From 8ae103e07ce2332918340463f419f7aad6528c55 Mon Sep 17 00:00:00 2001 From: Dale Hawkins Date: Mon, 16 Mar 2020 09:07:10 -0600 Subject: [PATCH 0001/1293] Fix documentation typo: tm_minute should be tm_min --- shared-bindings/time/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 8d7f2f3fd2..aa2f4fc6a5 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -107,7 +107,7 @@ mp_obj_t struct_time_make_new(const mp_obj_type_t *type, size_t n_args, const mp //| * ``tm_month``: the month, range [1, 12] //| * ``tm_mday``: the day of the month, range [1, 31] //| * ``tm_hour``: the hour, range [0, 23] -//| * ``tm_minute``: the minute, range [0, 59] +//| * ``tm_min``: the minute, range [0, 59] //| * ``tm_sec``: the second, range [0, 61] //| * ``tm_wday``: the day of the week, range [0, 6], Monday is 0 //| * ``tm_yday``: the day of the year, range [1, 366], -1 indicates not known From f572b723060382bbc9ca7a3edc88cb7c30fdcc30 Mon Sep 17 00:00:00 2001 From: AndrewR-L <59139513+AndrewR-L@users.noreply.github.com> Date: Fri, 17 Apr 2020 15:10:36 +0100 Subject: [PATCH 0002/1293] busio/UART: Correct and clarify readline() return. Surely readline() "rtype" is string not int as stated (and not bytes as some might expect). Also it is not totally unambiguous what happens on a timeout so it would help to clarify in docs that on a timeout it does NOT return with what it has read so far, rather it leaves all that in the buffer ready for a future read and returns nothing. Likewise clarify that if timeout=0 but there is no newline it DOES return what it has read so far (NOT None). At least this is what I think it does and/or is supposed to do! Python docs are generally not too explicit about what is the proper treatment, so perhaps all the more reason to clarify the interpretation adopted? --- shared-bindings/busio/UART.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 02c5afb16e..e4a6b93d9d 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -201,13 +201,15 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| :rtype: int or None (on a non-blocking error) //| //| *New in CircuitPython 4.0:* No length parameter is permitted. - +//| //| .. method:: readline() //| -//| Read a line, ending in a newline character. +//| Read a line, ending in a newline character, or +//| return None if a timeout occurs sooner, or +//| return everything readable if no newline is found and timeout=0 //| //| :return: the line read -//| :rtype: int or None +//| :rtype: str or None //| //| .. method:: write(buf) //| From 52b3e1faba958b351dc0bb040b2eee1fabb45007 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 14 May 2020 21:03:49 -0500 Subject: [PATCH 0003/1293] actions: upload artifacts for stubs & docs --- .github/workflows/build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4216f61392..de3aa5a9e1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,8 +66,16 @@ jobs: working-directory: tests - name: Stubs run: make stubs -j2 + - uses: actions/upload-artifact@v2 + with: + name: stubs + path: circuitpython-stubs* - name: Docs run: sphinx-build -E -W -b html . _build/html + - uses: actions/upload-artifact@v2 + with: + name: docs + path: _build/html - name: Translations run: make check-translate - name: New boards check From de0afcdf2dbdf1c22cb1f9fb5d4c5c3f8781ca45 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Wed, 27 May 2020 16:51:57 -0500 Subject: [PATCH 0004/1293] add ci_check_duplicate_usb_vid_pid.py; checks that a new board doesn't use duplicate USB VID/PID values unless explicitly whitelisted to do so --- tools/ci_check_duplicate_usb_vid_pid.py | 136 ++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 tools/ci_check_duplicate_usb_vid_pid.py diff --git a/tools/ci_check_duplicate_usb_vid_pid.py b/tools/ci_check_duplicate_usb_vid_pid.py new file mode 100644 index 0000000000..2890070db1 --- /dev/null +++ b/tools/ci_check_duplicate_usb_vid_pid.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python3 +# +# This file is part of the MicroPython project, http://micropython.org/ +# +# The MIT License (MIT) +# +# Copyright (c) 2020 Michael Schroeder +# +# 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. + +import argparse +import pathlib +import re +import sys + +DEFAULT_WHITELIST = [ + "circuitplayground_express", + "circuitplayground_express_crickit", + "circuitplayground_express_displayio", + "pycubed", + "pycubed_mram", + "pygamer", + "pygamer_advance", + "trinket_m0", + "trinket_m0_haxpress" +] + +cli_parser = argparse.ArgumentParser(description="USB VID/PID Duplicate Checker") +cli_parser.add_argument( + "--whitelist", + dest="whitelist", + nargs="?", + action="store", + default=DEFAULT_WHITELIST, + help=( + "Board names to ignore duplicate VID/PID combinations. Pass an empty " + "string to disable all duplicate ignoring. Defaults are: " + f"{', '.join(DEFAULT_WHITELIST)}" + ) +) + +def configboard_files(): + """ A pathlib glob search for all ports/*/boards/*/mpconfigboard.mk file + paths. + + :returns: A ``pathlib.Path.glob()`` genarator object + """ + working_dir = pathlib.Path().resolve() + if not working_dir.name.startswith("circuitpython"): + raise RuntimeError( + "Please run USB VID/PID duplicate verification at the " + "top-level directory." + ) + return working_dir.glob("ports/**/boards/**/mpconfigboard.mk") + +def check_vid_pid(files, whitelist): + """ Compiles a list of USB VID & PID values for all boards, and checks + for duplicates. Raises a `RuntimeError` if duplicates are found, and + lists the duplicates. + """ + + duplicates_found = False + + usb_ids = {} + + vid_pattern = re.compile(r"^USB_VID\s*\=\s*(.*)", flags=re.M) + pid_pattern = re.compile(r"^USB_PID\s*\=\s*(.*)", flags=re.M) + + for board_config in files: + src_text = board_config.read_text() + + usb_vid = vid_pattern.search(src_text) + usb_pid = pid_pattern.search(src_text) + + board_name = board_config.parts[-2] + + board_whitelisted = False + if board_name in whitelist: + board_whitelisted = True + board_name += " (whitelisted)" + + if usb_vid and usb_pid: + id_group = f"{usb_vid.group(1)}:{usb_pid.group(1)}" + if id_group not in usb_ids: + usb_ids[id_group] = { + "boards": [board_name], + "duplicate": False + } + else: + usb_ids[id_group]['boards'].append(board_name) + if not board_whitelisted: + usb_ids[id_group]['duplicate'] = True + duplicates_found = True + + if duplicates_found: + duplicates = "" + for key, value in usb_ids.items(): + if value["duplicate"]: + duplicates += ( + f"- VID/PID: {key}\n" + f" Boards: {', '.join(value['boards'])}\n" + ) + + duplicate_message = ( + f"Duplicate VID/PID usage found!\n{duplicates}" + ) + sys.exit(duplicate_message) + + +if __name__ == "__main__": + arguments = cli_parser.parse_args() + + print("Running USB VID/PID Duplicate Checker...") + print( + f"Ignoring the following boards: {', '.join(arguments.whitelist)}", + end="\n\n" + ) + + board_files = configboard_files() + check_vid_pid(board_files, arguments.whitelist) From 8e64b1240857340cd86d49a716ae5f542ab35e04 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Wed, 27 May 2020 16:54:52 -0500 Subject: [PATCH 0005/1293] build.yml: add step to run tools/ci_check_duplicate_usb_vid_pid.py --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0719b40e94..dead151423 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,6 +73,8 @@ jobs: - name: New boards check run: python3 -u ci_new_boards_check.py working-directory: tools + - name: Duplicate USB VID/PID Check + run: python3 -u -m tools.ci_check_duplicate_usb_vid_pid - name: Build mpy-cross.static-raspbian run: make -C mpy-cross -j2 -f Makefile.static-raspbian - uses: actions/upload-artifact@v1.0.0 From c7b6d35fd43ca192c3e7e95bf0a0f2ea0b0fc4a5 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Wed, 27 May 2020 19:08:56 -0500 Subject: [PATCH 0006/1293] ci_check_duplicate_usb_vid_pid.py: update docstring; moved to sys.exit from raising RuntimeError --- tools/ci_check_duplicate_usb_vid_pid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ci_check_duplicate_usb_vid_pid.py b/tools/ci_check_duplicate_usb_vid_pid.py index 2890070db1..505704f122 100644 --- a/tools/ci_check_duplicate_usb_vid_pid.py +++ b/tools/ci_check_duplicate_usb_vid_pid.py @@ -71,8 +71,8 @@ def configboard_files(): def check_vid_pid(files, whitelist): """ Compiles a list of USB VID & PID values for all boards, and checks - for duplicates. Raises a `RuntimeError` if duplicates are found, and - lists the duplicates. + for duplicates. Exits with ``sys.exit()`` (non-zero exit code) + if duplicates are found, and lists the duplicates. """ duplicates_found = False From eeb3825646453762b6e40f012cc3b9bbd9442d20 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 9 Jun 2020 13:04:42 -0700 Subject: [PATCH 0007/1293] Update precommit check branch --- .github/workflows/pre-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 116829296d..9663103046 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -7,7 +7,7 @@ name: pre-commit on: pull_request: push: - branches: [master] + branches: [main] jobs: pre-commit: From b414f82669ad2106d8705a485fcfde13ac5cf358 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 9 Jun 2020 18:01:52 -0400 Subject: [PATCH 0008/1293] Add DTCM and ITCM support to F7 series --- ports/stm/boards/STM32F746xG_fs.ld | 10 ++++++++-- ports/stm/boards/STM32F767_fs.ld | 11 +++++++++-- ports/stm/boards/nucleo_f746zg/mpconfigboard.h | 8 ++++++++ ports/stm/boards/nucleo_f746zg/mpconfigboard.mk | 2 +- ports/stm/boards/nucleo_f767zi/mpconfigboard.h | 8 ++++++++ ports/stm/boards/nucleo_f767zi/mpconfigboard.mk | 2 +- ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h | 8 ++++++++ ports/stm/supervisor/port.c | 14 +++++++------- 8 files changed, 50 insertions(+), 13 deletions(-) diff --git a/ports/stm/boards/STM32F746xG_fs.ld b/ports/stm/boards/STM32F746xG_fs.ld index 6c9ea4de31..7419c43d2e 100644 --- a/ports/stm/boards/STM32F746xG_fs.ld +++ b/ports/stm/boards/STM32F746xG_fs.ld @@ -26,6 +26,11 @@ * THE SOFTWARE. */ + /* Entry Point */ +ENTRY(Reset_Handler) + +_ld_default_stack_size = 24K; + /* Specify the memory areas */ MEMORY { @@ -33,7 +38,8 @@ MEMORY FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 32K /* sector 0 */ FLASH_FS (rx) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1,2,3 are 32K */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 896K /* sector 4 is 128K, sectors 5,6,7 are 256K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K + DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K + RAM (xrw) : ORIGIN = 0x20010000, LENGTH = 256K /* AXI SRAM */ ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 16K } @@ -44,7 +50,7 @@ _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just above last byte of RAM. Note that EABI requires the stack to be 8-byte aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); +_estack = ORIGIN(DTCM) + LENGTH(DTCM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); diff --git a/ports/stm/boards/STM32F767_fs.ld b/ports/stm/boards/STM32F767_fs.ld index 2feb422257..2ab73e907c 100644 --- a/ports/stm/boards/STM32F767_fs.ld +++ b/ports/stm/boards/STM32F767_fs.ld @@ -2,6 +2,11 @@ GNU linker script for STM32F767 with filesystem */ +/* Entry Point */ +ENTRY(Reset_Handler) + +_ld_default_stack_size = 24K; + /* Specify the memory areas */ MEMORY { @@ -9,7 +14,9 @@ MEMORY FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 32K /* sector 0 */ FLASH_FS (rx) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1,2,3 are 32K */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 1920K /* sector 4 is 128K, sectors 5,6,7 are 256K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K + DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + RAM (xrw) : ORIGIN = 0x20020000, LENGTH = 384K /* AXI SRAM */ + ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 16K } /* produce a link error if there is not this amount of RAM for these sections */ @@ -19,7 +26,7 @@ _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just above last byte of RAM. Note that EABI requires the stack to be 8-byte aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); +_estack = ORIGIN(DTCM) + LENGTH(DTCM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index c1f0d59b2d..e2b54335a5 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -33,6 +33,14 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) +// H7 and F7 MPU definitions +#define CPY_FLASH_REGION_SIZE ARM_MPU_REGION_SIZE_1MB +#define CPY_ITCM_REGION_SIZE ARM_MPU_REGION_SIZE_16KB +#define CPY_DTCM_REGION_SIZE ARM_MPU_REGION_SIZE_128KB +#define CPY_SRAM_REGION_SIZE ARM_MPU_REGION_SIZE_256KB +#define CPY_SRAM_SUBMASK 0x00 +#define CPY_SRAM_START_ADDR 0x20010000 + #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk index f23f642e7e..6e88e6d882 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk @@ -10,5 +10,5 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F746xx MCU_PACKAGE = LQFP144 -LD_COMMON = boards/common_default.ld +LLD_COMMON = boards/common_tcm.ld LD_FILE = boards/STM32F746xG_fs.ld diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h index 21e0ef0ba4..327651923a 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h @@ -32,6 +32,14 @@ #define FLASH_SIZE (0x200000) #define FLASH_PAGE_SIZE (0x4000) +// H7 and F7 MPU definitions +#define CPY_FLASH_REGION_SIZE ARM_MPU_REGION_SIZE_2MB +#define CPY_ITCM_REGION_SIZE ARM_MPU_REGION_SIZE_16KB +#define CPY_DTCM_REGION_SIZE ARM_MPU_REGION_SIZE_128KB +#define CPY_SRAM_REGION_SIZE ARM_MPU_REGION_SIZE_512KB +#define CPY_SRAM_SUBMASK 0xFC // Mask 512 to 384 +#define CPY_SRAM_START_ADDR 0x20020000 + #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk index 4e5e1bc7c8..c5d956b994 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk @@ -10,5 +10,5 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F767xx MCU_PACKAGE = LQFP144 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_tcm.ld LD_FILE = boards/STM32F767_fs.ld diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h index 1ae7f81a47..2ac986701e 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h @@ -31,6 +31,14 @@ #define FLASH_PAGE_SIZE (0x4000) +// H7 and F7 MPU definitions +#define CPY_FLASH_REGION_SIZE ARM_MPU_REGION_SIZE_2MB +#define CPY_ITCM_REGION_SIZE ARM_MPU_REGION_SIZE_64KB +#define CPY_DTCM_REGION_SIZE ARM_MPU_REGION_SIZE_128KB +#define CPY_SRAM_REGION_SIZE ARM_MPU_REGION_SIZE_512KB +#define CPY_SRAM_SUBMASK 0x00 +#define CPY_SRAM_START_ADDR 0x24000000 + #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 25504ddece..713803d55d 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -49,7 +49,7 @@ #include STM32_HAL_H //only enable the Reset Handler overwrite for the H7 for now -#if (CPY_STM32H7) +#if (CPY_STM32H7) || (CPY_STM32F7) // Device memories must be accessed in order. #define DEVICE 2 @@ -86,7 +86,7 @@ extern uint32_t _ld_itcm_flash_copy; extern void main(void); extern void SystemInit(void); -// This replaces the Reset_Handler in startup_*.S and SystemInit in system_*.c. +// This replaces the Reset_Handler in gcc/startup_*.s, calls SystemInit from system_*.c __attribute__((used, naked)) void Reset_Handler(void) { __disable_irq(); __set_MSP((uint32_t) &_ld_stack_top); @@ -105,20 +105,20 @@ __attribute__((used, naked)) void Reset_Handler(void) { // Mark all the flash the same until instructed otherwise. MPU->RBAR = ARM_MPU_RBAR(11, 0x08000000U); - MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_2MB); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, CPY_FLASH_REGION_SIZE); // This the ITCM. Set it to read-only because we've loaded everything already and it's easy to // accidentally write the wrong value to 0x00000000 (aka NULL). MPU->RBAR = ARM_MPU_RBAR(12, 0x00000000U); - MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_RO, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_64KB); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_RO, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, CPY_ITCM_REGION_SIZE); // This the DTCM. MPU->RBAR = ARM_MPU_RBAR(14, 0x20000000U); - MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_128KB); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, CPY_DTCM_REGION_SIZE); // This is AXI SRAM (D1). - MPU->RBAR = ARM_MPU_RBAR(15, 0x24000000U); - MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_512KB); + MPU->RBAR = ARM_MPU_RBAR(15, CPY_SRAM_START_ADDR); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, CPY_SRAM_SUBMASK, CPY_SRAM_REGION_SIZE); /* Enable MPU */ ARM_MPU_Enable(MPU_CTRL_PRIVDEFENA_Msk); From 7cc8b784c36d1fc01867a00c9a6e40353eedc599 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 10 Jun 2020 09:49:35 -0400 Subject: [PATCH 0009/1293] Add missing openmv definitions --- ports/stm/boards/nucleo_f746zg/mpconfigboard.mk | 2 +- ports/stm/boards/openmv_h7/mpconfigboard.h | 8 ++++++++ ports/stm/boards/stm32f746g_discovery/mpconfigboard.h | 8 ++++++++ ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk index 6e88e6d882..651f3c2292 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk @@ -10,5 +10,5 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F746xx MCU_PACKAGE = LQFP144 -LLD_COMMON = boards/common_tcm.ld +LD_COMMON = boards/common_tcm.ld LD_FILE = boards/STM32F746xG_fs.ld diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.h b/ports/stm/boards/openmv_h7/mpconfigboard.h index cf9d6e7d14..77ae235ecf 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.h +++ b/ports/stm/boards/openmv_h7/mpconfigboard.h @@ -31,5 +31,13 @@ #define FLASH_PAGE_SIZE (0x4000) +// H7 and F7 MPU definitions +#define CPY_FLASH_REGION_SIZE ARM_MPU_REGION_SIZE_2MB +#define CPY_ITCM_REGION_SIZE ARM_MPU_REGION_SIZE_64KB +#define CPY_DTCM_REGION_SIZE ARM_MPU_REGION_SIZE_128KB +#define CPY_SRAM_REGION_SIZE ARM_MPU_REGION_SIZE_512KB +#define CPY_SRAM_SUBMASK 0x00 +#define CPY_SRAM_START_ADDR 0x24000000 + #define HSE_VALUE ((uint32_t)12000000) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index 1fa69182a6..769990a98c 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -34,6 +34,14 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) +// H7 and F7 MPU definitions +#define CPY_FLASH_REGION_SIZE ARM_MPU_REGION_SIZE_1MB +#define CPY_ITCM_REGION_SIZE ARM_MPU_REGION_SIZE_16KB +#define CPY_DTCM_REGION_SIZE ARM_MPU_REGION_SIZE_128KB +#define CPY_SRAM_REGION_SIZE ARM_MPU_REGION_SIZE_256KB +#define CPY_SRAM_SUBMASK 0x00 +#define CPY_SRAM_START_ADDR 0x20010000 + // Lower frequency to allow external RAM use #define HSE_VALUE ((uint32_t)25000000) #define LSE_VALUE ((uint32_t)32768) diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk index ff8456df66..94a50853cb 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk @@ -10,5 +10,5 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F746xx MCU_PACKAGE = TFBGA216 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_tcm.ld LD_FILE = boards/STM32F746xG_fs.ld From c88a8e66c6552294671e4282bdaa52d97c6e6c2c Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 10 Jun 2020 13:22:21 -0400 Subject: [PATCH 0010/1293] Minor comment fix --- ports/stm/supervisor/port.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 713803d55d..07a93c025b 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -48,7 +48,6 @@ #include STM32_HAL_H -//only enable the Reset Handler overwrite for the H7 for now #if (CPY_STM32H7) || (CPY_STM32F7) // Device memories must be accessed in order. From c08702414e410769de3d4821aa07f419c9ef7508 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 10 Jun 2020 16:36:44 -0400 Subject: [PATCH 0011/1293] Add macros for setting correct F7 and H7 I2C timing --- ports/stm/boards/nucleo_f746zg/mpconfigboard.h | 4 ++++ ports/stm/boards/nucleo_f767zi/mpconfigboard.h | 4 ++++ ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h | 6 ++++++ ports/stm/boards/openmv_h7/mpconfigboard.h | 4 ++++ ports/stm/boards/stm32f746g_discovery/mpconfigboard.h | 4 ++++ ports/stm/common-hal/busio/I2C.c | 8 +++++++- 6 files changed, 29 insertions(+), 1 deletion(-) diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index e2b54335a5..13ec369bf3 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -46,5 +46,9 @@ #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x6000030D +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 + #define DEBUG_UART_TX (&pin_PD08) #define DEBUG_UART_RX (&pin_PD09) diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h index 327651923a..b08a0062e2 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h @@ -40,6 +40,10 @@ #define CPY_SRAM_SUBMASK 0xFC // Mask 512 to 384 #define CPY_SRAM_START_ADDR 0x20020000 +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x6000030D +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 + #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h index 2ac986701e..15186e89d6 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h @@ -39,6 +39,12 @@ #define CPY_SRAM_SUBMASK 0x00 #define CPY_SRAM_START_ADDR 0x24000000 +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x00B03FDB +#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 + + + #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.h b/ports/stm/boards/openmv_h7/mpconfigboard.h index 77ae235ecf..2f61e24213 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.h +++ b/ports/stm/boards/openmv_h7/mpconfigboard.h @@ -39,5 +39,9 @@ #define CPY_SRAM_SUBMASK 0x00 #define CPY_SRAM_START_ADDR 0x24000000 +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x00B03FDB +#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 + #define HSE_VALUE ((uint32_t)12000000) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index 769990a98c..35a28ca3d1 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -50,6 +50,10 @@ #define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_6) #define CPY_CLK_USB_USES_AUDIOPLL (1) +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x00401959 +#define CPY_I2CSTANDARD_TIMINGR 0x00C0EAFF + #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 48c4c1933a..01d0703ca1 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -120,7 +120,13 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, // Handle the HAL handle differences #if (CPY_STM32H7 || CPY_STM32F7) - self->handle.Init.Timing = 0x40604E73; //Taken from STCube examples + if (frequency == 400000) { + self->handle.Init.Timing = CPY_I2CFAST_TIMINGR; + } else if (frequency == 100000) { + self->handle.Init.Timing = CPY_I2CSTANDARD_TIMINGR; + } else { + mp_raise_ValueError(translate("MCU supports only I2C Standard and Fast modes")); + } #else self->handle.Init.ClockSpeed = frequency; self->handle.Init.DutyCycle = I2C_DUTYCYCLE_2; From 058c16e98c4036c8a53547062f513a0d74eb90c4 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Wed, 10 Jun 2020 17:11:28 -0500 Subject: [PATCH 0012/1293] Issue #3014 - refresh after changing to transparent Adding self->needs_refresh = true; in common_hal_displayio_palette_make_opaque() and common_hal_displayio_palette_make_transparent() --- shared-module/displayio/Palette.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared-module/displayio/Palette.c b/shared-module/displayio/Palette.c index 1ef03aab44..facb1fa732 100644 --- a/shared-module/displayio/Palette.c +++ b/shared-module/displayio/Palette.c @@ -35,10 +35,12 @@ void common_hal_displayio_palette_construct(displayio_palette_t* self, uint16_t void common_hal_displayio_palette_make_opaque(displayio_palette_t* self, uint32_t palette_index) { self->colors[palette_index].transparent = false; + self->needs_refresh = true; } void common_hal_displayio_palette_make_transparent(displayio_palette_t* self, uint32_t palette_index) { self->colors[palette_index].transparent = true; + self->needs_refresh = true; } uint32_t common_hal_displayio_palette_get_len(displayio_palette_t* self) { From 724637faa3b96b20f4deed32d58dcb7b50672479 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 11 Jun 2020 11:17:51 -0400 Subject: [PATCH 0013/1293] Move I2C speed to clock-style definition --- .../stm/boards/nucleo_f746zg/mpconfigboard.h | 4 --- .../stm/boards/nucleo_f767zi/mpconfigboard.h | 4 --- .../boards/nucleo_h743zi_2/mpconfigboard.h | 6 ---- ports/stm/boards/openmv_h7/mpconfigboard.h | 4 --- ports/stm/common-hal/busio/I2C.c | 3 +- ports/stm/peripherals/clocks.h | 30 +++++++++++++++++++ .../peripherals/stm32f7/stm32f746xx/clocks.h | 8 +++++ .../peripherals/stm32f7/stm32f767xx/clocks.h | 8 +++++ .../peripherals/stm32h7/stm32h743xx/clocks.h | 8 +++++ 9 files changed, 56 insertions(+), 19 deletions(-) diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index 13ec369bf3..e2b54335a5 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -46,9 +46,5 @@ #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x6000030D -#define CPY_I2CSTANDARD_TIMINGR 0x20404768 - #define DEBUG_UART_TX (&pin_PD08) #define DEBUG_UART_RX (&pin_PD09) diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h index b08a0062e2..327651923a 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h @@ -40,10 +40,6 @@ #define CPY_SRAM_SUBMASK 0xFC // Mask 512 to 384 #define CPY_SRAM_START_ADDR 0x20020000 -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x6000030D -#define CPY_I2CSTANDARD_TIMINGR 0x20404768 - #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h index 15186e89d6..2ac986701e 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h @@ -39,12 +39,6 @@ #define CPY_SRAM_SUBMASK 0x00 #define CPY_SRAM_START_ADDR 0x24000000 -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x00B03FDB -#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 - - - #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.h b/ports/stm/boards/openmv_h7/mpconfigboard.h index 2f61e24213..77ae235ecf 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.h +++ b/ports/stm/boards/openmv_h7/mpconfigboard.h @@ -39,9 +39,5 @@ #define CPY_SRAM_SUBMASK 0x00 #define CPY_SRAM_START_ADDR 0x24000000 -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x00B03FDB -#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 - #define HSE_VALUE ((uint32_t)12000000) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 01d0703ca1..00f15aaa60 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -33,6 +33,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "supervisor/shared/translate.h" #include "common-hal/microcontroller/Pin.h" +#include "clocks.h" // Arrays use 0 based numbering: I2C1 is stored at index 0 #define MAX_I2C 4 @@ -125,7 +126,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, } else if (frequency == 100000) { self->handle.Init.Timing = CPY_I2CSTANDARD_TIMINGR; } else { - mp_raise_ValueError(translate("MCU supports only I2C Standard and Fast modes")); + mp_raise_ValueError(translate("Unsupported baudrate")); } #else self->handle.Init.ClockSpeed = frequency; diff --git a/ports/stm/peripherals/clocks.h b/ports/stm/peripherals/clocks.h index 1f837c79ee..192190e5ee 100644 --- a/ports/stm/peripherals/clocks.h +++ b/ports/stm/peripherals/clocks.h @@ -24,4 +24,34 @@ * THE SOFTWARE. */ +// F4 Series +#ifdef STM32F401xE +#include "stm32f4/stm32f401xe/clocks.h" +#endif +#ifdef STM32F411xE +#include "stm32f4/stm32f411xe/clocks.h" +#endif +#ifdef STM32F412Zx +#include "stm32f4/stm32f412zx/clocks.h" +#endif +#ifdef STM32F405xx +#include "stm32f4/stm32f405xx/clocks.h" +#endif +#ifdef STM32F407xx +#include "stm32f4/stm32f407xx/clocks.h" +#endif + +// F7 Series +#ifdef STM32F746xx +#include "stm32f7/stm32f746xx/clocks.h" +#endif +#ifdef STM32F767xx +#include "stm32f7/stm32f767xx/clocks.h" +#endif + +// H7 Series +#ifdef STM32H743xx +#include "stm32h7/stm32h743xx/clocks.h" +#endif + void stm32_peripherals_clocks_init(void); diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h index eb44625143..bd53c38cd9 100644 --- a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h @@ -61,3 +61,11 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif + +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x6000030D +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 +#endif diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h index 187a024ad0..a89756db05 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h @@ -61,3 +61,11 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif + +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x6000030D +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 +#endif diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h index ad241b7ef6..e7c5170966 100644 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h @@ -68,3 +68,11 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif + +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x00B03FDB +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 +#endif From 3c3cad5ae6f050150931373e1472098671779973 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 11:11:44 -0500 Subject: [PATCH 0014/1293] docs: Improve 5.0.x <-> main branch doc linkrot This improves, but does not entirely fix, the broken links that result from the autoapi change. It fixes module-level links, but class links still do not work (e.g., /shared-bindings/displayio/Palette.html (5.0.x) is now just /shared-bindings/displayio/#displayio.Palette). --- .gitignore | 1 + conf.py | 1 + ports/atmel-samd/README.rst | 2 +- shared-bindings/index.rst | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f5edb89f0e..8a773970d3 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,7 @@ _build ###################### genrst/ /autoapi/ +/shared-bindings/**/*.rst # ctags and similar ################### diff --git a/conf.py b/conf.py index 3980ea8e1b..06aab271b2 100644 --- a/conf.py +++ b/conf.py @@ -79,6 +79,7 @@ autoapi_add_toctree_entry = False autoapi_options = ['members', 'undoc-members', 'private-members', 'show-inheritance', 'special-members', 'show-module-summary'] autoapi_template_dir = 'docs/autoapi/templates' autoapi_python_use_implicit_namespaces = True +autoapi_root = "shared-bindings" # The encoding of source files. #source_encoding = 'utf-8-sig' diff --git a/ports/atmel-samd/README.rst b/ports/atmel-samd/README.rst index a6881902e9..0746d1de06 100644 --- a/ports/atmel-samd/README.rst +++ b/ports/atmel-samd/README.rst @@ -21,4 +21,4 @@ Port Specific modules --------------------- .. toctree:: - ../../autoapi/samd/index + ../../shared-bindings/samd/index diff --git a/shared-bindings/index.rst b/shared-bindings/index.rst index d941773943..bf04ae18b1 100644 --- a/shared-bindings/index.rst +++ b/shared-bindings/index.rst @@ -19,5 +19,5 @@ Modules :glob: :maxdepth: 2 - ../autoapi/*/index + ../shared-bindings/*/index help From f83b0c2507611a95ab4dea0c87b25ba85a0de9d6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 12:56:22 -0500 Subject: [PATCH 0015/1293] docs: conf.py: alphabetize imports --- conf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conf.py b/conf.py index 06aab271b2..99423841b8 100644 --- a/conf.py +++ b/conf.py @@ -14,11 +14,12 @@ # serve to show the default. import json -import sys import os +import subprocess +import sys +import urllib.parse import recommonmark -import subprocess # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the From cb8539b06dd4bce11207341a311bffca741d190c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 13:04:21 -0500 Subject: [PATCH 0016/1293] docs: Generate redirects for autoapi renaming --- conf.py | 45 ++++++++++++++++++++++ docs/redirects.txt | 94 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100644 docs/redirects.txt diff --git a/conf.py b/conf.py index 99423841b8..d39f74bd7d 100644 --- a/conf.py +++ b/conf.py @@ -14,6 +14,7 @@ # serve to show the default. import json +import logging import os import subprocess import sys @@ -82,6 +83,8 @@ autoapi_template_dir = 'docs/autoapi/templates' autoapi_python_use_implicit_namespaces = True autoapi_root = "shared-bindings" +redirects_file = 'docs/redirects.txt' + # The encoding of source files. #source_encoding = 'utf-8-sig' @@ -376,5 +379,47 @@ intersphinx_mapping = {"cpython": ('https://docs.python.org/3/', None), "bus_device": ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None), "register": ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None)} +# Adapted from sphinxcontrib-redirects +from sphinx.builders import html as builders + +TEMPLATE = """ + + +""" + + +def generate_redirects(app): + path = os.path.join(app.srcdir, app.config.redirects_file) + if not os.path.exists(path): + app.info("Could not find redirects file at '%s'" % path) + return + + # TODO(stephenfin): Add support for DirectoryHTMLBuilder + if not type(app.builder) == builders.StandaloneHTMLBuilder: + logging.warn("The 'sphinxcontib-redirects' plugin is only supported " + "by the 'html' builder. Skipping...") + return + + with open(path) as redirects: + for line in redirects.readlines(): + from_path, to_path = line.rstrip().split(' ') + + logging.debug("Redirecting '%s' to '%s'" % (from_path, to_path)) + + from_path = os.path.splitext(from_path)[0] + ".html" + to_path_prefix = '..%s' % os.path.sep * ( + len(from_path.split(os.path.sep)) - 1) + to_path = to_path_prefix + to_path + + redirected_filename = os.path.join(app.builder.outdir, from_path) + redirected_directory = os.path.dirname(redirected_filename) + if not os.path.exists(redirected_directory): + os.makedirs(redirected_directory) + + with open(redirected_filename, 'w') as f: + f.write(TEMPLATE % urllib.parse.quote(to_path, '#/')) + def setup(app): app.add_css_file("customstyle.css") + app.add_config_value('redirects_file', 'redirects', 'env') + app.connect('builder-inited', generate_redirects) diff --git a/docs/redirects.txt b/docs/redirects.txt new file mode 100644 index 0000000000..68d0b2de2e --- /dev/null +++ b/docs/redirects.txt @@ -0,0 +1,94 @@ +shared-bindings/frequencyio/FrequencyIn.rst shared-bindings/frequencyio/#frequencyio.FrequencyIn +shared-bindings/fontio/BuiltinFont.rst shared-bindings/fontio/#fontio.BuiltinFont +shared-bindings/fontio/Glyph.rst shared-bindings/fontio/#fontio.Glyph +shared-bindings/aesio/AES.rst shared-bindings/aesio/#aesio.AES +shared-bindings/supervisor/Runtime.rst shared-bindings/supervisor/#supervisor.Runtime +shared-bindings/terminalio/Terminal.rst shared-bindings/terminalio/#terminalio.Terminal +shared-bindings/audiopwmio/PWMAudioOut.rst shared-bindings/audiopwmio/#audiopwmio.PWMAudioOut +shared-bindings/gamepadshift/GamePadShift.rst shared-bindings/gamepadshift/#gamepadshift.GamePadShift +shared-bindings/vectorio/Circle.rst shared-bindings/vectorio/#vectorio.Circle +shared-bindings/vectorio/Polygon.rst shared-bindings/vectorio/#vectorio.Polygon +shared-bindings/vectorio/Rectangle.rst shared-bindings/vectorio/#vectorio.Rectangle +shared-bindings/vectorio/VectorShape.rst shared-bindings/vectorio/#vectorio.VectorShape +shared-bindings/displayio/Bitmap.rst shared-bindings/displayio/#displayio.Bitmap +shared-bindings/displayio/ColorConverter.rst shared-bindings/displayio/#displayio.ColorConverter +shared-bindings/displayio/Display.rst shared-bindings/displayio/#displayio.Display +shared-bindings/displayio/EPaperDisplay.rst shared-bindings/displayio/#displayio.EPaperDisplay +shared-bindings/displayio/FourWire.rst shared-bindings/displayio/#displayio.FourWire +shared-bindings/displayio/Group.rst shared-bindings/displayio/#displayio.Group +shared-bindings/displayio/I2CDisplay.rst shared-bindings/displayio/#displayio.I2CDisplay +shared-bindings/displayio/OnDiskBitmap.rst shared-bindings/displayio/#displayio.OnDiskBitmap +shared-bindings/displayio/Palette.rst shared-bindings/displayio/#displayio.Palette +shared-bindings/displayio/ParallelBus.rst shared-bindings/displayio/#displayio.ParallelBus +shared-bindings/displayio/Shape.rst shared-bindings/displayio/#displayio.Shape +shared-bindings/displayio/TileGrid.rst shared-bindings/displayio/#displayio.TileGrid +shared-bindings/_pixelbuf/PixelBuf.rst shared-bindings/_pixelbuf/#_pixelbuf.PixelBuf +shared-bindings/gamepad/GamePad.rst shared-bindings/gamepad/#gamepad.GamePad +shared-bindings/_pew/PewPew.rst shared-bindings/_pew/#_pew.PewPew +shared-bindings/rotaryio/IncrementalEncoder.rst shared-bindings/rotaryio/#rotaryio.IncrementalEncoder +shared-bindings/audiomixer/Mixer.rst shared-bindings/audiomixer/#audiomixer.Mixer +shared-bindings/audiomixer/MixerVoice.rst shared-bindings/audiomixer/#audiomixer.MixerVoice +shared-bindings/pulseio/PWMOut.rst shared-bindings/pulseio/#pulseio.PWMOut +shared-bindings/pulseio/PulseIn.rst shared-bindings/pulseio/#pulseio.PulseIn +shared-bindings/pulseio/PulseOut.rst shared-bindings/pulseio/#pulseio.PulseOut +shared-bindings/time/struct_time.rst shared-bindings/time/#time.struct_time +shared-bindings/i2cslave/I2CSlave.rst shared-bindings/i2cslave/#i2cslave.I2CSlave +shared-bindings/i2cslave/I2CSlaveRequest.rst shared-bindings/i2cslave/#i2cslave.I2CSlaveRequest +shared-bindings/nvm/ByteArray.rst shared-bindings/nvm/#nvm.ByteArray +shared-bindings/busio/I2C.rst shared-bindings/busio/#busio.I2C +shared-bindings/busio/OneWire.rst shared-bindings/busio/#busio.OneWire +shared-bindings/busio/SPI.rst shared-bindings/busio/#busio.SPI +shared-bindings/busio/UART.rst shared-bindings/busio/#busio.UART +shared-bindings/busio/Parity.rst shared-bindings/busio/#busio.Parity +shared-bindings/ulab/array.rst shared-bindings/ulab/#ulab.array +shared-bindings/watchdog/WatchDogMode.rst shared-bindings/watchdog/#watchdog.WatchDogMode +shared-bindings/watchdog/WatchDogTimer.rst shared-bindings/watchdog/#watchdog.WatchDogTimer +shared-bindings/audioio/AudioOut.rst shared-bindings/audioio/#audioio.AudioOut +shared-bindings/ps2io/Ps2.rst shared-bindings/ps2io/#ps2io.Ps2 +shared-bindings/touchio/TouchIn.rst shared-bindings/touchio/#touchio.TouchIn +shared-bindings/rgbmatrix/RGBMatrix.rst shared-bindings/rgbmatrix/#rgbmatrix.RGBMatrix +shared-bindings/audiomp3/MP3.rst shared-bindings/audiomp3/#audiomp3.MP3 +shared-bindings/usb_midi/PortIn.rst shared-bindings/usb_midi/#usb_midi.PortIn +shared-bindings/usb_midi/PortOut.rst shared-bindings/usb_midi/#usb_midi.PortOut +shared-bindings/usb_hid/Device.rst shared-bindings/usb_hid/#usb_hid.Device +shared-bindings/wiznet/WIZNET5K.rst shared-bindings/wiznet/#wiznet.WIZNET5K +shared-bindings/_bleio/BluetoothError.rst shared-bindings/_bleio/#_bleio.BluetoothError +shared-bindings/_bleio/ConnectionError.rst shared-bindings/_bleio/#_bleio.ConnectionError +shared-bindings/_bleio/RoleError.rst shared-bindings/_bleio/#_bleio.RoleError +shared-bindings/_bleio/SecurityError.rst shared-bindings/_bleio/#_bleio.SecurityError +shared-bindings/_bleio/Adapter.rst shared-bindings/_bleio/#_bleio.Adapter +shared-bindings/_bleio/Address.rst shared-bindings/_bleio/#_bleio.Address +shared-bindings/_bleio/Attribute.rst shared-bindings/_bleio/#_bleio.Attribute +shared-bindings/_bleio/Characteristic.rst shared-bindings/_bleio/#_bleio.Characteristic +shared-bindings/_bleio/CharacteristicBuffer.rst shared-bindings/_bleio/#_bleio.CharacteristicBuffer +shared-bindings/_bleio/Connection.rst shared-bindings/_bleio/#_bleio.Connection +shared-bindings/_bleio/Descriptor.rst shared-bindings/_bleio/#_bleio.Descriptor +shared-bindings/_bleio/PacketBuffer.rst shared-bindings/_bleio/#_bleio.PacketBuffer +shared-bindings/_bleio/ScanEntry.rst shared-bindings/_bleio/#_bleio.ScanEntry +shared-bindings/_bleio/ScanResults.rst shared-bindings/_bleio/#_bleio.ScanResults +shared-bindings/_bleio/Service.rst shared-bindings/_bleio/#_bleio.Service +shared-bindings/_bleio/UUID.rst shared-bindings/_bleio/#_bleio.UUID +shared-bindings/socket/socket.rst shared-bindings/socket/#socket.socket +shared-bindings/microcontroller/Pin.rst shared-bindings/microcontroller/#microcontroller.Pin +shared-bindings/microcontroller/Processor.rst shared-bindings/microcontroller/#microcontroller.Processor +shared-bindings/microcontroller/RunMode.rst shared-bindings/microcontroller/#microcontroller.RunMode +shared-bindings/audiocore/RawSample.rst shared-bindings/audiocore/#audiocore.RawSample +shared-bindings/audiocore/WaveFile.rst shared-bindings/audiocore/#audiocore.WaveFile +shared-bindings/framebufferio/FramebufferDisplay.rst shared-bindings/framebufferio/#framebufferio.FramebufferDisplay +shared-bindings/audiobusio/I2SOut.rst shared-bindings/audiobusio/#audiobusio.I2SOut +shared-bindings/audiobusio/PDMIn.rst shared-bindings/audiobusio/#audiobusio.PDMIn +shared-bindings/countio/Counter.rst shared-bindings/countio/#countio.Counter +shared-bindings/storage/VfsFat.rst shared-bindings/storage/#storage.VfsFat +shared-bindings/digitalio/DigitalInOut.rst shared-bindings/digitalio/#digitalio.DigitalInOut +shared-bindings/digitalio/Direction.rst shared-bindings/digitalio/#digitalio.Direction +shared-bindings/digitalio/DriveMode.rst shared-bindings/digitalio/#digitalio.DriveMode +shared-bindings/digitalio/Pull.rst shared-bindings/digitalio/#digitalio.Pull +shared-bindings/bitbangio/I2C.rst shared-bindings/bitbangio/#bitbangio.I2C +shared-bindings/bitbangio/OneWire.rst shared-bindings/bitbangio/#bitbangio.OneWire +shared-bindings/bitbangio/SPI.rst shared-bindings/bitbangio/#bitbangio.SPI +shared-bindings/rtc/RTC.rst shared-bindings/rtc/#rtc.RTC +shared-bindings/analogio/AnalogIn.rst shared-bindings/analogio/#analogio.AnalogIn +shared-bindings/analogio/AnalogOut.rst shared-bindings/analogio/#analogio.AnalogOut +shared-bindings/_stage/Layer.rst shared-bindings/_stage/#_stage.Layer +shared-bindings/_stage/Text.rst shared-bindings/_stage/#_stage.Text +shared-bindings/samd/Clock.rst shared-bindings/samd/#samd.Clock From 32a29ffdff4f757b818be9d63df44366a9ea389c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 13:04:58 -0500 Subject: [PATCH 0017/1293] shared-bindings: Change docstrings with '\x...' chars to raw strings Closes: #3032 --- shared-bindings/_bleio/Address.c | 2 +- shared-bindings/displayio/Display.c | 2 +- shared-bindings/displayio/Palette.c | 2 +- shared-bindings/nvm/ByteArray.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c index ccbab1b9d2..9beaff2ab2 100644 --- a/shared-bindings/_bleio/Address.c +++ b/shared-bindings/_bleio/Address.c @@ -78,7 +78,7 @@ STATIC mp_obj_t bleio_address_make_new(const mp_obj_type_t *type, size_t n_args, } //| address_bytes: Any = ... -//| """The bytes that make up the device address (read-only). +//| r"""The bytes that make up the device address (read-only). //| //| Note that the ``bytes`` object returned is in little-endian order: //| The least significant byte is ``address_bytes[0]``. So the address will diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 62ef0f5d00..6e454f34bd 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -50,7 +50,7 @@ //| contain the initialization sequence at minimum.""" //| //| def __init__(self, display_bus: Any, init_sequence: buffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: microcontroller.Pin = None, brightness_command: int = None, brightness: bool = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60): -//| """Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). +//| r"""Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). //| //| The ``init_sequence`` is bitpacked to minimize the ram impact. Every command begins with a //| command byte followed by a byte to determine the parameter count and if a delay is need after. diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c index 871b2b06af..37cfbd82e9 100644 --- a/shared-bindings/displayio/Palette.c +++ b/shared-bindings/displayio/Palette.c @@ -85,7 +85,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } //| def __setitem__(self, index: Any, value: Any) -> Any: -//| """Sets the pixel color at the given index. The index should be an integer in the range 0 to color_count-1. +//| r"""Sets the pixel color at the given index. The index should be an integer in the range 0 to color_count-1. //| //| The value argument represents a color, and can be from 0x000000 to 0xFFFFFF (to represent an RGB value). //| Value can be an int, bytes (3 bytes (RGB) or 4 bytes (RGB + pad byte)), bytearray, diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c index 326f719a83..06d7d4c95b 100644 --- a/shared-bindings/nvm/ByteArray.c +++ b/shared-bindings/nvm/ByteArray.c @@ -32,7 +32,7 @@ #include "supervisor/shared/translate.h" //| class ByteArray: -//| """Presents a stretch of non-volatile memory as a bytearray. +//| r"""Presents a stretch of non-volatile memory as a bytearray. //| //| Non-volatile memory is available as a byte array that persists over reloads //| and power cycles. Each assignment causes an erase and write cycle so its recommended to assign From 03c04e77ae5f94750408009cfa91f06b96a5898d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 18:54:05 -0500 Subject: [PATCH 0018/1293] actions: Try checkout v2.2.0 This version is supposed to > Fetch all history for all tags and branches when fetch-depth=0 We leave the tags fetch in place so that actions _in cloned repos_ work. Cloned repos' tags do not necessarily match adafruit/circuitpython, but we want version reporting to be able to use adafruit/circuitpython tags when they are most relevant according to "git describe"'s heuristics. Submodules are different, as they always point to the repo specified in .gitmodules, so they don't need special handling to get the most relevant tags. --- .github/workflows/build.yml | 25 +++++-------------------- .github/workflows/create_website_pr.yml | 3 +-- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00454cc2da..ae73b3a655 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,14 +16,11 @@ jobs: env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: CircuitPython version run: git describe --dirty --tags - name: Set up Python 3.8 @@ -110,14 +107,11 @@ jobs: gcc --version python3 --version msgfmt --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: CircuitPython version run: git describe --dirty --tags - name: Build mpy-cross @@ -286,14 +280,11 @@ jobs: gcc --version arm-none-eabi-gcc --version python3 --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: mpy-cross run: make -C mpy-cross -j2 - name: build @@ -337,14 +328,11 @@ jobs: gcc --version riscv64-unknown-elf-gcc --version python3 --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: mpy-cross run: make -C mpy-cross -j2 - name: build @@ -377,14 +365,11 @@ jobs: uses: actions/setup-python@v1 with: python-version: 3.8 - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: CircuitPython version run: git describe --dirty --tags - uses: actions/cache@v1 diff --git a/.github/workflows/create_website_pr.yml b/.github/workflows/create_website_pr.yml index 79a6c68a75..9907c08ae6 100644 --- a/.github/workflows/create_website_pr.yml +++ b/.github/workflows/create_website_pr.yml @@ -23,12 +23,11 @@ jobs: run: | gcc --version python3 --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: CircuitPython version run: git describe --dirty --tags - name: Website From 2aac3cbdceffbeb1d70ac9de1412a29335f18158 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 15 Jun 2020 13:51:09 -0400 Subject: [PATCH 0019/1293] Revert I2C timing overrides, reduce scope to module only --- .../stm32f746g_discovery/mpconfigboard.h | 4 --- ports/stm/common-hal/busio/I2C.c | 19 +++++++++++- ports/stm/peripherals/clocks.h | 30 ------------------- .../peripherals/stm32f7/stm32f746xx/clocks.h | 8 ----- .../peripherals/stm32f7/stm32f767xx/clocks.h | 8 ----- .../peripherals/stm32h7/stm32h743xx/clocks.h | 8 ----- 6 files changed, 18 insertions(+), 59 deletions(-) diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index 35a28ca3d1..769990a98c 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -50,10 +50,6 @@ #define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_6) #define CPY_CLK_USB_USES_AUDIOPLL (1) -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x00401959 -#define CPY_I2CSTANDARD_TIMINGR 0x00C0EAFF - #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 00f15aaa60..6adcf55750 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -33,7 +33,24 @@ #include "shared-bindings/microcontroller/__init__.h" #include "supervisor/shared/translate.h" #include "common-hal/microcontroller/Pin.h" -#include "clocks.h" + +// I2C timing specs for the H7 and F7 +// Configured for maximum possible clock settings for the family +#if (CPY_STM32F7) +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x6000030D +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 +#endif +#elif (CPY_STM32H7) +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x00B03FDB +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 +#endif +#endif // Arrays use 0 based numbering: I2C1 is stored at index 0 #define MAX_I2C 4 diff --git a/ports/stm/peripherals/clocks.h b/ports/stm/peripherals/clocks.h index 192190e5ee..1f837c79ee 100644 --- a/ports/stm/peripherals/clocks.h +++ b/ports/stm/peripherals/clocks.h @@ -24,34 +24,4 @@ * THE SOFTWARE. */ -// F4 Series -#ifdef STM32F401xE -#include "stm32f4/stm32f401xe/clocks.h" -#endif -#ifdef STM32F411xE -#include "stm32f4/stm32f411xe/clocks.h" -#endif -#ifdef STM32F412Zx -#include "stm32f4/stm32f412zx/clocks.h" -#endif -#ifdef STM32F405xx -#include "stm32f4/stm32f405xx/clocks.h" -#endif -#ifdef STM32F407xx -#include "stm32f4/stm32f407xx/clocks.h" -#endif - -// F7 Series -#ifdef STM32F746xx -#include "stm32f7/stm32f746xx/clocks.h" -#endif -#ifdef STM32F767xx -#include "stm32f7/stm32f767xx/clocks.h" -#endif - -// H7 Series -#ifdef STM32H743xx -#include "stm32h7/stm32h743xx/clocks.h" -#endif - void stm32_peripherals_clocks_init(void); diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h index bd53c38cd9..eb44625143 100644 --- a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h @@ -61,11 +61,3 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif - -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#ifndef CPY_I2CFAST_TIMINGR -#define CPY_I2CFAST_TIMINGR 0x6000030D -#endif -#ifndef CPY_I2CSTANDARD_TIMINGR -#define CPY_I2CSTANDARD_TIMINGR 0x20404768 -#endif diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h index a89756db05..187a024ad0 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h @@ -61,11 +61,3 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif - -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#ifndef CPY_I2CFAST_TIMINGR -#define CPY_I2CFAST_TIMINGR 0x6000030D -#endif -#ifndef CPY_I2CSTANDARD_TIMINGR -#define CPY_I2CSTANDARD_TIMINGR 0x20404768 -#endif diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h index e7c5170966..ad241b7ef6 100644 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h @@ -68,11 +68,3 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif - -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#ifndef CPY_I2CFAST_TIMINGR -#define CPY_I2CFAST_TIMINGR 0x00B03FDB -#endif -#ifndef CPY_I2CSTANDARD_TIMINGR -#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 -#endif From a9614bb9643fac83275a7085f3fa5fca28bb4239 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 15 Jun 2020 15:17:27 -0500 Subject: [PATCH 0020/1293] cxd56: Sort the configuration settings --- ports/cxd56/mpconfigport.mk | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 8aeae1de56..4594df731a 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -8,15 +8,15 @@ USB_CDC_EP_NUM_DATA_IN = 1 USB_MSC_EP_NUM_OUT = 5 USB_MSC_EP_NUM_IN = 4 -CIRCUITPY_AUDIOIO = 0 CIRCUITPY_AUDIOBUSIO = 0 -CIRCUITPY_I2CSLAVE = 0 -CIRCUITPY_ROTARYIO = 0 -CIRCUITPY_TOUCHIO = 0 -CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_NEOPIXEL_WRITE = 0 -CIRCUITPY_NVM = 0 +CIRCUITPY_AUDIOIO = 0 +CIRCUITPY_COUNTIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_COUNTIO = 0 +CIRCUITPY_GAMEPAD = 0 +CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_NEOPIXEL_WRITE = 0 +CIRCUITPY_NVM = 0 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_TOUCHIO = 0 INTERNAL_LIBM = 1 From 9d5ccccf7d572697284a12fa9804878fc67c32f9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 15 Jun 2020 15:18:11 -0500 Subject: [PATCH 0021/1293] cxd56: Disable HID and MIDI These are already disabled via the USB_DEVICES setting, but the code is included anyway. --- ports/cxd56/mpconfigport.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 4594df731a..5894b9b73b 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -19,4 +19,6 @@ CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_TOUCHIO = 0 +CIRCUITPY_USB_HID = 0 +CIRCUITPY_USB_MIDI = 0 INTERNAL_LIBM = 1 From 81896930c7a91447c8830003e8cf92dce28db3d4 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 15 Jun 2020 16:35:51 -0400 Subject: [PATCH 0022/1293] Fix ScanEntry prefix matching for all --- shared-module/_bleio/ScanEntry.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/shared-module/_bleio/ScanEntry.c b/shared-module/_bleio/ScanEntry.c index 785209c4ab..91712baadc 100644 --- a/shared-module/_bleio/ScanEntry.c +++ b/shared-module/_bleio/ScanEntry.c @@ -56,12 +56,19 @@ bool bleio_scanentry_data_matches(const uint8_t* data, size_t len, const uint8_t if (prefixes_length == 0) { return true; } + if (len == 0) { + // Prefixes exist, but no data. + return false; + } size_t i = 0; while(i < prefixes_length) { uint8_t prefix_length = prefixes[i]; i += 1; size_t j = 0; + bool prefix_matched = false; + mp_printf(&mp_plat_print,"i %d\n", i); // XXX while (j < len) { + mp_printf(&mp_plat_print," j %d\n", j); // XXX uint8_t structure_length = data[j]; j += 1; if (structure_length == 0) { @@ -71,13 +78,21 @@ bool bleio_scanentry_data_matches(const uint8_t* data, size_t len, const uint8_t if (any) { return true; } - } else if (!any) { - return false; + prefix_matched = true; + mp_printf(&mp_plat_print," match\n"); // XXX + break; } j += structure_length; } + // If all (!any), the current prefix must have matched at least one field. + if (!prefix_matched && !any) { + mp_printf(&mp_plat_print," Date: Mon, 15 Jun 2020 16:50:33 -0500 Subject: [PATCH 0023/1293] docs: conf.py: Remove an irrelevant TODO This TODO made sense in the context of the original project, but for use in CircuitPython it does not appear to be relevant. Remove it. --- conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/conf.py b/conf.py index d39f74bd7d..38546a5d0a 100644 --- a/conf.py +++ b/conf.py @@ -394,7 +394,6 @@ def generate_redirects(app): app.info("Could not find redirects file at '%s'" % path) return - # TODO(stephenfin): Add support for DirectoryHTMLBuilder if not type(app.builder) == builders.StandaloneHTMLBuilder: logging.warn("The 'sphinxcontib-redirects' plugin is only supported " "by the 'html' builder. Skipping...") From c91435eff2e0ec0fa92fb383e2e96a18237d5c3f Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 15 Jun 2020 18:10:34 -0400 Subject: [PATCH 0024/1293] remove debugging prints --- shared-module/_bleio/ScanEntry.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/shared-module/_bleio/ScanEntry.c b/shared-module/_bleio/ScanEntry.c index 91712baadc..af9e4b3471 100644 --- a/shared-module/_bleio/ScanEntry.c +++ b/shared-module/_bleio/ScanEntry.c @@ -66,9 +66,7 @@ bool bleio_scanentry_data_matches(const uint8_t* data, size_t len, const uint8_t i += 1; size_t j = 0; bool prefix_matched = false; - mp_printf(&mp_plat_print,"i %d\n", i); // XXX while (j < len) { - mp_printf(&mp_plat_print," j %d\n", j); // XXX uint8_t structure_length = data[j]; j += 1; if (structure_length == 0) { @@ -79,20 +77,17 @@ bool bleio_scanentry_data_matches(const uint8_t* data, size_t len, const uint8_t return true; } prefix_matched = true; - mp_printf(&mp_plat_print," match\n"); // XXX break; } j += structure_length; } // If all (!any), the current prefix must have matched at least one field. if (!prefix_matched && !any) { - mp_printf(&mp_plat_print," Date: Mon, 15 Jun 2020 14:52:35 -0500 Subject: [PATCH 0025/1293] supervisor.mk: Compute what USB_DEVICES should be, and check it against what it is --- supervisor/supervisor.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 195e4a9b23..7eb7e26305 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -119,10 +119,25 @@ ifndef USB_DEVICES USB_DEVICES = "CDC,MSC,AUDIO,HID" endif +USB_DEVICES_COMPUTED := CDC,MSC +ifeq ($(CIRCUITPY_USB_MIDI),1) +USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),AUDIO +endif +ifeq ($(CIRCUITPY_USB_HID),1) +USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),HID +endif +USB_DEVICES_COMPUTED := "$(USB_DEVICES_COMPUTED)" + ifndef USB_HID_DEVICES USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD" endif +# During a transitional period, check that the COMPUTED values match. +# Once they do all match, we can remove all the hard-coded ones. +ifneq ($(USB_DEVICES),$(USB_DEVICES_COMPUTED)) +$(error Computed USB devices '$(USB_DEVICES_COMPUTED)' different than hard-coded USB devices '$(USB_DEVICES)') +endif + ifndef USB_MSC_MAX_PACKET_SIZE USB_MSC_MAX_PACKET_SIZE = 64 endif From 37793044fc7725551e10dec8ace7e0e08f8d975f Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 16 Jun 2020 12:03:56 -0400 Subject: [PATCH 0026/1293] Add meowbit UF2 download override to website --- tools/build_board_info.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 4433023305..6c670930f4 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -56,7 +56,10 @@ extension_by_board = { "makerdiary_nrf52840_mdk_usb_dongle": HEX_UF2, "pca10056": BIN_UF2, "pca10059": BIN_UF2, - "electronut_labs_blip": HEX + "electronut_labs_blip": HEX, + + # stm32 + "meowbit_v121": UF2 } aliases_by_board = { From fd4aafacbe9251177694598ea65f51f59af3f614 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 16 Jun 2020 12:33:15 -0400 Subject: [PATCH 0027/1293] Add port D to LQFP64 --- ports/stm/common-hal/microcontroller/Pin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index 6102134978..e966f709f6 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -46,8 +46,8 @@ bool neopixel_in_use; #define GPIO_PORT_COUNT 5 GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE}; #elif defined(LQFP64) - #define GPIO_PORT_COUNT 3 - GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC}; + #define GPIO_PORT_COUNT 4 + GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD}; #elif defined(UFQFPN48) #define GPIO_PORT_COUNT 3 GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC}; From 47425f21cc73c8038f79231521bd60c163092211 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Tue, 16 Jun 2020 15:10:23 -0500 Subject: [PATCH 0028/1293] Handle a sleep exit with ctrl-c --- shared-module/time/__init__.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shared-module/time/__init__.c b/shared-module/time/__init__.c index 347e68ae02..fad72c4b26 100644 --- a/shared-module/time/__init__.c +++ b/shared-module/time/__init__.c @@ -27,6 +27,8 @@ #include "py/mphal.h" #include "supervisor/port.h" #include "supervisor/shared/tick.h" +#include "py/obj.h" +#include "py/mpstate.h" uint64_t common_hal_time_monotonic(void) { return supervisor_ticks_ms64(); @@ -42,4 +44,9 @@ uint64_t common_hal_time_monotonic_ns(void) { void common_hal_time_delay_ms(uint32_t delay) { mp_hal_delay_ms(delay); + // if the delay was cut short by a CTRL-C then clear the keyboard exception + if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) + { + MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; + } } From 80fdb18da130afed96316bdcd05e39134aea619e Mon Sep 17 00:00:00 2001 From: Andreas Buchen Date: Tue, 16 Jun 2020 05:50:40 +0000 Subject: [PATCH 0029/1293] Translated using Weblate (German) Currently translated at 98.0% (749 of 764 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/de/ --- locale/de_DE.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index 76a0eec831..1359ce6dd0 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-05-29 17:42+0000\n" -"Last-Translator: Thomas Friehoff \n" +"PO-Revision-Date: 2020-06-16 18:24+0000\n" +"Last-Translator: Andreas Buchen \n" "Language-Team: German \n" "Language: de_DE\n" @@ -17,7 +17,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.1-dev\n" +"X-Generator: Weblate 4.1.1-dev\n" #: main.c msgid "" @@ -1717,7 +1717,7 @@ msgstr "" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer is not currently running" -msgstr "" +msgstr "WatchDogTimer läuft aktuell nicht" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" From 23da0fa99cce43941c0736b1bd24ed80ca89a991 Mon Sep 17 00:00:00 2001 From: Mark Olsson Date: Wed, 17 Jun 2020 20:48:04 +0200 Subject: [PATCH 0030/1293] Fixes issue with memory alignment in STM32 When compiling with optimizations on, an issue occurs where the claimed_pins/never_reset_pins memory location is shared with another variable. This causes some bad memory read, so the USB pins ended up being reset. Setting these to have an alignment of 4 bytes resolves this. Tested on nucleo_f746zg --- ports/stm/common-hal/microcontroller/Pin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index e966f709f6..f474414b39 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -55,7 +55,7 @@ bool neopixel_in_use; STATIC uint16_t claimed_pins[GPIO_PORT_COUNT]; -STATIC uint16_t never_reset_pins[GPIO_PORT_COUNT]; +STATIC uint16_t __ALIGNED(4) never_reset_pins[GPIO_PORT_COUNT]; void reset_all_pins(void) { // Reset claimed pins From 178be2e3c9ec76db03a379a2c26d56a667bf8840 Mon Sep 17 00:00:00 2001 From: Florin Trutiu Date: Fri, 19 Jun 2020 18:56:20 +0300 Subject: [PATCH 0031/1293] loc_ber_m4_base_board --- .github/workflows/build.yml | 1 + .../boards/loc_ber_m4_base_board/board.c | 39 +++++++++++++++ .../loc_ber_m4_base_board/mpconfigboard.h | 32 ++++++++++++ .../loc_ber_m4_base_board/mpconfigboard.mk | 17 +++++++ .../boards/loc_ber_m4_base_board/pins.c | 49 +++++++++++++++++++ 5 files changed, 138 insertions(+) create mode 100644 ports/atmel-samd/boards/loc_ber_m4_base_board/board.c create mode 100644 ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/loc_ber_m4_base_board/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f312bc0931..9945024d24 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -195,6 +195,7 @@ jobs: - "itsybitsy_m4_express" - "itsybitsy_nrf52840_express" - "kicksat-sprite" + - "loc_ber_m4_base_board" - "makerdiary_nrf52840_mdk" - "makerdiary_nrf52840_mdk_usb_dongle" - "meowbit_v121" diff --git a/ports/atmel-samd/boards/loc_ber_m4_base_board/board.c b/ports/atmel-samd/boards/loc_ber_m4_base_board/board.c new file mode 100644 index 0000000000..0f60736a24 --- /dev/null +++ b/ports/atmel-samd/boards/loc_ber_m4_base_board/board.c @@ -0,0 +1,39 @@ +/* + * 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 "boards/board.h" +#include "mpconfigboard.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.h b/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.h new file mode 100644 index 0000000000..cbc7b25c16 --- /dev/null +++ b/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.h @@ -0,0 +1,32 @@ +#define MICROPY_HW_BOARD_NAME "LoC BeR M4 base board" +#define MICROPY_HW_MCU_NAME "samd51g19" + +#define CIRCUITPY_MCU_FAMILY samd51 + +// This is for Rev B +#define MICROPY_HW_LED_STATUS (&pin_PA22) + +#define MICROPY_HW_APA102_MOSI (&pin_PB03) +#define MICROPY_HW_APA102_SCK (&pin_PB02) + +// These are pins not to reset. +// QSPI Data pins +#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11) +// DotStar pins, QSPI CS, and QSPI SCK +#define MICROPY_PORT_B (PORT_PB02 | PORT_PB03 | PORT_PB10 | PORT_PB11) +#define MICROPY_PORT_C (0) +#define MICROPY_PORT_D (0) + +#define DEFAULT_I2C_BUS_SCL (&pin_PA13) +#define DEFAULT_I2C_BUS_SDA (&pin_PA12) + +#define DEFAULT_SPI_BUS_SCK (&pin_PA01) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA00) +#define DEFAULT_SPI_BUS_MISO (&pin_PB23) + +#define DEFAULT_UART_BUS_RX (&pin_PA16) +#define DEFAULT_UART_BUS_TX (&pin_PA17) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk b/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk new file mode 100644 index 0000000000..e88127afd2 --- /dev/null +++ b/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x239A +USB_PID = 0x802C +USB_PRODUCT = "LoC BeR M4 base board" +USB_MANUFACTURER = "Zoomax" + +CHIP_VARIANT = SAMD51G19A +CHIP_FAMILY = samd51 + +INTERNAL_FLASH_FILESYSTEM = 1 +CIRCUITPY_FULL_BUILD = 0 + +LONGINT_IMPL = MPZ + +# No I2S on SAMD51G +CIRCUITPY_AUDIOBUSIO = 0 + +CIRCUITPY_BITBANG_APA102 = 1 diff --git a/ports/atmel-samd/boards/loc_ber_m4_base_board/pins.c b/ports/atmel-samd/boards/loc_ber_m4_base_board/pins.c new file mode 100644 index 0000000000..6d0f34c7da --- /dev/null +++ b/ports/atmel-samd/boards/loc_ber_m4_base_board/pins.c @@ -0,0 +1,49 @@ +#include "shared-bindings/board/__init__.h" + +// This mapping only includes functional names because pins broken +// out on connectors are labeled with their MCU name available from +// microcontroller.pin. +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PB09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA06) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA17) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA17) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PB22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA18) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA19) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA20) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA21) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA23) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA22) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA13) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB23) }, + + { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_PB02) }, + { 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_OBJ_NEW_QSTR(MP_QSTR_SCK_2), MP_ROM_PTR(&pin_PB10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI_2), MP_ROM_PTR(&pin_PA08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MISO_2), MP_ROM_PTR(&pin_PA09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_CS_2), MP_ROM_PTR(&pin_PB11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_WP_2), MP_ROM_PTR(&pin_PA10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_HOLD_2), MP_ROM_PTR(&pin_PA11) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From b31654959071ee23b16e636938831daaab911bac Mon Sep 17 00:00:00 2001 From: Florin Trutiu Date: Fri, 19 Jun 2020 19:26:29 +0300 Subject: [PATCH 0032/1293] Added the new assigned VID/PID pair --- ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk b/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk index e88127afd2..55d6fa78e6 100644 --- a/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk +++ b/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x802C +USB_PID = 0x80B8 USB_PRODUCT = "LoC BeR M4 base board" USB_MANUFACTURER = "Zoomax" From 6a76e1571b7303f08dd90948bce44042716cc4a0 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Fri, 19 Jun 2020 12:30:18 -0500 Subject: [PATCH 0033/1293] Added stack trace after a sleep ctrl-c interrupt --- shared-module/time/__init__.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shared-module/time/__init__.c b/shared-module/time/__init__.c index fad72c4b26..b83c3ca519 100644 --- a/shared-module/time/__init__.c +++ b/shared-module/time/__init__.c @@ -28,6 +28,7 @@ #include "supervisor/port.h" #include "supervisor/shared/tick.h" #include "py/obj.h" +#include "py/nlr.h" #include "py/mpstate.h" uint64_t common_hal_time_monotonic(void) { @@ -47,6 +48,7 @@ void common_hal_time_delay_ms(uint32_t delay) { // if the delay was cut short by a CTRL-C then clear the keyboard exception if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) { - MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; + MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; + nlr_raise(mp_obj_new_exception(&mp_type_KeyboardInterrupt)); } } From 99789289d8f2a1d6284caa8ae788ca530e7deb79 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Fri, 19 Jun 2020 12:33:43 -0500 Subject: [PATCH 0034/1293] Update __init__.c --- shared-module/time/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/time/__init__.c b/shared-module/time/__init__.c index b83c3ca519..dd232e755e 100644 --- a/shared-module/time/__init__.c +++ b/shared-module/time/__init__.c @@ -48,7 +48,7 @@ void common_hal_time_delay_ms(uint32_t delay) { // if the delay was cut short by a CTRL-C then clear the keyboard exception if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) { - MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; + MP_STATE_VM (mp_pending_exception) = MP_OBJ_NULL; nlr_raise(mp_obj_new_exception(&mp_type_KeyboardInterrupt)); } } From beb80e75458168dd475f2153179bd786c867f380 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Fri, 19 Jun 2020 12:38:55 -0500 Subject: [PATCH 0035/1293] removed trailing whitespace --- shared-module/time/__init__.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared-module/time/__init__.c b/shared-module/time/__init__.c index dd232e755e..559e224a3f 100644 --- a/shared-module/time/__init__.c +++ b/shared-module/time/__init__.c @@ -48,7 +48,8 @@ void common_hal_time_delay_ms(uint32_t delay) { // if the delay was cut short by a CTRL-C then clear the keyboard exception if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) { - MP_STATE_VM (mp_pending_exception) = MP_OBJ_NULL; + // clear exception and generate stacktrace + MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; nlr_raise(mp_obj_new_exception(&mp_type_KeyboardInterrupt)); } } From 1687c8b1e38aa646639455e141c28e724da4d269 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 19 Jun 2020 15:05:51 -0400 Subject: [PATCH 0036/1293] delay 1ms on SAMD51 when reading processor voltage --- .../atmel-samd/common-hal/microcontroller/Processor.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ports/atmel-samd/common-hal/microcontroller/Processor.c b/ports/atmel-samd/common-hal/microcontroller/Processor.c index 1e0b8fa791..2ca3ab30bd 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Processor.c +++ b/ports/atmel-samd/common-hal/microcontroller/Processor.c @@ -61,6 +61,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include "py/mphal.h" #include "common-hal/microcontroller/Processor.h" #include "samd/adc.h" @@ -286,11 +287,15 @@ float common_hal_mcu_processor_get_voltage(void) { #ifdef SAMD51 hri_supc_set_VREF_SEL_bf(SUPC, SUPC_VREF_SEL_1V0_Val); - // ONDEMAND must be clear, and VREFOE must be set, or else the ADC conversion will not complete. - // See https://community.atmel.com/forum/samd51-using-intref-adc-voltage-reference - hri_supc_clear_VREF_ONDEMAND_bit(SUPC); hri_supc_set_VREF_VREFOE_bit(SUPC); + adc_sync_set_reference(&adc, ADC_REFCTRL_REFSEL_INTREF_Val); + + // On some processor samples, the ADC will hang trying to read the voltage. A simple + // delay after setting the SUPC bits seems to fix things. This appears to be due to VREFOE + // startup time. There is no synchronization bit to check. + // See https://community.atmel.com/forum/samd51-using-intref-adc-voltage-reference + mp_hal_delay_ms(1); #endif adc_sync_set_resolution(&adc, ADC_CTRLB_RESSEL_12BIT_Val); From e381f593ff2071d8f40c7cd049fbdb924b3c1faa Mon Sep 17 00:00:00 2001 From: DavePutz Date: Fri, 19 Jun 2020 19:00:03 -0500 Subject: [PATCH 0037/1293] Moved changes to supervisor/shared/tick.c --- shared-module/time/__init__.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/shared-module/time/__init__.c b/shared-module/time/__init__.c index 559e224a3f..2e43799415 100644 --- a/shared-module/time/__init__.c +++ b/shared-module/time/__init__.c @@ -28,7 +28,6 @@ #include "supervisor/port.h" #include "supervisor/shared/tick.h" #include "py/obj.h" -#include "py/nlr.h" #include "py/mpstate.h" uint64_t common_hal_time_monotonic(void) { @@ -45,11 +44,4 @@ uint64_t common_hal_time_monotonic_ns(void) { void common_hal_time_delay_ms(uint32_t delay) { mp_hal_delay_ms(delay); - // if the delay was cut short by a CTRL-C then clear the keyboard exception - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) - { - // clear exception and generate stacktrace - MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; - nlr_raise(mp_obj_new_exception(&mp_type_KeyboardInterrupt)); - } } From 0b52359190490ab4a821d3998ce053a6fb23f28c Mon Sep 17 00:00:00 2001 From: DavePutz Date: Fri, 19 Jun 2020 19:02:43 -0500 Subject: [PATCH 0038/1293] Generate stacktrace and reset exception for ctrl-c interrupt Added code in mp_hal_delay_ms() to generate stacktrace and reset exception for ctrl-c interrupt --- supervisor/shared/tick.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 47395bd602..001db0f354 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -105,6 +105,12 @@ void mp_hal_delay_ms(mp_uint_t delay) { if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || WATCHDOG_EXCEPTION_CHECK()) { + if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) + { + // clear exception and generate stacktrace + MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; + nlr_raise(mp_obj_new_exception(&mp_type_KeyboardInterrupt)); + } break; } remaining = end_tick - port_get_raw_ticks(NULL); From 5d158d884d2be6d9f69a8ff747cd87b7917e2963 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 20 Jun 2020 08:44:24 -0500 Subject: [PATCH 0039/1293] ci_check_duplicate_usb_vid_pid.py: change 'whitelist' terminology to 'ignorelist' --- tools/ci_check_duplicate_usb_vid_pid.py | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/ci_check_duplicate_usb_vid_pid.py b/tools/ci_check_duplicate_usb_vid_pid.py index 505704f122..b05d56012f 100644 --- a/tools/ci_check_duplicate_usb_vid_pid.py +++ b/tools/ci_check_duplicate_usb_vid_pid.py @@ -29,7 +29,7 @@ import pathlib import re import sys -DEFAULT_WHITELIST = [ +DEFAULT_IGNORELIST = [ "circuitplayground_express", "circuitplayground_express_crickit", "circuitplayground_express_displayio", @@ -43,15 +43,15 @@ DEFAULT_WHITELIST = [ cli_parser = argparse.ArgumentParser(description="USB VID/PID Duplicate Checker") cli_parser.add_argument( - "--whitelist", - dest="whitelist", + "--ignorelist", + dest="ignorelist", nargs="?", action="store", - default=DEFAULT_WHITELIST, + default=DEFAULT_IGNORELIST, help=( "Board names to ignore duplicate VID/PID combinations. Pass an empty " "string to disable all duplicate ignoring. Defaults are: " - f"{', '.join(DEFAULT_WHITELIST)}" + f"{', '.join(DEFAULT_IGNORELIST)}" ) ) @@ -69,7 +69,7 @@ def configboard_files(): ) return working_dir.glob("ports/**/boards/**/mpconfigboard.mk") -def check_vid_pid(files, whitelist): +def check_vid_pid(files, ignorelist): """ Compiles a list of USB VID & PID values for all boards, and checks for duplicates. Exits with ``sys.exit()`` (non-zero exit code) if duplicates are found, and lists the duplicates. @@ -90,10 +90,10 @@ def check_vid_pid(files, whitelist): board_name = board_config.parts[-2] - board_whitelisted = False - if board_name in whitelist: - board_whitelisted = True - board_name += " (whitelisted)" + board_ignorelisted = False + if board_name in ignorelist: + board_ignorelisted = True + board_name += " (ignorelisted)" if usb_vid and usb_pid: id_group = f"{usb_vid.group(1)}:{usb_pid.group(1)}" @@ -104,7 +104,7 @@ def check_vid_pid(files, whitelist): } else: usb_ids[id_group]['boards'].append(board_name) - if not board_whitelisted: + if not board_ignorelisted: usb_ids[id_group]['duplicate'] = True duplicates_found = True @@ -128,9 +128,9 @@ if __name__ == "__main__": print("Running USB VID/PID Duplicate Checker...") print( - f"Ignoring the following boards: {', '.join(arguments.whitelist)}", + f"Ignoring the following boards: {', '.join(arguments.ignorelist)}", end="\n\n" ) board_files = configboard_files() - check_vid_pid(board_files, arguments.whitelist) + check_vid_pid(board_files, arguments.ignorelist) From 182a8733a4acf356b848714c1f2e85190a27da0c Mon Sep 17 00:00:00 2001 From: DavePutz Date: Sun, 21 Jun 2020 13:28:26 -0500 Subject: [PATCH 0040/1293] Rework handling of ctrl-c interrupt --- supervisor/shared/tick.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 001db0f354..3842b67d56 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -102,15 +102,15 @@ void mp_hal_delay_ms(mp_uint_t delay) { while (remaining > 0) { RUN_BACKGROUND_TASKS; // Check to see if we've been CTRL-Ced by autoreload or the user. - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || - WATCHDOG_EXCEPTION_CHECK()) { - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) + if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) { // clear exception and generate stacktrace MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; nlr_raise(mp_obj_new_exception(&mp_type_KeyboardInterrupt)); - } + } + if( MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || + WATCHDOG_EXCEPTION_CHECK()) { + // stop sleeping immediately break; } remaining = end_tick - port_get_raw_ticks(NULL); From dff1c07e185831e145fb77f152194c408d972d8b Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Sun, 21 Jun 2020 03:51:19 +0000 Subject: [PATCH 0041/1293] Translated using Weblate (Spanish) Currently translated at 69.7% (533 of 764 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/locale/es.po b/locale/es.po index 5fe0f945ad..074230cabb 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: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-05-17 20:56+0000\n" -"Last-Translator: Jeff Epler \n" +"PO-Revision-Date: 2020-06-22 04:41+0000\n" +"Last-Translator: Alvaro Figueroa \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.1-dev\n" +"X-Generator: Weblate 4.2-dev\n" #: main.c msgid "" @@ -32,12 +32,17 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"Reporte un problema con el contenido de su unidad CIRCUITPY en\n" +"https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c msgid "" "\n" "To exit, please reset the board without " msgstr "" +"\n" +"Para salir, favor reinicie la tarjeta sin " #: py/obj.c msgid " File \"%q\"" @@ -59,7 +64,7 @@ msgstr "%%c requiere int o char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "" +msgstr "%d pines de dirección y %d pines rgb indican una altura de %d, no de %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -75,7 +80,7 @@ msgstr "%q indices deben ser enteros, no %s" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "" +msgstr "%q lista debe ser una lista" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -86,7 +91,7 @@ msgstr "%q debe ser >= 1" #: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "" +msgstr "%q debe ser una tupla de longitud 2" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" @@ -152,11 +157,11 @@ msgstr "'%s' entero 0x%x no cabe en la máscara 0x%x" #: py/runtime.c msgid "'%s' object cannot assign attribute '%q'" -msgstr "" +msgstr "El objeto '%s' no puede asignar al atributo '%q'" #: py/proto.c msgid "'%s' object does not support '%q'" -msgstr "" +msgstr "El objeto '%s' no admite '%q'" #: py/obj.c #, c-format @@ -268,7 +273,7 @@ msgstr "La dirección debe ser %d bytes de largo" #: shared-bindings/_bleio/Address.c msgid "Address type out of range" -msgstr "" +msgstr "Tipo de dirección fuera de rango" #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" @@ -309,11 +314,11 @@ msgstr "Todos los timers en uso" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." -msgstr "" +msgstr "Ya se encuentra publicando." #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" -msgstr "" +msgstr "El pin proporcionado no soporta AnalogIn" #: ports/cxd56/common-hal/analogio/AnalogOut.c #: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c @@ -344,7 +349,7 @@ msgstr "Valores del array deben ser bytes individuales." #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" -msgstr "" +msgstr "Como máximo %d %q se puede especificar (no %d)" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." @@ -377,7 +382,7 @@ msgstr "Bits depth debe ser múltiplo de 8." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "" +msgstr "Ambos RX y TX requeridos para control de flujo" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -387,7 +392,7 @@ msgstr "Ambos pines deben soportar interrupciones por hardware" #: shared-bindings/framebufferio/FramebufferDisplay.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "" +msgstr "El brillo debe ser 0-1.0" #: shared-bindings/supervisor/__init__.c msgid "Brightness must be between 0 and 255" @@ -411,17 +416,17 @@ msgstr "Tamaño de buffer incorrecto. Debe ser de %d bytes." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "" +msgstr "Buffer no es un bytearray." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" -msgstr "" +msgstr "El buffer es muy pequeño" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "" +msgstr "La longitud del buffer %d es muy grande. Debe ser menor a %d" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -429,7 +434,7 @@ msgstr "Buffer debe ser de longitud 1 como minimo" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Buffer too large and unable to allocate" -msgstr "" +msgstr "Buffer demasiado grande e incapaz de asignar" #: shared-bindings/_bleio/PacketBuffer.c #, c-format @@ -452,11 +457,11 @@ msgstr "Bytes debe estar entre 0 y 255." #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "Los bloques CBC deben ser múltiplos de 16 bytes" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "" +msgstr "Llame a super().__ init __() antes de acceder al objeto nativo." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" From ac2a4608da7d1f0cbcf501b24fab7bc5c2072d22 Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Mon, 22 Jun 2020 04:56:36 +0000 Subject: [PATCH 0042/1293] Translated using Weblate (Spanish) Currently translated at 77.7% (594 of 764 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 124 ++++++++++++++++++++++++++------------------------- 1 file changed, 64 insertions(+), 60 deletions(-) diff --git a/locale/es.po b/locale/es.po index 074230cabb..8ecc00931b 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-06-22 04:41+0000\n" +"PO-Revision-Date: 2020-06-22 10:35+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" @@ -370,7 +370,7 @@ msgstr "" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" -msgstr "" +msgstr "Por debajo de taza mínima de refrescamiento" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" @@ -513,7 +513,7 @@ msgstr "No se puede asignar un valor cuando la dirección es input." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "" +msgstr "No se puede especificar RTS o CTS en modo RS485" #: py/objslice.c msgid "Cannot subclass slice" @@ -529,7 +529,7 @@ msgstr "No se puede obtener inequívocamente sizeof escalar" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" +msgstr "No puede variar la frecuencia en un temporizador que ya está en uso" #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." @@ -541,13 +541,15 @@ msgstr "CharateristicBuffer escritura no proporcionada" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" -msgstr "" +msgstr "El código central de CircuitPython se estrelló con fuerza. ¡Whoops!\n" #: supervisor/shared/safe_mode.c msgid "" "CircuitPython is in safe mode because you pressed the reset button during " "boot. Press again to exit safe mode.\n" msgstr "" +"CircuitPython está en modo seguro porque presionó el botón de reinicio " +"durante el arranque. Presione nuevamente para salir del modo seguro.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." @@ -575,14 +577,16 @@ msgid "" "Connection has been disconnected and can no longer be used. Create a new " "connection." msgstr "" +"La conexión se ha desconectado y ya no se puede usar. Crea una nueva " +"conexión." #: py/persistentcode.c msgid "Corrupt .mpy file" -msgstr "" +msgstr "Archivo .mpy corrupto" #: py/emitglue.c msgid "Corrupt raw code" -msgstr "" +msgstr "Código crudo corrupto" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" @@ -590,31 +594,31 @@ msgstr "No se puede inicializar la UART" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize channel" -msgstr "" +msgstr "No se pudo inicializar el canal" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize timer" -msgstr "" +msgstr "No se pudo inicializar el temporizador" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init channel" -msgstr "" +msgstr "No se pudo reiniciar el canal" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init timer" -msgstr "" +msgstr "No se pudo reiniciar el temporizador" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not restart PWM" -msgstr "" +msgstr "No se pudo reiniciar el PWM" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" -msgstr "" +msgstr "No se pudo iniciar el PWM" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" -msgstr "" +msgstr "No se pudo iniciar la interrupción, RX ocupado" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" @@ -640,11 +644,11 @@ msgstr "" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" -msgstr "" +msgstr "Error de inicio del canal DAC" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" -msgstr "" +msgstr "Error de inicio del dispositivo DAC" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -669,16 +673,16 @@ msgstr "Capacidad de destino es mas pequeña que destination_length." #: ports/nrf/common-hal/audiobusio/I2SOut.c msgid "Device in use" -msgstr "" +msgstr "Dispositivo en uso" #: ports/cxd56/common-hal/digitalio/DigitalInOut.c msgid "DigitalInOut not supported on given pin" -msgstr "" +msgstr "DigitalInOut no es compatible con un pin dado" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." -msgstr "" +msgstr "La pantalla debe tener un espacio de color de 16 bits." #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c @@ -718,7 +722,7 @@ msgstr "Se esperaba una Característica." #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" -msgstr "" +msgstr "Se esperaba un servicio" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c @@ -727,7 +731,7 @@ msgstr "Se esperaba un UUID" #: shared-bindings/_bleio/Adapter.c msgid "Expected an Address" -msgstr "" +msgstr "Se esperaba una dirección" #: shared-module/_pixelbuf/PixelBuf.c #, c-format @@ -736,7 +740,7 @@ msgstr "Se esperaba un tuple de %d, se obtuvo %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." -msgstr "" +msgstr "No se admiten anuncios extendidos con respuesta de escaneo." #: extmod/ulab/code/fft.c msgid "FFT is defined for ndarrays only" @@ -766,15 +770,15 @@ msgstr "Falló la asignación del buffer RX de %d bytes" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" -msgstr "" +msgstr "Error al conectar: error interno" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: timeout" -msgstr "" +msgstr "Error al conectar: tiempo de espera agotado" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" -msgstr "" +msgstr "Error al analizar el archivo MP3" #: ports/nrf/sd_mutex.c #, c-format @@ -783,7 +787,7 @@ msgstr "No se puede liberar el mutex, err 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "" +msgstr "Error al escribir al flash interno." #: py/moduerrno.c msgid "File exists" @@ -796,6 +800,7 @@ msgstr "Frecuencia capturada por encima de la capacidad. Captura en pausa." #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" +"La frecuencia debe coincidir con PWMOut existente usando este temporizador" #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c @@ -806,7 +811,7 @@ msgstr "La función requiere lock" #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" -msgstr "" +msgstr "El grupo ya está siendo utilizado" #: shared-module/displayio/Group.c msgid "Group full" @@ -815,11 +820,11 @@ msgstr "Group lleno" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" -msgstr "" +msgstr "Hardware ocupado, pruebe pines alternativos" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" -msgstr "" +msgstr "Hardware en uso, pruebe pines alternativos" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -827,7 +832,7 @@ msgstr "Operación I/O en archivo cerrado" #: ports/stm/common-hal/busio/I2C.c msgid "I2C Init Error" -msgstr "" +msgstr "Error de inicio de I2C" #: extmod/machine_i2c.c msgid "I2C operation not supported" @@ -836,7 +841,7 @@ msgstr "operación I2C no soportada" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "" +msgstr "IV debe tener %d bytes de longitud" #: py/persistentcode.c msgid "" @@ -856,11 +861,11 @@ msgstr "error Input/output" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" -msgstr "" +msgstr "Autenticación insuficiente" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" -msgstr "" +msgstr "Cifrado insuficiente" #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" @@ -869,7 +874,7 @@ msgstr "" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format msgid "Internal error #%d" -msgstr "" +msgstr "Error interno #%d" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -878,7 +883,7 @@ msgstr "Pin %q inválido" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" -msgstr "" +msgstr "Valor de unidad de ADC no válido" #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" @@ -886,11 +891,11 @@ msgstr "Archivo BMP inválido" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" -msgstr "" +msgstr "Pin suministrado inválido para DAC" #: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" -msgstr "" +msgstr "Selección de pin I2C no válida" #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c @@ -900,11 +905,11 @@ msgstr "Frecuencia PWM inválida" #: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" -msgstr "" +msgstr "Selección de pin SPI no válida" #: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" -msgstr "" +msgstr "Selección de pin UART no válida" #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" @@ -920,7 +925,7 @@ msgstr "Tamaño de buffer inválido" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Invalid byteorder string" -msgstr "" +msgstr "Cadena de byteorder inválida" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" @@ -944,7 +949,7 @@ msgstr "Formato de fragmento de formato no válido" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid frequency supplied" -msgstr "" +msgstr "Frecuencia suministrada no válida" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." @@ -986,7 +991,7 @@ msgstr "pines inválidos" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid pins for PWMOut" -msgstr "" +msgstr "Pines inválidos para PWMOut" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c @@ -995,7 +1000,7 @@ msgstr "Polaridad inválida" #: shared-bindings/_bleio/Characteristic.c msgid "Invalid properties" -msgstr "" +msgstr "Propiedades inválidas" #: shared-bindings/microcontroller/__init__.c msgid "Invalid run mode." @@ -1064,7 +1069,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error." -msgstr "" +msgstr "Error fatal de MicroPython." #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -1072,7 +1077,7 @@ msgstr "Micrófono demora de inicio debe estar en el rango 0.0 a 1.0" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" -msgstr "" +msgstr "Falta el pin MISO o MOSI" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." @@ -1080,7 +1085,7 @@ msgstr "Debe de ser una subclase de %q" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" -msgstr "" +msgstr "Debe proporcionar un pin MISO o MOSI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1089,7 +1094,7 @@ msgstr "" #: py/parse.c msgid "Name too long" -msgstr "" +msgstr "Nombre muy largo" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" @@ -1107,11 +1112,11 @@ msgstr "No se encontró el canal DMA" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" -msgstr "" +msgstr "Sin pin MISO" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" -msgstr "" +msgstr "Sin pin MOSI" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1131,7 +1136,7 @@ msgstr "Relojes no disponibles" #: shared-bindings/_bleio/PacketBuffer.c msgid "No connection: length cannot be determined" -msgstr "" +msgstr "Sin conexión: no se puede determinar la longitud" #: shared-bindings/board/__init__.c msgid "No default %q bus" @@ -1160,15 +1165,15 @@ msgstr "" #: shared-bindings/time/__init__.c msgid "No long integer support" -msgstr "" +msgstr "No hay soporte de entero largo" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." -msgstr "" +msgstr "No hay más temporizadores disponibles en este pin." #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" -msgstr "" +msgstr "No hay pulldown en el pin; 1Mohm recomendado" #: py/moduerrno.c msgid "No space left on device" @@ -1180,7 +1185,7 @@ msgstr "No existe el archivo/directorio" #: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" -msgstr "" +msgstr "No hay temporizador disponible" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." @@ -1261,15 +1266,15 @@ msgstr "Pin no tiene capacidad ADC" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pin is input only" -msgstr "" +msgstr "El pin es solo de entrada" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" -msgstr "" +msgstr "El pin debe admitir interrupciones de hardware" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" -msgstr "" +msgstr "Número de pin ya reservado por EXTI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1280,13 +1285,12 @@ msgid "" msgstr "" #: py/builtinhelp.c -#, fuzzy msgid "Plus any modules on the filesystem\n" -msgstr "Incapaz de montar de nuevo el sistema de archivos" +msgstr "Además de cualquier módulo en el sistema de archivos\n" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" -msgstr "" +msgstr "El polígono necesita al menos 3 puntos" #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" From 579784c4a070293ae8561b7fe1acd41d993847eb Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Mon, 22 Jun 2020 12:36:00 +0200 Subject: [PATCH 0043/1293] 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/es.po | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/locale/es.po b/locale/es.po index 8ecc00931b..43e80a1da6 100644 --- a/locale/es.po +++ b/locale/es.po @@ -64,7 +64,8 @@ msgstr "%%c requiere int o char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "%d pines de dirección y %d pines rgb indican una altura de %d, no de %d" +msgstr "" +"%d pines de dirección y %d pines rgb indican una altura de %d, no de %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" From de14b5b02f1ceebabca8f79c8e166e673f039aec Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 8 May 2020 10:48:46 -0500 Subject: [PATCH 0044/1293] flash: Correctly signal error on invalid flash read This logic was intended to mirror what is done for "write", but the wrong variable name was repeated twice. --- supervisor/shared/flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/shared/flash.c b/supervisor/shared/flash.c index 298e7d83e4..9f52ddbc48 100644 --- a/supervisor/shared/flash.c +++ b/supervisor/shared/flash.c @@ -88,7 +88,7 @@ static void build_partition(uint8_t *buf, int boot, int type, uint32_t start_blo mp_uint_t flash_read_blocks(uint8_t *dest, uint32_t block_num, uint32_t num_blocks) { if (block_num == 0) { - if (block_num > 1) { + if (num_blocks > 1) { return 1; // error } // fake the MBR so we can decide on our own partition table From 5a3a0a50924e8306690769b0683f836cb9608145 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 21 May 2020 11:02:54 -0500 Subject: [PATCH 0045/1293] stm: Makefile: sort files in SRC_STM32 --- ports/stm/Makefile | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/ports/stm/Makefile b/ports/stm/Makefile index a7b519ffcb..08cb36ddf2 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -154,43 +154,43 @@ CFLAGS += \ -DCFG_TUD_MIDI_TX_BUFSIZE=128 SRC_STM32 = $(addprefix $(HAL_DIR)/Src/stm32$(MCU_SERIES_LOWER)xx_,\ + hal.c \ hal_adc.c \ hal_adc_ex.c \ + hal_cortex.c \ hal_dac.c \ hal_dac_ex.c \ + hal_dma.c \ + hal_dma_ex.c \ + hal_exti.c \ + hal_flash.c \ + hal_flash_ex.c \ + hal_gpio.c \ hal_i2c.c \ hal_i2c_ex.c \ + hal_pwr.c \ + hal_pwr_ex.c \ hal_qspi.c \ + hal_rcc.c \ + hal_rcc_ex.c \ hal_rng.c \ hal_rtc.c \ hal_rtc_ex.c \ + hal_sd.c \ hal_spi.c \ hal_tim.c \ hal_tim_ex.c \ hal_uart.c \ hal_usart.c \ - hal_rcc.c \ - hal_rcc_ex.c \ - hal_flash.c \ - hal_flash_ex.c \ - hal_gpio.c \ - hal_dma_ex.c \ - hal_dma.c \ - hal_pwr.c \ - hal_pwr_ex.c \ - hal_cortex.c \ - hal.c \ - hal_exti.c \ - hal_sd.c \ - ll_gpio.c \ ll_adc.c \ - ll_i2c.c \ ll_dma.c \ + ll_exti.c \ + ll_gpio.c \ + ll_i2c.c \ + ll_rcc.c \ ll_sdmmc.c \ ll_usart.c \ - ll_rcc.c \ ll_utils.c \ - ll_exti.c \ ) # Need this to avoid UART linker problems. TODO: rewrite to use registered callbacks. From a580f0f1c4f2a221ddf3ff169eff79158bd8acf6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 21 Jun 2020 08:31:26 -0500 Subject: [PATCH 0046/1293] _pew: move to common-hal I noticed that this code was referring to samd-specific functionality, and isn't enabled except in one samd board (pewpew10). Move it. There is incomplte support for _pew in mimxrt10xx which then caused build errors; adding a #if guard to check for _pew being enabled fixes it. The _pew module is not likely to be important on mimxrt but I'll leave the choice to remove it to someone else. --- {shared-module => ports/atmel-samd/common-hal}/_pew/PewPew.c | 0 {shared-module => ports/atmel-samd/common-hal}/_pew/PewPew.h | 0 .../atmel-samd/common-hal}/_pew/__init__.c | 0 .../atmel-samd/common-hal}/_pew/__init__.h | 0 ports/atmel-samd/supervisor/port.c | 4 +++- ports/atmel-samd/timer_handler.c | 2 +- ports/mimxrt10xx/supervisor/port.c | 2 ++ py/circuitpy_defns.mk | 4 ++-- shared-bindings/_pew/PewPew.c | 2 +- shared-bindings/_pew/__init__.c | 2 +- 10 files changed, 10 insertions(+), 6 deletions(-) rename {shared-module => ports/atmel-samd/common-hal}/_pew/PewPew.c (100%) rename {shared-module => ports/atmel-samd/common-hal}/_pew/PewPew.h (100%) rename {shared-module => ports/atmel-samd/common-hal}/_pew/__init__.c (100%) rename {shared-module => ports/atmel-samd/common-hal}/_pew/__init__.h (100%) diff --git a/shared-module/_pew/PewPew.c b/ports/atmel-samd/common-hal/_pew/PewPew.c similarity index 100% rename from shared-module/_pew/PewPew.c rename to ports/atmel-samd/common-hal/_pew/PewPew.c diff --git a/shared-module/_pew/PewPew.h b/ports/atmel-samd/common-hal/_pew/PewPew.h similarity index 100% rename from shared-module/_pew/PewPew.h rename to ports/atmel-samd/common-hal/_pew/PewPew.h diff --git a/shared-module/_pew/__init__.c b/ports/atmel-samd/common-hal/_pew/__init__.c similarity index 100% rename from shared-module/_pew/__init__.c rename to ports/atmel-samd/common-hal/_pew/__init__.c diff --git a/shared-module/_pew/__init__.h b/ports/atmel-samd/common-hal/_pew/__init__.h similarity index 100% rename from shared-module/_pew/__init__.h rename to ports/atmel-samd/common-hal/_pew/__init__.h diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 2b3e9826f8..74c9849976 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -85,7 +85,9 @@ #if CIRCUITPY_GAMEPADSHIFT #include "shared-module/gamepadshift/__init__.h" #endif -#include "shared-module/_pew/PewPew.h" +#if CIRCUITPY_PEW +#include "common-hal/_pew/PewPew.h" +#endif extern volatile bool mp_msc_enabled; diff --git a/ports/atmel-samd/timer_handler.c b/ports/atmel-samd/timer_handler.c index 34d819e162..16d65334e0 100644 --- a/ports/atmel-samd/timer_handler.c +++ b/ports/atmel-samd/timer_handler.c @@ -31,7 +31,7 @@ #include "common-hal/pulseio/PulseIn.h" #include "common-hal/pulseio/PulseOut.h" -#include "shared-module/_pew/PewPew.h" +#include "common-hal/_pew/PewPew.h" #include "common-hal/frequencyio/FrequencyIn.h" extern void _PM_IRQ_HANDLER(void); diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index ed5824732d..0b53a79f07 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -53,7 +53,9 @@ #if CIRCUITPY_GAMEPADSHIFT #include "shared-module/gamepadshift/__init__.h" #endif +#if CIRCUITPY_PEW #include "shared-module/_pew/PewPew.h" +#endif #include "supervisor/shared/tick.h" #include "clocks.h" diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 67fbde6e4f..cdfb4c6b69 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -259,6 +259,8 @@ SRC_COMMON_HAL_ALL = \ _bleio/PacketBuffer.c \ _bleio/Service.c \ _bleio/UUID.c \ + _pew/__init__.c \ + _pew/PewPew.c \ analogio/AnalogIn.c \ analogio/AnalogOut.c \ analogio/__init__.c \ @@ -396,8 +398,6 @@ SRC_SHARED_MODULE_ALL = \ terminalio/__init__.c \ uheap/__init__.c \ ustack/__init__.c \ - _pew/__init__.c \ - _pew/PewPew.c \ _eve/__init__.c # All possible sources are listed here, and are filtered by SRC_PATTERNS. diff --git a/shared-bindings/_pew/PewPew.c b/shared-bindings/_pew/PewPew.c index 82bf04a617..352ef38f27 100644 --- a/shared-bindings/_pew/PewPew.c +++ b/shared-bindings/_pew/PewPew.c @@ -31,7 +31,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/util.h" #include "PewPew.h" -#include "shared-module/_pew/PewPew.h" +#include "common-hal/_pew/PewPew.h" #include "supervisor/shared/translate.h" //| class PewPew: diff --git a/shared-bindings/_pew/__init__.c b/shared-bindings/_pew/__init__.c index 6e0070d8e2..498beaf1c9 100644 --- a/shared-bindings/_pew/__init__.c +++ b/shared-bindings/_pew/__init__.c @@ -27,7 +27,7 @@ #include "py/runtime.h" #include "py/mphal.h" #include "PewPew.h" -#include "shared-module/_pew/PewPew.h" +#include "common-hal/_pew/PewPew.h" STATIC mp_obj_t get_pressed(void) { pew_obj_t *pew = MP_STATE_VM(pew_singleton); From 8a760b065733fb27ad42f78d606beed025d8106d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 22 Jun 2020 10:27:37 -0500 Subject: [PATCH 0047/1293] stm: Pin.c: Compute GPIO_PORT_COUNT instead of specifying manually --- ports/stm/common-hal/microcontroller/Pin.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index e966f709f6..b0e3c7015f 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -37,23 +37,20 @@ bool neopixel_in_use; #endif #if defined(TFBGA216) - #define GPIO_PORT_COUNT 11 - GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH, GPIOI, GPIOJ, GPIOK}; + GPIO_TypeDef * ports[] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH, GPIOI, GPIOJ, GPIOK}; #elif defined(LQFP144) - #define GPIO_PORT_COUNT 7 - GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG}; + GPIO_TypeDef * ports[] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG}; #elif defined(LQFP100_f4) || (LQFP100_x7) - #define GPIO_PORT_COUNT 5 - GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE}; + GPIO_TypeDef * ports[] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE}; #elif defined(LQFP64) - #define GPIO_PORT_COUNT 4 - GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD}; + GPIO_TypeDef * ports[] = {GPIOA, GPIOB, GPIOC, GPIOD}; #elif defined(UFQFPN48) - #define GPIO_PORT_COUNT 3 - GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC}; + GPIO_TypeDef * ports[] = {GPIOA, GPIOB, GPIOC}; #endif +#define GPIO_PORT_COUNT (MP_ARRAY_SIZE(ports)) + STATIC uint16_t claimed_pins[GPIO_PORT_COUNT]; STATIC uint16_t never_reset_pins[GPIO_PORT_COUNT]; From 6638bc32c3c989c3bd4ffc761bd1462ed06828be Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 9 Jun 2020 14:06:54 -0500 Subject: [PATCH 0048/1293] samd: Makefile: Regularize whitespace --- 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 d0ab65e6b7..8eb24e8361 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -206,7 +206,7 @@ SRC_ASF += \ else ifeq ($(CHIP_FAMILY), samd51) SRC_ASF += \ - hal/src/hal_rand_sync.c \ + hal/src/hal_rand_sync.c \ hpl/core/hpl_core_m4.c \ hpl/mclk/hpl_mclk.c \ hpl/osc32kctrl/hpl_osc32kctrl.c \ From a770b5a919338b9df068bd0bca14edec9996bc31 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 16 Jun 2020 11:31:07 -0500 Subject: [PATCH 0049/1293] never_reset_pin: Move pin validity check before first use of pin number --- ports/atmel-samd/common-hal/microcontroller/Pin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/common-hal/microcontroller/Pin.c b/ports/atmel-samd/common-hal/microcontroller/Pin.c index cf78673b20..3c214a9f41 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Pin.c +++ b/ports/atmel-samd/common-hal/microcontroller/Pin.c @@ -110,12 +110,12 @@ void never_reset_pin_number(uint8_t pin_number) { } void reset_pin_number(uint8_t pin_number) { - never_reset_pins[GPIO_PORT(pin_number)] &= ~(1 << GPIO_PIN(pin_number)); - if (pin_number >= PORT_BITS) { return; } + never_reset_pins[GPIO_PORT(pin_number)] &= ~(1 << GPIO_PIN(pin_number)); + #ifdef MICROPY_HW_NEOPIXEL if (pin_number == MICROPY_HW_NEOPIXEL->number) { neopixel_in_use = false; From a7b36f724f16a204f6d324e70e3e1429389249fe Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 21 Jun 2020 08:33:33 -0500 Subject: [PATCH 0050/1293] circuitpy_defns.mk: Sort several lists of source files and regularize whitespace in one spot --- py/circuitpy_defns.mk | 60 +++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index cdfb4c6b69..fb8f46bd87 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -249,7 +249,6 @@ endif # All possible sources are listed here, and are filtered by SRC_PATTERNS in SRC_COMMON_HAL SRC_COMMON_HAL_ALL = \ - _bleio/__init__.c \ _bleio/Adapter.c \ _bleio/Attribute.c \ _bleio/Characteristic.c \ @@ -259,18 +258,19 @@ SRC_COMMON_HAL_ALL = \ _bleio/PacketBuffer.c \ _bleio/Service.c \ _bleio/UUID.c \ - _pew/__init__.c \ + _bleio/__init__.c \ _pew/PewPew.c \ + _pew/__init__.c \ analogio/AnalogIn.c \ analogio/AnalogOut.c \ analogio/__init__.c \ - audiobusio/__init__.c \ audiobusio/I2SOut.c \ audiobusio/PDMIn.c \ - audiopwmio/__init__.c \ - audiopwmio/PWMAudioOut.c \ - audioio/__init__.c \ + audiobusio/__init__.c \ audioio/AudioOut.c \ + audioio/__init__.c \ + audiopwmio/PWMAudioOut.c \ + audiopwmio/__init__.c \ board/__init__.c \ busio/I2C.c \ busio/SPI.c \ @@ -281,8 +281,8 @@ SRC_COMMON_HAL_ALL = \ digitalio/DigitalInOut.c \ digitalio/__init__.c \ displayio/ParallelBus.c \ - frequencyio/__init__.c \ frequencyio/FrequencyIn.c \ + frequencyio/__init__.c \ i2cslave/I2CSlave.c \ i2cslave/__init__.c \ microcontroller/Pin.c \ @@ -292,23 +292,23 @@ SRC_COMMON_HAL_ALL = \ nvm/ByteArray.c \ nvm/__init__.c \ os/__init__.c \ - rgbmatrix/RGBMatrix.c \ - rgbmatrix/__init__.c \ + ps2io/Ps2.c \ + ps2io/__init__.c \ pulseio/PWMOut.c \ pulseio/PulseIn.c \ pulseio/PulseOut.c \ pulseio/__init__.c \ - ps2io/Ps2.c \ - ps2io/__init__.c \ + rgbmatrix/RGBMatrix.c \ + rgbmatrix/__init__.c \ rotaryio/IncrementalEncoder.c \ rotaryio/__init__.c \ rtc/RTC.c \ rtc/__init__.c \ supervisor/Runtime.c \ supervisor/__init__.c \ - watchdog/__init__.c \ watchdog/WatchDogMode.c \ watchdog/WatchDogTimer.c \ + watchdog/__init__.c \ SRC_COMMON_HAL = $(filter $(SRC_PATTERNS), $(SRC_COMMON_HAL_ALL)) @@ -320,13 +320,13 @@ $(filter $(SRC_PATTERNS), \ _bleio/Address.c \ _bleio/Attribute.c \ _bleio/ScanEntry.c \ + _eve/__init__.c \ digitalio/Direction.c \ digitalio/DriveMode.c \ digitalio/Pull.c \ fontio/Glyph.c \ - microcontroller/RunMode.c \ math/__init__.c \ - _eve/__init__.c \ + microcontroller/RunMode.c \ ) SRC_BINDINGS_ENUMS += \ @@ -337,29 +337,30 @@ SRC_SHARED_MODULE_ALL = \ _bleio/Attribute.c \ _bleio/ScanEntry.c \ _bleio/ScanResults.c \ + _eve/__init__.c \ _pixelbuf/PixelBuf.c \ _pixelbuf/__init__.c \ _stage/Layer.c \ _stage/Text.c \ _stage/__init__.c \ - audiopwmio/__init__.c \ - audioio/__init__.c \ - audiocore/__init__.c \ + aesio/__init__.c \ + aesio/aes.c \ audiocore/RawSample.c \ audiocore/WaveFile.c \ - audiomixer/__init__.c \ + audiocore/__init__.c \ + audioio/__init__.c \ audiomixer/Mixer.c \ audiomixer/MixerVoice.c \ - audiomp3/__init__.c \ + audiomixer/__init__.c \ audiomp3/MP3Decoder.c \ + audiomp3/__init__.c \ + audiopwmio/__init__.c \ bitbangio/I2C.c \ bitbangio/OneWire.c \ bitbangio/SPI.c \ bitbangio/__init__.c \ board/__init__.c \ busio/OneWire.c \ - aesio/__init__.c \ - aesio/aes.c \ displayio/Bitmap.c \ displayio/ColorConverter.c \ displayio/Display.c \ @@ -372,11 +373,6 @@ SRC_SHARED_MODULE_ALL = \ displayio/Shape.c \ displayio/TileGrid.c \ displayio/__init__.c \ - vectorio/Circle.c \ - vectorio/Rectangle.c \ - vectorio/Polygon.c \ - vectorio/VectorShape.c \ - vectorio/__init__.c \ fontio/BuiltinFont.c \ fontio/__init__.c \ framebufferio/FramebufferDisplay.c \ @@ -385,20 +381,24 @@ SRC_SHARED_MODULE_ALL = \ gamepad/__init__.c \ gamepadshift/GamePadShift.c \ gamepadshift/__init__.c \ + network/__init__.c \ os/__init__.c \ random/__init__.c \ - socket/__init__.c \ - network/__init__.c \ rgbmatrix/RGBMatrix.c \ rgbmatrix/__init__.c \ + socket/__init__.c \ storage/__init__.c \ struct/__init__.c \ - time/__init__.c \ terminalio/Terminal.c \ terminalio/__init__.c \ + time/__init__.c \ uheap/__init__.c \ ustack/__init__.c \ - _eve/__init__.c + vectorio/Circle.c \ + vectorio/Polygon.c \ + vectorio/Rectangle.c \ + vectorio/VectorShape.c \ + vectorio/__init__.c \ # All possible sources are listed here, and are filtered by SRC_PATTERNS. SRC_SHARED_MODULE = $(filter $(SRC_PATTERNS), $(SRC_SHARED_MODULE_ALL)) From d43449a6d613c5a6a386231745f6fca91b352b79 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 22 Jun 2020 10:17:44 -0500 Subject: [PATCH 0051/1293] sparkfun samd51 thing plus: Fix board.I2C() This had the SDA and SCL pins transposed, so nothing worked. --- .../boards/sparkfun_samd51_thing_plus/mpconfigboard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/mpconfigboard.h b/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/mpconfigboard.h index a5dee295bf..97a4465a19 100644 --- a/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/mpconfigboard.h +++ b/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/mpconfigboard.h @@ -18,8 +18,8 @@ #define BOARD_HAS_CRYSTAL 1 -#define DEFAULT_I2C_BUS_SCL (&pin_PA22) -#define DEFAULT_I2C_BUS_SDA (&pin_PA23) +#define DEFAULT_I2C_BUS_SCL (&pin_PA23) +#define DEFAULT_I2C_BUS_SDA (&pin_PA22) #define DEFAULT_SPI_BUS_SCK (&pin_PB13) #define DEFAULT_SPI_BUS_MOSI (&pin_PB12) From 65512cef1c278258f525422fe57271ffac6f51b0 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 22 Jun 2020 15:59:15 -0500 Subject: [PATCH 0052/1293] Update tick.c --- supervisor/shared/tick.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 3842b67d56..106ff53f89 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -104,13 +104,13 @@ void mp_hal_delay_ms(mp_uint_t delay) { // Check to see if we've been CTRL-Ced by autoreload or the user. if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) { - // clear exception and generate stacktrace + // clear exception and generate stacktrace MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; nlr_raise(mp_obj_new_exception(&mp_type_KeyboardInterrupt)); } if( MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || WATCHDOG_EXCEPTION_CHECK()) { - // stop sleeping immediately + // stop sleeping immediately break; } remaining = end_tick - port_get_raw_ticks(NULL); From 30a1624d59830e9eb73340e329586beec704b713 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 22 Jun 2020 20:18:55 -0500 Subject: [PATCH 0053/1293] Removed unneeded #includes --- shared-module/time/__init__.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/shared-module/time/__init__.c b/shared-module/time/__init__.c index 2e43799415..347e68ae02 100644 --- a/shared-module/time/__init__.c +++ b/shared-module/time/__init__.c @@ -27,8 +27,6 @@ #include "py/mphal.h" #include "supervisor/port.h" #include "supervisor/shared/tick.h" -#include "py/obj.h" -#include "py/mpstate.h" uint64_t common_hal_time_monotonic(void) { return supervisor_ticks_ms64(); From da733c01da5c19d377aa215d25abdcd074fbc846 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 18 Jun 2020 14:13:59 -0500 Subject: [PATCH 0054/1293] atmel-samd: Add support for SAM E54 family MCUs This introduces the new macro SAM_D5X_E5X. This is mostly the same as SAMD51 before, except in a few places where a special case for SAME54 is required --- ports/atmel-samd/Makefile | 55 +- ports/atmel-samd/asf4 | 2 +- .../asf4_conf/same54/hpl_adc_config.h | 303 + .../asf4_conf/same54/hpl_dac_config.h | 169 + .../asf4_conf/same54/hpl_dmac_config.h | 7277 +++++++++++++++++ .../asf4_conf/same54/hpl_gclk_config.h | 924 +++ .../asf4_conf/same54/hpl_mclk_config.h | 104 + .../asf4_conf/same54/hpl_nvmctrl_config.h | 36 + .../asf4_conf/same54/hpl_osc32kctrl_config.h | 163 + .../asf4_conf/same54/hpl_oscctrl_config.h | 634 ++ .../asf4_conf/same54/hpl_rtc_config.h | 145 + .../asf4_conf/same54/hpl_sercom_config.h | 751 ++ .../asf4_conf/same54/hpl_systick_config.h | 18 + .../asf4_conf/same54/hpl_tc_config.h | 209 + .../asf4_conf/same54/hpl_trng_config.h | 27 + .../asf4_conf/same54/hpl_usb_config.h | 413 + .../asf4_conf/same54/peripheral_clk_config.h | 1006 +++ .../atmel-samd/asf4_conf/same54/usbd_config.h | 850 ++ ports/atmel-samd/bindings/samd/Clock.c | 2 +- ports/atmel-samd/common-hal/_pew/PewPew.c | 4 +- .../common-hal/analogio/AnalogOut.c | 20 +- .../atmel-samd/common-hal/audiobusio/I2SOut.c | 26 +- .../atmel-samd/common-hal/audiobusio/PDMIn.c | 20 +- .../atmel-samd/common-hal/audioio/AudioOut.c | 46 +- .../atmel-samd/common-hal/audioio/AudioOut.h | 2 +- ports/atmel-samd/common-hal/busio/UART.c | 2 +- .../common-hal/frequencyio/FrequencyIn.c | 44 +- .../common-hal/frequencyio/FrequencyIn.h | 2 +- .../common-hal/microcontroller/Pin.c | 8 +- .../common-hal/microcontroller/Processor.c | 8 +- .../common-hal/neopixel_write/__init__.c | 17 +- ports/atmel-samd/common-hal/os/__init__.c | 6 +- ports/atmel-samd/common-hal/pulseio/PWMOut.c | 16 +- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 6 +- .../atmel-samd/common-hal/pulseio/PulseOut.c | 4 +- ports/atmel-samd/mpconfigport.h | 14 +- ports/atmel-samd/mphalport.c | 2 +- ports/atmel-samd/peripherals | 2 +- ports/atmel-samd/supervisor/internal_flash.c | 8 +- ports/atmel-samd/supervisor/port.c | 33 +- ports/atmel-samd/supervisor/same54_cpu.s | 27 + ports/atmel-samd/supervisor/usb.c | 6 +- 42 files changed, 13257 insertions(+), 154 deletions(-) create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_adc_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_dac_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_dmac_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_gclk_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_mclk_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_nvmctrl_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_osc32kctrl_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_oscctrl_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_rtc_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_sercom_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_systick_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_tc_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_trng_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_usb_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/usbd_config.h create mode 100755 ports/atmel-samd/supervisor/same54_cpu.s diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 8eb24e8361..5f901a1991 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -86,17 +86,27 @@ INC += -I. \ # NDEBUG disables assert() statements. This reduces code size pretty dramatically, per tannewt. ifeq ($(CHIP_FAMILY), samd21) +PERIPHERALS_CHIP_FAMILY=samd21 CFLAGS += -Os -DNDEBUG # TinyUSB defines CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 endif ifeq ($(CHIP_FAMILY), samd51) +PERIPHERALS_CHIP_FAMILY=sam_d5x_e5x CFLAGS += -Os -DNDEBUG # TinyUSB defines CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD51 -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 +ifeq ($(CHIP_FAMILY), same54) +PERIPHERALS_CHIP_FAMILY=sam_d5x_e5x +CFLAGS += -Os -DNDEBUG +# TinyUSB defines +CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD51 -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 + +$(echo PERIPHERALS_CHIP_FAMILY=$(PERIPHERALS_CHIP_FAMILY)) #Debugging/Optimization ifeq ($(DEBUG), 1) CFLAGS += -ggdb @@ -152,7 +162,16 @@ CFLAGS += \ -mcpu=cortex-m4 \ -mfloat-abi=hard \ -mfpu=fpv4-sp-d16 \ - -DSAMD51 + -DSAM_D5X_E5X -DSAMD51 +endif +ifeq ($(CHIP_FAMILY), same54) +CFLAGS += \ + -mthumb \ + -mabi=aapcs-linux \ + -mcpu=cortex-m4 \ + -mfloat-abi=hard \ + -mfpu=fpv4-sp-d16 \ + -DSAM_D5X_E5X -DSAME54 endif @@ -171,6 +190,9 @@ BOOTLOADER_SIZE := 0x2000 else ifeq ($(CHIP_FAMILY), samd51) LDFLAGS += -mthumb -mcpu=cortex-m4 BOOTLOADER_SIZE := 0x4000 +else ifeq ($(CHIP_FAMILY), same54) +LDFLAGS += -mthumb -mcpu=cortex-m4 +BOOTLOADER_SIZE := 0x4000 endif SRC_ASF := \ @@ -213,6 +235,15 @@ SRC_ASF += \ hpl/oscctrl/hpl_oscctrl.c \ hpl/trng/hpl_trng.c \ +else ifeq ($(CHIP_FAMILY), same54) +SRC_ASF += \ + hal/src/hal_rand_sync.c \ + hpl/core/hpl_core_m4.c \ + hpl/mclk/hpl_mclk.c \ + hpl/osc32kctrl/hpl_osc32kctrl.c \ + hpl/oscctrl/hpl_oscctrl.c \ + hpl/trng/hpl_trng.c \ + endif SRC_ASF := $(addprefix asf4/$(CHIP_FAMILY)/, $(SRC_ASF)) @@ -240,15 +271,15 @@ SRC_C = \ lib/utils/stdout_helpers.c \ lib/utils/sys_stdio_mphal.c \ mphalport.c \ - peripherals/samd/$(CHIP_FAMILY)/adc.c \ - peripherals/samd/$(CHIP_FAMILY)/cache.c \ - peripherals/samd/$(CHIP_FAMILY)/clocks.c \ - peripherals/samd/$(CHIP_FAMILY)/dma.c \ - peripherals/samd/$(CHIP_FAMILY)/events.c \ - peripherals/samd/$(CHIP_FAMILY)/external_interrupts.c \ - peripherals/samd/$(CHIP_FAMILY)/pins.c \ - peripherals/samd/$(CHIP_FAMILY)/sercom.c \ - peripherals/samd/$(CHIP_FAMILY)/timers.c \ + peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/adc.c \ + peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/cache.c \ + peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/clocks.c \ + peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/dma.c \ + peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/events.c \ + peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/external_interrupts.c \ + peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/pins.c \ + peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/sercom.c \ + peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/timers.c \ peripherals/samd/clocks.c \ peripherals/samd/dma.c \ peripherals/samd/events.c \ @@ -288,7 +319,7 @@ endif # The smallest SAMD51 packages don't have I2S. Everything else does. ifeq ($(CIRCUITPY_AUDIOBUSIO),1) -SRC_C += peripherals/samd/i2s.c peripherals/samd/$(CHIP_FAMILY)/i2s.c +SRC_C += peripherals/samd/i2s.c peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/i2s.c endif SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \ @@ -317,7 +348,7 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) # Sources that only hold QSTRs after pre-processing. -SRC_QSTR_PREPROCESSOR += peripherals/samd/$(CHIP_FAMILY)/clocks.c +SRC_QSTR_PREPROCESSOR += peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/clocks.c all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 diff --git a/ports/atmel-samd/asf4 b/ports/atmel-samd/asf4 index 039b5f3bbc..c0eef7b751 160000 --- a/ports/atmel-samd/asf4 +++ b/ports/atmel-samd/asf4 @@ -1 +1 @@ -Subproject commit 039b5f3bbc3f4ba4421e581db290560d59fef625 +Subproject commit c0eef7b75124fc946af5f75e12d82d6d01315ab1 diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_adc_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_adc_config.h new file mode 100644 index 0000000000..13d8151028 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_adc_config.h @@ -0,0 +1,303 @@ +/* Auto-generated config file hpl_adc_config.h */ +#ifndef HPL_ADC_CONFIG_H +#define HPL_ADC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +#ifndef CONF_ADC_0_ENABLE +#define CONF_ADC_0_ENABLE 1 +#endif + +// Basic Configuration + +// Conversion Result Resolution +// <0x0=>12-bit +// <0x1=>16-bit (averaging must be enabled) +// <0x2=>10-bit +// <0x3=>8-bit +// Defines the bit resolution for the ADC sample values (RESSEL) +// adc_resolution +#ifndef CONF_ADC_0_RESSEL +#define CONF_ADC_0_RESSEL 0x0 +#endif + +// Reference Selection +// <0x0=>Internal bandgap reference +// <0x2=>1/2 VDDANA (only for VDDANA > 2.0V) +// <0x3=>VDDANA +// <0x4=>External reference A +// <0x5=>External reference B +// <0x6=>External reference C +// Select the reference for the ADC (REFSEL) +// adc_reference +#ifndef CONF_ADC_0_REFSEL +#define CONF_ADC_0_REFSEL 0x0 +#endif + +// Prescaler configuration +// <0x0=>Peripheral clock divided by 2 +// <0x1=>Peripheral clock divided by 4 +// <0x2=>Peripheral clock divided by 8 +// <0x3=>Peripheral clock divided by 16 +// <0x4=>Peripheral clock divided by 32 +// <0x5=>Peripheral clock divided by 64 +// <0x6=>Peripheral clock divided by 128 +// <0x7=>Peripheral clock divided by 256 +// These bits define the ADC clock relative to the peripheral clock (PRESCALER) +// adc_prescaler +#ifndef CONF_ADC_0_PRESCALER +#define CONF_ADC_0_PRESCALER 0x3 +#endif + +// Free Running Mode +// When enabled, the ADC is in free running mode and a new conversion will be initiated when a previous conversion completes. (FREERUN) +// adc_freerunning_mode +#ifndef CONF_ADC_0_FREERUN +#define CONF_ADC_0_FREERUN 0 +#endif + +// Differential Mode +// In differential mode, the voltage difference between the MUXPOS and MUXNEG inputs will be converted by the ADC. (DIFFMODE) +// adc_differential_mode +#ifndef CONF_ADC_0_DIFFMODE +#define CONF_ADC_0_DIFFMODE 0 +#endif + +// Positive Mux Input Selection +// <0x00=>ADC AIN0 pin +// <0x01=>ADC AIN1 pin +// <0x02=>ADC AIN2 pin +// <0x03=>ADC AIN3 pin +// <0x04=>ADC AIN4 pin +// <0x05=>ADC AIN5 pin +// <0x06=>ADC AIN6 pin +// <0x07=>ADC AIN7 pin +// <0x08=>ADC AIN8 pin +// <0x09=>ADC AIN9 pin +// <0x0A=>ADC AIN10 pin +// <0x0B=>ADC AIN11 pin +// <0x0C=>ADC AIN12 pin +// <0x0D=>ADC AIN13 pin +// <0x0E=>ADC AIN14 pin +// <0x0F=>ADC AIN15 pin +// <0x18=>1/4 scaled core supply +// <0x19=>1/4 Scaled VBAT Supply +// <0x1A=>1/4 scaled I/O supply +// <0x1B=>Bandgap voltage +// <0x1C=>Temperature reference (PTAT) +// <0x1D=>Temperature reference (CTAT) +// <0x1E=>DAC Output +// These bits define the Mux selection for the positive ADC input. (MUXPOS) +// adc_pinmux_positive +#ifndef CONF_ADC_0_MUXPOS +#define CONF_ADC_0_MUXPOS 0x0 +#endif + +// Negative Mux Input Selection +// <0x00=>ADC AIN0 pin +// <0x01=>ADC AIN1 pin +// <0x02=>ADC AIN2 pin +// <0x03=>ADC AIN3 pin +// <0x04=>ADC AIN4 pin +// <0x05=>ADC AIN5 pin +// <0x06=>ADC AIN6 pin +// <0x07=>ADC AIN7 pin +// <0x18=>Internal ground +// <0x19=>I/O ground +// These bits define the Mux selection for the negative ADC input. (MUXNEG) +// adc_pinmux_negative +#ifndef CONF_ADC_0_MUXNEG +#define CONF_ADC_0_MUXNEG 0x0 +#endif + +// + +// Advanced Configuration +// adc_advanced_settings +#ifndef CONF_ADC_0_ADVANCED +#define CONF_ADC_0_ADVANCED 0 +#endif + +// Run in standby +// Indicates whether the ADC will continue running in standby sleep mode or not (RUNSTDBY) +// adc_arch_runstdby +#ifndef CONF_ADC_0_RUNSTDBY +#define CONF_ADC_0_RUNSTDBY 0 +#endif + +// Debug Run +// If enabled, the ADC is running if the CPU is halted by an external debugger. (DBGRUN) +// adc_arch_dbgrun +#ifndef CONF_ADC_0_DBGRUN +#define CONF_ADC_0_DBGRUN 0 +#endif + +// On Demand Control +// Will keep the ADC peripheral running if requested by other peripherals (ONDEMAND) +// adc_arch_ondemand +#ifndef CONF_ADC_0_ONDEMAND +#define CONF_ADC_0_ONDEMAND 0 +#endif + +// Left-Adjusted Result +// When enabled, the ADC conversion result is left-adjusted in the RESULT register. The high byte of the 12-bit result will be present in the upper part of the result register. (LEFTADJ) +// adc_arch_leftadj +#ifndef CONF_ADC_0_LEFTADJ +#define CONF_ADC_0_LEFTADJ 0 +#endif + +// Reference Buffer Offset Compensation Enable +// The accuracy of the gain stage can be increased by enabling the reference buffer offset compensation. This will decrease the input impedance and thus increase the start-up time of the reference. (REFCOMP) +// adc_arch_refcomp +#ifndef CONF_ADC_0_REFCOMP +#define CONF_ADC_0_REFCOMP 0 +#endif + +// Comparator Offset Compensation Enable +// This bit indicates whether the Comparator Offset Compensation is enabled or not (OFFCOMP) +// adc_arch_offcomp +#ifndef CONF_ADC_0_OFFCOMP +#define CONF_ADC_0_OFFCOMP 0 +#endif + +// Digital Correction Logic Enabled +// When enabled, the ADC conversion result in the RESULT register is then corrected for gain and offset based on the values in the GAINCAL and OFFSETCAL registers. (CORREN) +// adc_arch_corren +#ifndef CONF_ADC_0_CORREN +#define CONF_ADC_0_CORREN 0 +#endif + +// Offset Correction Value <0-4095> +// If the digital correction logic is enabled (CTRLB.CORREN = 1), these bits define how the ADC conversion result is compensated for offset error before being written to the Result register. (OFFSETCORR) +// adc_arch_offsetcorr +#ifndef CONF_ADC_0_OFFSETCORR +#define CONF_ADC_0_OFFSETCORR 0 +#endif + +// Gain Correction Value <0-4095> +// If the digital correction logic is enabled (CTRLB.CORREN = 1), these bits define how the ADC conversion result is compensated for gain error before being written to the result register. (GAINCORR) +// adc_arch_gaincorr +#ifndef CONF_ADC_0_GAINCORR +#define CONF_ADC_0_GAINCORR 0 +#endif + +// Adjusting Result / Division Coefficient <0-7> +// These bits define the division coefficient in 2n steps. (ADJRES) +// adc_arch_adjres +#ifndef CONF_ADC_0_ADJRES +#define CONF_ADC_0_ADJRES 0x0 +#endif + +// Number of Samples to be Collected +// <0x0=>1 sample +// <0x1=>2 samples +// <0x2=>4 samples +// <0x3=>8 samples +// <0x4=>16 samples +// <0x5=>32 samples +// <0x6=>64 samples +// <0x7=>128 samples +// <0x8=>256 samples +// <0x9=>512 samples +// <0xA=>1024 samples +// Define how many samples should be added together.The result will be available in the Result register (SAMPLENUM) +// adc_arch_samplenum +#ifndef CONF_ADC_0_SAMPLENUM +#define CONF_ADC_0_SAMPLENUM 0x0 +#endif + +// Sampling Time Length <0-63> +// These bits control the ADC sampling time in number of half CLK_ADC cycles, depending of the prescaler value, thus controlling the ADC input impedance. (SAMPLEN) +// adc_arch_samplen +#ifndef CONF_ADC_0_SAMPLEN +#define CONF_ADC_0_SAMPLEN 0 +#endif + +// Window Monitor Mode +// <0x0=>No window mode +// <0x1=>Mode 1: RESULT above lower threshold +// <0x2=>Mode 2: RESULT beneath upper threshold +// <0x3=>Mode 3: RESULT inside lower and upper threshold +// <0x4=>Mode 4: RESULT outside lower and upper threshold +// These bits enable and define the window monitor mode. (WINMODE) +// adc_arch_winmode +#ifndef CONF_ADC_0_WINMODE +#define CONF_ADC_0_WINMODE 0x0 +#endif + +// Window Monitor Lower Threshold <0-65535> +// If the window monitor is enabled, these bits define the lower threshold value. (WINLT) +// adc_arch_winlt +#ifndef CONF_ADC_0_WINLT +#define CONF_ADC_0_WINLT 0 +#endif + +// Window Monitor Upper Threshold <0-65535> +// If the window monitor is enabled, these bits define the lower threshold value. (WINUT) +// adc_arch_winut +#ifndef CONF_ADC_0_WINUT +#define CONF_ADC_0_WINUT 0 +#endif + +// Bitmask for positive input sequence <0-4294967295> +// Use this parameter to input the bitmask for positive input sequence control (refer to datasheet for the device). +// adc_arch_seqen +#ifndef CONF_ADC_0_SEQEN +#define CONF_ADC_0_SEQEN 0x0 +#endif + +// + +// Event Control +// adc_arch_event_settings +#ifndef CONF_ADC_0_EVENT_CONTROL +#define CONF_ADC_0_EVENT_CONTROL 0 +#endif + +// Window Monitor Event Out +// Enables event output on window event (WINMONEO) +// adc_arch_winmoneo +#ifndef CONF_ADC_0_WINMONEO +#define CONF_ADC_0_WINMONEO 0 +#endif + +// Result Ready Event Out +// Enables event output on result ready event (RESRDEO) +// adc_arch_resrdyeo +#ifndef CONF_ADC_0_RESRDYEO +#define CONF_ADC_0_RESRDYEO 0 +#endif + +// Invert flush Event Signal +// Invert the flush event input signal (FLUSHINV) +// adc_arch_flushinv +#ifndef CONF_ADC_0_FLUSHINV +#define CONF_ADC_0_FLUSHINV 0 +#endif + +// Trigger Flush On Event +// Trigger an ADC pipeline flush on event (FLUSHEI) +// adc_arch_flushei +#ifndef CONF_ADC_0_FLUSHEI +#define CONF_ADC_0_FLUSHEI 0 +#endif + +// Invert Start Conversion Event Signal +// Invert the start conversion event input signal (STARTINV) +// adc_arch_startinv +#ifndef CONF_ADC_0_STARTINV +#define CONF_ADC_0_STARTINV 0 +#endif + +// Trigger Conversion On Event +// Trigger a conversion on event. (STARTEI) +// adc_arch_startei +#ifndef CONF_ADC_0_STARTEI +#define CONF_ADC_0_STARTEI 0 +#endif + +// + +// <<< end of configuration section >>> + +#endif // HPL_ADC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_dac_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_dac_config.h new file mode 100644 index 0000000000..c46f99b7db --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_dac_config.h @@ -0,0 +1,169 @@ +/* Auto-generated config file hpl_dac_config.h */ +#ifndef HPL_DAC_CONFIG_H +#define HPL_DAC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Basic configuration +// Reference Selection +// <0x00=> Unbuffered external voltage reference +// <0x01=> Voltage supply +// <0x02=> Buffered external voltage reference +// <0x03=> Internal bandgap reference +// dac_arch_refsel +#ifndef CONF_DAC_REFSEL +#define CONF_DAC_REFSEL 0 +#endif + +// Differential mode +// Indicates whether the differential mode is enabled or not +// dac_arch_diff +#ifndef CONF_DAC_DIFF +#define CONF_DAC_DIFF 0 +#endif +// + +// Advanced Configuration +// dac_advanced_settings +#ifndef CONF_DAC_ADVANCED_CONFIG +#define CONF_DAC_ADVANCED_CONFIG 0 +#endif + +// Debug Run +// Indicate whether running when CPU is halted +// adc_arch_dbgrun +#ifndef CONF_DAC_DBGRUN +#define CONF_DAC_DBGRUN 1 +#endif + +// Channel 0 configuration +// Left Adjusted Data +// Indicate how the data is adjusted in the Data and Data Buffer register +// dac0_arch_leftadj +#ifndef CONF_DAC0_LEFTADJ +#define CONF_DAC0_LEFTADJ 1 +#endif + +// Current control +// <0=> GCLK_DAC <= 1.2MHz (100kSPS) +// <1=> 1.2MHz < GCLK_DAC <= 6MHz (500kSPS) +// <2=> 6MHz < GCLK_DAC <= 12MHz (1MSPS) +// This defines the current in output buffer according to conversion rate +// dac0_arch_cctrl +#ifndef CONF_DAC0_CCTRL +#define CONF_DAC0_CCTRL 0 +#endif + +// Run in standby +// Indicates whether the DAC channel will continue running in standby sleep mode or not +// dac0_arch_runstdby +#ifndef CONF_DAC0_RUNSTDBY +#define CONF_DAC0_RUNSTDBY 0 +#endif + +// Dithering Mode +// Indicate whether dithering mode is enabled +// dac0_arch_ditrher +#ifndef CONF_DAC0_DITHER +#define CONF_DAC0_DITHER 0 +#endif + +// Refresh period <0x00-0xFF> +// This defines the refresh period. If it is 0, the refresh mode is disabled, else the refresh period is: value * 500us +// dac0_arch_refresh +#ifndef CONF_DAC0_REFRESH +#define CONF_DAC0_REFRESH 2 +#endif +// +// Channel 1 configuration +// Left Adjusted Data +// Indicate how the data is adjusted in the Data and Data Buffer register +// dac1_arch_leftadj +#ifndef CONF_DAC1_LEFTADJ +#define CONF_DAC1_LEFTADJ 1 +#endif + +// Current control +// <0=> GCLK_DAC <= 1.2MHz (100kSPS) +// <1=> 1.2MHz < GCLK_DAC <= 6MHz (500kSPS) +// <2=> 6MHz < GCLK_DAC <= 12MHz (1MSPS) +// This defines the current in output buffer according to conversion rate +// dac1_arch_cctrl +#ifndef CONF_DAC1_CCTRL +#define CONF_DAC1_CCTRL 0 +#endif + +// Run in standby +// Indicates whether the DAC channel will continue running in standby sleep mode or not +// dac1_arch_runstdby +#ifndef CONF_DAC1_RUNSTDBY +#define CONF_DAC1_RUNSTDBY 0 +#endif + +// Dithering Mode +// Indicate whether dithering mode is enabled +// dac1_arch_ditrher +#ifndef CONF_DAC1_DITHER +#define CONF_DAC1_DITHER 0 +#endif + +// Refresh period <0x00-0xFF> +// This defines the refresh period. If it is 0, the refresh mode is disabled, else the refresh period is: value * 500us +// dac1_arch_refresh +#ifndef CONF_DAC1_REFRESH +#define CONF_DAC1_REFRESH 2 +#endif +// + +// Event configuration +// Inversion of DAC 0 event +// <0=> Detection on rising edge pf the input event +// <1=> Detection on falling edge pf the input event +// This defines the edge detection of the input event +// dac_arch_invei0 +#ifndef CONF_DAC_INVEI0 +#define CONF_DAC_INVEI0 0 +#endif + +// Data Buffer of DAC 0 Empty Event Output +// Indicate whether Data Buffer Empty Event is enabled and generated when the Data Buffer register is empty or not +// dac_arch_emptyeo_0 +#ifndef CONF_DAC_EMPTYEO0 +#define CONF_DAC_EMPTYEO0 0 +#endif + +// Start Conversion Event Input DAC 0 +// Indicate whether Start input event is enabled +// dac_arch_startei_0 +#ifndef CONF_DAC_STARTEI0 +#define CONF_DAC_STARTEI0 0 +#endif +// Inversion of DAC 1 event +// <0=> Detection on rising edge pf the input event +// <1=> Detection on falling edge pf the input event +// This defines the edge detection of the input event +// dac_arch_invei1 +#ifndef CONF_DAC_INVEI1 +#define CONF_DAC_INVEI1 0 +#endif + +// Data Buffer of DAC 1 Empty Event Output +// Indicate whether Data Buffer Empty Event is enabled and generated when the Data Buffer register is empty or not +// dac_arch_emptyeo_1 +#ifndef CONF_DAC_EMPTYEO1 +#define CONF_DAC_EMPTYEO1 0 +#endif + +// Start Conversion Event Input DAC 1 +// Indicate whether Start input event is enabled +// dac_arch_startei_1 +#ifndef CONF_DAC_STARTEI1 +#define CONF_DAC_STARTEI1 0 +#endif + +// +// + +// <<< end of configuration section >>> + +#endif // HPL_DAC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_dmac_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_dmac_config.h new file mode 100644 index 0000000000..90499fc27f --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_dmac_config.h @@ -0,0 +1,7277 @@ +/* Auto-generated config file hpl_dmac_config.h */ +#ifndef HPL_DMAC_CONFIG_H +#define HPL_DMAC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// DMAC enable +// Indicates whether dmac is enabled or not +// dmac_enable +#ifndef CONF_DMAC_ENABLE +#define CONF_DMAC_ENABLE 0 +#endif + +// Priority Level 0 +// Indicates whether Priority Level 0 is enabled or not +// dmac_lvlen0 +#ifndef CONF_DMAC_LVLEN0 +#define CONF_DMAC_LVLEN0 1 +#endif + +// Level 0 Round-Robin Arbitration +// <0=> Static arbitration scheme for channel with priority 0 +// <1=> Round-robin arbitration scheme for channel with priority 0 +// Defines Level 0 Arbitration for DMA channels +// dmac_rrlvlen0 +#ifndef CONF_DMAC_RRLVLEN0 +#define CONF_DMAC_RRLVLEN0 0 +#endif + +// Level 0 Channel Priority Number <0x00-0xFF> +// dmac_lvlpri0 +#ifndef CONF_DMAC_LVLPRI0 +#define CONF_DMAC_LVLPRI0 0 +#endif +// Priority Level 1 +// Indicates whether Priority Level 1 is enabled or not +// dmac_lvlen1 +#ifndef CONF_DMAC_LVLEN1 +#define CONF_DMAC_LVLEN1 1 +#endif + +// Level 1 Round-Robin Arbitration +// <0=> Static arbitration scheme for channel with priority 1 +// <1=> Round-robin arbitration scheme for channel with priority 1 +// Defines Level 1 Arbitration for DMA channels +// dmac_rrlvlen1 +#ifndef CONF_DMAC_RRLVLEN1 +#define CONF_DMAC_RRLVLEN1 0 +#endif + +// Level 1 Channel Priority Number <0x00-0xFF> +// dmac_lvlpri1 +#ifndef CONF_DMAC_LVLPRI1 +#define CONF_DMAC_LVLPRI1 0 +#endif +// Priority Level 2 +// Indicates whether Priority Level 2 is enabled or not +// dmac_lvlen2 +#ifndef CONF_DMAC_LVLEN2 +#define CONF_DMAC_LVLEN2 1 +#endif + +// Level 2 Round-Robin Arbitration +// <0=> Static arbitration scheme for channel with priority 2 +// <1=> Round-robin arbitration scheme for channel with priority 2 +// Defines Level 2 Arbitration for DMA channels +// dmac_rrlvlen2 +#ifndef CONF_DMAC_RRLVLEN2 +#define CONF_DMAC_RRLVLEN2 0 +#endif + +// Level 2 Channel Priority Number <0x00-0xFF> +// dmac_lvlpri2 +#ifndef CONF_DMAC_LVLPRI2 +#define CONF_DMAC_LVLPRI2 0 +#endif +// Priority Level 3 +// Indicates whether Priority Level 3 is enabled or not +// dmac_lvlen3 +#ifndef CONF_DMAC_LVLEN3 +#define CONF_DMAC_LVLEN3 1 +#endif + +// Level 3 Round-Robin Arbitration +// <0=> Static arbitration scheme for channel with priority 3 +// <1=> Round-robin arbitration scheme for channel with priority 3 +// Defines Level 3 Arbitration for DMA channels +// dmac_rrlvlen3 +#ifndef CONF_DMAC_RRLVLEN3 +#define CONF_DMAC_RRLVLEN3 0 +#endif + +// Level 3 Channel Priority Number <0x00-0xFF> +// dmac_lvlpri3 +#ifndef CONF_DMAC_LVLPRI3 +#define CONF_DMAC_LVLPRI3 0 +#endif +// Debug Run +// Indicates whether Debug Run is enabled or not +// dmac_dbgrun +#ifndef CONF_DMAC_DBGRUN +#define CONF_DMAC_DBGRUN 0 +#endif + +// Channel 0 settings +// dmac_channel_0_settings +#ifndef CONF_DMAC_CHANNEL_0_SETTINGS +#define CONF_DMAC_CHANNEL_0_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 0 is running in standby mode or not +// dmac_runstdby_0 +#ifndef CONF_DMAC_RUNSTDBY_0 +#define CONF_DMAC_RUNSTDBY_0 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_0 +#ifndef CONF_DMAC_TRIGACT_0 +#define CONF_DMAC_TRIGACT_0 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_0 +#ifndef CONF_DMAC_TRIGSRC_0 +#define CONF_DMAC_TRIGSRC_0 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_0 +#ifndef CONF_DMAC_LVL_0 +#define CONF_DMAC_LVL_0 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_0 +#ifndef CONF_DMAC_EVOE_0 +#define CONF_DMAC_EVOE_0 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_0 +#ifndef CONF_DMAC_EVIE_0 +#define CONF_DMAC_EVIE_0 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_0 +#ifndef CONF_DMAC_EVACT_0 +#define CONF_DMAC_EVACT_0 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_0 +#ifndef CONF_DMAC_STEPSIZE_0 +#define CONF_DMAC_STEPSIZE_0 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_0 +#ifndef CONF_DMAC_STEPSEL_0 +#define CONF_DMAC_STEPSEL_0 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_0 +#ifndef CONF_DMAC_SRCINC_0 +#define CONF_DMAC_SRCINC_0 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_0 +#ifndef CONF_DMAC_DSTINC_0 +#define CONF_DMAC_DSTINC_0 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_0 +#ifndef CONF_DMAC_BEATSIZE_0 +#define CONF_DMAC_BEATSIZE_0 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_0 +#ifndef CONF_DMAC_BLOCKACT_0 +#define CONF_DMAC_BLOCKACT_0 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_0 +#ifndef CONF_DMAC_EVOSEL_0 +#define CONF_DMAC_EVOSEL_0 0 +#endif +// + +// Channel 1 settings +// dmac_channel_1_settings +#ifndef CONF_DMAC_CHANNEL_1_SETTINGS +#define CONF_DMAC_CHANNEL_1_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 1 is running in standby mode or not +// dmac_runstdby_1 +#ifndef CONF_DMAC_RUNSTDBY_1 +#define CONF_DMAC_RUNSTDBY_1 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_1 +#ifndef CONF_DMAC_TRIGACT_1 +#define CONF_DMAC_TRIGACT_1 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_1 +#ifndef CONF_DMAC_TRIGSRC_1 +#define CONF_DMAC_TRIGSRC_1 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_1 +#ifndef CONF_DMAC_LVL_1 +#define CONF_DMAC_LVL_1 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_1 +#ifndef CONF_DMAC_EVOE_1 +#define CONF_DMAC_EVOE_1 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_1 +#ifndef CONF_DMAC_EVIE_1 +#define CONF_DMAC_EVIE_1 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_1 +#ifndef CONF_DMAC_EVACT_1 +#define CONF_DMAC_EVACT_1 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_1 +#ifndef CONF_DMAC_STEPSIZE_1 +#define CONF_DMAC_STEPSIZE_1 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_1 +#ifndef CONF_DMAC_STEPSEL_1 +#define CONF_DMAC_STEPSEL_1 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_1 +#ifndef CONF_DMAC_SRCINC_1 +#define CONF_DMAC_SRCINC_1 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_1 +#ifndef CONF_DMAC_DSTINC_1 +#define CONF_DMAC_DSTINC_1 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_1 +#ifndef CONF_DMAC_BEATSIZE_1 +#define CONF_DMAC_BEATSIZE_1 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_1 +#ifndef CONF_DMAC_BLOCKACT_1 +#define CONF_DMAC_BLOCKACT_1 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_1 +#ifndef CONF_DMAC_EVOSEL_1 +#define CONF_DMAC_EVOSEL_1 0 +#endif +// + +// Channel 2 settings +// dmac_channel_2_settings +#ifndef CONF_DMAC_CHANNEL_2_SETTINGS +#define CONF_DMAC_CHANNEL_2_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 2 is running in standby mode or not +// dmac_runstdby_2 +#ifndef CONF_DMAC_RUNSTDBY_2 +#define CONF_DMAC_RUNSTDBY_2 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_2 +#ifndef CONF_DMAC_TRIGACT_2 +#define CONF_DMAC_TRIGACT_2 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_2 +#ifndef CONF_DMAC_TRIGSRC_2 +#define CONF_DMAC_TRIGSRC_2 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_2 +#ifndef CONF_DMAC_LVL_2 +#define CONF_DMAC_LVL_2 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_2 +#ifndef CONF_DMAC_EVOE_2 +#define CONF_DMAC_EVOE_2 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_2 +#ifndef CONF_DMAC_EVIE_2 +#define CONF_DMAC_EVIE_2 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_2 +#ifndef CONF_DMAC_EVACT_2 +#define CONF_DMAC_EVACT_2 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_2 +#ifndef CONF_DMAC_STEPSIZE_2 +#define CONF_DMAC_STEPSIZE_2 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_2 +#ifndef CONF_DMAC_STEPSEL_2 +#define CONF_DMAC_STEPSEL_2 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_2 +#ifndef CONF_DMAC_SRCINC_2 +#define CONF_DMAC_SRCINC_2 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_2 +#ifndef CONF_DMAC_DSTINC_2 +#define CONF_DMAC_DSTINC_2 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_2 +#ifndef CONF_DMAC_BEATSIZE_2 +#define CONF_DMAC_BEATSIZE_2 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_2 +#ifndef CONF_DMAC_BLOCKACT_2 +#define CONF_DMAC_BLOCKACT_2 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_2 +#ifndef CONF_DMAC_EVOSEL_2 +#define CONF_DMAC_EVOSEL_2 0 +#endif +// + +// Channel 3 settings +// dmac_channel_3_settings +#ifndef CONF_DMAC_CHANNEL_3_SETTINGS +#define CONF_DMAC_CHANNEL_3_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 3 is running in standby mode or not +// dmac_runstdby_3 +#ifndef CONF_DMAC_RUNSTDBY_3 +#define CONF_DMAC_RUNSTDBY_3 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_3 +#ifndef CONF_DMAC_TRIGACT_3 +#define CONF_DMAC_TRIGACT_3 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_3 +#ifndef CONF_DMAC_TRIGSRC_3 +#define CONF_DMAC_TRIGSRC_3 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_3 +#ifndef CONF_DMAC_LVL_3 +#define CONF_DMAC_LVL_3 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_3 +#ifndef CONF_DMAC_EVOE_3 +#define CONF_DMAC_EVOE_3 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_3 +#ifndef CONF_DMAC_EVIE_3 +#define CONF_DMAC_EVIE_3 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_3 +#ifndef CONF_DMAC_EVACT_3 +#define CONF_DMAC_EVACT_3 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_3 +#ifndef CONF_DMAC_STEPSIZE_3 +#define CONF_DMAC_STEPSIZE_3 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_3 +#ifndef CONF_DMAC_STEPSEL_3 +#define CONF_DMAC_STEPSEL_3 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_3 +#ifndef CONF_DMAC_SRCINC_3 +#define CONF_DMAC_SRCINC_3 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_3 +#ifndef CONF_DMAC_DSTINC_3 +#define CONF_DMAC_DSTINC_3 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_3 +#ifndef CONF_DMAC_BEATSIZE_3 +#define CONF_DMAC_BEATSIZE_3 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_3 +#ifndef CONF_DMAC_BLOCKACT_3 +#define CONF_DMAC_BLOCKACT_3 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_3 +#ifndef CONF_DMAC_EVOSEL_3 +#define CONF_DMAC_EVOSEL_3 0 +#endif +// + +// Channel 4 settings +// dmac_channel_4_settings +#ifndef CONF_DMAC_CHANNEL_4_SETTINGS +#define CONF_DMAC_CHANNEL_4_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 4 is running in standby mode or not +// dmac_runstdby_4 +#ifndef CONF_DMAC_RUNSTDBY_4 +#define CONF_DMAC_RUNSTDBY_4 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_4 +#ifndef CONF_DMAC_TRIGACT_4 +#define CONF_DMAC_TRIGACT_4 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_4 +#ifndef CONF_DMAC_TRIGSRC_4 +#define CONF_DMAC_TRIGSRC_4 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_4 +#ifndef CONF_DMAC_LVL_4 +#define CONF_DMAC_LVL_4 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_4 +#ifndef CONF_DMAC_EVOE_4 +#define CONF_DMAC_EVOE_4 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_4 +#ifndef CONF_DMAC_EVIE_4 +#define CONF_DMAC_EVIE_4 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_4 +#ifndef CONF_DMAC_EVACT_4 +#define CONF_DMAC_EVACT_4 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_4 +#ifndef CONF_DMAC_STEPSIZE_4 +#define CONF_DMAC_STEPSIZE_4 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_4 +#ifndef CONF_DMAC_STEPSEL_4 +#define CONF_DMAC_STEPSEL_4 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_4 +#ifndef CONF_DMAC_SRCINC_4 +#define CONF_DMAC_SRCINC_4 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_4 +#ifndef CONF_DMAC_DSTINC_4 +#define CONF_DMAC_DSTINC_4 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_4 +#ifndef CONF_DMAC_BEATSIZE_4 +#define CONF_DMAC_BEATSIZE_4 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_4 +#ifndef CONF_DMAC_BLOCKACT_4 +#define CONF_DMAC_BLOCKACT_4 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_4 +#ifndef CONF_DMAC_EVOSEL_4 +#define CONF_DMAC_EVOSEL_4 0 +#endif +// + +// Channel 5 settings +// dmac_channel_5_settings +#ifndef CONF_DMAC_CHANNEL_5_SETTINGS +#define CONF_DMAC_CHANNEL_5_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 5 is running in standby mode or not +// dmac_runstdby_5 +#ifndef CONF_DMAC_RUNSTDBY_5 +#define CONF_DMAC_RUNSTDBY_5 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_5 +#ifndef CONF_DMAC_TRIGACT_5 +#define CONF_DMAC_TRIGACT_5 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_5 +#ifndef CONF_DMAC_TRIGSRC_5 +#define CONF_DMAC_TRIGSRC_5 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_5 +#ifndef CONF_DMAC_LVL_5 +#define CONF_DMAC_LVL_5 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_5 +#ifndef CONF_DMAC_EVOE_5 +#define CONF_DMAC_EVOE_5 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_5 +#ifndef CONF_DMAC_EVIE_5 +#define CONF_DMAC_EVIE_5 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_5 +#ifndef CONF_DMAC_EVACT_5 +#define CONF_DMAC_EVACT_5 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_5 +#ifndef CONF_DMAC_STEPSIZE_5 +#define CONF_DMAC_STEPSIZE_5 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_5 +#ifndef CONF_DMAC_STEPSEL_5 +#define CONF_DMAC_STEPSEL_5 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_5 +#ifndef CONF_DMAC_SRCINC_5 +#define CONF_DMAC_SRCINC_5 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_5 +#ifndef CONF_DMAC_DSTINC_5 +#define CONF_DMAC_DSTINC_5 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_5 +#ifndef CONF_DMAC_BEATSIZE_5 +#define CONF_DMAC_BEATSIZE_5 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_5 +#ifndef CONF_DMAC_BLOCKACT_5 +#define CONF_DMAC_BLOCKACT_5 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_5 +#ifndef CONF_DMAC_EVOSEL_5 +#define CONF_DMAC_EVOSEL_5 0 +#endif +// + +// Channel 6 settings +// dmac_channel_6_settings +#ifndef CONF_DMAC_CHANNEL_6_SETTINGS +#define CONF_DMAC_CHANNEL_6_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 6 is running in standby mode or not +// dmac_runstdby_6 +#ifndef CONF_DMAC_RUNSTDBY_6 +#define CONF_DMAC_RUNSTDBY_6 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_6 +#ifndef CONF_DMAC_TRIGACT_6 +#define CONF_DMAC_TRIGACT_6 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_6 +#ifndef CONF_DMAC_TRIGSRC_6 +#define CONF_DMAC_TRIGSRC_6 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_6 +#ifndef CONF_DMAC_LVL_6 +#define CONF_DMAC_LVL_6 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_6 +#ifndef CONF_DMAC_EVOE_6 +#define CONF_DMAC_EVOE_6 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_6 +#ifndef CONF_DMAC_EVIE_6 +#define CONF_DMAC_EVIE_6 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_6 +#ifndef CONF_DMAC_EVACT_6 +#define CONF_DMAC_EVACT_6 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_6 +#ifndef CONF_DMAC_STEPSIZE_6 +#define CONF_DMAC_STEPSIZE_6 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_6 +#ifndef CONF_DMAC_STEPSEL_6 +#define CONF_DMAC_STEPSEL_6 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_6 +#ifndef CONF_DMAC_SRCINC_6 +#define CONF_DMAC_SRCINC_6 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_6 +#ifndef CONF_DMAC_DSTINC_6 +#define CONF_DMAC_DSTINC_6 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_6 +#ifndef CONF_DMAC_BEATSIZE_6 +#define CONF_DMAC_BEATSIZE_6 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_6 +#ifndef CONF_DMAC_BLOCKACT_6 +#define CONF_DMAC_BLOCKACT_6 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_6 +#ifndef CONF_DMAC_EVOSEL_6 +#define CONF_DMAC_EVOSEL_6 0 +#endif +// + +// Channel 7 settings +// dmac_channel_7_settings +#ifndef CONF_DMAC_CHANNEL_7_SETTINGS +#define CONF_DMAC_CHANNEL_7_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 7 is running in standby mode or not +// dmac_runstdby_7 +#ifndef CONF_DMAC_RUNSTDBY_7 +#define CONF_DMAC_RUNSTDBY_7 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_7 +#ifndef CONF_DMAC_TRIGACT_7 +#define CONF_DMAC_TRIGACT_7 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_7 +#ifndef CONF_DMAC_TRIGSRC_7 +#define CONF_DMAC_TRIGSRC_7 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_7 +#ifndef CONF_DMAC_LVL_7 +#define CONF_DMAC_LVL_7 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_7 +#ifndef CONF_DMAC_EVOE_7 +#define CONF_DMAC_EVOE_7 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_7 +#ifndef CONF_DMAC_EVIE_7 +#define CONF_DMAC_EVIE_7 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_7 +#ifndef CONF_DMAC_EVACT_7 +#define CONF_DMAC_EVACT_7 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_7 +#ifndef CONF_DMAC_STEPSIZE_7 +#define CONF_DMAC_STEPSIZE_7 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_7 +#ifndef CONF_DMAC_STEPSEL_7 +#define CONF_DMAC_STEPSEL_7 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_7 +#ifndef CONF_DMAC_SRCINC_7 +#define CONF_DMAC_SRCINC_7 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_7 +#ifndef CONF_DMAC_DSTINC_7 +#define CONF_DMAC_DSTINC_7 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_7 +#ifndef CONF_DMAC_BEATSIZE_7 +#define CONF_DMAC_BEATSIZE_7 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_7 +#ifndef CONF_DMAC_BLOCKACT_7 +#define CONF_DMAC_BLOCKACT_7 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_7 +#ifndef CONF_DMAC_EVOSEL_7 +#define CONF_DMAC_EVOSEL_7 0 +#endif +// + +// Channel 8 settings +// dmac_channel_8_settings +#ifndef CONF_DMAC_CHANNEL_8_SETTINGS +#define CONF_DMAC_CHANNEL_8_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 8 is running in standby mode or not +// dmac_runstdby_8 +#ifndef CONF_DMAC_RUNSTDBY_8 +#define CONF_DMAC_RUNSTDBY_8 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_8 +#ifndef CONF_DMAC_TRIGACT_8 +#define CONF_DMAC_TRIGACT_8 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_8 +#ifndef CONF_DMAC_TRIGSRC_8 +#define CONF_DMAC_TRIGSRC_8 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_8 +#ifndef CONF_DMAC_LVL_8 +#define CONF_DMAC_LVL_8 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_8 +#ifndef CONF_DMAC_EVOE_8 +#define CONF_DMAC_EVOE_8 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_8 +#ifndef CONF_DMAC_EVIE_8 +#define CONF_DMAC_EVIE_8 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_8 +#ifndef CONF_DMAC_EVACT_8 +#define CONF_DMAC_EVACT_8 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_8 +#ifndef CONF_DMAC_STEPSIZE_8 +#define CONF_DMAC_STEPSIZE_8 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_8 +#ifndef CONF_DMAC_STEPSEL_8 +#define CONF_DMAC_STEPSEL_8 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_8 +#ifndef CONF_DMAC_SRCINC_8 +#define CONF_DMAC_SRCINC_8 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_8 +#ifndef CONF_DMAC_DSTINC_8 +#define CONF_DMAC_DSTINC_8 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_8 +#ifndef CONF_DMAC_BEATSIZE_8 +#define CONF_DMAC_BEATSIZE_8 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_8 +#ifndef CONF_DMAC_BLOCKACT_8 +#define CONF_DMAC_BLOCKACT_8 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_8 +#ifndef CONF_DMAC_EVOSEL_8 +#define CONF_DMAC_EVOSEL_8 0 +#endif +// + +// Channel 9 settings +// dmac_channel_9_settings +#ifndef CONF_DMAC_CHANNEL_9_SETTINGS +#define CONF_DMAC_CHANNEL_9_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 9 is running in standby mode or not +// dmac_runstdby_9 +#ifndef CONF_DMAC_RUNSTDBY_9 +#define CONF_DMAC_RUNSTDBY_9 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_9 +#ifndef CONF_DMAC_TRIGACT_9 +#define CONF_DMAC_TRIGACT_9 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_9 +#ifndef CONF_DMAC_TRIGSRC_9 +#define CONF_DMAC_TRIGSRC_9 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_9 +#ifndef CONF_DMAC_LVL_9 +#define CONF_DMAC_LVL_9 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_9 +#ifndef CONF_DMAC_EVOE_9 +#define CONF_DMAC_EVOE_9 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_9 +#ifndef CONF_DMAC_EVIE_9 +#define CONF_DMAC_EVIE_9 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_9 +#ifndef CONF_DMAC_EVACT_9 +#define CONF_DMAC_EVACT_9 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_9 +#ifndef CONF_DMAC_STEPSIZE_9 +#define CONF_DMAC_STEPSIZE_9 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_9 +#ifndef CONF_DMAC_STEPSEL_9 +#define CONF_DMAC_STEPSEL_9 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_9 +#ifndef CONF_DMAC_SRCINC_9 +#define CONF_DMAC_SRCINC_9 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_9 +#ifndef CONF_DMAC_DSTINC_9 +#define CONF_DMAC_DSTINC_9 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_9 +#ifndef CONF_DMAC_BEATSIZE_9 +#define CONF_DMAC_BEATSIZE_9 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_9 +#ifndef CONF_DMAC_BLOCKACT_9 +#define CONF_DMAC_BLOCKACT_9 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_9 +#ifndef CONF_DMAC_EVOSEL_9 +#define CONF_DMAC_EVOSEL_9 0 +#endif +// + +// Channel 10 settings +// dmac_channel_10_settings +#ifndef CONF_DMAC_CHANNEL_10_SETTINGS +#define CONF_DMAC_CHANNEL_10_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 10 is running in standby mode or not +// dmac_runstdby_10 +#ifndef CONF_DMAC_RUNSTDBY_10 +#define CONF_DMAC_RUNSTDBY_10 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_10 +#ifndef CONF_DMAC_TRIGACT_10 +#define CONF_DMAC_TRIGACT_10 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_10 +#ifndef CONF_DMAC_TRIGSRC_10 +#define CONF_DMAC_TRIGSRC_10 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_10 +#ifndef CONF_DMAC_LVL_10 +#define CONF_DMAC_LVL_10 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_10 +#ifndef CONF_DMAC_EVOE_10 +#define CONF_DMAC_EVOE_10 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_10 +#ifndef CONF_DMAC_EVIE_10 +#define CONF_DMAC_EVIE_10 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_10 +#ifndef CONF_DMAC_EVACT_10 +#define CONF_DMAC_EVACT_10 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_10 +#ifndef CONF_DMAC_STEPSIZE_10 +#define CONF_DMAC_STEPSIZE_10 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_10 +#ifndef CONF_DMAC_STEPSEL_10 +#define CONF_DMAC_STEPSEL_10 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_10 +#ifndef CONF_DMAC_SRCINC_10 +#define CONF_DMAC_SRCINC_10 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_10 +#ifndef CONF_DMAC_DSTINC_10 +#define CONF_DMAC_DSTINC_10 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_10 +#ifndef CONF_DMAC_BEATSIZE_10 +#define CONF_DMAC_BEATSIZE_10 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_10 +#ifndef CONF_DMAC_BLOCKACT_10 +#define CONF_DMAC_BLOCKACT_10 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_10 +#ifndef CONF_DMAC_EVOSEL_10 +#define CONF_DMAC_EVOSEL_10 0 +#endif +// + +// Channel 11 settings +// dmac_channel_11_settings +#ifndef CONF_DMAC_CHANNEL_11_SETTINGS +#define CONF_DMAC_CHANNEL_11_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 11 is running in standby mode or not +// dmac_runstdby_11 +#ifndef CONF_DMAC_RUNSTDBY_11 +#define CONF_DMAC_RUNSTDBY_11 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_11 +#ifndef CONF_DMAC_TRIGACT_11 +#define CONF_DMAC_TRIGACT_11 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_11 +#ifndef CONF_DMAC_TRIGSRC_11 +#define CONF_DMAC_TRIGSRC_11 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_11 +#ifndef CONF_DMAC_LVL_11 +#define CONF_DMAC_LVL_11 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_11 +#ifndef CONF_DMAC_EVOE_11 +#define CONF_DMAC_EVOE_11 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_11 +#ifndef CONF_DMAC_EVIE_11 +#define CONF_DMAC_EVIE_11 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_11 +#ifndef CONF_DMAC_EVACT_11 +#define CONF_DMAC_EVACT_11 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_11 +#ifndef CONF_DMAC_STEPSIZE_11 +#define CONF_DMAC_STEPSIZE_11 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_11 +#ifndef CONF_DMAC_STEPSEL_11 +#define CONF_DMAC_STEPSEL_11 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_11 +#ifndef CONF_DMAC_SRCINC_11 +#define CONF_DMAC_SRCINC_11 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_11 +#ifndef CONF_DMAC_DSTINC_11 +#define CONF_DMAC_DSTINC_11 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_11 +#ifndef CONF_DMAC_BEATSIZE_11 +#define CONF_DMAC_BEATSIZE_11 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_11 +#ifndef CONF_DMAC_BLOCKACT_11 +#define CONF_DMAC_BLOCKACT_11 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_11 +#ifndef CONF_DMAC_EVOSEL_11 +#define CONF_DMAC_EVOSEL_11 0 +#endif +// + +// Channel 12 settings +// dmac_channel_12_settings +#ifndef CONF_DMAC_CHANNEL_12_SETTINGS +#define CONF_DMAC_CHANNEL_12_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 12 is running in standby mode or not +// dmac_runstdby_12 +#ifndef CONF_DMAC_RUNSTDBY_12 +#define CONF_DMAC_RUNSTDBY_12 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_12 +#ifndef CONF_DMAC_TRIGACT_12 +#define CONF_DMAC_TRIGACT_12 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_12 +#ifndef CONF_DMAC_TRIGSRC_12 +#define CONF_DMAC_TRIGSRC_12 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_12 +#ifndef CONF_DMAC_LVL_12 +#define CONF_DMAC_LVL_12 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_12 +#ifndef CONF_DMAC_EVOE_12 +#define CONF_DMAC_EVOE_12 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_12 +#ifndef CONF_DMAC_EVIE_12 +#define CONF_DMAC_EVIE_12 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_12 +#ifndef CONF_DMAC_EVACT_12 +#define CONF_DMAC_EVACT_12 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_12 +#ifndef CONF_DMAC_STEPSIZE_12 +#define CONF_DMAC_STEPSIZE_12 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_12 +#ifndef CONF_DMAC_STEPSEL_12 +#define CONF_DMAC_STEPSEL_12 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_12 +#ifndef CONF_DMAC_SRCINC_12 +#define CONF_DMAC_SRCINC_12 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_12 +#ifndef CONF_DMAC_DSTINC_12 +#define CONF_DMAC_DSTINC_12 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_12 +#ifndef CONF_DMAC_BEATSIZE_12 +#define CONF_DMAC_BEATSIZE_12 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_12 +#ifndef CONF_DMAC_BLOCKACT_12 +#define CONF_DMAC_BLOCKACT_12 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_12 +#ifndef CONF_DMAC_EVOSEL_12 +#define CONF_DMAC_EVOSEL_12 0 +#endif +// + +// Channel 13 settings +// dmac_channel_13_settings +#ifndef CONF_DMAC_CHANNEL_13_SETTINGS +#define CONF_DMAC_CHANNEL_13_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 13 is running in standby mode or not +// dmac_runstdby_13 +#ifndef CONF_DMAC_RUNSTDBY_13 +#define CONF_DMAC_RUNSTDBY_13 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_13 +#ifndef CONF_DMAC_TRIGACT_13 +#define CONF_DMAC_TRIGACT_13 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_13 +#ifndef CONF_DMAC_TRIGSRC_13 +#define CONF_DMAC_TRIGSRC_13 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_13 +#ifndef CONF_DMAC_LVL_13 +#define CONF_DMAC_LVL_13 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_13 +#ifndef CONF_DMAC_EVOE_13 +#define CONF_DMAC_EVOE_13 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_13 +#ifndef CONF_DMAC_EVIE_13 +#define CONF_DMAC_EVIE_13 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_13 +#ifndef CONF_DMAC_EVACT_13 +#define CONF_DMAC_EVACT_13 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_13 +#ifndef CONF_DMAC_STEPSIZE_13 +#define CONF_DMAC_STEPSIZE_13 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_13 +#ifndef CONF_DMAC_STEPSEL_13 +#define CONF_DMAC_STEPSEL_13 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_13 +#ifndef CONF_DMAC_SRCINC_13 +#define CONF_DMAC_SRCINC_13 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_13 +#ifndef CONF_DMAC_DSTINC_13 +#define CONF_DMAC_DSTINC_13 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_13 +#ifndef CONF_DMAC_BEATSIZE_13 +#define CONF_DMAC_BEATSIZE_13 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_13 +#ifndef CONF_DMAC_BLOCKACT_13 +#define CONF_DMAC_BLOCKACT_13 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_13 +#ifndef CONF_DMAC_EVOSEL_13 +#define CONF_DMAC_EVOSEL_13 0 +#endif +// + +// Channel 14 settings +// dmac_channel_14_settings +#ifndef CONF_DMAC_CHANNEL_14_SETTINGS +#define CONF_DMAC_CHANNEL_14_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 14 is running in standby mode or not +// dmac_runstdby_14 +#ifndef CONF_DMAC_RUNSTDBY_14 +#define CONF_DMAC_RUNSTDBY_14 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_14 +#ifndef CONF_DMAC_TRIGACT_14 +#define CONF_DMAC_TRIGACT_14 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_14 +#ifndef CONF_DMAC_TRIGSRC_14 +#define CONF_DMAC_TRIGSRC_14 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_14 +#ifndef CONF_DMAC_LVL_14 +#define CONF_DMAC_LVL_14 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_14 +#ifndef CONF_DMAC_EVOE_14 +#define CONF_DMAC_EVOE_14 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_14 +#ifndef CONF_DMAC_EVIE_14 +#define CONF_DMAC_EVIE_14 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_14 +#ifndef CONF_DMAC_EVACT_14 +#define CONF_DMAC_EVACT_14 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_14 +#ifndef CONF_DMAC_STEPSIZE_14 +#define CONF_DMAC_STEPSIZE_14 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_14 +#ifndef CONF_DMAC_STEPSEL_14 +#define CONF_DMAC_STEPSEL_14 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_14 +#ifndef CONF_DMAC_SRCINC_14 +#define CONF_DMAC_SRCINC_14 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_14 +#ifndef CONF_DMAC_DSTINC_14 +#define CONF_DMAC_DSTINC_14 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_14 +#ifndef CONF_DMAC_BEATSIZE_14 +#define CONF_DMAC_BEATSIZE_14 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_14 +#ifndef CONF_DMAC_BLOCKACT_14 +#define CONF_DMAC_BLOCKACT_14 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_14 +#ifndef CONF_DMAC_EVOSEL_14 +#define CONF_DMAC_EVOSEL_14 0 +#endif +// + +// Channel 15 settings +// dmac_channel_15_settings +#ifndef CONF_DMAC_CHANNEL_15_SETTINGS +#define CONF_DMAC_CHANNEL_15_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 15 is running in standby mode or not +// dmac_runstdby_15 +#ifndef CONF_DMAC_RUNSTDBY_15 +#define CONF_DMAC_RUNSTDBY_15 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_15 +#ifndef CONF_DMAC_TRIGACT_15 +#define CONF_DMAC_TRIGACT_15 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_15 +#ifndef CONF_DMAC_TRIGSRC_15 +#define CONF_DMAC_TRIGSRC_15 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_15 +#ifndef CONF_DMAC_LVL_15 +#define CONF_DMAC_LVL_15 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_15 +#ifndef CONF_DMAC_EVOE_15 +#define CONF_DMAC_EVOE_15 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_15 +#ifndef CONF_DMAC_EVIE_15 +#define CONF_DMAC_EVIE_15 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_15 +#ifndef CONF_DMAC_EVACT_15 +#define CONF_DMAC_EVACT_15 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_15 +#ifndef CONF_DMAC_STEPSIZE_15 +#define CONF_DMAC_STEPSIZE_15 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_15 +#ifndef CONF_DMAC_STEPSEL_15 +#define CONF_DMAC_STEPSEL_15 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_15 +#ifndef CONF_DMAC_SRCINC_15 +#define CONF_DMAC_SRCINC_15 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_15 +#ifndef CONF_DMAC_DSTINC_15 +#define CONF_DMAC_DSTINC_15 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_15 +#ifndef CONF_DMAC_BEATSIZE_15 +#define CONF_DMAC_BEATSIZE_15 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_15 +#ifndef CONF_DMAC_BLOCKACT_15 +#define CONF_DMAC_BLOCKACT_15 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_15 +#ifndef CONF_DMAC_EVOSEL_15 +#define CONF_DMAC_EVOSEL_15 0 +#endif +// + +// Channel 16 settings +// dmac_channel_16_settings +#ifndef CONF_DMAC_CHANNEL_16_SETTINGS +#define CONF_DMAC_CHANNEL_16_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 16 is running in standby mode or not +// dmac_runstdby_16 +#ifndef CONF_DMAC_RUNSTDBY_16 +#define CONF_DMAC_RUNSTDBY_16 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_16 +#ifndef CONF_DMAC_TRIGACT_16 +#define CONF_DMAC_TRIGACT_16 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_16 +#ifndef CONF_DMAC_TRIGSRC_16 +#define CONF_DMAC_TRIGSRC_16 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_16 +#ifndef CONF_DMAC_LVL_16 +#define CONF_DMAC_LVL_16 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_16 +#ifndef CONF_DMAC_EVOE_16 +#define CONF_DMAC_EVOE_16 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_16 +#ifndef CONF_DMAC_EVIE_16 +#define CONF_DMAC_EVIE_16 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_16 +#ifndef CONF_DMAC_EVACT_16 +#define CONF_DMAC_EVACT_16 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_16 +#ifndef CONF_DMAC_STEPSIZE_16 +#define CONF_DMAC_STEPSIZE_16 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_16 +#ifndef CONF_DMAC_STEPSEL_16 +#define CONF_DMAC_STEPSEL_16 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_16 +#ifndef CONF_DMAC_SRCINC_16 +#define CONF_DMAC_SRCINC_16 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_16 +#ifndef CONF_DMAC_DSTINC_16 +#define CONF_DMAC_DSTINC_16 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_16 +#ifndef CONF_DMAC_BEATSIZE_16 +#define CONF_DMAC_BEATSIZE_16 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_16 +#ifndef CONF_DMAC_BLOCKACT_16 +#define CONF_DMAC_BLOCKACT_16 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_16 +#ifndef CONF_DMAC_EVOSEL_16 +#define CONF_DMAC_EVOSEL_16 0 +#endif +// + +// Channel 17 settings +// dmac_channel_17_settings +#ifndef CONF_DMAC_CHANNEL_17_SETTINGS +#define CONF_DMAC_CHANNEL_17_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 17 is running in standby mode or not +// dmac_runstdby_17 +#ifndef CONF_DMAC_RUNSTDBY_17 +#define CONF_DMAC_RUNSTDBY_17 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_17 +#ifndef CONF_DMAC_TRIGACT_17 +#define CONF_DMAC_TRIGACT_17 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_17 +#ifndef CONF_DMAC_TRIGSRC_17 +#define CONF_DMAC_TRIGSRC_17 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_17 +#ifndef CONF_DMAC_LVL_17 +#define CONF_DMAC_LVL_17 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_17 +#ifndef CONF_DMAC_EVOE_17 +#define CONF_DMAC_EVOE_17 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_17 +#ifndef CONF_DMAC_EVIE_17 +#define CONF_DMAC_EVIE_17 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_17 +#ifndef CONF_DMAC_EVACT_17 +#define CONF_DMAC_EVACT_17 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_17 +#ifndef CONF_DMAC_STEPSIZE_17 +#define CONF_DMAC_STEPSIZE_17 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_17 +#ifndef CONF_DMAC_STEPSEL_17 +#define CONF_DMAC_STEPSEL_17 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_17 +#ifndef CONF_DMAC_SRCINC_17 +#define CONF_DMAC_SRCINC_17 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_17 +#ifndef CONF_DMAC_DSTINC_17 +#define CONF_DMAC_DSTINC_17 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_17 +#ifndef CONF_DMAC_BEATSIZE_17 +#define CONF_DMAC_BEATSIZE_17 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_17 +#ifndef CONF_DMAC_BLOCKACT_17 +#define CONF_DMAC_BLOCKACT_17 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_17 +#ifndef CONF_DMAC_EVOSEL_17 +#define CONF_DMAC_EVOSEL_17 0 +#endif +// + +// Channel 18 settings +// dmac_channel_18_settings +#ifndef CONF_DMAC_CHANNEL_18_SETTINGS +#define CONF_DMAC_CHANNEL_18_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 18 is running in standby mode or not +// dmac_runstdby_18 +#ifndef CONF_DMAC_RUNSTDBY_18 +#define CONF_DMAC_RUNSTDBY_18 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_18 +#ifndef CONF_DMAC_TRIGACT_18 +#define CONF_DMAC_TRIGACT_18 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_18 +#ifndef CONF_DMAC_TRIGSRC_18 +#define CONF_DMAC_TRIGSRC_18 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_18 +#ifndef CONF_DMAC_LVL_18 +#define CONF_DMAC_LVL_18 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_18 +#ifndef CONF_DMAC_EVOE_18 +#define CONF_DMAC_EVOE_18 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_18 +#ifndef CONF_DMAC_EVIE_18 +#define CONF_DMAC_EVIE_18 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_18 +#ifndef CONF_DMAC_EVACT_18 +#define CONF_DMAC_EVACT_18 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_18 +#ifndef CONF_DMAC_STEPSIZE_18 +#define CONF_DMAC_STEPSIZE_18 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_18 +#ifndef CONF_DMAC_STEPSEL_18 +#define CONF_DMAC_STEPSEL_18 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_18 +#ifndef CONF_DMAC_SRCINC_18 +#define CONF_DMAC_SRCINC_18 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_18 +#ifndef CONF_DMAC_DSTINC_18 +#define CONF_DMAC_DSTINC_18 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_18 +#ifndef CONF_DMAC_BEATSIZE_18 +#define CONF_DMAC_BEATSIZE_18 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_18 +#ifndef CONF_DMAC_BLOCKACT_18 +#define CONF_DMAC_BLOCKACT_18 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_18 +#ifndef CONF_DMAC_EVOSEL_18 +#define CONF_DMAC_EVOSEL_18 0 +#endif +// + +// Channel 19 settings +// dmac_channel_19_settings +#ifndef CONF_DMAC_CHANNEL_19_SETTINGS +#define CONF_DMAC_CHANNEL_19_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 19 is running in standby mode or not +// dmac_runstdby_19 +#ifndef CONF_DMAC_RUNSTDBY_19 +#define CONF_DMAC_RUNSTDBY_19 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_19 +#ifndef CONF_DMAC_TRIGACT_19 +#define CONF_DMAC_TRIGACT_19 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_19 +#ifndef CONF_DMAC_TRIGSRC_19 +#define CONF_DMAC_TRIGSRC_19 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_19 +#ifndef CONF_DMAC_LVL_19 +#define CONF_DMAC_LVL_19 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_19 +#ifndef CONF_DMAC_EVOE_19 +#define CONF_DMAC_EVOE_19 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_19 +#ifndef CONF_DMAC_EVIE_19 +#define CONF_DMAC_EVIE_19 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_19 +#ifndef CONF_DMAC_EVACT_19 +#define CONF_DMAC_EVACT_19 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_19 +#ifndef CONF_DMAC_STEPSIZE_19 +#define CONF_DMAC_STEPSIZE_19 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_19 +#ifndef CONF_DMAC_STEPSEL_19 +#define CONF_DMAC_STEPSEL_19 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_19 +#ifndef CONF_DMAC_SRCINC_19 +#define CONF_DMAC_SRCINC_19 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_19 +#ifndef CONF_DMAC_DSTINC_19 +#define CONF_DMAC_DSTINC_19 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_19 +#ifndef CONF_DMAC_BEATSIZE_19 +#define CONF_DMAC_BEATSIZE_19 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_19 +#ifndef CONF_DMAC_BLOCKACT_19 +#define CONF_DMAC_BLOCKACT_19 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_19 +#ifndef CONF_DMAC_EVOSEL_19 +#define CONF_DMAC_EVOSEL_19 0 +#endif +// + +// Channel 20 settings +// dmac_channel_20_settings +#ifndef CONF_DMAC_CHANNEL_20_SETTINGS +#define CONF_DMAC_CHANNEL_20_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 20 is running in standby mode or not +// dmac_runstdby_20 +#ifndef CONF_DMAC_RUNSTDBY_20 +#define CONF_DMAC_RUNSTDBY_20 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_20 +#ifndef CONF_DMAC_TRIGACT_20 +#define CONF_DMAC_TRIGACT_20 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_20 +#ifndef CONF_DMAC_TRIGSRC_20 +#define CONF_DMAC_TRIGSRC_20 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_20 +#ifndef CONF_DMAC_LVL_20 +#define CONF_DMAC_LVL_20 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_20 +#ifndef CONF_DMAC_EVOE_20 +#define CONF_DMAC_EVOE_20 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_20 +#ifndef CONF_DMAC_EVIE_20 +#define CONF_DMAC_EVIE_20 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_20 +#ifndef CONF_DMAC_EVACT_20 +#define CONF_DMAC_EVACT_20 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_20 +#ifndef CONF_DMAC_STEPSIZE_20 +#define CONF_DMAC_STEPSIZE_20 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_20 +#ifndef CONF_DMAC_STEPSEL_20 +#define CONF_DMAC_STEPSEL_20 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_20 +#ifndef CONF_DMAC_SRCINC_20 +#define CONF_DMAC_SRCINC_20 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_20 +#ifndef CONF_DMAC_DSTINC_20 +#define CONF_DMAC_DSTINC_20 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_20 +#ifndef CONF_DMAC_BEATSIZE_20 +#define CONF_DMAC_BEATSIZE_20 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_20 +#ifndef CONF_DMAC_BLOCKACT_20 +#define CONF_DMAC_BLOCKACT_20 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_20 +#ifndef CONF_DMAC_EVOSEL_20 +#define CONF_DMAC_EVOSEL_20 0 +#endif +// + +// Channel 21 settings +// dmac_channel_21_settings +#ifndef CONF_DMAC_CHANNEL_21_SETTINGS +#define CONF_DMAC_CHANNEL_21_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 21 is running in standby mode or not +// dmac_runstdby_21 +#ifndef CONF_DMAC_RUNSTDBY_21 +#define CONF_DMAC_RUNSTDBY_21 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_21 +#ifndef CONF_DMAC_TRIGACT_21 +#define CONF_DMAC_TRIGACT_21 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_21 +#ifndef CONF_DMAC_TRIGSRC_21 +#define CONF_DMAC_TRIGSRC_21 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_21 +#ifndef CONF_DMAC_LVL_21 +#define CONF_DMAC_LVL_21 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_21 +#ifndef CONF_DMAC_EVOE_21 +#define CONF_DMAC_EVOE_21 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_21 +#ifndef CONF_DMAC_EVIE_21 +#define CONF_DMAC_EVIE_21 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_21 +#ifndef CONF_DMAC_EVACT_21 +#define CONF_DMAC_EVACT_21 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_21 +#ifndef CONF_DMAC_STEPSIZE_21 +#define CONF_DMAC_STEPSIZE_21 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_21 +#ifndef CONF_DMAC_STEPSEL_21 +#define CONF_DMAC_STEPSEL_21 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_21 +#ifndef CONF_DMAC_SRCINC_21 +#define CONF_DMAC_SRCINC_21 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_21 +#ifndef CONF_DMAC_DSTINC_21 +#define CONF_DMAC_DSTINC_21 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_21 +#ifndef CONF_DMAC_BEATSIZE_21 +#define CONF_DMAC_BEATSIZE_21 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_21 +#ifndef CONF_DMAC_BLOCKACT_21 +#define CONF_DMAC_BLOCKACT_21 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_21 +#ifndef CONF_DMAC_EVOSEL_21 +#define CONF_DMAC_EVOSEL_21 0 +#endif +// + +// Channel 22 settings +// dmac_channel_22_settings +#ifndef CONF_DMAC_CHANNEL_22_SETTINGS +#define CONF_DMAC_CHANNEL_22_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 22 is running in standby mode or not +// dmac_runstdby_22 +#ifndef CONF_DMAC_RUNSTDBY_22 +#define CONF_DMAC_RUNSTDBY_22 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_22 +#ifndef CONF_DMAC_TRIGACT_22 +#define CONF_DMAC_TRIGACT_22 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_22 +#ifndef CONF_DMAC_TRIGSRC_22 +#define CONF_DMAC_TRIGSRC_22 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_22 +#ifndef CONF_DMAC_LVL_22 +#define CONF_DMAC_LVL_22 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_22 +#ifndef CONF_DMAC_EVOE_22 +#define CONF_DMAC_EVOE_22 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_22 +#ifndef CONF_DMAC_EVIE_22 +#define CONF_DMAC_EVIE_22 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_22 +#ifndef CONF_DMAC_EVACT_22 +#define CONF_DMAC_EVACT_22 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_22 +#ifndef CONF_DMAC_STEPSIZE_22 +#define CONF_DMAC_STEPSIZE_22 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_22 +#ifndef CONF_DMAC_STEPSEL_22 +#define CONF_DMAC_STEPSEL_22 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_22 +#ifndef CONF_DMAC_SRCINC_22 +#define CONF_DMAC_SRCINC_22 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_22 +#ifndef CONF_DMAC_DSTINC_22 +#define CONF_DMAC_DSTINC_22 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_22 +#ifndef CONF_DMAC_BEATSIZE_22 +#define CONF_DMAC_BEATSIZE_22 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_22 +#ifndef CONF_DMAC_BLOCKACT_22 +#define CONF_DMAC_BLOCKACT_22 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_22 +#ifndef CONF_DMAC_EVOSEL_22 +#define CONF_DMAC_EVOSEL_22 0 +#endif +// + +// Channel 23 settings +// dmac_channel_23_settings +#ifndef CONF_DMAC_CHANNEL_23_SETTINGS +#define CONF_DMAC_CHANNEL_23_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 23 is running in standby mode or not +// dmac_runstdby_23 +#ifndef CONF_DMAC_RUNSTDBY_23 +#define CONF_DMAC_RUNSTDBY_23 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_23 +#ifndef CONF_DMAC_TRIGACT_23 +#define CONF_DMAC_TRIGACT_23 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_23 +#ifndef CONF_DMAC_TRIGSRC_23 +#define CONF_DMAC_TRIGSRC_23 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_23 +#ifndef CONF_DMAC_LVL_23 +#define CONF_DMAC_LVL_23 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_23 +#ifndef CONF_DMAC_EVOE_23 +#define CONF_DMAC_EVOE_23 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_23 +#ifndef CONF_DMAC_EVIE_23 +#define CONF_DMAC_EVIE_23 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_23 +#ifndef CONF_DMAC_EVACT_23 +#define CONF_DMAC_EVACT_23 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_23 +#ifndef CONF_DMAC_STEPSIZE_23 +#define CONF_DMAC_STEPSIZE_23 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_23 +#ifndef CONF_DMAC_STEPSEL_23 +#define CONF_DMAC_STEPSEL_23 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_23 +#ifndef CONF_DMAC_SRCINC_23 +#define CONF_DMAC_SRCINC_23 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_23 +#ifndef CONF_DMAC_DSTINC_23 +#define CONF_DMAC_DSTINC_23 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_23 +#ifndef CONF_DMAC_BEATSIZE_23 +#define CONF_DMAC_BEATSIZE_23 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_23 +#ifndef CONF_DMAC_BLOCKACT_23 +#define CONF_DMAC_BLOCKACT_23 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_23 +#ifndef CONF_DMAC_EVOSEL_23 +#define CONF_DMAC_EVOSEL_23 0 +#endif +// + +// Channel 24 settings +// dmac_channel_24_settings +#ifndef CONF_DMAC_CHANNEL_24_SETTINGS +#define CONF_DMAC_CHANNEL_24_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 24 is running in standby mode or not +// dmac_runstdby_24 +#ifndef CONF_DMAC_RUNSTDBY_24 +#define CONF_DMAC_RUNSTDBY_24 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_24 +#ifndef CONF_DMAC_TRIGACT_24 +#define CONF_DMAC_TRIGACT_24 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_24 +#ifndef CONF_DMAC_TRIGSRC_24 +#define CONF_DMAC_TRIGSRC_24 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_24 +#ifndef CONF_DMAC_LVL_24 +#define CONF_DMAC_LVL_24 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_24 +#ifndef CONF_DMAC_EVOE_24 +#define CONF_DMAC_EVOE_24 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_24 +#ifndef CONF_DMAC_EVIE_24 +#define CONF_DMAC_EVIE_24 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_24 +#ifndef CONF_DMAC_EVACT_24 +#define CONF_DMAC_EVACT_24 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_24 +#ifndef CONF_DMAC_STEPSIZE_24 +#define CONF_DMAC_STEPSIZE_24 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_24 +#ifndef CONF_DMAC_STEPSEL_24 +#define CONF_DMAC_STEPSEL_24 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_24 +#ifndef CONF_DMAC_SRCINC_24 +#define CONF_DMAC_SRCINC_24 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_24 +#ifndef CONF_DMAC_DSTINC_24 +#define CONF_DMAC_DSTINC_24 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_24 +#ifndef CONF_DMAC_BEATSIZE_24 +#define CONF_DMAC_BEATSIZE_24 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_24 +#ifndef CONF_DMAC_BLOCKACT_24 +#define CONF_DMAC_BLOCKACT_24 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_24 +#ifndef CONF_DMAC_EVOSEL_24 +#define CONF_DMAC_EVOSEL_24 0 +#endif +// + +// Channel 25 settings +// dmac_channel_25_settings +#ifndef CONF_DMAC_CHANNEL_25_SETTINGS +#define CONF_DMAC_CHANNEL_25_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 25 is running in standby mode or not +// dmac_runstdby_25 +#ifndef CONF_DMAC_RUNSTDBY_25 +#define CONF_DMAC_RUNSTDBY_25 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_25 +#ifndef CONF_DMAC_TRIGACT_25 +#define CONF_DMAC_TRIGACT_25 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_25 +#ifndef CONF_DMAC_TRIGSRC_25 +#define CONF_DMAC_TRIGSRC_25 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_25 +#ifndef CONF_DMAC_LVL_25 +#define CONF_DMAC_LVL_25 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_25 +#ifndef CONF_DMAC_EVOE_25 +#define CONF_DMAC_EVOE_25 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_25 +#ifndef CONF_DMAC_EVIE_25 +#define CONF_DMAC_EVIE_25 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_25 +#ifndef CONF_DMAC_EVACT_25 +#define CONF_DMAC_EVACT_25 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_25 +#ifndef CONF_DMAC_STEPSIZE_25 +#define CONF_DMAC_STEPSIZE_25 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_25 +#ifndef CONF_DMAC_STEPSEL_25 +#define CONF_DMAC_STEPSEL_25 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_25 +#ifndef CONF_DMAC_SRCINC_25 +#define CONF_DMAC_SRCINC_25 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_25 +#ifndef CONF_DMAC_DSTINC_25 +#define CONF_DMAC_DSTINC_25 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_25 +#ifndef CONF_DMAC_BEATSIZE_25 +#define CONF_DMAC_BEATSIZE_25 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_25 +#ifndef CONF_DMAC_BLOCKACT_25 +#define CONF_DMAC_BLOCKACT_25 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_25 +#ifndef CONF_DMAC_EVOSEL_25 +#define CONF_DMAC_EVOSEL_25 0 +#endif +// + +// Channel 26 settings +// dmac_channel_26_settings +#ifndef CONF_DMAC_CHANNEL_26_SETTINGS +#define CONF_DMAC_CHANNEL_26_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 26 is running in standby mode or not +// dmac_runstdby_26 +#ifndef CONF_DMAC_RUNSTDBY_26 +#define CONF_DMAC_RUNSTDBY_26 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_26 +#ifndef CONF_DMAC_TRIGACT_26 +#define CONF_DMAC_TRIGACT_26 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_26 +#ifndef CONF_DMAC_TRIGSRC_26 +#define CONF_DMAC_TRIGSRC_26 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_26 +#ifndef CONF_DMAC_LVL_26 +#define CONF_DMAC_LVL_26 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_26 +#ifndef CONF_DMAC_EVOE_26 +#define CONF_DMAC_EVOE_26 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_26 +#ifndef CONF_DMAC_EVIE_26 +#define CONF_DMAC_EVIE_26 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_26 +#ifndef CONF_DMAC_EVACT_26 +#define CONF_DMAC_EVACT_26 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_26 +#ifndef CONF_DMAC_STEPSIZE_26 +#define CONF_DMAC_STEPSIZE_26 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_26 +#ifndef CONF_DMAC_STEPSEL_26 +#define CONF_DMAC_STEPSEL_26 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_26 +#ifndef CONF_DMAC_SRCINC_26 +#define CONF_DMAC_SRCINC_26 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_26 +#ifndef CONF_DMAC_DSTINC_26 +#define CONF_DMAC_DSTINC_26 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_26 +#ifndef CONF_DMAC_BEATSIZE_26 +#define CONF_DMAC_BEATSIZE_26 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_26 +#ifndef CONF_DMAC_BLOCKACT_26 +#define CONF_DMAC_BLOCKACT_26 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_26 +#ifndef CONF_DMAC_EVOSEL_26 +#define CONF_DMAC_EVOSEL_26 0 +#endif +// + +// Channel 27 settings +// dmac_channel_27_settings +#ifndef CONF_DMAC_CHANNEL_27_SETTINGS +#define CONF_DMAC_CHANNEL_27_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 27 is running in standby mode or not +// dmac_runstdby_27 +#ifndef CONF_DMAC_RUNSTDBY_27 +#define CONF_DMAC_RUNSTDBY_27 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_27 +#ifndef CONF_DMAC_TRIGACT_27 +#define CONF_DMAC_TRIGACT_27 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_27 +#ifndef CONF_DMAC_TRIGSRC_27 +#define CONF_DMAC_TRIGSRC_27 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_27 +#ifndef CONF_DMAC_LVL_27 +#define CONF_DMAC_LVL_27 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_27 +#ifndef CONF_DMAC_EVOE_27 +#define CONF_DMAC_EVOE_27 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_27 +#ifndef CONF_DMAC_EVIE_27 +#define CONF_DMAC_EVIE_27 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_27 +#ifndef CONF_DMAC_EVACT_27 +#define CONF_DMAC_EVACT_27 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_27 +#ifndef CONF_DMAC_STEPSIZE_27 +#define CONF_DMAC_STEPSIZE_27 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_27 +#ifndef CONF_DMAC_STEPSEL_27 +#define CONF_DMAC_STEPSEL_27 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_27 +#ifndef CONF_DMAC_SRCINC_27 +#define CONF_DMAC_SRCINC_27 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_27 +#ifndef CONF_DMAC_DSTINC_27 +#define CONF_DMAC_DSTINC_27 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_27 +#ifndef CONF_DMAC_BEATSIZE_27 +#define CONF_DMAC_BEATSIZE_27 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_27 +#ifndef CONF_DMAC_BLOCKACT_27 +#define CONF_DMAC_BLOCKACT_27 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_27 +#ifndef CONF_DMAC_EVOSEL_27 +#define CONF_DMAC_EVOSEL_27 0 +#endif +// + +// Channel 28 settings +// dmac_channel_28_settings +#ifndef CONF_DMAC_CHANNEL_28_SETTINGS +#define CONF_DMAC_CHANNEL_28_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 28 is running in standby mode or not +// dmac_runstdby_28 +#ifndef CONF_DMAC_RUNSTDBY_28 +#define CONF_DMAC_RUNSTDBY_28 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_28 +#ifndef CONF_DMAC_TRIGACT_28 +#define CONF_DMAC_TRIGACT_28 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_28 +#ifndef CONF_DMAC_TRIGSRC_28 +#define CONF_DMAC_TRIGSRC_28 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_28 +#ifndef CONF_DMAC_LVL_28 +#define CONF_DMAC_LVL_28 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_28 +#ifndef CONF_DMAC_EVOE_28 +#define CONF_DMAC_EVOE_28 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_28 +#ifndef CONF_DMAC_EVIE_28 +#define CONF_DMAC_EVIE_28 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_28 +#ifndef CONF_DMAC_EVACT_28 +#define CONF_DMAC_EVACT_28 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_28 +#ifndef CONF_DMAC_STEPSIZE_28 +#define CONF_DMAC_STEPSIZE_28 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_28 +#ifndef CONF_DMAC_STEPSEL_28 +#define CONF_DMAC_STEPSEL_28 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_28 +#ifndef CONF_DMAC_SRCINC_28 +#define CONF_DMAC_SRCINC_28 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_28 +#ifndef CONF_DMAC_DSTINC_28 +#define CONF_DMAC_DSTINC_28 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_28 +#ifndef CONF_DMAC_BEATSIZE_28 +#define CONF_DMAC_BEATSIZE_28 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_28 +#ifndef CONF_DMAC_BLOCKACT_28 +#define CONF_DMAC_BLOCKACT_28 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_28 +#ifndef CONF_DMAC_EVOSEL_28 +#define CONF_DMAC_EVOSEL_28 0 +#endif +// + +// Channel 29 settings +// dmac_channel_29_settings +#ifndef CONF_DMAC_CHANNEL_29_SETTINGS +#define CONF_DMAC_CHANNEL_29_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 29 is running in standby mode or not +// dmac_runstdby_29 +#ifndef CONF_DMAC_RUNSTDBY_29 +#define CONF_DMAC_RUNSTDBY_29 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_29 +#ifndef CONF_DMAC_TRIGACT_29 +#define CONF_DMAC_TRIGACT_29 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_29 +#ifndef CONF_DMAC_TRIGSRC_29 +#define CONF_DMAC_TRIGSRC_29 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_29 +#ifndef CONF_DMAC_LVL_29 +#define CONF_DMAC_LVL_29 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_29 +#ifndef CONF_DMAC_EVOE_29 +#define CONF_DMAC_EVOE_29 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_29 +#ifndef CONF_DMAC_EVIE_29 +#define CONF_DMAC_EVIE_29 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_29 +#ifndef CONF_DMAC_EVACT_29 +#define CONF_DMAC_EVACT_29 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_29 +#ifndef CONF_DMAC_STEPSIZE_29 +#define CONF_DMAC_STEPSIZE_29 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_29 +#ifndef CONF_DMAC_STEPSEL_29 +#define CONF_DMAC_STEPSEL_29 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_29 +#ifndef CONF_DMAC_SRCINC_29 +#define CONF_DMAC_SRCINC_29 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_29 +#ifndef CONF_DMAC_DSTINC_29 +#define CONF_DMAC_DSTINC_29 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_29 +#ifndef CONF_DMAC_BEATSIZE_29 +#define CONF_DMAC_BEATSIZE_29 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_29 +#ifndef CONF_DMAC_BLOCKACT_29 +#define CONF_DMAC_BLOCKACT_29 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_29 +#ifndef CONF_DMAC_EVOSEL_29 +#define CONF_DMAC_EVOSEL_29 0 +#endif +// + +// Channel 30 settings +// dmac_channel_30_settings +#ifndef CONF_DMAC_CHANNEL_30_SETTINGS +#define CONF_DMAC_CHANNEL_30_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 30 is running in standby mode or not +// dmac_runstdby_30 +#ifndef CONF_DMAC_RUNSTDBY_30 +#define CONF_DMAC_RUNSTDBY_30 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_30 +#ifndef CONF_DMAC_TRIGACT_30 +#define CONF_DMAC_TRIGACT_30 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_30 +#ifndef CONF_DMAC_TRIGSRC_30 +#define CONF_DMAC_TRIGSRC_30 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_30 +#ifndef CONF_DMAC_LVL_30 +#define CONF_DMAC_LVL_30 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_30 +#ifndef CONF_DMAC_EVOE_30 +#define CONF_DMAC_EVOE_30 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_30 +#ifndef CONF_DMAC_EVIE_30 +#define CONF_DMAC_EVIE_30 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_30 +#ifndef CONF_DMAC_EVACT_30 +#define CONF_DMAC_EVACT_30 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_30 +#ifndef CONF_DMAC_STEPSIZE_30 +#define CONF_DMAC_STEPSIZE_30 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_30 +#ifndef CONF_DMAC_STEPSEL_30 +#define CONF_DMAC_STEPSEL_30 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_30 +#ifndef CONF_DMAC_SRCINC_30 +#define CONF_DMAC_SRCINC_30 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_30 +#ifndef CONF_DMAC_DSTINC_30 +#define CONF_DMAC_DSTINC_30 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_30 +#ifndef CONF_DMAC_BEATSIZE_30 +#define CONF_DMAC_BEATSIZE_30 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_30 +#ifndef CONF_DMAC_BLOCKACT_30 +#define CONF_DMAC_BLOCKACT_30 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_30 +#ifndef CONF_DMAC_EVOSEL_30 +#define CONF_DMAC_EVOSEL_30 0 +#endif +// + +// Channel 31 settings +// dmac_channel_31_settings +#ifndef CONF_DMAC_CHANNEL_31_SETTINGS +#define CONF_DMAC_CHANNEL_31_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 31 is running in standby mode or not +// dmac_runstdby_31 +#ifndef CONF_DMAC_RUNSTDBY_31 +#define CONF_DMAC_RUNSTDBY_31 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_31 +#ifndef CONF_DMAC_TRIGACT_31 +#define CONF_DMAC_TRIGACT_31 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_31 +#ifndef CONF_DMAC_TRIGSRC_31 +#define CONF_DMAC_TRIGSRC_31 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_31 +#ifndef CONF_DMAC_LVL_31 +#define CONF_DMAC_LVL_31 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_31 +#ifndef CONF_DMAC_EVOE_31 +#define CONF_DMAC_EVOE_31 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_31 +#ifndef CONF_DMAC_EVIE_31 +#define CONF_DMAC_EVIE_31 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_31 +#ifndef CONF_DMAC_EVACT_31 +#define CONF_DMAC_EVACT_31 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_31 +#ifndef CONF_DMAC_STEPSIZE_31 +#define CONF_DMAC_STEPSIZE_31 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_31 +#ifndef CONF_DMAC_STEPSEL_31 +#define CONF_DMAC_STEPSEL_31 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_31 +#ifndef CONF_DMAC_SRCINC_31 +#define CONF_DMAC_SRCINC_31 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_31 +#ifndef CONF_DMAC_DSTINC_31 +#define CONF_DMAC_DSTINC_31 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_31 +#ifndef CONF_DMAC_BEATSIZE_31 +#define CONF_DMAC_BEATSIZE_31 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_31 +#ifndef CONF_DMAC_BLOCKACT_31 +#define CONF_DMAC_BLOCKACT_31 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_31 +#ifndef CONF_DMAC_EVOSEL_31 +#define CONF_DMAC_EVOSEL_31 0 +#endif +// + +// + +// <<< end of configuration section >>> + +#endif // HPL_DMAC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_gclk_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_gclk_config.h new file mode 100644 index 0000000000..6f4f01a7e6 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_gclk_config.h @@ -0,0 +1,924 @@ +// Circuit Python SAMD51 clock tree: +// DFLL48M (with USBCRM on to sync with external USB ref) -> GCLK1, GCLK5, GCLK6 +// GCLK1 (48MHz) -> 48 MHz peripherals +// GCLK5 (48 MHz divided down to 2 MHz) -> DPLL0 +// DPLL0 (multiplied up to 120 MHz) -> GCLK0, GCLK4 (output for monitoring) +// GCLK6 (48 MHz divided down to 12 MHz) -> DAC + +// We'd like to use XOSC32K as a ref for DFLL48M on boards with a 32kHz crystal, +// but haven't figured that out yet. + +// Used in hpl/core/hpl_init.c to define which clocks should be initialized first. +// Not clear why all these need to be specified, but it doesn't work properly otherwise. + +//#define CIRCUITPY_GCLK_INIT_1ST (1 << 0 | 1 << 1 | 1 << 3 | 1 <<5) +#define CIRCUITPY_GCLK_INIT_1ST 0xffff + +/* Auto-generated config file hpl_gclk_config.h */ +#ifndef HPL_GCLK_CONFIG_H +#define HPL_GCLK_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Generic clock generator 0 configuration +// Indicates whether generic clock 0 configuration is enabled or not +// enable_gclk_gen_0 +#ifndef CONF_GCLK_GENERATOR_0_CONFIG +#define CONF_GCLK_GENERATOR_0_CONFIG 1 +#endif + +// Generic Clock Generator Control +// Generic clock generator 0 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 0 +// gclk_gen_0_oscillator +#ifndef CONF_GCLK_GEN_0_SOURCE +#define CONF_GCLK_GEN_0_SOURCE GCLK_GENCTRL_SRC_DPLL0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_0_runstdby +#ifndef CONF_GCLK_GEN_0_RUNSTDBY +#define CONF_GCLK_GEN_0_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_0_div_sel +#ifndef CONF_GCLK_GEN_0_DIVSEL +#define CONF_GCLK_GEN_0_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_0_oe +#ifndef CONF_GCLK_GEN_0_OE +#define CONF_GCLK_GEN_0_OE 1 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_0_oov +#ifndef CONF_GCLK_GEN_0_OOV +#define CONF_GCLK_GEN_0_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_0_idc +#ifndef CONF_GCLK_GEN_0_IDC +#define CONF_GCLK_GEN_0_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_0_enable +#ifndef CONF_GCLK_GEN_0_GENEN +#define CONF_GCLK_GEN_0_GENEN 1 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 0 division <0x0000-0xFFFF> +// gclk_gen_0_div +#ifndef CONF_GCLK_GEN_0_DIV +#define CONF_GCLK_GEN_0_DIV 1 +#endif +// +// + +// Generic clock generator 1 configuration +// Indicates whether generic clock 1 configuration is enabled or not +// enable_gclk_gen_1 +#ifndef CONF_GCLK_GENERATOR_1_CONFIG +#define CONF_GCLK_GENERATOR_1_CONFIG 1 +#endif + +// Generic Clock Generator Control +// Generic clock generator 1 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 1 +// gclk_gen_1_oscillator +#ifndef CONF_GCLK_GEN_1_SOURCE +#define CONF_GCLK_GEN_1_SOURCE GCLK_GENCTRL_SRC_DFLL +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_1_runstdby +#ifndef CONF_GCLK_GEN_1_RUNSTDBY +#define CONF_GCLK_GEN_1_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_1_div_sel +#ifndef CONF_GCLK_GEN_1_DIVSEL +#define CONF_GCLK_GEN_1_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_1_oe +#ifndef CONF_GCLK_GEN_1_OE +#define CONF_GCLK_GEN_1_OE 1 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_1_oov +#ifndef CONF_GCLK_GEN_1_OOV +#define CONF_GCLK_GEN_1_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_1_idc +#ifndef CONF_GCLK_GEN_1_IDC +#define CONF_GCLK_GEN_1_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_1_enable +#ifndef CONF_GCLK_GEN_1_GENEN +#define CONF_GCLK_GEN_1_GENEN 1 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 1 division <0x0000-0xFFFF> +// gclk_gen_1_div +#ifndef CONF_GCLK_GEN_1_DIV +#define CONF_GCLK_GEN_1_DIV 1 +#endif +// +// + +// Generic clock generator 2 configuration +// Indicates whether generic clock 2 configuration is enabled or not +// enable_gclk_gen_2 +#ifndef CONF_GCLK_GENERATOR_2_CONFIG +#define CONF_GCLK_GENERATOR_2_CONFIG 1 +#endif + +// Generic Clock Generator Control +// Generic clock generator 2 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 2 +// gclk_gen_2_oscillator +#ifndef CONF_GCLK_GEN_2_SOURCE +#define CONF_GCLK_GEN_2_SOURCE GCLK_GENCTRL_SRC_OSCULP32K +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_2_runstdby +#ifndef CONF_GCLK_GEN_2_RUNSTDBY +#define CONF_GCLK_GEN_2_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_2_div_sel +#ifndef CONF_GCLK_GEN_2_DIVSEL +#define CONF_GCLK_GEN_2_DIVSEL 1 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_2_oe +#ifndef CONF_GCLK_GEN_2_OE +#define CONF_GCLK_GEN_2_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_2_oov +#ifndef CONF_GCLK_GEN_2_OOV +#define CONF_GCLK_GEN_2_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_2_idc +#ifndef CONF_GCLK_GEN_2_IDC +#define CONF_GCLK_GEN_2_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_2_enable +#ifndef CONF_GCLK_GEN_2_GENEN +#define CONF_GCLK_GEN_2_GENEN 1 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 2 division <0x0000-0xFFFF> +// gclk_gen_2_div +#ifndef CONF_GCLK_GEN_2_DIV +#define CONF_GCLK_GEN_2_DIV 4 +#endif +// +// + +// Generic clock generator 3 configuration +// Indicates whether generic clock 3 configuration is enabled or not +// enable_gclk_gen_3 +#ifndef CONF_GCLK_GENERATOR_3_CONFIG +#define CONF_GCLK_GENERATOR_3_CONFIG 0 +#endif + +// Generic Clock Generator Control +// Generic clock generator 3 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 3 +// gclk_gen_3_oscillator +#ifndef CONF_GCLK_GEN_3_SOURCE +#define CONF_GCLK_GEN_3_SOURCE GCLK_GENCTRL_SRC_XOSC32K +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_3_runstdby +#ifndef CONF_GCLK_GEN_3_RUNSTDBY +#define CONF_GCLK_GEN_3_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_3_div_sel +#ifndef CONF_GCLK_GEN_3_DIVSEL +#define CONF_GCLK_GEN_3_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_3_oe +#ifndef CONF_GCLK_GEN_3_OE +#define CONF_GCLK_GEN_3_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_3_oov +#ifndef CONF_GCLK_GEN_3_OOV +#define CONF_GCLK_GEN_3_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_3_idc +#ifndef CONF_GCLK_GEN_3_IDC +#define CONF_GCLK_GEN_3_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_3_enable +#ifndef CONF_GCLK_GEN_3_GENEN +#define CONF_GCLK_GEN_3_GENEN 0 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 3 division <0x0000-0xFFFF> +// gclk_gen_3_div +#ifndef CONF_GCLK_GEN_3_DIV +#define CONF_GCLK_GEN_3_DIV 1 +#endif +// +// + +// Generic clock generator 4 configuration +// Indicates whether generic clock 4 configuration is enabled or not +// enable_gclk_gen_4 +#ifndef CONF_GCLK_GENERATOR_4_CONFIG +#define CONF_GCLK_GENERATOR_4_CONFIG 1 +#endif + +// Generic Clock Generator Control +// Generic clock generator 4 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 4 +// gclk_gen_4_oscillator +#ifndef CONF_GCLK_GEN_4_SOURCE +#define CONF_GCLK_GEN_4_SOURCE GCLK_GENCTRL_SRC_DPLL0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_4_runstdby +#ifndef CONF_GCLK_GEN_4_RUNSTDBY +#define CONF_GCLK_GEN_4_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_4_div_sel +#ifndef CONF_GCLK_GEN_4_DIVSEL +#define CONF_GCLK_GEN_4_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_4_oe +#ifndef CONF_GCLK_GEN_4_OE +#define CONF_GCLK_GEN_4_OE 1 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_4_oov +#ifndef CONF_GCLK_GEN_4_OOV +#define CONF_GCLK_GEN_4_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_4_idc +#ifndef CONF_GCLK_GEN_4_IDC +#define CONF_GCLK_GEN_4_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_4_enable +#ifndef CONF_GCLK_GEN_4_GENEN +#define CONF_GCLK_GEN_4_GENEN 1 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 4 division <0x0000-0xFFFF> +// gclk_gen_4_div +#ifndef CONF_GCLK_GEN_4_DIV +#define CONF_GCLK_GEN_4_DIV 1 +#endif +// +// + +// Generic clock generator 5 configuration +// Indicates whether generic clock 5 configuration is enabled or not +// enable_gclk_gen_5 +#ifndef CONF_GCLK_GENERATOR_5_CONFIG +#define CONF_GCLK_GENERATOR_5_CONFIG 1 +#endif + +// Generic Clock Generator Control +// Generic clock generator 5 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 5 +// gclk_gen_5_oscillator +#ifndef CONF_GCLK_GEN_5_SOURCE +#define CONF_GCLK_GEN_5_SOURCE GCLK_GENCTRL_SRC_DFLL +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_5_runstdby +#ifndef CONF_GCLK_GEN_5_RUNSTDBY +#define CONF_GCLK_GEN_5_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_5_div_sel +#ifndef CONF_GCLK_GEN_5_DIVSEL +#define CONF_GCLK_GEN_5_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_5_oe +#ifndef CONF_GCLK_GEN_5_OE +#define CONF_GCLK_GEN_5_OE 1 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_5_oov +#ifndef CONF_GCLK_GEN_5_OOV +#define CONF_GCLK_GEN_5_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_5_idc +#ifndef CONF_GCLK_GEN_5_IDC +#define CONF_GCLK_GEN_5_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_5_enable +#ifndef CONF_GCLK_GEN_5_GENEN +#define CONF_GCLK_GEN_5_GENEN 1 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 5 division <0x0000-0xFFFF> +// gclk_gen_5_div +#ifndef CONF_GCLK_GEN_5_DIV +#define CONF_GCLK_GEN_5_DIV 24 +#endif +// +// + +// Generic clock generator 6 configuration +// Indicates whether generic clock 6 configuration is enabled or not +// enable_gclk_gen_6 +#ifndef CONF_GCLK_GENERATOR_6_CONFIG +#define CONF_GCLK_GENERATOR_6_CONFIG 1 +#endif + +// Generic Clock Generator Control +// Generic clock generator 6 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 6 +// gclk_gen_6_oscillator +#ifndef CONF_GCLK_GEN_6_SOURCE +#define CONF_GCLK_GEN_6_SOURCE GCLK_GENCTRL_SRC_DFLL +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_6_runstdby +#ifndef CONF_GCLK_GEN_6_RUNSTDBY +#define CONF_GCLK_GEN_6_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_6_div_sel +#ifndef CONF_GCLK_GEN_6_DIVSEL +#define CONF_GCLK_GEN_6_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_6_oe +#ifndef CONF_GCLK_GEN_6_OE +#define CONF_GCLK_GEN_6_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_6_oov +#ifndef CONF_GCLK_GEN_6_OOV +#define CONF_GCLK_GEN_6_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_6_idc +#ifndef CONF_GCLK_GEN_6_IDC +#define CONF_GCLK_GEN_6_IDC 1 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_6_enable +#ifndef CONF_GCLK_GEN_6_GENEN +#define CONF_GCLK_GEN_6_GENEN 1 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 6 division <0x0000-0xFFFF> +// gclk_gen_6_div +#ifndef CONF_GCLK_GEN_6_DIV +#define CONF_GCLK_GEN_6_DIV 4 +#endif +// +// + +// Generic clock generator 7 configuration +// Indicates whether generic clock 7 configuration is enabled or not +// enable_gclk_gen_7 +#ifndef CONF_GCLK_GENERATOR_7_CONFIG +#define CONF_GCLK_GENERATOR_7_CONFIG 0 +#endif + +// Generic Clock Generator Control +// Generic clock generator 7 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 7 +// gclk_gen_7_oscillator +#ifndef CONF_GCLK_GEN_7_SOURCE +#define CONF_GCLK_GEN_7_SOURCE GCLK_GENCTRL_SRC_XOSC1 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_7_runstdby +#ifndef CONF_GCLK_GEN_7_RUNSTDBY +#define CONF_GCLK_GEN_7_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_7_div_sel +#ifndef CONF_GCLK_GEN_7_DIVSEL +#define CONF_GCLK_GEN_7_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_7_oe +#ifndef CONF_GCLK_GEN_7_OE +#define CONF_GCLK_GEN_7_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_7_oov +#ifndef CONF_GCLK_GEN_7_OOV +#define CONF_GCLK_GEN_7_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_7_idc +#ifndef CONF_GCLK_GEN_7_IDC +#define CONF_GCLK_GEN_7_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_7_enable +#ifndef CONF_GCLK_GEN_7_GENEN +#define CONF_GCLK_GEN_7_GENEN 0 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 7 division <0x0000-0xFFFF> +// gclk_gen_7_div +#ifndef CONF_GCLK_GEN_7_DIV +#define CONF_GCLK_GEN_7_DIV 1 +#endif +// +// + +// Generic clock generator 8 configuration +// Indicates whether generic clock 8 configuration is enabled or not +// enable_gclk_gen_8 +#ifndef CONF_GCLK_GENERATOR_8_CONFIG +#define CONF_GCLK_GENERATOR_8_CONFIG 0 +#endif + +// Generic Clock Generator Control +// Generic clock generator 8 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 8 +// gclk_gen_8_oscillator +#ifndef CONF_GCLK_GEN_8_SOURCE +#define CONF_GCLK_GEN_8_SOURCE GCLK_GENCTRL_SRC_XOSC1 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_8_runstdby +#ifndef CONF_GCLK_GEN_8_RUNSTDBY +#define CONF_GCLK_GEN_8_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_8_div_sel +#ifndef CONF_GCLK_GEN_8_DIVSEL +#define CONF_GCLK_GEN_8_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_8_oe +#ifndef CONF_GCLK_GEN_8_OE +#define CONF_GCLK_GEN_8_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_8_oov +#ifndef CONF_GCLK_GEN_8_OOV +#define CONF_GCLK_GEN_8_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_8_idc +#ifndef CONF_GCLK_GEN_8_IDC +#define CONF_GCLK_GEN_8_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_8_enable +#ifndef CONF_GCLK_GEN_8_GENEN +#define CONF_GCLK_GEN_8_GENEN 0 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 8 division <0x0000-0xFFFF> +// gclk_gen_8_div +#ifndef CONF_GCLK_GEN_8_DIV +#define CONF_GCLK_GEN_8_DIV 1 +#endif +// +// + +// Generic clock generator 9 configuration +// Indicates whether generic clock 9 configuration is enabled or not +// enable_gclk_gen_9 +#ifndef CONF_GCLK_GENERATOR_9_CONFIG +#define CONF_GCLK_GENERATOR_9_CONFIG 0 +#endif + +// Generic Clock Generator Control +// Generic clock generator 9 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 9 +// gclk_gen_9_oscillator +#ifndef CONF_GCLK_GEN_9_SOURCE +#define CONF_GCLK_GEN_9_SOURCE GCLK_GENCTRL_SRC_XOSC1 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_9_runstdby +#ifndef CONF_GCLK_GEN_9_RUNSTDBY +#define CONF_GCLK_GEN_9_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_9_div_sel +#ifndef CONF_GCLK_GEN_9_DIVSEL +#define CONF_GCLK_GEN_9_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_9_oe +#ifndef CONF_GCLK_GEN_9_OE +#define CONF_GCLK_GEN_9_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_9_oov +#ifndef CONF_GCLK_GEN_9_OOV +#define CONF_GCLK_GEN_9_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_9_idc +#ifndef CONF_GCLK_GEN_9_IDC +#define CONF_GCLK_GEN_9_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_9_enable +#ifndef CONF_GCLK_GEN_9_GENEN +#define CONF_GCLK_GEN_9_GENEN 0 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 9 division <0x0000-0xFFFF> +// gclk_gen_9_div +#ifndef CONF_GCLK_GEN_9_DIV +#define CONF_GCLK_GEN_9_DIV 1 +#endif +// +// + +// Generic clock generator 10 configuration +// Indicates whether generic clock 10 configuration is enabled or not +// enable_gclk_gen_10 +#ifndef CONF_GCLK_GENERATOR_10_CONFIG +#define CONF_GCLK_GENERATOR_10_CONFIG 0 +#endif + +// Generic Clock Generator Control +// Generic clock generator 10 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 10 +// gclk_gen_10_oscillator +#ifndef CONF_GCLK_GEN_10_SOURCE +#define CONF_GCLK_GEN_10_SOURCE GCLK_GENCTRL_SRC_XOSC1 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_10_runstdby +#ifndef CONF_GCLK_GEN_10_RUNSTDBY +#define CONF_GCLK_GEN_10_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_10_div_sel +#ifndef CONF_GCLK_GEN_10_DIVSEL +#define CONF_GCLK_GEN_10_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_10_oe +#ifndef CONF_GCLK_GEN_10_OE +#define CONF_GCLK_GEN_10_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_10_oov +#ifndef CONF_GCLK_GEN_10_OOV +#define CONF_GCLK_GEN_10_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_10_idc +#ifndef CONF_GCLK_GEN_10_IDC +#define CONF_GCLK_GEN_10_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_10_enable +#ifndef CONF_GCLK_GEN_10_GENEN +#define CONF_GCLK_GEN_10_GENEN 0 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 10 division <0x0000-0xFFFF> +// gclk_gen_10_div +#ifndef CONF_GCLK_GEN_10_DIV +#define CONF_GCLK_GEN_10_DIV 1 +#endif +// +// + +// Generic clock generator 11 configuration +// Indicates whether generic clock 11 configuration is enabled or not +// enable_gclk_gen_11 +#ifndef CONF_GCLK_GENERATOR_11_CONFIG +#define CONF_GCLK_GENERATOR_11_CONFIG 0 +#endif + +// Generic Clock Generator Control +// Generic clock generator 11 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 11 +// gclk_gen_11_oscillator +#ifndef CONF_GCLK_GEN_11_SOURCE +#define CONF_GCLK_GEN_11_SOURCE GCLK_GENCTRL_SRC_XOSC1 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_11_runstdby +#ifndef CONF_GCLK_GEN_11_RUNSTDBY +#define CONF_GCLK_GEN_11_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_11_div_sel +#ifndef CONF_GCLK_GEN_11_DIVSEL +#define CONF_GCLK_GEN_11_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_11_oe +#ifndef CONF_GCLK_GEN_11_OE +#define CONF_GCLK_GEN_11_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_11_oov +#ifndef CONF_GCLK_GEN_11_OOV +#define CONF_GCLK_GEN_11_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_11_idc +#ifndef CONF_GCLK_GEN_11_IDC +#define CONF_GCLK_GEN_11_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_11_enable +#ifndef CONF_GCLK_GEN_11_GENEN +#define CONF_GCLK_GEN_11_GENEN 0 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 11 division <0x0000-0xFFFF> +// gclk_gen_11_div +#ifndef CONF_GCLK_GEN_11_DIV +#define CONF_GCLK_GEN_11_DIV 1 +#endif +// +// + +// <<< end of configuration section >>> + +#endif // HPL_GCLK_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_mclk_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_mclk_config.h new file mode 100644 index 0000000000..a5a7de53c2 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_mclk_config.h @@ -0,0 +1,104 @@ +/* Auto-generated config file hpl_mclk_config.h */ +#ifndef HPL_MCLK_CONFIG_H +#define HPL_MCLK_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +#include + +// System Configuration +// Indicates whether configuration for system is enabled or not +// enable_cpu_clock +#ifndef CONF_SYSTEM_CONFIG +#define CONF_SYSTEM_CONFIG 1 +#endif + +// Basic settings +// CPU Clock source +// Generic clock generator 0 +// This defines the clock source for the CPU +// cpu_clock_source +#ifndef CONF_CPU_SRC +#define CONF_CPU_SRC GCLK_PCHCTRL_GEN_GCLK0_Val +#endif + +// CPU Clock Division Factor +// 1 +// 2 +// 4 +// 8 +// 16 +// 32 +// 64 +// 128 +// Prescalar for CPU clock +// cpu_div +#ifndef CONF_MCLK_CPUDIV +#define CONF_MCLK_CPUDIV MCLK_CPUDIV_DIV_DIV1_Val +#endif +// Low Power Clock Division +// Divide by 1 +// Divide by 2 +// Divide by 4 +// Divide by 8 +// Divide by 16 +// Divide by 32 +// Divide by 64 +// Divide by 128 +// mclk_arch_lpdiv +#ifndef CONF_MCLK_LPDIV +#define CONF_MCLK_LPDIV MCLK_LPDIV_LPDIV_DIV4_Val +#endif + +// Backup Clock Division +// Divide by 1 +// Divide by 2 +// Divide by 4 +// Divide by 8 +// Divide by 16 +// Divide by 32 +// Divide by 64 +// Divide by 128 +// mclk_arch_bupdiv +#ifndef CONF_MCLK_BUPDIV +#define CONF_MCLK_BUPDIV MCLK_BUPDIV_BUPDIV_DIV8_Val +#endif +// High-Speed Clock Division +// Divide by 1 +// mclk_arch_hsdiv +#ifndef CONF_MCLK_HSDIV +#define CONF_MCLK_HSDIV MCLK_HSDIV_DIV_DIV1_Val +#endif +// + +// NVM Settings +// NVM Wait States +// These bits select the number of wait states for a read operation. +// <0=> 0 +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 +// <8=> 8 +// <9=> 9 +// <10=> 10 +// <11=> 11 +// <12=> 12 +// <13=> 13 +// <14=> 14 +// <15=> 15 +// nvm_wait_states +#ifndef CONF_NVM_WAIT_STATE +#define CONF_NVM_WAIT_STATE 0 +#endif + +// + +// + +// <<< end of configuration section >>> + +#endif // HPL_MCLK_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_nvmctrl_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_nvmctrl_config.h new file mode 100644 index 0000000000..53fcb593ab --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_nvmctrl_config.h @@ -0,0 +1,36 @@ +/* Auto-generated config file hpl_nvmctrl_config.h */ +#ifndef HPL_NVMCTRL_CONFIG_H +#define HPL_NVMCTRL_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Basic Settings + +// Power Reduction Mode During Sleep +// <0x00=> Wake On Access +// <0x01=> Wake Up Instant +// <0x03=> Disabled +// nvm_arch_sleepprm +#ifndef CONF_NVM_SLEEPPRM +#define CONF_NVM_SLEEPPRM 0 +#endif + +// AHB0 Cache Disable +// Indicate whether AHB0 cache is disable or not +// nvm_arch_cache0 +#ifndef CONF_NVM_CACHE0 +#define CONF_NVM_CACHE0 1 +#endif + +// AHB1 Cache Disable +// Indicate whether AHB1 cache is disable or not +// nvm_arch_cache1 +#ifndef CONF_NVM_CACHE1 +#define CONF_NVM_CACHE1 1 +#endif + +// + +// <<< end of configuration section >>> + +#endif // HPL_NVMCTRL_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_osc32kctrl_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_osc32kctrl_config.h new file mode 100644 index 0000000000..d93cbf922e --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_osc32kctrl_config.h @@ -0,0 +1,163 @@ +/* Auto-generated config file hpl_osc32kctrl_config.h */ +#ifndef HPL_OSC32KCTRL_CONFIG_H +#define HPL_OSC32KCTRL_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// RTC Source configuration +// enable_rtc_source +#ifndef CONF_RTCCTRL_CONFIG +#define CONF_RTCCTRL_CONFIG 0 +#endif + +// RTC source control +// RTC Clock Source Selection +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// This defines the clock source for RTC +// rtc_source_oscillator +#ifndef CONF_RTCCTRL_SRC +#define CONF_RTCCTRL_SRC GCLK_GENCTRL_SRC_OSCULP32K +#endif + +// Use 1 kHz output +// rtc_1khz_selection +#ifndef CONF_RTCCTRL_1KHZ +#define CONF_RTCCTRL_1KHZ 1 +#endif + +#if CONF_RTCCTRL_SRC == GCLK_GENCTRL_SRC_OSCULP32K +#define CONF_RTCCTRL (CONF_RTCCTRL_1KHZ ? OSC32KCTRL_RTCCTRL_RTCSEL_ULP1K_Val : OSC32KCTRL_RTCCTRL_RTCSEL_ULP32K_Val) +#elif CONF_RTCCTRL_SRC == GCLK_GENCTRL_SRC_XOSC32K +#define CONF_RTCCTRL (CONF_RTCCTRL_1KHZ ? OSC32KCTRL_RTCCTRL_RTCSEL_XOSC1K_Val : OSC32KCTRL_RTCCTRL_RTCSEL_XOSC32K_Val) +#else +#error unexpected CONF_RTCCTRL_SRC +#endif + +// +// + +// 32kHz External Crystal Oscillator Configuration +// Indicates whether configuration for External 32K Osc is enabled or not +// enable_xosc32k +#ifndef CONF_XOSC32K_CONFIG +#define CONF_XOSC32K_CONFIG 1 +#endif + +// 32kHz External Crystal Oscillator Control +// Oscillator enable +// Indicates whether 32kHz External Crystal Oscillator is enabled or not +// xosc32k_arch_enable +#ifndef CONF_XOSC32K_ENABLE +#define CONF_XOSC32K_ENABLE 1 +#endif + +// Start-Up Time +// <0x0=>62592us +// <0x1=>125092us +// <0x2=>500092us +// <0x3=>1000092us +// <0x4=>2000092us +// <0x5=>4000092us +// <0x6=>8000092us +// xosc32k_arch_startup +#ifndef CONF_XOSC32K_STARTUP +#define CONF_XOSC32K_STARTUP 0x0 +#endif + +// On Demand Control +// Indicates whether On Demand Control is enabled or not +// xosc32k_arch_ondemand +#ifndef CONF_XOSC32K_ONDEMAND +#define CONF_XOSC32K_ONDEMAND 1 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// xosc32k_arch_runstdby +#ifndef CONF_XOSC32K_RUNSTDBY +#define CONF_XOSC32K_RUNSTDBY 0 +#endif + +// 1kHz Output Enable +// Indicates whether 1kHz Output is enabled or not +// xosc32k_arch_en1k +#ifndef CONF_XOSC32K_EN1K +#define CONF_XOSC32K_EN1K 0 +#endif + +// 32kHz Output Enable +// Indicates whether 32kHz Output is enabled or not +// xosc32k_arch_en32k +#ifndef CONF_XOSC32K_EN32K +#define CONF_XOSC32K_EN32K 0 +#endif + +// Clock Switch Back +// Indicates whether Clock Switch Back is enabled or not +// xosc32k_arch_swben +#ifndef CONF_XOSC32K_SWBEN +#define CONF_XOSC32K_SWBEN 0 +#endif + +// Clock Failure Detector +// Indicates whether Clock Failure Detector is enabled or not +// xosc32k_arch_cfden +#ifndef CONF_XOSC32K_CFDEN +#define CONF_XOSC32K_CFDEN 0 +#endif + +// Clock Failure Detector Event Out +// Indicates whether Clock Failure Detector Event Out is enabled or not +// xosc32k_arch_cfdeo +#ifndef CONF_XOSC32K_CFDEO +#define CONF_XOSC32K_CFDEO 0 +#endif + +// Crystal connected to XIN32/XOUT32 Enable +// Indicates whether the connections between the I/O pads and the external clock or crystal oscillator is enabled or not +// xosc32k_arch_xtalen +#ifndef CONF_XOSC32K_XTALEN +#define CONF_XOSC32K_XTALEN 0 +#endif + +// Control Gain Mode +// <0x0=>Low Power mode +// <0x1=>Standard mode +// <0x2=>High Speed mode +// xosc32k_arch_cgm +#ifndef CONF_XOSC32K_CGM +#define CONF_XOSC32K_CGM 0x1 +#endif + +// +// + +// 32kHz Ultra Low Power Internal Oscillator Configuration +// Indicates whether configuration for OSCULP32K is enabled or not +// enable_osculp32k +#ifndef CONF_OSCULP32K_CONFIG +#define CONF_OSCULP32K_CONFIG 1 +#endif + +// 32kHz Ultra Low Power Internal Oscillator Control + +// Oscillator Calibration Control +// Indicates whether Oscillator Calibration is enabled or not +// osculp32k_calib_enable +#ifndef CONF_OSCULP32K_CALIB_ENABLE +#define CONF_OSCULP32K_CALIB_ENABLE 0 +#endif + +// Oscillator Calibration <0x0-0x3F> +// osculp32k_calib +#ifndef CONF_OSCULP32K_CALIB +#define CONF_OSCULP32K_CALIB 0x0 +#endif + +// +// + +// <<< end of configuration section >>> + +#endif // HPL_OSC32KCTRL_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_oscctrl_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_oscctrl_config.h new file mode 100644 index 0000000000..cd11866059 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_oscctrl_config.h @@ -0,0 +1,634 @@ +/* Auto-generated config file hpl_oscctrl_config.h */ +#ifndef HPL_OSCCTRL_CONFIG_H +#define HPL_OSCCTRL_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// External Multipurpose Crystal Oscillator Configuration +// Indicates whether configuration for XOSC0 is enabled or not +// enable_xosc0 +#ifndef CONF_XOSC0_CONFIG +#define CONF_XOSC0_CONFIG 0 +#endif + +// Frequency <8000000-48000000> +// Oscillation frequency of the resonator connected to the External Multipurpose Crystal Oscillator. +// xosc0_frequency +#ifndef CONF_XOSC_FREQUENCY +#define CONF_XOSC0_FREQUENCY 12000000 +#endif + +// External Multipurpose Crystal Oscillator Control +// Oscillator enable +// Indicates whether External Multipurpose Crystal Oscillator is enabled or not +// xosc0_arch_enable +#ifndef CONF_XOSC0_ENABLE +#define CONF_XOSC0_ENABLE 0 +#endif + +// Start-Up Time +// <0x0=>31us +// <0x1=>61us +// <0x2=>122us +// <0x3=>244us +// <0x4=>488us +// <0x5=>977us +// <0x6=>1953us +// <0x7=>3906us +// <0x8=>7813us +// <0x9=>15625us +// <0xA=>31250us +// <0xB=>62500us +// <0xC=>125000us +// <0xD=>250000us +// <0xE=>500000us +// <0xF=>1000000us +// xosc0_arch_startup +#ifndef CONF_XOSC0_STARTUP +#define CONF_XOSC0_STARTUP 0 +#endif + +// Clock Switch Back +// Indicates whether Clock Switch Back is enabled or not +// xosc0_arch_swben +#ifndef CONF_XOSC0_SWBEN +#define CONF_XOSC0_SWBEN 0 +#endif + +// Clock Failure Detector +// Indicates whether Clock Failure Detector is enabled or not +// xosc0_arch_cfden +#ifndef CONF_XOSC0_CFDEN +#define CONF_XOSC0_CFDEN 0 +#endif + +// Automatic Loop Control Enable +// Indicates whether Automatic Loop Control is enabled or not +// xosc0_arch_enalc +#ifndef CONF_XOSC0_ENALC +#define CONF_XOSC0_ENALC 0 +#endif + +// Low Buffer Gain Enable +// Indicates whether Low Buffer Gain is enabled or not +// xosc0_arch_lowbufgain +#ifndef CONF_XOSC0_LOWBUFGAIN +#define CONF_XOSC0_LOWBUFGAIN 0 +#endif + +// On Demand Control +// Indicates whether On Demand Control is enabled or not +// xosc0_arch_ondemand +#ifndef CONF_XOSC0_ONDEMAND +#define CONF_XOSC0_ONDEMAND 0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// xosc0_arch_runstdby +#ifndef CONF_XOSC0_RUNSTDBY +#define CONF_XOSC0_RUNSTDBY 0 +#endif + +// Crystal connected to XIN/XOUT Enable +// Indicates whether the connections between the I/O pads and the external clock or crystal oscillator is enabled or not +// xosc0_arch_xtalen +#ifndef CONF_XOSC0_XTALEN +#define CONF_XOSC0_XTALEN 0 +#endif +// +// + +#if CONF_XOSC0_FREQUENCY >= 32000000 +#define CONF_XOSC0_CFDPRESC 0x0 +#define CONF_XOSC0_IMULT 0x7 +#define CONF_XOSC0_IPTAT 0x3 +#elif CONF_XOSC0_FREQUENCY >= 24000000 +#define CONF_XOSC0_CFDPRESC 0x1 +#define CONF_XOSC0_IMULT 0x6 +#define CONF_XOSC0_IPTAT 0x3 +#elif CONF_XOSC0_FREQUENCY >= 16000000 +#define CONF_XOSC0_CFDPRESC 0x2 +#define CONF_XOSC0_IMULT 0x5 +#define CONF_XOSC0_IPTAT 0x3 +#elif CONF_XOSC0_FREQUENCY >= 8000000 +#define CONF_XOSC0_CFDPRESC 0x3 +#define CONF_XOSC0_IMULT 0x4 +#define CONF_XOSC0_IPTAT 0x3 +#endif + +// External Multipurpose Crystal Oscillator Configuration +// Indicates whether configuration for XOSC1 is enabled or not +// enable_xosc1 +#ifndef CONF_XOSC1_CONFIG +#define CONF_XOSC1_CONFIG 0 +#endif + +// Frequency <8000000-48000000> +// Oscillation frequency of the resonator connected to the External Multipurpose Crystal Oscillator. +// xosc1_frequency +#ifndef CONF_XOSC_FREQUENCY +#define CONF_XOSC1_FREQUENCY 12000000 +#endif + +// External Multipurpose Crystal Oscillator Control +// Oscillator enable +// Indicates whether External Multipurpose Crystal Oscillator is enabled or not +// xosc1_arch_enable +#ifndef CONF_XOSC1_ENABLE +#define CONF_XOSC1_ENABLE 0 +#endif + +// Start-Up Time +// <0x0=>31us +// <0x1=>61us +// <0x2=>122us +// <0x3=>244us +// <0x4=>488us +// <0x5=>977us +// <0x6=>1953us +// <0x7=>3906us +// <0x8=>7813us +// <0x9=>15625us +// <0xA=>31250us +// <0xB=>62500us +// <0xC=>125000us +// <0xD=>250000us +// <0xE=>500000us +// <0xF=>1000000us +// xosc1_arch_startup +#ifndef CONF_XOSC1_STARTUP +#define CONF_XOSC1_STARTUP 0 +#endif + +// Clock Switch Back +// Indicates whether Clock Switch Back is enabled or not +// xosc1_arch_swben +#ifndef CONF_XOSC1_SWBEN +#define CONF_XOSC1_SWBEN 0 +#endif + +// Clock Failure Detector +// Indicates whether Clock Failure Detector is enabled or not +// xosc1_arch_cfden +#ifndef CONF_XOSC1_CFDEN +#define CONF_XOSC1_CFDEN 0 +#endif + +// Automatic Loop Control Enable +// Indicates whether Automatic Loop Control is enabled or not +// xosc1_arch_enalc +#ifndef CONF_XOSC1_ENALC +#define CONF_XOSC1_ENALC 0 +#endif + +// Low Buffer Gain Enable +// Indicates whether Low Buffer Gain is enabled or not +// xosc1_arch_lowbufgain +#ifndef CONF_XOSC1_LOWBUFGAIN +#define CONF_XOSC1_LOWBUFGAIN 0 +#endif + +// On Demand Control +// Indicates whether On Demand Control is enabled or not +// xosc1_arch_ondemand +#ifndef CONF_XOSC1_ONDEMAND +#define CONF_XOSC1_ONDEMAND 0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// xosc1_arch_runstdby +#ifndef CONF_XOSC1_RUNSTDBY +#define CONF_XOSC1_RUNSTDBY 0 +#endif + +// Crystal connected to XIN/XOUT Enable +// Indicates whether the connections between the I/O pads and the external clock or crystal oscillator is enabled or not +// xosc1_arch_xtalen +#ifndef CONF_XOSC1_XTALEN +#define CONF_XOSC1_XTALEN 0 +#endif +// +// + +#if CONF_XOSC1_FREQUENCY >= 32000000 +#define CONF_XOSC1_CFDPRESC 0x0 +#define CONF_XOSC1_IMULT 0x7 +#define CONF_XOSC1_IPTAT 0x3 +#elif CONF_XOSC1_FREQUENCY >= 24000000 +#define CONF_XOSC1_CFDPRESC 0x1 +#define CONF_XOSC1_IMULT 0x6 +#define CONF_XOSC1_IPTAT 0x3 +#elif CONF_XOSC1_FREQUENCY >= 16000000 +#define CONF_XOSC1_CFDPRESC 0x2 +#define CONF_XOSC1_IMULT 0x5 +#define CONF_XOSC1_IPTAT 0x3 +#elif CONF_XOSC1_FREQUENCY >= 8000000 +#define CONF_XOSC1_CFDPRESC 0x3 +#define CONF_XOSC1_IMULT 0x4 +#define CONF_XOSC1_IPTAT 0x3 +#endif + +// DFLL Configuration +// Indicates whether configuration for DFLL is enabled or not +// enable_dfll +#ifndef CONF_DFLL_CONFIG +#define CONF_DFLL_CONFIG 0 +#endif + +// Reference Clock Source +// Generic clock generator 0 +// Generic clock generator 1 +// Generic clock generator 2 +// Generic clock generator 3 +// Generic clock generator 4 +// Generic clock generator 5 +// Generic clock generator 6 +// Generic clock generator 7 +// Generic clock generator 8 +// Generic clock generator 9 +// Generic clock generator 10 +// Generic clock generator 11 +// Select the clock source +// dfll_ref_clock +#ifndef CONF_DFLL_GCLK +#define CONF_DFLL_GCLK GCLK_PCHCTRL_GEN_GCLK3_Val +#endif + +// Digital Frequency Locked Loop Control +// DFLL Enable +// Indicates whether DFLL is enabled or not +// dfll_arch_enable +#ifndef CONF_DFLL_ENABLE +#define CONF_DFLL_ENABLE 1 +#endif + +// On Demand Control +// Indicates whether On Demand Control is enabled or not +// dfll_arch_ondemand +#ifndef CONF_DFLL_ONDEMAND +#define CONF_DFLL_ONDEMAND 0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// dfll_arch_runstdby +#ifndef CONF_DFLL_RUNSTDBY +#define CONF_DFLL_RUNSTDBY 0 +#endif + +// USB Clock Recovery Mode +// Indicates whether USB Clock Recovery Mode is enabled or not +// dfll_arch_usbcrm +#ifndef CONF_DFLL_USBCRM +#define CONF_DFLL_USBCRM 1 +#endif + +// Wait Lock +// Indicates whether Wait Lock is enabled or not +// dfll_arch_waitlock +#ifndef CONF_DFLL_WAITLOCK +#define CONF_DFLL_WAITLOCK 1 +#endif + +// Bypass Coarse Lock +// Indicates whether Bypass Coarse Lock is enabled or not +// dfll_arch_bplckc +#ifndef CONF_DFLL_BPLCKC +#define CONF_DFLL_BPLCKC 0 +#endif + +// Quick Lock Disable +// Indicates whether Quick Lock Disable is enabled or not +// dfll_arch_qldis +#ifndef CONF_DFLL_QLDIS +#define CONF_DFLL_QLDIS 0 +#endif + +// Chill Cycle Disable +// Indicates whether Chill Cycle Disable is enabled or not +// dfll_arch_ccdis +#ifndef CONF_DFLL_CCDIS +#define CONF_DFLL_CCDIS 1 +#endif + +// Lose Lock After Wake +// Indicates whether Lose Lock After Wake is enabled or not +// dfll_arch_llaw +#ifndef CONF_DFLL_LLAW +#define CONF_DFLL_LLAW 0 +#endif + +// Stable DFLL Frequency +// Indicates whether Stable DFLL Frequency is enabled or not +// dfll_arch_stable +#ifndef CONF_DFLL_STABLE +#define CONF_DFLL_STABLE 0 +#endif + +// Operating Mode Selection +// <0=>Open Loop Mode +// <1=>Closed Loop Mode +// dfll_mode +#ifndef CONF_DFLL_MODE +#define CONF_DFLL_MODE 0x0 +#endif + +// Coarse Maximum Step <0x0-0x1F> +// dfll_arch_cstep +#ifndef CONF_DFLL_CSTEP +#define CONF_DFLL_CSTEP 0x1 +#endif + +// Fine Maximum Step <0x0-0xFF> +// dfll_arch_fstep +#ifndef CONF_DFLL_FSTEP +#define CONF_DFLL_FSTEP 0x1 +#endif + +// DFLL Multiply Factor <0x0-0xFFFF> +// dfll_mul +#ifndef CONF_DFLL_MUL +#define CONF_DFLL_MUL 0x0 +#endif + +// DFLL Calibration Overwrite +// Indicates whether Overwrite Calibration value of DFLL +// dfll_arch_calibration +#ifndef CONF_DFLL_OVERWRITE_CALIBRATION +#define CONF_DFLL_OVERWRITE_CALIBRATION 0 +#endif + +// Coarse Value <0x0-0x3F> +// dfll_arch_coarse +#ifndef CONF_DFLL_COARSE +#define CONF_DFLL_COARSE (0x1f / 4) +#endif + +// Fine Value <0x0-0xFF> +// dfll_arch_fine +#ifndef CONF_DFLL_FINE +#define CONF_DFLL_FINE (0x80) +#endif + +// + +// + +// + +// FDPLL0 Configuration +// Indicates whether configuration for FDPLL0 is enabled or not +// enable_fdpll0 +#ifndef CONF_FDPLL0_CONFIG +#define CONF_FDPLL0_CONFIG 1 +#endif + +// Reference Clock Source +// 32kHz External Crystal Oscillator (XOSC32K) +// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator 0 +// Generic clock generator 1 +// Generic clock generator 2 +// Generic clock generator 3 +// Generic clock generator 4 +// Generic clock generator 5 +// Generic clock generator 6 +// Generic clock generator 7 +// Generic clock generator 8 +// Generic clock generator 9 +// Generic clock generator 10 +// Generic clock generator 11 +// Select the clock source. +// fdpll0_ref_clock +#ifndef CONF_FDPLL0_GCLK +#define CONF_FDPLL0_GCLK GCLK_PCHCTRL_GEN_GCLK5_Val +#endif + +// Digital Phase Locked Loop Control +// Enable +// Indicates whether Digital Phase Locked Loop is enabled or not +// fdpll0_arch_enable +#ifndef CONF_FDPLL0_ENABLE +#define CONF_FDPLL0_ENABLE 1 +#endif + +// On Demand Control +// Indicates whether On Demand Control is enabled or not +// fdpll0_arch_ondemand +#ifndef CONF_FDPLL0_ONDEMAND +#define CONF_FDPLL0_ONDEMAND 0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// fdpll0_arch_runstdby +#ifndef CONF_FDPLL0_RUNSTDBY +#define CONF_FDPLL0_RUNSTDBY 0 +#endif + +// Loop Divider Ratio Fractional Part <0x0-0x1F> +// fdpll0_ldrfrac +#ifndef CONF_FDPLL0_LDRFRAC +#define CONF_FDPLL0_LDRFRAC 0x0 +#endif + +// Loop Divider Ratio Integer Part <0x0-0x1FFF> +// fdpll0_ldr +#ifndef CONF_FDPLL0_LDR +#define CONF_FDPLL0_LDR 59 +#endif + +// Clock Divider <0x0-0x7FF> +// fdpll0_clock_div +#ifndef CONF_FDPLL0_DIV +#define CONF_FDPLL0_DIV 0x0 +#endif + +// DCO Filter Enable +// Indicates whether DCO Filter Enable is enabled or not +// fdpll0_arch_dcoen +#ifndef CONF_FDPLL0_DCOEN +#define CONF_FDPLL0_DCOEN 0 +#endif + +// Sigma-Delta DCO Filter Selection <0x0-0x7> +// fdpll0_clock_dcofilter +#ifndef CONF_FDPLL0_DCOFILTER +#define CONF_FDPLL0_DCOFILTER 0x0 +#endif + +// Lock Bypass +// Indicates whether Lock Bypass is enabled or not +// fdpll0_arch_lbypass +#ifndef CONF_FDPLL0_LBYPASS +#define CONF_FDPLL0_LBYPASS 0 +#endif + +// Lock Time +// <0x0=>No time-out, automatic lock +// <0x4=>The Time-out if no lock within 800 us +// <0x5=>The Time-out if no lock within 900 us +// <0x6=>The Time-out if no lock within 1 ms +// <0x7=>The Time-out if no lock within 11 ms +// fdpll0_arch_ltime +#ifndef CONF_FDPLL0_LTIME +#define CONF_FDPLL0_LTIME 0x0 +#endif + +// Reference Clock Selection +// <0x0=>GCLK clock reference +// <0x1=>XOSC32K clock reference +// <0x2=>XOSC0 clock reference +// <0x3=>XOSC1 clock reference +// fdpll0_arch_refclk +#ifndef CONF_FDPLL0_REFCLK +#define CONF_FDPLL0_REFCLK 0x0 +#endif + +// Wake Up Fast +// Indicates whether Wake Up Fast is enabled or not +// fdpll0_arch_wuf +#ifndef CONF_FDPLL0_WUF +#define CONF_FDPLL0_WUF 0 +#endif + +// Proportional Integral Filter Selection <0x0-0xF> +// fdpll0_arch_filter +#ifndef CONF_FDPLL0_FILTER +#define CONF_FDPLL0_FILTER 0x0 +#endif + +// +// +// FDPLL1 Configuration +// Indicates whether configuration for FDPLL1 is enabled or not +// enable_fdpll1 +#ifndef CONF_FDPLL1_CONFIG +#define CONF_FDPLL1_CONFIG 0 +#endif + +// Reference Clock Source +// 32kHz External Crystal Oscillator (XOSC32K) +// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator 0 +// Generic clock generator 1 +// Generic clock generator 2 +// Generic clock generator 3 +// Generic clock generator 4 +// Generic clock generator 5 +// Generic clock generator 6 +// Generic clock generator 7 +// Generic clock generator 8 +// Generic clock generator 9 +// Generic clock generator 10 +// Generic clock generator 11 +// Select the clock source. +// fdpll1_ref_clock +#ifndef CONF_FDPLL1_GCLK +#define CONF_FDPLL1_GCLK GCLK_GENCTRL_SRC_XOSC32K +#endif + +// Digital Phase Locked Loop Control +// Enable +// Indicates whether Digital Phase Locked Loop is enabled or not +// fdpll1_arch_enable +#ifndef CONF_FDPLL1_ENABLE +#define CONF_FDPLL1_ENABLE 0 +#endif + +// On Demand Control +// Indicates whether On Demand Control is enabled or not +// fdpll1_arch_ondemand +#ifndef CONF_FDPLL1_ONDEMAND +#define CONF_FDPLL1_ONDEMAND 0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// fdpll1_arch_runstdby +#ifndef CONF_FDPLL1_RUNSTDBY +#define CONF_FDPLL1_RUNSTDBY 0 +#endif + +// Loop Divider Ratio Fractional Part <0x0-0x1F> +// fdpll1_ldrfrac +#ifndef CONF_FDPLL1_LDRFRAC +#define CONF_FDPLL1_LDRFRAC 0xd +#endif + +// Loop Divider Ratio Integer Part <0x0-0x1FFF> +// fdpll1_ldr +#ifndef CONF_FDPLL1_LDR +#define CONF_FDPLL1_LDR 0x5b7 +#endif + +// Clock Divider <0x0-0x7FF> +// fdpll1_clock_div +#ifndef CONF_FDPLL1_DIV +#define CONF_FDPLL1_DIV 0x0 +#endif + +// DCO Filter Enable +// Indicates whether DCO Filter Enable is enabled or not +// fdpll1_arch_dcoen +#ifndef CONF_FDPLL1_DCOEN +#define CONF_FDPLL1_DCOEN 0 +#endif + +// Sigma-Delta DCO Filter Selection <0x0-0x7> +// fdpll1_clock_dcofilter +#ifndef CONF_FDPLL1_DCOFILTER +#define CONF_FDPLL1_DCOFILTER 0x0 +#endif + +// Lock Bypass +// Indicates whether Lock Bypass is enabled or not +// fdpll1_arch_lbypass +#ifndef CONF_FDPLL1_LBYPASS +#define CONF_FDPLL1_LBYPASS 0 +#endif + +// Lock Time +// <0x0=>No time-out, automatic lock +// <0x4=>The Time-out if no lock within 800 us +// <0x5=>The Time-out if no lock within 900 us +// <0x6=>The Time-out if no lock within 1 ms +// <0x7=>The Time-out if no lock within 11 ms +// fdpll1_arch_ltime +#ifndef CONF_FDPLL1_LTIME +#define CONF_FDPLL1_LTIME 0x0 +#endif + +// Reference Clock Selection +// <0x0=>GCLK clock reference +// <0x1=>XOSC32K clock reference +// <0x2=>XOSC0 clock reference +// <0x3=>XOSC1 clock reference +// fdpll1_arch_refclk +#ifndef CONF_FDPLL1_REFCLK +#define CONF_FDPLL1_REFCLK 0x1 +#endif + +// Wake Up Fast +// Indicates whether Wake Up Fast is enabled or not +// fdpll1_arch_wuf +#ifndef CONF_FDPLL1_WUF +#define CONF_FDPLL1_WUF 0 +#endif + +// Proportional Integral Filter Selection <0x0-0xF> +// fdpll1_arch_filter +#ifndef CONF_FDPLL1_FILTER +#define CONF_FDPLL1_FILTER 0x0 +#endif + +// +// + +// <<< end of configuration section >>> + +#endif // HPL_OSCCTRL_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_rtc_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_rtc_config.h new file mode 100644 index 0000000000..2b0b6712e6 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_rtc_config.h @@ -0,0 +1,145 @@ +/* Auto-generated config file hpl_rtc_config.h */ +#ifndef HPL_RTC_CONFIG_H +#define HPL_RTC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Basic settings + +#ifndef CONF_RTC_ENABLE +#define CONF_RTC_ENABLE 1 +#endif + +// Force reset RTC on initialization +// Force RTC to reset on initialization. +// Note that the previous power down data in RTC is lost if it's enabled. +// rtc_arch_init_reset +#ifndef CONF_RTC_INIT_RESET +#define CONF_RTC_INIT_RESET 0 +#endif + +// Prescaler configuration +// <0x0=>OFF(Peripheral clock divided by 1) +// <0x1=>Peripheral clock divided by 1 +// <0x2=>Peripheral clock divided by 2 +// <0x3=>Peripheral clock divided by 4 +// <0x4=>Peripheral clock divided by 8 +// <0x5=>Peripheral clock divided by 16 +// <0x6=>Peripheral clock divided by 32 +// <0x7=>Peripheral clock divided by 64 +// <0x8=>Peripheral clock divided by 128 +// <0x9=>Peripheral clock divided by 256 +// <0xA=>Peripheral clock divided by 512 +// <0xB=>Peripheral clock divided by 1024 +// These bits define the RTC clock relative to the peripheral clock +// rtc_arch_prescaler +#ifndef CONF_RTC_PRESCALER +#define CONF_RTC_PRESCALER 0xb + +#endif + +// Compare Value <1-4294967295> +// These bits define the RTC Compare value, the ticks period is equal to reciprocal of (rtc clock/prescaler/compare value), +// by default 1K clock input, 1 prescaler, 1 compare value, the ticks period equals to 1ms. +// rtc_arch_comp_val + +#ifndef CONF_RTC_COMP_VAL +#define CONF_RTC_COMP_VAL 1 + +#endif + +// Event control +// rtc_event_control +#ifndef CONF_RTC_EVENT_CONTROL_ENABLE +#define CONF_RTC_EVENT_CONTROL_ENABLE 0 +#endif + +// Periodic Interval 0 Event Output +// This bit indicates whether Periodic interval 0 event is enabled and will be generated +// rtc_pereo0 +#ifndef CONF_RTC_PEREO0 +#define CONF_RTC_PEREO0 0 +#endif +// Periodic Interval 1 Event Output +// This bit indicates whether Periodic interval 1 event is enabled and will be generated +// rtc_pereo1 +#ifndef CONF_RTC_PEREO1 +#define CONF_RTC_PEREO1 0 +#endif +// Periodic Interval 2 Event Output +// This bit indicates whether Periodic interval 2 event is enabled and will be generated +// rtc_pereo2 +#ifndef CONF_RTC_PEREO2 +#define CONF_RTC_PEREO2 0 +#endif +// Periodic Interval 3 Event Output +// This bit indicates whether Periodic interval 3 event is enabled and will be generated +// rtc_pereo3 +#ifndef CONF_RTC_PEREO3 +#define CONF_RTC_PEREO3 0 +#endif +// Periodic Interval 4 Event Output +// This bit indicates whether Periodic interval 4 event is enabled and will be generated +// rtc_pereo4 +#ifndef CONF_RTC_PEREO4 +#define CONF_RTC_PEREO4 0 +#endif +// Periodic Interval 5 Event Output +// This bit indicates whether Periodic interval 5 event is enabled and will be generated +// rtc_pereo5 +#ifndef CONF_RTC_PEREO5 +#define CONF_RTC_PEREO5 0 +#endif +// Periodic Interval 6 Event Output +// This bit indicates whether Periodic interval 6 event is enabled and will be generated +// rtc_pereo6 +#ifndef CONF_RTC_PEREO6 +#define CONF_RTC_PEREO6 0 +#endif +// Periodic Interval 7 Event Output +// This bit indicates whether Periodic interval 7 event is enabled and will be generated +// rtc_pereo7 +#ifndef CONF_RTC_PEREO7 +#define CONF_RTC_PEREO7 0 +#endif + +// Compare 0 Event Output +// This bit indicates whether Compare O event is enabled and will be generated +// rtc_cmpeo0 +#ifndef CONF_RTC_COMPE0 +#define CONF_RTC_COMPE0 0 +#endif + +// Compare 1 Event Output +// This bit indicates whether Compare 1 event is enabled and will be generated +// rtc_cmpeo1 +#ifndef CONF_RTC_COMPE1 +#define CONF_RTC_COMPE1 0 +#endif +// Overflow Event Output +// This bit indicates whether Overflow event is enabled and will be generated +// rtc_ovfeo +#ifndef CONF_RTC_OVFEO +#define CONF_RTC_OVFEO 0 +#endif + +// Tamper Event Output +// This bit indicates whether Tamper event output is enabled and will be generated +// rtc_tampereo +#ifndef CONF_RTC_TAMPEREO +#define CONF_RTC_TAMPEREO 0 +#endif + +// Tamper Event Input +// This bit indicates whether Tamper event input is enabled and will be generated +// rtc_tampevei +#ifndef CONF_RTC_TAMPEVEI +#define CONF_RTC_TAMPEVEI 0 +#endif +// + +// + +// <<< end of configuration section >>> + +#endif // HPL_RTC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_sercom_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_sercom_config.h new file mode 100644 index 0000000000..cd411154c7 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_sercom_config.h @@ -0,0 +1,751 @@ +// For CircuitPython, use SERCOM settings as prototypes to set +// the default settings. This file defines these SERCOMs +// +// SERCOM0: SPI with hal_spi_m_sync.c driver: spi master synchronous +// SERCOM1: I2C with hal_i2c_m_sync.c driver: i2c master synchronous +// SERCOM2: USART with hal_usart_async.c driver: usart asynchronous +// SERCOM3: SPI with hal_spi_m_dma.c: spi master DMA + +#define PROTOTYPE_SERCOM_SPI_M_SYNC SERCOM0 +#define PROTOTYPE_SERCOM_SPI_M_SYNC_CLOCK_FREQUENCY CONF_GCLK_SERCOM0_CORE_FREQUENCY + +#define PROTOTYPE_SERCOM_I2CM_SYNC SERCOM1 + +#define PROTOTYPE_SERCOM_USART_ASYNC SERCOM2 +#define PROTOTYPE_SERCOM_USART_ASYNC_CLOCK_FREQUENCY CONF_GCLK_SERCOM2_CORE_FREQUENCY + +/* Auto-generated config file hpl_sercom_config.h */ +#ifndef HPL_SERCOM_CONFIG_H +#define HPL_SERCOM_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +#include + +// Enable configuration of module +#ifndef CONF_SERCOM_0_SPI_ENABLE +#define CONF_SERCOM_0_SPI_ENABLE 1 +#endif + +// Set module in SPI Master mode +#ifndef CONF_SERCOM_0_SPI_MODE +#define CONF_SERCOM_0_SPI_MODE 0x03 +#endif + +// Basic Configuration + +// Receive buffer enable +// Enable receive buffer to receive data from slave (RXEN) +// spi_master_rx_enable +#ifndef CONF_SERCOM_0_SPI_RXEN +#define CONF_SERCOM_0_SPI_RXEN 0x1 +#endif + +// Character Size +// Bit size for all characters sent over the SPI bus (CHSIZE) +// <0x0=>8 bits +// <0x1=>9 bits +// spi_master_character_size +#ifndef CONF_SERCOM_0_SPI_CHSIZE +#define CONF_SERCOM_0_SPI_CHSIZE 0x0 +#endif + +// Baud rate <1-12000000> +// The SPI data transfer rate +// spi_master_baud_rate +#ifndef CONF_SERCOM_0_SPI_BAUD +#define CONF_SERCOM_0_SPI_BAUD 50000 +#endif + +// + +// Advanced Configuration +// spi_master_advanced +#ifndef CONF_SERCOM_0_SPI_ADVANCED +#define CONF_SERCOM_0_SPI_ADVANCED 1 +#endif + +// Dummy byte <0x00-0x1ff> +// spi_master_dummybyte +// Dummy byte used when reading data from the slave without sending any data +#ifndef CONF_SERCOM_0_SPI_DUMMYBYTE +#define CONF_SERCOM_0_SPI_DUMMYBYTE 0x1ff +#endif + +// Data Order +// <0=>MSB first +// <1=>LSB first +// I least significant or most significant bit is shifted out first (DORD) +// spi_master_arch_dord +#ifndef CONF_SERCOM_0_SPI_DORD +#define CONF_SERCOM_0_SPI_DORD 0x0 +#endif + +// Clock Polarity +// <0=>SCK is low when idle +// <1=>SCK is high when idle +// Determines if the leading edge is rising or falling with a corresponding opposite edge at the trailing edge. (CPOL) +// spi_master_arch_cpol +#ifndef CONF_SERCOM_0_SPI_CPOL +#define CONF_SERCOM_0_SPI_CPOL 0x0 +#endif + +// Clock Phase +// <0x0=>Sample input on leading edge +// <0x1=>Sample input on trailing edge +// Determines if input data is sampled on leading or trailing SCK edge. (CPHA) +// spi_master_arch_cpha +#ifndef CONF_SERCOM_0_SPI_CPHA +#define CONF_SERCOM_0_SPI_CPHA 0x0 +#endif + +// Immediate Buffer Overflow Notification +// Controls when OVF is asserted (IBON) +// <0x0=>In data stream +// <0x1=>On buffer overflow +// spi_master_arch_ibon +#ifndef CONF_SERCOM_0_SPI_IBON +#define CONF_SERCOM_0_SPI_IBON 0x0 +#endif + +// Run in stand-by +// Module stays active in stand-by sleep mode. (RUNSTDBY) +// spi_master_arch_runstdby +#ifndef CONF_SERCOM_0_SPI_RUNSTDBY +#define CONF_SERCOM_0_SPI_RUNSTDBY 0x0 +#endif + +// Debug Stop Mode +// Behavior of the baud-rate generator when CPU is halted by external debugger. (DBGSTOP) +// <0=>Keep running +// <1=>Halt +// spi_master_arch_dbgstop +#ifndef CONF_SERCOM_0_SPI_DBGSTOP +#define CONF_SERCOM_0_SPI_DBGSTOP 0 +#endif + +// + +// Address mode disabled in master mode +#ifndef CONF_SERCOM_0_SPI_AMODE_EN +#define CONF_SERCOM_0_SPI_AMODE_EN 0 +#endif + +#ifndef CONF_SERCOM_0_SPI_AMODE +#define CONF_SERCOM_0_SPI_AMODE 0 +#endif + +#ifndef CONF_SERCOM_0_SPI_ADDR +#define CONF_SERCOM_0_SPI_ADDR 0 +#endif + +#ifndef CONF_SERCOM_0_SPI_ADDRMASK +#define CONF_SERCOM_0_SPI_ADDRMASK 0 +#endif + +#ifndef CONF_SERCOM_0_SPI_SSDE +#define CONF_SERCOM_0_SPI_SSDE 0 +#endif + +#ifndef CONF_SERCOM_0_SPI_MSSEN +#define CONF_SERCOM_0_SPI_MSSEN 0x0 +#endif + +#ifndef CONF_SERCOM_0_SPI_PLOADEN +#define CONF_SERCOM_0_SPI_PLOADEN 0 +#endif + +// Receive Data Pinout +// <0x0=>PAD[0] +// <0x1=>PAD[1] +// <0x2=>PAD[2] +// <0x3=>PAD[3] +// spi_master_rxpo +#ifndef CONF_SERCOM_0_SPI_RXPO +#define CONF_SERCOM_0_SPI_RXPO 2 +#endif + +// Transmit Data Pinout +// <0x0=>PAD[0,1]_DO_SCK +// <0x1=>PAD[2,3]_DO_SCK +// <0x2=>PAD[3,1]_DO_SCK +// <0x3=>PAD[0,3]_DO_SCK +// spi_master_txpo +#ifndef CONF_SERCOM_0_SPI_TXPO +#define CONF_SERCOM_0_SPI_TXPO 0 +#endif + +// Calculate baud register value from requested baudrate value +#ifndef CONF_SERCOM_0_SPI_BAUD_RATE +#define CONF_SERCOM_0_SPI_BAUD_RATE ((float)CONF_GCLK_SERCOM0_CORE_FREQUENCY / (float)(2 * CONF_SERCOM_0_SPI_BAUD)) - 1 +#endif + +#include + +#ifndef SERCOM_I2CM_CTRLA_MODE_I2C_MASTER +#define SERCOM_I2CM_CTRLA_MODE_I2C_MASTER (5 << 2) +#endif + +#ifndef CONF_SERCOM_1_I2CM_ENABLE +#define CONF_SERCOM_1_I2CM_ENABLE 1 +#endif + +// Basic + +// I2C Bus clock speed (Hz) <1-400000> +// I2C Bus clock (SCL) speed measured in Hz +// i2c_master_baud_rate +#ifndef CONF_SERCOM_1_I2CM_BAUD +#define CONF_SERCOM_1_I2CM_BAUD 100000 +#endif + +// + +// Advanced +// i2c_master_advanced +#ifndef CONF_SERCOM_1_I2CM_ADVANCED_CONFIG +#define CONF_SERCOM_1_I2CM_ADVANCED_CONFIG 1 +#endif + +// TRise (ns) <0-300> +// Determined by the bus impedance, check electric characteristics in the datasheet +// Standard Fast Mode: typical 215ns, max 300ns +// Fast Mode +: typical 60ns, max 100ns +// High Speed Mode: typical 20ns, max 40ns +// i2c_master_arch_trise + +#ifndef CONF_SERCOM_1_I2CM_TRISE +#define CONF_SERCOM_1_I2CM_TRISE 215 +#endif + +// Master SCL Low Extended Time-Out (MEXTTOEN) +// This enables the master SCL low extend time-out +// i2c_master_arch_mexttoen +#ifndef CONF_SERCOM_1_I2CM_MEXTTOEN +#define CONF_SERCOM_1_I2CM_MEXTTOEN 0 +#endif + +// Slave SCL Low Extend Time-Out (SEXTTOEN) +// Enables the slave SCL low extend time-out. If SCL is cumulatively held low for greater than 25ms from the initial START to a STOP, the slave will release its clock hold if enabled and reset the internal state machine +// i2c_master_arch_sexttoen +#ifndef CONF_SERCOM_1_I2CM_SEXTTOEN +#define CONF_SERCOM_1_I2CM_SEXTTOEN 0 +#endif + +// SCL Low Time-Out (LOWTOUT) +// Enables SCL low time-out. If SCL is held low for 25ms-35ms, the master will release it's clock hold +// i2c_master_arch_lowtout +#ifndef CONF_SERCOM_1_I2CM_LOWTOUT +#define CONF_SERCOM_1_I2CM_LOWTOUT 0 +#endif + +// Inactive Time-Out (INACTOUT) +// <0x0=>Disabled +// <0x1=>5-6 SCL cycle time-out(50-60us) +// <0x2=>10-11 SCL cycle time-out(100-110us) +// <0x3=>20-21 SCL cycle time-out(200-210us) +// Defines if inactivity time-out should be enabled, and how long the time-out should be +// i2c_master_arch_inactout +#ifndef CONF_SERCOM_1_I2CM_INACTOUT +#define CONF_SERCOM_1_I2CM_INACTOUT 0x0 +#endif + +// SDA Hold Time (SDAHOLD) +// <0=>Disabled +// <1=>50-100ns hold time +// <2=>300-600ns hold time +// <3=>400-800ns hold time +// Defines the SDA hold time with respect to the negative edge of SCL +// i2c_master_arch_sdahold +#ifndef CONF_SERCOM_1_I2CM_SDAHOLD +#define CONF_SERCOM_1_I2CM_SDAHOLD 0x2 +#endif + +// Run in stand-by +// Determine if the module shall run in standby sleep mode +// i2c_master_arch_runstdby +#ifndef CONF_SERCOM_1_I2CM_RUNSTDBY +#define CONF_SERCOM_1_I2CM_RUNSTDBY 0 +#endif + +// Debug Stop Mode +// Behavior of the baud-rate generator when CPU is halted by external debugger. +// <0=>Keep running +// <1=>Halt +// i2c_master_arch_dbgstop +#ifndef CONF_SERCOM_1_I2CM_DEBUG_STOP_MODE +#define CONF_SERCOM_1_I2CM_DEBUG_STOP_MODE 0 +#endif + +// + +#ifndef CONF_SERCOM_1_I2CM_SPEED +#define CONF_SERCOM_1_I2CM_SPEED 0x00 // Speed: Standard/Fast mode +#endif +#if CONF_SERCOM_1_I2CM_TRISE < 215 || CONF_SERCOM_1_I2CM_TRISE > 300 +#warning Bad I2C Rise time for Standard/Fast mode, reset to 215ns +#undef CONF_SERCOM_1_I2CM_TRISE +#define CONF_SERCOM_1_I2CM_TRISE 215 +#endif + +// gclk_freq - (i2c_scl_freq * 10) - (gclk_freq * i2c_scl_freq * Trise) +// BAUD + BAUDLOW = -------------------------------------------------------------------- +// i2c_scl_freq +// BAUD: register value low [7:0] +// BAUDLOW: register value high [15:8], only used for odd BAUD + BAUDLOW +#define CONF_SERCOM_1_I2CM_BAUD_BAUDLOW \ + (((CONF_GCLK_SERCOM1_CORE_FREQUENCY - (CONF_SERCOM_1_I2CM_BAUD * 10) \ + - (CONF_SERCOM_1_I2CM_TRISE * (CONF_SERCOM_1_I2CM_BAUD / 100) * (CONF_GCLK_SERCOM1_CORE_FREQUENCY / 10000) \ + / 1000)) \ + * 10 \ + + 5) \ + / (CONF_SERCOM_1_I2CM_BAUD * 10)) +#ifndef CONF_SERCOM_1_I2CM_BAUD_RATE +#if CONF_SERCOM_1_I2CM_BAUD_BAUDLOW > (0xFF * 2) +#warning Requested I2C baudrate too low, please check +#define CONF_SERCOM_1_I2CM_BAUD_RATE 0xFF +#elif CONF_SERCOM_1_I2CM_BAUD_BAUDLOW <= 1 +#warning Requested I2C baudrate too high, please check +#define CONF_SERCOM_1_I2CM_BAUD_RATE 1 +#else +#define CONF_SERCOM_1_I2CM_BAUD_RATE \ + ((CONF_SERCOM_1_I2CM_BAUD_BAUDLOW & 0x1) \ + ? (CONF_SERCOM_1_I2CM_BAUD_BAUDLOW / 2) + ((CONF_SERCOM_1_I2CM_BAUD_BAUDLOW / 2 + 1) << 8) \ + : (CONF_SERCOM_1_I2CM_BAUD_BAUDLOW / 2)) +#endif +#endif + +#include + +#ifndef CONF_SERCOM_2_USART_ENABLE +#define CONF_SERCOM_2_USART_ENABLE 1 +#endif + +// Basic Configuration + +// Receive buffer enable +// Enable input buffer in SERCOM module +// usart_rx_enable +#ifndef CONF_SERCOM_2_USART_RXEN +#define CONF_SERCOM_2_USART_RXEN 1 +#endif + +// Transmitt buffer enable +// Enable output buffer in SERCOM module +// usart_tx_enable +#ifndef CONF_SERCOM_2_USART_TXEN +#define CONF_SERCOM_2_USART_TXEN 1 +#endif + +// Frame parity +// <0x0=>No parity +// <0x1=>Even parity +// <0x2=>Odd parity +// Parity bit mode for USART frame +// usart_parity +#ifndef CONF_SERCOM_2_USART_PARITY +#define CONF_SERCOM_2_USART_PARITY 0x0 +#endif + +// Character Size +// <0x0=>8 bits +// <0x1=>9 bits +// <0x5=>5 bits +// <0x6=>6 bits +// <0x7=>7 bits +// Data character size in USART frame +// usart_character_size +#ifndef CONF_SERCOM_2_USART_CHSIZE +#define CONF_SERCOM_2_USART_CHSIZE 0x0 +#endif + +// Stop Bit +// <0=>One stop bit +// <1=>Two stop bits +// Number of stop bits in USART frame +// usart_stop_bit +#ifndef CONF_SERCOM_2_USART_SBMODE +#define CONF_SERCOM_2_USART_SBMODE 0 +#endif + +// Baud rate <1-3000000> +// USART baud rate setting +// usart_baud_rate +#ifndef CONF_SERCOM_2_USART_BAUD +#define CONF_SERCOM_2_USART_BAUD 9600 +#endif + +// + +// Advanced configuration +// usart_advanced +#ifndef CONF_SERCOM_2_USART_ADVANCED_CONFIG +#define CONF_SERCOM_2_USART_ADVANCED_CONFIG 1 +#endif + +// Run in stand-by +// Keep the module running in standby sleep mode +// usart_arch_runstdby +#ifndef CONF_SERCOM_2_USART_RUNSTDBY +#define CONF_SERCOM_2_USART_RUNSTDBY 0 +#endif + +// Immediate Buffer Overflow Notification +// Controls when the BUFOVF status bit is asserted +// usart_arch_ibon +#ifndef CONF_SERCOM_2_USART_IBON +#define CONF_SERCOM_2_USART_IBON 0 +#endif + +// Start of Frame Detection Enable +// Will wake the device from any sleep mode if usart_init and usart_enable was run priort to going to sleep. (receive buffer must be enabled) +// usart_arch_sfde +#ifndef CONF_SERCOM_2_USART_SFDE +#define CONF_SERCOM_2_USART_SFDE 0 +#endif + +// Collision Detection Enable +// Collision detection enable +// usart_arch_cloden +#ifndef CONF_SERCOM_2_USART_CLODEN +#define CONF_SERCOM_2_USART_CLODEN 0 +#endif + +// Operating Mode +// <0x0=>USART with external clock +// <0x1=>USART with internal clock +// Drive the shift register by an internal clock generated by the baud rate generator or an external clock supplied on the XCK pin. +// usart_arch_clock_mode +#ifndef CONF_SERCOM_2_USART_MODE +#define CONF_SERCOM_2_USART_MODE 0x1 +#endif + +// Sample Rate +// <0x0=>16x arithmetic +// <0x1=>16x fractional +// <0x2=>8x arithmetic +// <0x3=>8x fractional +// <0x3=>3x +// How many over-sampling bits used when samling data state +// usart_arch_sampr +#ifndef CONF_SERCOM_2_USART_SAMPR +#define CONF_SERCOM_2_USART_SAMPR 0x0 +#endif + +// Sample Adjustment +// <0x0=>7-8-9 (3-4-5 8-bit over-sampling) +// <0x1=>9-10-11 (4-5-6 8-bit over-sampling) +// <0x2=>11-12-13 (5-6-7 8-bit over-sampling) +// <0x3=>13-14-15 (6-7-8 8-bit over-sampling) +// Adjust which samples to use for data sampling in asynchronous mode +// usart_arch_sampa +#ifndef CONF_SERCOM_2_USART_SAMPA +#define CONF_SERCOM_2_USART_SAMPA 0x0 +#endif + +// Fractional Part <0-7> +// Fractional part of the baud rate if baud rate generator is in fractional mode +// usart_arch_fractional +#ifndef CONF_SERCOM_2_USART_FRACTIONAL +#define CONF_SERCOM_2_USART_FRACTIONAL 0x0 +#endif + +// Data Order +// <0=>MSB is transmitted first +// <1=>LSB is transmitted first +// Data order of the data bits in the frame +// usart_arch_dord +#ifndef CONF_SERCOM_2_USART_DORD +#define CONF_SERCOM_2_USART_DORD 1 +#endif + +// Does not do anything in UART mode +#define CONF_SERCOM_2_USART_CPOL 0 + +// Encoding Format +// <0=>No encoding +// <1=>IrDA encoded +// usart_arch_enc +#ifndef CONF_SERCOM_2_USART_ENC +#define CONF_SERCOM_2_USART_ENC 0 +#endif + +// Debug Stop Mode +// Behavior of the baud-rate generator when CPU is halted by external debugger. +// <0=>Keep running +// <1=>Halt +// usart_arch_dbgstop +#ifndef CONF_SERCOM_2_USART_DEBUG_STOP_MODE +#define CONF_SERCOM_2_USART_DEBUG_STOP_MODE 0 +#endif + +// + +#ifndef CONF_SERCOM_2_USART_INACK +#define CONF_SERCOM_2_USART_INACK 0x0 +#endif + +#ifndef CONF_SERCOM_2_USART_DSNACK +#define CONF_SERCOM_2_USART_DSNACK 0x0 +#endif + +#ifndef CONF_SERCOM_2_USART_MAXITER +#define CONF_SERCOM_2_USART_MAXITER 0x7 +#endif + +#ifndef CONF_SERCOM_2_USART_GTIME +#define CONF_SERCOM_2_USART_GTIME 0x2 +#endif + +#define CONF_SERCOM_2_USART_RXINV 0x0 +#define CONF_SERCOM_2_USART_TXINV 0x0 + +#ifndef CONF_SERCOM_2_USART_CMODE +#define CONF_SERCOM_2_USART_CMODE 0 +#endif + +#ifndef CONF_SERCOM_2_USART_RXPO +#define CONF_SERCOM_2_USART_RXPO 1 /* RX is on PIN_PA08 */ +#endif + +#ifndef CONF_SERCOM_2_USART_TXPO +#define CONF_SERCOM_2_USART_TXPO 0 /* TX is on PIN_PA09 */ +#endif + +/* Set correct parity settings in register interface based on PARITY setting */ +#if CONF_SERCOM_2_USART_PARITY == 0 +#define CONF_SERCOM_2_USART_PMODE 0 +#define CONF_SERCOM_2_USART_FORM 0 +#else +#define CONF_SERCOM_2_USART_PMODE CONF_SERCOM_2_USART_PARITY - 1 +#define CONF_SERCOM_2_USART_FORM 1 +#endif + +// Calculate BAUD register value in UART mode +#if CONF_SERCOM_2_USART_SAMPR == 0 +#ifndef CONF_SERCOM_2_USART_BAUD_RATE +#define CONF_SERCOM_2_USART_BAUD_RATE \ + 65536 - ((65536 * 16.0f * CONF_SERCOM_2_USART_BAUD) / CONF_GCLK_SERCOM2_CORE_FREQUENCY) +#endif +#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH +#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0 +#endif +#elif CONF_SERCOM_2_USART_SAMPR == 1 +#ifndef CONF_SERCOM_2_USART_BAUD_RATE +#define CONF_SERCOM_2_USART_BAUD_RATE \ + ((CONF_GCLK_SERCOM2_CORE_FREQUENCY) / (CONF_SERCOM_2_USART_BAUD * 16)) - (CONF_SERCOM_2_USART_FRACTIONAL / 8) +#endif +#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH +#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0 +#endif +#elif CONF_SERCOM_2_USART_SAMPR == 2 +#ifndef CONF_SERCOM_2_USART_BAUD_RATE +#define CONF_SERCOM_2_USART_BAUD_RATE \ + 65536 - ((65536 * 8.0f * CONF_SERCOM_2_USART_BAUD) / CONF_GCLK_SERCOM2_CORE_FREQUENCY) +#endif +#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH +#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0 +#endif +#elif CONF_SERCOM_2_USART_SAMPR == 3 +#ifndef CONF_SERCOM_2_USART_BAUD_RATE +#define CONF_SERCOM_2_USART_BAUD_RATE \ + ((CONF_GCLK_SERCOM2_CORE_FREQUENCY) / (CONF_SERCOM_2_USART_BAUD * 8)) - (CONF_SERCOM_2_USART_FRACTIONAL / 8) +#endif +#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH +#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0 +#endif +#elif CONF_SERCOM_2_USART_SAMPR == 4 +#ifndef CONF_SERCOM_2_USART_BAUD_RATE +#define CONF_SERCOM_2_USART_BAUD_RATE \ + 65536 - ((65536 * 3.0f * CONF_SERCOM_2_USART_BAUD) / CONF_GCLK_SERCOM2_CORE_FREQUENCY) +#endif +#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH +#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0 +#endif +#endif + +#include + +// Enable configuration of module +#ifndef CONF_SERCOM_3_SPI_ENABLE +#define CONF_SERCOM_3_SPI_ENABLE 1 +#endif + +// SPI DMA TX Channel <0-32> +// This defines DMA channel to be used +// spi_master_dma_tx_channel +#ifndef CONF_SERCOM_3_SPI_M_DMA_TX_CHANNEL +#define CONF_SERCOM_3_SPI_M_DMA_TX_CHANNEL 0 +#endif + +// SPI RX Channel Enable +// spi_master_rx_channel +#ifndef CONF_SERCOM_3_SPI_RX_CHANNEL +#define CONF_SERCOM_3_SPI_RX_CHANNEL 1 +#endif + +// DMA Channel <0-32> +// This defines DMA channel to be used +// spi_master_dma_rx_channel +#ifndef CONF_SERCOM_3_SPI_M_DMA_RX_CHANNEL +#define CONF_SERCOM_3_SPI_M_DMA_RX_CHANNEL 1 +#endif + +// + +// Set module in SPI Master mode +#ifndef CONF_SERCOM_3_SPI_MODE +#define CONF_SERCOM_3_SPI_MODE 0x03 +#endif + +// Basic Configuration + +// Receive buffer enable +// Enable receive buffer to receive data from slave (RXEN) +// spi_master_rx_enable +#ifndef CONF_SERCOM_3_SPI_RXEN +#define CONF_SERCOM_3_SPI_RXEN 0x1 +#endif + +// Character Size +// Bit size for all characters sent over the SPI bus (CHSIZE) +// <0x0=>8 bits +// <0x1=>9 bits +// spi_master_character_size +#ifndef CONF_SERCOM_3_SPI_CHSIZE +#define CONF_SERCOM_3_SPI_CHSIZE 0x0 +#endif + +// Baud rate <1-12000000> +// The SPI data transfer rate +// spi_master_baud_rate +#ifndef CONF_SERCOM_3_SPI_BAUD +#define CONF_SERCOM_3_SPI_BAUD 50000 +#endif + +// + +// Advanced Configuration +// spi_master_advanced +#ifndef CONF_SERCOM_3_SPI_ADVANCED +#define CONF_SERCOM_3_SPI_ADVANCED 0 +#endif + +// Dummy byte <0x00-0x1ff> +// spi_master_dummybyte +// Dummy byte used when reading data from the slave without sending any data +#ifndef CONF_SERCOM_3_SPI_DUMMYBYTE +#define CONF_SERCOM_3_SPI_DUMMYBYTE 0x1ff +#endif + +// Data Order +// <0=>MSB first +// <1=>LSB first +// I least significant or most significant bit is shifted out first (DORD) +// spi_master_arch_dord +#ifndef CONF_SERCOM_3_SPI_DORD +#define CONF_SERCOM_3_SPI_DORD 0x0 +#endif + +// Clock Polarity +// <0=>SCK is low when idle +// <1=>SCK is high when idle +// Determines if the leading edge is rising or falling with a corresponding opposite edge at the trailing edge. (CPOL) +// spi_master_arch_cpol +#ifndef CONF_SERCOM_3_SPI_CPOL +#define CONF_SERCOM_3_SPI_CPOL 0x0 +#endif + +// Clock Phase +// <0x0=>Sample input on leading edge +// <0x1=>Sample input on trailing edge +// Determines if input data is sampled on leading or trailing SCK edge. (CPHA) +// spi_master_arch_cpha +#ifndef CONF_SERCOM_3_SPI_CPHA +#define CONF_SERCOM_3_SPI_CPHA 0x0 +#endif + +// Immediate Buffer Overflow Notification +// Controls when OVF is asserted (IBON) +// <0x0=>In data stream +// <0x1=>On buffer overflow +// spi_master_arch_ibon +#ifndef CONF_SERCOM_3_SPI_IBON +#define CONF_SERCOM_3_SPI_IBON 0x0 +#endif + +// Run in stand-by +// Module stays active in stand-by sleep mode. (RUNSTDBY) +// spi_master_arch_runstdby +#ifndef CONF_SERCOM_3_SPI_RUNSTDBY +#define CONF_SERCOM_3_SPI_RUNSTDBY 0x0 +#endif + +// Debug Stop Mode +// Behavior of the baud-rate generator when CPU is halted by external debugger. (DBGSTOP) +// <0=>Keep running +// <1=>Halt +// spi_master_arch_dbgstop +#ifndef CONF_SERCOM_3_SPI_DBGSTOP +#define CONF_SERCOM_3_SPI_DBGSTOP 0 +#endif + +// + +// Address mode disabled in master mode +#ifndef CONF_SERCOM_3_SPI_AMODE_EN +#define CONF_SERCOM_3_SPI_AMODE_EN 0 +#endif + +#ifndef CONF_SERCOM_3_SPI_AMODE +#define CONF_SERCOM_3_SPI_AMODE 0 +#endif + +#ifndef CONF_SERCOM_3_SPI_ADDR +#define CONF_SERCOM_3_SPI_ADDR 0 +#endif + +#ifndef CONF_SERCOM_3_SPI_ADDRMASK +#define CONF_SERCOM_3_SPI_ADDRMASK 0 +#endif + +#ifndef CONF_SERCOM_3_SPI_SSDE +#define CONF_SERCOM_3_SPI_SSDE 0 +#endif + +#ifndef CONF_SERCOM_3_SPI_MSSEN +#define CONF_SERCOM_3_SPI_MSSEN 0x0 +#endif + +#ifndef CONF_SERCOM_3_SPI_PLOADEN +#define CONF_SERCOM_3_SPI_PLOADEN 0 +#endif + +// Receive Data Pinout +// <0x0=>PAD[0] +// <0x1=>PAD[1] +// <0x2=>PAD[2] +// <0x3=>PAD[3] +// spi_master_rxpo +#ifndef CONF_SERCOM_3_SPI_RXPO +#define CONF_SERCOM_3_SPI_RXPO 2 +#endif + +// Transmit Data Pinout +// <0x0=>PAD[0,1]_DO_SCK +// <0x1=>PAD[2,3]_DO_SCK +// <0x2=>PAD[3,1]_DO_SCK +// <0x3=>PAD[0,3]_DO_SCK +// spi_master_txpo +#ifndef CONF_SERCOM_3_SPI_TXPO +#define CONF_SERCOM_3_SPI_TXPO 0 +#endif + +// Calculate baud register value from requested baudrate value +#ifndef CONF_SERCOM_3_SPI_BAUD_RATE +#define CONF_SERCOM_3_SPI_BAUD_RATE ((float)CONF_GCLK_SERCOM3_CORE_FREQUENCY / (float)(2 * CONF_SERCOM_3_SPI_BAUD)) - 1 +#endif + +// <<< end of configuration section >>> + +#endif // HPL_SERCOM_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_systick_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_systick_config.h new file mode 100644 index 0000000000..a7f2f36208 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_systick_config.h @@ -0,0 +1,18 @@ +/* Auto-generated config file hpl_systick_config.h */ +#ifndef HPL_SYSTICK_CONFIG_H +#define HPL_SYSTICK_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Advanced settings +// SysTick exception request +// Indicates whether the generation of SysTick exception is enabled or not +// systick_arch_tickint +#ifndef CONF_SYSTICK_TICKINT +#define CONF_SYSTICK_TICKINT 0 +#endif +// + +// <<< end of configuration section >>> + +#endif // HPL_SYSTICK_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_tc_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_tc_config.h new file mode 100644 index 0000000000..38d48e9b67 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_tc_config.h @@ -0,0 +1,209 @@ +/* Auto-generated config file hpl_tc_config.h */ +#ifndef HPL_TC_CONFIG_H +#define HPL_TC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +#include + +#ifndef CONF_TC0_ENABLE +#define CONF_TC0_ENABLE 1 +#endif + +// Basic settings +// Prescaler +// <0=> No division +// <1=> Divide by 2 +// <2=> Divide by 4 +// <3=> Divide by 8 +// <4=> Divide by 16 +// <5=> Divide by 64 +// <6=> Divide by 256 +// <7=> Divide by 1024 +// This defines the prescaler value +// tc_prescaler +#ifndef CONF_TC0_PRESCALER +#define CONF_TC0_PRESCALER 0 +#endif +// + +// PWM Waveform Output settings +// Waveform Period Value (uS) <0x00-0xFFFFFFFF> +// The unit of this value is us. +// tc_arch_wave_per_val +#ifndef CONF_TC0_WAVE_PER_VAL +#define CONF_TC0_WAVE_PER_VAL 0x3e8 +#endif + +// Waveform Duty Value (0.1%) <0x00-0x03E8> +// The unit of this value is 1/1000. +// tc_arch_wave_duty_val +#ifndef CONF_TC0_WAVE_DUTY_VAL +#define CONF_TC0_WAVE_DUTY_VAL 0x1f4 +#endif + +/* Caculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ +#if CONF_TC0_PRESCALER < TC_CTRLA_PRESCALER_DIV64_Val +#define CONF_TC0_CC0 \ + ((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 1000000 / (1 << CONF_TC0_PRESCALER) - 1)) +#define CONF_TC0_CC1 ((CONF_TC0_CC0 * CONF_TC0_WAVE_DUTY_VAL) / 1000) + +#elif CONF_TC0_PRESCALER == TC_CTRLA_PRESCALER_DIV64_Val +#define CONF_TC0_CC0 ((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 64000000 - 1)) +#define CONF_TC0_CC1 ((CONF_TC0_CC0 * CONF_TC0_WAVE_DUTY_VAL) / 1000) + +#elif CONF_TC0_PRESCALER == TC_CTRLA_PRESCALER_DIV256_Val +#define CONF_TC0_CC0 ((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 256000000 - 1)) +#define CONF_TC0_CC1 ((CONF_TC0_CC0 * CONF_TC0_WAVE_DUTY_VAL) / 1000) + +#elif CONF_TC0_PRESCALER == TC_CTRLA_PRESCALER_DIV1024_Val +#define CONF_TC0_CC0 ((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 1024000000 - 1)) +#define CONF_TC0_CC1 ((CONF_TC0_CC0 * CONF_TC0_WAVE_DUTY_VAL) / 1000) +#endif + +// + +// Advanced settings +// Mode +// Counter in 16-bit mode +// Counter in 32-bit mode +// These bits mode +// tc_mode +#ifndef CONF_TC0_MODE +#define CONF_TC0_MODE TC_CTRLA_MODE_COUNT16_Val +#endif + +// Period Value <0x00000000-0xFFFFFFFF> +// tc_per +#ifndef CONF_TC0_PER +#define CONF_TC0_PER 0x32 +#endif +// + +// Advanced settings +// Prescaler and Counter Synchronization Selection +// Reload or reset counter on next GCLK +// Reload or reset counter on next prescaler clock +// Reload or reset counter on next GCLK and reset prescaler counter +// These bits select if on retrigger event, the Counter should be cleared or reloaded on the next GCLK_TCx clock or on the next prescaled GCLK_TCx clock. +// tc_arch_presync +#ifndef CONF_TC0_PRESCSYNC +#define CONF_TC0_PRESCSYNC TC_CTRLA_PRESCSYNC_GCLK_Val +#endif + +// Run in standby +// Indicates whether the will continue running in standby sleep mode or not +// tc_arch_runstdby +#ifndef CONF_TC0_RUNSTDBY +#define CONF_TC0_RUNSTDBY 0 +#endif + +// On-Demand +// Indicates whether the TC0's on-demand mode is on or not +// tc_arch_ondemand +#ifndef CONF_TC0_ONDEMAND +#define CONF_TC0_ONDEMAND 0 +#endif + +// Auto Lock +// <0x0=>The Lock Update bit is not affected on overflow/underflow and re-trigger event +// <0x1=>The Lock Update bit is set on each overflow/underflow or re-trigger event +// tc_arch_alock +#ifndef CONF_TC0_ALOCK +#define CONF_TC0_ALOCK 0 +#endif + +/* Commented intentionally. Timer uses fixed value. May be used by other abstractions based on TC. */ +//#define CONF_TC0_CAPTEN0 0 +//#define CONF_TC0_CAPTEN1 0 +//#define CONF_TC0_COPEN0 0 +//#define CONF_TC0_COPEN1 0 + +/* Commented intentionally. Timer uses fixed value. May be used by other abstractions based on TC. */ +//#define CONF_TC0_DIR 0 +//#define CONF_TC0_ONESHOT 0 +//#define CONF_TC0_LUPD 0 + +// Debug Running Mode +// Indicates whether the Debug Running Mode is enabled or not +// tc_arch_dbgrun +#ifndef CONF_TC0_DBGRUN +#define CONF_TC0_DBGRUN 0 +#endif + +// Event control +// timer_event_control +#ifndef CONF_TC0_EVENT_CONTROL_ENABLE +#define CONF_TC0_EVENT_CONTROL_ENABLE 0 +#endif + +// Output Event On Match or Capture on Channel 0 +// Enable output of event on timer tick +// tc_arch_mceo0 +#ifndef CONF_TC0_MCEO0 +#define CONF_TC0_MCEO0 0 +#endif + +// Output Event On Match or Capture on Channel 1 +// Enable output of event on timer tick +// tc_arch_mceo1 +#ifndef CONF_TC0_MCEO1 +#define CONF_TC0_MCEO1 0 +#endif + +// Output Event On Timer Tick +// Enable output of event on timer tick +// tc_arch_ovfeo +#ifndef CONF_TC0_OVFEO +#define CONF_TC0_OVFEO 0 +#endif + +// Event Input +// Enable asynchronous input events +// tc_arch_tcei +#ifndef CONF_TC0_TCEI +#define CONF_TC0_TCEI 0 +#endif + +// Inverted Event Input +// Invert the asynchronous input events +// tc_arch_tcinv +#ifndef CONF_TC0_TCINV +#define CONF_TC0_TCINV 0 +#endif + +// Event action +// <0=> Event action disabled +// <1=> Start, restart or re-trigger TC on event +// <2=> Count on event +// <3=> Start on event +// <4=> Time stamp capture +// <5=> Period captured in CC0, pulse width in CC1 +// <6=> Period captured in CC1, pulse width in CC0 +// <7=> Pulse width capture +// Event which will be performed on an event +// tc_arch_evact +#ifndef CONF_TC0_EVACT +#define CONF_TC0_EVACT 0 +#endif +// + +/* Commented intentionally. Timer uses fixed value. May be used by other abstractions based on TC. */ +//#define CONF_TC0_WAVEGEN TC_CTRLA_WAVEGEN_MFRQ_Val + +/* Commented intentionally. Timer uses fixed value. May be used by other abstractions based on TC. */ +//#define CONF_TC0_INVEN0 0 +//#define CONF_TC0_INVEN1 0 + +/* Commented intentionally. Timer uses fixed value. May be used by other abstractions based on TC. */ +//#define CONF_TC0_PERBUF 0 + +/* Commented intentionally. Timer uses fixed value. May be used by other abstractions based on TC. */ +//#define CONF_TC0_CCBUF0 0 +//#define CONF_TC0_CCBUF1 0 + +// + +// <<< end of configuration section >>> + +#endif // HPL_TC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_trng_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_trng_config.h new file mode 100644 index 0000000000..ba9014989a --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_trng_config.h @@ -0,0 +1,27 @@ +/* Auto-generated config file hpl_trng_config.h */ +#ifndef HPL_TRNG_CONFIG_H +#define HPL_TRNG_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Advanced configurations + +// Run In Standby +// Indicates whether the TRNG works in standby mode +// trng_runstdby +#ifndef CONF_TRNG_RUNSTDBY +#define CONF_TRNG_RUNSTDBY 0 +#endif + +// Data Ready Event Output Enable +// Indicates whether the TRNG generates event on Data Ready +// trng_datardyeo +#ifndef CONF_TRNG_DATARDYEO +#define CONF_TRNG_DATARDYEO 0 +#endif + +// + +// <<< end of configuration section >>> + +#endif // HPL_TRNG_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_usb_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_usb_config.h new file mode 100644 index 0000000000..d1bb42fe45 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_usb_config.h @@ -0,0 +1,413 @@ +/* Auto-generated config file hpl_usb_config.h */ +#ifndef HPL_USB_CONFIG_H +#define HPL_USB_CONFIG_H + +// CIRCUITPY: + +// Use 64-byte USB buffers for endpoint directions that are in use. They're set to 0 below otherwise. + +#include "genhdr/autogen_usb_descriptor.h" + +#if defined(USB_ENDPOINT_1_OUT_USED) && USB_ENDPOINT_1_OUT_USED +#define CONF_USB_EP1_CACHE 64 +#endif +#if defined(USB_ENDPOINT_1_IN_USED) && USB_ENDPOINT_1_IN_USED +#define CONF_USB_EP1_I_CACHE 64 +#endif + +#if defined(USB_ENDPOINT_2_OUT_USED) && USB_ENDPOINT_2_OUT_USED +#define CONF_USB_EP2_CACHE 64 +#endif +#if defined(USB_ENDPOINT_2_IN_USED) && USB_ENDPOINT_2_IN_USED +#define CONF_USB_EP2_I_CACHE 64 +#endif + +#if defined(USB_ENDPOINT_3_OUT_USED) && USB_ENDPOINT_3_OUT_USED +#define CONF_USB_EP3_CACHE 64 +#endif +#if defined(USB_ENDPOINT_3_IN_USED) && USB_ENDPOINT_3_IN_USED +#define CONF_USB_EP3_I_CACHE 64 +#endif + +#if defined(USB_ENDPOINT_4_OUT_USED) && USB_ENDPOINT_4_OUT_USED +#define CONF_USB_EP4_CACHE 64 +#endif +#if defined(USB_ENDPOINT_4_IN_USED) && USB_ENDPOINT_4_IN_USED +#define CONF_USB_EP4_I_CACHE 64 +#endif + +#if defined(USB_ENDPOINT_5_OUT_USED) && USB_ENDPOINT_5_OUT_USED +#define CONF_USB_EP5_CACHE 64 +#endif +#if defined(USB_ENDPOINT_5_IN_USED) && USB_ENDPOINT_5_IN_USED +#define CONF_USB_EP5_I_CACHE 64 +#endif + +#if defined(USB_ENDPOINT_6_OUT_USED) && USB_ENDPOINT_6_OUT_USED +#define CONF_USB_EP6_CACHE 64 +#endif +#if defined(USB_ENDPOINT_6_IN_USED) && USB_ENDPOINT_6_IN_USED +#define CONF_USB_EP6_I_CACHE 64 +#endif + +#if defined(USB_ENDPOINT_7_OUT_USED) && USB_ENDPOINT_7_OUT_USED +#define CONF_USB_EP7_CACHE 64 +#endif +#if defined(USB_ENDPOINT_7_IN_USED) && USB_ENDPOINT_7_IN_USED +#define CONF_USB_EP7_I_CACHE 64 +#endif + + +// <<< Use Configuration Wizard in Context Menu >>> + +#define CONF_USB_N_0 0 +#define CONF_USB_N_1 1 +#define CONF_USB_N_2 2 +#define CONF_USB_N_3 3 +#define CONF_USB_N_4 4 +#define CONF_USB_N_5 5 +#define CONF_USB_N_6 6 +#define CONF_USB_N_7 7 +#define CONF_USB_N_8 8 +#define CONF_USB_N_9 9 +#define CONF_USB_N_10 10 +#define CONF_USB_N_11 11 +#define CONF_USB_N_12 12 +#define CONF_USB_N_13 13 +#define CONF_USB_N_14 14 +#define CONF_USB_N_15 15 + +#define CONF_USB_D_EP_N_MAX (USB_EPT_NUM - 1) +#define CONF_USB_D_N_EP_MAX (CONF_USB_D_EP_N_MAX * 2 - 1) + +// USB Device HAL Configuration + +// Max number of endpoints supported +// Limits the number of endpoints (described by EP address) can be used in app. +// NOTE(tannewt): This not only limits the number of endpoints but also the +// addresses. In other words, even if you use endpoint 6 you need to set this to 11. +// 1 (EP0 only) +// 2 (EP0 + 1 endpoint) +// 3 (EP0 + 2 endpoints) +// 4 (EP0 + 3 endpoints) +// 5 (EP0 + 4 endpoints) +// 6 (EP0 + 5 endpoints) +// 7 (EP0 + 6 endpoints) +// 8 (EP0 + 7 endpoints) +// Max possible (by "Max Endpoint Number" config) +// usbd_num_ep_sp +#ifndef CONF_USB_D_NUM_EP_SP +#define CONF_USB_D_NUM_EP_SP CONF_USB_D_N_EP_MAX +#endif + +// + +// Max Endpoint Number supported +// Limits the max endpoint number. +// USB endpoint address is constructed by direction and endpoint number. Bit 8 of address set indicates the direction is IN. E.g., EP0x81 and EP0x01 have the same endpoint number, 1. +// Reduce the value according to specific device design, to cut-off memory usage. +// 0 (only EP0) +// 1 (EP 0x81 or 0x01) +// 2 (EP 0x82 or 0x02) +// 3 (EP 0x83 or 0x03) +// 4 (EP 0x84 or 0x04) +// 5 (EP 0x85 or 0x05) +// 6 (EP 0x86 or 0x06) +// 7 (EP 0x87 or 0x07) +// Max possible (by HW) +// The number of physical endpoints - 1 +// usbd_arch_max_ep_n +#ifndef CONF_USB_D_MAX_EP_N +#define CONF_USB_D_MAX_EP_N CONF_USB_D_EP_N_MAX +#endif + +// USB Speed Limit +// Limits the working speed of the device. +// Full speed +// Low Speed +// usbd_arch_speed +#ifndef CONF_USB_D_SPEED +#define CONF_USB_D_SPEED USB_SPEED_FS +#endif + +// Cache buffer size for EP0 +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// EP0 is default control endpoint, so cache must be used to be able to receive SETUP packet at any time. +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// usb_arch_ep0_cache +#ifndef CONF_USB_EP0_CACHE +#define CONF_USB_EP0_CACHE 64 +#endif + +// Cache configuration EP1 +// Cache buffer size for EP1 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep1_cache +#ifndef CONF_USB_EP1_CACHE +#define CONF_USB_EP1_CACHE 0 +#endif + +// Cache buffer size for EP1 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep1_I_CACHE +#ifndef CONF_USB_EP1_I_CACHE +#define CONF_USB_EP1_I_CACHE 0 +#endif +// + +// Cache configuration EP2 +// Cache buffer size for EP2 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep2_cache +#ifndef CONF_USB_EP2_CACHE +#define CONF_USB_EP2_CACHE 0 +#endif + +// Cache buffer size for EP2 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep2_I_CACHE +#ifndef CONF_USB_EP2_I_CACHE +#define CONF_USB_EP2_I_CACHE 0 +#endif +// + +// Cache configuration EP3 +// Cache buffer size for EP3 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep3_cache +#ifndef CONF_USB_EP3_CACHE +#define CONF_USB_EP3_CACHE 0 +#endif + +// Cache buffer size for EP3 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep3_I_CACHE +#ifndef CONF_USB_EP3_I_CACHE +#define CONF_USB_EP3_I_CACHE 0 +#endif +// + +// Cache configuration EP4 +// Cache buffer size for EP4 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep4_cache +#ifndef CONF_USB_EP4_CACHE +#define CONF_USB_EP4_CACHE 0 +#endif + +// Cache buffer size for EP4 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep4_I_CACHE +#ifndef CONF_USB_EP4_I_CACHE +#define CONF_USB_EP4_I_CACHE 0 +#endif +// + +// Cache configuration EP5 +// Cache buffer size for EP5 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep5_cache +#ifndef CONF_USB_EP5_CACHE +#define CONF_USB_EP5_CACHE 0 +#endif + +// Cache buffer size for EP5 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep5_I_CACHE +#ifndef CONF_USB_EP5_I_CACHE +#define CONF_USB_EP5_I_CACHE 0 +#endif +// + +// Cache configuration EP6 +// Cache buffer size for EP6 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep6_cache +#ifndef CONF_USB_EP6_CACHE +#define CONF_USB_EP6_CACHE 0 +#endif + +// Cache buffer size for EP6 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep6_I_CACHE +#ifndef CONF_USB_EP6_I_CACHE +#define CONF_USB_EP6_I_CACHE 0 +#endif +// + +// Cache configuration EP7 +// Cache buffer size for EP7 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep7_cache +#ifndef CONF_USB_EP7_CACHE +#define CONF_USB_EP7_CACHE 0 +#endif + +// Cache buffer size for EP7 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep7_I_CACHE +#ifndef CONF_USB_EP7_I_CACHE +#define CONF_USB_EP7_I_CACHE 0 +#endif +// + +// <<< end of configuration section >>> + +#endif // HPL_USB_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h b/ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h new file mode 100644 index 0000000000..030a90a7a9 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h @@ -0,0 +1,1006 @@ +/* Auto-generated config file peripheral_clk_config.h */ +#ifndef PERIPHERAL_CLK_CONFIG_H +#define PERIPHERAL_CLK_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// ADC Clock Source +// adc_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for ADC. +#ifndef CONF_GCLK_ADC0_SRC +#define CONF_GCLK_ADC0_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_ADC0_FREQUENCY + * \brief ADC0's Clock frequency + */ +#ifndef CONF_GCLK_ADC0_FREQUENCY +#define CONF_GCLK_ADC0_FREQUENCY 48000000 +#endif + +// DAC Clock Source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// dac_gclk_selection +// Select the clock source for DAC. +#ifndef CONF_GCLK_DAC_SRC +#define CONF_GCLK_DAC_SRC GCLK_PCHCTRL_GEN_GCLK6_Val +#endif + +/** + * \def CONF_GCLK_DAC_FREQUENCY + * \brief DAC's Clock frequency + */ +#ifndef CONF_GCLK_DAC_FREQUENCY +#define CONF_GCLK_DAC_FREQUENCY 2000000 +#endif + +// EVSYS Channel 0 Clock Source +// evsys_clk_selection_0 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 0. +#ifndef CONF_GCLK_EVSYS_CHANNEL_0_SRC +#define CONF_GCLK_EVSYS_CHANNEL_0_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_0_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_0_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_0_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 1 Clock Source +// evsys_clk_selection_1 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 1. +#ifndef CONF_GCLK_EVSYS_CHANNEL_1_SRC +#define CONF_GCLK_EVSYS_CHANNEL_1_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_1_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_1_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_1_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 2 Clock Source +// evsys_clk_selection_2 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 2. +#ifndef CONF_GCLK_EVSYS_CHANNEL_2_SRC +#define CONF_GCLK_EVSYS_CHANNEL_2_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_2_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_2_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_2_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 3 Clock Source +// evsys_clk_selection_3 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 3. +#ifndef CONF_GCLK_EVSYS_CHANNEL_3_SRC +#define CONF_GCLK_EVSYS_CHANNEL_3_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_3_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_3_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_3_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 4 Clock Source +// evsys_clk_selection_4 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 4. +#ifndef CONF_GCLK_EVSYS_CHANNEL_4_SRC +#define CONF_GCLK_EVSYS_CHANNEL_4_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_4_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_4_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_4_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 5 Clock Source +// evsys_clk_selection_5 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 5. +#ifndef CONF_GCLK_EVSYS_CHANNEL_5_SRC +#define CONF_GCLK_EVSYS_CHANNEL_5_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_5_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_5_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_5_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 6 Clock Source +// evsys_clk_selection_6 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 6. +#ifndef CONF_GCLK_EVSYS_CHANNEL_6_SRC +#define CONF_GCLK_EVSYS_CHANNEL_6_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_6_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_6_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_6_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 7 Clock Source +// evsys_clk_selection_7 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 7. +#ifndef CONF_GCLK_EVSYS_CHANNEL_7_SRC +#define CONF_GCLK_EVSYS_CHANNEL_7_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_7_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_7_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_7_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 8 Clock Source +// evsys_clk_selection_8 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 8. +#ifndef CONF_GCLK_EVSYS_CHANNEL_8_SRC +#define CONF_GCLK_EVSYS_CHANNEL_8_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_8_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_8_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_8_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 9 Clock Source +// evsys_clk_selection_9 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 9. +#ifndef CONF_GCLK_EVSYS_CHANNEL_9_SRC +#define CONF_GCLK_EVSYS_CHANNEL_9_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_9_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_9_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_9_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 10 Clock Source +// evsys_clk_selection_10 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 10. +#ifndef CONF_GCLK_EVSYS_CHANNEL_10_SRC +#define CONF_GCLK_EVSYS_CHANNEL_10_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_10_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_10_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_10_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 11 Clock Source +// evsys_clk_selection_11 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 11. +#ifndef CONF_GCLK_EVSYS_CHANNEL_11_SRC +#define CONF_GCLK_EVSYS_CHANNEL_11_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_11_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_11_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_11_FREQUENCY 48000000.0 +#endif + +/** + * \def CONF_CPU_FREQUENCY + * \brief CPU's Clock frequency + */ +#ifndef CONF_CPU_FREQUENCY +#define CONF_CPU_FREQUENCY 120000000 +#endif + +// RTC Clock Source +// rtc_clk_selection +// RTC source +// Select the clock source for RTC. +#ifndef CONF_GCLK_RTC_SRC +#define CONF_GCLK_RTC_SRC RTC_CLOCK_SOURCE +#endif + +/** + * \def CONF_GCLK_RTC_FREQUENCY + * \brief RTC's Clock frequency + */ +#ifndef CONF_GCLK_RTC_FREQUENCY +#define CONF_GCLK_RTC_FREQUENCY 1024 +#endif + +// Core Clock Source +// core_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for CORE. +#ifndef CONF_GCLK_SERCOM0_CORE_SRC +#define CONF_GCLK_SERCOM0_CORE_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +// Slow Clock Source +// slow_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the slow clock source. +#ifndef CONF_GCLK_SERCOM0_SLOW_SRC +#define CONF_GCLK_SERCOM0_SLOW_SRC GCLK_PCHCTRL_GEN_GCLK3_Val +#endif + +/** + * \def CONF_GCLK_SERCOM0_CORE_FREQUENCY + * \brief SERCOM0's Core Clock frequency + */ +#ifndef CONF_GCLK_SERCOM0_CORE_FREQUENCY +#define CONF_GCLK_SERCOM0_CORE_FREQUENCY 48000000 +#endif + +/** + * \def CONF_GCLK_SERCOM0_SLOW_FREQUENCY + * \brief SERCOM0's Slow Clock frequency + */ +#ifndef CONF_GCLK_SERCOM0_SLOW_FREQUENCY +#define CONF_GCLK_SERCOM0_SLOW_FREQUENCY 32768 +#endif + +// Core Clock Source +// core_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for CORE. +#ifndef CONF_GCLK_SERCOM1_CORE_SRC +#define CONF_GCLK_SERCOM1_CORE_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +// Slow Clock Source +// slow_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the slow clock source. +#ifndef CONF_GCLK_SERCOM1_SLOW_SRC +#define CONF_GCLK_SERCOM1_SLOW_SRC GCLK_PCHCTRL_GEN_GCLK3_Val +#endif + +/** + * \def CONF_GCLK_SERCOM1_CORE_FREQUENCY + * \brief SERCOM1's Core Clock frequency + */ +#ifndef CONF_GCLK_SERCOM1_CORE_FREQUENCY +#define CONF_GCLK_SERCOM1_CORE_FREQUENCY 48000000 +#endif + +/** + * \def CONF_GCLK_SERCOM1_SLOW_FREQUENCY + * \brief SERCOM1's Slow Clock frequency + */ +#ifndef CONF_GCLK_SERCOM1_SLOW_FREQUENCY +#define CONF_GCLK_SERCOM1_SLOW_FREQUENCY 32768 +#endif + +// Core Clock Source +// core_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for CORE. +#ifndef CONF_GCLK_SERCOM2_CORE_SRC +#define CONF_GCLK_SERCOM2_CORE_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +// Slow Clock Source +// slow_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the slow clock source. +#ifndef CONF_GCLK_SERCOM2_SLOW_SRC +#define CONF_GCLK_SERCOM2_SLOW_SRC GCLK_PCHCTRL_GEN_GCLK3_Val +#endif + +/** + * \def CONF_GCLK_SERCOM2_CORE_FREQUENCY + * \brief SERCOM2's Core Clock frequency + */ +#ifndef CONF_GCLK_SERCOM2_CORE_FREQUENCY +#define CONF_GCLK_SERCOM2_CORE_FREQUENCY 48000000 +#endif + +/** + * \def CONF_GCLK_SERCOM2_SLOW_FREQUENCY + * \brief SERCOM2's Slow Clock frequency + */ +#ifndef CONF_GCLK_SERCOM2_SLOW_FREQUENCY +#define CONF_GCLK_SERCOM2_SLOW_FREQUENCY 32768 +#endif + +// Core Clock Source +// core_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for CORE. +#ifndef CONF_GCLK_SERCOM3_CORE_SRC +#define CONF_GCLK_SERCOM3_CORE_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +// Slow Clock Source +// slow_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the slow clock source. +#ifndef CONF_GCLK_SERCOM3_SLOW_SRC +#define CONF_GCLK_SERCOM3_SLOW_SRC GCLK_PCHCTRL_GEN_GCLK3_Val +#endif + +/** + * \def CONF_GCLK_SERCOM3_CORE_FREQUENCY + * \brief SERCOM3's Core Clock frequency + */ +#ifndef CONF_GCLK_SERCOM3_CORE_FREQUENCY +#define CONF_GCLK_SERCOM3_CORE_FREQUENCY 48000000 +#endif + +/** + * \def CONF_GCLK_SERCOM3_SLOW_FREQUENCY + * \brief SERCOM3's Slow Clock frequency + */ +#ifndef CONF_GCLK_SERCOM3_SLOW_FREQUENCY +#define CONF_GCLK_SERCOM3_SLOW_FREQUENCY 32768 +#endif + +// TC Clock Source +// tc_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for TC. +#ifndef CONF_GCLK_TC0_SRC +#define CONF_GCLK_TC0_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_TC0_FREQUENCY + * \brief TC0's Clock frequency + */ +#ifndef CONF_GCLK_TC0_FREQUENCY +#define CONF_GCLK_TC0_FREQUENCY 48000000 +#endif + +// USB Clock Source +// usb_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for USB. +#ifndef CONF_GCLK_USB_SRC +#define CONF_GCLK_USB_SRC GCLK_PCHCTRL_GEN_GCLK1_Val + +#endif + +/** + * \def CONF_GCLK_USB_FREQUENCY + * \brief USB's Clock frequency + */ +#ifndef CONF_GCLK_USB_FREQUENCY +#define CONF_GCLK_USB_FREQUENCY 48000000 +#endif + +// <<< end of configuration section >>> + +#endif // PERIPHERAL_CLK_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/usbd_config.h b/ports/atmel-samd/asf4_conf/same54/usbd_config.h new file mode 100644 index 0000000000..be1fa3c9e0 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/usbd_config.h @@ -0,0 +1,850 @@ +/* Auto-generated config file usbd_config.h */ +#ifndef USBD_CONFIG_H +#define USBD_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// ---- USB Device Stack Core Options ---- + +// High Speed Support +// Enable high speed specific descriptors support, e.g., DeviceQualifierDescriptor and OtherSpeedConfiguration Descriptor. +// High speed support require descriptors description array on start, for LS/FS and HS support in first and second place. +// usbd_hs_sp +#ifndef CONF_USBD_HS_SP +#define CONF_USBD_HS_SP 0 +#endif + +// ---- USB Device Stack Composite Options ---- + +// Enable String Descriptors +// usb_composite_str_en +#ifndef CONF_USB_COMPOSITE_STR_EN +#define CONF_USB_COMPOSITE_STR_EN 0 +#endif +// Language IDs +// Language IDs in c format, split by comma (E.g., 0x0409 ...) +// usb_composite_langid +#ifndef CONF_USB_COMPOSITE_LANGID +#define CONF_USB_COMPOSITE_LANGID "0x0409" +#endif + +#ifndef CONF_USB_COMPOSITE_LANGID_DESC +#define CONF_USB_COMPOSITE_LANGID_DESC +#endif +// + +// Composite Device Descriptor + +// bcdUSB +// <0x0200=> USB 2.0 version +// <0x0210=> USB 2.1 version +// usb_composite_bcdusb +#ifndef CONF_USB_COMPOSITE_BCDUSB +#define CONF_USB_COMPOSITE_BCDUSB 0x200 +#endif + +// bMaxPackeSize0 +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes +// usb_composite_bmaxpksz0 +#ifndef CONF_USB_COMPOSITE_BMAXPKSZ0 +#define CONF_USB_COMPOSITE_BMAXPKSZ0 0x40 +#endif + +// idVender <0x0000-0xFFFF> +// usb_composite_idvender +#ifndef CONF_USB_COMPOSITE_IDVENDER +#define CONF_USB_COMPOSITE_IDVENDER 0x3eb +#endif + +// idProduct <0x0000-0xFFFF> +// usb_composite_idproduct +#ifndef CONF_USB_COMPOSITE_IDPRODUCT +#define CONF_USB_COMPOSITE_IDPRODUCT 0x2421 +#endif + +// bcdDevice <0x0000-0xFFFF> +// usb_composite_bcddevice +#ifndef CONF_USB_COMPOSITE_BCDDEVICE +#define CONF_USB_COMPOSITE_BCDDEVICE 0x100 +#endif + +// Enable string descriptor of iManufact +// usb_composite_imanufact_en +#ifndef CONF_USB_COMPOSITE_IMANUFACT_EN +#define CONF_USB_COMPOSITE_IMANUFACT_EN 0 +#endif + +#ifndef CONF_USB_COMPOSITE_IMANUFACT +#define CONF_USB_COMPOSITE_IMANUFACT (CONF_USB_COMPOSITE_IMANUFACT_EN * (CONF_USB_COMPOSITE_IMANUFACT_EN)) +#endif + +// Unicode string of iManufact +// usb_composite_imanufact_str +#ifndef CONF_USB_COMPOSITE_IMANUFACT_STR +#define CONF_USB_COMPOSITE_IMANUFACT_STR "Atmel" +#endif + +#ifndef CONF_USB_COMPOSITE_IMANUFACT_STR_DESC +#define CONF_USB_COMPOSITE_IMANUFACT_STR_DESC +#endif + +// + +// Enable string descriptor of iProduct +// usb_composite_iproduct_en +#ifndef CONF_USB_COMPOSITE_IPRODUCT_EN +#define CONF_USB_COMPOSITE_IPRODUCT_EN 0 +#endif + +#ifndef CONF_USB_COMPOSITE_IPRODUCT +#define CONF_USB_COMPOSITE_IPRODUCT \ + (CONF_USB_COMPOSITE_IPRODUCT_EN * (CONF_USB_COMPOSITE_IMANUFACT_EN + CONF_USB_COMPOSITE_IPRODUCT_EN)) +#endif + +// Unicode string of iProduct +// usb_composite_iproduct_str +#ifndef CONF_USB_COMPOSITE_IPRODUCT_STR +#define CONF_USB_COMPOSITE_IPRODUCT_STR "Composite Demo" +#endif + +#ifndef CONF_USB_COMPOSITE_IPRODUCT_STR_DESC +#define CONF_USB_COMPOSITE_IPRODUCT_STR_DESC +#endif + +// + +// Enable string descriptor of iSerialNum +// usb_composite_iserialnum_en +#ifndef CONF_USB_COMPOSITE_ISERIALNUM_EN +#define CONF_USB_COMPOSITE_ISERIALNUM_EN 0 +#endif + +#ifndef CONF_USB_COMPOSITE_ISERIALNUM +#define CONF_USB_COMPOSITE_ISERIALNUM \ + (CONF_USB_COMPOSITE_ISERIALNUM_EN \ + * (CONF_USB_COMPOSITE_IMANUFACT_EN + CONF_USB_COMPOSITE_IPRODUCT_EN + CONF_USB_COMPOSITE_ISERIALNUM_EN)) +#endif + +// Unicode string of iSerialNum +// usb_composite_iserialnum_str +#ifndef CONF_USB_COMPOSITE_ISERIALNUM_STR +#define CONF_USB_COMPOSITE_ISERIALNUM_STR "123456789ABCDEF" +#endif + +#ifndef CONF_USB_COMPOSITE_ISERIALNUM_STR_DESC +#define CONF_USB_COMPOSITE_ISERIALNUM_STR_DESC +#endif + +// + +// bNumConfigurations <0x01-0xFF> +// usb_composite_bnumconfig +#ifndef CONF_USB_COMPOSITE_BNUMCONFIG +#define CONF_USB_COMPOSITE_BNUMCONFIG 0x1 +#endif + +// + +// Composite Configuration Descriptor +// bConfigurationValue <0x01-0xFF> +// usb_composite_bconfigval +#ifndef CONF_USB_COMPOSITE_BCONFIGVAL +#define CONF_USB_COMPOSITE_BCONFIGVAL 0x1 +#endif +// Enable string descriptor of iConfig +// usb_composite_iconfig_en +#ifndef CONF_USB_COMPOSITE_ICONFIG_EN +#define CONF_USB_COMPOSITE_ICONFIG_EN 0 +#endif + +#ifndef CONF_USB_COMPOSITE_ICONFIG +#define CONF_USB_COMPOSITE_ICONFIG \ + (CONF_USB_COMPOSITE_ICONFIG_EN \ + * (CONF_USB_COMPOSITE_IMANUFACT_EN + CONF_USB_COMPOSITE_IPRODUCT_EN + CONF_USB_COMPOSITE_ISERIALNUM_EN \ + + CONF_USB_COMPOSITE_ICONFIG_EN)) +#endif + +// Unicode string of iConfig +// usb_composite_iconfig_str +#ifndef CONF_USB_COMPOSITE_ICONFIG_STR +#define CONF_USB_COMPOSITE_ICONFIG_STR "" +#endif + +#ifndef CONF_USB_COMPOSITE_ICONFIG_STR_DESC +#define CONF_USB_COMPOSITE_ICONFIG_STR_DESC +#endif + +// + +// bmAttributes +// <0x80=> Bus power supply, not support for remote wakeup +// <0xA0=> Bus power supply, support for remote wakeup +// <0xC0=> Self powered, not support for remote wakeup +// <0xE0=> Self powered, support for remote wakeup +// usb_composite_bmattri +#ifndef CONF_USB_COMPOSITE_BMATTRI +#define CONF_USB_COMPOSITE_BMATTRI 0x80 +#endif + +// bMaxPower <0x00-0xFF> +// usb_composite_bmaxpower +#ifndef CONF_USB_COMPOSITE_BMAXPOWER +#define CONF_USB_COMPOSITE_BMAXPOWER 0x32 +#endif +// + +// CDC ACM Support +// usb_composite_cdc_acm_support +#ifndef CONF_USB_COMPOSITE_CDC_ACM_EN +#define CONF_USB_COMPOSITE_CDC_ACM_EN 0 +#endif + +// CDC ACM Comm Interrupt IN Endpoint Address +// <0x81=> EndpointAddress = 0x81 +// <0x82=> EndpointAddress = 0x82 +// <0x83=> EndpointAddress = 0x83 +// <0x84=> EndpointAddress = 0x84 +// <0x85=> EndpointAddress = 0x85 +// <0x86=> EndpointAddress = 0x86 +// <0x87=> EndpointAddress = 0x87 +// <0x88=> EndpointAddress = 0x88 +// <0x89=> EndpointAddress = 0x89 + +// usb_composite_cdc_acm_epaddr +#ifndef CONF_USB_COMPOSITE_CDC_ACM_COMM_INT_EPADDR +#define CONF_USB_COMPOSITE_CDC_ACM_COMM_INT_EPADDR 0x82 +#endif + +// CDC ACM Comm Interrupt IN Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_cdc_acm_comm_int_maxpksz +#ifndef CONF_USB_COMPOSITE_CDC_ACM_COMM_INT_MAXPKSZ +#define CONF_USB_COMPOSITE_CDC_ACM_COMM_INT_MAXPKSZ 0x40 +#endif + +// CDC ACM Data BULK IN Endpoint Address +// <0x81=> EndpointAddress = 0x81 +// <0x82=> EndpointAddress = 0x82 +// <0x83=> EndpointAddress = 0x83 +// <0x84=> EndpointAddress = 0x84 +// <0x85=> EndpointAddress = 0x85 +// <0x86=> EndpointAddress = 0x86 +// <0x87=> EndpointAddress = 0x87 +// <0x88=> EndpointAddress = 0x88 +// <0x89=> EndpointAddress = 0x89 + +// usb_composite_cdc_acm_data_bulkin_epaddr +#ifndef CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKIN_EPADDR +#define CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKIN_EPADDR 0x81 +#endif + +// CDC ACM Data BULK IN Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_cdc_acm_data_builin_maxpksz +#ifndef CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKIN_MAXPKSZ +#define CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKIN_MAXPKSZ 0x40 +#endif + +// CDC ACM Data BULK IN Endpoint wMaxPacketSize for High Speed +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes +// <0x0080=> 128 bytes +// <0x0100=> 256 bytes +// <0x0200=> 512 bytes + +// usb_composite_cdc_acm_data_builin_maxpksz_hs +#ifndef CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKIN_MAXPKSZ_HS +#define CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKIN_MAXPKSZ_HS 0x200 +#endif + +// CDC ACM Data BULK OUT Endpoint Address +// <0x01=> EndpointAddress = 0x01 +// <0x02=> EndpointAddress = 0x02 +// <0x03=> EndpointAddress = 0x03 +// <0x04=> EndpointAddress = 0x04 +// <0x05=> EndpointAddress = 0x05 +// <0x06=> EndpointAddress = 0x06 +// <0x07=> EndpointAddress = 0x07 +// <0x08=> EndpointAddress = 0x08 +// <0x09=> EndpointAddress = 0x09 + +// usb_composite_cdc_acm_data_bulkout_epaddr +#ifndef CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKOUT_EPADDR +#define CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKOUT_EPADDR 0x1 +#endif + +// CDC ACM Data BULK OUT Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_cdc_acm_data_buckout_maxpksz +#ifndef CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKOUT_MAXPKSZ +#define CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKOUT_MAXPKSZ 0x40 +#endif + +// CDC ACM Data BULK OUT Endpoint wMaxPacketSize for High Speed +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes +// <0x0080=> 128 bytes +// <0x0100=> 256 bytes +// <0x0200=> 512 bytes + +// usb_composite_cdc_acm_data_buckout_maxpksz_hs +#ifndef CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKOUT_MAXPKSZ_HS +#define CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKOUT_MAXPKSZ_HS 0x200 +#endif + +// CDC ACM Echo Demo generation +// conf_usb_composite_cdc_echo_demo +// Invoke cdcdf_acm_demo_init(buf[wMaxPacketSize]) to enable the echo demo. +// Buf is packet buffer for data receive and echo back. +// The buffer is 4 byte aligned to support DMA. +#ifndef CONF_USB_COMPOSITE_CDC_ECHO_DEMO +#define CONF_USB_COMPOSITE_CDC_ECHO_DEMO 0 +#endif + +// + +// HID Mouse Support +// usb_composite_hid_mouse_support +#ifndef CONF_USB_COMPOSITE_HID_MOUSE_EN +#define CONF_USB_COMPOSITE_HID_MOUSE_EN 0 +#endif + +// HID Mouse INTERRUPT IN Endpoint Address +// <0x81=> EndpointAddress = 0x81 +// <0x82=> EndpointAddress = 0x82 +// <0x83=> EndpointAddress = 0x83 +// <0x84=> EndpointAddress = 0x84 +// <0x85=> EndpointAddress = 0x85 +// <0x86=> EndpointAddress = 0x86 +// <0x87=> EndpointAddress = 0x87 +// <0x88=> EndpointAddress = 0x88 +// <0x89=> EndpointAddress = 0x89 + +// usb_composite_hid_mouse_intin_epaddr +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_MOUSE_INTIN_EPADDR +#define CONF_USB_COMPOSITE_HID_MOUSE_INTIN_EPADDR 0x83 +#endif + +// HID Mouse INTERRUPT IN Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_hid_mouse_intin_maxpksz +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_MOUSE_INTIN_MAXPKSZ +#define CONF_USB_COMPOSITE_HID_MOUSE_INTIN_MAXPKSZ 0x8 +#endif + +// HID Mouse Move Demo generation +// conf_usb_composite_hid_mouse_demo +// Invoke hiddf_demo_init(button1, button2, button3) to enabled the move demo. +// Button1 and button3 are the pins used for mouse moving left and right. +#ifndef CONF_USB_COMPOSITE_HID_MOUSE_DEMO +#define CONF_USB_COMPOSITE_HID_MOUSE_DEMO 0 +#endif + +// + +// HID Keyboard Support +// usb_composite_hid_keyboard_support +#ifndef CONF_USB_COMPOSITE_HID_KEYBOARD_EN +#define CONF_USB_COMPOSITE_HID_KEYBOARD_EN 0 +#endif + +// HID Keyboard INTERRUPT IN Endpoint Address +// <0x81=> EndpointAddress = 0x81 +// <0x82=> EndpointAddress = 0x82 +// <0x83=> EndpointAddress = 0x83 +// <0x84=> EndpointAddress = 0x84 +// <0x85=> EndpointAddress = 0x85 +// <0x86=> EndpointAddress = 0x86 +// <0x87=> EndpointAddress = 0x87 +// <0x88=> EndpointAddress = 0x88 +// <0x89=> EndpointAddress = 0x89 + +// usb_composite_hid_keyboard_intin_epaddr +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_KEYBOARD_INTIN_EPADDR +#define CONF_USB_COMPOSITE_HID_KEYBOARD_INTIN_EPADDR 0x84 +#endif + +// HID Keyboard INTERRUPT IN Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_hid_keyboard_intin_maxpksz +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_KEYBOARD_INTIN_MAXPKSZ +#define CONF_USB_COMPOSITE_HID_KEYBOARD_INTIN_MAXPKSZ 0x8 +#endif + +// HID Keyboard INTERRUPT OUT Endpoint Address +// <0x01=> EndpointAddress = 0x01 +// <0x02=> EndpointAddress = 0x02 +// <0x03=> EndpointAddress = 0x03 +// <0x04=> EndpointAddress = 0x04 +// <0x05=> EndpointAddress = 0x05 +// <0x06=> EndpointAddress = 0x06 +// <0x07=> EndpointAddress = 0x07 +// <0x08=> EndpointAddress = 0x08 +// <0x09=> EndpointAddress = 0x09 + +// usb_composite_hid_keyboard_intout_epaddr +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_KEYBOARD_INTOUT_EPADDR +#define CONF_USB_COMPOSITE_HID_KEYBOARD_INTOUT_EPADDR 0x2 +#endif + +// HID Keyboard INTERRUPT OUT Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_hid_keyboard_intout_maxpksz +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_KEYBOARD_INTOUT_MAXPKSZ +#define CONF_USB_COMPOSITE_HID_KEYBOARD_INTOUT_MAXPKSZ 0x8 +#endif + +// HID Keyboard Caps Lock Demo generation +// conf_usb_composite_hid_keyboard_demo +// Invoke hiddf_demo_init(button1, button2, button3) to enabled the move demo. +// Buffon2 is the pin used for keyboard CAPS LOCK simulation. +#ifndef CONF_USB_COMPOSITE_HID_KEYBOARD_DEMO +#define CONF_USB_COMPOSITE_HID_KEYBOARD_DEMO 0 +#endif + +// + +// HID Generic Support +// usb_composite_hid_generic_support +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_EN +#define CONF_USB_COMPOSITE_HID_GENERIC_EN 0 +#endif + +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_REPORT_LEN +#define CONF_USB_COMPOSITE_HID_GENERIC_REPORT_LEN 53 +#endif + +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_REPORT +#define CONF_USB_COMPOSITE_HID_GENERIC_REPORT \ + 0x06, 0xFF, 0xFF, 0x09, 0x01, 0xA1, 0x01, 0x09, 0x02, 0x09, 0x03, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08, 0x95, \ + 0x40, 0x81, 0x02, 0x09, 0x04, 0x09, 0x05, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08, 0x95, 0x40, 0x91, 0x02, \ + 0x09, 0x06, 0x09, 0x07, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08, 0x95, 0x04, 0xB1, 0x02, 0xC0 +#endif + +// HID Generic INTERRUPT IN Endpoint Address +// <0x81=> EndpointAddress = 0x81 +// <0x82=> EndpointAddress = 0x82 +// <0x83=> EndpointAddress = 0x83 +// <0x84=> EndpointAddress = 0x84 +// <0x85=> EndpointAddress = 0x85 +// <0x86=> EndpointAddress = 0x86 +// <0x87=> EndpointAddress = 0x87 +// <0x88=> EndpointAddress = 0x88 +// <0x89=> EndpointAddress = 0x89 + +// usb_composite_hid_generic_intin_epaddr +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_INTIN_EPADDR +#define CONF_USB_COMPOSITE_HID_GENERIC_INTIN_EPADDR 0x85 +#endif + +// HID Generic INTERRUPT IN Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_hid_generic_intin_maxpksz +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_INTIN_MAXPKSZ +#define CONF_USB_COMPOSITE_HID_GENERIC_INTIN_MAXPKSZ 0x40 +#endif + +// HID Generic INTERRUPT OUT Endpoint Address +// <0x01=> EndpointAddress = 0x01 +// <0x02=> EndpointAddress = 0x02 +// <0x03=> EndpointAddress = 0x03 +// <0x04=> EndpointAddress = 0x04 +// <0x05=> EndpointAddress = 0x05 +// <0x06=> EndpointAddress = 0x06 +// <0x07=> EndpointAddress = 0x07 +// <0x08=> EndpointAddress = 0x08 +// <0x09=> EndpointAddress = 0x09 + +// usb_composite_hid_generic_intout_epaddr +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_INTOUT_EPADDR +#define CONF_USB_COMPOSITE_HID_GENERIC_INTOUT_EPADDR 0x3 +#endif + +// HID Generic INTERRUPT OUT Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes +// usb_composite_hid_generic_intout_maxpksz +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_INTOUT_MAXPKSZ +#define CONF_USB_COMPOSITE_HID_GENERIC_INTOUT_MAXPKSZ 0x40 +#endif + +// + +// MSC Support +// usb_composite_msc_support +#ifndef CONF_USB_COMPOSITE_MSC_EN +#define CONF_USB_COMPOSITE_MSC_EN 0 +#endif + +// MSC BULK Endpoints wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_msc_bulk_maxpksz +#ifndef CONF_USB_COMPOSITE_MSC_BULK_MAXPKSZ +#define CONF_USB_COMPOSITE_MSC_BULK_MAXPKSZ 0x40 +#endif + +// MSC BULK Endpoints wMaxPacketSize for High Speed +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes +// <0x0080=> 128 bytes +// <0x0100=> 256 bytes +// <0x0200=> 512 bytes + +// usb_composite_msc_bulk_maxpksz_hs +#ifndef CONF_USB_COMPOSITE_MSC_BULK_MAXPKSZ_HS +#define CONF_USB_COMPOSITE_MSC_BULK_MAXPKSZ_HS 0x200 +#endif + +// MSC BULK IN Endpoint Address +// <0x81=> EndpointAddress = 0x81 +// <0x82=> EndpointAddress = 0x82 +// <0x83=> EndpointAddress = 0x83 +// <0x84=> EndpointAddress = 0x84 +// <0x85=> EndpointAddress = 0x85 +// <0x86=> EndpointAddress = 0x86 +// <0x87=> EndpointAddress = 0x87 +// <0x88=> EndpointAddress = 0x88 +// <0x89=> EndpointAddress = 0x89 + +// usb_composite_msc_bulkin_epaddr +#ifndef CONF_USB_COMPOSITE_MSC_BULKIN_EPADDR +#define CONF_USB_COMPOSITE_MSC_BULKIN_EPADDR 0x86 +#endif + +// MSC BULK OUT Endpoint Address +// <0x01=> EndpointAddress = 0x01 +// <0x02=> EndpointAddress = 0x02 +// <0x03=> EndpointAddress = 0x03 +// <0x04=> EndpointAddress = 0x04 +// <0x05=> EndpointAddress = 0x05 +// <0x06=> EndpointAddress = 0x06 +// <0x07=> EndpointAddress = 0x07 +// <0x08=> EndpointAddress = 0x08 +// <0x09=> EndpointAddress = 0x09 + +// usb_composite_msc_bulkout_epaddr +#ifndef CONF_USB_COMPOSITE_MSC_BULKOUT_EPADDR +#define CONF_USB_COMPOSITE_MSC_BULKOUT_EPADDR 0x4 +#endif + +// Enable Demo code for Disk LUN handling +// usb_composite_msc_demo_en +#ifndef CONF_USB_COMPOSITE_MSC_LUN_DEMO +#define CONF_USB_COMPOSITE_MSC_LUN_DEMO 1 +#endif + +// Disk access cache/buffer of sectors if non-RAM disk (e.g., SD/MMC) enabled <1-64> +// conf_usb_msc_lun_buf_sectors +#ifndef CONF_USB_MSC_LUN_BUF_SECTORS +#define CONF_USB_MSC_LUN_BUF_SECTORS 4 +#endif + +// Enable Demo for RAM Disk +// conf_usb_msc_lun0_enable +#ifndef CONF_USB_MSC_LUN0_ENABLE +#define CONF_USB_MSC_LUN0_ENABLE 1 +#endif + +#ifndef CONF_USB_MSC_LUN0_TYPE +#define CONF_USB_MSC_LUN0_TYPE 0x00 +#endif + +// The disk is removable +// conf_usb_msc_lun0_rmb +#ifndef CONF_USB_MSC_LUN0_RMB +#define CONF_USB_MSC_LUN0_RMB 0x1 +#endif + +#ifndef CONF_USB_MSC_LUN0_ISO +#define CONF_USB_MSC_LUN0_ISO 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN0_ECMA +#define CONF_USB_MSC_LUN0_ECMA 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN0_ANSI +#define CONF_USB_MSC_LUN0_ANSI 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN0_REPO +#define CONF_USB_MSC_LUN0_REPO 0x01 +#endif + +#ifndef CONF_USB_MSC_LUN0_FACTORY +#define CONF_USB_MSC_LUN0_FACTORY 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN0_PRODUCT +#define CONF_USB_MSC_LUN0_PRODUCT 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN0_PRODUCT_VERSION +#define CONF_USB_MSC_LUN0_PRODUCT_VERSION 0x00, 0x00, 0x00, 0x00 +#endif + +// Disk Size (in KB) <0x1-0xFFFFFFFF> +// Windows will not show disk less than 20K, so 22K is used to reserve more RAM for APP +// conf_usb_msc_lun0_capacity + +#ifndef CONF_USB_MSC_LUN0_CAPACITY +#define CONF_USB_MSC_LUN0_CAPACITY 22 +#endif + +#ifndef CONF_USB_MSC_LUN0_BLOCK_SIZE +#define CONF_USB_MSC_LUN0_BLOCK_SIZE 512 +#endif + +#ifndef CONF_USB_MSC_LUN0_LAST_BLOCK_ADDR +#define CONF_USB_MSC_LUN0_LAST_BLOCK_ADDR \ + ((uint32_t)CONF_USB_MSC_LUN0_CAPACITY * 1024 / CONF_USB_MSC_LUN0_BLOCK_SIZE - 1) +#endif + +// + +// Enable Demo for SD/MMC Disk +// SD/MMC stack must be added before enable SD/MMC demo +// SD/MMC insert/eject not supported by this simple demo +// conf_usb_msc_lun1_enable +#ifndef CONF_USB_MSC_LUN1_ENABLE +#define CONF_USB_MSC_LUN1_ENABLE 0 +#endif + +#ifndef CONF_USB_MSC_LUN1_TYPE +#define CONF_USB_MSC_LUN1_TYPE 0x00 +#endif + +// The disk is removable +// SD/MMC stack must be added before enable SD/MMC demo +// SD/MMC insert/eject not supported by this simple demo +// conf_usb_msc_lun1_rmb +#ifndef CONF_USB_MSC_LUN1_RMB +#define CONF_USB_MSC_LUN1_RMB 0x1 +#endif + +#ifndef CONF_USB_MSC_LUN1_ISO +#define CONF_USB_MSC_LUN1_ISO 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN1_ECMA +#define CONF_USB_MSC_LUN1_ECMA 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN1_ANSI +#define CONF_USB_MSC_LUN1_ANSI 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN1_REPO +#define CONF_USB_MSC_LUN1_REPO 0x01 +#endif + +#ifndef CONF_USB_MSC_LUN1_FACTORY +#define CONF_USB_MSC_LUN1_FACTORY 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN1_PRODUCT +#define CONF_USB_MSC_LUN1_PRODUCT 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN1_PRODUCT_VERSION +#define CONF_USB_MSC_LUN1_PRODUCT_VERSION 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN1_CAPACITY +#define CONF_USB_MSC_LUN1_CAPACITY 22 +#endif + +#ifndef CONF_USB_MSC_LUN1_BLOCK_SIZE +#define CONF_USB_MSC_LUN1_BLOCK_SIZE 512 +#endif + +#ifndef CONF_USB_MSC_LUN1_LAST_BLOCK_ADDR +#define CONF_USB_MSC_LUN1_LAST_BLOCK_ADDR \ + ((uint32_t)CONF_USB_MSC_LUN1_CAPACITY * 1024 / CONF_USB_MSC_LUN1_BLOCK_SIZE - 1) +#endif + +// + +// Enable Demo for LUN 2 +// conf_usb_msc_lun2_enable +#ifndef CONF_USB_MSC_LUN2_ENABLE +#define CONF_USB_MSC_LUN2_ENABLE 0 +#endif + +#ifndef CONF_USB_MSC_LUN2_TYPE +#define CONF_USB_MSC_LUN2_TYPE 0x00 +#endif + +// The disk is removable +// conf_usb_msc_lun2_rmb +#ifndef CONF_USB_MSC_LUN2_RMB +#define CONF_USB_MSC_LUN2_RMB 0x1 +#endif + +#ifndef CONF_USB_MSC_LUN2_ISO +#define CONF_USB_MSC_LUN2_ISO 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN2_ECMA +#define CONF_USB_MSC_LUN2_ECMA 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN2_ANSI +#define CONF_USB_MSC_LUN2_ANSI 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN2_REPO +#define CONF_USB_MSC_LUN2_REPO 0x01 +#endif + +#ifndef CONF_USB_MSC_LUN2_FACTORY +#define CONF_USB_MSC_LUN2_FACTORY 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN2_PRODUCT +#define CONF_USB_MSC_LUN2_PRODUCT 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN2_PRODUCT_VERSION +#define CONF_USB_MSC_LUN2_PRODUCT_VERSION 0x00, 0x00, 0x00, 0x00 +#endif + +// Disk Size (in KB) <0x1-0xFFFFFFFF> +// conf_usb_msc_lun2_capacity + +#ifndef CONF_USB_MSC_LUN2_CAPACITY +#define CONF_USB_MSC_LUN2_CAPACITY 22 +#endif + +#ifndef CONF_USB_MSC_LUN2_BLOCK_SIZE +#define CONF_USB_MSC_LUN2_BLOCK_SIZE 512 +#endif + +#ifndef CONF_USB_MSC_LUN2_LAST_BLOCK_ADDR +#define CONF_USB_MSC_LUN2_LAST_BLOCK_ADDR \ + ((uint32_t)CONF_USB_MSC_LUN2_CAPACITY * 1024 / CONF_USB_MSC_LUN2_BLOCK_SIZE - 1) +#endif + +// + +// Enable Demo for LUN 3 +// conf_usb_msc_lun3_enable +#ifndef CONF_USB_MSC_LUN3_ENABLE +#define CONF_USB_MSC_LUN3_ENABLE 0 +#endif + +#ifndef CONF_USB_MSC_LUN3_TYPE +#define CONF_USB_MSC_LUN3_TYPE 0x00 +#endif + +// The disk is removable +// conf_usb_msc_lun3_rmb +#ifndef CONF_USB_MSC_LUN3_RMB +#define CONF_USB_MSC_LUN3_RMB 0x1 +#endif + +#ifndef CONF_USB_MSC_LUN3_ISO +#define CONF_USB_MSC_LUN3_ISO 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN3_ECMA +#define CONF_USB_MSC_LUN3_ECMA 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN3_ANSI +#define CONF_USB_MSC_LUN3_ANSI 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN3_REPO +#define CONF_USB_MSC_LUN3_REPO 0x01 +#endif + +#ifndef CONF_USB_MSC_LUN3_FACTORY +#define CONF_USB_MSC_LUN3_FACTORY 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN3_PRODUCT +#define CONF_USB_MSC_LUN3_PRODUCT 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN3_PRODUCT_VERSION +#define CONF_USB_MSC_LUN3_PRODUCT_VERSION 0x00, 0x00, 0x00, 0x00 +#endif + +// Disk Size (in KB) <0x1-0xFFFFFFFF> +// conf_usb_msc_lun3_capacity + +#ifndef CONF_USB_MSC_LUN3_CAPACITY +#define CONF_USB_MSC_LUN3_CAPACITY 22 +#endif + +#ifndef CONF_USB_MSC_LUN3_BLOCK_SIZE +#define CONF_USB_MSC_LUN3_BLOCK_SIZE 512 +#endif + +#ifndef CONF_USB_MSC_LUN3_LAST_BLOCK_ADDR +#define CONF_USB_MSC_LUN3_LAST_BLOCK_ADDR \ + ((uint32_t)CONF_USB_MSC_LUN3_CAPACITY * 1024 / CONF_USB_MSC_LUN3_BLOCK_SIZE - 1) +#endif + +// + +// +// + +// <<< end of configuration section >>> + +#endif // USBD_CONFIG_H diff --git a/ports/atmel-samd/bindings/samd/Clock.c b/ports/atmel-samd/bindings/samd/Clock.c index 24e425e8cb..e1022c52f7 100644 --- a/ports/atmel-samd/bindings/samd/Clock.c +++ b/ports/atmel-samd/bindings/samd/Clock.c @@ -272,7 +272,7 @@ MP_DEFINE_CONST_DICT(samd_clock_globals, samd_clock_global_dict_table); #endif // SAMD21 -#ifdef SAMD51 +#ifdef SAM_D5X_E5X diff --git a/ports/atmel-samd/common-hal/_pew/PewPew.c b/ports/atmel-samd/common-hal/_pew/PewPew.c index 568dc6425f..cfdfe75d8d 100644 --- a/ports/atmel-samd/common-hal/_pew/PewPew.c +++ b/ports/atmel-samd/common-hal/_pew/PewPew.c @@ -88,7 +88,7 @@ void pew_init() { #ifdef SAMD21 turn_on_clocks(true, index, 0); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X turn_on_clocks(true, index, 1); #endif @@ -98,7 +98,7 @@ void pew_init() { TC_CTRLA_PRESCALER_DIV64 | TC_CTRLA_WAVEGEN_MFRQ; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc_reset(tc); tc_set_enable(tc, false); tc->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 diff --git a/ports/atmel-samd/common-hal/analogio/AnalogOut.c b/ports/atmel-samd/common-hal/analogio/AnalogOut.c index 9ac1f7bd15..e69a240717 100644 --- a/ports/atmel-samd/common-hal/analogio/AnalogOut.c +++ b/ports/atmel-samd/common-hal/analogio/AnalogOut.c @@ -50,7 +50,7 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, mp_raise_NotImplementedError(translate("No DAC on chip")); #else if (pin->number != PIN_PA02 - #ifdef SAMD51 + #ifdef SAM_D5X_E5X && pin->number != PIN_PA05 #endif ) { @@ -59,13 +59,13 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, } self->channel = 0; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (pin->number == PIN_PA05) { self->channel = 1; } #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X hri_mclk_set_APBDMASK_DAC_bit(MCLK); #endif @@ -80,16 +80,16 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, // Don't double init the DAC on the SAMD51 when both outputs are in use. We use the free state // of each output pin to determine DAC state. int32_t result = ERR_NONE; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (!common_hal_mcu_pin_is_free(&pin_PA02) || !common_hal_mcu_pin_is_free(&pin_PA05)) { #endif // Fake the descriptor if the DAC is already initialized. self->descriptor.device.hw = DAC; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X } else { #endif result = dac_sync_init(&self->descriptor, DAC); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X } #endif if (result != ERR_NONE) { @@ -109,18 +109,18 @@ bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { } void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { - #if (defined(SAMD21) && defined(PIN_PA02)) || defined(SAMD51) + #if (defined(SAMD21) && defined(PIN_PA02)) || defined(SAM_D5X_E5X) if (common_hal_analogio_analogout_deinited(self)) { return; } dac_sync_disable_channel(&self->descriptor, self->channel); reset_pin_number(PIN_PA02); // Only deinit the DAC on the SAMD51 if both outputs are free. - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (common_hal_mcu_pin_is_free(&pin_PA02) && common_hal_mcu_pin_is_free(&pin_PA05)) { #endif dac_sync_deinit(&self->descriptor); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X } #endif self->deinited = true; @@ -147,7 +147,7 @@ void analogout_reset(void) { #ifdef SAMD21 while (DAC->STATUS.reg & DAC_STATUS_SYNCBUSY) {} #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X while (DAC->SYNCBUSY.reg & DAC_SYNCBUSY_SWRST) {} #endif DAC->CTRLA.reg |= DAC_CTRLA_SWRST; diff --git a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c index 8f827e7fba..20fa624edf 100644 --- a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c +++ b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -59,13 +59,13 @@ #define SERCTRL(name) I2S_SERCTRL_ ## name #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X #define SERCTRL(name) I2S_TXCTRL_ ## name #endif void i2sout_reset(void) { // Make sure the I2S peripheral is running so we can see if the resources we need are free. - #ifdef SAMD51 + #ifdef SAM_D5X_E5X // Connect the clock units to the 2mhz clock. It can't disable without it. connect_gclk_to_peripheral(5, I2S_GCLK_ID_0); connect_gclk_to_peripheral(5, I2S_GCLK_ID_1); @@ -76,7 +76,7 @@ void i2sout_reset(void) { } // Make sure the I2S peripheral is running so we can see if the resources we need are free. - #ifdef SAMD51 + #ifdef SAM_D5X_E5X // Connect the clock units to the 2mhz clock by default. They can't reset without it. disconnect_gclk_from_peripheral(5, I2S_GCLK_ID_0); disconnect_gclk_from_peripheral(5, I2S_GCLK_ID_1); @@ -132,7 +132,7 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t* self, serializer = 1; } #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X // Only clock unit 0 can be used for transmission. if (bit_clock == &pin_PA10 || bit_clock == &pin_PB16) { // I2S SCK[0] bc_clock_unit = 0; @@ -170,14 +170,14 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t* self, mp_raise_RuntimeError(translate("Serializer in use")); } #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (I2S->CTRLA.bit.TXEN == 1) { mp_raise_RuntimeError(translate("Serializer in use")); } #endif } - #ifdef SAMD51 + #ifdef SAM_D5X_E5X #define GPIO_I2S_FUNCTION GPIO_PIN_FUNCTION_J #endif #ifdef SAMD21 @@ -254,7 +254,7 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, #ifdef SAMD21 uint32_t serctrl = (self->clock_unit << I2S_SERCTRL_CLKSEL_Pos) | SERCTRL(SERMODE_TX) | I2S_SERCTRL_TXSAME_SAME | I2S_SERCTRL_EXTEND_MSBIT | I2S_SERCTRL_TXDEFAULT_ONE | I2S_SERCTRL_SLOTADJ_LEFT; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X uint32_t serctrl = (self->clock_unit << I2S_RXCTRL_CLKSEL_Pos) | I2S_TXCTRL_TXSAME_SAME; #endif if (audiosample_channel_count(sample) == 1) { @@ -277,7 +277,7 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, #ifdef SAMD21 I2S->SERCTRL[self->serializer].reg = serctrl; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X I2S->TXCTRL.reg = serctrl; #endif @@ -291,7 +291,7 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, uint32_t tx_register = (uint32_t) &I2S->DATA[self->serializer].reg; uint8_t dmac_id = I2S_DMAC_ID_TX_0 + self->serializer; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X uint32_t tx_register = (uint32_t) &I2S->TXDATA.reg; uint8_t dmac_id = I2S_DMAC_ID_TX_0; #endif @@ -316,7 +316,7 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, I2S->CTRLA.vec.SEREN = 1 << self->serializer; while ((I2S->SYNCBUSY.vec.SEREN & (1 << self->serializer)) != 0) {} #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X I2S->CTRLA.bit.TXEN = 1; while (I2S->SYNCBUSY.bit.TXEN == 1) {} #endif @@ -333,7 +333,7 @@ void common_hal_audiobusio_i2sout_resume(audiobusio_i2sout_obj_t* self) { #ifdef SAMD21 I2S->INTFLAG.reg = I2S_INTFLAG_TXUR0 << self->serializer; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X I2S->INTFLAG.reg = I2S_INTFLAG_TXUR0 | I2S_INTFLAG_TXUR1; #endif @@ -351,7 +351,7 @@ void common_hal_audiobusio_i2sout_stop(audiobusio_i2sout_obj_t* self) { I2S->CTRLA.vec.SEREN &= ~(1 << self->serializer); while ((I2S->SYNCBUSY.vec.SEREN & (1 << self->serializer)) != 0) {} #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X I2S->CTRLA.bit.TXEN = 0; while (I2S->SYNCBUSY.bit.TXEN == 1) {} #endif @@ -368,7 +368,7 @@ void common_hal_audiobusio_i2sout_stop(audiobusio_i2sout_obj_t* self) { disconnect_gclk_from_peripheral(self->gclk, I2S_GCLK_ID_0 + self->clock_unit); disable_clock_generator(self->gclk); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X connect_gclk_to_peripheral(5, I2S_GCLK_ID_0 + self->clock_unit); #endif diff --git a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c index a1e35a1dc0..474512f5ea 100644 --- a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c +++ b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -60,7 +60,7 @@ #define SERCTRL(name) I2S_SERCTRL_ ## name #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X #define SERCTRL(name) I2S_RXCTRL_ ## name #endif @@ -94,7 +94,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, self->clock_unit = 1; #endif #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (clock_pin == &pin_PA10 || clock_pin == &pin_PB16) { self->clock_unit = 0; } else if (clock_pin == &pin_PB12 @@ -122,7 +122,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, #endif self->serializer = 1; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (data_pin == &pin_PB10 || data_pin == &pin_PA22) { self->serializer = 1; #endif @@ -145,13 +145,13 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, mp_raise_RuntimeError(translate("Serializer in use")); } #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (I2S->CTRLA.bit.RXEN == 1) { mp_raise_RuntimeError(translate("Serializer in use")); } #endif } - #ifdef SAMD51 + #ifdef SAM_D5X_E5X #define GPIO_I2S_FUNCTION GPIO_PIN_FUNCTION_J #endif #ifdef SAMD21 @@ -185,7 +185,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, #ifdef SAMD21 uint32_t serctrl = (self->clock_unit << I2S_SERCTRL_CLKSEL_Pos) | SERCTRL(SERMODE_PDM2) | SERCTRL(DATASIZE_32); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X uint32_t serctrl = (self->clock_unit << I2S_RXCTRL_CLKSEL_Pos) | SERCTRL(SERMODE_PDM2) | SERCTRL(DATASIZE_32); #endif @@ -196,7 +196,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, #ifdef SAMD21 I2S->SERCTRL[self->serializer].reg = serctrl; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X I2S->RXCTRL.reg = serctrl; #endif @@ -274,7 +274,7 @@ static void setup_dma(audiobusio_pdmin_obj_t* self, uint32_t length, #ifdef SAMD21 descriptor->SRCADDR.reg = (uint32_t)&I2S->DATA[self->serializer]; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X descriptor->SRCADDR.reg = (uint32_t)&I2S->RXDATA; #endif @@ -295,7 +295,7 @@ static void setup_dma(audiobusio_pdmin_obj_t* self, uint32_t length, #ifdef SAMD21 second_descriptor->SRCADDR.reg = (uint32_t)&I2S->DATA[self->serializer]; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X second_descriptor->SRCADDR.reg = (uint32_t)&I2S->RXDATA; #endif second_descriptor->BTCTRL.reg = DMAC_BTCTRL_VALID | @@ -400,7 +400,7 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* se #ifdef SAMD21 #define MAX_WAIT_COUNTS 1000 #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X #define MAX_WAIT_COUNTS 6000 #endif // If wait_counts exceeds the max count, buffer has probably stopped filling; diff --git a/ports/atmel-samd/common-hal/audioio/AudioOut.c b/ports/atmel-samd/common-hal/audioio/AudioOut.c index 75621b361f..5cefba56f1 100644 --- a/ports/atmel-samd/common-hal/audioio/AudioOut.c +++ b/ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -74,7 +74,7 @@ static void ramp_value(uint16_t start, uint16_t end) { } #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X static void ramp_value(uint16_t start, uint16_t end) { int32_t diff = (int32_t) end - start; int32_t step = 49; @@ -104,7 +104,7 @@ void audioout_reset(void) { #ifdef SAMD21 while (DAC->STATUS.reg & DAC_STATUS_SYNCBUSY) {} #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X while (DAC->SYNCBUSY.reg & DAC_SYNCBUSY_SWRST) {} #endif if (DAC->CTRLA.bit.ENABLE) { @@ -118,7 +118,7 @@ void audioout_reset(void) { // Caller validates that pins are free. void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, const mcu_pin_obj_t* left_channel, const mcu_pin_obj_t* right_channel, uint16_t quiescent_value) { - #ifdef SAMD51 + #ifdef SAM_D5X_E5X bool dac_clock_enabled = hri_mclk_get_APBDMASK_DAC_bit(MCLK); #endif @@ -138,7 +138,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, } claim_pin(left_channel); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X self->right_channel = NULL; if (left_channel != &pin_PA02 && left_channel != &pin_PA05) { mp_raise_ValueError(translate("Invalid pin for left channel")); @@ -159,7 +159,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, self->left_channel = left_channel; audio_dma_init(&self->left_dma); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X hri_mclk_set_APBDMASK_DAC_bit(MCLK); #endif @@ -176,12 +176,12 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, DAC->CTRLA.bit.SWRST = 1; while (DAC->CTRLA.bit.SWRST == 1) {} // Make sure there are no outstanding access errors. (Reading DATA can cause this.) - #ifdef SAMD51 + #ifdef SAM_D5X_E5X PAC->INTFLAGD.reg = PAC_INTFLAGD_DAC; #endif bool channel0_enabled = true; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X channel0_enabled = self->left_channel == &pin_PA02 || self->right_channel == &pin_PA02; bool channel1_enabled = self->left_channel == &pin_PA05 || self->right_channel == &pin_PA05; #endif @@ -195,7 +195,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, DAC_CTRLB_EOEN | DAC_CTRLB_VPD; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X DAC->EVCTRL.reg |= DAC_EVCTRL_STARTEI0; DAC->DACCTRL[0].reg = DAC_DACCTRL_CCTRL_CC100K | DAC_DACCTRL_ENABLE | @@ -203,7 +203,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, DAC->CTRLB.reg = DAC_CTRLB_REFSEL_VREFPU; #endif } - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (channel1_enabled) { DAC->EVCTRL.reg |= DAC_EVCTRL_STARTEI1; DAC->DACCTRL[1].reg = DAC_DACCTRL_CCTRL_CC100K | @@ -218,7 +218,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, #ifdef SAMD21 while (DAC->STATUS.bit.SYNCBUSY == 1) {} #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X while (DAC->SYNCBUSY.bit.ENABLE == 1) {} while (channel0_enabled && DAC->STATUS.bit.READY0 == 0) {} while (channel1_enabled && DAC->STATUS.bit.READY1 == 0) {} @@ -243,7 +243,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, // Use the 48mhz clocks on both the SAMD21 and 51 because we will be going much slower. uint8_t tc_gclk = 0; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc_gclk = 1; #endif @@ -253,7 +253,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, // Don't bother setting the period. We set it before you playback anything. tc_set_enable(t, false); tc_reset(t); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X t->COUNT16.WAVE.reg = TC_WAVE_WAVEGEN_MFRQ; #endif #ifdef SAMD21 @@ -268,7 +268,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, #ifdef SAMD21 #define FIRST_TC_GEN_ID EVSYS_ID_GEN_TC3_OVF #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X #define FIRST_TC_GEN_ID EVSYS_ID_GEN_TC0_OVF #endif uint8_t tc_gen_id = FIRST_TC_GEN_ID + 3 * tc_index; @@ -282,7 +282,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, mp_raise_RuntimeError(translate("All event channels in use")); } - #ifdef SAMD51 + #ifdef SAM_D5X_E5X connect_event_user_to_channel(EVSYS_ID_USER_DAC_START_1, channel); if (right_channel != NULL) { gpio_set_pin_function(self->right_channel->number, GPIO_PIN_FUNCTION_B); @@ -322,7 +322,7 @@ void common_hal_audioio_audioout_deinit(audioio_audioout_obj_t* self) { #ifdef SAMD21 while (DAC->STATUS.bit.SYNCBUSY == 1) {} #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X while (DAC->SYNCBUSY.bit.ENABLE == 1) {} #endif @@ -332,7 +332,7 @@ void common_hal_audioio_audioout_deinit(audioio_audioout_obj_t* self) { reset_pin_number(self->left_channel->number); self->left_channel = NULL; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X reset_pin_number(self->right_channel->number); self->right_channel = NULL; #endif @@ -369,7 +369,7 @@ void common_hal_audioio_audioout_play(audioio_audioout_obj_t* self, #ifdef SAMD21 uint32_t max_sample_rate = 350000; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X uint32_t max_sample_rate = 1000000; #endif if (sample_rate > max_sample_rate) { @@ -382,7 +382,7 @@ void common_hal_audioio_audioout_play(audioio_audioout_obj_t* self, DAC_DMAC_ID_EMPTY); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X uint32_t left_channel_reg = (uint32_t) &DAC->DATABUF[0].reg; uint8_t tc_trig_id = TC0_DMAC_ID_OVF + 3 * self->tc_index; uint8_t left_channel_trigger = tc_trig_id; @@ -416,7 +416,7 @@ void common_hal_audioio_audioout_play(audioio_audioout_obj_t* self, #endif if (result != AUDIO_DMA_OK) { audio_dma_stop(&self->left_dma); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X audio_dma_stop(&self->right_dma); #endif if (result == AUDIO_DMA_DMA_BUSY) { @@ -434,7 +434,7 @@ void common_hal_audioio_audioout_play(audioio_audioout_obj_t* self, void common_hal_audioio_audioout_pause(audioio_audioout_obj_t* self) { audio_dma_pause(&self->left_dma); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X audio_dma_pause(&self->right_dma); #endif } @@ -444,12 +444,12 @@ void common_hal_audioio_audioout_resume(audioio_audioout_obj_t* self) { #ifdef SAMD21 DAC->INTFLAG.reg = DAC_INTFLAG_UNDERRUN; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X DAC->INTFLAG.reg = DAC_INTFLAG_UNDERRUN0 | DAC_INTFLAG_UNDERRUN1; #endif audio_dma_resume(&self->left_dma); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X audio_dma_resume(&self->right_dma); #endif } @@ -462,7 +462,7 @@ void common_hal_audioio_audioout_stop(audioio_audioout_obj_t* self) { Tc* timer = tc_insts[self->tc_index]; timer->COUNT16.CTRLBSET.reg = TC_CTRLBSET_CMD_STOP; audio_dma_stop(&self->left_dma); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X audio_dma_stop(&self->right_dma); #endif // Ramp the DAC to default. The start is ignored when the current value can be readback. diff --git a/ports/atmel-samd/common-hal/audioio/AudioOut.h b/ports/atmel-samd/common-hal/audioio/AudioOut.h index 56b6b75c89..956839969f 100644 --- a/ports/atmel-samd/common-hal/audioio/AudioOut.h +++ b/ports/atmel-samd/common-hal/audioio/AudioOut.h @@ -36,7 +36,7 @@ typedef struct { mp_obj_base_t base; const mcu_pin_obj_t *left_channel; audio_dma_t left_dma; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X const mcu_pin_obj_t *right_channel; audio_dma_t right_dma; #endif diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index 9f740dc8af..b587eaaef4 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -105,7 +105,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, continue; } #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X if (potential_sercom->USART.CTRLA.bit.ENABLE != 0 || !(tx->sercom[i].pad == 0)) { continue; diff --git a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c index fcb3c0ce73..1952df5637 100644 --- a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +++ b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c @@ -54,7 +54,7 @@ static frequencyio_frequencyin_obj_t *active_frequencyins[TC_INST_NUM]; volatile uint8_t reference_tc = 0xff; -#ifdef SAMD51 +#ifdef SAM_D5X_E5X static uint8_t dpll_gclk; #endif @@ -67,7 +67,7 @@ void frequencyin_emergency_cancel_capture(uint8_t index) { NVIC_DisableIRQ(EIC_IRQn); NVIC_ClearPendingIRQ(EIC_IRQn); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X NVIC_DisableIRQ(EIC_0_IRQn + self->channel); NVIC_ClearPendingIRQ(EIC_0_IRQn + self->channel); #endif @@ -78,7 +78,7 @@ void frequencyin_emergency_cancel_capture(uint8_t index) { #ifdef SAMD21 NVIC_EnableIRQ(EIC_IRQn); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X NVIC_EnableIRQ(EIC_0_IRQn + self->channel); #endif mp_raise_RuntimeError(translate("Frequency captured is above capability. Capture Paused.")); @@ -107,7 +107,7 @@ void frequencyin_interrupt_handler(uint8_t index) { self->factor = (uint32_t) (current_ns - self->last_ns) / 1000000.0; self->last_ns = current_ns; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc->COUNT16.CTRLBSET.bit.CMD = TC_CTRLBSET_CMD_READSYNC_Val; while ((tc->COUNT16.SYNCBUSY.bit.COUNT == 1) || (tc->COUNT16.CTRLBSET.bit.CMD == TC_CTRLBSET_CMD_READSYNC_Val)) { @@ -121,7 +121,7 @@ void frequencyin_interrupt_handler(uint8_t index) { } self->frequency = new_freq; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc->COUNT16.CTRLBSET.bit.CMD = TC_CTRLBSET_CMD_RETRIGGER_Val; while ((tc->COUNT16.SYNCBUSY.bit.COUNT == 1) || (tc->COUNT16.CTRLBSET.bit.CMD == TC_CTRLBSET_CMD_RETRIGGER_Val)) { @@ -151,7 +151,7 @@ void frequencyin_reference_tc_init() { #endif // use the DPLL we setup so that the reference_tc and freqin_tc(s) // are using the same clock frequency. - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (dpll_gclk == 0xff) { frequencyin_samd51_start_dpll(); } @@ -168,7 +168,7 @@ void frequencyin_reference_tc_init() { tc->COUNT16.INTENSET.bit.OVF = 1; NVIC_EnableIRQ(TC3_IRQn + reference_tc); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 | TC_CTRLA_PRESCALER_DIV1; tc->COUNT16.INTENSET.bit.OVF = 1; @@ -192,7 +192,7 @@ void frequencyin_reference_tc_enable(bool enable) { tc_set_enable(tc, enable); } -#ifdef SAMD51 +#ifdef SAM_D5X_E5X void frequencyin_samd51_start_dpll() { if (clock_get_enabled(0, GCLK_SOURCE_DPLL1)) { return; @@ -259,7 +259,7 @@ void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* #ifdef SAMD21 ((EIC->INTENSET.vec.EXTINT & mask) != 0 || (EIC->EVCTRL.vec.EXTINTEO & mask) != 0)) { #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X ((EIC->INTENSET.bit.EXTINT & mask) != 0 || (EIC->EVCTRL.bit.EXTINTEO & mask) != 0)) { #endif mp_raise_RuntimeError(translate("EXTINT channel already in use")); @@ -280,7 +280,7 @@ void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* #ifdef SAMD21 self->TC_IRQ = TC3_IRQn + timer_index; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X self->TC_IRQ = TC0_IRQn + timer_index; #endif @@ -292,7 +292,7 @@ void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* set_timer_handler(timer_index, 0, TC_HANDLER_NO_INTERRUPT); turn_on_clocks(true, timer_index, 0); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X frequencyin_samd51_start_dpll(); if (dpll_gclk == 0xff && !clock_get_enabled(0, GCLK_SOURCE_DPLL1)) { common_hal_frequencyio_frequencyin_deinit(self); @@ -318,7 +318,7 @@ void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* masked_value = EIC->EVCTRL.vec.EXTINTEO; EIC->EVCTRL.vec.EXTINTEO = masked_value | (1 << self->channel); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X masked_value = EIC->EVCTRL.bit.EXTINTEO; EIC->EVCTRL.bit.EXTINTEO = masked_value | (1 << self->channel); EIC->ASYNCH.bit.ASYNCH = 1; @@ -334,7 +334,7 @@ void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* #ifdef SAMD21 connect_event_user_to_channel((EVSYS_ID_USER_TC3_EVU + timer_index), evsys_channel); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X connect_event_user_to_channel((EVSYS_ID_USER_TC0_EVU + timer_index), evsys_channel); #endif init_async_event_channel(evsys_channel, (EVSYS_ID_GEN_EIC_EXTINT_0 + self->channel)); @@ -349,7 +349,7 @@ void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* tc->COUNT16.EVCTRL.bit.EVACT = TC_EVCTRL_EVACT_COUNT_Val; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc->COUNT16.EVCTRL.reg = TC_EVCTRL_EVACT(TC_EVCTRL_EVACT_COUNT_Val) | TC_EVCTRL_TCEI; tc->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 | TC_CTRLA_PRESCALER_DIV1; @@ -393,7 +393,7 @@ void common_hal_frequencyio_frequencyin_deinit(frequencyio_frequencyin_obj_t* se uint32_t masked_value = EIC->EVCTRL.vec.EXTINTEO; EIC->EVCTRL.vec.EXTINTEO = masked_value ^ (1 << self->channel); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X disable_event_user(EVSYS_ID_USER_TC0_EVU + self->tc_index); uint32_t masked_value = EIC->EVCTRL.bit.EXTINTEO; EIC->EVCTRL.bit.EXTINTEO = masked_value ^ (1 << self->channel); @@ -427,7 +427,7 @@ void common_hal_frequencyio_frequencyin_deinit(frequencyio_frequencyin_obj_t* se if (!check_active) { frequencyin_reference_tc_enable(false); reference_tc = 0xff; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X frequencyin_samd51_stop_dpll(); #endif } @@ -438,7 +438,7 @@ uint32_t common_hal_frequencyio_frequencyin_get_item(frequencyio_frequencyin_obj #ifdef SAMD21 NVIC_DisableIRQ(EIC_IRQn); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X NVIC_DisableIRQ(EIC_0_IRQn + self->channel); #endif @@ -462,7 +462,7 @@ uint32_t common_hal_frequencyio_frequencyin_get_item(frequencyio_frequencyin_obj NVIC_ClearPendingIRQ(EIC_IRQn); NVIC_EnableIRQ(EIC_IRQn); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X NVIC_ClearPendingIRQ(EIC_0_IRQn + self->channel); NVIC_EnableIRQ(EIC_0_IRQn + self->channel); #endif @@ -481,7 +481,7 @@ void common_hal_frequencyio_frequencyin_pause(frequencyio_frequencyin_obj_t* sel uint32_t masked_value = EIC->EVCTRL.vec.EXTINTEO; EIC->EVCTRL.vec.EXTINTEO = masked_value ^ (1 << self->channel); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X uint32_t masked_value = EIC->EVCTRL.bit.EXTINTEO; EIC->EVCTRL.bit.EXTINTEO = masked_value ^ (1 << self->channel); #endif @@ -499,7 +499,7 @@ void common_hal_frequencyio_frequencyin_resume(frequencyio_frequencyin_obj_t* se uint32_t masked_value = EIC->EVCTRL.vec.EXTINTEO; EIC->EVCTRL.vec.EXTINTEO = masked_value | (1 << self->channel); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X uint32_t masked_value = EIC->EVCTRL.bit.EXTINTEO; EIC->EVCTRL.bit.EXTINTEO = masked_value | (1 << self->channel); #endif @@ -512,7 +512,7 @@ void common_hal_frequencyio_frequencyin_clear(frequencyio_frequencyin_obj_t* sel #ifdef SAMD21 NVIC_DisableIRQ(EIC_IRQn); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X NVIC_DisableIRQ(EIC_0_IRQn + self->channel); #endif @@ -524,7 +524,7 @@ void common_hal_frequencyio_frequencyin_clear(frequencyio_frequencyin_obj_t* sel NVIC_ClearPendingIRQ(EIC_IRQn); NVIC_EnableIRQ(EIC_IRQn); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X NVIC_ClearPendingIRQ(EIC_0_IRQn + self->channel); NVIC_EnableIRQ(EIC_0_IRQn + self->channel); #endif diff --git a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.h b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.h index 461fb661f1..53b9f2d2d1 100644 --- a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.h +++ b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.h @@ -50,7 +50,7 @@ void frequencyin_emergency_cancel_capture(uint8_t index); void frequencyin_reference_tc_init(void); void frequencyin_reference_tc_enable(bool enable); bool frequencyin_reference_tc_enabled(void); -#ifdef SAMD51 +#ifdef SAM_D5X_E5X void frequencyin_samd51_start_dpll(void); void frequencyin_samd51_stop_dpll(void); #endif diff --git a/ports/atmel-samd/common-hal/microcontroller/Pin.c b/ports/atmel-samd/common-hal/microcontroller/Pin.c index 3c214a9f41..5ce077eb86 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Pin.c +++ b/ports/atmel-samd/common-hal/microcontroller/Pin.c @@ -45,7 +45,7 @@ bool speaker_enable_in_use; #define PORT_COUNT (PORT_BITS / 32 + 1) -#ifdef SAMD51 +#ifdef SAM_D5X_E5X #define SWD_MUX GPIO_PIN_FUNCTION_H #endif #ifdef SAMD21 @@ -80,7 +80,7 @@ void reset_all_pins(void) { // Configure SWD. SWDIO will be automatically switched on PA31 when a signal is input on // SWCLK. - #ifdef SAMD51 + #ifdef SAM_D5X_E5X gpio_set_pin_function(PIN_PA30, MUX_PA30H_CM4_SWCLK); #endif #ifdef SAMD21 @@ -136,7 +136,7 @@ void reset_pin_number(uint8_t pin_number) { #endif if (pin_number == PIN_PA30 - #ifdef SAMD51 + #ifdef SAM_D5X_E5X ) { #endif #ifdef SAMD21 @@ -199,7 +199,7 @@ bool pin_number_is_free(uint8_t pin_number) { return false; } if (pin_number == PIN_PA30 - #ifdef SAMD51 + #ifdef SAM_D5X_E5X ) { #endif #ifdef SAMD21 diff --git a/ports/atmel-samd/common-hal/microcontroller/Processor.c b/ports/atmel-samd/common-hal/microcontroller/Processor.c index 2ca3ab30bd..199f19354b 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Processor.c +++ b/ports/atmel-samd/common-hal/microcontroller/Processor.c @@ -163,7 +163,7 @@ STATIC float calculate_temperature(uint16_t raw_value) { } #endif // SAMD21 -#ifdef SAMD51 +#ifdef SAM_D5X_E5X STATIC float calculate_temperature(uint16_t TP, uint16_t TC) { uint32_t TLI = (*(uint32_t *)FUSES_ROOM_TEMP_VAL_INT_ADDR & FUSES_ROOM_TEMP_VAL_INT_Msk) >> FUSES_ROOM_TEMP_VAL_INT_Pos; uint32_t TLD = (*(uint32_t *)FUSES_ROOM_TEMP_VAL_DEC_ADDR & FUSES_ROOM_TEMP_VAL_DEC_Msk) >> FUSES_ROOM_TEMP_VAL_DEC_Pos; @@ -231,7 +231,7 @@ float common_hal_mcu_processor_get_temperature(void) { return calculate_temperature(value); #endif // SAMD21 -#ifdef SAMD51 +#ifdef SAM_D5X_E5X adc_sync_set_resolution(&adc, ADC_CTRLB_RESSEL_12BIT_Val); // Using INTVCC0 as the reference voltage. // INTVCC1 seems to read a little high. @@ -285,7 +285,7 @@ float common_hal_mcu_processor_get_voltage(void) { adc_sync_set_reference(&adc, ADC_REFCTRL_REFSEL_INT1V_Val); #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X hri_supc_set_VREF_SEL_bf(SUPC, SUPC_VREF_SEL_1V0_Val); hri_supc_set_VREF_VREFOE_bit(SUPC); @@ -332,7 +332,7 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) { uint32_t* id_addresses[4] = {(uint32_t *) 0x0080A00C, (uint32_t *) 0x0080A040, (uint32_t *) 0x0080A044, (uint32_t *) 0x0080A048}; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X uint32_t* id_addresses[4] = {(uint32_t *) 0x008061FC, (uint32_t *) 0x00806010, (uint32_t *) 0x00806014, (uint32_t *) 0x00806018}; #endif diff --git a/ports/atmel-samd/common-hal/neopixel_write/__init__.c b/ports/atmel-samd/common-hal/neopixel_write/__init__.c index 5c79f72a40..43c8575cb3 100644 --- a/ports/atmel-samd/common-hal/neopixel_write/__init__.c +++ b/ports/atmel-samd/common-hal/neopixel_write/__init__.c @@ -31,7 +31,10 @@ #include "supervisor/port.h" -#ifdef SAMD51 +#if defined(SAME54) +#include "hri/hri_cmcc_e54.h" +#include "hri/hri_nvmctrl_e54.h" +#elif defined(SAMD51) #include "hri/hri_cmcc_d51.h" #include "hri/hri_nvmctrl_d51.h" #endif @@ -53,7 +56,7 @@ static void neopixel_send_buffer_core(volatile uint32_t *clraddr, uint32_t pinMa #ifdef SAMD21 " movs r6, #3; d2: sub r6, #1; bne d2;" // delay 3 #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X " movs r6, #3; d2: subs r6, #1; bne d2;" // delay 3 #endif " tst r4, r5;" // mask&r5 @@ -63,14 +66,14 @@ static void neopixel_send_buffer_core(volatile uint32_t *clraddr, uint32_t pinMa #ifdef SAMD21 " movs r6, #6; d0: sub r6, #1; bne d0;" // delay 6 #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X " movs r6, #6; d0: subs r6, #1; bne d0;" // delay 6 #endif " str r1, [r0, #0];" // clr (possibly again, doesn't matter) #ifdef SAMD21 " asr r4, r4, #1;" // mask >>= 1 #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X " asrs r4, r4, #1;" // mask >>= 1 #endif " beq nextbyte;" @@ -78,7 +81,7 @@ static void neopixel_send_buffer_core(volatile uint32_t *clraddr, uint32_t pinMa #ifdef SAMD21 " movs r6, #2; d1: sub r6, #1; bne d1;" // delay 2 #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X " movs r6, #2; d1: subs r6, #1; bne d1;" // delay 2 #endif " b loopBit;" @@ -108,7 +111,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout, mp_hal_disable_all_interrupts(); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X // When this routine is positioned at certain addresses, the timing logic // below can be too fast by about 2.5x. This is some kind of (un)fortunate code // positioning with respect to a cache line. @@ -135,7 +138,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout, volatile uint32_t *clr = &(port->OUTCLR.reg); neopixel_send_buffer_core(clr, pinMask, pixels, numBytes); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X // Turn instruction, data, and NVM caches back on. hri_cmcc_clear_CFG_reg(CMCC, CMCC_CFG_DCDIS | CMCC_CFG_ICDIS); hri_nvmctrl_clear_CTRLA_CACHEDIS0_bit(NVMCTRL); diff --git a/ports/atmel-samd/common-hal/os/__init__.c b/ports/atmel-samd/common-hal/os/__init__.c index eeba29dfaf..c151b105a8 100644 --- a/ports/atmel-samd/common-hal/os/__init__.c +++ b/ports/atmel-samd/common-hal/os/__init__.c @@ -30,7 +30,7 @@ #include "py/objtuple.h" #include "py/qstr.h" -#ifdef SAMD51 +#ifdef SAM_D5X_E5X #include "hal/include/hal_rand_sync.h" #endif @@ -42,7 +42,7 @@ STATIC const qstr os_uname_info_fields[] = { STATIC const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "samd21"); STATIC const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "samd21"); #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X STATIC const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "samd51"); STATIC const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "samd51"); #endif @@ -67,7 +67,7 @@ mp_obj_t common_hal_os_uname(void) { } bool common_hal_os_urandom(uint8_t* buffer, uint32_t length) { - #ifdef SAMD51 + #ifdef SAM_D5X_E5X hri_mclk_set_APBCMASK_TRNG_bit(MCLK); struct rand_sync_desc random; rand_sync_init(&random, TRNG); diff --git a/ports/atmel-samd/common-hal/pulseio/PWMOut.c b/ports/atmel-samd/common-hal/pulseio/PWMOut.c index b627dadc54..752f6c214b 100644 --- a/ports/atmel-samd/common-hal/pulseio/PWMOut.c +++ b/ports/atmel-samd/common-hal/pulseio/PWMOut.c @@ -55,7 +55,7 @@ uint8_t tcc_refcount[TCC_INST_NUM]; #ifdef SAMD21 uint8_t tcc_channels[3]; // Set by pwmout_reset() to {0xf0, 0xfc, 0xfc} initially. #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X uint8_t tcc_channels[5]; // Set by pwmout_reset() to {0xc0, 0xf0, 0xf8, 0xfc, 0xfc} initially. #endif @@ -148,7 +148,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, if (pin->timer[0].index >= TC_INST_NUM && pin->timer[1].index >= TCC_INST_NUM -#ifdef SAMD51 +#ifdef SAM_D5X_E5X && pin->timer[2].index >= TCC_INST_NUM #endif ) { @@ -260,7 +260,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, TC_CTRLA_WAVEGEN_MPWM; tc->COUNT16.CC[0].reg = top; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc->COUNT16.CTRLA.bit.SWRST = 1; while (tc->COUNT16.CTRLA.bit.SWRST == 1) { @@ -345,7 +345,7 @@ extern void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, #ifdef SAMD21 tc_insts[t->index]->COUNT16.CC[t->wave_output].reg = adjusted_duty; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X Tc* tc = tc_insts[t->index]; while (tc->COUNT16.SYNCBUSY.bit.CC1 != 0) {} tc->COUNT16.CCBUF[1].reg = adjusted_duty; @@ -366,7 +366,7 @@ extern void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, #ifdef SAMD21 tcc->CCB[channel].reg = adjusted_duty; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tcc->CCBUF[channel].reg = adjusted_duty; #endif tcc->CTRLBCLR.bit.LUPD = 1; @@ -396,7 +396,7 @@ uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) { cv = tcc->CC[channel].reg; } #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if ((tcc->STATUS.vec.CCBUFV & (1 << channel)) != 0) { cv = tcc->CCBUF[channel].reg; } else { @@ -444,7 +444,7 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, #ifdef SAMD21 tc->COUNT16.CC[0].reg = new_top; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X while (tc->COUNT16.SYNCBUSY.reg != 0) {} tc->COUNT16.CCBUF[0].reg = new_top; #endif @@ -461,7 +461,7 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, #ifdef SAMD21 tcc->PERB.bit.PERB = new_top; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tcc->PERBUF.bit.PERBUF = new_top; #endif } diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index 508ee8d385..7ea20321b2 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -79,7 +79,7 @@ void pulsein_interrupt_handler(uint8_t channel) { // Grab the current time first. uint32_t current_overflow = overflow_count; Tc* tc = tc_insts[pulsein_tc_index]; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc->COUNT16.CTRLBSET.reg = TC_CTRLBSET_CMD_READSYNC; while (tc->COUNT16.SYNCBUSY.bit.COUNT == 1 || tc->COUNT16.CTRLBSET.bit.CMD == TC_CTRLBSET_CMD_READSYNC_Val) {} @@ -173,7 +173,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, // We use GCLK0 for SAMD21 which is 48MHz. We prescale it to 3MHz. turn_on_clocks(true, index, 0); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X // We use GCLK5 for SAMD51 because it runs at 2MHz and we can use it for a 1MHz clock, // 1us per tick. turn_on_clocks(true, index, 5); @@ -185,7 +185,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, TC_CTRLA_PRESCALER_DIV16 | TC_CTRLA_WAVEGEN_NFRQ; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc_reset(tc); tc_set_enable(tc, false); tc->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 | TC_CTRLA_PRESCALER_DIV2; diff --git a/ports/atmel-samd/common-hal/pulseio/PulseOut.c b/ports/atmel-samd/common-hal/pulseio/PulseOut.c index 8b8bc6dc68..5c829f84db 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseOut.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseOut.c @@ -119,7 +119,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, #ifdef SAMD21 turn_on_clocks(true, index, 0); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X turn_on_clocks(true, index, 1); #endif @@ -129,7 +129,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, TC_CTRLA_PRESCALER_DIV64 | TC_CTRLA_WAVEGEN_NFRQ; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc_reset(tc); tc_set_enable(tc, false); tc->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 | TC_CTRLA_PRESCALER_DIV64; diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 1aa305cd30..354097ce41 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -65,13 +65,17 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// -#ifdef SAMD51 +#ifdef SAM_D5X_E5X -// HSRAM_SIZE is defined in the ASF4 include files for each SAMD51 chip. +// HSRAM_SIZE is defined in the ASF4 include files for each SAM_D5X_E5X chip. #define RAM_SIZE HSRAM_SIZE #define BOOTLOADER_SIZE (16*1024) #define CIRCUITPY_MCU_FAMILY samd51 +#ifdef SAMD51 #define MICROPY_PY_SYS_PLATFORM "MicroChip SAMD51" +#elif defined(SAME54) +#define MICROPY_PY_SYS_PLATFORM "MicroChip SAME54" +#endif #define SPI_FLASH_MAX_BAUDRATE 24000000 #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1) #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) @@ -81,7 +85,7 @@ #define MICROPY_PY_UJSON (1) // MICROPY_PY_UERRNO_LIST - Use the default -#endif // SAMD51 +#endif // SAM_D5X_E5X //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -115,7 +119,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// -#ifdef SAMD51 +#ifdef SAM_D5X_E5X #ifndef CIRCUITPY_INTERNAL_NVM_SIZE #define CIRCUITPY_INTERNAL_NVM_SIZE (8192) @@ -137,7 +141,7 @@ #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) #endif -#endif // SAMD51 +#endif // SAM_D5X_E5X //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/ports/atmel-samd/mphalport.c b/ports/atmel-samd/mphalport.c index 23a9b43300..b497b89cd8 100644 --- a/ports/atmel-samd/mphalport.c +++ b/ports/atmel-samd/mphalport.c @@ -58,7 +58,7 @@ extern uint32_t common_hal_mcu_processor_get_frequency(void); #ifdef SAMD21 #define DELAY_LOOP_ITERATIONS_PER_US ( (10U*48000000U) / common_hal_mcu_processor_get_frequency()) #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X #define DELAY_LOOP_ITERATIONS_PER_US ( (30U*120000000U) / common_hal_mcu_processor_get_frequency()) #endif diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 6b531fc923..e4161d7d6d 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 6b531fc923d9f02b14bd731a5f584ddf716e8773 +Subproject commit e4161d7d6d98d78eddcccb82128856af4baf7e50 diff --git a/ports/atmel-samd/supervisor/internal_flash.c b/ports/atmel-samd/supervisor/internal_flash.c index 9c8ff990ed..091959c4e6 100644 --- a/ports/atmel-samd/supervisor/internal_flash.c +++ b/ports/atmel-samd/supervisor/internal_flash.c @@ -39,6 +39,12 @@ #ifdef SAMD21 #include "hpl/pm/hpl_pm_base.h" #endif +#ifdef SAME54 +#include "hri/hri_mclk_e54.h" +#endif +#ifdef SAMD51 +#include "hri/hri_mclk_d51.h" +#endif #include "hal/include/hal_flash.h" #include "supervisor/flash.h" @@ -57,7 +63,7 @@ void supervisor_flash_init(void) { port_pin_set_output_level(MICROPY_HW_LED_MSC, false); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X hri_mclk_set_AHBMASK_NVMCTRL_bit(MCLK); #endif #ifdef SAMD21 diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 74c9849976..48bd3211b5 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -40,11 +40,14 @@ #include "hpl/gclk/hpl_gclk_base.h" #include "hpl/pm/hpl_pm_base.h" -#ifdef SAMD21 +#if defined(SAMD21) #include "hri/hri_pm_d21.h" -#endif -#ifdef SAMD51 +#elif defined(SAME54) +#include "hri/hri_rstc_e54.h" +#elif defined(SAMD51) #include "hri/hri_rstc_d51.h" +#else +#error Unknown chip family #endif #include "common-hal/analogio/AnalogIn.h" @@ -146,7 +149,7 @@ static void rtc_init(void) { RTC_MODE0_CTRL_MODE_COUNT32 | RTC_MODE0_CTRL_PRESCALER_DIV2; #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X hri_mclk_set_APBAMASK_RTC_bit(MCLK); RTC->MODE0.CTRLA.bit.SWRST = true; while (RTC->MODE0.SYNCBUSY.bit.SWRST != 0) {} @@ -169,7 +172,7 @@ static void rtc_init(void) { NVIC_SetPriority(USB_IRQn, 1); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X NVIC_SetPriority(USB_0_IRQn, 1); NVIC_SetPriority(USB_1_IRQn, 1); NVIC_SetPriority(USB_2_IRQn, 1); @@ -204,7 +207,7 @@ safe_mode_t port_init(void) { #endif #endif -#if defined(SAMD51) +#if defined(SAM_D5X_E5X) // Set brownout detection to ~2.7V. Default from factory is 1.7V, // which is too low for proper operation of external SPI flash chips (they are 2.7-3.6V). // Disable while changing level. @@ -283,7 +286,7 @@ safe_mode_t port_init(void) { return BROWNOUT; } #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (RSTC->RCAUSE.bit.BODVDD == 1 || RSTC->RCAUSE.bit.BODCORE == 1) { return BROWNOUT; } @@ -341,7 +344,7 @@ void reset_port(void) { // Output clocks for debugging. // not supported by SAMD51G; uncomment for SAMD51J or update for 51G - // #ifdef SAMD51 + // #ifdef SAM_D5X_E5X // gpio_set_pin_function(PIN_PA10, GPIO_PIN_FUNCTION_M); // GCLK4, D3 // gpio_set_pin_function(PIN_PA11, GPIO_PIN_FUNCTION_M); // GCLK5, A4 // gpio_set_pin_function(PIN_PB14, GPIO_PIN_FUNCTION_M); // GCLK0, D5 @@ -388,7 +391,7 @@ uint32_t *port_heap_get_top(void) { #ifdef SAMD21 uint32_t* safe_word = (uint32_t*) (HMCRAMC0_ADDR + HMCRAMC0_SIZE - 0x2000); #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X uint32_t* safe_word = (uint32_t*) (HSRAM_ADDR + HSRAM_SIZE - 0x2000); #endif @@ -412,7 +415,7 @@ void RTC_Handler(void) { // Our RTC is 32 bits and we're clocking it at 16.384khz which is 16 (2 ** 4) subticks per // tick. overflowed_ticks += (1L<< (32 - 4)); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X } else if (intflag & RTC_MODE0_INTFLAG_PER2) { RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_PER2; // Do things common to all ports when the tick occurs @@ -431,14 +434,14 @@ void RTC_Handler(void) { } } #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_CMP0; #endif } } static uint32_t _get_count(void) { - #ifdef SAMD51 + #ifdef SAM_D5X_E5X while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) {} #endif #ifdef SAMD21 @@ -459,7 +462,7 @@ uint64_t port_get_raw_ticks(uint8_t* subticks) { // Enable 1/1024 second tick. void port_enable_tick(void) { - #ifdef SAMD51 + #ifdef SAM_D5X_E5X // PER2 will generate an interrupt every 32 ticks of the source 32.768 clock. RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_PER2; #endif @@ -471,7 +474,7 @@ void port_enable_tick(void) { // Disable 1/1024 second tick. void port_disable_tick(void) { - #ifdef SAMD51 + #ifdef SAM_D5X_E5X RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_PER2; #endif #ifdef SAMD21 @@ -492,7 +495,7 @@ void port_interrupt_after_ticks(uint32_t ticks) { } void port_sleep_until_interrupt(void) { - #ifdef SAMD51 + #ifdef SAM_D5X_E5X // Clear the FPU interrupt because it can prevent us from sleeping. if (__get_FPSCR() & ~(0x9f)) { __set_FPSCR(__get_FPSCR() & ~(0x9f)); diff --git a/ports/atmel-samd/supervisor/same54_cpu.s b/ports/atmel-samd/supervisor/same54_cpu.s new file mode 100755 index 0000000000..9e6807a5e2 --- /dev/null +++ b/ports/atmel-samd/supervisor/same54_cpu.s @@ -0,0 +1,27 @@ +.syntax unified +.cpu cortex-m4 +.thumb +.text +.align 2 + +@ uint cpu_get_regs_and_sp(r0=uint regs[10]) +.global cpu_get_regs_and_sp +.thumb +.thumb_func +.type cpu_get_regs_and_sp, %function +cpu_get_regs_and_sp: +@ store registers into given array +str r4, [r0], #4 +str r5, [r0], #4 +str r6, [r0], #4 +str r7, [r0], #4 +str r8, [r0], #4 +str r9, [r0], #4 +str r10, [r0], #4 +str r11, [r0], #4 +str r12, [r0], #4 +str r13, [r0], #4 + +@ return the sp +mov r0, sp +bx lr diff --git a/ports/atmel-samd/supervisor/usb.c b/ports/atmel-samd/supervisor/usb.c index b8a94790d7..650ed6a397 100644 --- a/ports/atmel-samd/supervisor/usb.c +++ b/ports/atmel-samd/supervisor/usb.c @@ -37,7 +37,7 @@ void init_usb_hardware(void) { _gclk_enable_channel(USB_GCLK_ID, GCLK_CLKCTRL_GEN_GCLK0_Val); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X hri_gclk_write_PCHCTRL_reg(GCLK, USB_GCLK_ID, GCLK_PCHCTRL_GEN_GCLK1_Val | GCLK_PCHCTRL_CHEN); hri_mclk_set_AHBMASK_USB_bit(MCLK); hri_mclk_set_APBBMASK_USB_bit(MCLK); @@ -53,7 +53,7 @@ void init_usb_hardware(void) { gpio_set_pin_function(PIN_PA24, PINMUX_PA24G_USB_DM); gpio_set_pin_function(PIN_PA25, PINMUX_PA25G_USB_DP); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X gpio_set_pin_function(PIN_PA24, PINMUX_PA24H_USB_DM); gpio_set_pin_function(PIN_PA25, PINMUX_PA25H_USB_DP); #endif @@ -65,7 +65,7 @@ void USB_Handler(void) { } #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X void USB_0_Handler (void) { tud_int_handler(0); } From d5074220a8e80fb1cd6292b2159eecc3d4599d48 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 18 Jun 2020 14:16:57 -0500 Subject: [PATCH 0055/1293] atmel-samd: Add SAM E54 Xplained board Few peripherals are actually tested. However, USB, I2C and GPIO seem to work. Most pins are silkscreened with the "PX00" style, so the board module only includes the small number that are screened differently. The default SPI, I2C, and UART are the ones on the EXT2 header. This is arbitrary, but the I2C on this connector is shared with the on-board I2C devices and the PCC header, making it the most versatile. --- .github/workflows/build.yml | 1 + .../atmel-samd/boards/same54_xplained/board.c | 39 ++++++++ .../boards/same54_xplained/mpconfigboard.h | 33 +++++++ .../boards/same54_xplained/mpconfigboard.mk | 13 +++ .../atmel-samd/boards/same54_xplained/pins.c | 99 +++++++++++++++++++ supervisor/shared/external_flash/devices.h | 19 ++++ 6 files changed, 204 insertions(+) create mode 100644 ports/atmel-samd/boards/same54_xplained/board.c create mode 100644 ports/atmel-samd/boards/same54_xplained/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/same54_xplained/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9945024d24..fd357e78ef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -238,6 +238,7 @@ jobs: - "pyruler" - "robohatmm1_m4" - "sam32" + - "same54_xplained" - "seeeduino_xiao" - "serpente" - "shirtty" diff --git a/ports/atmel-samd/boards/same54_xplained/board.c b/ports/atmel-samd/boards/same54_xplained/board.c new file mode 100644 index 0000000000..7599f02b8e --- /dev/null +++ b/ports/atmel-samd/boards/same54_xplained/board.c @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 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 "boards/board.h" +#include "mpconfigboard.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/same54_xplained/mpconfigboard.h b/ports/atmel-samd/boards/same54_xplained/mpconfigboard.h new file mode 100644 index 0000000000..934559a2a4 --- /dev/null +++ b/ports/atmel-samd/boards/same54_xplained/mpconfigboard.h @@ -0,0 +1,33 @@ +#define MICROPY_HW_BOARD_NAME "SAM E54 Xplained Pro" +#define MICROPY_HW_MCU_NAME "same54p20" + +#define CIRCUITPY_MCU_FAMILY samd51 + +// This is for Rev B which is green and has the SD card slot at the edge of the board. + +#define MICROPY_HW_LED_STATUS (&pin_PC18) + +// These are pins not to reset. +// QSPI Data pins +#define MICROPY_PORT_A ( PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11 ) +// QSPI CS, and QSPI SCK +#define MICROPY_PORT_B ( PORT_PB10 | PORT_PB11 ) +#define MICROPY_PORT_C (0) +#define MICROPY_PORT_D (0) + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PD09) +#define DEFAULT_I2C_BUS_SDA (&pin_PD08) + +#define DEFAULT_SPI_BUS_SCK (&pin_PC05) +#define DEFAULT_SPI_BUS_MOSI (&pin_PC04) +#define DEFAULT_SPI_BUS_MISO (&pin_PC07) + +#define DEFAULT_UART_BUS_RX (&pin_PB17) +#define DEFAULT_UART_BUS_TX (&pin_PB16) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 +#define IGNORE_PIN_PC19 1 diff --git a/ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk b/ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk new file mode 100644 index 0000000000..ffc4f567f9 --- /dev/null +++ b/ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk @@ -0,0 +1,13 @@ +USB_VID = 0x239A +USB_PID = 0x80B6 +USB_PRODUCT = "SAM E54 Xplained Pro" +USB_MANUFACTURER = "Microchip" + +CHIP_VARIANT = SAME54P20A +CHIP_FAMILY = same54 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 2 +EXTERNAL_FLASH_DEVICES = "N25Q256A" +LONGINT_IMPL = MPZ +LONGINT_IMPL = MPZ diff --git a/ports/atmel-samd/boards/same54_xplained/pins.c b/ports/atmel-samd/boards/same54_xplained/pins.c new file mode 100644 index 0000000000..5b9373724e --- /dev/null +++ b/ports/atmel-samd/boards/same54_xplained/pins.c @@ -0,0 +1,99 @@ +#include "shared-bindings/board/__init__.h" + +// This mapping only includes functional names because pins broken +// out on connectors are labeled with their MCU name available from +// microcontroller.pin. +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PD08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PD09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_VSYNC), MP_ROM_PTR(&pin_PA12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_HSYNC), MP_ROM_PTR(&pin_PA13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PCLK), MP_ROM_PTR(&pin_PA14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_XCLK), MP_ROM_PTR(&pin_PA15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D07), MP_ROM_PTR(&pin_PA23) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D06), MP_ROM_PTR(&pin_PA22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D05), MP_ROM_PTR(&pin_PA21) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D04), MP_ROM_PTR(&pin_PA20) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D03), MP_ROM_PTR(&pin_PA19) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D02), MP_ROM_PTR(&pin_PA18) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D01), MP_ROM_PTR(&pin_PA17) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D00), MP_ROM_PTR(&pin_PA16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D09), MP_ROM_PTR(&pin_PB15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D08), MP_ROM_PTR(&pin_PB14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RST), MP_ROM_PTR(&pin_PC12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PWDN), MP_ROM_PTR(&pin_PC11) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_PDEC_A), MP_ROM_PTR(&pin_PC16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PDEC_B), MP_ROM_PTR(&pin_PC17) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PDEC_C), MP_ROM_PTR(&pin_PC18) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_ADCDAC), MP_ROM_PTR(&pin_PA02) }, + + + { MP_OBJ_NEW_QSTR(MP_QSTR_SW0), MP_ROM_PTR(&pin_PB31) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PC18) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_QT), MP_ROM_PTR(&pin_PA16) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_CANRX), MP_ROM_PTR(&pin_PB12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_CANTX), MP_ROM_PTR(&pin_PB13) }, + + // EXT1 header + { MP_OBJ_NEW_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PA27), MP_ROM_PTR(&pin_PA27) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC22), MP_ROM_PTR(&pin_PC22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PA23), MP_ROM_PTR(&pin_PA23) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB28), MP_ROM_PTR(&pin_PB28) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB27), MP_ROM_PTR(&pin_PB27) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB29), MP_ROM_PTR(&pin_PB29) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB26), MP_ROM_PTR(&pin_PB26) }, + + // EXT2 header + { MP_OBJ_NEW_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PD00), MP_ROM_PTR(&pin_PD00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB02), MP_ROM_PTR(&pin_PB02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB17), MP_ROM_PTR(&pin_PB17) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB16), MP_ROM_PTR(&pin_PB16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, + + // EXT3 header + { MP_OBJ_NEW_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PD11), MP_ROM_PTR(&pin_PD11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PD10), MP_ROM_PTR(&pin_PD10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC31), MP_ROM_PTR(&pin_PC31) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC30), MP_ROM_PTR(&pin_PC30) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC22), MP_ROM_PTR(&pin_PC22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC23), MP_ROM_PTR(&pin_PC23) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC14), MP_ROM_PTR(&pin_PC14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, + + { 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_global_dict_table); diff --git a/supervisor/shared/external_flash/devices.h b/supervisor/shared/external_flash/devices.h index 466ab49eb8..a874dbd4fd 100644 --- a/supervisor/shared/external_flash/devices.h +++ b/supervisor/shared/external_flash/devices.h @@ -618,4 +618,23 @@ typedef struct { .write_status_register_split = false, \ .single_status_byte = true, \ } + +// Settings for the Micron N25Q256A 256Mb (32MiB) QSPI flash. +// Datasheet: https://www.micron.com/-/media/client/global/documents/products/data-sheet/nor-flash/serial-nor/n25q/n25q_256mb_3v.pdf +#define N25Q256A {\ + /* .total_size = (1 << 25), 32 MiB does not work at this time, as assumptions about 3-byte addresses abound */ \ + .total_size = (1 << 24), /* 16 MiB */ \ + .start_up_time_us = 10000, \ + .manufacturer_id = 0x20, \ + .memory_type = 0xBA, \ + .capacity = 0x19, \ + .max_clock_speed_mhz = 108, \ + .quad_enable_bit_mask = 0x02, \ + .has_sector_protection = false, \ + .supports_fast_read = true, \ + .supports_qspi = true, \ + .supports_qspi_writes = true, \ + .write_status_register_split = false, \ + .single_status_byte = true, \ +} #endif // MICROPY_INCLUDED_ATMEL_SAMD_EXTERNAL_FLASH_DEVICES_H From 38659b566c5cd4c9be1a8340bdd801f394ce7084 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 10:56:27 -0500 Subject: [PATCH 0056/1293] atmel-samd: Finish disabling USB MIDI and/or HID on certain boards --- ports/atmel-samd/boards/8086_commander/mpconfigboard.mk | 1 + ports/atmel-samd/boards/pewpew10/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/ugame10/mpconfigboard.mk | 2 ++ .../boards/winterbloom_big_honking_button/mpconfigboard.mk | 1 + ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk | 2 ++ 5 files changed, 8 insertions(+) diff --git a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk index dcc62fc9bc..8f8f508ea4 100644 --- a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk +++ b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk @@ -14,6 +14,7 @@ EXTERNAL_FLASH_DEVICES = "W25Q128JV_SQ" LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 +CIRCUITPY_USB_MIDI = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index 7305abf73a..1ad2553a31 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -24,3 +24,5 @@ SUPEROPT_GC = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x CFLAGS_BOARD = --param max-inline-insns-auto=15 + +USB_DEVICES="CDC,MSC,HID" diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index 1c43369076..2ccaa9bdbd 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -39,3 +39,5 @@ CFLAGS_INLINE_LIMIT = 45 else CFLAGS_INLINE_LIMIT = 70 endif + +USB_DEVICES="CDC,MSC" diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk index 466e345911..d2477e9fdc 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk @@ -31,4 +31,5 @@ CIRCUITPY_TOUCHIO = 0 CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_USB_HID = 0 +CIRCUITPY_USB_MIDI = 0 CIRCUITPY_RTC = 0 diff --git a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk index 9309fdce0d..372b1f4912 100644 --- a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk +++ b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk @@ -28,3 +28,5 @@ CIRCUITPY_COUNTIO=0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD + +USB_DEVICES="CDC,MSC,HID" From 458eef052e732a5c8385d30c966b4c59cde2b15a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 10:57:25 -0500 Subject: [PATCH 0057/1293] esp32s2: Disable USB MIDI .. it was not in the USB descriptors anyway (lack of enough endpoints?) --- ports/esp32s2/mpconfigport.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index c9df81db03..040022052c 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -30,8 +30,8 @@ CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_TOUCHIO = 0 -# Enable USB support +# Enable USB HID support CIRCUITPY_USB_HID = 1 -CIRCUITPY_USB_MIDI = 1 +CIRCUITPY_USB_MIDI = 0 CIRCUITPY_MODULE ?= none From 3f112d28e3ef4ba15e8e0829abbbba6e411977f9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 10:57:32 -0500 Subject: [PATCH 0058/1293] mimxrt10xx: Disable USB MIDI .. it was not in the USB descriptors anyway (lack of enough endpoints?) --- ports/mimxrt10xx/mpconfigport.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index e9e554142c..8162d43279 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -27,4 +27,5 @@ CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_COUNTIO = 0 +CIRCUITPY_USB_MIDI = 0 LONGINT_IMPL = MPZ From 0110463811869e187556e5ed8033c280a7199aa5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 11:01:08 -0500 Subject: [PATCH 0059/1293] stm: Disable USB MIDI and most USB HID .. it was not in the USB descriptors anyway (lack of enough endpoints?) --- ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk | 2 ++ ports/stm/mpconfigport.mk | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk index 04d2a9b0d0..a2a322dfab 100644 --- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk @@ -17,3 +17,5 @@ MCU_PACKAGE = LQFP144 LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F412_fs.ld + +CIRCUITPY_USB_HID = 1 diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 0c5247d952..09db525bd8 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -21,6 +21,8 @@ ifeq ($(MCU_SERIES),F4) ifndef CIRCUITPY_NVM CIRCUITPY_NVM = 0 endif + CIRCUITPY_USB_MIDI ?= 0 + CIRCUITPY_USB_HID ?= 0 endif ifeq ($(MCU_SERIES),H7) @@ -36,6 +38,8 @@ ifeq ($(MCU_SERIES),H7) CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 + CIRCUITPY_USB_MIDI ?= 0 + CIRCUITPY_USB_HID ?= 0 endif ifeq ($(MCU_SERIES),F7) @@ -50,4 +54,6 @@ ifeq ($(MCU_SERIES),F7) CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 + CIRCUITPY_USB_MIDI ?= 0 + CIRCUITPY_USB_HID ?= 0 endif From 93d3629da279ae080cdfa616d54451150b373697 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 11:02:38 -0500 Subject: [PATCH 0060/1293] stm: Sort configuration options and make them all conditional This makes them all overridable on the board level, tersely --- ports/stm/mpconfigport.mk | 77 +++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 09db525bd8..7b720d1564 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -1,59 +1,56 @@ -MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz -LONGINT_IMPL = MPZ -INTERNAL_LIBM = 1 -USB_SERIAL_NUMBER_LENGTH = 24 +MPY_TOOL_LONGINT_IMPL ?= -mlongint-impl=mpz +LONGINT_IMPL ?= MPZ +INTERNAL_LIBM ?= 1 +USB_SERIAL_NUMBER_LENGTH ?= 24 ifeq ($(MCU_VARIANT),STM32F405xx) - CIRCUITPY_FRAMEBUFFERIO = 1 - CIRCUITPY_RGBMATRIX = 1 + CIRCUITPY_FRAMEBUFFERIO ?= 1 + CIRCUITPY_RGBMATRIX ?= 1 endif ifeq ($(MCU_SERIES),F4) # Not yet implemented common-hal modules: - CIRCUITPY_AUDIOBUSIO = 0 - CIRCUITPY_AUDIOIO = 0 - CIRCUITPY_ROTARYIO = 0 - CIRCUITPY_COUNTIO = 0 - CIRCUITPY_RTC = 0 - CIRCUITPY_FREQUENCYIO = 0 - CIRCUITPY_I2CSLAVE = 0 - # Can be overridden on board level - ifndef CIRCUITPY_NVM - CIRCUITPY_NVM = 0 - endif + CIRCUITPY_AUDIOBUSIO ?= 0 + CIRCUITPY_AUDIOIO ?= 0 + CIRCUITPY_COUNTIO ?= 0 + CIRCUITPY_FREQUENCYIO ?= 0 + CIRCUITPY_I2CSLAVE ?= 0 + CIRCUITPY_NVM ?= 0 + CIRCUITPY_ROTARYIO ?= 0 + CIRCUITPY_RTC ?= 0 CIRCUITPY_USB_MIDI ?= 0 CIRCUITPY_USB_HID ?= 0 endif ifeq ($(MCU_SERIES),H7) # Not yet implemented common-hal modules: - CIRCUITPY_ANALOGIO = 0 - CIRCUITPY_NEOPIXEL_WRITE = 0 - CIRCUITPY_PULSEIO = 0 - CIRCUITPY_NVM = 0 - CIRCUITPY_AUDIOBUSIO = 0 - CIRCUITPY_AUDIOIO = 0 - CIRCUITPY_COUNTIO = 0 - CIRCUITPY_ROTARYIO = 0 - CIRCUITPY_RTC = 0 - CIRCUITPY_FREQUENCYIO = 0 - CIRCUITPY_I2CSLAVE = 0 - CIRCUITPY_USB_MIDI ?= 0 + CIRCUITPY_ANALOGIO ?= 0 + CIRCUITPY_AUDIOBUSIO ?= 0 + CIRCUITPY_AUDIOIO ?= 0 + CIRCUITPY_COUNTIO ?= 0 + CIRCUITPY_FREQUENCYIO ?= 0 + CIRCUITPY_I2CSLAVE ?= 0 + CIRCUITPY_NEOPIXEL_WRITE ?= 0 + CIRCUITPY_NVM ?= 0 + CIRCUITPY_PULSEIO ?= 0 + CIRCUITPY_ROTARYIO ?= 0 + CIRCUITPY_RTC ?= 0 CIRCUITPY_USB_HID ?= 0 + CIRCUITPY_USB_MIDI ?= 0 endif ifeq ($(MCU_SERIES),F7) # Not yet implemented common-hal modules: - CIRCUITPY_ANALOGIO = 0 - CIRCUITPY_NEOPIXEL_WRITE = 0 - CIRCUITPY_NVM = 0 - CIRCUITPY_AUDIOBUSIO = 0 - CIRCUITPY_AUDIOIO = 0 - CIRCUITPY_ROTARYIO = 0 - CIRCUITPY_COUNTIO = 0 - CIRCUITPY_RTC = 0 - CIRCUITPY_FREQUENCYIO = 0 - CIRCUITPY_I2CSLAVE = 0 - CIRCUITPY_USB_MIDI ?= 0 + CIRCUITPY_ANALOGIO ?= 0 + CIRCUITPY_AUDIOBUSIO ?= 0 + CIRCUITPY_AUDIOIO ?= 0 + CIRCUITPY_COUNTIO ?= 0 + CIRCUITPY_FREQUENCYIO ?= 0 + CIRCUITPY_I2CSLAVE ?= 0 + CIRCUITPY_NEOPIXEL_WRITE ?= 0 + CIRCUITPY_NVM ?= 0 + CIRCUITPY_ROTARYIO ?= 0 + CIRCUITPY_RTC ?= 0 CIRCUITPY_USB_HID ?= 0 + CIRCUITPY_USB_MIDI ?= 0 endif From b80abf1a90b515fff1503b75358e629fb248660c Mon Sep 17 00:00:00 2001 From: DavePutz Date: Tue, 23 Jun 2020 12:15:01 -0500 Subject: [PATCH 0061/1293] Update handing of a CTRL-C exception --- supervisor/shared/tick.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 106ff53f89..dd7dba8f3e 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -106,7 +106,7 @@ void mp_hal_delay_ms(mp_uint_t delay) { { // clear exception and generate stacktrace MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; - nlr_raise(mp_obj_new_exception(&mp_type_KeyboardInterrupt)); + nlr_raise(&MP_STATE_VM(mp_kbd_exception)); } if( MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || WATCHDOG_EXCEPTION_CHECK()) { From f232aef7865c4e094f060f9766418f60fb9f86ea Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 15 Jun 2020 19:12:04 -0500 Subject: [PATCH 0062/1293] supervisor.mk: Compute USB_DEVICES; remove from boards and ports Since Actions passed on the previous commit, where this computed value was checked against the specified value (if any), this is no net change, except that we no longer need to specify it for particular boards or ports. --- .../boards/8086_commander/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/pewpew10/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/ugame10/mpconfigboard.mk | 2 -- .../winterbloom_big_honking_button/mpconfigboard.mk | 1 - .../boards/winterbloom_sol/mpconfigboard.mk | 1 - .../atmel-samd/boards/xinabox_cs11/mpconfigboard.mk | 2 -- ports/cxd56/mpconfigport.mk | 1 - .../boards/espressif_saola_1_wroom/mpconfigboard.mk | 1 - .../boards/espressif_saola_1_wrover/mpconfigboard.mk | 1 - ports/litex/boards/fomu/mpconfigboard.mk | 1 - ports/mimxrt10xx/mpconfigport.mk | 1 - ports/stm/boards/espruino_pico/mpconfigboard.mk | 1 - ports/stm/boards/espruino_wifi/mpconfigboard.mk | 1 - .../feather_stm32f405_express/mpconfigboard.mk | 1 - ports/stm/boards/meowbit_v121/mpconfigboard.mk | 1 - ports/stm/boards/nucleo_f746zg/mpconfigboard.mk | 1 - ports/stm/boards/nucleo_f767zi/mpconfigboard.mk | 1 - ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk | 1 - ports/stm/boards/openmv_h7/mpconfigboard.mk | 1 - ports/stm/boards/pyb_nano_v2/mpconfigboard.mk | 1 - ports/stm/boards/pyboard_v11/mpconfigboard.mk | 1 - .../boards/stm32f411ce_blackpill/mpconfigboard.mk | 1 - .../boards/stm32f411ve_discovery/mpconfigboard.mk | 1 - .../boards/stm32f412zg_discovery/mpconfigboard.mk | 1 - ports/stm/boards/stm32f4_discovery/mpconfigboard.mk | 1 - .../stm/boards/stm32f746g_discovery/mpconfigboard.mk | 1 - ports/stm/boards/thunderpack/mpconfigboard.mk | 1 - supervisor/supervisor.mk | 12 +----------- 29 files changed, 1 insertion(+), 44 deletions(-) diff --git a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk index 8f8f508ea4..4b0377be25 100644 --- a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk +++ b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk @@ -3,8 +3,6 @@ USB_PID = 0x0101 USB_PRODUCT = "Commander" USB_MANUFACTURER = "8086 Consultancy" -USB_DEVICES= "CDC,MSC,HID" - CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index 1ad2553a31..7305abf73a 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -24,5 +24,3 @@ SUPEROPT_GC = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x CFLAGS_BOARD = --param max-inline-insns-auto=15 - -USB_DEVICES="CDC,MSC,HID" diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index 87f92ae9ec..864d31909d 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -46,8 +46,6 @@ CIRCUITPY_MATH = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pewpew_m4 CIRCUITPY_DISPLAY_FONT = $(TOP)/ports/atmel-samd/boards/ugame10/brutalist-6.bdf -USB_DEVICES = "CDC,MSC" - # Tweak inlining depending on language. ifeq ($(TRANSLATION), zh_Latn_pinyin) CFLAGS_INLINE_LIMIT = 45 diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index 2ccaa9bdbd..1c43369076 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -39,5 +39,3 @@ CFLAGS_INLINE_LIMIT = 45 else CFLAGS_INLINE_LIMIT = 70 endif - -USB_DEVICES="CDC,MSC" diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk index d2477e9fdc..de9b617649 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk @@ -4,7 +4,6 @@ USB_VID = 0x239A USB_PID = 0x6005 USB_PRODUCT = "Big Honking Button" USB_MANUFACTURER = "Winterbloom" -USB_DEVICES = "CDC,MSC" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 diff --git a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk index 6a78a4ff99..e96497b3e5 100644 --- a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk @@ -6,7 +6,6 @@ USB_PID = 0x8062 USB_PRODUCT = "Sol" USB_MANUFACTURER = "Winterbloom" USB_INTERFACE_NAME = "Sol" -USB_DEVICES = "CDC,MSC,AUDIO" CHIP_VARIANT = SAMD51J20A CHIP_FAMILY = samd51 diff --git a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk index 372b1f4912..9309fdce0d 100644 --- a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk +++ b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk @@ -28,5 +28,3 @@ CIRCUITPY_COUNTIO=0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD - -USB_DEVICES="CDC,MSC,HID" diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 5894b9b73b..d91458aca3 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -1,5 +1,4 @@ USB_SERIAL_NUMBER_LENGTH = 10 -USB_DEVICES = "CDC,MSC" USB_MSC_MAX_PACKET_SIZE = 512 USB_RENUMBER_ENDPOINTS = 0 USB_CDC_EP_NUM_NOTIFICATION = 3 diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk index cd27356153..d9ad568863 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x80A8 USB_PRODUCT = "Saola 1 w/WROOM" USB_MANUFACTURER = "Espressif" -USB_DEVICES = "CDC,MSC,HID" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk index 0b847de943..558b1144a9 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x80A6 USB_PRODUCT = "Saola 1 w/WROVER" USB_MANUFACTURER = "Espressif" -USB_DEVICES = "CDC,MSC,HID" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/litex/boards/fomu/mpconfigboard.mk b/ports/litex/boards/fomu/mpconfigboard.mk index 4787803ccd..c8de94e9c0 100644 --- a/ports/litex/boards/fomu/mpconfigboard.mk +++ b/ports/litex/boards/fomu/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x1209 USB_PID = 0x5BF0 USB_PRODUCT = "Fomu" USB_MANUFACTURER = "Foosn" -USB_DEVICES = "CDC,MSC,AUDIO,HID" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index 8162d43279..49d9985083 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -14,7 +14,6 @@ endif INTERNAL_LIBM = 1 -USB_DEVICES = "CDC,MSC,HID" USB_SERIAL_NUMBER_LENGTH = 32 USB_MSC_MAX_PACKET_SIZE = 512 diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.mk b/ports/stm/boards/espruino_pico/mpconfigboard.mk index 054937c33e..201237c9d6 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.mk +++ b/ports/stm/boards/espruino_pico/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x808E USB_PRODUCT = "Espruino Pico" USB_MANUFACTURER = "Espruino" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/espruino_wifi/mpconfigboard.mk b/ports/stm/boards/espruino_wifi/mpconfigboard.mk index ee82095ffd..9500a5f185 100644 --- a/ports/stm/boards/espruino_wifi/mpconfigboard.mk +++ b/ports/stm/boards/espruino_wifi/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x8090 USB_PRODUCT = "Espruino Wifi" USB_MANUFACTURER = "Espruino" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk index d98bd29ec7..2b2c0d6db5 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x805A USB_PRODUCT = "Feather STM32F405 Express" USB_MANUFACTURER = "Adafruit Industries LLC" -USB_DEVICES = "CDC,MSC" SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk index cf60c89c26..127cdb60e2 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x805A USB_PRODUCT = "Meowbit" USB_MANUFACTURER = "Kittenbot" -USB_DEVICES = "CDC,MSC" SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk index 651f3c2292..1c8edecc35 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x809E USB_PRODUCT = "Nucleo F746zg - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk index c5d956b994..0c712a0f48 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x809A USB_PRODUCT = "Nucleo F767ZI - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk index ea99a1e10b..35f47e1931 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x8098 USB_PRODUCT = "Nucleo H743ZI - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.mk b/ports/stm/boards/openmv_h7/mpconfigboard.mk index 4ff0f18d54..a837dc9ec7 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.mk +++ b/ports/stm/boards/openmv_h7/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x80A4 USB_PRODUCT = "OpenMV-H7 R1" USB_MANUFACTURER = "OpenMV, LLC" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk index 08a2668167..237dba921e 100644 --- a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk +++ b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x8068 USB_PRODUCT = "PYB LR Nano V2" USB_MANUFACTURER = "MicroPython Chinese Community" -USB_DEVICES = "CDC,MSC" SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 diff --git a/ports/stm/boards/pyboard_v11/mpconfigboard.mk b/ports/stm/boards/pyboard_v11/mpconfigboard.mk index c0c0f5f6cd..78b96e55fc 100644 --- a/ports/stm/boards/pyboard_v11/mpconfigboard.mk +++ b/ports/stm/boards/pyboard_v11/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x805C USB_PRODUCT = "Pyboard Version 1.1" USB_MANUFACTURER = "George Robotic" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk index 0054232e1d..9b45a0fac7 100644 --- a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk +++ b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x806A USB_PRODUCT = "stm32f411ce blackpill" USB_MANUFACTURER = "Unknown" -USB_DEVICES = "CDC,MSC" # SPI_FLASH_FILESYSTEM = 1 # EXTERNAL_FLASH_DEVICE_COUNT = 1 diff --git a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk index ca2f10ba37..3cb7162a4a 100644 --- a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x805E USB_PRODUCT = "STM32F411VE Discovery Board - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk index a2a322dfab..c99eb1a008 100644 --- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x8056 USB_PRODUCT = "STM32F412ZG Discovery Board - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC,HID" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk index 09652d9ad9..7eece58968 100644 --- a/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x808A USB_PRODUCT = "STM32F407VG Discovery Board - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk index 94a50853cb..c1c754ab5b 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x809C USB_PRODUCT = "ST STM32F746G Discovery - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/thunderpack/mpconfigboard.mk b/ports/stm/boards/thunderpack/mpconfigboard.mk index 007b00cdd1..afd0ffd751 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x806A USB_PRODUCT = "Thunderpack STM32F411" USB_MANUFACTURER = "Jeremy Gillick" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 7eb7e26305..0717785e7f 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -115,10 +115,6 @@ ifndef USB_INTERFACE_NAME USB_INTERFACE_NAME = "CircuitPython" endif -ifndef USB_DEVICES -USB_DEVICES = "CDC,MSC,AUDIO,HID" -endif - USB_DEVICES_COMPUTED := CDC,MSC ifeq ($(CIRCUITPY_USB_MIDI),1) USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),AUDIO @@ -126,18 +122,12 @@ endif ifeq ($(CIRCUITPY_USB_HID),1) USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),HID endif -USB_DEVICES_COMPUTED := "$(USB_DEVICES_COMPUTED)" +USB_DEVICES := "$(USB_DEVICES_COMPUTED)" ifndef USB_HID_DEVICES USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD" endif -# During a transitional period, check that the COMPUTED values match. -# Once they do all match, we can remove all the hard-coded ones. -ifneq ($(USB_DEVICES),$(USB_DEVICES_COMPUTED)) -$(error Computed USB devices '$(USB_DEVICES_COMPUTED)' different than hard-coded USB devices '$(USB_DEVICES)') -endif - ifndef USB_MSC_MAX_PACKET_SIZE USB_MSC_MAX_PACKET_SIZE = 64 endif From 84f424f6310bd9315d2dc002ff59b1802bcc1e8b Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Tue, 16 Jun 2020 20:39:56 +0200 Subject: [PATCH 0063/1293] gnss: Implement new library for GNSS --- py/circuitpy_defns.mk | 7 + py/circuitpy_mpconfig.h | 8 + py/circuitpy_mpconfig.mk | 3 + shared-bindings/gnss/GNSS.c | 245 +++++++++++++++++++++++++ shared-bindings/gnss/GNSS.h | 50 +++++ shared-bindings/gnss/PositionFix.c | 108 +++++++++++ shared-bindings/gnss/PositionFix.h | 50 +++++ shared-bindings/gnss/SatelliteSystem.c | 145 +++++++++++++++ shared-bindings/gnss/SatelliteSystem.h | 55 ++++++ shared-bindings/gnss/__init__.c | 53 ++++++ 10 files changed, 724 insertions(+) create mode 100644 shared-bindings/gnss/GNSS.c create mode 100644 shared-bindings/gnss/GNSS.h create mode 100644 shared-bindings/gnss/PositionFix.c create mode 100644 shared-bindings/gnss/PositionFix.h create mode 100644 shared-bindings/gnss/SatelliteSystem.c create mode 100644 shared-bindings/gnss/SatelliteSystem.h create mode 100644 shared-bindings/gnss/__init__.c diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index fb8f46bd87..95824be1e8 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -162,6 +162,9 @@ endif ifeq ($(CIRCUITPY_GAMEPADSHIFT),1) SRC_PATTERNS += gamepadshift/% endif +ifeq ($(CIRCUITPY_GNSS),1) +SRC_PATTERNS += gnss/% +endif ifeq ($(CIRCUITPY_I2CSLAVE),1) SRC_PATTERNS += i2cslave/% endif @@ -283,6 +286,10 @@ SRC_COMMON_HAL_ALL = \ displayio/ParallelBus.c \ frequencyio/FrequencyIn.c \ frequencyio/__init__.c \ + gnss/__init__.c \ + gnss/GNSS.c \ + gnss/PositionFix.c \ + gnss/SatelliteSystem.c \ i2cslave/I2CSlave.c \ i2cslave/__init__.c \ microcontroller/Pin.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 3fbb469000..4b054b83ce 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -401,6 +401,13 @@ extern const struct _mp_obj_module_t gamepadshift_module; #define GAMEPAD_ROOT_POINTERS #endif +#if CIRCUITPY_GNSS +extern const struct _mp_obj_module_t gnss_module; +#define GNSS_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_gnss), (mp_obj_t)&gnss_module }, +#else +#define GNSS_MODULE +#endif + #if CIRCUITPY_I2CSLAVE extern const struct _mp_obj_module_t i2cslave_module; #define I2CSLAVE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_i2cslave), (mp_obj_t)&i2cslave_module }, @@ -682,6 +689,7 @@ extern const struct _mp_obj_module_t watchdog_module; FREQUENCYIO_MODULE \ GAMEPAD_MODULE \ GAMEPADSHIFT_MODULE \ + GNSS_MODULE \ I2CSLAVE_MODULE \ JSON_MODULE \ MATH_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 865654a0d5..ac7d2ec305 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -109,6 +109,9 @@ CFLAGS += -DCIRCUITPY_GAMEPAD=$(CIRCUITPY_GAMEPAD) CIRCUITPY_GAMEPADSHIFT ?= 0 CFLAGS += -DCIRCUITPY_GAMEPADSHIFT=$(CIRCUITPY_GAMEPADSHIFT) +CIRCUITPY_GNSS ?= 0 +CFLAGS += -DCIRCUITPY_GNSS=$(CIRCUITPY_GNSS) + CIRCUITPY_I2CSLAVE ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_I2CSLAVE=$(CIRCUITPY_I2CSLAVE) diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c new file mode 100644 index 0000000000..37c25cf849 --- /dev/null +++ b/shared-bindings/gnss/GNSS.c @@ -0,0 +1,245 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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 "shared-bindings/gnss/GNSS.h" +#include "shared-bindings/util.h" + +#include "py/objproperty.h" +#include "py/runtime.h" + +//| class GNSS: +//| """Get updated positioning information from GNSS +//| +//| Usage:: +//| +//| import gnss +//| import time +//| +//| gps = gnss.GNSS() +//| gps.select(gnss.SatelliteSystem.GPS) +//| gps.start() +//| last_print = time.monotonic() +//| while True: +//| gps.update() +//| current = time.monotonic() +//| if current - last_print >= 1.0: +//| last_print = current +//| if gps.fix is gnss.PositionFix.INVALID: +//| print("Waiting for fix...") +//| continue +//| print("Latitude: {0:.6f} degrees".format(gps.latitude)) +//| print("Longitude: {0:.6f} degrees".format(gps.longitude))""" +//| + +//| def __init__(self, ): +//| """Turn on the GNSS.""" +//| ... +//| +STATIC mp_obj_t gnss_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + gnss_obj_t *self = m_new_obj(gnss_obj_t); + self->base.type = &gnss_type; + + common_hal_gnss_construct(self); + return MP_OBJ_FROM_PTR(self); +} + +//| def deinit(self, ) -> Any: +//| """Turn off the GNSS.""" +//| ... +//| +STATIC mp_obj_t gnss_obj_deinit(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_gnss_deinit(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_deinit_obj, gnss_obj_deinit); + +STATIC void check_for_deinit(gnss_obj_t *self) { + if (common_hal_gnss_deinited(self)) { + raise_deinited_error(); + } +} + +//| def select(self, system: gnss.SatelliteSystem) -> Any: +//| """Add specified satellite system to selection for positioning. +//| +//| :param gnss.SatelliteSystem system: satellite system to use""" +//| ... +//| +STATIC mp_obj_t gnss_obj_select(mp_obj_t self_in, mp_obj_t system_obj) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + gnss_satellitesystem_t system = gnss_satellitesystem_obj_to_type(system_obj); + common_hal_gnss_select(self, system); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(gnss_select_obj, gnss_obj_select); + +//| def deselect(self, system: gnss.SatelliteSystem) -> Any: +//| """Remove specified satellite system from selection for positioning. +//| +//| :param gnss.SatelliteSystem system: satellite system to remove""" +//| ... +//| +STATIC mp_obj_t gnss_obj_deselect(mp_obj_t self_in, mp_obj_t system_obj) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + gnss_satellitesystem_t system = gnss_satellitesystem_obj_to_type(system_obj); + common_hal_gnss_deselect(self, system); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(gnss_deselect_obj, gnss_obj_deselect); + +//| def start(self, ) -> Any: +//| """Start positioning.""" +//| ... +//| +STATIC mp_obj_t gnss_obj_start(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + common_hal_gnss_start(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_start_obj, gnss_obj_start); + +//| def stop(self, ) -> Any: +//| """Stop positioning.""" +//| ... +//| +STATIC mp_obj_t gnss_obj_stop(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + common_hal_gnss_stop(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_stop_obj, gnss_obj_stop); + +//| def update(self, ) -> Any: +//| """Update GNSS positioning information.""" +//| ... +//| +STATIC mp_obj_t gnss_obj_update(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + common_hal_gnss_update(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_update_obj, gnss_obj_update); + +//| latitude: Any = ... +//| """Latitude of current position.""" +//| +STATIC mp_obj_t gnss_obj_get_latitude(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_float(common_hal_gnss_get_latitude(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_latitude_obj, gnss_obj_get_latitude); + +const mp_obj_property_t gnss_latitude_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&gnss_get_latitude_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| longitude: Any = ... +//| """Longitude of current position.""" +//| +STATIC mp_obj_t gnss_obj_get_longitude(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_float(common_hal_gnss_get_longitude(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_longitude_obj, gnss_obj_get_longitude); + +const mp_obj_property_t gnss_longitude_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&gnss_get_longitude_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| altitude: Any = ... +//| """Altitude of current position.""" +//| +STATIC mp_obj_t gnss_obj_get_altitude(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_float(common_hal_gnss_get_altitude(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_altitude_obj, gnss_obj_get_altitude); + +const mp_obj_property_t gnss_altitude_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&gnss_get_altitude_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| fix: Any = ... +//| """Fix mode.""" +//| +STATIC mp_obj_t gnss_obj_get_fix(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return gnss_positionfix_type_to_obj(common_hal_gnss_get_fix(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_fix_obj, gnss_obj_get_fix); + +const mp_obj_property_t gnss_fix_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&gnss_get_fix_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +STATIC const mp_rom_map_elem_t gnss_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&gnss_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_select), MP_ROM_PTR(&gnss_select_obj) }, + { MP_ROM_QSTR(MP_QSTR_deselect), MP_ROM_PTR(&gnss_deselect_obj) }, + { MP_ROM_QSTR(MP_QSTR_start), MP_ROM_PTR(&gnss_start_obj) }, + { MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&gnss_stop_obj) }, + { MP_ROM_QSTR(MP_QSTR_update), MP_ROM_PTR(&gnss_update_obj) }, + + { MP_ROM_QSTR(MP_QSTR_latitude), MP_ROM_PTR(&gnss_latitude_obj) }, + { MP_ROM_QSTR(MP_QSTR_longitude), MP_ROM_PTR(&gnss_longitude_obj) }, + { MP_ROM_QSTR(MP_QSTR_altitude), MP_ROM_PTR(&gnss_altitude_obj) }, + { MP_ROM_QSTR(MP_QSTR_fix), MP_ROM_PTR(&gnss_fix_obj) } +}; +STATIC MP_DEFINE_CONST_DICT(gnss_locals_dict, gnss_locals_dict_table); + +const mp_obj_type_t gnss_type = { + { &mp_type_type }, + .name = MP_QSTR_GNSS, + .make_new = gnss_make_new, + .locals_dict = (mp_obj_dict_t*)&gnss_locals_dict, +}; diff --git a/shared-bindings/gnss/GNSS.h b/shared-bindings/gnss/GNSS.h new file mode 100644 index 0000000000..953eb9ce31 --- /dev/null +++ b/shared-bindings/gnss/GNSS.h @@ -0,0 +1,50 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_GNSS_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_GNSS_H + +#include "common-hal/gnss/GNSS.h" +#include "shared-bindings/gnss/SatelliteSystem.h" +#include "shared-bindings/gnss/PositionFix.h" + +extern const mp_obj_type_t gnss_type; + +void common_hal_gnss_construct(gnss_obj_t *self); +void common_hal_gnss_deinit(gnss_obj_t *self); +bool common_hal_gnss_deinited(gnss_obj_t *self); +void common_hal_gnss_select(gnss_obj_t *self, gnss_satellitesystem_t system); +void common_hal_gnss_deselect(gnss_obj_t *self, gnss_satellitesystem_t system); +void common_hal_gnss_start(gnss_obj_t *self); +void common_hal_gnss_stop(gnss_obj_t *self); +void common_hal_gnss_update(gnss_obj_t *self); + +mp_float_t common_hal_gnss_get_latitude(gnss_obj_t *self); +mp_float_t common_hal_gnss_get_longitude(gnss_obj_t *self); +mp_float_t common_hal_gnss_get_altitude(gnss_obj_t *self); +gnss_positionfix_t common_hal_gnss_get_fix(gnss_obj_t *self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_GNSS_H diff --git a/shared-bindings/gnss/PositionFix.c b/shared-bindings/gnss/PositionFix.c new file mode 100644 index 0000000000..106a28c347 --- /dev/null +++ b/shared-bindings/gnss/PositionFix.c @@ -0,0 +1,108 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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 "shared-bindings/gnss/PositionFix.h" + +//| class PositionFix: +//| """Position fix mode""" +//| +//| def __init__(self, ): +//| """Enum-like class to define the position fix mode.""" +//| +//| INVALID: Any = ... +//| """No measurement. +//| +//| :type gnss.PositionFix:""" +//| +//| FIX_2D: Any = ... +//| """2D fix. +//| +//| :type gnss.PositionFix:""" +//| +//| FIX_3D: Any = ... +//| """3D fix. +//| +//| :type gnss.PositionFix:""" +//| +const mp_obj_type_t gnss_positionfix_type; + +const gnss_positionfix_obj_t gnss_positionfix_invalid_obj = { + { &gnss_positionfix_type }, +}; + +const gnss_positionfix_obj_t gnss_positionfix_fix2d_obj = { + { &gnss_positionfix_type }, +}; + +const gnss_positionfix_obj_t gnss_positionfix_fix3d_obj = { + { &gnss_positionfix_type }, +}; + +gnss_positionfix_t gnss_positionfix_obj_to_type(mp_obj_t obj) { + gnss_positionfix_t posfix = POSITIONFIX_INVALID; + if (obj == MP_ROM_PTR(&gnss_positionfix_fix2d_obj)) { + posfix = POSITIONFIX_2D; + } else if (obj == MP_ROM_PTR(&gnss_positionfix_fix3d_obj)) { + posfix = POSITIONFIX_3D; + } + return posfix; +} + +mp_obj_t gnss_positionfix_type_to_obj(gnss_positionfix_t posfix) { + switch (posfix) { + case POSITIONFIX_2D: + return (mp_obj_t)MP_ROM_PTR(&gnss_positionfix_fix2d_obj); + case POSITIONFIX_3D: + return (mp_obj_t)MP_ROM_PTR(&gnss_positionfix_fix3d_obj); + case POSITIONFIX_INVALID: + default: + return (mp_obj_t)MP_ROM_PTR(&gnss_positionfix_invalid_obj); + } +} + +STATIC const mp_rom_map_elem_t gnss_positionfix_locals_dict_table[] = { + {MP_ROM_QSTR(MP_QSTR_INVALID), MP_ROM_PTR(&gnss_positionfix_invalid_obj)}, + {MP_ROM_QSTR(MP_QSTR_FIX_2D), MP_ROM_PTR(&gnss_positionfix_fix2d_obj)}, + {MP_ROM_QSTR(MP_QSTR_FIX_3D), MP_ROM_PTR(&gnss_positionfix_fix3d_obj)}, +}; +STATIC MP_DEFINE_CONST_DICT(gnss_positionfix_locals_dict, gnss_positionfix_locals_dict_table); + +STATIC void gnss_positionfix_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { + qstr posfix = MP_QSTR_INVALID; + if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_positionfix_fix2d_obj)) { + posfix = MP_QSTR_FIX_2D; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_positionfix_fix3d_obj)) { + posfix = MP_QSTR_FIX_3D; + } + mp_printf(print, "%q.%q.%q", MP_QSTR_gnss, MP_QSTR_PositionFix, posfix); +} + +const mp_obj_type_t gnss_positionfix_type = { + { &mp_type_type }, + .name = MP_QSTR_PositionFix, + .print = gnss_positionfix_print, + .locals_dict = (mp_obj_t)&gnss_positionfix_locals_dict, +}; diff --git a/shared-bindings/gnss/PositionFix.h b/shared-bindings/gnss/PositionFix.h new file mode 100644 index 0000000000..64497cb59b --- /dev/null +++ b/shared-bindings/gnss/PositionFix.h @@ -0,0 +1,50 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_POSITIONFIX_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_POSITIONFIX_H + +#include "py/obj.h" + +typedef enum { + POSITIONFIX_INVALID, + POSITIONFIX_2D, + POSITIONFIX_3D, +} gnss_positionfix_t; + +const mp_obj_type_t gnss_positionfix_type; + +gnss_positionfix_t gnss_positionfix_obj_to_type(mp_obj_t obj); +mp_obj_t gnss_positionfix_type_to_obj(gnss_positionfix_t mode); + +typedef struct { + mp_obj_base_t base; +} gnss_positionfix_obj_t; +extern const gnss_positionfix_obj_t gnss_positionfix_invalid_obj; +extern const gnss_positionfix_obj_t gnss_positionfix_fix2d_obj; +extern const gnss_positionfix_obj_t gnss_positionfix_fix3d_obj; + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_POSITIONFIX_H diff --git a/shared-bindings/gnss/SatelliteSystem.c b/shared-bindings/gnss/SatelliteSystem.c new file mode 100644 index 0000000000..badc02b964 --- /dev/null +++ b/shared-bindings/gnss/SatelliteSystem.c @@ -0,0 +1,145 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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 "shared-bindings/gnss/SatelliteSystem.h" + +//| class SatelliteSystem: +//| """Satellite system type""" +//| +//| def __init__(self, ): +//| """Enum-like class to define the satellite system type.""" +//| +//| GPS: Any = ... +//| """Global Positioning System. +//| +//| :type gnss.SatelliteSystem:""" +//| +//| GLONASS: Any = ... +//| """GLObal NAvigation Satellite System. +//| +//| :type gnss.SatelliteSystem:""" +//| +//| SBAS: Any = ... +//| """Satellite Based Augmentation System. +//| +//| :type gnss.SatelliteSystem:""" +//| +//| QZSS_L1CA: Any = ... +//| """Quasi-Zenith Satellite System L1C/A. +//| +//| :type gnss.SatelliteSystem:""" +//| +//| QZSS_L1S: Any = ... +//| """Quasi-Zenith Satellite System L1S. +//| +//| :type gnss.SatelliteSystem:""" +//| +const mp_obj_type_t gnss_satellitesystem_type; + +const gnss_satellitesystem_obj_t gnss_satellitesystem_gps_obj = { + { &gnss_satellitesystem_type }, +}; + +const gnss_satellitesystem_obj_t gnss_satellitesystem_glonass_obj = { + { &gnss_satellitesystem_type }, +}; + +const gnss_satellitesystem_obj_t gnss_satellitesystem_sbas_obj = { + { &gnss_satellitesystem_type }, +}; + +const gnss_satellitesystem_obj_t gnss_satellitesystem_qzss_l1ca_obj = { + { &gnss_satellitesystem_type }, +}; + +const gnss_satellitesystem_obj_t gnss_satellitesystem_qzss_l1s_obj = { + { &gnss_satellitesystem_type }, +}; + +gnss_satellitesystem_t gnss_satellitesystem_obj_to_type(mp_obj_t obj) { + if (obj == MP_ROM_PTR(&gnss_satellitesystem_gps_obj)) { + return SATELLITESYSTEM_GPS; + } else if (obj == MP_ROM_PTR(&gnss_satellitesystem_glonass_obj)) { + return SATELLITESYSTEM_GLONASS; + } else if (obj == MP_ROM_PTR(&gnss_satellitesystem_sbas_obj)) { + return SATELLITESYSTEM_SBAS; + } else if (obj == MP_ROM_PTR(&gnss_satellitesystem_qzss_l1ca_obj)) { + return SATELLITESYSTEM_QZSS_L1CA; + } else if (obj == MP_ROM_PTR(&gnss_satellitesystem_qzss_l1s_obj)) { + return SATELLITESYSTEM_QZSS_L1S; + } + return SATELLITESYSTEM_NONE; +} + +mp_obj_t gnss_satellitesystem_type_to_obj(gnss_satellitesystem_t system) { + switch (system) { + case SATELLITESYSTEM_GPS: + return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_gps_obj); + case SATELLITESYSTEM_GLONASS: + return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_glonass_obj); + case SATELLITESYSTEM_SBAS: + return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_sbas_obj); + case SATELLITESYSTEM_QZSS_L1CA: + return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_qzss_l1ca_obj); + case SATELLITESYSTEM_QZSS_L1S: + return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_qzss_l1s_obj); + case SATELLITESYSTEM_NONE: + default: + return (mp_obj_t)MP_ROM_PTR(&mp_const_none_obj); + } +} + +STATIC const mp_rom_map_elem_t gnss_satellitesystem_locals_dict_table[] = { + {MP_ROM_QSTR(MP_QSTR_GPS), MP_ROM_PTR(&gnss_satellitesystem_gps_obj)}, + {MP_ROM_QSTR(MP_QSTR_GLONASS), MP_ROM_PTR(&gnss_satellitesystem_glonass_obj)}, + {MP_ROM_QSTR(MP_QSTR_SBAS), MP_ROM_PTR(&gnss_satellitesystem_sbas_obj)}, + {MP_ROM_QSTR(MP_QSTR_QZSS_L1CA), MP_ROM_PTR(&gnss_satellitesystem_qzss_l1ca_obj)}, + {MP_ROM_QSTR(MP_QSTR_QZSS_L1S), MP_ROM_PTR(&gnss_satellitesystem_qzss_l1s_obj)}, +}; +STATIC MP_DEFINE_CONST_DICT(gnss_satellitesystem_locals_dict, gnss_satellitesystem_locals_dict_table); + +STATIC void gnss_satellitesystem_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { + qstr system = MP_QSTR_None; + if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_gps_obj)) { + system = MP_QSTR_GPS; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_glonass_obj)) { + system = MP_QSTR_GLONASS; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_sbas_obj)) { + system = MP_QSTR_SBAS; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_qzss_l1ca_obj)) { + system = MP_QSTR_QZSS_L1CA; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_qzss_l1s_obj)) { + system = MP_QSTR_QZSS_L1S; + } + mp_printf(print, "%q.%q.%q", MP_QSTR_gnss, MP_QSTR_SatelliteSystem, system); +} + +const mp_obj_type_t gnss_satellitesystem_type = { + { &mp_type_type }, + .name = MP_QSTR_SatelliteSystem, + .print = gnss_satellitesystem_print, + .locals_dict = (mp_obj_t)&gnss_satellitesystem_locals_dict, +}; diff --git a/shared-bindings/gnss/SatelliteSystem.h b/shared-bindings/gnss/SatelliteSystem.h new file mode 100644 index 0000000000..210cd0bb8b --- /dev/null +++ b/shared-bindings/gnss/SatelliteSystem.h @@ -0,0 +1,55 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_SATELLITESYSTEM_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_SATELLITESYSTEM_H + +#include "py/obj.h" + +typedef enum { + SATELLITESYSTEM_NONE, + SATELLITESYSTEM_GPS, + SATELLITESYSTEM_GLONASS, + SATELLITESYSTEM_SBAS, + SATELLITESYSTEM_QZSS_L1CA, + SATELLITESYSTEM_QZSS_L1S, +} gnss_satellitesystem_t; + +const mp_obj_type_t gnss_satellitesystem_type; + +gnss_satellitesystem_t gnss_satellitesystem_obj_to_type(mp_obj_t obj); +mp_obj_t gnss_satellitesystem_type_to_obj(gnss_satellitesystem_t mode); + +typedef struct { + mp_obj_base_t base; +} gnss_satellitesystem_obj_t; +extern const gnss_satellitesystem_obj_t gnss_satellitesystem_gps_obj; +extern const gnss_satellitesystem_obj_t gnss_satellitesystem_glonass_obj; +extern const gnss_satellitesystem_obj_t gnss_satellitesystem_sbas_obj; +extern const gnss_satellitesystem_obj_t gnss_satellitesystem_qzss_l1ca_obj; +extern const gnss_satellitesystem_obj_t gnss_satellitesystem_qzss_l1s_obj; + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_SATELLITESYSTEM_H diff --git a/shared-bindings/gnss/__init__.c b/shared-bindings/gnss/__init__.c new file mode 100644 index 0000000000..b3cf722f11 --- /dev/null +++ b/shared-bindings/gnss/__init__.c @@ -0,0 +1,53 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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/obj.h" +#include "py/runtime.h" +#include "py/mphal.h" +#include "shared-bindings/gnss/GNSS.h" +#include "shared-bindings/gnss/SatelliteSystem.h" +#include "shared-bindings/gnss/PositionFix.h" +#include "shared-bindings/util.h" + +//| """Global Navigation Satellite System +//| +//| The `gnss` module contains classes to control the GNSS and acquire positioning information.""" +//| +STATIC const mp_rom_map_elem_t gnss_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_gnss) }, + { MP_ROM_QSTR(MP_QSTR_GNSS), MP_ROM_PTR(&gnss_type) }, + + // Enum-like Classes. + { MP_ROM_QSTR(MP_QSTR_SatelliteSystem), MP_ROM_PTR(&gnss_satellitesystem_type) }, + { MP_ROM_QSTR(MP_QSTR_PositionFix), MP_ROM_PTR(&gnss_positionfix_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(gnss_module_globals, gnss_module_globals_table); + +const mp_obj_module_t gnss_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&gnss_module_globals, +}; From 343f093ead9380347681aed5decb524281083746 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Tue, 16 Jun 2020 20:41:02 +0200 Subject: [PATCH 0064/1293] spresense: Add support for GNSS --- ports/cxd56/common-hal/gnss/GNSS.c | 152 ++++++++++++++++++ ports/cxd56/common-hal/gnss/GNSS.h | 41 +++++ ports/cxd56/common-hal/gnss/PositionFix.c | 0 ports/cxd56/common-hal/gnss/SatelliteSystem.c | 0 ports/cxd56/common-hal/gnss/__init__.c | 0 ports/cxd56/mpconfigport.mk | 1 + 6 files changed, 194 insertions(+) create mode 100644 ports/cxd56/common-hal/gnss/GNSS.c create mode 100644 ports/cxd56/common-hal/gnss/GNSS.h create mode 100644 ports/cxd56/common-hal/gnss/PositionFix.c create mode 100644 ports/cxd56/common-hal/gnss/SatelliteSystem.c create mode 100644 ports/cxd56/common-hal/gnss/__init__.c diff --git a/ports/cxd56/common-hal/gnss/GNSS.c b/ports/cxd56/common-hal/gnss/GNSS.c new file mode 100644 index 0000000000..0e5655534b --- /dev/null +++ b/ports/cxd56/common-hal/gnss/GNSS.c @@ -0,0 +1,152 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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 +#include +#include +#include + +#include "py/runtime.h" + +#include "shared-bindings/gnss/GNSS.h" + +typedef struct { + const char* devpath; + int fd; +} gnss_dev_t; + +STATIC gnss_dev_t gnss_dev = {"/dev/gps", -1}; + +static unsigned long satellitesystem_type_to_bit_fields(gnss_satellitesystem_t system) { + switch (system) { + case SATELLITESYSTEM_GPS: + return CXD56_GNSS_SAT_GPS; + case SATELLITESYSTEM_GLONASS: + return CXD56_GNSS_SAT_GLONASS; + case SATELLITESYSTEM_SBAS: + return CXD56_GNSS_SAT_SBAS; + case SATELLITESYSTEM_QZSS_L1CA: + return CXD56_GNSS_SAT_QZ_L1CA; + case SATELLITESYSTEM_QZSS_L1S: + return CXD56_GNSS_SAT_QZ_L1S; + case SATELLITESYSTEM_NONE: + default: + return CXD56_GNSS_SAT_NONE; + } +} + +static gnss_positionfix_t fix_to_positionfix_type(uint8_t fix) { + switch (fix) { + case CXD56_GNSS_PVT_POSFIX_2D: + return POSITIONFIX_2D; + case CXD56_GNSS_PVT_POSFIX_3D: + return POSITIONFIX_3D; + case CXD56_GNSS_PVT_POSFIX_INVALID: + default: + return POSITIONFIX_INVALID; + } +} + +void common_hal_gnss_construct(gnss_obj_t *self) { + if (gnss_dev.fd < 0) { + gnss_dev.fd = open(gnss_dev.devpath, O_RDONLY); + if (gnss_dev.fd < 0) { + mp_raise_ValueError(translate("Could not initialize GNSS")); + } + } + + self->satellite_system = 0; + self->fix = POSITIONFIX_INVALID; +} + +void common_hal_gnss_deinit(gnss_obj_t *self) { + if (common_hal_gnss_deinited(self)) { + return; + } + + close(gnss_dev.fd); + gnss_dev.fd = -1; +} + +bool common_hal_gnss_deinited(gnss_obj_t *self) { + return gnss_dev.fd < 0; +} + +void common_hal_gnss_select(gnss_obj_t *self, gnss_satellitesystem_t system) { + unsigned long selection = self->satellite_system | satellitesystem_type_to_bit_fields(system); + + ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_SELECT_SATELLITE_SYSTEM, selection); + + self->satellite_system = selection; +} + +void common_hal_gnss_deselect(gnss_obj_t *self, gnss_satellitesystem_t system) { + unsigned long selection = self->satellite_system & ~satellitesystem_type_to_bit_fields(system); + + ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_SELECT_SATELLITE_SYSTEM, selection); + + self->satellite_system = selection; +} + +void common_hal_gnss_start(gnss_obj_t *self) { + if (self->satellite_system == 0) { + mp_raise_ValueError(translate("Cannot start without selecting at least one satellite system.")); + } + ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_START, CXD56_GNSS_STMOD_COLD); +} + +void common_hal_gnss_stop(gnss_obj_t *self) { + ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_STOP, 0); +} + +void common_hal_gnss_update(gnss_obj_t *self) { + struct cxd56_gnss_positiondata_s positiondata; + + read(gnss_dev.fd, &positiondata, sizeof(struct cxd56_gnss_positiondata_s)); + + if (positiondata.receiver.pos_dataexist) { + self->fix = positiondata.receiver.pos_fixmode; + self->latitude = positiondata.receiver.latitude; + self->longitude = positiondata.receiver.longitude; + self->altitude = positiondata.receiver.altitude; + } +} + +mp_float_t common_hal_gnss_get_latitude(gnss_obj_t *self) { + return (mp_float_t) self->latitude; +} + +mp_float_t common_hal_gnss_get_longitude(gnss_obj_t *self) { + return (mp_float_t) self->longitude; +} + +mp_float_t common_hal_gnss_get_altitude(gnss_obj_t *self) { + return (mp_float_t) self->altitude; +} + +gnss_positionfix_t common_hal_gnss_get_fix(gnss_obj_t *self) { + return fix_to_positionfix_type(self->fix); +} diff --git a/ports/cxd56/common-hal/gnss/GNSS.h b/ports/cxd56/common-hal/gnss/GNSS.h new file mode 100644 index 0000000000..fd44bcb5cd --- /dev/null +++ b/ports/cxd56/common-hal/gnss/GNSS.h @@ -0,0 +1,41 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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. + */ + +#ifndef MICROPY_INCLUDED_CXD56_COMMON_HAL_GNSS_GNSS_H +#define MICROPY_INCLUDED_CXD56_COMMON_HAL_GNSS_GNSS_H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + unsigned long satellite_system; + uint8_t fix; + double latitude; + double longitude; + double altitude; +} gnss_obj_t; + +#endif // MICROPY_INCLUDED_CXD56_COMMON_HAL_GNSS_GNSS_H diff --git a/ports/cxd56/common-hal/gnss/PositionFix.c b/ports/cxd56/common-hal/gnss/PositionFix.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/cxd56/common-hal/gnss/SatelliteSystem.c b/ports/cxd56/common-hal/gnss/SatelliteSystem.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/cxd56/common-hal/gnss/__init__.c b/ports/cxd56/common-hal/gnss/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 8aeae1de56..6c59e12993 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -14,6 +14,7 @@ CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_GAMEPAD = 0 +CIRCUITPY_GNSS = 1 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_DISPLAYIO = 0 From fc8908b6a4daaf32db51623e7c86b14b7d077d60 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Wed, 17 Jun 2020 08:03:14 +0200 Subject: [PATCH 0065/1293] locale: make translate --- locale/circuitpython.pot | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 11ecb99e8c..76f2a41dd8 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-17 08:00+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -503,6 +503,10 @@ msgstr "" msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Cannot start without selecting at least one satellite system." +msgstr "" + #: py/objslice.c msgid "Cannot subclass slice" msgstr "" @@ -572,6 +576,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -1611,6 +1619,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" From c49f4bcc8516a6dcc129305c1e2a052c5f66f4f7 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Thu, 18 Jun 2020 17:08:30 +0200 Subject: [PATCH 0066/1293] gnss: add a comment about the units --- shared-bindings/gnss/GNSS.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c index 37c25cf849..e7c2234506 100644 --- a/shared-bindings/gnss/GNSS.c +++ b/shared-bindings/gnss/GNSS.c @@ -31,7 +31,7 @@ #include "py/runtime.h" //| class GNSS: -//| """Get updated positioning information from GNSS +//| """Get updated positioning information from Global Navigation Satellite System (GNSS) //| //| Usage:: //| @@ -155,7 +155,7 @@ STATIC mp_obj_t gnss_obj_update(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(gnss_update_obj, gnss_obj_update); //| latitude: Any = ... -//| """Latitude of current position.""" +//| """Latitude of current position in degrees (float).""" //| STATIC mp_obj_t gnss_obj_get_latitude(mp_obj_t self_in) { gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -172,7 +172,7 @@ const mp_obj_property_t gnss_latitude_obj = { }; //| longitude: Any = ... -//| """Longitude of current position.""" +//| """Longitude of current position in degrees (float).""" //| STATIC mp_obj_t gnss_obj_get_longitude(mp_obj_t self_in) { gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -189,7 +189,7 @@ const mp_obj_property_t gnss_longitude_obj = { }; //| altitude: Any = ... -//| """Altitude of current position.""" +//| """Altitude of current position in degrees (float).""" //| STATIC mp_obj_t gnss_obj_get_altitude(mp_obj_t self_in) { gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); From 3509dad5b3364ea23ea8108a33aa88a853626104 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Wed, 24 Jun 2020 11:04:05 +0200 Subject: [PATCH 0067/1293] gnss: Remove start and stop --- ports/cxd56/common-hal/gnss/GNSS.c | 64 +++++---------- shared-bindings/gnss/GNSS.c | 105 ++++++++----------------- shared-bindings/gnss/GNSS.h | 6 +- shared-bindings/gnss/SatelliteSystem.h | 12 +-- 4 files changed, 58 insertions(+), 129 deletions(-) diff --git a/ports/cxd56/common-hal/gnss/GNSS.c b/ports/cxd56/common-hal/gnss/GNSS.c index 0e5655534b..401d880d92 100644 --- a/ports/cxd56/common-hal/gnss/GNSS.c +++ b/ports/cxd56/common-hal/gnss/GNSS.c @@ -40,24 +40,6 @@ typedef struct { STATIC gnss_dev_t gnss_dev = {"/dev/gps", -1}; -static unsigned long satellitesystem_type_to_bit_fields(gnss_satellitesystem_t system) { - switch (system) { - case SATELLITESYSTEM_GPS: - return CXD56_GNSS_SAT_GPS; - case SATELLITESYSTEM_GLONASS: - return CXD56_GNSS_SAT_GLONASS; - case SATELLITESYSTEM_SBAS: - return CXD56_GNSS_SAT_SBAS; - case SATELLITESYSTEM_QZSS_L1CA: - return CXD56_GNSS_SAT_QZ_L1CA; - case SATELLITESYSTEM_QZSS_L1S: - return CXD56_GNSS_SAT_QZ_L1S; - case SATELLITESYSTEM_NONE: - default: - return CXD56_GNSS_SAT_NONE; - } -} - static gnss_positionfix_t fix_to_positionfix_type(uint8_t fix) { switch (fix) { case CXD56_GNSS_PVT_POSFIX_2D: @@ -70,7 +52,7 @@ static gnss_positionfix_t fix_to_positionfix_type(uint8_t fix) { } } -void common_hal_gnss_construct(gnss_obj_t *self) { +void common_hal_gnss_construct(gnss_obj_t *self, unsigned long selection) { if (gnss_dev.fd < 0) { gnss_dev.fd = open(gnss_dev.devpath, O_RDONLY); if (gnss_dev.fd < 0) { @@ -80,6 +62,23 @@ void common_hal_gnss_construct(gnss_obj_t *self) { self->satellite_system = 0; self->fix = POSITIONFIX_INVALID; + + unsigned long sel = 0; + + if (selection & SATELLITESYSTEM_GPS) { + sel |= CXD56_GNSS_SAT_GPS; + } else if (selection & SATELLITESYSTEM_GLONASS) { + sel |= CXD56_GNSS_SAT_GLONASS; + } else if (selection & SATELLITESYSTEM_SBAS) { + sel |= CXD56_GNSS_SAT_SBAS; + } else if (selection & SATELLITESYSTEM_QZSS_L1CA) { + sel |= CXD56_GNSS_SAT_QZ_L1CA; + } else if (selection & SATELLITESYSTEM_QZSS_L1S) { + sel |= CXD56_GNSS_SAT_QZ_L1S; + } + + ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_SELECT_SATELLITE_SYSTEM, sel); + ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_START, CXD56_GNSS_STMOD_COLD); } void common_hal_gnss_deinit(gnss_obj_t *self) { @@ -95,33 +94,6 @@ bool common_hal_gnss_deinited(gnss_obj_t *self) { return gnss_dev.fd < 0; } -void common_hal_gnss_select(gnss_obj_t *self, gnss_satellitesystem_t system) { - unsigned long selection = self->satellite_system | satellitesystem_type_to_bit_fields(system); - - ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_SELECT_SATELLITE_SYSTEM, selection); - - self->satellite_system = selection; -} - -void common_hal_gnss_deselect(gnss_obj_t *self, gnss_satellitesystem_t system) { - unsigned long selection = self->satellite_system & ~satellitesystem_type_to_bit_fields(system); - - ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_SELECT_SATELLITE_SYSTEM, selection); - - self->satellite_system = selection; -} - -void common_hal_gnss_start(gnss_obj_t *self) { - if (self->satellite_system == 0) { - mp_raise_ValueError(translate("Cannot start without selecting at least one satellite system.")); - } - ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_START, CXD56_GNSS_STMOD_COLD); -} - -void common_hal_gnss_stop(gnss_obj_t *self) { - ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_STOP, 0); -} - void common_hal_gnss_update(gnss_obj_t *self) { struct cxd56_gnss_positiondata_s positiondata; diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c index e7c2234506..a7bb964a66 100644 --- a/shared-bindings/gnss/GNSS.c +++ b/shared-bindings/gnss/GNSS.c @@ -38,31 +38,54 @@ //| import gnss //| import time //| -//| gps = gnss.GNSS() -//| gps.select(gnss.SatelliteSystem.GPS) -//| gps.start() +//| nav = gnss.GNSS([gnss.SatelliteSystem.GPS, gnss.SatelliteSystem.GLONASS]) //| last_print = time.monotonic() //| while True: -//| gps.update() +//| nav.update() //| current = time.monotonic() //| if current - last_print >= 1.0: //| last_print = current -//| if gps.fix is gnss.PositionFix.INVALID: +//| if nav.fix is gnss.PositionFix.INVALID: //| print("Waiting for fix...") //| continue -//| print("Latitude: {0:.6f} degrees".format(gps.latitude)) -//| print("Longitude: {0:.6f} degrees".format(gps.longitude))""" +//| print("Latitude: {0:.6f} degrees".format(nav.latitude)) +//| print("Longitude: {0:.6f} degrees".format(nav.longitude))""" //| //| def __init__(self, ): -//| """Turn on the GNSS.""" +//| """Turn on the GNSS. +//| +//| :param gnss.SatelliteSystem system: satellite system to use""" //| ... //| STATIC mp_obj_t gnss_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { gnss_obj_t *self = m_new_obj(gnss_obj_t); self->base.type = &gnss_type; + enum { ARG_system }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_system, MP_ARG_REQUIRED | MP_ARG_OBJ }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - common_hal_gnss_construct(self); + unsigned long selection = 0; + if (MP_OBJ_IS_TYPE(args[ARG_system].u_obj, &gnss_satellitesystem_type)) { + selection |= gnss_satellitesystem_obj_to_type(args[ARG_system].u_obj); + } else if (MP_OBJ_IS_TYPE(args[ARG_system].u_obj, &mp_type_list)) { + size_t systems_size = 0; + mp_obj_t *systems; + mp_obj_list_get(args[ARG_system].u_obj, &systems_size, &systems); + for (size_t i = 0; i < systems_size; ++i) { + if (!MP_OBJ_IS_TYPE(systems[i], &gnss_satellitesystem_type)) { + mp_raise_TypeError(translate("System entry must be gnss.SatelliteSystem")); + } + selection |= gnss_satellitesystem_obj_to_type(systems[i]); + } + } else { + mp_raise_TypeError(translate("System entry must be gnss.SatelliteSystem")); + } + + common_hal_gnss_construct(self, selection); return MP_OBJ_FROM_PTR(self); } @@ -83,64 +106,6 @@ STATIC void check_for_deinit(gnss_obj_t *self) { } } -//| def select(self, system: gnss.SatelliteSystem) -> Any: -//| """Add specified satellite system to selection for positioning. -//| -//| :param gnss.SatelliteSystem system: satellite system to use""" -//| ... -//| -STATIC mp_obj_t gnss_obj_select(mp_obj_t self_in, mp_obj_t system_obj) { - gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - gnss_satellitesystem_t system = gnss_satellitesystem_obj_to_type(system_obj); - common_hal_gnss_select(self, system); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(gnss_select_obj, gnss_obj_select); - -//| def deselect(self, system: gnss.SatelliteSystem) -> Any: -//| """Remove specified satellite system from selection for positioning. -//| -//| :param gnss.SatelliteSystem system: satellite system to remove""" -//| ... -//| -STATIC mp_obj_t gnss_obj_deselect(mp_obj_t self_in, mp_obj_t system_obj) { - gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - gnss_satellitesystem_t system = gnss_satellitesystem_obj_to_type(system_obj); - common_hal_gnss_deselect(self, system); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(gnss_deselect_obj, gnss_obj_deselect); - -//| def start(self, ) -> Any: -//| """Start positioning.""" -//| ... -//| -STATIC mp_obj_t gnss_obj_start(mp_obj_t self_in) { - gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - common_hal_gnss_start(self); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(gnss_start_obj, gnss_obj_start); - -//| def stop(self, ) -> Any: -//| """Stop positioning.""" -//| ... -//| -STATIC mp_obj_t gnss_obj_stop(mp_obj_t self_in) { - gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - common_hal_gnss_stop(self); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(gnss_stop_obj, gnss_obj_stop); - //| def update(self, ) -> Any: //| """Update GNSS positioning information.""" //| ... @@ -189,7 +154,7 @@ const mp_obj_property_t gnss_longitude_obj = { }; //| altitude: Any = ... -//| """Altitude of current position in degrees (float).""" +//| """Altitude of current position in meters (float).""" //| STATIC mp_obj_t gnss_obj_get_altitude(mp_obj_t self_in) { gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -224,10 +189,6 @@ const mp_obj_property_t gnss_fix_obj = { STATIC const mp_rom_map_elem_t gnss_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&gnss_deinit_obj) }, - { MP_ROM_QSTR(MP_QSTR_select), MP_ROM_PTR(&gnss_select_obj) }, - { MP_ROM_QSTR(MP_QSTR_deselect), MP_ROM_PTR(&gnss_deselect_obj) }, - { MP_ROM_QSTR(MP_QSTR_start), MP_ROM_PTR(&gnss_start_obj) }, - { MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&gnss_stop_obj) }, { MP_ROM_QSTR(MP_QSTR_update), MP_ROM_PTR(&gnss_update_obj) }, { MP_ROM_QSTR(MP_QSTR_latitude), MP_ROM_PTR(&gnss_latitude_obj) }, diff --git a/shared-bindings/gnss/GNSS.h b/shared-bindings/gnss/GNSS.h index 953eb9ce31..c7332dc0e4 100644 --- a/shared-bindings/gnss/GNSS.h +++ b/shared-bindings/gnss/GNSS.h @@ -33,13 +33,9 @@ extern const mp_obj_type_t gnss_type; -void common_hal_gnss_construct(gnss_obj_t *self); +void common_hal_gnss_construct(gnss_obj_t *self, unsigned long selection); void common_hal_gnss_deinit(gnss_obj_t *self); bool common_hal_gnss_deinited(gnss_obj_t *self); -void common_hal_gnss_select(gnss_obj_t *self, gnss_satellitesystem_t system); -void common_hal_gnss_deselect(gnss_obj_t *self, gnss_satellitesystem_t system); -void common_hal_gnss_start(gnss_obj_t *self); -void common_hal_gnss_stop(gnss_obj_t *self); void common_hal_gnss_update(gnss_obj_t *self); mp_float_t common_hal_gnss_get_latitude(gnss_obj_t *self); diff --git a/shared-bindings/gnss/SatelliteSystem.h b/shared-bindings/gnss/SatelliteSystem.h index 210cd0bb8b..484e861abd 100644 --- a/shared-bindings/gnss/SatelliteSystem.h +++ b/shared-bindings/gnss/SatelliteSystem.h @@ -30,12 +30,12 @@ #include "py/obj.h" typedef enum { - SATELLITESYSTEM_NONE, - SATELLITESYSTEM_GPS, - SATELLITESYSTEM_GLONASS, - SATELLITESYSTEM_SBAS, - SATELLITESYSTEM_QZSS_L1CA, - SATELLITESYSTEM_QZSS_L1S, + SATELLITESYSTEM_NONE = 0, + SATELLITESYSTEM_GPS = (1U << 0), + SATELLITESYSTEM_GLONASS = (1U << 1), + SATELLITESYSTEM_SBAS = (1U << 2), + SATELLITESYSTEM_QZSS_L1CA = (1U << 3), + SATELLITESYSTEM_QZSS_L1S = (1U << 4), } gnss_satellitesystem_t; const mp_obj_type_t gnss_satellitesystem_type; From ab4c09cea7d93478f9e305bfdf4cfe4be6204186 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Wed, 24 Jun 2020 11:06:25 +0200 Subject: [PATCH 0068/1293] gnss: Add timestamp --- ports/cxd56/common-hal/gnss/GNSS.c | 13 ++++++++++++- ports/cxd56/common-hal/gnss/GNSS.h | 4 ++++ shared-bindings/gnss/GNSS.c | 21 +++++++++++++++++++++ shared-bindings/gnss/GNSS.h | 3 +++ 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/ports/cxd56/common-hal/gnss/GNSS.c b/ports/cxd56/common-hal/gnss/GNSS.c index 401d880d92..c0aaa3cfbd 100644 --- a/ports/cxd56/common-hal/gnss/GNSS.c +++ b/ports/cxd56/common-hal/gnss/GNSS.c @@ -26,8 +26,8 @@ #include #include +#include #include -#include #include "py/runtime.h" @@ -104,6 +104,8 @@ void common_hal_gnss_update(gnss_obj_t *self) { self->latitude = positiondata.receiver.latitude; self->longitude = positiondata.receiver.longitude; self->altitude = positiondata.receiver.altitude; + memcpy(&self->date, &positiondata.receiver.date, sizeof(struct cxd56_gnss_date_s)); + memcpy(&self->time, &positiondata.receiver.time, sizeof(struct cxd56_gnss_time_s)); } } @@ -119,6 +121,15 @@ mp_float_t common_hal_gnss_get_altitude(gnss_obj_t *self) { return (mp_float_t) self->altitude; } +void common_hal_gnss_get_timestamp(gnss_obj_t *self, timeutils_struct_time_t *tm) { + tm->tm_year = self->date.year; + tm->tm_mon = self->date.month; + tm->tm_mday = self->date.day; + tm->tm_hour = self->time.hour; + tm->tm_min = self->time.minute; + tm->tm_sec = self->time.sec; +} + gnss_positionfix_t common_hal_gnss_get_fix(gnss_obj_t *self) { return fix_to_positionfix_type(self->fix); } diff --git a/ports/cxd56/common-hal/gnss/GNSS.h b/ports/cxd56/common-hal/gnss/GNSS.h index fd44bcb5cd..e226104492 100644 --- a/ports/cxd56/common-hal/gnss/GNSS.h +++ b/ports/cxd56/common-hal/gnss/GNSS.h @@ -27,6 +27,8 @@ #ifndef MICROPY_INCLUDED_CXD56_COMMON_HAL_GNSS_GNSS_H #define MICROPY_INCLUDED_CXD56_COMMON_HAL_GNSS_GNSS_H +#include + #include "py/obj.h" typedef struct { @@ -36,6 +38,8 @@ typedef struct { double latitude; double longitude; double altitude; + struct cxd56_gnss_date_s date; + struct cxd56_gnss_time_s time; } gnss_obj_t; #endif // MICROPY_INCLUDED_CXD56_COMMON_HAL_GNSS_GNSS_H diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c index a7bb964a66..929e02ab81 100644 --- a/shared-bindings/gnss/GNSS.c +++ b/shared-bindings/gnss/GNSS.c @@ -25,6 +25,7 @@ */ #include "shared-bindings/gnss/GNSS.h" +#include "shared-bindings/time/__init__.h" #include "shared-bindings/util.h" #include "py/objproperty.h" @@ -170,6 +171,25 @@ const mp_obj_property_t gnss_altitude_obj = { (mp_obj_t)&mp_const_none_obj}, }; +//| timestamp: Any = ... +//| """Time when the position data was updated.""" +//| +STATIC mp_obj_t gnss_obj_get_timestamp(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + timeutils_struct_time_t tm; + common_hal_gnss_get_timestamp(self, &tm); + return struct_time_from_tm(&tm); +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_timestamp_obj, gnss_obj_get_timestamp); + +const mp_obj_property_t gnss_timestamp_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&gnss_get_timestamp_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + //| fix: Any = ... //| """Fix mode.""" //| @@ -194,6 +214,7 @@ STATIC const mp_rom_map_elem_t gnss_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_latitude), MP_ROM_PTR(&gnss_latitude_obj) }, { MP_ROM_QSTR(MP_QSTR_longitude), MP_ROM_PTR(&gnss_longitude_obj) }, { MP_ROM_QSTR(MP_QSTR_altitude), MP_ROM_PTR(&gnss_altitude_obj) }, + { MP_ROM_QSTR(MP_QSTR_timestamp), MP_ROM_PTR(&gnss_timestamp_obj) }, { MP_ROM_QSTR(MP_QSTR_fix), MP_ROM_PTR(&gnss_fix_obj) } }; STATIC MP_DEFINE_CONST_DICT(gnss_locals_dict, gnss_locals_dict_table); diff --git a/shared-bindings/gnss/GNSS.h b/shared-bindings/gnss/GNSS.h index c7332dc0e4..61ae35b12a 100644 --- a/shared-bindings/gnss/GNSS.h +++ b/shared-bindings/gnss/GNSS.h @@ -31,6 +31,8 @@ #include "shared-bindings/gnss/SatelliteSystem.h" #include "shared-bindings/gnss/PositionFix.h" +#include "lib/timeutils/timeutils.h" + extern const mp_obj_type_t gnss_type; void common_hal_gnss_construct(gnss_obj_t *self, unsigned long selection); @@ -41,6 +43,7 @@ void common_hal_gnss_update(gnss_obj_t *self); mp_float_t common_hal_gnss_get_latitude(gnss_obj_t *self); mp_float_t common_hal_gnss_get_longitude(gnss_obj_t *self); mp_float_t common_hal_gnss_get_altitude(gnss_obj_t *self); +void common_hal_gnss_get_timestamp(gnss_obj_t *self, timeutils_struct_time_t *tm); gnss_positionfix_t common_hal_gnss_get_fix(gnss_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_GNSS_H From 1537e7ae77870cf41eddc6f10df1855448801f8c Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Wed, 24 Jun 2020 11:10:37 +0200 Subject: [PATCH 0069/1293] locale: update translate --- locale/circuitpython.pot | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 76f2a41dd8..f125c2cc4b 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-17 08:00+0200\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -503,10 +503,6 @@ msgstr "" msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Cannot start without selecting at least one satellite system." -msgstr "" - #: py/objslice.c msgid "Cannot subclass slice" msgstr "" @@ -1433,6 +1429,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" From bf460ddf25ead020c6aeeb9ac4393ddf17daf7bb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 24 Jun 2020 09:44:45 -0500 Subject: [PATCH 0070/1293] supervisor.mk: Conditionally assign USB_DEVICES This restores the ability to remove CDC and/or MSC, at the price of giving up the new automatic check that USB_DEVICES is correct. Since devices have to have CDC and MSC to be "CircuitPython", this is not a facility that is going to be used by any in-tree drivers. --- supervisor/supervisor.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 0717785e7f..21803ae0a3 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -122,7 +122,7 @@ endif ifeq ($(CIRCUITPY_USB_HID),1) USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),HID endif -USB_DEVICES := "$(USB_DEVICES_COMPUTED)" +USB_DEVICES ?= "$(USB_DEVICES_COMPUTED)" ifndef USB_HID_DEVICES USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD" From d0401f02a947a468d3019e70b5b0f5f633429c5d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 28 May 2020 15:51:33 -0700 Subject: [PATCH 0071/1293] Add initial I2C support, not quite working fully though --- ports/esp32s2/Makefile | 1 + ports/esp32s2/common-hal/busio/I2C.c | 239 +++++++++++ ports/esp32s2/common-hal/busio/I2C.h | 49 +++ ports/esp32s2/common-hal/busio/OneWire.h | 33 ++ ports/esp32s2/common-hal/busio/SPI.c | 249 +++++++++++ ports/esp32s2/common-hal/busio/SPI.h | 44 ++ ports/esp32s2/common-hal/busio/UART.c | 405 ++++++++++++++++++ ports/esp32s2/common-hal/busio/UART.h | 48 +++ ports/esp32s2/common-hal/busio/__init__.c | 1 + .../esp32s2/common-hal/microcontroller/Pin.c | 4 + .../esp32s2/common-hal/microcontroller/Pin.h | 1 + ports/esp32s2/mpconfigport.mk | 4 +- ports/esp32s2/supervisor/port.c | 10 +- 13 files changed, 1085 insertions(+), 3 deletions(-) create mode 100644 ports/esp32s2/common-hal/busio/I2C.c create mode 100644 ports/esp32s2/common-hal/busio/I2C.h create mode 100644 ports/esp32s2/common-hal/busio/OneWire.h create mode 100644 ports/esp32s2/common-hal/busio/SPI.c create mode 100644 ports/esp32s2/common-hal/busio/SPI.h create mode 100644 ports/esp32s2/common-hal/busio/UART.c create mode 100644 ports/esp32s2/common-hal/busio/UART.h create mode 100644 ports/esp32s2/common-hal/busio/__init__.c diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 5ad5c2f1d3..4eac07f99f 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -78,6 +78,7 @@ INC += -Iesp-idf/components/freertos/xtensa/include INC += -Iesp-idf/components/esp32s2/include INC += -Iesp-idf/components/xtensa/esp32s2/include INC += -Iesp-idf/components/esp_common/include +INC += -Iesp-idf/components/esp_ringbuf/include INC += -Iesp-idf/components/esp_rom/include INC += -Iesp-idf/components/xtensa/include INC += -Iesp-idf/components/esp_timer/include diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/esp32s2/common-hal/busio/I2C.c new file mode 100644 index 0000000000..80743dc894 --- /dev/null +++ b/ports/esp32s2/common-hal/busio/I2C.c @@ -0,0 +1,239 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * 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/busio/I2C.h" +#include "py/mperrno.h" +#include "py/runtime.h" + +#include "driver/i2c.h" + +#include "esp_log.h" + +#include "shared-bindings/microcontroller/__init__.h" +#include "supervisor/shared/translate.h" + +// Number of times to try to send packet if failed. +#define ATTEMPTS 2 + +static const char* TAG = "CircuitPython I2C"; + +typedef enum { + STATUS_FREE = 0, + STATUS_IN_USE, + STATUS_NEVER_RESET +} i2c_status_t; + +static i2c_status_t i2c_status[I2C_NUM_MAX]; + +void never_reset_i2c(i2c_port_t num) { + i2c_status[num] = STATUS_NEVER_RESET; +} + +void i2c_reset(void) { + for (i2c_port_t num = 0; num < I2C_NUM_MAX; num++) { + if (i2c_status[num] == STATUS_IN_USE) { + i2c_driver_delete(num); + i2c_status[num] = STATUS_FREE; + } + } +} + +void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, + const mcu_pin_obj_t* scl, const mcu_pin_obj_t* sda, uint32_t frequency, uint32_t timeout) { + + // Make sure scl and sda aren't input only + +#if CIRCUITPY_REQUIRE_I2C_PULLUPS + // // Test that the pins are in a high state. (Hopefully indicating they are pulled up.) + // gpio_set_pin_function(sda->number, GPIO_PIN_FUNCTION_OFF); + // gpio_set_pin_function(scl->number, GPIO_PIN_FUNCTION_OFF); + // gpio_set_pin_direction(sda->number, GPIO_DIRECTION_IN); + // gpio_set_pin_direction(scl->number, GPIO_DIRECTION_IN); + + // gpio_set_pin_pull_mode(sda->number, GPIO_PULL_DOWN); + // gpio_set_pin_pull_mode(scl->number, GPIO_PULL_DOWN); + + // common_hal_mcu_delay_us(10); + + // gpio_set_pin_pull_mode(sda->number, GPIO_PULL_OFF); + // gpio_set_pin_pull_mode(scl->number, GPIO_PULL_OFF); + + // // We must pull up within 3us to achieve 400khz. + // common_hal_mcu_delay_us(3); + + // if (!gpio_get_pin_level(sda->number) || !gpio_get_pin_level(scl->number)) { + // reset_pin_number(sda->number); + // reset_pin_number(scl->number); + // mp_raise_RuntimeError(translate("SDA or SCL needs a pull up")); + // } +#endif + ESP_EARLY_LOGW(TAG, "create I2C"); + + + self->semaphore_handle = xSemaphoreCreateBinaryStatic(&self->semaphore); + xSemaphoreGive(self->semaphore_handle); + ESP_EARLY_LOGW(TAG, "new I2C lock %x", self->semaphore_handle); + self->sda_pin = sda; + self->scl_pin = scl; + ESP_EARLY_LOGW(TAG, "scl %d sda %d", self->sda_pin->number, self->scl_pin->number); + self->i2c_num = I2C_NUM_MAX; + for (i2c_port_t num = 0; num < I2C_NUM_MAX; num++) { + if (i2c_status[num] == STATUS_FREE) { + self->i2c_num = num; + } + } + if (self->i2c_num == I2C_NUM_MAX) { + mp_raise_ValueError(translate("All I2C peripherals are in use")); + } + i2c_status[self->i2c_num] = STATUS_IN_USE; + i2c_config_t i2c_conf = { + .mode = I2C_MODE_MASTER, + .sda_io_num = self->sda_pin->number, + .scl_io_num = self->scl_pin->number, + .sda_pullup_en = GPIO_PULLUP_DISABLE, /*!< Internal GPIO pull mode for I2C sda signal*/ + .scl_pullup_en = GPIO_PULLUP_DISABLE, /*!< Internal GPIO pull mode for I2C scl signal*/ + + .master = { + .clk_speed = frequency, + } + }; + // ESP_EARLY_LOGW(TAG, "param config %p %p %d %d", &i2c_conf, &(i2c_conf.mode), i2c_conf.mode, I2C_MODE_MAX); + ESP_EARLY_LOGW(TAG, "param config %p %d %d", &i2c_conf, i2c_conf.mode, I2C_MODE_MAX); + esp_err_t result = i2c_param_config(self->i2c_num, &i2c_conf); + if (result != ESP_OK) { + ESP_EARLY_LOGW(TAG, "error %d %p %d %d", result, &i2c_conf, (&i2c_conf)->mode, I2C_MODE_MAX); + vTaskDelay(0); + mp_raise_ValueError(translate("Invalid pins")); + } + ESP_EARLY_LOGW(TAG, "param config I2C done"); + result = i2c_driver_install(self->i2c_num, + I2C_MODE_MASTER, + 0, + 0, + 0); + if (result != ESP_OK) { + mp_raise_OSError(MP_EIO); + } + + claim_pin(sda); + claim_pin(scl); + ESP_EARLY_LOGW(TAG, "create I2C done"); +} + +bool common_hal_busio_i2c_deinited(busio_i2c_obj_t *self) { + return self->sda_pin == NULL; +} + +void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) { + if (common_hal_busio_i2c_deinited(self)) { + return; + } + + i2c_driver_delete(self->i2c_num); + i2c_status[self->i2c_num] = STATUS_FREE; + + reset_pin(self->sda_pin); + reset_pin(self->scl_pin); + self->sda_pin = NULL; + self->scl_pin = NULL; +} + +bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) { + i2c_cmd_handle_t cmd = i2c_cmd_link_create(); + i2c_master_start(cmd); + i2c_master_write_byte(cmd, addr << 1, true); + i2c_master_stop(cmd); + esp_err_t result = i2c_master_cmd_begin(self->i2c_num, cmd, 100); + i2c_cmd_link_delete(cmd); + return result == ESP_OK; +} + +bool common_hal_busio_i2c_try_lock(busio_i2c_obj_t *self) { + ESP_EARLY_LOGW(TAG, "locking I2C %x", self->semaphore_handle); + self->has_lock = xSemaphoreTake(self->semaphore_handle, 0) == pdTRUE; + if (self->has_lock) { + ESP_EARLY_LOGW(TAG, "lock grabbed"); + } else { + ESP_EARLY_LOGW(TAG, "unable to grab lock"); + } + return self->has_lock; +} + +bool common_hal_busio_i2c_has_lock(busio_i2c_obj_t *self) { + return self->has_lock; +} + +void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) { + ESP_EARLY_LOGW(TAG, "unlocking I2C"); + xSemaphoreGive(self->semaphore_handle); + self->has_lock = false; +} + +uint8_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr, + const uint8_t *data, size_t len, bool transmit_stop_bit) { + i2c_cmd_handle_t cmd = i2c_cmd_link_create(); + i2c_master_start(cmd); + i2c_master_write_byte(cmd, addr << 1, true); + i2c_master_write(cmd, (uint8_t*) data, len, true); + if (transmit_stop_bit) { + i2c_master_stop(cmd); + } + esp_err_t result = i2c_master_cmd_begin(self->i2c_num, cmd, 100 /* wait in ticks */); + i2c_cmd_link_delete(cmd); + + if (result == ESP_OK) { + return 0; + } else if (result == ESP_FAIL) { + return MP_ENODEV; + } + return MP_EIO; +} + +uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, + uint8_t *data, size_t len) { + + i2c_cmd_handle_t cmd = i2c_cmd_link_create(); + i2c_master_start(cmd); + i2c_master_write_byte(cmd, addr << 1 | 1, true); // | 1 to indicate read + i2c_master_read(cmd, data, len, true); + i2c_master_stop(cmd); + esp_err_t result = i2c_master_cmd_begin(self->i2c_num, cmd, 100 /* wait in ticks */); + i2c_cmd_link_delete(cmd); + + if (result == ESP_OK) { + return 0; + } else if (result == ESP_FAIL) { + return MP_ENODEV; + } + return MP_EIO; +} + +void common_hal_busio_i2c_never_reset(busio_i2c_obj_t *self) { + never_reset_i2c(self->i2c_num); + + never_reset_pin(self->scl_pin); + never_reset_pin(self->sda_pin); +} diff --git a/ports/esp32s2/common-hal/busio/I2C.h b/ports/esp32s2/common-hal/busio/I2C.h new file mode 100644 index 0000000000..d90fb2713a --- /dev/null +++ b/ports/esp32s2/common-hal/busio/I2C.h @@ -0,0 +1,49 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * 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_ESP32S2_COMMON_HAL_BUSIO_I2C_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_I2C_H + +#include "common-hal/microcontroller/Pin.h" + +#include "esp-idf/components/soc/include/hal/i2c_types.h" +#include "FreeRTOS.h" +#include "freertos/semphr.h" +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t* scl_pin; + const mcu_pin_obj_t* sda_pin; + i2c_port_t i2c_num; + StaticSemaphore_t semaphore; + SemaphoreHandle_t semaphore_handle; + bool has_lock; +} busio_i2c_obj_t; + +void i2c_reset(void); + +#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_H diff --git a/ports/esp32s2/common-hal/busio/OneWire.h b/ports/esp32s2/common-hal/busio/OneWire.h new file mode 100644 index 0000000000..bb6a014190 --- /dev/null +++ b/ports/esp32s2/common-hal/busio/OneWire.h @@ -0,0 +1,33 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft + * + * 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_ESP32S2_COMMON_HAL_BUSIO_ONEWIRE_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_ONEWIRE_H + +// Use bitbangio. +#include "shared-module/busio/OneWire.h" + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_ONEWIRE_H diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c new file mode 100644 index 0000000000..e761eb49be --- /dev/null +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -0,0 +1,249 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * 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/busio/SPI.h" +#include "py/mperrno.h" +#include "py/runtime.h" + +#include "boards/board.h" +#include "common-hal/microcontroller/Pin.h" +#include "supervisor/shared/rgb_led_status.h" + +void spi_reset(void) { + +} + +void common_hal_busio_spi_construct(busio_spi_obj_t *self, + const mcu_pin_obj_t * clock, const mcu_pin_obj_t * mosi, + const mcu_pin_obj_t * miso) { + // uint8_t sercom_index; + // uint32_t clock_pinmux = 0; + // bool mosi_none = mosi == NULL; + // bool miso_none = miso == NULL; + // uint32_t mosi_pinmux = 0; + // uint32_t miso_pinmux = 0; + // uint8_t clock_pad = 0; + // uint8_t mosi_pad = 0; + // uint8_t miso_pad = 0; + // uint8_t dopo = 255; + + // if (sercom == NULL) { + // mp_raise_ValueError(translate("Invalid pins")); + // } + + // // Set up SPI clocks on SERCOM. + // samd_peripherals_sercom_clock_init(sercom, sercom_index); + + #if defined(MICROPY_HW_APA102_SCK) && defined(MICROPY_HW_APA102_MOSI) && !CIRCUITPY_BITBANG_APA102 + // // if we're re-using the dotstar sercom, make sure it is disabled or the init will fail out + // hri_sercomspi_clear_CTRLA_ENABLE_bit(sercom); + #endif + // if (spi_m_sync_init(&self->spi_desc, sercom) != ERR_NONE) { + // mp_raise_OSError(MP_EIO); + // } + + // Pads must be set after spi_m_sync_init(), which uses default values from + // the prototypical SERCOM. + // hri_sercomspi_write_CTRLA_DOPO_bf(sercom, dopo); + // hri_sercomspi_write_CTRLA_DIPO_bf(sercom, miso_pad); + + // Always start at 250khz which is what SD cards need. They are sensitive to + // SPI bus noise before they are put into SPI mode. + // uint8_t baud_value = samd_peripherals_spi_baudrate_to_baud_reg_value(250000); + // if (spi_m_sync_set_baudrate(&self->spi_desc, baud_value) != ERR_NONE) { + // // spi_m_sync_set_baudrate does not check for validity, just whether the device is + // // busy or not + // mp_raise_OSError(MP_EIO); + // } + + // gpio_set_pin_direction(clock->number, GPIO_DIRECTION_OUT); + // gpio_set_pin_pull_mode(clock->number, GPIO_PULL_OFF); + // gpio_set_pin_function(clock->number, clock_pinmux); + // claim_pin(clock); + // self->clock_pin = clock->number; + + // if (mosi_none) { + // self->MOSI_pin = NO_PIN; + // } else { + // gpio_set_pin_direction(mosi->number, GPIO_DIRECTION_OUT); + // gpio_set_pin_pull_mode(mosi->number, GPIO_PULL_OFF); + // gpio_set_pin_function(mosi->number, mosi_pinmux); + // self->MOSI_pin = mosi->number; + // claim_pin(mosi); + // } + + // if (miso_none) { + // self->MISO_pin = NO_PIN; + // } else { + // gpio_set_pin_direction(miso->number, GPIO_DIRECTION_IN); + // gpio_set_pin_pull_mode(miso->number, GPIO_PULL_OFF); + // gpio_set_pin_function(miso->number, miso_pinmux); + // self->MISO_pin = miso->number; + // claim_pin(miso); + // } + + // spi_m_sync_enable(&self->spi_desc); +} + +void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { + // never_reset_sercom(self->spi_desc.dev.prvt); + + never_reset_pin(self->clock_pin); + never_reset_pin(self->MOSI_pin); + never_reset_pin(self->MISO_pin); +} + +bool common_hal_busio_spi_deinited(busio_spi_obj_t *self) { + return self->clock_pin == NULL; +} + +void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { + if (common_hal_busio_spi_deinited(self)) { + return; + } + // allow_reset_sercom(self->spi_desc.dev.prvt); + + // spi_m_sync_disable(&self->spi_desc); + // spi_m_sync_deinit(&self->spi_desc); + reset_pin(self->clock_pin); + reset_pin(self->MOSI_pin); + reset_pin(self->MISO_pin); + self->clock_pin = NULL; +} + +bool common_hal_busio_spi_configure(busio_spi_obj_t *self, + uint32_t baudrate, uint8_t polarity, uint8_t phase, uint8_t bits) { + // If the settings are already what we want then don't reset them. + // if (hri_sercomspi_get_CTRLA_CPHA_bit(hw) == phase && + // hri_sercomspi_get_CTRLA_CPOL_bit(hw) == polarity && + // hri_sercomspi_read_CTRLB_CHSIZE_bf(hw) == ((uint32_t)bits - 8) && + // hri_sercomspi_read_BAUD_BAUD_bf(hw) == baud_reg_value) { + // return true; + // } + + // Disable, set values (most or all are enable-protected), and re-enable. + // spi_m_sync_disable(&self->spi_desc); + // hri_sercomspi_wait_for_sync(hw, SERCOM_SPI_SYNCBUSY_MASK); + + // hri_sercomspi_write_CTRLA_CPHA_bit(hw, phase); + // hri_sercomspi_write_CTRLA_CPOL_bit(hw, polarity); + // hri_sercomspi_write_CTRLB_CHSIZE_bf(hw, bits - 8); + // hri_sercomspi_write_BAUD_BAUD_bf(hw, baud_reg_value); + // hri_sercomspi_wait_for_sync(hw, SERCOM_SPI_SYNCBUSY_MASK); + + // spi_m_sync_enable(&self->spi_desc); + // hri_sercomspi_wait_for_sync(hw, SERCOM_SPI_SYNCBUSY_MASK); + + return true; +} + +bool common_hal_busio_spi_try_lock(busio_spi_obj_t *self) { + bool grabbed_lock = false; + // CRITICAL_SECTION_ENTER() + if (!self->has_lock) { + grabbed_lock = true; + self->has_lock = true; + } + // CRITICAL_SECTION_LEAVE(); + return grabbed_lock; +} + +bool common_hal_busio_spi_has_lock(busio_spi_obj_t *self) { + return self->has_lock; +} + +void common_hal_busio_spi_unlock(busio_spi_obj_t *self) { + self->has_lock = false; +} + +bool common_hal_busio_spi_write(busio_spi_obj_t *self, + const uint8_t *data, size_t len) { + if (len == 0) { + return true; + } + // int32_t status; + if (len >= 16) { + // status = sercom_dma_write(self->spi_desc.dev.prvt, data, len); + } else { + // struct io_descriptor *spi_io; + // spi_m_sync_get_io_descriptor(&self->spi_desc, &spi_io); + // status = spi_io->write(spi_io, data, len); + } + return false; // Status is number of chars read or an error code < 0. +} + +bool common_hal_busio_spi_read(busio_spi_obj_t *self, + uint8_t *data, size_t len, uint8_t write_value) { + if (len == 0) { + return true; + } + // int32_t status; + if (len >= 16) { + // status = sercom_dma_read(self->spi_desc.dev.prvt, data, len, write_value); + } else { + // self->spi_desc.dev.dummy_byte = write_value; + + // struct io_descriptor *spi_io; + // spi_m_sync_get_io_descriptor(&self->spi_desc, &spi_io); + + // status = spi_io->read(spi_io, data, len); + } + return false; // Status is number of chars read or an error code < 0. +} + +bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uint8_t *data_in, size_t len) { + if (len == 0) { + return true; + } + // int32_t status; + if (len >= 16) { + // status = sercom_dma_transfer(self->spi_desc.dev.prvt, data_out, data_in, len); + } else { + // struct spi_xfer xfer; + // xfer.txbuf = data_out; + // xfer.rxbuf = data_in; + // xfer.size = len; + // status = spi_m_sync_transfer(&self->spi_desc, &xfer); + } + return false; // Status is number of chars read or an error code < 0. +} + +uint32_t common_hal_busio_spi_get_frequency(busio_spi_obj_t* self) { + // return samd_peripherals_spi_baud_reg_value_to_baudrate(hri_sercomspi_read_BAUD_reg(self->spi_desc.dev.prvt)); + return 0; +} + +uint8_t common_hal_busio_spi_get_phase(busio_spi_obj_t* self) { + // void * hw = self->spi_desc.dev.prvt; + // return hri_sercomspi_get_CTRLA_CPHA_bit(hw); + return 0; +} + +uint8_t common_hal_busio_spi_get_polarity(busio_spi_obj_t* self) { + // void * hw = self->spi_desc.dev.prvt; + // return hri_sercomspi_get_CTRLA_CPOL_bit(hw); + return 0; +} diff --git a/ports/esp32s2/common-hal/busio/SPI.h b/ports/esp32s2/common-hal/busio/SPI.h new file mode 100644 index 0000000000..0ff1a4f7ea --- /dev/null +++ b/ports/esp32s2/common-hal/busio/SPI.h @@ -0,0 +1,44 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * 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_ESP32S2_COMMON_HAL_BUSIO_SPI_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_SPI_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + bool has_lock; + const mcu_pin_obj_t* clock_pin; + const mcu_pin_obj_t* MOSI_pin; + const mcu_pin_obj_t* MISO_pin; +} busio_spi_obj_t; + +void spi_reset(void); + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_SPI_H diff --git a/ports/esp32s2/common-hal/busio/UART.c b/ports/esp32s2/common-hal/busio/UART.c new file mode 100644 index 0000000000..4a016ad1a8 --- /dev/null +++ b/ports/esp32s2/common-hal/busio/UART.c @@ -0,0 +1,405 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 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 "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/busio/UART.h" + +#include "mpconfigport.h" +#include "lib/utils/interrupt_char.h" +#include "py/gc.h" +#include "py/mperrno.h" +#include "py/runtime.h" +#include "py/stream.h" +#include "supervisor/shared/translate.h" +#include "supervisor/shared/tick.h" + +#define UART_DEBUG(...) (void)0 +// #define UART_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) + +// Do-nothing callback needed so that usart_async code will enable rx interrupts. +// See comment below re usart_async_register_callback() +// static void usart_async_rxc_callback(const struct usart_async_descriptor *const descr) { +// // Nothing needs to be done by us. +// } + +void uart_reset(void) { + +} + +void common_hal_busio_uart_construct(busio_uart_obj_t *self, + const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, + const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, + const mcu_pin_obj_t * rs485_dir, bool rs485_invert, + uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, + mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, + bool sigint_enabled) { + + // uint8_t sercom_index = 255; // Unset index + // uint32_t rx_pinmux = 0; + // uint8_t rx_pad = 255; // Unset pad + // uint32_t tx_pinmux = 0; + // uint8_t tx_pad = 255; // Unset pad + + // if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) { + // mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); + // } + + // if (bits > 8) { + // mp_raise_NotImplementedError(translate("bytes > 8 bits not supported")); + // } + + bool have_tx = tx != NULL; + bool have_rx = rx != NULL; + if (!have_tx && !have_rx) { + mp_raise_ValueError(translate("tx and rx cannot both be None")); + } + + self->baudrate = baudrate; + self->character_bits = bits; + self->timeout_ms = timeout * 1000; + + // This assignment is only here because the usart_async routines take a *const argument. +// struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; + +// for (int i = 0; i < NUM_SERCOMS_PER_PIN; i++) { +// Sercom* potential_sercom = NULL; +// if (have_tx) { +// sercom_index = tx->sercom[i].index; +// if (sercom_index >= SERCOM_INST_NUM) { +// continue; +// } +// potential_sercom = sercom_insts[sercom_index]; +// #ifdef SAMD21 +// if (potential_sercom->USART.CTRLA.bit.ENABLE != 0 || +// !(tx->sercom[i].pad == 0 || +// tx->sercom[i].pad == 2)) { +// continue; +// } +// #endif +// #ifdef SAMD51 +// if (potential_sercom->USART.CTRLA.bit.ENABLE != 0 || +// !(tx->sercom[i].pad == 0)) { +// continue; +// } +// #endif +// tx_pinmux = PINMUX(tx->number, (i == 0) ? MUX_C : MUX_D); +// tx_pad = tx->sercom[i].pad; +// if (rx == NULL) { +// sercom = potential_sercom; +// break; +// } +// } +// for (int j = 0; j < NUM_SERCOMS_PER_PIN; j++) { +// if (((!have_tx && rx->sercom[j].index < SERCOM_INST_NUM && +// sercom_insts[rx->sercom[j].index]->USART.CTRLA.bit.ENABLE == 0) || +// sercom_index == rx->sercom[j].index) && +// rx->sercom[j].pad != tx_pad) { +// rx_pinmux = PINMUX(rx->number, (j == 0) ? MUX_C : MUX_D); +// rx_pad = rx->sercom[j].pad; +// sercom = sercom_insts[rx->sercom[j].index]; +// sercom_index = rx->sercom[j].index; +// break; +// } +// } +// if (sercom != NULL) { +// break; +// } +// } + // if (sercom == NULL) { + // mp_raise_ValueError(translate("Invalid pins")); + // } + // if (!have_tx) { + // tx_pad = 0; + // if (rx_pad == 0) { + // tx_pad = 2; + // } + // } + // if (!have_rx) { + // rx_pad = (tx_pad + 1) % 4; + // } + + // // Set up clocks on SERCOM. + // samd_peripherals_sercom_clock_init(sercom, sercom_index); + + // if (rx && receiver_buffer_size > 0) { + // self->buffer_length = receiver_buffer_size; + // // Initially allocate the UART's buffer in the long-lived part of the + // // heap. UARTs are generally long-lived objects, but the "make long- + // // lived" machinery is incapable of moving internal pointers like + // // self->buffer, so do it manually. (However, as long as internal + // // pointers like this are NOT moved, allocating the buffer + // // in the long-lived pool is not strictly necessary) + // self->buffer = (uint8_t *) gc_alloc(self->buffer_length * sizeof(uint8_t), false, true); + // if (self->buffer == NULL) { + // common_hal_busio_uart_deinit(self); + // mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), self->buffer_length * sizeof(uint8_t)); + // } + // } else { + // self->buffer_length = 0; + // self->buffer = NULL; + // } + + // if (usart_async_init(usart_desc_p, sercom, self->buffer, self->buffer_length, NULL) != ERR_NONE) { + // mp_raise_ValueError(translate("Could not initialize UART")); + // } + + // usart_async_init() sets a number of defaults based on a prototypical SERCOM + // which don't necessarily match what we need. After calling it, set the values + // specific to this instantiation of UART. + + // Set pads computed for this SERCOM. + // TXPO: + // 0x0: TX pad 0; no RTS/CTS + // 0x1: TX pad 2; no RTS/CTS + // 0x2: TX pad 0; RTS: pad 2, CTS: pad 3 (not used by us right now) + // So divide by 2 to map pad to value. + // RXPO: + // 0x0: RX pad 0 + // 0x1: RX pad 1 + // 0x2: RX pad 2 + // 0x3: RX pad 3 + + // Doing a group mask and set of the registers saves 60 bytes over setting the bitfields individually. + + // sercom->USART.CTRLA.reg &= ~(SERCOM_USART_CTRLA_TXPO_Msk | + // SERCOM_USART_CTRLA_RXPO_Msk | + // SERCOM_USART_CTRLA_FORM_Msk); + // sercom->USART.CTRLA.reg |= SERCOM_USART_CTRLA_TXPO(tx_pad / 2) | + // SERCOM_USART_CTRLA_RXPO(rx_pad) | + // (parity == PARITY_NONE ? 0 : SERCOM_USART_CTRLA_FORM(1)); + + // Enable tx and/or rx based on whether the pins were specified. + // CHSIZE is 0 for 8 bits, 5, 6, 7 for 5, 6, 7 bits. 1 for 9 bits, but we don't support that. + // sercom->USART.CTRLB.reg &= ~(SERCOM_USART_CTRLB_TXEN | + // SERCOM_USART_CTRLB_RXEN | + // SERCOM_USART_CTRLB_PMODE | + // SERCOM_USART_CTRLB_SBMODE | + // SERCOM_USART_CTRLB_CHSIZE_Msk); + // sercom->USART.CTRLB.reg |= (have_tx ? SERCOM_USART_CTRLB_TXEN : 0) | + // (have_rx ? SERCOM_USART_CTRLB_RXEN : 0) | + // (parity == PARITY_ODD ? SERCOM_USART_CTRLB_PMODE : 0) | + // (stop > 1 ? SERCOM_USART_CTRLB_SBMODE : 0) | + // SERCOM_USART_CTRLB_CHSIZE(bits % 8); + + // Set baud rate + // common_hal_busio_uart_set_baudrate(self, baudrate); + + // Turn on rx interrupt handling. The UART async driver has its own set of internal callbacks, + // which are set up by uart_async_init(). These in turn can call user-specified callbacks. + // In fact, the actual interrupts are not enabled unless we set up a user-specified callback. + // This is confusing. It's explained in the Atmel START User Guide -> Implementation Description -> + // Different read function behavior in some asynchronous drivers. As of this writing: + // http://start.atmel.com/static/help/index.html?GUID-79201A5A-226F-4FBB-B0B8-AB0BE0554836 + // Look at the ASFv4 code example for async USART. + // usart_async_register_callback(usart_desc_p, USART_ASYNC_RXC_CB, usart_async_rxc_callback); + + + // if (have_tx) { + // gpio_set_pin_direction(tx->number, GPIO_DIRECTION_OUT); + // gpio_set_pin_pull_mode(tx->number, GPIO_PULL_OFF); + // gpio_set_pin_function(tx->number, tx_pinmux); + // self->tx_pin = tx->number; + // claim_pin(tx); + // } else { + // self->tx_pin = NO_PIN; + // } + + // if (have_rx) { + // gpio_set_pin_direction(rx->number, GPIO_DIRECTION_IN); + // gpio_set_pin_pull_mode(rx->number, GPIO_PULL_OFF); + // gpio_set_pin_function(rx->number, rx_pinmux); + // self->rx_pin = rx->number; + // claim_pin(rx); + // } else { + // self->rx_pin = NO_PIN; + // } + + // usart_async_enable(usart_desc_p); +} + +bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { + return self->rx_pin == NULL && self->tx_pin == NULL; +} + +void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { + if (common_hal_busio_uart_deinited(self)) { + return; + } + // // This assignment is only here because the usart_async routines take a *const argument. + // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; + // usart_async_disable(usart_desc_p); + // usart_async_deinit(usart_desc_p); + reset_pin(self->rx_pin); + reset_pin(self->tx_pin); + self->rx_pin = NULL; + self->tx_pin = NULL; +} + +// Read characters. +size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t len, int *errcode) { + if (self->rx_pin == NULL) { + mp_raise_ValueError(translate("No RX pin")); + } + + // This assignment is only here because the usart_async routines take a *const argument. + // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; + + if (len == 0) { + // Nothing to read. + return 0; + } + + // struct io_descriptor *io; + // usart_async_get_io_descriptor(usart_desc_p, &io); + + // size_t total_read = 0; + // uint64_t start_ticks = supervisor_ticks_ms64(); + + // Busy-wait until timeout or until we've read enough chars. + // while (supervisor_ticks_ms64() - start_ticks <= self->timeout_ms) { + // // Read as many chars as we can right now, up to len. + // size_t num_read = io_read(io, data, len); + + // // Advance pointer in data buffer, and decrease how many chars left to read. + // data += num_read; + // len -= num_read; + // total_read += num_read; + // if (len == 0) { + // // Don't need to read any more: data buf is full. + // break; + // } + // if (num_read > 0) { + // // Reset the timeout on every character read. + // start_ticks = supervisor_ticks_ms64(); + // } + // RUN_BACKGROUND_TASKS; + // // Allow user to break out of a timeout with a KeyboardInterrupt. + // if (mp_hal_is_interrupted()) { + // break; + // } + // // If we are zero timeout, make sure we don't loop again (in the event + // // we read in under 1ms) + // if (self->timeout_ms == 0) { + // break; + // } + // } + + // if (total_read == 0) { + // *errcode = EAGAIN; + // return MP_STREAM_ERROR; + // } + + // return total_read; + return 0; +} + +// Write characters. +size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, size_t len, int *errcode) { + if (self->tx_pin == NULL) { + mp_raise_ValueError(translate("No TX pin")); + } + + // This assignment is only here because the usart_async routines take a *const argument. + // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; + + // struct io_descriptor *io; + // usart_async_get_io_descriptor(usart_desc_p, &io); + + // // Start writing characters. This is non-blocking and will + // // return immediately after setting up the write. + // if (io_write(io, data, len) < 0) { + // *errcode = MP_EAGAIN; + // return MP_STREAM_ERROR; + // } + + // // Busy-wait until all characters transmitted. + // struct usart_async_status async_status; + // while (true) { + // usart_async_get_status(usart_desc_p, &async_status); + // if (async_status.txcnt >= len) { + // break; + // } + // RUN_BACKGROUND_TASKS; + // } + + return len; +} + +uint32_t common_hal_busio_uart_get_baudrate(busio_uart_obj_t *self) { + return self->baudrate; +} + +void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrate) { + // This assignment is only here because the usart_async routines take a *const argument. + // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; + // usart_async_set_baud_rate(usart_desc_p, + // // Samples and ARITHMETIC vs FRACTIONAL must correspond to USART_SAMPR in + // // hpl_sercom_config.h. + // _usart_async_calculate_baud_rate(baudrate, // e.g. 9600 baud + // PROTOTYPE_SERCOM_USART_ASYNC_CLOCK_FREQUENCY, + // 16, // samples + // USART_BAUDRATE_ASYNCH_ARITHMETIC, + // 0 // fraction - not used for ARITHMETIC + // )); + self->baudrate = baudrate; +} + +mp_float_t common_hal_busio_uart_get_timeout(busio_uart_obj_t *self) { + return (mp_float_t) (self->timeout_ms / 1000.0f); +} + +void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeout) { + self->timeout_ms = timeout * 1000; +} + +uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { + // This assignment is only here because the usart_async routines take a *const argument. + // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; + // struct usart_async_status async_status; + // usart_async_get_status(usart_desc_p, &async_status); + // return async_status.rxcnt; + return 0; +} + +void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { + // This assignment is only here because the usart_async routines take a *const argument. + // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; + // usart_async_flush_rx_buffer(usart_desc_p); + +} + +// True if there are no characters still to be written. +bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { + if (self->tx_pin == NULL) { + return false; + } + // This assignment is only here because the usart_async routines take a *const argument. + // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; + // struct usart_async_status async_status; + // usart_async_get_status(usart_desc_p, &async_status); + // return !(async_status.flags & USART_ASYNC_STATUS_BUSY); + return false; +} diff --git a/ports/esp32s2/common-hal/busio/UART.h b/ports/esp32s2/common-hal/busio/UART.h new file mode 100644 index 0000000000..3c2bd1dac5 --- /dev/null +++ b/ports/esp32s2/common-hal/busio/UART.h @@ -0,0 +1,48 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * 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_ESP32S2_COMMON_HAL_BUSIO_UART_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_UART_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t* rx_pin; + const mcu_pin_obj_t* tx_pin; + uint8_t character_bits; + bool rx_error; + uint32_t baudrate; + uint32_t timeout_ms; + uint32_t buffer_length; + uint8_t* buffer; +} busio_uart_obj_t; + +void uart_reset(void); + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_UART_H diff --git a/ports/esp32s2/common-hal/busio/__init__.c b/ports/esp32s2/common-hal/busio/__init__.c new file mode 100644 index 0000000000..41761b6743 --- /dev/null +++ b/ports/esp32s2/common-hal/busio/__init__.c @@ -0,0 +1 @@ +// No busio module functions. diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index 4c39eea164..fd815518d5 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -49,6 +49,10 @@ void reset_pin_number(gpio_num_t pin_number) { in_use[pin_number / 32] &= ~(1 << pin_number % 32); } +void reset_pin(const mcu_pin_obj_t* pin) { + reset_pin_number(pin->number); +} + void reset_all_pins(void) { for (uint8_t i = 0; i < GPIO_PIN_COUNT; i++) { uint32_t iomux_address = GPIO_PIN_MUX_REG[i]; diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.h b/ports/esp32s2/common-hal/microcontroller/Pin.h index 6f47b1ed31..573eec392b 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.h +++ b/ports/esp32s2/common-hal/microcontroller/Pin.h @@ -35,6 +35,7 @@ void reset_all_pins(void); // reset_pin_number takes the pin number instead of the pointer so that objects don't // need to store a full pointer. void reset_pin_number(gpio_num_t pin_number); +void reset_pin(const mcu_pin_obj_t* pin); void claim_pin(const mcu_pin_obj_t* pin); bool pin_number_is_free(gpio_num_t pin_number); void never_reset_pin_number(gpio_num_t pin_number); diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index c9df81db03..9f59c1b467 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -16,10 +16,10 @@ CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_ANALOGIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 -CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITBANGIO = 1 CIRCUITPY_BOARD = 1 CIRCUITPY_DIGITALIO = 1 -CIRCUITPY_BUSIO = 0 +CIRCUITPY_BUSIO = 1 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 2437b4f341..fbfbc9f2eb 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -35,6 +35,9 @@ #include "freertos/task.h" #include "common-hal/microcontroller/Pin.h" +#include "common-hal/busio/I2C.h" +#include "common-hal/busio/SPI.h" +#include "common-hal/busio/UART.h" #include "supervisor/memory.h" #include "supervisor/shared/tick.h" @@ -64,8 +67,13 @@ safe_mode_t port_init(void) { } void reset_port(void) { - reset_all_pins(); + +#if CIRCUITPY_BUSIO + i2c_reset(); + spi_reset(); + uart_reset(); +#endif } void reset_to_bootloader(void) { From ae52d052cb6b4fb6cd89702dafe8448565b4aa5e Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 29 May 2020 16:32:31 -0700 Subject: [PATCH 0072/1293] Fix I2C thanks to Mark! --- ports/esp32s2/common-hal/busio/I2C.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/esp32s2/common-hal/busio/I2C.c index 80743dc894..0a696bed61 100644 --- a/ports/esp32s2/common-hal/busio/I2C.c +++ b/ports/esp32s2/common-hal/busio/I2C.c @@ -218,7 +218,10 @@ uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, i2c_cmd_handle_t cmd = i2c_cmd_link_create(); i2c_master_start(cmd); i2c_master_write_byte(cmd, addr << 1 | 1, true); // | 1 to indicate read - i2c_master_read(cmd, data, len, true); + if (len > 1) { + i2c_master_read(cmd, data, len - 1, 0); + } + i2c_master_read_byte(cmd, data + len - 1, 1); i2c_master_stop(cmd); esp_err_t result = i2c_master_cmd_begin(self->i2c_num, cmd, 100 /* wait in ticks */); i2c_cmd_link_delete(cmd); From 6f050d7af368afb3eb45ac34533727794fa66c58 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 3 Jun 2020 14:05:21 -0700 Subject: [PATCH 0073/1293] Add pull up testing, proper us delay and stop supporting 45 and 46 for I2C --- ports/esp32s2/common-hal/busio/I2C.c | 72 ++++++++++------------------ ports/esp32s2/mphalport.c | 3 +- 2 files changed, 28 insertions(+), 47 deletions(-) diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/esp32s2/common-hal/busio/I2C.c index 0a696bed61..fd983619ff 100644 --- a/ports/esp32s2/common-hal/busio/I2C.c +++ b/ports/esp32s2/common-hal/busio/I2C.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Scott Shawcroft + * Copyright (c) 2020 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 @@ -30,16 +30,9 @@ #include "driver/i2c.h" -#include "esp_log.h" - #include "shared-bindings/microcontroller/__init__.h" #include "supervisor/shared/translate.h" -// Number of times to try to send packet if failed. -#define ATTEMPTS 2 - -static const char* TAG = "CircuitPython I2C"; - typedef enum { STATUS_FREE = 0, STATUS_IN_USE, @@ -63,42 +56,43 @@ void i2c_reset(void) { void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, const mcu_pin_obj_t* scl, const mcu_pin_obj_t* sda, uint32_t frequency, uint32_t timeout) { - - // Make sure scl and sda aren't input only + // Pins 45 and 46 are "strapping" pins that impact start up behavior. They usually need to + // be pulled-down so pulling them up for I2C is a bad idea. To make this hard, we don't + // support I2C on these pins. + // + // 46 is also input-only so it'll never work. + if (scl->number == 45 || scl->number == 46 || sda->number == 45 || sda->number == 46) { + mp_raise_ValueError(translate("Invalid pins")); + } #if CIRCUITPY_REQUIRE_I2C_PULLUPS - // // Test that the pins are in a high state. (Hopefully indicating they are pulled up.) - // gpio_set_pin_function(sda->number, GPIO_PIN_FUNCTION_OFF); - // gpio_set_pin_function(scl->number, GPIO_PIN_FUNCTION_OFF); - // gpio_set_pin_direction(sda->number, GPIO_DIRECTION_IN); - // gpio_set_pin_direction(scl->number, GPIO_DIRECTION_IN); + // Test that the pins are in a high state. (Hopefully indicating they are pulled up.) + gpio_set_direction(sda->number, GPIO_MODE_DEF_INPUT); + gpio_set_direction(scl->number, GPIO_MODE_DEF_INPUT); - // gpio_set_pin_pull_mode(sda->number, GPIO_PULL_DOWN); - // gpio_set_pin_pull_mode(scl->number, GPIO_PULL_DOWN); + gpio_pulldown_en(sda->number); + gpio_pulldown_en(scl->number); - // common_hal_mcu_delay_us(10); + common_hal_mcu_delay_us(10); - // gpio_set_pin_pull_mode(sda->number, GPIO_PULL_OFF); - // gpio_set_pin_pull_mode(scl->number, GPIO_PULL_OFF); + gpio_pulldown_dis(sda->number); + gpio_pulldown_dis(scl->number); - // // We must pull up within 3us to achieve 400khz. - // common_hal_mcu_delay_us(3); + // We must pull up within 3us to achieve 400khz. + common_hal_mcu_delay_us(3); - // if (!gpio_get_pin_level(sda->number) || !gpio_get_pin_level(scl->number)) { - // reset_pin_number(sda->number); - // reset_pin_number(scl->number); - // mp_raise_RuntimeError(translate("SDA or SCL needs a pull up")); - // } + if (gpio_get_level(sda->number) == 0 || gpio_get_level(scl->number) == 0) { + reset_pin_number(sda->number); + reset_pin_number(scl->number); + mp_raise_RuntimeError(translate("SDA or SCL needs a pull up")); + } #endif - ESP_EARLY_LOGW(TAG, "create I2C"); self->semaphore_handle = xSemaphoreCreateBinaryStatic(&self->semaphore); xSemaphoreGive(self->semaphore_handle); - ESP_EARLY_LOGW(TAG, "new I2C lock %x", self->semaphore_handle); self->sda_pin = sda; self->scl_pin = scl; - ESP_EARLY_LOGW(TAG, "scl %d sda %d", self->sda_pin->number, self->scl_pin->number); self->i2c_num = I2C_NUM_MAX; for (i2c_port_t num = 0; num < I2C_NUM_MAX; num++) { if (i2c_status[num] == STATUS_FREE) { @@ -120,15 +114,10 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, .clk_speed = frequency, } }; - // ESP_EARLY_LOGW(TAG, "param config %p %p %d %d", &i2c_conf, &(i2c_conf.mode), i2c_conf.mode, I2C_MODE_MAX); - ESP_EARLY_LOGW(TAG, "param config %p %d %d", &i2c_conf, i2c_conf.mode, I2C_MODE_MAX); esp_err_t result = i2c_param_config(self->i2c_num, &i2c_conf); if (result != ESP_OK) { - ESP_EARLY_LOGW(TAG, "error %d %p %d %d", result, &i2c_conf, (&i2c_conf)->mode, I2C_MODE_MAX); - vTaskDelay(0); mp_raise_ValueError(translate("Invalid pins")); } - ESP_EARLY_LOGW(TAG, "param config I2C done"); result = i2c_driver_install(self->i2c_num, I2C_MODE_MASTER, 0, @@ -140,7 +129,6 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, claim_pin(sda); claim_pin(scl); - ESP_EARLY_LOGW(TAG, "create I2C done"); } bool common_hal_busio_i2c_deinited(busio_i2c_obj_t *self) { @@ -166,19 +154,13 @@ bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) { i2c_master_start(cmd); i2c_master_write_byte(cmd, addr << 1, true); i2c_master_stop(cmd); - esp_err_t result = i2c_master_cmd_begin(self->i2c_num, cmd, 100); + esp_err_t result = i2c_master_cmd_begin(self->i2c_num, cmd, 10); i2c_cmd_link_delete(cmd); return result == ESP_OK; } bool common_hal_busio_i2c_try_lock(busio_i2c_obj_t *self) { - ESP_EARLY_LOGW(TAG, "locking I2C %x", self->semaphore_handle); self->has_lock = xSemaphoreTake(self->semaphore_handle, 0) == pdTRUE; - if (self->has_lock) { - ESP_EARLY_LOGW(TAG, "lock grabbed"); - } else { - ESP_EARLY_LOGW(TAG, "unable to grab lock"); - } return self->has_lock; } @@ -187,7 +169,6 @@ bool common_hal_busio_i2c_has_lock(busio_i2c_obj_t *self) { } void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) { - ESP_EARLY_LOGW(TAG, "unlocking I2C"); xSemaphoreGive(self->semaphore_handle); self->has_lock = false; } @@ -213,8 +194,7 @@ uint8_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr, } uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, - uint8_t *data, size_t len) { - + uint8_t *data, size_t len) { i2c_cmd_handle_t cmd = i2c_cmd_link_create(); i2c_master_start(cmd); i2c_master_write_byte(cmd, addr << 1 | 1, true); // | 1 to indicate read diff --git a/ports/esp32s2/mphalport.c b/ports/esp32s2/mphalport.c index da5258b0e2..e1662a6ce2 100644 --- a/ports/esp32s2/mphalport.c +++ b/ports/esp32s2/mphalport.c @@ -32,9 +32,10 @@ #include "py/gc.h" #include "esp-idf/components/xtensa/include/esp_debug_helpers.h" +#include "esp-idf/components/esp_rom/include/esp32s2/rom/ets_sys.h" void mp_hal_delay_us(mp_uint_t delay) { - mp_hal_delay_ms(delay / 1000); + ets_delay_us(delay); } // This is provided by the esp-idf/components/xtensa/esp32s2/libhal.a binary From a26102607e3fe5b6f888fcd246e20ac82a70af7b Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 9 Jun 2020 18:28:02 -0700 Subject: [PATCH 0074/1293] Add UART support --- Makefile | 9 + ports/atmel-samd/common-hal/busio/UART.c | 6 +- ports/cxd56/common-hal/busio/UART.c | 4 +- ports/esp32s2/common-hal/busio/UART.c | 480 ++++++++++------------- ports/esp32s2/common-hal/busio/UART.h | 7 +- ports/esp32s2/esp-idf | 2 +- ports/mimxrt10xx/common-hal/busio/UART.c | 4 +- ports/nrf/common-hal/busio/UART.c | 6 +- ports/stm/common-hal/busio/UART.c | 6 +- shared-bindings/busio/UART.c | 14 +- shared-bindings/busio/UART.h | 10 +- shared-module/board/__init__.c | 2 +- 12 files changed, 250 insertions(+), 300 deletions(-) diff --git a/Makefile b/Makefile index 55f64b17df..0df1950938 100644 --- a/Makefile +++ b/Makefile @@ -243,3 +243,12 @@ stubs: update-frozen-libraries: @echo "Updating all frozen libraries to latest tagged version." cd frozen; for library in *; do cd $$library; ../../tools/git-checkout-latest-tag.sh; cd ..; done + +one-of-each: all-source + make -C ports/atmel-samd BOARD=trinket_m0 + make -C ports/atmel-samd BOARD=feather_m4_express + make -C ports/esp32s2 BOARD=espressif_saola_1_wroom + make -C ports/litex BOARD=fomu + make -C ports/mimxrt10xx BOARD=feather_mimxrt1011 + make -C ports/nrf BOARD=feather_nrf52840_express + make -C ports/stm BOARD=feather_stm32f405_express diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index 9f740dc8af..9e213e061a 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -58,7 +58,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, - uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, + uint32_t baudrate, uint8_t bits, busio_uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, bool sigint_enabled) { @@ -195,7 +195,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, SERCOM_USART_CTRLA_FORM_Msk); sercom->USART.CTRLA.reg |= SERCOM_USART_CTRLA_TXPO(tx_pad / 2) | SERCOM_USART_CTRLA_RXPO(rx_pad) | - (parity == PARITY_NONE ? 0 : SERCOM_USART_CTRLA_FORM(1)); + (parity == BUSIO_UART_PARITY_NONE ? 0 : SERCOM_USART_CTRLA_FORM(1)); // Enable tx and/or rx based on whether the pins were specified. // CHSIZE is 0 for 8 bits, 5, 6, 7 for 5, 6, 7 bits. 1 for 9 bits, but we don't support that. @@ -206,7 +206,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, SERCOM_USART_CTRLB_CHSIZE_Msk); sercom->USART.CTRLB.reg |= (have_tx ? SERCOM_USART_CTRLB_TXEN : 0) | (have_rx ? SERCOM_USART_CTRLB_RXEN : 0) | - (parity == PARITY_ODD ? SERCOM_USART_CTRLB_PMODE : 0) | + (parity == BUSIO_UART_PARITY_ODD ? SERCOM_USART_CTRLB_PMODE : 0) | (stop > 1 ? SERCOM_USART_CTRLB_SBMODE : 0) | SERCOM_USART_CTRLB_CHSIZE(bits % 8); diff --git a/ports/cxd56/common-hal/busio/UART.c b/ports/cxd56/common-hal/busio/UART.c index e455b0568d..52d2afc0c2 100644 --- a/ports/cxd56/common-hal/busio/UART.c +++ b/ports/cxd56/common-hal/busio/UART.c @@ -56,7 +56,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, - uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, + uint32_t baudrate, uint8_t bits, busio_uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, bool sigint_enabled) { struct termios tio; @@ -69,7 +69,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_raise_ValueError(translate("Could not initialize UART")); } - if (parity != PARITY_NONE) { + if (parity != BUSIO_UART_PARITY_NONE) { mp_raise_ValueError(translate("Could not initialize UART")); } diff --git a/ports/esp32s2/common-hal/busio/UART.c b/ports/esp32s2/common-hal/busio/UART.c index 4a016ad1a8..d52e50cade 100644 --- a/ports/esp32s2/common-hal/busio/UART.c +++ b/ports/esp32s2/common-hal/busio/UART.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George + * Copyright (c) 2020 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 @@ -27,6 +27,8 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/busio/UART.h" +#include "driver/uart.h" + #include "mpconfigport.h" #include "lib/utils/interrupt_char.h" #include "py/gc.h" @@ -36,208 +38,178 @@ #include "supervisor/shared/translate.h" #include "supervisor/shared/tick.h" -#define UART_DEBUG(...) (void)0 -// #define UART_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) - -// Do-nothing callback needed so that usart_async code will enable rx interrupts. -// See comment below re usart_async_register_callback() -// static void usart_async_rxc_callback(const struct usart_async_descriptor *const descr) { -// // Nothing needs to be done by us. -// } - void uart_reset(void) { - + for (uart_port_t num = 0; num < UART_NUM_MAX; num++) { + // Ignore the UART used by the IDF. + #ifdef CONFIG_CONSOLE_UART_NUM + if (num == CONFIG_CONSOLE_UART_NUM) { + continue; + } + #endif + if (uart_is_driver_installed(num)) { + uart_driver_delete(num); + } + } } void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, - uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, + uint32_t baudrate, uint8_t bits, busio_uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, bool sigint_enabled) { - // uint8_t sercom_index = 255; // Unset index - // uint32_t rx_pinmux = 0; - // uint8_t rx_pad = 255; // Unset pad - // uint32_t tx_pinmux = 0; - // uint8_t tx_pad = 255; // Unset pad - - // if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) { - // mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); - // } - - // if (bits > 8) { - // mp_raise_NotImplementedError(translate("bytes > 8 bits not supported")); - // } + if (bits > 8) { + mp_raise_NotImplementedError(translate("bytes > 8 bits not supported")); + } bool have_tx = tx != NULL; bool have_rx = rx != NULL; + bool have_rts = rts != NULL; + bool have_cts = cts != NULL; + bool have_rs485_dir = rs485_dir != NULL; if (!have_tx && !have_rx) { mp_raise_ValueError(translate("tx and rx cannot both be None")); } - self->baudrate = baudrate; - self->character_bits = bits; + // Filter for sane settings for RS485 + if (have_rs485_dir) { + if (have_rts || have_cts) { + mp_raise_ValueError(translate("Cannot specify RTS or CTS in RS485 mode")); + } + } else if (rs485_invert) { + mp_raise_ValueError(translate("RS485 inversion specified when not in RS485 mode")); + } + self->timeout_ms = timeout * 1000; - // This assignment is only here because the usart_async routines take a *const argument. -// struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; + self->uart_num = UART_NUM_MAX; + for (uart_port_t num = 0; num < UART_NUM_MAX; num++) { + if (!uart_is_driver_installed(num)) { + self->uart_num = num; + } + } + if (self->uart_num == UART_NUM_MAX) { + mp_raise_ValueError(translate("All UART peripherals are in use")); + } -// for (int i = 0; i < NUM_SERCOMS_PER_PIN; i++) { -// Sercom* potential_sercom = NULL; -// if (have_tx) { -// sercom_index = tx->sercom[i].index; -// if (sercom_index >= SERCOM_INST_NUM) { -// continue; -// } -// potential_sercom = sercom_insts[sercom_index]; -// #ifdef SAMD21 -// if (potential_sercom->USART.CTRLA.bit.ENABLE != 0 || -// !(tx->sercom[i].pad == 0 || -// tx->sercom[i].pad == 2)) { -// continue; -// } -// #endif -// #ifdef SAMD51 -// if (potential_sercom->USART.CTRLA.bit.ENABLE != 0 || -// !(tx->sercom[i].pad == 0)) { -// continue; -// } -// #endif -// tx_pinmux = PINMUX(tx->number, (i == 0) ? MUX_C : MUX_D); -// tx_pad = tx->sercom[i].pad; -// if (rx == NULL) { -// sercom = potential_sercom; -// break; -// } -// } -// for (int j = 0; j < NUM_SERCOMS_PER_PIN; j++) { -// if (((!have_tx && rx->sercom[j].index < SERCOM_INST_NUM && -// sercom_insts[rx->sercom[j].index]->USART.CTRLA.bit.ENABLE == 0) || -// sercom_index == rx->sercom[j].index) && -// rx->sercom[j].pad != tx_pad) { -// rx_pinmux = PINMUX(rx->number, (j == 0) ? MUX_C : MUX_D); -// rx_pad = rx->sercom[j].pad; -// sercom = sercom_insts[rx->sercom[j].index]; -// sercom_index = rx->sercom[j].index; -// break; -// } -// } -// if (sercom != NULL) { -// break; -// } -// } - // if (sercom == NULL) { - // mp_raise_ValueError(translate("Invalid pins")); - // } - // if (!have_tx) { - // tx_pad = 0; - // if (rx_pad == 0) { - // tx_pad = 2; - // } - // } - // if (!have_rx) { - // rx_pad = (tx_pad + 1) % 4; - // } + uart_mode_t mode = UART_MODE_UART; + uart_hw_flowcontrol_t flow_control = UART_HW_FLOWCTRL_DISABLE; + if (have_rs485_dir) { + mode = UART_MODE_RS485_HALF_DUPLEX; + if (!rs485_invert) { + uart_set_line_inverse(self->uart_num, UART_SIGNAL_DTR_INV); + } + } else if (have_rts && have_cts) { + flow_control = UART_HW_FLOWCTRL_CTS_RTS; + } else if (have_rts) { + flow_control = UART_HW_FLOWCTRL_RTS; + } else if (have_rts) { + flow_control = UART_HW_FLOWCTRL_CTS; + } - // // Set up clocks on SERCOM. - // samd_peripherals_sercom_clock_init(sercom, sercom_index); + if (receiver_buffer_size <= UART_FIFO_LEN) { + receiver_buffer_size = UART_FIFO_LEN + 8; + } - // if (rx && receiver_buffer_size > 0) { - // self->buffer_length = receiver_buffer_size; - // // Initially allocate the UART's buffer in the long-lived part of the - // // heap. UARTs are generally long-lived objects, but the "make long- - // // lived" machinery is incapable of moving internal pointers like - // // self->buffer, so do it manually. (However, as long as internal - // // pointers like this are NOT moved, allocating the buffer - // // in the long-lived pool is not strictly necessary) - // self->buffer = (uint8_t *) gc_alloc(self->buffer_length * sizeof(uint8_t), false, true); - // if (self->buffer == NULL) { - // common_hal_busio_uart_deinit(self); - // mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), self->buffer_length * sizeof(uint8_t)); - // } - // } else { - // self->buffer_length = 0; - // self->buffer = NULL; - // } - - // if (usart_async_init(usart_desc_p, sercom, self->buffer, self->buffer_length, NULL) != ERR_NONE) { - // mp_raise_ValueError(translate("Could not initialize UART")); - // } - - // usart_async_init() sets a number of defaults based on a prototypical SERCOM - // which don't necessarily match what we need. After calling it, set the values - // specific to this instantiation of UART. - - // Set pads computed for this SERCOM. - // TXPO: - // 0x0: TX pad 0; no RTS/CTS - // 0x1: TX pad 2; no RTS/CTS - // 0x2: TX pad 0; RTS: pad 2, CTS: pad 3 (not used by us right now) - // So divide by 2 to map pad to value. - // RXPO: - // 0x0: RX pad 0 - // 0x1: RX pad 1 - // 0x2: RX pad 2 - // 0x3: RX pad 3 - - // Doing a group mask and set of the registers saves 60 bytes over setting the bitfields individually. - - // sercom->USART.CTRLA.reg &= ~(SERCOM_USART_CTRLA_TXPO_Msk | - // SERCOM_USART_CTRLA_RXPO_Msk | - // SERCOM_USART_CTRLA_FORM_Msk); - // sercom->USART.CTRLA.reg |= SERCOM_USART_CTRLA_TXPO(tx_pad / 2) | - // SERCOM_USART_CTRLA_RXPO(rx_pad) | - // (parity == PARITY_NONE ? 0 : SERCOM_USART_CTRLA_FORM(1)); - - // Enable tx and/or rx based on whether the pins were specified. - // CHSIZE is 0 for 8 bits, 5, 6, 7 for 5, 6, 7 bits. 1 for 9 bits, but we don't support that. - // sercom->USART.CTRLB.reg &= ~(SERCOM_USART_CTRLB_TXEN | - // SERCOM_USART_CTRLB_RXEN | - // SERCOM_USART_CTRLB_PMODE | - // SERCOM_USART_CTRLB_SBMODE | - // SERCOM_USART_CTRLB_CHSIZE_Msk); - // sercom->USART.CTRLB.reg |= (have_tx ? SERCOM_USART_CTRLB_TXEN : 0) | - // (have_rx ? SERCOM_USART_CTRLB_RXEN : 0) | - // (parity == PARITY_ODD ? SERCOM_USART_CTRLB_PMODE : 0) | - // (stop > 1 ? SERCOM_USART_CTRLB_SBMODE : 0) | - // SERCOM_USART_CTRLB_CHSIZE(bits % 8); + uint8_t rx_threshold = UART_FIFO_LEN - 8; + // Install the driver before we change the settings. + if (uart_driver_install(self->uart_num, receiver_buffer_size, 0, 0, NULL, 0) != ESP_OK || + uart_set_mode(self->uart_num, mode) != ESP_OK) { + mp_raise_ValueError(translate("Could not initialize UART")); + } + uart_set_hw_flow_ctrl(self->uart_num, flow_control, rx_threshold); // Set baud rate - // common_hal_busio_uart_set_baudrate(self, baudrate); + common_hal_busio_uart_set_baudrate(self, baudrate); - // Turn on rx interrupt handling. The UART async driver has its own set of internal callbacks, - // which are set up by uart_async_init(). These in turn can call user-specified callbacks. - // In fact, the actual interrupts are not enabled unless we set up a user-specified callback. - // This is confusing. It's explained in the Atmel START User Guide -> Implementation Description -> - // Different read function behavior in some asynchronous drivers. As of this writing: - // http://start.atmel.com/static/help/index.html?GUID-79201A5A-226F-4FBB-B0B8-AB0BE0554836 - // Look at the ASFv4 code example for async USART. - // usart_async_register_callback(usart_desc_p, USART_ASYNC_RXC_CB, usart_async_rxc_callback); + uart_word_length_t word_length = UART_DATA_8_BITS; + switch (bits) { + // Shared bindings prevents data < 7 bits. + // case 5: + // word_length = UART_DATA_5_BITS; + // break; + // case 6: + // word_length = UART_DATA_6_BITS; + // break; + case 7: + word_length = UART_DATA_7_BITS; + break; + case 8: + word_length = UART_DATA_8_BITS; + break; + default: + // Won't hit this because shared-bindings limits to 7-9 bits. We error on 9 above. + break; + } + uart_set_word_length(self->uart_num, word_length); + uart_parity_t parity_mode = UART_PARITY_DISABLE; + switch (parity) { + case BUSIO_UART_PARITY_NONE: + parity_mode = UART_PARITY_DISABLE; + break; + case BUSIO_UART_PARITY_EVEN: + parity_mode = UART_PARITY_EVEN; + break; + case BUSIO_UART_PARITY_ODD: + parity_mode = UART_PARITY_ODD; + break; + default: + // Won't reach here because the input is an enum that is completely handled. + break; + } + uart_set_parity(self->uart_num, parity_mode); - // if (have_tx) { - // gpio_set_pin_direction(tx->number, GPIO_DIRECTION_OUT); - // gpio_set_pin_pull_mode(tx->number, GPIO_PULL_OFF); - // gpio_set_pin_function(tx->number, tx_pinmux); - // self->tx_pin = tx->number; - // claim_pin(tx); - // } else { - // self->tx_pin = NO_PIN; - // } + // Stop is 1 or 2 always. + uart_stop_bits_t stop_bits= UART_STOP_BITS_1; + if (stop == 2) { + stop_bits = UART_STOP_BITS_2; + } + uart_set_stop_bits(self->uart_num, stop_bits); - // if (have_rx) { - // gpio_set_pin_direction(rx->number, GPIO_DIRECTION_IN); - // gpio_set_pin_pull_mode(rx->number, GPIO_PULL_OFF); - // gpio_set_pin_function(rx->number, rx_pinmux); - // self->rx_pin = rx->number; - // claim_pin(rx); - // } else { - // self->rx_pin = NO_PIN; - // } + self->tx_pin = NULL; + self->rx_pin = NULL; + self->rts_pin = NULL; + self->cts_pin = NULL; + int tx_num = -1; + int rx_num = -1; + int rts_num = -1; + int cts_num = -1; + if (have_tx) { + claim_pin(tx); + self->tx_pin = tx; + tx_num = tx->number; + } - // usart_async_enable(usart_desc_p); + if (have_rx) { + claim_pin(rx); + self->rx_pin = rx; + rx_num = rx->number; + } + + if (have_rts) { + claim_pin(rts); + self->rts_pin = rts; + rts_num = rts->number; + } + + if (have_cts) { + claim_pin(cts); + self->cts_pin = cts; + cts_num = cts->number; + } + + if (have_rs485_dir) { + claim_pin(rs485_dir); + // RTS is used for RS485 direction. + self->rts_pin = rs485_dir; + rts_num = rs485_dir->number; + } + if (uart_set_pin(self->uart_num, tx_num, rx_num, rts_num, cts_num) != ESP_OK) { + mp_raise_ValueError(translate("Invalid pins")); + } } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { @@ -248,14 +220,16 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { if (common_hal_busio_uart_deinited(self)) { return; } - // // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - // usart_async_disable(usart_desc_p); - // usart_async_deinit(usart_desc_p); + uart_driver_delete(self->uart_num); + reset_pin(self->rx_pin); reset_pin(self->tx_pin); + reset_pin(self->rts_pin); + reset_pin(self->cts_pin); self->rx_pin = NULL; self->tx_pin = NULL; + self->cts_pin = NULL; + self->rts_pin = NULL; } // Read characters. @@ -263,57 +237,49 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t if (self->rx_pin == NULL) { mp_raise_ValueError(translate("No RX pin")); } - - // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - if (len == 0) { // Nothing to read. return 0; } - // struct io_descriptor *io; - // usart_async_get_io_descriptor(usart_desc_p, &io); - - // size_t total_read = 0; - // uint64_t start_ticks = supervisor_ticks_ms64(); + size_t total_read = 0; + uint64_t start_ticks = supervisor_ticks_ms64(); // Busy-wait until timeout or until we've read enough chars. - // while (supervisor_ticks_ms64() - start_ticks <= self->timeout_ms) { - // // Read as many chars as we can right now, up to len. - // size_t num_read = io_read(io, data, len); + while (supervisor_ticks_ms64() - start_ticks <= self->timeout_ms) { + // Read as many chars as we can right now, up to len. + size_t num_read = uart_read_bytes(self->uart_num, data, len, 0); - // // Advance pointer in data buffer, and decrease how many chars left to read. - // data += num_read; - // len -= num_read; - // total_read += num_read; - // if (len == 0) { - // // Don't need to read any more: data buf is full. - // break; - // } - // if (num_read > 0) { - // // Reset the timeout on every character read. - // start_ticks = supervisor_ticks_ms64(); - // } - // RUN_BACKGROUND_TASKS; - // // Allow user to break out of a timeout with a KeyboardInterrupt. - // if (mp_hal_is_interrupted()) { - // break; - // } - // // If we are zero timeout, make sure we don't loop again (in the event - // // we read in under 1ms) - // if (self->timeout_ms == 0) { - // break; - // } - // } + // Advance pointer in data buffer, and decrease how many chars left to read. + data += num_read; + len -= num_read; + total_read += num_read; + if (len == 0) { + // Don't need to read any more: data buf is full. + break; + } + if (num_read > 0) { + // Reset the timeout on every character read. + start_ticks = supervisor_ticks_ms64(); + } + RUN_BACKGROUND_TASKS; + // Allow user to break out of a timeout with a KeyboardInterrupt. + if (mp_hal_is_interrupted()) { + break; + } + // If we are zero timeout, make sure we don't loop again (in the event + // we read in under 1ms) + if (self->timeout_ms == 0) { + break; + } + } - // if (total_read == 0) { - // *errcode = EAGAIN; - // return MP_STREAM_ERROR; - // } + if (total_read == 0) { + *errcode = EAGAIN; + return MP_STREAM_ERROR; + } - // return total_read; - return 0; + return total_read; } // Write characters. @@ -322,49 +288,34 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, mp_raise_ValueError(translate("No TX pin")); } - // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - - // struct io_descriptor *io; - // usart_async_get_io_descriptor(usart_desc_p, &io); - - // // Start writing characters. This is non-blocking and will - // // return immediately after setting up the write. - // if (io_write(io, data, len) < 0) { - // *errcode = MP_EAGAIN; - // return MP_STREAM_ERROR; - // } - - // // Busy-wait until all characters transmitted. - // struct usart_async_status async_status; - // while (true) { - // usart_async_get_status(usart_desc_p, &async_status); - // if (async_status.txcnt >= len) { - // break; - // } - // RUN_BACKGROUND_TASKS; - // } + while (len > 0) { + int count = uart_tx_chars(self->uart_num, (const char*) data, len); + if (count < 0) { + *errcode = MP_EAGAIN; + return MP_STREAM_ERROR; + } + len -= count; + data += count; + RUN_BACKGROUND_TASKS; + } + while (uart_wait_tx_done(self->uart_num, 0) == ESP_ERR_TIMEOUT) { + RUN_BACKGROUND_TASKS; + } return len; } uint32_t common_hal_busio_uart_get_baudrate(busio_uart_obj_t *self) { - return self->baudrate; + uint32_t baudrate; + uart_get_baudrate(self->uart_num, &baudrate); + return baudrate; } void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrate) { - // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - // usart_async_set_baud_rate(usart_desc_p, - // // Samples and ARITHMETIC vs FRACTIONAL must correspond to USART_SAMPR in - // // hpl_sercom_config.h. - // _usart_async_calculate_baud_rate(baudrate, // e.g. 9600 baud - // PROTOTYPE_SERCOM_USART_ASYNC_CLOCK_FREQUENCY, - // 16, // samples - // USART_BAUDRATE_ASYNCH_ARITHMETIC, - // 0 // fraction - not used for ARITHMETIC - // )); - self->baudrate = baudrate; + if (baudrate > UART_BITRATE_MAX || + uart_set_baudrate(self->uart_num, baudrate) != ESP_OK) { + mp_raise_ValueError(translate("Unsupported baudrate")); + } } mp_float_t common_hal_busio_uart_get_timeout(busio_uart_obj_t *self) { @@ -376,19 +327,13 @@ void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeou } uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { - // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - // struct usart_async_status async_status; - // usart_async_get_status(usart_desc_p, &async_status); - // return async_status.rxcnt; - return 0; + size_t count; + uart_get_buffered_data_len(self->uart_num, &count); + return count; } void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { - // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - // usart_async_flush_rx_buffer(usart_desc_p); - + uart_flush(self->uart_num); } // True if there are no characters still to be written. @@ -396,10 +341,5 @@ bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { if (self->tx_pin == NULL) { return false; } - // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - // struct usart_async_status async_status; - // usart_async_get_status(usart_desc_p, &async_status); - // return !(async_status.flags & USART_ASYNC_STATUS_BUSY); - return false; + return uart_wait_tx_done(self->uart_num, 0) != ESP_ERR_TIMEOUT; } diff --git a/ports/esp32s2/common-hal/busio/UART.h b/ports/esp32s2/common-hal/busio/UART.h index 3c2bd1dac5..b3cc929665 100644 --- a/ports/esp32s2/common-hal/busio/UART.h +++ b/ports/esp32s2/common-hal/busio/UART.h @@ -29,18 +29,19 @@ #include "common-hal/microcontroller/Pin.h" +#include "esp-idf/components/soc/include/hal/uart_types.h" #include "py/obj.h" typedef struct { mp_obj_base_t base; const mcu_pin_obj_t* rx_pin; const mcu_pin_obj_t* tx_pin; + const mcu_pin_obj_t* rts_pin; + const mcu_pin_obj_t* cts_pin; + uart_port_t uart_num; uint8_t character_bits; bool rx_error; - uint32_t baudrate; uint32_t timeout_ms; - uint32_t buffer_length; - uint8_t* buffer; } busio_uart_obj_t; void uart_reset(void); diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index 7aae7f034b..648f959037 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit 7aae7f034bab68d2dd6aaa763924c91eb697d87e +Subproject commit 648f959037896cff887a05b67105748790bfe63a diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index 5ef347e591..4ca2f8e497 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -85,7 +85,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, - uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, + uint32_t baudrate, uint8_t bits, busio_uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, bool sigint_enabled) { @@ -94,7 +94,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->timeout_ms = timeout * 1000; // We are transmitting one direction if one pin is NULL and the other isn't. - bool is_onedirection = (rx != NULL) != (tx != NULL); + bool is_onedirection = (rx == NULL) != (tx == NULL); bool uart_taken = false; const uint32_t rx_count = MP_ARRAY_SIZE(mcu_uart_rx_list); diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c index 89f3c9f327..012ebc3b5e 100644 --- a/ports/nrf/common-hal/busio/UART.c +++ b/ports/nrf/common-hal/busio/UART.c @@ -133,7 +133,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, - uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, + uint32_t baudrate, uint8_t bits, busio_uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, bool sigint_enabled) { @@ -162,7 +162,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_raise_ValueError(translate("Invalid buffer size")); } - if ( parity == PARITY_ODD ) { + if ( parity == BUSIO_UART_PARITY_ODD ) { mp_raise_ValueError(translate("Odd parity is not supported")); } @@ -176,7 +176,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, .interrupt_priority = 7, .hal_cfg = { .hwfc = NRF_UARTE_HWFC_DISABLED, - .parity = (parity == PARITY_NONE) ? NRF_UARTE_PARITY_EXCLUDED : NRF_UARTE_PARITY_INCLUDED + .parity = (parity == BUSIO_UART_PARITY_NONE) ? NRF_UARTE_PARITY_EXCLUDED : NRF_UARTE_PARITY_INCLUDED } }; diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index 86a932290a..7450f9897a 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -79,7 +79,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, - uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, + uint32_t baudrate, uint8_t bits, busio_uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, bool sigint_enabled) { @@ -201,8 +201,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->handle.Init.BaudRate = baudrate; self->handle.Init.WordLength = (bits == 9) ? UART_WORDLENGTH_9B : UART_WORDLENGTH_8B; self->handle.Init.StopBits = (stop > 1) ? UART_STOPBITS_2 : UART_STOPBITS_1; - self->handle.Init.Parity = (parity == PARITY_ODD) ? UART_PARITY_ODD : - (parity == PARITY_EVEN) ? UART_PARITY_EVEN : + self->handle.Init.Parity = (parity == BUSIO_UART_PARITY_ODD) ? UART_PARITY_ODD : + (parity == BUSIO_UART_PARITY_EVEN) ? UART_PARITY_EVEN : UART_PARITY_NONE; self->handle.Init.Mode = (self->tx != NULL && self->rx != NULL) ? UART_MODE_TX_RX : (self->tx != NULL) ? UART_MODE_TX : diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 8c0811266c..018ded1828 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -52,8 +52,8 @@ //| :param ~microcontroller.Pin rx: the pin to receive on, or ``None`` if this ``UART`` is transmit-only. //| :param ~microcontroller.Pin rts: the pin for rts, or ``None`` if rts not in use. //| :param ~microcontroller.Pin cts: the pin for cts, or ``None`` if cts not in use. -//| :param ~microcontroller.Pin rs485_dir: the pin for rs485 direction setting, or ``None`` if rs485 not in use. -//| :param bool rs485_invert: set to invert the sense of the rs485_dir pin. +//| :param ~microcontroller.Pin rs485_dir: the output pin for rs485 direction setting, or ``None`` if rs485 not in use. +//| :param bool rs485_invert: rs485_dir pin active high when set. Active low otherwise. //| :param int baudrate: the transmit and receive speed. //| :param int bits: the number of bits per byte, 7, 8 or 9. //| :param Parity parity: the parity used for error checking. @@ -87,8 +87,8 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co enum { ARG_tx, ARG_rx, ARG_baudrate, ARG_bits, ARG_parity, ARG_stop, ARG_timeout, ARG_receiver_buffer_size, ARG_rts, ARG_cts, ARG_rs485_dir,ARG_rs485_invert}; static const mp_arg_t allowed_args[] = { - { MP_QSTR_tx, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_rx, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_tx, MP_ARG_OBJ, {.u_obj = mp_const_none} }, + { MP_QSTR_rx, MP_ARG_OBJ, {.u_obj = mp_const_none} }, { MP_QSTR_baudrate, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 9600} }, { MP_QSTR_bits, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 8} }, { MP_QSTR_parity, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, @@ -115,11 +115,11 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co mp_raise_ValueError(translate("bits must be 7, 8 or 9")); } - uart_parity_t parity = PARITY_NONE; + busio_uart_parity_t parity = BUSIO_UART_PARITY_NONE; if (args[ARG_parity].u_obj == &busio_uart_parity_even_obj) { - parity = PARITY_EVEN; + parity = BUSIO_UART_PARITY_EVEN; } else if (args[ARG_parity].u_obj == &busio_uart_parity_odd_obj) { - parity = PARITY_ODD; + parity = BUSIO_UART_PARITY_ODD; } uint8_t stop = args[ARG_stop].u_int; diff --git a/shared-bindings/busio/UART.h b/shared-bindings/busio/UART.h index 3aed4e534c..ce8da1445c 100644 --- a/shared-bindings/busio/UART.h +++ b/shared-bindings/busio/UART.h @@ -34,17 +34,17 @@ extern const mp_obj_type_t busio_uart_type; typedef enum { - PARITY_NONE, - PARITY_EVEN, - PARITY_ODD -} uart_parity_t; + BUSIO_UART_PARITY_NONE, + BUSIO_UART_PARITY_EVEN, + BUSIO_UART_PARITY_ODD +} busio_uart_parity_t; // Construct an underlying UART object. extern void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, - uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, + uint32_t baudrate, uint8_t bits, busio_uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, bool sigint_enabled); diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index 0fbf916cd9..2c9139d8af 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -123,7 +123,7 @@ mp_obj_t common_hal_board_create_uart(void) { #endif common_hal_busio_uart_construct(self, tx, rx, rts, cts, rs485_dir, rs485_invert, - 9600, 8, PARITY_NONE, 1, 1.0f, 64, NULL, false); + 9600, 8, BUSIO_UART_PARITY_NONE, 1, 1.0f, 64, NULL, false); MP_STATE_VM(shared_uart_bus) = MP_OBJ_FROM_PTR(self); return MP_STATE_VM(shared_uart_bus); } From 7b56617f8ef6cf9af9a5a8dbdadbc678918d52ca Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 10 Jun 2020 13:50:10 -0700 Subject: [PATCH 0075/1293] Turn off stub so flash works over native usb --- ports/esp32s2/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 4eac07f99f..570eab0213 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -275,7 +275,7 @@ $(BUILD)/firmware.bin: $(BUILD)/esp-idf/partition_table/partition-table.bin $(BU $(Q)$(PYTHON) ../../tools/join_bins.py $@ 0x1000 $(BUILD)/esp-idf/bootloader/bootloader.bin 0x8000 $(BUILD)/esp-idf/partition_table/partition-table.bin 0x10000 $(BUILD)/circuitpython-firmware.bin flash: $(BUILD)/firmware.bin - esptool.py --chip esp32s2 -p $(PORT) -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ + esptool.py --chip esp32s2 -p $(PORT) --no-stub -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ include $(TOP)/py/mkrules.mk From f52f60b17d7fe5b7f139484e8b9988e3cf96eac1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 17 Jun 2020 10:57:52 -0700 Subject: [PATCH 0076/1293] Add UF2 build target --- ports/esp32s2/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 570eab0213..29504065e9 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -258,7 +258,7 @@ ESP_AUTOGEN_LD = $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld $(BUILD)/esp-id FLASH_FLAGS = --flash_mode $(CIRCUITPY_ESP_FLASH_MODE) --flash_freq $(CIRCUITPY_ESP_FLASH_FREQ) --flash_size $(CIRCUITPY_ESP_FLASH_SIZE) -all: $(BUILD)/firmware.bin +all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 $(BUILD)/firmware.elf: $(OBJ) | $(ESP_IDF_COMPONENTS_EXPANDED) $(ESP_AUTOGEN_LD) $(STEPECHO) "LINK $@" @@ -274,6 +274,10 @@ $(BUILD)/circuitpython-firmware.bin: $(BUILD)/firmware.elf $(BUILD)/firmware.bin: $(BUILD)/esp-idf/partition_table/partition-table.bin $(BUILD)/esp-idf/bootloader/bootloader.bin $(BUILD)/circuitpython-firmware.bin $(Q)$(PYTHON) ../../tools/join_bins.py $@ 0x1000 $(BUILD)/esp-idf/bootloader/bootloader.bin 0x8000 $(BUILD)/esp-idf/partition_table/partition-table.bin 0x10000 $(BUILD)/circuitpython-firmware.bin +$(BUILD)/firmware.uf2: $(BUILD)/circuitpython-firmware.bin + $(STEPECHO) "Create $@" + $(Q)$(PYTHON3) $(TOP)/tools/uf2/utils/uf2conv.py -f 0xbfdd4eee -b 0x0000 -c -o $@ $^ + flash: $(BUILD)/firmware.bin esptool.py --chip esp32s2 -p $(PORT) --no-stub -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ From fc9c0ba5731a7eb1188366841a9a564074e7052f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 17 Jun 2020 13:45:21 -0700 Subject: [PATCH 0077/1293] Initial SPI implementation. Almost certainly doesn't compile --- .../espressif_saola_1_wroom/mpconfigboard.mk | 2 - .../boards/unexpectedmaker_feathers2/board.c | 56 ++++ .../unexpectedmaker_feathers2/mpconfigboard.h | 36 +++ .../mpconfigboard.mk | 21 ++ .../boards/unexpectedmaker_feathers2/pins.c | 57 ++++ .../unexpectedmaker_feathers2/sdkconfig | 0 ports/esp32s2/common-hal/busio/I2C.c | 4 +- ports/esp32s2/common-hal/busio/SPI.c | 282 +++++++++++------- ports/esp32s2/common-hal/busio/SPI.h | 12 +- ports/esp32s2/common-hal/busio/UART.c | 8 +- .../esp32s2/common-hal/microcontroller/Pin.c | 5 +- .../esp32s2/common-hal/microcontroller/Pin.h | 5 +- 12 files changed, 366 insertions(+), 122 deletions(-) create mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2/board.c create mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h create mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk create mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c create mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk index cd27356153..94e3b60f2d 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_NEOPIXEL_WRITE = 0 -CIRCUITPY_DIGITALIO = 0 -CIRCUITPY_MICROCONTROLLER = 0 CIRCUITPY_ESP_FLASH_MODE=dio CIRCUITPY_ESP_FLASH_FREQ=40m diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c b/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c new file mode 100644 index 0000000000..8890ec4c16 --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c @@ -0,0 +1,56 @@ +/* + * 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 "boards/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // USB + never_reset_pin(&pin_GPIO19); + never_reset_pin(&pin_GPIO20); + + // Debug UART + never_reset_pin(&pin_GPIO43); + never_reset_pin(&pin_GPIO44); + + // SPI Flash and RAM + never_reset_pin(&pin_GPIO26); + never_reset_pin(&pin_GPIO27); + never_reset_pin(&pin_GPIO28); + never_reset_pin(&pin_GPIO29); + never_reset_pin(&pin_GPIO30); + never_reset_pin(&pin_GPIO31); + never_reset_pin(&pin_GPIO32); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h new file mode 100644 index 0000000000..93fb0c573d --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h @@ -0,0 +1,36 @@ +/* + * 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 "FeatherS2" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define AUTORESET_DELAY_MS 500 + +// Doesn't work with this on. +// #define MICROPY_HW_APA102_MOSI (&pin_GPIO44) +// #define MICROPY_HW_APA102_SCK (&pin_GPIO45) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk new file mode 100644 index 0000000000..ea3484d2fa --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk @@ -0,0 +1,21 @@ +USB_VID = 0x239A +USB_PID = 0x80AC +USB_PRODUCT = "FeatherS2" +USB_MANUFACTURER = "UnexpectedMaker" +USB_DEVICES = "CDC,MSC,HID" + + +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_NEOPIXEL_WRITE = 0 + +CIRCUITPY_ESP_FLASH_MODE=qio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=16MB + +CIRCUITPY_BITBANG_APA102 = 1 diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c b/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c new file mode 100644 index 0000000000..e8dd2edf6a --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c @@ -0,0 +1,57 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + + // Moving to 9 and 8 + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_GPIO44) }, // MTDO + { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_GPIO45) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + + { 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_global_dict_table); diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig b/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/esp32s2/common-hal/busio/I2C.c index fd983619ff..51817c95e2 100644 --- a/ports/esp32s2/common-hal/busio/I2C.c +++ b/ports/esp32s2/common-hal/busio/I2C.c @@ -143,8 +143,8 @@ void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) { i2c_driver_delete(self->i2c_num); i2c_status[self->i2c_num] = STATUS_FREE; - reset_pin(self->sda_pin); - reset_pin(self->scl_pin); + common_hal_reset_pin(self->sda_pin); + common_hal_reset_pin(self->scl_pin); self->sda_pin = NULL; self->scl_pin = NULL; } diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index e761eb49be..92a3dd4436 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -32,84 +32,141 @@ #include "common-hal/microcontroller/Pin.h" #include "supervisor/shared/rgb_led_status.h" -void spi_reset(void) { +static bool spi_never_reset[SOC_SPI_PERIPH_NUM]; +void spi_reset(void) { + for (spi_host_device_t host_id = SPI2_HOST; host_id < SOC_SPI_PERIPH_NUM; host_id++) { + if (spi_never_reset[host_id]) { + continue; + } + spi_bus_free(host_id); + } +} + +// This is copied in from the ESP-IDF because it is static. +// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD +// +// 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. +static bool bus_uses_iomux_pins(spi_host_device_t host, const spi_bus_config_t* bus_config) +{ + if (bus_config->sclk_io_num>=0 && + bus_config->sclk_io_num != spi_periph_signal[host].spiclk_iomux_pin) return false; + if (bus_config->quadwp_io_num>=0 && + bus_config->quadwp_io_num != spi_periph_signal[host].spiwp_iomux_pin) return false; + if (bus_config->quadhd_io_num>=0 && + bus_config->quadhd_io_num != spi_periph_signal[host].spihd_iomux_pin) return false; + if (bus_config->mosi_io_num >= 0 && + bus_config->mosi_io_num != spi_periph_signal[host].spid_iomux_pin) return false; + if (bus_config->miso_io_num>=0 && + bus_config->miso_io_num != spi_periph_signal[host].spiq_iomux_pin) return false; + + return true; +} + +// End copied code. + +static bool spi_bus_free(spi_host_device_t host_id) { + return spi_bus_get_attr(host_id) == NULL; } void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t * clock, const mcu_pin_obj_t * mosi, const mcu_pin_obj_t * miso) { - // uint8_t sercom_index; - // uint32_t clock_pinmux = 0; - // bool mosi_none = mosi == NULL; - // bool miso_none = miso == NULL; - // uint32_t mosi_pinmux = 0; - // uint32_t miso_pinmux = 0; - // uint8_t clock_pad = 0; - // uint8_t mosi_pad = 0; - // uint8_t miso_pad = 0; - // uint8_t dopo = 255; + spi_bus_config_t bus_config; + bus_config.mosi_io_num = mosi != NULL ? mosi->number : -1; + bus_config.miso_io_num = miso != NULL ? miso->number : -1; + bus_config.sclk_io_num = clock != NULL ? clock->number : -1; + bus_config.quadwp_io_num = -1; + bus_config.quadhd_io_num = -1; + bus_config.max_transfer_sz = 0; // Uses the default + bus_config.flags = SPICOMMON_BUSFLAG_MASTER | SPICOMMON_BUSFLAG_SCLK | + mosi != NULL ? SPICOMMON_BUSFLAG_MOSI : 0 | + miso != NULL ? SPICOMMON_BUSFLAG_MISO : 0; + bus_config.intr_flags = 0; - // if (sercom == NULL) { - // mp_raise_ValueError(translate("Invalid pins")); - // } + // RAM and Flash is often on SPI1 and is unsupported by the IDF so use it as + // a flag value. + spi_host_device_t host_id = SPI1_HOST; + self->connected_through_gpio = true; + // Try and save SPI2 for pins that are on the IOMUX + if (bus_uses_iomux_pins(SPI2_HOST, &bus_config) && spi_bus_free(SPI2_HOST)) { + host_id = SPI2_HOST; + self->connected_through_gpio = false; + } else if (spi_bus_free(SPI3_HOST)) { + host_id = SPI3_HOST; + } else if (spi_bus_free(SPI2_HOST)) { + host_id = SPI2_HOST; + } + if (host_id == SPI1_HOST) { + mp_raise_ValueError(translate("All SPI peripherals are in use")); + } - // // Set up SPI clocks on SERCOM. - // samd_peripherals_sercom_clock_init(sercom, sercom_index); + esp_err_t result = spi_bus_initialize(host_id, &bus_config, 0 /* dma channel */); + if (result == ESP_ERR_NO_MEM) { + mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); + } else if (result = ESP_INVALID_ARG) { + mp_raise_ValueError(translate("Invalid pins")); + } + spi_bus_lock_dev_config_t config = { .flags = 0 }; + result = spi_bus_lock_register_dev(spi_bus_get_attr(host_id)->lock, + spi_bus_lock_dev_config_t *config, + &self->lock); + if (result == ESP_ERR_NO_MEM) { + mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); + } - #if defined(MICROPY_HW_APA102_SCK) && defined(MICROPY_HW_APA102_MOSI) && !CIRCUITPY_BITBANG_APA102 - // // if we're re-using the dotstar sercom, make sure it is disabled or the init will fail out - // hri_sercomspi_clear_CTRLA_ENABLE_bit(sercom); - #endif - // if (spi_m_sync_init(&self->spi_desc, sercom) != ERR_NONE) { - // mp_raise_OSError(MP_EIO); - // } - // Pads must be set after spi_m_sync_init(), which uses default values from - // the prototypical SERCOM. - // hri_sercomspi_write_CTRLA_DOPO_bf(sercom, dopo); - // hri_sercomspi_write_CTRLA_DIPO_bf(sercom, miso_pad); + err = esp_intr_alloc(spicommon_irqsource_for_host(host_id), + bus_config.intr_flags | ESP_INTR_FLAG_INTRDISABLED, + spi_interrupt_handler, self, &self->intr); + if (result == ESP_ERR_NO_MEM) { + mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); + } - // Always start at 250khz which is what SD cards need. They are sensitive to - // SPI bus noise before they are put into SPI mode. - // uint8_t baud_value = samd_peripherals_spi_baudrate_to_baud_reg_value(250000); - // if (spi_m_sync_set_baudrate(&self->spi_desc, baud_value) != ERR_NONE) { - // // spi_m_sync_set_baudrate does not check for validity, just whether the device is - // // busy or not - // mp_raise_OSError(MP_EIO); - // } + spi_hal_context_t* hal = &self->hal_context; + hal->hw = NULL; // Set by spi_hal_init + hal->dmadesc_tx = NULL; + hal->dmadesc_rx = NULL; + hal->dmadesc_n = 0; - // gpio_set_pin_direction(clock->number, GPIO_DIRECTION_OUT); - // gpio_set_pin_pull_mode(clock->number, GPIO_PULL_OFF); - // gpio_set_pin_function(clock->number, clock_pinmux); - // claim_pin(clock); - // self->clock_pin = clock->number; + // We don't use native CS. + hal->cs_setup = 0; + hal->cs_hold = 0; + hal->cs_pin_id = -1; + hal->timing_conf = &self->timing_conf; - // if (mosi_none) { - // self->MOSI_pin = NO_PIN; - // } else { - // gpio_set_pin_direction(mosi->number, GPIO_DIRECTION_OUT); - // gpio_set_pin_pull_mode(mosi->number, GPIO_PULL_OFF); - // gpio_set_pin_function(mosi->number, mosi_pinmux); - // self->MOSI_pin = mosi->number; - // claim_pin(mosi); - // } + hal->sio = 1; + hal->half_duplex = 0; + hal->tx_lsbfirst = 0; + hal->rx_lsbfirst = 0; + hal->dma_enabled = 0; + hal->no_compensate = 1; + // Ignore CS bits - // if (miso_none) { - // self->MISO_pin = NO_PIN; - // } else { - // gpio_set_pin_direction(miso->number, GPIO_DIRECTION_IN); - // gpio_set_pin_pull_mode(miso->number, GPIO_PULL_OFF); - // gpio_set_pin_function(miso->number, miso_pinmux); - // self->MISO_pin = miso->number; - // claim_pin(miso); - // } + // We don't use cmd, addr or dummy bits. + hal->cmd = 0; + hal->cmd_bits = 0; + hal->addr_bits = 0; + hal->dummy_bits = 0; + hal->addr = 0; - // spi_m_sync_enable(&self->spi_desc); + hal->io_mode = SPI_LL_IO_MODE_NORMAL; + + spi_hal_init(hal, host_id); } void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { - // never_reset_sercom(self->spi_desc.dev.prvt); + spi_never_reset[self->host_id] = true; never_reset_pin(self->clock_pin); never_reset_pin(self->MOSI_pin); @@ -124,51 +181,50 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { if (common_hal_busio_spi_deinited(self)) { return; } - // allow_reset_sercom(self->spi_desc.dev.prvt); + spi_never_reset[self->host_id] = false; + spi_bus_free(self->host_id); - // spi_m_sync_disable(&self->spi_desc); - // spi_m_sync_deinit(&self->spi_desc); - reset_pin(self->clock_pin); - reset_pin(self->MOSI_pin); - reset_pin(self->MISO_pin); + common_hal_reset_pin(self->clock_pin); + common_hal_reset_pin(self->MOSI_pin); + common_hal_reset_pin(self->MISO_pin); self->clock_pin = NULL; } bool common_hal_busio_spi_configure(busio_spi_obj_t *self, uint32_t baudrate, uint8_t polarity, uint8_t phase, uint8_t bits) { - // If the settings are already what we want then don't reset them. - // if (hri_sercomspi_get_CTRLA_CPHA_bit(hw) == phase && - // hri_sercomspi_get_CTRLA_CPOL_bit(hw) == polarity && - // hri_sercomspi_read_CTRLB_CHSIZE_bf(hw) == ((uint32_t)bits - 8) && - // hri_sercomspi_read_BAUD_BAUD_bf(hw) == baud_reg_value) { - // return true; - // } - - // Disable, set values (most or all are enable-protected), and re-enable. - // spi_m_sync_disable(&self->spi_desc); - // hri_sercomspi_wait_for_sync(hw, SERCOM_SPI_SYNCBUSY_MASK); - - // hri_sercomspi_write_CTRLA_CPHA_bit(hw, phase); - // hri_sercomspi_write_CTRLA_CPOL_bit(hw, polarity); - // hri_sercomspi_write_CTRLB_CHSIZE_bf(hw, bits - 8); - // hri_sercomspi_write_BAUD_BAUD_bf(hw, baud_reg_value); - // hri_sercomspi_wait_for_sync(hw, SERCOM_SPI_SYNCBUSY_MASK); - - // spi_m_sync_enable(&self->spi_desc); - // hri_sercomspi_wait_for_sync(hw, SERCOM_SPI_SYNCBUSY_MASK); + if (baudrate == self->target_frequency && + polarity == self->polarity && + phase == self->phase && + bits == self->bits) { + return true; + } + self->hal_context->mode = polarity << 1 | phase; + self->polarity = polarity; + self->phase = phase; + self->bits = bits; + self->target_frequency = baudrate; + esp_err_t result = spi_hal_get_clock_conf(self->hal_context, + self->target_frequency, + 128 /* duty_cycle */, + self->connected_through_gpio, + 0 /* input_delay_ns */, + &self->real_frequency, + &self->timing_conf); + spi_hal_setup_device(&self->hal_context); return true; } bool common_hal_busio_spi_try_lock(busio_spi_obj_t *self) { - bool grabbed_lock = false; - // CRITICAL_SECTION_ENTER() - if (!self->has_lock) { - grabbed_lock = true; - self->has_lock = true; - } - // CRITICAL_SECTION_LEAVE(); - return grabbed_lock; + // If our lock has already been taken then return false because someone else + // may already grabbed it in our call stack. + if (self->has_lock) { + return false; + } + // Wait to grab the lock from another task. + esp_err_t ret = spi_bus_lock_acquire_start(self->lock, portMAX_DELAY); + self->has_lock = true; + return true; } bool common_hal_busio_spi_has_lock(busio_spi_obj_t *self) { @@ -176,6 +232,7 @@ bool common_hal_busio_spi_has_lock(busio_spi_obj_t *self) { } void common_hal_busio_spi_unlock(busio_spi_obj_t *self) { + spi_bus_lock_acquire_end(self->lock); self->has_lock = false; } @@ -218,32 +275,35 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uin if (len == 0) { return true; } - // int32_t status; - if (len >= 16) { - // status = sercom_dma_transfer(self->spi_desc.dev.prvt, data_out, data_in, len); + + spi_hal_context_t* hal = &self->hal_context; + hal->tx_bitlen = len * 8; + hal->rx_bitlen = len * 8; + hal->send_buffer = data_out; + hal->rcv_buffer = data_in; + + spi_hal_setup_trans(hal); + spi_hal_prepare_data(hal); + spi_hal_user_start(hal); + if (len >= 16 && false) { + // Set up the interrupt and wait on the lock. } else { - // struct spi_xfer xfer; - // xfer.txbuf = data_out; - // xfer.rxbuf = data_in; - // xfer.size = len; - // status = spi_m_sync_transfer(&self->spi_desc, &xfer); + while (!spi_hal_usr_is_done(hal)) { + RUN_BACKGROUND_TASKS(); + } } - return false; // Status is number of chars read or an error code < 0. + + return false; } uint32_t common_hal_busio_spi_get_frequency(busio_spi_obj_t* self) { - // return samd_peripherals_spi_baud_reg_value_to_baudrate(hri_sercomspi_read_BAUD_reg(self->spi_desc.dev.prvt)); - return 0; + return self->real_frequency; } uint8_t common_hal_busio_spi_get_phase(busio_spi_obj_t* self) { - // void * hw = self->spi_desc.dev.prvt; - // return hri_sercomspi_get_CTRLA_CPHA_bit(hw); - return 0; + return self->phase; } uint8_t common_hal_busio_spi_get_polarity(busio_spi_obj_t* self) { - // void * hw = self->spi_desc.dev.prvt; - // return hri_sercomspi_get_CTRLA_CPOL_bit(hw); - return 0; + return self->polarity; } diff --git a/ports/esp32s2/common-hal/busio/SPI.h b/ports/esp32s2/common-hal/busio/SPI.h index 0ff1a4f7ea..0c2f286078 100644 --- a/ports/esp32s2/common-hal/busio/SPI.h +++ b/ports/esp32s2/common-hal/busio/SPI.h @@ -33,10 +33,20 @@ typedef struct { mp_obj_base_t base; - bool has_lock; const mcu_pin_obj_t* clock_pin; const mcu_pin_obj_t* MOSI_pin; const mcu_pin_obj_t* MISO_pin; + spi_host_device_t host_id; + spi_bus_lock_dev_handle_t lock; + spi_hal_context_t hal_context; + spi_hal_timing_conf_t timing_conf; + uint32_t target_frequency; + uint32_t real_frequency; + uint8_t polarity; + uint8_t phase; + uint8_t bits; + bool has_lock; + bool connected_through_gpio; } busio_spi_obj_t; void spi_reset(void); diff --git a/ports/esp32s2/common-hal/busio/UART.c b/ports/esp32s2/common-hal/busio/UART.c index d52e50cade..f73f5c993d 100644 --- a/ports/esp32s2/common-hal/busio/UART.c +++ b/ports/esp32s2/common-hal/busio/UART.c @@ -222,10 +222,10 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { } uart_driver_delete(self->uart_num); - reset_pin(self->rx_pin); - reset_pin(self->tx_pin); - reset_pin(self->rts_pin); - reset_pin(self->cts_pin); + common_hal_reset_pin(self->rx_pin); + common_hal_reset_pin(self->tx_pin); + common_hal_reset_pin(self->rts_pin); + common_hal_reset_pin(self->cts_pin); self->rx_pin = NULL; self->tx_pin = NULL; self->cts_pin = NULL; diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index fd815518d5..075f80abc6 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -35,6 +35,9 @@ STATIC uint32_t never_reset_pins[2]; STATIC uint32_t in_use[2]; +bool apa102_mosi_in_use; +bool apa102_sck_in_use; + void never_reset_pin_number(gpio_num_t pin_number) { never_reset_pins[pin_number / 32] |= 1 << pin_number % 32; } @@ -49,7 +52,7 @@ void reset_pin_number(gpio_num_t pin_number) { in_use[pin_number / 32] &= ~(1 << pin_number % 32); } -void reset_pin(const mcu_pin_obj_t* pin) { +void common_hal_reset_pin(const mcu_pin_obj_t* pin) { reset_pin_number(pin->number); } diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.h b/ports/esp32s2/common-hal/microcontroller/Pin.h index 573eec392b..ab06b388f8 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.h +++ b/ports/esp32s2/common-hal/microcontroller/Pin.h @@ -31,11 +31,14 @@ #include "peripherals/pins.h" +extern bool apa102_mosi_in_use; +extern bool apa102_sck_in_use; + void reset_all_pins(void); // reset_pin_number takes the pin number instead of the pointer so that objects don't // need to store a full pointer. void reset_pin_number(gpio_num_t pin_number); -void reset_pin(const mcu_pin_obj_t* pin); +void common_hal_reset_pin(const mcu_pin_obj_t* pin); void claim_pin(const mcu_pin_obj_t* pin); bool pin_number_is_free(gpio_num_t pin_number); void never_reset_pin_number(gpio_num_t pin_number); From c5fa9730a87b47f569a2bc4a7599e67b198826e6 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 23 Jun 2020 12:58:01 -0700 Subject: [PATCH 0078/1293] Compiles! --- ports/atmel-samd/common-hal/busio/SPI.c | 4 +- .../espressif_saola_1_wrover/mpconfigboard.mk | 2 - ports/esp32s2/common-hal/busio/SPI.c | 82 ++++++++----------- ports/esp32s2/common-hal/busio/SPI.h | 6 +- ports/esp32s2/esp-idf | 2 +- ports/mimxrt10xx/common-hal/busio/SPI.c | 4 +- ports/nrf/common-hal/busio/SPI.c | 6 +- ports/stm/common-hal/busio/SPI.c | 4 +- shared-bindings/busio/SPI.h | 2 +- 9 files changed, 48 insertions(+), 64 deletions(-) diff --git a/ports/atmel-samd/common-hal/busio/SPI.c b/ports/atmel-samd/common-hal/busio/SPI.c index 1dc389027d..921713d690 100644 --- a/ports/atmel-samd/common-hal/busio/SPI.c +++ b/ports/atmel-samd/common-hal/busio/SPI.c @@ -341,7 +341,7 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, return status >= 0; // Status is number of chars read or an error code < 0. } -bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uint8_t *data_in, size_t len) { +bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_out, uint8_t *data_in, size_t len) { if (len == 0) { return true; } @@ -350,7 +350,7 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uin status = sercom_dma_transfer(self->spi_desc.dev.prvt, data_out, data_in, len); } else { struct spi_xfer xfer; - xfer.txbuf = data_out; + xfer.txbuf = (uint8_t*) data_out; xfer.rxbuf = data_in; xfer.size = len; status = spi_m_sync_transfer(&self->spi_desc, &xfer); diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk index 0b847de943..08f2770f58 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_NEOPIXEL_WRITE = 0 -CIRCUITPY_DIGITALIO = 0 -CIRCUITPY_MICROCONTROLLER = 0 CIRCUITPY_ESP_FLASH_MODE=dio CIRCUITPY_ESP_FLASH_FREQ=40m diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index 92a3dd4436..db28dee661 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -75,10 +75,14 @@ static bool bus_uses_iomux_pins(spi_host_device_t host, const spi_bus_config_t* // End copied code. -static bool spi_bus_free(spi_host_device_t host_id) { +static bool _spi_bus_free(spi_host_device_t host_id) { return spi_bus_get_attr(host_id) == NULL; } +static void spi_interrupt_handler(void *arg) { + +} + void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t * clock, const mcu_pin_obj_t * mosi, const mcu_pin_obj_t * miso) { @@ -90,8 +94,8 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, bus_config.quadhd_io_num = -1; bus_config.max_transfer_sz = 0; // Uses the default bus_config.flags = SPICOMMON_BUSFLAG_MASTER | SPICOMMON_BUSFLAG_SCLK | - mosi != NULL ? SPICOMMON_BUSFLAG_MOSI : 0 | - miso != NULL ? SPICOMMON_BUSFLAG_MISO : 0; + (mosi != NULL ? SPICOMMON_BUSFLAG_MOSI : 0) | + (miso != NULL ? SPICOMMON_BUSFLAG_MISO : 0); bus_config.intr_flags = 0; // RAM and Flash is often on SPI1 and is unsupported by the IDF so use it as @@ -99,12 +103,12 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, spi_host_device_t host_id = SPI1_HOST; self->connected_through_gpio = true; // Try and save SPI2 for pins that are on the IOMUX - if (bus_uses_iomux_pins(SPI2_HOST, &bus_config) && spi_bus_free(SPI2_HOST)) { + if (bus_uses_iomux_pins(SPI2_HOST, &bus_config) && _spi_bus_free(SPI2_HOST)) { host_id = SPI2_HOST; self->connected_through_gpio = false; - } else if (spi_bus_free(SPI3_HOST)) { + } else if (_spi_bus_free(SPI3_HOST)) { host_id = SPI3_HOST; - } else if (spi_bus_free(SPI2_HOST)) { + } else if (_spi_bus_free(SPI2_HOST)) { host_id = SPI2_HOST; } if (host_id == SPI1_HOST) { @@ -114,21 +118,21 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, esp_err_t result = spi_bus_initialize(host_id, &bus_config, 0 /* dma channel */); if (result == ESP_ERR_NO_MEM) { mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); - } else if (result = ESP_INVALID_ARG) { + } else if (result == ESP_ERR_INVALID_ARG) { mp_raise_ValueError(translate("Invalid pins")); } spi_bus_lock_dev_config_t config = { .flags = 0 }; result = spi_bus_lock_register_dev(spi_bus_get_attr(host_id)->lock, - spi_bus_lock_dev_config_t *config, + &config, &self->lock); if (result == ESP_ERR_NO_MEM) { mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); } - err = esp_intr_alloc(spicommon_irqsource_for_host(host_id), - bus_config.intr_flags | ESP_INTR_FLAG_INTRDISABLED, - spi_interrupt_handler, self, &self->intr); + result = esp_intr_alloc(spicommon_irqsource_for_host(host_id), + bus_config.intr_flags | ESP_INTR_FLAG_INTRDISABLED, + spi_interrupt_handler, self, &self->interrupt); if (result == ESP_ERR_NO_MEM) { mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); } @@ -198,18 +202,21 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, bits == self->bits) { return true; } - self->hal_context->mode = polarity << 1 | phase; + self->hal_context.mode = polarity << 1 | phase; self->polarity = polarity; self->phase = phase; self->bits = bits; self->target_frequency = baudrate; - esp_err_t result = spi_hal_get_clock_conf(self->hal_context, + esp_err_t result = spi_hal_get_clock_conf(&self->hal_context, self->target_frequency, 128 /* duty_cycle */, self->connected_through_gpio, 0 /* input_delay_ns */, &self->real_frequency, &self->timing_conf); + if (result != ESP_OK) { + return false; + } spi_hal_setup_device(&self->hal_context); return true; @@ -222,9 +229,9 @@ bool common_hal_busio_spi_try_lock(busio_spi_obj_t *self) { return false; } // Wait to grab the lock from another task. - esp_err_t ret = spi_bus_lock_acquire_start(self->lock, portMAX_DELAY); - self->has_lock = true; - return true; + esp_err_t result = spi_bus_lock_acquire_start(self->lock, portMAX_DELAY); + self->has_lock = result == ESP_OK; + return self->has_lock; } bool common_hal_busio_spi_has_lock(busio_spi_obj_t *self) { @@ -238,62 +245,37 @@ void common_hal_busio_spi_unlock(busio_spi_obj_t *self) { bool common_hal_busio_spi_write(busio_spi_obj_t *self, const uint8_t *data, size_t len) { - if (len == 0) { - return true; - } - // int32_t status; - if (len >= 16) { - // status = sercom_dma_write(self->spi_desc.dev.prvt, data, len); - } else { - // struct io_descriptor *spi_io; - // spi_m_sync_get_io_descriptor(&self->spi_desc, &spi_io); - // status = spi_io->write(spi_io, data, len); - } - return false; // Status is number of chars read or an error code < 0. + return common_hal_busio_spi_transfer(self, data, NULL, len); } bool common_hal_busio_spi_read(busio_spi_obj_t *self, uint8_t *data, size_t len, uint8_t write_value) { - if (len == 0) { - return true; - } - // int32_t status; - if (len >= 16) { - // status = sercom_dma_read(self->spi_desc.dev.prvt, data, len, write_value); - } else { - // self->spi_desc.dev.dummy_byte = write_value; - - // struct io_descriptor *spi_io; - // spi_m_sync_get_io_descriptor(&self->spi_desc, &spi_io); - - // status = spi_io->read(spi_io, data, len); - } - return false; // Status is number of chars read or an error code < 0. + return common_hal_busio_spi_transfer(self, NULL, data, len); } -bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uint8_t *data_in, size_t len) { +bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_out, uint8_t *data_in, size_t len) { if (len == 0) { return true; } spi_hal_context_t* hal = &self->hal_context; - hal->tx_bitlen = len * 8; - hal->rx_bitlen = len * 8; - hal->send_buffer = data_out; + hal->tx_bitlen = len * self->bits; + hal->rx_bitlen = len * self->bits; + hal->send_buffer = (uint8_t*) data_out; hal->rcv_buffer = data_in; spi_hal_setup_trans(hal); spi_hal_prepare_data(hal); spi_hal_user_start(hal); - if (len >= 16 && false) { + if (len >= SOC_SPI_MAXIMUM_BUFFER_SIZE && false) { // Set up the interrupt and wait on the lock. } else { while (!spi_hal_usr_is_done(hal)) { - RUN_BACKGROUND_TASKS(); + RUN_BACKGROUND_TASKS; } } - return false; + return true; } uint32_t common_hal_busio_spi_get_frequency(busio_spi_obj_t* self) { diff --git a/ports/esp32s2/common-hal/busio/SPI.h b/ports/esp32s2/common-hal/busio/SPI.h index 0c2f286078..38fbe42ffc 100644 --- a/ports/esp32s2/common-hal/busio/SPI.h +++ b/ports/esp32s2/common-hal/busio/SPI.h @@ -29,6 +29,9 @@ #include "common-hal/microcontroller/Pin.h" +#include "esp-idf/components/driver/include/driver/spi_common_internal.h" +#include "esp-idf/components/soc/include/hal/spi_hal.h" +#include "esp-idf/components/soc/include/hal/spi_types.h" #include "py/obj.h" typedef struct { @@ -40,8 +43,9 @@ typedef struct { spi_bus_lock_dev_handle_t lock; spi_hal_context_t hal_context; spi_hal_timing_conf_t timing_conf; + intr_handle_t interrupt; uint32_t target_frequency; - uint32_t real_frequency; + int32_t real_frequency; uint8_t polarity; uint8_t phase; uint8_t bits; diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index 648f959037..160ba4924d 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit 648f959037896cff887a05b67105748790bfe63a +Subproject commit 160ba4924d8b588e718f76e3a0d0e92c11052fa3 diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c index c51aef4daa..8fe1b799d6 100644 --- a/ports/mimxrt10xx/common-hal/busio/SPI.c +++ b/ports/mimxrt10xx/common-hal/busio/SPI.c @@ -321,7 +321,7 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, return (status == kStatus_Success); } -bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uint8_t *data_in, size_t len) { +bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_out, uint8_t *data_in, size_t len) { if (len == 0) { return true; } @@ -332,7 +332,7 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uin LPSPI_SetDummyData(self->spi, 0xFF); lpspi_transfer_t xfer = { 0 }; - xfer.txData = data_out; + xfer.txData = (uint8_t *)data_out; xfer.rxData = data_in; xfer.dataSize = len; diff --git a/ports/nrf/common-hal/busio/SPI.c b/ports/nrf/common-hal/busio/SPI.c index 3f205e7782..f27f0e267b 100644 --- a/ports/nrf/common-hal/busio/SPI.c +++ b/ports/nrf/common-hal/busio/SPI.c @@ -271,13 +271,13 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, uint8_t *data, size_t len, return true; } -bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uint8_t *data_in, size_t len) { +bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_out, uint8_t *data_in, size_t len) { const bool is_spim3 = self->spim_peripheral->spim.p_reg == NRF_SPIM3; - uint8_t *next_chunk_out = data_out; + const uint8_t *next_chunk_out = data_out; uint8_t *next_chunk_in = data_in; while (len > 0) { - uint8_t *chunk_out = next_chunk_out; + const uint8_t *chunk_out = next_chunk_out; size_t chunk_size = MIN(len, self->spim_peripheral->max_xfer_size); if (is_spim3) { // If SPIM3, copy into unused RAM block, and do DMA from there. diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index 65eeb8ebcf..c76705cd85 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -380,12 +380,12 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, } bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, - uint8_t *data_out, uint8_t *data_in, size_t len) { + const uint8_t *data_out, uint8_t *data_in, size_t len) { if (self->miso == NULL || self->mosi == NULL) { mp_raise_ValueError(translate("Missing MISO or MOSI Pin")); } HAL_StatusTypeDef result = HAL_SPI_TransmitReceive (&self->handle, - data_out, data_in, (uint16_t)len,HAL_MAX_DELAY); + (uint8_t *) data_out, data_in, (uint16_t)len,HAL_MAX_DELAY); return result == HAL_OK; } diff --git a/shared-bindings/busio/SPI.h b/shared-bindings/busio/SPI.h index b7b0715d13..f1a3b041ff 100644 --- a/shared-bindings/busio/SPI.h +++ b/shared-bindings/busio/SPI.h @@ -56,7 +56,7 @@ extern bool common_hal_busio_spi_write(busio_spi_obj_t *self, const uint8_t *dat extern bool common_hal_busio_spi_read(busio_spi_obj_t *self, uint8_t *data, size_t len, uint8_t write_value); // Reads and write len bytes simultaneously. -extern bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uint8_t *data_in, size_t len); +extern bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_out, uint8_t *data_in, size_t len); // Return actual SPI bus frequency. uint32_t common_hal_busio_spi_get_frequency(busio_spi_obj_t* self); From 496e16d99b2277a09ab8a518ee94450653e63317 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 23 Jun 2020 17:02:16 -0700 Subject: [PATCH 0079/1293] Handle memory (hopefully). Short TX works --- ports/esp32s2/Makefile | 3 ++ ports/esp32s2/common-hal/busio/SPI.c | 79 +++++++++++++++++++++++++--- 2 files changed, 74 insertions(+), 8 deletions(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 29504065e9..ee1e8107a6 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -281,6 +281,9 @@ $(BUILD)/firmware.uf2: $(BUILD)/circuitpython-firmware.bin flash: $(BUILD)/firmware.bin esptool.py --chip esp32s2 -p $(PORT) --no-stub -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ +flash-circuitpython-only: $(BUILD)/circuitpython-firmware.bin + esptool.py --chip esp32s2 -p $(PORT) --no-stub -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x10000 $^ + include $(TOP)/py/mkrules.mk # Print out the value of a make variable. diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index db28dee661..9790c516ff 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -32,14 +32,35 @@ #include "common-hal/microcontroller/Pin.h" #include "supervisor/shared/rgb_led_status.h" +#include "esp_log.h" + +static const char* TAG = "CircuitPython SPI"; + static bool spi_never_reset[SOC_SPI_PERIPH_NUM]; +// Store one lock handle per device so that we can free it. +static spi_bus_lock_dev_handle_t lock_dev_handle[SOC_SPI_PERIPH_NUM]; +static intr_handle_t intr_handle[SOC_SPI_PERIPH_NUM]; + void spi_reset(void) { for (spi_host_device_t host_id = SPI2_HOST; host_id < SOC_SPI_PERIPH_NUM; host_id++) { if (spi_never_reset[host_id]) { continue; } - spi_bus_free(host_id); + bool in_use = false; + if (lock_dev_handle[host_id] != NULL) { + spi_bus_lock_unregister_dev(lock_dev_handle[host_id]); + lock_dev_handle[host_id] = NULL; + in_use = true; + } + if (intr_handle[host_id] != NULL) { + esp_intr_free(intr_handle[host_id]); + intr_handle[host_id] = NULL; + in_use = true; + } + if (in_use) { + spi_bus_free(host_id); + } } } @@ -75,12 +96,24 @@ static bool bus_uses_iomux_pins(spi_host_device_t host, const spi_bus_config_t* // End copied code. -static bool _spi_bus_free(spi_host_device_t host_id) { +static bool spi_bus_is_free(spi_host_device_t host_id) { return spi_bus_get_attr(host_id) == NULL; } static void spi_interrupt_handler(void *arg) { + // busio_spi_obj_t *self = arg; +} +// The interrupt may get invoked by the bus lock. +static void spi_bus_intr_enable(void *self) +{ + esp_intr_enable(((busio_spi_obj_t *)self)->interrupt); +} + +// The interrupt is always disabled by the ISR itself, not exposed +static void spi_bus_intr_disable(void *self) +{ + esp_intr_disable(((busio_spi_obj_t *)self)->interrupt); } void common_hal_busio_spi_construct(busio_spi_obj_t *self, @@ -103,12 +136,12 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, spi_host_device_t host_id = SPI1_HOST; self->connected_through_gpio = true; // Try and save SPI2 for pins that are on the IOMUX - if (bus_uses_iomux_pins(SPI2_HOST, &bus_config) && _spi_bus_free(SPI2_HOST)) { + if (bus_uses_iomux_pins(SPI2_HOST, &bus_config) && spi_bus_is_free(SPI2_HOST)) { host_id = SPI2_HOST; self->connected_through_gpio = false; - } else if (_spi_bus_free(SPI3_HOST)) { + } else if (spi_bus_is_free(SPI3_HOST)) { host_id = SPI3_HOST; - } else if (_spi_bus_free(SPI2_HOST)) { + } else if (spi_bus_is_free(SPI2_HOST)) { host_id = SPI2_HOST; } if (host_id == SPI1_HOST) { @@ -121,21 +154,33 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, } else if (result == ESP_ERR_INVALID_ARG) { mp_raise_ValueError(translate("Invalid pins")); } + + // After this point, we need to deinit to free IDF memory so fill out self's pins. + self->clock_pin = clock; + self->MOSI_pin = mosi; + self->MISO_pin = miso; + spi_bus_lock_dev_config_t config = { .flags = 0 }; + // The returned lock is stored in the bus lock but must be freed separately with + // spi_bus_lock_unregister_dev. result = spi_bus_lock_register_dev(spi_bus_get_attr(host_id)->lock, &config, &self->lock); if (result == ESP_ERR_NO_MEM) { + common_hal_busio_spi_deinit(self); mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); } - + lock_dev_handle[host_id] = self->lock; result = esp_intr_alloc(spicommon_irqsource_for_host(host_id), bus_config.intr_flags | ESP_INTR_FLAG_INTRDISABLED, spi_interrupt_handler, self, &self->interrupt); if (result == ESP_ERR_NO_MEM) { + common_hal_busio_spi_deinit(self); mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); } + intr_handle[host_id] = self->interrupt; + spi_bus_lock_set_bg_control(spi_bus_get_attr(host_id)->lock, spi_bus_intr_enable, spi_bus_intr_disable, self); spi_hal_context_t* hal = &self->hal_context; hal->hw = NULL; // Set by spi_hal_init @@ -146,8 +191,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, // We don't use native CS. hal->cs_setup = 0; hal->cs_hold = 0; - hal->cs_pin_id = -1; - hal->timing_conf = &self->timing_conf; + hal->cs_pin_id = 0; hal->sio = 1; hal->half_duplex = 0; @@ -167,6 +211,13 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, hal->io_mode = SPI_LL_IO_MODE_NORMAL; spi_hal_init(hal, host_id); + // This must be set after spi_hal_init. + hal->timing_conf = &self->timing_conf; + if (hal->hw == NULL) { + ESP_LOGE(TAG, "SPI error %p", hal->hw); + } + + common_hal_busio_spi_configure(self, 250000, 0, 0, 8); } void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { @@ -186,6 +237,14 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { return; } spi_never_reset[self->host_id] = false; + if (self->lock != NULL) { + spi_bus_lock_unregister_dev(self->lock); + lock_dev_handle[self->host_id] = NULL; + } + if (self->interrupt != NULL) { + esp_intr_free(self->interrupt); + intr_handle[self->host_id] = NULL; + } spi_bus_free(self->host_id); common_hal_reset_pin(self->clock_pin); @@ -218,7 +277,11 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, return false; } + ESP_LOGI(TAG, "configure"); + ESP_LOGI(TAG, "real frequency %d", self->real_frequency); + ESP_LOGI(TAG, "timing_conf %p", self->hal_context.timing_conf); spi_hal_setup_device(&self->hal_context); + ESP_LOGI(TAG, "setup done"); return true; } From ed6e81d688469138b555f3579b1083f521485382 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 24 Jun 2020 12:46:36 -0700 Subject: [PATCH 0080/1293] Switch SPI to polling DMA and enable displayio --- ports/esp32s2/background.c | 6 +- .../boards/espressif_saola_1_wrover/board.c | 8 +- ports/esp32s2/common-hal/busio/I2C.c | 5 +- ports/esp32s2/common-hal/busio/SPI.c | 80 +++++++++++-------- ports/esp32s2/common-hal/busio/SPI.h | 4 + .../common-hal/displayio/ParallelBus.c | 66 +++++++++++++++ .../common-hal/displayio/ParallelBus.h | 36 +++++++++ .../esp32s2/common-hal/microcontroller/Pin.c | 2 +- .../esp32s2/common-hal/microcontroller/Pin.h | 1 - ports/esp32s2/modules/wroom.c | 12 +-- ports/esp32s2/modules/wrover.c | 14 ++-- ports/esp32s2/mpconfigport.mk | 2 +- shared-module/displayio/Display.h | 4 + shared-module/displayio/EPaperDisplay.h | 1 - 14 files changed, 182 insertions(+), 59 deletions(-) create mode 100644 ports/esp32s2/common-hal/displayio/ParallelBus.c create mode 100644 ports/esp32s2/common-hal/displayio/ParallelBus.h diff --git a/ports/esp32s2/background.c b/ports/esp32s2/background.c index e22cf4aacc..e979d78311 100644 --- a/ports/esp32s2/background.c +++ b/ports/esp32s2/background.c @@ -54,9 +54,9 @@ void run_background_tasks(void) { running_background_tasks = true; filesystem_background(); - // #if CIRCUITPY_DISPLAYIO - // displayio_background(); - // #endif + #if CIRCUITPY_DISPLAYIO + displayio_background(); + #endif running_background_tasks = false; assert_heap_ok(); diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/board.c b/ports/esp32s2/boards/espressif_saola_1_wrover/board.c index b7b2c4ef5b..9f708874bf 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/board.c +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/board.c @@ -30,12 +30,12 @@ void board_init(void) { // USB - never_reset_pin(&pin_GPIO19); - never_reset_pin(&pin_GPIO20); + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); // Debug UART - never_reset_pin(&pin_GPIO43); - never_reset_pin(&pin_GPIO44); + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); } bool board_requests_safe_mode(void) { diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/esp32s2/common-hal/busio/I2C.c index 51817c95e2..391d7323c5 100644 --- a/ports/esp32s2/common-hal/busio/I2C.c +++ b/ports/esp32s2/common-hal/busio/I2C.c @@ -31,6 +31,7 @@ #include "driver/i2c.h" #include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" #include "supervisor/shared/translate.h" typedef enum { @@ -217,6 +218,6 @@ uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, void common_hal_busio_i2c_never_reset(busio_i2c_obj_t *self) { never_reset_i2c(self->i2c_num); - never_reset_pin(self->scl_pin); - never_reset_pin(self->sda_pin); + common_hal_never_reset_pin(self->scl_pin); + common_hal_never_reset_pin(self->sda_pin); } diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index 9790c516ff..686f44cbc2 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -29,7 +29,7 @@ #include "py/runtime.h" #include "boards/board.h" -#include "common-hal/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/Pin.h" #include "supervisor/shared/rgb_led_status.h" #include "esp_log.h" @@ -101,7 +101,8 @@ static bool spi_bus_is_free(spi_host_device_t host_id) { } static void spi_interrupt_handler(void *arg) { - // busio_spi_obj_t *self = arg; + busio_spi_obj_t *self = arg; + ESP_LOGE(TAG, "SPI interrupt %p", self); } // The interrupt may get invoked by the bus lock. @@ -148,7 +149,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, mp_raise_ValueError(translate("All SPI peripherals are in use")); } - esp_err_t result = spi_bus_initialize(host_id, &bus_config, 0 /* dma channel */); + esp_err_t result = spi_bus_initialize(host_id, &bus_config, host_id /* dma channel */); if (result == ESP_ERR_NO_MEM) { mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); } else if (result == ESP_ERR_INVALID_ARG) { @@ -183,34 +184,35 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, spi_bus_lock_set_bg_control(spi_bus_get_attr(host_id)->lock, spi_bus_intr_enable, spi_bus_intr_disable, self); spi_hal_context_t* hal = &self->hal_context; - hal->hw = NULL; // Set by spi_hal_init - hal->dmadesc_tx = NULL; - hal->dmadesc_rx = NULL; - hal->dmadesc_n = 0; + + // spi_hal_init clears the given hal context so set everything after. + spi_hal_init(hal, host_id); + hal->dmadesc_tx = &self->tx_dma; + hal->dmadesc_rx = &self->rx_dma; + hal->dmadesc_n = 1; // We don't use native CS. - hal->cs_setup = 0; - hal->cs_hold = 0; - hal->cs_pin_id = 0; + // hal->cs_setup = 0; + // hal->cs_hold = 0; + // hal->cs_pin_id = 0; hal->sio = 1; - hal->half_duplex = 0; - hal->tx_lsbfirst = 0; - hal->rx_lsbfirst = 0; - hal->dma_enabled = 0; + // hal->half_duplex = 0; + // hal->tx_lsbfirst = 0; + // hal->rx_lsbfirst = 0; + hal->dma_enabled = 1; hal->no_compensate = 1; // Ignore CS bits // We don't use cmd, addr or dummy bits. - hal->cmd = 0; - hal->cmd_bits = 0; - hal->addr_bits = 0; - hal->dummy_bits = 0; - hal->addr = 0; + // hal->cmd = 0; + // hal->cmd_bits = 0; + // hal->addr_bits = 0; + // hal->dummy_bits = 0; + // hal->addr = 0; hal->io_mode = SPI_LL_IO_MODE_NORMAL; - spi_hal_init(hal, host_id); // This must be set after spi_hal_init. hal->timing_conf = &self->timing_conf; if (hal->hw == NULL) { @@ -223,9 +225,9 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { spi_never_reset[self->host_id] = true; - never_reset_pin(self->clock_pin); - never_reset_pin(self->MOSI_pin); - never_reset_pin(self->MISO_pin); + common_hal_never_reset_pin(self->clock_pin); + common_hal_never_reset_pin(self->MOSI_pin); + common_hal_never_reset_pin(self->MISO_pin); } bool common_hal_busio_spi_deinited(busio_spi_obj_t *self) { @@ -322,17 +324,29 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_ou } spi_hal_context_t* hal = &self->hal_context; - hal->tx_bitlen = len * self->bits; - hal->rx_bitlen = len * self->bits; - hal->send_buffer = (uint8_t*) data_out; - hal->rcv_buffer = data_in; + hal->send_buffer = NULL; + hal->rcv_buffer = NULL; + // This rounds up. + size_t dma_count = (len + LLDESC_MAX_NUM_PER_DESC - 1) / LLDESC_MAX_NUM_PER_DESC; + for (size_t i = 0; i < dma_count; i++) { + size_t offset = LLDESC_MAX_NUM_PER_DESC * i; + size_t dma_len = len - offset; + if (dma_len > LLDESC_MAX_NUM_PER_DESC) { + dma_len = LLDESC_MAX_NUM_PER_DESC; + } + hal->tx_bitlen = dma_len * self->bits; + hal->rx_bitlen = dma_len * self->bits; + if (data_out != NULL) { + hal->send_buffer = (uint8_t*) data_out + offset; + } + if (data_in != NULL) { + hal->rcv_buffer = data_in + offset; + } - spi_hal_setup_trans(hal); - spi_hal_prepare_data(hal); - spi_hal_user_start(hal); - if (len >= SOC_SPI_MAXIMUM_BUFFER_SIZE && false) { - // Set up the interrupt and wait on the lock. - } else { + spi_hal_setup_trans(hal); + spi_hal_prepare_data(hal); + spi_hal_user_start(hal); + // TODO: Switch to waiting on a lock that is given by an interrupt. while (!spi_hal_usr_is_done(hal)) { RUN_BACKGROUND_TASKS; } diff --git a/ports/esp32s2/common-hal/busio/SPI.h b/ports/esp32s2/common-hal/busio/SPI.h index 38fbe42ffc..6d82038317 100644 --- a/ports/esp32s2/common-hal/busio/SPI.h +++ b/ports/esp32s2/common-hal/busio/SPI.h @@ -44,6 +44,10 @@ typedef struct { spi_hal_context_t hal_context; spi_hal_timing_conf_t timing_conf; intr_handle_t interrupt; + // IDF allocates these in DMA accessible memory so they may need to move when + // we use external RAM for CircuitPython. + lldesc_t tx_dma; + lldesc_t rx_dma; uint32_t target_frequency; int32_t real_frequency; uint8_t polarity; diff --git a/ports/esp32s2/common-hal/displayio/ParallelBus.c b/ports/esp32s2/common-hal/displayio/ParallelBus.c new file mode 100644 index 0000000000..314b72ff73 --- /dev/null +++ b/ports/esp32s2/common-hal/displayio/ParallelBus.c @@ -0,0 +1,66 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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/displayio/ParallelBus.h" + +#include + +#include "common-hal/microcontroller/Pin.h" +#include "py/runtime.h" +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "shared-bindings/microcontroller/__init__.h" + +void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t* self, + const mcu_pin_obj_t* data0, const mcu_pin_obj_t* command, const mcu_pin_obj_t* chip_select, + const mcu_pin_obj_t* write, const mcu_pin_obj_t* read, const mcu_pin_obj_t* reset) { + + mp_raise_NotImplementedError(translate("ParallelBus not yet supported")); +} + +void common_hal_displayio_parallelbus_deinit(displayio_parallelbus_obj_t* self) { + +} + +bool common_hal_displayio_parallelbus_reset(mp_obj_t obj) { + return false; +} + +bool common_hal_displayio_parallelbus_bus_free(mp_obj_t obj) { + return false; +} + +bool common_hal_displayio_parallelbus_begin_transaction(mp_obj_t obj) { + + return false; +} + +void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, uint8_t *data, uint32_t data_length) { + +} + +void common_hal_displayio_parallelbus_end_transaction(mp_obj_t obj) { + +} diff --git a/ports/esp32s2/common-hal/displayio/ParallelBus.h b/ports/esp32s2/common-hal/displayio/ParallelBus.h new file mode 100644 index 0000000000..cd636921d9 --- /dev/null +++ b/ports/esp32s2/common-hal/displayio/ParallelBus.h @@ -0,0 +1,36 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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_ESP32S2_COMMON_HAL_DISPLAYIO_PARALLELBUS_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_DISPLAYIO_PARALLELBUS_H + +#include "common-hal/digitalio/DigitalInOut.h" + +typedef struct { + mp_obj_base_t base; +} displayio_parallelbus_obj_t; + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_DISPLAYIO_PARALLELBUS_H diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index 075f80abc6..5a059f0bbc 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -42,7 +42,7 @@ void never_reset_pin_number(gpio_num_t pin_number) { never_reset_pins[pin_number / 32] |= 1 << pin_number % 32; } -void never_reset_pin(const mcu_pin_obj_t* pin) { +void common_hal_never_reset_pin(const mcu_pin_obj_t* pin) { never_reset_pin_number(pin->number); } diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.h b/ports/esp32s2/common-hal/microcontroller/Pin.h index ab06b388f8..19985bda6f 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.h +++ b/ports/esp32s2/common-hal/microcontroller/Pin.h @@ -42,6 +42,5 @@ void common_hal_reset_pin(const mcu_pin_obj_t* pin); void claim_pin(const mcu_pin_obj_t* pin); bool pin_number_is_free(gpio_num_t pin_number); void never_reset_pin_number(gpio_num_t pin_number); -void never_reset_pin(const mcu_pin_obj_t* pin); #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_MICROCONTROLLER_PIN_H diff --git a/ports/esp32s2/modules/wroom.c b/ports/esp32s2/modules/wroom.c index 16c5861187..5e530701bf 100644 --- a/ports/esp32s2/modules/wroom.c +++ b/ports/esp32s2/modules/wroom.c @@ -28,10 +28,10 @@ void never_reset_module_internal_pins(void) { // SPI Flash - never_reset_pin(&pin_GPIO27); - never_reset_pin(&pin_GPIO28); - never_reset_pin(&pin_GPIO29); - never_reset_pin(&pin_GPIO30); - never_reset_pin(&pin_GPIO31); - never_reset_pin(&pin_GPIO32); + common_hal_never_reset_pin(&pin_GPIO27); + common_hal_never_reset_pin(&pin_GPIO28); + common_hal_never_reset_pin(&pin_GPIO29); + common_hal_never_reset_pin(&pin_GPIO30); + common_hal_never_reset_pin(&pin_GPIO31); + common_hal_never_reset_pin(&pin_GPIO32); } diff --git a/ports/esp32s2/modules/wrover.c b/ports/esp32s2/modules/wrover.c index d589a8fd4d..23fa7ee5ca 100644 --- a/ports/esp32s2/modules/wrover.c +++ b/ports/esp32s2/modules/wrover.c @@ -28,11 +28,11 @@ void never_reset_module_internal_pins(void) { // SPI Flash and RAM - never_reset_pin(&pin_GPIO26); - never_reset_pin(&pin_GPIO27); - never_reset_pin(&pin_GPIO28); - never_reset_pin(&pin_GPIO29); - never_reset_pin(&pin_GPIO30); - never_reset_pin(&pin_GPIO31); - never_reset_pin(&pin_GPIO32); + common_hal_never_reset_pin(&pin_GPIO26); + common_hal_never_reset_pin(&pin_GPIO27); + common_hal_never_reset_pin(&pin_GPIO28); + common_hal_never_reset_pin(&pin_GPIO29); + common_hal_never_reset_pin(&pin_GPIO30); + common_hal_never_reset_pin(&pin_GPIO31); + common_hal_never_reset_pin(&pin_GPIO32); } diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 9f59c1b467..8e2745a8c6 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -20,7 +20,7 @@ CIRCUITPY_BITBANGIO = 1 CIRCUITPY_BOARD = 1 CIRCUITPY_DIGITALIO = 1 CIRCUITPY_BUSIO = 1 -CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_DISPLAYIO = 1 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_MICROCONTROLLER = 1 diff --git a/shared-module/displayio/Display.h b/shared-module/displayio/Display.h index 8adaf597f9..861a38fd7c 100644 --- a/shared-module/displayio/Display.h +++ b/shared-module/displayio/Display.h @@ -29,7 +29,9 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/displayio/Group.h" +#if CIRCUITPY_PULSEIO #include "shared-bindings/pulseio/PWMOut.h" +#endif #include "shared-module/displayio/area.h" #include "shared-module/displayio/display_core.h" @@ -39,7 +41,9 @@ typedef struct { displayio_display_core_t core; union { digitalio_digitalinout_obj_t backlight_inout; + #if CIRCUITPY_PULSEIO pulseio_pwmout_obj_t backlight_pwm; + #endif }; uint64_t last_backlight_refresh; uint64_t last_refresh_call; diff --git a/shared-module/displayio/EPaperDisplay.h b/shared-module/displayio/EPaperDisplay.h index d08bed5462..3b9f6e3680 100644 --- a/shared-module/displayio/EPaperDisplay.h +++ b/shared-module/displayio/EPaperDisplay.h @@ -29,7 +29,6 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/displayio/Group.h" -#include "shared-bindings/pulseio/PWMOut.h" #include "shared-module/displayio/area.h" #include "shared-module/displayio/display_core.h" From 03e5043af4de14bd8115a4eeb608a2726ab59c6e Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 24 Jun 2020 13:10:31 -0700 Subject: [PATCH 0081/1293] Turn off Idle WDT and speed up CPU --- ports/esp32s2/background.c | 6 ++---- ports/esp32s2/sdkconfig.defaults | 28 ++++++++++++++++------------ ports/esp32s2/supervisor/port.c | 3 +++ 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/ports/esp32s2/background.c b/ports/esp32s2/background.c index e979d78311..a90fa7d0aa 100644 --- a/ports/esp32s2/background.c +++ b/ports/esp32s2/background.c @@ -47,10 +47,8 @@ void run_background_tasks(void) { return; } - // Delay for 1 tick so that we don't starve the idle task. - // TODO: 1 tick is 10ms which is a long time! Can we delegate to idle for a minimal amount of - // time? - vTaskDelay(1); + // Zero delay in case FreeRTOS wants to switch to something else. + vTaskDelay(0); running_background_tasks = true; filesystem_background(); diff --git a/ports/esp32s2/sdkconfig.defaults b/ports/esp32s2/sdkconfig.defaults index 958e1852ea..729ebac889 100644 --- a/ports/esp32s2/sdkconfig.defaults +++ b/ports/esp32s2/sdkconfig.defaults @@ -190,9 +190,9 @@ CONFIG_EFUSE_MAX_BLK_LEN=256 # ESP32S2-specific # # CONFIG_ESP32S2_DEFAULT_CPU_FREQ_80 is not set -CONFIG_ESP32S2_DEFAULT_CPU_FREQ_160=y -# CONFIG_ESP32S2_DEFAULT_CPU_FREQ_240 is not set -CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ=160 +# CONFIG_ESP32S2_DEFAULT_CPU_FREQ_160 is not set +CONFIG_ESP32S2_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ=240 # # Memory protection @@ -271,10 +271,7 @@ CONFIG_ESP_CONSOLE_UART_RX_GPIO=3 CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 CONFIG_ESP_INT_WDT=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 -CONFIG_ESP_TASK_WDT=y -# CONFIG_ESP_TASK_WDT_PANIC is not set -CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 -CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +# CONFIG_ESP_TASK_WDT is not set CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y # end of Common ESP-related @@ -528,6 +525,7 @@ CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 +# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set # CONFIG_MBEDTLS_DEBUG is not set # @@ -547,8 +545,12 @@ CONFIG_MBEDTLS_AES_USE_INTERRUPT=y CONFIG_MBEDTLS_HARDWARE_GCM=y CONFIG_MBEDTLS_HARDWARE_MPI=y CONFIG_MBEDTLS_HARDWARE_SHA=y +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set CONFIG_MBEDTLS_HAVE_TIME=y # CONFIG_MBEDTLS_HAVE_TIME_DATE is not set +CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y +CONFIG_MBEDTLS_SHA512_C=y CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y # CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set # CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set @@ -627,6 +629,10 @@ CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y CONFIG_MBEDTLS_ECP_NIST_OPTIM=y +# CONFIG_MBEDTLS_POLY1305_C is not set +# CONFIG_MBEDTLS_CHACHA20_C is not set +# CONFIG_MBEDTLS_HKDF_C is not set +# CONFIG_MBEDTLS_THREADING_C is not set # CONFIG_MBEDTLS_SECURITY_RISKS is not set # end of mbedTLS @@ -705,6 +711,7 @@ CONFIG_WPA_MBEDTLS_CRYPTO=y # CONFIG_WPA_DEBUG_PRINT is not set # CONFIG_WPA_TESTING_OPTIONS is not set # CONFIG_WPA_TLS_V12 is not set +# CONFIG_WPA_WPS_WARS is not set # end of Supplicant # end of Component config @@ -756,7 +763,7 @@ CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y CONFIG_ADC2_DISABLE_DAC=y CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_MAIN_TASK_STACK_SIZE=3584 +CONFIG_MAIN_TASK_STACK_SIZE=8192 CONFIG_IPC_TASK_STACK_SIZE=1024 CONFIG_CONSOLE_UART_DEFAULT=y # CONFIG_CONSOLE_UART_CUSTOM is not set @@ -767,10 +774,7 @@ CONFIG_CONSOLE_UART_RX_GPIO=3 CONFIG_CONSOLE_UART_BAUDRATE=115200 CONFIG_INT_WDT=y CONFIG_INT_WDT_TIMEOUT_MS=300 -CONFIG_TASK_WDT=y -# CONFIG_TASK_WDT_PANIC is not set -CONFIG_TASK_WDT_TIMEOUT_S=5 -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +# CONFIG_TASK_WDT is not set # CONFIG_EVENT_LOOP_PROFILING is not set CONFIG_POST_EVENTS_FROM_ISR=y CONFIG_POST_EVENTS_FROM_IRAM_ISR=y diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index fbfbc9f2eb..ebf0020399 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -69,6 +69,9 @@ safe_mode_t port_init(void) { void reset_port(void) { reset_all_pins(); + // A larger delay so the idle task can run and do any IDF cleanup needed. + vTaskDelay(4); + #if CIRCUITPY_BUSIO i2c_reset(); spi_reset(); From 436b15e558868ff836ba7205e7e799046bb53b64 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Thu, 25 Jun 2020 10:26:33 +0200 Subject: [PATCH 0082/1293] spresense: add elf32.h for mkspk --- ports/cxd56/mkspk/elf32.h | 175 ++++++++++++++++++++++++++++++++++++++ ports/cxd56/mkspk/mkspk.h | 12 ++- 2 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 ports/cxd56/mkspk/elf32.h diff --git a/ports/cxd56/mkspk/elf32.h b/ports/cxd56/mkspk/elf32.h new file mode 100644 index 0000000000..94a9c81ba3 --- /dev/null +++ b/ports/cxd56/mkspk/elf32.h @@ -0,0 +1,175 @@ +/**************************************************************************** + * include/elf32.h + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Reference: System V Application Binary Interface, Edition 4.1, March 18, + * 1997, The Santa Cruz Operation, Inc. + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __INCLUDE_ELF32_H +#define __INCLUDE_ELF32_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define EI_NIDENT 16 /* Size of e_ident[] */ + +#define ELF32_ST_BIND(i) ((i) >> 4) +#define ELF32_ST_TYPE(i) ((i) & 0xf) +#define ELF32_ST_INFO(b,t) (((b) << 4) | ((t) & 0xf)) + +/* Definitions for Elf32_Rel*::r_info */ + +#define ELF32_R_SYM(i) ((i) >> 8) +#define ELF32_R_TYPE(i) ((i) & 0xff) +#define ELF32_R_INFO(s,t) (((s)<< 8) | ((t) & 0xff)) + +#define ELF_R_SYM(i) ELF32_R_SYM(i) + +/**************************************************************************** + * Public Type Definitions + ****************************************************************************/ + +/* Figure 4.2: 32-Bit Data Types */ + +typedef uint32_t Elf32_Addr; /* Unsigned program address */ +typedef uint16_t Elf32_Half; /* Unsigned medium integer */ +typedef uint32_t Elf32_Off; /* Unsigned file offset */ +typedef int32_t Elf32_Sword; /* Signed large integer */ +typedef uint32_t Elf32_Word; /* Unsigned large integer */ + +/* Figure 4-3: ELF Header */ + +typedef struct +{ + unsigned char e_ident[EI_NIDENT]; + Elf32_Half e_type; + Elf32_Half e_machine; + Elf32_Word e_version; + Elf32_Addr e_entry; + Elf32_Off e_phoff; + Elf32_Off e_shoff; + Elf32_Word e_flags; + Elf32_Half e_ehsize; + Elf32_Half e_phentsize; + Elf32_Half e_phnum; + Elf32_Half e_shentsize; + Elf32_Half e_shnum; + Elf32_Half e_shstrndx; +} Elf32_Ehdr; + +/* Figure 4-8: Section Header */ + +typedef struct +{ + Elf32_Word sh_name; + Elf32_Word sh_type; + Elf32_Word sh_flags; + Elf32_Addr sh_addr; + Elf32_Off sh_offset; + Elf32_Word sh_size; + Elf32_Word sh_link; + Elf32_Word sh_info; + Elf32_Word sh_addralign; + Elf32_Word sh_entsize; +} Elf32_Shdr; + +/* Figure 4-15: Symbol Table Entry */ + +typedef struct +{ + Elf32_Word st_name; + Elf32_Addr st_value; + Elf32_Word st_size; + unsigned char st_info; + unsigned char st_other; + Elf32_Half st_shndx; +} Elf32_Sym; + +/* Figure 4-19: Relocation Entries */ + +typedef struct +{ + Elf32_Addr r_offset; + Elf32_Word r_info; +} Elf32_Rel; + +typedef struct +{ + Elf32_Addr r_offset; + Elf32_Word r_info; + Elf32_Sword r_addend; +} Elf32_Rela; + +/* Figure 5-1: Program Header */ + +typedef struct +{ + Elf32_Word p_type; + Elf32_Off p_offset; + Elf32_Addr p_vaddr; + Elf32_Addr p_paddr; + Elf32_Word p_filesz; + Elf32_Word p_memsz; + Elf32_Word p_flags; + Elf32_Word p_align; +} Elf32_Phdr; + +/* Figure 5-9: Dynamic Structure */ + +typedef struct +{ + Elf32_Sword d_tag; + union + { + Elf32_Word d_val; + Elf32_Addr d_ptr; + } d_un; +} Elf32_Dyn; + +typedef Elf32_Addr Elf_Addr; +typedef Elf32_Ehdr Elf_Ehdr; +typedef Elf32_Rel Elf_Rel; +typedef Elf32_Rela Elf_Rela; +typedef Elf32_Sym Elf_Sym; +typedef Elf32_Shdr Elf_Shdr; +typedef Elf32_Word Elf_Word; + +#endif /* __INCLUDE_ELF32_H */ diff --git a/ports/cxd56/mkspk/mkspk.h b/ports/cxd56/mkspk/mkspk.h index 5a67bb3dd4..5c1b979c04 100644 --- a/ports/cxd56/mkspk/mkspk.h +++ b/ports/cxd56/mkspk/mkspk.h @@ -36,12 +36,22 @@ ****************************************************************************/ #include "clefia.h" -#include "elf.h" +#include "elf32.h" /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +#define EI_MAG0 0 /* File identification */ +#define EI_MAG1 1 +#define EI_MAG2 2 +#define EI_MAG3 3 + +#define SHT_SYMTAB 2 +#define SHT_STRTAB 3 + +#define PT_LOAD 1 + #define alignup(x, a) (((x) + ((a) - 1)) & ~((a) - 1)) #define swap(a, b) { (a) ^= (b); (b) ^= (a); (a) ^= (b); } From f552d854f440b9332782b314ba381fb10f3a461a Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Wed, 24 Jun 2020 12:43:23 +0000 Subject: [PATCH 0083/1293] Translated using Weblate (Spanish) Currently translated at 81.9% (626 of 764 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 67 ++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/locale/es.po b/locale/es.po index 43e80a1da6..013750e931 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-06-22 10:35+0000\n" +"PO-Revision-Date: 2020-06-24 18:32+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" @@ -954,7 +954,7 @@ msgstr "Frecuencia suministrada no válida" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "" +msgstr "Acceso a memoria no válido" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid number of bits" @@ -1013,7 +1013,7 @@ msgstr "" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice" -msgstr "" +msgstr "Voz inválida" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice count" @@ -1025,11 +1025,11 @@ msgstr "Archivo wave inválido" #: ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" -msgstr "" +msgstr "Tamaño no válido de palabra/bit" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" -msgstr "" +msgstr "La llave debe tener 16, 24 o 32 bytes de longitud" #: py/compile.c msgid "LHS of keyword arg must be an id" @@ -1162,7 +1162,7 @@ msgstr "Sin soporte de hardware en pin" #: shared-bindings/aesio/aes.c msgid "No key was specified" -msgstr "" +msgstr "No se especificó ninguna llave" #: shared-bindings/time/__init__.c msgid "No long integer support" @@ -1251,7 +1251,7 @@ msgstr "" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" -msgstr "" +msgstr "ParallelBus no soportado aún" #: py/moduerrno.c msgid "Permission denied" @@ -1312,11 +1312,11 @@ msgstr "Pull no se usa cuando la dirección es output." #: ports/stm/common-hal/pulseio/PulseIn.c msgid "PulseIn not supported on this chip" -msgstr "" +msgstr "PulseIn no es compatible con este chip" #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" -msgstr "" +msgstr "PulseOut no es compatible con este chip" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" @@ -1324,7 +1324,7 @@ msgstr "" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" -msgstr "" +msgstr "Error de inicialización de RNG" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" @@ -1346,7 +1346,7 @@ msgstr "" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" -msgstr "" +msgstr "Error de generación de números aleatorios" #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" @@ -1357,17 +1357,16 @@ msgid "Read-only filesystem" msgstr "Sistema de archivos de solo-Lectura" #: shared-module/displayio/Bitmap.c -#, fuzzy msgid "Read-only object" -msgstr "Solo-lectura" +msgstr "Objeto de solo-lectura" #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" -msgstr "" +msgstr "Actualizando demasiado pronto" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" -msgstr "" +msgstr "El modo AES solicitado no es compatible" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" @@ -1392,11 +1391,11 @@ msgstr "SDA o SCL necesitan una pull up" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" -msgstr "" +msgstr "Error de inicio de SPI" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Re-initialization error" -msgstr "" +msgstr "Error de reinicialización de SPI" #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" @@ -1409,15 +1408,15 @@ msgstr "Frecuencia de muestreo demasiado alta. Debe ser menor a %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." -msgstr "" +msgstr "Escaneo en progreso. Use stop_scan para detener." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" -msgstr "" +msgstr "Pin CTS seleccionado no válido" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected RTS pin not valid" -msgstr "" +msgstr "Pin RTS seleccionado no válido" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1451,11 +1450,11 @@ msgstr "A Stream le falta el método readinto() o write()." #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" -msgstr "" +msgstr "Suministre al menos un pin UART" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" -msgstr "" +msgstr "Lectura de temperatura expirada" #: supervisor/shared/safe_mode.c msgid "" @@ -1498,11 +1497,11 @@ msgstr "La altura del Tile debe dividir exacto la altura del bitmap" #: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c msgid "Tile index out of bounds" -msgstr "" +msgstr "Índice de mosaico fuera de límites" #: shared-bindings/displayio/TileGrid.c msgid "Tile value out of bounds" -msgstr "" +msgstr "Valor de mosaico fuera de límites" #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" @@ -1512,6 +1511,8 @@ msgstr "Ancho del Tile debe dividir exactamente el ancho de mapa de bits" #, c-format msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +"Tiempo de espera demasiado largo: El tiempo máximo de espera es de %d " +"segundos" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1543,19 +1544,19 @@ msgstr "" #: ports/stm/common-hal/busio/UART.c msgid "UART De-init error" -msgstr "" +msgstr "Error de desinicialización de UARL" #: ports/stm/common-hal/busio/UART.c msgid "UART Init Error" -msgstr "" +msgstr "Error de inicialización de UARL" #: ports/stm/common-hal/busio/UART.c msgid "UART Re-init error" -msgstr "" +msgstr "Error de reinicialización de UARL" #: ports/stm/common-hal/busio/UART.c msgid "UART write error" -msgstr "" +msgstr "Error de escritura UART" #: shared-module/usb_hid/Device.c msgid "USB Busy" @@ -1567,7 +1568,7 @@ msgstr "Error USB" #: shared-bindings/_bleio/UUID.c msgid "UUID integer value must be 0-0xffff" -msgstr "" +msgstr "El valor entero del UUID debe ser 0-0xffff" #: shared-bindings/_bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" @@ -1585,7 +1586,7 @@ msgstr "No se pudieron asignar buffers para la conversión con signo" #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" -msgstr "" +msgstr "No se puede encontrar la pantalla I2C en %x" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1615,17 +1616,17 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "Unknown reason." -msgstr "" +msgstr "Razón desconocida." #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" -msgstr "" +msgstr "Error de seguridad desconocido: 0x%04x" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown soft device error: %04x" -msgstr "" +msgstr "Error suave desconocido en dispositivo: %04x" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format From ce95b9379d9a7f763a19de58be7a751e6874435c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 14:25:58 -0500 Subject: [PATCH 0084/1293] Refer to "main" branch of circuitpython --- CONTRIBUTING.md | 2 +- README.rst | 6 +++--- docs/README.md | 2 +- docs/design_guide.rst | 2 +- tools/codestats.sh | 10 +++++----- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7477df61cf..0d85926310 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing Please note that this project is released with a -[Contributor Code of Conduct](https://github.com/adafruit/circuitpython/blob/master/CODE_OF_CONDUCT.md). +[Contributor Code of Conduct](https://github.com/adafruit/circuitpython/blob/main/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. Participation covers any forum used to converse about CircuitPython including unofficial and official spaces. Failure to do so will result in corrective actions such as time out or ban from the project. diff --git a/README.rst b/README.rst index dfddd13373..d09dcda456 100644 --- a/README.rst +++ b/README.rst @@ -55,12 +55,12 @@ Contributing ------------ See -`CONTRIBUTING.md `__ +`CONTRIBUTING.md `__ for full guidelines but please be aware that by contributing to this project you are agreeing to the `Code of -Conduct `__. +Conduct `__. Contributors who follow the `Code of -Conduct `__ +Conduct `__ are welcome to submit pull requests and they will be promptly reviewed by project admins. Please join the `Discord `__ too. diff --git a/docs/README.md b/docs/README.md index e98b46f67b..19c81a2fa3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -5,7 +5,7 @@ The latest documentation can be found at: http://circuitpython.readthedocs.io/en/latest/ The documentation you see there is generated from the files in the whole tree: -https://github.com/adafruit/circuitpython/tree/master +https://github.com/adafruit/circuitpython/tree/main Building the documentation locally ---------------------------------- diff --git a/docs/design_guide.rst b/docs/design_guide.rst index 6f87ecf798..1d40943acb 100644 --- a/docs/design_guide.rst +++ b/docs/design_guide.rst @@ -3,7 +3,7 @@ Design Guide This guide covers a variety of development practices for CircuitPython core and library APIs. These APIs are both `built-into CircuitPython -`_ and those that are +`_ and those that are `distributed on GitHub `_ and in the `Adafruit `_ and `Community `_ bundles. Consistency with these diff --git a/tools/codestats.sh b/tools/codestats.sh index d33db973b1..5f7625c450 100755 --- a/tools/codestats.sh +++ b/tools/codestats.sh @@ -90,9 +90,9 @@ else last_rev="v1.0" fi -# get a list of hashes between last revision (exclusive) and master -hashes=$(git log --format=format:"%H" --reverse ${last_rev}..master) -#hashes=$(git log --format=format:"%H" --reverse ${last_rev}..master | $AWK '{if (NR % 10 == 0) print $0}') # do every 10th one +# get a list of hashes between last revision (exclusive) and main +hashes=$(git log --format=format:"%H" --reverse ${last_rev}..main) +#hashes=$(git log --format=format:"%H" --reverse ${last_rev}..main | $AWK '{if (NR % 10 == 0) print $0}') # do every 10th one for hash in $hashes; do @@ -182,6 +182,6 @@ EOF done -# checkout master and cleanup -git checkout master +# checkout main and cleanup +git checkout main $RM $pystoneavg From 2a1c37cf8b6d529294625ff0097642f926117f3a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 14:26:14 -0500 Subject: [PATCH 0085/1293] locale: Remove Language-Team lines that point nowhere --- locale/de_DE.po | 2 -- locale/en_x_pirate.po | 2 -- locale/fr.po | 2 -- 3 files changed, 6 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index 1359ce6dd0..d317a6234a 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -10,8 +10,6 @@ msgstr "" "POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" -"Language-Team: German \n" "Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index b240ab689b..0f1bf91057 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -10,8 +10,6 @@ msgstr "" "POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2020-03-30 22:11+0000\n" "Last-Translator: Tannewt \n" -"Language-Team: English \n" "Language: en_x_pirate\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/locale/fr.po b/locale/fr.po index 587f098771..20d42d49e0 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -11,8 +11,6 @@ msgstr "" "POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" -"Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" From 9110e366369ba0f99c8e33032da64edb34a4c74a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 14:28:11 -0500 Subject: [PATCH 0086/1293] Use main/selected terminology in docstrings Also copy some notes from busio docstrings to bitbangio docstrings --- shared-bindings/bitbangio/I2C.c | 14 +++++++++++--- shared-bindings/bitbangio/SPI.c | 24 +++++++++++++++++------- shared-bindings/busio/I2C.c | 6 +++--- shared-bindings/busio/SPI.c | 15 ++++++++------- shared-bindings/i2cslave/I2CSlave.c | 8 ++++---- shared-bindings/i2cslave/__init__.c | 6 +++--- 6 files changed, 46 insertions(+), 27 deletions(-) diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index 2043fc903f..43fe11e628 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -45,6 +45,14 @@ //| physical level it consists of 2 wires: SCL and SDA, the clock and data //| lines respectively. //| +//| .. seealso:: Using this class directly requires careful lock management. +//| Instead, use :class:`~adafruit_bus_device.i2c_device.I2CDevice` to +//| manage locks. +//| +//| .. seealso:: Using this class to directly read registers requires manual +//| bit unpacking. Instead, use an existing driver or make one with +//| :ref:`Register ` data descriptors. +//| //| :param ~microcontroller.Pin scl: The clock pin //| :param ~microcontroller.Pin sda: The data pin //| :param int frequency: The clock frequency of the bus @@ -158,7 +166,7 @@ STATIC mp_obj_t bitbangio_i2c_obj_unlock(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_unlock_obj, bitbangio_i2c_obj_unlock); //| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any: -//| """Read into ``buffer`` from the slave specified by ``address``. +//| """Read into ``buffer`` from the device selected by ``address``. //| The number of bytes read will be the length of ``buffer``. //| At least one byte must be read. //| @@ -210,7 +218,7 @@ STATIC mp_obj_t bitbangio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_a MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_readfrom_into_obj, 3, bitbangio_i2c_readfrom_into); //| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any: -//| """Write the bytes from ``buffer`` to the slave specified by ``address`` and then transmits a +//| """Write the bytes from ``buffer`` to the device selected by ``address`` and then transmits a //| stop bit. Use `writeto_then_readfrom` when needing a write, no stop and repeated start //| before a read. //| @@ -270,7 +278,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_writeto_obj, 1, bitbangio_i2c_wr //| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any: -//| """Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop +//| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and //| ``in_buffer`` can be the same buffer because they are used sequentially. //| diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index 08bbf1257f..6d31037c75 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -43,19 +43,29 @@ //| """A 3-4 wire serial protocol //| //| SPI is a serial protocol that has exclusive pins for data in and out of the -//| master. It is typically faster than :py:class:`~bitbangio.I2C` because a -//| separate pin is used to control the active slave rather than a transmitted +//| main device. It is typically faster than :py:class:`~bitbangio.I2C` because a +//| separate pin is used to select a device rather than a transmitted //| address. This class only manages three of the four SPI lines: `!clock`, -//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate slave -//| select line. (This is common because multiple slaves can share the `!clock`, -//| `!MOSI` and `!MISO` lines and therefore the hardware.)""" +//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate +//| select line, often abbreviated `!CS` or `!SS`. (This is common because +//| multiple secondaries can share the `!clock`, `!MOSI` and `!MISO` lines +//| and therefore the hardware.)""" //| //| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): //| """Construct an SPI object on the given pins. //| +//| .. seealso:: Using this class directly requires careful lock management. +//| Instead, use :class:`~adafruit_bus_device.spi_device.SPIDevice` to +//| manage locks. +//| +//| .. seealso:: Using this class to directly read registers requires manual +//| bit unpacking. Instead, use an existing driver or make one with +//| :ref:`Register ` data descriptors. +//| +//| //| :param ~microcontroller.Pin clock: the pin to use for the clock. -//| :param ~microcontroller.Pin MOSI: the Master Out Slave In pin. -//| :param ~microcontroller.Pin MISO: the Master In Slave Out pin.""" +//| :param ~microcontroller.Pin MOSI: the Main Out Selected In pin. +//| :param ~microcontroller.Pin MISO: the Main In Selected Out pin.""" //| ... //| diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 7e8af765f7..b61dd93f3a 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -177,7 +177,7 @@ STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock); //| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any: -//| """Read into ``buffer`` from the slave specified by ``address``. +//| """Read into ``buffer`` from the device selected by ``address``. //| The number of bytes read will be the length of ``buffer``. //| At least one byte must be read. //| @@ -229,7 +229,7 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args, MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_into); //| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any: -//| """Write the bytes from ``buffer`` to the slave specified by ``address``. +//| """Write the bytes from ``buffer`` to the device selected by ``address``. //| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be //| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and //| repeated start before a read. @@ -288,7 +288,7 @@ STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_ma STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto); //| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any: -//| """Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop +//| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and //| ``in_buffer`` can be the same buffer because they are used sequentially. //| diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 2ba9a4c22c..22f001d2dc 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -45,12 +45,13 @@ //| """A 3-4 wire serial protocol //| //| SPI is a serial protocol that has exclusive pins for data in and out of the -//| master. It is typically faster than :py:class:`~busio.I2C` because a -//| separate pin is used to control the active slave rather than a transitted +//| main device. It is typically faster than :py:class:`~bitbangio.I2C` because a +//| separate pin is used to select a device rather than a transmitted //| address. This class only manages three of the four SPI lines: `!clock`, -//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate slave -//| select line. (This is common because multiple slaves can share the `!clock`, -//| `!MOSI` and `!MISO` lines and therefore the hardware.)""" +//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate +//| select line, often abbreviated `!CS` or `!SS`. (This is common because +//| multiple secondaries can share the `!clock`, `!MOSI` and `!MISO` lines +//| and therefore the hardware.)""" //| //| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): //| @@ -72,8 +73,8 @@ //| :ref:`Register ` data descriptors. //| //| :param ~microcontroller.Pin clock: the pin to use for the clock. -//| :param ~microcontroller.Pin MOSI: the Master Out Slave In pin. -//| :param ~microcontroller.Pin MISO: the Master In Slave Out pin.""" +//| :param ~microcontroller.Pin MOSI: the Main Out Selected In pin. +//| :param ~microcontroller.Pin MISO: the Main In Selected Out pin.""" //| ... //| diff --git a/shared-bindings/i2cslave/I2CSlave.c b/shared-bindings/i2cslave/I2CSlave.c index 80875ce758..9f051a1253 100644 --- a/shared-bindings/i2cslave/I2CSlave.c +++ b/shared-bindings/i2cslave/I2CSlave.c @@ -134,7 +134,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_obj___exit__(size_t n_args, const mp_obj_t *a STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cslave_i2c_slave___exit___obj, 4, 4, i2cslave_i2c_slave_obj___exit__); //| def request(self, timeout: float = -1) -> Any: -//| """Wait for an I2C request from a master. +//| """Wait for an I2C request. //| //| :param float timeout: Timeout in seconds. Zero means wait forever, a negative value means check once //| :return: I2C Slave Request or None if timeout=-1 and there's no request @@ -228,12 +228,12 @@ const mp_obj_type_t i2cslave_i2c_slave_type = { //| class I2CSlaveRequest: //| //| def __init__(self, slave: i2cslave.I2CSlave, address: int, is_read: bool, is_restart: bool): -//| """I2C transfer request from a master. +//| """Information about an I2C transfer request //| This cannot be instantiated directly, but is returned by :py:meth:`I2CSlave.request`. //| //| :param slave: The I2C Slave receiving this request //| :param address: I2C address -//| :param is_read: I2C Master read request +//| :param is_read: True if the main device is requesting data //| :param is_restart: Repeated Start Condition""" //| STATIC mp_obj_t i2cslave_i2c_slave_request_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { @@ -270,7 +270,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_get_address(mp_obj_t self_in) { MP_DEFINE_CONST_PROP_GET(i2cslave_i2c_slave_request_address_obj, i2cslave_i2c_slave_request_get_address); //| is_read: bool = ... -//| """The I2C master is reading from the device.""" +//| """The I2C main controller is reading from this device.""" //| STATIC mp_obj_t i2cslave_i2c_slave_request_get_is_read(mp_obj_t self_in) { mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); diff --git a/shared-bindings/i2cslave/__init__.c b/shared-bindings/i2cslave/__init__.c index 41b42fef83..59674d5cb4 100644 --- a/shared-bindings/i2cslave/__init__.c +++ b/shared-bindings/i2cslave/__init__.c @@ -53,9 +53,9 @@ //| if not r: //| # Maybe do some housekeeping //| continue -//| with r: # Closes the transfer if necessary by sending a NACK or feeding the master dummy bytes +//| with r: # Closes the transfer if necessary by sending a NACK or feeding dummy bytes //| if r.address == 0x40: -//| if not r.is_read: # Master write which is Slave read +//| if not r.is_read: # Main write which is Selected read //| b = r.read(1) //| if not b or b[0] > 15: //| break @@ -63,7 +63,7 @@ //| b = r.read(1) //| if b: //| regs[index] = b[0] -//| elif r.is_restart: # Combined transfer: This is the Master read message +//| elif r.is_restart: # Combined transfer: This is the Main read message //| n = r.write(bytes([regs[index]])) //| #else: //| # A read transfer is not supported in this example From 9737dd9c308df0d7356ee5ff727e34a93a88e302 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 14:28:32 -0500 Subject: [PATCH 0087/1293] Scripts: Change wording for pseudoterminals --- tests/run-tests | 20 ++++++++++++-------- tools/pyboard.py | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/tests/run-tests b/tests/run-tests index 6e980f03ce..151d48095b 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -87,28 +87,32 @@ def run_micropython(pyb, args, test_file, is_special=False): def get(required=False): rv = b'' while True: - ready = select.select([master], [], [], 0.02) - if ready[0] == [master]: - rv += os.read(master, 1024) + ready = select.select([emulator], [], [], 0.02) + if ready[0] == [emulator]: + rv += os.read(emulator, 1024) else: if not required or rv: return rv def send_get(what): - os.write(master, what) + os.write(emulator, what) return get() with open(test_file, 'rb') as f: # instead of: output_mupy = subprocess.check_output(args, stdin=f) - master, slave = pty.openpty() - p = subprocess.Popen(args, stdin=slave, stdout=slave, + # openpty returns two read/write file descriptors. The first one is + # used by the program which provides the virtual + # terminal service, and the second one is used by the + # subprogram which requires a tty to work. + emulator, subterminal = pty.openpty() + p = subprocess.Popen(args, stdin=subterminal, stdout=subterminal, stderr=subprocess.STDOUT, bufsize=0) banner = get(True) output_mupy = banner + b''.join(send_get(line) for line in f) send_get(b'\x04') # exit the REPL, so coverage info is saved p.kill() - os.close(master) - os.close(slave) + os.close(emulator) + os.close(subterminal) else: output_mupy = subprocess.check_output(args + [test_file], stderr=subprocess.STDOUT) except subprocess.CalledProcessError: diff --git a/tools/pyboard.py b/tools/pyboard.py index 16ee41f703..bb5642bd78 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -191,7 +191,7 @@ class ProcessToSerial: class ProcessPtyToTerminal: - """Execute a process which creates a PTY and prints slave PTY as + """Execute a process which creates a PTY and prints secondary PTY as first line of its output, and emulate serial connection using this PTY.""" From 1d2cc0b968fb75e19a752ebe4ec846921297db0f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 08:45:15 -0500 Subject: [PATCH 0088/1293] I2CPeripheral: Rename class and its module This is an incompatible change. --- docs/porting.rst | 2 +- docs/redirects.txt | 4 +- .../boards/bdmicro_vina_m0/mpconfigboard.mk | 2 +- .../circuitbrains_basic_m0/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../feather_m0_express/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../feather_m0_supersized/mpconfigboard.mk | 2 +- .../hallowing_m0_express/mpconfigboard.mk | 2 +- .../itsybitsy_m0_express/mpconfigboard.mk | 2 +- .../boards/metro_m0_express/mpconfigboard.mk | 2 +- .../boards/pewpew_m4/mpconfigboard.mk | 2 +- .../boards/shirtty/mpconfigboard.mk | 2 +- .../boards/snekboard/mpconfigboard.mk | 2 +- .../sparkfun_redboard_turbo/mpconfigboard.mk | 2 +- .../stringcar_m0_express/mpconfigboard.mk | 2 +- .../trinket_m0_haxpress/mpconfigboard.mk | 2 +- .../boards/ugame10/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 3 +- .../boards/winterbloom_sol/mpconfigboard.mk | 2 +- .../I2CPeripheral.c} | 40 ++-- .../I2CPeripheral.h} | 8 +- .../common-hal/i2cperipheral/__init__.c | 1 + .../atmel-samd/common-hal/i2cslave/__init__.c | 1 - ports/cxd56/mpconfigport.mk | 2 +- ports/esp32s2/mpconfigport.mk | 2 +- ports/litex/mpconfigport.mk | 2 +- ports/mimxrt10xx/mpconfigport.mk | 2 +- ports/nrf/boards/pca10100/mpconfigboard.mk | 2 +- ports/nrf/mpconfigport.mk | 4 +- ports/stm/mpconfigport.mk | 6 +- py/circuitpy_defns.mk | 8 +- py/circuitpy_mpconfig.h | 10 +- py/circuitpy_mpconfig.mk | 4 +- .../I2CPeripheral.c} | 204 +++++++++--------- .../I2CPeripheral.h} | 26 +-- .../{i2cslave => i2cperipheral}/__init__.c | 37 ++-- 39 files changed, 203 insertions(+), 203 deletions(-) rename ports/atmel-samd/common-hal/{i2cslave/I2CSlave.c => i2cperipheral/I2CPeripheral.c} (80%) rename ports/atmel-samd/common-hal/{i2cslave/I2CSlave.h => i2cperipheral/I2CPeripheral.h} (85%) create mode 100644 ports/atmel-samd/common-hal/i2cperipheral/__init__.c delete mode 100644 ports/atmel-samd/common-hal/i2cslave/__init__.c rename shared-bindings/{i2cslave/I2CSlave.c => i2cperipheral/I2CPeripheral.c} (51%) rename shared-bindings/{i2cslave/I2CSlave.h => i2cperipheral/I2CPeripheral.h} (60%) rename shared-bindings/{i2cslave => i2cperipheral}/__init__.c (71%) diff --git a/docs/porting.rst b/docs/porting.rst index d28f56f475..db4ae76262 100644 --- a/docs/porting.rst +++ b/docs/porting.rst @@ -64,7 +64,7 @@ as a natural "TODO" list. An example minimal build list is shown below: CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 - CIRCUITPY_I2CSLAVE = 0 + CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO (stub ok) # These modules are implemented in shared-module/ - they can be included in diff --git a/docs/redirects.txt b/docs/redirects.txt index 68d0b2de2e..28dc73aba2 100644 --- a/docs/redirects.txt +++ b/docs/redirects.txt @@ -32,8 +32,8 @@ shared-bindings/pulseio/PWMOut.rst shared-bindings/pulseio/#pulseio.PWMOut shared-bindings/pulseio/PulseIn.rst shared-bindings/pulseio/#pulseio.PulseIn shared-bindings/pulseio/PulseOut.rst shared-bindings/pulseio/#pulseio.PulseOut shared-bindings/time/struct_time.rst shared-bindings/time/#time.struct_time -shared-bindings/i2cslave/I2CSlave.rst shared-bindings/i2cslave/#i2cslave.I2CSlave -shared-bindings/i2cslave/I2CSlaveRequest.rst shared-bindings/i2cslave/#i2cslave.I2CSlaveRequest +shared-bindings/i2cslave/I2CSlave.rst shared-bindings/i2cperipheral/#i2cperipheral.I2CPeripheral +shared-bindings/i2cslave/I2CSlaveRequest.rst shared-bindings/i2cperipheral/#i2cperipheral.I2CPeripheralRequest shared-bindings/nvm/ByteArray.rst shared-bindings/nvm/#nvm.ByteArray shared-bindings/busio/I2C.rst shared-bindings/busio/#busio.I2C shared-bindings/busio/OneWire.rst shared-bindings/busio/#busio.OneWire diff --git a/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk b/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk index 5a47a5890d..a36966b87c 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk @@ -12,7 +12,7 @@ EXTERNAL_FLASH_DEVICES = "MX25L51245G" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk index a71728e2db..da5f1ffac8 100755 --- a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk @@ -13,5 +13,5 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk index cdbdf44f80..81391b953e 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk @@ -14,7 +14,7 @@ LONGINT_IMPL = MPZ # Make room for frozen libs. CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 SUPEROPT_GC = 0 CFLAGS_INLINE_LIMIT = 55 diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index 46a245e609..7aa45eb39e 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -15,7 +15,7 @@ LONGINT_IMPL = NONE CIRCUITPY_BITBANGIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_PIXELBUF = 1 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index 4220aa77ff..863b97d315 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -14,7 +14,7 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" LONGINT_IMPL = NONE CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_RTC = 0 # So not all of displayio, sorry! diff --git a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk index 199cef362a..cec87f2bf9 100644 --- a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk @@ -13,7 +13,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk index d5e03b49d4..9e27ec7b4a 100644 --- a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk @@ -15,7 +15,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_GAMEPAD = 0 CFLAGS_INLINE_LIMIT = 50 diff --git a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk index a94dd3c4e7..8bd4b818df 100644 --- a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk @@ -13,7 +13,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 # supersized, not ultra-supersized CIRCUITPY_VECTORIO = 0 diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk index a8390fd97c..15c5ad817c 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk @@ -16,7 +16,7 @@ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_COUNTIO = 0 diff --git a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk index 812c208ccb..09420ed3da 100644 --- a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk @@ -15,7 +15,7 @@ CIRCUITPY_BITBANG_APA102 = 1 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_RTC = 0 # too itsy bitsy for all of displayio CIRCUITPY_VECTORIO = 0 diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk index 588e50ee1b..e3948565d1 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk @@ -12,7 +12,7 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index 864d31909d..b6490433e5 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -16,7 +16,7 @@ CIRCUITPY_ANALOGIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NETWORK = 0 CIRCUITPY_PIXELBUF = 0 diff --git a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk index 295ba4bce4..a04e097692 100644 --- a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk +++ b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk @@ -9,7 +9,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 -CIRCUITPY_I2CSLAVE = 1 +CIRCUITPY_I2CPERIPHERAL = 1 CIRCUITPY_TOUCHIO = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk index 08f8d431ea..eae50d70bf 100644 --- a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk +++ b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk @@ -13,7 +13,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk index 7a9b44e4c9..c17600fc75 100755 --- a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk @@ -12,7 +12,7 @@ EXTERNAL_FLASH_DEVICES = "W25Q32FV" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk index c4b1f6d5af..6f3febfe56 100644 --- a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk @@ -16,7 +16,7 @@ CIRCUITPY_BITBANG_APA102 = 1 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_RTC = 0 CIRCUITPY_VECTORIO = 0 diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk index 46f727131d..9e0621810c 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk @@ -15,6 +15,6 @@ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index 1c43369076..d641a89ebd 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -21,7 +21,7 @@ CIRCUITPY_DISPLAYIO = 1 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_RTC = 0 diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk index de9b617649..e06a2af7ee 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk @@ -19,12 +19,11 @@ CIRCUITPY_AUDIOIO = 1 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BLEIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NETWORK = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_RGBMATRIX = 0 diff --git a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk index e96497b3e5..11592073f9 100644 --- a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk @@ -22,7 +22,7 @@ CIRCUITPY_BLEIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NETWORK = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_RGBMATRIX = 0 diff --git a/ports/atmel-samd/common-hal/i2cslave/I2CSlave.c b/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c similarity index 80% rename from ports/atmel-samd/common-hal/i2cslave/I2CSlave.c rename to ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c index 79c1449e2f..84642d4048 100644 --- a/ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +++ b/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "shared-bindings/i2cslave/I2CSlave.h" +#include "shared-bindings/i2cperipheral/I2CPeripheral.h" #include "common-hal/busio/I2C.h" #include "lib/utils/interrupt_char.h" @@ -35,7 +35,7 @@ #include "hal/include/hal_gpio.h" #include "peripherals/samd/sercom.h" -void common_hal_i2cslave_i2c_slave_construct(i2cslave_i2c_slave_obj_t *self, +void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_peripheral_obj_t *self, const mcu_pin_obj_t *scl, const mcu_pin_obj_t *sda, uint8_t *addresses, unsigned int num_addresses, bool smbus) { uint8_t sercom_index; @@ -87,19 +87,19 @@ void common_hal_i2cslave_i2c_slave_construct(i2cslave_i2c_slave_obj_t *self, if (smbus) { sercom->I2CS.CTRLA.bit.LOWTOUTEN = 1; // Errata 12003 - sercom->I2CS.CTRLA.bit.SEXTTOEN = 1; // Slave SCL Low Extend/Cumulative Time-Out 25ms + sercom->I2CS.CTRLA.bit.SEXTTOEN = 1; // SCL Low Extend/Cumulative Time-Out 25ms } sercom->I2CS.CTRLA.bit.SCLSM = 0; // Clock stretch before ack - sercom->I2CS.CTRLA.bit.MODE = 0x04; // Slave mode + sercom->I2CS.CTRLA.bit.MODE = 0x04; // Device mode sercom->I2CS.CTRLA.bit.ENABLE = 1; } -bool common_hal_i2cslave_i2c_slave_deinited(i2cslave_i2c_slave_obj_t *self) { +bool common_hal_i2cperipheral_i2c_peripheral_deinited(i2cperipheral_i2c_peripheral_obj_t *self) { return self->sda_pin == NO_PIN; } -void common_hal_i2cslave_i2c_slave_deinit(i2cslave_i2c_slave_obj_t *self) { - if (common_hal_i2cslave_i2c_slave_deinited(self)) { +void common_hal_i2cperipheral_i2c_peripheral_deinit(i2cperipheral_i2c_peripheral_obj_t *self) { + if (common_hal_i2cperipheral_i2c_peripheral_deinited(self)) { return; } @@ -111,7 +111,7 @@ void common_hal_i2cslave_i2c_slave_deinit(i2cslave_i2c_slave_obj_t *self) { self->scl_pin = NO_PIN; } -static int i2c_slave_check_error(i2cslave_i2c_slave_obj_t *self, bool raise) { +static int i2c_peripheral_check_error(i2cperipheral_i2c_peripheral_obj_t *self, bool raise) { if (!self->sercom->I2CS.INTFLAG.bit.ERROR) { return 0; } @@ -130,9 +130,9 @@ static int i2c_slave_check_error(i2cslave_i2c_slave_obj_t *self, bool raise) { return -err; } -int common_hal_i2cslave_i2c_slave_is_addressed(i2cslave_i2c_slave_obj_t *self, uint8_t *address, bool *is_read, bool *is_restart) +int common_hal_i2cperipheral_i2c_peripheral_is_addressed(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *address, bool *is_read, bool *is_restart) { - int err = i2c_slave_check_error(self, false); + int err = i2c_peripheral_check_error(self, false); if (err) { return err; } @@ -149,22 +149,22 @@ int common_hal_i2cslave_i2c_slave_is_addressed(i2cslave_i2c_slave_obj_t *self, u for (unsigned int i = 0; i < self->num_addresses; i++) { if (*address == self->addresses[i]) { - common_hal_i2cslave_i2c_slave_ack(self, true); + common_hal_i2cperipheral_i2c_peripheral_ack(self, true); return 1; } } // This should clear AMATCH, but it doesn't... - common_hal_i2cslave_i2c_slave_ack(self, false); + common_hal_i2cperipheral_i2c_peripheral_ack(self, false); return 0; } -int common_hal_i2cslave_i2c_slave_read_byte(i2cslave_i2c_slave_obj_t *self, uint8_t *data) { +int common_hal_i2cperipheral_i2c_peripheral_read_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *data) { for (int t = 0; t < 100 && !self->sercom->I2CS.INTFLAG.reg; t++) { mp_hal_delay_us(10); } - i2c_slave_check_error(self, true); + i2c_peripheral_check_error(self, true); if (!self->sercom->I2CS.INTFLAG.bit.DRDY || self->sercom->I2CS.INTFLAG.bit.PREC || @@ -176,12 +176,12 @@ int common_hal_i2cslave_i2c_slave_read_byte(i2cslave_i2c_slave_obj_t *self, uint return 1; } -int common_hal_i2cslave_i2c_slave_write_byte(i2cslave_i2c_slave_obj_t *self, uint8_t data) { +int common_hal_i2cperipheral_i2c_peripheral_write_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t data) { for (int t = 0; !self->sercom->I2CS.INTFLAG.reg && t < 100; t++) { mp_hal_delay_us(10); } - i2c_slave_check_error(self, true); + i2c_peripheral_check_error(self, true); if (self->sercom->I2CS.INTFLAG.bit.PREC) { return 0; @@ -203,12 +203,12 @@ int common_hal_i2cslave_i2c_slave_write_byte(i2cslave_i2c_slave_obj_t *self, uin return 1; } -void common_hal_i2cslave_i2c_slave_ack(i2cslave_i2c_slave_obj_t *self, bool ack) { +void common_hal_i2cperipheral_i2c_peripheral_ack(i2cperipheral_i2c_peripheral_obj_t *self, bool ack) { self->sercom->I2CS.CTRLB.bit.ACKACT = !ack; self->sercom->I2CS.CTRLB.bit.CMD = 0x03; } -void common_hal_i2cslave_i2c_slave_close(i2cslave_i2c_slave_obj_t *self) { +void common_hal_i2cperipheral_i2c_peripheral_close(i2cperipheral_i2c_peripheral_obj_t *self) { for (int t = 0; !self->sercom->I2CS.INTFLAG.reg && t < 100; t++) { mp_hal_delay_us(10); } @@ -218,7 +218,7 @@ void common_hal_i2cslave_i2c_slave_close(i2cslave_i2c_slave_obj_t *self) { } if (!self->sercom->I2CS.STATUS.bit.DIR) { - common_hal_i2cslave_i2c_slave_ack(self, false); + common_hal_i2cperipheral_i2c_peripheral_ack(self, false); } else { int i = 0; while (self->sercom->I2CS.INTFLAG.reg == SERCOM_I2CS_INTFLAG_DRDY) { @@ -246,7 +246,7 @@ void common_hal_i2cslave_i2c_slave_close(i2cslave_i2c_slave_obj_t *self) { if (self->sercom->I2CS.STATUS.bit.CLKHOLD) { // Unable to release the clock. - // The slave might have to be re-initialized to get unstuck. + // The device might have to be re-initialized to get unstuck. mp_raise_OSError(MP_EIO); } } diff --git a/ports/atmel-samd/common-hal/i2cslave/I2CSlave.h b/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.h similarity index 85% rename from ports/atmel-samd/common-hal/i2cslave/I2CSlave.h rename to ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.h index bf4f877bd4..03ae3a2885 100644 --- a/ports/atmel-samd/common-hal/i2cslave/I2CSlave.h +++ b/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_SLAVE_H -#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_SLAVE_H +#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_PERIPHERAL_H +#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_PERIPHERAL_H #include "common-hal/microcontroller/Pin.h" #include "py/obj.h" @@ -40,6 +40,6 @@ typedef struct { uint8_t scl_pin; uint8_t sda_pin; bool writing; -} i2cslave_i2c_slave_obj_t; +} i2cperipheral_i2c_peripheral_obj_t; -#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_SLAVE_H +#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_PERIPHERAL_H diff --git a/ports/atmel-samd/common-hal/i2cperipheral/__init__.c b/ports/atmel-samd/common-hal/i2cperipheral/__init__.c new file mode 100644 index 0000000000..c67511c536 --- /dev/null +++ b/ports/atmel-samd/common-hal/i2cperipheral/__init__.c @@ -0,0 +1 @@ +// No i2cperipheral module functions. diff --git a/ports/atmel-samd/common-hal/i2cslave/__init__.c b/ports/atmel-samd/common-hal/i2cslave/__init__.c deleted file mode 100644 index f289bbc0e4..0000000000 --- a/ports/atmel-samd/common-hal/i2cslave/__init__.c +++ /dev/null @@ -1 +0,0 @@ -// No i2cslave module functions. diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index c60bb83e7d..23f60f8a7f 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -14,7 +14,7 @@ CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_GNSS = 1 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_ROTARYIO = 0 diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 040022052c..ad23105393 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -22,7 +22,7 @@ CIRCUITPY_DIGITALIO = 1 CIRCUITPY_BUSIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_MICROCONTROLLER = 1 CIRCUITPY_NVM = 0 CIRCUITPY_PULSEIO = 0 diff --git a/ports/litex/mpconfigport.mk b/ports/litex/mpconfigport.mk index 004930ba70..311c87b5d5 100644 --- a/ports/litex/mpconfigport.mk +++ b/ports/litex/mpconfigport.mk @@ -20,7 +20,7 @@ CIRCUITPY_BOARD = 0 CIRCUITPY_BUSIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NVM = 0 CIRCUITPY_PULSEIO = 0 CIRCUITPY_ROTARYIO = 0 diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index 49d9985083..12f34343b9 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -22,7 +22,7 @@ INTERNAL_FLASH_FILESYSTEM = 1 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NVM = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_COUNTIO = 0 diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 715b65e63e..385870a654 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -14,7 +14,7 @@ CIRCUITPY_COUNTIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_PIXELBUF = 0 diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index dda9b24366..ed689545d0 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -25,8 +25,8 @@ CIRCUITPY_AUDIOPWMIO ?= 1 CIRCUITPY_BLEIO ?= 1 -# No I2CSlave implementation -CIRCUITPY_I2CSLAVE = 0 +# No I2CPeripheral implementation +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_RTC ?= 1 diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 7b720d1564..896d78bba7 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -14,7 +14,7 @@ ifeq ($(MCU_SERIES),F4) CIRCUITPY_AUDIOIO ?= 0 CIRCUITPY_COUNTIO ?= 0 CIRCUITPY_FREQUENCYIO ?= 0 - CIRCUITPY_I2CSLAVE ?= 0 + CIRCUITPY_I2CPERIPHERAL ?= 0 CIRCUITPY_NVM ?= 0 CIRCUITPY_ROTARYIO ?= 0 CIRCUITPY_RTC ?= 0 @@ -29,7 +29,7 @@ ifeq ($(MCU_SERIES),H7) CIRCUITPY_AUDIOIO ?= 0 CIRCUITPY_COUNTIO ?= 0 CIRCUITPY_FREQUENCYIO ?= 0 - CIRCUITPY_I2CSLAVE ?= 0 + CIRCUITPY_I2CPERIPHERAL ?= 0 CIRCUITPY_NEOPIXEL_WRITE ?= 0 CIRCUITPY_NVM ?= 0 CIRCUITPY_PULSEIO ?= 0 @@ -46,7 +46,7 @@ ifeq ($(MCU_SERIES),F7) CIRCUITPY_AUDIOIO ?= 0 CIRCUITPY_COUNTIO ?= 0 CIRCUITPY_FREQUENCYIO ?= 0 - CIRCUITPY_I2CSLAVE ?= 0 + CIRCUITPY_I2CPERIPHERAL ?= 0 CIRCUITPY_NEOPIXEL_WRITE ?= 0 CIRCUITPY_NVM ?= 0 CIRCUITPY_ROTARYIO ?= 0 diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 95824be1e8..74d8f548dd 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -165,8 +165,8 @@ endif ifeq ($(CIRCUITPY_GNSS),1) SRC_PATTERNS += gnss/% endif -ifeq ($(CIRCUITPY_I2CSLAVE),1) -SRC_PATTERNS += i2cslave/% +ifeq ($(CIRCUITPY_I2CPERIPHERAL),1) +SRC_PATTERNS += i2cperipheral/% endif ifeq ($(CIRCUITPY_MATH),1) SRC_PATTERNS += math/% @@ -290,8 +290,8 @@ SRC_COMMON_HAL_ALL = \ gnss/GNSS.c \ gnss/PositionFix.c \ gnss/SatelliteSystem.c \ - i2cslave/I2CSlave.c \ - i2cslave/__init__.c \ + i2cperipheral/I2CPeripheral.c \ + i2cperipheral/__init__.c \ microcontroller/Pin.c \ microcontroller/Processor.c \ microcontroller/__init__.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 4b054b83ce..c92cb1b669 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -408,11 +408,11 @@ extern const struct _mp_obj_module_t gnss_module; #define GNSS_MODULE #endif -#if CIRCUITPY_I2CSLAVE -extern const struct _mp_obj_module_t i2cslave_module; -#define I2CSLAVE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_i2cslave), (mp_obj_t)&i2cslave_module }, +#if CIRCUITPY_I2CPERIPHERAL +extern const struct _mp_obj_module_t i2cperipheral_module; +#define I2CPERIPHERAL_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_i2cperipheral), (mp_obj_t)&i2cperipheral_module }, #else -#define I2CSLAVE_MODULE +#define I2CPERIPHERAL_MODULE #endif #if CIRCUITPY_MATH @@ -690,7 +690,7 @@ extern const struct _mp_obj_module_t watchdog_module; GAMEPAD_MODULE \ GAMEPADSHIFT_MODULE \ GNSS_MODULE \ - I2CSLAVE_MODULE \ + I2CPERIPHERAL_MODULE \ JSON_MODULE \ MATH_MODULE \ _EVE_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index ac7d2ec305..3459bff6d7 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -112,8 +112,8 @@ CFLAGS += -DCIRCUITPY_GAMEPADSHIFT=$(CIRCUITPY_GAMEPADSHIFT) CIRCUITPY_GNSS ?= 0 CFLAGS += -DCIRCUITPY_GNSS=$(CIRCUITPY_GNSS) -CIRCUITPY_I2CSLAVE ?= $(CIRCUITPY_FULL_BUILD) -CFLAGS += -DCIRCUITPY_I2CSLAVE=$(CIRCUITPY_I2CSLAVE) +CIRCUITPY_I2CPERIPHERAL ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_I2CPERIPHERAL=$(CIRCUITPY_I2CPERIPHERAL) CIRCUITPY_MATH ?= 1 CFLAGS += -DCIRCUITPY_MATH=$(CIRCUITPY_MATH) diff --git a/shared-bindings/i2cslave/I2CSlave.c b/shared-bindings/i2cperipheral/I2CPeripheral.c similarity index 51% rename from shared-bindings/i2cslave/I2CSlave.c rename to shared-bindings/i2cperipheral/I2CPeripheral.c index 9f051a1253..4a3900174a 100644 --- a/shared-bindings/i2cslave/I2CSlave.c +++ b/shared-bindings/i2cperipheral/I2CPeripheral.c @@ -25,7 +25,7 @@ */ #include "shared-bindings/microcontroller/Pin.h" -#include "shared-bindings/i2cslave/I2CSlave.h" +#include "shared-bindings/i2cperipheral/I2CPeripheral.h" #include "shared-bindings/time/__init__.h" #include "shared-bindings/util.h" @@ -39,22 +39,22 @@ #include "py/objproperty.h" #include "py/runtime.h" -STATIC mp_obj_t mp_obj_new_i2cslave_i2c_slave_request(i2cslave_i2c_slave_obj_t *slave, uint8_t address, bool is_read, bool is_restart) { - i2cslave_i2c_slave_request_obj_t *self = m_new_obj(i2cslave_i2c_slave_request_obj_t); - self->base.type = &i2cslave_i2c_slave_request_type; - self->slave = slave; +STATIC mp_obj_t mp_obj_new_i2cperipheral_i2c_peripheral_request(i2cperipheral_i2c_peripheral_obj_t *peripheral, uint8_t address, bool is_read, bool is_restart) { + i2cperipheral_i2c_peripheral_request_obj_t *self = m_new_obj(i2cperipheral_i2c_peripheral_request_obj_t); + self->base.type = &i2cperipheral_i2c_peripheral_request_type; + self->peripheral = peripheral; self->address = address; self->is_read = is_read; self->is_restart = is_restart; return (mp_obj_t)self; } -//| class I2CSlave: -//| """Two wire serial protocol slave""" +//| class I2CPeripheral: +//| """Two wire serial protocol peripheral""" //| //| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, addresses: tuple, smbus: bool = False): //| """I2C is a two-wire protocol for communicating between devices. -//| This implements the slave side. +//| This implements the peripheral (sensor, secondary) side. //| //| :param ~microcontroller.Pin scl: The clock pin //| :param ~microcontroller.Pin sda: The data pin @@ -62,9 +62,9 @@ STATIC mp_obj_t mp_obj_new_i2cslave_i2c_slave_request(i2cslave_i2c_slave_obj_t * //| :param bool smbus: Use SMBUS timings if the hardware supports it""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - i2cslave_i2c_slave_obj_t *self = m_new_obj(i2cslave_i2c_slave_obj_t); - self->base.type = &i2cslave_i2c_slave_type; +STATIC mp_obj_t i2cperipheral_i2c_peripheral_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + i2cperipheral_i2c_peripheral_obj_t *self = m_new_obj(i2cperipheral_i2c_peripheral_obj_t); + self->base.type = &i2cperipheral_i2c_peripheral_type; enum { ARG_scl, ARG_sda, ARG_addresses, ARG_smbus }; static const mp_arg_t allowed_args[] = { { MP_QSTR_scl, MP_ARG_REQUIRED | MP_ARG_OBJ }, @@ -98,7 +98,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_make_new(const mp_obj_type_t *type, size_t n_ mp_raise_ValueError(translate("addresses is empty")); } - common_hal_i2cslave_i2c_slave_construct(self, scl, sda, addresses, i, args[ARG_smbus].u_bool); + common_hal_i2cperipheral_i2c_peripheral_construct(self, scl, sda, addresses, i, args[ARG_smbus].u_bool); return (mp_obj_t)self; } @@ -106,13 +106,13 @@ STATIC mp_obj_t i2cslave_i2c_slave_make_new(const mp_obj_type_t *type, size_t n_ //| """Releases control of the underlying hardware so other classes can use it.""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_obj_deinit(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_type)); - i2cslave_i2c_slave_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_i2cslave_i2c_slave_deinit(self); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj_deinit(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_type)); + i2cperipheral_i2c_peripheral_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_i2cperipheral_i2c_peripheral_deinit(self); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_1(i2cslave_i2c_slave_deinit_obj, i2cslave_i2c_slave_obj_deinit); +MP_DEFINE_CONST_FUN_OBJ_1(i2cperipheral_i2c_peripheral_deinit_obj, i2cperipheral_i2c_peripheral_obj_deinit); //| def __enter__(self, ) -> Any: //| """No-op used in Context Managers.""" @@ -125,25 +125,25 @@ MP_DEFINE_CONST_FUN_OBJ_1(i2cslave_i2c_slave_deinit_obj, i2cslave_i2c_slave_obj_ //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_obj___exit__(size_t n_args, const mp_obj_t *args) { - mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cslave_i2c_slave_type)); - i2cslave_i2c_slave_obj_t *self = MP_OBJ_TO_PTR(args[0]); - common_hal_i2cslave_i2c_slave_deinit(self); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj___exit__(size_t n_args, const mp_obj_t *args) { + mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cperipheral_i2c_peripheral_type)); + i2cperipheral_i2c_peripheral_obj_t *self = MP_OBJ_TO_PTR(args[0]); + common_hal_i2cperipheral_i2c_peripheral_deinit(self); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cslave_i2c_slave___exit___obj, 4, 4, i2cslave_i2c_slave_obj___exit__); +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral___exit___obj, 4, 4, i2cperipheral_i2c_peripheral_obj___exit__); //| def request(self, timeout: float = -1) -> Any: //| """Wait for an I2C request. //| //| :param float timeout: Timeout in seconds. Zero means wait forever, a negative value means check once //| :return: I2C Slave Request or None if timeout=-1 and there's no request -//| :rtype: ~i2cslave.I2CSlaveRequest""" +//| :rtype: ~i2cperipheral.I2CPeripheralRequest""" //| -STATIC mp_obj_t i2cslave_i2c_slave_request(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - mp_check_self(MP_OBJ_IS_TYPE(pos_args[0], &i2cslave_i2c_slave_type)); - i2cslave_i2c_slave_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); - if(common_hal_i2cslave_i2c_slave_deinited(self)) { +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + mp_check_self(MP_OBJ_IS_TYPE(pos_args[0], &i2cperipheral_i2c_peripheral_type)); + i2cperipheral_i2c_peripheral_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + if(common_hal_i2cperipheral_i2c_peripheral_deinited(self)) { raise_deinited_error(); } enum { ARG_timeout }; @@ -180,7 +180,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_request(size_t n_args, const mp_obj_t *pos_ar return mp_const_none; } - int status = common_hal_i2cslave_i2c_slave_is_addressed(self, &address, &is_read, &is_restart); + int status = common_hal_i2cperipheral_i2c_peripheral_is_addressed(self, &address, &is_read, &is_restart); if (status < 0) { // On error try one more time before bailing out if (last_error) { @@ -198,7 +198,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_request(size_t n_args, const mp_obj_t *pos_ar continue; } - return mp_obj_new_i2cslave_i2c_slave_request(self, address, is_read, is_restart); + return mp_obj_new_i2cperipheral_i2c_peripheral_request(self, address, is_read, is_restart); } while (forever || common_hal_time_monotonic() < timeout_end); if (timeout_ms > 0) { @@ -206,39 +206,39 @@ STATIC mp_obj_t i2cslave_i2c_slave_request(size_t n_args, const mp_obj_t *pos_ar } return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_KW(i2cslave_i2c_slave_request_obj, 1, i2cslave_i2c_slave_request); +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(i2cperipheral_i2c_peripheral_request_obj, 1, i2cperipheral_i2c_peripheral_request); -STATIC const mp_rom_map_elem_t i2cslave_i2c_slave_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&i2cslave_i2c_slave_deinit_obj) }, +STATIC const mp_rom_map_elem_t i2cperipheral_i2c_peripheral_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2cslave_i2c_slave___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_request), MP_ROM_PTR(&i2cslave_i2c_slave_request_obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2cperipheral_i2c_peripheral___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_request), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_obj) }, }; -STATIC MP_DEFINE_CONST_DICT(i2cslave_i2c_slave_locals_dict, i2cslave_i2c_slave_locals_dict_table); +STATIC MP_DEFINE_CONST_DICT(i2cperipheral_i2c_peripheral_locals_dict, i2cperipheral_i2c_peripheral_locals_dict_table); -const mp_obj_type_t i2cslave_i2c_slave_type = { +const mp_obj_type_t i2cperipheral_i2c_peripheral_type = { { &mp_type_type }, - .name = MP_QSTR_I2CSlave, - .make_new = i2cslave_i2c_slave_make_new, - .locals_dict = (mp_obj_dict_t*)&i2cslave_i2c_slave_locals_dict, + .name = MP_QSTR_I2CPeripheral, + .make_new = i2cperipheral_i2c_peripheral_make_new, + .locals_dict = (mp_obj_dict_t*)&i2cperipheral_i2c_peripheral_locals_dict, }; -//| class I2CSlaveRequest: +//| class I2CPeripheralRequest: //| -//| def __init__(self, slave: i2cslave.I2CSlave, address: int, is_read: bool, is_restart: bool): +//| def __init__(self, peripheral: i2cperipheral.I2CPeripheral, address: int, is_read: bool, is_restart: bool): //| """Information about an I2C transfer request -//| This cannot be instantiated directly, but is returned by :py:meth:`I2CSlave.request`. +//| This cannot be instantiated directly, but is returned by :py:meth:`I2CPeripheral.request`. //| -//| :param slave: The I2C Slave receiving this request +//| :param peripheral: The I2CPeripheral object receiving this request //| :param address: I2C address -//| :param is_read: True if the main device is requesting data +//| :param is_read: True if the main peripheral is requesting data //| :param is_restart: Repeated Start Condition""" //| -STATIC mp_obj_t i2cslave_i2c_slave_request_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 4, 4, false); - return mp_obj_new_i2cslave_i2c_slave_request(args[0], mp_obj_get_int(args[1]), mp_obj_is_true(args[2]), mp_obj_is_true(args[3])); + return mp_obj_new_i2cperipheral_i2c_peripheral_request(args[0], mp_obj_get_int(args[1]), mp_obj_is_true(args[2]), mp_obj_is_true(args[3])); } //| def __enter__(self, ) -> Any: @@ -251,56 +251,56 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_make_new(const mp_obj_type_t *type, s //| """Close the request.""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_request_obj___exit__(size_t n_args, const mp_obj_t *args) { - mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); - common_hal_i2cslave_i2c_slave_close(self->slave); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_obj___exit__(size_t n_args, const mp_obj_t *args) { + mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); + common_hal_i2cperipheral_i2c_peripheral_close(self->peripheral); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cslave_i2c_slave_request___exit___obj, 4, 4, i2cslave_i2c_slave_request_obj___exit__); +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral_request___exit___obj, 4, 4, i2cperipheral_i2c_peripheral_request_obj___exit__); //| address: int = ... //| """The I2C address of the request.""" //| -STATIC mp_obj_t i2cslave_i2c_slave_request_get_address(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_address(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); return mp_obj_new_int(self->address); } -MP_DEFINE_CONST_PROP_GET(i2cslave_i2c_slave_request_address_obj, i2cslave_i2c_slave_request_get_address); +MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_address_obj, i2cperipheral_i2c_peripheral_request_get_address); //| is_read: bool = ... -//| """The I2C main controller is reading from this device.""" +//| """The I2C main controller is reading from this peripheral.""" //| -STATIC mp_obj_t i2cslave_i2c_slave_request_get_is_read(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_is_read(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); return mp_obj_new_bool(self->is_read); } -MP_DEFINE_CONST_PROP_GET(i2cslave_i2c_slave_request_is_read_obj, i2cslave_i2c_slave_request_get_is_read); +MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_is_read_obj, i2cperipheral_i2c_peripheral_request_get_is_read); //| is_restart: bool = ... //| """Is Repeated Start Condition.""" //| -STATIC mp_obj_t i2cslave_i2c_slave_request_get_is_restart(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_is_restart(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); return mp_obj_new_bool(self->is_restart); } -MP_DEFINE_CONST_PROP_GET(i2cslave_i2c_slave_request_is_restart_obj, i2cslave_i2c_slave_request_get_is_restart); +MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_is_restart_obj, i2cperipheral_i2c_peripheral_request_get_is_restart); //| def read(self, n: int = -1, ack: bool = True) -> bytearray: //| """Read data. -//| If ack=False, the caller is responsible for calling :py:meth:`I2CSlaveRequest.ack`. +//| If ack=False, the caller is responsible for calling :py:meth:`I2CPeripheralRequest.ack`. //| //| :param n: Number of bytes to read (negative means all) //| :param ack: Whether or not to send an ACK after the n'th byte //| :return: Bytes read""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_request_read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - mp_check_self(MP_OBJ_IS_TYPE(pos_args[0], &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + mp_check_self(MP_OBJ_IS_TYPE(pos_args[0], &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); enum { ARG_n, ARG_ack }; static const mp_arg_t allowed_args[] = { { MP_QSTR_n, MP_ARG_INT, {.u_int = -1} }, @@ -329,7 +329,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_read(size_t n_args, const mp_obj_t *p } uint8_t data; - int num = common_hal_i2cslave_i2c_slave_read_byte(self->slave, &data); + int num = common_hal_i2cperipheral_i2c_peripheral_read_byte(self->peripheral, &data); if (num == 0) { break; } @@ -338,16 +338,16 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_read(size_t n_args, const mp_obj_t *p buffer[i++] = data; if (i == n) { if (ack) { - common_hal_i2cslave_i2c_slave_ack(self->slave, true); + common_hal_i2cperipheral_i2c_peripheral_ack(self->peripheral, true); } break; } - common_hal_i2cslave_i2c_slave_ack(self->slave, true); + common_hal_i2cperipheral_i2c_peripheral_ack(self->peripheral, true); } return mp_obj_new_bytearray(i, buffer); } -MP_DEFINE_CONST_FUN_OBJ_KW(i2cslave_i2c_slave_request_read_obj, 1, i2cslave_i2c_slave_request_read); +MP_DEFINE_CONST_FUN_OBJ_KW(i2cperipheral_i2c_peripheral_request_read_obj, 1, i2cperipheral_i2c_peripheral_request_read); //| def write(self, buffer: bytearray) -> int: //| """Write the data contained in buffer. @@ -356,9 +356,9 @@ MP_DEFINE_CONST_FUN_OBJ_KW(i2cslave_i2c_slave_request_read_obj, 1, i2cslave_i2c_ //| :return: Number of bytes written""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_request_write(mp_obj_t self_in, mp_obj_t buf_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_write(mp_obj_t self_in, mp_obj_t buf_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); if (!self->is_read) { mp_raise_OSError(MP_EACCES); @@ -373,7 +373,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_write(mp_obj_t self_in, mp_obj_t buf_ break; } - int num = common_hal_i2cslave_i2c_slave_write_byte(self->slave, ((uint8_t *)(bufinfo.buf))[i]); + int num = common_hal_i2cperipheral_i2c_peripheral_write_byte(self->peripheral, ((uint8_t *)(bufinfo.buf))[i]); if (num == 0) { return mp_obj_new_int(i); } @@ -381,55 +381,55 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_write(mp_obj_t self_in, mp_obj_t buf_ return mp_obj_new_int(bufinfo.len); } -STATIC MP_DEFINE_CONST_FUN_OBJ_2(i2cslave_i2c_slave_request_write_obj, i2cslave_i2c_slave_request_write); +STATIC MP_DEFINE_CONST_FUN_OBJ_2(i2cperipheral_i2c_peripheral_request_write_obj, i2cperipheral_i2c_peripheral_request_write); //| def ack(self, ack: bool = True) -> Any: //| """Acknowledge or Not Acknowledge last byte received. -//| Use together with :py:meth:`I2CSlaveRequest.read` ack=False. +//| Use together with :py:meth:`I2CPeripheralRequest.read` ack=False. //| //| :param ack: Whether to send an ACK or NACK""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_request_ack(uint n_args, const mp_obj_t *args) { - mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_ack(uint n_args, const mp_obj_t *args) { + mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); bool ack = (n_args == 1) ? true : mp_obj_is_true(args[1]); if (self->is_read) { mp_raise_OSError(MP_EACCES); } - common_hal_i2cslave_i2c_slave_ack(self->slave, ack); + common_hal_i2cperipheral_i2c_peripheral_ack(self->peripheral, ack); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cslave_i2c_slave_request_ack_obj, 1, 2, i2cslave_i2c_slave_request_ack); +MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral_request_ack_obj, 1, 2, i2cperipheral_i2c_peripheral_request_ack); -STATIC mp_obj_t i2cslave_i2c_slave_request_close(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_close(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_i2cslave_i2c_slave_close(self->slave); + common_hal_i2cperipheral_i2c_peripheral_close(self->peripheral); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(i2cslave_i2c_slave_request_close_obj, i2cslave_i2c_slave_request_close); +STATIC MP_DEFINE_CONST_FUN_OBJ_1(i2cperipheral_i2c_peripheral_request_close_obj, i2cperipheral_i2c_peripheral_request_close); -STATIC const mp_rom_map_elem_t i2cslave_i2c_slave_request_locals_dict_table[] = { +STATIC const mp_rom_map_elem_t i2cperipheral_i2c_peripheral_request_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2cslave_i2c_slave_request___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_address), MP_ROM_PTR(&i2cslave_i2c_slave_request_address_obj) }, - { MP_ROM_QSTR(MP_QSTR_is_read), MP_ROM_PTR(&i2cslave_i2c_slave_request_is_read_obj) }, - { MP_ROM_QSTR(MP_QSTR_is_restart), MP_ROM_PTR(&i2cslave_i2c_slave_request_is_restart_obj) }, - { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&i2cslave_i2c_slave_request_read_obj) }, - { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&i2cslave_i2c_slave_request_write_obj) }, - { MP_ROM_QSTR(MP_QSTR_ack), MP_ROM_PTR(&i2cslave_i2c_slave_request_ack_obj) }, - { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&i2cslave_i2c_slave_request_close_obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_address), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_address_obj) }, + { MP_ROM_QSTR(MP_QSTR_is_read), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_is_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_is_restart), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_is_restart_obj) }, + { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_write_obj) }, + { MP_ROM_QSTR(MP_QSTR_ack), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_ack_obj) }, + { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_close_obj) }, }; -STATIC MP_DEFINE_CONST_DICT(i2cslave_i2c_slave_request_locals_dict, i2cslave_i2c_slave_request_locals_dict_table); +STATIC MP_DEFINE_CONST_DICT(i2cperipheral_i2c_peripheral_request_locals_dict, i2cperipheral_i2c_peripheral_request_locals_dict_table); -const mp_obj_type_t i2cslave_i2c_slave_request_type = { +const mp_obj_type_t i2cperipheral_i2c_peripheral_request_type = { { &mp_type_type }, - .name = MP_QSTR_I2CSlaveRequest, - .make_new = i2cslave_i2c_slave_request_make_new, - .locals_dict = (mp_obj_dict_t*)&i2cslave_i2c_slave_request_locals_dict, + .name = MP_QSTR_I2CPeripheralRequest, + .make_new = i2cperipheral_i2c_peripheral_request_make_new, + .locals_dict = (mp_obj_dict_t*)&i2cperipheral_i2c_peripheral_request_locals_dict, }; diff --git a/shared-bindings/i2cslave/I2CSlave.h b/shared-bindings/i2cperipheral/I2CPeripheral.h similarity index 60% rename from shared-bindings/i2cslave/I2CSlave.h rename to shared-bindings/i2cperipheral/I2CPeripheral.h index abb7614168..3035cfbfe7 100644 --- a/shared-bindings/i2cslave/I2CSlave.h +++ b/shared-bindings/i2cperipheral/I2CPeripheral.h @@ -30,31 +30,31 @@ #include "py/obj.h" #include "common-hal/microcontroller/Pin.h" -#include "common-hal/i2cslave/I2CSlave.h" +#include "common-hal/i2cperipheral/I2CPeripheral.h" typedef struct { mp_obj_base_t base; - i2cslave_i2c_slave_obj_t *slave; + i2cperipheral_i2c_peripheral_obj_t *peripheral; uint16_t address; bool is_read; bool is_restart; -} i2cslave_i2c_slave_request_obj_t; +} i2cperipheral_i2c_peripheral_request_obj_t; -extern const mp_obj_type_t i2cslave_i2c_slave_request_type; +extern const mp_obj_type_t i2cperipheral_i2c_peripheral_request_type; -extern const mp_obj_type_t i2cslave_i2c_slave_type; +extern const mp_obj_type_t i2cperipheral_i2c_peripheral_type; -extern void common_hal_i2cslave_i2c_slave_construct(i2cslave_i2c_slave_obj_t *self, +extern void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_peripheral_obj_t *self, const mcu_pin_obj_t* scl, const mcu_pin_obj_t* sda, uint8_t *addresses, unsigned int num_addresses, bool smbus); -extern void common_hal_i2cslave_i2c_slave_deinit(i2cslave_i2c_slave_obj_t *self); -extern bool common_hal_i2cslave_i2c_slave_deinited(i2cslave_i2c_slave_obj_t *self); +extern void common_hal_i2cperipheral_i2c_peripheral_deinit(i2cperipheral_i2c_peripheral_obj_t *self); +extern bool common_hal_i2cperipheral_i2c_peripheral_deinited(i2cperipheral_i2c_peripheral_obj_t *self); -extern int common_hal_i2cslave_i2c_slave_is_addressed(i2cslave_i2c_slave_obj_t *self, +extern int common_hal_i2cperipheral_i2c_peripheral_is_addressed(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *address, bool *is_read, bool *is_restart); -extern int common_hal_i2cslave_i2c_slave_read_byte(i2cslave_i2c_slave_obj_t *self, uint8_t *data); -extern int common_hal_i2cslave_i2c_slave_write_byte(i2cslave_i2c_slave_obj_t *self, uint8_t data); -extern void common_hal_i2cslave_i2c_slave_ack(i2cslave_i2c_slave_obj_t *self, bool ack); -extern void common_hal_i2cslave_i2c_slave_close(i2cslave_i2c_slave_obj_t *self); +extern int common_hal_i2cperipheral_i2c_peripheral_read_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *data); +extern int common_hal_i2cperipheral_i2c_peripheral_write_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t data); +extern void common_hal_i2cperipheral_i2c_peripheral_ack(i2cperipheral_i2c_peripheral_obj_t *self, bool ack); +extern void common_hal_i2cperipheral_i2c_peripheral_close(i2cperipheral_i2c_peripheral_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_I2C_SLAVE_H diff --git a/shared-bindings/i2cslave/__init__.c b/shared-bindings/i2cperipheral/__init__.c similarity index 71% rename from shared-bindings/i2cslave/__init__.c rename to shared-bindings/i2cperipheral/__init__.c index 59674d5cb4..e2cb8509d6 100644 --- a/shared-bindings/i2cslave/__init__.c +++ b/shared-bindings/i2cperipheral/__init__.c @@ -30,26 +30,26 @@ #include "py/runtime.h" #include "shared-bindings/microcontroller/Pin.h" -//#include "shared-bindings/i2cslave/__init__.h" -#include "shared-bindings/i2cslave/I2CSlave.h" +//#include "shared-bindings/i2cperipheral/__init__.h" +#include "shared-bindings/i2cperipheral/I2CPeripheral.h" #include "py/runtime.h" -//| """Two wire serial protocol slave +//| """Two wire serial protocol peripheral //| -//| The `i2cslave` module contains classes to support a I2C slave. +//| The `i2cperipheral` module contains classes to support an I2C peripheral. //| -//| Example emulating 2 devices:: +//| Example emulating a peripheral with 2 addresses (read and write):: //| //| import board -//| from i2cslave import I2CSlave +//| from i2cperipheral import I2CPeripheral //| //| regs = [0] * 16 //| index = 0 //| -//| with I2CSlave(board.SCL, board.SDA, (0x40, 0x41)) as slave: +//| with I2CPeripheral(board.SCL, board.SDA, (0x40, 0x41)) as device: //| while True: -//| r = slave.request() +//| r = device.request() //| if not r: //| # Maybe do some housekeeping //| continue @@ -67,7 +67,7 @@ //| n = r.write(bytes([regs[index]])) //| #else: //| # A read transfer is not supported in this example -//| # If the Master tries, it will get 0xff byte(s) by the ctx manager (r.close()) +//| # If the microcontroller tries, it will get 0xff byte(s) by the ctx manager (r.close()) //| elif r.address == 0x41: //| if not r.is_read: //| b = r.read(1) @@ -75,7 +75,7 @@ //| # do something //| pass //| -//| This example sets up an I2C slave that can be accessed from Linux like this:: +//| This example sets up an I2C device that can be accessed from Linux like this:: //| //| $ i2cget -y 1 0x40 0x01 //| 0x00 @@ -84,22 +84,23 @@ //| 0xaa //| //| .. warning:: -//| I2CSlave makes use of clock stretching in order to slow down the master. -//| Make sure the I2C master supports this. +//| I2CPeripheral makes use of clock stretching in order to slow down +//| the host. +//| Make sure the I2C host supports this. //| //| Raspberry Pi in particular does not support this with its I2C hw block. //| This can be worked around by using the ``i2c-gpio`` bit banging driver. //| Since the RPi firmware uses the hw i2c, it's not possible to emulate a HAT eeprom.""" //| -STATIC const mp_rom_map_elem_t i2cslave_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_i2cslave) }, - { MP_ROM_QSTR(MP_QSTR_I2CSlave), MP_ROM_PTR(&i2cslave_i2c_slave_type) }, +STATIC const mp_rom_map_elem_t i2cperipheral_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_i2cperipheral) }, + { MP_ROM_QSTR(MP_QSTR_I2CPeripheral), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_type) }, }; -STATIC MP_DEFINE_CONST_DICT(i2cslave_module_globals, i2cslave_module_globals_table); +STATIC MP_DEFINE_CONST_DICT(i2cperipheral_module_globals, i2cperipheral_module_globals_table); -const mp_obj_module_t i2cslave_module = { +const mp_obj_module_t i2cperipheral_module = { .base = { &mp_type_module }, - .globals = (mp_obj_dict_t*)&i2cslave_module_globals, + .globals = (mp_obj_dict_t*)&i2cperipheral_module_globals, }; From 3c11f6cc05d1e53985591fec3d0297444eeee151 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 14:43:02 -0500 Subject: [PATCH 0089/1293] tests: Remove a test for micropython-specific SPI behavior --- tests/pyb/spi.py | 33 --------------------------------- tests/pyb/spi.py.exp | 14 -------------- 2 files changed, 47 deletions(-) delete mode 100644 tests/pyb/spi.py delete mode 100644 tests/pyb/spi.py.exp diff --git a/tests/pyb/spi.py b/tests/pyb/spi.py deleted file mode 100644 index 88cc975bb6..0000000000 --- a/tests/pyb/spi.py +++ /dev/null @@ -1,33 +0,0 @@ -from pyb import SPI - -# test we can correctly create by id or name -for bus in (-1, 0, 1, 2, 3, "X", "Y", "Z"): - try: - SPI(bus) - print("SPI", bus) - except ValueError: - print("ValueError", bus) - -spi = SPI(1) -print(spi) - -spi = SPI(1, SPI.MASTER) -spi = SPI(1, SPI.MASTER, baudrate=500000) -spi = SPI(1, SPI.MASTER, 500000, polarity=1, phase=0, bits=8, firstbit=SPI.MSB, ti=False, crc=None) -print(spi) - -spi.init(SPI.SLAVE, phase=1) -print(spi) -try: - # need to flush input before we get an error (error is what we want to test) - for i in range(10): - spi.recv(1, timeout=100) -except OSError: - print("OSError") - -spi.init(SPI.MASTER) -spi.send(1, timeout=100) -print(spi.recv(1, timeout=100)) -print(spi.send_recv(1, timeout=100)) - -spi.deinit() diff --git a/tests/pyb/spi.py.exp b/tests/pyb/spi.py.exp deleted file mode 100644 index a0d835700f..0000000000 --- a/tests/pyb/spi.py.exp +++ /dev/null @@ -1,14 +0,0 @@ -ValueError -1 -ValueError 0 -SPI 1 -SPI 2 -ValueError 3 -SPI X -SPI Y -ValueError Z -SPI(1) -SPI(1, SPI.MASTER, baudrate=328125, prescaler=256, polarity=1, phase=0, bits=8) -SPI(1, SPI.SLAVE, polarity=1, phase=1, bits=8) -OSError -b'\xff' -b'\xff' From d82292fa1f902f014f763948996cf31a617d0a8e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 16:58:08 -0500 Subject: [PATCH 0090/1293] README: Remove a statement that's not particularly true at the moment --- README.rst | 1 - tests/pyb/halerror.py | 15 ---- tests/pyb/i2c.py | 32 -------- tests/pyb/i2c.py.exp | 12 --- tests/pyb/i2c_error.py | 50 ------------ tests/wipy/i2c.py | 175 ----------------------------------------- tests/wipy/i2c.py.exp | 51 ------------ tests/wipy/spi.py | 147 ---------------------------------- tests/wipy/spi.py.exp | 35 --------- 9 files changed, 518 deletions(-) delete mode 100644 tests/pyb/halerror.py delete mode 100644 tests/pyb/i2c.py delete mode 100644 tests/pyb/i2c.py.exp delete mode 100644 tests/pyb/i2c_error.py delete mode 100644 tests/wipy/i2c.py delete mode 100644 tests/wipy/i2c.py.exp delete mode 100644 tests/wipy/spi.py delete mode 100644 tests/wipy/spi.py.exp diff --git a/README.rst b/README.rst index d09dcda456..15e0c96783 100644 --- a/README.rst +++ b/README.rst @@ -96,7 +96,6 @@ CircuitPython: - Supports native USB on all boards, allowing file editing without special tools. - Supports only SAMD21, SAMD51, nRF52840, CXD56, STM32F4 and i.MX RT ports. -- Tracks MicroPython's releases (not master). - Floats (aka decimals) are enabled for all builds. - Error messages are translated into 10+ languages. - Does not support concurrency within Python (including interrupts and threading). Some concurrency diff --git a/tests/pyb/halerror.py b/tests/pyb/halerror.py deleted file mode 100644 index 1a6bce1a7e..0000000000 --- a/tests/pyb/halerror.py +++ /dev/null @@ -1,15 +0,0 @@ -# test hal errors - -import pyb - -i2c = pyb.I2C(2, pyb.I2C.MASTER) -try: - i2c.recv(1, 1) -except OSError as e: - print(repr(e)) - -can = pyb.CAN(1, pyb.CAN.NORMAL) -try: - can.send('1', 1, timeout=50) -except OSError as e: - print(repr(e)) diff --git a/tests/pyb/i2c.py b/tests/pyb/i2c.py deleted file mode 100644 index 6875e5a5aa..0000000000 --- a/tests/pyb/i2c.py +++ /dev/null @@ -1,32 +0,0 @@ -import pyb -from pyb import I2C - -# test we can correctly create by id or name -for bus in (-1, 0, 1, 2, 3, "X", "Y", "Z"): - try: - I2C(bus) - print("I2C", bus) - except ValueError: - print("ValueError", bus) - -i2c = I2C(1) - -i2c.init(I2C.MASTER, baudrate=400000) -print(i2c.scan()) -i2c.deinit() - -# use accelerometer to test i2c bus - -accel_addr = 76 - -pyb.Accel() # this will init the MMA for us -i2c.init(I2C.MASTER, baudrate=400000) - -print(i2c.scan()) -print(i2c.is_ready(accel_addr)) - -print(i2c.mem_read(1, accel_addr, 7, timeout=500)) -i2c.mem_write(0, accel_addr, 0, timeout=500) - -i2c.send(7, addr=accel_addr) -i2c.recv(1, addr=accel_addr) diff --git a/tests/pyb/i2c.py.exp b/tests/pyb/i2c.py.exp deleted file mode 100644 index 709fb412de..0000000000 --- a/tests/pyb/i2c.py.exp +++ /dev/null @@ -1,12 +0,0 @@ -ValueError -1 -ValueError 0 -I2C 1 -I2C 2 -ValueError 3 -I2C X -I2C Y -ValueError Z -[] -[76] -True -b'\x01' diff --git a/tests/pyb/i2c_error.py b/tests/pyb/i2c_error.py deleted file mode 100644 index 3201d6367d..0000000000 --- a/tests/pyb/i2c_error.py +++ /dev/null @@ -1,50 +0,0 @@ -# test I2C errors, with polling (disabled irqs) and DMA - -import pyb -from pyb import I2C - -# init accelerometer -pyb.Accel() - -# get I2C bus -i2c = I2C(1, I2C.MASTER, dma=True) - -# test polling mem_read -pyb.disable_irq() -i2c.mem_read(1, 76, 0x0a) # should succeed -pyb.enable_irq() -try: - pyb.disable_irq() - i2c.mem_read(1, 77, 0x0a) # should fail -except OSError as e: - pyb.enable_irq() - print(repr(e)) -i2c.mem_read(1, 76, 0x0a) # should succeed - -# test polling mem_write -pyb.disable_irq() -i2c.mem_write(1, 76, 0x0a) # should succeed -pyb.enable_irq() -try: - pyb.disable_irq() - i2c.mem_write(1, 77, 0x0a) # should fail -except OSError as e: - pyb.enable_irq() - print(repr(e)) -i2c.mem_write(1, 76, 0x0a) # should succeed - -# test DMA mem_read -i2c.mem_read(1, 76, 0x0a) # should succeed -try: - i2c.mem_read(1, 77, 0x0a) # should fail -except OSError as e: - print(repr(e)) -i2c.mem_read(1, 76, 0x0a) # should succeed - -# test DMA mem_write -i2c.mem_write(1, 76, 0x0a) # should succeed -try: - i2c.mem_write(1, 77, 0x0a) # should fail -except OSError as e: - print(repr(e)) -i2c.mem_write(1, 76, 0x0a) # should succeed diff --git a/tests/wipy/i2c.py b/tests/wipy/i2c.py deleted file mode 100644 index 39dcdc722b..0000000000 --- a/tests/wipy/i2c.py +++ /dev/null @@ -1,175 +0,0 @@ -''' -I2C test for the CC3200 based boards. -A MPU-9150 sensor must be connected to the I2C bus. -''' - -from machine import I2C -import os -import time - -mch = os.uname().machine -if 'LaunchPad' in mch: - i2c_pins = ('GP11', 'GP10') -elif 'WiPy' in mch: - i2c_pins = ('GP15', 'GP10') -else: - raise Exception('Board not supported!') - -i2c = I2C(0, I2C.MASTER, baudrate=400000) -# try initing without the peripheral id -i2c = I2C() -print(i2c) -i2c = I2C(mode=I2C.MASTER, baudrate=50000, pins=i2c_pins) -print(i2c) - -i2c = I2C(0, I2C.MASTER, baudrate=100000) -print(i2c) -i2c = I2C(0, mode=I2C.MASTER, baudrate=400000) -print(i2c) -i2c = I2C(0, mode=I2C.MASTER, baudrate=400000, pins=i2c_pins) -print(i2c) - -addr = i2c.scan()[0] -print(addr) - -reg = bytearray(1) -reg2 = bytearray(2) -reg2_r = bytearray(2) - -# reset the sensor -reg[0] |= 0x80 -print(1 == i2c.writeto_mem(addr, 107, reg)) -time.sleep_ms(100) # wait for the sensor to reset... - -print(1 == i2c.readfrom_mem_into(addr, 107, reg)) # read the power management register 1 -print(0x40 == reg[0]) - -# now just read one byte -data = i2c.readfrom_mem(addr, 117, 1) # read the "who am I?" register -print(0x68 == data[0]) -print(len(data) == 1) -print(1 == i2c.readfrom_mem_into(addr, 117, reg)) # read the "who am I?" register again -print(0x68 == reg[0]) - -# now try reading two bytes -data = i2c.readfrom_mem(addr, 116, 2) # read the "who am I?" register -print(0x68 == data[1]) -print(data == b'\x00\x68') -print(len(data) == 2) -print(2 == i2c.readfrom_mem_into(addr, 116, reg2)) # read the "who am I?" register again -print(0x68 == reg2[1]) -print(reg2 == b'\x00\x68') - -print(1 == i2c.readfrom_mem_into(addr, 107, reg)) # read the power management register 1 -print(0x40 == reg[0]) -# clear the sleep bit -reg[0] = 0 -print(1 == i2c.writeto_mem(addr, 107, reg)) -# read it back -i2c.readfrom_mem_into(addr, 107, reg) -print(0 == reg[0]) - -# set the sleep bit -reg[0] = 0x40 -print(1 == i2c.writeto_mem(addr, 107, reg)) -# read it back -i2c.readfrom_mem_into(addr, 107, reg) -print(0x40 == reg[0]) - -# reset the sensor -reg[0] |= 0x80 -print(1 == i2c.writeto_mem(addr, 107, reg)) -time.sleep_ms(100) # wait for the sensor to reset... - -# now read and write two register at a time -print(2 == i2c.readfrom_mem_into(addr, 107, reg2)) -print(0x40 == reg2[0]) -print(0x00 == reg2[1]) -# clear the sleep bit -reg2[0] = 0 -# set some other bits -reg2[1] |= 0x03 -print(2 == i2c.writeto_mem(addr, 107, reg2)) -# read it back -i2c.readfrom_mem_into(addr, 107, reg2_r) -print(reg2 == reg2_r) - -# reset the sensor -reg[0] = 0x80 -print(1 == i2c.writeto_mem(addr, 107, reg)) -time.sleep_ms(100) # wait for the sensor to reset... - -# try some raw read and writes -reg[0] = 117 # register address -print(1 == i2c.writeto(addr, reg, stop=False)) # just write the register address -# now read -print(1 == i2c.readfrom_into(addr, reg)) -print(reg[0] == 0x68) -reg[0] = 117 # register address -print(1 == i2c.writeto(addr, reg, stop=False)) # just write the register address -# now read -print(0x68 == i2c.readfrom(addr, 1)[0]) - -i2c.readfrom_mem_into(addr, 107, reg2) -print(0x40 == reg2[0]) -print(0x00 == reg2[1]) - -reg2[0] = 107 # register address -reg2[1] = 0 -print(2 == i2c.writeto(addr, reg2, stop=True)) # write the register address and the data -i2c.readfrom_mem_into(addr, 107, reg) # check it back -print(reg[0] == 0) - -# check for memory leaks... -for i in range (0, 1000): - i2c = I2C(0, I2C.MASTER, baudrate=100000) - -# test deinit -i2c = I2C(0, I2C.MASTER, baudrate=100000) -i2c.deinit() -print(i2c) - -# next ones should raise -try: - i2c.scan() -except Exception: - print("Exception") - -try: - i2c.readfrom(addr, 1) -except Exception: - print("Exception") - -try: - i2c.readfrom_into(addr, reg) -except Exception: - print("Exception") - -try: - i2c.readfrom_mem_into(addr, 107, reg) -except Exception: - print("Exception") - -try: - i2c.writeto(addr, reg, stop=False) -except Exception: - print("Exception") - -try: - i2c.writeto_mem(addr, 107, reg) -except Exception: - print("Exception") - -try: - i2c.readfrom_mem(addr, 116, 2) -except Exception: - print("Exception") - -try: - I2C(1, I2C.MASTER, baudrate=100000) -except Exception: - print("Exception") - -# reinitialization must work -i2c.init(baudrate=400000) -print(i2c) diff --git a/tests/wipy/i2c.py.exp b/tests/wipy/i2c.py.exp deleted file mode 100644 index 083da9be7d..0000000000 --- a/tests/wipy/i2c.py.exp +++ /dev/null @@ -1,51 +0,0 @@ -I2C(0, I2C.MASTER, baudrate=100000) -I2C(0, I2C.MASTER, baudrate=50000) -I2C(0, I2C.MASTER, baudrate=100000) -I2C(0, I2C.MASTER, baudrate=400000) -I2C(0, I2C.MASTER, baudrate=400000) -104 -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -I2C(0) -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -I2C(0, I2C.MASTER, baudrate=400000) diff --git a/tests/wipy/spi.py b/tests/wipy/spi.py deleted file mode 100644 index 6bd7aabce1..0000000000 --- a/tests/wipy/spi.py +++ /dev/null @@ -1,147 +0,0 @@ -''' -SPI test for the CC3200 based boards. -''' - -from machine import SPI -import os - -mch = os.uname().machine -if 'LaunchPad' in mch: - spi_pins = ('GP14', 'GP16', 'GP30') -elif 'WiPy' in mch: - spi_pins = ('GP14', 'GP16', 'GP30') -else: - raise Exception('Board not supported!') - -spi = SPI(0, SPI.MASTER, baudrate=2000000, polarity=0, phase=0, firstbit=SPI.MSB, pins=spi_pins) -print(spi) -spi = SPI(baudrate=5000000) -print(spi) -spi = SPI(0, SPI.MASTER, baudrate=200000, bits=16, polarity=0, phase=0) -print(spi) -spi = SPI(0, SPI.MASTER, baudrate=10000000, polarity=0, phase=1) -print(spi) -spi = SPI(0, SPI.MASTER, baudrate=5000000, bits=32, polarity=1, phase=0) -print(spi) -spi = SPI(0, SPI.MASTER, baudrate=10000000, polarity=1, phase=1) -print(spi) -spi.init(baudrate=20000000, polarity=0, phase=0) -print(spi) -spi=SPI() -print(spi) -SPI(mode=SPI.MASTER) -SPI(mode=SPI.MASTER, pins=spi_pins) -SPI(id=0, mode=SPI.MASTER, polarity=0, phase=0, pins=('GP14', 'GP16', 'GP15')) -SPI(0, SPI.MASTER, polarity=0, phase=0, pins=('GP31', 'GP16', 'GP15')) - -spi = SPI(0, SPI.MASTER, baudrate=10000000, polarity=0, phase=0, pins=spi_pins) -print(spi.write('123456') == 6) -buffer_r = bytearray(10) -print(spi.readinto(buffer_r) == 10) -print(spi.readinto(buffer_r, write=0x55) == 10) -read = spi.read(10) -print(len(read) == 10) -read = spi.read(10, write=0xFF) -print(len(read) == 10) -buffer_w = bytearray([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) -print(spi.write_readinto(buffer_w, buffer_r) == 10) -print(buffer_w == buffer_r) - -# test all polaritiy and phase combinations -spi.init(polarity=1, phase=0, pins=None) -buffer_r = bytearray(10) -spi.write_readinto(buffer_w, buffer_r) -print(buffer_w == buffer_r) - -spi.init(polarity=1, phase=1, pins=None) -buffer_r = bytearray(10) -spi.write_readinto(buffer_w, buffer_r) -print(buffer_w == buffer_r) - -spi.init(polarity=0, phase=1, pins=None) -buffer_r = bytearray(10) -spi.write_readinto(buffer_w, buffer_r) -print(buffer_w == buffer_r) - -# test 16 and 32 bit transfers -buffer_w = bytearray([1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2]) -buffer_r = bytearray(12) -spi.init(SPI.MASTER, baudrate=10000000, bits=16, polarity=0, phase=0, pins=None) -print(spi.write_readinto(buffer_w, buffer_r) == 12) -print(buffer_w == buffer_r) - -buffer_r = bytearray(12) -spi.init(SPI.MASTER, baudrate=10000000, bits=32, polarity=0, phase=0, pins=None) -print(spi.write_readinto(buffer_w, buffer_r) == 12) -print(buffer_w == buffer_r) - -# check for memory leaks... -for i in range (0, 1000): - spi = SPI(0, SPI.MASTER, baudrate=1000000) - -# test deinit -spi = SPI(0, SPI.MASTER, baudrate=1000000) -spi.deinit() -print(spi) - -spi = SPI(0, SPI.MASTER, baudrate=1000000) -# next ones must fail -try: - spi = SPI(0, 10, baudrate=10000000, polarity=0, phase=0) -except: - print("Exception") - -try: - spi = SPI(0, mode=SPI.MASTER, baudrate=10000000, polarity=1, phase=2) -except: - print("Exception") - -try: - spi = SPI(1, mode=SPI.MASTER, baudrate=10000000, polarity=1, phase=1) -except: - print("Exception") - -try: - spi = SPI(0, mode=SPI.MASTER, baudrate=2000000, polarity=2, phase=0) -except: - print("Exception") - -try: - spi = SPI(0, mode=SPI.MASTER, baudrate=2000000, polarity=2, phase=0, firstbit=2) -except: - print("Exception") - -try: - spi = SPI(0, mode=SPI.MASTER, baudrate=2000000, polarity=2, phase=0, pins=('GP1', 'GP2')) -except: - print("Exception") - -try: - spi = SPI(0, mode=SPI.MASTER, baudrate=2000000, polarity=0, phase=0, bits=9) -except: - print("Exception") - -spi.deinit() -try: - spi.read(15) -except Exception: - print("Exception") - -try: - spi.spi.readinto(buffer_r) -except Exception: - print("Exception") - -try: - spi.spi.write('abc') -except Exception: - print("Exception") - -try: - spi.write_readinto(buffer_w, buffer_r) -except Exception: - print("Exception") - -# reinitialization must work -spi.init(baudrate=500000) -print(spi) diff --git a/tests/wipy/spi.py.exp b/tests/wipy/spi.py.exp deleted file mode 100644 index cc4ff40228..0000000000 --- a/tests/wipy/spi.py.exp +++ /dev/null @@ -1,35 +0,0 @@ -SPI(0, SPI.MASTER, baudrate=2000000, bits=8, polarity=0, phase=0, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=5000000, bits=8, polarity=0, phase=0, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=200000, bits=16, polarity=0, phase=0, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=10000000, bits=8, polarity=0, phase=1, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=5000000, bits=32, polarity=1, phase=0, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=10000000, bits=8, polarity=1, phase=1, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=20000000, bits=8, polarity=0, phase=0, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=1000000, bits=8, polarity=0, phase=0, firstbit=SPI.MSB) -True -True -True -True -True -True -True -True -True -True -True -True -True -True -SPI(0) -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -SPI(0, SPI.MASTER, baudrate=500000, bits=8, polarity=0, phase=0, firstbit=SPI.MSB) From 4f8b37042d3575ace22067dba09694adf8fb80c0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 16:58:22 -0500 Subject: [PATCH 0091/1293] README: point at status badge for github actions, and right branch --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 15e0c96783..347b8b8c6b 100644 --- a/README.rst +++ b/README.rst @@ -210,8 +210,8 @@ The remaining port directories not listed above are in the repo to maintain comp `back to top <#circuitpython>`__ -.. |Build Status| image:: https://travis-ci.com/adafruit/circuitpython.svg?branch=master - :target: https://travis-ci.org/adafruit/circuitpython +.. |Build Status| image:: https://github.com/adafruit/circuitpython/workflows/Build%20CI/badge.svg + :target: https://github.com/adafruit/circuitpython/actions?query=branch%3Amain .. |Doc Status| image:: https://readthedocs.org/projects/circuitpython/badge/?version=latest :target: http://circuitpython.readthedocs.io/ .. |Discord| image:: https://img.shields.io/discord/327254708534116352.svg From 103ad9966a1c871fe06f2222bd0226bbd81fffba Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 17:00:35 -0500 Subject: [PATCH 0092/1293] remove machine_i2c, machine_spi This micropython code is not used in circuitpython --- extmod/machine_i2c.c | 641 ------------------------------------------- extmod/machine_i2c.h | 58 ---- extmod/machine_spi.c | 286 ------------------- extmod/machine_spi.h | 58 ---- ports/unix/Makefile | 2 - 5 files changed, 1045 deletions(-) delete mode 100644 extmod/machine_i2c.c delete mode 100644 extmod/machine_i2c.h delete mode 100644 extmod/machine_spi.c delete mode 100644 extmod/machine_spi.h diff --git a/extmod/machine_i2c.c b/extmod/machine_i2c.c deleted file mode 100644 index 4129ace0a0..0000000000 --- a/extmod/machine_i2c.c +++ /dev/null @@ -1,641 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 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 -#include -#include - -#include "py/mperrno.h" -#include "py/mphal.h" -#include "py/runtime.h" -#include "extmod/machine_i2c.h" - -#include "supervisor/shared/translate.h" - -#if MICROPY_PY_MACHINE_I2C - -typedef mp_machine_soft_i2c_obj_t machine_i2c_obj_t; - -STATIC void mp_hal_i2c_delay(machine_i2c_obj_t *self) { - // We need to use an accurate delay to get acceptable I2C - // speeds (eg 1us should be not much more than 1us). - mp_hal_delay_us_fast(self->us_delay); -} - -STATIC void mp_hal_i2c_scl_low(machine_i2c_obj_t *self) { - mp_hal_pin_od_low(self->scl); -} - -STATIC int mp_hal_i2c_scl_release(machine_i2c_obj_t *self) { - uint32_t count = self->us_timeout; - - mp_hal_pin_od_high(self->scl); - mp_hal_i2c_delay(self); - // For clock stretching, wait for the SCL pin to be released, with timeout. - for (; mp_hal_pin_read(self->scl) == 0 && count; --count) { - mp_hal_delay_us_fast(1); - } - if (count == 0) { - return -MP_ETIMEDOUT; - } - return 0; // success -} - -STATIC void mp_hal_i2c_sda_low(machine_i2c_obj_t *self) { - mp_hal_pin_od_low(self->sda); -} - -STATIC void mp_hal_i2c_sda_release(machine_i2c_obj_t *self) { - mp_hal_pin_od_high(self->sda); -} - -STATIC int mp_hal_i2c_sda_read(machine_i2c_obj_t *self) { - return mp_hal_pin_read(self->sda); -} - -STATIC int mp_hal_i2c_start(machine_i2c_obj_t *self) { - mp_hal_i2c_sda_release(self); - mp_hal_i2c_delay(self); - int ret = mp_hal_i2c_scl_release(self); - if (ret != 0) { - return ret; - } - mp_hal_i2c_sda_low(self); - mp_hal_i2c_delay(self); - return 0; // success -} - -STATIC int mp_hal_i2c_stop(machine_i2c_obj_t *self) { - mp_hal_i2c_delay(self); - mp_hal_i2c_sda_low(self); - mp_hal_i2c_delay(self); - int ret = mp_hal_i2c_scl_release(self); - mp_hal_i2c_sda_release(self); - mp_hal_i2c_delay(self); - return ret; -} - -STATIC void mp_hal_i2c_init(machine_i2c_obj_t *self, uint32_t freq) { - self->us_delay = 500000 / freq; - if (self->us_delay == 0) { - self->us_delay = 1; - } - mp_hal_pin_open_drain(self->scl); - mp_hal_pin_open_drain(self->sda); - mp_hal_i2c_stop(self); // ignore error -} - -// return value: -// 0 - byte written and ack received -// 1 - byte written and nack received -// <0 - error, with errno being the negative of the return value -STATIC int mp_hal_i2c_write_byte(machine_i2c_obj_t *self, uint8_t val) { - mp_hal_i2c_delay(self); - mp_hal_i2c_scl_low(self); - - for (int i = 7; i >= 0; i--) { - if ((val >> i) & 1) { - mp_hal_i2c_sda_release(self); - } else { - mp_hal_i2c_sda_low(self); - } - mp_hal_i2c_delay(self); - int ret = mp_hal_i2c_scl_release(self); - if (ret != 0) { - mp_hal_i2c_sda_release(self); - return ret; - } - mp_hal_i2c_scl_low(self); - } - - mp_hal_i2c_sda_release(self); - mp_hal_i2c_delay(self); - int ret = mp_hal_i2c_scl_release(self); - if (ret != 0) { - return ret; - } - - int ack = mp_hal_i2c_sda_read(self); - mp_hal_i2c_delay(self); - mp_hal_i2c_scl_low(self); - - return ack; -} - -// return value: -// 0 - success -// <0 - error, with errno being the negative of the return value -STATIC int mp_hal_i2c_read_byte(machine_i2c_obj_t *self, uint8_t *val, int nack) { - mp_hal_i2c_delay(self); - mp_hal_i2c_scl_low(self); - mp_hal_i2c_delay(self); - - uint8_t data = 0; - for (int i = 7; i >= 0; i--) { - int ret = mp_hal_i2c_scl_release(self); - if (ret != 0) { - return ret; - } - data = (data << 1) | mp_hal_i2c_sda_read(self); - mp_hal_i2c_scl_low(self); - mp_hal_i2c_delay(self); - } - *val = data; - - // send ack/nack bit - if (!nack) { - mp_hal_i2c_sda_low(self); - } - mp_hal_i2c_delay(self); - int ret = mp_hal_i2c_scl_release(self); - if (ret != 0) { - mp_hal_i2c_sda_release(self); - return ret; - } - mp_hal_i2c_scl_low(self); - mp_hal_i2c_sda_release(self); - - return 0; // success -} - -// return value: -// >=0 - number of acks received -// <0 - error, with errno being the negative of the return value -int mp_machine_soft_i2c_writeto(mp_obj_base_t *self_in, uint16_t addr, const uint8_t *src, size_t len, bool stop) { - machine_i2c_obj_t *self = (machine_i2c_obj_t*)self_in; - - // start the I2C transaction - int ret = mp_hal_i2c_start(self); - if (ret != 0) { - return ret; - } - - // write the slave address - ret = mp_hal_i2c_write_byte(self, addr << 1); - if (ret < 0) { - return ret; - } else if (ret != 0) { - // nack received, release the bus cleanly - mp_hal_i2c_stop(self); - return -MP_ENODEV; - } - - // write the buffer to the I2C memory - int num_acks = 0; - while (len--) { - ret = mp_hal_i2c_write_byte(self, *src++); - if (ret < 0) { - return ret; - } else if (ret != 0) { - // nack received, stop sending - break; - } - ++num_acks; - } - - // finish the I2C transaction - if (stop) { - ret = mp_hal_i2c_stop(self); - if (ret != 0) { - return ret; - } - } - - return num_acks; -} - -// return value: -// 0 - success -// <0 - error, with errno being the negative of the return value -int mp_machine_soft_i2c_readfrom(mp_obj_base_t *self_in, uint16_t addr, uint8_t *dest, size_t len, bool stop) { - machine_i2c_obj_t *self = (machine_i2c_obj_t*)self_in; - - // start the I2C transaction - int ret = mp_hal_i2c_start(self); - if (ret != 0) { - return ret; - } - - // write the slave address - ret = mp_hal_i2c_write_byte(self, (addr << 1) | 1); - if (ret < 0) { - return ret; - } else if (ret != 0) { - // nack received, release the bus cleanly - mp_hal_i2c_stop(self); - return -MP_ENODEV; - } - - // read the bytes from the slave - while (len--) { - ret = mp_hal_i2c_read_byte(self, dest++, len == 0); - if (ret != 0) { - return ret; - } - } - - // finish the I2C transaction - if (stop) { - ret = mp_hal_i2c_stop(self); - if (ret != 0) { - return ret; - } - } - - return 0; // success -} - -/******************************************************************************/ -// MicroPython bindings for I2C - -STATIC void machine_i2c_obj_init_helper(machine_i2c_obj_t *self, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_scl, ARG_sda, ARG_freq, ARG_timeout }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_scl, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_sda, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_freq, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 400000} }, - { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 255} }, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - self->scl = mp_hal_get_pin_obj(args[ARG_scl].u_obj); - self->sda = mp_hal_get_pin_obj(args[ARG_sda].u_obj); - self->us_timeout = args[ARG_timeout].u_int; - mp_hal_i2c_init(self, args[ARG_freq].u_int); -} - -STATIC mp_obj_t machine_i2c_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { - // check the id argument, if given - if (n_args > 0) { - if (args[0] != MP_OBJ_NEW_SMALL_INT(-1)) { - #if defined(MICROPY_PY_MACHINE_I2C_MAKE_NEW) - // dispatch to port-specific constructor - extern mp_obj_t MICROPY_PY_MACHINE_I2C_MAKE_NEW(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *all_args, mp_map_t *kw_args); - return MICROPY_PY_MACHINE_I2C_MAKE_NEW(type, n_args, args, kw_args); - #else - mp_raise_ValueError(translate("invalid I2C peripheral")); - #endif - } - --n_args; - ++args; - } - - // create new soft I2C object - machine_i2c_obj_t *self = m_new_obj(machine_i2c_obj_t); - self->base.type = &machine_i2c_type; - machine_i2c_obj_init_helper(self, n_args, args, kw_args); - return (mp_obj_t)self; -} - -STATIC mp_obj_t machine_i2c_obj_init(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { - machine_i2c_obj_init_helper(args[0], n_args - 1, args + 1, kw_args); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_KW(machine_i2c_init_obj, 1, machine_i2c_obj_init); - -STATIC mp_obj_t machine_i2c_scan(mp_obj_t self_in) { - mp_obj_base_t *self = MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - mp_obj_t list = mp_obj_new_list(0, NULL); - // 7-bit addresses 0b0000xxx and 0b1111xxx are reserved - for (int addr = 0x08; addr < 0x78; ++addr) { - int ret = i2c_p->writeto(self, addr, NULL, 0, true); - if (ret == 0) { - mp_obj_list_append(list, MP_OBJ_NEW_SMALL_INT(addr)); - } - } - return list; -} -MP_DEFINE_CONST_FUN_OBJ_1(machine_i2c_scan_obj, machine_i2c_scan); - -STATIC mp_obj_t machine_i2c_start(mp_obj_t self_in) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - if (i2c_p->start == NULL) { - mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported")); - } - int ret = i2c_p->start(self); - if (ret != 0) { - mp_raise_OSError(-ret); - } - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(machine_i2c_start_obj, machine_i2c_start); - -STATIC mp_obj_t machine_i2c_stop(mp_obj_t self_in) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - if (i2c_p->stop == NULL) { - mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported")); - } - int ret = i2c_p->stop(self); - if (ret != 0) { - mp_raise_OSError(-ret); - } - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(machine_i2c_stop_obj, machine_i2c_stop); - -STATIC mp_obj_t machine_i2c_readinto(size_t n_args, const mp_obj_t *args) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - if (i2c_p->read == NULL) { - mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported")); - } - - // get the buffer to read into - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_WRITE); - - // work out if we want to send a nack at the end - bool nack = (n_args == 2) ? true : mp_obj_is_true(args[2]); - - // do the read - int ret = i2c_p->read(self, bufinfo.buf, bufinfo.len, nack); - if (ret != 0) { - mp_raise_OSError(-ret); - } - - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_i2c_readinto_obj, 2, 3, machine_i2c_readinto); - -STATIC mp_obj_t machine_i2c_write(mp_obj_t self_in, mp_obj_t buf_in) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - if (i2c_p->write == NULL) { - mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported")); - } - - // get the buffer to write from - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); - - // do the write - int ret = i2c_p->write(self, bufinfo.buf, bufinfo.len); - if (ret < 0) { - mp_raise_OSError(-ret); - } - - // return number of acks received - return MP_OBJ_NEW_SMALL_INT(ret); -} -MP_DEFINE_CONST_FUN_OBJ_2(machine_i2c_write_obj, machine_i2c_write); - -STATIC mp_obj_t machine_i2c_readfrom(size_t n_args, const mp_obj_t *args) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - mp_int_t addr = mp_obj_get_int(args[1]); - vstr_t vstr; - vstr_init_len(&vstr, mp_obj_get_int(args[2])); - bool stop = (n_args == 3) ? true : mp_obj_is_true(args[3]); - int ret = i2c_p->readfrom(self, addr, (uint8_t*)vstr.buf, vstr.len, stop); - if (ret < 0) { - mp_raise_OSError(-ret); - } - return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); -} -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_i2c_readfrom_obj, 3, 4, machine_i2c_readfrom); - -STATIC mp_obj_t machine_i2c_readfrom_into(size_t n_args, const mp_obj_t *args) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - mp_int_t addr = mp_obj_get_int(args[1]); - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[2], &bufinfo, MP_BUFFER_WRITE); - bool stop = (n_args == 3) ? true : mp_obj_is_true(args[3]); - int ret = i2c_p->readfrom(self, addr, bufinfo.buf, bufinfo.len, stop); - if (ret < 0) { - mp_raise_OSError(-ret); - } - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_i2c_readfrom_into_obj, 3, 4, machine_i2c_readfrom_into); - -STATIC mp_obj_t machine_i2c_writeto(size_t n_args, const mp_obj_t *args) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - mp_int_t addr = mp_obj_get_int(args[1]); - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[2], &bufinfo, MP_BUFFER_READ); - bool stop = (n_args == 3) ? true : mp_obj_is_true(args[3]); - int ret = i2c_p->writeto(self, addr, bufinfo.buf, bufinfo.len, stop); - if (ret < 0) { - mp_raise_OSError(-ret); - } - // return number of acks received - return MP_OBJ_NEW_SMALL_INT(ret); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_i2c_writeto_obj, 3, 4, machine_i2c_writeto); - -STATIC int read_mem(mp_obj_t self_in, uint16_t addr, uint32_t memaddr, uint8_t addrsize, uint8_t *buf, size_t len) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - uint8_t memaddr_buf[4]; - size_t memaddr_len = 0; - for (int16_t i = addrsize - 8; i >= 0; i -= 8) { - memaddr_buf[memaddr_len++] = memaddr >> i; - } - int ret = i2c_p->writeto(self, addr, memaddr_buf, memaddr_len, false); - if (ret != memaddr_len) { - // must generate STOP - i2c_p->writeto(self, addr, NULL, 0, true); - return ret; - } - return i2c_p->readfrom(self, addr, buf, len, true); -} - -#define MAX_MEMADDR_SIZE (4) -#define BUF_STACK_SIZE (12) - -STATIC int write_mem(mp_obj_t self_in, uint16_t addr, uint32_t memaddr, uint8_t addrsize, const uint8_t *buf, size_t len) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - - // need some memory to create the buffer to send; try to use stack if possible - uint8_t buf2_stack[MAX_MEMADDR_SIZE + BUF_STACK_SIZE]; - uint8_t *buf2; - size_t buf2_alloc = 0; - if (len <= BUF_STACK_SIZE) { - buf2 = buf2_stack; - } else { - buf2_alloc = MAX_MEMADDR_SIZE + len; - buf2 = m_new(uint8_t, buf2_alloc); - } - - // create the buffer to send - size_t memaddr_len = 0; - for (int16_t i = addrsize - 8; i >= 0; i -= 8) { - buf2[memaddr_len++] = memaddr >> i; - } - memcpy(buf2 + memaddr_len, buf, len); - - int ret = i2c_p->writeto(self, addr, buf2, memaddr_len + len, true); - if (buf2_alloc != 0) { - m_del(uint8_t, buf2, buf2_alloc); - } - return ret; -} - -STATIC const mp_arg_t machine_i2c_mem_allowed_args[] = { - { MP_QSTR_addr, MP_ARG_REQUIRED | MP_ARG_INT, {.u_int = 0} }, - { MP_QSTR_memaddr, MP_ARG_REQUIRED | MP_ARG_INT, {.u_int = 0} }, - { MP_QSTR_arg, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - { MP_QSTR_addrsize, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 8} }, -}; - -STATIC mp_obj_t machine_i2c_readfrom_mem(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_addr, ARG_memaddr, ARG_n, ARG_addrsize }; - mp_arg_val_t args[MP_ARRAY_SIZE(machine_i2c_mem_allowed_args)]; - mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, - MP_ARRAY_SIZE(machine_i2c_mem_allowed_args), machine_i2c_mem_allowed_args, args); - - // create the buffer to store data into - vstr_t vstr; - vstr_init_len(&vstr, mp_obj_get_int(args[ARG_n].u_obj)); - - // do the transfer - int ret = read_mem(pos_args[0], args[ARG_addr].u_int, args[ARG_memaddr].u_int, - args[ARG_addrsize].u_int, (uint8_t*)vstr.buf, vstr.len); - if (ret < 0) { - mp_raise_OSError(-ret); - } - - return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); -} -MP_DEFINE_CONST_FUN_OBJ_KW(machine_i2c_readfrom_mem_obj, 1, machine_i2c_readfrom_mem); - - -STATIC mp_obj_t machine_i2c_readfrom_mem_into(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_addr, ARG_memaddr, ARG_buf, ARG_addrsize }; - mp_arg_val_t args[MP_ARRAY_SIZE(machine_i2c_mem_allowed_args)]; - mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, - MP_ARRAY_SIZE(machine_i2c_mem_allowed_args), machine_i2c_mem_allowed_args, args); - - // get the buffer to store data into - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[ARG_buf].u_obj, &bufinfo, MP_BUFFER_WRITE); - - // do the transfer - int ret = read_mem(pos_args[0], args[ARG_addr].u_int, args[ARG_memaddr].u_int, - args[ARG_addrsize].u_int, bufinfo.buf, bufinfo.len); - if (ret < 0) { - mp_raise_OSError(-ret); - } - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_KW(machine_i2c_readfrom_mem_into_obj, 1, machine_i2c_readfrom_mem_into); - -STATIC mp_obj_t machine_i2c_writeto_mem(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_addr, ARG_memaddr, ARG_buf, ARG_addrsize }; - mp_arg_val_t args[MP_ARRAY_SIZE(machine_i2c_mem_allowed_args)]; - mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, - MP_ARRAY_SIZE(machine_i2c_mem_allowed_args), machine_i2c_mem_allowed_args, args); - - // get the buffer to write the data from - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[ARG_buf].u_obj, &bufinfo, MP_BUFFER_READ); - - // do the transfer - int ret = write_mem(pos_args[0], args[ARG_addr].u_int, args[ARG_memaddr].u_int, - args[ARG_addrsize].u_int, bufinfo.buf, bufinfo.len); - if (ret < 0) { - mp_raise_OSError(-ret); - } - - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_KW(machine_i2c_writeto_mem_obj, 1, machine_i2c_writeto_mem); - -STATIC const mp_rom_map_elem_t machine_i2c_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&machine_i2c_init_obj) }, - { MP_ROM_QSTR(MP_QSTR_scan), MP_ROM_PTR(&machine_i2c_scan_obj) }, - - // primitive I2C operations - { MP_ROM_QSTR(MP_QSTR_start), MP_ROM_PTR(&machine_i2c_start_obj) }, - { MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&machine_i2c_stop_obj) }, - { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&machine_i2c_readinto_obj) }, - { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&machine_i2c_write_obj) }, - - // standard bus operations - { MP_ROM_QSTR(MP_QSTR_readfrom), MP_ROM_PTR(&machine_i2c_readfrom_obj) }, - { MP_ROM_QSTR(MP_QSTR_readfrom_into), MP_ROM_PTR(&machine_i2c_readfrom_into_obj) }, - { MP_ROM_QSTR(MP_QSTR_writeto), MP_ROM_PTR(&machine_i2c_writeto_obj) }, - - // memory operations - { MP_ROM_QSTR(MP_QSTR_readfrom_mem), MP_ROM_PTR(&machine_i2c_readfrom_mem_obj) }, - { MP_ROM_QSTR(MP_QSTR_readfrom_mem_into), MP_ROM_PTR(&machine_i2c_readfrom_mem_into_obj) }, - { MP_ROM_QSTR(MP_QSTR_writeto_mem), MP_ROM_PTR(&machine_i2c_writeto_mem_obj) }, -}; - -MP_DEFINE_CONST_DICT(mp_machine_soft_i2c_locals_dict, machine_i2c_locals_dict_table); - -int mp_machine_soft_i2c_read(mp_obj_base_t *self_in, uint8_t *dest, size_t len, bool nack) { - machine_i2c_obj_t *self = (machine_i2c_obj_t*)self_in; - while (len--) { - int ret = mp_hal_i2c_read_byte(self, dest++, nack && (len == 0)); - if (ret != 0) { - return ret; - } - } - return 0; // success -} - -int mp_machine_soft_i2c_write(mp_obj_base_t *self_in, const uint8_t *src, size_t len) { - machine_i2c_obj_t *self = (machine_i2c_obj_t*)self_in; - int num_acks = 0; - while (len--) { - int ret = mp_hal_i2c_write_byte(self, *src++); - if (ret < 0) { - return ret; - } else if (ret != 0) { - // nack received, stop sending - break; - } - ++num_acks; - } - return num_acks; -} - -STATIC const mp_machine_i2c_p_t mp_machine_soft_i2c_p = { - MP_PROTO_IMPLEMENT(MP_QSTR_protocol_i2c) - .start = (int(*)(mp_obj_base_t*))mp_hal_i2c_start, - .stop = (int(*)(mp_obj_base_t*))mp_hal_i2c_stop, - .read = mp_machine_soft_i2c_read, - .write = mp_machine_soft_i2c_write, - .readfrom = mp_machine_soft_i2c_readfrom, - .writeto = mp_machine_soft_i2c_writeto, -}; - -const mp_obj_type_t machine_i2c_type = { - { &mp_type_type }, - .name = MP_QSTR_I2C, - .make_new = machine_i2c_make_new, - .protocol = &mp_machine_soft_i2c_p, - .locals_dict = (mp_obj_dict_t*)&mp_machine_soft_i2c_locals_dict, -}; - -#endif // MICROPY_PY_MACHINE_I2C diff --git a/extmod/machine_i2c.h b/extmod/machine_i2c.h deleted file mode 100644 index 7f5ee568e3..0000000000 --- a/extmod/machine_i2c.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 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. - */ -#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H -#define MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H - -#include "py/obj.h" -#include "py/proto.h" - -// I2C protocol -// the first 4 methods can be NULL, meaning operation is not supported -typedef struct _mp_machine_i2c_p_t { - MP_PROTOCOL_HEAD - int (*start)(mp_obj_base_t *obj); - int (*stop)(mp_obj_base_t *obj); - int (*read)(mp_obj_base_t *obj, uint8_t *dest, size_t len, bool nack); - int (*write)(mp_obj_base_t *obj, const uint8_t *src, size_t len); - int (*readfrom)(mp_obj_base_t *obj, uint16_t addr, uint8_t *dest, size_t len, bool stop); - int (*writeto)(mp_obj_base_t *obj, uint16_t addr, const uint8_t *src, size_t len, bool stop); -} mp_machine_i2c_p_t; - -typedef struct _mp_machine_soft_i2c_obj_t { - mp_obj_base_t base; - uint32_t us_delay; - uint32_t us_timeout; - mp_hal_pin_obj_t scl; - mp_hal_pin_obj_t sda; -} mp_machine_soft_i2c_obj_t; - -extern const mp_obj_type_t machine_i2c_type; -extern const mp_obj_dict_t mp_machine_soft_i2c_locals_dict; - -int mp_machine_soft_i2c_readfrom(mp_obj_base_t *self_in, uint16_t addr, uint8_t *dest, size_t len, bool stop); -int mp_machine_soft_i2c_writeto(mp_obj_base_t *self_in, uint16_t addr, const uint8_t *src, size_t len, bool stop); - -#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H diff --git a/extmod/machine_spi.c b/extmod/machine_spi.c deleted file mode 100644 index 4ead321d90..0000000000 --- a/extmod/machine_spi.c +++ /dev/null @@ -1,286 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 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 -#include - -#include "py/runtime.h" -#include "extmod/machine_spi.h" - -#include "supervisor/shared/translate.h" - -#if MICROPY_PY_MACHINE_SPI - -// if a port didn't define MSB/LSB constants then provide them -#ifndef MICROPY_PY_MACHINE_SPI_MSB -#define MICROPY_PY_MACHINE_SPI_MSB (0) -#define MICROPY_PY_MACHINE_SPI_LSB (1) -#endif - -/******************************************************************************/ -// MicroPython bindings for generic machine.SPI - -STATIC mp_obj_t mp_machine_soft_spi_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args); - -mp_obj_t mp_machine_spi_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { - // check the id argument, if given - if (n_args > 0) { - if (args[0] != MP_OBJ_NEW_SMALL_INT(-1)) { - #if defined(MICROPY_PY_MACHINE_SPI_MAKE_NEW) - // dispatch to port-specific constructor - extern mp_obj_t MICROPY_PY_MACHINE_SPI_MAKE_NEW(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args); - return MICROPY_PY_MACHINE_SPI_MAKE_NEW(type, n_args, args, kw_args); - #else - mp_raise_ValueError(translate("invalid SPI peripheral")); - #endif - } - --n_args; - ++args; - } - - // software SPI - return mp_machine_soft_spi_make_new(type, n_args, args, kw_args); -} - -STATIC mp_obj_t machine_spi_init(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { - mp_obj_base_t *s = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_spi_p_t *spi_p = (mp_machine_spi_p_t*)mp_proto_get(QSTR_protocol_spi, s); - spi_p->init(s, n_args - 1, args + 1, kw_args); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_KW(machine_spi_init_obj, 1, machine_spi_init); - -STATIC mp_obj_t machine_spi_deinit(mp_obj_t self) { - mp_obj_base_t *s = (mp_obj_base_t*)MP_OBJ_TO_PTR(self); - mp_machine_spi_p_t *spi_p = (mp_machine_spi_p_t*)mp_proto_get(QSTR_protocol_spi, s); - if (spi_p->deinit != NULL) { - spi_p->deinit(s); - } - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(machine_spi_deinit_obj, machine_spi_deinit); - -STATIC void mp_machine_spi_transfer(mp_obj_t self, size_t len, const void *src, void *dest) { - mp_obj_base_t *s = (mp_obj_base_t*)MP_OBJ_TO_PTR(self); - mp_machine_spi_p_t *spi_p = (mp_machine_spi_p_t*)mp_proto_get(QSTR_protocol_spi, s); - spi_p->transfer(s, len, src, dest); -} - -STATIC mp_obj_t mp_machine_spi_read(size_t n_args, const mp_obj_t *args) { - vstr_t vstr; - vstr_init_len(&vstr, mp_obj_get_int(args[1])); - memset(vstr.buf, n_args == 3 ? mp_obj_get_int(args[2]) : 0, vstr.len); - mp_machine_spi_transfer(args[0], vstr.len, vstr.buf, vstr.buf); - return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); -} -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_machine_spi_read_obj, 2, 3, mp_machine_spi_read); - -STATIC mp_obj_t mp_machine_spi_readinto(size_t n_args, const mp_obj_t *args) { - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_WRITE); - memset(bufinfo.buf, n_args == 3 ? mp_obj_get_int(args[2]) : 0, bufinfo.len); - mp_machine_spi_transfer(args[0], bufinfo.len, bufinfo.buf, bufinfo.buf); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_machine_spi_readinto_obj, 2, 3, mp_machine_spi_readinto); - -STATIC mp_obj_t mp_machine_spi_write(mp_obj_t self, mp_obj_t wr_buf) { - mp_buffer_info_t src; - mp_get_buffer_raise(wr_buf, &src, MP_BUFFER_READ); - mp_machine_spi_transfer(self, src.len, (const uint8_t*)src.buf, NULL); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_2(mp_machine_spi_write_obj, mp_machine_spi_write); - -STATIC mp_obj_t mp_machine_spi_write_readinto(mp_obj_t self, mp_obj_t wr_buf, mp_obj_t rd_buf) { - mp_buffer_info_t src; - mp_get_buffer_raise(wr_buf, &src, MP_BUFFER_READ); - mp_buffer_info_t dest; - mp_get_buffer_raise(rd_buf, &dest, MP_BUFFER_WRITE); - if (src.len != dest.len) { - mp_raise_ValueError(translate("buffers must be the same length")); - } - mp_machine_spi_transfer(self, src.len, src.buf, dest.buf); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_3(mp_machine_spi_write_readinto_obj, mp_machine_spi_write_readinto); - -STATIC const mp_rom_map_elem_t machine_spi_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&machine_spi_init_obj) }, - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&machine_spi_deinit_obj) }, - { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&mp_machine_spi_read_obj) }, - { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_machine_spi_readinto_obj) }, - { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_machine_spi_write_obj) }, - { MP_ROM_QSTR(MP_QSTR_write_readinto), MP_ROM_PTR(&mp_machine_spi_write_readinto_obj) }, - - { MP_ROM_QSTR(MP_QSTR_MSB), MP_ROM_INT(MICROPY_PY_MACHINE_SPI_MSB) }, - { MP_ROM_QSTR(MP_QSTR_LSB), MP_ROM_INT(MICROPY_PY_MACHINE_SPI_LSB) }, -}; - -MP_DEFINE_CONST_DICT(mp_machine_spi_locals_dict, machine_spi_locals_dict_table); - -/******************************************************************************/ -// Implementation of soft SPI - -STATIC uint32_t baudrate_from_delay_half(uint32_t delay_half) { - #ifdef MICROPY_HW_SOFTSPI_MIN_DELAY - if (delay_half == MICROPY_HW_SOFTSPI_MIN_DELAY) { - return MICROPY_HW_SOFTSPI_MAX_BAUDRATE; - } else - #endif - { - return 500000 / delay_half; - } -} - -STATIC uint32_t baudrate_to_delay_half(uint32_t baudrate) { - #ifdef MICROPY_HW_SOFTSPI_MIN_DELAY - if (baudrate >= MICROPY_HW_SOFTSPI_MAX_BAUDRATE) { - return MICROPY_HW_SOFTSPI_MIN_DELAY; - } else - #endif - { - uint32_t delay_half = 500000 / baudrate; - // round delay_half up so that: actual_baudrate <= requested_baudrate - if (500000 % baudrate != 0) { - delay_half += 1; - } - return delay_half; - } -} - -STATIC void mp_machine_soft_spi_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { - mp_machine_soft_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); - mp_printf(print, "SoftSPI(baudrate=%u, polarity=%u, phase=%u," - " sck=" MP_HAL_PIN_FMT ", mosi=" MP_HAL_PIN_FMT ", miso=" MP_HAL_PIN_FMT ")", - baudrate_from_delay_half(self->spi.delay_half), self->spi.polarity, self->spi.phase, - mp_hal_pin_name(self->spi.sck), mp_hal_pin_name(self->spi.mosi), mp_hal_pin_name(self->spi.miso)); -} - -STATIC mp_obj_t mp_machine_soft_spi_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *all_args, mp_map_t *kw_args) { - enum { ARG_baudrate, ARG_polarity, ARG_phase, ARG_bits, ARG_firstbit, ARG_sck, ARG_mosi, ARG_miso }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_baudrate, MP_ARG_INT, {.u_int = 500000} }, - { MP_QSTR_polarity, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, - { MP_QSTR_phase, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, - { MP_QSTR_bits, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 8} }, - { MP_QSTR_firstbit, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = MICROPY_PY_MACHINE_SPI_MSB} }, - { MP_QSTR_sck, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - { MP_QSTR_mosi, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - { MP_QSTR_miso, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all(n_args, all_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - - // create new object - mp_machine_soft_spi_obj_t *self = m_new_obj(mp_machine_soft_spi_obj_t); - self->base.type = &mp_machine_soft_spi_type; - - // set parameters - self->spi.delay_half = baudrate_to_delay_half(args[ARG_baudrate].u_int); - self->spi.polarity = args[ARG_polarity].u_int; - self->spi.phase = args[ARG_phase].u_int; - if (args[ARG_bits].u_int != 8) { - mp_raise_ValueError(translate("bits must be 8")); - } - if (args[ARG_firstbit].u_int != MICROPY_PY_MACHINE_SPI_MSB) { - mp_raise_ValueError(translate("firstbit must be MSB")); - } - if (args[ARG_sck].u_obj == MP_OBJ_NULL - || args[ARG_mosi].u_obj == MP_OBJ_NULL - || args[ARG_miso].u_obj == MP_OBJ_NULL) { - mp_raise_ValueError(translate("must specify all of sck/mosi/miso")); - } - self->spi.sck = mp_hal_get_pin_obj(args[ARG_sck].u_obj); - self->spi.mosi = mp_hal_get_pin_obj(args[ARG_mosi].u_obj); - self->spi.miso = mp_hal_get_pin_obj(args[ARG_miso].u_obj); - - // configure bus - mp_soft_spi_ioctl(&self->spi, MP_SPI_IOCTL_INIT); - - return MP_OBJ_FROM_PTR(self); -} - -STATIC void mp_machine_soft_spi_init(mp_obj_base_t *self_in, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - mp_machine_soft_spi_obj_t *self = (mp_machine_soft_spi_obj_t*)self_in; - - enum { ARG_baudrate, ARG_polarity, ARG_phase, ARG_sck, ARG_mosi, ARG_miso }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_baudrate, MP_ARG_INT, {.u_int = -1} }, - { MP_QSTR_polarity, MP_ARG_INT, {.u_int = -1} }, - { MP_QSTR_phase, MP_ARG_INT, {.u_int = -1} }, - { MP_QSTR_sck, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - { MP_QSTR_mosi, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - { MP_QSTR_miso, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - - if (args[ARG_baudrate].u_int != -1) { - self->spi.delay_half = baudrate_to_delay_half(args[ARG_baudrate].u_int); - } - if (args[ARG_polarity].u_int != -1) { - self->spi.polarity = args[ARG_polarity].u_int; - } - if (args[ARG_phase].u_int != -1) { - self->spi.phase = args[ARG_phase].u_int; - } - if (args[ARG_sck].u_obj != MP_OBJ_NULL) { - self->spi.sck = mp_hal_get_pin_obj(args[ARG_sck].u_obj); - } - if (args[ARG_mosi].u_obj != MP_OBJ_NULL) { - self->spi.mosi = mp_hal_get_pin_obj(args[ARG_mosi].u_obj); - } - if (args[ARG_miso].u_obj != MP_OBJ_NULL) { - self->spi.miso = mp_hal_get_pin_obj(args[ARG_miso].u_obj); - } - - // configure bus - mp_soft_spi_ioctl(&self->spi, MP_SPI_IOCTL_INIT); -} - -STATIC void mp_machine_soft_spi_transfer(mp_obj_base_t *self_in, size_t len, const uint8_t *src, uint8_t *dest) { - mp_machine_soft_spi_obj_t *self = (mp_machine_soft_spi_obj_t*)self_in; - mp_soft_spi_transfer(&self->spi, len, src, dest); -} - -const mp_machine_spi_p_t mp_machine_soft_spi_p = { - MP_PROTO_IMPLEMENT(MP_QSTR_protocol_spi) - .init = mp_machine_soft_spi_init, - .deinit = NULL, - .transfer = mp_machine_soft_spi_transfer, -}; - -const mp_obj_type_t mp_machine_soft_spi_type = { - { &mp_type_type }, - .name = MP_QSTR_SoftSPI, - .print = mp_machine_soft_spi_print, - .make_new = mp_machine_spi_make_new, // delegate to master constructor - .protocol = &mp_machine_soft_spi_p, - .locals_dict = (mp_obj_dict_t*)&mp_machine_spi_locals_dict, -}; - -#endif // MICROPY_PY_MACHINE_SPI diff --git a/extmod/machine_spi.h b/extmod/machine_spi.h deleted file mode 100644 index 365b44d6e8..0000000000 --- a/extmod/machine_spi.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 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. - */ -#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_SPI_H -#define MICROPY_INCLUDED_EXTMOD_MACHINE_SPI_H - -#include "py/obj.h" -#include "py/proto.h" -#include "py/mphal.h" -#include "drivers/bus/spi.h" - -// SPI protocol -typedef struct _mp_machine_spi_p_t { - MP_PROTOCOL_HEAD - void (*init)(mp_obj_base_t *obj, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args); - void (*deinit)(mp_obj_base_t *obj); // can be NULL - void (*transfer)(mp_obj_base_t *obj, size_t len, const uint8_t *src, uint8_t *dest); -} mp_machine_spi_p_t; - -typedef struct _mp_machine_soft_spi_obj_t { - mp_obj_base_t base; - mp_soft_spi_obj_t spi; -} mp_machine_soft_spi_obj_t; - -extern const mp_machine_spi_p_t mp_machine_soft_spi_p; -extern const mp_obj_type_t mp_machine_soft_spi_type; -extern const mp_obj_dict_t mp_machine_spi_locals_dict; - -mp_obj_t mp_machine_spi_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args); - -MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_machine_spi_read_obj); -MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_machine_spi_readinto_obj); -MP_DECLARE_CONST_FUN_OBJ_2(mp_machine_spi_write_obj); -MP_DECLARE_CONST_FUN_OBJ_3(mp_machine_spi_write_readinto_obj); - -#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_SPI_H diff --git a/ports/unix/Makefile b/ports/unix/Makefile index 63c4980c31..5d4b168fe9 100644 --- a/ports/unix/Makefile +++ b/ports/unix/Makefile @@ -161,8 +161,6 @@ PY_EXTMOD_O_BASENAME += \ extmod/machine_pinbase.o \ extmod/machine_signal.o \ extmod/machine_pulse.o \ - extmod/machine_i2c.o \ - extmod/machine_spi.o LIB_SRC_C = $(addprefix lib/,\ $(LIB_SRC_C_EXTRA) \ From e7923c068ec62d4426af4b4ecc8fabe378b0f067 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 15 Jun 2020 16:48:16 -0500 Subject: [PATCH 0093/1293] docs: Explain our shift in terminology --- docs/design_guide.rst | 37 +++++++++++++++++++++++++++++++++++++ docs/static/customstyle.css | 4 ++++ 2 files changed, 41 insertions(+) diff --git a/docs/design_guide.rst b/docs/design_guide.rst index 1d40943acb..2d52e988b0 100644 --- a/docs/design_guide.rst +++ b/docs/design_guide.rst @@ -1,3 +1,5 @@ +.. role:: strike + Design Guide ============ @@ -46,6 +48,41 @@ not have the ``adafruit_`` module or package prefix. Both should have the CircuitPython repository topic on GitHub. +Terminology +----------- + +As our Code of Conduct states, we strive to use "welcoming and inclusive +language." Whether it is in documentation or in code, the words we use matter. +This means we disfavor language that due to historical and social context can +make community members and potential community members feel unwelcome. + +There are specific terms to avoid except where technical limitations require it. +While specific cases may call for other terms, consider using these suggested +terms first: + ++--------------------+---------------------+ +| Preferred | Deprecated | ++====================+=====================+ +| Main (device) | :strike:`Master` | ++--------------------+---------------------+ +| Peripheral | :strike:`Slave` | ++--------------------+ + +| Sensor | | ++--------------------+ + +| Secondary (device) | | ++--------------------+---------------------+ +| Denylist | :strike:`Blacklist` | ++--------------------+---------------------+ +| Allowlist | :strike:`Whitelist` | ++--------------------+---------------------+ + +Note that "technical limitations" refers e.g., to the situation where an +upstream library or URL has to contain those substrings in order to work. +However, when it comes to documentation and the names of parameters and +properties in CircuitPython, we will use alternate terms even if this breaks +tradition with past practice. + + .. _lifetime-and-contextmanagers: Lifetime and ContextManagers diff --git a/docs/static/customstyle.css b/docs/static/customstyle.css index 6c964b762c..3c0bc84243 100644 --- a/docs/static/customstyle.css +++ b/docs/static/customstyle.css @@ -24,3 +24,7 @@ overflow: visible !important; } } + +.strike { + text-decoration: line-through; +} From 66d031fc1890381cbdf14b1abce3436bc7d23abb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 14:15:45 -0500 Subject: [PATCH 0094/1293] make translate and msgmerge --- locale/ID.po | 71 ++++++++++++++++--------------- locale/circuitpython.pot | 41 ++++-------------- locale/cs.po | 50 +++++++--------------- locale/de_DE.po | 71 ++++++++++++++++--------------- locale/en_US.po | 78 +++++++++++++++++++--------------- locale/en_x_pirate.po | 90 +++++++++++++++++++++++++--------------- locale/es.po | 71 ++++++++++++++++--------------- locale/fil.po | 71 ++++++++++++++++--------------- locale/fr.po | 71 ++++++++++++++++--------------- locale/it_IT.po | 71 ++++++++++++++++--------------- locale/ko.po | 59 +++++++++++--------------- locale/nl.po | 71 ++++++++++++++++--------------- locale/pl.po | 71 ++++++++++++++++--------------- locale/pt_BR.po | 71 ++++++++++++++++--------------- locale/sv.po | 71 ++++++++++++++++--------------- locale/zh_Latn_pinyin.po | 71 ++++++++++++++++--------------- 16 files changed, 555 insertions(+), 544 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index c40ac105c5..ae057fbd7a 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -293,6 +293,7 @@ msgstr "Semua channel event yang disinkronisasi sedang digunakan" msgid "All timers for this pin are in use" msgstr "Semua timer untuk pin ini sedang digunakan" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -300,7 +301,7 @@ msgstr "Semua timer untuk pin ini sedang digunakan" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Semua timer sedang digunakan" @@ -582,6 +583,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Tidak dapat menginisialisasi UART" @@ -828,10 +833,6 @@ msgstr "operasi I/O pada file tertutup" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "operasi I2C tidak didukung" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -973,7 +974,7 @@ msgstr "Pin untuk channel kanan tidak valid" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1441,6 +1442,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1627,6 +1632,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Baudrate tidak didukung" @@ -1743,11 +1749,11 @@ msgstr "abort() dipanggil" msgid "address %08x is not aligned to %d bytes" msgstr "alamat %08x tidak selaras dengan %d bytes" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1828,10 +1834,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits harus memilki nilai 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1858,10 +1860,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "buffers harus mempunyai panjang yang sama" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1937,7 +1935,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2291,10 +2289,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "bit pertama(firstbit) harus berupa MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2479,14 +2473,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "perangkat I2C tidak valid" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "perangkat SPI tidak valid" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "argumen-argumen tidak valid" @@ -2663,10 +2649,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "harus menentukan semua pin sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -3455,6 +3437,9 @@ msgstr "" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 tidak mendukung pull up" +#~ msgid "I2C operation not supported" +#~ msgstr "operasi I2C tidak didukung" + #~ msgid "Invalid bit clock pin" #~ msgstr "Bit clock pada pin tidak valid" @@ -3546,9 +3531,15 @@ msgstr "" #~ msgid "[addrinfo error %d]" #~ msgstr "[addrinfo error %d]" +#~ msgid "bits must be 8" +#~ msgstr "bits harus memilki nilai 8" + #~ msgid "buffer too long" #~ msgstr "buffer terlalu panjang" +#~ msgid "buffers must be the same length" +#~ msgstr "buffers harus mempunyai panjang yang sama" + #~ msgid "can query only one param" #~ msgstr "hanya bisa melakukan query satu param" @@ -3573,6 +3564,9 @@ msgstr "" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "bit pertama(firstbit) harus berupa MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "alokasi flash harus dibawah 1MByte" @@ -3582,6 +3576,12 @@ msgstr "" #~ msgid "impossible baudrate" #~ msgstr "baudrate tidak memungkinkan" +#~ msgid "invalid I2C peripheral" +#~ msgstr "perangkat I2C tidak valid" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "perangkat SPI tidak valid" + #~ msgid "invalid alarm" #~ msgstr "alarm tidak valid" @@ -3603,6 +3603,9 @@ msgstr "" #~ msgid "memory allocation failed, allocating %u bytes for native code" #~ msgstr "alokasi memori gagal, mengalokasikan %u byte untuk kode native" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "harus menentukan semua pin sck/mosi/miso" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "keyword harus berupa string" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index f125c2cc4b..1582b746ca 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -291,6 +291,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -298,7 +299,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "" @@ -821,10 +822,6 @@ msgstr "" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -966,7 +963,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1729,11 +1726,11 @@ msgstr "" msgid "address %08x is not aligned to %d bytes" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1814,10 +1811,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1843,10 +1836,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1922,7 +1911,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2276,10 +2265,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2464,14 +2449,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "" @@ -2648,10 +2625,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 39bf51af8e..b23144fc8c 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -299,6 +299,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -306,7 +307,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "" @@ -580,6 +581,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -825,10 +830,6 @@ msgstr "" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -970,7 +971,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1433,6 +1434,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1619,6 +1624,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" @@ -1728,11 +1734,11 @@ msgstr "" msgid "address %08x is not aligned to %d bytes" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1813,10 +1819,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1842,10 +1844,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1921,7 +1919,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2275,10 +2273,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2463,14 +2457,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "" @@ -2647,10 +2633,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index d317a6234a..eff611b20d 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -298,6 +298,7 @@ msgstr "Alle sync event Kanäle werden benutzt" msgid "All timers for this pin are in use" msgstr "Alle timer für diesen Pin werden bereits benutzt" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -305,7 +306,7 @@ msgstr "Alle timer für diesen Pin werden bereits benutzt" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Alle timer werden benutzt" @@ -590,6 +591,10 @@ msgstr "Beschädigte .mpy Datei" msgid "Corrupt raw code" msgstr "Beschädigter raw code" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Konnte UART nicht initialisieren" @@ -840,10 +845,6 @@ msgstr "Lese/Schreibe-operation an geschlossener Datei" msgid "I2C Init Error" msgstr "I2C-Init-Fehler" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "I2C-operation nicht unterstützt" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -987,7 +988,7 @@ msgstr "Ungültiger Pin für rechten Kanal" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1463,6 +1464,10 @@ msgstr "Stream fehlt readinto() oder write() Methode." msgid "Supply at least one UART pin" msgstr "Geben Sie mindestens einen UART-Pin an" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "Zeitüberschreitung beim Auslesen der Temperatur" @@ -1667,6 +1672,7 @@ msgstr "" "Eingabeaufforderung auf dem anderen Gerät abgelehnt oder ignoriert." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Baudrate wird nicht unterstützt" @@ -1785,11 +1791,11 @@ msgstr "abort() wurde aufgerufen" msgid "address %08x is not aligned to %d bytes" msgstr "Addresse %08x ist nicht an %d bytes ausgerichtet" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "Adresse außerhalb der Grenzen" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "adresses ist leer" @@ -1870,10 +1876,6 @@ msgstr "Der binäre Operator %q ist nicht implementiert" msgid "bits must be 7, 8 or 9" msgstr "bits muss 7, 8 oder 9 sein" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits müssen 8 sein" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "Es müssen 8 oder 16 bits_per_sample sein" @@ -1899,10 +1901,6 @@ msgstr "Puffersegmente müssen gleich lang sein" msgid "buffer too small" msgstr "Der Puffer ist zu klein" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "Buffer müssen gleich lang sein" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "Tasten müssen digitalio.DigitalInOut sein" @@ -1980,7 +1978,7 @@ msgstr "Kann '%q' Objekt nicht implizit nach %q konvertieren" msgid "can't convert NaN to int" msgstr "kann NaN nicht nach int konvertieren" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "kann Adresse nicht in int konvertieren" @@ -2345,10 +2343,6 @@ msgstr "Das erste Argument muss ein Ndarray sein" msgid "first argument to super() must be type" msgstr "Das erste Argument für super() muss type sein" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "Erstes Bit muss das höchstwertigste Bit (MSB) sein" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "Die Abflachungsreihenfolge muss entweder \"C\" oder \"F\" sein" @@ -2534,14 +2528,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "Das Intervall muss im Bereich %s-%s sein" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "ungültige I2C Schnittstelle" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "ungültige SPI Schnittstelle" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "ungültige argumente" @@ -2724,10 +2710,6 @@ msgstr "Mehrfache Vererbung nicht unterstützt" msgid "must raise an object" msgstr "muss ein Objekt verursachen (raise)" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "sck/mosi/miso müssen alle spezifiziert sein" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "muss Schlüsselwortargument für key function verwenden" @@ -3560,6 +3542,9 @@ msgstr "Nullschritt" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 unterstützt pull up nicht" +#~ msgid "I2C operation not supported" +#~ msgstr "I2C-operation nicht unterstützt" + #~ msgid "Invalid bit clock pin" #~ msgstr "Ungültiges bit clock pin" @@ -3709,12 +3694,18 @@ msgstr "Nullschritt" #~ "Sie laufen im abgesicherten Modus, was bedeutet, dass etwas Unerwartetes " #~ "passiert ist.\n" +#~ msgid "bits must be 8" +#~ msgstr "bits müssen 8 sein" + #~ msgid "buf is too small. need %d bytes" #~ msgstr "buf ist zu klein. brauche %d Bytes" #~ msgid "buffer too long" #~ msgstr "Buffer zu lang" +#~ msgid "buffers must be the same length" +#~ msgstr "Buffer müssen gleich lang sein" + #~ msgid "byteorder is not an instance of ByteOrder (got a %s)" #~ msgstr "byteorder ist keine Instanz von ByteOrder (%s erhalten)" @@ -3730,6 +3721,9 @@ msgstr "Nullschritt" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "Erstes Bit muss das höchstwertigste Bit (MSB) sein" + #~ msgid "flash location must be below 1MByte" #~ msgstr "flash location muss unter 1MByte sein" @@ -3742,6 +3736,12 @@ msgstr "Nullschritt" #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "Das Interval ist nicht im Bereich 0.0020 bis 10.24" +#~ msgid "invalid I2C peripheral" +#~ msgstr "ungültige I2C Schnittstelle" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "ungültige SPI Schnittstelle" + #~ msgid "invalid alarm" #~ msgstr "ungültiger Alarm" @@ -3764,6 +3764,9 @@ msgstr "Nullschritt" #~ msgstr "" #~ "Speicherallozierung fehlgeschlagen, alloziere %u Bytes für nativen Code" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "sck/mosi/miso müssen alle spezifiziert sein" + #~ msgid "name must be a string" #~ msgstr "name muss ein String sein" diff --git a/locale/en_US.po b/locale/en_US.po index 579fc6501e..c89772779e 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -291,6 +291,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -298,7 +299,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "" @@ -572,6 +573,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -817,10 +822,6 @@ msgstr "" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -962,7 +963,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1425,6 +1426,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1611,6 +1616,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" @@ -1652,6 +1658,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +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 "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -1700,11 +1726,11 @@ msgstr "" msgid "address %08x is not aligned to %d bytes" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1785,10 +1811,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1814,10 +1836,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1893,7 +1911,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2247,10 +2265,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2435,14 +2449,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "" @@ -2619,10 +2625,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -3059,6 +3061,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3212,6 +3218,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 0f1bf91057..16f2b3669a 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-03-30 22:11+0000\n" "Last-Translator: Tannewt \n" "Language: en_x_pirate\n" @@ -296,6 +296,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -303,7 +304,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "" @@ -579,6 +580,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -824,10 +829,6 @@ msgstr "" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -969,7 +970,7 @@ msgstr "Belay that! Invalid pin for starboard-side channel" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1432,6 +1433,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1618,6 +1623,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" @@ -1659,6 +1665,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "Blimey! Yer code filename has two extensions\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +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 "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -1707,11 +1733,11 @@ msgstr "" msgid "address %08x is not aligned to %d bytes" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1792,10 +1818,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "pieces must be of 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1821,10 +1843,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "yer buffers must be of the same length" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1900,7 +1918,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2254,10 +2272,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2442,14 +2456,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "Belay that! I2C peripheral be invalid" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "Arr! SPI peripheral be invalid" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "" @@ -2626,10 +2632,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -3066,6 +3068,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3219,6 +3225,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" @@ -3281,3 +3291,15 @@ msgstr "" #~ msgid "Invalid clock pin" #~ msgstr "Avast! Clock pin be invalid" + +#~ msgid "bits must be 8" +#~ msgstr "pieces must be of 8" + +#~ msgid "buffers must be the same length" +#~ msgstr "yer buffers must be of the same length" + +#~ msgid "invalid I2C peripheral" +#~ msgstr "Belay that! I2C peripheral be invalid" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "Arr! SPI peripheral be invalid" diff --git a/locale/es.po b/locale/es.po index 013750e931..22597249bd 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-24 18:32+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -302,6 +302,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "Todos los timers para este pin están siendo utilizados" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -309,7 +310,7 @@ msgstr "Todos los timers para este pin están siendo utilizados" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Todos los timers en uso" @@ -589,6 +590,10 @@ msgstr "Archivo .mpy corrupto" msgid "Corrupt raw code" msgstr "Código crudo corrupto" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "No se puede inicializar la UART" @@ -835,10 +840,6 @@ msgstr "Operación I/O en archivo cerrado" msgid "I2C Init Error" msgstr "Error de inicio de I2C" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "operación I2C no soportada" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -982,7 +983,7 @@ msgstr "Pin inválido para canal derecho" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1452,6 +1453,10 @@ msgstr "A Stream le falta el método readinto() o write()." msgid "Supply at least one UART pin" msgstr "Suministre al menos un pin UART" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "Lectura de temperatura expirada" @@ -1640,6 +1645,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Baudrate no soportado" @@ -1756,11 +1762,11 @@ msgstr "se llamó abort()" msgid "address %08x is not aligned to %d bytes" msgstr "la dirección %08x no esta alineada a %d bytes" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "address fuera de límites" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "addresses esta vacío" @@ -1841,10 +1847,6 @@ msgstr "operacion binaria %q no implementada" msgid "bits must be 7, 8 or 9" msgstr "bits deben ser 7, 8 ó 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits debe ser 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample debe ser 8 ó 16" @@ -1871,10 +1873,6 @@ msgstr "Las secciones del buffer necesitan tener longitud igual" msgid "buffer too small" msgstr "buffer demasiado pequeño" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "los buffers deben de tener la misma longitud" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "los botones necesitan ser digitalio.DigitalInOut" @@ -1950,7 +1948,7 @@ msgstr "no se puede convertir el objeto '%q' a %q implícitamente" msgid "can't convert NaN to int" msgstr "no se puede convertir Nan a int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "no se puede convertir address a int" @@ -2311,10 +2309,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "primer argumento para super() debe ser de tipo" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit debe ser MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2499,14 +2493,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "periférico I2C inválido" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "periférico SPI inválido" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "argumentos inválidos" @@ -2686,10 +2672,6 @@ msgstr "herencia multiple no soportada" msgid "must raise an object" msgstr "debe hacer un raise de un objeto" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "se deben de especificar sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "debe utilizar argumento de palabra clave para la función clave" @@ -3526,6 +3508,9 @@ msgstr "paso cero" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 no soporta pull up." +#~ msgid "I2C operation not supported" +#~ msgstr "operación I2C no soportada" + #~ msgid "Invalid bit clock pin" #~ msgstr "Pin bit clock inválido" @@ -3695,12 +3680,18 @@ msgstr "paso cero" #~ msgid "bad GATT role" #~ msgstr "mal GATT role" +#~ msgid "bits must be 8" +#~ msgstr "bits debe ser 8" + #~ msgid "buf is too small. need %d bytes" #~ msgstr "buf es demasiado pequeño. necesita %d bytes" #~ msgid "buffer too long" #~ msgstr "buffer demasiado largo" +#~ msgid "buffers must be the same length" +#~ msgstr "los buffers deben de tener la misma longitud" + #~ msgid "byteorder is not an instance of ByteOrder (got a %s)" #~ msgstr "byteorder no es instancia de ByteOrder (encontarmos un %s)" @@ -3737,6 +3728,9 @@ msgstr "paso cero" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit debe ser MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "la ubicación de la flash debe estar debajo de 1MByte" @@ -3749,6 +3743,12 @@ msgstr "paso cero" #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "El intervalo está fuera del rango de 0.0020 a 10.24" +#~ msgid "invalid I2C peripheral" +#~ msgstr "periférico I2C inválido" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "periférico SPI inválido" + #~ msgid "invalid alarm" #~ msgstr "alarma inválida" @@ -3771,6 +3771,9 @@ msgstr "paso cero" #~ msgstr "" #~ "falló la asignación de memoria, asignando %u bytes para código nativo" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "se deben de especificar sck/mosi/miso" + #~ msgid "name must be a string" #~ msgstr "name debe de ser un string" diff --git a/locale/fil.po b/locale/fil.po index 66ccc711ac..e4c5678d27 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -295,6 +295,7 @@ msgstr "Lahat ng sync event channels ay ginagamit" msgid "All timers for this pin are in use" msgstr "Lahat ng timers para sa pin na ito ay ginagamit" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -302,7 +303,7 @@ msgstr "Lahat ng timers para sa pin na ito ay ginagamit" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Lahat ng timer ginagamit" @@ -581,6 +582,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Hindi ma-initialize ang UART" @@ -831,10 +836,6 @@ msgstr "I/O operasyon sa saradong file" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "Hindi supportado ang operasyong I2C" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -978,7 +979,7 @@ msgstr "Mali ang pin para sa kanang channel" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1448,6 +1449,10 @@ msgstr "Stream kulang ng readinto() o write() method." msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1635,6 +1640,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Hindi supportadong baudrate" @@ -1753,11 +1759,11 @@ msgstr "abort() tinawag" msgid "address %08x is not aligned to %d bytes" msgstr "address %08x ay hindi pantay sa %d bytes" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "wala sa sakop ang address" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "walang laman ang address" @@ -1838,10 +1844,6 @@ msgstr "binary op %q hindi implemented" msgid "bits must be 7, 8 or 9" msgstr "bits ay dapat 7, 8 o 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits ay dapat walo (8)" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample ay dapat 8 o 16" @@ -1868,10 +1870,6 @@ msgstr "aarehas na haba dapat ang buffer slices" msgid "buffer too small" msgstr "masyadong maliit ang buffer" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "ang buffers ay dapat parehas sa haba" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1948,7 +1946,7 @@ msgstr "hindi maaaring i-convert ang '%q' na bagay sa %q nang walang pahiwatig" msgid "can't convert NaN to int" msgstr "hindi ma i-convert NaN sa int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "hindi ma i-convert ang address sa INT" @@ -2312,10 +2310,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "unang argument ng super() ay dapat type" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit ay dapat MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2501,14 +2495,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "maling I2C peripheral" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "hindi wastong SPI peripheral" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "mali ang mga argumento" @@ -2689,10 +2675,6 @@ msgstr "maraming inhertance hindi sinusuportahan" msgid "must raise an object" msgstr "dapat itaas ang isang object" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "dapat tukuyin lahat ng SCK/MOSI/MISO" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "dapat gumamit ng keyword argument para sa key function" @@ -3506,6 +3488,9 @@ msgstr "zero step" #~ msgid "GPIO16 does not support pull up." #~ msgstr "Walang pull down support ang GPI016." +#~ msgid "I2C operation not supported" +#~ msgstr "Hindi supportado ang operasyong I2C" + #~ msgid "Invalid bit clock pin" #~ msgstr "Mali ang bit clock pin" @@ -3647,9 +3632,15 @@ msgstr "zero step" #~ msgid "[addrinfo error %d]" #~ msgstr "[addrinfo error %d]" +#~ msgid "bits must be 8" +#~ msgstr "bits ay dapat walo (8)" + #~ msgid "buffer too long" #~ msgstr "masyadong mahaba ng buffer" +#~ msgid "buffers must be the same length" +#~ msgstr "ang buffers ay dapat parehas sa haba" + #~ msgid "can query only one param" #~ msgstr "maaaring i-query lamang ang isang param" @@ -3680,6 +3671,9 @@ msgstr "zero step" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit ay dapat MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "dapat na mas mababa sa 1MB ang lokasyon ng flash" @@ -3689,6 +3683,12 @@ msgstr "zero step" #~ msgid "impossible baudrate" #~ msgstr "impossibleng baudrate" +#~ msgid "invalid I2C peripheral" +#~ msgstr "maling I2C peripheral" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "hindi wastong SPI peripheral" + #~ msgid "invalid alarm" #~ msgstr "mali ang alarm" @@ -3711,6 +3711,9 @@ msgstr "zero step" #~ msgstr "" #~ "nabigo ang paglalaan ng memorya, naglalaan ng %u bytes para sa native code" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "dapat tukuyin lahat ng SCK/MOSI/MISO" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "ang keywords dapat strings" diff --git a/locale/fr.po b/locale/fr.po index 20d42d49e0..5a49fd5f91 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" "Language: fr\n" @@ -302,6 +302,7 @@ msgstr "Tous les canaux d'événements de synchro sont utilisés" msgid "All timers for this pin are in use" msgstr "Tous les timers pour cette broche sont utilisés" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -309,7 +310,7 @@ msgstr "Tous les timers pour cette broche sont utilisés" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Tous les timers sont utilisés" @@ -597,6 +598,10 @@ msgstr "Fichier .mpy corrompu" msgid "Corrupt raw code" msgstr "Code brut corrompu" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "L'UART n'a pu être initialisé" @@ -844,10 +849,6 @@ msgstr "opération d'E/S sur un fichier fermé" msgid "I2C Init Error" msgstr "Erreur d'initialisation I2C" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "opération sur I2C non supportée" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -991,7 +992,7 @@ msgstr "Broche invalide pour le canal droit" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1467,6 +1468,10 @@ msgstr "Il manque une méthode readinto() ou write() au flux." msgid "Supply at least one UART pin" msgstr "Fournissez au moins une broche UART" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "Temporisation de lecture dépassée" @@ -1669,6 +1674,7 @@ msgstr "" "appareil ait été refusée ou ignorée." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Débit non supporté" @@ -1788,11 +1794,11 @@ msgstr "abort() appelé" msgid "address %08x is not aligned to %d bytes" msgstr "l'adresse %08x n'est pas alignée sur %d octets" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "adresse hors limites" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "adresses vides" @@ -1873,10 +1879,6 @@ msgstr "opération binaire '%q' non implémentée" msgid "bits must be 7, 8 or 9" msgstr "bits doivent être 7, 8 ou 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "les bits doivent être 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "'bits_per_sample' doivent être 8 ou 16" @@ -1902,10 +1904,6 @@ msgstr "les tranches de tampon doivent être de longueurs égales" msgid "buffer too small" msgstr "tampon trop petit" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "les tampons doivent être de la même longueur" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "les boutons doivent être des digitalio.DigitalInOut" @@ -1982,7 +1980,7 @@ msgstr "impossible de convertir l'objet '%q' en '%q' implicitement" msgid "can't convert NaN to int" msgstr "on ne peut convertir NaN en entier 'int'" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "ne peut convertir l'adresse en entier 'int'" @@ -2351,10 +2349,6 @@ msgstr "le premier argument doit être un ndarray" msgid "first argument to super() must be type" msgstr "le premier argument de super() doit être un type" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "le 1er bit doit être le MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "l'ordre d'aplatissement doit être «C» ou «F»" @@ -2541,14 +2535,6 @@ msgstr "interp est défini pour les tableaux 1D de longueur égale" msgid "interval must be in range %s-%s" msgstr "l'intervalle doit être dans la plage %s-%s" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "périphérique I2C invalide" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "périphérique SPI invalide" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "arguments invalides" @@ -2729,10 +2715,6 @@ msgstr "héritages multiples non supportés" msgid "must raise an object" msgstr "doit lever un objet" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "sck, mosi et miso doivent tous être spécifiés" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "doit utiliser un argument nommé pour une fonction key" @@ -3579,6 +3561,9 @@ msgstr "'step' nul" #~ msgid "GPIO16 does not support pull up." #~ msgstr "Le GPIO16 ne supporte pas le tirage (pull-up)" +#~ msgid "I2C operation not supported" +#~ msgstr "opération sur I2C non supportée" + #~ msgid "Invalid bit clock pin" #~ msgstr "Broche invalide pour 'bit clock'" @@ -3748,12 +3733,18 @@ msgstr "'step' nul" #~ msgid "bad GATT role" #~ msgstr "mauvais rôle GATT" +#~ msgid "bits must be 8" +#~ msgstr "les bits doivent être 8" + #~ msgid "buf is too small. need %d bytes" #~ msgstr "'buf' est trop petit. Besoin de %d octets" #~ msgid "buffer too long" #~ msgstr "tampon trop long" +#~ msgid "buffers must be the same length" +#~ msgstr "les tampons doivent être de la même longueur" + #~ msgid "byteorder is not an instance of ByteOrder (got a %s)" #~ msgstr "'byteorder' n'est pas une instance de ByteOrder (reçu un %s)" @@ -3792,6 +3783,9 @@ msgstr "'step' nul" #~ msgid "expecting a pin" #~ msgstr "une broche (Pin) est attendue" +#~ msgid "firstbit must be MSB" +#~ msgstr "le 1er bit doit être le MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "l'emplacement en mémoire flash doit être inférieur à 1Mo" @@ -3804,6 +3798,12 @@ msgstr "'step' nul" #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "intervalle hors bornes 0.0020 à 10.24" +#~ msgid "invalid I2C peripheral" +#~ msgstr "périphérique I2C invalide" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "périphérique SPI invalide" + #~ msgid "invalid alarm" #~ msgstr "alarme invalide" @@ -3826,6 +3826,9 @@ msgstr "'step' nul" #~ msgstr "" #~ "l'allocation de mémoire a échoué en allouant %u octets pour un code natif" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "sck, mosi et miso doivent tous être spécifiés" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "les noms doivent être des chaînes de caractère" diff --git a/locale/it_IT.po b/locale/it_IT.po index 01368e88a8..c47d0e8e3e 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -294,6 +294,7 @@ msgstr "Tutti i canali di eventi sincronizzati in uso" msgid "All timers for this pin are in use" msgstr "Tutti i timer per questo pin sono in uso" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -301,7 +302,7 @@ msgstr "Tutti i timer per questo pin sono in uso" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Tutti i timer utilizzati" @@ -582,6 +583,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Impossibile inizializzare l'UART" @@ -831,10 +836,6 @@ msgstr "operazione I/O su file chiuso" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "operazione I2C non supportata" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -980,7 +981,7 @@ msgstr "Pin non valido per il canale destro" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1459,6 +1460,10 @@ msgstr "Metodi mancanti readinto() o write() allo stream." msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1646,6 +1651,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "baudrate non supportato" @@ -1756,11 +1762,11 @@ msgstr "abort() chiamato" msgid "address %08x is not aligned to %d bytes" msgstr "l'indirizzo %08x non è allineato a %d bytes" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "indirizzo fuori limite" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "gli indirizzi sono vuoti" @@ -1841,10 +1847,6 @@ msgstr "operazione binaria %q non implementata" msgid "bits must be 7, 8 or 9" msgstr "i bit devono essere 7, 8 o 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "i bit devono essere 8" - #: shared-bindings/audiomixer/Mixer.c #, fuzzy msgid "bits_per_sample must be 8 or 16" @@ -1873,10 +1875,6 @@ msgstr "slice del buffer devono essere della stessa lunghezza" msgid "buffer too small" msgstr "buffer troppo piccolo" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "i buffer devono essere della stessa lunghezza" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1953,7 +1951,7 @@ msgstr "impossibile convertire l'oggetto '%q' implicitamente in %q" msgid "can't convert NaN to int" msgstr "impossibile convertire NaN in int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "impossible convertire indirizzo in int" @@ -2313,10 +2311,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "il primo bit deve essere il più significativo (MSB)" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2502,14 +2496,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "periferica I2C invalida" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "periferica SPI invalida" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "argomenti non validi" @@ -2691,10 +2677,6 @@ msgstr "ereditarietà multipla non supportata" msgid "must raise an object" msgstr "deve lanciare un oggetto" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "è necessario specificare tutte le sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -3529,6 +3511,9 @@ msgstr "zero step" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 non supporta pull-up" +#~ msgid "I2C operation not supported" +#~ msgstr "operazione I2C non supportata" + #~ msgid "Invalid bit clock pin" #~ msgstr "Pin del clock di bit non valido" @@ -3636,9 +3621,15 @@ msgstr "zero step" #~ msgid "[addrinfo error %d]" #~ msgstr "[errore addrinfo %d]" +#~ msgid "bits must be 8" +#~ msgstr "i bit devono essere 8" + #~ msgid "buffer too long" #~ msgstr "buffer troppo lungo" +#~ msgid "buffers must be the same length" +#~ msgstr "i buffer devono essere della stessa lunghezza" + #~ msgid "can query only one param" #~ msgstr "è possibile interrogare solo un parametro" @@ -3669,6 +3660,9 @@ msgstr "zero step" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "il primo bit deve essere il più significativo (MSB)" + #~ msgid "flash location must be below 1MByte" #~ msgstr "Locazione della flash deve essere inferiore a 1mb" @@ -3678,6 +3672,12 @@ msgstr "zero step" #~ msgid "impossible baudrate" #~ msgstr "baudrate impossibile" +#~ msgid "invalid I2C peripheral" +#~ msgstr "periferica I2C invalida" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "periferica SPI invalida" + #~ msgid "invalid alarm" #~ msgstr "alarm non valido" @@ -3700,6 +3700,9 @@ msgstr "zero step" #~ msgstr "" #~ "allocazione di memoria fallita, allocazione di %d byte per codice nativo" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "è necessario specificare tutte le sck/mosi/miso" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "argomenti nominati devono essere stringhe" diff --git a/locale/ko.po b/locale/ko.po index 27f8216f83..156f40d9b6 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -293,6 +293,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "핀의 모든 타이머가 사용 중입니다" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -300,7 +301,7 @@ msgstr "핀의 모든 타이머가 사용 중입니다" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "모든 타이머가 사용 중입니다" @@ -576,6 +577,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -821,10 +826,6 @@ msgstr "" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -966,7 +967,7 @@ msgstr "오른쪽 채널 핀이 잘못되었습니다" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1429,6 +1430,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1616,6 +1621,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" @@ -1725,11 +1731,11 @@ msgstr "" msgid "address %08x is not aligned to %d bytes" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1810,10 +1816,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "비트(bits)는 7, 8 또는 9 여야합니다" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "비트(bits)는 8이어야합니다" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample은 8 또는 16이어야합니다." @@ -1839,10 +1841,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1918,7 +1916,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2272,10 +2270,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2460,14 +2454,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "ICT주변 기기가 유효하지 않습니다" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "SPI주변 기기가 유효하지 않습니다" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "" @@ -2644,10 +2630,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -3319,3 +3301,12 @@ msgstr "" #~ msgid "Failed to continue scanning, err 0x%04x" #~ msgstr "스캔을 계속할 수 없습니다, 오류 0x%04x" + +#~ msgid "bits must be 8" +#~ msgstr "비트(bits)는 8이어야합니다" + +#~ msgid "invalid I2C peripheral" +#~ msgstr "ICT주변 기기가 유효하지 않습니다" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "SPI주변 기기가 유효하지 않습니다" diff --git a/locale/nl.po b/locale/nl.po index 5be371d83f..77cc11cab3 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-02 19:50+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -299,6 +299,7 @@ msgstr "Alle sync event kanalen zijn in gebruik" msgid "All timers for this pin are in use" msgstr "Alle timers voor deze pin zijn in gebruik" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -306,7 +307,7 @@ msgstr "Alle timers voor deze pin zijn in gebruik" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Alle timers zijn in gebruik" @@ -588,6 +589,10 @@ msgstr "Corrupt .mpy bestand" msgid "Corrupt raw code" msgstr "Corrupt raw code" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Kan UART niet initialiseren" @@ -835,10 +840,6 @@ msgstr "I/O actie op gesloten bestand" msgid "I2C Init Error" msgstr "I2C Init Fout" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "I2C actie niet ondersteund" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -982,7 +983,7 @@ msgstr "Ongeldige pin voor rechter kanaal" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1459,6 +1460,10 @@ msgstr "Stream mist readinto() of write() methode." msgid "Supply at least one UART pin" msgstr "Geef op zijn minst 1 UART pin op" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "Temperatuur lees time-out" @@ -1655,6 +1660,7 @@ msgstr "" "apparaat geweigerd of genegeerd werd." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Niet-ondersteunde baudsnelheid" @@ -1773,11 +1779,11 @@ msgstr "abort() aangeroepen" msgid "address %08x is not aligned to %d bytes" msgstr "adres %08x is niet afgestemd op %d bytes" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "adres buiten bereik" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "adressen zijn leeg" @@ -1858,10 +1864,6 @@ msgstr "binaire op %q niet geïmplementeerd" msgid "bits must be 7, 8 or 9" msgstr "bits moet 7, 8, of 9 zijn" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits moet 8 zijn" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample moet 8 of 16 zijn" @@ -1887,10 +1889,6 @@ msgstr "buffer slices moeten van gelijke grootte zijn" msgid "buffer too small" msgstr "buffer te klein" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "buffers moeten dezelfde lengte hebben" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "buttons moeten digitalio.DigitalInOut zijn" @@ -1967,7 +1965,7 @@ msgstr "kan '%q' object niet omzetten naar %q impliciet" msgid "can't convert NaN to int" msgstr "kan NaN niet omzetten naar int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "kan adres niet omzetten naar int" @@ -2324,10 +2322,6 @@ msgstr "eerst argument moet een ndarray zijn" msgid "first argument to super() must be type" msgstr "eerste argument voor super() moet een type zijn" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "het eerste bit moet het MSB zijn" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "De afvlakkingsvolgorde moet ofwel \"C\", ofwel \"F\" zijn" @@ -2513,14 +2507,6 @@ msgstr "interp is gedefinieerd for eendimensionale arrays van gelijke lengte" msgid "interval must be in range %s-%s" msgstr "interval moet binnen bereik %s-%s vallen" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "onjuist I2C randapparaat" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "onjuist SPI randapparaat" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "ongeldige argumenten" @@ -2700,10 +2686,6 @@ msgstr "meervoudige overerving niet ondersteund" msgid "must raise an object" msgstr "moet een object oproepen (raise)" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "sck/mosi/miso moeten alle gespecificeerd worden" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "voor sleutelfunctie moet een trefwoordargument gebruikt worden" @@ -3352,5 +3334,26 @@ msgstr "y-waarde buiten bereik" msgid "zero step" msgstr "nul-stap" +#~ msgid "I2C operation not supported" +#~ msgstr "I2C actie niet ondersteund" + #~ msgid "Negative step not supported" #~ msgstr "Negatieve stappen niet ondersteund" + +#~ msgid "bits must be 8" +#~ msgstr "bits moet 8 zijn" + +#~ msgid "buffers must be the same length" +#~ msgstr "buffers moeten dezelfde lengte hebben" + +#~ msgid "firstbit must be MSB" +#~ msgstr "het eerste bit moet het MSB zijn" + +#~ msgid "invalid I2C peripheral" +#~ msgstr "onjuist I2C randapparaat" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "onjuist SPI randapparaat" + +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "sck/mosi/miso moeten alle gespecificeerd worden" diff --git a/locale/pl.po b/locale/pl.po index 0e82359f9b..888ce64285 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -292,6 +292,7 @@ msgstr "Wszystkie kanały zdarzeń synchronizacji w użyciu" msgid "All timers for this pin are in use" msgstr "Wszystkie timery tej nóżki w użyciu" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -299,7 +300,7 @@ msgstr "Wszystkie timery tej nóżki w użyciu" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Wszystkie timery w użyciu" @@ -575,6 +576,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Ustawienie UART nie powiodło się" @@ -820,10 +825,6 @@ msgstr "Operacja I/O na zamkniętym pliku" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "Operacja I2C nieobsługiwana" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -967,7 +968,7 @@ msgstr "Zła nóżka dla prawego kanału" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1430,6 +1431,10 @@ msgstr "Strumień nie ma metod readinto() lub write()." msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1616,6 +1621,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Zła szybkość transmisji" @@ -1728,11 +1734,11 @@ msgstr "Wywołano abort()" msgid "address %08x is not aligned to %d bytes" msgstr "adres %08x nie jest wyrównany do %d bajtów" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "adres poza zakresem" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "adres jest pusty" @@ -1813,10 +1819,6 @@ msgstr "brak dwu-argumentowego operatora %q" msgid "bits must be 7, 8 or 9" msgstr "bits musi być 7, 8 lub 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits musi być 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample musi być 8 lub 16" @@ -1842,10 +1844,6 @@ msgstr "fragmenty bufora muszą mieć tę samą długość" msgid "buffer too small" msgstr "zbyt mały bufor" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "bufory muszą mieć tę samą długość" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "buttons musi być digitalio.DigitalInOut" @@ -1921,7 +1919,7 @@ msgstr "nie można automatycznie skonwertować '%q' do '%q'" msgid "can't convert NaN to int" msgstr "nie można skonwertować NaN do int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "nie można skonwertować adresu do int" @@ -2276,10 +2274,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "pierwszy argument super() musi być typem" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit musi być MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2464,14 +2458,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "złe I2C" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "złe SPI" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "złe arguemnty" @@ -2648,10 +2634,6 @@ msgstr "wielokrotne dziedzicznie niewspierane" msgid "must raise an object" msgstr "wyjątek musi być obiektem" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "sck/mosi/miso muszą być podane" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "funkcja key musi być podana jako argument nazwany" @@ -3426,6 +3408,9 @@ msgstr "zerowy krok" #~ msgid "Flash write failed to start, err 0x%04x" #~ msgstr "Nie udało się rozpocząć zapisu do flash, błąd 0x%04x" +#~ msgid "I2C operation not supported" +#~ msgstr "Operacja I2C nieobsługiwana" + #~ msgid "Invalid bit clock pin" #~ msgstr "Zła nóżka zegara" @@ -3523,9 +3508,15 @@ msgstr "zerowy krok" #~ msgid "bad GATT role" #~ msgstr "zła rola GATT" +#~ msgid "bits must be 8" +#~ msgstr "bits musi być 8" + #~ msgid "buf is too small. need %d bytes" #~ msgstr "buf zbyt mały. Wymagane %d bajtów" +#~ msgid "buffers must be the same length" +#~ msgstr "bufory muszą mieć tę samą długość" + #~ msgid "byteorder is not an instance of ByteOrder (got a %s)" #~ msgstr "byteorder musi być typu ByteOrder (jest %s)" @@ -3536,9 +3527,21 @@ msgstr "zerowy krok" #~ msgid "color buffer must be a buffer or int" #~ msgstr "bufor kolorów musi być typu buffer lub int" +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit musi być MSB" + #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "przedział poza zakresem 0.0020 do 10.24" +#~ msgid "invalid I2C peripheral" +#~ msgstr "złe I2C" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "złe SPI" + +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "sck/mosi/miso muszą być podane" + #~ msgid "name must be a string" #~ msgstr "nazwa musi być łańcuchem" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 308809a2be..e951df1080 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -294,6 +294,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "Todos os temporizadores para este pino estão em uso" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -301,7 +302,7 @@ msgstr "Todos os temporizadores para este pino estão em uso" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Todos os temporizadores em uso" @@ -578,6 +579,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Não foi possível inicializar o UART" @@ -826,10 +831,6 @@ msgstr "Operação I/O no arquivo fechado" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "I2C operação não suportada" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -973,7 +974,7 @@ msgstr "Pino inválido para canal direito" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1442,6 +1443,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1628,6 +1633,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Taxa de transmissão não suportada" @@ -1738,11 +1744,11 @@ msgstr "abort() chamado" msgid "address %08x is not aligned to %d bytes" msgstr "endereço %08x não está alinhado com %d bytes" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1823,10 +1829,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits devem ser 8" - #: shared-bindings/audiomixer/Mixer.c #, fuzzy msgid "bits_per_sample must be 8 or 16" @@ -1855,10 +1857,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "buffers devem ser o mesmo tamanho" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1934,7 +1932,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2289,10 +2287,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit devem ser MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2477,14 +2471,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "periférico I2C inválido" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "periférico SPI inválido" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "argumentos inválidos" @@ -2661,10 +2647,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "deve especificar todos sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -3439,6 +3421,9 @@ msgstr "passo zero" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 não suporta pull up." +#~ msgid "I2C operation not supported" +#~ msgstr "I2C operação não suportada" + #~ msgid "Invalid bit clock pin" #~ msgstr "Pino de bit clock inválido" @@ -3512,9 +3497,15 @@ msgstr "passo zero" #~ msgid "Use esptool to erase flash and re-upload Python instead" #~ msgstr "Use o esptool para apagar o flash e recarregar o Python" +#~ msgid "bits must be 8" +#~ msgstr "bits devem ser 8" + #~ msgid "buffer too long" #~ msgstr "buffer muito longo" +#~ msgid "buffers must be the same length" +#~ msgstr "buffers devem ser o mesmo tamanho" + #~ msgid "can query only one param" #~ msgstr "pode consultar apenas um parâmetro" @@ -3539,6 +3530,9 @@ msgstr "passo zero" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit devem ser MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "o local do flash deve estar abaixo de 1 MByte" @@ -3548,6 +3542,12 @@ msgstr "passo zero" #~ msgid "impossible baudrate" #~ msgstr "taxa de transmissão impossível" +#~ msgid "invalid I2C peripheral" +#~ msgstr "periférico I2C inválido" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "periférico SPI inválido" + #~ msgid "invalid alarm" #~ msgstr "Alarme inválido" @@ -3569,6 +3569,9 @@ msgstr "passo zero" #~ msgid "memory allocation failed, allocating %u bytes for native code" #~ msgstr "alocação de memória falhou, alocando %u bytes para código nativo" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "deve especificar todos sck/mosi/miso" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "heap deve ser uma lista" diff --git a/locale/sv.po b/locale/sv.po index bf9bb3f5d9..df2431c4e0 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-03 18:59+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -299,6 +299,7 @@ msgstr "Alla händelsekanaler används" msgid "All timers for this pin are in use" msgstr "Alla timers för denna pinne är i bruk" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -306,7 +307,7 @@ msgstr "Alla timers för denna pinne är i bruk" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Alla timers används" @@ -588,6 +589,10 @@ msgstr "Skadad .mpy-fil" msgid "Corrupt raw code" msgstr "Korrupt rå kod" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Det gick inte att initiera UART" @@ -833,10 +838,6 @@ msgstr "I/O-operation på stängd fil" msgid "I2C Init Error" msgstr "I2C init-fel" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "I2C-åtgärd stöds inte" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -980,7 +981,7 @@ msgstr "Ogiltig pinne för höger kanal" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1455,6 +1456,10 @@ msgstr "Stream saknar readinto() eller write() metod." msgid "Supply at least one UART pin" msgstr "Ange minst en UART-pinne" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "Temperaturavläsning tog för lång tid" @@ -1651,6 +1656,7 @@ msgstr "" "eller ignorerades." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Baudrate stöd inte" @@ -1766,11 +1772,11 @@ msgstr "abort() anropad" msgid "address %08x is not aligned to %d bytes" msgstr "adressen %08x är inte justerad till %d byte" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "adress utanför gränsen" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "adresserna är tomma" @@ -1851,10 +1857,6 @@ msgstr "binär op %q är inte implementerad" msgid "bits must be 7, 8 or 9" msgstr "bits måste vara 7, 8 eller 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits måste vara 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample måste vara 8 eller 16" @@ -1880,10 +1882,6 @@ msgstr "buffertsegmenten måste vara lika långa" msgid "buffer too small" msgstr "buffert för liten" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "buffertar måste vara samma längd" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "buttons måste vara digitalio.DigitalInOut" @@ -1959,7 +1957,7 @@ msgstr "kan inte konvertera '%q' objekt implicit till %q" msgid "can't convert NaN to int" msgstr "kan inte konvertera NaN till int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "kan inte konvertera address till int" @@ -2318,10 +2316,6 @@ msgstr "första argumentet måste vara en ndarray" msgid "first argument to super() must be type" msgstr "första argumentet till super() måste vara typ" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit måste vara MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "förenklingsordningen måste vara antingen \"C\" eller \"F\"" @@ -2506,14 +2500,6 @@ msgstr "interp är definierad för 1D-matriser med samma längd" msgid "interval must be in range %s-%s" msgstr "interval måste vara i intervallet %s-%s" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "ogiltig I2C-kringutrustning" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "ogiltig SPI-kringutrustning" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "ogiltiga argument" @@ -2693,10 +2679,6 @@ msgstr "multipelt arv stöds inte" msgid "must raise an object" msgstr "måste ge ett objekt" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "måste ange alla av sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "måste använda nyckelordsargument för nyckelfunktion" @@ -3345,8 +3327,29 @@ msgstr "y-värde utanför intervall" msgid "zero step" msgstr "noll steg" +#~ msgid "I2C operation not supported" +#~ msgstr "I2C-åtgärd stöds inte" + #~ msgid "Negative step not supported" #~ msgstr "Negativt step stöds inte" +#~ msgid "bits must be 8" +#~ msgstr "bits måste vara 8" + +#~ msgid "buffers must be the same length" +#~ msgstr "buffertar måste vara samma längd" + #~ msgid "empty %q list" #~ msgstr "tom %q-lista" + +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit måste vara MSB" + +#~ msgid "invalid I2C peripheral" +#~ msgstr "ogiltig I2C-kringutrustning" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "ogiltig SPI-kringutrustning" + +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "måste ange alla av sck/mosi/miso" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 9f44fbd9ef..4f85c5fa86 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -298,6 +298,7 @@ msgstr "Suǒyǒu tóngbù shìjiàn píndào shǐyòng" msgid "All timers for this pin are in use" msgstr "Cǐ yǐn jiǎo de suǒyǒu jìshí qì zhèngzài shǐyòng" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -305,7 +306,7 @@ msgstr "Cǐ yǐn jiǎo de suǒyǒu jìshí qì zhèngzài shǐyòng" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Suǒyǒu jìshí qì shǐyòng" @@ -583,6 +584,10 @@ msgstr "Fǔbài de .mpy wénjiàn" msgid "Corrupt raw code" msgstr "Sǔnhuài de yuánshǐ dàimǎ" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Wúfǎ chūshǐhuà UART" @@ -828,10 +833,6 @@ msgstr "Wénjiàn shàng de I/ O cāozuò" msgid "I2C Init Error" msgstr "I2C chūshǐhuà cuòwù" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "I2C cāozuò bù zhīchí" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -975,7 +976,7 @@ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1444,6 +1445,10 @@ msgstr "Liú quēshǎo readinto() huò write() fāngfǎ." msgid "Supply at least one UART pin" msgstr "Dìngyì zhìshǎo yīgè UART yǐn jiǎo" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1639,6 +1644,7 @@ msgstr "" "huò hūlüè." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Bù zhīchí de baudrate" @@ -1753,11 +1759,11 @@ msgstr "zhōngzhǐ () diàoyòng" msgid "address %08x is not aligned to %d bytes" msgstr "wèi zhǐ %08x wèi yǔ %d wèi yuán zǔ duìqí" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "dìzhǐ chāochū biānjiè" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "dìzhǐ wèi kōng" @@ -1838,10 +1844,6 @@ msgstr "èrjìnzhì bǎn qián bǎn %q wèi zhíxíng" msgid "bits must be 7, 8 or 9" msgstr "bǐtè bìxū shì 7,8 huò 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bǐtè bìxū shì 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "měi jiàn yàngběn bìxū wèi 8 huò 16" @@ -1867,10 +1869,6 @@ msgstr "huǎnchōng qū qiēpiàn bìxū chángdù xiāngděng" msgid "buffer too small" msgstr "huǎnchōng qū tài xiǎo" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "huǎnchōng qū bìxū shì chángdù xiāngtóng" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "ànniǔ bìxū shì digitalio.DigitalInOut" @@ -1946,7 +1944,7 @@ msgstr "wúfǎ jiāng '%q' duìxiàng zhuǎnhuàn wèi %q yǐn hán" msgid "can't convert NaN to int" msgstr "wúfǎ jiāng dǎoháng zhuǎnhuàn wèi int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "wúfǎ jiāng dìzhǐ zhuǎnhuàn wèi int" @@ -2304,10 +2302,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "chāojí () de dì yī gè cānshù bìxū shì lèixíng" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "dì yī wèi bìxū shì MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2492,14 +2486,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "Jiàngé bìxū zài %s-%s fànwéi nèi" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "wúxiào de I2C wàiwéi qì" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "wúxiào de SPI wàiwéi qì" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "wúxiào de cānshù" @@ -2677,10 +2663,6 @@ msgstr "bù zhīchí duō gè jìchéng" msgid "must raise an object" msgstr "bìxū tíchū duìxiàng" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "bìxū zhǐdìng suǒyǒu sck/mosi/misco" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "bìxū shǐyòng guānjiàn cí cānshù" @@ -3485,6 +3467,9 @@ msgstr "líng bù" #~ msgid "Flash write failed to start, err 0x%04x" #~ msgstr "Flash xiě rù shībài, err 0x%04x" +#~ msgid "I2C operation not supported" +#~ msgstr "I2C cāozuò bù zhīchí" + #~ msgid "Invalid bit clock pin" #~ msgstr "Wúxiào de wèi shízhōng yǐn jiǎo" @@ -3605,9 +3590,15 @@ msgstr "líng bù" #~ msgid "bad GATT role" #~ msgstr "zǒng xiédìng de bùliáng juésè" +#~ msgid "bits must be 8" +#~ msgstr "bǐtè bìxū shì 8" + #~ msgid "buf is too small. need %d bytes" #~ msgstr "huǎnchōng tài xiǎo. Xūyào%d zì jié" +#~ msgid "buffers must be the same length" +#~ msgstr "huǎnchōng qū bìxū shì chángdù xiāngtóng" + #~ msgid "byteorder is not an instance of ByteOrder (got a %s)" #~ msgstr "zì jié bùshì zì jié xù shílì (yǒu %s)" @@ -3620,9 +3611,21 @@ msgstr "líng bù" #~ msgid "expected a DigitalInOut" #~ msgstr "qídài de DigitalInOut" +#~ msgid "firstbit must be MSB" +#~ msgstr "dì yī wèi bìxū shì MSB" + #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "jùlí 0.0020 Zhì 10.24 Zhī jiān de jiàngé shíjiān" +#~ msgid "invalid I2C peripheral" +#~ msgstr "wúxiào de I2C wàiwéi qì" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "wúxiào de SPI wàiwéi qì" + +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "bìxū zhǐdìng suǒyǒu sck/mosi/misco" + #~ msgid "name must be a string" #~ msgstr "míngchēng bìxū shì yīgè zìfú chuàn" From 6c91af7d5601c0577e9f1909968bbb5aa2bf7b25 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 25 Jun 2020 17:27:01 -0400 Subject: [PATCH 0095/1293] WIP --- ports/stm/common-hal/pulseio/PulseOut.c | 3 - ports/stm/peripherals/timers.c | 272 ++++++++++++++++++++++++ ports/stm/peripherals/timers.h | 40 ++++ 3 files changed, 312 insertions(+), 3 deletions(-) create mode 100644 ports/stm/peripherals/timers.c create mode 100644 ports/stm/peripherals/timers.h diff --git a/ports/stm/common-hal/pulseio/PulseOut.c b/ports/stm/common-hal/pulseio/PulseOut.c index c7c879c883..c31b238304 100644 --- a/ports/stm/common-hal/pulseio/PulseOut.c +++ b/ports/stm/common-hal/pulseio/PulseOut.c @@ -81,9 +81,6 @@ STATIC void pulseout_event_handler(void) { return; //invalid interrupt } - HAL_GPIO_WritePin(pin_port(2),pin_mask(6), 1); - HAL_GPIO_WritePin(pin_port(2),pin_mask(6), 0); - pulse_array_index++; // No more pulses. Turn off output and don't restart. diff --git a/ports/stm/peripherals/timers.c b/ports/stm/peripherals/timers.c new file mode 100644 index 0000000000..81242f34b6 --- /dev/null +++ b/ports/stm/peripherals/timers.c @@ -0,0 +1,272 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland 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. + */ + +static bool stm_timer_reserved[MP_ARRAY_SIZE(mcu_tim_banks)]; +static bool stm_timer_never_reset[MP_ARRAY_SIZE(mcu_tim_banks)]; +static void *stm_timer_callback[MP_ARRAY_SIZE(mcu_tim_banks)](void); + +STATIC void tim_clock_enable(uint16_t mask); +STATIC void tim_clock_disable(uint16_t mask); + +// 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. +STATIC uint32_t timer_get_source_freq(uint32_t tim_id) { + 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; + } 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; + } + if (clk_div != 0) { + // APB prescaler for this timer is > 1 + source *= 2; + } + return source; +} + +TIM_TypeDef * stm_peripherals_find_timer(void) { + // TODO: check for unreserved timers from already claimed pins + + // Work backwards - higher index timers have fewer pin allocations + for (size_t i = MP_ARRAY_SIZE(stm_timer_reserved); i>=0; i--) { + if ((!stm_timer_reserved[i]) && (mcu_tim_banks[i] != NULL)) { + return mcu_tim_banks[i]; + } + } + mp_raise_RuntimeError(translate("All timers in use")); + return NULL; +} + +void stm_peripherals_timer_set_callback(void(*callback)(void), TIM_TypeDef * timer) { + stm_timer_callback[stm_peripherals_timer_get_index] +} + +void stm_peripherals_timer_free(TIM_TypeDef * instance) { + +} +void stm_peripherals_timer_never_reset(TIM_TypeDef * instance); +void stm_peripherals_timer_reset_ok(TIM_TypeDef * instance); +void stm_peripherals_timer_is_never_reset(TIM_TypeDef * instance); +void stm_peripherals_timer_is_reserved(TIM_TypeDef * instance); +size_t stm_peripherals_timer_get_index(TIM_TypeDef * instance); + +STATIC void tim_clock_enable(uint16_t mask) { + #ifdef TIM1 + if (mask & (1 << 0)) { + __HAL_RCC_TIM1_CLK_ENABLE(); + } + #endif + #ifdef TIM2 + if (mask & (1 << 1)) { + __HAL_RCC_TIM2_CLK_ENABLE(); + } + #endif + #ifdef TIM3 + if (mask & (1 << 2)) { + __HAL_RCC_TIM3_CLK_ENABLE(); + } + #endif + #ifdef TIM4 + if (mask & (1 << 3)) { + __HAL_RCC_TIM4_CLK_ENABLE(); + } + #endif + #ifdef TIM5 + if (mask & (1 << 4)) { + __HAL_RCC_TIM5_CLK_ENABLE(); + } + #endif + //6 and 7 are reserved ADC timers + #ifdef TIM8 + if (mask & (1 << 7)) { + __HAL_RCC_TIM8_CLK_ENABLE(); + } + #endif + #ifdef TIM9 + if (mask & (1 << 8)) { + __HAL_RCC_TIM9_CLK_ENABLE(); + } + #endif + #ifdef TIM10 + if (mask & (1 << 9)) { + __HAL_RCC_TIM10_CLK_ENABLE(); + } + #endif + #ifdef TIM11 + if (mask & (1 << 10)) { + __HAL_RCC_TIM11_CLK_ENABLE(); + } + #endif + #ifdef TIM12 + if (mask & (1 << 11)) { + __HAL_RCC_TIM12_CLK_ENABLE(); + } + #endif + #ifdef TIM13 + if (mask & (1 << 12)) { + __HAL_RCC_TIM13_CLK_ENABLE(); + } + #endif + #ifdef TIM14 + if (mask & (1 << 13)) { + __HAL_RCC_TIM14_CLK_ENABLE(); + } + #endif +} + +STATIC void tim_clock_disable(uint16_t mask) { + #ifdef TIM1 + if (mask & (1 << 0)) { + __HAL_RCC_TIM1_CLK_DISABLE(); + } + #endif + #ifdef TIM2 + if (mask & (1 << 1)) { + __HAL_RCC_TIM2_CLK_DISABLE(); + } + #endif + #ifdef TIM3 + if (mask & (1 << 2)) { + __HAL_RCC_TIM3_CLK_DISABLE(); + } + #endif + #ifdef TIM4 + if (mask & (1 << 3)) { + __HAL_RCC_TIM4_CLK_DISABLE(); + } + #endif + #ifdef TIM5 + if (mask & (1 << 4)) { + __HAL_RCC_TIM5_CLK_DISABLE(); + } + #endif + //6 and 7 are reserved ADC timers + #ifdef TIM8 + if (mask & (1 << 7)) { + __HAL_RCC_TIM8_CLK_DISABLE(); + } + #endif + #ifdef TIM9 + if (mask & (1 << 8)) { + __HAL_RCC_TIM9_CLK_DISABLE(); + } + #endif + #ifdef TIM10 + if (mask & (1 << 9)) { + __HAL_RCC_TIM10_CLK_DISABLE(); + } + #endif + #ifdef TIM11 + if (mask & (1 << 10)) { + __HAL_RCC_TIM11_CLK_DISABLE(); + } + #endif + #ifdef TIM12 + if (mask & (1 << 11)) { + __HAL_RCC_TIM12_CLK_DISABLE(); + } + #endif + #ifdef TIM13 + if (mask & (1 << 12)) { + __HAL_RCC_TIM13_CLK_DISABLE(); + } + #endif + #ifdef TIM14 + if (mask & (1 << 13)) { + __HAL_RCC_TIM14_CLK_DISABLE(); + } + #endif +} + +STATIC void callback_router(size_t index) { + if (stm_timer_callback[index]) { + (*stm_timer_callback[index])(); + } +} + +void TIM1_CC_IRQHandler(void) { // Advanced timer + callback_router(1); +} +void TIM2_IRQHandler(void) { + callback_router(2); +} +void TIM3_IRQHandler(void) { + callback_router(3); +} +void TIM4_IRQHandler(void) { + callback_router(4); +} +void TIM5_IRQHandler(void) { + callback_router(5); +} +void TIM6_DAC_IRQHandler(void) { // Basic timer (DAC) + callback_router(6); +} +void TIM7_IRQHandler(void) { // Basic timer + callback_router(7); +} +void TIM8_CC_IRQHandler(void) { // Advanced timer + callback_router(8); +} + +// Advanced timer interrupts are currently unused. +void TIM1_BRK_TIM9_IRQHandler(void) { + callback_router(9); +} +void TIM1_UP_TIM10_IRQHandler(void) { + callback_router(10); +} +void TIM1_TRG_COM_TIM11_IRQHandler(void) { + callback_router(11); +} +void TIM8_BRK_TIM12_IRQHandler(void) { + callback_router(12); +} +void TIM8_UP_TIM13_IRQHandler(void) { + callback_router(13); +} +void TIM8_TRG_COM_TIM14_IRQHandler(void) { + callback_router(14); +} + +#if (CPY_STM32H7) +void TIM15_IRQHandler(void) { + callback_router(15); +} +void TIM16_IRQHandler(void) { + callback_router(16); +} +void TIM17_IRQHandler(void) { + callback_router(17); +} +#endif diff --git a/ports/stm/peripherals/timers.h b/ports/stm/peripherals/timers.h new file mode 100644 index 0000000000..b0f594b775 --- /dev/null +++ b/ports/stm/peripherals/timers.h @@ -0,0 +1,40 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland 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. + */ + +typedef struct { + TIM_TypeDef * p_reg; + uint8_t instance_id; + uint8_t cc_channel_count; +} nrfx_timer_t; + +void timers_reset(void); +TIM_TypeDef * stm_peripherals_find_timer(void); +void stm_peripherals_timer_free(TIM_TypeDef * instance); +void stm_peripherals_timer_never_reset(TIM_TypeDef * instance); +void stm_peripherals_timer_reset_ok(TIM_TypeDef * instance); +void stm_peripherals_timer_is_never_reset(TIM_TypeDef * instance); +void stm_peripherals_timer_is_reserved(TIM_TypeDef * instance); +size_t stm_peripherals_timer_get_index(TIM_TypeDef * instance); From 0a41b86f6bbbd1333b277dd0b224ab425b57f301 Mon Sep 17 00:00:00 2001 From: Timon Date: Fri, 26 Jun 2020 01:36:03 +0200 Subject: [PATCH 0096/1293] Fix typo inserting IDF_PATH variable --- ports/esp32s2/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 5ad5c2f1d3..47afc41081 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -212,7 +212,7 @@ $(BUILD)/esp-idf: # create the config headers $(BUILD)/esp-idf/config/sdkconfig.h: boards/$(BOARD)/sdkconfig | $(BUILD)/esp-idf - IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;boards/$(BOARD)/sdkconfig" -DCMAKE_TOOLCHAIN_FILE=$IDF_PATH/tools/cmake/toolchain-esp32s2.cmake -DIDF_TARGET=esp32s2 -GNinja + IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;boards/$(BOARD)/sdkconfig" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-esp32s2.cmake -DIDF_TARGET=esp32s2 -GNinja # build a lib # Adding -d explain -j 1 -v to the ninja line will output debug info From a80d7479d0fe4e39eea99aebd2c526b697fefcff Mon Sep 17 00:00:00 2001 From: Timon Date: Fri, 26 Jun 2020 02:04:14 +0200 Subject: [PATCH 0097/1293] Update minimum required cmake to 3.16 Earliest tested version that compiles. Failed with version 3.10 --- ports/esp32s2/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/CMakeLists.txt b/ports/esp32s2/CMakeLists.txt index c831e48469..c99c1c7e78 100644 --- a/ports/esp32s2/CMakeLists.txt +++ b/ports/esp32s2/CMakeLists.txt @@ -1,6 +1,6 @@ # The following five lines of boilerplate have to be in your project's # CMakeLists in this exact order for cmake to work correctly -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.16) set(ENV{IDF_PATH} ${CMAKE_SOURCE_DIR}/esp-idf) set(COMPONENTS esptool_py soc driver log main) From 759929c24a9966b64075bedfb365f3dfc66ad681 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 25 Jun 2020 20:57:17 -0400 Subject: [PATCH 0098/1293] hci early wip; refactor supervisor bluetooth.c for nrf: tested --- devices/ble_hci/common-hal/_bleio/Adapter.c | 717 ++++++++++++++++ devices/ble_hci/common-hal/_bleio/Adapter.h | 71 ++ devices/ble_hci/common-hal/_bleio/Attribute.c | 60 ++ devices/ble_hci/common-hal/_bleio/Attribute.h | 34 + .../common-hal/_bleio/Characteristic.c | 266 ++++++ .../common-hal/_bleio/Characteristic.h | 55 ++ .../common-hal/_bleio/CharacteristicBuffer.c | 151 ++++ .../common-hal/_bleio/CharacteristicBuffer.h | 41 + .../ble_hci/common-hal/_bleio/Connection.c | 768 ++++++++++++++++++ .../ble_hci/common-hal/_bleio/Connection.h | 90 ++ .../ble_hci/common-hal/_bleio/Descriptor.c | 97 +++ .../ble_hci/common-hal/_bleio/Descriptor.h | 53 ++ .../ble_hci/common-hal/_bleio/PacketBuffer.c | 402 +++++++++ .../ble_hci/common-hal/_bleio/PacketBuffer.h | 51 ++ devices/ble_hci/common-hal/_bleio/Service.c | 147 ++++ devices/ble_hci/common-hal/_bleio/Service.h | 54 ++ devices/ble_hci/common-hal/_bleio/UUID.c | 88 ++ devices/ble_hci/common-hal/_bleio/UUID.h | 47 ++ devices/ble_hci/common-hal/_bleio/__init__.c | 246 ++++++ devices/ble_hci/common-hal/_bleio/__init__.h | 50 ++ devices/ble_hci/common-hal/_bleio/bonding.c | 306 +++++++ devices/ble_hci/common-hal/_bleio/bonding.h | 83 ++ devices/ble_hci/common-hal/_bleio/hci.c | 675 +++++++++++++++ devices/ble_hci/supervisor/bluetooth.c | 48 ++ devices/ble_hci/supervisor/bluetooth.h | 34 + ports/atmel-samd/asf4 | 2 +- .../metro_m4_airlift_lite/mpconfigboard.mk | 4 + ports/atmel-samd/peripherals | 2 +- ports/nrf/bluetooth/ble_drv.c | 1 + ports/nrf/supervisor/bluetooth.c | 81 ++ ports/nrf/supervisor/bluetooth.h | 36 + py/circuitpy_defns.mk | 10 +- py/circuitpy_mpconfig.mk | 4 + py/mkrules.mk | 5 +- shared-bindings/_bleio/Adapter.c | 56 +- shared-bindings/_bleio/Connection.c | 1 - supervisor/shared/bluetooth.c | 82 +- supervisor/shared/bluetooth.h | 3 +- supervisor/supervisor.mk | 2 +- 39 files changed, 4845 insertions(+), 78 deletions(-) create mode 100644 devices/ble_hci/common-hal/_bleio/Adapter.c create mode 100644 devices/ble_hci/common-hal/_bleio/Adapter.h create mode 100644 devices/ble_hci/common-hal/_bleio/Attribute.c create mode 100644 devices/ble_hci/common-hal/_bleio/Attribute.h create mode 100644 devices/ble_hci/common-hal/_bleio/Characteristic.c create mode 100644 devices/ble_hci/common-hal/_bleio/Characteristic.h create mode 100644 devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c create mode 100644 devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.h create mode 100644 devices/ble_hci/common-hal/_bleio/Connection.c create mode 100644 devices/ble_hci/common-hal/_bleio/Connection.h create mode 100644 devices/ble_hci/common-hal/_bleio/Descriptor.c create mode 100644 devices/ble_hci/common-hal/_bleio/Descriptor.h create mode 100644 devices/ble_hci/common-hal/_bleio/PacketBuffer.c create mode 100644 devices/ble_hci/common-hal/_bleio/PacketBuffer.h create mode 100644 devices/ble_hci/common-hal/_bleio/Service.c create mode 100644 devices/ble_hci/common-hal/_bleio/Service.h create mode 100644 devices/ble_hci/common-hal/_bleio/UUID.c create mode 100644 devices/ble_hci/common-hal/_bleio/UUID.h create mode 100644 devices/ble_hci/common-hal/_bleio/__init__.c create mode 100644 devices/ble_hci/common-hal/_bleio/__init__.h create mode 100644 devices/ble_hci/common-hal/_bleio/bonding.c create mode 100644 devices/ble_hci/common-hal/_bleio/bonding.h create mode 100644 devices/ble_hci/common-hal/_bleio/hci.c create mode 100644 devices/ble_hci/supervisor/bluetooth.c create mode 100644 devices/ble_hci/supervisor/bluetooth.h create mode 100644 ports/nrf/supervisor/bluetooth.c create mode 100644 ports/nrf/supervisor/bluetooth.h diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c new file mode 100644 index 0000000000..7e1bfe9920 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -0,0 +1,717 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Dan Halbert for Adafruit Industries + * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Artur Pacholec + * + * 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 +#include + +#include "bonding.h" + +#include "py/gc.h" +#include "py/objstr.h" +#include "py/runtime.h" +#include "supervisor/shared/safe_mode.h" +#include "supervisor/shared/tick.h" +#include "supervisor/usb.h" +#include "shared-bindings/_bleio/__init__.h" +#include "shared-bindings/_bleio/Adapter.h" +#include "shared-bindings/_bleio/Address.h" +#include "shared-bindings/nvm/ByteArray.h" +#include "shared-bindings/_bleio/Connection.h" +#include "shared-bindings/_bleio/ScanEntry.h" +#include "shared-bindings/time/__init__.h" + +#define BLE_MIN_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) +#define BLE_MAX_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) +#define BLE_SLAVE_LATENCY 0 +#define BLE_CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS) + +#ifndef BLEIO_VS_UUID_COUNT +#define BLEIO_VS_UUID_COUNT 75 +#endif + +#ifndef BLEIO_HVN_TX_QUEUE_SIZE +#define BLEIO_HVN_TX_QUEUE_SIZE 9 +#endif + +#ifndef BLEIO_CENTRAL_ROLE_COUNT +#define BLEIO_CENTRAL_ROLE_COUNT 4 +#endif + +#ifndef BLEIO_PERIPH_ROLE_COUNT +#define BLEIO_PERIPH_ROLE_COUNT 4 +#endif + +#ifndef BLEIO_ATTR_TAB_SIZE +#define BLEIO_ATTR_TAB_SIZE (BLE_GATTS_ATTR_TAB_SIZE_DEFAULT * 5) +#endif + +bleio_connection_internal_t bleio_connections[BLEIO_TOTAL_CONNECTION_COUNT]; + +STATIC bool adapter_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { + // bleio_adapter_obj_t *self = (bleio_adapter_obj_t*)self_in; + + // // For debugging. + // // mp_printf(&mp_plat_print, "Adapter event: 0x%04x\n", ble_evt->header.evt_id); + + // switch (ble_evt->header.evt_id) { + // case BLE_GAP_EVT_CONNECTED: { + // // Find an empty connection. One must always be available because the SD has the same + // // total connection limit. + // bleio_connection_internal_t *connection; + // for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + // connection = &bleio_connections[i]; + // if (connection->conn_handle == BLE_CONN_HANDLE_INVALID) { + // break; + // } + // } + + // // Central has connected. + // ble_gap_evt_connected_t* connected = &ble_evt->evt.gap_evt.params.connected; + + // connection->conn_handle = ble_evt->evt.gap_evt.conn_handle; + // connection->connection_obj = mp_const_none; + // connection->pair_status = PAIR_NOT_PAIRED; + // connection->mtu = 0; + + // ble_drv_add_event_handler_entry(&connection->handler_entry, connection_on_ble_evt, connection); + // self->connection_objs = NULL; + + // // Save the current connection parameters. + // memcpy(&connection->conn_params, &connected->conn_params, sizeof(ble_gap_conn_params_t)); + + // #if CIRCUITPY_VERBOSE_BLE + // ble_gap_conn_params_t *cp = &connected->conn_params; + // mp_printf(&mp_plat_print, "conn params: min_ci %d max_ci %d s_l %d sup_timeout %d\n", cp->min_conn_interval, cp->max_conn_interval, cp->slave_latency, cp->conn_sup_timeout); + // #endif + + // // See if connection interval set by Central is out of range. + // // If so, negotiate our preferred range. + // ble_gap_conn_params_t conn_params; + // sd_ble_gap_ppcp_get(&conn_params); + // if (conn_params.min_conn_interval < connected->conn_params.min_conn_interval || + // conn_params.min_conn_interval > connected->conn_params.max_conn_interval) { + // sd_ble_gap_conn_param_update(ble_evt->evt.gap_evt.conn_handle, &conn_params); + // } + // self->current_advertising_data = NULL; + // break; + // } + // case BLE_GAP_EVT_DISCONNECTED: { + // // Find the connection that was disconnected. + // bleio_connection_internal_t *connection; + // for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + // connection = &bleio_connections[i]; + // if (connection->conn_handle == ble_evt->evt.gap_evt.conn_handle) { + // break; + // } + // } + // ble_drv_remove_event_handler(connection_on_ble_evt, connection); + // connection->conn_handle = BLE_CONN_HANDLE_INVALID; + // connection->pair_status = PAIR_NOT_PAIRED; + // if (connection->connection_obj != mp_const_none) { + // bleio_connection_obj_t* obj = connection->connection_obj; + // obj->connection = NULL; + // obj->disconnect_reason = ble_evt->evt.gap_evt.params.disconnected.reason; + // } + // self->connection_objs = NULL; + + // break; + // } + + // case BLE_GAP_EVT_ADV_SET_TERMINATED: + // self->current_advertising_data = NULL; + // break; + + // default: + // // For debugging. + // // mp_printf(&mp_plat_print, "Unhandled adapter event: 0x%04x\n", ble_evt->header.evt_id); + // return false; + // break; + // } + return true; +} + +STATIC void get_address(bleio_adapter_obj_t *self, ble_gap_addr_t *address) { +// check_nrf_error(sd_ble_gap_addr_get(address)); +} + +char default_ble_name[] = { 'C', 'I', 'R', 'C', 'U', 'I', 'T', 'P', 'Y', 0, 0, 0, 0 , 0}; + +STATIC void bleio_adapter_reset_name(bleio_adapter_obj_t *self) { + uint8_t len = sizeof(default_ble_name) - 1; + + ble_gap_addr_t local_address; + get_address(self, &local_address); + + default_ble_name[len - 4] = nibble_to_hex_lower[local_address.addr[1] >> 4 & 0xf]; + default_ble_name[len - 3] = nibble_to_hex_lower[local_address.addr[1] & 0xf]; + default_ble_name[len - 2] = nibble_to_hex_lower[local_address.addr[0] >> 4 & 0xf]; + default_ble_name[len - 1] = nibble_to_hex_lower[local_address.addr[0] & 0xf]; + default_ble_name[len] = '\0'; // for now we add null for compatibility with C ASCIIZ strings + + common_hal_bleio_adapter_set_name(self, (char*) default_ble_name); +} + +void common_hal_bleio_adapter_construct(bleio_adapter_obj_t *self, mcu_pin_obj_t *tx, mcu_pin_obj_t *rx, mcu_pin_obj_t *rts, mcu_pin_obj_t *cts, uint32_t baudrate, uint32_t buffer_size, mcu_pin_obj_t* spi_cs, mcu_pin_obj_t* gpio0, mcu_pin_obj_t *reset, bool reset_high) { + self->tx = tx; + self->rx = rx; + self->rts = rts; + self->cts = cts; + self->baudrate = baudrate; + self->buffer_size = buffer_size; + self->spi_cs = spi_cs; + self->gpio0 = gpio0; + self->reset = reset; + self->reset_high = reset_high; + self->enabled = false; +} + +void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enabled) { + const bool is_enabled = common_hal_bleio_adapter_get_enabled(self); + + // Don't enable or disable twice + if (is_enabled == enabled) { + return; + } + + if (enabled) { + // Enable adapter. + + // common_hal UART takes rts and cts, but is currently not implemented for many ports. + // In addition, rts and cts may be pins that are not part of the serial peripheral + // used for tx and rx, so use GPIO for them. + common_hal_busio_uart_construct(&self->hci_uart, tx, rx, NULL, NULL, NULL, false, + BLEIO_HCI_BAUDRATE, 8, PARITY_NONE, 1, 0.0f, + BLEIO_HCI_BUFFER_SIZE, NULL, false); + + // RTS is output, active high + common_hal_digitalio_digitalinout_construct(&self->rts_digitalio, self->rts); + common_hal_digitalio_digitalinout_switch_to_output(&self->rts_digitalio, false, DRIVE_MODE_PUSH_PULL); + + // CTS is input. + common_hal_digitalio_digitalinout_construct(&self->cts_digitalio, self->cts); + + // SPI_CS and GPI0 are used to signal entering BLE mode. + // SPI_CS should be low, and GPI0 should be high + common_hal_digitalio_digitalinout_construct(&self->spi_cs_digitalio, self->spi_cs); + common_hal_digitalio_digitalinout_construct(&self->gpio0_digitalio, self->gpi0); + common_hal_digitalio_digitalinout_switch_to_output(&self->spi_cs_digitalio, false, DRIVE_MODE_PUSH_PULL); + common_hal_digitalio_digitalinout_switch_to_output(&self->gpio0_digitalio, true DRIVE_MODE_PUSH_PULL); + + // RESET is output, start in non-reset state. + common_hal_digitalio_digitalinout_construct(&self->reset_digitalio, self->reset); + common_hal_digitalio_digitalinout_switch_to_output(&self->reset_digitalio, + !self->reset_high, DRIVE_MODE_PUSH_PULL); + + // Adapter will enter BLE mode on reset, based on SPI_CS and GPIO0 settings. + // Reset HCI processor. Assert reset for 100ms, then wait 750ms for reset to complete. + common_hal_digitalio_digitalinout_set_value(&self->reset_digitalio, self->reset_high); + mp_hal_delay_ms(100); + common_hal_digitalio_digitalinout_set_value(&self->reset_digitalio, !self->reset_high); + mp_hal_delay_ms(750); + + // After reset, set SPI_CS high. + common_hal_digitalio_digitalinout_set_value(&self->spi_cs_digitalio, true); + + return; + } + + // Disable. + common_hal_digitalio_digitalinout_set_value(&self->reset_digitalio, self->reset_high); + mp_hal_delay_ms(100); + common_hal_digitalio_digitalinout_set_value(&self->reset_digitalio, !self->reset_high); + + // Free all pins. + common_hal_busio_uart_deinit(&self->hci_uart); + common_hal_digitalio_digitalinout_deinit(&self->rts_digitalio); + common_hal_digitalio_digitalinout_deinit(&self->cts_digitalio); + common_hal_digitalio_digitalinout_deinit(&self->spi_cs_digitalio); + common_hal_digitalio_digitalinout_deinit(&self->gpi0_digitalio); + common_hal_digitalio_digitalinout_deinit(&self->reset_digitalio); +} + +bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self) { + return self->enabled; +} + +bleio_address_obj_t *common_hal_bleio_adapter_get_address(bleio_adapter_obj_t *self) { + common_hal_bleio_adapter_set_enabled(self, true); + + ble_gap_addr_t local_address; + get_address(self, &local_address); + + bleio_address_obj_t *address = m_new_obj(bleio_address_obj_t); + address->base.type = &bleio_address_type; + + common_hal_bleio_address_construct(address, local_address.addr, local_address.addr_type); + return address; +} + +mp_obj_str_t* common_hal_bleio_adapter_get_name(bleio_adapter_obj_t *self) { + uint16_t len = 0; +// sd_ble_gap_device_name_get(NULL, &len); + uint8_t buf[len]; +// uint32_t err_code = sd_ble_gap_device_name_get(buf, &len); +// if (err_code != NRF_SUCCESS) { +// return NULL; +// } + return mp_obj_new_str((char*) buf, len); +} + +void common_hal_bleio_adapter_set_name(bleio_adapter_obj_t *self, const char* name) { + // ble_gap_conn_sec_mode_t sec; + // sec.lv = 0; + // sec.sm = 0; + // sd_ble_gap_device_name_set(&sec, (const uint8_t*) name, strlen(name)); +} + +// STATIC bool scan_on_ble_evt(ble_evt_t *ble_evt, void *scan_results_in) { +// bleio_scanresults_obj_t *scan_results = (bleio_scanresults_obj_t*)scan_results_in; + +// if (ble_evt->header.evt_id == BLE_GAP_EVT_TIMEOUT && +// ble_evt->evt.gap_evt.params.timeout.src == BLE_GAP_TIMEOUT_SRC_SCAN) { +// shared_module_bleio_scanresults_set_done(scan_results, true); +// ble_drv_remove_event_handler(scan_on_ble_evt, scan_results); +// return true; +// } + +// if (ble_evt->header.evt_id != BLE_GAP_EVT_ADV_REPORT) { +// return false; +// } +// ble_gap_evt_adv_report_t *report = &ble_evt->evt.gap_evt.params.adv_report; + +// shared_module_bleio_scanresults_append(scan_results, +// supervisor_ticks_ms64(), +// report->type.connectable, +// report->type.scan_response, +// report->rssi, +// report->peer_addr.addr, +// report->peer_addr.addr_type, +// report->data.p_data, +// report->data.len); + +// const uint32_t err_code = sd_ble_gap_scan_start(NULL, scan_results->common_hal_data); +// if (err_code != NRF_SUCCESS) { +// // TODO: Pass the error into the scan results so it can throw an exception. +// scan_results->done = true; +// } +// return true; +// } + +mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t* prefixes, size_t prefix_length, bool extended, mp_int_t buffer_size, mp_float_t timeout, mp_float_t interval, mp_float_t window, mp_int_t minimum_rssi, bool active) { + if (self->scan_results != NULL) { + if (!shared_module_bleio_scanresults_get_done(self->scan_results)) { + mp_raise_bleio_BluetoothError(translate("Scan already in progess. Stop with stop_scan.")); + } + self->scan_results = NULL; + } + self->scan_results = shared_module_bleio_new_scanresults(buffer_size, prefixes, prefix_length, minimum_rssi); + // size_t max_packet_size = extended ? BLE_GAP_SCAN_BUFFER_EXTENDED_MAX_SUPPORTED : BLE_GAP_SCAN_BUFFER_MAX; + // uint8_t *raw_data = m_malloc(sizeof(ble_data_t) + max_packet_size, false); + // ble_data_t * sd_data = (ble_data_t *) raw_data; + // self->scan_results->common_hal_data = sd_data; + // sd_data->len = max_packet_size; + // sd_data->p_data = raw_data + sizeof(ble_data_t); + + // ble_drv_add_event_handler(scan_on_ble_evt, self->scan_results); + + // uint32_t nrf_timeout = SEC_TO_UNITS(timeout, UNIT_10_MS); + // if (timeout <= 0.0001) { + // nrf_timeout = BLE_GAP_SCAN_TIMEOUT_UNLIMITED; + // } + + // ble_gap_scan_params_t scan_params = { + // .extended = extended, + // .interval = SEC_TO_UNITS(interval, UNIT_0_625_MS), + // .timeout = nrf_timeout, + // .window = SEC_TO_UNITS(window, UNIT_0_625_MS), + // .scan_phys = BLE_GAP_PHY_1MBPS, + // .active = active + // }; + // uint32_t err_code; + // vm_used_ble = true; + // err_code = sd_ble_gap_scan_start(&scan_params, sd_data); + + // if (err_code != NRF_SUCCESS) { + // self->scan_results = NULL; + // ble_drv_remove_event_handler(scan_on_ble_evt, self->scan_results); + // check_nrf_error(err_code); + // } + + return MP_OBJ_FROM_PTR(self->scan_results); +} + +void common_hal_bleio_adapter_stop_scan(bleio_adapter_obj_t *self) { + // sd_ble_gap_scan_stop(); + shared_module_bleio_scanresults_set_done(self->scan_results, true); + // ble_drv_remove_event_handler(scan_on_ble_evt, self->scan_results); + self->scan_results = NULL; +} + +// typedef struct { +// uint16_t conn_handle; +// volatile bool done; +// } connect_info_t; + +// STATIC bool connect_on_ble_evt(ble_evt_t *ble_evt, void *info_in) { +// connect_info_t *info = (connect_info_t*)info_in; + +// switch (ble_evt->header.evt_id) { +// case BLE_GAP_EVT_CONNECTED: +// info->conn_handle = ble_evt->evt.gap_evt.conn_handle; +// info->done = true; + +// break; + +// case BLE_GAP_EVT_TIMEOUT: +// // Handle will be invalid. +// info->done = true; +// break; +// default: +// // For debugging. +// // mp_printf(&mp_plat_print, "Unhandled central event: 0x%04x\n", ble_evt->header.evt_id); +// return false; +// break; +// } +// return true; +// } + +mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_address_obj_t *address, mp_float_t timeout) { + + // ble_gap_addr_t addr; + + // addr.addr_type = address->type; + // mp_buffer_info_t address_buf_info; + // mp_get_buffer_raise(address->bytes, &address_buf_info, MP_BUFFER_READ); + // memcpy(addr.addr, (uint8_t *) address_buf_info.buf, NUM_BLEIO_ADDRESS_BYTES); + + // ble_gap_scan_params_t scan_params = { + // .interval = MSEC_TO_UNITS(100, UNIT_0_625_MS), + // .window = MSEC_TO_UNITS(100, UNIT_0_625_MS), + // .scan_phys = BLE_GAP_PHY_1MBPS, + // // timeout of 0 means no timeout + // .timeout = SEC_TO_UNITS(timeout, UNIT_10_MS), + // }; + + // ble_gap_conn_params_t conn_params = { + // .conn_sup_timeout = MSEC_TO_UNITS(4000, UNIT_10_MS), + // .min_conn_interval = MSEC_TO_UNITS(15, UNIT_1_25_MS), + // .max_conn_interval = MSEC_TO_UNITS(300, UNIT_1_25_MS), + // .slave_latency = 0, // number of conn events + // }; + + // connect_info_t event_info; + // ble_drv_add_event_handler(connect_on_ble_evt, &event_info); + // event_info.done = false; + + vm_used_ble = true; + // uint32_t err_code = sd_ble_gap_connect(&addr, &scan_params, &conn_params, BLE_CONN_CFG_TAG_CUSTOM); + + // if (err_code != NRF_SUCCESS) { + // ble_drv_remove_event_handler(connect_on_ble_evt, &event_info); + // check_nrf_error(err_code); + // } + + // while (!event_info.done) { + // RUN_BACKGROUND_TASKS; + // } + + // ble_drv_remove_event_handler(connect_on_ble_evt, &event_info); + + // uint16_t conn_handle = event_info.conn_handle; + // if (conn_handle == BLE_CONN_HANDLE_INVALID) { + // mp_raise_bleio_BluetoothError(translate("Failed to connect: timeout")); + // } + + // // Negotiate for better PHY, larger MTU and data lengths since we are the central. These are + // // nice-to-haves so ignore any errors. + // ble_gap_phys_t const phys = { + // .rx_phys = BLE_GAP_PHY_AUTO, + // .tx_phys = BLE_GAP_PHY_AUTO, + // }; + // sd_ble_gap_phy_update(conn_handle, &phys); + // sd_ble_gattc_exchange_mtu_request(conn_handle, BLE_GATTS_VAR_ATTR_LEN_MAX); + // sd_ble_gap_data_length_update(conn_handle, NULL, NULL); + + // Make the connection object and return it. + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + bleio_connection_internal_t *connection = &bleio_connections[i]; + if (connection->conn_handle == conn_handle) { + return bleio_connection_new_from_internal(connection); + } + } + + mp_raise_bleio_BluetoothError(translate("Failed to connect: internal error")); + + return mp_const_none; +} + +// The nRF SD 6.1.0 can only do one concurrent advertisement so share the advertising handle. +uint8_t adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET; + +STATIC void check_data_fit(size_t data_len, bool connectable) { + if (data_len > BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED || + (connectable && data_len > BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_CONNECTABLE_MAX_SUPPORTED)) { + mp_raise_ValueError(translate("Data too large for advertisement packet")); + } +} + +// STATIC bool advertising_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { +// bleio_adapter_obj_t *self = (bleio_adapter_obj_t*)self_in; + +// switch (ble_evt->header.evt_id) { +// case BLE_GAP_EVT_ADV_SET_TERMINATED: +// common_hal_bleio_adapter_stop_advertising(self); +// ble_drv_remove_event_handler(advertising_on_ble_evt, self_in); +// break; + +// default: +// // For debugging. +// // mp_printf(&mp_plat_print, "Unhandled advertising event: 0x%04x\n", ble_evt->header.evt_id); +// return false; +// break; +// } +// return true; +// } + +uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, uint32_t timeout, float interval, uint8_t *advertising_data, uint16_t advertising_data_len, uint8_t *scan_response_data, uint16_t scan_response_data_len) { + // if (self->current_advertising_data != NULL && self->current_advertising_data == self->advertising_data) { + // return NRF_ERROR_BUSY; + // } + + // // If the current advertising data isn't owned by the adapter then it must be an internal + // // advertisement that we should stop. + // if (self->current_advertising_data != NULL) { + // common_hal_bleio_adapter_stop_advertising(self); + // } + + // uint32_t err_code; + // bool extended = advertising_data_len > BLE_GAP_ADV_SET_DATA_SIZE_MAX || + // scan_response_data_len > BLE_GAP_ADV_SET_DATA_SIZE_MAX; + + // uint8_t adv_type; + // if (extended) { + // if (connectable) { + // adv_type = BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED; + // } else if (scan_response_data_len > 0) { + // adv_type = BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED; + // } else { + // adv_type = BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED; + // } + // } else if (connectable) { + // adv_type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED; + // } else if (scan_response_data_len > 0) { + // adv_type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED; + // } else { + // adv_type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED; + // } + + // if (anonymous) { + // ble_gap_privacy_params_t privacy = { + // .privacy_mode = BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY, + // .private_addr_type = BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE, + // // Rotate the keys one second after we're scheduled to stop + // // advertising. This prevents a potential race condition where we + // // fire off a beacon with the same advertising data but a new MAC + // // address just as we tear down the connection. + // .private_addr_cycle_s = timeout + 1, + // .p_device_irk = NULL, + // }; + // err_code = sd_ble_gap_privacy_set(&privacy); + // } else { + // ble_gap_privacy_params_t privacy = { + // .privacy_mode = BLE_GAP_PRIVACY_MODE_OFF, + // .private_addr_type = BLE_GAP_ADDR_TYPE_PUBLIC, + // .private_addr_cycle_s = 0, + // .p_device_irk = NULL, + // }; + // err_code = sd_ble_gap_privacy_set(&privacy); + // } + // if (err_code != NRF_SUCCESS) { + // return err_code; + // } + + // ble_gap_adv_params_t adv_params = { + // .interval = SEC_TO_UNITS(interval, UNIT_0_625_MS), + // .properties.type = adv_type, + // .duration = SEC_TO_UNITS(timeout, UNIT_10_MS), + // .filter_policy = BLE_GAP_ADV_FP_ANY, + // .primary_phy = BLE_GAP_PHY_1MBPS, + // }; + + // const ble_gap_adv_data_t ble_gap_adv_data = { + // .adv_data.p_data = advertising_data, + // .adv_data.len = advertising_data_len, + // .scan_rsp_data.p_data = scan_response_data_len > 0 ? scan_response_data : NULL, + // .scan_rsp_data.len = scan_response_data_len, + // }; + + // err_code = sd_ble_gap_adv_set_configure(&adv_handle, &ble_gap_adv_data, &adv_params); + // if (err_code != NRF_SUCCESS) { + // return err_code; + // } + + // ble_drv_add_event_handler(advertising_on_ble_evt, self); + + // vm_used_ble = true; + // err_code = sd_ble_gap_adv_start(adv_handle, BLE_CONN_CFG_TAG_CUSTOM); + // if (err_code != NRF_SUCCESS) { + // return err_code; + // } + // self->current_advertising_data = advertising_data; + // return NRF_SUCCESS; + return 0; +} + + +void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, uint32_t timeout, mp_float_t interval, mp_buffer_info_t *advertising_data_bufinfo, mp_buffer_info_t *scan_response_data_bufinfo) { + if (self->current_advertising_data != NULL && self->current_advertising_data == self->advertising_data) { + mp_raise_bleio_BluetoothError(translate("Already advertising.")); + } + // interval value has already been validated. + + check_data_fit(advertising_data_bufinfo->len, connectable); + check_data_fit(scan_response_data_bufinfo->len, connectable); + + if (advertising_data_bufinfo->len > 31 && scan_response_data_bufinfo->len > 0) { + mp_raise_bleio_BluetoothError(translate("Extended advertisements with scan response not supported.")); + } + + // Anonymous mode requires a timeout so that we don't continue to broadcast + // the same data while cycling the MAC address -- otherwise, what's the + // point of randomizing the MAC address? + if (!timeout) { + if (anonymous) { + // The Nordic macro is in units of 10ms. Convert to seconds. + uint32_t adv_timeout_max_secs = UNITS_TO_SEC(BLE_GAP_ADV_TIMEOUT_LIMITED_MAX, UNIT_10_MS); + uint32_t rotate_timeout_max_secs = BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S; + timeout = MIN(adv_timeout_max_secs, rotate_timeout_max_secs); + } + else { + timeout = BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED; + } + } else { + if (SEC_TO_UNITS(timeout, UNIT_10_MS) > BLE_GAP_ADV_TIMEOUT_LIMITED_MAX) { + mp_raise_bleio_BluetoothError(translate("Timeout is too long: Maximum timeout length is %d seconds"), + UNITS_TO_SEC(BLE_GAP_ADV_TIMEOUT_LIMITED_MAX, UNIT_10_MS)); + } + } + + // The advertising data buffers must not move, because the SoftDevice depends on them. + // So make them long-lived and reuse them onwards. + if (self->advertising_data == NULL) { + self->advertising_data = (uint8_t *) gc_alloc(BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED * sizeof(uint8_t), false, true); + } + if (self->scan_response_data == NULL) { + self->scan_response_data = (uint8_t *) gc_alloc(BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED * sizeof(uint8_t), false, true); + } + + memcpy(self->advertising_data, advertising_data_bufinfo->buf, advertising_data_bufinfo->len); + memcpy(self->scan_response_data, scan_response_data_bufinfo->buf, scan_response_data_bufinfo->len); + + // check_nrf_error(_common_hal_bleio_adapter_start_advertising(self, connectable, anonymous, timeout, interval, + // self->advertising_data, + // advertising_data_bufinfo->len, + // self->scan_response_data, + // scan_response_data_bufinfo->len)); +} + +void common_hal_bleio_adapter_stop_advertising(bleio_adapter_obj_t *self) { + // if (adv_handle == BLE_GAP_ADV_SET_HANDLE_NOT_SET) + // return; + + // // TODO: Don't actually stop. Switch to advertising CircuitPython if we don't already have a connection. + // const uint32_t err_code = sd_ble_gap_adv_stop(adv_handle); + // self->current_advertising_data = NULL; + + // if ((err_code != NRF_SUCCESS) && (err_code != NRF_ERROR_INVALID_STATE)) { + // check_nrf_error(err_code); + // } +} + +bool common_hal_bleio_adapter_get_advertising(bleio_adapter_obj_t *self) { + return self->current_advertising_data != NULL; +} + +bool common_hal_bleio_adapter_get_connected(bleio_adapter_obj_t *self) { + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + bleio_connection_internal_t *connection = &bleio_connections[i]; + if (connection->conn_handle != BLE_CONN_HANDLE_INVALID) { + return true; + } + } + return false; +} + +mp_obj_t common_hal_bleio_adapter_get_connections(bleio_adapter_obj_t *self) { + if (self->connection_objs != NULL) { + return self->connection_objs; + } + size_t total_connected = 0; + mp_obj_t items[BLEIO_TOTAL_CONNECTION_COUNT]; + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + bleio_connection_internal_t *connection = &bleio_connections[i]; + if (connection->conn_handle != BLE_CONN_HANDLE_INVALID) { + if (connection->connection_obj == mp_const_none) { + connection->connection_obj = bleio_connection_new_from_internal(connection); + } + items[total_connected] = connection->connection_obj; + total_connected++; + } + } + self->connection_objs = mp_obj_new_tuple(total_connected, items); + return self->connection_objs; +} + +void common_hal_bleio_adapter_erase_bonding(bleio_adapter_obj_t *self) { + bonding_erase_storage(); +} + +void bleio_adapter_gc_collect(bleio_adapter_obj_t* adapter) { + gc_collect_root((void**)adapter, sizeof(bleio_adapter_obj_t) / sizeof(size_t)); + gc_collect_root((void**)bleio_connections, sizeof(bleio_connections) / sizeof(size_t)); +} + +void bleio_adapter_reset(bleio_adapter_obj_t* adapter) { + common_hal_bleio_adapter_stop_scan(adapter); + if (adapter->current_advertising_data != NULL) { + common_hal_bleio_adapter_stop_advertising(adapter); + } + + adapter->connection_objs = NULL; + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + bleio_connection_internal_t *connection = &bleio_connections[i]; + // Disconnect all connections with Python state cleanly. Keep any supervisor-only connections. + if (connection->connection_obj != mp_const_none && + connection->conn_handle != BLE_CONN_HANDLE_INVALID) { + common_hal_bleio_connection_disconnect(connection); + } + connection->connection_obj = mp_const_none; + } +} diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.h b/devices/ble_hci/common-hal/_bleio/Adapter.h new file mode 100644 index 0000000000..c12e9105c4 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/Adapter.h @@ -0,0 +1,71 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2016 Glenn Ruben Bakke + * + * 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_BLE_HCI_COMMON_HAL_ADAPTER_H +#define MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_ADAPTER_H + +#include "py/obj.h" +#include "py/objtuple.h" + +#include "shared-bindings/_bleio/Connection.h" +#include "shared-bindings/_bleio/ScanResults.h" +#include "shared-bindings/microcontroller/Pin.h" + +extern bleio_connection_internal_t bleio_connections[BLEIO_TOTAL_CONNECTION_COUNT]; + +typedef struct { + mp_obj_base_t base; + uint8_t* advertising_data; + uint8_t* scan_response_data; + uint8_t* current_advertising_data; + bleio_scanresults_obj_t* scan_results; + mp_obj_t name; + mp_obj_tuple_t *connection_objs; + mcu_pin_obj_t* tx; + mcu_pin_obj_t* rx; + mcu_pin_obj_t* rts; + mcu_pin_obj_t* cts; + uint32_t baudrate; + uint16_t buffer_size; + mcu_pin_obj_t* spi_cs; + mcu_pin_obj_t* gpio0; + mcu_pin_obj_t* reset; + bool reset_high; + busio_uart_obj_t hci_uart; + digitalio_digitalinout_obj_t rts_digitalio; + digitalio_digitalinout_obj_t cts_digitalio; + digitalio_digitalinout_obj_t spi_cs_digitalio; + digitalio_digitalinout_obj_t gpio0_digitalio; + digitalio_digitalinout_obj_t reset_digitalio; + bool enabled; +} bleio_adapter_obj_t; + +void bleio_adapter_gc_collect(bleio_adapter_obj_t* adapter); +void bleio_adapter_reset(bleio_adapter_obj_t* adapter); + +#endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_ADAPTER_H diff --git a/devices/ble_hci/common-hal/_bleio/Attribute.c b/devices/ble_hci/common-hal/_bleio/Attribute.c new file mode 100644 index 0000000000..c55914b10d --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/Attribute.c @@ -0,0 +1,60 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 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 "shared-bindings/_bleio/Attribute.h" + +// Convert a _bleio security mode to a ble_gap_conn_sec_mode_t setting. +void bleio_attribute_gatts_set_security_mode(ble_gap_conn_sec_mode_t *perm, bleio_attribute_security_mode_t security_mode) { + switch (security_mode) { + case SECURITY_MODE_NO_ACCESS: + BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(perm); + break; + + case SECURITY_MODE_OPEN: + BLE_GAP_CONN_SEC_MODE_SET_OPEN(perm); + break; + + case SECURITY_MODE_ENC_NO_MITM: + BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(perm); + break; + + case SECURITY_MODE_ENC_WITH_MITM: + BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM(perm); + break; + + case SECURITY_MODE_LESC_ENC_WITH_MITM: + BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM(perm); + break; + + case SECURITY_MODE_SIGNED_NO_MITM: + BLE_GAP_CONN_SEC_MODE_SET_SIGNED_NO_MITM(perm); + break; + + case SECURITY_MODE_SIGNED_WITH_MITM: + BLE_GAP_CONN_SEC_MODE_SET_SIGNED_WITH_MITM(perm); + break; + } +} diff --git a/devices/ble_hci/common-hal/_bleio/Attribute.h b/devices/ble_hci/common-hal/_bleio/Attribute.h new file mode 100644 index 0000000000..cd9c86ca39 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/Attribute.h @@ -0,0 +1,34 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * 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. + */ + +#ifndef MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_ATTRIBUTE_H +#define MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_ATTRIBUTE_H + +#include "shared-module/_bleio/Attribute.h" + +extern void bleio_attribute_gatts_set_security_mode(ble_gap_conn_sec_mode_t *perm, bleio_attribute_security_mode_t security_mode); + +#endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_ATTRIBUTE_H diff --git a/devices/ble_hci/common-hal/_bleio/Characteristic.c b/devices/ble_hci/common-hal/_bleio/Characteristic.c new file mode 100644 index 0000000000..d507cecca4 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/Characteristic.c @@ -0,0 +1,266 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) Dan Halbert for Adafruit Industries + * Copyright (c) 2018 Artur Pacholec + * + * 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 "shared-bindings/_bleio/__init__.h" +#include "shared-bindings/_bleio/Characteristic.h" +#include "shared-bindings/_bleio/Descriptor.h" +#include "shared-bindings/_bleio/Service.h" + +#include "common-hal/_bleio/Adapter.h" +#include "common-hal/_bleio/bonding.h" + +STATIC uint16_t characteristic_get_cccd(uint16_t cccd_handle, uint16_t conn_handle) { + uint16_t cccd; + ble_gatts_value_t value = { + .p_value = (uint8_t*) &cccd, + .len = 2, + }; + + const uint32_t err_code = sd_ble_gatts_value_get(conn_handle, cccd_handle, &value); + + if (err_code == BLE_ERROR_GATTS_SYS_ATTR_MISSING) { + // CCCD is not set, so say that neither Notify nor Indicate is enabled. + cccd = 0; + } else { + check_nrf_error(err_code); + } + + return cccd; +} + + +STATIC void characteristic_gatts_notify_indicate(uint16_t handle, uint16_t conn_handle, mp_buffer_info_t *bufinfo, uint16_t hvx_type) { + uint16_t hvx_len = bufinfo->len; + + ble_gatts_hvx_params_t hvx_params = { + .handle = handle, + .type = hvx_type, + .offset = 0, + .p_len = &hvx_len, + .p_data = bufinfo->buf, + }; + + while (1) { + const uint32_t err_code = sd_ble_gatts_hvx(conn_handle, &hvx_params); + if (err_code == NRF_SUCCESS) { + break; + } + // TX buffer is full + // We could wait for an event indicating the write is complete, but just retrying is easier. + if (err_code == NRF_ERROR_RESOURCES) { + RUN_BACKGROUND_TASKS; + continue; + } + + // Some real error has occurred. + check_nrf_error(err_code); + } +} + +void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, bleio_service_obj_t *service, uint16_t handle, bleio_uuid_obj_t *uuid, bleio_characteristic_properties_t props, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_buffer_info_t *initial_value_bufinfo) { + self->service = service; + self->uuid = uuid; + self->handle = BLE_GATT_HANDLE_INVALID; + self->props = props; + self->read_perm = read_perm; + self->write_perm = write_perm; + self->descriptor_list = NULL; + + const mp_int_t max_length_max = fixed_length ? BLE_GATTS_FIX_ATTR_LEN_MAX : BLE_GATTS_VAR_ATTR_LEN_MAX; + if (max_length < 0 || max_length > max_length_max) { + mp_raise_ValueError_varg(translate("max_length must be 0-%d when fixed_length is %s"), + max_length_max, fixed_length ? "True" : "False"); + } + self->max_length = max_length; + self->fixed_length = fixed_length; + + if (service->is_remote) { + self->handle = handle; + } else { + common_hal_bleio_service_add_characteristic(self->service, self, initial_value_bufinfo); + } + + if (initial_value_bufinfo != NULL) { + common_hal_bleio_characteristic_set_value(self, initial_value_bufinfo); + } +} + +bleio_descriptor_obj_t *common_hal_bleio_characteristic_get_descriptor_list(bleio_characteristic_obj_t *self) { + return self->descriptor_list; +} + +bleio_service_obj_t *common_hal_bleio_characteristic_get_service(bleio_characteristic_obj_t *self) { + return self->service; +} + +size_t common_hal_bleio_characteristic_get_value(bleio_characteristic_obj_t *self, uint8_t* buf, size_t len) { + // Do GATT operations only if this characteristic has been added to a registered service. + if (self->handle != BLE_GATT_HANDLE_INVALID) { + uint16_t conn_handle = bleio_connection_get_conn_handle(self->service->connection); + if (common_hal_bleio_service_get_is_remote(self->service)) { + // self->value is set by evt handler. + return common_hal_bleio_gattc_read(self->handle, conn_handle, buf, len); + } else { + // conn_handle is ignored for non-system attributes. + return common_hal_bleio_gatts_read(self->handle, conn_handle, buf, len); + } + } + + return 0; +} + +void common_hal_bleio_characteristic_set_value(bleio_characteristic_obj_t *self, mp_buffer_info_t *bufinfo) { + if (self->fixed_length && bufinfo->len != self->max_length) { + mp_raise_ValueError(translate("Value length != required fixed length")); + } + if (bufinfo->len > self->max_length) { + mp_raise_ValueError(translate("Value length > max_length")); + } + + // Do GATT operations only if this characteristic has been added to a registered service. + if (self->handle != BLE_GATT_HANDLE_INVALID) { + + if (common_hal_bleio_service_get_is_remote(self->service)) { + uint16_t conn_handle = bleio_connection_get_conn_handle(self->service->connection); + // Last argument is true if write-no-reponse desired. + common_hal_bleio_gattc_write(self->handle, conn_handle, bufinfo, + (self->props & CHAR_PROP_WRITE_NO_RESPONSE)); + } else { + // Always write the value locally even if no connections are active. + // conn_handle is ignored for non-system attributes, so we use BLE_CONN_HANDLE_INVALID. + common_hal_bleio_gatts_write(self->handle, BLE_CONN_HANDLE_INVALID, bufinfo); + // Check to see if we need to notify or indicate any active connections. + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + bleio_connection_internal_t *connection = &bleio_connections[i]; + uint16_t conn_handle = connection->conn_handle; + if (connection->conn_handle == BLE_CONN_HANDLE_INVALID) { + continue; + } + + uint16_t cccd = 0; + + const bool notify = self->props & CHAR_PROP_NOTIFY; + const bool indicate = self->props & CHAR_PROP_INDICATE; + if (notify | indicate) { + cccd = characteristic_get_cccd(self->cccd_handle, conn_handle); + } + + // It's possible that both notify and indicate are set. + if (notify && (cccd & BLE_GATT_HVX_NOTIFICATION)) { + characteristic_gatts_notify_indicate(self->handle, conn_handle, bufinfo, BLE_GATT_HVX_NOTIFICATION); + } + if (indicate && (cccd & BLE_GATT_HVX_INDICATION)) { + characteristic_gatts_notify_indicate(self->handle, conn_handle, bufinfo, BLE_GATT_HVX_INDICATION); + } + } + } + } +} + +bleio_uuid_obj_t *common_hal_bleio_characteristic_get_uuid(bleio_characteristic_obj_t *self) { + return self->uuid; +} + +bleio_characteristic_properties_t common_hal_bleio_characteristic_get_properties(bleio_characteristic_obj_t *self) { + return self->props; +} + +void common_hal_bleio_characteristic_add_descriptor(bleio_characteristic_obj_t *self, bleio_descriptor_obj_t *descriptor) { + ble_uuid_t desc_uuid; + bleio_uuid_convert_to_nrf_ble_uuid(descriptor->uuid, &desc_uuid); + + ble_gatts_attr_md_t desc_attr_md = { + // Data passed is not in a permanent location and should be copied. + .vloc = BLE_GATTS_VLOC_STACK, + .vlen = !descriptor->fixed_length, + }; + + bleio_attribute_gatts_set_security_mode(&desc_attr_md.read_perm, descriptor->read_perm); + bleio_attribute_gatts_set_security_mode(&desc_attr_md.write_perm, descriptor->write_perm); + + mp_buffer_info_t desc_value_bufinfo; + mp_get_buffer_raise(descriptor->value, &desc_value_bufinfo, MP_BUFFER_READ); + + ble_gatts_attr_t desc_attr = { + .p_uuid = &desc_uuid, + .p_attr_md = &desc_attr_md, + .init_len = desc_value_bufinfo.len, + .p_value = desc_value_bufinfo.buf, + .init_offs = 0, + .max_len = descriptor->max_length, + }; + + check_nrf_error(sd_ble_gatts_descriptor_add(self->handle, &desc_attr, &descriptor->handle)); + + descriptor->next = self->descriptor_list; + self->descriptor_list = descriptor; +} + +void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, bool notify, bool indicate) { + if (self->cccd_handle == BLE_GATT_HANDLE_INVALID) { + mp_raise_bleio_BluetoothError(translate("No CCCD for this Characteristic")); + } + + if (!common_hal_bleio_service_get_is_remote(self->service)) { + mp_raise_bleio_RoleError(translate("Can't set CCCD on local Characteristic")); + } + + const uint16_t conn_handle = bleio_connection_get_conn_handle(self->service->connection); + common_hal_bleio_check_connected(conn_handle); + + uint16_t cccd_value = + (notify ? BLE_GATT_HVX_NOTIFICATION : 0) | + (indicate ? BLE_GATT_HVX_INDICATION : 0); + + ble_gattc_write_params_t write_params = { + .write_op = BLE_GATT_OP_WRITE_REQ, + .handle = self->cccd_handle, + .p_value = (uint8_t *) &cccd_value, + .len = 2, + }; + + while (1) { + uint32_t err_code = sd_ble_gattc_write(conn_handle, &write_params); + if (err_code == NRF_SUCCESS) { + break; + } + + // Write with response will return NRF_ERROR_BUSY if the response has not been received. + // Write without reponse will return NRF_ERROR_RESOURCES if too many writes are pending. + if (err_code == NRF_ERROR_BUSY || err_code == NRF_ERROR_RESOURCES) { + // We could wait for an event indicating the write is complete, but just retrying is easier. + RUN_BACKGROUND_TASKS; + continue; + } + + // Some real error occurred. + check_nrf_error(err_code); + } + +} diff --git a/devices/ble_hci/common-hal/_bleio/Characteristic.h b/devices/ble_hci/common-hal/_bleio/Characteristic.h new file mode 100644 index 0000000000..4d5fa02f05 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/Characteristic.h @@ -0,0 +1,55 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * Copyright (c) 2018 Artur Pacholec + * + * 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_BLE_HCI_COMMON_HAL_CHARACTERISTIC_H +#define MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_CHARACTERISTIC_H + +#include "shared-bindings/_bleio/Attribute.h" +#include "common-hal/_bleio/Descriptor.h" +#include "shared-module/_bleio/Characteristic.h" +#include "common-hal/_bleio/Service.h" +#include "common-hal/_bleio/UUID.h" + +typedef struct _bleio_characteristic_obj { + mp_obj_base_t base; + // Will be MP_OBJ_NULL before being assigned to a Service. + bleio_service_obj_t *service; + bleio_uuid_obj_t *uuid; + mp_obj_t value; + uint16_t max_length; + bool fixed_length; + uint16_t handle; + bleio_characteristic_properties_t props; + bleio_attribute_security_mode_t read_perm; + bleio_attribute_security_mode_t write_perm; + bleio_descriptor_obj_t *descriptor_list; + uint16_t user_desc_handle; + uint16_t cccd_handle; + uint16_t sccd_handle; +} bleio_characteristic_obj_t; + +#endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_CHARACTERISTIC_H diff --git a/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c b/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c new file mode 100644 index 0000000000..6f848f8583 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c @@ -0,0 +1,151 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 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 +#include + +#include "lib/utils/interrupt_char.h" +#include "py/runtime.h" +#include "py/stream.h" + +#include "shared-bindings/_bleio/__init__.h" +#include "shared-bindings/_bleio/Connection.h" +#include "supervisor/shared/tick.h" +#include "common-hal/_bleio/CharacteristicBuffer.h" + +// Push all the data onto the ring buffer. When the buffer is full, new bytes will be dropped. +STATIC void write_to_ringbuf(bleio_characteristic_buffer_obj_t *self, uint8_t *data, uint16_t len) { + uint8_t is_nested_critical_region; + sd_nvic_critical_region_enter(&is_nested_critical_region); + ringbuf_put_n(&self->ringbuf, data, len); + sd_nvic_critical_region_exit(is_nested_critical_region); +} + +STATIC bool characteristic_buffer_on_ble_evt(ble_evt_t *ble_evt, void *param) { + bleio_characteristic_buffer_obj_t *self = (bleio_characteristic_buffer_obj_t *) param; + switch (ble_evt->header.evt_id) { + case BLE_GATTS_EVT_WRITE: { + // A client wrote to this server characteristic. + + ble_gatts_evt_write_t *evt_write = &ble_evt->evt.gatts_evt.params.write; + // Event handle must match the handle for my characteristic. + if (evt_write->handle == self->characteristic->handle) { + write_to_ringbuf(self, evt_write->data, evt_write->len); + } + break; + } + + case BLE_GATTC_EVT_HVX: { + // A remote service wrote to this characteristic. + + ble_gattc_evt_hvx_t* evt_hvx = &ble_evt->evt.gattc_evt.params.hvx; + // Must be a notification, and event handle must match the handle for my characteristic. + if (evt_hvx->type == BLE_GATT_HVX_NOTIFICATION && + evt_hvx->handle == self->characteristic->handle) { + write_to_ringbuf(self, evt_hvx->data, evt_hvx->len); + } + break; + } + default: + return false; + break; + } + return true; +} + +// Assumes that timeout and buffer_size have been validated before call. +void common_hal_bleio_characteristic_buffer_construct(bleio_characteristic_buffer_obj_t *self, + bleio_characteristic_obj_t *characteristic, + mp_float_t timeout, + size_t buffer_size) { + + self->characteristic = characteristic; + self->timeout_ms = timeout * 1000; + // This is a macro. + // true means long-lived, so it won't be moved. + ringbuf_alloc(&self->ringbuf, buffer_size, true); + + ble_drv_add_event_handler(characteristic_buffer_on_ble_evt, self); + +} + +uint32_t common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer_obj_t *self, uint8_t *data, size_t len, int *errcode) { + uint64_t start_ticks = supervisor_ticks_ms64(); + + // Wait for all bytes received or timeout + while ( (ringbuf_num_filled(&self->ringbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { + RUN_BACKGROUND_TASKS; + // Allow user to break out of a timeout with a KeyboardInterrupt. + if ( mp_hal_is_interrupted() ) { + return 0; + } + } + + // Copy received data. Lock out write interrupt handler while copying. + uint8_t is_nested_critical_region; + sd_nvic_critical_region_enter(&is_nested_critical_region); + + uint32_t num_bytes_read = ringbuf_get_n(&self->ringbuf, data, len); + + // Writes now OK. + sd_nvic_critical_region_exit(is_nested_critical_region); + + return num_bytes_read; +} + +uint32_t common_hal_bleio_characteristic_buffer_rx_characters_available(bleio_characteristic_buffer_obj_t *self) { + uint8_t is_nested_critical_region; + sd_nvic_critical_region_enter(&is_nested_critical_region); + uint16_t count = ringbuf_num_filled(&self->ringbuf); + sd_nvic_critical_region_exit(is_nested_critical_region); + return count; +} + +void common_hal_bleio_characteristic_buffer_clear_rx_buffer(bleio_characteristic_buffer_obj_t *self) { + // prevent conflict with uart irq + uint8_t is_nested_critical_region; + sd_nvic_critical_region_enter(&is_nested_critical_region); + ringbuf_clear(&self->ringbuf); + sd_nvic_critical_region_exit(is_nested_critical_region); +} + +bool common_hal_bleio_characteristic_buffer_deinited(bleio_characteristic_buffer_obj_t *self) { + return self->characteristic == NULL; +} + +void common_hal_bleio_characteristic_buffer_deinit(bleio_characteristic_buffer_obj_t *self) { + if (!common_hal_bleio_characteristic_buffer_deinited(self)) { + ble_drv_remove_event_handler(characteristic_buffer_on_ble_evt, self); + } +} + +bool common_hal_bleio_characteristic_buffer_connected(bleio_characteristic_buffer_obj_t *self) { + return self->characteristic != NULL && + self->characteristic->service != NULL && + (!self->characteristic->service->is_remote || + (self->characteristic->service->connection != MP_OBJ_NULL && + common_hal_bleio_connection_get_connected(self->characteristic->service->connection))); +} diff --git a/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.h b/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.h new file mode 100644 index 0000000000..8738d2c59c --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.h @@ -0,0 +1,41 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 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. + */ + +#ifndef MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_CHARACTERISTICBUFFER_H +#define MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_CHARACTERISTICBUFFER_H + +#include "py/ringbuf.h" +#include "shared-bindings/_bleio/Characteristic.h" + +typedef struct { + mp_obj_base_t base; + bleio_characteristic_obj_t *characteristic; + uint32_t timeout_ms; + // Ring buffer storing consecutive incoming values. + ringbuf_t ringbuf; +} bleio_characteristic_buffer_obj_t; + +#endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_CHARACTERISTICBUFFER_H diff --git a/devices/ble_hci/common-hal/_bleio/Connection.c b/devices/ble_hci/common-hal/_bleio/Connection.c new file mode 100644 index 0000000000..6c63f4261f --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/Connection.c @@ -0,0 +1,768 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * Copyright (c) 2018 Artur Pacholec + * + * 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/_bleio/Connection.h" + +#include +#include + +#include "lib/utils/interrupt_char.h" +#include "py/gc.h" +#include "py/objlist.h" +#include "py/objstr.h" +#include "py/qstr.h" +#include "py/runtime.h" +#include "shared-bindings/_bleio/__init__.h" +#include "shared-bindings/_bleio/Adapter.h" +#include "shared-bindings/_bleio/Attribute.h" +#include "shared-bindings/_bleio/Characteristic.h" +#include "shared-bindings/_bleio/Service.h" +#include "shared-bindings/_bleio/UUID.h" +#include "supervisor/shared/tick.h" + +#include "common-hal/_bleio/bonding.h" + +#define BLE_ADV_LENGTH_FIELD_SIZE 1 +#define BLE_ADV_AD_TYPE_FIELD_SIZE 1 +#define BLE_AD_TYPE_FLAGS_DATA_SIZE 1 + +static const ble_gap_sec_params_t pairing_sec_params = { + .bond = 1, + .mitm = 0, + .lesc = 0, + .keypress = 0, + .oob = 0, + .io_caps = BLE_GAP_IO_CAPS_NONE, + .min_key_size = 7, + .max_key_size = 16, + .kdist_own = { .enc = 1, .id = 1}, + .kdist_peer = { .enc = 1, .id = 1}, +}; + +#define CONNECTION_DEBUG (1) +#if CONNECTION_DEBUG + #define CONNECTION_DEBUG_PRINTF(...) printf(__VA_ARGS__) +#else + #define CONNECTION_DEBUG_PRINTF(...) +#endif + +static volatile bool m_discovery_in_process; +static volatile bool m_discovery_successful; + +static bleio_service_obj_t *m_char_discovery_service; +static bleio_characteristic_obj_t *m_desc_discovery_characteristic; + +bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { + bleio_connection_internal_t *self = (bleio_connection_internal_t*)self_in; + + if (BLE_GAP_EVT_BASE <= ble_evt->header.evt_id && ble_evt->header.evt_id <= BLE_GAP_EVT_LAST && + ble_evt->evt.gap_evt.conn_handle != self->conn_handle) { + return false; + } + if (BLE_GATTS_EVT_BASE <= ble_evt->header.evt_id && ble_evt->header.evt_id <= BLE_GATTS_EVT_LAST && + ble_evt->evt.gatts_evt.conn_handle != self->conn_handle) { + return false; + } + + switch (ble_evt->header.evt_id) { + case BLE_GAP_EVT_DISCONNECTED: + // Adapter.c does the work for this event. + break; + + case BLE_GAP_EVT_PHY_UPDATE_REQUEST: { + ble_gap_phys_t const phys = { + .rx_phys = BLE_GAP_PHY_AUTO, + .tx_phys = BLE_GAP_PHY_AUTO, + }; + sd_ble_gap_phy_update(ble_evt->evt.gap_evt.conn_handle, &phys); + break; + } + + case BLE_GAP_EVT_PHY_UPDATE: { // 0x22 + break; + } + + case BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST: + // SoftDevice will respond to a length update request. + sd_ble_gap_data_length_update(self->conn_handle, NULL, NULL); + break; + + case BLE_GAP_EVT_DATA_LENGTH_UPDATE: { // 0x24 + break; + } + + case BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST: { + ble_gatts_evt_exchange_mtu_request_t *request = + &ble_evt->evt.gatts_evt.params.exchange_mtu_request; + + uint16_t new_mtu = BLE_GATTS_VAR_ATTR_LEN_MAX; + if (request->client_rx_mtu < new_mtu) { + new_mtu = request->client_rx_mtu; + } + if (new_mtu < BLE_GATT_ATT_MTU_DEFAULT) { + new_mtu = BLE_GATT_ATT_MTU_DEFAULT; + } + if (self->mtu > 0) { + new_mtu = self->mtu; + } + + self->mtu = new_mtu; + sd_ble_gatts_exchange_mtu_reply(self->conn_handle, new_mtu); + break; + } + + + case BLE_GATTC_EVT_EXCHANGE_MTU_RSP: { + ble_gattc_evt_exchange_mtu_rsp_t *response = + &ble_evt->evt.gattc_evt.params.exchange_mtu_rsp; + + self->mtu = response->server_rx_mtu; + break; + } + + case BLE_GATTS_EVT_WRITE: + // A client wrote a value. + // If we are bonded and it's a CCCD (UUID 0x2902), store the CCCD value. + if (self->conn_handle != BLE_CONN_HANDLE_INVALID && + self->pair_status == PAIR_PAIRED && + ble_evt->evt.gatts_evt.params.write.uuid.type == BLE_UUID_TYPE_BLE && + ble_evt->evt.gatts_evt.params.write.uuid.uuid == 0x2902) { + // + // Save sys_attr data (CCCD state) in bonding area at + // next opportunity, but also remember time of this + // request, so we can consolidate closely-spaced requests. + self->do_bond_cccds = true; + self->do_bond_cccds_request_time = supervisor_ticks_ms64(); + } + // Return false so other handlers get this event as well. + return false; + + case BLE_GATTS_EVT_SYS_ATTR_MISSING: + sd_ble_gatts_sys_attr_set(self->conn_handle, NULL, 0, 0); + break; + + #if CIRCUITPY_VERBOSE_BLE + // Use read authorization to snoop on all reads when doing verbose debugging. + case BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST: { + + ble_gatts_evt_rw_authorize_request_t *request = + &ble_evt->evt.gatts_evt.params.authorize_request; + + mp_printf(&mp_plat_print, "Read %x offset %d ", request->request.read.handle, request->request.read.offset); + uint8_t value_bytes[22]; + ble_gatts_value_t value; + value.offset = request->request.read.offset; + value.len = 22; + value.p_value = value_bytes; + + sd_ble_gatts_value_get(self->conn_handle, request->request.read.handle, &value); + size_t len = value.len; + if (len > 22) { + len = 22; + } + for (uint8_t i = 0; i < len; i++) { + mp_printf(&mp_plat_print, " %02x", value_bytes[i]); + } + mp_printf(&mp_plat_print, "\n"); + ble_gatts_rw_authorize_reply_params_t reply; + reply.type = request->type; + reply.params.read.gatt_status = BLE_GATT_STATUS_SUCCESS; + reply.params.read.update = false; + reply.params.read.offset = request->request.read.offset; + sd_ble_gatts_rw_authorize_reply(self->conn_handle, &reply); + break; + } + #endif + + case BLE_GATTS_EVT_HVN_TX_COMPLETE: // Capture this for now. 0x55 + break; + case BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST: { + self->conn_params_updating = true; + ble_gap_evt_conn_param_update_request_t *request = + &ble_evt->evt.gap_evt.params.conn_param_update_request; + sd_ble_gap_conn_param_update(self->conn_handle, &request->conn_params); + break; + } + case BLE_GAP_EVT_CONN_PARAM_UPDATE: { // 0x12 + ble_gap_evt_conn_param_update_t *result = + &ble_evt->evt.gap_evt.params.conn_param_update; + + #if CIRCUITPY_VERBOSE_BLE + ble_gap_conn_params_t *cp = &ble_evt->evt.gap_evt.params.conn_param_update.conn_params; + mp_printf(&mp_plat_print, "conn params updated: min_ci %d max_ci %d s_l %d sup_timeout %d\n", cp->min_conn_interval, cp->max_conn_interval, cp->slave_latency, cp->conn_sup_timeout); + #endif + + memcpy(&self->conn_params, &result->conn_params, sizeof(ble_gap_conn_params_t)); + self->conn_params_updating = false; + break; + } + case BLE_GAP_EVT_SEC_PARAMS_REQUEST: { + // First time pairing. + // 1. Either we or peer initiate the process + // 2. Peer asks for security parameters using BLE_GAP_EVT_SEC_PARAMS_REQUEST. + // 3. Pair Key exchange ("just works" implemented now; TODO: out-of-band key pairing) + // 4. Connection is secured: BLE_GAP_EVT_CONN_SEC_UPDATE + // 5. Long-term Keys exchanged: BLE_GAP_EVT_AUTH_STATUS + + bonding_clear_keys(&self->bonding_keys); + self->ediv = EDIV_INVALID; + ble_gap_sec_keyset_t keyset = { + .keys_own = { + .p_enc_key = &self->bonding_keys.own_enc, + .p_id_key = NULL, + .p_sign_key = NULL, + .p_pk = NULL + }, + + .keys_peer = { + .p_enc_key = &self->bonding_keys.peer_enc, + .p_id_key = &self->bonding_keys.peer_id, + .p_sign_key = NULL, + .p_pk = NULL + } + }; + + sd_ble_gap_sec_params_reply(self->conn_handle, BLE_GAP_SEC_STATUS_SUCCESS, + self->is_central ? NULL : &pairing_sec_params, + &keyset); + break; + } + + case BLE_GAP_EVT_LESC_DHKEY_REQUEST: + // TODO for LESC pairing: + // sd_ble_gap_lesc_dhkey_reply(...); + break; + + case BLE_GAP_EVT_AUTH_STATUS: { // 0x19 + // Key exchange completed. + ble_gap_evt_auth_status_t* status = &ble_evt->evt.gap_evt.params.auth_status; + self->sec_status = status->auth_status; + if (status->auth_status == BLE_GAP_SEC_STATUS_SUCCESS) { + self->ediv = self->bonding_keys.own_enc.master_id.ediv; + self->pair_status = PAIR_PAIRED; + // Save keys in bonding area at next opportunity. + self->do_bond_keys = true; + } else { + // Inform busy-waiter pairing has failed. + self->pair_status = PAIR_NOT_PAIRED; + } + break; + } + + case BLE_GAP_EVT_SEC_INFO_REQUEST: { // 0x14 + // Peer asks for the stored keys. + // - load key and return if bonded previously. + // - Else return NULL --> Initiate key exchange + ble_gap_evt_sec_info_request_t* sec_info_request = &ble_evt->evt.gap_evt.params.sec_info_request; + (void) sec_info_request; + if ( bonding_load_keys(self->is_central, sec_info_request->master_id.ediv, &self->bonding_keys) ) { + sd_ble_gap_sec_info_reply( + self->conn_handle, + &self->bonding_keys.own_enc.enc_info, + &self->bonding_keys.peer_id.id_info, + NULL); + self->ediv = self->bonding_keys.own_enc.master_id.ediv; + } else { + // We don't have stored keys. Ask for keys. + sd_ble_gap_sec_info_reply(self->conn_handle, NULL, NULL, NULL); + } + break; + } + + case BLE_GAP_EVT_CONN_SEC_UPDATE: { // 0x1a + // We get this both on first-time pairing and on subsequent pairings using stored keys. + ble_gap_conn_sec_t* conn_sec = &ble_evt->evt.gap_evt.params.conn_sec_update.conn_sec; + if (conn_sec->sec_mode.sm <= 1 && conn_sec->sec_mode.lv <= 1) { + // Security setup did not succeed: + // mode 0, level 0 means no access + // mode 1, level 1 means open link + // mode >=1 and/or level >=1 means encryption is set up + self->pair_status = PAIR_NOT_PAIRED; + } else { + if (bonding_load_cccd_info(self->is_central, self->conn_handle, self->ediv)) { + // Did an sd_ble_gatts_sys_attr_set() with the stored sys_attr values. + } else { + // No matching bonding found, so use fresh system attributes. + sd_ble_gatts_sys_attr_set(self->conn_handle, NULL, 0, 0); + } + self->pair_status = PAIR_PAIRED; + } + break; + } + + default: + return false; + } + return true; +} + +void bleio_connection_clear(bleio_connection_internal_t *self) { + self->remote_service_list = NULL; + + self->conn_handle = BLE_CONN_HANDLE_INVALID; + self->pair_status = PAIR_NOT_PAIRED; + bonding_clear_keys(&self->bonding_keys); +} + +bool common_hal_bleio_connection_get_paired(bleio_connection_obj_t *self) { + if (self->connection == NULL) { + return false; + } + return self->connection->pair_status == PAIR_PAIRED; +} + +bool common_hal_bleio_connection_get_connected(bleio_connection_obj_t *self) { + if (self->connection == NULL) { + return false; + } + return self->connection->conn_handle != BLE_CONN_HANDLE_INVALID; +} + +void common_hal_bleio_connection_disconnect(bleio_connection_internal_t *self) { + sd_ble_gap_disconnect(self->conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION); +} + +void common_hal_bleio_connection_pair(bleio_connection_internal_t *self, bool bond) { + self->pair_status = PAIR_WAITING; + + check_nrf_error(sd_ble_gap_authenticate(self->conn_handle, &pairing_sec_params)); + + while (self->pair_status == PAIR_WAITING && !mp_hal_is_interrupted()) { + RUN_BACKGROUND_TASKS; + } + if (mp_hal_is_interrupted()) { + return; + } + check_sec_status(self->sec_status); +} + +mp_float_t common_hal_bleio_connection_get_connection_interval(bleio_connection_internal_t *self) { + while (self->conn_params_updating && !mp_hal_is_interrupted()) { + RUN_BACKGROUND_TASKS; + } + return 1.25f * self->conn_params.min_conn_interval; +} + +// Return the current negotiated MTU length, minus overhead. +mp_int_t common_hal_bleio_connection_get_max_packet_length(bleio_connection_internal_t *self) { + return (self->mtu == 0 ? BLE_GATT_ATT_MTU_DEFAULT : self->mtu) - 3; +} + +void common_hal_bleio_connection_set_connection_interval(bleio_connection_internal_t *self, mp_float_t new_interval) { + self->conn_params_updating = true; + uint16_t interval = new_interval / 1.25f; + self->conn_params.min_conn_interval = interval; + self->conn_params.max_conn_interval = interval; + uint32_t status = NRF_ERROR_BUSY; + while (status == NRF_ERROR_BUSY) { + status = sd_ble_gap_conn_param_update(self->conn_handle, &self->conn_params); + RUN_BACKGROUND_TASKS; + } + check_nrf_error(status); +} + +// service_uuid may be NULL, to discover all services. +STATIC bool discover_next_services(bleio_connection_internal_t* connection, uint16_t start_handle, ble_uuid_t *service_uuid) { + m_discovery_successful = false; + m_discovery_in_process = true; + + uint32_t nrf_err = NRF_ERROR_BUSY; + while (nrf_err == NRF_ERROR_BUSY) { + nrf_err = sd_ble_gattc_primary_services_discover(connection->conn_handle, start_handle, service_uuid); + } + check_nrf_error(nrf_err); + + // Wait for a discovery event. + while (m_discovery_in_process) { + MICROPY_VM_HOOK_LOOP; + } + return m_discovery_successful; +} + +STATIC bool discover_next_characteristics(bleio_connection_internal_t* connection, bleio_service_obj_t *service, uint16_t start_handle) { + m_char_discovery_service = service; + + ble_gattc_handle_range_t handle_range; + handle_range.start_handle = start_handle; + handle_range.end_handle = service->end_handle; + + m_discovery_successful = false; + m_discovery_in_process = true; + + uint32_t err_code = sd_ble_gattc_characteristics_discover(connection->conn_handle, &handle_range); + if (err_code != NRF_SUCCESS) { + return false; + } + + // Wait for a discovery event. + while (m_discovery_in_process) { + MICROPY_VM_HOOK_LOOP; + } + return m_discovery_successful; +} + +STATIC bool discover_next_descriptors(bleio_connection_internal_t* connection, bleio_characteristic_obj_t *characteristic, uint16_t start_handle, uint16_t end_handle) { + m_desc_discovery_characteristic = characteristic; + + ble_gattc_handle_range_t handle_range; + handle_range.start_handle = start_handle; + handle_range.end_handle = end_handle; + + m_discovery_successful = false; + m_discovery_in_process = true; + + uint32_t err_code = sd_ble_gattc_descriptors_discover(connection->conn_handle, &handle_range); + if (err_code != NRF_SUCCESS) { + return false; + } + + // Wait for a discovery event. + while (m_discovery_in_process) { + MICROPY_VM_HOOK_LOOP; + } + return m_discovery_successful; +} + +STATIC void on_primary_srv_discovery_rsp(ble_gattc_evt_prim_srvc_disc_rsp_t *response, bleio_connection_internal_t* connection) { + bleio_service_obj_t* tail = connection->remote_service_list; + + for (size_t i = 0; i < response->count; ++i) { + ble_gattc_service_t *gattc_service = &response->services[i]; + + bleio_service_obj_t *service = m_new_obj(bleio_service_obj_t); + service->base.type = &bleio_service_type; + + // Initialize several fields at once. + bleio_service_from_connection(service, bleio_connection_new_from_internal(connection)); + + service->is_remote = true; + service->start_handle = gattc_service->handle_range.start_handle; + service->end_handle = gattc_service->handle_range.end_handle; + service->handle = gattc_service->handle_range.start_handle; + + if (gattc_service->uuid.type != BLE_UUID_TYPE_UNKNOWN) { + // Known service UUID. + bleio_uuid_obj_t *uuid = m_new_obj(bleio_uuid_obj_t); + uuid->base.type = &bleio_uuid_type; + bleio_uuid_construct_from_nrf_ble_uuid(uuid, &gattc_service->uuid); + service->uuid = uuid; + } else { + // The discovery response contained a 128-bit UUID that has not yet been registered with the + // softdevice via sd_ble_uuid_vs_add(). We need to fetch the 128-bit value and register it. + // For now, just set the UUID to NULL. + service->uuid = NULL; + } + + service->next = tail; + tail = service; + } + + connection->remote_service_list = tail; + + if (response->count > 0) { + m_discovery_successful = true; + } + m_discovery_in_process = false; +} + +STATIC void on_char_discovery_rsp(ble_gattc_evt_char_disc_rsp_t *response, bleio_connection_internal_t* connection) { + for (size_t i = 0; i < response->count; ++i) { + ble_gattc_char_t *gattc_char = &response->chars[i]; + + bleio_characteristic_obj_t *characteristic = m_new_obj(bleio_characteristic_obj_t); + characteristic->base.type = &bleio_characteristic_type; + + bleio_uuid_obj_t *uuid = NULL; + + if (gattc_char->uuid.type != BLE_UUID_TYPE_UNKNOWN) { + // Known characteristic UUID. + uuid = m_new_obj(bleio_uuid_obj_t); + uuid->base.type = &bleio_uuid_type; + bleio_uuid_construct_from_nrf_ble_uuid(uuid, &gattc_char->uuid); + } else { + // The discovery response contained a 128-bit UUID that has not yet been registered with the + // softdevice via sd_ble_uuid_vs_add(). We need to fetch the 128-bit value and register it. + // For now, just leave the UUID as NULL. + } + + bleio_characteristic_properties_t props = + (gattc_char->char_props.broadcast ? CHAR_PROP_BROADCAST : 0) | + (gattc_char->char_props.indicate ? CHAR_PROP_INDICATE : 0) | + (gattc_char->char_props.notify ? CHAR_PROP_NOTIFY : 0) | + (gattc_char->char_props.read ? CHAR_PROP_READ : 0) | + (gattc_char->char_props.write ? CHAR_PROP_WRITE : 0) | + (gattc_char->char_props.write_wo_resp ? CHAR_PROP_WRITE_NO_RESPONSE : 0); + + // Call common_hal_bleio_characteristic_construct() to initalize some fields and set up evt handler. + common_hal_bleio_characteristic_construct( + characteristic, m_char_discovery_service, gattc_char->handle_value, uuid, + props, SECURITY_MODE_OPEN, SECURITY_MODE_OPEN, + GATT_MAX_DATA_LENGTH, false, // max_length, fixed_length: values may not matter for gattc + NULL); + + mp_obj_list_append(m_char_discovery_service->characteristic_list, MP_OBJ_FROM_PTR(characteristic)); + } + + if (response->count > 0) { + m_discovery_successful = true; + } + m_discovery_in_process = false; +} + +STATIC void on_desc_discovery_rsp(ble_gattc_evt_desc_disc_rsp_t *response, bleio_connection_internal_t* connection) { + for (size_t i = 0; i < response->count; ++i) { + ble_gattc_desc_t *gattc_desc = &response->descs[i]; + + // Remember handles for certain well-known descriptors. + switch (gattc_desc->uuid.uuid) { + case BLE_UUID_DESCRIPTOR_CLIENT_CHAR_CONFIG: + m_desc_discovery_characteristic->cccd_handle = gattc_desc->handle; + break; + + case BLE_UUID_DESCRIPTOR_SERVER_CHAR_CONFIG: + m_desc_discovery_characteristic->sccd_handle = gattc_desc->handle; + break; + + case BLE_UUID_DESCRIPTOR_CHAR_USER_DESC: + m_desc_discovery_characteristic->user_desc_handle = gattc_desc->handle; + break; + + default: + // TODO: sd_ble_gattc_descriptors_discover() can return things that are not descriptors, + // so ignore those. + // https://devzone.nordicsemi.com/f/nordic-q-a/49500/sd_ble_gattc_descriptors_discover-is-returning-attributes-that-are-not-descriptors + break; + } + + bleio_descriptor_obj_t *descriptor = m_new_obj(bleio_descriptor_obj_t); + descriptor->base.type = &bleio_descriptor_type; + + bleio_uuid_obj_t *uuid = NULL; + + if (gattc_desc->uuid.type != BLE_UUID_TYPE_UNKNOWN) { + // Known descriptor UUID. + uuid = m_new_obj(bleio_uuid_obj_t); + uuid->base.type = &bleio_uuid_type; + bleio_uuid_construct_from_nrf_ble_uuid(uuid, &gattc_desc->uuid); + } else { + // The discovery response contained a 128-bit UUID that has not yet been registered with the + // softdevice via sd_ble_uuid_vs_add(). We need to fetch the 128-bit value and register it. + // For now, just leave the UUID as NULL. + } + + common_hal_bleio_descriptor_construct( + descriptor, m_desc_discovery_characteristic, uuid, + SECURITY_MODE_OPEN, SECURITY_MODE_OPEN, + GATT_MAX_DATA_LENGTH, false, mp_const_empty_bytes); + descriptor->handle = gattc_desc->handle; + + mp_obj_list_append(m_desc_discovery_characteristic->descriptor_list, MP_OBJ_FROM_PTR(descriptor)); + } + + if (response->count > 0) { + m_discovery_successful = true; + } + m_discovery_in_process = false; +} + +STATIC bool discovery_on_ble_evt(ble_evt_t *ble_evt, mp_obj_t payload) { + bleio_connection_internal_t* connection = MP_OBJ_TO_PTR(payload); + switch (ble_evt->header.evt_id) { + case BLE_GAP_EVT_DISCONNECTED: + m_discovery_successful = false; + m_discovery_in_process = false; + break; + + case BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP: + on_primary_srv_discovery_rsp(&ble_evt->evt.gattc_evt.params.prim_srvc_disc_rsp, connection); + break; + + case BLE_GATTC_EVT_CHAR_DISC_RSP: + on_char_discovery_rsp(&ble_evt->evt.gattc_evt.params.char_disc_rsp, connection); + break; + + case BLE_GATTC_EVT_DESC_DISC_RSP: + on_desc_discovery_rsp(&ble_evt->evt.gattc_evt.params.desc_disc_rsp, connection); + break; + + default: + // CONNECTION_DEBUG_PRINTF(&mp_plat_print, "Unhandled discovery event: 0x%04x\n", ble_evt->header.evt_id); + return false; + break; + } + return true; +} + +STATIC void discover_remote_services(bleio_connection_internal_t *self, mp_obj_t service_uuids_whitelist) { + ble_drv_add_event_handler(discovery_on_ble_evt, self); + + // Start over with an empty list. + self->remote_service_list = NULL; + + if (service_uuids_whitelist == mp_const_none) { + // List of service UUID's not given, so discover all available services. + + uint16_t next_service_start_handle = BLE_GATT_HANDLE_START; + + while (discover_next_services(self, next_service_start_handle, MP_OBJ_NULL)) { + // discover_next_services() appends to remote_services_list. + + // Get the most recently discovered service, and then ask for services + // whose handles start after the last attribute handle inside that service. + const bleio_service_obj_t *service = self->remote_service_list; + next_service_start_handle = service->end_handle + 1; + } + } else { + mp_obj_iter_buf_t iter_buf; + mp_obj_t iterable = mp_getiter(service_uuids_whitelist, &iter_buf); + mp_obj_t uuid_obj; + while ((uuid_obj = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) { + if (!MP_OBJ_IS_TYPE(uuid_obj, &bleio_uuid_type)) { + mp_raise_TypeError(translate("non-UUID found in service_uuids_whitelist")); + } + bleio_uuid_obj_t *uuid = MP_OBJ_TO_PTR(uuid_obj); + + ble_uuid_t nrf_uuid; + bleio_uuid_convert_to_nrf_ble_uuid(uuid, &nrf_uuid); + + // Service might or might not be discovered; that's ok. Caller has to check + // Central.remote_services to find out. + // We only need to call this once for each service to discover. + discover_next_services(self, BLE_GATT_HANDLE_START, &nrf_uuid); + } + } + + + bleio_service_obj_t *service = self->remote_service_list; + while (service != NULL) { + // Skip the service if it had an unknown (unregistered) UUID. + if (service->uuid == NULL) { + service = service->next; + continue; + } + + uint16_t next_char_start_handle = service->start_handle; + + // Stop when we go past the end of the range of handles for this service or + // discovery call returns nothing. + // discover_next_characteristics() appends to the characteristic_list. + while (next_char_start_handle <= service->end_handle && + discover_next_characteristics(self, service, next_char_start_handle)) { + + + // Get the most recently discovered characteristic, and then ask for characteristics + // whose handles start after the last attribute handle inside that characteristic. + const bleio_characteristic_obj_t *characteristic = + MP_OBJ_TO_PTR(service->characteristic_list->items[service->characteristic_list->len - 1]); + + next_char_start_handle = characteristic->handle + 1; + } + + // Got characteristics for this service. Now discover descriptors for each characteristic. + size_t char_list_len = service->characteristic_list->len; + for (size_t char_idx = 0; char_idx < char_list_len; ++char_idx) { + bleio_characteristic_obj_t *characteristic = + MP_OBJ_TO_PTR(service->characteristic_list->items[char_idx]); + const bool last_characteristic = char_idx == char_list_len - 1; + bleio_characteristic_obj_t *next_characteristic = last_characteristic + ? NULL + : MP_OBJ_TO_PTR(service->characteristic_list->items[char_idx + 1]); + + // Skip the characteristic if it had an unknown (unregistered) UUID. + if (characteristic->uuid == NULL) { + continue; + } + + uint16_t next_desc_start_handle = characteristic->handle + 1; + + // Don't run past the end of this service or the beginning of the next characteristic. + uint16_t next_desc_end_handle = next_characteristic == NULL + ? service->end_handle + : next_characteristic->handle - 1; + + // Stop when we go past the end of the range of handles for this service or + // discovery call returns nothing. + // discover_next_descriptors() appends to the descriptor_list. + while (next_desc_start_handle <= service->end_handle && + next_desc_start_handle <= next_desc_end_handle && + discover_next_descriptors(self, characteristic, + next_desc_start_handle, next_desc_end_handle)) { + // Get the most recently discovered descriptor, and then ask for descriptors + // whose handles start after that descriptor's handle. + const bleio_descriptor_obj_t *descriptor = characteristic->descriptor_list; + next_desc_start_handle = descriptor->handle + 1; + } + } + service = service->next; + } + + // This event handler is no longer needed. + ble_drv_remove_event_handler(discovery_on_ble_evt, self); + +} + +mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(bleio_connection_obj_t *self, mp_obj_t service_uuids_whitelist) { + discover_remote_services(self->connection, service_uuids_whitelist); + bleio_connection_ensure_connected(self); + // Convert to a tuple and then clear the list so the callee will take ownership. + mp_obj_tuple_t *services_tuple = service_linked_list_to_tuple(self->connection->remote_service_list); + self->connection->remote_service_list = NULL; + + return services_tuple; +} + +uint16_t bleio_connection_get_conn_handle(bleio_connection_obj_t *self) { + if (self == NULL || self->connection == NULL) { + return BLE_CONN_HANDLE_INVALID; + } + return self->connection->conn_handle; +} + +mp_obj_t bleio_connection_new_from_internal(bleio_connection_internal_t* internal) { + if (internal->connection_obj != mp_const_none) { + return internal->connection_obj; + } + bleio_connection_obj_t *connection = m_new_obj(bleio_connection_obj_t); + connection->base.type = &bleio_connection_type; + connection->connection = internal; + internal->connection_obj = connection; + + return MP_OBJ_FROM_PTR(connection); +} + +// Find the connection that uses the given conn_handle. Return NULL if not found. +bleio_connection_internal_t *bleio_conn_handle_to_connection(uint16_t conn_handle) { + bleio_connection_internal_t *connection; + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + connection = &bleio_connections[i]; + if (connection->conn_handle == conn_handle) { + return connection; + } + } + + return NULL; +} diff --git a/devices/ble_hci/common-hal/_bleio/Connection.h b/devices/ble_hci/common-hal/_bleio/Connection.h new file mode 100644 index 0000000000..1b6616ab10 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/Connection.h @@ -0,0 +1,90 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * Copyright (c) 2018 Artur Pacholec + * + * 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_BLE_HCI_COMMON_HAL_CONNECTION_H +#define MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_CONNECTION_H + +#include + +#include "py/obj.h" +#include "py/objlist.h" + +#include "common-hal/_bleio/__init__.h" +#include "common-hal/_bleio/bonding.h" +#include "shared-module/_bleio/Address.h" +#include "common-hal/_bleio/Service.h" + +typedef enum { + PAIR_NOT_PAIRED, + PAIR_WAITING, + PAIR_PAIRED, +} pair_status_t; + +// We split the Connection object into two so that the internal mechanics can live outside of the +// VM. If it were one object, then we'd risk user code seeing a connection object of theirs be +// reused. +typedef struct { + uint16_t conn_handle; + bool is_central; + // Remote services discovered when this peripheral is acting as a client. + bleio_service_obj_t *remote_service_list; + // The advertising data and scan response buffers are held by us, not by the SD, so we must + // maintain them and not change it. If we need to change the contents during advertising, + // there are tricks to get the SD to notice (see DevZone - TBS). + bonding_keys_t bonding_keys; + // EDIV: Encrypted Diversifier: Identifies LTK during legacy pairing. + uint16_t ediv; + volatile pair_status_t pair_status; + uint8_t sec_status; // Internal security status. + mp_obj_t connection_obj; + ble_drv_evt_handler_entry_t handler_entry; + ble_gap_conn_params_t conn_params; + volatile bool conn_params_updating; + uint16_t mtu; + // Request that CCCD values for this conenction be saved, using sys_attr values. + volatile bool do_bond_cccds; + // Request that security key info for this connection be saved. + volatile bool do_bond_keys; + // Time of setting do_bond_ccds: we delay a bit to consolidate multiple CCCD changes + // into one write. Time is currently in ticks_ms. + uint64_t do_bond_cccds_request_time; +} bleio_connection_internal_t; + +typedef struct { + mp_obj_base_t base; + bleio_connection_internal_t* connection; + // The HCI disconnect reason. + uint8_t disconnect_reason; +} bleio_connection_obj_t; + +bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in); + +uint16_t bleio_connection_get_conn_handle(bleio_connection_obj_t *self); +mp_obj_t bleio_connection_new_from_internal(bleio_connection_internal_t* connection); +bleio_connection_internal_t *bleio_conn_handle_to_connection(uint16_t conn_handle); + +#endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_CONNECTION_H diff --git a/devices/ble_hci/common-hal/_bleio/Descriptor.c b/devices/ble_hci/common-hal/_bleio/Descriptor.c new file mode 100644 index 0000000000..faf50c658c --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/Descriptor.c @@ -0,0 +1,97 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2016 Glenn Ruben Bakke + * + * 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 "shared-bindings/_bleio/__init__.h" +#include "shared-bindings/_bleio/Descriptor.h" +#include "shared-bindings/_bleio/Service.h" +#include "shared-bindings/_bleio/UUID.h" + +void common_hal_bleio_descriptor_construct(bleio_descriptor_obj_t *self, bleio_characteristic_obj_t *characteristic, bleio_uuid_obj_t *uuid, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_buffer_info_t *initial_value_bufinfo) { + self->characteristic = characteristic; + self->uuid = uuid; + self->handle = BLE_GATT_HANDLE_INVALID; + self->read_perm = read_perm; + self->write_perm = write_perm; + + const mp_int_t max_length_max = fixed_length ? BLE_GATTS_FIX_ATTR_LEN_MAX : BLE_GATTS_VAR_ATTR_LEN_MAX; + if (max_length < 0 || max_length > max_length_max) { + mp_raise_ValueError_varg(translate("max_length must be 0-%d when fixed_length is %s"), + max_length_max, fixed_length ? "True" : "False"); + } + self->max_length = max_length; + self->fixed_length = fixed_length; + + common_hal_bleio_descriptor_set_value(self, initial_value_bufinfo); +} + +bleio_uuid_obj_t *common_hal_bleio_descriptor_get_uuid(bleio_descriptor_obj_t *self) { + return self->uuid; +} + +bleio_characteristic_obj_t *common_hal_bleio_descriptor_get_characteristic(bleio_descriptor_obj_t *self) { + return self->characteristic; +} + +size_t common_hal_bleio_descriptor_get_value(bleio_descriptor_obj_t *self, uint8_t* buf, size_t len) { + // Do GATT operations only if this descriptor has been registered + if (self->handle != BLE_GATT_HANDLE_INVALID) { + uint16_t conn_handle = bleio_connection_get_conn_handle(self->characteristic->service->connection); + if (common_hal_bleio_service_get_is_remote(self->characteristic->service)) { + return common_hal_bleio_gattc_read(self->handle, conn_handle, buf, len); + } else { + return common_hal_bleio_gatts_read(self->handle, conn_handle, buf, len); + } + } + + return 0; +} + +void common_hal_bleio_descriptor_set_value(bleio_descriptor_obj_t *self, mp_buffer_info_t *bufinfo) { + if (self->fixed_length && bufinfo->len != self->max_length) { + mp_raise_ValueError(translate("Value length != required fixed length")); + } + if (bufinfo->len > self->max_length) { + mp_raise_ValueError(translate("Value length > max_length")); + } + + self->value = mp_obj_new_bytes(bufinfo->buf, bufinfo->len); + + // Do GATT operations only if this descriptor has been registered. + if (self->handle != BLE_GATT_HANDLE_INVALID) { + uint16_t conn_handle = bleio_connection_get_conn_handle(self->characteristic->service->connection); + if (common_hal_bleio_service_get_is_remote(self->characteristic->service)) { + // false means WRITE_REQ, not write-no-response + common_hal_bleio_gattc_write(self->handle, conn_handle, bufinfo, false); + } else { + common_hal_bleio_gatts_write(self->handle, conn_handle, bufinfo); + } + } + +} diff --git a/devices/ble_hci/common-hal/_bleio/Descriptor.h b/devices/ble_hci/common-hal/_bleio/Descriptor.h new file mode 100644 index 0000000000..097a49f8ec --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/Descriptor.h @@ -0,0 +1,53 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2016 Glenn Ruben Bakke + * + * 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_BLE_HCI_COMMON_HAL_DESCRIPTOR_H +#define MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_DESCRIPTOR_H + +#include "py/obj.h" + +#include "common-hal/_bleio/UUID.h" + +// Forward declare characteristic because it includes a Descriptor. +struct _bleio_characteristic_obj; + +typedef struct _bleio_descriptor_obj { + mp_obj_base_t base; + // Will be MP_OBJ_NULL before being assigned to a Characteristic. + struct _bleio_characteristic_obj *characteristic; + bleio_uuid_obj_t *uuid; + mp_obj_t value; + uint16_t max_length; + bool fixed_length; + uint16_t handle; + bleio_attribute_security_mode_t read_perm; + bleio_attribute_security_mode_t write_perm; + struct _bleio_descriptor_obj* next; +} bleio_descriptor_obj_t; + +#endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_DESCRIPTOR_H diff --git a/devices/ble_hci/common-hal/_bleio/PacketBuffer.c b/devices/ble_hci/common-hal/_bleio/PacketBuffer.c new file mode 100644 index 0000000000..c3f41bc9d4 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/PacketBuffer.c @@ -0,0 +1,402 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019-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 +#include + +#include "lib/utils/interrupt_char.h" +#include "py/runtime.h" +#include "py/stream.h" + +#include "shared-bindings/_bleio/__init__.h" +#include "shared-bindings/_bleio/Connection.h" +#include "shared-bindings/_bleio/PacketBuffer.h" +#include "supervisor/shared/tick.h" + +STATIC void write_to_ringbuf(bleio_packet_buffer_obj_t *self, uint8_t *data, uint16_t len) { + if (len + sizeof(uint16_t) > ringbuf_capacity(&self->ringbuf)) { + // This shouldn't happen. + return; + } + // Push all the data onto the ring buffer. + uint8_t is_nested_critical_region; + sd_nvic_critical_region_enter(&is_nested_critical_region); + // Make room for the new value by dropping the oldest packets first. + while (ringbuf_capacity(&self->ringbuf) - ringbuf_num_filled(&self->ringbuf) < len + sizeof(uint16_t)) { + uint16_t packet_length; + ringbuf_get_n(&self->ringbuf, (uint8_t*) &packet_length, sizeof(uint16_t)); + for (uint16_t i = 0; i < packet_length; i++) { + ringbuf_get(&self->ringbuf); + } + // set an overflow flag? + } + ringbuf_put_n(&self->ringbuf, (uint8_t*) &len, sizeof(uint16_t)); + ringbuf_put_n(&self->ringbuf, data, len); + sd_nvic_critical_region_exit(is_nested_critical_region); +} + +STATIC uint32_t queue_next_write(bleio_packet_buffer_obj_t *self) { + // Queue up the next outgoing buffer. We use two, one that has been passed to the SD for + // transmission (when packet_queued is true) and the other is `pending` and can still be + // modified. By primarily appending to the `pending` buffer we can reduce the protocol overhead + // of the lower level link and ATT layers. + self->packet_queued = false; + if (self->pending_size > 0) { + uint16_t conn_handle = self->conn_handle; + uint32_t err_code; + if (self->client) { + ble_gattc_write_params_t write_params = { + .write_op = self->write_type, + .handle = self->characteristic->handle, + .p_value = self->outgoing[self->pending_index], + .len = self->pending_size, + }; + + err_code = sd_ble_gattc_write(conn_handle, &write_params); + } else { + uint16_t hvx_len = self->pending_size; + + ble_gatts_hvx_params_t hvx_params = { + .handle = self->characteristic->handle, + .type = self->write_type, + .offset = 0, + .p_len = &hvx_len, + .p_data = self->outgoing[self->pending_index], + }; + err_code = sd_ble_gatts_hvx(conn_handle, &hvx_params); + } + if (err_code != NRF_SUCCESS) { + // On error, simply skip updating the pending buffers so that the next HVC or WRITE + // complete event triggers another attempt. + return err_code; + } + self->pending_size = 0; + self->pending_index = (self->pending_index + 1) % 2; + self->packet_queued = true; + } + return NRF_SUCCESS; +} + +STATIC bool packet_buffer_on_ble_client_evt(ble_evt_t *ble_evt, void *param) { + const uint16_t evt_id = ble_evt->header.evt_id; + // Check if this is a GATTC event so we can make sure the conn_handle is valid. + if (evt_id < BLE_GATTC_EVT_BASE || evt_id > BLE_GATTC_EVT_LAST) { + return false; + } + + uint16_t conn_handle = ble_evt->evt.gattc_evt.conn_handle; + bleio_packet_buffer_obj_t *self = (bleio_packet_buffer_obj_t *) param; + if (conn_handle != self->conn_handle) { + return false; + } + switch (evt_id) { + case BLE_GATTC_EVT_HVX: { + // A remote service wrote to this characteristic. + ble_gattc_evt_hvx_t* evt_hvx = &ble_evt->evt.gattc_evt.params.hvx; + // Must be a notification, and event handle must match the handle for my characteristic. + if (evt_hvx->handle == self->characteristic->handle) { + write_to_ringbuf(self, evt_hvx->data, evt_hvx->len); + if (evt_hvx->type == BLE_GATT_HVX_INDICATION) { + sd_ble_gattc_hv_confirm(conn_handle, evt_hvx->handle); + } + } + break; + } + case BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE: { + queue_next_write(self); + break; + } + case BLE_GATTC_EVT_WRITE_RSP: { + queue_next_write(self); + break; + } + default: + return false; + break; + } + return true; +} + +STATIC bool packet_buffer_on_ble_server_evt(ble_evt_t *ble_evt, void *param) { + bleio_packet_buffer_obj_t *self = (bleio_packet_buffer_obj_t *) param; + switch (ble_evt->header.evt_id) { + case BLE_GATTS_EVT_WRITE: { + uint16_t conn_handle = ble_evt->evt.gatts_evt.conn_handle; + // A client wrote to this server characteristic. + + ble_gatts_evt_write_t *evt_write = &ble_evt->evt.gatts_evt.params.write; + + // Event handle must match the handle for my characteristic. + if (evt_write->handle == self->characteristic->handle) { + if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { + self->conn_handle = conn_handle; + } else if (self->conn_handle != conn_handle) { + return false; + } + write_to_ringbuf(self, evt_write->data, evt_write->len); + } else if (evt_write->handle == self->characteristic->cccd_handle) { + uint16_t cccd = *((uint16_t*) evt_write->data); + if (cccd & BLE_GATT_HVX_NOTIFICATION) { + self->conn_handle = conn_handle; + } else { + self->conn_handle = BLE_CONN_HANDLE_INVALID; + } + } + break; + } + case BLE_GAP_EVT_DISCONNECTED: { + if (self->conn_handle == ble_evt->evt.gap_evt.conn_handle) { + self->conn_handle = BLE_CONN_HANDLE_INVALID; + } + } + case BLE_GATTS_EVT_HVN_TX_COMPLETE: { + queue_next_write(self); + } + default: + return false; + break; + } + return true; +} + +void common_hal_bleio_packet_buffer_construct( + bleio_packet_buffer_obj_t *self, bleio_characteristic_obj_t *characteristic, + size_t buffer_size) { + + self->characteristic = characteristic; + self->client = self->characteristic->service->is_remote; + bleio_characteristic_properties_t incoming = self->characteristic->props & (CHAR_PROP_WRITE_NO_RESPONSE | CHAR_PROP_WRITE); + bleio_characteristic_properties_t outgoing = self->characteristic->props & (CHAR_PROP_NOTIFY | CHAR_PROP_INDICATE); + + if (self->client) { + // Swap if we're the client. + bleio_characteristic_properties_t temp = incoming; + incoming = outgoing; + outgoing = temp; + self->conn_handle = bleio_connection_get_conn_handle(MP_OBJ_TO_PTR(self->characteristic->service->connection)); + } else { + self->conn_handle = BLE_CONN_HANDLE_INVALID; + } + + if (incoming) { + if (!ringbuf_alloc(&self->ringbuf, buffer_size * (sizeof(uint16_t) + characteristic->max_length), false)) { + mp_raise_ValueError(translate("Buffer too large and unable to allocate")); + } + } + + if (outgoing) { + self->packet_queued = false; + self->pending_index = 0; + self->pending_size = 0; + self->outgoing[0] = m_malloc(characteristic->max_length, false); + self->outgoing[1] = m_malloc(characteristic->max_length, false); + } else { + self->outgoing[0] = NULL; + self->outgoing[1] = NULL; + } + + if (self->client) { + ble_drv_add_event_handler(packet_buffer_on_ble_client_evt, self); + if (incoming) { + // Prefer notify if both are available. + if (incoming & CHAR_PROP_NOTIFY) { + self->write_type = BLE_GATT_HVX_NOTIFICATION; + common_hal_bleio_characteristic_set_cccd(self->characteristic, true, false); + } else { + common_hal_bleio_characteristic_set_cccd(self->characteristic, false, true); + } + } + if (outgoing) { + self->write_type = BLE_GATT_OP_WRITE_REQ; + if (outgoing & CHAR_PROP_WRITE_NO_RESPONSE) { + self->write_type = BLE_GATT_OP_WRITE_CMD; + } + } + } else { + ble_drv_add_event_handler(packet_buffer_on_ble_server_evt, self); + if (outgoing) { + self->write_type = BLE_GATT_HVX_INDICATION; + if (outgoing & CHAR_PROP_NOTIFY) { + self->write_type = BLE_GATT_HVX_NOTIFICATION; + } + } + } +} + +mp_int_t common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len) { + if (ringbuf_num_filled(&self->ringbuf) < 2) { + return 0; + } + + // Copy received data. Lock out write interrupt handler while copying. + uint8_t is_nested_critical_region; + sd_nvic_critical_region_enter(&is_nested_critical_region); + + // Get packet length, which is in first two bytes of packet. + uint16_t packet_length; + ringbuf_get_n(&self->ringbuf, (uint8_t*) &packet_length, sizeof(uint16_t)); + + mp_int_t ret; + if (packet_length > len) { + // Packet is longer than requested. Return negative of overrun value. + ret = len - packet_length; + // Discard the packet if it's too large. Don't fill data. + while (packet_length--) { + (void) ringbuf_get(&self->ringbuf); + } + } else { + // Read as much as possible, but might be shorter than len. + ringbuf_get_n(&self->ringbuf, data, packet_length); + ret = packet_length; + } + + // Writes now OK. + sd_nvic_critical_region_exit(is_nested_critical_region); + + return ret; +} + +mp_int_t common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len, uint8_t* header, size_t header_len) { + if (self->outgoing[0] == NULL) { + mp_raise_bleio_BluetoothError(translate("Writes not supported on Characteristic")); + } + if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { + return -1; + } + uint16_t outgoing_packet_length = common_hal_bleio_packet_buffer_get_outgoing_packet_length(self); + + if (len + header_len > outgoing_packet_length) { + // Supplied data will not fit in a single BLE packet. + mp_raise_ValueError(translate("Total data to write is larger than outgoing_packet_length")); + } + + if (len + self->pending_size > outgoing_packet_length) { + // No room to append len bytes to packet. Wait until we get a free buffer, + // and keep checking that we haven't been disconnected. + while (self->pending_size != 0 && self->conn_handle != BLE_CONN_HANDLE_INVALID) { + RUN_BACKGROUND_TASKS; + } + } + if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { + return -1; + } + + size_t num_bytes_written = 0; + + uint8_t is_nested_critical_region; + sd_nvic_critical_region_enter(&is_nested_critical_region); + + uint8_t* pending = self->outgoing[self->pending_index]; + + if (self->pending_size == 0) { + memcpy(pending, header, header_len); + self->pending_size += header_len; + num_bytes_written += header_len; + } + memcpy(pending + self->pending_size, data, len); + self->pending_size += len; + num_bytes_written += len; + + sd_nvic_critical_region_exit(is_nested_critical_region); + + // If no writes are queued then sneak in this data. + if (!self->packet_queued) { + queue_next_write(self); + } + return num_bytes_written; +} + +mp_int_t common_hal_bleio_packet_buffer_get_incoming_packet_length(bleio_packet_buffer_obj_t *self) { + // If this PacketBuffer is coming from a remote service via NOTIFY or INDICATE + // the maximum size is what can be sent in one + // BLE packet. But we must be connected to know that value. + // + // Otherwise it can be as long as the characteristic + // will permit, whether or not we're connected. + + if (self->characteristic == NULL) { + return -1; + } + + if (self->characteristic->service != NULL && + self->characteristic->service->is_remote && + (common_hal_bleio_characteristic_get_properties(self->characteristic) & + (CHAR_PROP_INDICATE | CHAR_PROP_NOTIFY))) { + // We are talking to a remote service, and data is arriving via NOTIFY or INDICATE. + if (self->conn_handle != BLE_CONN_HANDLE_INVALID) { + bleio_connection_internal_t *connection = bleio_conn_handle_to_connection(self->conn_handle); + if (connection) { + return MIN(common_hal_bleio_connection_get_max_packet_length(connection), + self->characteristic->max_length); + } + } + // There's no current connection, so we don't know the MTU, and + // we can't tell what the largest incoming packet length would be. + return -1; + } + return self->characteristic->max_length; +} + +mp_int_t common_hal_bleio_packet_buffer_get_outgoing_packet_length(bleio_packet_buffer_obj_t *self) { + // If we are sending data via NOTIFY or INDICATE, the maximum size + // is what can be sent in one BLE packet. But we must be connected + // to know that value. + // + // Otherwise it can be as long as the characteristic + // will permit, whether or not we're connected. + + if (self->characteristic == NULL) { + return -1; + } + + if (self->characteristic->service != NULL && + !self->characteristic->service->is_remote && + (common_hal_bleio_characteristic_get_properties(self->characteristic) & + (CHAR_PROP_INDICATE | CHAR_PROP_NOTIFY))) { + // We are sending to a client, via NOTIFY or INDICATE. + if (self->conn_handle != BLE_CONN_HANDLE_INVALID) { + bleio_connection_internal_t *connection = bleio_conn_handle_to_connection(self->conn_handle); + if (connection) { + return MIN(common_hal_bleio_connection_get_max_packet_length(connection), + self->characteristic->max_length); + } + } + // There's no current connection, so we don't know the MTU, and + // we can't tell what the largest outgoing packet length would be. + return -1; + } + return self->characteristic->max_length; +} + +bool common_hal_bleio_packet_buffer_deinited(bleio_packet_buffer_obj_t *self) { + return self->characteristic == NULL; +} + +void common_hal_bleio_packet_buffer_deinit(bleio_packet_buffer_obj_t *self) { + if (!common_hal_bleio_packet_buffer_deinited(self)) { + ble_drv_remove_event_handler(packet_buffer_on_ble_client_evt, self); + } +} diff --git a/devices/ble_hci/common-hal/_bleio/PacketBuffer.h b/devices/ble_hci/common-hal/_bleio/PacketBuffer.h new file mode 100644 index 0000000000..e1577a9957 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/PacketBuffer.h @@ -0,0 +1,51 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019-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. + */ + +#ifndef MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_PACKETBUFFER_H +#define MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_PACKETBUFFER_H + +#include "py/ringbuf.h" +#include "shared-bindings/_bleio/Characteristic.h" + +typedef struct { + mp_obj_base_t base; + bleio_characteristic_obj_t *characteristic; + // Ring buffer storing consecutive incoming values. + ringbuf_t ringbuf; + // Two outgoing buffers to alternate between. One will be queued for transmission by the SD and + // the other is waiting to be queued and can be extended. + uint8_t* outgoing[2]; + volatile uint16_t pending_size; + // We remember the conn_handle so we can do a NOTIFY/INDICATE to a client. + // We can find out the conn_handle on a Characteristic write or a CCCD write (but not a read). + volatile uint16_t conn_handle; + uint8_t pending_index; + uint8_t write_type; + bool client; + bool packet_queued; +} bleio_packet_buffer_obj_t; + +#endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_PACKETBUFFER_H diff --git a/devices/ble_hci/common-hal/_bleio/Service.c b/devices/ble_hci/common-hal/_bleio/Service.c new file mode 100644 index 0000000000..f194a95dd7 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/Service.c @@ -0,0 +1,147 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * Copyright (c) 2018 Artur Pacholec + * + * 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 "common-hal/_bleio/__init__.h" +#include "shared-bindings/_bleio/Characteristic.h" +#include "shared-bindings/_bleio/Descriptor.h" +#include "shared-bindings/_bleio/Service.h" +#include "shared-bindings/_bleio/Adapter.h" + +uint32_t _common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uuid_obj_t *uuid, bool is_secondary, mp_obj_list_t * characteristic_list) { + self->handle = 0xFFFF; + self->uuid = uuid; + self->characteristic_list = characteristic_list; + self->is_remote = false; + self->connection = NULL; + self->is_secondary = is_secondary; + + ble_uuid_t nordic_uuid; + bleio_uuid_convert_to_nrf_ble_uuid(uuid, &nordic_uuid); + + uint8_t service_type = BLE_GATTS_SRVC_TYPE_PRIMARY; + if (is_secondary) { + service_type = BLE_GATTS_SRVC_TYPE_SECONDARY; + } + + vm_used_ble = true; + + return sd_ble_gatts_service_add(service_type, &nordic_uuid, &self->handle); +} + +void common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uuid_obj_t *uuid, bool is_secondary) { + check_nrf_error(_common_hal_bleio_service_construct(self, uuid, is_secondary, + mp_obj_new_list(0, NULL))); +} + +void bleio_service_from_connection(bleio_service_obj_t *self, mp_obj_t connection) { + self->handle = 0xFFFF; + self->uuid = NULL; + self->characteristic_list = mp_obj_new_list(0, NULL); + self->is_remote = true; + self->is_secondary = false; + self->connection = connection; +} + +bleio_uuid_obj_t *common_hal_bleio_service_get_uuid(bleio_service_obj_t *self) { + return self->uuid; +} + +mp_obj_list_t *common_hal_bleio_service_get_characteristic_list(bleio_service_obj_t *self) { + return self->characteristic_list; +} + +bool common_hal_bleio_service_get_is_remote(bleio_service_obj_t *self) { + return self->is_remote; +} + +bool common_hal_bleio_service_get_is_secondary(bleio_service_obj_t *self) { + return self->is_secondary; +} + +void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, + bleio_characteristic_obj_t *characteristic, + mp_buffer_info_t *initial_value_bufinfo) { + ble_gatts_char_md_t char_md = { + .char_props.broadcast = (characteristic->props & CHAR_PROP_BROADCAST) ? 1 : 0, + .char_props.read = (characteristic->props & CHAR_PROP_READ) ? 1 : 0, + .char_props.write_wo_resp = (characteristic->props & CHAR_PROP_WRITE_NO_RESPONSE) ? 1 : 0, + .char_props.write = (characteristic->props & CHAR_PROP_WRITE) ? 1 : 0, + .char_props.notify = (characteristic->props & CHAR_PROP_NOTIFY) ? 1 : 0, + .char_props.indicate = (characteristic->props & CHAR_PROP_INDICATE) ? 1 : 0, + }; + + ble_gatts_attr_md_t cccd_md = { + .vloc = BLE_GATTS_VLOC_STACK, + }; + + ble_uuid_t char_uuid; + bleio_uuid_convert_to_nrf_ble_uuid(characteristic->uuid, &char_uuid); + + ble_gatts_attr_md_t char_attr_md = { + .vloc = BLE_GATTS_VLOC_STACK, + .vlen = !characteristic->fixed_length, + }; + + if (char_md.char_props.notify || char_md.char_props.indicate) { + BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cccd_md.read_perm); + // Make CCCD write permission match characteristic read permission. + bleio_attribute_gatts_set_security_mode(&cccd_md.write_perm, characteristic->read_perm); + + char_md.p_cccd_md = &cccd_md; + } + + bleio_attribute_gatts_set_security_mode(&char_attr_md.read_perm, characteristic->read_perm); + bleio_attribute_gatts_set_security_mode(&char_attr_md.write_perm, characteristic->write_perm); + #if CIRCUITPY_VERBOSE_BLE + // Turn on read authorization so that we receive an event to print on every read. + char_attr_md.rd_auth = true; + #endif + + ble_gatts_attr_t char_attr = { + .p_uuid = &char_uuid, + .p_attr_md = &char_attr_md, + .init_len = 0, + .p_value = NULL, + .init_offs = 0, + .max_len = characteristic->max_length, + }; + + ble_gatts_char_handles_t char_handles; + + check_nrf_error(sd_ble_gatts_characteristic_add(self->handle, &char_md, &char_attr, &char_handles)); + + characteristic->user_desc_handle = char_handles.user_desc_handle; + characteristic->cccd_handle = char_handles.cccd_handle; + characteristic->sccd_handle = char_handles.sccd_handle; + characteristic->handle = char_handles.value_handle; + #if CIRCUITPY_VERBOSE_BLE + mp_printf(&mp_plat_print, "Char handle %x user %x cccd %x sccd %x\n", characteristic->handle, characteristic->user_desc_handle, characteristic->cccd_handle, characteristic->sccd_handle); + #endif + + mp_obj_list_append(self->characteristic_list, MP_OBJ_FROM_PTR(characteristic)); +} diff --git a/devices/ble_hci/common-hal/_bleio/Service.h b/devices/ble_hci/common-hal/_bleio/Service.h new file mode 100644 index 0000000000..bb8bc61edc --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/Service.h @@ -0,0 +1,54 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * Copyright (c) 2018 Artur Pacholec + * + * 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_BLE_HCI_COMMON_HAL_SERVICE_H +#define MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_SERVICE_H + +#include "py/objlist.h" +#include "common-hal/_bleio/UUID.h" + +typedef struct bleio_service_obj { + mp_obj_base_t base; + // Handle for the local service. + uint16_t handle; + // True if created during discovery. + bool is_remote; + bool is_secondary; + bleio_uuid_obj_t *uuid; + // The connection object is set only when this is a remote service. + // A local service doesn't know the connection. + mp_obj_t connection; + mp_obj_list_t *characteristic_list; + // Range of attribute handles of this remote service. + uint16_t start_handle; + uint16_t end_handle; + struct bleio_service_obj* next; +} bleio_service_obj_t; + +void bleio_service_from_connection(bleio_service_obj_t *self, mp_obj_t connection); + +#endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_SERVICE_H diff --git a/devices/ble_hci/common-hal/_bleio/UUID.c b/devices/ble_hci/common-hal/_bleio/UUID.c new file mode 100644 index 0000000000..1c6c35e477 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/UUID.c @@ -0,0 +1,88 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2016 Glenn Ruben Bakke + * + * 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 "py/runtime.h" +#include "common-hal/_bleio/UUID.h" +#include "shared-bindings/_bleio/__init__.h" +#include "shared-bindings/_bleio/Adapter.h" + +// If uuid128 is NULL, this is a Bluetooth SIG 16-bit UUID. +// If uuid128 is not NULL, it's a 128-bit (16-byte) UUID, with bytes 12 and 13 zero'd out, where +// the 16-bit part goes. Those 16 bits are passed in uuid16. +void common_hal_bleio_uuid_construct(bleio_uuid_obj_t *self, uint32_t uuid16, const uint8_t uuid128[]) { + self->nrf_ble_uuid.uuid = uuid16; + if (uuid128 == NULL) { + self->nrf_ble_uuid.type = BLE_UUID_TYPE_BLE; + } else { + ble_uuid128_t vs_uuid; + memcpy(vs_uuid.uuid128, uuid128, sizeof(vs_uuid.uuid128)); + + // Register this vendor-specific UUID. Bytes 12 and 13 will be zero. + check_nrf_error(sd_ble_uuid_vs_add(&vs_uuid, &self->nrf_ble_uuid.type)); + vm_used_ble = true; + } +} + +uint32_t common_hal_bleio_uuid_get_size(bleio_uuid_obj_t *self) { + // return self->nrf_ble_uuid.type == BLE_UUID_TYPE_BLE ? 16 : 128; +} + +uint32_t common_hal_bleio_uuid_get_uuid16(bleio_uuid_obj_t *self) { + // return self->nrf_ble_uuid.uuid; + return 0; +} + +void common_hal_bleio_uuid_get_uuid128(bleio_uuid_obj_t *self, uint8_t uuid128[16]) { + uint8_t length; + // check_nrf_error(sd_ble_uuid_encode(&self->nrf_ble_uuid, &length, uuid128)); +} + +void common_hal_bleio_uuid_pack_into(bleio_uuid_obj_t *self, uint8_t* buf) { + // if (self->nrf_ble_uuid.type == BLE_UUID_TYPE_BLE) { + // buf[0] = self->nrf_ble_uuid.uuid & 0xff; + // buf[1] = self->nrf_ble_uuid.uuid >> 8; + // } else { + // common_hal_bleio_uuid_get_uuid128(self, buf); + // } +} + +// void bleio_uuid_construct_from_nrf_ble_uuid(bleio_uuid_obj_t *self, ble_uuid_t *nrf_ble_uuid) { +// if (nrf_ble_uuid->type == BLE_UUID_TYPE_UNKNOWN) { +// mp_raise_bleio_BluetoothError(translate("Unexpected nrfx uuid type")); +// } +// self->nrf_ble_uuid.uuid = nrf_ble_uuid->uuid; +// self->nrf_ble_uuid.type = nrf_ble_uuid->type; +// } + +// // Fill in a ble_uuid_t from my values. +// void bleio_uuid_convert_to_nrf_ble_uuid(bleio_uuid_obj_t *self, ble_uuid_t *nrf_ble_uuid) { +// nrf_ble_uuid->uuid = self->nrf_ble_uuid.uuid; +// nrf_ble_uuid->type = self->nrf_ble_uuid.type; +// } diff --git a/devices/ble_hci/common-hal/_bleio/UUID.h b/devices/ble_hci/common-hal/_bleio/UUID.h new file mode 100644 index 0000000000..584a28960b --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/UUID.h @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2016 Glenn Ruben Bakke + * + * 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_BLE_HCI_COMMON_HAL_UUID_H +#define MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_UUID_H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + // Use the native way of storing UUID's: + // - ble_uuid_t.uuid is a 16-bit uuid. + // - ble_uuid_t.type is BLE_UUID_TYPE_BLE if it's a 16-bit Bluetooth SIG UUID. + // or is BLE_UUID_TYPE_VENDOR_BEGIN and higher, which indexes into a table of registered + // 128-bit UUIDs. + // ble_uuid_t nrf_ble_uuid; +} bleio_uuid_obj_t; + +// void bleio_uuid_construct_from_nrf_ble_uuid(bleio_uuid_obj_t *self, ble_uuid_t *nrf_uuid); +// void bleio_uuid_convert_to_nrf_ble_uuid(bleio_uuid_obj_t *self, ble_uuid_t *nrf_uuid); + +#endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_UUID_H diff --git a/devices/ble_hci/common-hal/_bleio/__init__.c b/devices/ble_hci/common-hal/_bleio/__init__.c new file mode 100644 index 0000000000..e84bba6626 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/__init__.c @@ -0,0 +1,246 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2016 Glenn Ruben Bakke + * + * 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 "py/runtime.h" +#include "shared-bindings/_bleio/__init__.h" +#include "shared-bindings/_bleio/Adapter.h" +#include "shared-bindings/_bleio/Characteristic.h" +#include "shared-bindings/_bleio/Connection.h" +#include "shared-bindings/_bleio/Descriptor.h" +#include "shared-bindings/_bleio/Service.h" +#include "shared-bindings/_bleio/UUID.h" +#include "supervisor/shared/bluetooth.h" + +#include "common-hal/_bleio/__init__.h" + +void check_nrf_error(uint32_t err_code) { + if (err_code == NRF_SUCCESS) { + return; + } + switch (err_code) { + case NRF_ERROR_TIMEOUT: + mp_raise_msg(&mp_type_TimeoutError, NULL); + return; + case BLE_ERROR_INVALID_CONN_HANDLE: + mp_raise_bleio_ConnectionError(translate("Not connected")); + return; + default: + mp_raise_bleio_BluetoothError(translate("Unknown soft device error: %04x"), err_code); + break; + } +} + +void check_gatt_status(uint16_t gatt_status) { + if (gatt_status == BLE_GATT_STATUS_SUCCESS) { + return; + } + switch (gatt_status) { + case BLE_GATT_STATUS_ATTERR_INSUF_AUTHENTICATION: + mp_raise_bleio_SecurityError(translate("Insufficient authentication")); + return; + case BLE_GATT_STATUS_ATTERR_INSUF_ENCRYPTION: + mp_raise_bleio_SecurityError(translate("Insufficient encryption")); + return; + default: + mp_raise_bleio_BluetoothError(translate("Unknown gatt error: 0x%04x"), gatt_status); + } +} + +void check_sec_status(uint8_t sec_status) { + if (sec_status == BLE_GAP_SEC_STATUS_SUCCESS) { + return; + } + + switch (sec_status) { + case BLE_GAP_SEC_STATUS_UNSPECIFIED: + mp_raise_bleio_SecurityError(translate("Unspecified issue. Can be that the pairing prompt on the other device was declined or ignored.")); + return; + default: + mp_raise_bleio_SecurityError(translate("Unknown security error: 0x%04x"), sec_status); + } +} + +// Turn off BLE on a reset or reload. +void bleio_reset() { + if (!common_hal_bleio_adapter_get_enabled(&common_hal_bleio_adapter_obj)) { + return; + } + bleio_adapter_reset(&common_hal_bleio_adapter_obj); + if (!vm_used_ble) { + // No user-code BLE operations were done, so we can maintain the supervisor state. + return; + } + common_hal_bleio_adapter_set_enabled(&common_hal_bleio_adapter_obj, false); + bonding_reset(); + supervisor_start_bluetooth(); +} + +// The singleton _bleio.Adapter object, bound to _bleio.adapter +// It currently only has properties and no state +bleio_adapter_obj_t common_hal_bleio_adapter_obj = { + .base = { + .type = &bleio_adapter_type, + }, +}; + +void common_hal_bleio_check_connected(uint16_t conn_handle) { + if (conn_handle == BLE_CONN_HANDLE_INVALID) { + mp_raise_bleio_ConnectionError(translate("Not connected")); + } +} + +// GATTS read of a Characteristic or Descriptor. +size_t common_hal_bleio_gatts_read(uint16_t handle, uint16_t conn_handle, uint8_t* buf, size_t len) { + // conn_handle is ignored unless this is a system attribute. + // If we're not connected, that's OK, because we can still read and write the local value. + + ble_gatts_value_t gatts_value = { + .p_value = buf, + .len = len, + }; + + check_nrf_error(sd_ble_gatts_value_get(conn_handle, handle, &gatts_value)); + + return gatts_value.len; +} + +void common_hal_bleio_gatts_write(uint16_t handle, uint16_t conn_handle, mp_buffer_info_t *bufinfo) { + // conn_handle is ignored unless this is a system attribute. + // If we're not connected, that's OK, because we can still read and write the local value. + + ble_gatts_value_t gatts_value = { + .p_value = bufinfo->buf, + .len = bufinfo->len, + }; + + check_nrf_error(sd_ble_gatts_value_set(conn_handle, handle, &gatts_value)); +} + +typedef struct { + uint8_t* buf; + size_t len; + size_t final_len; + uint16_t conn_handle; + volatile uint16_t status; + volatile bool done; +} read_info_t; + +STATIC bool _on_gattc_read_rsp_evt(ble_evt_t *ble_evt, void *param) { + read_info_t* read = param; + switch (ble_evt->header.evt_id) { + + // More events may be handled later, so keep this as a switch. + + case BLE_GATTC_EVT_READ_RSP: { + ble_gattc_evt_t* evt = &ble_evt->evt.gattc_evt; + ble_gattc_evt_read_rsp_t *response = &evt->params.read_rsp; + if (read && evt->conn_handle == read->conn_handle) { + read->status = evt->gatt_status; + size_t len = MIN(read->len, response->len); + memcpy(read->buf, response->data, len); + read->final_len = len; + // Indicate to busy-wait loop that we've read the attribute value. + read->done = true; + } + break; + } + + default: + // For debugging. + // mp_printf(&mp_plat_print, "Unhandled characteristic event: 0x%04x\n", ble_evt->header.evt_id); + return false; + break; + } + return true; +} + +size_t common_hal_bleio_gattc_read(uint16_t handle, uint16_t conn_handle, uint8_t* buf, size_t len) { + common_hal_bleio_check_connected(conn_handle); + + read_info_t read_info; + read_info.buf = buf; + read_info.len = len; + read_info.final_len = 0; + read_info.conn_handle = conn_handle; + // Set to true by the event handler. + read_info.done = false; + ble_drv_add_event_handler(_on_gattc_read_rsp_evt, &read_info); + + uint32_t nrf_error = NRF_ERROR_BUSY; + while (nrf_error == NRF_ERROR_BUSY) { + nrf_error = sd_ble_gattc_read(conn_handle, handle, 0); + } + if (nrf_error != NRF_SUCCESS) { + ble_drv_remove_event_handler(_on_gattc_read_rsp_evt, &read_info); + check_nrf_error(nrf_error); + } + + while (!read_info.done) { + RUN_BACKGROUND_TASKS; + } + + ble_drv_remove_event_handler(_on_gattc_read_rsp_evt, &read_info); + check_gatt_status(read_info.status); + return read_info.final_len; +} + +void common_hal_bleio_gattc_write(uint16_t handle, uint16_t conn_handle, mp_buffer_info_t *bufinfo, bool write_no_response) { + common_hal_bleio_check_connected(conn_handle); + + ble_gattc_write_params_t write_params = { + .write_op = write_no_response ? BLE_GATT_OP_WRITE_CMD: BLE_GATT_OP_WRITE_REQ, + .handle = handle, + .p_value = bufinfo->buf, + .len = bufinfo->len, + }; + + while (1) { + uint32_t err_code = sd_ble_gattc_write(conn_handle, &write_params); + if (err_code == NRF_SUCCESS) { + break; + } + + // Write with response will return NRF_ERROR_BUSY if the response has not been received. + // Write without reponse will return NRF_ERROR_RESOURCES if too many writes are pending. + if (err_code == NRF_ERROR_BUSY || err_code == NRF_ERROR_RESOURCES) { + // We could wait for an event indicating the write is complete, but just retrying is easier. + MICROPY_VM_HOOK_LOOP; + continue; + } + + // Some real error occurred. + check_nrf_error(err_code); + } + +} + +void common_hal_bleio_gc_collect(void) { + bleio_adapter_gc_collect(&common_hal_bleio_adapter_obj); +} diff --git a/devices/ble_hci/common-hal/_bleio/__init__.h b/devices/ble_hci/common-hal/_bleio/__init__.h new file mode 100644 index 0000000000..77548dac15 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/__init__.h @@ -0,0 +1,50 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * 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. + */ + +#ifndef MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_INIT_H +#define MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_INIT_H + +void bleio_reset(void); + +typedef struct { + // ble_gap_enc_key_t own_enc; + // ble_gap_enc_key_t peer_enc; + // ble_gap_id_key_t peer_id; +} bonding_keys_t; + +// We assume variable length data. +// 20 bytes max (23 - 3). +#define GATT_MAX_DATA_LENGTH (BLE_GATT_ATT_MTU_DEFAULT - 3) + +// These helpers raise the appropriate exceptions if the code doesn't equal success. +void check_nrf_error(uint32_t err_code); +void check_gatt_status(uint16_t gatt_status); +void check_sec_status(uint8_t sec_status); + +// Track if the user code modified the BLE state to know if we need to undo it on reload. +bool vm_used_ble; + +#endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_INIT_H diff --git a/devices/ble_hci/common-hal/_bleio/bonding.c b/devices/ble_hci/common-hal/_bleio/bonding.c new file mode 100644 index 0000000000..d03e418f7f --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/bonding.c @@ -0,0 +1,306 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 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 +#include +#include + +#include "shared-bindings/_bleio/__init__.h" +#include "shared-bindings/_bleio/Adapter.h" +#include "shared-bindings/nvm/ByteArray.h" +#include "supervisor/shared/tick.h" + +#include "bonding.h" + +// Internal flash area reserved for bonding storage. +#define BONDING_PAGES_START_ADDR CIRCUITPY_BLE_CONFIG_START_ADDR +#define BONDING_PAGES_END_ADDR (CIRCUITPY_BLE_CONFIG_START_ADDR + CIRCUITPY_BLE_CONFIG_SIZE) + +// First and last four bytes are magic bytes for id and version. Data is in between. +// 'BD01' +const uint32_t BONDING_FLAG = ('1' | '0' << 8 | 'D' << 16 | 'B' << 24); + +#define BONDING_DATA_START_ADDR (BONDING_PAGES_START_ADDR + sizeof(BONDING_FLAG)) +#define BONDING_DATA_END_ADDR (BONDING_PAGES_END_ADDR - sizeof(BONDING_FLAG)) + +#define BONDING_START_FLAG_ADDR BONDING_PAGES_START_ADDR +#define BONDING_END_FLAG_ADDR BONDING_DATA_END_ADDR + +// Save both system and user service info. +#define SYS_ATTR_FLAGS (BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS | BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS) + +#if BONDING_DEBUG +void bonding_print_block(bonding_block_t *block) { + printf("at 0x%08lx: is_central: %1d, type: 0x%x, ediv: 0x%04x, data_length: %d\n", + (uint32_t) block, block->is_central, block->type, block->ediv, block->data_length); +} + +void bonding_print_keys(bonding_keys_t *keys) { + for (size_t i = 0; i < sizeof(bonding_keys_t); i ++) { + printf("%x", ((uint8_t*) keys)[i]); + } + printf("\n"); +} +#endif + +STATIC size_t compute_block_size(uint16_t data_length) { + // Round data size up to the nearest 32-bit address. + return sizeof(bonding_block_t) + ((data_length + 3) & ~0x3); +} + +void bonding_erase_storage(void) { + // Erase all pages in the bonding area. + for(uint32_t page_address = BONDING_PAGES_START_ADDR; + page_address < BONDING_PAGES_END_ADDR; + page_address += FLASH_PAGE_SIZE) { + // Argument is page number, not address. + sd_flash_page_erase_sync(page_address / FLASH_PAGE_SIZE); + } + // Write marker words at the beginning and the end of the bonding area. + uint32_t flag = BONDING_FLAG; + sd_flash_write_sync((uint32_t *) BONDING_START_FLAG_ADDR, &flag, 1); + sd_flash_write_sync((uint32_t *) BONDING_END_FLAG_ADDR, &flag, 1); +} + +// Given NULL to start or block address, return the address of the next valid block. +// The last block returned is the unused block at the end. +// Return NULL if we have run off the end of the bonding space. + +STATIC bonding_block_t *next_block(bonding_block_t *block) { + while (1) { + // Advance to next block. + if (block == NULL) { + return (bonding_block_t *) BONDING_DATA_START_ADDR; + } else if (block->type == BLOCK_UNUSED) { + // Already at last block (the unused block). + return NULL; + } + + // Advance to next block. + block = (bonding_block_t *) ((uint8_t *) block + compute_block_size(block->data_length)); + + if (block >= (bonding_block_t *) BONDING_DATA_END_ADDR) { + // Went past end of bonding space. + return NULL; + } + if (block->type != BLOCK_INVALID) { + // Found an empty or a valid block. + return block; + } + // Invalid block (was erased); try again. + } +} + +// Find the block with given is_central, type and ediv value. +// If type == BLOCK_UNUSED, ediv is ignored and the the sole unused block at the end is returned. +// If not found, return NULL. +STATIC bonding_block_t *find_existing_block(bool is_central, bonding_block_type_t type, uint16_t ediv) { + bonding_block_t *block = NULL; + while (1) { + block = next_block(block); + if (block == NULL) { + return NULL; + } + // If types match, and block is unused, just return it. + // Otherwise check that is_central and ediv match. + if (type == block->type) { + if (type == BLOCK_UNUSED || + (is_central == block->is_central && ediv == block->ediv)) { + return block; + } + } + } +} + +// Get an empty block large enough to store data_length data. +STATIC bonding_block_t* find_unused_block(uint16_t data_length) { + bonding_block_t *unused_block = find_existing_block(true, BLOCK_UNUSED, EDIV_INVALID); + // If no more room, erase all existing blocks and start over. + if (!unused_block || + (uint8_t *) unused_block + compute_block_size(data_length) >= (uint8_t *) BONDING_DATA_END_ADDR) { + bonding_erase_storage(); + unused_block = (bonding_block_t *) BONDING_DATA_START_ADDR; + } + return unused_block; +} + +// Set the header word to all 0's, to mark the block as invalid. +// We don't change data_length, so we can still skip over this block. +STATIC void invalidate_block(bonding_block_t *block) { + uint32_t zero = 0; + sd_flash_write_sync((uint32_t *) block, &zero, 1); +} + +// Write bonding block header. +STATIC void write_block_header(bonding_block_t *dest_block, bonding_block_t *source_block_header) { + sd_flash_write_sync((uint32_t *) dest_block, (uint32_t *) source_block_header, sizeof(bonding_block_t) / 4); +} + +// Write variable-length data at end of bonding block. +STATIC void write_block_data(bonding_block_t *dest_block, uint8_t *data, uint16_t data_length) { + // Minimize the number of writes. Datasheet says no more than two writes per word before erasing again. + + // Start writing after the current header. + uint32_t *flash_word_p = (uint32_t *) ((uint8_t *) dest_block + sizeof(bonding_block_t)); + while (1) { + uint32_t word = 0xffffffff; + memcpy(&word, data, data_length >= 4 ? 4 : data_length); + sd_flash_write_sync(flash_word_p, &word, 1); + if (data_length <= 4) { + break; + } + data_length -= 4; + data += 4; + // Increment by word size. + flash_word_p++; + } +} + +STATIC void write_sys_attr_block(bleio_connection_internal_t *connection) { + uint16_t length = 0; + // First find out how big a buffer we need, then fetch the data. + if(sd_ble_gatts_sys_attr_get(connection->conn_handle, NULL, &length, SYS_ATTR_FLAGS) != NRF_SUCCESS) { + return; + } + uint8_t sys_attr[length]; + if(sd_ble_gatts_sys_attr_get(connection->conn_handle, sys_attr, &length, SYS_ATTR_FLAGS) != NRF_SUCCESS) { + return; + } + + // Is there an existing sys_attr block that matches the current sys_attr data? + bonding_block_t *existing_block = + find_existing_block(connection->is_central, BLOCK_SYS_ATTR, connection->ediv); + if (existing_block) { + if (length == existing_block->data_length && + memcmp(sys_attr, existing_block->data, length) == 0) { + // Identical block found. No need to store again. + return; + } + // Data doesn't match. Invalidate block and store a new one. + invalidate_block(existing_block); + } + + bonding_block_t block_header = { + .is_central = connection->is_central, + .type = BLOCK_SYS_ATTR, + .ediv = connection->ediv, + .conn_handle = connection->conn_handle, + .data_length = length, + }; + bonding_block_t *new_block = find_unused_block(length); + write_block_header(new_block, &block_header); + write_block_data(new_block, sys_attr, length); + return; +} + +STATIC void write_keys_block(bleio_connection_internal_t *connection) { + uint16_t const ediv = connection->is_central + ? connection->bonding_keys.peer_enc.master_id.ediv + : connection->bonding_keys.own_enc.master_id.ediv; + + // Is there an existing keys block that matches? + bonding_block_t *existing_block = find_existing_block(connection->is_central, BLOCK_KEYS, ediv); + if (existing_block) { + if (existing_block->data_length == sizeof(bonding_keys_t) && + memcmp(existing_block->data, &connection->bonding_keys, sizeof(bonding_keys_t)) == 0) { + // Identical block found. No need to store again. + return; + } + // Data doesn't match. Invalidate block and store a new one. + invalidate_block(existing_block); + } + + bonding_block_t block_header = { + .is_central = connection->is_central, + .type = BLOCK_KEYS, + .ediv = ediv, + .conn_handle = connection->conn_handle, + .data_length = sizeof(bonding_keys_t), + }; + bonding_block_t *new_block = find_unused_block(sizeof(bonding_keys_t)); + write_block_header(new_block, &block_header); + write_block_data(new_block, (uint8_t *) &connection->bonding_keys, sizeof(bonding_keys_t)); +} + +void bonding_clear_keys(bonding_keys_t *bonding_keys) { + memset((uint8_t*) bonding_keys, 0, sizeof(bonding_keys_t)); +} + +void bonding_reset(void) { + if (BONDING_FLAG != *((uint32_t *) BONDING_START_FLAG_ADDR) || + BONDING_FLAG != *((uint32_t *) BONDING_END_FLAG_ADDR)) { + bonding_erase_storage(); + } +} + +// Write bonding blocks to flash. Requests have been queued during evt handlers. +void bonding_background(void) { + // A paired connection will request that its keys and CCCD values be stored. + // The CCCD store whenever a CCCD value is written. + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + bleio_connection_internal_t *connection = &bleio_connections[i]; + + // Wait at least one second before saving CCCD, to consolidate + // writes that involve multiple CCCDs. For instance, for HID, + // three CCCD's are set in short succession by the HID client. + if (connection->do_bond_cccds) { + uint64_t current_ticks_ms = supervisor_ticks_ms64(); + if (current_ticks_ms - connection->do_bond_cccds_request_time >= 1000) { + write_sys_attr_block(connection); + connection->do_bond_cccds = false; + } + } + + if (connection->do_bond_keys) { + write_keys_block(connection); + connection->do_bond_keys = false; + } + } +} + +bool bonding_load_cccd_info(bool is_central, uint16_t conn_handle, uint16_t ediv) { + bonding_block_t *block = find_existing_block(is_central, BLOCK_SYS_ATTR, ediv); + if (block == NULL) { + return false; + } + + return NRF_SUCCESS == + sd_ble_gatts_sys_attr_set(conn_handle, block->data, block->data_length, SYS_ATTR_FLAGS); +} + +bool bonding_load_keys(bool is_central, uint16_t ediv, bonding_keys_t *bonding_keys) { + bonding_block_t *block = find_existing_block(is_central, BLOCK_KEYS, ediv); + if (block == NULL) { + return false; + } + if (sizeof(bonding_keys_t) != block->data_length) { + // bonding_keys_t is a fixed length, so lengths should match. + return false; + } + + memcpy(bonding_keys, block->data, block->data_length); + return true; +} diff --git a/devices/ble_hci/common-hal/_bleio/bonding.h b/devices/ble_hci/common-hal/_bleio/bonding.h new file mode 100644 index 0000000000..7fa66972de --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/bonding.h @@ -0,0 +1,83 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 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. + */ + +#ifndef MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_BONDING_H +#define MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_BONDING_H + +#include +#include +#include + +#include "common-hal/_bleio/__init__.h" + +#define EDIV_INVALID (0xffff) + +#define BONDING_DEBUG (1) +#if BONDING_DEBUG + #define BONDING_DEBUG_PRINTF(...) printf(__VA_ARGS__) + #define BONDING_DEBUG_PRINT_BLOCK(block) bonding_print_block(block) + #define BONDING_DEBUG_PRINT_KEYS(keys) bonding_print_keys(keys) +#else + #define BONDING_DEBUG_PRINTF(...) + #define BONDING_DEBUG_PRINT_BLOCK(block) + #define BONDING_DEBUG_PRINT_KEYS(keys) +#endif + +// Bonding data is stored in variable-length blocks consecutively in +// erased flash (all 1's). The blocks are 32-bit aligned, though the +// data may be any number of bytes. We hop through the blocks using +// the size field to find the next block. When we hit a word that is +// all 1's, we have reached the end of the blocks. We can write a new +// block there. + +typedef enum { + BLOCK_INVALID = 0, // Ignore this block + BLOCK_KEYS = 1, // Block contains bonding keys. + BLOCK_SYS_ATTR = 2, // Block contains sys_attr values (CCCD settings, etc.). + BLOCK_UNUSED = 0xff, // Initial erased value. +} bonding_block_type_t; + +typedef struct { + bool is_central: 1; // 1 if data is for a central role. + uint16_t reserved: 7; // Not currently used + bonding_block_type_t type: 8; // What kind of data is stored in. + uint16_t ediv; // ediv value; used as a lookup key. + uint16_t conn_handle; // Connection handle: used when a BLOCK_SYS_ATTR is queued to write. + // Not used as a key, etc. + uint16_t data_length; // Length of data in bytes, including ediv, not including padding. + // End of block header. 32-bit boundary here. + uint8_t data[]; // Rest of data in the block. Needs to be 32-bit aligned. + // Block is padded to 32-bit alignment. +} bonding_block_t; + +void bonding_background(void); +void bonding_erase_storage(void); +void bonding_reset(void); +void bonding_clear_keys(bonding_keys_t *bonding_keys); +bool bonding_load_cccd_info(bool is_central, uint16_t conn_handle, uint16_t ediv); +bool bonding_load_keys(bool is_central, uint16_t ediv, bonding_keys_t *bonding_keys); + +#endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_BONDING_H diff --git a/devices/ble_hci/common-hal/_bleio/hci.c b/devices/ble_hci/common-hal/_bleio/hci.c new file mode 100644 index 0000000000..8ff69f2027 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/hci.c @@ -0,0 +1,675 @@ + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "HCI.h" + +#define HCI_COMMAND_PKT 0x01 +#define HCI_ACLDATA_PKT 0x02 +#define HCI_EVENT_PKT 0x04 + +#define EVT_DISCONN_COMPLETE 0x05 +#define EVT_CMD_COMPLETE 0xe +#define EVT_CMD_STATUS 0x0f +#define EVT_NUM_COMP_PKTS 0x13 +#define EVT_LE_META_EVENT 0x3e + +#define EVT_LE_CONN_COMPLETE 0x01 +#define EVT_LE_ADVERTISING_REPORT 0x02 + +#define OGF_LINK_CTL 0x01 +#define OGF_HOST_CTL 0x03 +#define OGF_INFO_PARAM 0x04 +#define OGF_STATUS_PARAM 0x05 +#define OGF_LE_CTL 0x08 + +// OGF_LINK_CTL +#define OCF_DISCONNECT 0x0006 + +// OGF_HOST_CTL +#define OCF_SET_EVENT_MASK 0x0001 +#define OCF_RESET 0x0003 + +// OGF_INFO_PARAM +#define OCF_READ_LOCAL_VERSION 0x0001 +#define OCF_READ_BD_ADDR 0x0009 + +// OGF_STATUS_PARAM +#define OCF_READ_RSSI 0x0005 + +// OGF_LE_CTL +#define OCF_LE_READ_BUFFER_SIZE 0x0002 +#define OCF_LE_SET_RANDOM_ADDRESS 0x0005 +#define OCF_LE_SET_ADVERTISING_PARAMETERS 0x0006 +#define OCF_LE_SET_ADVERTISING_DATA 0x0008 +#define OCF_LE_SET_SCAN_RESPONSE_DATA 0x0009 +#define OCF_LE_SET_ADVERTISE_ENABLE 0x000a +#define OCF_LE_SET_SCAN_PARAMETERS 0x000b +#define OCF_LE_SET_SCAN_ENABLE 0x000c +#define OCF_LE_CREATE_CONN 0x000d +#define OCF_LE_CANCEL_CONN 0x000e +#define OCF_LE_CONN_UPDATE 0x0013 + +#define HCI_OE_USER_ENDED_CONNECTION 0x13 + +HCIClass::HCIClass() : + _debug(NULL), + _recvIndex(0), + _pendingPkt(0) +{ +} + +HCIClass::~HCIClass() +{ +} + +int HCIClass::begin() +{ + _recvIndex = 0; + + return HCITransport.begin(); +} + +void HCIClass::end() +{ + HCITransport.end(); +} + +void HCIClass::poll() +{ + poll(0); +} + +void HCIClass::poll(unsigned long timeout) +{ +#if defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_METRO_M4_AIRLIFT_LITE) + digitalWrite(NINA_RTS, LOW); +#endif + + if (timeout) { + HCITransport.wait(timeout); + } + + while (HCITransport.available()) { + byte b = HCITransport.read(); + + _recvBuffer[_recvIndex++] = b; + + if (_recvBuffer[0] == HCI_ACLDATA_PKT) { + if (_recvIndex > 5 && _recvIndex >= (5 + (_recvBuffer[3] + (_recvBuffer[4] << 8)))) { + if (_debug) { + dumpPkt("HCI ACLDATA RX <- ", _recvIndex, _recvBuffer); + } +#if defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_METRO_M4_AIRLIFT_LITE) + digitalWrite(NINA_RTS, HIGH); +#endif + int pktLen = _recvIndex - 1; + _recvIndex = 0; + + handleAclDataPkt(pktLen, &_recvBuffer[1]); + +#if defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_METRO_M4_AIRLIFT_LITE) + digitalWrite(NINA_RTS, LOW); +#endif + } + } else if (_recvBuffer[0] == HCI_EVENT_PKT) { + if (_recvIndex > 3 && _recvIndex >= (3 + _recvBuffer[2])) { + if (_debug) { + dumpPkt("HCI EVENT RX <- ", _recvIndex, _recvBuffer); + } +#if defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_METRO_M4_AIRLIFT_LITE) + digitalWrite(NINA_RTS, HIGH); +#endif + // received full event + int pktLen = _recvIndex - 1; + _recvIndex = 0; + + handleEventPkt(pktLen, &_recvBuffer[1]); + +#if defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_METRO_M4_AIRLIFT_LITE) + digitalWrite(NINA_RTS, LOW); +#endif + } + } else { + _recvIndex = 0; + + if (_debug) { + _debug->println(b, HEX); + } + } + } + +#if defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_METRO_M4_AIRLIFT_LITE) + digitalWrite(NINA_RTS, HIGH); +#endif +} + +int HCIClass::reset() +{ + return sendCommand(OGF_HOST_CTL << 10 | OCF_RESET); +} + +int HCIClass::readLocalVersion(uint8_t& hciVer, uint16_t& hciRev, uint8_t& lmpVer, uint16_t& manufacturer, uint16_t& lmpSubVer) +{ + int result = sendCommand(OGF_INFO_PARAM << 10 | OCF_READ_LOCAL_VERSION); + + if (result == 0) { + struct __attribute__ ((packed)) HCILocalVersion { + uint8_t hciVer; + uint16_t hciRev; + uint8_t lmpVer; + uint16_t manufacturer; + uint16_t lmpSubVer; + } *localVersion = (HCILocalVersion*)_cmdResponse; + + hciVer = localVersion->hciVer; + hciRev = localVersion->hciRev; + lmpVer = localVersion->lmpVer; + manufacturer = localVersion->manufacturer; + lmpSubVer = localVersion->lmpSubVer; + } + + return result; +} + +int HCIClass::readBdAddr(uint8_t addr[6]) +{ + int result = sendCommand(OGF_INFO_PARAM << 10 | OCF_READ_BD_ADDR); + + if (result == 0) { + memcpy(addr, _cmdResponse, 6); + } + + return result; +} + +int HCIClass::readRssi(uint16_t handle) +{ + int result = sendCommand(OGF_STATUS_PARAM << 10 | OCF_READ_RSSI, sizeof(handle), &handle); + int rssi = 127; + + if (result == 0) { + struct __attribute__ ((packed)) HCIReadRssi { + uint16_t handle; + int8_t rssi; + } *readRssi = (HCIReadRssi*)_cmdResponse; + + if (readRssi->handle == handle) { + rssi = readRssi->rssi; + } + } + + return rssi; +} + +int HCIClass::setEventMask(uint64_t eventMask) +{ + return sendCommand(OGF_HOST_CTL << 10 | OCF_SET_EVENT_MASK, sizeof(eventMask), &eventMask); +} + +int HCIClass::readLeBufferSize(uint16_t& pktLen, uint8_t& maxPkt) +{ + int result = sendCommand(OGF_LE_CTL << 10 | OCF_LE_READ_BUFFER_SIZE); + + if (result == 0) { + struct __attribute__ ((packed)) HCILeBufferSize { + uint16_t pktLen; + uint8_t maxPkt; + } *leBufferSize = (HCILeBufferSize*)_cmdResponse; + + pktLen = leBufferSize->pktLen; + _maxPkt = maxPkt = leBufferSize->maxPkt; + +#ifndef __AVR__ + ATT.setMaxMtu(pktLen - 9); // max pkt len - ACL header size +#endif + } + + return result; +} + +int HCIClass::leSetRandomAddress(uint8_t addr[6]) +{ + return sendCommand(OGF_LE_CTL << 10 | OCF_LE_SET_RANDOM_ADDRESS, 6, addr); +} + +int HCIClass::leSetAdvertisingParameters(uint16_t minInterval, uint16_t maxInterval, + uint8_t advType, uint8_t ownBdaddrType, + uint8_t directBdaddrType, uint8_t directBdaddr[6], + uint8_t chanMap, + uint8_t filter) +{ + struct __attribute__ ((packed)) HCILeAdvertisingParameters { + uint16_t minInterval; + uint16_t maxInterval; + uint8_t advType; + uint8_t ownBdaddrType; + uint8_t directBdaddrType; + uint8_t directBdaddr[6]; + uint8_t chanMap; + uint8_t filter; + } leAdvertisingParamters; + + leAdvertisingParamters.minInterval = minInterval; + leAdvertisingParamters.maxInterval = maxInterval; + leAdvertisingParamters.advType = advType; + leAdvertisingParamters.ownBdaddrType = ownBdaddrType; + leAdvertisingParamters.directBdaddrType = directBdaddrType; + memcpy(leAdvertisingParamters.directBdaddr, directBdaddr, 6); + leAdvertisingParamters.chanMap = chanMap; + leAdvertisingParamters.filter = filter; + + return sendCommand(OGF_LE_CTL << 10 | OCF_LE_SET_ADVERTISING_PARAMETERS, sizeof(leAdvertisingParamters), &leAdvertisingParamters); +} + +int HCIClass::leSetAdvertisingData(uint8_t length, uint8_t data[]) +{ + struct __attribute__ ((packed)) HCILeAdvertisingData { + uint8_t length; + uint8_t data[31]; + } leAdvertisingData; + + memset(&leAdvertisingData, 0, sizeof(leAdvertisingData)); + leAdvertisingData.length = length; + memcpy(leAdvertisingData.data, data, length); + + return sendCommand(OGF_LE_CTL << 10 | OCF_LE_SET_ADVERTISING_DATA, sizeof(leAdvertisingData), &leAdvertisingData); +} + +int HCIClass::leSetScanResponseData(uint8_t length, uint8_t data[]) +{ + struct __attribute__ ((packed)) HCILeScanResponseData { + uint8_t length; + uint8_t data[31]; + } leScanResponseData; + + memset(&leScanResponseData, 0, sizeof(leScanResponseData)); + leScanResponseData.length = length; + memcpy(leScanResponseData.data, data, length); + + return sendCommand(OGF_LE_CTL << 10 | OCF_LE_SET_SCAN_RESPONSE_DATA, sizeof(leScanResponseData), &leScanResponseData); +} + +int HCIClass::leSetAdvertiseEnable(uint8_t enable) +{ + return sendCommand(OGF_LE_CTL << 10 | OCF_LE_SET_ADVERTISE_ENABLE, sizeof(enable), &enable); +} + +int HCIClass::leSetScanParameters(uint8_t type, uint16_t interval, uint16_t window, + uint8_t ownBdaddrType, uint8_t filter) +{ + struct __attribute__ ((packed)) HCILeSetScanParameters { + uint8_t type; + uint16_t interval; + uint16_t window; + uint8_t ownBdaddrType; + uint8_t filter; + } leScanParameters; + + leScanParameters.type = type; + leScanParameters.interval = interval; + leScanParameters.window = window; + leScanParameters.ownBdaddrType = ownBdaddrType; + leScanParameters.filter = filter; + + return sendCommand(OGF_LE_CTL << 10 | OCF_LE_SET_SCAN_PARAMETERS, sizeof(leScanParameters), &leScanParameters); +} + +int HCIClass::leSetScanEnable(uint8_t enabled, uint8_t duplicates) +{ + struct __attribute__ ((packed)) HCILeSetScanEnableData { + uint8_t enabled; + uint8_t duplicates; + } leScanEnableData; + + leScanEnableData.enabled = enabled; + leScanEnableData.duplicates = duplicates; + + return sendCommand(OGF_LE_CTL << 10 | OCF_LE_SET_SCAN_ENABLE, sizeof(leScanEnableData), &leScanEnableData); +} + +int HCIClass::leCreateConn(uint16_t interval, uint16_t window, uint8_t initiatorFilter, + uint8_t peerBdaddrType, uint8_t peerBdaddr[6], uint8_t ownBdaddrType, + uint16_t minInterval, uint16_t maxInterval, uint16_t latency, + uint16_t supervisionTimeout, uint16_t minCeLength, uint16_t maxCeLength) +{ + struct __attribute__ ((packed)) HCILeCreateConnData { + uint16_t interval; + uint16_t window; + uint8_t initiatorFilter; + uint8_t peerBdaddrType; + uint8_t peerBdaddr[6]; + uint8_t ownBdaddrType; + uint16_t minInterval; + uint16_t maxInterval; + uint16_t latency; + uint16_t supervisionTimeout; + uint16_t minCeLength; + uint16_t maxCeLength; + } leCreateConnData; + + leCreateConnData.interval = interval; + leCreateConnData.window = window; + leCreateConnData.initiatorFilter = initiatorFilter; + leCreateConnData.peerBdaddrType = peerBdaddrType; + memcpy(leCreateConnData.peerBdaddr, peerBdaddr, sizeof(leCreateConnData.peerBdaddr)); + leCreateConnData.ownBdaddrType = ownBdaddrType; + leCreateConnData.minInterval = minInterval; + leCreateConnData.maxInterval = maxInterval; + leCreateConnData.latency = latency; + leCreateConnData.supervisionTimeout = supervisionTimeout; + leCreateConnData.minCeLength = minCeLength; + leCreateConnData.maxCeLength = maxCeLength; + + return sendCommand(OGF_LE_CTL << 10 | OCF_LE_CREATE_CONN, sizeof(leCreateConnData), &leCreateConnData); +} + +int HCIClass::leCancelConn() +{ + return sendCommand(OGF_LE_CTL << 10 | OCF_LE_CANCEL_CONN, 0, NULL); +} + +int HCIClass::leConnUpdate(uint16_t handle, uint16_t minInterval, uint16_t maxInterval, + uint16_t latency, uint16_t supervisionTimeout) +{ + struct __attribute__ ((packed)) HCILeConnUpdateData { + uint16_t handle; + uint16_t minInterval; + uint16_t maxInterval; + uint16_t latency; + uint16_t supervisionTimeout; + uint16_t minCeLength; + uint16_t maxCeLength; + } leConnUpdateData; + + leConnUpdateData.handle = handle; + leConnUpdateData.minInterval = minInterval; + leConnUpdateData.maxInterval = maxInterval; + leConnUpdateData.latency = latency; + leConnUpdateData.supervisionTimeout = supervisionTimeout; + leConnUpdateData.minCeLength = 0x0004; + leConnUpdateData.maxCeLength = 0x0006; + + return sendCommand(OGF_LE_CTL << 10 | OCF_LE_CONN_UPDATE, sizeof(leConnUpdateData), &leConnUpdateData); +} + +int HCIClass::sendAclPkt(uint16_t handle, uint8_t cid, uint8_t plen, void* data) +{ + while (_pendingPkt >= _maxPkt) { + poll(); + } + + struct __attribute__ ((packed)) HCIACLHdr { + uint8_t pktType; + uint16_t handle; + uint16_t dlen; + uint16_t plen; + uint16_t cid; + } aclHdr = { HCI_ACLDATA_PKT, handle, uint8_t(plen + 4), plen, cid }; + + uint8_t txBuffer[sizeof(aclHdr) + plen]; + memcpy(txBuffer, &aclHdr, sizeof(aclHdr)); + memcpy(&txBuffer[sizeof(aclHdr)], data, plen); + + if (_debug) { + dumpPkt("HCI ACLDATA TX -> ", sizeof(aclHdr) + plen, txBuffer); + } + + _pendingPkt++; + HCITransport.write(txBuffer, sizeof(aclHdr) + plen); + + return 0; +} + +int HCIClass::disconnect(uint16_t handle) +{ + struct __attribute__ ((packed)) HCIDisconnectData { + uint16_t handle; + uint8_t reason; + } disconnectData = { handle, HCI_OE_USER_ENDED_CONNECTION }; + + return sendCommand(OGF_LINK_CTL << 10 | OCF_DISCONNECT, sizeof(disconnectData), &disconnectData); +} + +void HCIClass::debug(Stream& stream) +{ + _debug = &stream; +} + +void HCIClass::noDebug() +{ + _debug = NULL; +} + +int HCIClass::sendCommand(uint16_t opcode, uint8_t plen, void* parameters) +{ + struct __attribute__ ((packed)) { + uint8_t pktType; + uint16_t opcode; + uint8_t plen; + } pktHdr = {HCI_COMMAND_PKT, opcode, plen}; + + uint8_t txBuffer[sizeof(pktHdr) + plen]; + memcpy(txBuffer, &pktHdr, sizeof(pktHdr)); + memcpy(&txBuffer[sizeof(pktHdr)], parameters, plen); + + if (_debug) { + dumpPkt("HCI COMMAND TX -> ", sizeof(pktHdr) + plen, txBuffer); + } + + HCITransport.write(txBuffer, sizeof(pktHdr) + plen); + + _cmdCompleteOpcode = 0xffff; + _cmdCompleteStatus = -1; + + for (unsigned long start = millis(); _cmdCompleteOpcode != opcode && millis() < (start + 1000);) { + poll(); + } + + return _cmdCompleteStatus; +} + +void HCIClass::handleAclDataPkt(uint8_t /*plen*/, uint8_t pdata[]) +{ + struct __attribute__ ((packed)) HCIACLHdr { + uint16_t handle; + uint16_t dlen; + uint16_t len; + uint16_t cid; + } *aclHdr = (HCIACLHdr*)pdata; + + uint16_t aclFlags = (aclHdr->handle & 0xf000) >> 12; + + if ((aclHdr->dlen - 4) != aclHdr->len) { + // packet is fragmented + if (aclFlags != 0x01) { + // copy into ACL buffer + memcpy(_aclPktBuffer, &_recvBuffer[1], sizeof(HCIACLHdr) + aclHdr->dlen - 4); + } else { + // copy next chunk into the buffer + HCIACLHdr* aclBufferHeader = (HCIACLHdr*)_aclPktBuffer; + + memcpy(&_aclPktBuffer[sizeof(HCIACLHdr) + aclBufferHeader->dlen - 4], &_recvBuffer[1 + sizeof(aclHdr->handle) + sizeof(aclHdr->dlen)], aclHdr->dlen); + + aclBufferHeader->dlen += aclHdr->dlen; + aclHdr = aclBufferHeader; + } + } + + if ((aclHdr->dlen - 4) != aclHdr->len) { + // don't have the full packet yet + return; + } + + if (aclHdr->cid == ATT_CID) { + if (aclFlags == 0x01) { + // use buffered packet + ATT.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &_aclPktBuffer[sizeof(HCIACLHdr)]); + } else { + // use the recv buffer + ATT.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &_recvBuffer[1 + sizeof(HCIACLHdr)]); + } + } else if (aclHdr->cid == SIGNALING_CID) { + L2CAPSignaling.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &_recvBuffer[1 + sizeof(HCIACLHdr)]); + } else { + struct __attribute__ ((packed)) { + uint8_t op; + uint8_t id; + uint16_t length; + uint16_t reason; + uint16_t localCid; + uint16_t remoteCid; + } l2capRejectCid= { 0x01, 0x00, 0x006, 0x0002, aclHdr->cid, 0x0000 }; + + sendAclPkt(aclHdr->handle & 0x0fff, 0x0005, sizeof(l2capRejectCid), &l2capRejectCid); + } +} + +void HCIClass::handleNumCompPkts(uint16_t /*handle*/, uint16_t numPkts) +{ + if (numPkts && _pendingPkt > numPkts) { + _pendingPkt -= numPkts; + } else { + _pendingPkt = 0; + } +} + +void HCIClass::handleEventPkt(uint8_t /*plen*/, uint8_t pdata[]) +{ + struct __attribute__ ((packed)) HCIEventHdr { + uint8_t evt; + uint8_t plen; + } *eventHdr = (HCIEventHdr*)pdata; + + if (eventHdr->evt == EVT_DISCONN_COMPLETE) { + struct __attribute__ ((packed)) DisconnComplete { + uint8_t status; + uint16_t handle; + uint8_t reason; + } *disconnComplete = (DisconnComplete*)&pdata[sizeof(HCIEventHdr)]; + + ATT.removeConnection(disconnComplete->handle, disconnComplete->reason); + L2CAPSignaling.removeConnection(disconnComplete->handle, disconnComplete->reason); + + HCI.leSetAdvertiseEnable(0x01); + } else if (eventHdr->evt == EVT_CMD_COMPLETE) { + struct __attribute__ ((packed)) CmdComplete { + uint8_t ncmd; + uint16_t opcode; + uint8_t status; + } *cmdCompleteHeader = (CmdComplete*)&pdata[sizeof(HCIEventHdr)]; + + _cmdCompleteOpcode = cmdCompleteHeader->opcode; + _cmdCompleteStatus = cmdCompleteHeader->status; + _cmdResponseLen = pdata[1] - sizeof(CmdComplete); + _cmdResponse = &pdata[sizeof(HCIEventHdr) + sizeof(CmdComplete)]; + + } else if (eventHdr->evt == EVT_CMD_STATUS) { + struct __attribute__ ((packed)) CmdStatus { + uint8_t status; + uint8_t ncmd; + uint16_t opcode; + } *cmdStatusHeader = (CmdStatus*)&pdata[sizeof(HCIEventHdr)]; + + _cmdCompleteOpcode = cmdStatusHeader->opcode; + _cmdCompleteStatus = cmdStatusHeader->status; + _cmdResponseLen = 0; + } else if (eventHdr->evt == EVT_NUM_COMP_PKTS) { + uint8_t numHandles = pdata[sizeof(HCIEventHdr)]; + uint16_t* data = (uint16_t*)&pdata[sizeof(HCIEventHdr) + sizeof(numHandles)]; + + for (uint8_t i = 0; i < numHandles; i++) { + handleNumCompPkts(data[0], data[1]); + + data += 2; + } + } else if (eventHdr->evt == EVT_LE_META_EVENT) { + struct __attribute__ ((packed)) LeMetaEventHeader { + uint8_t subevent; + } *leMetaHeader = (LeMetaEventHeader*)&pdata[sizeof(HCIEventHdr)]; + + if (leMetaHeader->subevent == EVT_LE_CONN_COMPLETE) { + struct __attribute__ ((packed)) EvtLeConnectionComplete { + uint8_t status; + uint16_t handle; + uint8_t role; + uint8_t peerBdaddrType; + uint8_t peerBdaddr[6]; + uint16_t interval; + uint16_t latency; + uint16_t supervisionTimeout; + uint8_t masterClockAccuracy; + } *leConnectionComplete = (EvtLeConnectionComplete*)&pdata[sizeof(HCIEventHdr) + sizeof(LeMetaEventHeader)]; + + if (leConnectionComplete->status == 0x00) { + ATT.addConnection(leConnectionComplete->handle, + leConnectionComplete->role, + leConnectionComplete->peerBdaddrType, + leConnectionComplete->peerBdaddr, + leConnectionComplete->interval, + leConnectionComplete->latency, + leConnectionComplete->supervisionTimeout, + leConnectionComplete->masterClockAccuracy); + + L2CAPSignaling.addConnection(leConnectionComplete->handle, + leConnectionComplete->role, + leConnectionComplete->peerBdaddrType, + leConnectionComplete->peerBdaddr, + leConnectionComplete->interval, + leConnectionComplete->latency, + leConnectionComplete->supervisionTimeout, + leConnectionComplete->masterClockAccuracy); + } + } else if (leMetaHeader->subevent == EVT_LE_ADVERTISING_REPORT) { + struct __attribute__ ((packed)) EvtLeAdvertisingReport { + uint8_t status; + uint8_t type; + uint8_t peerBdaddrType; + uint8_t peerBdaddr[6]; + uint8_t eirLength; + uint8_t eirData[31]; + } *leAdvertisingReport = (EvtLeAdvertisingReport*)&pdata[sizeof(HCIEventHdr) + sizeof(LeMetaEventHeader)]; + + if (leAdvertisingReport->status == 0x01) { + // last byte is RSSI + int8_t rssi = leAdvertisingReport->eirData[leAdvertisingReport->eirLength]; + + GAP.handleLeAdvertisingReport(leAdvertisingReport->type, + leAdvertisingReport->peerBdaddrType, + leAdvertisingReport->peerBdaddr, + leAdvertisingReport->eirLength, + leAdvertisingReport->eirData, + rssi); + + } + } + } +} + +void HCIClass::dumpPkt(const char* prefix, uint8_t plen, uint8_t pdata[]) +{ + if (_debug) { + _debug->print(prefix); + + for (uint8_t i = 0; i < plen; i++) { + byte b = pdata[i]; + + if (b < 16) { + _debug->print("0"); + } + + _debug->print(b, HEX); + } + + _debug->println(); + _debug->flush(); + } +} +` diff --git a/devices/ble_hci/supervisor/bluetooth.c b/devices/ble_hci/supervisor/bluetooth.c new file mode 100644 index 0000000000..7a0b775643 --- /dev/null +++ b/devices/ble_hci/supervisor/bluetooth.c @@ -0,0 +1,48 @@ +/* + * 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. + */ + +#if CIRCUITPY_BLE_FILE_SERVICE +#error CIRCUITPY_BLE_FILE_SERVICE not implemented for CIRCUITPY_BLEIO_HCI +#endif + +void supervisor_bluetooth_start_advertising(void) { +} + +void supervisor_start_bluetooth(void) { +} + +FIL active_file; +volatile bool new_filename; +volatile bool run_ble_background; +bool was_connected; + +void supervisor_bluetooth_background(void) { +} + +// This happens in an interrupt so we need to be quick. +bool supervisor_bluetooth_hook(ble_evt_t *ble_evt) { + return false; +} diff --git a/devices/ble_hci/supervisor/bluetooth.h b/devices/ble_hci/supervisor/bluetooth.h new file mode 100644 index 0000000000..03645829b1 --- /dev/null +++ b/devices/ble_hci/supervisor/bluetooth.h @@ -0,0 +1,34 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_DEVICE_BLE_HCI_SUPERVISOR_BLUETOOTH_H +#define MICROPY_INCLUDED_DEVICE_BLE_HCI_SUPERVISOR_BLUETOOTH_H + +void supervisor_start_bluetooth(void); +bool supervisor_bluetooth_hook(ble_evt_t *ble_evt); +void supervisor_bluetooth_background(void); + +#endif // MICROPY_INCLUDED_DEVICE_BLE_HCI_SUPERVISOR_BLUETOOTH_H diff --git a/ports/atmel-samd/asf4 b/ports/atmel-samd/asf4 index c0eef7b751..039b5f3bbc 160000 --- a/ports/atmel-samd/asf4 +++ b/ports/atmel-samd/asf4 @@ -1 +1 @@ -Subproject commit c0eef7b75124fc946af5f75e12d82d6d01315ab1 +Subproject commit 039b5f3bbc3f4ba4421e581db290560d59fef625 diff --git a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk index 4895cda77b..e999629c32 100644 --- a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk @@ -6,6 +6,10 @@ USB_MANUFACTURER = "Adafruit Industries LLC" CHIP_VARIANT = SAMD51J19A CHIP_FAMILY = samd51 +# Support _bleio via the on-board ESP32 module. +CIRCUITPY_BLEIO = 1 +CIRCUITPY_BLEIO_HCI = 1 + QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 3 EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C" diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index e4161d7d6d..6b531fc923 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit e4161d7d6d98d78eddcccb82128856af4baf7e50 +Subproject commit 6b531fc923d9f02b14bd731a5f584ddf716e8773 diff --git a/ports/nrf/bluetooth/ble_drv.c b/ports/nrf/bluetooth/ble_drv.c index e410ac3b42..67c6f34687 100644 --- a/ports/nrf/bluetooth/ble_drv.c +++ b/ports/nrf/bluetooth/ble_drv.c @@ -39,6 +39,7 @@ #include "py/mpstate.h" #include "supervisor/shared/bluetooth.h" +#include "supervisor/bluetooth.h" nrf_nvic_state_t nrf_nvic_state = { 0 }; diff --git a/ports/nrf/supervisor/bluetooth.c b/ports/nrf/supervisor/bluetooth.c new file mode 100644 index 0000000000..8d89d62723 --- /dev/null +++ b/ports/nrf/supervisor/bluetooth.c @@ -0,0 +1,81 @@ +/* + * 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. + */ + +#include "supervisor/shared/bluetooth.h" +#include "supervisor/bluetooth.h" + +// This happens in an interrupt so we need to be quick. +bool supervisor_bluetooth_hook(ble_evt_t *ble_evt) { +#if CIRCUITPY_BLE_FILE_SERVICE + // Catch writes to filename or contents. Length is read-only. + + bool done = false; + switch (ble_evt->header.evt_id) { + case BLE_GAP_EVT_CONNECTED: + // We run our background task even if it wasn't us connected to because we may want to + // advertise if the user code stopped advertising. + run_ble_background = true; + break; + case BLE_GAP_EVT_DISCONNECTED: + run_ble_background = true; + break; + case BLE_GATTS_EVT_WRITE: { + // A client wrote to a characteristic. + + ble_gatts_evt_write_t *evt_write = &ble_evt->evt.gatts_evt.params.write; + // Event handle must match the handle for my characteristic. + if (evt_write->handle == supervisor_ble_contents_characteristic.handle) { + // Handle events + //write_to_ringbuf(self, evt_write->data, evt_write->len); + // First packet includes a uint16_t le for length at the start. + uint16_t current_length = ((uint16_t*) current_command)[0]; + memcpy(((uint8_t*) current_command) + current_offset, evt_write->data, evt_write->len); + current_offset += evt_write->len; + current_length = ((uint16_t*) current_command)[0]; + if (current_offset == current_length) { + run_ble_background = true; + done = true; + } + } else if (evt_write->handle == supervisor_ble_filename_characteristic.handle) { + new_filename = true; + run_ble_background = true; + done = true; + } else { + return done; + } + break; + } + + default: + // For debugging. + // mp_printf(&mp_plat_print, "Unhandled peripheral event: 0x%04x\n", ble_evt->header.evt_id); + break; + } + return done; +#else + return false; +#endif +} diff --git a/ports/nrf/supervisor/bluetooth.h b/ports/nrf/supervisor/bluetooth.h new file mode 100644 index 0000000000..425de07e4d --- /dev/null +++ b/ports/nrf/supervisor/bluetooth.h @@ -0,0 +1,36 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_NRF_SUPERVISOR_BLUETOOTH_H +#define MICROPY_INCLUDED_NRF_SUPERVISOR_BLUETOOTH_H + +#include + +#include "ble.h" + +bool supervisor_bluetooth_hook(ble_evt_t *ble_evt); + +#endif // MICROPY_INCLUDED_NRF_SUPERVISOR_BLUETOOTH_H diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 74d8f548dd..811de78664 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -411,7 +411,7 @@ SRC_SHARED_MODULE_ALL = \ SRC_SHARED_MODULE = $(filter $(SRC_PATTERNS), $(SRC_SHARED_MODULE_ALL)) # Use the native touchio if requested. This flag is set conditionally in, say, mpconfigport.h. -# The presence of common-hal/touchio/* # does not imply it's available for all chips in a port, +# The presence of common-hal/touchio/* does not imply it's available for all chips in a port, # so there is an explicit flag. For example, SAMD21 touchio is native, but SAMD51 is not. ifeq ($(CIRCUITPY_TOUCHIO_USE_NATIVE),1) SRC_COMMON_HAL_ALL += \ @@ -422,6 +422,14 @@ SRC_SHARED_MODULE_ALL += \ touchio/TouchIn.c \ touchio/__init__.c endif + +# If supporting _bleio via HCI, make devices/ble_hci/common-hal/_bleio be includable, +# and use C source files in devices/ble_hci/common-hal. +ifeq ($(CIRCUITPY_BLEIO_HCI),1) +INC += -I$(TOP)/devices/ble_hci +DEVICES_MODULES += $(TOP)/devices/ble_hci +endif + ifeq ($(CIRCUITPY_AUDIOMP3),1) SRC_MOD += $(addprefix lib/mp3/src/, \ bitstream.c \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 3459bff6d7..239bb665e4 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -79,6 +79,10 @@ CFLAGS += -DCIRCUITPY_BITBANGIO=$(CIRCUITPY_BITBANGIO) CIRCUITPY_BLEIO ?= 0 CFLAGS += -DCIRCUITPY_BLEIO=$(CIRCUITPY_BLEIO) +# _bleio can be supported on most any board via HCI +CIRCUITPY_BLEIO_HCI ?= 0 +CFLAGS += -DCIRCUITPY_BLEIO_HCI=$(CIRCUITPY_BLEIO_HCI) + CIRCUITPY_BOARD ?= 1 CFLAGS += -DCIRCUITPY_BOARD=$(CIRCUITPY_BOARD) diff --git a/py/mkrules.mk b/py/mkrules.mk index 13a73b90e6..0b3ecc0e17 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -42,7 +42,7 @@ $(Q)$(CC) $(CFLAGS) -c -MD -o $@ $< $(RM) -f $(@:.o=.d) endef -vpath %.c . $(TOP) $(USER_C_MODULES) +vpath %.c . $(TOP) $(USER_C_MODULES) $(DEVICES_MODULES) $(BUILD)/%.o: %.c $(call compile_c) @@ -56,8 +56,7 @@ $(BUILD)/%.o: %.c QSTR_GEN_EXTRA_CFLAGS += -I$(BUILD)/tmp -vpath %.c . $(TOP) $(USER_C_MODULES) - +vpath %.c . $(TOP) $(USER_C_MODULES) $(DEVICES_MODULES) $(BUILD)/%.pp: %.c $(STEPECHO) "PreProcess $<" $(Q)$(CC) $(CFLAGS) -E -Wp,-C,-dD,-dI -o $@ $< diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 13acb9d3cf..0780e0a327 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -65,12 +65,59 @@ //| connections and also initiate connections.""" //| -//| def __init__(self, ): -//| """You cannot create an instance of `_bleio.Adapter`. +//| def __init__(self, *, tx: Pin, rx: Pin, rts: Pin, cts: Pin, baudrate: int = 115200, buffer_size: int = 256, spi_cs: Pin, gpio0: Pin, reset: Pin, reset_high: bool): +//| """On boards with native BLE, such as the nRf52840, +//| you cannot create an instance of `_bleio.Adapter`. //| Use `_bleio.adapter` to access the sole instance available.""" -//| ... //| +//| On boards that do not have native BLE, +//| call `_bleio.Adapter()` once, passing it the pins used to communicate +//| with an HCI co-processor, such as an Adafruit AirLift, on or off the board. +//| The `Adapter` object will be initialized, enabled, and will be available as `_bleio.adapter`. +//| The `tx`, `rx`, `rts`, and `cs` pins are used to communicate with the HCI co-processor in HCI mode. +//| The `spi_cs` and `gpio0` pins are used to enable BLE mode +//| (usually `spi_cs` is low and `gpio0` is high to enter BLE mode). +//| The `reset` pin is used to reset the co-processor. +//| `reset_high` describes whether the reset pin is active high or active low. +//| +#if CIRCUITPY_BLEIO_HCI +STATIC mp_obj_t bleio_adapter_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_tx, ARG_rx, ARG_rts, ARG_cts, ARG_baudrate, ARG_buffer_size, ARG_spi_cs, ARG_gpio0, ARG_reset, ARG_reset_high }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_tx, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_rx, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_rts, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_cts, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_baudrate, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 115200 } }, + { MP_QSTR_buffer_size, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 256 } }, + { MP_QSTR_spi_cs, MP_ARG_KW_ONLY }| MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_gpio0, MP_ARG_KW_ONLY }| MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_reset, MP_ARG_KW_ONLY }| MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_reset_high, MP_ARG_KW_ONLY |MP_ARG_BOOL }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + const mcu_pin_obj_t *tx = validate_obj_is_free_pin(args[ARG_tx].u_obj); + const mcu_pin_obj_t *rx = validate_obj_is_free_pin(args[ARG_rx].u_obj); + const mcu_pin_obj_t *rts = validate_obj_is_free_pin(args[ARG_rts].u_obj); + const mcu_pin_obj_t *cts = validate_obj_is_free_pin(args[ARG_cts].u_obj); + const mcu_pin_obj_t *spi_cs = validate_obj_is_free_pin(args[ARG_spi_cs].u_obj); + const mcu_pin_obj_t *gpio0 = validate_obj_is_free_pin(args[ARG_gpio0].u_obj); + const mcu_pin_obj_t *reset = validate_obj_is_free_pin(args[ARG_reset].u_obj); + const bool reset_high = args[ARG_reset_high].u_bool; + + common_hal_bleio_adapter_construct(&common_hal_bleio_adapter_obj, tx, rx, rts, cts, + args[ARG_baudrate], arg[ARG_buffer_size], + spi_cs, gpio0, + reset, reset_high); + common_hal_bleio_adapter_set_enabled(&common_hal_bleio_adapter_obj, true); + + return MP_OBJ_FROM_PTR(service); +} +#endif +//| //| enabled: Any = ... //| """State of the BLE adapter.""" //| @@ -418,5 +465,8 @@ STATIC MP_DEFINE_CONST_DICT(bleio_adapter_locals_dict, bleio_adapter_locals_dict const mp_obj_type_t bleio_adapter_type = { .base = { &mp_type_type }, .name = MP_QSTR_Adapter, +#if CIRCUITPY_BLEIO_HCI + .make_new = bleio_adapter_make_new, + #endif .locals_dict = (mp_obj_t)&bleio_adapter_locals_dict, }; diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index 0a96d8a111..69fc45a777 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -31,7 +31,6 @@ #include #include -#include "ble_drv.h" #include "py/objarray.h" #include "py/objproperty.h" #include "py/objstr.h" diff --git a/supervisor/shared/bluetooth.c b/supervisor/shared/bluetooth.c index 98d0fab38e..d2ff55377a 100644 --- a/supervisor/shared/bluetooth.c +++ b/supervisor/shared/bluetooth.c @@ -24,6 +24,15 @@ * THE SOFTWARE. */ +#if !CIRCUITPY_BLE_FILE_SERVICE +void supervisor_start_bluetooth(void) { +} + +void supervisor_bluetooth_background(void) { +} + +#else + #include #include "extmod/vfs.h" @@ -41,6 +50,8 @@ #include "py/mpstate.h" + + bleio_service_obj_t supervisor_ble_service; bleio_uuid_obj_t supervisor_ble_service_uuid; bleio_characteristic_obj_t supervisor_ble_version_characteristic; @@ -63,10 +74,7 @@ mp_obj_t service_list_items[1]; mp_obj_list_t characteristic_list; mp_obj_t characteristic_list_items[4]; -void supervisor_bluetooth_start_advertising(void) { - #if !CIRCUITPY_BLE_FILE_SERVICE - return; - #endif +STATIC void supervisor_bluetooth_start_advertising(void) { bool is_connected = common_hal_bleio_adapter_get_connected(&common_hal_bleio_adapter_obj); if (is_connected) { return; @@ -83,10 +91,6 @@ void supervisor_bluetooth_start_advertising(void) { } void supervisor_start_bluetooth(void) { - #if !CIRCUITPY_BLE_FILE_SERVICE - return; - #endif - common_hal_bleio_adapter_set_enabled(&common_hal_bleio_adapter_obj, true); supervisor_ble_service_uuid.base.type = &bleio_uuid_type; @@ -177,7 +181,7 @@ volatile bool new_filename; volatile bool run_ble_background; bool was_connected; -void update_file_length(void) { +STATIC void update_file_length(void) { int32_t file_length = -1; mp_buffer_info_t bufinfo; bufinfo.buf = &file_length; @@ -188,7 +192,7 @@ void update_file_length(void) { common_hal_bleio_characteristic_set_value(&supervisor_ble_length_characteristic, &bufinfo); } -void open_current_file(void) { +STATIC void open_current_file(void) { if (active_file.obj.fs != 0) { return; } @@ -203,17 +207,15 @@ void open_current_file(void) { update_file_length(); } -void close_current_file(void) { +STATIC void close_current_file(void) { f_close(&active_file); } uint32_t current_command[1024 / sizeof(uint32_t)]; volatile size_t current_offset; + void supervisor_bluetooth_background(void) { - #if !CIRCUITPY_BLE_FILE_SERVICE - return; - #endif if (!run_ble_background) { return; } @@ -305,54 +307,4 @@ void supervisor_bluetooth_background(void) { } } -// This happens in an interrupt so we need to be quick. -bool supervisor_bluetooth_hook(ble_evt_t *ble_evt) { - #if !CIRCUITPY_BLE_FILE_SERVICE - return false; - #endif - // Catch writes to filename or contents. Length is read-only. - - bool done = false; - switch (ble_evt->header.evt_id) { - case BLE_GAP_EVT_CONNECTED: - // We run our background task even if it wasn't us connected to because we may want to - // advertise if the user code stopped advertising. - run_ble_background = true; - break; - case BLE_GAP_EVT_DISCONNECTED: - run_ble_background = true; - break; - case BLE_GATTS_EVT_WRITE: { - // A client wrote to a characteristic. - - ble_gatts_evt_write_t *evt_write = &ble_evt->evt.gatts_evt.params.write; - // Event handle must match the handle for my characteristic. - if (evt_write->handle == supervisor_ble_contents_characteristic.handle) { - // Handle events - //write_to_ringbuf(self, evt_write->data, evt_write->len); - // First packet includes a uint16_t le for length at the start. - uint16_t current_length = ((uint16_t*) current_command)[0]; - memcpy(((uint8_t*) current_command) + current_offset, evt_write->data, evt_write->len); - current_offset += evt_write->len; - current_length = ((uint16_t*) current_command)[0]; - if (current_offset == current_length) { - run_ble_background = true; - done = true; - } - } else if (evt_write->handle == supervisor_ble_filename_characteristic.handle) { - new_filename = true; - run_ble_background = true; - done = true; - } else { - return done; - } - break; - } - - default: - // For debugging. - // mp_printf(&mp_plat_print, "Unhandled peripheral event: 0x%04x\n", ble_evt->header.evt_id); - break; - } - return done; -} +#endif // #else diff --git a/supervisor/shared/bluetooth.h b/supervisor/shared/bluetooth.h index 1fb6a879a8..aa5ae60bf7 100644 --- a/supervisor/shared/bluetooth.h +++ b/supervisor/shared/bluetooth.h @@ -28,7 +28,6 @@ #define MICROPY_INCLUDED_SUPERVISOR_SHARED_BLUETOOTH_H void supervisor_start_bluetooth(void); -bool supervisor_bluetooth_hook(ble_evt_t *ble_evt); void supervisor_bluetooth_background(void); -#endif +#endif // MICROPY_INCLUDED_SUPERVISOR_SHARED_BLUETOOTH_H diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 21803ae0a3..51a8f68255 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -33,7 +33,7 @@ endif CFLAGS += -DSPI_FLASH_FILESYSTEM=$(SPI_FLASH_FILESYSTEM) ifeq ($(CIRCUITPY_BLEIO),1) - SRC_SUPERVISOR += supervisor/shared/bluetooth.c + SRC_SUPERVISOR += supervisor/shared/bluetooth.c supervisor/bluetooth.c endif # Choose which flash filesystem impl to use. From 017c188ab5894723b4da004f01b45f84a5b3441c Mon Sep 17 00:00:00 2001 From: jgillick Date: Thu, 25 Jun 2020 16:31:28 -0700 Subject: [PATCH 0099/1293] Move NVM block to increase program size. --- ports/stm/boards/STM32F411_nvm.ld | 8 ++++---- ports/stm/boards/thunderpack/mpconfigboard.h | 16 ++++++++-------- ports/stm/supervisor/internal_flash.h | 5 ----- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/ports/stm/boards/STM32F411_nvm.ld b/ports/stm/boards/STM32F411_nvm.ld index 5ac3e52a6e..b2134b2594 100644 --- a/ports/stm/boards/STM32F411_nvm.ld +++ b/ports/stm/boards/STM32F411_nvm.ld @@ -6,10 +6,10 @@ MEMORY { FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 32K /* sectors 1,2 are 16K */ - FLASH_NVM (rwx) : ORIGIN = 0x0800C000, LENGTH = 16K /* sector 3 is 16K */ - FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH_NVM (rwx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 4 is 64K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 384K /* sectors 5,6,7 are 128K */ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } diff --git a/ports/stm/boards/thunderpack/mpconfigboard.h b/ports/stm/boards/thunderpack/mpconfigboard.h index 394fbfd84f..c2649e2555 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.h +++ b/ports/stm/boards/thunderpack/mpconfigboard.h @@ -28,16 +28,16 @@ // Non-volatile memory config #define CIRCUITPY_INTERNAL_NVM_SIZE (0x4000) -#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x0800C000) -#define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_3 +#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x08010000) +#define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_4 // Putting the entire flash sector in the NVM byte array buffer // would take up too much RAM. This limits how much of the sector we use. -#define NVM_BYTEARRAY_BUFFER_SIZE 512 +#define NVM_BYTEARRAY_BUFFER_SIZE 512 // Flash config -#define FLASH_SIZE (0x80000) -#define FLASH_PAGE_SIZE (0x4000) +#define FLASH_SIZE (0x80000) +#define FLASH_PAGE_SIZE (0x4000) #define BOARD_FLASH_SIZE (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE- 0x2000 - 0xC000) #define HSE_VALUE ((uint32_t)24000000U) @@ -47,7 +47,7 @@ #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // Status LEDs -#define MICROPY_HW_LED_STATUS (&pin_PA02) +#define MICROPY_HW_LED_STATUS (&pin_PA02) -#define DEFAULT_I2C_BUS_SCL (&pin_PB06) -#define DEFAULT_I2C_BUS_SDA (&pin_PB07) +#define DEFAULT_I2C_BUS_SCL (&pin_PB06) +#define DEFAULT_I2C_BUS_SDA (&pin_PB07) diff --git a/ports/stm/supervisor/internal_flash.h b/ports/stm/supervisor/internal_flash.h index b4d07ff482..13ade4e6e7 100644 --- a/ports/stm/supervisor/internal_flash.h +++ b/ports/stm/supervisor/internal_flash.h @@ -41,14 +41,9 @@ #ifdef STM32F411xE #define STM32_FLASH_SIZE 0x80000 //512KiB -#if CIRCUITPY_NVM -#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x8000 //32KiB -#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 -#else #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB #define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 #endif -#endif #ifdef STM32F412Zx #define STM32_FLASH_SIZE 0x100000 //1MB From 3e616ccead60030a04e237d28cd1034527818509 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 26 Jun 2020 12:21:57 -0400 Subject: [PATCH 0100/1293] update submodules --- ports/atmel-samd/asf4 | 2 +- ports/atmel-samd/peripherals | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/asf4 b/ports/atmel-samd/asf4 index 039b5f3bbc..c0eef7b751 160000 --- a/ports/atmel-samd/asf4 +++ b/ports/atmel-samd/asf4 @@ -1 +1 @@ -Subproject commit 039b5f3bbc3f4ba4421e581db290560d59fef625 +Subproject commit c0eef7b75124fc946af5f75e12d82d6d01315ab1 diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 6b531fc923..e4161d7d6d 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 6b531fc923d9f02b14bd731a5f584ddf716e8773 +Subproject commit e4161d7d6d98d78eddcccb82128856af4baf7e50 From 57bac9a1fce15135ba35cdc8e3ca8c63eb2be7c3 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 26 Jun 2020 12:42:54 -0400 Subject: [PATCH 0101/1293] update submodules --- devices/ble_hci/common-hal/_bleio/Adapter.h | 6 ++++++ .../ble_hci/common-hal/_bleio/Connection.h | 6 ++---- devices/ble_hci/supervisor/bluetooth.c | 19 ------------------- 3 files changed, 8 insertions(+), 23 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.h b/devices/ble_hci/common-hal/_bleio/Adapter.h index c12e9105c4..9d4d5abf86 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.h +++ b/devices/ble_hci/common-hal/_bleio/Adapter.h @@ -34,8 +34,14 @@ #include "shared-bindings/_bleio/Connection.h" #include "shared-bindings/_bleio/ScanResults.h" +#include "shared-bindings/busio/UART.h" +#include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/microcontroller/Pin.h" +#ifndef BLEIO_TOTAL_CONNECTION_COUNT +#define BLEIO_TOTAL_CONNECTION_COUNT 5 +#endif + extern bleio_connection_internal_t bleio_connections[BLEIO_TOTAL_CONNECTION_COUNT]; typedef struct { diff --git a/devices/ble_hci/common-hal/_bleio/Connection.h b/devices/ble_hci/common-hal/_bleio/Connection.h index 1b6616ab10..7ad91aa5c5 100644 --- a/devices/ble_hci/common-hal/_bleio/Connection.h +++ b/devices/ble_hci/common-hal/_bleio/Connection.h @@ -61,8 +61,8 @@ typedef struct { volatile pair_status_t pair_status; uint8_t sec_status; // Internal security status. mp_obj_t connection_obj; - ble_drv_evt_handler_entry_t handler_entry; - ble_gap_conn_params_t conn_params; + //REMOVE ble_drv_evt_handler_entry_t handler_entry; + //REMOVE ble_gap_conn_params_t conn_params; volatile bool conn_params_updating; uint16_t mtu; // Request that CCCD values for this conenction be saved, using sys_attr values. @@ -81,8 +81,6 @@ typedef struct { uint8_t disconnect_reason; } bleio_connection_obj_t; -bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in); - uint16_t bleio_connection_get_conn_handle(bleio_connection_obj_t *self); mp_obj_t bleio_connection_new_from_internal(bleio_connection_internal_t* connection); bleio_connection_internal_t *bleio_conn_handle_to_connection(uint16_t conn_handle); diff --git a/devices/ble_hci/supervisor/bluetooth.c b/devices/ble_hci/supervisor/bluetooth.c index 7a0b775643..83a46728e5 100644 --- a/devices/ble_hci/supervisor/bluetooth.c +++ b/devices/ble_hci/supervisor/bluetooth.c @@ -27,22 +27,3 @@ #if CIRCUITPY_BLE_FILE_SERVICE #error CIRCUITPY_BLE_FILE_SERVICE not implemented for CIRCUITPY_BLEIO_HCI #endif - -void supervisor_bluetooth_start_advertising(void) { -} - -void supervisor_start_bluetooth(void) { -} - -FIL active_file; -volatile bool new_filename; -volatile bool run_ble_background; -bool was_connected; - -void supervisor_bluetooth_background(void) { -} - -// This happens in an interrupt so we need to be quick. -bool supervisor_bluetooth_hook(ble_evt_t *ble_evt) { - return false; -} From 57fde2e07bb2ee4dcff342deed08e4e7799da799 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 6 May 2020 11:04:53 -0500 Subject: [PATCH 0102/1293] sdcardio: implement new library for SD card I/O Testing performed: That a card is successfully mounted on Pygamer with the built in SD card slot This module is enabled for most FULL_BUILD boards, but is disabled for samd21 ("M0"), litex, and pca10100 for various reasons. --- locale/circuitpython.pot | 37 +- ports/atmel-samd/mpconfigport.mk | 2 + ports/litex/mpconfigport.mk | 3 +- ports/nrf/boards/pca10100/mpconfigboard.mk | 1 + py/circuitpy_defns.mk | 5 + py/circuitpy_mpconfig.h | 8 + py/circuitpy_mpconfig.mk | 3 + shared-bindings/busio/SPI.c | 7 + shared-bindings/busio/SPI.h | 2 + shared-bindings/sdcardio/SDCard.c | 184 ++++++++ shared-bindings/sdcardio/SDCard.h | 30 ++ shared-bindings/sdcardio/__init__.c | 47 +++ shared-bindings/sdcardio/__init__.h | 0 shared-module/sdcardio/SDCard.c | 466 +++++++++++++++++++++ shared-module/sdcardio/SDCard.h | 51 +++ shared-module/sdcardio/__init__.c | 0 shared-module/sdcardio/__init__.h | 0 17 files changed, 843 insertions(+), 3 deletions(-) create mode 100644 shared-bindings/sdcardio/SDCard.c create mode 100644 shared-bindings/sdcardio/SDCard.h create mode 100644 shared-bindings/sdcardio/__init__.c create mode 100644 shared-bindings/sdcardio/__init__.h create mode 100644 shared-module/sdcardio/SDCard.c create mode 100644 shared-module/sdcardio/SDCard.h create mode 100644 shared-module/sdcardio/__init__.c create mode 100644 shared-module/sdcardio/__init__.h diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 1582b746ca..55147dc03e 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -417,6 +417,10 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "" @@ -698,7 +702,8 @@ msgstr "" msgid "Error in regex" msgstr "" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -1358,6 +1363,10 @@ msgstr "" msgid "Running in safe mode! Not running saved code.\n" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -1979,6 +1988,10 @@ msgstr "" msgid "can't send non-None value to a just-started generator" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "" @@ -2105,6 +2118,10 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2662,6 +2679,10 @@ msgstr "" msgid "negative shift count" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "" @@ -2683,6 +2704,10 @@ msgstr "" msgid "no reset pin available" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "" @@ -3073,6 +3098,14 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 92d47b186a..face79fad7 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -37,6 +37,8 @@ ifndef CIRCUITPY_TOUCHIO_USE_NATIVE CIRCUITPY_TOUCHIO_USE_NATIVE = 1 endif +CIRCUITPY_SDCARDIO ?= 0 + # SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic. USB_MSC_EP_NUM_OUT = 1 diff --git a/ports/litex/mpconfigport.mk b/ports/litex/mpconfigport.mk index 311c87b5d5..427e9ea841 100644 --- a/ports/litex/mpconfigport.mk +++ b/ports/litex/mpconfigport.mk @@ -18,6 +18,7 @@ CIRCUITPY_AUDIOIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_BOARD = 0 CIRCUITPY_BUSIO = 0 +CIRCUITPY_COUNTIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 @@ -25,7 +26,7 @@ CIRCUITPY_NVM = 0 CIRCUITPY_PULSEIO = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 -CIRCUITPY_COUNTIO = 0 +CIRCUITPY_SDCARDIO = 0 # Enable USB support CIRCUITPY_USB_HID = 1 CIRCUITPY_USB_MIDI = 1 diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 385870a654..318bc02065 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -21,6 +21,7 @@ CIRCUITPY_PIXELBUF = 0 CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 1 +CIRCUITPY_SDCARDIO = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_ULAB = 0 diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 74d8f548dd..f40f506c23 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -213,6 +213,9 @@ endif ifeq ($(CIRCUITPY_SAMD),1) SRC_PATTERNS += samd/% endif +ifeq ($(CIRCUITPY_SDCARDIO),1) +SRC_PATTERNS += sdcardio/% +endif ifeq ($(CIRCUITPY_STAGE),1) SRC_PATTERNS += _stage/% endif @@ -384,6 +387,8 @@ SRC_SHARED_MODULE_ALL = \ fontio/__init__.c \ framebufferio/FramebufferDisplay.c \ framebufferio/__init__.c \ + sdcardio/SDCard.c \ + sdcardio/__init__.c \ gamepad/GamePad.c \ gamepad/__init__.c \ gamepadshift/GamePadShift.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index c92cb1b669..10f91167b7 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -537,6 +537,13 @@ extern const struct _mp_obj_module_t samd_module; #define SAMD_MODULE #endif +#if CIRCUITPY_SDCARDIO +extern const struct _mp_obj_module_t sdcardio_module; +#define SDCARDIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_sdcardio), (mp_obj_t)&sdcardio_module }, +#else +#define SDCARDIO_MODULE +#endif + #if CIRCUITPY_STAGE extern const struct _mp_obj_module_t stage_module; #define STAGE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__stage), (mp_obj_t)&stage_module }, @@ -709,6 +716,7 @@ extern const struct _mp_obj_module_t watchdog_module; ROTARYIO_MODULE \ RTC_MODULE \ SAMD_MODULE \ + SDCARDIO_MODULE \ STAGE_MODULE \ STORAGE_MODULE \ STRUCT_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 3459bff6d7..0850c195a0 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -166,6 +166,9 @@ CFLAGS += -DCIRCUITPY_RTC=$(CIRCUITPY_RTC) CIRCUITPY_SAMD ?= 0 CFLAGS += -DCIRCUITPY_SAMD=$(CIRCUITPY_SAMD) +CIRCUITPY_SDCARDIO ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_SDCARDIO=$(CIRCUITPY_SDCARDIO) + # Currently always off. CIRCUITPY_STAGE ?= 0 CFLAGS += -DCIRCUITPY_STAGE=$(CIRCUITPY_STAGE) diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 22f001d2dc..793ab4f671 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -418,3 +418,10 @@ const mp_obj_type_t busio_spi_type = { .make_new = busio_spi_make_new, .locals_dict = (mp_obj_dict_t*)&busio_spi_locals_dict, }; + +busio_spi_obj_t *validate_obj_is_spi_bus(mp_obj_t obj) { + if (!MP_OBJ_IS_TYPE(obj, &busio_spi_type)) { + mp_raise_TypeError_varg(translate("Expected a %q"), busio_spi_type.name); + } + return MP_OBJ_TO_PTR(obj); +} diff --git a/shared-bindings/busio/SPI.h b/shared-bindings/busio/SPI.h index b7b0715d13..aa7d715b9f 100644 --- a/shared-bindings/busio/SPI.h +++ b/shared-bindings/busio/SPI.h @@ -70,4 +70,6 @@ uint8_t common_hal_busio_spi_get_polarity(busio_spi_obj_t* self); // This is used by the supervisor to claim SPI devices indefinitely. extern void common_hal_busio_spi_never_reset(busio_spi_obj_t *self); +extern busio_spi_obj_t *validate_obj_is_spi_bus(mp_obj_t obj_in); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_SPI_H diff --git a/shared-bindings/sdcardio/SDCard.c b/shared-bindings/sdcardio/SDCard.c new file mode 100644 index 0000000000..54ca39f806 --- /dev/null +++ b/shared-bindings/sdcardio/SDCard.c @@ -0,0 +1,184 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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/obj.h" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "py/objarray.h" + +#include "shared-bindings/sdcardio/SDCard.h" +#include "shared-module/sdcardio/SDCard.h" +#include "common-hal/busio/SPI.h" +#include "shared-bindings/busio/SPI.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/flash.h" + +//| class SDCard: +//| """SD Card Block Interface +//| +//| Controls an SD card over SPI. This built-in module has higher read +//| performance than the library adafruit_sdcard, but it is only compatible with +//| `busio.SPI`, not `bitbangio.SPI`. Usually an SDCard object is used +//| with ``storage.VfsFat`` to allow file I/O to an SD card.""" +//| +//| def __init__(bus:busio.SPI, cs=digitalio.DigitalInOut, baudrate=8000000): +//| """Construct an SPI SD Card object with the given properties +//| +//| :param busio.SPI spi: The SPI bus +//| :param microcontroller.Pin cs: The chip select connected to the card +//| :param int baudrate: The SPI data rate to use after card setup +//| :param busio.SDIO sdio: The SDIO bus. Mutually exclusive with spi and cs. +//| +//| Note that during detection and configuration, a hard-coded low baudrate is used. +//| Data transfers use the specified baurate (rounded down to one that is supported by +//| the microcontroller) +//| +//| Example usage: +//| +//| .. code-block:: python +//| +//| import os +//| +//| import board +//| import sdcardio +//| import storage +//| +//| sd = sdcardio.SDCard(board.SPI(), board.SD_CS) +//| vfs = storage.VfsFat(sd) +//| storage.mount(vfs, '/sd') +//| os.listdir('/sd')""" + +STATIC mp_obj_t sdcardio_sdcard_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_spi, ARG_cs, ARG_baudrate, ARG_sdio, NUM_ARGS }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_spi, MP_ARG_OBJ, {.u_obj = mp_const_none } }, + { MP_QSTR_cs, MP_ARG_OBJ, {.u_obj = mp_const_none } }, + { MP_QSTR_baudrate, MP_ARG_INT, {.u_int = 8000000} }, + { MP_QSTR_sdio, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_int = 8000000} }, + }; + MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + busio_spi_obj_t *spi = validate_obj_is_spi_bus(args[ARG_spi].u_obj); + mcu_pin_obj_t *cs = validate_obj_is_free_pin(args[ARG_cs].u_obj); + + sdcardio_sdcard_obj_t *self = m_new_obj(sdcardio_sdcard_obj_t); + self->base.type = &sdcardio_SDCard_type; + + common_hal_sdcardio_sdcard_construct(self, spi, cs, args[ARG_baudrate].u_int); + + return self; +} + + +//| def count() -> int: +//| """Returns the total number of sectors +//| +//| Due to technical limitations, this is a function and not a property. +//| +//| :return: The number of 512-byte blocks, as a number""" +//| +mp_obj_t sdcardio_sdcard_count(mp_obj_t self_in) { + sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t*)self_in; + return mp_obj_new_int_from_ull(common_hal_sdcardio_sdcard_get_blockcount(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_count_obj, sdcardio_sdcard_count); + +//| def deinit() -> None: +//| """Disable permanently. +//| +//| :return: None""" +//| +mp_obj_t sdcardio_sdcard_deinit(mp_obj_t self_in) { + sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t*)self_in; + common_hal_sdcardio_sdcard_deinit(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_deinit_obj, sdcardio_sdcard_deinit); + + +//| def readblocks(start_block: int, buf: bytearray) -> None: +//| +//| """Read one or more blocks from the card +//| +//| :param int start_block: The block to start reading from +//| :param bytearray buf: The buffer to write into. Length must be multiple of 512. +//| +//| :return: None""" +//| + +mp_obj_t sdcardio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { + uint32_t start_block = mp_obj_get_int(start_block_in); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE); + sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t*)self_in; + int result = common_hal_sdcardio_sdcard_readblocks(self, start_block, &bufinfo); + if (result < 0) { + mp_raise_OSError(-result); + } + return mp_const_none; +} + +MP_DEFINE_CONST_FUN_OBJ_3(sdcardio_sdcard_readblocks_obj, sdcardio_sdcard_readblocks); + +//| def writeblocks(start_block: int, buf: bytearray) -> None: +//| +//| """Write one or more blocks to the card +//| +//| :param int start_block: The block to start writing from +//| :param bytearray buf: The buffer to read from. Length must be multiple of 512. +//| +//| :return: None""" +//| + +mp_obj_t sdcardio_sdcard_writeblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { + uint32_t start_block = mp_obj_get_int(start_block_in); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); + sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t*)self_in; + int result = common_hal_sdcardio_sdcard_writeblocks(self, start_block, &bufinfo); + if (result < 0) { + mp_raise_OSError(-result); + } + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_3(sdcardio_sdcard_writeblocks_obj, sdcardio_sdcard_writeblocks); + +STATIC const mp_rom_map_elem_t sdcardio_sdcard_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_count), MP_ROM_PTR(&sdcardio_sdcard_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&sdcardio_sdcard_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_readblocks), MP_ROM_PTR(&sdcardio_sdcard_readblocks_obj) }, + { MP_ROM_QSTR(MP_QSTR_writeblocks), MP_ROM_PTR(&sdcardio_sdcard_writeblocks_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(sdcardio_sdcard_locals_dict, sdcardio_sdcard_locals_dict_table); + +const mp_obj_type_t sdcardio_SDCard_type = { + { &mp_type_type }, + .name = MP_QSTR_SDCard, + .make_new = sdcardio_sdcard_make_new, + .locals_dict = (mp_obj_dict_t*)&sdcardio_sdcard_locals_dict, +}; diff --git a/shared-bindings/sdcardio/SDCard.h b/shared-bindings/sdcardio/SDCard.h new file mode 100644 index 0000000000..5986d5b814 --- /dev/null +++ b/shared-bindings/sdcardio/SDCard.h @@ -0,0 +1,30 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017, 2018 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2020 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 + +extern const mp_obj_type_t sdcardio_SDCard_type; diff --git a/shared-bindings/sdcardio/__init__.c b/shared-bindings/sdcardio/__init__.c new file mode 100644 index 0000000000..746aa5588e --- /dev/null +++ b/shared-bindings/sdcardio/__init__.c @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/sdcardio/SDCard.h" + +//| """Interface to an SD card via the SPI bus""" + +STATIC const mp_rom_map_elem_t sdcardio_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_sdcardio) }, + { MP_ROM_QSTR(MP_QSTR_SDCard), MP_ROM_PTR(&sdcardio_SDCard_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(sdcardio_module_globals, sdcardio_module_globals_table); + +const mp_obj_module_t sdcardio_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&sdcardio_module_globals, +}; diff --git a/shared-bindings/sdcardio/__init__.h b/shared-bindings/sdcardio/__init__.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shared-module/sdcardio/SDCard.c b/shared-module/sdcardio/SDCard.c new file mode 100644 index 0000000000..9e861279d3 --- /dev/null +++ b/shared-module/sdcardio/SDCard.c @@ -0,0 +1,466 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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. + */ + +// This implementation largely follows the structure of adafruit_sdcard.py + +#include "shared-bindings/busio/SPI.h" +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "shared-bindings/time/__init__.h" +#include "shared-bindings/util.h" +#include "shared-module/sdcardio/SDCard.h" + +#include "py/mperrno.h" + +#if 0 +#define DEBUG_PRINT(...) ((void)mp_printf(&mp_plat_print, ## __VA_ARGS__)) +#else +#define DEBUG_PRINT(...) ((void)0) +#endif + +#define CMD_TIMEOUT (200) + +#define R1_IDLE_STATE (1<<0) +#define R1_ILLEGAL_COMMAND (1<<2) + +#define TOKEN_CMD25 (0xFC) +#define TOKEN_STOP_TRAN (0xFD) +#define TOKEN_DATA (0xFE) + +STATIC bool lock_and_configure_bus(sdcardio_sdcard_obj_t *self) { + if (!common_hal_busio_spi_try_lock(self->bus)) { + return false; + } + common_hal_busio_spi_configure(self->bus, self->baudrate, 0, 0, 8); + common_hal_digitalio_digitalinout_set_value(&self->cs, false); + return true; +} + +STATIC void lock_bus_or_throw(sdcardio_sdcard_obj_t *self) { + if (!lock_and_configure_bus(self)) { + mp_raise_OSError(EAGAIN); + } +} + +STATIC void clock_card(sdcardio_sdcard_obj_t *self, int bytes) { + uint8_t buf[] = {0xff}; + common_hal_digitalio_digitalinout_set_value(&self->cs, true); + for (int i=0; ibus, buf, 1); + } +} + +STATIC void extraclock_and_unlock_bus(sdcardio_sdcard_obj_t *self) { + clock_card(self, 1); + common_hal_busio_spi_unlock(self->bus); +} + +static uint8_t CRC7(const uint8_t* data, uint8_t n) { + uint8_t crc = 0; + for (uint8_t i = 0; i < n; i++) { + uint8_t d = data[i]; + for (uint8_t j = 0; j < 8; j++) { + crc <<= 1; + if ((d & 0x80) ^ (crc & 0x80)) { + crc ^= 0x09; + } + d <<= 1; + } + } + return (crc << 1) | 1; +} + +#define READY_TIMEOUT_NS (300 * 1000 * 1000) // 300ms +STATIC void wait_for_ready(sdcardio_sdcard_obj_t *self) { + uint64_t deadline = common_hal_time_monotonic_ns() + READY_TIMEOUT_NS; + while (common_hal_time_monotonic_ns() < deadline) { + uint8_t b; + common_hal_busio_spi_read(self->bus, &b, 1, 0xff); + if (b == 0xff) { + break; + } + } +} + +// In Python API, defaults are response=None, data_block=True, wait=True +STATIC int cmd(sdcardio_sdcard_obj_t *self, int cmd, int arg, void *response_buf, size_t response_len, bool data_block, bool wait) { + DEBUG_PRINT("cmd % 3d [%02x] arg=% 11d [%08x] len=%d%s%s\n", cmd, cmd, arg, arg, response_len, data_block ? " data" : "", wait ? " wait" : ""); + uint8_t cmdbuf[6]; + cmdbuf[0] = cmd | 0x40; + cmdbuf[1] = (arg >> 24) & 0xff; + cmdbuf[2] = (arg >> 16) & 0xff; + cmdbuf[3] = (arg >> 8) & 0xff; + cmdbuf[4] = arg & 0xff; + cmdbuf[5] = CRC7(cmdbuf, 5); + + if (wait) { + wait_for_ready(self); + } + + common_hal_busio_spi_write(self->bus, cmdbuf, sizeof(cmdbuf)); + + // Wait for the response (response[7] == 0) + bool response_received = false; + for (int i=0; ibus, cmdbuf, 1, 0xff); + if ((cmdbuf[0] & 0x80) == 0) { + response_received = true; + break; + } + } + + if (!response_received) { + return -EIO; + } + + if (response_buf) { + + if (data_block) { + cmdbuf[1] = 0xff; + do { + // Wait for the start block byte + common_hal_busio_spi_read(self->bus, cmdbuf+1, 1, 0xff); + } while (cmdbuf[1] != 0xfe); + } + + common_hal_busio_spi_read(self->bus, response_buf, response_len, 0xff); + + if (data_block) { + // Read and discard the CRC-CCITT checksum + common_hal_busio_spi_read(self->bus, cmdbuf+1, 2, 0xff); + } + + } + + return cmdbuf[0]; +} + +STATIC int block_cmd(sdcardio_sdcard_obj_t *self, int cmd_, int block, void *response_buf, size_t response_len, bool data_block, bool wait) { + return cmd(self, cmd_, block * self->cdv, response_buf, response_len, true, true); +} + +STATIC bool cmd_nodata(sdcardio_sdcard_obj_t* self, int cmd, int response) { + uint8_t cmdbuf[2] = {cmd, 0xff}; + + common_hal_busio_spi_write(self->bus, cmdbuf, sizeof(cmdbuf)); + + // Wait for the response (response[7] == response) + for (int i=0; ibus, cmdbuf, 1, 0xff); + if (cmdbuf[0] == response) { + return 0; + } + } + return -EIO; +} + +STATIC const compressed_string_t *init_card_v1(sdcardio_sdcard_obj_t *self) { + for (int i=0; icdv = 1; + } + return NULL; + } + } + return translate("timeout waiting for v2 card"); +} + +STATIC const compressed_string_t *init_card(sdcardio_sdcard_obj_t *self) { + clock_card(self, 10); + + common_hal_digitalio_digitalinout_set_value(&self->cs, false); + + // CMD0: init card: should return _R1_IDLE_STATE (allow 5 attempts) + { + bool reached_idle_state = false; + for (int i=0; i<5; i++) { + if (cmd(self, 0, 0, NULL, 0, true, true) == R1_IDLE_STATE) { + reached_idle_state = true; + break; + } + } + if (!reached_idle_state) { + return translate("no SD card"); + } + } + + // CMD8: determine card version + { + uint8_t rb7[4]; + int response = cmd(self, 8, 0x1AA, rb7, sizeof(rb7), false, true); + if (response == R1_IDLE_STATE) { + const compressed_string_t *result =init_card_v2(self); + if (result != NULL) { + return result; + } + } else if (response == (R1_IDLE_STATE | R1_ILLEGAL_COMMAND)) { + const compressed_string_t *result =init_card_v1(self); + if (result != NULL) { + return result; + } + } else { + return translate("couldn't determine SD card version"); + } + } + + // CMD9: get number of sectors + { + uint8_t csd[16]; + int response = cmd(self, 9, 0, csd, sizeof(csd), true, true); + if (response != 0) { + return translate("no response from SD card"); + } + int csd_version = (csd[0] & 0xC0) >> 6; + if (csd_version >= 2) { + return translate("SD card CSD format not supported"); + } + + if (csd_version == 1) { + self->sectors = ((csd[8] << 8 | csd[9]) + 1) * 1024; + } else { + uint32_t block_length = 1 << (csd[5] & 0xF); + uint32_t c_size = ((csd[6] & 0x3) << 10) | (csd[7] << 2) | ((csd[8] & 0xC) >> 6); + uint32_t mult = 1 << (((csd[9] & 0x3) << 1 | (csd[10] & 0x80) >> 7) + 2); + self->sectors = block_length / 512 * mult * (c_size + 1); + } + } + + // CMD16: set block length to 512 bytes + { + int response = cmd(self, 16, 512, NULL, 0, true, true); + if (response != 0) { + return translate("can't set 512 block size"); + } + } + + return NULL; +} + +void common_hal_sdcardio_sdcard_construct(sdcardio_sdcard_obj_t *self, busio_spi_obj_t *bus, mcu_pin_obj_t *cs, int baudrate) { + self->bus = bus; + common_hal_digitalio_digitalinout_construct(&self->cs, cs); + common_hal_digitalio_digitalinout_switch_to_output(&self->cs, true, DRIVE_MODE_PUSH_PULL); + + self->cdv = 512; + self->sectors = 0; + self->baudrate = 250000; + + lock_bus_or_throw(self); + const compressed_string_t *result = init_card(self); + extraclock_and_unlock_bus(self); + + if (result != NULL) { + common_hal_digitalio_digitalinout_deinit(&self->cs); + mp_raise_OSError_msg(result); + } + + self->baudrate = baudrate; +} + +void common_hal_sdcardio_sdcard_deinit(sdcardio_sdcard_obj_t *self) { + if (!self->bus) { + return; + } + self->bus = 0; + common_hal_digitalio_digitalinout_deinit(&self->cs); +} + +void common_hal_sdcardio_check_for_deinit(sdcardio_sdcard_obj_t *self) { + if (!self->bus) { + raise_deinited_error(); + } +} + +int common_hal_sdcardio_sdcard_get_blockcount(sdcardio_sdcard_obj_t *self) { + common_hal_sdcardio_check_for_deinit(self); + return self->sectors; +} + +int readinto(sdcardio_sdcard_obj_t *self, void *buf, size_t size) { + uint8_t aux[2] = {0, 0}; + while (aux[0] != 0xfe) { + common_hal_busio_spi_read(self->bus, aux, 1, 0xff); + } + + common_hal_busio_spi_read(self->bus, buf, size, 0xff); + + // Read checksum and throw it away + common_hal_busio_spi_read(self->bus, aux, sizeof(aux), 0xff); + return 0; +} + +int readblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf) { + uint32_t nblocks = buf->len / 512; + if (nblocks == 1) { + // Use CMD17 to read a single block + return block_cmd(self, 17, start_block, buf->buf, buf->len, true, true); + } else { + // Use CMD18 to read multiple blocks + int r = block_cmd(self, 18, start_block, NULL, 0, true, true); + if (r < 0) { + return r; + } + + uint8_t *ptr = buf->buf; + while (nblocks--) { + r = readinto(self, ptr, 512); + if (r < 0) { + return r; + } + ptr += 512; + } + + // End the multi-block read + r = cmd(self, 12, 0, NULL, 0, true, false); + + // Return first status 0 or last before card ready (0xff) + while (r != 0) { + uint8_t single_byte; + common_hal_busio_spi_read(self->bus, &single_byte, 1, 0xff); + if (single_byte & 0x80) { + return r; + } + r = single_byte; + } + } + return 0; +} + +int common_hal_sdcardio_sdcard_readblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf) { + common_hal_sdcardio_check_for_deinit(self); + if (buf->len % 512 != 0) { + mp_raise_ValueError(translate("Buffer length must be a multiple of 512")); + } + + lock_and_configure_bus(self); + int r = readblocks(self, start_block, buf); + extraclock_and_unlock_bus(self); + return r; +} + +int _write(sdcardio_sdcard_obj_t *self, uint8_t token, void *buf, size_t size) { + wait_for_ready(self); + + uint8_t cmd[2]; + cmd[0] = token; + + common_hal_busio_spi_write(self->bus, cmd, 1); + common_hal_busio_spi_write(self->bus, buf, size); + + cmd[0] = cmd[1] = 0xff; + common_hal_busio_spi_write(self->bus, cmd, 2); + + // Check the response + // This differs from the traditional adafruit_sdcard handling, + // but adafruit_sdcard also ignored the return value of SDCard._write(!) + // so nobody noticed + // + // + // Response is as follows: + // x x x 0 STAT 1 + // 7 6 5 4 3..1 0 + // with STATUS 010 indicating "data accepted", and other status bit + // combinations indicating failure. + // In practice, I was seeing cmd[0] as 0xe5, indicating success + for (int i=0; ibus, cmd, 1, 0xff); + DEBUG_PRINT("i=%02d cmd[0] = 0x%02x\n", i, cmd[0]); + if ((cmd[0] & 0b00010001) == 0b00000001) { + if ((cmd[0] & 0x1f) != 0x5) { + return -EIO; + } else { + break; + } + } + } + + // Wait for the write to finish + do { + common_hal_busio_spi_read(self->bus, cmd, 1, 0xff); + } while (cmd[0] == 0); + + // Success + return 0; +} + +int writeblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf) { + common_hal_sdcardio_check_for_deinit(self); + uint32_t nblocks = buf->len / 512; + if (nblocks == 1) { + // Use CMD24 to write a single block + int r = block_cmd(self, 24, start_block, NULL, 0, true, true); + if (r < 0) { + return r; + } + r = _write(self, TOKEN_DATA, buf->buf, buf->len); + if (r < 0) { + return r; + } + } else { + // Use CMD25 to write multiple block + int r = block_cmd(self, 25, start_block, NULL, 0, true, true); + if (r < 0) { + return r; + } + + uint8_t *ptr = buf->buf; + while (nblocks--) { + r = _write(self, TOKEN_CMD25, ptr, 512); + if (r < 0) { + return r; + } + ptr += 512; + } + + cmd_nodata(self, TOKEN_STOP_TRAN, 0); + } + return 0; +} + +int common_hal_sdcardio_sdcard_writeblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf) { + common_hal_sdcardio_check_for_deinit(self); + if (buf->len % 512 != 0) { + mp_raise_ValueError(translate("Buffer length must be a multiple of 512")); + } + lock_and_configure_bus(self); + int r = writeblocks(self, start_block, buf); + extraclock_and_unlock_bus(self); + return r; +} diff --git a/shared-module/sdcardio/SDCard.h b/shared-module/sdcardio/SDCard.h new file mode 100644 index 0000000000..76c906029f --- /dev/null +++ b/shared-module/sdcardio/SDCard.h @@ -0,0 +1,51 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "py/objarray.h" + +#include "common-hal/busio/SPI.h" +#include "common-hal/digitalio/DigitalInOut.h" + +typedef struct { + mp_obj_base_t base; + busio_spi_obj_t *bus; + digitalio_digitalinout_obj_t cs; + int cdv; + int baudrate; + uint32_t sectors; +} sdcardio_sdcard_obj_t; + +void common_hal_sdcardio_sdcard_construct(sdcardio_sdcard_obj_t *self, busio_spi_obj_t *spi, mcu_pin_obj_t *cs, int baudrate); +void common_hal_sdcardio_sdcard_deinit(sdcardio_sdcard_obj_t *self); +void common_hal_sdcardio_sdcard_check_for_deinit(sdcardio_sdcard_obj_t *self); +int common_hal_sdcardio_sdcard_get_blockcount(sdcardio_sdcard_obj_t *self); +int common_hal_sdcardio_sdcard_readblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf); +int common_hal_sdcardio_sdcard_writeblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf); diff --git a/shared-module/sdcardio/__init__.c b/shared-module/sdcardio/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shared-module/sdcardio/__init__.h b/shared-module/sdcardio/__init__.h new file mode 100644 index 0000000000..e69de29bb2 From 159728b550c70f239e03c267a23f3950de635d3a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 27 May 2020 09:09:39 -0500 Subject: [PATCH 0103/1293] shared-bindings: Factor out validate_list_is_free_pins This will ultimately be used by SDIO, where a variable length list of data lines is called for. --- locale/circuitpython.pot | 2 +- shared-bindings/microcontroller/Pin.c | 12 ++++++++++++ shared-bindings/microcontroller/Pin.h | 1 + shared-bindings/rgbmatrix/RGBMatrix.c | 11 ++++------- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 55147dc03e..9a5a788b08 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -338,7 +338,7 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "" diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index 765e602e5f..d5b971ae5e 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -101,6 +101,18 @@ mcu_pin_obj_t *validate_obj_is_free_pin(mp_obj_t obj) { return pin; } +// Validate every element in the list to be a free pin. +void validate_list_is_free_pins(qstr what, 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); + } + *count_out = len; + for (mp_int_t i=0; i max_pins) { - mp_raise_ValueError_varg(translate("At most %d %q may be specified (not %d)"), max_pins, what, len); - } - *count_out = len; - for (mp_int_t i=0; i Date: Fri, 26 Jun 2020 10:10:39 -0500 Subject: [PATCH 0104/1293] sdioio: Add shared-bindings There is no implementation yet. --- locale/circuitpython.pot | 4 + py/circuitpy_defns.mk | 5 + py/circuitpy_mpconfig.h | 8 + py/circuitpy_mpconfig.mk | 3 + shared-bindings/sdioio/SDCard.c | 310 ++++++++++++++++++++++++++++++ shared-bindings/sdioio/SDCard.h | 66 +++++++ shared-bindings/sdioio/__init__.c | 47 +++++ shared-bindings/sdioio/__init__.h | 0 8 files changed, 443 insertions(+) create mode 100644 shared-bindings/sdioio/SDCard.c create mode 100644 shared-bindings/sdioio/SDCard.h create mode 100644 shared-bindings/sdioio/__init__.c create mode 100644 shared-bindings/sdioio/__init__.h diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 9a5a788b08..481d29f248 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -863,6 +863,10 @@ msgstr "" msgid "Internal error #%d" msgstr "" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index f40f506c23..32d3640069 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -216,6 +216,9 @@ endif ifeq ($(CIRCUITPY_SDCARDIO),1) SRC_PATTERNS += sdcardio/% endif +ifeq ($(CIRCUITPY_SDIOIO),1) +SRC_PATTERNS += sdioio/% +endif ifeq ($(CIRCUITPY_STAGE),1) SRC_PATTERNS += _stage/% endif @@ -314,6 +317,8 @@ SRC_COMMON_HAL_ALL = \ rotaryio/__init__.c \ rtc/RTC.c \ rtc/__init__.c \ + sdioio/SDCard.c \ + sdioio/__init__.c \ supervisor/Runtime.c \ supervisor/__init__.c \ watchdog/WatchDogMode.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 10f91167b7..d05a246fce 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -544,6 +544,13 @@ extern const struct _mp_obj_module_t sdcardio_module; #define SDCARDIO_MODULE #endif +#if CIRCUITPY_SDIOIO +extern const struct _mp_obj_module_t sdioio_module; +#define SDIOIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_sdioio), (mp_obj_t)&sdioio_module }, +#else +#define SDIOIO_MODULE +#endif + #if CIRCUITPY_STAGE extern const struct _mp_obj_module_t stage_module; #define STAGE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__stage), (mp_obj_t)&stage_module }, @@ -717,6 +724,7 @@ extern const struct _mp_obj_module_t watchdog_module; RTC_MODULE \ SAMD_MODULE \ SDCARDIO_MODULE \ + SDIOIO_MODULE \ STAGE_MODULE \ STORAGE_MODULE \ STRUCT_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 0850c195a0..302368f74a 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -169,6 +169,9 @@ CFLAGS += -DCIRCUITPY_SAMD=$(CIRCUITPY_SAMD) CIRCUITPY_SDCARDIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_SDCARDIO=$(CIRCUITPY_SDCARDIO) +CIRCUITPY_SDIOIO ?= 0 +CFLAGS += -DCIRCUITPY_SDIOIO=$(CIRCUITPY_SDIOIO) + # Currently always off. CIRCUITPY_STAGE ?= 0 CFLAGS += -DCIRCUITPY_STAGE=$(CIRCUITPY_STAGE) diff --git a/shared-bindings/sdioio/SDCard.c b/shared-bindings/sdioio/SDCard.c new file mode 100644 index 0000000000..c6b1d280ba --- /dev/null +++ b/shared-bindings/sdioio/SDCard.c @@ -0,0 +1,310 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * 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. + */ + +// This file contains all of the Python API definitions for the +// sdioio.SDCard class. + +#include + +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/sdioio/SDCard.h" +#include "shared-bindings/util.h" + +#include "lib/utils/buffer_helper.h" +#include "lib/utils/context_manager_helpers.h" +#include "py/mperrno.h" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +//| class SDCard: +//| """SD Card Block Interface with SDIO +//| +//| Controls an SD card over SDIO. SDIO is a parallel protocol designed +//| for SD cards. It uses a clock pin, a command pin, and 1 or 4 +//| data pins. It can be operated at a high frequency such as +//| 25MHz. Usually an SDCard object is used with ``storage.VfsFat`` +//| to allow file I/O to an SD card.""" +//| +//| def __init__(*, clock: digitalio.DigitalInOut, command: digitalio.DigitalInOut, data: List[digitalio.DigitalInOut], frequency: int): +//| """Construct an SDIO SD Card object with the given properties +//| +//| :param ~microcontroller.Pin clock: the pin to use for the clock. +//| :param ~microcontroller.Pin command: the pin to use for the command. +//| :param data: A sequence of pins to use for data. +//| :param frequency: The frequency of the bus in Hz +//| +//| Example usage: +//| +//| .. code-block:: python +//| +//| import os +//| +//| import board +//| import sdioio +//| import storage +//| +//| sd = sdioio.SDCard( +//| clock=board.SDIO_CLOCK, +//| command=board.SDIO_COMMAND, +//| data=board.SDIO_DATA, +//| frequency=25000000) +//| vfs = storage.VfsFat(sd) +//| storage.mount(vfs, '/sd') +//| os.listdir('/sd')""" +//| ... +//| + +STATIC mp_obj_t sdioio_sdcard_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + sdioio_sdcard_obj_t *self = m_new_obj(sdioio_sdcard_obj_t); + self->base.type = &sdioio_SDCard_type; + enum { ARG_clock, ARG_command, ARG_data, ARG_frequency, NUM_ARGS }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_clock, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ }, + { MP_QSTR_command, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ }, + { MP_QSTR_data, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ }, + { MP_QSTR_frequency, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_INT }, + }; + MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + const mcu_pin_obj_t* clock = validate_obj_is_free_pin(args[ARG_clock].u_obj); + const mcu_pin_obj_t* command = validate_obj_is_free_pin(args[ARG_command].u_obj); + mcu_pin_obj_t *data_pins[4]; + uint8_t num_data; + validate_list_is_free_pins(MP_QSTR_data, data_pins, MP_ARRAY_SIZE(data_pins), args[ARG_data].u_obj, &num_data); + + common_hal_sdioio_sdcard_construct(self, clock, command, num_data, data_pins, args[ARG_frequency].u_int); + return MP_OBJ_FROM_PTR(self); +} + +STATIC void check_for_deinit(sdioio_sdcard_obj_t *self) { + if (common_hal_sdioio_sdcard_deinited(self)) { + raise_deinited_error(); + } +} + +//| def configure(*, frequency=0, width=0) -> None: +//| """Configures the SDIO bus. +//| +//| :param int frequency: the desired clock rate in Hertz. The actual clock rate may be higher or lower due to the granularity of available clock settings. Check the `frequency` attribute for the actual clock rate. +//| :param int width: the number of data lines to use. Must be 1 or 4 and must also not exceed the number of data lines at construction +//| +//| .. note:: Leaving a value unspecified or 0 means the current setting is kept""" +//| +STATIC mp_obj_t sdioio_sdcard_configure(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_frequency, ARG_width, NUM_ARGS }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_frequency, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_width, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, + }; + sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + check_for_deinit(self); + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); + mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + mp_int_t frequency = args[ARG_frequency].u_int; + if (frequency < 0) { + mp_raise_ValueError_varg(translate("Invalid %q"), MP_QSTR_baudrate); + } + + uint8_t width = args[ARG_width].u_int; + if (width != 0 && width != 1 && width != 4) { + mp_raise_ValueError_varg(translate("Invalid %q"), MP_QSTR_width); + } + + if (!common_hal_sdioio_sdcard_configure(self, frequency, width)) { + mp_raise_OSError(MP_EIO); + } + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_KW(sdioio_sdcard_configure_obj, 1, sdioio_sdcard_configure); + +//| def count() -> int: +//| """Returns the total number of sectors +//| +//| Due to technical limitations, this is a function and not a property. +//| +//| :return: The number of 512-byte blocks, as a number""" +//| +STATIC mp_obj_t sdioio_sdcard_count(mp_obj_t self_in) { + sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_sdioio_sdcard_get_count(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_count_obj, sdioio_sdcard_count); + +//| def readblocks(start_block: int, buf: bytearray) -> None: +//| +//| """Read one or more blocks from the card +//| +//| :param int start_block: The block to start reading from +//| :param bytearray buf: The buffer to write into. Length must be multiple of 512. +//| +//| :return: None""" +mp_obj_t sdioio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { + uint32_t start_block = mp_obj_get_int(start_block_in); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE); + sdioio_sdcard_obj_t *self = (sdioio_sdcard_obj_t*)self_in; + int result = common_hal_sdioio_sdcard_readblocks(self, start_block, &bufinfo); + if (result < 0) { + mp_raise_OSError(-result); + } + return mp_const_none; +} + +MP_DEFINE_CONST_FUN_OBJ_3(sdioio_sdcard_readblocks_obj, sdioio_sdcard_readblocks); + +//| def writeblocks(start_block: int, buf: bytearray) -> None: +//| +//| """Write one or more blocks to the card +//| +//| :param int start_block: The block to start writing from +//| :param bytearray buf: The buffer to read from. Length must be multiple of 512. +//| +//| :return: None""" +//| +mp_obj_t sdioio_sdcard_writeblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { + uint32_t start_block = mp_obj_get_int(start_block_in); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE); + sdioio_sdcard_obj_t *self = (sdioio_sdcard_obj_t*)self_in; + int result = common_hal_sdioio_sdcard_writeblocks(self, start_block, &bufinfo); + if (result < 0) { + mp_raise_OSError(-result); + } + return mp_const_none; +} + +MP_DEFINE_CONST_FUN_OBJ_3(sdioio_sdcard_writeblocks_obj, sdioio_sdcard_writeblocks); + +//| @property +//| def frequency(self) -> int: +//| """The actual SDIO bus frequency. This may not match the frequency +//| requested due to internal limitations.""" +//| ... +//| +STATIC mp_obj_t sdioio_sdcard_obj_get_frequency(mp_obj_t self_in) { + sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_sdioio_sdcard_get_frequency(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_get_frequency_obj, sdioio_sdcard_obj_get_frequency); + +const mp_obj_property_t sdioio_sdcard_frequency_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&sdioio_sdcard_get_frequency_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| @property +//| def width(self) -> int: +//| """The actual SDIO bus width, in bits""" +//| ... +//| +STATIC mp_obj_t sdioio_sdcard_obj_get_width(mp_obj_t self_in) { + sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_sdioio_sdcard_get_width(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_get_width_obj, sdioio_sdcard_obj_get_width); + +const mp_obj_property_t sdioio_sdcard_width_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&sdioio_sdcard_get_width_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| def deinit() -> None: +//| """Disable permanently. +//| +//| :return: None""" +STATIC mp_obj_t sdioio_sdcard_obj_deinit(mp_obj_t self_in) { + sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_sdioio_sdcard_deinit(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_deinit_obj, sdioio_sdcard_obj_deinit); + +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers. +//| Provided by context manager helper.""" +//| ... +//| + +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| +STATIC mp_obj_t sdioio_sdcard_obj___exit__(size_t n_args, const mp_obj_t *args) { + (void)n_args; + common_hal_sdioio_sdcard_deinit(args[0]); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(sdioio_sdcard_obj___exit___obj, 4, 4, sdioio_sdcard_obj___exit__); + +STATIC const mp_rom_map_elem_t sdioio_sdcard_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&sdioio_sdcard_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&sdioio_sdcard_obj___exit___obj) }, + + { MP_ROM_QSTR(MP_QSTR_configure), MP_ROM_PTR(&sdioio_sdcard_configure_obj) }, + { MP_ROM_QSTR(MP_QSTR_frequency), MP_ROM_PTR(&sdioio_sdcard_frequency_obj) }, + { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&sdioio_sdcard_width_obj) }, + + { MP_ROM_QSTR(MP_QSTR_count), MP_ROM_PTR(&sdioio_sdcard_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_readblocks), MP_ROM_PTR(&sdioio_sdcard_readblocks_obj) }, + { MP_ROM_QSTR(MP_QSTR_writeblocks), MP_ROM_PTR(&sdioio_sdcard_writeblocks_obj) }, + +// Methods in STM HAL: +// InitCard +// ReadBlocks +// WriteBlocks +// Erase +// GetCardState +// GetCardCID +// GetCardCSD +// GetCardInfo +// GetState +// GetError +// Abort + +}; +STATIC MP_DEFINE_CONST_DICT(sdioio_sdcard_locals_dict, sdioio_sdcard_locals_dict_table); + +const mp_obj_type_t sdioio_SDCard_type = { + { &mp_type_type }, + .name = MP_QSTR_SDCard, + .make_new = sdioio_sdcard_make_new, + .locals_dict = (mp_obj_dict_t*)&sdioio_sdcard_locals_dict, +}; diff --git a/shared-bindings/sdioio/SDCard.h b/shared-bindings/sdioio/SDCard.h new file mode 100644 index 0000000000..7f62ee7a65 --- /dev/null +++ b/shared-bindings/sdioio/SDCard.h @@ -0,0 +1,66 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * 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_BUSIO_SDIO_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_SDIO_H + +#include "py/obj.h" + +#include "common-hal/microcontroller/Pin.h" +#include "common-hal/sdioio/SDCard.h" + +// Type object used in Python. Should be shared between ports. +extern const mp_obj_type_t sdioio_SDCard_type; + +// Construct an underlying SDIO object. +extern void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, + const mcu_pin_obj_t * clock, const mcu_pin_obj_t * command, + uint8_t num_data, mcu_pin_obj_t ** data, uint32_t frequency); + +extern void common_hal_sdioio_sdcard_deinit(sdioio_sdcard_obj_t *self); +extern bool common_hal_sdioio_sdcard_deinited(sdioio_sdcard_obj_t *self); + +extern bool common_hal_sdioio_sdcard_configure(sdioio_sdcard_obj_t *self, uint32_t baudrate, uint8_t width); + +extern void common_hal_sdioio_sdcard_unlock(sdioio_sdcard_obj_t *self); + +// Return actual SDIO bus frequency. +uint32_t common_hal_sdioio_sdcard_get_frequency(sdioio_sdcard_obj_t* self); + +// Return SDIO bus width. +uint8_t common_hal_sdioio_sdcard_get_width(sdioio_sdcard_obj_t* self); + +// Return number of device blocks +uint32_t common_hal_sdioio_sdcard_get_count(sdioio_sdcard_obj_t* self); + +// Read or write blocks +int common_hal_sdioio_sdcard_readblocks(sdioio_sdcard_obj_t* self, uint32_t start_block, mp_buffer_info_t *bufinfo); +int common_hal_sdioio_sdcard_writeblocks(sdioio_sdcard_obj_t* self, uint32_t start_block, mp_buffer_info_t *bufinfo); + +// This is used by the supervisor to claim SDIO devices indefinitely. +extern void common_hal_sdioio_sdcard_never_reset(sdioio_sdcard_obj_t *self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_SDIO_H diff --git a/shared-bindings/sdioio/__init__.c b/shared-bindings/sdioio/__init__.c new file mode 100644 index 0000000000..b88e5c3a96 --- /dev/null +++ b/shared-bindings/sdioio/__init__.c @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/sdioio/SDCard.h" + +//| """Interface to an SD card via the SDIO bus""" + +STATIC const mp_rom_map_elem_t sdioio_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_sdio) }, + { MP_ROM_QSTR(MP_QSTR_SDCard), MP_ROM_PTR(&sdioio_SDCard_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(sdioio_module_globals, sdioio_module_globals_table); + +const mp_obj_module_t sdioio_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&sdioio_module_globals, +}; diff --git a/shared-bindings/sdioio/__init__.h b/shared-bindings/sdioio/__init__.h new file mode 100644 index 0000000000..e69de29bb2 From d4b945851285c0b5d3a38094223d97184449e7e1 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 9 Jun 2020 11:19:51 -0500 Subject: [PATCH 0105/1293] samd: sdio: Add needed files from atmel start --- ports/atmel-samd/sd_mmc/conf_sd_mmc.h | 79 + ports/atmel-samd/sd_mmc/sd_mmc.c | 1671 +++++++++++++++++++++ ports/atmel-samd/sd_mmc/sd_mmc.h | 310 ++++ ports/atmel-samd/sd_mmc/sd_mmc_protocol.h | 1001 ++++++++++++ 4 files changed, 3061 insertions(+) create mode 100644 ports/atmel-samd/sd_mmc/conf_sd_mmc.h create mode 100644 ports/atmel-samd/sd_mmc/sd_mmc.c create mode 100644 ports/atmel-samd/sd_mmc/sd_mmc.h create mode 100644 ports/atmel-samd/sd_mmc/sd_mmc_protocol.h diff --git a/ports/atmel-samd/sd_mmc/conf_sd_mmc.h b/ports/atmel-samd/sd_mmc/conf_sd_mmc.h new file mode 100644 index 0000000000..735dd3783c --- /dev/null +++ b/ports/atmel-samd/sd_mmc/conf_sd_mmc.h @@ -0,0 +1,79 @@ +/* Auto-generated config file conf_sd_mmc.h */ +#ifndef CONF_SD_MMC_H +#define CONF_SD_MMC_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Enable the SDIO support +// conf_sdio_support +#ifndef CONF_SDIO_SUPPORT +#define CONF_SDIO_SUPPORT 0 +#endif + +// Enable the MMC card support +// conf_mmc_support +#ifndef CONF_MMC_SUPPORT +#define CONF_MMC_SUPPORT 0 +#endif + +// Enable the OS support +// conf_sd_mmc_os_support +#ifndef CONF_OS_SUPPORT +#define CONF_OS_SUPPORT 0 +#endif + +// Detection (card/write protect) timeout (ms/ticks) +// conf_sd_mmc_debounce +#ifndef CONF_SD_MMC_DEBOUNCE +#define CONF_SD_MMC_DEBOUNCE 1000 +#endif + +#ifndef CONF_SD_MMC_MEM_CNT +#define CONF_SD_MMC_MEM_CNT 1 +#endif + +// SD/MMC Slot 0 +// conf_sd_mmc_0_enable +#ifndef CONF_SD_MMC_0_ENABLE +#define CONF_SD_MMC_0_ENABLE 1 +#endif + +// Card Detect (CD) 0 Enable +// conf_sd_mmc_0_cd_detect_en +#ifndef CONF_SD_MMC_0_CD_DETECT_EN +#define CONF_SD_MMC_0_CD_DETECT_EN 0 +#endif + +// Card Detect (CD) detection level +// <1=> High +// <0=> Low +// conf_sd_mmc_0_cd_detect_value +#ifndef CONF_SD_MMC_0_CD_DETECT_VALUE +#define CONF_SD_MMC_0_CD_DETECT_VALUE 0 +#endif +// + +// Write Protect (WP) 0 Enable +// conf_sd_mmc_0_wp_detect_en +#ifndef CONF_SD_MMC_0_WP_DETECT_EN +#define CONF_SD_MMC_0_WP_DETECT_EN 0 +#endif + +// Write Protect (WP) detection level +// <1=> High +// <0=> Low +// conf_sd_mmc_0_wp_detect_value +#ifndef CONF_SD_MMC_0_WP_DETECT_VALUE +#define CONF_SD_MMC_0_WP_DETECT_VALUE 1 +#endif +// + +// + +#ifndef CONF_MCI_OS_SUPPORT +#define CONF_MCI_OS_SUPPORT 0 +#endif + +// <<< end of configuration section >>> + +#endif // CONF_SD_MMC_H diff --git a/ports/atmel-samd/sd_mmc/sd_mmc.c b/ports/atmel-samd/sd_mmc/sd_mmc.c new file mode 100644 index 0000000000..5ea9d830e9 --- /dev/null +++ b/ports/atmel-samd/sd_mmc/sd_mmc.c @@ -0,0 +1,1671 @@ +/** + * \file + * + * \brief Common SD/MMC stack + * + * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries. + * + * \asf_license_start + * + * \page License + * + * Subject to your compliance with these terms, you may use Microchip + * software and any derivatives exclusively with Microchip products. + * It is your responsibility to comply with third party license terms applicable + * to your use of third party software (including open source software) that + * may accompany Microchip software. + * + * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, + * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, + * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE + * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL + * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE + * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE + * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT + * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY + * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, + * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Microchip Support + */ + +#include + +#include "conf_sd_mmc.h" + +#include "sd_mmc_protocol.h" +#include "sd_mmc.h" + +#if CONF_OS_SUPPORT +#include +#endif +#include +#include +#include +#include + +#define TPASTE2(a, b) a##b +#define ATPASTE2(a, b) TPASTE2(a, b) + +/** + * \ingroup sd_mmc_stack + * \defgroup sd_mmc_stack_internal Implementation of SD/MMC/SDIO Stack + * @{ + */ + +#ifndef CONF_SD_MMC_MEM_CNT +#define CONF_SD_MMC_MEM_CNT 0 +#endif + +/* Macros to switch SD MMC stack to the correct driver (MCI or SPI) */ +#if (CONF_SD_MMC_MEM_CNT != 0) +#if CONF_MCI_OS_SUPPORT +#include "hal_mci_os.h" +#else +#include "hal_mci_sync.h" +#endif +#define driver mci +#else +#error No MCI or HSMCI interfaces are defined for SD MMC stack. \ + CONF_SD_MMC_MEM_CNT must be added in board.h file. +#endif + +#if CONF_MCI_OS_SUPPORT +#define driver_select_device ATPASTE2(driver, _os_select_device) +#define driver_deselect_device ATPASTE2(driver, _os_deselect_device) +#define driver_get_bus_width ATPASTE2(driver, _os_get_bus_width) +#define driver_is_high_speed_capable ATPASTE2(driver, _os_is_high_speed_capable) +#define driver_send_clock ATPASTE2(driver, _os_send_init_sequence) +#define driver_send_cmd ATPASTE2(driver, _os_send_cmd) +#define driver_get_response ATPASTE2(driver, _os_get_response) +#define driver_get_response_128 ATPASTE2(driver, _os_get_response_128) +#define driver_adtc_start ATPASTE2(driver, _os_adtc_start) +#define driver_adtc_stop ATPASTE2(driver, _os_send_cmd) +#define driver_read_word ATPASTE2(driver, _os_read_bytes) +#define driver_write_word ATPASTE2(driver, _os_write_bytes) +#define driver_start_read_blocks ATPASTE2(driver, _os_start_read_blocks) +#define driver_wait_end_of_read_blocks ATPASTE2(driver, _os_wait_end_of_read_blocks) +#define driver_start_write_blocks ATPASTE2(driver, _os_start_write_blocks) +#define driver_wait_end_of_write_blocks ATPASTE2(driver, _os_wait_end_of_write_blocks) +#else +#define driver_select_device ATPASTE2(driver, _sync_select_device) +#define driver_deselect_device ATPASTE2(driver, _sync_deselect_device) +#define driver_get_bus_width ATPASTE2(driver, _sync_get_bus_width) +#define driver_is_high_speed_capable ATPASTE2(driver, _sync_is_high_speed_capable) +#define driver_send_clock ATPASTE2(driver, _sync_send_clock) +#define driver_send_cmd ATPASTE2(driver, _sync_send_cmd) +#define driver_get_response ATPASTE2(driver, _sync_get_response) +#define driver_get_response_128 ATPASTE2(driver, _sync_get_response_128) +#define driver_adtc_start ATPASTE2(driver, _sync_adtc_start) +#define driver_adtc_stop ATPASTE2(driver, _sync_send_cmd) +#define driver_read_word ATPASTE2(driver, _sync_read_word) +#define driver_write_word ATPASTE2(driver, _sync_write_word) +#define driver_start_read_blocks ATPASTE2(driver, _sync_start_read_blocks) +#define driver_wait_end_of_read_blocks ATPASTE2(driver, _sync_wait_end_of_read_blocks) +#define driver_start_write_blocks ATPASTE2(driver, _sync_start_write_blocks) +#define driver_wait_end_of_write_blocks ATPASTE2(driver, _sync_wait_end_of_write_blocks) +#endif + +#if (CONF_SDIO_SUPPORT == 1) +#define IS_SDIO() (sd_mmc_card->type & CARD_TYPE_SDIO) +#else +#define IS_SDIO() false +#endif + +/** This SD MMC stack supports only the high voltage */ +#define SD_MMC_VOLTAGE_SUPPORT \ + (OCR_VDD_27_28 | OCR_VDD_28_29 | OCR_VDD_29_30 | OCR_VDD_30_31 | OCR_VDD_31_32 | OCR_VDD_32_33) + +/** SD/MMC card states */ +enum card_state { + SD_MMC_CARD_STATE_READY = 0, /**< Ready to use */ + SD_MMC_CARD_STATE_DEBOUNCE = 1, /**< Debounce on going */ + SD_MMC_CARD_STATE_INIT = 2, /**< Initialization on going */ + SD_MMC_CARD_STATE_UNUSABLE = 3, /**< Unusable card */ + SD_MMC_CARD_STATE_NO_CARD = 4 /**< No SD/MMC card inserted */ +}; + +/** SD/MMC card information structure */ +struct sd_mmc_card { + uint32_t clock; /**< Card access clock */ + uint32_t capacity; /**< Card capacity in KBytes */ + uint16_t rca; /**< Relative card address */ + enum card_state state; /**< Card state */ + card_type_t type; /**< Card type */ + card_version_t version; /**< Card version */ + uint8_t bus_width; /**< Number of DATA lin on bus (MCI only) */ + uint8_t csd[CSD_REG_BSIZE]; /**< CSD register */ + uint8_t high_speed; /**< High speed card (1) */ +}; + +/** Card detect pin */ +static sd_mmc_detect_t *_cd; +/** Write protect pin */ +static sd_mmc_detect_t *_wp; + +/** SD/MMC card list */ +/** Note: Initialize card detect pin fields if present */ +static struct sd_mmc_card sd_mmc_cards[CONF_SD_MMC_MEM_CNT]; + +/** HAL driver instance */ +static void *sd_mmc_hal; +/** Index of current slot configurated */ +static uint8_t sd_mmc_slot_sel; +/** Pointer on current slot configurated */ +static struct sd_mmc_card *sd_mmc_card; +/** Number of block to read or write on the current transfer */ +static uint16_t sd_mmc_nb_block_to_tranfer = 0; +/** Number of block remaining to read or write on the current transfer */ +static uint16_t sd_mmc_nb_block_remaining = 0; + +/** SD/MMC transfer rate unit codes (10K) list */ +const uint32_t sd_mmc_trans_units[7] = {10, 100, 1000, 10000, 0, 0, 0}; +/** SD transfer multiplier factor codes (1/10) list */ +const uint32_t sd_trans_multipliers[16] = {0, 10, 12, 13, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80}; +/** MMC transfer multiplier factor codes (1/10) list */ +const uint32_t mmc_trans_multipliers[16] = {0, 10, 12, 13, 15, 20, 26, 30, 35, 40, 45, 52, 55, 60, 70, 80}; + +/** \name MMC, SD and SDIO commands process */ +/** @{ */ +#if CONF_MMC_SUPPORT +static bool mmc_mci_op_cond(void); +static bool mmc_cmd6_set_bus_width(uint8_t bus_width); +static bool mmc_cmd6_set_high_speed(void); +static bool mmc_cmd8(uint8_t *b_authorize_high_speed); +static void mmc_decode_csd(void); +#endif +static bool sd_mci_op_cond(uint8_t v2); +static bool sdio_op_cond(void); +static bool sdio_get_max_speed(void); +static bool sdio_cmd52_set_bus_width(void); +static bool sdio_cmd52_set_high_speed(void); +static bool sd_cm6_set_high_speed(void); +static bool sd_cmd8(uint8_t *v2); +static bool sd_mmc_cmd9_mci(void); +static void sd_decode_csd(void); +static bool sd_mmc_cmd13(void); +#if (CONF_SDIO_SUPPORT == 1) +static bool sdio_cmd52(uint8_t rw_flag, uint8_t func_nb, uint32_t reg_addr, uint8_t rd_after_wr, uint8_t *io_data); +static bool sdio_cmd53(uint8_t rw_flag, uint8_t func_nb, uint32_t reg_addr, uint8_t inc_addr, uint32_t size, + bool access_block); +#endif +static bool sd_acmd6(void); +static bool sd_acmd51(void); +/** @} */ + +/** \name Internal function to process the initialization and install */ +/** @{ */ +static sd_mmc_err_t sd_mmc_select_slot(uint8_t slot); +static void sd_mmc_configure_slot(void); +static void sd_mmc_deselect_slot(void); +static bool sd_mmc_mci_card_init(void); +#if CONF_MMC_SUPPORT +static bool sd_mmc_mci_install_mmc(void); +#endif +/** @} */ + +/** \name Internal functions to manage a large timeout after a card insertion */ +/** @{ */ +#if CONF_OS_SUPPORT +#define SD_MMC_START_TIMEOUT() os_sleep(CONF_SD_MMC_DEBOUNCE) +#else +#define SD_MMC_START_TIMEOUT() +#endif +#define SD_MMC_IS_TIMEOUT() true +#define SD_MMC_STOP_TIMEOUT() +/** @} */ + +#if CONF_MMC_SUPPORT +/** + * \brief Sends operation condition command and read OCR (MCI only) + * - CMD1 sends operation condition command + * - CMD1 reads OCR + * + * \return true if success, otherwise false + */ +static bool mmc_mci_op_cond(void) +{ + uint32_t retry, resp; + + /* + * Timeout 1s = 400KHz / ((6+6)*8) cylces = 4200 retry + * 6 = cmd byte size + * 6 = response byte size + */ + retry = 4200; + do { + if (!driver_send_cmd(sd_mmc_hal, MMC_MCI_CMD1_SEND_OP_COND, SD_MMC_VOLTAGE_SUPPORT | OCR_ACCESS_MODE_SECTOR)) { + return false; + } + /* Check busy flag */ + resp = driver_get_response(sd_mmc_hal); + if (resp & OCR_POWER_UP_BUSY) { + /* Check OCR value */ + if ((resp & OCR_ACCESS_MODE_MASK) == OCR_ACCESS_MODE_SECTOR) { + sd_mmc_card->type |= CARD_TYPE_HC; + } + break; + } + if (retry-- == 0) { + return false; + } + } while (1); + return true; +} +#endif + +/** + * \brief Ask to all cards to send their operations conditions (MCI only). + * - ACMD41 sends operation condition command. + * - ACMD41 reads OCR + * + * \param v2 Shall be 1 if it is a SD card V2 + * + * \return true if success, otherwise false + */ +static bool sd_mci_op_cond(uint8_t v2) +{ + uint32_t arg, retry, resp; + + /* + * Timeout 1s = 400KHz / ((6+6+6+6)*8) cylces = 2100 retry + * 6 = cmd byte size + * 6 = response byte size + * 6 = cmd byte size + * 6 = response byte size + */ + retry = 2100; + do { + /* CMD55 - Indicate to the card that the next command is an + * application specific command rather than a standard command.*/ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_CMD55_APP_CMD, 0)) { + return false; + } + + /* (ACMD41) Sends host OCR register */ + arg = SD_MMC_VOLTAGE_SUPPORT; + if (v2) { + arg |= SD_ACMD41_HCS; + } + /* Check response */ + if (!driver_send_cmd(sd_mmc_hal, SD_MCI_ACMD41_SD_SEND_OP_COND, arg)) { + return false; + } + resp = driver_get_response(sd_mmc_hal); + if (resp & OCR_POWER_UP_BUSY) { + /* Card is ready */ + if ((resp & OCR_CCS) != 0) { + sd_mmc_card->type |= CARD_TYPE_HC; + } + break; + } + if (retry-- == 0) { + return false; + } + } while (1); + return true; +} + +#if (CONF_SDIO_SUPPORT == 1) +/** + * \brief Try to get the SDIO card's operating condition + * - CMD5 to read OCR NF field + * - CMD5 to wait OCR power up busy + * - CMD5 to read OCR MP field + * sd_mmc_card->type is updated + * + * \return true if success, otherwise false + */ +static bool sdio_op_cond(void) +{ + uint32_t resp; + + /* CMD5 - SDIO send operation condition (OCR) command. */ + if (!driver_send_cmd(sd_mmc_hal, SDIO_CMD5_SEND_OP_COND, 0)) { + return true; /* No error but card type not updated */ + } + resp = driver_get_response(sd_mmc_hal); + if ((resp & OCR_SDIO_NF) == 0) { + return true; /* No error but card type not updated */ + } + + /* + * Wait card ready + * Timeout 1s = 400KHz / ((6+4)*8) cylces = 5000 retry + * 6 = cmd byte size + * 4(SPI) 6(MCI) = response byte size + */ + uint32_t cmd5_retry = 5000; + while (1) { + /* CMD5 - SDIO send operation condition (OCR) command.*/ + if (!driver_send_cmd(sd_mmc_hal, SDIO_CMD5_SEND_OP_COND, resp & SD_MMC_VOLTAGE_SUPPORT)) { + return false; + } + resp = driver_get_response(sd_mmc_hal); + if ((resp & OCR_POWER_UP_BUSY) == OCR_POWER_UP_BUSY) { + break; + } + if (cmd5_retry-- == 0) { + return false; + } + } + /* Update card type at the end of busy */ + if ((resp & OCR_SDIO_MP) > 0) { + sd_mmc_card->type = CARD_TYPE_SD_COMBO; + } else { + sd_mmc_card->type = CARD_TYPE_SDIO; + } + return true; /* No error and card type updated with SDIO type */ +} + +/** + * \brief Get SDIO max transfer speed in Hz. + * - CMD53 reads CIS area address in CCCR area. + * - Nx CMD53 search Fun0 tuple in CIS area + * - CMD53 reads TPLFE_MAX_TRAN_SPEED in Fun0 tuple + * - Compute maximum speed of SDIO + * and update sd_mmc_card->clock + * + * \return true if success, otherwise false + */ +static bool sdio_get_max_speed(void) +{ + uint32_t addr_new, addr_old; + uint8_t buf[6]; + uint32_t unit; + uint32_t mul; + uint8_t tplfe_max_tran_speed, i; + uint8_t addr_cis[4]; + + /* Read CIS area address in CCCR area */ + addr_old = SDIO_CCCR_CIS_PTR; + for (i = 0; i < 4; i++) { + sdio_cmd52(SDIO_CMD52_READ_FLAG, SDIO_CIA, addr_old, 0, &addr_cis[i]); + addr_old++; + } + addr_old = addr_cis[0] + (addr_cis[1] << 8) + (addr_cis[2] << 16) + (addr_cis[3] << 24); + addr_new = addr_old; + + while (1) { + /* Read a sample of CIA area */ + for (i = 0; i < 3; i++) { + sdio_cmd52(SDIO_CMD52_READ_FLAG, SDIO_CIA, addr_new, 0, &buf[i]); + addr_new++; + } + if (buf[0] == SDIO_CISTPL_END) { + return false; /* Tuple error */ + } + if (buf[0] == SDIO_CISTPL_FUNCE && buf[2] == 0x00) { + break; /* Fun0 tuple found */ + } + if (buf[1] == 0) { + return false; /* Tuple error */ + } + /* Next address */ + addr_new += buf[1] - 1; + if (addr_new > (addr_old + 256)) { + return false; /* Outoff CIS area */ + } + } + + /* Read all Fun0 tuple fields: fn0_blk_siz & max_tran_speed */ + addr_new -= 3; + for (i = 0; i < 6; i++) { + sdio_cmd52(SDIO_CMD52_READ_FLAG, SDIO_CIA, addr_new, 0, &buf[i]); + addr_new++; + } + + tplfe_max_tran_speed = buf[5]; + if (tplfe_max_tran_speed > 0x32) { + /* Error on SDIO register, the high speed is not activated + * and the clock can not be more than 25MHz. + * This error is present on specific SDIO card + * (H&D wireless card - HDG104 WiFi SIP). + */ + tplfe_max_tran_speed = 0x32; /* 25Mhz */ + } + + /* Decode transfer speed in Hz.*/ + unit = sd_mmc_trans_units[tplfe_max_tran_speed & 0x7]; + mul = sd_trans_multipliers[(tplfe_max_tran_speed >> 3) & 0xF]; + sd_mmc_card->clock = unit * mul * 1000; + /** + * Note: A combo card shall be a Full-Speed SDIO card + * which supports upto 25MHz. + * A SDIO card alone can be: + * - a Low-Speed SDIO card which supports 400Khz minimum + * - a Full-Speed SDIO card which supports upto 25MHz + */ + return true; +} + +/** + * \brief CMD52 for SDIO - Switches the bus width mode to 4 + * + * \note sd_mmc_card->bus_width is updated. + * + * \return true if success, otherwise false + */ +static bool sdio_cmd52_set_bus_width(void) +{ + /** + * A SD memory card always supports bus 4bit + * A SD COMBO card always supports bus 4bit + * A SDIO Full-Speed alone always supports 4bit + * A SDIO Low-Speed alone can supports 4bit (Optional) + */ + uint8_t u8_value; + + /* Check 4bit support in 4BLS of "Card Capability" register */ + if (!sdio_cmd52(SDIO_CMD52_READ_FLAG, SDIO_CIA, SDIO_CCCR_CAP, 0, &u8_value)) { + return false; + } + if ((u8_value & SDIO_CAP_4BLS) != SDIO_CAP_4BLS) { + /* No supported, it is not a protocol error */ + return true; + } + /* HS mode possible, then enable */ + u8_value = SDIO_BUSWIDTH_4B; + if (!sdio_cmd52(SDIO_CMD52_WRITE_FLAG, SDIO_CIA, SDIO_CCCR_BUS_CTRL, 1, &u8_value)) { + return false; + } + sd_mmc_card->bus_width = 4; + return true; +} + +/** + * \brief CMD52 for SDIO - Enable the high speed mode + * + * \note sd_mmc_card->high_speed is updated. + * \note sd_mmc_card->clock is updated. + * + * \return true if success, otherwise false + */ +static bool sdio_cmd52_set_high_speed(void) +{ + uint8_t u8_value; + + /* Check CIA.HS */ + if (!sdio_cmd52(SDIO_CMD52_READ_FLAG, SDIO_CIA, SDIO_CCCR_HS, 0, &u8_value)) { + return false; + } + if ((u8_value & SDIO_SHS) != SDIO_SHS) { + /* No supported, it is not a protocol error */ + return true; + } + /* HS mode possible, then enable */ + u8_value = SDIO_EHS; + if (!sdio_cmd52(SDIO_CMD52_WRITE_FLAG, SDIO_CIA, SDIO_CCCR_HS, 1, &u8_value)) { + return false; + } + sd_mmc_card->high_speed = 1; + sd_mmc_card->clock *= 2; + return true; +} + +#else +static bool sdio_op_cond(void) +{ + return true; /* No error but card type not updated */ +} +static bool sdio_get_max_speed(void) +{ + return false; +} +static bool sdio_cmd52_set_bus_width(void) +{ + return false; +} +static bool sdio_cmd52_set_high_speed(void) +{ + return false; +} +#endif + +/** + * \brief CMD6 for SD - Switch card in high speed mode + * + * \note CMD6 for SD is valid under the "trans" state. + * \note sd_mmc_card->high_speed is updated. + * \note sd_mmc_card->clock is updated. + * + * \return true if success, otherwise false + */ +static bool sd_cm6_set_high_speed(void) +{ + uint8_t switch_status[SD_SW_STATUS_BSIZE] = {0}; + + if (!driver_adtc_start(sd_mmc_hal, + SD_CMD6_SWITCH_FUNC, + SD_CMD6_MODE_SWITCH | SD_CMD6_GRP6_NO_INFLUENCE | SD_CMD6_GRP5_NO_INFLUENCE + | SD_CMD6_GRP4_NO_INFLUENCE | SD_CMD6_GRP3_NO_INFLUENCE | SD_CMD6_GRP2_DEFAULT + | SD_CMD6_GRP1_HIGH_SPEED, + SD_SW_STATUS_BSIZE, + 1, + true)) { + return false; + } + if (!driver_start_read_blocks(sd_mmc_hal, switch_status, 1)) { + return false; + } + if (!driver_wait_end_of_read_blocks(sd_mmc_hal)) { + return false; + } + + if (driver_get_response(sd_mmc_hal) & CARD_STATUS_SWITCH_ERROR) { + return false; + } + if (SD_SW_STATUS_FUN_GRP1_RC(switch_status) == SD_SW_STATUS_FUN_GRP_RC_ERROR) { + /* No supported, it is not a protocol error */ + return true; + } + if (SD_SW_STATUS_FUN_GRP1_BUSY(switch_status)) { + return false; + } + /* CMD6 function switching period is within 8 clocks + * after the end bit of status data.*/ + driver_send_clock(sd_mmc_hal); + sd_mmc_card->high_speed = 1; + sd_mmc_card->clock *= 2; + return true; +} + +#if CONF_MMC_SUPPORT + +/** + * \brief CMD6 for MMC - Switches the bus width mode + * + * \note CMD6 is valid under the "trans" state. + * \note sd_mmc_card->bus_width is updated. + * + * \param bus_width Bus width to set + * + * \return true if success, otherwise false + */ +static bool mmc_cmd6_set_bus_width(uint8_t bus_width) +{ + uint32_t arg; + + switch (bus_width) { + case 8: + arg = MMC_CMD6_ACCESS_SET_BITS | MMC_CMD6_INDEX_BUS_WIDTH | MMC_CMD6_VALUE_BUS_WIDTH_8BIT; + break; + case 4: + arg = MMC_CMD6_ACCESS_SET_BITS | MMC_CMD6_INDEX_BUS_WIDTH | MMC_CMD6_VALUE_BUS_WIDTH_4BIT; + break; + default: + arg = MMC_CMD6_ACCESS_SET_BITS | MMC_CMD6_INDEX_BUS_WIDTH | MMC_CMD6_VALUE_BUS_WIDTH_1BIT; + break; + } + if (!driver_send_cmd(sd_mmc_hal, MMC_CMD6_SWITCH, arg)) { + return false; + } + if (driver_get_response(sd_mmc_hal) & CARD_STATUS_SWITCH_ERROR) { + /* No supported, it is not a protocol error */ + return false; + } + sd_mmc_card->bus_width = bus_width; + return true; +} + +/** + * \brief CMD6 for MMC - Switches in high speed mode + * + * \note CMD6 is valid under the "trans" state. + * \note sd_mmc_card->high_speed is updated. + * \note sd_mmc_card->clock is updated. + * + * \return true if success, otherwise false + */ +static bool mmc_cmd6_set_high_speed(void) +{ + if (!driver_send_cmd(sd_mmc_hal, + MMC_CMD6_SWITCH, + MMC_CMD6_ACCESS_WRITE_BYTE | MMC_CMD6_INDEX_HS_TIMING | MMC_CMD6_VALUE_HS_TIMING_ENABLE)) { + return false; + } + if (driver_get_response(sd_mmc_hal) & CARD_STATUS_SWITCH_ERROR) { + /* No supported, it is not a protocol error */ + return false; + } + sd_mmc_card->high_speed = 1; + sd_mmc_card->clock = 52000000lu; + return true; +} +#endif + +/** + * \brief CMD8 for SD card - Send Interface Condition Command. + * + * \note + * Send SD Memory Card interface condition, which includes host supply + * voltage information and asks the card whether card supports voltage. + * Should be performed at initialization time to detect the card type. + * + * \param v2 Pointer to v2 flag to update + * + * \return true if success, otherwise false + * with a update of \ref sd_mmc_err. + */ +static bool sd_cmd8(uint8_t *v2) +{ + uint32_t resp; + + *v2 = 0; + /* Test for SD version 2 */ + if (!driver_send_cmd(sd_mmc_hal, SD_CMD8_SEND_IF_COND, SD_CMD8_PATTERN | SD_CMD8_HIGH_VOLTAGE)) { + return true; /* It is not a V2 */ + } + /* Check R7 response */ + resp = driver_get_response(sd_mmc_hal); + if (resp == 0xFFFFFFFF) { + /* No compliance R7 value */ + return true; /* It is not a V2 */ + } + if ((resp & (SD_CMD8_MASK_PATTERN | SD_CMD8_MASK_VOLTAGE)) != (SD_CMD8_PATTERN | SD_CMD8_HIGH_VOLTAGE)) { + return false; + } + *v2 = 1; + return true; +} + +#if CONF_MMC_SUPPORT +/** + * \brief CMD8 - The card sends its EXT_CSD register as a block of data. + * + * \param b_authorize_high_speed Pointer to update with the high speed + * support information + * + * \return true if success, otherwise false + */ +static bool mmc_cmd8(uint8_t *b_authorize_high_speed) +{ + uint16_t i; + uint32_t ext_csd; + uint32_t sec_count; + + if (!driver_adtc_start(sd_mmc_hal, MMC_CMD8_SEND_EXT_CSD, 0, EXT_CSD_BSIZE, 1, false)) { + return false; + } + /* Read and decode Extended Extended CSD + * Note: The read access is done in byte to avoid a buffer + * of EXT_CSD_BSIZE Byte in stack.*/ + + /* Read card type */ + for (i = 0; i < (EXT_CSD_CARD_TYPE_INDEX + 4) / 4; i++) { + if (!driver_read_word(sd_mmc_hal, &ext_csd)) { + return false; + } + } + *b_authorize_high_speed = (ext_csd >> ((EXT_CSD_CARD_TYPE_INDEX % 4) * 8)) & MMC_CTYPE_52MHZ; + + if (MMC_CSD_C_SIZE(sd_mmc_card->csd) == 0xFFF) { + /* For high capacity SD/MMC card, + * memory capacity = SEC_COUNT * 512 byte */ + for (; i < (EXT_CSD_SEC_COUNT_INDEX + 4) / 4; i++) { + if (!driver_read_word(sd_mmc_hal, &sec_count)) { + return false; + } + } + sd_mmc_card->capacity = sec_count / 2; + } + for (; i < EXT_CSD_BSIZE / 4; i++) { + if (!driver_read_word(sd_mmc_hal, &sec_count)) { + return false; + } + } + return true; +} + +#endif + +/** + * \brief CMD9: Addressed card sends its card-specific + * data (CSD) on the CMD line mci. + * + * \return true if success, otherwise false + */ +static bool sd_mmc_cmd9_mci(void) +{ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_MCI_CMD9_SEND_CSD, (uint32_t)sd_mmc_card->rca << 16)) { + return false; + } + driver_get_response_128(sd_mmc_hal, sd_mmc_card->csd); + return true; +} + +#if CONF_MMC_SUPPORT +/** + * \brief Decodes MMC CSD register + */ +static void mmc_decode_csd(void) +{ + uint32_t unit; + uint32_t mul; + uint32_t tran_speed; + + /* Get MMC System Specification version supported by the card */ + switch (MMC_CSD_SPEC_VERS(sd_mmc_card->csd)) { + default: + case 0: + sd_mmc_card->version = CARD_VER_MMC_1_2; + break; + + case 1: + sd_mmc_card->version = CARD_VER_MMC_1_4; + break; + + case 2: + sd_mmc_card->version = CARD_VER_MMC_2_2; + break; + + case 3: + sd_mmc_card->version = CARD_VER_MMC_3; + break; + + case 4: + sd_mmc_card->version = CARD_VER_MMC_4; + break; + } + + /* Get MMC memory max transfer speed in Hz.*/ + tran_speed = CSD_TRAN_SPEED(sd_mmc_card->csd); + unit = sd_mmc_trans_units[tran_speed & 0x7]; + mul = mmc_trans_multipliers[(tran_speed >> 3) & 0xF]; + sd_mmc_card->clock = unit * mul * 1000; + + /* + * Get card capacity. + * ---------------------------------------------------- + * For normal SD/MMC card: + * memory capacity = BLOCKNR * BLOCK_LEN + * Where + * BLOCKNR = (C_SIZE+1) * MULT + * MULT = 2 ^ (C_SIZE_MULT+2) (C_SIZE_MULT < 8) + * BLOCK_LEN = 2 ^ READ_BL_LEN (READ_BL_LEN < 12) + * ---------------------------------------------------- + * For high capacity SD/MMC card: + * memory capacity = SEC_COUNT * 512 byte + */ + if (MMC_CSD_C_SIZE(sd_mmc_card->csd) != 0xFFF) { + uint32_t blocknr + = ((MMC_CSD_C_SIZE(sd_mmc_card->csd) + 1) * (1 << (MMC_CSD_C_SIZE_MULT(sd_mmc_card->csd) + 2))); + sd_mmc_card->capacity = blocknr * (1 << MMC_CSD_READ_BL_LEN(sd_mmc_card->csd)) / 1024; + } +} +#endif + +/** + * \brief Decodes SD CSD register + */ +static void sd_decode_csd(void) +{ + uint32_t unit; + uint32_t mul; + uint32_t tran_speed; + + /* Get SD memory maximum transfer speed in Hz. */ + tran_speed = CSD_TRAN_SPEED(sd_mmc_card->csd); + unit = sd_mmc_trans_units[tran_speed & 0x7]; + mul = sd_trans_multipliers[(tran_speed >> 3) & 0xF]; + sd_mmc_card->clock = unit * mul * 1000; + + /* + * Get card capacity. + * ---------------------------------------------------- + * For normal SD/MMC card: + * memory capacity = BLOCKNR * BLOCK_LEN + * Where + * BLOCKNR = (C_SIZE+1) * MULT + * MULT = 2 ^ (C_SIZE_MULT+2) (C_SIZE_MULT < 8) + * BLOCK_LEN = 2 ^ READ_BL_LEN (READ_BL_LEN < 12) + * ---------------------------------------------------- + * For high capacity SD card: + * memory capacity = (C_SIZE+1) * 512K byte + */ + if (CSD_STRUCTURE_VERSION(sd_mmc_card->csd) >= SD_CSD_VER_2_0) { + sd_mmc_card->capacity = (SD_CSD_2_0_C_SIZE(sd_mmc_card->csd) + 1) * 512; + } else { + uint32_t blocknr + = ((SD_CSD_1_0_C_SIZE(sd_mmc_card->csd) + 1) * (1 << (SD_CSD_1_0_C_SIZE_MULT(sd_mmc_card->csd) + 2))); + sd_mmc_card->capacity = blocknr * (1 << SD_CSD_1_0_READ_BL_LEN(sd_mmc_card->csd)) / 1024; + } +} + +/** + * \brief CMD13 - Addressed card sends its status register. + * This function waits the clear of the busy flag + * + * \return true if success, otherwise false + */ +static bool sd_mmc_cmd13(void) +{ + uint32_t nec_timeout; + + /* Wait for data ready status. + * Nec timing: 0 to unlimited + * However a timeout is used. + * 200 000 * 8 cycles + */ + nec_timeout = 200000; + do { + if (!driver_send_cmd(sd_mmc_hal, SDMMC_MCI_CMD13_SEND_STATUS, (uint32_t)sd_mmc_card->rca << 16)) { + return false; + } + /* Check busy flag */ + if (driver_get_response(sd_mmc_hal) & CARD_STATUS_READY_FOR_DATA) { + break; + } + if (nec_timeout-- == 0) { + return false; + } + } while (1); + + return true; +} + +#if (CONF_SDIO_SUPPORT == 1) +/** + * \brief CMD52 - SDIO IO_RW_DIRECT command + * + * \param rw_flag Direction, 1:write, 0:read. + * \param func_nb Number of the function. + * \param rd_after_wr Read after Write flag. + * \param reg_addr register address. + * \param io_data Pointer to input argument and response buffer. + * + * \return true if success, otherwise false + */ +static bool sdio_cmd52(uint8_t rw_flag, uint8_t func_nb, uint32_t reg_addr, uint8_t rd_after_wr, uint8_t *io_data) +{ + ASSERT(io_data != NULL); + if (!driver_send_cmd(sd_mmc_hal, + SDIO_CMD52_IO_RW_DIRECT, + ((uint32_t)*io_data << SDIO_CMD52_WR_DATA) | ((uint32_t)rw_flag << SDIO_CMD52_RW_FLAG) + | ((uint32_t)func_nb << SDIO_CMD52_FUNCTION_NUM) + | ((uint32_t)rd_after_wr << SDIO_CMD52_RAW_FLAG) + | ((uint32_t)reg_addr << SDIO_CMD52_REG_ADRR))) { + return false; + } + *io_data = driver_get_response(sd_mmc_hal) & 0xFF; + return true; +} + +/** + * \brief CMD53 - SDIO IO_RW_EXTENDED command + * This implementation support only the SDIO multi-byte transfer mode which is + * similar to the single block transfer on memory. + * Note: The SDIO block transfer mode is optional for SDIO card. + * + * \param rw_flag Direction, 1:write, 0:read. + * \param func_nb Number of the function. + * \param reg_addr Register address. + * \param inc_addr 1:Incrementing address, 0: fixed. + * \param size Transfer data size. + * \param access_block true, if the block access (DMA) is used + * + * \return true if success, otherwise false + */ +static bool sdio_cmd53(uint8_t rw_flag, uint8_t func_nb, uint32_t reg_addr, uint8_t inc_addr, uint32_t size, + bool access_block) +{ + ASSERT(size != 0); + ASSERT(size <= 512); + + return driver_adtc_start( + sd_mmc_hal, + (rw_flag == SDIO_CMD53_READ_FLAG) ? SDIO_CMD53_IO_R_BYTE_EXTENDED : SDIO_CMD53_IO_W_BYTE_EXTENDED, + ((size % 512) << SDIO_CMD53_COUNT) | ((uint32_t)reg_addr << SDIO_CMD53_REG_ADDR) + | ((uint32_t)inc_addr << SDIO_CMD53_OP_CODE) | ((uint32_t)0 << SDIO_CMD53_BLOCK_MODE) + | ((uint32_t)func_nb << SDIO_CMD53_FUNCTION_NUM) | ((uint32_t)rw_flag << SDIO_CMD53_RW_FLAG), + size, + 1, + access_block); +} +#endif + +/** + * \brief ACMD6 - Define the data bus width to 4 bits bus + * + * \return true if success, otherwise false + */ +static bool sd_acmd6(void) +{ + /* CMD55 - Indicate to the card that the next command is an + * application specific command rather than a standard command.*/ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_CMD55_APP_CMD, (uint32_t)sd_mmc_card->rca << 16)) { + return false; + } + /* 10b = 4 bits bus */ + if (!driver_send_cmd(sd_mmc_hal, SD_ACMD6_SET_BUS_WIDTH, 0x2)) { + return false; + } + sd_mmc_card->bus_width = 4; + return true; +} + +/** + * \brief ACMD51 - Read the SD Configuration Register. + * + * \note + * SD Card Configuration Register (SCR) provides information on the SD Memory + * Card's special features that were configured into the given card. The size + * of SCR register is 64 bits. + * + * + * \return true if success, otherwise false + */ +static bool sd_acmd51(void) +{ + uint8_t scr[SD_SCR_REG_BSIZE]; + + /* CMD55 - Indicate to the card that the next command is an + * application specific command rather than a standard command.*/ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_CMD55_APP_CMD, (uint32_t)sd_mmc_card->rca << 16)) { + return false; + } + if (!driver_adtc_start(sd_mmc_hal, SD_ACMD51_SEND_SCR, 0, SD_SCR_REG_BSIZE, 1, true)) { + return false; + } + if (!driver_start_read_blocks(sd_mmc_hal, scr, 1)) { + return false; + } + if (!driver_wait_end_of_read_blocks(sd_mmc_hal)) { + return false; + } + + /* Get SD Memory Card - Spec. Version */ + switch (SD_SCR_SD_SPEC(scr)) { + case SD_SCR_SD_SPEC_1_0_01: + sd_mmc_card->version = CARD_VER_SD_1_0; + break; + + case SD_SCR_SD_SPEC_1_10: + sd_mmc_card->version = CARD_VER_SD_1_10; + break; + + case SD_SCR_SD_SPEC_2_00: + if (SD_SCR_SD_SPEC3(scr) == SD_SCR_SD_SPEC_3_00) { + sd_mmc_card->version = CARD_VER_SD_3_0; + } else { + sd_mmc_card->version = CARD_VER_SD_2_0; + } + break; + + default: + sd_mmc_card->version = CARD_VER_SD_1_0; + break; + } + return true; +} + +/** + * \brief Select a card slot and initialize the associated driver + * + * \param slot Card slot number + * + * \retval SD_MMC_ERR_SLOT Wrong slot number + * \retval SD_MMC_ERR_NO_CARD No card present on slot + * \retval SD_MMC_ERR_UNUSABLE Unusable card + * \retval SD_MMC_INIT_ONGOING Card initialization requested + * \retval SD_MMC_OK Card present + */ +static sd_mmc_err_t sd_mmc_select_slot(uint8_t slot) +{ + if (slot >= CONF_SD_MMC_MEM_CNT) { + return SD_MMC_ERR_SLOT; + } + + if (_cd && _cd[slot].pin != -1) { + /** Card Detect pins */ + if (gpio_get_pin_level(_cd[slot].pin) != _cd[slot].val) { + if (sd_mmc_cards[slot].state == SD_MMC_CARD_STATE_DEBOUNCE) { + SD_MMC_STOP_TIMEOUT(); + } + sd_mmc_cards[slot].state = SD_MMC_CARD_STATE_NO_CARD; + return SD_MMC_ERR_NO_CARD; + } + if (sd_mmc_cards[slot].state == SD_MMC_CARD_STATE_NO_CARD) { + /* A card plug on going, but this is not initialized */ + sd_mmc_cards[slot].state = SD_MMC_CARD_STATE_DEBOUNCE; + /* Debounce + Power On Setup */ + SD_MMC_START_TIMEOUT(); + return SD_MMC_ERR_NO_CARD; + } + if (sd_mmc_cards[slot].state == SD_MMC_CARD_STATE_DEBOUNCE) { + if (!SD_MMC_IS_TIMEOUT()) { + /* Debounce on going */ + return SD_MMC_ERR_NO_CARD; + } + /* Card is not initialized */ + sd_mmc_cards[slot].state = SD_MMC_CARD_STATE_INIT; + /* Set 1-bit bus width and low clock for initialization */ + sd_mmc_cards[slot].clock = SDMMC_CLOCK_INIT; + sd_mmc_cards[slot].bus_width = 1; + sd_mmc_cards[slot].high_speed = 0; + } + if (sd_mmc_cards[slot].state == SD_MMC_CARD_STATE_UNUSABLE) { + return SD_MMC_ERR_UNUSABLE; + } + } else { + /* No pin card detection, then always try to install it */ + if ((sd_mmc_cards[slot].state == SD_MMC_CARD_STATE_NO_CARD) + || (sd_mmc_cards[slot].state == SD_MMC_CARD_STATE_UNUSABLE)) { + /* Card is not initialized */ + sd_mmc_cards[slot].state = SD_MMC_CARD_STATE_INIT; + /* Set 1-bit bus width and low clock for initialization */ + sd_mmc_cards[slot].clock = SDMMC_CLOCK_INIT; + sd_mmc_cards[slot].bus_width = 1; + sd_mmc_cards[slot].high_speed = 0; + } + } + + ASSERT(!(sd_mmc_slot_sel != slot && sd_mmc_nb_block_remaining != 0)); + + /* Initialize interface */ + sd_mmc_slot_sel = slot; + sd_mmc_card = &sd_mmc_cards[slot]; + sd_mmc_configure_slot(); + return (sd_mmc_cards[slot].state == SD_MMC_CARD_STATE_INIT) ? SD_MMC_INIT_ONGOING : SD_MMC_OK; +} + +/** + * \brief Configures the driver with the selected card configuration + */ +static void sd_mmc_configure_slot(void) +{ + driver_select_device( + sd_mmc_hal, sd_mmc_slot_sel, sd_mmc_card->clock, sd_mmc_card->bus_width, sd_mmc_card->high_speed); +} + +/** + * \brief Deselect the current card slot + */ +static void sd_mmc_deselect_slot(void) +{ + if (sd_mmc_slot_sel < CONF_SD_MMC_MEM_CNT) { + driver_deselect_device(sd_mmc_hal, sd_mmc_slot_sel); + } +} + +/** + * \brief Initialize the SD card in MCI mode. + * + * \note + * This function runs the initialization procedure and the identification + * process, then it sets the SD/MMC card in transfer state. + * At last, it will automaticly enable maximum bus width and transfer speed. + * + * \return true if success, otherwise false + */ +static bool sd_mmc_mci_card_init(void) +{ + uint8_t v2 = 0; +#if (CONF_SDIO_SUPPORT == 1) + uint8_t data = 0x08; +#endif + + /* In first, try to install SD/SDIO card */ + sd_mmc_card->type = CARD_TYPE_SD; + sd_mmc_card->version = CARD_VER_UNKNOWN; + sd_mmc_card->rca = 0; + + /* Card need of 74 cycles clock minimum to start */ + driver_send_clock(sd_mmc_hal); + +#if (CONF_SDIO_SUPPORT == 1) + /* CMD52 Reset SDIO */ + sdio_cmd52(SDIO_CMD52_WRITE_FLAG, SDIO_CIA, SDIO_CCCR_IOA, 0, &data); +#endif + + /* CMD0 - Reset all cards to idle state.*/ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_MCI_CMD0_GO_IDLE_STATE, 0)) { + return false; + } + if (!sd_cmd8(&v2)) { + return false; + } + /* Try to get the SDIO card's operating condition */ + if (!sdio_op_cond()) { + return false; + } + + if (sd_mmc_card->type & CARD_TYPE_SD) { + /* Try to get the SD card's operating condition */ + if (!sd_mci_op_cond(v2)) { + /* It is not a SD card */ +#if CONF_MMC_SUPPORT + sd_mmc_card->type = CARD_TYPE_MMC; + return sd_mmc_mci_install_mmc(); +#else + sd_mmc_card->type = CARD_TYPE_UNKNOWN; + return false; +#endif + } + } + + if (sd_mmc_card->type & CARD_TYPE_SD) { + /* SD MEMORY, Put the Card in Identify Mode + * Note: The CID is not used in this stack */ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_CMD2_ALL_SEND_CID, 0)) { + return false; + } + } + /* Ask the card to publish a new relative address (RCA).*/ + if (!driver_send_cmd(sd_mmc_hal, SD_CMD3_SEND_RELATIVE_ADDR, 0)) { + return false; + } + sd_mmc_card->rca = (driver_get_response(sd_mmc_hal) >> 16) & 0xFFFF; + + /* SD MEMORY, Get the Card-Specific Data */ + if (sd_mmc_card->type & CARD_TYPE_SD) { + if (!sd_mmc_cmd9_mci()) { + return false; + } + sd_decode_csd(); + } + /* Select the and put it into Transfer Mode */ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_CMD7_SELECT_CARD_CMD, (uint32_t)sd_mmc_card->rca << 16)) { + return false; + } + /* SD MEMORY, Read the SCR to get card version */ + if (sd_mmc_card->type & CARD_TYPE_SD) { + if (!sd_acmd51()) { + return false; + } + } + if (IS_SDIO()) { + if (!sdio_get_max_speed()) { + return false; + } + } + if ((4 <= driver_get_bus_width(sd_mmc_hal, sd_mmc_slot_sel))) { + /* TRY to enable 4-bit mode */ + if (IS_SDIO()) { + if (!sdio_cmd52_set_bus_width()) { + return false; + } + } + if (sd_mmc_card->type & CARD_TYPE_SD) { + if (!sd_acmd6()) { + return false; + } + } + /* Switch to selected bus mode */ + sd_mmc_configure_slot(); + } + if (driver_is_high_speed_capable(sd_mmc_hal)) { + /* TRY to enable High-Speed Mode */ + if (IS_SDIO()) { + if (!sdio_cmd52_set_high_speed()) { + return false; + } + } + if (sd_mmc_card->type & CARD_TYPE_SD) { + if (sd_mmc_card->version > CARD_VER_SD_1_0) { + if (!sd_cm6_set_high_speed()) { + return false; + } + } + } + /* Valid new configuration */ + sd_mmc_configure_slot(); + } + /* SD MEMORY, Set default block size */ + if (sd_mmc_card->type & CARD_TYPE_SD) { + if (!driver_send_cmd(sd_mmc_hal, SDMMC_CMD16_SET_BLOCKLEN, SD_MMC_BLOCK_SIZE)) { + return false; + } + } + return true; +} + +#if CONF_MMC_SUPPORT +/** + * \brief Initialize the MMC card in MCI mode. + * + * \note + * This function runs the initialization procedure and the identification + * process, then it sets the SD/MMC card in transfer state. + * At last, it will automaticly enable maximum bus width and transfer speed. + * + * \return true if success, otherwise false + */ +static bool sd_mmc_mci_install_mmc(void) +{ + uint8_t b_authorize_high_speed; + + /* CMD0 - Reset all cards to idle state. */ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_MCI_CMD0_GO_IDLE_STATE, 0)) { + return false; + } + + if (!mmc_mci_op_cond()) { + return false; + } + + /* Put the Card in Identify Mode + * Note: The CID is not used in this stack*/ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_CMD2_ALL_SEND_CID, 0)) { + return false; + } + /* Assign relative address to the card.*/ + sd_mmc_card->rca = 1; + if (!driver_send_cmd(sd_mmc_hal, MMC_CMD3_SET_RELATIVE_ADDR, (uint32_t)sd_mmc_card->rca << 16)) { + return false; + } + /* Get the Card-Specific Data */ + if (!sd_mmc_cmd9_mci()) { + return false; + } + mmc_decode_csd(); + /* Select the and put it into Transfer Mode */ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_CMD7_SELECT_CARD_CMD, (uint32_t)sd_mmc_card->rca << 16)) { + return false; + } + if (sd_mmc_card->version >= CARD_VER_MMC_4) { + /* For MMC 4.0 Higher version + * Get EXT_CSD */ + if (!mmc_cmd8(&b_authorize_high_speed)) { + return false; + } + if (4 <= driver_get_bus_width(sd_mmc_hal, sd_mmc_slot_sel)) { + /* Enable more bus width */ + if (!mmc_cmd6_set_bus_width(driver_get_bus_width(sd_mmc_hal, sd_mmc_slot_sel))) { + return false; + } + /* Reinitialize the slot with the bus width */ + sd_mmc_configure_slot(); + } + if (driver_is_high_speed_capable(sd_mmc_hal) && b_authorize_high_speed) { + /* Enable HS */ + if (!mmc_cmd6_set_high_speed()) { + return false; + } + /* Reinitialize the slot with the new speed */ + sd_mmc_configure_slot(); + } + } else { + /* Reinitialize the slot with the new speed */ + sd_mmc_configure_slot(); + } + + uint8_t retry = 10; + while (retry--) { + /* Retry is a WORKAROUND for no compliance card (Atmel Internal ref. MMC19): + * These cards seem not ready immediatly + * after the end of busy of mmc_cmd6_set_high_speed()*/ + + /* Set default block size */ + if (driver_send_cmd(sd_mmc_hal, SDMMC_CMD16_SET_BLOCKLEN, SD_MMC_BLOCK_SIZE)) { + return true; + } + } + return false; +} +#endif + +/*--------------------- PUBLIC FUNCTIONS ----------------------------*/ + +void sd_mmc_init(void *hal, sd_mmc_detect_t *card_detects, sd_mmc_detect_t *wp_detects) +{ + /* GPIO will be used to detect card and write protect. + * The related clocks and pinmux must be configurated in good + * condition. */ + + for (uint8_t slot = 0; slot < CONF_SD_MMC_MEM_CNT; slot++) { + sd_mmc_cards[slot].state = SD_MMC_CARD_STATE_NO_CARD; + } + sd_mmc_slot_sel = 0xFF; /* No slot configurated */ + sd_mmc_hal = hal; + _cd = card_detects; + _wp = wp_detects; +} + +uint8_t sd_mmc_nb_slot(void) +{ + return CONF_SD_MMC_MEM_CNT; +} + +sd_mmc_err_t sd_mmc_check(uint8_t slot) +{ + sd_mmc_err_t sd_mmc_err; + + sd_mmc_err = sd_mmc_select_slot(slot); + if (sd_mmc_err != SD_MMC_INIT_ONGOING) { + sd_mmc_deselect_slot(); + return sd_mmc_err; + } + + /* Initialization of the card requested */ + if (sd_mmc_mci_card_init()) { + sd_mmc_card->state = SD_MMC_CARD_STATE_READY; + sd_mmc_deselect_slot(); + /* To notify that the card has been just initialized + * It is necessary for USB Device MSC */ + return SD_MMC_INIT_ONGOING; + } + sd_mmc_card->state = SD_MMC_CARD_STATE_UNUSABLE; + sd_mmc_deselect_slot(); + return SD_MMC_ERR_UNUSABLE; +} + +card_type_t sd_mmc_get_type(uint8_t slot) +{ + if (SD_MMC_OK != sd_mmc_select_slot(slot)) { + return CARD_TYPE_UNKNOWN; + } + sd_mmc_deselect_slot(); + return sd_mmc_card->type; +} + +card_version_t sd_mmc_get_version(uint8_t slot) +{ + if (SD_MMC_OK != sd_mmc_select_slot(slot)) { + return CARD_VER_UNKNOWN; + } + sd_mmc_deselect_slot(); + return sd_mmc_card->version; +} + +uint32_t sd_mmc_get_capacity(uint8_t slot) +{ + if (SD_MMC_OK != sd_mmc_select_slot(slot)) { + return 0; + } + sd_mmc_deselect_slot(); + return sd_mmc_card->capacity; +} + +bool sd_mmc_is_write_protected(uint8_t slot) +{ + /* No detection, always writable */ + if (!_wp || _wp[slot].pin == -1) { + return false; + } + /* Write Protect Detect */ + if (gpio_get_pin_level(_wp[slot].pin) == _wp[slot].val) { + return true; + } + return false; +} + +sd_mmc_err_t sd_mmc_init_read_blocks(uint8_t slot, uint32_t start, uint16_t nb_block) +{ + sd_mmc_err_t sd_mmc_err; + uint32_t cmd, arg, resp; + + sd_mmc_err = sd_mmc_select_slot(slot); + if (sd_mmc_err != SD_MMC_OK) { + return sd_mmc_err; + } + + /* Wait for data ready status */ + if (!sd_mmc_cmd13()) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + + if (nb_block > 1) { + cmd = SDMMC_CMD18_READ_MULTIPLE_BLOCK; + } else { + cmd = SDMMC_CMD17_READ_SINGLE_BLOCK; + } + /* + * SDSC Card (CCS=0) uses byte unit address, + * SDHC and SDXC Cards (CCS=1) use block unit address (512 Bytes unit). + */ + if (sd_mmc_card->type & CARD_TYPE_HC) { + arg = start; + } else { + arg = (start * SD_MMC_BLOCK_SIZE); + } + + if (!driver_adtc_start(sd_mmc_hal, cmd, arg, SD_MMC_BLOCK_SIZE, nb_block, true)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + /* Check response */ + resp = driver_get_response(sd_mmc_hal); + if (resp & CARD_STATUS_ERR_RD_WR) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + + sd_mmc_nb_block_remaining = nb_block; + sd_mmc_nb_block_to_tranfer = nb_block; + return SD_MMC_OK; +} + +sd_mmc_err_t sd_mmc_start_read_blocks(void *dest, uint16_t nb_block) +{ + ASSERT(sd_mmc_nb_block_remaining >= nb_block); + + if (!driver_start_read_blocks(sd_mmc_hal, dest, nb_block)) { + sd_mmc_nb_block_remaining = 0; + return SD_MMC_ERR_COMM; + } + sd_mmc_nb_block_remaining -= nb_block; + return SD_MMC_OK; +} + +sd_mmc_err_t sd_mmc_wait_end_of_read_blocks(bool abort) +{ + if (!driver_wait_end_of_read_blocks(sd_mmc_hal)) { + return SD_MMC_ERR_COMM; + } + if (abort) { + sd_mmc_nb_block_remaining = 0; + } else if (sd_mmc_nb_block_remaining) { + return SD_MMC_OK; + } + + /* All blocks are transfered then stop read operation */ + if (sd_mmc_nb_block_to_tranfer == 1) { + /* Single block transfer, then nothing to do */ + sd_mmc_deselect_slot(); + return SD_MMC_OK; + } + /* WORKAROUND for no compliance card (Atmel Internal ref. !MMC7 !SD19): + * The errors on this command must be ignored + * and one retry can be necessary in SPI mode for no compliance card.*/ + if (!driver_adtc_stop(sd_mmc_hal, SDMMC_CMD12_STOP_TRANSMISSION, 0)) { + driver_adtc_stop(sd_mmc_hal, SDMMC_CMD12_STOP_TRANSMISSION, 0); + } + sd_mmc_deselect_slot(); + return SD_MMC_OK; +} + +sd_mmc_err_t sd_mmc_init_write_blocks(uint8_t slot, uint32_t start, uint16_t nb_block) +{ + sd_mmc_err_t sd_mmc_err; + uint32_t cmd, arg, resp; + + sd_mmc_err = sd_mmc_select_slot(slot); + if (sd_mmc_err != SD_MMC_OK) { + return sd_mmc_err; + } + if (sd_mmc_is_write_protected(slot)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_WP; + } + + if (nb_block > 1) { + cmd = SDMMC_CMD25_WRITE_MULTIPLE_BLOCK; + } else { + cmd = SDMMC_CMD24_WRITE_BLOCK; + } + /* + * SDSC Card (CCS=0) uses byte unit address, + * SDHC and SDXC Cards (CCS=1) use block unit address (512 Bytes unit). + */ + if (sd_mmc_card->type & CARD_TYPE_HC) { + arg = start; + } else { + arg = (start * SD_MMC_BLOCK_SIZE); + } + if (!driver_adtc_start(sd_mmc_hal, cmd, arg, SD_MMC_BLOCK_SIZE, nb_block, true)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + /* Check response */ + resp = driver_get_response(sd_mmc_hal); + if (resp & CARD_STATUS_ERR_RD_WR) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + + sd_mmc_nb_block_remaining = nb_block; + sd_mmc_nb_block_to_tranfer = nb_block; + return SD_MMC_OK; +} + +sd_mmc_err_t sd_mmc_start_write_blocks(const void *src, uint16_t nb_block) +{ + ASSERT(sd_mmc_nb_block_remaining >= nb_block); + if (!driver_start_write_blocks(sd_mmc_hal, src, nb_block)) { + sd_mmc_nb_block_remaining = 0; + return SD_MMC_ERR_COMM; + } + sd_mmc_nb_block_remaining -= nb_block; + return SD_MMC_OK; +} + +sd_mmc_err_t sd_mmc_wait_end_of_write_blocks(bool abort) +{ + if (!driver_wait_end_of_write_blocks(sd_mmc_hal)) { + return SD_MMC_ERR_COMM; + } + if (abort) { + sd_mmc_nb_block_remaining = 0; + } else if (sd_mmc_nb_block_remaining) { + return SD_MMC_OK; + } + + /* All blocks are transfered then stop write operation */ + if (sd_mmc_nb_block_to_tranfer == 1) { + /* Single block transfer, then nothing to do */ + sd_mmc_deselect_slot(); + return SD_MMC_OK; + } + + /* Note: SPI multiblock writes terminate using a special + * token, not a STOP_TRANSMISSION request.*/ + if (!driver_adtc_stop(sd_mmc_hal, SDMMC_CMD12_STOP_TRANSMISSION, 0)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + + sd_mmc_deselect_slot(); + return SD_MMC_OK; +} + +#if (CONF_SDIO_SUPPORT == 1) +sd_mmc_err_t sdio_read_direct(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t *dest) +{ + sd_mmc_err_t sd_mmc_err; + + if (dest == NULL) { + return SD_MMC_ERR_PARAM; + } + + sd_mmc_err = sd_mmc_select_slot(slot); + if (sd_mmc_err != SD_MMC_OK) { + return sd_mmc_err; + } + + if (!sdio_cmd52(SDIO_CMD52_READ_FLAG, func_num, addr, 0, dest)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + sd_mmc_deselect_slot(); + return SD_MMC_OK; +} + +sd_mmc_err_t sdio_write_direct(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t data) +{ + sd_mmc_err_t sd_mmc_err; + + sd_mmc_err = sd_mmc_select_slot(slot); + if (sd_mmc_err != SD_MMC_OK) { + return sd_mmc_err; + } + + if (!sdio_cmd52(SDIO_CMD52_WRITE_FLAG, func_num, addr, 0, &data)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + + sd_mmc_deselect_slot(); + return SD_MMC_OK; +} + +sd_mmc_err_t sdio_read_extended(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t inc_addr, uint8_t *dest, + uint16_t size) +{ + sd_mmc_err_t sd_mmc_err; + + if ((size == 0) || (size > 512)) { + return SD_MMC_ERR_PARAM; + } + + sd_mmc_err = sd_mmc_select_slot(slot); + if (sd_mmc_err != SD_MMC_OK) { + return sd_mmc_err; + } + + if (!sdio_cmd53(SDIO_CMD53_READ_FLAG, func_num, addr, inc_addr, size, true)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + if (!driver_start_read_blocks(sd_mmc_hal, dest, 1)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + if (!driver_wait_end_of_read_blocks(sd_mmc_hal)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + + sd_mmc_deselect_slot(); + return SD_MMC_OK; +} + +sd_mmc_err_t sdio_write_extended(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t inc_addr, uint8_t *src, + uint16_t size) +{ + sd_mmc_err_t sd_mmc_err; + + if ((size == 0) || (size > 512)) { + return SD_MMC_ERR_PARAM; + } + + sd_mmc_err = sd_mmc_select_slot(slot); + if (sd_mmc_err != SD_MMC_OK) { + return sd_mmc_err; + } + + if (!sdio_cmd53(SDIO_CMD53_WRITE_FLAG, func_num, addr, inc_addr, size, true)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + if (!driver_start_write_blocks(sd_mmc_hal, src, 1)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + if (!driver_wait_end_of_write_blocks(sd_mmc_hal)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + + sd_mmc_deselect_slot(); + return SD_MMC_OK; +} +#endif + +/** @} */ diff --git a/ports/atmel-samd/sd_mmc/sd_mmc.h b/ports/atmel-samd/sd_mmc/sd_mmc.h new file mode 100644 index 0000000000..1437e5efd5 --- /dev/null +++ b/ports/atmel-samd/sd_mmc/sd_mmc.h @@ -0,0 +1,310 @@ +/** + * \file + * + * \brief Common SD/MMC stack header file + * + * Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries. + * + * \asf_license_start + * + * \page License + * + * Subject to your compliance with these terms, you may use Microchip + * software and any derivatives exclusively with Microchip products. + * It is your responsibility to comply with third party license terms applicable + * to your use of third party software (including open source software) that + * may accompany Microchip software. + * + * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, + * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, + * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE + * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL + * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE + * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE + * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT + * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY + * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, + * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Microchip Support + */ + +#ifndef SD_MMC_H_INCLUDED +#define SD_MMC_H_INCLUDED + +#include "compiler.h" +#include "conf_sd_mmc.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \ingroup common_memory + * \defgroup sd_mmc_stack_group SD/MMC/SDIO common stack + * + * SD/MMC/SDIO basic APIs used by SD/MMC/SDIO memory + * APIs (\ref sd_mmc_stack_mem_group). + * Also, it can be used by application which use the SDIO card + * or specific application which does not need of File System. + * + * For usual application which use the SD/MMC card in + * memory mode with a file system, please refer to + * \ref sd_mmc_stack_mem_group. + * @{ + */ + +typedef uint8_t sd_mmc_err_t; /**< Type of return error code */ + +/** \name Return error codes */ +/** @{ */ +#define SD_MMC_OK 0 /**< No error */ +#define SD_MMC_INIT_ONGOING 1 /**< Card not initialized */ +#define SD_MMC_ERR_NO_CARD 2 /**< No SD/MMC card inserted */ +#define SD_MMC_ERR_UNUSABLE 3 /**< Unusable card */ +#define SD_MMC_ERR_SLOT 4 /**< Slot unknow */ +#define SD_MMC_ERR_COMM 5 /**< General communication error */ +#define SD_MMC_ERR_PARAM 6 /**< Illeage input parameter */ +#define SD_MMC_ERR_WP 7 /**< Card write protected */ +/** @} */ + +typedef uint8_t card_type_t; /**< Type of card type */ + +/** \name Card Types */ +/** @{ */ +#define CARD_TYPE_UNKNOWN (0) /**< Unknown type card */ +#define CARD_TYPE_SD (1 << 0) /**< SD card */ +#define CARD_TYPE_MMC (1 << 1) /**< MMC card */ +#define CARD_TYPE_SDIO (1 << 2) /**< SDIO card */ +#define CARD_TYPE_HC (1 << 3) /**< High capacity card */ +/** SD combo card (io + memory) */ +#define CARD_TYPE_SD_COMBO (CARD_TYPE_SD | CARD_TYPE_SDIO) +/** @} */ + +typedef uint8_t card_version_t; /**< Type of card version */ + +/** \name Card Versions */ +/** @{ */ +#define CARD_VER_UNKNOWN (0) /**< Unknown card version */ +#define CARD_VER_SD_1_0 (0x10) /**< SD version 1.0 and 1.01 */ +#define CARD_VER_SD_1_10 (0x1A) /**< SD version 1.10 */ +#define CARD_VER_SD_2_0 (0X20) /**< SD version 2.00 */ +#define CARD_VER_SD_3_0 (0X30) /**< SD version 3.0X */ +#define CARD_VER_MMC_1_2 (0x12) /**< MMC version 1.2 */ +#define CARD_VER_MMC_1_4 (0x14) /**< MMC version 1.4 */ +#define CARD_VER_MMC_2_2 (0x22) /**< MMC version 2.2 */ +#define CARD_VER_MMC_3 (0x30) /**< MMC version 3 */ +#define CARD_VER_MMC_4 (0x40) /**< MMC version 4 */ +/** @} */ + +/** Card detect setting */ +typedef struct sd_mmc_detect { + int16_t pin; /**< Detection pin, -1 if no such pin */ + uint16_t val; /**< Detection value */ +} sd_mmc_detect_t; + +/** This SD MMC stack uses the maximum block size autorized (512 bytes) */ +#define SD_MMC_BLOCK_SIZE 512 + +/** + * \brief Initialize the SD/MMC stack and low level driver required + * \param[in] hal Pointer to HAL instance + * \param[in] card_detects Pointer to list of card detect settings, + * list size should be \ref CONF_SD_MMC_MEM_CNT + * \param[in] wp_detects Pointer to list of write protect detect settings + * list size should be \ref CONF_SD_MMC_MEM_CNT + */ +void sd_mmc_init(void *hal, sd_mmc_detect_t *card_detects, sd_mmc_detect_t *wp_detects); + +/** \brief Return the number of slot available + * + * \return Number of card slot available + */ +uint8_t sd_mmc_nb_slot(void); + +/** \brief Performs a card checks + * + * \param[in] slot Card slot to use + * + * \retval SD_MMC_OK Card ready + * \retval SD_MMC_INIT_ONGOING Initialization on going + * \retval SD_MMC_ERR_NO_CARD Card not present in slot + * \retval Other value for error cases, see \ref sd_mmc_err_t + */ +sd_mmc_err_t sd_mmc_check(uint8_t slot); + +/** \brief Get the card type + * + * \param[in] slot Card slot + * + * \return Card type (\ref card_type_t) + */ +card_type_t sd_mmc_get_type(uint8_t slot); + +/** \brief Get the card version + * + * \param[in] slot Card slot + * + * \return Card version (\ref card_version_t) + */ +card_version_t sd_mmc_get_version(uint8_t slot); + +/** \brief Get the memory capacity + * + * \param[in] slot Card slot + * + * \return Capacity (unit KB) + */ +uint32_t sd_mmc_get_capacity(uint8_t slot); + +/** \brief Get the card write protection status + * + * \param[in] slot Card slot + * + * \return true, if write portected + */ +bool sd_mmc_is_write_protected(uint8_t slot); + +/** + * \brief Initialize the read blocks of data from the card. + * + * \param[in] slot Card slot to use + * \param[in] start Start block number to to read. + * \param[in] nb_block Total number of blocks to be read. + * + * \return return SD_MMC_OK if success, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sd_mmc_init_read_blocks(uint8_t slot, uint32_t start, uint16_t nb_block); + +/** + * \brief Start the read blocks of data from the card. + * + * \param[out] dest Pointer to read buffer. + * \param[in] nb_block Number of blocks to be read. + * + * \return return SD_MMC_OK if started, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sd_mmc_start_read_blocks(void *dest, uint16_t nb_block); + +/** + * \brief Wait the end of read blocks of data from the card. + * + * \param[in] abort Abort reading process initialized by + * \ref sd_mmc_init_read_blocks() after the reading issued by + * \ref sd_mmc_start_read_blocks() is done + * + * \return return SD_MMC_OK if success, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sd_mmc_wait_end_of_read_blocks(bool abort); + +/** + * \brief Initialize the write blocks of data + * + * \param[in] slot Card slot to use + * \param[in] start Start block number to be written. + * \param[in] nb_block Total number of blocks to be written. + * + * \return return SD_MMC_OK if success, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sd_mmc_init_write_blocks(uint8_t slot, uint32_t start, uint16_t nb_block); + +/** + * \brief Start the write blocks of data + * + * \param[in] src Pointer to write buffer. + * \param[in] nb_block Number of blocks to be written. + * + * \return return SD_MMC_OK if started, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sd_mmc_start_write_blocks(const void *src, uint16_t nb_block); + +/** + * \brief Wait the end of write blocks of data + * + * \param[in] abort Abort writing process initialized by + * \ref sd_mmc_init_write_blocks() after the writing issued by + * \ref sd_mmc_start_write_blocks() is done + * + * \return return SD_MMC_OK if success, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sd_mmc_wait_end_of_write_blocks(bool abort); + +#if (CONF_SDIO_SUPPORT == 1) +/** + * \brief Read one byte from SDIO using RW_DIRECT command. + * + * \param[in] slot Card slot to use + * \param[in] func_num Function number. + * \param[in] addr Register address to read from. + * \param[out] dest Pointer to read buffer. + * + * \return return SD_MMC_OK if success, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sdio_read_direct(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t *dest); +/** + * \brief Write one byte to SDIO using RW_DIRECT command. + * + * \param[in] slot Card slot to use + * \param[in] func_num Function number. + * \param[in] addr Register address to read from. + * \param[in] data Data to be written. + * + * \return return SD_MMC_OK if success, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sdio_write_direct(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t data); + +/** + * \brief Read bytes from SDIO using RW_EXTENDED command. + * + * \param[in] slot Card slot to use + * \param[in] func_num Function number. + * \param[in] addr First register address to read from. + * \param[in] inc_addr 0 - The data address is fixed. + * 1 - The data address increase automatically. + * \param[out] dest Pointer to read buffer. + * \param[in] size Number of bytes to read (1 ~ 512). + * + * \return return SD_MMC_OK if success, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sdio_read_extended(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t inc_addr, uint8_t *dest, + uint16_t size); + +/** + * \brief Write bytes to SDIO using RW_EXTENDED command. + * + * \param[in] slot Card slot to use + * \param[in] func_num Function number. + * \param[in] addr First register address to write to. + * \param[in] inc_addr 0 - The data address is fixed. + * 1 - The data address increase automatically. + * \param[in] src Pointer to write buffer. + * \param[in] size Number of bytes to read (1 ~ 512). + * + * \return return SD_MMC_OK if success, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sdio_write_extended(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t inc_addr, uint8_t *src, + uint16_t size); +#endif /* SDIO_SUPPORT_ENABLE */ + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* SD_MMC_H_INCLUDED */ diff --git a/ports/atmel-samd/sd_mmc/sd_mmc_protocol.h b/ports/atmel-samd/sd_mmc/sd_mmc_protocol.h new file mode 100644 index 0000000000..0516e4fd10 --- /dev/null +++ b/ports/atmel-samd/sd_mmc/sd_mmc_protocol.h @@ -0,0 +1,1001 @@ +/** + * \file + * + * \brief SD/MMC protocol definitions. + * + * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. + * + * \asf_license_start + * + * \page License + * + * Subject to your compliance with these terms, you may use Microchip + * software and any derivatives exclusively with Microchip products. + * It is your responsibility to comply with third party license terms applicable + * to your use of third party software (including open source software) that + * may accompany Microchip software. + * + * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, + * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, + * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE + * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL + * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE + * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE + * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT + * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY + * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, + * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Microchip Support + */ + +#ifndef SD_MMC_PROTOCOL_H_INCLUDED +#define SD_MMC_PROTOCOL_H_INCLUDED + +#include "compiler.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \addtogroup sd_mmc_protocol SD/MMC Protocol Definition + * \ingroup sd_mmc_stack_group + * @{ + */ + +// SD/MMC/SDIO default clock frequency for initialization (400KHz) +#define SDMMC_CLOCK_INIT 400000 + +/** + * \name Macros for command definition + * + * Commands types: + * - broadcast commands (bc), no response + * - broadcast commands with response (bcr) (Note: No open drain on SD card) + * - addressed (point-to-point) commands (ac), no data transfer on DAT lines + * - addressed (point-to-point) data transfer commands (adtc), data transfer + * on DAT lines + * + * Specific MMC norms: + * CMD1, CMD2 & CMD3 are processed in the open-drain mode. + * The CMD line is driven with push-pull drivers. + * + * Specific SD norms: + * There is no open drain mode in SD memory card. + * + *************************************** + * Responses types: + * + * R1, R3, R4 & R5 use a 48 bits response protected by a 7bit CRC checksum + * - R1 receiv data not specified + * - R3 receiv OCR + * - R4, R5 RCA management (MMC only) + * - R6, R7 RCA management (SD only) + * + * R1b assert the BUSY signal and respond with R1. + * If the busy signal is asserted, it is done two clock cycles (Nsr time) + * after the end bit of the command. The DAT0 line is driven low. + * DAT1-DAT7 lines are driven by the card though their values are not relevant. + * + * R2 use a 136 bits response protected by a 7bit CRC checksum + * The content is CID or CSD + * + * Specific MMC norms: + * - R4 (Fast I/O) return RCA + * - R5 (interrupt request) return RCA null + * + * Specific SD norms: + * - R6 (Published RCA) return RCA + * - R7 (Card interface condition) return RCA null + * + * @{ + */ + +//! Value to define a SD/MMC/SDIO command +typedef uint32_t sdmmc_cmd_def_t; + +//! \name Flags used to define a SD/MMC/SDIO command +//! @{ +#define SDMMC_CMD_GET_INDEX(cmd) (cmd & 0x3F) +//! Have response (MCI only) +#define SDMMC_RESP_PRESENT (1lu << 8) +//! 8 bit response (SPI only) +#define SDMMC_RESP_8 (1lu << 9) +//! 32 bit response (SPI only) +#define SDMMC_RESP_32 (1lu << 10) +//! 136 bit response (MCI only) +#define SDMMC_RESP_136 (1lu << 11) +//! Expect valid crc (MCI only) +#define SDMMC_RESP_CRC (1lu << 12) +//! Card may send busy +#define SDMMC_RESP_BUSY (1lu << 13) +// Open drain for a braodcast command (bc) +// or to enter in inactive state (MCI only) +#define SDMMC_CMD_OPENDRAIN (1lu << 14) +//! To signal a data write operation +#define SDMMC_CMD_WRITE (1lu << 15) +//! To signal a SDIO tranfer in multi byte mode +#define SDMMC_CMD_SDIO_BYTE (1lu << 16) +//! To signal a SDIO tranfer in block mode +#define SDMMC_CMD_SDIO_BLOCK (1lu << 17) +//! To signal a data transfer in stream mode +#define SDMMC_CMD_STREAM (1lu << 18) +//! To signal a data transfer in single block mode +#define SDMMC_CMD_SINGLE_BLOCK (1lu << 19) +//! To signal a data transfer in multi block mode +#define SDMMC_CMD_MULTI_BLOCK (1lu << 20) +//! @} + +//! \name Set of flags to define a reponse type +//! @{ +#define SDMMC_CMD_NO_RESP (0) +#define SDMMC_CMD_R1 (SDMMC_RESP_PRESENT | SDMMC_RESP_CRC) +#define SDMMC_CMD_R1B (SDMMC_RESP_PRESENT | SDMMC_RESP_CRC | SDMMC_RESP_BUSY) +#define SDMMC_CMD_R2 (SDMMC_RESP_PRESENT | SDMMC_RESP_8 | SDMMC_RESP_136 | SDMMC_RESP_CRC) +#define SDMMC_CMD_R3 (SDMMC_RESP_PRESENT | SDMMC_RESP_32) +#define SDMMC_CMD_R4 (SDMMC_RESP_PRESENT | SDMMC_RESP_32) +#define SDMMC_CMD_R5 (SDMMC_RESP_PRESENT | SDMMC_RESP_8 | SDMMC_RESP_CRC) +#define SDMMC_CMD_R6 (SDMMC_RESP_PRESENT | SDMMC_RESP_CRC) +#define SDMMC_CMD_R7 (SDMMC_RESP_PRESENT | SDMMC_RESP_32 | SDMMC_RESP_CRC) +//! @} + +//! \name SD/MMC/SDIO command definitions +//! SDMMC_CMDx are include in SD and MMC norms +//! MMC_CMDx are include in MMC norms only +//! SD_CMDx are include in SD norms only +//! SDIO_CMDx are include in SDIO norms only +//! @{ + +/* + * --- Basic commands and read-stream command (class 0 and class 1) --- + */ + +/** Cmd0(bc): Reset all cards to idle state */ +#define SDMMC_SPI_CMD0_GO_IDLE_STATE (0 | SDMMC_CMD_R1) +#define SDMMC_MCI_CMD0_GO_IDLE_STATE (0 | SDMMC_CMD_NO_RESP | SDMMC_CMD_OPENDRAIN) +/** MMC Cmd1(bcr, R3): Ask the card to send its Operating Conditions */ +#define MMC_SPI_CMD1_SEND_OP_COND (1 | SDMMC_CMD_R1) +#define MMC_MCI_CMD1_SEND_OP_COND (1 | SDMMC_CMD_R3 | SDMMC_CMD_OPENDRAIN) +/** Cmd2(bcr, R2): Ask the card to send its CID number (stuff but arg 0 used) */ +#define SDMMC_CMD2_ALL_SEND_CID (2 | SDMMC_CMD_R2 | SDMMC_CMD_OPENDRAIN) +/** SD Cmd3(bcr, R6): Ask the card to publish a new relative address (RCA) */ +#define SD_CMD3_SEND_RELATIVE_ADDR (3 | SDMMC_CMD_R6 | SDMMC_CMD_OPENDRAIN) +/** MMC Cmd3(ac, R1): Assigns relative address to the card */ +#define MMC_CMD3_SET_RELATIVE_ADDR (3 | SDMMC_CMD_R1) +/** Cmd4(bc): Program the DSR of all cards (MCI only) */ +#define SDMMC_CMD4_SET_DSR (4 | SDMMC_CMD_NO_RESP) +/** MMC Cmd5(ac, R1b): Toggle the card between Sleep state and Standby state. */ +#define MMC_CMD5_SLEEP_AWAKE (5 | SDMMC_CMD_R1B) +/** Cmd7(ac, R1/R1b): Select/Deselect card + * For SD: R1b only from the selected card. + * For MMC: R1 while selecting from Stand-By State to Transfer State; + * R1b while selecting from Disconnected State to Programming State. + */ +#define SDMMC_CMD7_SELECT_CARD_CMD (7 | SDMMC_CMD_R1B) +#define SDMMC_CMD7_DESELECT_CARD_CMD (7 | SDMMC_CMD_R1) +/** MMC Cmd8(adtc, R1): Send EXT_CSD register as a block of data */ +#define MMC_CMD8_SEND_EXT_CSD (8 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK) +/** SD Cmd8(bcr, R7) : Send SD Memory Card interface condition */ +#define SD_CMD8_SEND_IF_COND (8 | SDMMC_CMD_R7 | SDMMC_CMD_OPENDRAIN) +/** Cmd9 SPI (R1): Addressed card sends its card-specific data (CSD) */ +#define SDMMC_SPI_CMD9_SEND_CSD (9 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK) +/** Cmd9 MCI (ac, R2): Addressed card sends its card-specific data (CSD) */ +#define SDMMC_MCI_CMD9_SEND_CSD (9 | SDMMC_CMD_R2) +/** Cmd10(ac, R2): Addressed card sends its card identification (CID) */ +#define SDMMC_CMD10_SEND_CID (10 | SDMMC_CMD_R2) +/** + * MMC Cmd11(adtc, R1): Read data stream from the card, starting at the given + * address, until a STOP_TRANSMISSION follows. + */ +#define MMC_CMD11_READ_DAT_UNTIL_STOP (11 | SDMMC_CMD_R1) +/* SD Cmd11 MCI (ac, R1): Voltage switching */ +#define SD_CMD11_READ_DAT_UNTIL_STOP (11 | SDMMC_CMD_R1) +/** Cmd12(ac, R1b): Force the card to stop transmission */ +#define SDMMC_CMD12_STOP_TRANSMISSION (12 | SDMMC_CMD_R1B) +/** Cmd13(R2): Addressed card sends its status register. */ +#define SDMMC_SPI_CMD13_SEND_STATUS (13 | SDMMC_CMD_R2) +/** Cmd13(ac, R1): Addressed card sends its status register. */ +#define SDMMC_MCI_CMD13_SEND_STATUS (13 | SDMMC_CMD_R1) +/** MMC Cmd14(adtc, R1): Read the reversed bus testing data pattern from a card. */ +#define MMC_CMD14_BUSTEST_R (14 | SDMMC_CMD_R1) +/** Cmd15(ac): Send an addressed card into the Inactive State. */ +// Note: It is a ac cmd, but it must be send like bc cmd to open drain +#define SDMMC_CMD15_GO_INACTIVE_STATE (15 | SDMMC_CMD_NO_RESP | SDMMC_CMD_OPENDRAIN) +/** MMC Cmd19(adtc, R1): Send the bus test data pattern */ +#define MMC_CMD19_BUSTEST_W (19 | SDMMC_CMD_R1) +/** Cmd58(R3): Reads the OCR register of a card */ +#define SDMMC_SPI_CMD58_READ_OCR (58 | SDMMC_CMD_R3) +/** Cmd59(R1): Turns the CRC option on or off */ +#define SDMMC_SPI_CMD59_CRC_ON_OFF (59 | SDMMC_CMD_R1) + +/* + * --- Block-oriented read commands (class 2) --- + */ +/** Cmd16(ac, R1): Set the block length (in bytes) */ +#define SDMMC_CMD16_SET_BLOCKLEN (16 | SDMMC_CMD_R1) +/** Cmd17(adtc, R1): Read single block */ +#define SDMMC_CMD17_READ_SINGLE_BLOCK (17 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK) +/** Cmd18(adtc, R1): Read multiple block */ +#define SDMMC_CMD18_READ_MULTIPLE_BLOCK (18 | SDMMC_CMD_R1 | SDMMC_CMD_MULTI_BLOCK) + +/* + * --- Sequential write commands (class 3) --- + */ + +/** + * MMC Cmd20(adtc, R1): Write a data stream from the host, starting at the + * given address, until a STOP_TRANSMISSION follows. + */ +#define MMC_CMD20_WRITE_DAT_UNTIL_STOP (20 | SDMMC_CMD_R1) + +/* + * --- Block-oriented write commands (class 4) --- + */ +/** MMC Cmd23(ac, R1): Set block count */ +#define MMC_CMD23_SET_BLOCK_COUNT (23 | SDMMC_CMD_R1) +/** Cmd24(adtc, R1): Write block */ +#define SDMMC_CMD24_WRITE_BLOCK (24 | SDMMC_CMD_R1 | SDMMC_CMD_WRITE | SDMMC_CMD_SINGLE_BLOCK) +/** Cmd25(adtc, R1): Write multiple block */ +#define SDMMC_CMD25_WRITE_MULTIPLE_BLOCK (25 | SDMMC_CMD_R1 | SDMMC_CMD_WRITE | SDMMC_CMD_MULTI_BLOCK) +/** MMC Cmd26(adtc, R1): Programming of the card identification register. */ +#define MMC_CMD26_PROGRAM_CID (26 | SDMMC_CMD_R1) +/** Cmd27(adtc, R1): Programming of the programmable bits of the CSD. */ +#define SDMMC_CMD27_PROGRAM_CSD (27 | SDMMC_CMD_R1) + +/* + * --- Erase commands (class 5) --- + */ +/** SD Cmd32(ac, R1): */ +#define SD_CMD32_ERASE_WR_BLK_START (32 | SDMMC_CMD_R1) +/** SD Cmd33(ac, R1): */ +#define SD_CMD33_ERASE_WR_BLK_END (33 | SDMMC_CMD_R1) +/** MMC Cmd35(ac, R1): */ +#define MMC_CMD35_ERASE_GROUP_START (35 | SDMMC_CMD_R1) +/** MMC Cmd36(ac, R1): */ +#define MMC_CMD36_ERASE_GROUP_END (36 | SDMMC_CMD_R1) +/** Cmd38(ac, R1B): */ +#define SDMMC_CMD38_ERASE (38 | SDMMC_CMD_R1B) + +/* + * --- Block Oriented Write Protection Commands (class 6) --- + */ +/** Cmd28(ac, R1b): Set write protection */ +#define SDMMC_CMD28_SET_WRITE_PROT (28 | SDMMC_CMD_R1B) +/** Cmd29(ac, R1b): Clr write protection */ +#define SDMMC_CMD29_CLR_WRITE_PROT (29 | SDMMC_CMD_R1B) +/** Cmd30(adtc, R1b): Send write protection */ +#define SDMMC_CMD30_SEND_WRITE_PROT (30 | SDMMC_CMD_R1) + +/* + * --- Lock Card (class 7) --- + */ +/** Cmd42(adtc, R1): Used to set/reset the password or lock/unlock the card. */ +#define SDMMC_CMD42_LOCK_UNLOCK (42 | SDMMC_CMD_R1) + +/* + * --- Application-specific commands (class 8) --- + */ +/** + * Cmd55(ac, R1): Indicate to the card that the next command is an application + * specific command rather than a standard command. + */ +#define SDMMC_CMD55_APP_CMD (55 | SDMMC_CMD_R1) +/** + * Cmd 56(adtc, R1): Used either to transfer a data block to the card or to get + * a data block from the card for general purpose/application specific commands. + */ +#define SDMMC_CMD56_GEN_CMD (56 | SDMMC_CMD_R1) + +/** + * MMC Cmd6(ac, R1b) : Switche the mode of operation of the selected card + * or modifies the EXT_CSD registers. + */ +#define MMC_CMD6_SWITCH (6 | SDMMC_CMD_R1B) +/** + * SD Cmd6(adtc, R1) : Check switchable function (mode 0) + * and switch card function (mode 1). + */ +#define SD_CMD6_SWITCH_FUNC (6 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK) +/** ACMD6(ac, R1): Define the data bus width */ +#define SD_ACMD6_SET_BUS_WIDTH (6 | SDMMC_CMD_R1) +/** ACMD13(adtc, R1): Send the SD Status. */ +#define SD_ACMD13_SD_STATUS (13 | SDMMC_CMD_R1) +/** + * ACMD22(adtc, R1): Send the number of the written (with-out errors) write + * blocks. + */ +#define SD_ACMD22_SEND_NUM_WR_BLOCKS (22 | SDMMC_CMD_R1) +/** + * ACMD23(ac, R1): Set the number of write blocks to be pre-erased before + * writing + */ +#define SD_ACMD23_SET_WR_BLK_ERASE_COUNT (23 | SDMMC_CMD_R1) +/** + * ACMD41(bcr, R3): Send host capacity support information (HCS) and asks the + * accessed card to send its operating condition register (OCR) content + * in the response + */ +#define SD_MCI_ACMD41_SD_SEND_OP_COND (41 | SDMMC_CMD_R3 | SDMMC_CMD_OPENDRAIN) +/** + * ACMD41(R1): Send host capacity support information (HCS) and activates the + * card's initilization process + */ +#define SD_SPI_ACMD41_SD_SEND_OP_COND (41 | SDMMC_CMD_R1) +/** + * ACMD42(ac, R1): Connect[1]/Disconnect[0] the 50 KOhm pull-up resistor on + * CD/DAT3 (pin 1) of the card. + */ +#define SD_ACMD42_SET_CLR_CARD_DETECT (42 | SDMMC_CMD_R1) +/** ACMD51(adtc, R1): Read the SD Configuration Register (SCR). */ +#define SD_ACMD51_SEND_SCR (51 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK) + +/* + * --- I/O mode commands (class 9) --- + */ +/** MMC Cmd39(ac, R4): Used to write and read 8 bit (register) data fields. */ +#define MMC_CMD39_FAST_IO (39 | SDMMC_CMD_R4) +/** MMC Cmd40(bcr, R5): Set the system into interrupt mode */ +#define MMC_CMD40_GO_IRQ_STATE (40 | SDMMC_CMD_R5 | SDMMC_CMD_OPENDRAIN) +/** SDIO Cmd5(R4): Send operation condition */ +#define SDIO_CMD5_SEND_OP_COND (5 | SDMMC_CMD_R4 | SDMMC_CMD_OPENDRAIN) +/** SDIO CMD52(R5): Direct IO read/write */ +#define SDIO_CMD52_IO_RW_DIRECT (52 | SDMMC_CMD_R5) +/** SDIO CMD53(R5): Extended IO read/write */ +#define SDIO_CMD53_IO_R_BYTE_EXTENDED (53 | SDMMC_CMD_R5 | SDMMC_CMD_SDIO_BYTE) +#define SDIO_CMD53_IO_W_BYTE_EXTENDED (53 | SDMMC_CMD_R5 | SDMMC_CMD_SDIO_BYTE | SDMMC_CMD_WRITE) +#define SDIO_CMD53_IO_R_BLOCK_EXTENDED (53 | SDMMC_CMD_R5 | SDMMC_CMD_SDIO_BLOCK) +#define SDIO_CMD53_IO_W_BLOCK_EXTENDED (53 | SDMMC_CMD_R5 | SDMMC_CMD_SDIO_BLOCK | SDMMC_CMD_WRITE) +//! @} +//! @} + +//! \name Macros for command argument definition +//! @{ + +//! \name MMC CMD6 argument structure +//! @{ +//! [31:26] Set to 0 +//! [25:24] Access +#define MMC_CMD6_ACCESS_COMMAND_SET (0lu << 24) +#define MMC_CMD6_ACCESS_SET_BITS (1lu << 24) +#define MMC_CMD6_ACCESS_CLEAR_BITS (2lu << 24) +#define MMC_CMD6_ACCESS_WRITE_BYTE (3lu << 24) +//! [23:16] Index for Mode Segment +#define MMC_CMD6_INDEX_CMD_SET (EXT_CSD_CMD_SET_INDEX << 16) +#define MMC_CMD6_INDEX_CMD_SET_REV (EXT_CSD_CMD_SET_REV_INDEX << 16) +#define MMC_CMD6_INDEX_POWER_CLASS (EXT_CSD_POWER_CLASS_INDEX << 16) +#define MMC_CMD6_INDEX_HS_TIMING (EXT_CSD_HS_TIMING_INDEX << 16) +#define MMC_CMD6_INDEX_BUS_WIDTH (EXT_CSD_BUS_WIDTH_INDEX << 16) +#define MMC_CMD6_INDEX_ERASED_MEM_CONT (EXT_CSD_ERASED_MEM_CONT_INDEX << 16) +#define MMC_CMD6_INDEX_BOOT_CONFIG (EXT_CSD_BOOT_CONFIG_INDEX << 16) +#define MMC_CMD6_INDEX_BOOT_BUS_WIDTH (EXT_CSD_BOOT_BUS_WIDTH_INDEX << 16) +#define MMC_CMD6_INDEX_ERASE_GROUP_DEF (EXT_CSD_ERASE_GROUP_DEF_INDEX << 16) +//! [15:8] Value +#define MMC_CMD6_VALUE_BUS_WIDTH_1BIT (0x0lu << 8) +#define MMC_CMD6_VALUE_BUS_WIDTH_4BIT (0x1lu << 8) +#define MMC_CMD6_VALUE_BUS_WIDTH_8BIT (0x2lu << 8) +#define MMC_CMD6_VALUE_HS_TIMING_ENABLE (0x1lu << 8) +#define MMC_CMD6_VALUE_HS_TIMING_DISABLE (0x0lu << 8) +//! [7:3] Set to 0 +//! [2:0] Cmd Set +//! @} + +//! \name SD CMD6 argument structure +//! @{ +//! CMD6 arg[ 3: 0] function group 1, access mode +#define SD_CMD6_GRP1_HIGH_SPEED (0x1lu << 0) +#define SD_CMD6_GRP1_DEFAULT (0x0lu << 0) +//! CMD6 arg[ 7: 4] function group 2, command system +#define SD_CMD6_GRP2_NO_INFLUENCE (0xFlu << 4) +#define SD_CMD6_GRP2_DEFAULT (0x0lu << 4) +//! CMD6 arg[11: 8] function group 3, 0xF or 0x0 +#define SD_CMD6_GRP3_NO_INFLUENCE (0xFlu << 8) +#define SD_CMD6_GRP3_DEFAULT (0x0lu << 8) +//! CMD6 arg[15:12] function group 4, 0xF or 0x0 +#define SD_CMD6_GRP4_NO_INFLUENCE (0xFlu << 12) +#define SD_CMD6_GRP4_DEFAULT (0x0lu << 12) +//! CMD6 arg[19:16] function group 5, 0xF or 0x0 +#define SD_CMD6_GRP5_NO_INFLUENCE (0xFlu << 16) +#define SD_CMD6_GRP5_DEFAULT (0x0lu << 16) +//! CMD6 arg[23:20] function group 6, 0xF or 0x0 +#define SD_CMD6_GRP6_NO_INFLUENCE (0xFlu << 20) +#define SD_CMD6_GRP6_DEFAULT (0x0lu << 20) +//! CMD6 arg[30:24] reserved 0 +//! CMD6 arg[31 ] Mode, 0: Check, 1: Switch +#define SD_CMD6_MODE_CHECK (0lu << 31) +#define SD_CMD6_MODE_SWITCH (1lu << 31) +//! @} + +//! \name SD CMD8 argument structure +//! @{ +#define SD_CMD8_PATTERN 0xAA +#define SD_CMD8_MASK_PATTERN 0xFF +#define SD_CMD8_HIGH_VOLTAGE 0x100 +#define SD_CMD8_MASK_VOLTAGE 0xF00 +//! @} + +//! \name SD ACMD41 arguments +//! @{ +#define SD_ACMD41_HCS (1lu << 30) //!< (SD) Host Capacity Support + //! @} +//! @} + +//! \name SDIO definitions +//! @{ + +//! \name SDIO state (in R5) +//! @{ +#define SDIO_R5_COM_CRC_ERROR (1lu << 15) /**< CRC check error */ +#define SDIO_R5_ILLEGAL_COMMAND (1lu << 14) /**< Illegal command */ +#define SDIO_R5_STATE (3lu << 12) /**< SDIO R5 state mask */ +#define SDIO_R5_STATE_DIS (0lu << 12) /**< Disabled */ +#define SDIO_R5_STATE_CMD (1lu << 12) /**< DAT lines free */ +#define SDIO_R5_STATE_TRN (2lu << 12) /**< Transfer */ +#define SDIO_R5_STATE_RFU (3lu << 12) /**< Reserved */ +#define SDIO_R5_ERROR (1lu << 11) /**< General error */ +#define SDIO_R5_FUNC_NUM (1lu << 9) /**< Invalid function number */ +#define SDIO_R5_OUT_OF_RANGE (1lu << 8) /**< Argument out of range */ +#define SDIO_R5_STATUS_ERR (SDIO_R5_ERROR | SDIO_R5_FUNC_NUM | SDIO_R5_OUT_OF_RANGE) //!< Errro status bits mask + //! @} + +//! \name SDIO state (in R6) +//! @{ +/** The CRC check of the previous command failed. */ +#define SDIO_R6_COM_CRC_ERROR (1lu << 15) +/** Command not legal for the card state. */ +#define SDIO_R6_ILLEGAL_COMMAND (1lu << 14) +/** A general or an unknown error occurred during the operation. */ +#define SDIO_R6_ERROR (1lu << 13) +/** Status bits mask for SDIO R6 */ +#define SDIO_STATUS_R6 (SDIO_R6_COM_CRC_ERROR | SDIO_R6_ILLEGAL_COMMAND | SDIO_R6_ERROR) +//! @} + +//! \name SDIO CMD52 argument bit offset +//! @{ +//! CMD52 arg[ 7: 0] Write data or stuff bits +#define SDIO_CMD52_WR_DATA 0 +//! CMD52 arg[ 8] Reserved +#define SDIO_CMD52_STUFF0 8 +//! CMD52 arg[25: 9] Register address +#define SDIO_CMD52_REG_ADRR 9 +//! CMD52 arg[ 26] Reserved +#define SDIO_CMD52_STUFF1 26 +//! CMD52 arg[ 27] Read after Write flag +#define SDIO_CMD52_RAW_FLAG 27 +//! CMD52 arg[30:28] Number of the function +#define SDIO_CMD52_FUNCTION_NUM 28 +//! CMD52 arg[ 31] Direction, 1:write, 0:read. +#define SDIO_CMD52_RW_FLAG 31 +#define SDIO_CMD52_READ_FLAG 0 +#define SDIO_CMD52_WRITE_FLAG 1 +//! @} + +//! \name SDIO CMD53 argument structure +//! @{ +/** + * [ 8: 0] Byte mode: number of bytes to transfer, + * 0 cause 512 bytes transfer. + * Block mode: number of blocks to transfer, + * 0 set count to infinite. + */ +#define SDIO_CMD53_COUNT 0 +//! CMD53 arg[25: 9] Start Address I/O register +#define SDIO_CMD53_REG_ADDR 9 +//! CMD53 arg[ 26] 1:Incrementing address, 0: fixed +#define SDIO_CMD53_OP_CODE 26 +//! CMD53 arg[ 27] (Optional) 1:block mode +#define SDIO_CMD53_BLOCK_MODE 27 +//! CMD53 arg[30:28] Number of the function +#define SDIO_CMD53_FUNCTION_NUM 28 +//! CMD53 arg[ 31] Direction, 1:WR, 0:RD +#define SDIO_CMD53_RW_FLAG 31 +#define SDIO_CMD53_READ_FLAG 0 +#define SDIO_CMD53_WRITE_FLAG 1 +//! @} + +//! \name SDIO Functions +//! @{ +#define SDIO_CIA 0 /**< SDIO Function 0 (CIA) */ +#define SDIO_FN0 0 /**< SDIO Function 0 */ +#define SDIO_FN1 1 /**< SDIO Function 1 */ +#define SDIO_FN2 2 /**< SDIO Function 2 */ +#define SDIO_FN3 3 /**< SDIO Function 3 */ +#define SDIO_FN4 4 /**< SDIO Function 4 */ +#define SDIO_FN5 5 /**< SDIO Function 5 */ +#define SDIO_FN6 6 /**< SDIO Function 6 */ +#define SDIO_FN7 7 /**< SDIO Function 7 */ + //! @} + +//! \name SDIO Card Common Control Registers (CCCR) +//! @{ +#define SDIO_CCCR_SDIO_REV 0x00 /**< CCCR/SDIO revision (RO) */ +#define SDIO_CCCR_REV (0xFlu << 0) /**< CCCR/FBR Version */ +#define SDIO_CCCR_REV_1_00 (0x0lu << 0) /**< CCCR/FBR Version 1.00 */ +#define SDIO_CCCR_REV_1_10 (0x1lu << 0) /**< CCCR/FBR Version 1.10 */ +#define SDIO_CCCR_REV_2_00 (0x2lu << 0) /**< CCCR/FBR Version 2.00 */ +#define SDIO_CCCR_REV_3_00 (0x3lu << 0) /**< CCCR/FBR Version 3.00 */ +#define SDIO_SDIO_REV (0xFlu << 4) /**< SDIO Spec */ +#define SDIO_SDIO_REV_1_00 (0x0lu << 4) /**< SDIO Spec 1.00 */ +#define SDIO_SDIO_REV_1_10 (0x1lu << 4) /**< SDIO Spec 1.10 */ +#define SDIO_SDIO_REV_1_20 (0x2lu << 4) /**< SDIO Spec 1.20(unreleased) */ +#define SDIO_SDIO_REV_2_00 (0x3lu << 4) /**< SDIO Spec Version 2.00 */ +#define SDIO_SDIO_REV_3_00 (0x4lu << 4) /**< SDIO Spec Version 3.00 */ +#define SDIO_CCCR_SD_REV 0x01 /**< SD Spec Revision (RO) */ +#define SDIO_SD_REV (0xFlu << 0) /**< SD Physical Spec */ +#define SDIO_SD_REV_1_01 (0x0lu << 0) /**< SD 1.01 (Mar 2000) */ +#define SDIO_SD_REV_1_10 (0x1lu << 0) /**< SD 1.10 (Oct 2004) */ +#define SDIO_SD_REV_2_00 (0x2lu << 0) /**< SD 2.00 (May 2006) */ +#define SDIO_SD_REV_3_00 (0x3lu << 0) /**< SD 3.00 */ +#define SDIO_CCCR_IOE 0x02 /**< I/O Enable (R/W) */ +#define SDIO_IOE (0xFElu << 1) /**< Functions Enable/Disable */ +#define SDIO_IOE_FN1 (0x1lu << 1) /**< Function 1 Enable/Disable */ +#define SDIO_IOE_FN2 (0x1lu << 2) /**< Function 2 Enable/Disable */ +#define SDIO_IOE_FN3 (0x1lu << 3) /**< Function 3 Enable/Disable */ +#define SDIO_IOE_FN4 (0x1lu << 4) /**< Function 4 Enable/Disable */ +#define SDIO_IOE_FN5 (0x1lu << 5) /**< Function 5 Enable/Disable */ +#define SDIO_IOE_FN6 (0x1lu << 6) /**< Function 6 Enable/Disable */ +#define SDIO_IOE_FN7 (0x1lu << 7) /**< Function 7 Enable/Disable */ +#define SDIO_CCCR_IOR 0x03 /**< I/O Ready (RO) */ +#define SDIO_IOR (0xFElu << 1) /**< Functions ready */ +#define SDIO_IOR_FN1 (0x1lu << 1) /**< Function 1 ready */ +#define SDIO_IOR_FN2 (0x1lu << 2) /**< Function 2 ready */ +#define SDIO_IOR_FN3 (0x1lu << 3) /**< Function 3 ready */ +#define SDIO_IOR_FN4 (0x1lu << 4) /**< Function 4 ready */ +#define SDIO_IOR_FN5 (0x1lu << 5) /**< Function 5 ready */ +#define SDIO_IOR_FN6 (0x1lu << 6) /**< Function 6 ready */ +#define SDIO_IOR_FN7 (0x1lu << 7) /**< Function 7 ready */ +#define SDIO_CCCR_IEN 0x04 /**< Int Enable */ +#define SDIO_IENM (0x1lu << 0) /**< Int Enable Master (R/W) */ +#define SDIO_IEN (0xFElu << 1) /**< Functions Int Enable */ +#define SDIO_IEN_FN1 (0x1lu << 1) /**< Function 1 Int Enable */ +#define SDIO_IEN_FN2 (0x1lu << 2) /**< Function 2 Int Enable */ +#define SDIO_IEN_FN3 (0x1lu << 3) /**< Function 3 Int Enable */ +#define SDIO_IEN_FN4 (0x1lu << 4) /**< Function 4 Int Enable */ +#define SDIO_IEN_FN5 (0x1lu << 5) /**< Function 5 Int Enable */ +#define SDIO_IEN_FN6 (0x1lu << 6) /**< Function 6 Int Enable */ +#define SDIO_IEN_FN7 (0x1lu << 7) /**< Function 7 Int Enable */ +#define SDIO_CCCR_INT 0x05 /**< Int Pending */ +#define SDIO_INT (0xFElu << 1) /**< Functions Int pending */ +#define SDIO_INT_FN1 (0x1lu << 1) /**< Function 1 Int pending */ +#define SDIO_INT_FN2 (0x1lu << 2) /**< Function 2 Int pending */ +#define SDIO_INT_FN3 (0x1lu << 3) /**< Function 3 Int pending */ +#define SDIO_INT_FN4 (0x1lu << 4) /**< Function 4 Int pending */ +#define SDIO_INT_FN5 (0x1lu << 5) /**< Function 5 Int pending */ +#define SDIO_INT_FN6 (0x1lu << 6) /**< Function 6 Int pending */ +#define SDIO_INT_FN7 (0x1lu << 7) /**< Function 7 Int pending */ +#define SDIO_CCCR_IOA 0x06 /**< I/O Abort */ +#define SDIO_AS (0x7lu << 0) /**< Abort Select In Order (WO) */ +#define SDIO_AS_FN1 (0x1lu << 0) /**< Abort function 1 IO */ +#define SDIO_AS_FN2 (0x2lu << 0) /**< Abort function 2 IO */ +#define SDIO_AS_FN3 (0x3lu << 0) /**< Abort function 3 IO */ +#define SDIO_AS_FN4 (0x4lu << 0) /**< Abort function 4 IO */ +#define SDIO_AS_FN5 (0x5lu << 0) /**< Abort function 5 IO */ +#define SDIO_AS_FN6 (0x6lu << 0) /**< Abort function 6 IO */ +#define SDIO_AS_FN7 (0x7lu << 0) /**< Abort function 7 IO */ +#define SDIO_RES (0x1lu << 3) /**< IO CARD RESET (WO) */ +#define SDIO_CCCR_BUS_CTRL 0x07 /**< Bus Interface Control */ +#define SDIO_BUSWIDTH (0x3lu << 0) /**< Data bus width (R/W) */ +#define SDIO_BUSWIDTH_1B (0x0lu << 0) /**< 1-bit data bus */ +#define SDIO_BUSWIDTH_4B (0x2lu << 0) /**< 4-bit data bus */ +/** Enable Continuous SPI interrupt (R/W) */ +#define SDIO_BUS_ECSI (0x1lu << 5) +/** Support Continuous SPI interrupt (RO) */ +#define SDIO_BUS_SCSI (0x1lu << 6) +/** Connect(0)/Disconnect(1) pull-up on CD/DAT[3] (R/W) */ +#define SDIO_BUS_CD_DISABLE (0x1lu << 7) +#define SDIO_CCCR_CAP 0x08 /**< Card Capability */ +/** Support Direct Commands during data transfer (RO) */ +#define SDIO_CAP_SDC (0x1lu << 0) +/** Support Multi-Block (RO) */ +#define SDIO_CAP_SMB (0x1lu << 1) +/** Support Read Wait (RO) */ +#define SDIO_CAP_SRW (0x1lu << 2) +/** Support Suspend/Resume (RO) */ +#define SDIO_CAP_SBS (0x1lu << 3) +/** Support interrupt between blocks of data in 4-bit SD mode (RO) */ +#define SDIO_CAP_S4MI (0x1lu << 4) +/** Enable interrupt between blocks of data in 4-bit SD mode (R/W) */ +#define SDIO_CAP_E4MI (0x1lu << 5) +/** Low-Speed Card (RO) */ +#define SDIO_CAP_LSC (0x1lu << 6) +/** 4-bit support for Low-Speed Card (RO) */ +#define SDIO_CAP_4BLS (0x1lu << 7) +/** Pointer to CIS (3B, LSB first) */ +#define SDIO_CCCR_CIS_PTR 0x09 +/** Bus Suspend */ +#define SDIO_CCCR_BUS_SUSPEND 0x0C +/** Bus Status (transfer on DAT[x] lines) (RO) */ +#define SDIO_BS (0x1lu << 0) +/** Bus Release Request/Status (R/W) */ +#define SDIO_BR (0x1lu << 1) +#define SDIO_CCCR_FUN_SEL 0x0D /**< Function select */ +#define SDIO_DF (0x1lu << 7) /**< Resume Data Flag (RO) */ +#define SDIO_FS (0xFlu << 0) /**< Select Function (R/W) */ +#define SDIO_FS_CIA (0x0lu << 0) /**< Select CIA (function 0) */ +#define SDIO_FS_FN1 (0x1lu << 0) /**< Select Function 1 */ +#define SDIO_FS_FN2 (0x2lu << 0) /**< Select Function 2 */ +#define SDIO_FS_FN3 (0x3lu << 0) /**< Select Function 3 */ +#define SDIO_FS_FN4 (0x4lu << 0) /**< Select Function 4 */ +#define SDIO_FS_FN5 (0x5lu << 0) /**< Select Function 5 */ +#define SDIO_FS_FN6 (0x6lu << 0) /**< Select Function 6 */ +#define SDIO_FS_FN7 (0x7lu << 0) /**< Select Function 7 */ +#define SDIO_FS_MEM (0x8lu << 0) /**< Select memory in combo card */ +#define SDIO_CCCR_EXEC 0x0E /**< Exec Flags (RO) */ +#define SDIO_EXM (0x1lu << 0) /**< Executing status of memory */ +#define SDIO_EX (0xFElu << 1) /**< Executing functions status */ +#define SDIO_EX_FN1 (0x1lu << 1) /**< Executing status of func 1 */ +#define SDIO_EX_FN2 (0x1lu << 2) /**< Executing status of func 2 */ +#define SDIO_EX_FN3 (0x1lu << 3) /**< Executing status of func 3 */ +#define SDIO_EX_FN4 (0x1lu << 4) /**< Executing status of func 4 */ +#define SDIO_EX_FN5 (0x1lu << 5) /**< Executing status of func 5 */ +#define SDIO_EX_FN6 (0x1lu << 6) /**< Executing status of func 6 */ +#define SDIO_EX_FN7 (0x1lu << 7) /**< Executing status of func 7 */ +#define SDIO_CCCR_READY 0x0F /**< Ready Flags (RO) */ +#define SDIO_RFM (0x1lu << 0) /**< Ready Flag for memory */ +#define SDIO_RF (0xFElu) /**< Ready Flag for functions */ +#define SDIO_RF_FN1 (0x1lu << 1) /**< Ready Flag for function 1 */ +#define SDIO_RF_FN2 (0x1lu << 2) /**< Ready Flag for function 2 */ +#define SDIO_RF_FN3 (0x1lu << 3) /**< Ready Flag for function 3 */ +#define SDIO_RF_FN4 (0x1lu << 4) /**< Ready Flag for function 4 */ +#define SDIO_RF_FN5 (0x1lu << 5) /**< Ready Flag for function 5 */ +#define SDIO_RF_FN6 (0x1lu << 6) /**< Ready Flag for function 6 */ +#define SDIO_RF_FN7 (0x1lu << 7) /**< Ready Flag for function 7 */ +#define SDIO_CCCR_FN0_BLKSIZ 0x10 /**< FN0 Block Size (2B, LSB first) (R/W) */ +#define SDIO_CCCR_POWER 0x12 /**< Power Control */ +#define SDIO_SMPC (0x1lu << 0) /**< Support Master Power Control*/ +#define SDIO_EMPC (0x1lu << 1) /**< Enable Master Power Control */ +#define SDIO_CCCR_HS 0x13 /**< High-Speed */ +#define SDIO_SHS (0x1lu << 0) /**< Support High-Speed (RO) */ +#define SDIO_EHS (0x1lu << 1) /**< Enable High-Speed (R/W) */ + //! @} + +//! \name SDIO Function Basic Registers (FBR) +//! @{ +#define SDIO_FBR_ADDR(fn, x) (0x100 * (fn) + (x)) +#define SDIO_FBR_CSA_IF 0x0 /**< CSA and function interface code (RO) */ +#define SDIO_IFC (0xFUL << 0) /**< Standard SDIO Fun Interface Code */ +#define SDIO_IFC_NO_IF (0x0UL << 0) /**< No SDIO standard interface */ +#define SDIO_IFC_UART (0x1UL << 0) /**< UART */ +#define SDIO_IFC_TA_BT (0x2UL << 0) /**< Type-A Bluetooth */ +#define SDIO_IFC_TB_BT (0x3UL << 0) /**< Type-B Bluetooth */ +#define SDIO_IFC_GPS (0x4UL << 0) /**< GPS */ +#define SDIO_IFC_CAMERA (0x5UL << 0) /**< Camera */ +#define SDIO_IFC_PHS (0x6UL << 0) /**< PHS */ +#define SDIO_IFC_WLAN (0x7UL << 0) /**< WLAN */ +#define SDIO_IFC_ATA (0x8UL << 0) /**< Embedded SDIO-ATA */ +#define SDIO_IFC_EXT (0xFUL << 0) /**< Check EXT interface code */ +#define SDIO_SCSA (0x1UL << 6) /**< Function supports Code Storage Area (CSA) */ +#define SDIO_FBR_CSA (0x1UL << 7) /**< Function CSA enable */ +#define SDIO_FBR_EXT_IF 0x1 /**< Extended function interface code (RO) */ +#define SDIO_FBR_PWR 0x2 /**< function power control */ +#define SDIO_SPS (0x1UL << 0) /**< function support power selection (RO) */ +#define SDIO_EPS (0x1UL << 1) /**< Low Current Mode/High Current Mode (R/W) */ +#define SDIO_FBR_CIS_PTR 0x9 /**< Address pointer to function CIS (3B, LSB first) (RO) */ +#define SDIO_FBR_CSA_PTR 0xC /**< Address pointer to CSA (3B, LSB first) (R/W) */ +#define SDIO_FBR_CSA_DATA 0xF /**< Read/Write fifo to CSA (R/W) */ +#define SDIO_FBR_BLK_SIZ 0x10 /**< Block size (2B, LSB first) (R/W) */ + //! @} + +//! \name SDIO Card Metaformat +//! @{ +/** Null tuple (PCMCIA 3.1.9) */ +#define SDIO_CISTPL_NULL 0x00 +/** Device tuple (PCMCIA 3.2.2) */ +#define SDIO_CISTPL_DEVICE 0x01 +/** Checksum control (PCMCIA 3.1.1) */ +#define SDIO_CISTPL_CHECKSUM 0x10 +/** Level 1 version (PCMCIA 3.2.10) */ +#define SDIO_CISTPL_VERS_1 0x15 +/** Alternate Language String (PCMCIA 3.2.1) */ +#define SDIO_CISTPL_ALTSTR 0x16 +/** Manufacturer Identification String (PCMCIA 3.2.9) */ +#define SDIO_CISTPL_MANFID 0x20 +/** Function Identification (PCMCIA 3.2.7) */ +#define SDIO_CISTPL_FUNCID 0x21 +/** Function Extensions (PCMCIA 3.2.6) */ +#define SDIO_CISTPL_FUNCE 0x22 +/** Additional information for SDIO (PCMCIA 6.1.2) */ +#define SDIO_CISTPL_SDIO_STD 0x91 +/** Reserved for future SDIO (PCMCIA 6.1.3) */ +#define SDIO_CISTPL_SDIO_EXT 0x92 +/** The End-of-chain Tuple (PCMCIA 3.1.2) */ +#define SDIO_CISTPL_END 0xFF +//! @} + +//! @} + +//! \name CSD, OCR, SCR, Switch status, extend CSD definitions +//! @{ + +/** + * \brief Macro function to extract a bits field from a large SD MMC register + * Used by : CSD, SCR, Switch status + */ +static inline uint32_t SDMMC_UNSTUFF_BITS(uint8_t *reg, uint16_t reg_size, uint16_t pos, uint8_t size) +{ + uint32_t value; + value = reg[((reg_size - pos + 7) / 8) - 1] >> (pos % 8); + if (((pos % 8) + size) > 8) { + value |= (uint32_t)reg[((reg_size - pos + 7) / 8) - 2] << (8 - (pos % 8)); + } + if (((pos % 8) + size) > 16) { + value |= (uint32_t)reg[((reg_size - pos + 7) / 8) - 3] << (16 - (pos % 8)); + } + if (((pos % 8) + size) > 24) { + value |= (uint32_t)reg[((reg_size - pos + 7) / 8) - 3] << (24 - (pos % 8)); + } + value &= ((uint32_t)1 << size) - 1; + return value; +} + + //! \name CSD Fields + //! @{ +#define CSD_REG_BIT_SIZE 128 //!< 128 bits +#define CSD_REG_BSIZE (CSD_REG_BIT_SIZE / 8) //!< 16 bytes +#define CSD_STRUCTURE(csd, pos, size) SDMMC_UNSTUFF_BITS(csd, CSD_REG_BIT_SIZE, pos, size) +#define CSD_STRUCTURE_VERSION(csd) CSD_STRUCTURE(csd, 126, 2) +#define SD_CSD_VER_1_0 0 +#define SD_CSD_VER_2_0 1 +#define MMC_CSD_VER_1_0 0 +#define MMC_CSD_VER_1_1 1 +#define MMC_CSD_VER_1_2 2 +#define CSD_TRAN_SPEED(csd) CSD_STRUCTURE(csd, 96, 8) +#define SD_CSD_1_0_C_SIZE(csd) CSD_STRUCTURE(csd, 62, 12) +#define SD_CSD_1_0_C_SIZE_MULT(csd) CSD_STRUCTURE(csd, 47, 3) +#define SD_CSD_1_0_READ_BL_LEN(csd) CSD_STRUCTURE(csd, 80, 4) +#define SD_CSD_2_0_C_SIZE(csd) CSD_STRUCTURE(csd, 48, 22) +#define MMC_CSD_C_SIZE(csd) CSD_STRUCTURE(csd, 62, 12) +#define MMC_CSD_C_SIZE_MULT(csd) CSD_STRUCTURE(csd, 47, 3) +#define MMC_CSD_READ_BL_LEN(csd) CSD_STRUCTURE(csd, 80, 4) +#define MMC_CSD_SPEC_VERS(csd) CSD_STRUCTURE(csd, 122, 4) + //! @} + + //! \name OCR Register Fields + //! @{ +#define OCR_REG_BSIZE (32 / 8) /**< 32 bits, 4 bytes */ +#define OCR_VDD_170_195 (1lu << 7) +#define OCR_VDD_20_21 (1lu << 8) +#define OCR_VDD_21_22 (1lu << 9) +#define OCR_VDD_22_23 (1lu << 10) +#define OCR_VDD_23_24 (1lu << 11) +#define OCR_VDD_24_25 (1lu << 12) +#define OCR_VDD_25_26 (1lu << 13) +#define OCR_VDD_26_27 (1lu << 14) +#define OCR_VDD_27_28 (1lu << 15) +#define OCR_VDD_28_29 (1lu << 16) +#define OCR_VDD_29_30 (1lu << 17) +#define OCR_VDD_30_31 (1lu << 18) +#define OCR_VDD_31_32 (1lu << 19) +#define OCR_VDD_32_33 (1lu << 20) +#define OCR_VDD_33_34 (1lu << 21) +#define OCR_VDD_34_35 (1lu << 22) +#define OCR_VDD_35_36 (1lu << 23) +#define OCR_SDIO_S18R (1lu << 24) /**< Switching to 1.8V Accepted */ +#define OCR_SDIO_MP (1lu << 27) /**< Memory Present */ +#define OCR_SDIO_NF (7lu << 28) /**< Number of I/O Functions */ +#define OCR_ACCESS_MODE_MASK (3lu << 29) /**< (MMC) Access mode mask */ +#define OCR_ACCESS_MODE_BYTE (0lu << 29) /**< (MMC) Byte access mode */ +#define OCR_ACCESS_MODE_SECTOR (2lu << 29) /**< (MMC) Sector access mode */ +#define OCR_CCS (1lu << 30) /**< (SD) Card Capacity Status */ +#define OCR_POWER_UP_BUSY (1lu << 31) /**< Card power up status bit */ + //! @} + + //! \name SD SCR Register Fields + //! @{ +#define SD_SCR_REG_BIT_SIZE 64 //!< 64 bits +#define SD_SCR_REG_BSIZE (SD_SCR_REG_BIT_SIZE / 8) //!< 8 bytes +#define SD_SCR_STRUCTURE(scr, pos, size) SDMMC_UNSTUFF_BITS(scr, SD_SCR_REG_BIT_SIZE, pos, size) +#define SD_SCR_SCR_STRUCTURE(scr) SD_SCR_STRUCTURE(scr, 60, 4) +#define SD_SCR_SCR_STRUCTURE_1_0 0 +#define SD_SCR_SD_SPEC(scr) SD_SCR_STRUCTURE(scr, 56, 4) +#define SD_SCR_SD_SPEC_1_0_01 0 +#define SD_SCR_SD_SPEC_1_10 1 +#define SD_SCR_SD_SPEC_2_00 2 +#define SD_SCR_DATA_STATUS_AFTER_ERASE(scr) SD_SCR_STRUCTURE(scr, 55, 1) +#define SD_SCR_SD_SECURITY(scr) SD_SCR_STRUCTURE(scr, 52, 3) +#define SD_SCR_SD_SECURITY_NO 0 +#define SD_SCR_SD_SECURITY_NOTUSED 1 +#define SD_SCR_SD_SECURITY_1_01 2 +#define SD_SCR_SD_SECURITY_2_00 3 +#define SD_SCR_SD_SECURITY_3_00 4 +#define SD_SCR_SD_BUS_WIDTHS(scr) SD_SCR_STRUCTURE(scr, 48, 4) +#define SD_SCR_SD_BUS_WIDTH_1BITS (1lu << 0) +#define SD_SCR_SD_BUS_WIDTH_4BITS (1lu << 2) +#define SD_SCR_SD_SPEC3(scr) SD_SCR_STRUCTURE(scr, 47, 1) +#define SD_SCR_SD_SPEC_3_00 1 +#define SD_SCR_SD_EX_SECURITY(scr) SD_SCR_STRUCTURE(scr, 43, 4) +#define SD_SCR_SD_CMD_SUPPORT(scr) SD_SCR_STRUCTURE(scr, 32, 2) + //! @} + + //! \name SD Switch Status Fields + //! @{ +#define SD_SW_STATUS_BIT_SIZE 512 //!< 512 bits +#define SD_SW_STATUS_BSIZE (SD_SW_STATUS_BIT_SIZE / 8) //!< 64 bytes +#define SD_SW_STATUS_STRUCTURE(sd_sw_status, pos, size) \ + SDMMC_UNSTUFF_BITS(sd_sw_status, SD_SW_STATUS_BIT_SIZE, pos, size) +#define SD_SW_STATUS_MAX_CURRENT_CONSUMPTION(status) SD_SW_STATUS_STRUCTURE(status, 496, 16) +#define SD_SW_STATUS_FUN_GRP6_INFO(status) SD_SW_STATUS_STRUCTURE(status, 480, 16) +#define SD_SW_STATUS_FUN_GRP5_INFO(status) SD_SW_STATUS_STRUCTURE(status, 464, 16) +#define SD_SW_STATUS_FUN_GRP4_INFO(status) SD_SW_STATUS_STRUCTURE(status, 448, 16) +#define SD_SW_STATUS_FUN_GRP3_INFO(status) SD_SW_STATUS_STRUCTURE(status, 432, 16) +#define SD_SW_STATUS_FUN_GRP2_INFO(status) SD_SW_STATUS_STRUCTURE(status, 416, 16) +#define SD_SW_STATUS_FUN_GRP1_INFO(status) SD_SW_STATUS_STRUCTURE(status, 400, 16) +#define SD_SW_STATUS_FUN_GRP6_RC(status) SD_SW_STATUS_STRUCTURE(status, 396, 4) +#define SD_SW_STATUS_FUN_GRP5_RC(status) SD_SW_STATUS_STRUCTURE(status, 392, 4) +#define SD_SW_STATUS_FUN_GRP4_RC(status) SD_SW_STATUS_STRUCTURE(status, 388, 4) +#define SD_SW_STATUS_FUN_GRP3_RC(status) SD_SW_STATUS_STRUCTURE(status, 384, 4) +#define SD_SW_STATUS_FUN_GRP2_RC(status) SD_SW_STATUS_STRUCTURE(status, 380, 4) +#define SD_SW_STATUS_FUN_GRP1_RC(status) SD_SW_STATUS_STRUCTURE(status, 376, 4) +#define SD_SW_STATUS_FUN_GRP_RC_ERROR 0xFU +#define SD_SW_STATUS_DATA_STRUCT_VER(status) SD_SW_STATUS_STRUCTURE(status, 368, 8) +#define SD_SW_STATUS_FUN_GRP6_BUSY(status) SD_SW_STATUS_STRUCTURE(status, 352, 16) +#define SD_SW_STATUS_FUN_GRP5_BUSY(status) SD_SW_STATUS_STRUCTURE(status, 336, 16) +#define SD_SW_STATUS_FUN_GRP4_BUSY(status) SD_SW_STATUS_STRUCTURE(status, 320, 16) +#define SD_SW_STATUS_FUN_GRP3_BUSY(status) SD_SW_STATUS_STRUCTURE(status, 304, 16) +#define SD_SW_STATUS_FUN_GRP2_BUSY(status) SD_SW_STATUS_STRUCTURE(status, 288, 16) +#define SD_SW_STATUS_FUN_GRP1_BUSY(status) SD_SW_STATUS_STRUCTURE(status, 272, 16) + //! @} + + //! \name Card Status Fields + //! @{ +#define CARD_STATUS_APP_CMD (1lu << 5) +#define CARD_STATUS_SWITCH_ERROR (1lu << 7) +#define CARD_STATUS_READY_FOR_DATA (1lu << 8) +#define CARD_STATUS_STATE_IDLE (0lu << 9) +#define CARD_STATUS_STATE_READY (1lu << 9) +#define CARD_STATUS_STATE_IDENT (2lu << 9) +#define CARD_STATUS_STATE_STBY (3lu << 9) +#define CARD_STATUS_STATE_TRAN (4lu << 9) +#define CARD_STATUS_STATE_DATA (5lu << 9) +#define CARD_STATUS_STATE_RCV (6lu << 9) +#define CARD_STATUS_STATE_PRG (7lu << 9) +#define CARD_STATUS_STATE_DIS (8lu << 9) +#define CARD_STATUS_STATE (0xFlu << 9) +#define CARD_STATUS_ERASE_RESET (1lu << 13) +#define CARD_STATUS_WP_ERASE_SKIP (1lu << 15) +#define CARD_STATUS_CIDCSD_OVERWRITE (1lu << 16) +#define CARD_STATUS_OVERRUN (1lu << 17) +#define CARD_STATUS_UNERRUN (1lu << 18) +#define CARD_STATUS_ERROR (1lu << 19) +#define CARD_STATUS_CC_ERROR (1lu << 20) +#define CARD_STATUS_CARD_ECC_FAILED (1lu << 21) +#define CARD_STATUS_ILLEGAL_COMMAND (1lu << 22) +#define CARD_STATUS_COM_CRC_ERROR (1lu << 23) +#define CARD_STATUS_UNLOCK_FAILED (1lu << 24) +#define CARD_STATUS_CARD_IS_LOCKED (1lu << 25) +#define CARD_STATUS_WP_VIOLATION (1lu << 26) +#define CARD_STATUS_ERASE_PARAM (1lu << 27) +#define CARD_STATUS_ERASE_SEQ_ERROR (1lu << 28) +#define CARD_STATUS_BLOCK_LEN_ERROR (1lu << 29) +#define CARD_STATUS_ADDRESS_MISALIGN (1lu << 30) +#define CARD_STATUS_ADDR_OUT_OF_RANGE (1lu << 31) + +#define CARD_STATUS_ERR_RD_WR \ + (CARD_STATUS_ADDR_OUT_OF_RANGE | CARD_STATUS_ADDRESS_MISALIGN | CARD_STATUS_BLOCK_LEN_ERROR \ + | CARD_STATUS_WP_VIOLATION | CARD_STATUS_ILLEGAL_COMMAND | CARD_STATUS_CC_ERROR | CARD_STATUS_ERROR) + //! @} + + //! \name SD Status Field + //! @{ +#define SD_STATUS_BSIZE (512 / 8) /**< 512 bits, 64bytes */ + //! @} + + //! \name MMC Extended CSD Register Field + //! @{ +#define EXT_CSD_BSIZE 512 /**< 512 bytes. */ +/* Below belongs to Properties Segment */ +#define EXT_CSD_S_CMD_SET_INDEX 504lu +#define EXT_CSD_BOOT_INFO_INDEX 228lu +#define EXT_CSD_BOOT_SIZE_MULTI_INDEX 226lu +#define EXT_CSD_ACC_SIZE_INDEX 225lu +#define EXT_CSD_HC_ERASE_GRP_SIZE_INDEX 224lu +#define EXT_CSD_ERASE_TIMEOUT_MULT_INDEX 223lu +#define EXT_CSD_REL_WR_SEC_C_INDEX 222lu +#define EXT_CSD_HC_WP_GRP_SIZE_INDEX 221lu +#define EXT_CSD_S_C_VCC_INDEX 220lu +#define EXT_CSD_S_C_VCCQ_INDEX 219lu +#define EXT_CSD_S_A_TIMEOUT_INDEX 217lu +#define EXT_CSD_SEC_COUNT_INDEX 212lu +#define EXT_CSD_MIN_PERF_W_8_52_INDEX 210lu +#define EXT_CSD_MIN_PERF_R_8_52_INDEX 209lu +#define EXT_CSD_MIN_PERF_W_8_26_4_52_INDEX 208lu +#define EXT_CSD_MIN_PERF_R_8_26_4_52_INDEX 207lu +#define EXT_CSD_MIN_PERF_W_4_26_INDEX 206lu +#define EXT_CSD_MIN_PERF_R_4_26_INDEX 205lu +#define EXT_CSD_PWR_CL_26_360_INDEX 203lu +#define EXT_CSD_PWR_CL_52_360_INDEX 202lu +#define EXT_CSD_PWR_CL_26_195_INDEX 201lu +#define EXT_CSD_PWR_CL_52_195_INDEX 200lu +#define EXT_CSD_CARD_TYPE_INDEX 196lu +/* MMC card type */ +#define MMC_CTYPE_26MHZ 0x1 +#define MMC_CTYPE_52MHZ 0x2 +#define EXT_CSD_CSD_STRUCTURE_INDEX 194lu +#define EXT_CSD_EXT_CSD_REV_INDEX 192lu + +/* Below belongs to Mode Segment */ +#define EXT_CSD_CMD_SET_INDEX 191lu +#define EXT_CSD_CMD_SET_REV_INDEX 189lu +#define EXT_CSD_POWER_CLASS_INDEX 187lu +#define EXT_CSD_HS_TIMING_INDEX 185lu +#define EXT_CSD_BUS_WIDTH_INDEX 183lu +#define EXT_CSD_ERASED_MEM_CONT_INDEX 181lu +#define EXT_CSD_BOOT_CONFIG_INDEX 179lu +#define EXT_CSD_BOOT_BUS_WIDTH_INDEX 177lu +#define EXT_CSD_ERASE_GROUP_DEF_INDEX 175lu + //! @} +//! @} + +//! \name Definition for SPI mode only +//! @{ + +//! SPI commands start with a start bit "0" and a transmit bit "1" +#define SPI_CMD_ENCODE(x) (0x40 | (x & 0x3F)) + +//! \name Register R1 definition for SPI mode +//! The R1 register is always send after a command. +//! @{ +#define R1_SPI_IDLE (1lu << 0) +#define R1_SPI_ERASE_RESET (1lu << 1) +#define R1_SPI_ILLEGAL_COMMAND (1lu << 2) +#define R1_SPI_COM_CRC (1lu << 3) +#define R1_SPI_ERASE_SEQ (1lu << 4) +#define R1_SPI_ADDRESS (1lu << 5) +#define R1_SPI_PARAMETER (1lu << 6) +// R1 bit 7 is always zero, reuse this bit for error +#define R1_SPI_ERROR (1lu << 7) +//! @} + +//! \name Register R2 definition for SPI mode +//! The R2 register can be send after R1 register. +//! @{ +#define R2_SPI_CARD_LOCKED (1lu << 0) +#define R2_SPI_WP_ERASE_SKIP (1lu << 1) +#define R2_SPI_LOCK_UNLOCK_FAIL R2_SPI_WP_ERASE_SKIP +#define R2_SPI_ERROR (1lu << 2) +#define R2_SPI_CC_ERROR (1lu << 3) +#define R2_SPI_CARD_ECC_ERROR (1lu << 4) +#define R2_SPI_WP_VIOLATION (1lu << 5) +#define R2_SPI_ERASE_PARAM (1lu << 6) +#define R2_SPI_OUT_OF_RANGE (1lu << 7) +#define R2_SPI_CSD_OVERWRITE R2_SPI_OUT_OF_RANGE +//! @} + +//! \name Control Tokens in SPI Mode +//! @{ +//! \name Tokens used for a read operation +//! @{ +#define SPI_TOKEN_SINGLE_MULTI_READ 0xFE +#define SPI_TOKEN_DATA_ERROR_VALID(token) (((token)&0xF0) == 0) +#define SPI_TOKEN_DATA_ERROR_ERRORS (0x0F) +#define SPI_TOKEN_DATA_ERROR_ERROR (1lu << 0) +#define SPI_TOKEN_DATA_ERROR_CC_ERROR (1lu << 1) +#define SPI_TOKEN_DATA_ERROR_ECC_ERROR (1lu << 2) +#define SPI_TOKEN_DATA_ERROR_OUT_RANGE (1lu << 3) + //! @} + //! \name Tokens used for a write operation + //! @{ +#define SPI_TOKEN_SINGLE_WRITE 0xFE +#define SPI_TOKEN_MULTI_WRITE 0xFC +#define SPI_TOKEN_STOP_TRAN 0xFD +#define SPI_TOKEN_DATA_RESP_VALID(token) ((((token) & (1 << 4)) == 0) && (((token) & (1 << 0)) == 1)) +#define SPI_TOKEN_DATA_RESP_CODE(token) ((token)&0x1E) +#define SPI_TOKEN_DATA_RESP_ACCEPTED (2lu << 1) +#define SPI_TOKEN_DATA_RESP_CRC_ERR (5lu << 1) +#define SPI_TOKEN_DATA_RESP_WRITE_ERR (6lu << 1) + //! @} + //! @} + //! @} + + //! @} end of sd_mmc_protocol + +#ifdef __cplusplus +} +#endif + +#endif /* SD_MMC_PROTOCOL_H_INCLUDED */ From f496c0b58d63f594ce42bd5b34cf8421674b4108 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 26 Jun 2020 10:58:54 -0500 Subject: [PATCH 0106/1293] atmel-samd: Add SDIO SD card interface --- locale/circuitpython.pot | 10 +- ports/atmel-samd/Makefile | 15 + ports/atmel-samd/asf4 | 2 +- .../asf4_conf/samd51/hpl_sdhc_config.h | 24 ++ .../asf4_conf/samd51/peripheral_clk_config.h | 164 +++++++++++ .../asf4_conf/same54/hpl_sdhc_config.h | 24 ++ .../asf4_conf/same54/peripheral_clk_config.h | 164 +++++++++++ .../grandcentral_m4_express/mpconfigboard.mk | 2 + .../boards/grandcentral_m4_express/pins.c | 17 ++ .../boards/same54_xplained/mpconfigboard.mk | 3 +- .../atmel-samd/boards/same54_xplained/pins.c | 17 ++ ports/atmel-samd/common-hal/sdioio/SDCard.c | 272 ++++++++++++++++++ ports/atmel-samd/common-hal/sdioio/SDCard.h | 40 +++ ports/atmel-samd/common-hal/sdioio/__init__.c | 0 ports/atmel-samd/common-hal/sdioio/__init__.h | 0 tools/mksdiodata.py | 40 +++ 16 files changed, 791 insertions(+), 3 deletions(-) create mode 100644 ports/atmel-samd/asf4_conf/samd51/hpl_sdhc_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_sdhc_config.h create mode 100644 ports/atmel-samd/common-hal/sdioio/SDCard.c create mode 100644 ports/atmel-samd/common-hal/sdioio/SDCard.h create mode 100644 ports/atmel-samd/common-hal/sdioio/__init__.c create mode 100644 ports/atmel-samd/common-hal/sdioio/__init__.h create mode 100755 tools/mksdiodata.py diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 481d29f248..3a3b159a04 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -58,6 +58,10 @@ msgstr "" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "" @@ -85,6 +89,10 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "" @@ -417,7 +425,7 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" -#: shared-module/sdcardio/SDCard.c +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" msgstr "" diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 5f901a1991..c308105a32 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -246,6 +246,14 @@ SRC_ASF += \ endif +ifeq ($(CIRCUITPY_SDIOIO),1) +SRC_ASF += \ + hal/src/hal_mci_sync.c \ + hpl/sdhc/hpl_sdhc.c \ + +$(BUILD)/asf4/$(CHIP_FAMILY)/hpl/sdhc/hpl_sdhc.o: CFLAGS += -Wno-cast-align +endif + SRC_ASF := $(addprefix asf4/$(CHIP_FAMILY)/, $(SRC_ASF)) SRC_C = \ @@ -290,6 +298,9 @@ SRC_C = \ supervisor/shared/memory.c \ timer_handler.c \ +ifeq ($(CIRCUITPY_SDIOIO),1) +SRC_C += ports/atmel-samd/sd_mmc/sd_mmc.c +endif ifeq ($(CIRCUITPY_NETWORK),1) CFLAGS += -DMICROPY_PY_NETWORK=1 @@ -346,6 +357,10 @@ endif OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) +SRC_QSTR += $(HEADER_BUILD)/sdiodata.h +$(HEADER_BUILD)/sdiodata.h: $(TOP)/tools/mksdiodata.py | $(HEADER_BUILD) + $(Q)$(PYTHON3) $< > $@ + SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) # Sources that only hold QSTRs after pre-processing. SRC_QSTR_PREPROCESSOR += peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/clocks.c diff --git a/ports/atmel-samd/asf4 b/ports/atmel-samd/asf4 index c0eef7b751..35a1525796 160000 --- a/ports/atmel-samd/asf4 +++ b/ports/atmel-samd/asf4 @@ -1 +1 @@ -Subproject commit c0eef7b75124fc946af5f75e12d82d6d01315ab1 +Subproject commit 35a1525796c7ef8a3893d90befdad2f267fca20e diff --git a/ports/atmel-samd/asf4_conf/samd51/hpl_sdhc_config.h b/ports/atmel-samd/asf4_conf/samd51/hpl_sdhc_config.h new file mode 100644 index 0000000000..daa6620517 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/samd51/hpl_sdhc_config.h @@ -0,0 +1,24 @@ +/* Auto-generated config file hpl_sdhc_config.h */ +#ifndef HPL_SDHC_CONFIG_H +#define HPL_SDHC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +#include "peripheral_clk_config.h" + +#ifndef CONF_BASE_FREQUENCY +#define CONF_BASE_FREQUENCY CONF_SDHC0_FREQUENCY +#endif + +// Clock Generator Select +// <0=> Divided Clock mode +// <1=> Programmable Clock mode +// This defines the clock generator mode in the SDCLK Frequency Select field +// sdhc_clk_gsel +#ifndef CONF_SDHC0_CLK_GEN_SEL +#define CONF_SDHC0_CLK_GEN_SEL 0 +#endif + +// <<< end of configuration section >>> + +#endif // HPL_SDHC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/samd51/peripheral_clk_config.h b/ports/atmel-samd/asf4_conf/samd51/peripheral_clk_config.h index 030a90a7a9..59fe8730e6 100644 --- a/ports/atmel-samd/asf4_conf/samd51/peripheral_clk_config.h +++ b/ports/atmel-samd/asf4_conf/samd51/peripheral_clk_config.h @@ -1001,6 +1001,170 @@ #define CONF_GCLK_USB_FREQUENCY 48000000 #endif +// SDHC Clock Settings +// SDHC Clock source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_gclk_selection +#ifndef CONF_GCLK_SDHC0_SRC +#define CONF_GCLK_SDHC0_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif + +// SDHC clock slow source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_slow_gclk_selection +#ifndef CONF_GCLK_SDHC0_SLOW_SRC +#define CONF_GCLK_SDHC0_SLOW_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif +// + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock frequency + */ +#ifndef CONF_SDHC0_FREQUENCY +#define CONF_SDHC0_FREQUENCY 12000000 +#endif + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock slow frequency + */ +#ifndef CONF_SDHC0_SLOW_FREQUENCY +#define CONF_SDHC0_SLOW_FREQUENCY 12000000 +#endif + +// SDHC Clock Settings +// SDHC Clock source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_gclk_selection +#ifndef CONF_GCLK_SDHC1_SRC +#define CONF_GCLK_SDHC1_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif + +// SDHC clock slow source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_slow_gclk_selection +#ifndef CONF_GCLK_SDHC1_SLOW_SRC +#define CONF_GCLK_SDHC1_SLOW_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif +// + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock frequency + */ +#ifndef CONF_SDHC1_FREQUENCY +#define CONF_SDHC1_FREQUENCY 12000000 +#endif + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock slow frequency + */ +#ifndef CONF_SDHC1_SLOW_FREQUENCY +#define CONF_SDHC1_SLOW_FREQUENCY 12000000 +#endif + // <<< end of configuration section >>> #endif // PERIPHERAL_CLK_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_sdhc_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_sdhc_config.h new file mode 100644 index 0000000000..daa6620517 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_sdhc_config.h @@ -0,0 +1,24 @@ +/* Auto-generated config file hpl_sdhc_config.h */ +#ifndef HPL_SDHC_CONFIG_H +#define HPL_SDHC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +#include "peripheral_clk_config.h" + +#ifndef CONF_BASE_FREQUENCY +#define CONF_BASE_FREQUENCY CONF_SDHC0_FREQUENCY +#endif + +// Clock Generator Select +// <0=> Divided Clock mode +// <1=> Programmable Clock mode +// This defines the clock generator mode in the SDCLK Frequency Select field +// sdhc_clk_gsel +#ifndef CONF_SDHC0_CLK_GEN_SEL +#define CONF_SDHC0_CLK_GEN_SEL 0 +#endif + +// <<< end of configuration section >>> + +#endif // HPL_SDHC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h b/ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h index 030a90a7a9..59fe8730e6 100644 --- a/ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h +++ b/ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h @@ -1001,6 +1001,170 @@ #define CONF_GCLK_USB_FREQUENCY 48000000 #endif +// SDHC Clock Settings +// SDHC Clock source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_gclk_selection +#ifndef CONF_GCLK_SDHC0_SRC +#define CONF_GCLK_SDHC0_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif + +// SDHC clock slow source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_slow_gclk_selection +#ifndef CONF_GCLK_SDHC0_SLOW_SRC +#define CONF_GCLK_SDHC0_SLOW_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif +// + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock frequency + */ +#ifndef CONF_SDHC0_FREQUENCY +#define CONF_SDHC0_FREQUENCY 12000000 +#endif + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock slow frequency + */ +#ifndef CONF_SDHC0_SLOW_FREQUENCY +#define CONF_SDHC0_SLOW_FREQUENCY 12000000 +#endif + +// SDHC Clock Settings +// SDHC Clock source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_gclk_selection +#ifndef CONF_GCLK_SDHC1_SRC +#define CONF_GCLK_SDHC1_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif + +// SDHC clock slow source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_slow_gclk_selection +#ifndef CONF_GCLK_SDHC1_SLOW_SRC +#define CONF_GCLK_SDHC1_SLOW_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif +// + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock frequency + */ +#ifndef CONF_SDHC1_FREQUENCY +#define CONF_SDHC1_FREQUENCY 12000000 +#endif + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock slow frequency + */ +#ifndef CONF_SDHC1_SLOW_FREQUENCY +#define CONF_SDHC1_SLOW_FREQUENCY 12000000 +#endif + // <<< end of configuration section >>> #endif // PERIPHERAL_CLK_CONFIG_H diff --git a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk index ab81ec5a29..08eb5c98ba 100644 --- a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk @@ -10,3 +10,5 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C" LONGINT_IMPL = MPZ + +CIRCUITPY_SDIOIO = 1 diff --git a/ports/atmel-samd/boards/grandcentral_m4_express/pins.c b/ports/atmel-samd/boards/grandcentral_m4_express/pins.c index 6b09c62bf3..b125aca086 100644 --- a/ports/atmel-samd/boards/grandcentral_m4_express/pins.c +++ b/ports/atmel-samd/boards/grandcentral_m4_express/pins.c @@ -1,5 +1,18 @@ +#include "py/objtuple.h" #include "shared-bindings/board/__init__.h" +STATIC const mp_rom_obj_tuple_t sdio_data_tuple = { + {&mp_type_tuple}, + 4, + { + MP_ROM_PTR(&pin_PB18), + MP_ROM_PTR(&pin_PB19), + MP_ROM_PTR(&pin_PB20), + MP_ROM_PTR(&pin_PB21), + } +}; + + // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. @@ -129,5 +142,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_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_SDIO_CLOCK), MP_ROM_PTR(&pin_PA21) }, + { MP_ROM_QSTR(MP_QSTR_SDIO_COMMAND), MP_ROM_PTR(&pin_PA20) }, + { MP_ROM_QSTR(MP_QSTR_SDIO_DATA), MP_ROM_PTR(&sdio_data_tuple) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk b/ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk index ffc4f567f9..7ac1265149 100644 --- a/ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk +++ b/ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk @@ -10,4 +10,5 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "N25Q256A" LONGINT_IMPL = MPZ -LONGINT_IMPL = MPZ + +CIRCUITPY_SDIOIO = 1 diff --git a/ports/atmel-samd/boards/same54_xplained/pins.c b/ports/atmel-samd/boards/same54_xplained/pins.c index 5b9373724e..8a864ab97d 100644 --- a/ports/atmel-samd/boards/same54_xplained/pins.c +++ b/ports/atmel-samd/boards/same54_xplained/pins.c @@ -1,5 +1,18 @@ +#include "py/objtuple.h" #include "shared-bindings/board/__init__.h" +STATIC const mp_rom_obj_tuple_t sdio_data_tuple = { + {&mp_type_tuple}, + 4, + { + MP_ROM_PTR(&pin_PB18), + MP_ROM_PTR(&pin_PB19), + MP_ROM_PTR(&pin_PB20), + MP_ROM_PTR(&pin_PB21), + } +}; + + // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. @@ -95,5 +108,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_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_SDIO_CLOCK), MP_ROM_PTR(&pin_PA21) }, + { MP_ROM_QSTR(MP_QSTR_SDIO_COMMAND), MP_ROM_PTR(&pin_PA20) }, + { MP_ROM_QSTR(MP_QSTR_SDIO_DATA), MP_ROM_PTR(&sdio_data_tuple) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/common-hal/sdioio/SDCard.c b/ports/atmel-samd/common-hal/sdioio/SDCard.c new file mode 100644 index 0000000000..6014bd8abf --- /dev/null +++ b/ports/atmel-samd/common-hal/sdioio/SDCard.c @@ -0,0 +1,272 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "py/mperrno.h" +#include "py/runtime.h" + +#include "boards/board.h" +#include "common-hal/microcontroller/Pin.h" +#include "shared-bindings/sdioio/SDCard.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/__init__.h" +#include "supervisor/shared/translate.h" + +#include "genhdr/sdiodata.h" + +#include "sd_mmc/sd_mmc.h" +#include "sd_mmc/conf_sd_mmc.h" +#include "peripheral_clk_config.h" + +#ifndef DEBUG_SDIO +#define DEBUG_SDIO (1) +#endif + +#if DEBUG_SDIO +#define DEBUG_PRINT(...) ((void)mp_printf(&mp_plat_print, __VA_ARGS__)) +#define DEBUG_PRINT_OBJ(o) ((void)mp_obj_print_helper(&mp_plat_print, (mp_obj_t)o, PRINT_REPR)) +#else +#define DEBUG_PRINT(...) ((void)0) +#define DEBUG_PRINT_OBJ(...) ((void)0) +#endif +#define DEBUG_PRINT_OBJ_NL(o) (DEBUG_PRINT_OBJ(o), DEBUG_PRINT("\n")) + +#define GPIO_PIN_FUNCTION_SDIO (GPIO_PIN_FUNCTION_I) + +static Sdhc *sdhc_insts[] = SDHC_INSTS; + +STATIC pin_function_t *find_pin_function(pin_function_t *table, const mcu_pin_obj_t *pin, int instance, uint16_t name) { + DEBUG_PRINT("\n\n[inst=% 2d] %q: ", instance, name); + DEBUG_PRINT_OBJ_NL(pin); + + for(; table->obj; table++) { + DEBUG_PRINT("[inst=% 2d] considering table @%p: "); + DEBUG_PRINT_OBJ(table->obj); + DEBUG_PRINT(" %d %d\n", table->instance, table->pin); + if (instance != -1 && instance != table->instance) { + continue; + } + if (pin == table->obj) { + return table; + } + } + mp_raise_ValueError_varg(translate("%q pin invalid"), name); +} + +void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, + const mcu_pin_obj_t * clock, const mcu_pin_obj_t * command, + uint8_t num_data, mcu_pin_obj_t ** data, uint32_t frequency) { + /* +SD breakout as assembled ("*" = minimum viable set) + +PURPLE 9 DAT2 SDA +BLUE 1 DAT3 SCL +GREEN 2 CMD * D32 +YELLOW 3 VSS1 +RED 4 VDD * 3.3V +BROWN 5 CLK * BROWN +BLACK 6 VSS2 * GND +WHITE 7 DAT0 * D8 +GREY 8 DAT1 D29 + +DAT0..3 PB18..21 (D8 D29 D20 D21) WHITE GREY PURPLE BLUE +CMD PA20 PCC_D? (D33) GREEN +CLK PA21 PCC_D? (D32) BROWN + +*/ + + pin_function_t *functions[6] = {}; + functions[0] = find_pin_function(sdio_cmd, command, -1, MP_QSTR_command); + int instance = functions[0]->instance; + functions[1] = find_pin_function(sdio_ck, clock, instance, MP_QSTR_clock); + functions[2] = find_pin_function(sdio_dat0, data[0], instance, MP_QSTR_data0); + if(num_data == 4) { + functions[3] = find_pin_function(sdio_dat1, data[1], instance, MP_QSTR_data1); + functions[4] = find_pin_function(sdio_dat2, data[2], instance, MP_QSTR_data2); + functions[5] = find_pin_function(sdio_dat3, data[3], instance, MP_QSTR_data3); + } + + // We've verified all pins, now set their special functions + self->command_pin = common_hal_mcu_pin_number(functions[0]->obj); + self->clock_pin = common_hal_mcu_pin_number(functions[1]->obj); + + for(int i=0; idata_pins[i] = common_hal_mcu_pin_number(function->obj); + } else { + self->data_pins[i] = COMMON_HAL_MCU_NO_PIN; + } + } + + for(size_t i=0; iobj) { + break; + } + + gpio_set_pin_direction(functions[i]->pin, GPIO_DIRECTION_OUT); + gpio_set_pin_level(functions[i]->pin, false); + // Enable pullups on all pins except CLK and DAT3 + 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; + self->frequency = frequency; + + if(instance == 0) { + hri_mclk_set_AHBMASK_SDHC0_bit(MCLK); + hri_gclk_write_PCHCTRL_reg(GCLK, SDHC0_GCLK_ID, CONF_GCLK_SDHC0_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); + hri_gclk_write_PCHCTRL_reg(GCLK, SDHC0_GCLK_ID_SLOW, CONF_GCLK_SDHC0_SLOW_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); + } else { +#ifdef SDHC1_GCLK_ID + hri_mclk_set_AHBMASK_SDHC1_bit(MCLK); + hri_gclk_write_PCHCTRL_reg(GCLK, SDHC1_GCLK_ID, CONF_GCLK_SDHC1_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); + hri_gclk_write_PCHCTRL_reg(GCLK, SDHC1_GCLK_ID_SLOW, CONF_GCLK_SDHC1_SLOW_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); +#endif + } + + DEBUG_PRINT("instance %d @%p\n", instance, sdhc_insts[instance]); + mci_sync_init(&self->IO_BUS, sdhc_insts[instance]); + sd_mmc_init(&self->IO_BUS, NULL, NULL); + + sd_mmc_err_t result = SD_MMC_INIT_ONGOING; + + for (int i=0; result == SD_MMC_INIT_ONGOING && i<100; i++) { + result = sd_mmc_check(0); + DEBUG_PRINT("sd_mmc_check(0) -> %d\n", result); + } + + if (result != SD_MMC_OK) { + 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 + self->capacity = sd_mmc_get_capacity(0) * 2; + + DEBUG_PRINT("capacity=%u\n", self->capacity); +} + +uint32_t common_hal_sdioio_sdcard_get_count(sdioio_sdcard_obj_t *self) { + return self->capacity; +} + +uint32_t common_hal_sdioio_sdcard_get_frequency(sdioio_sdcard_obj_t *self) { + return self->frequency; // self->frequency; +} + +uint8_t common_hal_sdioio_sdcard_get_width(sdioio_sdcard_obj_t *self) { + return self->num_data; // self->width; +} + +STATIC void check_for_deinit(sdioio_sdcard_obj_t *self) { +} + +STATIC void check_whole_block(mp_buffer_info_t *bufinfo) { + if (bufinfo->len % 512) { + mp_raise_ValueError(translate("Buffer length must be a multiple of 512")); + } +} + +STATIC void wait_write_complete(sdioio_sdcard_obj_t *self) { + if (self->state_programming) { + sd_mmc_wait_end_of_write_blocks(0); + self->state_programming = 0; + } +} + +STATIC void debug_print_state(sdioio_sdcard_obj_t *self, const char *what, sd_mmc_err_t r) { +#if DEBUG_SDIO + DEBUG_PRINT("%s: %d\n", what, r); +#endif +} + +int common_hal_sdioio_sdcard_writeblocks(sdioio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *bufinfo) { + check_for_deinit(self); + check_whole_block(bufinfo); + wait_write_complete(self); + self->state_programming = true; + sd_mmc_err_t r = sd_mmc_init_write_blocks(0, start_block, bufinfo->len / 512); + if (r != SD_MMC_OK) { + debug_print_state(self, "sd_mmc_init_write_blocks", r); + return -EIO; + } + r = sd_mmc_start_write_blocks(bufinfo->buf, bufinfo->len / 512); + if (r != SD_MMC_OK) { + debug_print_state(self, "sd_mmc_start_write_blocks", r); + return -EIO; + } + // debug_print_state(self, "after writeblocks OK"); + return 0; +} + +int common_hal_sdioio_sdcard_readblocks(sdioio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *bufinfo) { + check_for_deinit(self); + check_whole_block(bufinfo); + wait_write_complete(self); + sd_mmc_err_t r = sd_mmc_init_read_blocks(0, start_block, bufinfo->len / 512); + if (r != SD_MMC_OK) { + debug_print_state(self, "sd_mmc_init_read_blocks", r); + return -EIO; + } + r = sd_mmc_start_read_blocks(bufinfo->buf, bufinfo->len / 512); + if (r != SD_MMC_OK) { + debug_print_state(self, "sd_mmc_start_read_blocks", r); + return -EIO; + } + sd_mmc_wait_end_of_write_blocks(0); + return 0; +} + +bool common_hal_sdioio_sdcard_configure(sdioio_sdcard_obj_t *self, uint32_t frequency, uint8_t bits) { + check_for_deinit(self); + return true; +} + +bool common_hal_sdioio_sdcard_deinited(sdioio_sdcard_obj_t *self) { + return self->command_pin == COMMON_HAL_MCU_NO_PIN; +} + +void common_hal_sdioio_sdcard_deinit(sdioio_sdcard_obj_t *self) { + reset_pin_number(self->command_pin); + reset_pin_number(self->clock_pin); + reset_pin_number(self->data_pins[0]); + reset_pin_number(self->data_pins[1]); + reset_pin_number(self->data_pins[2]); + reset_pin_number(self->data_pins[3]); + + self->command_pin = COMMON_HAL_MCU_NO_PIN; + self->clock_pin = COMMON_HAL_MCU_NO_PIN; + self->data_pins[0] = COMMON_HAL_MCU_NO_PIN; + self->data_pins[1] = COMMON_HAL_MCU_NO_PIN; + self->data_pins[2] = COMMON_HAL_MCU_NO_PIN; + self->data_pins[3] = COMMON_HAL_MCU_NO_PIN; +} + +void common_hal_sdioio_sdcard_never_reset(sdioio_sdcard_obj_t *self) { +} diff --git a/ports/atmel-samd/common-hal/sdioio/SDCard.h b/ports/atmel-samd/common-hal/sdioio/SDCard.h new file mode 100644 index 0000000000..2baba38f0d --- /dev/null +++ b/ports/atmel-samd/common-hal/sdioio/SDCard.h @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * 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 "hal_mci_sync.h" + +typedef struct { + mp_obj_base_t base; + struct mci_sync_desc IO_BUS; + uint32_t frequency; + uint32_t capacity; + uint8_t num_data:3, state_programming:1, has_lock:1; + uint8_t command_pin; + uint8_t clock_pin; + uint8_t data_pins[4]; +} sdioio_sdcard_obj_t; diff --git a/ports/atmel-samd/common-hal/sdioio/__init__.c b/ports/atmel-samd/common-hal/sdioio/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/atmel-samd/common-hal/sdioio/__init__.h b/ports/atmel-samd/common-hal/sdioio/__init__.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tools/mksdiodata.py b/tools/mksdiodata.py new file mode 100755 index 0000000000..0cce3819f3 --- /dev/null +++ b/tools/mksdiodata.py @@ -0,0 +1,40 @@ +#!/usr/bin/python3 + +def defines(name, function): + print(f'pin_function_t {name} [] = {{') + for instance in (0, 1): + for port in 'ABCD': + for idx in range(32): + pin = f'P{port}{idx:02d}' + pinmux = f'PINMUX_{pin}I_SDHC{instance}_{function}' + print(f'''\ +#if defined({pinmux}) && ! defined(IGNORE_PIN_{pin}) + {{&pin_{pin}, {instance}, PIN_{pin}, {pinmux} & 0xffff}}, +#endif''') + print(f'{{NULL, 0, 0}}') + print(f'}};') + print() + +print('''\ +#include +#include "py/obj.h" +#include "sam.h" +#include "samd/pins.h" +#include "mpconfigport.h" +#include "atmel_start_pins.h" +#include "hal/include/hal_gpio.h" + +typedef struct { + const mcu_pin_obj_t *obj; + uint8_t instance; + uint8_t pin; + uint16_t function; +} pin_function_t; +''') + +defines('sdio_ck', 'SDCK') +defines('sdio_cmd', 'SDCMD') +defines('sdio_dat0', 'SDDAT0') +defines('sdio_dat1', 'SDDAT1') +defines('sdio_dat2', 'SDDAT2') +defines('sdio_dat3', 'SDDAT3') From 0f2fb93d1416b0be1c9a2f94b0ef25eda8b05d1f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 26 Jun 2020 13:15:30 -0500 Subject: [PATCH 0107/1293] Update shared-bindings/sdcardio/SDCard.c Co-authored-by: Scott Shawcroft --- shared-bindings/sdcardio/SDCard.c | 1 - 1 file changed, 1 deletion(-) diff --git a/shared-bindings/sdcardio/SDCard.c b/shared-bindings/sdcardio/SDCard.c index 54ca39f806..1d8c4bafbe 100644 --- a/shared-bindings/sdcardio/SDCard.c +++ b/shared-bindings/sdcardio/SDCard.c @@ -50,7 +50,6 @@ //| :param busio.SPI spi: The SPI bus //| :param microcontroller.Pin cs: The chip select connected to the card //| :param int baudrate: The SPI data rate to use after card setup -//| :param busio.SDIO sdio: The SDIO bus. Mutually exclusive with spi and cs. //| //| Note that during detection and configuration, a hard-coded low baudrate is used. //| Data transfers use the specified baurate (rounded down to one that is supported by From c5db97c50f3dd2a8d71958b22efe9fe728e0d7f4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 26 Jun 2020 13:16:16 -0500 Subject: [PATCH 0108/1293] atmel-sam: sdio: disable debug prints by default --- ports/atmel-samd/common-hal/sdioio/SDCard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/common-hal/sdioio/SDCard.c b/ports/atmel-samd/common-hal/sdioio/SDCard.c index 6014bd8abf..8cd077ecd7 100644 --- a/ports/atmel-samd/common-hal/sdioio/SDCard.c +++ b/ports/atmel-samd/common-hal/sdioio/SDCard.c @@ -42,7 +42,7 @@ #include "peripheral_clk_config.h" #ifndef DEBUG_SDIO -#define DEBUG_SDIO (1) +#define DEBUG_SDIO (0) #endif #if DEBUG_SDIO From 472a04ba4bd107575b42cab102e4849d6943779e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 26 Jun 2020 13:17:00 -0500 Subject: [PATCH 0109/1293] sdioio: Remove junk in comments --- shared-bindings/sdioio/SDCard.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/shared-bindings/sdioio/SDCard.c b/shared-bindings/sdioio/SDCard.c index c6b1d280ba..77b41ce127 100644 --- a/shared-bindings/sdioio/SDCard.c +++ b/shared-bindings/sdioio/SDCard.c @@ -285,20 +285,6 @@ STATIC const mp_rom_map_elem_t sdioio_sdcard_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_count), MP_ROM_PTR(&sdioio_sdcard_count_obj) }, { MP_ROM_QSTR(MP_QSTR_readblocks), MP_ROM_PTR(&sdioio_sdcard_readblocks_obj) }, { MP_ROM_QSTR(MP_QSTR_writeblocks), MP_ROM_PTR(&sdioio_sdcard_writeblocks_obj) }, - -// Methods in STM HAL: -// InitCard -// ReadBlocks -// WriteBlocks -// Erase -// GetCardState -// GetCardCID -// GetCardCSD -// GetCardInfo -// GetState -// GetError -// Abort - }; STATIC MP_DEFINE_CONST_DICT(sdioio_sdcard_locals_dict, sdioio_sdcard_locals_dict_table); From a9f257bcd645b342bdc473e0ab2804a3c099126c Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 26 Jun 2020 12:32:56 -0700 Subject: [PATCH 0110/1293] Store host_id so that never reset works --- ports/esp32s2/common-hal/busio/SPI.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index 686f44cbc2..60514df389 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -160,6 +160,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->clock_pin = clock; self->MOSI_pin = mosi; self->MISO_pin = miso; + self->host_id = host_id; spi_bus_lock_dev_config_t config = { .flags = 0 }; // The returned lock is stored in the bus lock but must be freed separately with From 2d579cc9953a3ba965973c6d5139c007b3c1b38d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 26 Jun 2020 12:33:50 -0700 Subject: [PATCH 0111/1293] Use NULL for deinited DigitalInOut This fixes a Display issue where no backlight pin is given but it's still deinitialized. --- ports/esp32s2/common-hal/digitalio/DigitalInOut.c | 4 ++-- ports/litex/common-hal/digitalio/DigitalInOut.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c index 7745a9c0a3..fb3ee10ad7 100644 --- a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c +++ b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c @@ -46,7 +46,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct( } bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self) { @@ -55,7 +55,7 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self } reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } void common_hal_digitalio_digitalinout_switch_to_input( diff --git a/ports/litex/common-hal/digitalio/DigitalInOut.c b/ports/litex/common-hal/digitalio/DigitalInOut.c index 26f79f16df..53df637c43 100644 --- a/ports/litex/common-hal/digitalio/DigitalInOut.c +++ b/ports/litex/common-hal/digitalio/DigitalInOut.c @@ -46,7 +46,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct( } bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self) { @@ -55,7 +55,7 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self } // reset_pin_number(0, self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } void common_hal_digitalio_digitalinout_switch_to_input( From 2019d47ed5b70eaf4da4175b9db47be7ba5f0441 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 26 Jun 2020 15:04:04 -0500 Subject: [PATCH 0112/1293] redirects.txt: sort according to LANG=C.UTF-8 collation rules --- docs/redirects.txt | 144 ++++++++++++++++++++++----------------------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/docs/redirects.txt b/docs/redirects.txt index 28dc73aba2..20c730df43 100644 --- a/docs/redirects.txt +++ b/docs/redirects.txt @@ -1,15 +1,48 @@ -shared-bindings/frequencyio/FrequencyIn.rst shared-bindings/frequencyio/#frequencyio.FrequencyIn -shared-bindings/fontio/BuiltinFont.rst shared-bindings/fontio/#fontio.BuiltinFont -shared-bindings/fontio/Glyph.rst shared-bindings/fontio/#fontio.Glyph +shared-bindings/_bleio/Adapter.rst shared-bindings/_bleio/#_bleio.Adapter +shared-bindings/_bleio/Address.rst shared-bindings/_bleio/#_bleio.Address +shared-bindings/_bleio/Attribute.rst shared-bindings/_bleio/#_bleio.Attribute +shared-bindings/_bleio/BluetoothError.rst shared-bindings/_bleio/#_bleio.BluetoothError +shared-bindings/_bleio/Characteristic.rst shared-bindings/_bleio/#_bleio.Characteristic +shared-bindings/_bleio/CharacteristicBuffer.rst shared-bindings/_bleio/#_bleio.CharacteristicBuffer +shared-bindings/_bleio/Connection.rst shared-bindings/_bleio/#_bleio.Connection +shared-bindings/_bleio/ConnectionError.rst shared-bindings/_bleio/#_bleio.ConnectionError +shared-bindings/_bleio/Descriptor.rst shared-bindings/_bleio/#_bleio.Descriptor +shared-bindings/_bleio/PacketBuffer.rst shared-bindings/_bleio/#_bleio.PacketBuffer +shared-bindings/_bleio/RoleError.rst shared-bindings/_bleio/#_bleio.RoleError +shared-bindings/_bleio/ScanEntry.rst shared-bindings/_bleio/#_bleio.ScanEntry +shared-bindings/_bleio/ScanResults.rst shared-bindings/_bleio/#_bleio.ScanResults +shared-bindings/_bleio/SecurityError.rst shared-bindings/_bleio/#_bleio.SecurityError +shared-bindings/_bleio/Service.rst shared-bindings/_bleio/#_bleio.Service +shared-bindings/_bleio/UUID.rst shared-bindings/_bleio/#_bleio.UUID +shared-bindings/_pew/PewPew.rst shared-bindings/_pew/#_pew.PewPew +shared-bindings/_pixelbuf/PixelBuf.rst shared-bindings/_pixelbuf/#_pixelbuf.PixelBuf +shared-bindings/_stage/Layer.rst shared-bindings/_stage/#_stage.Layer +shared-bindings/_stage/Text.rst shared-bindings/_stage/#_stage.Text shared-bindings/aesio/AES.rst shared-bindings/aesio/#aesio.AES -shared-bindings/supervisor/Runtime.rst shared-bindings/supervisor/#supervisor.Runtime -shared-bindings/terminalio/Terminal.rst shared-bindings/terminalio/#terminalio.Terminal +shared-bindings/analogio/AnalogIn.rst shared-bindings/analogio/#analogio.AnalogIn +shared-bindings/analogio/AnalogOut.rst shared-bindings/analogio/#analogio.AnalogOut +shared-bindings/audiobusio/I2SOut.rst shared-bindings/audiobusio/#audiobusio.I2SOut +shared-bindings/audiobusio/PDMIn.rst shared-bindings/audiobusio/#audiobusio.PDMIn +shared-bindings/audiocore/RawSample.rst shared-bindings/audiocore/#audiocore.RawSample +shared-bindings/audiocore/WaveFile.rst shared-bindings/audiocore/#audiocore.WaveFile +shared-bindings/audioio/AudioOut.rst shared-bindings/audioio/#audioio.AudioOut +shared-bindings/audiomixer/Mixer.rst shared-bindings/audiomixer/#audiomixer.Mixer +shared-bindings/audiomixer/MixerVoice.rst shared-bindings/audiomixer/#audiomixer.MixerVoice +shared-bindings/audiomp3/MP3.rst shared-bindings/audiomp3/#audiomp3.MP3 shared-bindings/audiopwmio/PWMAudioOut.rst shared-bindings/audiopwmio/#audiopwmio.PWMAudioOut -shared-bindings/gamepadshift/GamePadShift.rst shared-bindings/gamepadshift/#gamepadshift.GamePadShift -shared-bindings/vectorio/Circle.rst shared-bindings/vectorio/#vectorio.Circle -shared-bindings/vectorio/Polygon.rst shared-bindings/vectorio/#vectorio.Polygon -shared-bindings/vectorio/Rectangle.rst shared-bindings/vectorio/#vectorio.Rectangle -shared-bindings/vectorio/VectorShape.rst shared-bindings/vectorio/#vectorio.VectorShape +shared-bindings/bitbangio/I2C.rst shared-bindings/bitbangio/#bitbangio.I2C +shared-bindings/bitbangio/OneWire.rst shared-bindings/bitbangio/#bitbangio.OneWire +shared-bindings/bitbangio/SPI.rst shared-bindings/bitbangio/#bitbangio.SPI +shared-bindings/busio/I2C.rst shared-bindings/busio/#busio.I2C +shared-bindings/busio/OneWire.rst shared-bindings/busio/#busio.OneWire +shared-bindings/busio/Parity.rst shared-bindings/busio/#busio.Parity +shared-bindings/busio/SPI.rst shared-bindings/busio/#busio.SPI +shared-bindings/busio/UART.rst shared-bindings/busio/#busio.UART +shared-bindings/countio/Counter.rst shared-bindings/countio/#countio.Counter +shared-bindings/digitalio/DigitalInOut.rst shared-bindings/digitalio/#digitalio.DigitalInOut +shared-bindings/digitalio/Direction.rst shared-bindings/digitalio/#digitalio.Direction +shared-bindings/digitalio/DriveMode.rst shared-bindings/digitalio/#digitalio.DriveMode +shared-bindings/digitalio/Pull.rst shared-bindings/digitalio/#digitalio.Pull shared-bindings/displayio/Bitmap.rst shared-bindings/displayio/#displayio.Bitmap shared-bindings/displayio/ColorConverter.rst shared-bindings/displayio/#displayio.ColorConverter shared-bindings/displayio/Display.rst shared-bindings/displayio/#displayio.Display @@ -22,73 +55,40 @@ shared-bindings/displayio/Palette.rst shared-bindings/displayio/#displayio.Palet shared-bindings/displayio/ParallelBus.rst shared-bindings/displayio/#displayio.ParallelBus shared-bindings/displayio/Shape.rst shared-bindings/displayio/#displayio.Shape shared-bindings/displayio/TileGrid.rst shared-bindings/displayio/#displayio.TileGrid -shared-bindings/_pixelbuf/PixelBuf.rst shared-bindings/_pixelbuf/#_pixelbuf.PixelBuf +shared-bindings/fontio/BuiltinFont.rst shared-bindings/fontio/#fontio.BuiltinFont +shared-bindings/fontio/Glyph.rst shared-bindings/fontio/#fontio.Glyph +shared-bindings/framebufferio/FramebufferDisplay.rst shared-bindings/framebufferio/#framebufferio.FramebufferDisplay +shared-bindings/frequencyio/FrequencyIn.rst shared-bindings/frequencyio/#frequencyio.FrequencyIn shared-bindings/gamepad/GamePad.rst shared-bindings/gamepad/#gamepad.GamePad -shared-bindings/_pew/PewPew.rst shared-bindings/_pew/#_pew.PewPew -shared-bindings/rotaryio/IncrementalEncoder.rst shared-bindings/rotaryio/#rotaryio.IncrementalEncoder -shared-bindings/audiomixer/Mixer.rst shared-bindings/audiomixer/#audiomixer.Mixer -shared-bindings/audiomixer/MixerVoice.rst shared-bindings/audiomixer/#audiomixer.MixerVoice -shared-bindings/pulseio/PWMOut.rst shared-bindings/pulseio/#pulseio.PWMOut -shared-bindings/pulseio/PulseIn.rst shared-bindings/pulseio/#pulseio.PulseIn -shared-bindings/pulseio/PulseOut.rst shared-bindings/pulseio/#pulseio.PulseOut -shared-bindings/time/struct_time.rst shared-bindings/time/#time.struct_time +shared-bindings/gamepadshift/GamePadShift.rst shared-bindings/gamepadshift/#gamepadshift.GamePadShift shared-bindings/i2cslave/I2CSlave.rst shared-bindings/i2cperipheral/#i2cperipheral.I2CPeripheral shared-bindings/i2cslave/I2CSlaveRequest.rst shared-bindings/i2cperipheral/#i2cperipheral.I2CPeripheralRequest -shared-bindings/nvm/ByteArray.rst shared-bindings/nvm/#nvm.ByteArray -shared-bindings/busio/I2C.rst shared-bindings/busio/#busio.I2C -shared-bindings/busio/OneWire.rst shared-bindings/busio/#busio.OneWire -shared-bindings/busio/SPI.rst shared-bindings/busio/#busio.SPI -shared-bindings/busio/UART.rst shared-bindings/busio/#busio.UART -shared-bindings/busio/Parity.rst shared-bindings/busio/#busio.Parity -shared-bindings/ulab/array.rst shared-bindings/ulab/#ulab.array -shared-bindings/watchdog/WatchDogMode.rst shared-bindings/watchdog/#watchdog.WatchDogMode -shared-bindings/watchdog/WatchDogTimer.rst shared-bindings/watchdog/#watchdog.WatchDogTimer -shared-bindings/audioio/AudioOut.rst shared-bindings/audioio/#audioio.AudioOut -shared-bindings/ps2io/Ps2.rst shared-bindings/ps2io/#ps2io.Ps2 -shared-bindings/touchio/TouchIn.rst shared-bindings/touchio/#touchio.TouchIn -shared-bindings/rgbmatrix/RGBMatrix.rst shared-bindings/rgbmatrix/#rgbmatrix.RGBMatrix -shared-bindings/audiomp3/MP3.rst shared-bindings/audiomp3/#audiomp3.MP3 -shared-bindings/usb_midi/PortIn.rst shared-bindings/usb_midi/#usb_midi.PortIn -shared-bindings/usb_midi/PortOut.rst shared-bindings/usb_midi/#usb_midi.PortOut -shared-bindings/usb_hid/Device.rst shared-bindings/usb_hid/#usb_hid.Device -shared-bindings/wiznet/WIZNET5K.rst shared-bindings/wiznet/#wiznet.WIZNET5K -shared-bindings/_bleio/BluetoothError.rst shared-bindings/_bleio/#_bleio.BluetoothError -shared-bindings/_bleio/ConnectionError.rst shared-bindings/_bleio/#_bleio.ConnectionError -shared-bindings/_bleio/RoleError.rst shared-bindings/_bleio/#_bleio.RoleError -shared-bindings/_bleio/SecurityError.rst shared-bindings/_bleio/#_bleio.SecurityError -shared-bindings/_bleio/Adapter.rst shared-bindings/_bleio/#_bleio.Adapter -shared-bindings/_bleio/Address.rst shared-bindings/_bleio/#_bleio.Address -shared-bindings/_bleio/Attribute.rst shared-bindings/_bleio/#_bleio.Attribute -shared-bindings/_bleio/Characteristic.rst shared-bindings/_bleio/#_bleio.Characteristic -shared-bindings/_bleio/CharacteristicBuffer.rst shared-bindings/_bleio/#_bleio.CharacteristicBuffer -shared-bindings/_bleio/Connection.rst shared-bindings/_bleio/#_bleio.Connection -shared-bindings/_bleio/Descriptor.rst shared-bindings/_bleio/#_bleio.Descriptor -shared-bindings/_bleio/PacketBuffer.rst shared-bindings/_bleio/#_bleio.PacketBuffer -shared-bindings/_bleio/ScanEntry.rst shared-bindings/_bleio/#_bleio.ScanEntry -shared-bindings/_bleio/ScanResults.rst shared-bindings/_bleio/#_bleio.ScanResults -shared-bindings/_bleio/Service.rst shared-bindings/_bleio/#_bleio.Service -shared-bindings/_bleio/UUID.rst shared-bindings/_bleio/#_bleio.UUID -shared-bindings/socket/socket.rst shared-bindings/socket/#socket.socket shared-bindings/microcontroller/Pin.rst shared-bindings/microcontroller/#microcontroller.Pin shared-bindings/microcontroller/Processor.rst shared-bindings/microcontroller/#microcontroller.Processor shared-bindings/microcontroller/RunMode.rst shared-bindings/microcontroller/#microcontroller.RunMode -shared-bindings/audiocore/RawSample.rst shared-bindings/audiocore/#audiocore.RawSample -shared-bindings/audiocore/WaveFile.rst shared-bindings/audiocore/#audiocore.WaveFile -shared-bindings/framebufferio/FramebufferDisplay.rst shared-bindings/framebufferio/#framebufferio.FramebufferDisplay -shared-bindings/audiobusio/I2SOut.rst shared-bindings/audiobusio/#audiobusio.I2SOut -shared-bindings/audiobusio/PDMIn.rst shared-bindings/audiobusio/#audiobusio.PDMIn -shared-bindings/countio/Counter.rst shared-bindings/countio/#countio.Counter -shared-bindings/storage/VfsFat.rst shared-bindings/storage/#storage.VfsFat -shared-bindings/digitalio/DigitalInOut.rst shared-bindings/digitalio/#digitalio.DigitalInOut -shared-bindings/digitalio/Direction.rst shared-bindings/digitalio/#digitalio.Direction -shared-bindings/digitalio/DriveMode.rst shared-bindings/digitalio/#digitalio.DriveMode -shared-bindings/digitalio/Pull.rst shared-bindings/digitalio/#digitalio.Pull -shared-bindings/bitbangio/I2C.rst shared-bindings/bitbangio/#bitbangio.I2C -shared-bindings/bitbangio/OneWire.rst shared-bindings/bitbangio/#bitbangio.OneWire -shared-bindings/bitbangio/SPI.rst shared-bindings/bitbangio/#bitbangio.SPI +shared-bindings/nvm/ByteArray.rst shared-bindings/nvm/#nvm.ByteArray +shared-bindings/ps2io/Ps2.rst shared-bindings/ps2io/#ps2io.Ps2 +shared-bindings/pulseio/PWMOut.rst shared-bindings/pulseio/#pulseio.PWMOut +shared-bindings/pulseio/PulseIn.rst shared-bindings/pulseio/#pulseio.PulseIn +shared-bindings/pulseio/PulseOut.rst shared-bindings/pulseio/#pulseio.PulseOut +shared-bindings/rgbmatrix/RGBMatrix.rst shared-bindings/rgbmatrix/#rgbmatrix.RGBMatrix +shared-bindings/rotaryio/IncrementalEncoder.rst shared-bindings/rotaryio/#rotaryio.IncrementalEncoder shared-bindings/rtc/RTC.rst shared-bindings/rtc/#rtc.RTC -shared-bindings/analogio/AnalogIn.rst shared-bindings/analogio/#analogio.AnalogIn -shared-bindings/analogio/AnalogOut.rst shared-bindings/analogio/#analogio.AnalogOut -shared-bindings/_stage/Layer.rst shared-bindings/_stage/#_stage.Layer -shared-bindings/_stage/Text.rst shared-bindings/_stage/#_stage.Text shared-bindings/samd/Clock.rst shared-bindings/samd/#samd.Clock +shared-bindings/socket/socket.rst shared-bindings/socket/#socket.socket +shared-bindings/storage/VfsFat.rst shared-bindings/storage/#storage.VfsFat +shared-bindings/supervisor/Runtime.rst shared-bindings/supervisor/#supervisor.Runtime +shared-bindings/terminalio/Terminal.rst shared-bindings/terminalio/#terminalio.Terminal +shared-bindings/time/struct_time.rst shared-bindings/time/#time.struct_time +shared-bindings/touchio/TouchIn.rst shared-bindings/touchio/#touchio.TouchIn +shared-bindings/ulab/array.rst shared-bindings/ulab/#ulab.array +shared-bindings/usb_hid/Device.rst shared-bindings/usb_hid/#usb_hid.Device +shared-bindings/usb_midi/PortIn.rst shared-bindings/usb_midi/#usb_midi.PortIn +shared-bindings/usb_midi/PortOut.rst shared-bindings/usb_midi/#usb_midi.PortOut +shared-bindings/vectorio/Circle.rst shared-bindings/vectorio/#vectorio.Circle +shared-bindings/vectorio/Polygon.rst shared-bindings/vectorio/#vectorio.Polygon +shared-bindings/vectorio/Rectangle.rst shared-bindings/vectorio/#vectorio.Rectangle +shared-bindings/vectorio/VectorShape.rst shared-bindings/vectorio/#vectorio.VectorShape +shared-bindings/watchdog/WatchDogMode.rst shared-bindings/watchdog/#watchdog.WatchDogMode +shared-bindings/watchdog/WatchDogTimer.rst shared-bindings/watchdog/#watchdog.WatchDogTimer +shared-bindings/wiznet/WIZNET5K.rst shared-bindings/wiznet/#wiznet.WIZNET5K From 844f575a90630fa75f37abf0c089e638f98ec54e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 26 Jun 2020 15:06:22 -0500 Subject: [PATCH 0113/1293] redirects: Add __init__ page redirects --- docs/redirects.txt | 67 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/docs/redirects.txt b/docs/redirects.txt index 20c730df43..75965eff9b 100644 --- a/docs/redirects.txt +++ b/docs/redirects.txt @@ -1,3 +1,4 @@ +shared-bindings//__init__.rst shared-bindings// shared-bindings/_bleio/Adapter.rst shared-bindings/_bleio/#_bleio.Adapter shared-bindings/_bleio/Address.rst shared-bindings/_bleio/#_bleio.Address shared-bindings/_bleio/Attribute.rst shared-bindings/_bleio/#_bleio.Attribute @@ -14,35 +15,53 @@ shared-bindings/_bleio/ScanResults.rst shared-bindings/_bleio/#_bleio.ScanResult shared-bindings/_bleio/SecurityError.rst shared-bindings/_bleio/#_bleio.SecurityError shared-bindings/_bleio/Service.rst shared-bindings/_bleio/#_bleio.Service shared-bindings/_bleio/UUID.rst shared-bindings/_bleio/#_bleio.UUID +shared-bindings/_bleio/__init__.rst shared-bindings/_bleio/ +shared-bindings/_eve/__init__.rst shared-bindings/_eve/ shared-bindings/_pew/PewPew.rst shared-bindings/_pew/#_pew.PewPew +shared-bindings/_pew/__init__.rst shared-bindings/_pew/ shared-bindings/_pixelbuf/PixelBuf.rst shared-bindings/_pixelbuf/#_pixelbuf.PixelBuf +shared-bindings/_pixelbuf/__init__.rst shared-bindings/_pixelbuf/ shared-bindings/_stage/Layer.rst shared-bindings/_stage/#_stage.Layer shared-bindings/_stage/Text.rst shared-bindings/_stage/#_stage.Text +shared-bindings/_stage/__init__.rst shared-bindings/_stage/ shared-bindings/aesio/AES.rst shared-bindings/aesio/#aesio.AES +shared-bindings/aesio/__init__.rst shared-bindings/aesio/ shared-bindings/analogio/AnalogIn.rst shared-bindings/analogio/#analogio.AnalogIn shared-bindings/analogio/AnalogOut.rst shared-bindings/analogio/#analogio.AnalogOut +shared-bindings/analogio/__init__.rst shared-bindings/analogio/ shared-bindings/audiobusio/I2SOut.rst shared-bindings/audiobusio/#audiobusio.I2SOut shared-bindings/audiobusio/PDMIn.rst shared-bindings/audiobusio/#audiobusio.PDMIn +shared-bindings/audiobusio/__init__.rst shared-bindings/audiobusio/ shared-bindings/audiocore/RawSample.rst shared-bindings/audiocore/#audiocore.RawSample shared-bindings/audiocore/WaveFile.rst shared-bindings/audiocore/#audiocore.WaveFile +shared-bindings/audiocore/__init__.rst shared-bindings/audiocore/ shared-bindings/audioio/AudioOut.rst shared-bindings/audioio/#audioio.AudioOut +shared-bindings/audioio/__init__.rst shared-bindings/audioio/ shared-bindings/audiomixer/Mixer.rst shared-bindings/audiomixer/#audiomixer.Mixer shared-bindings/audiomixer/MixerVoice.rst shared-bindings/audiomixer/#audiomixer.MixerVoice +shared-bindings/audiomixer/__init__.rst shared-bindings/audiomixer/ shared-bindings/audiomp3/MP3.rst shared-bindings/audiomp3/#audiomp3.MP3 +shared-bindings/audiomp3/__init__.rst shared-bindings/audiomp3/ shared-bindings/audiopwmio/PWMAudioOut.rst shared-bindings/audiopwmio/#audiopwmio.PWMAudioOut +shared-bindings/audiopwmio/__init__.rst shared-bindings/audiopwmio/ shared-bindings/bitbangio/I2C.rst shared-bindings/bitbangio/#bitbangio.I2C shared-bindings/bitbangio/OneWire.rst shared-bindings/bitbangio/#bitbangio.OneWire shared-bindings/bitbangio/SPI.rst shared-bindings/bitbangio/#bitbangio.SPI +shared-bindings/bitbangio/__init__.rst shared-bindings/bitbangio/ +shared-bindings/board/__init__.rst shared-bindings/board/ shared-bindings/busio/I2C.rst shared-bindings/busio/#busio.I2C shared-bindings/busio/OneWire.rst shared-bindings/busio/#busio.OneWire shared-bindings/busio/Parity.rst shared-bindings/busio/#busio.Parity shared-bindings/busio/SPI.rst shared-bindings/busio/#busio.SPI shared-bindings/busio/UART.rst shared-bindings/busio/#busio.UART +shared-bindings/busio/__init__.rst shared-bindings/busio/ shared-bindings/countio/Counter.rst shared-bindings/countio/#countio.Counter +shared-bindings/countio/__init__.rst shared-bindings/countio/ shared-bindings/digitalio/DigitalInOut.rst shared-bindings/digitalio/#digitalio.DigitalInOut shared-bindings/digitalio/Direction.rst shared-bindings/digitalio/#digitalio.Direction shared-bindings/digitalio/DriveMode.rst shared-bindings/digitalio/#digitalio.DriveMode shared-bindings/digitalio/Pull.rst shared-bindings/digitalio/#digitalio.Pull +shared-bindings/digitalio/__init__.rst shared-bindings/digitalio/ shared-bindings/displayio/Bitmap.rst shared-bindings/displayio/#displayio.Bitmap shared-bindings/displayio/ColorConverter.rst shared-bindings/displayio/#displayio.ColorConverter shared-bindings/displayio/Display.rst shared-bindings/displayio/#displayio.Display @@ -55,40 +74,88 @@ shared-bindings/displayio/Palette.rst shared-bindings/displayio/#displayio.Palet shared-bindings/displayio/ParallelBus.rst shared-bindings/displayio/#displayio.ParallelBus shared-bindings/displayio/Shape.rst shared-bindings/displayio/#displayio.Shape shared-bindings/displayio/TileGrid.rst shared-bindings/displayio/#displayio.TileGrid +shared-bindings/displayio/__init__.rst shared-bindings/displayio/ shared-bindings/fontio/BuiltinFont.rst shared-bindings/fontio/#fontio.BuiltinFont shared-bindings/fontio/Glyph.rst shared-bindings/fontio/#fontio.Glyph +shared-bindings/fontio/__init__.rst shared-bindings/fontio/ shared-bindings/framebufferio/FramebufferDisplay.rst shared-bindings/framebufferio/#framebufferio.FramebufferDisplay +shared-bindings/framebufferio/__init__.rst shared-bindings/framebufferio/ shared-bindings/frequencyio/FrequencyIn.rst shared-bindings/frequencyio/#frequencyio.FrequencyIn +shared-bindings/frequencyio/__init__.rst shared-bindings/frequencyio/ shared-bindings/gamepad/GamePad.rst shared-bindings/gamepad/#gamepad.GamePad +shared-bindings/gamepad/__init__.rst shared-bindings/gamepad/ shared-bindings/gamepadshift/GamePadShift.rst shared-bindings/gamepadshift/#gamepadshift.GamePadShift +shared-bindings/gamepadshift/__init__.rst shared-bindings/gamepadshift/ +shared-bindings/gnss/__init__.rst shared-bindings/gnss/ +shared-bindings/i2cperipheral/__init__.rst shared-bindings/i2cperipheral/ +shared-bindings/i2csecondary/__init__.rst shared-bindings/i2csecondary/ shared-bindings/i2cslave/I2CSlave.rst shared-bindings/i2cperipheral/#i2cperipheral.I2CPeripheral shared-bindings/i2cslave/I2CSlaveRequest.rst shared-bindings/i2cperipheral/#i2cperipheral.I2CPeripheralRequest +shared-bindings/math/__init__.rst shared-bindings/math/ shared-bindings/microcontroller/Pin.rst shared-bindings/microcontroller/#microcontroller.Pin shared-bindings/microcontroller/Processor.rst shared-bindings/microcontroller/#microcontroller.Processor shared-bindings/microcontroller/RunMode.rst shared-bindings/microcontroller/#microcontroller.RunMode +shared-bindings/microcontroller/__init__.rst shared-bindings/microcontroller/ +shared-bindings/multiterminal/__init__.rst shared-bindings/multiterminal/ +shared-bindings/neopixel_write/__init__.rst shared-bindings/neopixel_write/ +shared-bindings/network/__init__.rst shared-bindings/network/ shared-bindings/nvm/ByteArray.rst shared-bindings/nvm/#nvm.ByteArray +shared-bindings/nvm/__init__.rst shared-bindings/nvm/ +shared-bindings/os/__init__.rst shared-bindings/os/ +shared-bindings/protomatter/__init__.rst shared-bindings/protomatter/ shared-bindings/ps2io/Ps2.rst shared-bindings/ps2io/#ps2io.Ps2 +shared-bindings/ps2io/__init__.rst shared-bindings/ps2io/ shared-bindings/pulseio/PWMOut.rst shared-bindings/pulseio/#pulseio.PWMOut shared-bindings/pulseio/PulseIn.rst shared-bindings/pulseio/#pulseio.PulseIn shared-bindings/pulseio/PulseOut.rst shared-bindings/pulseio/#pulseio.PulseOut +shared-bindings/pulseio/__init__.rst shared-bindings/pulseio/ +shared-bindings/random/__init__.rst shared-bindings/random/ shared-bindings/rgbmatrix/RGBMatrix.rst shared-bindings/rgbmatrix/#rgbmatrix.RGBMatrix +shared-bindings/rgbmatrix/__init__.rst shared-bindings/rgbmatrix/ shared-bindings/rotaryio/IncrementalEncoder.rst shared-bindings/rotaryio/#rotaryio.IncrementalEncoder +shared-bindings/rotaryio/__init__.rst shared-bindings/rotaryio/ shared-bindings/rtc/RTC.rst shared-bindings/rtc/#rtc.RTC +shared-bindings/rtc/__init__.rst shared-bindings/rtc/ shared-bindings/samd/Clock.rst shared-bindings/samd/#samd.Clock +shared-bindings/samd/__init__.rst shared-bindings/samd/ +shared-bindings/socket/__init__.rst shared-bindings/socket/ shared-bindings/socket/socket.rst shared-bindings/socket/#socket.socket shared-bindings/storage/VfsFat.rst shared-bindings/storage/#storage.VfsFat +shared-bindings/storage/__init__.rst shared-bindings/storage/ +shared-bindings/struct/__init__.rst shared-bindings/struct/ shared-bindings/supervisor/Runtime.rst shared-bindings/supervisor/#supervisor.Runtime +shared-bindings/supervisor/__init__.rst shared-bindings/supervisor/ shared-bindings/terminalio/Terminal.rst shared-bindings/terminalio/#terminalio.Terminal +shared-bindings/terminalio/__init__.rst shared-bindings/terminalio/ +shared-bindings/time/__init__.rst shared-bindings/time/ shared-bindings/time/struct_time.rst shared-bindings/time/#time.struct_time shared-bindings/touchio/TouchIn.rst shared-bindings/touchio/#touchio.TouchIn +shared-bindings/touchio/__init__.rst shared-bindings/touchio/ +shared-bindings/uheap/__init__.rst shared-bindings/uheap/ +shared-bindings/ulab/__init__.rst shared-bindings/ulab/ +shared-bindings/ulab/approx/__init__.rst shared-bindings/ulab/approx/ shared-bindings/ulab/array.rst shared-bindings/ulab/#ulab.array +shared-bindings/ulab/compare/__init__.rst shared-bindings/ulab/compare/ +shared-bindings/ulab/extras/__init__.rst shared-bindings/ulab/extras/ +shared-bindings/ulab/fft/__init__.rst shared-bindings/ulab/fft/ +shared-bindings/ulab/filter/__init__.rst shared-bindings/ulab/filter/ +shared-bindings/ulab/linalg/__init__.rst shared-bindings/ulab/linalg/ +shared-bindings/ulab/numerical/__init__.rst shared-bindings/ulab/numerical/ +shared-bindings/ulab/poly/__init__.rst shared-bindings/ulab/poly/ +shared-bindings/ulab/vector/__init__.rst shared-bindings/ulab/vector/ shared-bindings/usb_hid/Device.rst shared-bindings/usb_hid/#usb_hid.Device +shared-bindings/usb_hid/__init__.rst shared-bindings/usb_hid/ shared-bindings/usb_midi/PortIn.rst shared-bindings/usb_midi/#usb_midi.PortIn shared-bindings/usb_midi/PortOut.rst shared-bindings/usb_midi/#usb_midi.PortOut +shared-bindings/usb_midi/__init__.rst shared-bindings/usb_midi/ +shared-bindings/ustack/__init__.rst shared-bindings/ustack/ shared-bindings/vectorio/Circle.rst shared-bindings/vectorio/#vectorio.Circle shared-bindings/vectorio/Polygon.rst shared-bindings/vectorio/#vectorio.Polygon shared-bindings/vectorio/Rectangle.rst shared-bindings/vectorio/#vectorio.Rectangle shared-bindings/vectorio/VectorShape.rst shared-bindings/vectorio/#vectorio.VectorShape +shared-bindings/vectorio/__init__.rst shared-bindings/vectorio/ shared-bindings/watchdog/WatchDogMode.rst shared-bindings/watchdog/#watchdog.WatchDogMode shared-bindings/watchdog/WatchDogTimer.rst shared-bindings/watchdog/#watchdog.WatchDogTimer +shared-bindings/watchdog/__init__.rst shared-bindings/watchdog/ shared-bindings/wiznet/WIZNET5K.rst shared-bindings/wiznet/#wiznet.WIZNET5K +shared-bindings/wiznet/__init__.rst shared-bindings/wiznet/ From 56367b197bdf8b6d4adced23b128fb45d17fbd27 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 26 Jun 2020 15:23:42 -0500 Subject: [PATCH 0114/1293] docs: conf.py: Fix redirects for RTD --- conf.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/conf.py b/conf.py index 38546a5d0a..8e4fbb23bb 100644 --- a/conf.py +++ b/conf.py @@ -391,12 +391,13 @@ TEMPLATE = """ def generate_redirects(app): path = os.path.join(app.srcdir, app.config.redirects_file) if not os.path.exists(path): - app.info("Could not find redirects file at '%s'" % path) + logging.info("Could not find redirects file at '%s'" % path) return - if not type(app.builder) == builders.StandaloneHTMLBuilder: + logging.warn(f"Builder is {app.builder.name} ({type(app.builder)})") + if not isinstance(app.builder, builders.StandaloneHTMLBuilder): logging.warn("The 'sphinxcontib-redirects' plugin is only supported " - "by the 'html' builder. Skipping...") + "by the 'html' builder and subclasses. Skipping...") return with open(path) as redirects: From e40539cacadd2967b8cdedf79963903d0668c1ca Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 26 Jun 2020 15:28:20 -0500 Subject: [PATCH 0115/1293] docs: conf.py: fix logging about reidrects --- conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf.py b/conf.py index 8e4fbb23bb..43f689648d 100644 --- a/conf.py +++ b/conf.py @@ -391,13 +391,13 @@ TEMPLATE = """ def generate_redirects(app): path = os.path.join(app.srcdir, app.config.redirects_file) if not os.path.exists(path): - logging.info("Could not find redirects file at '%s'" % path) + logging.error("Could not find redirects file at '%s'" % path) return - logging.warn(f"Builder is {app.builder.name} ({type(app.builder)})") if not isinstance(app.builder, builders.StandaloneHTMLBuilder): logging.warn("The 'sphinxcontib-redirects' plugin is only supported " "by the 'html' builder and subclasses. Skipping...") + logging.warn(f"Builder is {app.builder.name} ({type(app.builder)})") return with open(path) as redirects: From 1bc2e979eb9ca2f3cb0eed396cc35406eceea27a Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 26 Jun 2020 17:23:20 -0400 Subject: [PATCH 0116/1293] wip; compiles; much commented out --- devices/ble_hci/common-hal/_bleio/Adapter.c | 254 ++-- devices/ble_hci/common-hal/_bleio/Adapter.h | 14 +- devices/ble_hci/common-hal/_bleio/Attribute.c | 50 +- devices/ble_hci/common-hal/_bleio/Attribute.h | 9 +- .../common-hal/_bleio/Characteristic.c | 215 +-- .../common-hal/_bleio/CharacteristicBuffer.c | 90 +- .../ble_hci/common-hal/_bleio/Connection.c | 1187 +++++++++-------- .../ble_hci/common-hal/_bleio/Connection.h | 1 - .../ble_hci/common-hal/_bleio/PacketBuffer.c | 343 ++--- devices/ble_hci/common-hal/_bleio/Service.c | 114 +- devices/ble_hci/common-hal/_bleio/UUID.c | 32 +- devices/ble_hci/common-hal/_bleio/UUID.h | 2 +- devices/ble_hci/common-hal/_bleio/__init__.c | 268 ++-- devices/ble_hci/common-hal/_bleio/__init__.h | 9 + devices/ble_hci/common-hal/_bleio/bonding.c | 306 ----- devices/ble_hci/common-hal/_bleio/bonding.h | 83 -- py/circuitpy_defns.mk | 12 + shared-bindings/_bleio/Adapter.c | 22 +- shared-bindings/_bleio/Adapter.h | 4 + 19 files changed, 1340 insertions(+), 1675 deletions(-) delete mode 100644 devices/ble_hci/common-hal/_bleio/bonding.c delete mode 100644 devices/ble_hci/common-hal/_bleio/bonding.h diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index 7e1bfe9920..adfd12845e 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -31,9 +31,8 @@ #include #include -#include "bonding.h" - #include "py/gc.h" +#include "py/mphal.h" #include "py/objstr.h" #include "py/runtime.h" #include "supervisor/shared/safe_mode.h" @@ -74,111 +73,111 @@ bleio_connection_internal_t bleio_connections[BLEIO_TOTAL_CONNECTION_COUNT]; -STATIC bool adapter_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { - // bleio_adapter_obj_t *self = (bleio_adapter_obj_t*)self_in; +// STATIC bool adapter_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { +// bleio_adapter_obj_t *self = (bleio_adapter_obj_t*)self_in; - // // For debugging. - // // mp_printf(&mp_plat_print, "Adapter event: 0x%04x\n", ble_evt->header.evt_id); +// // For debugging. +// // mp_printf(&mp_plat_print, "Adapter event: 0x%04x\n", ble_evt->header.evt_id); - // switch (ble_evt->header.evt_id) { - // case BLE_GAP_EVT_CONNECTED: { - // // Find an empty connection. One must always be available because the SD has the same - // // total connection limit. - // bleio_connection_internal_t *connection; - // for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { - // connection = &bleio_connections[i]; - // if (connection->conn_handle == BLE_CONN_HANDLE_INVALID) { - // break; - // } - // } +// switch (ble_evt->header.evt_id) { +// case BLE_GAP_EVT_CONNECTED: { +// // Find an empty connection. One must always be available because the SD has the same +// // total connection limit. +// bleio_connection_internal_t *connection; +// for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { +// connection = &bleio_connections[i]; +// if (connection->conn_handle == BLE_CONN_HANDLE_INVALID) { +// break; +// } +// } - // // Central has connected. - // ble_gap_evt_connected_t* connected = &ble_evt->evt.gap_evt.params.connected; +// // Central has connected. +// ble_gap_evt_connected_t* connected = &ble_evt->evt.gap_evt.params.connected; - // connection->conn_handle = ble_evt->evt.gap_evt.conn_handle; - // connection->connection_obj = mp_const_none; - // connection->pair_status = PAIR_NOT_PAIRED; - // connection->mtu = 0; +// connection->conn_handle = ble_evt->evt.gap_evt.conn_handle; +// connection->connection_obj = mp_const_none; +// connection->pair_status = PAIR_NOT_PAIRED; +// connection->mtu = 0; - // ble_drv_add_event_handler_entry(&connection->handler_entry, connection_on_ble_evt, connection); - // self->connection_objs = NULL; +// ble_drv_add_event_handler_entry(&connection->handler_entry, connection_on_ble_evt, connection); +// self->connection_objs = NULL; - // // Save the current connection parameters. - // memcpy(&connection->conn_params, &connected->conn_params, sizeof(ble_gap_conn_params_t)); +// // Save the current connection parameters. +// memcpy(&connection->conn_params, &connected->conn_params, sizeof(ble_gap_conn_params_t)); - // #if CIRCUITPY_VERBOSE_BLE - // ble_gap_conn_params_t *cp = &connected->conn_params; - // mp_printf(&mp_plat_print, "conn params: min_ci %d max_ci %d s_l %d sup_timeout %d\n", cp->min_conn_interval, cp->max_conn_interval, cp->slave_latency, cp->conn_sup_timeout); - // #endif +// #if CIRCUITPY_VERBOSE_BLE +// ble_gap_conn_params_t *cp = &connected->conn_params; +// mp_printf(&mp_plat_print, "conn params: min_ci %d max_ci %d s_l %d sup_timeout %d\n", cp->min_conn_interval, cp->max_conn_interval, cp->slave_latency, cp->conn_sup_timeout); +// #endif - // // See if connection interval set by Central is out of range. - // // If so, negotiate our preferred range. - // ble_gap_conn_params_t conn_params; - // sd_ble_gap_ppcp_get(&conn_params); - // if (conn_params.min_conn_interval < connected->conn_params.min_conn_interval || - // conn_params.min_conn_interval > connected->conn_params.max_conn_interval) { - // sd_ble_gap_conn_param_update(ble_evt->evt.gap_evt.conn_handle, &conn_params); - // } - // self->current_advertising_data = NULL; - // break; - // } - // case BLE_GAP_EVT_DISCONNECTED: { - // // Find the connection that was disconnected. - // bleio_connection_internal_t *connection; - // for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { - // connection = &bleio_connections[i]; - // if (connection->conn_handle == ble_evt->evt.gap_evt.conn_handle) { - // break; - // } - // } - // ble_drv_remove_event_handler(connection_on_ble_evt, connection); - // connection->conn_handle = BLE_CONN_HANDLE_INVALID; - // connection->pair_status = PAIR_NOT_PAIRED; - // if (connection->connection_obj != mp_const_none) { - // bleio_connection_obj_t* obj = connection->connection_obj; - // obj->connection = NULL; - // obj->disconnect_reason = ble_evt->evt.gap_evt.params.disconnected.reason; - // } - // self->connection_objs = NULL; +// // See if connection interval set by Central is out of range. +// // If so, negotiate our preferred range. +// ble_gap_conn_params_t conn_params; +// sd_ble_gap_ppcp_get(&conn_params); +// if (conn_params.min_conn_interval < connected->conn_params.min_conn_interval || +// conn_params.min_conn_interval > connected->conn_params.max_conn_interval) { +// sd_ble_gap_conn_param_update(ble_evt->evt.gap_evt.conn_handle, &conn_params); +// } +// self->current_advertising_data = NULL; +// break; +// } +// case BLE_GAP_EVT_DISCONNECTED: { +// // Find the connection that was disconnected. +// bleio_connection_internal_t *connection; +// for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { +// connection = &bleio_connections[i]; +// if (connection->conn_handle == ble_evt->evt.gap_evt.conn_handle) { +// break; +// } +// } +// ble_drv_remove_event_handler(connection_on_ble_evt, connection); +// connection->conn_handle = BLE_CONN_HANDLE_INVALID; +// connection->pair_status = PAIR_NOT_PAIRED; +// if (connection->connection_obj != mp_const_none) { +// bleio_connection_obj_t* obj = connection->connection_obj; +// obj->connection = NULL; +// obj->disconnect_reason = ble_evt->evt.gap_evt.params.disconnected.reason; +// } +// self->connection_objs = NULL; - // break; - // } +// break; +// } - // case BLE_GAP_EVT_ADV_SET_TERMINATED: - // self->current_advertising_data = NULL; - // break; +// case BLE_GAP_EVT_ADV_SET_TERMINATED: +// self->current_advertising_data = NULL; +// break; - // default: - // // For debugging. - // // mp_printf(&mp_plat_print, "Unhandled adapter event: 0x%04x\n", ble_evt->header.evt_id); - // return false; - // break; - // } - return true; -} +// default: +// // For debugging. +// // mp_printf(&mp_plat_print, "Unhandled adapter event: 0x%04x\n", ble_evt->header.evt_id); +// return false; +// break; +// } +// return true; +// } -STATIC void get_address(bleio_adapter_obj_t *self, ble_gap_addr_t *address) { +// STATIC void get_address(bleio_adapter_obj_t *self, ble_gap_addr_t *address) { // check_nrf_error(sd_ble_gap_addr_get(address)); -} +// } char default_ble_name[] = { 'C', 'I', 'R', 'C', 'U', 'I', 'T', 'P', 'Y', 0, 0, 0, 0 , 0}; -STATIC void bleio_adapter_reset_name(bleio_adapter_obj_t *self) { - uint8_t len = sizeof(default_ble_name) - 1; +// STATIC void bleio_adapter_reset_name(bleio_adapter_obj_t *self) { +// // uint8_t len = sizeof(default_ble_name) - 1; - ble_gap_addr_t local_address; - get_address(self, &local_address); +// // ble_gap_addr_t local_address; +// // get_address(self, &local_address); - default_ble_name[len - 4] = nibble_to_hex_lower[local_address.addr[1] >> 4 & 0xf]; - default_ble_name[len - 3] = nibble_to_hex_lower[local_address.addr[1] & 0xf]; - default_ble_name[len - 2] = nibble_to_hex_lower[local_address.addr[0] >> 4 & 0xf]; - default_ble_name[len - 1] = nibble_to_hex_lower[local_address.addr[0] & 0xf]; - default_ble_name[len] = '\0'; // for now we add null for compatibility with C ASCIIZ strings +// // default_ble_name[len - 4] = nibble_to_hex_lower[local_address.addr[1] >> 4 & 0xf]; +// // default_ble_name[len - 3] = nibble_to_hex_lower[local_address.addr[1] & 0xf]; +// // default_ble_name[len - 2] = nibble_to_hex_lower[local_address.addr[0] >> 4 & 0xf]; +// // default_ble_name[len - 1] = nibble_to_hex_lower[local_address.addr[0] & 0xf]; +// // default_ble_name[len] = '\0'; // for now we add null for compatibility with C ASCIIZ strings - common_hal_bleio_adapter_set_name(self, (char*) default_ble_name); -} +// common_hal_bleio_adapter_set_name(self, (char*) default_ble_name); +// } -void common_hal_bleio_adapter_construct(bleio_adapter_obj_t *self, mcu_pin_obj_t *tx, mcu_pin_obj_t *rx, mcu_pin_obj_t *rts, mcu_pin_obj_t *cts, uint32_t baudrate, uint32_t buffer_size, mcu_pin_obj_t* spi_cs, mcu_pin_obj_t* gpio0, mcu_pin_obj_t *reset, bool reset_high) { +void common_hal_bleio_adapter_construct(bleio_adapter_obj_t *self, const mcu_pin_obj_t *tx, const mcu_pin_obj_t *rx, const mcu_pin_obj_t *rts, const mcu_pin_obj_t *cts, uint32_t baudrate, uint32_t buffer_size, const mcu_pin_obj_t* spi_cs, const mcu_pin_obj_t* gpio0, const mcu_pin_obj_t *reset, bool reset_high) { self->tx = tx; self->rx = rx; self->rts = rts; @@ -206,9 +205,9 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable // common_hal UART takes rts and cts, but is currently not implemented for many ports. // In addition, rts and cts may be pins that are not part of the serial peripheral // used for tx and rx, so use GPIO for them. - common_hal_busio_uart_construct(&self->hci_uart, tx, rx, NULL, NULL, NULL, false, - BLEIO_HCI_BAUDRATE, 8, PARITY_NONE, 1, 0.0f, - BLEIO_HCI_BUFFER_SIZE, NULL, false); + common_hal_busio_uart_construct(&self->hci_uart, self->tx, self->rx, NULL, NULL, NULL, false, + self->baudrate, 8, PARITY_NONE, 1, 0.0f, + self->buffer_size, NULL, false); // RTS is output, active high common_hal_digitalio_digitalinout_construct(&self->rts_digitalio, self->rts); @@ -220,9 +219,9 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable // SPI_CS and GPI0 are used to signal entering BLE mode. // SPI_CS should be low, and GPI0 should be high common_hal_digitalio_digitalinout_construct(&self->spi_cs_digitalio, self->spi_cs); - common_hal_digitalio_digitalinout_construct(&self->gpio0_digitalio, self->gpi0); + common_hal_digitalio_digitalinout_construct(&self->gpio0_digitalio, self->gpio0); common_hal_digitalio_digitalinout_switch_to_output(&self->spi_cs_digitalio, false, DRIVE_MODE_PUSH_PULL); - common_hal_digitalio_digitalinout_switch_to_output(&self->gpio0_digitalio, true DRIVE_MODE_PUSH_PULL); + common_hal_digitalio_digitalinout_switch_to_output(&self->gpio0_digitalio, true, DRIVE_MODE_PUSH_PULL); // RESET is output, start in non-reset state. common_hal_digitalio_digitalinout_construct(&self->reset_digitalio, self->reset); @@ -252,7 +251,7 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable common_hal_digitalio_digitalinout_deinit(&self->rts_digitalio); common_hal_digitalio_digitalinout_deinit(&self->cts_digitalio); common_hal_digitalio_digitalinout_deinit(&self->spi_cs_digitalio); - common_hal_digitalio_digitalinout_deinit(&self->gpi0_digitalio); + common_hal_digitalio_digitalinout_deinit(&self->gpio0_digitalio); common_hal_digitalio_digitalinout_deinit(&self->reset_digitalio); } @@ -263,13 +262,13 @@ bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self) { bleio_address_obj_t *common_hal_bleio_adapter_get_address(bleio_adapter_obj_t *self) { common_hal_bleio_adapter_set_enabled(self, true); - ble_gap_addr_t local_address; - get_address(self, &local_address); + // ble_gap_addr_t local_address; + // get_address(self, &local_address); bleio_address_obj_t *address = m_new_obj(bleio_address_obj_t); address->base.type = &bleio_address_type; - common_hal_bleio_address_construct(address, local_address.addr, local_address.addr_type); + // common_hal_bleio_address_construct(address, local_address.addr, local_address.addr_type); return address; } @@ -460,12 +459,12 @@ mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_addre // sd_ble_gap_data_length_update(conn_handle, NULL, NULL); // Make the connection object and return it. - for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { - bleio_connection_internal_t *connection = &bleio_connections[i]; - if (connection->conn_handle == conn_handle) { - return bleio_connection_new_from_internal(connection); - } - } + // for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + // bleio_connection_internal_t *connection = &bleio_connections[i]; + // if (connection->conn_handle == conn_handle) { + // return bleio_connection_new_from_internal(connection); + // } + // } mp_raise_bleio_BluetoothError(translate("Failed to connect: internal error")); @@ -473,13 +472,13 @@ mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_addre } // The nRF SD 6.1.0 can only do one concurrent advertisement so share the advertising handle. -uint8_t adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET; +//FIX uint8_t adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET; STATIC void check_data_fit(size_t data_len, bool connectable) { - if (data_len > BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED || - (connectable && data_len > BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_CONNECTABLE_MAX_SUPPORTED)) { - mp_raise_ValueError(translate("Data too large for advertisement packet")); - } + //FIX if (data_len > BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED || + // (connectable && data_len > BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_CONNECTABLE_MAX_SUPPORTED)) { + // mp_raise_ValueError(translate("Data too large for advertisement packet")); + // } } // STATIC bool advertising_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { @@ -607,30 +606,31 @@ void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool // the same data while cycling the MAC address -- otherwise, what's the // point of randomizing the MAC address? if (!timeout) { - if (anonymous) { - // The Nordic macro is in units of 10ms. Convert to seconds. - uint32_t adv_timeout_max_secs = UNITS_TO_SEC(BLE_GAP_ADV_TIMEOUT_LIMITED_MAX, UNIT_10_MS); - uint32_t rotate_timeout_max_secs = BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S; - timeout = MIN(adv_timeout_max_secs, rotate_timeout_max_secs); - } - else { - timeout = BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED; - } + //FIX if (anonymous) { + // // The Nordic macro is in units of 10ms. Convert to seconds. + // uint32_t adv_timeout_max_secs = UNITS_TO_SEC(BLE_GAP_ADV_TIMEOUT_LIMITED_MAX, UNIT_10_MS); + // uint32_t rotate_timeout_max_secs = BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S; + // timeout = MIN(adv_timeout_max_secs, rotate_timeout_max_secs); + // } + // else { + // timeout = BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED; + // } } else { - if (SEC_TO_UNITS(timeout, UNIT_10_MS) > BLE_GAP_ADV_TIMEOUT_LIMITED_MAX) { - mp_raise_bleio_BluetoothError(translate("Timeout is too long: Maximum timeout length is %d seconds"), - UNITS_TO_SEC(BLE_GAP_ADV_TIMEOUT_LIMITED_MAX, UNIT_10_MS)); - } + //FIX if (SEC_TO_UNITS(timeout, UNIT_10_MS) > BLE_GAP_ADV_TIMEOUT_LIMITED_MAX) { + // mp_raise_bleio_BluetoothError(translate("Timeout is too long: Maximum timeout length is %d seconds"), + // UNITS_TO_SEC(BLE_GAP_ADV_TIMEOUT_LIMITED_MAX, UNIT_10_MS)); + // } } // The advertising data buffers must not move, because the SoftDevice depends on them. // So make them long-lived and reuse them onwards. - if (self->advertising_data == NULL) { - self->advertising_data = (uint8_t *) gc_alloc(BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED * sizeof(uint8_t), false, true); - } - if (self->scan_response_data == NULL) { - self->scan_response_data = (uint8_t *) gc_alloc(BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED * sizeof(uint8_t), false, true); - } + //FIX GET CORRECT SIZE + // if (self->advertising_data == NULL) { + // self->advertising_data = (uint8_t *) gc_alloc(BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED * sizeof(uint8_t), false, true); + // } + // if (self->scan_response_data == NULL) { + // self->scan_response_data = (uint8_t *) gc_alloc(BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED * sizeof(uint8_t), false, true); + // } memcpy(self->advertising_data, advertising_data_bufinfo->buf, advertising_data_bufinfo->len); memcpy(self->scan_response_data, scan_response_data_bufinfo->buf, scan_response_data_bufinfo->len); @@ -690,7 +690,7 @@ mp_obj_t common_hal_bleio_adapter_get_connections(bleio_adapter_obj_t *self) { } void common_hal_bleio_adapter_erase_bonding(bleio_adapter_obj_t *self) { - bonding_erase_storage(); + //FIX bonding_erase_storage(); } void bleio_adapter_gc_collect(bleio_adapter_obj_t* adapter) { diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.h b/devices/ble_hci/common-hal/_bleio/Adapter.h index 9d4d5abf86..f045f920f4 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.h +++ b/devices/ble_hci/common-hal/_bleio/Adapter.h @@ -52,15 +52,15 @@ typedef struct { bleio_scanresults_obj_t* scan_results; mp_obj_t name; mp_obj_tuple_t *connection_objs; - mcu_pin_obj_t* tx; - mcu_pin_obj_t* rx; - mcu_pin_obj_t* rts; - mcu_pin_obj_t* cts; + const mcu_pin_obj_t* tx; + const mcu_pin_obj_t* rx; + const mcu_pin_obj_t* rts; + const mcu_pin_obj_t* cts; uint32_t baudrate; uint16_t buffer_size; - mcu_pin_obj_t* spi_cs; - mcu_pin_obj_t* gpio0; - mcu_pin_obj_t* reset; + const mcu_pin_obj_t* spi_cs; + const mcu_pin_obj_t* gpio0; + const mcu_pin_obj_t* reset; bool reset_high; busio_uart_obj_t hci_uart; digitalio_digitalinout_obj_t rts_digitalio; diff --git a/devices/ble_hci/common-hal/_bleio/Attribute.c b/devices/ble_hci/common-hal/_bleio/Attribute.c index c55914b10d..30a0ebcf05 100644 --- a/devices/ble_hci/common-hal/_bleio/Attribute.c +++ b/devices/ble_hci/common-hal/_bleio/Attribute.c @@ -27,34 +27,34 @@ #include "shared-bindings/_bleio/Attribute.h" // Convert a _bleio security mode to a ble_gap_conn_sec_mode_t setting. -void bleio_attribute_gatts_set_security_mode(ble_gap_conn_sec_mode_t *perm, bleio_attribute_security_mode_t security_mode) { - switch (security_mode) { - case SECURITY_MODE_NO_ACCESS: - BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(perm); - break; +// void bleio_attribute_gatts_set_security_mode(ble_gap_conn_sec_mode_t *perm, bleio_attribute_security_mode_t security_mode) { +// switch (security_mode) { +// case SECURITY_MODE_NO_ACCESS: +// BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(perm); +// break; - case SECURITY_MODE_OPEN: - BLE_GAP_CONN_SEC_MODE_SET_OPEN(perm); - break; +// case SECURITY_MODE_OPEN: +// BLE_GAP_CONN_SEC_MODE_SET_OPEN(perm); +// break; - case SECURITY_MODE_ENC_NO_MITM: - BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(perm); - break; +// case SECURITY_MODE_ENC_NO_MITM: +// BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(perm); +// break; - case SECURITY_MODE_ENC_WITH_MITM: - BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM(perm); - break; +// case SECURITY_MODE_ENC_WITH_MITM: +// BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM(perm); +// break; - case SECURITY_MODE_LESC_ENC_WITH_MITM: - BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM(perm); - break; +// case SECURITY_MODE_LESC_ENC_WITH_MITM: +// BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM(perm); +// break; - case SECURITY_MODE_SIGNED_NO_MITM: - BLE_GAP_CONN_SEC_MODE_SET_SIGNED_NO_MITM(perm); - break; +// case SECURITY_MODE_SIGNED_NO_MITM: +// BLE_GAP_CONN_SEC_MODE_SET_SIGNED_NO_MITM(perm); +// break; - case SECURITY_MODE_SIGNED_WITH_MITM: - BLE_GAP_CONN_SEC_MODE_SET_SIGNED_WITH_MITM(perm); - break; - } -} +// case SECURITY_MODE_SIGNED_WITH_MITM: +// BLE_GAP_CONN_SEC_MODE_SET_SIGNED_WITH_MITM(perm); +// break; +// } +// } diff --git a/devices/ble_hci/common-hal/_bleio/Attribute.h b/devices/ble_hci/common-hal/_bleio/Attribute.h index cd9c86ca39..f527bcf740 100644 --- a/devices/ble_hci/common-hal/_bleio/Attribute.h +++ b/devices/ble_hci/common-hal/_bleio/Attribute.h @@ -29,6 +29,13 @@ #include "shared-module/_bleio/Attribute.h" -extern void bleio_attribute_gatts_set_security_mode(ble_gap_conn_sec_mode_t *perm, bleio_attribute_security_mode_t security_mode); +// typedef struct +// { +// uint8_t sm : 4; /**< Security Mode (1 or 2), 0 for no permissions at all. */ +// uint8_t lv : 4; /**< Level (1, 2, 3 or 4), 0 for no permissions at all. */ + +// } ble_gap_conn_sec_mode_t; + +// extern void bleio_attribute_gatts_set_security_mode(ble_gap_conn_sec_mode_t *perm, bleio_attribute_security_mode_t security_mode); #endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_ATTRIBUTE_H diff --git a/devices/ble_hci/common-hal/_bleio/Characteristic.c b/devices/ble_hci/common-hal/_bleio/Characteristic.c index d507cecca4..ff08bf15c4 100644 --- a/devices/ble_hci/common-hal/_bleio/Characteristic.c +++ b/devices/ble_hci/common-hal/_bleio/Characteristic.c @@ -33,70 +33,70 @@ #include "shared-bindings/_bleio/Service.h" #include "common-hal/_bleio/Adapter.h" -#include "common-hal/_bleio/bonding.h" -STATIC uint16_t characteristic_get_cccd(uint16_t cccd_handle, uint16_t conn_handle) { - uint16_t cccd; - ble_gatts_value_t value = { - .p_value = (uint8_t*) &cccd, - .len = 2, - }; +// STATIC uint16_t characteristic_get_cccd(uint16_t cccd_handle, uint16_t conn_handle) { +// uint16_t cccd; +// // ble_gatts_value_t value = { +// // .p_value = (uint8_t*) &cccd, +// // .len = 2, +// // }; - const uint32_t err_code = sd_ble_gatts_value_get(conn_handle, cccd_handle, &value); +// // const uint32_t err_code = sd_ble_gatts_value_get(conn_handle, cccd_handle, &value); - if (err_code == BLE_ERROR_GATTS_SYS_ATTR_MISSING) { - // CCCD is not set, so say that neither Notify nor Indicate is enabled. - cccd = 0; - } else { - check_nrf_error(err_code); - } +// // if (err_code == BLE_ERROR_GATTS_SYS_ATTR_MISSING) { +// // // CCCD is not set, so say that neither Notify nor Indicate is enabled. +// // cccd = 0; +// // } else { +// // check_nrf_error(err_code); +// // } - return cccd; -} +// return cccd; +// } -STATIC void characteristic_gatts_notify_indicate(uint16_t handle, uint16_t conn_handle, mp_buffer_info_t *bufinfo, uint16_t hvx_type) { - uint16_t hvx_len = bufinfo->len; +// STATIC void characteristic_gatts_notify_indicate(uint16_t handle, uint16_t conn_handle, mp_buffer_info_t *bufinfo, uint16_t hvx_type) { +// uint16_t hvx_len = bufinfo->len; - ble_gatts_hvx_params_t hvx_params = { - .handle = handle, - .type = hvx_type, - .offset = 0, - .p_len = &hvx_len, - .p_data = bufinfo->buf, - }; +// ble_gatts_hvx_params_t hvx_params = { +// .handle = handle, +// .type = hvx_type, +// .offset = 0, +// .p_len = &hvx_len, +// .p_data = bufinfo->buf, +// }; - while (1) { - const uint32_t err_code = sd_ble_gatts_hvx(conn_handle, &hvx_params); - if (err_code == NRF_SUCCESS) { - break; - } - // TX buffer is full - // We could wait for an event indicating the write is complete, but just retrying is easier. - if (err_code == NRF_ERROR_RESOURCES) { - RUN_BACKGROUND_TASKS; - continue; - } +// while (1) { +// const uint32_t err_code = sd_ble_gatts_hvx(conn_handle, &hvx_params); +// if (err_code == NRF_SUCCESS) { +// break; +// } +// // TX buffer is full +// // We could wait for an event indicating the write is complete, but just retrying is easier. +// if (err_code == NRF_ERROR_RESOURCES) { +// RUN_BACKGROUND_TASKS; +// continue; +// } - // Some real error has occurred. - check_nrf_error(err_code); - } -} +// // Some real error has occurred. +// check_nrf_error(err_code); +// } +// } void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, bleio_service_obj_t *service, uint16_t handle, bleio_uuid_obj_t *uuid, bleio_characteristic_properties_t props, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_buffer_info_t *initial_value_bufinfo) { self->service = service; self->uuid = uuid; - self->handle = BLE_GATT_HANDLE_INVALID; + //FIX self->handle = BLE_GATT_HANDLE_INVALID; self->props = props; self->read_perm = read_perm; self->write_perm = write_perm; self->descriptor_list = NULL; - const mp_int_t max_length_max = fixed_length ? BLE_GATTS_FIX_ATTR_LEN_MAX : BLE_GATTS_VAR_ATTR_LEN_MAX; - if (max_length < 0 || max_length > max_length_max) { - mp_raise_ValueError_varg(translate("max_length must be 0-%d when fixed_length is %s"), - max_length_max, fixed_length ? "True" : "False"); - } + //FIX + // const mp_int_t max_length_max = fixed_length ? BLE_GATTS_FIX_ATTR_LEN_MAX : BLE_GATTS_VAR_ATTR_LEN_MAX; + // if (max_length < 0 || max_length > max_length_max) { + // mp_raise_ValueError_varg(translate("max_length must be 0-%d when fixed_length is %s"), + // max_length_max, fixed_length ? "True" : "False"); + // } self->max_length = max_length; self->fixed_length = fixed_length; @@ -159,25 +159,26 @@ void common_hal_bleio_characteristic_set_value(bleio_characteristic_obj_t *self, for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { bleio_connection_internal_t *connection = &bleio_connections[i]; uint16_t conn_handle = connection->conn_handle; - if (connection->conn_handle == BLE_CONN_HANDLE_INVALID) { + if (conn_handle == BLE_CONN_HANDLE_INVALID) { continue; } - uint16_t cccd = 0; + //FIX + // uint16_t cccd = 0; - const bool notify = self->props & CHAR_PROP_NOTIFY; - const bool indicate = self->props & CHAR_PROP_INDICATE; - if (notify | indicate) { - cccd = characteristic_get_cccd(self->cccd_handle, conn_handle); - } + // const bool notify = self->props & CHAR_PROP_NOTIFY; + // const bool indicate = self->props & CHAR_PROP_INDICATE; + // if (notify | indicate) { + // cccd = characteristic_get_cccd(self->cccd_handle, conn_handle); + // } - // It's possible that both notify and indicate are set. - if (notify && (cccd & BLE_GATT_HVX_NOTIFICATION)) { - characteristic_gatts_notify_indicate(self->handle, conn_handle, bufinfo, BLE_GATT_HVX_NOTIFICATION); - } - if (indicate && (cccd & BLE_GATT_HVX_INDICATION)) { - characteristic_gatts_notify_indicate(self->handle, conn_handle, bufinfo, BLE_GATT_HVX_INDICATION); - } + // // It's possible that both notify and indicate are set. + // if (notify && (cccd & BLE_GATT_HVX_NOTIFICATION)) { + // characteristic_gatts_notify_indicate(self->handle, conn_handle, bufinfo, BLE_GATT_HVX_NOTIFICATION); + // } + // if (indicate && (cccd & BLE_GATT_HVX_INDICATION)) { + // characteristic_gatts_notify_indicate(self->handle, conn_handle, bufinfo, BLE_GATT_HVX_INDICATION); + // } } } } @@ -192,34 +193,35 @@ bleio_characteristic_properties_t common_hal_bleio_characteristic_get_properties } void common_hal_bleio_characteristic_add_descriptor(bleio_characteristic_obj_t *self, bleio_descriptor_obj_t *descriptor) { - ble_uuid_t desc_uuid; - bleio_uuid_convert_to_nrf_ble_uuid(descriptor->uuid, &desc_uuid); + //FIX + // ble_uuid_t desc_uuid; + // bleio_uuid_convert_to_nrf_ble_uuid(descriptor->uuid, &desc_uuid); - ble_gatts_attr_md_t desc_attr_md = { - // Data passed is not in a permanent location and should be copied. - .vloc = BLE_GATTS_VLOC_STACK, - .vlen = !descriptor->fixed_length, - }; + // ble_gatts_attr_md_t desc_attr_md = { + // // Data passed is not in a permanent location and should be copied. + // .vloc = BLE_GATTS_VLOC_STACK, + // .vlen = !descriptor->fixed_length, + // }; - bleio_attribute_gatts_set_security_mode(&desc_attr_md.read_perm, descriptor->read_perm); - bleio_attribute_gatts_set_security_mode(&desc_attr_md.write_perm, descriptor->write_perm); + // bleio_attribute_gatts_set_security_mode(&desc_attr_md.read_perm, descriptor->read_perm); + // bleio_attribute_gatts_set_security_mode(&desc_attr_md.write_perm, descriptor->write_perm); - mp_buffer_info_t desc_value_bufinfo; - mp_get_buffer_raise(descriptor->value, &desc_value_bufinfo, MP_BUFFER_READ); + // mp_buffer_info_t desc_value_bufinfo; + // mp_get_buffer_raise(descriptor->value, &desc_value_bufinfo, MP_BUFFER_READ); - ble_gatts_attr_t desc_attr = { - .p_uuid = &desc_uuid, - .p_attr_md = &desc_attr_md, - .init_len = desc_value_bufinfo.len, - .p_value = desc_value_bufinfo.buf, - .init_offs = 0, - .max_len = descriptor->max_length, - }; + // ble_gatts_attr_t desc_attr = { + // .p_uuid = &desc_uuid, + // .p_attr_md = &desc_attr_md, + // .init_len = desc_value_bufinfo.len, + // .p_value = desc_value_bufinfo.buf, + // .init_offs = 0, + // .max_len = descriptor->max_length, + // }; - check_nrf_error(sd_ble_gatts_descriptor_add(self->handle, &desc_attr, &descriptor->handle)); + // check_nrf_error(sd_ble_gatts_descriptor_add(self->handle, &desc_attr, &descriptor->handle)); - descriptor->next = self->descriptor_list; - self->descriptor_list = descriptor; + // descriptor->next = self->descriptor_list; + // self->descriptor_list = descriptor; } void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, bool notify, bool indicate) { @@ -234,33 +236,34 @@ void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, const uint16_t conn_handle = bleio_connection_get_conn_handle(self->service->connection); common_hal_bleio_check_connected(conn_handle); - uint16_t cccd_value = - (notify ? BLE_GATT_HVX_NOTIFICATION : 0) | - (indicate ? BLE_GATT_HVX_INDICATION : 0); + //FIX + // uint16_t cccd_value = + // (notify ? BLE_GATT_HVX_NOTIFICATION : 0) | + // (indicate ? BLE_GATT_HVX_INDICATION : 0); - ble_gattc_write_params_t write_params = { - .write_op = BLE_GATT_OP_WRITE_REQ, - .handle = self->cccd_handle, - .p_value = (uint8_t *) &cccd_value, - .len = 2, - }; + // ble_gattc_write_params_t write_params = { + // .write_op = BLE_GATT_OP_WRITE_REQ, + // .handle = self->cccd_handle, + // .p_value = (uint8_t *) &cccd_value, + // .len = 2, + // }; - while (1) { - uint32_t err_code = sd_ble_gattc_write(conn_handle, &write_params); - if (err_code == NRF_SUCCESS) { - break; - } + // while (1) { + // uint32_t err_code = sd_ble_gattc_write(conn_handle, &write_params); + // if (err_code == NRF_SUCCESS) { + // break; + // } - // Write with response will return NRF_ERROR_BUSY if the response has not been received. - // Write without reponse will return NRF_ERROR_RESOURCES if too many writes are pending. - if (err_code == NRF_ERROR_BUSY || err_code == NRF_ERROR_RESOURCES) { - // We could wait for an event indicating the write is complete, but just retrying is easier. - RUN_BACKGROUND_TASKS; - continue; - } + // // Write with response will return NRF_ERROR_BUSY if the response has not been received. + // // Write without reponse will return NRF_ERROR_RESOURCES if too many writes are pending. + // if (err_code == NRF_ERROR_BUSY || err_code == NRF_ERROR_RESOURCES) { + // // We could wait for an event indicating the write is complete, but just retrying is easier. + // RUN_BACKGROUND_TASKS; + // continue; + // } - // Some real error occurred. - check_nrf_error(err_code); - } + // // Some real error occurred. + // check_nrf_error(err_code); + // } } diff --git a/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c b/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c index 6f848f8583..c4eb6a19fe 100644 --- a/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c +++ b/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c @@ -37,44 +37,44 @@ #include "common-hal/_bleio/CharacteristicBuffer.h" // Push all the data onto the ring buffer. When the buffer is full, new bytes will be dropped. -STATIC void write_to_ringbuf(bleio_characteristic_buffer_obj_t *self, uint8_t *data, uint16_t len) { - uint8_t is_nested_critical_region; - sd_nvic_critical_region_enter(&is_nested_critical_region); - ringbuf_put_n(&self->ringbuf, data, len); - sd_nvic_critical_region_exit(is_nested_critical_region); -} +// STATIC void write_to_ringbuf(bleio_characteristic_buffer_obj_t *self, uint8_t *data, uint16_t len) { +// uint8_t is_nested_critical_region; +// sd_nvic_critical_region_enter(&is_nested_critical_region); +// ringbuf_put_n(&self->ringbuf, data, len); +// sd_nvic_critical_region_exit(is_nested_critical_region); +// } -STATIC bool characteristic_buffer_on_ble_evt(ble_evt_t *ble_evt, void *param) { - bleio_characteristic_buffer_obj_t *self = (bleio_characteristic_buffer_obj_t *) param; - switch (ble_evt->header.evt_id) { - case BLE_GATTS_EVT_WRITE: { - // A client wrote to this server characteristic. +// STATIC bool characteristic_buffer_on_ble_evt(ble_evt_t *ble_evt, void *param) { +// bleio_characteristic_buffer_obj_t *self = (bleio_characteristic_buffer_obj_t *) param; +// switch (ble_evt->header.evt_id) { +// case BLE_GATTS_EVT_WRITE: { +// // A client wrote to this server characteristic. - ble_gatts_evt_write_t *evt_write = &ble_evt->evt.gatts_evt.params.write; - // Event handle must match the handle for my characteristic. - if (evt_write->handle == self->characteristic->handle) { - write_to_ringbuf(self, evt_write->data, evt_write->len); - } - break; - } +// ble_gatts_evt_write_t *evt_write = &ble_evt->evt.gatts_evt.params.write; +// // Event handle must match the handle for my characteristic. +// if (evt_write->handle == self->characteristic->handle) { +// write_to_ringbuf(self, evt_write->data, evt_write->len); +// } +// break; +// } - case BLE_GATTC_EVT_HVX: { - // A remote service wrote to this characteristic. +// case BLE_GATTC_EVT_HVX: { +// // A remote service wrote to this characteristic. - ble_gattc_evt_hvx_t* evt_hvx = &ble_evt->evt.gattc_evt.params.hvx; - // Must be a notification, and event handle must match the handle for my characteristic. - if (evt_hvx->type == BLE_GATT_HVX_NOTIFICATION && - evt_hvx->handle == self->characteristic->handle) { - write_to_ringbuf(self, evt_hvx->data, evt_hvx->len); - } - break; - } - default: - return false; - break; - } - return true; -} +// ble_gattc_evt_hvx_t* evt_hvx = &ble_evt->evt.gattc_evt.params.hvx; +// // Must be a notification, and event handle must match the handle for my characteristic. +// if (evt_hvx->type == BLE_GATT_HVX_NOTIFICATION && +// evt_hvx->handle == self->characteristic->handle) { +// write_to_ringbuf(self, evt_hvx->data, evt_hvx->len); +// } +// break; +// } +// default: +// return false; +// break; +// } +// return true; +// } // Assumes that timeout and buffer_size have been validated before call. void common_hal_bleio_characteristic_buffer_construct(bleio_characteristic_buffer_obj_t *self, @@ -88,7 +88,7 @@ void common_hal_bleio_characteristic_buffer_construct(bleio_characteristic_buffe // true means long-lived, so it won't be moved. ringbuf_alloc(&self->ringbuf, buffer_size, true); - ble_drv_add_event_handler(characteristic_buffer_on_ble_evt, self); + // FIX ble_drv_add_event_handler(characteristic_buffer_on_ble_evt, self); } @@ -105,31 +105,31 @@ uint32_t common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer } // Copy received data. Lock out write interrupt handler while copying. - uint8_t is_nested_critical_region; - sd_nvic_critical_region_enter(&is_nested_critical_region); + // FIX uint8_t is_nested_critical_region; + // FIX sd_nvic_critical_region_enter(&is_nested_critical_region); uint32_t num_bytes_read = ringbuf_get_n(&self->ringbuf, data, len); // Writes now OK. - sd_nvic_critical_region_exit(is_nested_critical_region); + // FIX sd_nvic_critical_region_exit(is_nested_critical_region); return num_bytes_read; } uint32_t common_hal_bleio_characteristic_buffer_rx_characters_available(bleio_characteristic_buffer_obj_t *self) { - uint8_t is_nested_critical_region; - sd_nvic_critical_region_enter(&is_nested_critical_region); + //FIX uint8_t is_nested_critical_region; + //FIX sd_nvic_critical_region_enter(&is_nested_critical_region); uint16_t count = ringbuf_num_filled(&self->ringbuf); - sd_nvic_critical_region_exit(is_nested_critical_region); + //FIX sd_nvic_critical_region_exit(is_nested_critical_region); return count; } void common_hal_bleio_characteristic_buffer_clear_rx_buffer(bleio_characteristic_buffer_obj_t *self) { // prevent conflict with uart irq - uint8_t is_nested_critical_region; - sd_nvic_critical_region_enter(&is_nested_critical_region); + //FIX uint8_t is_nested_critical_region; + //FIX sd_nvic_critical_region_enter(&is_nested_critical_region); ringbuf_clear(&self->ringbuf); - sd_nvic_critical_region_exit(is_nested_critical_region); + //FIX sd_nvic_critical_region_exit(is_nested_critical_region); } bool common_hal_bleio_characteristic_buffer_deinited(bleio_characteristic_buffer_obj_t *self) { @@ -138,7 +138,7 @@ bool common_hal_bleio_characteristic_buffer_deinited(bleio_characteristic_buffer void common_hal_bleio_characteristic_buffer_deinit(bleio_characteristic_buffer_obj_t *self) { if (!common_hal_bleio_characteristic_buffer_deinited(self)) { - ble_drv_remove_event_handler(characteristic_buffer_on_ble_evt, self); + //FIX ble_drv_remove_event_handler(characteristic_buffer_on_ble_evt, self); } } diff --git a/devices/ble_hci/common-hal/_bleio/Connection.c b/devices/ble_hci/common-hal/_bleio/Connection.c index 6c63f4261f..913f120feb 100644 --- a/devices/ble_hci/common-hal/_bleio/Connection.c +++ b/devices/ble_hci/common-hal/_bleio/Connection.c @@ -44,24 +44,22 @@ #include "shared-bindings/_bleio/UUID.h" #include "supervisor/shared/tick.h" -#include "common-hal/_bleio/bonding.h" - #define BLE_ADV_LENGTH_FIELD_SIZE 1 #define BLE_ADV_AD_TYPE_FIELD_SIZE 1 #define BLE_AD_TYPE_FLAGS_DATA_SIZE 1 -static const ble_gap_sec_params_t pairing_sec_params = { - .bond = 1, - .mitm = 0, - .lesc = 0, - .keypress = 0, - .oob = 0, - .io_caps = BLE_GAP_IO_CAPS_NONE, - .min_key_size = 7, - .max_key_size = 16, - .kdist_own = { .enc = 1, .id = 1}, - .kdist_peer = { .enc = 1, .id = 1}, -}; +// static const ble_gap_sec_params_t pairing_sec_params = { +// .bond = 1, +// .mitm = 0, +// .lesc = 0, +// .keypress = 0, +// .oob = 0, +// .io_caps = BLE_GAP_IO_CAPS_NONE, +// .min_key_size = 7, +// .max_key_size = 16, +// .kdist_own = { .enc = 1, .id = 1}, +// .kdist_peer = { .enc = 1, .id = 1}, +// }; #define CONNECTION_DEBUG (1) #if CONNECTION_DEBUG @@ -73,259 +71,259 @@ static const ble_gap_sec_params_t pairing_sec_params = { static volatile bool m_discovery_in_process; static volatile bool m_discovery_successful; -static bleio_service_obj_t *m_char_discovery_service; -static bleio_characteristic_obj_t *m_desc_discovery_characteristic; +//FIX static bleio_service_obj_t *m_char_discovery_service; +//FIX static bleio_characteristic_obj_t *m_desc_discovery_characteristic; -bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { - bleio_connection_internal_t *self = (bleio_connection_internal_t*)self_in; +// bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { +// bleio_connection_internal_t *self = (bleio_connection_internal_t*)self_in; - if (BLE_GAP_EVT_BASE <= ble_evt->header.evt_id && ble_evt->header.evt_id <= BLE_GAP_EVT_LAST && - ble_evt->evt.gap_evt.conn_handle != self->conn_handle) { - return false; - } - if (BLE_GATTS_EVT_BASE <= ble_evt->header.evt_id && ble_evt->header.evt_id <= BLE_GATTS_EVT_LAST && - ble_evt->evt.gatts_evt.conn_handle != self->conn_handle) { - return false; - } +// if (BLE_GAP_EVT_BASE <= ble_evt->header.evt_id && ble_evt->header.evt_id <= BLE_GAP_EVT_LAST && +// ble_evt->evt.gap_evt.conn_handle != self->conn_handle) { +// return false; +// } +// if (BLE_GATTS_EVT_BASE <= ble_evt->header.evt_id && ble_evt->header.evt_id <= BLE_GATTS_EVT_LAST && +// ble_evt->evt.gatts_evt.conn_handle != self->conn_handle) { +// return false; +// } - switch (ble_evt->header.evt_id) { - case BLE_GAP_EVT_DISCONNECTED: - // Adapter.c does the work for this event. - break; +// switch (ble_evt->header.evt_id) { +// case BLE_GAP_EVT_DISCONNECTED: +// // Adapter.c does the work for this event. +// break; - case BLE_GAP_EVT_PHY_UPDATE_REQUEST: { - ble_gap_phys_t const phys = { - .rx_phys = BLE_GAP_PHY_AUTO, - .tx_phys = BLE_GAP_PHY_AUTO, - }; - sd_ble_gap_phy_update(ble_evt->evt.gap_evt.conn_handle, &phys); - break; - } +// case BLE_GAP_EVT_PHY_UPDATE_REQUEST: { +// ble_gap_phys_t const phys = { +// .rx_phys = BLE_GAP_PHY_AUTO, +// .tx_phys = BLE_GAP_PHY_AUTO, +// }; +// sd_ble_gap_phy_update(ble_evt->evt.gap_evt.conn_handle, &phys); +// break; +// } - case BLE_GAP_EVT_PHY_UPDATE: { // 0x22 - break; - } +// case BLE_GAP_EVT_PHY_UPDATE: { // 0x22 +// break; +// } - case BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST: - // SoftDevice will respond to a length update request. - sd_ble_gap_data_length_update(self->conn_handle, NULL, NULL); - break; +// case BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST: +// // SoftDevice will respond to a length update request. +// sd_ble_gap_data_length_update(self->conn_handle, NULL, NULL); +// break; - case BLE_GAP_EVT_DATA_LENGTH_UPDATE: { // 0x24 - break; - } +// case BLE_GAP_EVT_DATA_LENGTH_UPDATE: { // 0x24 +// break; +// } - case BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST: { - ble_gatts_evt_exchange_mtu_request_t *request = - &ble_evt->evt.gatts_evt.params.exchange_mtu_request; +// case BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST: { +// ble_gatts_evt_exchange_mtu_request_t *request = +// &ble_evt->evt.gatts_evt.params.exchange_mtu_request; - uint16_t new_mtu = BLE_GATTS_VAR_ATTR_LEN_MAX; - if (request->client_rx_mtu < new_mtu) { - new_mtu = request->client_rx_mtu; - } - if (new_mtu < BLE_GATT_ATT_MTU_DEFAULT) { - new_mtu = BLE_GATT_ATT_MTU_DEFAULT; - } - if (self->mtu > 0) { - new_mtu = self->mtu; - } +// uint16_t new_mtu = BLE_GATTS_VAR_ATTR_LEN_MAX; +// if (request->client_rx_mtu < new_mtu) { +// new_mtu = request->client_rx_mtu; +// } +// if (new_mtu < BLE_GATT_ATT_MTU_DEFAULT) { +// new_mtu = BLE_GATT_ATT_MTU_DEFAULT; +// } +// if (self->mtu > 0) { +// new_mtu = self->mtu; +// } - self->mtu = new_mtu; - sd_ble_gatts_exchange_mtu_reply(self->conn_handle, new_mtu); - break; - } +// self->mtu = new_mtu; +// sd_ble_gatts_exchange_mtu_reply(self->conn_handle, new_mtu); +// break; +// } - case BLE_GATTC_EVT_EXCHANGE_MTU_RSP: { - ble_gattc_evt_exchange_mtu_rsp_t *response = - &ble_evt->evt.gattc_evt.params.exchange_mtu_rsp; +// case BLE_GATTC_EVT_EXCHANGE_MTU_RSP: { +// ble_gattc_evt_exchange_mtu_rsp_t *response = +// &ble_evt->evt.gattc_evt.params.exchange_mtu_rsp; - self->mtu = response->server_rx_mtu; - break; - } +// self->mtu = response->server_rx_mtu; +// break; +// } - case BLE_GATTS_EVT_WRITE: - // A client wrote a value. - // If we are bonded and it's a CCCD (UUID 0x2902), store the CCCD value. - if (self->conn_handle != BLE_CONN_HANDLE_INVALID && - self->pair_status == PAIR_PAIRED && - ble_evt->evt.gatts_evt.params.write.uuid.type == BLE_UUID_TYPE_BLE && - ble_evt->evt.gatts_evt.params.write.uuid.uuid == 0x2902) { - // - // Save sys_attr data (CCCD state) in bonding area at - // next opportunity, but also remember time of this - // request, so we can consolidate closely-spaced requests. - self->do_bond_cccds = true; - self->do_bond_cccds_request_time = supervisor_ticks_ms64(); - } - // Return false so other handlers get this event as well. - return false; +// case BLE_GATTS_EVT_WRITE: +// // A client wrote a value. +// // If we are bonded and it's a CCCD (UUID 0x2902), store the CCCD value. +// if (self->conn_handle != BLE_CONN_HANDLE_INVALID && +// self->pair_status == PAIR_PAIRED && +// ble_evt->evt.gatts_evt.params.write.uuid.type == BLE_UUID_TYPE_BLE && +// ble_evt->evt.gatts_evt.params.write.uuid.uuid == 0x2902) { +// // +// // Save sys_attr data (CCCD state) in bonding area at +// // next opportunity, but also remember time of this +// // request, so we can consolidate closely-spaced requests. +// self->do_bond_cccds = true; +// self->do_bond_cccds_request_time = supervisor_ticks_ms64(); +// } +// // Return false so other handlers get this event as well. +// return false; - case BLE_GATTS_EVT_SYS_ATTR_MISSING: - sd_ble_gatts_sys_attr_set(self->conn_handle, NULL, 0, 0); - break; +// case BLE_GATTS_EVT_SYS_ATTR_MISSING: +// sd_ble_gatts_sys_attr_set(self->conn_handle, NULL, 0, 0); +// break; - #if CIRCUITPY_VERBOSE_BLE - // Use read authorization to snoop on all reads when doing verbose debugging. - case BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST: { +// #if CIRCUITPY_VERBOSE_BLE +// // Use read authorization to snoop on all reads when doing verbose debugging. +// case BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST: { - ble_gatts_evt_rw_authorize_request_t *request = - &ble_evt->evt.gatts_evt.params.authorize_request; +// ble_gatts_evt_rw_authorize_request_t *request = +// &ble_evt->evt.gatts_evt.params.authorize_request; - mp_printf(&mp_plat_print, "Read %x offset %d ", request->request.read.handle, request->request.read.offset); - uint8_t value_bytes[22]; - ble_gatts_value_t value; - value.offset = request->request.read.offset; - value.len = 22; - value.p_value = value_bytes; +// mp_printf(&mp_plat_print, "Read %x offset %d ", request->request.read.handle, request->request.read.offset); +// uint8_t value_bytes[22]; +// ble_gatts_value_t value; +// value.offset = request->request.read.offset; +// value.len = 22; +// value.p_value = value_bytes; - sd_ble_gatts_value_get(self->conn_handle, request->request.read.handle, &value); - size_t len = value.len; - if (len > 22) { - len = 22; - } - for (uint8_t i = 0; i < len; i++) { - mp_printf(&mp_plat_print, " %02x", value_bytes[i]); - } - mp_printf(&mp_plat_print, "\n"); - ble_gatts_rw_authorize_reply_params_t reply; - reply.type = request->type; - reply.params.read.gatt_status = BLE_GATT_STATUS_SUCCESS; - reply.params.read.update = false; - reply.params.read.offset = request->request.read.offset; - sd_ble_gatts_rw_authorize_reply(self->conn_handle, &reply); - break; - } - #endif +// sd_ble_gatts_value_get(self->conn_handle, request->request.read.handle, &value); +// size_t len = value.len; +// if (len > 22) { +// len = 22; +// } +// for (uint8_t i = 0; i < len; i++) { +// mp_printf(&mp_plat_print, " %02x", value_bytes[i]); +// } +// mp_printf(&mp_plat_print, "\n"); +// ble_gatts_rw_authorize_reply_params_t reply; +// reply.type = request->type; +// reply.params.read.gatt_status = BLE_GATT_STATUS_SUCCESS; +// reply.params.read.update = false; +// reply.params.read.offset = request->request.read.offset; +// sd_ble_gatts_rw_authorize_reply(self->conn_handle, &reply); +// break; +// } +// #endif - case BLE_GATTS_EVT_HVN_TX_COMPLETE: // Capture this for now. 0x55 - break; - case BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST: { - self->conn_params_updating = true; - ble_gap_evt_conn_param_update_request_t *request = - &ble_evt->evt.gap_evt.params.conn_param_update_request; - sd_ble_gap_conn_param_update(self->conn_handle, &request->conn_params); - break; - } - case BLE_GAP_EVT_CONN_PARAM_UPDATE: { // 0x12 - ble_gap_evt_conn_param_update_t *result = - &ble_evt->evt.gap_evt.params.conn_param_update; +// case BLE_GATTS_EVT_HVN_TX_COMPLETE: // Capture this for now. 0x55 +// break; +// case BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST: { +// self->conn_params_updating = true; +// ble_gap_evt_conn_param_update_request_t *request = +// &ble_evt->evt.gap_evt.params.conn_param_update_request; +// sd_ble_gap_conn_param_update(self->conn_handle, &request->conn_params); +// break; +// } +// case BLE_GAP_EVT_CONN_PARAM_UPDATE: { // 0x12 +// ble_gap_evt_conn_param_update_t *result = +// &ble_evt->evt.gap_evt.params.conn_param_update; - #if CIRCUITPY_VERBOSE_BLE - ble_gap_conn_params_t *cp = &ble_evt->evt.gap_evt.params.conn_param_update.conn_params; - mp_printf(&mp_plat_print, "conn params updated: min_ci %d max_ci %d s_l %d sup_timeout %d\n", cp->min_conn_interval, cp->max_conn_interval, cp->slave_latency, cp->conn_sup_timeout); - #endif +// #if CIRCUITPY_VERBOSE_BLE +// ble_gap_conn_params_t *cp = &ble_evt->evt.gap_evt.params.conn_param_update.conn_params; +// mp_printf(&mp_plat_print, "conn params updated: min_ci %d max_ci %d s_l %d sup_timeout %d\n", cp->min_conn_interval, cp->max_conn_interval, cp->slave_latency, cp->conn_sup_timeout); +// #endif - memcpy(&self->conn_params, &result->conn_params, sizeof(ble_gap_conn_params_t)); - self->conn_params_updating = false; - break; - } - case BLE_GAP_EVT_SEC_PARAMS_REQUEST: { - // First time pairing. - // 1. Either we or peer initiate the process - // 2. Peer asks for security parameters using BLE_GAP_EVT_SEC_PARAMS_REQUEST. - // 3. Pair Key exchange ("just works" implemented now; TODO: out-of-band key pairing) - // 4. Connection is secured: BLE_GAP_EVT_CONN_SEC_UPDATE - // 5. Long-term Keys exchanged: BLE_GAP_EVT_AUTH_STATUS +// memcpy(&self->conn_params, &result->conn_params, sizeof(ble_gap_conn_params_t)); +// self->conn_params_updating = false; +// break; +// } +// case BLE_GAP_EVT_SEC_PARAMS_REQUEST: { +// // First time pairing. +// // 1. Either we or peer initiate the process +// // 2. Peer asks for security parameters using BLE_GAP_EVT_SEC_PARAMS_REQUEST. +// // 3. Pair Key exchange ("just works" implemented now; TODO: out-of-band key pairing) +// // 4. Connection is secured: BLE_GAP_EVT_CONN_SEC_UPDATE +// // 5. Long-term Keys exchanged: BLE_GAP_EVT_AUTH_STATUS - bonding_clear_keys(&self->bonding_keys); - self->ediv = EDIV_INVALID; - ble_gap_sec_keyset_t keyset = { - .keys_own = { - .p_enc_key = &self->bonding_keys.own_enc, - .p_id_key = NULL, - .p_sign_key = NULL, - .p_pk = NULL - }, +// bonding_clear_keys(&self->bonding_keys); +// self->ediv = EDIV_INVALID; +// ble_gap_sec_keyset_t keyset = { +// .keys_own = { +// .p_enc_key = &self->bonding_keys.own_enc, +// .p_id_key = NULL, +// .p_sign_key = NULL, +// .p_pk = NULL +// }, - .keys_peer = { - .p_enc_key = &self->bonding_keys.peer_enc, - .p_id_key = &self->bonding_keys.peer_id, - .p_sign_key = NULL, - .p_pk = NULL - } - }; +// .keys_peer = { +// .p_enc_key = &self->bonding_keys.peer_enc, +// .p_id_key = &self->bonding_keys.peer_id, +// .p_sign_key = NULL, +// .p_pk = NULL +// } +// }; - sd_ble_gap_sec_params_reply(self->conn_handle, BLE_GAP_SEC_STATUS_SUCCESS, - self->is_central ? NULL : &pairing_sec_params, - &keyset); - break; - } +// sd_ble_gap_sec_params_reply(self->conn_handle, BLE_GAP_SEC_STATUS_SUCCESS, +// self->is_central ? NULL : &pairing_sec_params, +// &keyset); +// break; +// } - case BLE_GAP_EVT_LESC_DHKEY_REQUEST: - // TODO for LESC pairing: - // sd_ble_gap_lesc_dhkey_reply(...); - break; +// case BLE_GAP_EVT_LESC_DHKEY_REQUEST: +// // TODO for LESC pairing: +// // sd_ble_gap_lesc_dhkey_reply(...); +// break; - case BLE_GAP_EVT_AUTH_STATUS: { // 0x19 - // Key exchange completed. - ble_gap_evt_auth_status_t* status = &ble_evt->evt.gap_evt.params.auth_status; - self->sec_status = status->auth_status; - if (status->auth_status == BLE_GAP_SEC_STATUS_SUCCESS) { - self->ediv = self->bonding_keys.own_enc.master_id.ediv; - self->pair_status = PAIR_PAIRED; - // Save keys in bonding area at next opportunity. - self->do_bond_keys = true; - } else { - // Inform busy-waiter pairing has failed. - self->pair_status = PAIR_NOT_PAIRED; - } - break; - } +// case BLE_GAP_EVT_AUTH_STATUS: { // 0x19 +// // Key exchange completed. +// ble_gap_evt_auth_status_t* status = &ble_evt->evt.gap_evt.params.auth_status; +// self->sec_status = status->auth_status; +// if (status->auth_status == BLE_GAP_SEC_STATUS_SUCCESS) { +// self->ediv = self->bonding_keys.own_enc.master_id.ediv; +// self->pair_status = PAIR_PAIRED; +// // Save keys in bonding area at next opportunity. +// self->do_bond_keys = true; +// } else { +// // Inform busy-waiter pairing has failed. +// self->pair_status = PAIR_NOT_PAIRED; +// } +// break; +// } - case BLE_GAP_EVT_SEC_INFO_REQUEST: { // 0x14 - // Peer asks for the stored keys. - // - load key and return if bonded previously. - // - Else return NULL --> Initiate key exchange - ble_gap_evt_sec_info_request_t* sec_info_request = &ble_evt->evt.gap_evt.params.sec_info_request; - (void) sec_info_request; - if ( bonding_load_keys(self->is_central, sec_info_request->master_id.ediv, &self->bonding_keys) ) { - sd_ble_gap_sec_info_reply( - self->conn_handle, - &self->bonding_keys.own_enc.enc_info, - &self->bonding_keys.peer_id.id_info, - NULL); - self->ediv = self->bonding_keys.own_enc.master_id.ediv; - } else { - // We don't have stored keys. Ask for keys. - sd_ble_gap_sec_info_reply(self->conn_handle, NULL, NULL, NULL); - } - break; - } +// case BLE_GAP_EVT_SEC_INFO_REQUEST: { // 0x14 +// // Peer asks for the stored keys. +// // - load key and return if bonded previously. +// // - Else return NULL --> Initiate key exchange +// ble_gap_evt_sec_info_request_t* sec_info_request = &ble_evt->evt.gap_evt.params.sec_info_request; +// (void) sec_info_request; +// if ( bonding_load_keys(self->is_central, sec_info_request->master_id.ediv, &self->bonding_keys) ) { +// sd_ble_gap_sec_info_reply( +// self->conn_handle, +// &self->bonding_keys.own_enc.enc_info, +// &self->bonding_keys.peer_id.id_info, +// NULL); +// self->ediv = self->bonding_keys.own_enc.master_id.ediv; +// } else { +// // We don't have stored keys. Ask for keys. +// sd_ble_gap_sec_info_reply(self->conn_handle, NULL, NULL, NULL); +// } +// break; +// } - case BLE_GAP_EVT_CONN_SEC_UPDATE: { // 0x1a - // We get this both on first-time pairing and on subsequent pairings using stored keys. - ble_gap_conn_sec_t* conn_sec = &ble_evt->evt.gap_evt.params.conn_sec_update.conn_sec; - if (conn_sec->sec_mode.sm <= 1 && conn_sec->sec_mode.lv <= 1) { - // Security setup did not succeed: - // mode 0, level 0 means no access - // mode 1, level 1 means open link - // mode >=1 and/or level >=1 means encryption is set up - self->pair_status = PAIR_NOT_PAIRED; - } else { - if (bonding_load_cccd_info(self->is_central, self->conn_handle, self->ediv)) { - // Did an sd_ble_gatts_sys_attr_set() with the stored sys_attr values. - } else { - // No matching bonding found, so use fresh system attributes. - sd_ble_gatts_sys_attr_set(self->conn_handle, NULL, 0, 0); - } - self->pair_status = PAIR_PAIRED; - } - break; - } +// case BLE_GAP_EVT_CONN_SEC_UPDATE: { // 0x1a +// // We get this both on first-time pairing and on subsequent pairings using stored keys. +// ble_gap_conn_sec_t* conn_sec = &ble_evt->evt.gap_evt.params.conn_sec_update.conn_sec; +// if (conn_sec->sec_mode.sm <= 1 && conn_sec->sec_mode.lv <= 1) { +// // Security setup did not succeed: +// // mode 0, level 0 means no access +// // mode 1, level 1 means open link +// // mode >=1 and/or level >=1 means encryption is set up +// self->pair_status = PAIR_NOT_PAIRED; +// } else { +// if (bonding_load_cccd_info(self->is_central, self->conn_handle, self->ediv)) { +// // Did an sd_ble_gatts_sys_attr_set() with the stored sys_attr values. +// } else { +// // No matching bonding found, so use fresh system attributes. +// sd_ble_gatts_sys_attr_set(self->conn_handle, NULL, 0, 0); +// } +// self->pair_status = PAIR_PAIRED; +// } +// break; +// } - default: - return false; - } - return true; -} +// default: +// return false; +// } +// return true; +// } void bleio_connection_clear(bleio_connection_internal_t *self) { self->remote_service_list = NULL; - self->conn_handle = BLE_CONN_HANDLE_INVALID; + //FIX self->conn_handle = BLE_CONN_HANDLE_INVALID; self->pair_status = PAIR_NOT_PAIRED; - bonding_clear_keys(&self->bonding_keys); + //FIX bonding_clear_keys(&self->bonding_keys); } bool common_hal_bleio_connection_get_paired(bleio_connection_obj_t *self) { @@ -339,17 +337,18 @@ bool common_hal_bleio_connection_get_connected(bleio_connection_obj_t *self) { if (self->connection == NULL) { return false; } - return self->connection->conn_handle != BLE_CONN_HANDLE_INVALID; + return false; + //FIX return self->connection->conn_handle != BLE_CONN_HANDLE_INVALID; } void common_hal_bleio_connection_disconnect(bleio_connection_internal_t *self) { - sd_ble_gap_disconnect(self->conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION); + //FIX sd_ble_gap_disconnect(self->conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION); } void common_hal_bleio_connection_pair(bleio_connection_internal_t *self, bool bond) { self->pair_status = PAIR_WAITING; - check_nrf_error(sd_ble_gap_authenticate(self->conn_handle, &pairing_sec_params)); + //FIX check_nrf_error(sd_ble_gap_authenticate(self->conn_handle, &pairing_sec_params)); while (self->pair_status == PAIR_WAITING && !mp_hal_is_interrupted()) { RUN_BACKGROUND_TASKS; @@ -364,369 +363,371 @@ mp_float_t common_hal_bleio_connection_get_connection_interval(bleio_connection_ while (self->conn_params_updating && !mp_hal_is_interrupted()) { RUN_BACKGROUND_TASKS; } - return 1.25f * self->conn_params.min_conn_interval; + //FIX return 1.25f * self->conn_params.min_conn_interval; + return 0.0f; } // Return the current negotiated MTU length, minus overhead. mp_int_t common_hal_bleio_connection_get_max_packet_length(bleio_connection_internal_t *self) { - return (self->mtu == 0 ? BLE_GATT_ATT_MTU_DEFAULT : self->mtu) - 3; + /// FIX return (self->mtu == 0 ? BLE_GATT_ATT_MTU_DEFAULT : self->mtu) - 3; + return 0; } void common_hal_bleio_connection_set_connection_interval(bleio_connection_internal_t *self, mp_float_t new_interval) { - self->conn_params_updating = true; - uint16_t interval = new_interval / 1.25f; - self->conn_params.min_conn_interval = interval; - self->conn_params.max_conn_interval = interval; - uint32_t status = NRF_ERROR_BUSY; - while (status == NRF_ERROR_BUSY) { - status = sd_ble_gap_conn_param_update(self->conn_handle, &self->conn_params); - RUN_BACKGROUND_TASKS; - } - check_nrf_error(status); + // self->conn_params_updating = true; + // uint16_t interval = new_interval / 1.25f; + // self->conn_params.min_conn_interval = interval; + // self->conn_params.max_conn_interval = interval; + // uint32_t status = NRF_ERROR_BUSY; + // while (status == NRF_ERROR_BUSY) { + // status = sd_ble_gap_conn_param_update(self->conn_handle, &self->conn_params); + // RUN_BACKGROUND_TASKS; + // } + // check_nrf_error(status); } // service_uuid may be NULL, to discover all services. -STATIC bool discover_next_services(bleio_connection_internal_t* connection, uint16_t start_handle, ble_uuid_t *service_uuid) { - m_discovery_successful = false; - m_discovery_in_process = true; - - uint32_t nrf_err = NRF_ERROR_BUSY; - while (nrf_err == NRF_ERROR_BUSY) { - nrf_err = sd_ble_gattc_primary_services_discover(connection->conn_handle, start_handle, service_uuid); - } - check_nrf_error(nrf_err); - - // Wait for a discovery event. - while (m_discovery_in_process) { - MICROPY_VM_HOOK_LOOP; - } - return m_discovery_successful; -} - -STATIC bool discover_next_characteristics(bleio_connection_internal_t* connection, bleio_service_obj_t *service, uint16_t start_handle) { - m_char_discovery_service = service; - - ble_gattc_handle_range_t handle_range; - handle_range.start_handle = start_handle; - handle_range.end_handle = service->end_handle; - - m_discovery_successful = false; - m_discovery_in_process = true; - - uint32_t err_code = sd_ble_gattc_characteristics_discover(connection->conn_handle, &handle_range); - if (err_code != NRF_SUCCESS) { - return false; - } - - // Wait for a discovery event. - while (m_discovery_in_process) { - MICROPY_VM_HOOK_LOOP; - } - return m_discovery_successful; -} - -STATIC bool discover_next_descriptors(bleio_connection_internal_t* connection, bleio_characteristic_obj_t *characteristic, uint16_t start_handle, uint16_t end_handle) { - m_desc_discovery_characteristic = characteristic; - - ble_gattc_handle_range_t handle_range; - handle_range.start_handle = start_handle; - handle_range.end_handle = end_handle; - - m_discovery_successful = false; - m_discovery_in_process = true; - - uint32_t err_code = sd_ble_gattc_descriptors_discover(connection->conn_handle, &handle_range); - if (err_code != NRF_SUCCESS) { - return false; - } - - // Wait for a discovery event. - while (m_discovery_in_process) { - MICROPY_VM_HOOK_LOOP; - } - return m_discovery_successful; -} - -STATIC void on_primary_srv_discovery_rsp(ble_gattc_evt_prim_srvc_disc_rsp_t *response, bleio_connection_internal_t* connection) { - bleio_service_obj_t* tail = connection->remote_service_list; - - for (size_t i = 0; i < response->count; ++i) { - ble_gattc_service_t *gattc_service = &response->services[i]; - - bleio_service_obj_t *service = m_new_obj(bleio_service_obj_t); - service->base.type = &bleio_service_type; - - // Initialize several fields at once. - bleio_service_from_connection(service, bleio_connection_new_from_internal(connection)); - - service->is_remote = true; - service->start_handle = gattc_service->handle_range.start_handle; - service->end_handle = gattc_service->handle_range.end_handle; - service->handle = gattc_service->handle_range.start_handle; - - if (gattc_service->uuid.type != BLE_UUID_TYPE_UNKNOWN) { - // Known service UUID. - bleio_uuid_obj_t *uuid = m_new_obj(bleio_uuid_obj_t); - uuid->base.type = &bleio_uuid_type; - bleio_uuid_construct_from_nrf_ble_uuid(uuid, &gattc_service->uuid); - service->uuid = uuid; - } else { - // The discovery response contained a 128-bit UUID that has not yet been registered with the - // softdevice via sd_ble_uuid_vs_add(). We need to fetch the 128-bit value and register it. - // For now, just set the UUID to NULL. - service->uuid = NULL; - } - - service->next = tail; - tail = service; - } - - connection->remote_service_list = tail; - - if (response->count > 0) { - m_discovery_successful = true; - } - m_discovery_in_process = false; -} - -STATIC void on_char_discovery_rsp(ble_gattc_evt_char_disc_rsp_t *response, bleio_connection_internal_t* connection) { - for (size_t i = 0; i < response->count; ++i) { - ble_gattc_char_t *gattc_char = &response->chars[i]; - - bleio_characteristic_obj_t *characteristic = m_new_obj(bleio_characteristic_obj_t); - characteristic->base.type = &bleio_characteristic_type; - - bleio_uuid_obj_t *uuid = NULL; - - if (gattc_char->uuid.type != BLE_UUID_TYPE_UNKNOWN) { - // Known characteristic UUID. - uuid = m_new_obj(bleio_uuid_obj_t); - uuid->base.type = &bleio_uuid_type; - bleio_uuid_construct_from_nrf_ble_uuid(uuid, &gattc_char->uuid); - } else { - // The discovery response contained a 128-bit UUID that has not yet been registered with the - // softdevice via sd_ble_uuid_vs_add(). We need to fetch the 128-bit value and register it. - // For now, just leave the UUID as NULL. - } - - bleio_characteristic_properties_t props = - (gattc_char->char_props.broadcast ? CHAR_PROP_BROADCAST : 0) | - (gattc_char->char_props.indicate ? CHAR_PROP_INDICATE : 0) | - (gattc_char->char_props.notify ? CHAR_PROP_NOTIFY : 0) | - (gattc_char->char_props.read ? CHAR_PROP_READ : 0) | - (gattc_char->char_props.write ? CHAR_PROP_WRITE : 0) | - (gattc_char->char_props.write_wo_resp ? CHAR_PROP_WRITE_NO_RESPONSE : 0); - - // Call common_hal_bleio_characteristic_construct() to initalize some fields and set up evt handler. - common_hal_bleio_characteristic_construct( - characteristic, m_char_discovery_service, gattc_char->handle_value, uuid, - props, SECURITY_MODE_OPEN, SECURITY_MODE_OPEN, - GATT_MAX_DATA_LENGTH, false, // max_length, fixed_length: values may not matter for gattc - NULL); - - mp_obj_list_append(m_char_discovery_service->characteristic_list, MP_OBJ_FROM_PTR(characteristic)); - } - - if (response->count > 0) { - m_discovery_successful = true; - } - m_discovery_in_process = false; -} - -STATIC void on_desc_discovery_rsp(ble_gattc_evt_desc_disc_rsp_t *response, bleio_connection_internal_t* connection) { - for (size_t i = 0; i < response->count; ++i) { - ble_gattc_desc_t *gattc_desc = &response->descs[i]; - - // Remember handles for certain well-known descriptors. - switch (gattc_desc->uuid.uuid) { - case BLE_UUID_DESCRIPTOR_CLIENT_CHAR_CONFIG: - m_desc_discovery_characteristic->cccd_handle = gattc_desc->handle; - break; - - case BLE_UUID_DESCRIPTOR_SERVER_CHAR_CONFIG: - m_desc_discovery_characteristic->sccd_handle = gattc_desc->handle; - break; - - case BLE_UUID_DESCRIPTOR_CHAR_USER_DESC: - m_desc_discovery_characteristic->user_desc_handle = gattc_desc->handle; - break; - - default: - // TODO: sd_ble_gattc_descriptors_discover() can return things that are not descriptors, - // so ignore those. - // https://devzone.nordicsemi.com/f/nordic-q-a/49500/sd_ble_gattc_descriptors_discover-is-returning-attributes-that-are-not-descriptors - break; - } - - bleio_descriptor_obj_t *descriptor = m_new_obj(bleio_descriptor_obj_t); - descriptor->base.type = &bleio_descriptor_type; - - bleio_uuid_obj_t *uuid = NULL; - - if (gattc_desc->uuid.type != BLE_UUID_TYPE_UNKNOWN) { - // Known descriptor UUID. - uuid = m_new_obj(bleio_uuid_obj_t); - uuid->base.type = &bleio_uuid_type; - bleio_uuid_construct_from_nrf_ble_uuid(uuid, &gattc_desc->uuid); - } else { - // The discovery response contained a 128-bit UUID that has not yet been registered with the - // softdevice via sd_ble_uuid_vs_add(). We need to fetch the 128-bit value and register it. - // For now, just leave the UUID as NULL. - } - - common_hal_bleio_descriptor_construct( - descriptor, m_desc_discovery_characteristic, uuid, - SECURITY_MODE_OPEN, SECURITY_MODE_OPEN, - GATT_MAX_DATA_LENGTH, false, mp_const_empty_bytes); - descriptor->handle = gattc_desc->handle; - - mp_obj_list_append(m_desc_discovery_characteristic->descriptor_list, MP_OBJ_FROM_PTR(descriptor)); - } - - if (response->count > 0) { - m_discovery_successful = true; - } - m_discovery_in_process = false; -} - -STATIC bool discovery_on_ble_evt(ble_evt_t *ble_evt, mp_obj_t payload) { - bleio_connection_internal_t* connection = MP_OBJ_TO_PTR(payload); - switch (ble_evt->header.evt_id) { - case BLE_GAP_EVT_DISCONNECTED: - m_discovery_successful = false; - m_discovery_in_process = false; - break; - - case BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP: - on_primary_srv_discovery_rsp(&ble_evt->evt.gattc_evt.params.prim_srvc_disc_rsp, connection); - break; - - case BLE_GATTC_EVT_CHAR_DISC_RSP: - on_char_discovery_rsp(&ble_evt->evt.gattc_evt.params.char_disc_rsp, connection); - break; - - case BLE_GATTC_EVT_DESC_DISC_RSP: - on_desc_discovery_rsp(&ble_evt->evt.gattc_evt.params.desc_disc_rsp, connection); - break; - - default: - // CONNECTION_DEBUG_PRINTF(&mp_plat_print, "Unhandled discovery event: 0x%04x\n", ble_evt->header.evt_id); - return false; - break; - } - return true; -} - -STATIC void discover_remote_services(bleio_connection_internal_t *self, mp_obj_t service_uuids_whitelist) { - ble_drv_add_event_handler(discovery_on_ble_evt, self); - - // Start over with an empty list. - self->remote_service_list = NULL; - - if (service_uuids_whitelist == mp_const_none) { - // List of service UUID's not given, so discover all available services. - - uint16_t next_service_start_handle = BLE_GATT_HANDLE_START; - - while (discover_next_services(self, next_service_start_handle, MP_OBJ_NULL)) { - // discover_next_services() appends to remote_services_list. - - // Get the most recently discovered service, and then ask for services - // whose handles start after the last attribute handle inside that service. - const bleio_service_obj_t *service = self->remote_service_list; - next_service_start_handle = service->end_handle + 1; - } - } else { - mp_obj_iter_buf_t iter_buf; - mp_obj_t iterable = mp_getiter(service_uuids_whitelist, &iter_buf); - mp_obj_t uuid_obj; - while ((uuid_obj = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) { - if (!MP_OBJ_IS_TYPE(uuid_obj, &bleio_uuid_type)) { - mp_raise_TypeError(translate("non-UUID found in service_uuids_whitelist")); - } - bleio_uuid_obj_t *uuid = MP_OBJ_TO_PTR(uuid_obj); - - ble_uuid_t nrf_uuid; - bleio_uuid_convert_to_nrf_ble_uuid(uuid, &nrf_uuid); - - // Service might or might not be discovered; that's ok. Caller has to check - // Central.remote_services to find out. - // We only need to call this once for each service to discover. - discover_next_services(self, BLE_GATT_HANDLE_START, &nrf_uuid); - } - } - - - bleio_service_obj_t *service = self->remote_service_list; - while (service != NULL) { - // Skip the service if it had an unknown (unregistered) UUID. - if (service->uuid == NULL) { - service = service->next; - continue; - } - - uint16_t next_char_start_handle = service->start_handle; - - // Stop when we go past the end of the range of handles for this service or - // discovery call returns nothing. - // discover_next_characteristics() appends to the characteristic_list. - while (next_char_start_handle <= service->end_handle && - discover_next_characteristics(self, service, next_char_start_handle)) { - - - // Get the most recently discovered characteristic, and then ask for characteristics - // whose handles start after the last attribute handle inside that characteristic. - const bleio_characteristic_obj_t *characteristic = - MP_OBJ_TO_PTR(service->characteristic_list->items[service->characteristic_list->len - 1]); - - next_char_start_handle = characteristic->handle + 1; - } - - // Got characteristics for this service. Now discover descriptors for each characteristic. - size_t char_list_len = service->characteristic_list->len; - for (size_t char_idx = 0; char_idx < char_list_len; ++char_idx) { - bleio_characteristic_obj_t *characteristic = - MP_OBJ_TO_PTR(service->characteristic_list->items[char_idx]); - const bool last_characteristic = char_idx == char_list_len - 1; - bleio_characteristic_obj_t *next_characteristic = last_characteristic - ? NULL - : MP_OBJ_TO_PTR(service->characteristic_list->items[char_idx + 1]); - - // Skip the characteristic if it had an unknown (unregistered) UUID. - if (characteristic->uuid == NULL) { - continue; - } - - uint16_t next_desc_start_handle = characteristic->handle + 1; - - // Don't run past the end of this service or the beginning of the next characteristic. - uint16_t next_desc_end_handle = next_characteristic == NULL - ? service->end_handle - : next_characteristic->handle - 1; - - // Stop when we go past the end of the range of handles for this service or - // discovery call returns nothing. - // discover_next_descriptors() appends to the descriptor_list. - while (next_desc_start_handle <= service->end_handle && - next_desc_start_handle <= next_desc_end_handle && - discover_next_descriptors(self, characteristic, - next_desc_start_handle, next_desc_end_handle)) { - // Get the most recently discovered descriptor, and then ask for descriptors - // whose handles start after that descriptor's handle. - const bleio_descriptor_obj_t *descriptor = characteristic->descriptor_list; - next_desc_start_handle = descriptor->handle + 1; - } - } - service = service->next; - } - - // This event handler is no longer needed. - ble_drv_remove_event_handler(discovery_on_ble_evt, self); - -} +// STATIC bool discover_next_services(bleio_connection_internal_t* connection, uint16_t start_handle, ble_uuid_t *service_uuid) { +// m_discovery_successful = false; +// m_discovery_in_process = true; + +// uint32_t nrf_err = NRF_ERROR_BUSY; +// while (nrf_err == NRF_ERROR_BUSY) { +// nrf_err = sd_ble_gattc_primary_services_discover(connection->conn_handle, start_handle, service_uuid); +// } +// check_nrf_error(nrf_err); + +// // Wait for a discovery event. +// while (m_discovery_in_process) { +// MICROPY_VM_HOOK_LOOP; +// } +// return m_discovery_successful; +// } + +// STATIC bool discover_next_characteristics(bleio_connection_internal_t* connection, bleio_service_obj_t *service, uint16_t start_handle) { +// m_char_discovery_service = service; + +// ble_gattc_handle_range_t handle_range; +// handle_range.start_handle = start_handle; +// handle_range.end_handle = service->end_handle; + +// m_discovery_successful = false; +// m_discovery_in_process = true; + +// uint32_t err_code = sd_ble_gattc_characteristics_discover(connection->conn_handle, &handle_range); +// if (err_code != NRF_SUCCESS) { +// return false; +// } + +// // Wait for a discovery event. +// while (m_discovery_in_process) { +// MICROPY_VM_HOOK_LOOP; +// } +// return m_discovery_successful; +// } + +// STATIC bool discover_next_descriptors(bleio_connection_internal_t* connection, bleio_characteristic_obj_t *characteristic, uint16_t start_handle, uint16_t end_handle) { +// m_desc_discovery_characteristic = characteristic; + +// ble_gattc_handle_range_t handle_range; +// handle_range.start_handle = start_handle; +// handle_range.end_handle = end_handle; + +// m_discovery_successful = false; +// m_discovery_in_process = true; + +// uint32_t err_code = sd_ble_gattc_descriptors_discover(connection->conn_handle, &handle_range); +// if (err_code != NRF_SUCCESS) { +// return false; +// } + +// // Wait for a discovery event. +// while (m_discovery_in_process) { +// MICROPY_VM_HOOK_LOOP; +// } +// return m_discovery_successful; +// } + +// STATIC void on_primary_srv_discovery_rsp(ble_gattc_evt_prim_srvc_disc_rsp_t *response, bleio_connection_internal_t* connection) { +// bleio_service_obj_t* tail = connection->remote_service_list; + +// for (size_t i = 0; i < response->count; ++i) { +// ble_gattc_service_t *gattc_service = &response->services[i]; + +// bleio_service_obj_t *service = m_new_obj(bleio_service_obj_t); +// service->base.type = &bleio_service_type; + +// // Initialize several fields at once. +// bleio_service_from_connection(service, bleio_connection_new_from_internal(connection)); + +// service->is_remote = true; +// service->start_handle = gattc_service->handle_range.start_handle; +// service->end_handle = gattc_service->handle_range.end_handle; +// service->handle = gattc_service->handle_range.start_handle; + +// if (gattc_service->uuid.type != BLE_UUID_TYPE_UNKNOWN) { +// // Known service UUID. +// bleio_uuid_obj_t *uuid = m_new_obj(bleio_uuid_obj_t); +// uuid->base.type = &bleio_uuid_type; +// bleio_uuid_construct_from_nrf_ble_uuid(uuid, &gattc_service->uuid); +// service->uuid = uuid; +// } else { +// // The discovery response contained a 128-bit UUID that has not yet been registered with the +// // softdevice via sd_ble_uuid_vs_add(). We need to fetch the 128-bit value and register it. +// // For now, just set the UUID to NULL. +// service->uuid = NULL; +// } + +// service->next = tail; +// tail = service; +// } + +// connection->remote_service_list = tail; + +// if (response->count > 0) { +// m_discovery_successful = true; +// } +// m_discovery_in_process = false; +// } + +// STATIC void on_char_discovery_rsp(ble_gattc_evt_char_disc_rsp_t *response, bleio_connection_internal_t* connection) { +// for (size_t i = 0; i < response->count; ++i) { +// ble_gattc_char_t *gattc_char = &response->chars[i]; + +// bleio_characteristic_obj_t *characteristic = m_new_obj(bleio_characteristic_obj_t); +// characteristic->base.type = &bleio_characteristic_type; + +// bleio_uuid_obj_t *uuid = NULL; + +// if (gattc_char->uuid.type != BLE_UUID_TYPE_UNKNOWN) { +// // Known characteristic UUID. +// uuid = m_new_obj(bleio_uuid_obj_t); +// uuid->base.type = &bleio_uuid_type; +// bleio_uuid_construct_from_nrf_ble_uuid(uuid, &gattc_char->uuid); +// } else { +// // The discovery response contained a 128-bit UUID that has not yet been registered with the +// // softdevice via sd_ble_uuid_vs_add(). We need to fetch the 128-bit value and register it. +// // For now, just leave the UUID as NULL. +// } + +// bleio_characteristic_properties_t props = +// (gattc_char->char_props.broadcast ? CHAR_PROP_BROADCAST : 0) | +// (gattc_char->char_props.indicate ? CHAR_PROP_INDICATE : 0) | +// (gattc_char->char_props.notify ? CHAR_PROP_NOTIFY : 0) | +// (gattc_char->char_props.read ? CHAR_PROP_READ : 0) | +// (gattc_char->char_props.write ? CHAR_PROP_WRITE : 0) | +// (gattc_char->char_props.write_wo_resp ? CHAR_PROP_WRITE_NO_RESPONSE : 0); + +// // Call common_hal_bleio_characteristic_construct() to initalize some fields and set up evt handler. +// common_hal_bleio_characteristic_construct( +// characteristic, m_char_discovery_service, gattc_char->handle_value, uuid, +// props, SECURITY_MODE_OPEN, SECURITY_MODE_OPEN, +// GATT_MAX_DATA_LENGTH, false, // max_length, fixed_length: values may not matter for gattc +// NULL); + +// mp_obj_list_append(m_char_discovery_service->characteristic_list, MP_OBJ_FROM_PTR(characteristic)); +// } + +// if (response->count > 0) { +// m_discovery_successful = true; +// } +// m_discovery_in_process = false; +// } + +// STATIC void on_desc_discovery_rsp(ble_gattc_evt_desc_disc_rsp_t *response, bleio_connection_internal_t* connection) { +// for (size_t i = 0; i < response->count; ++i) { +// ble_gattc_desc_t *gattc_desc = &response->descs[i]; + +// // Remember handles for certain well-known descriptors. +// switch (gattc_desc->uuid.uuid) { +// case BLE_UUID_DESCRIPTOR_CLIENT_CHAR_CONFIG: +// m_desc_discovery_characteristic->cccd_handle = gattc_desc->handle; +// break; + +// case BLE_UUID_DESCRIPTOR_SERVER_CHAR_CONFIG: +// m_desc_discovery_characteristic->sccd_handle = gattc_desc->handle; +// break; + +// case BLE_UUID_DESCRIPTOR_CHAR_USER_DESC: +// m_desc_discovery_characteristic->user_desc_handle = gattc_desc->handle; +// break; + +// default: +// // TODO: sd_ble_gattc_descriptors_discover() can return things that are not descriptors, +// // so ignore those. +// // https://devzone.nordicsemi.com/f/nordic-q-a/49500/sd_ble_gattc_descriptors_discover-is-returning-attributes-that-are-not-descriptors +// break; +// } + +// bleio_descriptor_obj_t *descriptor = m_new_obj(bleio_descriptor_obj_t); +// descriptor->base.type = &bleio_descriptor_type; + +// bleio_uuid_obj_t *uuid = NULL; + +// if (gattc_desc->uuid.type != BLE_UUID_TYPE_UNKNOWN) { +// // Known descriptor UUID. +// uuid = m_new_obj(bleio_uuid_obj_t); +// uuid->base.type = &bleio_uuid_type; +// bleio_uuid_construct_from_nrf_ble_uuid(uuid, &gattc_desc->uuid); +// } else { +// // The discovery response contained a 128-bit UUID that has not yet been registered with the +// // softdevice via sd_ble_uuid_vs_add(). We need to fetch the 128-bit value and register it. +// // For now, just leave the UUID as NULL. +// } + +// common_hal_bleio_descriptor_construct( +// descriptor, m_desc_discovery_characteristic, uuid, +// SECURITY_MODE_OPEN, SECURITY_MODE_OPEN, +// GATT_MAX_DATA_LENGTH, false, mp_const_empty_bytes); +// descriptor->handle = gattc_desc->handle; + +// mp_obj_list_append(m_desc_discovery_characteristic->descriptor_list, MP_OBJ_FROM_PTR(descriptor)); +// } + +// if (response->count > 0) { +// m_discovery_successful = true; +// } +// m_discovery_in_process = false; +// } + +// STATIC bool discovery_on_ble_evt(ble_evt_t *ble_evt, mp_obj_t payload) { +// bleio_connection_internal_t* connection = MP_OBJ_TO_PTR(payload); +// switch (ble_evt->header.evt_id) { +// case BLE_GAP_EVT_DISCONNECTED: +// m_discovery_successful = false; +// m_discovery_in_process = false; +// break; + +// case BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP: +// on_primary_srv_discovery_rsp(&ble_evt->evt.gattc_evt.params.prim_srvc_disc_rsp, connection); +// break; + +// case BLE_GATTC_EVT_CHAR_DISC_RSP: +// on_char_discovery_rsp(&ble_evt->evt.gattc_evt.params.char_disc_rsp, connection); +// break; + +// case BLE_GATTC_EVT_DESC_DISC_RSP: +// on_desc_discovery_rsp(&ble_evt->evt.gattc_evt.params.desc_disc_rsp, connection); +// break; + +// default: +// // CONNECTION_DEBUG_PRINTF(&mp_plat_print, "Unhandled discovery event: 0x%04x\n", ble_evt->header.evt_id); +// return false; +// break; +// } +// return true; +// } + +// STATIC void discover_remote_services(bleio_connection_internal_t *self, mp_obj_t service_uuids_whitelist) { +// ble_drv_add_event_handler(discovery_on_ble_evt, self); + +// // Start over with an empty list. +// self->remote_service_list = NULL; + +// if (service_uuids_whitelist == mp_const_none) { +// // List of service UUID's not given, so discover all available services. + +// uint16_t next_service_start_handle = BLE_GATT_HANDLE_START; + +// while (discover_next_services(self, next_service_start_handle, MP_OBJ_NULL)) { +// // discover_next_services() appends to remote_services_list. + +// // Get the most recently discovered service, and then ask for services +// // whose handles start after the last attribute handle inside that service. +// const bleio_service_obj_t *service = self->remote_service_list; +// next_service_start_handle = service->end_handle + 1; +// } +// } else { +// mp_obj_iter_buf_t iter_buf; +// mp_obj_t iterable = mp_getiter(service_uuids_whitelist, &iter_buf); +// mp_obj_t uuid_obj; +// while ((uuid_obj = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) { +// if (!MP_OBJ_IS_TYPE(uuid_obj, &bleio_uuid_type)) { +// mp_raise_TypeError(translate("non-UUID found in service_uuids_whitelist")); +// } +// bleio_uuid_obj_t *uuid = MP_OBJ_TO_PTR(uuid_obj); + +// ble_uuid_t nrf_uuid; +// bleio_uuid_convert_to_nrf_ble_uuid(uuid, &nrf_uuid); + +// // Service might or might not be discovered; that's ok. Caller has to check +// // Central.remote_services to find out. +// // We only need to call this once for each service to discover. +// discover_next_services(self, BLE_GATT_HANDLE_START, &nrf_uuid); +// } +// } + + +// bleio_service_obj_t *service = self->remote_service_list; +// while (service != NULL) { +// // Skip the service if it had an unknown (unregistered) UUID. +// if (service->uuid == NULL) { +// service = service->next; +// continue; +// } + +// uint16_t next_char_start_handle = service->start_handle; + +// // Stop when we go past the end of the range of handles for this service or +// // discovery call returns nothing. +// // discover_next_characteristics() appends to the characteristic_list. +// while (next_char_start_handle <= service->end_handle && +// discover_next_characteristics(self, service, next_char_start_handle)) { + + +// // Get the most recently discovered characteristic, and then ask for characteristics +// // whose handles start after the last attribute handle inside that characteristic. +// const bleio_characteristic_obj_t *characteristic = +// MP_OBJ_TO_PTR(service->characteristic_list->items[service->characteristic_list->len - 1]); + +// next_char_start_handle = characteristic->handle + 1; +// } + +// // Got characteristics for this service. Now discover descriptors for each characteristic. +// size_t char_list_len = service->characteristic_list->len; +// for (size_t char_idx = 0; char_idx < char_list_len; ++char_idx) { +// bleio_characteristic_obj_t *characteristic = +// MP_OBJ_TO_PTR(service->characteristic_list->items[char_idx]); +// const bool last_characteristic = char_idx == char_list_len - 1; +// bleio_characteristic_obj_t *next_characteristic = last_characteristic +// ? NULL +// : MP_OBJ_TO_PTR(service->characteristic_list->items[char_idx + 1]); + +// // Skip the characteristic if it had an unknown (unregistered) UUID. +// if (characteristic->uuid == NULL) { +// continue; +// } + +// uint16_t next_desc_start_handle = characteristic->handle + 1; + +// // Don't run past the end of this service or the beginning of the next characteristic. +// uint16_t next_desc_end_handle = next_characteristic == NULL +// ? service->end_handle +// : next_characteristic->handle - 1; + +// // Stop when we go past the end of the range of handles for this service or +// // discovery call returns nothing. +// // discover_next_descriptors() appends to the descriptor_list. +// while (next_desc_start_handle <= service->end_handle && +// next_desc_start_handle <= next_desc_end_handle && +// discover_next_descriptors(self, characteristic, +// next_desc_start_handle, next_desc_end_handle)) { +// // Get the most recently discovered descriptor, and then ask for descriptors +// // whose handles start after that descriptor's handle. +// const bleio_descriptor_obj_t *descriptor = characteristic->descriptor_list; +// next_desc_start_handle = descriptor->handle + 1; +// } +// } +// service = service->next; +// } + +// // This event handler is no longer needed. +// ble_drv_remove_event_handler(discovery_on_ble_evt, self); + +// } mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(bleio_connection_obj_t *self, mp_obj_t service_uuids_whitelist) { - discover_remote_services(self->connection, service_uuids_whitelist); + //FIX discover_remote_services(self->connection, service_uuids_whitelist); bleio_connection_ensure_connected(self); // Convert to a tuple and then clear the list so the callee will take ownership. mp_obj_tuple_t *services_tuple = service_linked_list_to_tuple(self->connection->remote_service_list); @@ -756,13 +757,13 @@ mp_obj_t bleio_connection_new_from_internal(bleio_connection_internal_t* interna // Find the connection that uses the given conn_handle. Return NULL if not found. bleio_connection_internal_t *bleio_conn_handle_to_connection(uint16_t conn_handle) { - bleio_connection_internal_t *connection; - for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { - connection = &bleio_connections[i]; - if (connection->conn_handle == conn_handle) { - return connection; - } - } + //FIX bleio_connection_internal_t *connection; + // for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + // connection = &bleio_connections[i]; + // if (connection->conn_handle == conn_handle) { + // return connection; + // } + // } return NULL; } diff --git a/devices/ble_hci/common-hal/_bleio/Connection.h b/devices/ble_hci/common-hal/_bleio/Connection.h index 7ad91aa5c5..bb0c140c55 100644 --- a/devices/ble_hci/common-hal/_bleio/Connection.h +++ b/devices/ble_hci/common-hal/_bleio/Connection.h @@ -34,7 +34,6 @@ #include "py/objlist.h" #include "common-hal/_bleio/__init__.h" -#include "common-hal/_bleio/bonding.h" #include "shared-module/_bleio/Address.h" #include "common-hal/_bleio/Service.h" diff --git a/devices/ble_hci/common-hal/_bleio/PacketBuffer.c b/devices/ble_hci/common-hal/_bleio/PacketBuffer.c index c3f41bc9d4..65d4139605 100644 --- a/devices/ble_hci/common-hal/_bleio/PacketBuffer.c +++ b/devices/ble_hci/common-hal/_bleio/PacketBuffer.c @@ -36,151 +36,152 @@ #include "shared-bindings/_bleio/PacketBuffer.h" #include "supervisor/shared/tick.h" -STATIC void write_to_ringbuf(bleio_packet_buffer_obj_t *self, uint8_t *data, uint16_t len) { - if (len + sizeof(uint16_t) > ringbuf_capacity(&self->ringbuf)) { - // This shouldn't happen. - return; - } - // Push all the data onto the ring buffer. - uint8_t is_nested_critical_region; - sd_nvic_critical_region_enter(&is_nested_critical_region); - // Make room for the new value by dropping the oldest packets first. - while (ringbuf_capacity(&self->ringbuf) - ringbuf_num_filled(&self->ringbuf) < len + sizeof(uint16_t)) { - uint16_t packet_length; - ringbuf_get_n(&self->ringbuf, (uint8_t*) &packet_length, sizeof(uint16_t)); - for (uint16_t i = 0; i < packet_length; i++) { - ringbuf_get(&self->ringbuf); - } - // set an overflow flag? - } - ringbuf_put_n(&self->ringbuf, (uint8_t*) &len, sizeof(uint16_t)); - ringbuf_put_n(&self->ringbuf, data, len); - sd_nvic_critical_region_exit(is_nested_critical_region); -} +// STATIC void write_to_ringbuf(bleio_packet_buffer_obj_t *self, uint8_t *data, uint16_t len) { +// if (len + sizeof(uint16_t) > ringbuf_capacity(&self->ringbuf)) { +// // This shouldn't happen. +// return; +// } +// // Push all the data onto the ring buffer. +// //FIX uint8_t is_nested_critical_region; +// //FIX sd_nvic_critical_region_enter(&is_nested_critical_region); +// // Make room for the new value by dropping the oldest packets first. +// while (ringbuf_capacity(&self->ringbuf) - ringbuf_num_filled(&self->ringbuf) < len + sizeof(uint16_t)) { +// uint16_t packet_length; +// ringbuf_get_n(&self->ringbuf, (uint8_t*) &packet_length, sizeof(uint16_t)); +// for (uint16_t i = 0; i < packet_length; i++) { +// ringbuf_get(&self->ringbuf); +// } +// // set an overflow flag? +// } +// ringbuf_put_n(&self->ringbuf, (uint8_t*) &len, sizeof(uint16_t)); +// ringbuf_put_n(&self->ringbuf, data, len); +// //FIX sd_nvic_critical_region_exit(is_nested_critical_region); +// } -STATIC uint32_t queue_next_write(bleio_packet_buffer_obj_t *self) { - // Queue up the next outgoing buffer. We use two, one that has been passed to the SD for - // transmission (when packet_queued is true) and the other is `pending` and can still be - // modified. By primarily appending to the `pending` buffer we can reduce the protocol overhead - // of the lower level link and ATT layers. - self->packet_queued = false; - if (self->pending_size > 0) { - uint16_t conn_handle = self->conn_handle; - uint32_t err_code; - if (self->client) { - ble_gattc_write_params_t write_params = { - .write_op = self->write_type, - .handle = self->characteristic->handle, - .p_value = self->outgoing[self->pending_index], - .len = self->pending_size, - }; +//FIX +// STATIC uint32_t queue_next_write(bleio_packet_buffer_obj_t *self) { +// // Queue up the next outgoing buffer. We use two, one that has been passed to the SD for +// // transmission (when packet_queued is true) and the other is `pending` and can still be +// // modified. By primarily appending to the `pending` buffer we can reduce the protocol overhead +// // of the lower level link and ATT layers. +// self->packet_queued = false; +// if (self->pending_size > 0) { +// uint16_t conn_handle = self->conn_handle; +// uint32_t err_code; +// if (self->client) { +// ble_gattc_write_params_t write_params = { +// .write_op = self->write_type, +// .handle = self->characteristic->handle, +// .p_value = self->outgoing[self->pending_index], +// .len = self->pending_size, +// }; - err_code = sd_ble_gattc_write(conn_handle, &write_params); - } else { - uint16_t hvx_len = self->pending_size; +// err_code = sd_ble_gattc_write(conn_handle, &write_params); +// } else { +// uint16_t hvx_len = self->pending_size; - ble_gatts_hvx_params_t hvx_params = { - .handle = self->characteristic->handle, - .type = self->write_type, - .offset = 0, - .p_len = &hvx_len, - .p_data = self->outgoing[self->pending_index], - }; - err_code = sd_ble_gatts_hvx(conn_handle, &hvx_params); - } - if (err_code != NRF_SUCCESS) { - // On error, simply skip updating the pending buffers so that the next HVC or WRITE - // complete event triggers another attempt. - return err_code; - } - self->pending_size = 0; - self->pending_index = (self->pending_index + 1) % 2; - self->packet_queued = true; - } - return NRF_SUCCESS; -} +// ble_gatts_hvx_params_t hvx_params = { +// .handle = self->characteristic->handle, +// .type = self->write_type, +// .offset = 0, +// .p_len = &hvx_len, +// .p_data = self->outgoing[self->pending_index], +// }; +// err_code = sd_ble_gatts_hvx(conn_handle, &hvx_params); +// } +// if (err_code != NRF_SUCCESS) { +// // On error, simply skip updating the pending buffers so that the next HVC or WRITE +// // complete event triggers another attempt. +// return err_code; +// } +// self->pending_size = 0; +// self->pending_index = (self->pending_index + 1) % 2; +// self->packet_queued = true; +// } +// return NRF_SUCCESS; +// } -STATIC bool packet_buffer_on_ble_client_evt(ble_evt_t *ble_evt, void *param) { - const uint16_t evt_id = ble_evt->header.evt_id; - // Check if this is a GATTC event so we can make sure the conn_handle is valid. - if (evt_id < BLE_GATTC_EVT_BASE || evt_id > BLE_GATTC_EVT_LAST) { - return false; - } +// STATIC bool packet_buffer_on_ble_client_evt(ble_evt_t *ble_evt, void *param) { +// const uint16_t evt_id = ble_evt->header.evt_id; +// // Check if this is a GATTC event so we can make sure the conn_handle is valid. +// if (evt_id < BLE_GATTC_EVT_BASE || evt_id > BLE_GATTC_EVT_LAST) { +// return false; +// } - uint16_t conn_handle = ble_evt->evt.gattc_evt.conn_handle; - bleio_packet_buffer_obj_t *self = (bleio_packet_buffer_obj_t *) param; - if (conn_handle != self->conn_handle) { - return false; - } - switch (evt_id) { - case BLE_GATTC_EVT_HVX: { - // A remote service wrote to this characteristic. - ble_gattc_evt_hvx_t* evt_hvx = &ble_evt->evt.gattc_evt.params.hvx; - // Must be a notification, and event handle must match the handle for my characteristic. - if (evt_hvx->handle == self->characteristic->handle) { - write_to_ringbuf(self, evt_hvx->data, evt_hvx->len); - if (evt_hvx->type == BLE_GATT_HVX_INDICATION) { - sd_ble_gattc_hv_confirm(conn_handle, evt_hvx->handle); - } - } - break; - } - case BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE: { - queue_next_write(self); - break; - } - case BLE_GATTC_EVT_WRITE_RSP: { - queue_next_write(self); - break; - } - default: - return false; - break; - } - return true; -} +// uint16_t conn_handle = ble_evt->evt.gattc_evt.conn_handle; +// bleio_packet_buffer_obj_t *self = (bleio_packet_buffer_obj_t *) param; +// if (conn_handle != self->conn_handle) { +// return false; +// } +// switch (evt_id) { +// case BLE_GATTC_EVT_HVX: { +// // A remote service wrote to this characteristic. +// ble_gattc_evt_hvx_t* evt_hvx = &ble_evt->evt.gattc_evt.params.hvx; +// // Must be a notification, and event handle must match the handle for my characteristic. +// if (evt_hvx->handle == self->characteristic->handle) { +// write_to_ringbuf(self, evt_hvx->data, evt_hvx->len); +// if (evt_hvx->type == BLE_GATT_HVX_INDICATION) { +// sd_ble_gattc_hv_confirm(conn_handle, evt_hvx->handle); +// } +// } +// break; +// } +// case BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE: { +// queue_next_write(self); +// break; +// } +// case BLE_GATTC_EVT_WRITE_RSP: { +// queue_next_write(self); +// break; +// } +// default: +// return false; +// break; +// } +// return true; +// } -STATIC bool packet_buffer_on_ble_server_evt(ble_evt_t *ble_evt, void *param) { - bleio_packet_buffer_obj_t *self = (bleio_packet_buffer_obj_t *) param; - switch (ble_evt->header.evt_id) { - case BLE_GATTS_EVT_WRITE: { - uint16_t conn_handle = ble_evt->evt.gatts_evt.conn_handle; - // A client wrote to this server characteristic. +// STATIC bool packet_buffer_on_ble_server_evt(ble_evt_t *ble_evt, void *param) { +// bleio_packet_buffer_obj_t *self = (bleio_packet_buffer_obj_t *) param; +// switch (ble_evt->header.evt_id) { +// case BLE_GATTS_EVT_WRITE: { +// uint16_t conn_handle = ble_evt->evt.gatts_evt.conn_handle; +// // A client wrote to this server characteristic. - ble_gatts_evt_write_t *evt_write = &ble_evt->evt.gatts_evt.params.write; +// ble_gatts_evt_write_t *evt_write = &ble_evt->evt.gatts_evt.params.write; - // Event handle must match the handle for my characteristic. - if (evt_write->handle == self->characteristic->handle) { - if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { - self->conn_handle = conn_handle; - } else if (self->conn_handle != conn_handle) { - return false; - } - write_to_ringbuf(self, evt_write->data, evt_write->len); - } else if (evt_write->handle == self->characteristic->cccd_handle) { - uint16_t cccd = *((uint16_t*) evt_write->data); - if (cccd & BLE_GATT_HVX_NOTIFICATION) { - self->conn_handle = conn_handle; - } else { - self->conn_handle = BLE_CONN_HANDLE_INVALID; - } - } - break; - } - case BLE_GAP_EVT_DISCONNECTED: { - if (self->conn_handle == ble_evt->evt.gap_evt.conn_handle) { - self->conn_handle = BLE_CONN_HANDLE_INVALID; - } - } - case BLE_GATTS_EVT_HVN_TX_COMPLETE: { - queue_next_write(self); - } - default: - return false; - break; - } - return true; -} +// // Event handle must match the handle for my characteristic. +// if (evt_write->handle == self->characteristic->handle) { +// if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { +// self->conn_handle = conn_handle; +// } else if (self->conn_handle != conn_handle) { +// return false; +// } +// write_to_ringbuf(self, evt_write->data, evt_write->len); +// } else if (evt_write->handle == self->characteristic->cccd_handle) { +// uint16_t cccd = *((uint16_t*) evt_write->data); +// if (cccd & BLE_GATT_HVX_NOTIFICATION) { +// self->conn_handle = conn_handle; +// } else { +// self->conn_handle = BLE_CONN_HANDLE_INVALID; +// } +// } +// break; +// } +// case BLE_GAP_EVT_DISCONNECTED: { +// if (self->conn_handle == ble_evt->evt.gap_evt.conn_handle) { +// self->conn_handle = BLE_CONN_HANDLE_INVALID; +// } +// } +// case BLE_GATTS_EVT_HVN_TX_COMPLETE: { +// queue_next_write(self); +// } +// default: +// return false; +// break; +// } +// return true; +// } void common_hal_bleio_packet_buffer_construct( bleio_packet_buffer_obj_t *self, bleio_characteristic_obj_t *characteristic, @@ -218,32 +219,32 @@ void common_hal_bleio_packet_buffer_construct( self->outgoing[1] = NULL; } - if (self->client) { - ble_drv_add_event_handler(packet_buffer_on_ble_client_evt, self); - if (incoming) { - // Prefer notify if both are available. - if (incoming & CHAR_PROP_NOTIFY) { - self->write_type = BLE_GATT_HVX_NOTIFICATION; - common_hal_bleio_characteristic_set_cccd(self->characteristic, true, false); - } else { - common_hal_bleio_characteristic_set_cccd(self->characteristic, false, true); - } - } - if (outgoing) { - self->write_type = BLE_GATT_OP_WRITE_REQ; - if (outgoing & CHAR_PROP_WRITE_NO_RESPONSE) { - self->write_type = BLE_GATT_OP_WRITE_CMD; - } - } - } else { - ble_drv_add_event_handler(packet_buffer_on_ble_server_evt, self); - if (outgoing) { - self->write_type = BLE_GATT_HVX_INDICATION; - if (outgoing & CHAR_PROP_NOTIFY) { - self->write_type = BLE_GATT_HVX_NOTIFICATION; - } - } - } + //FIX if (self->client) { + // ble_drv_add_event_handler(packet_buffer_on_ble_client_evt, self); + // if (incoming) { + // // Prefer notify if both are available. + // if (incoming & CHAR_PROP_NOTIFY) { + // self->write_type = BLE_GATT_HVX_NOTIFICATION; + // common_hal_bleio_characteristic_set_cccd(self->characteristic, true, false); + // } else { + // common_hal_bleio_characteristic_set_cccd(self->characteristic, false, true); + // } + // } + // if (outgoing) { + // self->write_type = BLE_GATT_OP_WRITE_REQ; + // if (outgoing & CHAR_PROP_WRITE_NO_RESPONSE) { + // self->write_type = BLE_GATT_OP_WRITE_CMD; + // } + // } + // } else { + // ble_drv_add_event_handler(packet_buffer_on_ble_server_evt, self); + // if (outgoing) { + // self->write_type = BLE_GATT_HVX_INDICATION; + // if (outgoing & CHAR_PROP_NOTIFY) { + // self->write_type = BLE_GATT_HVX_NOTIFICATION; + // } + // } + // } } mp_int_t common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len) { @@ -252,8 +253,8 @@ mp_int_t common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self } // Copy received data. Lock out write interrupt handler while copying. - uint8_t is_nested_critical_region; - sd_nvic_critical_region_enter(&is_nested_critical_region); + //FIX uint8_t is_nested_critical_region; + //FIX sd_nvic_critical_region_enter(&is_nested_critical_region); // Get packet length, which is in first two bytes of packet. uint16_t packet_length; @@ -274,7 +275,7 @@ mp_int_t common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self } // Writes now OK. - sd_nvic_critical_region_exit(is_nested_critical_region); + //FIX sd_nvic_critical_region_exit(is_nested_critical_region); return ret; } @@ -306,8 +307,8 @@ mp_int_t common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, u size_t num_bytes_written = 0; - uint8_t is_nested_critical_region; - sd_nvic_critical_region_enter(&is_nested_critical_region); + //FIX uint8_t is_nested_critical_region; + //FIX sd_nvic_critical_region_enter(&is_nested_critical_region); uint8_t* pending = self->outgoing[self->pending_index]; @@ -320,11 +321,11 @@ mp_int_t common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, u self->pending_size += len; num_bytes_written += len; - sd_nvic_critical_region_exit(is_nested_critical_region); + //FIX sd_nvic_critical_region_exit(is_nested_critical_region); // If no writes are queued then sneak in this data. if (!self->packet_queued) { - queue_next_write(self); + //FIX queue_next_write(self); } return num_bytes_written; } @@ -397,6 +398,6 @@ bool common_hal_bleio_packet_buffer_deinited(bleio_packet_buffer_obj_t *self) { void common_hal_bleio_packet_buffer_deinit(bleio_packet_buffer_obj_t *self) { if (!common_hal_bleio_packet_buffer_deinited(self)) { - ble_drv_remove_event_handler(packet_buffer_on_ble_client_evt, self); + //FIX ble_drv_remove_event_handler(packet_buffer_on_ble_client_evt, self); } } diff --git a/devices/ble_hci/common-hal/_bleio/Service.c b/devices/ble_hci/common-hal/_bleio/Service.c index f194a95dd7..1f9649b6c3 100644 --- a/devices/ble_hci/common-hal/_bleio/Service.c +++ b/devices/ble_hci/common-hal/_bleio/Service.c @@ -40,22 +40,24 @@ uint32_t _common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uu self->connection = NULL; self->is_secondary = is_secondary; - ble_uuid_t nordic_uuid; - bleio_uuid_convert_to_nrf_ble_uuid(uuid, &nordic_uuid); + //FIX + // ble_uuid_t nordic_uuid; + // bleio_uuid_convert_to_nrf_ble_uuid(uuid, &nordic_uuid); - uint8_t service_type = BLE_GATTS_SRVC_TYPE_PRIMARY; - if (is_secondary) { - service_type = BLE_GATTS_SRVC_TYPE_SECONDARY; - } + // uint8_t service_type = BLE_GATTS_SRVC_TYPE_PRIMARY; + // if (is_secondary) { + // service_type = BLE_GATTS_SRVC_TYPE_SECONDARY; + // } vm_used_ble = true; - return sd_ble_gatts_service_add(service_type, &nordic_uuid, &self->handle); + //FIX return sd_ble_gatts_service_add(service_type, &nordic_uuid, &self->handle); + return 0; } void common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uuid_obj_t *uuid, bool is_secondary) { - check_nrf_error(_common_hal_bleio_service_construct(self, uuid, is_secondary, - mp_obj_new_list(0, NULL))); + //FIX check_nrf_error(_common_hal_bleio_service_construct(self, uuid, is_secondary, + // mp_obj_new_list(0, NULL))); } void bleio_service_from_connection(bleio_service_obj_t *self, mp_obj_t connection) { @@ -86,62 +88,62 @@ bool common_hal_bleio_service_get_is_secondary(bleio_service_obj_t *self) { void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, bleio_characteristic_obj_t *characteristic, mp_buffer_info_t *initial_value_bufinfo) { - ble_gatts_char_md_t char_md = { - .char_props.broadcast = (characteristic->props & CHAR_PROP_BROADCAST) ? 1 : 0, - .char_props.read = (characteristic->props & CHAR_PROP_READ) ? 1 : 0, - .char_props.write_wo_resp = (characteristic->props & CHAR_PROP_WRITE_NO_RESPONSE) ? 1 : 0, - .char_props.write = (characteristic->props & CHAR_PROP_WRITE) ? 1 : 0, - .char_props.notify = (characteristic->props & CHAR_PROP_NOTIFY) ? 1 : 0, - .char_props.indicate = (characteristic->props & CHAR_PROP_INDICATE) ? 1 : 0, - }; + // ble_gatts_char_md_t char_md = { + // .char_props.broadcast = (characteristic->props & CHAR_PROP_BROADCAST) ? 1 : 0, + // .char_props.read = (characteristic->props & CHAR_PROP_READ) ? 1 : 0, + // .char_props.write_wo_resp = (characteristic->props & CHAR_PROP_WRITE_NO_RESPONSE) ? 1 : 0, + // .char_props.write = (characteristic->props & CHAR_PROP_WRITE) ? 1 : 0, + // .char_props.notify = (characteristic->props & CHAR_PROP_NOTIFY) ? 1 : 0, + // .char_props.indicate = (characteristic->props & CHAR_PROP_INDICATE) ? 1 : 0, + // }; - ble_gatts_attr_md_t cccd_md = { - .vloc = BLE_GATTS_VLOC_STACK, - }; + // ble_gatts_attr_md_t cccd_md = { + // .vloc = BLE_GATTS_VLOC_STACK, + // }; - ble_uuid_t char_uuid; - bleio_uuid_convert_to_nrf_ble_uuid(characteristic->uuid, &char_uuid); + // ble_uuid_t char_uuid; + // bleio_uuid_convert_to_nrf_ble_uuid(characteristic->uuid, &char_uuid); - ble_gatts_attr_md_t char_attr_md = { - .vloc = BLE_GATTS_VLOC_STACK, - .vlen = !characteristic->fixed_length, - }; + // ble_gatts_attr_md_t char_attr_md = { + // .vloc = BLE_GATTS_VLOC_STACK, + // .vlen = !characteristic->fixed_length, + // }; - if (char_md.char_props.notify || char_md.char_props.indicate) { - BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cccd_md.read_perm); - // Make CCCD write permission match characteristic read permission. - bleio_attribute_gatts_set_security_mode(&cccd_md.write_perm, characteristic->read_perm); + // if (char_md.char_props.notify || char_md.char_props.indicate) { + // BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cccd_md.read_perm); + // // Make CCCD write permission match characteristic read permission. + // bleio_attribute_gatts_set_security_mode(&cccd_md.write_perm, characteristic->read_perm); - char_md.p_cccd_md = &cccd_md; - } + // char_md.p_cccd_md = &cccd_md; + // } - bleio_attribute_gatts_set_security_mode(&char_attr_md.read_perm, characteristic->read_perm); - bleio_attribute_gatts_set_security_mode(&char_attr_md.write_perm, characteristic->write_perm); - #if CIRCUITPY_VERBOSE_BLE - // Turn on read authorization so that we receive an event to print on every read. - char_attr_md.rd_auth = true; - #endif + // bleio_attribute_gatts_set_security_mode(&char_attr_md.read_perm, characteristic->read_perm); + // bleio_attribute_gatts_set_security_mode(&char_attr_md.write_perm, characteristic->write_perm); + // #if CIRCUITPY_VERBOSE_BLE + // // Turn on read authorization so that we receive an event to print on every read. + // char_attr_md.rd_auth = true; + // #endif - ble_gatts_attr_t char_attr = { - .p_uuid = &char_uuid, - .p_attr_md = &char_attr_md, - .init_len = 0, - .p_value = NULL, - .init_offs = 0, - .max_len = characteristic->max_length, - }; + // ble_gatts_attr_t char_attr = { + // .p_uuid = &char_uuid, + // .p_attr_md = &char_attr_md, + // .init_len = 0, + // .p_value = NULL, + // .init_offs = 0, + // .max_len = characteristic->max_length, + // }; - ble_gatts_char_handles_t char_handles; + // ble_gatts_char_handles_t char_handles; - check_nrf_error(sd_ble_gatts_characteristic_add(self->handle, &char_md, &char_attr, &char_handles)); + // check_nrf_error(sd_ble_gatts_characteristic_add(self->handle, &char_md, &char_attr, &char_handles)); - characteristic->user_desc_handle = char_handles.user_desc_handle; - characteristic->cccd_handle = char_handles.cccd_handle; - characteristic->sccd_handle = char_handles.sccd_handle; - characteristic->handle = char_handles.value_handle; - #if CIRCUITPY_VERBOSE_BLE - mp_printf(&mp_plat_print, "Char handle %x user %x cccd %x sccd %x\n", characteristic->handle, characteristic->user_desc_handle, characteristic->cccd_handle, characteristic->sccd_handle); - #endif + // characteristic->user_desc_handle = char_handles.user_desc_handle; + // characteristic->cccd_handle = char_handles.cccd_handle; + // characteristic->sccd_handle = char_handles.sccd_handle; + // characteristic->handle = char_handles.value_handle; + // #if CIRCUITPY_VERBOSE_BLE + // mp_printf(&mp_plat_print, "Char handle %x user %x cccd %x sccd %x\n", characteristic->handle, characteristic->user_desc_handle, characteristic->cccd_handle, characteristic->sccd_handle); + // #endif - mp_obj_list_append(self->characteristic_list, MP_OBJ_FROM_PTR(characteristic)); + // mp_obj_list_append(self->characteristic_list, MP_OBJ_FROM_PTR(characteristic)); } diff --git a/devices/ble_hci/common-hal/_bleio/UUID.c b/devices/ble_hci/common-hal/_bleio/UUID.c index 1c6c35e477..3f5fbe4fe4 100644 --- a/devices/ble_hci/common-hal/_bleio/UUID.c +++ b/devices/ble_hci/common-hal/_bleio/UUID.c @@ -37,35 +37,36 @@ // If uuid128 is not NULL, it's a 128-bit (16-byte) UUID, with bytes 12 and 13 zero'd out, where // the 16-bit part goes. Those 16 bits are passed in uuid16. void common_hal_bleio_uuid_construct(bleio_uuid_obj_t *self, uint32_t uuid16, const uint8_t uuid128[]) { - self->nrf_ble_uuid.uuid = uuid16; - if (uuid128 == NULL) { - self->nrf_ble_uuid.type = BLE_UUID_TYPE_BLE; - } else { - ble_uuid128_t vs_uuid; - memcpy(vs_uuid.uuid128, uuid128, sizeof(vs_uuid.uuid128)); + //FIX self->nrf_ble_uuid.uuid = uuid16; + // if (uuid128 == NULL) { + // self->nrf_ble_uuid.type = BLE_UUID_TYPE_BLE; + // } else { + // ble_uuid128_t vs_uuid; + // memcpy(vs_uuid.uuid128, uuid128, sizeof(vs_uuid.uuid128)); - // Register this vendor-specific UUID. Bytes 12 and 13 will be zero. - check_nrf_error(sd_ble_uuid_vs_add(&vs_uuid, &self->nrf_ble_uuid.type)); - vm_used_ble = true; - } + // // Register this vendor-specific UUID. Bytes 12 and 13 will be zero. + // check_nrf_error(sd_ble_uuid_vs_add(&vs_uuid, &self->nrf_ble_uuid.type)); + // vm_used_ble = true; + // } } uint32_t common_hal_bleio_uuid_get_size(bleio_uuid_obj_t *self) { - // return self->nrf_ble_uuid.type == BLE_UUID_TYPE_BLE ? 16 : 128; + //FIX return self->nrf_ble_uuid.type == BLE_UUID_TYPE_BLE ? 16 : 128; + return 0; } uint32_t common_hal_bleio_uuid_get_uuid16(bleio_uuid_obj_t *self) { - // return self->nrf_ble_uuid.uuid; + //FIX return self->nrf_ble_uuid.uuid; return 0; } void common_hal_bleio_uuid_get_uuid128(bleio_uuid_obj_t *self, uint8_t uuid128[16]) { - uint8_t length; - // check_nrf_error(sd_ble_uuid_encode(&self->nrf_ble_uuid, &length, uuid128)); + //FIX uint8_t length; + //FIX check_nrf_error(sd_ble_uuid_encode(&self->nrf_ble_uuid, &length, uuid128)); } void common_hal_bleio_uuid_pack_into(bleio_uuid_obj_t *self, uint8_t* buf) { - // if (self->nrf_ble_uuid.type == BLE_UUID_TYPE_BLE) { + //FIX if (self->nrf_ble_uuid.type == BLE_UUID_TYPE_BLE) { // buf[0] = self->nrf_ble_uuid.uuid & 0xff; // buf[1] = self->nrf_ble_uuid.uuid >> 8; // } else { @@ -73,6 +74,7 @@ void common_hal_bleio_uuid_pack_into(bleio_uuid_obj_t *self, uint8_t* buf) { // } } +//FIX // void bleio_uuid_construct_from_nrf_ble_uuid(bleio_uuid_obj_t *self, ble_uuid_t *nrf_ble_uuid) { // if (nrf_ble_uuid->type == BLE_UUID_TYPE_UNKNOWN) { // mp_raise_bleio_BluetoothError(translate("Unexpected nrfx uuid type")); diff --git a/devices/ble_hci/common-hal/_bleio/UUID.h b/devices/ble_hci/common-hal/_bleio/UUID.h index 584a28960b..4a72d38acd 100644 --- a/devices/ble_hci/common-hal/_bleio/UUID.h +++ b/devices/ble_hci/common-hal/_bleio/UUID.h @@ -33,7 +33,7 @@ typedef struct { mp_obj_base_t base; - // Use the native way of storing UUID's: + //FIX Use the native way of storing UUID's: // - ble_uuid_t.uuid is a 16-bit uuid. // - ble_uuid_t.type is BLE_UUID_TYPE_BLE if it's a 16-bit Bluetooth SIG UUID. // or is BLE_UUID_TYPE_VENDOR_BEGIN and higher, which indexes into a table of registered diff --git a/devices/ble_hci/common-hal/_bleio/__init__.c b/devices/ble_hci/common-hal/_bleio/__init__.c index e84bba6626..a09c3a05c5 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.c +++ b/devices/ble_hci/common-hal/_bleio/__init__.c @@ -40,52 +40,53 @@ #include "common-hal/_bleio/__init__.h" -void check_nrf_error(uint32_t err_code) { - if (err_code == NRF_SUCCESS) { - return; - } - switch (err_code) { - case NRF_ERROR_TIMEOUT: - mp_raise_msg(&mp_type_TimeoutError, NULL); - return; - case BLE_ERROR_INVALID_CONN_HANDLE: - mp_raise_bleio_ConnectionError(translate("Not connected")); - return; - default: - mp_raise_bleio_BluetoothError(translate("Unknown soft device error: %04x"), err_code); - break; - } -} +//FIX to check HCI error +// void check_nrf_error(uint32_t err_code) { +// if (err_code == NRF_SUCCESS) { +// return; +// } +// switch (err_code) { +// case NRF_ERROR_TIMEOUT: +// mp_raise_msg(&mp_type_TimeoutError, NULL); +// return; +// case BLE_ERROR_INVALID_CONN_HANDLE: +// mp_raise_bleio_ConnectionError(translate("Not connected")); +// return; +// default: +// mp_raise_bleio_BluetoothError(translate("Unknown soft device error: %04x"), err_code); +// break; +// } +// } -void check_gatt_status(uint16_t gatt_status) { - if (gatt_status == BLE_GATT_STATUS_SUCCESS) { - return; - } - switch (gatt_status) { - case BLE_GATT_STATUS_ATTERR_INSUF_AUTHENTICATION: - mp_raise_bleio_SecurityError(translate("Insufficient authentication")); - return; - case BLE_GATT_STATUS_ATTERR_INSUF_ENCRYPTION: - mp_raise_bleio_SecurityError(translate("Insufficient encryption")); - return; - default: - mp_raise_bleio_BluetoothError(translate("Unknown gatt error: 0x%04x"), gatt_status); - } -} +// void check_gatt_status(uint16_t gatt_status) { +// if (gatt_status == BLE_GATT_STATUS_SUCCESS) { +// return; +// } +// switch (gatt_status) { +// case BLE_GATT_STATUS_ATTERR_INSUF_AUTHENTICATION: +// mp_raise_bleio_SecurityError(translate("Insufficient authentication")); +// return; +// case BLE_GATT_STATUS_ATTERR_INSUF_ENCRYPTION: +// mp_raise_bleio_SecurityError(translate("Insufficient encryption")); +// return; +// default: +// mp_raise_bleio_BluetoothError(translate("Unknown gatt error: 0x%04x"), gatt_status); +// } +// } -void check_sec_status(uint8_t sec_status) { - if (sec_status == BLE_GAP_SEC_STATUS_SUCCESS) { - return; - } +// void check_sec_status(uint8_t sec_status) { +// if (sec_status == BLE_GAP_SEC_STATUS_SUCCESS) { +// return; +// } - switch (sec_status) { - case BLE_GAP_SEC_STATUS_UNSPECIFIED: - mp_raise_bleio_SecurityError(translate("Unspecified issue. Can be that the pairing prompt on the other device was declined or ignored.")); - return; - default: - mp_raise_bleio_SecurityError(translate("Unknown security error: 0x%04x"), sec_status); - } -} +// switch (sec_status) { +// case BLE_GAP_SEC_STATUS_UNSPECIFIED: +// mp_raise_bleio_SecurityError(translate("Unspecified issue. Can be that the pairing prompt on the other device was declined or ignored.")); +// return; +// default: +// mp_raise_bleio_SecurityError(translate("Unknown security error: 0x%04x"), sec_status); +// } +// } // Turn off BLE on a reset or reload. void bleio_reset() { @@ -98,7 +99,7 @@ void bleio_reset() { return; } common_hal_bleio_adapter_set_enabled(&common_hal_bleio_adapter_obj, false); - bonding_reset(); + //FIX bonding_reset(); supervisor_start_bluetooth(); } @@ -121,124 +122,127 @@ size_t common_hal_bleio_gatts_read(uint16_t handle, uint16_t conn_handle, uint8_ // conn_handle is ignored unless this is a system attribute. // If we're not connected, that's OK, because we can still read and write the local value. - ble_gatts_value_t gatts_value = { - .p_value = buf, - .len = len, - }; + //FIX ble_gatts_value_t gatts_value = { + // .p_value = buf, + // .len = len, + // }; - check_nrf_error(sd_ble_gatts_value_get(conn_handle, handle, &gatts_value)); + // check_nrf_error(sd_ble_gatts_value_get(conn_handle, handle, &gatts_value)); - return gatts_value.len; + // return gatts_value.len; + return 0; } void common_hal_bleio_gatts_write(uint16_t handle, uint16_t conn_handle, mp_buffer_info_t *bufinfo) { // conn_handle is ignored unless this is a system attribute. // If we're not connected, that's OK, because we can still read and write the local value. - ble_gatts_value_t gatts_value = { - .p_value = bufinfo->buf, - .len = bufinfo->len, - }; + //FIX ble_gatts_value_t gatts_value = { + // .p_value = bufinfo->buf, + // .len = bufinfo->len, + // }; - check_nrf_error(sd_ble_gatts_value_set(conn_handle, handle, &gatts_value)); + // check_nrf_error(sd_ble_gatts_value_set(conn_handle, handle, &gatts_value)); } -typedef struct { - uint8_t* buf; - size_t len; - size_t final_len; - uint16_t conn_handle; - volatile uint16_t status; - volatile bool done; -} read_info_t; +//FIX +// typedef struct { +// uint8_t* buf; +// size_t len; +// size_t final_len; +// uint16_t conn_handle; +// volatile uint16_t status; +// volatile bool done; +// } read_info_t; -STATIC bool _on_gattc_read_rsp_evt(ble_evt_t *ble_evt, void *param) { - read_info_t* read = param; - switch (ble_evt->header.evt_id) { +// STATIC bool _on_gattc_read_rsp_evt(ble_evt_t *ble_evt, void *param) { +// read_info_t* read = param; +// switch (ble_evt->header.evt_id) { - // More events may be handled later, so keep this as a switch. +// // More events may be handled later, so keep this as a switch. - case BLE_GATTC_EVT_READ_RSP: { - ble_gattc_evt_t* evt = &ble_evt->evt.gattc_evt; - ble_gattc_evt_read_rsp_t *response = &evt->params.read_rsp; - if (read && evt->conn_handle == read->conn_handle) { - read->status = evt->gatt_status; - size_t len = MIN(read->len, response->len); - memcpy(read->buf, response->data, len); - read->final_len = len; - // Indicate to busy-wait loop that we've read the attribute value. - read->done = true; - } - break; - } +// case BLE_GATTC_EVT_READ_RSP: { +// ble_gattc_evt_t* evt = &ble_evt->evt.gattc_evt; +// ble_gattc_evt_read_rsp_t *response = &evt->params.read_rsp; +// if (read && evt->conn_handle == read->conn_handle) { +// read->status = evt->gatt_status; +// size_t len = MIN(read->len, response->len); +// memcpy(read->buf, response->data, len); +// read->final_len = len; +// // Indicate to busy-wait loop that we've read the attribute value. +// read->done = true; +// } +// break; +// } - default: - // For debugging. - // mp_printf(&mp_plat_print, "Unhandled characteristic event: 0x%04x\n", ble_evt->header.evt_id); - return false; - break; - } - return true; -} +// default: +// // For debugging. +// // mp_printf(&mp_plat_print, "Unhandled characteristic event: 0x%04x\n", ble_evt->header.evt_id); +// return false; +// break; +// } +// return true; +// } size_t common_hal_bleio_gattc_read(uint16_t handle, uint16_t conn_handle, uint8_t* buf, size_t len) { common_hal_bleio_check_connected(conn_handle); - read_info_t read_info; - read_info.buf = buf; - read_info.len = len; - read_info.final_len = 0; - read_info.conn_handle = conn_handle; - // Set to true by the event handler. - read_info.done = false; - ble_drv_add_event_handler(_on_gattc_read_rsp_evt, &read_info); + //FIX read_info_t read_info; + // read_info.buf = buf; + // read_info.len = len; + // read_info.final_len = 0; + // read_info.conn_handle = conn_handle; + // // Set to true by the event handler. + // read_info.done = false; + // ble_drv_add_event_handler(_on_gattc_read_rsp_evt, &read_info); - uint32_t nrf_error = NRF_ERROR_BUSY; - while (nrf_error == NRF_ERROR_BUSY) { - nrf_error = sd_ble_gattc_read(conn_handle, handle, 0); - } - if (nrf_error != NRF_SUCCESS) { - ble_drv_remove_event_handler(_on_gattc_read_rsp_evt, &read_info); - check_nrf_error(nrf_error); - } + // uint32_t nrf_error = NRF_ERROR_BUSY; + // while (nrf_error == NRF_ERROR_BUSY) { + // nrf_error = sd_ble_gattc_read(conn_handle, handle, 0); + // } + // if (nrf_error != NRF_SUCCESS) { + // ble_drv_remove_event_handler(_on_gattc_read_rsp_evt, &read_info); + // check_nrf_error(nrf_error); + // } - while (!read_info.done) { - RUN_BACKGROUND_TASKS; - } + // while (!read_info.done) { + // RUN_BACKGROUND_TASKS; + // } - ble_drv_remove_event_handler(_on_gattc_read_rsp_evt, &read_info); - check_gatt_status(read_info.status); - return read_info.final_len; + // ble_drv_remove_event_handler(_on_gattc_read_rsp_evt, &read_info); + // check_gatt_status(read_info.status); + // return read_info.final_len; + return 0; } void common_hal_bleio_gattc_write(uint16_t handle, uint16_t conn_handle, mp_buffer_info_t *bufinfo, bool write_no_response) { common_hal_bleio_check_connected(conn_handle); - ble_gattc_write_params_t write_params = { - .write_op = write_no_response ? BLE_GATT_OP_WRITE_CMD: BLE_GATT_OP_WRITE_REQ, - .handle = handle, - .p_value = bufinfo->buf, - .len = bufinfo->len, - }; + //FIX + // ble_gattc_write_params_t write_params = { + // .write_op = write_no_response ? BLE_GATT_OP_WRITE_CMD: BLE_GATT_OP_WRITE_REQ, + // .handle = handle, + // .p_value = bufinfo->buf, + // .len = bufinfo->len, + // }; - while (1) { - uint32_t err_code = sd_ble_gattc_write(conn_handle, &write_params); - if (err_code == NRF_SUCCESS) { - break; - } + // while (1) { + // uint32_t err_code = sd_ble_gattc_write(conn_handle, &write_params); + // if (err_code == NRF_SUCCESS) { + // break; + // } - // Write with response will return NRF_ERROR_BUSY if the response has not been received. - // Write without reponse will return NRF_ERROR_RESOURCES if too many writes are pending. - if (err_code == NRF_ERROR_BUSY || err_code == NRF_ERROR_RESOURCES) { - // We could wait for an event indicating the write is complete, but just retrying is easier. - MICROPY_VM_HOOK_LOOP; - continue; - } - - // Some real error occurred. - check_nrf_error(err_code); - } + // // Write with response will return NRF_ERROR_BUSY if the response has not been received. + // // Write without reponse will return NRF_ERROR_RESOURCES if too many writes are pending. + // if (err_code == NRF_ERROR_BUSY || err_code == NRF_ERROR_RESOURCES) { + // // We could wait for an event indicating the write is complete, but just retrying is easier. + // MICROPY_VM_HOOK_LOOP; + // continue; + // } + // // Some real error occurred. + // check_nrf_error(err_code); + // } } void common_hal_bleio_gc_collect(void) { diff --git a/devices/ble_hci/common-hal/_bleio/__init__.h b/devices/ble_hci/common-hal/_bleio/__init__.h index 77548dac15..784dcefdcb 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.h +++ b/devices/ble_hci/common-hal/_bleio/__init__.h @@ -27,6 +27,8 @@ #ifndef MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_INIT_H #define MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_INIT_H +#include + void bleio_reset(void); typedef struct { @@ -39,6 +41,13 @@ typedef struct { // 20 bytes max (23 - 3). #define GATT_MAX_DATA_LENGTH (BLE_GATT_ATT_MTU_DEFAULT - 3) +//FIX +#define BLE_GATT_HANDLE_INVALID 0x0000 +#define BLE_CONN_HANDLE_INVALID 0xFFFF +#define BLE_GATTS_FIX_ATTR_LEN_MAX (510) /**< Maximum length for fixed length Attribute Values. */ +#define BLE_GATTS_VAR_ATTR_LEN_MAX (512) /**< Maximum length for variable length Attribute Values. */ + + // These helpers raise the appropriate exceptions if the code doesn't equal success. void check_nrf_error(uint32_t err_code); void check_gatt_status(uint16_t gatt_status); diff --git a/devices/ble_hci/common-hal/_bleio/bonding.c b/devices/ble_hci/common-hal/_bleio/bonding.c deleted file mode 100644 index d03e418f7f..0000000000 --- a/devices/ble_hci/common-hal/_bleio/bonding.c +++ /dev/null @@ -1,306 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 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 -#include -#include - -#include "shared-bindings/_bleio/__init__.h" -#include "shared-bindings/_bleio/Adapter.h" -#include "shared-bindings/nvm/ByteArray.h" -#include "supervisor/shared/tick.h" - -#include "bonding.h" - -// Internal flash area reserved for bonding storage. -#define BONDING_PAGES_START_ADDR CIRCUITPY_BLE_CONFIG_START_ADDR -#define BONDING_PAGES_END_ADDR (CIRCUITPY_BLE_CONFIG_START_ADDR + CIRCUITPY_BLE_CONFIG_SIZE) - -// First and last four bytes are magic bytes for id and version. Data is in between. -// 'BD01' -const uint32_t BONDING_FLAG = ('1' | '0' << 8 | 'D' << 16 | 'B' << 24); - -#define BONDING_DATA_START_ADDR (BONDING_PAGES_START_ADDR + sizeof(BONDING_FLAG)) -#define BONDING_DATA_END_ADDR (BONDING_PAGES_END_ADDR - sizeof(BONDING_FLAG)) - -#define BONDING_START_FLAG_ADDR BONDING_PAGES_START_ADDR -#define BONDING_END_FLAG_ADDR BONDING_DATA_END_ADDR - -// Save both system and user service info. -#define SYS_ATTR_FLAGS (BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS | BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS) - -#if BONDING_DEBUG -void bonding_print_block(bonding_block_t *block) { - printf("at 0x%08lx: is_central: %1d, type: 0x%x, ediv: 0x%04x, data_length: %d\n", - (uint32_t) block, block->is_central, block->type, block->ediv, block->data_length); -} - -void bonding_print_keys(bonding_keys_t *keys) { - for (size_t i = 0; i < sizeof(bonding_keys_t); i ++) { - printf("%x", ((uint8_t*) keys)[i]); - } - printf("\n"); -} -#endif - -STATIC size_t compute_block_size(uint16_t data_length) { - // Round data size up to the nearest 32-bit address. - return sizeof(bonding_block_t) + ((data_length + 3) & ~0x3); -} - -void bonding_erase_storage(void) { - // Erase all pages in the bonding area. - for(uint32_t page_address = BONDING_PAGES_START_ADDR; - page_address < BONDING_PAGES_END_ADDR; - page_address += FLASH_PAGE_SIZE) { - // Argument is page number, not address. - sd_flash_page_erase_sync(page_address / FLASH_PAGE_SIZE); - } - // Write marker words at the beginning and the end of the bonding area. - uint32_t flag = BONDING_FLAG; - sd_flash_write_sync((uint32_t *) BONDING_START_FLAG_ADDR, &flag, 1); - sd_flash_write_sync((uint32_t *) BONDING_END_FLAG_ADDR, &flag, 1); -} - -// Given NULL to start or block address, return the address of the next valid block. -// The last block returned is the unused block at the end. -// Return NULL if we have run off the end of the bonding space. - -STATIC bonding_block_t *next_block(bonding_block_t *block) { - while (1) { - // Advance to next block. - if (block == NULL) { - return (bonding_block_t *) BONDING_DATA_START_ADDR; - } else if (block->type == BLOCK_UNUSED) { - // Already at last block (the unused block). - return NULL; - } - - // Advance to next block. - block = (bonding_block_t *) ((uint8_t *) block + compute_block_size(block->data_length)); - - if (block >= (bonding_block_t *) BONDING_DATA_END_ADDR) { - // Went past end of bonding space. - return NULL; - } - if (block->type != BLOCK_INVALID) { - // Found an empty or a valid block. - return block; - } - // Invalid block (was erased); try again. - } -} - -// Find the block with given is_central, type and ediv value. -// If type == BLOCK_UNUSED, ediv is ignored and the the sole unused block at the end is returned. -// If not found, return NULL. -STATIC bonding_block_t *find_existing_block(bool is_central, bonding_block_type_t type, uint16_t ediv) { - bonding_block_t *block = NULL; - while (1) { - block = next_block(block); - if (block == NULL) { - return NULL; - } - // If types match, and block is unused, just return it. - // Otherwise check that is_central and ediv match. - if (type == block->type) { - if (type == BLOCK_UNUSED || - (is_central == block->is_central && ediv == block->ediv)) { - return block; - } - } - } -} - -// Get an empty block large enough to store data_length data. -STATIC bonding_block_t* find_unused_block(uint16_t data_length) { - bonding_block_t *unused_block = find_existing_block(true, BLOCK_UNUSED, EDIV_INVALID); - // If no more room, erase all existing blocks and start over. - if (!unused_block || - (uint8_t *) unused_block + compute_block_size(data_length) >= (uint8_t *) BONDING_DATA_END_ADDR) { - bonding_erase_storage(); - unused_block = (bonding_block_t *) BONDING_DATA_START_ADDR; - } - return unused_block; -} - -// Set the header word to all 0's, to mark the block as invalid. -// We don't change data_length, so we can still skip over this block. -STATIC void invalidate_block(bonding_block_t *block) { - uint32_t zero = 0; - sd_flash_write_sync((uint32_t *) block, &zero, 1); -} - -// Write bonding block header. -STATIC void write_block_header(bonding_block_t *dest_block, bonding_block_t *source_block_header) { - sd_flash_write_sync((uint32_t *) dest_block, (uint32_t *) source_block_header, sizeof(bonding_block_t) / 4); -} - -// Write variable-length data at end of bonding block. -STATIC void write_block_data(bonding_block_t *dest_block, uint8_t *data, uint16_t data_length) { - // Minimize the number of writes. Datasheet says no more than two writes per word before erasing again. - - // Start writing after the current header. - uint32_t *flash_word_p = (uint32_t *) ((uint8_t *) dest_block + sizeof(bonding_block_t)); - while (1) { - uint32_t word = 0xffffffff; - memcpy(&word, data, data_length >= 4 ? 4 : data_length); - sd_flash_write_sync(flash_word_p, &word, 1); - if (data_length <= 4) { - break; - } - data_length -= 4; - data += 4; - // Increment by word size. - flash_word_p++; - } -} - -STATIC void write_sys_attr_block(bleio_connection_internal_t *connection) { - uint16_t length = 0; - // First find out how big a buffer we need, then fetch the data. - if(sd_ble_gatts_sys_attr_get(connection->conn_handle, NULL, &length, SYS_ATTR_FLAGS) != NRF_SUCCESS) { - return; - } - uint8_t sys_attr[length]; - if(sd_ble_gatts_sys_attr_get(connection->conn_handle, sys_attr, &length, SYS_ATTR_FLAGS) != NRF_SUCCESS) { - return; - } - - // Is there an existing sys_attr block that matches the current sys_attr data? - bonding_block_t *existing_block = - find_existing_block(connection->is_central, BLOCK_SYS_ATTR, connection->ediv); - if (existing_block) { - if (length == existing_block->data_length && - memcmp(sys_attr, existing_block->data, length) == 0) { - // Identical block found. No need to store again. - return; - } - // Data doesn't match. Invalidate block and store a new one. - invalidate_block(existing_block); - } - - bonding_block_t block_header = { - .is_central = connection->is_central, - .type = BLOCK_SYS_ATTR, - .ediv = connection->ediv, - .conn_handle = connection->conn_handle, - .data_length = length, - }; - bonding_block_t *new_block = find_unused_block(length); - write_block_header(new_block, &block_header); - write_block_data(new_block, sys_attr, length); - return; -} - -STATIC void write_keys_block(bleio_connection_internal_t *connection) { - uint16_t const ediv = connection->is_central - ? connection->bonding_keys.peer_enc.master_id.ediv - : connection->bonding_keys.own_enc.master_id.ediv; - - // Is there an existing keys block that matches? - bonding_block_t *existing_block = find_existing_block(connection->is_central, BLOCK_KEYS, ediv); - if (existing_block) { - if (existing_block->data_length == sizeof(bonding_keys_t) && - memcmp(existing_block->data, &connection->bonding_keys, sizeof(bonding_keys_t)) == 0) { - // Identical block found. No need to store again. - return; - } - // Data doesn't match. Invalidate block and store a new one. - invalidate_block(existing_block); - } - - bonding_block_t block_header = { - .is_central = connection->is_central, - .type = BLOCK_KEYS, - .ediv = ediv, - .conn_handle = connection->conn_handle, - .data_length = sizeof(bonding_keys_t), - }; - bonding_block_t *new_block = find_unused_block(sizeof(bonding_keys_t)); - write_block_header(new_block, &block_header); - write_block_data(new_block, (uint8_t *) &connection->bonding_keys, sizeof(bonding_keys_t)); -} - -void bonding_clear_keys(bonding_keys_t *bonding_keys) { - memset((uint8_t*) bonding_keys, 0, sizeof(bonding_keys_t)); -} - -void bonding_reset(void) { - if (BONDING_FLAG != *((uint32_t *) BONDING_START_FLAG_ADDR) || - BONDING_FLAG != *((uint32_t *) BONDING_END_FLAG_ADDR)) { - bonding_erase_storage(); - } -} - -// Write bonding blocks to flash. Requests have been queued during evt handlers. -void bonding_background(void) { - // A paired connection will request that its keys and CCCD values be stored. - // The CCCD store whenever a CCCD value is written. - for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { - bleio_connection_internal_t *connection = &bleio_connections[i]; - - // Wait at least one second before saving CCCD, to consolidate - // writes that involve multiple CCCDs. For instance, for HID, - // three CCCD's are set in short succession by the HID client. - if (connection->do_bond_cccds) { - uint64_t current_ticks_ms = supervisor_ticks_ms64(); - if (current_ticks_ms - connection->do_bond_cccds_request_time >= 1000) { - write_sys_attr_block(connection); - connection->do_bond_cccds = false; - } - } - - if (connection->do_bond_keys) { - write_keys_block(connection); - connection->do_bond_keys = false; - } - } -} - -bool bonding_load_cccd_info(bool is_central, uint16_t conn_handle, uint16_t ediv) { - bonding_block_t *block = find_existing_block(is_central, BLOCK_SYS_ATTR, ediv); - if (block == NULL) { - return false; - } - - return NRF_SUCCESS == - sd_ble_gatts_sys_attr_set(conn_handle, block->data, block->data_length, SYS_ATTR_FLAGS); -} - -bool bonding_load_keys(bool is_central, uint16_t ediv, bonding_keys_t *bonding_keys) { - bonding_block_t *block = find_existing_block(is_central, BLOCK_KEYS, ediv); - if (block == NULL) { - return false; - } - if (sizeof(bonding_keys_t) != block->data_length) { - // bonding_keys_t is a fixed length, so lengths should match. - return false; - } - - memcpy(bonding_keys, block->data, block->data_length); - return true; -} diff --git a/devices/ble_hci/common-hal/_bleio/bonding.h b/devices/ble_hci/common-hal/_bleio/bonding.h deleted file mode 100644 index 7fa66972de..0000000000 --- a/devices/ble_hci/common-hal/_bleio/bonding.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 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. - */ - -#ifndef MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_BONDING_H -#define MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_BONDING_H - -#include -#include -#include - -#include "common-hal/_bleio/__init__.h" - -#define EDIV_INVALID (0xffff) - -#define BONDING_DEBUG (1) -#if BONDING_DEBUG - #define BONDING_DEBUG_PRINTF(...) printf(__VA_ARGS__) - #define BONDING_DEBUG_PRINT_BLOCK(block) bonding_print_block(block) - #define BONDING_DEBUG_PRINT_KEYS(keys) bonding_print_keys(keys) -#else - #define BONDING_DEBUG_PRINTF(...) - #define BONDING_DEBUG_PRINT_BLOCK(block) - #define BONDING_DEBUG_PRINT_KEYS(keys) -#endif - -// Bonding data is stored in variable-length blocks consecutively in -// erased flash (all 1's). The blocks are 32-bit aligned, though the -// data may be any number of bytes. We hop through the blocks using -// the size field to find the next block. When we hit a word that is -// all 1's, we have reached the end of the blocks. We can write a new -// block there. - -typedef enum { - BLOCK_INVALID = 0, // Ignore this block - BLOCK_KEYS = 1, // Block contains bonding keys. - BLOCK_SYS_ATTR = 2, // Block contains sys_attr values (CCCD settings, etc.). - BLOCK_UNUSED = 0xff, // Initial erased value. -} bonding_block_type_t; - -typedef struct { - bool is_central: 1; // 1 if data is for a central role. - uint16_t reserved: 7; // Not currently used - bonding_block_type_t type: 8; // What kind of data is stored in. - uint16_t ediv; // ediv value; used as a lookup key. - uint16_t conn_handle; // Connection handle: used when a BLOCK_SYS_ATTR is queued to write. - // Not used as a key, etc. - uint16_t data_length; // Length of data in bytes, including ediv, not including padding. - // End of block header. 32-bit boundary here. - uint8_t data[]; // Rest of data in the block. Needs to be 32-bit aligned. - // Block is padded to 32-bit alignment. -} bonding_block_t; - -void bonding_background(void); -void bonding_erase_storage(void); -void bonding_reset(void); -void bonding_clear_keys(bonding_keys_t *bonding_keys); -bool bonding_load_cccd_info(bool is_central, uint16_t conn_handle, uint16_t ediv); -bool bonding_load_keys(bool is_central, uint16_t ediv, bonding_keys_t *bonding_keys); - -#endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_BONDING_H diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 811de78664..38ef373126 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -317,6 +317,13 @@ SRC_COMMON_HAL_ALL = \ watchdog/WatchDogTimer.c \ watchdog/__init__.c \ +ifeq ($(CIRCUITPY_BLEIO_HCI),1) +SRC_C +=\ + common_hal/_bleio/hci.c \ + +endif + + SRC_COMMON_HAL = $(filter $(SRC_PATTERNS), $(SRC_COMMON_HAL_ALL)) # These don't have corresponding files in each port but are still located in @@ -463,6 +470,11 @@ $(filter $(SRC_PATTERNS), \ displayio/display_core.c \ ) +SRC_COMMON_HAL_INTERNAL = \ +$(filter $(SRC_PATTERNS), \ + _bleio/ \ +) + ifeq ($(INTERNAL_LIBM),1) SRC_LIBM = \ $(addprefix lib/,\ diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 0780e0a327..cf3b62ff18 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -90,10 +90,10 @@ STATIC mp_obj_t bleio_adapter_make_new(const mp_obj_type_t *type, size_t n_args, { MP_QSTR_cts, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_baudrate, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 115200 } }, { MP_QSTR_buffer_size, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 256 } }, - { MP_QSTR_spi_cs, MP_ARG_KW_ONLY }| MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_gpio0, MP_ARG_KW_ONLY }| MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_reset, MP_ARG_KW_ONLY }| MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_reset_high, MP_ARG_KW_ONLY |MP_ARG_BOOL }, + { MP_QSTR_spi_cs, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_gpio0, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_reset, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_reset_high, MP_ARG_KW_ONLY | MP_ARG_BOOL }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; @@ -108,13 +108,23 @@ STATIC mp_obj_t bleio_adapter_make_new(const mp_obj_type_t *type, size_t n_args, const mcu_pin_obj_t *reset = validate_obj_is_free_pin(args[ARG_reset].u_obj); const bool reset_high = args[ARG_reset_high].u_bool; + if (args[ARG_baudrate].u_int <= 0) { + mp_raise_ValueError(translate("baudrate must be > 0")); + } + const uint32_t baudrate = args[ARG_baudrate].u_int; + + if (args[ARG_buffer_size].u_int <= 1) { + mp_raise_ValueError(translate("buffer_size must be >= 1")); + } + const uint32_t buffer_size = args[ARG_buffer_size].u_int; + common_hal_bleio_adapter_construct(&common_hal_bleio_adapter_obj, tx, rx, rts, cts, - args[ARG_baudrate], arg[ARG_buffer_size], + baudrate, buffer_size, spi_cs, gpio0, reset, reset_high); common_hal_bleio_adapter_set_enabled(&common_hal_bleio_adapter_obj, true); - return MP_OBJ_FROM_PTR(service); + return MP_OBJ_FROM_PTR(&common_hal_bleio_adapter_obj); } #endif //| diff --git a/shared-bindings/_bleio/Adapter.h b/shared-bindings/_bleio/Adapter.h index 39147b6ebc..3f7cd54304 100644 --- a/shared-bindings/_bleio/Adapter.h +++ b/shared-bindings/_bleio/Adapter.h @@ -37,6 +37,10 @@ const mp_obj_type_t bleio_adapter_type; +#if CIRCUITPY_BLEIO_HCI +void common_hal_bleio_adapter_construct(bleio_adapter_obj_t *self, const mcu_pin_obj_t *tx, const mcu_pin_obj_t *rx, const mcu_pin_obj_t *rts, const mcu_pin_obj_t *cts, uint32_t baudrate, uint32_t buffer_size, const mcu_pin_obj_t* spi_cs, const mcu_pin_obj_t* gpio0, const mcu_pin_obj_t *reset, bool reset_high); +#endif + extern bool common_hal_bleio_adapter_get_advertising(bleio_adapter_obj_t *self); extern bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self); extern void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enabled); From ba0911b0f6f03238d1f81b010f85192678fb7fa4 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 26 Jun 2020 17:01:25 -0500 Subject: [PATCH 0117/1293] add custom css for 'viewing-old-docs' message --- docs/static/customstyle.css | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/static/customstyle.css b/docs/static/customstyle.css index 6c964b762c..2f6e10bd83 100644 --- a/docs/static/customstyle.css +++ b/docs/static/customstyle.css @@ -9,7 +9,19 @@ margin: 4px; } +/* custom CSS to sticky the ' viewing outdated version' + warning +*/ +.document > .admonition { + position: sticky; + top: 0px; + background-color: salmon; + z-index: 2; +} +body { + overflow-x: unset!important; +} /* override table width restrictions */ @media screen and (min-width: 767px) { From f879114c43297e6cb94f697a6009904d7e260131 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 26 Jun 2020 19:27:05 -0400 Subject: [PATCH 0118/1293] do HCI pin init in Python, not here --- devices/ble_hci/common-hal/_bleio/Adapter.c | 62 +--------------- devices/ble_hci/common-hal/_bleio/Adapter.h | 7 -- shared-bindings/_bleio/Adapter.c | 82 ++++++++++----------- shared-bindings/_bleio/Adapter.h | 36 ++++----- 4 files changed, 58 insertions(+), 129 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index adfd12845e..c25bec5b82 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -177,17 +177,13 @@ char default_ble_name[] = { 'C', 'I', 'R', 'C', 'U', 'I', 'T', 'P', 'Y', 0, 0, 0 // common_hal_bleio_adapter_set_name(self, (char*) default_ble_name); // } -void common_hal_bleio_adapter_construct(bleio_adapter_obj_t *self, const mcu_pin_obj_t *tx, const mcu_pin_obj_t *rx, const mcu_pin_obj_t *rts, const mcu_pin_obj_t *cts, uint32_t baudrate, uint32_t buffer_size, const mcu_pin_obj_t* spi_cs, const mcu_pin_obj_t* gpio0, const mcu_pin_obj_t *reset, bool reset_high) { +void common_hal_bleio_adapter_hci_init(bleio_adapter_obj_t *self, const mcu_pin_obj_t *tx, const mcu_pin_obj_t *rx, const mcu_pin_obj_t *rts, const mcu_pin_obj_t *cts, uint32_t baudrate, uint32_t buffer_size) { self->tx = tx; self->rx = rx; self->rts = rts; self->cts = cts; self->baudrate = baudrate; self->buffer_size = buffer_size; - self->spi_cs = spi_cs; - self->gpio0 = gpio0; - self->reset = reset; - self->reset_high = reset_high; self->enabled = false; } @@ -199,60 +195,8 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable return; } - if (enabled) { - // Enable adapter. - - // common_hal UART takes rts and cts, but is currently not implemented for many ports. - // In addition, rts and cts may be pins that are not part of the serial peripheral - // used for tx and rx, so use GPIO for them. - common_hal_busio_uart_construct(&self->hci_uart, self->tx, self->rx, NULL, NULL, NULL, false, - self->baudrate, 8, PARITY_NONE, 1, 0.0f, - self->buffer_size, NULL, false); - - // RTS is output, active high - common_hal_digitalio_digitalinout_construct(&self->rts_digitalio, self->rts); - common_hal_digitalio_digitalinout_switch_to_output(&self->rts_digitalio, false, DRIVE_MODE_PUSH_PULL); - - // CTS is input. - common_hal_digitalio_digitalinout_construct(&self->cts_digitalio, self->cts); - - // SPI_CS and GPI0 are used to signal entering BLE mode. - // SPI_CS should be low, and GPI0 should be high - common_hal_digitalio_digitalinout_construct(&self->spi_cs_digitalio, self->spi_cs); - common_hal_digitalio_digitalinout_construct(&self->gpio0_digitalio, self->gpio0); - common_hal_digitalio_digitalinout_switch_to_output(&self->spi_cs_digitalio, false, DRIVE_MODE_PUSH_PULL); - common_hal_digitalio_digitalinout_switch_to_output(&self->gpio0_digitalio, true, DRIVE_MODE_PUSH_PULL); - - // RESET is output, start in non-reset state. - common_hal_digitalio_digitalinout_construct(&self->reset_digitalio, self->reset); - common_hal_digitalio_digitalinout_switch_to_output(&self->reset_digitalio, - !self->reset_high, DRIVE_MODE_PUSH_PULL); - - // Adapter will enter BLE mode on reset, based on SPI_CS and GPIO0 settings. - // Reset HCI processor. Assert reset for 100ms, then wait 750ms for reset to complete. - common_hal_digitalio_digitalinout_set_value(&self->reset_digitalio, self->reset_high); - mp_hal_delay_ms(100); - common_hal_digitalio_digitalinout_set_value(&self->reset_digitalio, !self->reset_high); - mp_hal_delay_ms(750); - - // After reset, set SPI_CS high. - common_hal_digitalio_digitalinout_set_value(&self->spi_cs_digitalio, true); - - return; - } - - // Disable. - common_hal_digitalio_digitalinout_set_value(&self->reset_digitalio, self->reset_high); - mp_hal_delay_ms(100); - common_hal_digitalio_digitalinout_set_value(&self->reset_digitalio, !self->reset_high); - - // Free all pins. - common_hal_busio_uart_deinit(&self->hci_uart); - common_hal_digitalio_digitalinout_deinit(&self->rts_digitalio); - common_hal_digitalio_digitalinout_deinit(&self->cts_digitalio); - common_hal_digitalio_digitalinout_deinit(&self->spi_cs_digitalio); - common_hal_digitalio_digitalinout_deinit(&self->gpio0_digitalio); - common_hal_digitalio_digitalinout_deinit(&self->reset_digitalio); + //FIX enable/disable HCI adapter, but don't reset it, since we don't know how. + self->enabled = enabled; } bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self) { diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.h b/devices/ble_hci/common-hal/_bleio/Adapter.h index f045f920f4..38303062aa 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.h +++ b/devices/ble_hci/common-hal/_bleio/Adapter.h @@ -58,16 +58,9 @@ typedef struct { const mcu_pin_obj_t* cts; uint32_t baudrate; uint16_t buffer_size; - const mcu_pin_obj_t* spi_cs; - const mcu_pin_obj_t* gpio0; - const mcu_pin_obj_t* reset; - bool reset_high; busio_uart_obj_t hci_uart; digitalio_digitalinout_obj_t rts_digitalio; digitalio_digitalinout_obj_t cts_digitalio; - digitalio_digitalinout_obj_t spi_cs_digitalio; - digitalio_digitalinout_obj_t gpio0_digitalio; - digitalio_digitalinout_obj_t reset_digitalio; bool enabled; } bleio_adapter_obj_t; diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index cf3b62ff18..911fa6d35a 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -65,24 +65,26 @@ //| connections and also initiate connections.""" //| -//| def __init__(self, *, tx: Pin, rx: Pin, rts: Pin, cts: Pin, baudrate: int = 115200, buffer_size: int = 256, spi_cs: Pin, gpio0: Pin, reset: Pin, reset_high: bool): -//| """On boards with native BLE, such as the nRf52840, -//| you cannot create an instance of `_bleio.Adapter`. +//| def __init__(self, *, tx: Pin, rx: Pin, rts: Pin, cts: Pin, baudrate: int = 115200, buffer_size: int = 256): +//| You cannot create an instance of `_bleio.Adapter`. //| Use `_bleio.adapter` to access the sole instance available.""" //| -//| On boards that do not have native BLE, -//| call `_bleio.Adapter()` once, passing it the pins used to communicate -//| with an HCI co-processor, such as an Adafruit AirLift, on or off the board. -//| The `Adapter` object will be initialized, enabled, and will be available as `_bleio.adapter`. +//| On boards that do not have native BLE. You can use HCI co-processor. +//| Call `_bleio.adapter.hci_init()` passing it the pins used to communicate +//| with the co-processor, such as an Adafruit AirLift. +//| The co-processor must have been reset and put into BLE mode beforehand +//| by the appropriate pin manipulation. //| The `tx`, `rx`, `rts`, and `cs` pins are used to communicate with the HCI co-processor in HCI mode. -//| The `spi_cs` and `gpio0` pins are used to enable BLE mode -//| (usually `spi_cs` is low and `gpio0` is high to enter BLE mode). -//| The `reset` pin is used to reset the co-processor. -//| `reset_high` describes whether the reset pin is active high or active low. //| #if CIRCUITPY_BLEIO_HCI -STATIC mp_obj_t bleio_adapter_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_tx, ARG_rx, ARG_rts, ARG_cts, ARG_baudrate, ARG_buffer_size, ARG_spi_cs, ARG_gpio0, ARG_reset, ARG_reset_high }; +mp_obj_t bleio_adapter_hci_init(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + bleio_adapter_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + + if (self->enabled) { + mp_raise_ValueError(translate("HCI Adapter is already enabled")); + } + + enum { ARG_tx, ARG_rx, ARG_rts, ARG_cts, ARG_baudrate, ARG_buffer_size }; static const mp_arg_t allowed_args[] = { { MP_QSTR_tx, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_rx, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, @@ -90,43 +92,33 @@ STATIC mp_obj_t bleio_adapter_make_new(const mp_obj_type_t *type, size_t n_args, { MP_QSTR_cts, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_baudrate, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 115200 } }, { MP_QSTR_buffer_size, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 256 } }, - { MP_QSTR_spi_cs, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_gpio0, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_reset, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_reset_high, MP_ARG_KW_ONLY | MP_ARG_BOOL }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - const mcu_pin_obj_t *tx = validate_obj_is_free_pin(args[ARG_tx].u_obj); - const mcu_pin_obj_t *rx = validate_obj_is_free_pin(args[ARG_rx].u_obj); - const mcu_pin_obj_t *rts = validate_obj_is_free_pin(args[ARG_rts].u_obj); - const mcu_pin_obj_t *cts = validate_obj_is_free_pin(args[ARG_cts].u_obj); - const mcu_pin_obj_t *spi_cs = validate_obj_is_free_pin(args[ARG_spi_cs].u_obj); - const mcu_pin_obj_t *gpio0 = validate_obj_is_free_pin(args[ARG_gpio0].u_obj); - const mcu_pin_obj_t *reset = validate_obj_is_free_pin(args[ARG_reset].u_obj); - const bool reset_high = args[ARG_reset_high].u_bool; + const mcu_pin_obj_t *tx = validate_obj_is_free_pin(args[ARG_tx].u_obj); + const mcu_pin_obj_t *rx = validate_obj_is_free_pin(args[ARG_rx].u_obj); + const mcu_pin_obj_t *rts = validate_obj_is_free_pin(args[ARG_rts].u_obj); + const mcu_pin_obj_t *cts = validate_obj_is_free_pin(args[ARG_cts].u_obj); - if (args[ARG_baudrate].u_int <= 0) { - mp_raise_ValueError(translate("baudrate must be > 0")); - } - const uint32_t baudrate = args[ARG_baudrate].u_int; + if (args[ARG_baudrate].u_int <= 0) { + mp_raise_ValueError(translate("baudrate must be > 0")); + } + const uint32_t baudrate = args[ARG_baudrate].u_int; - if (args[ARG_buffer_size].u_int <= 1) { - mp_raise_ValueError(translate("buffer_size must be >= 1")); - } - const uint32_t buffer_size = args[ARG_buffer_size].u_int; + if (args[ARG_buffer_size].u_int <= 1) { + mp_raise_ValueError(translate("buffer_size must be >= 1")); + } + const uint32_t buffer_size = args[ARG_buffer_size].u_int; - common_hal_bleio_adapter_construct(&common_hal_bleio_adapter_obj, tx, rx, rts, cts, - baudrate, buffer_size, - spi_cs, gpio0, - reset, reset_high); - common_hal_bleio_adapter_set_enabled(&common_hal_bleio_adapter_obj, true); - - return MP_OBJ_FROM_PTR(&common_hal_bleio_adapter_obj); + common_hal_bleio_adapter_hci_init(&common_hal_bleio_adapter_obj, tx, rx, rts, cts, + baudrate, buffer_size); + return mp_const_none; } -#endif +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_hci_init_obj, 1, bleio_adapter_hci_init); +#endif // CIRCUITPY_BLEIO_HCI + //| //| enabled: Any = ... //| """State of the BLE adapter.""" @@ -451,6 +443,9 @@ STATIC mp_obj_t bleio_adapter_erase_bonding(mp_obj_t self_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_erase_bonding_obj, bleio_adapter_erase_bonding); STATIC const mp_rom_map_elem_t bleio_adapter_locals_dict_table[] = { +#if CIRCUITPY_BLEIO_HCI + { MP_ROM_QSTR(MP_QSTR_hci_init), MP_ROM_PTR(&bleio_adapter_hci_init_obj) }, +#endif { MP_ROM_QSTR(MP_QSTR_enabled), MP_ROM_PTR(&bleio_adapter_enabled_obj) }, { MP_ROM_QSTR(MP_QSTR_address), MP_ROM_PTR(&bleio_adapter_address_obj) }, { MP_ROM_QSTR(MP_QSTR_name), MP_ROM_PTR(&bleio_adapter_name_obj) }, @@ -475,8 +470,5 @@ STATIC MP_DEFINE_CONST_DICT(bleio_adapter_locals_dict, bleio_adapter_locals_dict const mp_obj_type_t bleio_adapter_type = { .base = { &mp_type_type }, .name = MP_QSTR_Adapter, -#if CIRCUITPY_BLEIO_HCI - .make_new = bleio_adapter_make_new, - #endif .locals_dict = (mp_obj_t)&bleio_adapter_locals_dict, }; diff --git a/shared-bindings/_bleio/Adapter.h b/shared-bindings/_bleio/Adapter.h index 3f7cd54304..8fdeb1354c 100644 --- a/shared-bindings/_bleio/Adapter.h +++ b/shared-bindings/_bleio/Adapter.h @@ -38,30 +38,30 @@ const mp_obj_type_t bleio_adapter_type; #if CIRCUITPY_BLEIO_HCI -void common_hal_bleio_adapter_construct(bleio_adapter_obj_t *self, const mcu_pin_obj_t *tx, const mcu_pin_obj_t *rx, const mcu_pin_obj_t *rts, const mcu_pin_obj_t *cts, uint32_t baudrate, uint32_t buffer_size, const mcu_pin_obj_t* spi_cs, const mcu_pin_obj_t* gpio0, const mcu_pin_obj_t *reset, bool reset_high); -#endif +void common_hal_bleio_adapter_hci_init(bleio_adapter_obj_t *self, const mcu_pin_obj_t *tx, const mcu_pin_obj_t *rx, const mcu_pin_obj_t *rts, const mcu_pin_obj_t *cts, uint32_t baudrate, uint32_t buffer_size); +#endif // CIRCUITPY_BLEIO_HCI -extern bool common_hal_bleio_adapter_get_advertising(bleio_adapter_obj_t *self); -extern bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self); -extern void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enabled); -extern bool common_hal_bleio_adapter_get_connected(bleio_adapter_obj_t *self); -extern bleio_address_obj_t *common_hal_bleio_adapter_get_address(bleio_adapter_obj_t *self); +bool common_hal_bleio_adapter_get_advertising(bleio_adapter_obj_t *self); +bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self); +void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enabled); +bool common_hal_bleio_adapter_get_connected(bleio_adapter_obj_t *self); +bleio_address_obj_t *common_hal_bleio_adapter_get_address(bleio_adapter_obj_t *self); -extern mp_obj_str_t* common_hal_bleio_adapter_get_name(bleio_adapter_obj_t *self); -extern void common_hal_bleio_adapter_set_name(bleio_adapter_obj_t *self, const char* name); +mp_obj_str_t* common_hal_bleio_adapter_get_name(bleio_adapter_obj_t *self); +void common_hal_bleio_adapter_set_name(bleio_adapter_obj_t *self, const char* name); -extern uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, uint32_t timeout, float interval, uint8_t *advertising_data, uint16_t advertising_data_len, uint8_t *scan_response_data, uint16_t scan_response_data_len); +uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, uint32_t timeout, float interval, uint8_t *advertising_data, uint16_t advertising_data_len, uint8_t *scan_response_data, uint16_t scan_response_data_len); -extern void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, uint32_t timeout, mp_float_t interval, mp_buffer_info_t *advertising_data_bufinfo, mp_buffer_info_t *scan_response_data_bufinfo); -extern void common_hal_bleio_adapter_stop_advertising(bleio_adapter_obj_t *self); +void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, uint32_t timeout, mp_float_t interval, mp_buffer_info_t *advertising_data_bufinfo, mp_buffer_info_t *scan_response_data_bufinfo); +void common_hal_bleio_adapter_stop_advertising(bleio_adapter_obj_t *self); -extern mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t* prefixes, size_t prefix_length, bool extended, mp_int_t buffer_size, mp_float_t timeout, mp_float_t interval, mp_float_t window, mp_int_t minimum_rssi, bool active); -extern void common_hal_bleio_adapter_stop_scan(bleio_adapter_obj_t *self); +mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t* prefixes, size_t prefix_length, bool extended, mp_int_t buffer_size, mp_float_t timeout, mp_float_t interval, mp_float_t window, mp_int_t minimum_rssi, bool active); +void common_hal_bleio_adapter_stop_scan(bleio_adapter_obj_t *self); -extern bool common_hal_bleio_adapter_get_connected(bleio_adapter_obj_t *self); -extern mp_obj_t common_hal_bleio_adapter_get_connections(bleio_adapter_obj_t *self); -extern mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_address_obj_t *address, mp_float_t timeout); +bool common_hal_bleio_adapter_get_connected(bleio_adapter_obj_t *self); +mp_obj_t common_hal_bleio_adapter_get_connections(bleio_adapter_obj_t *self); +mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_address_obj_t *address, mp_float_t timeout); -extern void common_hal_bleio_adapter_erase_bonding(bleio_adapter_obj_t *self); +void common_hal_bleio_adapter_erase_bonding(bleio_adapter_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_ADAPTER_H From 08749630a28527f45a01cbfa3c1db417030feacf Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 26 Jun 2020 16:30:24 -0700 Subject: [PATCH 0119/1293] Fix SPI RX and remove debug prints --- ports/esp32s2/common-hal/busio/SPI.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index 60514df389..73d7d0595e 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -32,10 +32,6 @@ #include "shared-bindings/microcontroller/Pin.h" #include "supervisor/shared/rgb_led_status.h" -#include "esp_log.h" - -static const char* TAG = "CircuitPython SPI"; - static bool spi_never_reset[SOC_SPI_PERIPH_NUM]; // Store one lock handle per device so that we can free it. @@ -101,8 +97,7 @@ static bool spi_bus_is_free(spi_host_device_t host_id) { } static void spi_interrupt_handler(void *arg) { - busio_spi_obj_t *self = arg; - ESP_LOGE(TAG, "SPI interrupt %p", self); + // busio_spi_obj_t *self = arg; } // The interrupt may get invoked by the bus lock. @@ -197,8 +192,8 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, // hal->cs_hold = 0; // hal->cs_pin_id = 0; - hal->sio = 1; - // hal->half_duplex = 0; + hal->sio = 0; + hal->half_duplex = 0; // hal->tx_lsbfirst = 0; // hal->rx_lsbfirst = 0; hal->dma_enabled = 1; @@ -216,9 +211,6 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, // This must be set after spi_hal_init. hal->timing_conf = &self->timing_conf; - if (hal->hw == NULL) { - ESP_LOGE(TAG, "SPI error %p", hal->hw); - } common_hal_busio_spi_configure(self, 250000, 0, 0, 8); } @@ -280,11 +272,7 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, return false; } - ESP_LOGI(TAG, "configure"); - ESP_LOGI(TAG, "real frequency %d", self->real_frequency); - ESP_LOGI(TAG, "timing_conf %p", self->hal_context.timing_conf); spi_hal_setup_device(&self->hal_context); - ESP_LOGI(TAG, "setup done"); return true; } @@ -351,6 +339,7 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_ou while (!spi_hal_usr_is_done(hal)) { RUN_BACKGROUND_TASKS; } + spi_hal_fetch_result(hal); } return true; From 7f6bef3251d295120fe8f89e666b277dc2f596b1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 26 Jun 2020 16:56:17 -0700 Subject: [PATCH 0120/1293] Remove debug prints --- ports/esp32s2/supervisor/internal_flash.c | 36 ++++++++--------------- ports/esp32s2/supervisor/port.c | 24 ++------------- 2 files changed, 15 insertions(+), 45 deletions(-) diff --git a/ports/esp32s2/supervisor/internal_flash.c b/ports/esp32s2/supervisor/internal_flash.c index a8d3fa485c..5cf77c8010 100644 --- a/ports/esp32s2/supervisor/internal_flash.c +++ b/ports/esp32s2/supervisor/internal_flash.c @@ -39,11 +39,6 @@ #include "esp-idf/components/spi_flash/include/esp_partition.h" -#include "esp_log.h" - - -static const char* TAG = "CircuitPython Internal Flash"; - #include "supervisor/usb.h" STATIC const esp_partition_t * _partition; @@ -52,8 +47,6 @@ void supervisor_flash_init(void) { _partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_FAT, NULL); - - ESP_EARLY_LOGW(TAG, "fatfs partition %p", _partition); } uint32_t supervisor_flash_get_block_size(void) { @@ -74,11 +67,10 @@ STATIC uint8_t _cache[SECTOR_SIZE]; STATIC uint32_t _cache_lba; mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { - esp_err_t ok = esp_partition_read(_partition, - block * FILESYSTEM_BLOCK_SIZE, - dest, - num_blocks * FILESYSTEM_BLOCK_SIZE); - ESP_EARLY_LOGW(TAG, "read %d", ok); + esp_partition_read(_partition, + block * FILESYSTEM_BLOCK_SIZE, + dest, + num_blocks * FILESYSTEM_BLOCK_SIZE); return 0; } @@ -90,13 +82,11 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 uint32_t sector_offset = block_address / blocks_per_sector * SECTOR_SIZE; uint8_t block_offset = block_address % blocks_per_sector; - esp_err_t result; if (_cache_lba != block_address) { - result = esp_partition_read(_partition, - sector_offset, - _cache, - SECTOR_SIZE); - ESP_EARLY_LOGW(TAG, "flash read before write %d", result); + esp_partition_read(_partition, + sector_offset, + _cache, + SECTOR_SIZE); _cache_lba = sector_offset; } for (uint8_t b = block_offset; b < blocks_per_sector; b++) { @@ -109,11 +99,11 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 FILESYSTEM_BLOCK_SIZE); block++; } - result = esp_partition_erase_range(_partition, sector_offset, SECTOR_SIZE); - result = esp_partition_write(_partition, - sector_offset, - _cache, - SECTOR_SIZE); + esp_partition_erase_range(_partition, sector_offset, SECTOR_SIZE); + esp_partition_write(_partition, + sector_offset, + _cache, + SECTOR_SIZE); } return 0; // success diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index ebf0020399..a80550b309 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -41,10 +41,6 @@ #include "supervisor/memory.h" #include "supervisor/shared/tick.h" -#include "esp_log.h" - -static const char* TAG = "CircuitPython"; - STATIC esp_timer_handle_t _tick_timer; void tick_timer_cb(void* arg) { @@ -57,12 +53,8 @@ safe_mode_t port_init(void) { args.arg = NULL; args.dispatch_method = ESP_TIMER_TASK; args.name = "CircuitPython Tick"; - esp_err_t result = esp_timer_create(&args, &_tick_timer); - if (result != ESP_OK) { - ESP_EARLY_LOGE(TAG, "Unable to create tick timer."); - } + esp_timer_create(&args, &_tick_timer); never_reset_module_internal_pins(); - ESP_EARLY_LOGW(TAG, "port init done"); return NO_SAFE_MODE; } @@ -109,12 +101,8 @@ uint32_t *port_stack_get_top(void) { supervisor_allocation _fixed_stack; supervisor_allocation* port_fixed_stack(void) { - - ESP_EARLY_LOGW(TAG, "port fixed stack"); _fixed_stack.ptr = port_stack_get_limit(); - ESP_EARLY_LOGW(TAG, "got limit %p", _fixed_stack.ptr); _fixed_stack.length = (port_stack_get_top() - port_stack_get_limit()) * sizeof(uint32_t); - ESP_EARLY_LOGW(TAG, "got length %d", _fixed_stack.length); return &_fixed_stack; } @@ -139,10 +127,7 @@ uint64_t port_get_raw_ticks(uint8_t* subticks) { // Enable 1/1024 second tick. void port_enable_tick(void) { - esp_err_t result = esp_timer_start_periodic(_tick_timer, 1000000 / 1024); - if (result != ESP_OK) { - ESP_EARLY_LOGE(TAG, "Unable to start tick timer."); - } + esp_timer_start_periodic(_tick_timer, 1000000 / 1024); } // Disable 1/1024 second tick. @@ -153,14 +138,12 @@ void port_disable_tick(void) { TickType_t sleep_time_set; TickType_t sleep_time_duration; void port_interrupt_after_ticks(uint32_t ticks) { - // ESP_EARLY_LOGW(TAG, "after ticks"); sleep_time_set = xTaskGetTickCount(); sleep_time_duration = ticks / portTICK_PERIOD_MS; // esp_sleep_enable_timer_wakeup(uint64_t time_in_us) } void port_sleep_until_interrupt(void) { - // ESP_EARLY_LOGW(TAG, "sleep until"); // FreeRTOS delay here maybe. // Light sleep shuts down BLE and wifi. // esp_light_sleep_start() @@ -174,8 +157,5 @@ void port_sleep_until_interrupt(void) { // Wrap main in app_main that the IDF expects. extern void main(void); void app_main(void) { - ESP_EARLY_LOGW(TAG, "Hello from CircuitPython"); - // ESP_LOGW(TAG, "Hello from CircuitPython"); - main(); } From bbedd43273fe404c5da151b9c12ab4a1ad02748d Mon Sep 17 00:00:00 2001 From: jerryneedell Date: Sat, 27 Jun 2020 13:27:42 -0400 Subject: [PATCH 0121/1293] change CMake verision requirement --- frozen/Adafruit_CircuitPython_RFM9x | 1 + ports/esp32s2/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 160000 frozen/Adafruit_CircuitPython_RFM9x diff --git a/frozen/Adafruit_CircuitPython_RFM9x b/frozen/Adafruit_CircuitPython_RFM9x new file mode 160000 index 0000000000..6485df1279 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_RFM9x @@ -0,0 +1 @@ +Subproject commit 6485df1279aac2d42a86861d27df5e692efbfc78 diff --git a/ports/esp32s2/CMakeLists.txt b/ports/esp32s2/CMakeLists.txt index c99c1c7e78..716588cf22 100644 --- a/ports/esp32s2/CMakeLists.txt +++ b/ports/esp32s2/CMakeLists.txt @@ -1,6 +1,6 @@ # The following five lines of boilerplate have to be in your project's # CMakeLists in this exact order for cmake to work correctly -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.13) set(ENV{IDF_PATH} ${CMAKE_SOURCE_DIR}/esp-idf) set(COMPONENTS esptool_py soc driver log main) From 501512552639c6dfd08a37149fbb9564237eb11a Mon Sep 17 00:00:00 2001 From: jerryneedell Date: Sun, 28 Jun 2020 05:23:07 -0400 Subject: [PATCH 0122/1293] remove extra frozen folder --- frozen/Adafruit_CircuitPython_RFM9x | 1 - 1 file changed, 1 deletion(-) delete mode 160000 frozen/Adafruit_CircuitPython_RFM9x diff --git a/frozen/Adafruit_CircuitPython_RFM9x b/frozen/Adafruit_CircuitPython_RFM9x deleted file mode 160000 index 6485df1279..0000000000 --- a/frozen/Adafruit_CircuitPython_RFM9x +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6485df1279aac2d42a86861d27df5e692efbfc78 From 39fc16deae265c691c4057d270641e5fd63fb166 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 25 Jun 2020 18:08:47 +0200 Subject: [PATCH 0123/1293] 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 | 2 +- locale/cs.po | 2 +- locale/de_DE.po | 2 +- locale/es.po | 2 +- locale/fil.po | 2 +- locale/fr.po | 2 +- locale/it_IT.po | 2 +- locale/ko.po | 2 +- locale/nl.po | 2 +- locale/pl.po | 2 +- locale/pt_BR.po | 2 +- locale/sv.po | 2 +- locale/zh_Latn_pinyin.po | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index ae057fbd7a..5a20dd965a 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/cs.po b/locale/cs.po index b23144fc8c..4fc8309216 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" diff --git a/locale/de_DE.po b/locale/de_DE.po index eff611b20d..dfe85323ab 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" diff --git a/locale/es.po b/locale/es.po index 22597249bd..7c0203565d 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2020-06-24 18:32+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" diff --git a/locale/fil.po b/locale/fil.po index e4c5678d27..8652cca634 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" diff --git a/locale/fr.po b/locale/fr.po index 5a49fd5f91..8fb8a72a1f 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" "Language: fr\n" diff --git a/locale/it_IT.po b/locale/it_IT.po index c47d0e8e3e..a0cc25b740 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" diff --git a/locale/ko.po b/locale/ko.po index 156f40d9b6..edab1d7377 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" diff --git a/locale/nl.po b/locale/nl.po index 77cc11cab3..f7586d7432 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2020-06-02 19:50+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" diff --git a/locale/pl.po b/locale/pl.po index 888ce64285..ca32e190e3 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e951df1080..68c829ca57 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/locale/sv.po b/locale/sv.po index df2431c4e0..f7c1278c6d 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2020-06-03 18:59+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 4f85c5fa86..16f79f8ff2 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" From b0440a90a7f1d2833cc3570f8d362e1a75d58fae Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 25 Jun 2020 19:51:56 +0200 Subject: [PATCH 0124/1293] 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 | 2 +- locale/cs.po | 2 +- locale/de_DE.po | 2 +- locale/es.po | 2 +- locale/fil.po | 2 +- locale/fr.po | 2 +- locale/it_IT.po | 2 +- locale/ko.po | 2 +- locale/nl.po | 2 +- locale/pl.po | 2 +- locale/pt_BR.po | 2 +- locale/sv.po | 2 +- locale/zh_Latn_pinyin.po | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 5a20dd965a..ae057fbd7a 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/cs.po b/locale/cs.po index 4fc8309216..b23144fc8c 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" diff --git a/locale/de_DE.po b/locale/de_DE.po index dfe85323ab..eff611b20d 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" diff --git a/locale/es.po b/locale/es.po index 7c0203565d..22597249bd 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-24 18:32+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" diff --git a/locale/fil.po b/locale/fil.po index 8652cca634..e4c5678d27 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" diff --git a/locale/fr.po b/locale/fr.po index 8fb8a72a1f..5a49fd5f91 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" "Language: fr\n" diff --git a/locale/it_IT.po b/locale/it_IT.po index a0cc25b740..c47d0e8e3e 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" diff --git a/locale/ko.po b/locale/ko.po index edab1d7377..156f40d9b6 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" diff --git a/locale/nl.po b/locale/nl.po index f7586d7432..77cc11cab3 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-02 19:50+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" diff --git a/locale/pl.po b/locale/pl.po index ca32e190e3..888ce64285 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 68c829ca57..e951df1080 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/locale/sv.po b/locale/sv.po index f7c1278c6d..df2431c4e0 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-03 18:59+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 16f79f8ff2..4f85c5fa86 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" From c9d8cfc9faa3a7e351de0b5d789e7fa3a85ac333 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Fri, 26 Jun 2020 09:11:07 +0000 Subject: [PATCH 0125/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 24.3% (185 of 759 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 109 +++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 62 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e951df1080..33d98d5bdb 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -3,25 +3,28 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-25 11:44-0500\n" -"PO-Revision-Date: 2018-10-02 21:14-0000\n" -"Last-Translator: \n" +"PO-Revision-Date: 2020-06-26 16:42+0000\n" +"Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\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.2-dev\n" #: main.c msgid "" "\n" "Code done running. Waiting for reload.\n" msgstr "" +"\n" +"O código concluiu a execução. Esperando pela recarga.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -29,12 +32,17 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"Registre um problema com o conteúdo do seu controlador no CIRCUITPY\n" +"https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c msgid "" "\n" "To exit, please reset the board without " msgstr "" +"\n" +"Para encerrar, redefina a placa sem " #: py/obj.c msgid " File \"%q\"" @@ -56,7 +64,7 @@ msgstr "%%c requer int ou char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "" +msgstr "%d endereços dos pinos e %d pinos rgb indicam uma altura do %d, não %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -78,18 +86,16 @@ msgstr "" #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c #: shared-bindings/vectorio/Rectangle.c -#, fuzzy msgid "%q must be >= 1" -msgstr "buffers devem ser o mesmo tamanho" +msgstr "%q deve ser >= 1" #: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" msgstr "" #: shared-bindings/fontio/BuiltinFont.c -#, fuzzy msgid "%q should be an int" -msgstr "y deve ser um int" +msgstr "%q deve ser um int" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -261,9 +267,9 @@ msgid "A hardware interrupt channel is already in use" msgstr "Um canal de interrupção de hardware já está em uso" #: shared-bindings/_bleio/Address.c -#, fuzzy, c-format +#, c-format msgid "Address must be %d bytes long" -msgstr "buffers devem ser o mesmo tamanho" +msgstr "O endereço deve ter %d bytes de comprimento" #: shared-bindings/_bleio/Address.c msgid "Address type out of range" @@ -278,9 +284,8 @@ msgid "All SPI peripherals are in use" msgstr "Todos os periféricos SPI estão em uso" #: ports/nrf/common-hal/busio/UART.c -#, fuzzy msgid "All UART peripherals are in use" -msgstr "Todos os periféricos I2C estão em uso" +msgstr "Todos os periféricos UART estão em uso" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "All event channels in use" @@ -435,14 +440,13 @@ msgstr "" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c -#, fuzzy, c-format +#, c-format msgid "Bus pin %d is already in use" -msgstr "DAC em uso" +msgstr "O pino bus %d já está em uso" #: shared-bindings/_bleio/UUID.c -#, fuzzy msgid "Byte buffer must be 16 bytes." -msgstr "buffers devem ser o mesmo tamanho" +msgstr "O buffer deve ter 16 bytes." #: shared-bindings/nvm/ByteArray.c msgid "Bytes must be between 0 and 255." @@ -471,9 +475,8 @@ msgid "Cannot get pull while in output mode" msgstr "" #: ports/nrf/common-hal/microcontroller/Processor.c -#, fuzzy msgid "Cannot get temperature" -msgstr "Não pode obter a temperatura. status: 0x%02x" +msgstr "Não é possível obter a temperatura" #: shared-bindings/_bleio/Adapter.c msgid "Cannot have scan responses for extended, connectable advertisements." @@ -527,7 +530,7 @@ msgstr "" #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." -msgstr "Não é possível ler sem um pino MOSI" +msgstr "Não é possível fazer a escrita sem um pino MOSI." #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -561,9 +564,8 @@ msgstr "" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c -#, fuzzy msgid "Command must be an int between 0 and 255" -msgstr "Os bytes devem estar entre 0 e 255." +msgstr "O comando deve ser um int entre 0 e 255" #: shared-bindings/_bleio/Connection.c msgid "" @@ -659,9 +661,8 @@ msgid "Data chunk must follow fmt chunk" msgstr "Pedaço de dados deve seguir o pedaço de cortes" #: ports/nrf/common-hal/_bleio/Adapter.c -#, fuzzy msgid "Data too large for advertisement packet" -msgstr "Não é possível ajustar dados no pacote de anúncios." +msgstr "Os dados são grandes demais para o pacote de publicidade" #: shared-bindings/audiobusio/PDMIn.c msgid "Destination capacity is smaller than destination_length." @@ -713,9 +714,8 @@ msgstr "Esperado um" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c -#, fuzzy msgid "Expected a Characteristic" -msgstr "Não é possível adicionar Característica." +msgstr "Uma característica é necessária" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" @@ -723,9 +723,8 @@ msgstr "" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c -#, fuzzy msgid "Expected a UUID" -msgstr "Esperado um" +msgstr "Um UUID é necessário" #: shared-bindings/_bleio/Adapter.c msgid "Expected an Address" @@ -749,9 +748,9 @@ msgid "Failed sending command." msgstr "Falha ao enviar comando." #: ports/nrf/sd_mutex.c -#, fuzzy, c-format +#, c-format msgid "Failed to acquire mutex, err 0x%04x" -msgstr "Não é possível ler o valor do atributo. status: 0x%02x" +msgstr "Houve uma falha na aquisição do mutex, err 0x%04x" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" @@ -779,9 +778,9 @@ msgid "Failed to parse MP3 file" msgstr "" #: ports/nrf/sd_mutex.c -#, fuzzy, c-format +#, c-format msgid "Failed to release mutex, err 0x%04x" -msgstr "Não é possível ler o valor do atributo. status: 0x%02x" +msgstr "Houve uma falha ao liberar o mutex, err 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." @@ -911,9 +910,8 @@ msgid "Invalid bits per value" msgstr "" #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -#, fuzzy msgid "Invalid buffer size" -msgstr "Arquivo inválido" +msgstr "O tamanho do buffer é inválido" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Invalid byteorder string" @@ -924,13 +922,12 @@ msgid "Invalid capture period. Valid range: 1 - 500" msgstr "" #: shared-bindings/audiomixer/Mixer.c -#, fuzzy msgid "Invalid channel count" -msgstr "certificado inválido" +msgstr "A contagem do canal é inválido" #: shared-bindings/digitalio/DigitalInOut.c msgid "Invalid direction." -msgstr "Direção inválida" +msgstr "Direção inválida." #: shared-module/audiocore/WaveFile.c msgid "Invalid file" @@ -1008,9 +1005,8 @@ msgid "Invalid voice" msgstr "" #: shared-bindings/audiomixer/Mixer.c -#, fuzzy msgid "Invalid voice count" -msgstr "certificado inválido" +msgstr "A contagem da voz é inválida" #: shared-module/audiocore/WaveFile.c msgid "Invalid wave file" @@ -1046,7 +1042,7 @@ msgstr "" #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." -msgstr "Inicialização do pino MISO falhou" +msgstr "A inicialização do pino MISO falhou." #: shared-module/bitbangio/SPI.c msgid "MOSI pin init failed." @@ -1187,9 +1183,8 @@ msgstr "" #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c -#, fuzzy msgid "Not connected" -msgstr "Não é possível conectar-se ao AP" +msgstr "Não Conectado" #: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c #: shared-bindings/audiopwmio/PWMAudioOut.c @@ -1203,9 +1198,8 @@ msgstr "" "Objeto foi desinicializado e não pode ser mais usaado. Crie um novo objeto." #: ports/nrf/common-hal/busio/UART.c -#, fuzzy msgid "Odd parity is not supported" -msgstr "I2C operação não suportada" +msgstr "A paridade ímpar não é compatível" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1276,9 +1270,8 @@ msgid "" msgstr "" #: py/builtinhelp.c -#, fuzzy msgid "Plus any modules on the filesystem\n" -msgstr "Não é possível remontar o sistema de arquivos" +msgstr "Além de quaisquer módulos no sistema de arquivos\n" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" @@ -1347,9 +1340,8 @@ msgid "Read-only filesystem" msgstr "Sistema de arquivos somente leitura" #: shared-module/displayio/Bitmap.c -#, fuzzy msgid "Read-only object" -msgstr "Somente leitura" +msgstr "Objeto de leitura apenas" #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" @@ -1638,9 +1630,8 @@ msgid "Unsupported baudrate" msgstr "Taxa de transmissão não suportada" #: shared-module/displayio/display_core.c -#, fuzzy msgid "Unsupported display bus type" -msgstr "Taxa de transmissão não suportada" +msgstr "Não há suporte para o tipo do display bus" #: shared-module/audiocore/WaveFile.c msgid "Unsupported format" @@ -1716,7 +1707,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " -msgstr "Você solicitou o início do modo de segurança" +msgstr "Você solicitou o início do modo de segurança através do " #: py/objtype.c msgid "__init__() should return None" @@ -1830,23 +1821,20 @@ msgid "bits must be 7, 8 or 9" msgstr "" #: shared-bindings/audiomixer/Mixer.c -#, fuzzy msgid "bits_per_sample must be 8 or 16" -msgstr "bits devem ser 8" +msgstr "bits_per_sample deve ser 8 ou 16" #: py/emitinlinethumb.c -#, fuzzy msgid "branch not in range" -msgstr "Calibração está fora do intervalo" +msgstr "ramo fora do alcance" #: shared-bindings/audiocore/RawSample.c msgid "buffer must be a bytes-like object" msgstr "" #: shared-module/struct/__init__.c -#, fuzzy msgid "buffer size must match format" -msgstr "buffers devem ser o mesmo tamanho" +msgstr "o tamanho do buffer deve coincidir com o formato" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "buffer slices must be of equal length" @@ -2193,9 +2181,8 @@ msgid "end of format while looking for conversion specifier" msgstr "" #: shared-bindings/displayio/Shape.c -#, fuzzy msgid "end_x should be an int" -msgstr "y deve ser um int" +msgstr "end_x deve ser um int" #: ports/nrf/common-hal/busio/UART.c #, c-format @@ -3015,9 +3002,8 @@ msgid "start/end indices" msgstr "" #: shared-bindings/displayio/Shape.c -#, fuzzy msgid "start_x should be an int" -msgstr "y deve ser um int" +msgstr "start_x deve ser um int" #: shared-bindings/random/__init__.c msgid "step must be non-zero" @@ -3093,9 +3079,8 @@ msgid "timeout must be 0.0-100.0 seconds" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c -#, fuzzy msgid "timeout must be >= 0.0" -msgstr "bits devem ser 8" +msgstr "o tempo limite deve ser >= 0,0" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" From 87e4f47866853c938a5a624c5a1a416a831692c8 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Mon, 29 Jun 2020 00:17:12 -0500 Subject: [PATCH 0126/1293] docs/shared_bindings_matrix.py: changes to allow usage in 'tools/build_board_info.py'; includes root dir finder, and output board name option. --- docs/shared_bindings_matrix.py | 49 +++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index 02ef683492..c0d07d4b41 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -23,6 +23,7 @@ import json import os +import pathlib import re import subprocess import sys @@ -30,17 +31,39 @@ import sys SUPPORTED_PORTS = ['atmel-samd', 'esp32s2', 'litex', 'mimxrt10xx', 'nrf', 'stm'] +def get_circuitpython_root_dir(): + """ The path to the root './circuitpython' directory + """ + cwd = pathlib.Path('.').resolve() + cwd_parts = cwd.parts + + root_idx = len(cwd_parts) + + # Search the path from tail to head, so that we capture the + # deepest folder. This avoids overshooting in instances like: + # '/home/user/circuitpython_v5/circuitpython' + for idx, val in enumerate(cwd_parts[::-1]): + if val.startswith("circuitpython"): + root_idx = root_idx - idx + break + + root_dir = '/'.join(cwd_parts[:root_idx]) + + return pathlib.Path(root_dir).resolve() + def get_shared_bindings(): """ Get a list of modules in shared-bindings based on folder names """ - return [item for item in os.listdir("./shared-bindings")] + shared_bindings_dir = get_circuitpython_root_dir() / "shared-bindings" + return [item.name for item in shared_bindings_dir.iterdir()] def read_mpconfig(): """ Open 'circuitpy_mpconfig.mk' and return the contents. """ configs = [] - with open("py/circuitpy_mpconfig.mk") as mpconfig: + cpy_mpcfg = get_circuitpython_root_dir() / "py" / "circuitpy_mpconfig.mk" + with open(cpy_mpcfg) as mpconfig: configs = mpconfig.read() return configs @@ -120,7 +143,7 @@ def lookup_setting(settings, key, default=''): key = value[2:-1] return value -def support_matrix_by_board(): +def support_matrix_by_board(use_branded_name=True): """ Compiles a list of the available core modules available for each board. """ @@ -129,20 +152,22 @@ def support_matrix_by_board(): boards = dict() for port in SUPPORTED_PORTS: - port_dir = "ports/{}/boards".format(port) - for entry in os.scandir(port_dir): + port_dir = get_circuitpython_root_dir() / "ports" / port + for entry in (port_dir / "boards").iterdir(): if not entry.is_dir(): continue board_modules = [] + board_name = entry.name - settings = get_settings_from_makefile(f'ports/{port}', entry.name) + settings = get_settings_from_makefile(str(port_dir), entry.name) - with open(os.path.join(entry.path, "mpconfigboard.h")) as get_name: - board_contents = get_name.read() - board_name_re = re.search("(?<=MICROPY_HW_BOARD_NAME)\s+(.+)", - board_contents) - if board_name_re: - board_name = board_name_re.group(1).strip('"') + if use_branded_name: + with open(os.path.join(entry.path, "mpconfigboard.h")) as get_name: + board_contents = get_name.read() + board_name_re = re.search(r"(?<=MICROPY_HW_BOARD_NAME)\s+(.+)", + board_contents) + if board_name_re: + board_name = board_name_re.group(1).strip('"') board_modules = [] for module in base: From 928433f2e3d16ac04032f495fa4a83fd4a296ca3 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Mon, 29 Jun 2020 00:27:45 -0500 Subject: [PATCH 0127/1293] tools/build_board_info.py: add built-in modules information for each board for use on circuitpython.org; uses 'docs/shared_bindings_matrix.py' --- tools/build_board_info.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 6c670930f4..20a5866b7f 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -9,6 +9,9 @@ import base64 from datetime import date from sh.contrib import git +sys.path.append("../docs") +import shared_bindings_matrix + sys.path.append("adabot") import adabot.github_requests as github @@ -246,6 +249,10 @@ def generate_download_info(): languages = get_languages() + support_matrix = shared_bindings_matrix.support_matrix_by_board( + use_branded_name=False + ) + new_stable = "-" not in new_tag previous_releases = set() @@ -283,6 +290,7 @@ def generate_download_info(): new_version = { "stable": new_stable, "version": new_tag, + "modules": support_matrix.get(alias, "[]"), "files": {} } for language in languages: From d911dc98d9a9acd76a337232933ee0776370a66c Mon Sep 17 00:00:00 2001 From: sommersoft Date: Mon, 29 Jun 2020 01:09:04 -0500 Subject: [PATCH 0128/1293] docs/shared_binding_matrix.py: fix usage with the branded name (building docs) --- docs/shared_bindings_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index c0d07d4b41..12a7b7eb86 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -162,7 +162,7 @@ def support_matrix_by_board(use_branded_name=True): settings = get_settings_from_makefile(str(port_dir), entry.name) if use_branded_name: - with open(os.path.join(entry.path, "mpconfigboard.h")) as get_name: + with open(entry / "mpconfigboard.h") as get_name: board_contents = get_name.read() board_name_re = re.search(r"(?<=MICROPY_HW_BOARD_NAME)\s+(.+)", board_contents) From 0dd17f441805ef584a31294060e4a9101cbe7f7d Mon Sep 17 00:00:00 2001 From: ansonhe97 Date: Mon, 29 Jun 2020 16:22:41 +0800 Subject: [PATCH 0129/1293] Add: Added Seeed Wio Terminal board support --- .github/workflows/build.yml | 1 + .../boards/seeeduino_wio_terminal/board.c | 39 ++++++++++++++ .../seeeduino_wio_terminal/mpconfigboard.h | 32 ++++++++++++ .../seeeduino_wio_terminal/mpconfigboard.mk | 14 +++++ .../boards/seeeduino_wio_terminal/pins.c | 52 +++++++++++++++++++ 5 files changed, 138 insertions(+) create mode 100644 ports/atmel-samd/boards/seeeduino_wio_terminal/board.c create mode 100644 ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd357e78ef..50b9cfeb4e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -240,6 +240,7 @@ jobs: - "sam32" - "same54_xplained" - "seeeduino_xiao" + - "seeeduino_wio_terminal" - "serpente" - "shirtty" - "simmel" diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c new file mode 100644 index 0000000000..0f60736a24 --- /dev/null +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c @@ -0,0 +1,39 @@ +/* + * 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 "boards/board.h" +#include "mpconfigboard.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h new file mode 100644 index 0000000000..5409d6ca91 --- /dev/null +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h @@ -0,0 +1,32 @@ +#define MICROPY_HW_BOARD_NAME "Seeeduino Wio Terminal" +#define MICROPY_HW_MCU_NAME "samd51p19" + +// Rev E + +#define MICROPY_HW_LED_STATUS (&pin_PA15) + +// These are pins not to reset. +// QSPI Data pins +#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11) +// QSPI CS, QSPI SCK and NeoPixel pin +#define MICROPY_PORT_B (PORT_PB03 | PORT_PB10 | PORT_PB11) +#define MICROPY_PORT_C (0) +#define MICROPY_PORT_D (0) + +#define EXTERNAL_FLASH_QSPI_DUAL + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA16) +#define DEFAULT_I2C_BUS_SDA (&pin_PA17) + +#define DEFAULT_SPI_BUS_SCK (&pin_PB03) +#define DEFAULT_SPI_BUS_MOSI (&pin_PB02) +#define DEFAULT_SPI_BUS_MISO (&pin_PB00) + +#define DEFAULT_UART_BUS_RX (&pin_PB27) +#define DEFAULT_UART_BUS_TX (&pin_PB26) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 \ No newline at end of file diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.mk b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.mk new file mode 100644 index 0000000000..ad6a0f356c --- /dev/null +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.mk @@ -0,0 +1,14 @@ +USB_VID = 0x2886 +USB_PID = 0x802d +USB_PRODUCT = "Seeeduino Wio Terminal" +USB_MANUFACTURER = "Seeed" + +CHIP_VARIANT = SAMD51P19A +CHIP_FAMILY = samd51 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = "W25Q32JV_IQ" +LONGINT_IMPL = MPZ + +CIRCUITPY_VECTORIO = 1 \ No newline at end of file diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c new file mode 100644 index 0000000000..deaffe80d4 --- /dev/null +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c @@ -0,0 +1,52 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + + // Analog pins + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA06) }, + + // Digital pins + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA17) }, // MP_QSTR_SDA + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA16) }, //MP_QSTR_SCL + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA15) }, // MP_QSTR_LED + + // UART pins + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB26) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB27) }, + + // SPI pins + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA00) }, + + // I2C pins + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA17) }, + + // LED pins + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA15) }, // status + + // Comm objects + { 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_global_dict_table); \ No newline at end of file From 4613f80d7a049acc61332da59341a900ae0208f7 Mon Sep 17 00:00:00 2001 From: ansonhe97 Date: Mon, 29 Jun 2020 17:41:48 +0800 Subject: [PATCH 0130/1293] Fix end of line --- ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h | 2 +- ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h index 5409d6ca91..f7d0448df9 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h @@ -29,4 +29,4 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 -#define IGNORE_PIN_PA25 1 \ No newline at end of file +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.mk b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.mk index ad6a0f356c..f57e016b4e 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.mk +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.mk @@ -11,4 +11,4 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "W25Q32JV_IQ" LONGINT_IMPL = MPZ -CIRCUITPY_VECTORIO = 1 \ No newline at end of file +CIRCUITPY_VECTORIO = 1 diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c index deaffe80d4..8c6260ce2c 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c @@ -49,4 +49,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From c84c30846cded89bfef889ae3bd92f9102fab816 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Mon, 29 Jun 2020 09:02:04 -0500 Subject: [PATCH 0131/1293] docs/shared_bindings_matrix.py: use '__file__' to ascertain root dir --- docs/shared_bindings_matrix.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index 12a7b7eb86..4abf5b8859 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -34,22 +34,10 @@ SUPPORTED_PORTS = ['atmel-samd', 'esp32s2', 'litex', 'mimxrt10xx', 'nrf', 'stm'] def get_circuitpython_root_dir(): """ The path to the root './circuitpython' directory """ - cwd = pathlib.Path('.').resolve() - cwd_parts = cwd.parts + file_path = pathlib.Path(__file__).resolve() + root_dir = file_path.parent.parent - root_idx = len(cwd_parts) - - # Search the path from tail to head, so that we capture the - # deepest folder. This avoids overshooting in instances like: - # '/home/user/circuitpython_v5/circuitpython' - for idx, val in enumerate(cwd_parts[::-1]): - if val.startswith("circuitpython"): - root_idx = root_idx - idx - break - - root_dir = '/'.join(cwd_parts[:root_idx]) - - return pathlib.Path(root_dir).resolve() + return root_dir def get_shared_bindings(): """ Get a list of modules in shared-bindings based on folder names From ceb2efcbc3b4b5e34fda51abed7bd1bfb4d5a6db Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 29 Jun 2020 16:34:37 -0700 Subject: [PATCH 0132/1293] Add new UnexpectedMaker FeatherS2 to CI. --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00454cc2da..80cbc9b748 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -371,6 +371,7 @@ jobs: board: - "espressif_saola_1_wroom" - "espressif_saola_1_wrover" + - "unexpectedmaker_feathers2" steps: - name: Set up Python 3.8 From fc0cb8fb293839e1ed22cc219ad8df995af02bd5 Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Sun, 28 Jun 2020 18:25:01 +0000 Subject: [PATCH 0133/1293] Translated using Weblate (Spanish) Currently translated at 89.0% (676 of 759 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 121 +++++++++++++++++++++++++++------------------------ 1 file changed, 65 insertions(+), 56 deletions(-) diff --git a/locale/es.po b/locale/es.po index 22597249bd..ebffaeb984 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-25 11:44-0500\n" -"PO-Revision-Date: 2020-06-24 18:32+0000\n" +"PO-Revision-Date: 2020-06-29 13:13+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" @@ -441,7 +441,7 @@ msgstr "Buffer demasiado grande e incapaz de asignar" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "" +msgstr "Búfer muy corto por %d bytes" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -592,7 +592,7 @@ msgstr "Código crudo corrupto" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" -msgstr "" +msgstr "No se pudo inicializar el GNSS" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" @@ -628,7 +628,7 @@ msgstr "No se pudo iniciar la interrupción, RX ocupado" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" -msgstr "" +msgstr "No se pudo encontrar el decodificador" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -637,7 +637,7 @@ msgstr "No se pudo asignar el primer buffer" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate input buffer" -msgstr "" +msgstr "No se pudo encontrar el búfer de entrada" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -702,7 +702,7 @@ msgstr "Modo Drive no se usa cuando la dirección es input." #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" -msgstr "" +msgstr "ECB solo opera sobre 16 bytes a la vez" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -1285,6 +1285,8 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" +"El pinout utiliza %d bytes por elemento, lo que consume más del ideal de %d " +"bytes. Si esto no se puede evitar, pase allow_inefficient=True al constructor" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" @@ -1321,7 +1323,7 @@ msgstr "PulseOut no es compatible con este chip" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" -msgstr "" +msgstr "Error de desinicializado del RNG" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" @@ -1329,7 +1331,7 @@ msgstr "Error de inicialización de RNG" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" -msgstr "" +msgstr "Se especifica inversión de RS485 sin estar en modo RS485" #: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c #: ports/nrf/common-hal/rtc/RTC.c @@ -1343,7 +1345,7 @@ msgstr "RTC no soportado en esta placa" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" +msgstr "Sin capacidad de RTS/CTS/RS485 para este dispositivo" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" @@ -1435,7 +1437,7 @@ msgstr "Rebanadas no soportadas" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "" +msgstr "Los búferes de fuente y destino deben ser del mismo tamaño" #: extmod/modure.c msgid "Splitting with sub-captures" @@ -1472,6 +1474,8 @@ msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode.\n" msgstr "" +"El módulo de `microcontroller` fue utilizado para bootear en modo seguro. " +"Presione reset para salir del modo seguro.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1479,6 +1483,11 @@ msgid "" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" +"La alimentación de la microntroladora bajó. Asegúrate que tu fuente de " +"poder\n" +"pueda suplir suficiente energía para todo el circuito y presione reset (" +"luego de\n" +"expulsar CIRCUITPY)\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1533,7 +1542,7 @@ msgstr "Muchos displays" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Total data to write is larger than outgoing_packet_length" -msgstr "" +msgstr "Los datos totales a escribir son más grandes que outgoing_packet_length" #: py/obj.c msgid "Traceback (most recent call last):\n" @@ -1545,7 +1554,7 @@ msgstr "Argumento tuple o struct_time requerido" #: ports/stm/common-hal/busio/UART.c msgid "UART Buffer allocation error" -msgstr "" +msgstr "No se pudo encontrar el búfer para UART" #: ports/stm/common-hal/busio/UART.c msgid "UART De-init error" @@ -1643,6 +1652,8 @@ msgid "" "Unspecified issue. Can be that the pairing prompt on the other device was " "declined or ignored." msgstr "" +"Problema no especificado. Puede ser que la señal de emparejamiento del otro " +"dispositivo fue declinada o ignorada." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/I2C.c @@ -1650,9 +1661,8 @@ msgid "Unsupported baudrate" msgstr "Baudrate no soportado" #: shared-module/displayio/display_core.c -#, fuzzy msgid "Unsupported display bus type" -msgstr "tipo de bitmap no soportado" +msgstr "Sin capacidad de bus tipo display" #: shared-module/audiocore/WaveFile.c msgid "Unsupported format" @@ -1669,12 +1679,12 @@ msgstr "valor pull no soportado." #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length != required fixed length" -msgstr "" +msgstr "Tamaño del valor != del tamaño fijo requerido" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length > max_length" -msgstr "" +msgstr "Tamaño de valor > max_length" #: py/emitnative.c msgid "Viper functions don't currently support more than 4 arguments" @@ -1682,7 +1692,7 @@ msgstr "funciones Viper actualmente no soportan más de 4 argumentos." #: ports/stm/common-hal/microcontroller/Processor.c msgid "Voltage read timed out" -msgstr "" +msgstr "Tiempo de espera agotado para lectura de voltaje" #: main.c msgid "WARNING: Your code filename has two extensions\n" @@ -1730,7 +1740,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "You are in safe mode: something unanticipated happened.\n" -msgstr "" +msgstr "Estás en modo seguro: algo inesperado ha sucedido.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -1772,7 +1782,7 @@ msgstr "addresses esta vacío" #: extmod/ulab/code/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" +msgstr "arctan2 se encuentra implementado solo para escalares y ndarrays" #: py/modbuiltins.c msgid "arg is an empty sequence" @@ -1780,7 +1790,7 @@ msgstr "argumento es una secuencia vacía" #: extmod/ulab/code/numerical.c msgid "argsort argument must be an ndarray" -msgstr "" +msgstr "El argumento para argsort debe ser un ndarray" #: py/runtime.c msgid "argument has wrong type" @@ -1797,7 +1807,7 @@ msgstr "argumento deberia ser un '%q' no un '%q'" #: extmod/ulab/code/linalg.c msgid "arguments must be ndarrays" -msgstr "" +msgstr "argumentos deben ser ndarrays" #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -1805,7 +1815,7 @@ msgstr "array/bytes requeridos en el lado derecho" #: extmod/ulab/code/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" -msgstr "" +msgstr "se trató de traer argmin/argmax de una secuencia vacía" #: py/objstr.c msgid "attributes not supported yet" @@ -1813,15 +1823,15 @@ msgstr "atributos aún no soportados" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, None, or 1" -msgstr "" +msgstr "eje debe ser -1, 0, None o 1" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, or 1" -msgstr "" +msgstr "eje debe ser -1, 0, o 1" #: extmod/ulab/code/numerical.c msgid "axis must be None, 0, or 1" -msgstr "" +msgstr "eje debe ser None, 0, o 1" #: py/builtinevex.c msgid "bad compile mode" @@ -1852,9 +1862,8 @@ msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample debe ser 8 ó 16" #: py/emitinlinethumb.c -#, fuzzy msgid "branch not in range" -msgstr "El argumento de chr() no esta en el rango(256)" +msgstr "la rama no está dentro del rango" #: shared-bindings/audiocore/RawSample.c msgid "buffer must be a bytes-like object" @@ -1883,7 +1892,7 @@ msgstr "codigo byte no implementado" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "byteorder is not a string" -msgstr "" +msgstr "byteorder no es una cadena" #: ports/atmel-samd/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" @@ -2065,7 +2074,7 @@ msgstr "no se puedo realizar importación relativa" #: extmod/ulab/code/ndarray.c msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" +msgstr "no se puede reformar el arreglo (forma de entrada/salida incompatible)" #: py/emitnative.c msgid "casting" @@ -2085,7 +2094,7 @@ msgstr "El argumento de chr() no esta en el rango(256)" #: shared-module/vectorio/Circle.c msgid "circle can only be registered in one parent" -msgstr "" +msgstr "circle solo puede ser registrado con un pariente" #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" @@ -2093,7 +2102,7 @@ msgstr "color buffer debe ser 3 bytes (RGB) ó 4 bytes (RGB + pad byte)" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a buffer, tuple, list, or int" -msgstr "" +msgstr "el búfer de color debe ser un búfer, una tupla, una lista o un entero" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a bytearray or array of type 'b' or 'B'" @@ -2149,11 +2158,11 @@ msgstr "" #: extmod/ulab/code/approx.c msgid "data must be iterable" -msgstr "" +msgstr "los datos deben permitir iteración" #: extmod/ulab/code/approx.c msgid "data must be of equal length" -msgstr "" +msgstr "los datos deben ser de igual tamaño" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" @@ -2291,19 +2300,19 @@ msgstr "sistema de archivos debe proporcionar método de montaje" #: extmod/ulab/code/vectorise.c msgid "first argument must be a callable" -msgstr "" +msgstr "se debe poder llamar al primer argumento" #: extmod/ulab/code/approx.c msgid "first argument must be a function" -msgstr "" +msgstr "el primer argumento debe ser una función" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" -msgstr "" +msgstr "el primer argumento debe permitir iteración" #: extmod/ulab/code/vectorise.c msgid "first argument must be an ndarray" -msgstr "" +msgstr "el primer argumento debe ser ndarray" #: py/objtype.c msgid "first argument to super() must be type" @@ -2319,7 +2328,7 @@ msgstr "" #: py/objint.c msgid "float too big" -msgstr "" +msgstr "punto flotante muy grande" #: shared-bindings/_stage/Text.c msgid "font must be 2048 bytes long" @@ -2352,7 +2361,7 @@ msgstr "" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" -msgstr "" +msgstr "la función está implementada solo para escalares y ndarrays" #: py/argcheck.c #, c-format @@ -2411,7 +2420,7 @@ msgstr "formato incompleto" #: py/objstr.c msgid "incomplete format key" -msgstr "" +msgstr "formato de llave incompleto" #: extmod/modubinascii.c msgid "incorrect padding" @@ -2419,7 +2428,7 @@ msgstr "relleno (padding) incorrecto" #: extmod/ulab/code/ndarray.c msgid "index is out of bounds" -msgstr "" +msgstr "el índice está fuera de límites" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -2434,11 +2443,11 @@ msgstr "indices deben ser enteros" #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" -msgstr "" +msgstr "los índices deben ser enteros, particiones o listas de booleanos" #: extmod/ulab/code/approx.c msgid "initial values must be iterable" -msgstr "" +msgstr "los valores iniciales deben permitir iteración" #: py/compile.c msgid "inline assembler must be a function" @@ -2446,35 +2455,35 @@ msgstr "ensamblador en línea debe ser una función" #: extmod/ulab/code/create.c msgid "input argument must be an integer or a 2-tuple" -msgstr "" +msgstr "el argumento de entrada debe ser un entero o una tupla de par" #: extmod/ulab/code/fft.c msgid "input array length must be power of 2" -msgstr "" +msgstr "el tamaño del arreglo de entrada debe ser potencia de 2" #: extmod/ulab/code/poly.c msgid "input data must be an iterable" -msgstr "" +msgstr "los datos de entrada deben permitir iteración" #: extmod/ulab/code/linalg.c msgid "input matrix is asymmetric" -msgstr "" +msgstr "la matriz de entrada es asimétrica" #: extmod/ulab/code/linalg.c msgid "input matrix is singular" -msgstr "" +msgstr "la matriz de entrada es singular" #: extmod/ulab/code/linalg.c msgid "input must be square matrix" -msgstr "" +msgstr "la entrada debe ser una matriz cuadrada" #: extmod/ulab/code/numerical.c msgid "input must be tuple, list, range, or ndarray" -msgstr "" +msgstr "la entrada debe ser una tupla, lista, rango o ndarray" #: extmod/ulab/code/poly.c msgid "input vectors must be of equal length" -msgstr "" +msgstr "los vectores de entrada deben ser de igual tamaño" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" @@ -2491,7 +2500,7 @@ msgstr "" #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" -msgstr "" +msgstr "el intervalo debe ser der rango %s-%s" #: lib/netutils/netutils.c msgid "invalid arguments" @@ -2523,7 +2532,7 @@ msgstr "decorador de micropython inválido" #: shared-bindings/random/__init__.c msgid "invalid step" -msgstr "" +msgstr "paso inválido" #: py/compile.c py/parse.c msgid "invalid syntax" @@ -2552,11 +2561,11 @@ msgstr "issubclass() arg 2 debe ser una clase o tuple de clases" #: extmod/ulab/code/ndarray.c msgid "iterables are not of the same length" -msgstr "" +msgstr "los iterables no son del mismo tamaño" #: extmod/ulab/code/linalg.c msgid "iterations did not converge" -msgstr "" +msgstr "las iteraciones no convergen" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" @@ -2587,7 +2596,7 @@ msgstr "argumento length no permitido para este tipo" #: shared-bindings/audiomixer/MixerVoice.c msgid "level must be between 0 and 1" -msgstr "" +msgstr "el nivel debe ser entre 0 y 1" #: py/objarray.c msgid "lhs and rhs should be compatible" From 4d9fcc6ed01d88de8747df3b47e2aab387903a99 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Mon, 29 Jun 2020 22:48:56 +0000 Subject: [PATCH 0134/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 56.9% (432 of 759 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 506 ++++++++++++++++++++++++++---------------------- 1 file changed, 279 insertions(+), 227 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 33d98d5bdb..6b921ffdfe 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-25 11:44-0500\n" -"PO-Revision-Date: 2020-06-26 16:42+0000\n" +"PO-Revision-Date: 2020-06-29 22:52+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -64,7 +64,7 @@ msgstr "%%c requer int ou char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "%d endereços dos pinos e %d pinos rgb indicam uma altura do %d, não %d" +msgstr "%d endereços dos pinos e %d pinos rgb indicam uma altura do %d, não %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -72,15 +72,15 @@ msgstr "%q em uso" #: py/obj.c msgid "%q index out of range" -msgstr "" +msgstr "O índice %q está fora do intervalo" #: py/obj.c msgid "%q indices must be integers, not %s" -msgstr "" +msgstr "Os índices %q devem ser inteiros, e não %s" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "" +msgstr "A lista %q deve ser uma lista" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -91,7 +91,7 @@ msgstr "%q deve ser >= 1" #: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "" +msgstr "%q deve ser uma tupla de comprimento 2" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" @@ -99,7 +99,7 @@ msgstr "%q deve ser um int" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" -msgstr "" +msgstr "%q() recebe %d argumentos posicionais, porém %d foram informados" #: py/argcheck.c msgid "'%q' argument required" @@ -108,98 +108,100 @@ msgstr "'%q' argumento(s) requerido(s)" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" -msgstr "" +msgstr "'%s' exige um rótulo" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a register" -msgstr "" +msgstr "'%s' exige um registro" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects a special register" -msgstr "" +msgstr "'%s' exige um registro especial" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects an FPU register" -msgstr "" +msgstr "'%s' exige um registro FPU" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects an address of the form [a, b]" -msgstr "" +msgstr "'%s' exige um endereço no formato [a, b]" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects an integer" -msgstr "" +msgstr "'%s' exige um número inteiro" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects at most r%d" -msgstr "" +msgstr "'%s' exige no máximo r%d" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects {r0, r1, ...}" -msgstr "" +msgstr "'%s' exige {r0, r1, ...}" #: py/emitinlinextensa.c #, c-format msgid "'%s' integer %d is not within range %d..%d" -msgstr "" +msgstr "O número inteiro '%s' %d não está dentro do intervalo %d..%d" #: py/emitinlinethumb.c #, c-format msgid "'%s' integer 0x%x does not fit in mask 0x%x" -msgstr "" +msgstr "O número inteiro '%s' 0x%x não cabe na máscara 0x%x" #: py/runtime.c msgid "'%s' object cannot assign attribute '%q'" -msgstr "" +msgstr "O objeto '%s' não pode definir o atributo '%q'" #: py/proto.c msgid "'%s' object does not support '%q'" -msgstr "" +msgstr "O objeto '%s' não é compatível com '%q'" #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" -msgstr "" +msgstr "O objeto '%s' não compatível com a atribuição dos itens" #: py/obj.c #, c-format msgid "'%s' object does not support item deletion" -msgstr "" +msgstr "O objeto '%s' não é compatível com exclusão do item" #: py/runtime.c msgid "'%s' object has no attribute '%q'" -msgstr "" +msgstr "O objeto '%s' não possui o atributo '%q'" #: py/runtime.c #, c-format msgid "'%s' object is not an iterator" -msgstr "" +msgstr "O objeto '%s' não é um iterador" #: py/objtype.c py/runtime.c #, c-format msgid "'%s' object is not callable" -msgstr "" +msgstr "O objeto '%s' não é invocável" #: py/runtime.c #, c-format msgid "'%s' object is not iterable" -msgstr "" +msgstr "O objeto '%s' não é iterável" #: py/obj.c #, c-format msgid "'%s' object is not subscriptable" -msgstr "" +msgstr "O objeto '%s' não é subroteirizável" #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "" +"'=' alinhamento não permitido no especificador do formato da cadeia de " +"caracteres" #: shared-module/struct/__init__.c msgid "'S' and 'O' are not supported format types" @@ -207,59 +209,59 @@ msgstr "'S' e 'O' não são tipos de formato suportados" #: py/compile.c msgid "'align' requires 1 argument" -msgstr "" +msgstr "O 'align' exige 1 argumento" #: py/compile.c msgid "'async for' or 'async with' outside async function" -msgstr "" +msgstr "'assíncrono para' ou 'assíncrono com' função assíncrona externa" #: py/compile.c msgid "'await' outside function" -msgstr "" +msgstr "'aguardar' fora da função" #: py/compile.c msgid "'break' outside loop" -msgstr "" +msgstr "'break' fora do loop" #: py/compile.c msgid "'continue' outside loop" -msgstr "" +msgstr "'continue' fora do loop" #: py/compile.c msgid "'data' requires at least 2 arguments" -msgstr "" +msgstr "'data' exige pelo menos 2 argumentos" #: py/compile.c msgid "'data' requires integer arguments" -msgstr "" +msgstr "'data' exige argumentos inteiros" #: py/compile.c msgid "'label' requires 1 argument" -msgstr "" +msgstr "'label' exige 1 argumento" #: py/compile.c msgid "'return' outside function" -msgstr "" +msgstr "função externa 'return'" #: py/compile.c msgid "'yield' outside function" -msgstr "" +msgstr "função externa 'yield'" #: py/compile.c msgid "*x must be assignment target" -msgstr "" +msgstr "*x deve ser o destino da atribuição" #: py/obj.c msgid ", in %q\n" -msgstr "" +msgstr ", em %q\n" #: py/objcomplex.c msgid "0.0 to a complex power" -msgstr "" +msgstr "0,0 para uma potência complexa" #: py/modbuiltins.c msgid "3-arg pow() not supported" -msgstr "" +msgstr "3-arg pow() não compatível" #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -273,7 +275,7 @@ msgstr "O endereço deve ter %d bytes de comprimento" #: shared-bindings/_bleio/Address.c msgid "Address type out of range" -msgstr "" +msgstr "O tipo do endereço está fora do alcance" #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" @@ -293,7 +295,7 @@ msgstr "Todos os canais de eventos em uso" #: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "All sync event channels in use" -msgstr "" +msgstr "Todos os canais dos eventos de sincronização em uso" #: shared-bindings/pulseio/PWMOut.c msgid "All timers for this pin are in use" @@ -313,11 +315,11 @@ msgstr "Todos os temporizadores em uso" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." -msgstr "" +msgstr "Já está anunciando." #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" -msgstr "" +msgstr "O AnalogIn não é compatível no pino informado" #: ports/cxd56/common-hal/analogio/AnalogOut.c #: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c @@ -327,7 +329,7 @@ msgstr "Funcionalidade AnalogOut não suportada" #: shared-bindings/analogio/AnalogOut.c msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "" +msgstr "O AnalogOut é de apenas 16 bits. O valor deve ser menor que 65536." #: ports/atmel-samd/common-hal/analogio/AnalogOut.c msgid "AnalogOut not supported on given pin" @@ -344,15 +346,17 @@ msgstr "Array deve conter meias palavras (tipo 'H')" #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." -msgstr "" +msgstr "Os valores da matriz devem ser bytes simples." #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" -msgstr "" +msgstr "Pelo menos %d %q pode ser definido (não %d)" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" +"A tentativa da área de alocação dinâmica de variáveis (heap) quando o " +"MicroPython VM não está em execução." #: main.c msgid "Auto-reload is off.\n" @@ -363,19 +367,23 @@ msgid "" "Auto-reload is on. Simply save files over USB to run them or enter REPL to " "disable.\n" msgstr "" +"O recarregamento automático está ativo. Simplesmente salve os arquivos via " +"USB para executá-los ou digite REPL para desativar.\n" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" -msgstr "" +msgstr "Abaixo da taxa mínima de quadros" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "" +"O clock de bits e a seleção de palavras devem compartilhar uma unidade de " +"clock" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." -msgstr "" +msgstr "A profundidade de bits deve ser o múltiplo de 8." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" @@ -389,7 +397,7 @@ msgstr "Ambos os pinos devem suportar interrupções de hardware" #: shared-bindings/framebufferio/FramebufferDisplay.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "" +msgstr "O brilho deve ser 0-1,0" #: shared-bindings/supervisor/__init__.c msgid "Brightness must be between 0 and 255" @@ -398,12 +406,12 @@ msgstr "O brilho deve estar entre 0 e 255" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" -msgstr "" +msgstr "Brilho não ajustável" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "" +msgstr "O buffer + desvio é muito pequeno %d %d %d" #: shared-module/usb_hid/Device.c #, c-format @@ -413,30 +421,30 @@ msgstr "Buffer de tamanho incorreto. Deve ser %d bytes." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "" +msgstr "O buffer não é um bytearray." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" -msgstr "" +msgstr "O buffer é muito pequeno" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "" +msgstr "O tamanho do buffer %d é muito grande. Deve ser menor que %d" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" -msgstr "" +msgstr "O comprimento do buffer deve ter pelo menos 1" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Buffer too large and unable to allocate" -msgstr "" +msgstr "O buffer é muito grande e incapaz de alocar" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "" +msgstr "O buffer é muito curto em %d bytes" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -454,15 +462,15 @@ msgstr "Os bytes devem estar entre 0 e 255." #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "Os blocos CBC devem ter múltiplos de 16 bytes" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "" +msgstr "Chame super().__init__() antes de acessar o objeto nativo." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" -msgstr "" +msgstr "Não é possível definir o CCCD com a característica local" #: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" @@ -472,7 +480,7 @@ msgstr "Não é possível excluir valores" #: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c #: ports/nrf/common-hal/digitalio/DigitalInOut.c msgid "Cannot get pull while in output mode" -msgstr "" +msgstr "Não é possível obter pull enquanto está modo de saída" #: ports/nrf/common-hal/microcontroller/Processor.c msgid "Cannot get temperature" @@ -481,10 +489,12 @@ msgstr "Não é possível obter a temperatura" #: shared-bindings/_bleio/Adapter.c msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" +"Não é possível ter respostas da verificação para os anúncios estendidos e " +"conectáveis." #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" -msgstr "" +msgstr "Não é possível emitir os dois canais no mesmo pino" #: shared-module/bitbangio/SPI.c msgid "Cannot read without MISO pin." @@ -503,18 +513,19 @@ msgstr "Não é possível remontar '/' enquanto o USB estiver ativo." #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c msgid "Cannot reset into bootloader because no bootloader is present." msgstr "" +"Não é possível redefinir para o bootloader porque o mesmo não está presente." #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." -msgstr "" +msgstr "Não é possível definir o valor quando a direção é inserida." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "" +msgstr "Não é possível definir o RTS ou CTS no modo RS485" #: py/objslice.c msgid "Cannot subclass slice" -msgstr "" +msgstr "Não é possível subclassificar a fatia" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins." @@ -522,11 +533,11 @@ msgstr "Não é possível transferir sem os pinos MOSI e MISO." #: extmod/moductypes.c msgid "Cannot unambiguously get sizeof scalar" -msgstr "" +msgstr "Não é possível obter inequivocamente o tamanho do escalar" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" +msgstr "Não é possível variar a frequência em um timer que já esteja em uso" #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." @@ -534,17 +545,20 @@ msgstr "Não é possível fazer a escrita sem um pino MOSI." #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" -msgstr "" +msgstr "Escrita CharacteristicBuffer não informada" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" -msgstr "" +msgstr "O núcleo principal do CircuitPython falhou feio. Ops!\n" #: supervisor/shared/safe_mode.c msgid "" "CircuitPython is in safe mode because you pressed the reset button during " "boot. Press again to exit safe mode.\n" msgstr "" +"O CircuitPython está no modo de segurança porque você pressionou o botão de " +"redefinição durante a inicialização. Pressione novamente para sair do modo " +"de segurança.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." @@ -560,7 +574,7 @@ msgstr "Unidade de Clock em uso" #: shared-bindings/_pew/PewPew.c msgid "Column entry must be digitalio.DigitalInOut" -msgstr "" +msgstr "A entrada da coluna deve ser digitalio.DigitalInOut" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c @@ -572,14 +586,15 @@ msgid "" "Connection has been disconnected and can no longer be used. Create a new " "connection." msgstr "" +"A conexão foi desconectada e não pode mais ser usada. Crie uma nova conexão." #: py/persistentcode.c msgid "Corrupt .mpy file" -msgstr "" +msgstr "Arquivo .mpy corrompido" #: py/emitglue.c msgid "Corrupt raw code" -msgstr "" +msgstr "Código bruto corrompido" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" @@ -591,35 +606,35 @@ msgstr "Não foi possível inicializar o UART" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize channel" -msgstr "" +msgstr "Não foi possível inicializar o canal" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize timer" -msgstr "" +msgstr "Não foi possível inicializar o temporizador" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init channel" -msgstr "" +msgstr "Não foi possível reiniciar o canal" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init timer" -msgstr "" +msgstr "Não foi possível reiniciar o temporizador" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not restart PWM" -msgstr "" +msgstr "Não foi possível reiniciar o PWM" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" -msgstr "" +msgstr "Não foi possível iniciar o PWM" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" -msgstr "" +msgstr "Não foi possível iniciar a interrupção, RX ocupado" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" -msgstr "" +msgstr "Não foi possível alocar o decodificador" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -628,7 +643,7 @@ msgstr "Não pôde alocar primeiro buffer" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate input buffer" -msgstr "" +msgstr "Não foi possível alocar o buffer de entrada" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -637,15 +652,15 @@ msgstr "Não pôde alocar segundo buffer" #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." -msgstr "" +msgstr "Falha no HardFault_Handler." #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" -msgstr "" +msgstr "Erro de Inicialização do Canal DAC" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" -msgstr "" +msgstr "Erro de Inicialização do Dispositivo DAC" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -654,7 +669,7 @@ msgstr "DAC em uso" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c msgid "Data 0 pin must be byte aligned" -msgstr "" +msgstr "O pino de dados 0 deve ser alinhado por bytes" #: shared-module/audiocore/WaveFile.c msgid "Data chunk must follow fmt chunk" @@ -666,34 +681,34 @@ msgstr "Os dados são grandes demais para o pacote de publicidade" #: shared-bindings/audiobusio/PDMIn.c msgid "Destination capacity is smaller than destination_length." -msgstr "" +msgstr "A capacidade do destino é menor que destination_length." #: ports/nrf/common-hal/audiobusio/I2SOut.c msgid "Device in use" -msgstr "" +msgstr "Dispositivo em uso" #: ports/cxd56/common-hal/digitalio/DigitalInOut.c msgid "DigitalInOut not supported on given pin" -msgstr "" +msgstr "O DigitalInOut não é compatível em um determinado pino" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." -msgstr "" +msgstr "O monitor deve ter um espaço de cores com 16 bits." #: 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 "A rotação da tela deve estar em incrementos de 90 graus" #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." -msgstr "" +msgstr "O modo do controlador não é usado quando a direção for inserida." #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" -msgstr "" +msgstr "O BCE opera apenas com 16 bytes por vez" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -719,7 +734,7 @@ msgstr "Uma característica é necessária" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" -msgstr "" +msgstr "Esperava um Serviço" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c @@ -728,20 +743,20 @@ msgstr "Um UUID é necessário" #: shared-bindings/_bleio/Adapter.c msgid "Expected an Address" -msgstr "" +msgstr "Um endereço esperado" #: shared-module/_pixelbuf/PixelBuf.c #, c-format msgid "Expected tuple of length %d, got %d" -msgstr "" +msgstr "Tupla esperada com comprimento %d, obteve %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." -msgstr "" +msgstr "Anúncios estendidos não compatíveis com a resposta da varredura." #: extmod/ulab/code/fft.c msgid "FFT is defined for ndarrays only" -msgstr "" +msgstr "O FFT é definido apenas para ndarrays" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." @@ -767,15 +782,15 @@ msgstr "Falha ao alocar buffer RX de %d bytes" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" -msgstr "" +msgstr "Falha ao conectar: erro interno" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: timeout" -msgstr "" +msgstr "Falha ao conectar: tempo limite" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" -msgstr "" +msgstr "Falha ao analisar o arquivo MP3" #: ports/nrf/sd_mutex.c #, c-format @@ -784,7 +799,7 @@ msgstr "Houve uma falha ao liberar o mutex, err 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "" +msgstr "Falha ao gravar o flash interno." #: py/moduerrno.c msgid "File exists" @@ -793,21 +808,23 @@ msgstr "Arquivo já existe" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" +"A frequência capturada está acima da capacidade. A captura está em pausa." #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" +"A frequência deve coincidir com o PWMOut existente usando este temporizador" #: 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 "A função requer bloqueio" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" -msgstr "" +msgstr "O grupo já está em uso" #: shared-module/displayio/Group.c msgid "Group full" @@ -816,11 +833,11 @@ msgstr "Grupo cheio" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" -msgstr "" +msgstr "O hardware está ocupado, tente os pinos alternativos" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" -msgstr "" +msgstr "O hardware está em uso, tente os pinos alternativos" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -828,43 +845,45 @@ msgstr "Operação I/O no arquivo fechado" #: ports/stm/common-hal/busio/I2C.c msgid "I2C Init Error" -msgstr "" +msgstr "Erro de inicialização do I2C" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "" +msgstr "O IV deve ter %d bytes de comprimento" #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" +"Arquivo .mpy incompatível. Atualize todos os arquivos .mpy. Consulte " +"http://adafru.it/mpy-update para mais informações." #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" -msgstr "" +msgstr "O tamanho do buffer está incorreto" #: py/moduerrno.c msgid "Input/output error" -msgstr "" +msgstr "Erro de entrada/saída" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" -msgstr "" +msgstr "Autenticação insuficiente" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" -msgstr "" +msgstr "Criptografia insuficiente" #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" -msgstr "" +msgstr "Erro interno de definição" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format msgid "Internal error #%d" -msgstr "" +msgstr "Erro interno #%d" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -873,7 +892,7 @@ msgstr "Pino do %q inválido" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" -msgstr "" +msgstr "Valor inválido da unidade ADC" #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" @@ -881,11 +900,11 @@ msgstr "Arquivo BMP inválido" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" -msgstr "" +msgstr "O pino DAC informado é inválido" #: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" -msgstr "" +msgstr "A seleção dos pinos I2C é inválido" #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c @@ -895,11 +914,11 @@ msgstr "Frequência PWM inválida" #: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" -msgstr "" +msgstr "A seleção do pino SPI é inválido" #: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" -msgstr "" +msgstr "A seleção dos pinos UART é inválido" #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" @@ -907,7 +926,7 @@ msgstr "Argumento inválido" #: shared-module/displayio/Bitmap.c msgid "Invalid bits per value" -msgstr "" +msgstr "Os valores por bits são inválidos" #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" @@ -915,11 +934,11 @@ msgstr "O tamanho do buffer é inválido" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Invalid byteorder string" -msgstr "" +msgstr "A cadeia de bytes é inválida" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" +msgstr "O período de captura é inválido. O intervalo válido é: 1 - 500" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid channel count" @@ -939,11 +958,11 @@ msgstr "Tamanho do pedaço de formato inválido" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid frequency supplied" -msgstr "" +msgstr "A frequência informada é inválida" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "" +msgstr "O acesso da memória é inválido." #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid number of bits" @@ -981,28 +1000,28 @@ msgstr "Pinos inválidos" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid pins for PWMOut" -msgstr "" +msgstr "Os pinos para o PWMOut são inválidos" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" -msgstr "" +msgstr "Polaridade inválida" #: shared-bindings/_bleio/Characteristic.c msgid "Invalid properties" -msgstr "" +msgstr "Propriedades inválidas" #: shared-bindings/microcontroller/__init__.c msgid "Invalid run mode." -msgstr "" +msgstr "O modo de execução é inválido." #: shared-module/_bleio/Attribute.c msgid "Invalid security_mode" -msgstr "" +msgstr "O Security_mode é inválido" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice" -msgstr "" +msgstr "A voz é inválida" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice count" @@ -1014,23 +1033,23 @@ msgstr "Aqruivo de ondas inválido" #: ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" -msgstr "" +msgstr "O comprimento do bit/palavra são inválidos" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" -msgstr "" +msgstr "A chave deve ter 16, 24 ou 32 bytes de comprimento" #: py/compile.c msgid "LHS of keyword arg must be an id" -msgstr "" +msgstr "O LHS da palavra-chave arg deve ser um ID" #: shared-module/displayio/Group.c msgid "Layer already in a group." -msgstr "" +msgstr "A camada já existe em um grupo." #: shared-module/displayio/Group.c msgid "Layer must be a Group or TileGrid subclass." -msgstr "" +msgstr "A camada deve ser uma subclasse Group ou TileGrid." #: py/objslice.c msgid "Length must be an int" @@ -1038,7 +1057,7 @@ msgstr "Tamanho deve ser um int" #: py/objslice.c msgid "Length must be non-negative" -msgstr "" +msgstr "O comprimento deve ser positivo" #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." @@ -1051,44 +1070,44 @@ msgstr "Inicialização do pino MOSI falhou." #: shared-module/displayio/Shape.c #, c-format msgid "Maximum x value when mirrored is %d" -msgstr "" +msgstr "O valor máximo de x quando espelhado é %d" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." -msgstr "" +msgstr "O salto do MicroPython NLR falhou. Possível corrupção de memória." #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error." -msgstr "" +msgstr "Houve um erro fatal do MicroPython." #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" -msgstr "" +msgstr "O atraso na inicialização do microfone deve estar entre 0,0 e 1,0" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" -msgstr "" +msgstr "O pino MISO ou MOSI está ausente" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." -msgstr "" +msgstr "Deve ser uma subclasse %q." #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" -msgstr "" +msgstr "Deve informar os pinos MISO ou MOSI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" -msgstr "" +msgstr "Deve utilizar um múltiplo de 6 pinos rgb, não %d" #: py/parse.c msgid "Name too long" -msgstr "" +msgstr "Nome muito longo" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" -msgstr "" +msgstr "Não há nenhum CCCD para esta característica" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c @@ -1102,11 +1121,11 @@ msgstr "Nenhum canal DMA encontrado" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" -msgstr "" +msgstr "Nenhum pino MISO" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" -msgstr "" +msgstr "Nenhum pino MOSI" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1122,11 +1141,11 @@ msgstr "Nenhum pino TX" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "No available clocks" -msgstr "" +msgstr "Nenhum clock disponível" #: shared-bindings/_bleio/PacketBuffer.c msgid "No connection: length cannot be determined" -msgstr "" +msgstr "Sem conexão: o comprimento não pode ser determinado" #: shared-bindings/board/__init__.c msgid "No default %q bus" @@ -1138,7 +1157,7 @@ msgstr "Não há GCLKs livre" #: shared-bindings/os/__init__.c msgid "No hardware random available" -msgstr "" +msgstr "Nenhum hardware aleatório está disponível" #: ports/atmel-samd/common-hal/ps2io/Ps2.c msgid "No hardware support on clk pin" @@ -1151,35 +1170,35 @@ msgstr "Nenhum suporte de hardware no pino" #: shared-bindings/aesio/aes.c msgid "No key was specified" -msgstr "" +msgstr "Nenhuma chave foi definida" #: shared-bindings/time/__init__.c msgid "No long integer support" -msgstr "" +msgstr "Não há compatibilidade com inteiro longo" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." -msgstr "" +msgstr "Não há mais temporizadores disponíveis neste pino." #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" -msgstr "" +msgstr "Não há pulldown no pino; É recomendável utilizar um resistor de 1M ohm" #: py/moduerrno.c msgid "No space left on device" -msgstr "" +msgstr "Não resta espaço no dispositivo" #: py/moduerrno.c msgid "No such file/directory" -msgstr "" +msgstr "Este arquivo/diretório não existe" #: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" -msgstr "" +msgstr "Não há um temporizador disponível" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." -msgstr "" +msgstr "Declaração de falha do dispositivo Nordic Soft." #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -1189,7 +1208,7 @@ msgstr "Não Conectado" #: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c #: shared-bindings/audiopwmio/PWMAudioOut.c msgid "Not playing" -msgstr "" +msgstr "Não está jogando" #: shared-bindings/util.c msgid "" @@ -1203,13 +1222,15 @@ msgstr "A paridade ímpar não é compatível" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " -msgstr "" +msgstr "Apenas mono com 8 ou 16 bits com " #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" "Only Windows format, uncompressed BMP supported: given header size is %d" msgstr "" +"O BMP descompactado é compatível apenas no formato Windows: o tamanho do " +"cabeçalho é %d" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1217,25 +1238,31 @@ msgid "" "Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " "%d bpp given" msgstr "" +"São compatíveis apenas os BMPs monocromáticos, indexados em 4bpp ou 8bpp e " +"16bpp ou superior: determinado %d bpp" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." -msgstr "" +msgstr "A superamostragem deve ser um múltiplo de 8." #: shared-bindings/pulseio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "" +"O duty_cycle do PWM deve estar entre 0 e inclusive 65535 (com resolução de " +"16 bits)" #: shared-bindings/pulseio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +"A frequência do PWM não pode ser gravada quando variable_frequency for False " +"na construção." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" -msgstr "" +msgstr "O ParallelBus ainda não é compatível" #: py/moduerrno.c msgid "Permission denied" @@ -1255,11 +1282,11 @@ msgstr "" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" -msgstr "" +msgstr "O pino deve ser compatível com as interrupções do hardware" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" -msgstr "" +msgstr "Número do PIN já está reservado através da EXTI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1268,6 +1295,9 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" +"A pinagem utiliza %d bytes por elemento, que consome mais do que %d bytes do " +"ideal. Caso isso não possa ser evitado, passe allow_inefficient=True ao " +"construtor" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" @@ -1284,34 +1314,37 @@ msgstr "Buffer Ps2 vazio" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" +"O buffer do prefixo deve estar na área de alocação dinâmica de variáveis " +"(heap)" #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" +"Pressione qualquer tecla para entrar no REPL. Use CTRL-D para recarregar." #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." -msgstr "" +msgstr "O Pull não foi usado quando a direção for gerada." #: ports/stm/common-hal/pulseio/PulseIn.c msgid "PulseIn not supported on this chip" -msgstr "" +msgstr "O PulseIn não é compatível neste CI" #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" -msgstr "" +msgstr "O PulseOut não é compatível neste CI" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" -msgstr "" +msgstr "Erro DeInit RNG" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" -msgstr "" +msgstr "Houve um erro na inicialização do RNG" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" -msgstr "" +msgstr "A definição da inversão do RS485 quando não está no modo RS485" #: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c #: ports/nrf/common-hal/rtc/RTC.c @@ -1325,11 +1358,11 @@ msgstr "O RTC não é suportado nesta placa" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" +msgstr "RTS/CTS/RS485 Ainda não é compatível neste dispositivo" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" -msgstr "" +msgstr "Houve um erro na geração do número aleatório" #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" @@ -1345,11 +1378,11 @@ msgstr "Objeto de leitura apenas" #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" -msgstr "" +msgstr "A recarga foi cedo demais" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" -msgstr "" +msgstr "O modo AES solicitado não é compatível" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" @@ -1357,7 +1390,7 @@ msgstr "Canal direito não suportado" #: shared-bindings/_pew/PewPew.c msgid "Row entry must be digitalio.DigitalInOut" -msgstr "" +msgstr "A entrada da linha deve ser digitalio.DigitalInOut" #: main.c msgid "Running in safe mode! Auto-reload is off.\n" @@ -1374,15 +1407,15 @@ msgstr "SDA ou SCL precisa de um pull up" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" -msgstr "" +msgstr "Houve um erro na inicialização SPI" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Re-initialization error" -msgstr "" +msgstr "Houve um erro na reinicialização SPI" #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" -msgstr "" +msgstr "A taxa de amostragem deve ser positiva" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #, c-format @@ -1391,15 +1424,15 @@ msgstr "Taxa de amostragem muito alta. Deve ser menor que %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." -msgstr "" +msgstr "O escaneamento já está em andamento. Interrompa com stop_scan." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" -msgstr "" +msgstr "O pino CTS selecionado é inválido" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected RTS pin not valid" -msgstr "" +msgstr "O pino RTS selecionado é inválido" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1408,20 +1441,20 @@ msgstr "Serializer em uso" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." -msgstr "" +msgstr "Fatie e avalie os diferentes comprimentos." #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" -msgstr "" +msgstr "Fatiamento não compatível" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "" +msgstr "Os buffers da origem e do destino devem ter o mesmo comprimento" #: extmod/modure.c msgid "Splitting with sub-captures" -msgstr "" +msgstr "Divisão com sub-capturas" #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" @@ -1429,11 +1462,11 @@ msgstr "O tamanho da pilha deve ser pelo menos 256" #: shared-bindings/multiterminal/__init__.c msgid "Stream missing readinto() or write() method." -msgstr "" +msgstr "Transmita o método ausente readinto() ou write()." #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" -msgstr "" +msgstr "Forneça pelo menos um pino UART" #: shared-bindings/gnss/GNSS.c msgid "System entry must be gnss.SatelliteSystem" @@ -1441,19 +1474,24 @@ msgstr "" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" -msgstr "" +msgstr "A leitura da temperatura expirou" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Please increase the stack size if you know how, or if not:" msgstr "" +"A área de alocação dinâmica de variáveis (heap) do CircuitPython foi " +"corrompida porque a pilha de funções (stack) era muito pequena.\n" +"Aumente o tamanho da pilha de funções caso saiba como, ou caso não saiba:" #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode.\n" msgstr "" +"O módulo `microcontrolador` foi utilizado para inicializar no modo de " +"segurança. Pressione reset para encerrar do modo de segurança.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1461,38 +1499,42 @@ msgid "" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" +"A força do microcontrolador caiu. Verifique se a fonte de alimentação " +"fornece\n" +"energia suficiente para todo o circuito e pressione reset (após a ejeção " +"CIRCUITPY).\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" -msgstr "" +msgstr "A amostragem bits_per_sample não coincide com a do mixer" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's channel count does not match the mixer's" -msgstr "" +msgstr "A contagem da amostragem dos canais não coincide com o a do mixer" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's sample rate does not match the mixer's" -msgstr "" +msgstr "A taxa de amostragem da amostra não coincide com a do mixer" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's signedness does not match the mixer's" -msgstr "" +msgstr "A amostragem \"signedness\" não coincide com a do mixer" #: shared-bindings/displayio/TileGrid.c msgid "Tile height must exactly divide bitmap height" -msgstr "" +msgstr "A altura do bloco deve dividir exatamente com a altura do bitmap" #: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c msgid "Tile index out of bounds" -msgstr "" +msgstr "O índice do bloco está fora dos limites" #: shared-bindings/displayio/TileGrid.c msgid "Tile value out of bounds" -msgstr "" +msgstr "O valor do bloco está fora dos limites" #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" -msgstr "" +msgstr "A largura do bloco deve dividir exatamente com a largura do bitmap" #: ports/nrf/common-hal/_bleio/Adapter.c #, c-format @@ -1505,43 +1547,43 @@ msgstr "Muitos canais na amostra." #: shared-module/displayio/__init__.c msgid "Too many display busses" -msgstr "" +msgstr "Muitos barramentos estão sendo exibidos" #: shared-module/displayio/__init__.c msgid "Too many displays" -msgstr "" +msgstr "Exibições demais" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Total data to write is larger than outgoing_packet_length" -msgstr "" +msgstr "O total dos dados que serão gravados é maior que outgoing_packet_length" #: py/obj.c msgid "Traceback (most recent call last):\n" -msgstr "" +msgstr "Traceback (a última chamada mais recente):\n" #: shared-bindings/time/__init__.c msgid "Tuple or struct_time argument required" -msgstr "" +msgstr "O argumento de tupla ou struct_time é necessário" #: ports/stm/common-hal/busio/UART.c msgid "UART Buffer allocation error" -msgstr "" +msgstr "Houve um erro na alocação do Buffer UART" #: ports/stm/common-hal/busio/UART.c msgid "UART De-init error" -msgstr "" +msgstr "Houve um erro da não inicialização do UART" #: ports/stm/common-hal/busio/UART.c msgid "UART Init Error" -msgstr "" +msgstr "Houve um erro na inicialização do UART" #: ports/stm/common-hal/busio/UART.c msgid "UART Re-init error" -msgstr "" +msgstr "Houve um erro na reinicialização do UART" #: ports/stm/common-hal/busio/UART.c msgid "UART write error" -msgstr "" +msgstr "Houve um erro na gravação UART" #: shared-module/usb_hid/Device.c msgid "USB Busy" @@ -1553,15 +1595,15 @@ msgstr "Erro na USB" #: shared-bindings/_bleio/UUID.c msgid "UUID integer value must be 0-0xffff" -msgstr "" +msgstr "O valor inteiro UUID deve ser 0-0xffff" #: shared-bindings/_bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" -msgstr "" +msgstr "A cadeia de caracteres UUID não 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" #: shared-bindings/_bleio/UUID.c msgid "UUID value is not str, int or byte buffer" -msgstr "" +msgstr "O valor UUID não é um buffer str, int ou byte" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -1571,7 +1613,7 @@ msgstr "Não é possível alocar buffers para conversão assinada" #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" -msgstr "" +msgstr "Não foi possível encontrar a tela I2C no %x" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1580,11 +1622,11 @@ msgstr "Não é possível encontrar GCLK livre" #: py/parse.c msgid "Unable to init parser" -msgstr "" +msgstr "Não foi possível iniciar o analisador" #: shared-module/displayio/OnDiskBitmap.c msgid "Unable to read color palette data" -msgstr "" +msgstr "Não foi possível ler os dados da paleta de cores" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." @@ -1592,37 +1634,39 @@ msgstr "Não é possível gravar no nvm." #: ports/nrf/common-hal/_bleio/UUID.c msgid "Unexpected nrfx uuid type" -msgstr "" +msgstr "Tipo uuid nrfx inesperado" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" -msgstr "" +msgstr "Erro gatt desconhecido: 0x%04x" #: supervisor/shared/safe_mode.c msgid "Unknown reason." -msgstr "" +msgstr "Motivo desconhecido." #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" -msgstr "" +msgstr "Erro de segurança desconhecido: 0x%04x" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown soft device error: %04x" -msgstr "" +msgstr "Erro desconhecido do dispositivo de soft: %04x" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." -msgstr "" +msgstr "Quantidade inigualável de itens no RHS (%d esperado, obteve %d)." #: ports/nrf/common-hal/_bleio/__init__.c msgid "" "Unspecified issue. Can be that the pairing prompt on the other device was " "declined or ignored." msgstr "" +"Problema desconhecido. Pode ser que o prompt de emparelhamento no outro " +"dispositivo tenha sido recusado ou ignorado." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/I2C.c @@ -1639,29 +1683,29 @@ msgstr "Formato não suportado" #: py/moduerrno.c msgid "Unsupported operation" -msgstr "" +msgstr "Operação não suportada" #: shared-bindings/digitalio/DigitalInOut.c msgid "Unsupported pull value." -msgstr "" +msgstr "O valor pull não é compatível." #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length != required fixed length" -msgstr "" +msgstr "Comprimento do valor != comprimento fixo necessário" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length > max_length" -msgstr "" +msgstr "O comprimento do valor é > max_length" #: py/emitnative.c msgid "Viper functions don't currently support more than 4 arguments" -msgstr "" +msgstr "Atualmente, as funções do Viper não suportam mais de 4 argumentos" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Voltage read timed out" -msgstr "" +msgstr "O tempo limite de leitura da tensão expirou" #: main.c msgid "WARNING: Your code filename has two extensions\n" @@ -1696,6 +1740,12 @@ msgid "" "\n" "To list built-in modules please do `help(\"modules\")`.\n" msgstr "" +"Bem-vindo ao Adafruit CircuitPython% s!\n" +"\n" +"Visite learn.adafruit.com/category/circuitpython para obter guias de projeto." +"\n" +"\n" +"Para listar os módulos internos, faça `help (\" modules \")`.\n" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" @@ -2166,7 +2216,7 @@ msgstr "vazio" #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" -msgstr "heap vazia" +msgstr "a área de alocação dinâmica de variáveis (heap) está vazia" #: py/objstr.c msgid "empty separator" @@ -2360,7 +2410,7 @@ msgstr "" #: extmod/moduheapq.c msgid "heap must be a list" -msgstr "heap deve ser uma lista" +msgstr "a área de alocação dinâmica de variáveis (heap) deve ser uma lista" #: py/compile.c msgid "identifier redefined as global" @@ -2609,6 +2659,8 @@ msgstr "" #: py/runtime.c msgid "memory allocation failed, heap is locked" msgstr "" +"falha na alocação de memória, a área de alocação dinâmica de variáveis (heap)" +" está bloqueada" #: py/builtinimport.c msgid "module not found" From 3f764d99eefb02cb2f19cf366ffe3f5831d6a675 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Mon, 29 Jun 2020 23:49:52 +0000 Subject: [PATCH 0135/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 69.3% (526 of 759 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 195 +++++++++++++++++++++++++----------------------- 1 file changed, 102 insertions(+), 93 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 6b921ffdfe..6ade65a33f 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-25 11:44-0500\n" -"PO-Revision-Date: 2020-06-29 22:52+0000\n" +"PO-Revision-Date: 2020-06-29 23:50+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -1740,20 +1740,20 @@ msgid "" "\n" "To list built-in modules please do `help(\"modules\")`.\n" msgstr "" -"Bem-vindo ao Adafruit CircuitPython% s!\n" +"Bem-vindo ao Adafruit CircuitPython %s!\n" "\n" -"Visite learn.adafruit.com/category/circuitpython para obter guias de projeto." +"Para obter guias de projeto, visite learn.adafruit.com/category/" +"circuitpython.\n" "\n" -"\n" -"Para listar os módulos internos, faça `help (\" modules \")`.\n" +"Para listar os módulos internos, faça `help(\"modules\")`.\n" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" -msgstr "" +msgstr "A escrita não é compatível na Característica" #: supervisor/shared/safe_mode.c msgid "You are in safe mode: something unanticipated happened.\n" -msgstr "" +msgstr "Você está no modo de segurança: algo inesperado aconteceu.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -1761,20 +1761,20 @@ msgstr "Você solicitou o início do modo de segurança através do " #: py/objtype.c msgid "__init__() should return None" -msgstr "" +msgstr "O __init__() deve retornar Nenhum" #: py/objtype.c #, c-format msgid "__init__() should return None, not '%s'" -msgstr "" +msgstr "O __init__() deve retornar Nenhum, não '%s'" #: py/objobject.c msgid "__new__ arg must be a user-type" -msgstr "" +msgstr "O argumento __new__ deve ser um tipo usuário" #: extmod/modubinascii.c extmod/moduhashlib.c msgid "a bytes-like object is required" -msgstr "" +msgstr "é necessário objetos tipo bytes" #: lib/embed/abort_.c msgid "abort() called" @@ -1787,23 +1787,23 @@ msgstr "endereço %08x não está alinhado com %d bytes" #: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" -msgstr "" +msgstr "endereço fora dos limites" #: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" -msgstr "" +msgstr "os endereços estão vazios" #: extmod/ulab/code/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" +msgstr "O arctan2 está implementado apenas para escalares e ndarrays" #: py/modbuiltins.c msgid "arg is an empty sequence" -msgstr "" +msgstr "o arg é uma sequência vazia" #: extmod/ulab/code/numerical.c msgid "argsort argument must be an ndarray" -msgstr "" +msgstr "O argumento argsort deve ser um ndarray" #: py/runtime.c msgid "argument has wrong type" @@ -1812,23 +1812,23 @@ msgstr "argumento tem tipo errado" #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" -msgstr "" +msgstr "o argumento num/tipos não combinam" #: py/runtime.c msgid "argument should be a '%q' not a '%q'" -msgstr "" +msgstr "o argumento deve ser um '%q' e não um '%q'" #: extmod/ulab/code/linalg.c msgid "arguments must be ndarrays" -msgstr "" +msgstr "os argumentos devem ser ndarrays" #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" -msgstr "" +msgstr "matriz/bytes são necessários no lado direito" #: extmod/ulab/code/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" -msgstr "" +msgstr "tente obter argmin/argmax de uma sequência vazia" #: py/objstr.c msgid "attributes not supported yet" @@ -1836,39 +1836,39 @@ msgstr "atributos ainda não suportados" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, None, or 1" -msgstr "" +msgstr "o eixo deve ser -1, 0, Nenhum ou 1" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, or 1" -msgstr "" +msgstr "o eixo deve ser -1, 0 ou 1" #: extmod/ulab/code/numerical.c msgid "axis must be None, 0, or 1" -msgstr "" +msgstr "o eixo deve ser Nenhum, 0 ou 1" #: py/builtinevex.c msgid "bad compile mode" -msgstr "" +msgstr "modo de compilação ruim" #: py/objstr.c msgid "bad conversion specifier" -msgstr "" +msgstr "especificador de conversão incorreto" #: py/objstr.c msgid "bad format string" -msgstr "" +msgstr "formato da string incorreta" #: py/binary.c msgid "bad typecode" -msgstr "" +msgstr "typecode incorreto" #: py/emitnative.c msgid "binary op %q not implemented" -msgstr "" +msgstr "a operação binário %q não foi implementada" #: shared-bindings/busio/UART.c msgid "bits must be 7, 8 or 9" -msgstr "" +msgstr "os bits devem ser 7, 8 ou 9" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" @@ -1880,7 +1880,7 @@ msgstr "ramo fora do alcance" #: shared-bindings/audiocore/RawSample.c msgid "buffer must be a bytes-like object" -msgstr "" +msgstr "o buffer deve ser um objeto como bytes" #: shared-module/struct/__init__.c msgid "buffer size must match format" @@ -1888,24 +1888,24 @@ msgstr "o tamanho do buffer deve coincidir com o formato" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "buffer slices must be of equal length" -msgstr "" +msgstr "as fatias do buffer devem ter o mesmo comprimento" #: py/modstruct.c shared-bindings/struct/__init__.c #: shared-module/struct/__init__.c msgid "buffer too small" -msgstr "" +msgstr "o buffer é muito pequeno" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" -msgstr "" +msgstr "os botões devem ser digitalio.DigitalInOut" #: py/vm.c msgid "byte code not implemented" -msgstr "" +msgstr "o código dos bytes ainda não foi implementado" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "byteorder is not a string" -msgstr "" +msgstr "a ordem dos bytes não é uma cadeia de caracteres" #: ports/atmel-samd/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" @@ -1913,7 +1913,7 @@ msgstr "bytes > 8 bits não suportado" #: py/objstr.c msgid "bytes value out of range" -msgstr "" +msgstr "o valor dos bytes estão fora do alcance" #: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" @@ -1929,144 +1929,148 @@ msgstr "Valor de calibração fora do intervalo +/- 127" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" -msgstr "" +msgstr "só pode haver até 4 parâmetros para a montagem Thumb" #: py/emitinlinextensa.c msgid "can only have up to 4 parameters to Xtensa assembly" -msgstr "" +msgstr "só pode haver até 4 parâmetros para a montagem Xtensa" #: py/persistentcode.c msgid "can only save bytecode" -msgstr "" +msgstr "apenas o bytecode pode ser salvo" #: py/objtype.c msgid "can't add special method to already-subclassed class" -msgstr "" +msgstr "não é possível adicionar o método especial à classe já subclassificada" #: py/compile.c msgid "can't assign to expression" -msgstr "" +msgstr "a expressão não pode ser atribuída" #: py/obj.c #, c-format msgid "can't convert %s to complex" -msgstr "" +msgstr "Não é possível converter %s para complex" #: py/obj.c #, c-format msgid "can't convert %s to float" -msgstr "" +msgstr "Não é possível converter %s para float" #: py/obj.c #, c-format msgid "can't convert %s to int" -msgstr "" +msgstr "Não é possível converter %s para int" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" -msgstr "" +msgstr "não é possível converter implicitamente o objeto '%q' para %q" #: py/objint.c msgid "can't convert NaN to int" -msgstr "" +msgstr "Não é possível converter NaN para int" #: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" -msgstr "" +msgstr "não é possível converter o endereço para int" #: py/objint.c msgid "can't convert inf to int" -msgstr "" +msgstr "não é possível converter inf para int" #: py/obj.c msgid "can't convert to complex" -msgstr "" +msgstr "não é possível converter para complex" #: py/obj.c msgid "can't convert to float" -msgstr "" +msgstr "não é possível converter para float" #: py/obj.c msgid "can't convert to int" -msgstr "" +msgstr "não é possível converter para int" #: py/objstr.c msgid "can't convert to str implicitly" -msgstr "" +msgstr "não é possível converter implicitamente para str" #: py/compile.c msgid "can't declare nonlocal in outer code" -msgstr "" +msgstr "não é possível declarar nonlocal no código externo" #: py/compile.c msgid "can't delete expression" -msgstr "" +msgstr "não é possível excluir a expressão" #: py/emitnative.c msgid "can't do binary op between '%q' and '%q'" -msgstr "" +msgstr "não é possível executar uma operação binária entre '%q' e '%q'" #: py/objcomplex.c msgid "can't do truncated division of a complex number" -msgstr "" +msgstr "não é possível fazer a divisão truncada de um número complexo" #: py/compile.c msgid "can't have multiple **x" -msgstr "" +msgstr "não pode haver vários **x" #: py/compile.c msgid "can't have multiple *x" -msgstr "" +msgstr "não pode haver vários *x" #: py/emitnative.c msgid "can't implicitly convert '%q' to 'bool'" -msgstr "" +msgstr "não é possível converter implicitamente '%q' em 'bool'" #: py/emitnative.c msgid "can't load from '%q'" -msgstr "" +msgstr "não é possível carregar a partir de '%q'" #: py/emitnative.c msgid "can't load with '%q' index" -msgstr "" +msgstr "não é possível carregar com o índice '%q'" #: py/objgenerator.c msgid "can't pend throw to just-started generator" -msgstr "" +msgstr "não pode pendurar o lançamento para o gerador recém-iniciado" #: py/objgenerator.c msgid "can't send non-None value to a just-started generator" msgstr "" +"Não é possível enviar algo que não seja um valor para um gerador recém-" +"iniciado" #: py/objnamedtuple.c msgid "can't set attribute" -msgstr "" +msgstr "não é possível definir o atributo" #: py/emitnative.c msgid "can't store '%q'" -msgstr "" +msgstr "não é possível armazenar '%q'" #: py/emitnative.c msgid "can't store to '%q'" -msgstr "" +msgstr "não é possível armazenar em '%q'" #: py/emitnative.c msgid "can't store with '%q' index" -msgstr "" +msgstr "não é possível armazenar com o índice '%q'" #: py/objstr.c msgid "" "can't switch from automatic field numbering to manual field specification" msgstr "" +"não é possível alternar entre a numeração automática dos campos para a manual" #: py/objstr.c msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" +"não é possível alternar da especificação de campo manual para a automática" #: py/objtype.c msgid "cannot create '%q' instances" -msgstr "" +msgstr "não é possível criar instâncias '%q'" #: py/objtype.c msgid "cannot create instance" @@ -2078,43 +2082,46 @@ msgstr "não pode importar nome %q" #: py/builtinimport.c msgid "cannot perform relative import" -msgstr "" +msgstr "não pode executar a importação relativa" #: extmod/ulab/code/ndarray.c msgid "cannot reshape array (incompatible input/output shape)" msgstr "" +"não é possível remodelar a matriz (formato de entrada/saída incompatível)" #: py/emitnative.c msgid "casting" -msgstr "" +msgstr "fundição" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" -msgstr "" +msgstr "o buffer dos caracteres é muito pequeno" #: py/modbuiltins.c msgid "chr() arg not in range(0x110000)" -msgstr "" +msgstr "o arg chr() está fora do intervalo(0x110000)" #: py/modbuiltins.c msgid "chr() arg not in range(256)" -msgstr "" +msgstr "o arg chr() está fora do intervalo(256)" #: shared-module/vectorio/Circle.c msgid "circle can only be registered in one parent" -msgstr "" +msgstr "o círculo só pode ser registrado em um pai" #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" -msgstr "" +msgstr "o buffer das cores deve ter 3 bytes (RGB) ou 4 bytes (RGB + pad byte)" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a buffer, tuple, list, or int" -msgstr "" +msgstr "O buffer das cores deve ser um buffer, tupla, lista ou int" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a bytearray or array of type 'b' or 'B'" msgstr "" +"O buffer das cores deve ser uma matriz de bytes ou uma matriz do tipo 'b' ou " +"'B'" #: shared-bindings/displayio/Palette.c msgid "color must be between 0x000000 and 0xffffff" @@ -2126,15 +2133,15 @@ msgstr "cor deve ser um int" #: py/objcomplex.c msgid "complex division by zero" -msgstr "" +msgstr "divisão complexa por zero" #: py/objfloat.c py/parsenum.c msgid "complex values not supported" -msgstr "" +msgstr "os valores complexos não compatíveis" #: extmod/moduzlib.c msgid "compression header" -msgstr "" +msgstr "compressão do cabeçalho" #: py/parse.c msgid "constant must be an integer" @@ -2142,27 +2149,27 @@ msgstr "constante deve ser um inteiro" #: py/emitnative.c msgid "conversion to object" -msgstr "" +msgstr "conversão para o objeto" #: extmod/ulab/code/filter.c msgid "convolve arguments must be linear arrays" -msgstr "" +msgstr "os argumentos convolutivos devem ser matrizes lineares" #: extmod/ulab/code/filter.c msgid "convolve arguments must be ndarrays" -msgstr "" +msgstr "os argumentos convolutivos devem ser ndarrays" #: extmod/ulab/code/filter.c msgid "convolve arguments must not be empty" -msgstr "" +msgstr "os argumentos convolutivos não devem estar vazios" #: extmod/ulab/code/ndarray.c msgid "could not broadast input array from shape" -msgstr "" +msgstr "não foi possível transmitir a matriz da entrada a partir da forma" #: extmod/ulab/code/poly.c msgid "could not invert Vandermonde matrix" -msgstr "" +msgstr "não foi possível inverter a matriz Vandermonde" #: extmod/ulab/code/approx.c msgid "data must be iterable" @@ -2174,24 +2181,26 @@ msgstr "" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" -msgstr "" +msgstr "O ddof deve ser menor que o comprimento do conjunto dos dados" #: py/parsenum.c msgid "decimal numbers not supported" -msgstr "" +msgstr "os números decimais não são compatíveis" #: py/compile.c msgid "default 'except' must be last" -msgstr "" +msgstr "a predefinição 'exceto' deve ser o último" #: shared-bindings/audiobusio/PDMIn.c msgid "" "destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" msgstr "" +"o buffer do destino deve ser um bytearray ou matriz do tipo 'B' para " +"bit_depth = 8" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" -msgstr "" +msgstr "o buffer do destino deve ser uma matriz do tipo 'H' para bit_depth = 16" #: shared-bindings/audiobusio/PDMIn.c msgid "destination_length must be an int >= 0" @@ -2199,11 +2208,11 @@ msgstr "destination_length deve ser um int >= 0" #: py/objdict.c msgid "dict update sequence has wrong length" -msgstr "" +msgstr "sequência da atualização dict tem o comprimento errado" #: extmod/ulab/code/numerical.c msgid "diff argument must be an ndarray" -msgstr "" +msgstr "O argumento diff deve ser um ndarray" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c @@ -2220,7 +2229,7 @@ msgstr "a área de alocação dinâmica de variáveis (heap) está vazia" #: py/objstr.c msgid "empty separator" -msgstr "" +msgstr "separador vazio" #: shared-bindings/random/__init__.c msgid "empty sequence" @@ -2228,7 +2237,7 @@ msgstr "seqüência vazia" #: py/objstr.c msgid "end of format while looking for conversion specifier" -msgstr "" +msgstr "final de formato enquanto procura pelo especificador de conversão" #: shared-bindings/displayio/Shape.c msgid "end_x should be an int" From c1e7a254a3b6aceb66637a5b71efb47c0b928275 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 30 Jun 2020 01:50:07 +0200 Subject: [PATCH 0136/1293] 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 | 51 +++++++++++++++++++++++++++++-- locale/cs.po | 51 +++++++++++++++++++++++++++++-- locale/de_DE.po | 51 +++++++++++++++++++++++++++++-- locale/es.po | 58 +++++++++++++++++++++++++++++++---- locale/fil.po | 51 +++++++++++++++++++++++++++++-- locale/fr.po | 51 +++++++++++++++++++++++++++++-- locale/it_IT.po | 51 +++++++++++++++++++++++++++++-- locale/ko.po | 51 +++++++++++++++++++++++++++++-- locale/nl.po | 51 +++++++++++++++++++++++++++++-- locale/pl.po | 51 +++++++++++++++++++++++++++++-- locale/pt_BR.po | 65 ++++++++++++++++++++++++++++++++++------ locale/sv.po | 51 +++++++++++++++++++++++++++++-- locale/zh_Latn_pinyin.po | 51 +++++++++++++++++++++++++++++-- 13 files changed, 636 insertions(+), 48 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index ae057fbd7a..8d89115d7a 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -58,6 +58,10 @@ msgstr "" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "" @@ -86,6 +90,10 @@ msgstr "buffers harus mempunyai panjang yang sama" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "" @@ -340,7 +348,7 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -421,6 +429,10 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "" @@ -709,7 +721,8 @@ msgstr "Channel EXTINT sedang digunakan" msgid "Error in regex" msgstr "Error pada regex" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -869,6 +882,10 @@ msgstr "" msgid "Internal error #%d" msgstr "" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1374,6 +1391,10 @@ msgid "Running in safe mode! Not running saved code.\n" msgstr "" "Berjalan di mode aman(safe mode)! tidak menjalankan kode yang tersimpan.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -2003,6 +2024,10 @@ msgstr "" msgid "can't send non-None value to a just-started generator" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "" @@ -2129,6 +2154,10 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2686,6 +2715,10 @@ msgstr "" msgid "negative shift count" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "" @@ -2707,6 +2740,10 @@ msgstr "tidak ada modul yang bernama '%q'" msgid "no reset pin available" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "" @@ -3099,6 +3136,14 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "bits harus memilki nilai 8" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index b23144fc8c..3869cd45ab 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -66,6 +66,10 @@ msgstr "%% c vyžaduje int nebo char" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "%d adresní piny a %d rgb piny označují výšku %d, nikoli %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q se nyní používá" @@ -93,6 +97,10 @@ msgstr "% q musí být > = 1" msgid "%q must be a tuple of length 2" msgstr "% q musí být n-tice délky 2" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "% q by měl být int" @@ -346,7 +354,7 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -425,6 +433,10 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "" @@ -706,7 +718,8 @@ msgstr "" msgid "Error in regex" msgstr "" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -866,6 +879,10 @@ msgstr "" msgid "Internal error #%d" msgstr "" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1366,6 +1383,10 @@ msgstr "" msgid "Running in safe mode! Not running saved code.\n" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -1987,6 +2008,10 @@ msgstr "" msgid "can't send non-None value to a just-started generator" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "" @@ -2113,6 +2138,10 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2670,6 +2699,10 @@ msgstr "" msgid "negative shift count" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "" @@ -2691,6 +2724,10 @@ msgstr "" msgid "no reset pin available" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "" @@ -3081,6 +3118,14 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index eff611b20d..567a2f8ba2 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -65,6 +65,10 @@ msgstr "%%c erwartet int oder char" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "%d Adress-Pins und %d rgb-Pins zeigen eine Höhe von %d, nicht von %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q in Benutzung" @@ -92,6 +96,10 @@ msgstr "%q muss >= 1 sein" msgid "%q must be a tuple of length 2" msgstr "%q muss ein Tupel der Länge 2 sein" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q sollte ein integer sein" @@ -345,7 +353,7 @@ msgstr "Array muss Halbwörter enthalten (type 'H')" msgid "Array values should be single bytes." msgstr "Array-Werte sollten aus Einzelbytes bestehen." -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: 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)" @@ -428,6 +436,10 @@ msgstr "Der Puffer ist zu klein" msgid "Buffer length %d too big. It must be less than %d" msgstr "Die Pufferlänge %d ist zu groß. Sie muss kleiner als %d sein" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Der Puffer muss eine Mindestenslänge von 1 haben" @@ -716,7 +728,8 @@ msgstr "EXTINT Kanal ist schon in Benutzung" msgid "Error in regex" msgstr "Fehler in regex" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -883,6 +896,10 @@ msgstr "Interner Definitionsfehler" msgid "Internal error #%d" msgstr "Interner Fehler #%d" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1396,6 +1413,10 @@ msgstr "Sicherheitsmodus aktiv! Automatisches Neuladen ist deaktiviert.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Sicherheitsmodus aktiv! Gespeicherter Code wird nicht ausgeführt\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -2048,6 +2069,10 @@ msgstr "" "Nicht \"None\" Werte können nicht an einen gerade gestarteten Generator " "gesendet werden" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "kann Attribut nicht setzen" @@ -2181,6 +2206,10 @@ msgstr "Eingabearray konnte nicht aus der Form übertragen werden" msgid "could not invert Vandermonde matrix" msgstr "Vandermonde-Matrix konnte nicht invertiert werden" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2747,6 +2776,10 @@ msgstr "negative Potenz ohne Gleitkomma (float) Unterstützung" msgid "negative shift count" msgstr "Negative shift Anzahl" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "Keine aktive Ausnahme zu verusachen (raise)" @@ -2768,6 +2801,10 @@ msgstr "Kein Modul mit dem Namen '%q'" msgid "no reset pin available" msgstr "kein Reset Pin verfügbar" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "kein solches Attribut" @@ -3165,6 +3202,14 @@ msgstr "Das Zeitlimit muss 0,0-100,0 Sekunden betragen" msgid "timeout must be >= 0.0" msgstr "timeout muss >= 0.0 sein" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "Zeitstempel außerhalb des Bereichs für Plattform time_t" diff --git a/locale/es.po b/locale/es.po index ebffaeb984..aad07ddf4f 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2020-06-29 13:13+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -67,6 +67,10 @@ msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" "%d pines de dirección y %d pines rgb indican una altura de %d, no de %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q está siendo utilizado" @@ -94,6 +98,10 @@ msgstr "%q debe ser >= 1" msgid "%q must be a tuple of length 2" msgstr "%q debe ser una tupla de longitud 2" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q debe ser un int" @@ -349,7 +357,7 @@ msgstr "Array debe contener media palabra (type 'H')" msgid "Array values should be single bytes." msgstr "Valores del array deben ser bytes individuales." -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: 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)" @@ -430,6 +438,10 @@ msgstr "El buffer es muy pequeño" msgid "Buffer length %d too big. It must be less than %d" msgstr "La longitud del buffer %d es muy grande. Debe ser menor a %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Buffer debe ser de longitud 1 como minimo" @@ -715,7 +727,8 @@ msgstr "El canal EXTINT ya está siendo utilizado" msgid "Error in regex" msgstr "Error en regex" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -878,6 +891,10 @@ msgstr "" msgid "Internal error #%d" msgstr "Error interno #%d" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1387,6 +1404,10 @@ msgstr "Ejecutando en modo seguro! La auto-recarga esta deshabilitada.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Ejecutando en modo seguro! No se esta ejecutando el código guardado.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -1485,8 +1506,8 @@ msgid "" msgstr "" "La alimentación de la microntroladora bajó. Asegúrate que tu fuente de " "poder\n" -"pueda suplir suficiente energía para todo el circuito y presione reset (" -"luego de\n" +"pueda suplir suficiente energía para todo el circuito y presione reset " +"(luego de\n" "expulsar CIRCUITPY)\n" #: shared-module/audiomixer/MixerVoice.c @@ -1542,7 +1563,8 @@ msgstr "Muchos displays" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Total data to write is larger than outgoing_packet_length" -msgstr "Los datos totales a escribir son más grandes que outgoing_packet_length" +msgstr "" +"Los datos totales a escribir son más grandes que outgoing_packet_length" #: py/obj.c msgid "Traceback (most recent call last):\n" @@ -2026,6 +2048,10 @@ msgid "can't send non-None value to a just-started generator" msgstr "" "no se puede enviar un valor que no sea None a un generador recién iniciado" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "no se puede asignar el atributo" @@ -2156,6 +2182,10 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "los datos deben permitir iteración" @@ -2718,6 +2748,10 @@ msgstr "potencia negativa sin float support" msgid "negative shift count" msgstr "cuenta de corrimientos negativo" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "exception no activa para reraise" @@ -2739,6 +2773,10 @@ msgstr "ningún módulo se llama '%q'" msgid "no reset pin available" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "no hay tal atributo" @@ -3136,6 +3174,14 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "tiempo muerto debe ser >= 0.0" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp fuera de rango para plataform time_t" diff --git a/locale/fil.po b/locale/fil.po index e4c5678d27..4f155ecc58 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -58,6 +58,10 @@ msgstr "%%c nangangailangan ng int o char" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q ay ginagamit" @@ -86,6 +90,10 @@ msgstr "aarehas na haba dapat ang buffer slices" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c #, fuzzy msgid "%q should be an int" @@ -342,7 +350,7 @@ msgstr "May halfwords (type 'H') dapat ang array" msgid "Array values should be single bytes." msgstr "Array values ay dapat single bytes." -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -423,6 +431,10 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Buffer dapat ay hindi baba sa 1 na haba" @@ -710,7 +722,8 @@ msgstr "Ginagamit na ang EXTINT channel" msgid "Error in regex" msgstr "May pagkakamali sa REGEX" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -874,6 +887,10 @@ msgstr "" msgid "Internal error #%d" msgstr "" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1381,6 +1398,10 @@ msgstr "Tumatakbo sa safe mode! Awtomatikong pag re-reload ay OFF.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Tumatakbo sa safe mode! Hindi tumatakbo ang nai-save na code.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -2015,6 +2036,10 @@ msgstr "hindi mapadala ang send throw sa isang kaka umpisang generator" msgid "can't send non-None value to a just-started generator" msgstr "hindi mapadala ang non-None value sa isang kaka umpisang generator" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "hindi ma i-set ang attribute" @@ -2145,6 +2170,10 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2712,6 +2741,10 @@ msgstr "negatibong power na walang float support" msgid "negative shift count" msgstr "negative shift count" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "walang aktibong exception para i-reraise" @@ -2733,6 +2766,10 @@ msgstr "walang module na '%q'" msgid "no reset pin available" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "walang ganoon na attribute" @@ -3129,6 +3166,14 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "bits ay dapat walo (8)" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "wala sa sakop ng timestamp ang platform time_t" diff --git a/locale/fr.po b/locale/fr.po index 5a49fd5f91..392b779894 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" "Language: fr\n" @@ -69,6 +69,10 @@ msgstr "" "Les broches d'adresse %d et les broches RVB %d indiquent une hauteur de %d, " "pas %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q utilisé" @@ -96,6 +100,10 @@ msgstr "%q doit être >=1" msgid "%q must be a tuple of length 2" msgstr "%q doit être un tuple de longueur 2" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q doit être un entier (int)" @@ -350,7 +358,7 @@ msgstr "Le tableau doit contenir des demi-mots (type 'H')" msgid "Array values should be single bytes." msgstr "Les valeurs du tableau doivent être des octets simples 'bytes'." -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: 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)" @@ -433,6 +441,10 @@ msgstr "Le tampon est trop petit" msgid "Buffer length %d too big. It must be less than %d" msgstr "La longueur du tampon %d est trop grande. Il doit être inférieur à %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Le tampon doit être de longueur au moins 1" @@ -723,7 +735,8 @@ msgstr "Canal EXTINT déjà utilisé" msgid "Error in regex" msgstr "Erreur dans l'expression régulière" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -887,6 +900,10 @@ msgstr "Erreur de définition interne" msgid "Internal error #%d" msgstr "Erreur interne #%d" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1400,6 +1417,10 @@ msgstr "Mode sans-échec ! Auto-chargement désactivé.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Mode sans-échec ! Le code sauvegardé n'est pas éxecuté.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -2052,6 +2073,10 @@ msgstr "" "on ne peut envoyer une valeur autre que 'None' à un générateur fraîchement " "démarré" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "attribut non modifiable" @@ -2185,6 +2210,10 @@ msgstr "n'a pas pu diffuser le tableau d'entrée à partir de la forme" msgid "could not invert Vandermonde matrix" msgstr "n'a pas pu inverser la matrice Vandermonde" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "les données doivent être les objets iterables" @@ -2752,6 +2781,10 @@ msgstr "puissance négative sans support des nombres à virgule flottante" msgid "negative shift count" msgstr "compte de décalage négatif" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "aucune exception active à relever" @@ -2773,6 +2806,10 @@ msgstr "pas de module '%q'" msgid "no reset pin available" msgstr "pas de broche de réinitialisation disponible" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "pas de tel attribut" @@ -3171,6 +3208,14 @@ msgstr "le délai doit être compris entre 0.0 et 100.0 secondes" msgid "timeout must be >= 0.0" msgstr "'timeout' doit être >= 0.0" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "'timestamp' hors bornes pour 'time_t' de la plateforme" diff --git a/locale/it_IT.po b/locale/it_IT.po index c47d0e8e3e..13651437b7 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -58,6 +58,10 @@ msgstr "%%c necessita di int o char" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q in uso" @@ -86,6 +90,10 @@ msgstr "slice del buffer devono essere della stessa lunghezza" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c #, fuzzy msgid "%q should be an int" @@ -341,7 +349,7 @@ msgstr "Array deve avere mezzoparole (typo 'H')" msgid "Array values should be single bytes." msgstr "Valori di Array dovrebbero essere bytes singulari" -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -423,6 +431,10 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Il buffer deve essere lungo almeno 1" @@ -710,7 +722,8 @@ msgstr "Canale EXTINT già in uso" msgid "Error in regex" msgstr "Errore nella regex" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -874,6 +887,10 @@ msgstr "" msgid "Internal error #%d" msgstr "" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1390,6 +1407,10 @@ msgstr "Modalità sicura in esecuzione! Auto-reload disattivato.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Modalità sicura in esecuzione! Codice salvato non in esecuzione.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -2019,6 +2040,10 @@ msgstr "" msgid "can't send non-None value to a just-started generator" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "impossibile impostare attributo" @@ -2147,6 +2172,10 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2714,6 +2743,10 @@ msgstr "potenza negativa senza supporto per float" msgid "negative shift count" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "nessuna eccezione attiva da rilanciare" @@ -2736,6 +2769,10 @@ msgstr "nessun modulo chiamato '%q'" msgid "no reset pin available" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "attributo inesistente" @@ -3136,6 +3173,14 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "i bit devono essere 8" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp è fuori intervallo per il time_t della piattaforma" diff --git a/locale/ko.po b/locale/ko.po index 156f40d9b6..73926d47bd 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -60,6 +60,10 @@ msgstr "%%c 전수(int)또는 캐릭터(char)필요합니다" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q 사용 중입니다" @@ -87,6 +91,10 @@ msgstr "%q 는 >=1이어야합니다" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q 는 정수(int) 여야합니다" @@ -340,7 +348,7 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -421,6 +429,10 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "잘못된 크기의 버퍼. >1 여야합니다" @@ -702,7 +714,8 @@ msgstr "" msgid "Error in regex" msgstr "Regex에 오류가 있습니다." -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -862,6 +875,10 @@ msgstr "" msgid "Internal error #%d" msgstr "" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1362,6 +1379,10 @@ msgstr "" msgid "Running in safe mode! Not running saved code.\n" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -1984,6 +2005,10 @@ msgstr "" msgid "can't send non-None value to a just-started generator" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "" @@ -2110,6 +2135,10 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2667,6 +2696,10 @@ msgstr "" msgid "negative shift count" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "" @@ -2688,6 +2721,10 @@ msgstr "" msgid "no reset pin available" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "" @@ -3078,6 +3115,14 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 77cc11cab3..b9fd85e163 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2020-06-02 19:50+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -66,6 +66,10 @@ msgstr "%%c vereist een int of char" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "%d adres pins en %d RGB pins geven een hoogte van %d aan, niet %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q in gebruik" @@ -93,6 +97,10 @@ msgstr "%q moet >= 1 zijn" msgid "%q must be a tuple of length 2" msgstr "%q moet een tuple van lengte 2 zijn" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q moet een int zijn" @@ -346,7 +354,7 @@ msgstr "Array moet halfwords (type 'H') bevatten" msgid "Array values should be single bytes." msgstr "Array waardes moet enkele bytes zijn." -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: 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)" @@ -427,6 +435,10 @@ msgstr "Buffer is te klein" msgid "Buffer length %d too big. It must be less than %d" msgstr "Buffer lengte %d te groot. Het moet kleiner zijn dan %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Buffer moet op zijn minst lengte 1 zijn" @@ -714,7 +726,8 @@ msgstr "EXTINT kanaal al in gebruik" msgid "Error in regex" msgstr "Fout in regex" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -878,6 +891,10 @@ msgstr "Interne define fout" msgid "Internal error #%d" msgstr "Interne fout #%d" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1392,6 +1409,10 @@ msgstr "Draaiende in veilige modus! Auto-herlaad is uit.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Draaiende in veilige modus! Opgeslagen code wordt niet uitgevoerd.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -2033,6 +2054,10 @@ msgstr "kan throw niet aan net gestartte generator toevoegen" msgid "can't send non-None value to a just-started generator" msgstr "kan geen niet-'None' waarde naar een net gestartte generator sturen" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "kan attribute niet instellen" @@ -2160,6 +2185,10 @@ msgstr "kon de invoerarray niet vanuit vorm uitzenden" msgid "could not invert Vandermonde matrix" msgstr "kon de Vandermonde matrix niet omkeren" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "data moet itereerbaar zijn" @@ -2723,6 +2752,10 @@ msgstr "negatieve macht terwijl er geen ondersteuning is voor float" msgid "negative shift count" msgstr "negatieve verschuivingstelling (shift count)" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "geen actieve uitzondering om opnieuw op te werpen (raise)" @@ -2744,6 +2777,10 @@ msgstr "geen module met naam '%q'" msgid "no reset pin available" msgstr "geen reset pin beschikbaar" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "niet zo'n attribuut" @@ -3137,6 +3174,14 @@ msgstr "timeout moet tussen 0.0 en 100.0 seconden zijn" msgid "timeout must be >= 0.0" msgstr "timeout moet groter dan 0.0 zijn" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp buiten bereik voor platform time_t" diff --git a/locale/pl.po b/locale/pl.po index 888ce64285..1f2e9a61bc 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -59,6 +59,10 @@ msgstr "%%c wymaga int lub char" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q w użyciu" @@ -86,6 +90,10 @@ msgstr "%q musi być >= 1" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q powinno być typu int" @@ -339,7 +347,7 @@ msgstr "Tablica musi zawierać pół-słowa (typ 'H')" msgid "Array values should be single bytes." msgstr "Wartości powinny być bajtami." -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -420,6 +428,10 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Bufor musi mieć długość 1 lub więcej" @@ -701,7 +713,8 @@ msgstr "Kanał EXTINT w użyciu" msgid "Error in regex" msgstr "Błąd w regex" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -863,6 +876,10 @@ msgstr "" msgid "Internal error #%d" msgstr "" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1363,6 +1380,10 @@ msgstr "Uruchomiony tryb bezpieczeństwa! Samo-przeładowanie wyłączone.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Uruchomiony tryb bezpieczeństwa! Zapisany kod nie jest uruchamiany.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -1987,6 +2008,10 @@ msgstr "nie można skoczyć do świeżo stworzonego generatora" msgid "can't send non-None value to a just-started generator" msgstr "świeżo stworzony generator może tylko przyjąć None" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "nie można ustawić atrybutu" @@ -2113,6 +2138,10 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2671,6 +2700,10 @@ msgstr "ujemna potęga, ale brak obsługi liczb zmiennoprzecinkowych" msgid "negative shift count" msgstr "ujemne przesunięcie" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "brak wyjątku do ponownego rzucenia" @@ -2692,6 +2725,10 @@ msgstr "brak modułu o nazwie '%q'" msgid "no reset pin available" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "nie ma takiego atrybutu" @@ -3084,6 +3121,14 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "timeout musi być >= 0.0" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp poza zakresem dla time_t na tej platformie" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 6ade65a33f..30d77864b3 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2020-06-29 23:50+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -66,6 +66,10 @@ msgstr "%%c requer int ou char" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "%d endereços dos pinos e %d pinos rgb indicam uma altura do %d, não %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q em uso" @@ -93,6 +97,10 @@ msgstr "%q deve ser >= 1" msgid "%q must be a tuple of length 2" msgstr "%q deve ser uma tupla de comprimento 2" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q deve ser um int" @@ -348,7 +356,7 @@ msgstr "Array deve conter meias palavras (tipo 'H')" msgid "Array values should be single bytes." msgstr "Os valores da matriz devem ser bytes simples." -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: 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)" @@ -433,6 +441,10 @@ msgstr "O buffer é muito pequeno" msgid "Buffer length %d too big. It must be less than %d" msgstr "O tamanho do buffer %d é muito grande. Deve ser menor que %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "O comprimento do buffer deve ter pelo menos 1" @@ -721,7 +733,8 @@ msgstr "Canal EXTINT em uso" msgid "Error in regex" msgstr "Erro no regex" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -857,8 +870,8 @@ msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" -"Arquivo .mpy incompatível. Atualize todos os arquivos .mpy. Consulte " -"http://adafru.it/mpy-update para mais informações." +"Arquivo .mpy incompatível. Atualize todos os arquivos .mpy. Consulte http://" +"adafru.it/mpy-update para mais informações." #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" @@ -885,6 +898,10 @@ msgstr "Erro interno de definição" msgid "Internal error #%d" msgstr "Erro interno #%d" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1400,6 +1417,10 @@ msgstr "Rodando em modo seguro! Atualização automática está desligada.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Rodando em modo seguro! Não está executando o código salvo.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -1555,7 +1576,8 @@ msgstr "Exibições demais" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Total data to write is larger than outgoing_packet_length" -msgstr "O total dos dados que serão gravados é maior que outgoing_packet_length" +msgstr "" +"O total dos dados que serão gravados é maior que outgoing_packet_length" #: py/obj.c msgid "Traceback (most recent call last):\n" @@ -2040,6 +2062,10 @@ msgstr "" "Não é possível enviar algo que não seja um valor para um gerador recém-" "iniciado" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "não é possível definir o atributo" @@ -2171,6 +2197,10 @@ msgstr "não foi possível transmitir a matriz da entrada a partir da forma" msgid "could not invert Vandermonde matrix" msgstr "não foi possível inverter a matriz Vandermonde" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2200,7 +2230,8 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" -msgstr "o buffer do destino deve ser uma matriz do tipo 'H' para bit_depth = 16" +msgstr "" +"o buffer do destino deve ser uma matriz do tipo 'H' para bit_depth = 16" #: shared-bindings/audiobusio/PDMIn.c msgid "destination_length must be an int >= 0" @@ -2668,8 +2699,8 @@ msgstr "" #: py/runtime.c msgid "memory allocation failed, heap is locked" msgstr "" -"falha na alocação de memória, a área de alocação dinâmica de variáveis (heap)" -" está bloqueada" +"falha na alocação de memória, a área de alocação dinâmica de variáveis " +"(heap) está bloqueada" #: py/builtinimport.c msgid "module not found" @@ -2732,6 +2763,10 @@ msgstr "" msgid "negative shift count" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "" @@ -2753,6 +2788,10 @@ msgstr "" msgid "no reset pin available" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "" @@ -3143,6 +3182,14 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "o tempo limite deve ser >= 0,0" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp fora do intervalo para a plataforma time_t" diff --git a/locale/sv.po b/locale/sv.po index df2431c4e0..6a38d35702 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2020-06-03 18:59+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -66,6 +66,10 @@ msgstr "%%c kräver int eller char" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "%d adresspinnar och %d RGB-pinnar indikerar en höjd av %d, inte %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q används redan" @@ -93,6 +97,10 @@ msgstr "%q måste vara >= 1" msgid "%q must be a tuple of length 2" msgstr "%q måste vara en tuple av längd 2" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q ska vara en int" @@ -346,7 +354,7 @@ 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/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "Högst %d %q kan anges (inte %d)" @@ -427,6 +435,10 @@ msgstr "Bufferten är för liten" msgid "Buffer length %d too big. It must be less than %d" msgstr "Buffertlängd %d för stor. Den måste vara mindre än %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Bufferten måste ha minst längd 1" @@ -714,7 +726,8 @@ msgstr "EXTINT-kanalen används redan" msgid "Error in regex" msgstr "Fel i regex" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -876,6 +889,10 @@ msgstr "Internt define-fel" msgid "Internal error #%d" msgstr "Internt fel #%d" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1388,6 +1405,10 @@ msgstr "Kör i säkert läge! Autoladdning är avstängd.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Kör i säkert läge! Sparad kod körs inte.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -2025,6 +2046,10 @@ msgstr "kan inte 'pend throw' för nystartad generator" msgid "can't send non-None value to a just-started generator" msgstr "kan inte skicka icke-None värde till nystartad generator" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "kan inte att ange attribut" @@ -2153,6 +2178,10 @@ msgstr "Kan inte sända indatamatris från form" msgid "could not invert Vandermonde matrix" msgstr "kan inte invertera Vandermonde-matris" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "data måste vara itererbar" @@ -2716,6 +2745,10 @@ msgstr "negativ exponent utan stöd för flyttal" msgid "negative shift count" msgstr "negativt skiftantal" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "ingen aktiv exception för reraise" @@ -2737,6 +2770,10 @@ msgstr "ingen modul med namnet '%q'" msgid "no reset pin available" msgstr "ingen reset-pinne tillgänglig" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "inget sådant attribut" @@ -3130,6 +3167,14 @@ msgstr "timeout måste vara 0.0-100.0 sekunder" msgid "timeout must be >= 0.0" msgstr "timeout måste vara >= 0.0" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp utom räckvidd för plattformens \"time_t\"" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 4f85c5fa86..1609f672cd 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -65,6 +65,10 @@ msgstr "%%c xūyào zhěngshù huò char" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q zhèngzài shǐyòng" @@ -92,6 +96,10 @@ msgstr "%q bìxū dàyú huò děngyú 1" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q yīnggāi shì yīgè int" @@ -345,7 +353,7 @@ msgstr "Shùzǔ bìxū bāohán bàn zìshù (type 'H')" msgid "Array values should be single bytes." msgstr "Shùzǔ zhí yīnggāi shì dāngè zì jié." -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -426,6 +434,10 @@ msgstr "Huǎnchōng qū tài xiǎo" msgid "Buffer length %d too big. It must be less than %d" msgstr "Huǎnchōng qū chángdù%d tài dà. Tā bìxū xiǎoyú%d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Huǎnchōng qū bìxū zhìshǎo chángdù 1" @@ -709,7 +721,8 @@ msgstr "EXTINT píndào yǐjīng shǐyòng" msgid "Error in regex" msgstr "Zhèngzé biǎodá shì cuòwù" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -871,6 +884,10 @@ msgstr "Nèibù dìngyì cuòwù" msgid "Internal error #%d" msgstr "" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1377,6 +1394,10 @@ msgstr "Zài ānquán móshì xià yùnxíng! Zìdòng chóngxīn jiāzài yǐ g msgid "Running in safe mode! Not running saved code.\n" msgstr "Zài ānquán móshì xià yùnxíng! Bù yùnxíng yǐ bǎocún de dàimǎ.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -2012,6 +2033,10 @@ msgstr "bùnéng bǎ tā rēng dào gāng qǐdòng de fā diànjī shàng" msgid "can't send non-None value to a just-started generator" msgstr "wúfǎ xiàng gānggāng qǐdòng de shēngchéng qì fāsòng fēi zhí" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "wúfǎ shèzhì shǔxìng" @@ -2141,6 +2166,10 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2701,6 +2730,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-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "méiyǒu jīhuó de yìcháng lái chóngxīn píngjià" @@ -2722,6 +2755,10 @@ msgstr "méiyǒu mókuài '%q'" msgid "no reset pin available" msgstr "Méiyǒu kěyòng de fùwèi yǐn jiǎo" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "méiyǒu cǐ shǔxìng" @@ -3114,6 +3151,14 @@ msgstr "Chāo shí shíjiān bìxū wèi 0.0 Dào 100.0 Miǎo" msgid "timeout must be >= 0.0" msgstr "chāoshí bìxū shì >= 0.0" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "time_t shíjiān chuō chāochū píngtái fànwéi" From 1a0c10c328842300aca8ed5113815cfb5bf95d26 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 29 Jun 2020 17:15:01 -0700 Subject: [PATCH 0137/1293] Fix debug UART call --- supervisor/shared/serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c index 513022667a..8eb78a90e5 100644 --- a/supervisor/shared/serial.c +++ b/supervisor/shared/serial.c @@ -55,7 +55,7 @@ void serial_early_init(void) { const mcu_pin_obj_t* tx = MP_OBJ_TO_PTR(DEBUG_UART_TX); common_hal_busio_uart_construct(&debug_uart, tx, rx, NULL, NULL, NULL, - false, 115200, 8, PARITY_NONE, 1, 1.0f, 64, + false, 115200, 8, UART_PARITY_NONE, 1, 1.0f, 64, buf_array, true); common_hal_busio_uart_never_reset(&debug_uart); #endif From 965a40b6a19a9eb35ecc4256aa850d41c88a0137 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 29 Jun 2020 17:17:46 -0700 Subject: [PATCH 0138/1293] Fix cxd56 function signature --- ports/cxd56/common-hal/busio/SPI.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/cxd56/common-hal/busio/SPI.c b/ports/cxd56/common-hal/busio/SPI.c index 718a8ff16e..2d365d4826 100644 --- a/ports/cxd56/common-hal/busio/SPI.c +++ b/ports/cxd56/common-hal/busio/SPI.c @@ -130,7 +130,7 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, uint8_t *data, size_t len, return true; } -bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uint8_t *data_in, size_t len) { +bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_out, uint8_t *data_in, size_t len) { SPI_EXCHANGE(self->spi_dev, data_out, data_in, len); return true; From 69b3d475647b14a87891e38fe00a525b916c5d8a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 29 Jun 2020 18:21:53 -0700 Subject: [PATCH 0139/1293] Fix other esp builds --- .../boards/espressif_saola_1_wroom/board.c | 8 +++---- .../boards/unexpectedmaker_feathers2/board.c | 22 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/board.c b/ports/esp32s2/boards/espressif_saola_1_wroom/board.c index b7b2c4ef5b..9f708874bf 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/board.c +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/board.c @@ -30,12 +30,12 @@ void board_init(void) { // USB - never_reset_pin(&pin_GPIO19); - never_reset_pin(&pin_GPIO20); + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); // Debug UART - never_reset_pin(&pin_GPIO43); - never_reset_pin(&pin_GPIO44); + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); } bool board_requests_safe_mode(void) { diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c b/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c index 8890ec4c16..1dc30b5af8 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c @@ -30,21 +30,21 @@ void board_init(void) { // USB - never_reset_pin(&pin_GPIO19); - never_reset_pin(&pin_GPIO20); + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); // Debug UART - never_reset_pin(&pin_GPIO43); - never_reset_pin(&pin_GPIO44); + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); // SPI Flash and RAM - never_reset_pin(&pin_GPIO26); - never_reset_pin(&pin_GPIO27); - never_reset_pin(&pin_GPIO28); - never_reset_pin(&pin_GPIO29); - never_reset_pin(&pin_GPIO30); - never_reset_pin(&pin_GPIO31); - never_reset_pin(&pin_GPIO32); + common_hal_never_reset_pin(&pin_GPIO26); + common_hal_never_reset_pin(&pin_GPIO27); + common_hal_never_reset_pin(&pin_GPIO28); + common_hal_never_reset_pin(&pin_GPIO29); + common_hal_never_reset_pin(&pin_GPIO30); + common_hal_never_reset_pin(&pin_GPIO31); + common_hal_never_reset_pin(&pin_GPIO32); } bool board_requests_safe_mode(void) { From d9e623eb09cbae5e088d761dd382df408f3c31d9 Mon Sep 17 00:00:00 2001 From: ansonhe97 Date: Tue, 30 Jun 2020 09:51:44 +0800 Subject: [PATCH 0140/1293] Fix order of ci check --- .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 50b9cfeb4e..8ddb8bbd44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -239,8 +239,8 @@ jobs: - "robohatmm1_m4" - "sam32" - "same54_xplained" - - "seeeduino_xiao" - "seeeduino_wio_terminal" + - "seeeduino_xiao" - "serpente" - "shirtty" - "simmel" From 5028804878addc988548b91d173b5fb88380435f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 30 Jun 2020 15:29:42 -0700 Subject: [PATCH 0141/1293] Remove fixed pointers and check UART return --- ports/esp32s2/common-hal/busio/I2C.c | 10 ++++++---- ports/esp32s2/common-hal/busio/I2C.h | 1 - ports/esp32s2/common-hal/busio/SPI.c | 6 +++--- ports/esp32s2/common-hal/busio/UART.c | 3 +++ 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/esp32s2/common-hal/busio/I2C.c index 391d7323c5..74b3896fc2 100644 --- a/ports/esp32s2/common-hal/busio/I2C.c +++ b/ports/esp32s2/common-hal/busio/I2C.c @@ -90,8 +90,10 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, #endif - self->semaphore_handle = xSemaphoreCreateBinaryStatic(&self->semaphore); - xSemaphoreGive(self->semaphore_handle); + if (xSemaphoreCreateBinaryStatic(&self->semaphore) != &self->semaphore) { + mp_raise_RuntimeError(translate("Unable to create lock")); + } + xSemaphoreGive(&self->semaphore); self->sda_pin = sda; self->scl_pin = scl; self->i2c_num = I2C_NUM_MAX; @@ -161,7 +163,7 @@ bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) { } bool common_hal_busio_i2c_try_lock(busio_i2c_obj_t *self) { - self->has_lock = xSemaphoreTake(self->semaphore_handle, 0) == pdTRUE; + self->has_lock = xSemaphoreTake(&self->semaphore, 0) == pdTRUE; return self->has_lock; } @@ -170,7 +172,7 @@ bool common_hal_busio_i2c_has_lock(busio_i2c_obj_t *self) { } void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) { - xSemaphoreGive(self->semaphore_handle); + xSemaphoreGive(&self->semaphore); self->has_lock = false; } diff --git a/ports/esp32s2/common-hal/busio/I2C.h b/ports/esp32s2/common-hal/busio/I2C.h index d90fb2713a..24a3fd4951 100644 --- a/ports/esp32s2/common-hal/busio/I2C.h +++ b/ports/esp32s2/common-hal/busio/I2C.h @@ -40,7 +40,6 @@ typedef struct { const mcu_pin_obj_t* sda_pin; i2c_port_t i2c_num; StaticSemaphore_t semaphore; - SemaphoreHandle_t semaphore_handle; bool has_lock; } busio_i2c_obj_t; diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index 73d7d0595e..a22075cd59 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -209,9 +209,6 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, hal->io_mode = SPI_LL_IO_MODE_NORMAL; - // This must be set after spi_hal_init. - hal->timing_conf = &self->timing_conf; - common_hal_busio_spi_configure(self, 250000, 0, 0, 8); } @@ -261,6 +258,7 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, self->phase = phase; self->bits = bits; self->target_frequency = baudrate; + self->hal_context.timing_conf = &self->timing_conf; esp_err_t result = spi_hal_get_clock_conf(&self->hal_context, self->target_frequency, 128 /* duty_cycle */, @@ -315,6 +313,8 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_ou spi_hal_context_t* hal = &self->hal_context; hal->send_buffer = NULL; hal->rcv_buffer = NULL; + // Reset timing_conf in case we've moved since the last time we used it. + hal->timing_conf = &self->timing_conf; // This rounds up. size_t dma_count = (len + LLDESC_MAX_NUM_PER_DESC - 1) / LLDESC_MAX_NUM_PER_DESC; for (size_t i = 0; i < dma_count; i++) { diff --git a/ports/esp32s2/common-hal/busio/UART.c b/ports/esp32s2/common-hal/busio/UART.c index f73f5c993d..b0162adba9 100644 --- a/ports/esp32s2/common-hal/busio/UART.c +++ b/ports/esp32s2/common-hal/busio/UART.c @@ -249,6 +249,9 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t while (supervisor_ticks_ms64() - start_ticks <= self->timeout_ms) { // Read as many chars as we can right now, up to len. size_t num_read = uart_read_bytes(self->uart_num, data, len, 0); + if (num_read < 0) { + break; + } // Advance pointer in data buffer, and decrease how many chars left to read. data += num_read; From c3d1256d765a7de12d787c2641017de25dbde7d0 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 30 Jun 2020 15:30:07 -0700 Subject: [PATCH 0142/1293] Add one-of-each build target at the top level. --- Makefile | 53 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 0df1950938..d45dae8b90 100644 --- a/Makefile +++ b/Makefile @@ -244,11 +244,48 @@ update-frozen-libraries: @echo "Updating all frozen libraries to latest tagged version." cd frozen; for library in *; do cd $$library; ../../tools/git-checkout-latest-tag.sh; cd ..; done -one-of-each: all-source - make -C ports/atmel-samd BOARD=trinket_m0 - make -C ports/atmel-samd BOARD=feather_m4_express - make -C ports/esp32s2 BOARD=espressif_saola_1_wroom - make -C ports/litex BOARD=fomu - make -C ports/mimxrt10xx BOARD=feather_mimxrt1011 - make -C ports/nrf BOARD=feather_nrf52840_express - make -C ports/stm BOARD=feather_stm32f405_express +one-of-each: samd21 samd51 esp32s2 litex mimxrt10xx nrf stm + +samd21: + $(MAKE) -C ports/atmel-samd BOARD=trinket_m0 + +samd51: + $(MAKE) -C ports/atmel-samd BOARD=feather_m4_express + +esp32s2: + $(MAKE) -C ports/esp32s2 BOARD=espressif_saola_1_wroom + +litex: + $(MAKE) -C ports/litex BOARD=fomu + +mimxrt10xx: + $(MAKE) -C ports/mimxrt10xx BOARD=feather_mimxrt1011 + +nrf: + $(MAKE) -C ports/nrf BOARD=feather_nrf52840_express + +stm: + $(MAKE) -C ports/stm BOARD=feather_stm32f405_express + +clean-one-of-each: clean-samd21 clean-samd51 clean-esp32s2 clean-litex clean-mimxrt10xx clean-nrf clean-stm + +clean-samd21: + $(MAKE) -C ports/atmel-samd BOARD=trinket_m0 clean + +clean-samd51: + $(MAKE) -C ports/atmel-samd BOARD=feather_m4_express clean + +clean-esp32s2: + $(MAKE) -C ports/esp32s2 BOARD=espressif_saola_1_wroom clean + +clean-litex: + $(MAKE) -C ports/litex BOARD=fomu clean + +clean-mimxrt10xx: + $(MAKE) -C ports/mimxrt10xx BOARD=feather_mimxrt1011 clean + +clean-nrf: + $(MAKE) -C ports/nrf BOARD=feather_nrf52840_express clean + +clean-stm: + $(MAKE) -C ports/stm BOARD=feather_stm32f405_express clean From 11cb3e3b4b18a12b56f926f342c65c0f7db93896 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 30 Jun 2020 23:19:40 -0400 Subject: [PATCH 0143/1293] hci skeleton done; not working yet --- devices/ble_hci/common-hal/_bleio/Adapter.c | 46 +- devices/ble_hci/common-hal/_bleio/Adapter.h | 12 +- devices/ble_hci/common-hal/_bleio/hci.c | 1055 +++++++++---------- ports/atmel-samd/Makefile | 2 +- py/circuitpy_defns.mk | 4 +- shared-bindings/_bleio/Adapter.c | 14 +- shared-bindings/_bleio/__init__.c | 3 + 7 files changed, 587 insertions(+), 549 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index c25bec5b82..5f5259f7ef 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -31,6 +31,8 @@ #include #include +#include "hci.h" + #include "py/gc.h" #include "py/mphal.h" #include "py/objstr.h" @@ -178,10 +180,10 @@ char default_ble_name[] = { 'C', 'I', 'R', 'C', 'U', 'I', 'T', 'P', 'Y', 0, 0, 0 // } void common_hal_bleio_adapter_hci_init(bleio_adapter_obj_t *self, const mcu_pin_obj_t *tx, const mcu_pin_obj_t *rx, const mcu_pin_obj_t *rts, const mcu_pin_obj_t *cts, uint32_t baudrate, uint32_t buffer_size) { - self->tx = tx; - self->rx = rx; - self->rts = rts; - self->cts = cts; + self->tx_pin = tx; + self->rx_pin = rx; + self->rts_pin = rts; + self->cts_pin = cts; self->baudrate = baudrate; self->buffer_size = buffer_size; self->enabled = false; @@ -195,6 +197,35 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable return; } + if (enabled) { + common_hal_busio_uart_construct( + &self->hci_uart, + self->tx_pin, // tx pin + self->rx_pin, // rx pin + NULL, // rts pin + NULL, // cts pin + NULL, // rs485 dir pin + false, // rs485 invert + 0, // timeout + self->baudrate, // baudrate + 8, // nbits + PARITY_NONE, // parity + 1, // stop bits + self->buffer_size, // buffer size + NULL, // buffer + false // sigint_enabled + ); + common_hal_digitalio_digitalinout_construct(&self->rts_digitalinout, self->rts_pin); + common_hal_digitalio_digitalinout_construct(&self->cts_digitalinout, self->cts_pin); + + hci_init(self); + } else { + common_hal_busio_uart_deinit(&self->hci_uart); + common_hal_digitalio_digitalinout_deinit(&self->rts_digitalinout); + common_hal_digitalio_digitalinout_deinit(&self->cts_digitalinout); + } + + //FIX enable/disable HCI adapter, but don't reset it, since we don't know how. self->enabled = enabled; } @@ -206,13 +237,14 @@ bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self) { bleio_address_obj_t *common_hal_bleio_adapter_get_address(bleio_adapter_obj_t *self) { common_hal_bleio_adapter_set_enabled(self, true); - // ble_gap_addr_t local_address; - // get_address(self, &local_address); + uint8_t addr[6]; + hci_readBdAddr(addr); bleio_address_obj_t *address = m_new_obj(bleio_address_obj_t); address->base.type = &bleio_address_type; - // common_hal_bleio_address_construct(address, local_address.addr, local_address.addr_type); + // 0 is the type designating a public address. + common_hal_bleio_address_construct(address, addr, 0); return address; } diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.h b/devices/ble_hci/common-hal/_bleio/Adapter.h index 38303062aa..565963dc0d 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.h +++ b/devices/ble_hci/common-hal/_bleio/Adapter.h @@ -52,15 +52,15 @@ typedef struct { bleio_scanresults_obj_t* scan_results; mp_obj_t name; mp_obj_tuple_t *connection_objs; - const mcu_pin_obj_t* tx; - const mcu_pin_obj_t* rx; - const mcu_pin_obj_t* rts; - const mcu_pin_obj_t* cts; + const mcu_pin_obj_t* tx_pin; + const mcu_pin_obj_t* rx_pin; + const mcu_pin_obj_t* rts_pin; + const mcu_pin_obj_t* cts_pin; uint32_t baudrate; uint16_t buffer_size; busio_uart_obj_t hci_uart; - digitalio_digitalinout_obj_t rts_digitalio; - digitalio_digitalinout_obj_t cts_digitalio; + digitalio_digitalinout_obj_t rts_digitalinout; + digitalio_digitalinout_obj_t cts_digitalinout; bool enabled; } bleio_adapter_obj_t; diff --git a/devices/ble_hci/common-hal/_bleio/hci.c b/devices/ble_hci/common-hal/_bleio/hci.c index 8ff69f2027..7d4add9afd 100644 --- a/devices/ble_hci/common-hal/_bleio/hci.c +++ b/devices/ble_hci/common-hal/_bleio/hci.c @@ -1,3 +1,6 @@ +/* + This file is part of the ArduinoBLE library. + Copyright (c) 2018 Arduino SA. All rights reserved. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -9,7 +12,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "HCI.h" +#include "hci.h" +#include + +#include "supervisor/shared/tick.h" + +#define ATT_CID 0x0004 #define HCI_COMMAND_PKT 0x01 #define HCI_ACLDATA_PKT 0x02 @@ -59,617 +67,608 @@ #define HCI_OE_USER_ENDED_CONNECTION 0x13 -HCIClass::HCIClass() : - _debug(NULL), - _recvIndex(0), - _pendingPkt(0) + +#define RECV_BUFFER_SIZE (3 + 255) +#define ACL_PKT_BUFFER_SIZE (255) + +STATIC bleio_adapter_obj_t *adapter; + +STATIC int recv_idx; +STATIC uint8_t recv_buffer[RECV_BUFFER_SIZE]; +STATIC uint16_t cmd_complete_opcode; +STATIC int cmd_complete_status; +STATIC uint8_t cmd_response_len; +STATIC uint8_t* cmd_response; + +STATIC uint8_t max_pkt; +STATIC uint8_t pending_pkt; + +//FIX STATIC uint8_t acl_pkt_buffer[255]; + +STATIC bool debug = true; + +typedef struct __attribute__ ((packed)) { + uint8_t evt; + uint8_t plen; +} HCIEventHdr; + +STATIC void dumpPkt(const char* prefix, uint8_t plen, uint8_t pdata[]) { -} + if (debug) { + mp_printf(&mp_plat_print, "%s", prefix); -HCIClass::~HCIClass() -{ -} - -int HCIClass::begin() -{ - _recvIndex = 0; - - return HCITransport.begin(); -} - -void HCIClass::end() -{ - HCITransport.end(); -} - -void HCIClass::poll() -{ - poll(0); -} - -void HCIClass::poll(unsigned long timeout) -{ -#if defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_METRO_M4_AIRLIFT_LITE) - digitalWrite(NINA_RTS, LOW); -#endif - - if (timeout) { - HCITransport.wait(timeout); - } - - while (HCITransport.available()) { - byte b = HCITransport.read(); - - _recvBuffer[_recvIndex++] = b; - - if (_recvBuffer[0] == HCI_ACLDATA_PKT) { - if (_recvIndex > 5 && _recvIndex >= (5 + (_recvBuffer[3] + (_recvBuffer[4] << 8)))) { - if (_debug) { - dumpPkt("HCI ACLDATA RX <- ", _recvIndex, _recvBuffer); + for (uint8_t i = 0; i < plen; i++) { + mp_printf(&mp_plat_print, "%02x", pdata[i]); } -#if defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_METRO_M4_AIRLIFT_LITE) - digitalWrite(NINA_RTS, HIGH); -#endif - int pktLen = _recvIndex - 1; - _recvIndex = 0; + mp_printf(&mp_plat_print, "\n"); + } +} - handleAclDataPkt(pktLen, &_recvBuffer[1]); -#if defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_METRO_M4_AIRLIFT_LITE) - digitalWrite(NINA_RTS, LOW); -#endif - } - } else if (_recvBuffer[0] == HCI_EVENT_PKT) { - if (_recvIndex > 3 && _recvIndex >= (3 + _recvBuffer[2])) { - if (_debug) { - dumpPkt("HCI EVENT RX <- ", _recvIndex, _recvBuffer); - } -#if defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_METRO_M4_AIRLIFT_LITE) - digitalWrite(NINA_RTS, HIGH); -#endif - // received full event - int pktLen = _recvIndex - 1; - _recvIndex = 0; +STATIC void handleAclDataPkt(uint8_t plen, uint8_t pdata[]) +{ + // typedef struct __attribute__ ((packed)) { + // uint16_t handle; + // uint16_t dlen; + // uint16_t len; + // uint16_t cid; + // } HCIACLHdr; - handleEventPkt(pktLen, &_recvBuffer[1]); + // HCIACLHdr *aclHdr = (HCIACLHdr*)pdata; -#if defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_METRO_M4_AIRLIFT_LITE) - digitalWrite(NINA_RTS, LOW); -#endif - } + // uint16_t aclFlags = (aclHdr->handle & 0xf000) >> 12; + + // if ((aclHdr->dlen - 4) != aclHdr->len) { + // // packet is fragmented + // if (aclFlags != 0x01) { + // // copy into ACL buffer + // memcpy(acl_pkt_buffer, &recv_buffer[1], sizeof(HCIACLHdr) + aclHdr->dlen - 4); + // } else { + // // copy next chunk into the buffer + // HCIACLHdr* aclBufferHeader = (HCIACLHdr*)acl_pkt_buffer; + + // memcpy(&acl_pkt_buffer[sizeof(HCIACLHdr) + aclBufferHeader->dlen - 4], &recv_buffer[1 + sizeof(aclHdr->handle) + sizeof(aclHdr->dlen)], aclHdr->dlen); + + // aclBufferHeader->dlen += aclHdr->dlen; + // aclHdr = aclBufferHeader; + // } + // } + + // if ((aclHdr->dlen - 4) != aclHdr->len) { + // // don't have the full packet yet + // return; + // } + + // if (aclHdr->cid == ATT_CID) { + // if (aclFlags == 0x01) { + // // use buffered packet + // ATT.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &acl_pkt_buffer[sizeof(HCIACLHdr)]); + // } else { + // // use the recv buffer + // ATT.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &recv_buffer[1 + sizeof(HCIACLHdr)]); + // } + // } else if (aclHdr->cid == SIGNALING_CID) { + // L2CAPSignaling.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &recv_buffer[1 + sizeof(HCIACLHdr)]); + // } else { + // struct __attribute__ ((packed)) { + // uint8_t op; + // uint8_t id; + // uint16_t length; + // uint16_t reason; + // uint16_t localCid; + // uint16_t remoteCid; + // } l2capRejectCid= { 0x01, 0x00, 0x006, 0x0002, aclHdr->cid, 0x0000 }; + + // sendAclPkt(aclHdr->handle & 0x0fff, 0x0005, sizeof(l2capRejectCid), &l2capRejectCid); + // } +} + +STATIC void handleNumCompPkts(uint16_t handle, uint16_t numPkts) +{ + if (numPkts && pending_pkt > numPkts) { + pending_pkt -= numPkts; } else { - _recvIndex = 0; - - if (_debug) { - _debug->println(b, HEX); - } + pending_pkt = 0; } - } - -#if defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_METRO_M4_AIRLIFT_LITE) - digitalWrite(NINA_RTS, HIGH); -#endif } -int HCIClass::reset() +STATIC void handleEventPkt(uint8_t plen, uint8_t pdata[]) { - return sendCommand(OGF_HOST_CTL << 10 | OCF_RESET); -} + HCIEventHdr *eventHdr = (HCIEventHdr*)pdata; -int HCIClass::readLocalVersion(uint8_t& hciVer, uint16_t& hciRev, uint8_t& lmpVer, uint16_t& manufacturer, uint16_t& lmpSubVer) -{ - int result = sendCommand(OGF_INFO_PARAM << 10 | OCF_READ_LOCAL_VERSION); + if (eventHdr->evt == EVT_DISCONN_COMPLETE) { + typedef struct __attribute__ ((packed)) { + uint8_t status; + uint16_t handle; + uint8_t reason; + } DisconnComplete; - if (result == 0) { - struct __attribute__ ((packed)) HCILocalVersion { - uint8_t hciVer; - uint16_t hciRev; - uint8_t lmpVer; - uint16_t manufacturer; - uint16_t lmpSubVer; - } *localVersion = (HCILocalVersion*)_cmdResponse; + DisconnComplete *disconnComplete = (DisconnComplete*)&pdata[sizeof(HCIEventHdr)]; + (void) disconnComplete; + //FIX + // ATT.removeConnection(disconnComplete->handle, disconnComplete->reason); + // L2CAPSignaling.removeConnection(disconnComplete->handle, disconnComplete->reason); - hciVer = localVersion->hciVer; - hciRev = localVersion->hciRev; - lmpVer = localVersion->lmpVer; - manufacturer = localVersion->manufacturer; - lmpSubVer = localVersion->lmpSubVer; - } + hci_leSetAdvertiseEnable(0x01); + } else if (eventHdr->evt == EVT_CMD_COMPLETE) { + typedef struct __attribute__ ((packed)) { + uint8_t ncmd; + uint16_t opcode; + uint8_t status; + } CmdComplete; - return result; -} + CmdComplete *cmdCompleteHeader = (CmdComplete*)&pdata[sizeof(HCIEventHdr)]; + cmd_complete_opcode = cmdCompleteHeader->opcode; + cmd_complete_status = cmdCompleteHeader->status; + cmd_response_len = pdata[1] - sizeof(CmdComplete); + cmd_response = &pdata[sizeof(HCIEventHdr) + sizeof(CmdComplete)]; -int HCIClass::readBdAddr(uint8_t addr[6]) -{ - int result = sendCommand(OGF_INFO_PARAM << 10 | OCF_READ_BD_ADDR); + } else if (eventHdr->evt == EVT_CMD_STATUS) { + typedef struct __attribute__ ((packed)) { + uint8_t status; + uint8_t ncmd; + uint16_t opcode; + } CmdStatus; - if (result == 0) { - memcpy(addr, _cmdResponse, 6); - } + CmdStatus *cmdStatusHeader = (CmdStatus*)&pdata[sizeof(HCIEventHdr)]; + cmd_complete_opcode = cmdStatusHeader->opcode; + cmd_complete_status = cmdStatusHeader->status; + cmd_response_len = 0; + } else if (eventHdr->evt == EVT_NUM_COMP_PKTS) { + uint8_t numHandles = pdata[sizeof(HCIEventHdr)]; + uint8_t* data = &pdata[sizeof(HCIEventHdr) + sizeof(numHandles)]; - return result; -} + for (uint8_t i = 0; i < numHandles; i++) { + handleNumCompPkts(data[0], data[1]); -int HCIClass::readRssi(uint16_t handle) -{ - int result = sendCommand(OGF_STATUS_PARAM << 10 | OCF_READ_RSSI, sizeof(handle), &handle); - int rssi = 127; + data += 2; + } + } else if (eventHdr->evt == EVT_LE_META_EVENT) { + typedef struct __attribute__ ((packed)) { + uint8_t subevent; + } LeMetaEventHeader; - if (result == 0) { - struct __attribute__ ((packed)) HCIReadRssi { - uint16_t handle; - int8_t rssi; - } *readRssi = (HCIReadRssi*)_cmdResponse; + LeMetaEventHeader *leMetaHeader = (LeMetaEventHeader*)&pdata[sizeof(HCIEventHdr)]; + if (leMetaHeader->subevent == EVT_LE_CONN_COMPLETE) { + typedef struct __attribute__ ((packed)) { + uint8_t status; + uint16_t handle; + uint8_t role; + uint8_t peerBdaddrType; + uint8_t peerBdaddr[6]; + uint16_t interval; + uint16_t latency; + uint16_t supervisionTimeout; + uint8_t masterClockAccuracy; + } EvtLeConnectionComplete; - if (readRssi->handle == handle) { - rssi = readRssi->rssi; + EvtLeConnectionComplete *leConnectionComplete = (EvtLeConnectionComplete*)&pdata[sizeof(HCIEventHdr) + sizeof(LeMetaEventHeader)]; + + if (leConnectionComplete->status == 0x00) { + // ATT.addConnection(leConnectionComplete->handle, + // leConnectionComplete->role, + // leConnectionComplete->peerBdaddrType, + // leConnectionComplete->peerBdaddr, + // leConnectionComplete->interval, + // leConnectionComplete->latency, + // leConnectionComplete->supervisionTimeout, + // leConnectionComplete->masterClockAccuracy); + + // L2CAPSignaling.addConnection(leConnectionComplete->handle, + // leConnectionComplete->role, + // leConnectionComplete->peerBdaddrType, + // leConnectionComplete->peerBdaddr, + // leConnectionComplete->interval, + // leConnectionComplete->latency, + // leConnectionComplete->supervisionTimeout, + // leConnectionComplete->masterClockAccuracy); + } + } else if (leMetaHeader->subevent == EVT_LE_ADVERTISING_REPORT) { + typedef struct __attribute__ ((packed)) { + uint8_t status; + uint8_t type; + uint8_t peerBdaddrType; + uint8_t peerBdaddr[6]; + uint8_t eirLength; + uint8_t eirData[31]; + } EvtLeAdvertisingReport; + + EvtLeAdvertisingReport*leAdvertisingReport = (EvtLeAdvertisingReport*)&pdata[sizeof(HCIEventHdr) + sizeof(LeMetaEventHeader)]; + + if (leAdvertisingReport->status == 0x01) { + // last byte is RSSI + //FIX int8_t rssi = leAdvertisingReport->eirData[leAdvertisingReport->eirLength]; + + // GAP.handleLeAdvertisingReport(leAdvertisingReport->type, + // leAdvertisingReport->peerBdaddrType, + // leAdvertisingReport->peerBdaddr, + // leAdvertisingReport->eirLength, + // leAdvertisingReport->eirData, + // rssi); + + } + } } - } - - return rssi; } -int HCIClass::setEventMask(uint64_t eventMask) -{ - return sendCommand(OGF_HOST_CTL << 10 | OCF_SET_EVENT_MASK, sizeof(eventMask), &eventMask); +void hci_init(bleio_adapter_obj_t *adapter_in) { + adapter = adapter_in; + recv_idx = 0; + pending_pkt = 0; } -int HCIClass::readLeBufferSize(uint16_t& pktLen, uint8_t& maxPkt) +void hci_poll(void) { + // Assert RTS low to say we're ready to read data. + common_hal_digitalio_digitalinout_set_value(&adapter->rts_digitalinout, false); + + int errcode = 0; + while (common_hal_busio_uart_rx_characters_available(&adapter->hci_uart)) { + // Read just one character. + common_hal_busio_uart_read(&adapter->hci_uart, recv_buffer + recv_idx, 1, &errcode); + recv_idx++; + + if (recv_buffer[0] == HCI_ACLDATA_PKT) { + if (recv_idx > 5 && recv_idx >= (5 + (recv_buffer[3] + (recv_buffer[4] << 8)))) { + if (debug) { + dumpPkt("HCI ACLDATA RX <- ", recv_idx, recv_buffer); + } + // Hold data while processing packet. + common_hal_digitalio_digitalinout_set_value(&adapter->rts_digitalinout, true); + size_t pktLen = recv_idx - 1; + recv_idx = 0; + + handleAclDataPkt(pktLen, &recv_buffer[1]); + + common_hal_digitalio_digitalinout_set_value(&adapter->rts_digitalinout, false); + } + } else if (recv_buffer[0] == HCI_EVENT_PKT) { + if (recv_idx > 3 && recv_idx >= (3 + recv_buffer[2])) { + if (debug) { + dumpPkt("HCI EVENT RX <- ", recv_idx, recv_buffer); + } + // Hold data while processing packet. + common_hal_digitalio_digitalinout_set_value(&adapter->rts_digitalinout, true); + // Received full event. Reset buffer and handle packet. + size_t pktLen = recv_idx - 1; + recv_idx = 0; + + handleEventPkt(pktLen, &recv_buffer[1]); + + common_hal_digitalio_digitalinout_set_value(&adapter->rts_digitalinout, false); + } + } else { + recv_idx = 0; + } + } + + common_hal_digitalio_digitalinout_set_value(&adapter->rts_digitalinout, true); +} + + +int hci_sendCommand(uint8_t ogf, uint16_t ocf, uint8_t plen, void* parameters) { - int result = sendCommand(OGF_LE_CTL << 10 | OCF_LE_READ_BUFFER_SIZE); + uint16_t opcode = ogf << 10 | ocf; - if (result == 0) { - struct __attribute__ ((packed)) HCILeBufferSize { - uint16_t pktLen; - uint8_t maxPkt; - } *leBufferSize = (HCILeBufferSize*)_cmdResponse; + struct __attribute__ ((packed)) { + uint8_t pktType; + uint16_t opcode; + uint8_t plen; + } pktHdr = {HCI_COMMAND_PKT, opcode, plen}; - pktLen = leBufferSize->pktLen; - _maxPkt = maxPkt = leBufferSize->maxPkt; + uint8_t txBuffer[sizeof(pktHdr) + plen]; + memcpy(txBuffer, &pktHdr, sizeof(pktHdr)); + memcpy(&txBuffer[sizeof(pktHdr)], parameters, plen); + + if (debug) { + dumpPkt("HCI COMMAND TX -> ", sizeof(pktHdr) + plen, txBuffer); + } + + int errcode = 0; + common_hal_busio_uart_write(&adapter->hci_uart, txBuffer, sizeof(pktHdr) + plen, &errcode); + if (errcode) { + return -1; + } + + cmd_complete_opcode = 0xffff; + cmd_complete_status = -1; + + // Wait up to one second for a response. + for (uint64_t start = supervisor_ticks_ms64(); + cmd_complete_opcode != opcode && supervisor_ticks_ms64() < (start + 5000); + ) { + hci_poll(); + } + + return cmd_complete_status; +} + +int hci_reset(void) { + return hci_sendCommand(OGF_HOST_CTL, OCF_RESET, 0, NULL); +} + +int hci_readLocalVersion(uint8_t *hciVer, uint16_t *hciRev, uint8_t *lmpVer, uint16_t *manufacturer, uint16_t *lmpSubVer) { + int result = hci_sendCommand(OGF_INFO_PARAM, OCF_READ_LOCAL_VERSION, 0, NULL); + + if (result == 0) { + typedef struct __attribute__ ((packed)) { + uint8_t hciVer; + uint16_t hciRev; + uint8_t lmpVer; + uint16_t manufacturer; + uint16_t lmpSubVer; + } HCILocalVersion; + + HCILocalVersion *localVersion = (HCILocalVersion*)cmd_response; + *hciVer = localVersion->hciVer; + *hciRev = localVersion->hciRev; + *lmpVer = localVersion->lmpVer; + *manufacturer = localVersion->manufacturer; + *lmpSubVer = localVersion->lmpSubVer; + } + + return result; +} + +int hci_readBdAddr(uint8_t addr[6]) { + int result = hci_sendCommand(OGF_INFO_PARAM, OCF_READ_BD_ADDR, 0, NULL); + + if (result == 0) { + memcpy(addr, cmd_response, 6); + } + + return result; +} + +int hci_readRssi(uint16_t handle) { + int result = hci_sendCommand(OGF_STATUS_PARAM, OCF_READ_RSSI, sizeof(handle), &handle); + int rssi = 127; + + if (result == 0) { + typedef struct __attribute__ ((packed)) { + uint16_t handle; + int8_t rssi; + } HCIReadRssi; + + HCIReadRssi *readRssi = (HCIReadRssi*)cmd_response; + if (readRssi->handle == handle) { + rssi = readRssi->rssi; + } + } + + return rssi; +} + +int hci_setEventMask(uint64_t eventMask) { + return hci_sendCommand(OGF_HOST_CTL, OCF_SET_EVENT_MASK, sizeof(eventMask), &eventMask); +} + +int hci_readLeBufferSize(uint16_t *pktLen, uint8_t *maxPkt) +{ + int result = hci_sendCommand(OGF_LE_CTL, OCF_LE_READ_BUFFER_SIZE, 0, NULL); + + if (result == 0) { + typedef struct __attribute__ ((packed)) { + uint16_t pktLen; + uint8_t maxPkt; + } HCILeBufferSize; + + HCILeBufferSize *leBufferSize = (HCILeBufferSize*)cmd_response; + *pktLen = leBufferSize->pktLen; + *maxPkt = leBufferSize->maxPkt; #ifndef __AVR__ - ATT.setMaxMtu(pktLen - 9); // max pkt len - ACL header size + // FIX (needed?) ATT.setMaxMtu(pktLen - 9); // max pkt len - ACL header size #endif - } + } - return result; + return result; } -int HCIClass::leSetRandomAddress(uint8_t addr[6]) +int hci_leSetRandomAddress(uint8_t addr[6]) { - return sendCommand(OGF_LE_CTL << 10 | OCF_LE_SET_RANDOM_ADDRESS, 6, addr); + return hci_sendCommand(OGF_LE_CTL, OCF_LE_SET_RANDOM_ADDRESS, 6, addr); } -int HCIClass::leSetAdvertisingParameters(uint16_t minInterval, uint16_t maxInterval, +int hci_leSetAdvertisingParameters(uint16_t minInterval, uint16_t maxInterval, uint8_t advType, uint8_t ownBdaddrType, uint8_t directBdaddrType, uint8_t directBdaddr[6], uint8_t chanMap, uint8_t filter) { - struct __attribute__ ((packed)) HCILeAdvertisingParameters { - uint16_t minInterval; - uint16_t maxInterval; - uint8_t advType; - uint8_t ownBdaddrType; - uint8_t directBdaddrType; - uint8_t directBdaddr[6]; - uint8_t chanMap; - uint8_t filter; - } leAdvertisingParamters; + struct __attribute__ ((packed)) HCILeAdvertisingParameters { + uint16_t minInterval; + uint16_t maxInterval; + uint8_t advType; + uint8_t ownBdaddrType; + uint8_t directBdaddrType; + uint8_t directBdaddr[6]; + uint8_t chanMap; + uint8_t filter; + } leAdvertisingParamters; - leAdvertisingParamters.minInterval = minInterval; - leAdvertisingParamters.maxInterval = maxInterval; - leAdvertisingParamters.advType = advType; - leAdvertisingParamters.ownBdaddrType = ownBdaddrType; - leAdvertisingParamters.directBdaddrType = directBdaddrType; - memcpy(leAdvertisingParamters.directBdaddr, directBdaddr, 6); - leAdvertisingParamters.chanMap = chanMap; - leAdvertisingParamters.filter = filter; + leAdvertisingParamters.minInterval = minInterval; + leAdvertisingParamters.maxInterval = maxInterval; + leAdvertisingParamters.advType = advType; + leAdvertisingParamters.ownBdaddrType = ownBdaddrType; + leAdvertisingParamters.directBdaddrType = directBdaddrType; + memcpy(leAdvertisingParamters.directBdaddr, directBdaddr, 6); + leAdvertisingParamters.chanMap = chanMap; + leAdvertisingParamters.filter = filter; - return sendCommand(OGF_LE_CTL << 10 | OCF_LE_SET_ADVERTISING_PARAMETERS, sizeof(leAdvertisingParamters), &leAdvertisingParamters); + return hci_sendCommand(OGF_LE_CTL, OCF_LE_SET_ADVERTISING_PARAMETERS, sizeof(leAdvertisingParamters), &leAdvertisingParamters); } -int HCIClass::leSetAdvertisingData(uint8_t length, uint8_t data[]) +int hci_leSetAdvertisingData(uint8_t length, uint8_t data[]) { - struct __attribute__ ((packed)) HCILeAdvertisingData { - uint8_t length; - uint8_t data[31]; - } leAdvertisingData; + struct __attribute__ ((packed)) HCILeAdvertisingData { + uint8_t length; + uint8_t data[31]; + } leAdvertisingData; - memset(&leAdvertisingData, 0, sizeof(leAdvertisingData)); - leAdvertisingData.length = length; - memcpy(leAdvertisingData.data, data, length); + memset(&leAdvertisingData, 0, sizeof(leAdvertisingData)); + leAdvertisingData.length = length; + memcpy(leAdvertisingData.data, data, length); - return sendCommand(OGF_LE_CTL << 10 | OCF_LE_SET_ADVERTISING_DATA, sizeof(leAdvertisingData), &leAdvertisingData); + return hci_sendCommand(OGF_LE_CTL, OCF_LE_SET_ADVERTISING_DATA, sizeof(leAdvertisingData), &leAdvertisingData); } -int HCIClass::leSetScanResponseData(uint8_t length, uint8_t data[]) +int hci_leSetScanResponseData(uint8_t length, uint8_t data[]) { - struct __attribute__ ((packed)) HCILeScanResponseData { - uint8_t length; - uint8_t data[31]; - } leScanResponseData; + struct __attribute__ ((packed)) HCILeScanResponseData { + uint8_t length; + uint8_t data[31]; + } leScanResponseData; - memset(&leScanResponseData, 0, sizeof(leScanResponseData)); - leScanResponseData.length = length; - memcpy(leScanResponseData.data, data, length); + memset(&leScanResponseData, 0, sizeof(leScanResponseData)); + leScanResponseData.length = length; + memcpy(leScanResponseData.data, data, length); - return sendCommand(OGF_LE_CTL << 10 | OCF_LE_SET_SCAN_RESPONSE_DATA, sizeof(leScanResponseData), &leScanResponseData); + return hci_sendCommand(OGF_LE_CTL, OCF_LE_SET_SCAN_RESPONSE_DATA, sizeof(leScanResponseData), &leScanResponseData); } -int HCIClass::leSetAdvertiseEnable(uint8_t enable) +int hci_leSetAdvertiseEnable(uint8_t enable) { - return sendCommand(OGF_LE_CTL << 10 | OCF_LE_SET_ADVERTISE_ENABLE, sizeof(enable), &enable); + return hci_sendCommand(OGF_LE_CTL, OCF_LE_SET_ADVERTISE_ENABLE, sizeof(enable), &enable); } -int HCIClass::leSetScanParameters(uint8_t type, uint16_t interval, uint16_t window, - uint8_t ownBdaddrType, uint8_t filter) +int hci_leSetScanParameters(uint8_t type, uint16_t interval, uint16_t window, + uint8_t ownBdaddrType, uint8_t filter) { - struct __attribute__ ((packed)) HCILeSetScanParameters { - uint8_t type; - uint16_t interval; - uint16_t window; - uint8_t ownBdaddrType; - uint8_t filter; - } leScanParameters; + struct __attribute__ ((packed)) HCILeSetScanParameters { + uint8_t type; + uint16_t interval; + uint16_t window; + uint8_t ownBdaddrType; + uint8_t filter; + } leScanParameters; - leScanParameters.type = type; - leScanParameters.interval = interval; - leScanParameters.window = window; - leScanParameters.ownBdaddrType = ownBdaddrType; - leScanParameters.filter = filter; + leScanParameters.type = type; + leScanParameters.interval = interval; + leScanParameters.window = window; + leScanParameters.ownBdaddrType = ownBdaddrType; + leScanParameters.filter = filter; - return sendCommand(OGF_LE_CTL << 10 | OCF_LE_SET_SCAN_PARAMETERS, sizeof(leScanParameters), &leScanParameters); + return hci_sendCommand(OGF_LE_CTL, OCF_LE_SET_SCAN_PARAMETERS, sizeof(leScanParameters), &leScanParameters); } -int HCIClass::leSetScanEnable(uint8_t enabled, uint8_t duplicates) +int hci_leSetScanEnable(uint8_t enabled, uint8_t duplicates) { - struct __attribute__ ((packed)) HCILeSetScanEnableData { - uint8_t enabled; - uint8_t duplicates; - } leScanEnableData; + struct __attribute__ ((packed)) HCILeSetScanEnableData { + uint8_t enabled; + uint8_t duplicates; + } leScanEnableData; - leScanEnableData.enabled = enabled; - leScanEnableData.duplicates = duplicates; + leScanEnableData.enabled = enabled; + leScanEnableData.duplicates = duplicates; - return sendCommand(OGF_LE_CTL << 10 | OCF_LE_SET_SCAN_ENABLE, sizeof(leScanEnableData), &leScanEnableData); + return hci_sendCommand(OGF_LE_CTL, OCF_LE_SET_SCAN_ENABLE, sizeof(leScanEnableData), &leScanEnableData); } -int HCIClass::leCreateConn(uint16_t interval, uint16_t window, uint8_t initiatorFilter, - uint8_t peerBdaddrType, uint8_t peerBdaddr[6], uint8_t ownBdaddrType, - uint16_t minInterval, uint16_t maxInterval, uint16_t latency, - uint16_t supervisionTimeout, uint16_t minCeLength, uint16_t maxCeLength) +int hci_leCreateConn(uint16_t interval, uint16_t window, uint8_t initiatorFilter, + uint8_t peerBdaddrType, uint8_t peerBdaddr[6], uint8_t ownBdaddrType, + uint16_t minInterval, uint16_t maxInterval, uint16_t latency, + uint16_t supervisionTimeout, uint16_t minCeLength, uint16_t maxCeLength) { - struct __attribute__ ((packed)) HCILeCreateConnData { - uint16_t interval; - uint16_t window; - uint8_t initiatorFilter; - uint8_t peerBdaddrType; - uint8_t peerBdaddr[6]; - uint8_t ownBdaddrType; - uint16_t minInterval; - uint16_t maxInterval; - uint16_t latency; - uint16_t supervisionTimeout; - uint16_t minCeLength; - uint16_t maxCeLength; - } leCreateConnData; - - leCreateConnData.interval = interval; - leCreateConnData.window = window; - leCreateConnData.initiatorFilter = initiatorFilter; - leCreateConnData.peerBdaddrType = peerBdaddrType; - memcpy(leCreateConnData.peerBdaddr, peerBdaddr, sizeof(leCreateConnData.peerBdaddr)); - leCreateConnData.ownBdaddrType = ownBdaddrType; - leCreateConnData.minInterval = minInterval; - leCreateConnData.maxInterval = maxInterval; - leCreateConnData.latency = latency; - leCreateConnData.supervisionTimeout = supervisionTimeout; - leCreateConnData.minCeLength = minCeLength; - leCreateConnData.maxCeLength = maxCeLength; - - return sendCommand(OGF_LE_CTL << 10 | OCF_LE_CREATE_CONN, sizeof(leCreateConnData), &leCreateConnData); -} - -int HCIClass::leCancelConn() -{ - return sendCommand(OGF_LE_CTL << 10 | OCF_LE_CANCEL_CONN, 0, NULL); -} - -int HCIClass::leConnUpdate(uint16_t handle, uint16_t minInterval, uint16_t maxInterval, - uint16_t latency, uint16_t supervisionTimeout) -{ - struct __attribute__ ((packed)) HCILeConnUpdateData { - uint16_t handle; - uint16_t minInterval; - uint16_t maxInterval; - uint16_t latency; - uint16_t supervisionTimeout; - uint16_t minCeLength; - uint16_t maxCeLength; - } leConnUpdateData; - - leConnUpdateData.handle = handle; - leConnUpdateData.minInterval = minInterval; - leConnUpdateData.maxInterval = maxInterval; - leConnUpdateData.latency = latency; - leConnUpdateData.supervisionTimeout = supervisionTimeout; - leConnUpdateData.minCeLength = 0x0004; - leConnUpdateData.maxCeLength = 0x0006; - - return sendCommand(OGF_LE_CTL << 10 | OCF_LE_CONN_UPDATE, sizeof(leConnUpdateData), &leConnUpdateData); -} - -int HCIClass::sendAclPkt(uint16_t handle, uint8_t cid, uint8_t plen, void* data) -{ - while (_pendingPkt >= _maxPkt) { - poll(); - } - - struct __attribute__ ((packed)) HCIACLHdr { - uint8_t pktType; - uint16_t handle; - uint16_t dlen; - uint16_t plen; - uint16_t cid; - } aclHdr = { HCI_ACLDATA_PKT, handle, uint8_t(plen + 4), plen, cid }; - - uint8_t txBuffer[sizeof(aclHdr) + plen]; - memcpy(txBuffer, &aclHdr, sizeof(aclHdr)); - memcpy(&txBuffer[sizeof(aclHdr)], data, plen); - - if (_debug) { - dumpPkt("HCI ACLDATA TX -> ", sizeof(aclHdr) + plen, txBuffer); - } - - _pendingPkt++; - HCITransport.write(txBuffer, sizeof(aclHdr) + plen); - - return 0; -} - -int HCIClass::disconnect(uint16_t handle) -{ - struct __attribute__ ((packed)) HCIDisconnectData { - uint16_t handle; - uint8_t reason; - } disconnectData = { handle, HCI_OE_USER_ENDED_CONNECTION }; - - return sendCommand(OGF_LINK_CTL << 10 | OCF_DISCONNECT, sizeof(disconnectData), &disconnectData); -} - -void HCIClass::debug(Stream& stream) -{ - _debug = &stream; -} - -void HCIClass::noDebug() -{ - _debug = NULL; -} - -int HCIClass::sendCommand(uint16_t opcode, uint8_t plen, void* parameters) -{ - struct __attribute__ ((packed)) { - uint8_t pktType; - uint16_t opcode; - uint8_t plen; - } pktHdr = {HCI_COMMAND_PKT, opcode, plen}; - - uint8_t txBuffer[sizeof(pktHdr) + plen]; - memcpy(txBuffer, &pktHdr, sizeof(pktHdr)); - memcpy(&txBuffer[sizeof(pktHdr)], parameters, plen); - - if (_debug) { - dumpPkt("HCI COMMAND TX -> ", sizeof(pktHdr) + plen, txBuffer); - } - - HCITransport.write(txBuffer, sizeof(pktHdr) + plen); - - _cmdCompleteOpcode = 0xffff; - _cmdCompleteStatus = -1; - - for (unsigned long start = millis(); _cmdCompleteOpcode != opcode && millis() < (start + 1000);) { - poll(); - } - - return _cmdCompleteStatus; -} - -void HCIClass::handleAclDataPkt(uint8_t /*plen*/, uint8_t pdata[]) -{ - struct __attribute__ ((packed)) HCIACLHdr { - uint16_t handle; - uint16_t dlen; - uint16_t len; - uint16_t cid; - } *aclHdr = (HCIACLHdr*)pdata; - - uint16_t aclFlags = (aclHdr->handle & 0xf000) >> 12; - - if ((aclHdr->dlen - 4) != aclHdr->len) { - // packet is fragmented - if (aclFlags != 0x01) { - // copy into ACL buffer - memcpy(_aclPktBuffer, &_recvBuffer[1], sizeof(HCIACLHdr) + aclHdr->dlen - 4); - } else { - // copy next chunk into the buffer - HCIACLHdr* aclBufferHeader = (HCIACLHdr*)_aclPktBuffer; - - memcpy(&_aclPktBuffer[sizeof(HCIACLHdr) + aclBufferHeader->dlen - 4], &_recvBuffer[1 + sizeof(aclHdr->handle) + sizeof(aclHdr->dlen)], aclHdr->dlen); - - aclBufferHeader->dlen += aclHdr->dlen; - aclHdr = aclBufferHeader; - } - } - - if ((aclHdr->dlen - 4) != aclHdr->len) { - // don't have the full packet yet - return; - } - - if (aclHdr->cid == ATT_CID) { - if (aclFlags == 0x01) { - // use buffered packet - ATT.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &_aclPktBuffer[sizeof(HCIACLHdr)]); - } else { - // use the recv buffer - ATT.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &_recvBuffer[1 + sizeof(HCIACLHdr)]); - } - } else if (aclHdr->cid == SIGNALING_CID) { - L2CAPSignaling.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &_recvBuffer[1 + sizeof(HCIACLHdr)]); - } else { - struct __attribute__ ((packed)) { - uint8_t op; - uint8_t id; - uint16_t length; - uint16_t reason; - uint16_t localCid; - uint16_t remoteCid; - } l2capRejectCid= { 0x01, 0x00, 0x006, 0x0002, aclHdr->cid, 0x0000 }; - - sendAclPkt(aclHdr->handle & 0x0fff, 0x0005, sizeof(l2capRejectCid), &l2capRejectCid); - } -} - -void HCIClass::handleNumCompPkts(uint16_t /*handle*/, uint16_t numPkts) -{ - if (numPkts && _pendingPkt > numPkts) { - _pendingPkt -= numPkts; - } else { - _pendingPkt = 0; - } -} - -void HCIClass::handleEventPkt(uint8_t /*plen*/, uint8_t pdata[]) -{ - struct __attribute__ ((packed)) HCIEventHdr { - uint8_t evt; - uint8_t plen; - } *eventHdr = (HCIEventHdr*)pdata; - - if (eventHdr->evt == EVT_DISCONN_COMPLETE) { - struct __attribute__ ((packed)) DisconnComplete { - uint8_t status; - uint16_t handle; - uint8_t reason; - } *disconnComplete = (DisconnComplete*)&pdata[sizeof(HCIEventHdr)]; - - ATT.removeConnection(disconnComplete->handle, disconnComplete->reason); - L2CAPSignaling.removeConnection(disconnComplete->handle, disconnComplete->reason); - - HCI.leSetAdvertiseEnable(0x01); - } else if (eventHdr->evt == EVT_CMD_COMPLETE) { - struct __attribute__ ((packed)) CmdComplete { - uint8_t ncmd; - uint16_t opcode; - uint8_t status; - } *cmdCompleteHeader = (CmdComplete*)&pdata[sizeof(HCIEventHdr)]; - - _cmdCompleteOpcode = cmdCompleteHeader->opcode; - _cmdCompleteStatus = cmdCompleteHeader->status; - _cmdResponseLen = pdata[1] - sizeof(CmdComplete); - _cmdResponse = &pdata[sizeof(HCIEventHdr) + sizeof(CmdComplete)]; - - } else if (eventHdr->evt == EVT_CMD_STATUS) { - struct __attribute__ ((packed)) CmdStatus { - uint8_t status; - uint8_t ncmd; - uint16_t opcode; - } *cmdStatusHeader = (CmdStatus*)&pdata[sizeof(HCIEventHdr)]; - - _cmdCompleteOpcode = cmdStatusHeader->opcode; - _cmdCompleteStatus = cmdStatusHeader->status; - _cmdResponseLen = 0; - } else if (eventHdr->evt == EVT_NUM_COMP_PKTS) { - uint8_t numHandles = pdata[sizeof(HCIEventHdr)]; - uint16_t* data = (uint16_t*)&pdata[sizeof(HCIEventHdr) + sizeof(numHandles)]; - - for (uint8_t i = 0; i < numHandles; i++) { - handleNumCompPkts(data[0], data[1]); - - data += 2; - } - } else if (eventHdr->evt == EVT_LE_META_EVENT) { - struct __attribute__ ((packed)) LeMetaEventHeader { - uint8_t subevent; - } *leMetaHeader = (LeMetaEventHeader*)&pdata[sizeof(HCIEventHdr)]; - - if (leMetaHeader->subevent == EVT_LE_CONN_COMPLETE) { - struct __attribute__ ((packed)) EvtLeConnectionComplete { - uint8_t status; - uint16_t handle; - uint8_t role; + struct __attribute__ ((packed)) HCILeCreateConnData { + uint16_t interval; + uint16_t window; + uint8_t initiatorFilter; uint8_t peerBdaddrType; uint8_t peerBdaddr[6]; - uint16_t interval; + uint8_t ownBdaddrType; + uint16_t minInterval; + uint16_t maxInterval; uint16_t latency; uint16_t supervisionTimeout; - uint8_t masterClockAccuracy; - } *leConnectionComplete = (EvtLeConnectionComplete*)&pdata[sizeof(HCIEventHdr) + sizeof(LeMetaEventHeader)]; + uint16_t minCeLength; + uint16_t maxCeLength; + } leCreateConnData; - if (leConnectionComplete->status == 0x00) { - ATT.addConnection(leConnectionComplete->handle, - leConnectionComplete->role, - leConnectionComplete->peerBdaddrType, - leConnectionComplete->peerBdaddr, - leConnectionComplete->interval, - leConnectionComplete->latency, - leConnectionComplete->supervisionTimeout, - leConnectionComplete->masterClockAccuracy); + leCreateConnData.interval = interval; + leCreateConnData.window = window; + leCreateConnData.initiatorFilter = initiatorFilter; + leCreateConnData.peerBdaddrType = peerBdaddrType; + memcpy(leCreateConnData.peerBdaddr, peerBdaddr, sizeof(leCreateConnData.peerBdaddr)); + leCreateConnData.ownBdaddrType = ownBdaddrType; + leCreateConnData.minInterval = minInterval; + leCreateConnData.maxInterval = maxInterval; + leCreateConnData.latency = latency; + leCreateConnData.supervisionTimeout = supervisionTimeout; + leCreateConnData.minCeLength = minCeLength; + leCreateConnData.maxCeLength = maxCeLength; - L2CAPSignaling.addConnection(leConnectionComplete->handle, - leConnectionComplete->role, - leConnectionComplete->peerBdaddrType, - leConnectionComplete->peerBdaddr, - leConnectionComplete->interval, - leConnectionComplete->latency, - leConnectionComplete->supervisionTimeout, - leConnectionComplete->masterClockAccuracy); - } - } else if (leMetaHeader->subevent == EVT_LE_ADVERTISING_REPORT) { - struct __attribute__ ((packed)) EvtLeAdvertisingReport { - uint8_t status; - uint8_t type; - uint8_t peerBdaddrType; - uint8_t peerBdaddr[6]; - uint8_t eirLength; - uint8_t eirData[31]; - } *leAdvertisingReport = (EvtLeAdvertisingReport*)&pdata[sizeof(HCIEventHdr) + sizeof(LeMetaEventHeader)]; - - if (leAdvertisingReport->status == 0x01) { - // last byte is RSSI - int8_t rssi = leAdvertisingReport->eirData[leAdvertisingReport->eirLength]; - - GAP.handleLeAdvertisingReport(leAdvertisingReport->type, - leAdvertisingReport->peerBdaddrType, - leAdvertisingReport->peerBdaddr, - leAdvertisingReport->eirLength, - leAdvertisingReport->eirData, - rssi); - - } - } - } + return hci_sendCommand(OGF_LE_CTL, OCF_LE_CREATE_CONN, sizeof(leCreateConnData), &leCreateConnData); } -void HCIClass::dumpPkt(const char* prefix, uint8_t plen, uint8_t pdata[]) +int hci_leCancelConn() { - if (_debug) { - _debug->print(prefix); + return hci_sendCommand(OGF_LE_CTL, OCF_LE_CANCEL_CONN, 0, NULL); +} - for (uint8_t i = 0; i < plen; i++) { - byte b = pdata[i]; +int hci_leConnUpdate(uint16_t handle, uint16_t minInterval, uint16_t maxInterval, + uint16_t latency, uint16_t supervisionTimeout) +{ + struct __attribute__ ((packed)) HCILeConnUpdateData { + uint16_t handle; + uint16_t minInterval; + uint16_t maxInterval; + uint16_t latency; + uint16_t supervisionTimeout; + uint16_t minCeLength; + uint16_t maxCeLength; + } leConnUpdateData; - if (b < 16) { - _debug->print("0"); - } + leConnUpdateData.handle = handle; + leConnUpdateData.minInterval = minInterval; + leConnUpdateData.maxInterval = maxInterval; + leConnUpdateData.latency = latency; + leConnUpdateData.supervisionTimeout = supervisionTimeout; + leConnUpdateData.minCeLength = 0x0004; + leConnUpdateData.maxCeLength = 0x0006; - _debug->print(b, HEX); + return hci_sendCommand(OGF_LE_CTL, OCF_LE_CONN_UPDATE, sizeof(leConnUpdateData), &leConnUpdateData); +} + +int hci_sendAclPkt(uint16_t handle, uint8_t cid, uint8_t plen, void* data) { + while (pending_pkt >= max_pkt) { + hci_poll(); } - _debug->println(); - _debug->flush(); - } + typedef struct __attribute__ ((packed)) { + uint8_t pktType; + uint16_t handle; + uint16_t dlen; + uint16_t plen; + uint16_t cid; + } HCIACLHdr; + + HCIACLHdr aclHdr = { HCI_ACLDATA_PKT, handle, (uint8_t)(plen + 4), plen, cid }; + + uint8_t txBuffer[sizeof(aclHdr) + plen]; + memcpy(txBuffer, &aclHdr, sizeof(aclHdr)); + memcpy(&txBuffer[sizeof(aclHdr)], data, plen); + + if (debug) { + dumpPkt("HCI ACLDATA TX -> ", sizeof(aclHdr) + plen, txBuffer); + } + + pending_pkt++; + + int errcode = 0; + common_hal_busio_uart_write(&adapter->hci_uart, txBuffer, sizeof(aclHdr) + plen, &errcode); + if (errcode) { + return -1; + } + + return 0; +} + +int hci_disconnect(uint16_t handle) +{ + struct __attribute__ ((packed)) HCIDisconnectData { + uint16_t handle; + uint8_t reason; + } disconnectData = { handle, HCI_OE_USER_ENDED_CONNECTION }; + + return hci_sendCommand(OGF_LINK_CTL, OCF_DISCONNECT, sizeof(disconnectData), &disconnectData); } -` diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 5f901a1991..cce89a7acb 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -248,7 +248,7 @@ endif SRC_ASF := $(addprefix asf4/$(CHIP_FAMILY)/, $(SRC_ASF)) -SRC_C = \ +SRC_C += \ audio_dma.c \ background.c \ bindings/samd/Clock.c \ diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 38ef373126..b30159c7c1 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -318,8 +318,8 @@ SRC_COMMON_HAL_ALL = \ watchdog/__init__.c \ ifeq ($(CIRCUITPY_BLEIO_HCI),1) -SRC_C +=\ - common_hal/_bleio/hci.c \ +SRC_C += \ + common-hal/_bleio/hci.c \ endif diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 911fa6d35a..1b991ac6d4 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -64,20 +64,20 @@ //| advertisements and it can advertise its own data. Furthermore, Adapters can accept incoming //| connections and also initiate connections.""" //| - -//| def __init__(self, *, tx: Pin, rx: Pin, rts: Pin, cts: Pin, baudrate: int = 115200, buffer_size: int = 256): //| You cannot create an instance of `_bleio.Adapter`. //| Use `_bleio.adapter` to access the sole instance available.""" //| -//| On boards that do not have native BLE. You can use HCI co-processor. + +//| def hci_init(self, *, tx: Pin, rx: Pin, rts: Pin, cts: Pin, baudrate: int = 115200, buffer_size: int = 256): +//| On boards that do not have native BLE, you can an use HCI co-processor. //| Call `_bleio.adapter.hci_init()` passing it the pins used to communicate //| with the co-processor, such as an Adafruit AirLift. //| The co-processor must have been reset and put into BLE mode beforehand //| by the appropriate pin manipulation. //| The `tx`, `rx`, `rts`, and `cs` pins are used to communicate with the HCI co-processor in HCI mode. //| -#if CIRCUITPY_BLEIO_HCI mp_obj_t bleio_adapter_hci_init(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { +#if CIRCUITPY_BLEIO_HCI bleio_adapter_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); if (self->enabled) { @@ -114,10 +114,14 @@ mp_obj_t bleio_adapter_hci_init(mp_uint_t n_args, const mp_obj_t *pos_args, mp_m common_hal_bleio_adapter_hci_init(&common_hal_bleio_adapter_obj, tx, rx, rts, cts, baudrate, buffer_size); + return mp_const_none; +#else + mp_raise_RuntimeError(translate("hci_init not available")); + return mp_const_none; +#endif // CIRCUITPY_BLEIO_HCI } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_hci_init_obj, 1, bleio_adapter_hci_init); -#endif // CIRCUITPY_BLEIO_HCI //| //| enabled: Any = ... diff --git a/shared-bindings/_bleio/__init__.c b/shared-bindings/_bleio/__init__.c index 90b185f79a..29405ecadd 100644 --- a/shared-bindings/_bleio/__init__.c +++ b/shared-bindings/_bleio/__init__.c @@ -112,7 +112,10 @@ NORETURN void mp_raise_bleio_SecurityError(const compressed_string_t* fmt, ...) // Called when _bleio is imported. STATIC mp_obj_t bleio___init__(void) { +#if !CIRCUITPY_BLEIO_HCI + // HCI cannot be enabled on import, because we need to setup the HCI adapter first. common_hal_bleio_adapter_set_enabled(&common_hal_bleio_adapter_obj, true); +#endif return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_0(bleio___init___obj, bleio___init__); From d4e28dd23393a0129b9faae65a3ff91bff91af11 Mon Sep 17 00:00:00 2001 From: ansonhe97 Date: Wed, 1 Jul 2020 17:06:26 +0800 Subject: [PATCH 0144/1293] ADD: added more special pins on Wio Terminal --- .../boards/seeeduino_wio_terminal/pins.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c index 8c6260ce2c..92cc8f8be1 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c @@ -44,6 +44,27 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { // LED pins { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA15) }, // status + // LCD Display + { MP_OBJ_NEW_QSTR(MP_QSTR_TFT_MISO), MP_ROM_PTR(&pin_PB18) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_TFT_MOSI), MP_ROM_PTR(&pin_PB19) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_TFT_SCK), MP_ROM_PTR(&pin_PB20) }, + { MP_ROM_QSTR(MP_QSTR_TFT_SS), MP_ROM_PTR(&pin_PB21) }, + { MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_PC06) }, + { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_PC05) }, + + // Special named pins + { MP_OBJ_NEW_QSTR(MP_QSTR_SWITCH_UP), MP_ROM_PTR(&pin_PD20) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SWITCH_LEFT), MP_ROM_PTR(&pin_PD12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SWITCH_RIGHT), MP_ROM_PTR(&pin_PD09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SWITCH_DOWN), MP_ROM_PTR(&pin_PD08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SWITCH_PRESS), MP_ROM_PTR(&pin_PD10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_1), MP_ROM_PTR(&pin_PC26) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_2), MP_ROM_PTR(&pin_PC27) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_3), MP_ROM_PTR(&pin_PC28) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_LIGHT), MP_ROM_PTR(&pin_PD01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_BUZZER), MP_ROM_PTR(&pin_PD11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IR), MP_ROM_PTR(&pin_PB31) }, + // Comm objects { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, From 0a9c6fbb7f4381ab758945d4c02d9f156757a39c Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 30 Jun 2020 07:55:11 +0000 Subject: [PATCH 0145/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (770 of 770 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 488 +++++++++++++++++++++++++----------------------- 1 file changed, 252 insertions(+), 236 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 30d77864b3..acabdb197e 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-26 11:50-0500\n" -"PO-Revision-Date: 2020-06-29 23:50+0000\n" +"PO-Revision-Date: 2020-06-30 17:48+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -68,7 +68,7 @@ msgstr "%d endereços dos pinos e %d pinos rgb indicam uma altura do %d, não %d #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" -msgstr "" +msgstr "%q falha: %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -99,7 +99,7 @@ msgstr "%q deve ser uma tupla de comprimento 2" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q pin invalid" -msgstr "" +msgstr "%q pino inválido" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" @@ -395,7 +395,7 @@ msgstr "A profundidade de bits deve ser o múltiplo de 8." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "" +msgstr "Ambos os RX e TX são necessários para o controle do fluxo" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -443,7 +443,7 @@ msgstr "O tamanho do buffer %d é muito grande. Deve ser menor que %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" -msgstr "" +msgstr "O comprimento do Buffer deve ser um múltiplo de 512" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -610,7 +610,7 @@ msgstr "Código bruto corrompido" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" -msgstr "" +msgstr "Não foi possível inicializar o GNSS" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" @@ -900,7 +900,7 @@ msgstr "Erro interno #%d" #: shared-bindings/sdioio/SDCard.c msgid "Invalid %q" -msgstr "" +msgstr "%q Inválido" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1295,7 +1295,7 @@ msgstr "O pino não tem recursos de ADC" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pin is input only" -msgstr "" +msgstr "Apenas o pino de entrada" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" @@ -1322,7 +1322,7 @@ msgstr "Além de quaisquer módulos no sistema de arquivos\n" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" -msgstr "" +msgstr "O Polígono precisa de pelo menos 3 pontos" #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" @@ -1419,7 +1419,7 @@ msgstr "Rodando em modo seguro! Não está executando o código salvo.\n" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" -msgstr "" +msgstr "O formato CSD do Cartão SD não é compatível" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c @@ -1491,7 +1491,7 @@ msgstr "Forneça pelo menos um pino UART" #: shared-bindings/gnss/GNSS.c msgid "System entry must be gnss.SatelliteSystem" -msgstr "" +msgstr "A entrada no sistema deve ser gnss.SatelliteSystem" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" @@ -1561,6 +1561,8 @@ msgstr "A largura do bloco deve dividir exatamente com a largura do bitmap" #, c-format msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +"O tempo limite é long demais: O comprimento máximo do tempo limite é de %d " +"segundos" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1736,22 +1738,26 @@ msgstr "AVISO: Seu arquivo de código tem duas extensões\n" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" +"O WatchDogTimer não pode ser não-inicializado uma vez que o modo é definido " +"como RESET" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer is not currently running" -msgstr "" +msgstr "O WatchDogTimer não está em execução" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" 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 "" +msgstr "O WatchDogTimer.timeout deve ser maior que 0" #: supervisor/shared/safe_mode.c msgid "Watchdog timer expired." -msgstr "" +msgstr "O temporizador Watchdog expirou." #: py/builtinhelp.c #, c-format @@ -2064,7 +2070,7 @@ msgstr "" #: shared-module/sdcardio/SDCard.c msgid "can't set 512 block size" -msgstr "" +msgstr "não é possível definir o tamanho de 512 blocos" #: py/objnamedtuple.c msgid "can't set attribute" @@ -2199,15 +2205,15 @@ msgstr "não foi possível inverter a matriz Vandermonde" #: shared-module/sdcardio/SDCard.c msgid "couldn't determine SD card version" -msgstr "" +msgstr "não foi possível determinar a versão do cartão SD" #: extmod/ulab/code/approx.c msgid "data must be iterable" -msgstr "" +msgstr "os dados devem ser iteráveis" #: extmod/ulab/code/approx.c msgid "data must be of equal length" -msgstr "" +msgstr "os dados devem ser de igual comprimento" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" @@ -2281,31 +2287,31 @@ msgstr "erro = 0x%08lX" #: py/runtime.c msgid "exceptions must derive from BaseException" -msgstr "" +msgstr "as exceções devem derivar a partir do BaseException" #: py/objstr.c msgid "expected ':' after format specifier" -msgstr "" +msgstr "é esperado ':' após o especificador do formato" #: py/obj.c msgid "expected tuple/list" -msgstr "" +msgstr "é esperada tupla/lista" #: py/modthread.c msgid "expecting a dict for keyword args" -msgstr "" +msgstr "esperando um dicionário para os args da palavra-chave" #: py/compile.c msgid "expecting an assembler instruction" -msgstr "" +msgstr "esperando uma instrução assembler" #: py/compile.c msgid "expecting just a value for set" -msgstr "" +msgstr "esperando apenas um valor para o conjunto" #: py/compile.c msgid "expecting key:value for dict" -msgstr "" +msgstr "chave esperada: valor para dict" #: py/argcheck.c msgid "extra keyword arguments given" @@ -2317,28 +2323,28 @@ msgstr "argumentos extra posicionais passados" #: py/parse.c msgid "f-string expression part cannot include a '#'" -msgstr "" +msgstr "A parte da expressão f-string não pode incluir um '#'" #: py/parse.c msgid "f-string expression part cannot include a backslash" -msgstr "" +msgstr "A parte da expressão f-string não pode incluir uma barra invertida" #: py/parse.c msgid "f-string: empty expression not allowed" -msgstr "" +msgstr "f-string: expressão vazia não é permitida" #: py/parse.c msgid "f-string: expecting '}'" -msgstr "" +msgstr "f-string: esperando '}'" #: py/parse.c msgid "f-string: single '}' is not allowed" -msgstr "" +msgstr "f-string: um único '}' não é permitido" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" -msgstr "" +msgstr "o arquivo deve ser um arquivo aberto no modo byte" #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" @@ -2346,31 +2352,31 @@ msgstr "sistema de arquivos deve fornecer método de montagem" #: extmod/ulab/code/vectorise.c msgid "first argument must be a callable" -msgstr "" +msgstr "o primeiro argumento deve ser chamável" #: extmod/ulab/code/approx.c msgid "first argument must be a function" -msgstr "" +msgstr "o primeiro argumento deve ser uma função" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" -msgstr "" +msgstr "o primeiro argumento deve ser um iterável" #: extmod/ulab/code/vectorise.c msgid "first argument must be an ndarray" -msgstr "" +msgstr "o primeiro argumento deve ser um ndarray" #: py/objtype.c msgid "first argument to super() must be type" -msgstr "" +msgstr "o primeiro argumento para super() deve ser um tipo" #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" -msgstr "" +msgstr "a ordem do nivelamento deve ser 'C' ou 'F'" #: extmod/ulab/code/numerical.c msgid "flip argument must be an ndarray" -msgstr "" +msgstr "o argumento flip deve ser um ndarray" #: py/objint.c msgid "float too big" @@ -2378,11 +2384,11 @@ msgstr "float muito grande" #: shared-bindings/_stage/Text.c msgid "font must be 2048 bytes long" -msgstr "" +msgstr "a fonte deve ter 2048 bytes de comprimento" #: py/objstr.c msgid "format requires a dict" -msgstr "" +msgstr "formato requer um dict" #: py/objdeque.c msgid "full" @@ -2399,15 +2405,15 @@ msgstr "função esperada na maioria dos %d argumentos, obteve %d" #: py/bc.c py/objnamedtuple.c msgid "function got multiple values for argument '%q'" -msgstr "" +msgstr "A função obteve vários valores para o argumento '%q'" #: extmod/ulab/code/approx.c msgid "function has the same sign at the ends of interval" -msgstr "" +msgstr "a função tem o mesmo sinal nas extremidades do intervalo" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" -msgstr "" +msgstr "A função foi implementada apenas para escalares e ndarrays" #: py/argcheck.c #, c-format @@ -2416,16 +2422,16 @@ msgstr "função ausente %d requer argumentos posicionais" #: py/bc.c msgid "function missing keyword-only argument" -msgstr "" +msgstr "falta apenas a palavra chave do argumento da função" #: py/bc.c msgid "function missing required keyword argument '%q'" -msgstr "" +msgstr "falta apenas a palavra chave do argumento '%q' da função" #: py/bc.c #, c-format msgid "function missing required positional argument #%d" -msgstr "" +msgstr "falta o argumento #%d da posição necessária da função" #: py/argcheck.c py/bc.c py/objnamedtuple.c #, c-format @@ -2438,15 +2444,15 @@ msgstr "função leva exatamente 9 argumentos" #: py/objgenerator.c msgid "generator already executing" -msgstr "" +msgstr "o gerador já está em execução" #: py/objgenerator.c msgid "generator ignored GeneratorExit" -msgstr "" +msgstr "ignorando o gerador GeneratorExit" #: shared-bindings/_stage/Layer.c msgid "graphic must be 2048 bytes long" -msgstr "" +msgstr "o gráfico deve ter 2048 bytes de comprimento" #: extmod/moduheapq.c msgid "heap must be a list" @@ -2454,11 +2460,11 @@ msgstr "a área de alocação dinâmica de variáveis (heap) deve ser uma lista" #: py/compile.c msgid "identifier redefined as global" -msgstr "" +msgstr "o identificador foi redefinido como global" #: py/compile.c msgid "identifier redefined as nonlocal" -msgstr "" +msgstr "o identificador foi redefinido como não-local" #: py/objstr.c msgid "incomplete format" @@ -2466,7 +2472,7 @@ msgstr "formato incompleto" #: py/objstr.c msgid "incomplete format key" -msgstr "" +msgstr "a chave do formato está incompleto" #: extmod/modubinascii.c msgid "incorrect padding" @@ -2474,7 +2480,7 @@ msgstr "preenchimento incorreto" #: extmod/ulab/code/ndarray.c msgid "index is out of bounds" -msgstr "" +msgstr "o índice está fora dos limites" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -2485,55 +2491,55 @@ msgstr "Índice fora do intervalo" #: py/obj.c msgid "indices must be integers" -msgstr "" +msgstr "os índices devem ser inteiros" #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" -msgstr "" +msgstr "os índices devem ser números inteiros, fatias ou listas booleanas" #: extmod/ulab/code/approx.c msgid "initial values must be iterable" -msgstr "" +msgstr "os valores iniciais devem ser iteráveis" #: py/compile.c msgid "inline assembler must be a function" -msgstr "" +msgstr "o assembler em linha deve ser uma função" #: extmod/ulab/code/create.c msgid "input argument must be an integer or a 2-tuple" -msgstr "" +msgstr "o argumento da entrada deve ser um número inteiro ou uma tupla de 2" #: extmod/ulab/code/fft.c msgid "input array length must be power of 2" -msgstr "" +msgstr "comprimento da matriz da entrada deve ter potência de 2" #: extmod/ulab/code/poly.c msgid "input data must be an iterable" -msgstr "" +msgstr "os dados da entrada devem ser iteráveis" #: extmod/ulab/code/linalg.c msgid "input matrix is asymmetric" -msgstr "" +msgstr "a matriz da entrada é assimétrica" #: extmod/ulab/code/linalg.c msgid "input matrix is singular" -msgstr "" +msgstr "a matriz da entrada é singular" #: extmod/ulab/code/linalg.c msgid "input must be square matrix" -msgstr "" +msgstr "a entrada deve ser uma matriz quadrada" #: extmod/ulab/code/numerical.c msgid "input must be tuple, list, range, or ndarray" -msgstr "" +msgstr "A entrada deve ser tupla, lista, intervalo ou matriz" #: extmod/ulab/code/poly.c msgid "input vectors must be of equal length" -msgstr "" +msgstr "os vetores da entrada devem ter o mesmo comprimento" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "" +msgstr "int() arg 2 deve ser >= 2 e <= 36" #: py/objstr.c msgid "integer required" @@ -2541,12 +2547,12 @@ msgstr "inteiro requerido" #: extmod/ulab/code/approx.c msgid "interp is defined for 1D arrays of equal length" -msgstr "" +msgstr "o interp é definido para matrizes 1D de igual comprimento" #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" -msgstr "" +msgstr "o intervalo deve estar entre %s-%s" #: lib/netutils/netutils.c msgid "invalid arguments" @@ -2566,7 +2572,7 @@ msgstr "formato inválido" #: py/objstr.c msgid "invalid format specifier" -msgstr "" +msgstr "o especificador do formato é inválido" #: extmod/modussl_axtls.c msgid "invalid key" @@ -2574,7 +2580,7 @@ msgstr "chave inválida" #: py/compile.c msgid "invalid micropython decorator" -msgstr "" +msgstr "o decorador micropython é inválido" #: shared-bindings/random/__init__.c msgid "invalid step" @@ -2582,119 +2588,122 @@ msgstr "passo inválido" #: py/compile.c py/parse.c msgid "invalid syntax" -msgstr "" +msgstr "sintaxe inválida" #: py/parsenum.c msgid "invalid syntax for integer" -msgstr "" +msgstr "sintaxe inválida para o número inteiro" #: py/parsenum.c #, c-format msgid "invalid syntax for integer with base %d" -msgstr "" +msgstr "sintaxe inválida para o número inteiro com base %d" #: py/parsenum.c msgid "invalid syntax for number" -msgstr "" +msgstr "sintaxe inválida para o número" #: py/objtype.c msgid "issubclass() arg 1 must be a class" -msgstr "" +msgstr "issubclass() arg 1 deve ser uma classe" #: py/objtype.c msgid "issubclass() arg 2 must be a class or a tuple of classes" -msgstr "" +msgstr "issubclass() arg 2 deve ser uma classe ou uma tupla de classes" #: extmod/ulab/code/ndarray.c msgid "iterables are not of the same length" -msgstr "" +msgstr "os iteráveis não têm o mesmo comprimento" #: extmod/ulab/code/linalg.c msgid "iterations did not converge" -msgstr "" +msgstr "as iterações não convergiram" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" +"join espera uma lista de objetos str/bytes consistentes com o próprio objeto" #: py/argcheck.c msgid "keyword argument(s) not yet implemented - use normal args instead" msgstr "" +"o(s) argumento(s) de palavra-chave ainda não foi implementado - em vez " +"disso, use argumentos normais" #: py/bc.c msgid "keywords must be strings" -msgstr "" +msgstr "as palavras-chave devem ser uma cadeia de caracteres" #: py/emitinlinethumb.c py/emitinlinextensa.c msgid "label '%q' not defined" -msgstr "" +msgstr "o rótulo '%q' não foi definido" #: py/compile.c msgid "label redefined" -msgstr "" +msgstr "o rótulo foi redefinido" #: py/stream.c msgid "length argument not allowed for this type" -msgstr "" +msgstr "o argumento de comprimento não é permitido para este tipo" #: shared-bindings/audiomixer/MixerVoice.c msgid "level must be between 0 and 1" -msgstr "" +msgstr "o nível deve estar entre 0 e 1" #: py/objarray.c msgid "lhs and rhs should be compatible" -msgstr "" +msgstr "o lhs e rhs devem ser compatíveis" #: py/emitnative.c msgid "local '%q' has type '%q' but source is '%q'" -msgstr "" +msgstr "o local '%q' tem o tipo '%q', porém a origem é '%q'" #: py/emitnative.c msgid "local '%q' used before type known" -msgstr "" +msgstr "o local '%q' usado antes do tipo conhecido" #: py/vm.c msgid "local variable referenced before assignment" -msgstr "" +msgstr "a variável local referenciada antes da atribuição" #: py/objint.c msgid "long int not supported in this build" -msgstr "" +msgstr "o long int não é suportado nesta compilação" #: py/parse.c msgid "malformed f-string" -msgstr "" +msgstr "f-string malformado" #: shared-bindings/_stage/Layer.c msgid "map buffer too small" -msgstr "" +msgstr "o mapa do buffer é muito pequeno" #: py/modmath.c shared-bindings/math/__init__.c msgid "math domain error" -msgstr "" +msgstr "erro de domínio matemático" #: extmod/ulab/code/linalg.c msgid "matrix dimensions do not match" -msgstr "" +msgstr "as dimensões da matriz não coincidem" #: extmod/ulab/code/linalg.c msgid "matrix is not positive definite" -msgstr "" +msgstr "a matriz não é definitiva positiva" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format msgid "max_length must be 0-%d when fixed_length is %s" -msgstr "" +msgstr "o max_length deve ser 0-%d quando Fixed_length for %s" #: py/runtime.c msgid "maximum recursion depth exceeded" -msgstr "" +msgstr "a recursão máxima da profundidade foi excedida" #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" -msgstr "" +msgstr "falha na alocação de memória, alocando %u bytes" #: py/runtime.c msgid "memory allocation failed, heap is locked" @@ -2704,39 +2713,39 @@ msgstr "" #: py/builtinimport.c msgid "module not found" -msgstr "" +msgstr "o módulo não foi encontrado" #: extmod/ulab/code/poly.c msgid "more degrees of freedom than data points" -msgstr "" +msgstr "mais graus de liberdade do que pontos de dados" #: py/compile.c msgid "multiple *x in assignment" -msgstr "" +msgstr "múltiplo *x na atribuição" #: py/objtype.c msgid "multiple bases have instance lay-out conflict" -msgstr "" +msgstr "várias bases possuem instâncias de layout com conflitos" #: py/objtype.c msgid "multiple inheritance not supported" -msgstr "" +msgstr "herança múltipla não suportada" #: py/emitnative.c msgid "must raise an object" -msgstr "" +msgstr "deve levantar um objeto" #: py/modbuiltins.c msgid "must use keyword argument for key function" -msgstr "" +msgstr "deve usar o argumento da palavra-chave para a função da chave" #: extmod/ulab/code/numerical.c msgid "n must be between 0, and 9" -msgstr "" +msgstr "n deve estar entre 0 e 9" #: py/runtime.c msgid "name '%q' is not defined" -msgstr "" +msgstr "o nome '%q' não está definido" #: py/runtime.c msgid "name not defined" @@ -2744,11 +2753,11 @@ msgstr "nome não definido" #: py/compile.c msgid "name reused for argument" -msgstr "" +msgstr "o nome foi reutilizado para o argumento" #: py/emitnative.c msgid "native yield" -msgstr "" +msgstr "rendimento nativo" #: py/runtime.c #, c-format @@ -2757,113 +2766,113 @@ msgstr "precisa de mais de %d valores para desempacotar" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" -msgstr "" +msgstr "potência negativa sem suporte de flutuação" #: py/objint_mpz.c py/runtime.c msgid "negative shift count" -msgstr "" +msgstr "contagem de turnos negativos" #: shared-module/sdcardio/SDCard.c msgid "no SD card" -msgstr "" +msgstr "nenhum cartão SD" #: py/vm.c msgid "no active exception to reraise" -msgstr "" +msgstr "nenhuma exceção ativa para reraise" #: shared-bindings/socket/__init__.c shared-module/network/__init__.c msgid "no available NIC" -msgstr "" +msgstr "não há uma Placa de Rede disponível" #: py/compile.c msgid "no binding for nonlocal found" -msgstr "" +msgstr "nenhuma ligação para nonlocal foi encontrada" #: py/builtinimport.c msgid "no module named '%q'" -msgstr "" +msgstr "nenhum módulo chamado '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c msgid "no reset pin available" -msgstr "" +msgstr "nenhum pino de redefinição está disponível" #: shared-module/sdcardio/SDCard.c msgid "no response from SD card" -msgstr "" +msgstr "não houve resposta do cartão SD" #: py/runtime.c msgid "no such attribute" -msgstr "" +msgstr "não há tal atributo" #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" -msgstr "" +msgstr "um não UUID foi encontrado na lista service_uuids_whitelist" #: py/compile.c msgid "non-default argument follows default argument" -msgstr "" +msgstr "o argumento não predefinido segue o argumento predefinido" #: extmod/modubinascii.c msgid "non-hex digit found" -msgstr "" +msgstr "um dígito não hexadecimal foi encontrado" #: py/compile.c msgid "non-keyword arg after */**" -msgstr "" +msgstr "um arg sem palavra-chave após */ **" #: py/compile.c msgid "non-keyword arg after keyword arg" -msgstr "" +msgstr "um arg não-palavra-chave após a palavra-chave arg" #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" -msgstr "" +msgstr "não é um UUID com 128 bits" #: py/objstr.c msgid "not all arguments converted during string formatting" -msgstr "" +msgstr "nem todos os argumentos são convertidos durante a formatação da string" #: py/objstr.c msgid "not enough arguments for format string" -msgstr "" +msgstr "argumentos insuficientes para o formato da string" #: extmod/ulab/code/poly.c msgid "number of arguments must be 2, or 3" -msgstr "" +msgstr "a quantidade dos argumentos deve ser 2 ou 3" #: extmod/ulab/code/create.c msgid "number of points must be at least 2" -msgstr "" +msgstr "a quantidade dos pontos deve ser pelo menos 2" #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" -msgstr "" +msgstr "o objeto '%s' não é uma tupla ou uma lista" #: py/obj.c msgid "object does not support item assignment" -msgstr "" +msgstr "O objeto não suporta a atribuição dos itens" #: py/obj.c msgid "object does not support item deletion" -msgstr "" +msgstr "objeto não suporta a exclusão do item" #: py/obj.c msgid "object has no len" -msgstr "" +msgstr "o objeto não tem len" #: py/obj.c msgid "object is not subscriptable" -msgstr "" +msgstr "O objeto não é subroteirizável" #: py/runtime.c msgid "object not an iterator" -msgstr "" +msgstr "o objeto não é um iterador" #: py/objtype.c py/runtime.c msgid "object not callable" -msgstr "" +msgstr "o objeto não é resgatável" #: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" @@ -2876,121 +2885,126 @@ msgstr "objeto não iterável" #: py/obj.c #, c-format msgid "object of type '%s' has no len()" -msgstr "" +msgstr "O objeto do tipo '%s' não possui len()" #: py/obj.c msgid "object with buffer protocol required" -msgstr "" +msgstr "é necessário objeto com protocolo do buffer" #: extmod/modubinascii.c msgid "odd-length string" -msgstr "" +msgstr "sequência com comprimento ímpar" #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" -msgstr "" +msgstr "desvio fora dos limites" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" -msgstr "" +msgstr "apenas bit_depth = 16 é compatível" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" -msgstr "" +msgstr "apenas sample_rate = 16000 é compatível" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "" +"apenas fatias com a etapa=1 (também conhecida como Nenhuma) são compatíveis" #: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c #: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" -msgstr "" +msgstr "os operandos não puderam ser transmitidos juntos" #: extmod/ulab/code/numerical.c msgid "operation is not implemented on ndarrays" -msgstr "" +msgstr "a operação não foi implementada nos ndarrays" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" -msgstr "" +msgstr "operação não é compatível com o tipo informado" #: py/modbuiltins.c msgid "ord expects a character" -msgstr "" +msgstr "o ord espera um caractere" #: py/modbuiltins.c #, c-format msgid "ord() expected a character, but string of length %d found" msgstr "" +"o ord() esperava um caractere, porém a sequência do comprimento %d foi " +"encontrada" #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "" +"houve um transbordamento durante a conversão int longo para a palavra de " +"máquina" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" -msgstr "" +msgstr "a paleta deve ter 32 bytes de comprimento" #: shared-bindings/displayio/Palette.c msgid "palette_index should be an int" -msgstr "" +msgstr "palette_index deve ser um int" #: py/compile.c msgid "parameter annotation must be an identifier" -msgstr "" +msgstr "a anotação do parâmetro deve ser um identificador" #: py/emitinlinextensa.c msgid "parameters must be registers in sequence a2 to a5" -msgstr "" +msgstr "os parâmetros devem ser registradores na sequência a2 até a5" #: py/emitinlinethumb.c msgid "parameters must be registers in sequence r0 to r3" -msgstr "" +msgstr "os parâmetros devem ser registradores na sequência r0 até r3" #: shared-bindings/displayio/Bitmap.c msgid "pixel coordinates out of bounds" -msgstr "" +msgstr "as coordenadas do pixel estão fora dos limites" #: shared-bindings/displayio/Bitmap.c msgid "pixel value requires too many bits" -msgstr "" +msgstr "o valor do pixel requer bits demais" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" -msgstr "" +msgstr "o pixel_shader deve ser displayio.Palette ou displayio.ColorConverter" #: shared-module/vectorio/Polygon.c msgid "polygon can only be registered in one parent" -msgstr "" +msgstr "o polígono só pode ser registrado em um pai" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" -msgstr "" +msgstr "pop a partir de um PulseIn vazio" #: py/objset.c msgid "pop from an empty set" -msgstr "" +msgstr "pop a partir de um conjunto vazio" #: py/objlist.c msgid "pop from empty list" -msgstr "" +msgstr "pop a partir da lista vazia" #: py/objdict.c msgid "popitem(): dictionary is empty" -msgstr "" +msgstr "popitem(): o dicionário está vazio" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" -msgstr "" +msgstr "O terceiro argumento pow() não pode ser 0" #: py/objint_mpz.c msgid "pow() with 3 arguments requires integers" -msgstr "" +msgstr "o pow() com 3 argumentos requer números inteiros" #: extmod/modutimeq.c msgid "queue overflow" @@ -2998,52 +3012,54 @@ msgstr "estouro de fila" #: py/parse.c msgid "raw f-strings are not implemented" -msgstr "" +msgstr "o f-strings bruto não estão implementados" #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" -msgstr "" +msgstr "partes reais e imaginárias devem ter o mesmo comprimento" #: py/builtinimport.c msgid "relative import" -msgstr "" +msgstr "importação relativa" #: py/obj.c #, c-format msgid "requested length %d but object has length %d" -msgstr "" +msgstr "o comprimento solicitado %d, porém o objeto tem comprimento %d" #: py/compile.c msgid "return annotation must be an identifier" -msgstr "" +msgstr "a anotação do retorno deve ser um identificador" #: py/emitnative.c msgid "return expected '%q' but got '%q'" -msgstr "" +msgstr "o retorno esperado era '%q', porém obteve '% q'" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" -msgstr "" +msgstr "rgb_pins[%d] duplica outra atribuição dos pinos" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "" +msgstr "rgb_pins[%d] não está na mesma porta que o clock" #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" -msgstr "" +msgstr "o lado direito deve ser um ndarray ou um escalar" #: py/objstr.c msgid "rsplit(None,n)" -msgstr "" +msgstr "rsplit(Nenhum,n)" #: shared-bindings/audiocore/RawSample.c msgid "" "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " "'B'" msgstr "" +"O buffer sample_source deve ser um bytearray ou matriz do tipo 'h', 'H', 'b' " +"ou 'B'" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -3051,7 +3067,7 @@ msgstr "Taxa de amostragem fora do intervalo" #: py/modmicropython.c msgid "schedule stack full" -msgstr "" +msgstr "agende a pilha de função completa" #: lib/utils/pyexec.c py/builtinimport.c msgid "script compilation not supported" @@ -3059,47 +3075,47 @@ msgstr "compilação de script não suportada" #: extmod/ulab/code/ndarray.c msgid "shape must be a 2-tuple" -msgstr "" +msgstr "a forma deve ser uma tupla de 2" #: py/objstr.c msgid "sign not allowed in string format specifier" -msgstr "" +msgstr "sinal não permitido no especificador do formato da sequência" #: py/objstr.c msgid "sign not allowed with integer format specifier 'c'" -msgstr "" +msgstr "sinal não permitido com o especificador no formato inteiro 'c'" #: py/objstr.c msgid "single '}' encountered in format string" -msgstr "" +msgstr "único '}' encontrado na string do formato" #: extmod/ulab/code/linalg.c msgid "size is defined for ndarrays only" -msgstr "" +msgstr "o tamanho é definido apenas para os ndarrays" #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" -msgstr "" +msgstr "a duração do sleep não deve ser negativo" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" -msgstr "" +msgstr "a etapa da fatia não pode ser zero" #: py/objint.c py/sequence.c msgid "small int overflow" -msgstr "" +msgstr "transbordamento int pequeno" #: main.c msgid "soft reboot\n" -msgstr "" +msgstr "reinicialização soft\n" #: extmod/ulab/code/numerical.c msgid "sort argument must be an ndarray" -msgstr "" +msgstr "o argumento da classificação deve ser um ndarray" #: py/objstr.c msgid "start/end indices" -msgstr "" +msgstr "os índices de início/fim" #: shared-bindings/displayio/Shape.c msgid "start_x should be an int" @@ -3111,28 +3127,28 @@ msgstr "o passo deve ser diferente de zero" #: shared-bindings/busio/UART.c msgid "stop must be 1 or 2" -msgstr "" +msgstr "o stop deve ser 1 ou 2" #: shared-bindings/random/__init__.c msgid "stop not reachable from start" -msgstr "" +msgstr "stop não está acessível a partir do início" #: py/stream.c msgid "stream operation not supported" -msgstr "" +msgstr "a operação do fluxo não é compatível" #: py/objstrunicode.c msgid "string index out of range" -msgstr "" +msgstr "o índice da string está fora do intervalo" #: py/objstrunicode.c #, c-format msgid "string indices must be integers, not %s" -msgstr "" +msgstr "o índices das string devem ser números inteiros, não %s" #: py/stream.c msgid "string not supported; use bytes or bytearray" -msgstr "" +msgstr "a string não é compatível; use bytes ou bytearray" #: extmod/moductypes.c msgid "struct: cannot index" @@ -3148,11 +3164,11 @@ msgstr "struct: sem campos" #: py/objstr.c msgid "substring not found" -msgstr "" +msgstr "a substring não foi encontrada" #: py/compile.c msgid "super() can't find self" -msgstr "" +msgstr "o super() não consegue se encontrar" #: extmod/modujson.c msgid "syntax error in JSON" @@ -3160,7 +3176,7 @@ msgstr "erro de sintaxe no JSON" #: extmod/moductypes.c msgid "syntax error in uctypes descriptor" -msgstr "" +msgstr "houve um erro de sintaxe no descritor uctypes" #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" @@ -3168,15 +3184,15 @@ msgstr "Limite deve estar no alcance de 0-65536" #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" -msgstr "" +msgstr "time.struct_time() leva uma sequência com 9" #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" -msgstr "" +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 "" +msgstr "o tempo limite deve ser entre 0.0 a 100.0 segundos" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" @@ -3184,11 +3200,11 @@ msgstr "o tempo limite deve ser >= 0,0" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" -msgstr "" +msgstr "o tempo limite na espera pelo cartão v1" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v2 card" -msgstr "" +msgstr "o tempo limite na espera pelo cartão v2" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" @@ -3200,24 +3216,24 @@ msgstr "Muitos argumentos fornecidos com o formato dado" #: extmod/ulab/code/ndarray.c msgid "too many indices" -msgstr "" +msgstr "índices demais" #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" -msgstr "" +msgstr "valores demais para descompactar (esperado %d)" #: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" -msgstr "" +msgstr "o índice da tupla está fora do intervalo" #: py/obj.c msgid "tuple/list has wrong length" -msgstr "" +msgstr "a tupla/lista está com tamanho incorreto" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "tuple/list required on RHS" -msgstr "" +msgstr "a tupla/lista necessária no RHS" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c @@ -3226,69 +3242,69 @@ msgstr "TX e RX não podem ser ambos" #: py/objtype.c msgid "type '%q' is not an acceptable base type" -msgstr "" +msgstr "o tipo '%q' não é um tipo base aceitável" #: py/objtype.c msgid "type is not an acceptable base type" -msgstr "" +msgstr "tipo não é um tipo base aceitável" #: py/runtime.c msgid "type object '%q' has no attribute '%q'" -msgstr "" +msgstr "o objeto tipo '%q' não possuí atributo '%q'" #: py/objtype.c msgid "type takes 1 or 3 arguments" -msgstr "" +msgstr "o tipo usa 1 ou 3 argumentos" #: py/objint_longlong.c msgid "ulonglong too large" -msgstr "" +msgstr "ulonglong é muito grande" #: py/emitnative.c msgid "unary op %q not implemented" -msgstr "" +msgstr "op %q unário não foi implementado" #: py/parse.c msgid "unexpected indent" -msgstr "" +msgstr "recuo inesperado" #: py/bc.c msgid "unexpected keyword argument" -msgstr "" +msgstr "argumento inesperado da palavra-chave" #: py/bc.c py/objnamedtuple.c msgid "unexpected keyword argument '%q'" -msgstr "" +msgstr "argumento inesperado da palavra-chave '%q'" #: py/lexer.c msgid "unicode name escapes" -msgstr "" +msgstr "escapar o nome unicode" #: py/parse.c msgid "unindent does not match any outer indentation level" -msgstr "" +msgstr "o unindent não coincide com nenhum nível de recuo externo" #: py/objstr.c #, c-format msgid "unknown conversion specifier %c" -msgstr "" +msgstr "especificador de conversão desconhecido %c" #: py/objstr.c #, c-format msgid "unknown format code '%c' for object of type '%s'" -msgstr "" +msgstr "código de formato desconhecido '%c' para o objeto do tipo '%s'" #: py/compile.c msgid "unknown type" -msgstr "" +msgstr "tipo desconhecido" #: py/emitnative.c msgid "unknown type '%q'" -msgstr "" +msgstr "tipo desconhecido '%q'" #: py/objstr.c msgid "unmatched '{' in format" -msgstr "" +msgstr "um '{' sem par no formato" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -3297,83 +3313,83 @@ msgstr "atributo ilegível" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c #: shared-module/vectorio/Polygon.c msgid "unsupported %q type" -msgstr "" +msgstr "tipo %q não suportado" #: py/emitinlinethumb.c #, c-format msgid "unsupported Thumb instruction '%s' with %d arguments" -msgstr "" +msgstr "instrução Thumb '%s' não compatível com argumentos %d" #: py/emitinlinextensa.c #, c-format msgid "unsupported Xtensa instruction '%s' with %d arguments" -msgstr "" +msgstr "instrução Xtensa '%s' não compatível com argumentos %d" #: py/objstr.c #, c-format msgid "unsupported format character '%c' (0x%x) at index %d" -msgstr "" +msgstr "o caractere do formato não é compatível '%c' (0x%x) no índice %d" #: py/runtime.c msgid "unsupported type for %q: '%s'" -msgstr "" +msgstr "tipo não compatível para %q: '%s'" #: py/runtime.c msgid "unsupported type for operator" -msgstr "" +msgstr "tipo não compatível para o operador" #: py/runtime.c msgid "unsupported types for %q: '%s', '%s'" -msgstr "" +msgstr "tipos não compatíveis para %q: '%s', '%s'" #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" -msgstr "" +msgstr "o valor deve caber em %d byte(s)" #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" -msgstr "" +msgstr "o value_count deve ser > 0" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" -msgstr "" +msgstr "o tempo limite do watchdog deve ser maior que 0" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" -msgstr "" +msgstr "a janela deve ser <= intervalo" #: extmod/ulab/code/linalg.c msgid "wrong argument type" -msgstr "" +msgstr "tipo do argumento errado" #: extmod/ulab/code/ndarray.c msgid "wrong index type" -msgstr "" +msgstr "tipo do índice errado" #: extmod/ulab/code/vectorise.c msgid "wrong input type" -msgstr "" +msgstr "tipo da entrada incorreta" #: py/objstr.c msgid "wrong number of arguments" -msgstr "" +msgstr "quantidade errada dos argumentos" #: py/runtime.c msgid "wrong number of values to unpack" -msgstr "" +msgstr "quantidade incorreta dos valores para descompressão" #: extmod/ulab/code/ndarray.c msgid "wrong operand type" -msgstr "" +msgstr "tipo do operando errado" #: extmod/ulab/code/vectorise.c msgid "wrong output type" -msgstr "" +msgstr "tipo da saída incorreta" #: shared-module/displayio/Shape.c msgid "x value out of bounds" -msgstr "" +msgstr "a valor x está fora dos limites" #: shared-bindings/displayio/Shape.c msgid "y should be an int" @@ -3381,7 +3397,7 @@ msgstr "y deve ser um int" #: shared-module/displayio/Shape.c msgid "y value out of bounds" -msgstr "" +msgstr "o valor y está fora dos limites" #: py/objrange.c msgid "zero step" From ab9a64eafa7f2e5892e13053c5e9490437548263 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 1 Jul 2020 10:07:45 -0400 Subject: [PATCH 0146/1293] Add timer allocator, adjust pulsio to use general purpose timers --- ports/stm/Makefile | 1 + ports/stm/common-hal/pulseio/PWMOut.c | 176 +++--------------------- ports/stm/common-hal/pulseio/PulseIn.c | 77 +++++------ ports/stm/common-hal/pulseio/PulseOut.c | 132 ++++++++---------- ports/stm/mpconfigport.mk | 4 +- ports/stm/peripherals/timers.c | 138 ++++++++++++++++--- ports/stm/peripherals/timers.h | 27 +++- ports/stm/supervisor/port.c | 2 + 8 files changed, 253 insertions(+), 304 deletions(-) diff --git a/ports/stm/Makefile b/ports/stm/Makefile index 08cb36ddf2..0db0775e2e 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -207,6 +207,7 @@ SRC_C += \ mphalport.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ + peripherals/timers.c \ peripherals/stm32$(MCU_SERIES_LOWER)/clocks.c \ peripherals/stm32$(MCU_SERIES_LOWER)/$(MCU_VARIANT_LOWER)/pins.c \ peripherals/stm32$(MCU_SERIES_LOWER)/$(MCU_VARIANT_LOWER)/gpio.c \ diff --git a/ports/stm/common-hal/pulseio/PWMOut.c b/ports/stm/common-hal/pulseio/PWMOut.c index 304a1539c0..a3c21330e0 100644 --- a/ports/stm/common-hal/pulseio/PWMOut.c +++ b/ports/stm/common-hal/pulseio/PWMOut.c @@ -35,38 +35,14 @@ #include STM32_HAL_H #include "common-hal/microcontroller/Pin.h" +#include "timers.h" + #define ALL_CLOCKS 0xFFFF STATIC uint8_t reserved_tim[TIM_BANK_ARRAY_LEN]; STATIC uint32_t tim_frequencies[TIM_BANK_ARRAY_LEN]; STATIC bool never_reset_tim[TIM_BANK_ARRAY_LEN]; -STATIC void tim_clock_enable(uint16_t mask); -STATIC void tim_clock_disable(uint16_t mask); - -// 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. -STATIC uint32_t timer_get_source_freq(uint32_t tim_id) { - 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; - } 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; - } - if (clk_div != 0) { - // APB prescaler for this timer is > 1 - source *= 2; - } - return source; -} - 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); @@ -97,7 +73,6 @@ void pwmout_reset(void) { never_reset_mask |= 1 << i; } } - tim_clock_disable(ALL_CLOCKS & ~(never_reset_mask)); } pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, @@ -107,6 +82,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, 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; @@ -119,8 +95,13 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, //if pin is same if (l_tim->pin == pin) { - //check if the timer has a channel active + //check if the timer has a channel active, or is reserved by main timer system if (reserved_tim[l_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; + 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; @@ -155,9 +136,12 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, reserved_tim[self->tim->tim_index - 1] |= 1 << (self->tim->channel_index - 1); } tim_frequencies[self->tim->tim_index - 1] = frequency; + stm_peripherals_timer_reserve(TIMx); } else { //no match found if (tim_chan_taken) { mp_raise_ValueError(translate("No more timers available on this pin.")); + } else if (tim_taken_internal) { + mp_raise_ValueError(translate("Timer was reserved for internal use - declare PWM pins earlier in the program")); } else if (tim_taken_f_mismatch) { mp_raise_ValueError(translate("Frequency must match existing PWMOut using this timer")); } else if (var_freq_mismatch) { @@ -182,8 +166,8 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, uint32_t prescaler = 0; //prescaler is 15 bit uint32_t period = 0; //period is 16 bit - timer_get_optimal_divisors(&period, &prescaler, frequency, - timer_get_source_freq(self->tim->tim_index)); + uint32_t source_freq = stm_peripherals_timer_get_source_freq(TIMx); + timer_get_optimal_divisors(&period, &prescaler, frequency, source_freq); //Timer init self->handle.Instance = TIMx; @@ -282,8 +266,8 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_ uint32_t prescaler = 0; uint32_t period = 0; - timer_get_optimal_divisors(&period, &prescaler, frequency, - timer_get_source_freq(self->tim->tim_index)); + uint32_t source_freq = stm_peripherals_timer_get_source_freq(self->handle.Instance); + timer_get_optimal_divisors(&period, &prescaler, frequency, source_freq); //shut down HAL_TIM_PWM_Stop(&self->handle, self->channel); @@ -318,131 +302,3 @@ uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) { bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t* self) { return self->variable_frequency; } - -STATIC void tim_clock_enable(uint16_t mask) { - #ifdef TIM1 - if (mask & (1 << 0)) { - __HAL_RCC_TIM1_CLK_ENABLE(); - } - #endif - #ifdef TIM2 - if (mask & (1 << 1)) { - __HAL_RCC_TIM2_CLK_ENABLE(); - } - #endif - #ifdef TIM3 - if (mask & (1 << 2)) { - __HAL_RCC_TIM3_CLK_ENABLE(); - } - #endif - #ifdef TIM4 - if (mask & (1 << 3)) { - __HAL_RCC_TIM4_CLK_ENABLE(); - } - #endif - #ifdef TIM5 - if (mask & (1 << 4)) { - __HAL_RCC_TIM5_CLK_ENABLE(); - } - #endif - //6 and 7 are reserved ADC timers - #ifdef TIM8 - if (mask & (1 << 7)) { - __HAL_RCC_TIM8_CLK_ENABLE(); - } - #endif - #ifdef TIM9 - if (mask & (1 << 8)) { - __HAL_RCC_TIM9_CLK_ENABLE(); - } - #endif - #ifdef TIM10 - if (mask & (1 << 9)) { - __HAL_RCC_TIM10_CLK_ENABLE(); - } - #endif - #ifdef TIM11 - if (mask & (1 << 10)) { - __HAL_RCC_TIM11_CLK_ENABLE(); - } - #endif - #ifdef TIM12 - if (mask & (1 << 11)) { - __HAL_RCC_TIM12_CLK_ENABLE(); - } - #endif - #ifdef TIM13 - if (mask & (1 << 12)) { - __HAL_RCC_TIM13_CLK_ENABLE(); - } - #endif - #ifdef TIM14 - if (mask & (1 << 13)) { - __HAL_RCC_TIM14_CLK_ENABLE(); - } - #endif -} - -STATIC void tim_clock_disable(uint16_t mask) { - #ifdef TIM1 - if (mask & (1 << 0)) { - __HAL_RCC_TIM1_CLK_DISABLE(); - } - #endif - #ifdef TIM2 - if (mask & (1 << 1)) { - __HAL_RCC_TIM2_CLK_DISABLE(); - } - #endif - #ifdef TIM3 - if (mask & (1 << 2)) { - __HAL_RCC_TIM3_CLK_DISABLE(); - } - #endif - #ifdef TIM4 - if (mask & (1 << 3)) { - __HAL_RCC_TIM4_CLK_DISABLE(); - } - #endif - #ifdef TIM5 - if (mask & (1 << 4)) { - __HAL_RCC_TIM5_CLK_DISABLE(); - } - #endif - //6 and 7 are reserved ADC timers - #ifdef TIM8 - if (mask & (1 << 7)) { - __HAL_RCC_TIM8_CLK_DISABLE(); - } - #endif - #ifdef TIM9 - if (mask & (1 << 8)) { - __HAL_RCC_TIM9_CLK_DISABLE(); - } - #endif - #ifdef TIM10 - if (mask & (1 << 9)) { - __HAL_RCC_TIM10_CLK_DISABLE(); - } - #endif - #ifdef TIM11 - if (mask & (1 << 10)) { - __HAL_RCC_TIM11_CLK_DISABLE(); - } - #endif - #ifdef TIM12 - if (mask & (1 << 11)) { - __HAL_RCC_TIM12_CLK_DISABLE(); - } - #endif - #ifdef TIM13 - if (mask & (1 << 12)) { - __HAL_RCC_TIM13_CLK_DISABLE(); - } - #endif - #ifdef TIM14 - if (mask & (1 << 13)) { - __HAL_RCC_TIM14_CLK_DISABLE(); - } - #endif -} diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c index 9d82a18a01..8b93e52f20 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.c +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -32,39 +32,36 @@ #include "py/runtime.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/pulseio/PulseIn.h" +#include "timers.h" #include STM32_HAL_H #define STM32_GPIO_PORT_SIZE 16 - static pulseio_pulsein_obj_t* _objs[STM32_GPIO_PORT_SIZE]; -STATIC TIM_HandleTypeDef t6_handle; +STATIC TIM_HandleTypeDef tim_handle; static uint32_t overflow_count = 0; STATIC uint8_t refcount = 0; static void assign_EXTI_Interrupt(pulseio_pulsein_obj_t* self, uint8_t num); -void TIM6_IRQHandler(void) +void pulsein_timer_event_handler(void) { // Detect TIM Update event - if (__HAL_TIM_GET_FLAG(&t6_handle, TIM_FLAG_UPDATE) != RESET) + if (__HAL_TIM_GET_FLAG(&tim_handle, TIM_FLAG_UPDATE) != RESET) { - if (__HAL_TIM_GET_IT_SOURCE(&t6_handle, TIM_IT_UPDATE) != RESET) + if (__HAL_TIM_GET_IT_SOURCE(&tim_handle, TIM_IT_UPDATE) != RESET) { - __HAL_TIM_CLEAR_IT(&t6_handle, TIM_IT_UPDATE); + __HAL_TIM_CLEAR_IT(&tim_handle, TIM_IT_UPDATE); overflow_count++; } } } -static void pulsein_handler(uint8_t num) { +static void pulsein_exti_event_handler(uint8_t num) { // Grab the current time first. uint32_t current_overflow = overflow_count; - uint32_t current_count = 0; - #if HAS_BASIC_TIM - current_count = TIM6->CNT; - #endif + uint32_t current_count = tim_handle.Instance->CNT; // Interrupt register must be cleared manually EXTI->PR = 1 << num; @@ -105,17 +102,12 @@ void pulsein_reset(void) { } memset(_objs, 0, sizeof(_objs)); - #if HAS_BASIC_TIM - __HAL_RCC_TIM6_CLK_DISABLE(); + tim_clock_disable(stm_peripherals_timer_get_index(tim_handle.Instance)); refcount = 0; - #endif } void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu_pin_obj_t* pin, uint16_t maxlen, bool idle_state) { -#if !(HAS_BASIC_TIM) - mp_raise_NotImplementedError(translate("PulseIn not supported on this chip")); -#else // STM32 has one shared EXTI for each pin number, 0-15 uint8_t p_num = pin->number; if(_objs[p_num]) { @@ -141,24 +133,33 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu self->last_count = 0; self->last_overflow = 0; - if (HAL_TIM_Base_GetState(&t6_handle) == HAL_TIM_STATE_RESET) { - // Set the new period - t6_handle.Instance = TIM6; - t6_handle.Init.Prescaler = 168; // HCLK is 168 mhz so divide down to 1mhz - t6_handle.Init.Period = 0xffff; - HAL_TIM_Base_Init(&t6_handle); + if (HAL_TIM_Base_GetState(&tim_handle) == HAL_TIM_STATE_RESET) { + // Find a suitable timer + TIM_TypeDef * tim_instance = stm_peripherals_find_timer(); + stm_peripherals_timer_reserve(tim_instance); - // TIM6 has limited HAL support, set registers manually - t6_handle.Instance->SR = 0; // Prevent the SR from triggering an interrupt - t6_handle.Instance->CR1 |= TIM_CR1_CEN; // Resume timer - t6_handle.Instance->CR1 |= TIM_CR1_URS; // Disable non-overflow interrupts - __HAL_TIM_ENABLE_IT(&t6_handle, TIM_IT_UPDATE); + // Calculate a 1ms period + uint32_t source = stm_peripherals_timer_get_source_freq(tim_instance); + uint32_t prescaler = source/1000000; // 1us intervals + + stm_peripherals_timer_preinit(tim_instance, 4, pulsein_timer_event_handler); + + // Set the new period + tim_handle.Instance = tim_instance; + tim_handle.Init.Prescaler = prescaler; // divide down to 1mhz + tim_handle.Init.Period = 0xffff; + HAL_TIM_Base_Init(&tim_handle); + + // Set registers manually + tim_handle.Instance->SR = 0; // Prevent the SR from triggering an interrupt + tim_handle.Instance->CR1 |= TIM_CR1_CEN; // Resume timer + tim_handle.Instance->CR1 |= TIM_CR1_URS; // Disable non-overflow interrupts + __HAL_TIM_ENABLE_IT(&tim_handle, TIM_IT_UPDATE); overflow_count = 0; } // Add to active PulseIns refcount++; -#endif // EXTI pins can also be read as an input GPIO_InitTypeDef GPIO_InitStruct = {0}; @@ -189,9 +190,7 @@ void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) { refcount--; if (refcount == 0) { - #if HAS_BASIC_TIM - __HAL_RCC_TIM6_CLK_DISABLE(); - #endif + tim_clock_disable(1<< stm_peripherals_timer_get_index(tim_handle.Instance)); } } @@ -299,23 +298,23 @@ static void assign_EXTI_Interrupt(pulseio_pulsein_obj_t* self, uint8_t num) { void EXTI0_IRQHandler(void) { - pulsein_handler(0); + pulsein_exti_event_handler(0); } void EXTI1_IRQHandler(void) { - pulsein_handler(1); + pulsein_exti_event_handler(1); } void EXTI2_IRQHandler(void) { - pulsein_handler(2); + pulsein_exti_event_handler(2); } void EXTI3_IRQHandler(void) { - pulsein_handler(3); + pulsein_exti_event_handler(3); } void EXTI4_IRQHandler(void) { - pulsein_handler(4); + pulsein_exti_event_handler(4); } void EXTI9_5_IRQHandler(void) @@ -323,7 +322,7 @@ void EXTI9_5_IRQHandler(void) uint32_t pending = EXTI->PR; for (uint i = 5; i <= 9; i++) { if(pending & (1 << i)) { - pulsein_handler(i); + pulsein_exti_event_handler(i); } } } @@ -333,7 +332,7 @@ void EXTI15_10_IRQHandler(void) uint32_t pending = EXTI->PR; for (uint i = 10; i <= 15; i++) { if(pending & (1 << i)) { - pulsein_handler(i); + pulsein_exti_event_handler(i); } } } diff --git a/ports/stm/common-hal/pulseio/PulseOut.c b/ports/stm/common-hal/pulseio/PulseOut.c index c31b238304..ba817ae263 100644 --- a/ports/stm/common-hal/pulseio/PulseOut.c +++ b/ports/stm/common-hal/pulseio/PulseOut.c @@ -37,19 +37,19 @@ #include STM32_HAL_H #include "common-hal/microcontroller/Pin.h" +#include "timers.h" // A single timer is shared amongst all PulseOut objects under the assumption that // the code is single threaded. STATIC uint8_t refcount = 0; - STATIC uint16_t *pulse_array = NULL; STATIC volatile uint16_t pulse_array_index = 0; STATIC uint16_t pulse_array_length; - //Timer is shared, must be accessible by interrupt -STATIC TIM_HandleTypeDef t7_handle; +STATIC TIM_HandleTypeDef tim_handle; pulseio_pulseout_obj_t *curr_pulseout = NULL; + STATIC void turn_on(pulseio_pulseout_obj_t *pulseout) { // Turn on PWM HAL_TIM_PWM_Start(&(pulseout->pwmout->handle), pulseout->pwmout->channel); @@ -65,88 +65,79 @@ STATIC void turn_off(pulseio_pulseout_obj_t *pulseout) { STATIC void start_timer(void) { // Set the new period - t7_handle.Init.Period = pulse_array[pulse_array_index] - 1; - HAL_TIM_Base_Init(&t7_handle); + tim_handle.Init.Period = pulse_array[pulse_array_index] - 1; + HAL_TIM_Base_Init(&tim_handle); // TIM7 has limited HAL support, set registers manually - t7_handle.Instance->SR = 0; // Prevent the SR from triggering an interrupt - t7_handle.Instance->CR1 |= TIM_CR1_CEN; // Resume timer - t7_handle.Instance->CR1 |= TIM_CR1_URS; // Disable non-overflow interrupts - __HAL_TIM_ENABLE_IT(&t7_handle, TIM_IT_UPDATE); + tim_handle.Instance->SR = 0; // Prevent the SR from triggering an interrupt + tim_handle.Instance->CR1 |= TIM_CR1_CEN; // Resume timer + tim_handle.Instance->CR1 |= TIM_CR1_URS; // Disable non-overflow interrupts + __HAL_TIM_ENABLE_IT(&tim_handle, TIM_IT_UPDATE); } STATIC void pulseout_event_handler(void) { - if (curr_pulseout->pwmout == NULL) { - return; //invalid interrupt + // Detect TIM Update event + if (__HAL_TIM_GET_FLAG(&tim_handle, TIM_FLAG_UPDATE) != RESET) + { + if (__HAL_TIM_GET_IT_SOURCE(&tim_handle, TIM_IT_UPDATE) != RESET) + { + __HAL_TIM_CLEAR_IT(&tim_handle, TIM_IT_UPDATE); + if (curr_pulseout->pwmout == NULL) { + return; //invalid interrupt + } + + pulse_array_index++; + + // No more pulses. Turn off output and don't restart. + if (pulse_array_index >= pulse_array_length) { + turn_off(curr_pulseout); + return; + } + + // Alternate on and off, starting with on. + if (pulse_array_index % 2 == 0) { + turn_on(curr_pulseout); + } else { + turn_off(curr_pulseout); + } + + // Count up to the next given value. + start_timer(); + } } - - pulse_array_index++; - - // No more pulses. Turn off output and don't restart. - if (pulse_array_index >= pulse_array_length) { - turn_off(curr_pulseout); - return; - } - - // Alternate on and off, starting with on. - if (pulse_array_index % 2 == 0) { - turn_on(curr_pulseout); - } else { - turn_off(curr_pulseout); - } - - // Count up to the next given value. - start_timer(); } void pulseout_reset() { - #if HAS_BASIC_TIM - __HAL_RCC_TIM7_CLK_DISABLE(); + stm_peripherals_timer_free(tim_handle.Instance); refcount = 0; - #endif } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, const pulseio_pwmout_obj_t* carrier) { -#if !(HAS_BASIC_TIM) - mp_raise_NotImplementedError(translate("PulseOut not supported on this chip")); -#else // Add to active PulseOuts refcount++; + TIM_TypeDef * tim_instance = stm_peripherals_find_timer(); + stm_peripherals_timer_reserve(tim_instance); - // Calculate a 1 ms period - uint32_t source, clk_div; - source = HAL_RCC_GetPCLK1Freq(); // TIM7 is on APB1 - clk_div = RCC->CFGR & RCC_CFGR_PPRE1; - // APB quirk, see See DM00031020 Rev 4, page 115. - if (clk_div != 0) { - // APB prescaler for this timer is > 1 - source *= 2; - } - + //calculate a 1ms period + uint32_t source = stm_peripherals_timer_get_source_freq(tim_instance); uint32_t prescaler = source/1000000; //1us intervals - __HAL_RCC_TIM7_CLK_ENABLE(); - HAL_NVIC_SetPriority(TIM7_IRQn, 4, 0); - HAL_NVIC_EnableIRQ(TIM7_IRQn); + stm_peripherals_timer_preinit(tim_instance, 4, pulseout_event_handler); + tim_handle.Instance = tim_instance; + tim_handle.Init.Period = 100; //immediately replaced. + tim_handle.Init.Prescaler = prescaler - 1; + tim_handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + tim_handle.Init.CounterMode = TIM_COUNTERMODE_UP; + tim_handle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; - // Timers 6 and 7 have no pins, so using them doesn't affect PWM availability - t7_handle.Instance = TIM7; - t7_handle.Init.Period = 100; //immediately replaced. - t7_handle.Init.Prescaler = prescaler - 1; - t7_handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - t7_handle.Init.CounterMode = TIM_COUNTERMODE_UP; - t7_handle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; - - HAL_TIM_Base_Init(&t7_handle); - t7_handle.Instance->SR = 0; + HAL_TIM_Base_Init(&tim_handle); + tim_handle.Instance->SR = 0; // The HAL can't work with const, recast required. self->pwmout = (pulseio_pwmout_obj_t*)carrier; - turn_off(self); -#endif } bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t* self) { @@ -162,9 +153,7 @@ void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t* self) { refcount--; if (refcount == 0) { - #if HAS_BASIC_TIM - __HAL_RCC_TIM7_CLK_DISABLE(); - #endif + tim_clock_disable(1<< stm_peripherals_timer_get_index(tim_handle.Instance)); } } @@ -187,24 +176,11 @@ void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t* self, uint16_t* pu // signal. RUN_BACKGROUND_TASKS; - // Use when debugging, or issues are irrecoverable + // // Use when debugging, or issues are irrecoverable // if ((supervisor_ticks_ms64() - starttime ) > timeout ) { // mp_raise_RuntimeError(translate("Error: Send Timeout")); // } } //turn off timer counter. - t7_handle.Instance->CR1 &= ~TIM_CR1_CEN; -} - -void TIM7_IRQHandler(void) -{ - // Detect TIM Update event - if (__HAL_TIM_GET_FLAG(&t7_handle, TIM_FLAG_UPDATE) != RESET) - { - if (__HAL_TIM_GET_IT_SOURCE(&t7_handle, TIM_IT_UPDATE) != RESET) - { - __HAL_TIM_CLEAR_IT(&t7_handle, TIM_IT_UPDATE); - pulseout_event_handler(); - } - } + tim_handle.Instance->CR1 &= ~TIM_CR1_CEN; } diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 7b720d1564..3b3a21bd24 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -4,8 +4,8 @@ INTERNAL_LIBM ?= 1 USB_SERIAL_NUMBER_LENGTH ?= 24 ifeq ($(MCU_VARIANT),STM32F405xx) - CIRCUITPY_FRAMEBUFFERIO ?= 1 - CIRCUITPY_RGBMATRIX ?= 1 + CIRCUITPY_FRAMEBUFFERIO ?= 0 + CIRCUITPY_RGBMATRIX ?= 0 endif ifeq ($(MCU_SERIES),F4) diff --git a/ports/stm/peripherals/timers.c b/ports/stm/peripherals/timers.c index 81242f34b6..f28b36eec7 100644 --- a/ports/stm/peripherals/timers.c +++ b/ports/stm/peripherals/timers.c @@ -23,20 +23,51 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#include "timers.h" + +#include "py/mpconfig.h" +#include "py/gc.h" +#include "py/obj.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +#include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" + +#define ALL_CLOCKS 0xFFFF static bool stm_timer_reserved[MP_ARRAY_SIZE(mcu_tim_banks)]; static bool stm_timer_never_reset[MP_ARRAY_SIZE(mcu_tim_banks)]; -static void *stm_timer_callback[MP_ARRAY_SIZE(mcu_tim_banks)](void); - -STATIC void tim_clock_enable(uint16_t mask); -STATIC void tim_clock_disable(uint16_t mask); +static void (*stm_timer_callback[MP_ARRAY_SIZE(mcu_tim_banks)])(void); +static size_t irq_map[] = { + TIM1_CC_IRQn, + TIM2_IRQn, + TIM3_IRQn, + TIM4_IRQn, + TIM5_IRQn, + TIM6_DAC_IRQn, + TIM7_IRQn, + TIM8_CC_IRQn, + TIM1_BRK_TIM9_IRQn, + TIM1_UP_TIM10_IRQn, + TIM1_TRG_COM_TIM11_IRQn, + TIM8_BRK_TIM12_IRQn, + TIM8_UP_TIM13_IRQn, + TIM8_TRG_COM_TIM14_IRQn, +#if (CPY_STM32H7) + TIM15_IRQn, + TIM16_IRQn, + TIM17_IRQn, +#endif +}; // 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. -STATIC uint32_t timer_get_source_freq(uint32_t tim_id) { +uint32_t stm_peripherals_timer_get_source_freq(TIM_TypeDef * timer) { + size_t tim_id = stm_peripherals_timer_get_index(timer); uint32_t source, clk_div; if (tim_id == 1 || (8 <= tim_id && tim_id <= 11)) { // TIM{1,8,9,10,11} are on APB2 @@ -54,11 +85,44 @@ STATIC uint32_t timer_get_source_freq(uint32_t tim_id) { return source; } +void timers_reset(void) { + uint16_t never_reset_mask = 0x00; + for (size_t i = 0; i < MP_ARRAY_SIZE(mcu_tim_banks); i++) { + if (!stm_timer_never_reset[i]) { + stm_timer_reserved[i] = false; + } else { + never_reset_mask |= 1 << i; + } + } + tim_clock_disable(ALL_CLOCKS & ~(never_reset_mask)); +} + TIM_TypeDef * stm_peripherals_find_timer(void) { - // TODO: check for unreserved timers from already claimed pins + // Check for timers on pins outside the package size + // for (size_t i = 0; i < MP_ARRAY_SIZE(mcu_tim_banks); i++) { + // bool timer_in_package = false; + // // Find each timer instance on the given bank + // for (size_t j = 0; j < MP_ARRAY_SIZE(mcu_tim_pin_list); j++) { + // // If a pin is claimed, we skip it + // if ( (mcu_tim_pin_list[j].tim_index == i) + // && (common_hal_mcu_pin_is_free(mcu_tim_pin_list[j].pin) == true) ) { + // // Search whether any pins in the package array match it + // for (size_t k = 0; k < mcu_pin_globals.map.alloc; k++) { + // if ( (mcu_tim_pin_list[j].pin == (mcu_pin_obj_t*)(mcu_pin_globals.map.table[k].value)) ) { + // timer_in_package = true; + // } + // } + // } + // } + // // If no results are found, no unclaimed pins with this timer are in this package, + // // and it is safe to pick + // if (timer_in_package == false && mcu_tim_banks[i] != NULL) { + // return mcu_tim_banks[i]; + // } + // } // Work backwards - higher index timers have fewer pin allocations - for (size_t i = MP_ARRAY_SIZE(stm_timer_reserved); i>=0; i--) { + for (size_t i = (MP_ARRAY_SIZE(mcu_tim_banks) - 1); i>=0; i--) { if ((!stm_timer_reserved[i]) && (mcu_tim_banks[i] != NULL)) { return mcu_tim_banks[i]; } @@ -67,20 +131,58 @@ TIM_TypeDef * stm_peripherals_find_timer(void) { return NULL; } +void stm_peripherals_timer_preinit(TIM_TypeDef * instance, uint8_t prio, void (*callback)(void)) { + size_t tim_idx = stm_peripherals_timer_get_index(instance); + stm_timer_callback[tim_idx] = callback; + tim_clock_enable(1 << tim_idx); + HAL_NVIC_SetPriority(irq_map[tim_idx], prio, 0); + HAL_NVIC_EnableIRQ(irq_map[tim_idx]); +} + +void stm_peripherals_timer_reserve(TIM_TypeDef * instance) { + size_t tim_idx = stm_peripherals_timer_get_index(instance); + stm_timer_reserved[tim_idx] = true; +} + void stm_peripherals_timer_set_callback(void(*callback)(void), TIM_TypeDef * timer) { - stm_timer_callback[stm_peripherals_timer_get_index] + stm_timer_callback[stm_peripherals_timer_get_index(timer)] = callback; } void stm_peripherals_timer_free(TIM_TypeDef * instance) { - + size_t tim_idx = stm_peripherals_timer_get_index(instance); + stm_timer_callback[tim_idx] = NULL; + tim_clock_disable(1 << tim_idx); + stm_timer_reserved[tim_idx] = false; + stm_timer_never_reset[tim_idx] = false; } -void stm_peripherals_timer_never_reset(TIM_TypeDef * instance); -void stm_peripherals_timer_reset_ok(TIM_TypeDef * instance); -void stm_peripherals_timer_is_never_reset(TIM_TypeDef * instance); -void stm_peripherals_timer_is_reserved(TIM_TypeDef * instance); -size_t stm_peripherals_timer_get_index(TIM_TypeDef * instance); -STATIC void tim_clock_enable(uint16_t mask) { +void stm_peripherals_timer_never_reset(TIM_TypeDef * instance) { + size_t tim_idx = stm_peripherals_timer_get_index(instance); + stm_timer_never_reset[tim_idx] = true; +} +void stm_peripherals_timer_reset_ok(TIM_TypeDef * instance) { + size_t tim_idx = stm_peripherals_timer_get_index(instance); + stm_timer_never_reset[tim_idx] = false; +} +bool stm_peripherals_timer_is_never_reset(TIM_TypeDef * instance){ + size_t tim_idx = stm_peripherals_timer_get_index(instance); + return stm_timer_never_reset[tim_idx]; +} +bool stm_peripherals_timer_is_reserved(TIM_TypeDef * instance) { + size_t tim_idx = stm_peripherals_timer_get_index(instance); + return stm_timer_reserved[tim_idx]; +} + +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]) { + return i; + } + } + return ~(size_t)0; +} + +void tim_clock_enable(uint16_t mask) { #ifdef TIM1 if (mask & (1 << 0)) { __HAL_RCC_TIM1_CLK_ENABLE(); @@ -144,7 +246,7 @@ STATIC void tim_clock_enable(uint16_t mask) { #endif } -STATIC void tim_clock_disable(uint16_t mask) { +void tim_clock_disable(uint16_t mask) { #ifdef TIM1 if (mask & (1 << 0)) { __HAL_RCC_TIM1_CLK_DISABLE(); @@ -209,8 +311,8 @@ STATIC void tim_clock_disable(uint16_t mask) { } STATIC void callback_router(size_t index) { - if (stm_timer_callback[index]) { - (*stm_timer_callback[index])(); + if (stm_timer_callback[index - 1]) { + (*stm_timer_callback[index - 1])(); } } diff --git a/ports/stm/peripherals/timers.h b/ports/stm/peripherals/timers.h index b0f594b775..8c8a80d53c 100644 --- a/ports/stm/peripherals/timers.h +++ b/ports/stm/peripherals/timers.h @@ -24,17 +24,30 @@ * THE SOFTWARE. */ -typedef struct { - TIM_TypeDef * p_reg; - uint8_t instance_id; - uint8_t cc_channel_count; -} nrfx_timer_t; +// typedef struct { +// TIM_TypeDef * timer; +// bool reserved; +// bool never_reset; +// void (*stm_timer_callback)(void); +// size_t irq; +// } stm_timer_t; +#include +#include "py/mphal.h" +#include "peripherals/periph.h" + +#include STM32_HAL_H + +void tim_clock_enable(uint16_t mask); +void tim_clock_disable(uint16_t mask); +uint32_t stm_peripherals_timer_get_source_freq(TIM_TypeDef * timer); void timers_reset(void); TIM_TypeDef * stm_peripherals_find_timer(void); +void stm_peripherals_timer_preinit(TIM_TypeDef * instance, uint8_t prio, void (*callback)(void)); +void stm_peripherals_timer_reserve(TIM_TypeDef * instance); void stm_peripherals_timer_free(TIM_TypeDef * instance); void stm_peripherals_timer_never_reset(TIM_TypeDef * instance); void stm_peripherals_timer_reset_ok(TIM_TypeDef * instance); -void stm_peripherals_timer_is_never_reset(TIM_TypeDef * instance); -void stm_peripherals_timer_is_reserved(TIM_TypeDef * instance); +bool stm_peripherals_timer_is_never_reset(TIM_TypeDef * instance); +bool stm_peripherals_timer_is_reserved(TIM_TypeDef * instance); size_t stm_peripherals_timer_get_index(TIM_TypeDef * instance); diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 07a93c025b..7c9fcf750e 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -41,6 +41,7 @@ #include "common-hal/pulseio/PWMOut.h" #include "common-hal/pulseio/PulseOut.h" #include "common-hal/pulseio/PulseIn.h" +#include "timers.h" #endif #include "clocks.h" @@ -224,6 +225,7 @@ void reset_port(void) { uart_reset(); #endif #if CIRCUITPY_PULSEIO + timers_reset(); pwmout_reset(); pulseout_reset(); pulsein_reset(); From 783846c6057f96999687c5895bef97b28e47e1fa Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 1 Jul 2020 10:00:28 -0500 Subject: [PATCH 0147/1293] ulab: update to 0.51.1 --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index 0394801933..48cb939839 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 0394801933f6e68a5bc7cdb0da76c7884e8cf70a +Subproject commit 48cb939839fcf091fcdcdf742530b1b650066a15 From e33accae4d8439dbab0764d98e6f188c9489eb06 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 1 Jul 2020 10:15:09 -0500 Subject: [PATCH 0148/1293] ulab: document sosfilt --- shared-bindings/ulab/filter/__init__.pyi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/shared-bindings/ulab/filter/__init__.pyi b/shared-bindings/ulab/filter/__init__.pyi index fff404300b..5e7202e06c 100644 --- a/shared-bindings/ulab/filter/__init__.pyi +++ b/shared-bindings/ulab/filter/__init__.pyi @@ -17,3 +17,20 @@ def convolve(r, c=None): Convolution is most time-efficient when both inputs are of float type.""" ... + +def sosfilt(sos : ulab.array, x : ulab.array, *, xi : Optional[ulab.array] = None) -> Union[ulab.array, Tuple[ulab.array, ulab.array]]: + """ + :param ulab.array sos: Array of second-order filter coefficients, must have shape (n_sections, 6). Each row corresponds to a second-order section, with the first three columns providing the numerator coefficients and the last three providing the denominator coefficients. + :param ulab.array x: The data to be filtered + :param ulab.array zi: Optional initial conditions for the filter + + :return: If ``xi`` is not specified, the filter result alone is returned. If ``xi`` is specified, the return value is a 2-tuple of the filter result and the final filter conditions. + + Filter data along one dimension using cascaded second-order sections. + + Filter a data sequence, x, using a digital IIR filter defined by sos. + + The filter function is implemented as a series of second-order filters with direct-form II transposed structure. It is designed to minimize numerical precision errors for high-order filters. + + Filter coefficients can be generated by using scipy's filter generators such as ``signal.ellip(..., output='sos')``.""" + ... From 48bc4bd5d6159c55ebe4c4ef6f517d794a054502 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 1 Jul 2020 10:33:38 -0500 Subject: [PATCH 0149/1293] make translate --- locale/circuitpython.pot | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 3a3b159a04..7141cc8722 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3009,6 +3009,10 @@ msgstr "" msgid "sleep length must be non-negative" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "" @@ -3025,6 +3029,18 @@ msgstr "" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3314,3 +3330,15 @@ msgstr "" #: py/objrange.c msgid "zero step" msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" From b80dbb4b2c0437b5ab3eece24a271f460f7d21c3 Mon Sep 17 00:00:00 2001 From: svgops Date: Wed, 1 Jul 2020 12:06:59 -0600 Subject: [PATCH 0150/1293] add-ndgarage_ndbit6_v2 --- .../boards/ndgarage_ndbit6/mpconfigboard.h | 19 ++----- .../atmel-samd/boards/ndgarage_ndbit6/pins.c | 50 +++++++++---------- 2 files changed, 28 insertions(+), 41 deletions(-) diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h index 51be8d7c06..ed2d779f5b 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h +++ b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h @@ -1,13 +1,8 @@ -#define MICROPY_HW_BOARD_NAME "ndGarage[n°]Bit6:FeatherSnow" +#define MICROPY_HW_BOARD_NAME "ndGarage[n°]Bit6:FeatherSnow-v2" #define MICROPY_HW_MCU_NAME "samd21e18" #define MICROPY_HW_LED_STATUS (&pin_PA23) -#define SPI_FLASH_MOSI_PIN &pin_PA16 -#define SPI_FLASH_MISO_PIN &pin_PA18 -#define SPI_FLASH_SCK_PIN &pin_PA17 -#define SPI_FLASH_CS_PIN &pin_PA15 - #define MICROPY_PORT_A (PORT_PA24 | PORT_PA25) #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) @@ -16,15 +11,11 @@ #define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 CIRCUITPY_INTERNAL_NVM_SIZE) -#define DEFAULT_I2C_BUS_SCL (&pin_PA09) -#define DEFAULT_I2C_BUS_SDA (&pin_PA08) +#define DEFAULT_I2C_BUS_SCL (&pin_PA17) +#define DEFAULT_I2C_BUS_SDA (&pin_PA16) -#define DEFAULT_SPI_BUS_SCK (&pin_PA05) -#define DEFAULT_SPI_BUS_MOSI (&pin_PA04) -#define DEFAULT_SPI_BUS_MISO (&pin_PA06) - -#define DEFAULT_UART_BUS_RX (&pin_PA09) -#define DEFAULT_UART_BUS_TX (&pin_PA08) +#define DEFAULT_UART_BUS_RX (&pin_PA17) +#define DEFAULT_UART_BUS_TX (&pin_PA16) // USB is always used. #define IGNORE_PIN_PA24 1 diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c b/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c index 2ea5630079..562684fd8c 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c +++ b/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c @@ -1,39 +1,35 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA11) }, - { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA22) }, - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA28) }, - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA23) }, - { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PA27) }, - { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA27) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PA28) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_PA19) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA17) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA09) }, - - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_PA23) }, { 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_global_dict_table); From c759c9a2aab89040b20aa4af43744987a569b14d Mon Sep 17 00:00:00 2001 From: ndgarage Date: Wed, 1 Jul 2020 13:58:07 -0600 Subject: [PATCH 0151/1293] add-ndgarage_ndbit6_v2-update --- .github/workflows/build.yml | 1 + .../boards/ndgarage_ndbit6_v2/board.c | 39 +++++++++++++++++++ .../boards/ndgarage_ndbit6_v2/mpconfigboard.h | 22 +++++++++++ .../ndgarage_ndbit6_v2/mpconfigboard.mk | 14 +++++++ .../boards/ndgarage_ndbit6_v2/pins.c | 35 +++++++++++++++++ 5 files changed, 111 insertions(+) create mode 100644 ports/atmel-samd/boards/ndgarage_ndbit6_v2/board.c create mode 100644 ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/ndgarage_ndbit6_v2/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00454cc2da..4c74df3391 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -204,6 +204,7 @@ jobs: - "mini_sam_m4" - "monster_m4sk" - "ndgarage_ndbit6" + - "ndgarage_ndbit6_v2" - "nfc_copy_cat" - "nice_nano" - "nucleo_f746zg" diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/board.c b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/board.c new file mode 100644 index 0000000000..0f60736a24 --- /dev/null +++ b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/board.c @@ -0,0 +1,39 @@ +/* + * 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 "boards/board.h" +#include "mpconfigboard.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.h b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.h new file mode 100644 index 0000000000..ed2d779f5b --- /dev/null +++ b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.h @@ -0,0 +1,22 @@ +#define MICROPY_HW_BOARD_NAME "ndGarage[n°]Bit6:FeatherSnow-v2" +#define MICROPY_HW_MCU_NAME "samd21e18" + +#define MICROPY_HW_LED_STATUS (&pin_PA23) + +#define MICROPY_PORT_A (PORT_PA24 | PORT_PA25) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define CIRCUITPY_INTERNAL_NVM_SIZE 256 + +#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 CIRCUITPY_INTERNAL_NVM_SIZE) + +#define DEFAULT_I2C_BUS_SCL (&pin_PA17) +#define DEFAULT_I2C_BUS_SDA (&pin_PA16) + +#define DEFAULT_UART_BUS_RX (&pin_PA17) +#define DEFAULT_UART_BUS_TX (&pin_PA16) + +// USB is always used. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk new file mode 100644 index 0000000000..09804bc4e7 --- /dev/null +++ b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk @@ -0,0 +1,14 @@ +LD_FILE = boards/samd21x18-bootloader.ld +USB_VID = 0x239A +USB_PID = 0x8066 +USB_PRODUCT = "Bit6" +USB_MANUFACTURER = "ndGarage" + +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE +CIRCUITPY_FULL_BUILD = 0 + +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/pins.c b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/pins.c new file mode 100644 index 0000000000..562684fd8c --- /dev/null +++ b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/pins.c @@ -0,0 +1,35 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA27) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PA28) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_PA19) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA17) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA16) }, + + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_PA23) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 0537f4e77543130b7b1962774a656cf7997d3c2c Mon Sep 17 00:00:00 2001 From: ndgarage Date: Wed, 1 Jul 2020 14:12:52 -0600 Subject: [PATCH 0152/1293] restore-ndgarage_ndbit6-to-original --- .../boards/ndgarage_ndbit6/mpconfigboard.h | 20 ++++++-- .../atmel-samd/boards/ndgarage_ndbit6/pins.c | 51 ++++++++++--------- 2 files changed, 43 insertions(+), 28 deletions(-) diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h index ed2d779f5b..869f207a16 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h +++ b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h @@ -1,8 +1,13 @@ -#define MICROPY_HW_BOARD_NAME "ndGarage[n°]Bit6:FeatherSnow-v2" +#define MICROPY_HW_BOARD_NAME "ndGarage[n°]Bit6:FeatherSnow" #define MICROPY_HW_MCU_NAME "samd21e18" #define MICROPY_HW_LED_STATUS (&pin_PA23) +#define SPI_FLASH_MOSI_PIN &pin_PA16 +#define SPI_FLASH_MISO_PIN &pin_PA18 +#define SPI_FLASH_SCK_PIN &pin_PA17 +#define SPI_FLASH_CS_PIN &pin_PA15 + #define MICROPY_PORT_A (PORT_PA24 | PORT_PA25) #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) @@ -11,12 +16,17 @@ #define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 CIRCUITPY_INTERNAL_NVM_SIZE) -#define DEFAULT_I2C_BUS_SCL (&pin_PA17) -#define DEFAULT_I2C_BUS_SDA (&pin_PA16) +#define DEFAULT_I2C_BUS_SCL (&pin_PA09) +#define DEFAULT_I2C_BUS_SDA (&pin_PA08) -#define DEFAULT_UART_BUS_RX (&pin_PA17) -#define DEFAULT_UART_BUS_TX (&pin_PA16) +#define DEFAULT_SPI_BUS_SCK (&pin_PA05) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA04) +#define DEFAULT_SPI_BUS_MISO (&pin_PA06) + +#define DEFAULT_UART_BUS_RX (&pin_PA09) +#define DEFAULT_UART_BUS_TX (&pin_PA08) // USB is always used. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 + diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c b/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c index 562684fd8c..8b3898b185 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c +++ b/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c @@ -1,35 +1,40 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA27) }, - { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA18) }, - { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA23) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PA11) }, - { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PA22) }, - { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PA28) }, - { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA28) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PA27) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA16) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA17) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA09) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_PA23) }, { 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_global_dict_table); + From 367d3800fc501bfe3ec05b4b517ed195cf8d07c4 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 1 Jul 2020 14:35:25 -0700 Subject: [PATCH 0153/1293] Return false if we already have the lock --- ports/esp32s2/common-hal/busio/I2C.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/esp32s2/common-hal/busio/I2C.c index 74b3896fc2..57270372f1 100644 --- a/ports/esp32s2/common-hal/busio/I2C.c +++ b/ports/esp32s2/common-hal/busio/I2C.c @@ -163,6 +163,9 @@ bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) { } bool common_hal_busio_i2c_try_lock(busio_i2c_obj_t *self) { + if (self->has_lock) { + return false; + } self->has_lock = xSemaphoreTake(&self->semaphore, 0) == pdTRUE; return self->has_lock; } From 87d58b3b0a7b9d1c67e3234680a14a18ca55189c Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 1 Jul 2020 17:48:10 -0400 Subject: [PATCH 0154/1293] STM32: add debug flags, fix hang in simplex SPI --- ports/stm/Makefile | 4 ++-- ports/stm/common-hal/busio/SPI.c | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ports/stm/Makefile b/ports/stm/Makefile index 08cb36ddf2..a982de765b 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -81,12 +81,12 @@ INC += -I../../supervisor/shared/usb #Debugging/Optimization ifeq ($(DEBUG), 1) - CFLAGS += -ggdb + CFLAGS += -ggdb3 # You may want to enable these flags to make setting breakpoints easier. CFLAGS += -fno-inline -fno-ipa-sra else CFLAGS += -Os -DNDEBUG - CFLAGS += -ggdb + CFLAGS += -ggdb3 # TODO: Test with -flto # CFLAGS += -flto endif diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index 65eeb8ebcf..380302da65 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -238,8 +238,11 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->handle.Instance = SPIx; self->handle.Init.Mode = SPI_MODE_MASTER; - // Direction change only required for RX-only, see RefMan RM0090:884 - self->handle.Init.Direction = (self->mosi == NULL) ? SPI_DIRECTION_2LINES_RXONLY : SPI_DIRECTION_2LINES; + // Implementing one-directional recieve-only SPI as per [RefMan RM0090:884] + // results in BSY bit related hangs. Using MOSI as an IO works fine without it, + // so it's unclear why this mode is present in the first place. + //self->handle.Init.Direction = (self->mosi == NULL) ? SPI_DIRECTION_2LINES_RXONLY : SPI_DIRECTION_2LINES; + self->handle.Init.Direction = SPI_DIRECTION_2LINES; self->handle.Init.DataSize = SPI_DATASIZE_8BIT; self->handle.Init.CLKPolarity = SPI_POLARITY_LOW; self->handle.Init.CLKPhase = SPI_PHASE_1EDGE; From a301a9d9b12b69284a6f21e365505a96295e0743 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 1 Jul 2020 23:21:09 +0200 Subject: [PATCH 0155/1293] 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 | 30 +++++++++++++++++++++++++++++- locale/cs.po | 30 +++++++++++++++++++++++++++++- locale/de_DE.po | 30 +++++++++++++++++++++++++++++- locale/es.po | 30 +++++++++++++++++++++++++++++- locale/fil.po | 30 +++++++++++++++++++++++++++++- locale/fr.po | 30 +++++++++++++++++++++++++++++- locale/it_IT.po | 30 +++++++++++++++++++++++++++++- locale/ko.po | 30 +++++++++++++++++++++++++++++- locale/nl.po | 30 +++++++++++++++++++++++++++++- locale/pl.po | 30 +++++++++++++++++++++++++++++- locale/pt_BR.po | 34 +++++++++++++++++++++++++++++++--- locale/sv.po | 30 +++++++++++++++++++++++++++++- locale/zh_Latn_pinyin.po | 30 +++++++++++++++++++++++++++++- 13 files changed, 379 insertions(+), 15 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 8d89115d7a..da4f7b904b 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3034,6 +3034,10 @@ msgstr "" msgid "sleep length must be non-negative" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "" @@ -3050,6 +3054,18 @@ msgstr "memulai ulang software(soft reboot)\n" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3341,6 +3357,18 @@ msgstr "" msgid "zero step" msgstr "" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "AP required" #~ msgstr "AP dibutuhkan" diff --git a/locale/cs.po b/locale/cs.po index 3869cd45ab..9029985397 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -3017,6 +3017,10 @@ msgstr "" msgid "sleep length must be non-negative" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "" @@ -3033,6 +3037,18 @@ msgstr "" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3322,3 +3338,15 @@ msgstr "" #: py/objrange.c msgid "zero step" msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 567a2f8ba2..3b7c49b396 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -3100,6 +3100,10 @@ msgstr "Größe ist nur für ndarrays definiert" msgid "sleep length must be non-negative" msgstr "Die Schlafdauer darf nicht negativ sein" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "Der Slice-Schritt kann nicht Null sein" @@ -3116,6 +3120,18 @@ msgstr "weicher reboot\n" msgid "sort argument must be an ndarray" msgstr "sortierungs Argument muss ein ndarray sein" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start/end Indizes" @@ -3411,6 +3427,18 @@ msgstr "y Wert außerhalb der Grenzen" msgid "zero step" msgstr "Nullschritt" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "AP required" #~ msgstr "AP erforderlich" diff --git a/locale/es.po b/locale/es.po index aad07ddf4f..9034024068 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2020-06-29 13:13+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -3072,6 +3072,10 @@ msgstr "" msgid "sleep length must be non-negative" msgstr "la longitud de sleep no puede ser negativa" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "slice step no puede ser cero" @@ -3088,6 +3092,18 @@ msgstr "reinicio suave\n" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "índices inicio/final" @@ -3381,6 +3397,18 @@ msgstr "address fuera de límites" msgid "zero step" msgstr "paso cero" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "AP required" #~ msgstr "AP requerido" diff --git a/locale/fil.po b/locale/fil.po index 4f155ecc58..ff5cc6426d 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -3063,6 +3063,10 @@ msgstr "" msgid "sleep length must be non-negative" msgstr "sleep length ay dapat hindi negatibo" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "slice step ay hindi puedeng 0" @@ -3079,6 +3083,18 @@ msgstr "malambot na reboot\n" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start/end indeks" @@ -3373,6 +3389,18 @@ msgstr "wala sa sakop ang address" msgid "zero step" msgstr "zero step" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "AP required" #~ msgstr "AP kailangan" diff --git a/locale/fr.po b/locale/fr.po index 392b779894..7facdef043 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" "Language: fr\n" @@ -3106,6 +3106,10 @@ msgstr "la taille est définie pour les ndarrays uniquement" msgid "sleep length must be non-negative" msgstr "la longueur de sleep ne doit pas être négative" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "le pas 'step' de la tranche ne peut être zéro" @@ -3122,6 +3126,18 @@ msgstr "redémarrage logiciel\n" msgid "sort argument must be an ndarray" msgstr "l'argument de «sort» doit être un ndarray" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "indices de début/fin" @@ -3413,6 +3429,18 @@ msgstr "valeur y hors limites" msgid "zero step" msgstr "'step' nul" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "AP required" #~ msgstr "'AP' requis" diff --git a/locale/it_IT.po b/locale/it_IT.po index 13651437b7..983b47b824 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -3070,6 +3070,10 @@ msgstr "" msgid "sleep length must be non-negative" msgstr "la lunghezza di sleed deve essere non negativa" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "la step della slice non può essere zero" @@ -3086,6 +3090,18 @@ msgstr "soft reboot\n" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3380,6 +3396,18 @@ msgstr "indirizzo fuori limite" msgid "zero step" msgstr "zero step" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "AP required" #~ msgstr "AP richiesto" diff --git a/locale/ko.po b/locale/ko.po index 73926d47bd..ea3f564700 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -3014,6 +3014,10 @@ msgstr "" msgid "sleep length must be non-negative" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "" @@ -3030,6 +3034,18 @@ msgstr "" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3320,6 +3336,18 @@ msgstr "" msgid "zero step" msgstr "" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "Can't add services in Central mode" #~ msgstr "센트랄(중앙) 모드에서는 서비스를 추가 할 수 없습니다" diff --git a/locale/nl.po b/locale/nl.po index b9fd85e163..12a767b183 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2020-06-02 19:50+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -3073,6 +3073,10 @@ msgstr "omvang is alleen voor ndarrays gedefinieerd" msgid "sleep length must be non-negative" msgstr "de slaapduur mag niet negatief zijn" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "segmentstap mag niet nul zijn" @@ -3089,6 +3093,18 @@ msgstr "zachte herstart\n" msgid "sort argument must be an ndarray" msgstr "sorteerargument moet een ndarray zijn" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start/stop indices" @@ -3379,6 +3395,18 @@ msgstr "y-waarde buiten bereik" msgid "zero step" msgstr "nul-stap" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "I2C operation not supported" #~ msgstr "I2C actie niet ondersteund" diff --git a/locale/pl.po b/locale/pl.po index 1f2e9a61bc..d626e8ebcf 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -3020,6 +3020,10 @@ msgstr "" msgid "sleep length must be non-negative" msgstr "okres snu musi być nieujemny" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "zerowy krok" @@ -3036,6 +3040,18 @@ msgstr "programowy reset\n" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "początkowe/końcowe indeksy" @@ -3326,6 +3342,18 @@ msgstr "y poza zakresem" msgid "zero step" msgstr "zerowy krok" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "Address is not %d bytes long or is in wrong format" #~ msgstr "Adres nie ma długości %d bajtów lub zły format" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index acabdb197e..8094f4a2df 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2020-06-30 17:48+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -1748,8 +1748,8 @@ msgstr "O WatchDogTimer não está em execução" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" -"O WatchDogTimer.mode não pode ser alterado uma vez definido para WatchDogMode" -".RESET" +"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" @@ -3097,6 +3097,10 @@ msgstr "o tamanho é definido apenas para os ndarrays" msgid "sleep length must be non-negative" msgstr "a duração do sleep não deve ser negativo" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "a etapa da fatia não pode ser zero" @@ -3113,6 +3117,18 @@ msgstr "reinicialização soft\n" msgid "sort argument must be an ndarray" msgstr "o argumento da classificação deve ser um ndarray" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "os índices de início/fim" @@ -3403,6 +3419,18 @@ msgstr "o valor y está fora dos limites" msgid "zero step" msgstr "passo zero" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "AP required" #~ msgstr "AP requerido" diff --git a/locale/sv.po b/locale/sv.po index 6a38d35702..f359eba275 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2020-06-03 18:59+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -3066,6 +3066,10 @@ msgstr "storlek är enbart definierad ndarrays" msgid "sleep length must be non-negative" msgstr "värdet för sleep måste vara positivt" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "segmentsteg får inte vara noll" @@ -3082,6 +3086,18 @@ msgstr "mjuk omstart\n" msgid "sort argument must be an ndarray" msgstr "argumentet sort måste vara en ndarray" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start-/slutindex" @@ -3372,6 +3388,18 @@ msgstr "y-värde utanför intervall" msgid "zero step" msgstr "noll steg" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "I2C operation not supported" #~ msgstr "I2C-åtgärd stöds inte" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 1609f672cd..bc9a7253b9 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -3050,6 +3050,10 @@ msgstr "" msgid "sleep length must be non-negative" msgstr "shuìmián chángdù bìxū shìfēi fùshù" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "qiēpiàn bù bùnéng wéi líng" @@ -3066,6 +3070,18 @@ msgstr "ruǎn chóngqǐ\n" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "kāishǐ/jiéshù zhǐshù" @@ -3356,6 +3372,18 @@ msgstr "y zhí chāochū biānjiè" msgid "zero step" msgstr "líng bù" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "Address is not %d bytes long or is in wrong format" #~ msgstr "Dìzhǐ bùshì %d zì jié zhǎng, huòzhě géshì cuòwù" From 75bcd73439bf038a1b88e1b4124059241ea054ff Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Wed, 1 Jul 2020 22:00:10 +0000 Subject: [PATCH 0156/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (777 of 777 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 8094f4a2df..92cf0172d0 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-01 10:33-0500\n" -"PO-Revision-Date: 2020-06-30 17:48+0000\n" +"PO-Revision-Date: 2020-07-02 02:02+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -354,7 +354,7 @@ msgstr "Array deve conter meias palavras (tipo 'H')" #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." -msgstr "Os valores da matriz devem ser bytes simples." +msgstr "Os valores das matrizes devem ser bytes simples." #: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" @@ -3099,7 +3099,7 @@ msgstr "a duração do sleep não deve ser negativo" #: extmod/ulab/code/ndarray.c msgid "slice step can't be zero" -msgstr "" +msgstr "a etapa da fatia não pode ser zero" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" @@ -3119,15 +3119,15 @@ msgstr "o argumento da classificação deve ser um ndarray" #: extmod/ulab/code/filter.c msgid "sos array must be of shape (n_section, 6)" -msgstr "" +msgstr "o sos da matriz deve estar na forma (n_section, 6)" #: extmod/ulab/code/filter.c msgid "sos[:, 3] should be all ones" -msgstr "" +msgstr "sos[:, 3] deve ser um em todos" #: extmod/ulab/code/filter.c msgid "sosfilt requires iterable arguments" -msgstr "" +msgstr "o sosfilt requer que os argumentos sejam iteráveis" #: py/objstr.c msgid "start/end indices" @@ -3421,15 +3421,15 @@ msgstr "passo zero" #: extmod/ulab/code/filter.c msgid "zi must be an ndarray" -msgstr "" +msgstr "zi deve ser um ndarray" #: extmod/ulab/code/filter.c msgid "zi must be of float type" -msgstr "" +msgstr "zi deve ser de um tipo float" #: extmod/ulab/code/filter.c msgid "zi must be of shape (n_section, 2)" -msgstr "" +msgstr "zi deve estar na forma (n_section, 2)" #~ msgid "AP required" #~ msgstr "AP requerido" From f4a24744477abe0d924ef08781d6e30118cc9982 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Thu, 2 Jul 2020 15:24:59 +0200 Subject: [PATCH 0157/1293] spresense: Add support for sdioio --- ports/cxd56/boards/spresense/pins.c | 16 +++ ports/cxd56/common-hal/microcontroller/Pin.c | 6 + ports/cxd56/common-hal/microcontroller/Pin.h | 6 + ports/cxd56/common-hal/sdioio/SDCard.c | 141 +++++++++++++++++++ ports/cxd56/common-hal/sdioio/SDCard.h | 47 +++++++ ports/cxd56/common-hal/sdioio/__init__.c | 0 ports/cxd56/mpconfigport.mk | 3 + 7 files changed, 219 insertions(+) create mode 100644 ports/cxd56/common-hal/sdioio/SDCard.c create mode 100644 ports/cxd56/common-hal/sdioio/SDCard.h create mode 100644 ports/cxd56/common-hal/sdioio/__init__.c diff --git a/ports/cxd56/boards/spresense/pins.c b/ports/cxd56/boards/spresense/pins.c index fcc854590a..5028d91556 100644 --- a/ports/cxd56/boards/spresense/pins.c +++ b/ports/cxd56/boards/spresense/pins.c @@ -24,8 +24,21 @@ * THE SOFTWARE. */ +#include "py/objtuple.h" + #include "shared-bindings/board/__init__.h" +STATIC const mp_rom_obj_tuple_t sdio_data_tuple = { + {&mp_type_tuple}, + 4, + { + MP_ROM_PTR(&pin_SDIO_DATA0), + MP_ROM_PTR(&pin_SDIO_DATA1), + MP_ROM_PTR(&pin_SDIO_DATA2), + MP_ROM_PTR(&pin_SDIO_DATA3), + } +}; + STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_UART2_RXD) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_UART2_TXD) }, @@ -76,5 +89,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_SDIO_CLOCK), MP_ROM_PTR(&pin_SDIO_CLK) }, + { MP_ROM_QSTR(MP_QSTR_SDIO_COMMAND), MP_ROM_PTR(&pin_SDIO_CMD) }, + { MP_ROM_QSTR(MP_QSTR_SDIO_DATA), MP_ROM_PTR(&sdio_data_tuple) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/cxd56/common-hal/microcontroller/Pin.c b/ports/cxd56/common-hal/microcontroller/Pin.c index 23377197c2..7aba1ad54b 100644 --- a/ports/cxd56/common-hal/microcontroller/Pin.c +++ b/ports/cxd56/common-hal/microcontroller/Pin.c @@ -72,6 +72,12 @@ const mcu_pin_obj_t pin_I2S1_BCK = PIN(PIN_I2S1_BCK, false); const mcu_pin_obj_t pin_I2S1_LRCK = PIN(PIN_I2S1_LRCK, false); const mcu_pin_obj_t pin_I2S1_DATA_IN = PIN(PIN_I2S1_DATA_IN, false); const mcu_pin_obj_t pin_I2S1_DATA_OUT = PIN(PIN_I2S1_DATA_OUT, false); +const mcu_pin_obj_t pin_SDIO_CLK = PIN(PIN_SDIO_CLK, false); +const mcu_pin_obj_t pin_SDIO_CMD = PIN(PIN_SDIO_CMD, false); +const mcu_pin_obj_t pin_SDIO_DATA0 = PIN(PIN_SDIO_DATA0, false); +const mcu_pin_obj_t pin_SDIO_DATA1 = PIN(PIN_SDIO_DATA1, false); +const mcu_pin_obj_t pin_SDIO_DATA2 = PIN(PIN_SDIO_DATA2, false); +const mcu_pin_obj_t pin_SDIO_DATA3 = PIN(PIN_SDIO_DATA3, false); const mcu_pin_obj_t pin_LPADC0 = PIN(0, true); const mcu_pin_obj_t pin_LPADC1 = PIN(1, true); const mcu_pin_obj_t pin_LPADC2 = PIN(2, true); diff --git a/ports/cxd56/common-hal/microcontroller/Pin.h b/ports/cxd56/common-hal/microcontroller/Pin.h index fe6524edb5..6759a2dcab 100644 --- a/ports/cxd56/common-hal/microcontroller/Pin.h +++ b/ports/cxd56/common-hal/microcontroller/Pin.h @@ -77,6 +77,12 @@ extern const mcu_pin_obj_t pin_I2S1_BCK; extern const mcu_pin_obj_t pin_I2S1_LRCK; extern const mcu_pin_obj_t pin_I2S1_DATA_IN; extern const mcu_pin_obj_t pin_I2S1_DATA_OUT; +extern const mcu_pin_obj_t pin_SDIO_CLK; +extern const mcu_pin_obj_t pin_SDIO_CMD; +extern const mcu_pin_obj_t pin_SDIO_DATA0; +extern const mcu_pin_obj_t pin_SDIO_DATA1; +extern const mcu_pin_obj_t pin_SDIO_DATA2; +extern const mcu_pin_obj_t pin_SDIO_DATA3; extern const mcu_pin_obj_t pin_LPADC0; extern const mcu_pin_obj_t pin_LPADC1; extern const mcu_pin_obj_t pin_LPADC2; diff --git a/ports/cxd56/common-hal/sdioio/SDCard.c b/ports/cxd56/common-hal/sdioio/SDCard.c new file mode 100644 index 0000000000..cf7de422c1 --- /dev/null +++ b/ports/cxd56/common-hal/sdioio/SDCard.c @@ -0,0 +1,141 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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 +#include +#include + +#include "py/mperrno.h" +#include "py/runtime.h" + +#include "shared-bindings/sdioio/SDCard.h" +#include "shared-bindings/util.h" + +#define DATA_PINS_NUM 4 + +void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, + const mcu_pin_obj_t *clock, const mcu_pin_obj_t *command, + uint8_t num_data, mcu_pin_obj_t **data, uint32_t frequency) { + struct geometry geo; + + if (clock->number != PIN_SDIO_CLK || command->number != PIN_SDIO_CMD) { + mp_raise_ValueError(translate("Invalid pins")); + } + + uint8_t data_pins_num = 0; + for (uint8_t i = 0; i < DATA_PINS_NUM; i++) { + if (data[i]->number != PIN_SDIO_DATA0 || data[i]->number != PIN_SDIO_DATA1 || + data[i]->number != PIN_SDIO_DATA2 || data[i]->number != PIN_SDIO_DATA3) { + data_pins_num++; + } + } + + if (data_pins_num != DATA_PINS_NUM) { + mp_raise_ValueError(translate("Invalid pins")); + } + + if (open_blockdriver("/dev/mmcsd0", 0, &self->inode) < 0) { + mp_raise_ValueError(translate("Could not initialize SDCard")); + } + + self->inode->u.i_bops->geometry(self->inode, &geo); + + claim_pin(clock); + claim_pin(command); + self->clock_pin = clock; + self->command_pin = command; + for (uint8_t i = 0; i < DATA_PINS_NUM; i++) { + claim_pin(data[i]); + self->data_pins[i] = data[i]; + } + + self->count = geo.geo_nsectors; + self->frequency = frequency; + self->width = num_data; +} + +void common_hal_sdioio_sdcard_deinit(sdioio_sdcard_obj_t *self) { + close_blockdriver(self->inode); + self->inode = NULL; + + reset_pin_number(self->clock_pin->number); + reset_pin_number(self->command_pin->number); + for (uint8_t i = 0; i < DATA_PINS_NUM; i++) { + reset_pin_number(self->data_pins[i]->number); + } +} + +bool common_hal_sdioio_sdcard_deinited(sdioio_sdcard_obj_t *self) { + return self->inode == NULL; +} + +bool common_hal_sdioio_sdcard_configure(sdioio_sdcard_obj_t *self, uint32_t baudrate, uint8_t width) { + return true; +} + +uint32_t common_hal_sdioio_sdcard_get_frequency(sdioio_sdcard_obj_t* self) { + return self->frequency; +} + +uint8_t common_hal_sdioio_sdcard_get_width(sdioio_sdcard_obj_t* self) { + return self->width; +} + +uint32_t common_hal_sdioio_sdcard_get_count(sdioio_sdcard_obj_t* self) { + return self->count; +} + +STATIC void check_whole_block(mp_buffer_info_t *bufinfo) { + if (bufinfo->len % 512) { + mp_raise_ValueError(translate("Buffer length must be a multiple of 512")); + } +} + +int common_hal_sdioio_sdcard_readblocks(sdioio_sdcard_obj_t* self, uint32_t start_block, mp_buffer_info_t *bufinfo) { + if (common_hal_sdioio_sdcard_deinited(self)) { + raise_deinited_error(); + } + check_whole_block(bufinfo); + + return self->inode->u.i_bops->read(self->inode, bufinfo->buf, start_block, bufinfo->len / 512); +} + +int common_hal_sdioio_sdcard_writeblocks(sdioio_sdcard_obj_t* self, uint32_t start_block, mp_buffer_info_t *bufinfo) { + if (common_hal_sdioio_sdcard_deinited(self)) { + raise_deinited_error(); + } + check_whole_block(bufinfo); + + return self->inode->u.i_bops->write(self->inode, bufinfo->buf, start_block, bufinfo->len / 512);; +} + +void common_hal_sdioio_sdcard_never_reset(sdioio_sdcard_obj_t *self) { + never_reset_pin_number(self->clock_pin->number); + never_reset_pin_number(self->command_pin->number); + for (uint8_t i = 0; i < DATA_PINS_NUM; i++) { + never_reset_pin_number(self->data_pins[i]->number); + } +} diff --git a/ports/cxd56/common-hal/sdioio/SDCard.h b/ports/cxd56/common-hal/sdioio/SDCard.h new file mode 100644 index 0000000000..cbdcd47069 --- /dev/null +++ b/ports/cxd56/common-hal/sdioio/SDCard.h @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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. + */ + +#ifndef MICROPY_INCLUDED_CXD56_SDIOIO_SDCARD_H +#define MICROPY_INCLUDED_CXD56_SDIOIO_SDCARD_H + +#include + +#include "py/obj.h" + +#include "common-hal/microcontroller/Pin.h" + +typedef struct { + mp_obj_base_t base; + struct inode* inode; + uint32_t frequency; + uint32_t count; + uint8_t width; + const mcu_pin_obj_t *command_pin; + const mcu_pin_obj_t *clock_pin; + const mcu_pin_obj_t *data_pins[4]; +} sdioio_sdcard_obj_t; + +#endif // MICROPY_INCLUDED_CXD56_SDIOIO_SDCARD_H diff --git a/ports/cxd56/common-hal/sdioio/__init__.c b/ports/cxd56/common-hal/sdioio/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 23f60f8a7f..eb077c07bd 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -7,6 +7,8 @@ USB_CDC_EP_NUM_DATA_IN = 1 USB_MSC_EP_NUM_OUT = 5 USB_MSC_EP_NUM_IN = 4 +MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz + CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_COUNTIO = 0 @@ -18,6 +20,7 @@ CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_SDIOIO = 1 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_USB_MIDI = 0 From 7aa689823eee9a9c19050e313ce4665b9e192f1b Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 09:27:14 -0400 Subject: [PATCH 0158/1293] Added type hints to analogio --- shared-bindings/analogio/AnalogIn.c | 10 +++++----- shared-bindings/analogio/AnalogOut.c | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index 400784b390..84a4bf5f43 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -70,7 +70,7 @@ STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type, return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Turn off the AnalogIn and release the pin for other use.""" //| ... //| @@ -86,13 +86,13 @@ STATIC void check_for_deinit(analogio_analogin_obj_t *self) { raise_deinited_error(); } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> None: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -104,7 +104,7 @@ STATIC mp_obj_t analogio_analogin___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogin___exit___obj, 4, 4, analogio_analogin___exit__); -//| value: Any = ... +//| value: int = ... //| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (read-only) //| //| Even if the underlying analog to digital converter (ADC) is lower @@ -124,7 +124,7 @@ const mp_obj_property_t analogio_analogin_value_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| reference_voltage: Any = ... +//| reference_voltage: Optional[float] = ... //| """The maximum voltage measurable (also known as the reference voltage) as a //| `float` in Volts.""" //| diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index a8edcc0ae1..f020096472 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -66,7 +66,7 @@ STATIC mp_obj_t analogio_analogout_make_new(const mp_obj_type_t *type, mp_uint_t return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Turn off the AnalogOut and release the pin for other use.""" //| ... //| @@ -79,13 +79,13 @@ STATIC mp_obj_t analogio_analogout_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(analogio_analogout_deinit_obj, analogio_analogout_deinit); -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> None: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -97,7 +97,7 @@ STATIC mp_obj_t analogio_analogout___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogout___exit___obj, 4, 4, analogio_analogout___exit__); -//| value: Any = ... +//| value: None = ... //| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (write-only) //| //| Even if the underlying digital to analog converter (DAC) is lower From 22f0c14fdbdd457f700411781c601d428105d913 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Thu, 2 Jul 2020 15:26:05 +0200 Subject: [PATCH 0159/1293] locale: update translate --- locale/circuitpython.pot | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 7141cc8722..6e32ebab98 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-01 10:33-0500\n" +"POT-Creation-Date: 2020-07-02 15:29+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -425,7 +425,8 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" msgstr "" @@ -589,6 +590,10 @@ msgstr "" msgid "Could not initialize GNSS" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -982,7 +987,8 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" From 6fd6747e9eb27c04038ad53df79a2f8885485f3d Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 09:36:22 -0400 Subject: [PATCH 0160/1293] Added type hints for analogio --- shared-bindings/analogio/AnalogIn.c | 10 +++++----- shared-bindings/analogio/AnalogOut.c | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index 400784b390..84a4bf5f43 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -70,7 +70,7 @@ STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type, return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Turn off the AnalogIn and release the pin for other use.""" //| ... //| @@ -86,13 +86,13 @@ STATIC void check_for_deinit(analogio_analogin_obj_t *self) { raise_deinited_error(); } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> None: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -104,7 +104,7 @@ STATIC mp_obj_t analogio_analogin___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogin___exit___obj, 4, 4, analogio_analogin___exit__); -//| value: Any = ... +//| value: int = ... //| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (read-only) //| //| Even if the underlying analog to digital converter (ADC) is lower @@ -124,7 +124,7 @@ const mp_obj_property_t analogio_analogin_value_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| reference_voltage: Any = ... +//| reference_voltage: Optional[float] = ... //| """The maximum voltage measurable (also known as the reference voltage) as a //| `float` in Volts.""" //| diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index a8edcc0ae1..f020096472 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -66,7 +66,7 @@ STATIC mp_obj_t analogio_analogout_make_new(const mp_obj_type_t *type, mp_uint_t return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Turn off the AnalogOut and release the pin for other use.""" //| ... //| @@ -79,13 +79,13 @@ STATIC mp_obj_t analogio_analogout_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(analogio_analogout_deinit_obj, analogio_analogout_deinit); -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> None: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -97,7 +97,7 @@ STATIC mp_obj_t analogio_analogout___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogout___exit___obj, 4, 4, analogio_analogout___exit__); -//| value: Any = ... +//| value: None = ... //| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (write-only) //| //| Even if the underlying digital to analog converter (DAC) is lower From cb259de5ef01a9b8d590ab34f866fd6bce9a801a Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 10:23:17 -0400 Subject: [PATCH 0161/1293] Did busio, fixed up analogio --- shared-bindings/analogio/AnalogIn.c | 2 +- shared-bindings/analogio/AnalogOut.c | 2 +- shared-bindings/busio/I2C.c | 18 ++++++++--------- shared-bindings/busio/OneWire.c | 12 ++++++------ shared-bindings/busio/SPI.c | 20 +++++++++---------- shared-bindings/busio/UART.c | 29 ++++++++++++++-------------- 6 files changed, 42 insertions(+), 41 deletions(-) diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index 84a4bf5f43..b41abc8478 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -86,7 +86,7 @@ STATIC void check_for_deinit(analogio_analogin_obj_t *self) { raise_deinited_error(); } } -//| def __enter__(self, ) -> None: +//| def __enter__(self, ) -> AnalogIn: //| """No-op used by Context Managers.""" //| ... //| diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index f020096472..11957e8e9d 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -79,7 +79,7 @@ STATIC mp_obj_t analogio_analogout_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(analogio_analogout_deinit_obj, analogio_analogout_deinit); -//| def __enter__(self, ) -> None: +//| def __enter__(self, ) -> AnalogOut: //| """No-op used by Context Managers.""" //| ... //| diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index b61dd93f3a..7de9d5d4df 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -83,7 +83,7 @@ STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, con return (mp_obj_t)self; } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Releases control of the underlying hardware so other classes can use it.""" //| ... //| @@ -100,13 +100,13 @@ STATIC void check_for_deinit(busio_i2c_obj_t *self) { } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> I2C: //| """No-op used in Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware on context exit. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -125,7 +125,7 @@ static void check_lock(busio_i2c_obj_t *self) { } } -//| def scan(self, ) -> Any: +//| def scan(self, ) -> list: //| //| """Scan all I2C addresses between 0x08 and 0x77 inclusive and return a //| list of those that respond. @@ -150,7 +150,7 @@ STATIC mp_obj_t busio_i2c_scan(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_scan_obj, busio_i2c_scan); -//| def try_lock(self, ) -> Any: +//| def try_lock(self, ) -> bool: //| """Attempts to grab the I2C lock. Returns True on success. //| //| :return: True when lock has been grabbed @@ -164,7 +164,7 @@ STATIC mp_obj_t busio_i2c_obj_try_lock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_try_lock_obj, busio_i2c_obj_try_lock); -//| def unlock(self, ) -> Any: +//| def unlock(self, ) -> none: //| """Releases the I2C lock.""" //| ... //| @@ -176,7 +176,7 @@ STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock); -//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any: +//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> None: //| """Read into ``buffer`` from the device selected by ``address``. //| The number of bytes read will be the length of ``buffer``. //| At least one byte must be read. @@ -228,7 +228,7 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args, } MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_into); -//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any: +//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> None: //| """Write the bytes from ``buffer`` to the device selected by ``address``. //| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be //| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and @@ -287,7 +287,7 @@ STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_ma } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto); -//| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any: +//| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: //| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and //| ``in_buffer`` can be the same buffer because they are used sequentially. diff --git a/shared-bindings/busio/OneWire.c b/shared-bindings/busio/OneWire.c index 723cc031a8..08a79daa9b 100644 --- a/shared-bindings/busio/OneWire.c +++ b/shared-bindings/busio/OneWire.c @@ -77,7 +77,7 @@ STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Deinitialize the OneWire bus and release any hardware resources for reuse.""" //| ... //| @@ -94,13 +94,13 @@ STATIC void check_for_deinit(busio_onewire_obj_t *self) { } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> OneWire: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -112,7 +112,7 @@ STATIC mp_obj_t busio_onewire_obj___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_onewire___exit___obj, 4, 4, busio_onewire_obj___exit__); -//| def reset(self, ) -> Any: +//| def reset(self, ) -> bool: //| """Reset the OneWire bus and read presence //| //| :returns: False when at least one device is present @@ -127,7 +127,7 @@ STATIC mp_obj_t busio_onewire_obj_reset(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_reset_obj, busio_onewire_obj_reset); -//| def read_bit(self, ) -> Any: +//| def read_bit(self, ) -> bool: //| """Read in a bit //| //| :returns: bit state read @@ -142,7 +142,7 @@ STATIC mp_obj_t busio_onewire_obj_read_bit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_read_bit_obj, busio_onewire_obj_read_bit); -//| def write_bit(self, value: Any) -> Any: +//| def write_bit(self, value: bool) -> None: //| """Write out a bit based on value.""" //| ... //| diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 793ab4f671..3d28adbcb5 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -100,7 +100,7 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, con return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Turn off the SPI bus.""" //| ... //| @@ -111,13 +111,13 @@ STATIC mp_obj_t busio_spi_obj_deinit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_deinit_obj, busio_spi_obj_deinit); -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> SPI: //| """No-op used by Context Managers. //| Provided by context manager helper.""" //| ... //| -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -142,7 +142,7 @@ STATIC void check_for_deinit(busio_spi_obj_t *self) { } } -//| def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> Any: +//| def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> None: //| """Configures the SPI bus. The SPI object must be locked. //| //| :param int baudrate: the desired clock rate in Hertz. The actual clock rate may be higher or lower @@ -201,7 +201,7 @@ STATIC mp_obj_t busio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_ } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_configure_obj, 1, busio_spi_configure); -//| def try_lock(self, ) -> Any: +//| def try_lock(self, ) -> bool: //| """Attempts to grab the SPI lock. Returns True on success. //| //| :return: True when lock has been grabbed @@ -215,7 +215,7 @@ STATIC mp_obj_t busio_spi_obj_try_lock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_try_lock_obj, busio_spi_obj_try_lock); -//| def unlock(self, ) -> Any: +//| def unlock(self, ) -> None: //| """Releases the SPI lock.""" //| ... //| @@ -228,7 +228,7 @@ STATIC mp_obj_t busio_spi_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_unlock_obj, busio_spi_obj_unlock); -//| def write(self, buffer: bytearray, *, start: Any = 0, end: int = None) -> Any: +//| def write(self, buffer: bytes, *, start: int = 0, end: int = None) -> None: //| """Write the data contained in ``buffer``. The SPI object must be locked. //| If the buffer is empty, nothing happens. //| @@ -270,7 +270,7 @@ STATIC mp_obj_t busio_spi_write(size_t n_args, const mp_obj_t *pos_args, mp_map_ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_obj, 2, busio_spi_write); -//| def readinto(self, buffer: bytearray, *, start: Any = 0, end: int = None, write_value: int = 0) -> Any: +//| def readinto(self, buffer: bytearray, *, start: int = 0, end: int = None, write_value: int = 0) -> None: //| """Read into ``buffer`` while writing ``write_value`` for each byte read. //| The SPI object must be locked. //| If the number of bytes to read is 0, nothing happens. @@ -314,7 +314,7 @@ STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_m } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_readinto_obj, 2, busio_spi_readinto); -//| def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: Any = 0, out_end: int = None, in_start: Any = 0, in_end: int = None) -> Any: +//| def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: int = 0, out_end: int = None, in_start: None = 0, in_end: int = None) -> None: //| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. //| The SPI object must be locked. //| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` @@ -377,7 +377,7 @@ STATIC mp_obj_t busio_spi_write_readinto(size_t n_args, const mp_obj_t *pos_args } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_readinto_obj, 2, busio_spi_write_readinto); -//| frequency: Any = ... +//| frequency: int = ... //| """The actual SPI bus frequency. This may not match the frequency requested //| due to internal limitations.""" //| diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 018ded1828..133caee198 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -142,7 +142,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co return (mp_obj_t)self; } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Deinitialises the UART and releases any hardware resources for reuse.""" //| ... //| @@ -159,13 +159,13 @@ STATIC void check_for_deinit(busio_uart_obj_t *self) { } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> UART: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -179,7 +179,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ // These are standard stream methods. Code is in py/stream.c. // -//| def read(self, nbytes: Any = None) -> Any: +//| def read(self, nbytes: int = None) -> Optional[bytes]: //| """Read characters. If ``nbytes`` is specified then read at most that many //| bytes. Otherwise, read everything that arrives until the connection //| times out. Providing the number of bytes expected is highly recommended @@ -190,7 +190,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| ... //| -//| def readinto(self, buf: Any) -> Any: +//| def readinto(self, buf: bytes) -> Optional[int]: //| """Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. //| //| :return: number of bytes read and stored into ``buf`` @@ -200,7 +200,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| ... //| -//| def readline(self, ) -> Any: +//| def readline(self, ) -> Optional[int]: //| """Read a line, ending in a newline character. //| //| :return: the line read @@ -208,7 +208,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| ... //| -//| def write(self, buf: Any) -> Any: +//| def write(self, buf: bytearray) -> Optional[int]: //| """Write the buffer of bytes to the bus. //| //| *New in CircuitPython 4.0:* ``buf`` must be bytes, not a string. @@ -261,7 +261,7 @@ STATIC mp_uint_t busio_uart_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint_t return ret; } -//| baudrate: Any = ... +//| baudrate: int = ... //| """The current baudrate.""" //| STATIC mp_obj_t busio_uart_obj_get_baudrate(mp_obj_t self_in) { @@ -287,7 +287,7 @@ const mp_obj_property_t busio_uart_baudrate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| in_waiting: Any = ... +//| in_waiting: int = ... //| """The number of bytes in the input buffer, available to be read""" //| STATIC mp_obj_t busio_uart_obj_get_in_waiting(mp_obj_t self_in) { @@ -304,7 +304,7 @@ const mp_obj_property_t busio_uart_in_waiting_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| timeout: Any = ... +//| timeout: float = ... //| """The current timeout, in seconds (float).""" //| STATIC mp_obj_t busio_uart_obj_get_timeout(mp_obj_t self_in) { @@ -332,8 +332,9 @@ const mp_obj_property_t busio_uart_timeout_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def reset_input_buffer(self, ) -> Any: ... -//| """Discard any unread characters in the input buffer.""" +//| def reset_input_buffer(self, ) -> None: +//| """Discard any unread characters in the input buffer.""" +//| ... //| STATIC mp_obj_t busio_uart_obj_reset_input_buffer(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -346,10 +347,10 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(busio_uart_reset_input_buffer_obj, busio_uart_o //| class Parity: //| """Enum-like class to define the parity used to verify correct data transfer.""" //| -//| ODD: Any = ... +//| ODD: int = ... //| """Total number of ones should be odd.""" //| -//| EVEN: Any = ... +//| EVEN: int = ... //| """Total number of ones should be even.""" //| const mp_obj_type_t busio_uart_parity_type; From d1664bdde2764e1a72a792dcfb23d4b650085e97 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 10:25:20 -0400 Subject: [PATCH 0162/1293] Fixed extract_pyi script to allow NoneType --- tools/extract_pyi.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index d749d202b3..131cef15f2 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -1,3 +1,7 @@ +# Run with 'python tools/extract_pyi.py shared-bindings/ path/to/stub/dir +# You can also test a specific library in shared-bindings by putting the path +# to that directory instead + import os import sys import astroid @@ -58,8 +62,10 @@ def convert_folder(top_level, stub_directory): print(i.__dict__['name']) for j in i.body: if isinstance(j, astroid.scoped_nodes.FunctionDef): - if None in j.args.__dict__['annotations']: - print(f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n") + for i in j.args.__dict__['annotations']: + if type(i) == astroid.node_classes.Name: + if i.name == 'Any': + print(f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n") if j.returns: if 'Any' in j.returns.__dict__.values(): print(f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}") From 1e96ca582ee1d5e728dd6cd8b744a40ea1c98fe5 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 11:10:43 -0400 Subject: [PATCH 0163/1293] Made more modifications to extract_pyi.py --- tools/extract_pyi.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index 131cef15f2..9d22af93af 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -62,10 +62,14 @@ def convert_folder(top_level, stub_directory): print(i.__dict__['name']) for j in i.body: if isinstance(j, astroid.scoped_nodes.FunctionDef): - for i in j.args.__dict__['annotations']: - if type(i) == astroid.node_classes.Name: - if i.name == 'Any': + for k, l in zip(j.args.__dict__['annotations'], j.args.__dict__['args']): + # K is type, l is name + if l.name != 'self': + if not k: print(f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n") + elif str(type(k)) == "": + if k.name == 'Any': + print(f"'Any' parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n") if j.returns: if 'Any' in j.returns.__dict__.values(): print(f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}") From 627ecadb3f6f131f62a760bb58f3f329b9ad1c2c Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 11:10:53 -0400 Subject: [PATCH 0164/1293] Did aesio --- shared-bindings/aesio/aes.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/aesio/aes.c b/shared-bindings/aesio/aes.c index f6a0a89b80..11505a0018 100644 --- a/shared-bindings/aesio/aes.c +++ b/shared-bindings/aesio/aes.c @@ -12,7 +12,7 @@ //| class AES: //| """Encrypt and decrypt AES streams""" //| -//| def __init__(self, key, mode=0, iv=None, segment_size=8) -> Any: +//| def __init__(self, key: bytearray, mode: int=0, iv: bytearray=None, segment_size: int=8) -> AES: //| """Create a new AES state with the given key. //| //| :param bytearray key: A 16-, 24-, or 32-byte key @@ -152,7 +152,7 @@ STATIC void validate_length(aesio_aes_obj_t *self, size_t src_length, } } -//| def encrypt_into(src, dest) -> None: +//| def encrypt_into(src: bytes, dest: bytearray) -> None: //| """Encrypt the buffer from ``src`` into ``dest``. //| //| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the @@ -183,7 +183,7 @@ STATIC mp_obj_t aesio_aes_encrypt_into(mp_obj_t aesio_obj, mp_obj_t src, STATIC MP_DEFINE_CONST_FUN_OBJ_3(aesio_aes_encrypt_into_obj, aesio_aes_encrypt_into); -//| def decrypt_into(src, dest) -> None: +//| def decrypt_into(src: bytes, dest: bytearray) -> None: //| //| """Decrypt the buffer from ``src`` into ``dest``. //| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the From 427733af04fa4d9d2075ec98e4083c48d1469695 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 11:30:42 -0400 Subject: [PATCH 0165/1293] More tweaks to extract_pyi.py --- tools/extract_pyi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index 9d22af93af..1781cbd10d 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -76,7 +76,7 @@ def convert_folder(top_level, stub_directory): elif isinstance(j, astroid.node_classes.AnnAssign): if 'name' in j.__dict__['annotation'].__dict__: if j.__dict__['annotation'].__dict__['name'] == 'Any': - print(f"missing attribute type on line {j.__dict__['lineno']}") + print(f"missing attribute type: {j.__dict__['target'].name} on line {j.__dict__['lineno']}") ok += 1 except astroid.exceptions.AstroidSyntaxError as e: From 2681bd52b5ec3834024d8b189335315ea4cab7fc Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 11:33:18 -0400 Subject: [PATCH 0166/1293] Did audiobusio --- shared-bindings/audiobusio/I2SOut.c | 18 +++++++++--------- shared-bindings/audiobusio/PDMIn.c | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index fd71a6e852..dd212cdb54 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -112,7 +112,7 @@ STATIC mp_obj_t audiobusio_i2sout_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Deinitialises the I2SOut and releases any hardware resources for reuse.""" //| ... //| @@ -128,13 +128,13 @@ STATIC void check_for_deinit(audiobusio_i2sout_obj_t *self) { raise_deinited_error(); } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> I2SOut: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -147,7 +147,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj___exit__(size_t n_args, const mp_obj_t *ar STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_i2sout___exit___obj, 4, 4, audiobusio_i2sout_obj___exit__); -//| def play(self, sample: Any, *, loop: Any = False) -> Any: +//| def play(self, sample: Union[audiocore.WaveFile, audiocore.RawSample, audiomixe.Mixer], *, loop: Any = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| @@ -174,7 +174,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj_play(size_t n_args, const mp_obj_t *pos_ar } MP_DEFINE_CONST_FUN_OBJ_KW(audiobusio_i2sout_play_obj, 1, audiobusio_i2sout_obj_play); -//| def stop(self, ) -> Any: +//| def stop(self, ) -> None: //| """Stops playback.""" //| ... //| @@ -186,7 +186,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj_stop(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_stop_obj, audiobusio_i2sout_obj_stop); -//| playing: Any = ... +//| playing: bool = ... //| """True when the audio sample is being output. (read-only)""" //| STATIC mp_obj_t audiobusio_i2sout_obj_get_playing(mp_obj_t self_in) { @@ -203,7 +203,7 @@ const mp_obj_property_t audiobusio_i2sout_playing_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def pause(self, ) -> Any: +//| def pause(self, ) -> None: //| """Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" //| ... //| @@ -219,7 +219,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj_pause(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_pause_obj, audiobusio_i2sout_obj_pause); -//| def resume(self, ) -> Any: +//| def resume(self, ) -> None: //| """Resumes sample playback after :py:func:`pause`.""" //| ... //| @@ -235,7 +235,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj_resume(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_resume_obj, audiobusio_i2sout_obj_resume); -//| paused: Any = ... +//| paused: bool = ... //| """True when playback is paused. (read-only)""" //| STATIC mp_obj_t audiobusio_i2sout_obj_get_paused(mp_obj_t self_in) { diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c index 5b950297b5..4aa1787992 100644 --- a/shared-bindings/audiobusio/PDMIn.c +++ b/shared-bindings/audiobusio/PDMIn.c @@ -134,7 +134,7 @@ STATIC mp_obj_t audiobusio_pdmin_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Deinitialises the PDMIn and releases any hardware resources for reuse.""" //| ... //| @@ -150,13 +150,13 @@ STATIC void check_for_deinit(audiobusio_pdmin_obj_t *self) { raise_deinited_error(); } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> PDMIn: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context.""" //| ... //| @@ -168,7 +168,7 @@ STATIC mp_obj_t audiobusio_pdmin_obj___exit__(size_t n_args, const mp_obj_t *arg STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_pdmin___exit___obj, 4, 4, audiobusio_pdmin_obj___exit__); -//| def record(self, destination: Any, destination_length: Any) -> Any: +//| def record(self, destination: bytearray, destination_length: int) -> None: //| """Records destination_length bytes of samples to destination. This is //| blocking. //| @@ -210,7 +210,7 @@ STATIC mp_obj_t audiobusio_pdmin_obj_record(mp_obj_t self_obj, mp_obj_t destinat } MP_DEFINE_CONST_FUN_OBJ_3(audiobusio_pdmin_record_obj, audiobusio_pdmin_obj_record); -//| sample_rate: Any = ... +//| sample_rate: int = ... //| """The actual sample_rate of the recording. This may not match the constructed //| sample rate due to internal clock limitations.""" //| From b26ee6c1f666598bf3dd2bd66414916e3d7fe79f Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 11:37:24 -0400 Subject: [PATCH 0167/1293] Added type hints to audiocore --- shared-bindings/audiocore/RawSample.c | 8 ++++---- shared-bindings/audiocore/WaveFile.c | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/shared-bindings/audiocore/RawSample.c b/shared-bindings/audiocore/RawSample.c index 2eadf1fab4..dec029bf41 100644 --- a/shared-bindings/audiocore/RawSample.c +++ b/shared-bindings/audiocore/RawSample.c @@ -101,7 +101,7 @@ STATIC mp_obj_t audioio_rawsample_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Deinitialises the AudioOut and releases any hardware resources for reuse.""" //| ... //| @@ -118,13 +118,13 @@ STATIC void check_for_deinit(audioio_rawsample_obj_t *self) { } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> RawSample: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -136,7 +136,7 @@ STATIC mp_obj_t audioio_rawsample_obj___exit__(size_t n_args, const mp_obj_t *ar } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_rawsample___exit___obj, 4, 4, audioio_rawsample_obj___exit__); -//| sample_rate: Any = ... +//| sample_rate: Optional(int) = ... //| """32 bit value that dictates how quickly samples are played in Hertz (cycles per second). //| When the sample is looped, this can change the pitch output without changing the underlying //| sample. This will not change the sample rate of any active playback. Call ``play`` again to diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index a067f6cda8..6f7d270058 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -91,7 +91,7 @@ STATIC mp_obj_t audioio_wavefile_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Deinitialises the WaveFile and releases all memory resources for reuse.""" //| ... STATIC mp_obj_t audioio_wavefile_deinit(mp_obj_t self_in) { @@ -107,13 +107,13 @@ STATIC void check_for_deinit(audioio_wavefile_obj_t *self) { } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> WaveFile: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -125,7 +125,7 @@ STATIC mp_obj_t audioio_wavefile_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_wavefile___exit___obj, 4, 4, audioio_wavefile_obj___exit__); -//| sample_rate: Any = ... +//| sample_rate: Optional(int) = ... //| """32 bit value that dictates how quickly samples are loaded into the DAC //| in Hertz (cycles per second). When the sample is looped, this can change //| the pitch output without changing the underlying sample.""" @@ -152,7 +152,7 @@ const mp_obj_property_t audioio_wavefile_sample_rate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| bits_per_sample: Any = ... +//| bits_per_sample: int = ... //| """Bits per sample. (read only)""" //| STATIC mp_obj_t audioio_wavefile_obj_get_bits_per_sample(mp_obj_t self_in) { @@ -168,7 +168,7 @@ const mp_obj_property_t audioio_wavefile_bits_per_sample_obj = { (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj}, }; -//| channel_count: Any = ... +//| channel_count: int = ... //| """Number of audio channels. (read only)""" //| STATIC mp_obj_t audioio_wavefile_obj_get_channel_count(mp_obj_t self_in) { From 3d1e0051e6a1ccff0fbca760ce0781a5086a9676 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 11:46:08 -0400 Subject: [PATCH 0168/1293] Added type hints to audioio --- shared-bindings/audioio/AudioOut.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index 9ba72bd41d..25b3d01ffa 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -111,7 +111,7 @@ STATIC mp_obj_t audioio_audioout_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Deinitialises the AudioOut and releases any hardware resources for reuse.""" //| ... //| @@ -127,13 +127,13 @@ STATIC void check_for_deinit(audioio_audioout_obj_t *self) { raise_deinited_error(); } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> AudioOut: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -146,7 +146,7 @@ STATIC mp_obj_t audioio_audioout_obj___exit__(size_t n_args, const mp_obj_t *arg STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_audioout___exit___obj, 4, 4, audioio_audioout_obj___exit__); -//| def play(self, sample: Any, *, loop: Any = False) -> Any: +//| def play(self, sample: Union[audiocore.WaveFile, audiocore.RawSample, audiomixer.Mixer], *, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| @@ -175,7 +175,7 @@ STATIC mp_obj_t audioio_audioout_obj_play(size_t n_args, const mp_obj_t *pos_arg } MP_DEFINE_CONST_FUN_OBJ_KW(audioio_audioout_play_obj, 1, audioio_audioout_obj_play); -//| def stop(self, ) -> Any: +//| def stop(self, ) -> None: //| """Stops playback and resets to the start of the sample.""" //| ... //| @@ -187,7 +187,7 @@ STATIC mp_obj_t audioio_audioout_obj_stop(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_stop_obj, audioio_audioout_obj_stop); -//| playing: Any = ... +//| playing: bool = ... //| """True when an audio sample is being output even if `paused`. (read-only)""" //| STATIC mp_obj_t audioio_audioout_obj_get_playing(mp_obj_t self_in) { @@ -204,7 +204,7 @@ const mp_obj_property_t audioio_audioout_playing_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def pause(self, ) -> Any: +//| def pause(self, ) -> None: //| """Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" //| ... //| @@ -220,7 +220,7 @@ STATIC mp_obj_t audioio_audioout_obj_pause(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_pause_obj, audioio_audioout_obj_pause); -//| def resume(self, ) -> Any: +//| def resume(self, ) -> None: //| """Resumes sample playback after :py:func:`pause`.""" //| ... //| @@ -236,7 +236,7 @@ STATIC mp_obj_t audioio_audioout_obj_resume(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_resume_obj, audioio_audioout_obj_resume); -//| paused: Any = ... +//| paused: bool = ... //| """True when playback is paused. (read-only)""" //| STATIC mp_obj_t audioio_audioout_obj_get_paused(mp_obj_t self_in) { From 24bca06db00ed032f645d69534b42625c9772776 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 11:55:27 -0400 Subject: [PATCH 0169/1293] Added type hints to audiomixer --- shared-bindings/audiomixer/Mixer.c | 16 ++++++++-------- shared-bindings/audiomixer/MixerVoice.c | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/shared-bindings/audiomixer/Mixer.c b/shared-bindings/audiomixer/Mixer.c index 31e62cdae1..abd09790f8 100644 --- a/shared-bindings/audiomixer/Mixer.c +++ b/shared-bindings/audiomixer/Mixer.c @@ -121,7 +121,7 @@ STATIC mp_obj_t audiomixer_mixer_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Deinitialises the Mixer and releases any hardware resources for reuse.""" //| ... //| @@ -138,13 +138,13 @@ STATIC void check_for_deinit(audiomixer_mixer_obj_t *self) { } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> Mixer: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -156,7 +156,7 @@ STATIC mp_obj_t audiomixer_mixer_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiomixer_mixer___exit___obj, 4, 4, audiomixer_mixer_obj___exit__); -//| playing: Any = ... +//| playing: bool = ... //| """True when any voice is being output. (read-only)""" //| STATIC mp_obj_t audiomixer_mixer_obj_get_playing(mp_obj_t self_in) { @@ -173,7 +173,7 @@ const mp_obj_property_t audiomixer_mixer_playing_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| sample_rate: Any = ... +//| sample_rate: int = ... //| """32 bit value that dictates how quickly samples are played in Hertz (cycles per second).""" //| STATIC mp_obj_t audiomixer_mixer_obj_get_sample_rate(mp_obj_t self_in) { @@ -190,7 +190,7 @@ const mp_obj_property_t audiomixer_mixer_sample_rate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| voice: Any = ... +//| voice: Tuple[audiomixer.MixerVoice, ...] = ... //| """A tuple of the mixer's `audiomixer.MixerVoice` object(s). //| //| .. code-block:: python @@ -211,7 +211,7 @@ const mp_obj_property_t audiomixer_mixer_voice_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def play(self, sample: Any, *, voice: Any = 0, loop: Any = False) -> Any: +//| def play(self, sample: Union[audiomixer.WaveFile, audiocore.RawSample, audiomixer.Mixer], *, voice: int = 0, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| @@ -244,7 +244,7 @@ STATIC mp_obj_t audiomixer_mixer_obj_play(size_t n_args, const mp_obj_t *pos_arg } MP_DEFINE_CONST_FUN_OBJ_KW(audiomixer_mixer_play_obj, 1, audiomixer_mixer_obj_play); -//| def stop_voice(self, voice: Any = 0) -> Any: +//| def stop_voice(self, voice: int = 0) -> None: //| """Stops playback of the sample on the given voice.""" //| ... //| diff --git a/shared-bindings/audiomixer/MixerVoice.c b/shared-bindings/audiomixer/MixerVoice.c index ec5768d2f0..eb0c399d5e 100644 --- a/shared-bindings/audiomixer/MixerVoice.c +++ b/shared-bindings/audiomixer/MixerVoice.c @@ -56,7 +56,7 @@ STATIC mp_obj_t audiomixer_mixervoice_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(self); } -//| def play(self, sample: Any, *, loop: Any = False) -> Any: +//| def play(self, sample: Union[audiocore.WaveFile, audiomixer.Mixer, audiocore.RawSample], *, loop: bool = False) -> None: //| """Plays the sample once when ``loop=False``, and continuously when ``loop=True``. //| Does not block. Use `playing` to block. //| @@ -81,7 +81,7 @@ STATIC mp_obj_t audiomixer_mixervoice_obj_play(size_t n_args, const mp_obj_t *po } MP_DEFINE_CONST_FUN_OBJ_KW(audiomixer_mixervoice_play_obj, 1, audiomixer_mixervoice_obj_play); -//| def stop(self, ) -> Any: +//| def stop(self, ) -> None: //| """Stops playback of the sample on this voice.""" //| ... //| @@ -100,7 +100,7 @@ STATIC mp_obj_t audiomixer_mixervoice_obj_stop(size_t n_args, const mp_obj_t *po } MP_DEFINE_CONST_FUN_OBJ_KW(audiomixer_mixervoice_stop_obj, 1, audiomixer_mixervoice_obj_stop); -//| level: Any = ... +//| level: None = ... //| """The volume level of a voice, as a floating point number between 0 and 1.""" //| STATIC mp_obj_t audiomixer_mixervoice_obj_get_level(mp_obj_t self_in) { @@ -136,7 +136,7 @@ const mp_obj_property_t audiomixer_mixervoice_level_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| playing: Any = ... +//| playing: bool = ... //| """True when this voice is being output. (read-only)""" //| From e114b31a7ab8a75dac542bdab0d4d1fb64246a06 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 12:00:40 -0400 Subject: [PATCH 0170/1293] Added type hints to audiomp3 --- shared-bindings/audiomp3/MP3Decoder.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index e6d48e32cb..4d4792cdc5 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -89,7 +89,7 @@ STATIC mp_obj_t audiomp3_mp3file_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Deinitialises the MP3 and releases all memory resources for reuse.""" //| ... //| @@ -106,13 +106,13 @@ STATIC void check_for_deinit(audiomp3_mp3file_obj_t *self) { } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> MP3: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -124,7 +124,7 @@ STATIC mp_obj_t audiomp3_mp3file_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiomp3_mp3file___exit___obj, 4, 4, audiomp3_mp3file_obj___exit__); -//| file: Any = ... +//| file: Optional[file] = ... //| """File to play back.""" //| STATIC mp_obj_t audiomp3_mp3file_obj_get_file(mp_obj_t self_in) { @@ -154,7 +154,7 @@ const mp_obj_property_t audiomp3_mp3file_file_obj = { -//| sample_rate: Any = ... +//| sample_rate: Optional[int] = ... //| """32 bit value that dictates how quickly samples are loaded into the DAC //| in Hertz (cycles per second). When the sample is looped, this can change //| the pitch output without changing the underlying sample.""" @@ -181,7 +181,7 @@ const mp_obj_property_t audiomp3_mp3file_sample_rate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| bits_per_sample: Any = ... +//| bits_per_sample: int = ... //| """Bits per sample. (read only)""" //| STATIC mp_obj_t audiomp3_mp3file_obj_get_bits_per_sample(mp_obj_t self_in) { @@ -198,7 +198,7 @@ const mp_obj_property_t audiomp3_mp3file_bits_per_sample_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| channel_count: Any = ... +//| channel_count: int = ... //| """Number of audio channels. (read only)""" //| STATIC mp_obj_t audiomp3_mp3file_obj_get_channel_count(mp_obj_t self_in) { @@ -215,7 +215,7 @@ const mp_obj_property_t audiomp3_mp3file_channel_count_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| rms_level: Any = ... +//| rms_level: float = ... //| """The RMS audio level of a recently played moment of audio. (read only)""" //| STATIC mp_obj_t audiomp3_mp3file_obj_get_rms_level(mp_obj_t self_in) { From e169da3532f646e2498f2b326a52aeff896ae170 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 12:01:28 -0400 Subject: [PATCH 0171/1293] More extract_pyi tweaks --- tools/extract_pyi.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index 1781cbd10d..f504e634e2 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -59,6 +59,7 @@ def convert_folder(top_level, stub_directory): tree = astroid.parse(stub_contents) for i in tree.body: if 'name' in i.__dict__: + print() print(i.__dict__['name']) for j in i.body: if isinstance(j, astroid.scoped_nodes.FunctionDef): @@ -66,10 +67,10 @@ def convert_folder(top_level, stub_directory): # K is type, l is name if l.name != 'self': if not k: - print(f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n") + print(f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}") elif str(type(k)) == "": if k.name == 'Any': - print(f"'Any' parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n") + print(f"'Any' parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}") if j.returns: if 'Any' in j.returns.__dict__.values(): print(f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}") From ed476a417cb3f0f197355c33b5c5e3db79dddd4e Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 12:07:03 -0400 Subject: [PATCH 0172/1293] Added type hints to audiopwmio --- shared-bindings/audiopwmio/PWMAudioOut.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index 812b7330d4..cb0b02fd66 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -114,7 +114,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_make_new(const mp_obj_type_t *type, size_ return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Deinitialises the PWMAudioOut and releases any hardware resources for reuse.""" //| ... //| @@ -130,13 +130,13 @@ STATIC void check_for_deinit(audiopwmio_pwmaudioout_obj_t *self) { raise_deinited_error(); } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> PWMAudioOut: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -148,7 +148,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj___exit__(size_t n_args, const mp_obj_ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiopwmio_pwmaudioout___exit___obj, 4, 4, audiopwmio_pwmaudioout_obj___exit__); -//| def play(self, sample: Any, *, loop: Any = False) -> Any: +//| def play(self, sample: Union[audiocore.WaveFile, audiocore.RawSample, audiomixer.Mixer], *, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| @@ -177,7 +177,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj_play(size_t n_args, const mp_obj_t *p } MP_DEFINE_CONST_FUN_OBJ_KW(audiopwmio_pwmaudioout_play_obj, 1, audiopwmio_pwmaudioout_obj_play); -//| def stop(self, ) -> Any: +//| def stop(self, ) -> None: //| """Stops playback and resets to the start of the sample.""" //| ... //| @@ -189,7 +189,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj_stop(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiopwmio_pwmaudioout_stop_obj, audiopwmio_pwmaudioout_obj_stop); -//| playing: Any = ... +//| playing: bool = ... //| """True when an audio sample is being output even if `paused`. (read-only)""" //| STATIC mp_obj_t audiopwmio_pwmaudioout_obj_get_playing(mp_obj_t self_in) { @@ -206,7 +206,7 @@ const mp_obj_property_t audiopwmio_pwmaudioout_playing_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def pause(self, ) -> Any: +//| def pause(self, ) -> None: //| """Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" //| ... //| @@ -222,7 +222,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj_pause(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiopwmio_pwmaudioout_pause_obj, audiopwmio_pwmaudioout_obj_pause); -//| def resume(self, ) -> Any: +//| def resume(self, ) -> None: //| """Resumes sample playback after :py:func:`pause`.""" //| ... //| @@ -238,7 +238,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj_resume(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiopwmio_pwmaudioout_resume_obj, audiopwmio_pwmaudioout_obj_resume); -//| paused: Any = ... +//| paused: bool = ... //| """True when playback is paused. (read-only)""" //| STATIC mp_obj_t audiopwmio_pwmaudioout_obj_get_paused(mp_obj_t self_in) { From ffc5f0c3382bf76e73cfcb9d0ba45b4c1fb19b26 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 12:37:03 -0400 Subject: [PATCH 0173/1293] Added type hints to bitbangio --- shared-bindings/bitbangio/I2C.c | 18 +++++++++--------- shared-bindings/bitbangio/OneWire.c | 12 ++++++------ shared-bindings/bitbangio/SPI.c | 18 +++++++++--------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index 43fe11e628..ae5d613cfd 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -79,7 +79,7 @@ STATIC mp_obj_t bitbangio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, return (mp_obj_t)self; } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Releases control of the underlying hardware so other classes can use it.""" //| ... //| @@ -96,13 +96,13 @@ STATIC void check_for_deinit(bitbangio_i2c_obj_t *self) { } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> I2C: //| """No-op used in Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware on context exit. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -120,7 +120,7 @@ static void check_lock(bitbangio_i2c_obj_t *self) { } } -//| def scan(self, ) -> Any: +//| def scan(self, ) -> list: //| """Scan all I2C addresses between 0x08 and 0x77 inclusive and return a list of //| those that respond. A device responds if it pulls the SDA line low after //| its address (including a read bit) is sent on the bus.""" @@ -142,7 +142,7 @@ STATIC mp_obj_t bitbangio_i2c_scan(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_scan_obj, bitbangio_i2c_scan); -//| def try_lock(self, ) -> Any: +//| def try_lock(self, ) -> bool: //| """Attempts to grab the I2C lock. Returns True on success.""" //| ... //| @@ -153,7 +153,7 @@ STATIC mp_obj_t bitbangio_i2c_obj_try_lock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_try_lock_obj, bitbangio_i2c_obj_try_lock); -//| def unlock(self, ) -> Any: +//| def unlock(self, ) -> None: //| """Releases the I2C lock.""" //| ... //| @@ -165,7 +165,7 @@ STATIC mp_obj_t bitbangio_i2c_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_unlock_obj, bitbangio_i2c_obj_unlock); -//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any: +//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> None: //| """Read into ``buffer`` from the device selected by ``address``. //| The number of bytes read will be the length of ``buffer``. //| At least one byte must be read. @@ -217,7 +217,7 @@ STATIC mp_obj_t bitbangio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_a } MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_readfrom_into_obj, 3, bitbangio_i2c_readfrom_into); -//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any: +//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> None: //| """Write the bytes from ``buffer`` to the device selected by ``address`` and then transmits a //| stop bit. Use `writeto_then_readfrom` when needing a write, no stop and repeated start //| before a read. @@ -277,7 +277,7 @@ STATIC mp_obj_t bitbangio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, m STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_writeto_obj, 1, bitbangio_i2c_writeto); -//| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any: +//| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: //| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and //| ``in_buffer`` can be the same buffer because they are used sequentially. diff --git a/shared-bindings/bitbangio/OneWire.c b/shared-bindings/bitbangio/OneWire.c index a236f4c2aa..898eb3ba6f 100644 --- a/shared-bindings/bitbangio/OneWire.c +++ b/shared-bindings/bitbangio/OneWire.c @@ -78,7 +78,7 @@ STATIC mp_obj_t bitbangio_onewire_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Deinitialize the OneWire bus and release any hardware resources for reuse.""" //| ... //| @@ -95,13 +95,13 @@ STATIC void check_for_deinit(bitbangio_onewire_obj_t *self) { } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> OneWire: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -113,7 +113,7 @@ STATIC mp_obj_t bitbangio_onewire_obj___exit__(size_t n_args, const mp_obj_t *ar } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitbangio_onewire___exit___obj, 4, 4, bitbangio_onewire_obj___exit__); -//| def reset(self, ) -> Any: +//| def reset(self, ) -> bool: //| """Reset the OneWire bus""" //| ... //| @@ -125,7 +125,7 @@ STATIC mp_obj_t bitbangio_onewire_obj_reset(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_onewire_reset_obj, bitbangio_onewire_obj_reset); -//| def read_bit(self, ) -> Any: +//| def read_bit(self, ) -> bool: //| """Read in a bit //| //| :returns: bit state read @@ -140,7 +140,7 @@ STATIC mp_obj_t bitbangio_onewire_obj_read_bit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_onewire_read_bit_obj, bitbangio_onewire_obj_read_bit); -//| def write_bit(self, value: Any) -> Any: +//| def write_bit(self, value: bool) -> None: //| """Write out a bit based on value.""" //| ... //| diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index 6d31037c75..f69b812360 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -90,7 +90,7 @@ STATIC mp_obj_t bitbangio_spi_make_new(const mp_obj_type_t *type, size_t n_args, return (mp_obj_t)self; } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Turn off the SPI bus.""" //| ... //| @@ -107,13 +107,13 @@ STATIC void check_for_deinit(bitbangio_spi_obj_t *self) { } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> SPI: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -132,7 +132,7 @@ static void check_lock(bitbangio_spi_obj_t *self) { } } -//| def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> Any: +//| def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> None: //| """Configures the SPI bus. Only valid when locked. //| //| :param int baudrate: the clock rate in Hertz @@ -174,7 +174,7 @@ STATIC mp_obj_t bitbangio_spi_configure(size_t n_args, const mp_obj_t *pos_args, } MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_spi_configure_obj, 1, bitbangio_spi_configure); -//| def try_lock(self, ) -> Any: +//| def try_lock(self, ) -> bool: //| """Attempts to grab the SPI lock. Returns True on success. //| //| :return: True when lock has been grabbed @@ -188,7 +188,7 @@ STATIC mp_obj_t bitbangio_spi_obj_try_lock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_spi_try_lock_obj, bitbangio_spi_obj_try_lock); -//| def unlock(self, ) -> Any: +//| def unlock(self, ) -> None: //| """Releases the SPI lock.""" //| ... //| @@ -200,7 +200,7 @@ STATIC mp_obj_t bitbangio_spi_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_spi_unlock_obj, bitbangio_spi_obj_unlock); -//| def write(self, buf: Any) -> Any: +//| def write(self, buf: bytes) -> None: //| """Write the data contained in ``buf``. Requires the SPI being locked. //| If the buffer is empty, nothing happens.""" //| ... @@ -224,7 +224,7 @@ STATIC mp_obj_t bitbangio_spi_write(mp_obj_t self_in, mp_obj_t wr_buf) { MP_DEFINE_CONST_FUN_OBJ_2(bitbangio_spi_write_obj, bitbangio_spi_write); -//| def readinto(self, buf: Any) -> Any: +//| def readinto(self, buf: bytearray) -> None: //| """Read into the buffer specified by ``buf`` while writing zeroes. //| Requires the SPI being locked. //| If the number of bytes to read is 0, nothing happens.""" @@ -248,7 +248,7 @@ STATIC mp_obj_t bitbangio_spi_readinto(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitbangio_spi_readinto_obj, 2, 2, bitbangio_spi_readinto); -//| def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: Any = 0, out_end: int = None, in_start: Any = 0, in_end: int = None) -> Any: +//| def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: //| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. //| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` //| must be equal. From ac113fdc815f31b54d742f73265359787bd95290 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 12:39:17 -0400 Subject: [PATCH 0174/1293] Changed bytearray to a union --- shared-bindings/aesio/aes.c | 6 +++--- shared-bindings/audiobusio/PDMIn.c | 2 +- shared-bindings/audiocore/WaveFile.c | 2 +- shared-bindings/audiomp3/MP3Decoder.c | 2 +- shared-bindings/bitbangio/I2C.c | 6 +++--- shared-bindings/bitbangio/SPI.c | 6 +++--- shared-bindings/busio/I2C.c | 8 ++++---- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/shared-bindings/aesio/aes.c b/shared-bindings/aesio/aes.c index 11505a0018..4fa6ac6e8f 100644 --- a/shared-bindings/aesio/aes.c +++ b/shared-bindings/aesio/aes.c @@ -12,7 +12,7 @@ //| class AES: //| """Encrypt and decrypt AES streams""" //| -//| def __init__(self, key: bytearray, mode: int=0, iv: bytearray=None, segment_size: int=8) -> AES: +//| def __init__(self, key: Union[bytes, bytearray, memoryview], mode: int=0, iv: Union[bytes, bytearray, memoryview]=None, segment_size: int=8) -> AES: //| """Create a new AES state with the given key. //| //| :param bytearray key: A 16-, 24-, or 32-byte key @@ -152,7 +152,7 @@ STATIC void validate_length(aesio_aes_obj_t *self, size_t src_length, } } -//| def encrypt_into(src: bytes, dest: bytearray) -> None: +//| def encrypt_into(src: Union[bytes, bytearray, memoryview], dest: Union[bytes, bytearray, memoryview]) -> None: //| """Encrypt the buffer from ``src`` into ``dest``. //| //| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the @@ -183,7 +183,7 @@ STATIC mp_obj_t aesio_aes_encrypt_into(mp_obj_t aesio_obj, mp_obj_t src, STATIC MP_DEFINE_CONST_FUN_OBJ_3(aesio_aes_encrypt_into_obj, aesio_aes_encrypt_into); -//| def decrypt_into(src: bytes, dest: bytearray) -> None: +//| def decrypt_into(src: Union[bytes, bytearray, memoryview], dest: Union[bytes, bytearray, memoryview]) -> None: //| //| """Decrypt the buffer from ``src`` into ``dest``. //| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c index 4aa1787992..7b2e04c34f 100644 --- a/shared-bindings/audiobusio/PDMIn.c +++ b/shared-bindings/audiobusio/PDMIn.c @@ -168,7 +168,7 @@ STATIC mp_obj_t audiobusio_pdmin_obj___exit__(size_t n_args, const mp_obj_t *arg STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_pdmin___exit___obj, 4, 4, audiobusio_pdmin_obj___exit__); -//| def record(self, destination: bytearray, destination_length: int) -> None: +//| def record(self, destination: Union[bytes, bytearray, memoryview], destination_length: int) -> None: //| """Records destination_length bytes of samples to destination. This is //| blocking. //| diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index 6f7d270058..7df169cc97 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -40,7 +40,7 @@ //| be 8 bit unsigned or 16 bit signed. If a buffer is provided, it will be used instead of allocating //| an internal buffer.""" //| -//| def __init__(self, file: typing.BinaryIO, buffer: bytearray): +//| def __init__(self, file: typing.BinaryIO, buffer: Union[bytes, bytearray, memoryview]): //| """Load a .wav file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. //| //| :param typing.BinaryIO file: Already opened wave file diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index 4d4792cdc5..d9ec490825 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -37,7 +37,7 @@ //| class MP3: //| """Load a mp3 file for audio playback""" //| -//| def __init__(self, file: typing.BinaryIO, buffer: bytearray): +//| def __init__(self, file: typing.BinaryIO, buffer: Union[bytes, bytearray, memoryview]): //| //| """Load a .mp3 file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. //| diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index ae5d613cfd..37ed617703 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -165,7 +165,7 @@ STATIC mp_obj_t bitbangio_i2c_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_unlock_obj, bitbangio_i2c_obj_unlock); -//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> None: +//| def readfrom_into(self, address: int, buffer: Union[bytes, bytearray, memoryview], *, start: int = 0, end: int = None) -> None: //| """Read into ``buffer`` from the device selected by ``address``. //| The number of bytes read will be the length of ``buffer``. //| At least one byte must be read. @@ -217,7 +217,7 @@ STATIC mp_obj_t bitbangio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_a } MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_readfrom_into_obj, 3, bitbangio_i2c_readfrom_into); -//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> None: +//| def writeto(self, address: int, buffer: Union[bytes, bytearray, memoryview], *, start: int = 0, end: int = None, stop: bool = True) -> None: //| """Write the bytes from ``buffer`` to the device selected by ``address`` and then transmits a //| stop bit. Use `writeto_then_readfrom` when needing a write, no stop and repeated start //| before a read. @@ -277,7 +277,7 @@ STATIC mp_obj_t bitbangio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, m STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_writeto_obj, 1, bitbangio_i2c_writeto); -//| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: +//| def writeto_then_readfrom(self, address: int, out_buffer: Union[bytes, bytearray, memoryview], in_buffer: Union[bytes, bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: //| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and //| ``in_buffer`` can be the same buffer because they are used sequentially. diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index f69b812360..2e5a811cf0 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -200,7 +200,7 @@ STATIC mp_obj_t bitbangio_spi_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_spi_unlock_obj, bitbangio_spi_obj_unlock); -//| def write(self, buf: bytes) -> None: +//| def write(self, buf: Union[bytes, bytearray, memoryview]) -> None: //| """Write the data contained in ``buf``. Requires the SPI being locked. //| If the buffer is empty, nothing happens.""" //| ... @@ -224,7 +224,7 @@ STATIC mp_obj_t bitbangio_spi_write(mp_obj_t self_in, mp_obj_t wr_buf) { MP_DEFINE_CONST_FUN_OBJ_2(bitbangio_spi_write_obj, bitbangio_spi_write); -//| def readinto(self, buf: bytearray) -> None: +//| def readinto(self, buf: Union[bytes, bytearray, memoryview]) -> None: //| """Read into the buffer specified by ``buf`` while writing zeroes. //| Requires the SPI being locked. //| If the number of bytes to read is 0, nothing happens.""" @@ -248,7 +248,7 @@ STATIC mp_obj_t bitbangio_spi_readinto(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitbangio_spi_readinto_obj, 2, 2, bitbangio_spi_readinto); -//| def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: +//| def write_readinto(self, buffer_out: Union[bytes, bytearray, memoryview], buffer_in: Union[bytes, bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: //| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. //| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` //| must be equal. diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 7de9d5d4df..eb33a24594 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -164,7 +164,7 @@ STATIC mp_obj_t busio_i2c_obj_try_lock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_try_lock_obj, busio_i2c_obj_try_lock); -//| def unlock(self, ) -> none: +//| def unlock(self, ) -> None: //| """Releases the I2C lock.""" //| ... //| @@ -176,7 +176,7 @@ STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock); -//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> None: +//| def readfrom_into(self, address: int, buffer: Union[bytes, bytearray, memoryview], *, start: int = 0, end: int = None) -> None: //| """Read into ``buffer`` from the device selected by ``address``. //| The number of bytes read will be the length of ``buffer``. //| At least one byte must be read. @@ -228,7 +228,7 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args, } MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_into); -//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> None: +//| def writeto(self, address: int, buffer: Union[bytes, bytearray, memoryview], *, start: int = 0, end: int = None, stop: bool = True) -> None: //| """Write the bytes from ``buffer`` to the device selected by ``address``. //| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be //| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and @@ -287,7 +287,7 @@ STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_ma } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto); -//| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: +//| def writeto_then_readfrom(self, address: int, out_buffer: Union[bytes, bytearray, memoryview], in_buffer: Union[bytes, bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: //| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and //| ``in_buffer`` can be the same buffer because they are used sequentially. From 522b17ca93d4e1d64bb113057c8a62992a22c4ab Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 13:25:07 -0400 Subject: [PATCH 0175/1293] Made suggested changes --- shared-bindings/aesio/aes.c | 4 ++-- shared-bindings/analogio/AnalogOut.c | 2 +- shared-bindings/audiobusio/I2SOut.c | 2 +- shared-bindings/audiobusio/PDMIn.c | 2 +- shared-bindings/audiocore/WaveFile.c | 2 +- shared-bindings/audioio/AudioOut.c | 12 ++++++------ shared-bindings/audiomixer/MixerVoice.c | 2 +- shared-bindings/audiomp3/MP3Decoder.c | 2 +- shared-bindings/bitbangio/I2C.c | 4 ++-- shared-bindings/bitbangio/SPI.c | 4 ++-- shared-bindings/busio/I2C.c | 4 ++-- shared-bindings/busio/SPI.c | 4 ++-- shared-bindings/busio/UART.c | 6 +++--- 13 files changed, 25 insertions(+), 25 deletions(-) diff --git a/shared-bindings/aesio/aes.c b/shared-bindings/aesio/aes.c index 4fa6ac6e8f..c8d4ee82ca 100644 --- a/shared-bindings/aesio/aes.c +++ b/shared-bindings/aesio/aes.c @@ -152,7 +152,7 @@ STATIC void validate_length(aesio_aes_obj_t *self, size_t src_length, } } -//| def encrypt_into(src: Union[bytes, bytearray, memoryview], dest: Union[bytes, bytearray, memoryview]) -> None: +//| def encrypt_into(src: Union[bytearray, memoryview], dest: Union[bytearray, memoryview]) -> None: //| """Encrypt the buffer from ``src`` into ``dest``. //| //| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the @@ -183,7 +183,7 @@ STATIC mp_obj_t aesio_aes_encrypt_into(mp_obj_t aesio_obj, mp_obj_t src, STATIC MP_DEFINE_CONST_FUN_OBJ_3(aesio_aes_encrypt_into_obj, aesio_aes_encrypt_into); -//| def decrypt_into(src: Union[bytes, bytearray, memoryview], dest: Union[bytes, bytearray, memoryview]) -> None: +//| def decrypt_into(src: Union[bytearray, memoryview], dest: Union[bytearray, memoryview]) -> None: //| //| """Decrypt the buffer from ``src`` into ``dest``. //| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index 11957e8e9d..c8f7bc5d78 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -97,7 +97,7 @@ STATIC mp_obj_t analogio_analogout___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogout___exit___obj, 4, 4, analogio_analogout___exit__); -//| value: None = ... +//| value: int = ... //| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (write-only) //| //| Even if the underlying digital to analog converter (DAC) is lower diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index dd212cdb54..04fb8fa81c 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -147,7 +147,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj___exit__(size_t n_args, const mp_obj_t *ar STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_i2sout___exit___obj, 4, 4, audiobusio_i2sout_obj___exit__); -//| def play(self, sample: Union[audiocore.WaveFile, audiocore.RawSample, audiomixe.Mixer], *, loop: Any = False) -> None: +//| def play(self, sample: Union[audiocore.WaveFile, audiocore.RawSample, audiomixe.Mixer], *, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c index 7b2e04c34f..8c16a980f7 100644 --- a/shared-bindings/audiobusio/PDMIn.c +++ b/shared-bindings/audiobusio/PDMIn.c @@ -168,7 +168,7 @@ STATIC mp_obj_t audiobusio_pdmin_obj___exit__(size_t n_args, const mp_obj_t *arg STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_pdmin___exit___obj, 4, 4, audiobusio_pdmin_obj___exit__); -//| def record(self, destination: Union[bytes, bytearray, memoryview], destination_length: int) -> None: +//| def record(self, destination: Union[bytearray, memoryview], destination_length: int) -> None: //| """Records destination_length bytes of samples to destination. This is //| blocking. //| diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index 7df169cc97..71ee78f781 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -125,7 +125,7 @@ STATIC mp_obj_t audioio_wavefile_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_wavefile___exit___obj, 4, 4, audioio_wavefile_obj___exit__); -//| sample_rate: Optional(int) = ... +//| sample_rate: Optional[int] = ... //| """32 bit value that dictates how quickly samples are loaded into the DAC //| in Hertz (cycles per second). When the sample is looped, this can change //| the pitch output without changing the underlying sample.""" diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index 25b3d01ffa..a500eb7c79 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -111,7 +111,7 @@ STATIC mp_obj_t audioio_audioout_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> None: +//| def deinit(self) -> None: //| """Deinitialises the AudioOut and releases any hardware resources for reuse.""" //| ... //| @@ -127,13 +127,13 @@ STATIC void check_for_deinit(audioio_audioout_obj_t *self) { raise_deinited_error(); } } -//| def __enter__(self, ) -> AudioOut: +//| def __enter__(self) -> AudioOut: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> None: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -175,7 +175,7 @@ STATIC mp_obj_t audioio_audioout_obj_play(size_t n_args, const mp_obj_t *pos_arg } MP_DEFINE_CONST_FUN_OBJ_KW(audioio_audioout_play_obj, 1, audioio_audioout_obj_play); -//| def stop(self, ) -> None: +//| def stop(self) -> None: //| """Stops playback and resets to the start of the sample.""" //| ... //| @@ -204,7 +204,7 @@ const mp_obj_property_t audioio_audioout_playing_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def pause(self, ) -> None: +//| def pause(self) -> None: //| """Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" //| ... //| @@ -220,7 +220,7 @@ STATIC mp_obj_t audioio_audioout_obj_pause(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_pause_obj, audioio_audioout_obj_pause); -//| def resume(self, ) -> None: +//| def resume(self) -> None: //| """Resumes sample playback after :py:func:`pause`.""" //| ... //| diff --git a/shared-bindings/audiomixer/MixerVoice.c b/shared-bindings/audiomixer/MixerVoice.c index eb0c399d5e..d1b0bcfcd1 100644 --- a/shared-bindings/audiomixer/MixerVoice.c +++ b/shared-bindings/audiomixer/MixerVoice.c @@ -100,7 +100,7 @@ STATIC mp_obj_t audiomixer_mixervoice_obj_stop(size_t n_args, const mp_obj_t *po } MP_DEFINE_CONST_FUN_OBJ_KW(audiomixer_mixervoice_stop_obj, 1, audiomixer_mixervoice_obj_stop); -//| level: None = ... +//| level: float = ... //| """The volume level of a voice, as a floating point number between 0 and 1.""" //| STATIC mp_obj_t audiomixer_mixervoice_obj_get_level(mp_obj_t self_in) { diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index d9ec490825..b790aecb51 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -37,7 +37,7 @@ //| class MP3: //| """Load a mp3 file for audio playback""" //| -//| def __init__(self, file: typing.BinaryIO, buffer: Union[bytes, bytearray, memoryview]): +//| def __init__(self, file: typing.BinaryIO, buffer: Union[bytearray, memoryview]): //| //| """Load a .mp3 file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. //| diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index 37ed617703..b32cbe650e 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -165,7 +165,7 @@ STATIC mp_obj_t bitbangio_i2c_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_unlock_obj, bitbangio_i2c_obj_unlock); -//| def readfrom_into(self, address: int, buffer: Union[bytes, bytearray, memoryview], *, start: int = 0, end: int = None) -> None: +//| def readfrom_into(self, address: int, buffer: Union[bytearray, memoryview], *, start: int = 0, end: int = None) -> None: //| """Read into ``buffer`` from the device selected by ``address``. //| The number of bytes read will be the length of ``buffer``. //| At least one byte must be read. @@ -277,7 +277,7 @@ STATIC mp_obj_t bitbangio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, m STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_writeto_obj, 1, bitbangio_i2c_writeto); -//| def writeto_then_readfrom(self, address: int, out_buffer: Union[bytes, bytearray, memoryview], in_buffer: Union[bytes, bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: +//| def writeto_then_readfrom(self, address: int, out_buffer: Union[bytearray, memoryview], in_buffer: Union[bytes, bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: //| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and //| ``in_buffer`` can be the same buffer because they are used sequentially. diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index 2e5a811cf0..8b69c04f23 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -224,7 +224,7 @@ STATIC mp_obj_t bitbangio_spi_write(mp_obj_t self_in, mp_obj_t wr_buf) { MP_DEFINE_CONST_FUN_OBJ_2(bitbangio_spi_write_obj, bitbangio_spi_write); -//| def readinto(self, buf: Union[bytes, bytearray, memoryview]) -> None: +//| def readinto(self, buf: Union[bytearray, memoryview]) -> None: //| """Read into the buffer specified by ``buf`` while writing zeroes. //| Requires the SPI being locked. //| If the number of bytes to read is 0, nothing happens.""" @@ -248,7 +248,7 @@ STATIC mp_obj_t bitbangio_spi_readinto(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitbangio_spi_readinto_obj, 2, 2, bitbangio_spi_readinto); -//| def write_readinto(self, buffer_out: Union[bytes, bytearray, memoryview], buffer_in: Union[bytes, bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: +//| def write_readinto(self, buffer_out: Union[bytes, bytearray, memoryview], buffer_in: Union[bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: //| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. //| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` //| must be equal. diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index eb33a24594..0b4079d4f3 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -176,7 +176,7 @@ STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock); -//| def readfrom_into(self, address: int, buffer: Union[bytes, bytearray, memoryview], *, start: int = 0, end: int = None) -> None: +//| def readfrom_into(self, address: int, buffer: Union[bytearray, memoryview], *, start: int = 0, end: int = None) -> None: //| """Read into ``buffer`` from the device selected by ``address``. //| The number of bytes read will be the length of ``buffer``. //| At least one byte must be read. @@ -287,7 +287,7 @@ STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_ma } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto); -//| def writeto_then_readfrom(self, address: int, out_buffer: Union[bytes, bytearray, memoryview], in_buffer: Union[bytes, bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: +//| def writeto_then_readfrom(self, address: int, out_buffer: Union[bytes, bytearray, memoryview], in_buffer: Union[bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: //| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and //| ``in_buffer`` can be the same buffer because they are used sequentially. diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 3d28adbcb5..12eccab95e 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -228,7 +228,7 @@ STATIC mp_obj_t busio_spi_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_unlock_obj, busio_spi_obj_unlock); -//| def write(self, buffer: bytes, *, start: int = 0, end: int = None) -> None: +//| def write(self, buffer: Union[bytes, bytearray, memoryview], *, start: int = 0, end: int = None) -> None: //| """Write the data contained in ``buffer``. The SPI object must be locked. //| If the buffer is empty, nothing happens. //| @@ -314,7 +314,7 @@ STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_m } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_readinto_obj, 2, busio_spi_readinto); -//| def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: int = 0, out_end: int = None, in_start: None = 0, in_end: int = None) -> None: +//| def write_readinto(self, buffer_out: Union[bytes, bytearray, memoryview], buffer_in: Union[bytes, bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: //| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. //| The SPI object must be locked. //| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 133caee198..af0d4dbcd4 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -190,7 +190,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| ... //| -//| def readinto(self, buf: bytes) -> Optional[int]: +//| def readinto(self, buf: Union[bytearray, memoryview]) -> Optional[int]: //| """Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. //| //| :return: number of bytes read and stored into ``buf`` @@ -200,7 +200,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| ... //| -//| def readline(self, ) -> Optional[int]: +//| def readline(self, ) -> bytes: //| """Read a line, ending in a newline character. //| //| :return: the line read @@ -208,7 +208,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| ... //| -//| def write(self, buf: bytearray) -> Optional[int]: +//| def write(self, buf: Union[bytearray, memoryview]) -> Optional[int]: //| """Write the buffer of bytes to the bus. //| //| *New in CircuitPython 4.0:* ``buf`` must be bytes, not a string. From 54cb1feea04c0c93afe40868bc050ff7f645c61e Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 13:28:36 -0400 Subject: [PATCH 0176/1293] Removed all 'self, )' --- shared-bindings/_eve/__init__.c | 14 +++++++------- shared-bindings/_pixelbuf/PixelBuf.c | 2 +- shared-bindings/analogio/AnalogIn.c | 6 +++--- shared-bindings/analogio/AnalogOut.c | 6 +++--- shared-bindings/audiobusio/I2SOut.c | 12 ++++++------ shared-bindings/audiobusio/PDMIn.c | 6 +++--- shared-bindings/audiocore/RawSample.c | 6 +++--- shared-bindings/audiocore/WaveFile.c | 6 +++--- shared-bindings/audiomixer/Mixer.c | 6 +++--- shared-bindings/audiomixer/MixerVoice.c | 4 ++-- shared-bindings/audiomp3/MP3Decoder.c | 6 +++--- shared-bindings/audiopwmio/PWMAudioOut.c | 12 ++++++------ shared-bindings/bitbangio/I2C.c | 12 ++++++------ shared-bindings/bitbangio/OneWire.c | 10 +++++----- shared-bindings/bitbangio/SPI.c | 10 +++++----- shared-bindings/busio/I2C.c | 12 ++++++------ shared-bindings/busio/OneWire.c | 10 +++++----- shared-bindings/busio/SPI.c | 10 +++++----- shared-bindings/busio/UART.c | 10 +++++----- shared-bindings/digitalio/DigitalInOut.c | 4 ++-- shared-bindings/digitalio/Direction.c | 2 +- shared-bindings/digitalio/DriveMode.c | 2 +- shared-bindings/digitalio/Pull.c | 2 +- shared-bindings/displayio/EPaperDisplay.c | 2 +- shared-bindings/displayio/FourWire.c | 2 +- shared-bindings/displayio/Group.c | 2 +- shared-bindings/displayio/I2CDisplay.c | 2 +- shared-bindings/displayio/Palette.c | 2 +- shared-bindings/displayio/ParallelBus.c | 2 +- shared-bindings/fontio/BuiltinFont.c | 4 ++-- shared-bindings/frequencyio/FrequencyIn.c | 12 ++++++------ shared-bindings/gamepad/GamePad.c | 4 ++-- shared-bindings/gamepadshift/GamePadShift.c | 4 ++-- shared-bindings/gnss/GNSS.c | 6 +++--- shared-bindings/gnss/PositionFix.c | 2 +- shared-bindings/gnss/SatelliteSystem.c | 2 +- shared-bindings/i2cperipheral/I2CPeripheral.c | 10 +++++----- shared-bindings/microcontroller/Pin.c | 2 +- shared-bindings/microcontroller/Processor.c | 2 +- shared-bindings/microcontroller/RunMode.c | 2 +- shared-bindings/nvm/ByteArray.c | 4 ++-- shared-bindings/ps2io/Ps2.c | 12 ++++++------ shared-bindings/pulseio/PWMOut.c | 6 +++--- shared-bindings/pulseio/PulseIn.c | 14 +++++++------- shared-bindings/pulseio/PulseOut.c | 6 +++--- shared-bindings/rgbmatrix/RGBMatrix.c | 2 +- shared-bindings/rotaryio/IncrementalEncoder.c | 6 +++--- shared-bindings/rtc/RTC.c | 2 +- shared-bindings/sdioio/SDCard.c | 4 ++-- shared-bindings/socket/__init__.c | 2 +- shared-bindings/supervisor/Runtime.c | 2 +- shared-bindings/touchio/TouchIn.c | 6 +++--- shared-bindings/usb_hid/Device.c | 2 +- shared-bindings/usb_midi/PortOut.c | 2 +- shared-bindings/watchdog/WatchDogMode.c | 2 +- shared-bindings/watchdog/WatchDogTimer.c | 2 +- 56 files changed, 153 insertions(+), 153 deletions(-) diff --git a/shared-bindings/_eve/__init__.c b/shared-bindings/_eve/__init__.c index 4fa48f2c75..8a329147b5 100644 --- a/shared-bindings/_eve/__init__.c +++ b/shared-bindings/_eve/__init__.c @@ -58,7 +58,7 @@ STATIC mp_obj_t _register(mp_obj_t self, mp_obj_t o) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(register_obj, _register); -//| def flush(self, ) -> Any: +//| def flush(self) -> Any: //| """Send any queued drawing commands directly to the hardware. //| //| :param int width: The width of the grid in tiles, or 1 for sprites.""" @@ -559,7 +559,7 @@ STATIC mp_obj_t _colorrgb(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(colorrgb_obj, 4, 4, _colorrgb); -//| def Display(self, ) -> Any: ... +//| def Display(self) -> Any: ... //| """End the display list""" //| @@ -570,7 +570,7 @@ STATIC mp_obj_t _display(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(display_obj, _display); -//| def End(self, ) -> Any: +//| def End(self) -> Any: //| """End drawing a graphics primitive //| //| :meth:`Vertex2ii` and :meth:`Vertex2f` calls are ignored until the next :meth:`Begin`.""" @@ -628,7 +628,7 @@ STATIC mp_obj_t _macro(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(macro_obj, _macro); -//| def Nop(self, ) -> Any: +//| def Nop(self) -> Any: //| """No operation""" //| ... //| @@ -672,7 +672,7 @@ STATIC mp_obj_t _pointsize(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(pointsize_obj, _pointsize); -//| def RestoreContext(self, ) -> Any: +//| def RestoreContext(self) -> Any: //| """Restore the current graphics context from the context stack""" //| ... //| @@ -684,7 +684,7 @@ STATIC mp_obj_t _restorecontext(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(restorecontext_obj, _restorecontext); -//| def Return(self, ) -> Any: +//| def Return(self) -> Any: //| """Return from a previous call command""" //| ... //| @@ -696,7 +696,7 @@ STATIC mp_obj_t _return(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(return_obj, _return); -//| def SaveContext(self, ) -> Any: +//| def SaveContext(self) -> Any: //| """Push the current graphics context on the context stack""" //| ... //| diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index c953951ea5..4c24776c3f 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -245,7 +245,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -//| def show(self, ) -> Any: +//| def show(self) -> Any: //| """Transmits the color data to the pixels so that they are shown. This is done automatically //| when `auto_write` is True.""" //| ... diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index b41abc8478..e52d9b16be 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -70,7 +70,7 @@ STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type, return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> None: +//| def deinit(self) -> None: //| """Turn off the AnalogIn and release the pin for other use.""" //| ... //| @@ -86,13 +86,13 @@ STATIC void check_for_deinit(analogio_analogin_obj_t *self) { raise_deinited_error(); } } -//| def __enter__(self, ) -> AnalogIn: +//| def __enter__(self) -> AnalogIn: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> None: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index c8f7bc5d78..9523b91a99 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -66,7 +66,7 @@ STATIC mp_obj_t analogio_analogout_make_new(const mp_obj_type_t *type, mp_uint_t return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> None: +//| def deinit(self) -> None: //| """Turn off the AnalogOut and release the pin for other use.""" //| ... //| @@ -79,13 +79,13 @@ STATIC mp_obj_t analogio_analogout_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(analogio_analogout_deinit_obj, analogio_analogout_deinit); -//| def __enter__(self, ) -> AnalogOut: +//| def __enter__(self) -> AnalogOut: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> None: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index 04fb8fa81c..5d1c4f5957 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -112,7 +112,7 @@ STATIC mp_obj_t audiobusio_i2sout_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> None: +//| def deinit(self) -> None: //| """Deinitialises the I2SOut and releases any hardware resources for reuse.""" //| ... //| @@ -128,13 +128,13 @@ STATIC void check_for_deinit(audiobusio_i2sout_obj_t *self) { raise_deinited_error(); } } -//| def __enter__(self, ) -> I2SOut: +//| def __enter__(self) -> I2SOut: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> None: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -174,7 +174,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj_play(size_t n_args, const mp_obj_t *pos_ar } MP_DEFINE_CONST_FUN_OBJ_KW(audiobusio_i2sout_play_obj, 1, audiobusio_i2sout_obj_play); -//| def stop(self, ) -> None: +//| def stop(self) -> None: //| """Stops playback.""" //| ... //| @@ -203,7 +203,7 @@ const mp_obj_property_t audiobusio_i2sout_playing_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def pause(self, ) -> None: +//| def pause(self) -> None: //| """Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" //| ... //| @@ -219,7 +219,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj_pause(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_pause_obj, audiobusio_i2sout_obj_pause); -//| def resume(self, ) -> None: +//| def resume(self) -> None: //| """Resumes sample playback after :py:func:`pause`.""" //| ... //| diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c index 8c16a980f7..cfb19d7ce3 100644 --- a/shared-bindings/audiobusio/PDMIn.c +++ b/shared-bindings/audiobusio/PDMIn.c @@ -134,7 +134,7 @@ STATIC mp_obj_t audiobusio_pdmin_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> None: +//| def deinit(self) -> None: //| """Deinitialises the PDMIn and releases any hardware resources for reuse.""" //| ... //| @@ -150,13 +150,13 @@ STATIC void check_for_deinit(audiobusio_pdmin_obj_t *self) { raise_deinited_error(); } } -//| def __enter__(self, ) -> PDMIn: +//| def __enter__(self) -> PDMIn: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> None: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context.""" //| ... //| diff --git a/shared-bindings/audiocore/RawSample.c b/shared-bindings/audiocore/RawSample.c index dec029bf41..dc5cfd8200 100644 --- a/shared-bindings/audiocore/RawSample.c +++ b/shared-bindings/audiocore/RawSample.c @@ -101,7 +101,7 @@ STATIC mp_obj_t audioio_rawsample_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> None: +//| def deinit(self) -> None: //| """Deinitialises the AudioOut and releases any hardware resources for reuse.""" //| ... //| @@ -118,13 +118,13 @@ STATIC void check_for_deinit(audioio_rawsample_obj_t *self) { } } -//| def __enter__(self, ) -> RawSample: +//| def __enter__(self) -> RawSample: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> None: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index 71ee78f781..4eed5eaca5 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -91,7 +91,7 @@ STATIC mp_obj_t audioio_wavefile_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> None: +//| def deinit(self) -> None: //| """Deinitialises the WaveFile and releases all memory resources for reuse.""" //| ... STATIC mp_obj_t audioio_wavefile_deinit(mp_obj_t self_in) { @@ -107,13 +107,13 @@ STATIC void check_for_deinit(audioio_wavefile_obj_t *self) { } } -//| def __enter__(self, ) -> WaveFile: +//| def __enter__(self) -> WaveFile: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> None: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... diff --git a/shared-bindings/audiomixer/Mixer.c b/shared-bindings/audiomixer/Mixer.c index abd09790f8..dc08a11264 100644 --- a/shared-bindings/audiomixer/Mixer.c +++ b/shared-bindings/audiomixer/Mixer.c @@ -121,7 +121,7 @@ STATIC mp_obj_t audiomixer_mixer_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> None: +//| def deinit(self) -> None: //| """Deinitialises the Mixer and releases any hardware resources for reuse.""" //| ... //| @@ -138,13 +138,13 @@ STATIC void check_for_deinit(audiomixer_mixer_obj_t *self) { } } -//| def __enter__(self, ) -> Mixer: +//| def __enter__(self) -> Mixer: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> None: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... diff --git a/shared-bindings/audiomixer/MixerVoice.c b/shared-bindings/audiomixer/MixerVoice.c index d1b0bcfcd1..cb313e0fb1 100644 --- a/shared-bindings/audiomixer/MixerVoice.c +++ b/shared-bindings/audiomixer/MixerVoice.c @@ -42,7 +42,7 @@ //| //| Used to access and control samples with `audiomixer.Mixer`.""" //| -//| def __init__(self, ): +//| def __init__(self): //| """MixerVoice instance object(s) created by `audiomixer.Mixer`.""" //| ... //| @@ -81,7 +81,7 @@ STATIC mp_obj_t audiomixer_mixervoice_obj_play(size_t n_args, const mp_obj_t *po } MP_DEFINE_CONST_FUN_OBJ_KW(audiomixer_mixervoice_play_obj, 1, audiomixer_mixervoice_obj_play); -//| def stop(self, ) -> None: +//| def stop(self) -> None: //| """Stops playback of the sample on this voice.""" //| ... //| diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index b790aecb51..a4fd6e61f6 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -89,7 +89,7 @@ STATIC mp_obj_t audiomp3_mp3file_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> None: +//| def deinit(self) -> None: //| """Deinitialises the MP3 and releases all memory resources for reuse.""" //| ... //| @@ -106,13 +106,13 @@ STATIC void check_for_deinit(audiomp3_mp3file_obj_t *self) { } } -//| def __enter__(self, ) -> MP3: +//| def __enter__(self) -> MP3: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> None: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index cb0b02fd66..b16538f174 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -114,7 +114,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_make_new(const mp_obj_type_t *type, size_ return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> None: +//| def deinit(self) -> None: //| """Deinitialises the PWMAudioOut and releases any hardware resources for reuse.""" //| ... //| @@ -130,13 +130,13 @@ STATIC void check_for_deinit(audiopwmio_pwmaudioout_obj_t *self) { raise_deinited_error(); } } -//| def __enter__(self, ) -> PWMAudioOut: +//| def __enter__(self) -> PWMAudioOut: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> None: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -177,7 +177,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj_play(size_t n_args, const mp_obj_t *p } MP_DEFINE_CONST_FUN_OBJ_KW(audiopwmio_pwmaudioout_play_obj, 1, audiopwmio_pwmaudioout_obj_play); -//| def stop(self, ) -> None: +//| def stop(self) -> None: //| """Stops playback and resets to the start of the sample.""" //| ... //| @@ -206,7 +206,7 @@ const mp_obj_property_t audiopwmio_pwmaudioout_playing_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def pause(self, ) -> None: +//| def pause(self) -> None: //| """Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" //| ... //| @@ -222,7 +222,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj_pause(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiopwmio_pwmaudioout_pause_obj, audiopwmio_pwmaudioout_obj_pause); -//| def resume(self, ) -> None: +//| def resume(self) -> None: //| """Resumes sample playback after :py:func:`pause`.""" //| ... //| diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index b32cbe650e..b10110430e 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -79,7 +79,7 @@ STATIC mp_obj_t bitbangio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, return (mp_obj_t)self; } -//| def deinit(self, ) -> None: +//| def deinit(self) -> None: //| """Releases control of the underlying hardware so other classes can use it.""" //| ... //| @@ -96,13 +96,13 @@ STATIC void check_for_deinit(bitbangio_i2c_obj_t *self) { } } -//| def __enter__(self, ) -> I2C: +//| def __enter__(self) -> I2C: //| """No-op used in Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> None: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware on context exit. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -120,7 +120,7 @@ static void check_lock(bitbangio_i2c_obj_t *self) { } } -//| def scan(self, ) -> list: +//| def scan(self) -> list: //| """Scan all I2C addresses between 0x08 and 0x77 inclusive and return a list of //| those that respond. A device responds if it pulls the SDA line low after //| its address (including a read bit) is sent on the bus.""" @@ -142,7 +142,7 @@ STATIC mp_obj_t bitbangio_i2c_scan(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_scan_obj, bitbangio_i2c_scan); -//| def try_lock(self, ) -> bool: +//| def try_lock(self) -> bool: //| """Attempts to grab the I2C lock. Returns True on success.""" //| ... //| @@ -153,7 +153,7 @@ STATIC mp_obj_t bitbangio_i2c_obj_try_lock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_try_lock_obj, bitbangio_i2c_obj_try_lock); -//| def unlock(self, ) -> None: +//| def unlock(self) -> None: //| """Releases the I2C lock.""" //| ... //| diff --git a/shared-bindings/bitbangio/OneWire.c b/shared-bindings/bitbangio/OneWire.c index 898eb3ba6f..b9fce5e056 100644 --- a/shared-bindings/bitbangio/OneWire.c +++ b/shared-bindings/bitbangio/OneWire.c @@ -78,7 +78,7 @@ STATIC mp_obj_t bitbangio_onewire_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> None: +//| def deinit(self) -> None: //| """Deinitialize the OneWire bus and release any hardware resources for reuse.""" //| ... //| @@ -95,13 +95,13 @@ STATIC void check_for_deinit(bitbangio_onewire_obj_t *self) { } } -//| def __enter__(self, ) -> OneWire: +//| def __enter__(self) -> OneWire: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> None: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -113,7 +113,7 @@ STATIC mp_obj_t bitbangio_onewire_obj___exit__(size_t n_args, const mp_obj_t *ar } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitbangio_onewire___exit___obj, 4, 4, bitbangio_onewire_obj___exit__); -//| def reset(self, ) -> bool: +//| def reset(self) -> bool: //| """Reset the OneWire bus""" //| ... //| @@ -125,7 +125,7 @@ STATIC mp_obj_t bitbangio_onewire_obj_reset(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_onewire_reset_obj, bitbangio_onewire_obj_reset); -//| def read_bit(self, ) -> bool: +//| def read_bit(self) -> bool: //| """Read in a bit //| //| :returns: bit state read diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index 8b69c04f23..597d8602be 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -90,7 +90,7 @@ STATIC mp_obj_t bitbangio_spi_make_new(const mp_obj_type_t *type, size_t n_args, return (mp_obj_t)self; } -//| def deinit(self, ) -> None: +//| def deinit(self) -> None: //| """Turn off the SPI bus.""" //| ... //| @@ -107,13 +107,13 @@ STATIC void check_for_deinit(bitbangio_spi_obj_t *self) { } } -//| def __enter__(self, ) -> SPI: +//| def __enter__(self) -> SPI: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> None: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -174,7 +174,7 @@ STATIC mp_obj_t bitbangio_spi_configure(size_t n_args, const mp_obj_t *pos_args, } MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_spi_configure_obj, 1, bitbangio_spi_configure); -//| def try_lock(self, ) -> bool: +//| def try_lock(self) -> bool: //| """Attempts to grab the SPI lock. Returns True on success. //| //| :return: True when lock has been grabbed @@ -188,7 +188,7 @@ STATIC mp_obj_t bitbangio_spi_obj_try_lock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_spi_try_lock_obj, bitbangio_spi_obj_try_lock); -//| def unlock(self, ) -> None: +//| def unlock(self) -> None: //| """Releases the SPI lock.""" //| ... //| diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 0b4079d4f3..2b3497c422 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -83,7 +83,7 @@ STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, con return (mp_obj_t)self; } -//| def deinit(self, ) -> None: +//| def deinit(self) -> None: //| """Releases control of the underlying hardware so other classes can use it.""" //| ... //| @@ -100,13 +100,13 @@ STATIC void check_for_deinit(busio_i2c_obj_t *self) { } } -//| def __enter__(self, ) -> I2C: +//| def __enter__(self) -> I2C: //| """No-op used in Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> None: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware on context exit. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -125,7 +125,7 @@ static void check_lock(busio_i2c_obj_t *self) { } } -//| def scan(self, ) -> list: +//| def scan(self) -> list: //| //| """Scan all I2C addresses between 0x08 and 0x77 inclusive and return a //| list of those that respond. @@ -150,7 +150,7 @@ STATIC mp_obj_t busio_i2c_scan(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_scan_obj, busio_i2c_scan); -//| def try_lock(self, ) -> bool: +//| def try_lock(self) -> bool: //| """Attempts to grab the I2C lock. Returns True on success. //| //| :return: True when lock has been grabbed @@ -164,7 +164,7 @@ STATIC mp_obj_t busio_i2c_obj_try_lock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_try_lock_obj, busio_i2c_obj_try_lock); -//| def unlock(self, ) -> None: +//| def unlock(self) -> None: //| """Releases the I2C lock.""" //| ... //| diff --git a/shared-bindings/busio/OneWire.c b/shared-bindings/busio/OneWire.c index 08a79daa9b..66f0fba3da 100644 --- a/shared-bindings/busio/OneWire.c +++ b/shared-bindings/busio/OneWire.c @@ -77,7 +77,7 @@ STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> None: +//| def deinit(self) -> None: //| """Deinitialize the OneWire bus and release any hardware resources for reuse.""" //| ... //| @@ -94,13 +94,13 @@ STATIC void check_for_deinit(busio_onewire_obj_t *self) { } } -//| def __enter__(self, ) -> OneWire: +//| def __enter__(self) -> OneWire: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> None: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -112,7 +112,7 @@ STATIC mp_obj_t busio_onewire_obj___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_onewire___exit___obj, 4, 4, busio_onewire_obj___exit__); -//| def reset(self, ) -> bool: +//| def reset(self) -> bool: //| """Reset the OneWire bus and read presence //| //| :returns: False when at least one device is present @@ -127,7 +127,7 @@ STATIC mp_obj_t busio_onewire_obj_reset(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_reset_obj, busio_onewire_obj_reset); -//| def read_bit(self, ) -> bool: +//| def read_bit(self) -> bool: //| """Read in a bit //| //| :returns: bit state read diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 12eccab95e..e5b0da4a65 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -100,7 +100,7 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, con return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> None: +//| def deinit(self) -> None: //| """Turn off the SPI bus.""" //| ... //| @@ -111,13 +111,13 @@ STATIC mp_obj_t busio_spi_obj_deinit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_deinit_obj, busio_spi_obj_deinit); -//| def __enter__(self, ) -> SPI: +//| def __enter__(self) -> SPI: //| """No-op used by Context Managers. //| Provided by context manager helper.""" //| ... //| -//| def __exit__(self, ) -> None: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -201,7 +201,7 @@ STATIC mp_obj_t busio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_ } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_configure_obj, 1, busio_spi_configure); -//| def try_lock(self, ) -> bool: +//| def try_lock(self) -> bool: //| """Attempts to grab the SPI lock. Returns True on success. //| //| :return: True when lock has been grabbed @@ -215,7 +215,7 @@ STATIC mp_obj_t busio_spi_obj_try_lock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_try_lock_obj, busio_spi_obj_try_lock); -//| def unlock(self, ) -> None: +//| def unlock(self) -> None: //| """Releases the SPI lock.""" //| ... //| diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index af0d4dbcd4..2ce1467bbb 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -142,7 +142,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co return (mp_obj_t)self; } -//| def deinit(self, ) -> None: +//| def deinit(self) -> None: //| """Deinitialises the UART and releases any hardware resources for reuse.""" //| ... //| @@ -159,13 +159,13 @@ STATIC void check_for_deinit(busio_uart_obj_t *self) { } } -//| def __enter__(self, ) -> UART: +//| def __enter__(self) -> UART: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> None: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -200,7 +200,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| ... //| -//| def readline(self, ) -> bytes: +//| def readline(self) -> bytes: //| """Read a line, ending in a newline character. //| //| :return: the line read @@ -332,7 +332,7 @@ const mp_obj_property_t busio_uart_timeout_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def reset_input_buffer(self, ) -> None: +//| def reset_input_buffer(self) -> None: //| """Discard any unread characters in the input buffer.""" //| ... //| diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index eaf2c18101..21dc4dfed6 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -82,13 +82,13 @@ STATIC mp_obj_t digitalio_digitalinout_obj_deinit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(digitalio_digitalinout_deinit_obj, digitalio_digitalinout_obj_deinit); -//| def __enter__(self, ) -> DigitalInOut: +//| def __enter__(self) -> DigitalInOut: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> None: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... diff --git a/shared-bindings/digitalio/Direction.c b/shared-bindings/digitalio/Direction.c index dbd0e93e47..56e2a281c4 100644 --- a/shared-bindings/digitalio/Direction.c +++ b/shared-bindings/digitalio/Direction.c @@ -41,7 +41,7 @@ //| class Direction: //| """Defines the direction of a digital pin""" //| -//| def __init__(self, ): +//| def __init__(self): //| """Enum-like class to define which direction the digital values are //| going.""" //| ... diff --git a/shared-bindings/digitalio/DriveMode.c b/shared-bindings/digitalio/DriveMode.c index 31b682d388..d1d962d341 100644 --- a/shared-bindings/digitalio/DriveMode.c +++ b/shared-bindings/digitalio/DriveMode.c @@ -29,7 +29,7 @@ //| class DriveMode: //| """Defines the drive mode of a digital pin""" //| -//| def __init__(self, ): +//| def __init__(self): //| """Enum-like class to define the drive mode used when outputting //| digital values.""" //| ... diff --git a/shared-bindings/digitalio/Pull.c b/shared-bindings/digitalio/Pull.c index 9aeec1f331..46d12bf882 100644 --- a/shared-bindings/digitalio/Pull.c +++ b/shared-bindings/digitalio/Pull.c @@ -29,7 +29,7 @@ //| class Pull: //| """Defines the pull of a digital input pin""" //| -//| def __init__(self, ): +//| def __init__(self): //| """Enum-like class to define the pull value, if any, used while reading //| digital values in.""" //| ... diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index 8b77e4df37..1bae0532a1 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -190,7 +190,7 @@ STATIC mp_obj_t displayio_epaperdisplay_obj_show(mp_obj_t self_in, mp_obj_t grou } MP_DEFINE_CONST_FUN_OBJ_2(displayio_epaperdisplay_show_obj, displayio_epaperdisplay_obj_show); -//| def refresh(self, ) -> Any: +//| def refresh(self) -> Any: //| """Refreshes the display immediately or raises an exception if too soon. Use //| ``time.sleep(display.time_to_refresh)`` to sleep until a refresh can occur.""" //| ... diff --git a/shared-bindings/displayio/FourWire.c b/shared-bindings/displayio/FourWire.c index 5ee4ec5a9a..ad8656c0ee 100644 --- a/shared-bindings/displayio/FourWire.c +++ b/shared-bindings/displayio/FourWire.c @@ -96,7 +96,7 @@ STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_ return self; } -//| def reset(self, ) -> Any: +//| def reset(self) -> Any: //| """Performs a hardware reset via the reset pin. Raises an exception if called when no reset pin //| is available.""" //| ... diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index b6f96883b9..9eb641f639 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -264,7 +264,7 @@ STATIC mp_obj_t displayio_group_obj_remove(mp_obj_t self_in, mp_obj_t layer) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_remove_obj, displayio_group_obj_remove); -//| def __len__(self, ) -> Any: +//| def __len__(self) -> Any: //| """Returns the number of layers in a Group""" //| ... //| diff --git a/shared-bindings/displayio/I2CDisplay.c b/shared-bindings/displayio/I2CDisplay.c index 0cfac66720..a97c295212 100644 --- a/shared-bindings/displayio/I2CDisplay.c +++ b/shared-bindings/displayio/I2CDisplay.c @@ -76,7 +76,7 @@ STATIC mp_obj_t displayio_i2cdisplay_make_new(const mp_obj_type_t *type, size_t return self; } -//| def reset(self, ) -> Any: +//| def reset(self) -> Any: //| """Performs a hardware reset via the reset pin. Raises an exception if called when no reset pin //| is available.""" //| ... diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c index 37cfbd82e9..4823fdae2d 100644 --- a/shared-bindings/displayio/Palette.c +++ b/shared-bindings/displayio/Palette.c @@ -70,7 +70,7 @@ STATIC mp_obj_t displayio_palette_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(self); } -//| def __len__(self, ) -> Any: +//| def __len__(self) -> Any: //| """Returns the number of colors in a Palette""" //| ... //| diff --git a/shared-bindings/displayio/ParallelBus.c b/shared-bindings/displayio/ParallelBus.c index eb75ecc038..0fff2e5276 100644 --- a/shared-bindings/displayio/ParallelBus.c +++ b/shared-bindings/displayio/ParallelBus.c @@ -86,7 +86,7 @@ STATIC mp_obj_t displayio_parallelbus_make_new(const mp_obj_type_t *type, size_t return self; } -//| def reset(self, ) -> Any: +//| def reset(self) -> Any: //| """Performs a hardware reset via the reset pin. Raises an exception if called when no reset pin //| is available.""" //| ... diff --git a/shared-bindings/fontio/BuiltinFont.c b/shared-bindings/fontio/BuiltinFont.c index bf9a658739..169937553a 100644 --- a/shared-bindings/fontio/BuiltinFont.c +++ b/shared-bindings/fontio/BuiltinFont.c @@ -39,7 +39,7 @@ //| class BuiltinFont: //| """A font built into CircuitPython""" //| -//| def __init__(self, ): +//| def __init__(self): //| """Creation not supported. Available fonts are defined when CircuitPython is built. See the //| `Adafruit_CircuitPython_Bitmap_Font `_ //| library for dynamically loaded fonts.""" @@ -64,7 +64,7 @@ const mp_obj_property_t fontio_builtinfont_bitmap_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def get_bounding_box(self, ) -> Any: +//| def get_bounding_box(self) -> Any: //| """Returns the maximum bounds of all glyphs in the font in a tuple of two values: width, height.""" //| ... //| diff --git a/shared-bindings/frequencyio/FrequencyIn.c b/shared-bindings/frequencyio/FrequencyIn.c index 2d628088b7..cadcf7a26e 100644 --- a/shared-bindings/frequencyio/FrequencyIn.c +++ b/shared-bindings/frequencyio/FrequencyIn.c @@ -94,7 +94,7 @@ STATIC mp_obj_t frequencyio_frequencyin_make_new(const mp_obj_type_t *type, size return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self) -> Any: //| """Deinitialises the FrequencyIn and releases any hardware resources for reuse.""" //| ... //| @@ -111,13 +111,13 @@ STATIC void check_for_deinit(frequencyio_frequencyin_obj_t *self) { } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self) -> Any: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self) -> Any: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -129,7 +129,7 @@ STATIC mp_obj_t frequencyio_frequencyin_obj___exit__(size_t n_args, const mp_obj } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(frequencyio_frequencyin___exit___obj, 4, 4, frequencyio_frequencyin_obj___exit__); -//| def pause(self, ) -> Any: +//| def pause(self) -> Any: //| """Pause frequency capture.""" //| ... //| @@ -142,7 +142,7 @@ STATIC mp_obj_t frequencyio_frequencyin_obj_pause(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(frequencyio_frequencyin_pause_obj, frequencyio_frequencyin_obj_pause); -//| def resume(self, ) -> Any: +//| def resume(self) -> Any: //| """Resumes frequency capture.""" //| ... //| @@ -155,7 +155,7 @@ STATIC mp_obj_t frequencyio_frequencyin_obj_resume(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(frequencyio_frequencyin_resume_obj, frequencyio_frequencyin_obj_resume); -//| def clear(self, ) -> Any: +//| def clear(self) -> Any: //| """Clears the last detected frequency capture value.""" //| ... //| diff --git a/shared-bindings/gamepad/GamePad.c b/shared-bindings/gamepad/GamePad.c index 9a23344b3c..5e035762e8 100644 --- a/shared-bindings/gamepad/GamePad.c +++ b/shared-bindings/gamepad/GamePad.c @@ -114,7 +114,7 @@ STATIC mp_obj_t gamepad_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(gamepad_singleton); } -//| def get_pressed(self, ) -> Any: +//| def get_pressed(self) -> Any: //| """Get the status of buttons pressed since the last call and clear it. //| //| Returns an 8-bit number, with bits that correspond to buttons, @@ -133,7 +133,7 @@ STATIC mp_obj_t gamepad_get_pressed(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(gamepad_get_pressed_obj, gamepad_get_pressed); -//| def deinit(self, ) -> Any: +//| def deinit(self) -> Any: //| """Disable button scanning.""" //| ... //| diff --git a/shared-bindings/gamepadshift/GamePadShift.c b/shared-bindings/gamepadshift/GamePadShift.c index 854f092ada..782d9724dc 100644 --- a/shared-bindings/gamepadshift/GamePadShift.c +++ b/shared-bindings/gamepadshift/GamePadShift.c @@ -82,7 +82,7 @@ STATIC mp_obj_t gamepadshift_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(gamepad_singleton); } -//| def get_pressed(self, ) -> Any: +//| def get_pressed(self) -> Any: //| """Get the status of buttons pressed since the last call and clear it. //| //| Returns an 8-bit number, with bits that correspond to buttons, @@ -100,7 +100,7 @@ STATIC mp_obj_t gamepadshift_get_pressed(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(gamepadshift_get_pressed_obj, gamepadshift_get_pressed); -//| def deinit(self, ) -> Any: +//| def deinit(self) -> Any: //| """Disable button scanning.""" //| ... //| diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c index 929e02ab81..59ec038dd1 100644 --- a/shared-bindings/gnss/GNSS.c +++ b/shared-bindings/gnss/GNSS.c @@ -53,7 +53,7 @@ //| print("Longitude: {0:.6f} degrees".format(nav.longitude))""" //| -//| def __init__(self, ): +//| def __init__(self): //| """Turn on the GNSS. //| //| :param gnss.SatelliteSystem system: satellite system to use""" @@ -90,7 +90,7 @@ STATIC mp_obj_t gnss_make_new(const mp_obj_type_t *type, size_t n_args, const mp return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self) -> Any: //| """Turn off the GNSS.""" //| ... //| @@ -107,7 +107,7 @@ STATIC void check_for_deinit(gnss_obj_t *self) { } } -//| def update(self, ) -> Any: +//| def update(self) -> Any: //| """Update GNSS positioning information.""" //| ... //| diff --git a/shared-bindings/gnss/PositionFix.c b/shared-bindings/gnss/PositionFix.c index 106a28c347..016603f049 100644 --- a/shared-bindings/gnss/PositionFix.c +++ b/shared-bindings/gnss/PositionFix.c @@ -29,7 +29,7 @@ //| class PositionFix: //| """Position fix mode""" //| -//| def __init__(self, ): +//| def __init__(self): //| """Enum-like class to define the position fix mode.""" //| //| INVALID: Any = ... diff --git a/shared-bindings/gnss/SatelliteSystem.c b/shared-bindings/gnss/SatelliteSystem.c index badc02b964..6d3fb4782d 100644 --- a/shared-bindings/gnss/SatelliteSystem.c +++ b/shared-bindings/gnss/SatelliteSystem.c @@ -29,7 +29,7 @@ //| class SatelliteSystem: //| """Satellite system type""" //| -//| def __init__(self, ): +//| def __init__(self): //| """Enum-like class to define the satellite system type.""" //| //| GPS: Any = ... diff --git a/shared-bindings/i2cperipheral/I2CPeripheral.c b/shared-bindings/i2cperipheral/I2CPeripheral.c index 4a3900174a..696c3b3883 100644 --- a/shared-bindings/i2cperipheral/I2CPeripheral.c +++ b/shared-bindings/i2cperipheral/I2CPeripheral.c @@ -102,7 +102,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_make_new(const mp_obj_type_t *type, return (mp_obj_t)self; } -//| def deinit(self, ) -> Any: +//| def deinit(self) -> Any: //| """Releases control of the underlying hardware so other classes can use it.""" //| ... //| @@ -114,13 +114,13 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj_deinit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(i2cperipheral_i2c_peripheral_deinit_obj, i2cperipheral_i2c_peripheral_obj_deinit); -//| def __enter__(self, ) -> Any: +//| def __enter__(self) -> Any: //| """No-op used in Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self) -> Any: //| """Automatically deinitializes the hardware on context exit. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -241,13 +241,13 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_make_new(const mp_obj_type_ return mp_obj_new_i2cperipheral_i2c_peripheral_request(args[0], mp_obj_get_int(args[1]), mp_obj_is_true(args[2]), mp_obj_is_true(args[3])); } -//| def __enter__(self, ) -> Any: +//| def __enter__(self) -> Any: //| """No-op used in Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self) -> Any: //| """Close the request.""" //| ... //| diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index d5b971ae5e..f53949d85b 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -36,7 +36,7 @@ //| class Pin: //| """Identifies an IO pin on the microcontroller.""" //| -//| def __init__(self, ): +//| def __init__(self): //| """Identifies an IO pin on the microcontroller. They are fixed by the //| hardware so they cannot be constructed on demand. Instead, use //| `board` or `microcontroller.pin` to reference the desired pin.""" diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c index c4b2491247..c3c60d5cc6 100644 --- a/shared-bindings/microcontroller/Processor.c +++ b/shared-bindings/microcontroller/Processor.c @@ -44,7 +44,7 @@ //| print(microcontroller.cpu.temperature)""" //| -//| def __init__(self, ): +//| def __init__(self): //| """You cannot create an instance of `microcontroller.Processor`. //| Use `microcontroller.cpu` to access the sole instance available.""" //| ... diff --git a/shared-bindings/microcontroller/RunMode.c b/shared-bindings/microcontroller/RunMode.c index 6db315d8d9..d4c10109a5 100644 --- a/shared-bindings/microcontroller/RunMode.c +++ b/shared-bindings/microcontroller/RunMode.c @@ -29,7 +29,7 @@ //| class RunMode: //| """run state of the microcontroller""" //| -//| def __init__(self, ): +//| def __init__(self): //| """Enum-like class to define the run mode of the microcontroller and //| CircuitPython.""" //| diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c index 06d7d4c95b..3b316a33bc 100644 --- a/shared-bindings/nvm/ByteArray.c +++ b/shared-bindings/nvm/ByteArray.c @@ -44,12 +44,12 @@ //| microcontroller.nvm[0:3] = b\"\xcc\x10\x00\"""" //| -//| def __init__(self, ): +//| def __init__(self): //| """Not currently dynamically supported. Access the sole instance through `microcontroller.nvm`.""" //| ... //| -//| def __len__(self, ) -> Any: +//| def __len__(self) -> Any: //| """Return the length. This is used by (`len`)""" //| ... //| diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c index a87b14ddd7..fd82591d5e 100644 --- a/shared-bindings/ps2io/Ps2.c +++ b/shared-bindings/ps2io/Ps2.c @@ -87,7 +87,7 @@ STATIC mp_obj_t ps2io_ps2_make_new(const mp_obj_type_t *type, size_t n_args, con return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self) -> Any: //| """Deinitialises the Ps2 and releases any hardware resources for reuse.""" //| ... //| @@ -104,13 +104,13 @@ STATIC void check_for_deinit(ps2io_ps2_obj_t *self) { } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self) -> Any: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self) -> Any: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -122,7 +122,7 @@ STATIC mp_obj_t ps2io_ps2_obj___exit__(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ps2io_ps2___exit___obj, 4, 4, ps2io_ps2_obj___exit__); -//| def popleft(self, ) -> Any: +//| def popleft(self) -> Any: //| """Removes and returns the oldest received byte. When buffer //| is empty, raises an IndexError exception.""" //| ... @@ -164,7 +164,7 @@ STATIC mp_obj_t ps2io_ps2_obj_sendcmd(mp_obj_t self_in, mp_obj_t ob) { } MP_DEFINE_CONST_FUN_OBJ_2(ps2io_ps2_sendcmd_obj, ps2io_ps2_obj_sendcmd); -//| def clear_errors(self, ) -> Any: +//| def clear_errors(self) -> Any: //| """Returns and clears a bitmap with latest recorded communication errors. //| //| Reception errors (arise asynchronously, as data is received): @@ -202,7 +202,7 @@ STATIC mp_obj_t ps2io_ps2_obj_clear_errors(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(ps2io_ps2_clear_errors_obj, ps2io_ps2_obj_clear_errors); -//| def __len__(self, ) -> Any: +//| def __len__(self) -> Any: //| """Returns the number of received bytes in buffer, available //| to :py:func:`popleft()`.""" //| ... diff --git a/shared-bindings/pulseio/PWMOut.c b/shared-bindings/pulseio/PWMOut.c index 7970c02f34..863365987f 100644 --- a/shared-bindings/pulseio/PWMOut.c +++ b/shared-bindings/pulseio/PWMOut.c @@ -115,7 +115,7 @@ STATIC mp_obj_t pulseio_pwmout_make_new(const mp_obj_type_t *type, size_t n_args return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self) -> Any: //| """Deinitialises the PWMOut and releases any hardware resources for reuse.""" //| ... //| @@ -132,13 +132,13 @@ STATIC void check_for_deinit(pulseio_pwmout_obj_t *self) { } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self) -> Any: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self) -> Any: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... diff --git a/shared-bindings/pulseio/PulseIn.c b/shared-bindings/pulseio/PulseIn.c index 5c52b25822..e187697077 100644 --- a/shared-bindings/pulseio/PulseIn.c +++ b/shared-bindings/pulseio/PulseIn.c @@ -96,7 +96,7 @@ STATIC mp_obj_t pulseio_pulsein_make_new(const mp_obj_type_t *type, size_t n_arg return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self) -> Any: //| """Deinitialises the PulseIn and releases any hardware resources for reuse.""" //| ... //| @@ -113,13 +113,13 @@ STATIC void check_for_deinit(pulseio_pulsein_obj_t *self) { } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self) -> Any: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self) -> Any: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -131,7 +131,7 @@ STATIC mp_obj_t pulseio_pulsein_obj___exit__(size_t n_args, const mp_obj_t *args } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pulseio_pulsein___exit___obj, 4, 4, pulseio_pulsein_obj___exit__); -//| def pause(self, ) -> Any: +//| def pause(self) -> Any: //| """Pause pulse capture""" //| ... //| @@ -171,7 +171,7 @@ STATIC mp_obj_t pulseio_pulsein_obj_resume(size_t n_args, const mp_obj_t *pos_ar } MP_DEFINE_CONST_FUN_OBJ_KW(pulseio_pulsein_resume_obj, 1, pulseio_pulsein_obj_resume); -//| def clear(self, ) -> Any: +//| def clear(self) -> Any: //| """Clears all captured pulses""" //| ... //| @@ -184,7 +184,7 @@ STATIC mp_obj_t pulseio_pulsein_obj_clear(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(pulseio_pulsein_clear_obj, pulseio_pulsein_obj_clear); -//| def popleft(self, ) -> Any: +//| def popleft(self) -> Any: //| """Removes and returns the oldest read pulse.""" //| ... //| @@ -234,7 +234,7 @@ const mp_obj_property_t pulseio_pulsein_paused_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def __len__(self, ) -> Any: +//| def __len__(self) -> Any: //| """Returns the current pulse length //| //| This allows you to:: diff --git a/shared-bindings/pulseio/PulseOut.c b/shared-bindings/pulseio/PulseOut.c index 16b0a6f0cc..bfb3576a8d 100644 --- a/shared-bindings/pulseio/PulseOut.c +++ b/shared-bindings/pulseio/PulseOut.c @@ -81,7 +81,7 @@ STATIC mp_obj_t pulseio_pulseout_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self) -> Any: //| """Deinitialises the PulseOut and releases any hardware resources for reuse.""" //| ... //| @@ -92,13 +92,13 @@ STATIC mp_obj_t pulseio_pulseout_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(pulseio_pulseout_deinit_obj, pulseio_pulseout_deinit); -//| def __enter__(self, ) -> Any: +//| def __enter__(self) -> Any: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self) -> Any: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index c833faa6e9..1bbd169654 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -237,7 +237,7 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self) -> Any: //| """Free the resources (pins, timers, etc.) associated with this //| rgbmatrix instance. After deinitialization, no further operations //| may be performed.""" diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c index 8b27238668..418de664ee 100644 --- a/shared-bindings/rotaryio/IncrementalEncoder.c +++ b/shared-bindings/rotaryio/IncrementalEncoder.c @@ -80,7 +80,7 @@ STATIC mp_obj_t rotaryio_incrementalencoder_make_new(const mp_obj_type_t *type, return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self) -> Any: //| """Deinitializes the IncrementalEncoder and releases any hardware resources for reuse.""" //| ... //| @@ -97,13 +97,13 @@ STATIC void check_for_deinit(rotaryio_incrementalencoder_obj_t *self) { } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self) -> Any: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self) -> Any: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... diff --git a/shared-bindings/rtc/RTC.c b/shared-bindings/rtc/RTC.c index 58fe308f53..009256176b 100644 --- a/shared-bindings/rtc/RTC.c +++ b/shared-bindings/rtc/RTC.c @@ -41,7 +41,7 @@ const rtc_rtc_obj_t rtc_rtc_obj = {{&rtc_rtc_type}}; //| class RTC: //| """Real Time Clock""" //| -//| def __init__(self, ): +//| def __init__(self): //| """This class represents the onboard Real Time Clock. It is a singleton and will always return the same instance.""" //| ... //| diff --git a/shared-bindings/sdioio/SDCard.c b/shared-bindings/sdioio/SDCard.c index 77b41ce127..2feb7d8030 100644 --- a/shared-bindings/sdioio/SDCard.c +++ b/shared-bindings/sdioio/SDCard.c @@ -255,13 +255,13 @@ STATIC mp_obj_t sdioio_sdcard_obj_deinit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_deinit_obj, sdioio_sdcard_obj_deinit); -//| def __enter__(self, ) -> Any: +//| def __enter__(self) -> Any: //| """No-op used by Context Managers. //| Provided by context manager helper.""" //| ... //| -//| def __exit__(self, ) -> Any: +//| def __exit__(self) -> Any: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c index 19c4850cde..643a57b1bb 100644 --- a/shared-bindings/socket/__init__.c +++ b/shared-bindings/socket/__init__.c @@ -145,7 +145,7 @@ STATIC mp_obj_t socket_listen(mp_obj_t self_in, mp_obj_t backlog) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_listen_obj, socket_listen); -//| def accept(self, ) -> Any: +//| def accept(self) -> Any: //| """Accept a connection on a listening socket of type SOCK_STREAM, //| creating a new socket of type SOCK_STREAM. //| Returns a tuple of (new_socket, remote_address)""" diff --git a/shared-bindings/supervisor/Runtime.c b/shared-bindings/supervisor/Runtime.c index a420d5b805..e0bd07600d 100755 --- a/shared-bindings/supervisor/Runtime.c +++ b/shared-bindings/supervisor/Runtime.c @@ -39,7 +39,7 @@ //| print("Hello World!")""" //| -//| def __init__(self, ): +//| def __init__(self): //| """You cannot create an instance of `supervisor.Runtime`. //| Use `supervisor.runtime` to access the sole instance available.""" //| ... diff --git a/shared-bindings/touchio/TouchIn.c b/shared-bindings/touchio/TouchIn.c index 4c1d534eaa..0a9851cc59 100644 --- a/shared-bindings/touchio/TouchIn.c +++ b/shared-bindings/touchio/TouchIn.c @@ -73,7 +73,7 @@ STATIC mp_obj_t touchio_touchin_make_new(const mp_obj_type_t *type, return (mp_obj_t) self; } -//| def deinit(self, ) -> Any: +//| def deinit(self) -> Any: //| """Deinitialises the TouchIn and releases any hardware resources for reuse.""" //| ... //| @@ -90,13 +90,13 @@ STATIC void check_for_deinit(touchio_touchin_obj_t *self) { } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self) -> Any: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self) -> Any: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... diff --git a/shared-bindings/usb_hid/Device.c b/shared-bindings/usb_hid/Device.c index 8c0c364ff3..99b7b9db96 100644 --- a/shared-bindings/usb_hid/Device.c +++ b/shared-bindings/usb_hid/Device.c @@ -39,7 +39,7 @@ //| mouse.send_report()""" //| -//| def __init__(self, ): +//| def __init__(self): //| """Not currently dynamically supported.""" //| ... //| diff --git a/shared-bindings/usb_midi/PortOut.c b/shared-bindings/usb_midi/PortOut.c index 14ed0e767e..b4afbc0362 100644 --- a/shared-bindings/usb_midi/PortOut.c +++ b/shared-bindings/usb_midi/PortOut.c @@ -38,7 +38,7 @@ //| class PortOut: //| """Sends midi messages to a computer over USB""" //| -//| def __init__(self, ): +//| def __init__(self): //| """You cannot create an instance of `usb_midi.PortOut`. //| //| PortOut objects are constructed for every corresponding entry in the USB diff --git a/shared-bindings/watchdog/WatchDogMode.c b/shared-bindings/watchdog/WatchDogMode.c index 369454c11b..293ee043d9 100644 --- a/shared-bindings/watchdog/WatchDogMode.c +++ b/shared-bindings/watchdog/WatchDogMode.c @@ -29,7 +29,7 @@ //| class WatchDogMode: //| """run state of the watchdog timer""" //| -//| def __init__(self, ): +//| def __init__(self): //| """Enum-like class to define the run mode of the watchdog timer.""" //| //| RAISE: Any = ... diff --git a/shared-bindings/watchdog/WatchDogTimer.c b/shared-bindings/watchdog/WatchDogTimer.c index 52bda4c779..4a2aa00cdf 100644 --- a/shared-bindings/watchdog/WatchDogTimer.c +++ b/shared-bindings/watchdog/WatchDogTimer.c @@ -49,7 +49,7 @@ //| """ //| -//| def __init__(self, ): +//| def __init__(self): //| """Not currently dynamically supported. Access the sole instance through `microcontroller.watchdog`.""" //| ... //| From 26f1fd00719ef0c5dc904e9b6f03ad2a90e2abdc Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 14:11:25 -0400 Subject: [PATCH 0177/1293] Added type hints to _bleio --- shared-bindings/_bleio/Adapter.c | 26 ++++++++--------- shared-bindings/_bleio/Address.c | 20 ++++++------- shared-bindings/_bleio/Attribute.c | 16 +++++------ shared-bindings/_bleio/Characteristic.c | 28 +++++++++---------- shared-bindings/_bleio/CharacteristicBuffer.c | 12 ++++---- shared-bindings/_bleio/Connection.c | 16 +++++------ shared-bindings/_bleio/Descriptor.c | 8 +++--- shared-bindings/_bleio/PacketBuffer.c | 8 +++--- shared-bindings/_bleio/ScanEntry.c | 14 +++++----- shared-bindings/_bleio/ScanResults.c | 6 ++-- shared-bindings/_bleio/Service.c | 8 +++--- shared-bindings/_bleio/UUID.c | 12 ++++---- shared-bindings/_bleio/__init__.c | 8 +++--- 13 files changed, 91 insertions(+), 91 deletions(-) diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 13acb9d3cf..5aab9eca5b 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -65,13 +65,13 @@ //| connections and also initiate connections.""" //| -//| def __init__(self, ): +//| def __init__(self): //| """You cannot create an instance of `_bleio.Adapter`. //| Use `_bleio.adapter` to access the sole instance available.""" //| ... //| -//| enabled: Any = ... +//| enabled: bool = ... //| """State of the BLE adapter.""" //| STATIC mp_obj_t bleio_adapter_get_enabled(mp_obj_t self) { @@ -95,7 +95,7 @@ const mp_obj_property_t bleio_adapter_enabled_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| address: Any = ... +//| address: str = ... //| """MAC address of the BLE adapter. (read-only)""" //| STATIC mp_obj_t bleio_adapter_get_address(mp_obj_t self) { @@ -111,7 +111,7 @@ const mp_obj_property_t bleio_adapter_address_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| name: Any = ... +//| name: str = ... //| """name of the BLE adapter used once connected. //| The name is "CIRCUITPY" + the last four hex digits of ``adapter.address``, //| to make it easy to distinguish multiple CircuitPython boards.""" @@ -135,7 +135,7 @@ const mp_obj_property_t bleio_adapter_name_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| def start_advertising(self, data: buf, *, scan_response: buf = None, connectable: bool = True, anonymous: bool = False, timeout: int = 0, interval: float = 0.1) -> Any: +//| def start_advertising(self, data: buf, *, scan_response: buf = None, connectable: bool = True, anonymous: bool = False, timeout: int = 0, interval: float = 0.1) -> None: //| """Starts advertising until `stop_advertising` is called or if connectable, another device //| connects to us. //| @@ -202,7 +202,7 @@ STATIC mp_obj_t bleio_adapter_start_advertising(mp_uint_t n_args, const mp_obj_t } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_start_advertising_obj, 2, bleio_adapter_start_advertising); -//| def stop_advertising(self, ) -> Any: +//| def stop_advertising(self) -> None: //| """Stop sending advertising packets.""" //| ... //| @@ -215,7 +215,7 @@ STATIC mp_obj_t bleio_adapter_stop_advertising(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_stop_advertising_obj, bleio_adapter_stop_advertising); -//| def start_scan(self, prefixes: sequence = b"", *, buffer_size: int = 512, extended: bool = False, timeout: float = None, interval: float = 0.1, window: float = 0.1, minimum_rssi: int = -80, active: bool = True) -> Any: +//| def start_scan(self, prefixes: sequence = b"", *, buffer_size: int = 512, extended: bool = False, timeout: float = None, interval: float = 0.1, window: float = 0.1, minimum_rssi: int = -80, active: bool = True) -> iterable: //| """Starts a BLE scan and returns an iterator of results. Advertisements and scan responses are //| filtered and returned separately. //| @@ -288,7 +288,7 @@ STATIC mp_obj_t bleio_adapter_start_scan(size_t n_args, const mp_obj_t *pos_args } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_start_scan_obj, 1, bleio_adapter_start_scan); -//| def stop_scan(self, ) -> Any: +//| def stop_scan(self) -> None: //| """Stop the current scan.""" //| ... //| @@ -301,7 +301,7 @@ STATIC mp_obj_t bleio_adapter_stop_scan(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_stop_scan_obj, bleio_adapter_stop_scan); -//| advertising: Any = ... +//| advertising: bool = ... //| """True when the adapter is currently advertising. (read-only)""" //| STATIC mp_obj_t bleio_adapter_get_advertising(mp_obj_t self) { @@ -317,7 +317,7 @@ const mp_obj_property_t bleio_adapter_advertising_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| connected: Any = ... +//| connected: bool = ... //| """True when the adapter is connected to another device regardless of who initiated the //| connection. (read-only)""" //| @@ -334,7 +334,7 @@ const mp_obj_property_t bleio_adapter_connected_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| connections: Any = ... +//| connections: tuple = ... //| """Tuple of active connections including those initiated through //| :py:meth:`_bleio.Adapter.connect`. (read-only)""" //| @@ -350,7 +350,7 @@ const mp_obj_property_t bleio_adapter_connections_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| def connect(self, address: Address, *, timeout: float/int) -> Any: +//| def connect(self, address: Address, *, timeout: float/int) -> Adapter.connect: //| """Attempts a connection to the device with the given address. //| //| :param Address address: The address of the peripheral to connect to @@ -380,7 +380,7 @@ STATIC mp_obj_t bleio_adapter_connect(mp_uint_t n_args, const mp_obj_t *pos_args } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_connect_obj, 2, bleio_adapter_connect); -//| def erase_bonding(self, ) -> Any: +//| def erase_bonding(self) -> None: //| """Erase all bonding information stored in flash memory.""" //| ... //| diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c index 9beaff2ab2..87bae19cee 100644 --- a/shared-bindings/_bleio/Address.c +++ b/shared-bindings/_bleio/Address.c @@ -38,7 +38,7 @@ //| """Encapsulates the address of a BLE device.""" //| -//| def __init__(self, address: buf, address_type: Any): +//| def __init__(self, address: Union[bytes, bytearray, memoryview], address_type: int): //| """Create a new Address object encapsulating the address value. //| The value itself can be one of: //| @@ -77,8 +77,8 @@ STATIC mp_obj_t bleio_address_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(self); } -//| address_bytes: Any = ... -//| r"""The bytes that make up the device address (read-only). +//| address_bytes: bytes = ... +//| """The bytes that make up the device address (read-only). //| //| Note that the ``bytes`` object returned is in little-endian order: //| The least significant byte is ``address_bytes[0]``. So the address will @@ -108,7 +108,7 @@ const mp_obj_property_t bleio_address_address_bytes_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| type: Any = ... +//| type: int = ... //| """The address type (read-only). //| //| One of the integer values: `PUBLIC`, `RANDOM_STATIC`, `RANDOM_PRIVATE_RESOLVABLE`, @@ -128,7 +128,7 @@ const mp_obj_property_t bleio_address_type_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def __eq__(self, other: Any) -> Any: +//| def __eq__(self, other: bytes) -> Optional[bool]: //| """Two Address objects are equal if their addresses and address types are equal.""" //| ... //| @@ -154,7 +154,7 @@ STATIC mp_obj_t bleio_address_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_o } } -//| def __hash__(self, ) -> Any: +//| def __hash__(self) -> Optional[int]: //| """Returns a hash for the Address data.""" //| ... //| @@ -187,17 +187,17 @@ STATIC void bleio_address_print(const mp_print_t *print, mp_obj_t self_in, mp_pr buf[5], buf[4], buf[3], buf[2], buf[1], buf[0]); } -//| PUBLIC: Any = ... +//| PUBLIC: bytes = ... //| """A publicly known address, with a company ID (high 24 bits)and company-assigned part (low 24 bits).""" //| -//| RANDOM_STATIC: Any = ... +//| RANDOM_STATIC: int = ... //| """A randomly generated address that does not change often. It may never change or may change after //| a power cycle.""" //| -//| RANDOM_PRIVATE_RESOLVABLE: Any = ... +//| RANDOM_PRIVATE_RESOLVABLE: int = ... //| """An address that is usable when the peer knows the other device's secret Identity Resolving Key (IRK).""" //| -//| RANDOM_PRIVATE_NON_RESOLVABLE: Any = ... +//| RANDOM_PRIVATE_NON_RESOLVABLE: int = ... //| """A randomly generated address that changes on every connection.""" //| STATIC const mp_rom_map_elem_t bleio_address_locals_dict_table[] = { diff --git a/shared-bindings/_bleio/Attribute.c b/shared-bindings/_bleio/Attribute.c index 6c47c87ba8..79f45da94d 100644 --- a/shared-bindings/_bleio/Attribute.c +++ b/shared-bindings/_bleio/Attribute.c @@ -36,32 +36,32 @@ //| :py:class:`~Characteristic` and :py:class:`~Descriptor`, //| but is not defined as a Python superclass of those classes.""" //| -//| def __init__(self, ): +//| def __init__(self): //| """You cannot create an instance of :py:class:`~_bleio.Attribute`.""" //| ... //| STATIC const mp_rom_map_elem_t bleio_attribute_locals_dict_table[] = { -//| NO_ACCESS: Any = ... +//| NO_ACCESS: int = ... //| """security mode: access not allowed""" //| -//| OPEN: Any = ... +//| OPEN: int = ... //| """security_mode: no security (link is not encrypted)""" //| -//| ENCRYPT_NO_MITM: Any = ... +//| ENCRYPT_NO_MITM: int = ... //| """security_mode: unauthenticated encryption, without man-in-the-middle protection""" //| -//| ENCRYPT_WITH_MITM: Any = ... +//| ENCRYPT_WITH_MITM: int = ... //| """security_mode: authenticated encryption, with man-in-the-middle protection""" //| -//| LESC_ENCRYPT_WITH_MITM: Any = ... +//| LESC_ENCRYPT_WITH_MITM: int = ... //| """security_mode: LESC encryption, with man-in-the-middle protection""" //| -//| SIGNED_NO_MITM: Any = ... +//| SIGNED_NO_MITM: int = ... //| """security_mode: unauthenticated data signing, without man-in-the-middle protection""" //| -//| SIGNED_WITH_MITM: Any = ... +//| SIGNED_WITH_MITM: int = ... //| """security_mode: authenticated data signing, without man-in-the-middle protection""" //| { MP_ROM_QSTR(MP_QSTR_NO_ACCESS), MP_ROM_INT(SECURITY_MODE_NO_ACCESS) }, diff --git a/shared-bindings/_bleio/Characteristic.c b/shared-bindings/_bleio/Characteristic.c index 785b677d67..e4c81d8c27 100644 --- a/shared-bindings/_bleio/Characteristic.c +++ b/shared-bindings/_bleio/Characteristic.c @@ -37,7 +37,7 @@ //| """Stores information about a BLE service characteristic and allows reading //| and writing of the characteristic's value.""" //| -//| def __init__(self, ): +//| def __init__(self): //| """There is no regular constructor for a Characteristic. A new local Characteristic can be created //| and attached to a Service by calling `add_to_service()`. //| Remote Characteristic objects are created by `Connection.discover_remote_services()` @@ -45,7 +45,7 @@ //| ... //| -//| def add_to_service(self, service: Service, uuid: UUID, *, properties: int = 0, read_perm: int = Attribute.OPEN, write_perm: int = Attribute.OPEN, max_length: int = 20, fixed_length: bool = False, initial_value: buf = None) -> Any: +//| def add_to_service(self, service: Service, uuid: UUID, *, properties: int = 0, read_perm: int = Attribute.OPEN, write_perm: int = Attribute.OPEN, max_length: int = 20, fixed_length: bool = False, initial_value: buf = None) -> Characteristic: //| """Create a new Characteristic object, and add it to this Service. //| //| :param Service service: The service that will provide this characteristic @@ -141,7 +141,7 @@ STATIC MP_DEFINE_CONST_CLASSMETHOD_OBJ(bleio_characteristic_add_to_service_obj, -//| properties: Any = ... +//| properties: int = ... //| """An int bitmask representing which properties are set, specified as bitwise or'ing of //| of these possible values. //| `BROADCAST`, `INDICATE`, `NOTIFY`, `READ`, `WRITE`, `WRITE_NO_RESPONSE`.""" @@ -160,7 +160,7 @@ const mp_obj_property_t bleio_characteristic_properties_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| uuid: Any = ... +//| uuid: Optional[UUID] = ... //| """The UUID of this characteristic. (read-only) //| //| Will be ``None`` if the 128-bit UUID for this characteristic is not known.""" @@ -180,7 +180,7 @@ const mp_obj_property_t bleio_characteristic_uuid_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| value: Any = ... +//| value: bytearray = ... //| """The value of this characteristic.""" //| STATIC mp_obj_t bleio_characteristic_get_value(mp_obj_t self_in) { @@ -211,7 +211,7 @@ const mp_obj_property_t bleio_characteristic_value_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| descriptors: Any = ... +//| descriptors: Descriptor = ... //| """A tuple of :py:class:`Descriptor` that describe this characteristic. (read-only)""" //| STATIC mp_obj_t bleio_characteristic_get_descriptors(mp_obj_t self_in) { @@ -241,7 +241,7 @@ const mp_obj_property_t bleio_characteristic_descriptors_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| service: Any = ... +//| service: Service = ... //| """The Service this Characteristic is a part of.""" //| STATIC mp_obj_t bleio_characteristic_get_service(mp_obj_t self_in) { @@ -258,7 +258,7 @@ const mp_obj_property_t bleio_characteristic_service_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| def set_cccd(self, *, notify: bool = False, indicate: float = False) -> Any: +//| def set_cccd(self, *, notify: bool = False, indicate: float = False) -> None: //| """Set the remote characteristic's CCCD to enable or disable notification and indication. //| //| :param bool notify: True if Characteristic should receive notifications of remote writes @@ -291,22 +291,22 @@ STATIC const mp_rom_map_elem_t bleio_characteristic_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_set_cccd), MP_ROM_PTR(&bleio_characteristic_set_cccd_obj) }, // Bitmask constants to represent properties -//| BROADCAST: Any = ... +//| BROADCAST: int = ... //| """property: allowed in advertising packets""" //| -//| INDICATE: Any = ... +//| INDICATE: int = ... //| """property: server will indicate to the client when the value is set and wait for a response""" //| -//| NOTIFY: Any = ... +//| NOTIFY: int = ... //| """property: server will notify the client when the value is set""" //| -//| READ: Any = ... +//| READ: int = ... //| """property: clients may read this characteristic""" //| -//| WRITE: Any = ... +//| WRITE: int = ... //| """property: clients may write this characteristic; a response will be sent back""" //| -//| WRITE_NO_RESPONSE: Any = ... +//| WRITE_NO_RESPONSE: int = ... //| """property: clients may write this characteristic; no response will be sent back""" //| { MP_ROM_QSTR(MP_QSTR_BROADCAST), MP_ROM_INT(CHAR_PROP_BROADCAST) }, diff --git a/shared-bindings/_bleio/CharacteristicBuffer.c b/shared-bindings/_bleio/CharacteristicBuffer.c index 6cbd587c64..ee5a8ea332 100644 --- a/shared-bindings/_bleio/CharacteristicBuffer.c +++ b/shared-bindings/_bleio/CharacteristicBuffer.c @@ -100,7 +100,7 @@ STATIC void check_for_deinit(bleio_characteristic_buffer_obj_t *self) { // These are standard stream methods. Code is in py/stream.c. // -//| def read(self, nbytes: Any = None) -> Any: +//| def read(self, nbytes: int = None) -> Optional[bytes]: //| """Read characters. If ``nbytes`` is specified then read at most that many //| bytes. Otherwise, read everything that arrives until the connection //| times out. Providing the number of bytes expected is highly recommended @@ -110,14 +110,14 @@ STATIC void check_for_deinit(bleio_characteristic_buffer_obj_t *self) { //| :rtype: bytes or None""" //| ... //| -//| def readinto(self, buf: Any) -> Any: +//| def readinto(self, buf: Union[bytearray, memoryview]) -> Optional[int]: //| """Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. //| //| :return: number of bytes read and stored into ``buf`` //| :rtype: int or None (on a non-blocking error)""" //| ... //| -//| def readline(self, ) -> Any: +//| def readline(self) -> bytes: //| """Read a line, ending in a newline character. //| //| :return: the line read @@ -167,7 +167,7 @@ STATIC mp_uint_t bleio_characteristic_buffer_ioctl(mp_obj_t self_in, mp_uint_t r return ret; } -//| in_waiting: Any = ... +//| in_waiting: int = ... //| """The number of bytes in the input buffer, available to be read""" //| STATIC mp_obj_t bleio_characteristic_buffer_obj_get_in_waiting(mp_obj_t self_in) { @@ -184,7 +184,7 @@ const mp_obj_property_t bleio_characteristic_buffer_in_waiting_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def reset_input_buffer(self, ) -> Any: +//| def reset_input_buffer(self) -> None: //| """Discard any unread characters in the input buffer.""" //| ... //| @@ -196,7 +196,7 @@ STATIC mp_obj_t bleio_characteristic_buffer_obj_reset_input_buffer(mp_obj_t self } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_characteristic_buffer_reset_input_buffer_obj, bleio_characteristic_buffer_obj_reset_input_buffer); -//| def deinit(self, ) -> Any: +//| def deinit(self) -> None: //| """Disable permanently.""" //| ... //| diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index 0a96d8a111..64e2baefa3 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -68,13 +68,13 @@ void bleio_connection_ensure_connected(bleio_connection_obj_t *self) { } } -//| def __init__(self, ): +//| def __init__(self): //| """Connections cannot be made directly. Instead, to initiate a connection use `Adapter.connect`. //| Connections may also be made when another device initiates a connection. To use a Connection //| created by a peer, read the `Adapter.connections` property. //| ... //| -//| def disconnect(self, ) -> Any: +//| def disconnect(self) -> Any: //| ""Disconnects from the remote peripheral. Does nothing if already disconnected.""" //| ... //| @@ -87,7 +87,7 @@ STATIC mp_obj_t bleio_connection_disconnect(mp_obj_t self_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_disconnect_obj, bleio_connection_disconnect); -//| def pair(self, *, bond: Any = True) -> Any: +//| def pair(self, *, bond: bool = True) -> None: //| """Pair to the peer to improve security.""" //| ... //| @@ -109,7 +109,7 @@ STATIC mp_obj_t bleio_connection_pair(mp_uint_t n_args, const mp_obj_t *pos_args } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_connection_pair_obj, 1, bleio_connection_pair); -//| def discover_remote_services(self, service_uuids_whitelist: iterable = None) -> Any: +//| def discover_remote_services(self, service_uuids_whitelist: iterable = None) -> Tuple(_bleio.Service, ...): //| """Do BLE discovery for all services or for the given service UUIDS, //| to find their handles and characteristics, and return the discovered services. //| `Connection.connected` must be True. @@ -152,7 +152,7 @@ STATIC mp_obj_t bleio_connection_discover_remote_services(mp_uint_t n_args, cons } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_connection_discover_remote_services_obj, 1, bleio_connection_discover_remote_services); -//| connected: Any = ... +//| connected: bool = ... //| """True if connected to the remote peer.""" //| STATIC mp_obj_t bleio_connection_get_connected(mp_obj_t self_in) { @@ -170,7 +170,7 @@ const mp_obj_property_t bleio_connection_connected_obj = { }; -//| paired: Any = ... +//| paired: bool = ... //| """True if paired to the remote peer.""" //| STATIC mp_obj_t bleio_connection_get_paired(mp_obj_t self_in) { @@ -188,7 +188,7 @@ const mp_obj_property_t bleio_connection_paired_obj = { }; -//| connection_interval: Any = ... +//| connection_interval: float = ... //| """Time between transmissions in milliseconds. Will be multiple of 1.25ms. Lower numbers //| increase speed and decrease latency but increase power consumption. //| @@ -206,7 +206,7 @@ STATIC mp_obj_t bleio_connection_get_connection_interval(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_get_connection_interval_obj, bleio_connection_get_connection_interval); -//| attribute: Any = ... +//| attribute: int = ... //| """The maximum number of data bytes that can be sent in a single transmission, //| not including overhead bytes. //| diff --git a/shared-bindings/_bleio/Descriptor.c b/shared-bindings/_bleio/Descriptor.c index 9d70208494..b478e85e12 100644 --- a/shared-bindings/_bleio/Descriptor.c +++ b/shared-bindings/_bleio/Descriptor.c @@ -39,7 +39,7 @@ //| Descriptors are attached to BLE characteristics and provide contextual //| information about the characteristic.""" //| -//| def __init__(self, ): +//| def __init__(self): //| """There is no regular constructor for a Descriptor. A new local Descriptor can be created //| and attached to a Characteristic by calling `add_to_characteristic()`. //| Remote Descriptor objects are created by `Connection.discover_remote_services()` @@ -132,7 +132,7 @@ STATIC mp_obj_t bleio_descriptor_add_to_characteristic(size_t n_args, const mp_o STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_descriptor_add_to_characteristic_fun_obj, 3, bleio_descriptor_add_to_characteristic); STATIC MP_DEFINE_CONST_CLASSMETHOD_OBJ(bleio_descriptor_add_to_characteristic_obj, MP_ROM_PTR(&bleio_descriptor_add_to_characteristic_fun_obj)); -//| uuid: Any = ... +//| uuid: UUID = ... //| """The descriptor uuid. (read-only)""" //| STATIC mp_obj_t bleio_descriptor_get_uuid(mp_obj_t self_in) { @@ -150,7 +150,7 @@ const mp_obj_property_t bleio_descriptor_uuid_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| characteristic: Any = ... +//| characteristic: Characteristic = ... //| """The Characteristic this Descriptor is a part of.""" //| STATIC mp_obj_t bleio_descriptor_get_characteristic(mp_obj_t self_in) { @@ -167,7 +167,7 @@ const mp_obj_property_t bleio_descriptor_characteristic_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| value: Any = ... +//| value: Union[bytearray, memoryview] = ... //| """The value of this descriptor.""" //| STATIC mp_obj_t bleio_descriptor_get_value(mp_obj_t self_in) { diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index 907bfabd27..a5b017312c 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -93,7 +93,7 @@ STATIC void check_for_deinit(bleio_packet_buffer_obj_t *self) { } } -//| def readinto(self, buf: Any) -> Any: +//| def readinto(self, buf: Union[bytearray, memoryview]) -> int: //| """Reads a single BLE packet into the ``buf``. Raises an exception if the next packet is longer //| than the given buffer. Use `packet_size` to read the maximum length of a single packet. //| @@ -117,7 +117,7 @@ STATIC mp_obj_t bleio_packet_buffer_readinto(mp_obj_t self_in, mp_obj_t buffer_o } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bleio_packet_buffer_readinto_obj, bleio_packet_buffer_readinto); -//| def write(self, data: Any, *, header: Any = None) -> Any: +//| def write(self, data: bytes, *, header: bytes = None) -> int: //| """Writes all bytes from data into the same outgoing packet. The bytes from header are included //| before data when the pending packet is currently empty. //| @@ -169,7 +169,7 @@ STATIC mp_obj_t bleio_packet_buffer_write(mp_uint_t n_args, const mp_obj_t *pos_ } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_packet_buffer_write_obj, 1, bleio_packet_buffer_write); -//| def deinit(self) -> Any: +//| def deinit(self) -> None: //| """Disable permanently.""" //| ... STATIC mp_obj_t bleio_packet_buffer_deinit(mp_obj_t self_in) { @@ -184,7 +184,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_deinit_obj, bleio_packet_bu //| The name `packet_size` is deprecated and //| will be removed in CircuitPython 6.0.0.""" //| -//| incoming_packet_length: Any = ... +//| incoming_packet_length: int = ... //| """Maximum length in bytes of a packet we are reading.""" //| STATIC mp_obj_t bleio_packet_buffer_get_incoming_packet_length(mp_obj_t self_in) { diff --git a/shared-bindings/_bleio/ScanEntry.c b/shared-bindings/_bleio/ScanEntry.c index 905bea81d2..f8d769cabe 100644 --- a/shared-bindings/_bleio/ScanEntry.c +++ b/shared-bindings/_bleio/ScanEntry.c @@ -41,11 +41,11 @@ //| it has no user-visible constructor.""" //| -//| def __init__(self, ): +//| def __init__(self): //| """Cannot be instantiated directly. Use `_bleio.Adapter.start_scan`.""" //| ... //| -//| def matches(self, prefixes: Any, *, all: Any = True) -> Any: +//| def matches(self, prefixes: ScanEntry, *, all: bool = True) -> bool: //| """Returns True if the ScanEntry matches all prefixes when ``all`` is True. This is stricter //| than the scan filtering which accepts any advertisements that match any of the prefixes //| where all is False.""" @@ -70,7 +70,7 @@ STATIC mp_obj_t bleio_scanentry_matches(mp_uint_t n_args, const mp_obj_t *pos_ar } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_scanentry_matches_obj, 2, bleio_scanentry_matches); -//| address: Any = ... +//| address: _bleio.Address = ... //| """The address of the device (read-only), of type `_bleio.Address`.""" //| STATIC mp_obj_t bleio_scanentry_get_address(mp_obj_t self_in) { @@ -86,7 +86,7 @@ const mp_obj_property_t bleio_scanentry_address_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| advertisement_bytes: Any = ... +//| advertisement_bytes: bytes = ... //| """All the advertisement data present in the packet, returned as a ``bytes`` object. (read-only)""" //| STATIC mp_obj_t scanentry_get_advertisement_bytes(mp_obj_t self_in) { @@ -102,7 +102,7 @@ const mp_obj_property_t bleio_scanentry_advertisement_bytes_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| rssi: Any = ... +//| rssi: int = ... //| """The signal strength of the device at the time of the scan, in integer dBm. (read-only)""" //| STATIC mp_obj_t scanentry_get_rssi(mp_obj_t self_in) { @@ -118,7 +118,7 @@ const mp_obj_property_t bleio_scanentry_rssi_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| connectable: Any = ... +//| connectable: bool = ... //| """True if the device can be connected to. (read-only)""" //| STATIC mp_obj_t scanentry_get_connectable(mp_obj_t self_in) { @@ -134,7 +134,7 @@ const mp_obj_property_t bleio_scanentry_connectable_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| scan_response: Any = ... +//| scan_response: bool = ... //| """True if the entry was a scan response. (read-only)""" //| STATIC mp_obj_t scanentry_get_scan_response(mp_obj_t self_in) { diff --git a/shared-bindings/_bleio/ScanResults.c b/shared-bindings/_bleio/ScanResults.c index 6077dcbdae..bc9d55c80f 100644 --- a/shared-bindings/_bleio/ScanResults.c +++ b/shared-bindings/_bleio/ScanResults.c @@ -46,15 +46,15 @@ STATIC mp_obj_t scanresults_iternext(mp_obj_t self_in) { return MP_OBJ_STOP_ITERATION; } -//| def __init__(self, ): +//| def __init__(self): //| """Cannot be instantiated directly. Use `_bleio.Adapter.start_scan`.""" //| ... //| -//| def __iter__(self, ) -> Any: +//| def __iter__(self) -> __iter__: //| """Returns itself since it is the iterator.""" //| ... //| -//| def __next__(self, ) -> Any: +//| def __next__(self) -> _bleio.ScanEntry: //| """Returns the next `_bleio.ScanEntry`. Blocks if none have been received and scanning is still //| active. Raises `StopIteration` if scanning is finished and no other results are available.""" //| ... diff --git a/shared-bindings/_bleio/Service.c b/shared-bindings/_bleio/Service.c index 5ca7504f27..5cda11de4e 100644 --- a/shared-bindings/_bleio/Service.c +++ b/shared-bindings/_bleio/Service.c @@ -73,7 +73,7 @@ STATIC mp_obj_t bleio_service_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(service); } -//| characteristics: Any = ... +//| characteristics: Tuple(Characteristic, ...) = ... //| """A tuple of :py:class:`Characteristic` designating the characteristics that are offered by //| this service. (read-only)""" //| @@ -92,7 +92,7 @@ const mp_obj_property_t bleio_service_characteristics_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| remote: Any = ... +//| remote: bool = ... //| """True if this is a service provided by a remote device. (read-only)""" //| STATIC mp_obj_t bleio_service_get_remote(mp_obj_t self_in) { @@ -109,7 +109,7 @@ const mp_obj_property_t bleio_service_remote_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| secondary: Any = ... +//| secondary: bool = ... //| """True if this is a secondary service. (read-only)""" //| STATIC mp_obj_t bleio_service_get_secondary(mp_obj_t self_in) { @@ -126,7 +126,7 @@ const mp_obj_property_t bleio_service_secondary_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| uuid: Any = ... +//| uuid: Optional[UUID] = ... //| """The UUID of this service. (read-only) //| //| Will be ``None`` if the 128-bit UUID for this service is not known.""" diff --git a/shared-bindings/_bleio/UUID.c b/shared-bindings/_bleio/UUID.c index 78161b9566..a36cade6a0 100644 --- a/shared-bindings/_bleio/UUID.c +++ b/shared-bindings/_bleio/UUID.c @@ -36,7 +36,7 @@ //| class UUID: //| """A 16-bit or 128-bit UUID. Can be used for services, characteristics, descriptors and more.""" //| -//| def __init__(self, value: Any): +//| def __init__(self, value: Union[int, typing.ByteString]): //| """Create a new UUID or UUID object encapsulating the uuid value. //| The value can be one of: //| @@ -120,7 +120,7 @@ STATIC mp_obj_t bleio_uuid_make_new(const mp_obj_type_t *type, size_t n_args, co return MP_OBJ_FROM_PTR(self); } -//| uuid16: Any = ... +//| uuid16: int = ... //| """The 16-bit part of the UUID. (read-only) //| //| :type: int""" @@ -139,7 +139,7 @@ const mp_obj_property_t bleio_uuid_uuid16_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| uuid128: Any = ... +//| uuid128: bytes = ... //| """The 128-bit value of the UUID //| Raises AttributeError if this is a 16-bit UUID. (read-only) //| @@ -165,7 +165,7 @@ const mp_obj_property_t bleio_uuid_uuid128_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| size: Any = ... +//| size: int = ... //| """128 if this UUID represents a 128-bit vendor-specific UUID. 16 if this UUID represents a //| 16-bit Bluetooth SIG assigned UUID. (read-only) 32-bit UUIDs are not currently supported. //| @@ -186,7 +186,7 @@ const mp_obj_property_t bleio_uuid_size_obj = { }; -//| def pack_into(self, buffer: Any, offset: Any = 0) -> Any: +//| def pack_into(self, buffer: Union[bytearray, memoryview], offset: int = 0) -> None: //| """Packs the UUID into the given buffer at the given offset.""" //| ... //| @@ -248,7 +248,7 @@ STATIC mp_obj_t bleio_uuid_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -//| def __eq__(self, other: Any) -> Any: +//| def __eq__(self, other: UUID) -> Optional[bool]: //| """Two UUID objects are equal if their values match and they are both 128-bit or both 16-bit.""" //| ... //| diff --git a/shared-bindings/_bleio/__init__.c b/shared-bindings/_bleio/__init__.c index 90b185f79a..8778e94eda 100644 --- a/shared-bindings/_bleio/__init__.c +++ b/shared-bindings/_bleio/__init__.c @@ -60,7 +60,7 @@ //| class BluetoothError: -//| def __init__(self, Exception: Any): +//| def __init__(self, Exception: Exception): //| """Catch all exception for Bluetooth related errors.""" //| ... MP_DEFINE_BLEIO_EXCEPTION(BluetoothError, Exception) @@ -73,7 +73,7 @@ NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* fmt, ...) nlr_raise(exception); } //| class ConnectionError: -//| def __init__(self, BluetoothError: Any): +//| def __init__(self, BluetoothError: _bleio.BluetoothError): //| """Raised when a connection is unavailable.""" //| ... //| @@ -87,7 +87,7 @@ NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* fmt, ... } //| class RoleError: -//| def __init__(self, BluetoothError: Any): +//| def __init__(self, BluetoothError: _bleio.BluetoothError): //| """Raised when a resource is used as the mismatched role. For example, if a local CCCD is //| attempted to be set but they can only be set when remote.""" //| ... @@ -97,7 +97,7 @@ NORETURN void mp_raise_bleio_RoleError(const compressed_string_t* msg) { mp_raise_msg(&mp_type_bleio_RoleError, msg); } //| class SecurityError: -//| def __init__(self, BluetoothError: Any): +//| def __init__(self, BluetoothError: _bleio.BluetoothError): //| """Raised when a security related error occurs.""" //| ... //| From 51fd286cbfc26ee36bef96445172c01744573279 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 14:14:05 -0400 Subject: [PATCH 0178/1293] Added type hints to board --- shared-bindings/board/__init__.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index 010a9fb92a..6837fc41c2 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -37,7 +37,7 @@ //| .. warning:: The board module varies by board. The APIs documented here may or may not be //| available on a specific board.""" -//| def I2C() -> Any: +//| def I2C() -> busio.I2C: //| """Returns the `busio.I2C` object for the board designated SDA and SCL pins. It is a singleton.""" //| ... //| @@ -61,7 +61,7 @@ mp_obj_t board_i2c(void) { MP_DEFINE_CONST_FUN_OBJ_0(board_i2c_obj, board_i2c); -//| def SPI() -> Any: +//| def SPI() -> busio.SPI: //| """Returns the `busio.SPI` object for the board designated SCK, MOSI and MISO pins. It is a //| singleton.""" //| ... @@ -85,7 +85,7 @@ mp_obj_t board_spi(void) { #endif MP_DEFINE_CONST_FUN_OBJ_0(board_spi_obj, board_spi); -//| def UART() -> Any: +//| def UART() -> busio.UART: //| """Returns the `busio.UART` object for the board designated TX and RX pins. It is a singleton. //| //| The object created uses the default parameter values for `busio.UART`. If you need to set From dd27fdfbe34a6d67e5019d211e96bc8cda3ee77d Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 14:15:43 -0400 Subject: [PATCH 0179/1293] Added type hints to countio --- shared-bindings/countio/Counter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/countio/Counter.c b/shared-bindings/countio/Counter.c index 8db795015d..64e8701b75 100644 --- a/shared-bindings/countio/Counter.c +++ b/shared-bindings/countio/Counter.c @@ -13,7 +13,7 @@ //| """Counter will keep track of the number of falling edge transistions (pulses) on a //| given pin""" //| -//| def __init__(self, pin_a): +//| def __init__(self, pin_a: microcontroller.Pin): //| """Create a Counter object associated with the given pin. It tracks the number of //| falling pulses relative when the object is constructed. //| From 4b66483757048be03c7d34fd07d2028693a629a3 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 2 Jul 2020 15:38:37 -0400 Subject: [PATCH 0180/1293] Update submodule, revert direction change --- ports/stm/common-hal/busio/SPI.c | 7 ++----- ports/stm/st_driver | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index 380302da65..65eeb8ebcf 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -238,11 +238,8 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->handle.Instance = SPIx; self->handle.Init.Mode = SPI_MODE_MASTER; - // Implementing one-directional recieve-only SPI as per [RefMan RM0090:884] - // results in BSY bit related hangs. Using MOSI as an IO works fine without it, - // so it's unclear why this mode is present in the first place. - //self->handle.Init.Direction = (self->mosi == NULL) ? SPI_DIRECTION_2LINES_RXONLY : SPI_DIRECTION_2LINES; - self->handle.Init.Direction = SPI_DIRECTION_2LINES; + // Direction change only required for RX-only, see RefMan RM0090:884 + self->handle.Init.Direction = (self->mosi == NULL) ? SPI_DIRECTION_2LINES_RXONLY : SPI_DIRECTION_2LINES; self->handle.Init.DataSize = SPI_DATASIZE_8BIT; self->handle.Init.CLKPolarity = SPI_POLARITY_LOW; self->handle.Init.CLKPhase = SPI_PHASE_1EDGE; diff --git a/ports/stm/st_driver b/ports/stm/st_driver index 3fc2e0f3db..1900834751 160000 --- a/ports/stm/st_driver +++ b/ports/stm/st_driver @@ -1 +1 @@ -Subproject commit 3fc2e0f3db155b33177bb0705e0dd65cadb58412 +Subproject commit 1900834751fd6754457874b8c971690bab33e0a7 From 185a149da4cb13be12b905a25dcc4984fb636efe Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Thu, 2 Jul 2020 08:37:40 +0000 Subject: [PATCH 0181/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (777 of 777 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 92cf0172d0..9c357e198a 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-01 10:33-0500\n" -"PO-Revision-Date: 2020-07-02 02:02+0000\n" +"PO-Revision-Date: 2020-07-02 13:32+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -3405,7 +3405,7 @@ msgstr "tipo da saída incorreta" #: shared-module/displayio/Shape.c msgid "x value out of bounds" -msgstr "a valor x está fora dos limites" +msgstr "o valor x está fora dos limites" #: shared-bindings/displayio/Shape.c msgid "y should be an int" From 8f921cf138cc3059c7715f7cda03c99fd5a4db71 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 2 Jul 2020 20:28:32 +0200 Subject: [PATCH 0182/1293] 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 | 12 +++++++++--- locale/cs.po | 12 +++++++++--- locale/de_DE.po | 12 +++++++++--- locale/es.po | 12 +++++++++--- locale/fil.po | 12 +++++++++--- locale/fr.po | 12 +++++++++--- locale/it_IT.po | 12 +++++++++--- locale/ko.po | 12 +++++++++--- locale/nl.po | 12 +++++++++--- locale/pl.po | 12 +++++++++--- locale/pt_BR.po | 12 +++++++++--- locale/sv.po | 12 +++++++++--- locale/zh_Latn_pinyin.po | 12 +++++++++--- 13 files changed, 117 insertions(+), 39 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index da4f7b904b..44d3bfde29 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-01 10:33-0500\n" +"POT-Creation-Date: 2020-07-02 15:29+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -429,7 +429,8 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" msgstr "" @@ -599,6 +600,10 @@ msgstr "" msgid "Could not initialize GNSS" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Tidak dapat menginisialisasi UART" @@ -993,7 +998,8 @@ msgstr "Pin untuk channel kanan tidak valid" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" diff --git a/locale/cs.po b/locale/cs.po index 9029985397..dfe1cfa384 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-01 10:33-0500\n" +"POT-Creation-Date: 2020-07-02 15:29+0200\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -433,7 +433,8 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" msgstr "" @@ -597,6 +598,10 @@ msgstr "" msgid "Could not initialize GNSS" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -990,7 +995,8 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" diff --git a/locale/de_DE.po b/locale/de_DE.po index 3b7c49b396..f2d9258566 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-01 10:33-0500\n" +"POT-Creation-Date: 2020-07-02 15:29+0200\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -436,7 +436,8 @@ msgstr "Der Puffer ist zu klein" msgid "Buffer length %d too big. It must be less than %d" msgstr "Die Pufferlänge %d ist zu groß. Sie muss kleiner als %d sein" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" msgstr "" @@ -607,6 +608,10 @@ msgstr "Beschädigter raw code" msgid "Could not initialize GNSS" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Konnte UART nicht initialisieren" @@ -1007,7 +1012,8 @@ msgstr "Ungültiger Pin für rechten Kanal" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" diff --git a/locale/es.po b/locale/es.po index 9034024068..423d673617 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-01 10:33-0500\n" +"POT-Creation-Date: 2020-07-02 15:29+0200\n" "PO-Revision-Date: 2020-06-29 13:13+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -438,7 +438,8 @@ msgstr "El buffer es muy pequeño" msgid "Buffer length %d too big. It must be less than %d" msgstr "La longitud del buffer %d es muy grande. Debe ser menor a %d" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" msgstr "" @@ -606,6 +607,10 @@ msgstr "Código crudo corrupto" msgid "Could not initialize GNSS" msgstr "No se pudo inicializar el GNSS" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "No se puede inicializar la UART" @@ -1002,7 +1007,8 @@ msgstr "Pin inválido para canal derecho" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" diff --git a/locale/fil.po b/locale/fil.po index ff5cc6426d..3489316130 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-01 10:33-0500\n" +"POT-Creation-Date: 2020-07-02 15:29+0200\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -431,7 +431,8 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" msgstr "" @@ -598,6 +599,10 @@ msgstr "" msgid "Could not initialize GNSS" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Hindi ma-initialize ang UART" @@ -998,7 +1003,8 @@ msgstr "Mali ang pin para sa kanang channel" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" diff --git a/locale/fr.po b/locale/fr.po index 7facdef043..2db7f47222 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-01 10:33-0500\n" +"POT-Creation-Date: 2020-07-02 15:29+0200\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" "Language: fr\n" @@ -441,7 +441,8 @@ msgstr "Le tampon est trop petit" msgid "Buffer length %d too big. It must be less than %d" msgstr "La longueur du tampon %d est trop grande. Il doit être inférieur à %d" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" msgstr "" @@ -614,6 +615,10 @@ msgstr "Code brut corrompu" msgid "Could not initialize GNSS" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "L'UART n'a pu être initialisé" @@ -1011,7 +1016,8 @@ msgstr "Broche invalide pour le canal droit" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" diff --git a/locale/it_IT.po b/locale/it_IT.po index 983b47b824..bd49e2388b 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-01 10:33-0500\n" +"POT-Creation-Date: 2020-07-02 15:29+0200\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -431,7 +431,8 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" msgstr "" @@ -599,6 +600,10 @@ msgstr "" msgid "Could not initialize GNSS" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Impossibile inizializzare l'UART" @@ -1000,7 +1005,8 @@ msgstr "Pin non valido per il canale destro" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" diff --git a/locale/ko.po b/locale/ko.po index ea3f564700..4bd56cde1e 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-01 10:33-0500\n" +"POT-Creation-Date: 2020-07-02 15:29+0200\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -429,7 +429,8 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" msgstr "" @@ -593,6 +594,10 @@ msgstr "" msgid "Could not initialize GNSS" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -986,7 +991,8 @@ msgstr "오른쪽 채널 핀이 잘못되었습니다" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" diff --git a/locale/nl.po b/locale/nl.po index 12a767b183..8306aa7797 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-01 10:33-0500\n" +"POT-Creation-Date: 2020-07-02 15:29+0200\n" "PO-Revision-Date: 2020-06-02 19:50+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -435,7 +435,8 @@ msgstr "Buffer is te klein" msgid "Buffer length %d too big. It must be less than %d" msgstr "Buffer lengte %d te groot. Het moet kleiner zijn dan %d" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" msgstr "" @@ -605,6 +606,10 @@ msgstr "Corrupt raw code" msgid "Could not initialize GNSS" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Kan UART niet initialiseren" @@ -1002,7 +1007,8 @@ msgstr "Ongeldige pin voor rechter kanaal" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" diff --git a/locale/pl.po b/locale/pl.po index d626e8ebcf..7724481314 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-01 10:33-0500\n" +"POT-Creation-Date: 2020-07-02 15:29+0200\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -428,7 +428,8 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" msgstr "" @@ -592,6 +593,10 @@ msgstr "" msgid "Could not initialize GNSS" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Ustawienie UART nie powiodło się" @@ -987,7 +992,8 @@ msgstr "Zła nóżka dla prawego kanału" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 9c357e198a..99e59304c8 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-01 10:33-0500\n" +"POT-Creation-Date: 2020-07-02 15:29+0200\n" "PO-Revision-Date: 2020-07-02 13:32+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -441,7 +441,8 @@ msgstr "O buffer é muito pequeno" msgid "Buffer length %d too big. It must be less than %d" msgstr "O tamanho do buffer %d é muito grande. Deve ser menor que %d" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" msgstr "O comprimento do Buffer deve ser um múltiplo de 512" @@ -612,6 +613,10 @@ msgstr "Código bruto corrompido" msgid "Could not initialize GNSS" msgstr "Não foi possível inicializar o GNSS" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Não foi possível inicializar o UART" @@ -1009,7 +1014,8 @@ msgstr "Pino inválido para canal direito" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" diff --git a/locale/sv.po b/locale/sv.po index f359eba275..3ec91c19ee 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-01 10:33-0500\n" +"POT-Creation-Date: 2020-07-02 15:29+0200\n" "PO-Revision-Date: 2020-06-03 18:59+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -435,7 +435,8 @@ msgstr "Bufferten är för liten" msgid "Buffer length %d too big. It must be less than %d" msgstr "Buffertlängd %d för stor. Den måste vara mindre än %d" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" msgstr "" @@ -605,6 +606,10 @@ msgstr "Korrupt rå kod" msgid "Could not initialize GNSS" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Det gick inte att initiera UART" @@ -1000,7 +1005,8 @@ msgstr "Ogiltig pinne för höger kanal" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index bc9a7253b9..db41adb536 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-01 10:33-0500\n" +"POT-Creation-Date: 2020-07-02 15:29+0200\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -434,7 +434,8 @@ msgstr "Huǎnchōng qū tài xiǎo" msgid "Buffer length %d too big. It must be less than %d" msgstr "Huǎnchōng qū chángdù%d tài dà. Tā bìxū xiǎoyú%d" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" msgstr "" @@ -600,6 +601,10 @@ msgstr "Sǔnhuài de yuánshǐ dàimǎ" msgid "Could not initialize GNSS" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Wúfǎ chūshǐhuà UART" @@ -995,7 +1000,8 @@ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" From 35e35e61d3016d83f1e528bf3e7947fa24f995f0 Mon Sep 17 00:00:00 2001 From: _fonzlate Date: Thu, 2 Jul 2020 20:06:04 +0000 Subject: [PATCH 0183/1293] Translated using Weblate (Dutch) Currently translated at 100.0% (778 of 778 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/nl/ --- locale/nl.po | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index 8306aa7797..34e9c835a2 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-02 15:29+0200\n" -"PO-Revision-Date: 2020-06-02 19:50+0000\n" +"PO-Revision-Date: 2020-07-02 20:42+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" "Language: nl\n" @@ -16,7 +16,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.1-dev\n" +"X-Generator: Weblate 4.2-dev\n" #: main.c msgid "" @@ -68,7 +68,7 @@ msgstr "%d adres pins en %d RGB pins geven een hoogte van %d aan, niet %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" -msgstr "" +msgstr "%q fout: %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -99,7 +99,7 @@ msgstr "%q moet een tuple van lengte 2 zijn" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q pin invalid" -msgstr "" +msgstr "%q pin onjuist" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" @@ -438,7 +438,7 @@ msgstr "Buffer lengte %d te groot. Het moet kleiner zijn dan %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" -msgstr "" +msgstr "Buffer lengte moet een veelvoud van 512 zijn" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -604,11 +604,11 @@ msgstr "Corrupt raw code" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" -msgstr "" +msgstr "Kan GNSS niet initialiseren" #: ports/cxd56/common-hal/sdioio/SDCard.c msgid "Could not initialize SDCard" -msgstr "" +msgstr "Kan SDCard niet initialiseren" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" @@ -898,7 +898,7 @@ msgstr "Interne fout #%d" #: shared-bindings/sdioio/SDCard.c msgid "Invalid %q" -msgstr "" +msgstr "Ongeldige %q" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1417,7 +1417,7 @@ msgstr "Draaiende in veilige modus! Opgeslagen code wordt niet uitgevoerd.\n" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" -msgstr "" +msgstr "SD kaart CSD formaat niet ondersteund" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c @@ -1489,7 +1489,7 @@ msgstr "Geef op zijn minst 1 UART pin op" #: shared-bindings/gnss/GNSS.c msgid "System entry must be gnss.SatelliteSystem" -msgstr "" +msgstr "Systeem invoer moet gnss.SatelliteSystem zijn" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" @@ -2062,7 +2062,7 @@ msgstr "kan geen niet-'None' waarde naar een net gestartte generator sturen" #: shared-module/sdcardio/SDCard.c msgid "can't set 512 block size" -msgstr "" +msgstr "kan geen 512 blokgrootte instellen" #: py/objnamedtuple.c msgid "can't set attribute" @@ -2193,7 +2193,7 @@ msgstr "kon de Vandermonde matrix niet omkeren" #: shared-module/sdcardio/SDCard.c msgid "couldn't determine SD card version" -msgstr "" +msgstr "kon SD kaart versie niet bepalen" #: extmod/ulab/code/approx.c msgid "data must be iterable" @@ -2760,7 +2760,7 @@ msgstr "negatieve verschuivingstelling (shift count)" #: shared-module/sdcardio/SDCard.c msgid "no SD card" -msgstr "" +msgstr "geen SD kaart" #: py/vm.c msgid "no active exception to reraise" @@ -2785,7 +2785,7 @@ msgstr "geen reset pin beschikbaar" #: shared-module/sdcardio/SDCard.c msgid "no response from SD card" -msgstr "" +msgstr "geen antwoord van SD kaart" #: py/runtime.c msgid "no such attribute" @@ -3081,7 +3081,7 @@ msgstr "de slaapduur mag niet negatief zijn" #: extmod/ulab/code/ndarray.c msgid "slice step can't be zero" -msgstr "" +msgstr "segmentstap mag niet nul zijn" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" @@ -3101,15 +3101,15 @@ msgstr "sorteerargument moet een ndarray zijn" #: extmod/ulab/code/filter.c msgid "sos array must be of shape (n_section, 6)" -msgstr "" +msgstr "sos array moet vorm (n_section, 6) hebben" #: extmod/ulab/code/filter.c msgid "sos[:, 3] should be all ones" -msgstr "" +msgstr "sos[:, 3] moeten allemaal 1 zijn" #: extmod/ulab/code/filter.c msgid "sosfilt requires iterable arguments" -msgstr "" +msgstr "sosfilt vereist itereerbare argumenten" #: py/objstr.c msgid "start/end indices" @@ -3198,11 +3198,11 @@ msgstr "timeout moet groter dan 0.0 zijn" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" -msgstr "" +msgstr "timeout bij wachten op v1 kaart" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v2 card" -msgstr "" +msgstr "timeout bij wachten op v2 kaart" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" @@ -3403,15 +3403,15 @@ msgstr "nul-stap" #: extmod/ulab/code/filter.c msgid "zi must be an ndarray" -msgstr "" +msgstr "zi moet een ndarray zijn" #: extmod/ulab/code/filter.c msgid "zi must be of float type" -msgstr "" +msgstr "zi moet van type float zijn" #: extmod/ulab/code/filter.c msgid "zi must be of shape (n_section, 2)" -msgstr "" +msgstr "zi moet vorm (n_section, 2) hebben" #~ msgid "I2C operation not supported" #~ msgstr "I2C actie niet ondersteund" From 9b4ffc05710873e69bfeed209d0f7ebd8fb2f259 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 17:47:52 -0400 Subject: [PATCH 0184/1293] Changed unions to ReadableBuffer and WriteableBuffer --- shared-bindings/_bleio/Address.c | 2 +- shared-bindings/_bleio/CharacteristicBuffer.c | 2 +- shared-bindings/_bleio/Descriptor.c | 2 +- shared-bindings/_bleio/PacketBuffer.c | 2 +- shared-bindings/_bleio/UUID.c | 2 +- shared-bindings/aesio/aes.c | 6 +++--- shared-bindings/audiobusio/PDMIn.c | 2 +- shared-bindings/audiocore/WaveFile.c | 2 +- shared-bindings/audiomp3/MP3Decoder.c | 2 +- shared-bindings/bitbangio/I2C.c | 6 +++--- shared-bindings/bitbangio/SPI.c | 6 +++--- shared-bindings/busio/I2C.c | 6 +++--- shared-bindings/busio/SPI.c | 4 ++-- shared-bindings/busio/UART.c | 4 ++-- 14 files changed, 24 insertions(+), 24 deletions(-) diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c index 87bae19cee..06fb58d76a 100644 --- a/shared-bindings/_bleio/Address.c +++ b/shared-bindings/_bleio/Address.c @@ -38,7 +38,7 @@ //| """Encapsulates the address of a BLE device.""" //| -//| def __init__(self, address: Union[bytes, bytearray, memoryview], address_type: int): +//| def __init__(self, address: ReadableBuffer, address_type: int): //| """Create a new Address object encapsulating the address value. //| The value itself can be one of: //| diff --git a/shared-bindings/_bleio/CharacteristicBuffer.c b/shared-bindings/_bleio/CharacteristicBuffer.c index ee5a8ea332..efe27e5d2a 100644 --- a/shared-bindings/_bleio/CharacteristicBuffer.c +++ b/shared-bindings/_bleio/CharacteristicBuffer.c @@ -110,7 +110,7 @@ STATIC void check_for_deinit(bleio_characteristic_buffer_obj_t *self) { //| :rtype: bytes or None""" //| ... //| -//| def readinto(self, buf: Union[bytearray, memoryview]) -> Optional[int]: +//| def readinto(self, buf: WriteableBuffer) -> Optional[int]: //| """Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. //| //| :return: number of bytes read and stored into ``buf`` diff --git a/shared-bindings/_bleio/Descriptor.c b/shared-bindings/_bleio/Descriptor.c index b478e85e12..6382221a16 100644 --- a/shared-bindings/_bleio/Descriptor.c +++ b/shared-bindings/_bleio/Descriptor.c @@ -167,7 +167,7 @@ const mp_obj_property_t bleio_descriptor_characteristic_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| value: Union[bytearray, memoryview] = ... +//| value: WriteableBuffer = ... //| """The value of this descriptor.""" //| STATIC mp_obj_t bleio_descriptor_get_value(mp_obj_t self_in) { diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index a5b017312c..7645a25aaa 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -93,7 +93,7 @@ STATIC void check_for_deinit(bleio_packet_buffer_obj_t *self) { } } -//| def readinto(self, buf: Union[bytearray, memoryview]) -> int: +//| def readinto(self, buf: WriteableBuffer) -> int: //| """Reads a single BLE packet into the ``buf``. Raises an exception if the next packet is longer //| than the given buffer. Use `packet_size` to read the maximum length of a single packet. //| diff --git a/shared-bindings/_bleio/UUID.c b/shared-bindings/_bleio/UUID.c index a36cade6a0..823275f900 100644 --- a/shared-bindings/_bleio/UUID.c +++ b/shared-bindings/_bleio/UUID.c @@ -186,7 +186,7 @@ const mp_obj_property_t bleio_uuid_size_obj = { }; -//| def pack_into(self, buffer: Union[bytearray, memoryview], offset: int = 0) -> None: +//| def pack_into(self, buffer: WriteableBuffer, offset: int = 0) -> None: //| """Packs the UUID into the given buffer at the given offset.""" //| ... //| diff --git a/shared-bindings/aesio/aes.c b/shared-bindings/aesio/aes.c index c8d4ee82ca..df6d0c5676 100644 --- a/shared-bindings/aesio/aes.c +++ b/shared-bindings/aesio/aes.c @@ -12,7 +12,7 @@ //| class AES: //| """Encrypt and decrypt AES streams""" //| -//| def __init__(self, key: Union[bytes, bytearray, memoryview], mode: int=0, iv: Union[bytes, bytearray, memoryview]=None, segment_size: int=8) -> AES: +//| def __init__(self, key: ReadableBuffer, mode: int=0, iv: ReadableBuffer=None, segment_size: int=8) -> AES: //| """Create a new AES state with the given key. //| //| :param bytearray key: A 16-, 24-, or 32-byte key @@ -152,7 +152,7 @@ STATIC void validate_length(aesio_aes_obj_t *self, size_t src_length, } } -//| def encrypt_into(src: Union[bytearray, memoryview], dest: Union[bytearray, memoryview]) -> None: +//| def encrypt_into(src: WriteableBuffer, dest: WriteableBuffer) -> None: //| """Encrypt the buffer from ``src`` into ``dest``. //| //| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the @@ -183,7 +183,7 @@ STATIC mp_obj_t aesio_aes_encrypt_into(mp_obj_t aesio_obj, mp_obj_t src, STATIC MP_DEFINE_CONST_FUN_OBJ_3(aesio_aes_encrypt_into_obj, aesio_aes_encrypt_into); -//| def decrypt_into(src: Union[bytearray, memoryview], dest: Union[bytearray, memoryview]) -> None: +//| def decrypt_into(src: WriteableBuffer, dest: WriteableBuffer) -> None: //| //| """Decrypt the buffer from ``src`` into ``dest``. //| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c index cfb19d7ce3..329c7bde53 100644 --- a/shared-bindings/audiobusio/PDMIn.c +++ b/shared-bindings/audiobusio/PDMIn.c @@ -168,7 +168,7 @@ STATIC mp_obj_t audiobusio_pdmin_obj___exit__(size_t n_args, const mp_obj_t *arg STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_pdmin___exit___obj, 4, 4, audiobusio_pdmin_obj___exit__); -//| def record(self, destination: Union[bytearray, memoryview], destination_length: int) -> None: +//| def record(self, destination: WriteableBuffer, destination_length: int) -> None: //| """Records destination_length bytes of samples to destination. This is //| blocking. //| diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index 4eed5eaca5..838447f2e1 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -40,7 +40,7 @@ //| be 8 bit unsigned or 16 bit signed. If a buffer is provided, it will be used instead of allocating //| an internal buffer.""" //| -//| def __init__(self, file: typing.BinaryIO, buffer: Union[bytes, bytearray, memoryview]): +//| def __init__(self, file: typing.BinaryIO, buffer: ReadableBuffer): //| """Load a .wav file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. //| //| :param typing.BinaryIO file: Already opened wave file diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index a4fd6e61f6..68c27169ff 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -37,7 +37,7 @@ //| class MP3: //| """Load a mp3 file for audio playback""" //| -//| def __init__(self, file: typing.BinaryIO, buffer: Union[bytearray, memoryview]): +//| def __init__(self, file: typing.BinaryIO, buffer: WriteableBuffer): //| //| """Load a .mp3 file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. //| diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index b10110430e..710275b2f6 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -165,7 +165,7 @@ STATIC mp_obj_t bitbangio_i2c_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_unlock_obj, bitbangio_i2c_obj_unlock); -//| def readfrom_into(self, address: int, buffer: Union[bytearray, memoryview], *, start: int = 0, end: int = None) -> None: +//| def readfrom_into(self, address: int, buffer: WriteableBuffer, *, start: int = 0, end: int = None) -> None: //| """Read into ``buffer`` from the device selected by ``address``. //| The number of bytes read will be the length of ``buffer``. //| At least one byte must be read. @@ -217,7 +217,7 @@ STATIC mp_obj_t bitbangio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_a } MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_readfrom_into_obj, 3, bitbangio_i2c_readfrom_into); -//| def writeto(self, address: int, buffer: Union[bytes, bytearray, memoryview], *, start: int = 0, end: int = None, stop: bool = True) -> None: +//| def writeto(self, address: int, buffer: ReadableBuffer, *, start: int = 0, end: int = None, stop: bool = True) -> None: //| """Write the bytes from ``buffer`` to the device selected by ``address`` and then transmits a //| stop bit. Use `writeto_then_readfrom` when needing a write, no stop and repeated start //| before a read. @@ -277,7 +277,7 @@ STATIC mp_obj_t bitbangio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, m STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_writeto_obj, 1, bitbangio_i2c_writeto); -//| def writeto_then_readfrom(self, address: int, out_buffer: Union[bytearray, memoryview], in_buffer: Union[bytes, bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: +//| def writeto_then_readfrom(self, address: int, out_buffer: WriteableBuffer, in_buffer: ReadableBuffer, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: //| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and //| ``in_buffer`` can be the same buffer because they are used sequentially. diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index 597d8602be..90483e3ebf 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -200,7 +200,7 @@ STATIC mp_obj_t bitbangio_spi_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_spi_unlock_obj, bitbangio_spi_obj_unlock); -//| def write(self, buf: Union[bytes, bytearray, memoryview]) -> None: +//| def write(self, buf: ReadableBuffer) -> None: //| """Write the data contained in ``buf``. Requires the SPI being locked. //| If the buffer is empty, nothing happens.""" //| ... @@ -224,7 +224,7 @@ STATIC mp_obj_t bitbangio_spi_write(mp_obj_t self_in, mp_obj_t wr_buf) { MP_DEFINE_CONST_FUN_OBJ_2(bitbangio_spi_write_obj, bitbangio_spi_write); -//| def readinto(self, buf: Union[bytearray, memoryview]) -> None: +//| def readinto(self, buf: WriteableBuffer) -> None: //| """Read into the buffer specified by ``buf`` while writing zeroes. //| Requires the SPI being locked. //| If the number of bytes to read is 0, nothing happens.""" @@ -248,7 +248,7 @@ STATIC mp_obj_t bitbangio_spi_readinto(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitbangio_spi_readinto_obj, 2, 2, bitbangio_spi_readinto); -//| def write_readinto(self, buffer_out: Union[bytes, bytearray, memoryview], buffer_in: Union[bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: +//| def write_readinto(self, buffer_out: ReadableBuffer, buffer_in: WriteableBuffer, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: //| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. //| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` //| must be equal. diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 2b3497c422..cf38fdce60 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -176,7 +176,7 @@ STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock); -//| def readfrom_into(self, address: int, buffer: Union[bytearray, memoryview], *, start: int = 0, end: int = None) -> None: +//| def readfrom_into(self, address: int, buffer: WriteableBuffer, *, start: int = 0, end: int = None) -> None: //| """Read into ``buffer`` from the device selected by ``address``. //| The number of bytes read will be the length of ``buffer``. //| At least one byte must be read. @@ -228,7 +228,7 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args, } MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_into); -//| def writeto(self, address: int, buffer: Union[bytes, bytearray, memoryview], *, start: int = 0, end: int = None, stop: bool = True) -> None: +//| def writeto(self, address: int, buffer: ReadableBuffer, *, start: int = 0, end: int = None, stop: bool = True) -> None: //| """Write the bytes from ``buffer`` to the device selected by ``address``. //| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be //| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and @@ -287,7 +287,7 @@ STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_ma } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto); -//| def writeto_then_readfrom(self, address: int, out_buffer: Union[bytes, bytearray, memoryview], in_buffer: Union[bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: +//| def writeto_then_readfrom(self, address: int, out_buffer: ReadableBuffer, in_buffer: WriteableBuffer, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: //| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and //| ``in_buffer`` can be the same buffer because they are used sequentially. diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index e5b0da4a65..38c1bcc0e7 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -228,7 +228,7 @@ STATIC mp_obj_t busio_spi_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_unlock_obj, busio_spi_obj_unlock); -//| def write(self, buffer: Union[bytes, bytearray, memoryview], *, start: int = 0, end: int = None) -> None: +//| def write(self, buffer: ReadableBuffer, *, start: int = 0, end: int = None) -> None: //| """Write the data contained in ``buffer``. The SPI object must be locked. //| If the buffer is empty, nothing happens. //| @@ -314,7 +314,7 @@ STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_m } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_readinto_obj, 2, busio_spi_readinto); -//| def write_readinto(self, buffer_out: Union[bytes, bytearray, memoryview], buffer_in: Union[bytes, bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: +//| def write_readinto(self, buffer_out: ReadableBuffer, buffer_in: ReadableBuffer, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: //| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. //| The SPI object must be locked. //| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 2ce1467bbb..fd51d5d3b6 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -190,7 +190,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| ... //| -//| def readinto(self, buf: Union[bytearray, memoryview]) -> Optional[int]: +//| def readinto(self, buf: WriteableBuffer) -> Optional[int]: //| """Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. //| //| :return: number of bytes read and stored into ``buf`` @@ -208,7 +208,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| ... //| -//| def write(self, buf: Union[bytearray, memoryview]) -> Optional[int]: +//| def write(self, buf: WriteableBuffer) -> Optional[int]: //| """Write the buffer of bytes to the bus. //| //| *New in CircuitPython 4.0:* ``buf`` must be bytes, not a string. From 70fdde4aaaa6c1c8fd54c0463d405dfbf8794b10 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 2 Jul 2020 15:11:40 -0700 Subject: [PATCH 0185/1293] Remove trailing space --- 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 25cf5f480a..a9619a8e0b 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -202,7 +202,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| def readline(self, ) -> Any: //| """Read a line, ending in a newline character, or //| return None if a timeout occurs sooner, or -//| return everything readable if no newline is found and timeout=0 +//| return everything readable if no newline is found and timeout=0 //| //| :return: the line read //| :rtype: bytes or None""" From 49aacc8596eb1036e62ea284ca4f6604d514c24a Mon Sep 17 00:00:00 2001 From: ansonhe97 Date: Fri, 3 Jul 2020 12:43:21 +0800 Subject: [PATCH 0186/1293] ADD: Fixed wrong SPI pins and added more functional pins --- .../boards/seeeduino_wio_terminal/pins.c | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c index 92cc8f8be1..1fac07b0b8 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c @@ -33,9 +33,10 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB27) }, // SPI pins - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_PB01) }, // I2C pins { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA16) }, @@ -51,19 +52,35 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_TFT_SS), MP_ROM_PTR(&pin_PB21) }, { MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_PC06) }, { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_PC07) }, - // Special named pins + // SD Card + { MP_OBJ_NEW_QSTR(MP_QSTR_SD_MISO), MP_ROM_PTR(&pin_PC18) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SD_MOSI), MP_ROM_PTR(&pin_PC16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SD_SCK), MP_ROM_PTR(&pin_PC17) }, + { MP_ROM_QSTR(MP_QSTR_SD_SS), MP_ROM_PTR(&pin_PC19) }, + { MP_ROM_QSTR(MP_QSTR_SD_DET), MP_ROM_PTR(&pin_PC21) }, + + // Switch { MP_OBJ_NEW_QSTR(MP_QSTR_SWITCH_UP), MP_ROM_PTR(&pin_PD20) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SWITCH_LEFT), MP_ROM_PTR(&pin_PD12) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SWITCH_RIGHT), MP_ROM_PTR(&pin_PD09) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SWITCH_DOWN), MP_ROM_PTR(&pin_PD08) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SWITCH_PRESS), MP_ROM_PTR(&pin_PD10) }, + + // Button { MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_1), MP_ROM_PTR(&pin_PC26) }, { MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_2), MP_ROM_PTR(&pin_PC27) }, { MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_3), MP_ROM_PTR(&pin_PC28) }, + + // Special named pins { MP_OBJ_NEW_QSTR(MP_QSTR_LIGHT), MP_ROM_PTR(&pin_PD01) }, { MP_OBJ_NEW_QSTR(MP_QSTR_BUZZER), MP_ROM_PTR(&pin_PD11) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IR), MP_ROM_PTR(&pin_PB31) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MIC), MP_ROM_PTR(&pin_PC30) }, + { MP_ROM_QSTR(MP_QSTR_GYROSCOPE_SCL), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_GYROSCOPE_SDA), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_GYROSCOPE_INT), MP_ROM_PTR(&pin_PC21) }, // Comm objects { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, From 2a92cf8d8bc63f5179fa8c8b3df5c515dbc407c1 Mon Sep 17 00:00:00 2001 From: ansonhe97 Date: Fri, 3 Jul 2020 12:44:20 +0800 Subject: [PATCH 0187/1293] ADD: Added LCD driver to board init --- .../boards/seeeduino_wio_terminal/board.c | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c index 0f60736a24..b7fc736eb0 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c @@ -27,8 +27,85 @@ #include "boards/board.h" #include "mpconfigboard.h" #include "hal/include/hal_gpio.h" +#include "shared-bindings/busio/SPI.h" +#include "shared-bindings/displayio/FourWire.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/displayio/mipi_constants.h" + +displayio_fourwire_obj_t board_display_obj; + +uint8_t display_init_sequence[] = { + 0x01, 0x80, 0x80, // Software reset then delay 0x80 (128ms) + 0xEF, 0x03, 0x03, 0x80, 0x02, + 0xCF, 0x03, 0x00, 0xC1, 0x30, + 0xED, 0x04, 0x64, 0x03, 0x12, 0x81, + 0xE8, 0x03, 0x85, 0x00, 0x78, + 0xCB, 0x05, 0x39, 0x2C, 0x00, 0x34, 0x02, + 0xF7, 0x01, 0x20, + 0xEA, 0x02, 0x00, 0x00, + 0xc0, 0x01, 0x23, // Power control VRH[5:0] + 0xc1, 0x01, 0x10, // Power control SAP[2:0];BT[3:0] + 0xc5, 0x02, 0x3e, 0x28, // VCM control + 0xc7, 0x01, 0x86, // VCM control2 + 0x36, 0x01, 0x38, // Memory Access Control + 0x37, 0x01, 0x00, // Vertical scroll zero + 0x3a, 0x01, 0x55, // COLMOD: Pixel Format Set + 0xb1, 0x02, 0x00, 0x18, // Frame Rate Control (In Normal Mode/Full Colors) + 0xb6, 0x03, 0x08, 0x82, 0x27, // Display Function Control + 0xF2, 0x01, 0x00, // 3Gamma Function Disable + 0x26, 0x01, 0x01, // Gamma curve selected + 0xe0, 0x0f, 0x0F, 0x31, 0x2B, 0x0C, 0x0E, 0x08, 0x4E, 0xF1, 0x37, 0x07, 0x10, 0x03, 0x0E, 0x09, 0x00, // Set Gamma + 0xe1, 0x0f, 0x00, 0x0E, 0x14, 0x03, 0x11, 0x07, 0x31, 0xC1, 0x48, 0x08, 0x0F, 0x0C, 0x31, 0x36, 0x0F, // Set Gamma + 0x11, 0x80, 0x78, // Exit Sleep then delay 0x78 (120ms) + 0x29, 0x80, 0x78, // Display on then delay 0x78 (120ms) +}; void board_init(void) { + busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; + common_hal_busio_spi_construct(spi, &pin_PB20, &pin_PB19, NULL); + common_hal_busio_spi_never_reset(spi); + + displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; + bus->base.type = &displayio_fourwire_type; + common_hal_displayio_fourwire_construct(bus, + spi, + &pin_PC06, // TFT_DC Command or data + &pin_PB21, // TFT_CS Chip select + &pin_PC07, // TFT_RST Reset + 60000000, // Baudrate + 0, // Polarity + 0); // Phase + + displayio_display_obj_t* display = &displays[0].display; + display->base.type = &displayio_display_type; + common_hal_displayio_display_construct(display, + bus, + 320, // Width + 240, // Height + 0, // column start + 0, // row start + 180, // rotation + 16, // Color depth + false, // Grayscale + false, // pixels in a byte share a row. Only valid for depths < 8 + 1, // bytes per cell. Only valid for depths < 8 + false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word + MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command + MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command + MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command + 0x37, // set vertical scroll command + display_init_sequence, + sizeof(display_init_sequence), + &pin_PC05, // backlight pin + NO_BRIGHTNESS_COMMAND, + 1.0f, // brightness (ignored) + true, // auto_brightness + false, // single_byte_bounds + false, // data_as_commands + true, // auto_refresh + 60, // native_frames_per_second + true); // backlight_on_high } bool board_requests_safe_mode(void) { From 2ecb46f19235e7ea3ac80304aa6a4dc069f31ba0 Mon Sep 17 00:00:00 2001 From: ansonhe97 Date: Fri, 3 Jul 2020 13:42:27 +0800 Subject: [PATCH 0188/1293] Fix CI --- ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c index 1fac07b0b8..6668461f9b 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c @@ -53,7 +53,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_PC06) }, { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_PC05) }, { MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_PC07) }, - + // SD Card { MP_OBJ_NEW_QSTR(MP_QSTR_SD_MISO), MP_ROM_PTR(&pin_PC18) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SD_MOSI), MP_ROM_PTR(&pin_PC16) }, From 783cc4de398aba060eb69971c4aaf3453ee43500 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 10:05:14 -0400 Subject: [PATCH 0189/1293] Added type hints to displayio --- shared-bindings/displayio/Bitmap.c | 10 ++++----- shared-bindings/displayio/ColorConverter.c | 4 ++-- shared-bindings/displayio/Display.c | 22 +++++++++--------- shared-bindings/displayio/EPaperDisplay.c | 14 ++++++------ shared-bindings/displayio/FourWire.c | 4 ++-- shared-bindings/displayio/Group.c | 26 +++++++++++----------- shared-bindings/displayio/I2CDisplay.c | 4 ++-- shared-bindings/displayio/OnDiskBitmap.c | 4 ++-- shared-bindings/displayio/Palette.c | 8 +++---- shared-bindings/displayio/ParallelBus.c | 4 ++-- shared-bindings/displayio/Shape.c | 2 +- shared-bindings/displayio/TileGrid.c | 18 +++++++-------- 12 files changed, 60 insertions(+), 60 deletions(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index a52840f2e0..9677b51f62 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -73,7 +73,7 @@ STATIC mp_obj_t displayio_bitmap_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| width: Any = ... +//| width: int = ... //| """Width of the bitmap. (read only)""" //| STATIC mp_obj_t displayio_bitmap_obj_get_width(mp_obj_t self_in) { @@ -91,7 +91,7 @@ const mp_obj_property_t displayio_bitmap_width_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| height: Any = ... +//| height: int = ... //| """Height of the bitmap. (read only)""" //| STATIC mp_obj_t displayio_bitmap_obj_get_height(mp_obj_t self_in) { @@ -109,7 +109,7 @@ const mp_obj_property_t displayio_bitmap_height_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def __getitem__(self, index: Any) -> Any: +//| def __getitem__(self, index: Union[Tuple[int, int], int]) -> int: //| """Returns the value at the given index. The index can either be an x,y tuple or an int equal //| to ``y * width + x``. //| @@ -118,7 +118,7 @@ const mp_obj_property_t displayio_bitmap_height_obj = { //| print(bitmap[0,1])""" //| ... //| -//| def __setitem__(self, index: Any, value: Any) -> Any: +//| def __setitem__(self, index: Union[Tuple[int, int], int], value: int) -> None: //| """Sets the value at the given index. The index can either be an x,y tuple or an int equal //| to ``y * width + x``. //| @@ -172,7 +172,7 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val return mp_const_none; } -//| def fill(self, value: Any) -> Any: +//| def fill(self, value: int) -> None: //| """Fills the bitmap with the supplied palette index value.""" //| ... //| diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index 33d0bdd3cb..6126c4194d 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -65,7 +65,7 @@ STATIC mp_obj_t displayio_colorconverter_make_new(const mp_obj_type_t *type, siz return MP_OBJ_FROM_PTR(self); } -//| def convert(self, color: Any) -> Any: +//| def convert(self, color: int) -> int: //| """Converts the given RGB888 color to RGB565""" //| ... //| @@ -84,7 +84,7 @@ STATIC mp_obj_t displayio_colorconverter_obj_convert(mp_obj_t self_in, mp_obj_t } MP_DEFINE_CONST_FUN_OBJ_2(displayio_colorconverter_convert_obj, displayio_colorconverter_obj_convert); -//| dither: Any = ... +//| dither: bool = ... //| """When true the color converter dithers the output by adding random noise when //| truncating to display bitdepth""" //| diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 6e454f34bd..c3ddc6c140 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -49,7 +49,7 @@ //| Most people should not use this class directly. Use a specific display driver instead that will //| contain the initialization sequence at minimum.""" //| -//| def __init__(self, display_bus: Any, init_sequence: buffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: microcontroller.Pin = None, brightness_command: int = None, brightness: bool = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60): +//| def __init__(self, display_bus: displayio, init_sequence: buffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: microcontroller.Pin = None, brightness_command: int = None, brightness: bool = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60): //| r"""Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). //| //| The ``init_sequence`` is bitpacked to minimize the ram impact. Every command begins with a @@ -188,7 +188,7 @@ static displayio_display_obj_t* native_display(mp_obj_t display_obj) { return MP_OBJ_TO_PTR(native_display); } -//| def show(self, group: Group) -> Any: +//| def show(self, group: Group) -> None: //| """Switches to displaying the given group of layers. When group is None, the default //| CircuitPython terminal will be shown. //| @@ -210,7 +210,7 @@ STATIC mp_obj_t displayio_display_obj_show(mp_obj_t self_in, mp_obj_t group_in) } MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show); -//| def refresh(self, *, target_frames_per_second: int = 60, minimum_frames_per_second: int = 1) -> Any: +//| def refresh(self, *, target_frames_per_second: int = 60, minimum_frames_per_second: int = 1) -> bool: //| """When auto refresh is off, waits for the target frame rate and then refreshes the display, //| returning True. If the call has taken too long since the last refresh call for the given //| target frame rate, then the refresh returns False immediately without updating the screen to @@ -245,7 +245,7 @@ STATIC mp_obj_t displayio_display_obj_refresh(size_t n_args, const mp_obj_t *pos } MP_DEFINE_CONST_FUN_OBJ_KW(displayio_display_refresh_obj, 1, displayio_display_obj_refresh); -//| auto_refresh: Any = ... +//| auto_refresh: None = ... //| """True when the display is refreshed automatically.""" //| STATIC mp_obj_t displayio_display_obj_get_auto_refresh(mp_obj_t self_in) { @@ -270,7 +270,7 @@ const mp_obj_property_t displayio_display_auto_refresh_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| brightness: Any = ... +//| brightness: float = ... //| """The brightness of the display as a float. 0.0 is off and 1.0 is full brightness. When //| `auto_brightness` is True, the value of `brightness` will change automatically. //| If `brightness` is set, `auto_brightness` will be disabled and will be set to False.""" @@ -307,7 +307,7 @@ const mp_obj_property_t displayio_display_brightness_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| auto_brightness: Any = ... +//| auto_brightness: Optional[bool] = ... //| """True when the display brightness is adjusted automatically, based on an ambient //| light sensor or other method. Note that some displays may have this set to True by default, //| but not actually implement automatic brightness adjustment. `auto_brightness` is set to False @@ -338,7 +338,7 @@ const mp_obj_property_t displayio_display_auto_brightness_obj = { -//| width: Any = ... +//| width: int = ... //| Gets the width of the board //| //| @@ -355,7 +355,7 @@ const mp_obj_property_t displayio_display_width_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| height: Any = ... +//| height: int = ... //| """Gets the height of the board""" //| //| @@ -372,7 +372,7 @@ const mp_obj_property_t displayio_display_height_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| rotation: Any = ... +//| rotation: Optional[int] = ... //| """The rotation of the display as an int in degrees.""" //| STATIC mp_obj_t displayio_display_obj_get_rotation(mp_obj_t self_in) { @@ -395,7 +395,7 @@ const mp_obj_property_t displayio_display_rotation_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| bus: Any = ... +//| bus: displayio = ... //| """The bus being used by the display""" //| //| @@ -413,7 +413,7 @@ const mp_obj_property_t displayio_display_bus_obj = { }; -//| def fill_row(self, y: int, buffer: bytearray) -> Any: +//| def fill_row(self, y: int, buffer: WriteableBuffer) -> bytearray: //| """Extract the pixels from a single row //| //| :param int y: The top edge of the area diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index 1bae0532a1..e5768572ea 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -49,7 +49,7 @@ //| Most people should not use this class directly. Use a specific display driver instead that will //| contain the startup and shutdown sequences at minimum.""" //| -//| def __init__(self, display_bus: Any, start_sequence: buffer, stop_sequence: buffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: int = None, set_row_window_command: int = None, single_byte_bounds: Any = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: int = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: microcontroller.Pin = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False): +//| def __init__(self, display_bus: displayio, start_sequence: buffer, stop_sequence: buffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: int = None, set_row_window_command: int = None, single_byte_bounds: bool = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: int = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: microcontroller.Pin = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False): //| """Create a EPaperDisplay object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). //| //| The ``start_sequence`` and ``stop_sequence`` are bitpacked to minimize the ram impact. Every @@ -168,7 +168,7 @@ static displayio_epaperdisplay_obj_t* native_display(mp_obj_t display_obj) { return MP_OBJ_TO_PTR(native_display); } -//| def show(self, group: Group) -> Any: +//| def show(self, group: Group) -> None: //| """Switches to displaying the given group of layers. When group is None, the default //| CircuitPython terminal will be shown. //| @@ -190,7 +190,7 @@ STATIC mp_obj_t displayio_epaperdisplay_obj_show(mp_obj_t self_in, mp_obj_t grou } MP_DEFINE_CONST_FUN_OBJ_2(displayio_epaperdisplay_show_obj, displayio_epaperdisplay_obj_show); -//| def refresh(self) -> Any: +//| def refresh(self) -> None: //| """Refreshes the display immediately or raises an exception if too soon. Use //| ``time.sleep(display.time_to_refresh)`` to sleep until a refresh can occur.""" //| ... @@ -205,7 +205,7 @@ STATIC mp_obj_t displayio_epaperdisplay_obj_refresh(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_refresh_obj, displayio_epaperdisplay_obj_refresh); -//| time_to_refresh: Any = ... +//| time_to_refresh: float = ... //| """Time, in fractional seconds, until the ePaper display can be refreshed.""" //| STATIC mp_obj_t displayio_epaperdisplay_obj_get_time_to_refresh(mp_obj_t self_in) { @@ -221,7 +221,7 @@ const mp_obj_property_t displayio_epaperdisplay_time_to_refresh_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| width: Any = ... +//| width: int = ... //| """Gets the width of the display in pixels""" //| STATIC mp_obj_t displayio_epaperdisplay_obj_get_width(mp_obj_t self_in) { @@ -237,7 +237,7 @@ const mp_obj_property_t displayio_epaperdisplay_width_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| height: Any = ... +//| height: int = ... //| """Gets the height of the display in pixels""" //| STATIC mp_obj_t displayio_epaperdisplay_obj_get_height(mp_obj_t self_in) { @@ -253,7 +253,7 @@ const mp_obj_property_t displayio_epaperdisplay_height_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| bus: Any = ... +//| bus: displayio = ... //| """The bus being used by the display""" //| STATIC mp_obj_t displayio_epaperdisplay_obj_get_bus(mp_obj_t self_in) { diff --git a/shared-bindings/displayio/FourWire.c b/shared-bindings/displayio/FourWire.c index ad8656c0ee..7e53249244 100644 --- a/shared-bindings/displayio/FourWire.c +++ b/shared-bindings/displayio/FourWire.c @@ -96,7 +96,7 @@ STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_ return self; } -//| def reset(self) -> Any: +//| def reset(self) -> None: //| """Performs a hardware reset via the reset pin. Raises an exception if called when no reset pin //| is available.""" //| ... @@ -111,7 +111,7 @@ STATIC mp_obj_t displayio_fourwire_obj_reset(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_fourwire_reset_obj, displayio_fourwire_obj_reset); -//| def send(self, command: Any, data: Any, *, toggle_every_byte: Any = False) -> Any: +//| def send(self, command: int, data: FourWire, *, toggle_every_byte: bool = False) -> None: //| """Sends the given command value followed by the full set of data. Display state, such as //| vertical scroll, set via ``send`` may or may not be reset once the code is done.""" //| ... diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index 9eb641f639..d81bf5fdb0 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -86,7 +86,7 @@ displayio_group_t* native_group(mp_obj_t group_obj) { return MP_OBJ_TO_PTR(native_group); } -//| hidden: Any = ... +//| hidden: Optional[bool] = ... //| """True when the Group and all of it's layers are not visible. When False, the Group's layers //| are visible if they haven't been hidden.""" //| @@ -111,7 +111,7 @@ const mp_obj_property_t displayio_group_hidden_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| scale: Any = ... +//| scale: Optional[int] = ... //| """Scales each pixel within the Group in both directions. For example, when scale=2 each pixel //| will be represented by 2x2 pixels.""" //| @@ -140,7 +140,7 @@ const mp_obj_property_t displayio_group_scale_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| x: Any = ... +//| x: Optional[int] = ... //| """X position of the Group in the parent.""" //| STATIC mp_obj_t displayio_group_obj_get_x(mp_obj_t self_in) { @@ -165,7 +165,7 @@ const mp_obj_property_t displayio_group_x_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| y: Any = ... +//| y: Optional[int] = ... //| """Y position of the Group in the parent.""" //| STATIC mp_obj_t displayio_group_obj_get_y(mp_obj_t self_in) { @@ -190,7 +190,7 @@ const mp_obj_property_t displayio_group_y_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def append(self, layer: Any) -> Any: +//| def append(self, layer: layer) -> None: //| """Append a layer to the group. It will be drawn above other layers.""" //| ... //| @@ -201,7 +201,7 @@ STATIC mp_obj_t displayio_group_obj_append(mp_obj_t self_in, mp_obj_t layer) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_append_obj, displayio_group_obj_append); -//| def insert(self, index: Any, layer: Any) -> Any: +//| def insert(self, index: int, layer: layer) -> None: //| """Insert a layer into the group.""" //| ... //| @@ -214,7 +214,7 @@ STATIC mp_obj_t displayio_group_obj_insert(mp_obj_t self_in, mp_obj_t index_obj, MP_DEFINE_CONST_FUN_OBJ_3(displayio_group_insert_obj, displayio_group_obj_insert); -//| def index(self, layer: Any) -> Any: +//| def index(self, layer: layer) -> int: //| """Returns the index of the first copy of layer. Raises ValueError if not found.""" //| ... //| @@ -228,7 +228,7 @@ STATIC mp_obj_t displayio_group_obj_index(mp_obj_t self_in, mp_obj_t layer) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_index_obj, displayio_group_obj_index); -//| def pop(self, i: Any = -1) -> Any: +//| def pop(self, i: int = -1) -> group: //| """Remove the ith item and return it.""" //| ... //| @@ -251,7 +251,7 @@ STATIC mp_obj_t displayio_group_obj_pop(size_t n_args, const mp_obj_t *pos_args, MP_DEFINE_CONST_FUN_OBJ_KW(displayio_group_pop_obj, 1, displayio_group_obj_pop); -//| def remove(self, layer: Any) -> Any: +//| def remove(self, layer: layer) -> None: //| """Remove the first copy of layer. Raises ValueError if it is not present.""" //| ... //| @@ -264,7 +264,7 @@ STATIC mp_obj_t displayio_group_obj_remove(mp_obj_t self_in, mp_obj_t layer) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_remove_obj, displayio_group_obj_remove); -//| def __len__(self) -> Any: +//| def __len__(self) -> Union[bool, int, None]: //| """Returns the number of layers in a Group""" //| ... //| @@ -278,7 +278,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -//| def __getitem__(self, index: Any) -> Any: +//| def __getitem__(self, index: int) -> group: //| """Returns the value at the given index. //| //| This allows you to:: @@ -286,7 +286,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { //| print(group[0])""" //| ... //| -//| def __setitem__(self, index: Any, value: Any) -> Any: +//| def __setitem__(self, index: int, value: group) -> None: //| """Sets the value at the given index. //| //| This allows you to:: @@ -294,7 +294,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { //| group[0] = sprite""" //| ... //| -//| def __delitem__(self, index: Any) -> Any: +//| def __delitem__(self, index: int) -> group: //| """Deletes the value at the given index. //| //| This allows you to:: diff --git a/shared-bindings/displayio/I2CDisplay.c b/shared-bindings/displayio/I2CDisplay.c index a97c295212..7bca2c36b2 100644 --- a/shared-bindings/displayio/I2CDisplay.c +++ b/shared-bindings/displayio/I2CDisplay.c @@ -76,7 +76,7 @@ STATIC mp_obj_t displayio_i2cdisplay_make_new(const mp_obj_type_t *type, size_t return self; } -//| def reset(self) -> Any: +//| def reset(self) -> None: //| """Performs a hardware reset via the reset pin. Raises an exception if called when no reset pin //| is available.""" //| ... @@ -91,7 +91,7 @@ STATIC mp_obj_t displayio_i2cdisplay_obj_reset(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_i2cdisplay_reset_obj, displayio_i2cdisplay_obj_reset); -//| def send(self, command: Any, data: Any) -> Any: +//| def send(self, command: int, data: displayio) -> None: //| """Sends the given command value followed by the full set of data. Display state, such as //| vertical scroll, set via ``send`` may or may not be reset once the code is done.""" //| ... diff --git a/shared-bindings/displayio/OnDiskBitmap.c b/shared-bindings/displayio/OnDiskBitmap.c index 170873653a..0c6ca761c9 100644 --- a/shared-bindings/displayio/OnDiskBitmap.c +++ b/shared-bindings/displayio/OnDiskBitmap.c @@ -89,7 +89,7 @@ STATIC mp_obj_t displayio_ondiskbitmap_make_new(const mp_obj_type_t *type, size_ return MP_OBJ_FROM_PTR(self); } -//| width: Any = ... +//| width: int = ... //| """Width of the bitmap. (read only)""" //| STATIC mp_obj_t displayio_ondiskbitmap_obj_get_width(mp_obj_t self_in) { @@ -108,7 +108,7 @@ const mp_obj_property_t displayio_ondiskbitmap_width_obj = { }; -//| height: Any = ... +//| height: int = ... //| """Height of the bitmap. (read only)""" //| STATIC mp_obj_t displayio_ondiskbitmap_obj_get_height(mp_obj_t self_in) { diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c index 4823fdae2d..4b7756a11c 100644 --- a/shared-bindings/displayio/Palette.c +++ b/shared-bindings/displayio/Palette.c @@ -70,7 +70,7 @@ STATIC mp_obj_t displayio_palette_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(self); } -//| def __len__(self) -> Any: +//| def __len__(self) -> Union[bool, int, None]: //| """Returns the number of colors in a Palette""" //| ... //| @@ -84,7 +84,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -//| def __setitem__(self, index: Any, value: Any) -> Any: +//| def __setitem__(self, index: int, value: Union[int, ReadableBuffer]) -> Optional[int]: //| r"""Sets the pixel color at the given index. The index should be an integer in the range 0 to color_count-1. //| //| The value argument represents a color, and can be from 0x000000 to 0xFFFFFF (to represent an RGB value). @@ -147,7 +147,7 @@ STATIC mp_obj_t palette_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t val return mp_const_none; } -//| def make_transparent(self, palette_index: Any) -> Any: ... +//| def make_transparent(self, palette_index: int) -> None: ... //| STATIC mp_obj_t displayio_palette_obj_make_transparent(mp_obj_t self_in, mp_obj_t palette_index_obj) { displayio_palette_t *self = MP_OBJ_TO_PTR(self_in); @@ -161,7 +161,7 @@ STATIC mp_obj_t displayio_palette_obj_make_transparent(mp_obj_t self_in, mp_obj_ } MP_DEFINE_CONST_FUN_OBJ_2(displayio_palette_make_transparent_obj, displayio_palette_obj_make_transparent); -//| def make_opaque(self, palette_index: Any) -> Any: ... +//| def make_opaque(self, palette_index: int) -> None: ... //| STATIC mp_obj_t displayio_palette_obj_make_opaque(mp_obj_t self_in, mp_obj_t palette_index_obj) { displayio_palette_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/displayio/ParallelBus.c b/shared-bindings/displayio/ParallelBus.c index 0fff2e5276..e3897a420e 100644 --- a/shared-bindings/displayio/ParallelBus.c +++ b/shared-bindings/displayio/ParallelBus.c @@ -86,7 +86,7 @@ STATIC mp_obj_t displayio_parallelbus_make_new(const mp_obj_type_t *type, size_t return self; } -//| def reset(self) -> Any: +//| def reset(self) -> None: //| """Performs a hardware reset via the reset pin. Raises an exception if called when no reset pin //| is available.""" //| ... @@ -102,7 +102,7 @@ STATIC mp_obj_t displayio_parallelbus_obj_reset(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_parallelbus_reset_obj, displayio_parallelbus_obj_reset); -//| def send(self, command: Any, data: Any) -> Any: +//| def send(self, command: int, data: displayio) -> None: //| """Sends the given command value followed by the full set of data. Display state, such as //| vertical scroll, set via ``send`` may or may not be reset once the code is done.""" //| ... diff --git a/shared-bindings/displayio/Shape.c b/shared-bindings/displayio/Shape.c index fce89c7716..258ac49021 100644 --- a/shared-bindings/displayio/Shape.c +++ b/shared-bindings/displayio/Shape.c @@ -79,7 +79,7 @@ STATIC mp_obj_t displayio_shape_make_new(const mp_obj_type_t *type, size_t n_arg } -//| def set_boundary(self, y: Any, start_x: Any, end_x: Any) -> Any: +//| def set_boundary(self, y: int, start_x: int, end_x: int) -> None: //| """Loads pre-packed data into the given row.""" //| ... //| diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c index 01fba46a58..9f17f4116b 100644 --- a/shared-bindings/displayio/TileGrid.c +++ b/shared-bindings/displayio/TileGrid.c @@ -141,7 +141,7 @@ static displayio_tilegrid_t* native_tilegrid(mp_obj_t tilegrid_obj) { mp_obj_assert_native_inited(native_tilegrid); return MP_OBJ_TO_PTR(native_tilegrid); } -//| hidden: Any = ... +//| hidden: Optional[bool] = ... //| """True when the TileGrid is hidden. This may be False even when a part of a hidden Group.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_hidden(mp_obj_t self_in) { @@ -165,7 +165,7 @@ const mp_obj_property_t displayio_tilegrid_hidden_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| x: Any = ... +//| x: Optional[int] = ... //| """X position of the left edge in the parent.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_x(mp_obj_t self_in) { @@ -190,7 +190,7 @@ const mp_obj_property_t displayio_tilegrid_x_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| y: Any = ... +//| y: Optional[int] = ... //| """Y position of the top edge in the parent.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_y(mp_obj_t self_in) { @@ -215,7 +215,7 @@ const mp_obj_property_t displayio_tilegrid_y_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| flip_x: Any = ... +//| flip_x: Optional[bool] = ... //| """If true, the left edge rendered will be the right edge of the right-most tile.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_flip_x(mp_obj_t self_in) { @@ -239,7 +239,7 @@ const mp_obj_property_t displayio_tilegrid_flip_x_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| flip_y: Any = ... +//| flip_y: Optional[bool] = ... //| """If true, the top edge rendered will be the bottom edge of the bottom-most tile.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_flip_y(mp_obj_t self_in) { @@ -264,7 +264,7 @@ const mp_obj_property_t displayio_tilegrid_flip_y_obj = { }; -//| transpose_xy: Any = ... +//| transpose_xy: Optional[bool] = ... //| """If true, the TileGrid's axis will be swapped. When combined with mirroring, any 90 degree //| rotation can be achieved along with the corresponding mirrored version.""" //| @@ -289,7 +289,7 @@ const mp_obj_property_t displayio_tilegrid_transpose_xy_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| pixel_shader: Any = ... +//| pixel_shader: pixel_shader = ... //| """The pixel shader of the tilegrid.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_pixel_shader(mp_obj_t self_in) { @@ -317,7 +317,7 @@ const mp_obj_property_t displayio_tilegrid_pixel_shader_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def __getitem__(self, index: Any) -> Any: +//| def __getitem__(self, index: Union[Tuple[int, int], int]) -> int: //| """Returns the tile index at the given index. The index can either be an x,y tuple or an int equal //| to ``y * width + x``. //| @@ -326,7 +326,7 @@ const mp_obj_property_t displayio_tilegrid_pixel_shader_obj = { //| print(grid[0])""" //| ... //| -//| def __setitem__(self, index: Any, tile_index: Any) -> Any: +//| def __setitem__(self, index: Union[Tuple[int, int], int], tile_index: int) -> None: //| """Sets the tile index at the given index. The index can either be an x,y tuple or an int equal //| to ``y * width + x``. //| From 48ea2271b78e6bce8b59b5280ccfb81212070e79 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 10:08:25 -0400 Subject: [PATCH 0190/1293] Added type hints to fontio --- shared-bindings/fontio/BuiltinFont.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/fontio/BuiltinFont.c b/shared-bindings/fontio/BuiltinFont.c index 169937553a..cc4d50fe24 100644 --- a/shared-bindings/fontio/BuiltinFont.c +++ b/shared-bindings/fontio/BuiltinFont.c @@ -46,7 +46,7 @@ //| ... //| -//| bitmap: Any = ... +//| bitmap: bitmap = ... //| """Bitmap containing all font glyphs starting with ASCII and followed by unicode. Use //| `get_glyph` in most cases. This is useful for use with `displayio.TileGrid` and //| `terminalio.Terminal`.""" @@ -64,7 +64,7 @@ const mp_obj_property_t fontio_builtinfont_bitmap_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def get_bounding_box(self) -> Any: +//| def get_bounding_box(self) -> Tuple[int, int]: //| """Returns the maximum bounds of all glyphs in the font in a tuple of two values: width, height.""" //| ... //| @@ -76,7 +76,7 @@ STATIC mp_obj_t fontio_builtinfont_obj_get_bounding_box(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(fontio_builtinfont_get_bounding_box_obj, fontio_builtinfont_obj_get_bounding_box); -//| def get_glyph(self, codepoint: Any) -> Any: +//| def get_glyph(self, codepoint: int) -> fontio.Glyph: //| """Returns a `fontio.Glyph` for the given codepoint or None if no glyph is available.""" //| ... //| From ca0e8ea1ebedd631756c02b8bff4c2e0de227576 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 10:12:04 -0400 Subject: [PATCH 0191/1293] Added type hints to framebufferio --- .../framebufferio/FramebufferDisplay.c | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index 51ef090599..4bbdf888d9 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -47,7 +47,7 @@ //| objects in CircuitPython, Display objects live until `displayio.release_displays()` //| is called. This is done so that CircuitPython can use the display itself.""" //| -//| def __init__(self, framebuffer: Any, *, rotation: int = 0, auto_refresh: bool = True): +//| def __init__(self, framebuffer: framebuffer, *, rotation: int = 0, auto_refresh: bool = True): //| """Create a Display object with the given framebuffer (a buffer, array, ulab.array, etc) //| //| :param framebuffer: The framebuffer that the display is connected to @@ -94,7 +94,7 @@ static framebufferio_framebufferdisplay_obj_t* native_display(mp_obj_t display_o return MP_OBJ_TO_PTR(native_display); } -//| def show(self, group: Group) -> Any: +//| def show(self, group: Group) -> None: //| """Switches to displaying the given group of layers. When group is None, the default //| CircuitPython terminal will be shown. //| @@ -116,7 +116,7 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_obj_show(mp_obj_t self_in, mp_o } MP_DEFINE_CONST_FUN_OBJ_2(framebufferio_framebufferdisplay_show_obj, framebufferio_framebufferdisplay_obj_show); -//| def refresh(self, *, target_frames_per_second: int = 60, minimum_frames_per_second: int = 1) -> Any: +//| def refresh(self, *, target_frames_per_second: int = 60, minimum_frames_per_second: int = 1) -> bool: //| """When auto refresh is off, waits for the target frame rate and then refreshes the display, //| returning True. If the call has taken too long since the last refresh call for the given //| target frame rate, then the refresh returns False immediately without updating the screen to @@ -151,7 +151,7 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_obj_refresh(size_t n_args, cons } MP_DEFINE_CONST_FUN_OBJ_KW(framebufferio_framebufferdisplay_refresh_obj, 1, framebufferio_framebufferdisplay_obj_refresh); -//| auto_refresh: Any = ... +//| auto_refresh: Optional[bool] = ... //| """True when the display is refreshed automatically.""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_auto_refresh(mp_obj_t self_in) { @@ -176,7 +176,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_auto_refresh_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| brightness: Any = ... +//| brightness: Optional[float] = ... //| """The brightness of the display as a float. 0.0 is off and 1.0 is full brightness. When //| `auto_brightness` is True, the value of `brightness` will change automatically. //| If `brightness` is set, `auto_brightness` will be disabled and will be set to False.""" @@ -213,7 +213,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_brightness_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| auto_brightness: Any = ... +//| auto_brightness: Optional[bool] = ... //| """True when the display brightness is adjusted automatically, based on an ambient //| light sensor or other method. Note that some displays may have this set to True by default, //| but not actually implement automatic brightness adjustment. `auto_brightness` is set to False @@ -244,7 +244,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_auto_brightness_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| width: Any = ... +//| width: int = ... //| """Gets the width of the framebuffer""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_width(mp_obj_t self_in) { @@ -260,7 +260,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_width_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| height: Any = ... +//| height: int = ... //| """Gets the height of the framebuffer""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_height(mp_obj_t self_in) { @@ -276,7 +276,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_height_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| rotation: Any = ... +//| rotation: Optional[int] = ... //| """The rotation of the display as an int in degrees.""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_rotation(mp_obj_t self_in) { @@ -299,7 +299,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_rotation_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| framebuffer: Any = ... +//| framebuffer: framebuffer = ... //| """The framebuffer being used by the display""" //| //| @@ -317,7 +317,7 @@ const mp_obj_property_t framebufferio_framebufferframebuffer_obj = { }; -//| def fill_row(self, y: int, buffer: bytearray) -> Any: +//| def fill_row(self, y: int, buffer: ReadableBuffer) -> displayio: //| """Extract the pixels from a single row //| //| :param int y: The top edge of the area From 51841447be983480357bfadd9a41d0c5efc33917 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 10:14:40 -0400 Subject: [PATCH 0192/1293] Added type hints to frequencyio --- shared-bindings/frequencyio/FrequencyIn.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/shared-bindings/frequencyio/FrequencyIn.c b/shared-bindings/frequencyio/FrequencyIn.c index cadcf7a26e..b8b8a0f2db 100644 --- a/shared-bindings/frequencyio/FrequencyIn.c +++ b/shared-bindings/frequencyio/FrequencyIn.c @@ -94,7 +94,7 @@ STATIC mp_obj_t frequencyio_frequencyin_make_new(const mp_obj_type_t *type, size return MP_OBJ_FROM_PTR(self); } -//| def deinit(self) -> Any: +//| def deinit(self) -> None: //| """Deinitialises the FrequencyIn and releases any hardware resources for reuse.""" //| ... //| @@ -111,13 +111,13 @@ STATIC void check_for_deinit(frequencyio_frequencyin_obj_t *self) { } } -//| def __enter__(self) -> Any: +//| def __enter__(self) -> FrequencyIn: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self) -> Any: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -129,7 +129,7 @@ STATIC mp_obj_t frequencyio_frequencyin_obj___exit__(size_t n_args, const mp_obj } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(frequencyio_frequencyin___exit___obj, 4, 4, frequencyio_frequencyin_obj___exit__); -//| def pause(self) -> Any: +//| def pause(self) -> None: //| """Pause frequency capture.""" //| ... //| @@ -142,7 +142,7 @@ STATIC mp_obj_t frequencyio_frequencyin_obj_pause(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(frequencyio_frequencyin_pause_obj, frequencyio_frequencyin_obj_pause); -//| def resume(self) -> Any: +//| def resume(self) -> None: //| """Resumes frequency capture.""" //| ... //| @@ -155,7 +155,7 @@ STATIC mp_obj_t frequencyio_frequencyin_obj_resume(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(frequencyio_frequencyin_resume_obj, frequencyio_frequencyin_obj_resume); -//| def clear(self) -> Any: +//| def clear(self) -> None: //| """Clears the last detected frequency capture value.""" //| ... //| @@ -169,7 +169,7 @@ STATIC mp_obj_t frequencyio_frequencyin_obj_clear(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(frequencyio_frequencyin_clear_obj, frequencyio_frequencyin_obj_clear); -//| capture_period: Any = ... +//| capture_period: Optional[int] = ... //| """The capture measurement period. Lower incoming frequencies will be measured //| more accurately with longer capture periods. Higher frequencies are more //| accurate with shorter capture periods. @@ -201,7 +201,7 @@ const mp_obj_property_t frequencyio_frequencyin_capture_period_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def __get__(self, index: Any) -> Any: +//| def __get__(self, index: int) -> int: //| """Returns the value of the last frequency captured.""" //| ... //| From ff8604bb825dd003625c8e139d66fc90d93a8340 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 10:17:35 -0400 Subject: [PATCH 0193/1293] Added type hints to gamepad --- shared-bindings/gamepad/GamePad.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/gamepad/GamePad.c b/shared-bindings/gamepad/GamePad.c index 5e035762e8..a5da83e3eb 100644 --- a/shared-bindings/gamepad/GamePad.c +++ b/shared-bindings/gamepad/GamePad.c @@ -70,7 +70,7 @@ //| time.sleep(0.1)""" //| -//| def __init__(self, b1: Any, b2: Any, b3: Any, b4: Any, b5: Any, b6: Any, b7: Any, b8: Any): +//| def __init__(self, b1: DigialInOut, b2: DigialInOut, b3: DigialInOut, b4: DigialInOut, b5: DigialInOut, b6: DigialInOut, b7: DigialInOut, b8: DigialInOut): //| """Initializes button scanning routines. //| //| The ``b1``-``b8`` parameters are ``DigitalInOut`` objects, which @@ -114,7 +114,7 @@ STATIC mp_obj_t gamepad_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(gamepad_singleton); } -//| def get_pressed(self) -> Any: +//| def get_pressed(self) -> int: //| """Get the status of buttons pressed since the last call and clear it. //| //| Returns an 8-bit number, with bits that correspond to buttons, @@ -133,7 +133,7 @@ STATIC mp_obj_t gamepad_get_pressed(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(gamepad_get_pressed_obj, gamepad_get_pressed); -//| def deinit(self) -> Any: +//| def deinit(self) -> None: //| """Disable button scanning.""" //| ... //| From d73348f673538f74e896999d395b8fe8c0914a67 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 10:19:34 -0400 Subject: [PATCH 0194/1293] Added type hints to gamepadshift --- shared-bindings/gamepadshift/GamePadShift.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/gamepadshift/GamePadShift.c b/shared-bindings/gamepadshift/GamePadShift.c index 782d9724dc..f01c957046 100644 --- a/shared-bindings/gamepadshift/GamePadShift.c +++ b/shared-bindings/gamepadshift/GamePadShift.c @@ -36,7 +36,7 @@ //| class GamePadShift: //| """Scan buttons for presses through a shift register""" //| -//| def __init__(self, clock: Any, data: Any, latch: Any): +//| def __init__(self, clock: DigitalInOut, data: DigitalInOut, latch: DigitalInOut): //| """Initializes button scanning routines. //| //| The ``clock``, ``data`` and ``latch`` parameters are ``DigitalInOut`` @@ -82,7 +82,7 @@ STATIC mp_obj_t gamepadshift_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(gamepad_singleton); } -//| def get_pressed(self) -> Any: +//| def get_pressed(self) -> int: //| """Get the status of buttons pressed since the last call and clear it. //| //| Returns an 8-bit number, with bits that correspond to buttons, @@ -100,7 +100,7 @@ STATIC mp_obj_t gamepadshift_get_pressed(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(gamepadshift_get_pressed_obj, gamepadshift_get_pressed); -//| def deinit(self) -> Any: +//| def deinit(self) -> None: //| """Disable button scanning.""" //| ... //| From 6a3968d8050cc1f21ba1451dfb3b2e8658b050e2 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 10:26:31 -0400 Subject: [PATCH 0195/1293] Added type hints to gnss --- shared-bindings/gnss/GNSS.c | 14 +++++++------- shared-bindings/gnss/PositionFix.c | 6 +++--- shared-bindings/gnss/SatelliteSystem.c | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c index 59ec038dd1..99f2ba5c84 100644 --- a/shared-bindings/gnss/GNSS.c +++ b/shared-bindings/gnss/GNSS.c @@ -90,7 +90,7 @@ STATIC mp_obj_t gnss_make_new(const mp_obj_type_t *type, size_t n_args, const mp return MP_OBJ_FROM_PTR(self); } -//| def deinit(self) -> Any: +//| def deinit(self) -> None: //| """Turn off the GNSS.""" //| ... //| @@ -107,7 +107,7 @@ STATIC void check_for_deinit(gnss_obj_t *self) { } } -//| def update(self) -> Any: +//| def update(self) -> None: //| """Update GNSS positioning information.""" //| ... //| @@ -120,7 +120,7 @@ STATIC mp_obj_t gnss_obj_update(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(gnss_update_obj, gnss_obj_update); -//| latitude: Any = ... +//| latitude: float = ... //| """Latitude of current position in degrees (float).""" //| STATIC mp_obj_t gnss_obj_get_latitude(mp_obj_t self_in) { @@ -137,7 +137,7 @@ const mp_obj_property_t gnss_latitude_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| longitude: Any = ... +//| longitude: float = ... //| """Longitude of current position in degrees (float).""" //| STATIC mp_obj_t gnss_obj_get_longitude(mp_obj_t self_in) { @@ -154,7 +154,7 @@ const mp_obj_property_t gnss_longitude_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| altitude: Any = ... +//| altitude: float = ... //| """Altitude of current position in meters (float).""" //| STATIC mp_obj_t gnss_obj_get_altitude(mp_obj_t self_in) { @@ -171,7 +171,7 @@ const mp_obj_property_t gnss_altitude_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| timestamp: Any = ... +//| timestamp: string = ... //| """Time when the position data was updated.""" //| STATIC mp_obj_t gnss_obj_get_timestamp(mp_obj_t self_in) { @@ -190,7 +190,7 @@ const mp_obj_property_t gnss_timestamp_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| fix: Any = ... +//| fix: string = ... //| """Fix mode.""" //| STATIC mp_obj_t gnss_obj_get_fix(mp_obj_t self_in) { diff --git a/shared-bindings/gnss/PositionFix.c b/shared-bindings/gnss/PositionFix.c index 016603f049..52c0dd482b 100644 --- a/shared-bindings/gnss/PositionFix.c +++ b/shared-bindings/gnss/PositionFix.c @@ -32,17 +32,17 @@ //| def __init__(self): //| """Enum-like class to define the position fix mode.""" //| -//| INVALID: Any = ... +//| INVALID: gnss.PositionFix = ... //| """No measurement. //| //| :type gnss.PositionFix:""" //| -//| FIX_2D: Any = ... +//| FIX_2D: gnss.PositionFix = ... //| """2D fix. //| //| :type gnss.PositionFix:""" //| -//| FIX_3D: Any = ... +//| FIX_3D: gnss.PositionFix = ... //| """3D fix. //| //| :type gnss.PositionFix:""" diff --git a/shared-bindings/gnss/SatelliteSystem.c b/shared-bindings/gnss/SatelliteSystem.c index 6d3fb4782d..5ee7f0ffbf 100644 --- a/shared-bindings/gnss/SatelliteSystem.c +++ b/shared-bindings/gnss/SatelliteSystem.c @@ -32,27 +32,27 @@ //| def __init__(self): //| """Enum-like class to define the satellite system type.""" //| -//| GPS: Any = ... +//| GPS: gnss.SatelliteSystem = ... //| """Global Positioning System. //| //| :type gnss.SatelliteSystem:""" //| -//| GLONASS: Any = ... +//| GLONASS: gnss.SatelliteSystem = ... //| """GLObal NAvigation Satellite System. //| //| :type gnss.SatelliteSystem:""" //| -//| SBAS: Any = ... +//| SBAS: gnss.SatelliteSystem = ... //| """Satellite Based Augmentation System. //| //| :type gnss.SatelliteSystem:""" //| -//| QZSS_L1CA: Any = ... +//| QZSS_L1CA: gnss.SatelliteSystem = ... //| """Quasi-Zenith Satellite System L1C/A. //| //| :type gnss.SatelliteSystem:""" //| -//| QZSS_L1S: Any = ... +//| QZSS_L1S: gnss.SatelliteSystem = ... //| """Quasi-Zenith Satellite System L1S. //| //| :type gnss.SatelliteSystem:""" From 2e8b8c7b954f176988ed6c244db18efa0a696968 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 10:29:39 -0400 Subject: [PATCH 0196/1293] Added type hints to i2cperipheral --- shared-bindings/i2cperipheral/I2CPeripheral.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/shared-bindings/i2cperipheral/I2CPeripheral.c b/shared-bindings/i2cperipheral/I2CPeripheral.c index 696c3b3883..55094f75ca 100644 --- a/shared-bindings/i2cperipheral/I2CPeripheral.c +++ b/shared-bindings/i2cperipheral/I2CPeripheral.c @@ -102,7 +102,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_make_new(const mp_obj_type_t *type, return (mp_obj_t)self; } -//| def deinit(self) -> Any: +//| def deinit(self) -> None: //| """Releases control of the underlying hardware so other classes can use it.""" //| ... //| @@ -114,13 +114,13 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj_deinit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(i2cperipheral_i2c_peripheral_deinit_obj, i2cperipheral_i2c_peripheral_obj_deinit); -//| def __enter__(self) -> Any: +//| def __enter__(self) -> I2CPeripheral: //| """No-op used in Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self) -> Any: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware on context exit. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -133,7 +133,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj___exit__(size_t n_args, const m } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral___exit___obj, 4, 4, i2cperipheral_i2c_peripheral_obj___exit__); -//| def request(self, timeout: float = -1) -> Any: +//| def request(self, timeout: float = -1) -> i2cperipheral.I2CPeripheralRequest: //| """Wait for an I2C request. //| //| :param float timeout: Timeout in seconds. Zero means wait forever, a negative value means check once @@ -241,13 +241,13 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_make_new(const mp_obj_type_ return mp_obj_new_i2cperipheral_i2c_peripheral_request(args[0], mp_obj_get_int(args[1]), mp_obj_is_true(args[2]), mp_obj_is_true(args[3])); } -//| def __enter__(self) -> Any: +//| def __enter__(self) -> I2CPeripheralRequest: //| """No-op used in Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self) -> Any: +//| def __exit__(self) -> None: //| """Close the request.""" //| ... //| @@ -383,7 +383,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_write(mp_obj_t self_in, mp_ } STATIC MP_DEFINE_CONST_FUN_OBJ_2(i2cperipheral_i2c_peripheral_request_write_obj, i2cperipheral_i2c_peripheral_request_write); -//| def ack(self, ack: bool = True) -> Any: +//| def ack(self, ack: bool = True) -> None: //| """Acknowledge or Not Acknowledge last byte received. //| Use together with :py:meth:`I2CPeripheralRequest.read` ack=False. //| From 0a8d9eed45422936bfa6df58d79ac2b4a855ca90 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 10:33:28 -0400 Subject: [PATCH 0197/1293] Added type hints to microcontroller --- shared-bindings/microcontroller/Processor.c | 6 +++--- shared-bindings/microcontroller/RunMode.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c index c3c60d5cc6..32ec4f2e79 100644 --- a/shared-bindings/microcontroller/Processor.c +++ b/shared-bindings/microcontroller/Processor.c @@ -67,7 +67,7 @@ const mp_obj_property_t mcu_processor_frequency_obj = { }, }; -//| temperature: Any = ... +//| temperature: Optional[float] = ... //| """The on-chip temperature, in Celsius, as a float. (read-only) //| //| Is `None` if the temperature is not available.""" @@ -87,7 +87,7 @@ const mp_obj_property_t mcu_processor_temperature_obj = { }, }; -//| uid: Any = ... +//| uid: bytearray = ... //| """The unique id (aka serial number) of the chip as a `bytearray`. (read-only)""" //| STATIC mp_obj_t mcu_processor_get_uid(mp_obj_t self) { @@ -106,7 +106,7 @@ const mp_obj_property_t mcu_processor_uid_obj = { }, }; -//| voltage: Any = ... +//| voltage: Optional[float] = ... //| """The input voltage to the microcontroller, as a float. (read-only) //| //| Is `None` if the voltage is not available.""" diff --git a/shared-bindings/microcontroller/RunMode.c b/shared-bindings/microcontroller/RunMode.c index d4c10109a5..dce7a52301 100644 --- a/shared-bindings/microcontroller/RunMode.c +++ b/shared-bindings/microcontroller/RunMode.c @@ -33,18 +33,18 @@ //| """Enum-like class to define the run mode of the microcontroller and //| CircuitPython.""" //| -//| NORMAL: Any = ... +//| NORMAL: microcontroller.RunMode = ... //| """Run CircuitPython as normal. //| //| :type microcontroller.RunMode:""" //| -//| SAFE_MODE: Any = ... +//| SAFE_MODE: microcontroller.RunMode = ... //| """Run CircuitPython in safe mode. User code will not be run and the //| file system will be writeable over USB. //| //| :type microcontroller.RunMode:""" //| -//| BOOTLOADER: Any = ... +//| BOOTLOADER: microcontroller.RunMode = ... //| """Run the bootloader. //| //| :type microcontroller.RunMode:""" From 0abf45a4463df9d2e30e1c309d6aee902e56b7ff Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 10:37:55 -0400 Subject: [PATCH 0198/1293] Added type hints to nvm --- shared-bindings/nvm/ByteArray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c index 3b316a33bc..b30582f662 100644 --- a/shared-bindings/nvm/ByteArray.c +++ b/shared-bindings/nvm/ByteArray.c @@ -49,7 +49,7 @@ //| ... //| -//| def __len__(self) -> Any: +//| def __len__(self) -> Union[bool, int, None]: //| """Return the length. This is used by (`len`)""" //| ... //| From e273b9a11faa1c9aba72fc58a87af075da76036d Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 10:42:57 -0400 Subject: [PATCH 0199/1293] Added type hints to _pew --- shared-bindings/_pew/PewPew.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/_pew/PewPew.c b/shared-bindings/_pew/PewPew.c index 352ef38f27..313389ad8a 100644 --- a/shared-bindings/_pew/PewPew.c +++ b/shared-bindings/_pew/PewPew.c @@ -46,7 +46,7 @@ //| that library.""" //| -//| def __init__(self, buffer: Any, rows: Any, cols: Any, buttons: Any): +//| def __init__(self, buffer: ReadableBuffer, rows: List[DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput], cols: List[DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput], buttons: DigitalInputOutput): //| """Initializes matrix scanning routines. //| //| The ``buffer`` is a 64 byte long ``bytearray`` that stores what should From 41f12a7a6c8424257adcd49a549d4258cd9814e4 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 10:47:44 -0400 Subject: [PATCH 0200/1293] Added type hints to pixelbuf --- shared-bindings/_pixelbuf/PixelBuf.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 4c24776c3f..f66b73fdf3 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -152,7 +152,7 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t } } -//| bpp: Any = ... +//| bpp: int = ... //| """The number of bytes per pixel in the buffer (read-only)""" //| STATIC mp_obj_t pixelbuf_pixelbuf_obj_get_bpp(mp_obj_t self_in) { @@ -168,7 +168,7 @@ const mp_obj_property_t pixelbuf_pixelbuf_bpp_obj = { }; -//| brightness: Any = ... +//| brightness: float = ... //| """Float value between 0 and 1. Output brightness. //| //| When brightness is less than 1.0, a second buffer will be used to store the color values @@ -199,7 +199,7 @@ const mp_obj_property_t pixelbuf_pixelbuf_brightness_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| auto_write: Any = ... +//| auto_write: bool = ... //| """Whether to automatically write the pixels after each update.""" //| STATIC mp_obj_t pixelbuf_pixelbuf_obj_get_auto_write(mp_obj_t self_in) { @@ -221,7 +221,7 @@ const mp_obj_property_t pixelbuf_pixelbuf_auto_write_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| byteorder: Any = ... +//| byteorder: string = ... //| """byteorder string for the buffer (read-only)""" //| STATIC mp_obj_t pixelbuf_pixelbuf_obj_get_byteorder(mp_obj_t self_in) { @@ -245,7 +245,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -//| def show(self) -> Any: +//| 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.""" //| ... @@ -257,9 +257,9 @@ 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(color: Any) -> Any: -//| """Fills the given pixelbuf with the given color.""" -//| ... +//| def fill(color: tuple[int, int, int]) -> None: +//| """Fills the given pixelbuf with the given color.""" +//| ... //| STATIC mp_obj_t pixelbuf_pixelbuf_fill(mp_obj_t self_in, mp_obj_t value) { @@ -269,13 +269,13 @@ 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); -//| def __getitem__(self, index: Any) -> Any: +//| def __getitem__(self, index: int) -> Tuple[int, int, int, Union[int, float]]: //| """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.""" //| ... //| -//| def __setitem__(self, index: Any, value: Any) -> Any: +//| def __setitem__(self, index: int, value: Union[int, Tuple[int, int, int, Union[int, float]]]) -> PixelBuf: //| """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). From a2c7e2795b4d9ba5d8592d1fe3e6d8c7422c65af Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 10:51:39 -0400 Subject: [PATCH 0201/1293] Added type hints to ps2io --- shared-bindings/ps2io/Ps2.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c index fd82591d5e..b4a741030e 100644 --- a/shared-bindings/ps2io/Ps2.c +++ b/shared-bindings/ps2io/Ps2.c @@ -87,7 +87,7 @@ STATIC mp_obj_t ps2io_ps2_make_new(const mp_obj_type_t *type, size_t n_args, con return MP_OBJ_FROM_PTR(self); } -//| def deinit(self) -> Any: +//| def deinit(self) -> None: //| """Deinitialises the Ps2 and releases any hardware resources for reuse.""" //| ... //| @@ -104,13 +104,13 @@ STATIC void check_for_deinit(ps2io_ps2_obj_t *self) { } } -//| def __enter__(self) -> Any: +//| def __enter__(self) -> Ps2: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self) -> Any: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -122,7 +122,7 @@ STATIC mp_obj_t ps2io_ps2_obj___exit__(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ps2io_ps2___exit___obj, 4, 4, ps2io_ps2_obj___exit__); -//| def popleft(self) -> Any: +//| def popleft(self) -> byte: //| """Removes and returns the oldest received byte. When buffer //| is empty, raises an IndexError exception.""" //| ... @@ -139,7 +139,7 @@ STATIC mp_obj_t ps2io_ps2_obj_popleft(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(ps2io_ps2_popleft_obj, ps2io_ps2_obj_popleft); -//| def sendcmd(self, byte: int) -> Any: +//| def sendcmd(self, byte: int) -> int: //| """Sends a command byte to PS/2. Returns the response byte, typically //| the general ack value (0xFA). Some commands return additional data //| which is available through :py:func:`popleft()`. @@ -164,7 +164,7 @@ STATIC mp_obj_t ps2io_ps2_obj_sendcmd(mp_obj_t self_in, mp_obj_t ob) { } MP_DEFINE_CONST_FUN_OBJ_2(ps2io_ps2_sendcmd_obj, ps2io_ps2_obj_sendcmd); -//| def clear_errors(self) -> Any: +//| def clear_errors(self) -> int: //| """Returns and clears a bitmap with latest recorded communication errors. //| //| Reception errors (arise asynchronously, as data is received): @@ -202,7 +202,7 @@ STATIC mp_obj_t ps2io_ps2_obj_clear_errors(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(ps2io_ps2_clear_errors_obj, ps2io_ps2_obj_clear_errors); -//| def __len__(self) -> Any: +//| def __len__(self) -> Union[bool, int, None]: //| """Returns the number of received bytes in buffer, available //| to :py:func:`popleft()`.""" //| ... From 93d20077cc56079bbe49a21f4dae13e1abe7632c Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 11:04:03 -0400 Subject: [PATCH 0202/1293] Added type hints to pulseio --- shared-bindings/pulseio/PWMOut.c | 10 +++++----- shared-bindings/pulseio/PulseIn.c | 22 +++++++++++----------- shared-bindings/pulseio/PulseOut.c | 8 ++++---- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/shared-bindings/pulseio/PWMOut.c b/shared-bindings/pulseio/PWMOut.c index 863365987f..4197a5251f 100644 --- a/shared-bindings/pulseio/PWMOut.c +++ b/shared-bindings/pulseio/PWMOut.c @@ -115,7 +115,7 @@ STATIC mp_obj_t pulseio_pwmout_make_new(const mp_obj_type_t *type, size_t n_args return MP_OBJ_FROM_PTR(self); } -//| def deinit(self) -> Any: +//| def deinit(self) -> None: //| """Deinitialises the PWMOut and releases any hardware resources for reuse.""" //| ... //| @@ -132,13 +132,13 @@ STATIC void check_for_deinit(pulseio_pwmout_obj_t *self) { } } -//| def __enter__(self) -> Any: +//| def __enter__(self) -> PWMOut: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self) -> Any: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -150,7 +150,7 @@ STATIC mp_obj_t pulseio_pwmout_obj___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pulseio_pwmout___exit___obj, 4, 4, pulseio_pwmout_obj___exit__); -//| duty_cycle: Any = ... +//| duty_cycle: Optional[int] = ... //| """16 bit value that dictates how much of one cycle is high (1) versus low //| (0). 0xffff will always be high, 0 will always be low and 0x7fff will //| be half high and then half low. @@ -186,7 +186,7 @@ const mp_obj_property_t pulseio_pwmout_duty_cycle_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| frequency: Any = ... +//| frequency: Optional[int] = ... //| """32 bit value that dictates the PWM frequency in Hertz (cycles per //| second). Only writeable when constructed with ``variable_frequency=True``. //| diff --git a/shared-bindings/pulseio/PulseIn.c b/shared-bindings/pulseio/PulseIn.c index e187697077..d83306eab0 100644 --- a/shared-bindings/pulseio/PulseIn.c +++ b/shared-bindings/pulseio/PulseIn.c @@ -96,7 +96,7 @@ STATIC mp_obj_t pulseio_pulsein_make_new(const mp_obj_type_t *type, size_t n_arg return MP_OBJ_FROM_PTR(self); } -//| def deinit(self) -> Any: +//| def deinit(self) -> None: //| """Deinitialises the PulseIn and releases any hardware resources for reuse.""" //| ... //| @@ -113,13 +113,13 @@ STATIC void check_for_deinit(pulseio_pulsein_obj_t *self) { } } -//| def __enter__(self) -> Any: +//| def __enter__(self) -> PulseIn: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self) -> Any: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -131,7 +131,7 @@ STATIC mp_obj_t pulseio_pulsein_obj___exit__(size_t n_args, const mp_obj_t *args } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pulseio_pulsein___exit___obj, 4, 4, pulseio_pulsein_obj___exit__); -//| def pause(self) -> Any: +//| def pause(self) -> None: //| """Pause pulse capture""" //| ... //| @@ -144,7 +144,7 @@ STATIC mp_obj_t pulseio_pulsein_obj_pause(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(pulseio_pulsein_pause_obj, pulseio_pulsein_obj_pause); -//| def resume(self, trigger_duration: int = 0) -> Any: +//| def resume(self, trigger_duration: int = 0) -> None: //| """Resumes pulse capture after an optional trigger pulse. //| //| .. warning:: Using trigger pulse with a device that drives both high and @@ -171,7 +171,7 @@ STATIC mp_obj_t pulseio_pulsein_obj_resume(size_t n_args, const mp_obj_t *pos_ar } MP_DEFINE_CONST_FUN_OBJ_KW(pulseio_pulsein_resume_obj, 1, pulseio_pulsein_obj_resume); -//| def clear(self) -> Any: +//| def clear(self) -> None: //| """Clears all captured pulses""" //| ... //| @@ -184,7 +184,7 @@ STATIC mp_obj_t pulseio_pulsein_obj_clear(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(pulseio_pulsein_clear_obj, pulseio_pulsein_obj_clear); -//| def popleft(self) -> Any: +//| def popleft(self) -> int: //| """Removes and returns the oldest read pulse.""" //| ... //| @@ -196,7 +196,7 @@ STATIC mp_obj_t pulseio_pulsein_obj_popleft(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(pulseio_pulsein_popleft_obj, pulseio_pulsein_obj_popleft); -//| maxlen: Any = ... +//| maxlen: int = ... //| """The maximum length of the PulseIn. When len() is equal to maxlen, //| it is unclear which pulses are active and which are idle.""" //| @@ -215,7 +215,7 @@ const mp_obj_property_t pulseio_pulsein_maxlen_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| paused: Any = ... +//| paused: bool = ... //| """True when pulse capture is paused as a result of :py:func:`pause` or an error during capture //| such as a signal that is too fast.""" //| @@ -234,7 +234,7 @@ const mp_obj_property_t pulseio_pulsein_paused_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def __len__(self) -> Any: +//| def __len__(self) -> Union[bool, int, None]: //| """Returns the current pulse length //| //| This allows you to:: @@ -254,7 +254,7 @@ STATIC mp_obj_t pulsein_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -//| def __getitem__(self, index: Any) -> Any: +//| def __getitem__(self, index: int) -> Optional[int]: //| """Returns the value at the given index or values in slice. //| //| This allows you to:: diff --git a/shared-bindings/pulseio/PulseOut.c b/shared-bindings/pulseio/PulseOut.c index bfb3576a8d..dfed6d3049 100644 --- a/shared-bindings/pulseio/PulseOut.c +++ b/shared-bindings/pulseio/PulseOut.c @@ -81,7 +81,7 @@ STATIC mp_obj_t pulseio_pulseout_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| def deinit(self) -> Any: +//| def deinit(self) -> None: //| """Deinitialises the PulseOut and releases any hardware resources for reuse.""" //| ... //| @@ -92,13 +92,13 @@ STATIC mp_obj_t pulseio_pulseout_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(pulseio_pulseout_deinit_obj, pulseio_pulseout_deinit); -//| def __enter__(self) -> Any: +//| def __enter__(self) -> PulseOut: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self) -> Any: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -110,7 +110,7 @@ STATIC mp_obj_t pulseio_pulseout_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pulseio_pulseout___exit___obj, 4, 4, pulseio_pulseout_obj___exit__); -//| def send(self, pulses: array.array) -> Any: +//| def send(self, pulses: array.array) -> None: //| """Pulse alternating on and off durations in microseconds starting with on. //| ``pulses`` must be an `array.array` with data type 'H' for unsigned //| halfword (two bytes). From c8437e6595bf23c74ba779c32c7177538e21a52b Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 11:10:13 -0400 Subject: [PATCH 0203/1293] Added type hints to rgbmatrix --- shared-bindings/rgbmatrix/RGBMatrix.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index 1bbd169654..decf94f679 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -128,7 +128,7 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_ } } -//| def __init__(self, *, width: Any, bit_depth: Any, rgb_pins: Any, addr_pins: Any, clock_pin: Any, latch_pin: Any, output_enable_pin: Any, doublebuffer: Any = True, framebuffer: Any = None, height: Any = 0): +//| def __init__(self, *, width: int, bit_depth: List[digitalio.DigitalInOut], rgb_pins: List[digitalio.DigitalInOut], addr_pins: List[digitalio.DigitalInOut], clock_pin: digitalio.DigitalInOut, latch_pin: digitalio.DigitalInOut, output_enable_pin: digitalio.DigitalInOut, doublebuffer: bool = True, framebuffer: WriteableBuffer = None, height: int = 0): //| """Create a RGBMatrix object with the given attributes. The height of //| the display is determined by the number of rgb and address pins: //| len(rgb_pins) // 3 * 2 ** len(address_pins). With 6 RGB pins and 4 @@ -237,7 +237,7 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n return MP_OBJ_FROM_PTR(self); } -//| def deinit(self) -> Any: +//| def deinit(self) -> None: //| """Free the resources (pins, timers, etc.) associated with this //| rgbmatrix instance. After deinitialization, no further operations //| may be performed.""" @@ -257,7 +257,7 @@ static void check_for_deinit(rgbmatrix_rgbmatrix_obj_t *self) { } } -//| brightness: Any = ... +//| brightness: Optional[float] = ... //| """In the current implementation, 0.0 turns the display off entirely //| and any other value up to 1.0 turns the display on fully.""" //| @@ -288,9 +288,10 @@ const mp_obj_property_t rgbmatrix_rgbmatrix_brightness_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def refresh(self) -> Any: ... -//| """Transmits the color data in the buffer to the pixels so that -//| they are shown.""" +//| def refresh(self) -> None: +//| """Transmits the color data in the buffer to the pixels so that +//| they are shown.""" +//| ... //| STATIC mp_obj_t rgbmatrix_rgbmatrix_refresh(mp_obj_t self_in) { rgbmatrix_rgbmatrix_obj_t *self = (rgbmatrix_rgbmatrix_obj_t*)self_in; From d9a98bd05c90ebe4746e8a646e28d26030864c94 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 11:13:16 -0400 Subject: [PATCH 0204/1293] Added type hints to rotaryio --- shared-bindings/rotaryio/IncrementalEncoder.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c index 418de664ee..26a50dde9f 100644 --- a/shared-bindings/rotaryio/IncrementalEncoder.c +++ b/shared-bindings/rotaryio/IncrementalEncoder.c @@ -80,7 +80,7 @@ STATIC mp_obj_t rotaryio_incrementalencoder_make_new(const mp_obj_type_t *type, return MP_OBJ_FROM_PTR(self); } -//| def deinit(self) -> Any: +//| def deinit(self) -> None: //| """Deinitializes the IncrementalEncoder and releases any hardware resources for reuse.""" //| ... //| @@ -97,13 +97,13 @@ STATIC void check_for_deinit(rotaryio_incrementalencoder_obj_t *self) { } } -//| def __enter__(self) -> Any: +//| def __enter__(self) -> IncrementalEncoder: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self) -> Any: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -116,7 +116,7 @@ STATIC mp_obj_t rotaryio_incrementalencoder_obj___exit__(size_t n_args, const mp STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(rotaryio_incrementalencoder___exit___obj, 4, 4, rotaryio_incrementalencoder_obj___exit__); -//| position: Any = ... +//| position: Optional[int] = ... //| """The current position in terms of pulses. The number of pulses per rotation is defined by the //| specific hardware.""" //| From 48443ce02bfb6aff91b5d5da203976822bfb2556 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 11:15:22 -0400 Subject: [PATCH 0205/1293] Added type hints to sdcardio --- shared-bindings/sdcardio/SDCard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/sdcardio/SDCard.c b/shared-bindings/sdcardio/SDCard.c index 1d8c4bafbe..6b32bb1c11 100644 --- a/shared-bindings/sdcardio/SDCard.c +++ b/shared-bindings/sdcardio/SDCard.c @@ -44,7 +44,7 @@ //| `busio.SPI`, not `bitbangio.SPI`. Usually an SDCard object is used //| with ``storage.VfsFat`` to allow file I/O to an SD card.""" //| -//| def __init__(bus:busio.SPI, cs=digitalio.DigitalInOut, baudrate=8000000): +//| def __init__(bus:busio.SPI, cs: digitalio.DigitalInOut=digitalio.DigitalInOut, baudrate: int=8000000): //| """Construct an SPI SD Card object with the given properties //| //| :param busio.SPI spi: The SPI bus From 71ec419da6a0ee36545bb1911b9c8c9435a77108 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 11:16:41 -0400 Subject: [PATCH 0206/1293] Added type hints to sdioio --- shared-bindings/sdioio/SDCard.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/sdioio/SDCard.c b/shared-bindings/sdioio/SDCard.c index 2feb7d8030..8890c1f3cc 100644 --- a/shared-bindings/sdioio/SDCard.c +++ b/shared-bindings/sdioio/SDCard.c @@ -109,7 +109,7 @@ STATIC void check_for_deinit(sdioio_sdcard_obj_t *self) { } } -//| def configure(*, frequency=0, width=0) -> None: +//| def configure(*, frequency: int=0, width: int=0) -> None: //| """Configures the SDIO bus. //| //| :param int frequency: the desired clock rate in Hertz. The actual clock rate may be higher or lower due to the granularity of available clock settings. Check the `frequency` attribute for the actual clock rate. @@ -255,13 +255,13 @@ STATIC mp_obj_t sdioio_sdcard_obj_deinit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_deinit_obj, sdioio_sdcard_obj_deinit); -//| def __enter__(self) -> Any: +//| def __enter__(self) -> SDCard: //| """No-op used by Context Managers. //| Provided by context manager helper.""" //| ... //| -//| def __exit__(self) -> Any: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... From 9116470fd7f51e133af95fb7c759dbd89e420229 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 11:24:53 -0400 Subject: [PATCH 0207/1293] Added type hints to socket --- shared-bindings/socket/__init__.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c index 643a57b1bb..10a56ef407 100644 --- a/shared-bindings/socket/__init__.c +++ b/shared-bindings/socket/__init__.c @@ -93,7 +93,7 @@ STATIC void socket_select_nic(mod_network_socket_obj_t *self, const byte *ip) { } } -//| def bind(self, address: tuple) -> Any: +//| def bind(self, address: tuple) -> None: //| """Bind a socket to an address //| //| :param ~tuple address: tuple of (remote_address, remote_port)""" @@ -120,7 +120,7 @@ STATIC mp_obj_t socket_bind(mp_obj_t self_in, mp_obj_t addr_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_bind_obj, socket_bind); -//| def listen(self, backlog: int) -> Any: +//| def listen(self, backlog: int) -> None: //| """Set socket to listen for incoming connections //| //| :param ~int backlog: length of backlog queue for waiting connetions""" @@ -145,7 +145,7 @@ STATIC mp_obj_t socket_listen(mp_obj_t self_in, mp_obj_t backlog) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_listen_obj, socket_listen); -//| def accept(self) -> Any: +//| def accept(self) -> tuple: //| """Accept a connection on a listening socket of type SOCK_STREAM, //| creating a new socket of type SOCK_STREAM. //| Returns a tuple of (new_socket, remote_address)""" @@ -182,7 +182,7 @@ STATIC mp_obj_t socket_accept(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(socket_accept_obj, socket_accept); -//| def connect(self, address: tuple) -> Any: +//| def connect(self, address: tuple) -> None: //| """Connect a socket to a remote address //| //| :param ~tuple address: tuple of (remote_address, remote_port)""" @@ -209,7 +209,7 @@ STATIC mp_obj_t socket_connect(mp_obj_t self_in, mp_obj_t addr_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_connect_obj, socket_connect); -//| def send(self, bytes: bytes) -> Any: +//| def send(self, bytes: bytes) -> int: //| """Send some bytes to the connected remote address. //| Suits sockets of type SOCK_STREAM //| @@ -246,7 +246,7 @@ STATIC mp_int_t _socket_recv_into(mod_network_socket_obj_t *sock, byte *buf, mp_ } -//| def recv_into(self, buffer: bytearray, bufsize: int) -> Any: +//| def recv_into(self, buffer: WriteableBuffer, bufsize: int) -> int: //| """Reads some bytes from the connected remote address, writing //| into the provided buffer. If bufsize <= len(buffer) is given, //| a maximum of bufsize bytes will be read into the buffer. If no @@ -282,7 +282,7 @@ STATIC mp_obj_t socket_recv_into(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_recv_into_obj, 2, 3, socket_recv_into); -//| def recv(self, bufsize: int) -> Any: +//| def recv(self, bufsize: int) -> bytes: //| """Reads some bytes from the connected remote address. //| Suits sockets of type SOCK_STREAM //| Returns a bytes() of length <= bufsize @@ -309,7 +309,7 @@ STATIC mp_obj_t socket_recv(mp_obj_t self_in, mp_obj_t len_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_recv_obj, socket_recv); -//| def sendto(self, bytes: bytes, address: tuple) -> Any: +//| def sendto(self, bytes: bytes, address: tuple) -> int: //| """Send some bytes to a specific address. //| Suits sockets of type SOCK_DGRAM //| @@ -343,7 +343,7 @@ STATIC mp_obj_t socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_obj_t addr_ } STATIC MP_DEFINE_CONST_FUN_OBJ_3(socket_sendto_obj, socket_sendto); -//| def recvfrom(self, bufsize: int) -> Any: +//| def recvfrom(self, bufsize: int) -> Tuple[bytes, tuple]: //| """Reads some bytes from the connected remote address. //| Suits sockets of type SOCK_STREAM //| @@ -382,7 +382,7 @@ STATIC mp_obj_t socket_recvfrom(mp_obj_t self_in, mp_obj_t len_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_recvfrom_obj, socket_recvfrom); -//| def setsockopt(self, level: Any, optname: Any, value: Any) -> Any: +//| def setsockopt(self, level: int, optname: int, value: int) -> None: //| """Sets socket options""" //| ... //| @@ -416,7 +416,7 @@ STATIC mp_obj_t socket_setsockopt(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_setsockopt_obj, 4, 4, socket_setsockopt); -//| def settimeout(self, value: int) -> Any: +//| def settimeout(self, value: int) -> None: //| """Set the timeout value for this socket. //| //| :param ~int value: timeout in seconds. 0 means non-blocking. None means block indefinitely.""" @@ -447,7 +447,7 @@ STATIC mp_obj_t socket_settimeout(mp_obj_t self_in, mp_obj_t timeout_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_settimeout_obj, socket_settimeout); -//| def setblocking(self, flag: bool) -> Any: +//| def setblocking(self, flag: bool) -> Optional[int]: //| """Set the blocking behaviour of this socket. //| //| :param ~bool flag: False means non-blocking, True means block indefinitely.""" From 6e4c76a926b726d974598c0298b8580cd92c2f66 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 11:26:48 -0400 Subject: [PATCH 0208/1293] Added type hints to _stage --- shared-bindings/_stage/Layer.c | 4 ++-- shared-bindings/_stage/Text.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/_stage/Layer.c b/shared-bindings/_stage/Layer.c index 0f8260e53f..99a1560b59 100644 --- a/shared-bindings/_stage/Layer.c +++ b/shared-bindings/_stage/Layer.c @@ -88,7 +88,7 @@ STATIC mp_obj_t layer_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(self); } -//| def move(self, x: Any, y: Any) -> Any: +//| def move(self, x: int, y: int) -> None: //| """Set the offset of the layer to the specified values.""" //| ... //| @@ -100,7 +100,7 @@ STATIC mp_obj_t layer_move(mp_obj_t self_in, mp_obj_t x_in, mp_obj_t y_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(layer_move_obj, layer_move); -//| def frame(self, frame: Any, rotation: Any) -> Any: +//| def frame(self, frame: int, rotation: int) -> None: //| """Set the animation frame of the sprite, and optionally rotation its //| graphic.""" //| ... diff --git a/shared-bindings/_stage/Text.c b/shared-bindings/_stage/Text.c index b0ff1525c3..4468de7718 100644 --- a/shared-bindings/_stage/Text.c +++ b/shared-bindings/_stage/Text.c @@ -82,7 +82,7 @@ STATIC mp_obj_t text_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(self); } -//| def move(self, x: Any, y: Any) -> Any: +//| def move(self, x: int, y: int) -> None: //| """Set the offset of the text to the specified values.""" //| ... //| From f8229372bd06eea08e97be5241352d521fa8972f Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 11:31:57 -0400 Subject: [PATCH 0209/1293] Added type hints to terminalio --- shared-bindings/terminalio/Terminal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/terminalio/Terminal.c b/shared-bindings/terminalio/Terminal.c index 5c045fdee2..43310dd2a5 100644 --- a/shared-bindings/terminalio/Terminal.c +++ b/shared-bindings/terminalio/Terminal.c @@ -40,7 +40,7 @@ //| class Terminal: //| """Display a character stream with a TileGrid""" //| -//| def __init__(self, tilegrid: Any, font: Any): +//| def __init__(self, tilegrid: bitmap, font: fontio.BuiltinFont): //| """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.""" //| ... @@ -72,7 +72,7 @@ STATIC mp_obj_t terminalio_terminal_make_new(const mp_obj_type_t *type, size_t n // These are standard stream methods. Code is in py/stream.c. // -//| def write(self, buf: Any) -> Any: +//| def write(self, buf: ReadableBuffer) -> Optional[int]: //| """Write the buffer of bytes to the bus. //| //| :return: the number of bytes written From 0a657091c60e4c996f485508401370e7ae0f13b3 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 11:34:45 -0400 Subject: [PATCH 0210/1293] Added type hints to touchio --- shared-bindings/touchio/TouchIn.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/shared-bindings/touchio/TouchIn.c b/shared-bindings/touchio/TouchIn.c index 0a9851cc59..50ca952ce8 100644 --- a/shared-bindings/touchio/TouchIn.c +++ b/shared-bindings/touchio/TouchIn.c @@ -73,7 +73,7 @@ STATIC mp_obj_t touchio_touchin_make_new(const mp_obj_type_t *type, return (mp_obj_t) self; } -//| def deinit(self) -> Any: +//| def deinit(self) -> None: //| """Deinitialises the TouchIn and releases any hardware resources for reuse.""" //| ... //| @@ -90,13 +90,13 @@ STATIC void check_for_deinit(touchio_touchin_obj_t *self) { } } -//| def __enter__(self) -> Any: +//| def __enter__(self) -> TouchIn: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self) -> Any: +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -108,7 +108,7 @@ STATIC mp_obj_t touchio_touchin_obj___exit__(size_t n_args, const mp_obj_t *args } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(touchio_touchin___exit___obj, 4, 4, touchio_touchin_obj___exit__); -//| value: Any = ... +//| value: bool = ... //| """Whether the touch pad is being touched or not. (read-only) //| //| True when `raw_value` > `threshold`.""" @@ -128,7 +128,7 @@ const mp_obj_property_t touchio_touchin_value_obj = { }; -//| raw_value: Any = ... +//| raw_value: int = ... //| """The raw touch measurement as an `int`. (read-only)""" //| STATIC mp_obj_t touchio_touchin_obj_get_raw_value(mp_obj_t self_in) { @@ -147,7 +147,7 @@ const mp_obj_property_t touchio_touchin_raw_value_obj = { }; -//| threshold: Any = ... +//| threshold: Optional[int] = ... //| """Minimum `raw_value` needed to detect a touch (and for `value` to be `True`). //| //| When the **TouchIn** object is created, an initial `raw_value` is read from the pin, From e089862a6c7bcd8274ff45512f92b1330a01b3ae Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 11:38:02 -0400 Subject: [PATCH 0211/1293] Added type hints to usb_hid --- shared-bindings/usb_hid/Device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/usb_hid/Device.c b/shared-bindings/usb_hid/Device.c index 99b7b9db96..14b441e445 100644 --- a/shared-bindings/usb_hid/Device.c +++ b/shared-bindings/usb_hid/Device.c @@ -43,7 +43,7 @@ //| """Not currently dynamically supported.""" //| ... //| -//| def send_report(self, buf: Any) -> Any: +//| def send_report(self, buf: ReadableBuffer) -> None: //| """Send a HID report.""" //| ... //| @@ -58,7 +58,7 @@ STATIC mp_obj_t usb_hid_device_send_report(mp_obj_t self_in, mp_obj_t buffer) { } MP_DEFINE_CONST_FUN_OBJ_2(usb_hid_device_send_report_obj, usb_hid_device_send_report); -//| usage_page: Any = ... +//| usage_page: int = ... //| """The usage page of the device as an `int`. Can be thought of a category. (read-only)""" //| STATIC mp_obj_t usb_hid_device_obj_get_usage_page(mp_obj_t self_in) { @@ -74,7 +74,7 @@ const mp_obj_property_t usb_hid_device_usage_page_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| usage: Any = ... +//| usage: int = ... //| """The functionality of the device as an int. (read-only) //| //| For example, Keyboard is 0x06 within the generic desktop usage page 0x01. From 9c842c5a670117751785edae8f6355cae8f27ced Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 11:40:20 -0400 Subject: [PATCH 0212/1293] Added type hints to usb_midi --- shared-bindings/usb_midi/PortIn.c | 4 ++-- shared-bindings/usb_midi/PortOut.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/usb_midi/PortIn.c b/shared-bindings/usb_midi/PortIn.c index 9d9310b47a..176283cd50 100644 --- a/shared-bindings/usb_midi/PortIn.c +++ b/shared-bindings/usb_midi/PortIn.c @@ -48,7 +48,7 @@ // These are standard stream methods. Code is in py/stream.c. // -//| def read(self, nbytes: Any = None) -> Any: +//| def read(self, nbytes: int = None) -> Optional[bytes]: //| """Read characters. If ``nbytes`` is specified then read at most that many //| bytes. Otherwise, read everything that arrives until the connection //| times out. Providing the number of bytes expected is highly recommended @@ -58,7 +58,7 @@ //| :rtype: bytes or None""" //| ... //| -//| def readinto(self, buf: Any, nbytes: Any = None) -> Any: +//| def readinto(self, buf: WriteableBuffer, nbytes: int = None) -> Optional[bytes]: //| """Read bytes into the ``buf``. If ``nbytes`` is specified then read at most //| that many bytes. Otherwise, read at most ``len(buf)`` bytes. //| diff --git a/shared-bindings/usb_midi/PortOut.c b/shared-bindings/usb_midi/PortOut.c index b4afbc0362..92ed451e97 100644 --- a/shared-bindings/usb_midi/PortOut.c +++ b/shared-bindings/usb_midi/PortOut.c @@ -47,7 +47,7 @@ // These are standard stream methods. Code is in py/stream.c. // -//| def write(self, buf: Any) -> Any: +//| def write(self, buf: ReadableBuffer) -> Optional[int]: //| """Write the buffer of bytes to the bus. //| //| :return: the number of bytes written From 5163618d23f52c7f351b2a7d416e5dd4f434d9dc Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 11:42:07 -0400 Subject: [PATCH 0213/1293] Added type hints to watchdog --- shared-bindings/watchdog/WatchDogMode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/watchdog/WatchDogMode.c b/shared-bindings/watchdog/WatchDogMode.c index 293ee043d9..d867ba5248 100644 --- a/shared-bindings/watchdog/WatchDogMode.c +++ b/shared-bindings/watchdog/WatchDogMode.c @@ -32,12 +32,12 @@ //| def __init__(self): //| """Enum-like class to define the run mode of the watchdog timer.""" //| -//| RAISE: Any = ... +//| RAISE: watchdog.WatchDogMode = ... //| """Raise an exception when the WatchDogTimer expires. //| //| :type watchdog.WatchDogMode:""" //| -//| RESET: Any = ... +//| RESET: watchdog.WatchDogMode = ... //| """Reset the system if the WatchDogTimer expires. //| //| :type watchdog.WatchDogMode:""" From 843ff5d30271709186a117877ff0521b769ae8d1 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 11:44:16 -0400 Subject: [PATCH 0214/1293] Added type hints to wiznet --- shared-bindings/wiznet/wiznet5k.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/wiznet/wiznet5k.c b/shared-bindings/wiznet/wiznet5k.c index 2f49dffea9..90bd9ac2c7 100644 --- a/shared-bindings/wiznet/wiznet5k.c +++ b/shared-bindings/wiznet/wiznet5k.c @@ -84,7 +84,7 @@ STATIC mp_obj_t wiznet5k_make_new(const mp_obj_type_t *type, size_t n_args, cons return ret; } -//| connected: Any = ... +//| connected: bool = ... //| """(boolean, readonly) is this device physically connected?""" //| @@ -101,7 +101,7 @@ const mp_obj_property_t wiznet5k_connected_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| dhcp: Any = ... +//| dhcp: bool = ... //| """(boolean, readwrite) is DHCP active on this device? //| //| * set to True to activate DHCP, False to turn it off""" @@ -134,7 +134,7 @@ const mp_obj_property_t wiznet5k_dhcp_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def ifconfig(self, params: Any = None) -> Any: +//| def ifconfig(self, params: tuple = None) -> Optional[tuple]: //| """Called without parameters, returns a tuple of //| (ip_address, subnet_mask, gateway_address, dns_server) //| From 3df03a565069d6e8874eb678d4f010eee97305b0 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 13:49:00 -0400 Subject: [PATCH 0215/1293] Made most of the requested changes --- shared-bindings/_bleio/Adapter.c | 4 +-- shared-bindings/_bleio/Address.c | 6 ++-- shared-bindings/_bleio/Connection.c | 2 +- shared-bindings/_bleio/PacketBuffer.c | 2 +- shared-bindings/_bleio/ScanEntry.c | 2 +- shared-bindings/_bleio/ScanResults.c | 4 +-- shared-bindings/_bleio/Service.c | 2 +- shared-bindings/_bleio/UUID.c | 4 +-- shared-bindings/_bleio/__init__.c | 30 ++++++++----------- shared-bindings/_eve/__init__.c | 18 +++++------ shared-bindings/_pew/PewPew.c | 2 +- shared-bindings/_pixelbuf/PixelBuf.c | 2 +- shared-bindings/aesio/aes.c | 6 ++-- shared-bindings/audiobusio/I2SOut.c | 2 +- shared-bindings/audiocore/WaveFile.c | 2 +- shared-bindings/audiomixer/Mixer.c | 2 +- shared-bindings/audiomixer/MixerVoice.c | 2 +- shared-bindings/audiomp3/MP3Decoder.c | 4 +-- shared-bindings/busio/SPI.c | 6 ++-- shared-bindings/busio/UART.c | 2 +- shared-bindings/displayio/Display.c | 4 +-- shared-bindings/displayio/EPaperDisplay.c | 2 +- shared-bindings/displayio/Group.c | 12 ++++---- shared-bindings/displayio/I2CDisplay.c | 2 +- shared-bindings/displayio/Palette.c | 4 ++- shared-bindings/displayio/ParallelBus.c | 2 +- shared-bindings/displayio/TileGrid.c | 12 ++++---- shared-bindings/fontio/BuiltinFont.c | 2 +- .../framebufferio/FramebufferDisplay.c | 10 +++---- shared-bindings/frequencyio/FrequencyIn.c | 2 +- shared-bindings/gamepad/GamePad.c | 2 +- shared-bindings/gnss/GNSS.c | 2 +- shared-bindings/gnss/PositionFix.c | 10 +++---- shared-bindings/gnss/SatelliteSystem.c | 10 +++---- shared-bindings/i2cperipheral/I2CPeripheral.c | 2 +- shared-bindings/microcontroller/RunMode.c | 6 ++-- shared-bindings/nvm/ByteArray.c | 4 ++- shared-bindings/ps2io/Ps2.c | 8 +++-- shared-bindings/pulseio/PWMOut.c | 4 +-- shared-bindings/pulseio/PulseIn.c | 4 ++- shared-bindings/rgbmatrix/RGBMatrix.c | 4 +-- shared-bindings/rotaryio/IncrementalEncoder.c | 2 +- shared-bindings/supervisor/Runtime.c | 2 +- shared-bindings/usb_hid/Device.c | 2 +- shared-bindings/usb_midi/PortIn.c | 2 +- shared-bindings/usb_midi/PortOut.c | 2 +- shared-bindings/watchdog/WatchDogMode.c | 2 +- shared-bindings/watchdog/WatchDogTimer.c | 2 +- 48 files changed, 116 insertions(+), 110 deletions(-) diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 5aab9eca5b..4067a2a2a3 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -95,7 +95,7 @@ const mp_obj_property_t bleio_adapter_enabled_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| address: str = ... +//| address: Address = ... //| """MAC address of the BLE adapter. (read-only)""" //| STATIC mp_obj_t bleio_adapter_get_address(mp_obj_t self) { @@ -350,7 +350,7 @@ const mp_obj_property_t bleio_adapter_connections_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| def connect(self, address: Address, *, timeout: float/int) -> Adapter.connect: +//| def connect(self, address: Address, *, timeout: float/int) -> Connection: //| """Attempts a connection to the device with the given address. //| //| :param Address address: The address of the peripheral to connect to diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c index 06fb58d76a..144b4c167c 100644 --- a/shared-bindings/_bleio/Address.c +++ b/shared-bindings/_bleio/Address.c @@ -128,7 +128,7 @@ const mp_obj_property_t bleio_address_type_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def __eq__(self, other: bytes) -> Optional[bool]: +//| def __eq__(self, other: Any) -> bool: //| """Two Address objects are equal if their addresses and address types are equal.""" //| ... //| @@ -154,7 +154,7 @@ STATIC mp_obj_t bleio_address_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_o } } -//| def __hash__(self) -> Optional[int]: +//| def __hash__(self) -> int: //| """Returns a hash for the Address data.""" //| ... //| @@ -187,7 +187,7 @@ STATIC void bleio_address_print(const mp_print_t *print, mp_obj_t self_in, mp_pr buf[5], buf[4], buf[3], buf[2], buf[1], buf[0]); } -//| PUBLIC: bytes = ... +//| PUBLIC: int = ... //| """A publicly known address, with a company ID (high 24 bits)and company-assigned part (low 24 bits).""" //| //| RANDOM_STATIC: int = ... diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index 64e2baefa3..ad63a3c150 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -109,7 +109,7 @@ STATIC mp_obj_t bleio_connection_pair(mp_uint_t n_args, const mp_obj_t *pos_args } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_connection_pair_obj, 1, bleio_connection_pair); -//| def discover_remote_services(self, service_uuids_whitelist: iterable = None) -> Tuple(_bleio.Service, ...): +//| def discover_remote_services(self, service_uuids_whitelist: iterable = None) -> Service: //| """Do BLE discovery for all services or for the given service UUIDS, //| to find their handles and characteristics, and return the discovered services. //| `Connection.connected` must be True. diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index 7645a25aaa..7de79ab637 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -117,7 +117,7 @@ STATIC mp_obj_t bleio_packet_buffer_readinto(mp_obj_t self_in, mp_obj_t buffer_o } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bleio_packet_buffer_readinto_obj, bleio_packet_buffer_readinto); -//| def write(self, data: bytes, *, header: bytes = None) -> int: +//| def write(self, data: bytes, *, header: Optional[bytes] = None) -> int: //| """Writes all bytes from data into the same outgoing packet. The bytes from header are included //| before data when the pending packet is currently empty. //| diff --git a/shared-bindings/_bleio/ScanEntry.c b/shared-bindings/_bleio/ScanEntry.c index f8d769cabe..561472f5cb 100644 --- a/shared-bindings/_bleio/ScanEntry.c +++ b/shared-bindings/_bleio/ScanEntry.c @@ -70,7 +70,7 @@ STATIC mp_obj_t bleio_scanentry_matches(mp_uint_t n_args, const mp_obj_t *pos_ar } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_scanentry_matches_obj, 2, bleio_scanentry_matches); -//| address: _bleio.Address = ... +//| address: Address = ... //| """The address of the device (read-only), of type `_bleio.Address`.""" //| STATIC mp_obj_t bleio_scanentry_get_address(mp_obj_t self_in) { diff --git a/shared-bindings/_bleio/ScanResults.c b/shared-bindings/_bleio/ScanResults.c index bc9d55c80f..d9620e3fc5 100644 --- a/shared-bindings/_bleio/ScanResults.c +++ b/shared-bindings/_bleio/ScanResults.c @@ -50,11 +50,11 @@ STATIC mp_obj_t scanresults_iternext(mp_obj_t self_in) { //| """Cannot be instantiated directly. Use `_bleio.Adapter.start_scan`.""" //| ... //| -//| def __iter__(self) -> __iter__: +//| def __iter__(self) -> Iterator[ScanEntry]: //| """Returns itself since it is the iterator.""" //| ... //| -//| def __next__(self) -> _bleio.ScanEntry: +//| def __next__(self) -> ScanEntry: //| """Returns the next `_bleio.ScanEntry`. Blocks if none have been received and scanning is still //| active. Raises `StopIteration` if scanning is finished and no other results are available.""" //| ... diff --git a/shared-bindings/_bleio/Service.c b/shared-bindings/_bleio/Service.c index 5cda11de4e..d2033c60c0 100644 --- a/shared-bindings/_bleio/Service.c +++ b/shared-bindings/_bleio/Service.c @@ -73,7 +73,7 @@ STATIC mp_obj_t bleio_service_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(service); } -//| characteristics: Tuple(Characteristic, ...) = ... +//| characteristics: Tuple[Characteristic, ...] = ... //| """A tuple of :py:class:`Characteristic` designating the characteristics that are offered by //| this service. (read-only)""" //| diff --git a/shared-bindings/_bleio/UUID.c b/shared-bindings/_bleio/UUID.c index 823275f900..90a39e5e58 100644 --- a/shared-bindings/_bleio/UUID.c +++ b/shared-bindings/_bleio/UUID.c @@ -36,7 +36,7 @@ //| class UUID: //| """A 16-bit or 128-bit UUID. Can be used for services, characteristics, descriptors and more.""" //| -//| def __init__(self, value: Union[int, typing.ByteString]): +//| def __init__(self, value: Union[int, ReadableBuffer, str]): //| """Create a new UUID or UUID object encapsulating the uuid value. //| The value can be one of: //| @@ -248,7 +248,7 @@ STATIC mp_obj_t bleio_uuid_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -//| def __eq__(self, other: UUID) -> Optional[bool]: +//| def __eq__(self, other: Any) -> bool: //| """Two UUID objects are equal if their values match and they are both 128-bit or both 16-bit.""" //| ... //| diff --git a/shared-bindings/_bleio/__init__.c b/shared-bindings/_bleio/__init__.c index 8778e94eda..4aeb7b4602 100644 --- a/shared-bindings/_bleio/__init__.c +++ b/shared-bindings/_bleio/__init__.c @@ -59,10 +59,9 @@ //| -//| class BluetoothError: -//| def __init__(self, Exception: Exception): -//| """Catch all exception for Bluetooth related errors.""" -//| ... +//| class BluetoothError(Exception): +//| """Catch all exception for Bluetooth related errors.""" +//| ... MP_DEFINE_BLEIO_EXCEPTION(BluetoothError, Exception) NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* fmt, ...) { @@ -72,10 +71,9 @@ NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* fmt, ...) va_end(argptr); nlr_raise(exception); } -//| class ConnectionError: -//| def __init__(self, BluetoothError: _bleio.BluetoothError): -//| """Raised when a connection is unavailable.""" -//| ... +//| class ConnectionError(BluetoothError): +//| """Raised when a connection is unavailable.""" +//| ... //| MP_DEFINE_BLEIO_EXCEPTION(ConnectionError, bleio_BluetoothError) NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* fmt, ...) { @@ -86,20 +84,18 @@ NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* fmt, ... nlr_raise(exception); } -//| class RoleError: -//| def __init__(self, BluetoothError: _bleio.BluetoothError): -//| """Raised when a resource is used as the mismatched role. For example, if a local CCCD is -//| attempted to be set but they can only be set when remote.""" -//| ... +//| class RoleError(BluetoothError): +//| """Raised when a resource is used as the mismatched role. For example, if a local CCCD is +//| attempted to be set but they can only be set when remote.""" +//| ... //| MP_DEFINE_BLEIO_EXCEPTION(RoleError, bleio_BluetoothError) NORETURN void mp_raise_bleio_RoleError(const compressed_string_t* msg) { mp_raise_msg(&mp_type_bleio_RoleError, msg); } -//| class SecurityError: -//| def __init__(self, BluetoothError: _bleio.BluetoothError): -//| """Raised when a security related error occurs.""" -//| ... +//| class SecurityError(BluetoothError): +//| """Raised when a security related error occurs.""" +//| ... //| MP_DEFINE_BLEIO_EXCEPTION(SecurityError, bleio_BluetoothError) NORETURN void mp_raise_bleio_SecurityError(const compressed_string_t* fmt, ...) { diff --git a/shared-bindings/_eve/__init__.c b/shared-bindings/_eve/__init__.c index 8a329147b5..e4ba77ed43 100644 --- a/shared-bindings/_eve/__init__.c +++ b/shared-bindings/_eve/__init__.c @@ -58,7 +58,7 @@ STATIC mp_obj_t _register(mp_obj_t self, mp_obj_t o) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(register_obj, _register); -//| def flush(self) -> Any: +//| def flush(self) -> None: //| """Send any queued drawing commands directly to the hardware. //| //| :param int width: The width of the grid in tiles, or 1 for sprites.""" @@ -559,9 +559,9 @@ STATIC mp_obj_t _colorrgb(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(colorrgb_obj, 4, 4, _colorrgb); -//| def Display(self) -> Any: ... -//| """End the display list""" -//| +//| def Display(self) -> None: +//| """End the display list""" +//| ... STATIC mp_obj_t _display(mp_obj_t self) { @@ -570,7 +570,7 @@ STATIC mp_obj_t _display(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(display_obj, _display); -//| def End(self) -> Any: +//| def End(self) -> None: //| """End drawing a graphics primitive //| //| :meth:`Vertex2ii` and :meth:`Vertex2f` calls are ignored until the next :meth:`Begin`.""" @@ -628,7 +628,7 @@ STATIC mp_obj_t _macro(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(macro_obj, _macro); -//| def Nop(self) -> Any: +//| def Nop(self) -> None: //| """No operation""" //| ... //| @@ -672,7 +672,7 @@ STATIC mp_obj_t _pointsize(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(pointsize_obj, _pointsize); -//| def RestoreContext(self) -> Any: +//| def RestoreContext(self) -> None: //| """Restore the current graphics context from the context stack""" //| ... //| @@ -684,7 +684,7 @@ STATIC mp_obj_t _restorecontext(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(restorecontext_obj, _restorecontext); -//| def Return(self) -> Any: +//| def Return(self) -> None: //| """Return from a previous call command""" //| ... //| @@ -696,7 +696,7 @@ STATIC mp_obj_t _return(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(return_obj, _return); -//| def SaveContext(self) -> Any: +//| def SaveContext(self) -> None: //| """Push the current graphics context on the context stack""" //| ... //| diff --git a/shared-bindings/_pew/PewPew.c b/shared-bindings/_pew/PewPew.c index 313389ad8a..c29f7f322d 100644 --- a/shared-bindings/_pew/PewPew.c +++ b/shared-bindings/_pew/PewPew.c @@ -46,7 +46,7 @@ //| that library.""" //| -//| def __init__(self, buffer: ReadableBuffer, rows: List[DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput], cols: List[DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput, DigitalInputOutput], buttons: DigitalInputOutput): +//| def __init__(self, buffer: ReadableBuffer, rows: List[DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut], cols: List[DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut], buttons: DigitalInOut): //| """Initializes matrix scanning routines. //| //| The ``buffer`` is a 64 byte long ``bytearray`` that stores what should diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index f66b73fdf3..81bbc08021 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -257,7 +257,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(color: tuple[int, int, int]) -> None: +//| def fill(color: Union[int, Tuple[int, int, int]]) -> None: //| """Fills the given pixelbuf with the given color.""" //| ... //| diff --git a/shared-bindings/aesio/aes.c b/shared-bindings/aesio/aes.c index df6d0c5676..e580be38be 100644 --- a/shared-bindings/aesio/aes.c +++ b/shared-bindings/aesio/aes.c @@ -12,7 +12,7 @@ //| class AES: //| """Encrypt and decrypt AES streams""" //| -//| def __init__(self, key: ReadableBuffer, mode: int=0, iv: ReadableBuffer=None, segment_size: int=8) -> AES: +//| def __init__(self, key: Optional[ReadableBuffer], mode: int=0, iv: ReadableBuffer=None, segment_size: int=8) -> None: //| """Create a new AES state with the given key. //| //| :param bytearray key: A 16-, 24-, or 32-byte key @@ -152,7 +152,7 @@ STATIC void validate_length(aesio_aes_obj_t *self, size_t src_length, } } -//| def encrypt_into(src: WriteableBuffer, dest: WriteableBuffer) -> None: +//| def encrypt_into(src: ReadableBuffer, dest: WriteableBuffer) -> None: //| """Encrypt the buffer from ``src`` into ``dest``. //| //| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the @@ -183,7 +183,7 @@ STATIC mp_obj_t aesio_aes_encrypt_into(mp_obj_t aesio_obj, mp_obj_t src, STATIC MP_DEFINE_CONST_FUN_OBJ_3(aesio_aes_encrypt_into_obj, aesio_aes_encrypt_into); -//| def decrypt_into(src: WriteableBuffer, dest: WriteableBuffer) -> None: +//| def decrypt_into(src: ReadableBuffer, dest: WriteableBuffer) -> None: //| //| """Decrypt the buffer from ``src`` into ``dest``. //| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index 5d1c4f5957..bf08d14ce5 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -147,7 +147,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj___exit__(size_t n_args, const mp_obj_t *ar STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_i2sout___exit___obj, 4, 4, audiobusio_i2sout_obj___exit__); -//| def play(self, sample: Union[audiocore.WaveFile, audiocore.RawSample, audiomixe.Mixer], *, loop: bool = False) -> None: +//| def play(self, sample: Union[audiocore.WaveFile, audiocore.RawSample, audiomixer.Mixer], *, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index 838447f2e1..b31a110c64 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -125,7 +125,7 @@ STATIC mp_obj_t audioio_wavefile_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_wavefile___exit___obj, 4, 4, audioio_wavefile_obj___exit__); -//| sample_rate: Optional[int] = ... +//| sample_rate: int = ... //| """32 bit value that dictates how quickly samples are loaded into the DAC //| in Hertz (cycles per second). When the sample is looped, this can change //| the pitch output without changing the underlying sample.""" diff --git a/shared-bindings/audiomixer/Mixer.c b/shared-bindings/audiomixer/Mixer.c index dc08a11264..a31953e03c 100644 --- a/shared-bindings/audiomixer/Mixer.c +++ b/shared-bindings/audiomixer/Mixer.c @@ -190,7 +190,7 @@ const mp_obj_property_t audiomixer_mixer_sample_rate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| voice: Tuple[audiomixer.MixerVoice, ...] = ... +//| voice: Tuple[MixerVoice, ...] = ... //| """A tuple of the mixer's `audiomixer.MixerVoice` object(s). //| //| .. code-block:: python diff --git a/shared-bindings/audiomixer/MixerVoice.c b/shared-bindings/audiomixer/MixerVoice.c index cb313e0fb1..f94d8f1761 100644 --- a/shared-bindings/audiomixer/MixerVoice.c +++ b/shared-bindings/audiomixer/MixerVoice.c @@ -56,7 +56,7 @@ STATIC mp_obj_t audiomixer_mixervoice_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(self); } -//| def play(self, sample: Union[audiocore.WaveFile, audiomixer.Mixer, audiocore.RawSample], *, loop: bool = False) -> None: +//| def play(self, sample: Union[audiocore.WaveFile, Mixer, audiocore.RawSample], *, loop: bool = False) -> None: //| """Plays the sample once when ``loop=False``, and continuously when ``loop=True``. //| Does not block. Use `playing` to block. //| diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index 68c27169ff..46e6c81f07 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -124,7 +124,7 @@ STATIC mp_obj_t audiomp3_mp3file_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiomp3_mp3file___exit___obj, 4, 4, audiomp3_mp3file_obj___exit__); -//| file: Optional[file] = ... +//| file: file = ... //| """File to play back.""" //| STATIC mp_obj_t audiomp3_mp3file_obj_get_file(mp_obj_t self_in) { @@ -154,7 +154,7 @@ const mp_obj_property_t audiomp3_mp3file_file_obj = { -//| sample_rate: Optional[int] = ... +//| sample_rate: int = ... //| """32 bit value that dictates how quickly samples are loaded into the DAC //| in Hertz (cycles per second). When the sample is looped, this can change //| the pitch output without changing the underlying sample.""" diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 38c1bcc0e7..a40c41e6a7 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -228,7 +228,7 @@ STATIC mp_obj_t busio_spi_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_unlock_obj, busio_spi_obj_unlock); -//| def write(self, buffer: ReadableBuffer, *, start: int = 0, end: int = None) -> None: +//| def write(self, buffer: ReadableBuffer, *, start: int = 0, end: Optional[int] = None) -> None: //| """Write the data contained in ``buffer``. The SPI object must be locked. //| If the buffer is empty, nothing happens. //| @@ -270,7 +270,7 @@ STATIC mp_obj_t busio_spi_write(size_t n_args, const mp_obj_t *pos_args, mp_map_ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_obj, 2, busio_spi_write); -//| def readinto(self, buffer: bytearray, *, start: int = 0, end: int = None, write_value: int = 0) -> None: +//| def readinto(self, buffer: bytearray, *, start: int = 0, end: Optional[int] = None, write_value: int = 0) -> None: //| """Read into ``buffer`` while writing ``write_value`` for each byte read. //| The SPI object must be locked. //| If the number of bytes to read is 0, nothing happens. @@ -314,7 +314,7 @@ STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_m } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_readinto_obj, 2, busio_spi_readinto); -//| def write_readinto(self, buffer_out: ReadableBuffer, buffer_in: ReadableBuffer, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: +//| def write_readinto(self, buffer_out: ReadableBuffer, buffer_in: ReadableBuffer, *, out_start: int = 0, out_end: Optional[int] = None, in_start: int = 0, in_end: Optional[int] = None) -> None: //| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. //| The SPI object must be locked. //| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index fd51d5d3b6..f4f8746fe8 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -179,7 +179,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ // These are standard stream methods. Code is in py/stream.c. // -//| def read(self, nbytes: int = None) -> Optional[bytes]: +//| def read(self, nbytes: Optional[int] = None) -> Optional[bytes]: //| """Read characters. If ``nbytes`` is specified then read at most that many //| bytes. Otherwise, read everything that arrives until the connection //| times out. Providing the number of bytes expected is highly recommended diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index c3ddc6c140..e2e6488766 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -49,7 +49,7 @@ //| Most people should not use this class directly. Use a specific display driver instead that will //| contain the initialization sequence at minimum.""" //| -//| def __init__(self, display_bus: displayio, init_sequence: buffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: microcontroller.Pin = None, brightness_command: int = None, brightness: bool = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60): +//| def __init__(self, display_bus: displayio, init_sequence: buffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: Optional[microcontroller.Pin] = None, brightness_command: int = None, brightness: bool = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60): //| r"""Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). //| //| The ``init_sequence`` is bitpacked to minimize the ram impact. Every command begins with a @@ -372,7 +372,7 @@ const mp_obj_property_t displayio_display_height_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| rotation: Optional[int] = ... +//| rotation: int = ... //| """The rotation of the display as an int in degrees.""" //| STATIC mp_obj_t displayio_display_obj_get_rotation(mp_obj_t self_in) { diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index e5768572ea..b9f7dd9a1c 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -49,7 +49,7 @@ //| Most people should not use this class directly. Use a specific display driver instead that will //| contain the startup and shutdown sequences at minimum.""" //| -//| def __init__(self, display_bus: displayio, start_sequence: buffer, stop_sequence: buffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: int = None, set_row_window_command: int = None, single_byte_bounds: bool = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: int = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: microcontroller.Pin = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False): +//| def __init__(self, display_bus: displayio, start_sequence: buffer, stop_sequence: buffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: Optional[int] = None, set_row_window_command: Optional[int] = None, single_byte_bounds: bool = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: Optional[int] = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: Optional[microcontroller.Pin] = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False): //| """Create a EPaperDisplay object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). //| //| The ``start_sequence`` and ``stop_sequence`` are bitpacked to minimize the ram impact. Every diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index d81bf5fdb0..9d12ca1615 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -86,7 +86,7 @@ displayio_group_t* native_group(mp_obj_t group_obj) { return MP_OBJ_TO_PTR(native_group); } -//| hidden: Optional[bool] = ... +//| hidden: bool = ... //| """True when the Group and all of it's layers are not visible. When False, the Group's layers //| are visible if they haven't been hidden.""" //| @@ -111,7 +111,7 @@ const mp_obj_property_t displayio_group_hidden_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| scale: Optional[int] = ... +//| scale: int = ... //| """Scales each pixel within the Group in both directions. For example, when scale=2 each pixel //| will be represented by 2x2 pixels.""" //| @@ -140,7 +140,7 @@ const mp_obj_property_t displayio_group_scale_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| x: Optional[int] = ... +//| x: int = ... //| """X position of the Group in the parent.""" //| STATIC mp_obj_t displayio_group_obj_get_x(mp_obj_t self_in) { @@ -165,7 +165,7 @@ const mp_obj_property_t displayio_group_x_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| y: Optional[int] = ... +//| y: int = ... //| """Y position of the Group in the parent.""" //| STATIC mp_obj_t displayio_group_obj_get_y(mp_obj_t self_in) { @@ -264,7 +264,9 @@ STATIC mp_obj_t displayio_group_obj_remove(mp_obj_t self_in, mp_obj_t layer) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_remove_obj, displayio_group_obj_remove); -//| def __len__(self) -> Union[bool, int, None]: +//| def __bool__(self) -> bool: ... +//| +//| def __len__(self) -> int: //| """Returns the number of layers in a Group""" //| ... //| diff --git a/shared-bindings/displayio/I2CDisplay.c b/shared-bindings/displayio/I2CDisplay.c index 7bca2c36b2..7c1827db31 100644 --- a/shared-bindings/displayio/I2CDisplay.c +++ b/shared-bindings/displayio/I2CDisplay.c @@ -91,7 +91,7 @@ STATIC mp_obj_t displayio_i2cdisplay_obj_reset(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_i2cdisplay_reset_obj, displayio_i2cdisplay_obj_reset); -//| def send(self, command: int, data: displayio) -> None: +//| def send(self, command: int, data: ReadableBuffer) -> None: //| """Sends the given command value followed by the full set of data. Display state, such as //| vertical scroll, set via ``send`` may or may not be reset once the code is done.""" //| ... diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c index 4b7756a11c..a06dd38ff0 100644 --- a/shared-bindings/displayio/Palette.c +++ b/shared-bindings/displayio/Palette.c @@ -70,7 +70,9 @@ STATIC mp_obj_t displayio_palette_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(self); } -//| def __len__(self) -> Union[bool, int, None]: +//| def __bool__(self) -> bool: ... +//| +//| def __len__(self) -> int: //| """Returns the number of colors in a Palette""" //| ... //| diff --git a/shared-bindings/displayio/ParallelBus.c b/shared-bindings/displayio/ParallelBus.c index e3897a420e..247ac5dd50 100644 --- a/shared-bindings/displayio/ParallelBus.c +++ b/shared-bindings/displayio/ParallelBus.c @@ -102,7 +102,7 @@ STATIC mp_obj_t displayio_parallelbus_obj_reset(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_parallelbus_reset_obj, displayio_parallelbus_obj_reset); -//| def send(self, command: int, data: displayio) -> None: +//| def send(self, command: int, data: ReadableBuffer) -> None: //| """Sends the given command value followed by the full set of data. Display state, such as //| vertical scroll, set via ``send`` may or may not be reset once the code is done.""" //| ... diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c index 9f17f4116b..d3ad0f0fc9 100644 --- a/shared-bindings/displayio/TileGrid.c +++ b/shared-bindings/displayio/TileGrid.c @@ -141,7 +141,7 @@ static displayio_tilegrid_t* native_tilegrid(mp_obj_t tilegrid_obj) { mp_obj_assert_native_inited(native_tilegrid); return MP_OBJ_TO_PTR(native_tilegrid); } -//| hidden: Optional[bool] = ... +//| hidden: bool = ... //| """True when the TileGrid is hidden. This may be False even when a part of a hidden Group.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_hidden(mp_obj_t self_in) { @@ -165,7 +165,7 @@ const mp_obj_property_t displayio_tilegrid_hidden_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| x: Optional[int] = ... +//| x: int = ... //| """X position of the left edge in the parent.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_x(mp_obj_t self_in) { @@ -190,7 +190,7 @@ const mp_obj_property_t displayio_tilegrid_x_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| y: Optional[int] = ... +//| y: int = ... //| """Y position of the top edge in the parent.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_y(mp_obj_t self_in) { @@ -215,7 +215,7 @@ const mp_obj_property_t displayio_tilegrid_y_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| flip_x: Optional[bool] = ... +//| flip_x: bool = ... //| """If true, the left edge rendered will be the right edge of the right-most tile.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_flip_x(mp_obj_t self_in) { @@ -239,7 +239,7 @@ const mp_obj_property_t displayio_tilegrid_flip_x_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| flip_y: Optional[bool] = ... +//| flip_y: bool = ... //| """If true, the top edge rendered will be the bottom edge of the bottom-most tile.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_flip_y(mp_obj_t self_in) { @@ -264,7 +264,7 @@ const mp_obj_property_t displayio_tilegrid_flip_y_obj = { }; -//| transpose_xy: Optional[bool] = ... +//| transpose_xy: bool = ... //| """If true, the TileGrid's axis will be swapped. When combined with mirroring, any 90 degree //| rotation can be achieved along with the corresponding mirrored version.""" //| diff --git a/shared-bindings/fontio/BuiltinFont.c b/shared-bindings/fontio/BuiltinFont.c index cc4d50fe24..6d6a39818f 100644 --- a/shared-bindings/fontio/BuiltinFont.c +++ b/shared-bindings/fontio/BuiltinFont.c @@ -76,7 +76,7 @@ STATIC mp_obj_t fontio_builtinfont_obj_get_bounding_box(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(fontio_builtinfont_get_bounding_box_obj, fontio_builtinfont_obj_get_bounding_box); -//| def get_glyph(self, codepoint: int) -> fontio.Glyph: +//| def get_glyph(self, codepoint: int) -> Glyph: //| """Returns a `fontio.Glyph` for the given codepoint or None if no glyph is available.""" //| ... //| diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index 4bbdf888d9..29e11638a0 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -151,7 +151,7 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_obj_refresh(size_t n_args, cons } MP_DEFINE_CONST_FUN_OBJ_KW(framebufferio_framebufferdisplay_refresh_obj, 1, framebufferio_framebufferdisplay_obj_refresh); -//| auto_refresh: Optional[bool] = ... +//| auto_refresh: bool = ... //| """True when the display is refreshed automatically.""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_auto_refresh(mp_obj_t self_in) { @@ -176,7 +176,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_auto_refresh_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| brightness: Optional[float] = ... +//| brightness: float = ... //| """The brightness of the display as a float. 0.0 is off and 1.0 is full brightness. When //| `auto_brightness` is True, the value of `brightness` will change automatically. //| If `brightness` is set, `auto_brightness` will be disabled and will be set to False.""" @@ -213,7 +213,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_brightness_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| auto_brightness: Optional[bool] = ... +//| auto_brightness: bool = ... //| """True when the display brightness is adjusted automatically, based on an ambient //| light sensor or other method. Note that some displays may have this set to True by default, //| but not actually implement automatic brightness adjustment. `auto_brightness` is set to False @@ -276,7 +276,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_height_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| rotation: Optional[int] = ... +//| rotation: int = ... //| """The rotation of the display as an int in degrees.""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_rotation(mp_obj_t self_in) { @@ -317,7 +317,7 @@ const mp_obj_property_t framebufferio_framebufferframebuffer_obj = { }; -//| def fill_row(self, y: int, buffer: ReadableBuffer) -> displayio: +//| def fill_row(self, y: int, buffer: WriteableBuffer) -> displayio: //| """Extract the pixels from a single row //| //| :param int y: The top edge of the area diff --git a/shared-bindings/frequencyio/FrequencyIn.c b/shared-bindings/frequencyio/FrequencyIn.c index b8b8a0f2db..1aed71f25c 100644 --- a/shared-bindings/frequencyio/FrequencyIn.c +++ b/shared-bindings/frequencyio/FrequencyIn.c @@ -169,7 +169,7 @@ STATIC mp_obj_t frequencyio_frequencyin_obj_clear(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(frequencyio_frequencyin_clear_obj, frequencyio_frequencyin_obj_clear); -//| capture_period: Optional[int] = ... +//| capture_period: int = ... //| """The capture measurement period. Lower incoming frequencies will be measured //| more accurately with longer capture periods. Higher frequencies are more //| accurate with shorter capture periods. diff --git a/shared-bindings/gamepad/GamePad.c b/shared-bindings/gamepad/GamePad.c index a5da83e3eb..8c0f58d0e8 100644 --- a/shared-bindings/gamepad/GamePad.c +++ b/shared-bindings/gamepad/GamePad.c @@ -70,7 +70,7 @@ //| time.sleep(0.1)""" //| -//| def __init__(self, b1: DigialInOut, b2: DigialInOut, b3: DigialInOut, b4: DigialInOut, b5: DigialInOut, b6: DigialInOut, b7: DigialInOut, b8: DigialInOut): +//| def __init__(self, b1: DigitalInOut, b2: DigitalInOut, b3: DigitalInOut, b4: DigitalInOut, b5: DigitalInOut, b6: DigitalInOut, b7: DigitalInOut, b8: DigitalInOut): //| """Initializes button scanning routines. //| //| The ``b1``-``b8`` parameters are ``DigitalInOut`` objects, which diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c index 99f2ba5c84..86bf3ca42c 100644 --- a/shared-bindings/gnss/GNSS.c +++ b/shared-bindings/gnss/GNSS.c @@ -171,7 +171,7 @@ const mp_obj_property_t gnss_altitude_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| timestamp: string = ... +//| timestamp: time.struct_time = ... //| """Time when the position data was updated.""" //| STATIC mp_obj_t gnss_obj_get_timestamp(mp_obj_t self_in) { diff --git a/shared-bindings/gnss/PositionFix.c b/shared-bindings/gnss/PositionFix.c index 52c0dd482b..9d4c96fe0b 100644 --- a/shared-bindings/gnss/PositionFix.c +++ b/shared-bindings/gnss/PositionFix.c @@ -32,17 +32,17 @@ //| def __init__(self): //| """Enum-like class to define the position fix mode.""" //| -//| INVALID: gnss.PositionFix = ... +//| INVALID: PositionFix = ... //| """No measurement. //| -//| :type gnss.PositionFix:""" +//| :type PositionFix:""" //| -//| FIX_2D: gnss.PositionFix = ... +//| FIX_2D: PositionFix = ... //| """2D fix. //| -//| :type gnss.PositionFix:""" +//| :type PositionFix:""" //| -//| FIX_3D: gnss.PositionFix = ... +//| FIX_3D: PositionFix = ... //| """3D fix. //| //| :type gnss.PositionFix:""" diff --git a/shared-bindings/gnss/SatelliteSystem.c b/shared-bindings/gnss/SatelliteSystem.c index 5ee7f0ffbf..3405021d47 100644 --- a/shared-bindings/gnss/SatelliteSystem.c +++ b/shared-bindings/gnss/SatelliteSystem.c @@ -32,27 +32,27 @@ //| def __init__(self): //| """Enum-like class to define the satellite system type.""" //| -//| GPS: gnss.SatelliteSystem = ... +//| GPS: SatelliteSystem = ... //| """Global Positioning System. //| //| :type gnss.SatelliteSystem:""" //| -//| GLONASS: gnss.SatelliteSystem = ... +//| GLONASS: SatelliteSystem = ... //| """GLObal NAvigation Satellite System. //| //| :type gnss.SatelliteSystem:""" //| -//| SBAS: gnss.SatelliteSystem = ... +//| SBAS: SatelliteSystem = ... //| """Satellite Based Augmentation System. //| //| :type gnss.SatelliteSystem:""" //| -//| QZSS_L1CA: gnss.SatelliteSystem = ... +//| QZSS_L1CA: SatelliteSystem = ... //| """Quasi-Zenith Satellite System L1C/A. //| //| :type gnss.SatelliteSystem:""" //| -//| QZSS_L1S: gnss.SatelliteSystem = ... +//| QZSS_L1S: SatelliteSystem = ... //| """Quasi-Zenith Satellite System L1S. //| //| :type gnss.SatelliteSystem:""" diff --git a/shared-bindings/i2cperipheral/I2CPeripheral.c b/shared-bindings/i2cperipheral/I2CPeripheral.c index 55094f75ca..0a1c798abb 100644 --- a/shared-bindings/i2cperipheral/I2CPeripheral.c +++ b/shared-bindings/i2cperipheral/I2CPeripheral.c @@ -133,7 +133,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj___exit__(size_t n_args, const m } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral___exit___obj, 4, 4, i2cperipheral_i2c_peripheral_obj___exit__); -//| def request(self, timeout: float = -1) -> i2cperipheral.I2CPeripheralRequest: +//| def request(self, timeout: float = -1) -> I2CPeripheralRequest: //| """Wait for an I2C request. //| //| :param float timeout: Timeout in seconds. Zero means wait forever, a negative value means check once diff --git a/shared-bindings/microcontroller/RunMode.c b/shared-bindings/microcontroller/RunMode.c index dce7a52301..f133c34b14 100644 --- a/shared-bindings/microcontroller/RunMode.c +++ b/shared-bindings/microcontroller/RunMode.c @@ -33,18 +33,18 @@ //| """Enum-like class to define the run mode of the microcontroller and //| CircuitPython.""" //| -//| NORMAL: microcontroller.RunMode = ... +//| NORMAL: RunMode = ... //| """Run CircuitPython as normal. //| //| :type microcontroller.RunMode:""" //| -//| SAFE_MODE: microcontroller.RunMode = ... +//| SAFE_MODE: RunMode = ... //| """Run CircuitPython in safe mode. User code will not be run and the //| file system will be writeable over USB. //| //| :type microcontroller.RunMode:""" //| -//| BOOTLOADER: microcontroller.RunMode = ... +//| BOOTLOADER: RunMode = ... //| """Run the bootloader. //| //| :type microcontroller.RunMode:""" diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c index b30582f662..6f282d6973 100644 --- a/shared-bindings/nvm/ByteArray.c +++ b/shared-bindings/nvm/ByteArray.c @@ -49,7 +49,9 @@ //| ... //| -//| def __len__(self) -> Union[bool, int, None]: +//| def __bool__(self) -> bool: ... +//| +//| def __len__(self) -> int: //| """Return the length. This is used by (`len`)""" //| ... //| diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c index b4a741030e..a7f1d9da5f 100644 --- a/shared-bindings/ps2io/Ps2.c +++ b/shared-bindings/ps2io/Ps2.c @@ -122,7 +122,7 @@ STATIC mp_obj_t ps2io_ps2_obj___exit__(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ps2io_ps2___exit___obj, 4, 4, ps2io_ps2_obj___exit__); -//| def popleft(self) -> byte: +//| def popleft(self) -> int: //| """Removes and returns the oldest received byte. When buffer //| is empty, raises an IndexError exception.""" //| ... @@ -164,7 +164,7 @@ STATIC mp_obj_t ps2io_ps2_obj_sendcmd(mp_obj_t self_in, mp_obj_t ob) { } MP_DEFINE_CONST_FUN_OBJ_2(ps2io_ps2_sendcmd_obj, ps2io_ps2_obj_sendcmd); -//| def clear_errors(self) -> int: +//| def clear_errors(self) -> None: //| """Returns and clears a bitmap with latest recorded communication errors. //| //| Reception errors (arise asynchronously, as data is received): @@ -202,7 +202,9 @@ STATIC mp_obj_t ps2io_ps2_obj_clear_errors(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(ps2io_ps2_clear_errors_obj, ps2io_ps2_obj_clear_errors); -//| def __len__(self) -> Union[bool, int, None]: +//| def __bool__(self) -> bool: ... +//| +//| def __len__(self) -> int: //| """Returns the number of received bytes in buffer, available //| to :py:func:`popleft()`.""" //| ... diff --git a/shared-bindings/pulseio/PWMOut.c b/shared-bindings/pulseio/PWMOut.c index 4197a5251f..862a500bf6 100644 --- a/shared-bindings/pulseio/PWMOut.c +++ b/shared-bindings/pulseio/PWMOut.c @@ -150,7 +150,7 @@ STATIC mp_obj_t pulseio_pwmout_obj___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pulseio_pwmout___exit___obj, 4, 4, pulseio_pwmout_obj___exit__); -//| duty_cycle: Optional[int] = ... +//| duty_cycle: int = ... //| """16 bit value that dictates how much of one cycle is high (1) versus low //| (0). 0xffff will always be high, 0 will always be low and 0x7fff will //| be half high and then half low. @@ -186,7 +186,7 @@ const mp_obj_property_t pulseio_pwmout_duty_cycle_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| frequency: Optional[int] = ... +//| frequency: int = ... //| """32 bit value that dictates the PWM frequency in Hertz (cycles per //| second). Only writeable when constructed with ``variable_frequency=True``. //| diff --git a/shared-bindings/pulseio/PulseIn.c b/shared-bindings/pulseio/PulseIn.c index d83306eab0..75ea1a80e3 100644 --- a/shared-bindings/pulseio/PulseIn.c +++ b/shared-bindings/pulseio/PulseIn.c @@ -234,7 +234,9 @@ const mp_obj_property_t pulseio_pulsein_paused_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def __len__(self) -> Union[bool, int, None]: +//| def __bool__(self) -> bool: ... +//| +//| def __len__(self) -> int: //| """Returns the current pulse length //| //| This allows you to:: diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index decf94f679..0099d9f0c5 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -128,7 +128,7 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_ } } -//| def __init__(self, *, width: int, bit_depth: List[digitalio.DigitalInOut], rgb_pins: List[digitalio.DigitalInOut], addr_pins: List[digitalio.DigitalInOut], clock_pin: digitalio.DigitalInOut, latch_pin: digitalio.DigitalInOut, output_enable_pin: digitalio.DigitalInOut, doublebuffer: bool = True, framebuffer: WriteableBuffer = None, height: int = 0): +//| def __init__(self, *, width: int, bit_depth: List[digitalio.DigitalInOut], rgb_pins: List[digitalio.DigitalInOut], addr_pins: List[digitalio.DigitalInOut], clock_pin: digitalio.DigitalInOut, latch_pin: digitalio.DigitalInOut, output_enable_pin: digitalio.DigitalInOut, doublebuffer: bool = True, framebuffer: Optional[WriteableBuffer] = None, height: int = 0): //| """Create a RGBMatrix object with the given attributes. The height of //| the display is determined by the number of rgb and address pins: //| len(rgb_pins) // 3 * 2 ** len(address_pins). With 6 RGB pins and 4 @@ -257,7 +257,7 @@ static void check_for_deinit(rgbmatrix_rgbmatrix_obj_t *self) { } } -//| brightness: Optional[float] = ... +//| brightness: float = ... //| """In the current implementation, 0.0 turns the display off entirely //| and any other value up to 1.0 turns the display on fully.""" //| diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c index 26a50dde9f..201336266a 100644 --- a/shared-bindings/rotaryio/IncrementalEncoder.c +++ b/shared-bindings/rotaryio/IncrementalEncoder.c @@ -116,7 +116,7 @@ STATIC mp_obj_t rotaryio_incrementalencoder_obj___exit__(size_t n_args, const mp STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(rotaryio_incrementalencoder___exit___obj, 4, 4, rotaryio_incrementalencoder_obj___exit__); -//| position: Optional[int] = ... +//| position: int = ... //| """The current position in terms of pulses. The number of pulses per rotation is defined by the //| specific hardware.""" //| diff --git a/shared-bindings/supervisor/Runtime.c b/shared-bindings/supervisor/Runtime.c index e0bd07600d..ba72bcd038 100755 --- a/shared-bindings/supervisor/Runtime.c +++ b/shared-bindings/supervisor/Runtime.c @@ -39,7 +39,7 @@ //| print("Hello World!")""" //| -//| def __init__(self): +//| def __init__(self): -> None //| """You cannot create an instance of `supervisor.Runtime`. //| Use `supervisor.runtime` to access the sole instance available.""" //| ... diff --git a/shared-bindings/usb_hid/Device.c b/shared-bindings/usb_hid/Device.c index 14b441e445..f7323accf8 100644 --- a/shared-bindings/usb_hid/Device.c +++ b/shared-bindings/usb_hid/Device.c @@ -39,7 +39,7 @@ //| mouse.send_report()""" //| -//| def __init__(self): +//| def __init__(self): -> None //| """Not currently dynamically supported.""" //| ... //| diff --git a/shared-bindings/usb_midi/PortIn.c b/shared-bindings/usb_midi/PortIn.c index 176283cd50..62c4f98e8d 100644 --- a/shared-bindings/usb_midi/PortIn.c +++ b/shared-bindings/usb_midi/PortIn.c @@ -58,7 +58,7 @@ //| :rtype: bytes or None""" //| ... //| -//| def readinto(self, buf: WriteableBuffer, nbytes: int = None) -> Optional[bytes]: +//| def readinto(self, buf: WriteableBuffer, nbytes: Optional[int] = None) -> Optional[bytes]: //| """Read bytes into the ``buf``. If ``nbytes`` is specified then read at most //| that many bytes. Otherwise, read at most ``len(buf)`` bytes. //| diff --git a/shared-bindings/usb_midi/PortOut.c b/shared-bindings/usb_midi/PortOut.c index 92ed451e97..e820c0a36f 100644 --- a/shared-bindings/usb_midi/PortOut.c +++ b/shared-bindings/usb_midi/PortOut.c @@ -38,7 +38,7 @@ //| class PortOut: //| """Sends midi messages to a computer over USB""" //| -//| def __init__(self): +//| def __init__(self): -> None //| """You cannot create an instance of `usb_midi.PortOut`. //| //| PortOut objects are constructed for every corresponding entry in the USB diff --git a/shared-bindings/watchdog/WatchDogMode.c b/shared-bindings/watchdog/WatchDogMode.c index d867ba5248..6c3a70c1e1 100644 --- a/shared-bindings/watchdog/WatchDogMode.c +++ b/shared-bindings/watchdog/WatchDogMode.c @@ -29,7 +29,7 @@ //| class WatchDogMode: //| """run state of the watchdog timer""" //| -//| def __init__(self): +//| def __init__(self): -> None //| """Enum-like class to define the run mode of the watchdog timer.""" //| //| RAISE: watchdog.WatchDogMode = ... diff --git a/shared-bindings/watchdog/WatchDogTimer.c b/shared-bindings/watchdog/WatchDogTimer.c index 4a2aa00cdf..ba1e43b358 100644 --- a/shared-bindings/watchdog/WatchDogTimer.c +++ b/shared-bindings/watchdog/WatchDogTimer.c @@ -49,7 +49,7 @@ //| """ //| -//| def __init__(self): +//| def __init__(self): -> None //| """Not currently dynamically supported. Access the sole instance through `microcontroller.watchdog`.""" //| ... //| From d358c915c3d27469fc17bdc302dad393d7e28a09 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 14:00:06 -0400 Subject: [PATCH 0216/1293] Fixed init formatting --- shared-bindings/supervisor/Runtime.c | 2 +- shared-bindings/usb_hid/Device.c | 2 +- shared-bindings/usb_midi/PortOut.c | 2 +- shared-bindings/watchdog/WatchDogMode.c | 2 +- shared-bindings/watchdog/WatchDogTimer.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/shared-bindings/supervisor/Runtime.c b/shared-bindings/supervisor/Runtime.c index ba72bcd038..689c299ef8 100755 --- a/shared-bindings/supervisor/Runtime.c +++ b/shared-bindings/supervisor/Runtime.c @@ -39,7 +39,7 @@ //| print("Hello World!")""" //| -//| def __init__(self): -> None +//| def __init__(self) -> None: //| """You cannot create an instance of `supervisor.Runtime`. //| Use `supervisor.runtime` to access the sole instance available.""" //| ... diff --git a/shared-bindings/usb_hid/Device.c b/shared-bindings/usb_hid/Device.c index f7323accf8..d071716efa 100644 --- a/shared-bindings/usb_hid/Device.c +++ b/shared-bindings/usb_hid/Device.c @@ -39,7 +39,7 @@ //| mouse.send_report()""" //| -//| def __init__(self): -> None +//| def __init__(self) -> None: //| """Not currently dynamically supported.""" //| ... //| diff --git a/shared-bindings/usb_midi/PortOut.c b/shared-bindings/usb_midi/PortOut.c index e820c0a36f..ce7062ed3c 100644 --- a/shared-bindings/usb_midi/PortOut.c +++ b/shared-bindings/usb_midi/PortOut.c @@ -38,7 +38,7 @@ //| class PortOut: //| """Sends midi messages to a computer over USB""" //| -//| def __init__(self): -> None +//| def __init__(self) -> None: //| """You cannot create an instance of `usb_midi.PortOut`. //| //| PortOut objects are constructed for every corresponding entry in the USB diff --git a/shared-bindings/watchdog/WatchDogMode.c b/shared-bindings/watchdog/WatchDogMode.c index 6c3a70c1e1..9b9999d8bf 100644 --- a/shared-bindings/watchdog/WatchDogMode.c +++ b/shared-bindings/watchdog/WatchDogMode.c @@ -29,7 +29,7 @@ //| class WatchDogMode: //| """run state of the watchdog timer""" //| -//| def __init__(self): -> None +//| def __init__(self) -> None: //| """Enum-like class to define the run mode of the watchdog timer.""" //| //| RAISE: watchdog.WatchDogMode = ... diff --git a/shared-bindings/watchdog/WatchDogTimer.c b/shared-bindings/watchdog/WatchDogTimer.c index ba1e43b358..20bead106c 100644 --- a/shared-bindings/watchdog/WatchDogTimer.c +++ b/shared-bindings/watchdog/WatchDogTimer.c @@ -49,7 +49,7 @@ //| """ //| -//| def __init__(self): -> None +//| def __init__(self) -> None: //| """Not currently dynamically supported. Access the sole instance through `microcontroller.watchdog`.""" //| ... //| From d0d949cd24dbff5fb382f8c7abf3bae7ba46541a Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 14:23:34 -0400 Subject: [PATCH 0217/1293] Made every init return None --- shared-bindings/_bleio/Adapter.c | 2 +- shared-bindings/_bleio/Address.c | 2 +- shared-bindings/_bleio/Attribute.c | 2 +- shared-bindings/_bleio/Characteristic.c | 2 +- shared-bindings/_bleio/CharacteristicBuffer.c | 2 +- shared-bindings/_bleio/Connection.c | 2 +- shared-bindings/_bleio/Descriptor.c | 2 +- shared-bindings/_bleio/PacketBuffer.c | 2 +- shared-bindings/_bleio/ScanEntry.c | 2 +- shared-bindings/_bleio/ScanResults.c | 2 +- shared-bindings/_bleio/Service.c | 2 +- shared-bindings/_bleio/UUID.c | 2 +- shared-bindings/_pew/PewPew.c | 2 +- shared-bindings/_pixelbuf/PixelBuf.c | 2 +- shared-bindings/_stage/Layer.c | 2 +- shared-bindings/_stage/Text.c | 2 +- shared-bindings/analogio/AnalogIn.c | 2 +- shared-bindings/analogio/AnalogOut.c | 2 +- shared-bindings/audiobusio/I2SOut.c | 2 +- shared-bindings/audiobusio/PDMIn.c | 2 +- shared-bindings/audiocore/RawSample.c | 2 +- shared-bindings/audiocore/WaveFile.c | 2 +- shared-bindings/audioio/AudioOut.c | 2 +- shared-bindings/audiomixer/Mixer.c | 2 +- shared-bindings/audiomixer/MixerVoice.c | 2 +- shared-bindings/audiomp3/MP3Decoder.c | 2 +- shared-bindings/audiopwmio/PWMAudioOut.c | 2 +- shared-bindings/bitbangio/I2C.c | 2 +- shared-bindings/bitbangio/OneWire.c | 2 +- shared-bindings/bitbangio/SPI.c | 2 +- shared-bindings/busio/I2C.c | 2 +- shared-bindings/busio/OneWire.c | 2 +- shared-bindings/busio/SPI.c | 2 +- shared-bindings/busio/UART.c | 2 +- shared-bindings/countio/Counter.c | 2 +- shared-bindings/digitalio/DigitalInOut.c | 2 +- shared-bindings/digitalio/Direction.c | 2 +- shared-bindings/digitalio/DriveMode.c | 2 +- shared-bindings/digitalio/Pull.c | 2 +- shared-bindings/displayio/Bitmap.c | 2 +- shared-bindings/displayio/ColorConverter.c | 2 +- shared-bindings/displayio/Display.c | 2 +- shared-bindings/displayio/EPaperDisplay.c | 2 +- shared-bindings/displayio/FourWire.c | 2 +- shared-bindings/displayio/Group.c | 2 +- shared-bindings/displayio/I2CDisplay.c | 2 +- shared-bindings/displayio/OnDiskBitmap.c | 2 +- shared-bindings/displayio/Palette.c | 2 +- shared-bindings/displayio/ParallelBus.c | 2 +- shared-bindings/displayio/Shape.c | 2 +- shared-bindings/displayio/TileGrid.c | 2 +- shared-bindings/fontio/BuiltinFont.c | 2 +- shared-bindings/framebufferio/FramebufferDisplay.c | 2 +- shared-bindings/frequencyio/FrequencyIn.c | 2 +- shared-bindings/gamepad/GamePad.c | 2 +- shared-bindings/gamepadshift/GamePadShift.c | 2 +- shared-bindings/gnss/GNSS.c | 2 +- shared-bindings/gnss/PositionFix.c | 2 +- shared-bindings/gnss/SatelliteSystem.c | 2 +- shared-bindings/i2cperipheral/I2CPeripheral.c | 4 ++-- shared-bindings/microcontroller/Pin.c | 2 +- shared-bindings/microcontroller/Processor.c | 2 +- shared-bindings/microcontroller/RunMode.c | 2 +- shared-bindings/nvm/ByteArray.c | 2 +- shared-bindings/ps2io/Ps2.c | 2 +- shared-bindings/pulseio/PWMOut.c | 2 +- shared-bindings/pulseio/PulseIn.c | 2 +- shared-bindings/pulseio/PulseOut.c | 2 +- shared-bindings/rgbmatrix/RGBMatrix.c | 2 +- shared-bindings/rotaryio/IncrementalEncoder.c | 2 +- shared-bindings/rtc/RTC.c | 2 +- shared-bindings/sdcardio/SDCard.c | 2 +- shared-bindings/sdioio/SDCard.c | 2 +- shared-bindings/socket/__init__.c | 2 +- shared-bindings/storage/__init__.c | 2 +- shared-bindings/terminalio/Terminal.c | 2 +- shared-bindings/time/__init__.c | 2 +- shared-bindings/touchio/TouchIn.c | 2 +- shared-bindings/ulab/__init__.pyi | 2 +- shared-bindings/usb_midi/PortIn.c | 2 +- shared-bindings/vectorio/Circle.c | 2 +- shared-bindings/vectorio/Polygon.c | 2 +- shared-bindings/vectorio/Rectangle.c | 2 +- shared-bindings/vectorio/VectorShape.c | 2 +- shared-bindings/wiznet/wiznet5k.c | 2 +- 85 files changed, 86 insertions(+), 86 deletions(-) diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 4067a2a2a3..75212fa91f 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -65,7 +65,7 @@ //| connections and also initiate connections.""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """You cannot create an instance of `_bleio.Adapter`. //| Use `_bleio.adapter` to access the sole instance available.""" //| ... diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c index 144b4c167c..2481a9199c 100644 --- a/shared-bindings/_bleio/Address.c +++ b/shared-bindings/_bleio/Address.c @@ -38,7 +38,7 @@ //| """Encapsulates the address of a BLE device.""" //| -//| def __init__(self, address: ReadableBuffer, address_type: int): +//| def __init__(self, address: ReadableBuffer, address_type: int) -> None: //| """Create a new Address object encapsulating the address value. //| The value itself can be one of: //| diff --git a/shared-bindings/_bleio/Attribute.c b/shared-bindings/_bleio/Attribute.c index 79f45da94d..7d91c93780 100644 --- a/shared-bindings/_bleio/Attribute.c +++ b/shared-bindings/_bleio/Attribute.c @@ -36,7 +36,7 @@ //| :py:class:`~Characteristic` and :py:class:`~Descriptor`, //| but is not defined as a Python superclass of those classes.""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """You cannot create an instance of :py:class:`~_bleio.Attribute`.""" //| ... //| diff --git a/shared-bindings/_bleio/Characteristic.c b/shared-bindings/_bleio/Characteristic.c index e4c81d8c27..593d8edcb4 100644 --- a/shared-bindings/_bleio/Characteristic.c +++ b/shared-bindings/_bleio/Characteristic.c @@ -37,7 +37,7 @@ //| """Stores information about a BLE service characteristic and allows reading //| and writing of the characteristic's value.""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """There is no regular constructor for a Characteristic. A new local Characteristic can be created //| and attached to a Service by calling `add_to_service()`. //| Remote Characteristic objects are created by `Connection.discover_remote_services()` diff --git a/shared-bindings/_bleio/CharacteristicBuffer.c b/shared-bindings/_bleio/CharacteristicBuffer.c index efe27e5d2a..24d7a26b64 100644 --- a/shared-bindings/_bleio/CharacteristicBuffer.c +++ b/shared-bindings/_bleio/CharacteristicBuffer.c @@ -44,7 +44,7 @@ STATIC void raise_error_if_not_connected(bleio_characteristic_buffer_obj_t *self //| class CharacteristicBuffer: //| """Accumulates a Characteristic's incoming values in a FIFO buffer.""" //| -//| def __init__(self, characteristic: Characteristic, *, timeout: int = 1, buffer_size: int = 64): +//| def __init__(self, characteristic: Characteristic, *, timeout: int = 1, buffer_size: int = 64) -> None: //| //| """Monitor the given Characteristic. Each time a new value is written to the Characteristic //| add the newly-written bytes to a FIFO buffer. diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index ad63a3c150..5dfbc5a36c 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -68,7 +68,7 @@ void bleio_connection_ensure_connected(bleio_connection_obj_t *self) { } } -//| def __init__(self): +//| def __init__(self) -> None: //| """Connections cannot be made directly. Instead, to initiate a connection use `Adapter.connect`. //| Connections may also be made when another device initiates a connection. To use a Connection //| created by a peer, read the `Adapter.connections` property. diff --git a/shared-bindings/_bleio/Descriptor.c b/shared-bindings/_bleio/Descriptor.c index 6382221a16..b709fea6dd 100644 --- a/shared-bindings/_bleio/Descriptor.c +++ b/shared-bindings/_bleio/Descriptor.c @@ -39,7 +39,7 @@ //| Descriptors are attached to BLE characteristics and provide contextual //| information about the characteristic.""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """There is no regular constructor for a Descriptor. A new local Descriptor can be created //| and attached to a Characteristic by calling `add_to_characteristic()`. //| Remote Descriptor objects are created by `Connection.discover_remote_services()` diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index 7de79ab637..bbdde37d5b 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -44,7 +44,7 @@ //| When we're the server, we ignore all connections besides the first to subscribe to //| notifications.""" //| -//| def __init__(self, characteristic: Characteristic, *, buffer_size: int): +//| def __init__(self, characteristic: Characteristic, *, buffer_size: int) -> None: //| """Monitor the given Characteristic. Each time a new value is written to the Characteristic //| add the newly-written bytes to a FIFO buffer. //| diff --git a/shared-bindings/_bleio/ScanEntry.c b/shared-bindings/_bleio/ScanEntry.c index 561472f5cb..d2f0e77fd1 100644 --- a/shared-bindings/_bleio/ScanEntry.c +++ b/shared-bindings/_bleio/ScanEntry.c @@ -41,7 +41,7 @@ //| it has no user-visible constructor.""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Cannot be instantiated directly. Use `_bleio.Adapter.start_scan`.""" //| ... //| diff --git a/shared-bindings/_bleio/ScanResults.c b/shared-bindings/_bleio/ScanResults.c index d9620e3fc5..9dca90c38a 100644 --- a/shared-bindings/_bleio/ScanResults.c +++ b/shared-bindings/_bleio/ScanResults.c @@ -46,7 +46,7 @@ STATIC mp_obj_t scanresults_iternext(mp_obj_t self_in) { return MP_OBJ_STOP_ITERATION; } -//| def __init__(self): +//| def __init__(self) -> None: //| """Cannot be instantiated directly. Use `_bleio.Adapter.start_scan`.""" //| ... //| diff --git a/shared-bindings/_bleio/Service.c b/shared-bindings/_bleio/Service.c index d2033c60c0..65f920c583 100644 --- a/shared-bindings/_bleio/Service.c +++ b/shared-bindings/_bleio/Service.c @@ -35,7 +35,7 @@ //| class Service: //| """Stores information about a BLE service and its characteristics.""" //| -//| def __init__(self, uuid: UUID, *, secondary: bool = False): +//| def __init__(self, uuid: UUID, *, secondary: bool = False) -> None: //| """Create a new Service identified by the specified UUID. It can be accessed by all //| connections. This is known as a Service server. Client Service objects are created via //| `Connection.discover_remote_services`. diff --git a/shared-bindings/_bleio/UUID.c b/shared-bindings/_bleio/UUID.c index 90a39e5e58..c6706e46a7 100644 --- a/shared-bindings/_bleio/UUID.c +++ b/shared-bindings/_bleio/UUID.c @@ -36,7 +36,7 @@ //| class UUID: //| """A 16-bit or 128-bit UUID. Can be used for services, characteristics, descriptors and more.""" //| -//| def __init__(self, value: Union[int, ReadableBuffer, str]): +//| def __init__(self, value: Union[int, ReadableBuffer, str]) -> None: //| """Create a new UUID or UUID object encapsulating the uuid value. //| The value can be one of: //| diff --git a/shared-bindings/_pew/PewPew.c b/shared-bindings/_pew/PewPew.c index c29f7f322d..32a956c93c 100644 --- a/shared-bindings/_pew/PewPew.c +++ b/shared-bindings/_pew/PewPew.c @@ -46,7 +46,7 @@ //| that library.""" //| -//| def __init__(self, buffer: ReadableBuffer, rows: List[DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut], cols: List[DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut], buttons: DigitalInOut): +//| def __init__(self, buffer: ReadableBuffer, rows: List[DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut], cols: List[DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut], buttons: DigitalInOut) -> None: //| """Initializes matrix scanning routines. //| //| The ``buffer`` is a 64 byte long ``bytearray`` that stores what should diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 81bbc08021..951395acba 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -47,7 +47,7 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t //| class PixelBuf: //| """A fast RGB[W] pixel buffer for LED and similar devices.""" //| -//| def __init__(self, size: int, *, byteorder: str = "BGR", brightness: float = 0, auto_write: bool = False, header: bytes = b"", trailer: bytes = b""): +//| def __init__(self, size: int, *, byteorder: str = "BGR", brightness: float = 0, auto_write: bool = False, header: bytes = b"", trailer: bytes = b"") -> None: //| """Create a PixelBuf object of the specified size, byteorder, and bits per pixel. //| //| When brightness is less than 1.0, a second buffer will be used to store the color values diff --git a/shared-bindings/_stage/Layer.c b/shared-bindings/_stage/Layer.c index 99a1560b59..5828669a78 100644 --- a/shared-bindings/_stage/Layer.c +++ b/shared-bindings/_stage/Layer.c @@ -33,7 +33,7 @@ //| class Layer: //| """Keep information about a single layer of graphics""" //| -//| def __init__(self, width: int, height: int, graphic: bytearray, palette: bytearray, grid: bytearray): +//| def __init__(self, width: int, height: int, graphic: bytearray, palette: bytearray, grid: bytearray) -> None: //| """Keep internal information about a layer of graphics (either a //| ``Grid`` or a ``Sprite``) in a format suitable for fast rendering //| with the ``render()`` function. diff --git a/shared-bindings/_stage/Text.c b/shared-bindings/_stage/Text.c index 4468de7718..555eb58310 100644 --- a/shared-bindings/_stage/Text.c +++ b/shared-bindings/_stage/Text.c @@ -33,7 +33,7 @@ //| class Text: //| """Keep information about a single grid of text""" //| -//| def __init__(self, width: int, height: int, font: bytearray, palette: bytearray, chars: bytearray): +//| def __init__(self, width: int, height: int, font: bytearray, palette: bytearray, chars: bytearray) -> None: //| """Keep internal information about a grid of text //| in a format suitable for fast rendering //| with the ``render()`` function. diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index e52d9b16be..a91ffd9467 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -48,7 +48,7 @@ //| val = adc.value""" //| -//| def __init__(self, pin: microcontroller.Pin): +//| def __init__(self, pin: microcontroller.Pin) -> None: //| """Use the AnalogIn on the given pin. The reference voltage varies by //| platform so use ``reference_voltage`` to read the configured setting. //| diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index 9523b91a99..3b8d9354ad 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -47,7 +47,7 @@ //| dac = analogio.AnalogOut(pin.PA02) # output on pin PA02 //| dac.value = 32768 # makes PA02 1.65V""" //| -//| def __init__(self, pin: microcontroller.Pin): +//| def __init__(self, pin: microcontroller.Pin) -> None: //| """Use the AnalogOut on the given pin. //| //| :param ~microcontroller.Pin pin: the pin to output to""" diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index bf08d14ce5..304c737f62 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -38,7 +38,7 @@ //| class I2SOut: //| """Output an I2S audio signal""" //| -//| def __init__(self, bit_clock: microcontroller.Pin, word_select: microcontroller.Pin, data: microcontroller.Pin, *, left_justified: bool): +//| def __init__(self, bit_clock: microcontroller.Pin, word_select: microcontroller.Pin, data: microcontroller.Pin, *, left_justified: bool) -> None: //| """Create a I2SOut object associated with the given pins. //| //| :param ~microcontroller.Pin bit_clock: The bit clock (or serial clock) pin diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c index 329c7bde53..9a963bcfa9 100644 --- a/shared-bindings/audiobusio/PDMIn.c +++ b/shared-bindings/audiobusio/PDMIn.c @@ -39,7 +39,7 @@ //| class PDMIn: //| """Record an input PDM audio stream""" //| -//| def __init__(self, clock_pin: microcontroller.Pin, data_pin: microcontroller.Pin, *, sample_rate: int = 16000, bit_depth: int = 8, mono: bool = True, oversample: int = 64, startup_delay: float = 0.11): +//| def __init__(self, clock_pin: microcontroller.Pin, data_pin: microcontroller.Pin, *, sample_rate: int = 16000, bit_depth: int = 8, mono: bool = True, oversample: int = 64, startup_delay: float = 0.11) -> None: //| """Create a PDMIn object associated with the given pins. This allows you to //| record audio signals from the given pins. Individual ports may put further //| restrictions on the recording parameters. The overall sample rate is diff --git a/shared-bindings/audiocore/RawSample.c b/shared-bindings/audiocore/RawSample.c index dc5cfd8200..20ebae0015 100644 --- a/shared-bindings/audiocore/RawSample.c +++ b/shared-bindings/audiocore/RawSample.c @@ -38,7 +38,7 @@ //| class RawSample: //| """A raw audio sample buffer in memory""" //| -//| def __init__(self, buffer: array.array, *, channel_count: int = 1, sample_rate: int = 8000): +//| def __init__(self, buffer: array.array, *, channel_count: int = 1, sample_rate: int = 8000) -> None: //| """Create a RawSample based on the given buffer of signed values. If channel_count is more than //| 1 then each channel's samples should alternate. In other words, for a two channel buffer, the //| first sample will be for channel 1, the second sample will be for channel two, the third for diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index b31a110c64..d986d6db5c 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -40,7 +40,7 @@ //| be 8 bit unsigned or 16 bit signed. If a buffer is provided, it will be used instead of allocating //| an internal buffer.""" //| -//| def __init__(self, file: typing.BinaryIO, buffer: ReadableBuffer): +//| def __init__(self, file: typing.BinaryIO, buffer: ReadableBuffer) -> None: //| """Load a .wav file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. //| //| :param typing.BinaryIO file: Already opened wave file diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index a500eb7c79..e1a78c44c4 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -39,7 +39,7 @@ //| class AudioOut: //| """Output an analog audio signal""" //| -//| def __init__(self, left_channel: microcontroller.Pin, *, right_channel: microcontroller.Pin = None, quiescent_value: int = 0x8000): +//| def __init__(self, left_channel: microcontroller.Pin, *, right_channel: microcontroller.Pin = None, quiescent_value: int = 0x8000) -> None: //| """Create a AudioOut object associated with the given pin(s). This allows you to //| play audio signals out on the given pin(s). //| diff --git a/shared-bindings/audiomixer/Mixer.c b/shared-bindings/audiomixer/Mixer.c index a31953e03c..0d7712b036 100644 --- a/shared-bindings/audiomixer/Mixer.c +++ b/shared-bindings/audiomixer/Mixer.c @@ -41,7 +41,7 @@ //| class Mixer: //| """Mixes one or more audio samples together into one sample.""" //| -//| def __init__(self, voice_count: int = 2, buffer_size: int = 1024, channel_count: int = 2, bits_per_sample: int = 16, samples_signed: bool = True, sample_rate: int = 8000): +//| def __init__(self, voice_count: int = 2, buffer_size: int = 1024, channel_count: int = 2, bits_per_sample: int = 16, samples_signed: bool = True, sample_rate: int = 8000) -> None: //| """Create a Mixer object that can mix multiple channels with the same sample rate. //| Samples are accessed and controlled with the mixer's `audiomixer.MixerVoice` objects. //| diff --git a/shared-bindings/audiomixer/MixerVoice.c b/shared-bindings/audiomixer/MixerVoice.c index f94d8f1761..26a044d464 100644 --- a/shared-bindings/audiomixer/MixerVoice.c +++ b/shared-bindings/audiomixer/MixerVoice.c @@ -42,7 +42,7 @@ //| //| Used to access and control samples with `audiomixer.Mixer`.""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """MixerVoice instance object(s) created by `audiomixer.Mixer`.""" //| ... //| diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index 46e6c81f07..b7bb449572 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -37,7 +37,7 @@ //| class MP3: //| """Load a mp3 file for audio playback""" //| -//| def __init__(self, file: typing.BinaryIO, buffer: WriteableBuffer): +//| def __init__(self, file: typing.BinaryIO, buffer: WriteableBuffer) -> None: //| //| """Load a .mp3 file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. //| diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index b16538f174..1d740823a9 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -39,7 +39,7 @@ //| class PWMAudioOut: //| """Output an analog audio signal by varying the PWM duty cycle.""" //| -//| def __init__(self, left_channel: microcontroller.Pin, *, right_channel: microcontroller.Pin = None, quiescent_value: int = 0x8000): +//| def __init__(self, left_channel: microcontroller.Pin, *, right_channel: microcontroller.Pin = None, quiescent_value: int = 0x8000) -> None: //| """Create a PWMAudioOut object associated with the given pin(s). This allows you to //| play audio signals out on the given pin(s). In contrast to mod:`audioio`, //| the pin(s) specified are digital pins, and are driven with a device-dependent PWM diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index 710275b2f6..a9ab475bdb 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -40,7 +40,7 @@ //| class I2C: //| """Two wire serial protocol""" //| -//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int): +//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int) -> None: //| """I2C is a two-wire protocol for communicating between devices. At the //| physical level it consists of 2 wires: SCL and SDA, the clock and data //| lines respectively. diff --git a/shared-bindings/bitbangio/OneWire.c b/shared-bindings/bitbangio/OneWire.c index b9fce5e056..da94a393e3 100644 --- a/shared-bindings/bitbangio/OneWire.c +++ b/shared-bindings/bitbangio/OneWire.c @@ -42,7 +42,7 @@ //| //| Protocol definition is here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126""" //| -//| def __init__(self, pin: microcontroller.Pin): +//| def __init__(self, pin: microcontroller.Pin) -> None: //| //| """Create a OneWire object associated with the given pin. The object //| implements the lowest level timing-sensitive bits of the protocol. diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index 90483e3ebf..0a4d62361a 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -51,7 +51,7 @@ //| multiple secondaries can share the `!clock`, `!MOSI` and `!MISO` lines //| and therefore the hardware.)""" //| -//| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): +//| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None) -> None: //| """Construct an SPI object on the given pins. //| //| .. seealso:: Using this class directly requires careful lock management. diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index cf38fdce60..d34386a685 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -39,7 +39,7 @@ //| class I2C: //| """Two wire serial protocol""" //| -//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int = 255): +//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int = 255) -> None: //| //| """I2C is a two-wire protocol for communicating between devices. At the //| physical level it consists of 2 wires: SCL and SDA, the clock and data diff --git a/shared-bindings/busio/OneWire.c b/shared-bindings/busio/OneWire.c index 66f0fba3da..1fae391819 100644 --- a/shared-bindings/busio/OneWire.c +++ b/shared-bindings/busio/OneWire.c @@ -37,7 +37,7 @@ //| class OneWire: //| """Lowest-level of the Maxim OneWire protocol""" //| -//| def __init__(self, pin: microcontroller.Pin): +//| def __init__(self, pin: microcontroller.Pin) -> None: //| """(formerly Dallas Semi) OneWire protocol. //| //| Protocol definition is here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126 diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index a40c41e6a7..173f8aa6df 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -53,7 +53,7 @@ //| multiple secondaries can share the `!clock`, `!MOSI` and `!MISO` lines //| and therefore the hardware.)""" //| -//| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): +//| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None) -> None: //| //| """Construct an SPI object on the given pins. //| diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index f4f8746fe8..31a36a809d 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -44,7 +44,7 @@ //| class UART: //| """A bidirectional serial protocol""" -//| def __init__(self, tx: microcontroller.Pin, rx: microcontroller.Pin, *, baudrate: int = 9600, bits: int = 8, parity: Parity = None, stop: int = 1, timeout: float = 1, receiver_buffer_size: int = 64): +//| def __init__(self, tx: microcontroller.Pin, rx: microcontroller.Pin, *, baudrate: int = 9600, bits: int = 8, parity: Parity = None, stop: int = 1, timeout: float = 1, receiver_buffer_size: int = 64) -> None: //| """A common bidirectional serial protocol that uses an an agreed upon speed //| rather than a shared clock line. //| diff --git a/shared-bindings/countio/Counter.c b/shared-bindings/countio/Counter.c index 64e8701b75..e40ec3b64f 100644 --- a/shared-bindings/countio/Counter.c +++ b/shared-bindings/countio/Counter.c @@ -13,7 +13,7 @@ //| """Counter will keep track of the number of falling edge transistions (pulses) on a //| given pin""" //| -//| def __init__(self, pin_a: microcontroller.Pin): +//| def __init__(self, pin_a: microcontroller.Pin) -> None: //| """Create a Counter object associated with the given pin. It tracks the number of //| falling pulses relative when the object is constructed. //| diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index 21dc4dfed6..ffc65620e4 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -50,7 +50,7 @@ //| a pin, see the :py:class:`analogio.AnalogIn` and //| :py:class:`analogio.AnalogOut` classes.""" //| -//| def __init__(self, pin: microcontroller.Pin): +//| def __init__(self, pin: microcontroller.Pin) -> None: //| """Create a new DigitalInOut object associated with the pin. Defaults to input //| with no pull. Use :py:meth:`switch_to_input` and //| :py:meth:`switch_to_output` to change the direction. diff --git a/shared-bindings/digitalio/Direction.c b/shared-bindings/digitalio/Direction.c index 56e2a281c4..3798b3fa74 100644 --- a/shared-bindings/digitalio/Direction.c +++ b/shared-bindings/digitalio/Direction.c @@ -41,7 +41,7 @@ //| class Direction: //| """Defines the direction of a digital pin""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Enum-like class to define which direction the digital values are //| going.""" //| ... diff --git a/shared-bindings/digitalio/DriveMode.c b/shared-bindings/digitalio/DriveMode.c index d1d962d341..208143a2fa 100644 --- a/shared-bindings/digitalio/DriveMode.c +++ b/shared-bindings/digitalio/DriveMode.c @@ -29,7 +29,7 @@ //| class DriveMode: //| """Defines the drive mode of a digital pin""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Enum-like class to define the drive mode used when outputting //| digital values.""" //| ... diff --git a/shared-bindings/digitalio/Pull.c b/shared-bindings/digitalio/Pull.c index 46d12bf882..9656811c89 100644 --- a/shared-bindings/digitalio/Pull.c +++ b/shared-bindings/digitalio/Pull.c @@ -29,7 +29,7 @@ //| class Pull: //| """Defines the pull of a digital input pin""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Enum-like class to define the pull value, if any, used while reading //| digital values in.""" //| ... diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 9677b51f62..b2cda21536 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -39,7 +39,7 @@ //| class Bitmap: //| """Stores values of a certain size in a 2D array""" //| -//| def __init__(self, width: int, height: int, value_count: int): +//| def __init__(self, width: int, height: int, value_count: int) -> None: //| """Create a Bitmap object with the given fixed size. Each pixel stores a value that is used to //| index into a corresponding palette. This enables differently colored sprites to share the //| underlying Bitmap. value_count is used to minimize the memory used to store the Bitmap. diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index 6126c4194d..17eed1a9b1 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -39,7 +39,7 @@ //| class ColorConverter: //| """Converts one color format to another.""" //| -//| def __init__(self, *, dither: bool = False): +//| def __init__(self, *, dither: bool = False) -> None: //| """Create a ColorConverter object to convert color formats. Only supports RGB888 to RGB565 //| currently. //| :param bool dither: Adds random noise to dither the output image""" diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index e2e6488766..8d5fa87184 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -49,7 +49,7 @@ //| Most people should not use this class directly. Use a specific display driver instead that will //| contain the initialization sequence at minimum.""" //| -//| def __init__(self, display_bus: displayio, init_sequence: buffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: Optional[microcontroller.Pin] = None, brightness_command: int = None, brightness: bool = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60): +//| def __init__(self, display_bus: displayio, init_sequence: buffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: Optional[microcontroller.Pin] = None, brightness_command: int = None, brightness: bool = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60) -> None: //| r"""Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). //| //| The ``init_sequence`` is bitpacked to minimize the ram impact. Every command begins with a diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index b9f7dd9a1c..21eaf14daa 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -49,7 +49,7 @@ //| Most people should not use this class directly. Use a specific display driver instead that will //| contain the startup and shutdown sequences at minimum.""" //| -//| def __init__(self, display_bus: displayio, start_sequence: buffer, stop_sequence: buffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: Optional[int] = None, set_row_window_command: Optional[int] = None, single_byte_bounds: bool = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: Optional[int] = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: Optional[microcontroller.Pin] = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False): +//| def __init__(self, display_bus: displayio, start_sequence: buffer, stop_sequence: buffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: Optional[int] = None, set_row_window_command: Optional[int] = None, single_byte_bounds: bool = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: Optional[int] = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: Optional[microcontroller.Pin] = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False) -> None: //| """Create a EPaperDisplay object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). //| //| The ``start_sequence`` and ``stop_sequence`` are bitpacked to minimize the ram impact. Every diff --git a/shared-bindings/displayio/FourWire.c b/shared-bindings/displayio/FourWire.c index 7e53249244..83d260c0f6 100644 --- a/shared-bindings/displayio/FourWire.c +++ b/shared-bindings/displayio/FourWire.c @@ -42,7 +42,7 @@ //| """Manage updating a display over SPI four wire protocol in the background while Python code runs. //| It doesn't handle display initialization.""" //| -//| def __init__(self, spi_bus: busio.SPI, *, command: microcontroller.Pin, chip_select: microcontroller.Pin, reset: microcontroller.Pin = None, baudrate: int = 24000000, polarity: int = 0, phase: int = 0): +//| def __init__(self, spi_bus: busio.SPI, *, command: microcontroller.Pin, chip_select: microcontroller.Pin, reset: microcontroller.Pin = None, baudrate: int = 24000000, polarity: int = 0, phase: int = 0) -> None: //| """Create a FourWire object associated with the given pins. //| //| The SPI bus and pins are then in use by the display until `displayio.release_displays()` is diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index 9d12ca1615..02915da644 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -38,7 +38,7 @@ //| class Group: //| """Manage a group of sprites and groups and how they are inter-related.""" //| -//| def __init__(self, *, max_size: int = 4, scale: int = 1, x: int = 0, y: int = 0): +//| def __init__(self, *, max_size: int = 4, scale: int = 1, x: int = 0, y: int = 0) -> None: //| """Create a Group of a given size and scale. Scale is in one dimension. For example, scale=2 //| leads to a layer's pixel being 2x2 pixels when in the group. //| diff --git a/shared-bindings/displayio/I2CDisplay.c b/shared-bindings/displayio/I2CDisplay.c index 7c1827db31..c8b6702a15 100644 --- a/shared-bindings/displayio/I2CDisplay.c +++ b/shared-bindings/displayio/I2CDisplay.c @@ -42,7 +42,7 @@ //| """Manage updating a display over I2C in the background while Python code runs. //| It doesn't handle display initialization.""" //| -//| def __init__(self, i2c_bus: busio.I2C, *, device_address: int, reset: microcontroller.Pin = None): +//| def __init__(self, i2c_bus: busio.I2C, *, device_address: int, reset: microcontroller.Pin = None) -> None: //| """Create a I2CDisplay object associated with the given I2C bus and reset pin. //| //| The I2C bus and pins are then in use by the display until `displayio.release_displays()` is diff --git a/shared-bindings/displayio/OnDiskBitmap.c b/shared-bindings/displayio/OnDiskBitmap.c index 0c6ca761c9..7e94a0401a 100644 --- a/shared-bindings/displayio/OnDiskBitmap.c +++ b/shared-bindings/displayio/OnDiskBitmap.c @@ -69,7 +69,7 @@ //| while True: //| pass""" //| -//| def __init__(self, file: file): +//| def __init__(self, file: file) -> None: //| """Create an OnDiskBitmap object with the given file. //| //| :param file file: The open bitmap file""" diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c index a06dd38ff0..5418133e1e 100644 --- a/shared-bindings/displayio/Palette.c +++ b/shared-bindings/displayio/Palette.c @@ -46,7 +46,7 @@ //| """Map a pixel palette_index to a full color. Colors are transformed to the display's format internally to //| save memory.""" //| -//| def __init__(self, color_count: int): +//| def __init__(self, color_count: int) -> None: //| """Create a Palette object to store a set number of colors. //| //| :param int color_count: The number of colors in the Palette""" diff --git a/shared-bindings/displayio/ParallelBus.c b/shared-bindings/displayio/ParallelBus.c index 247ac5dd50..30c9d373c8 100644 --- a/shared-bindings/displayio/ParallelBus.c +++ b/shared-bindings/displayio/ParallelBus.c @@ -42,7 +42,7 @@ //| protocol may be refered to as 8080-I Series Parallel Interface in datasheets. It doesn't handle //| display initialization.""" //| -//| def __init__(self, *, data0: microcontroller.Pin, command: microcontroller.Pin, chip_select: microcontroller.Pin, write: microcontroller.Pin, read: microcontroller.Pin, reset: microcontroller.Pin): +//| def __init__(self, *, data0: microcontroller.Pin, command: microcontroller.Pin, chip_select: microcontroller.Pin, write: microcontroller.Pin, read: microcontroller.Pin, reset: microcontroller.Pin) -> None: //| """Create a ParallelBus object associated with the given pins. The bus is inferred from data0 //| by implying the next 7 additional pins on a given GPIO port. //| diff --git a/shared-bindings/displayio/Shape.c b/shared-bindings/displayio/Shape.c index 258ac49021..4d737ecae2 100644 --- a/shared-bindings/displayio/Shape.c +++ b/shared-bindings/displayio/Shape.c @@ -37,7 +37,7 @@ //| class Shape: //| """Represents a shape made by defining boundaries that may be mirrored.""" //| -//| def __init__(self, width: int, height: int, *, mirror_x: bool = False, mirror_y: bool = False): +//| def __init__(self, width: int, height: int, *, mirror_x: bool = False, mirror_y: bool = False) -> None: //| """Create a Shape object with the given fixed size. Each pixel is one bit and is stored by the //| column boundaries of the shape on each row. Each row's boundary defaults to the full row. //| diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c index d3ad0f0fc9..348fcb4484 100644 --- a/shared-bindings/displayio/TileGrid.c +++ b/shared-bindings/displayio/TileGrid.c @@ -48,7 +48,7 @@ //| //| A single tile grid is also known as a Sprite.""" //| -//| def __init__(self, bitmap: displayio.Bitmap, *, pixel_shader: displayio.Palette, width: int = 1, height: int = 1, tile_width: int = None, tile_height: int = None, default_tile: int = 0, x: int = 0, y: int = 0): +//| def __init__(self, bitmap: displayio.Bitmap, *, pixel_shader: displayio.Palette, width: int = 1, height: int = 1, tile_width: int = None, tile_height: int = None, default_tile: int = 0, x: int = 0, y: int = 0) -> None: //| """Create a TileGrid object. The bitmap is source for 2d pixels. The pixel_shader is used to //| convert the value and its location to a display native pixel color. This may be a simple color //| palette lookup, a gradient, a pattern or a color transformer. diff --git a/shared-bindings/fontio/BuiltinFont.c b/shared-bindings/fontio/BuiltinFont.c index 6d6a39818f..9e2f81c475 100644 --- a/shared-bindings/fontio/BuiltinFont.c +++ b/shared-bindings/fontio/BuiltinFont.c @@ -39,7 +39,7 @@ //| class BuiltinFont: //| """A font built into CircuitPython""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Creation not supported. Available fonts are defined when CircuitPython is built. See the //| `Adafruit_CircuitPython_Bitmap_Font `_ //| library for dynamically loaded fonts.""" diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index 29e11638a0..737e0696f8 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -47,7 +47,7 @@ //| objects in CircuitPython, Display objects live until `displayio.release_displays()` //| is called. This is done so that CircuitPython can use the display itself.""" //| -//| def __init__(self, framebuffer: framebuffer, *, rotation: int = 0, auto_refresh: bool = True): +//| def __init__(self, framebuffer: framebuffer, *, rotation: int = 0, auto_refresh: bool = True) -> None: //| """Create a Display object with the given framebuffer (a buffer, array, ulab.array, etc) //| //| :param framebuffer: The framebuffer that the display is connected to diff --git a/shared-bindings/frequencyio/FrequencyIn.c b/shared-bindings/frequencyio/FrequencyIn.c index 1aed71f25c..5f99b166c7 100644 --- a/shared-bindings/frequencyio/FrequencyIn.c +++ b/shared-bindings/frequencyio/FrequencyIn.c @@ -46,7 +46,7 @@ //| //| FrequencyIn will not determine pulse width (use ``PulseIn``).""" //| -//| def __init__(self, pin: microcontroller.Pin, capture_period: int = 10): +//| def __init__(self, pin: microcontroller.Pin, capture_period: int = 10) -> None: //| """Create a FrequencyIn object associated with the given pin. //| //| :param ~microcontroller.Pin pin: Pin to read frequency from. diff --git a/shared-bindings/gamepad/GamePad.c b/shared-bindings/gamepad/GamePad.c index 8c0f58d0e8..f03a6cd33e 100644 --- a/shared-bindings/gamepad/GamePad.c +++ b/shared-bindings/gamepad/GamePad.c @@ -70,7 +70,7 @@ //| time.sleep(0.1)""" //| -//| def __init__(self, b1: DigitalInOut, b2: DigitalInOut, b3: DigitalInOut, b4: DigitalInOut, b5: DigitalInOut, b6: DigitalInOut, b7: DigitalInOut, b8: DigitalInOut): +//| def __init__(self, b1: DigitalInOut, b2: DigitalInOut, b3: DigitalInOut, b4: DigitalInOut, b5: DigitalInOut, b6: DigitalInOut, b7: DigitalInOut, b8: DigitalInOut) -> None: //| """Initializes button scanning routines. //| //| The ``b1``-``b8`` parameters are ``DigitalInOut`` objects, which diff --git a/shared-bindings/gamepadshift/GamePadShift.c b/shared-bindings/gamepadshift/GamePadShift.c index f01c957046..e05a95865c 100644 --- a/shared-bindings/gamepadshift/GamePadShift.c +++ b/shared-bindings/gamepadshift/GamePadShift.c @@ -36,7 +36,7 @@ //| class GamePadShift: //| """Scan buttons for presses through a shift register""" //| -//| def __init__(self, clock: DigitalInOut, data: DigitalInOut, latch: DigitalInOut): +//| def __init__(self, clock: DigitalInOut, data: DigitalInOut, latch: DigitalInOut) -> None: //| """Initializes button scanning routines. //| //| The ``clock``, ``data`` and ``latch`` parameters are ``DigitalInOut`` diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c index 86bf3ca42c..0ecc1ac6a1 100644 --- a/shared-bindings/gnss/GNSS.c +++ b/shared-bindings/gnss/GNSS.c @@ -53,7 +53,7 @@ //| print("Longitude: {0:.6f} degrees".format(nav.longitude))""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Turn on the GNSS. //| //| :param gnss.SatelliteSystem system: satellite system to use""" diff --git a/shared-bindings/gnss/PositionFix.c b/shared-bindings/gnss/PositionFix.c index 9d4c96fe0b..f2cd2b9fe3 100644 --- a/shared-bindings/gnss/PositionFix.c +++ b/shared-bindings/gnss/PositionFix.c @@ -29,7 +29,7 @@ //| class PositionFix: //| """Position fix mode""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Enum-like class to define the position fix mode.""" //| //| INVALID: PositionFix = ... diff --git a/shared-bindings/gnss/SatelliteSystem.c b/shared-bindings/gnss/SatelliteSystem.c index 3405021d47..2fd785f0a9 100644 --- a/shared-bindings/gnss/SatelliteSystem.c +++ b/shared-bindings/gnss/SatelliteSystem.c @@ -29,7 +29,7 @@ //| class SatelliteSystem: //| """Satellite system type""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Enum-like class to define the satellite system type.""" //| //| GPS: SatelliteSystem = ... diff --git a/shared-bindings/i2cperipheral/I2CPeripheral.c b/shared-bindings/i2cperipheral/I2CPeripheral.c index 0a1c798abb..b528ca9c39 100644 --- a/shared-bindings/i2cperipheral/I2CPeripheral.c +++ b/shared-bindings/i2cperipheral/I2CPeripheral.c @@ -52,7 +52,7 @@ STATIC mp_obj_t mp_obj_new_i2cperipheral_i2c_peripheral_request(i2cperipheral_i2 //| class I2CPeripheral: //| """Two wire serial protocol peripheral""" //| -//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, addresses: tuple, smbus: bool = False): +//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, addresses: tuple, smbus: bool = False) -> None: //| """I2C is a two-wire protocol for communicating between devices. //| This implements the peripheral (sensor, secondary) side. //| @@ -227,7 +227,7 @@ const mp_obj_type_t i2cperipheral_i2c_peripheral_type = { //| class I2CPeripheralRequest: //| -//| def __init__(self, peripheral: i2cperipheral.I2CPeripheral, address: int, is_read: bool, is_restart: bool): +//| def __init__(self, peripheral: i2cperipheral.I2CPeripheral, address: int, is_read: bool, is_restart: bool) -> None: //| """Information about an I2C transfer request //| This cannot be instantiated directly, but is returned by :py:meth:`I2CPeripheral.request`. //| diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index f53949d85b..931c0b4c45 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -36,7 +36,7 @@ //| class Pin: //| """Identifies an IO pin on the microcontroller.""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Identifies an IO pin on the microcontroller. They are fixed by the //| hardware so they cannot be constructed on demand. Instead, use //| `board` or `microcontroller.pin` to reference the desired pin.""" diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c index 32ec4f2e79..d9f780f846 100644 --- a/shared-bindings/microcontroller/Processor.c +++ b/shared-bindings/microcontroller/Processor.c @@ -44,7 +44,7 @@ //| print(microcontroller.cpu.temperature)""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """You cannot create an instance of `microcontroller.Processor`. //| Use `microcontroller.cpu` to access the sole instance available.""" //| ... diff --git a/shared-bindings/microcontroller/RunMode.c b/shared-bindings/microcontroller/RunMode.c index f133c34b14..38bbb612b0 100644 --- a/shared-bindings/microcontroller/RunMode.c +++ b/shared-bindings/microcontroller/RunMode.c @@ -29,7 +29,7 @@ //| class RunMode: //| """run state of the microcontroller""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Enum-like class to define the run mode of the microcontroller and //| CircuitPython.""" //| diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c index 6f282d6973..278ac4d739 100644 --- a/shared-bindings/nvm/ByteArray.c +++ b/shared-bindings/nvm/ByteArray.c @@ -44,7 +44,7 @@ //| microcontroller.nvm[0:3] = b\"\xcc\x10\x00\"""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Not currently dynamically supported. Access the sole instance through `microcontroller.nvm`.""" //| ... //| diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c index a7f1d9da5f..15731ea404 100644 --- a/shared-bindings/ps2io/Ps2.c +++ b/shared-bindings/ps2io/Ps2.c @@ -45,7 +45,7 @@ //| level converters must be used to connect the I/O lines to pins //| of 3.3V boards.""" //| -//| def __init__(self, data_pin: microcontroller.Pin, clock_pin: microcontroller.Pin): +//| def __init__(self, data_pin: microcontroller.Pin, clock_pin: microcontroller.Pin) -> None: //| """Create a Ps2 object associated with the given pins. //| //| :param ~microcontroller.Pin data_pin: Pin tied to data wire. diff --git a/shared-bindings/pulseio/PWMOut.c b/shared-bindings/pulseio/PWMOut.c index 862a500bf6..e3aa43a31a 100644 --- a/shared-bindings/pulseio/PWMOut.c +++ b/shared-bindings/pulseio/PWMOut.c @@ -38,7 +38,7 @@ //| class PWMOut: //| """Output a Pulse Width Modulated signal on a given pin.""" //| -//| def __init__(self, pin: microcontroller.Pin, *, duty_cycle: int = 0, frequency: int = 500, variable_frequency: bool = False): +//| def __init__(self, pin: microcontroller.Pin, *, duty_cycle: int = 0, frequency: int = 500, variable_frequency: bool = False) -> None: //| """Create a PWM object associated with the given pin. This allows you to //| write PWM signals out on the given pin. Frequency is fixed after init //| unless ``variable_frequency`` is True. diff --git a/shared-bindings/pulseio/PulseIn.c b/shared-bindings/pulseio/PulseIn.c index 75ea1a80e3..4bcff06ee2 100644 --- a/shared-bindings/pulseio/PulseIn.c +++ b/shared-bindings/pulseio/PulseIn.c @@ -40,7 +40,7 @@ //| and low cost temperature sensors (DHT). The pulsed signal consists of timed active and //| idle periods. Unlike PWM, there is no set duration for active and idle pairs.""" //| -//| def __init__(self, pin: microcontroller.Pin, maxlen: int = 2, *, idle_state: bool = False): +//| def __init__(self, pin: microcontroller.Pin, maxlen: int = 2, *, idle_state: bool = False) -> None: //| """Create a PulseIn object associated with the given pin. The object acts as //| a read-only sequence of pulse lengths with a given max length. When it is //| active, new pulse lengths are added to the end of the list. When there is diff --git a/shared-bindings/pulseio/PulseOut.c b/shared-bindings/pulseio/PulseOut.c index dfed6d3049..9e2d687449 100644 --- a/shared-bindings/pulseio/PulseOut.c +++ b/shared-bindings/pulseio/PulseOut.c @@ -41,7 +41,7 @@ //| pulsed signal consists of timed on and off periods. Unlike PWM, there is no set duration //| for on and off pairs.""" //| -//| def __init__(self, carrier: pulseio.PWMOut): +//| def __init__(self, carrier: pulseio.PWMOut) -> None: //| """Create a PulseOut object associated with the given PWMout object. //| //| :param ~pulseio.PWMOut carrier: PWMOut that is set to output on the desired pin. diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index 0099d9f0c5..e04336351d 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -128,7 +128,7 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_ } } -//| def __init__(self, *, width: int, bit_depth: List[digitalio.DigitalInOut], rgb_pins: List[digitalio.DigitalInOut], addr_pins: List[digitalio.DigitalInOut], clock_pin: digitalio.DigitalInOut, latch_pin: digitalio.DigitalInOut, output_enable_pin: digitalio.DigitalInOut, doublebuffer: bool = True, framebuffer: Optional[WriteableBuffer] = None, height: int = 0): +//| def __init__(self, *, width: int, bit_depth: List[digitalio.DigitalInOut], rgb_pins: List[digitalio.DigitalInOut], addr_pins: List[digitalio.DigitalInOut], clock_pin: digitalio.DigitalInOut, latch_pin: digitalio.DigitalInOut, output_enable_pin: digitalio.DigitalInOut, doublebuffer: bool = True, framebuffer: Optional[WriteableBuffer] = None, height: int = 0) -> None: //| """Create a RGBMatrix object with the given attributes. The height of //| the display is determined by the number of rgb and address pins: //| len(rgb_pins) // 3 * 2 ** len(address_pins). With 6 RGB pins and 4 diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c index 201336266a..37c4ee324e 100644 --- a/shared-bindings/rotaryio/IncrementalEncoder.c +++ b/shared-bindings/rotaryio/IncrementalEncoder.c @@ -37,7 +37,7 @@ //| class IncrementalEncoder: //| """IncrementalEncoder determines the relative rotational position based on two series of pulses.""" //| -//| def __init__(self, pin_a: microcontroller.Pin, pin_b: microcontroller.Pin): +//| def __init__(self, pin_a: microcontroller.Pin, pin_b: microcontroller.Pin) -> None: //| """Create an IncrementalEncoder object associated with the given pins. It tracks the positional //| state of an incremental rotary encoder (also known as a quadrature encoder.) Position is //| relative to the position when the object is contructed. diff --git a/shared-bindings/rtc/RTC.c b/shared-bindings/rtc/RTC.c index 009256176b..f6d1e06c4c 100644 --- a/shared-bindings/rtc/RTC.c +++ b/shared-bindings/rtc/RTC.c @@ -41,7 +41,7 @@ const rtc_rtc_obj_t rtc_rtc_obj = {{&rtc_rtc_type}}; //| class RTC: //| """Real Time Clock""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """This class represents the onboard Real Time Clock. It is a singleton and will always return the same instance.""" //| ... //| diff --git a/shared-bindings/sdcardio/SDCard.c b/shared-bindings/sdcardio/SDCard.c index 6b32bb1c11..7f53f741dd 100644 --- a/shared-bindings/sdcardio/SDCard.c +++ b/shared-bindings/sdcardio/SDCard.c @@ -44,7 +44,7 @@ //| `busio.SPI`, not `bitbangio.SPI`. Usually an SDCard object is used //| with ``storage.VfsFat`` to allow file I/O to an SD card.""" //| -//| def __init__(bus:busio.SPI, cs: digitalio.DigitalInOut=digitalio.DigitalInOut, baudrate: int=8000000): +//| def __init__(bus:busio.SPI, cs: digitalio.DigitalInOut=digitalio.DigitalInOut, baudrate: int=8000000) -> None: //| """Construct an SPI SD Card object with the given properties //| //| :param busio.SPI spi: The SPI bus diff --git a/shared-bindings/sdioio/SDCard.c b/shared-bindings/sdioio/SDCard.c index 8890c1f3cc..94ba1c3871 100644 --- a/shared-bindings/sdioio/SDCard.c +++ b/shared-bindings/sdioio/SDCard.c @@ -49,7 +49,7 @@ //| 25MHz. Usually an SDCard object is used with ``storage.VfsFat`` //| to allow file I/O to an SD card.""" //| -//| def __init__(*, clock: digitalio.DigitalInOut, command: digitalio.DigitalInOut, data: List[digitalio.DigitalInOut], frequency: int): +//| def __init__(*, clock: digitalio.DigitalInOut, command: digitalio.DigitalInOut, data: List[digitalio.DigitalInOut], frequency: int) -> None: //| """Construct an SDIO SD Card object with the given properties //| //| :param ~microcontroller.Pin clock: the pin to use for the clock. diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c index 10a56ef407..985104d553 100644 --- a/shared-bindings/socket/__init__.c +++ b/shared-bindings/socket/__init__.c @@ -46,7 +46,7 @@ STATIC const mp_obj_type_t socket_type; //| class socket: //| -//| def __init__(self, family: int, type: int, proto: int): +//| def __init__(self, family: int, type: int, proto: int) -> None: //| """Create a new socket //| //| :param ~int family: AF_INET or AF_INET6 diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c index 3abc5512c9..0a34ef74e9 100644 --- a/shared-bindings/storage/__init__.c +++ b/shared-bindings/storage/__init__.c @@ -168,7 +168,7 @@ STATIC const mp_rom_map_elem_t storage_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_erase_filesystem), MP_ROM_PTR(&storage_erase_filesystem_obj) }, //| class VfsFat: -//| def __init__(self, block_device: Any): +//| def __init__(self, block_device: Any) -> None: //| """Create a new VfsFat filesystem around the given block device. //| //| :param block_device: Block device the the filesystem lives on""" diff --git a/shared-bindings/terminalio/Terminal.c b/shared-bindings/terminalio/Terminal.c index 43310dd2a5..623b99e096 100644 --- a/shared-bindings/terminalio/Terminal.c +++ b/shared-bindings/terminalio/Terminal.c @@ -40,7 +40,7 @@ //| class Terminal: //| """Display a character stream with a TileGrid""" //| -//| def __init__(self, tilegrid: bitmap, font: fontio.BuiltinFont): +//| def __init__(self, tilegrid: bitmap, font: fontio.BuiltinFont) -> 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.""" //| ... diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 531980effc..9b68bdd8d0 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -93,7 +93,7 @@ mp_obj_t struct_time_make_new(const mp_obj_type_t *type, size_t n_args, const mp } //| class struct_time: -//| def __init__(self, time_tuple: Any): +//| def __init__(self, time_tuple: Any) -> None: //| """Structure used to capture a date and time. Note that it takes a tuple! //| //| :param tuple time_tuple: Tuple of time info: ``(tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec, tm_wday, tm_yday, tm_isdst)`` diff --git a/shared-bindings/touchio/TouchIn.c b/shared-bindings/touchio/TouchIn.c index 50ca952ce8..d63db4ba13 100644 --- a/shared-bindings/touchio/TouchIn.c +++ b/shared-bindings/touchio/TouchIn.c @@ -52,7 +52,7 @@ //| print("touched!")""" //| -//| def __init__(self, pin: microcontroller.Pin): +//| def __init__(self, pin: microcontroller.Pin) -> None: //| """Use the TouchIn on the given pin. //| //| :param ~microcontroller.Pin pin: the pin to read from""" diff --git a/shared-bindings/ulab/__init__.pyi b/shared-bindings/ulab/__init__.pyi index e5de1391b6..03bfe36108 100644 --- a/shared-bindings/ulab/__init__.pyi +++ b/shared-bindings/ulab/__init__.pyi @@ -17,7 +17,7 @@ https://docs.scipy.org/doc/numpy/index.html""" class array: """1- and 2- dimensional array""" - def __init__(self, values, *, dtype=float): + def __init__(self, values, *, dtype=float) -> None: """:param sequence values: Sequence giving the initial content of the array. :param dtype: The type of array values, ``int8``, ``uint8``, ``int16``, ``uint16``, or ``float`` diff --git a/shared-bindings/usb_midi/PortIn.c b/shared-bindings/usb_midi/PortIn.c index 62c4f98e8d..5b26a94c43 100644 --- a/shared-bindings/usb_midi/PortIn.c +++ b/shared-bindings/usb_midi/PortIn.c @@ -38,7 +38,7 @@ //| class PortIn: //| """Receives midi commands over USB""" //| -//| def __init__(self): +//| def __init__(self) -> None: //| """You cannot create an instance of `usb_midi.PortIn`. //| //| PortIn objects are constructed for every corresponding entry in the USB diff --git a/shared-bindings/vectorio/Circle.c b/shared-bindings/vectorio/Circle.c index 65923fd96a..7b010591d2 100644 --- a/shared-bindings/vectorio/Circle.c +++ b/shared-bindings/vectorio/Circle.c @@ -11,7 +11,7 @@ //| class Circle: //| -//| def __init__(self, radius: int): +//| def __init__(self, radius: int) -> None: //| """Circle is positioned on screen by its center point. //| //| :param radius: The radius of the circle in pixels""" diff --git a/shared-bindings/vectorio/Polygon.c b/shared-bindings/vectorio/Polygon.c index 3443d9e426..486619eaeb 100644 --- a/shared-bindings/vectorio/Polygon.c +++ b/shared-bindings/vectorio/Polygon.c @@ -18,7 +18,7 @@ //| from typing import List, Tuple //| //| class Polygon: -//| def __init__(self, points: List[ Tuple[ x, y ], ... ] ): +//| def __init__(self, points: List[ Tuple[ x, y ], ... ] ) -> None: //| """Represents a closed shape by ordered vertices //| //| :param points: Vertices for the polygon""" diff --git a/shared-bindings/vectorio/Rectangle.c b/shared-bindings/vectorio/Rectangle.c index f04a25c35a..9a637f317c 100644 --- a/shared-bindings/vectorio/Rectangle.c +++ b/shared-bindings/vectorio/Rectangle.c @@ -8,7 +8,7 @@ #include "supervisor/shared/translate.h" //| class Rectangle: -//| def __init__(self, width: int, height: int): +//| def __init__(self, width: int, height: int) -> None: //| """Represents a rectangle by defining its bounds //| //| :param width: The number of pixels wide diff --git a/shared-bindings/vectorio/VectorShape.c b/shared-bindings/vectorio/VectorShape.c index c512bcd546..d1042b1c63 100644 --- a/shared-bindings/vectorio/VectorShape.c +++ b/shared-bindings/vectorio/VectorShape.c @@ -20,7 +20,7 @@ //| class VectorShape: -//| def __init__(self, shape: vectorio.Polygon, pixel_shader: displayio.Palette, x: int=0, y: int=0): +//| def __init__(self, shape: vectorio.Polygon, pixel_shader: displayio.Palette, x: int=0, y: int=0) -> None: //| """Binds a vector shape to a location and pixel color //| //| :param shape: The shape to draw. diff --git a/shared-bindings/wiznet/wiznet5k.c b/shared-bindings/wiznet/wiznet5k.c index 90bd9ac2c7..a58ac5b502 100644 --- a/shared-bindings/wiznet/wiznet5k.c +++ b/shared-bindings/wiznet/wiznet5k.c @@ -49,7 +49,7 @@ //| class WIZNET5K: //| """Wrapper for Wiznet 5500 Ethernet interface""" //| -//| def __init__(self, spi: busio.SPI, cs: microcontroller.Pin, rst: microcontroller.Pin, dhcp: bool = True): +//| def __init__(self, spi: busio.SPI, cs: microcontroller.Pin, rst: microcontroller.Pin, dhcp: bool = True) -> None: //| """Create a new WIZNET5500 interface using the specified pins //| //| :param ~busio.SPI spi: spi bus to use From f56deb60c6b14af0e8639ba0e9a3ea742236f83a Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 14:48:16 -0400 Subject: [PATCH 0218/1293] Added type hints to _eve --- shared-bindings/_eve/__init__.c | 94 ++++++++++++++++----------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/shared-bindings/_eve/__init__.c b/shared-bindings/_eve/__init__.c index e4ba77ed43..dd7f6f8bd1 100644 --- a/shared-bindings/_eve/__init__.c +++ b/shared-bindings/_eve/__init__.c @@ -70,7 +70,7 @@ STATIC mp_obj_t _flush(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(flush_obj, _flush); -//| def cc(self, b: bytes) -> Any: +//| def cc(self, b: bytes) -> None: //| """Append bytes to the command FIFO. //| //| :param bytes b: The bytes to add""" @@ -86,7 +86,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(cc_obj, _cc); //{ -//| def AlphaFunc(self, func: int, ref: int) -> Any: +//| def AlphaFunc(self, func: int, ref: int) -> None: //| """Set the alpha test function //| //| :param int func: specifies the test function, one of ``NEVER``, ``LESS``, ``LEQUAL``, ``GREATER``, ``GEQUAL``, ``EQUAL``, ``NOTEQUAL``, or ``ALWAYS``. Range 0-7. The initial value is ALWAYS(7) @@ -104,7 +104,7 @@ STATIC mp_obj_t _alphafunc(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(alphafunc_obj, _alphafunc); -//| def Begin(self, prim: int) -> Any: +//| def Begin(self, prim: int) -> None: //| """Begin drawing a graphics primitive //| //| :param int prim: graphics primitive. @@ -120,7 +120,7 @@ STATIC mp_obj_t _begin(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(begin_obj, _begin); -//| def BitmapExtFormat(self, format: int) -> Any: +//| def BitmapExtFormat(self, format: int) -> None: //| """Set the bitmap format //| //| :param int format: bitmap pixel format.""" @@ -134,7 +134,7 @@ STATIC mp_obj_t _bitmapextformat(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmapextformat_obj, _bitmapextformat); -//| def BitmapHandle(self, handle: int) -> Any: +//| def BitmapHandle(self, handle: int) -> None: //| """Set the bitmap handle //| //| :param int handle: bitmap handle. Range 0-31. The initial value is 0 @@ -150,7 +150,7 @@ STATIC mp_obj_t _bitmaphandle(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmaphandle_obj, _bitmaphandle); -//| def BitmapLayoutH(self, linestride: int, height: int) -> Any: +//| def BitmapLayoutH(self, linestride: int, height: int) -> None: //| """Set the source bitmap memory format and layout for the current handle. high bits for large bitmaps //| //| :param int linestride: high part of bitmap line stride, in bytes. Range 0-7 @@ -166,7 +166,7 @@ STATIC mp_obj_t _bitmaplayouth(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaplayouth_obj, _bitmaplayouth); -//| def BitmapLayout(self, format: int, linestride: int, height: int) -> Any: +//| def BitmapLayout(self, format: int, linestride: int, height: int) -> None: //| """Set the source bitmap memory format and layout for the current handle //| //| :param int format: bitmap pixel format, or GLFORMAT to use BITMAP_EXT_FORMAT instead. Range 0-31 @@ -184,7 +184,7 @@ STATIC mp_obj_t _bitmaplayout(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitmaplayout_obj, 4, 4, _bitmaplayout); -//| def BitmapSizeH(self, width: int, height: int) -> Any: +//| def BitmapSizeH(self, width: int, height: int) -> None: //| """Set the screen drawing of bitmaps for the current handle. high bits for large bitmaps //| //| :param int width: high part of drawn bitmap width, in pixels. Range 0-3 @@ -200,7 +200,7 @@ STATIC mp_obj_t _bitmapsizeh(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmapsizeh_obj, _bitmapsizeh); -//| def BitmapSize(self, filter: int, wrapx: int, wrapy: int, width: int, height: int) -> Any: +//| def BitmapSize(self, filter: int, wrapx: int, wrapy: int, width: int, height: int) -> None: //| """Set the screen drawing of bitmaps for the current handle //| //| :param int filter: bitmap filtering mode, one of ``NEAREST`` or ``BILINEAR``. Range 0-1 @@ -222,7 +222,7 @@ STATIC mp_obj_t _bitmapsize(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitmapsize_obj, 6, 6, _bitmapsize); -//| def BitmapSource(self, addr: int) -> Any: +//| def BitmapSource(self, addr: int) -> None: //| """Set the source address for bitmap graphics //| //| :param int addr: Bitmap start address, pixel-aligned. May be in SRAM or flash. Range 0-16777215""" @@ -236,7 +236,7 @@ STATIC mp_obj_t _bitmapsource(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmapsource_obj, _bitmapsource); -//| def BitmapSwizzle(self, r: int, g: int, b: int, a: int) -> Any: +//| def BitmapSwizzle(self, r: int, g: int, b: int, a: int) -> None: //| """Set the source for the r,g,b and a channels of a bitmap //| //| :param int r: red component source channel. Range 0-7 @@ -256,7 +256,7 @@ STATIC mp_obj_t _bitmapswizzle(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitmapswizzle_obj, 5, 5, _bitmapswizzle); -//| def BitmapTransformA(self, p: Any, v: int) -> Any: +//| def BitmapTransformA(self, p: int, v: int) -> None: //| """Set the :math:`a` component of the bitmap transform matrix //| //| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0 @@ -276,7 +276,7 @@ STATIC mp_obj_t _bitmaptransforma(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaptransforma_obj, _bitmaptransforma); -//| def BitmapTransformB(self, p: Any, v: int) -> Any: +//| def BitmapTransformB(self, p: int, v: int) -> None: //| """Set the :math:`b` component of the bitmap transform matrix //| //| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0 @@ -296,7 +296,7 @@ STATIC mp_obj_t _bitmaptransformb(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaptransformb_obj, _bitmaptransformb); -//| def BitmapTransformC(self, v: int) -> Any: +//| def BitmapTransformC(self, v: int) -> None: //| """Set the :math:`c` component of the bitmap transform matrix //| //| :param int v: The :math:`c` component of the bitmap transform matrix, in signed 15.8 bit fixed-point form. Range 0-16777215. The initial value is 0 @@ -312,7 +312,7 @@ STATIC mp_obj_t _bitmaptransformc(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmaptransformc_obj, _bitmaptransformc); -//| def BitmapTransformD(self, p: Any, v: int) -> Any: +//| def BitmapTransformD(self, p: int, v: int) -> None: //| """Set the :math:`d` component of the bitmap transform matrix //| //| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0 @@ -332,7 +332,7 @@ STATIC mp_obj_t _bitmaptransformd(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaptransformd_obj, _bitmaptransformd); -//| def BitmapTransformE(self, p: Any, v: int) -> Any: +//| def BitmapTransformE(self, p: int, v: int) -> None: //| """Set the :math:`e` component of the bitmap transform matrix //| //| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0 @@ -352,7 +352,7 @@ STATIC mp_obj_t _bitmaptransforme(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaptransforme_obj, _bitmaptransforme); -//| def BitmapTransformF(self, v: int) -> Any: +//| def BitmapTransformF(self, v: int) -> None: //| """Set the :math:`f` component of the bitmap transform matrix //| //| :param int v: The :math:`f` component of the bitmap transform matrix, in signed 15.8 bit fixed-point form. Range 0-16777215. The initial value is 0 @@ -368,7 +368,7 @@ STATIC mp_obj_t _bitmaptransformf(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmaptransformf_obj, _bitmaptransformf); -//| def BlendFunc(self, src: int, dst: int) -> Any: +//| def BlendFunc(self, src: int, dst: int) -> None: //| """Set pixel arithmetic //| //| :param int src: specifies how the source blending factor is computed. One of ``ZERO``, ``ONE``, ``SRC_ALPHA``, ``DST_ALPHA``, ``ONE_MINUS_SRC_ALPHA`` or ``ONE_MINUS_DST_ALPHA``. Range 0-7. The initial value is SRC_ALPHA(2) @@ -386,7 +386,7 @@ STATIC mp_obj_t _blendfunc(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(blendfunc_obj, _blendfunc); -//| def Call(self, dest: int) -> Any: +//| def Call(self, dest: int) -> None: //| """Execute a sequence of commands at another location in the display list //| //| :param int dest: display list address. Range 0-65535""" @@ -400,7 +400,7 @@ STATIC mp_obj_t _call(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(call_obj, _call); -//| def Cell(self, cell: int) -> Any: +//| def Cell(self, cell: int) -> None: //| """Set the bitmap cell number for the vertex2f command //| //| :param int cell: bitmap cell number. Range 0-127. The initial value is 0 @@ -416,7 +416,7 @@ STATIC mp_obj_t _cell(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(cell_obj, _cell); -//| def ClearColorA(self, alpha: int) -> Any: +//| def ClearColorA(self, alpha: int) -> None: //| """Set clear value for the alpha channel //| //| :param int alpha: alpha value used when the color buffer is cleared. Range 0-255. The initial value is 0 @@ -432,7 +432,7 @@ STATIC mp_obj_t _clearcolora(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(clearcolora_obj, _clearcolora); -//| def ClearColorRGB(self, red: int, green: int, blue: int) -> Any: +//| def ClearColorRGB(self, red: int, green: int, blue: int) -> None: //| """Set clear values for red, green and blue channels //| //| :param int red: red value used when the color buffer is cleared. Range 0-255. The initial value is 0 @@ -452,7 +452,7 @@ STATIC mp_obj_t _clearcolorrgb(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(clearcolorrgb_obj, 4, 4, _clearcolorrgb); -//| def Clear(self, c: int, s: int, t: int) -> Any: +//| def Clear(self, c: int, s: int, t: int) -> None: //| """Clear buffers to preset values //| //| :param int c: clear color buffer. Range 0-1 @@ -470,7 +470,7 @@ STATIC mp_obj_t _clear(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(clear_obj, 1, 4, _clear); -//| def ClearStencil(self, s: int) -> Any: +//| def ClearStencil(self, s: int) -> None: //| """Set clear value for the stencil buffer //| //| :param int s: value used when the stencil buffer is cleared. Range 0-255. The initial value is 0 @@ -486,7 +486,7 @@ STATIC mp_obj_t _clearstencil(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(clearstencil_obj, _clearstencil); -//| def ClearTag(self, s: int) -> Any: +//| def ClearTag(self, s: int) -> None: //| """Set clear value for the tag buffer //| //| :param int s: value used when the tag buffer is cleared. Range 0-255. The initial value is 0 @@ -501,7 +501,7 @@ STATIC mp_obj_t _cleartag(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(cleartag_obj, _cleartag); -//| def ColorA(self, alpha: int) -> Any: +//| def ColorA(self, alpha: int) -> None: //| """Set the current color alpha //| //| :param int alpha: alpha for the current color. Range 0-255. The initial value is 255 @@ -517,7 +517,7 @@ STATIC mp_obj_t _colora(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(colora_obj, _colora); -//| def ColorMask(self, r: int, g: int, b: int, a: int) -> Any: +//| def ColorMask(self, r: int, g: int, b: int, a: int) -> None: //| """Enable and disable writing of frame buffer color components //| //| :param int r: allow updates to the frame buffer red component. Range 0-1. The initial value is 1 @@ -539,7 +539,7 @@ STATIC mp_obj_t _colormask(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(colormask_obj, 5, 5, _colormask); -//| def ColorRGB(self, red: int, green: int, blue: int) -> Any: +//| def ColorRGB(self, red: int, green: int, blue: int) -> None: //| """Set the drawing color //| //| :param int red: red value for the current color. Range 0-255. The initial value is 255 @@ -584,7 +584,7 @@ STATIC mp_obj_t _end(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(end_obj, _end); -//| def Jump(self, dest: int) -> Any: +//| def Jump(self, dest: int) -> None: //| """Execute commands at another location in the display list //| //| :param int dest: display list address. Range 0-65535""" @@ -598,7 +598,7 @@ STATIC mp_obj_t _jump(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(jump_obj, _jump); -//| def LineWidth(self, width: int) -> Any: +//| def LineWidth(self, width: int) -> None: //| """Set the width of rasterized lines //| //| :param int width: line width in :math:`1/16` pixel. Range 0-4095. The initial value is 16 @@ -614,7 +614,7 @@ STATIC mp_obj_t _linewidth(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(linewidth_obj, _linewidth); -//| def Macro(self, m: int) -> Any: +//| def Macro(self, m: int) -> None: //| """Execute a single command from a macro register //| //| :param int m: macro register to read. Range 0-1""" @@ -640,7 +640,7 @@ STATIC mp_obj_t _nop(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(nop_obj, _nop); -//| def PaletteSource(self, addr: int) -> Any: +//| def PaletteSource(self, addr: int) -> None: //| """Set the base address of the palette //| //| :param int addr: Address in graphics SRAM, 2-byte aligned. Range 0-4194303. The initial value is 0 @@ -656,7 +656,7 @@ STATIC mp_obj_t _palettesource(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(palettesource_obj, _palettesource); -//| def PointSize(self, size: int) -> Any: +//| def PointSize(self, size: int) -> None: //| """Set the radius of rasterized points //| //| :param int size: point radius in :math:`1/16` pixel. Range 0-8191. The initial value is 16 @@ -708,7 +708,7 @@ STATIC mp_obj_t _savecontext(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(savecontext_obj, _savecontext); -//| def ScissorSize(self, width: int, height: int) -> Any: +//| def ScissorSize(self, width: int, height: int) -> None: //| """Set the size of the scissor clip rectangle //| //| :param int width: The width of the scissor clip rectangle, in pixels. Range 0-4095. The initial value is hsize @@ -726,7 +726,7 @@ STATIC mp_obj_t _scissorsize(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(scissorsize_obj, _scissorsize); -//| def ScissorXY(self, x: int, y: int) -> Any: +//| def ScissorXY(self, x: int, y: int) -> None: //| """Set the top left corner of the scissor clip rectangle //| //| :param int x: The :math:`x` coordinate of the scissor clip rectangle, in pixels. Range 0-2047. The initial value is 0 @@ -744,7 +744,7 @@ STATIC mp_obj_t _scissorxy(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(scissorxy_obj, _scissorxy); -//| def StencilFunc(self, func: int, ref: int, mask: int) -> Any: +//| def StencilFunc(self, func: int, ref: int, mask: int) -> None: //| """Set function and reference value for stencil testing //| //| :param int func: specifies the test function, one of ``NEVER``, ``LESS``, ``LEQUAL``, ``GREATER``, ``GEQUAL``, ``EQUAL``, ``NOTEQUAL``, or ``ALWAYS``. Range 0-7. The initial value is ALWAYS(7) @@ -764,7 +764,7 @@ STATIC mp_obj_t _stencilfunc(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(stencilfunc_obj, 4, 4, _stencilfunc); -//| def StencilMask(self, mask: int) -> Any: +//| def StencilMask(self, mask: int) -> None: //| """Control the writing of individual bits in the stencil planes //| //| :param int mask: the mask used to enable writing stencil bits. Range 0-255. The initial value is 255 @@ -780,7 +780,7 @@ STATIC mp_obj_t _stencilmask(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(stencilmask_obj, _stencilmask); -//| def StencilOp(self, sfail: int, spass: int) -> Any: +//| def StencilOp(self, sfail: int, spass: int) -> None: //| """Set stencil test actions //| //| :param int sfail: specifies the action to take when the stencil test fails, one of ``KEEP``, ``ZERO``, ``REPLACE``, ``INCR``, ``INCR_WRAP``, ``DECR``, ``DECR_WRAP``, and ``INVERT``. Range 0-7. The initial value is KEEP(1) @@ -798,7 +798,7 @@ STATIC mp_obj_t _stencilop(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(stencilop_obj, _stencilop); -//| def TagMask(self, mask: int) -> Any: +//| def TagMask(self, mask: int) -> None: //| """Control the writing of the tag buffer //| //| :param int mask: allow updates to the tag buffer. Range 0-1. The initial value is 1 @@ -814,7 +814,7 @@ STATIC mp_obj_t _tagmask(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(tagmask_obj, _tagmask); -//| def Tag(self, s: int) -> Any: +//| def Tag(self, s: int) -> None: //| """Set the current tag value //| //| :param int s: tag value. Range 0-255. The initial value is 255 @@ -830,7 +830,7 @@ STATIC mp_obj_t _tag(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(tag_obj, _tag); -//| def VertexTranslateX(self, x: int) -> Any: +//| def VertexTranslateX(self, x: int) -> None: //| """Set the vertex transformation's x translation component //| //| :param int x: signed x-coordinate in :math:`1/16` pixel. Range 0-131071. The initial value is 0 @@ -846,7 +846,7 @@ STATIC mp_obj_t _vertextranslatex(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(vertextranslatex_obj, _vertextranslatex); -//| def VertexTranslateY(self, y: int) -> Any: +//| def VertexTranslateY(self, y: int) -> None: //| """Set the vertex transformation's y translation component //| //| :param int y: signed y-coordinate in :math:`1/16` pixel. Range 0-131071. The initial value is 0 @@ -863,7 +863,7 @@ STATIC mp_obj_t _vertextranslatey(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(vertextranslatey_obj, _vertextranslatey); -//| def VertexFormat(self, frac: int) -> Any: +//| def VertexFormat(self, frac: int) -> None: //| """Set the precision of vertex2f coordinates //| //| :param int frac: Number of fractional bits in X,Y coordinates, 0-4. Range 0-7. The initial value is 4 @@ -879,7 +879,7 @@ STATIC mp_obj_t _vertexformat(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(vertexformat_obj, _vertexformat); -//| def Vertex2ii(self, x: int, y: int, handle: int, cell: int) -> Any: +//| def Vertex2ii(self, x: int, y: int, handle: int, cell: int) -> None: //| """:param int x: x-coordinate in pixels. Range 0-511 //| :param int y: y-coordinate in pixels. Range 0-511 //| :param int handle: bitmap handle. Range 0-31 @@ -954,7 +954,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(vertex2ii_obj, 3, 5, _vertex2ii); // Hand-written functions { -//| def Vertex2f(self, b: Any) -> Any: +//| def Vertex2f(self, b: float) -> None: //| """Draw a point. //| //| :param float x: pixel x-coordinate @@ -973,7 +973,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_3(vertex2f_obj, _vertex2f); #define ADD_X(self, x) \ common_hal__eve_add(EVEHAL(self), sizeof(x), &(x)); -//| def cmd0(self, n: int) -> Any: +//| def cmd0(self, n: int) -> None: //| """Append the command word n to the FIFO //| //| :param int n: The command code @@ -990,7 +990,7 @@ STATIC mp_obj_t _cmd0(mp_obj_t self, mp_obj_t n) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(cmd0_obj, _cmd0); -//| def cmd(self, n: int, fmt: str, args: tuple) -> Any: +//| def cmd(self, n: int, fmt: str, args: tuple) -> None: //| """Append a command packet to the FIFO. //| //| :param int n: The command code From 591cc1a24350e52a9a46204219f8aa647ec7f9d8 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 15:04:43 -0400 Subject: [PATCH 0219/1293] Added type hints to math --- shared-bindings/math/__init__.c | 78 ++++++++++++++++----------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c index 8226a08ecb..c76fe7e01e 100644 --- a/shared-bindings/math/__init__.c +++ b/shared-bindings/math/__init__.c @@ -79,108 +79,108 @@ STATIC NORETURN void math_error(void) { #define log2(x) (log(x) * 1.442695040888963407354163704) #endif -//| e: Any = ... +//| e: float = ... //| """base of the natural logarithm""" //| -//| pi: Any = ... +//| pi: float = ... //| """the ratio of a circle's circumference to its diameter""" //| -//| def acos(x: Any) -> Any: +//| def acos(x: float) -> float: //| """Return the inverse cosine of ``x``.""" //| ... //| -//| def asin(x: Any) -> Any: +//| def asin(x: float) -> float: //| """Return the inverse sine of ``x``.""" //| ... //| -//| def atan(x: Any) -> Any: +//| def atan(x: float) -> float: //| """Return the inverse tangent of ``x``.""" //| ... //| -//| def atan2(y: Any, x: Any) -> Any: +//| def atan2(y: float, x: float) -> float: //| """Return the principal value of the inverse tangent of ``y/x``.""" //| ... //| -//| def ceil(x: Any) -> Any: +//| def ceil(x: float) -> int: //| """Return an integer, being ``x`` rounded towards positive infinity.""" //| ... //| -//| def copysign(x: Any, y: Any) -> Any: +//| def copysign(x: float, y: float) -> float: //| """Return ``x`` with the sign of ``y``.""" //| ... //| -//| def cos(x: Any) -> Any: +//| def cos(x: float) -> float: //| """Return the cosine of ``x``.""" //| ... //| -//| def degrees(x: Any) -> Any: +//| def degrees(x: float) -> float: //| """Return radians ``x`` converted to degrees.""" //| ... //| -//| def exp(x: Any) -> Any: +//| def exp(x: float) -> float: //| """Return the exponential of ``x``.""" //| ... //| -//| def fabs(x: Any) -> Any: +//| def fabs(x: float) -> float: //| """Return the absolute value of ``x``.""" //| ... //| -//| def floor(x: Any) -> Any: +//| def floor(x: float) -> float: //| """Return an integer, being ``x`` rounded towards negative infinity.""" //| ... //| -//| def fmod(x: Any, y: Any) -> Any: +//| def fmod(x: float, y: float) -> int: //| """Return the remainder of ``x/y``.""" //| ... //| -//| def frexp(x: Any) -> Any: +//| def frexp(x: float) -> Tuple[int, int]: //| """Decomposes a floating-point number into its mantissa and exponent. //| The returned value is the tuple ``(m, e)`` such that ``x == m * 2**e`` //| exactly. If ``x == 0`` then the function returns ``(0.0, 0)``, otherwise //| the relation ``0.5 <= abs(m) < 1`` holds.""" //| ... //| -//| def isfinite(x: Any) -> Any: +//| def isfinite(x: float) -> bool: //| """Return ``True`` if ``x`` is finite.""" //| ... //| -//| def isinf(x: Any) -> Any: +//| def isinf(x: float) -> bool: //| """Return ``True`` if ``x`` is infinite.""" //| ... //| -//| def isnan(x: Any) -> Any: +//| def isnan(x: float) -> bool: //| """Return ``True`` if ``x`` is not-a-number""" //| ... //| -//| def ldexp(x: Any, exp: Any) -> Any: +//| def ldexp(x: float, exp: float) -> float: //| """Return ``x * (2**exp)``.""" //| ... //| -//| def modf(x: Any) -> Any: +//| def modf(x: float) -> Tuple[float, float]: //| """Return a tuple of two floats, being the fractional and integral parts of //| ``x``. Both return values have the same sign as ``x``.""" //| ... //| -//| def pow(x: Any, y: Any) -> Any: +//| def pow(x: float, y: float) -> float: //| """Returns ``x`` to the power of ``y``.""" //| -//| def radians(x: Any) -> Any: +//| def radians(x: float) -> float: //| """Return degrees ``x`` converted to radians.""" //| -//| def sin(x: Any) -> Any: +//| def sin(x: float) -> float: //| """Return the sine of ``x``.""" //| ... //| -//| def sqrt(x: Any) -> Any: +//| def sqrt(x: float) -> float: //| """Returns the square root of ``x``.""" //| ... //| -//| def tan(x: Any) -> Any: +//| def tan(x: float) -> float: //| """Return the tangent of ``x``.""" //| ... //| -//| def trunc(x: Any) -> Any: +//| def trunc(x: float) -> int: //| """Return an integer, being ``x`` rounded towards 0.""" //| ... //| @@ -190,55 +190,55 @@ MATH_FUN_2(pow, pow) MATH_FUN_1(exp, exp) #if MICROPY_PY_MATH_SPECIAL_FUNCTIONS -//| def expm1(x): +//| def expm1(x: float) -> float: //| """Return ``exp(x) - 1``.""" //| ... //| MATH_FUN_1(expm1, expm1) -//| def log2(x): +//| def log2(x: float) -> float: //| """Return the base-2 logarithm of ``x``.""" //| ... //| MATH_FUN_1_ERRCOND(log2, log2, (x <= (mp_float_t)0.0)) -//| def log10(x): +//| def log10(x: float) -> float: //| """Return the base-10 logarithm of ``x``.""" //| ... //| MATH_FUN_1_ERRCOND(log10, log10, (x <= (mp_float_t)0.0)) -//| def cosh(x): +//| def cosh(x: float) -> float: //| """Return the hyperbolic cosine of ``x``.""" //| ... //| MATH_FUN_1(cosh, cosh) -//| def sinh(x): +//| def sinh(x: float) -> float: //| """Return the hyperbolic sine of ``x``.""" //| ... //| MATH_FUN_1(sinh, sinh) -//| def tanh(x): +//| def tanh(x: float) -> float: //| """Return the hyperbolic tangent of ``x``.""" //| ... //| MATH_FUN_1(tanh, tanh) -//| def acosh(x): +//| def acosh(x: float) -> float: //| """Return the inverse hyperbolic cosine of ``x``.""" //| ... //| MATH_FUN_1(acosh, acosh) -//| def asinh(x): +//| def asinh(x: float) -> float: //| """Return the inverse hyperbolic sine of ``x``.""" //| ... //| MATH_FUN_1(asinh, asinh) -//| def atanh(x): +//| def atanh(x: float) -> float: //| """Return the inverse hyperbolic tangent of ``x``.""" //| ... //| @@ -280,25 +280,25 @@ MATH_FUN_1_TO_INT(trunc, trunc) MATH_FUN_2(ldexp, ldexp) #if MICROPY_PY_MATH_SPECIAL_FUNCTIONS -//| def erf(x): +//| def erf(x: float) -> float: //| """Return the error function of ``x``.""" //| ... //| MATH_FUN_1(erf, erf) -//| def erfc(x): +//| def erfc(x: float) -> float: //| """Return the complementary error function of ``x``.""" //| ... //| MATH_FUN_1(erfc, erfc) -//| def gamma(x): +//| def gamma(x: float) -> float: //| """Return the gamma function of ``x``.""" //| ... //| MATH_FUN_1(gamma, tgamma) -//| def lgamma(x): +//| def lgamma(x: float) -> float: //| """Return the natural logarithm of the gamma function of ``x``.""" //| ... //| From 9122d0b9f41181ac726781fc4238ca5212415a75 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 15:08:16 -0400 Subject: [PATCH 0220/1293] Added type hints to multiterminal --- shared-bindings/multiterminal/__init__.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/multiterminal/__init__.c b/shared-bindings/multiterminal/__init__.c index baf2fb6749..e4d6768ada 100644 --- a/shared-bindings/multiterminal/__init__.c +++ b/shared-bindings/multiterminal/__init__.c @@ -37,7 +37,7 @@ //| serial connection and the optional secondary connection.""" //| -//| def get_secondary_terminal() -> Any: +//| def get_secondary_terminal() -> secondary_terminal: //| """Returns the current secondary terminal.""" //| ... //| @@ -46,7 +46,7 @@ STATIC mp_obj_t multiterminal_obj_get_secondary_terminal() { } MP_DEFINE_CONST_FUN_OBJ_0(multiterminal_get_secondary_terminal_obj, multiterminal_obj_get_secondary_terminal); -//| def set_secondary_terminal(stream: stream) -> Any: +//| def set_secondary_terminal(stream: stream) -> None: //| """Read additional input from the given stream and write out back to it. //| This doesn't replace the core stream (usually UART or native USB) but is //| mixed in instead. @@ -68,7 +68,7 @@ STATIC mp_obj_t multiterminal_obj_set_secondary_terminal(mp_obj_t secondary_term } MP_DEFINE_CONST_FUN_OBJ_1(multiterminal_set_secondary_terminal_obj, multiterminal_obj_set_secondary_terminal); -//| def clear_secondary_terminal() -> Any: +//| def clear_secondary_terminal() -> None: //| """Clears the secondary terminal.""" //| ... //| @@ -78,7 +78,7 @@ STATIC mp_obj_t multiterminal_obj_clear_secondary_terminal() { } MP_DEFINE_CONST_FUN_OBJ_0(multiterminal_clear_secondary_terminal_obj, multiterminal_obj_clear_secondary_terminal); -//| def schedule_secondary_terminal_read(socket: Any) -> Any: +//| def schedule_secondary_terminal_read(socket: secondary_terminal) -> None: //| """In cases where the underlying OS is doing task scheduling, this notifies //| the OS when more data is available on the socket to read. This is useful //| as a callback for lwip sockets.""" From aaa550b33e7f9e7068deb60d1864f5bab00fb06f Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 15:10:56 -0400 Subject: [PATCH 0221/1293] Added type hints to network --- shared-bindings/network/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/network/__init__.c b/shared-bindings/network/__init__.c index 6af86688eb..10255ee86e 100644 --- a/shared-bindings/network/__init__.c +++ b/shared-bindings/network/__init__.c @@ -44,7 +44,7 @@ //| It is used by the 'socket' module to look up a suitable //| NIC when a socket is created.""" //| -//| def route() -> Any: +//| def route() -> list: //| """Returns a list of all configured NICs.""" //| ... //| From e237dfe3c5dc455c2236e530e4d64438c7c52a18 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 15:18:44 -0400 Subject: [PATCH 0222/1293] Added type hints to os --- shared-bindings/os/__init__.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/shared-bindings/os/__init__.c b/shared-bindings/os/__init__.c index 4e991d089d..268bf345e2 100644 --- a/shared-bindings/os/__init__.c +++ b/shared-bindings/os/__init__.c @@ -44,7 +44,7 @@ //| other way around.""" //| -//| def uname() -> Any: +//| def uname() -> tuple: //| """Returns a named tuple of operating specific and CircuitPython port //| specific information.""" //| ... @@ -54,7 +54,7 @@ STATIC mp_obj_t os_uname(void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(os_uname_obj, os_uname); -//| def chdir(path: Any) -> Any: +//| def chdir(path: string) -> None: //| """Change current directory.""" //| ... //| @@ -65,7 +65,7 @@ mp_obj_t os_chdir(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_chdir_obj, os_chdir); -//| def getcwd() -> Any: +//| def getcwd() -> string: //| """Get the current directory.""" //| ... //| @@ -74,7 +74,7 @@ mp_obj_t os_getcwd(void) { } MP_DEFINE_CONST_FUN_OBJ_0(os_getcwd_obj, os_getcwd); -//| def listdir(dir: Any) -> Any: +//| def listdir(dir: string) -> string: //| """With no argument, list the current directory. Otherwise list the given directory.""" //| ... //| @@ -89,7 +89,7 @@ mp_obj_t os_listdir(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(os_listdir_obj, 0, 1, os_listdir); -//| def mkdir(path: Any) -> Any: +//| def mkdir(path: string) -> None: //| """Create a new directory.""" //| ... //| @@ -100,7 +100,7 @@ mp_obj_t os_mkdir(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_mkdir_obj, os_mkdir); -//| def remove(path: Any) -> Any: +//| def remove(path: string) -> None: //| """Remove a file.""" //| ... //| @@ -111,7 +111,7 @@ mp_obj_t os_remove(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_remove_obj, os_remove); -//| def rmdir(path: Any) -> Any: +//| def rmdir(path: string) -> None: //| """Remove a directory.""" //| ... //| @@ -123,7 +123,7 @@ mp_obj_t os_rename(mp_obj_t old_path_in, mp_obj_t new_path_in) { } MP_DEFINE_CONST_FUN_OBJ_2(os_rename_obj, os_rename); -//| def rename(old_path: Any, new_path: Any) -> Any: +//| def rename(old_path: string, new_path: string) -> string: //| """Rename a file.""" //| ... //| @@ -134,7 +134,7 @@ mp_obj_t os_rmdir(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_rmdir_obj, os_rmdir); -//| def stat(path: Any) -> Any: +//| def stat(path: string) -> string: //| """Get the status of a file or directory. //| //| .. note:: On builds without long integers, the number of seconds @@ -149,7 +149,7 @@ mp_obj_t os_stat(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_stat_obj, os_stat); -//| def statvfs(path: Any) -> Any: +//| def statvfs(path: string) -> Tuple[string, string, string, string, string, string, string, string, string, string]: //| """Get the status of a fileystem. //| //| Returns a tuple with the filesystem information in the following order: @@ -176,7 +176,7 @@ mp_obj_t os_statvfs(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_statvfs_obj, os_statvfs); -//| def sync() -> Any: +//| def sync() -> None: //| """Sync all filesystems.""" //| ... //| @@ -189,7 +189,7 @@ STATIC mp_obj_t os_sync(void) { } MP_DEFINE_CONST_FUN_OBJ_0(os_sync_obj, os_sync); -//| def urandom(size: Any) -> Any: +//| def urandom(size: int) -> string: //| """Returns a string of *size* random bytes based on a hardware True Random //| Number Generator. When not available, it will raise a NotImplementedError.""" //| ... From 97d405e1094ac4d9e34ca155ecebf45ff1ad0f40 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 15:25:58 -0400 Subject: [PATCH 0223/1293] Added type hints to random --- shared-bindings/random/__init__.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/shared-bindings/random/__init__.c b/shared-bindings/random/__init__.c index c0124df417..10ddca4991 100644 --- a/shared-bindings/random/__init__.c +++ b/shared-bindings/random/__init__.c @@ -47,7 +47,7 @@ //| bytes from `os.urandom` directly for true randomness.""" //| -//| def seed(seed: Any) -> Any: +//| def seed(seed: int) -> None: //| """Sets the starting seed of the random number generation. Further calls to //| `random` will return deterministic results afterwards.""" //| ... @@ -59,7 +59,7 @@ STATIC mp_obj_t random_seed(mp_obj_t seed_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(random_seed_obj, random_seed); -//| def getrandbits(k: Any) -> Any: +//| def getrandbits(k: int) -> int: //| """Returns an integer with *k* random bits.""" //| ... //| @@ -72,7 +72,7 @@ STATIC mp_obj_t random_getrandbits(mp_obj_t num_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(random_getrandbits_obj, random_getrandbits); -//| def randrange(stop: Any) -> Any: +//| def randrange(stop: Tuple[int, int, int]) -> int: //| """Returns a randomly selected integer from ``range(start, stop, step)``.""" //| ... //| @@ -114,7 +114,7 @@ STATIC mp_obj_t random_randrange(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(random_randrange_obj, 1, 3, random_randrange); -//| def randint(a: Any, b: Any) -> Any: +//| def randint(a: int, b: int) -> int: //| """Returns a randomly selected integer between a and b inclusive. Equivalent //| to ``randrange(a, b + 1, 1)``""" //| ... @@ -129,7 +129,7 @@ STATIC mp_obj_t random_randint(mp_obj_t a_in, mp_obj_t b_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(random_randint_obj, random_randint); -//| def choice(seq: Any) -> Any: +//| def choice(seq: list) -> Any: //| """Returns a randomly selected element from the given sequence. Raises //| IndexError when the sequence is empty.""" //| ... @@ -143,7 +143,7 @@ STATIC mp_obj_t random_choice(mp_obj_t seq) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(random_choice_obj, random_choice); -//| def random() -> Any: +//| def random() -> float: //| """Returns a random float between 0 and 1.0.""" //| ... //| @@ -152,7 +152,7 @@ STATIC mp_obj_t random_random(void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(random_random_obj, random_random); -//| def uniform(a: Any, b: Any) -> Any: +//| def uniform(a: float, b: float) -> float: //| """Returns a random float between a and b. It may or may not be inclusive //| depending on float rounding.""" //| ... From a88004e509985da055a5837a42e42a37e5cfd371 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 15:27:11 -0400 Subject: [PATCH 0224/1293] Added type hints to rtc --- shared-bindings/rtc/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/rtc/__init__.c b/shared-bindings/rtc/__init__.c index b204d511c9..02b9beba66 100644 --- a/shared-bindings/rtc/__init__.c +++ b/shared-bindings/rtc/__init__.c @@ -50,7 +50,7 @@ mp_obj_t rtc_get_time_source_time(void) { return struct_time_from_tm(&tm); } -//| def set_time_source(rtc: Any) -> Any: +//| def set_time_source(rtc: RTC) -> None: //| """Sets the RTC time source used by :func:`time.localtime`. //| The default is :class:`rtc.RTC`, but it's useful to use this to override the //| time source for testing purposes. For example:: From 45b6e0174e386ad8bd6c0180a3e406f6c21f87d7 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 15:38:40 -0400 Subject: [PATCH 0225/1293] Added type hints to storage --- shared-bindings/storage/__init__.c | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c index 0a34ef74e9..5ca124892a 100644 --- a/shared-bindings/storage/__init__.c +++ b/shared-bindings/storage/__init__.c @@ -43,7 +43,7 @@ //| directly.""" //| -//| def mount(filesystem: Any, mount_path: Any, *, readonly: bool = False) -> Any: +//| def mount(filesystem: VfsFat, mount_path: string, *, readonly: bool = False) -> None: //| """Mounts the given filesystem object at the given path. //| //| This is the CircuitPython analog to the UNIX ``mount`` command. @@ -80,7 +80,7 @@ mp_obj_t storage_mount(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_arg } MP_DEFINE_CONST_FUN_OBJ_KW(storage_mount_obj, 2, storage_mount); -//| def umount(mount: Any) -> Any: +//| def umount(mount: Union[string, VfsFat]) -> None: //| """Unmounts the given filesystem object or if *mount* is a path, then unmount //| the filesystem mounted at that location. //| @@ -98,7 +98,7 @@ mp_obj_t storage_umount(mp_obj_t mnt_in) { } MP_DEFINE_CONST_FUN_OBJ_1(storage_umount_obj, storage_umount); -//| def remount(mount_path: Any, readonly: bool = False, *, disable_concurrent_write_protection: bool = False) -> Any: +//| def remount(mount_path: string, readonly: bool = False, *, disable_concurrent_write_protection: bool = False) -> None: //| """Remounts the given path with new parameters. //| //| :param bool readonly: True when the filesystem should be readonly to CircuitPython. @@ -128,7 +128,7 @@ mp_obj_t storage_remount(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_a } MP_DEFINE_CONST_FUN_OBJ_KW(storage_remount_obj, 1, storage_remount); -//| def getmount(mount_path: Any) -> Any: +//| def getmount(mount_path: string) -> VfsFat: //| """Retrieves the mount object associated with the mount path""" //| ... //| @@ -137,7 +137,7 @@ mp_obj_t storage_getmount(const mp_obj_t mnt_in) { } MP_DEFINE_CONST_FUN_OBJ_1(storage_getmount_obj, storage_getmount); -//| def erase_filesystem() -> Any: +//| def erase_filesystem() -> None: //| """Erase and re-create the ``CIRCUITPY`` filesystem. //| //| On boards that present USB-visible ``CIRCUITPY`` drive (e.g., SAMD21 and SAMD51), @@ -168,51 +168,51 @@ STATIC const mp_rom_map_elem_t storage_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_erase_filesystem), MP_ROM_PTR(&storage_erase_filesystem_obj) }, //| class VfsFat: -//| def __init__(self, block_device: Any) -> None: +//| def __init__(self, block_device: string) -> None: //| """Create a new VfsFat filesystem around the given block device. //| //| :param block_device: Block device the the filesystem lives on""" //| -//| label: Any = ... +//| label: string = ... //| """The filesystem label, up to 11 case-insensitive bytes. Note that //| this property can only be set when the device is writable by the //| microcontroller.""" //| ... //| -//| def mkfs(self) -> Any: +//| def mkfs(self) -> None: //| """Format the block device, deleting any data that may have been there""" //| ... //| -//| def open(self, path: Any, mode: Any) -> Any: +//| def open(self, path: string, mode: string) -> None: //| """Like builtin ``open()``""" //| ... //| -//| def ilistdir(self, path: Any) -> Any: +//| def ilistdir(self, path: string) -> iterator: //| """Return an iterator whose values describe files and folders within //| ``path``""" //| ... //| -//| def mkdir(self, path: Any) -> Any: +//| def mkdir(self, path: string) -> None: //| """Like `os.mkdir`""" //| ... //| -//| def rmdir(self, path: Any) -> Any: +//| def rmdir(self, path: string) -> None: //| """Like `os.rmdir`""" //| ... //| -//| def stat(self, path: Any) -> Any: +//| def stat(self, path: string) -> string: //| """Like `os.stat`""" //| ... //| -//| def statvfs(self, path: Any) -> Any: +//| def statvfs(self, path: string) -> Tuple[string, string, string, string, string, string, string, string, string, string]: //| """Like `os.statvfs`""" //| ... //| -//| def mount(self, readonly: Any, mkfs: Any) -> Any: +//| def mount(self, readonly: bool, mkfs: VfsFat) -> None: //| """Don't call this directly, call `storage.mount`.""" //| ... //| -//| def umount(self) -> Any: +//| def umount(self) -> None: //| """Don't call this directly, call `storage.umount`.""" //| ... //| From 4758081e10b1289ccc2b1224e711f2eef4bed829 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 15:45:29 -0400 Subject: [PATCH 0226/1293] Added type hints to struct --- shared-bindings/struct/__init__.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/struct/__init__.c b/shared-bindings/struct/__init__.c index 256b385c8e..607ddf0d5c 100644 --- a/shared-bindings/struct/__init__.c +++ b/shared-bindings/struct/__init__.c @@ -62,7 +62,7 @@ STATIC mp_obj_t struct_calcsize(mp_obj_t fmt_in) { } MP_DEFINE_CONST_FUN_OBJ_1(struct_calcsize_obj, struct_calcsize); -//| def pack(fmt: Any, *values: Any) -> Any: +//| def pack(fmt: string, *values: ReadableBuffer) -> bytes: //| """Pack the values according to the format string fmt. //| The return value is a bytes object encoding the values.""" //| ... @@ -80,7 +80,7 @@ STATIC mp_obj_t struct_pack(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(struct_pack_obj, 1, MP_OBJ_FUN_ARGS_MAX, struct_pack); -//| def pack_into(fmt: Any, buffer: Any, offset: Any, *values: Any) -> Any: +//| def pack_into(fmt: string, buffer: WriteableBuffer, offset: int, *values: readableBuffer) -> None: //| """Pack the values according to the format string fmt into a buffer //| starting at offset. offset may be negative to count from the end of buffer.""" //| ... @@ -106,7 +106,7 @@ STATIC mp_obj_t struct_pack_into(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(struct_pack_into_obj, 3, MP_OBJ_FUN_ARGS_MAX, struct_pack_into); -//| def unpack(fmt: Any, data: Any) -> Any: +//| def unpack(fmt: string, data: ReadableBuffer) -> tuple: //| """Unpack from the data according to the format string fmt. The return value //| is a tuple of the unpacked values. The buffer size must match the size //| required by the format.""" @@ -124,7 +124,7 @@ STATIC mp_obj_t struct_unpack(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(struct_unpack_obj, 2, 3, struct_unpack); -//| def unpack_from(fmt: Any, data: Any, offset: Any = 0) -> Any: +//| def unpack_from(fmt: string, data: ReadableBuffer, offset: int = 0) -> tuple: //| """Unpack from the data starting at offset according to the format string fmt. //| offset may be negative to count from the end of buffer. The return value is //| a tuple of the unpacked values. The buffer size must be at least as big From 4c5a9d1e3aa9412693a6a6e4221bf3a85b8a5e62 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 15:49:51 -0400 Subject: [PATCH 0227/1293] Added type hints to time --- shared-bindings/time/__init__.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 9b68bdd8d0..54f51b0b9a 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -42,7 +42,7 @@ //| written in MicroPython will work in CPython but not necessarily the other //| way around.""" //| -//| def monotonic() -> Any: +//| def monotonic() -> float: //| """Returns an always increasing value of time with an unknown reference //| point. Only use it to compare against other values from `monotonic`. //| @@ -57,7 +57,7 @@ STATIC mp_obj_t time_monotonic(void) { } MP_DEFINE_CONST_FUN_OBJ_0(time_monotonic_obj, time_monotonic); -//| def sleep(seconds: float) -> Any: +//| def sleep(seconds: float) -> None: //| """Sleep for a given number of seconds. //| //| :param float seconds: the time to sleep in fractional seconds""" @@ -93,7 +93,7 @@ mp_obj_t struct_time_make_new(const mp_obj_type_t *type, size_t n_args, const mp } //| class struct_time: -//| def __init__(self, time_tuple: Any) -> None: +//| def __init__(self, time_tuple: tuple) -> None: //| """Structure used to capture a date and time. Note that it takes a tuple! //| //| :param tuple time_tuple: Tuple of time info: ``(tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec, tm_wday, tm_yday, tm_isdst)`` @@ -198,7 +198,7 @@ mp_obj_t MP_WEAK rtc_get_time_source_time(void) { mp_raise_RuntimeError(translate("RTC is not supported on this board")); } -//| def time() -> Any: +//| def time() -> int: //| """Return the current time in seconds since since Jan 1, 1970. //| //| :return: the current time @@ -214,7 +214,7 @@ STATIC mp_obj_t time_time(void) { } MP_DEFINE_CONST_FUN_OBJ_0(time_time_obj, time_time); -//| def monotonic_ns() -> Any: +//| def monotonic_ns() -> int: //| """Return the time of the specified clock clk_id in nanoseconds. //| //| :return: the current time @@ -227,7 +227,7 @@ STATIC mp_obj_t time_monotonic_ns(void) { } MP_DEFINE_CONST_FUN_OBJ_0(time_monotonic_ns_obj, time_monotonic_ns); -//| def localtime(secs: Any) -> Any: +//| def localtime(secs: int) -> struct_time: //| """Convert a time expressed in seconds since Jan 1, 1970 to a struct_time in //| local time. If secs is not provided or None, the current time as returned //| by time() is used. @@ -260,7 +260,7 @@ STATIC mp_obj_t time_localtime(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(time_localtime_obj, 0, 1, time_localtime); -//| def mktime(t: Any) -> Any: +//| def mktime(t: struct_time) -> int: //| """This is the inverse function of localtime(). Its argument is the //| struct_time or full 9-tuple (since the dst flag is needed; use -1 as the //| dst flag if it is unknown) which expresses the time in local time, not UTC. From 657c651e0efae2c9c4590e7c5cad5bb201fab3b4 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 15:51:39 -0400 Subject: [PATCH 0228/1293] Added type hints to uheap --- shared-bindings/uheap/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/uheap/__init__.c b/shared-bindings/uheap/__init__.c index f089f29221..0559d974ab 100644 --- a/shared-bindings/uheap/__init__.c +++ b/shared-bindings/uheap/__init__.c @@ -34,7 +34,7 @@ //| """Heap size analysis""" //| -//| def info(object: Any) -> Any: +//| def info(object: Any) -> int: //| """Prints memory debugging info for the given object and returns the //| estimated size.""" //| ... From 9911b64fa13442f552a9968cdf40d926b98de6f8 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 15:52:53 -0400 Subject: [PATCH 0229/1293] Added type hints to ustack --- shared-bindings/ustack/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/ustack/__init__.c b/shared-bindings/ustack/__init__.c index e5fac69417..de48c838a2 100644 --- a/shared-bindings/ustack/__init__.c +++ b/shared-bindings/ustack/__init__.c @@ -60,7 +60,7 @@ STATIC mp_obj_t stack_size(void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(stack_size_obj, stack_size); -//| def stack_usage() -> Any: +//| def stack_usage() -> int: //| """Return how much stack is currently in use. //| Same as micropython.stack_use(); duplicated here for convenience.""" //| ... From 50a6342f6d4a8f7fb776bd8a95fc6b2c7b5ed514 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 3 Jul 2020 12:54:48 -0700 Subject: [PATCH 0230/1293] Shrink files.json by using one space instead of four. Also: - Remove download count update because the files are no longer on GitHub. - Add "extensions" and "languages" to each board dictionary so we can stop using "files" entirely. --- tools/build_board_info.py | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 20a5866b7f..bbafe19f6a 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -153,7 +153,7 @@ def create_pr(changes, updated, git_info, user): info["id"] = id updated_list.append(info) - updated = json.dumps(updated_list, sort_keys=True, indent=4).encode("utf-8") + b"\n" + updated = json.dumps(updated_list, sort_keys=True, indent=1).encode("utf-8") + b"\n" #print(updated.decode("utf-8")) pr_title = "Automated website update for release {}".format(changes["new_release"]) boards = "" @@ -205,19 +205,6 @@ def create_pr(changes, updated, git_info, user): print(changes) print(pr_info) -def update_downloads(boards, release): - response = github.get("/repos/adafruit/circuitpython/releases/tags/{}".format(release)) - if not response.ok: - print(response.text) - raise RuntimeError("cannot get previous release info") - - assets = response.json()["assets"] - for asset in assets: - board_name = asset["name"].split("-")[2] - if board_name not in boards: - continue - boards[board_name]["download_count"] += asset["download_count"] - def print_active_user(): response = github.get("/user") @@ -269,9 +256,6 @@ def generate_download_info(): board_mapping = get_board_mapping() - for release in previous_releases: - update_downloads(board_mapping, release) - for port in SUPPORTED_PORTS: board_path = os.path.join("../ports", port, "boards") for board_path in os.scandir(board_path): @@ -291,7 +275,9 @@ def generate_download_info(): "stable": new_stable, "version": new_tag, "modules": support_matrix.get(alias, "[]"), - "files": {} + "files": {}, + "languages": languages, + "extensions": board_info["extensions"] } for language in languages: files = [] From bce77adecdbfd36006dbc97a50b67d05720c8135 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 3 Jul 2020 16:03:19 -0400 Subject: [PATCH 0231/1293] Added type hints previously missed --- shared-bindings/_pixelbuf/__init__.c | 2 +- shared-bindings/digitalio/Direction.c | 4 ++-- shared-bindings/digitalio/DriveMode.c | 4 ++-- shared-bindings/digitalio/Pull.c | 4 ++-- shared-bindings/displayio/__init__.c | 2 +- shared-bindings/microcontroller/__init__.c | 10 +++++----- shared-bindings/socket/__init__.c | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/shared-bindings/_pixelbuf/__init__.c b/shared-bindings/_pixelbuf/__init__.c index bfd479fde0..6038fdfdcc 100644 --- a/shared-bindings/_pixelbuf/__init__.c +++ b/shared-bindings/_pixelbuf/__init__.c @@ -41,7 +41,7 @@ //| Byteorders are configured with strings, such as "RGB" or "RGBD".""" // TODO: Pull in docs from pypixelbuf. -//| def colorwheel(n: int) -> Any: +//| def colorwheel(n: int) -> int: //| """C implementation of the common wheel() function found in many examples. //| Returns the colorwheel RGB value as an integer value for n (usable in :py:class:`PixelBuf`, neopixel, and dotstar).""" //| ... diff --git a/shared-bindings/digitalio/Direction.c b/shared-bindings/digitalio/Direction.c index 3798b3fa74..173ebfb2b4 100644 --- a/shared-bindings/digitalio/Direction.c +++ b/shared-bindings/digitalio/Direction.c @@ -46,10 +46,10 @@ //| going.""" //| ... //| -//| INPUT: Any = ... +//| INPUT: Direction = ... //| """Read digital data in""" //| -//| OUTPUT: Any = ... +//| OUTPUT: Direction = ... //| """Write digital data out""" //| const mp_obj_type_t digitalio_direction_type; diff --git a/shared-bindings/digitalio/DriveMode.c b/shared-bindings/digitalio/DriveMode.c index 208143a2fa..2f22029b0b 100644 --- a/shared-bindings/digitalio/DriveMode.c +++ b/shared-bindings/digitalio/DriveMode.c @@ -34,10 +34,10 @@ //| digital values.""" //| ... //| -//| PUSH_PULL: Any = ... +//| PUSH_PULL: DriveMode = ... //| """Output both high and low digital values""" //| -//| OPEN_DRAIN: Any = ... +//| OPEN_DRAIN: DriveMode = ... //| """Output low digital values but go into high z for digital high. This is //| useful for i2c and other protocols that share a digital line.""" //| diff --git a/shared-bindings/digitalio/Pull.c b/shared-bindings/digitalio/Pull.c index 9656811c89..87e2a8f1ee 100644 --- a/shared-bindings/digitalio/Pull.c +++ b/shared-bindings/digitalio/Pull.c @@ -34,11 +34,11 @@ //| digital values in.""" //| ... //| -//| UP: Any = ... +//| UP: Pull = ... //| """When the input line isn't being driven the pull up can pull the state //| of the line high so it reads as true.""" //| -//| DOWN: Any = ... +//| DOWN: Pull = ... //| """When the input line isn't being driven the pull down can pull the //| state of the line low so it reads as false.""" //| diff --git a/shared-bindings/displayio/__init__.c b/shared-bindings/displayio/__init__.c index b791336b56..16d068e2e5 100644 --- a/shared-bindings/displayio/__init__.c +++ b/shared-bindings/displayio/__init__.c @@ -50,7 +50,7 @@ //| -//| def release_displays() -> Any: +//| def release_displays() -> None: //| """Releases any actively used displays so their busses and pins can be used again. This will also //| release the builtin display on boards that have one. You will need to reinitialize it yourself //| afterwards. This may take seconds to complete if an active EPaperDisplay is refreshing. diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c index 88fe9c2245..6d556cdd75 100644 --- a/shared-bindings/microcontroller/__init__.c +++ b/shared-bindings/microcontroller/__init__.c @@ -54,7 +54,7 @@ //| This object is the sole instance of `microcontroller.Processor`.""" //| -//| def delay_us(delay: Any) -> Any: +//| def delay_us(delay: int) -> None: //| """Dedicated delay method used for very short delays. **Do not** do long delays //| because this stops all other functions from completing. Think of this as an empty //| ``while`` loop that runs for the specified ``(delay)`` time. If you have other @@ -72,7 +72,7 @@ STATIC mp_obj_t mcu_delay_us(mp_obj_t delay_obj) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(mcu_delay_us_obj, mcu_delay_us); -//| def disable_interrupts() -> Any: +//| def disable_interrupts() -> None: //| """Disable all interrupts. Be very careful, this can stall everything.""" //| ... //| @@ -82,7 +82,7 @@ STATIC mp_obj_t mcu_disable_interrupts(void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(mcu_disable_interrupts_obj, mcu_disable_interrupts); -//| def enable_interrupts() -> Any: +//| def enable_interrupts() -> None: //| """Enable the interrupts that were enabled at the last disable.""" //| ... //| @@ -92,7 +92,7 @@ STATIC mp_obj_t mcu_enable_interrupts(void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(mcu_enable_interrupts_obj, mcu_enable_interrupts); -//| def on_next_reset(run_mode: microcontroller.RunMode) -> Any: +//| def on_next_reset(run_mode: microcontroller.RunMode) -> None: //| """Configure the run mode used the next time the microcontroller is reset but //| not powered down. //| @@ -117,7 +117,7 @@ STATIC mp_obj_t mcu_on_next_reset(mp_obj_t run_mode_obj) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(mcu_on_next_reset_obj, mcu_on_next_reset); -//| def reset() -> Any: +//| def reset() -> None: //| """Reset the microcontroller. After reset, the microcontroller will enter the //| run mode last set by `on_next_reset`. //| diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c index 985104d553..64b1a538d8 100644 --- a/shared-bindings/socket/__init__.c +++ b/shared-bindings/socket/__init__.c @@ -509,7 +509,7 @@ STATIC const mp_obj_type_t socket_type = { .locals_dict = (mp_obj_dict_t*)&socket_locals_dict, }; -//| def getaddrinfo(host: Any, port: Any) -> Any: +//| def getaddrinfo(host: string, port: string) -> tuple: //| """Gets the address information for a hostname and port //| //| Returns the appropriate family, socket type, socket protocol and From 5375e546037ffa2d1c0b7b9cffbd56bc3472ab7e Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Fri, 3 Jul 2020 13:08:18 +0000 Subject: [PATCH 0232/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (778 of 778 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 99e59304c8..f25d2d86e6 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-02 15:29+0200\n" -"PO-Revision-Date: 2020-07-02 13:32+0000\n" +"PO-Revision-Date: 2020-07-03 22:53+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -615,7 +615,7 @@ msgstr "Não foi possível inicializar o GNSS" #: ports/cxd56/common-hal/sdioio/SDCard.c msgid "Could not initialize SDCard" -msgstr "" +msgstr "Não foi possível inicializar o SDCard" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" From 2345b57373eb3ad95ba72d65c076a735f28b605a Mon Sep 17 00:00:00 2001 From: oon arfiandwi Date: Sat, 4 Jul 2020 00:58:33 +0000 Subject: [PATCH 0233/1293] Translated using Weblate (Indonesian) Currently translated at 29.1% (227 of 778 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/id/ --- locale/ID.po | 150 ++++++++++++++++++++++++++------------------------- 1 file changed, 77 insertions(+), 73 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 44d3bfde29..390bfcd944 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -3,25 +3,28 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-02 15:29+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2020-07-04 02:34+0000\n" +"Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" -"Language: \n" +"Language: ID\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.2-dev\n" #: main.c msgid "" "\n" "Code done running. Waiting for reload.\n" msgstr "" +"\n" +"Kode selesai berjalan. Menunggu memuat ulang.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -29,20 +32,25 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"Harap ajukan masalah dengan konten drive CIRCUITPY Anda di\n" +"https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c msgid "" "\n" "To exit, please reset the board without " msgstr "" +"\n" +"Untuk keluar, harap setel ulang papan tanpa" #: py/obj.c msgid " File \"%q\"" -msgstr "" +msgstr "  File \"% q\"" #: py/obj.c msgid " File \"%q\", line %d" -msgstr "" +msgstr "  File \"% q\", baris% d" #: main.c msgid " output:\n" @@ -51,12 +59,12 @@ msgstr "output:\n" #: py/objstr.c #, c-format msgid "%%c requires int or char" -msgstr "" +msgstr "%%c harus int atau char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "" +msgstr "pin alamat %d dan pin rgb %d menunjukkan tinggi %d, bukan %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" @@ -64,39 +72,38 @@ msgstr "" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" -msgstr "" +msgstr "%q sedang digunakan" #: py/obj.c msgid "%q index out of range" -msgstr "" +msgstr "%q indeks di luar batas" #: py/obj.c msgid "%q indices must be integers, not %s" -msgstr "" +msgstr "indeks %q harus bilangan bulat, bukan %s" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "" +msgstr "daftar %q harus berupa daftar" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c #: shared-bindings/vectorio/Rectangle.c -#, fuzzy msgid "%q must be >= 1" -msgstr "buffers harus mempunyai panjang yang sama" +msgstr "%q harus >= 1" #: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "" +msgstr "%q harus berupa tuple dengan panjang 2" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q pin invalid" -msgstr "" +msgstr "pin %q tidak valid" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" -msgstr "" +msgstr "%q harus berupa int" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -109,7 +116,7 @@ msgstr "'%q' argumen dibutuhkan" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" -msgstr "" +msgstr "'%s' mengharapkan sebuah label" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -149,7 +156,7 @@ msgstr "'%s' mengharapkan {r0, r1, ...}" #: py/emitinlinextensa.c #, c-format msgid "'%s' integer %d is not within range %d..%d" -msgstr "" +msgstr "'%s' integer %d tidak dalam kisaran %d..%d" #: py/emitinlinethumb.c #, c-format @@ -158,40 +165,40 @@ msgstr "'%s' integer 0x%x tidak cukup didalam mask 0x%x" #: py/runtime.c msgid "'%s' object cannot assign attribute '%q'" -msgstr "" +msgstr "Objek '%s' tidak dapat menetapkan atribut '%q'" #: py/proto.c msgid "'%s' object does not support '%q'" -msgstr "" +msgstr "Objek '%s' tidak mendukung '%q'" #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" -msgstr "" +msgstr "Objek '%s' tidak mendukung penetapan item" #: py/obj.c #, c-format msgid "'%s' object does not support item deletion" -msgstr "" +msgstr "Objek '%s' tidak mendukung penghapusan item" #: py/runtime.c msgid "'%s' object has no attribute '%q'" -msgstr "" +msgstr "Objek '%s' tidak memiliki atribut '%q'" #: py/runtime.c #, c-format msgid "'%s' object is not an iterator" -msgstr "" +msgstr "Objek '%s' bukan iterator" #: py/objtype.c py/runtime.c #, c-format msgid "'%s' object is not callable" -msgstr "" +msgstr "Objek '%s' tidak dapat dipanggil" #: py/runtime.c #, c-format msgid "'%s' object is not iterable" -msgstr "" +msgstr "'%s' objek tidak dapat diulang" #: py/obj.c #, c-format @@ -200,11 +207,11 @@ msgstr "" #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" -msgstr "" +msgstr "'=' perataan tidak diizinkan dalam penentu format string" #: shared-module/struct/__init__.c msgid "'S' and 'O' are not supported format types" -msgstr "" +msgstr "'S' dan 'O' bukan tipe format yang didukung" #: py/compile.c msgid "'align' requires 1 argument" @@ -212,7 +219,7 @@ msgstr "'align' membutuhkan 1 argumen" #: py/compile.c msgid "'async for' or 'async with' outside async function" -msgstr "" +msgstr "'async for' atau 'async with' di luar fungsi async" #: py/compile.c msgid "'await' outside function" @@ -252,7 +259,7 @@ msgstr "*x harus menjadi target assignment" #: py/obj.c msgid ", in %q\n" -msgstr "" +msgstr ", dalam %q\n" #: py/objcomplex.c msgid "0.0 to a complex power" @@ -260,7 +267,7 @@ msgstr "" #: py/modbuiltins.c msgid "3-arg pow() not supported" -msgstr "" +msgstr "pow() 3-arg tidak didukung" #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -268,13 +275,13 @@ msgid "A hardware interrupt channel is already in use" msgstr "Sebuah channel hardware interrupt sedang digunakan" #: shared-bindings/_bleio/Address.c -#, fuzzy, c-format +#, c-format msgid "Address must be %d bytes long" -msgstr "buffers harus mempunyai panjang yang sama" +msgstr "Alamat harus sepanjang %d byte" #: shared-bindings/_bleio/Address.c msgid "Address type out of range" -msgstr "" +msgstr "Jenis alamat di luar batas" #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" @@ -285,9 +292,8 @@ msgid "All SPI peripherals are in use" msgstr "Semua perangkat SPI sedang digunakan" #: ports/nrf/common-hal/busio/UART.c -#, fuzzy msgid "All UART peripherals are in use" -msgstr "Semua perangkat I2C sedang digunakan" +msgstr "Semua perangkat UART sedang digunakan" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "All event channels in use" @@ -319,7 +325,7 @@ msgstr "" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" -msgstr "" +msgstr "AnalogIn tidak didukung pada pin yang diberikan" #: ports/cxd56/common-hal/analogio/AnalogOut.c #: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c @@ -329,7 +335,7 @@ msgstr "fungsionalitas AnalogOut tidak didukung" #: shared-bindings/analogio/AnalogOut.c msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "" +msgstr "AnalogOut hanya 16 bit. Nilai harus kurang dari 65536." #: ports/atmel-samd/common-hal/analogio/AnalogOut.c msgid "AnalogOut not supported on given pin" @@ -342,19 +348,19 @@ msgstr "Send yang lain sudah aktif" #: shared-bindings/pulseio/PulseOut.c msgid "Array must contain halfwords (type 'H')" -msgstr "" +msgstr "Array harus mengandung halfwords (ketik 'H')" #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." -msgstr "" +msgstr "Nilai array harus berupa byte tunggal." #: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" -msgstr "" +msgstr "Paling banyak %d %q dapat ditentukan (bukan %d)" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." -msgstr "" +msgstr "Mencoba alokasi heap ketika MicroPython VM tidak berjalan." #: main.c msgid "Auto-reload is off.\n" @@ -371,7 +377,7 @@ msgstr "" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" -msgstr "" +msgstr "Di bawah frame rate minimum" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" @@ -379,7 +385,7 @@ msgstr "Bit clock dan word harus memiliki kesamaan pada clock unit" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." -msgstr "" +msgstr "Kedalaman bit harus kelipatan 8." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" @@ -393,90 +399,89 @@ msgstr "Kedua pin harus mendukung hardware interrut" #: shared-bindings/framebufferio/FramebufferDisplay.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "" +msgstr "Brightness harus di antara 0-1.0" #: shared-bindings/supervisor/__init__.c msgid "Brightness must be between 0 and 255" -msgstr "" +msgstr "Brightness harus di antara 0 dan 255" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" -msgstr "" +msgstr "Brightness tidak bisa disesuaikan" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "" +msgstr "Buffer + offset terlalu kecil %d %d %d" #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." -msgstr "" +msgstr "Ukuran buffer salah. Seharusnya %d byte." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "" +msgstr "Buffer bukan bytearray." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" -msgstr "" +msgstr "Buffer terlalu kecil" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "" +msgstr "Panjang buffer %d terlalu besar. Itu harus kurang dari %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" -msgstr "" +msgstr "Panjang buffer harus kelipatan 512" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" -msgstr "" +msgstr "Buffer harus memiliki panjang setidaknya 1" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Buffer too large and unable to allocate" -msgstr "" +msgstr "Buffer terlalu besar dan tidak dapat dialokasikan" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "" +msgstr "Buffer terlalu pendek untuk %d byte" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c -#, fuzzy, c-format +#, c-format msgid "Bus pin %d is already in use" -msgstr "DAC sudah digunakan" +msgstr "Pin bus %d sudah digunakan" #: shared-bindings/_bleio/UUID.c -#, fuzzy msgid "Byte buffer must be 16 bytes." -msgstr "buffers harus mempunyai panjang yang sama" +msgstr "Byte buffer harus 16 byte." #: shared-bindings/nvm/ByteArray.c msgid "Bytes must be between 0 and 255." -msgstr "" +msgstr "Bytes harus di antara 0 dan 255." #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "Blok CBC harus merupakan kelipatan 16 byte" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "" +msgstr "Panggil super().__init__() sebelum mengakses objek asli." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" -msgstr "" +msgstr "Tidak dapat mengatur CCCD pada Karakteristik lokal" #: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" -msgstr "" +msgstr "Tidak dapat menghapus nilai" #: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c #: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c @@ -485,9 +490,8 @@ msgid "Cannot get pull while in output mode" msgstr "Tidak bisa mendapatkan pull pada saat mode output" #: ports/nrf/common-hal/microcontroller/Processor.c -#, fuzzy msgid "Cannot get temperature" -msgstr "Tidak bisa mendapatkan temperatur. status: 0x%02x" +msgstr "Tidak bisa mendapatkan suhu" #: shared-bindings/_bleio/Adapter.c msgid "Cannot have scan responses for extended, connectable advertisements." @@ -501,15 +505,15 @@ msgstr "" #: shared-module/bitbangio/SPI.c msgid "Cannot read without MISO pin." -msgstr "" +msgstr "Tidak dapat membaca tanpa pin MISO." #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" -msgstr "" +msgstr "Tidak dapat merekam ke file" #: shared-module/storage/__init__.c msgid "Cannot remount '/' when USB is active." -msgstr "" +msgstr "Tidak dapat memasang kembali '/' ketika USB aktif." #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c @@ -521,11 +525,11 @@ msgstr "" #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." -msgstr "" +msgstr "Tidak dapat menetapkan nilai saat arah input." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "" +msgstr "Tidak dapat menentukan RTS atau CTS dalam mode RS485" #: py/objslice.c msgid "Cannot subclass slice" From 01b2682842f47afbe27bbfcd0f00db96f764fea2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 4 Jul 2020 02:42:15 +0000 Subject: [PATCH 0234/1293] Translated using Weblate (Indonesian) Currently translated at 29.1% (227 of 778 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/id/ --- locale/ID.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 390bfcd944..a0c255b233 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-02 15:29+0200\n" -"PO-Revision-Date: 2020-07-04 02:34+0000\n" -"Last-Translator: oon arfiandwi \n" +"PO-Revision-Date: 2020-07-04 02:45+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: LANGUAGE \n" "Language: ID\n" "MIME-Version: 1.0\n" @@ -46,11 +46,11 @@ msgstr "" #: py/obj.c msgid " File \"%q\"" -msgstr "  File \"% q\"" +msgstr " File \"%q\"" #: py/obj.c msgid " File \"%q\", line %d" -msgstr "  File \"% q\", baris% d" +msgstr " File \"%q\", baris %d" #: main.c msgid " output:\n" From 36ef3476de945071da9c1274e5b4d8bcdcc13d13 Mon Sep 17 00:00:00 2001 From: ansonhe97 Date: Sat, 4 Jul 2020 11:21:58 +0800 Subject: [PATCH 0235/1293] Fix depreciate terminology --- ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c index 6668461f9b..254d730a89 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c @@ -36,7 +36,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB02) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB03) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB00) }, - { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_PB01) }, // I2C pins { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA16) }, @@ -49,7 +49,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_TFT_MISO), MP_ROM_PTR(&pin_PB18) }, { MP_OBJ_NEW_QSTR(MP_QSTR_TFT_MOSI), MP_ROM_PTR(&pin_PB19) }, { MP_OBJ_NEW_QSTR(MP_QSTR_TFT_SCK), MP_ROM_PTR(&pin_PB20) }, - { MP_ROM_QSTR(MP_QSTR_TFT_SS), MP_ROM_PTR(&pin_PB21) }, + { MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_PB21) }, { MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_PC06) }, { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_PC05) }, { MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_PC07) }, @@ -58,7 +58,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_SD_MISO), MP_ROM_PTR(&pin_PC18) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SD_MOSI), MP_ROM_PTR(&pin_PC16) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SD_SCK), MP_ROM_PTR(&pin_PC17) }, - { MP_ROM_QSTR(MP_QSTR_SD_SS), MP_ROM_PTR(&pin_PC19) }, + { MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PC19) }, { MP_ROM_QSTR(MP_QSTR_SD_DET), MP_ROM_PTR(&pin_PC21) }, // Switch From e514782cc68a0f5e01631f8471b1af9a450e8995 Mon Sep 17 00:00:00 2001 From: ndgarage Date: Sat, 4 Jul 2020 10:39:21 -0600 Subject: [PATCH 0236/1293] update-with-new-usb-PID --- ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk index 09804bc4e7..90c000418a 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk @@ -1,7 +1,7 @@ LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A -USB_PID = 0x8066 -USB_PRODUCT = "Bit6" +USB_PID = 0x80B9 +USB_PRODUCT = "Bit7" USB_MANUFACTURER = "ndGarage" CHIP_VARIANT = SAMD21E18A From 94d90742dd02a7d4350a5f712baa81a3ee105fa9 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Sat, 4 Jul 2020 21:15:38 -0500 Subject: [PATCH 0237/1293] Implementation of RTC continuous synchronization during pulsein Flags and code to implement RTC continuous synchronization during pulsein --- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 10 ++++++++++ ports/atmel-samd/common-hal/pulseio/PulseIn.h | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index 7ea20321b2..b825579dbe 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -125,6 +125,9 @@ void pulsein_interrupt_handler(uint8_t channel) { } void pulsein_reset() { +#ifdef SAMD21 + rtc_end_pulsein(); +#endif refcount = 0; pulsein_tc_index = 0xff; overflow_count = 0; @@ -221,6 +224,10 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, // Set config will enable the EIC. pulsein_set_config(self, true); +#ifdef SAMD21 + rtc_start_pulsein(); +#endif + } bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t* self) { @@ -231,6 +238,9 @@ void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) { if (common_hal_pulseio_pulsein_deinited(self)) { return; } +#ifdef SAMD21 + rtc_end_pulsein(); +#endif set_eic_handler(self->channel, EIC_HANDLER_NO_INTERRUPT); turn_off_eic_channel(self->channel); reset_pin_number(self->pin); diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.h b/ports/atmel-samd/common-hal/pulseio/PulseIn.h index 89b61a83ac..99358178f2 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.h +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.h @@ -50,5 +50,11 @@ void pulsein_reset(void); void pulsein_interrupt_handler(uint8_t channel); void pulsein_timer_interrupt_handler(uint8_t index); +#ifdef SAMD21 +void rtc_set_continuous(void); +void rtc_start_pulsein(void); +void rtc_end_pulsein(void); +#endif + #endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PULSEIO_PULSEIN_H From ac33c3fe2c8f8bd866b205ecb844b2f1b9fffcdd Mon Sep 17 00:00:00 2001 From: DavePutz Date: Sat, 4 Jul 2020 21:17:19 -0500 Subject: [PATCH 0238/1293] Implementation of continuous synchronization of RTC during pulsein Flags and code to implement continuous synchronization of RTC during pulsein --- ports/atmel-samd/supervisor/port.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 48bd3211b5..05ce0eb09b 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -91,6 +91,23 @@ #if CIRCUITPY_PEW #include "common-hal/_pew/PewPew.h" #endif +#ifdef SAMD21 +volatile bool hold_interrupt = false; + +void rtc_start_pulsein(void) { + rtc_set_continuous(); + hold_interrupt = true; +} +void rtc_end_pulsein(void) { + hold_interrupt = false; +} + +void rtc_set_continuous(void) { + while (RTC->MODE0.STATUS.bit.SYNCBUSY); + RTC->MODE0.READREQ.reg = RTC_READREQ_RREQ | RTC_READREQ_RCONT | 0x0010; + while (RTC->MODE0.STATUS.bit.SYNCBUSY); +} +#endif extern volatile bool mp_msc_enabled; @@ -489,6 +506,11 @@ void port_interrupt_after_ticks(uint32_t ticks) { // We'll interrupt sooner with an overflow. return; } +#ifdef SAMD21 + if (hold_interrupt == true) { + return; + } +#endif RTC->MODE0.COMP[0].reg = current_ticks + (ticks << 4); RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP0; RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_CMP0; From d1c9bb30e2983f6e2728b4eb17579bd956680626 Mon Sep 17 00:00:00 2001 From: Tyler Crumpton Date: Mon, 6 Jul 2020 09:56:52 -0500 Subject: [PATCH 0239/1293] Fix minor typo in MicroPython libraries page --- docs/library/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/library/index.rst b/docs/library/index.rst index 6c2e576e7d..f847ead0af 100644 --- a/docs/library/index.rst +++ b/docs/library/index.rst @@ -70,7 +70,7 @@ CircuitPython/MicroPython-specific libraries Functionality specific to the CircuitPython/MicroPython implementation is available in the following libraries. These libraries may change signficantly or be removed in future -versions of CircuitPtyon. +versions of CircuitPython. .. toctree:: :maxdepth: 1 From 97355f8fb78c277df3940bf1e4385311d32f2662 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Tue, 30 Jun 2020 14:50:09 +0200 Subject: [PATCH 0240/1293] spresense: update SDK to 2.0.1 --- ports/cxd56/Makefile | 20 +- ports/cxd56/README.md | 4 +- ports/cxd56/common-hal/pulseio/PWMOut.h | 2 +- ports/cxd56/configs/circuitpython/defconfig | 171 ++++++ ports/cxd56/spresense-exported-sdk | 2 +- ports/cxd56/tools/flash_writer.py | 580 +++++++++++++++++++ ports/cxd56/tools/xmodem.py | 590 ++++++++++++++++++++ 7 files changed, 1358 insertions(+), 11 deletions(-) create mode 100644 ports/cxd56/configs/circuitpython/defconfig create mode 100755 ports/cxd56/tools/flash_writer.py create mode 100644 ports/cxd56/tools/xmodem.py diff --git a/ports/cxd56/Makefile b/ports/cxd56/Makefile index 507d763312..3766d42228 100644 --- a/ports/cxd56/Makefile +++ b/ports/cxd56/Makefile @@ -62,6 +62,13 @@ SPRESENSE_SDK = spresense-exported-sdk FIRMWARE = $(SPRESENSE_SDK)/firmware +BOOTLOADER_FILES += \ + $(FIRMWARE)/AESM.espk \ + $(FIRMWARE)/dnnrt-mp.espk \ + $(FIRMWARE)/gnssfw.espk \ + $(FIRMWARE)/loader.espk \ + $(FIRMWARE)/sysutil.spk \ + # Platforms are: Linux, Darwin, MSYS, CYGWIN PLATFORM := $(firstword $(subst _, ,$(shell uname -s 2>/dev/null))) @@ -91,8 +98,7 @@ INC += \ -I$(SPRESENSE_SDK)/nuttx/arch \ -I$(SPRESENSE_SDK)/nuttx/arch/chip \ -I$(SPRESENSE_SDK)/nuttx/arch/os \ - -I$(SPRESENSE_SDK)/sdk/bsp/include \ - -I$(SPRESENSE_SDK)/sdk/bsp/include/sdk \ + -I$(SPRESENSE_SDK)/sdk/include \ CFLAGS += \ $(INC) \ @@ -125,7 +131,7 @@ LDFLAGS = \ --entry=__start \ -nostartfiles \ -nodefaultlibs \ - -T$(SPRESENSE_SDK)/nuttx/build/ramconfig.ld \ + -T$(SPRESENSE_SDK)/nuttx/scripts/ramconfig.ld \ --gc-sections \ -Map=$(BUILD)/output.map \ -o $(BUILD)/firmware.elf \ @@ -133,8 +139,8 @@ LDFLAGS = \ -u spresense_main \ -u board_timerhook \ $(BUILD)/libmpy.a \ - $(SPRESENSE_SDK)/sdk/libs/libapps.a \ - $(SPRESENSE_SDK)/sdk/libs/libsdk.a \ + $(SPRESENSE_SDK)/nuttx/libs/libapps.a \ + $(SPRESENSE_SDK)/nuttx/libs/libnuttx.a \ $(LIBM) \ $(LIBGCC) \ --end-group \ @@ -213,11 +219,11 @@ $(BUILD)/firmware.spk: $(BUILD)/firmware.elf $(MKSPK) flash: $(BUILD)/firmware.spk $(ECHO) "Writing $< to the board" - $(SPRESENSE_SDK)/sdk/tools/flash.sh -c $(SERIAL) $(BUILD)/firmware.spk + tools/flash_writer.py -s -c $(SERIAL) -d -b 115200 -n $(BUILD)/firmware.spk flash-bootloader: $(SPRESENSE_SDK) $(FIRMWARE) $(ECHO) "Writing loader to the board" - $(SPRESENSE_SDK)/sdk/tools/flash.sh -l $(FIRMWARE) -c $(SERIAL) + tools/flash_writer.py -s -c $(SERIAL) -d -b 115200 -n $(BOOTLOADER_FILES) include $(TOP)/py/mkrules.mk diff --git a/ports/cxd56/README.md b/ports/cxd56/README.md index ec284e7421..7fa439aacb 100644 --- a/ports/cxd56/README.md +++ b/ports/cxd56/README.md @@ -16,7 +16,7 @@ Board features: * Spresense is powered by Sony's CXD5602 microcontroller (ARM® Cortex®-M4F × 6 cores), with a clock speed of 156 MHz. -Currently, Spresense port does not support GNSS, Audio and Multicore. +Currently, Spresense port does not support Audio and Multicore. Refer to [developer.sony.com/develop/spresense/](https://developer.sony.com/develop/spresense/) for further information about this board. @@ -75,7 +75,7 @@ Bootloader information: * You have to accept the End User License Agreement to be able to download and use the Spresense bootloader binary. -Download the spresense binaries zip archive from: [Spresense firmware v1-4-000](https://developer.sony.com/file/download/download-spresense-firmware-v1-4-000) +Download the spresense binaries zip archive from: [Spresense firmware v2-0-000](https://developer.sony.com/file/download/download-spresense-firmware-v2-0-000) Extract spresense binaries in your PC to ports/spresense/spresense-exported-sdk/firmware/ diff --git a/ports/cxd56/common-hal/pulseio/PWMOut.h b/ports/cxd56/common-hal/pulseio/PWMOut.h index 57fc4181f0..694acc4e0c 100644 --- a/ports/cxd56/common-hal/pulseio/PWMOut.h +++ b/ports/cxd56/common-hal/pulseio/PWMOut.h @@ -27,7 +27,7 @@ #ifndef MICROPY_INCLUDED_CXD56_COMMON_HAL_PULSEIO_PWMOUT_H #define MICROPY_INCLUDED_CXD56_COMMON_HAL_PULSEIO_PWMOUT_H -#include +#include #include "common-hal/microcontroller/Pin.h" diff --git a/ports/cxd56/configs/circuitpython/defconfig b/ports/cxd56/configs/circuitpython/defconfig new file mode 100644 index 0000000000..268f7a68e9 --- /dev/null +++ b/ports/cxd56/configs/circuitpython/defconfig @@ -0,0 +1,171 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# +# CONFIG_ARCH_LEDS is not set +# CONFIG_CXD56_I2C0_SCUSEQ is not set +# CONFIG_CXD56_SFC is not set +# CONFIG_CXD56_SPI3_SCUSEQ is not set +# CONFIG_MMCSD_MMCSUPPORT is not set +# CONFIG_MMCSD_SPI is not set +# CONFIG_MTD_SMART_WEAR_LEVEL is not set +# CONFIG_NET_IPv4 is not set +# CONFIG_NXFONTS_PACKEDMSFIRST is not set +# CONFIG_STANDARD_SERIAL is not set +CONFIG_ARCH="arm" +CONFIG_ARCH_BOARD="spresense" +CONFIG_ARCH_BOARD_SPRESENSE=y +CONFIG_ARCH_CHIP="cxd56xx" +CONFIG_ARCH_CHIP_CXD56XX=y +CONFIG_ARCH_INTERRUPTSTACK=2048 +CONFIG_ARCH_MATH_H=y +CONFIG_ARCH_STACKDUMP=y +CONFIG_ARMV7M_USEBASEPRI=y +CONFIG_ASMP=y +CONFIG_AUDIO=y +CONFIG_AUDIOUTILS_DSP_MOUNTPT="/mnt/sd0/BIN" +CONFIG_AUDIOUTILS_MANAGER=y +CONFIG_AUDIOUTILS_PLAYER=y +CONFIG_AUDIOUTILS_PLAYLIST=y +CONFIG_AUDIOUTILS_RECORDER=y +CONFIG_BOARDCTL_IOCTL=y +CONFIG_BOARDCTL_POWEROFF=y +CONFIG_BOARDCTL_RESET=y +CONFIG_BOARDCTL_UNIQUEID=y +CONFIG_BOARDCTL_UNIQUEID_SIZE=5 +CONFIG_BOARDCTL_USBDEVCTRL=y +CONFIG_BOARD_CRASHDUMP=y +CONFIG_BOARD_LATE_INITIALIZE=y +CONFIG_BOARD_LOOPSPERMSEC=5434 +CONFIG_BOOT_RUNFROMISRAM=y +CONFIG_BUILTIN=y +CONFIG_CLOCK_MONOTONIC=y +CONFIG_CXD56_ADC=y +CONFIG_CXD56_AUDIO=y +CONFIG_CXD56_BINARY=y +CONFIG_CXD56_CHARGER=y +CONFIG_CXD56_CISIF=y +CONFIG_CXD56_GAUGE=y +CONFIG_CXD56_GNSS=y +CONFIG_CXD56_HPADC0=y +CONFIG_CXD56_HPADC1=y +CONFIG_CXD56_I2C0=y +CONFIG_CXD56_I2C2=y +CONFIG_CXD56_I2C=y +CONFIG_CXD56_I2C_DRIVER=y +CONFIG_CXD56_IMAGEPROC=y +CONFIG_CXD56_LPADC=y +CONFIG_CXD56_PWM0=y +CONFIG_CXD56_PWM1=y +CONFIG_CXD56_PWM2=y +CONFIG_CXD56_PWM3=y +CONFIG_CXD56_PWM=y +CONFIG_CXD56_SDIO=y +CONFIG_CXD56_SPI3=y +CONFIG_CXD56_SPI5=y +CONFIG_CXD56_SPI=y +CONFIG_CXD56_UART2=y +CONFIG_DEBUG_FULLOPT=y +CONFIG_DEBUG_SYMBOLS=y +CONFIG_DNN_RT=y +CONFIG_DNN_RT_MP=y +CONFIG_DRIVERS_VIDEO=y +CONFIG_EXTERNALS_CMSIS=y +CONFIG_FAT_LCNAMES=y +CONFIG_FAT_LFN=y +CONFIG_FAT_MAXFNAME=64 +CONFIG_FS_FAT=y +CONFIG_FS_PROCFS=y +CONFIG_FS_PROCFS_REGISTER=y +CONFIG_FS_ROMFS=y +CONFIG_FS_SMARTFS=y +CONFIG_HAVE_CXX=y +CONFIG_HAVE_CXXINITIALIZE=y +CONFIG_LCD=y +CONFIG_LCD_NOGETRUN=y +CONFIG_LIBC_FLOATINGPOINT=y +CONFIG_LIBC_IPv4_ADDRCONV=y +CONFIG_LIBC_IPv6_ADDRCONV=y +CONFIG_LIB_KBDCODEC=y +CONFIG_MAX_WDOGPARMS=2 +CONFIG_MEMUTILS=y +CONFIG_MMCSD=y +CONFIG_MMCSD_SDIO=y +CONFIG_MTD=y +CONFIG_MTD_BYTE_WRITE=y +CONFIG_MTD_SMART=y +CONFIG_MTD_SMART_ENABLE_CRC=y +CONFIG_MTD_SMART_FSCK=y +CONFIG_MTD_SMART_SECTOR_SIZE=4096 +CONFIG_NAME_MAX=64 +CONFIG_NET=y +CONFIG_NETDEVICES=y +CONFIG_NETDEV_LATEINIT=y +CONFIG_NET_SOCKOPTS=y +CONFIG_NET_TCP_NO_STACK=y +CONFIG_NET_UDP_NO_STACK=y +CONFIG_NET_USRSOCK=y +CONFIG_NET_USRSOCK_TCP=y +CONFIG_NET_USRSOCK_UDP=y +CONFIG_NFILE_STREAMS=8 +CONFIG_NSH_ARCHINIT=y +CONFIG_NSH_BUILTIN_APPS=y +CONFIG_NSH_DISABLE_LOSMART=y +CONFIG_NSH_LINELEN=160 +CONFIG_NSH_MAXARGUMENTS=14 +CONFIG_NSH_READLINE=y +CONFIG_PIPES=y +CONFIG_PREALLOC_MQ_MSGS=4 +CONFIG_PREALLOC_TIMERS=4 +CONFIG_PREALLOC_WDOGS=16 +CONFIG_PWM=y +CONFIG_RAM_SIZE=1572864 +CONFIG_RAM_START=0x0d000000 +CONFIG_READLINE_CMD_HISTORY=y +CONFIG_READLINE_CMD_HISTORY_LINELEN=160 +CONFIG_READLINE_TABCOMPLETION=y +CONFIG_RR_INTERVAL=200 +CONFIG_RTC=y +CONFIG_RTC_ALARM=y +CONFIG_RTC_DRIVER=y +CONFIG_RTC_FREQUENCY=32768 +CONFIG_RTC_HIRES=y +CONFIG_SCHED_CHILD_STATUS=y +CONFIG_SCHED_HAVE_PARENT=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_LPNTHREADS=3 +CONFIG_SCHED_LPWORK=y +CONFIG_SCHED_WAITPID=y +CONFIG_SDCLONE_DISABLE=y +CONFIG_SDIO_MUXBUS=y +CONFIG_SDK_AUDIO=y +CONFIG_SERIAL_TERMIOS=y +CONFIG_SMARTFS_ALIGNED_ACCESS=y +CONFIG_SMARTFS_MAXNAMLEN=30 +CONFIG_SMARTFS_MULTI_ROOT_DIRS=y +CONFIG_SPECIFIC_DRIVERS=y +CONFIG_SPI=y +CONFIG_SPRESENSE_EXTENSION=y +CONFIG_START_DAY=6 +CONFIG_START_MONTH=12 +CONFIG_START_YEAR=2011 +CONFIG_SYSTEMTICK_HOOK=y +CONFIG_SYSTEM_CLE=y +CONFIG_SYSTEM_NSH=y +CONFIG_SYSTEM_NSH_CXXINITIALIZE=y +CONFIG_UART1_RXBUFSIZE=1024 +CONFIG_UART1_SERIAL_CONSOLE=y +CONFIG_UART1_TXBUFSIZE=1024 +CONFIG_UART2_IFLOWCONTROL=y +CONFIG_UART2_OFLOWCONTROL=y +CONFIG_USBDEV=y +CONFIG_USBDEV_DMA=y +CONFIG_USBDEV_DUALSPEED=y +CONFIG_USEC_PER_TICK=1000 +CONFIG_USERMAIN_STACKSIZE=1064960 +CONFIG_USER_ENTRYPOINT="spresense_main" +CONFIG_VIDEO_ISX012=y +CONFIG_VIDEO_STREAM=y diff --git a/ports/cxd56/spresense-exported-sdk b/ports/cxd56/spresense-exported-sdk index 7f6568c7f4..c991d439fa 160000 --- a/ports/cxd56/spresense-exported-sdk +++ b/ports/cxd56/spresense-exported-sdk @@ -1 +1 @@ -Subproject commit 7f6568c7f4898cdb24a2f06040784a836050686e +Subproject commit c991d439fac9c23cfcac0da16fe8055f818d40a4 diff --git a/ports/cxd56/tools/flash_writer.py b/ports/cxd56/tools/flash_writer.py new file mode 100755 index 0000000000..840f10c32f --- /dev/null +++ b/ports/cxd56/tools/flash_writer.py @@ -0,0 +1,580 @@ +#! /usr/bin/env python3 + +# Copyright (C) 2018 Sony Semiconductor Solutions Corp. +# +# 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. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "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 +# COPYRIGHT OWNER OR CONTRIBUTORS 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. +# + +import time +import sys +import os +import struct +import glob +import fnmatch +import errno +import telnetlib +import argparse +import shutil +import subprocess +import re +import xmodem + +import_serial_module = True + +# When SDK release, plase set SDK_RELEASE as True. +SDK_RELEASE = False + +if SDK_RELEASE : + PRINT_RAW_COMMAND = False + REBOOT_AT_END = True +else : + PRINT_RAW_COMMAND = True + REBOOT_AT_END = True + +try: + import serial +except: + import_serial_module = False + +# supported environment various +# CXD56_PORT +# CXD56_TELNETSRV_PORT +# CXD56_TELNETSRV_IP + +PROTOCOL_SERIAL = 0 +PROTOCOL_TELNET = 1 + +MAX_DOT_COUNT = 70 + +# configure parameters and default value +class ConfigArgs: + PROTOCOL_TYPE = None + SERIAL_PORT = "COM1" + SERVER_PORT = 4569 + SERVER_IP = "localhost" + EOL = bytes([10]) + WAIT_RESET = True + AUTO_RESET = False + DTR_RESET = False + XMODEM_BAUD = 0 + NO_SET_BOOTABLE = False + PACKAGE_NAME = [] + FILE_NAME = [] + ERASE_NAME = [] + PKGSYS_NAME = [] + PKGAPP_NAME = [] + PKGUPD_NAME = [] + +ROM_MSG = [b"Welcome to nash"] +XMDM_MSG = "Waiting for XMODEM (CRC or 1K) transfer. Ctrl-X to cancel." + +class ConfigArgsLoader(): + def __init__(self): + self.parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter) + self.parser.add_argument("package_name", help="the name of the package to install", nargs='*') + self.parser.add_argument("-f", "--file", dest="file_name", help="save file", action='append') + self.parser.add_argument("-e", "--erase", dest="erase_name", help="erase file", action='append') + + self.parser.add_argument("-S", "--sys", dest="pkgsys_name", help="the name of the system package to install", action='append') + self.parser.add_argument("-A", "--app", dest="pkgapp_name", help="the name of the application package to install", action='append') + self.parser.add_argument("-U", "--upd", dest="pkgupd_name", help="the name of the updater package to install", action='append') + + self.parser.add_argument("-a", "--auto-reset", dest="auto_reset", + action="store_true", default=None, + help="try to auto reset develop board if possible") + self.parser.add_argument("-d", "--dtr-reset", dest="dtr_reset", + action="store_true", default=None, + help="try to auto reset develop board if possible") + self.parser.add_argument("-n", "--no-set-bootable", dest="no_set_bootable", + action="store_true", default=None, + help="not to set bootable") + + group = self.parser.add_argument_group() + group.add_argument("-i", "--server-ip", dest="server_ip", + help="the ip address connected to the telnet server") + group.add_argument("-p", "--server-port", dest="server_port", type=int, + help="the port connected to the telnet server") + + group = self.parser.add_argument_group() + group.add_argument("-c", "--serial-port", dest="serial_port", help="the serial port") + group.add_argument("-b", "--xmodem-baudrate", dest="xmodem_baud", help="Use the faster baudrate in xmodem") + + mutually_group = self.parser.add_mutually_exclusive_group() + mutually_group.add_argument("-t", "--telnet-protocol", dest="telnet_protocol", + action="store_true", default=None, + help="use the telnet protocol for binary transmission") + mutually_group.add_argument("-s", "--serial-protocol", dest="serial_protocol", + action="store_true", default=None, + help="use the serial port for binary transmission, default options") + + mutually_group2 = self.parser.add_mutually_exclusive_group() + mutually_group2.add_argument("-F", "--force-wait-reset", dest="wait_reset", + action="store_true", default=None, + help="force wait for pressing RESET button") + mutually_group2.add_argument("-N", "--no-wait-reset", dest="wait_reset", + action="store_false", default=None, + help="if possible, skip to wait for pressing RESET button") + + def update_config(self): + args = self.parser.parse_args() + + ConfigArgs.PACKAGE_NAME = args.package_name + ConfigArgs.FILE_NAME = args.file_name + ConfigArgs.ERASE_NAME = args.erase_name + ConfigArgs.PKGSYS_NAME = args.pkgsys_name + ConfigArgs.PKGAPP_NAME = args.pkgapp_name + ConfigArgs.PKGUPD_NAME = args.pkgupd_name + + # Get serial port or telnet server ip etc + if args.serial_protocol == True: + ConfigArgs.PROTOCOL_TYPE = PROTOCOL_SERIAL + elif args.telnet_protocol == True: + ConfigArgs.PROTOCOL_TYPE = PROTOCOL_TELNET + + if ConfigArgs.PROTOCOL_TYPE == None: + proto = os.environ.get("CXD56_PROTOCOL") + if proto is not None: + if 's' in proto: + ConfigArgs.PROTOCOL_TYPE = PROTOCOL_SERIAL + elif 't' in proto: + ConfigArgs.PROTOCOL_TYPE = PROTOCOL_TELNET + + if ConfigArgs.PROTOCOL_TYPE == None: + ConfigArgs.PROTOCOL_TYPE = PROTOCOL_SERIAL + + if ConfigArgs.PROTOCOL_TYPE == PROTOCOL_SERIAL: + if args.serial_port is not None: + ConfigArgs.SERIAL_PORT = args.serial_port + else: + # Get serial port from the environment + port = os.environ.get("CXD56_PORT") + if port is not None: + ConfigArgs.SERIAL_PORT = port + else: + print("CXD56_PORT is not set, Use " + ConfigArgs.SERIAL_PORT + ".") + else: + ConfigArgs.PROTOCOL_TYPE = PROTOCOL_TELNET + if args.server_port is not None: + ConfigArgs.SERVER_PORT = args.server_port + else: + port = os.environ.get("CXD56_TELNETSRV_PORT") + if port is not None: + ConfigArgs.SERVER_PORT = port + else: + print("CXD56_TELNETSRV_PORT is not set, Use " + str(ConfigArgs.SERVER_PORT) + ".") + if args.server_ip is not None: + ConfigArgs.SERVER_IP = args.server_ip + else: + ip = os.environ.get("CXD56_TELNETSRV_IP") + if ip is not None: + ConfigArgs.SERVER_IP = ip + else: + print("CXD56_TELNETSRV_IP is not set, Use " + ConfigArgs.SERVER_IP + ".") + + if args.xmodem_baud is not None: + ConfigArgs.XMODEM_BAUD = args.xmodem_baud + + if args.auto_reset is not None: + ConfigArgs.AUTO_RESET = args.auto_reset + + if args.dtr_reset is not None: + ConfigArgs.DTR_RESET = args.dtr_reset + + if args.no_set_bootable is not None: + ConfigArgs.NO_SET_BOOTABLE = args.no_set_bootable + + if args.wait_reset is not None: + ConfigArgs.WAIT_RESET = args.wait_reset + +class TelnetDev: + def __init__(self): + srv_ipaddr = ConfigArgs.SERVER_IP + srv_port = ConfigArgs.SERVER_PORT + self.recvbuf = b''; + try: + self.telnet = telnetlib.Telnet(host=srv_ipaddr, port=srv_port, timeout=10) + # There is a ack to be sent after connecting to the telnet server. + self.telnet.write(b"\xff") + except Exception as e: + print("Cannot connect to the server %s:%d" % (srv_ipaddr, srv_port)) + sys.exit(e.args[0]) + + def readline(self, size=None): + res = b'' + ch = b'' + while ch != ConfigArgs.EOL: + ch = self.getc_raw(1, timeout=0.1) + if ch == b'': + return res + res += ch + return res + + def getc_raw(self, size, timeout=1): + res = b'' + tm = time.monotonic() + while size > 0: + while self.recvbuf == b'': + self.recvbuf = self.telnet.read_eager() + if self.recvbuf == b'': + if (time.monotonic() - tm) > timeout: + return res + time.sleep(0.1) + res += self.recvbuf[0:1] + self.recvbuf = self.recvbuf[1:] + size -= 1 + return res + + def write(self, buffer): + self.telnet.write(buffer) + + def discard_inputs(self, timeout=1.0): + while True: + ch = self.getc_raw(1, timeout=timeout) + if ch == b'': + break + + def getc(self, size, timeout=1): + c = self.getc_raw(size, timeout) + return c + + def putc(self, buffer, timeout=1): + self.telnet.write(buffer) + self.show_progress(len(buffer)) + + def reboot(self): + # no-op + pass + + def set_file_size(self, filesize): + self.bytes_transfered = 0 + self.filesize = filesize + self.count = 0 + + def show_progress(self, sendsize): + if PRINT_RAW_COMMAND: + if self.count < MAX_DOT_COUNT: + self.bytes_transfered = self.bytes_transfered + sendsize + cur_count = int(self.bytes_transfered * MAX_DOT_COUNT / self.filesize) + if MAX_DOT_COUNT < cur_count: + cur_count = MAX_DOT_COUNT + for idx in range(cur_count - self.count): + print('#',end='') + sys.stdout.flush() + self.count = cur_count + if self.count == MAX_DOT_COUNT: + print("\n") + +class SerialDev: + def __init__(self): + if import_serial_module is False: + print("Cannot import serial module, maybe it's not install yet.") + print("\n", end="") + print("Please install python-setuptool by Cygwin installer.") + print("After that use easy_intall command to install serial module") + print(" $ cd tool/") + print(" $ python3 -m easy_install pyserial-2.7.tar.gz") + quit() + else: + port = ConfigArgs.SERIAL_PORT + try: + self.serial = serial.Serial(port, baudrate=115200, + parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, + bytesize=serial.EIGHTBITS, timeout=0.1) + except Exception as e: + print("Cannot open port : " + port) + sys.exit(e.args[0]) + + def readline(self, size=None): + return self.serial.readline(size) + + def write(self, buffer): + self.serial.write(buffer) + self.serial.flush() + + def discard_inputs(self, timeout=1.0): + time.sleep(timeout) + self.serial.flushInput() + + def getc(self, size, timeout=1): + self.serial.timeout = timeout + c = self.serial.read(size) + self.serial.timeout = 0.1 + return c + + def putc(self, buffer, timeout=1): + self.serial.timeout = timeout + self.serial.write(buffer) + self.serial.flush() + self.serial.timeout = 0.1 + self.show_progress(len(buffer)) + + # Note: windows platform dependent code + def putc_win(self, buffer, timeout=1): + self.serial.write(buffer) + self.show_progress(len(buffer)) + while True: + if self.serial.out_waiting == 0: + break + + def setBaudrate(self, baudrate): +# self.serial.setBaudrate(baudrate) + self.serial.baudrate = baudrate + + def reboot(self): + # Target Reset by DTR + self.serial.setDTR(False) + self.serial.setDTR(True) + self.serial.setDTR(False) + + def set_file_size(self, filesize): + self.bytes_transfered = 0 + self.filesize = filesize + self.count = 0 + + def show_progress(self, sendsize): + if PRINT_RAW_COMMAND: + if self.count < MAX_DOT_COUNT: + self.bytes_transfered = self.bytes_transfered + sendsize + cur_count = int(self.bytes_transfered * MAX_DOT_COUNT / self.filesize) + if MAX_DOT_COUNT < cur_count: + cur_count = MAX_DOT_COUNT + for idx in range(cur_count - self.count): + print('#',end='') + sys.stdout.flush() + self.count = cur_count + if self.count == MAX_DOT_COUNT: + print("\n") + +class FlashWriter: + def __init__(self, protocol_sel=PROTOCOL_SERIAL): + if protocol_sel == PROTOCOL_TELNET: + self.serial = TelnetDev() + else: + self.serial = SerialDev() + + def cancel_autoboot(self) : + boot_msg = '' + self.serial.reboot() # Target reboot before send 'r' + while boot_msg == '' : + rx = self.serial.readline().strip() + self.serial.write(b"r") # Send "r" key to avoid auto boot + for msg in ROM_MSG : + if msg in rx : + boot_msg = msg + break + while True : + rx = self.serial.readline().decode(errors="replace").strip() + if "updater" in rx : + # Workaround : Sometime first character is dropped. + # Send line feed as air shot before actual command. + self.serial.write(b"\n") # Send line feed + self.serial.discard_inputs()# Clear input buffer to sync + return boot_msg.decode(errors="ignore") + + def recv(self): + rx = self.serial.readline() + if PRINT_RAW_COMMAND : + serial_line = rx.decode(errors="replace") + if serial_line.strip() != "" and not serial_line.startswith(XMDM_MSG): + print(serial_line, end="") + return rx + + def wait(self, string): + while True: + rx = self.recv() + if string.encode() in rx: + time.sleep(0.1) + break + + def wait_for_prompt(self): + prompt_pat = re.compile(b"updater") + while True: + rx = self.recv() + if prompt_pat.search(rx): + time.sleep(0.1) + break + + def send(self, string): + self.serial.write(str(string).encode() + b"\n") + rx = self.serial.readline() + if PRINT_RAW_COMMAND : + print(rx.decode(errors="replace"), end="") + + def read_output(self, prompt_text) : + output = [] + while True : + rx = self.serial.readline() + if prompt_text.encode() in rx : + time.sleep(0.1) + break + if rx != "" : + output.append(rx.decode(errors="ignore").rstrip()) + return output + + def install_files(self, files, command) : + if ConfigArgs.XMODEM_BAUD: + command += " -b " + ConfigArgs.XMODEM_BAUD + if os.name == 'nt': + modem = xmodem.XMODEM(self.serial.getc, self.serial.putc_win, 'xmodem1k') + else: + modem = xmodem.XMODEM(self.serial.getc, self.serial.putc, 'xmodem1k') + for file in files: + with open(file, "rb") as bin : + self.send(command) + print("Install " + file) + self.wait(XMDM_MSG) + print("|0%" + + "-" * (int(MAX_DOT_COUNT / 2) - 6) + + "50%" + + "-" * (MAX_DOT_COUNT - int(MAX_DOT_COUNT / 2) - 5) + + "100%|") + if ConfigArgs.XMODEM_BAUD: + self.serial.setBaudrate(ConfigArgs.XMODEM_BAUD) + self.serial.discard_inputs() # Clear input buffer to sync + self.serial.set_file_size(os.path.getsize(file)) + modem.send(bin) + if ConfigArgs.XMODEM_BAUD: + self.serial.setBaudrate(115200) + self.wait_for_prompt() + + def save_files(self, files) : + if ConfigArgs.XMODEM_BAUD: + command = "save_file -b " + ConfigArgs.XMODEM_BAUD + " -x " + else: + command = "save_file -x " + if os.name == 'nt': + modem = xmodem.XMODEM(self.serial.getc, self.serial.putc_win, 'xmodem1k') + else: + modem = xmodem.XMODEM(self.serial.getc, self.serial.putc, 'xmodem1k') + for file in files: + with open(file, "rb") as bin : + self.send(command + os.path.basename(file)) + print("Save " + file) + self.wait(XMDM_MSG) + if ConfigArgs.XMODEM_BAUD: + self.serial.setBaudrate(ConfigArgs.XMODEM_BAUD) + self.serial.discard_inputs() # Clear input buffer to sync + self.serial.set_file_size(os.path.getsize(file)) + modem.send(bin) + if ConfigArgs.XMODEM_BAUD: + self.serial.setBaudrate(115200) + self.wait_for_prompt() + self.send("chmod d+rw " + os.path.basename(file)) + self.wait_for_prompt() + + def delete_files(self, files) : + for file in files : + self.delete_binary(file) + + def delete_binary(self, bin_name) : + self.send("rm " + bin_name) + self.wait_for_prompt() + +def main(): + try: + config_loader = ConfigArgsLoader() + config_loader.update_config() + except: + return errno.EINVAL + + # Wait to reset the board + writer = FlashWriter(ConfigArgs.PROTOCOL_TYPE) + + do_wait_reset = True + if ConfigArgs.AUTO_RESET: + if subprocess.call("cd " + sys.path[0] + "; ./reset_board.sh", shell=True) == 0: + print("auto reset board sucess!!") + do_wait_reset = False + bootrom_msg = writer.cancel_autoboot() + + if ConfigArgs.DTR_RESET: + do_wait_reset = False + bootrom_msg = writer.cancel_autoboot() + + if ConfigArgs.WAIT_RESET == False and do_wait_reset == True: + rx = writer.recv() + time.sleep(1) + for i in range(3): + writer.send("") + rx = writer.recv() + if "updater".encode() in rx: + # No need to wait for reset + do_wait_reset = False + break + time.sleep(1) + + if do_wait_reset: + # Wait to reset the board + print('Please press RESET button on target board') + sys.stdout.flush() + bootrom_msg = writer.cancel_autoboot() + + # Remove files + if ConfigArgs.ERASE_NAME : + print(">>> Remove exisiting files ...") + writer.delete_files(ConfigArgs.ERASE_NAME) + + # Install files + if ConfigArgs.PACKAGE_NAME or ConfigArgs.PKGSYS_NAME or ConfigArgs.PKGAPP_NAME or ConfigArgs.PKGUPD_NAME: + print(">>> Install files ...") + if ConfigArgs.PACKAGE_NAME : + writer.install_files(ConfigArgs.PACKAGE_NAME, "install") + if ConfigArgs.PKGSYS_NAME : + writer.install_files(ConfigArgs.PKGSYS_NAME, "install") + if ConfigArgs.PKGAPP_NAME : + writer.install_files(ConfigArgs.PKGAPP_NAME, "install") + if ConfigArgs.PKGUPD_NAME : + writer.install_files(ConfigArgs.PKGUPD_NAME, "install -k updater.key") + + # Save files + if ConfigArgs.FILE_NAME : + print(">>> Save files ...") + writer.save_files(ConfigArgs.FILE_NAME) + + # Set auto boot + if not ConfigArgs.NO_SET_BOOTABLE: + print(">>> Save Configuration to FlashROM ...") + writer.send("set bootable M0P") + writer.wait_for_prompt() + + # Sync all cached data to flash + writer.send("sync") + writer.wait_for_prompt() + + if REBOOT_AT_END : + print("Restarting the board ...") + writer.send("reboot") + + return 0 + +if __name__ == "__main__": + try: + sys.exit(main()) + except KeyboardInterrupt: + print("Canceled by keyboard interrupt.") + pass diff --git a/ports/cxd56/tools/xmodem.py b/ports/cxd56/tools/xmodem.py new file mode 100644 index 0000000000..c934300560 --- /dev/null +++ b/ports/cxd56/tools/xmodem.py @@ -0,0 +1,590 @@ +''' +=============================== + XMODEM file transfer protocol +=============================== + +.. $Id$ + +This is a literal implementation of XMODEM.TXT_, XMODEM1K.TXT_ and +XMODMCRC.TXT_, support for YMODEM and ZMODEM is pending. YMODEM should +be fairly easy to implement as it is a hack on top of the XMODEM +protocol using sequence bytes ``0x00`` for sending file names (and some +meta data). + +.. _XMODEM.TXT: doc/XMODEM.TXT +.. _XMODEM1K.TXT: doc/XMODEM1K.TXT +.. _XMODMCRC.TXT: doc/XMODMCRC.TXT + +Data flow example including error recovery +========================================== + +Here is a sample of the data flow, sending a 3-block message. +It includes the two most common line hits - a garbaged block, +and an ``ACK`` reply getting garbaged. ``CRC`` or ``CSUM`` represents +the checksum bytes. + +XMODEM 128 byte blocks +---------------------- + +:: + + SENDER RECEIVER + + <-- NAK + SOH 01 FE Data[128] CSUM --> + <-- ACK + SOH 02 FD Data[128] CSUM --> + <-- ACK + SOH 03 FC Data[128] CSUM --> + <-- ACK + SOH 04 FB Data[128] CSUM --> + <-- ACK + SOH 05 FA Data[100] CPMEOF[28] CSUM --> + <-- ACK + EOT --> + <-- ACK + +XMODEM-1k blocks, CRC mode +-------------------------- + +:: + + SENDER RECEIVER + + <-- C + STX 01 FE Data[1024] CRC CRC --> + <-- ACK + STX 02 FD Data[1024] CRC CRC --> + <-- ACK + STX 03 FC Data[1000] CPMEOF[24] CRC CRC --> + <-- ACK + EOT --> + <-- ACK + +Mixed 1024 and 128 byte Blocks +------------------------------ + +:: + + SENDER RECEIVER + + <-- C + STX 01 FE Data[1024] CRC CRC --> + <-- ACK + STX 02 FD Data[1024] CRC CRC --> + <-- ACK + SOH 03 FC Data[128] CRC CRC --> + <-- ACK + SOH 04 FB Data[100] CPMEOF[28] CRC CRC --> + <-- ACK + EOT --> + <-- ACK + +YMODEM Batch Transmission Session (1 file) +------------------------------------------ + +:: + + SENDER RECEIVER + <-- C (command:rb) + SOH 00 FF foo.c NUL[123] CRC CRC --> + <-- ACK + <-- C + SOH 01 FE Data[128] CRC CRC --> + <-- ACK + SOH 02 FC Data[128] CRC CRC --> + <-- ACK + SOH 03 FB Data[100] CPMEOF[28] CRC CRC --> + <-- ACK + EOT --> + <-- NAK + EOT --> + <-- ACK + <-- C + SOH 00 FF NUL[128] CRC CRC --> + <-- ACK + + +''' + +__author__ = 'Wijnand Modderman ' +__copyright__ = ['Copyright (c) 2010 Wijnand Modderman', + 'Copyright (c) 1981 Chuck Forsberg'] +__license__ = 'MIT' +__version__ = '0.3.2' + +import logging +import time +import sys +from functools import partial +import collections + +# Loggerr +log = logging.getLogger('xmodem') + +# Protocol bytes +SOH = bytes([0x01]) +STX = bytes([0x02]) +EOT = bytes([0x04]) +ACK = bytes([0x06]) +DLE = bytes([0x10]) +NAK = bytes([0x15]) +CAN = bytes([0x18]) +CRC = bytes([0x43]) # C + + +class XMODEM(object): + ''' + XMODEM Protocol handler, expects an object to read from and an object to + write to. + + >>> def getc(size, timeout=1): + ... return data or None + ... + >>> def putc(data, timeout=1): + ... return size or None + ... + >>> modem = XMODEM(getc, putc) + + + :param getc: Function to retreive bytes from a stream + :type getc: callable + :param putc: Function to transmit bytes to a stream + :type putc: callable + :param mode: XMODEM protocol mode + :type mode: string + :param pad: Padding character to make the packets match the packet size + :type pad: char + + ''' + + # crctab calculated by Mark G. Mendel, Network Systems Corporation + crctable = [ + 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, + 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, + 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, + 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, + 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, + 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, + 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, + 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, + 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, + 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, + 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, + 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, + 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, + 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, + 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, + 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, + 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, + 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, + 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, + 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, + 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, + 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, + 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, + 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, + 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, + 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, + 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, + 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, + 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, + 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, + 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, + 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0, + ] + + def __init__(self, getc, putc, mode='xmodem', pad=b'\x1a'): + self.getc = getc + self.putc = putc + self.mode = mode + self.pad = pad + + def abort(self, count=2, timeout=60): + ''' + Send an abort sequence using CAN bytes. + ''' + for counter in range(0, count): + self.putc(CAN, timeout) + + def send(self, stream, retry=32, timeout=360, quiet=0, callback=None): + ''' + Send a stream via the XMODEM protocol. + + >>> stream = file('/etc/issue', 'rb') + >>> print modem.send(stream) + True + + Returns ``True`` upon succesful transmission or ``False`` in case of + failure. + + :param stream: The stream object to send data from. + :type stream: stream (file, etc.) + :param retry: The maximum number of times to try to resend a failed + packet before failing. + :type retry: int + :param timeout: The number of seconds to wait for a response before + timing out. + :type timeout: int + :param quiet: If 0, it prints info to stderr. If 1, it does not print any info. + :type quiet: int + :param callback: Reference to a callback function that has the + following signature. This is useful for + getting status updates while a xmodem + transfer is underway. + Expected callback signature: + def callback(total_packets, success_count, error_count) + :type callback: callable + ''' + + # initialize protocol + try: + packet_size = dict( + xmodem = 128, + xmodem1k = 1024, + )[self.mode] + except AttributeError: + raise ValueError("An invalid mode was supplied") + + error_count = 0 + crc_mode = 0 + cancel = 0 + while True: + char = self.getc(1) + if char: + if char == NAK: + crc_mode = 0 + break + elif char == CRC: + crc_mode = 1 + break + elif char == CAN: + if not quiet: + print('received CAN', file=sys.stderr) + if cancel: + return False + else: + cancel = 1 + else: + log.error('send ERROR expected NAK/CRC, got %s' % \ + (ord(char),)) + + error_count += 1 + if error_count >= retry: + self.abort(timeout=timeout) + return False + + # send data + error_count = 0 + success_count = 0 + total_packets = 0 + sequence = 1 + while True: + data = stream.read(packet_size) + if not data: + log.info('sending EOT') + # end of stream + break + total_packets += 1 + data = data.ljust(packet_size, self.pad) + if crc_mode: + crc = self.calc_crc(data) + else: + crc = self.calc_checksum(data) + + # emit packet + while True: + if packet_size == 128: + self.putc(SOH) + else: # packet_size == 1024 + self.putc(STX) + self.putc(bytes([sequence])) + self.putc(bytes([0xff - sequence])) + self.putc(data) + if crc_mode: + self.putc(bytes([crc >> 8])) + self.putc(bytes([crc & 0xff])) + else: + self.putc(bytes([crc])) + + char = self.getc(1, timeout) + if char == ACK: + success_count += 1 + if isinstance(callback, collections.Callable): + callback(total_packets, success_count, error_count) + break + if char == NAK: + error_count += 1 + if isinstance(callback, collections.Callable): + callback(total_packets, success_count, error_count) + if error_count >= retry: + # excessive amounts of retransmissions requested, + # abort transfer + self.abort(timeout=timeout) + log.warning('excessive NAKs, transfer aborted') + return False + + # return to loop and resend + continue + else: + log.error('Not ACK, Not NAK') + error_count += 1 + if isinstance(callback, collections.Callable): + callback(total_packets, success_count, error_count) + if error_count >= retry: + # excessive amounts of retransmissions requested, + # abort transfer + self.abort(timeout=timeout) + log.warning('excessive protocol errors, transfer aborted') + return False + + # return to loop and resend + continue + + # protocol error + self.abort(timeout=timeout) + log.error('protocol error') + return False + + # keep track of sequence + sequence = (sequence + 1) % 0x100 + + while True: + # end of transmission + self.putc(EOT) + + #An ACK should be returned + char = self.getc(1, timeout) + if char == ACK: + break + else: + error_count += 1 + if error_count >= retry: + self.abort(timeout=timeout) + log.warning('EOT was not ACKd, transfer aborted') + return False + + return True + + def recv(self, stream, crc_mode=1, retry=16, timeout=60, delay=1, quiet=0): + ''' + Receive a stream via the XMODEM protocol. + + >>> stream = file('/etc/issue', 'wb') + >>> print modem.recv(stream) + 2342 + + Returns the number of bytes received on success or ``None`` in case of + failure. + ''' + + # initiate protocol + error_count = 0 + char = 0 + cancel = 0 + while True: + # first try CRC mode, if this fails, + # fall back to checksum mode + if error_count >= retry: + self.abort(timeout=timeout) + return None + elif crc_mode and error_count < (retry / 2): + if not self.putc(CRC): + time.sleep(delay) + error_count += 1 + else: + crc_mode = 0 + if not self.putc(NAK): + time.sleep(delay) + error_count += 1 + + char = self.getc(1, timeout) + if not char: + error_count += 1 + continue + elif char == SOH: + #crc_mode = 0 + break + elif char == STX: + break + elif char == CAN: + if cancel: + return None + else: + cancel = 1 + else: + error_count += 1 + + # read data + error_count = 0 + income_size = 0 + packet_size = 128 + sequence = 1 + cancel = 0 + while True: + while True: + if char == SOH: + packet_size = 128 + break + elif char == STX: + packet_size = 1024 + break + elif char == EOT: + # We received an EOT, so send an ACK and return the received + # data length + self.putc(ACK) + return income_size + elif char == CAN: + # cancel at two consecutive cancels + if cancel: + return None + else: + cancel = 1 + else: + if not quiet: + print('recv ERROR expected SOH/EOT, got', ord(char), file=sys.stderr) + error_count += 1 + if error_count >= retry: + self.abort() + return None + # read sequence + error_count = 0 + cancel = 0 + seq1 = ord(self.getc(1)) + seq2 = 0xff - ord(self.getc(1)) + if seq1 == sequence and seq2 == sequence: + # sequence is ok, read packet + # packet_size + checksum + data = self.getc(packet_size + 1 + crc_mode, timeout) + if crc_mode: + csum = (ord(data[-2]) << 8) + ord(data[-1]) + data = data[:-2] + log.debug('CRC (%04x <> %04x)' % \ + (csum, self.calc_crc(data))) + valid = csum == self.calc_crc(data) + else: + csum = data[-1] + data = data[:-1] + log.debug('checksum (checksum(%02x <> %02x)' % \ + (ord(csum), self.calc_checksum(data))) + valid = ord(csum) == self.calc_checksum(data) + + # valid data, append chunk + if valid: + income_size += len(data) + stream.write(data) + self.putc(ACK) + sequence = (sequence + 1) % 0x100 + char = self.getc(1, timeout) + continue + else: + # consume data + self.getc(packet_size + 1 + crc_mode) + self.debug('expecting sequence %d, got %d/%d' % \ + (sequence, seq1, seq2)) + + # something went wrong, request retransmission + self.putc(NAK) + + def calc_checksum(self, data, checksum=0): + ''' + Calculate the checksum for a given block of data, can also be used to + update a checksum. + + >>> csum = modem.calc_checksum('hello') + >>> csum = modem.calc_checksum('world', csum) + >>> hex(csum) + '0x3c' + + ''' + return (sum(map(ord, data)) + checksum) % 256 + + def calc_crc(self, data, crc=0): + ''' + Calculate the Cyclic Redundancy Check for a given block of data, can + also be used to update a CRC. + + >>> crc = modem.calc_crc('hello') + >>> crc = modem.calc_crc('world', crc) + >>> hex(crc) + '0xd5e3' + + ''' + for char in data: + crc = (crc << 8) ^ self.crctable[((crc >> 8) ^ int(char)) & 0xff] + return crc & 0xffff + + +XMODEM1k = partial(XMODEM, mode='xmodem1k') + + +def run(): + import optparse + import subprocess + + parser = optparse.OptionParser(usage='%prog [] filename filename') + parser.add_option('-m', '--mode', default='xmodem', + help='XMODEM mode (xmodem, xmodem1k)') + + options, args = parser.parse_args() + if len(args) != 3: + parser.error('invalid arguments') + return 1 + + elif args[0] not in ('send', 'recv'): + parser.error('invalid mode') + return 1 + + def _func(so, si): + import select + import subprocess + + print('si', si) + print('so', so) + + def getc(size, timeout=3): + w,t,f = select.select([so], [], [], timeout) + if w: + data = so.read(size) + else: + data = None + + print('getc(', repr(data), ')') + return data + + def putc(data, timeout=3): + w,t,f = select.select([], [si], [], timeout) + if t: + si.write(data) + si.flush() + size = len(data) + else: + size = None + + print('putc(', repr(data), repr(size), ')') + return size + + return getc, putc + + def _pipe(*command): + pipe = subprocess.Popen(command, + stdout=subprocess.PIPE, stdin=subprocess.PIPE) + return pipe.stdout, pipe.stdin + + if args[0] == 'recv': + import io + getc, putc = _func(*_pipe('sz', '--xmodem', args[2])) + stream = open(args[1], 'wb') + xmodem = XMODEM(getc, putc, mode=options.mode) + status = xmodem.recv(stream, retry=8) + stream.close() + + elif args[0] == 'send': + getc, putc = _func(*_pipe('rz', '--xmodem', args[2])) + stream = open(args[1], 'rb') + xmodem = XMODEM(getc, putc, mode=options.mode) + status = xmodem.send(stream, retry=8) + stream.close() + +if __name__ == '__main__': + sys.exit(run()) From 2f80460a2f81dd036dd4aa158f935884a3b71cd0 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Thu, 2 Jul 2020 22:57:58 +0200 Subject: [PATCH 0241/1293] Fluff M0: additional pins on version 1.3 of the board --- ports/atmel-samd/boards/fluff_m0/pins.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/atmel-samd/boards/fluff_m0/pins.c b/ports/atmel-samd/boards/fluff_m0/pins.c index d80d46b895..ac7811328b 100644 --- a/ports/atmel-samd/boards/fluff_m0/pins.c +++ b/ports/atmel-samd/boards/fluff_m0/pins.c @@ -30,6 +30,8 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA27) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA28) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, From 9dbb6fdb38c2089ad80666bc75986201d15b46a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Wed, 3 Jun 2020 23:25:19 +0100 Subject: [PATCH 0242/1293] Add a `.mailmap` file to collate together multiple author entries. This reduces the 484 separate authors into 405, removing some obviously invalid addresses on the way. --- .mailmap | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 .mailmap diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000000..f9d7f47a16 --- /dev/null +++ b/.mailmap @@ -0,0 +1,112 @@ +# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò +# +# SPDX-License-Identifier: Unlicense + +Alexander Steffen +Alexander Steffen +Alexander Steffen +Benjamin Vernoux +Brent Rubell +Brent Rubell +Brent Rubell +Carlos +Chris Packham +Chris Packham +Damiano Mazzella +Damien George +Dan Halbert +Dan Halbert +Daniel Pollard +Daniel Pollard +Daniel Tralamazza +Daniel Tralamazza +David Glaude +David Glaude +George Waters +George Waters +Ha Thach +Henrik Sölver +Ilya Dmitrichenko +Ilya Dmitrichenko +Jason Pecor <14111408+jpecor@users.noreply.github.com> +Jeff Epler +Jeff Epler +Jeff Epler +Jeff Epler +Jerry Needell +Joe Bakalor +Josh Klar +Josh Klar +Juan Biondi +Juan Biondi +KalbeAbbas +KalbeAbbas +Kamil Tomaszewski +Kamil Tomaszewski <46525824+kamtom480@users.noreply.github.com> +Kattni +Kattni Rembor +Kenny +Kenny <3454741+WarriorOfWire@users.noreply.github.com> +Kevin Townsend +Kevin Townsend +Krzysztof Blazewicz +Krzysztof Blazewicz +Li Weiwei +Li Weiwei +Limor "Ladyada" Fried +Limor "Ladyada" Fried +Lucian Copeland +Lucian Copeland +Mark Olsson +Mark Olsson +Matt Land +Matt Land +Matt Wozniski +Matt Wozniski +Melissa LeBlanc-Williams +Melissa LeBlanc-Williams +Metallicow +Metallicow +Peter Hinch +Peter Hinch +Radomir Dopieralski +Radomir Dopieralski +Rafa Gould +Rafa Gould <50337143+rafa-gould@users.noreply.github.com> +Ryan Shaw +Ryan Shaw +Sabas +Sabas +Sabas +Scott Shawcroft +Scott Shawcroft +Scott Shawcroft +Scott Shawcroft +Scott Shawcroft +Sebastian Plamauer +Sebastian Plamauer +Senuros +Senuros +Stewart Colborne +Stewart Colborne +TG-Techie +TG-Techie <39284876+TG-Techie@users.noreply.github.com> +Thea Flowers +Thea Flowers +Tobias Badertscher +Tobias Badertscher +danicampora +danicampora +dherrada +dherrada <33632497+dherrada@users.noreply.github.com> +dherrada <=> +glennrub +retoc +retoc +siddacious +siddacious +siddacious +sommersoft +sommersoft +stijn +stijn From f4a1cfb11667e6ded52249f6a59895cddea9b7a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Wed, 3 Jun 2020 23:27:48 +0100 Subject: [PATCH 0243/1293] Add LICENSES as identified by REUSE tooling. --- LICENSES/BSD-3-Clause.txt | 26 +++ LICENSES/CC-BY-4.0.txt | 324 ++++++++++++++++++++++++++++++++++++++ LICENSES/MIT.txt | 19 +++ LICENSES/Unlicense.txt | 20 +++ 4 files changed, 389 insertions(+) create mode 100644 LICENSES/BSD-3-Clause.txt create mode 100644 LICENSES/CC-BY-4.0.txt create mode 100644 LICENSES/MIT.txt create mode 100644 LICENSES/Unlicense.txt diff --git a/LICENSES/BSD-3-Clause.txt b/LICENSES/BSD-3-Clause.txt new file mode 100644 index 0000000000..0741db789e --- /dev/null +++ b/LICENSES/BSD-3-Clause.txt @@ -0,0 +1,26 @@ +Copyright (c) . All rights reserved. + +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. Neither the name of the copyright holder nor the names of its contributors +may be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT HOLDER OR CONTRIBUTORS 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. diff --git a/LICENSES/CC-BY-4.0.txt b/LICENSES/CC-BY-4.0.txt new file mode 100644 index 0000000000..3f92dfc5fd --- /dev/null +++ b/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/LICENSES/MIT.txt b/LICENSES/MIT.txt new file mode 100644 index 0000000000..204b93da48 --- /dev/null +++ b/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/LICENSES/Unlicense.txt b/LICENSES/Unlicense.txt new file mode 100644 index 0000000000..24a8f90199 --- /dev/null +++ b/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 From eed7e84d94efe038f8af13bbfcb889bb9cc2f363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Thu, 4 Jun 2020 08:49:24 +0100 Subject: [PATCH 0244/1293] Add an explicit SPDX license file for ter-u12n. While the .bdf file already includes copyright information, this makes it visible as part of REUSE SPDX identification. --- LICENSES/OFL-1.1.txt | 90 ++++++++++++++++++++++++++++++++ tools/fonts/ter-u12n.bdf.license | 3 ++ 2 files changed, 93 insertions(+) create mode 100644 LICENSES/OFL-1.1.txt create mode 100644 tools/fonts/ter-u12n.bdf.license diff --git a/LICENSES/OFL-1.1.txt b/LICENSES/OFL-1.1.txt new file mode 100644 index 0000000000..084c9628a6 --- /dev/null +++ b/LICENSES/OFL-1.1.txt @@ -0,0 +1,90 @@ +Copyright (c) , (), + +with Reserved Font Name . This Font Software is licensed +under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL +SIL OPEN FONT LICENSE + +Version 1.1 - 26 February 2007 + +PREAMBLE + +The goals of the Open Font License (OFL) are to stimulate worldwide development +of collaborative font projects, to support the font creation efforts of academic +and linguistic communities, and to provide a free and open framework in which +fonts may be shared and improved in partnership with others. + +The OFL allows the licensed fonts to be used, studied, modified and redistributed +freely as long as they are not sold by themselves. The fonts, including any +derivative works, can be bundled, embedded, redistributed and/or sold with +any software provided that any reserved names are not used by derivative works. +The fonts and derivatives, however, cannot be released under any other type +of license. The requirement for fonts to remain under this license does not +apply to any document created using the fonts or their derivatives. + +DEFINITIONS + +"Font Software" refers to the set of files released by the Copyright Holder(s) +under this license and clearly marked as such. This may include source files, +build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the copyright +statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, or +substituting — in part or in whole — any of the components of the Original +Version, by changing formats or by porting the Font Software to a new environment. + +"Author" refers to any designer, engineer, programmer, technical writer or +other person who contributed to the Font Software. + +PERMISSION & CONDITIONS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the Font Software, to use, study, copy, merge, embed, modify, redistribute, +and sell modified and unmodified copies of the Font Software, subject to the +following conditions: + +1) Neither the Font Software nor any of its individual components, in Original +or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, redistributed +and/or sold with any software, provided that each copy contains the above +copyright notice and this license. These can be included either as stand-alone +text files, human-readable headers or in the appropriate machine-readable +metadata fields within text or binary files as long as those fields can be +easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font Name(s) +unless explicit written permission is granted by the corresponding Copyright +Holder. This restriction only applies to the primary font name as presented +to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software +shall not be used to promote, endorse or advertise any Modified Version, except +to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) +or with their explicit written permission. + +5) The Font Software, modified or unmodified, in part or in whole, must be +distributed entirely under this license, and must not be distributed under +any other license. The requirement for fonts to remain under this license +does not apply to any document created using the Font Software. + +TERMINATION + +This license becomes null and void if any of the above conditions are not met. + +DISCLAIMER + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, +INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT +SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/tools/fonts/ter-u12n.bdf.license b/tools/fonts/ter-u12n.bdf.license new file mode 100644 index 0000000000..a40e8711de --- /dev/null +++ b/tools/fonts/ter-u12n.bdf.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Dimitar Toshkov Zhekov + +SPDX-License-Identifier: OFL-1.1 From d7e57259f9d6c73dfba46a4710625bde4e50979a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Thu, 4 Jun 2020 08:59:49 +0100 Subject: [PATCH 0245/1293] Add copyright and license information to translations. Since these have multiple copyright lines already, preserve those in addition to the generic 'contributors' line, but make them appear as SPDX lines. --- locale/ID.po | 7 +++---- locale/circuitpython.pot | 8 +++----- locale/cs.po | 7 +++---- locale/de_DE.po | 7 +++---- locale/en_US.po | 7 +++---- locale/en_x_pirate.po | 7 +++---- locale/es.po | 12 +++++++----- locale/fil.po | 7 +++---- locale/fr.po | 10 +++++----- locale/it_IT.po | 9 ++++----- locale/ko.po | 9 ++++----- locale/nl.po | 7 +++---- locale/pl.po | 8 ++++---- locale/pt_BR.po | 7 +++---- locale/sv.po | 7 +++---- locale/zh_Latn_pinyin.po | 8 ++++---- 16 files changed, 58 insertions(+), 69 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index a0c255b233..11834ec133 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -1,8 +1,7 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # +# SPDX-License-Identifier: MIT + msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 6e32ebab98..5abccd4bef 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1,9 +1,7 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # -#, fuzzy +# SPDX-License-Identifier: MIT + msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" diff --git a/locale/cs.po b/locale/cs.po index dfe1cfa384..bc4e3df05b 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -1,8 +1,7 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # +# SPDX-License-Identifier: MIT + msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" diff --git a/locale/de_DE.po b/locale/de_DE.po index f2d9258566..13afa135d5 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -1,8 +1,7 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # +# SPDX-License-Identifier: MIT + msgid "" msgstr "" "Project-Id-Version: \n" diff --git a/locale/en_US.po b/locale/en_US.po index c89772779e..de9fa6347d 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -1,8 +1,7 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # +# SPDX-License-Identifier: MIT + msgid "" msgstr "" "Project-Id-Version: \n" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 16f2b3669a..40b0b314c4 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -1,8 +1,7 @@ -# Pirate (English) Translation -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # +# SPDX-License-Identifier: MIT + msgid "" msgstr "" "Project-Id-Version: \n" diff --git a/locale/es.po b/locale/es.po index 423d673617..b3963e98b4 100644 --- a/locale/es.po +++ b/locale/es.po @@ -1,8 +1,10 @@ -# Spanish translation. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# Carlos Diaz , 2018. -# Juan Biondi , 2018. +# SPDX-FileCopyrightText: 2018 Carlos Diaz +# SPDX-FileCopyrightText: 2018 Juan Biondi +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT +#, fuzzy + msgid "" msgstr "" "Project-Id-Version: \n" diff --git a/locale/fil.po b/locale/fil.po index 3489316130..b5058c8722 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -1,8 +1,7 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # +# SPDX-License-Identifier: MIT + msgid "" msgstr "" "Project-Id-Version: \n" diff --git a/locale/fr.po b/locale/fr.po index 2db7f47222..d292fad249 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -1,9 +1,9 @@ -# French translation. -# Copyright (C) 2018 -# This file is distributed under the same license as the PACKAGE package. -# Pierrick Couturier , 2018. -# Olivier Deveault +# SPDX-FileCopyrightText: 2018 Pierrick Couturier +# SPDX-FileCopyrightText: 2018 Olivier Deveault +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # +# SPDX-License-Identifier: MIT + msgid "" msgstr "" "Project-Id-Version: 0.1\n" diff --git a/locale/it_IT.po b/locale/it_IT.po index bd49e2388b..6bc322a537 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -1,9 +1,8 @@ -# Italian translation. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# Enrico Paganin , 2018 +# SPDX-FileCopyrightText: 2018 Enrico Paganin +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # -#, fuzzy +# SPDX-License-Identifier: MIT + msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" diff --git a/locale/ko.po b/locale/ko.po index 4bd56cde1e..c0dffe1d5d 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -1,9 +1,8 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# 글라파, 2019. +# SPDX-FileCopyrightText: 2019 글라파 +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # -#, fuzzy +# SPDX-License-Identifier: MIT + msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" diff --git a/locale/nl.po b/locale/nl.po index 34e9c835a2..69d739a22f 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -1,8 +1,7 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # +# SPDX-License-Identifier: MIT + msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" diff --git a/locale/pl.po b/locale/pl.po index 7724481314..b100ffae08 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -1,8 +1,8 @@ -# Adafruit CircuitPython Polish Translation -# Copyright (C) 2019 -# This file is distributed under the same license as the CircuitPython package. -# Radomir Dopieralski , 2019. +# SPDX-FileCopyrightText: 2019 Radomir Dopieralski +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # +# SPDX-License-Identifier: MIT + msgid "" msgstr "" "Project-Id-Version: \n" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index f25d2d86e6..d6e2e83f5d 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -1,8 +1,7 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # +# SPDX-License-Identifier: MIT + msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" diff --git a/locale/sv.po b/locale/sv.po index 3ec91c19ee..a8579794a4 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -1,8 +1,7 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # +# SPDX-License-Identifier: MIT + msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index db41adb536..e8898d79e1 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -1,8 +1,8 @@ -# Adafruit CircuitPython Chinese Hanyu Pinyin Translation -# Copyright (C) 2019 -# This file is distributed under the same license as the CircuitPython package. -# @hexthat#2155, 2019. +# SPDX-FileCopyrightText: 2019 @hexthat#2155 +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # +# SPDX-License-Identifier: MIT + msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" From 34b4993d63a6b576f29d624385c681f679b4124c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Wed, 3 Jun 2020 23:40:05 +0100 Subject: [PATCH 0246/1293] Add license to some obvious files. --- .gitattributes | 4 +++ .github/workflows/build.yml | 4 +++ .github/workflows/create_website_pr.yml | 4 +++ .gitignore | 4 +++ .gitmodules | 4 +++ .readthedocs.yml | 4 +++ .rosie.yml | 4 +++ ACKNOWLEDGEMENTS.license | 3 ++ BUILDING.md | 5 +++ CONTRIBUTING.md | 6 ++++ Makefile | 4 +++ conf.py | 4 +++ docs/shared_bindings_matrix.py | 2 +- docs/static/favicon.ico.license | 3 ++ drivers/bus/qspi.h | 2 +- drivers/bus/softqspi.c | 2 +- drivers/bus/softspi.c | 2 +- drivers/bus/spi.h | 2 +- extmod/font_petme128_8x8.h | 30 +++------------- extmod/machine_mem.c | 29 +++------------ extmod/machine_mem.h | 30 +++------------- extmod/machine_pinbase.c | 29 +++------------ extmod/machine_pinbase.h | 30 +++------------- extmod/machine_pulse.c | 29 +++------------ extmod/machine_pulse.h | 30 +++------------- extmod/machine_signal.c | 29 +++------------ extmod/machine_signal.h | 30 +++------------- extmod/misc.h | 32 ++++------------- extmod/modbtree.c | 29 +++------------ extmod/modframebuf.c | 29 +++------------ extmod/modlwip.c | 33 ++++------------- extmod/modonewire.c | 29 +++------------ extmod/modubinascii.c | 29 +++------------ extmod/modubinascii.h | 30 +++------------- extmod/moductypes.c | 29 +++------------ extmod/moduhashlib.c | 29 +++------------ extmod/moduheapq.c | 29 +++------------ extmod/modujson.c | 29 +++------------ extmod/modurandom.c | 29 +++------------ extmod/modure.c | 29 +++------------ extmod/moduselect.c | 29 +++------------ extmod/modussl_axtls.c | 29 +++------------ extmod/modussl_mbedtls.c | 29 +++------------ extmod/modutimeq.c | 31 +++------------- extmod/moduzlib.c | 29 +++------------ extmod/modwebrepl.c | 29 +++------------ extmod/modwebsocket.c | 29 +++------------ extmod/modwebsocket.h | 4 +++ extmod/uos_dupterm.c | 31 +++------------- extmod/utime_mphal.c | 31 +++------------- extmod/utime_mphal.h | 32 ++++------------- extmod/vfs.c | 29 +++------------ extmod/vfs.h | 30 +++------------- extmod/vfs_fat.c | 31 +++------------- extmod/vfs_fat.h | 30 +++------------- extmod/vfs_fat_diskio.c | 32 +++-------------- extmod/vfs_fat_file.c | 29 +++------------ extmod/vfs_posix.c | 29 +++------------ extmod/vfs_posix.h | 30 +++------------- extmod/vfs_posix_file.c | 29 +++------------ extmod/vfs_reader.c | 29 +++------------ extmod/virtpin.c | 29 +++------------ extmod/virtpin.h | 30 +++------------- lib/libc/string0.c | 2 +- lib/libm/math.c | 2 +- lib/mp-readline/readline.c | 2 +- lib/mp-readline/readline.h | 2 +- lib/netutils/netutils.c | 2 +- lib/netutils/netutils.h | 2 +- lib/oofatfs/ffconf.h | 2 +- lib/timeutils/timeutils.c | 2 +- lib/timeutils/timeutils.h | 2 +- lib/utils/interrupt_char.c | 2 +- lib/utils/interrupt_char.h | 2 +- lib/utils/printf.c | 2 +- lib/utils/pyexec.c | 2 +- lib/utils/pyexec.h | 2 +- lib/utils/sys_stdio_mphal.c | 2 +- ...CircuitPython_Repo_header_logo.png.license | 3 ++ logo/adafruit_blinka_angles-back.svg.license | 3 ++ logo/adafruit_blinka_angles-front.svg.license | 3 ++ logo/adafruit_blinka_angles-left.svg.license | 3 ++ logo/adafruit_blinka_angles-right.svg.license | 3 ++ logo/adafruit_blinka_computer.svg.license | 3 ++ ..._circuit_python_ourboros_color.svg.license | 3 ++ ...it_python_ouroboros_logo_final.svg.license | 3 ++ ...t_circuit_python_sitting_color.svg.license | 3 ++ ...thon_stacked_lockup_logo_final.svg.license | 3 ++ logo/awesome_circuitpython.svg.license | 3 ++ logo/blinka_colorform-cooking.png.license | 3 ++ logo/blinka_colorform-cooking.svg.license | 3 ++ ...linka_colorform-first-birthday.svg.license | 3 ++ logo/blinka_colorform-painting.svg.license | 3 ++ logo/blinka_colorform-reading.svg.license | 3 ++ logo/blinka_colorform-singing.svg.license | 3 ++ logo/blinka_colorform-telescope.svg.license | 3 ++ logo/blinka_colorform-test_tubes.svg.license | 3 ++ mpy-cross/.gitignore | 4 +++ mpy-cross/Makefile | 4 +++ mpy-cross/Makefile.fuzz | 3 ++ mpy-cross/Makefile.static | 4 +++ mpy-cross/Makefile.static-mingw | 4 +++ mpy-cross/Makefile.static-raspbian | 4 +++ mpy-cross/README.md | 6 ++++ mpy-cross/fmode.c | 29 +++------------ mpy-cross/fmode.h | 30 +++------------- mpy-cross/gccollect.c | 29 +++------------ mpy-cross/main.c | 29 +++------------ mpy-cross/mpconfigport.h | 29 +++------------ mpy-cross/mphalport.h | 4 +++ mpy-cross/mpy-cross.mk | 4 +++ mpy-cross/qstrdefsport.h | 4 +++ ports/atmel-samd/Makefile | 2 +- .../common-hal/analogio/AnalogOut.c | 2 +- ports/atmel-samd/common-hal/board/__init__.c | 2 +- ports/atmel-samd/common-hal/busio/UART.c | 2 +- ports/atmel-samd/common-hal/pulseio/PWMOut.c | 2 +- .../atmel-samd/common-hal/pulseio/PulseOut.c | 2 +- ports/atmel-samd/fatfs_port.c | 2 +- ports/atmel-samd/supervisor/internal_flash.c | 2 +- ports/atmel-samd/supervisor/internal_flash.h | 2 +- ports/atmel-samd/tools/gen_pin_name_table.py | 2 +- ports/esp32s2/Makefile | 2 +- ports/esp32s2/fatfs_port.c | 2 +- ports/esp32s2/supervisor/internal_flash.c | 2 +- ports/esp32s2/supervisor/internal_flash.h | 2 +- ports/litex/Makefile | 2 +- ports/litex/fatfs_port.c | 2 +- ports/litex/supervisor/internal_flash.c | 2 +- ports/litex/supervisor/internal_flash.h | 2 +- ports/mimxrt10xx/Makefile | 4 +-- .../common-hal/analogio/AnalogOut.c | 2 +- ports/mimxrt10xx/common-hal/board/__init__.c | 2 +- ports/mimxrt10xx/common-hal/busio/UART.c | 2 +- ports/mimxrt10xx/common-hal/pulseio/PWMOut.c | 2 +- .../mimxrt10xx/common-hal/pulseio/PulseOut.c | 2 +- ports/mimxrt10xx/fatfs_port.c | 2 +- ports/mimxrt10xx/supervisor/internal_flash.c | 2 +- ports/mimxrt10xx/supervisor/internal_flash.h | 2 +- ports/nrf/Makefile | 2 +- ports/nrf/examples/ubluepy_temp.py | 2 +- ports/nrf/fatfs_port.c | 2 +- ports/nrf/peripherals/nrf/nvm.c | 2 +- ports/nrf/peripherals/nrf/nvm.h | 2 +- ports/nrf/supervisor/internal_flash.c | 2 +- ports/nrf/supervisor/internal_flash.h | 2 +- ports/stm/Makefile | 4 +-- ports/stm/common-hal/analogio/AnalogOut.c | 2 +- ports/stm/fatfs_port.c | 2 +- ports/stm/supervisor/internal_flash.c | 2 +- ports/stm/supervisor/internal_flash.h | 2 +- ports/stm/tools/parse_af_csv.py | 2 +- ports/stm/tools/parse_pins_csv.py | 2 +- ports/unix/fdfile.h | 2 +- ports/unix/file.c | 2 +- ports/unix/gccollect.c | 2 +- ports/unix/input.c | 2 +- ports/unix/main.c | 2 +- ports/unix/modffi.c | 2 +- ports/unix/modmachine.c | 2 +- ports/unix/modos.c | 2 +- ports/unix/modtime.c | 2 +- ports/unix/moduos_vfs.c | 2 +- ports/unix/moduselect.c | 2 +- ports/unix/modusocket.c | 2 +- ports/unix/mpconfigport.h | 2 +- ports/unix/mpconfigport_coverage.h | 2 +- ports/unix/mpconfigport_fast.h | 2 +- ports/unix/mpconfigport_freedos.h | 2 +- ports/unix/mpconfigport_minimal.h | 2 +- ports/unix/mpconfigport_nanbox.h | 2 +- ports/unix/mphalport.h | 2 +- ports/unix/mpthreadport.c | 2 +- ports/unix/mpthreadport.h | 2 +- ports/unix/qstrdefsport.h | 2 +- ports/unix/unix_mphal.c | 2 +- py/argcheck.c | 2 +- py/asmarm.c | 2 +- py/asmarm.h | 2 +- py/asmbase.c | 2 +- py/asmbase.h | 2 +- py/asmthumb.c | 2 +- py/asmthumb.h | 2 +- py/asmx64.c | 2 +- py/asmx64.h | 2 +- py/asmx86.c | 2 +- py/asmx86.h | 2 +- py/asmxtensa.c | 2 +- py/asmxtensa.h | 2 +- py/bc.c | 2 +- py/bc.h | 2 +- py/bc0.h | 2 +- py/binary.c | 2 +- py/binary.h | 2 +- py/builtin.h | 2 +- py/builtinevex.c | 2 +- py/builtinhelp.c | 2 +- py/builtinimport.c | 2 +- py/circuitpy_defns.mk | 2 +- py/circuitpy_mpconfig.mk | 2 +- py/compile.c | 2 +- py/compile.h | 2 +- py/emit.h | 2 +- py/emitbc.c | 2 +- py/emitcommon.c | 2 +- py/emitglue.c | 2 +- py/emitglue.h | 2 +- py/emitinlinethumb.c | 2 +- py/emitinlinextensa.c | 2 +- py/emitnative.c | 2 +- py/formatfloat.c | 2 +- py/formatfloat.h | 2 +- py/frozenmod.c | 2 +- py/frozenmod.h | 2 +- py/gc.c | 2 +- py/gc.h | 2 +- py/grammar.h | 2 +- py/ioctl.h | 2 +- py/lexer.c | 2 +- py/lexer.h | 2 +- py/malloc.c | 2 +- py/map.c | 2 +- py/misc.h | 2 +- py/modarray.c | 2 +- py/modbuiltins.c | 2 +- py/modcmath.c | 2 +- py/modcollections.c | 2 +- py/modgc.c | 2 +- py/modio.c | 2 +- py/modmath.c | 2 +- py/modmicropython.c | 2 +- py/modstruct.c | 2 +- py/modsys.c | 2 +- py/modthread.c | 2 +- py/moduerrno.c | 2 +- py/mpconfig.h | 2 +- py/mperrno.h | 2 +- py/mphal.h | 2 +- py/mpprint.c | 2 +- py/mpprint.h | 2 +- py/mpstate.c | 2 +- py/mpstate.h | 2 +- py/mpthread.h | 2 +- py/mpz.c | 2 +- py/mpz.h | 2 +- py/nativeglue.c | 2 +- py/nlr.c | 2 +- py/nlr.h | 2 +- py/nlrsetjmp.c | 2 +- py/nlrthumb.c | 2 +- py/nlrx64.c | 2 +- py/nlrx86.c | 2 +- py/nlrxtensa.c | 2 +- py/obj.c | 2 +- py/obj.h | 2 +- py/objarray.c | 2 +- py/objarray.h | 2 +- py/objattrtuple.c | 2 +- py/objbool.c | 2 +- py/objboundmeth.c | 2 +- py/objcell.c | 2 +- py/objclosure.c | 2 +- py/objcomplex.c | 2 +- py/objdict.c | 2 +- py/objenumerate.c | 2 +- py/objexcept.c | 2 +- py/objexcept.h | 2 +- py/objfilter.c | 2 +- py/objfloat.c | 2 +- py/objfun.c | 2 +- py/objfun.h | 2 +- py/objgenerator.c | 2 +- py/objgenerator.h | 2 +- py/objgetitemiter.c | 2 +- py/objint.c | 2 +- py/objint.h | 2 +- py/objint_longlong.c | 2 +- py/objint_mpz.c | 2 +- py/objlist.c | 2 +- py/objlist.h | 2 +- py/objmap.c | 2 +- py/objmodule.c | 2 +- py/objmodule.h | 2 +- py/objnamedtuple.c | 2 +- py/objnamedtuple.h | 2 +- py/objnone.c | 2 +- py/objobject.c | 2 +- py/objproperty.c | 2 +- py/objproperty.h | 2 +- py/objrange.c | 2 +- py/objreversed.c | 2 +- py/objset.c | 2 +- py/objsingleton.c | 2 +- py/objslice.c | 2 +- py/objstr.c | 2 +- py/objstr.h | 2 +- py/objstringio.c | 2 +- py/objstringio.h | 2 +- py/objstrunicode.c | 2 +- py/objtuple.c | 2 +- py/objtuple.h | 2 +- py/objtype.c | 2 +- py/objtype.h | 2 +- py/objzip.c | 2 +- py/opmethods.c | 2 +- py/parse.c | 2 +- py/parse.h | 2 +- py/parsenum.c | 2 +- py/parsenum.h | 2 +- py/parsenumbase.c | 2 +- py/parsenumbase.h | 2 +- py/persistentcode.c | 2 +- py/persistentcode.h | 2 +- py/pystack.c | 2 +- py/pystack.h | 2 +- py/qstr.c | 2 +- py/qstr.h | 2 +- py/qstrdefs.h | 2 +- py/reader.c | 2 +- py/reader.h | 2 +- py/repl.c | 2 +- py/repl.h | 2 +- py/runtime.c | 2 +- py/runtime.h | 2 +- py/runtime0.h | 2 +- py/scheduler.c | 2 +- py/scope.c | 2 +- py/scope.h | 2 +- py/sequence.c | 2 +- py/showbc.c | 2 +- py/smallint.c | 2 +- py/smallint.h | 2 +- py/stream.c | 2 +- py/stream.h | 2 +- py/unicode.c | 2 +- py/unicode.h | 2 +- py/vm.c | 2 +- py/vmentrytable.h | 2 +- py/vstr.c | 2 +- py/warning.c | 2 +- setup.py | 4 +++ shared-bindings/analogio/AnalogIn.c | 2 +- shared-bindings/analogio/AnalogIn.h | 2 +- shared-bindings/analogio/AnalogOut.c | 2 +- shared-bindings/analogio/AnalogOut.h | 2 +- shared-bindings/digitalio/DigitalInOut.c | 2 +- shared-bindings/digitalio/DigitalInOut.h | 2 +- shared-bindings/gnss/GNSS.c | 28 ++------------- shared-bindings/gnss/GNSS.h | 28 ++------------- shared-bindings/gnss/PositionFix.c | 28 ++------------- shared-bindings/gnss/PositionFix.h | 28 ++------------- shared-bindings/gnss/SatelliteSystem.c | 28 ++------------- shared-bindings/gnss/SatelliteSystem.h | 28 ++------------- shared-bindings/gnss/__init__.c | 28 ++------------- shared-bindings/math/__init__.c | 2 +- shared-bindings/network/__init__.c | 2 +- shared-bindings/network/__init__.h | 2 +- shared-bindings/os/__init__.c | 2 +- shared-bindings/pulseio/PWMOut.c | 2 +- shared-bindings/pulseio/PWMOut.h | 2 +- shared-bindings/pulseio/PulseOut.h | 2 +- shared-bindings/rtc/RTC.c | 2 +- shared-bindings/rtc/__init__.c | 2 +- shared-bindings/socket/__init__.c | 2 +- shared-bindings/storage/__init__.c | 2 +- shared-bindings/struct/__init__.c | 2 +- shared-bindings/time/__init__.c | 2 +- shared-bindings/touchio/TouchIn.c | 2 +- shared-bindings/touchio/TouchIn.h | 2 +- shared-bindings/wiznet/__init__.c | 2 +- shared-bindings/wiznet/wiznet5k.c | 2 +- shared-module/bitbangio/I2C.c | 2 +- shared-module/bitbangio/SPI.c | 2 +- shared-module/network/__init__.h | 2 +- shared-module/os/__init__.c | 2 +- shared-module/storage/__init__.c | 2 +- shared-module/wiznet/wiznet5k.c | 2 +- shared-module/wiznet/wiznet5k.h | 2 +- supervisor/flash.h | 2 +- .../shared/external_flash/common_commands.h | 2 +- supervisor/stub/internal_flash.c | 2 +- tests/skip_if.py | 23 ++---------- tests/thread/mutate_bytearray.py | 4 ++- tests/thread/mutate_dict.py | 4 ++- tests/thread/mutate_instance.py | 4 ++- tests/thread/mutate_list.py | 4 ++- tests/thread/mutate_set.py | 4 ++- tests/thread/stress_aes.py | 4 ++- tests/thread/stress_heap.py | 4 ++- tests/thread/stress_recurse.py | 4 ++- tests/thread/thread_exc1.py | 4 ++- tests/thread/thread_exit1.py | 4 ++- tests/thread/thread_exit2.py | 4 ++- tests/thread/thread_gc1.py | 4 ++- tests/thread/thread_ident1.py | 4 ++- tests/thread/thread_lock1.py | 4 ++- tests/thread/thread_lock2.py | 4 ++- tests/thread/thread_lock3.py | 4 ++- tests/thread/thread_lock4.py | 4 ++- tests/thread/thread_qstr1.py | 4 ++- tests/thread/thread_shared1.py | 4 ++- tests/thread/thread_shared2.py | 4 ++- tests/thread/thread_sleep1.py | 4 ++- tests/thread/thread_stacksize1.py | 4 ++- tests/thread/thread_start1.py | 4 ++- tests/thread/thread_start2.py | 4 ++- tools/analyze_heap_dump.py | 4 +++ tools/analyze_mpy.py | 4 +++ tools/bootstrap_upip.sh | 4 +++ tools/build-stm-latest.sh | 4 +++ tools/build_board_info.py | 4 +++ tools/build_memory_info.py | 27 +++----------- tools/build_release_files.py | 4 +++ tools/chart_code_size.py | 4 +++ tools/check_code_size.sh | 5 +++ tools/check_translations.py | 4 +++ tools/ci_new_boards_check.py | 4 +++ tools/codestats.sh | 5 +++ tools/convert_release_notes.py | 4 +++ tools/cpboard.py | 35 ++++--------------- tools/dfu.py | 4 +++ tools/extract_pyi.py | 4 +++ tools/file2h.py | 4 +++ tools/fixup_translations.py | 4 +++ tools/gc_activity.py | 4 +++ tools/gc_activity_between_collects.py | 4 +++ tools/gen-changelog.sh | 4 +++ tools/gen_display_resources.py | 4 +++ tools/gen_ld_files.py | 5 +++ tools/gen_usb_descriptor.py | 4 +++ tools/gendoc.py | 4 +++ tools/git-checkout-latest-tag.sh | 5 +++ tools/hid_report_descriptors.py | 23 ++---------- tools/insert-usb-ids.py | 4 +++ tools/join_bins.py | 4 +++ tools/make-frozen.py | 5 +++ tools/mpy-tool.py | 27 +++----------- tools/mpy_bin2res.py | 5 +++ tools/mpy_cross_all.py | 5 +++ tools/preprocess_frozen_modules.py | 5 +++ tools/print_status.py | 4 +++ tools/pyboard.py | 29 +++------------ tools/pydfu.py | 9 ++--- tools/tinytest-codegen.py | 4 +++ tools/upip.py | 10 +++--- tools/upip_utarfile.py | 4 +++ 446 files changed, 928 insertions(+), 1865 deletions(-) create mode 100644 ACKNOWLEDGEMENTS.license create mode 100644 docs/static/favicon.ico.license create mode 100644 logo/CircuitPython_Repo_header_logo.png.license create mode 100644 logo/adafruit_blinka_angles-back.svg.license create mode 100644 logo/adafruit_blinka_angles-front.svg.license create mode 100644 logo/adafruit_blinka_angles-left.svg.license create mode 100644 logo/adafruit_blinka_angles-right.svg.license create mode 100644 logo/adafruit_blinka_computer.svg.license create mode 100644 logo/adafruit_circuit_python_ourboros_color.svg.license create mode 100644 logo/adafruit_circuit_python_ouroboros_logo_final.svg.license create mode 100644 logo/adafruit_circuit_python_sitting_color.svg.license create mode 100644 logo/adafruit_circuit_python_stacked_lockup_logo_final.svg.license create mode 100644 logo/awesome_circuitpython.svg.license create mode 100644 logo/blinka_colorform-cooking.png.license create mode 100644 logo/blinka_colorform-cooking.svg.license create mode 100644 logo/blinka_colorform-first-birthday.svg.license create mode 100644 logo/blinka_colorform-painting.svg.license create mode 100644 logo/blinka_colorform-reading.svg.license create mode 100644 logo/blinka_colorform-singing.svg.license create mode 100644 logo/blinka_colorform-telescope.svg.license create mode 100644 logo/blinka_colorform-test_tubes.svg.license diff --git a/.gitattributes b/.gitattributes index 7d1fdfe33e..5ebde95f07 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # Per default everything gets normalized and gets LF line endings on checkout. * text eol=lf diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa7dd9dd25..b022dc2474 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + name: Build CI on: diff --git a/.github/workflows/create_website_pr.yml b/.github/workflows/create_website_pr.yml index 9907c08ae6..71959ffdcd 100644 --- a/.github/workflows/create_website_pr.yml +++ b/.github/workflows/create_website_pr.yml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + name: Update CircuitPython.org on: diff --git a/.gitignore b/.gitignore index 8a773970d3..475a1183ff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # Compiled Sources ################### *.o diff --git a/.gitmodules b/.gitmodules index a990aed2ab..f09a1e4c68 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + [submodule "lib/axtls"] path = lib/axtls url = https://github.com/pfalcon/axtls diff --git a/.readthedocs.yml b/.readthedocs.yml index 6ff5f2422d..4030bc3178 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # .readthedocs.yml # Read the Docs configuration file # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details diff --git a/.rosie.yml b/.rosie.yml index 3f7f9bb1d7..52a8802de2 100644 --- a/.rosie.yml +++ b/.rosie.yml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # This configuration file tells Rosie where to find prebuilt .bin files (Travis # builds them) and where to find the tests. diff --git a/ACKNOWLEDGEMENTS.license b/ACKNOWLEDGEMENTS.license new file mode 100644 index 0000000000..d25be17638 --- /dev/null +++ b/ACKNOWLEDGEMENTS.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) + +SPDX-License-Identifier: MIT diff --git a/BUILDING.md b/BUILDING.md index bc60026785..10d7d8f4af 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,3 +1,8 @@ + # Building CircuitPython diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0d85926310..29db397932 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,9 @@ + + # Contributing Please note that this project is released with a [Contributor Code of Conduct](https://github.com/adafruit/circuitpython/blob/main/CODE_OF_CONDUCT.md). diff --git a/Makefile b/Makefile index d45dae8b90..74d3d88c77 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # Top-level Makefile for documentation builds and miscellaneous tasks. # diff --git a/conf.py b/conf.py index 43f689648d..37e611dbb8 100644 --- a/conf.py +++ b/conf.py @@ -13,6 +13,10 @@ # All configuration values have a default; values that are commented out # serve to show the default. +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + import json import logging import os diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index 4abf5b8859..7b96c14f29 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -1,6 +1,6 @@ # The MIT License (MIT) # -# Copyright (c) 2019 Michael Schroeder +# SPDX-FileCopyrightText: Copyright (c) 2019 Michael Schroeder # # 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/docs/static/favicon.ico.license b/docs/static/favicon.ico.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/docs/static/favicon.ico.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/drivers/bus/qspi.h b/drivers/bus/qspi.h index 31c9d14fca..81587b08b3 100644 --- a/drivers/bus/qspi.h +++ b/drivers/bus/qspi.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2017-2018 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2017-2018 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 diff --git a/drivers/bus/softqspi.c b/drivers/bus/softqspi.c index 10c5992466..87f7c8ae8c 100644 --- a/drivers/bus/softqspi.c +++ b/drivers/bus/softqspi.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2017-2018 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2017-2018 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 diff --git a/drivers/bus/softspi.c b/drivers/bus/softspi.c index bc12d89d3b..feb8e00d38 100644 --- a/drivers/bus/softspi.c +++ b/drivers/bus/softspi.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016-2018 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2016-2018 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 diff --git a/drivers/bus/spi.h b/drivers/bus/spi.h index 6d1b9c2f83..5d150cd38f 100644 --- a/drivers/bus/spi.h +++ b/drivers/bus/spi.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016-2018 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2016-2018 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 diff --git a/extmod/font_petme128_8x8.h b/extmod/font_petme128_8x8.h index 9963698b17..632397dfe3 100644 --- a/extmod/font_petme128_8x8.h +++ b/extmod/font_petme128_8x8.h @@ -1,28 +1,8 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George +// +// SPDX-License-Identifier: MIT + #ifndef MICROPY_INCLUDED_STM32_FONT_PETME128_8X8_H #define MICROPY_INCLUDED_STM32_FONT_PETME128_8X8_H diff --git a/extmod/machine_mem.c b/extmod/machine_mem.c index e0649290ef..6c6e110631 100644 --- a/extmod/machine_mem.c +++ b/extmod/machine_mem.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George +// +// SPDX-License-Identifier: MIT #include "py/runtime.h" #include "extmod/machine_mem.h" diff --git a/extmod/machine_mem.h b/extmod/machine_mem.h index a48a52c820..735887c60e 100644 --- a/extmod/machine_mem.h +++ b/extmod/machine_mem.h @@ -1,28 +1,8 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2015 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2015 Damien P. George +// +// SPDX-License-Identifier: MIT + #ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_MEM_H #define MICROPY_INCLUDED_EXTMOD_MACHINE_MEM_H diff --git a/extmod/machine_pinbase.c b/extmod/machine_pinbase.c index 6cd14c187e..a5e33c5602 100644 --- a/extmod/machine_pinbase.c +++ b/extmod/machine_pinbase.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2016 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT #include "py/mpconfig.h" #if MICROPY_PY_MACHINE diff --git a/extmod/machine_pinbase.h b/extmod/machine_pinbase.h index c96abbc46c..b747563a1e 100644 --- a/extmod/machine_pinbase.h +++ b/extmod/machine_pinbase.h @@ -1,28 +1,8 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2016 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT + #ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H #define MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H diff --git a/extmod/machine_pulse.c b/extmod/machine_pulse.c index 5f837479dd..eaee12b367 100644 --- a/extmod/machine_pulse.c +++ b/extmod/machine_pulse.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George +// +// SPDX-License-Identifier: MIT #include "py/runtime.h" #include "py/mperrno.h" diff --git a/extmod/machine_pulse.h b/extmod/machine_pulse.h index e303dca02e..a9b0ebc1b4 100644 --- a/extmod/machine_pulse.h +++ b/extmod/machine_pulse.h @@ -1,28 +1,8 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George +// +// SPDX-License-Identifier: MIT + #ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H #define MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H diff --git a/extmod/machine_signal.c b/extmod/machine_signal.c index 50501e34fe..a215fc3889 100644 --- a/extmod/machine_signal.c +++ b/extmod/machine_signal.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2017 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT #include "py/mpconfig.h" #if MICROPY_PY_MACHINE diff --git a/extmod/machine_signal.h b/extmod/machine_signal.h index df1c3e2e90..17ffe5563f 100644 --- a/extmod/machine_signal.h +++ b/extmod/machine_signal.h @@ -1,28 +1,8 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2017 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT + #ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H #define MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H diff --git a/extmod/misc.h b/extmod/misc.h index d6f6d859c6..3e12e56719 100644 --- a/extmod/misc.h +++ b/extmod/misc.h @@ -1,29 +1,9 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2014-2016 Damien P. George - * Copyright (c) 2016 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2016 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2014-2016 Damien P. George +// +// SPDX-License-Identifier: MIT + #ifndef MICROPY_INCLUDED_EXTMOD_MISC_H #define MICROPY_INCLUDED_EXTMOD_MISC_H diff --git a/extmod/modbtree.c b/extmod/modbtree.c index 7cfa9c6afb..9f5261b1b7 100644 --- a/extmod/modbtree.c +++ b/extmod/modbtree.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2016 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT #include #include diff --git a/extmod/modframebuf.c b/extmod/modframebuf.c index c59d1592ba..07a50a2f4c 100644 --- a/extmod/modframebuf.c +++ b/extmod/modframebuf.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George +// +// SPDX-License-Identifier: MIT #include #include diff --git a/extmod/modlwip.c b/extmod/modlwip.c index 776b81ee51..20cc3a6594 100644 --- a/extmod/modlwip.c +++ b/extmod/modlwip.c @@ -1,30 +1,9 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013, 2014 Damien P. George - * Copyright (c) 2015 Galen Hazelwood - * Copyright (c) 2015-2017 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2015 Galen Hazelwood +// Copyright (c) 2015-2017 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George +// +// SPDX-License-Identifier: MIT #include #include diff --git a/extmod/modonewire.c b/extmod/modonewire.c index 53c9456c20..1b085a0555 100644 --- a/extmod/modonewire.c +++ b/extmod/modonewire.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2015-2017 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2015-2017 Damien P. George +// +// SPDX-License-Identifier: MIT #include #include diff --git a/extmod/modubinascii.c b/extmod/modubinascii.c index 0f64b27151..32c36eea6d 100644 --- a/extmod/modubinascii.c +++ b/extmod/modubinascii.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2014 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2014 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT #include #include diff --git a/extmod/modubinascii.h b/extmod/modubinascii.h index fb31692678..eb47e286bf 100644 --- a/extmod/modubinascii.h +++ b/extmod/modubinascii.h @@ -1,28 +1,8 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2014 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2014 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT + #ifndef MICROPY_INCLUDED_EXTMOD_MODUBINASCII_H #define MICROPY_INCLUDED_EXTMOD_MODUBINASCII_H diff --git a/extmod/moductypes.c b/extmod/moductypes.c index 451dc29ed9..a384f1e2c2 100644 --- a/extmod/moductypes.c +++ b/extmod/moductypes.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2014 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2014 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT #include #include diff --git a/extmod/moduhashlib.c b/extmod/moduhashlib.c index 970c63da82..95485de138 100644 --- a/extmod/moduhashlib.c +++ b/extmod/moduhashlib.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2014 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2014 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT #include #include diff --git a/extmod/moduheapq.c b/extmod/moduheapq.c index db17e8ca21..bc4b97ff5b 100644 --- a/extmod/moduheapq.c +++ b/extmod/moduheapq.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2014 Damien P. George +// +// SPDX-License-Identifier: MIT #include "py/objlist.h" #include "py/runtime.h" diff --git a/extmod/modujson.c b/extmod/modujson.c index 0f93ccb110..5e90839582 100644 --- a/extmod/modujson.c +++ b/extmod/modujson.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2014-2016 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2014-2016 Damien P. George +// +// SPDX-License-Identifier: MIT #include diff --git a/extmod/modurandom.c b/extmod/modurandom.c index 1512a3fd4a..a60250efc8 100644 --- a/extmod/modurandom.c +++ b/extmod/modurandom.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2016 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT #include #include diff --git a/extmod/modure.c b/extmod/modure.c index 125afef4d3..a20f3ee429 100644 --- a/extmod/modure.c +++ b/extmod/modure.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2014 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2014 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT #include #include diff --git a/extmod/moduselect.c b/extmod/moduselect.c index 6c9d18e50b..97b14a5f25 100644 --- a/extmod/moduselect.c +++ b/extmod/moduselect.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2014 Damien P. George +// +// SPDX-License-Identifier: MIT #include "py/mpconfig.h" #if MICROPY_PY_USELECT diff --git a/extmod/modussl_axtls.c b/extmod/modussl_axtls.c index 032dea09fd..7cc2bb3e25 100644 --- a/extmod/modussl_axtls.c +++ b/extmod/modussl_axtls.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2015-2017 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2015-2017 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT #include #include diff --git a/extmod/modussl_mbedtls.c b/extmod/modussl_mbedtls.c index 9abdeb966e..990523173d 100644 --- a/extmod/modussl_mbedtls.c +++ b/extmod/modussl_mbedtls.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Linaro Ltd. - * - * 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. - */ +// Copyright (c) 2016 Linaro Ltd. +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT #include "py/mpconfig.h" #if MICROPY_PY_USSL && MICROPY_SSL_MBEDTLS diff --git a/extmod/modutimeq.c b/extmod/modutimeq.c index 99b51016d8..bb2b6b335d 100644 --- a/extmod/modutimeq.c +++ b/extmod/modutimeq.c @@ -1,29 +1,8 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2014 Damien P. George - * Copyright (c) 2016-2017 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2016-2017 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2014 Damien P. George +// +// SPDX-License-Identifier: MIT #include diff --git a/extmod/moduzlib.c b/extmod/moduzlib.c index 3a081bc452..8422e75983 100644 --- a/extmod/moduzlib.c +++ b/extmod/moduzlib.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2014-2016 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2014-2016 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT #include #include diff --git a/extmod/modwebrepl.c b/extmod/modwebrepl.c index fb4d97358d..5b3c6150a7 100644 --- a/extmod/modwebrepl.c +++ b/extmod/modwebrepl.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2016 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT #include #include diff --git a/extmod/modwebsocket.c b/extmod/modwebsocket.c index 496e4b5bb3..581af6b588 100644 --- a/extmod/modwebsocket.c +++ b/extmod/modwebsocket.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2016 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT #include #include diff --git a/extmod/modwebsocket.h b/extmod/modwebsocket.h index 2720147dfd..46aa0408b6 100644 --- a/extmod/modwebsocket.h +++ b/extmod/modwebsocket.h @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT + #ifndef MICROPY_INCLUDED_EXTMOD_MODWEBSOCKET_H #define MICROPY_INCLUDED_EXTMOD_MODWEBSOCKET_H diff --git a/extmod/uos_dupterm.c b/extmod/uos_dupterm.c index 781ec0d46b..bd2dc639c8 100644 --- a/extmod/uos_dupterm.c +++ b/extmod/uos_dupterm.c @@ -1,29 +1,8 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Paul Sokolovsky - * Copyright (c) 2017 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. - */ +// Copyright (c) 2016 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2017 Damien P. George +// +// SPDX-License-Identifier: MIT #include #include "py/mpconfig.h" diff --git a/extmod/utime_mphal.c b/extmod/utime_mphal.c index 0fe3a3ba1d..ebbc9ac263 100644 --- a/extmod/utime_mphal.c +++ b/extmod/utime_mphal.c @@ -1,29 +1,8 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013-2016 Damien P. George - * Copyright (c) 2016 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2016 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2013-2016 Damien P. George +// +// SPDX-License-Identifier: MIT #include "py/mpconfig.h" #if MICROPY_PY_UTIME_MP_HAL diff --git a/extmod/utime_mphal.h b/extmod/utime_mphal.h index 88a9ed4d37..20b4093d31 100644 --- a/extmod/utime_mphal.h +++ b/extmod/utime_mphal.h @@ -1,29 +1,9 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013-2016 Damien P. George - * Copyright (c) 2016 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2016 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2013-2016 Damien P. George +// +// SPDX-License-Identifier: MIT + #ifndef MICROPY_INCLUDED_EXTMOD_UTIME_MPHAL_H #define MICROPY_INCLUDED_EXTMOD_UTIME_MPHAL_H diff --git a/extmod/vfs.c b/extmod/vfs.c index 2bb4057e7e..c9c1fe3c31 100644 --- a/extmod/vfs.c +++ b/extmod/vfs.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2017 Damien P. George +// +// SPDX-License-Identifier: MIT #include #include diff --git a/extmod/vfs.h b/extmod/vfs.h index 6c0692365f..85958d80d9 100644 --- a/extmod/vfs.h +++ b/extmod/vfs.h @@ -1,28 +1,8 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2017 Damien P. George +// +// SPDX-License-Identifier: MIT + #ifndef MICROPY_INCLUDED_EXTMOD_VFS_H #define MICROPY_INCLUDED_EXTMOD_VFS_H diff --git a/extmod/vfs_fat.c b/extmod/vfs_fat.c index 9cb4d98426..b8f43ee295 100644 --- a/extmod/vfs_fat.c +++ b/extmod/vfs_fat.c @@ -1,29 +1,8 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2014 Damien P. George - * Copyright (c) 2016 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2016 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2014 Damien P. George +// +// SPDX-License-Identifier: MIT #include "py/mpconfig.h" #if MICROPY_VFS_FAT diff --git a/extmod/vfs_fat.h b/extmod/vfs_fat.h index 08b03d0d18..41f8365ec5 100644 --- a/extmod/vfs_fat.h +++ b/extmod/vfs_fat.h @@ -1,28 +1,8 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George +// +// SPDX-License-Identifier: MIT + #ifndef MICROPY_INCLUDED_EXTMOD_VFS_FAT_H #define MICROPY_INCLUDED_EXTMOD_VFS_FAT_H diff --git a/extmod/vfs_fat_diskio.c b/extmod/vfs_fat_diskio.c index 0e442d8fa9..ac8924394a 100644 --- a/extmod/vfs_fat_diskio.c +++ b/extmod/vfs_fat_diskio.c @@ -1,31 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * Original template for this file comes from: - * Low level disk I/O module skeleton for FatFs, (C)ChaN, 2013 - * - * The MIT License (MIT) - * - * 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George +// +// SPDX-License-Identifier: MIT #include "py/mpconfig.h" #if MICROPY_VFS && MICROPY_VFS_FAT diff --git a/extmod/vfs_fat_file.c b/extmod/vfs_fat_file.c index 422f057a85..0642f4a9ce 100644 --- a/extmod/vfs_fat_file.c +++ b/extmod/vfs_fat_file.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George +// +// SPDX-License-Identifier: MIT #include "py/mpconfig.h" #if MICROPY_VFS && MICROPY_VFS_FAT diff --git a/extmod/vfs_posix.c b/extmod/vfs_posix.c index 56a5de303d..8d81d51751 100644 --- a/extmod/vfs_posix.c +++ b/extmod/vfs_posix.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017-2018 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2017-2018 Damien P. George +// +// SPDX-License-Identifier: MIT #include "py/runtime.h" #include "py/mperrno.h" diff --git a/extmod/vfs_posix.h b/extmod/vfs_posix.h index 32299b8269..4540baedf0 100644 --- a/extmod/vfs_posix.h +++ b/extmod/vfs_posix.h @@ -1,28 +1,8 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2018 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2018 Damien P. George +// +// SPDX-License-Identifier: MIT + #ifndef MICROPY_INCLUDED_EXTMOD_VFS_POSIX_H #define MICROPY_INCLUDED_EXTMOD_VFS_POSIX_H diff --git a/extmod/vfs_posix_file.c b/extmod/vfs_posix_file.c index be455fa281..eefc1d905a 100644 --- a/extmod/vfs_posix_file.c +++ b/extmod/vfs_posix_file.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013-2018 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2013-2018 Damien P. George +// +// SPDX-License-Identifier: MIT #include "py/runtime.h" #include "py/stream.h" diff --git a/extmod/vfs_reader.c b/extmod/vfs_reader.c index e1ee45a3c7..a700611860 100644 --- a/extmod/vfs_reader.c +++ b/extmod/vfs_reader.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013-2017 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. - */ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// SPDX-FileCopyrightText: Copyright (c) 2013-2017 Damien P. George +// +// SPDX-License-Identifier: MIT #include #include diff --git a/extmod/virtpin.c b/extmod/virtpin.c index 559f992650..fb993946a2 100644 --- a/extmod/virtpin.c +++ b/extmod/virtpin.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2016 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT #include "extmod/virtpin.h" #include "py/proto.h" diff --git a/extmod/virtpin.h b/extmod/virtpin.h index 591249e48d..9b43406bd1 100644 --- a/extmod/virtpin.h +++ b/extmod/virtpin.h @@ -1,28 +1,8 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Paul Sokolovsky - * - * 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. - */ +// Copyright (c) 2016 Paul Sokolovsky +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT + #ifndef MICROPY_INCLUDED_EXTMOD_VIRTPIN_H #define MICROPY_INCLUDED_EXTMOD_VIRTPIN_H diff --git a/lib/libc/string0.c b/lib/libc/string0.c index a2f936237d..18bd993618 100644 --- a/lib/libc/string0.c +++ b/lib/libc/string0.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/lib/libm/math.c b/lib/libm/math.c index 0e53563bcb..670d95ed2d 100644 --- a/lib/libm/math.c +++ b/lib/libm/math.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/lib/mp-readline/readline.c b/lib/mp-readline/readline.c index 0edaebbfae..432413d501 100644 --- a/lib/mp-readline/readline.c +++ b/lib/mp-readline/readline.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/lib/mp-readline/readline.h b/lib/mp-readline/readline.h index 17d4ec60ed..9168edafa0 100644 --- a/lib/mp-readline/readline.h +++ b/lib/mp-readline/readline.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/lib/netutils/netutils.c b/lib/netutils/netutils.c index 03418d7e66..4385f5a5e5 100644 --- a/lib/netutils/netutils.c +++ b/lib/netutils/netutils.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2015 Daniel Campora * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/lib/netutils/netutils.h b/lib/netutils/netutils.h index 4befc90db0..98e1d24932 100644 --- a/lib/netutils/netutils.h +++ b/lib/netutils/netutils.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2015 Daniel Campora * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/lib/oofatfs/ffconf.h b/lib/oofatfs/ffconf.h index 214311b4c2..d8485a293a 100644 --- a/lib/oofatfs/ffconf.h +++ b/lib/oofatfs/ffconf.h @@ -6,7 +6,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2017 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2017 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 diff --git a/lib/timeutils/timeutils.c b/lib/timeutils/timeutils.c index b93a85dee9..fdd3426ad4 100644 --- a/lib/timeutils/timeutils.c +++ b/lib/timeutils/timeutils.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2015 Daniel Campora * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/lib/timeutils/timeutils.h b/lib/timeutils/timeutils.h index 0ca6bb1679..4ba8c7fdac 100644 --- a/lib/timeutils/timeutils.h +++ b/lib/timeutils/timeutils.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2015 Daniel Campora * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/lib/utils/interrupt_char.c b/lib/utils/interrupt_char.c index da7f702544..7410ac1e5d 100644 --- a/lib/utils/interrupt_char.c +++ b/lib/utils/interrupt_char.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2016 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 diff --git a/lib/utils/interrupt_char.h b/lib/utils/interrupt_char.h index e0b1db5298..0e5e2fc0c6 100644 --- a/lib/utils/interrupt_char.h +++ b/lib/utils/interrupt_char.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2016 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 diff --git a/lib/utils/printf.c b/lib/utils/printf.c index 3a4cc25494..e95d778fd2 100644 --- a/lib/utils/printf.c +++ b/lib/utils/printf.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/lib/utils/pyexec.c b/lib/utils/pyexec.c index c8e369e791..8e99bc2099 100755 --- a/lib/utils/pyexec.c +++ b/lib/utils/pyexec.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/lib/utils/pyexec.h b/lib/utils/pyexec.h index bde516c593..cef72a76c7 100644 --- a/lib/utils/pyexec.h +++ b/lib/utils/pyexec.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/lib/utils/sys_stdio_mphal.c b/lib/utils/sys_stdio_mphal.c index c1607dfe8c..3a11fa66c9 100644 --- a/lib/utils/sys_stdio_mphal.c +++ b/lib/utils/sys_stdio_mphal.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2017 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2017 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 diff --git a/logo/CircuitPython_Repo_header_logo.png.license b/logo/CircuitPython_Repo_header_logo.png.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/CircuitPython_Repo_header_logo.png.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/logo/adafruit_blinka_angles-back.svg.license b/logo/adafruit_blinka_angles-back.svg.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/adafruit_blinka_angles-back.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/logo/adafruit_blinka_angles-front.svg.license b/logo/adafruit_blinka_angles-front.svg.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/adafruit_blinka_angles-front.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/logo/adafruit_blinka_angles-left.svg.license b/logo/adafruit_blinka_angles-left.svg.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/adafruit_blinka_angles-left.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/logo/adafruit_blinka_angles-right.svg.license b/logo/adafruit_blinka_angles-right.svg.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/adafruit_blinka_angles-right.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/logo/adafruit_blinka_computer.svg.license b/logo/adafruit_blinka_computer.svg.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/adafruit_blinka_computer.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/logo/adafruit_circuit_python_ourboros_color.svg.license b/logo/adafruit_circuit_python_ourboros_color.svg.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/adafruit_circuit_python_ourboros_color.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/logo/adafruit_circuit_python_ouroboros_logo_final.svg.license b/logo/adafruit_circuit_python_ouroboros_logo_final.svg.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/adafruit_circuit_python_ouroboros_logo_final.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/logo/adafruit_circuit_python_sitting_color.svg.license b/logo/adafruit_circuit_python_sitting_color.svg.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/adafruit_circuit_python_sitting_color.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/logo/adafruit_circuit_python_stacked_lockup_logo_final.svg.license b/logo/adafruit_circuit_python_stacked_lockup_logo_final.svg.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/adafruit_circuit_python_stacked_lockup_logo_final.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/logo/awesome_circuitpython.svg.license b/logo/awesome_circuitpython.svg.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/awesome_circuitpython.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/logo/blinka_colorform-cooking.png.license b/logo/blinka_colorform-cooking.png.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/blinka_colorform-cooking.png.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/logo/blinka_colorform-cooking.svg.license b/logo/blinka_colorform-cooking.svg.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/blinka_colorform-cooking.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/logo/blinka_colorform-first-birthday.svg.license b/logo/blinka_colorform-first-birthday.svg.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/blinka_colorform-first-birthday.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/logo/blinka_colorform-painting.svg.license b/logo/blinka_colorform-painting.svg.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/blinka_colorform-painting.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/logo/blinka_colorform-reading.svg.license b/logo/blinka_colorform-reading.svg.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/blinka_colorform-reading.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/logo/blinka_colorform-singing.svg.license b/logo/blinka_colorform-singing.svg.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/blinka_colorform-singing.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/logo/blinka_colorform-telescope.svg.license b/logo/blinka_colorform-telescope.svg.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/blinka_colorform-telescope.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/logo/blinka_colorform-test_tubes.svg.license b/logo/blinka_colorform-test_tubes.svg.license new file mode 100644 index 0000000000..86a3fbfe83 --- /dev/null +++ b/logo/blinka_colorform-test_tubes.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries + +SPDX-License-Identifier: CC-BY-4.0 diff --git a/mpy-cross/.gitignore b/mpy-cross/.gitignore index 80d7acd423..6daeea5040 100644 --- a/mpy-cross/.gitignore +++ b/mpy-cross/.gitignore @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + /build-* /mpy-cross /mpy-cross.static diff --git a/mpy-cross/Makefile b/mpy-cross/Makefile index 072304faa0..3ff379ed36 100644 --- a/mpy-cross/Makefile +++ b/mpy-cross/Makefile @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # The following is a temporary hack to forefully undefine vars that might have # be defined by a calling Makefile (from recursive make). # TODO: Find a better way to be able to call this Makefile recursively. diff --git a/mpy-cross/Makefile.fuzz b/mpy-cross/Makefile.fuzz index ca59788f4c..0fbbe9b647 100644 --- a/mpy-cross/Makefile.fuzz +++ b/mpy-cross/Makefile.fuzz @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT PROG=mpy-cross.fuzz BUILD=build-static diff --git a/mpy-cross/Makefile.static b/mpy-cross/Makefile.static index ca0925f758..ac2a8079bb 100644 --- a/mpy-cross/Makefile.static +++ b/mpy-cross/Makefile.static @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + PROG=mpy-cross.static BUILD=build-static STATIC_BUILD=1 diff --git a/mpy-cross/Makefile.static-mingw b/mpy-cross/Makefile.static-mingw index a176e80e6e..f5bc861779 100644 --- a/mpy-cross/Makefile.static-mingw +++ b/mpy-cross/Makefile.static-mingw @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + PROG=mpy-cross.static.exe CROSS_COMPILE = x86_64-w64-mingw32- BUILD=build-static-mingw diff --git a/mpy-cross/Makefile.static-raspbian b/mpy-cross/Makefile.static-raspbian index 9129f555e7..f895f998b5 100644 --- a/mpy-cross/Makefile.static-raspbian +++ b/mpy-cross/Makefile.static-raspbian @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + PROG=mpy-cross.static-raspbian BUILD=build-static-raspbian STATIC_BUILD=1 diff --git a/mpy-cross/README.md b/mpy-cross/README.md index e35b28b696..3d1ace394c 100644 --- a/mpy-cross/README.md +++ b/mpy-cross/README.md @@ -1,3 +1,9 @@ + + MicroPython cross compiler ========================== diff --git a/mpy-cross/fmode.c b/mpy-cross/fmode.c index 33ba24ed1f..b1fa3fc857 100644 --- a/mpy-cross/fmode.c +++ b/mpy-cross/fmode.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013-2016 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. - */ +// SPDX-FileCopyrightText: Copyright (c) 2013-2016 Damien P. George +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT #include "fmode.h" #include "py/mpconfig.h" diff --git a/mpy-cross/fmode.h b/mpy-cross/fmode.h index c661c84d0c..05b4a46b21 100644 --- a/mpy-cross/fmode.h +++ b/mpy-cross/fmode.h @@ -1,28 +1,8 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013-2016 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. - */ +// SPDX-FileCopyrightText: Copyright (c) 2013-2016 Damien P. George +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT + #ifndef MICROPY_INCLUDED_WINDOWS_FMODE_H #define MICROPY_INCLUDED_WINDOWS_FMODE_H diff --git a/mpy-cross/gccollect.c b/mpy-cross/gccollect.c index 75891a2fb5..2216fad311 100644 --- a/mpy-cross/gccollect.c +++ b/mpy-cross/gccollect.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * 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. - */ +// SPDX-FileCopyrightText: Copyright (c) 2013-2014 Damien P. George +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT #include diff --git a/mpy-cross/main.c b/mpy-cross/main.c index 7c232385b8..7a1012b8fc 100644 --- a/mpy-cross/main.c +++ b/mpy-cross/main.c @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013-2016 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. - */ +// SPDX-FileCopyrightText: Copyright (c) 2013-2016 Damien P. George +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT #include #include diff --git a/mpy-cross/mpconfigport.h b/mpy-cross/mpconfigport.h index 1a8b4880da..0b07a5b442 100644 --- a/mpy-cross/mpconfigport.h +++ b/mpy-cross/mpconfigport.h @@ -1,28 +1,7 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013-2015 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. - */ +// SPDX-FileCopyrightText: Copyright (c) 2013-2015 Damien P. George +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT // options to control how MicroPython is built diff --git a/mpy-cross/mphalport.h b/mpy-cross/mphalport.h index 4bd8276f34..245b99c4c3 100644 --- a/mpy-cross/mphalport.h +++ b/mpy-cross/mphalport.h @@ -1 +1,5 @@ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT + // empty file diff --git a/mpy-cross/mpy-cross.mk b/mpy-cross/mpy-cross.mk index de96305cbf..c813dae9eb 100644 --- a/mpy-cross/mpy-cross.mk +++ b/mpy-cross/mpy-cross.mk @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + include ../py/mkenv.mk # define main target diff --git a/mpy-cross/qstrdefsport.h b/mpy-cross/qstrdefsport.h index 3ba897069b..36d4b9ccf4 100644 --- a/mpy-cross/qstrdefsport.h +++ b/mpy-cross/qstrdefsport.h @@ -1 +1,5 @@ +// SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +// +// SPDX-License-Identifier: MIT + // qstrs specific to this port diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index c308105a32..eedcc94a92 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -2,7 +2,7 @@ # # The MIT License (MIT) # -# Copyright (c) 2019 Dan Halbert for Adafruit Industries +# SPDX-FileCopyrightText: Copyright (c) 2019 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 diff --git a/ports/atmel-samd/common-hal/analogio/AnalogOut.c b/ports/atmel-samd/common-hal/analogio/AnalogOut.c index e69a240717..fac4c6bfcb 100644 --- a/ports/atmel-samd/common-hal/analogio/AnalogOut.c +++ b/ports/atmel-samd/common-hal/analogio/AnalogOut.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/atmel-samd/common-hal/board/__init__.c b/ports/atmel-samd/common-hal/board/__init__.c index 634760335e..92a1721383 100644 --- a/ports/atmel-samd/common-hal/board/__init__.c +++ b/ports/atmel-samd/common-hal/board/__init__.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index 8aebd49523..9557c3b5f1 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2016 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 diff --git a/ports/atmel-samd/common-hal/pulseio/PWMOut.c b/ports/atmel-samd/common-hal/pulseio/PWMOut.c index 752f6c214b..e33437dada 100644 --- a/ports/atmel-samd/common-hal/pulseio/PWMOut.c +++ b/ports/atmel-samd/common-hal/pulseio/PWMOut.c @@ -4,7 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * Copyright (c) 2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2016 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 diff --git a/ports/atmel-samd/common-hal/pulseio/PulseOut.c b/ports/atmel-samd/common-hal/pulseio/PulseOut.c index 5c829f84db..e9b2137cb0 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseOut.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseOut.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2016 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 diff --git a/ports/atmel-samd/fatfs_port.c b/ports/atmel-samd/fatfs_port.c index c4ce18c2a7..c65a73a428 100644 --- a/ports/atmel-samd/fatfs_port.c +++ b/ports/atmel-samd/fatfs_port.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/atmel-samd/supervisor/internal_flash.c b/ports/atmel-samd/supervisor/internal_flash.c index 091959c4e6..ecb59f836e 100644 --- a/ports/atmel-samd/supervisor/internal_flash.c +++ b/ports/atmel-samd/supervisor/internal_flash.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/atmel-samd/supervisor/internal_flash.h b/ports/atmel-samd/supervisor/internal_flash.h index df8b495ccb..1199e3b9c4 100644 --- a/ports/atmel-samd/supervisor/internal_flash.h +++ b/ports/atmel-samd/supervisor/internal_flash.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/atmel-samd/tools/gen_pin_name_table.py b/ports/atmel-samd/tools/gen_pin_name_table.py index ded64e5f69..4e25c39fd9 100644 --- a/ports/atmel-samd/tools/gen_pin_name_table.py +++ b/ports/atmel-samd/tools/gen_pin_name_table.py @@ -2,7 +2,7 @@ # # The MIT License (MIT) # -# Copyright (c) 2017 Scott Shawcroft for Adafruit Industries +# SPDX-FileCopyrightText: 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 diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 3e69e66393..b296976885 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -2,7 +2,7 @@ # # The MIT License (MIT) # -# Copyright (c) 2020 Scott Shawcroft for Adafruit Industries +# 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 diff --git a/ports/esp32s2/fatfs_port.c b/ports/esp32s2/fatfs_port.c index 13ac21fb1b..8bdc047c12 100644 --- a/ports/esp32s2/fatfs_port.c +++ b/ports/esp32s2/fatfs_port.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/esp32s2/supervisor/internal_flash.c b/ports/esp32s2/supervisor/internal_flash.c index 5cf77c8010..26774efac8 100644 --- a/ports/esp32s2/supervisor/internal_flash.c +++ b/ports/esp32s2/supervisor/internal_flash.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2019 Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/esp32s2/supervisor/internal_flash.h b/ports/esp32s2/supervisor/internal_flash.h index e06ef2d160..02d5190030 100644 --- a/ports/esp32s2/supervisor/internal_flash.h +++ b/ports/esp32s2/supervisor/internal_flash.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2019 Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/litex/Makefile b/ports/litex/Makefile index d75a4da288..29149942c9 100644 --- a/ports/litex/Makefile +++ b/ports/litex/Makefile @@ -2,7 +2,7 @@ # # The MIT License (MIT) # -# Copyright (c) 2019 Scott Shawcroft for Adafruit Industries +# SPDX-FileCopyrightText: 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 diff --git a/ports/litex/fatfs_port.c b/ports/litex/fatfs_port.c index 13ac21fb1b..8bdc047c12 100644 --- a/ports/litex/fatfs_port.c +++ b/ports/litex/fatfs_port.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/litex/supervisor/internal_flash.c b/ports/litex/supervisor/internal_flash.c index cf777a8acc..9b1dea6852 100644 --- a/ports/litex/supervisor/internal_flash.c +++ b/ports/litex/supervisor/internal_flash.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2019 Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/litex/supervisor/internal_flash.h b/ports/litex/supervisor/internal_flash.h index 41a69e2abe..1498207d3e 100644 --- a/ports/litex/supervisor/internal_flash.h +++ b/ports/litex/supervisor/internal_flash.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2019 Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 78cab0188e..d82b625e74 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -2,8 +2,8 @@ # # The MIT License (MIT) # -# Copyright (c) 2019 Dan Halbert for Adafruit Industries -# Copyright (c) 2019 Artur Pacholec +# SPDX-FileCopyrightText: Copyright (c) 2019 Dan Halbert for Adafruit Industries +# SPDX-FileCopyrightText: Copyright (c) 2019 Artur Pacholec # # 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/mimxrt10xx/common-hal/analogio/AnalogOut.c b/ports/mimxrt10xx/common-hal/analogio/AnalogOut.c index 3d072627a4..6bdbeff7c2 100644 --- a/ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +++ b/ports/mimxrt10xx/common-hal/analogio/AnalogOut.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2019 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/mimxrt10xx/common-hal/board/__init__.c b/ports/mimxrt10xx/common-hal/board/__init__.c index e86251480e..4967e1a76a 100644 --- a/ports/mimxrt10xx/common-hal/board/__init__.c +++ b/ports/mimxrt10xx/common-hal/board/__init__.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2019 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index 4ca2f8e497..db5582d150 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George * Copyright (c) 2019 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/mimxrt10xx/common-hal/pulseio/PWMOut.c b/ports/mimxrt10xx/common-hal/pulseio/PWMOut.c index c75b75316a..50dd477ea6 100644 --- a/ports/mimxrt10xx/common-hal/pulseio/PWMOut.c +++ b/ports/mimxrt10xx/common-hal/pulseio/PWMOut.c @@ -4,7 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * Copyright (c) 2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George * Copyright (c) 2019 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/mimxrt10xx/common-hal/pulseio/PulseOut.c b/ports/mimxrt10xx/common-hal/pulseio/PulseOut.c index a49cfa7af7..ffa885688a 100644 --- a/ports/mimxrt10xx/common-hal/pulseio/PulseOut.c +++ b/ports/mimxrt10xx/common-hal/pulseio/PulseOut.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George * Copyright (c) 2019 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/mimxrt10xx/fatfs_port.c b/ports/mimxrt10xx/fatfs_port.c index c4ce18c2a7..c65a73a428 100644 --- a/ports/mimxrt10xx/fatfs_port.c +++ b/ports/mimxrt10xx/fatfs_port.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/mimxrt10xx/supervisor/internal_flash.c b/ports/mimxrt10xx/supervisor/internal_flash.c index 9abd15e60e..09f44ccedf 100644 --- a/ports/mimxrt10xx/supervisor/internal_flash.c +++ b/ports/mimxrt10xx/supervisor/internal_flash.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2019 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/mimxrt10xx/supervisor/internal_flash.h b/ports/mimxrt10xx/supervisor/internal_flash.h index dfbfe1d4b4..daee66620c 100644 --- a/ports/mimxrt10xx/supervisor/internal_flash.h +++ b/ports/mimxrt10xx/supervisor/internal_flash.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 5b81fa9a74..e1d86f7bc1 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -2,7 +2,7 @@ # # The MIT License (MIT) # -# Copyright (c) 2019 Dan Halbert for Adafruit Industries +# SPDX-FileCopyrightText: Copyright (c) 2019 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 diff --git a/ports/nrf/examples/ubluepy_temp.py b/ports/nrf/examples/ubluepy_temp.py index 118407af5e..405f77c4b0 100644 --- a/ports/nrf/examples/ubluepy_temp.py +++ b/ports/nrf/examples/ubluepy_temp.py @@ -2,7 +2,7 @@ # # The MIT License (MIT) # -# Copyright (c) 2017 Glenn Ruben Bakke +# SPDX-FileCopyrightText: Copyright (c) 2017 Glenn Ruben Bakke # # 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/nrf/fatfs_port.c b/ports/nrf/fatfs_port.c index cb1bfa8347..2b741f993a 100644 --- a/ports/nrf/fatfs_port.c +++ b/ports/nrf/fatfs_port.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/nrf/peripherals/nrf/nvm.c b/ports/nrf/peripherals/nrf/nvm.c index dc50e2eefa..ce47d73c77 100644 --- a/ports/nrf/peripherals/nrf/nvm.c +++ b/ports/nrf/peripherals/nrf/nvm.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2019 Nick Moore for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/nrf/peripherals/nrf/nvm.h b/ports/nrf/peripherals/nrf/nvm.h index 8ba95773d6..9e144d802a 100644 --- a/ports/nrf/peripherals/nrf/nvm.h +++ b/ports/nrf/peripherals/nrf/nvm.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2019 Nick Moore for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/nrf/supervisor/internal_flash.c b/ports/nrf/supervisor/internal_flash.c index 737bab2036..93de0b2c49 100644 --- a/ports/nrf/supervisor/internal_flash.c +++ b/ports/nrf/supervisor/internal_flash.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/nrf/supervisor/internal_flash.h b/ports/nrf/supervisor/internal_flash.h index 024a53ebba..81da690217 100644 --- a/ports/nrf/supervisor/internal_flash.h +++ b/ports/nrf/supervisor/internal_flash.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/stm/Makefile b/ports/stm/Makefile index a982de765b..e2dc2346e2 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -2,8 +2,8 @@ # # The MIT License (MIT) # -# Copyright (c) 2019 Dan Halbert for Adafruit Industries -# Copyright (c) 2019 Lucian Copeland for Adafruit Industries +# SPDX-FileCopyrightText: Copyright (c) 2019 Dan Halbert for Adafruit Industries +# SPDX-FileCopyrightText: Copyright (c) 2019 Lucian Copeland 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 diff --git a/ports/stm/common-hal/analogio/AnalogOut.c b/ports/stm/common-hal/analogio/AnalogOut.c index 2ea969f503..a505b2bf0f 100644 --- a/ports/stm/common-hal/analogio/AnalogOut.c +++ b/ports/stm/common-hal/analogio/AnalogOut.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2019, Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/stm/fatfs_port.c b/ports/stm/fatfs_port.c index 6a17f627bd..631f7f0982 100644 --- a/ports/stm/fatfs_port.c +++ b/ports/stm/fatfs_port.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/stm/supervisor/internal_flash.c b/ports/stm/supervisor/internal_flash.c index d37a54f60f..864403c366 100644 --- a/ports/stm/supervisor/internal_flash.c +++ b/ports/stm/supervisor/internal_flash.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2020 Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/stm/supervisor/internal_flash.h b/ports/stm/supervisor/internal_flash.h index 13ade4e6e7..ad5cba62d8 100644 --- a/ports/stm/supervisor/internal_flash.h +++ b/ports/stm/supervisor/internal_flash.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2020 Lucian Copeland for Adafruit Industries * Copyright (c) 2020 Mark Olsson * diff --git a/ports/stm/tools/parse_af_csv.py b/ports/stm/tools/parse_af_csv.py index 4e97252602..984696be0d 100644 --- a/ports/stm/tools/parse_af_csv.py +++ b/ports/stm/tools/parse_af_csv.py @@ -2,7 +2,7 @@ # # The MIT License (MIT) # -# Copyright (c) 2020 Lucian Copeland for Adafruit Industries +# SPDX-FileCopyrightText: Copyright (c) 2020 Lucian Copeland 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 diff --git a/ports/stm/tools/parse_pins_csv.py b/ports/stm/tools/parse_pins_csv.py index 4ab3fc25c9..68f6db586e 100644 --- a/ports/stm/tools/parse_pins_csv.py +++ b/ports/stm/tools/parse_pins_csv.py @@ -2,7 +2,7 @@ # # The MIT License (MIT) # -# Copyright (c) 2020 Lucian Copeland for Adafruit Industries +# SPDX-FileCopyrightText: Copyright (c) 2020 Lucian Copeland 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 diff --git a/ports/unix/fdfile.h b/ports/unix/fdfile.h index 69a9b6be41..d7da673be9 100644 --- a/ports/unix/fdfile.h +++ b/ports/unix/fdfile.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2016 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/unix/file.c b/ports/unix/file.c index e5c73d26c2..e4f62e3d5a 100644 --- a/ports/unix/file.c +++ b/ports/unix/file.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/unix/gccollect.c b/ports/unix/gccollect.c index 02f6fc91a8..7cd74ec134 100644 --- a/ports/unix/gccollect.c +++ b/ports/unix/gccollect.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/unix/input.c b/ports/unix/input.c index 7d60b46cc7..b661ce3e24 100644 --- a/ports/unix/input.c +++ b/ports/unix/input.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/unix/main.c b/ports/unix/main.c index d1187ae905..5a3cbaf477 100644 --- a/ports/unix/main.c +++ b/ports/unix/main.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/unix/modffi.c b/ports/unix/modffi.c index 03dc9e4ec6..c750f2eb77 100644 --- a/ports/unix/modffi.c +++ b/ports/unix/modffi.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/unix/modmachine.c b/ports/unix/modmachine.c index b2bca12063..61697cfb6f 100644 --- a/ports/unix/modmachine.c +++ b/ports/unix/modmachine.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/unix/modos.c b/ports/unix/modos.c index d99d0d62c9..252b19a50c 100644 --- a/ports/unix/modos.c +++ b/ports/unix/modos.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/unix/modtime.c b/ports/unix/modtime.c index a8f6ed5c6e..cc9b4a3371 100644 --- a/ports/unix/modtime.c +++ b/ports/unix/modtime.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/unix/moduos_vfs.c b/ports/unix/moduos_vfs.c index e9ac8e1f88..b45d4485b5 100644 --- a/ports/unix/moduos_vfs.c +++ b/ports/unix/moduos_vfs.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2017 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2017 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 diff --git a/ports/unix/moduselect.c b/ports/unix/moduselect.c index 1ea7dc19a5..dbda5e1107 100644 --- a/ports/unix/moduselect.c +++ b/ports/unix/moduselect.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2014 Damien P. George * Copyright (c) 2015-2017 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/unix/modusocket.c b/ports/unix/modusocket.c index 95da276ed9..90651a19ea 100644 --- a/ports/unix/modusocket.c +++ b/ports/unix/modusocket.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/unix/mpconfigport.h b/ports/unix/mpconfigport.h index 3ac7ceaf21..3ae4ff7866 100644 --- a/ports/unix/mpconfigport.h +++ b/ports/unix/mpconfigport.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/unix/mpconfigport_coverage.h b/ports/unix/mpconfigport_coverage.h index 97c05cfee4..51015a5872 100644 --- a/ports/unix/mpconfigport_coverage.h +++ b/ports/unix/mpconfigport_coverage.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2016 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 diff --git a/ports/unix/mpconfigport_fast.h b/ports/unix/mpconfigport_fast.h index 442159eb4f..76e02c1b0a 100644 --- a/ports/unix/mpconfigport_fast.h +++ b/ports/unix/mpconfigport_fast.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/unix/mpconfigport_freedos.h b/ports/unix/mpconfigport_freedos.h index 09c85ab1e3..19c73b7623 100644 --- a/ports/unix/mpconfigport_freedos.h +++ b/ports/unix/mpconfigport_freedos.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2015 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2015 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 diff --git a/ports/unix/mpconfigport_minimal.h b/ports/unix/mpconfigport_minimal.h index ef7a1a09a0..1a13d5725b 100644 --- a/ports/unix/mpconfigport_minimal.h +++ b/ports/unix/mpconfigport_minimal.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2015 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2015 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 diff --git a/ports/unix/mpconfigport_nanbox.h b/ports/unix/mpconfigport_nanbox.h index 7da2cf7b80..fa41407cfb 100644 --- a/ports/unix/mpconfigport_nanbox.h +++ b/ports/unix/mpconfigport_nanbox.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2016 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 diff --git a/ports/unix/mphalport.h b/ports/unix/mphalport.h index ff7a51567c..6f2880d4ef 100644 --- a/ports/unix/mphalport.h +++ b/ports/unix/mphalport.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2015 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2015 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 diff --git a/ports/unix/mpthreadport.c b/ports/unix/mpthreadport.c index baca0a2b1e..3641745bc6 100644 --- a/ports/unix/mpthreadport.c +++ b/ports/unix/mpthreadport.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd + * SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd * * 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/unix/mpthreadport.h b/ports/unix/mpthreadport.h index b158ed5bcc..bd712ebee0 100644 --- a/ports/unix/mpthreadport.h +++ b/ports/unix/mpthreadport.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd + * SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd * * 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/unix/qstrdefsport.h b/ports/unix/qstrdefsport.h index ebfaa6ccab..873e832720 100644 --- a/ports/unix/qstrdefsport.h +++ b/ports/unix/qstrdefsport.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/ports/unix/unix_mphal.c b/ports/unix/unix_mphal.c index f27c62fd1d..e9494d7ff2 100644 --- a/ports/unix/unix_mphal.c +++ b/ports/unix/unix_mphal.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2015 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2015 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 diff --git a/py/argcheck.c b/py/argcheck.c index a8df206e28..9341c02a6c 100644 --- a/py/argcheck.c +++ b/py/argcheck.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/asmarm.c b/py/asmarm.c index 1a8923bc23..11e498b2c7 100644 --- a/py/asmarm.c +++ b/py/asmarm.c @@ -4,7 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2014 Fabian Vogt - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/asmarm.h b/py/asmarm.h index 5603030912..f63106a9b6 100644 --- a/py/asmarm.h +++ b/py/asmarm.h @@ -4,7 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2014 Fabian Vogt - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/asmbase.c b/py/asmbase.c index 4c84c3b255..4d080f095e 100644 --- a/py/asmbase.c +++ b/py/asmbase.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2016 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 diff --git a/py/asmbase.h b/py/asmbase.h index d2b4038931..3b2f59d159 100644 --- a/py/asmbase.h +++ b/py/asmbase.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2016 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 diff --git a/py/asmthumb.c b/py/asmthumb.c index c5b45f2f51..3cf47c5b15 100644 --- a/py/asmthumb.c +++ b/py/asmthumb.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/asmthumb.h b/py/asmthumb.h index b7e2acc048..32219eb55a 100644 --- a/py/asmthumb.h +++ b/py/asmthumb.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/asmx64.c b/py/asmx64.c index c900a08d1f..8706b806e5 100644 --- a/py/asmx64.c +++ b/py/asmx64.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/asmx64.h b/py/asmx64.h index ed0b785fb2..113d925119 100644 --- a/py/asmx64.h +++ b/py/asmx64.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/asmx86.c b/py/asmx86.c index 3938baaacb..8a08c68a03 100644 --- a/py/asmx86.c +++ b/py/asmx86.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 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 diff --git a/py/asmx86.h b/py/asmx86.h index 0908b8c711..05902350fc 100644 --- a/py/asmx86.h +++ b/py/asmx86.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 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 diff --git a/py/asmxtensa.c b/py/asmxtensa.c index 00448dfc59..98b49ecb5e 100644 --- a/py/asmxtensa.c +++ b/py/asmxtensa.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2016 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 diff --git a/py/asmxtensa.h b/py/asmxtensa.h index ef80f700a3..d43824338d 100644 --- a/py/asmxtensa.h +++ b/py/asmxtensa.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2016 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 diff --git a/py/bc.c b/py/bc.c index 69b4cb238b..6406713385 100644 --- a/py/bc.c +++ b/py/bc.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/py/bc.h b/py/bc.h index ebfdeaac1d..b71325f92b 100644 --- a/py/bc.h +++ b/py/bc.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/bc0.h b/py/bc0.h index 70acfb0cac..a031bcc88b 100644 --- a/py/bc0.h +++ b/py/bc0.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/binary.c b/py/binary.c index 2ec12fa931..cd0f1aa4df 100644 --- a/py/binary.c +++ b/py/binary.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/binary.h b/py/binary.h index 0dae6a29e6..6c70d93339 100644 --- a/py/binary.h +++ b/py/binary.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/builtin.h b/py/builtin.h index 6e0d5d9bef..2275691fc8 100644 --- a/py/builtin.h +++ b/py/builtin.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/builtinevex.c b/py/builtinevex.c index cb046b4076..ade12d39d0 100644 --- a/py/builtinevex.c +++ b/py/builtinevex.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/builtinhelp.c b/py/builtinhelp.c index 01c0bc84e0..d12e088d60 100644 --- a/py/builtinhelp.c +++ b/py/builtinhelp.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2016 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 diff --git a/py/builtinimport.c b/py/builtinimport.c index 2be779c6c0..597819f55c 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 32d3640069..815ee2e62b 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -2,7 +2,7 @@ # # The MIT License (MIT) # -# Copyright (c) 2019 Dan Halbert for Adafruit Industries +# SPDX-FileCopyrightText: Copyright (c) 2019 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 diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 302368f74a..075981e30f 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -3,7 +3,7 @@ # # The MIT License (MIT) # -# Copyright (c) 2019 Dan Halbert for Adafruit Industries +# SPDX-FileCopyrightText: Copyright (c) 2019 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 diff --git a/py/compile.c b/py/compile.c index d5fae02994..4708110056 100644 --- a/py/compile.c +++ b/py/compile.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2015 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2015 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 diff --git a/py/compile.h b/py/compile.h index 3297e83aeb..0f8d023a25 100644 --- a/py/compile.h +++ b/py/compile.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/emit.h b/py/emit.h index aa98efa774..30543d2a3c 100644 --- a/py/emit.h +++ b/py/emit.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/emitbc.c b/py/emitbc.c index f3951e9cb5..f45dcb9167 100644 --- a/py/emitbc.c +++ b/py/emitbc.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/emitcommon.c b/py/emitcommon.c index 89cc2c9597..88c9803a6e 100644 --- a/py/emitcommon.c +++ b/py/emitcommon.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/emitglue.c b/py/emitglue.c index 7708689dd4..3a3174b0f8 100644 --- a/py/emitglue.c +++ b/py/emitglue.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/emitglue.h b/py/emitglue.h index 0830a0d5c8..2ddcc3e53e 100644 --- a/py/emitglue.h +++ b/py/emitglue.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/emitinlinethumb.c b/py/emitinlinethumb.c index 7f0ec66590..47ed14321e 100644 --- a/py/emitinlinethumb.c +++ b/py/emitinlinethumb.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/emitinlinextensa.c b/py/emitinlinextensa.c index 9cd65824be..ae84aae2e3 100644 --- a/py/emitinlinextensa.c +++ b/py/emitinlinextensa.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2016 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 diff --git a/py/emitnative.c b/py/emitnative.c index 60f31d15f5..51919e389b 100644 --- a/py/emitnative.c +++ b/py/emitnative.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/formatfloat.c b/py/formatfloat.c index dc7fc1d1fd..166a98a2e6 100644 --- a/py/formatfloat.c +++ b/py/formatfloat.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/formatfloat.h b/py/formatfloat.h index 9a1643b4dd..c433cb8057 100644 --- a/py/formatfloat.h +++ b/py/formatfloat.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/frozenmod.c b/py/frozenmod.c index a9143b582a..0e040a44fd 100644 --- a/py/frozenmod.c +++ b/py/frozenmod.c @@ -4,7 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2015 Paul Sokolovsky - * Copyright (c) 2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2016 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 diff --git a/py/frozenmod.h b/py/frozenmod.h index 1e50f3807a..3ba1b590d7 100644 --- a/py/frozenmod.h +++ b/py/frozenmod.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 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 diff --git a/py/gc.c b/py/gc.c index 271bc94624..2f3f63522e 100755 --- a/py/gc.c +++ b/py/gc.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/gc.h b/py/gc.h index 2a0811f4ed..b7c2889d5c 100644 --- a/py/gc.h +++ b/py/gc.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/grammar.h b/py/grammar.h index 5a5b682acc..28f7850398 100644 --- a/py/grammar.h +++ b/py/grammar.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2015 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2015 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 diff --git a/py/ioctl.h b/py/ioctl.h index ced4275900..8c84835cc1 100644 --- a/py/ioctl.h +++ b/py/ioctl.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2015 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2015 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 diff --git a/py/lexer.c b/py/lexer.c index 00cd59bcae..de121f87a2 100644 --- a/py/lexer.c +++ b/py/lexer.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/lexer.h b/py/lexer.h index a3eaa2a7e6..74195fe030 100644 --- a/py/lexer.h +++ b/py/lexer.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/malloc.c b/py/malloc.c index f190582ab2..8d5141ee04 100644 --- a/py/malloc.c +++ b/py/malloc.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/map.c b/py/map.c index 57c11dbc97..69eed9d3b9 100644 --- a/py/map.c +++ b/py/map.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/misc.h b/py/misc.h index 673568f226..944c0a7164 100644 --- a/py/misc.h +++ b/py/misc.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/modarray.c b/py/modarray.c index c0cdca9286..75bc5169f8 100644 --- a/py/modarray.c +++ b/py/modarray.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/modbuiltins.c b/py/modbuiltins.c index e764f1987e..905c3471f1 100644 --- a/py/modbuiltins.c +++ b/py/modbuiltins.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/modcmath.c b/py/modcmath.c index 70fd542af9..d6b364733d 100644 --- a/py/modcmath.c +++ b/py/modcmath.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/modcollections.c b/py/modcollections.c index 91e7355281..9634c5ce73 100644 --- a/py/modcollections.c +++ b/py/modcollections.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/modgc.c b/py/modgc.c index 55e73defce..b01876422a 100644 --- a/py/modgc.c +++ b/py/modgc.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/modio.c b/py/modio.c index 17840a6d87..4bcc3971eb 100644 --- a/py/modio.c +++ b/py/modio.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/modmath.c b/py/modmath.c index 9d75ea2d52..ec520bb6f2 100644 --- a/py/modmath.c +++ b/py/modmath.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2017 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2017 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 diff --git a/py/modmicropython.c b/py/modmicropython.c index a45d44653a..7e29825ae4 100644 --- a/py/modmicropython.c +++ b/py/modmicropython.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/modstruct.c b/py/modstruct.c index a238d3935a..fe766a4deb 100644 --- a/py/modstruct.c +++ b/py/modstruct.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/py/modsys.c b/py/modsys.c index 68e048d91d..a1d2cf831c 100644 --- a/py/modsys.c +++ b/py/modsys.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014-2017 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/py/modthread.c b/py/modthread.c index 1c00f6397e..250756ef27 100644 --- a/py/modthread.c +++ b/py/modthread.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd + * SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd * * 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/py/moduerrno.c b/py/moduerrno.c index 3be5adba1e..3928f8cd89 100644 --- a/py/moduerrno.c +++ b/py/moduerrno.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2016 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 diff --git a/py/mpconfig.h b/py/mpconfig.h index 513f04f6ef..034d39d409 100755 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/mperrno.h b/py/mperrno.h index 911a9b4131..e339fde852 100644 --- a/py/mperrno.h +++ b/py/mperrno.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2016 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 diff --git a/py/mphal.h b/py/mphal.h index 92de01d08b..c242dd2452 100644 --- a/py/mphal.h +++ b/py/mphal.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2015 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2015 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 diff --git a/py/mpprint.c b/py/mpprint.c index c2e65301c9..e814d2ebe5 100644 --- a/py/mpprint.c +++ b/py/mpprint.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2015 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2015 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 diff --git a/py/mpprint.h b/py/mpprint.h index 07462bddcc..0d12b9a3d0 100644 --- a/py/mpprint.h +++ b/py/mpprint.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/mpstate.c b/py/mpstate.c index 32f1d60a59..b3957cc09a 100644 --- a/py/mpstate.c +++ b/py/mpstate.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 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 diff --git a/py/mpstate.h b/py/mpstate.h index a5815776a4..32f353528c 100644 --- a/py/mpstate.h +++ b/py/mpstate.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 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 diff --git a/py/mpthread.h b/py/mpthread.h index 602df830c4..3a6983e9d0 100644 --- a/py/mpthread.h +++ b/py/mpthread.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd + * SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd * * 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/py/mpz.c b/py/mpz.c index 8687092d02..7800cdcc45 100644 --- a/py/mpz.c +++ b/py/mpz.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/mpz.h b/py/mpz.h index 3c36cac66b..e412f5cce1 100644 --- a/py/mpz.h +++ b/py/mpz.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/nativeglue.c b/py/nativeglue.c index b87da6931e..9ac8060097 100644 --- a/py/nativeglue.c +++ b/py/nativeglue.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 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 diff --git a/py/nlr.c b/py/nlr.c index 1bfd9c19b0..95d833177d 100644 --- a/py/nlr.c +++ b/py/nlr.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2017 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2017 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 diff --git a/py/nlr.h b/py/nlr.h index 1b95002d3b..aed24e277a 100644 --- a/py/nlr.h +++ b/py/nlr.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/nlrsetjmp.c b/py/nlrsetjmp.c index 960dd86f52..a93595dc83 100644 --- a/py/nlrsetjmp.c +++ b/py/nlrsetjmp.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2017 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2017 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 diff --git a/py/nlrthumb.c b/py/nlrthumb.c index 056aa358e7..464995fa88 100644 --- a/py/nlrthumb.c +++ b/py/nlrthumb.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2017 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2017 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 diff --git a/py/nlrx64.c b/py/nlrx64.c index 569ad84fb0..246d6a95b8 100644 --- a/py/nlrx64.c +++ b/py/nlrx64.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2017 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2017 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 diff --git a/py/nlrx86.c b/py/nlrx86.c index 6fbbe44327..18306253d7 100644 --- a/py/nlrx86.c +++ b/py/nlrx86.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2017 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2017 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 diff --git a/py/nlrxtensa.c b/py/nlrxtensa.c index 5640350043..e04535ff83 100644 --- a/py/nlrxtensa.c +++ b/py/nlrxtensa.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014-2017 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2014-2017 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 diff --git a/py/obj.c b/py/obj.c index 4fa2032dc7..7644b5de8e 100644 --- a/py/obj.c +++ b/py/obj.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/obj.h b/py/obj.h index fa315d12f7..8536e33335 100644 --- a/py/obj.h +++ b/py/obj.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objarray.c b/py/objarray.c index fccb966a2b..7dfdc5b121 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/py/objarray.h b/py/objarray.h index 0dad705711..7ad5328f0e 100644 --- a/py/objarray.h +++ b/py/objarray.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/py/objattrtuple.c b/py/objattrtuple.c index 3cc298d4e9..ac9b808a20 100644 --- a/py/objattrtuple.c +++ b/py/objattrtuple.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2015 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2015 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 diff --git a/py/objbool.c b/py/objbool.c index cd7d7100c9..5e8f630ff1 100644 --- a/py/objbool.c +++ b/py/objbool.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objboundmeth.c b/py/objboundmeth.c index a05680d410..5bf25567f0 100644 --- a/py/objboundmeth.c +++ b/py/objboundmeth.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objcell.c b/py/objcell.c index 111906412e..25fe5232a1 100644 --- a/py/objcell.c +++ b/py/objcell.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objclosure.c b/py/objclosure.c index 4eb9eb8b84..6f6772ff1c 100644 --- a/py/objclosure.c +++ b/py/objclosure.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objcomplex.c b/py/objcomplex.c index b38e2c5fa6..43e0690d38 100644 --- a/py/objcomplex.c +++ b/py/objcomplex.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objdict.c b/py/objdict.c index 3ec3cbe80a..39169fe1ad 100644 --- a/py/objdict.c +++ b/py/objdict.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objenumerate.c b/py/objenumerate.c index 818725d856..dee7fc760d 100644 --- a/py/objenumerate.c +++ b/py/objenumerate.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objexcept.c b/py/objexcept.c index 796be122fe..e3b953543e 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objexcept.h b/py/objexcept.h index 7c30762248..c19658427a 100644 --- a/py/objexcept.h +++ b/py/objexcept.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 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 diff --git a/py/objfilter.c b/py/objfilter.c index af95326e60..0e02f4b5ef 100644 --- a/py/objfilter.c +++ b/py/objfilter.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objfloat.c b/py/objfloat.c index f544ade053..59f1eb2f69 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objfun.c b/py/objfun.c index c586a290ac..933044ef71 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/py/objfun.h b/py/objfun.h index fbb3516261..457c3cf48c 100644 --- a/py/objfun.h +++ b/py/objfun.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objgenerator.c b/py/objgenerator.c index 01d42ba94f..6ffcfae46a 100644 --- a/py/objgenerator.c +++ b/py/objgenerator.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014-2017 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/py/objgenerator.h b/py/objgenerator.h index 80bf9cd860..4b7f8c1ac5 100644 --- a/py/objgenerator.h +++ b/py/objgenerator.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objgetitemiter.c b/py/objgetitemiter.c index ec41c2c5b1..44e8fe8894 100644 --- a/py/objgetitemiter.c +++ b/py/objgetitemiter.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objint.c b/py/objint.c index b78c9f25b1..82f5aadd18 100644 --- a/py/objint.c +++ b/py/objint.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objint.h b/py/objint.h index e8c9bc3e06..bba9ff50a5 100644 --- a/py/objint.h +++ b/py/objint.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objint_longlong.c b/py/objint_longlong.c index ce02fa1755..1890496305 100644 --- a/py/objint_longlong.c +++ b/py/objint_longlong.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/py/objint_mpz.c b/py/objint_mpz.c index 95e4d7e176..90060114ed 100644 --- a/py/objint_mpz.c +++ b/py/objint_mpz.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objlist.c b/py/objlist.c index 608ea9f6ca..9242020d45 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objlist.h b/py/objlist.h index a43663db76..f02030557b 100644 --- a/py/objlist.h +++ b/py/objlist.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objmap.c b/py/objmap.c index cf71f99eeb..5cf975f492 100644 --- a/py/objmap.c +++ b/py/objmap.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objmodule.c b/py/objmodule.c index b6a8a084e9..757aece046 100644 --- a/py/objmodule.c +++ b/py/objmodule.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objmodule.h b/py/objmodule.h index b7702ec50b..0b9b2d130d 100644 --- a/py/objmodule.h +++ b/py/objmodule.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objnamedtuple.c b/py/objnamedtuple.c index 84dcf79097..6c36909e75 100644 --- a/py/objnamedtuple.c +++ b/py/objnamedtuple.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/py/objnamedtuple.h b/py/objnamedtuple.h index 0ea0d28622..9f290c3ec4 100644 --- a/py/objnamedtuple.h +++ b/py/objnamedtuple.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/py/objnone.c b/py/objnone.c index da1031835c..b1fbd48f75 100644 --- a/py/objnone.c +++ b/py/objnone.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objobject.c b/py/objobject.c index a42edde3c6..8983cd9ad3 100644 --- a/py/objobject.c +++ b/py/objobject.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objproperty.c b/py/objproperty.c index ddf484af2b..e909533c45 100644 --- a/py/objproperty.c +++ b/py/objproperty.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objproperty.h b/py/objproperty.h index f95c1083c0..f3ade89d92 100644 --- a/py/objproperty.h +++ b/py/objproperty.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objrange.c b/py/objrange.c index 30d55c56cd..7af9f37a11 100644 --- a/py/objrange.c +++ b/py/objrange.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objreversed.c b/py/objreversed.c index 4937d08189..63d122b5db 100644 --- a/py/objreversed.c +++ b/py/objreversed.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 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 diff --git a/py/objset.c b/py/objset.c index 5d1608c7ea..d986c6ddaf 100644 --- a/py/objset.c +++ b/py/objset.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2017 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2017 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 diff --git a/py/objsingleton.c b/py/objsingleton.c index 67535391ea..1c27573343 100644 --- a/py/objsingleton.c +++ b/py/objsingleton.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objslice.c b/py/objslice.c index cbbee326e9..40d4d3c760 100644 --- a/py/objslice.c +++ b/py/objslice.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objstr.c b/py/objstr.c index a60f507e99..5e0c6fdfaa 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/py/objstr.h b/py/objstr.h index 61a11d0bd6..4b5e2054e0 100644 --- a/py/objstr.h +++ b/py/objstr.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objstringio.c b/py/objstringio.c index 178e6446cc..eb40e51543 100644 --- a/py/objstringio.c +++ b/py/objstringio.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/py/objstringio.h b/py/objstringio.h index 56738f4e45..38778f03ae 100644 --- a/py/objstringio.h +++ b/py/objstringio.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2016 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 diff --git a/py/objstrunicode.c b/py/objstrunicode.c index 30000a51e7..351a67e913 100644 --- a/py/objstrunicode.c +++ b/py/objstrunicode.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/py/objtuple.c b/py/objtuple.c index 0a2ed6f4c3..d34a7f7624 100644 --- a/py/objtuple.c +++ b/py/objtuple.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objtuple.h b/py/objtuple.h index 7f20ab7b6f..d2e87e9949 100644 --- a/py/objtuple.h +++ b/py/objtuple.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objtype.c b/py/objtype.c index ad68b85d2a..fd51ce36b8 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2018 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2018 Damien P. George * Copyright (c) 2014-2016 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/py/objtype.h b/py/objtype.h index a32c874967..a44622ffeb 100644 --- a/py/objtype.h +++ b/py/objtype.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/objzip.c b/py/objzip.c index ce9afd55de..885e464418 100644 --- a/py/objzip.c +++ b/py/objzip.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/opmethods.c b/py/opmethods.c index 247fa5bbc8..07d1e340de 100644 --- a/py/opmethods.c +++ b/py/opmethods.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/parse.c b/py/parse.c index b8cfda2cb5..28621cf898 100644 --- a/py/parse.c +++ b/py/parse.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2017 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2017 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 diff --git a/py/parse.h b/py/parse.h index 9a1a2b4dd4..946b41eac3 100644 --- a/py/parse.h +++ b/py/parse.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/parsenum.c b/py/parsenum.c index 6ef309b475..da63825e4b 100644 --- a/py/parsenum.c +++ b/py/parsenum.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/parsenum.h b/py/parsenum.h index a5bed731d2..a91ca532da 100644 --- a/py/parsenum.h +++ b/py/parsenum.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/parsenumbase.c b/py/parsenumbase.c index ba10591226..e4ac6d00ed 100644 --- a/py/parsenumbase.c +++ b/py/parsenumbase.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/parsenumbase.h b/py/parsenumbase.h index 3a525f993c..43dcc2353a 100644 --- a/py/parsenumbase.h +++ b/py/parsenumbase.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/persistentcode.c b/py/persistentcode.c index eb69bd4079..9b438453ad 100644 --- a/py/persistentcode.c +++ b/py/persistentcode.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2016 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 diff --git a/py/persistentcode.h b/py/persistentcode.h index d04e0b6330..cbb300e4b3 100644 --- a/py/persistentcode.h +++ b/py/persistentcode.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2016 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 diff --git a/py/pystack.c b/py/pystack.c index 552e59d537..f79ea92101 100644 --- a/py/pystack.c +++ b/py/pystack.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2017 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2017 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 diff --git a/py/pystack.h b/py/pystack.h index 82ac3743d1..3fbcdeeb8a 100644 --- a/py/pystack.h +++ b/py/pystack.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2017 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2017 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 diff --git a/py/qstr.c b/py/qstr.c index bb80244355..17d8517c93 100755 --- a/py/qstr.c +++ b/py/qstr.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/qstr.h b/py/qstr.h index 39b904fb18..070a3cd4f8 100644 --- a/py/qstr.h +++ b/py/qstr.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/qstrdefs.h b/py/qstrdefs.h index a609058120..b682671970 100644 --- a/py/qstrdefs.h +++ b/py/qstrdefs.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/reader.c b/py/reader.c index 80364104bb..1b0bbf094a 100644 --- a/py/reader.c +++ b/py/reader.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2016 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 diff --git a/py/reader.h b/py/reader.h index 8511c72ce5..6d8565d7b7 100644 --- a/py/reader.h +++ b/py/reader.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2016 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 diff --git a/py/repl.c b/py/repl.c index aa91c3f12e..785c0fb538 100644 --- a/py/repl.c +++ b/py/repl.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013-2015 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013-2015 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 diff --git a/py/repl.h b/py/repl.h index a7a4136cad..89b64c45f0 100644 --- a/py/repl.h +++ b/py/repl.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/runtime.c b/py/runtime.c index 59dcbc7a1c..91ead1fba9 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/runtime.h b/py/runtime.h index f811035571..d3a82333e7 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/runtime0.h b/py/runtime0.h index 16434b315a..a8089ea646 100644 --- a/py/runtime0.h +++ b/py/runtime0.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/scheduler.c b/py/scheduler.c index 30851a4d2b..fea7e0153d 100644 --- a/py/scheduler.c +++ b/py/scheduler.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2017 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2017 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 diff --git a/py/scope.c b/py/scope.c index 1a6ae7b8ad..98f39d4c6d 100644 --- a/py/scope.c +++ b/py/scope.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/scope.h b/py/scope.h index e3b6a57c79..c92a39e5e6 100644 --- a/py/scope.h +++ b/py/scope.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/sequence.c b/py/sequence.c index 0e668ea2a1..e6421fde5e 100644 --- a/py/sequence.c +++ b/py/sequence.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/py/showbc.c b/py/showbc.c index e71d8a2536..5a8e660fc4 100644 --- a/py/showbc.c +++ b/py/showbc.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/smallint.c b/py/smallint.c index aa542ca7bf..9124b76c13 100644 --- a/py/smallint.c +++ b/py/smallint.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/smallint.h b/py/smallint.h index 6a3c75236c..c58584413f 100644 --- a/py/smallint.h +++ b/py/smallint.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/stream.c b/py/stream.c index 2ff2b76a61..ae702bb1b6 100644 --- a/py/stream.c +++ b/py/stream.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/py/stream.h b/py/stream.h index dc9fc84c96..be6b23d40d 100644 --- a/py/stream.h +++ b/py/stream.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/unicode.c b/py/unicode.c index 935dc9012e..a17dbf969b 100644 --- a/py/unicode.c +++ b/py/unicode.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/unicode.h b/py/unicode.h index c1fb517894..78e7a7ab7e 100644 --- a/py/unicode.h +++ b/py/unicode.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 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 diff --git a/py/vm.c b/py/vm.c index 4f0340681e..9b3354b096 100644 --- a/py/vm.c +++ b/py/vm.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/py/vmentrytable.h b/py/vmentrytable.h index 31a96dbec4..e01199eee2 100644 --- a/py/vmentrytable.h +++ b/py/vmentrytable.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/vstr.c b/py/vstr.c index 91cd7f584f..ccc567d100 100644 --- a/py/vstr.c +++ b/py/vstr.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/py/warning.c b/py/warning.c index 12d0f9c99b..d516eabddf 100644 --- a/py/warning.c +++ b/py/warning.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 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 diff --git a/setup.py b/setup.py index 769bc66e1d..d2989d068d 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + from datetime import datetime from setuptools import setup from pathlib import Path diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index 400784b390..2aadf1c764 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/shared-bindings/analogio/AnalogIn.h b/shared-bindings/analogio/AnalogIn.h index 4aa7fca233..32f11e08f5 100644 --- a/shared-bindings/analogio/AnalogIn.h +++ b/shared-bindings/analogio/AnalogIn.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index a8edcc0ae1..62b73c5b13 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/shared-bindings/analogio/AnalogOut.h b/shared-bindings/analogio/AnalogOut.h index 6fe5d9b193..e4e94548b8 100644 --- a/shared-bindings/analogio/AnalogOut.h +++ b/shared-bindings/analogio/AnalogOut.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index eaf2c18101..0ef527f768 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/shared-bindings/digitalio/DigitalInOut.h b/shared-bindings/digitalio/DigitalInOut.h index dd6f088ab4..3d1f9c7cb3 100644 --- a/shared-bindings/digitalio/DigitalInOut.h +++ b/shared-bindings/digitalio/DigitalInOut.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c index 929e02ab81..1867665911 100644 --- a/shared-bindings/gnss/GNSS.c +++ b/shared-bindings/gnss/GNSS.c @@ -1,28 +1,6 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright 2020 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. - */ +// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation +// +// SPDX-License-Identifier: MIT #include "shared-bindings/gnss/GNSS.h" #include "shared-bindings/time/__init__.h" diff --git a/shared-bindings/gnss/GNSS.h b/shared-bindings/gnss/GNSS.h index 61ae35b12a..60069a90a9 100644 --- a/shared-bindings/gnss/GNSS.h +++ b/shared-bindings/gnss/GNSS.h @@ -1,28 +1,6 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright 2020 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. - */ +// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation +// +// SPDX-License-Identifier: MIT #ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_GNSS_H #define MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_GNSS_H diff --git a/shared-bindings/gnss/PositionFix.c b/shared-bindings/gnss/PositionFix.c index 106a28c347..262ebf3190 100644 --- a/shared-bindings/gnss/PositionFix.c +++ b/shared-bindings/gnss/PositionFix.c @@ -1,28 +1,6 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright 2020 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. - */ +// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation +// +// SPDX-License-Identifier: MIT #include "shared-bindings/gnss/PositionFix.h" diff --git a/shared-bindings/gnss/PositionFix.h b/shared-bindings/gnss/PositionFix.h index 64497cb59b..34090872cc 100644 --- a/shared-bindings/gnss/PositionFix.h +++ b/shared-bindings/gnss/PositionFix.h @@ -1,28 +1,6 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright 2020 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. - */ +// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation +// +// SPDX-License-Identifier: MIT #ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_POSITIONFIX_H #define MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_POSITIONFIX_H diff --git a/shared-bindings/gnss/SatelliteSystem.c b/shared-bindings/gnss/SatelliteSystem.c index badc02b964..8739fbc029 100644 --- a/shared-bindings/gnss/SatelliteSystem.c +++ b/shared-bindings/gnss/SatelliteSystem.c @@ -1,28 +1,6 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright 2020 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. - */ +// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation +// +// SPDX-License-Identifier: MIT #include "shared-bindings/gnss/SatelliteSystem.h" diff --git a/shared-bindings/gnss/SatelliteSystem.h b/shared-bindings/gnss/SatelliteSystem.h index 484e861abd..17f1550028 100644 --- a/shared-bindings/gnss/SatelliteSystem.h +++ b/shared-bindings/gnss/SatelliteSystem.h @@ -1,28 +1,6 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright 2020 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. - */ +// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation +// +// SPDX-License-Identifier: MIT #ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_SATELLITESYSTEM_H #define MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_SATELLITESYSTEM_H diff --git a/shared-bindings/gnss/__init__.c b/shared-bindings/gnss/__init__.c index b3cf722f11..4b0d312ae6 100644 --- a/shared-bindings/gnss/__init__.c +++ b/shared-bindings/gnss/__init__.c @@ -1,28 +1,6 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright 2020 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. - */ +// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation +// +// SPDX-License-Identifier: MIT #include "py/obj.h" #include "py/runtime.h" diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c index 8226a08ecb..ad2e1877d7 100644 --- a/shared-bindings/math/__init__.c +++ b/shared-bindings/math/__init__.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2017 Michael McWethy * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/shared-bindings/network/__init__.c b/shared-bindings/network/__init__.c index 6af86688eb..58aa13473e 100644 --- a/shared-bindings/network/__init__.c +++ b/shared-bindings/network/__init__.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 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 diff --git a/shared-bindings/network/__init__.h b/shared-bindings/network/__init__.h index 4fe5e75a37..b579aa57a3 100644 --- a/shared-bindings/network/__init__.h +++ b/shared-bindings/network/__init__.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/shared-bindings/os/__init__.c b/shared-bindings/os/__init__.c index 4e991d089d..a247d6d845 100644 --- a/shared-bindings/os/__init__.c +++ b/shared-bindings/os/__init__.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2015 Josef Gajdusek * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries * diff --git a/shared-bindings/pulseio/PWMOut.c b/shared-bindings/pulseio/PWMOut.c index 7970c02f34..a51789053f 100644 --- a/shared-bindings/pulseio/PWMOut.c +++ b/shared-bindings/pulseio/PWMOut.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2016 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 diff --git a/shared-bindings/pulseio/PWMOut.h b/shared-bindings/pulseio/PWMOut.h index c01e0c9261..c72278e0e0 100644 --- a/shared-bindings/pulseio/PWMOut.h +++ b/shared-bindings/pulseio/PWMOut.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/shared-bindings/pulseio/PulseOut.h b/shared-bindings/pulseio/PulseOut.h index 2cf78d3f29..390910ff62 100644 --- a/shared-bindings/pulseio/PulseOut.h +++ b/shared-bindings/pulseio/PulseOut.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/shared-bindings/rtc/RTC.c b/shared-bindings/rtc/RTC.c index 58fe308f53..7debb70c18 100644 --- a/shared-bindings/rtc/RTC.c +++ b/shared-bindings/rtc/RTC.c @@ -4,7 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2018 Noralf Trønnes - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/shared-bindings/rtc/__init__.c b/shared-bindings/rtc/__init__.c index b204d511c9..9f8d37fdd1 100644 --- a/shared-bindings/rtc/__init__.c +++ b/shared-bindings/rtc/__init__.c @@ -4,7 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2018 Noralf Trønnes - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c index 19c4850cde..0ded0218bb 100644 --- a/shared-bindings/socket/__init__.c +++ b/shared-bindings/socket/__init__.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2014 Damien P. George * 2018 Nick Moore for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c index 3abc5512c9..725329ad5b 100644 --- a/shared-bindings/storage/__init__.c +++ b/shared-bindings/storage/__init__.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2015 Josef Gajdusek * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries * diff --git a/shared-bindings/struct/__init__.c b/shared-bindings/struct/__init__.c index 256b385c8e..26c0ff3aff 100644 --- a/shared-bindings/struct/__init__.c +++ b/shared-bindings/struct/__init__.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2014 Paul Sokolovsky * Copyright (c) 2017 Michael McWethy * diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 531980effc..2f8a1c3e2c 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2015 Josef Gajdusek * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries * diff --git a/shared-bindings/touchio/TouchIn.c b/shared-bindings/touchio/TouchIn.c index 4c1d534eaa..54e5ac4a5e 100644 --- a/shared-bindings/touchio/TouchIn.c +++ b/shared-bindings/touchio/TouchIn.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/shared-bindings/touchio/TouchIn.h b/shared-bindings/touchio/TouchIn.h index e04e79c0b6..42f9da46d5 100644 --- a/shared-bindings/touchio/TouchIn.h +++ b/shared-bindings/touchio/TouchIn.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/shared-bindings/wiznet/__init__.c b/shared-bindings/wiznet/__init__.c index 0d3f1e4cd6..bc7ff150fe 100644 --- a/shared-bindings/wiznet/__init__.c +++ b/shared-bindings/wiznet/__init__.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 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 diff --git a/shared-bindings/wiznet/wiznet5k.c b/shared-bindings/wiznet/wiznet5k.c index 2f49dffea9..b3f372f41a 100644 --- a/shared-bindings/wiznet/wiznet5k.c +++ b/shared-bindings/wiznet/wiznet5k.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 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 diff --git a/shared-module/bitbangio/I2C.c b/shared-module/bitbangio/I2C.c index 5a9ac9a991..d44aec0e75 100644 --- a/shared-module/bitbangio/I2C.c +++ b/shared-module/bitbangio/I2C.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George, Scott Shawcroft + * SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George, Scott Shawcroft * * 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/shared-module/bitbangio/SPI.c b/shared-module/bitbangio/SPI.c index e0ff1184fe..f3fe16029a 100644 --- a/shared-module/bitbangio/SPI.c +++ b/shared-module/bitbangio/SPI.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/shared-module/network/__init__.h b/shared-module/network/__init__.h index f4eb05bb51..280cfe6c81 100644 --- a/shared-module/network/__init__.h +++ b/shared-module/network/__init__.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2018 Nick Moore * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/shared-module/os/__init__.c b/shared-module/os/__init__.c index 8060eec4f3..39cf40fda3 100644 --- a/shared-module/os/__init__.c +++ b/shared-module/os/__init__.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2015 Josef Gajdusek * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries * diff --git a/shared-module/storage/__init__.c b/shared-module/storage/__init__.c index c3d4b50c8e..aa3bcc6867 100644 --- a/shared-module/storage/__init__.c +++ b/shared-module/storage/__init__.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2015 Josef Gajdusek * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries * diff --git a/shared-module/wiznet/wiznet5k.c b/shared-module/wiznet/wiznet5k.c index a603a55937..8ccb4ff8d2 100644 --- a/shared-module/wiznet/wiznet5k.c +++ b/shared-module/wiznet/wiznet5k.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 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 diff --git a/shared-module/wiznet/wiznet5k.h b/shared-module/wiznet/wiznet5k.h index 19823ae550..4597a30160 100644 --- a/shared-module/wiznet/wiznet5k.h +++ b/shared-module/wiznet/wiznet5k.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2014 Damien P. George + * SPDX-FileCopyrightText: Copyright (c) 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 diff --git a/supervisor/flash.h b/supervisor/flash.h index a8a77bf040..cd69cbfa9b 100644 --- a/supervisor/flash.h +++ b/supervisor/flash.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/supervisor/shared/external_flash/common_commands.h b/supervisor/shared/external_flash/common_commands.h index 2eaa848331..37efd8ceb1 100644 --- a/supervisor/shared/external_flash/common_commands.h +++ b/supervisor/shared/external_flash/common_commands.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/supervisor/stub/internal_flash.c b/supervisor/stub/internal_flash.c index 5a82f81f77..3a4ba935de 100644 --- a/supervisor/stub/internal_flash.c +++ b/supervisor/stub/internal_flash.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2013, 2014 Damien P. George + * 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 diff --git a/tests/skip_if.py b/tests/skip_if.py index 7d6c5b2075..a8f50c4656 100644 --- a/tests/skip_if.py +++ b/tests/skip_if.py @@ -1,24 +1,7 @@ -# The MIT License (MIT) +# SPDX-FileCopyrightText: Copyright (c) 2017 Scott Shawcroft for Adafruit Industries +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # -# 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. +# SPDX-License-Identifier: MIT # This must be on one line so its skipped when built into tests. """This file provides helpers to detect particular running conditions and skip the test when appropriate.""" diff --git a/tests/thread/mutate_bytearray.py b/tests/thread/mutate_bytearray.py index f91b2d5807..5015c3f9cf 100644 --- a/tests/thread/mutate_bytearray.py +++ b/tests/thread/mutate_bytearray.py @@ -1,6 +1,8 @@ # test concurrent mutating access to a shared bytearray object # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT import _thread diff --git a/tests/thread/mutate_dict.py b/tests/thread/mutate_dict.py index c57d332d51..563fce39de 100644 --- a/tests/thread/mutate_dict.py +++ b/tests/thread/mutate_dict.py @@ -1,6 +1,8 @@ # test concurrent mutating access to a shared dict object # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT import _thread diff --git a/tests/thread/mutate_instance.py b/tests/thread/mutate_instance.py index a1ae428b54..2ecfbe1092 100644 --- a/tests/thread/mutate_instance.py +++ b/tests/thread/mutate_instance.py @@ -1,6 +1,8 @@ # test concurrent mutating access to a shared user instance # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT import _thread diff --git a/tests/thread/mutate_list.py b/tests/thread/mutate_list.py index 764a9bd99e..d70e8a8a38 100644 --- a/tests/thread/mutate_list.py +++ b/tests/thread/mutate_list.py @@ -1,6 +1,8 @@ # test concurrent mutating access to a shared list object # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT import _thread diff --git a/tests/thread/mutate_set.py b/tests/thread/mutate_set.py index 5492d86313..c4529f3562 100644 --- a/tests/thread/mutate_set.py +++ b/tests/thread/mutate_set.py @@ -1,6 +1,8 @@ # test concurrent mutating access to a shared set object # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT import _thread diff --git a/tests/thread/stress_aes.py b/tests/thread/stress_aes.py index df75e616c6..ebf7af371b 100644 --- a/tests/thread/stress_aes.py +++ b/tests/thread/stress_aes.py @@ -11,7 +11,9 @@ # aggressive by changing the amount of data to encrypt, the number of loops and # the number of threads. # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT ################################################################## # discrete arithmetic routines, mostly from a precomputed table diff --git a/tests/thread/stress_heap.py b/tests/thread/stress_heap.py index 5482a9ac6f..206cf1a860 100644 --- a/tests/thread/stress_heap.py +++ b/tests/thread/stress_heap.py @@ -1,7 +1,9 @@ # stress test for the heap by allocating lots of objects within threads # allocates about 5mb on the heap # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT try: import utime as time diff --git a/tests/thread/stress_recurse.py b/tests/thread/stress_recurse.py index 68367c4dd7..8edee246ad 100644 --- a/tests/thread/stress_recurse.py +++ b/tests/thread/stress_recurse.py @@ -1,6 +1,8 @@ # test hitting the function recursion limit within a thread # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT import _thread diff --git a/tests/thread/thread_exc1.py b/tests/thread/thread_exc1.py index 10fb94b4fb..e00a16bd26 100644 --- a/tests/thread/thread_exc1.py +++ b/tests/thread/thread_exc1.py @@ -1,6 +1,8 @@ # test raising and catching an exception within a thread # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT import _thread diff --git a/tests/thread/thread_exit1.py b/tests/thread/thread_exit1.py index 88cdd165c7..ad7b01d89b 100644 --- a/tests/thread/thread_exit1.py +++ b/tests/thread/thread_exit1.py @@ -1,6 +1,8 @@ # test _thread.exit() function # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT try: import utime as time diff --git a/tests/thread/thread_exit2.py b/tests/thread/thread_exit2.py index 368a11bba4..6bff8a1736 100644 --- a/tests/thread/thread_exit2.py +++ b/tests/thread/thread_exit2.py @@ -1,6 +1,8 @@ # test raising SystemExit to finish a thread # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT try: import utime as time diff --git a/tests/thread/thread_gc1.py b/tests/thread/thread_gc1.py index 8dcbf7e07a..2ea1891615 100644 --- a/tests/thread/thread_gc1.py +++ b/tests/thread/thread_gc1.py @@ -1,6 +1,8 @@ # test that we can run the garbage collector within threads # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT import gc import _thread diff --git a/tests/thread/thread_ident1.py b/tests/thread/thread_ident1.py index 217fce73b1..9a6f89ff5f 100644 --- a/tests/thread/thread_ident1.py +++ b/tests/thread/thread_ident1.py @@ -1,6 +1,8 @@ # test _thread.get_ident() function # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT import _thread diff --git a/tests/thread/thread_lock1.py b/tests/thread/thread_lock1.py index ba5c7dff06..c2d7c9d1ed 100644 --- a/tests/thread/thread_lock1.py +++ b/tests/thread/thread_lock1.py @@ -1,6 +1,8 @@ # test _thread lock object using a single thread # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT import _thread diff --git a/tests/thread/thread_lock2.py b/tests/thread/thread_lock2.py index 405f10b0b6..4ef912dff5 100644 --- a/tests/thread/thread_lock2.py +++ b/tests/thread/thread_lock2.py @@ -1,6 +1,8 @@ # test _thread lock objects with multiple threads # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT try: import utime as time diff --git a/tests/thread/thread_lock3.py b/tests/thread/thread_lock3.py index 607898dad8..35808d99cb 100644 --- a/tests/thread/thread_lock3.py +++ b/tests/thread/thread_lock3.py @@ -1,6 +1,8 @@ # test thread coordination using a lock object # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT import _thread diff --git a/tests/thread/thread_lock4.py b/tests/thread/thread_lock4.py index 2f9d42d6b5..440f3e90c6 100644 --- a/tests/thread/thread_lock4.py +++ b/tests/thread/thread_lock4.py @@ -1,6 +1,8 @@ # test using lock to coordinate access to global mutable objects # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT try: import utime as time diff --git a/tests/thread/thread_qstr1.py b/tests/thread/thread_qstr1.py index f4136d9646..dccfb7f517 100644 --- a/tests/thread/thread_qstr1.py +++ b/tests/thread/thread_qstr1.py @@ -1,6 +1,8 @@ # test concurrent interning of strings # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT try: import utime as time diff --git a/tests/thread/thread_shared1.py b/tests/thread/thread_shared1.py index 13c6651cc4..de339ad7f8 100644 --- a/tests/thread/thread_shared1.py +++ b/tests/thread/thread_shared1.py @@ -1,6 +1,8 @@ # test capability for threads to access a shared immutable data structure # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT import _thread diff --git a/tests/thread/thread_shared2.py b/tests/thread/thread_shared2.py index e4bfe78022..2c749e6883 100644 --- a/tests/thread/thread_shared2.py +++ b/tests/thread/thread_shared2.py @@ -1,7 +1,9 @@ # test capability for threads to access a shared mutable data structure # (without contention because they access different parts of the structure) # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT import _thread diff --git a/tests/thread/thread_sleep1.py b/tests/thread/thread_sleep1.py index 032ec17543..d5aa99f977 100644 --- a/tests/thread/thread_sleep1.py +++ b/tests/thread/thread_sleep1.py @@ -1,6 +1,8 @@ # test threads sleeping # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT try: import utime diff --git a/tests/thread/thread_stacksize1.py b/tests/thread/thread_stacksize1.py index 62b6e5e40d..e7189fafbc 100644 --- a/tests/thread/thread_stacksize1.py +++ b/tests/thread/thread_stacksize1.py @@ -1,6 +1,8 @@ # test setting the thread stack size # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT import sys import _thread diff --git a/tests/thread/thread_start1.py b/tests/thread/thread_start1.py index d23a74aa21..94df6dc625 100644 --- a/tests/thread/thread_start1.py +++ b/tests/thread/thread_start1.py @@ -1,6 +1,8 @@ # test basic capability to start a new thread # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT try: import utime as time diff --git a/tests/thread/thread_start2.py b/tests/thread/thread_start2.py index d0913e37cd..9412bb6183 100644 --- a/tests/thread/thread_start2.py +++ b/tests/thread/thread_start2.py @@ -1,6 +1,8 @@ # test capability to start a thread with keyword args # -# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +# +# SPDX-License-Identifier: MIT try: import utime as time diff --git a/tools/analyze_heap_dump.py b/tools/analyze_heap_dump.py index b8f2bd0112..887871db7a 100755 --- a/tools/analyze_heap_dump.py +++ b/tools/analyze_heap_dump.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # This script renders a graph of the MicroPython heap at the given point it was dumped. # It takes three files, the binary dump of ram, the binary for CircuitPython and the linker map file. diff --git a/tools/analyze_mpy.py b/tools/analyze_mpy.py index 376207a24e..a2f541d0f4 100644 --- a/tools/analyze_mpy.py +++ b/tools/analyze_mpy.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + import sys import binascii import io diff --git a/tools/bootstrap_upip.sh b/tools/bootstrap_upip.sh index 2891775d7d..8b9d199fa9 100755 --- a/tools/bootstrap_upip.sh +++ b/tools/bootstrap_upip.sh @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # This script performs bootstrap installation of upip package manager from PyPI # All the other packages can be installed using it. diff --git a/tools/build-stm-latest.sh b/tools/build-stm-latest.sh index 07cb168daa..bfee1b1922 100755 --- a/tools/build-stm-latest.sh +++ b/tools/build-stm-latest.sh @@ -1,5 +1,9 @@ #!/bin/bash +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # function for building firmware function do_build() { descr=$1 diff --git a/tools/build_board_info.py b/tools/build_board_info.py index bbafe19f6a..6ed8b8c167 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -1,5 +1,9 @@ #!/usr/bin/env python3 +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + import json import os import subprocess diff --git a/tools/build_memory_info.py b/tools/build_memory_info.py index 808b70bd22..26697b9740 100644 --- a/tools/build_memory_info.py +++ b/tools/build_memory_info.py @@ -1,28 +1,9 @@ #!/usr/bin/env python3 + +# SPDX-FileCopyrightText: Copyright (c) 2017 Scott Shawcroft for Adafruit Industries +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # -# 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. +# SPDX-License-Identifier: MIT import re import sys diff --git a/tools/build_release_files.py b/tools/build_release_files.py index 09133e51fa..3563dd99f1 100755 --- a/tools/build_release_files.py +++ b/tools/build_release_files.py @@ -1,5 +1,9 @@ #! /usr/bin/env python3 +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + import os import sys import subprocess diff --git a/tools/chart_code_size.py b/tools/chart_code_size.py index 0b55787fa4..f75269130f 100644 --- a/tools/chart_code_size.py +++ b/tools/chart_code_size.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # This script renders a graph of the CircuitPython rom image. # It takes the single elf file and uses objdump to get its contents. diff --git a/tools/check_code_size.sh b/tools/check_code_size.sh index 2925ff1689..bdf1b5ad9b 100755 --- a/tools/check_code_size.sh +++ b/tools/check_code_size.sh @@ -1,4 +1,9 @@ #!/bin/bash + +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # # This script check that changes don't lead to code size regressions. # (Size of the language core (== minimal port should not grow)). diff --git a/tools/check_translations.py b/tools/check_translations.py index 7c008d3da7..95776a5449 100644 --- a/tools/check_translations.py +++ b/tools/check_translations.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # Validate that all entries in the .pot are in every .po. Only the .pot is updated so we can detect # if a translation was added to the source but isn't in a .po. This ensures translators can grab # complete files to work on. diff --git a/tools/ci_new_boards_check.py b/tools/ci_new_boards_check.py index 8bb8876fbc..86010bad3e 100644 --- a/tools/ci_new_boards_check.py +++ b/tools/ci_new_boards_check.py @@ -1,5 +1,9 @@ #! /usr/bin/env python3 +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + import sys import os import json diff --git a/tools/codestats.sh b/tools/codestats.sh index 5f7625c450..c0dd747dc6 100755 --- a/tools/codestats.sh +++ b/tools/codestats.sh @@ -1,4 +1,9 @@ #!/bin/sh + +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # # This script generates statistics (build size, speed) for successive # revisions of the code. It checks out git commits one an a time, compiles diff --git a/tools/convert_release_notes.py b/tools/convert_release_notes.py index 6491841029..4b16f005ec 100644 --- a/tools/convert_release_notes.py +++ b/tools/convert_release_notes.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + import sys import mistune diff --git a/tools/cpboard.py b/tools/cpboard.py index 7769cb4f46..464be4ba44 100644 --- a/tools/cpboard.py +++ b/tools/cpboard.py @@ -1,33 +1,12 @@ #!/usr/bin/env python3 + +# SPDX-FileCopyrightText: Copyright (c) 2014-2016 Damien P. George +# SPDX-FileCopyrightText: Copyright (c) 2017 Paul Sokolovsky +# SPDX-FileCopyrightText: Copyright (c) 2017 Scott Shawcroft for Adafruit Industries +# SPDX-FileCopyrightText: Copyright (c) 2018 Noralf Trønnes +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # -# This file is part of the MicroPython project, http://micropython.org/ -# -# The MIT License (MIT) -# -# Copyright (c) 2017 Scott Shawcroft for Adafruit Industries -# Copyright (c) 2018 Noralf Trønnes -# -# Parts taken from pyboard.py: -# Copyright (c) 2014-2016 Damien P. George -# Copyright (c) 2017 Paul Sokolovsky -# -# 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. +# SPDX-License-Identifier: MIT import os import re diff --git a/tools/dfu.py b/tools/dfu.py index dd6019235b..489465f0cf 100644 --- a/tools/dfu.py +++ b/tools/dfu.py @@ -1,5 +1,9 @@ #!/usr/bin/python +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # Written by Antonio Galea - 2010/11/18 # Updated for DFU 1.1 by Sean Cross - 2020/03/31 # Distributed under Gnu LGPL 3.0 diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index d749d202b3..b9366f6bab 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + import os import sys import astroid diff --git a/tools/file2h.py b/tools/file2h.py index 2a04ae22b9..706dd4dd23 100644 --- a/tools/file2h.py +++ b/tools/file2h.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # Reads in a text file, and performs the necessary escapes so that it # can be #included as a static string like: # static const char string_from_textfile[] = diff --git a/tools/fixup_translations.py b/tools/fixup_translations.py index 6db7f1cc5c..0362923e88 100644 --- a/tools/fixup_translations.py +++ b/tools/fixup_translations.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # Validate that all entries in the .pot are in every .po. Only the .pot is updated so we can detect # if a translation was added to the source but isn't in a .po. This ensures translators can grab # complete files to work on. diff --git a/tools/gc_activity.py b/tools/gc_activity.py index 8d172ea3ab..cc9a218361 100644 --- a/tools/gc_activity.py +++ b/tools/gc_activity.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + import sys import json diff --git a/tools/gc_activity_between_collects.py b/tools/gc_activity_between_collects.py index c02c479f9a..f906cf5c7e 100644 --- a/tools/gc_activity_between_collects.py +++ b/tools/gc_activity_between_collects.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + import sys import json diff --git a/tools/gen-changelog.sh b/tools/gen-changelog.sh index 6eca1b4b11..b29606b0c7 100755 --- a/tools/gen-changelog.sh +++ b/tools/gen-changelog.sh @@ -1,5 +1,9 @@ #!/bin/sh +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + echo "MicroPython change log" for t in $(git tag | grep -v v1.0-rc1 | sort -rV); do diff --git a/tools/gen_display_resources.py b/tools/gen_display_resources.py index c08daf4776..478a2f22f9 100644 --- a/tools/gen_display_resources.py +++ b/tools/gen_display_resources.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + import argparse import os diff --git a/tools/gen_ld_files.py b/tools/gen_ld_files.py index c2ac812bc9..1fea1a7efa 100755 --- a/tools/gen_ld_files.py +++ b/tools/gen_ld_files.py @@ -1,4 +1,9 @@ #! /usr/bin/env python3 + +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + import argparse import os diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index 5e25528f90..9a8423c323 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + import argparse import os diff --git a/tools/gendoc.py b/tools/gendoc.py index 61844d203f..85411cb410 100644 --- a/tools/gendoc.py +++ b/tools/gendoc.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + """ Generate documentation for pyboard API from C files. """ diff --git a/tools/git-checkout-latest-tag.sh b/tools/git-checkout-latest-tag.sh index f6242a946d..69fa2ced4f 100755 --- a/tools/git-checkout-latest-tag.sh +++ b/tools/git-checkout-latest-tag.sh @@ -1,3 +1,8 @@ #!/bin/bash + +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + git fetch --tags git checkout $(git describe --tags `git rev-list --tags --max-count=1`) diff --git a/tools/hid_report_descriptors.py b/tools/hid_report_descriptors.py index 07ed26744f..e13e0dbdd1 100644 --- a/tools/hid_report_descriptors.py +++ b/tools/hid_report_descriptors.py @@ -1,24 +1,7 @@ -# The MIT License (MIT) +# SPDX-FileCopyrightText: Copyright (c) 2018 Dan Halbert for Adafruit Industries +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # -# 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. +# SPDX-License-Identifier: MIT import struct diff --git a/tools/insert-usb-ids.py b/tools/insert-usb-ids.py index cdccd3be97..bf74ceeab5 100644 --- a/tools/insert-usb-ids.py +++ b/tools/insert-usb-ids.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # Reads the USB VID and PID from the file specified by sys.argv[1] and then # inserts those values into the template file specified by sys.argv[2], # printing the result to stdout diff --git a/tools/join_bins.py b/tools/join_bins.py index cb73aaabb8..a370f86e44 100644 --- a/tools/join_bins.py +++ b/tools/join_bins.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + import sys output_filename = sys.argv[1] diff --git a/tools/make-frozen.py b/tools/make-frozen.py index 1051b520e4..ad23b9d595 100755 --- a/tools/make-frozen.py +++ b/tools/make-frozen.py @@ -1,4 +1,9 @@ #!/usr/bin/env python + +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # # Create frozen modules structure for MicroPython. # diff --git a/tools/mpy-tool.py b/tools/mpy-tool.py index 5ce24061bc..95090466c4 100755 --- a/tools/mpy-tool.py +++ b/tools/mpy-tool.py @@ -1,28 +1,9 @@ #!/usr/bin/env python3 + +# SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # -# This file is part of the MicroPython project, http://micropython.org/ -# -# The MIT License (MIT) -# -# Copyright (c) 2016 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. +# SPDX-License-Identifier: MIT # Python 2/3 compatibility code from __future__ import print_function diff --git a/tools/mpy_bin2res.py b/tools/mpy_bin2res.py index 0c89e7e92b..8d67b71baa 100755 --- a/tools/mpy_bin2res.py +++ b/tools/mpy_bin2res.py @@ -1,4 +1,9 @@ #!/usr/bin/env python3 + +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + # # This tool converts binary resource files passed on the command line # into a Python source file containing data from these files, which can diff --git a/tools/mpy_cross_all.py b/tools/mpy_cross_all.py index 2bda71e9bc..5d9f8bc0ba 100755 --- a/tools/mpy_cross_all.py +++ b/tools/mpy_cross_all.py @@ -1,4 +1,9 @@ #!/usr/bin/env python3 + +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + import argparse import os import os.path diff --git a/tools/preprocess_frozen_modules.py b/tools/preprocess_frozen_modules.py index 7ae20c4d61..b75a2e7238 100755 --- a/tools/preprocess_frozen_modules.py +++ b/tools/preprocess_frozen_modules.py @@ -1,4 +1,9 @@ #!/usr/bin/env python3 + +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + import argparse import os import os.path diff --git a/tools/print_status.py b/tools/print_status.py index ed563fd68b..9a8b311dc2 100755 --- a/tools/print_status.py +++ b/tools/print_status.py @@ -1,5 +1,9 @@ #!/usr/bin/env python3 +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + import sys if len(sys.argv) != 2: print("""\ diff --git a/tools/pyboard.py b/tools/pyboard.py index bb5642bd78..ddf6bb6c40 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -1,29 +1,10 @@ #!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2014-2016 Damien P. George +# SPDX-FileCopyrightText: Copyright (c) 2017 Paul Sokolovsky +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # -# This file is part of the MicroPython project, http://micropython.org/ -# -# The MIT License (MIT) -# -# Copyright (c) 2014-2016 Damien P. George -# Copyright (c) 2017 Paul Sokolovsky -# -# 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. +# SPDX-License-Identifier: MIT """ pyboard interface diff --git a/tools/pydfu.py b/tools/pydfu.py index a7adda37cc..a6210c603a 100755 --- a/tools/pydfu.py +++ b/tools/pydfu.py @@ -1,8 +1,9 @@ #!/usr/bin/env python -# This file is part of the OpenMV project. -# Copyright (c) 2013/2014 Ibrahim Abdelkader -# This work is licensed under the MIT license, see the file LICENSE for -# details. + +# SPDX-FileCopyrightText: Copyright (c) 2013/2014 Ibrahim Abdelkader +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT """This module implements enough functionality to program the STM32F4xx over DFU, without requiring dfu-util. diff --git a/tools/tinytest-codegen.py b/tools/tinytest-codegen.py index 7a48f8a9a7..74b1878f95 100755 --- a/tools/tinytest-codegen.py +++ b/tools/tinytest-codegen.py @@ -1,5 +1,9 @@ #!/usr/bin/env python3 +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + import os, sys from glob import glob from re import sub diff --git a/tools/upip.py b/tools/upip.py index a400c31743..27fbae272f 100644 --- a/tools/upip.py +++ b/tools/upip.py @@ -1,10 +1,10 @@ -# # upip - Package manager for MicroPython + +# SPDX-FileCopyrightText: Copyright (c) 2015-2018 Paul Sokolovsky +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # -# Copyright (c) 2015-2018 Paul Sokolovsky -# -# Licensed under the MIT license. -# +# SPDX-License-Identifier: MIT + import sys import gc import uos as os diff --git a/tools/upip_utarfile.py b/tools/upip_utarfile.py index 460ca2cd44..44d6364524 100644 --- a/tools/upip_utarfile.py +++ b/tools/upip_utarfile.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + import uctypes # http://www.gnu.org/software/tar/manual/html_node/Standard.html From ab4a453006f3110fb4836708cb88521f126884df Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 6 Jul 2020 21:40:38 -0500 Subject: [PATCH 0247/1293] Made requested changes --- ports/atmel-samd/supervisor/port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 05ce0eb09b..9a09c7afad 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -507,7 +507,7 @@ void port_interrupt_after_ticks(uint32_t ticks) { return; } #ifdef SAMD21 - if (hold_interrupt == true) { + if (hold_interrupt) { return; } #endif @@ -525,7 +525,7 @@ void port_sleep_until_interrupt(void) { } #endif common_hal_mcu_disable_interrupts(); - if (!tud_task_event_ready()) { + if (!tud_task_event_ready() && !hold_interrupt) { __DSB(); __WFI(); } From 1b3cb17abdc943af3ccbe2b6fd1182bbda3597b2 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 6 Jul 2020 21:47:11 -0500 Subject: [PATCH 0248/1293] Corrected file for SAMD51 build --- ports/atmel-samd/supervisor/port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 9a09c7afad..af107de421 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -91,8 +91,8 @@ #if CIRCUITPY_PEW #include "common-hal/_pew/PewPew.h" #endif -#ifdef SAMD21 volatile bool hold_interrupt = false; +#ifdef SAMD21 void rtc_start_pulsein(void) { rtc_set_continuous(); From 0932b64ae7ea75d2ecc3c363ed6a9507fc4cc3a6 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 6 Jul 2020 23:25:33 -0500 Subject: [PATCH 0249/1293] Correct for SAMD51 build --- ports/atmel-samd/supervisor/port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index af107de421..e892e6cde5 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -93,11 +93,11 @@ #endif volatile bool hold_interrupt = false; #ifdef SAMD21 - void rtc_start_pulsein(void) { rtc_set_continuous(); hold_interrupt = true; } + void rtc_end_pulsein(void) { hold_interrupt = false; } From d73d7488b7e001f8f6ba138648b49a6969a71f6a Mon Sep 17 00:00:00 2001 From: oon arfiandwi Date: Mon, 6 Jul 2020 04:06:24 +0000 Subject: [PATCH 0250/1293] Translated using Weblate (Indonesian) Currently translated at 43.0% (335 of 778 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/id/ --- locale/ID.po | 223 +++++++++++++++++++++++++++------------------------ 1 file changed, 116 insertions(+), 107 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index a0c255b233..aab5f82810 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-02 15:29+0200\n" -"PO-Revision-Date: 2020-07-04 02:45+0000\n" -"Last-Translator: Jeff Epler \n" +"PO-Revision-Date: 2020-07-06 18:10+0000\n" +"Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" "Language: ID\n" "MIME-Version: 1.0\n" @@ -203,7 +203,7 @@ msgstr "'%s' objek tidak dapat diulang" #: py/obj.c #, c-format msgid "'%s' object is not subscriptable" -msgstr "" +msgstr "Objek '%s' tidak dapat disubkripsikan" #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" @@ -263,7 +263,7 @@ msgstr ", dalam %q\n" #: py/objcomplex.c msgid "0.0 to a complex power" -msgstr "" +msgstr "0.0 ke kompleks berpangkat" #: py/modbuiltins.c msgid "3-arg pow() not supported" @@ -321,7 +321,7 @@ msgstr "Semua timer sedang digunakan" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." -msgstr "" +msgstr "Sudah disebarkan." #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -399,7 +399,7 @@ msgstr "Kedua pin harus mendukung hardware interrut" #: shared-bindings/framebufferio/FramebufferDisplay.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "Brightness harus di antara 0-1.0" +msgstr "Kecerahan harus di antara 0-1.0" #: shared-bindings/supervisor/__init__.c msgid "Brightness must be between 0 and 255" @@ -442,7 +442,7 @@ msgstr "Panjang buffer harus kelipatan 512" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" -msgstr "Buffer harus memiliki panjang setidaknya 1" +msgstr "Penyangga harus memiliki panjang setidaknya 1" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Buffer too large and unable to allocate" @@ -496,6 +496,8 @@ msgstr "Tidak bisa mendapatkan suhu" #: shared-bindings/_bleio/Adapter.c msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" +"Tidak dapat memiliki respon pindaian untuk penyebaran yang terhubung dan " +"diperluas." #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" @@ -533,11 +535,11 @@ msgstr "Tidak dapat menentukan RTS atau CTS dalam mode RS485" #: py/objslice.c msgid "Cannot subclass slice" -msgstr "" +msgstr "Tidak dapat membuat subkelas dari irisan" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins." -msgstr "" +msgstr "Tidak dapat transfer tanpa pin MOSI dan MISO." #: extmod/moductypes.c msgid "Cannot unambiguously get sizeof scalar" @@ -546,32 +548,36 @@ msgstr "tidak dapat mendapatkan ukuran scalar secara tidak ambigu" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" +"Tidak dapat membuat variasi frekuensi pada penghitung waktu yang sudah " +"digunakan" #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." -msgstr "" +msgstr "Tidak dapat menulis tanpa pin MOSI." #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" -msgstr "" +msgstr "Menulis CharacteristicBuffer tidak tersedia" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" -msgstr "" +msgstr "Kode inti CircuitPython mengalami crash. Aduh!\n" #: supervisor/shared/safe_mode.c msgid "" "CircuitPython is in safe mode because you pressed the reset button during " "boot. Press again to exit safe mode.\n" msgstr "" +"CircuitPython dalam mode aman karena Anda menekan tombol reset saat boot. " +"Tekan lagi untuk keluar dari mode aman.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." -msgstr "" +msgstr "Init pin clock gagal." #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" -msgstr "" +msgstr "Peregangan clock terlalu panjang" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Clock unit in use" @@ -579,26 +585,27 @@ msgstr "Clock unit sedang digunakan" #: shared-bindings/_pew/PewPew.c msgid "Column entry must be digitalio.DigitalInOut" -msgstr "" +msgstr "Entri kolom harus digitalio.DigitalInOut" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c msgid "Command must be an int between 0 and 255" -msgstr "" +msgstr "Perintah harus berupa int di antara 0 dan 255" #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " "connection." msgstr "" +"Koneksi telah terputus dan tidak dapat lagi digunakan. Buat koneksi baru." #: py/persistentcode.c msgid "Corrupt .mpy file" -msgstr "" +msgstr "File .mpy rusak" #: py/emitglue.c msgid "Corrupt raw code" -msgstr "" +msgstr "Kode raw rusak" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" @@ -614,61 +621,61 @@ msgstr "Tidak dapat menginisialisasi UART" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize channel" -msgstr "" +msgstr "Tidak dapat menginisialisasi kanal" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize timer" -msgstr "" +msgstr "Tidak dapat menginisialisasi timer" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init channel" -msgstr "" +msgstr "Tidak dapat menginisialisasi ulang kanal" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init timer" -msgstr "" +msgstr "Tidak dapat menginisialisasi ulang timer" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not restart PWM" -msgstr "" +msgstr "Tidak dapat memulai ulang PWM" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" -msgstr "" +msgstr "Tidak dapat memulai PWM" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" -msgstr "" +msgstr "Tidak dapat memulai interupsi, RX sibuk" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" -msgstr "" +msgstr "Tidak dapat mengalokasikan dekoder" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate first buffer" -msgstr "" +msgstr "Tidak dapat mengalokasikan penyangga pertama" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate input buffer" -msgstr "" +msgstr "Tidak dapat mengalokasikan penyangga masukan" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate second buffer" -msgstr "" +msgstr "Tidak dapat mengalokasikan penyangga kedua" #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." -msgstr "" +msgstr "Gagal ke HardFault_Handler." #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" -msgstr "" +msgstr "Terjadi kesalahan saat menginisialisasi kanal DAC" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" -msgstr "" +msgstr "Terjadi kesalahan saat menginisialisasi perangkat DAC" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -677,11 +684,11 @@ msgstr "DAC sudah digunakan" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c msgid "Data 0 pin must be byte aligned" -msgstr "" +msgstr "Data 0 pin harus byte disejajarkan" #: shared-module/audiocore/WaveFile.c msgid "Data chunk must follow fmt chunk" -msgstr "" +msgstr "Potongan data harus mengikuti fmt chunk" #: ports/nrf/common-hal/_bleio/Adapter.c #, fuzzy @@ -690,34 +697,34 @@ msgstr "Tidak bisa menyesuaikan data ke dalam paket advertisment" #: shared-bindings/audiobusio/PDMIn.c msgid "Destination capacity is smaller than destination_length." -msgstr "" +msgstr "Kapasitas tujuan lebih kecil dari destination_length." #: ports/nrf/common-hal/audiobusio/I2SOut.c msgid "Device in use" -msgstr "" +msgstr "Perangkat sedang digunakan" #: ports/cxd56/common-hal/digitalio/DigitalInOut.c msgid "DigitalInOut not supported on given pin" -msgstr "" +msgstr "DigitalInOut tidak didukung pada pin yang diberikan" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." -msgstr "" +msgstr "Tampilan harus memiliki ruang warna 16 bit." #: 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 "Rotasi tampilan harus dalam kelipatan 90 derajat" #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." -msgstr "" +msgstr "Mode kendara tidak digunakan saat arah input." #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" -msgstr "" +msgstr "ECB hanya beroperasi pada 16 byte di satu waktu" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -735,42 +742,42 @@ msgstr "Error pada regex" #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" -msgstr "" +msgstr "Diharapkan %q" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c msgid "Expected a Characteristic" -msgstr "" +msgstr "Diharapkan sebuah Karakteristik" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" -msgstr "" +msgstr "Diharapkan sebuah Layanan" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" -msgstr "" +msgstr "Diharapkan sebuah UUID" #: shared-bindings/_bleio/Adapter.c msgid "Expected an Address" -msgstr "" +msgstr "Diharapkan sebuah Alamat" #: shared-module/_pixelbuf/PixelBuf.c #, c-format msgid "Expected tuple of length %d, got %d" -msgstr "" +msgstr "Diharapkan tuple dengan panjang %d, didapatkan %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." -msgstr "" +msgstr "Penyebaran yang diperluas dengan respon pindai tidak didukung." #: extmod/ulab/code/fft.c msgid "FFT is defined for ndarrays only" -msgstr "" +msgstr "FFT didefinisikan hanya untuk ndarrays" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." -msgstr "" +msgstr "Gagal mengirim perintah." #: ports/nrf/sd_mutex.c #, fuzzy, c-format @@ -792,15 +799,15 @@ msgstr "Gagal untuk megalokasikan buffer RX dari %d byte" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" -msgstr "" +msgstr "Gagal terhubung: kesalahan internal" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: timeout" -msgstr "" +msgstr "Gagal terhubung: habis waktu" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" -msgstr "" +msgstr "Gagal mengurai file MP3" #: ports/nrf/sd_mutex.c #, fuzzy, c-format @@ -809,43 +816,43 @@ msgstr "Gagal untuk melepaskan mutex, status: 0x%08lX" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "" +msgstr "Gagal menulis flash internal." #: py/moduerrno.c msgid "File exists" -msgstr "" +msgstr "File sudah ada" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." -msgstr "" +msgstr "Frekuensi yang ditangkap berada di atas kemampuan. Penangkapan Ditunda." #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" -msgstr "" +msgstr "Frekuensi harus cocok dengan PWMOut yang ada menggunakan timer ini" #: 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 "Fungsinya membutuhkan kunci" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" -msgstr "" +msgstr "Grup sudah digunakan" #: shared-module/displayio/Group.c msgid "Group full" -msgstr "" +msgstr "Grup penuh" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" -msgstr "" +msgstr "Perangkat keras sibuk, coba pin alternatif" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" -msgstr "" +msgstr "Perangkat keras sedang digunakan, coba pin alternatif" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -853,43 +860,45 @@ msgstr "operasi I/O pada file tertutup" #: ports/stm/common-hal/busio/I2C.c msgid "I2C Init Error" -msgstr "" +msgstr "Gagal Inisialisasi I2C" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "" +msgstr "Panjang IV harus %d byte" #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" +"File .mpy tidak kompatibel. Perbarui semua file .mpy. Lihat http://adafru.it/" +"mpy-update untuk info lebih lanjut." #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" -msgstr "" +msgstr "Ukuran penyangga salah" #: py/moduerrno.c msgid "Input/output error" -msgstr "" +msgstr "Kesalahan input/output" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" -msgstr "" +msgstr "Otentikasi tidak cukup" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" -msgstr "" +msgstr "Enkripsi tidak cukup" #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" -msgstr "" +msgstr "Kesalahan definisi internal" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format msgid "Internal error #%d" -msgstr "" +msgstr "Kesalahan internal #%d" #: shared-bindings/sdioio/SDCard.c msgid "Invalid %q" @@ -902,19 +911,19 @@ msgstr "%q pada tidak valid" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" -msgstr "" +msgstr "Nilai Unit ADC tidak valid" #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" -msgstr "" +msgstr "File BMP tidak valid" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" -msgstr "" +msgstr "Pin DAC yang diberikan tidak valid" #: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" -msgstr "" +msgstr "Pilihan pin I2C tidak valid" #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c @@ -924,19 +933,19 @@ msgstr "Frekuensi PWM tidak valid" #: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" -msgstr "" +msgstr "Pilihan pin SPI tidak valid" #: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" -msgstr "" +msgstr "Pilihan pin UART tidak valid" #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" -msgstr "" +msgstr "Argumen tidak valid" #: shared-module/displayio/Bitmap.c msgid "Invalid bits per value" -msgstr "" +msgstr "Bit per nilai tidak valid" #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" @@ -944,44 +953,44 @@ msgstr "Ukuran buffer tidak valid" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Invalid byteorder string" -msgstr "" +msgstr "String byteorder tidak valid" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" +msgstr "Periode penangkapan tidak valid. Kisaran yang valid: 1 - 500" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid channel count" -msgstr "" +msgstr "Jumlah kanal tidak valid" #: shared-bindings/digitalio/DigitalInOut.c msgid "Invalid direction." -msgstr "" +msgstr "Arah tidak valid." #: shared-module/audiocore/WaveFile.c msgid "Invalid file" -msgstr "" +msgstr "File tidak valid" #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" -msgstr "" +msgstr "Ukuran potongan format tidak valid" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid frequency supplied" -msgstr "" +msgstr "Frekuensi yang diberikan tidak valid" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "" +msgstr "Akses memori tidak valid." #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid number of bits" -msgstr "" +msgstr "Jumlah bit tidak valid" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c msgid "Invalid phase" -msgstr "" +msgstr "Fase tidak valid" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c @@ -1011,44 +1020,44 @@ msgstr "Pin-pin tidak valid" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid pins for PWMOut" -msgstr "" +msgstr "Pin untuk PWMOut tidak valid" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" -msgstr "" +msgstr "Polaritas tidak valid" #: shared-bindings/_bleio/Characteristic.c msgid "Invalid properties" -msgstr "" +msgstr "Properti tidak valid" #: shared-bindings/microcontroller/__init__.c msgid "Invalid run mode." -msgstr "" +msgstr "Mode operasi tidak valid." #: shared-module/_bleio/Attribute.c msgid "Invalid security_mode" -msgstr "" +msgstr "security_mode tidak valid" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice" -msgstr "" +msgstr "Suara tidak valid" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice count" -msgstr "" +msgstr "Hitungan suara tidak valid" #: shared-module/audiocore/WaveFile.c msgid "Invalid wave file" -msgstr "" +msgstr "File wave tidak valid" #: ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" -msgstr "" +msgstr "Panjang kata/bit tidak valid" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" -msgstr "" +msgstr "Panjang kunci harus 16, 24, atau 32 byte" #: py/compile.c msgid "LHS of keyword arg must be an id" @@ -1056,40 +1065,40 @@ msgstr "LHS dari keyword arg harus menjadi sebuah id" #: shared-module/displayio/Group.c msgid "Layer already in a group." -msgstr "" +msgstr "Layer sudah ada dalam grup." #: shared-module/displayio/Group.c msgid "Layer must be a Group or TileGrid subclass." -msgstr "" +msgstr "Layer harus sebuah Grup atau subklas dari TileGrid." #: py/objslice.c msgid "Length must be an int" -msgstr "" +msgstr "Panjang harus berupa int" #: py/objslice.c msgid "Length must be non-negative" -msgstr "" +msgstr "Panjangnya harus non-negatif" #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." -msgstr "" +msgstr "Pin MISO gagal inisialisasi." #: shared-module/bitbangio/SPI.c msgid "MOSI pin init failed." -msgstr "" +msgstr "Pin MOSI gagal inisialisasi." #: shared-module/displayio/Shape.c #, c-format msgid "Maximum x value when mirrored is %d" -msgstr "" +msgstr "Nilai x maksimum ketika dicerminkan adalah %d" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." -msgstr "" +msgstr "Lompatan NLR MicroPython gagal. Kemungkinan kerusakan memori." #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error." -msgstr "" +msgstr "Kesalahan fatal MicroPython." #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" From cceab2af659b42c9762a50c4e1d8b843850eaf74 Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Tue, 7 Jul 2020 04:23:02 +0000 Subject: [PATCH 0251/1293] Translated using Weblate (Spanish) Currently translated at 100.0% (778 of 778 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 218 ++++++++++++++++++++++++++------------------------- 1 file changed, 113 insertions(+), 105 deletions(-) diff --git a/locale/es.po b/locale/es.po index 423d673617..2778c53315 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-02 15:29+0200\n" -"PO-Revision-Date: 2020-06-29 13:13+0000\n" +"PO-Revision-Date: 2020-07-07 15:59+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" @@ -69,7 +69,7 @@ msgstr "" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" -msgstr "" +msgstr "%q fallo: %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -100,7 +100,7 @@ msgstr "%q debe ser una tupla de longitud 2" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q pin invalid" -msgstr "" +msgstr "pin inválido %q" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" @@ -220,7 +220,7 @@ msgstr "'align' requiere 1 argumento" #: py/compile.c msgid "'async for' or 'async with' outside async function" -msgstr "" +msgstr "'async for' o 'async with' fuera de la función async" #: py/compile.c msgid "'await' outside function" @@ -364,6 +364,8 @@ msgstr "Como máximo %d %q se puede especificar (no %d)" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" +"Se intentó asignación del montículo, sin que la VM de MicroPython esté " +"ejecutando." #: main.c msgid "Auto-reload is off.\n" @@ -416,7 +418,7 @@ msgstr "El brillo no se puede ajustar" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "" +msgstr "Búfer + compensado muy pequeños %d %d %d" #: shared-module/usb_hid/Device.c #, c-format @@ -441,7 +443,7 @@ msgstr "La longitud del buffer %d es muy grande. Debe ser menor a %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" -msgstr "" +msgstr "El tamaño del búfer debe ser múltiplo de 512" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -464,7 +466,7 @@ msgstr "Bus pin %d ya está siendo utilizado" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." -msgstr "Byte buffer debe de ser 16 bytes" +msgstr "Búfer Byte debe de ser 16 bytes." #: shared-bindings/nvm/ByteArray.c msgid "Bytes must be between 0 and 255." @@ -480,7 +482,7 @@ msgstr "Llame a super().__ init __() antes de acceder al objeto nativo." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" -msgstr "" +msgstr "No se puede configurar CCCD en la característica local" #: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" @@ -494,11 +496,13 @@ msgstr "No puede ser pull mientras este en modo de salida" #: ports/nrf/common-hal/microcontroller/Processor.c msgid "Cannot get temperature" -msgstr "No se puede obtener la temperatura." +msgstr "No se puede obtener la temperatura" #: shared-bindings/_bleio/Adapter.c msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" +"No se pueden obtener respuestas de exploración para anuncios extendidos y " +"conectables." #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" @@ -568,7 +572,7 @@ msgstr "" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." -msgstr "Clock pin init fallido" +msgstr "Iniciado de pin de reloj fallido." #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" @@ -585,7 +589,7 @@ msgstr "Entrada de columna debe ser digitalio.DigitalInOut" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c msgid "Command must be an int between 0 and 255" -msgstr "Command debe estar entre 0 y 255." +msgstr "Command debe ser un int entre 0 y 255" #: shared-bindings/_bleio/Connection.c msgid "" @@ -609,7 +613,7 @@ msgstr "No se pudo inicializar el GNSS" #: ports/cxd56/common-hal/sdioio/SDCard.c msgid "Could not initialize SDCard" -msgstr "" +msgstr "No se pudo inicializar SDCard" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" @@ -663,7 +667,7 @@ msgstr "No se pudo asignar el segundo buffer" #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." -msgstr "" +msgstr "Choque contra el HardFault_Handler." #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" @@ -768,16 +772,16 @@ msgstr "No se admiten anuncios extendidos con respuesta de escaneo." #: extmod/ulab/code/fft.c msgid "FFT is defined for ndarrays only" -msgstr "" +msgstr "FFT se define solo para ndarrays" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Fallo enviando comando" #: ports/nrf/sd_mutex.c -#, fuzzy, c-format +#, c-format msgid "Failed to acquire mutex, err 0x%04x" -msgstr "No se puede adquirir el mutex, status: 0x%08lX" +msgstr "No se puede adquirir el mutex, error 0x%04x" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" @@ -889,7 +893,7 @@ msgstr "Cifrado insuficiente" #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" -msgstr "" +msgstr "Error interno de definición" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format @@ -898,7 +902,7 @@ msgstr "Error interno #%d" #: shared-bindings/sdioio/SDCard.c msgid "Invalid %q" -msgstr "" +msgstr "%q inválido" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1033,7 +1037,7 @@ msgstr "Modo de ejecución inválido." #: shared-module/_bleio/Attribute.c msgid "Invalid security_mode" -msgstr "" +msgstr "Modo de seguridad no válido" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice" @@ -1090,7 +1094,7 @@ msgstr "Valor máximo de x cuando se refleja es %d" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." -msgstr "" +msgstr "MicroPython NLR jump falló. Probable corrupción de la memoria." #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error." @@ -1115,7 +1119,7 @@ msgstr "Debe proporcionar un pin MISO o MOSI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" -msgstr "" +msgstr "Debe usar un múltiplo de 6 pines rgb, no %d" #: py/parse.c msgid "Name too long" @@ -1123,7 +1127,7 @@ msgstr "Nombre muy largo" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" -msgstr "" +msgstr "No hay CCCD para esta característica" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c @@ -1214,7 +1218,7 @@ msgstr "No hay temporizador disponible" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." -msgstr "" +msgstr "fallo de aserción de dispositivo Nordic Soft." #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -1255,6 +1259,8 @@ msgid "" "Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " "%d bpp given" msgstr "" +"Solo se admiten BMP monocromáticos, indexados de 4 bpp u 8 bpp y 16 bpp o " +"más: %d bpp proporcionados" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." @@ -1325,7 +1331,7 @@ msgstr "Pop de un buffer Ps2 vacio" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" -msgstr "" +msgstr "El búfer de prefijo debe estar en el montículo" #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." @@ -1412,7 +1418,7 @@ msgstr "Ejecutando en modo seguro! No se esta ejecutando el código guardado.\n" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" -msgstr "" +msgstr "Sin capacidad para formato CSD para tarjeta SD" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c @@ -1484,7 +1490,7 @@ msgstr "Suministre al menos un pin UART" #: shared-bindings/gnss/GNSS.c msgid "System entry must be gnss.SatelliteSystem" -msgstr "" +msgstr "La entrada del sistema debe ser gnss.SatelliteSystem" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" @@ -1495,6 +1501,8 @@ msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Please increase the stack size if you know how, or if not:" msgstr "" +"El montículo de CircuitPython se dañó porque la pila era demasiado pequeña.\n" +"Aumente el tamaño de la pila si sabe cómo, o si no:" #: supervisor/shared/safe_mode.c msgid "" @@ -1654,7 +1662,7 @@ msgstr "Tipo de uuid nrfx inesperado" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" -msgstr "" +msgstr "Error de gatt desconocido: 0x%04x" #: supervisor/shared/safe_mode.c msgid "Unknown reason." @@ -1729,22 +1737,25 @@ msgstr "ADVERTENCIA: El nombre de archivo de tu código tiene dos extensiones\n" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" +"WatchDogTimer no se puede desinicializar luego de definirse en modo RESET" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer is not currently running" -msgstr "" +msgstr "WatchDogTimer no se está ejecutando en este momento" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" 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 "" +msgstr "WatchDogTimer.timeout debe ser mayor a 0" #: supervisor/shared/safe_mode.c msgid "Watchdog timer expired." -msgstr "" +msgstr "Temporizador de perro guardián expirado." #: py/builtinhelp.c #, c-format @@ -1764,7 +1775,7 @@ msgstr "" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" -msgstr "" +msgstr "Escrituras no admitidas en la característica" #: supervisor/shared/safe_mode.c msgid "You are in safe mode: something unanticipated happened.\n" @@ -2056,7 +2067,7 @@ msgstr "" #: shared-module/sdcardio/SDCard.c msgid "can't set 512 block size" -msgstr "" +msgstr "no se puede definir un tamaño de bloque de 512" #: py/objnamedtuple.c msgid "can't set attribute" @@ -2110,7 +2121,7 @@ msgstr "no se puede reformar el arreglo (forma de entrada/salida incompatible)" #: py/emitnative.c msgid "casting" -msgstr "" +msgstr "convirtiendo tipo" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" @@ -2170,27 +2181,27 @@ msgstr "conversión a objeto" #: extmod/ulab/code/filter.c msgid "convolve arguments must be linear arrays" -msgstr "" +msgstr "los argumentos para convolve deben ser arreglos lineares" #: extmod/ulab/code/filter.c msgid "convolve arguments must be ndarrays" -msgstr "" +msgstr "los argumentos para convolve deben ser ndarrays" #: extmod/ulab/code/filter.c msgid "convolve arguments must not be empty" -msgstr "" +msgstr "los argumentos para convolve no deben estar vacíos" #: extmod/ulab/code/ndarray.c msgid "could not broadast input array from shape" -msgstr "" +msgstr "no se pudo anunciar la matriz de entrada desde la forma" #: extmod/ulab/code/poly.c msgid "could not invert Vandermonde matrix" -msgstr "" +msgstr "no se pudo invertir la matriz de Vandermonde" #: shared-module/sdcardio/SDCard.c msgid "couldn't determine SD card version" -msgstr "" +msgstr "no se pudo determinar la versión de la tarjeta SD" #: extmod/ulab/code/approx.c msgid "data must be iterable" @@ -2202,7 +2213,7 @@ msgstr "los datos deben ser de igual tamaño" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" -msgstr "" +msgstr "ddof debe ser menor que la longitud del conjunto de datos" #: py/parsenum.c msgid "decimal numbers not supported" @@ -2233,7 +2244,7 @@ msgstr "la secuencia de actualizacion del dict tiene una longitud incorrecta" #: extmod/ulab/code/numerical.c msgid "diff argument must be an ndarray" -msgstr "" +msgstr "El argumento diff debe ser un ndarray" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c @@ -2307,23 +2318,23 @@ msgstr "argumento posicional adicional dado" #: py/parse.c msgid "f-string expression part cannot include a '#'" -msgstr "" +msgstr "La parte de expresión f-string no puede incluir un '#'" #: py/parse.c msgid "f-string expression part cannot include a backslash" -msgstr "" +msgstr "La parte de expresión f-string no puede incluir una barra invertida" #: py/parse.c msgid "f-string: empty expression not allowed" -msgstr "" +msgstr "cadena-f: expresión vacía no permitida" #: py/parse.c msgid "f-string: expecting '}'" -msgstr "" +msgstr "f-string: esperando '}'" #: py/parse.c msgid "f-string: single '}' is not allowed" -msgstr "" +msgstr "cadena-f: solo '}' no está permitido" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c @@ -2356,11 +2367,11 @@ msgstr "primer argumento para super() debe ser de tipo" #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" -msgstr "" +msgstr "el orden de aplanamiento debe ser 'C' o 'F'" #: extmod/ulab/code/numerical.c msgid "flip argument must be an ndarray" -msgstr "" +msgstr "el argumento invertido debe ser un ndarray" #: py/objint.c msgid "float too big" @@ -2393,7 +2404,7 @@ msgstr "la función tiene múltiples valores para el argumento '%q'" #: extmod/ulab/code/approx.c msgid "function has the same sign at the ends of interval" -msgstr "" +msgstr "la función tiene el mismo signo a extremos del intervalo" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" @@ -2531,7 +2542,7 @@ msgstr "Entero requerido" #: extmod/ulab/code/approx.c msgid "interp is defined for 1D arrays of equal length" -msgstr "" +msgstr "interp está definido para arreglos de 1D del mismo tamaño" #: shared-bindings/_bleio/Adapter.c #, c-format @@ -2656,7 +2667,7 @@ msgstr "long int no soportado en esta compilación" #: py/parse.c msgid "malformed f-string" -msgstr "" +msgstr "cadena-f mal formada" #: shared-bindings/_stage/Layer.c msgid "map buffer too small" @@ -2668,17 +2679,17 @@ msgstr "error de dominio matemático" #: extmod/ulab/code/linalg.c msgid "matrix dimensions do not match" -msgstr "" +msgstr "las dimensiones de la matriz no coinciden" #: extmod/ulab/code/linalg.c msgid "matrix is not positive definite" -msgstr "" +msgstr "matrix no es definida positiva" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format msgid "max_length must be 0-%d when fixed_length is %s" -msgstr "" +msgstr "max_length debe ser 0-%d cuando fixed_length es %s" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -2699,7 +2710,7 @@ msgstr "módulo no encontrado" #: extmod/ulab/code/poly.c msgid "more degrees of freedom than data points" -msgstr "" +msgstr "más grados de libertad que los puntos de datos" #: py/compile.c msgid "multiple *x in assignment" @@ -2723,7 +2734,7 @@ msgstr "debe utilizar argumento de palabra clave para la función clave" #: extmod/ulab/code/numerical.c msgid "n must be between 0, and 9" -msgstr "" +msgstr "n debe estar entre 0 y 9" #: py/runtime.c msgid "name '%q' is not defined" @@ -2756,7 +2767,7 @@ msgstr "cuenta de corrimientos negativo" #: shared-module/sdcardio/SDCard.c msgid "no SD card" -msgstr "" +msgstr "no hay tarjeta SD" #: py/vm.c msgid "no active exception to reraise" @@ -2777,11 +2788,11 @@ msgstr "ningún módulo se llama '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c msgid "no reset pin available" -msgstr "" +msgstr "no hay pin de reinicio disponible" #: shared-module/sdcardio/SDCard.c msgid "no response from SD card" -msgstr "" +msgstr "no hay respuesta de la tarjeta SD" #: py/runtime.c msgid "no such attribute" @@ -2789,7 +2800,7 @@ msgstr "no hay tal atributo" #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" -msgstr "" +msgstr "no UUID encontrado en service_uuids_whitelist" #: py/compile.c msgid "non-default argument follows default argument" @@ -2824,11 +2835,11 @@ msgstr "no suficientes argumentos para format string" #: extmod/ulab/code/poly.c msgid "number of arguments must be 2, or 3" -msgstr "" +msgstr "el número de argumentos debe ser 2 o 3" #: extmod/ulab/code/create.c msgid "number of points must be at least 2" -msgstr "" +msgstr "el número de puntos debe ser al menos 2" #: py/obj.c #, c-format @@ -2881,17 +2892,16 @@ msgid "odd-length string" msgstr "string de longitud impar" #: py/objstr.c py/objstrunicode.c -#, fuzzy msgid "offset out of bounds" -msgstr "address fuera de límites" +msgstr "offset fuera de límites" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" -msgstr "" +msgstr "solo se admite bit_depth=16" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" -msgstr "" +msgstr "solo se admite sample_rate=16000" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c #: shared-bindings/nvm/ByteArray.c @@ -2901,15 +2911,15 @@ msgstr "solo se admiten segmentos con step=1 (alias None)" #: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c #: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" -msgstr "" +msgstr "los operandos no se pueden transmitir juntos" #: extmod/ulab/code/numerical.c msgid "operation is not implemented on ndarrays" -msgstr "" +msgstr "la operación no está implementada para ndarrays" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" -msgstr "" +msgstr "la operación no es compatible para un tipo dado" #: py/modbuiltins.c msgid "ord expects a character" @@ -2958,7 +2968,7 @@ msgstr "pixel_shader debe ser displayio.Palette o displayio.ColorConverter" #: shared-module/vectorio/Polygon.c msgid "polygon can only be registered in one parent" -msgstr "" +msgstr "el polígono solo se puede registrar en uno de los padres" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -2993,11 +3003,11 @@ msgstr "desbordamiento de cola(queue)" #: py/parse.c msgid "raw f-strings are not implemented" -msgstr "" +msgstr "no está implementado cadenas-f sin procesar" #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" -msgstr "" +msgstr "las partes reales e imaginarias deben ser de igual longitud" #: py/builtinimport.c msgid "relative import" @@ -3019,16 +3029,16 @@ msgstr "retorno esperado '%q' pero se obtuvo '%q'" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" -msgstr "" +msgstr "rgb_pins[%d] duplica otra asignación de pin" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "" +msgstr "rgb_pins[%d] no está en el mismo puerto que el reloj" #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" -msgstr "" +msgstr "el lado derecho debe ser un ndarray o escalar" #: py/objstr.c msgid "rsplit(None,n)" @@ -3048,7 +3058,7 @@ msgstr "frecuencia de muestreo fuera de rango" #: py/modmicropython.c msgid "schedule stack full" -msgstr "" +msgstr "pila de horario llena" #: lib/utils/pyexec.c py/builtinimport.c msgid "script compilation not supported" @@ -3056,7 +3066,7 @@ msgstr "script de compilación no soportado" #: extmod/ulab/code/ndarray.c msgid "shape must be a 2-tuple" -msgstr "" +msgstr "la forma debe ser una tupla de 2" #: py/objstr.c msgid "sign not allowed in string format specifier" @@ -3072,7 +3082,7 @@ msgstr "un solo '}' encontrado en format string" #: extmod/ulab/code/linalg.c msgid "size is defined for ndarrays only" -msgstr "" +msgstr "el tamaño se define solo para ndarrays" #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" @@ -3080,7 +3090,7 @@ msgstr "la longitud de sleep no puede ser negativa" #: extmod/ulab/code/ndarray.c msgid "slice step can't be zero" -msgstr "" +msgstr "el tamaño de la división no puede ser cero" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" @@ -3096,28 +3106,27 @@ msgstr "reinicio suave\n" #: extmod/ulab/code/numerical.c msgid "sort argument must be an ndarray" -msgstr "" +msgstr "argumento de ordenado debe ser un ndarray" #: extmod/ulab/code/filter.c msgid "sos array must be of shape (n_section, 6)" -msgstr "" +msgstr "el arreglo sos debe de forma (n_section, 6)" #: extmod/ulab/code/filter.c msgid "sos[:, 3] should be all ones" -msgstr "" +msgstr "sos[:, 3] deberían ser todos unos" #: extmod/ulab/code/filter.c msgid "sosfilt requires iterable arguments" -msgstr "" +msgstr "sosfilt requiere argumentos iterables" #: py/objstr.c msgid "start/end indices" msgstr "índices inicio/final" #: shared-bindings/displayio/Shape.c -#, fuzzy msgid "start_x should be an int" -msgstr "y deberia ser un int" +msgstr "start_x deberia ser un int" #: shared-bindings/random/__init__.c msgid "step must be non-zero" @@ -3187,10 +3196,11 @@ msgstr "time.struct_time() toma un sequencio 9" #: ports/nrf/common-hal/watchdog/WatchDogTimer.c 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 "" +msgstr "el tiempo de espera debe ser 0.0-100.0 segundos" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" @@ -3198,11 +3208,11 @@ msgstr "tiempo muerto debe ser >= 0.0" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" -msgstr "" +msgstr "tiempo de espera agotado esperando por tarjeta v1" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v2 card" -msgstr "" +msgstr "tiempo de espera agotado esperando a tarjeta v2" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" @@ -3214,7 +3224,7 @@ msgstr "demasiados argumentos provistos con el formato dado" #: extmod/ulab/code/ndarray.c msgid "too many indices" -msgstr "" +msgstr "demasiados índices" #: py/runtime.c #, c-format @@ -3343,31 +3353,31 @@ msgstr "tipos no soportados para %q: '%s', '%s'" #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" -msgstr "" +msgstr "el valor debe caber en %d byte(s)" #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" -msgstr "" +msgstr "value_count debe ser > 0" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" -msgstr "" +msgstr "el tiempo de espera del perro guardián debe ser mayor a 0" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" -msgstr "" +msgstr "la ventana debe ser <= intervalo" #: extmod/ulab/code/linalg.c msgid "wrong argument type" -msgstr "" +msgstr "tipo de argumento incorrecto" #: extmod/ulab/code/ndarray.c msgid "wrong index type" -msgstr "" +msgstr "tipo de índice incorrecto" #: extmod/ulab/code/vectorise.c msgid "wrong input type" -msgstr "" +msgstr "tipo de entrada incorrecta" #: py/objstr.c msgid "wrong number of arguments" @@ -3379,25 +3389,23 @@ msgstr "numero erroneo de valores a descomprimir" #: extmod/ulab/code/ndarray.c msgid "wrong operand type" -msgstr "" +msgstr "tipo de operando incorrecto" #: extmod/ulab/code/vectorise.c msgid "wrong output type" -msgstr "" +msgstr "tipo de salida incorrecta" #: shared-module/displayio/Shape.c -#, fuzzy msgid "x value out of bounds" -msgstr "address fuera de límites" +msgstr "valor x fuera de límites" #: shared-bindings/displayio/Shape.c msgid "y should be an int" msgstr "y deberia ser un int" #: shared-module/displayio/Shape.c -#, fuzzy msgid "y value out of bounds" -msgstr "address fuera de límites" +msgstr "valor y fuera de límites" #: py/objrange.c msgid "zero step" @@ -3405,15 +3413,15 @@ msgstr "paso cero" #: extmod/ulab/code/filter.c msgid "zi must be an ndarray" -msgstr "" +msgstr "zi debe ser un ndarray" #: extmod/ulab/code/filter.c msgid "zi must be of float type" -msgstr "" +msgstr "zi debe ser de tipo flotante" #: extmod/ulab/code/filter.c msgid "zi must be of shape (n_section, 2)" -msgstr "" +msgstr "zi debe ser una forma (n_section,2)" #~ msgid "AP required" #~ msgstr "AP requerido" From b5af05cd31988cb89435b724fa8d684ce95d0f34 Mon Sep 17 00:00:00 2001 From: Arudinne Date: Tue, 7 Jul 2020 12:27:23 -0500 Subject: [PATCH 0252/1293] new file: ports/nrf/boards/raytac_mdbt50q-db-40/board.c new file: ports/nrf/boards/raytac_mdbt50q-db-40/bootloader/6.0.0/pca10056_bootloader_6.0.0_s140.zip new file: ports/nrf/boards/raytac_mdbt50q-db-40/mpconfigboard.h new file: ports/nrf/boards/raytac_mdbt50q-db-40/mpconfigboard.mk new file: ports/nrf/boards/raytac_mdbt50q-db-40/pins.c --- ports/nrf/boards/raytac_mdbt50q-db-40/board.c | 38 +++++++++ .../6.0.0/pca10056_bootloader_6.0.0_s140.zip | Bin 0 -> 174550 bytes .../raytac_mdbt50q-db-40/mpconfigboard.h | 30 +++++++ .../raytac_mdbt50q-db-40/mpconfigboard.mk | 8 ++ ports/nrf/boards/raytac_mdbt50q-db-40/pins.c | 80 ++++++++++++++++++ 5 files changed, 156 insertions(+) create mode 100644 ports/nrf/boards/raytac_mdbt50q-db-40/board.c create mode 100644 ports/nrf/boards/raytac_mdbt50q-db-40/bootloader/6.0.0/pca10056_bootloader_6.0.0_s140.zip create mode 100644 ports/nrf/boards/raytac_mdbt50q-db-40/mpconfigboard.h create mode 100644 ports/nrf/boards/raytac_mdbt50q-db-40/mpconfigboard.mk create mode 100644 ports/nrf/boards/raytac_mdbt50q-db-40/pins.c diff --git a/ports/nrf/boards/raytac_mdbt50q-db-40/board.c b/ports/nrf/boards/raytac_mdbt50q-db-40/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/nrf/boards/raytac_mdbt50q-db-40/board.c @@ -0,0 +1,38 @@ +/* + * 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 "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/nrf/boards/raytac_mdbt50q-db-40/bootloader/6.0.0/pca10056_bootloader_6.0.0_s140.zip b/ports/nrf/boards/raytac_mdbt50q-db-40/bootloader/6.0.0/pca10056_bootloader_6.0.0_s140.zip new file mode 100644 index 0000000000000000000000000000000000000000..691f4a1ab3cce19e13c954eb71a4d1feff592c27 GIT binary patch literal 174550 zcmb5X3w#vS**|_}c6N7mvq>fwAV4m&2}vdqWP>+UYBvEV31W%2s;%$q##*~*TNm)M z++>4@8!TW08Cqq7v~@zjOs@O?KC=m6e|_KI z=Z~MwoSAdZbDnd~bDs0u&avSdn~=-s-<8hKmOS}!z@LFM{apC1yz}-uzI)-FjrU#8 zUfGqzKaPzj-M?@6QlS`2gvo5f05nRJD+FT8)`$n{QTpKpKNzO+E7wy294 zUop1;ucDqpL&)^(`+Pu*d_LfcaEm3>z5hbSHY~H%H#IIbI3_J3cxSR0<6bR%m33ts zjY;lRZrdi6+skzn_Aq9=>R0R4>(y_nnXmG#oR8~r)UjH&kK4OR&Dsi9#8~rnZj!ePjSqn%fEMj?TNk&<~SK)t!E+)vx+n`@_j|^sFeeu9!{n< zMaJZO{C+2$x-yvJ_>dWyjP>hs#LO)KrdEpO63(_ERwLPYKZju-uLH(`>Hyais-1IU zaG{_+-mz8n2XlsmcOc9R8{-vDL+^AZ_kYc|qE5{*+(UUWNuJWt(`P(f zuW~YHA=|%k(o=EVV1D!?&G!b?_sslA ziE-`dvt~XMcgn!spD!B*lYCq7MGkK<3s__LS+kHe4%9F|XlD!3&zg+6+x-TQH%vnF zF4M<$ne#${X6Gxr%!^stQ-PrLi;Ncc6G61khMCe9?=fZOix3tyUvM&EKv1bo2aBN1 z6l5Mb1nXj!(}w!(R9_!rO4O6OpFMVuS#46$`jE( z#sIVORa3;QT-D>XW@PC&Q_Q#=-DL_afWHpbioYV$@z>2Bs^eb1Ta84S*J0d0)?+eB ztT?9GP`ikzS>{^^uE^dqJsQEzG9|zkIzVf6{LZH6(l3%Bhw(IK{WS0qQJX{UemnLVx<+N#jLrl?G zbQ$L08z}k5IL4+yj$WzqJ81;pAEhy9ulX%-8t+-#Wyc7z7Oq9aSTp8P6_tB3+t{7V z>z0AXR;yQQd#1$D6V?!$iQaJ&z3T_cG=gh;Jo4HeU)PU2Xg1PS){^Vx+DeQ)!}(qj z&sT>D)AvkK`!bag_8d#m7>BeB>Y`O5Gfv)Os*Klx56|S9F9giRB9_(0wGfRguxR8e zi$?qwjntqv&m3P`A3P(f@UUH`#4_9LEnK_U<}eyerr1CQc}xLS=5+Xoe|NDp_U8)K zTs2+g6s9GQdSqYZ3VD8n%@#FfwM}to%9>QpG&#^@^t3gPB<7qjYBzP{s#{G@OUBdb zYIi@EnWjlzw&udkQPr+EHHUH$U^$5MJj#1dCHk5@UUt&YIQ;S=7s(Rff3Ed42bx&< z44wTX7!~_@8@F@WGG=T{I!=mMY0i_i+@?<9WHk>8Wi3tV{SMBrX3Ud}`;zPP_jLxE z_tYFa^83WafY#ScIAm$r-nxYuzC1whwV>BoxG{~F<&~^Fyu{UAp9n=)0(J^UzLDeY4W5sLK$kb zqs8>}{>1b|F57&j*&|Ea`F@W8&g$OVZ_5<5z5PPwRru@7T!+yTJHC^!pM1o_PA`~LycXwKExv&k?Gr6trk~%^ zp7CeV293$Fh<8*FXv6|lRvhe!xIAO#CBi71vr+z+G2M(@EwDt3BW2b#YG+2Lz=VvDCy`&@!B`E3NBfxZU(Sqt#W!EQ>F$*)S2C}Pz2eE_;HvSSKJ!QNnysn`8N+6+hRY&8*{!pE z?WQ~Od4lqUiSJdi5}~o}kN@pU-{;AvtapB*+(q(dc%P=G-Y=G4M31rl=Dw@F1ekAI zc`2BeoXvY(^Q)Abty4`quyI(>B&^L#(Jq_YuIbI;rkBi&NVl26_B8FV+H_8|d70di zsMMDl*`TAP#(XvnE57Ayjh9R*LgV6A>{^=Q(mYB!s4oHtZmT|r9?NUeth68tNPDcb zU7o-4dx_-HdlDp_*;URc9hGA&T&xHOMLE>7@D$HNJ$A36W&sP9$qLcChjdD*u#oTMOjIY@gex8}b*(hRxyJ zrgS^o8z6JNiJk1mIE}kqb8h3-On<{(DgB{=JF3Vckb@w3Nnn^aY1!Pc-{F^p;Wxs6O*G-%r>V&o2>($ms+CuyfvS1ac;W;c)g4D)&|B`NO($aHt zvvcI!<4n#zo+V4iMLFa6!c#VucHAkuj;G7c<2KoTyaz3nsPCO%p-Qyn+|Gfr( z=7@3Uw%wi8Yy83G3pZPMC&#GQf6|=Wo4|Dsf#%1TZdGSQ^VQ92L>-RtFV_Rt{~EHh z>7bq$^UI@|#`ESp)mc`dUa7L5WEdTza@1<8VX=Ch>W6%Ebd zsUu(A852sjn9P?$a)|GGl0)Rp*n=}<7t$VymE5g*F&Cvt2jmP1^+H|gs@n{Gs?eX!NS=2aO?$997p4P8R^~K59~M+4EGc1Y9X@#F#Wz${Wmi>IiTG7jDXUmf zZzsvIk|M=(-$)+4L>Ib~N9|tlePeK(t)cx$P|`G~qF|n#WjE={s)$ub)*518B$QQt z>uow9Ow<0EpxQYW3}qFkWW=X=FVj=dv~j0}tFu2FeA{if&DpU^^vjQ)y)<5-=b%mA zXdjz(9tN+CgBPQJkT1|bmoc2gJMd_aPOIP!PAg`*TP0axLk<4{r}Da8pH}hqAsXo` zMm4M)A9Nh^VT-2u=`ntUGgtx1>k{;=oG!MlF2-gB(bMNf*=#;OxR`Cv3gq{2vzUC^ z+EF}^pk{exwb+P`+tIVOaA2hpJ!-!CGYcm7O1N455bb9eKOIeBN}R7O0G<!pgb~N7>;jv%%=)r<)GlWjzZnx$dcHR%&)^h3PGxIH>oK~J2mt*X z`$CYuh-N(FDVjmcoMP#KE@Kh3y>x2_uup@8-T~RTqc%!B=W*1Tj}hu0OZ9J7?4`&H zrlaEpQ|zb+yNc7~&XZY1>*AHGg?@>f56-+K@`gDStVVer&R(6KH8aWHW*JAf;W* zlr`=aqWjDiHv6R3h&Cm(S*oYnShmcz)BOxHhKAkS2#dN!1X=9&@Irg$Hp%$sa9#{} zbpWdla1)8s-`D@36D~c#c76Ui9R7IZcY1mo>NA8S%JvzC*ng`PgWK&U%m zH?=oq11AesXvuEE>IGB6+-G!b1W&w8mvvsR(l6I*P(HPPDVx!5DBJ4K#+ZN>sTQ?b zvDv#Jh?XzdO!#K=Bze{jUxAvb-R@jV3wGO4?*-FswL~qJ|I0YuHeC2GUtSxTqF=0E ziLpub{J!0w(iWo9jez6S!P9gJ>R`ocu3{R-oMgD2Sh?SYu5qy?%|RQ4GeP>UTyqn!CAPuv1O}wtT>vWx}TFAwD9ZEOz_$%SSLQLlm8e^t*-2g*%Mc) z)tL3WgDxX8`TD1mJbTGRiE}*LWo(CyCdJXe@^5ng8@Z{qd*MW`&@bA&(4L6n3&pWd zCi4p?@+q$*NV)dn=aK8MR(|H$+Qdt*AG3IvJxk{bSkzX$Fwbkz=ws01(zL*umpg+C zH*^Mqw1>Yk90*oNS;dKX2)JZ`FF1@hC-xprmRH=h;@c7VJbAJgP%wr8K6W!;)3OR?hPOVKy8XohODb zLys=O=xpk6s2uDA1cAn!Q)vWgv^NY3OpFshwj2L7%CKtf#-34Gbzlz6u6(TI4At>m zhOu*`L`@d#?W|HORrW->@nq73T%DzUe1fl85VKX-G*;rV^ zIXHKOR-oNjH=0_boY!t_+Pl=yiev2=z!7q!#P@mZ6X9 zIB#{JDezIfJIE?WUp@M=i`|s@Biz7FjuUSwAP7f~-XZUQ=P|5l9>T0C*QaQ^%E%r1Y4do!rRnH~lx2 z#qbxSAzWnBdrk48)Z3zqLOtM|)kKff^NWG!<+N}08BNWFtk`R;ua-c~e@Jq(XK76S z!Phn~L*aPpFtcFHdGiBi&Q?OC`RdaQ{ z?sOH2fr~?bNO1B83GM<=U@<4#b*^{>Zvx(U+6SwjN^r$PiF@i;kZ7G5@0j0#XW@O& z0xRPbSNwg9M6b<$n8xw|(x8&Y_dz9`;<54~HW7JjB5zS6Crd`f`1_!t$r666LrKi^-SG2*Rt8ynJwzo`wDSlpmes8BkIRn2=wR__%hlm2ct7uU;j6H3Y+bF9xWe)c)c<7t~)^_jhoDP_0rwyROel zmDO$8@p8K-_ZX5Oy#l;9o@nE59BhLG2YLF z)OfN0&oUQh2h-~}*LdQ2wH~D1*F0V0h;v<8Mz5J1+=6-K{LXq;&~=Mg>!@?q+ZQ{o zvDN{W!mnN*|7{0o9`q@bPn~|L9ouF6d3aKub{oBKNPt&3mK-b_%`*OLgvKz-XxPii zO->p=de-5Y4L;cGWEy!sGp&_3`R1t;edqGTItg!~T1UO7${jpta~yUBIm5;^)o^jk zYl`|F0edgJm0$jk33jO6vk@@x=TBqTQUBXnGWi4aC9>t4Y--KTTX)@l%ibS`=6)k{ zrU-@OUz4M8636;7JiwY5wQe zIu(y)Ard?e5B@RImz0OHUBbLWd7x*@n0Lm< zOXP>Ll|1Z6nR!lpduYs|(sRR@Z^q?$@Z8{C6CtV&_$SnjD@5Pf4j#rIjdi(YHA$S*%pzO*xW0 zT4ueK;JepK6>75}9h50Ev~u*SLYa!3T;!BOZb%-@v{D|VV86vTCsKB#l(VB&iV>E& zIB1l-rSnTY)C-$@LE`Z`!iV@H^V;PsV}~W{WXYE%$j^8;d|MnM9bScY%FC8d(YpcE zvJ3u0Xs&W9Eg&sQO*OXo($jU&heQ@sJ;vQbc0*2D9?359GC9;N<5xqsbf?FDUPC@V zti@TP{&jN}%YuYQe#B7Eo%x@1{-WmeA+jHn)L~bP)E3CWY!(Y<8GpA*U64?M@E1pU zZBGq}<{U(SjH^durUF+h$AJ`q^3WY@NwjdSsPt)~hF5id=DbC=G9& zNZaCOBC;ytqIRX8q%4Lg4xzYyt9hYZ6WeOeh1b=k+3-UPSj(I`v#!*~8ISkayiDi3 z9Lk4k=UX=XWw7FJ8e>X&9DYhk4mS?eBJ(Db%RB%nrY-scJg-ci-!s1}C)^R^m0T^U z%+$mezNgL#vL}|TvY&h+cUJh$fm&Nm$OfB^q%(GeW3r7;awWz%zVgbc_>oQ;LA$=t z7-v#Qf@Tg033AArXd@bZ9&OC;;l1gGV=rOl3KzqgDx%e0mRWU(k{RmuWKW(_6?@8Sj4bBTYYapLL}=9LJsaqDAH34#3$DS_z;(!CH~^}?*bH|6 zVJU2t;#26sEwQJ}x#)*8PI)U$@|0&--c+BHKit|JQND5{ILEr`X~ z?S%FogV+6C&_g~;g2M!Y4JKFgo|!2{pf~5RT>q_&YsvG{IvQrn5gM zh~jo8P#SiRoCbZ3zgu4G>kh1yyIa>v-TK;I2d6pY?Wo0CF%FnB9y&PJ(i-Gjg#Jv% z85fOiflnm8Kb<89pB!hg9Ne;WdC9#VxR6`(i*nIrY1lS$llf%jMlKY z+?~7a7*e*l6cgow4x^{2>>@R9=ZyC3w&dVmtdZ04i`1Drr?%(f{Z+jG9bveLP zTRxs>-CXSy-`}yWD)y`ykeZ!Vl#={mg5G}PbZLI4^L;s*7h80yp)m^1=ahd>qtIY0 z+hTG7t{ik8>M@r9Z=1}uWpDQyXNHJ>8t7dFHn1+t(=7DAG_b`iL&+OavRrnz<)WlM zN%WKY%H(a9{Q+7Zb}q@dHYtOa$hsiHb0dfMJKMoSlNJ0S zn_h%<=aP*?#M$_Ma&YPB{Fof>9oWxtu*lFpZP#<;V~J95npskHtk($**A9wx2-+4i zGhhQ%97LZo5d)JP{O>WEJF7lJ5Aow00%5Tm&p;qdF(4GTKzspTSRfp6+7G9`P#gq( z@t^%7SYHTM1S#8jaWZZuufC-_u)40B(~p4fw62!B_0>|hye36yn-j22f~v$3q9Eb~ zEyH%>2)Myx7*8p%#moYwX5*LJAhe|!zeDbCtXw^Mr{X?X7vr$=C1KCn8b|xUdI~(E zcX~TU`i)bG92s_?5hmXZ%WJZhmy=)H0y{1%5B-qhc=o7R4X!0R*OqQD_~jg0=!b2) zUo_`MkQ=#5xBawrJ?ETrSm>X{Sj+Q2B;UOkp0i7BobmNhJ7(+Jt1GpvISatIuFzZ8 z%ZAA5>uca=ef(|wrW3jG-z zXS5I7SvsIfaaOuMKiSDc7CLSE^Y_&J;)s1tmL^)Q2(0x%o1Qhtk_N!794xfSK1a|L zRp{vXl<;Tr5NOJQS)MfpORyn~q1TXZ?utOp!ODzSUS8QJha9lRK51UX0xK-*uW@QG z_H)FJq{_?T&TG$=51~BlyW#qxnH3j-6LZG+ym|9(8k?6fHdZr=WO#IR1dq|t;h|CX z>nK^zJ{h&ca^^JJO&!s2Z1p2(%L@;5a`4g-pE^GH`(dAIgT`J3>zia;I@X3!lvvw? zkfq^CrXD&vZupe2HrOP-cSQ(NV1?ayX7otn?I=O(7-jIc;XAyDR10{nc65+6&8T%6 z>fRJK&tleS9PGwJqk&+R%9@p?K+xYD#NSAB8>C9fI1Qg`+x>0pnH90OFPQr*kI7A;#{x|qkF_>!G>cnc^Nj2X zvKAA3_-@r^L78t-fA@gnOKcCUqS;K?X}5ANIGf{PCV7RKZKq)66k0hBFZo6}W9!iT z-Jw+xCp(-xx_p(sjwB2H{y&16S{p;ntq)T<56Z0@>We*TN!Nj}U7x2{>b3e;b+3Mj zPBj9d!)6&f0DchMlCA6OWJnN^e1ek=IL77=69LQ}eG7z)AeHlN)+6M@eQY=@;pm{K zQlpkLF6*%yuZ~PHeVHVk*>$_IYvN5{N@(=B0$sqRO;J9HPsN(vJLI6fw$^Su{YI|* zMWP)Ny9*ZR!*RQ@b%Y1^OpSd@H(SM&-)enfenRfyjMu@h*N@obzk??jw(OpHTW6~-UCT`C9m8EZ+4pIR+fVX+D#V7jUg%~au-$^T6u0+kT{q- zJgqXMNgn}LT5e^P=J?27`8~~5nW;&Y55$-^#b z8_mq#q%1#hz|8MBV9NN-!cXbgn#k63j$L`|l4FULZg@#Int2^9h~E7W6n5Z*%Xi>} zGkbla4IVrigGgd_*;1oGWU~h~yZW<8bWLS6vj7oCd?nH_s}59KsR&r&aebE_7}#LF zcjxya?=7VFtY%sM{J?;a%^T|x{}K-G%ty@b@cec5ei!fTpTd!Se*PNHxW-iO3*%X9 z2JbT;YP&DIy6?WH%qy94|DH9$`+sgu?f4K9NL%COt6v9?#om38Qzd=R>fV8BiO0;r z(x@p>*$AMO9UI-Mvp=6}TeeM4ee?SU5?SbrjJ|Bueui-u`rSOU#-6PStXLL&te|cc zc@(Z4P9Aroq!%SmX#YA#Pn$l;YY5z9dK$_Uqs*VQcddDxfVG+#$CH5-oPIq#puwOY z?|(_Qt~h)=ALYwXexKF4AM+gqe`{Sqvv6((?3e*tHgZ-ifPT18p@_8qK3=|}>$rsa zvrzxJb2v4DMpg&#mo>Lix>;}9VU;UExyL5T^+si@1eNojEtl#C&z0*wz%51jDDYYq zREq0^vax1t-SNfhgSxUhrKOT@^gau65lTLy1<~WSW*MI50Q|;id$Zn@g2-{3F+%@& zJVounD5AWRHy^h+^zEFnf3LFIsa$Kx_eXPlaS8WFmPr@rZeysvcoYN?xD$RIe zNI=|$!1#FZAqFc4Y3Gu0a7b1|(0vA=wdX)n6%k>Z(u0DCWLY*Y7~jF}b{bv{D*eV# zmOMUqJ)+g~VfEyo`P-G!iHNdL&z4Tw-~2<9JF-_ft=Wy4L%|pq_8OU7bH3LwIH`&Y z@m_Al)!<64_bd9Obt}3d!dS$zigw^00!Wd=SL( z{{sDw%G$8M+KnFb2}r-{Ldi_={uk9K+!^Wh8ks3N}HFod|}uQ=wA{l{+D zW?r_S#)qh5%z%c7?=0xEt@&xjLzvNR zPh(V$-VKTM$}z!Mj~YeL1^ZxuLCkezy55SIe~y!*X-4B%hAsy=V+^ubI_y38&fLab zLpGftq#3QFf^qw}k#Lrh#!SBX6u#aGYl}R`sd?w5YsGWYw9+{)cvwR{a&$+&+qfK7 zE_n0}|F0bQb~CI9p<1!)V((3LGNO4nP*vtQ(blZ-hWemdRwckI`L#M&5@g9NExKc% zmh)O;&b-wtmY!~0-fB7}-rKZdeDEeqvl|`!QIbRaoCvFwNA*Kuk&U4dl5}m5L1kGE z5w&eJOBn3+(4R-EofzlmtQhy6zR{+OzUJsJ<^BlifwjD5RzQju8h&D4;NN08{PQ9G zZ2{$d79SrhgoJfmW7}0=)fIVlxeog~Sq)pQNPMZsTPN2St7PLVtMZHEgHh{b$2ejj z1cn{gnXQS%KNc9`da+cDrImGRd{z5vo9eRq(IAoP1DgBk2qlW;i zfdMK>&zn1@AU;xHg<7U67FPg^>wy_$`m!87g%|9*kX_*&h}Xt$2Bz>vSr!DhWkE<` zd*To)`*}Yn&eR?KoZD?Aov=7r{o>Xx7J-?Rwzl)+4Vm`1qd3c#RV5ou!?(mz_?$e1 z@(%UtV}JgdItv<-O<#D*F8?9HWS7yFl)7C;w>1ue{C46tj6iz-G_e%8m1E2Zw`)gf z6zE+lZZNZ8UEnP1f}K&j>HSVb#y>Fpli1hsCKdZZ755I)m=vEkCVx6KKFBanPhdTB z#>&xu!Up>YqVO|~A0d7}5X>}=00&97BhEb#U3_X!R-$!8086SLkJP-}U+8&8?QuGbwFgXTY+0G6p{PHlYgN>oj zEvn2kZc5@rPjG%L)A+u10zvAbcKFfX*ZIuZMU9dD;l@xTOlv~|J(vq~K@AS{`|@OK zcO9O$B_lY$kZIhK40P|iwhf$;#TUe?!bw=%>p`7}P(u_V#cgufX9Rf=(jOCF*lmaI zAt;&JGMvR4AG`-N^;ukA2MrkV4UeAB~v+Y=M zsP%_OM+tpo6C`0KznECtwFREt47C;WgfiCtNGCI>H*0&Gvd7pqBz3ojDL!<3@YIMB zqqLy8^lY5Z$e}YD*o}V&J$@*DJd~QPNvnj6H3u8rI&clkLhx&F=yzZP_#{p+?Aq#?t(Q*09IsCI=2&ZUci^gl0nq)Q^0%{Fh2)O zy9JX6%n)GaTQHv+wgDz_xCnY_D-|(+VT|QnaX;o_IrM7*zJgSwbBLEUp_fLayxo=?e((Yme*9)C{DiaGTxx$)DWIy!h17OW5A z%Mg+2FxpYCFV2D2eu}afw|Euos6NZKb>Z#|y)4$c-tR1YpIP=}s?mWOnCJW1g}>LT z0D~E8hV5#W@^-v+eYNw=_p5@7%#5Pt!NvetLFM~c>7GPZ>1&9FDTa(gk(}d$jxpGT zwPHl3&@MAR$W26$lZV0?&${NBFn0k1&NRwWkIQ&%jJy?sG4wiD!VKwkRx(4Kj+WD2 zCtC#VX_>~>vAk{>Yk&6`SxiGc#8bbxw(_B@NN(rL7GmU~V1^tscrhbaD zp}qvgzxzee(nVl3Mmf91$^HQz!w0BMKIB(ZdyUQFwN8s$jSv29L`1~f2MGnMU@8mZ zFLWLJEoOcAtH45gVE{3d0g^0l9`5U=eqW23CR+bh!Xc*_e@;%=34vjXhYDDA9f>Dl zl~!WogBJ{A%^u8=UxF3<=LwREoj4!Y8h^x`-bzr5AfIGnWjU|_JX?vqNr_rZb-#ePuO(VW%l>A4w1jTXtuC{)M)*7qy+8zb8&^vPOB*R*Z4%hYstu+8I(BUkse9VE!#{>AwfeWrB z-$VnQdn8LG*(B-AoPf3NHf}$m2CW*aD8kuzu~3)g2w3I0?YB;RNCQ z$f(@CC`NSipoP!p*hS?)Yoy+4Jz}-~X~Nd-!_G4Zs%HBHBRup`0__KS%v{V5kBH-` zcv9rCgkQEq)<=poTNkT{x?*^fmRV0;YPX)Ebi#TH(npXd9q`$4ABZ#L2)ug|!A!kV z{HX|d+OrK_+Y#VD~;^=J$BI=01NA zYaEzovsLheootZc1M1rz);>|vaf%|c9jrm<|8IK2&c5spP& zcSE1pnk3i-BZ9HhO!+!J%%P@ZFZwZTuB4T`7*U|ND$rYl(1qKeF~9Pu)I~hZrf{3>`{C1d)W(%YfeH$KGql-b*_kMU-HVg};yW2>8KA>97knp0mz1XBxR! z$KVJ=rvtnsD9$5+uu~BZ?FdU1+!4&$K__zcaJAF%zIWAPr|o_0$nT4wFK8fEPbB#G zZWA9~f9JqEIS)UW6aK0A7Shc2)`L>`EmvLmTLaasE|e3_ccqcXFDDJ@Kf`;*@U60jUjE>Jy~iLdv!(3-B11g%o+_@tZV>?u_tyyj9 z^9kfd&V_Zj$moMM|66EMd*DB_Y2-z-#dG!fu<&PTw150~xc3dpbH?RhwoeJj!CYSu zf7=4yAk~`>f5j~L?J|v@4(Gi=^}UGW`Th_W{Iwa(YKp#Sem5(!YLoeWSl#)tp{1V( z?g-uy`w2{}j#JCB{Gv1uI?#|*e7PD378z{Jvh_Xcfc_`P`T_w!xsyAM-Esg@tz8wv z9>~BGXRe`(dm;M;LQg_3^2JDEBgxG{zFGKNIB)EvR3sdH61FPx3k2Zv_gdC%UZnHXn$p1#C zt<#O-VUl7wISZaL$%_7UZ>RP4RxB_09(d9%_)A>KElb6=wj$$)kc!>L++mwB9de&7 zzGHp0A;B6gb`bSZjpNu~&7}@CvKgm^IyZo8o-qa07d~pfuz|r|YIn8u%VMSyvTO|Z zp1Mq&zwQU`_8XrM+&(bCENKWHQy1hl#G^p(Y`_liG2|3moYOh^4D2i0%-i6L4=Z=c{D1Bpp!q6VFB0@p_o4===d z3)h#9(Om9#2#1}h{gsQq8~7mM$N6SCbU2}}XO>mnx3)71UEjuaG?0~hsS8oPW!eC z9fYIRPOe!9t2wou*zi(gqH(_~fH;9_#4y9^$~A_3tM$<4vpxFq_!OW|=f;Qk3jL2@ z#J7(L=#_Bh)le|-s`&_0Hu&nK`D-u!ZX-q~a%aM(&pP%^*x;s|9d+k<<1{dm2X7w- zc{zD>p49`4^3u;frJl=Sud?F<@_E?e`g+1ze=t=hIr!lic>~O)CEl^Y@?XtcwKHPJ zxdj(|7lOf$_XVWbBRJJldbTI$&rLTXD$n&p=)Z&GOQd44D9yNN*cqx?RUL9A=JQPU z*JPfh#PjQKA32{6pENgOZQ39&t%kfzQoO!if*+NK+%Ci~(w{V2A$wn-9X115-rY}{ z56j}(I|d$Q;(a^T|JFrc@4)zr_fhID@L%!1U&fH;tU2eRmlPR)8de@63RE6Y!ZMzA zGwNdc)EMAva{xaI_~n3q+rNc>+gbRxO~C&l;NNy0{FjCmD=G$dg|x{QT3!6yMVKc# z=WRdP3x`saMVzj~Pnv7lVe?L}U$pnHO09( zM46m%?J%uCyXLi`nMeb&eL$YAu|aiglAcNXnOsAIkR!i(dg(8dN2`x>bb0{VPbgR$ zy5e~9==|fbt}bDv8_nAqO7HR*KTJ~Ovkd=WV0@9M;#92mFbNokdb)@LD@OIVI3gDwG05 zr+pl+QU#p*YZ_0@(#p|En7*@onI!WP%+ou7{x&p-za#|tqXZ%l!M!Kf43$a3XMS$Y zm0GiY&1mX$&N4MM0|&-=0>RC~v!2-n_wf^YU18-O{Ttf1Y+i5WB= zCVjyUTvv~Ah=3~mATlvClVhTw_4}a>%{{xHRqC&r{|Vpz9S+|jE?k4#a>y>99Lyc< z=>E-dXauqg(hiUP{P7VR_H$VFv7a+o;RK6LOMwGt`J0KGVdnb(lcgEVd=>j6Q?&R? z$LU0{0GxalPBZ^6oMhm10dP7uPmV9Oa2i&Il$V`sRpbx#sH~iYTU5?<71|TiURU{w zb(#~=CGHAWT!rU~){Gr%#)ma?Ax3BKvE1_fGB*1jjr@{hgP)Dw{uyqhf=s>LoW{PP z`bAfN9yd0)YZTthW_iQ1;B}@0@oU+v4j$pDto0$;a4=5KBmN9t*!sYB+$iHWWbRsh zM!6f1<65r;xd+k$!M)WQ#hQ`z$2_sN$6DdFNrOMk@e!x2fiy0XG#y^TLC@l+tVwZsdG$=({{d6Pii$POh})>PQoliJ1MsRob_(96iZw1* z43k}f`9jDllrf;(F!~NcVJCCHxC2_t@C_kgBHBE zDNGT*T!nY_H5%FEy(=CLleArJrAUh3V5MfdzJ*&Hyen*w&K+6a6$|lvCkvhgy~8%sSEU}pp{Q{D{JHxOLb+<^zw|dU+g|$imfjI0xVykFuP^HA)8|IC_FkVocgjg zg2KTYS8YTvJB3jt z{rP`Mw84si6PLK7!V@FkD&6>UA*``(=oAfTo$@`g^0Uzh)IT=+Zx$VvjZ9MEIsQpw zSdu)S4oSAAaS#p1&_*+(^>AXEwO009Fa(U!B$P=$M=-cA!3aXz;tumNA`fL+A2g#e zjQhar+SkCAGnRVDofD{O<6E|Tdz`?GkFUE6NT5~7J+Shdmh65o(P))!L}}S7EuSsjc($~>auNIh<4bVLN+o$tW`%|^#>tRS zm}Lop#Pq?~7xgl7$sQ_K6&gAums8g|$XA8K8W~0g*#c(aG^*E!aj!C~^X-~)7unMu zF>hnIZ)Fzwj~OigEG!wBJlQ*7XQ=eV5x?s~tTFzcqeL6%foxvz{e_?e)WR27YgZ~Q zEzIW3oL0m{$e2l1sMGV@&0tf%^e+1{zVz<%IllDn_objyJJ=~;2d7i3tX#w?=7Hh1 zZa=8^AGFh0yZDs20G|`jMA|uV&p{tcht2o1#If}* z&`>(!`ctLs@zNMs{sKuS`*TVPKTrOk8zJ_MIUomQg67TuTB=sY#F}EoRO06-;nXJc z$lJidqa?_?6Q#IIqRR54+?ZSjiv%+=$5PS)+m865ex0ui?Kfvd7B?aux#{`!yv3>W zHBJ_nE9AlD#fR<~;F$P8CG1hSU&l%j7ktY~9Yjiy#0O?UDjFT^OVB+X}C&AMzvD&bE0VzfDRG^VJ2AwvtP4Se&kI?|52u{x@Q4K7UGT@jNWi!<~GQl@O<>e ztrD0MERg>29>pB^8)VSMH` zMsv!wL2pJ>eJHj*#fjQN{p*R#w1paxBS>u_Ic&4!lsecn{VpX0do$)S7@D~)67CBz zIk;R|ZqvaDTM(Dp(iYwZjj4B_m+c?u1 z5*#;HT=Q8qTKrpLp3c0&$tJF@k!=s<^A#LP%4ff|0Y2%ux5NQ`Lg&36_xJFbf>v3u ztbk_wld+0b+hAql{9DZVQV?m_eUV-n?k}>5m?FLthiNQtdq4AO|}SC-nco z1`DoDIP=RD{Nouff5TdH0_Z1UwIZUv7{{z|PQ5{;=cfr_+ZpnBqV5Y5bvsbE33-_l z^*@2s`VMUU5$DD4PmXZ}V;tecg%@ZQ7^sLz5Lufw3DX^bBi@ZODyleIwdHj z;Qgb6yT_#Vl&n7&Q4_o+A29if<2#mrkl3+29rhU7Um8bbX!8({LxTJs)qZ1kw z-NYo|RR8GUT-^u0`@T1dDp3)0+uCzkuOUrdXtc>l+j&9rBjJSlD8v*vSLgVh?89FzYEG0JV z0R#p2waKp`3LxEh-13)qBqa2U${rea;1(Yzyp;zag}{>FP4$vSrfiI2-*ZxOd5F$0 zFlbT*jBkO(vtgO~mM;y_EM$9^VCQ6d>4Qvu7}nTFu`3Cv|I&DCY*KQ`KC9bO-+zV^ z{TYasPB#|AGbYJSL?ER6J;Yrw(qwmsWtVQ;_zIJY?P?)(U77(2Gr&1B50exkhn(kW zQrwei#@B#NN?U_>67kpMSsESu7H(4G!sQiSSPrR`P|qY*lkybV4sHcbDXEt1pslN5 zCnaB&)1jq&W#faxqf#tWr>Ha1{xaZ!J7?v>8AOxL4P6bM5bDXokGyYWmlx5?KaIoZ zis#Tcc_2bPFP>TNPtMQKXq0ou=f|qU#p*R;Q+^)a|2*cLz>;h@3$RXy;*wV{NH=~o z^49_yk!j!(%|p}h>eb{Ev=FEvvFjD&q zsPdd_N^^7gOS&q}1%H^ElCz}W-f?2Y&O!z}h}tS&6Yh~6@^U9ry! z9Bs#f46#d6v7_A%tP2s}mKPJsahDw;JEY2Z zb*#Vr&ME(f7A2pJ=rOcR-3@xY7W(=mJ(hzW*Cos@x*x)cF}VF)i~x38)1o-DXHqsH zZXu@)Qr(AWeThk1Mvz(0qua4KxYjq*8Uay z6yyJjRI>={u(V^n*YLx7Z}#kfTs89kAHm%Zn3pn&?>=B&!Fz;&a!7?R_72<;_6Q)5)j+nS-*aal?usbT9?3Sx8xQP- zcWucNkl`s_3|yDn(J#T)^5QwkKGtG(%at)V{Jxhk_<0dkwa14$Q0gxB(J5aMzC!ln z9Mugf{@yTdf?;IO$csUl4As@@$t z(|dcVb}w%I74y7W>zPm>Ie%t6U*~Y1lvmvGX?n+*$ogDOgq?%#p~!?5ikkt!Dcs0u zS`SJ0OeAERZv!6(A3}SX__>ur$XYO60MpROAunoTa>2bstLJDad zfae|SB8aH&pW=J!1S5Ta8{gZ*`(cgXa4QPk9pgmor5DkxG6x@6xEfDysM;xL?P0RP zY?1v4?>^!`#mTV|;}jdomXwH7kDW=bPn~$>PI2Cf2mq32JDg*AOmjlQ zgvXRpDUT_oQXW%E&2rs2Ammu(kh&Tv7LK?A1DlYliizMLT%7b|4tg^DgYe?!z<*j3 zz5yOD-f-F+dN%b*dvoAT8#L*X#jx%0{Nj+`>N~IX4!p^5MiZqGp#d$C1B|zkZ|P%8 zpX^9y8`Nyvu&Ss9xakjP7uMK!aTSP5Qg3Mt^>9VQ*(;L7Gv6{m>>qlW^-j zW(DhOa?G}a@(Nko3iO33O^CNn*xMY&2iU_NgYS3E_#-4U)#l?y9#{BdQ*Hrg#)uJT zpj#&MVuxc{bfV)?e$J$f?C8&BIAt^jD+}XsOC#MkX*2ekzrnlM{X+hN0E51oBmXU7 zyqXKR!u4BXtRy$a&vuawxWu8Sul*-t=1L9D&XuI!=fzFyHluXkj0oMh{_k#xv>6n0 zIC(>)3wIo!yCKqLJU8;?8zPf~Zz00+{2L;vhnsK%`NtT;+EQ^2G zMY|-qJ)R84WJgC3n$`$3t|4e(gNbx#;WkK3bjO{r4Kv9tJlkFW zbY-12B72=VyGwiO>%aBzD^EVd+Hk{z40(z?=hdNIkdU#n47KY5q+FNroiVIhP@A(q zm-FMSm~HguZ{#2czOvD$Cd%A2QAS5>7sDv;X#zK8oKra5>);Q!M)x$?b-J0_?|2Ar zW)s~qNw)=3jP18Z`LdPzF{&w{jO21;9(F<=all&W)^Sg!g~cq$VuVF&)M(<%-b4Lq z6FJk);l~`t_Td)%pAq=DzKS{O4$oi9myv8f|2}Gw=~wBKttz9JPt+eA<<_z}h^KJu zAMkUH%el2)gXg&W5@_wy1YgFXecq6Vyc6Y*;%p#J?6uIn^UyAfDb|rUs)m%cGFnpZ zOV`<)-=OY0sLN1yWN@R&=JevruOK5+6v=4QRb3wD(m3@V+_nswG}6Xp-1PIv=vBC5 z?J8K%_mCsDn|S8<;L7oa?q?A-B~N@Mo;p4lgk)?(dCCb`Is09$md0<@mYOZg zKcxk!*#S$Z6=z8|>C;|E=R8}n_gsa&Cl?Y&x_aGbB(vNfBkB9Lp)kDRBrm0?Yv#BV zBbj5~CpRLJD&1Hz5#>+T2>Sjc;>$?39=+XzXc$h|{#Cn$Jb#)T7ih;}r~vFpp7WpC{TfKE*?jx5_Y-6nCoIq5b{Bd@ zJ&(bEKzL1JIuEUUKYkWVoWc5zF8q(UJ~Q0j{4#FmT&f47BZC`~PQW6ln?`Uy3FzN} zUvNz?cH-;GbIUmNE4ysTZfdUqvAxuavgTH-$VZ1Sga=_q!BAqnzOA{wxv9n;zp>m= z_EXE2FY7myr=bPHQpbsrR2w&rkk9g_auIW6#8dYFuVe1mY}1-C+zgMqSP+E*Ki9w7 z|3{y@*(&)rt7LF>>+*jltXmtID^|VGRY149(@nO2UW^#F<&*c>x{S+)=sw#&e(65j zl>SN)lDAnBMbQYwZ?uMk_dOr>;>;~))F2ACt*Ni6IBEw+qkHkz58(!W*fktR_Q-Vb zDI0>|rr>ZrWC(l0Fja$1zU7M|Y4@Yo1#LjXx z1wP>NLmqg5S}Y5rhmpTp0;k2!!*0a)U5KBRgDEZ84IEt9R6kLN>T@ zh*`Sn3HZmaL%g!s2Ht?(hC`f0iA+(U-@^WM@#qKGEB{1$;L=XqO#QIhY@HEl08hJN z+=-qv0P@YltPHpE{sikNyz5${&8ue;R?g)W*Id?*vZKK`1#)_;V=ueD%r_TAZ zBk=JFd$zTEBX$G(oeV6ho&pxPqV_#OyHN{UFK%_c5HY|P=4!%)(S|BYaErpbu#o;UtH7)I- z^+s`X!^>uhx}`d|6mg~~WX(gyYztyq4`2Z5{ZDp94LC&J(i9DDWf! zDr%dj0qd>P(veE+8KhoII6>XWuR=Lj2=U_vpIdtepANK+w^Qq~I!(LLk`QWevSRmV zrlJWQOf3Z3yG6SWwOkwfu;zMMEWZ_z_j~k3Y+MIqgtqr}GhTLR<*ga4hldHP%81Pe)80_dO2g3k|U)+3c$!Xss3f>XVg)>dvtrofj0??$Ui(rvOJ-im`SpT`^AD>Za@O$@2ZoJns ztg_v1(6*KM#+tV1cjB`b|KG)EylG^Xo#$7f&6*$OnxYxdU++!LKGj%ba*E|#<98#h zwM^;J>zEJkWh{*M?=UE`rF?j8aU~nWljTh8bV#z0x6LYW2Y@ds)tQWM7%$9G7P}Sr z=^n&<=gctg7CZByDfu}(=B?5-C+$+rNpmO0K)R_06v(L*@@=fxDVsWYtYkr(hjoxd zrl!kIUSA`YkBb}(E>MIwuZg+gQzkBs zLxsk7IFQwbxIDTW9wzt{G17uWnOnwfdls6p+->BILV1L)z?_uB1CDH`uzcXZMJ%H; z{of)+d0z-0rwpsu)|T6m-Imjl(S~S@IvzXbZdfQXV?E&AJprbQD&a?m0&a&IC_$?y zK(4qe@Is(RuVI87pIDYx8-nB_F3Nkt*0fXR5Dmk_!(Eh$!DJXZuDO z-(yzTPdUj6f8ZL1ed4G6ut&c}*`oi1_F|@G>lS^LdyoF(@E+agc64&;dhmS{wi2Zt zk2$_C#Y*POm&n;KS&POaOM;-?oAO6&uJ6aT?fu2xJ^Gz>d-NZAo`vrcR=j)4%be@Z z=shZp&h)*U>t^(;+vg+X^bjBL{u*EM)% zhTYj7sJtSUBRw9!0{qKmR1OP&F5Pa5Vue6CHaGS==qITZMDfSCS&&a>36bX_^jsm; zwtK8LiE1NxE?w6zQmmVYKk5x~CPvzWQvo(+L|pcEYzRNX4@mM8Qv5Z zI`cY;3T&Di@f;@UdQebM=VDgyMi+W36}1}_(mk!if?YN+YVYQYHtJ@?x7?Dv9G3q~ z*Z8J`0Y8!`^Ips7Bn*_u=%IbqSKb*LvwY)4z zUe(&Z)H1WYAza>sh_Z`kqZMnzyxY`C_iYEy@&%~Wg|p6v^CjCjtAwb8vu?f-Q*bga zwFL&-Em@g5}88W75 z@a>0?hn{oVqHc<=;gGqD)`r2~I)@TD6dAGXsW3P#TNZ1GOmkuj3jetcZ z9)2-=n3)0#at58G#F^39)AyORB;|`$;Dzn56J!y(SB|tgE@2GaY+|ROP1?Fdwie}d zuE4JQKGytJ?6f*o*G*$&jd>s1+vNkgeTT6YY_K`pWZ)~M9I5x-9Pva zLh^R5RK)x zWLndbQYQZ;z9_QoT3hhx)*X;rfG_|#yWkXg=eAvEF2-IhyQ6hUWLN8E#CdJ46pqmy z7MuYVL%Ouv8S?dUIGe9a$QHHBp35@29EYff{)z zv5@>BMO&0S9*SJ0*!eZs`Iin`jh#<(2rbzLL+1#JHwxWl+1Re9=z1;Q0c$p|PSPC6 z4;OA)SkMcds~Ri^jmaF#|MyR5cRz?<>X(9SrfYBLGj4*_nL8){5aGX?w9Jg`%!17E z1@_F$0{msdK0iA*CdzNdx!J?;(VlH(>RAh${rTT5YUuOcRnuql$JSoK&;Io2+g*s% zPS!=*;hheS&ob0n42^RQR^{1|U67War}b11bH5;V3~;dK{nGG1I3C|qxVy_~td3_# z%5~lmth_C@r>mrPKdjBcRyUk)IBEKjqU%;J`e-Xtm&pQF6VbC5hsd%)6zS!?k}Rt3 zpxt%V(Qg)%RXqZPiA9G(Q}|$I^|`+90IT6yct7*jWk=TUHTPS@Zx-xFq~ohy_Bk_; z?wGQ>viRtJok?3Or^k9N(h-b6C!M9X-8-k$!1iHfxN2ubD-eB1bYiZWsS3avBx*W& zNQt8?@JTN4NqjU@^2gz6fnTT<7PS{qNkqr|*xfn-z>m-q8-_dwguTRjToH6uxu#?kY^*Hn>(L7(N$2O_cjFU%>P}0a_7JYw@jEO4 z^!$&8h%bB&mJICeDps(*%YqTwHzRBeQaT5ZKNDnEWo8alqIbP zf7u*QYsLlbr^B4=n!+it6G2Y;nSmaWseRMvyS*n^17CRjPJAHcJAuCj>>&>A9?1S_ zOUMPS6sSjC8TR^BqczYJ6uHJ@my_S<)!;Aae5YMbmI^})#-L5oGIXMtA6)55JlZ!>VN`b#Q=$EHDlp ziw+H^HMH~dA{?x3sgHhk!h$*kXrmiXAevVZ{SzQ}0UguemXtC?g!?8IO##O!GKaQS zXWFwPm)Dp*M$`gg{*SiR7Fc8_eCYEK!Eg-g+p3)f_e?wh){l6Z=LK*F&ao>Wj$OIm z_;npJWKrg=%xL<#zl=rZ{MPdpo*|3i+t6+e5k0ENlWPl53qR$0baW=Yh>BTkY&C+n1L%N%ooThuD7+An^O&j4vT1+7{)@JI{} z5Qshd)BFMHjRfS+;GLa3j&m%QN3Lo`JVnAF%n2XIfK~$)Fr|hvc#>d9*elyNhCHcn+EYE@Qw1J%x#T z*FodUwtD4U)LW1|e*x2PLFvm^?T zw{`p0bgi*hy#eGF(O0%v=`urWn!azr-C`AkPo@`=Ms|v|8_zJ-ws*~EYZ}*>BTTZA zEqD8ucU_TUv#yl8}V2*Lqc(L|d`ytvq{d?ty2KMPVqhL?2E}7;dkD zjSKm@^u&8cZ0`43F}Vl7S@u?}%i$=k2uxYA^G605}SYg}7^EhN<>j zK>@M15N8#sG)L12=%2^PR+rdkH6p<6dsB&cN|1j&AXy~XfrR-}z$00-oH=tQO@-FC zZ8SU5;D=7b>7KgNuXKr3DVKOO1Vn{Ukax{E1aG!ro=XA_K(a?#qekkHwNUTdiTBU@ zb~drn&!Wfi{-3DZWj^+=_>4<3W73)$+_mhBVIT0(j_!nP!5xF9qUWw|$(2^^+Ur%l!D_ z33gzAh5Q}947{KAS%4J9=X4+n{<=cmE=Ac)o3=n&uwd4#;*xm_ z7L-!r$V+lq8FYiD4+>pQXs>)ruPD!OIgEQJP0N`^e^%5;K1F75&UB)seT}m58~Gi< zuWTv&8kbJMi~NtsHwowrerP3NtNs|7VeRhM;^X#le)4|a0^X@&>>H4~;A`Z@Z#;fW ze>35?R&fhtmI~ujum_+ewb&2h-D)TODC`}e$sZ1-5|5?EVa4mqKGO9TM5oT2u5uF7 zu7=kFvUw#1prS36kK%r-)-~+)knPUv6||qgYr=&ydj&E&F>U^+)a@>6@b1SM@!s$g zgJ(Fi>mPsTLD7U!E4+7KROxEEl-~`1M%;E$y5xj%U!)}{uu`V&Y-^gFLzIhelw?XO+`lYaVuX{_{# zqvWMtgOwtK*ZK!E>2`1(DOWAzai+aF0u*In6E%Z-wgS2EJ?J&5&wt0KRcjf79Mi`6 zP=~!v-i>!ovnA0ge18+y4aFbG$l3rFzQYCtK^t)lxtK6j8qg z-YL1LhiN^AP4tPuvm9ct{y{z9uoIctEdb3Y)*~ zeDNz3S#ClPR=#H6x9K|7BYLI!S3Wyt=e5dFLL=FL94S@hoNs*%=X_NAr{p;?C&ngFlS_CM(gy@bXserz6!6?qj(XU+xyDXAqwzd~U{PR+O%D9=ckAcfhdVeY5?bhga=R z8?tpC*4to%q355#Cq3VePkR0td}c(yqqpU_urs|LXo);3cBl{dIiww+=lAqnU&ESG zCw%*^y-xL)?KSAX-MxmvvLjWs4HErlACRXcE5XSyc7>a=6(@tcFo1V>+JR4yd^jOu zCB6{;3;Ar?iII~&ANWsS&s7*RlhdjV3?n}o=43iB4~@A02C{Oc@D%i6yD2`GA#U4) zHGx>BA|94Krr}h>|D>HKj(}EkMIr6ve;<+>xb3772FF-WUKWBJf)8_+oGLfUn@b!d z>QA(dGlOx-t6&&o({twUmNWuN9TwXyXdiVk8 z;yVxrr239vsCg#J(JF3@uiFP)-7)V{9va(Jq7<=yq`O6?Kp>j4I*Oc!-UEE>9;{l* zCQRSVhEEfrnOU?SLYkseZXKPg;ABT0C!Y_Bp(C7o;yx*^c$yJmk%$9;9vJPZ#E(Zp zYwFjCRU}2*quczBH+X z4ZaMeUUwDQSzrBJxq4Ec%R^5;f*9NEs4y^rp#(^cCX@pFeYDVHVEWweq4+7BVJPD? zvIW0rTr>BJ9BQ$bdLYF$cGAvwQaon4{H!tBX8GNkJm@YE&zA00K*TQDXvpJ<_?y?e zj9zggp29*P<8X6}VrBlMYx+?aypH4XT>}!E?h=lwU01+^kjB31#I6Ci@f$^P(Jwfg zf46HOgx}0ZnG~99ite0ifgJiye1UNiG(7NTe1SKkNH693HbJhp%Ln53JY<5F3K`2{ z_iXyxH=gO*TzT$j>B?8A#bcTloA!fL4N&`Ru#366FL1)O)p%Yii*Ks||7WWz3-}x0 z^`*$Hzha`e@bciLG6NOBhyz>59G#`U2rZ=`R731Mf!2QB zkk~I+FO{Fd9;=nzjt#WeWb5bWA7EMmklV^J_T}JLn8pvyi)2A&qB33bzfXDmt8PFk zAVkH`rDXvJ@f(;ciUgt)9Ue{Bnr+nj7bCLZk8uv8$j{|s7U>}TIA0&zXM;z-EPwxN7Ht!`0LpoNUpdnhJlf*Nm)J(HeVMFZd^-TVw||6Q87#UkwADGo#;Z9uMp$ zSDEA~2XFo+@=ke?v63N=5^$>fk=Gfc)KkMs=E}0)3T``<_*cs9ztiEW`a{==uHROE zj^5pCP!l7QDdLr_a+%klaQvm7i3fgD^DX2^oq-JTUs7Gl4plqFs$NHU_%p4y zi@bJ6Znwyf)6N$+!MmkOZqvE8BBQ-ejPclBe}i0J^+yA_S<;(j&hT8hOgBMaY-Tsg ztRT=uQadY9x**l+ccYgiBcABGuKMq>u|Baf4@H%+D3dCo8MVR_cY#-|D)T_2`^)=k zs}_ijIFsQ0?Zfx?{D@5ObN!XM;sQtkQ4ahu@zW%$A?vGu5@<{gfFA9Nr!Yqr4Ee6U zW;UU{VvWJmS2r&xaVj-W zJSu7;fM#vLVlJDi6hcGv_wmxxr>?7UBBg?}iMtQ@ucv4qh^YSu$TY7lWwSog?K`iM zuavvx#fIdKY*?7~N@_0U;l#Ofg7$zL^qQh2$!dli_lP#| zcvnPhK(~#;MgUA_UUGe$bop zp0CPXJr#^if0?oG!!GpF435>e>ZRF7C3r*GfER}{cv}rO+Yb~*oBAjY3pWAu7x4f3(*mpe=F=GLC_vfb0EK(*dJt$q9(||y(~N5yLm;V0+B_W zHhGkj{a)sWrL0)Md7Gu4-rO;EEyuVf7Q1m(K*W$m`~7Hn#Nu?W`e7gne=)*H&rn_d z42+6E*3N*}t9lSM>`R}`oOa|jtMNN|I}mO-@m_8(huL%#@%;z6s(cA;7#(p(n9~=$ z3;qnAbJHuV5^VRw8It6?6g0csIOn$+B~VNin*oKCe=>5vuQ#niS#O#S-F7#;g|>_# z`u$W%TjWxSKcqO~qyjYCp~_R>4-ztB{}B!4#cQu@wwN8O;wF6cp~ z;uP@#N8c5o$b8>E6F4nL$p?P;D8J7770WGNq5o~mrB##tlOy9dZiI$__~iAKno)v= zwS)U-p7f7P-*3IcYw7=^^;=cb{f`3K{8s`5!!?^)MjYa@hHZ8KRx+CoAoj z{~`O?#s6qLEtp@se*n82oEkJYbN!B4cRDmb^_Dv-O?|5i{o{OID@Ixb5{(n{8eA$y z=KAi7yFi0a$K05!dod;x<;);g^t^jQr8PETNv6UT+lsgXc#(}z9$eD(2g0Hs(FG6g zKz^)ovfDcMFxL*B`7tiqI$#zhdHPUrz@j~*r!@`|=I(BsOK%Uc_K(U&i$(kK zFz0VLXW{Na3>$})l74EJk)?!dH)&^57U-+Eb+r!e0l~0flN>%yrkbsgGH4ZIT(^9r z|Mp>4k`GG~V`2D-l%wp=lU769kuhNA%H`HBi*^}WV~>`PwM9W&m=oR#O2B8<*6XBm z18yL5B8Hkufe+KbOzT2@;dGp0LzcnZvl*bokc@&{vHNTWY<{+)MFmt-;fTd&Q7?sN zdLg0*XR=h{wv^2o1n*0yw*F{x3?GqyDXWNbPCpB-V`h}!?)8r^viTH8jZZAPMnPnG zFsOKf?q2@A&$u`je@J816bI&e1}q?b$fjMY+v zc(<2waqr!zWqg!>dV&Nm6<>#cg^!n3D9i#dvZdh#7Mlt>dW0=`q=yyxaTt zT9KH0`-K zW=qko|I+P>#fZ^0W87$*ZZcX#^&W)(tXWy>Lry)6R(hH@~d_<~d-ISTu9le?70%8T}$ThJ|mGpJ)AVu&n$F ztSAmB5gZV^-vpW>QFe+2wP>FXS!E@7e3N^s(#1*wdw0vuP0+(0713uNtIO&%wWktS zB%vyZ{to;J&cYr0gM5iy*(86wX_2?HADIw_lp$M{37%9It!(tu0=DC3`P(wvW&zf$ zx~Z;8=~7#|gTYEfNtK9dDy}%-w_#Jd-i1Xm zsPU3_1pR7{5lu{=KA?%n(FQzztfx|WePcQjbK?f&K0APafOfW~oL&mZ>HVu^_YtX~qLeL+e3BqYrm`bU0!l7==7 z6M1z<0%S{S1yz|O*9D1M$A?;E(%rdT*@xUxmRiP`^oL(E)`!<|yax9(b`mdlIiZVk zur+hqKY?=h^Qf(VBY2j7K)*m-OP0Ya#Bt?;7_8*%_{L!6;-foTV|#0=e*$~+a^uP0 z=+4bK`JPQR-GpecvTr{)Z%<1-?wxs*pV`@Op;bD#KluD6Wh!$`{IFIIRI|T}a!Z#t z*x=>2F7n!{Fgur8pnd!h{>)z#u&3FR0uT>&ZsKq*DP5tK`c1(~>oIT86uwcunYfc> zoOW#gbl_QJFxM*Tt2gjB(Az(pF>{_x9RZ4(sMFK!`+?5M=n=Rr;3fs#C*i>5rV^{M>L*7@ZbU>6sGxo9dog~ujeY+!G+k!nJ4pn) zPo^zNbnXYJW`40$j2*+Q_3k6b3Vj68>cApb}PNGF^BXlWhKrl<3tk0BB%PI zpZe&ARf*2uxkY|s48$V&7CPst#QRa=yC~6$vxUl|(?xVXth}vY_2vu3HY1KRm2eJk zKn?#q^`f6I0nX_B325Q$f~}zF>6R@=IWM3b&dJYDmsG7hqEJprOUYSa?Bmo7asiYH z`XwSNw@yBMam@^2ZLtB7Pp^;rFfJOR*EnGLY-@T9efuu*&_2vfH#mLRkTb=83zs`A z41gM~;?Ew;fL@K8G;GNoT!yPt-OwLg8Jhup)k*(WQ1u)9AH{EmY$5=43|2W%+nX_u zQ?P^*q-BQq3?|la^u@Qa2D~Oj1ykNc83vSTkeI(%PdB@Knm%|ncujRCTf;sO3Z-7%% zYacN|PO%_QEp)wD|KvrON;H5no1@YN>=H;b;NguN7CBkTggz`VYxJiIWy-Q>c|?t3 zi0uxiC9Mh0!NlP2Qy<-aR%AkS|9};!K9tQV6_EV1;hjNIluRPMb{d_9&KA;b6S_V0 zAF#21Iuwt;eGV%V{F$TJ<0T$Vxs7o1L{Np)M@Qq}uG^NKcP~MCSm);Cf5**X`c4|% zRN@S23~pz$!n&=k4SpR0Y|Y&R?i>#12d8$D1{j=%YfW#V=(@+SCT5$bNGra%cIYss!na3m4)BG7bPUYT6Hy^duH#2 zr$E`Ag0?Bu0lC8isl>PSZ>aarvd#QggrXkjsXv2F`?Uy41|=6w)^`YB zt4MtSrQI3%dTDop3VES34UCRg9qN6E^ZPSw;Z)D}aE1AMEtVs6eY0-w_6GIDv?STm z=SF5JyL3z24;6|RWYR0A=vVSdp~z%-UxA8J8JB@l*yh>{y_aD8Wn^Sn&BZ3wQjA<* zAF*QW;Gd;El#rWpa5nTBX=_TVyevxVM;=>066~LU0!^3%FY&uEBZ77cD5)lASQp&n zEzVGr08OlWu5idb!>qD33i#>r9{1v1@U4TUaMTTyT;j2=GWNau7Gzh6a=3%eeatI- z-&@1(phe3blM^kwUD%tj_KjGcWzz#)(3f3uPjDk*Ce3qzcQ~gYYMC?1$VZY&#DoNCYlQ`oEDx?Z~HbPq4J$4)0LnosoDvPxct2yemnR8n$1>0eA_eaOOR%2&Obge=T%Estq*S)cq zk7r$SH>?!U$pF3gE}##Jz!Ud2g?;3|WoE8cptUnE-fgS{?^*0L-p8>iYS`aa`Aa;> zS)Vy#xnxI-c2b$o1FurjdC*?&8loLVJ4tM#a%`}{7l9)iOjHdv$HhyO*d?v|uqWJ? zq<6xvu@jUo1!pmx7F8qS-bOF!dFEo|ds)UUwbh@*k~P-d(KEdL{WDfzcu~}rsHKE0 zdSRU>xBx49`v{HPBK1{uqPiFv3Qws6HFP?r??+6ZkDfu^kv0!J#pwxUWHH+EYRrqa zh>DvsvP0wRF5l2a90$`F&ih|SadPvGUK^wiv5MbVS^ZoL@yw-9$K3vgreNh$vB9n) z+?`CEOHPW90}j{wh#Y($5rpYBz7ua~{ZH#Ac^~4@=&s7tO9O7s4I55|bdB0QkOv+o z52KJNEm7U@Jb^CeVr}pRC^e1M(}^6=mqH?<3|~0MU2~$KNzfYE`rl-HKSP#xNbJ(x zO`zM7&pW%--MSy1R^{@%ji%z_RnIra0~FJo)pl1iX)^u8oh~#4&5Fm z`n7U+?_f)o@YMmZ3c`=-Oy)JKf6KeBM_sjz9~>-iF*5LR$@bI6UMD zSlitZ_%1w6HP#w4?Ha!P)PBrGA?Cu-XNIPawR#(kV{LEM{$eSXD2^N?WOi*C0C9?fT`{R*`}yPD8GJB6e@< ze(WfhAuS1go*-EVnU+7Son-SKj$&po()3#@!3~ON74d^R(1RBOvv69IMuBMN)3D&u z8A%=q@G%+7a&!TAYdW%(xx5}6!=ZXQN7JVs=>RW0|KOL;e+B>O!t;nc?|z|~EYcUA zB-%Gl-WpC*?Au15R|Y+OhCD$epj)(26j>RwwefAHHgg+Ug5VjPk#_(br3!@WPF7^r z4yK+(^cmCE3ATA8CwitpPgcl1VEk&yIx<_%>a=#iS2)S357qH(iY~yvAOr6|EBvDC zAHWV<$cCFarN65pydb1|=NqgbsnC(j%~wpWa-1QPS=lE5i?I=z^R{))LCB`qwc@ zduXh^-5Bq!)ZV4pGG)C97;F2x7g`MN_63~jk8~}LTpuY%s~4r}U@HPwydgan9`8F5 zk``yE%fc%2v%<`ozE6~rM(wp^;t6DYs%XuHt>;6`9{JD{ov`maxVhOM>3<`~eC(ic z^)Fw$3W?OPW(eBtIs=9USJdp@y2Po#1OK;tf3x72c^#}We-Nz2cieQX*U{vjYl=-Z z>JxehugSjeKj-WUI9v0oR}-*%*E%YEZnB2P5{ZmqHkZX#zG}z0puxAQrkg7{=}RR} zrV+KM6C5AXwX-_;0-|J!7P8Y@v)_39_rc?`{i$MCZ8z#k@&_;`rTqf&i6 z|ENLlV7GxEVB zdhhdphu-krB^5xe<&e#k{v&iG%F)DB>Gi|98H(f~(DMYm3g{c5F$yud&pCGATe`TH zYTT|{*>$onQs(zyY*yfu61B|XpK7dPa)d09oQijDQe;*m$?g~n`n(-z-234%W}G<~ z`^sfns_YG2L;{mHbe8*uZpJGMFMDqDb@jeP;?g1bFTm5;<4bFKR$!MVm;JnkdDmX^ z^I8$T+-&9B4(lR^l{}NFZ02Eo1_#eWDFE+2hw-fi-z4K3hdUW(k3hdIawZq`|jvF*Vn(pejm&StQ(vzd%6P^@HT1S7JX!-~3O zkUWaaQRHx6o`L^o4U)$I{qI_Bk2i6p{4wVm z(7aVYi8vdw)Wr2KV_<2;N6%DZebR4ANN*FMXr{==R&7E?t^g=2{o&pRAOK> zk;oY=j|jEYo-6BL05;y*`kr_RG$hih?l?WWOjDg$0l*bkIK24sYn7rFoy|Cio`LG^ z;}IjWu-2q<{k^7XO>-h{Al>PQkaZl{*`@=b zewjOC(sgDdclTuAF~Vxh_$F?)7^`e*Y1#oxb!Ag?Lc#* zpoCZXb^1*tSVT)c?U3xt-htr5B33R@iAo3 zQ(8p@GST;ZS7_wyr0=90Kt4FLf2Anf zZ98f*v-bPwlfx&&_2vg}L`fMDH|okWN(M$a-+W)%H)tH%%K4v^$!^RIT>nMtM(!-1 zvC@l{KA0Q4xtfn<;2aH#H4olRY=Lq>l{PL2_7+TsHLaq$ zsE?$wuig>Deb5*>rH#-cad$LarHXUx;Eun3*8=74f(F>b5x1=U0`cFsBLe-?cv%ph zFLwAZDM6Lwhjh7@D%EP%#s4m}<6FS_a<+aW2!Bd``cSjJr25Lf{R2YI6@BA?SC|Q8 zbJTDD#On#pmK!lwe@!y=dh)VVZc)jT!PAOfIMTh4`dt1-Xe+N~$P;+6H+Y_>r$6zg z691K?Cy_79@~y)(mO|*bVX{Bi2EuK7sxEa5m8F(&#XZ7Py6VRr*fJ9oRS9Ueaa+OAHAA|;Ymf^a?(Akb(Iceq8l?5v$ zHr_QOYW`rHYZ}ly{t=s|PIgU?=DYqHo32WP0gZRJ6^Jf>{|~+~>tGzXI+ic+t{`I{ zuEE5J-z}fUrC_gc7VmB$j&~-UpkK_#=}v3u5!1X`)WYzqXj3!jTdj5a5zD-SzCf36 zEH*k1DAn(&yad`WnTv3*w2FEoDGtJmMUSM%x+<4!tTe?;Pmzx9*XkOhMGqWl?`jrt ze`pWx4)-_b{3OQX4vYOs)bp<8M@RU1ccGqi4kq~Bx_;2dUZ*nC+P(|remh2`K1jW` zT#pQcChECm9cB$>Gr}k{wCob@vU{m!OXHCY{72a!88k!|JO9-8RcG*B;V#s82Wqq# zSA58WeOuq##>lKV!p-|`Eb}WRR;f;PraBq+cp9^sBf>nnFY7DUUj>c0cRK2%6lImgvWr{Pq|G48|coM&~r&|bQe zdh}@_%0<~?*z^?ghqZs6=z=f07@e$+GoCmbx0cvdv1FWjp{$H(feZO~Bw;(a8y&4i zi4y8`BLfhvf7>W%cr5gw1R4%pLV5kE>HC0079$NUW5KQl`EzJ7r}r@S)icSg{dMH) zXVNG7muJ$@5S>Z11Gj{q#yK|admri#g%F=QM~JEooW>85q;^Pk1v8v(#9X_Sji7t{ z%slmY11AL=KW+dn((;Gh1;{?HSuH$S%K|Sft+JH zmO#`;P8;mVFfRhC0w}-Snpc95E*(fr=2i=CL>NgyPbozpxoz+^mesiPAKEC)N+MtgDr03 zl;d$8c}T$z0B3G43rykQiOJ8)jv@|7s;ssE8A3viV=H+76u4LXs!Ufm;{9E4-JD-Q zZak_b06n5;SnUOTKHT-;nJn}-2iTJ1hF#s%_KIm0)vtfi_zFL70`fW7bFyOT(Ft_% z5>e|fN5_i33g8XkZv#0V8m1-B$l`Mo5P8vc&yKyd(>HewJi7Dqb=9dWh3HNBdxE7^ ztp!`Uz@3+rPI*;dtcVLLs->f|t6qb5eUZ*jdkq9bwN`?Xu)@BIAmGA%2sLcT^W zmft5Du5C_zz9DiClS-?06*#Lz1)QFm0Xd*$7TMeM7GMhn*FXA9W!ACv_o(^iU{z#& zaK?FtyNjzb6}yKdJ7jAm>2B%9Fe{YO zinsF~ZfgT!UyLvbTvcP}j^i6b8!X{8M@ycitr%s?bHFDm&5d$%a)7Bq-lIVDMJ-~C zAui-ge^OuqzMhs8Mk)xyS$t?5-ffd^EOSJ9`R`bx~kw44JI0y2;e}H2`+_B8Fi&}hvyCfcuHZQ*Z7tqZj&K$ zRhK2=c-=wbc+bTx$g7$D?b9P6y~=(zp5}UO;9QXtSc8Hm>ehJnp1>U;4tJyRDY9#f zPdm#HV)$KRe~B~j#wZE-NC|_C_54b&v=e{)x0GGG3LNa?xJD(k;B$g5=MbNqk6p!j zsD9#m?*QJ0aIgWjJX3oM7&y@OI&&~io=l{;h97}~O z5upVB1v~_ob+{0bF3w=?`E@_F#jXfeMzB{aQ&*UyoH`zOG7NDkW@&o(4<`p}3);a= z+r-8#dVUBfL7|-8HqRd25ds!ksMNn5>-1{gH~m%zC~Vd;%`$G8X3l(HU(q{#_Rqnc z@Y>q7_O&zDzP$GQ+H-3^TRVVH{IvEzYyXY+wQE0RPw29JA5O4VAX%8^^HJ0jF8Ty} zt{yemJ+Q5#Ry!dL9sO9C|DPD$E482nY#(SweTx_&Z6YVFI}YEURZ;*e+9$1_40;Mb zSqU*zu&(oMEwb&Uf*q5$Ps8s|>21KSoDV;Apv2)04hTY^CB`?Lg>4K751Ac;79Bl} z`?8p@Jy3ZiMoDoz-=B$?>dXJZBgYld!|Z|CrfZ;?o`&<{=OcW3<^Z2bXGtFL$2c|g zu}kIKsHB%h`R!B^J(Ks+g(vPB!EbikOPT!~QRQL2yXUjfjPSaNF{M7j$z4EmYkyf@)hS&#QX{)^Yi`DSk3$5CxLx2om zbne4Bsogm0@BV+Cq}p_8ePO$2rB(7^Bw@8mS&fn8Br~ike|7wd<7d^$ zAOA*uM6Fff`+^+ZYJ&pV*#sKtVq~v1x0_xk|3SHfN`=TJ^;I=?z>=2b57%N-A>F5Gl5@lieKiBgr#`C~&D^}Db#IGLy4MxfC zq;-SUW};Clz54u#-)zMw9sdpI+_?&?JaZR#C*<%83-hhf-mZp%j~fK-H?YF4J74um zdR=jymfaIOa2|yNryn-C{A8)W+ElQER=~F5W?9-qD^oenNv8R4#@tR?!(Y~H+f8~S z79}qN-ei8Pp#6Q_tgyE7AS-egwsc|EwRci9zikIHjS;6&yd2yHmnF=9I;LRc>#**r zC+G!})>D7NKzTJGwuGL0__+K0LzPAAvpT-4$y5ejV>8Zo)N`ShZALAwNQXrVFh3L;hWnTWBx7OS3GdsF!!QM8+u=JEZy!@xh)!c)E!CpP4O`Ga+St1Tg~a5);^TD zTyMr`Q@<4t{r)@97fW;m++uH&3s2>q?c{vP9;_+HuXfW%2yW{^4|C(+ubX4Xdj>EPC3}8qW1CSPn9P=KNE5EJ%>(3(Cq6@sF5h1=sB+i7z$B7Qlvd zH8*X+0w0}^8P=PR2rrS2136Ef{O;z{naoNjP)3iw5J*>MdoQR5E1HBA-2so$Sd3E# z9A|-pU}i7kd?O^LUWfTOGSAu3B6~Z2=isf4b-#v(ua3#JKlbC}&ftFdN8}nOFM1u# zb2<8ctGgjt8{O(Mb-R8y;Ml%Geo1IMMH zI3QZt`6Skv1XMvS2f7KZ7hdn>!JJ0diK zSD%+(Vc1>2OOGSby045Q)zCOZt(<@wIEhMsTut-7i-Hm&6b{AGrA|hvpi@zGFP(VI zc{?N|G0e5iQoWIG|GU=T$BsXm{gPPKTwr=~%jqmWP02D;YQt;M-+8lNO8<3Znyj9Vksa%_|do0c$-oPJ2niW|yGiy;qC-@}u0iS-bA1|{ahkG2XtWhxL=b!PNzc?PrZ_j>-5jA1O$O>aJ<1Ak!-NV{G zxjSzM^?rnW$c=T9F1Z%CQG&cnUl^wS=(gGnO-^W#qz!XyA|wpb=19JL?52fw4qn?& zpJb4kOwjA3{ZL7-GngnD6~YV_((>yv{Y74G4v?wm%#P)%6a1MGVGb8F7fC9oDC%6q8>^jtP0of!`3Zf?73Y3G8aN}vF{ zv;zLJPne%zTU&yaIAhDfp`F*ux(Q#HJfi*u88#lZ0Z9YiLO^{>?*U+%_*){pe+RrJ zGlREAcy&`#M!~g_P55On7S_44tl+N@=Sn&RYOU2ZGde!P&7KAPxLQ9&>GSwJc5@t0SV8yl*h}AsExWvwkp7f2I$-_u@63_u%?;tBKr#UjgWc*c=dKQ zTQZ?%wjN2=C~GQ~^dj>_6dsDe@sZPa`u0r-W-6I}2N2yqzi!u>^_AwMOQ06R7LOk>PWnn}#RlKIT190GuyG1|Nnj z-RAZ6T#kr4!XwSaYBbwzmck)LoQGV7HWf8- zsF6oBl7E}KW69(0{3W7K!s%v5bFLzd3!-G+ag2i&S%IB>IPB|@WMM}ZdMlb*eceGiF2RjF7^z*Q^Vso+vVU1#;qGcQtn`TY4c*5~V9*>dXK=xeh1fGckHLf==WCw@=Pe~!lH^xz!% zi-LXdKdnTx8L#z?UKou(Cb1S+5$2CFkC>rz;OwcyS$N^p8)N>FUbnRwUew*X#eR&q zoc;=mIX7eOq^@CY;NdVE&i&c-@`w6$$^zMf@!gUvg`emqxqfQa0ZM?7*Ct@8 ztcPW#JZ{-C!`VBxD~5v$BO6# zEuS)#>(68%Pm!FIEXc~!o{aluHcI|QHX4&lZ95HbIpmAxcKRgW4xIn12xY9zD&8(8MuE$7}PEk2p_ZuW!dux#QAM{gR?25B|QP=R`xs2fn zPKNc(l7vIbsiz^f-|5)ZbtdS6z5T=ogu!|mo}|h&%Fb5qI|lvUM0r7^w$Q2Y+Hz@lJ9H5c;~mXi;Dxz86|3ah(WBj^t+mzpu`^!NR(R6({uSIv-IzwWP5%&U;1)S+z-p|FYh}}R%uX*4 zZ2CIHpzrFUkG++3+Fc5r0A)K6kpT+MlHBsS>V?$?nHm!*YHlRL;kFxBr?Vg zh+Hah{b+eTlm5%F7H$Yr&b7y|em&t2_3tPm_^D5zSILUj;2AYp>d&xT#dtrSDc-jhu|;WA#`m+=rRc@8gdc zG~;)1W!l4CKHYBj@NB_P8Yr{a=JS2zaRV%J+$~^#-RO|2 z4gpo--+eylp=~peS9JLNIWyX{CBLjp0CxI~h57QKE;jqKSQ+kM#n@H%+f}oz3g_JV zu6J(pxO>l;CVJe$S+=mst#;k&Sbx@Sf4b}O%768hfmgBbYYsO+=lT#%q5Rj=C|_(w zO@wR5UchOE9-vrQ@%f|CG6U0t&C2f= zEcvg4)@2k#Y5yx-k`k_Ty$6Gn(Nz#@v$I2ir01li_dC&`z0{OnL*F|jz4z& zzVi4{;+7?4yz!e4EwyUj8_Cwz4gc*rT=^L*`C-e8Ek|~i_+pT{Nb95qz@pc8%cMHDG7- zoe$&i-PdzHp<{VHr9LY#^Qj$sK+~Dii=7rog}N~rQ++n6IsDa^IvB(I9O)vJvrL^K?4aFn9qn7!wmAy zM{lqo$}N?cH#VoQf^(pGdJ6bDG*6F@xQuxcLH~il0*?Zg`CprsR+k`lI7fR2UVm=w zFA8kBE{4zbIu`~)GrY^pVVsP3W#MJVYa(9xcsatn^cM7KQX^?AGQ-B1^yso`3FTR} zGSH>9QDC4$^L#VB`tw}hjY&<+^=;sqTb-DHvMHn8uAmjs4C&uq#xt}UH>zf!A9LC~ zoQStVp0u-?h*euTvcK{>QHs*e)XYQ5-Urki(9rt0&5{BurDZY6C`(*mWG za?)#x6a(s3otsJ8h7_t4#{A;uW{SE6+$G>GAlQ_fDdH@Oek;1IIJOmcu_>Tbttsj@ z^*i@Xs7~-Q4v0kPgi~%gz0myL&q+ad`Tbu1e_yXAC!h1VU!KqNc|Once)hTV*TV9Y z--5RN2)AQwaEZQ6jj{Zm&mM#>pGGB&ZBM9Q#VM&U`UFl-qQYkv#;AoHS_tl@D-n7E zUS*_}{zqX^@@PlPM)j**b8!QIDL3c`LKEV%2buj~?7ak0tnfv?4Yyd-^X<3`fL<`= zmu<5J5+SLDO1(msR+K@Y$%Fy zb}M4#Doc^40eOCp@{DCDZw%WbnaWMz84IJ7ANXPWq$u!=B}n)OC+m(*YbqqW{CM`tBW;4vtYUwZ1U!gykwoxV--h`O7l*b67RT%%r$JB&~HTmwva|si05{Od& zMq3+v=>XOP_+rrK|8la@W8mF#AxX_rDxu|{)9l~UmUrRi($s05Flz_mgC)u>I{*K`P2nd`a=>}9d6k0#k`HI1ek`m<@D zmp*JZ+YI29On~N75pbKZd^=3z= zM^r4?*bfY*C@ZnGc7(GO|Io7KE!ey1eC;f77P?Fw;h!j3M#3ZM2o<;fM9H))EO@xP zq~!^9vA8sxgB)n^P>7%u8xWxAE@lNL|KbFHMU!e z3og0;mxGPm+mpG0$C@kyJ90L6x1n6oBZsJLzOo={(WDl}fj0I*{9qy-($8(~HV!<_ zeHK5SAUO`*)eE~gjUp6ANg_k^Rih5Y@Lcv(M4jgtxxyYDDT$~JeXk6TWZS{1j9API zfDB=X`hl1GB~ zJ-j3Q%fYFpeS=4`FU5}_enm9wsjExpnj=vg9*cILulz|mWaNs+qLItLq_6?Ku>};3 zcGPP?HS*CLmMB*YtRLzPHeyF_Na&66emSgO{T%fD`+ycb@nLoVx2hgI_st#uw!p$Z9fi} z($@74{cBn_p7zK8mi9>mS+C$91-m*t5%Adh~{rhfsbQSGh zUmxGScu-KRz?$`4z&_LF%RZd&3!^%kFYCL)G-mMgg!`SMs8vdbp72D1tkM!SmSuVr z?6Y_(1vaN5WKW8+N?^^|^3u=R?#tnh$!vlLc~Dm`=3@s+u8!%toWvunZ;1fAz((QQ z5PmjJDJw6>-8_`PyG9O?Uve$ZI>b2=r;;XLjuRXTN6O%@M#vT*1ulv8A$Gc?yAZoD zTBZp4QbiD$4Pz>Cpm5yw!q__XR~)zfG4+h?rQJ6GwK83YMM!ZnMkx{rX8#mrq|5an z{O>W!<-^1}HCs!0we7kd$|1{Epnb2EGB5)yGPix5n#IwsC@!SW92d8}EBvf#)xxrK z3c$-zx}E9xFYu{Gv`$Y*pXti-Oz?09w zNa0&I1GF7-RdjxgI6hfejuK!=(9hIIrh93d?O50 zg}!tOAui0cM_(BfviSp!S12$26~@@Q2iOeYqs};g(D4d5$9?>&F09P;t?4u;;}qW> z6|VTS|AaO(Q7?&`ksYJ=kiE=+gjv}*0*)Y-qZHs)&xBCg!<#UlP|r#O@MkuF}>!(#e1IzW%=EpV0_+Pe&CL}(*8eh?otc; z>b3}vbg8pKUFy|szZo=SY_FqO^qqU)2X*byz2}EPb9WAA7+-W}9QaY8e#A2R%D{$f z;e$8vmb4>uhp;}f0aZQMiZen5?ARNGJ?f;kUp>4>Ee=&YvPYfOvGb?91`QLwQ@0`d zEA9K!L%WcApO*J;1~bf&x{nUvjAb&7=+EyRcqse551z$)k~+o?TCrk^DOdje&E2T+ zx3=Ux(v2EF_EXf?JRfpebI8wp%!zaA z+b`uQ|NRoiVZl~-#Nj>9U&wc*&)QjBj)rG48TPjrJEB*QS{2w!+AWx6i-z@fQ*3lW zb$~e>IpB6EX3{&ME$Ox3KeG*fgl%Fcr~DY+`}nANTrX8;%f!j{AKsSD zJJosOYxr!CUSGo=U%v*3e@Y$BgS4ArZ&T!vim))4rJZ8wmQ?_)5`c!`1)qNycI=!o z^d)CMv%k4MZqTREu*e)`<}$ znU?Wml6QR=Gs=|n%fn|9^qbCoB%jVy-Wh&rkjuc`qrErwS_eF$8=))Prn7OKg3<=L zHn%I|*6S9Nb&k$H)Zh8AFXZ3S5wbrbhy1HW%!d4^sbWp+u=>in>)_92AL^B(tN_ku z$5P3Yqdb3cGWaTUj4LVd5Raaz{A#pmIWDB4=5nkN^9J>MZ5!0v+B&~<^77sH9&~!% zPz#{pV}x33)-KY3oTy9&;s%$oL1jDWPGJxH^$O?L-Jj+H_Q5w?3wSh>XB#-Q1?TQr zL;M`}v4IfyvAf{qzyj2<>S%^%55{Gr5}bn#Hvf)?5jF*B7I#e@kKdB}boX}b87p}I$_Cz_Y4^G_nGbBHXPD@40@lL$^@V? zW-I@rvRU`Ui)9gW8?>&X`P{tc>GYo$epY6~J)NppJ40?&KGVIi^A2nQZQKpo`HkqagBg~w8z&A}^yUNKDZHg70=o_2gAMMV<9r{0-7lyz zK0%e{Ql5e*o$K7zO_Zw{xq2P2u-#vGU33S2@2>;JdFWE^U)OR!tUj|of52j*H|p9`Q#YK@!_=Hgoq7{S-h+A*T^Df&~!+EK(?LOs%z9gVxA(+An?a z<`onpvjv~hj_^Y5`$%}J_HAp8)3=z>Iv<`1e;(bu$~0rUyA*pU?@oI`Pze!dJ=65kMsC`@N+&qn?T)!#*8=* zK8U#}^jn%&Ie~TJ=2@qmRy1jhHcRB;|9e}l5k1-}_NH43P7BX%>XQ=f%xU?;yDBfe zs~Q~hd=LAmeM?(6YwbMh->+s##mn}qR%t0dCrQuZvp}N0(b;kW)LL8E6(V_px_1(A z+XUc7JfrcB7I?jtg4UALkO1U+)LtKMh9I$4MB)nc7U=zO*$j3QQ)7{csF*;DiH;V< z3b4ve*`GqzC1DMTiZ1&wo@w3Fia!+3#Cst-BW{o@zm$$ge%aY?$M;}P6;f{TcX204 zG)St9_IC}2nqN5}J;3Zez#n??pbt;Pn_t>P{}3-kp1OE?N5!q_`1@zIa8um3_MhWF z8JE`oFfXMY&6#cXrj_aFz}nYZig>*5^`X4`ML(EPj%nIo0hd~VhA zg^Ck2IS2jo^}w(0y}2ia`yK|2FKF2-cV0|?H(Vq+pz1Uz_q@W28|lUc68pYjw#Ql~ zMhrN$G)8$BAeUW-r<|ONa@x=uAZU zdm*{$)pB%ezh&T>!&ijNSnJtTis%S(tE5&^Y#T6-RZtmvX14artqFUq71Wvx;9uVv z6sm;S@gTKjWEKy!Ac{?O;A7Kg*$!PmO}7k5k?FILbCn@>Dxs@FJ>k27&H4 zc?eZsuI2K7tL4Ae?8(bD>!zC30GlD`E?eKlY5t^uW`|NSlgmg$yd$FP(t3Ek0p5Eg z_?m(&CKj@vJ!nu~8}(yM(7%wAbC3lZ;cG#FMf4U>aA+^I=+gWXQtlnD?lCCOAUsVK z(9-p0g`oxiz(~c_G$lWd=jd=p*nLJ^0iBEs9jkCxuACk*D0hvjIQv1f1)NR_!D6ulskQR{piF2NDL>!-jQBaz06)OL4hPl$Aa7LRp>zs${a zg&dc;8Ar<|m4zx~{t9DsJ@^Zt{a!^ic{%Zl#&awnj&^>hWPa5~p zgOc8c47nj9h4spvV-oI9fD=F7S8Tkmn5`FnZh?|(17Ztg5CY_sM6K`6F>4auHuX+1 zuhJTwSlOob<*>?gahtzSy(gy$pTV3R_*|271fQWC&K5!{qRir6%I$yuues$Tw`82Z z9AAOQ?fDl%bF8-YT~E3vAABJKnxxFbxRGo_lS~dSF>WXPIw%h8xJQ%g%Xk6imNgOF-+ZR$)3zI{PWD73jaW98O0=yC zsk6i#c%CWZJ;~FN8_7u-{8Ugq(s`j@#yKb{K=M@bQnz07*i118(YI7%2TDbG&~Yt7 zd6$0s#L7UMiYxs9?WGRQE`E~M@9>1E^?RUqeV9&@uZ3M<%Rr6g&boqrti?6_h~hCaCrl@Yi zRoE*7Xia*A^_Ryaq#ky%nMG0D+lq*(OaV^2~#4S-8HN>JCZ;51Rrw%o|2XZkD5b4KfKH zH-tOJ?|OWN6O?thX8^JbsLr?5^i!6S8o#x{jjP0zVw?dl$=7Ii&w(Crtt8d!95P}vGvb2pnzkI5Nkc}A7Trt0I8}s?-23iUPdg(@*DK{hJ z(nxX$Pxrjw*@FA9Two(E^}t7(WKj-ZZ1UHGf|(B)WQO1GkN+k+A}W(+-zLoE9OaKV zA-mA#{Wu|iJw`U!CPtr(`S1xnN_^^A#{-W*7er3;5ZK!dh(m3xh{@O&a0@KyaL$Ab zS0X(b*!6-lg5(t^1dA3^$S#i&;>5qk*$frF)twmj_Vx!0z4(`>$wSCb(TX-&7A`V<}5H( zZ*))j2==wO`PYYB&?oeTo0>yY=N6c5$b5I|mFxrHue!O9Dm_f@>Gl`!g4F^vjynG1 z4eI2M0|`pWh1|G9pWO8qSR-oX^L^n@)}nOh6%nzP57&fqYad2`(cEHXo85dr7pe=H z(0FrWB2s_#^C1k*}w` zwi7-qfS0l^(A(a64d|+&-#PW(a8-d+`}^*`BE3Ab;8)$ZHcPdRTIV!N_;=9e$qYTy zS{h-cc>!~H3es_@PErwDWb>3KyEUvm)OIOq`_z=yZqh28 z3mr45)d!@uza(11edNM!p(;LFL7u0SrfpMgVoTs? zs}YvvJbc+5X>owV;=B0v+dPet+nXJi=M$}jmo6q+Y;w8{jkUztt_qT3T21tXsA+B4WmV zHrCi9w%X^=+81l5tYWwW=de!2-hA*Ul-}8Fa!~(^K2zA#^I=ggzU#wjN=YjPaSYDp zLXXMO=Bddyg>MWSwtraE5$S`5Rhv8SP^bXfk{?Q*hq~MIuY($KQH`!_l2U*5+Y_BH)WUGaL`dpScn*HSDs>jiS*BwKtoY0OK>(9jhDsBOyLDu zX>H@BSy5USN^^KNc0ZLr1E_y_%GJYxshhexwUSbW(e7hKC$*AVru3jBTmBp^mTkCm z%0~F&D*gXmPCLq>R2j1$ozv3X4Em3IElnkBrqs4U?)z+OaZmAP zYtOTrq1md91@-uBjdI=K=F z(9RRir1k3T)OJi;7(2EzTw{k_330BlO7@szCU}xh9iA51(QWqww^)^?1$r}43VEW$ z?qmbUC_f&y`lr;kLg#QO&XhU8a%1I$2W5h1Hmq~Msi#O5Jd(d9ybF5yoS)%j&=NLy zc2OJruvY*s{o}ALdkPwW_S*WXyssr>^PAzbmGenHXmXZ2;L(YdOz>?E@%{{iq8CeQ zeEc-7g~zk9H`~L7o#BZdOMa0DdsqJ*Qytjxh$rZnlK!rqqTR#0!a$V06nFY~-0JbT z@_5`pxVkm~Pb>l>&Xi_8ywHUS!F$8hu;&%ze|_ytXc#+c34xf(NPkm^UrTqC&ipPz zcp7>kFa_4y9#F;*d`k9%@`QZYf2n5zjyR&_bqQEOjr10-RCC{4-V{(wXl8K2c78a;O)*5 z+qc{_%c+(&5(;gP*A2d^Q7v~!p7yz#)B!D2Yl=Kurfh|*4X6g1Keb35wd`0od*a63 zaHZt=tdQ&~P;boEde33C{V_kV3K{Gixj?JRJ6ly9{ssK&@o(?}%`o6XO-$gd-N<*o z=L`St)<~Aj!IDA;{K&4QM1%gO+WQ)SUrl!*9qwd5Yp*XPuXk^Cvo=%Z5%4N$^bL3d zfKDm-fFzBwjq{qqq(%D}e0Hs0{!P{9sEN!gTpHRD3ZYMI(9kDJNHD<@trztkIulpOlx74?49{R{bVG1jhX2|0C zhDu$`SXmhV*(%KQGFSmXixvH1%vHI*4Egpc@2htC>F)2TCGx9~T9H@to!vX@&K$hT zqYLGOD<%jU0>(p`3lbY1mxR?pJVnhc%r4V2)01da&eBj!7j|bPg^@n)e*tRZT z2z#?MEuwmm-tJCVtPyf)>ROzfW@7e-g~6`GvXZnb98 zO<~M5R%%cChGcd~nczzxHT%2X8j{XI{#MN78GcBM9-9+k739w$mE3!Adc**$3EeWsc3_YWLrtPyfT1@{gCNF1i&-i#^0bJWffOgX4ZwG0%D z+T4aV3(zTH1~JAeWNm(9RbhUA9KpdE7&I%aWg8?XJ@ua`_j+-d>7O zPwTZi(uMFh#FTaFrtT%4tf!c=N!{2Tn8Kz#)GhgUpfAZ@<7V81PLKT{R2BlV?zF6* z89m>|shT|j&lE!vu;Hs~xe|W+JGc`|C2vE>{wai|vU!N^AzgkZxm3IJ&j~^LBRKdg z8}y*X={j+%ce%3;x&4dOGI3#qmAKV1$Gk9==)Gt|x{TE(4Tm?-JKz6JRdQU_Lo0Nh zJ9*HAI1Gp?bk>-96OARja-y9MKjkR^Q5JIpR7seY_Qq%Zw>XA$95E*{TNNgdcR`Y2 zWI%QRPm^k&HXd|JPKSJcIV8YPD%Rm^@TO>=lB?*(Cc+=NDOO+fR(DA9EhZUvz?rMu z_bO?~>*enhec1h%Ti?6&ht4+^vn!Hu2l8a4W_dzzQBm#58XZ%)ujSzXK=(&xHsfqu z)bwv!yNY1pC9c9O0boyYj0epas=t{0)`$ojE$ZEmQaFvn6U5nh*LuVfagGULe@=<; zyW+*uJ1JFr`;U3`m*4J7i8#OJDwSinZ}`Rw-Q;6MEGhO7y?8EFjN9{No{P!S5pmY( zgZZ&D-7f7-Yf3Dchc`lJD*4}dE`}}}rPz8o#e}q{h4o?yad;;&#?PSkdQYxLYPY}& z--L^|DW1$hGs{(ecu_+AGY2d2{QZlQcjb1Hmb|Nkhra+ja&1W!LW7a)aemR2_lJ*9 zR4o>tf4LrU?vqNS*#)RWAVo9*xrT5yHb0`8+ZL-__B)U^bU@~i#qwZ-AQtzXb+SjW z?!TqI%VC{(H<3-myO~d=-%VzQ&UNUGl8YIg>pfy|@l(0Vw2K|yYf4Pj{Buq}EcQcG zZdO~tuIaGTxf*y9rVy1U`TuXF+41H-m(_@pPK_=ZFXzPQrZ1P%cBvc*<*-zVwl0;u zPivZkAD<`|Y488|gfu4xs{9T#Y~W#|50aHW7EHG#i^U;xc}LA=5lCr%ujVpSaEd4W zZXy%W_DQS_a-4jYIXH!h#kor7D2;>C$2Sv+5h=WFr&%;=ZLB<&&Q#j&Z7kScqB z2|PjKtBTMHzSEBW+BjLiTWlVg+GC0~h_ODm*K z@D6Fr^jsShf4={$lY^{DoE_ZeNk4Pq6!ao5K80Ev#HUuF*F_E?X0Zh!nPLbb*-R{1 z?rGBIe?usO-ncXa=PCRnNhRp zdkg(++jsojcSy$ycC#+Z(d@HyayktuN zr#|4vW~?}$aKS#A#Vok@)p&&kk3(0OO|UG>#EO=>%t5Z)B2D%zP%=#mlpM&ZOy;ST zg#VbMOl7b023?WvySjkxS>1~|RX0Uw5*`;igntM#^jGT_>A$N#rJrrM+Hkv}*)U|7 zW;|{fFy!GrYMOmU>^-b9!U%z%EJzY1=3mYiX96FjR3a3OGS;~)qpcG+RHtIFP8YXE zvMa>{gu}!sYjf-WK6Y_*WO%6B^o*KhyuB)3id-$wY-Z)BKS6HN{~QsdWy^JnRqYHL z?WbT5!j#WbgjPXMpQUtm;~{$bBxSVo2RKOz2r`?wPrLnkKTfC;`=@7A@~}8;lHWMe z5jcoC99c^E6t+$6kcw_l=P(YIUpl0$m5ugZV2M42)S1AaXa}0pHuXwr|JgqF+Sxu{ z#Cga7YYd~*YBb`lUgUsLfL!qX*Z4MdwnSmlNuJMf{|Ue6;I~0+tKr|3>d zSO%SWJ}v|0K+t|SrLyfC;+zpXjx^*aL{~d*{dom37QXSP^#ONRIs# zt;~wcb(o@!$n=!KuGi|66Yp5d+q1OLyp&0PTW*nma^$8Xwj#y^eTy0MA& zN8(I=qrBn2~YPMd@lp$>C=cQv6F*{H>>I<%diJDY0Ur`6bj9{2(LHk>~? z0kKycB`*2BiycAR@{IhxL6H;jo*ypxjQ!vKahqR}OV;1|l z7$KRKvUG|v_PwJy_ED_0Va=W^8E*>umh-^&gZ44(wDZdi@CzswJD1S7f&&^NDu7}x zmInquszWrbv_cP0R*s$?``%cBWSI)%}RAm8Va?-cv*#%pDzd^xID+PCNz_4-&%*XzG8 z7DzA1R4)_OCY$*v(ihmb00{-{mAK&2vvWBv(6sy@_86DSUAYgd9gwP8n^s-?=~1I( zJzkBuzb&3$EDYwcRX8P_Q{`3rO`t!FI|&dx_?cr&4%pVR%6sCrpsvy!>obid`VyaGp|A3LBCisL9vb^7SSX~#47oi?A6ISSw;BYVjZ^|B=IF7qQs4w`+idePW6f|{mm6LGu@XMFh7~uwq2$gQEyWGw}ww7uGL2LT6iUm$13lA^ysBgTk>f& z#_|Gmz05YMlZpC(;e^2RTjA%9azS3Vvh#^_4I0>LzrkZ$4xhTXSLW=t_?PLkRhg5b z5%t}LouB(Mou7>zhsobMno7PsbZK|8DuFRmWP{@i~Y zXK3?#ArvMl74-c?lJZxkbH74wObf$;Ao~jPIuktgGaR8Ss$AyxsFo}o2DI0 zQ2$=)wRhCguFN*NiMF%99;=48`@Xoms?Qj}I<^Ol()Tg%1p8g_Ja}0r8fR73k2Niq zw(L;NtZ8{i@J-OFrOOFpBxhyQ@};XY?ndb97SNtal8@SlbwO*a(UZBgO-}RO)IxWB zpTDyyy??<6gpd9sy0tMBA2P2O)Vk($hY{(H;UX z2_@nZewTU9SaLA6bos^kS)JxNJCNd&p>&SGC$;Hh_mPL?-tltNd)Ko;=aQ^lR^=}j z|8vRCB|Czq+WnY&R^{5UFK7U9%a>LoG;iVe96KAV892zdfFnQP<_++;=`3trA{JYf zpIuCkO?1dA{SlVbU+e|M)|OO(&x7Ugs7rF^4-; zPE5at4Bp1cS02&&RR>S;T8s?86Z>bq-{reSo`Ml3?%%=gKTfFnM8VQETREgFpL`?_ zVO`qZGUK1>a;c@5k8RY_n>_#A*1{6RgO4o%d`kbFc>&`#g=$3rr;bnU<9 z-e#s&E;9$~O)h*d#NOM7J-8LVZ>3-%kS2E|h^q7O&tR~SHy5MDhutCrzrjgF*?_=t zgJw>T-y9S0o@3_{^lm~>s?9xV(M<@5s`*O(qy_l50#G8ST0oWi4(#5Blm9C~L1eL~ zd*FeiPxjn)@-J)P2a2+MydJeOOLF#VRebrpR^0{+8jxbXhu61s9fs`q@jaz#!x>&!r@!4Z=<>hOnQ(sU~ZRf@B~waU8*XktF*_2%940wEng`CGca>Hv_1PX zzOIAxdRpb=xUH41%<;IVr={{N=Ah8_al&*puL}RO4Y-Jeji{3niHSjd)iJzfeRnR`Kk(rqCmD!fvmlEjLnAB1AZDfdQk zBN+_Lg+=pR?M5+(wFYA+TfpWyliW47%xeoeze{(Sz%c6thFR|!oLm__!<&sBw*VP| z`9VU4Bl${TZpOWvoA_0a0|kX&vA+>%aQF967u{NMrFM9*4zWg6_+cRED&i|M4lJs_ z&SSb3h(rv?>Z)+P9XDQr#}eUY=EUu*oJFF7OPUp2Ojjy{52E%3Fdsk_pCq}^Z&JFM z@5YQ>l1D-NCVDa;d8>pTE6|vrk8}^@8e{eeacPZ%ZbJi=nl}}ADuHg?SkjiF8%t_4 z`I=c{vnmTm_%d!5bi<+X3@kR>CiwzPzB53vGg800m)dNP@M{Vp8PKJ$aDT++#jIhiQ~GW2P$@t&kl`%1rWbb``hkRF4}7qBbn_&S;}zX}%XMSPn_p#Y1J(rf-OH!2jF> zpub|v16$pu`2Gh@;#-JYAhWar-NXSbB}aIJd*H(~-c9<}0BADI5UYY0xeqW@x(}U& zd9sLnXE&Ixm%>ZKu0q^lEmf7~0I%?2JSv<%e3cJm=# zf_A=Tz{5F%^Ml?%zDKfU$d9RI4rg#3DE|du(pv^xOpgVt0lpu#D^0{~JBx1-E; zxJSl&K`OaDuuiQI72LRFdj2}Ub_y%bFIYLib9B%BKi-XQ_HpX)TVAIdPtcJ2qt{uu z!EO8i{@J0M;^^Iv-%`G#H|p)H8HVl*{4@ETt6!bB2ol4b+D7=?G}TH=w5ted~8E`AthMu@uHV*3!6JG84A9;w;SaGUdHgs=EkJ#Lbnx~Gm#$*Hv|%`R^1h6r!V1}AYkd5u=%IjPgQ zQ{j}`)lKS^jUBR3aSXaLxC;?A{@gCbb?w(q;cCt8rUGD-iZsp~^0;bti+jQW+WRLm zUHcn@b2w)Ky_-|2YqQ8tg73)hQIh4*W@?DdnW;OF7vYpLm6JJTmO6W$7|h@OxMxvN z_q25?gQa=CvmMg>0>}ySv686;Y=-c0dx5TvcD8)9rx3T5yiM0$HjhftwdsCqZs(Ld zRg8#e&8NUZoQ4vg2KCk1tuf%i0)NpGLRu$z=q3z>B@taaSF)exzUOq(oHED^C~cS- zk5X^^VeF|Pi-cQSiF@jFa(IlB&>w8GYHx%wlqW}S$2DE5c|#GCb{MyT*0$pw`=_7} z>)jliU&*ml>IOFC%~4{Q0sS=Z;Xm@=dU(eh*n}Bh)+kj?hh=Jr&BQF-G`ZtETZQ$o zTQ5J0Sw4@|2Bn!9vD4UV%mYF$ZjWtKr@@mhXx^#V@1T`)l?Og%H&LW2ckn@c-t;9A)-U zw^#4e`!tVw&}`c0A&-8i;VpBUS{0xh-0!0G!?B&-P&Fu`DB_Neb_Zw}NPkIO2Xr|| zC6bPd8`P4JFz^sj71UISJ?#w@IkB21t5P%eB=l)ytnB_f@ArJldA7m_Xq#Fku~N!& z9rDa`T!EeKShqA&?U$f`@>BT!1K;aQQxy&tS#-xuau6MQVa4v2d5@`8j^+kd9J(IX zCAln`t6H5F_=pvI7Zo1pmS$Y&e_)@Vh2SMt+$-604%}Y96{YSN3;~sHeIDjK z^g<~FzpPeO1ZDtkaF7;Z66Yb^h@GRPc}7&`$i+0xX?&GNJ!GnsN1$xL2?1 znKO?;$H69&o|*^^kk&#|!56b~j-7)}D{kKKPy0!WXS%oaCSZ%QcKB5(b7I^AhVv{i z5i6@@@&uVh4H(0E56QRQ0I~<|A~OTD!p;Cc5nk%W+;p6YmD9YKXWc1(4?>;09suqq z^wYV6OgesyQc;?d;H?h>rEnB|2OgkQe`CI!Z$=+uz0)7j0Ct`^i5}2zq77v0tS9>H zC+y+BUF1sd@^HApr&;}TZB5f1>! ziFBdBZ8(D*=zAGM4{=@%?MT86mQmw#D6S6a?f{_-^pU&@8lhh#F^I1mD22?ZU^?tEH6^D2U{H5`4ug*uTm}9D)7IJfW#X`6VC4 zwAaErpolgD(-c$qz>wtD=A!}n#N&eZS8x2jBW~a}$27NSEV}X95 zIp|x}wo+Qv4v*-KD_xOapnu!2=S!6tF}BP(ZG!yn3BJU(YTW9t=GO`E7Qw(YjmMd5 zTSYiCzx1czF&o%_=+EP$h(E`+icTe4p=$(-nrCotJ$8ks7@R-p`|XFVn=Vco9I(k6 zg~s)I@`&4lUmHeoKB;&L^9AQ|O&6Q1NG4X__y9bvvW(C*(D279>(}PN6KYjxqgv9z z$|-cgxu>r?4mj*sU;6x|Z5T!wzaDtisI z-wN8Vd(V&hghsjX+<&g+^MqQ$806>a94=@%oKC(ta+l|u@SO?|z^ z8EVQS)DNEzzonX3I+eMRW+~}nLvQ7_&G6I>y~9ygL+EO8_ja_L!5%d2YxV0lmTB#6 z9#7HfVQskUHV855g@?3I*tP>f0((Rwacm{*2azcyTw`F?`V4L6SI zJ?Yi7RZG83Yf*nZ9rm;qb~<^}$amiC6){>q5dL;Z0OUVG~yftL#(j#$J3;AgT{mo#3Iljx9W9hfU+S?(oGpHtS8%>9$ zv@jtpQTjzH@kOa|?G190>OoIZ$wfnb2{!A7b6L;R=zgTVHDZpa3qHNE1xN{13~Rvj z3049(VXij2oo6z&S-Au==^BCsMf^)C?=F91L zg<8D7Y8=I;oE&uuc*UFJS9$aU>oewgh{GnGaxN{CZp#>ih8(orZXd;-+RnLkkP3qz zl%Bu;$nJE0HZ8w7SY>nuIjL?}?H%biGqpEZPs8iSYd(9tjwP%bHT!REMqi_aZB3A8 z6l3fOZ4`B|je$3`VL6h{sa}giROFk(=m}FgbdeTH{qXJKbjZzGh!gvY`Y4+@sO4X) zg&j{2|24UXc(J^mM}YsJX{@-mG^FRvbm&f0`2^@H|F_1c61TUpJ_O0kCXo%)f!-U{ zvTROL1GL^MJ>UTw=XiLj_-bgIsSJmeYz@VC^-cFTaAmNsv)i!itOCch7OPN6V3rN1 zl7C7;eg?jhct)zv1$BqtTL^hRBvG^jxQ6o7S=lz6_PCr3KWAGkr;@(|FAWYxCD~YG zg!oEh?8~tXHkT|tcv!uog;kgac~jcDzX+x7P5kEm)5$$U(1F1ibMZUxFT3Bjb`hP1 z7-VkZ!X9q~x2q-Qf^_Np5Dw<|ZBJC(*PbBG7Ib>3qq#9c_vc@ZcSy|c!9oq9R_cIG@@Ycug_f=!&eW^WmE zK(}eLfnrg+=}b%^wtDV4+DVsr+J=DrUVA#ZV(4c>K(@DYACJ%5r%bg?er>OE?eJ+* zMew407gs`ZzjSLK-nRyl0CC=gg2jcq2exGw_16{b#dksfY4<49hlPbY8PN1uj$r<1?j2fk!(8?mi#Nb{sH4Qc~-ITtt#)WWdLnTD)*4qaDwAVFj>FR%bvCF^NSdAto>*Am#oHPcTxih%`;GjRo%ynr>a-l`by%B5wRuwd`EnVg&EtIGx zwB3jQnFcy9Y+=(i8o1z`S)&QCOkixVg1ZX30p$*OUmr^6vQ5hc2%7K@MO2h%)$2q{ zE^OD{^d>ffR&Wx^WmJQyDx0b89T$F+eh)dzHT5m11t+y24#`NbxpZnhD~3o4zVZb+ znZPnNe&zU^r3k6=!uOQEFH?+()y{5aH+%rxcGOXZ+$S$nC#Rp7;55Srh9-NRij`Cf z?nHydoX`=2SD`?UOHjK zPOv!#3Lq<~NlQ%nPO#a~#Ah1MKYfSs5}!}&fc^ydx2Ka8?0}3IB|S#VAiQ@g&b9_$ zslwwj8uRL_`uCQ2J-$BGba&~w&|)9cz4tA|C{;qWvOfF0Z+iPwwus&?s?YS9r)ByY z=Lt5;oE)E_3Gwgg5X|p2XzA0j=26;nZ1EdsLykAj_Q7tO=tJH)=YqUg?RYsg-c2Yk z9p8mqGp0@QQHbg8Oy4A=cGgPzjQ6fb>~v_K>b?8gbiQ|p%JoBE^$J?9pk_FyNM)=T z`pU!n;9JHiv4!27GTp$H?s48^et{VVHTiHxNRcm(c*^ccCjWOVTPeQC6j&}RWB7NeYSN?<#mZLR(8iSF z&eu{vPh0tinoQme`IY1&kFGR6qtls_^)aXLDd%J%d~d|>7{1@bw~T)U|2U_yF6K1t zWzMlw_Qf{Pw7}l-`V4=@ZuoJ+EyaBQcM9kGELX7p8+}=;gki(kEPs(ZJ9hf4xDMDk z{K^;L@4ndLf2PLb<9n9AP!A0q?#Hc^``}eF0c3UfgK-Tt3)^*;<@BtO672O}7g;OQL=>x5&>8G+ryMVMA9%Bs6=UD`I)Rw=qp?%Tx5j91V#=O#lPf*fd!Z4C^Yn!n zoq!eBwF_98!E?j3|01aXsFO<-cmJsH^KM<$`Tp5j9jk#4Q5Ktp7F>lVDK=B9TNR!Q zVyBW1j8&rLqZeVZejBYQ+Q~~1Vt#cSddg)hU!149vYmxpKzV?_7BsLwu@K0Y|1Vl4 zs;=p-Vj3OIH$je*tc<{8VtlE8@Ky`yHx=-5-=GUV2gm|R+-pF&FT#Ew{w>k>r;_=v z0`*&FvKM>sGnf}dcX01@Bm74czR~RuZh-veRPw#CnZQDzzQ_XKESIzBDeNIq)ESkc zKL|=eU*K<`37;nmhc?#e<9|~H9*E7seeMCI{S9a(t#-zKH$LyUGP{oEGb@K|jw@<- zLuE}CjKxf~(98LG|64V#vn(>E{Wkug3iX@)>IE+t_dLB^v@=Q-O}r_&tLXg^R*tmrAMYZ2`={gFA*wz;VW zgC}JJCoo{J<^*iPRHX=cqseRr9|a5k$*v`Rx4`EUP(zF#@9^Vhe!!4p3Y0_ot~>;+ zp-`PC6WZeD0ewz7=3&G%eAMB`d2_%d>Vv7O({U|#$Ye}nX21|Q0;J-j^RWgcu57#C zQvP(%g7pU(&*b;N`y1So8R+SjN8Liq2@9O{?!kj8APWcfrjlz$-fb|I6$f|t_25fd zm%u;Y5VV#)wgo#7!sR%Z5S4>n(95ah>|uINCVR9I{8K|&FqOP@BvtieYMtp>ziB`} zX)9Xx&=7C$@N*xBZuzdv&^=W zxMJOaK9?WRTcL~D_t34c;M^g`UV%>z@z7t+n)pT)K6VD&*Uwa%8=QE4eaZHMMHyxp zSn7*2sq&v6}uNxzSSuU#(_$9Esl8?Z=q}9YNrC!;>ow8}+~`f&SaIJ8e(oOwh80}E9at9- zftoJJ`~b^!79LsL*WKw>`>C&2V^-V=ze%{mLV6kcGG#s=R);T;mXM`xo920#@-Iy# zBg2Q)eOnElr@-ICIuy2=I4Rzm!WcuErJPT?1Mo<)VQyp&+4nv*dgSm!Qws(hDV z%y z7UWZ((Xx1gtncB<3sgdrEe>g@mrA{}8QFvvn+Or2%M`@qf zSA#c9+pRnaq^cC?-pm_Km^(sFr{A^20jjw~W#>bUbSDsZI&*p3a~NMCXW^~p2pe!o z%+5ZdJ5^9Gnx()wXhC^_G4!i_YHZ4lvx1%e*`BLCdifPtYnNk18LWB16ePb&Q%ckYO33AiOhRfw z-r^PxaFR~WLn`$Ej9tLzYSMe$jsG3H+$HW3@_d9m|D_O<*Idv1q+@YuPXJR1`pbMg zKA2>}e;58=eQE4%z1J|0^OG$(@eD#eCz*WI-b?SD;C;SH{6xSN5aIuTG#vCmYq8*5 zb}G41ZJ-o^hI*yQvd+R}Z@Qpcrs(^n}PE9>#C^PxQ-miPP z;9C*rJpATzeAm~tK(l$nnGTjwvNZc~3Jcd&=Iukk%tarkAEkdZpgz;KjDw)?x zCi`W08N|5KPP_+wFM@A05$^~dQaI1y89XNLtQL*;HTAOr)C;!Z(&yl4Z}b{`Y?^?7 zy>C8vt^H~vH?LlY(VAah?=^wLpNCK4h28VHGWc(DPYZbFyOq$&0$<&{9A8}nE60A? zR5!1-KF3Fhao9B%l_3S84yF#{*U~bdv;G@eF0;|16_M-aU5mJ1#i$52+I>w?SAdUI z&$Ig70pi6zPi~Bse`y3}qV3dUrf6U;_#v&W>0ge$g^*&3sqGHIl08N%Oqu5^Xt(bj|J@3`?en_ldpV#E} zZ*F3%P4{Q4eRn<(u?0?=7s+^#4fAITe2=VURhDS64?QK#TZ_B!r~?S9^B!z-=KJ1) zO@bvV(K|+=4%o{=!wR<-Jn+UqmG03)?`~4mRJlO;b8YHy?YRvB=eZC}?M=SAb54hO znp0r`lg|Me(EqoTfB2V_zom79xkGai^THh3>Gr?KP@5)$g#n;|jS0)5uK`PdqUVH zu4*Z?F$<##TK%{>5gM?N@N2(VbYa7y1q;rtUc*)WSM2X=zxyBq!Y5bGVTM%NEWo$7 zMCUgU(!GGE>pk@i!kHtk$jInm{d7~U2W5CPy43(vkWC85!B=IYQ_#A7B z74yT~AkM-HC;&=I*FI0H{V(J6>*s5yU9RtUQCA^a(SWwBScpEx3_tf~Qv>R4K)sz8 z+BsW;TV|{jJORrBEttrhd3m50de&&ce;$70=Fv&=f#783tj6zJ3S$<5=!g@tf}Qvl zL2sOsFjMia5dS9pFUJ3~r96v`KpXihJnMUxV+|x%KpN&_&W4use&EMDM?c4a|9s(? z%T~*sA6`Lyxg^1B^tEvAv+kZ z9|Cpv!k19auoIs{L&*hPIizjTS69yR8Drc`eVoFfxhU;h`D35r{nH%^sE!-A5#T@P zey(BlWP6U+>yhguXjd@)(}rVS$ybe3i6I9*|5y8TjL6=J(CjtGa|?|qT-B~w3Lt{*w)Joj*gQeXo~YVDIf+AOiP7= z3a$u%{t$Sv<#$KDDAmkN;}(0?ny* zN%WmyR=*qxAK$ks-)f}h`ENkpd9(Zt;+T(EFG6~K5UbP;6|$I&Rq4ybZ`tfu?dbDZ z%2PJ@ z%BuEabeI=!H~bMb;LXe6mC|HKJ+yx_Jau@x3;r14O$O(`wHbO^MN}jM!hG6eGtgE9 z2uewUuMDin#pJdNEbDT+-Q`QruV2j+M(JRPlWkE*Ky^P(bRm}O* za@unzIt9KUX+SeQkR@p)Puc_x=rt4YTy6lhy+fgAmc6%Om!N5$3IRcq7BK1N^1|xF zyiAyek#k_oJk0Und%`5-w?J~b4*5%_W7lSZ=!7K!_^uW-Q^+425EU-0BZ`_2pVP`e zJ=P}bQvzf~@M7d6J^n^M4(HE?z!OZmys~#hxl~QkTA5&~X_{v!GgI3R6qw4K=ojb;(U&*yAC|vXJD%;JF}v`eXjK+y6w$4lL6=$~FX?bE zL!JSe2T9Euft_!OiVFey_f9P5ZjMuDPA(nuIZVeyqrvUDM7$-qgrXYVIs0ssAv~ z6+Tz6UQpgz6t7hzS7t&dn(G(FK`w`!BS;$Qzsm))eg3ie|6Q)bdV*=JvW{Wj%A6Sg zXJ9025EZjv-N`FXbLm-HUlYu3#Mg8%!TS@ zi+$Udf4STM{$s#gfPYJe>B-eh==PKdJ#8h2F&B2*aemG5(1WI>Ov?6s3K$Boz-Fc$ zOJ1KTjHv}TT7)zBB2rWRA|!3Zr%rqg@}W_VfwFzfGvoQmij-tPH8o2h3kTYZn802H zL>eFk;M_CxA&5eQ)M5sjU;Qqq#=D>z?}BQ)3#x%LM%5b>_^kwuC{rlNX)f+yi1Ngk zWA<-g8^D}Rv!A{spJE0`g98KdDR~o3jsMdZ6$J+5Q)LE7ra%K9$C{R$<`;cr_e%Z% zMg(zMK8O?TXfH+QGf0h{m;Y&`1sGppOeSO!mJdoYWpU@PF3%1~x*vBs+?Br1Am1ms z4OWx8_#D=be(b1v1k@%uu7N-I!~n)koIM=~34cW)bJ@y^nO^a9B{ zjmDR}sE&aTW%?2ljOlOf*TC01qR^Pmw*S2oH8JL<*`EkJz}~VW^Ejm?E$XfP-!oHqf+aCz;3y0dR;TEOOAlP;W8fKsklU3I$W8!vWz#Y6baM{-rfCX$u&)b zdlv3GbB5nwuDG}he2G?UX3`npUCH-5kwUpj&No^ppUyw^`q;~%;BifxIi0N55(9&Rm2QXcIMNM{K%*`wy3IbX)8O!~ZuAV)U0P0gaTX+K zcZ;psputTVLAC9cy}wrc7^RtXyVB*f-XKo&j$jhJ_~bDMeup!7cJw-(f_Ilw<2~!t zdY$mUKMLoKUgQ&SVlEZl7+wUgX@n=qCOnPDlLj;{4L;BjbqK%Ux;SC->*fla_0@H2 zS%xnf8WR?R(U2|dSe#~(g@bV<1X@Q5cszkg^RNnUC zD-RD>0^TSo6KSj)s@i<`X_NQH1e0mL#p&UJ%Fpc0{DjoR`=t5KyOw%*)Pk=>u`v>Q zpf?=SN5AMi4!S|@V?~*Mksq#9NzIj6eRXUSQjcyfmy$wL(vSJtM> zBRKZ3fss$b>;4VmU{gth8BfPV0l)i14?k2H3*8WjBI13kJyCwGmwtEROo+?+dpy0= z+5&BA5_S(&FXFCgzg60k&#)E%{edpN;&qbT+P1+CqV0kQk(R88v_uvcDOm>z;|r0~ zc+>8|=HY>)QzEpAJM0$t!ooV^nGASRN(c_YY5L)yXfN6+jaDLbe*rY0m=6{au~(%3 zo3HxMMsDN#rEUCxxZ#e|e8vu3Efm8A>-5JfF8bY|r;DFZV!vDiPlq~MwL>Z)?OB;k zlpy0Fl9RqWOQ)0c@WX7tIdJQsL9lU>%B~4g{>e7$NHxFJCXT$6pXo*-KQoNfbsg2| zaN>!*DZ-7=|;aic5 z7vJg94o&DBAh_=)KZHl!Z z1${vzn*z0E6>?UR4*NOgBtyYFUGHdF&=S;kP0=Rd$|P)CJ(O^1^GxOvJ1yf$Ik_fX?6&4A@wLffdo;&v)Jo7`P5bWEn8PxwEyY43`0r%ap8GKk3Gl4L~B1 zS_Me3RLFmZd@-VNi4kp^+K)IC;=NFyfE_hJ;ZiS>&|trDReWVh3-LGk{9kizl^weES44vN$C@82JAm_YeQiY04@V|B+&)y}%v z)yq8mdU5+w293I=2oi-!cht|i)=jp$Xnbi^DD(tIUsfV6{a>U36+0okI>(!%qh2OXZSfdu=WrJf(P zKuQ30p?}GNXXgRy$5AZF?6UGaU*tkJ(naKA@MvwD1gjds+0NgCbd-ZtbDN@36-Md< zTj5t$7#YYp%->@YPBa1UL^hJ_l5+i4Cu^*brwE82EeY~9y?^h_S7sCTW8(2Dh{ugE zPx9+*BSy0PoS6j4Rw>`+wqOl{ktY82ycKC8?In)DI&6e=q(z*;3MAy*2R{0HX*2Rh zBPJ)|{ywmgBxSZ8Lc3xA1g;A1Bn#Aw_&6gtBh`jqFTW1F&;lvwN#xkrORc=Fk~p`Q9~FCj$cgyJ z!#Z@5MqU$^l-AKIG&SIGPEq3NHE;)@77kV6Y?aFz4t2KD9q$0aMf(C6lk9jYnv-6B zBkO=iGmSjws-ktM{2stp!9^|GW{ z&mU*d3?Pr7dl)rjDeq@PYTqv!ihkDq6Xa8$tJ?1hUT%S)t8BN*qHdCC0x{+{J@xhYK>MWQEL!QQ$kcu2HH#Q z$-MNPF^Ck&0NsWam?+`;Tc-j3mPVo<+F%)e>6G^n#Bn1&y9*vv$hJHY(zC>HdW;br zKHgUafBA^!6*VdMPokvfN)1??2?Y%Fm*vyjT~Uj(WGOv``!YcXhT;7IXi#y69W*lm zRyy=PNA@{6z!Bdk(Zr&ru*4G#RAGUSpZOwzCMfB?&^QSjdE;l-|1E)TyE z=Q^VyZGSZM4Q8FU_YjMQT;U{pH1v4bfZs3sXtu$M7f?$J6iU(1g0L9W2Z;`(LMBMU zMX~7k3RT`2B|VHaMzu1p_KTE%u`-*-x!}12WigYN#uRlfj-;FPc%O#6v6;dsI`74b z1jJsNfcpTia|QZBb0Z!bT5t0>`$PZ1d&<3$?p`61%}PqGw!Y9Wa4H?1@*O44^0E?# zUOoU%?vk?y45aV>T6g$1XeM9F&+oKEUogG|tST9Nz@eidxAHK}FhXzV)lp4bs ziUDe+OE1KE5^BeW-d~(!hCI}+m)l}ioR-qdzVJl)LV(>j|E5!NPK@(zk`K;el|p#< zd+_UR5y7+<_uUadWa%JFG*qS3uuojP+Y74h;g3tKd$TYL)ctO?Zn6t7e%GqtpD7^; z*ynJT8y`386>BVq!C(AEE z1g2Q%yfSMZ2Oh(=W-ZMfJ)&nqH;3q%67WtyKEj_b`ee5#-v*vY7mtzMJ}>vS!qlZGd(dk`+l|SgjC$7R$17+8~)Bf?zNq$h_JD9nQv6DYq(Z zP}ic(zA<;`(8?P)iQh#U> z?8Jrqii^+HBE`Zm@Bgcp=*#<{CbaIbmZmdWd))Q)?ni0uVa7!?hSnkpLCI-ztpv3y zb`YiM#dmK~n+rjifJNh&=^S)&fHKw^g@d3C*3jHm;H@d7=xB&4ivJ`z>k8Ru!h!n( z!uVY5)EoSxq+GWfLbqta^2B;OOSH>J=WRT zkGKb4cj6n1+B@pmt-bAb*b*q?%HrdC47j?cw*ce%EFUQyx!{36U2CeN3_b}ptV@&n zEFU+Js?AbTHDzyfX&8;|n7)B=J%Cc~1jeJ!V$l?e%LfQZ6VC~PFta_|DZCpnj3wgrG{?;EPUmwtNHYW66Hii{$ryAc{om{ zGWn=y4R{hf@8px736eLwuW5^1nB9mp=GGMYfIYO%(WXBfsKZF_19cJdp99}GU?J!~ z!%dJ@4nWE{CQ=McNXgK>M?-$(BYE*Uc$Mf6J)mI!0hE&piyx~r6*;B>XS{q8=sPT| z4v`!e4c))LWGx_(vDGJHH-^5J@bztdR^*=$u15XtI29!<8WAW862t+2%hpmOw3d%6 zrIFmOSMbi@H)4iY1*mj_q4QfsUNi~PgWqNcr{e4DvA3Ry)v7qkCPV%}J-1wHSC&5- z8jM&})SsU!{UMkLyGzzm4WPTjW{A}nC znQ(%5(z&Ggx)+foW>D)KKAk)?YHv4`%Ctr+C_94n1 zqRD6Zh=ZSwkmi^LnRFBIGG8P-5dyL=C-|q@J>UdeLh@>Zg(qeV5{E`OogP9)Nie{|dM-M>Q?0j-0@HjqF6p0giCRj1uV2$F$ z>p@WM$Kh{_s2r1<>-K?WAf^mv-f!yqLwBOT@M2PDv9;V0Go9vv9e^rqthFfw`2@2^ z-dA_}ER&v-1hekV)8MBQ5d0KGcb^y*2Q%y&o}Ks0BhZ zlb5!>i2XuneAf$z94Z)NV-YRnyf&jMFAF^#uD~05Ou$%UEJ5UH5AJEfV)tQ;4?X`H z_L8eiZQwsX{P74}59}|ka&jGFpSF^Rf6eRUjbSsqJ);ac)+zp%;9;94`WUE9nOLt9W2<=1C9>kplX_J?%1s&S@K zfCOa#9akkQ%>B`{pRx`(qf$tc9Qs2Odq>b-7cj&b0k(k>W+Q?uyv>mf(KA-~hNV@T z`j5U;OJneo@JXj@?;4z&z==G}FXCmZ!zQN|V+O7#6+xE_Ixa8V-yd3bDSiK?bm#sj zrVoZEvL4G0{ynS54viqy^Yd&2G*U!|Ht;s2a`0p~tms{KR=}QRsGru^WGVdKd}~1( zG|cqupRZ`pp{3V$XK8c=TEt{C6qFAaB3i804l3SBW?#??uwK!FQd9!x!P`bb&o?$; zQ2IAMP$+vC-m#-NuaFSY$pT_2!6%IFE?DK0mB^j;ricz<>v8%Z$#EeSYhwZb$dXGV z!otz&K7=Q%{evh)1E2B(|0IhpIPh$>(7X4^Vz1=Ku-F@9BZvl+{$kBAnnv=t%LIR} zC&X&}o)fp@_pjm^{Qh0s$bSjCBV$HQ07WfbN?HNzQnZ&Z7UVX;T6BE?_Mu|Qc+-KnhR08)v4@0m84VbHdw(6l3uP4>ut~Rd%(?U#Y|76kG*Jz z-6HN6?65n9cJaLZg56L?mYwYU87ofJ$+eBpaOPJ{Y3nLsY*@Ne2aK(X>mPf zl2=)WLqnb_Xw75WlQ!FT@8RnN>(s*b6FgHm3ac~+>i@FDJ_WXH!XExJ;~xGkPUOMT z4zye&zuv!xZ-869jod3Z9^1n=3J%X6{+!T+-_1hMqX8926;ALuLaG;EHtpfF@XrAo z!Mlxy^;EkSb|aFp-1jVeR0jq9`h~^G>vcU%k0lLH4C;Ee*6PY9&vcuc;gPS!Z zojeokBpn&y@kV}+SZ(*hTc2KzgcH5NHMAF0G9_^{>nhQRo0$ox`2sAW>HfLhhkY&9 zEnsX#qdK-MBAgeuKn`IEfqU!%a>et2du9qNTTIZc3hV?oH|gaOy>#0D9@Y=fWrFfV zSUe?;#iem9F0q#Yi-ExruuOPDc;+(U?t{1*+mcR(~*5N)(Xn{dY~1o zYr2rQ89pnLsZ<-av3s`AZ!f7<`?f6l1IWp<$|mPD_uTU2WQ_Am-+rl#ENotZpI49V z->w+jYMQrJA;K<=?Kl6^*f#6sVm>gogMKi!C*xz=5g*&X*#C0n*veGX0EHSD+h>)1 zu)JFjC}TTI8QTLG+Xs}fC7b67?YWzsy9v$&g^&AH*dB_*_Fx>g2kZy0stqG&{A!I* zMs*S#eg-&{vS~R~N>hL87DJ9Yn#sYdU#n1a`L>)pSMwEOoqzdnRqrj-(-YK9gsGS`?f}LNC zO-Q>L?J-uCSF&)y7)|SDgR0RT=SCJ&0B<{bn|eSpiyO z{2AtCsnV8>d=3H}(thb&+*8_#6A-N>N~Zg4BVP~tljR3T+w9s+BRIA_6_hR0PgF>u zLCR`BlV*&iAHK(Eu9VZ<#NAGF6LV!+xxM@f${^pCqhkG$zRP1rP{{;TK$*f<&%!qN z9-@-3i}!tEyzj;K;(zMQl#KBzhkGnwg)xc=MaY@fe~vRKBTV??nTulgdJnZ3E4H|>F zelfQ9 z86%+taG+tQ_V7F-x1eOy_ak|A$gqOc1V}wV7Xsu93I@m zbCvIsC_i?-b1&r@hg_7i5>#dq?m>Jx8TY%9|7IgfG79orv2bWZ6u9412j15ox;wHT z-q#KOKb9vcr$G$5%IT}^2+SF}HZtebk`ex{G zexF3%I(4$W-(L0`%;2W;**EP_`~vIbTl+tS)^?kvuC&pgmh%Um>YX`tvj274AGiT) zT&Z>?*LY5StAXDU0c**RIHjHVHXND_m{pnt_!EzW=0)tjt0@S{s-PTVT2Xoc(3A*j zgR{1j{?>2Lg`c6aojgx~Cso1Sst4rq5ZQxL49YV>y|EO!dL<1~rf`~%+(7?+2AR{t z_VDGRHHTzBYo4KOMA#D<8N4g#z`2a)AiM4BPE98~xrt|au$tJu|I+^)#tLBG+oGZ9 zf|aNhEAm*V7IXHti;w(PwWb}7*5(QS6{mBbd};v2UWnPe0G`eTc~S)Qy9%?ts^a_D z|92b;LVcWmZ4sIw%i>xbCP|3D zN7UxliWSX>-!zi6Nmkzz^T|_EtdC-#WcepANei6jr@R#LxW<+!@zBR{>VZBjv<4@m z+&^*py(TglrQZ=ReHCE)Wv7OuSL_OsR6QoZ8k-H(5yabfn@$kKs)*&$7mNToIAg8{%?JPDWSWMMMByA34r{Kkve4ru8Ta!`$T&g zWaIPjP$OD%SMoj<4z2F{v^*(mvfq0C`$~5H7I9?@qDe-A)%~ILe$o(D?uNa)SEbi~ zgm=%Y=rv0y3x|H)S8NL-YED!2=*J!g^;fBE7(Q!MDqGkTGjzq|g z#zjHl&4nBJP|Ss2)(udt8{vl= z)aeCF8I@btA`}pf8o>!NYHI~^I&?Z2_*VUod~gg-QrW?Hj{okYv;mrvEBuXgF;j3N zrEo=aLeVnC=W^oh+U)Eqf=Q|gD{I>=*dwFS#B7DdWjM4v3~F0NJtew~{!}Totw?aI z?Y^mk=oq!0@DNcip||*|eV`}F9~pws2~RwrXB8_*#)|Weahy?|OBx7r2M@!BZmcBAw+POxS>X24Mr%(Z=$O ztFWQwiq%L~aC}g}37!;O*|>;K5WSf2q`;EHvDnpe7ts@1oeJ_qRmXDcYtXSs(6KZ_ zUpC36IsO{%H`{(WTWxcEOjhu{t7m9ztKe;^+Uc05A7cm1HL`ZXq#JL=c_KE-0Xjf3 zRw(>Wb2b6{DUrJDrkdVRYpkidaG_RmJmy$3xpiRP{tZ$J(bvL;Fm`PxFUJ0$^+L!3 zA2Hm@OiccdeTTV2;D_4rOKAeq9^8jHTuD@5Ab-~W*lCVA_P~toh!m6HKhwyH5JSG^ zUFc?1C=0QV`5dDmXS-7<+wM5yG?WD$G%NMCD$q?0Z09uT34T_?dYTvBF@yHj3-KOO z$s(aB4f}|6h6?s>un9?w4XoJBITG?@AuZ#ov|AL93c1jPkaa3?r5CsdaJjx)%qJ z25@g7@Q-*I;TkOSW|(S{8@Ka5c!vukM#kOH;bKRu(4g9D7V4lEgy#aYwvf*IzzV+# zI=%lf4_P0^syv(<$>MUSQ3A%efHBw5-e1L+GgdS=VOLzhxp#p#~OuQ&N*x-z8wR7{i4{k@1sj# zJB&4xIVE)hlYd;7bjl$um1_}zHB z!K9Nz5vp~gKs8)co}q2UbC2@8Sx7_6q2-m|KTyXPHrMe54ko{I;L0}igSJUEsevZG z2D=7pVFl{J?=NH#dhod-lmF`g^_Q@Mu;E+e&V|>GCYM$I&lOCbj?(a6G!h*)S>>ks zuR5M$N|Al7{Z>!G49GELgi_aq# zJ(F)eptk**A}h4RO5gL!Td4P}Xdmd;FpQWAzak~)L)cH&z&aAx40sq6cszi9kVckD z@ShBf8rtWN;rMp>EUxKJ-o4!`c@R9ylag*^y^qX`cp-zc}nUW z^vxP0bf#CI=Vi_sOCBTH|uc}dPiy-7G7@dSU zF-Ms{p8$)k@{K6}7PWk358f)@P#QOMs`jm^9%BO@KW$qD^Xqnl$Xh$W8Me_DVHeHHGPtgDHIhRnw58# zX-$$sU*^{-(1A{`D?sg8iS;j&f3KuIho0-u^XJ6vHPaVs=v)$`UJ$#wN7$6AY1X?vg?;=`OiE;iO_bOog?Kru2 zK6J8Qsxg^pCSDD-#}qm+N0eX-h4Uh#iL&H_vas&C2KWz}fb~ZA9K(NLJTJGEdNDOD z?}j|!wPRgzU6{r1bvCVB+7G`Y3P#*5ttlOhFLxFf_`Lkp;=$*V(r-tZ)SoH~{S(^P zl$LfNhp^B0Iri=C_&&eit?;aSr25k2z%724z9`@-+1-I8oHCj2l z|Ex03;og764^H_9=9E?pPRyGV8HA+njqO3|P1N8g~nkL9k_tF>3D&G#~ z*K9x?E?*0{%m#k9*ur-Snw~$-*UG#4JJ9PwiFh$l-nkh6WtELn$zE+P%B7UXsp-Ig ztIK~jNbyy+MyUQXph}IEYm~lRIbN%KhnkniFJGymMU1U(z8dD zujfdE#vp!iP152F*qrB%$!Sjy3I$0D1%5FMyB+lC35EXAOsNXK>Z-taBrVRwoFAZ! zw_W_jZ>4xCLyIy4qb@xU3Q*o_6#6h%${#a0@MTSoF9y8x@RikLf&(Q08<`2RXpSVo zFP}Lw9B<}U{xb|z_^RUvjFplCot?oN8cTY!vKqeZ&H`BD?NtJ(G zdn0$~;gQaQvHOrkm6g%N8YZ!E_58!iT>lQfhPe*y;0=sy2^#Ti+51$p9?=Z@LZ8Gn zr}-wfIYquFqQzY+Z;in_Kdg8~0g*F-(QUCWXQYkS`4jNg5=c4qO1Flkn6nk>PRe>P zJ9|`?D=T{(8!~=rz;MbqetaNfe3pMO{NH4bw*>UTq2q0VYsNnkh>f2IJHbBKps6bo zJx;d*Gq%7gh8b$lcbX7EgX{u@+P`*w>13OYZlQL4V@YjNa$Rjz<6+!|`KPhwW1DsI zlbl*Z_fH@_H1jf%{^ZF$4EmF(wVU@KH zEBRKL0=&^kr5Iulz`}&iAH&y8tz=7)w}lHmu0x^Fngfu}OVZ$vGtm?ZEeXfZl|h&G zhQLPc^F8WH!Y(!abNfa$H1Id7Pw?LgPR9w}BJ6VP;cp4M)V$_@v|n3W7Tn19ftuVH zpnDqptPfH!YjV5P7z!dAOFgck%Ur&Gz9 ziKt?V9fd=3n>w_uP4FU}qH#-& zyF4fOQS8aRXMC3@z^_6wbSKAzvvm!S*}jF&^v_BeImnA0bzv9U_2=qOk$z6_pp0Qk z8_uDBfj|R42T1%Ckf68lecb*BSLlK7}=IPy2}FRFDtaxLXK8GZ@x&I^-$dCHsfsOuutg;bDntktlF0aPgJ zu$r<8XK5NZN4_xf?cq_ujJ{Le3+;+IwK&^Yi!*KDj&nrfkRI*? zZT|vxei~CWl;hXp_ZmN~gwM~Yv#o5FYSL^BBlBiBQPI0Lxy@6sCR+@hm!9m~rJ7uS z6JHM6_;sbOy&1am@?88EAveHoXr6cz;sKL%p8#5_kwY>2?qH*Mk^L$$Ko~s_(qb0A zUsOq}xMscxU$1V#f3can!B5Be@5*5Xd$^%3wOgP1;MC2am`^y?mnM8f-@uZmn)v;h zUTTjfS(F{=Mx|UQ`lE$?XEG?L(;=WwZ$@?W+(gf>L7wuW->^t-KhtQu=y@^=7k=nO8 z;)o(+U^MjD6HxQ7{|z0VTX_~1<#U-vzBA?lpBZHm3TSKyYAFiLC=Q!WS*?!X$w5<% zq;O3=%6zJNfOAlP9>#ep9dH3ghWx{(Sm-uRax0zV!k8&?&%^N20vmY9b(8z(ortwY zlN-7pd_7l8!PlvZ)D*-y1%m=fT1`<)Xza2P%Zp?O;xYTGu%?g%c}ye-zH?sy@ens@ zHfcBMHc?skKm%PswiLCjC+xyrO?V(R0rm%PVg>>`8sCJyX)|_N5T#cv!9NZ9yi%}0 z4mq5wU9XjA^&ze=a(ekw0#VR2HBMXOG=;-eq3>1NExkT3Z!n$#hRqR27i9%rM0{cG z*6qH*?%3FbK;l>pPK;K;&Q}9G7*=HH@bHFe?UpvsM#|}d^%hp@{epZ5GOAQVW8I;Q zb%!$69ijkf+NwxrU&DTC8+MH9_}5I=L2aUxgp(wfcT_gIkwe(te2D3{8Oo!&lBoPCqN74$+6~oT4=uxac;q3~E$!{y~ZLh*==V6OstSLZr0j-tT=%;hx zL*%2XoYi^hy4zB7{fqOSY4P$W#43y>t$Io3(#T(7)eEV7bWxm2tZp>~QHDi3cH~FY zYhzh??g*5AnX-JK$k8z92i@?2eo#Hyk1BIKd0Bq)UOd^qs)aO0?z~kk)SDCHO=V5+ zCh>A-GyfKC`vkqix=W-na2bheJ&e|5+o(0$`bh$8=Jl8I)hqcLE!P2h4VO|IL~rj} zoc>MtyqT||)V6ArxkjvzZ%HM(LR4m9TY0<5tpR1AQSkEl#@j$mOuIeMofzdzT^?SY?e-bO{UD#NgO?n^s!3l#0jM z7=64oD{-pUa2&nBXnWu*+wc*3Y8vCq#|SUPY*^sPLVZr@NBDj@Xs?;t;5mOhi6Dn;@-C0uxw;OD%X1Z@R>?{pfV*~EY0L>lgW1G2M)U1QQ<&J15=>X|&U3TY)e=6*_1N?u>I-F01Cx<|F&HHYB{9B`%OByl;p0o20e>Vnx2j;N^1p;$L zQJG8gq#?2=o%B{g#s5FA@XsKfqG0&O^NQ;mSD{O)c3wzKO2m%H7arF5eMld}xxi%N z9gra5<)pAry-&lP=6J0S+yyh9)<7=fYW%y5k9YSq0`4mJ(J3?JLlz5-RjBM~g`*bM z4Z{kCs8c=0q}E7&PMAr9l~b&jM(p!S4Pv%>`5VTfR$*;DJohyEO?5&?U8AWEc#AdN zI-(7T{iEox{sF8ifTKlOXR>z9Agl?3o@MSu~QqK$+{}duzF$ zLAo|U!v^gQ&C0tmAMO^te0}`?J@|i*NIQ$Pn|U9`h*oB_W-Y*+nIn!wI|_@2UsdW5 zl=^=t5v5I1N}E$@su8+p;UwlKl13hdQNmnA?ZlNntweMl@A%utPrnH#37Nb*YMMvm z;c#OQ7d`tSm!>^w`8v^`uFYbo@ zfB-88LFPCk)&MC+i(e;pRaCii#TJ2m^^(AbH3`bz1IZj@b>cciI(_(eI#gZ5?W6NQ zbPs|Cp4Fs{bz{Bwa<@jCGIj*ki&|OA^F001guHw67PPY=V{tmJF6ESQ?A$;Go-cX^ z<2UBX#P6WG#NbfeC)Qnq-`nb9W3N}vnEi0pw1Uf1od$(cK8%$uM$VG7IC(6cL;k?> zH1tcVPJmhnJ)LDRC{kLWKsE@ZySs87z6*K&I~a@aL*Yva(nXc>oucuinN2ijE%s@w zEp@mvGwFP3TptomvLFzRe+WJsOu(SIOhnsYRiwy~zZQ+4v~%%}-eg|!W{9a_j)(9)me&X~@;q-rx zukPu+SJ8hbLURCkV#bkPa&1-n75N8r5Y(eN4h7zTCTSJ_)dHJHhacjAO#$KWo1iYt7 zjj(hml?~8=J|wLMzwz+*L8D1tQ0i26NoamrX6S(x(a;QNB~*Pg8^C2ar+FlF|vi?oio*EW2e7 zqjD|Hd}78W&PYe7?YuBl5diR+X>s~~8V{HR3@uH!XZ>w^mPQkagu=+?1 z!2T6}x@gu_2Qtlb14GP91H;VA18)au&eEO;?UYa%f+-1Q%z2wA7j~CSsrdJEW&P-d zHd_GRdCBhz)>#Aj2P4M}Y%SuOG?C>+wew&|H}3J1x3?Kn6jXKad17~ zDm40he4DTx8|^;+pSYLe-h_J@?mKX|u{yrBDi$h?#X=Vl6N*|l1Z56+TYXN!bNbu8 z*!NF0PX=UgCagxb^oB0r^uJW2GabeA-(ciVr?=@_9rA|`ZQ~1IACnd!Pg!)T(}k3E z@R^bztwqZPz;JkQTby#Z4yATCYgv9O_RUgz_PYdm4ScwfXNQlVbB7EG3b+kgFV%~J zQA(3&z5VW`cY}gz%?bEoKm6bX$dO);MDwmlukhV@qn6Y z!duCewZ4M&_A-T@ZACN<+S&OIzdON;=LfJuVf=3QAyDiOK%b6@YOOS`cO8QNRNO1j zSE6K>aif`UGd5vXHS_<(y%hH*+{o}Nj;vWJjrfIx zlUJgE7))6A6W35{&P0tviA#W{ZfP%-5jb zqp{Ik9{*_bRXFlz>~IsuA*eSf8ZwlCh@gn+1lTklRN*uf&-Di_dm~sqNQ&$cJ3V*4 zTT=HV_V7BZ6LzGPUMQp%0d zKegPNfig!@nMY9O2Bpk~me)WXZ?=)$J9PTP8(M-by`i(w%{&8A#JvFnyk2}@Uw?Lx z$a*vj8*uM{-k^<}GCKG#aWBkZJ$0^d$QW+3GxS#VSO|L;;cdIHsN=iLjJEG|8BIMa z=AVRhZg0rZPc}JZ3BvLRDfl4dCj%c0er-N{qhZ&_5X=EauzXE^H>{<4L$mvHgBqN2 zOz8?RPs^`xwq5A*vL`Pt{@tR^f%FDS*JzObeEX(O)C7ye_uxkV;eNKc5H28kXN4(^3f8@b0!fsh3h%BY7@@CUOxFB4jt(|L-uCyKRvR3MRN(FAI)@b z@6Ke*yNUmt>APno2&1=mPtv&%bJ>l)JPr?Jgv|>B(mX=}?Nb=APtmeid+vzFIE5q! z!F7Hy&O4r~SN@Cm{~Xsh2j}&Kn#1*I$BzC3uti!NH~_EtkKeG)K1`vfHi2c6gZ&ZOQkLGqyOrzWa{V&3dR(ztHbyjY;QuV^$NFRZ-DGz zy*|^t*Ict}DlU2)-f3EC9A;3qU+DTwg)n1XFR(N1rx9yi^E$O|Tdy=*^gRdfXxJ4% z2}1wlwQD;E2Zv&>5RupwTL;nwYMMa9)SO!!cqa85vSr!DBoRr zPB03t+9zm*QoC3vni5C=zUB?!>ykCVSKp(At=;$?z|{k=U}C^-;Hrt4GJ&U`e3vnR zr?vU>dP8Y_o8tCL;6HIJHN>%02P_@H(1?ivLyhp;lqoRDj_bWtXubzADI99#y`j;4 zq>D*tM``fm@tl(TzSzUH(mbK@Or6IqEgbDq_sU2Mo(qp(bvU0Jz2kE(c`VSRk`{@L zQ%>B&x7QzduICTm=@xHdDeYo3b7&ecb9KmIOBOp@pK?V9JDE##Nm zDF5hQI`2bYpZE@^9&$^%nQ#MS=$rx}y#(J31m|6DVU!(b z(O-AH3QD4b4|l?vEdRB@ZtR3A{@``~vq;mo|J`MpN4Ye}g*hiNIX|2QISP?Q|_uCPVnH*{DgD*si*#xDGSXMYxedr;dq}~z1+C-Ogi5xoG=bX2dCm&;b9*pQWZ~Vn7RudUi2I zX2=Mft-U39cHYI%yNdh+X$|ELU{;1mefvq@_D(_mD(3aQ=6ZegWLwEaR{eTi%{*!o zT8lPl5hILnFDuwtJ2Xfoi|lx()y;jcuU2!vKCj9bF?V;Emr##dZQ6iGQhOvwYzwS4 zdz*bkO+ihdTPy%2Af40ceN_61_5fnDX8C(V$9iextQfhkI@R3dDfff9(Fi6)iDQ8&czK7#IJ-9RFf;KniAHrJCh8+5Xm^ zLE3PoH)<<}AlJ}9`lTFO|0xH2lR=)h9E3bD&2rG7{F2^%0wNX9aQ23_z&FNBT+8}; zL!aVW!6J3BLRLg;0F-?vqX42IZ-fAL2o9nBhluCXoF%@WkGr_ndj1__$etue zdSm$pQxBg0-V3kAh>=)vvAVXzqnv9h83a2CSouc&Izt5HbX{%2dOlqsT>$wl21TrM zxDDo;@mz=W+~W=z6-onQ2gRgtno?l>3oprrKwHnD*^T&Zw_sJH-lXbDK!Pyl zl#*k(j`L}zW4IdJG)GuI8<%u)W!7^j=b@>|C@0siDXZsNDl4*1^?&6dC}H#0Hwpp)~mHgIk6%ZSw~f>LErA79c2DOPJ^soY^O zPdYA+%MJY2E#|v&ce(Uk3E4^ThhKuSeiBRSUctotoA6v2+m%f^AZ>|<|JZ22e3xI^ z1-K76KF)ymq(K<&i57Qf-|MOP7oeP5MIrvY+uc%`;K)cDz&@zEVkFhVSLa} zy@5qfDy4kTQtzq^ujpQn-fou8gSA0Zs5}~+XdLD{?jN|{rdlUl%L8%d#dJ6P5Gx$_J9A_?=Fw?xsD5+*D9y5 z#@i`U=w#pY^ZSgArP_|7a=VA91MS0&vRfNTH_7DR^@@lUB25<%n|TAUlW;Tj1+UsB2G>i{&oI|3aYd&a%P_8{{_L zX*3{ygt(W7wqjqIWN6hx84v9{bU~?Et;L|!A}F;?7nm$CRTe#0!A3RPNRnEK^R9;E z)4b_fVCAaBuJ`o%o*lKD;6e|36M%%lf45Bxw7MD2uBDv(Q8wm-sh-9T(c-kh*|{fL zwwGS$FpS*iZbJVP5lxqRyD2{3hXyKrhH<*%H)XE}=EHvwyoSPmSAV51i6>YswgtJU z$wW1N(ZWNI#0=d6ZzU_$ls_S{tMRXcAm|Xb9c6T{!h^M+3*ZiV9 zFWj#3g~_&Je3Q$Gqr6OXa%{%Q*+eIS7fGO#S%?#w6mVpL)>Wxr5WRf5^sgN%kD%J8 z&rAS>%GiRKnxaUV{9w5|jLVE(y%$^-CgZw3|6bKq-^!INaqQYU6XasdXDi`-m zM-=up?VWkkT`YeED9!r#TunRqG|knL21wvU|3#vaabD8hk*x5NWLG`TOVb-FLjX?! zKRNskF5)Ne;9Bd(c~*s=Y*X?nWfng;H9;xUSXPJGOW&)!j5di zg?2M(t(%QYJDEaoJG^l!;D(hay@^w~((VoeB4)R>7+hY!jozRXz^#o1;&2P_X#(IT ztaYcjvGN+XEuM>|qHTw_5!_Iwp$uHmMBgja6YwriqZxe_dD}iBHi6W1I;Z~h^L6es5z@{4QX0 z?yj(bc9`$R^F7QA?)VdNn8~!NdR4{6owa9HZC{0dE2~#3|5k2aIn1;Zy7isVr&G#K z=+k#X$4;r!@iYUMU34s{xM+7cJUe-yawk8I>jbV(aCPANw6X#A5Dok^p1;NYYuq`m zFrK$oHSia3?Zov8E+;M*t_8T(Vy}Y*OM>cGUsO68qvZmfvF_f<-Qw-vdy04RCE{1u zKVM$Chu61##!@4!Z+Aq#uq`6@-3NaI^=&V-Xpsge2|KyRa<~k7C5JTF0pAaSg(ij_V@Q z7)H_2=>1=e9E}={o;q6fZ7i4{yf0TB!T+1lyXM;yoLdG)?cUX&t^WUd5QB<(Bwh^P?^LQrdc}Rj=fK{k~UFs3>9L=Ea$xl49bUjb^ zF0ocTvFcn>V(GcW{Q7gLscdwr980P=mpg7t`1Rgx;Wzp!&Slr&|1ZnWrH)JOO3i&T zcVk(sWkh&wpLW98kJg^kq+Vaa^8Xsq&sThe>opPmk>f2w*YU(sc*7r<+ zpOyMW%iDpy=QBW|j<;ZageXHg(8$4U8>imv-_ez-Io^`-QCc?IojM+0rG{>S#|T>g zFvN;X?G`}i{vXcX1U{>oe(&YCcgo3I!{Aa@cHW&&uyEiNsSNgNVn)w;CWc7muA zYjqL?2V9s0(13_R(W2Eh!KGleCP;jVfJqcBsBLEe`vaG9p=wxaorEO!CX;0T-{;&J z7Oj2X&mTUSd+t5kbGGL^=Q+<3v+aVNmdF94{$?~y`TPKJ5vb)c+~tpLvpqc1V~mRL zrjWN6+p(x=HlWXh^>U*vYRu-4898LOiB!kHsFSvoEWqZ9mjZ7OEcTg+kv(g|q1&PZ z-L~kc?EfRo+US$y-;khQ-gG|94EAfz!u{!i%^kK=dxYwxg=gT`-xH7w%o2QQzEoEf zej>@cCeHQS`^tK+Ww6yD*szDkzM14{}u^f>0fS~vk;^6}+WCde$zWa_C<5`7P}ow^?0p7w7uIluT!$X|yOJE&09 z16hac2FwGRnAio$Zz@~=FCfwTUx>YP@ z@ET2}Q16U{Bs@V!^u)o8OilRsmI+KVwvCL$4BcU>C(`_Q;~0;Wo9VgB^O^@ILc`0a zY!=jW^?@5+>l6$~X*(Sr?UANS@+!};^w&-?9_yNL;0E|CWj$dBtgfDpJ<=q>E0-(^ zo{{MdrV)c?$~52evd9E>how7JR?AQ)NrU_`3mgl zg}XObF>H)O~1P6*3!8w|CZ3riUr=?lFSb+^c>X-PH6+Q=zB9*Q<`k$!OFU zjuO{|#%NEkIcn-G^z=Z|vmRFG=w#Cie|)a4iz|E7=uo})NSq5)hudSKr@%`Yx5!c0 zx=7AVf81?4)C+60#A|kVaJ!Aaw)MLAGRVdDIPWcl%~mJYcPVr`X5()m=v~nhJd@^0 z+@prqkHl?|G1QbuUw%E=>6=X+jILWhulv3SZKrB7*Wrx4K@fWGtNdw3L(emnwSdR! zIkygLNqWhq0!Dsk!Hu()V193>H*2<#%_ieHQJ9#9njTyK;rd)iw%jm(BfQ;E&ASpc z-#v$F_S{oEhw8oGa%%MjccR{TCs$|MdhUDhl~Xp`Ydz0AcpGk~Zu7jE$aUK&Udpz_ z`@*dLmAHq*O3Yz78?+l4#pBjmww)5;+YB%Q8Xd+6Rw3@`7?##Q;>#&~`R%s9!vCDkqXbq07Z_YT%u~qVFsw0s#?Cb29&-)Z z*0e(2Iuaf*aY@qf0ObTfJ1-Y-lKeEnIk3FcdgDn0d{PlTAi*0EV9O(~M0nDC5^!))p-4U?Kx#7_YL4iAqyiec>gZ!yj^H|>BI=F0gtC$nwK7{ZU zqxfM5NwhvS!0m0pt^w>ZUxH&ZI`q6qq6K9_|Jn!~V|Bn9%2Zo; zBcz8)o3=xiL~u|Vl2;HyR=Lp6_ryoZ7M4*~!#y2jiC=V3zu3?(M)XVJ_K&u;pSDbC z-_~~8GEtZeuVs^yLPp?>U9f~UHDm^dUq~^89e9fH*C9Zo2;LI8zd_@a@g(UoMGTKs z#3>hqgp)R*{Io?hqTk9-r(}mAIl}uOM+&`r+G2kkcGBZt?Bl|aDR&u8+6-e|l;`UX zor@skoPaz(?=SSsKNDZ=2Kp*sEK!OeSs|~=Y_Mn~qfE9Ne}$OqwD*#~BqO*9sS2$4 zgmL@l2QRm6WRS3yfcq-zd0z-ekI9$9`PqciheL8_UL?ns1xc`JO;&!Nh+D$Y82lx$ zd4@mQu@aP^)&boG^aS}FgvVZ|tM?VJf2Kttt_fC*3+L6|J@67no^&g8xaTVZ)huVv=H;Xi>5!niOH8K^ZYoP}s!S zk-Pl`yCKnneEylqKG=bGIb^~OQdkHe!S05XR49_#ha%TBECLr z)wZlDwXInbvnicW;ITw<1_}57P&uRiYdKV7qMXwx9JdvytM#jj`jcS>jF=?tgbhO^&{{M$%)>ZIJ1O6Ffg za39W3DaF6LMe^%OsTt(UT`AB@lcf@(k4Ev^BWp?9HW~>rP{ha4nm-4#O^g_=!)DK( zoieI6E6b65xLC1aWxEu5GaSB}Kd(51m9u-+go*i=99rdR3$WapBtt&5b0Ra0-b~zC zAM(O_R!ywlEgYs@8oV0@3~MGYKNDIrJB>`gs~QnMEj@xTq$K;26L)!?>q&B1?gdtsQ{XF?PBK9Mtia$UV{ev93%X zq!7rWIi)WNv=PrWGQ-SZ6AtThoNGd2gD*8ZtusS4BTh#E`smz|8qL@mjV4%6j;;L79g$a6bJ4F@Eq$94@8~D z!zQJ5mUJujOmLi0KmH1u;dRo}?jP&Cx^+is$*tmn7^rw1d-|J410xwd<2XjT-JcJf zq+}8o$rAbIZNi_Vca?rbBc=^r z!2!z;)F;4RKoMk*s_|^cQ$XvBAQ@VXXFHxj+;_F%kFCM(hCgA=IOoLHqBTuDFRic~ zsIDF7w70g^HsUQY3je890<_#Lz*H`*PYcIXDCs|aBOPr(N)Wm5Oh82tcsAEG?mxlO zV8<^_Smq+@DPo0Zyat~j`IbX0Vqw->1;_7jS`{0q@99_gPI541~wwdlK_^nCzcP(go8&0l|mVc$C^oatTvG1HfNnrv7eCabS)kKK?GH zVWDh=M2@X!Q=@=Evb-_PYW> zpD<~JC#^}yp8$%EG%y%WdiVMnWESrVynD)>MmMxiYL0@j#S=q!`0KR8Ozg~u-I9EG zDYrxx_8Dc_KdEv!@;Z3ld;CYkM?0?OvDf#Rc&sn5)z@~)CDC0%P;+?4BlSxXNsb@p zbSq@DAXE1;yrGA*tx^MiUzd*J7jA{h>$GOczT^)7NV^^Nz>1nzzX>9bWP&rBb_(35 z>-Rx-a3AW`nKG|^R9{}zR^JH!yQMX?HLF6}9{D9~V?WG}jl{IO?y|I)F&6g>l33yfGTY_s|aOKS6o=7tq%k1**k8VknM(kLiQY3m$& z#A|$AV=k*>9(GR_F?(vs*rJk{+Ofq~ zrzy+?ycIiA63O7Hx59@~2c%-o`uzN-o=!42lX22lpmq9ldNSRj?IQS6CXai5oB^qv z0dwVHnZ&%|YD8jAeR#nXS{f&T$5ZQjv}MWF zC~xQkU&pbGuj~ca-xvr4etPSNvthj{zFH#HHQFoQC$%r&6%IVF0l@*yeB@gQ|EpWz zapw>4ce4dPT4L%|ee`=<{QIBq{SE&8M}1o$ui0!&%sNLv_Fv?uyf1l)HZ;iwSQP73 zza2o^I=6^_m^P>m#$_9+$NnJco^$>n{k5Z^DoJ^z%3fttASbQBinCl_Mc#ppox|WM zH>UoiPp+aFtcBW3pnL3|tu~!l8Mld`K$-~EIv+R1*w@;GbapoX6 zaMMC6+EeeVEvwUxu;I5l!1e1Gst4pp=TkZ>=sKe_Mb4Fb)xN=c?)7#b&LF+&!Pv4= z6&@t(f%%!BsQE#_bWq4^SOWlm>fDo!aLL{B*XML}i_j7Q+8<5Kn{M zfj-LWgPx}kGYWpwhl%hyggv9fPtcK{M#8xU;1KGW3 zDPs;{j9Wr-faU!;Nr0|$Ox>)_XmTxs{Z8gW3yC8pfb+quG|Tn^esj1^YmcwbkC}kC zf4~FH%Yzm+8nP%u>K9Rx{Z9e)K&3sPnUq7ROeWkD039OWM4+k%2h3O(ln!2W{pqbU zBceq)584q}KSS!@Vl^JUoSU=-m{%3tYNfz$QwoZ2fz4|DENMqiN-1O^VMfTv>z$!d z4TS5(2zhKHY`LYszUfNPJOo$&kOqA88N5Hy8v9zBh7ZekBogp*^AJ793ZG z&xK3?l}CMM4D03eMDvx$HRdNja544Y(H!vhXl!+eGQr=YHyQyUWi-#(0osVl{tz>W z_;tx)>IX~cvX+CT6&~hebyU*6DA6<86QQy-@F1EDSs;J&U*=FgMIsF%dI~r<**ux8 zHk^ptPZe=G&ETog94@-05S`rzjDFBEuBWgr3Yt{)CaqV!yPw+og=>qCw3k131u>RE zZ7-fjTn>C0hBc5}gucL+uUr;JB#3{fts~HSt>-X z>^CR|dmTcT@>PBaGmmr=KLh414t1+vzz=1;Z<;3rFQ7f@m;H~BM{G@qro$t4fu~#j zd%uAAHrO)>!J0`?NgI9#)r;V_gs@HsHa}!|#=hhky+o2@9aKx8wNEg94r-RDl|y(A z2ZSvJtn+PAm~0GR2kVS&q6@p&+XX5t_*3c@>Ft7ERT@aKTY%dfXeGX_G*w+4{R+DljU?H}gQFtZOzZa1AnxEvcUh6B#CBE-k9RK*80>T4Rq_iC zGsX@YY^-ulX|MVm{1H;FLG9b0U=_0= z{$!E$rBkbn*^pg2BIoprU34BYgz2?^de^8i2AnwX_B{jdhv_J7I_84kMG)Wkw!gV;jt$aq`c2SQV378LYS=S`bS6gkV+KntQ_$N} z621Lu|5l&XK{5OuZ?`xFqcSB;*23VoVU4F^^bC$a&U(^kZGBhUBh_HF(ufk5Q;e*P znV`!mMpnc~|8+CQC8!;Ckz6DB%lKVsHF}nIbKDeijE5Tn=yQL>sc`*_x&hcw_XG^O zAWY@XKKWf(_uL_i%NRJ>Vm{rW z>HYSh?1tUvHaUpjPkFm*zLVdY{f~}CXg69DxgOTxpyiS4#oBpi@E4GoSdmOOKdWGQ ztQTIfZh;@=sRQ-!%u6%-7^DIW@HtD~e1%~`z63}i*_IzW!Xh`-Pzs%A!M=g=1{2;4Eczrh#7xc&qC?(op@%t2M) zvzd16w0?6jmH!VGb6gM}R2%vqMff+^52~B2juBx;-~{*e3!fK#q%pzrjEaa^c^LB* zb&#Y#r-x^>7_YkOstX1$170C4u8*-H)T?$zukpOl(W`zFW%lvdZHxPRJI1`JrxJnZ z1;^-62DBo_AdaxRH5XSWb#2-y{C$hR)A&>CKs({Dqb>k%^fsiFVSUww7QY)cs3 zw=OHjGbMat*-AWzg`Laa!_yLW28tghU%qq$2+R>;_9wNEz=sk-%bIKo?9g{+2>%cB zp&E5E^NguZ#`H?SF1?e0N;mPHM+$E}qnfF5ZXL)Q7p~!(8+Tdd7^N`52yx&TS>v zI#s4CrZAoQjDW_g!7DA-y`9_i8;)}fA-Uy-lS#mIzZ*Q2ZUG;M1QpjCroK3h(>6|?MZ5QE z$2+KeU=DaXdht)a>g{|D9>xfM7XINGuhq{-&1<9cp{actXrlMAQyXB(Lq8YMPI%c# z#%6SX^SWnly4=an6f?TNetp`q+Ts=6$6hz$d_AP@?6>goB09Jm)NUd8^%Dn=?+ky% zE_|N1JF#M)4qpOjkM#w2)^)H8*N3LfNtgALN^QuAGFOL%K9UeNOu|0 zflWJ?bXc4#x-b6I54A|h!%3)qT&bX}P%@Mub$qlC+?{l^Y!1fhv%YIQkABsw{y%;O zOu)3F``R~B0M&0`MP^3#HE$Smmwc72^s0OMlFmRkqx*_C2)-5Fm%gDxSab$L13!BZ z4IoCA#9@6I+_4$mS#RL(h@Yu?G!^}<(}~|b2^e#K^pzpES6vr}icX|wd%ocH6X*22 zGv4#L@tz-ocg{pVT^{fGJ9*usUT4`N=YIT;b_jKE;xsDNeFZ;-wD41iF*gS7(nwJl zJ0FAeKT+B&7rWi0)zI(QBPG|?1ZUN{SFWwCS-G#aeI@+s%>Oga;GfA2JfdK}&A3E+d({v7dekG)UUic;Sy_Tq$IhhM8&Aa?--b?h+=IA- zeFZI({6^(h2>%u7G|b-SzFu{?He7+#{h?&VHZ>TTTyx~ODKdK?YVPmr>r2+=euTc6 zIi&sqHY5Z)?jj>{!os=T3f%n!I3cvJDU41Hd~Tv&huL+xDVB{jErDYc zIf3yZn_-vCNtRb5HEv2G*g4_V!CHt~zK-dzQg{!-v^)KGSl=Bob66?I zpJUU2l?GwWWV7#rGTLR^*6v*b+kZj5EPIO$Ha!{!Ug zCs=18hNT6HxM%fLSJ7fh`Ls3++`k)nOB4JDIs*{@^FO!TgqGipmOmI8nlp^ITSU7@ zpK14?`WV`Vc0)I?MREb+yW;Jpa4Et@Wu|iB(U+AMlufwZ_}}`#HDuv^K)J7pUE!f; zE=o~m(W=|GHoPP$Idv(mtyGWR3q9%%cm>+SJd1e?;?@~@)OAA#peafHA^7Wk)Ow66 zZ~Y3s^AI=f{82Wdt-a8Pd7sa{LHMS4cP_?I840*){*g!F#QYmnKSh|@L$@`=0W!i~ zEX`)}fAD=?&;V>5C1&EFdT2FDlf zmNf=kh!JwJ9zc1Exd!Yqz}&f3;7{7QgvdREe>er5{ebmUl7;-06NL^dbwCbuH{GqxnKS2t9OKO7v4CcHte_m0c2I`uUEN>+ew&ZWoM2f;*D&{oiN4AH+D=6vhZY5S|EvW|-kl;XDN5A0&3h zW|aM*)}yYBm%kMDBa5SYUH)ApiKM|3;c(axhV5vYYX$g&B%sc}-rL%vI`}!{m~4R5 zN8&qlZ=21Y6Qz(5@zBWXyD(Bn==QTKw3k-s1UqEp`1)jatl&!jxXpp< zXnjt?`ot+*oP_lWd095eI;pYe(G?fA{>iQ1=3bL7ljVuT>Rf8ztCQtT&-;BTR;J6w zwVGcj{To#~8Stnh|?Uujh>!4m91*^?wGiU{0 z(&`?YpK%4o2(EU}u8N&xVF4a0VSCgtbymm(YY6_`Ch(01)q;T_xUih!=^P=@m#+pA z?`iz~sQxaMJ=B03J;LNifywQJ$)&Q|@})`14LrQ2_9(*k`+1t$^84|f!Z>+Yc{!iO z%M~7`T6WZ|T4-3+<&uNSa_B~1S(H9E_E;;9hLYRm%;Y7Xs zAG)6yzzrVGxWiI##vM@CalW;XSAvrvmFEO!^=8bDHJZsoErP4q*YbxK$$wFZCN`g_!r=sfTyV(KlBQ4t~+MJqU@*dP0!0kq$8Tfq8^KN#JBGRpg_ zJx}2Iw`dD)%?aN5fLGw~Ud!Pv1-y?SMM@lABYa2Kx76Uv-GGChO902EVSPRtQ?Gcl z5kBt0VNZqh(P5@Ilh=SleD{ZVQ1?+4ZV=v8yCnnUM_tE*vA2N;4y?yr6u(#i(= zCFreR^%JM&S0OIz0?ybSVK;Q8PZXpjZ96qG>z83%foR8J18Ep*KRpch6*q<_Ay*9i z>J8f0a-Dl_n0U)N&yh}sGedt;Kx6csDI*}0*zSVtfy$8#tQ6fG+B!^q3z>?`daDVhMEZIU9lk?<~-3K{^&ZeYcUCjmL zw|%cYW%&Azro&RoB}H^-o6o?#?L4@P&Vl>oLz_DoXs*|wCw@7~xulO~+t1^(?PojB zoom;9Z?2Vv^O0vCAkybr(K&PNs`KPf;EOdrd&VQjsevgN^>GM&JunG=(R)CD(C$r~ zyR6V?eEhSRIwsqkaIL?2c)myp}aZ`#QTom5qRH9*Sv!jYtZK zz*YY)MT)B7m=DI*e<8egA=zBDw4N+=^==YR;P*?nRAMcmvZx%k$px9UVZuL3T@?lR zZXPelqm@rfw{{9b&}S_s$i670dCDNaHq2}e9YD>jE4!c(vXQ`=(0&fFUqf>SJ{f;E z(aC#6o|vEOoEIi-o9$XehR2Xh@-6N83|@!8uXTrp1K!gJrMK3429{-?E{zlur&jIVJfLyXv;^;B^CuO zJ?G118PqBXe&io~@-X&fxur!DAc_QSMN9UStaY5;l;V6(|4D(#4=8=!G;!amEumP<1*(r7Qu0-oFtA44?wRj%$L>^n> zb7e+W76j;)P458<*52NyjE)OKy2LItcEP6|0wqrUgY$Vsm-=kq4)3Fo5r$T9hn-b+WO<5t5@zkL?tc{Wmqi&&OzUMS#4w=L9sT01AHbi?maUwS6dyGmQ z506H8BgcMBDe>fbUhH7`4WZ@=2HG6A3ll%lzLZfH%kh*?xVdR%#Z%DOeAd0Hbu3Q9 z22UHXe0SK`lIeM0Q(U1-*%TuzP}+j~wDkF=kmCEwd)!OsMN|1FnpF2b{DbRM0+m?W z^ocgAe*QIusE6L`PbIT0<;WQ%-H{JqJ2r`=(D?i+uV6~D;)T!if`zW$9hc7Uh&-0; zC~P&z?0^WI6nP93#ovs*>=2e7Cxn@V>a1@V+~>gwhCnzv}AT>|2-K15bV;aKb*^Us|EBIEl{! z(av(RK^fax)9nuX*b?2xcuG!g&Mo69olB-Y#o8*#L_gc0n`xCtMwt}MkTV9=A}$jL z=}rza*^v@D9R@4-okqvJ?k$yn4~09*0}Gnu2dH;(dXC+(n5Ql3QfIwgzj#nRc3ug3 zT(|oC?oGfSMc=_64EB@=E8II&0sIZgdCoOR)Gi0~^&qd%M>6mJJiq)i@R_?e^HA;p_(qjiD=B>$9ohOTpIQIn&S0Iiq8{)C1>V%Ka_G_tp;A}zOa#} zxF0FL4I!N$coP<#ImZoW$bGYkmjmfp=%~hyn8C#?>V@fNU;^UE)_Z$9q~;?UdvDil zma`76&GFyn&$&Nm@okG=TrA5kmdi_C>da)tes_Un2jo@mpsX1$B8y)iYu19#L7$v0 z4=3{&>PZ#ka&Nc#>`!m&SURZoxIwW3bY~7Stp9nvbSf3YKS~v3bNx!r{t+YZD`)#BUv}Ja| z`|w@&a{1Gsg5u*R*OZl(o1lB*^~?7wD<3I^hwnaliHy}0JJLmV#>?#w3E8wNz8sJr zqMhim;~0KWhq~xZ?fSN}jHGt>j(Ui3y*$e9FffMpyw&*A~Xz^~YMe zOi!eSw<*Y_m5Y!YOmBUx{Kazr?sRUK(GP2;$BJ3h&?Dh2)UDn#C}N))m6#6*rzPgY z6ichb=L7wIe?HJ`fXSy;M+Qc2H)9E0aX0V<;g0XpJy{l!5gsA@q1)&stB+Cj+L+Pv z3}z>|o`V8HIz$0`JGK{?y`p1N?j$Lcabxb;-SsUj?BcGv)GT{%v?pEaBVjo^<;+9mbw%_bpaJ+(!g>X)^iWWIb<}yW|nj ze7gXrN?WU~^Hu>qQv{*Jf^fRQC|~8V$_%#P$O4@Kf7TMYgmpe|oU5>|_4bQBlKd@7 zZoJQ<04nT_Hk4(Aoe2rMB&-j_OR>=&D7T$c&M?@(C`q6EJ$Nn!JdnDBe@y71LNbM5 z+78bfjg{Yp$psD_lhQFJIz%Qw^zUg@bEG47WF1bI^_VT7E^s0zZrmfYy#Ytl!4n2y zvoEUtc2Myigy-X0=nK;-1Lsc`WNEiCo5tq;xdCwSm1_KLSlx&*Uv6>+Bl|(02$AH; zhG|cN^BMv+LCNzv)qCDCdhX>|B^`2wA=wy8#FW1S&P$FRdo+C4z?X(jxj)I}8Dd9p zu4OJ*R=b&f4bRUgQR4ZYSm|-m$pRdMTgt57&oqtw)Wg>NQ5(Z399;I8HkyZA_$KP# z5Hj*m8$xEVh(FUD^P}n~gGSG9`CQ)?{VliwBF2bjFiyxAr60r3^4@Y#GZ-h22lHH* zi{CGcrlC*uQ%`^APSilNd_H)ht{uhrc=R z$8d)qRd)>?(e8T+UN|bi6@Z+iSVChl;C~2b{A1wp44W3e>&>BeE9VIv!(9Sl1Qz)K z93c9d0ZtMB+6|k;JSV4AWrw_~L{CAha2Su#snoNnh*HHGG@GIM>7~?dWNVB#Efj(+ zgS>}fOC|B0*TlaAqdaJ(67eSD=6_x!-8L`cu-$Q{47&Gs*`#v_&knAJQUH2^FByk7)Y2NH7V)eWV3OGs|uiBi2KbW(e~ zbbTq(oSDxfsAeuPsLyD6GXkH{oTeEKoEyj7`fk0of_9~Xj9ImzX=2o%;tT{IqN0+i zG%7y_Wy$g;hn#nHk^Y=x!lzec%$o3IRP7R@7V{OJao`~md?bY{0ynyFN9eF!)PZlj zKS^Fwq;}eX^~^VQ)bX4bAm@61)}ynN@5)DZ zioG?|f-M!~*O5Zx&(UNrTGF=m-tNrGQlxh=SMQ}o`@kt_JXMrJ)F7YzE2(#cNo!m8TPi>m$Ehs}e+rVE z(oZk#RPP(uT4DCckYWCmrPNZb7naJ}7?iK4}xSQ_xjNhW^)&?bX`Vu!jEM zd|8nkifh3ce^&od=T(=WFIo`Pu1uvHq7kV|fNq&js(W^ZW(m$GeXx|CBRW&S1I`W= zKpyoXE`#Tv3GV@HBA z52f4&errwbnhfH#ZfT`__=2xuDmb6pnB(ZDx{Zq0aaJ@;ItYK~LN0kjYYVJ{=70$j z;qaNxHD9T{i~RN4Dlhp*q*FZ0Aun5FJ>+96s(P>!8e4A%c}>>piNdFlT+tq&oTPhr zJ94i@?sYu3zqxMqszzOZ%Lu*zdD3DzCj0wHPks|`E{Lj`C^Nm)JQW;_&qerAFitg1 zHH5s7!>~fvmukT`o)dOUCXB(3U|C7{K6Pl#A3m8fG&rePQgPpsYt%P_b-Bp=vO^*HdpD{|{fxgrYxb`6+8y^LgQ?!@j(9yDo|u*mG4^}Zx< z6cW(=MN3Cdv1Mtn3{~$-J}0Iv9y7`z!=D>lHU_0nT{#i*laRCK`IGEa?`wR&xgCDd zC#D#=I;OE^H5mwU7;$ADI44FmLcwCBe z5^jEiT7{HmzZ^9KYH1`q#fG3Y$!g1Lt6}95mPH_Ofum+;oy2l}O(BIwuJ5+f~rdWfPgb?Svy0a!05!okIkFv2RnUu^|Im z_IeG42Zvw}W`IRrK@3}_VH^mq3}-mZa>-LD&8`0cp)}l2me-R5bT)|{c{mI&qLAc& z5c~U8$NuMN&C$H0T}sl?Da!AaSC1}lBJZMN?T10iGrSVN_7V0}D#0$)E(l7>`Ei0h zwTj|~pOc2weyjeX|KDowkP;Fu4L&OymabNttY(G-w+k8&(G$dJ$t=$EZKZ8>xU? zR2S7rrT-?5a|M#zRqj{FODk5A#O&m^Q}0E=Y2hQT&jo^e1LRV}7_FpQckNm?EQ<$> zm@&tzS+2=X@zq=g7q>K^C8_6GvD16zV<54{{b$d-y}G{9@x^P!}-NP0^)-M35Y)#NI?AY!0|^}WGv(g3G3BjJ_7%= zvdGb)zk)~iQ-$!Z0KEI>@2rKgp#axCTEuc3X{{3-ln#vGkPkfbEG`E~R*2Xpacf)P zam*WF!9R|HO!Ok`8d0sDYfT#EF=+e0JAG?w>*J|cSi*26QT*Z&xNGDg+s2I`x# zDS5IK$b9N8iS3hI&B0!L)i*>`gvmD9^BR6(8fA{Vpw;L&^k7- z!A+$7oRY=<&_IxOE(|%V)wZ6D;F+Pp8-gxrX+U+|Amm`8fzLVmJPJza|O&I8SzMYu~ok zZE2;uZx?y>y)Y4luBJ3Ze5`5^LRlr!+l$OINsUxXA&=tO>6 z8Tok<+Yq8X5oe~EL!iKL=CJqz)?%NZbm-+22jnWqxA((-W0-uXlSlN2CGw#zdyynesfDL_Wye=+)~9|z!Q{nsXq%gI2yI3$h&46-law@0GfMB>w*l( zPSjpEel2*KLG3{=rJ=YDZu0@k7t}J!kE2Jgi4iPbXz0`Jy-%{Y1T~*mfaQQ(4JQjL zn{s2A&S(q5l+FlW*pzM&w+uk`Y_M-ba?IFzAxgZ{4~hRiN@s;#A75Zc3+z2$6v;FF zoG7LJhz)^GiX9oUlZN(3XzQJ@onQ!yb|=pt!)^H%=(}4}#-JXeL8up~2R*iO_(jYs_{D_mfe@JnQyTjQxA+=73?8%Uv~E_=a_j-3E@b#{+&LgM zc^`LWdRPC*PIorx(Eg*-&=_!P=sup{>&4xgFL1m`ij0Cr`vh6OUksTP`F;a5-mUQ1 zYrp^Nr9}uEQVie~$#}aGZ!)LKa`^jn+_e|L7j6CHMVSq&k3L@O9=U&`b_u?C*B51$ zKSE!U_m@8|KMsD@0kY50EvK~{dwc`lvUv%x3;E!*rlaesF>@Xbo zF^?A%<>C6KNsI4XJn23W{Wzq;TMqRt@R<=bMS}jM(Y{0SHDyQc|FE<-21Ny>u zNoM`4l*V_xyW}yDfrn3sI5HIhe34maa0&Ro-SwcEXfs~+;o%6}?% zG}nIr-%Gj%B`xy4tR3>wNY%olXrs0YIO7rEjESu#+(3{|a{9XVyswQ~johdO;Q>66 z$|pbhCh!^XP~yu+{-KLNSy$6O)EvLn$+lx3ia`1pagg9Re!cSz9hxB`5g-)mzp z3P%13-k>GokVkor9zB*(dGy$^MMv@P;IU&5Y<&IbTa2)#*{Rp^5uGHSt%Jo7YvrF6 z?3|lO4oj$PM^DnKD9WUI-qBik9B485$z>w6zBD;)jk_`}xrT?YTk|f$Vik{HUdFDk)9f~Z-v4ms9n^R{o^`hI@ax(`%EAh^DK#KeZm2DS zg}Lg=1-0#X3RQk(s4RSf34a0SRNP8A8?`%7QzJZD(A%3R7yjFM7~a4UcJc5VJnZJ- z*R?r3haN-p2>DZ|-1R)Hm$aUT^^(?UmmmlAm}F0`tkY73(#pyBf?0-ndl%$|DR&#> z<2PtsjJRl-t>oE})|D6{i4pRqdSg7@7HEc1-fwuF`%q7v_Aeg(vqtipr{MuG&e7Y{ z4qIl1P#IQU3T$sT_+Vw3uea(d8{Vk5^%YmW*vMleQdA9U@GM&Q*0pcVg5&{gnqN#- zcFx%!sB|NrrJU>H($tYVU*odzwUYCknVhkoW-)z9%;MDjXJ_y*#QHFsA7`Z>uAh}-vPD-za@fy_rKM{ zB()Ch0So*F{af9~d6#q+KZrdH_w#|9n`YJ8aUQUQlVDGMgkwBxs!xaY;@RN5WeCi1 zQ|KPQ1gl)Duv@7RcUlI?l-V zgMe1}=5}oR5ZNtukv)Y!I!C{R`0el?Qw=&UIfG@tSbNKOl2Ta( zIURBc6q>!U=Uz|3=WVa?^J3B&gn1sCONIU(4Uu;=P;0aVOw_9a#>?B^u?Z z;VEj6ViEMLM9e-pbf-c$C`Fm@Mj}+Zz2So#ce*g!pY9hyN%g4%1N4ny&mvk*un)nr z`p<_}fhV;}+vJ@Y&kv6#EC}Al43tnJkd;BA6tcti+V&vD6|Ldlt0`Q~!$myY&coFR zmk5?h`VDHVo}T2tRd4gjKBDRR)c?Wm!EGq@lT0AT#h~e^9+5+p#-Y-0geoS`ozUak zTDzTZ&=~g3diR8x+Z-}_XvJ>?^-H^LTc>C;gtlWxvu2pGHi84>YSPCriT7O}9S$FZ!{@T~xA*HaGyUvAk3pJR5Z`BP{i4XO8W9eFy3 zimi0soh#u!8fPCm2~Dtz>+3byUW4CkoItS`6g-DHkl{(Lsll6v)xdwa-`iqwL;QKTP+&j0RQJdbjXFcr|?kB{_xuLa44~p-RcahtT-J0I2AK@j(--;gL zCCA^|A1PX2eobxbI!`@HYG2;~KD*7c=aB+f8aJ%hVR`?FmFr(XNs~Q^(y8pn0Ov5z z%10P)(_cFL&A;PXS0713PIGHHW&&A!(P!h$1$|sYjc731GrA=^{15wGBIeW=yYw>< z@m>1V&xTyw`o@Ep+ms>=DL&qXT>v^Xi{vzTb})W!$e$5PMaZC}=U)mh4#nW<8gYW^ z!#xpEVE*02R|T(>jfFSYt3DU-D>{~g)BE#Kp+cn&L#YkBI@O!{Y>q+>lhsc1YC=J$ zx}Xnqz0YWGL-^W02DwwpVL*=BT@*4Sv=T6X26 zM`_6JxI6SYN*3~HZQK`f)$YQ5TCMxuFmZDi#kskC>MsHL?ciz>FAhFh;BU#`d=R&b z55STt3Pj4)HdycjilE!7u%&-@pR*vjAsd+HatCS9V|J;)DMPY(6$_n zvP@^nx(a1I#BOd{hZFQVoRg{by`Yi7Aw%o^fH&n#O(PH@O8@f{qsDyB&)}D8KXeAi zxGLk7A1M=+|8yEp$DK6kL$>csMSbs}zFtmygL?-*<}VG_@3eyZP$3mH;f&3B_^=;} zlv|^dluq>*n$3}Opx$?Oynm{l9q;Qk8gGN#0h?CDOEkdxCH3uNuxA2p@O*G-ygK(# z0MA0_9@2cLId|?X4scmAeXg_A6K^(DBn84dbqKE?+_IDCwwtA7=d{D5BWKE1DujrN zJeYSl$1`}U(ocBhO+}e{>~X~EtA}D(pa2}RqZJf(WeSm<;F#z+$}$DN0EnlfU-Xh< zoabvyO+|m0Qjfj~UJZC)G#23AAf&@ieP=#X2l-L{VauYlf^X2{^WYr-<0|GEA?*XJ z`3^%~>_$qKw8lgQ@4_pPU9X#E5CgWLxrwvb!1f8A* z)Jx-GVTne06k76^x1mit7*lT?q}lfYuqk+km|ub;Ei5P^{2x3Cs#dtr91<_IgbeWM zZp6KlQGpg;*o=6+q%p|51!umS3vgDHwrOcXWO^SwT*^%izFcsg7BT;Bsu4a#)i+^v z$_UOgxN*5Q_&gLlXY)M~J8G&6HsdLezN>c_r1pS!#|N#Wp{(lg<}ZcU?gx{oin8GoEd$za}GjxxlupEoVRZ-<+YNg?_aphutoBi{M6Qw`5VCNXZZ^Q zu*wg)DVFcw4a-vKi)!2#Ul-W1Q17j2RPnF(*b%M!wA#h!1d+IT>Qny+=`G4_1z#V$Eb#Ne zJ;%IThh3RcCOFsF|D)-c8~S}zB8IqBebAmHTt-r5bRw^1XLIWD%i&}t?c*pr!N89)13-ok}H3pRDCgZ=Qg0qYB$>Yjlvbu)Z@)mL?@8@b+or)qqMaM-u% zdpi$;)9|gjt55dUFL%L`VSSauk$C_+(sGvTn()Ck#aB?$3EK@)%TeD7x%P(o<&zu^ z*qLxZ=2PmcU+!=u?N8)$0FzOx9g7r~2-o0FPk{OBvQ|Dy$w* z{VR9syFHyZfm0**?jRWisrjbal-~$hR~mDMV|VbK1w|?u0i20{mN_h6DA{j9WVDBpFg8)c40N-)6!)B z?ki_2koU)|MOcTQ?2KMs`mOqE)LSJZCJXQ1s+j|_m*LLZQ6hT<`F5{d#n8@F4Sdnv z&aw}evwTSXfk&E^EyB01+y9ZT*!y7>@lomgzpByV`Bv?ZPM8z)6nT8UDbUplGKft= zhIvqHbeli(`Krgckfswl{0=YtgDthgR!T(uH)4&SPDA)x^`D4i+{UG=tHW!kBi}zJ z#x8<~6WM^Uk@-C0#&6Z927SvbkUp8;_avmyUxQ4>^Eg{JpSqfjy;Nibm(7z_Hr$sw zE49ozJ=I&^DGSq_!T~|HDMjE$xIVVc+jx8gvjEnKS@X5vg9V-)Gi9%-l#MreiHjk7 zzEH;v_H>xhPRS&?1gNjq<2)-hUsuW^Y5lAT)=ElUnJi+%YGNVXifZS)Yv=wQn%2Uk zQlzrMxnia-nUVB*P{_3;gjhyqc zvZ{lTw?+E~mn$gj9)PqQc4fi*DC`ag8JuWI5GRti+;AD-)jq&z4{0XdoMEr)-5#L%i51z(S= zEacH?Miz@~8=MyjUYA-y(q*fJq^u^luwSraH0_y9X%*W~J((gNChgWp^%b+8c8@sl zhTC>vwcE7+QAj&qbJEO$79k|b|L%AOW0lmDBA@6eC@m;sK3KI4Wy5ca1GB1cNK#_z zE8skQ8n%}*`)Y673B#gl|Ge(4mBy$LNiT@0%VSLb2)hTMxdAw)Vtg6tU9JK&DHsYC z`NbeS7#)%jPA^U8W)y8%K|NQ0(kuk5x8X1${d3)%?2Y&&KVTW}q_$&gq zna^vi=4t_F)T+1OLnj~ixm?Fu$T9c@tm98MaV$ZTc(b1K2HWvT@m4s5 z!xp6S%(@PD;-W9PSkzk=|L%%^U;CZ!SMu)+{%@!bkzHPfK4S*hrV&C^Ub2_IUi=@v zTAR_|RSQfK^+%3XLCbTf{c!kLnpu$O0c&$GJN&&gnZmfzQRk$Y*Bz|d@V!*BkXD+0 zCe`q=!fA=I!)z_m`l{q=~t#0&^|8UWB?M za|Q9Yua*h3vY+Go&&!g=KL<_yHV|)m&)isc6TaV6W}SBa z_k!m6*Uq1l>2r5k4X?Sy&?twv-=L&AgahfGg5B@2YfIBh+B9i&n>H$!$pyPh%C12< z?ye-^Ii$udC{i1dn&!G|mSA^l1rm+Km1S4`V7kkYPK0!S5g#*u^F^}?=1!YEno2bo zPX)zhSUWH~jQii!Sh|Imo(|t(Xd}ZHD@q5x&YqPscjAA@vmYtW=ApMUeX#q2GO5`* zExpw0O_fK_Vg!TXJ+$pTZPaL2<|s!mb`>+~Gae961rbBFQ|N%kO81FI`h5v`~By){PAmFpYxoY z^PFd2KKsMt33h$8{oCWv{I6D5X{Tv1y2#~uPkON~$N(~&{C8i0#D#ZNwqIEA_F)D!nf8(E zq^1C8+j7UO{iNpujWs$4nw#oR=qYMUPnTtTB6l3umAa#Lm)er-V;kT}fZBcNBd)@g z_7lhd5&zY2b#*mblHz*z_xoG|<~uZDVj(>zQD>-OyQ99RjB!H{(-a zkR{mhGKas5&!@V5{dVAJEx;UUu7%-b{3l6R&j7<#R&D6R%t(+hBhWp}&}JQ3DQVjY zzzio;3-h(pGW`blw#ddgzd6v~HQKYW=NY>w6_JeBBxj0(KLh)NBT0${zqU(|lJR3n zt}ClrP}Um3pQ+%Bfi_K*M%h<>IHT+c_6R+28lLp4M)!ofFn6gx(&}D!YzP3FfWaB9h{rW)x z9@rzfT^-}q_H4!aCsUuMRdHJ23>vx~x2c7Jm`do2;jGXYC-ee?AULD#jcUs8;$VYA z`B~8R2R}=TvsQS>>F8;0DuJ}oufx@plF%xDUbCtZc?bVk)ydwiAoNC)QQ!8zR zk5VgbhaNr;9vwML`1U%0=ETBG?h2qDFCuhJwSuUGoY%}Og?%A&pyF522Zyt7$Im@oT!+IGaY;44}qGP%f8e7 zUQS2%J1RON_V!IN3!--N4`obB)7nucnq27`YPHE?m58q3fc@ z<&ud@0MPNN&jWn{SU85b{#CDk)ZWiEmbj*z9j?%eAxPj~OKQYj2?i@0v;R)<8(2oF z2zvX9l=qh5jgXHYV0M2KpORpAH9=CD*2P|t8|A0w96y3zZJ?c*aocfzCK(rM-k-n0 z&C>H)$mtk+47x+)(-`bM$S1LMFKfy6r&p&-#4#Ar`U=LG{91*c!TKpz9TLvB!#ik6DY$Lw zeP8rl<$dq5khINxzLRniPGMJOtZ4yu-QF;c%-|X*@a%a5n z_xrz#zc=ugY5_D&E%0#8dN#&cyD<-VQHPbD(ns&lBha_AtYeU)eT{#e6y}9@=1Xgy zmt^TX*uXaWyQD?VGk#8J0_Oyj5A{}zvoP6--^HIx0^FLxg}!+y`CN5Z@Vod+kUg9R_4!#W34c3351gWCDy?xOGp{-Bt0SB7;?W1X9UOoQf-#m29ir3Kc1fxlu-tG+2 zQ<9scE8G@2*?+fEiwe}D1GRV?yNkVx7ru`l?td}x`oE-E`zB3sEK>XeRBtN9@8aEPqpy?{ zKUY$`NlDR+6n~2ppNhG5F<%&v&tl9>vI05k68{vj?6J)R4unbB>Deeuhu2M(n+1n-X;lwD|N*12O<5~hoR<#&m zVUE)pFcx*u8-P(IJ5it+d{3dF3mV@cwhTL&V*;&FoAs|{|#tlo@7w-1#;49Xfub8YdD;FtLdWnn<2r>&Q37C zf&xwShkGWvV|-84Bw{Tnb)9#HAiIR+V_pa`XH(0=<(^&bxc`XYH*^AU-P^;nyV~*l zqjGwkosF|>F&jeKSsk)AbbW%Kt(}GIM|;j_4ZX3PaksY9XD-027f9%srbtPJrddVr z97RehG`%W%=b#<}1f-Q73ZF486lU$gmEO^?{bKK{x1VDlENUNp;%PU1VCtYPd;7VE z@q9Ed$SEt2Y3%LO671|$KK6D&xliT6%1N%`9JpEMST~W`BiIdCzNACW8EJun(4TsE zJ#7JKvY}Ls^lQiS-O%NeGmhMT?kMu2&nb+So2EfpjN(r5X;HY!+P>$E9;MbV41;&t zelh;44&|Z0tJ?J)wy?1rc|I1H>ii8F)fZbZ(|Yvrw*swklLfA^BMs<_ZOZWN4l=|6Cn$ z?G_nw^E{M8sU;iv{(^1;)AjuY?S|S_Y&i)U?8Z}qJ?qqDd-|y~Z;q7at4FE)cK(#k zYp7%eikE0`mx3H=^7I_Z@FP0XVkBhQl`MH^PO7dMzRYTEWu{M$Ylbgfx$1D$`?Shc zjcdA3rCd2&(|jzhgj|okJ>v>O?w$;fpbkQQTS`dQ6hf{+`it#^l)O#I2id5dh4Cw= z=px(@0=9v0jvxA)m1&YsV*M5VFtkhHS+avZVg2drxHX7HTAw1M;eskbOA~H(d);rpl;Wo9|W{F(p(0?XX+1;>EB2&nwW6|>JUOa zgmX|&4qyXZ*@(6VtUf@<%{Sw0F}$aLVT4cO{g40V?N9ys7V+rcwzL$Sx{(kHH+TqH zcM#{-{u1?{fU!7{B@2EF-#kAd3j7N1PvQMXcz+h}-^2SAcprdrhl`YxTfrWwVra=Z z^0T|{Tb|10hwI}%+$wi(Z}cxcm42na{Keh_+c(zU#o*~QC{6ZR=^bHMHOH%PqoKd> zrv{+NWI6y%M$q)+gG~&n%wx&2dl+&e%#iMjsW2X3$kxLQIsIKKY`>c!7W`)Lo`$y} z{#nF-HkJy%y$|nxkKetikVD$c4L98IUvFcd(>Uguxd{#JjH z=_gNta1?MBV8psx3HZrumb{LEcL?j#7hb%>?><2B z)hwyFjv+q4ZGgr2eK%kZzz0|dcopy$z_)+_fbJTW3IJkY$u{s^(5N7m-~$G0 z-TV062|PxN`#k{0WPCrDT_~6t*81QiVPHnX?V+3yYc?3S=n8}?-u!2t5z-gFkoF4W z)a87%Vm*^C{mHNgCFF&9^;zV8z^?%70KW!21o+p#HQp?;VdVKngpUFq|Gxq5Uh_jb zCHJQ8vys>TF745>{qN#zee|Ex`0+RNo__oP_di36s>T*9Yvp~$FkeOSL&jzUU3w-& z1ll$o&u0;B3+F2cbJd*kUJGo5kZ^h$a}b|eH+LWpeZS7i3>gpPEKOPUY;qh%?7J5?U~ zTic@X@uD$IEVR5TU_u-3q&#W?{8HGM;d??{&t*~nNAojkUMP6MK#E^<>!RuN^))KF zerWUwyalw~m?(Dcs$^z<7aP4hAL~MXqwpo}Sq~@Hxe5FPa0#ZMFE$K+zLfi|s#g0x zl-P@1%Z(KuDg1B(EDiaO@J#1@7O0#LSOBO1%mMfS27nP@0{8)|0LuUz^o$uFV>N?& zaq(fyZQAbADGfP6-i97$QbxM#TW$&y+s9|QGF2Vh$lBOCoFJRjhB^66--3(x!Q$wc z^6PZpHNI=AAz9ugfr|Q1<=Nl*W_foc#+2QHV?cB#!Rw1$>Dw)llG`I@$$b%vg@1;R zsnc5_QD{uYA4xK{tqGlzsfXW%{Vr%Qq&c@H(jlvSSxK#_Z#3pTN!U0eUWLqX?EXE7 zsYR@vN~~uu$GTNXkH(85J)3X{=_TVElvtZD$EqHQMRQ~7)rct|rXDfxQexiU$DnL0 zm3#QU5HwA|;|G8lb4LGvpzS^A_h&0GuTPUM(_xGm^xp*gW3bJgKzQ#08B$amhjI2! zLaPGq*N$y?A?fY97jG&!OGUzJNXBCrLBP|gAC2~2^uq-E=61D@#-OPjPZ(y>k=lV@ zlzW^?gM*jik$gB6q;z}cFjlsoyKpq2pGooiw)Rv!Lra0zC^2P5zuB7;Olv)*as1Wf zD-8ajhvC0$E)0+vI6=9{B4(f`Pb7`Lf?!!V2iJmDizU zf(K{;dVm3t3oro+CxZTNH*F+BAz(a!)@2+*)Xp_iT=Wan5hIPX)Ays}j=pDnL>Yth zp3?4f{COg=WsA1Jlyp`meJiauR6ynkE1Q0B+rA!9G2oKk3u_;_5T5o~`E*h(+JY6W z$@pW#oP1}3l{=H6f=2hnlYurmuGhEZ&d-H*L>YVl??Fl-H{Xcz7aM%8g#H>*R3gIC z%EQVpC+x_h%e~;@-LQ9kBUu629%3)bmndhTIhiTU2qfc%B(>qCb?~FFx1#S8REl2l zOwI8`;m-iY;Zm3UnzF9Z=fsM(DQ1eF@;!wXbRjH|4)@*%z9_-@=5rH>v$$Z@;oi{g zsV7(C$)1WQ5O?yVcN5M@TYOup&C*I6`tzUuH@mNZt;+wi|IF-nqjY4vG)%|BzTrE) z<1Jc&m8W7puy6pz%3Fu;@ZNzlZCLrpFp7hSKC;))o}^O>Pp@VWKz zoNJKhFNZ&fF~Z+sw0E&y$zMW8@~;t^SH-ZsmF9IFe7VD~;qWxX-lx=j%rI>QYGf$a&o_x1)bf*^#J;w+O{oDL(Z_{*0RaIxg z?$ju)icy2^Y0J;1o86Q7nLdnM}*Bs?)92(94;lX75(jc8*WDjvM zK*Mtl#GuFG@(RWzDY{7b4MbQoH;YtZeM-=HSf8{lL_Uzvw$boqC1m9a>R<8RJp-&Q zlI}WJ;nG5TV;H{J`qyUkung09D8XVaJTu6PhE}E#-$7pZ?@fj_V+&muBY5s_Wp*+0 z_F<+W&7q6v0O<}k%3y3?kGL%23SuILvz24o7JPwoa|gg#{S09|ioM;!dbOCtpsCx3 zskiG{N-)e*m`1_w!Ro+i^oWNXgv|`ky%ddeQqur{V}&;PYksc;Ay7-I-CV$oE{$EK2a{a{-&(eNm=t-{bUz=S*QRmM-*<)sCA$TR<6wO#s~qHQQoGn&MC5r zCe*K@&k^LXPilSj!Fw)nY(2CG&1;vg6~yisSMvEuzKE?p8>9Pj5dA#)Kj_+%Cw_WX z{mVjeby#W=KC>J}tfU#URK(NE>ore;cP8G^pz^dys4Ww@88SJ0(wf$N;R z8v{C!)S6&CgaPJ9T&z3oU_rLjx)lSUjCKa{$?}0#jY(%>e2kNEwcTn4lDL`J6O-JOZ=x?jS~4!_BHzVc>Y2+jr5T+jAJ@$qKgHgr z0!EB8eBehDwVI=n$r1JWe2b0^_fEND^RXPVg^TM~mPti&7QfG}0`;&>OphevuO{`t zdN$HAy~rY_Rn748@`Fij)q5AxRc`Sr(e9yb!^`(ld(RE2eCU{>W2?MnI&^mG-Foqs zC~YaPG}>16?nTjPV$k9MCv#r3be_WZ!$MKQ&7_F%JJtN&7g~;*#MAq^n71 zGurQRe~rwSY|sgmb{NIiB+P9!a8;aZ6Q$lQSxbH(Cv3o~+4UyH?e4?-@)qqpZ4E2G zIKay#L*N0+dlHTyJDYW|CvB)tPo%t!#-nNRXmw6bG6k)ivJVs^l~s7&x`5Jwg%)iU zBPRza_RxgYqtL3V=JDifSX|I~jy&Gfw%vvJL4c-(!wBP|z^fE2ovul(eN2NHa@mW~ zn`)im-4b2Dh}9&qGCcP;+)`U$zR7*loUdb#G)*~sVUG5dN3a$>n-E-W32P|*S*G#R zv$|gr`RTqTtyh6kN?P_M*wC|nb0B}szxm7o*ceP68=dZZBfr#B?|%`aG-)-j(bv;h z@1Es;dE2u3Ws`k{z#4Za*(PNKHG%G$oE2s2i+$O_{J{0KJEVF)jeEd)bI82rwq*kH ziN@H;V-Tkhab7G*hlh-%p?W{kR?-JXd6u&-U3NB>`u=9TJ0DX`&O~3H>T}^t*tZm% zYV1IUkHa@dV?!KRq+V%dWA(|FbpR>-qrYWYL+!SSfJS4-Uowg(Gn+aGa z>Fm^iLc_V4{mxc3u$=WarqPEPm@}YKT9~xIhkl~%Pvyy(*gw99OwrX^gEIUX=h9ML zRDCP7ilBECX!~I?Hc-c8<6&aE4?f(I6 zvZwE4jE;%yg*es(;S+m+*B~qhKJhAWHCEo+p9TFSSnm|^{oMId%#Woy4z!anod@MK zCt)Q_nbRRh(fd5rNTR3pu=3;mg4A}V+(qP9j!^ta1Du9ntkMzlVyPx#TDPa?07u8i z$aunz4;iHVOYD&gBa?lTftOGA{VN9k{}x`($cJ&xH!BzQGx8K@BD3-Y-1X2?|8Sq* z54$#*?}LqieScJdw2!op;)Z)5$0RMAnz(~>XEwnWCb#KV8fk|BqUA#&1Ykh*Nnc!O) zdEn(WB(TJNP- z7h@%cgg3Wq2IO}SLnm@-?bB|qhvBqX8FXEiO~jTqW5K22K*f2zYByHQbVzx1!02{j zOaV8xvhq89JiOuxpQy(9Kf7-_+q%p2>_YmKnSQK!Bf>V|)0y4|Ei;>+QQ?2YPjTOaXxFl^J#51L zDP`u)>SIA;GEN>E+%n|p-$8o*O>7VH-*iJ3$qv)6?5z~%G_>e#>E4QpznY>qZ3ypx z7AbsqUG+ip!&INt5?%O*vrIN$&dRSU>1Kk1VQ8c2Bw8#!%Y3@8&J^{No=!NOTx+5Y zRs#e4g>yGO9A;*nG4ZA9&d<(ZEUB`nXalrRS96ND!^&q9%nW{V4E`D&o_cAiANU*W zOTLS+^4}BPSZ{!n%YRg6*%kTu^0Dn!0=;9xB~qtNq8C_%OBp#jE$L-C(U z&O)&^MlOfGD3yq_^0*`Pw1CQalY{@!L?*lBM?zx`nyePl(8$(-i|0}89FG5G$ZpH2 zyAC@qGihtW71)}%A&~Yv;&mrGHNNyI zUw)kAKm#ms^0=yc|)8RvfZ8X@D@t-CQ2iW~NRmpgPl1D=_%g0zuL8`w)OIwGu9Dxb& zSfsYSi#@LDQOp9sUomd{2u~sOAj}19!`|`?@JG&WXi0~*odE65;^->y#7wmmSKs9x zA2FiszZs4wEzZa*;dOzPRalD|`KL)rgFS;YEg36k(Ew9f-FGgAvS26t9+tMOcrj*Z zdk*QZ9LZ0nYpWP;+K#xJ`fRmkhc7a|GuuJr4Iy8cgba?mBhyfNBYy1;_W6>IUya%ojD&_tYli2Zmqkx*qX92utbO(5EP=%gy3Ay#D9pG03@5OGw_kRxEi0hM~MUJ-UUA{uv z2KU2GNPazZC&mxB?D8w%bZMN6y;8r3XSHWBtV`uNL`?78AxRS?_q2I^o7^dTzj`2Mh zXLPL5v91N&0{8~+Zbay85xrs+u^9uR_o*ghfXFw&GH5wCZ_qH0x~t%g1X^ZyL|uw} zAorDQ8=t7T=330cyuPceAIAA*$#?*J3L}3xqy-kiW6jt%a3wh2@2}+>KR(OTd8xer zEBZ=rrCwR;2DG+A3Enx?$JSZIslKUITpf|^O1~W)nv9dXT~?aT`T+rJ-syyDr@iJ- z!T`HSUj8JZ*;$NVCgs=hL^e`#5+3}i8fV5%MppGr@Hw%YX{<{F25UVq?gxhofYas& z=}s_q$S&qJIotTgWSmne+Q??Z$<)#t)mIxz1G*la-?X>?U(5?t+ThjKU z>w=b;$h6zCNY+oX2yN%z;@LsKn*iFTblottVC_LUpf5ABUTBo{;;-1T7hfi-n7qX|Izg1mh|AJCKWV{bq*W$7o+STWyB4+wh2hn z5K%L8Njfx?Rt)f1mD&cOqY4`^B43g8Bh@iOx~^orMOg(6Lqxt0loY`^wmPgP$@qTs za2$2!hAzhLRZ8uX%)vFFYrc#9!pBY=AMi=oBOI|PJdNV)&}4k;APXC_KgWI!x}qCg z)ZuvE;7Z^4AUm}b{uJg%n5oeyf6#yxg;<8;4gEj$+8)S(XHf$%OKykW0V_`SPc+7Z0wDEt8mfr^LzYla!}_?nT4~~d0|)OH!@{ zk#<$8eKP~pzO+k;VHcY!PsM;kw%><5?gH!rkQS|PQxlyLDuwq)`F-5MtdEj$F_EG! zNc;UtJkTRbj5M?WiO;-oawD=BW~aC~wf_If2Z zt&f(G6l)sr-NF<`QR9gL=P%P|R;-vpq zNCt0q)vv)hcoCE;BY)VRsslKC^6!)(&tHu%Sk{;36qv;;g ze9jZ@buK9L+d5G?MkgKZz1yCZ;aB6w?=7jA@HtXWCB3Bkeaj_J{mgHLIx|%efC1?)ns*>^QgrQZ1why!w2L|yqm2J>(X&SU2XuVzmBwCCR4<{cREDMhF%nVRD zgbw3%w2U+lntpjp2J}Nzj@+o;r=Mq*9N?>FM%CCGsVvads`Zsf1rm4(@zR90RfFf{ z&>kPWoX%)nVX=sI)i}~{UNs|kDA@UveJUTNk{Y1ns>MD`^QL2o_7&xasQ+n&8jkl4 zrDndN<%uR0@RDCAwe_TQb|n27wl}nRpS$#AVf72RW6mw+QX^@zTibaPfi6mK=z77E zj9)#h2X~t54J~AVGcpEHV34Un8y%QqPZYf7g_wVYX=JwZ+mrBNiFp?N2c%bsJ7b3y z?-w(TTphmy-j|0?#th=$Ktn@Uv1O}Lp0cEFmp`m+fE5X5S%DPNVwc74iLZfu>4!2D z?oE2V(bE$f{U#sZ1o6$rk#D%Vke0JRlf%lVzRUroGWf%n-^H9GxeX3$ckKzMKZClV z?%5|(dG2zXI%yl&WJcvKxJ3);$Mybv$X}4VvkhrutqLt3N!!NlOvXC~A)~{2RwdYl z>;ULXg3{89OQqa|zTi`d?BKn(tXh;PUPx)%#!60EL-iQH0mGDvi{AY6_aeD&MMc^FT5`wp$$V~1r}Xt~0KtPSRLg4HU+mFw77r2VoLH9B45+A%!C8K}c}=~)e%UAf6`;$GNA}?w!F*ha)%#DN zv_6bjf+ia`z|7&Nsk+ir?U>C^%Ye6mgbQQ!a@{j1R^iX^@`5o`7hrp2#<-@=U$^YI z|DCfuXPUm*eJQGjuDIGugm=!8vUk8Irt2_mH`;y%gtWgj&^+NC6WY`LHy396Ro-#! zjO0$(fY8G(8SzKs8C(8j(pS8o0e`N}D5imSq&WMv;F!aP0XCQ#@Z{1(vV##RCue#x z#f@#m*f{_=1o$0*@@19-2=!%BnI-N7)=bZRn7RSVUb16@598+ScDZSi-;7TmY=t*OoqAgK11*ZXH?Wc6DYD4L`e5GthN1hCZo`v4f!8MFn zXw7IGid#Wd%y4GztdMzbEAE)z9Ryb+(`gasoS(j!vpTU$8ayAL&G8%pwlWk?Lww%3 z@&d=Lyr40{XN&XMgvtpG|Fk>t>`vvG3eVKeJ1@8q=Uo7AJk?xrE{(H@xmIl><)UQt z=(R&QhjD?Nt5fx8IqiXr{f)J0JM}w1KC6A~P-5~nYFCx2!@kgHS^qRRT2_-%)*nhb z?Y}8$3u6DTCH*1f_iX-_q7g#y`e>R^Iw+>EQA= zVVT~&T%};)f|yI?Ige)+^~L_WCySVrHA5vn))Y9*DwJQn+YtdaAFMb$20S%w+UbC> z#?sHqx=f9Yndo2h{2I2ASXKnU(R5njJA5e44LUX-f-W0DOX;2LesI4yJ9rjpe$dl1 zlJO^o)xg0rF(b6FN`|f#^2`S~p}+8WlmBwQB@v2KlpW5i$;SSep0+HoFOaU+WquK` ztWnvB#b9MYH>)xJJ{(BpNU`U%f5|tM=b~W^*5CgwPab)eA0{JIZc&8lj-?;YnP;%A z3UC&rZ#V#LEwjirI#9Q#25d^*{@0v@TI2*d^|*h^X|!(iOv&0NUUY@83O{^jX*j($ z+i^2=D-4c`h!(A}(BY0;@92weS;smqMbkEMo9o@@qg#H>L)!S=$!8N|oK#D2E5dZ- zZ*ux@H9OgfOiwOH`4&v0rVjL}e<cS~_C~9$NiS#W@yZP3uetCKZdRZC}N7wl82G`ax`Tb;Vj* zu|a&YDNo!5`CfLb7MN%EU|uVwS!07(^}3-+V;PFS*#B&z5SktQHd0gpof~G7MdWZo z*;YK&VjW7us;Bp0wZd3vl}xs=B7q6Hd$ zjIh*;RT$ibosdovdv(-WOG<j z>qwn$B%e~ep{Mn{5&1A?R=71Z^=yIWlq1yR-l*K?3a4NJ;AUx+l$ z4j+io_Adu41lR!rU@5=}SPrNHxBxou;^21RN~fB4yK!=dEjzf|JprenEmUw6;9%{% z6IfW~U5KkKp)wDu9ZBRv1MoEAq*%PEaxK<9tf57alFXyB=R*TnF-a0c$hNRLkmkd_ zDa`dR4Lpm}oS=a_P}B;o+KZta=&@ohQ3)GgBx4<=c@W5d1)l{H-7Ee-)3l^G(Ws18 z53Lu-#-|%v-i2NvQ-pGtbtI|)+A@!y^6u2WNBqE~aKA6fL$lVWb~!%J69xR2~;SjE)2MXg0bYcB*hg2-R>zulVUGkEhMErtC$xN)bNsV@e~ zm&ysI`=H^xFzs@yD>@Jx%EZ6KXgQxi8EIJ`0XzzL5J2lNGmr%wF23Le?~B#Opf31A z&2IPX$d6NgzB(uPye~^y49Wg%lTBU^3^?6ylk&tdu*EdCy2CcVx+@m0svpO z5Isev1OL=w)LG2b+g^xDbsk5!f9~Y=Dvv8)kk`BZkZ`Gx*35xuac^u3*0NKH!Y0P{CeGf8M~UN^2y$!M9V0d~ zq-4j6IotovvV}2fn~Q$yFpF;?jkL%L5%uhN zV($6luXHnd+N;lqMv?J%AWr8pK4uiZgH&eG@ar+xTzwR|J8k}o*34?g`awb~r28|# z`A)_Mhu&GmN$)2Lg`DsRKUZp)OSPG+u~v+Z)zPs_$83;}Ta0Hq=jiyQ>&b9(J!H|4 zNDdo(L`b)qLiJQ8;0MqUKv$wJ3vK6(iCm-EpVA$^$4V^)HYT!-8sD)5Uu^b6zX|El z{6_PpdC+;I@ihc};pxyE;3U(7LhH@b+|K^1oIZDPaW zZHM`isV6H|tvy`vAYD5Zd**ri_D$mRnA7^c)C%exiiD|;HG^-i|2TTI<1D|c<1G7c zloI*%$a-q-D{9qUp4oz^^zKH!==+$aC=PB|Z;a+o+l7`_?cEWa6?TT*tE})=!Q!N% zWPAcRH>2fbU}eBl3kk%}fql85B^&%HtG}l3OY%aq)uX{Z=*d6|3?YrzBxZ*Uu;3qz z?Lu4Z1Z)HB0XzeE4uJKq(lO6byTz>re_^cXJI*#Pkck%i#a8HaC5n9$y{2Gx@T2D9 zY8_&gw=-oOIMLzu{*4LO+^IMph=hzmxaBEnwHv2o=H$_Zr9wR$Y%-v9{8Vh zE;#qTj_cO36^Zh|OW|k2**<%10r+&<0pgqn`S6VcG?ouk`!gYB6?_~i1i{Y{wuLUm zbizgO2`K-NmYvpt)`ixA){E9J(UMb>GjF134LXALunkJI*@9VB2Ct?zN6M-?)tukV zb|2LfX;EUD@K%C1a042$tuoDP3+B|GYOcRrgR;P)Wa0Kg#`Lzid_uGz@Rz_?FHyIOH0EGTan(w_x@g0T`1}Ow@NksU49l{U>9p2 zjb9oz)-oPgnZsKFteVi`@z^bIz>|Tap?Rt6oeP|Cv1{WwuB@PWDZ^e&E?VqrXpY68 z4DZu`Ghqs-eP%xo&IltwUyi(cRz+~0Eb93JAa@7GCPtsLr4O?GTP1i<@qZa^>K(Jb zptDmNCoxXu>Q29D)veGs9(x}@K$htJj0MJ}7k95>oX~Y9mI~9d-OCIjrH%&Cd;KwR zYGX8Axn&&cxcBhQtHw)P%_^BwO@>bK*k3`n<}UwS_##I-yu5qW9M|q;M6ifIm5wJ& z9awcU*LX|1U9x(%)?cKypEUhbj?`-J^w?Yr^6R8;~e&VmEb)624 zz*VVwvP*bBGySjlLhENCty_u`{!qhI9@o7Fi+X8WINet$Js3{+=1CYe3scley5H#M z4;s&Eh)v|1oNt*b=`~PUj=Zl1Q~~}D-3ndgQ}~GKu#W+U>TgM^7ijhy+A_VFkct?k zn+gs74(o?Y&c}4#w98LUS>apOr}EMmw-)C5-(T{1?1d0~gggKp{*kmh?9`@>MQVY{ z(RYkUwSpLV0jxIk?XdHM){wU4lmH2S($LB(v8n8(5ot~Nbr$Kc8(z~zPQg2v&ZqlP zZt5=Be)(XZ(yl@&%zpZdu3xlHG=G|(3S}|0sJ-f%9LXj{ZUw&+c~H$~8|nx1dBk%8 zv@IRTzd31dr8aj)l!8Nw+BW)*mg6fW9lcktq;ve%4hI)G<A?1>CU;)md|Ln4`{l3|bFV}y!#=7xMxPz-&+>IN7eK1< zZ7c&NSsi9~XyIciN8)yXnl$hSa?qDNcJ2T$Zbb%kxxO<{R$6D;uT&O8#~8imAR$O= zr7}PI1p460dpaXA-*69_a>1ib#J(U>vS2pkD;oF*L%$Sj;Zs_r;0Q%EMc(51#q&N( z?AZfo%JxG#?q_YY0~Vjt@9=L2HENaMUk7KPkuN4z?BY0?U2{} z1X=^h_{5=!ij4Mrq}WS)$PhGDGNs+oX_D2ao@RoSq#CmSWIShxg$5L{cE;FJc%mxJ zjF8gKsM$BB%Iu$W=`{A@Zp@9pL}(h2HNBOm*bH*AhBMNZheR$5PgD+gmV+gs1~W2E zNk0{TEUXo2Z&Ur@XHfQSfF*z@06PIM0CoW$1Ss;ugB->b_=z|*GN|axY1x+#FoM$e z$bUmS_uP#&+*H^3$3pD0tAj>4i(M7TEd6(Q3%fZ|8eFKp@kF+I$qBRPV9@O82IR;| zwkG=ecda6r<>CpJru$|2hyB(lWXwB07$@r|~wJ5n$ zqMJ& z#W8EBc5xqM`M`e%N9&_$7bNlR%NGbngFchX`r1hRKs7Dz;im5DVRqw;s z(uc8BzWYYPw_{Wy3w=rS1084g0YZRU0PP#vS5#y2DEymfe3a(Kh{jmUR_Y@U5P1B{ z6sQIZX{X;X{|>&VHy>I=h8CkAb{(S-z&&KbCipAO_nR;$0I0#spcpxPos3UK+xAD3 z@pIsPU5aMc&=$9#2IYAEEp!NJEh&wkj4y^=7#%-fg2zh76&**k+;p7LIy}EVi;R|? z)=TfjS`X<(I!cp_XDYL#Zh*?8XrKIMfYztAA1wx5VA#eC(7k|;Q(B)TfGfdokWJ#T=2EE?4^C_*II*-md^t3W-ojYGxX?P7c2ML} zQ-4Ty>EPW5tDuu1h8X}#6MUO=!D=IA8L9^bU;vaCC*!BVgAp;JLW_P%asS+R6GGmx zgce~DLOnt|LIc9d2y+oS5t`>XMGo(=1P%|q7=WE*t&`eA zQoG0nvcZO!R#M8H0!=WTIIj4_idhQF<6@cuDIGu?8LT-L*h}X8=!q?d#<7m|nJFEZ zOG*YJ1TD*>E@TFA3`A%Snbn5>#)clUW@Yz<&Uy!NJ#iy(Rc(N`5t+EY%p@*gPX^c1 ztc%*&lP<e^v(q>YYxLJUlozRd7HjLX`u_c5qD{@ z*iTt~(tV+b+KMB+=)=_hFlSzl?_BLGwIvU{V1A+5HQCP`N+YnjQosT z$N-7$H064X{k9oj{zL;yun?g(Dqlzr&lmm`o5y*6_HcO{K^inYJ3_;2*}ggBDaV4D z_TiQ-Tb@|eVBVe(gob8%5}gsUD0c;=VAF5^`R<8eM^K4nh`zV%_N`Dpfy=i*1 zY*dS}j&MC8*p(HQG1IlBH~V)l?~QUkzUt=XN36S763amRf%efdP;F`YuWj*#wN)EK z#P)88g|8*bV`VUhdAbArY_yGfFSi5i5QDmPL|)G=9d9aHQqiH)qYlJl@LE0D_bWE@ z7c;8^t@^Th7xiZyP2|qBRUE~2G%W@z7JKa<#WUVC@s5fQ zbcT8QB6wL}IoV@-nAkq|uXuQS>rBt;hhXKz7GMpUf%0M>@7)RdqyjBCnh!kG!+$R2 zM~t$3` zTF;!#WHUWG5GyuXQLD&aX&#g}u+{gQ`Is%>uoQ|+@dQ!T4@(KyPt@n{pmxa}l(V9W z=qtuv9=%MN;OLIVG^!I+a>rOOj^)<|AM)8;i^C5ovw`xy{xkGztc3qid`T3uMJLvR zz7G|F=P!UxM93hlMaUw20wITR8$ur8PJ}9iyAY}oJ~Lx$LgQQ|(wyEL^s6){R`|>~ zW5Xr?Hnbe;`8C6*dCiHR`aY>`sI7Cm&hHK-<2MZdWd6+yGH`ALqt*7S&cE2BhwHbK z&66Uz0vX^|yx5b$9#3dBR3gs88w1h9W^?VsiM)<|y*us&<=^#A^V4(p_14|H4>Rcg zXfvLeY9E^$IHv0T%~~;G>lp1fW@he`kE5S66(?rl9E-c|`%l2-cg3G2y0$fnD8Yr< z?laAX2%UYZ62NTldrZKUBt_>ltDg9GF1pSfciobe*79lv+nl6yE7z)tE&xqI_8aG%96IaA;wD z23kj!;eD9_9)WR7p}h-cLSF*D0sPp9$wEl;-2m##!~@6yXj;IvvVnthO%i9bE8G|- zcymHZCqRSU^*ih~RLACP=x~xBy-V#tdLDiR410PQBem=5i7|F#3yU^*K6K-8*1jm} zSG-;1s0L18_gYSOsnNc?1)ALXmuJCEUIVN=e`Dj$=T;E=gVE~q_fO0AoBY|>?;gVb z4$X2OvETcn=RTk7{1?~{`7#&u+(uK~cZughmP&YgD1<+C-Zt0Uh4bepVMlx<`+C0_ ztNK&G3I-yK?ZflNukS;boyLjljQVr7VVoTo0FEzgp)s}dOIwU z)*qe}DLX4E9xYEYejD=pGjKC6YC$vBP@-|vF|0e8hPDY;4x8h$) zwgM&F?aphrZCbI3DQjpR)2@_u1J$)0wT;%GzPaL}@HUYY&z<{9vnn!8EJyBbNoJ;@ zRk04=Fi<<*gFVW|ZK&9=aYLZ;Xb;0sj{OJC$@nzjztC5$p{+h?kXi_IC$+vp=(}PU z3u(R36b%{uunU7t=JR+@>4+w*G)=&tUjxX>o+K~W?=#mv+Eg!+(z(%>7hF~AI~g4-CYg9lkoW2Wt(7{#kqY*&0ekSd%M2GrQ#64fKoI zq20dU&d;x%5e)b4T|X0?gP%pzojtHXZv_8<*k*$b?>avZDc>9k_a0e)KKdKqliq@0 zA+RM5HY}&4C#rYBy6bC5S`Od~g?f8(`nnwKwJ!N+Xze<+qb7Qx)||$csug`SrZhX6 zV+&QYT_I4)zS>`GdJa84Ui>|*y>m}Kh&Aw}vM&-vqOTupjh$*<;fQzs(z^rvTj)oX z^hDBwU&N-1YoWV%Rf0@C8!1^A@Ro@m=xD1xgnC=xw`1>GT7%U-vt+DoXeN%|MZhnG zUb!(;vMv?VncNc7I`X2-#2nl5>f5V~1N@47&vaVHEgRr&$&7Hn;3|{3%iuHLFyHxEI1yzh`d7;nT1yPL~{V%9U5b6*0CkfBrUlZ z#Xi$TY|TNhXB+$}e-qsv;15i$wkFt&Lb_`kr-=;`)psEFe?;4$SEY6QSLewXEMGas zkrgeO=X@Xs*d4!!#rNa9tUWt$J?xBbi?HC_SH@WT`itVLYvEmc{YCey(;lF0dE3CW zby5ucr|3Ru`8vxw>RaYe{}1=w1K)nlIj+0d{X5=K1bt#^!SmJc_JC7#`s+rF*#m&L z0CWt$0yqLV16s8M;bZVuCIIOCk}%GXyp|f{f5$ja`7c=C+x|Q9_FG@4i`wc!l$6VjD4 z0lAZDwaoM#&1s>c)@+P|l)o|R#Q_%QNdFMkM4Ak5@6g&&(fu2GEIOwK`V2gB(i$+= zcQE_GD;xR;Z5Nb{whhf|%GpGP_E`;NJ=?_HB0F&f^oaTB=^*8&&zY-@P>&*?C^N56 zFm*8#zl&Lv_3hg}CnQ;;B@u+QuIGav>2ljk0-F-VU_NT?9zURE2wnZ5R1DG{!S{id9G@C=1(~4|UkcJWsHO6EP!cYyzB;1{yU5`3b;mTE zc=3d`m4Pft<4v6g)dXwxOHs;~IHma-^X;qH`zTwY6}}yjF0Bu2h->s!YK) z!J8&m^hRvVWFY{Al6qX(RrV4-J4@UuiH#5;uOigjs@ zanaN}b+^bmLW{`pLQ9aH?)H!!6&}`V!ATC32Ui}>y*v^WS=u(d=O0cx@`1|tiFY<6mw0DREzLsEKm46Hb#I&vp~lnZ3o(pM<8XOHXZ~sk^F+;S4(0e93O%AOC0Y<##aBK`wv{cM-ZuJ!;YA>G(VbG4gIkJlC!Gz`ZXoN zAHGh;=P3Ra4@Fkh3gXcVE|x)>^t%^gbi6hu_Qb{udt!RwIkd^2QAavP==>!3qjjbs zcpYA492cp?&x4!Yz+d1GrM@|%Iuot*)_@Dv?5Bg2o4F+6Y=te*sq#VVd{)z=c6(+j0+iiW?|g>%?4|Jiw0MnV4!w|74%EcXfk# z-*Q-#!H>{nC-n3alq<_)@1tYw=R@&WU9(dxMJb<-MBfFIM%( zW8jg}=cB(r8~L4@oBvmB*B{ixmB-)i2J)jpsMU(#z?#s?4-HHB(SV%BB&-G$IHfn< zcs&eBEU7>+M8#64N%2}+?`nT&PkSBfh}Wz2Y7gz*$kk3e*1NX%qeEzCD(%s+=hQvm z+JfQ`5*zOGHi%;FpSPK}Z}Z;wz5V`rZ{NQCzVA!SQ$o9*5e;aYwRw4=dDZIn#8CrB zo@aH5qxoD8Y~LHcqZXF5H;(s@)H({b8o}f3kB65C^W>3|QOwl80Ir&V+2g?Mzf+h| zPA<&)N=nV5GNE`-Ubg;Gk5z7ovR;qyJDH8)qh?T1l+JvW$S;$ZDJIsSg^Qz7dGb?9pF5XYBEg1wjzBG7lLf7=p-S;Q#s>_m|M@Cd zDB{U}H^vE}h?f6Mnw`5mw4s{%nBfWodZBSkI-47&C+0_f-|j{N^Y2!pbW)Zi~fRCM$C^k@8F+ zc}bsN?8wc_=9>S9rTZ7w=WjXN;2(YlM68ld$PsM+fu5Tj)ztYR*Kj zjF4Y*(UkXC8@;1`g2}j7?nQ9l0PRU$lW3c}f1Slj^&9az3IAzd8%9j^{Q$dgA>>F?kruAj+A#!XezI#oxYT*S3(o>Qz$=M@r`Hs*qIZJmncs3p!iXo>ARx7 zy{!j!so_SX1U*Et0&d&{ObC_+bCZ$YYl)yU)_+bA-LZN0j6H z%`1mE)jo60(A;Xh_H;Bho*DVYwOP@5yRAbit1_w`J!nz)52q?eCxyUBdhj4-D^r8) z@;uuH%=@2;#ztmEQwnWEoQ*`a*N#@G`xnnA@O2m%Q3j7zm@g}WtZA{$Jft)q9mY)7 zqKxiO%tZg!L1HbXzT2MIgW8D!7TN)_2&oKYDW{)`bdHn!m7zTr_G5SryBrDZN^`)j zj^Pi8bp0-1R}DyP&*T@BCOWgaH(*bvQ~>`lv#2{7yQbI9iY~Yl9&xNHnGPlB(1H%O z?;vXYXJD83)3mOWfTT3cu?{J0uzd<2u24?V!1f)6t>m8qsp8RLmBKuvHNPyqKgw(0 zGV3DRSoIJ$i-{=5_=xuE!ie@t%}~awd#tCT;fcjsRdjw~X5{Gz_+nK@HDfPX*og8n zi6}?!=+6KZYMGl)1YQC+cLk1(vg$Tldiv|&XLv*fepbl*)I^R{r~t1}P>ycyJ5u54 zXH9-^Q*DO-%O{TxYZR+1&WcrH-N!%fB?eD#_pm0xHOwg#5$(0_%-77ThY}LNsXDS~ zr39&Se1wCTHQ@A`BBR$A5!jqO?3nWemq9b2mKPEs>2?Y6-C)iBE`&s#DM zS~R^hheb|U>a<+#52p5|eJq!NpQtqq0(Q+4ah*rMfu*J~COW6al){p`r}b^Uh|=|_ zcf(IImh{ZAb>YtRUqo6U8pW?MZ${n;pHZDTgqgUTuW6fR@Ohg0G*xhFMK+k`A`Y?% zE*rOELmof6K09ea+E(mG;76*5xN&taXCX~UbI*WmA!~_9im_LK37-fBqTvc~U5IPl zZQ<9UJgw1zy0U%%!cV+_agYZAd;40fQ@D9aGg%G)thEU32!{|}Mfe-SHwgFwNruax zflEG~2Et;hjWv^HneboE;CJK5vA`un^;)smXsM~G<9TsKT|o)Y^W_U&UZ;OYtDA51 zH#aTQl*>_hgV(iVS$Uh&=V|pX(=>UV4!_6SV(__Jn;cGewyx3dZ*42f&)>d%yTRdd zZ1QdO_zg~PbAGGO>)Pt{=Lh2zy?^c6it0K_m`nyG(Bk#_o4gK}+sETEB_wIqcwO$MGJeGr3cRIh zt6N5fZ=tj%X)Ioc&$YyEE8}J2mrMgJ*@ogb>MP^d6%+}4i9s+3i{nv}M)o0xx^3e9 zWcn8N7T4A`zt7`tBh_A?%j4v0tt$!yp}2&6uL_DdT|cZ3of)cc*U$ap+u5^e8nq)} z5$}ICnS>DTd_I{l`{*;6kT0L3enbdavp<~jzZV0tioMMg)v{X5?T9>%ZIS1mUAqlC?juy`*cbnhv zP@A`b=T8$WqdqEPIYbCTEEThYeQQ@hF~aOEJMqAZQf0OmwTJX>8@{>ZU!@o z%U}(jmikSeCO2|)ZLa!;CIeD*H|mK4HPyFy9;PtHVq=NvmRy&^e@hiexwQ&Ui^pHz z>Tqs$`|FYI_#P(mjU275O`dq?aT8%h#?qqFlKYIMH_=DI>7kpV(Fane_)t_-R8lw- z$D1K(?}fXYjJE;V1&%FhJ8>TrgqcwFZDK0K7 z`d-chGg5ZWte#3?irEE4rXu5w;ydMHJ2g9Ns~C0;cSC{p4{S73rKUkGt5y8;W{}2l zseSn+f*D8sGAZdKR#y|7VF@H{HIuBfu|)>b7X(rmo>kz Date: Tue, 7 Jul 2020 13:01:21 -0500 Subject: [PATCH 0253/1293] modified: .github/workflows/build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa7dd9dd25..68dbb04c76 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -236,6 +236,7 @@ jobs: - "pyportal" - "pyportal_titano" - "pyruler" + - "raytac_mdbt50q-db-40" - "robohatmm1_m4" - "sam32" - "same54_xplained" From dc2f729d193e18238306d810e822ae47befe6c2d Mon Sep 17 00:00:00 2001 From: Arudinne Date: Tue, 7 Jul 2020 14:37:08 -0500 Subject: [PATCH 0254/1293] modified: ports/nrf/boards/raytac_mdbt50q-db-40/mpconfigboard.mk modified: ports/nrf/boards/raytac_mdbt50q-db-40/pins.c --- ports/nrf/boards/raytac_mdbt50q-db-40/mpconfigboard.mk | 2 +- ports/nrf/boards/raytac_mdbt50q-db-40/pins.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/boards/raytac_mdbt50q-db-40/mpconfigboard.mk b/ports/nrf/boards/raytac_mdbt50q-db-40/mpconfigboard.mk index ec39f6fd81..f49618e776 100644 --- a/ports/nrf/boards/raytac_mdbt50q-db-40/mpconfigboard.mk +++ b/ports/nrf/boards/raytac_mdbt50q-db-40/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x802A +USB_PID = 0x80BC USB_PRODUCT = "MDBT50Q-DB-40" USB_MANUFACTURER = "Raytac Corporation" diff --git a/ports/nrf/boards/raytac_mdbt50q-db-40/pins.c b/ports/nrf/boards/raytac_mdbt50q-db-40/pins.c index 33693697a1..f6a6ed5ed4 100644 --- a/ports/nrf/boards/raytac_mdbt50q-db-40/pins.c +++ b/ports/nrf/boards/raytac_mdbt50q-db-40/pins.c @@ -30,8 +30,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P0_28), MP_ROM_PTR(&pin_P0_28) }, { MP_ROM_QSTR(MP_QSTR_P0_29), MP_ROM_PTR(&pin_P0_29) }, { MP_ROM_QSTR(MP_QSTR_P0_30), MP_ROM_PTR(&pin_P0_30) }, - { MP_ROM_QSTR(MP_QSTR_P0_31), MP_ROM_PTR(&pin_P0_31) }, + { 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) }, From 57ab4f1329f61844409735189a482359d7d4b7a7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 24 Jun 2020 11:28:28 -0500 Subject: [PATCH 0255/1293] stm: SPI: revamp pin search code I discussed with Hierophect on Discord about how to "de-nest" the code for configuring SPI objects on STM, because the problems with one nesting level per pin becomes unmanageable with the up to 10 pins of SDIO. This code (which is only compile-tested so far) demonstrates the concept we discussed. The SCK pin is always required. Loop over all possibilities of the SCK pin. When we are considering a particular item in the mcu_spi_sck_list we have now become committed to using a particular periph_index. If all the other pins can be satisfied by that periph_index, then we have a working combination. Once we have a working combination that is not reserved, we can return that combination. On reaching the end, we have checked all the possible possibilities and can give the same errors as before: One if there was a possibility that worked but was reserved; and another if no possibility worked. --- ports/stm/common-hal/busio/SPI.c | 148 +++++++++++++------------------ 1 file changed, 61 insertions(+), 87 deletions(-) diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index c76705cd85..d4dd6cb3fc 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -107,105 +107,79 @@ void spi_reset(void) { spi_clock_disable(ALL_CLOCKS & ~(never_reset_mask)); } -void common_hal_busio_spi_construct(busio_spi_obj_t *self, +STATIC const mcu_periph_obj_t *find_pin_function(const mcu_periph_obj_t *table, size_t sz, const mcu_pin_obj_t *pin, int periph_index) { + for(size_t i = 0; iperiph_index && pin == table->pin ) { + return table; + } + } + return NULL; +} + +//match pins to SPI objects +STATIC int check_pins(busio_spi_obj_t *self, const mcu_pin_obj_t * sck, const mcu_pin_obj_t * mosi, const mcu_pin_obj_t * miso) { - - //match pins to SPI objects - SPI_TypeDef * SPIx; + bool spi_taken = false; uint8_t sck_len = MP_ARRAY_SIZE(mcu_spi_sck_list); uint8_t mosi_len = MP_ARRAY_SIZE(mcu_spi_mosi_list); uint8_t miso_len = MP_ARRAY_SIZE(mcu_spi_miso_list); - bool spi_taken = false; //SCK is not optional. MOSI and MISO are - for (uint i = 0; i < sck_len; i++) { - if (mcu_spi_sck_list[i].pin == sck) { - //if both MOSI and MISO exist, loop search normally - if ((mosi != NULL) && (miso != NULL)) { - //MOSI - for (uint j = 0; j < mosi_len; j++) { - if (mcu_spi_mosi_list[j].pin == mosi) { - //MISO - for (uint k = 0; k < miso_len; k++) { - if ((mcu_spi_miso_list[k].pin == miso) //everything needs the same index - && (mcu_spi_sck_list[i].periph_index == mcu_spi_mosi_list[j].periph_index) - && (mcu_spi_sck_list[i].periph_index == mcu_spi_miso_list[k].periph_index)) { - //keep looking if the SPI is taken, edge case - if (reserved_spi[mcu_spi_sck_list[i].periph_index - 1]) { - spi_taken = true; - continue; - } - //store pins if not - self->sck = &mcu_spi_sck_list[i]; - self->mosi = &mcu_spi_mosi_list[j]; - self->miso = &mcu_spi_miso_list[k]; - break; - } - } - if (self->sck != NULL) { - break; // Multi-level break to pick lowest peripheral - } - } - } - if (self->sck != NULL) { - break; - } - // if just MISO, reduce search - } else if (miso != NULL) { - for (uint j = 0; j < miso_len; j++) { - if ((mcu_spi_miso_list[j].pin == miso) //only SCK and MISO need the same index - && (mcu_spi_sck_list[i].periph_index == mcu_spi_miso_list[j].periph_index)) { - if (reserved_spi[mcu_spi_sck_list[i].periph_index - 1]) { - spi_taken = true; - continue; - } - self->sck = &mcu_spi_sck_list[i]; - self->mosi = NULL; - self->miso = &mcu_spi_miso_list[j]; - break; - } - } - if (self->sck != NULL) { - break; - } - // if just MOSI, reduce search - } else if (mosi != NULL) { - for (uint j = 0; j < mosi_len; j++) { - if ((mcu_spi_mosi_list[j].pin == mosi) //only SCK and MOSI need the same index - && (mcu_spi_sck_list[i].periph_index == mcu_spi_mosi_list[j].periph_index)) { - if (reserved_spi[mcu_spi_sck_list[i].periph_index - 1]) { - spi_taken = true; - continue; - } - self->sck = &mcu_spi_sck_list[i]; - self->mosi = &mcu_spi_mosi_list[j]; - self->miso = NULL; - break; - } - } - if (self->sck != NULL) { - break; - } - } else { - //throw an error immediately - mp_raise_ValueError(translate("Must provide MISO or MOSI pin")); - } - } + if (!sck) { + mp_raise_ValueError(translate("Must provide SCK pin")); } - //handle typedef selection, errors - if (self->sck != NULL && (self->mosi != NULL || self->miso != NULL)) { - SPIx = mcu_spi_banks[self->sck->periph_index - 1]; - } else { - if (spi_taken) { - mp_raise_ValueError(translate("Hardware busy, try alternative pins")); - } else { - mp_raise_ValueError(translate("Invalid SPI pin selection")); - } + if (!miso && !mosi) { + mp_raise_ValueError(translate("Must provide MISO or MOSI pin")); } + // Loop over each possibility for SCK. Check whether MISO and/or MOSI can be used on the same peripheral + for (uint i = 0; i < sck_len; i++) { + const mcu_periph_obj_t *mcu_spi_sck = &mcu_spi_sck_list[i]; + if (mcu_spi_sck->pin != sck) { + continue; + } + + int periph_index = mcu_spi_sck->periph_index; + + const mcu_periph_obj_t *mcu_spi_miso = NULL; + if (miso && !(mcu_spi_miso = find_pin_function(mcu_spi_miso_list, miso_len, miso, periph_index))) { + continue; + } + + const mcu_periph_obj_t *mcu_spi_mosi = NULL; + if (mosi && !(mcu_spi_mosi = find_pin_function(mcu_spi_mosi_list, mosi_len, mosi, periph_index))) { + continue; + } + + if (reserved_spi[periph_index-1]) { + spi_taken = true; + continue; + } + + self->sck = mcu_spi_sck; + self->mosi = mcu_spi_mosi; + self->miso = mcu_spi_miso; + + return periph_index; + } + + if (spi_taken) { + mp_raise_ValueError(translate("Hardware busy, try alternative pins")); + } else { + mp_raise_ValueError(translate("Invalid SPI pin selection")); + } +} + +void common_hal_busio_spi_construct(busio_spi_obj_t *self, + const mcu_pin_obj_t * sck, const mcu_pin_obj_t * mosi, + const mcu_pin_obj_t * miso) { + + int periph_index = check_pins(self, sck, mosi, miso); + SPI_TypeDef * SPIx = mcu_spi_banks[periph_index - 1]; + //Start GPIO for each pin GPIO_InitTypeDef GPIO_InitStruct = {0}; GPIO_InitStruct.Pin = pin_mask(sck->number); From 5a9aac472a42b39a34e906a4260dd842f388d9f2 Mon Sep 17 00:00:00 2001 From: Arudinne Date: Tue, 7 Jul 2020 14:37:59 -0500 Subject: [PATCH 0256/1293] modified: ports/nrf/boards/raytac_mdbt50q-db-40/pins.c --- ports/nrf/boards/raytac_mdbt50q-db-40/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/boards/raytac_mdbt50q-db-40/pins.c b/ports/nrf/boards/raytac_mdbt50q-db-40/pins.c index f6a6ed5ed4..33693697a1 100644 --- a/ports/nrf/boards/raytac_mdbt50q-db-40/pins.c +++ b/ports/nrf/boards/raytac_mdbt50q-db-40/pins.c @@ -30,8 +30,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P0_28), MP_ROM_PTR(&pin_P0_28) }, { MP_ROM_QSTR(MP_QSTR_P0_29), MP_ROM_PTR(&pin_P0_29) }, { MP_ROM_QSTR(MP_QSTR_P0_30), MP_ROM_PTR(&pin_P0_30) }, - { 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) }, From 959b4da9bbaf48e10707b1a5859f7cc4c5ee0b84 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 7 Jul 2020 14:38:34 -0500 Subject: [PATCH 0257/1293] make translate --- locale/circuitpython.pot | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 6e32ebab98..f3c9d04113 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-02 15:29+0200\n" +"POT-Creation-Date: 2020-07-07 14:38-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1092,6 +1092,10 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide SCK pin" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" From a5ab2829eb90f15d0b78678cd2f2aadd18160fed Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 8 Jul 2020 09:33:41 -0400 Subject: [PATCH 0258/1293] use zephyr include files; wip: compiles --- devices/ble_hci/common-hal/_bleio/Adapter.c | 51 +- devices/ble_hci/common-hal/_bleio/Adapter.h | 6 +- devices/ble_hci/common-hal/_bleio/hci.c | 674 ------- devices/ble_hci/common-hal/_bleio/hci_api.c | 646 ++++++ devices/ble_hci/common-hal/_bleio/hci_api.h | 69 + .../common-hal/_bleio/hci_include/#hci.h# | 1775 +++++++++++++++++ .../common-hal/_bleio/hci_include/README.md | 2 + .../common-hal/_bleio/hci_include/addr.h | 100 + .../common-hal/_bleio/hci_include/hci.h | 1764 ++++++++++++++++ .../common-hal/_bleio/hci_include/hci_err.h | 92 + .../common-hal/_bleio/hci_include/hci_raw.h | 152 ++ .../common-hal/_bleio/hci_include/hci_vs.h | 379 ++++ py/circuitpy_defns.mk | 2 +- shared-bindings/_bleio/Adapter.c | 39 +- shared-bindings/_bleio/Adapter.h | 2 +- shared-bindings/time/__init__.c | 5 +- 16 files changed, 5005 insertions(+), 753 deletions(-) delete mode 100644 devices/ble_hci/common-hal/_bleio/hci.c create mode 100644 devices/ble_hci/common-hal/_bleio/hci_api.c create mode 100644 devices/ble_hci/common-hal/_bleio/hci_api.h create mode 100644 devices/ble_hci/common-hal/_bleio/hci_include/#hci.h# create mode 100644 devices/ble_hci/common-hal/_bleio/hci_include/README.md create mode 100644 devices/ble_hci/common-hal/_bleio/hci_include/addr.h create mode 100644 devices/ble_hci/common-hal/_bleio/hci_include/hci.h create mode 100644 devices/ble_hci/common-hal/_bleio/hci_include/hci_err.h create mode 100644 devices/ble_hci/common-hal/_bleio/hci_include/hci_raw.h create mode 100644 devices/ble_hci/common-hal/_bleio/hci_include/hci_vs.h diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index 5f5259f7ef..9dbeca68f5 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -31,7 +31,7 @@ #include #include -#include "hci.h" +#include "hci_api.h" #include "py/gc.h" #include "py/mphal.h" @@ -179,13 +179,10 @@ char default_ble_name[] = { 'C', 'I', 'R', 'C', 'U', 'I', 'T', 'P', 'Y', 0, 0, 0 // common_hal_bleio_adapter_set_name(self, (char*) default_ble_name); // } -void common_hal_bleio_adapter_hci_init(bleio_adapter_obj_t *self, const mcu_pin_obj_t *tx, const mcu_pin_obj_t *rx, const mcu_pin_obj_t *rts, const mcu_pin_obj_t *cts, uint32_t baudrate, uint32_t buffer_size) { - self->tx_pin = tx; - self->rx_pin = rx; +void common_hal_bleio_adapter_hci_init(bleio_adapter_obj_t *self, busio_uart_obj_t *uart, const mcu_pin_obj_t *rts, const mcu_pin_obj_t *cts) { + self->hci_uart = uart; self->rts_pin = rts; self->cts_pin = cts; - self->baudrate = baudrate; - self->buffer_size = buffer_size; self->enabled = false; } @@ -198,34 +195,15 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable } if (enabled) { - common_hal_busio_uart_construct( - &self->hci_uart, - self->tx_pin, // tx pin - self->rx_pin, // rx pin - NULL, // rts pin - NULL, // cts pin - NULL, // rs485 dir pin - false, // rs485 invert - 0, // timeout - self->baudrate, // baudrate - 8, // nbits - PARITY_NONE, // parity - 1, // stop bits - self->buffer_size, // buffer size - NULL, // buffer - false // sigint_enabled - ); common_hal_digitalio_digitalinout_construct(&self->rts_digitalinout, self->rts_pin); common_hal_digitalio_digitalinout_construct(&self->cts_digitalinout, self->cts_pin); hci_init(self); } else { - common_hal_busio_uart_deinit(&self->hci_uart); common_hal_digitalio_digitalinout_deinit(&self->rts_digitalinout); common_hal_digitalio_digitalinout_deinit(&self->cts_digitalinout); } - //FIX enable/disable HCI adapter, but don't reset it, since we don't know how. self->enabled = enabled; } @@ -235,35 +213,22 @@ bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self) { } bleio_address_obj_t *common_hal_bleio_adapter_get_address(bleio_adapter_obj_t *self) { - common_hal_bleio_adapter_set_enabled(self, true); - - uint8_t addr[6]; - hci_readBdAddr(addr); + bt_addr_le_t addr; + hci_read_bd_addr(&addr.a); bleio_address_obj_t *address = m_new_obj(bleio_address_obj_t); address->base.type = &bleio_address_type; - // 0 is the type designating a public address. - common_hal_bleio_address_construct(address, addr, 0); + common_hal_bleio_address_construct(address, addr.a.val, addr.type); return address; } mp_obj_str_t* common_hal_bleio_adapter_get_name(bleio_adapter_obj_t *self) { - uint16_t len = 0; -// sd_ble_gap_device_name_get(NULL, &len); - uint8_t buf[len]; -// uint32_t err_code = sd_ble_gap_device_name_get(buf, &len); -// if (err_code != NRF_SUCCESS) { -// return NULL; -// } - return mp_obj_new_str((char*) buf, len); + return self->name; } void common_hal_bleio_adapter_set_name(bleio_adapter_obj_t *self, const char* name) { - // ble_gap_conn_sec_mode_t sec; - // sec.lv = 0; - // sec.sm = 0; - // sd_ble_gap_device_name_set(&sec, (const uint8_t*) name, strlen(name)); + self->name = mp_obj_new_str(name, strlen(name)); } // STATIC bool scan_on_ble_evt(ble_evt_t *ble_evt, void *scan_results_in) { diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.h b/devices/ble_hci/common-hal/_bleio/Adapter.h index 565963dc0d..73b9fed0b0 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.h +++ b/devices/ble_hci/common-hal/_bleio/Adapter.h @@ -52,13 +52,9 @@ typedef struct { bleio_scanresults_obj_t* scan_results; mp_obj_t name; mp_obj_tuple_t *connection_objs; - const mcu_pin_obj_t* tx_pin; - const mcu_pin_obj_t* rx_pin; + busio_uart_obj_t* hci_uart; const mcu_pin_obj_t* rts_pin; const mcu_pin_obj_t* cts_pin; - uint32_t baudrate; - uint16_t buffer_size; - busio_uart_obj_t hci_uart; digitalio_digitalinout_obj_t rts_digitalinout; digitalio_digitalinout_obj_t cts_digitalinout; bool enabled; diff --git a/devices/ble_hci/common-hal/_bleio/hci.c b/devices/ble_hci/common-hal/_bleio/hci.c deleted file mode 100644 index 7d4add9afd..0000000000 --- a/devices/ble_hci/common-hal/_bleio/hci.c +++ /dev/null @@ -1,674 +0,0 @@ -/* - This file is part of the ArduinoBLE library. - Copyright (c) 2018 Arduino SA. All rights reserved. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "hci.h" -#include - -#include "supervisor/shared/tick.h" - -#define ATT_CID 0x0004 - -#define HCI_COMMAND_PKT 0x01 -#define HCI_ACLDATA_PKT 0x02 -#define HCI_EVENT_PKT 0x04 - -#define EVT_DISCONN_COMPLETE 0x05 -#define EVT_CMD_COMPLETE 0xe -#define EVT_CMD_STATUS 0x0f -#define EVT_NUM_COMP_PKTS 0x13 -#define EVT_LE_META_EVENT 0x3e - -#define EVT_LE_CONN_COMPLETE 0x01 -#define EVT_LE_ADVERTISING_REPORT 0x02 - -#define OGF_LINK_CTL 0x01 -#define OGF_HOST_CTL 0x03 -#define OGF_INFO_PARAM 0x04 -#define OGF_STATUS_PARAM 0x05 -#define OGF_LE_CTL 0x08 - -// OGF_LINK_CTL -#define OCF_DISCONNECT 0x0006 - -// OGF_HOST_CTL -#define OCF_SET_EVENT_MASK 0x0001 -#define OCF_RESET 0x0003 - -// OGF_INFO_PARAM -#define OCF_READ_LOCAL_VERSION 0x0001 -#define OCF_READ_BD_ADDR 0x0009 - -// OGF_STATUS_PARAM -#define OCF_READ_RSSI 0x0005 - -// OGF_LE_CTL -#define OCF_LE_READ_BUFFER_SIZE 0x0002 -#define OCF_LE_SET_RANDOM_ADDRESS 0x0005 -#define OCF_LE_SET_ADVERTISING_PARAMETERS 0x0006 -#define OCF_LE_SET_ADVERTISING_DATA 0x0008 -#define OCF_LE_SET_SCAN_RESPONSE_DATA 0x0009 -#define OCF_LE_SET_ADVERTISE_ENABLE 0x000a -#define OCF_LE_SET_SCAN_PARAMETERS 0x000b -#define OCF_LE_SET_SCAN_ENABLE 0x000c -#define OCF_LE_CREATE_CONN 0x000d -#define OCF_LE_CANCEL_CONN 0x000e -#define OCF_LE_CONN_UPDATE 0x0013 - -#define HCI_OE_USER_ENDED_CONNECTION 0x13 - - -#define RECV_BUFFER_SIZE (3 + 255) -#define ACL_PKT_BUFFER_SIZE (255) - -STATIC bleio_adapter_obj_t *adapter; - -STATIC int recv_idx; -STATIC uint8_t recv_buffer[RECV_BUFFER_SIZE]; -STATIC uint16_t cmd_complete_opcode; -STATIC int cmd_complete_status; -STATIC uint8_t cmd_response_len; -STATIC uint8_t* cmd_response; - -STATIC uint8_t max_pkt; -STATIC uint8_t pending_pkt; - -//FIX STATIC uint8_t acl_pkt_buffer[255]; - -STATIC bool debug = true; - -typedef struct __attribute__ ((packed)) { - uint8_t evt; - uint8_t plen; -} HCIEventHdr; - -STATIC void dumpPkt(const char* prefix, uint8_t plen, uint8_t pdata[]) -{ - if (debug) { - mp_printf(&mp_plat_print, "%s", prefix); - - for (uint8_t i = 0; i < plen; i++) { - mp_printf(&mp_plat_print, "%02x", pdata[i]); - } - mp_printf(&mp_plat_print, "\n"); - } -} - - -STATIC void handleAclDataPkt(uint8_t plen, uint8_t pdata[]) -{ - // typedef struct __attribute__ ((packed)) { - // uint16_t handle; - // uint16_t dlen; - // uint16_t len; - // uint16_t cid; - // } HCIACLHdr; - - // HCIACLHdr *aclHdr = (HCIACLHdr*)pdata; - - // uint16_t aclFlags = (aclHdr->handle & 0xf000) >> 12; - - // if ((aclHdr->dlen - 4) != aclHdr->len) { - // // packet is fragmented - // if (aclFlags != 0x01) { - // // copy into ACL buffer - // memcpy(acl_pkt_buffer, &recv_buffer[1], sizeof(HCIACLHdr) + aclHdr->dlen - 4); - // } else { - // // copy next chunk into the buffer - // HCIACLHdr* aclBufferHeader = (HCIACLHdr*)acl_pkt_buffer; - - // memcpy(&acl_pkt_buffer[sizeof(HCIACLHdr) + aclBufferHeader->dlen - 4], &recv_buffer[1 + sizeof(aclHdr->handle) + sizeof(aclHdr->dlen)], aclHdr->dlen); - - // aclBufferHeader->dlen += aclHdr->dlen; - // aclHdr = aclBufferHeader; - // } - // } - - // if ((aclHdr->dlen - 4) != aclHdr->len) { - // // don't have the full packet yet - // return; - // } - - // if (aclHdr->cid == ATT_CID) { - // if (aclFlags == 0x01) { - // // use buffered packet - // ATT.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &acl_pkt_buffer[sizeof(HCIACLHdr)]); - // } else { - // // use the recv buffer - // ATT.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &recv_buffer[1 + sizeof(HCIACLHdr)]); - // } - // } else if (aclHdr->cid == SIGNALING_CID) { - // L2CAPSignaling.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &recv_buffer[1 + sizeof(HCIACLHdr)]); - // } else { - // struct __attribute__ ((packed)) { - // uint8_t op; - // uint8_t id; - // uint16_t length; - // uint16_t reason; - // uint16_t localCid; - // uint16_t remoteCid; - // } l2capRejectCid= { 0x01, 0x00, 0x006, 0x0002, aclHdr->cid, 0x0000 }; - - // sendAclPkt(aclHdr->handle & 0x0fff, 0x0005, sizeof(l2capRejectCid), &l2capRejectCid); - // } -} - -STATIC void handleNumCompPkts(uint16_t handle, uint16_t numPkts) -{ - if (numPkts && pending_pkt > numPkts) { - pending_pkt -= numPkts; - } else { - pending_pkt = 0; - } -} - -STATIC void handleEventPkt(uint8_t plen, uint8_t pdata[]) -{ - HCIEventHdr *eventHdr = (HCIEventHdr*)pdata; - - if (eventHdr->evt == EVT_DISCONN_COMPLETE) { - typedef struct __attribute__ ((packed)) { - uint8_t status; - uint16_t handle; - uint8_t reason; - } DisconnComplete; - - DisconnComplete *disconnComplete = (DisconnComplete*)&pdata[sizeof(HCIEventHdr)]; - (void) disconnComplete; - //FIX - // ATT.removeConnection(disconnComplete->handle, disconnComplete->reason); - // L2CAPSignaling.removeConnection(disconnComplete->handle, disconnComplete->reason); - - hci_leSetAdvertiseEnable(0x01); - } else if (eventHdr->evt == EVT_CMD_COMPLETE) { - typedef struct __attribute__ ((packed)) { - uint8_t ncmd; - uint16_t opcode; - uint8_t status; - } CmdComplete; - - CmdComplete *cmdCompleteHeader = (CmdComplete*)&pdata[sizeof(HCIEventHdr)]; - cmd_complete_opcode = cmdCompleteHeader->opcode; - cmd_complete_status = cmdCompleteHeader->status; - cmd_response_len = pdata[1] - sizeof(CmdComplete); - cmd_response = &pdata[sizeof(HCIEventHdr) + sizeof(CmdComplete)]; - - } else if (eventHdr->evt == EVT_CMD_STATUS) { - typedef struct __attribute__ ((packed)) { - uint8_t status; - uint8_t ncmd; - uint16_t opcode; - } CmdStatus; - - CmdStatus *cmdStatusHeader = (CmdStatus*)&pdata[sizeof(HCIEventHdr)]; - cmd_complete_opcode = cmdStatusHeader->opcode; - cmd_complete_status = cmdStatusHeader->status; - cmd_response_len = 0; - } else if (eventHdr->evt == EVT_NUM_COMP_PKTS) { - uint8_t numHandles = pdata[sizeof(HCIEventHdr)]; - uint8_t* data = &pdata[sizeof(HCIEventHdr) + sizeof(numHandles)]; - - for (uint8_t i = 0; i < numHandles; i++) { - handleNumCompPkts(data[0], data[1]); - - data += 2; - } - } else if (eventHdr->evt == EVT_LE_META_EVENT) { - typedef struct __attribute__ ((packed)) { - uint8_t subevent; - } LeMetaEventHeader; - - LeMetaEventHeader *leMetaHeader = (LeMetaEventHeader*)&pdata[sizeof(HCIEventHdr)]; - if (leMetaHeader->subevent == EVT_LE_CONN_COMPLETE) { - typedef struct __attribute__ ((packed)) { - uint8_t status; - uint16_t handle; - uint8_t role; - uint8_t peerBdaddrType; - uint8_t peerBdaddr[6]; - uint16_t interval; - uint16_t latency; - uint16_t supervisionTimeout; - uint8_t masterClockAccuracy; - } EvtLeConnectionComplete; - - EvtLeConnectionComplete *leConnectionComplete = (EvtLeConnectionComplete*)&pdata[sizeof(HCIEventHdr) + sizeof(LeMetaEventHeader)]; - - if (leConnectionComplete->status == 0x00) { - // ATT.addConnection(leConnectionComplete->handle, - // leConnectionComplete->role, - // leConnectionComplete->peerBdaddrType, - // leConnectionComplete->peerBdaddr, - // leConnectionComplete->interval, - // leConnectionComplete->latency, - // leConnectionComplete->supervisionTimeout, - // leConnectionComplete->masterClockAccuracy); - - // L2CAPSignaling.addConnection(leConnectionComplete->handle, - // leConnectionComplete->role, - // leConnectionComplete->peerBdaddrType, - // leConnectionComplete->peerBdaddr, - // leConnectionComplete->interval, - // leConnectionComplete->latency, - // leConnectionComplete->supervisionTimeout, - // leConnectionComplete->masterClockAccuracy); - } - } else if (leMetaHeader->subevent == EVT_LE_ADVERTISING_REPORT) { - typedef struct __attribute__ ((packed)) { - uint8_t status; - uint8_t type; - uint8_t peerBdaddrType; - uint8_t peerBdaddr[6]; - uint8_t eirLength; - uint8_t eirData[31]; - } EvtLeAdvertisingReport; - - EvtLeAdvertisingReport*leAdvertisingReport = (EvtLeAdvertisingReport*)&pdata[sizeof(HCIEventHdr) + sizeof(LeMetaEventHeader)]; - - if (leAdvertisingReport->status == 0x01) { - // last byte is RSSI - //FIX int8_t rssi = leAdvertisingReport->eirData[leAdvertisingReport->eirLength]; - - // GAP.handleLeAdvertisingReport(leAdvertisingReport->type, - // leAdvertisingReport->peerBdaddrType, - // leAdvertisingReport->peerBdaddr, - // leAdvertisingReport->eirLength, - // leAdvertisingReport->eirData, - // rssi); - - } - } - } -} - -void hci_init(bleio_adapter_obj_t *adapter_in) { - adapter = adapter_in; - recv_idx = 0; - pending_pkt = 0; -} - -void hci_poll(void) { - // Assert RTS low to say we're ready to read data. - common_hal_digitalio_digitalinout_set_value(&adapter->rts_digitalinout, false); - - int errcode = 0; - while (common_hal_busio_uart_rx_characters_available(&adapter->hci_uart)) { - // Read just one character. - common_hal_busio_uart_read(&adapter->hci_uart, recv_buffer + recv_idx, 1, &errcode); - recv_idx++; - - if (recv_buffer[0] == HCI_ACLDATA_PKT) { - if (recv_idx > 5 && recv_idx >= (5 + (recv_buffer[3] + (recv_buffer[4] << 8)))) { - if (debug) { - dumpPkt("HCI ACLDATA RX <- ", recv_idx, recv_buffer); - } - // Hold data while processing packet. - common_hal_digitalio_digitalinout_set_value(&adapter->rts_digitalinout, true); - size_t pktLen = recv_idx - 1; - recv_idx = 0; - - handleAclDataPkt(pktLen, &recv_buffer[1]); - - common_hal_digitalio_digitalinout_set_value(&adapter->rts_digitalinout, false); - } - } else if (recv_buffer[0] == HCI_EVENT_PKT) { - if (recv_idx > 3 && recv_idx >= (3 + recv_buffer[2])) { - if (debug) { - dumpPkt("HCI EVENT RX <- ", recv_idx, recv_buffer); - } - // Hold data while processing packet. - common_hal_digitalio_digitalinout_set_value(&adapter->rts_digitalinout, true); - // Received full event. Reset buffer and handle packet. - size_t pktLen = recv_idx - 1; - recv_idx = 0; - - handleEventPkt(pktLen, &recv_buffer[1]); - - common_hal_digitalio_digitalinout_set_value(&adapter->rts_digitalinout, false); - } - } else { - recv_idx = 0; - } - } - - common_hal_digitalio_digitalinout_set_value(&adapter->rts_digitalinout, true); -} - - -int hci_sendCommand(uint8_t ogf, uint16_t ocf, uint8_t plen, void* parameters) -{ - uint16_t opcode = ogf << 10 | ocf; - - struct __attribute__ ((packed)) { - uint8_t pktType; - uint16_t opcode; - uint8_t plen; - } pktHdr = {HCI_COMMAND_PKT, opcode, plen}; - - uint8_t txBuffer[sizeof(pktHdr) + plen]; - memcpy(txBuffer, &pktHdr, sizeof(pktHdr)); - memcpy(&txBuffer[sizeof(pktHdr)], parameters, plen); - - if (debug) { - dumpPkt("HCI COMMAND TX -> ", sizeof(pktHdr) + plen, txBuffer); - } - - int errcode = 0; - common_hal_busio_uart_write(&adapter->hci_uart, txBuffer, sizeof(pktHdr) + plen, &errcode); - if (errcode) { - return -1; - } - - cmd_complete_opcode = 0xffff; - cmd_complete_status = -1; - - // Wait up to one second for a response. - for (uint64_t start = supervisor_ticks_ms64(); - cmd_complete_opcode != opcode && supervisor_ticks_ms64() < (start + 5000); - ) { - hci_poll(); - } - - return cmd_complete_status; -} - -int hci_reset(void) { - return hci_sendCommand(OGF_HOST_CTL, OCF_RESET, 0, NULL); -} - -int hci_readLocalVersion(uint8_t *hciVer, uint16_t *hciRev, uint8_t *lmpVer, uint16_t *manufacturer, uint16_t *lmpSubVer) { - int result = hci_sendCommand(OGF_INFO_PARAM, OCF_READ_LOCAL_VERSION, 0, NULL); - - if (result == 0) { - typedef struct __attribute__ ((packed)) { - uint8_t hciVer; - uint16_t hciRev; - uint8_t lmpVer; - uint16_t manufacturer; - uint16_t lmpSubVer; - } HCILocalVersion; - - HCILocalVersion *localVersion = (HCILocalVersion*)cmd_response; - *hciVer = localVersion->hciVer; - *hciRev = localVersion->hciRev; - *lmpVer = localVersion->lmpVer; - *manufacturer = localVersion->manufacturer; - *lmpSubVer = localVersion->lmpSubVer; - } - - return result; -} - -int hci_readBdAddr(uint8_t addr[6]) { - int result = hci_sendCommand(OGF_INFO_PARAM, OCF_READ_BD_ADDR, 0, NULL); - - if (result == 0) { - memcpy(addr, cmd_response, 6); - } - - return result; -} - -int hci_readRssi(uint16_t handle) { - int result = hci_sendCommand(OGF_STATUS_PARAM, OCF_READ_RSSI, sizeof(handle), &handle); - int rssi = 127; - - if (result == 0) { - typedef struct __attribute__ ((packed)) { - uint16_t handle; - int8_t rssi; - } HCIReadRssi; - - HCIReadRssi *readRssi = (HCIReadRssi*)cmd_response; - if (readRssi->handle == handle) { - rssi = readRssi->rssi; - } - } - - return rssi; -} - -int hci_setEventMask(uint64_t eventMask) { - return hci_sendCommand(OGF_HOST_CTL, OCF_SET_EVENT_MASK, sizeof(eventMask), &eventMask); -} - -int hci_readLeBufferSize(uint16_t *pktLen, uint8_t *maxPkt) -{ - int result = hci_sendCommand(OGF_LE_CTL, OCF_LE_READ_BUFFER_SIZE, 0, NULL); - - if (result == 0) { - typedef struct __attribute__ ((packed)) { - uint16_t pktLen; - uint8_t maxPkt; - } HCILeBufferSize; - - HCILeBufferSize *leBufferSize = (HCILeBufferSize*)cmd_response; - *pktLen = leBufferSize->pktLen; - *maxPkt = leBufferSize->maxPkt; - -#ifndef __AVR__ - // FIX (needed?) ATT.setMaxMtu(pktLen - 9); // max pkt len - ACL header size -#endif - } - - return result; -} - -int hci_leSetRandomAddress(uint8_t addr[6]) -{ - return hci_sendCommand(OGF_LE_CTL, OCF_LE_SET_RANDOM_ADDRESS, 6, addr); -} - -int hci_leSetAdvertisingParameters(uint16_t minInterval, uint16_t maxInterval, - uint8_t advType, uint8_t ownBdaddrType, - uint8_t directBdaddrType, uint8_t directBdaddr[6], - uint8_t chanMap, - uint8_t filter) -{ - struct __attribute__ ((packed)) HCILeAdvertisingParameters { - uint16_t minInterval; - uint16_t maxInterval; - uint8_t advType; - uint8_t ownBdaddrType; - uint8_t directBdaddrType; - uint8_t directBdaddr[6]; - uint8_t chanMap; - uint8_t filter; - } leAdvertisingParamters; - - leAdvertisingParamters.minInterval = minInterval; - leAdvertisingParamters.maxInterval = maxInterval; - leAdvertisingParamters.advType = advType; - leAdvertisingParamters.ownBdaddrType = ownBdaddrType; - leAdvertisingParamters.directBdaddrType = directBdaddrType; - memcpy(leAdvertisingParamters.directBdaddr, directBdaddr, 6); - leAdvertisingParamters.chanMap = chanMap; - leAdvertisingParamters.filter = filter; - - return hci_sendCommand(OGF_LE_CTL, OCF_LE_SET_ADVERTISING_PARAMETERS, sizeof(leAdvertisingParamters), &leAdvertisingParamters); -} - -int hci_leSetAdvertisingData(uint8_t length, uint8_t data[]) -{ - struct __attribute__ ((packed)) HCILeAdvertisingData { - uint8_t length; - uint8_t data[31]; - } leAdvertisingData; - - memset(&leAdvertisingData, 0, sizeof(leAdvertisingData)); - leAdvertisingData.length = length; - memcpy(leAdvertisingData.data, data, length); - - return hci_sendCommand(OGF_LE_CTL, OCF_LE_SET_ADVERTISING_DATA, sizeof(leAdvertisingData), &leAdvertisingData); -} - -int hci_leSetScanResponseData(uint8_t length, uint8_t data[]) -{ - struct __attribute__ ((packed)) HCILeScanResponseData { - uint8_t length; - uint8_t data[31]; - } leScanResponseData; - - memset(&leScanResponseData, 0, sizeof(leScanResponseData)); - leScanResponseData.length = length; - memcpy(leScanResponseData.data, data, length); - - return hci_sendCommand(OGF_LE_CTL, OCF_LE_SET_SCAN_RESPONSE_DATA, sizeof(leScanResponseData), &leScanResponseData); -} - -int hci_leSetAdvertiseEnable(uint8_t enable) -{ - return hci_sendCommand(OGF_LE_CTL, OCF_LE_SET_ADVERTISE_ENABLE, sizeof(enable), &enable); -} - -int hci_leSetScanParameters(uint8_t type, uint16_t interval, uint16_t window, - uint8_t ownBdaddrType, uint8_t filter) -{ - struct __attribute__ ((packed)) HCILeSetScanParameters { - uint8_t type; - uint16_t interval; - uint16_t window; - uint8_t ownBdaddrType; - uint8_t filter; - } leScanParameters; - - leScanParameters.type = type; - leScanParameters.interval = interval; - leScanParameters.window = window; - leScanParameters.ownBdaddrType = ownBdaddrType; - leScanParameters.filter = filter; - - return hci_sendCommand(OGF_LE_CTL, OCF_LE_SET_SCAN_PARAMETERS, sizeof(leScanParameters), &leScanParameters); -} - -int hci_leSetScanEnable(uint8_t enabled, uint8_t duplicates) -{ - struct __attribute__ ((packed)) HCILeSetScanEnableData { - uint8_t enabled; - uint8_t duplicates; - } leScanEnableData; - - leScanEnableData.enabled = enabled; - leScanEnableData.duplicates = duplicates; - - return hci_sendCommand(OGF_LE_CTL, OCF_LE_SET_SCAN_ENABLE, sizeof(leScanEnableData), &leScanEnableData); -} - -int hci_leCreateConn(uint16_t interval, uint16_t window, uint8_t initiatorFilter, - uint8_t peerBdaddrType, uint8_t peerBdaddr[6], uint8_t ownBdaddrType, - uint16_t minInterval, uint16_t maxInterval, uint16_t latency, - uint16_t supervisionTimeout, uint16_t minCeLength, uint16_t maxCeLength) -{ - struct __attribute__ ((packed)) HCILeCreateConnData { - uint16_t interval; - uint16_t window; - uint8_t initiatorFilter; - uint8_t peerBdaddrType; - uint8_t peerBdaddr[6]; - uint8_t ownBdaddrType; - uint16_t minInterval; - uint16_t maxInterval; - uint16_t latency; - uint16_t supervisionTimeout; - uint16_t minCeLength; - uint16_t maxCeLength; - } leCreateConnData; - - leCreateConnData.interval = interval; - leCreateConnData.window = window; - leCreateConnData.initiatorFilter = initiatorFilter; - leCreateConnData.peerBdaddrType = peerBdaddrType; - memcpy(leCreateConnData.peerBdaddr, peerBdaddr, sizeof(leCreateConnData.peerBdaddr)); - leCreateConnData.ownBdaddrType = ownBdaddrType; - leCreateConnData.minInterval = minInterval; - leCreateConnData.maxInterval = maxInterval; - leCreateConnData.latency = latency; - leCreateConnData.supervisionTimeout = supervisionTimeout; - leCreateConnData.minCeLength = minCeLength; - leCreateConnData.maxCeLength = maxCeLength; - - return hci_sendCommand(OGF_LE_CTL, OCF_LE_CREATE_CONN, sizeof(leCreateConnData), &leCreateConnData); -} - -int hci_leCancelConn() -{ - return hci_sendCommand(OGF_LE_CTL, OCF_LE_CANCEL_CONN, 0, NULL); -} - -int hci_leConnUpdate(uint16_t handle, uint16_t minInterval, uint16_t maxInterval, - uint16_t latency, uint16_t supervisionTimeout) -{ - struct __attribute__ ((packed)) HCILeConnUpdateData { - uint16_t handle; - uint16_t minInterval; - uint16_t maxInterval; - uint16_t latency; - uint16_t supervisionTimeout; - uint16_t minCeLength; - uint16_t maxCeLength; - } leConnUpdateData; - - leConnUpdateData.handle = handle; - leConnUpdateData.minInterval = minInterval; - leConnUpdateData.maxInterval = maxInterval; - leConnUpdateData.latency = latency; - leConnUpdateData.supervisionTimeout = supervisionTimeout; - leConnUpdateData.minCeLength = 0x0004; - leConnUpdateData.maxCeLength = 0x0006; - - return hci_sendCommand(OGF_LE_CTL, OCF_LE_CONN_UPDATE, sizeof(leConnUpdateData), &leConnUpdateData); -} - -int hci_sendAclPkt(uint16_t handle, uint8_t cid, uint8_t plen, void* data) { - while (pending_pkt >= max_pkt) { - hci_poll(); - } - - typedef struct __attribute__ ((packed)) { - uint8_t pktType; - uint16_t handle; - uint16_t dlen; - uint16_t plen; - uint16_t cid; - } HCIACLHdr; - - HCIACLHdr aclHdr = { HCI_ACLDATA_PKT, handle, (uint8_t)(plen + 4), plen, cid }; - - uint8_t txBuffer[sizeof(aclHdr) + plen]; - memcpy(txBuffer, &aclHdr, sizeof(aclHdr)); - memcpy(&txBuffer[sizeof(aclHdr)], data, plen); - - if (debug) { - dumpPkt("HCI ACLDATA TX -> ", sizeof(aclHdr) + plen, txBuffer); - } - - pending_pkt++; - - int errcode = 0; - common_hal_busio_uart_write(&adapter->hci_uart, txBuffer, sizeof(aclHdr) + plen, &errcode); - if (errcode) { - return -1; - } - - return 0; -} - -int hci_disconnect(uint16_t handle) -{ - struct __attribute__ ((packed)) HCIDisconnectData { - uint16_t handle; - uint8_t reason; - } disconnectData = { handle, HCI_OE_USER_ENDED_CONNECTION }; - - return hci_sendCommand(OGF_LINK_CTL, OCF_DISCONNECT, sizeof(disconnectData), &disconnectData); -} diff --git a/devices/ble_hci/common-hal/_bleio/hci_api.c b/devices/ble_hci/common-hal/_bleio/hci_api.c new file mode 100644 index 0000000000..180ab6f5ec --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/hci_api.c @@ -0,0 +1,646 @@ +/* + This file is part of the ArduinoBLE library. + Copyright (c) 2018 Arduino SA. All rights reserved. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "hci_api.h" + +// Zephyr include files to define HCI communication values and structs. +#include "hci_include/hci.h" +#include "hci_include/hci_err.h" + +#include + +#include "supervisor/shared/tick.h" + +// HCI H4 protocol packet types: first byte in the packet. +#define H4_CMD 0x01 +#define H4_ACL 0x02 +#define H4_SCO 0x03 +#define H4_EVT 0x04 + +//FIX replace +#define ATT_CID 0x0004 + +#define RX_BUFFER_SIZE (3 + 255) +#define ACL_PKT_BUFFER_SIZE (255) + +#define CTS_TIMEOUT_MSECS (1000) +#define RESPONSE_TIMEOUT_MSECS (1000) + +STATIC bleio_adapter_obj_t *adapter; + +STATIC uint8_t rx_buffer[RX_BUFFER_SIZE]; +STATIC size_t rx_idx; + +STATIC size_t num_command_packets_allowed; +STATIC size_t max_pkt; +STATIC size_t pending_pkt; + +// Results from parsing a command response packet. +STATIC bool cmd_response_received; +STATIC uint16_t cmd_response_opcode; +STATIC uint8_t cmd_response_status; +STATIC size_t cmd_response_len; +STATIC uint8_t* cmd_response_data; + +//FIX STATIC uint8_t acl_pkt_buffer[ACL_PKT_BUFFER_SIZE]; + +STATIC bool debug = true; + +// These are the headers of the full packets that are sent over the serial interface. +// They all have a one-byte type-field at the front, one of the H4_xxx packet types. + +typedef struct __attribute__ ((packed)) { + uint8_t pkt_type; + uint16_t opcode; + uint8_t param_len; +} h4_hci_cmd_hdr_t; + +typedef struct __attribute__ ((packed)) { + uint8_t pkt_type; + uint16_t handle; + uint16_t total_data_len; + uint16_t acl_data_len; + uint16_t cid; +} h4_hci_acl_hdr_t; + +typedef struct __attribute__ ((packed)) { + uint8_t pkt_type; + uint8_t evt; + uint8_t param_len; +} h4_hci_evt_hdr_t; + + + +STATIC void dump_pkt(const char* prefix, uint8_t pkt_len, uint8_t pkt_data[]) { + if (debug) { + mp_printf(&mp_plat_print, "%s", prefix); + for (uint8_t i = 0; i < pkt_len; i++) { + mp_printf(&mp_plat_print, "%02x", pkt_data[i]); + } + mp_printf(&mp_plat_print, "\n"); + } +} + +STATIC void process_acl_data_pkt(uint8_t pkt_len, uint8_t pkt_data[]) { + //FIX pkt_len is +1 than before, because it includes the pkt_type. + // h4_hci_acl_hdr_t *aclHdr = (h4_hci_acl_hdr_t*)pkt_data; + + // uint16_t aclFlags = (aclHdr->handle & 0xf000) >> 12; + + // if ((aclHdr->data_len - 4) != aclHdr->len) { + // // packet is fragmented + // if (aclFlags != 0x01) { + // // copy into ACL buffer + // memcpy(acl_pkt_buffer, &rx_buffer[1], sizeof(HCIACLHdr) + aclHdr->data_len - 4); + // } else { + // // copy next chunk into the buffer + // HCIACLHdr* aclBufferHeader = (HCIACLHdr*)acl_pkt_buffer; + + // memcpy(&acl_pkt_buffer[sizeof(HCIACLHdr) + aclBufferHeader->data_len - 4], &rx_buffer[1 + sizeof(aclHdr->handle) + sizeof(aclHdr->data_len)], aclHdr->data_len); + + // aclBufferHeader->data_len += aclHdr->data_len; + // aclHdr = aclBufferHeader; + // } + // } + + // if ((aclHdr->data_len - 4) != aclHdr->len) { + // // don't have the full packet yet + // return; + // } + + // if (aclHdr->cid == ATT_CID) { + // if (aclFlags == 0x01) { + // // use buffered packet + // ATT.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &acl_pkt_buffer[sizeof(HCIACLHdr)]); + // } else { + // // use the rx buffer + // ATT.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &rx_buffer[1 + sizeof(HCIACLHdr)]); + // } + // } else if (aclHdr->cid == SIGNALING_CID) { + // L2CAPSignaling.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &rx_buffer[1 + sizeof(HCIACLHdr)]); + // } else { + // struct __attribute__ ((packed)) { + // uint8_t op; + // uint8_t id; + // uint16_t length; + // uint16_t reason; + // uint16_t localCid; + // uint16_t remoteCid; + // } l2capRejectCid= { 0x01, 0x00, 0x006, 0x0002, aclHdr->cid, 0x0000 }; + + // sendAclPkt(aclHdr->handle & 0x0fff, 0x0005, sizeof(l2capRejectCid), &l2capRejectCid); + // } +} + +// Process number of completed packets. Reduce number of pending packets by reported +// number of completed. +STATIC void process_num_comp_pkts(uint16_t handle, uint16_t num_pkts) { + if (num_pkts && pending_pkt > num_pkts) { + pending_pkt -= num_pkts; + } else { + pending_pkt = 0; + } +} + +STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt[]) +{ + h4_hci_evt_hdr_t *evt_hdr = (h4_hci_evt_hdr_t*) pkt; + // The data itself, after the header. + uint8_t *evt_data = pkt + sizeof(h4_hci_evt_hdr_t); + + switch (evt_hdr->evt) { + case BT_HCI_EVT_DISCONN_COMPLETE: { + struct bt_hci_evt_disconn_complete *disconn_complete = (struct bt_hci_evt_disconn_complete*) evt_data; + (void) disconn_complete; + //FIX + // ATT.removeConnection(disconn_complete->handle, disconn_complete->reason); + // L2CAPSignaling.removeConnection(disconn_complete->handle, disconn_complete->reason); + hci_le_set_advertise_enable(0x01); + break; + } + + case BT_HCI_EVT_CMD_COMPLETE: { + + struct cmd_complete_with_status { + struct bt_hci_evt_cmd_complete cmd_complete; + struct bt_hci_evt_cc_status cc_status; + } __packed; + + struct cmd_complete_with_status *evt = (struct cmd_complete_with_status *) evt_data; + + num_command_packets_allowed = evt->cmd_complete.ncmd; + + cmd_response_received = true; + cmd_response_opcode = evt->cmd_complete.opcode; + cmd_response_status = evt->cc_status.status; + // All the bytes following status. + cmd_response_data = &evt_data[sizeof(struct cmd_complete_with_status)]; + cmd_response_len = evt_hdr->param_len - sizeof(struct cmd_complete_with_status); + + break; + } + + case BT_HCI_EVT_CMD_STATUS: { + struct bt_hci_evt_cmd_status *evt = (struct bt_hci_evt_cmd_status *) evt_data; + + num_command_packets_allowed = evt->ncmd; + + cmd_response_received = true; + cmd_response_opcode = evt->opcode; + cmd_response_status = evt->status; + cmd_response_data = NULL; + cmd_response_len = 0; + + break; + } + + case BT_HCI_EVT_NUM_COMPLETED_PACKETS: { + struct bt_hci_evt_num_completed_packets *evt = (struct bt_hci_evt_num_completed_packets *) evt_data; + + // Start at zero-th pair: (conn handle, num completed packets). + struct bt_hci_handle_count *handle_and_count = &(evt->h[0]); + for (uint8_t i = 0; i < evt->num_handles; i++) { + process_num_comp_pkts(handle_and_count->handle, handle_and_count->count); + handle_and_count++; + } + break; + } + + case BT_HCI_EVT_LE_META_EVENT: { + struct bt_hci_evt_le_meta_event *meta_evt = (struct bt_hci_evt_le_meta_event *) evt_data; + // Start of the encapsulated LE event. + uint8_t *le_evt = evt_data + sizeof (struct bt_hci_evt_le_meta_event); + + if (meta_evt->subevent == BT_HCI_EVT_LE_CONN_COMPLETE) { + struct bt_hci_evt_le_conn_complete *le_conn_complete = + (struct bt_hci_evt_le_conn_complete *) le_evt; + + if (le_conn_complete->status == 0x00) { + // ATT.addConnection(le_conn_complete->handle, + // le_conn_complete->role, + // le_conn_complete->peer_addr //FIX struct + // le_conn_complete->interval, + // le_conn_complete->latency, + // le_conn_complete->supv_timeout + // le_conn_complete->clock_accuracy); + + // L2CAPSignaling.addConnection(le_conn_complete->handle, + // le_conn_complete->role, + // le_conn_complete->peer_addr, //FIX struct + // le_conn_complete->interval, + // le_conn_complete->latency, + // le_conn_complete->supv_timeout, + // le_conn_complete->clock_accuracy); + } + } else if (meta_evt->subevent == BT_HCI_EVT_LE_ADVERTISING_REPORT) { + struct bt_hci_evt_le_advertising_info *le_advertising_info = + (struct bt_hci_evt_le_advertising_info *) le_evt; + if (le_advertising_info->evt_type == BT_HCI_ADV_DIRECT_IND) { //FIX handle kind of advertising + // last byte is RSSI + // GAP.handleLeAdvertisingReport(leAdvertisingReport->type, + // leAdvertisingReport->peerBdaddrType, + // leAdvertisingReport->peerBdaddr, + // leAdvertisingReport->eirLength, + // leAdvertisingReport->eirData, + // rssi); //FIX, don't separate + + } + } + break; + } + + default: + break; + } +} + +void hci_init(bleio_adapter_obj_t *adapter_in) { + adapter = adapter_in; + rx_idx = 0; + pending_pkt = 0; +} + +hci_result_t hci_poll_for_incoming_pkt(void) { + // Assert RTS low to say we're ready to read data. + common_hal_digitalio_digitalinout_set_value(&adapter->rts_digitalinout, false); + + int errcode = 0; + bool packet_is_complete = false; + + // Read bytes until we run out, or accumulate a complete packet. + while (common_hal_busio_uart_rx_characters_available(adapter->hci_uart)) { + common_hal_busio_uart_read(adapter->hci_uart, rx_buffer + rx_idx, 1, &errcode); + if (!errcode) { + return HCI_READ_ERROR; + } + rx_idx++; + + switch (rx_buffer[0]) { + case H4_ACL: + if (rx_idx > sizeof(h4_hci_acl_hdr_t) && + rx_idx >= sizeof(h4_hci_acl_hdr_t) + ((h4_hci_acl_hdr_t *) rx_buffer)->total_data_len) { + packet_is_complete = true; + } + break; + + case H4_EVT: + if (rx_idx > sizeof(h4_hci_evt_hdr_t) && + rx_idx >= sizeof(h4_hci_evt_hdr_t) + ((h4_hci_evt_hdr_t *) rx_buffer)->param_len) { + packet_is_complete = true; + } + break; + + default: + // Unknown or bad packet type. Start over. + rx_idx = 0; + break; + } + } + + if (!packet_is_complete) { + return HCI_OK; + } + + // Stop incoming data while processing packet. + common_hal_digitalio_digitalinout_set_value(&adapter->rts_digitalinout, true); + size_t pkt_len = rx_idx; + rx_idx = 0; + + switch (rx_buffer[0]) { + case H4_ACL: + if (debug) { + dump_pkt("HCI EVENT RX <- ", rx_idx, rx_buffer); + } + + process_acl_data_pkt(pkt_len, rx_buffer); + break; + + case H4_EVT: + if (debug) { + dump_pkt("HCI ACLDATA RX <- ", rx_idx, rx_buffer); + } + + process_evt_pkt(pkt_len, rx_buffer); + break; + + default: + break; + } + + common_hal_digitalio_digitalinout_set_value(&adapter->rts_digitalinout, true); + + return HCI_OK; +} + + +// Returns +STATIC hci_result_t write_pkt(uint8_t *buffer, size_t len) { + // Wait for CTS to go low before writing to HCI adapter. + uint64_t start = supervisor_ticks_ms64(); + while (common_hal_digitalio_digitalinout_get_value(&adapter->cts_digitalinout)) { + RUN_BACKGROUND_TASKS; + if (supervisor_ticks_ms64() - start > CTS_TIMEOUT_MSECS) { + return HCI_WRITE_TIMEOUT; + } + } + + int errcode = 0; + common_hal_busio_uart_write(adapter->hci_uart, buffer, len, &errcode); + if (errcode) { + return HCI_WRITE_ERROR; + } + + return HCI_OK; +} + +STATIC hci_result_t send_command(uint16_t opcode, uint8_t params_len, void* params) { + uint8_t tx_buffer[sizeof(h4_hci_cmd_hdr_t) + params_len]; + + // cmd header is at the beginning of tx_buffer + h4_hci_cmd_hdr_t *cmd_hdr = (h4_hci_cmd_hdr_t *) tx_buffer; + cmd_hdr->pkt_type = H4_CMD; + cmd_hdr->opcode = opcode; + cmd_hdr->param_len = params_len; + + // Copy the params data into the space after the header. + memcpy(&tx_buffer[sizeof(h4_hci_cmd_hdr_t)], params, params_len); + + if (debug) { + dump_pkt("HCI COMMAND TX -> ", sizeof(tx_buffer), tx_buffer); + } + + int result = write_pkt(tx_buffer, sizeof(h4_hci_cmd_hdr_t) + params_len); + if (result != HCI_OK) { + return result; + } + + cmd_response_received = false; + + // Wait for a response. Note that other packets may be received that are not + // command responses. + uint64_t start = supervisor_ticks_ms64(); + while (1) { + result = hci_poll_for_incoming_pkt(); + if (result != HCI_OK) { + // I/O error. + return result; + } + + if (cmd_response_received && cmd_response_opcode == opcode) { + // If this is definitely a response to the command that was sent, + // return the status value, which will will be + // BT_HCI_ERR_SUCCESS (0x00) if the command succeeded, + // or a BT_HCI_ERR_x value (> 0x00) if there ws a problem. + return cmd_response_status; + } + + if (supervisor_ticks_ms64() - start > RESPONSE_TIMEOUT_MSECS) { + return HCI_READ_TIMEOUT; + } + RUN_BACKGROUND_TASKS; + } + + // No I/O error, but no response sent back in time. + return HCI_NO_RESPONSE; +} + +//FIX remove unused +STATIC int __attribute__((unused)) send_acl_pkt(uint16_t handle, uint8_t cid, void* data, uint8_t data_len) { + int result; + while (pending_pkt >= max_pkt) { + result = hci_poll_for_incoming_pkt(); + if (result != HCI_OK) { + return result; + } + } + + // data_len does not include cid. + const size_t cid_len = sizeof(((h4_hci_acl_hdr_t *)0)->cid); + // buf_len is size of entire packet including header. + const size_t buf_len = sizeof(h4_hci_acl_hdr_t) + cid_len + data_len; + uint8_t tx_buffer[buf_len]; + + h4_hci_acl_hdr_t *acl_hdr = (h4_hci_acl_hdr_t *) tx_buffer; + acl_hdr->pkt_type = H4_ACL; + acl_hdr->handle = handle; + acl_hdr->total_data_len = (uint8_t)(cid_len + data_len); + acl_hdr->acl_data_len = (uint8_t) data_len; + acl_hdr->cid = cid; + + memcpy(&tx_buffer[sizeof(h4_hci_acl_hdr_t)], data, data_len); + + if (debug) { + dump_pkt("HCI ACLDATA TX -> ", buf_len, tx_buffer); + } + + pending_pkt++; + + int errcode = 0; + common_hal_busio_uart_write(adapter->hci_uart, tx_buffer, buf_len, &errcode); + if (errcode) { + return HCI_WRITE_ERROR; + } + + return HCI_OK; +} + +hci_result_t hci_reset(void) { + return send_command(BT_HCI_OP_RESET, 0, NULL); +} + +hci_result_t hci_read_local_version(uint8_t *hci_version, uint16_t *hci_revision, uint8_t *lmp_version, uint16_t *manufacturer, uint16_t *lmp_subversion) { + hci_result_t result = send_command(BT_HCI_OP_READ_LOCAL_VERSION_INFO, 0, NULL); + if (result == HCI_OK) { + struct bt_hci_rp_read_local_version_info *response = + (struct bt_hci_rp_read_local_version_info *) cmd_response_data; + *hci_version = response->hci_version; + *hci_revision = response->hci_revision; + *lmp_version = response->lmp_version; + *manufacturer = response->manufacturer; + *lmp_subversion = response->lmp_subversion; + } + + return result; +} + +hci_result_t hci_read_bd_addr(bt_addr_t *addr) { + int result = send_command(BT_HCI_OP_READ_BD_ADDR, 0, NULL); + if (result == HCI_OK) { + struct bt_hci_rp_read_bd_addr *response = (struct bt_hci_rp_read_bd_addr *) cmd_response_data; + memcpy(addr->val, response->bdaddr.val, sizeof(bt_addr_t)); + } + + return result; +} + +hci_result_t hci_read_rssi(uint16_t handle, int *rssi) { + int result = send_command(BT_HCI_OP_READ_RSSI, sizeof(handle), &handle); + if (result == HCI_OK) { + struct bt_hci_rp_read_rssi *response = (struct bt_hci_rp_read_rssi *) cmd_response_data; + if (response->handle != handle) { + // Handle doesn't match. + return HCI_NO_RESPONSE; + } + + *rssi = response->rssi; + } + + return result; +} + +hci_result_t hci_set_evt_mask(uint64_t event_mask) { + return send_command(BT_HCI_OP_SET_EVENT_MASK, sizeof(event_mask), &event_mask); +} + +hci_result_t hci_read_le_buffer_size(uint16_t *le_max_len, uint8_t *le_max_num) { + int result = send_command(BT_HCI_OP_LE_READ_BUFFER_SIZE, 0, NULL); + if (result == HCI_OK) { + struct bt_hci_rp_le_read_buffer_size *response = + (struct bt_hci_rp_le_read_buffer_size *) cmd_response_data; + *le_max_len = response->le_max_len; + *le_max_num = response->le_max_num; + } + + return result; +} + +hci_result_t hci_le_set_random_address(uint8_t addr[6]) { + return send_command(BT_HCI_OP_LE_SET_RANDOM_ADDRESS, 6, addr); +} + +hci_result_t hci_le_set_advertising_parameters(uint16_t min_interval, uint16_t max_interval, uint8_t type, uint8_t own_addr_type, bt_addr_le_t *direct_addr, uint8_t channel_map, uint8_t filter_policy) { + struct bt_hci_cp_le_set_adv_param params = { + .min_interval = min_interval, + .max_interval = max_interval, + .type = type, + .own_addr_type = own_addr_type, + // .direct_addr set below. + .channel_map = channel_map, + .filter_policy = filter_policy, + }; + params.direct_addr.type = direct_addr->type; + memcpy(params.direct_addr.a.val, direct_addr->a.val, sizeof(params.direct_addr.a.val)); + + return send_command(BT_HCI_OP_LE_SET_ADV_PARAM, sizeof(params), ¶ms); +} + +hci_result_t hci_le_read_maximum_advertising_data_length(int *max_adv_data_len) { + int result = send_command(BT_HCI_OP_LE_READ_MAX_ADV_DATA_LEN, 0, NULL); + if (result == HCI_OK) { + struct bt_hci_rp_le_read_max_adv_data_len *response = + (struct bt_hci_rp_le_read_max_adv_data_len *) cmd_response_data; + if (response->status == BT_HCI_ERR_SUCCESS) { + *max_adv_data_len = response->max_adv_data_len; + } + } + + return result; +} + +hci_result_t hci_le_set_advertising_data(uint8_t len, uint8_t data[]) { + struct bt_hci_cp_le_set_adv_data params = { + // Zero out unused data bytes. + .data = { 0 }, + }; + + params.len = len; + memcpy(params.data, data, len); + + // All data bytes are sent even if some are unused. + return send_command(BT_HCI_OP_LE_SET_ADV_DATA, sizeof(params), ¶ms); +} + +hci_result_t hci_le_set_scan_response_data(uint8_t len, uint8_t data[]) { + struct bt_hci_cp_le_set_scan_rsp_data params = { + // Zero out unused data bytes. + .data = { 0 }, + }; + params.len = len; + memcpy(params.data, data, len); + + // All data bytes are sent even if some are unused. + return send_command(BT_HCI_OP_LE_SET_SCAN_RSP_DATA, sizeof(params), ¶ms); +} + +hci_result_t hci_le_set_advertise_enable(uint8_t enable) { + return send_command(BT_HCI_OP_LE_SET_ADV_ENABLE, sizeof(enable), &enable); +} + +hci_result_t hci_le_set_scan_parameters(uint8_t scan_type, uint16_t interval, uint16_t window, uint8_t addr_type, uint8_t filter_policy) { + struct bt_hci_cp_le_set_scan_param params = { + .scan_type = scan_type, + .interval = interval, + .window = window, + .addr_type = addr_type, + .filter_policy = filter_policy, + }; + + return send_command(BT_HCI_OP_LE_SET_SCAN_PARAM, sizeof(params), ¶ms); +} + +hci_result_t hci_le_set_scan_enable(uint8_t enable, uint8_t filter_dup) { + struct bt_hci_cp_le_set_scan_enable params = { + .enable = enable, + .filter_dup = filter_dup, + }; + + return send_command(BT_HCI_OP_LE_SET_SCAN_ENABLE, sizeof(params), ¶ms); +} + +hci_result_t hci_le_create_conn(uint16_t scan_interval, uint16_t scan_window, uint8_t filter_policy, bt_addr_le_t *peer_addr, uint8_t own_addr_type, uint16_t conn_interval_min, uint16_t conn_interval_max, uint16_t conn_latency, uint16_t supervision_timeout, uint16_t min_ce_len, uint16_t max_ce_len) { + struct bt_hci_cp_le_create_conn params = { + .scan_interval = scan_interval, + .scan_window = scan_window, + .filter_policy = filter_policy, + // .peer_addr is set below + .own_addr_type = own_addr_type, + .conn_interval_min = conn_interval_min, + .conn_interval_max = conn_interval_max, + .conn_latency = conn_latency, + .supervision_timeout = supervision_timeout, + .min_ce_len = min_ce_len, + .max_ce_len = max_ce_len, + }; + params.peer_addr.type = peer_addr->type; + memcpy(params.peer_addr.a.val, peer_addr->a.val, sizeof(params.peer_addr.a.val)); + + return send_command(BT_HCI_OP_LE_CREATE_CONN, sizeof(params), ¶ms); +} + +hci_result_t hci_le_cancel_conn(void) { + return send_command(BT_HCI_OP_CONNECT_CANCEL, 0, NULL); +} + +hci_result_t hci_le_conn_update(uint16_t handle, uint16_t conn_interval_min, uint16_t conn_interval_max, uint16_t conn_latency, uint16_t supervision_timeout) { + struct hci_cp_le_conn_update params = { + .handle = handle, + .conn_interval_min = conn_interval_min, + .conn_interval_max = conn_interval_max, + .conn_latency = conn_latency, + .supervision_timeout = supervision_timeout, + .min_ce_len = 4, + .max_ce_len = 6, + }; + + return send_command(BT_HCI_OP_LE_CONN_UPDATE, sizeof(params), ¶ms); +} + +hci_result_t hci_disconnect(uint16_t handle) { + struct bt_hci_cp_disconnect params = { + .handle = handle, + .reason = BT_HCI_ERR_REMOTE_USER_TERM_CONN, + }; + + return send_command(BT_HCI_OP_DISCONNECT, sizeof(params), ¶ms); +} diff --git a/devices/ble_hci/common-hal/_bleio/hci_api.h b/devices/ble_hci/common-hal/_bleio/hci_api.h new file mode 100644 index 0000000000..a2235ec8c1 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/hci_api.h @@ -0,0 +1,69 @@ +/* + This file is part of the ArduinoBLE library. + Copyright (c) 2018 Arduino SA. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_HCI_H +#define MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_HCI_H + +#include + +#include "common-hal/_bleio/hci_include/hci.h" + +#include "common-hal/_bleio/Adapter.h" + +// An hci_result_t is one of the HCI_x values below, +// or is it > 0 and is an HCI command status value (see hci_include/hci_err.h) +typedef int hci_result_t; +#define HCI_OK (0) +#define HCI_NO_RESPONSE (-1) +#define HCI_ERR_RESPONSE (-2) +#define HCI_READ_TIMEOUT (-3) +#define HCI_WRITE_TIMEOUT (-4) +#define HCI_READ_ERROR (-5) +#define HCI_WRITE_ERROR (-6) + +void hci_init(bleio_adapter_obj_t *adapter_in); + +hci_result_t hci_disconnect(uint16_t handle); + +hci_result_t hci_le_cancel_conn(void); +hci_result_t hci_le_conn_update(uint16_t handle, uint16_t conn_interval_min, uint16_t conn_interval_max, uint16_t conn_latency, uint16_t supervision_timeout); +hci_result_t hci_le_create_conn(uint16_t scan_interval, uint16_t scan_window, uint8_t filter_policy, bt_addr_le_t *peer_addr, uint8_t own_addr_type, uint16_t conn_interval_min, uint16_t conn_interval_max, uint16_t conn_latency, uint16_t supervision_timeout, uint16_t min_ce_len, uint16_t max_ce_len); + +hci_result_t hci_le_read_maximum_advertising_data_length(int *max_adv_data_len); + +hci_result_t hci_le_set_advertise_enable(uint8_t enable); +hci_result_t hci_le_set_advertising_data(uint8_t length, uint8_t data[]); +hci_result_t hci_le_set_advertising_parameters(uint16_t min_interval, uint16_t max_interval, uint8_t type, uint8_t own_addr_type, bt_addr_le_t *direct_addr, uint8_t channel_map, uint8_t filter_policy); +hci_result_t hci_le_set_random_address(uint8_t addr[6]); +hci_result_t hci_le_set_scan_enable(uint8_t enable, uint8_t filter_dup); +hci_result_t hci_le_set_scan_parameters(uint8_t scan_type, uint16_t interval, uint16_t window, uint8_t addr_type, uint8_t filter_policy); +hci_result_t hci_le_set_scan_response_data(uint8_t length, uint8_t data[]); + +hci_result_t hci_poll_for_incoming_pkt(void); + +hci_result_t hci_read_bd_addr(bt_addr_t *addr); +hci_result_t hci_read_le_buffer_size(uint16_t *le_max_len, uint8_t *le_max_num); +hci_result_t hci_read_local_version(uint8_t *hci_version, uint16_t *hci_revision, uint8_t *lmp_version, uint16_t *manufacturer, uint16_t *lmp_subversion); +hci_result_t hci_read_rssi(uint16_t handle, int *rssi); + +hci_result_t hci_reset(void); + +hci_result_t hci_set_evt_mask(uint64_t event_mask); + +#endif // MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_HCI_H diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/#hci.h# b/devices/ble_hci/common-hal/_bleio/hci_include/#hci.h# new file mode 100644 index 0000000000..942a82a3c6 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/hci_include/#hci.h# @@ -0,0 +1,1775 @@ +/* hci.h - Bluetooth Host Control Interface definitions */ + +/* + * Copyright (c) 2015-2016 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef ZEPHYR_INCLUDE_BLUETOOTH_HCI_H_ +#define ZEPHYR_INCLUDE_BLUETOOTH_HCI_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Special own address types for LL privacy (used in adv & scan parameters) */ +#define BT_HCI_OWN_ADDR_RPA_OR_PUBLIC 0x02 +#define BT_HCI_OWN_ADDR_RPA_OR_RANDOM 0x03 +#define BT_HCI_OWN_ADDR_RPA_MASK 0x02 + +#define BT_HCI_PEER_ADDR_RPA_UNRESOLVED 0xfe +#define BT_HCI_PEER_ADDR_ANONYMOUS 0xff + +#define BT_ENC_KEY_SIZE_MIN 0x07 +#define BT_ENC_KEY_SIZE_MAX 0x10 + +struct bt_hci_evt_hdr { + uint8_t evt; + uint8_t len; +} __packed; +#define BT_HCI_EVT_HDR_SIZE 2 + +#define BT_ACL_START_NO_FLUSH 0x00 +#define BT_ACL_CONT 0x01 +#define BT_ACL_START 0x02 +#define BT_ACL_COMPLETE 0x03 + +#define BT_ACL_POINT_TO_POINT 0x00 +#define BT_ACL_BROADCAST 0x01 + +#define bt_acl_handle(h) ((h) & BIT_MASK(12)) +#define bt_acl_flags(h) ((h) >> 12) +#define bt_acl_flags_pb(f) ((f) & BIT_MASK(2)) +#define bt_acl_flags_bc(f) ((f) >> 2) +#define bt_acl_handle_pack(h, f) ((h) | ((f) << 12)) + +struct bt_hci_acl_hdr { + uint16_t handle; + uint16_t len; +} __packed; +#define BT_HCI_ACL_HDR_SIZE 4 + +struct bt_hci_cmd_hdr { + uint16_t opcode; + uint8_t param_len; +} __packed; +#define BT_HCI_CMD_HDR_SIZE 3 + +/* Supported Commands */ +#define BT_CMD_TEST(cmd, octet, bit) (cmd[octet] & BIT(bit)) +#define BT_CMD_LE_STATES(cmd) BT_CMD_TEST(cmd, 28, 3) + +#define BT_FEAT_TEST(feat, page, octet, bit) (feat[page][octet] & BIT(bit)) + +#define BT_FEAT_BREDR(feat) !BT_FEAT_TEST(feat, 0, 4, 5) +#define BT_FEAT_LE(feat) BT_FEAT_TEST(feat, 0, 4, 6) +#define BT_FEAT_EXT_FEATURES(feat) BT_FEAT_TEST(feat, 0, 7, 7) +#define BT_FEAT_HOST_SSP(feat) BT_FEAT_TEST(feat, 1, 0, 0) +#define BT_FEAT_SC(feat) BT_FEAT_TEST(feat, 2, 1, 0) + +#define BT_FEAT_LMP_ESCO_CAPABLE(feat) BT_FEAT_TEST(feat, 0, 3, 7) +#define BT_FEAT_HV2_PKT(feat) BT_FEAT_TEST(feat, 0, 1, 4) +#define BT_FEAT_HV3_PKT(feat) BT_FEAT_TEST(feat, 0, 1, 5) +#define BT_FEAT_EV4_PKT(feat) BT_FEAT_TEST(feat, 0, 4, 0) +#define BT_FEAT_EV5_PKT(feat) BT_FEAT_TEST(feat, 0, 4, 1) +#define BT_FEAT_2EV3_PKT(feat) BT_FEAT_TEST(feat, 0, 5, 5) +#define BT_FEAT_3EV3_PKT(feat) BT_FEAT_TEST(feat, 0, 5, 6) +#define BT_FEAT_3SLOT_PKT(feat) BT_FEAT_TEST(feat, 0, 5, 7) + +/* LE features */ +#define BT_LE_FEAT_BIT_ENC 0 +#define BT_LE_FEAT_BIT_CONN_PARAM_REQ 1 +#define BT_LE_FEAT_BIT_EXT_REJ_IND 2 +#define BT_LE_FEAT_BIT_SLAVE_FEAT_REQ 3 +#define BT_LE_FEAT_BIT_PING 4 +#define BT_LE_FEAT_BIT_DLE 5 +#define BT_LE_FEAT_BIT_PRIVACY 6 +#define BT_LE_FEAT_BIT_EXT_SCAN 7 +#define BT_LE_FEAT_BIT_PHY_2M 8 +#define BT_LE_FEAT_BIT_SMI_TX 9 +#define BT_LE_FEAT_BIT_SMI_RX 10 +#define BT_LE_FEAT_BIT_PHY_CODED 11 +#define BT_LE_FEAT_BIT_EXT_ADV 12 +#define BT_LE_FEAT_BIT_PER_ADV 13 +#define BT_LE_FEAT_BIT_CHAN_SEL_ALGO_2 14 +#define BT_LE_FEAT_BIT_PWR_CLASS_1 15 +#define BT_LE_FEAT_BIT_MIN_USED_CHAN_PROC 16 +#define BT_LE_FEAT_BIT_CONN_CTE_REQ 17 +#define BT_LE_FEAT_BIT_CONN_CTE_RESP 18 +#define BT_LE_FEAT_BIT_CONNECTIONLESS_CTE_TX 19 +#define BT_LE_FEAT_BIT_CONNECTIONLESS_CTE_RX 20 +#define BT_LE_FEAT_BIT_ANT_SWITCH_TX_AOD 21 +#define BT_LE_FEAT_BIT_ANT_SWITCH_RX_AOA 22 +#define BT_LE_FEAT_BIT_RX_CTE 23 +#define BT_LE_FEAT_BIT_PERIODIC_SYNC_XFER_SEND 24 +#define BT_LE_FEAT_BIT_PERIODIC_SYNC_XFER_RECV 25 +#define BT_LE_FEAT_BIT_SCA_UPDATE 26 +#define BT_LE_FEAT_BIT_REMOTE_PUB_KEY_VALIDATE 27 +#define BT_LE_FEAT_BIT_CIS_MASTER 28 +#define BT_LE_FEAT_BIT_CIS_SLAVE 29 +#define BT_LE_FEAT_BIT_ISO_BROADCASTER 30 +#define BT_LE_FEAT_BIT_SYNC_RECEIVER 31 +#define BT_LE_FEAT_BIT_ISO_CHANNELS 32 +#define BT_LE_FEAT_BIT_PWR_CTRL_REQ 33 +#define BT_LE_FEAT_BIT_PWR_CHG_IND 34 +#define BT_LE_FEAT_BIT_PATH_LOSS_MONITOR 35 + +#define BT_LE_FEAT_TEST(feat, n) (feat[(n) >> 3] & \ + BIT((n) & 7)) + +#define BT_FEAT_LE_ENCR(feat) BT_LE_FEAT_TEST(feat, \ + BT_LE_FEAT_BIT_ENC) +#define BT_FEAT_LE_CONN_PARAM_REQ_PROC(feat) BT_LE_FEAT_TEST(feat, \ + BT_LE_FEAT_BIT_CONN_PARAM_REQ) +#define BT_FEAT_LE_SLAVE_FEATURE_XCHG(feat) BT_LE_FEAT_TEST(feat, \ + BT_LE_FEAT_BIT_SLAVE_FEAT_REQ) +#define BT_FEAT_LE_DLE(feat) BT_LE_FEAT_TEST(feat, \ + BT_LE_FEAT_BIT_DLE) +#define BT_FEAT_LE_PHY_2M(feat) BT_LE_FEAT_TEST(feat, \ + BT_LE_FEAT_BIT_PHY_2M) +#define BT_FEAT_LE_PHY_CODED(feat) BT_LE_FEAT_TEST(feat, \ + BT_LE_FEAT_BIT_PHY_CODED) +#define BT_FEAT_LE_PRIVACY(feat) BT_LE_FEAT_TEST(feat, \ + BT_LE_FEAT_BIT_PRIVACY) +#define BT_FEAT_LE_EXT_ADV(feat) BT_LE_FEAT_TEST(feat, \ + BT_LE_FEAT_BIT_EXT_ADV) + +/* LE States */ +#define BT_LE_STATES_SLAVE_CONN_ADV(states) (states & 0x0000004000000000) + +/* Bonding/authentication types */ +#define BT_HCI_NO_BONDING 0x00 +#define BT_HCI_NO_BONDING_MITM 0x01 +#define BT_HCI_DEDICATED_BONDING 0x02 +#define BT_HCI_DEDICATED_BONDING_MITM 0x03 +#define BT_HCI_GENERAL_BONDING 0x04 +#define BT_HCI_GENERAL_BONDING_MITM 0x05 + +/* + * MITM protection is enabled in SSP authentication requirements octet when + * LSB bit is set. + */ +#define BT_MITM 0x01 + +/* I/O capabilities */ +#define BT_IO_DISPLAY_ONLY 0x00 +#define BT_IO_DISPLAY_YESNO 0x01 +#define BT_IO_KEYBOARD_ONLY 0x02 +#define BT_IO_NO_INPUT_OUTPUT 0x03 + +/* SCO packet types */ +#define HCI_PKT_TYPE_HV1 0x0020 +#define HCI_PKT_TYPE_HV2 0x0040 +#define HCI_PKT_TYPE_HV3 0x0080 + +/* eSCO packet types */ +#define HCI_PKT_TYPE_ESCO_HV1 0x0001 +#define HCI_PKT_TYPE_ESCO_HV2 0x0002 +#define HCI_PKT_TYPE_ESCO_HV3 0x0004 +#define HCI_PKT_TYPE_ESCO_EV3 0x0008 +#define HCI_PKT_TYPE_ESCO_EV4 0x0010 +#define HCI_PKT_TYPE_ESCO_EV5 0x0020 +#define HCI_PKT_TYPE_ESCO_2EV3 0x0040 +#define HCI_PKT_TYPE_ESCO_3EV3 0x0080 +#define HCI_PKT_TYPE_ESCO_2EV5 0x0100 +#define HCI_PKT_TYPE_ESCO_3EV5 0x0200 + + +#define ESCO_PKT_MASK (HCI_PKT_TYPE_ESCO_HV1 | \ + HCI_PKT_TYPE_ESCO_HV2 | \ + HCI_PKT_TYPE_ESCO_HV3) +#define SCO_PKT_MASK (HCI_PKT_TYPE_HV1 | \ + HCI_PKT_TYPE_HV2 | \ + HCI_PKT_TYPE_HV3) +#define EDR_ESCO_PKT_MASK (HCI_PKT_TYPE_ESCO_2EV3 | \ + HCI_PKT_TYPE_ESCO_3EV3 | \ + HCI_PKT_TYPE_ESCO_2EV5 | \ + HCI_PKT_TYPE_ESCO_3EV5) + +/* HCI BR/EDR link types */ +#define BT_HCI_SCO 0x00 +#define BT_HCI_ACL 0x01 +#define BT_HCI_ESCO 0x02 + +/* OpCode Group Fields */ +#define BT_OGF_LINK_CTRL 0x01 +#define BT_OGF_BASEBAND 0x03 +#define BT_OGF_INFO 0x04 +#define BT_OGF_STATUS 0x05 +#define BT_OGF_LE 0x08 +#define BT_OGF_VS 0x3f + +/* Construct OpCode from OGF and OCF */ +#define BT_OP(ogf, ocf) ((ocf) | ((ogf) << 10)) + +/* Invalid opcode */ +#define BT_OP_NOP 0x0000 + +/* Obtain OGF from OpCode */ +#define BT_OGF(opcode) (((opcode) >> 10) & BIT_MASK(6)) +/* Obtain OCF from OpCode */ +#define BT_OCF(opcode) ((opcode) & BIT_MASK(10)) + +#define BT_HCI_OP_INQUIRY BT_OP(BT_OGF_LINK_CTRL, 0x0001) +struct bt_hci_op_inquiry { + uint8_t lap[3]; + uint8_t length; + uint8_t num_rsp; +} __packed; + +#define BT_HCI_OP_INQUIRY_CANCEL BT_OP(BT_OGF_LINK_CTRL, 0x0002) + +#define BT_HCI_OP_CONNECT BT_OP(BT_OGF_LINK_CTRL, 0x0005) +struct bt_hci_cp_connect { + bt_addr_t bdaddr; + uint16_t packet_type; + uint8_t pscan_rep_mode; + uint8_t reserved; + uint16_t clock_offset; + uint8_t allow_role_switch; +} __packed; + +#define BT_HCI_OP_DISCONNECT BT_OP(BT_OGF_LINK_CTRL, 0x0006) +struct bt_hci_cp_disconnect { + uint16_t handle; + uint8_t reason; +} __packed; + +#define BT_HCI_OP_CONNECT_CANCEL BT_OP(BT_OGF_LINK_CTRL, 0x0008) +struct bt_hci_cp_connect_cancel { + bt_addr_t bdaddr; +} __packed; +struct bt_hci_rp_connect_cancel { + uint8_t status; + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_OP_ACCEPT_CONN_REQ BT_OP(BT_OGF_LINK_CTRL, 0x0009) +struct bt_hci_cp_accept_conn_req { + bt_addr_t bdaddr; + uint8_t role; +} __packed; + +#define BT_HCI_OP_SETUP_SYNC_CONN BT_OP(BT_OGF_LINK_CTRL, 0x0028) +struct bt_hci_cp_setup_sync_conn { + uint16_t handle; + uint32_t tx_bandwidth; + uint32_t rx_bandwidth; + uint16_t max_latency; + uint16_t content_format; + uint8_t retrans_effort; + uint16_t pkt_type; +} __packed; + +#define BT_HCI_OP_ACCEPT_SYNC_CONN_REQ BT_OP(BT_OGF_LINK_CTRL, 0x0029) +struct bt_hci_cp_accept_sync_conn_req { + bt_addr_t bdaddr; + uint32_t tx_bandwidth; + uint32_t rx_bandwidth; + uint16_t max_latency; + uint16_t content_format; + uint8_t retrans_effort; + uint16_t pkt_type; +} __packed; + +#define BT_HCI_OP_REJECT_CONN_REQ BT_OP(BT_OGF_LINK_CTRL, 0x000a) +struct bt_hci_cp_reject_conn_req { + bt_addr_t bdaddr; + uint8_t reason; +} __packed; + +#define BT_HCI_OP_LINK_KEY_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x000b) +struct bt_hci_cp_link_key_reply { + bt_addr_t bdaddr; + uint8_t link_key[16]; +} __packed; + +#define BT_HCI_OP_LINK_KEY_NEG_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x000c) +struct bt_hci_cp_link_key_neg_reply { + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_OP_PIN_CODE_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x000d) +struct bt_hci_cp_pin_code_reply { + bt_addr_t bdaddr; + uint8_t pin_len; + uint8_t pin_code[16]; +} __packed; +struct bt_hci_rp_pin_code_reply { + uint8_t status; + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_OP_PIN_CODE_NEG_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x000e) +struct bt_hci_cp_pin_code_neg_reply { + bt_addr_t bdaddr; +} __packed; +struct bt_hci_rp_pin_code_neg_reply { + uint8_t status; + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_OP_AUTH_REQUESTED BT_OP(BT_OGF_LINK_CTRL, 0x0011) +struct bt_hci_cp_auth_requested { + uint16_t handle; +} __packed; + +#define BT_HCI_OP_SET_CONN_ENCRYPT BT_OP(BT_OGF_LINK_CTRL, 0x0013) +struct bt_hci_cp_set_conn_encrypt { + uint16_t handle; + uint8_t encrypt; +} __packed; + +#define BT_HCI_OP_REMOTE_NAME_REQUEST BT_OP(BT_OGF_LINK_CTRL, 0x0019) +struct bt_hci_cp_remote_name_request { + bt_addr_t bdaddr; + uint8_t pscan_rep_mode; + uint8_t reserved; + uint16_t clock_offset; +} __packed; + +#define BT_HCI_OP_REMOTE_NAME_CANCEL BT_OP(BT_OGF_LINK_CTRL, 0x001a) +struct bt_hci_cp_remote_name_cancel { + bt_addr_t bdaddr; +} __packed; +struct bt_hci_rp_remote_name_cancel { + uint8_t status; + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_OP_READ_REMOTE_FEATURES BT_OP(BT_OGF_LINK_CTRL, 0x001b) +struct bt_hci_cp_read_remote_features { + uint16_t handle; +} __packed; + +#define BT_HCI_OP_READ_REMOTE_EXT_FEATURES BT_OP(BT_OGF_LINK_CTRL, 0x001c) +struct bt_hci_cp_read_remote_ext_features { + uint16_t handle; + uint8_t page; +} __packed; + +#define BT_HCI_OP_READ_REMOTE_VERSION_INFO BT_OP(BT_OGF_LINK_CTRL, 0x001d) +struct bt_hci_cp_read_remote_version_info { + uint16_t handle; +} __packed; + +#define BT_HCI_OP_IO_CAPABILITY_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x002b) +struct bt_hci_cp_io_capability_reply { + bt_addr_t bdaddr; + uint8_t capability; + uint8_t oob_data; + uint8_t authentication; +} __packed; + +#define BT_HCI_OP_USER_CONFIRM_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x002c) +#define BT_HCI_OP_USER_CONFIRM_NEG_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x002d) +struct bt_hci_cp_user_confirm_reply { + bt_addr_t bdaddr; +} __packed; +struct bt_hci_rp_user_confirm_reply { + uint8_t status; + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_OP_USER_PASSKEY_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x002e) +struct bt_hci_cp_user_passkey_reply { + bt_addr_t bdaddr; + uint32_t passkey; +} __packed; + +#define BT_HCI_OP_USER_PASSKEY_NEG_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x002f) +struct bt_hci_cp_user_passkey_neg_reply { + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_OP_IO_CAPABILITY_NEG_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x0034) +struct bt_hci_cp_io_capability_neg_reply { + bt_addr_t bdaddr; + uint8_t reason; +} __packed; + +#define BT_HCI_OP_SET_EVENT_MASK BT_OP(BT_OGF_BASEBAND, 0x0001) +struct bt_hci_cp_set_event_mask { + uint8_t events[8]; +} __packed; + +#define BT_HCI_OP_RESET BT_OP(BT_OGF_BASEBAND, 0x0003) + +#define BT_HCI_OP_WRITE_LOCAL_NAME BT_OP(BT_OGF_BASEBAND, 0x0013) +struct bt_hci_write_local_name { + uint8_t local_name[248]; +} __packed; + +#define BT_HCI_OP_WRITE_PAGE_TIMEOUT BT_OP(BT_OGF_BASEBAND, 0x0018) + +#define BT_HCI_OP_WRITE_SCAN_ENABLE BT_OP(BT_OGF_BASEBAND, 0x001a) +#define BT_BREDR_SCAN_DISABLED 0x00 +#define BT_BREDR_SCAN_INQUIRY 0x01 +#define BT_BREDR_SCAN_PAGE 0x02 + +#define BT_TX_POWER_LEVEL_CURRENT 0x00 +#define BT_TX_POWER_LEVEL_MAX 0x01 +#define BT_HCI_OP_READ_TX_POWER_LEVEL BT_OP(BT_OGF_BASEBAND, 0x002d) +struct bt_hci_cp_read_tx_power_level { + uint16_t handle; + uint8_t type; +} __packed; + +struct bt_hci_rp_read_tx_power_level { + uint8_t status; + uint16_t handle; + int8_t tx_power_level; +} __packed; + +#define BT_HCI_CTL_TO_HOST_FLOW_DISABLE 0x00 +#define BT_HCI_CTL_TO_HOST_FLOW_ENABLE 0x01 +#define BT_HCI_OP_SET_CTL_TO_HOST_FLOW BT_OP(BT_OGF_BASEBAND, 0x0031) +struct bt_hci_cp_set_ctl_to_host_flow { + uint8_t flow_enable; +} __packed; + +#define BT_HCI_OP_HOST_BUFFER_SIZE BT_OP(BT_OGF_BASEBAND, 0x0033) +struct bt_hci_cp_host_buffer_size { + uint16_t acl_mtu; + uint8_t sco_mtu; + uint16_t acl_pkts; + uint16_t sco_pkts; +} __packed; + +struct bt_hci_handle_count { + uint16_t handle; + uint16_t count; +} __packed; + +#define BT_HCI_OP_HOST_NUM_COMPLETED_PACKETS BT_OP(BT_OGF_BASEBAND, 0x0035) +struct bt_hci_cp_host_num_completed_packets { + uint8_t num_handles; + struct bt_hci_handle_count h[0]; +} __packed; + +#define BT_HCI_OP_WRITE_INQUIRY_MODE BT_OP(BT_OGF_BASEBAND, 0x0045) +struct bt_hci_cp_write_inquiry_mode { + uint8_t mode; +} __packed; + +#define BT_HCI_OP_WRITE_SSP_MODE BT_OP(BT_OGF_BASEBAND, 0x0056) +struct bt_hci_cp_write_ssp_mode { + uint8_t mode; +} __packed; + +#define BT_HCI_OP_SET_EVENT_MASK_PAGE_2 BT_OP(BT_OGF_BASEBAND, 0x0063) +struct bt_hci_cp_set_event_mask_page_2 { + uint8_t events_page_2[8]; +} __packed; + +#define BT_HCI_OP_LE_WRITE_LE_HOST_SUPP BT_OP(BT_OGF_BASEBAND, 0x006d) +struct bt_hci_cp_write_le_host_supp { + uint8_t le; + uint8_t simul; +} __packed; + +#define BT_HCI_OP_WRITE_SC_HOST_SUPP BT_OP(BT_OGF_BASEBAND, 0x007a) +struct bt_hci_cp_write_sc_host_supp { + uint8_t sc_support; +} __packed; + +#define BT_HCI_OP_READ_AUTH_PAYLOAD_TIMEOUT BT_OP(BT_OGF_BASEBAND, 0x007b) +struct bt_hci_cp_read_auth_payload_timeout { + uint16_t handle; +} __packed; + +struct bt_hci_rp_read_auth_payload_timeout { + uint8_t status; + uint16_t handle; + uint16_t auth_payload_timeout; +} __packed; + +#define BT_HCI_OP_WRITE_AUTH_PAYLOAD_TIMEOUT BT_OP(BT_OGF_BASEBAND, 0x007c) +struct bt_hci_cp_write_auth_payload_timeout { + uint16_t handle; + uint16_t auth_payload_timeout; +} __packed; + +struct bt_hci_rp_write_auth_payload_timeout { + uint8_t status; + uint16_t handle; +} __packed; + +/* HCI version from Assigned Numbers */ +#define BT_HCI_VERSION_1_0B 0 +#define BT_HCI_VERSION_1_1 1 +#define BT_HCI_VERSION_1_2 2 +#define BT_HCI_VERSION_2_0 3 +#define BT_HCI_VERSION_2_1 4 +#define BT_HCI_VERSION_3_0 5 +#define BT_HCI_VERSION_4_0 6 +#define BT_HCI_VERSION_4_1 7 +#define BT_HCI_VERSION_4_2 8 +#define BT_HCI_VERSION_5_0 9 +#define BT_HCI_VERSION_5_1 10 +#define BT_HCI_VERSION_5_2 11 + +#define BT_HCI_OP_READ_LOCAL_VERSION_INFO BT_OP(BT_OGF_INFO, 0x0001) +struct bt_hci_rp_read_local_version_info { + uint8_t status; + uint8_t hci_version; + uint16_t hci_revision; + uint8_t lmp_version; + uint16_t manufacturer; + uint16_t lmp_subversion; +} __packed; + +#define BT_HCI_OP_READ_SUPPORTED_COMMANDS BT_OP(BT_OGF_INFO, 0x0002) +struct bt_hci_rp_read_supported_commands { + uint8_t status; + uint8_t commands[64]; +} __packed; + +#define BT_HCI_OP_READ_LOCAL_EXT_FEATURES BT_OP(BT_OGF_INFO, 0x0004) +struct bt_hci_cp_read_local_ext_features { + uint8_t page; +}; +struct bt_hci_rp_read_local_ext_features { + uint8_t status; + uint8_t page; + uint8_t max_page; + uint8_t ext_features[8]; +} __packed; + +#define BT_HCI_OP_READ_LOCAL_FEATURES BT_OP(BT_OGF_INFO, 0x0003) +struct bt_hci_rp_read_local_features { + uint8_t status; + uint8_t features[8]; +} __packed; + +#define BT_HCI_OP_READ_BUFFER_SIZE BT_OP(BT_OGF_INFO, 0x0005) +struct bt_hci_rp_read_buffer_size { + uint8_t status; + uint16_t acl_max_len; + uint8_t sco_max_len; + uint16_t acl_max_num; + uint16_t sco_max_num; +} __packed; + +#define BT_HCI_OP_READ_BD_ADDR BT_OP(BT_OGF_INFO, 0x0009) +struct bt_hci_rp_read_bd_addr { + uint8_t status; + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_OP_READ_RSSI BT_OP(BT_OGF_STATUS, 0x0005) +struct bt_hci_cp_read_rssi { + uint16_t handle; +} __packed; +struct bt_hci_rp_read_rssi { + uint8_t status; + uint16_t handle; + int8_t rssi; +} __packed; + +#define BT_HCI_ENCRYPTION_KEY_SIZE_MIN 7 +#define BT_HCI_ENCRYPTION_KEY_SIZE_MAX 16 + +#define BT_HCI_OP_READ_ENCRYPTION_KEY_SIZE BT_OP(BT_OGF_STATUS, 0x0008) +struct bt_hci_cp_read_encryption_key_size { + uint16_t handle; +} __packed; +struct bt_hci_rp_read_encryption_key_size { + uint8_t status; + uint16_t handle; + uint8_t key_size; +} __packed; + +/* BLE */ + +#define BT_HCI_OP_LE_SET_EVENT_MASK BT_OP(BT_OGF_LE, 0x0001) +struct bt_hci_cp_le_set_event_mask { + uint8_t events[8]; +} __packed; + +#define BT_HCI_OP_LE_READ_BUFFER_SIZE BT_OP(BT_OGF_LE, 0x0002) +struct bt_hci_rp_le_read_buffer_size { + uint8_t status; + uint16_t le_max_len; + uint8_t le_max_num; +} __packed; + +#define BT_HCI_OP_LE_READ_LOCAL_FEATURES BT_OP(BT_OGF_LE, 0x0003) +struct bt_hci_rp_le_read_local_features { + uint8_t status; + uint8_t features[8]; +} __packed; + +#define BT_HCI_OP_LE_SET_RANDOM_ADDRESS BT_OP(BT_OGF_LE, 0x0005) +struct bt_hci_cp_le_set_random_address { + bt_addr_t bdaddr; +} __packed; + +/* LE Advertising Types (LE Advertising Parameters Set)*/ +#define BT_LE_ADV_IND (__DEPRECATED_MACRO 0x00) +#define BT_LE_ADV_DIRECT_IND (__DEPRECATED_MACRO 0x01) +#define BT_LE_ADV_SCAN_IND (__DEPRECATED_MACRO 0x02) +#define BT_LE_ADV_NONCONN_IND (__DEPRECATED_MACRO 0x03) +#define BT_LE_ADV_DIRECT_IND_LOW_DUTY (__DEPRECATED_MACRO 0x04) +/* LE Advertising PDU Types. */ +#define BT_LE_ADV_SCAN_RSP (__DEPRECATED_MACRO 0x04) + +#define BT_HCI_ADV_IND 0x00 +#define BT_HCI_ADV_DIRECT_IND 0x01 +#define BT_HCI_ADV_SCAN_IND 0x02 +#define BT_HCI_ADV_NONCONN_IND 0x03 +#define BT_HCI_ADV_DIRECT_IND_LOW_DUTY 0x04 +#define BT_HCI_ADV_SCAN_RSP 0x04 + +#define BT_LE_ADV_FP_NO_WHITELIST 0x00 +#define BT_LE_ADV_FP_WHITELIST_SCAN_REQ 0x01 +#define BT_LE_ADV_FP_WHITELIST_CONN_IND 0x02 +#define BT_LE_ADV_FP_WHITELIST_BOTH 0x03 + +#define BT_HCI_OP_LE_SET_ADV_PARAM BT_OP(BT_OGF_LE, 0x0006) +struct bt_hci_cp_le_set_adv_param { + uint16_t min_interval; + uint16_t max_interval; + uint8_t type; + uint8_t own_addr_type; + bt_addr_le_t direct_addr; + uint8_t channel_map; + uint8_t filter_policy; +} __packed; + +#define BT_HCI_OP_LE_READ_ADV_CHAN_TX_POWER BT_OP(BT_OGF_LE, 0x0007) +struct bt_hci_rp_le_read_chan_tx_power { + uint8_t status; + int8_t tx_power_level; +} __packed; + +#define BT_HCI_OP_LE_SET_ADV_DATA BT_OP(BT_OGF_LE, 0x0008) +struct bt_hci_cp_le_set_adv_data { + uint8_t len; + uint8_t data[31]; +} __packed; + +#define BT_HCI_OP_LE_SET_SCAN_RSP_DATA BT_OP(BT_OGF_LE, 0x0009) +struct bt_hci_cp_le_set_scan_rsp_data { + uint8_t len; + uint8_t data[31]; +} __packed; + +#define BT_HCI_LE_ADV_DISABLE 0x00 +#define BT_HCI_LE_ADV_ENABLE 0x01 + +#define BT_HCI_OP_LE_SET_ADV_ENABLE BT_OP(BT_OGF_LE, 0x000a) +struct bt_hci_cp_le_set_adv_enable { + uint8_t enable; +} __packed; + +/* Scan types */ +#define BT_HCI_OP_LE_SET_SCAN_PARAM BT_OP(BT_OGF_LE, 0x000b) +#define BT_HCI_LE_SCAN_PASSIVE 0x00 +#define BT_HCI_LE_SCAN_ACTIVE 0x01 + +#define BT_HCI_LE_SCAN_FP_NO_WHITELIST 0x00 +#define BT_HCI_LE_SCAN_FP_USE_WHITELIST 0x01 + +struct bt_hci_cp_le_set_scan_param { + uint8_t scan_type; + uint16_t interval; + uint16_t window; + uint8_t addr_type; + uint8_t filter_policy; +} __packed; + +#define BT_HCI_OP_LE_SET_SCAN_ENABLE BT_OP(BT_OGF_LE, 0x000c) + +#define BT_HCI_LE_SCAN_DISABLE 0x00 +#define BT_HCI_LE_SCAN_ENABLE 0x01 + +#define BT_HCI_LE_SCAN_FILTER_DUP_DISABLE 0x00 +#define BT_HCI_LE_SCAN_FILTER_DUP_ENABLE 0x01 + +struct bt_hci_cp_le_set_scan_enable { + uint8_t enable; + uint8_t filter_dup; +} __packed; + +#define BT_HCI_OP_LE_CREATE_CONN BT_OP(BT_OGF_LE, 0x000d) + +#define BT_HCI_LE_CREATE_CONN_FP_DIRECT 0x00 +#define BT_HCI_LE_CREATE_CONN_FP_WHITELIST 0x01 + +struct bt_hci_cp_le_create_conn { + uint16_t scan_interval; + uint16_t scan_window; + uint8_t filter_policy; + bt_addr_le_t peer_addr; + uint8_t own_addr_type; + uint16_t conn_interval_min; + uint16_t conn_interval_max; + uint16_t conn_latency; + uint16_t supervision_timeout; + uint16_t min_ce_len; + uint16_t max_ce_len; +} __packed; + +#define BT_HCI_OP_LE_CREATE_CONN_CANCEL BT_OP(BT_OGF_LE, 0x000e) + +#define BT_HCI_OP_LE_READ_WL_SIZE BT_OP(BT_OGF_LE, 0x000f) +struct bt_hci_rp_le_read_wl_size { + uint8_t status; + uint8_t wl_size; +} __packed; + +#define BT_HCI_OP_LE_CLEAR_WL BT_OP(BT_OGF_LE, 0x0010) + +#define BT_HCI_OP_LE_ADD_DEV_TO_WL BT_OP(BT_OGF_LE, 0x0011) +struct bt_hci_cp_le_add_dev_to_wl { + bt_addr_le_t addr; +} __packed; + +#define BT_HCI_OP_LE_REM_DEV_FROM_WL BT_OP(BT_OGF_LE, 0x0012) +struct bt_hci_cp_le_rem_dev_from_wl { + bt_addr_le_t addr; +} __packed; + +#define BT_HCI_OP_LE_CONN_UPDATE BT_OP(BT_OGF_LE, 0x0013) +struct hci_cp_le_conn_update { + uint16_t handle; + uint16_t conn_interval_min; + uint16_t conn_interval_max; + uint16_t conn_latency; + uint16_t supervision_timeout; + uint16_t min_ce_len; + uint16_t max_ce_len; +} __packed; + +#define BT_HCI_OP_LE_SET_HOST_CHAN_CLASSIF BT_OP(BT_OGF_LE, 0x0014) +struct bt_hci_cp_le_set_host_chan_classif { + uint8_t ch_map[5]; +} __packed; + +#define BT_HCI_OP_LE_READ_CHAN_MAP BT_OP(BT_OGF_LE, 0x0015) +struct bt_hci_cp_le_read_chan_map { + uint16_t handle; +} __packed; +struct bt_hci_rp_le_read_chan_map { + uint8_t status; + uint16_t handle; + uint8_t ch_map[5]; +} __packed; + +#define BT_HCI_OP_LE_READ_REMOTE_FEATURES BT_OP(BT_OGF_LE, 0x0016) +struct bt_hci_cp_le_read_remote_features { + uint16_t handle; +} __packed; + +#define BT_HCI_OP_LE_ENCRYPT BT_OP(BT_OGF_LE, 0x0017) +struct bt_hci_cp_le_encrypt { + uint8_t key[16]; + uint8_t plaintext[16]; +} __packed; +struct bt_hci_rp_le_encrypt { + uint8_t status; + uint8_t enc_data[16]; +} __packed; + +#define BT_HCI_OP_LE_RAND BT_OP(BT_OGF_LE, 0x0018) +struct bt_hci_rp_le_rand { + uint8_t status; + uint8_t rand[8]; +} __packed; + +#define BT_HCI_OP_LE_START_ENCRYPTION BT_OP(BT_OGF_LE, 0x0019) +struct bt_hci_cp_le_start_encryption { + uint16_t handle; + uint64_t rand; + uint16_t ediv; + uint8_t ltk[16]; +} __packed; + +#define BT_HCI_OP_LE_LTK_REQ_REPLY BT_OP(BT_OGF_LE, 0x001a) +struct bt_hci_cp_le_ltk_req_reply { + uint16_t handle; + uint8_t ltk[16]; +} __packed; +struct bt_hci_rp_le_ltk_req_reply { + uint8_t status; + uint16_t handle; +} __packed; + +#define BT_HCI_OP_LE_LTK_REQ_NEG_REPLY BT_OP(BT_OGF_LE, 0x001b) +struct bt_hci_cp_le_ltk_req_neg_reply { + uint16_t handle; +} __packed; +struct bt_hci_rp_le_ltk_req_neg_reply { + uint8_t status; + uint16_t handle; +} __packed; + +#define BT_HCI_OP_LE_READ_SUPP_STATES BT_OP(BT_OGF_LE, 0x001c) +struct bt_hci_rp_le_read_supp_states { + uint8_t status; + uint8_t le_states[8]; +} __packed; + +#define BT_HCI_OP_LE_RX_TEST BT_OP(BT_OGF_LE, 0x001d) +struct bt_hci_cp_le_rx_test { + uint8_t rx_ch; +} __packed; + +#define BT_HCI_OP_LE_TX_TEST BT_OP(BT_OGF_LE, 0x001e) +struct bt_hci_cp_le_tx_test { + uint8_t tx_ch; + uint8_t test_data_len; + uint8_t pkt_payload; +} __packed; + +#define BT_HCI_OP_LE_TEST_END BT_OP(BT_OGF_LE, 0x001f) +struct bt_hci_rp_le_test_end { + uint8_t status; + uint16_t rx_pkt_count; +} __packed; + +#define BT_HCI_OP_LE_CONN_PARAM_REQ_REPLY BT_OP(BT_OGF_LE, 0x0020) +struct bt_hci_cp_le_conn_param_req_reply { + uint16_t handle; + uint16_t interval_min; + uint16_t interval_max; + uint16_t latency; + uint16_t timeout; + uint16_t min_ce_len; + uint16_t max_ce_len; +} __packed; +struct bt_hci_rp_le_conn_param_req_reply { + uint8_t status; + uint16_t handle; +} __packed; + +#define BT_HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY BT_OP(BT_OGF_LE, 0x0021) +struct bt_hci_cp_le_conn_param_req_neg_reply { + uint16_t handle; + uint8_t reason; +} __packed; +struct bt_hci_rp_le_conn_param_req_neg_reply { + uint8_t status; + uint16_t handle; +} __packed; + +#define BT_HCI_OP_LE_SET_DATA_LEN BT_OP(BT_OGF_LE, 0x0022) +struct bt_hci_cp_le_set_data_len { + uint16_t handle; + uint16_t tx_octets; + uint16_t tx_time; +} __packed; +struct bt_hci_rp_le_set_data_len { + uint8_t status; + uint16_t handle; +} __packed; + +#define BT_HCI_OP_LE_READ_DEFAULT_DATA_LEN BT_OP(BT_OGF_LE, 0x0023) +struct bt_hci_rp_le_read_default_data_len { + uint8_t status; + uint16_t max_tx_octets; + uint16_t max_tx_time; +} __packed; + +#define BT_HCI_OP_LE_WRITE_DEFAULT_DATA_LEN BT_OP(BT_OGF_LE, 0x0024) +struct bt_hci_cp_le_write_default_data_len { + uint16_t max_tx_octets; + uint16_t max_tx_time; +} __packed; + +#define BT_HCI_OP_LE_P256_PUBLIC_KEY BT_OP(BT_OGF_LE, 0x0025) + +#define BT_HCI_OP_LE_GENERATE_DHKEY BT_OP(BT_OGF_LE, 0x0026) +struct bt_hci_cp_le_generate_dhkey { + uint8_t key[64]; +} __packed; + +#define BT_HCI_OP_LE_ADD_DEV_TO_RL BT_OP(BT_OGF_LE, 0x0027) +struct bt_hci_cp_le_add_dev_to_rl { + bt_addr_le_t peer_id_addr; + uint8_t peer_irk[16]; + uint8_t local_irk[16]; +} __packed; + +#define BT_HCI_OP_LE_REM_DEV_FROM_RL BT_OP(BT_OGF_LE, 0x0028) +struct bt_hci_cp_le_rem_dev_from_rl { + bt_addr_le_t peer_id_addr; +} __packed; + +#define BT_HCI_OP_LE_CLEAR_RL BT_OP(BT_OGF_LE, 0x0029) + +#define BT_HCI_OP_LE_READ_RL_SIZE BT_OP(BT_OGF_LE, 0x002a) +struct bt_hci_rp_le_read_rl_size { + uint8_t status; + uint8_t rl_size; +} __packed; + +#define BT_HCI_OP_LE_READ_PEER_RPA BT_OP(BT_OGF_LE, 0x002b) +struct bt_hci_cp_le_read_peer_rpa { + bt_addr_le_t peer_id_addr; +} __packed; +struct bt_hci_rp_le_read_peer_rpa { + uint8_t status; + bt_addr_t peer_rpa; +} __packed; + +#define BT_HCI_OP_LE_READ_LOCAL_RPA BT_OP(BT_OGF_LE, 0x002c) +struct bt_hci_cp_le_read_local_rpa { + bt_addr_le_t peer_id_addr; +} __packed; +struct bt_hci_rp_le_read_local_rpa { + uint8_t status; + bt_addr_t local_rpa; +} __packed; + +#define BT_HCI_ADDR_RES_DISABLE 0x00 +#define BT_HCI_ADDR_RES_ENABLE 0x01 + +#define BT_HCI_OP_LE_SET_ADDR_RES_ENABLE BT_OP(BT_OGF_LE, 0x002d) +struct bt_hci_cp_le_set_addr_res_enable { + uint8_t enable; +} __packed; + +#define BT_HCI_OP_LE_SET_RPA_TIMEOUT BT_OP(BT_OGF_LE, 0x002e) +struct bt_hci_cp_le_set_rpa_timeout { + uint16_t rpa_timeout; +} __packed; + +#define BT_HCI_OP_LE_READ_MAX_DATA_LEN BT_OP(BT_OGF_LE, 0x002f) +struct bt_hci_rp_le_read_max_data_len { + uint8_t status; + uint16_t max_tx_octets; + uint16_t max_tx_time; + uint16_t max_rx_octets; + uint16_t max_rx_time; +} __packed; + +#define BT_HCI_LE_PHY_1M 0x01 +#define BT_HCI_LE_PHY_2M 0x02 +#define BT_HCI_LE_PHY_CODED 0x03 + +#define BT_HCI_OP_LE_READ_PHY BT_OP(BT_OGF_LE, 0x0030) +struct bt_hci_cp_le_read_phy { + uint16_t handle; +} __packed; +struct bt_hci_rp_le_read_phy { + uint8_t status; + uint16_t handle; + uint8_t tx_phy; + uint8_t rx_phy; +} __packed; + +#define BT_HCI_LE_PHY_TX_ANY BIT(0) +#define BT_HCI_LE_PHY_RX_ANY BIT(1) + +#define BT_HCI_LE_PHY_PREFER_1M BIT(0) +#define BT_HCI_LE_PHY_PREFER_2M BIT(1) +#define BT_HCI_LE_PHY_PREFER_CODED BIT(2) + +#define BT_HCI_OP_LE_SET_DEFAULT_PHY BT_OP(BT_OGF_LE, 0x0031) +struct bt_hci_cp_le_set_default_phy { + uint8_t all_phys; + uint8_t tx_phys; + uint8_t rx_phys; +} __packed; + +#define BT_HCI_LE_PHY_CODED_ANY 0x00 +#define BT_HCI_LE_PHY_CODED_S2 0x01 +#define BT_HCI_LE_PHY_CODED_S8 0x02 + +#define BT_HCI_OP_LE_SET_PHY BT_OP(BT_OGF_LE, 0x0032) +struct bt_hci_cp_le_set_phy { + uint16_t handle; + uint8_t all_phys; + uint8_t tx_phys; + uint8_t rx_phys; + uint16_t phy_opts; +} __packed; + +#define BT_HCI_LE_MOD_INDEX_STANDARD 0x00 +#define BT_HCI_LE_MOD_INDEX_STABLE 0x01 + +#define BT_HCI_OP_LE_ENH_RX_TEST BT_OP(BT_OGF_LE, 0x0033) +struct bt_hci_cp_le_enh_rx_test { + uint8_t rx_ch; + uint8_t phy; + uint8_t mod_index; +} __packed; + +/* Extends BT_HCI_LE_PHY */ +#define BT_HCI_LE_TX_PHY_CODED_S8 0x03 +#define BT_HCI_LE_TX_PHY_CODED_S2 0x04 + +#define BT_HCI_OP_LE_ENH_TX_TEST BT_OP(BT_OGF_LE, 0x0034) +struct bt_hci_cp_le_enh_tx_test { + uint8_t tx_ch; + uint8_t test_data_len; + uint8_t pkt_payload; + uint8_t phy; +} __packed; + +#define BT_HCI_OP_LE_SET_ADV_SET_RANDOM_ADDR BT_OP(BT_OGF_LE, 0x0035) +struct bt_hci_cp_le_set_adv_set_random_addr { + uint8_t handle; + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_LE_ADV_PROP_CONN BIT(0) +#define BT_HCI_LE_ADV_PROP_SCAN BIT(1) +#define BT_HCI_LE_ADV_PROP_DIRECT BIT(2) +#define BT_HCI_LE_ADV_PROP_HI_DC_CONN BIT(3) +#define BT_HCI_LE_ADV_PROP_LEGACY BIT(4) +#define BT_HCI_LE_ADV_PROP_ANON BIT(5) +#define BT_HCI_LE_ADV_PROP_TX_POWER BIT(6) + +#define BT_HCI_LE_ADV_SCAN_REQ_ENABLE 1 +#define BT_HCI_LE_ADV_SCAN_REQ_DISABLE 0 + +#define BT_HCI_LE_ADV_TX_POWER_NO_PREF 0x7F + +#define BT_HCI_OP_LE_SET_EXT_ADV_PARAM BT_OP(BT_OGF_LE, 0x0036) +struct bt_hci_cp_le_set_ext_adv_param { + uint8_t handle; + uint16_t props; + uint8_t prim_min_interval[3]; + uint8_t prim_max_interval[3]; + uint8_t prim_channel_map; + uint8_t own_addr_type; + bt_addr_le_t peer_addr; + uint8_t filter_policy; + int8_t tx_power; + uint8_t prim_adv_phy; + uint8_t sec_adv_max_skip; + uint8_t sec_adv_phy; + uint8_t sid; + uint8_t scan_req_notify_enable; +} __packed; +struct bt_hci_rp_le_set_ext_adv_param { + uint8_t status; + int8_t tx_power; +} __packed; + +#define BT_HCI_LE_EXT_ADV_OP_INTERM_FRAG 0x00 +#define BT_HCI_LE_EXT_ADV_OP_FIRST_FRAG 0x01 +#define BT_HCI_LE_EXT_ADV_OP_LAST_FRAG 0x02 +#define BT_HCI_LE_EXT_ADV_OP_COMPLETE_DATA 0x03 +#define BT_HCI_LE_EXT_ADV_OP_UNCHANGED_DATA 0x04 + +#define BT_HCI_LE_EXT_ADV_FRAG_ENABLED 0x00 +#define BT_HCI_LE_EXT_ADV_FRAG_DISABLED 0x01 + +#define BT_HCI_LE_EXT_ADV_FRAG_MAX_LEN 251 + +#define BT_HCI_OP_LE_SET_EXT_ADV_DATA BT_OP(BT_OGF_LE, 0x0037) +struct bt_hci_cp_le_set_ext_adv_data { + uint8_t handle; + uint8_t op; + uint8_t frag_pref; + uint8_t len; + uint8_t data[251]; +} __packed; + +#define BT_HCI_OP_LE_SET_EXT_SCAN_RSP_DATA BT_OP(BT_OGF_LE, 0x0038) +struct bt_hci_cp_le_set_ext_scan_rsp_data { + uint8_t handle; + uint8_t op; + uint8_t frag_pref; + uint8_t len; + uint8_t data[251]; +} __packed; + +#define BT_HCI_OP_LE_SET_EXT_ADV_ENABLE BT_OP(BT_OGF_LE, 0x0039) +struct bt_hci_ext_adv_set { + uint8_t handle; + uint16_t duration; + uint8_t max_ext_adv_evts; +} __packed; + +struct bt_hci_cp_le_set_ext_adv_enable { + uint8_t enable; + uint8_t set_num; + struct bt_hci_ext_adv_set s[0]; +} __packed; + +#define BT_HCI_OP_LE_READ_MAX_ADV_DATA_LEN BT_OP(BT_OGF_LE, 0x003a) +struct bt_hci_rp_le_read_max_adv_data_len { + uint8_t status; + uint16_t max_adv_data_len; +} __packed; + +#define BT_HCI_OP_LE_READ_NUM_ADV_SETS BT_OP(BT_OGF_LE, 0x003b) +struct bt_hci_rp_le_read_num_adv_sets { + uint8_t status; + uint8_t num_sets; +} __packed; + +#define BT_HCI_OP_LE_REMOVE_ADV_SET BT_OP(BT_OGF_LE, 0x003c) +struct bt_hci_cp_le_remove_adv_set { + uint8_t handle; +} __packed; + +#define BT_HCI_OP_CLEAR_ADV_SETS BT_OP(BT_OGF_LE, 0x003d) + +#define BT_HCI_OP_LE_SET_PER_ADV_PARAM BT_OP(BT_OGF_LE, 0x003e) +struct bt_hci_cp_le_set_per_adv_param { + uint8_t handle; + uint16_t min_interval; + uint16_t max_interval; + uint16_t props; +} __packed; + +#define BT_HCI_OP_LE_SET_PER_ADV_DATA BT_OP(BT_OGF_LE, 0x003f) +struct bt_hci_cp_le_set_per_adv_data { + uint8_t handle; + uint8_t op; + uint8_t len; + uint8_t data[251]; +} __packed; + +#define BT_HCI_OP_LE_SET_PER_ADV_ENABLE BT_OP(BT_OGF_LE, 0x0040) +struct bt_hci_cp_le_set_per_adv_enable { + uint8_t enable; + uint8_t handle; +} __packed; + +#define BT_HCI_OP_LE_SET_EXT_SCAN_PARAM BT_OP(BT_OGF_LE, 0x0041) +struct bt_hci_ext_scan_phy { + uint8_t type; + uint16_t interval; + uint16_t window; +} __packed; + +#define BT_HCI_LE_EXT_SCAN_PHY_1M BIT(0) +#define BT_HCI_LE_EXT_SCAN_PHY_2M BIT(1) +#define BT_HCI_LE_EXT_SCAN_PHY_CODED BIT(2) + +struct bt_hci_cp_le_set_ext_scan_param { + uint8_t own_addr_type; + uint8_t filter_policy; + uint8_t phys; + struct bt_hci_ext_scan_phy p[0]; +} __packed; + +/* Extends BT_HCI_LE_SCAN_FILTER_DUP */ +#define BT_HCI_LE_EXT_SCAN_FILTER_DUP_ENABLE_RESET 0x02 + +#define BT_HCI_OP_LE_SET_EXT_SCAN_ENABLE BT_OP(BT_OGF_LE, 0x0042) +struct bt_hci_cp_le_set_ext_scan_enable { + uint8_t enable; + uint8_t filter_dup; + uint16_t duration; + uint16_t period; +} __packed; + +#define BT_HCI_OP_LE_EXT_CREATE_CONN BT_OP(BT_OGF_LE, 0x0043) +struct bt_hci_ext_conn_phy { + uint16_t scan_interval; + uint16_t scan_window; + uint16_t conn_interval_min; + uint16_t conn_interval_max; + uint16_t conn_latency; + uint16_t supervision_timeout; + uint16_t min_ce_len; + uint16_t max_ce_len; +} __packed; + +struct bt_hci_cp_le_ext_create_conn { + uint8_t filter_policy; + uint8_t own_addr_type; + bt_addr_le_t peer_addr; + uint8_t phys; + struct bt_hci_ext_conn_phy p[0]; +} __packed; + +#define BT_HCI_OP_LE_PER_ADV_CREATE_SYNC BT_OP(BT_OGF_LE, 0x0044) +struct bt_hci_cp_le_per_adv_create_sync { + uint8_t filter_policy; + uint8_t sid; + bt_addr_le_t addr; + uint16_t skip; + uint16_t sync_timeout; + uint8_t unused; +} __packed; + +#define BT_HCI_OP_LE_PER_ADV_CREATE_SYNC_CANCEL BT_OP(BT_OGF_LE, 0x0045) + +#define BT_HCI_OP_LE_PER_ADV_TERMINATE_SYNC BT_OP(BT_OGF_LE, 0x0046) +struct bt_hci_cp_le_per_adv_terminate_sync { + uint16_t handle; +} __packed; + +#define BT_HCI_OP_LE_ADD_DEV_TO_PER_ADV_LIST BT_OP(BT_OGF_LE, 0x0047) +struct bt_hci_cp_le_add_dev_to_per_adv_list { + bt_addr_le_t addr; + uint8_t sid; +} __packed; + +#define BT_HCI_OP_LE_REM_DEV_FROM_PER_ADV_LIST BT_OP(BT_OGF_LE, 0x0048) +struct bt_hci_cp_le_rem_dev_from_per_adv_list { + bt_addr_le_t addr; + uint8_t sid; +} __packed; + +#define BT_HCI_OP_LE_CLEAR_PER_ADV_LIST BT_OP(BT_OGF_LE, 0x0049) + +#define BT_HCI_OP_LE_READ_PER_ADV_LIST_SIZE BT_OP(BT_OGF_LE, 0x004a) +struct bt_hci_rp_le_read_per_adv_list_size { + uint8_t status; + uint8_t list_size; +} __packed; + +#define BT_HCI_OP_LE_READ_TX_POWER BT_OP(BT_OGF_LE, 0x004b) +struct bt_hci_rp_le_read_tx_power { + uint8_t status; + int8_t min_tx_power; + int8_t max_tx_power; +} __packed; + +#define BT_HCI_OP_LE_READ_RF_PATH_COMP BT_OP(BT_OGF_LE, 0x004c) +struct bt_hci_rp_le_read_rf_path_comp { + uint8_t status; + int16_t tx_path_comp; + int16_t rx_path_comp; +} __packed; + +#define BT_HCI_OP_LE_WRITE_RF_PATH_COMP BT_OP(BT_OGF_LE, 0x004d) +struct bt_hci_cp_le_write_rf_path_comp { + int16_t tx_path_comp; + int16_t rx_path_comp; +} __packed; + +#define BT_HCI_LE_PRIVACY_MODE_NETWORK 0x00 +#define BT_HCI_LE_PRIVACY_MODE_DEVICE 0x01 + +#define BT_HCI_OP_LE_SET_PRIVACY_MODE BT_OP(BT_OGF_LE, 0x004e) +struct bt_hci_cp_le_set_privacy_mode { + bt_addr_le_t id_addr; + uint8_t mode; +} __packed; + +/* Event definitions */ + +#define BT_HCI_EVT_UNKNOWN 0x00 +#define BT_HCI_EVT_VENDOR 0xff + +#define BT_HCI_EVT_INQUIRY_COMPLETE 0x01 +struct bt_hci_evt_inquiry_complete { + uint8_t status; +} __packed; + +#define BT_HCI_EVT_CONN_COMPLETE 0x03 +struct bt_hci_evt_conn_complete { + uint8_t status; + uint16_t handle; + bt_addr_t bdaddr; + uint8_t link_type; + uint8_t encr_enabled; +} __packed; + +#define BT_HCI_EVT_CONN_REQUEST 0x04 +struct bt_hci_evt_conn_request { + bt_addr_t bdaddr; + uint8_t dev_class[3]; + uint8_t link_type; +} __packed; + +#define BT_HCI_EVT_DISCONN_COMPLETE 0x05 +struct bt_hci_evt_disconn_complete { + uint8_t status; + uint16_t handle; + uint8_t reason; +} __packed; + +#define BT_HCI_EVT_AUTH_COMPLETE 0x06 +struct bt_hci_evt_auth_complete { + uint8_t status; + uint16_t handle; +} __packed; + +#define BT_HCI_EVT_REMOTE_NAME_REQ_COMPLETE 0x07 +struct bt_hci_evt_remote_name_req_complete { + uint8_t status; + bt_addr_t bdaddr; + uint8_t name[248]; +} __packed; + +#define BT_HCI_EVT_ENCRYPT_CHANGE 0x08 +struct bt_hci_evt_encrypt_change { + uint8_t status; + uint16_t handle; + uint8_t encrypt; +} __packed; + +#define BT_HCI_EVT_REMOTE_FEATURES 0x0b +struct bt_hci_evt_remote_features { + uint8_t status; + uint16_t handle; + uint8_t features[8]; +} __packed; + +#define BT_HCI_EVT_REMOTE_VERSION_INFO 0x0c +struct bt_hci_evt_remote_version_info { + uint8_t status; + uint16_t handle; + uint8_t version; + uint16_t manufacturer; + uint16_t subversion; +} __packed; + +#define BT_HCI_EVT_CMD_COMPLETE 0x0e +struct bt_hci_evt_cmd_complete { + uint8_t ncmd; + uint16_t opcode; +} __packed; + +struct bt_hci_evt_cc_status { + uint8_t status; +} __packed; + +#define BT_HCI_EVT_CMD_STATUS 0x0f +struct bt_hci_evt_cmd_status { + uint8_t status; + uint8_t ncmd; + uint16_t opcode; +} __packed; + +#define BT_HCI_EVT_ROLE_CHANGE 0x12 +struct bt_hci_evt_role_change { + uint8_t status; + bt_addr_t bdaddr; + uint8_t role; +} __packed; + +#define BT_HCI_EVT_NUM_COMPLETED_PACKETS 0x13 +struct bt_hci_evt_num_completed_packets { + uint8_t num_handles; + struct bt_hci_handle_count h[0]; +} __packed; + +#define BT_HCI_EVT_PIN_CODE_REQ 0x16 +struct bt_hci_evt_pin_code_req { + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_EVT_LINK_KEY_REQ 0x17 +struct bt_hci_evt_link_key_req { + bt_addr_t bdaddr; +} __packed; + +/* Link Key types */ +#define BT_LK_COMBINATION 0x00 +#define BT_LK_LOCAL_UNIT 0x01 +#define BT_LK_REMOTE_UNIT 0x02 +#define BT_LK_DEBUG_COMBINATION 0x03 +#define BT_LK_UNAUTH_COMBINATION_P192 0x04 +#define BT_LK_AUTH_COMBINATION_P192 0x05 +#define BT_LK_CHANGED_COMBINATION 0x06 +#define BT_LK_UNAUTH_COMBINATION_P256 0x07 +#define BT_LK_AUTH_COMBINATION_P256 0x08 + +#define BT_HCI_EVT_LINK_KEY_NOTIFY 0x18 +struct bt_hci_evt_link_key_notify { + bt_addr_t bdaddr; + uint8_t link_key[16]; + uint8_t key_type; +} __packed; + +/* Overflow link types */ +#define BT_OVERFLOW_LINK_SYNCH 0x00 +#define BT_OVERFLOW_LINK_ACL 0x01 + +#define BT_HCI_EVT_DATA_BUF_OVERFLOW 0x1a +struct bt_hci_evt_data_buf_overflow { + uint8_t link_type; +} __packed; + +#define BT_HCI_EVT_INQUIRY_RESULT_WITH_RSSI 0x22 +struct bt_hci_evt_inquiry_result_with_rssi { + bt_addr_t addr; + uint8_t pscan_rep_mode; + uint8_t reserved; + uint8_t cod[3]; + uint16_t clock_offset; + int8_t rssi; +} __packed; + +#define BT_HCI_EVT_REMOTE_EXT_FEATURES 0x23 +struct bt_hci_evt_remote_ext_features { + uint8_t status; + uint16_t handle; + uint8_t page; + uint8_t max_page; + uint8_t features[8]; +} __packed; + +#define BT_HCI_EVT_SYNC_CONN_COMPLETE 0x2c +struct bt_hci_evt_sync_conn_complete { + uint8_t status; + uint16_t handle; + bt_addr_t bdaddr; + uint8_t link_type; + uint8_t tx_interval; + uint8_t retansmission_window; + uint16_t rx_pkt_length; + uint16_t tx_pkt_length; + uint8_t air_mode; +} __packed; + +#define BT_HCI_EVT_EXTENDED_INQUIRY_RESULT 0x2f +struct bt_hci_evt_extended_inquiry_result { + uint8_t num_reports; + bt_addr_t addr; + uint8_t pscan_rep_mode; + uint8_t reserved; + uint8_t cod[3]; + uint16_t clock_offset; + int8_t rssi; + uint8_t eir[240]; +} __packed; + +#define BT_HCI_EVT_ENCRYPT_KEY_REFRESH_COMPLETE 0x30 +struct bt_hci_evt_encrypt_key_refresh_complete { + uint8_t status; + uint16_t handle; +} __packed; + +#define BT_HCI_EVT_IO_CAPA_REQ 0x31 +struct bt_hci_evt_io_capa_req { + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_EVT_IO_CAPA_RESP 0x32 +struct bt_hci_evt_io_capa_resp { + bt_addr_t bdaddr; + uint8_t capability; + uint8_t oob_data; + uint8_t authentication; +} __packed; + +#define BT_HCI_EVT_USER_CONFIRM_REQ 0x33 +struct bt_hci_evt_user_confirm_req { + bt_addr_t bdaddr; + uint32_t passkey; +} __packed; + +#define BT_HCI_EVT_USER_PASSKEY_REQ 0x34 +struct bt_hci_evt_user_passkey_req { + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_EVT_SSP_COMPLETE 0x36 +struct bt_hci_evt_ssp_complete { + uint8_t status; + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_EVT_USER_PASSKEY_NOTIFY 0x3b +struct bt_hci_evt_user_passkey_notify { + bt_addr_t bdaddr; + uint32_t passkey; +} __packed; + +#define BT_HCI_EVT_LE_META_EVENT 0x3e +struct bt_hci_evt_le_meta_event { + uint8_t subevent; +} __packed; + +#define BT_HCI_EVT_AUTH_PAYLOAD_TIMEOUT_EXP 0x57 +struct bt_hci_evt_auth_payload_timeout_exp { + uint16_t handle; +} __packed; + +#define BT_HCI_ROLE_MASTER 0x00 +#define BT_HCI_ROLE_SLAVE 0x01 + +#define BT_HCI_EVT_LE_CONN_COMPLETE 0x01 +struct bt_hci_evt_le_conn_complete { + uint8_t status; + uint16_t handle; + uint8_t role; + bt_addr_le_t peer_addr; + uint16_t interval; + uint16_t latency; + uint16_t supv_timeout; + uint8_t clock_accuracy; +} __packed; + +#define BT_HCI_EVT_LE_ADVERTISING_REPORT 0x02 +struct bt_hci_evt_le_advertising_info { + uint8_t evt_type; + bt_addr_le_t addr; + uint8_t length; + uint8_t data[0]; +} __packed; +struct bt_hci_evt_le_advertising_report { + uint8_t num_reports; + struct bt_hci_evt_le_advertising_info adv_info[0]; +} __packed; + +#define BT_HCI_EVT_LE_CONN_UPDATE_COMPLETE 0x03 +struct bt_hci_evt_le_conn_update_complete { + uint8_t status; + uint16_t handle; + uint16_t interval; + uint16_t latency; + uint16_t supv_timeout; +} __packed; + +#define BT_HCI_EV_LE_REMOTE_FEAT_COMPLETE 0x04 +struct bt_hci_evt_le_remote_feat_complete { + uint8_t status; + uint16_t handle; + uint8_t features[8]; +} __packed; + +#define BT_HCI_EVT_LE_LTK_REQUEST 0x05 +struct bt_hci_evt_le_ltk_request { + uint16_t handle; + uint64_t rand; + uint16_t ediv; +} __packed; + +#define BT_HCI_EVT_LE_CONN_PARAM_REQ 0x06 +struct bt_hci_evt_le_conn_param_req { + uint16_t handle; + uint16_t interval_min; + uint16_t interval_max; + uint16_t latency; + uint16_t timeout; +} __packed; + +#define BT_HCI_EVT_LE_DATA_LEN_CHANGE 0x07 +struct bt_hci_evt_le_data_len_change { + uint16_t handle; + uint16_t max_tx_octets; + uint16_t max_tx_time; + uint16_t max_rx_octets; + uint16_t max_rx_time; +} __packed; + +#define BT_HCI_EVT_LE_P256_PUBLIC_KEY_COMPLETE 0x08 +struct bt_hci_evt_le_p256_public_key_complete { + uint8_t status; + uint8_t key[64]; +} __packed; + +#define BT_HCI_EVT_LE_GENERATE_DHKEY_COMPLETE 0x09 +struct bt_hci_evt_le_generate_dhkey_complete { + uint8_t status; + uint8_t dhkey[32]; +} __packed; + +#define BT_HCI_EVT_LE_ENH_CONN_COMPLETE 0x0a +struct bt_hci_evt_le_enh_conn_complete { + uint8_t status; + uint16_t handle; + uint8_t role; + bt_addr_le_t peer_addr; + bt_addr_t local_rpa; + bt_addr_t peer_rpa; + uint16_t interval; + uint16_t latency; + uint16_t supv_timeout; + uint8_t clock_accuracy; +} __packed; + +#define BT_HCI_EVT_LE_DIRECT_ADV_REPORT 0x0b +struct bt_hci_evt_le_direct_adv_info { + uint8_t evt_type; + bt_addr_le_t addr; + bt_addr_le_t dir_addr; + int8_t rssi; +} __packed; +struct bt_hci_evt_le_direct_adv_report { + uint8_t num_reports; + struct bt_hci_evt_le_direct_adv_info direct_adv_info[0]; +} __packed; + +#define BT_HCI_EVT_LE_PHY_UPDATE_COMPLETE 0x0c +struct bt_hci_evt_le_phy_update_complete { + uint8_t status; + uint16_t handle; + uint8_t tx_phy; + uint8_t rx_phy; +} __packed; + +#define BT_HCI_EVT_LE_EXT_ADVERTISING_REPORT 0x0d + +#define BT_HCI_LE_ADV_EVT_TYPE_CONN BIT(0) +#define BT_HCI_LE_ADV_EVT_TYPE_SCAN BIT(1) +#define BT_HCI_LE_ADV_EVT_TYPE_DIRECT BIT(2) +#define BT_HCI_LE_ADV_EVT_TYPE_SCAN_RSP BIT(3) +#define BT_HCI_LE_ADV_EVT_TYPE_LEGACY BIT(4) + +#define BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS(ev_type) (((ev_type) >> 5) & 0x03) +#define BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS_COMPLETE 0 +#define BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS_PARTIAL 1 +#define BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS_INCOMPLETE 2 + +struct bt_hci_evt_le_ext_advertising_info { + uint16_t evt_type; + bt_addr_le_t addr; + uint8_t prim_phy; + uint8_t sec_phy; + uint8_t sid; + int8_t tx_power; + int8_t rssi; + uint16_t interval; + bt_addr_le_t direct_addr; + uint8_t length; + uint8_t data[0]; +} __packed; +struct bt_hci_evt_le_ext_advertising_report { + uint8_t num_reports; + struct bt_hci_evt_le_ext_advertising_info adv_info[0]; +} __packed; + +#define BT_HCI_EVT_LE_PER_ADV_SYNC_ESTABLISHED 0x0e +struct bt_hci_evt_le_per_adv_sync_established { + uint8_t status; + uint16_t handle; + uint8_t sid; + bt_addr_le_t adv_addr; + uint8_t phy; + uint16_t interval; + uint8_t clock_accuracy; +} __packed; + +#define BT_HCI_EVT_LE_PER_ADVERTISING_REPORT 0x0f +struct bt_hci_evt_le_per_advertising_report { + uint16_t handle; + int8_t tx_power; + int8_t rssi; + uint8_t unused; + uint8_t data_status; + uint8_t length; + uint8_t data[0]; +} __packed; + +#define BT_HCI_EVT_LE_PER_ADV_SYNC_LOST 0x10 +struct bt_hci_evt_le_per_adv_sync_lost { + uint16_t handle; +} __packed; + +#define BT_HCI_EVT_LE_SCAN_TIMEOUT 0x11 + +#define BT_HCI_EVT_LE_ADV_SET_TERMINATED 0x12 +struct bt_hci_evt_le_adv_set_terminated { + uint8_t status; + uint8_t adv_handle; + uint16_t conn_handle; + uint8_t num_completed_ext_adv_evts; +} __packed; + +#define BT_HCI_EVT_LE_SCAN_REQ_RECEIVED 0x13 +struct bt_hci_evt_le_scan_req_received { + uint8_t handle; + bt_addr_le_t addr; +} __packed; + +#define BT_HCI_LE_CHAN_SEL_ALGO_1 0x00 +#define BT_HCI_LE_CHAN_SEL_ALGO_2 0x01 + +#define BT_HCI_EVT_LE_CHAN_SEL_ALGO 0x14 +struct bt_hci_evt_le_chan_sel_algo { + uint16_t handle; + uint8_t chan_sel_algo; +} __packed; + +/* Event mask bits */ + +#define BT_EVT_BIT(n) (1ULL << (n)) + +#define BT_EVT_MASK_INQUIRY_COMPLETE BT_EVT_BIT(0) +#define BT_EVT_MASK_CONN_COMPLETE BT_EVT_BIT(2) +#define BT_EVT_MASK_CONN_REQUEST BT_EVT_BIT(3) +#define BT_EVT_MASK_DISCONN_COMPLETE BT_EVT_BIT(4) +#define BT_EVT_MASK_AUTH_COMPLETE BT_EVT_BIT(5) +#define BT_EVT_MASK_REMOTE_NAME_REQ_COMPLETE BT_EVT_BIT(6) +#define BT_EVT_MASK_ENCRYPT_CHANGE BT_EVT_BIT(7) +#define BT_EVT_MASK_REMOTE_FEATURES BT_EVT_BIT(10) +#define BT_EVT_MASK_REMOTE_VERSION_INFO BT_EVT_BIT(11) +#define BT_EVT_MASK_HARDWARE_ERROR BT_EVT_BIT(15) +#define BT_EVT_MASK_ROLE_CHANGE BT_EVT_BIT(17) +#define BT_EVT_MASK_PIN_CODE_REQ BT_EVT_BIT(21) +#define BT_EVT_MASK_LINK_KEY_REQ BT_EVT_BIT(22) +#define BT_EVT_MASK_LINK_KEY_NOTIFY BT_EVT_BIT(23) +#define BT_EVT_MASK_DATA_BUFFER_OVERFLOW BT_EVT_BIT(25) +#define BT_EVT_MASK_INQUIRY_RESULT_WITH_RSSI BT_EVT_BIT(33) +#define BT_EVT_MASK_REMOTE_EXT_FEATURES BT_EVT_BIT(34) +#define BT_EVT_MASK_SYNC_CONN_COMPLETE BT_EVT_BIT(43) +#define BT_EVT_MASK_EXTENDED_INQUIRY_RESULT BT_EVT_BIT(46) +#define BT_EVT_MASK_ENCRYPT_KEY_REFRESH_COMPLETE BT_EVT_BIT(47) +#define BT_EVT_MASK_IO_CAPA_REQ BT_EVT_BIT(48) +#define BT_EVT_MASK_IO_CAPA_RESP BT_EVT_BIT(49) +#define BT_EVT_MASK_USER_CONFIRM_REQ BT_EVT_BIT(50) +#define BT_EVT_MASK_USER_PASSKEY_REQ BT_EVT_BIT(51) +#define BT_EVT_MASK_SSP_COMPLETE BT_EVT_BIT(53) +#define BT_EVT_MASK_USER_PASSKEY_NOTIFY BT_EVT_BIT(58) +#define BT_EVT_MASK_LE_META_EVENT BT_EVT_BIT(61) + +/* Page 2 */ +#define BT_EVT_MASK_PHY_LINK_COMPLETE BT_EVT_BIT(0) +#define BT_EVT_MASK_CH_SELECTED_COMPLETE BT_EVT_BIT(1) +#define BT_EVT_MASK_DISCONN_PHY_LINK_COMPLETE BT_EVT_BIT(2) +#define BT_EVT_MASK_PHY_LINK_LOSS_EARLY_WARN BT_EVT_BIT(3) +#define BT_EVT_MASK_PHY_LINK_RECOVERY BT_EVT_BIT(4) +#define BT_EVT_MASK_LOG_LINK_COMPLETE BT_EVT_BIT(5) +#define BT_EVT_MASK_DISCONN_LOG_LINK_COMPLETE BT_EVT_BIT(6) +#define BT_EVT_MASK_FLOW_SPEC_MODIFY_COMPLETE BT_EVT_BIT(7) +#define BT_EVT_MASK_NUM_COMPLETE_DATA_BLOCKS BT_EVT_BIT(8) +#define BT_EVT_MASK_AMP_START_TEST BT_EVT_BIT(9) +#define BT_EVT_MASK_AMP_TEST_END BT_EVT_BIT(10) +#define BT_EVT_MASK_AMP_RX_REPORT BT_EVT_BIT(11) +#define BT_EVT_MASK_AMP_SR_MODE_CHANGE_COMPLETE BT_EVT_BIT(12) +#define BT_EVT_MASK_AMP_STATUS_CHANGE BT_EVT_BIT(13) +#define BT_EVT_MASK_TRIGG_CLOCK_CAPTURE BT_EVT_BIT(14) +#define BT_EVT_MASK_SYNCH_TRAIN_COMPLETE BT_EVT_BIT(15) +#define BT_EVT_MASK_SYNCH_TRAIN_RX BT_EVT_BIT(16) +#define BT_EVT_MASK_CL_SLAVE_BC_RX BT_EVT_BIT(17) +#define BT_EVT_MASK_CL_SLAVE_BC_TIMEOUT BT_EVT_BIT(18) +#define BT_EVT_MASK_TRUNC_PAGE_COMPLETE BT_EVT_BIT(19) +#define BT_EVT_MASK_SLAVE_PAGE_RSP_TIMEOUT BT_EVT_BIT(20) +#define BT_EVT_MASK_CL_SLAVE_BC_CH_MAP_CHANGE BT_EVT_BIT(21) +#define BT_EVT_MASK_INQUIRY_RSP_NOT BT_EVT_BIT(22) +#define BT_EVT_MASK_AUTH_PAYLOAD_TIMEOUT_EXP BT_EVT_BIT(23) +#define BT_EVT_MASK_SAM_STATUS_CHANGE BT_EVT_BIT(24) + +#define BT_EVT_MASK_LE_CONN_COMPLETE BT_EVT_BIT(0) +#define BT_EVT_MASK_LE_ADVERTISING_REPORT BT_EVT_BIT(1) +#define BT_EVT_MASK_LE_CONN_UPDATE_COMPLETE BT_EVT_BIT(2) +#define BT_EVT_MASK_LE_REMOTE_FEAT_COMPLETE BT_EVT_BIT(3) +#define BT_EVT_MASK_LE_LTK_REQUEST BT_EVT_BIT(4) +#define BT_EVT_MASK_LE_CONN_PARAM_REQ BT_EVT_BIT(5) +#define BT_EVT_MASK_LE_DATA_LEN_CHANGE BT_EVT_BIT(6) +#define BT_EVT_MASK_LE_P256_PUBLIC_KEY_COMPLETE BT_EVT_BIT(7) +#define BT_EVT_MASK_LE_GENERATE_DHKEY_COMPLETE BT_EVT_BIT(8) +#define BT_EVT_MASK_LE_ENH_CONN_COMPLETE BT_EVT_BIT(9) +#define BT_EVT_MASK_LE_DIRECT_ADV_REPORT BT_EVT_BIT(10) +#define BT_EVT_MASK_LE_PHY_UPDATE_COMPLETE BT_EVT_BIT(11) +#define BT_EVT_MASK_LE_EXT_ADVERTISING_REPORT BT_EVT_BIT(12) +#define BT_EVT_MASK_LE_PER_ADV_SYNC_ESTABLISHED BT_EVT_BIT(13) +#define BT_EVT_MASK_LE_PER_ADVERTISING_REPORT BT_EVT_BIT(14) +#define BT_EVT_MASK_LE_PER_ADV_SYNC_LOST BT_EVT_BIT(15) +#define BT_EVT_MASK_LE_SCAN_TIMEOUT BT_EVT_BIT(16) +#define BT_EVT_MASK_LE_ADV_SET_TERMINATED BT_EVT_BIT(17) +#define BT_EVT_MASK_LE_SCAN_REQ_RECEIVED BT_EVT_BIT(18) +#define BT_EVT_MASK_LE_CHAN_SEL_ALGO BT_EVT_BIT(19) + + // +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_INCLUDE_BLUETOOTH_HCI_H_ */ diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/README.md b/devices/ble_hci/common-hal/_bleio/hci_include/README.md new file mode 100644 index 0000000000..4d2968c39c --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/hci_include/README.md @@ -0,0 +1,2 @@ +The HCI-related include files here are copied from the Zephyr project: +https://github.com/zephyrproject-rtos/zephyr/tree/master/include/bluetooth diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/addr.h b/devices/ble_hci/common-hal/_bleio/hci_include/addr.h new file mode 100644 index 0000000000..8f503b8a17 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/hci_include/addr.h @@ -0,0 +1,100 @@ +// CircuitPython: Adapted from Zephyer include files. +/** @file + * @brief Bluetooth device address definitions and utilities. + */ + +/* + * Copyright (c) 2019 Nordic Semiconductor ASA + * Copyright 2020 Dan Halbert for Adafruit Industries + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef ZEPHYR_INCLUDE_BLUETOOTH_ADDR_H_ +#define ZEPHYR_INCLUDE_BLUETOOTH_ADDR_H_ + +#include + +/** + * @brief Bluetooth device address definitions and utilities. + * @defgroup bt_addr Device Address + * @ingroup bluetooth + * @{ + */ + +#define BT_ADDR_LE_PUBLIC 0x00 +#define BT_ADDR_LE_RANDOM 0x01 +#define BT_ADDR_LE_PUBLIC_ID 0x02 +#define BT_ADDR_LE_RANDOM_ID 0x03 + +/** Bluetooth Device Address */ +typedef struct { + uint8_t val[6]; +} bt_addr_t; + +/** Bluetooth LE Device Address */ +typedef struct { + uint8_t type; + bt_addr_t a; +} bt_addr_le_t; + +#define BT_ADDR_ANY ((bt_addr_t[]) { { { 0, 0, 0, 0, 0, 0 } } }) +#define BT_ADDR_NONE ((bt_addr_t[]) { { \ + { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } } }) +#define BT_ADDR_LE_ANY ((bt_addr_le_t[]) { { 0, { { 0, 0, 0, 0, 0, 0 } } } }) +#define BT_ADDR_LE_NONE ((bt_addr_le_t[]) { { 0, \ + { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } } } }) + +static inline int bt_addr_cmp(const bt_addr_t *a, const bt_addr_t *b) +{ + return memcmp(a, b, sizeof(*a)); +} + +static inline int bt_addr_le_cmp(const bt_addr_le_t *a, const bt_addr_le_t *b) +{ + return memcmp(a, b, sizeof(*a)); +} + +static inline void bt_addr_copy(bt_addr_t *dst, const bt_addr_t *src) +{ + memcpy(dst, src, sizeof(*dst)); +} + +static inline void bt_addr_le_copy(bt_addr_le_t *dst, const bt_addr_le_t *src) +{ + memcpy(dst, src, sizeof(*dst)); +} + +#define BT_ADDR_IS_RPA(a) (((a)->val[5] & 0xc0) == 0x40) +#define BT_ADDR_IS_NRPA(a) (((a)->val[5] & 0xc0) == 0x00) +#define BT_ADDR_IS_STATIC(a) (((a)->val[5] & 0xc0) == 0xc0) + +#define BT_ADDR_SET_RPA(a) ((a)->val[5] = (((a)->val[5] & 0x3f) | 0x40)) +#define BT_ADDR_SET_NRPA(a) ((a)->val[5] &= 0x3f) +#define BT_ADDR_SET_STATIC(a) ((a)->val[5] |= 0xc0) + +int bt_addr_le_create_nrpa(bt_addr_le_t *addr); +int bt_addr_le_create_static(bt_addr_le_t *addr); + +static inline bool bt_addr_le_is_rpa(const bt_addr_le_t *addr) +{ + if (addr->type != BT_ADDR_LE_RANDOM) { + return false; + } + + return BT_ADDR_IS_RPA(&addr->a); +} + +static inline bool bt_addr_le_is_identity(const bt_addr_le_t *addr) +{ + if (addr->type == BT_ADDR_LE_PUBLIC) { + return true; + } + + return BT_ADDR_IS_STATIC(&addr->a); +} + +/** + * @} + */ + +#endif /* ZEPHYR_INCLUDE_BLUETOOTH_ADDR_H_ */ diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/hci.h b/devices/ble_hci/common-hal/_bleio/hci_include/hci.h new file mode 100644 index 0000000000..dbe233fef0 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/hci_include/hci.h @@ -0,0 +1,1764 @@ +// CircuitPython: Adapted from Zephyr include file. +/* hci.h - Bluetooth Host Control Interface definitions */ + +/* + * Copyright 2020 Dan Halbert for Adafruit Industries + * Copyright (c) 2015-2016 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef ZEPHYR_INCLUDE_BLUETOOTH_HCI_H_ +#define ZEPHYR_INCLUDE_BLUETOOTH_HCI_H_ + +#include +#include +#include "addr.h" + +/* Special own address types for LL privacy (used in adv & scan parameters) */ +#define BT_HCI_OWN_ADDR_RPA_OR_PUBLIC 0x02 +#define BT_HCI_OWN_ADDR_RPA_OR_RANDOM 0x03 +#define BT_HCI_OWN_ADDR_RPA_MASK 0x02 + +#define BT_HCI_PEER_ADDR_RPA_UNRESOLVED 0xfe +#define BT_HCI_PEER_ADDR_ANONYMOUS 0xff + +#define BT_ENC_KEY_SIZE_MIN 0x07 +#define BT_ENC_KEY_SIZE_MAX 0x10 + +struct bt_hci_evt_hdr { + uint8_t evt; + uint8_t len; +} __packed; +#define BT_HCI_EVT_HDR_SIZE 2 + +#define BT_ACL_START_NO_FLUSH 0x00 +#define BT_ACL_CONT 0x01 +#define BT_ACL_START 0x02 +#define BT_ACL_COMPLETE 0x03 + +#define BT_ACL_POINT_TO_POINT 0x00 +#define BT_ACL_BROADCAST 0x01 + +#define bt_acl_handle(h) ((h) & BIT_MASK(12)) +#define bt_acl_flags(h) ((h) >> 12) +#define bt_acl_flags_pb(f) ((f) & BIT_MASK(2)) +#define bt_acl_flags_bc(f) ((f) >> 2) +#define bt_acl_handle_pack(h, f) ((h) | ((f) << 12)) + +struct bt_hci_acl_hdr { + uint16_t handle; + uint16_t len; +} __packed; +#define BT_HCI_ACL_HDR_SIZE 4 + +struct bt_hci_cmd_hdr { + uint16_t opcode; + uint8_t param_len; +} __packed; +#define BT_HCI_CMD_HDR_SIZE 3 + +/* Supported Commands */ +#define BT_CMD_TEST(cmd, octet, bit) (cmd[octet] & BIT(bit)) +#define BT_CMD_LE_STATES(cmd) BT_CMD_TEST(cmd, 28, 3) + +#define BT_FEAT_TEST(feat, page, octet, bit) (feat[page][octet] & BIT(bit)) + +#define BT_FEAT_BREDR(feat) !BT_FEAT_TEST(feat, 0, 4, 5) +#define BT_FEAT_LE(feat) BT_FEAT_TEST(feat, 0, 4, 6) +#define BT_FEAT_EXT_FEATURES(feat) BT_FEAT_TEST(feat, 0, 7, 7) +#define BT_FEAT_HOST_SSP(feat) BT_FEAT_TEST(feat, 1, 0, 0) +#define BT_FEAT_SC(feat) BT_FEAT_TEST(feat, 2, 1, 0) + +#define BT_FEAT_LMP_ESCO_CAPABLE(feat) BT_FEAT_TEST(feat, 0, 3, 7) +#define BT_FEAT_HV2_PKT(feat) BT_FEAT_TEST(feat, 0, 1, 4) +#define BT_FEAT_HV3_PKT(feat) BT_FEAT_TEST(feat, 0, 1, 5) +#define BT_FEAT_EV4_PKT(feat) BT_FEAT_TEST(feat, 0, 4, 0) +#define BT_FEAT_EV5_PKT(feat) BT_FEAT_TEST(feat, 0, 4, 1) +#define BT_FEAT_2EV3_PKT(feat) BT_FEAT_TEST(feat, 0, 5, 5) +#define BT_FEAT_3EV3_PKT(feat) BT_FEAT_TEST(feat, 0, 5, 6) +#define BT_FEAT_3SLOT_PKT(feat) BT_FEAT_TEST(feat, 0, 5, 7) + +/* LE features */ +#define BT_LE_FEAT_BIT_ENC 0 +#define BT_LE_FEAT_BIT_CONN_PARAM_REQ 1 +#define BT_LE_FEAT_BIT_EXT_REJ_IND 2 +#define BT_LE_FEAT_BIT_SLAVE_FEAT_REQ 3 +#define BT_LE_FEAT_BIT_PING 4 +#define BT_LE_FEAT_BIT_DLE 5 +#define BT_LE_FEAT_BIT_PRIVACY 6 +#define BT_LE_FEAT_BIT_EXT_SCAN 7 +#define BT_LE_FEAT_BIT_PHY_2M 8 +#define BT_LE_FEAT_BIT_SMI_TX 9 +#define BT_LE_FEAT_BIT_SMI_RX 10 +#define BT_LE_FEAT_BIT_PHY_CODED 11 +#define BT_LE_FEAT_BIT_EXT_ADV 12 +#define BT_LE_FEAT_BIT_PER_ADV 13 +#define BT_LE_FEAT_BIT_CHAN_SEL_ALGO_2 14 +#define BT_LE_FEAT_BIT_PWR_CLASS_1 15 +#define BT_LE_FEAT_BIT_MIN_USED_CHAN_PROC 16 +#define BT_LE_FEAT_BIT_CONN_CTE_REQ 17 +#define BT_LE_FEAT_BIT_CONN_CTE_RESP 18 +#define BT_LE_FEAT_BIT_CONNECTIONLESS_CTE_TX 19 +#define BT_LE_FEAT_BIT_CONNECTIONLESS_CTE_RX 20 +#define BT_LE_FEAT_BIT_ANT_SWITCH_TX_AOD 21 +#define BT_LE_FEAT_BIT_ANT_SWITCH_RX_AOA 22 +#define BT_LE_FEAT_BIT_RX_CTE 23 +#define BT_LE_FEAT_BIT_PERIODIC_SYNC_XFER_SEND 24 +#define BT_LE_FEAT_BIT_PERIODIC_SYNC_XFER_RECV 25 +#define BT_LE_FEAT_BIT_SCA_UPDATE 26 +#define BT_LE_FEAT_BIT_REMOTE_PUB_KEY_VALIDATE 27 +#define BT_LE_FEAT_BIT_CIS_MASTER 28 +#define BT_LE_FEAT_BIT_CIS_SLAVE 29 +#define BT_LE_FEAT_BIT_ISO_BROADCASTER 30 +#define BT_LE_FEAT_BIT_SYNC_RECEIVER 31 +#define BT_LE_FEAT_BIT_ISO_CHANNELS 32 +#define BT_LE_FEAT_BIT_PWR_CTRL_REQ 33 +#define BT_LE_FEAT_BIT_PWR_CHG_IND 34 +#define BT_LE_FEAT_BIT_PATH_LOSS_MONITOR 35 + +#define BT_LE_FEAT_TEST(feat, n) (feat[(n) >> 3] & \ + BIT((n) & 7)) + +#define BT_FEAT_LE_ENCR(feat) BT_LE_FEAT_TEST(feat, \ + BT_LE_FEAT_BIT_ENC) +#define BT_FEAT_LE_CONN_PARAM_REQ_PROC(feat) BT_LE_FEAT_TEST(feat, \ + BT_LE_FEAT_BIT_CONN_PARAM_REQ) +#define BT_FEAT_LE_SLAVE_FEATURE_XCHG(feat) BT_LE_FEAT_TEST(feat, \ + BT_LE_FEAT_BIT_SLAVE_FEAT_REQ) +#define BT_FEAT_LE_DLE(feat) BT_LE_FEAT_TEST(feat, \ + BT_LE_FEAT_BIT_DLE) +#define BT_FEAT_LE_PHY_2M(feat) BT_LE_FEAT_TEST(feat, \ + BT_LE_FEAT_BIT_PHY_2M) +#define BT_FEAT_LE_PHY_CODED(feat) BT_LE_FEAT_TEST(feat, \ + BT_LE_FEAT_BIT_PHY_CODED) +#define BT_FEAT_LE_PRIVACY(feat) BT_LE_FEAT_TEST(feat, \ + BT_LE_FEAT_BIT_PRIVACY) +#define BT_FEAT_LE_EXT_ADV(feat) BT_LE_FEAT_TEST(feat, \ + BT_LE_FEAT_BIT_EXT_ADV) + +/* LE States */ +#define BT_LE_STATES_SLAVE_CONN_ADV(states) (states & 0x0000004000000000) + +/* Bonding/authentication types */ +#define BT_HCI_NO_BONDING 0x00 +#define BT_HCI_NO_BONDING_MITM 0x01 +#define BT_HCI_DEDICATED_BONDING 0x02 +#define BT_HCI_DEDICATED_BONDING_MITM 0x03 +#define BT_HCI_GENERAL_BONDING 0x04 +#define BT_HCI_GENERAL_BONDING_MITM 0x05 + +/* + * MITM protection is enabled in SSP authentication requirements octet when + * LSB bit is set. + */ +#define BT_MITM 0x01 + +/* I/O capabilities */ +#define BT_IO_DISPLAY_ONLY 0x00 +#define BT_IO_DISPLAY_YESNO 0x01 +#define BT_IO_KEYBOARD_ONLY 0x02 +#define BT_IO_NO_INPUT_OUTPUT 0x03 + +/* SCO packet types */ +#define HCI_PKT_TYPE_HV1 0x0020 +#define HCI_PKT_TYPE_HV2 0x0040 +#define HCI_PKT_TYPE_HV3 0x0080 + +/* eSCO packet types */ +#define HCI_PKT_TYPE_ESCO_HV1 0x0001 +#define HCI_PKT_TYPE_ESCO_HV2 0x0002 +#define HCI_PKT_TYPE_ESCO_HV3 0x0004 +#define HCI_PKT_TYPE_ESCO_EV3 0x0008 +#define HCI_PKT_TYPE_ESCO_EV4 0x0010 +#define HCI_PKT_TYPE_ESCO_EV5 0x0020 +#define HCI_PKT_TYPE_ESCO_2EV3 0x0040 +#define HCI_PKT_TYPE_ESCO_3EV3 0x0080 +#define HCI_PKT_TYPE_ESCO_2EV5 0x0100 +#define HCI_PKT_TYPE_ESCO_3EV5 0x0200 + + +#define ESCO_PKT_MASK (HCI_PKT_TYPE_ESCO_HV1 | \ + HCI_PKT_TYPE_ESCO_HV2 | \ + HCI_PKT_TYPE_ESCO_HV3) +#define SCO_PKT_MASK (HCI_PKT_TYPE_HV1 | \ + HCI_PKT_TYPE_HV2 | \ + HCI_PKT_TYPE_HV3) +#define EDR_ESCO_PKT_MASK (HCI_PKT_TYPE_ESCO_2EV3 | \ + HCI_PKT_TYPE_ESCO_3EV3 | \ + HCI_PKT_TYPE_ESCO_2EV5 | \ + HCI_PKT_TYPE_ESCO_3EV5) + +/* HCI BR/EDR link types */ +#define BT_HCI_SCO 0x00 +#define BT_HCI_ACL 0x01 +#define BT_HCI_ESCO 0x02 + +/* OpCode Group Fields */ +#define BT_OGF_LINK_CTRL 0x01 +#define BT_OGF_BASEBAND 0x03 +#define BT_OGF_INFO 0x04 +#define BT_OGF_STATUS 0x05 +#define BT_OGF_LE 0x08 +#define BT_OGF_VS 0x3f + +/* Construct OpCode from OGF and OCF */ +#define BT_OP(ogf, ocf) ((ocf) | ((ogf) << 10)) + +/* Invalid opcode */ +#define BT_OP_NOP 0x0000 + +/* Obtain OGF from OpCode */ +#define BT_OGF(opcode) (((opcode) >> 10) & BIT_MASK(6)) +/* Obtain OCF from OpCode */ +#define BT_OCF(opcode) ((opcode) & BIT_MASK(10)) + +#define BT_HCI_OP_INQUIRY BT_OP(BT_OGF_LINK_CTRL, 0x0001) +struct bt_hci_op_inquiry { + uint8_t lap[3]; + uint8_t length; + uint8_t num_rsp; +} __packed; + +#define BT_HCI_OP_INQUIRY_CANCEL BT_OP(BT_OGF_LINK_CTRL, 0x0002) + +#define BT_HCI_OP_CONNECT BT_OP(BT_OGF_LINK_CTRL, 0x0005) +struct bt_hci_cp_connect { + bt_addr_t bdaddr; + uint16_t packet_type; + uint8_t pscan_rep_mode; + uint8_t reserved; + uint16_t clock_offset; + uint8_t allow_role_switch; +} __packed; + +#define BT_HCI_OP_DISCONNECT BT_OP(BT_OGF_LINK_CTRL, 0x0006) +struct bt_hci_cp_disconnect { + uint16_t handle; + uint8_t reason; +} __packed; + +#define BT_HCI_OP_CONNECT_CANCEL BT_OP(BT_OGF_LINK_CTRL, 0x0008) +struct bt_hci_cp_connect_cancel { + bt_addr_t bdaddr; +} __packed; +struct bt_hci_rp_connect_cancel { + uint8_t status; + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_OP_ACCEPT_CONN_REQ BT_OP(BT_OGF_LINK_CTRL, 0x0009) +struct bt_hci_cp_accept_conn_req { + bt_addr_t bdaddr; + uint8_t role; +} __packed; + +#define BT_HCI_OP_SETUP_SYNC_CONN BT_OP(BT_OGF_LINK_CTRL, 0x0028) +struct bt_hci_cp_setup_sync_conn { + uint16_t handle; + uint32_t tx_bandwidth; + uint32_t rx_bandwidth; + uint16_t max_latency; + uint16_t content_format; + uint8_t retrans_effort; + uint16_t pkt_type; +} __packed; + +#define BT_HCI_OP_ACCEPT_SYNC_CONN_REQ BT_OP(BT_OGF_LINK_CTRL, 0x0029) +struct bt_hci_cp_accept_sync_conn_req { + bt_addr_t bdaddr; + uint32_t tx_bandwidth; + uint32_t rx_bandwidth; + uint16_t max_latency; + uint16_t content_format; + uint8_t retrans_effort; + uint16_t pkt_type; +} __packed; + +#define BT_HCI_OP_REJECT_CONN_REQ BT_OP(BT_OGF_LINK_CTRL, 0x000a) +struct bt_hci_cp_reject_conn_req { + bt_addr_t bdaddr; + uint8_t reason; +} __packed; + +#define BT_HCI_OP_LINK_KEY_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x000b) +struct bt_hci_cp_link_key_reply { + bt_addr_t bdaddr; + uint8_t link_key[16]; +} __packed; + +#define BT_HCI_OP_LINK_KEY_NEG_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x000c) +struct bt_hci_cp_link_key_neg_reply { + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_OP_PIN_CODE_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x000d) +struct bt_hci_cp_pin_code_reply { + bt_addr_t bdaddr; + uint8_t pin_len; + uint8_t pin_code[16]; +} __packed; +struct bt_hci_rp_pin_code_reply { + uint8_t status; + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_OP_PIN_CODE_NEG_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x000e) +struct bt_hci_cp_pin_code_neg_reply { + bt_addr_t bdaddr; +} __packed; +struct bt_hci_rp_pin_code_neg_reply { + uint8_t status; + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_OP_AUTH_REQUESTED BT_OP(BT_OGF_LINK_CTRL, 0x0011) +struct bt_hci_cp_auth_requested { + uint16_t handle; +} __packed; + +#define BT_HCI_OP_SET_CONN_ENCRYPT BT_OP(BT_OGF_LINK_CTRL, 0x0013) +struct bt_hci_cp_set_conn_encrypt { + uint16_t handle; + uint8_t encrypt; +} __packed; + +#define BT_HCI_OP_REMOTE_NAME_REQUEST BT_OP(BT_OGF_LINK_CTRL, 0x0019) +struct bt_hci_cp_remote_name_request { + bt_addr_t bdaddr; + uint8_t pscan_rep_mode; + uint8_t reserved; + uint16_t clock_offset; +} __packed; + +#define BT_HCI_OP_REMOTE_NAME_CANCEL BT_OP(BT_OGF_LINK_CTRL, 0x001a) +struct bt_hci_cp_remote_name_cancel { + bt_addr_t bdaddr; +} __packed; +struct bt_hci_rp_remote_name_cancel { + uint8_t status; + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_OP_READ_REMOTE_FEATURES BT_OP(BT_OGF_LINK_CTRL, 0x001b) +struct bt_hci_cp_read_remote_features { + uint16_t handle; +} __packed; + +#define BT_HCI_OP_READ_REMOTE_EXT_FEATURES BT_OP(BT_OGF_LINK_CTRL, 0x001c) +struct bt_hci_cp_read_remote_ext_features { + uint16_t handle; + uint8_t page; +} __packed; + +#define BT_HCI_OP_READ_REMOTE_VERSION_INFO BT_OP(BT_OGF_LINK_CTRL, 0x001d) +struct bt_hci_cp_read_remote_version_info { + uint16_t handle; +} __packed; + +#define BT_HCI_OP_IO_CAPABILITY_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x002b) +struct bt_hci_cp_io_capability_reply { + bt_addr_t bdaddr; + uint8_t capability; + uint8_t oob_data; + uint8_t authentication; +} __packed; + +#define BT_HCI_OP_USER_CONFIRM_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x002c) +#define BT_HCI_OP_USER_CONFIRM_NEG_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x002d) +struct bt_hci_cp_user_confirm_reply { + bt_addr_t bdaddr; +} __packed; +struct bt_hci_rp_user_confirm_reply { + uint8_t status; + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_OP_USER_PASSKEY_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x002e) +struct bt_hci_cp_user_passkey_reply { + bt_addr_t bdaddr; + uint32_t passkey; +} __packed; + +#define BT_HCI_OP_USER_PASSKEY_NEG_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x002f) +struct bt_hci_cp_user_passkey_neg_reply { + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_OP_IO_CAPABILITY_NEG_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x0034) +struct bt_hci_cp_io_capability_neg_reply { + bt_addr_t bdaddr; + uint8_t reason; +} __packed; + +#define BT_HCI_OP_SET_EVENT_MASK BT_OP(BT_OGF_BASEBAND, 0x0001) +struct bt_hci_cp_set_event_mask { + uint8_t events[8]; +} __packed; + +#define BT_HCI_OP_RESET BT_OP(BT_OGF_BASEBAND, 0x0003) + +#define BT_HCI_OP_WRITE_LOCAL_NAME BT_OP(BT_OGF_BASEBAND, 0x0013) +struct bt_hci_write_local_name { + uint8_t local_name[248]; +} __packed; + +#define BT_HCI_OP_WRITE_PAGE_TIMEOUT BT_OP(BT_OGF_BASEBAND, 0x0018) + +#define BT_HCI_OP_WRITE_SCAN_ENABLE BT_OP(BT_OGF_BASEBAND, 0x001a) +#define BT_BREDR_SCAN_DISABLED 0x00 +#define BT_BREDR_SCAN_INQUIRY 0x01 +#define BT_BREDR_SCAN_PAGE 0x02 + +#define BT_TX_POWER_LEVEL_CURRENT 0x00 +#define BT_TX_POWER_LEVEL_MAX 0x01 +#define BT_HCI_OP_READ_TX_POWER_LEVEL BT_OP(BT_OGF_BASEBAND, 0x002d) +struct bt_hci_cp_read_tx_power_level { + uint16_t handle; + uint8_t type; +} __packed; + +struct bt_hci_rp_read_tx_power_level { + uint8_t status; + uint16_t handle; + int8_t tx_power_level; +} __packed; + +#define BT_HCI_CTL_TO_HOST_FLOW_DISABLE 0x00 +#define BT_HCI_CTL_TO_HOST_FLOW_ENABLE 0x01 +#define BT_HCI_OP_SET_CTL_TO_HOST_FLOW BT_OP(BT_OGF_BASEBAND, 0x0031) +struct bt_hci_cp_set_ctl_to_host_flow { + uint8_t flow_enable; +} __packed; + +#define BT_HCI_OP_HOST_BUFFER_SIZE BT_OP(BT_OGF_BASEBAND, 0x0033) +struct bt_hci_cp_host_buffer_size { + uint16_t acl_mtu; + uint8_t sco_mtu; + uint16_t acl_pkts; + uint16_t sco_pkts; +} __packed; + +struct bt_hci_handle_count { + uint16_t handle; + uint16_t count; +} __packed; + +#define BT_HCI_OP_HOST_NUM_COMPLETED_PACKETS BT_OP(BT_OGF_BASEBAND, 0x0035) +struct bt_hci_cp_host_num_completed_packets { + uint8_t num_handles; + struct bt_hci_handle_count h[0]; +} __packed; + +#define BT_HCI_OP_WRITE_INQUIRY_MODE BT_OP(BT_OGF_BASEBAND, 0x0045) +struct bt_hci_cp_write_inquiry_mode { + uint8_t mode; +} __packed; + +#define BT_HCI_OP_WRITE_SSP_MODE BT_OP(BT_OGF_BASEBAND, 0x0056) +struct bt_hci_cp_write_ssp_mode { + uint8_t mode; +} __packed; + +#define BT_HCI_OP_SET_EVENT_MASK_PAGE_2 BT_OP(BT_OGF_BASEBAND, 0x0063) +struct bt_hci_cp_set_event_mask_page_2 { + uint8_t events_page_2[8]; +} __packed; + +#define BT_HCI_OP_LE_WRITE_LE_HOST_SUPP BT_OP(BT_OGF_BASEBAND, 0x006d) +struct bt_hci_cp_write_le_host_supp { + uint8_t le; + uint8_t simul; +} __packed; + +#define BT_HCI_OP_WRITE_SC_HOST_SUPP BT_OP(BT_OGF_BASEBAND, 0x007a) +struct bt_hci_cp_write_sc_host_supp { + uint8_t sc_support; +} __packed; + +#define BT_HCI_OP_READ_AUTH_PAYLOAD_TIMEOUT BT_OP(BT_OGF_BASEBAND, 0x007b) +struct bt_hci_cp_read_auth_payload_timeout { + uint16_t handle; +} __packed; + +struct bt_hci_rp_read_auth_payload_timeout { + uint8_t status; + uint16_t handle; + uint16_t auth_payload_timeout; +} __packed; + +#define BT_HCI_OP_WRITE_AUTH_PAYLOAD_TIMEOUT BT_OP(BT_OGF_BASEBAND, 0x007c) +struct bt_hci_cp_write_auth_payload_timeout { + uint16_t handle; + uint16_t auth_payload_timeout; +} __packed; + +struct bt_hci_rp_write_auth_payload_timeout { + uint8_t status; + uint16_t handle; +} __packed; + +/* HCI version from Assigned Numbers */ +#define BT_HCI_VERSION_1_0B 0 +#define BT_HCI_VERSION_1_1 1 +#define BT_HCI_VERSION_1_2 2 +#define BT_HCI_VERSION_2_0 3 +#define BT_HCI_VERSION_2_1 4 +#define BT_HCI_VERSION_3_0 5 +#define BT_HCI_VERSION_4_0 6 +#define BT_HCI_VERSION_4_1 7 +#define BT_HCI_VERSION_4_2 8 +#define BT_HCI_VERSION_5_0 9 +#define BT_HCI_VERSION_5_1 10 +#define BT_HCI_VERSION_5_2 11 + +#define BT_HCI_OP_READ_LOCAL_VERSION_INFO BT_OP(BT_OGF_INFO, 0x0001) +struct bt_hci_rp_read_local_version_info { + uint8_t status; + uint8_t hci_version; + uint16_t hci_revision; + uint8_t lmp_version; + uint16_t manufacturer; + uint16_t lmp_subversion; +} __packed; + +#define BT_HCI_OP_READ_SUPPORTED_COMMANDS BT_OP(BT_OGF_INFO, 0x0002) +struct bt_hci_rp_read_supported_commands { + uint8_t status; + uint8_t commands[64]; +} __packed; + +#define BT_HCI_OP_READ_LOCAL_EXT_FEATURES BT_OP(BT_OGF_INFO, 0x0004) +struct bt_hci_cp_read_local_ext_features { + uint8_t page; +}; +struct bt_hci_rp_read_local_ext_features { + uint8_t status; + uint8_t page; + uint8_t max_page; + uint8_t ext_features[8]; +} __packed; + +#define BT_HCI_OP_READ_LOCAL_FEATURES BT_OP(BT_OGF_INFO, 0x0003) +struct bt_hci_rp_read_local_features { + uint8_t status; + uint8_t features[8]; +} __packed; + +#define BT_HCI_OP_READ_BUFFER_SIZE BT_OP(BT_OGF_INFO, 0x0005) +struct bt_hci_rp_read_buffer_size { + uint8_t status; + uint16_t acl_max_len; + uint8_t sco_max_len; + uint16_t acl_max_num; + uint16_t sco_max_num; +} __packed; + +#define BT_HCI_OP_READ_BD_ADDR BT_OP(BT_OGF_INFO, 0x0009) +struct bt_hci_rp_read_bd_addr { + uint8_t status; + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_OP_READ_RSSI BT_OP(BT_OGF_STATUS, 0x0005) +struct bt_hci_cp_read_rssi { + uint16_t handle; +} __packed; +struct bt_hci_rp_read_rssi { + uint8_t status; + uint16_t handle; + int8_t rssi; +} __packed; + +#define BT_HCI_ENCRYPTION_KEY_SIZE_MIN 7 +#define BT_HCI_ENCRYPTION_KEY_SIZE_MAX 16 + +#define BT_HCI_OP_READ_ENCRYPTION_KEY_SIZE BT_OP(BT_OGF_STATUS, 0x0008) +struct bt_hci_cp_read_encryption_key_size { + uint16_t handle; +} __packed; +struct bt_hci_rp_read_encryption_key_size { + uint8_t status; + uint16_t handle; + uint8_t key_size; +} __packed; + +/* BLE */ + +#define BT_HCI_OP_LE_SET_EVENT_MASK BT_OP(BT_OGF_LE, 0x0001) +struct bt_hci_cp_le_set_event_mask { + uint8_t events[8]; +} __packed; + +#define BT_HCI_OP_LE_READ_BUFFER_SIZE BT_OP(BT_OGF_LE, 0x0002) +struct bt_hci_rp_le_read_buffer_size { + uint8_t status; + uint16_t le_max_len; + uint8_t le_max_num; +} __packed; + +#define BT_HCI_OP_LE_READ_LOCAL_FEATURES BT_OP(BT_OGF_LE, 0x0003) +struct bt_hci_rp_le_read_local_features { + uint8_t status; + uint8_t features[8]; +} __packed; + +#define BT_HCI_OP_LE_SET_RANDOM_ADDRESS BT_OP(BT_OGF_LE, 0x0005) +struct bt_hci_cp_le_set_random_address { + bt_addr_t bdaddr; +} __packed; + +/* LE Advertising Types (LE Advertising Parameters Set)*/ +#define BT_LE_ADV_IND (__DEPRECATED_MACRO 0x00) +#define BT_LE_ADV_DIRECT_IND (__DEPRECATED_MACRO 0x01) +#define BT_LE_ADV_SCAN_IND (__DEPRECATED_MACRO 0x02) +#define BT_LE_ADV_NONCONN_IND (__DEPRECATED_MACRO 0x03) +#define BT_LE_ADV_DIRECT_IND_LOW_DUTY (__DEPRECATED_MACRO 0x04) +/* LE Advertising PDU Types. */ +#define BT_LE_ADV_SCAN_RSP (__DEPRECATED_MACRO 0x04) + +#define BT_HCI_ADV_IND 0x00 +#define BT_HCI_ADV_DIRECT_IND 0x01 +#define BT_HCI_ADV_SCAN_IND 0x02 +#define BT_HCI_ADV_NONCONN_IND 0x03 +#define BT_HCI_ADV_DIRECT_IND_LOW_DUTY 0x04 +#define BT_HCI_ADV_SCAN_RSP 0x04 + +#define BT_LE_ADV_FP_NO_WHITELIST 0x00 +#define BT_LE_ADV_FP_WHITELIST_SCAN_REQ 0x01 +#define BT_LE_ADV_FP_WHITELIST_CONN_IND 0x02 +#define BT_LE_ADV_FP_WHITELIST_BOTH 0x03 + +#define BT_HCI_OP_LE_SET_ADV_PARAM BT_OP(BT_OGF_LE, 0x0006) +struct bt_hci_cp_le_set_adv_param { + uint16_t min_interval; + uint16_t max_interval; + uint8_t type; + uint8_t own_addr_type; + bt_addr_le_t direct_addr; + uint8_t channel_map; + uint8_t filter_policy; +} __packed; + +#define BT_HCI_OP_LE_READ_ADV_CHAN_TX_POWER BT_OP(BT_OGF_LE, 0x0007) +struct bt_hci_rp_le_read_chan_tx_power { + uint8_t status; + int8_t tx_power_level; +} __packed; + +#define BT_HCI_OP_LE_SET_ADV_DATA BT_OP(BT_OGF_LE, 0x0008) +struct bt_hci_cp_le_set_adv_data { + uint8_t len; + uint8_t data[31]; +} __packed; + +#define BT_HCI_OP_LE_SET_SCAN_RSP_DATA BT_OP(BT_OGF_LE, 0x0009) +struct bt_hci_cp_le_set_scan_rsp_data { + uint8_t len; + uint8_t data[31]; +} __packed; + +#define BT_HCI_LE_ADV_DISABLE 0x00 +#define BT_HCI_LE_ADV_ENABLE 0x01 + +#define BT_HCI_OP_LE_SET_ADV_ENABLE BT_OP(BT_OGF_LE, 0x000a) +struct bt_hci_cp_le_set_adv_enable { + uint8_t enable; +} __packed; + +/* Scan types */ +#define BT_HCI_OP_LE_SET_SCAN_PARAM BT_OP(BT_OGF_LE, 0x000b) +#define BT_HCI_LE_SCAN_PASSIVE 0x00 +#define BT_HCI_LE_SCAN_ACTIVE 0x01 + +#define BT_HCI_LE_SCAN_FP_NO_WHITELIST 0x00 +#define BT_HCI_LE_SCAN_FP_USE_WHITELIST 0x01 + +struct bt_hci_cp_le_set_scan_param { + uint8_t scan_type; + uint16_t interval; + uint16_t window; + uint8_t addr_type; + uint8_t filter_policy; +} __packed; + +#define BT_HCI_OP_LE_SET_SCAN_ENABLE BT_OP(BT_OGF_LE, 0x000c) + +#define BT_HCI_LE_SCAN_DISABLE 0x00 +#define BT_HCI_LE_SCAN_ENABLE 0x01 + +#define BT_HCI_LE_SCAN_FILTER_DUP_DISABLE 0x00 +#define BT_HCI_LE_SCAN_FILTER_DUP_ENABLE 0x01 + +struct bt_hci_cp_le_set_scan_enable { + uint8_t enable; + uint8_t filter_dup; +} __packed; + +#define BT_HCI_OP_LE_CREATE_CONN BT_OP(BT_OGF_LE, 0x000d) + +#define BT_HCI_LE_CREATE_CONN_FP_DIRECT 0x00 +#define BT_HCI_LE_CREATE_CONN_FP_WHITELIST 0x01 + +struct bt_hci_cp_le_create_conn { + uint16_t scan_interval; + uint16_t scan_window; + uint8_t filter_policy; + bt_addr_le_t peer_addr; + uint8_t own_addr_type; + uint16_t conn_interval_min; + uint16_t conn_interval_max; + uint16_t conn_latency; + uint16_t supervision_timeout; + uint16_t min_ce_len; + uint16_t max_ce_len; +} __packed; + +#define BT_HCI_OP_LE_CREATE_CONN_CANCEL BT_OP(BT_OGF_LE, 0x000e) + +#define BT_HCI_OP_LE_READ_WL_SIZE BT_OP(BT_OGF_LE, 0x000f) +struct bt_hci_rp_le_read_wl_size { + uint8_t status; + uint8_t wl_size; +} __packed; + +#define BT_HCI_OP_LE_CLEAR_WL BT_OP(BT_OGF_LE, 0x0010) + +#define BT_HCI_OP_LE_ADD_DEV_TO_WL BT_OP(BT_OGF_LE, 0x0011) +struct bt_hci_cp_le_add_dev_to_wl { + bt_addr_le_t addr; +} __packed; + +#define BT_HCI_OP_LE_REM_DEV_FROM_WL BT_OP(BT_OGF_LE, 0x0012) +struct bt_hci_cp_le_rem_dev_from_wl { + bt_addr_le_t addr; +} __packed; + +#define BT_HCI_OP_LE_CONN_UPDATE BT_OP(BT_OGF_LE, 0x0013) +struct hci_cp_le_conn_update { + uint16_t handle; + uint16_t conn_interval_min; + uint16_t conn_interval_max; + uint16_t conn_latency; + uint16_t supervision_timeout; + uint16_t min_ce_len; + uint16_t max_ce_len; +} __packed; + +#define BT_HCI_OP_LE_SET_HOST_CHAN_CLASSIF BT_OP(BT_OGF_LE, 0x0014) +struct bt_hci_cp_le_set_host_chan_classif { + uint8_t ch_map[5]; +} __packed; + +#define BT_HCI_OP_LE_READ_CHAN_MAP BT_OP(BT_OGF_LE, 0x0015) +struct bt_hci_cp_le_read_chan_map { + uint16_t handle; +} __packed; +struct bt_hci_rp_le_read_chan_map { + uint8_t status; + uint16_t handle; + uint8_t ch_map[5]; +} __packed; + +#define BT_HCI_OP_LE_READ_REMOTE_FEATURES BT_OP(BT_OGF_LE, 0x0016) +struct bt_hci_cp_le_read_remote_features { + uint16_t handle; +} __packed; + +#define BT_HCI_OP_LE_ENCRYPT BT_OP(BT_OGF_LE, 0x0017) +struct bt_hci_cp_le_encrypt { + uint8_t key[16]; + uint8_t plaintext[16]; +} __packed; +struct bt_hci_rp_le_encrypt { + uint8_t status; + uint8_t enc_data[16]; +} __packed; + +#define BT_HCI_OP_LE_RAND BT_OP(BT_OGF_LE, 0x0018) +struct bt_hci_rp_le_rand { + uint8_t status; + uint8_t rand[8]; +} __packed; + +#define BT_HCI_OP_LE_START_ENCRYPTION BT_OP(BT_OGF_LE, 0x0019) +struct bt_hci_cp_le_start_encryption { + uint16_t handle; + uint64_t rand; + uint16_t ediv; + uint8_t ltk[16]; +} __packed; + +#define BT_HCI_OP_LE_LTK_REQ_REPLY BT_OP(BT_OGF_LE, 0x001a) +struct bt_hci_cp_le_ltk_req_reply { + uint16_t handle; + uint8_t ltk[16]; +} __packed; +struct bt_hci_rp_le_ltk_req_reply { + uint8_t status; + uint16_t handle; +} __packed; + +#define BT_HCI_OP_LE_LTK_REQ_NEG_REPLY BT_OP(BT_OGF_LE, 0x001b) +struct bt_hci_cp_le_ltk_req_neg_reply { + uint16_t handle; +} __packed; +struct bt_hci_rp_le_ltk_req_neg_reply { + uint8_t status; + uint16_t handle; +} __packed; + +#define BT_HCI_OP_LE_READ_SUPP_STATES BT_OP(BT_OGF_LE, 0x001c) +struct bt_hci_rp_le_read_supp_states { + uint8_t status; + uint8_t le_states[8]; +} __packed; + +#define BT_HCI_OP_LE_RX_TEST BT_OP(BT_OGF_LE, 0x001d) +struct bt_hci_cp_le_rx_test { + uint8_t rx_ch; +} __packed; + +#define BT_HCI_OP_LE_TX_TEST BT_OP(BT_OGF_LE, 0x001e) +struct bt_hci_cp_le_tx_test { + uint8_t tx_ch; + uint8_t test_data_len; + uint8_t pkt_payload; +} __packed; + +#define BT_HCI_OP_LE_TEST_END BT_OP(BT_OGF_LE, 0x001f) +struct bt_hci_rp_le_test_end { + uint8_t status; + uint16_t rx_pkt_count; +} __packed; + +#define BT_HCI_OP_LE_CONN_PARAM_REQ_REPLY BT_OP(BT_OGF_LE, 0x0020) +struct bt_hci_cp_le_conn_param_req_reply { + uint16_t handle; + uint16_t interval_min; + uint16_t interval_max; + uint16_t latency; + uint16_t timeout; + uint16_t min_ce_len; + uint16_t max_ce_len; +} __packed; +struct bt_hci_rp_le_conn_param_req_reply { + uint8_t status; + uint16_t handle; +} __packed; + +#define BT_HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY BT_OP(BT_OGF_LE, 0x0021) +struct bt_hci_cp_le_conn_param_req_neg_reply { + uint16_t handle; + uint8_t reason; +} __packed; +struct bt_hci_rp_le_conn_param_req_neg_reply { + uint8_t status; + uint16_t handle; +} __packed; + +#define BT_HCI_OP_LE_SET_DATA_LEN BT_OP(BT_OGF_LE, 0x0022) +struct bt_hci_cp_le_set_data_len { + uint16_t handle; + uint16_t tx_octets; + uint16_t tx_time; +} __packed; +struct bt_hci_rp_le_set_data_len { + uint8_t status; + uint16_t handle; +} __packed; + +#define BT_HCI_OP_LE_READ_DEFAULT_DATA_LEN BT_OP(BT_OGF_LE, 0x0023) +struct bt_hci_rp_le_read_default_data_len { + uint8_t status; + uint16_t max_tx_octets; + uint16_t max_tx_time; +} __packed; + +#define BT_HCI_OP_LE_WRITE_DEFAULT_DATA_LEN BT_OP(BT_OGF_LE, 0x0024) +struct bt_hci_cp_le_write_default_data_len { + uint16_t max_tx_octets; + uint16_t max_tx_time; +} __packed; + +#define BT_HCI_OP_LE_P256_PUBLIC_KEY BT_OP(BT_OGF_LE, 0x0025) + +#define BT_HCI_OP_LE_GENERATE_DHKEY BT_OP(BT_OGF_LE, 0x0026) +struct bt_hci_cp_le_generate_dhkey { + uint8_t key[64]; +} __packed; + +#define BT_HCI_OP_LE_ADD_DEV_TO_RL BT_OP(BT_OGF_LE, 0x0027) +struct bt_hci_cp_le_add_dev_to_rl { + bt_addr_le_t peer_id_addr; + uint8_t peer_irk[16]; + uint8_t local_irk[16]; +} __packed; + +#define BT_HCI_OP_LE_REM_DEV_FROM_RL BT_OP(BT_OGF_LE, 0x0028) +struct bt_hci_cp_le_rem_dev_from_rl { + bt_addr_le_t peer_id_addr; +} __packed; + +#define BT_HCI_OP_LE_CLEAR_RL BT_OP(BT_OGF_LE, 0x0029) + +#define BT_HCI_OP_LE_READ_RL_SIZE BT_OP(BT_OGF_LE, 0x002a) +struct bt_hci_rp_le_read_rl_size { + uint8_t status; + uint8_t rl_size; +} __packed; + +#define BT_HCI_OP_LE_READ_PEER_RPA BT_OP(BT_OGF_LE, 0x002b) +struct bt_hci_cp_le_read_peer_rpa { + bt_addr_le_t peer_id_addr; +} __packed; +struct bt_hci_rp_le_read_peer_rpa { + uint8_t status; + bt_addr_t peer_rpa; +} __packed; + +#define BT_HCI_OP_LE_READ_LOCAL_RPA BT_OP(BT_OGF_LE, 0x002c) +struct bt_hci_cp_le_read_local_rpa { + bt_addr_le_t peer_id_addr; +} __packed; +struct bt_hci_rp_le_read_local_rpa { + uint8_t status; + bt_addr_t local_rpa; +} __packed; + +#define BT_HCI_ADDR_RES_DISABLE 0x00 +#define BT_HCI_ADDR_RES_ENABLE 0x01 + +#define BT_HCI_OP_LE_SET_ADDR_RES_ENABLE BT_OP(BT_OGF_LE, 0x002d) +struct bt_hci_cp_le_set_addr_res_enable { + uint8_t enable; +} __packed; + +#define BT_HCI_OP_LE_SET_RPA_TIMEOUT BT_OP(BT_OGF_LE, 0x002e) +struct bt_hci_cp_le_set_rpa_timeout { + uint16_t rpa_timeout; +} __packed; + +#define BT_HCI_OP_LE_READ_MAX_DATA_LEN BT_OP(BT_OGF_LE, 0x002f) +struct bt_hci_rp_le_read_max_data_len { + uint8_t status; + uint16_t max_tx_octets; + uint16_t max_tx_time; + uint16_t max_rx_octets; + uint16_t max_rx_time; +} __packed; + +#define BT_HCI_LE_PHY_1M 0x01 +#define BT_HCI_LE_PHY_2M 0x02 +#define BT_HCI_LE_PHY_CODED 0x03 + +#define BT_HCI_OP_LE_READ_PHY BT_OP(BT_OGF_LE, 0x0030) +struct bt_hci_cp_le_read_phy { + uint16_t handle; +} __packed; +struct bt_hci_rp_le_read_phy { + uint8_t status; + uint16_t handle; + uint8_t tx_phy; + uint8_t rx_phy; +} __packed; + +#define BT_HCI_LE_PHY_TX_ANY BIT(0) +#define BT_HCI_LE_PHY_RX_ANY BIT(1) + +#define BT_HCI_LE_PHY_PREFER_1M BIT(0) +#define BT_HCI_LE_PHY_PREFER_2M BIT(1) +#define BT_HCI_LE_PHY_PREFER_CODED BIT(2) + +#define BT_HCI_OP_LE_SET_DEFAULT_PHY BT_OP(BT_OGF_LE, 0x0031) +struct bt_hci_cp_le_set_default_phy { + uint8_t all_phys; + uint8_t tx_phys; + uint8_t rx_phys; +} __packed; + +#define BT_HCI_LE_PHY_CODED_ANY 0x00 +#define BT_HCI_LE_PHY_CODED_S2 0x01 +#define BT_HCI_LE_PHY_CODED_S8 0x02 + +#define BT_HCI_OP_LE_SET_PHY BT_OP(BT_OGF_LE, 0x0032) +struct bt_hci_cp_le_set_phy { + uint16_t handle; + uint8_t all_phys; + uint8_t tx_phys; + uint8_t rx_phys; + uint16_t phy_opts; +} __packed; + +#define BT_HCI_LE_MOD_INDEX_STANDARD 0x00 +#define BT_HCI_LE_MOD_INDEX_STABLE 0x01 + +#define BT_HCI_OP_LE_ENH_RX_TEST BT_OP(BT_OGF_LE, 0x0033) +struct bt_hci_cp_le_enh_rx_test { + uint8_t rx_ch; + uint8_t phy; + uint8_t mod_index; +} __packed; + +/* Extends BT_HCI_LE_PHY */ +#define BT_HCI_LE_TX_PHY_CODED_S8 0x03 +#define BT_HCI_LE_TX_PHY_CODED_S2 0x04 + +#define BT_HCI_OP_LE_ENH_TX_TEST BT_OP(BT_OGF_LE, 0x0034) +struct bt_hci_cp_le_enh_tx_test { + uint8_t tx_ch; + uint8_t test_data_len; + uint8_t pkt_payload; + uint8_t phy; +} __packed; + +#define BT_HCI_OP_LE_SET_ADV_SET_RANDOM_ADDR BT_OP(BT_OGF_LE, 0x0035) +struct bt_hci_cp_le_set_adv_set_random_addr { + uint8_t handle; + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_LE_ADV_PROP_CONN BIT(0) +#define BT_HCI_LE_ADV_PROP_SCAN BIT(1) +#define BT_HCI_LE_ADV_PROP_DIRECT BIT(2) +#define BT_HCI_LE_ADV_PROP_HI_DC_CONN BIT(3) +#define BT_HCI_LE_ADV_PROP_LEGACY BIT(4) +#define BT_HCI_LE_ADV_PROP_ANON BIT(5) +#define BT_HCI_LE_ADV_PROP_TX_POWER BIT(6) + +#define BT_HCI_LE_ADV_SCAN_REQ_ENABLE 1 +#define BT_HCI_LE_ADV_SCAN_REQ_DISABLE 0 + +#define BT_HCI_LE_ADV_TX_POWER_NO_PREF 0x7F + +#define BT_HCI_OP_LE_SET_EXT_ADV_PARAM BT_OP(BT_OGF_LE, 0x0036) +struct bt_hci_cp_le_set_ext_adv_param { + uint8_t handle; + uint16_t props; + uint8_t prim_min_interval[3]; + uint8_t prim_max_interval[3]; + uint8_t prim_channel_map; + uint8_t own_addr_type; + bt_addr_le_t peer_addr; + uint8_t filter_policy; + int8_t tx_power; + uint8_t prim_adv_phy; + uint8_t sec_adv_max_skip; + uint8_t sec_adv_phy; + uint8_t sid; + uint8_t scan_req_notify_enable; +} __packed; +struct bt_hci_rp_le_set_ext_adv_param { + uint8_t status; + int8_t tx_power; +} __packed; + +#define BT_HCI_LE_EXT_ADV_OP_INTERM_FRAG 0x00 +#define BT_HCI_LE_EXT_ADV_OP_FIRST_FRAG 0x01 +#define BT_HCI_LE_EXT_ADV_OP_LAST_FRAG 0x02 +#define BT_HCI_LE_EXT_ADV_OP_COMPLETE_DATA 0x03 +#define BT_HCI_LE_EXT_ADV_OP_UNCHANGED_DATA 0x04 + +#define BT_HCI_LE_EXT_ADV_FRAG_ENABLED 0x00 +#define BT_HCI_LE_EXT_ADV_FRAG_DISABLED 0x01 + +#define BT_HCI_LE_EXT_ADV_FRAG_MAX_LEN 251 + +#define BT_HCI_OP_LE_SET_EXT_ADV_DATA BT_OP(BT_OGF_LE, 0x0037) +struct bt_hci_cp_le_set_ext_adv_data { + uint8_t handle; + uint8_t op; + uint8_t frag_pref; + uint8_t len; + uint8_t data[251]; +} __packed; + +#define BT_HCI_OP_LE_SET_EXT_SCAN_RSP_DATA BT_OP(BT_OGF_LE, 0x0038) +struct bt_hci_cp_le_set_ext_scan_rsp_data { + uint8_t handle; + uint8_t op; + uint8_t frag_pref; + uint8_t len; + uint8_t data[251]; +} __packed; + +#define BT_HCI_OP_LE_SET_EXT_ADV_ENABLE BT_OP(BT_OGF_LE, 0x0039) +struct bt_hci_ext_adv_set { + uint8_t handle; + uint16_t duration; + uint8_t max_ext_adv_evts; +} __packed; + +struct bt_hci_cp_le_set_ext_adv_enable { + uint8_t enable; + uint8_t set_num; + struct bt_hci_ext_adv_set s[0]; +} __packed; + +#define BT_HCI_OP_LE_READ_MAX_ADV_DATA_LEN BT_OP(BT_OGF_LE, 0x003a) +struct bt_hci_rp_le_read_max_adv_data_len { + uint8_t status; + uint16_t max_adv_data_len; +} __packed; + +#define BT_HCI_OP_LE_READ_NUM_ADV_SETS BT_OP(BT_OGF_LE, 0x003b) +struct bt_hci_rp_le_read_num_adv_sets { + uint8_t status; + uint8_t num_sets; +} __packed; + +#define BT_HCI_OP_LE_REMOVE_ADV_SET BT_OP(BT_OGF_LE, 0x003c) +struct bt_hci_cp_le_remove_adv_set { + uint8_t handle; +} __packed; + +#define BT_HCI_OP_CLEAR_ADV_SETS BT_OP(BT_OGF_LE, 0x003d) + +#define BT_HCI_OP_LE_SET_PER_ADV_PARAM BT_OP(BT_OGF_LE, 0x003e) +struct bt_hci_cp_le_set_per_adv_param { + uint8_t handle; + uint16_t min_interval; + uint16_t max_interval; + uint16_t props; +} __packed; + +#define BT_HCI_OP_LE_SET_PER_ADV_DATA BT_OP(BT_OGF_LE, 0x003f) +struct bt_hci_cp_le_set_per_adv_data { + uint8_t handle; + uint8_t op; + uint8_t len; + uint8_t data[251]; +} __packed; + +#define BT_HCI_OP_LE_SET_PER_ADV_ENABLE BT_OP(BT_OGF_LE, 0x0040) +struct bt_hci_cp_le_set_per_adv_enable { + uint8_t enable; + uint8_t handle; +} __packed; + +#define BT_HCI_OP_LE_SET_EXT_SCAN_PARAM BT_OP(BT_OGF_LE, 0x0041) +struct bt_hci_ext_scan_phy { + uint8_t type; + uint16_t interval; + uint16_t window; +} __packed; + +#define BT_HCI_LE_EXT_SCAN_PHY_1M BIT(0) +#define BT_HCI_LE_EXT_SCAN_PHY_2M BIT(1) +#define BT_HCI_LE_EXT_SCAN_PHY_CODED BIT(2) + +struct bt_hci_cp_le_set_ext_scan_param { + uint8_t own_addr_type; + uint8_t filter_policy; + uint8_t phys; + struct bt_hci_ext_scan_phy p[0]; +} __packed; + +/* Extends BT_HCI_LE_SCAN_FILTER_DUP */ +#define BT_HCI_LE_EXT_SCAN_FILTER_DUP_ENABLE_RESET 0x02 + +#define BT_HCI_OP_LE_SET_EXT_SCAN_ENABLE BT_OP(BT_OGF_LE, 0x0042) +struct bt_hci_cp_le_set_ext_scan_enable { + uint8_t enable; + uint8_t filter_dup; + uint16_t duration; + uint16_t period; +} __packed; + +#define BT_HCI_OP_LE_EXT_CREATE_CONN BT_OP(BT_OGF_LE, 0x0043) +struct bt_hci_ext_conn_phy { + uint16_t scan_interval; + uint16_t scan_window; + uint16_t conn_interval_min; + uint16_t conn_interval_max; + uint16_t conn_latency; + uint16_t supervision_timeout; + uint16_t min_ce_len; + uint16_t max_ce_len; +} __packed; + +struct bt_hci_cp_le_ext_create_conn { + uint8_t filter_policy; + uint8_t own_addr_type; + bt_addr_le_t peer_addr; + uint8_t phys; + struct bt_hci_ext_conn_phy p[0]; +} __packed; + +#define BT_HCI_OP_LE_PER_ADV_CREATE_SYNC BT_OP(BT_OGF_LE, 0x0044) +struct bt_hci_cp_le_per_adv_create_sync { + uint8_t filter_policy; + uint8_t sid; + bt_addr_le_t addr; + uint16_t skip; + uint16_t sync_timeout; + uint8_t unused; +} __packed; + +#define BT_HCI_OP_LE_PER_ADV_CREATE_SYNC_CANCEL BT_OP(BT_OGF_LE, 0x0045) + +#define BT_HCI_OP_LE_PER_ADV_TERMINATE_SYNC BT_OP(BT_OGF_LE, 0x0046) +struct bt_hci_cp_le_per_adv_terminate_sync { + uint16_t handle; +} __packed; + +#define BT_HCI_OP_LE_ADD_DEV_TO_PER_ADV_LIST BT_OP(BT_OGF_LE, 0x0047) +struct bt_hci_cp_le_add_dev_to_per_adv_list { + bt_addr_le_t addr; + uint8_t sid; +} __packed; + +#define BT_HCI_OP_LE_REM_DEV_FROM_PER_ADV_LIST BT_OP(BT_OGF_LE, 0x0048) +struct bt_hci_cp_le_rem_dev_from_per_adv_list { + bt_addr_le_t addr; + uint8_t sid; +} __packed; + +#define BT_HCI_OP_LE_CLEAR_PER_ADV_LIST BT_OP(BT_OGF_LE, 0x0049) + +#define BT_HCI_OP_LE_READ_PER_ADV_LIST_SIZE BT_OP(BT_OGF_LE, 0x004a) +struct bt_hci_rp_le_read_per_adv_list_size { + uint8_t status; + uint8_t list_size; +} __packed; + +#define BT_HCI_OP_LE_READ_TX_POWER BT_OP(BT_OGF_LE, 0x004b) +struct bt_hci_rp_le_read_tx_power { + uint8_t status; + int8_t min_tx_power; + int8_t max_tx_power; +} __packed; + +#define BT_HCI_OP_LE_READ_RF_PATH_COMP BT_OP(BT_OGF_LE, 0x004c) +struct bt_hci_rp_le_read_rf_path_comp { + uint8_t status; + int16_t tx_path_comp; + int16_t rx_path_comp; +} __packed; + +#define BT_HCI_OP_LE_WRITE_RF_PATH_COMP BT_OP(BT_OGF_LE, 0x004d) +struct bt_hci_cp_le_write_rf_path_comp { + int16_t tx_path_comp; + int16_t rx_path_comp; +} __packed; + +#define BT_HCI_LE_PRIVACY_MODE_NETWORK 0x00 +#define BT_HCI_LE_PRIVACY_MODE_DEVICE 0x01 + +#define BT_HCI_OP_LE_SET_PRIVACY_MODE BT_OP(BT_OGF_LE, 0x004e) +struct bt_hci_cp_le_set_privacy_mode { + bt_addr_le_t id_addr; + uint8_t mode; +} __packed; + +/* Event definitions */ + +#define BT_HCI_EVT_UNKNOWN 0x00 +#define BT_HCI_EVT_VENDOR 0xff + +#define BT_HCI_EVT_INQUIRY_COMPLETE 0x01 +struct bt_hci_evt_inquiry_complete { + uint8_t status; +} __packed; + +#define BT_HCI_EVT_CONN_COMPLETE 0x03 +struct bt_hci_evt_conn_complete { + uint8_t status; + uint16_t handle; + bt_addr_t bdaddr; + uint8_t link_type; + uint8_t encr_enabled; +} __packed; + +#define BT_HCI_EVT_CONN_REQUEST 0x04 +struct bt_hci_evt_conn_request { + bt_addr_t bdaddr; + uint8_t dev_class[3]; + uint8_t link_type; +} __packed; + +#define BT_HCI_EVT_DISCONN_COMPLETE 0x05 +struct bt_hci_evt_disconn_complete { + uint8_t status; + uint16_t handle; + uint8_t reason; +} __packed; + +#define BT_HCI_EVT_AUTH_COMPLETE 0x06 +struct bt_hci_evt_auth_complete { + uint8_t status; + uint16_t handle; +} __packed; + +#define BT_HCI_EVT_REMOTE_NAME_REQ_COMPLETE 0x07 +struct bt_hci_evt_remote_name_req_complete { + uint8_t status; + bt_addr_t bdaddr; + uint8_t name[248]; +} __packed; + +#define BT_HCI_EVT_ENCRYPT_CHANGE 0x08 +struct bt_hci_evt_encrypt_change { + uint8_t status; + uint16_t handle; + uint8_t encrypt; +} __packed; + +#define BT_HCI_EVT_REMOTE_FEATURES 0x0b +struct bt_hci_evt_remote_features { + uint8_t status; + uint16_t handle; + uint8_t features[8]; +} __packed; + +#define BT_HCI_EVT_REMOTE_VERSION_INFO 0x0c +struct bt_hci_evt_remote_version_info { + uint8_t status; + uint16_t handle; + uint8_t version; + uint16_t manufacturer; + uint16_t subversion; +} __packed; + +#define BT_HCI_EVT_CMD_COMPLETE 0x0e +struct bt_hci_evt_cmd_complete { + uint8_t ncmd; + uint16_t opcode; +} __packed; + +struct bt_hci_evt_cc_status { + uint8_t status; +} __packed; + +#define BT_HCI_EVT_CMD_STATUS 0x0f +struct bt_hci_evt_cmd_status { + uint8_t status; + uint8_t ncmd; + uint16_t opcode; +} __packed; + +#define BT_HCI_EVT_ROLE_CHANGE 0x12 +struct bt_hci_evt_role_change { + uint8_t status; + bt_addr_t bdaddr; + uint8_t role; +} __packed; + +#define BT_HCI_EVT_NUM_COMPLETED_PACKETS 0x13 +struct bt_hci_evt_num_completed_packets { + uint8_t num_handles; + struct bt_hci_handle_count h[0]; +} __packed; + +#define BT_HCI_EVT_PIN_CODE_REQ 0x16 +struct bt_hci_evt_pin_code_req { + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_EVT_LINK_KEY_REQ 0x17 +struct bt_hci_evt_link_key_req { + bt_addr_t bdaddr; +} __packed; + +/* Link Key types */ +#define BT_LK_COMBINATION 0x00 +#define BT_LK_LOCAL_UNIT 0x01 +#define BT_LK_REMOTE_UNIT 0x02 +#define BT_LK_DEBUG_COMBINATION 0x03 +#define BT_LK_UNAUTH_COMBINATION_P192 0x04 +#define BT_LK_AUTH_COMBINATION_P192 0x05 +#define BT_LK_CHANGED_COMBINATION 0x06 +#define BT_LK_UNAUTH_COMBINATION_P256 0x07 +#define BT_LK_AUTH_COMBINATION_P256 0x08 + +#define BT_HCI_EVT_LINK_KEY_NOTIFY 0x18 +struct bt_hci_evt_link_key_notify { + bt_addr_t bdaddr; + uint8_t link_key[16]; + uint8_t key_type; +} __packed; + +/* Overflow link types */ +#define BT_OVERFLOW_LINK_SYNCH 0x00 +#define BT_OVERFLOW_LINK_ACL 0x01 + +#define BT_HCI_EVT_DATA_BUF_OVERFLOW 0x1a +struct bt_hci_evt_data_buf_overflow { + uint8_t link_type; +} __packed; + +#define BT_HCI_EVT_INQUIRY_RESULT_WITH_RSSI 0x22 +struct bt_hci_evt_inquiry_result_with_rssi { + bt_addr_t addr; + uint8_t pscan_rep_mode; + uint8_t reserved; + uint8_t cod[3]; + uint16_t clock_offset; + int8_t rssi; +} __packed; + +#define BT_HCI_EVT_REMOTE_EXT_FEATURES 0x23 +struct bt_hci_evt_remote_ext_features { + uint8_t status; + uint16_t handle; + uint8_t page; + uint8_t max_page; + uint8_t features[8]; +} __packed; + +#define BT_HCI_EVT_SYNC_CONN_COMPLETE 0x2c +struct bt_hci_evt_sync_conn_complete { + uint8_t status; + uint16_t handle; + bt_addr_t bdaddr; + uint8_t link_type; + uint8_t tx_interval; + uint8_t retansmission_window; + uint16_t rx_pkt_length; + uint16_t tx_pkt_length; + uint8_t air_mode; +} __packed; + +#define BT_HCI_EVT_EXTENDED_INQUIRY_RESULT 0x2f +struct bt_hci_evt_extended_inquiry_result { + uint8_t num_reports; + bt_addr_t addr; + uint8_t pscan_rep_mode; + uint8_t reserved; + uint8_t cod[3]; + uint16_t clock_offset; + int8_t rssi; + uint8_t eir[240]; +} __packed; + +#define BT_HCI_EVT_ENCRYPT_KEY_REFRESH_COMPLETE 0x30 +struct bt_hci_evt_encrypt_key_refresh_complete { + uint8_t status; + uint16_t handle; +} __packed; + +#define BT_HCI_EVT_IO_CAPA_REQ 0x31 +struct bt_hci_evt_io_capa_req { + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_EVT_IO_CAPA_RESP 0x32 +struct bt_hci_evt_io_capa_resp { + bt_addr_t bdaddr; + uint8_t capability; + uint8_t oob_data; + uint8_t authentication; +} __packed; + +#define BT_HCI_EVT_USER_CONFIRM_REQ 0x33 +struct bt_hci_evt_user_confirm_req { + bt_addr_t bdaddr; + uint32_t passkey; +} __packed; + +#define BT_HCI_EVT_USER_PASSKEY_REQ 0x34 +struct bt_hci_evt_user_passkey_req { + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_EVT_SSP_COMPLETE 0x36 +struct bt_hci_evt_ssp_complete { + uint8_t status; + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_EVT_USER_PASSKEY_NOTIFY 0x3b +struct bt_hci_evt_user_passkey_notify { + bt_addr_t bdaddr; + uint32_t passkey; +} __packed; + +#define BT_HCI_EVT_LE_META_EVENT 0x3e +struct bt_hci_evt_le_meta_event { + uint8_t subevent; +} __packed; + +#define BT_HCI_EVT_AUTH_PAYLOAD_TIMEOUT_EXP 0x57 +struct bt_hci_evt_auth_payload_timeout_exp { + uint16_t handle; +} __packed; + +#define BT_HCI_ROLE_MASTER 0x00 +#define BT_HCI_ROLE_SLAVE 0x01 + +#define BT_HCI_EVT_LE_CONN_COMPLETE 0x01 +struct bt_hci_evt_le_conn_complete { + uint8_t status; + uint16_t handle; + uint8_t role; + bt_addr_le_t peer_addr; + uint16_t interval; + uint16_t latency; + uint16_t supv_timeout; + uint8_t clock_accuracy; +} __packed; + +#define BT_HCI_EVT_LE_ADVERTISING_REPORT 0x02 +struct bt_hci_evt_le_advertising_info { + uint8_t evt_type; + bt_addr_le_t addr; + uint8_t length; + uint8_t data[0]; +} __packed; +struct bt_hci_evt_le_advertising_report { + uint8_t num_reports; + struct bt_hci_evt_le_advertising_info adv_info[0]; +} __packed; + +#define BT_HCI_EVT_LE_CONN_UPDATE_COMPLETE 0x03 +struct bt_hci_evt_le_conn_update_complete { + uint8_t status; + uint16_t handle; + uint16_t interval; + uint16_t latency; + uint16_t supv_timeout; +} __packed; + +#define BT_HCI_EV_LE_REMOTE_FEAT_COMPLETE 0x04 +struct bt_hci_evt_le_remote_feat_complete { + uint8_t status; + uint16_t handle; + uint8_t features[8]; +} __packed; + +#define BT_HCI_EVT_LE_LTK_REQUEST 0x05 +struct bt_hci_evt_le_ltk_request { + uint16_t handle; + uint64_t rand; + uint16_t ediv; +} __packed; + +#define BT_HCI_EVT_LE_CONN_PARAM_REQ 0x06 +struct bt_hci_evt_le_conn_param_req { + uint16_t handle; + uint16_t interval_min; + uint16_t interval_max; + uint16_t latency; + uint16_t timeout; +} __packed; + +#define BT_HCI_EVT_LE_DATA_LEN_CHANGE 0x07 +struct bt_hci_evt_le_data_len_change { + uint16_t handle; + uint16_t max_tx_octets; + uint16_t max_tx_time; + uint16_t max_rx_octets; + uint16_t max_rx_time; +} __packed; + +#define BT_HCI_EVT_LE_P256_PUBLIC_KEY_COMPLETE 0x08 +struct bt_hci_evt_le_p256_public_key_complete { + uint8_t status; + uint8_t key[64]; +} __packed; + +#define BT_HCI_EVT_LE_GENERATE_DHKEY_COMPLETE 0x09 +struct bt_hci_evt_le_generate_dhkey_complete { + uint8_t status; + uint8_t dhkey[32]; +} __packed; + +#define BT_HCI_EVT_LE_ENH_CONN_COMPLETE 0x0a +struct bt_hci_evt_le_enh_conn_complete { + uint8_t status; + uint16_t handle; + uint8_t role; + bt_addr_le_t peer_addr; + bt_addr_t local_rpa; + bt_addr_t peer_rpa; + uint16_t interval; + uint16_t latency; + uint16_t supv_timeout; + uint8_t clock_accuracy; +} __packed; + +#define BT_HCI_EVT_LE_DIRECT_ADV_REPORT 0x0b +struct bt_hci_evt_le_direct_adv_info { + uint8_t evt_type; + bt_addr_le_t addr; + bt_addr_le_t dir_addr; + int8_t rssi; +} __packed; +struct bt_hci_evt_le_direct_adv_report { + uint8_t num_reports; + struct bt_hci_evt_le_direct_adv_info direct_adv_info[0]; +} __packed; + +#define BT_HCI_EVT_LE_PHY_UPDATE_COMPLETE 0x0c +struct bt_hci_evt_le_phy_update_complete { + uint8_t status; + uint16_t handle; + uint8_t tx_phy; + uint8_t rx_phy; +} __packed; + +#define BT_HCI_EVT_LE_EXT_ADVERTISING_REPORT 0x0d + +#define BT_HCI_LE_ADV_EVT_TYPE_CONN BIT(0) +#define BT_HCI_LE_ADV_EVT_TYPE_SCAN BIT(1) +#define BT_HCI_LE_ADV_EVT_TYPE_DIRECT BIT(2) +#define BT_HCI_LE_ADV_EVT_TYPE_SCAN_RSP BIT(3) +#define BT_HCI_LE_ADV_EVT_TYPE_LEGACY BIT(4) + +#define BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS(ev_type) (((ev_type) >> 5) & 0x03) +#define BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS_COMPLETE 0 +#define BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS_PARTIAL 1 +#define BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS_INCOMPLETE 2 + +struct bt_hci_evt_le_ext_advertising_info { + uint16_t evt_type; + bt_addr_le_t addr; + uint8_t prim_phy; + uint8_t sec_phy; + uint8_t sid; + int8_t tx_power; + int8_t rssi; + uint16_t interval; + bt_addr_le_t direct_addr; + uint8_t length; + uint8_t data[0]; +} __packed; +struct bt_hci_evt_le_ext_advertising_report { + uint8_t num_reports; + struct bt_hci_evt_le_ext_advertising_info adv_info[0]; +} __packed; + +#define BT_HCI_EVT_LE_PER_ADV_SYNC_ESTABLISHED 0x0e +struct bt_hci_evt_le_per_adv_sync_established { + uint8_t status; + uint16_t handle; + uint8_t sid; + bt_addr_le_t adv_addr; + uint8_t phy; + uint16_t interval; + uint8_t clock_accuracy; +} __packed; + +#define BT_HCI_EVT_LE_PER_ADVERTISING_REPORT 0x0f +struct bt_hci_evt_le_per_advertising_report { + uint16_t handle; + int8_t tx_power; + int8_t rssi; + uint8_t unused; + uint8_t data_status; + uint8_t length; + uint8_t data[0]; +} __packed; + +#define BT_HCI_EVT_LE_PER_ADV_SYNC_LOST 0x10 +struct bt_hci_evt_le_per_adv_sync_lost { + uint16_t handle; +} __packed; + +#define BT_HCI_EVT_LE_SCAN_TIMEOUT 0x11 + +#define BT_HCI_EVT_LE_ADV_SET_TERMINATED 0x12 +struct bt_hci_evt_le_adv_set_terminated { + uint8_t status; + uint8_t adv_handle; + uint16_t conn_handle; + uint8_t num_completed_ext_adv_evts; +} __packed; + +#define BT_HCI_EVT_LE_SCAN_REQ_RECEIVED 0x13 +struct bt_hci_evt_le_scan_req_received { + uint8_t handle; + bt_addr_le_t addr; +} __packed; + +#define BT_HCI_LE_CHAN_SEL_ALGO_1 0x00 +#define BT_HCI_LE_CHAN_SEL_ALGO_2 0x01 + +#define BT_HCI_EVT_LE_CHAN_SEL_ALGO 0x14 +struct bt_hci_evt_le_chan_sel_algo { + uint16_t handle; + uint8_t chan_sel_algo; +} __packed; + +/* Event mask bits */ + +#define BT_EVT_BIT(n) (1ULL << (n)) + +#define BT_EVT_MASK_INQUIRY_COMPLETE BT_EVT_BIT(0) +#define BT_EVT_MASK_CONN_COMPLETE BT_EVT_BIT(2) +#define BT_EVT_MASK_CONN_REQUEST BT_EVT_BIT(3) +#define BT_EVT_MASK_DISCONN_COMPLETE BT_EVT_BIT(4) +#define BT_EVT_MASK_AUTH_COMPLETE BT_EVT_BIT(5) +#define BT_EVT_MASK_REMOTE_NAME_REQ_COMPLETE BT_EVT_BIT(6) +#define BT_EVT_MASK_ENCRYPT_CHANGE BT_EVT_BIT(7) +#define BT_EVT_MASK_REMOTE_FEATURES BT_EVT_BIT(10) +#define BT_EVT_MASK_REMOTE_VERSION_INFO BT_EVT_BIT(11) +#define BT_EVT_MASK_HARDWARE_ERROR BT_EVT_BIT(15) +#define BT_EVT_MASK_ROLE_CHANGE BT_EVT_BIT(17) +#define BT_EVT_MASK_PIN_CODE_REQ BT_EVT_BIT(21) +#define BT_EVT_MASK_LINK_KEY_REQ BT_EVT_BIT(22) +#define BT_EVT_MASK_LINK_KEY_NOTIFY BT_EVT_BIT(23) +#define BT_EVT_MASK_DATA_BUFFER_OVERFLOW BT_EVT_BIT(25) +#define BT_EVT_MASK_INQUIRY_RESULT_WITH_RSSI BT_EVT_BIT(33) +#define BT_EVT_MASK_REMOTE_EXT_FEATURES BT_EVT_BIT(34) +#define BT_EVT_MASK_SYNC_CONN_COMPLETE BT_EVT_BIT(43) +#define BT_EVT_MASK_EXTENDED_INQUIRY_RESULT BT_EVT_BIT(46) +#define BT_EVT_MASK_ENCRYPT_KEY_REFRESH_COMPLETE BT_EVT_BIT(47) +#define BT_EVT_MASK_IO_CAPA_REQ BT_EVT_BIT(48) +#define BT_EVT_MASK_IO_CAPA_RESP BT_EVT_BIT(49) +#define BT_EVT_MASK_USER_CONFIRM_REQ BT_EVT_BIT(50) +#define BT_EVT_MASK_USER_PASSKEY_REQ BT_EVT_BIT(51) +#define BT_EVT_MASK_SSP_COMPLETE BT_EVT_BIT(53) +#define BT_EVT_MASK_USER_PASSKEY_NOTIFY BT_EVT_BIT(58) +#define BT_EVT_MASK_LE_META_EVENT BT_EVT_BIT(61) + +/* Page 2 */ +#define BT_EVT_MASK_PHY_LINK_COMPLETE BT_EVT_BIT(0) +#define BT_EVT_MASK_CH_SELECTED_COMPLETE BT_EVT_BIT(1) +#define BT_EVT_MASK_DISCONN_PHY_LINK_COMPLETE BT_EVT_BIT(2) +#define BT_EVT_MASK_PHY_LINK_LOSS_EARLY_WARN BT_EVT_BIT(3) +#define BT_EVT_MASK_PHY_LINK_RECOVERY BT_EVT_BIT(4) +#define BT_EVT_MASK_LOG_LINK_COMPLETE BT_EVT_BIT(5) +#define BT_EVT_MASK_DISCONN_LOG_LINK_COMPLETE BT_EVT_BIT(6) +#define BT_EVT_MASK_FLOW_SPEC_MODIFY_COMPLETE BT_EVT_BIT(7) +#define BT_EVT_MASK_NUM_COMPLETE_DATA_BLOCKS BT_EVT_BIT(8) +#define BT_EVT_MASK_AMP_START_TEST BT_EVT_BIT(9) +#define BT_EVT_MASK_AMP_TEST_END BT_EVT_BIT(10) +#define BT_EVT_MASK_AMP_RX_REPORT BT_EVT_BIT(11) +#define BT_EVT_MASK_AMP_SR_MODE_CHANGE_COMPLETE BT_EVT_BIT(12) +#define BT_EVT_MASK_AMP_STATUS_CHANGE BT_EVT_BIT(13) +#define BT_EVT_MASK_TRIGG_CLOCK_CAPTURE BT_EVT_BIT(14) +#define BT_EVT_MASK_SYNCH_TRAIN_COMPLETE BT_EVT_BIT(15) +#define BT_EVT_MASK_SYNCH_TRAIN_RX BT_EVT_BIT(16) +#define BT_EVT_MASK_CL_SLAVE_BC_RX BT_EVT_BIT(17) +#define BT_EVT_MASK_CL_SLAVE_BC_TIMEOUT BT_EVT_BIT(18) +#define BT_EVT_MASK_TRUNC_PAGE_COMPLETE BT_EVT_BIT(19) +#define BT_EVT_MASK_SLAVE_PAGE_RSP_TIMEOUT BT_EVT_BIT(20) +#define BT_EVT_MASK_CL_SLAVE_BC_CH_MAP_CHANGE BT_EVT_BIT(21) +#define BT_EVT_MASK_INQUIRY_RSP_NOT BT_EVT_BIT(22) +#define BT_EVT_MASK_AUTH_PAYLOAD_TIMEOUT_EXP BT_EVT_BIT(23) +#define BT_EVT_MASK_SAM_STATUS_CHANGE BT_EVT_BIT(24) + +#define BT_EVT_MASK_LE_CONN_COMPLETE BT_EVT_BIT(0) +#define BT_EVT_MASK_LE_ADVERTISING_REPORT BT_EVT_BIT(1) +#define BT_EVT_MASK_LE_CONN_UPDATE_COMPLETE BT_EVT_BIT(2) +#define BT_EVT_MASK_LE_REMOTE_FEAT_COMPLETE BT_EVT_BIT(3) +#define BT_EVT_MASK_LE_LTK_REQUEST BT_EVT_BIT(4) +#define BT_EVT_MASK_LE_CONN_PARAM_REQ BT_EVT_BIT(5) +#define BT_EVT_MASK_LE_DATA_LEN_CHANGE BT_EVT_BIT(6) +#define BT_EVT_MASK_LE_P256_PUBLIC_KEY_COMPLETE BT_EVT_BIT(7) +#define BT_EVT_MASK_LE_GENERATE_DHKEY_COMPLETE BT_EVT_BIT(8) +#define BT_EVT_MASK_LE_ENH_CONN_COMPLETE BT_EVT_BIT(9) +#define BT_EVT_MASK_LE_DIRECT_ADV_REPORT BT_EVT_BIT(10) +#define BT_EVT_MASK_LE_PHY_UPDATE_COMPLETE BT_EVT_BIT(11) +#define BT_EVT_MASK_LE_EXT_ADVERTISING_REPORT BT_EVT_BIT(12) +#define BT_EVT_MASK_LE_PER_ADV_SYNC_ESTABLISHED BT_EVT_BIT(13) +#define BT_EVT_MASK_LE_PER_ADVERTISING_REPORT BT_EVT_BIT(14) +#define BT_EVT_MASK_LE_PER_ADV_SYNC_LOST BT_EVT_BIT(15) +#define BT_EVT_MASK_LE_SCAN_TIMEOUT BT_EVT_BIT(16) +#define BT_EVT_MASK_LE_ADV_SET_TERMINATED BT_EVT_BIT(17) +#define BT_EVT_MASK_LE_SCAN_REQ_RECEIVED BT_EVT_BIT(18) +#define BT_EVT_MASK_LE_CHAN_SEL_ALGO BT_EVT_BIT(19) + +// + +#endif /* ZEPHYR_INCLUDE_BLUETOOTH_HCI_H_ */ diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/hci_err.h b/devices/ble_hci/common-hal/_bleio/hci_include/hci_err.h new file mode 100644 index 0000000000..476d3f4638 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/hci_include/hci_err.h @@ -0,0 +1,92 @@ +/** @file + * @brief Bluetooth Host Control Interface status codes. + */ + +/* + * Copyright (c) 2019 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef ZEPHYR_INCLUDE_BLUETOOTH_HCI_STATUS_H_ +#define ZEPHYR_INCLUDE_BLUETOOTH_HCI_STATUS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** HCI Error Codes, BT Core Spec v5.2 [Vol 1, Part F]. */ +#define BT_HCI_ERR_SUCCESS 0x00 +#define BT_HCI_ERR_UNKNOWN_CMD 0x01 +#define BT_HCI_ERR_UNKNOWN_CONN_ID 0x02 +#define BT_HCI_ERR_HW_FAILURE 0x03 +#define BT_HCI_ERR_PAGE_TIMEOUT 0x04 +#define BT_HCI_ERR_AUTH_FAIL 0x05 +#define BT_HCI_ERR_PIN_OR_KEY_MISSING 0x06 +#define BT_HCI_ERR_MEM_CAPACITY_EXCEEDED 0x07 +#define BT_HCI_ERR_CONN_TIMEOUT 0x08 +#define BT_HCI_ERR_CONN_LIMIT_EXCEEDED 0x09 +#define BT_HCI_ERR_SYNC_CONN_LIMIT_EXCEEDED 0x0a +#define BT_HCI_ERR_CONN_ALREADY_EXISTS 0x0b +#define BT_HCI_ERR_CMD_DISALLOWED 0x0c +#define BT_HCI_ERR_INSUFFICIENT_RESOURCES 0x0d +#define BT_HCI_ERR_INSUFFICIENT_SECURITY 0x0e +#define BT_HCI_ERR_BD_ADDR_UNACCEPTABLE 0x0f +#define BT_HCI_ERR_CONN_ACCEPT_TIMEOUT 0x10 +#define BT_HCI_ERR_UNSUPP_FEATURE_PARAM_VAL 0x11 +#define BT_HCI_ERR_INVALID_PARAM 0x12 +#define BT_HCI_ERR_REMOTE_USER_TERM_CONN 0x13 +#define BT_HCI_ERR_REMOTE_LOW_RESOURCES 0x14 +#define BT_HCI_ERR_REMOTE_POWER_OFF 0x15 +#define BT_HCI_ERR_LOCALHOST_TERM_CONN 0x16 +#define BT_HCI_ERR_REPEATED_ATTEMPTS 0x17 +#define BT_HCI_ERR_PAIRING_NOT_ALLOWED 0x18 +#define BT_HCI_ERR_UNKNOWN_LMP_PDU 0x19 +#define BT_HCI_ERR_UNSUPP_REMOTE_FEATURE 0x1a +#define BT_HCI_ERR_SCO_OFFSET_REJECTED 0x1b +#define BT_HCI_ERR_SCO_INTERVAL_REJECTED 0x1c +#define BT_HCI_ERR_SCO_AIR_MODE_REJECTED 0x1d +#define BT_HCI_ERR_INVALID_LL_PARAM 0x1e +#define BT_HCI_ERR_UNSPECIFIED 0x1f +#define BT_HCI_ERR_UNSUPP_LL_PARAM_VAL 0x20 +#define BT_HCI_ERR_ROLE_CHANGE_NOT_ALLOWED 0x21 +#define BT_HCI_ERR_LL_RESP_TIMEOUT 0x22 +#define BT_HCI_ERR_LL_PROC_COLLISION 0x23 +#define BT_HCI_ERR_LMP_PDU_NOT_ALLOWED 0x24 +#define BT_HCI_ERR_ENC_MODE_NOT_ACCEPTABLE 0x25 +#define BT_HCI_ERR_LINK_KEY_CANNOT_BE_CHANGED 0x26 +#define BT_HCI_ERR_REQUESTED_QOS_NOT_SUPPORTED 0x27 +#define BT_HCI_ERR_INSTANT_PASSED 0x28 +#define BT_HCI_ERR_PAIRING_NOT_SUPPORTED 0x29 +#define BT_HCI_ERR_DIFF_TRANS_COLLISION 0x2a +#define BT_HCI_ERR_QOS_UNACCEPTABLE_PARAM 0x2c +#define BT_HCI_ERR_QOS_REJECTED 0x2d +#define BT_HCI_ERR_CHAN_ASSESS_NOT_SUPPORTED 0x2e +#define BT_HCI_ERR_INSUFF_SECURITY 0x2f +#define BT_HCI_ERR_PARAM_OUT_OF_MANDATORY_RANGE 0x30 +#define BT_HCI_ERR_ROLE_SWITCH_PENDING 0x32 +#define BT_HCI_ERR_RESERVED_SLOT_VIOLATION 0x34 +#define BT_HCI_ERR_ROLE_SWITCH_FAILED 0x35 +#define BT_HCI_ERR_EXT_INQ_RESP_TOO_LARGE 0x36 +#define BT_HCI_ERR_SIMPLE_PAIR_NOT_SUPP_BY_HOST 0x37 +#define BT_HCI_ERR_HOST_BUSY_PAIRING 0x38 +#define BT_HCI_ERR_CONN_REJECTED_DUE_TO_NO_CHAN 0x39 +#define BT_HCI_ERR_CONTROLLER_BUSY 0x3a +#define BT_HCI_ERR_UNACCEPT_CONN_PARAM 0x3b +#define BT_HCI_ERR_ADV_TIMEOUT 0x3c +#define BT_HCI_ERR_TERM_DUE_TO_MIC_FAIL 0x3d +#define BT_HCI_ERR_CONN_FAIL_TO_ESTAB 0x3e +#define BT_HCI_ERR_MAC_CONN_FAILED 0x3f +#define BT_HCI_ERR_CLOCK_ADJUST_REJECTED 0x40 +#define BT_HCI_ERR_SUBMAP_NOT_DEFINED 0x41 +#define BT_HCI_ERR_UNKNOWN_ADV_IDENTIFIER 0x42 +#define BT_HCI_ERR_LIMIT_REACHED 0x43 +#define BT_HCI_ERR_OP_CANCELLED_BY_HOST 0x44 +#define BT_HCI_ERR_PACKET_TOO_LONG 0x45 + +#define BT_HCI_ERR_AUTHENTICATION_FAIL __DEPRECATED_MACRO BT_HCI_ERR_AUTH_FAIL + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_INCLUDE_BLUETOOTH_HCI_STATUS_H_ */ diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/hci_raw.h b/devices/ble_hci/common-hal/_bleio/hci_include/hci_raw.h new file mode 100644 index 0000000000..030fb0ca3c --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/hci_include/hci_raw.h @@ -0,0 +1,152 @@ +/** @file + * @brief Bluetooth HCI RAW channel handling + */ + +/* + * Copyright (c) 2016 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef ZEPHYR_INCLUDE_BLUETOOTH_HCI_RAW_H_ +#define ZEPHYR_INCLUDE_BLUETOOTH_HCI_RAW_H_ + +/** + * @brief HCI RAW channel + * @defgroup hci_raw HCI RAW channel + * @ingroup bluetooth + * @{ + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(CONFIG_BT_CTLR_TX_BUFFER_SIZE) +#define BT_L2CAP_MTU (CONFIG_BT_CTLR_TX_BUFFER_SIZE - BT_L2CAP_HDR_SIZE) +#else +#define BT_L2CAP_MTU 65 /* 64-byte public key + opcode */ +#endif /* CONFIG_BT_CTLR */ + +/** Data size needed for ACL buffers */ +#define BT_BUF_ACL_SIZE BT_L2CAP_BUF_SIZE(BT_L2CAP_MTU) + +#if defined(CONFIG_BT_CTLR_TX_BUFFERS) +#define BT_HCI_ACL_COUNT CONFIG_BT_CTLR_TX_BUFFERS +#else +#define BT_HCI_ACL_COUNT 6 +#endif + +#define BT_BUF_TX_SIZE MAX(BT_BUF_RX_SIZE, BT_BUF_ACL_SIZE) + +/** @brief Send packet to the Bluetooth controller + * + * Send packet to the Bluetooth controller. Caller needs to + * implement netbuf pool. + * + * @param buf netbuf packet to be send + * + * @return Zero on success or (negative) error code otherwise. + */ +int bt_send(struct net_buf *buf); + +enum { + /** Passthrough mode + * + * While in this mode the buffers are passed as is between the stack + * and the driver. + */ + BT_HCI_RAW_MODE_PASSTHROUGH = 0x00, + + /** H:4 mode + * + * While in this mode H:4 headers will added into the buffers + * according to the buffer type when coming from the stack and will be + * removed and used to set the buffer type. + */ + BT_HCI_RAW_MODE_H4 = 0x01, +}; + +/** @brief Set Bluetooth RAW channel mode + * + * Set access mode of Bluetooth RAW channel. + * + * @param mode Access mode. + * + * @return Zero on success or (negative) error code otherwise. + */ +int bt_hci_raw_set_mode(uint8_t mode); + +/** @brief Get Bluetooth RAW channel mode + * + * Get access mode of Bluetooth RAW channel. + * + * @return Access mode. + */ +uint8_t bt_hci_raw_get_mode(void); + +#define BT_HCI_ERR_EXT_HANDLED 0xff + +/** Helper macro to define a command extension + * + * @param _op Opcode of the command. + * @param _min_len Minimal length of the command. + * @param _func Handler function to be called. + */ +#define BT_HCI_RAW_CMD_EXT(_op, _min_len, _func) \ + { \ + .op = _op, \ + .min_len = _min_len, \ + .func = _func, \ + } + +struct bt_hci_raw_cmd_ext { + /** Opcode of the command */ + uint16_t op; + + /** Minimal length of the command */ + size_t min_len; + + /** Handler function. + * + * Handler function to be called when a command is intercepted. + * + * @param buf Buffer containing the command. + * + * @return HCI Status code or BT_HCI_ERR_EXT_HANDLED if command has + * been handled already and a response has been sent as oppose to + * BT_HCI_ERR_SUCCESS which just indicates that the command can be + * sent to the controller to be processed. + */ + uint8_t (*func)(struct net_buf *buf); +}; + +/** @brief Register Bluetooth RAW command extension table + * + * Register Bluetooth RAW channel command extension table, opcodes in this + * table are intercepted to sent to the handler function. + * + * @param cmds Pointer to the command extension table. + * @param size Size of the command extension table. + */ +void bt_hci_raw_cmd_ext_register(struct bt_hci_raw_cmd_ext *cmds, size_t size); + +/** @brief Enable Bluetooth RAW channel: + * + * Enable Bluetooth RAW HCI channel. + * + * @param rx_queue netbuf queue where HCI packets received from the Bluetooth + * controller are to be queued. The queue is defined in the caller while + * the available buffers pools are handled in the stack. + * + * @return Zero on success or (negative) error code otherwise. + */ +int bt_enable_raw(struct k_fifo *rx_queue); + +#ifdef __cplusplus +} +#endif +/** + * @} + */ + +#endif /* ZEPHYR_INCLUDE_BLUETOOTH_HCI_RAW_H_ */ diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/hci_vs.h b/devices/ble_hci/common-hal/_bleio/hci_include/hci_vs.h new file mode 100644 index 0000000000..e4f94b6a83 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/hci_include/hci_vs.h @@ -0,0 +1,379 @@ +/* hci_vs.h - Bluetooth Host Control Interface Vendor Specific definitions */ + +/* + * Copyright (c) 2017-2018 Nordic Semiconductor ASA + * Copyright (c) 2015-2016 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef ZEPHYR_INCLUDE_BLUETOOTH_HCI_VS_H_ +#define ZEPHYR_INCLUDE_BLUETOOTH_HCI_VS_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define BT_VS_CMD_BIT_VERSION 0 +#define BT_VS_CMD_BIT_SUP_CMD 1 +#define BT_VS_CMD_BIT_SUP_FEAT 2 +#define BT_VS_CMD_BIT_SET_EVT_MASK 3 +#define BT_VS_CMD_BIT_RESET 4 +#define BT_VS_CMD_BIT_WRITE_BDADDR 5 +#define BT_VS_CMD_BIT_SET_TRACE_ENABLE 6 +#define BT_VS_CMD_BIT_READ_BUILD_INFO 7 +#define BT_VS_CMD_BIT_READ_STATIC_ADDRS 8 +#define BT_VS_CMD_BIT_READ_KEY_ROOTS 9 +#define BT_VS_CMD_BIT_READ_CHIP_TEMP 10 +#define BT_VS_CMD_BIT_READ_HOST_STACK_CMD 11 +#define BT_VS_CMD_BIT_SET_SCAN_REP_ENABLE 12 +#define BT_VS_CMD_BIT_WRITE_TX_POWER 13 +#define BT_VS_CMD_BIT_READ_TX_POWER 14 + +#define BT_VS_CMD_SUP_FEAT(cmd) BT_LE_FEAT_TEST(cmd, \ + BT_VS_CMD_BIT_SUP_FEAT) +#define BT_VS_CMD_READ_STATIC_ADDRS(cmd) BT_LE_FEAT_TEST(cmd, \ + BT_VS_CMD_BIT_READ_STATIC_ADDRS) +#define BT_VS_CMD_READ_KEY_ROOTS(cmd) BT_LE_FEAT_TEST(cmd, \ + BT_VS_CMD_BIT_READ_KEY_ROOTS) + +#define BT_HCI_VS_HW_PLAT_INTEL 0x0001 +#define BT_HCI_VS_HW_PLAT_NORDIC 0x0002 +#define BT_HCI_VS_HW_PLAT_NXP 0x0003 + +#define BT_HCI_VS_HW_VAR_NORDIC_NRF51X 0x0001 +#define BT_HCI_VS_HW_VAR_NORDIC_NRF52X 0x0002 +#define BT_HCI_VS_HW_VAR_NORDIC_NRF53X 0x0003 + +#define BT_HCI_VS_FW_VAR_STANDARD_CTLR 0x0001 +#define BT_HCI_VS_FW_VAR_VS_CTLR 0x0002 +#define BT_HCI_VS_FW_VAR_FW_LOADER 0x0003 +#define BT_HCI_VS_FW_VAR_RESCUE_IMG 0x0004 +#define BT_HCI_OP_VS_READ_VERSION_INFO BT_OP(BT_OGF_VS, 0x0001) +struct bt_hci_rp_vs_read_version_info { + uint8_t status; + uint16_t hw_platform; + uint16_t hw_variant; + uint8_t fw_variant; + uint8_t fw_version; + uint16_t fw_revision; + uint32_t fw_build; +} __packed; + +#define BT_HCI_OP_VS_READ_SUPPORTED_COMMANDS BT_OP(BT_OGF_VS, 0x0002) +struct bt_hci_rp_vs_read_supported_commands { + uint8_t status; + uint8_t commands[64]; +} __packed; + +#define BT_HCI_OP_VS_READ_SUPPORTED_FEATURES BT_OP(BT_OGF_VS, 0x0003) +struct bt_hci_rp_vs_read_supported_features { + uint8_t status; + uint8_t features[8]; +} __packed; + +#define BT_HCI_OP_VS_SET_EVENT_MASK BT_OP(BT_OGF_VS, 0x0004) +struct bt_hci_cp_vs_set_event_mask { + uint8_t event_mask[8]; +} __packed; + +#define BT_HCI_VS_RESET_SOFT 0x00 +#define BT_HCI_VS_RESET_HARD 0x01 +#define BT_HCI_OP_VS_RESET BT_OP(BT_OGF_VS, 0x0005) +struct bt_hci_cp_vs_reset { + uint8_t type; +} __packed; + +#define BT_HCI_OP_VS_WRITE_BD_ADDR BT_OP(BT_OGF_VS, 0x0006) +struct bt_hci_cp_vs_write_bd_addr { + bt_addr_t bdaddr; +} __packed; + +#define BT_HCI_VS_TRACE_DISABLED 0x00 +#define BT_HCI_VS_TRACE_ENABLED 0x01 + +#define BT_HCI_VS_TRACE_HCI_EVTS 0x00 +#define BT_HCI_VS_TRACE_VDC 0x01 +#define BT_HCI_OP_VS_SET_TRACE_ENABLE BT_OP(BT_OGF_VS, 0x0007) +struct bt_hci_cp_vs_set_trace_enable { + uint8_t enable; + uint8_t type; +} __packed; + +#define BT_HCI_OP_VS_READ_BUILD_INFO BT_OP(BT_OGF_VS, 0x0008) +struct bt_hci_rp_vs_read_build_info { + uint8_t status; + uint8_t info[0]; +} __packed; + +struct bt_hci_vs_static_addr { + bt_addr_t bdaddr; + uint8_t ir[16]; +} __packed; + +#define BT_HCI_OP_VS_READ_STATIC_ADDRS BT_OP(BT_OGF_VS, 0x0009) +struct bt_hci_rp_vs_read_static_addrs { + uint8_t status; + uint8_t num_addrs; + struct bt_hci_vs_static_addr a[0]; +} __packed; + +#define BT_HCI_OP_VS_READ_KEY_HIERARCHY_ROOTS BT_OP(BT_OGF_VS, 0x000a) +struct bt_hci_rp_vs_read_key_hierarchy_roots { + uint8_t status; + uint8_t ir[16]; + uint8_t er[16]; +} __packed; + +#define BT_HCI_OP_VS_READ_CHIP_TEMP BT_OP(BT_OGF_VS, 0x000b) +struct bt_hci_rp_vs_read_chip_temp { + uint8_t status; + int8_t temps; +} __packed; + +struct bt_hci_vs_cmd { + uint16_t vendor_id; + uint16_t opcode_base; +} __packed; + +#define BT_HCI_VS_VID_ANDROID 0x0001 +#define BT_HCI_VS_VID_MICROSOFT 0x0002 +#define BT_HCI_OP_VS_READ_HOST_STACK_CMDS BT_OP(BT_OGF_VS, 0x000c) +struct bt_hci_rp_vs_read_host_stack_cmds { + uint8_t status; + uint8_t num_cmds; + struct bt_hci_vs_cmd c[0]; +} __packed; + +#define BT_HCI_VS_SCAN_REQ_REPORTS_DISABLED 0x00 +#define BT_HCI_VS_SCAN_REQ_REPORTS_ENABLED 0x01 +#define BT_HCI_OP_VS_SET_SCAN_REQ_REPORTS BT_OP(BT_OGF_VS, 0x000d) +struct bt_hci_cp_vs_set_scan_req_reports { + uint8_t enable; +} __packed; + +#define BT_HCI_VS_LL_HANDLE_TYPE_ADV 0x00 +#define BT_HCI_VS_LL_HANDLE_TYPE_SCAN 0x01 +#define BT_HCI_VS_LL_HANDLE_TYPE_CONN 0x02 +#define BT_HCI_VS_LL_TX_POWER_LEVEL_NO_PREF 0x7F +#define BT_HCI_OP_VS_WRITE_TX_POWER_LEVEL BT_OP(BT_OGF_VS, 0x000e) +struct bt_hci_cp_vs_write_tx_power_level { + uint8_t handle_type; + uint16_t handle; + int8_t tx_power_level; +} __packed; + +struct bt_hci_rp_vs_write_tx_power_level { + uint8_t status; + uint8_t handle_type; + uint16_t handle; + int8_t selected_tx_power; +} __packed; + +#define BT_HCI_OP_VS_READ_TX_POWER_LEVEL BT_OP(BT_OGF_VS, 0x000f) +struct bt_hci_cp_vs_read_tx_power_level { + uint8_t handle_type; + uint16_t handle; +} __packed; + +struct bt_hci_rp_vs_read_tx_power_level { + uint8_t status; + uint8_t handle_type; + uint16_t handle; + int8_t tx_power_level; +} __packed; + +#define BT_HCI_OP_VS_READ_USB_TRANSPORT_MODE BT_OP(BT_OGF_VS, 0x0010) + +struct bt_hci_rp_vs_read_usb_transport_mode { + uint8_t status; + uint8_t num_supported_modes; + uint8_t supported_mode[0]; +} __packed; + +#define BT_HCI_VS_USB_H2_MODE 0x00 +#define BT_HCI_VS_USB_H4_MODE 0x01 + +#define BT_HCI_OP_VS_SET_USB_TRANSPORT_MODE BT_OP(BT_OGF_VS, 0x0011) + +struct bt_hci_cp_vs_set_usb_transport_mode { + uint8_t mode; +} __packed; + +/* Events */ + +struct bt_hci_evt_vs { + uint8_t subevent; +} __packed; + +#define BT_HCI_EVT_VS_FATAL_ERROR 0x02 +struct bt_hci_evt_vs_fatal_error { + uint64_t pc; + uint8_t err_info[0]; +} __packed; + +#define BT_HCI_VS_TRACE_LMP_TX 0x01 +#define BT_HCI_VS_TRACE_LMP_RX 0x02 +#define BT_HCI_VS_TRACE_LLCP_TX 0x03 +#define BT_HCI_VS_TRACE_LLCP_RX 0x04 +#define BT_HCI_VS_TRACE_LE_CONN_IND 0x05 +#define BT_HCI_EVT_VS_TRACE_INFO 0x03 +struct bt_hci_evt_vs_trace_info { + uint8_t type; + uint8_t data[0]; +} __packed; + +#define BT_HCI_EVT_VS_SCAN_REQ_RX 0x04 +struct bt_hci_evt_vs_scan_req_rx { + bt_addr_le_t addr; + int8_t rssi; +} __packed; + +/* Event mask bits */ + +#define BT_EVT_MASK_VS_FATAL_ERROR BT_EVT_BIT(1) +#define BT_EVT_MASK_VS_TRACE_INFO BT_EVT_BIT(2) +#define BT_EVT_MASK_VS_SCAN_REQ_RX BT_EVT_BIT(3) + +/* Mesh HCI commands */ +#define BT_HCI_MESH_REVISION 0x01 + +#define BT_HCI_OP_VS_MESH BT_OP(BT_OGF_VS, 0x0042) +#define BT_HCI_MESH_EVT_PREFIX 0xF0 + +struct bt_hci_cp_mesh { + uint8_t opcode; +} __packed; + +#define BT_HCI_OC_MESH_GET_OPTS 0x00 +struct bt_hci_rp_mesh_get_opts { + uint8_t status; + uint8_t opcode; + uint8_t revision; + uint8_t ch_map; + int8_t min_tx_power; + int8_t max_tx_power; + uint8_t max_scan_filter; + uint8_t max_filter_pattern; + uint8_t max_adv_slot; + uint8_t max_tx_window; + uint8_t evt_prefix_len; + uint8_t evt_prefix; +} __packed; + +#define BT_HCI_MESH_PATTERN_LEN_MAX 0x0f + +#define BT_HCI_OC_MESH_SET_SCAN_FILTER 0x01 +struct bt_hci_mesh_pattern { + uint8_t pattern_len; + uint8_t pattern[0]; +} __packed; + +struct bt_hci_cp_mesh_set_scan_filter { + uint8_t scan_filter; + uint8_t filter_dup; + uint8_t num_patterns; + struct bt_hci_mesh_pattern patterns[0]; +} __packed; +struct bt_hci_rp_mesh_set_scan_filter { + uint8_t status; + uint8_t opcode; + uint8_t scan_filter; +} __packed; + +#define BT_HCI_OC_MESH_ADVERTISE 0x02 +struct bt_hci_cp_mesh_advertise { + uint8_t adv_slot; + uint8_t own_addr_type; + bt_addr_t random_addr; + uint8_t ch_map; + int8_t tx_power; + uint8_t min_tx_delay; + uint8_t max_tx_delay; + uint8_t retx_count; + uint8_t retx_interval; + uint8_t scan_delay; + uint16_t scan_duration; + uint8_t scan_filter; + uint8_t data_len; + uint8_t data[31]; +} __packed; +struct bt_hci_rp_mesh_advertise { + uint8_t status; + uint8_t opcode; + uint8_t adv_slot; +} __packed; + +#define BT_HCI_OC_MESH_ADVERTISE_TIMED 0x03 +struct bt_hci_cp_mesh_advertise_timed { + uint8_t adv_slot; + uint8_t own_addr_type; + bt_addr_t random_addr; + uint8_t ch_map; + int8_t tx_power; + uint8_t retx_count; + uint8_t retx_interval; + uint32_t instant; + uint16_t tx_delay; + uint16_t tx_window; + uint8_t data_len; + uint8_t data[31]; +} __packed; +struct bt_hci_rp_mesh_advertise_timed { + uint8_t status; + uint8_t opcode; + uint8_t adv_slot; +} __packed; + +#define BT_HCI_OC_MESH_ADVERTISE_CANCEL 0x04 +struct bt_hci_cp_mesh_advertise_cancel { + uint8_t adv_slot; +} __packed; +struct bt_hci_rp_mesh_advertise_cancel { + uint8_t status; + uint8_t opcode; + uint8_t adv_slot; +} __packed; + +#define BT_HCI_OC_MESH_SET_SCANNING 0x05 +struct bt_hci_cp_mesh_set_scanning { + uint8_t enable; + uint8_t ch_map; + uint8_t scan_filter; +} __packed; +struct bt_hci_rp_mesh_set_scanning { + uint8_t status; + uint8_t opcode; +} __packed; + +/* Events */ +struct bt_hci_evt_mesh { + uint8_t prefix; + uint8_t subevent; +} __packed; + +#define BT_HCI_EVT_MESH_ADV_COMPLETE 0x00 +struct bt_hci_evt_mesh_adv_complete { + uint8_t adv_slot; +} __packed; + +#define BT_HCI_EVT_MESH_SCANNING_REPORT 0x01 +struct bt_hci_evt_mesh_scan_report { + bt_addr_le_t addr; + uint8_t chan; + int8_t rssi; + uint32_t instant; + uint8_t data_len; + uint8_t data[0]; +} __packed; +struct bt_hci_evt_mesh_scanning_report { + uint8_t num_reports; + struct bt_hci_evt_mesh_scan_report reports[0]; +} __packed; + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_INCLUDE_BLUETOOTH_HCI_VS_H_ */ diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index b30159c7c1..0dd31904f2 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -319,7 +319,7 @@ SRC_COMMON_HAL_ALL = \ ifeq ($(CIRCUITPY_BLEIO_HCI),1) SRC_C += \ - common-hal/_bleio/hci.c \ + common-hal/_bleio/hci_api.c \ endif diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 1b991ac6d4..6ad4b75456 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -68,52 +68,37 @@ //| Use `_bleio.adapter` to access the sole instance available.""" //| -//| def hci_init(self, *, tx: Pin, rx: Pin, rts: Pin, cts: Pin, baudrate: int = 115200, buffer_size: int = 256): +//| def hci_init(self, *, uart: busio.UART, cts: Pin, baudrate: int = 115200, buffer_size: int = 256): //| On boards that do not have native BLE, you can an use HCI co-processor. -//| Call `_bleio.adapter.hci_init()` passing it the pins used to communicate +//| Call `_bleio.adapter.hci_init()` passing it the uart and pins used to communicate //| with the co-processor, such as an Adafruit AirLift. //| The co-processor must have been reset and put into BLE mode beforehand //| by the appropriate pin manipulation. -//| The `tx`, `rx`, `rts`, and `cs` pins are used to communicate with the HCI co-processor in HCI mode. +//| The `uart` object, and `rts` and `cs` pins are used to +//| communicate with the HCI co-processor in HCI mode. //| mp_obj_t bleio_adapter_hci_init(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { #if CIRCUITPY_BLEIO_HCI bleio_adapter_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); - if (self->enabled) { - mp_raise_ValueError(translate("HCI Adapter is already enabled")); - } - - enum { ARG_tx, ARG_rx, ARG_rts, ARG_cts, ARG_baudrate, ARG_buffer_size }; + enum { ARG_uart, ARG_rts, ARG_cts }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_tx, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_rx, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_uart, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_rts, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_cts, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_baudrate, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 115200 } }, - { MP_QSTR_buffer_size, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 256 } }, }; 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); - const mcu_pin_obj_t *tx = validate_obj_is_free_pin(args[ARG_tx].u_obj); - const mcu_pin_obj_t *rx = validate_obj_is_free_pin(args[ARG_rx].u_obj); + busio_uart_obj_t *uart = args[ARG_uart].u_obj; + if (!MP_OBJ_IS_TYPE(uart, &busio_uart_type)) { + mp_raise_ValueError(translate("Expected a UART")); + } const mcu_pin_obj_t *rts = validate_obj_is_free_pin(args[ARG_rts].u_obj); const mcu_pin_obj_t *cts = validate_obj_is_free_pin(args[ARG_cts].u_obj); - if (args[ARG_baudrate].u_int <= 0) { - mp_raise_ValueError(translate("baudrate must be > 0")); - } - const uint32_t baudrate = args[ARG_baudrate].u_int; - - if (args[ARG_buffer_size].u_int <= 1) { - mp_raise_ValueError(translate("buffer_size must be >= 1")); - } - const uint32_t buffer_size = args[ARG_buffer_size].u_int; - - common_hal_bleio_adapter_hci_init(&common_hal_bleio_adapter_obj, tx, rx, rts, cts, - baudrate, buffer_size); + common_hal_bleio_adapter_hci_init(self, uart, rts, cts); return mp_const_none; #else @@ -268,7 +253,7 @@ STATIC mp_obj_t bleio_adapter_stop_advertising(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_stop_advertising_obj, bleio_adapter_stop_advertising); -//| def start_scan(self, prefixes: sequence = b"", *, buffer_size: int = 512, extended: bool = False, timeout: float = None, interval: float = 0.1, window: float = 0.1, minimum_rssi: int = -80, active: bool = True) -> Any: +//| def start_scan(self, *, prefixes: sequence = b"", buffer_size: int = 512, extended: bool = False, timeout: float = None, interval: float = 0.1, window: float = 0.1, minimum_rssi: int = -80, active: bool = True) -> Any: //| """Starts a BLE scan and returns an iterator of results. Advertisements and scan responses are //| filtered and returned separately. //| diff --git a/shared-bindings/_bleio/Adapter.h b/shared-bindings/_bleio/Adapter.h index 8fdeb1354c..9caca161f2 100644 --- a/shared-bindings/_bleio/Adapter.h +++ b/shared-bindings/_bleio/Adapter.h @@ -38,7 +38,7 @@ const mp_obj_type_t bleio_adapter_type; #if CIRCUITPY_BLEIO_HCI -void common_hal_bleio_adapter_hci_init(bleio_adapter_obj_t *self, const mcu_pin_obj_t *tx, const mcu_pin_obj_t *rx, const mcu_pin_obj_t *rts, const mcu_pin_obj_t *cts, uint32_t baudrate, uint32_t buffer_size); +void common_hal_bleio_adapter_hci_init(bleio_adapter_obj_t *self, busio_uart_obj_t *uart, const mcu_pin_obj_t *rts, const mcu_pin_obj_t *cts); #endif // CIRCUITPY_BLEIO_HCI bool common_hal_bleio_adapter_get_advertising(bleio_adapter_obj_t *self); diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 531980effc..60a67b2161 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -43,8 +43,9 @@ //| way around.""" //| //| def monotonic() -> Any: -//| """Returns an always increasing value of time with an unknown reference -//| point. Only use it to compare against other values from `monotonic`. +//| """Returns an always increasing value of time, in fractional seconds, +//| with an unknown reference point. +//| Only use it to compare against other values from `monotonic`. //| //| :return: the current monotonic time //| :rtype: float""" From 768149fb014b81e42c17102335ed539f00f51a7c Mon Sep 17 00:00:00 2001 From: Arudinne Date: Wed, 8 Jul 2020 10:36:41 -0500 Subject: [PATCH 0259/1293] modified: ports/nrf/boards/raytac_mdbt50q-db-40/pins.c --- ports/nrf/boards/raytac_mdbt50q-db-40/pins.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/nrf/boards/raytac_mdbt50q-db-40/pins.c b/ports/nrf/boards/raytac_mdbt50q-db-40/pins.c index 33693697a1..426498cc20 100644 --- a/ports/nrf/boards/raytac_mdbt50q-db-40/pins.c +++ b/ports/nrf/boards/raytac_mdbt50q-db-40/pins.c @@ -48,7 +48,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P1_13), MP_ROM_PTR(&pin_P1_13) }, { MP_ROM_QSTR(MP_QSTR_P1_14), MP_ROM_PTR(&pin_P1_14) }, { MP_ROM_QSTR(MP_QSTR_P1_15), MP_ROM_PTR(&pin_P1_15) }, - + { MP_ROM_QSTR(MP_QSTR_AIN_0), MP_ROM_PTR(&pin_P0_02) }, { MP_ROM_QSTR(MP_QSTR_AIN_1), MP_ROM_PTR(&pin_P0_03) }, { MP_ROM_QSTR(MP_QSTR_AIN_2), MP_ROM_PTR(&pin_P0_04) }, @@ -60,17 +60,17 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_NFC_1), MP_ROM_PTR(&pin_P0_09) }, { MP_ROM_QSTR(MP_QSTR_NFC_2), MP_ROM_PTR(&pin_P0_10) }, - + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_06) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_08) }, { MP_ROM_QSTR(MP_QSTR_CTS), MP_ROM_PTR(&pin_P0_07) }, { MP_ROM_QSTR(MP_QSTR_RTS), MP_ROM_PTR(&pin_P0_05) }, - + { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_P0_14) }, { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_P0_13) }, { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_P0_15) }, { MP_ROM_QSTR(MP_QSTR_LED_4), MP_ROM_PTR(&pin_P0_16) }, - + { MP_ROM_QSTR(MP_QSTR_SW1), MP_ROM_PTR(&pin_P0_11) }, { MP_ROM_QSTR(MP_QSTR_SW2), MP_ROM_PTR(&pin_P0_12) }, { MP_ROM_QSTR(MP_QSTR_SW3), MP_ROM_PTR(&pin_P0_24) }, From 83a27edd20de293927e8070da8585b11cb2f8ef7 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Wed, 8 Jul 2020 19:59:53 +0200 Subject: [PATCH 0260/1293] SAMD: make the brownout detection level configurable per board Not all boards have external flash or other components that make them require 2.7V -- sometimes we can get considerably longer battery life by decreasing this requirement. In particular, pewpew10 and pewpew_m4 are powered directly from battery, with no LDO, and should work fine down to 1.6V. --- ports/atmel-samd/boards/pewpew10/mpconfigboard.h | 2 ++ ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h | 3 +++ ports/atmel-samd/mpconfigport.h | 10 ++++++++++ ports/atmel-samd/supervisor/port.c | 6 +++--- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.h b/ports/atmel-samd/boards/pewpew10/mpconfigboard.h index 6b3b4aa15c..940e250b46 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.h +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.h @@ -43,3 +43,5 @@ #define DEFAULT_UART_BUS_RX (&pin_PA01) #define DEFAULT_UART_BUS_TX (&pin_PA00) + +#define BOARD_BROWNOUT_LEVEL (6) diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h index 60cd8d754f..7da5cf14c1 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h @@ -40,3 +40,6 @@ #define IGNORE_PIN_PB09 1 #define IGNORE_PIN_PB10 1 #define IGNORE_PIN_PB11 1 + +#define BOARD_BROWNOUT_LEVEL (6) +// 1.6V diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 354097ce41..3a5d4e1a2f 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -112,6 +112,11 @@ #define CIRCUITPY_DEFAULT_STACK_SIZE 4096 #endif +#ifndef BOARD_BROWNOUT_LEVEL ( +#define BOARD_BROWNLOUT_LEVEL (39) +// 2.77V with hysteresis off. Table 37.20 in datasheet. +#endif + // Smallest unit of flash that can be erased. #define FLASH_ERASE_SIZE NVMCTRL_ROW_SIZE @@ -129,6 +134,11 @@ #define CIRCUITPY_DEFAULT_STACK_SIZE (24*1024) #endif +#ifndef BOARD_BROWNOUT_LEVEL ( +#define BOARD_BROWNLOUT_LEVEL (200) +// 2.7V: 1.5V + LEVEL * 6mV. +#endif + // Smallest unit of flash that can be erased. #define FLASH_ERASE_SIZE NVMCTRL_BLOCK_SIZE diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index e892e6cde5..5b085dc81b 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -206,11 +206,11 @@ static void rtc_init(void) { safe_mode_t port_init(void) { #if defined(SAMD21) - // Set brownout detection to ~2.7V. Default from factory is 1.7V, + // Set brownout detection. Default from factory is 1.7V, // which is too low for proper operation of external SPI flash chips (they are 2.7-3.6V). // Disable while changing level. SYSCTRL->BOD33.bit.ENABLE = 0; - SYSCTRL->BOD33.bit.LEVEL = 39; // 2.77V with hysteresis off. Table 37.20 in datasheet. + SYSCTRL->BOD33.bit.LEVEL = BOARD_BROWNOUT_LEVEL; SYSCTRL->BOD33.bit.ENABLE = 1; #ifdef ENABLE_MICRO_TRACE_BUFFER @@ -229,7 +229,7 @@ safe_mode_t port_init(void) { // which is too low for proper operation of external SPI flash chips (they are 2.7-3.6V). // Disable while changing level. SUPC->BOD33.bit.ENABLE = 0; - SUPC->BOD33.bit.LEVEL = 200; // 2.7V: 1.5V + LEVEL * 6mV. + SUPC->BOD33.bit.LEVEL = BOARD_BROWNOUT_LEVEL; SUPC->BOD33.bit.ENABLE = 1; // MPU (Memory Protection Unit) setup. From 6d97f6fcccbf08a95242dfb5202a4e95825ee3f3 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 8 Jul 2020 20:31:35 -0500 Subject: [PATCH 0261/1293] audioio: Remove compatibility code These items were aliased from audiocore to audioio for compatibility with 4.x, but according to our deprecation schedule can be removed in 6.0. --- py/circuitpy_mpconfig.mk | 3 --- shared-bindings/audioio/__init__.c | 16 ---------------- 2 files changed, 19 deletions(-) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 302368f74a..84fb926b5e 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -45,9 +45,6 @@ CFLAGS += -DCIRCUITPY_AUDIOBUSIO=$(CIRCUITPY_AUDIOBUSIO) CIRCUITPY_AUDIOIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_AUDIOIO=$(CIRCUITPY_AUDIOIO) -CIRCUITPY_AUDIOIO_COMPAT ?= $(CIRCUITPY_AUDIOIO) -CFLAGS += -DCIRCUITPY_AUDIOIO_COMPAT=$(CIRCUITPY_AUDIOIO_COMPAT) - CIRCUITPY_AUDIOPWMIO ?= 0 CFLAGS += -DCIRCUITPY_AUDIOPWMIO=$(CIRCUITPY_AUDIOPWMIO) diff --git a/shared-bindings/audioio/__init__.c b/shared-bindings/audioio/__init__.c index 7ec927834f..a9c58e8645 100644 --- a/shared-bindings/audioio/__init__.c +++ b/shared-bindings/audioio/__init__.c @@ -33,15 +33,6 @@ #include "shared-bindings/audioio/__init__.h" #include "shared-bindings/audioio/AudioOut.h" -#if CIRCUITPY_AUDIOIO_COMPAT -#include "shared-bindings/audiomixer/Mixer.h" -#include "shared-bindings/audiocore/RawSample.h" -#include "shared-bindings/audiocore/WaveFile.h" -#endif -#if CIRCUITPY_AUDIOMIXER -#include "shared-bindings/audiomixer/Mixer.h" -#endif - //| """Support for audio output //| //| The `audioio` module contains classes to provide access to audio IO. @@ -62,13 +53,6 @@ STATIC const mp_rom_map_elem_t audioio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_audioio) }, { MP_ROM_QSTR(MP_QSTR_AudioOut), MP_ROM_PTR(&audioio_audioout_type) }, -#if CIRCUITPY_AUDIOIO_COMPAT - #if CIRCUITPY_AUDIOMIXER - { MP_ROM_QSTR(MP_QSTR_Mixer), MP_ROM_PTR(&audiomixer_mixer_type) }, - #endif - { MP_ROM_QSTR(MP_QSTR_RawSample), MP_ROM_PTR(&audioio_rawsample_type) }, - { MP_ROM_QSTR(MP_QSTR_WaveFile), MP_ROM_PTR(&audioio_wavefile_type) }, -#endif }; STATIC MP_DEFINE_CONST_DICT(audioio_module_globals, audioio_module_globals_table); From bb5cdcf9548d2a25a2aabf70e592f624c98bbec5 Mon Sep 17 00:00:00 2001 From: arms22 Date: Thu, 9 Jul 2020 11:26:45 +0900 Subject: [PATCH 0262/1293] Add new board BLE-SS dev board Multi Sensor --- .github/workflows/build.yml | 1 + .../bless_dev_board_multi_sensor/board.c | 12 +++++ .../mpconfigboard.h | 17 +++++++ .../mpconfigboard.mk | 8 ++++ .../bless_dev_board_multi_sensor/pins.c | 45 +++++++++++++++++++ 5 files changed, 83 insertions(+) create mode 100644 ports/nrf/boards/bless_dev_board_multi_sensor/board.c create mode 100644 ports/nrf/boards/bless_dev_board_multi_sensor/mpconfigboard.h create mode 100644 ports/nrf/boards/bless_dev_board_multi_sensor/mpconfigboard.mk create mode 100644 ports/nrf/boards/bless_dev_board_multi_sensor/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa3aee4a5d..adefa8b132 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -142,6 +142,7 @@ jobs: - "arduino_zero" - "bast_pro_mini_m0" - "bdmicro_vina_m0" + - "bless_dev_board_multi_sensor" - "capablerobot_usbhub" - "catwan_usbstick" - "circuitbrains_basic_m0" diff --git a/ports/nrf/boards/bless_dev_board_multi_sensor/board.c b/ports/nrf/boards/bless_dev_board_multi_sensor/board.c new file mode 100644 index 0000000000..71b9a06577 --- /dev/null +++ b/ports/nrf/boards/bless_dev_board_multi_sensor/board.c @@ -0,0 +1,12 @@ +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/nrf/boards/bless_dev_board_multi_sensor/mpconfigboard.h b/ports/nrf/boards/bless_dev_board_multi_sensor/mpconfigboard.h new file mode 100644 index 0000000000..7fffd86ccd --- /dev/null +++ b/ports/nrf/boards/bless_dev_board_multi_sensor/mpconfigboard.h @@ -0,0 +1,17 @@ +#include "nrfx/hal/nrf_gpio.h" + +#define MICROPY_HW_BOARD_NAME "BLE-SS dev board Multi Sensor" +#define MICROPY_HW_MCU_NAME "nRF52840" +#define MICROPY_HW_LED_STATUS (&pin_P0_07) + +#define DEFAULT_I2C_BUS_SCL (&pin_P0_26) +#define DEFAULT_I2C_BUS_SDA (&pin_P0_24) + +#define DEFAULT_SPI_BUS_SCK (&pin_P0_13) /* n.c */ +#define DEFAULT_SPI_BUS_MOSI (&pin_P0_14) /* n.c */ +#define DEFAULT_SPI_BUS_MISO (&pin_P0_15) /* n.c */ + +#define DEFAULT_UART_BUS_RX (&pin_P0_02) /* TP7 */ +#define DEFAULT_UART_BUS_TX (&pin_P0_03) /* TP6 */ + +/* Note: Flash chip is not provided. */ diff --git a/ports/nrf/boards/bless_dev_board_multi_sensor/mpconfigboard.mk b/ports/nrf/boards/bless_dev_board_multi_sensor/mpconfigboard.mk new file mode 100644 index 0000000000..90b0908505 --- /dev/null +++ b/ports/nrf/boards/bless_dev_board_multi_sensor/mpconfigboard.mk @@ -0,0 +1,8 @@ +USB_VID = 0x2786 +USB_PID = 0x9207 +USB_PRODUCT = "BLE-SS dev board Multi Sensor" +USB_MANUFACTURER = "Switch Science, Inc." + +MCU_CHIP = nrf52840 + +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/bless_dev_board_multi_sensor/pins.c b/ports/nrf/boards/bless_dev_board_multi_sensor/pins.c new file mode 100644 index 0000000000..c6010a8c33 --- /dev/null +++ b/ports/nrf/boards/bless_dev_board_multi_sensor/pins.c @@ -0,0 +1,45 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P0_02) }, // TP7 + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P0_03) }, // TP6 + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P0_04) }, // LED1 + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P0_05) }, // U2-BMX055-INT1 + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P0_06) }, // U2-BMX055-DRDYM + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P0_07) }, // LED2 + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P0_08) }, // U4-HDC2010-DRDY/INT + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_09) }, // TP1 + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_P0_10) }, // U3-LPS22HB-INT_DRDY + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P0_12) }, // S2 + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_P0_23) }, // BZ1 + { MP_ROM_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_P0_28) }, // U2-BMX055-INT4 + { MP_ROM_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_P0_29) }, // U2-BMX055-INT3 + { MP_ROM_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_P0_30) }, // U2-BMX055-INT5 + { MP_ROM_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_P0_31) }, // S1 + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_02) }, // A0/TP7 + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_03) }, // A1/TP6 + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_24) }, // 24 - SDA + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_26) }, // 26 - SCL + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_13) }, // 13 - MISO (n.c) + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_14) }, // 14 - MOSI (n.c) + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_15) }, // 15 - SCK (n.c) + + { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_P0_07) }, // 4 - LED1 + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_P0_04) }, // 7 - LED2 + + { MP_ROM_QSTR(MP_QSTR_BUTTON1), MP_ROM_PTR(&pin_P0_31) }, // 31 - S1 + { MP_ROM_QSTR(MP_QSTR_BUTTON2), MP_ROM_PTR(&pin_P0_12) }, // 12 - S2 + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_02) }, // 2 - UART RX + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_03) }, // 3 - UART TX + + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_QWIIC), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From f03045b97e7fa9c1b65f5d457036aec1f451f3da Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 8 Jul 2020 23:15:48 -0400 Subject: [PATCH 0263/1293] address working; improved pkt dump --- devices/ble_hci/common-hal/_bleio/Adapter.c | 22 +- devices/ble_hci/common-hal/_bleio/Adapter.h | 11 +- .../ble_hci/common-hal/_bleio/Connection.c | 2 +- devices/ble_hci/common-hal/_bleio/__init__.c | 53 +- devices/ble_hci/common-hal/_bleio/__init__.h | 4 +- devices/ble_hci/common-hal/_bleio/hci_api.c | 96 +- devices/ble_hci/common-hal/_bleio/hci_api.h | 20 +- .../common-hal/_bleio/hci_include/#hci.h# | 1775 ----------------- shared-bindings/_bleio/Adapter.c | 25 +- shared-bindings/_bleio/Adapter.h | 2 +- 10 files changed, 148 insertions(+), 1862 deletions(-) delete mode 100644 devices/ble_hci/common-hal/_bleio/hci_include/#hci.h# diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index 9dbeca68f5..c08eb2db40 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -179,10 +179,10 @@ char default_ble_name[] = { 'C', 'I', 'R', 'C', 'U', 'I', 'T', 'P', 'Y', 0, 0, 0 // common_hal_bleio_adapter_set_name(self, (char*) default_ble_name); // } -void common_hal_bleio_adapter_hci_init(bleio_adapter_obj_t *self, busio_uart_obj_t *uart, const mcu_pin_obj_t *rts, const mcu_pin_obj_t *cts) { +void common_hal_bleio_adapter_hci_uart_init(bleio_adapter_obj_t *self, busio_uart_obj_t *uart, digitalio_digitalinout_obj_t *rts, digitalio_digitalinout_obj_t *cts) { self->hci_uart = uart; - self->rts_pin = rts; - self->cts_pin = cts; + self->rts_digitalinout = rts; + self->cts_digitalinout = cts; self->enabled = false; } @@ -194,16 +194,6 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable return; } - if (enabled) { - common_hal_digitalio_digitalinout_construct(&self->rts_digitalinout, self->rts_pin); - common_hal_digitalio_digitalinout_construct(&self->cts_digitalinout, self->cts_pin); - - hci_init(self); - } else { - common_hal_digitalio_digitalinout_deinit(&self->rts_digitalinout); - common_hal_digitalio_digitalinout_deinit(&self->cts_digitalinout); - } - //FIX enable/disable HCI adapter, but don't reset it, since we don't know how. self->enabled = enabled; } @@ -213,13 +203,13 @@ bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self) { } bleio_address_obj_t *common_hal_bleio_adapter_get_address(bleio_adapter_obj_t *self) { - bt_addr_le_t addr; - hci_read_bd_addr(&addr.a); + bt_addr_t addr; + check_hci_error(hci_read_bd_addr(&addr)); bleio_address_obj_t *address = m_new_obj(bleio_address_obj_t); address->base.type = &bleio_address_type; - common_hal_bleio_address_construct(address, addr.a.val, addr.type); + common_hal_bleio_address_construct(address, addr.val, BT_ADDR_LE_PUBLIC); return address; } diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.h b/devices/ble_hci/common-hal/_bleio/Adapter.h index 73b9fed0b0..dbec03bd84 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.h +++ b/devices/ble_hci/common-hal/_bleio/Adapter.h @@ -36,7 +36,6 @@ #include "shared-bindings/_bleio/ScanResults.h" #include "shared-bindings/busio/UART.h" #include "shared-bindings/digitalio/DigitalInOut.h" -#include "shared-bindings/microcontroller/Pin.h" #ifndef BLEIO_TOTAL_CONNECTION_COUNT #define BLEIO_TOTAL_CONNECTION_COUNT 5 @@ -44,19 +43,17 @@ extern bleio_connection_internal_t bleio_connections[BLEIO_TOTAL_CONNECTION_COUNT]; -typedef struct { +typedef struct _bleio_adapter_obj_t { mp_obj_base_t base; uint8_t* advertising_data; uint8_t* scan_response_data; uint8_t* current_advertising_data; - bleio_scanresults_obj_t* scan_results; + bleio_scanresults_obj_t *scan_results; mp_obj_t name; mp_obj_tuple_t *connection_objs; busio_uart_obj_t* hci_uart; - const mcu_pin_obj_t* rts_pin; - const mcu_pin_obj_t* cts_pin; - digitalio_digitalinout_obj_t rts_digitalinout; - digitalio_digitalinout_obj_t cts_digitalinout; + digitalio_digitalinout_obj_t *rts_digitalinout; + digitalio_digitalinout_obj_t *cts_digitalinout; bool enabled; } bleio_adapter_obj_t; diff --git a/devices/ble_hci/common-hal/_bleio/Connection.c b/devices/ble_hci/common-hal/_bleio/Connection.c index 913f120feb..6b528552ae 100644 --- a/devices/ble_hci/common-hal/_bleio/Connection.c +++ b/devices/ble_hci/common-hal/_bleio/Connection.c @@ -356,7 +356,7 @@ void common_hal_bleio_connection_pair(bleio_connection_internal_t *self, bool bo if (mp_hal_is_interrupted()) { return; } - check_sec_status(self->sec_status); + //FIX check_sec_status(self->sec_status); } mp_float_t common_hal_bleio_connection_get_connection_interval(bleio_connection_internal_t *self) { diff --git a/devices/ble_hci/common-hal/_bleio/__init__.c b/devices/ble_hci/common-hal/_bleio/__init__.c index a09c3a05c5..e32ca55ec8 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.c +++ b/devices/ble_hci/common-hal/_bleio/__init__.c @@ -38,25 +38,41 @@ #include "shared-bindings/_bleio/UUID.h" #include "supervisor/shared/bluetooth.h" -#include "common-hal/_bleio/__init__.h" +void check_hci_error(hci_result_t result) { + switch (result) { + case HCI_OK: + return; -//FIX to check HCI error -// void check_nrf_error(uint32_t err_code) { -// if (err_code == NRF_SUCCESS) { -// return; -// } -// switch (err_code) { -// case NRF_ERROR_TIMEOUT: -// mp_raise_msg(&mp_type_TimeoutError, NULL); -// return; -// case BLE_ERROR_INVALID_CONN_HANDLE: -// mp_raise_bleio_ConnectionError(translate("Not connected")); -// return; -// default: -// mp_raise_bleio_BluetoothError(translate("Unknown soft device error: %04x"), err_code); -// break; -// } -// } + case HCI_NO_RESPONSE: + mp_raise_bleio_BluetoothError(translate("No HCI command response received")); + return; + + case HCI_READ_TIMEOUT: + mp_raise_bleio_BluetoothError(translate("Timeout waiting for HCI response")); + return; + + case HCI_WRITE_TIMEOUT: + mp_raise_bleio_BluetoothError(translate("Timeout waiting to write HCI request")); + return; + + case HCI_READ_ERROR: + mp_raise_bleio_BluetoothError(translate("Error reading from HCI adapter")); + return; + + case HCI_WRITE_ERROR: + mp_raise_bleio_BluetoothError(translate("Error writing to HCI adapter")); + return; + + default: + // Should be an HCI status error, > 0. + if (result > 0) { + mp_raise_bleio_BluetoothError(translate("HCI status error: %02x"), result); + } else { + mp_raise_bleio_BluetoothError(translate("Unknown hci_result_t: %d"), result); + } + return; + } +} // void check_gatt_status(uint16_t gatt_status) { // if (gatt_status == BLE_GATT_STATUS_SUCCESS) { @@ -104,7 +120,6 @@ void bleio_reset() { } // The singleton _bleio.Adapter object, bound to _bleio.adapter -// It currently only has properties and no state bleio_adapter_obj_t common_hal_bleio_adapter_obj = { .base = { .type = &bleio_adapter_type, diff --git a/devices/ble_hci/common-hal/_bleio/__init__.h b/devices/ble_hci/common-hal/_bleio/__init__.h index 784dcefdcb..00f5e0c68c 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.h +++ b/devices/ble_hci/common-hal/_bleio/__init__.h @@ -29,6 +29,8 @@ #include +#include "hci_api.h" + void bleio_reset(void); typedef struct { @@ -49,7 +51,7 @@ typedef struct { // These helpers raise the appropriate exceptions if the code doesn't equal success. -void check_nrf_error(uint32_t err_code); +void check_hci_error(hci_result_t result); void check_gatt_status(uint16_t gatt_status); void check_sec_status(uint8_t sec_status); diff --git a/devices/ble_hci/common-hal/_bleio/hci_api.c b/devices/ble_hci/common-hal/_bleio/hci_api.c index 180ab6f5ec..a82c0c93ca 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_api.c +++ b/devices/ble_hci/common-hal/_bleio/hci_api.c @@ -14,6 +14,8 @@ #include "hci_api.h" +#include "py/obj.h" + // Zephyr include files to define HCI communication values and structs. #include "hci_include/hci.h" #include "hci_include/hci_err.h" @@ -21,6 +23,8 @@ #include #include "supervisor/shared/tick.h" +#include "shared-bindings/_bleio/__init__.h" +#include "common-hal/_bleio/Adapter.h" // HCI H4 protocol packet types: first byte in the packet. #define H4_CMD 0x01 @@ -31,13 +35,15 @@ //FIX replace #define ATT_CID 0x0004 +#define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER)) + #define RX_BUFFER_SIZE (3 + 255) #define ACL_PKT_BUFFER_SIZE (255) #define CTS_TIMEOUT_MSECS (1000) #define RESPONSE_TIMEOUT_MSECS (1000) -STATIC bleio_adapter_obj_t *adapter; +#define adapter (&common_hal_bleio_adapter_obj) STATIC uint8_t rx_buffer[RX_BUFFER_SIZE]; STATIC size_t rx_idx; @@ -81,12 +87,55 @@ typedef struct __attribute__ ((packed)) { } h4_hci_evt_hdr_t; - -STATIC void dump_pkt(const char* prefix, uint8_t pkt_len, uint8_t pkt_data[]) { +STATIC void dump_cmd_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { if (debug) { - mp_printf(&mp_plat_print, "%s", prefix); - for (uint8_t i = 0; i < pkt_len; i++) { - mp_printf(&mp_plat_print, "%02x", pkt_data[i]); + h4_hci_cmd_hdr_t *pkt = (h4_hci_cmd_hdr_t *) pkt_data; + mp_printf(&mp_plat_print, + "%s HCI COMMAND (%x) opcode: %04x, len: %d, data: ", + tx ? "TX->" : "RX<-", + pkt->pkt_type, pkt->opcode, pkt->param_len); + uint8_t i; + for (i = sizeof(h4_hci_cmd_hdr_t); i < pkt_len; i++) { + mp_printf(&mp_plat_print, "%02x ", pkt_data[i]); + } + if (i != pkt->param_len + sizeof(h4_hci_cmd_hdr_t)) { + mp_printf(&mp_plat_print, " LENGTH MISMATCH"); + } + mp_printf(&mp_plat_print, "\n"); + } +} + +STATIC void dump_acl_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { + if (debug) { + h4_hci_acl_hdr_t *pkt = (h4_hci_acl_hdr_t *) pkt_data; + mp_printf(&mp_plat_print, + "%s HCI ACLDATA (%x) handle: %04x, total_data_len: %d, acl_data_len: %d, cid: %04x, data: ", + tx ? "TX->" : "RX<-", + pkt->pkt_type, pkt->handle, pkt->total_data_len, pkt->acl_data_len, pkt->cid); + uint8_t i; + for (i = sizeof(h4_hci_acl_hdr_t); i < pkt_len; i++) { + mp_printf(&mp_plat_print, "%02x ", pkt_data[i]); + } + if (i != pkt->acl_data_len + sizeof(h4_hci_acl_hdr_t)) { + mp_printf(&mp_plat_print, " LENGTH MISMATCH"); + } + mp_printf(&mp_plat_print, "\n"); + } +} + +STATIC void dump_evt_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { + if (debug) { + h4_hci_evt_hdr_t *pkt = (h4_hci_evt_hdr_t *) pkt_data; + mp_printf(&mp_plat_print, + "%s HCI EVENT (%x) evt: %02x, param_len: %d, data: ", + tx ? "TX->" : "RX<-", + pkt->pkt_type, pkt->evt, pkt->param_len); + uint8_t i; + for (i = sizeof(h4_hci_evt_hdr_t); i < pkt_len; i++) { + mp_printf(&mp_plat_print, "%02x ", pkt_data[i]); + } + if (i != pkt->param_len + sizeof(h4_hci_evt_hdr_t)) { + mp_printf(&mp_plat_print, " LENGTH MISMATCH"); } mp_printf(&mp_plat_print, "\n"); } @@ -184,9 +233,11 @@ STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt[]) cmd_response_received = true; cmd_response_opcode = evt->cmd_complete.opcode; cmd_response_status = evt->cc_status.status; - // All the bytes following status. - cmd_response_data = &evt_data[sizeof(struct cmd_complete_with_status)]; - cmd_response_len = evt_hdr->param_len - sizeof(struct cmd_complete_with_status); + // All the bytes following cmd_complete, -including- the status byte, which is + // included in all the _bt_hci_rp_* structs. + cmd_response_data = &evt_data[sizeof_field(struct cmd_complete_with_status, cmd_complete)]; + // Includes status byte. + cmd_response_len = evt_hdr->param_len - sizeof_field(struct cmd_complete_with_status, cmd_complete); break; } @@ -265,15 +316,14 @@ STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt[]) } } -void hci_init(bleio_adapter_obj_t *adapter_in) { - adapter = adapter_in; +void hci_init(void) { rx_idx = 0; pending_pkt = 0; } hci_result_t hci_poll_for_incoming_pkt(void) { // Assert RTS low to say we're ready to read data. - common_hal_digitalio_digitalinout_set_value(&adapter->rts_digitalinout, false); + common_hal_digitalio_digitalinout_set_value(adapter->rts_digitalinout, false); int errcode = 0; bool packet_is_complete = false; @@ -281,7 +331,7 @@ hci_result_t hci_poll_for_incoming_pkt(void) { // Read bytes until we run out, or accumulate a complete packet. while (common_hal_busio_uart_rx_characters_available(adapter->hci_uart)) { common_hal_busio_uart_read(adapter->hci_uart, rx_buffer + rx_idx, 1, &errcode); - if (!errcode) { + if (errcode) { return HCI_READ_ERROR; } rx_idx++; @@ -313,14 +363,15 @@ hci_result_t hci_poll_for_incoming_pkt(void) { } // Stop incoming data while processing packet. - common_hal_digitalio_digitalinout_set_value(&adapter->rts_digitalinout, true); + common_hal_digitalio_digitalinout_set_value(adapter->rts_digitalinout, true); size_t pkt_len = rx_idx; + // Reset for next pack rx_idx = 0; switch (rx_buffer[0]) { case H4_ACL: if (debug) { - dump_pkt("HCI EVENT RX <- ", rx_idx, rx_buffer); + dump_acl_pkt(false, pkt_len, rx_buffer); } process_acl_data_pkt(pkt_len, rx_buffer); @@ -328,7 +379,7 @@ hci_result_t hci_poll_for_incoming_pkt(void) { case H4_EVT: if (debug) { - dump_pkt("HCI ACLDATA RX <- ", rx_idx, rx_buffer); + dump_evt_pkt(false, pkt_len, rx_buffer); } process_evt_pkt(pkt_len, rx_buffer); @@ -338,7 +389,7 @@ hci_result_t hci_poll_for_incoming_pkt(void) { break; } - common_hal_digitalio_digitalinout_set_value(&adapter->rts_digitalinout, true); + common_hal_digitalio_digitalinout_set_value(adapter->rts_digitalinout, true); return HCI_OK; } @@ -348,7 +399,8 @@ hci_result_t hci_poll_for_incoming_pkt(void) { STATIC hci_result_t write_pkt(uint8_t *buffer, size_t len) { // Wait for CTS to go low before writing to HCI adapter. uint64_t start = supervisor_ticks_ms64(); - while (common_hal_digitalio_digitalinout_get_value(&adapter->cts_digitalinout)) { + + while (common_hal_digitalio_digitalinout_get_value(adapter->cts_digitalinout)) { RUN_BACKGROUND_TASKS; if (supervisor_ticks_ms64() - start > CTS_TIMEOUT_MSECS) { return HCI_WRITE_TIMEOUT; @@ -377,7 +429,7 @@ STATIC hci_result_t send_command(uint16_t opcode, uint8_t params_len, void* para memcpy(&tx_buffer[sizeof(h4_hci_cmd_hdr_t)], params, params_len); if (debug) { - dump_pkt("HCI COMMAND TX -> ", sizeof(tx_buffer), tx_buffer); + dump_cmd_pkt(true, sizeof(tx_buffer), tx_buffer); } int result = write_pkt(tx_buffer, sizeof(h4_hci_cmd_hdr_t) + params_len); @@ -426,7 +478,7 @@ STATIC int __attribute__((unused)) send_acl_pkt(uint16_t handle, uint8_t cid, vo } // data_len does not include cid. - const size_t cid_len = sizeof(((h4_hci_acl_hdr_t *)0)->cid); + const size_t cid_len = sizeof_field(h4_hci_acl_hdr_t, cid); // buf_len is size of entire packet including header. const size_t buf_len = sizeof(h4_hci_acl_hdr_t) + cid_len + data_len; uint8_t tx_buffer[buf_len]; @@ -441,7 +493,7 @@ STATIC int __attribute__((unused)) send_acl_pkt(uint16_t handle, uint8_t cid, vo memcpy(&tx_buffer[sizeof(h4_hci_acl_hdr_t)], data, data_len); if (debug) { - dump_pkt("HCI ACLDATA TX -> ", buf_len, tx_buffer); + dump_acl_pkt(true, buf_len, tx_buffer); } pending_pkt++; @@ -478,7 +530,7 @@ hci_result_t hci_read_bd_addr(bt_addr_t *addr) { int result = send_command(BT_HCI_OP_READ_BD_ADDR, 0, NULL); if (result == HCI_OK) { struct bt_hci_rp_read_bd_addr *response = (struct bt_hci_rp_read_bd_addr *) cmd_response_data; - memcpy(addr->val, response->bdaddr.val, sizeof(bt_addr_t)); + memcpy(addr->val, response->bdaddr.val, sizeof_field(bt_addr_t, val)); } return result; diff --git a/devices/ble_hci/common-hal/_bleio/hci_api.h b/devices/ble_hci/common-hal/_bleio/hci_api.h index a2235ec8c1..303f26ba5e 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_api.h +++ b/devices/ble_hci/common-hal/_bleio/hci_api.h @@ -17,27 +17,27 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_HCI_H -#define MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_HCI_H +#ifndef MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_HCI_API_H +#define MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_HCI_API_H #include #include "common-hal/_bleio/hci_include/hci.h" -#include "common-hal/_bleio/Adapter.h" +// Incomplete forward declaration to get around mutually-dependent include files. +typedef struct _bleio_adapter_obj_t bleio_adapter_obj_t; // An hci_result_t is one of the HCI_x values below, // or is it > 0 and is an HCI command status value (see hci_include/hci_err.h) typedef int hci_result_t; #define HCI_OK (0) #define HCI_NO_RESPONSE (-1) -#define HCI_ERR_RESPONSE (-2) -#define HCI_READ_TIMEOUT (-3) -#define HCI_WRITE_TIMEOUT (-4) -#define HCI_READ_ERROR (-5) -#define HCI_WRITE_ERROR (-6) +#define HCI_READ_TIMEOUT (-2) +#define HCI_WRITE_TIMEOUT (-3) +#define HCI_READ_ERROR (-4) +#define HCI_WRITE_ERROR (-5) -void hci_init(bleio_adapter_obj_t *adapter_in); +void hci_init(void); hci_result_t hci_disconnect(uint16_t handle); @@ -66,4 +66,4 @@ hci_result_t hci_reset(void); hci_result_t hci_set_evt_mask(uint64_t event_mask); -#endif // MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_HCI_H +#endif // MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_HCI_API_H diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/#hci.h# b/devices/ble_hci/common-hal/_bleio/hci_include/#hci.h# deleted file mode 100644 index 942a82a3c6..0000000000 --- a/devices/ble_hci/common-hal/_bleio/hci_include/#hci.h# +++ /dev/null @@ -1,1775 +0,0 @@ -/* hci.h - Bluetooth Host Control Interface definitions */ - -/* - * Copyright (c) 2015-2016 Intel Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ -#ifndef ZEPHYR_INCLUDE_BLUETOOTH_HCI_H_ -#define ZEPHYR_INCLUDE_BLUETOOTH_HCI_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Special own address types for LL privacy (used in adv & scan parameters) */ -#define BT_HCI_OWN_ADDR_RPA_OR_PUBLIC 0x02 -#define BT_HCI_OWN_ADDR_RPA_OR_RANDOM 0x03 -#define BT_HCI_OWN_ADDR_RPA_MASK 0x02 - -#define BT_HCI_PEER_ADDR_RPA_UNRESOLVED 0xfe -#define BT_HCI_PEER_ADDR_ANONYMOUS 0xff - -#define BT_ENC_KEY_SIZE_MIN 0x07 -#define BT_ENC_KEY_SIZE_MAX 0x10 - -struct bt_hci_evt_hdr { - uint8_t evt; - uint8_t len; -} __packed; -#define BT_HCI_EVT_HDR_SIZE 2 - -#define BT_ACL_START_NO_FLUSH 0x00 -#define BT_ACL_CONT 0x01 -#define BT_ACL_START 0x02 -#define BT_ACL_COMPLETE 0x03 - -#define BT_ACL_POINT_TO_POINT 0x00 -#define BT_ACL_BROADCAST 0x01 - -#define bt_acl_handle(h) ((h) & BIT_MASK(12)) -#define bt_acl_flags(h) ((h) >> 12) -#define bt_acl_flags_pb(f) ((f) & BIT_MASK(2)) -#define bt_acl_flags_bc(f) ((f) >> 2) -#define bt_acl_handle_pack(h, f) ((h) | ((f) << 12)) - -struct bt_hci_acl_hdr { - uint16_t handle; - uint16_t len; -} __packed; -#define BT_HCI_ACL_HDR_SIZE 4 - -struct bt_hci_cmd_hdr { - uint16_t opcode; - uint8_t param_len; -} __packed; -#define BT_HCI_CMD_HDR_SIZE 3 - -/* Supported Commands */ -#define BT_CMD_TEST(cmd, octet, bit) (cmd[octet] & BIT(bit)) -#define BT_CMD_LE_STATES(cmd) BT_CMD_TEST(cmd, 28, 3) - -#define BT_FEAT_TEST(feat, page, octet, bit) (feat[page][octet] & BIT(bit)) - -#define BT_FEAT_BREDR(feat) !BT_FEAT_TEST(feat, 0, 4, 5) -#define BT_FEAT_LE(feat) BT_FEAT_TEST(feat, 0, 4, 6) -#define BT_FEAT_EXT_FEATURES(feat) BT_FEAT_TEST(feat, 0, 7, 7) -#define BT_FEAT_HOST_SSP(feat) BT_FEAT_TEST(feat, 1, 0, 0) -#define BT_FEAT_SC(feat) BT_FEAT_TEST(feat, 2, 1, 0) - -#define BT_FEAT_LMP_ESCO_CAPABLE(feat) BT_FEAT_TEST(feat, 0, 3, 7) -#define BT_FEAT_HV2_PKT(feat) BT_FEAT_TEST(feat, 0, 1, 4) -#define BT_FEAT_HV3_PKT(feat) BT_FEAT_TEST(feat, 0, 1, 5) -#define BT_FEAT_EV4_PKT(feat) BT_FEAT_TEST(feat, 0, 4, 0) -#define BT_FEAT_EV5_PKT(feat) BT_FEAT_TEST(feat, 0, 4, 1) -#define BT_FEAT_2EV3_PKT(feat) BT_FEAT_TEST(feat, 0, 5, 5) -#define BT_FEAT_3EV3_PKT(feat) BT_FEAT_TEST(feat, 0, 5, 6) -#define BT_FEAT_3SLOT_PKT(feat) BT_FEAT_TEST(feat, 0, 5, 7) - -/* LE features */ -#define BT_LE_FEAT_BIT_ENC 0 -#define BT_LE_FEAT_BIT_CONN_PARAM_REQ 1 -#define BT_LE_FEAT_BIT_EXT_REJ_IND 2 -#define BT_LE_FEAT_BIT_SLAVE_FEAT_REQ 3 -#define BT_LE_FEAT_BIT_PING 4 -#define BT_LE_FEAT_BIT_DLE 5 -#define BT_LE_FEAT_BIT_PRIVACY 6 -#define BT_LE_FEAT_BIT_EXT_SCAN 7 -#define BT_LE_FEAT_BIT_PHY_2M 8 -#define BT_LE_FEAT_BIT_SMI_TX 9 -#define BT_LE_FEAT_BIT_SMI_RX 10 -#define BT_LE_FEAT_BIT_PHY_CODED 11 -#define BT_LE_FEAT_BIT_EXT_ADV 12 -#define BT_LE_FEAT_BIT_PER_ADV 13 -#define BT_LE_FEAT_BIT_CHAN_SEL_ALGO_2 14 -#define BT_LE_FEAT_BIT_PWR_CLASS_1 15 -#define BT_LE_FEAT_BIT_MIN_USED_CHAN_PROC 16 -#define BT_LE_FEAT_BIT_CONN_CTE_REQ 17 -#define BT_LE_FEAT_BIT_CONN_CTE_RESP 18 -#define BT_LE_FEAT_BIT_CONNECTIONLESS_CTE_TX 19 -#define BT_LE_FEAT_BIT_CONNECTIONLESS_CTE_RX 20 -#define BT_LE_FEAT_BIT_ANT_SWITCH_TX_AOD 21 -#define BT_LE_FEAT_BIT_ANT_SWITCH_RX_AOA 22 -#define BT_LE_FEAT_BIT_RX_CTE 23 -#define BT_LE_FEAT_BIT_PERIODIC_SYNC_XFER_SEND 24 -#define BT_LE_FEAT_BIT_PERIODIC_SYNC_XFER_RECV 25 -#define BT_LE_FEAT_BIT_SCA_UPDATE 26 -#define BT_LE_FEAT_BIT_REMOTE_PUB_KEY_VALIDATE 27 -#define BT_LE_FEAT_BIT_CIS_MASTER 28 -#define BT_LE_FEAT_BIT_CIS_SLAVE 29 -#define BT_LE_FEAT_BIT_ISO_BROADCASTER 30 -#define BT_LE_FEAT_BIT_SYNC_RECEIVER 31 -#define BT_LE_FEAT_BIT_ISO_CHANNELS 32 -#define BT_LE_FEAT_BIT_PWR_CTRL_REQ 33 -#define BT_LE_FEAT_BIT_PWR_CHG_IND 34 -#define BT_LE_FEAT_BIT_PATH_LOSS_MONITOR 35 - -#define BT_LE_FEAT_TEST(feat, n) (feat[(n) >> 3] & \ - BIT((n) & 7)) - -#define BT_FEAT_LE_ENCR(feat) BT_LE_FEAT_TEST(feat, \ - BT_LE_FEAT_BIT_ENC) -#define BT_FEAT_LE_CONN_PARAM_REQ_PROC(feat) BT_LE_FEAT_TEST(feat, \ - BT_LE_FEAT_BIT_CONN_PARAM_REQ) -#define BT_FEAT_LE_SLAVE_FEATURE_XCHG(feat) BT_LE_FEAT_TEST(feat, \ - BT_LE_FEAT_BIT_SLAVE_FEAT_REQ) -#define BT_FEAT_LE_DLE(feat) BT_LE_FEAT_TEST(feat, \ - BT_LE_FEAT_BIT_DLE) -#define BT_FEAT_LE_PHY_2M(feat) BT_LE_FEAT_TEST(feat, \ - BT_LE_FEAT_BIT_PHY_2M) -#define BT_FEAT_LE_PHY_CODED(feat) BT_LE_FEAT_TEST(feat, \ - BT_LE_FEAT_BIT_PHY_CODED) -#define BT_FEAT_LE_PRIVACY(feat) BT_LE_FEAT_TEST(feat, \ - BT_LE_FEAT_BIT_PRIVACY) -#define BT_FEAT_LE_EXT_ADV(feat) BT_LE_FEAT_TEST(feat, \ - BT_LE_FEAT_BIT_EXT_ADV) - -/* LE States */ -#define BT_LE_STATES_SLAVE_CONN_ADV(states) (states & 0x0000004000000000) - -/* Bonding/authentication types */ -#define BT_HCI_NO_BONDING 0x00 -#define BT_HCI_NO_BONDING_MITM 0x01 -#define BT_HCI_DEDICATED_BONDING 0x02 -#define BT_HCI_DEDICATED_BONDING_MITM 0x03 -#define BT_HCI_GENERAL_BONDING 0x04 -#define BT_HCI_GENERAL_BONDING_MITM 0x05 - -/* - * MITM protection is enabled in SSP authentication requirements octet when - * LSB bit is set. - */ -#define BT_MITM 0x01 - -/* I/O capabilities */ -#define BT_IO_DISPLAY_ONLY 0x00 -#define BT_IO_DISPLAY_YESNO 0x01 -#define BT_IO_KEYBOARD_ONLY 0x02 -#define BT_IO_NO_INPUT_OUTPUT 0x03 - -/* SCO packet types */ -#define HCI_PKT_TYPE_HV1 0x0020 -#define HCI_PKT_TYPE_HV2 0x0040 -#define HCI_PKT_TYPE_HV3 0x0080 - -/* eSCO packet types */ -#define HCI_PKT_TYPE_ESCO_HV1 0x0001 -#define HCI_PKT_TYPE_ESCO_HV2 0x0002 -#define HCI_PKT_TYPE_ESCO_HV3 0x0004 -#define HCI_PKT_TYPE_ESCO_EV3 0x0008 -#define HCI_PKT_TYPE_ESCO_EV4 0x0010 -#define HCI_PKT_TYPE_ESCO_EV5 0x0020 -#define HCI_PKT_TYPE_ESCO_2EV3 0x0040 -#define HCI_PKT_TYPE_ESCO_3EV3 0x0080 -#define HCI_PKT_TYPE_ESCO_2EV5 0x0100 -#define HCI_PKT_TYPE_ESCO_3EV5 0x0200 - - -#define ESCO_PKT_MASK (HCI_PKT_TYPE_ESCO_HV1 | \ - HCI_PKT_TYPE_ESCO_HV2 | \ - HCI_PKT_TYPE_ESCO_HV3) -#define SCO_PKT_MASK (HCI_PKT_TYPE_HV1 | \ - HCI_PKT_TYPE_HV2 | \ - HCI_PKT_TYPE_HV3) -#define EDR_ESCO_PKT_MASK (HCI_PKT_TYPE_ESCO_2EV3 | \ - HCI_PKT_TYPE_ESCO_3EV3 | \ - HCI_PKT_TYPE_ESCO_2EV5 | \ - HCI_PKT_TYPE_ESCO_3EV5) - -/* HCI BR/EDR link types */ -#define BT_HCI_SCO 0x00 -#define BT_HCI_ACL 0x01 -#define BT_HCI_ESCO 0x02 - -/* OpCode Group Fields */ -#define BT_OGF_LINK_CTRL 0x01 -#define BT_OGF_BASEBAND 0x03 -#define BT_OGF_INFO 0x04 -#define BT_OGF_STATUS 0x05 -#define BT_OGF_LE 0x08 -#define BT_OGF_VS 0x3f - -/* Construct OpCode from OGF and OCF */ -#define BT_OP(ogf, ocf) ((ocf) | ((ogf) << 10)) - -/* Invalid opcode */ -#define BT_OP_NOP 0x0000 - -/* Obtain OGF from OpCode */ -#define BT_OGF(opcode) (((opcode) >> 10) & BIT_MASK(6)) -/* Obtain OCF from OpCode */ -#define BT_OCF(opcode) ((opcode) & BIT_MASK(10)) - -#define BT_HCI_OP_INQUIRY BT_OP(BT_OGF_LINK_CTRL, 0x0001) -struct bt_hci_op_inquiry { - uint8_t lap[3]; - uint8_t length; - uint8_t num_rsp; -} __packed; - -#define BT_HCI_OP_INQUIRY_CANCEL BT_OP(BT_OGF_LINK_CTRL, 0x0002) - -#define BT_HCI_OP_CONNECT BT_OP(BT_OGF_LINK_CTRL, 0x0005) -struct bt_hci_cp_connect { - bt_addr_t bdaddr; - uint16_t packet_type; - uint8_t pscan_rep_mode; - uint8_t reserved; - uint16_t clock_offset; - uint8_t allow_role_switch; -} __packed; - -#define BT_HCI_OP_DISCONNECT BT_OP(BT_OGF_LINK_CTRL, 0x0006) -struct bt_hci_cp_disconnect { - uint16_t handle; - uint8_t reason; -} __packed; - -#define BT_HCI_OP_CONNECT_CANCEL BT_OP(BT_OGF_LINK_CTRL, 0x0008) -struct bt_hci_cp_connect_cancel { - bt_addr_t bdaddr; -} __packed; -struct bt_hci_rp_connect_cancel { - uint8_t status; - bt_addr_t bdaddr; -} __packed; - -#define BT_HCI_OP_ACCEPT_CONN_REQ BT_OP(BT_OGF_LINK_CTRL, 0x0009) -struct bt_hci_cp_accept_conn_req { - bt_addr_t bdaddr; - uint8_t role; -} __packed; - -#define BT_HCI_OP_SETUP_SYNC_CONN BT_OP(BT_OGF_LINK_CTRL, 0x0028) -struct bt_hci_cp_setup_sync_conn { - uint16_t handle; - uint32_t tx_bandwidth; - uint32_t rx_bandwidth; - uint16_t max_latency; - uint16_t content_format; - uint8_t retrans_effort; - uint16_t pkt_type; -} __packed; - -#define BT_HCI_OP_ACCEPT_SYNC_CONN_REQ BT_OP(BT_OGF_LINK_CTRL, 0x0029) -struct bt_hci_cp_accept_sync_conn_req { - bt_addr_t bdaddr; - uint32_t tx_bandwidth; - uint32_t rx_bandwidth; - uint16_t max_latency; - uint16_t content_format; - uint8_t retrans_effort; - uint16_t pkt_type; -} __packed; - -#define BT_HCI_OP_REJECT_CONN_REQ BT_OP(BT_OGF_LINK_CTRL, 0x000a) -struct bt_hci_cp_reject_conn_req { - bt_addr_t bdaddr; - uint8_t reason; -} __packed; - -#define BT_HCI_OP_LINK_KEY_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x000b) -struct bt_hci_cp_link_key_reply { - bt_addr_t bdaddr; - uint8_t link_key[16]; -} __packed; - -#define BT_HCI_OP_LINK_KEY_NEG_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x000c) -struct bt_hci_cp_link_key_neg_reply { - bt_addr_t bdaddr; -} __packed; - -#define BT_HCI_OP_PIN_CODE_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x000d) -struct bt_hci_cp_pin_code_reply { - bt_addr_t bdaddr; - uint8_t pin_len; - uint8_t pin_code[16]; -} __packed; -struct bt_hci_rp_pin_code_reply { - uint8_t status; - bt_addr_t bdaddr; -} __packed; - -#define BT_HCI_OP_PIN_CODE_NEG_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x000e) -struct bt_hci_cp_pin_code_neg_reply { - bt_addr_t bdaddr; -} __packed; -struct bt_hci_rp_pin_code_neg_reply { - uint8_t status; - bt_addr_t bdaddr; -} __packed; - -#define BT_HCI_OP_AUTH_REQUESTED BT_OP(BT_OGF_LINK_CTRL, 0x0011) -struct bt_hci_cp_auth_requested { - uint16_t handle; -} __packed; - -#define BT_HCI_OP_SET_CONN_ENCRYPT BT_OP(BT_OGF_LINK_CTRL, 0x0013) -struct bt_hci_cp_set_conn_encrypt { - uint16_t handle; - uint8_t encrypt; -} __packed; - -#define BT_HCI_OP_REMOTE_NAME_REQUEST BT_OP(BT_OGF_LINK_CTRL, 0x0019) -struct bt_hci_cp_remote_name_request { - bt_addr_t bdaddr; - uint8_t pscan_rep_mode; - uint8_t reserved; - uint16_t clock_offset; -} __packed; - -#define BT_HCI_OP_REMOTE_NAME_CANCEL BT_OP(BT_OGF_LINK_CTRL, 0x001a) -struct bt_hci_cp_remote_name_cancel { - bt_addr_t bdaddr; -} __packed; -struct bt_hci_rp_remote_name_cancel { - uint8_t status; - bt_addr_t bdaddr; -} __packed; - -#define BT_HCI_OP_READ_REMOTE_FEATURES BT_OP(BT_OGF_LINK_CTRL, 0x001b) -struct bt_hci_cp_read_remote_features { - uint16_t handle; -} __packed; - -#define BT_HCI_OP_READ_REMOTE_EXT_FEATURES BT_OP(BT_OGF_LINK_CTRL, 0x001c) -struct bt_hci_cp_read_remote_ext_features { - uint16_t handle; - uint8_t page; -} __packed; - -#define BT_HCI_OP_READ_REMOTE_VERSION_INFO BT_OP(BT_OGF_LINK_CTRL, 0x001d) -struct bt_hci_cp_read_remote_version_info { - uint16_t handle; -} __packed; - -#define BT_HCI_OP_IO_CAPABILITY_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x002b) -struct bt_hci_cp_io_capability_reply { - bt_addr_t bdaddr; - uint8_t capability; - uint8_t oob_data; - uint8_t authentication; -} __packed; - -#define BT_HCI_OP_USER_CONFIRM_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x002c) -#define BT_HCI_OP_USER_CONFIRM_NEG_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x002d) -struct bt_hci_cp_user_confirm_reply { - bt_addr_t bdaddr; -} __packed; -struct bt_hci_rp_user_confirm_reply { - uint8_t status; - bt_addr_t bdaddr; -} __packed; - -#define BT_HCI_OP_USER_PASSKEY_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x002e) -struct bt_hci_cp_user_passkey_reply { - bt_addr_t bdaddr; - uint32_t passkey; -} __packed; - -#define BT_HCI_OP_USER_PASSKEY_NEG_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x002f) -struct bt_hci_cp_user_passkey_neg_reply { - bt_addr_t bdaddr; -} __packed; - -#define BT_HCI_OP_IO_CAPABILITY_NEG_REPLY BT_OP(BT_OGF_LINK_CTRL, 0x0034) -struct bt_hci_cp_io_capability_neg_reply { - bt_addr_t bdaddr; - uint8_t reason; -} __packed; - -#define BT_HCI_OP_SET_EVENT_MASK BT_OP(BT_OGF_BASEBAND, 0x0001) -struct bt_hci_cp_set_event_mask { - uint8_t events[8]; -} __packed; - -#define BT_HCI_OP_RESET BT_OP(BT_OGF_BASEBAND, 0x0003) - -#define BT_HCI_OP_WRITE_LOCAL_NAME BT_OP(BT_OGF_BASEBAND, 0x0013) -struct bt_hci_write_local_name { - uint8_t local_name[248]; -} __packed; - -#define BT_HCI_OP_WRITE_PAGE_TIMEOUT BT_OP(BT_OGF_BASEBAND, 0x0018) - -#define BT_HCI_OP_WRITE_SCAN_ENABLE BT_OP(BT_OGF_BASEBAND, 0x001a) -#define BT_BREDR_SCAN_DISABLED 0x00 -#define BT_BREDR_SCAN_INQUIRY 0x01 -#define BT_BREDR_SCAN_PAGE 0x02 - -#define BT_TX_POWER_LEVEL_CURRENT 0x00 -#define BT_TX_POWER_LEVEL_MAX 0x01 -#define BT_HCI_OP_READ_TX_POWER_LEVEL BT_OP(BT_OGF_BASEBAND, 0x002d) -struct bt_hci_cp_read_tx_power_level { - uint16_t handle; - uint8_t type; -} __packed; - -struct bt_hci_rp_read_tx_power_level { - uint8_t status; - uint16_t handle; - int8_t tx_power_level; -} __packed; - -#define BT_HCI_CTL_TO_HOST_FLOW_DISABLE 0x00 -#define BT_HCI_CTL_TO_HOST_FLOW_ENABLE 0x01 -#define BT_HCI_OP_SET_CTL_TO_HOST_FLOW BT_OP(BT_OGF_BASEBAND, 0x0031) -struct bt_hci_cp_set_ctl_to_host_flow { - uint8_t flow_enable; -} __packed; - -#define BT_HCI_OP_HOST_BUFFER_SIZE BT_OP(BT_OGF_BASEBAND, 0x0033) -struct bt_hci_cp_host_buffer_size { - uint16_t acl_mtu; - uint8_t sco_mtu; - uint16_t acl_pkts; - uint16_t sco_pkts; -} __packed; - -struct bt_hci_handle_count { - uint16_t handle; - uint16_t count; -} __packed; - -#define BT_HCI_OP_HOST_NUM_COMPLETED_PACKETS BT_OP(BT_OGF_BASEBAND, 0x0035) -struct bt_hci_cp_host_num_completed_packets { - uint8_t num_handles; - struct bt_hci_handle_count h[0]; -} __packed; - -#define BT_HCI_OP_WRITE_INQUIRY_MODE BT_OP(BT_OGF_BASEBAND, 0x0045) -struct bt_hci_cp_write_inquiry_mode { - uint8_t mode; -} __packed; - -#define BT_HCI_OP_WRITE_SSP_MODE BT_OP(BT_OGF_BASEBAND, 0x0056) -struct bt_hci_cp_write_ssp_mode { - uint8_t mode; -} __packed; - -#define BT_HCI_OP_SET_EVENT_MASK_PAGE_2 BT_OP(BT_OGF_BASEBAND, 0x0063) -struct bt_hci_cp_set_event_mask_page_2 { - uint8_t events_page_2[8]; -} __packed; - -#define BT_HCI_OP_LE_WRITE_LE_HOST_SUPP BT_OP(BT_OGF_BASEBAND, 0x006d) -struct bt_hci_cp_write_le_host_supp { - uint8_t le; - uint8_t simul; -} __packed; - -#define BT_HCI_OP_WRITE_SC_HOST_SUPP BT_OP(BT_OGF_BASEBAND, 0x007a) -struct bt_hci_cp_write_sc_host_supp { - uint8_t sc_support; -} __packed; - -#define BT_HCI_OP_READ_AUTH_PAYLOAD_TIMEOUT BT_OP(BT_OGF_BASEBAND, 0x007b) -struct bt_hci_cp_read_auth_payload_timeout { - uint16_t handle; -} __packed; - -struct bt_hci_rp_read_auth_payload_timeout { - uint8_t status; - uint16_t handle; - uint16_t auth_payload_timeout; -} __packed; - -#define BT_HCI_OP_WRITE_AUTH_PAYLOAD_TIMEOUT BT_OP(BT_OGF_BASEBAND, 0x007c) -struct bt_hci_cp_write_auth_payload_timeout { - uint16_t handle; - uint16_t auth_payload_timeout; -} __packed; - -struct bt_hci_rp_write_auth_payload_timeout { - uint8_t status; - uint16_t handle; -} __packed; - -/* HCI version from Assigned Numbers */ -#define BT_HCI_VERSION_1_0B 0 -#define BT_HCI_VERSION_1_1 1 -#define BT_HCI_VERSION_1_2 2 -#define BT_HCI_VERSION_2_0 3 -#define BT_HCI_VERSION_2_1 4 -#define BT_HCI_VERSION_3_0 5 -#define BT_HCI_VERSION_4_0 6 -#define BT_HCI_VERSION_4_1 7 -#define BT_HCI_VERSION_4_2 8 -#define BT_HCI_VERSION_5_0 9 -#define BT_HCI_VERSION_5_1 10 -#define BT_HCI_VERSION_5_2 11 - -#define BT_HCI_OP_READ_LOCAL_VERSION_INFO BT_OP(BT_OGF_INFO, 0x0001) -struct bt_hci_rp_read_local_version_info { - uint8_t status; - uint8_t hci_version; - uint16_t hci_revision; - uint8_t lmp_version; - uint16_t manufacturer; - uint16_t lmp_subversion; -} __packed; - -#define BT_HCI_OP_READ_SUPPORTED_COMMANDS BT_OP(BT_OGF_INFO, 0x0002) -struct bt_hci_rp_read_supported_commands { - uint8_t status; - uint8_t commands[64]; -} __packed; - -#define BT_HCI_OP_READ_LOCAL_EXT_FEATURES BT_OP(BT_OGF_INFO, 0x0004) -struct bt_hci_cp_read_local_ext_features { - uint8_t page; -}; -struct bt_hci_rp_read_local_ext_features { - uint8_t status; - uint8_t page; - uint8_t max_page; - uint8_t ext_features[8]; -} __packed; - -#define BT_HCI_OP_READ_LOCAL_FEATURES BT_OP(BT_OGF_INFO, 0x0003) -struct bt_hci_rp_read_local_features { - uint8_t status; - uint8_t features[8]; -} __packed; - -#define BT_HCI_OP_READ_BUFFER_SIZE BT_OP(BT_OGF_INFO, 0x0005) -struct bt_hci_rp_read_buffer_size { - uint8_t status; - uint16_t acl_max_len; - uint8_t sco_max_len; - uint16_t acl_max_num; - uint16_t sco_max_num; -} __packed; - -#define BT_HCI_OP_READ_BD_ADDR BT_OP(BT_OGF_INFO, 0x0009) -struct bt_hci_rp_read_bd_addr { - uint8_t status; - bt_addr_t bdaddr; -} __packed; - -#define BT_HCI_OP_READ_RSSI BT_OP(BT_OGF_STATUS, 0x0005) -struct bt_hci_cp_read_rssi { - uint16_t handle; -} __packed; -struct bt_hci_rp_read_rssi { - uint8_t status; - uint16_t handle; - int8_t rssi; -} __packed; - -#define BT_HCI_ENCRYPTION_KEY_SIZE_MIN 7 -#define BT_HCI_ENCRYPTION_KEY_SIZE_MAX 16 - -#define BT_HCI_OP_READ_ENCRYPTION_KEY_SIZE BT_OP(BT_OGF_STATUS, 0x0008) -struct bt_hci_cp_read_encryption_key_size { - uint16_t handle; -} __packed; -struct bt_hci_rp_read_encryption_key_size { - uint8_t status; - uint16_t handle; - uint8_t key_size; -} __packed; - -/* BLE */ - -#define BT_HCI_OP_LE_SET_EVENT_MASK BT_OP(BT_OGF_LE, 0x0001) -struct bt_hci_cp_le_set_event_mask { - uint8_t events[8]; -} __packed; - -#define BT_HCI_OP_LE_READ_BUFFER_SIZE BT_OP(BT_OGF_LE, 0x0002) -struct bt_hci_rp_le_read_buffer_size { - uint8_t status; - uint16_t le_max_len; - uint8_t le_max_num; -} __packed; - -#define BT_HCI_OP_LE_READ_LOCAL_FEATURES BT_OP(BT_OGF_LE, 0x0003) -struct bt_hci_rp_le_read_local_features { - uint8_t status; - uint8_t features[8]; -} __packed; - -#define BT_HCI_OP_LE_SET_RANDOM_ADDRESS BT_OP(BT_OGF_LE, 0x0005) -struct bt_hci_cp_le_set_random_address { - bt_addr_t bdaddr; -} __packed; - -/* LE Advertising Types (LE Advertising Parameters Set)*/ -#define BT_LE_ADV_IND (__DEPRECATED_MACRO 0x00) -#define BT_LE_ADV_DIRECT_IND (__DEPRECATED_MACRO 0x01) -#define BT_LE_ADV_SCAN_IND (__DEPRECATED_MACRO 0x02) -#define BT_LE_ADV_NONCONN_IND (__DEPRECATED_MACRO 0x03) -#define BT_LE_ADV_DIRECT_IND_LOW_DUTY (__DEPRECATED_MACRO 0x04) -/* LE Advertising PDU Types. */ -#define BT_LE_ADV_SCAN_RSP (__DEPRECATED_MACRO 0x04) - -#define BT_HCI_ADV_IND 0x00 -#define BT_HCI_ADV_DIRECT_IND 0x01 -#define BT_HCI_ADV_SCAN_IND 0x02 -#define BT_HCI_ADV_NONCONN_IND 0x03 -#define BT_HCI_ADV_DIRECT_IND_LOW_DUTY 0x04 -#define BT_HCI_ADV_SCAN_RSP 0x04 - -#define BT_LE_ADV_FP_NO_WHITELIST 0x00 -#define BT_LE_ADV_FP_WHITELIST_SCAN_REQ 0x01 -#define BT_LE_ADV_FP_WHITELIST_CONN_IND 0x02 -#define BT_LE_ADV_FP_WHITELIST_BOTH 0x03 - -#define BT_HCI_OP_LE_SET_ADV_PARAM BT_OP(BT_OGF_LE, 0x0006) -struct bt_hci_cp_le_set_adv_param { - uint16_t min_interval; - uint16_t max_interval; - uint8_t type; - uint8_t own_addr_type; - bt_addr_le_t direct_addr; - uint8_t channel_map; - uint8_t filter_policy; -} __packed; - -#define BT_HCI_OP_LE_READ_ADV_CHAN_TX_POWER BT_OP(BT_OGF_LE, 0x0007) -struct bt_hci_rp_le_read_chan_tx_power { - uint8_t status; - int8_t tx_power_level; -} __packed; - -#define BT_HCI_OP_LE_SET_ADV_DATA BT_OP(BT_OGF_LE, 0x0008) -struct bt_hci_cp_le_set_adv_data { - uint8_t len; - uint8_t data[31]; -} __packed; - -#define BT_HCI_OP_LE_SET_SCAN_RSP_DATA BT_OP(BT_OGF_LE, 0x0009) -struct bt_hci_cp_le_set_scan_rsp_data { - uint8_t len; - uint8_t data[31]; -} __packed; - -#define BT_HCI_LE_ADV_DISABLE 0x00 -#define BT_HCI_LE_ADV_ENABLE 0x01 - -#define BT_HCI_OP_LE_SET_ADV_ENABLE BT_OP(BT_OGF_LE, 0x000a) -struct bt_hci_cp_le_set_adv_enable { - uint8_t enable; -} __packed; - -/* Scan types */ -#define BT_HCI_OP_LE_SET_SCAN_PARAM BT_OP(BT_OGF_LE, 0x000b) -#define BT_HCI_LE_SCAN_PASSIVE 0x00 -#define BT_HCI_LE_SCAN_ACTIVE 0x01 - -#define BT_HCI_LE_SCAN_FP_NO_WHITELIST 0x00 -#define BT_HCI_LE_SCAN_FP_USE_WHITELIST 0x01 - -struct bt_hci_cp_le_set_scan_param { - uint8_t scan_type; - uint16_t interval; - uint16_t window; - uint8_t addr_type; - uint8_t filter_policy; -} __packed; - -#define BT_HCI_OP_LE_SET_SCAN_ENABLE BT_OP(BT_OGF_LE, 0x000c) - -#define BT_HCI_LE_SCAN_DISABLE 0x00 -#define BT_HCI_LE_SCAN_ENABLE 0x01 - -#define BT_HCI_LE_SCAN_FILTER_DUP_DISABLE 0x00 -#define BT_HCI_LE_SCAN_FILTER_DUP_ENABLE 0x01 - -struct bt_hci_cp_le_set_scan_enable { - uint8_t enable; - uint8_t filter_dup; -} __packed; - -#define BT_HCI_OP_LE_CREATE_CONN BT_OP(BT_OGF_LE, 0x000d) - -#define BT_HCI_LE_CREATE_CONN_FP_DIRECT 0x00 -#define BT_HCI_LE_CREATE_CONN_FP_WHITELIST 0x01 - -struct bt_hci_cp_le_create_conn { - uint16_t scan_interval; - uint16_t scan_window; - uint8_t filter_policy; - bt_addr_le_t peer_addr; - uint8_t own_addr_type; - uint16_t conn_interval_min; - uint16_t conn_interval_max; - uint16_t conn_latency; - uint16_t supervision_timeout; - uint16_t min_ce_len; - uint16_t max_ce_len; -} __packed; - -#define BT_HCI_OP_LE_CREATE_CONN_CANCEL BT_OP(BT_OGF_LE, 0x000e) - -#define BT_HCI_OP_LE_READ_WL_SIZE BT_OP(BT_OGF_LE, 0x000f) -struct bt_hci_rp_le_read_wl_size { - uint8_t status; - uint8_t wl_size; -} __packed; - -#define BT_HCI_OP_LE_CLEAR_WL BT_OP(BT_OGF_LE, 0x0010) - -#define BT_HCI_OP_LE_ADD_DEV_TO_WL BT_OP(BT_OGF_LE, 0x0011) -struct bt_hci_cp_le_add_dev_to_wl { - bt_addr_le_t addr; -} __packed; - -#define BT_HCI_OP_LE_REM_DEV_FROM_WL BT_OP(BT_OGF_LE, 0x0012) -struct bt_hci_cp_le_rem_dev_from_wl { - bt_addr_le_t addr; -} __packed; - -#define BT_HCI_OP_LE_CONN_UPDATE BT_OP(BT_OGF_LE, 0x0013) -struct hci_cp_le_conn_update { - uint16_t handle; - uint16_t conn_interval_min; - uint16_t conn_interval_max; - uint16_t conn_latency; - uint16_t supervision_timeout; - uint16_t min_ce_len; - uint16_t max_ce_len; -} __packed; - -#define BT_HCI_OP_LE_SET_HOST_CHAN_CLASSIF BT_OP(BT_OGF_LE, 0x0014) -struct bt_hci_cp_le_set_host_chan_classif { - uint8_t ch_map[5]; -} __packed; - -#define BT_HCI_OP_LE_READ_CHAN_MAP BT_OP(BT_OGF_LE, 0x0015) -struct bt_hci_cp_le_read_chan_map { - uint16_t handle; -} __packed; -struct bt_hci_rp_le_read_chan_map { - uint8_t status; - uint16_t handle; - uint8_t ch_map[5]; -} __packed; - -#define BT_HCI_OP_LE_READ_REMOTE_FEATURES BT_OP(BT_OGF_LE, 0x0016) -struct bt_hci_cp_le_read_remote_features { - uint16_t handle; -} __packed; - -#define BT_HCI_OP_LE_ENCRYPT BT_OP(BT_OGF_LE, 0x0017) -struct bt_hci_cp_le_encrypt { - uint8_t key[16]; - uint8_t plaintext[16]; -} __packed; -struct bt_hci_rp_le_encrypt { - uint8_t status; - uint8_t enc_data[16]; -} __packed; - -#define BT_HCI_OP_LE_RAND BT_OP(BT_OGF_LE, 0x0018) -struct bt_hci_rp_le_rand { - uint8_t status; - uint8_t rand[8]; -} __packed; - -#define BT_HCI_OP_LE_START_ENCRYPTION BT_OP(BT_OGF_LE, 0x0019) -struct bt_hci_cp_le_start_encryption { - uint16_t handle; - uint64_t rand; - uint16_t ediv; - uint8_t ltk[16]; -} __packed; - -#define BT_HCI_OP_LE_LTK_REQ_REPLY BT_OP(BT_OGF_LE, 0x001a) -struct bt_hci_cp_le_ltk_req_reply { - uint16_t handle; - uint8_t ltk[16]; -} __packed; -struct bt_hci_rp_le_ltk_req_reply { - uint8_t status; - uint16_t handle; -} __packed; - -#define BT_HCI_OP_LE_LTK_REQ_NEG_REPLY BT_OP(BT_OGF_LE, 0x001b) -struct bt_hci_cp_le_ltk_req_neg_reply { - uint16_t handle; -} __packed; -struct bt_hci_rp_le_ltk_req_neg_reply { - uint8_t status; - uint16_t handle; -} __packed; - -#define BT_HCI_OP_LE_READ_SUPP_STATES BT_OP(BT_OGF_LE, 0x001c) -struct bt_hci_rp_le_read_supp_states { - uint8_t status; - uint8_t le_states[8]; -} __packed; - -#define BT_HCI_OP_LE_RX_TEST BT_OP(BT_OGF_LE, 0x001d) -struct bt_hci_cp_le_rx_test { - uint8_t rx_ch; -} __packed; - -#define BT_HCI_OP_LE_TX_TEST BT_OP(BT_OGF_LE, 0x001e) -struct bt_hci_cp_le_tx_test { - uint8_t tx_ch; - uint8_t test_data_len; - uint8_t pkt_payload; -} __packed; - -#define BT_HCI_OP_LE_TEST_END BT_OP(BT_OGF_LE, 0x001f) -struct bt_hci_rp_le_test_end { - uint8_t status; - uint16_t rx_pkt_count; -} __packed; - -#define BT_HCI_OP_LE_CONN_PARAM_REQ_REPLY BT_OP(BT_OGF_LE, 0x0020) -struct bt_hci_cp_le_conn_param_req_reply { - uint16_t handle; - uint16_t interval_min; - uint16_t interval_max; - uint16_t latency; - uint16_t timeout; - uint16_t min_ce_len; - uint16_t max_ce_len; -} __packed; -struct bt_hci_rp_le_conn_param_req_reply { - uint8_t status; - uint16_t handle; -} __packed; - -#define BT_HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY BT_OP(BT_OGF_LE, 0x0021) -struct bt_hci_cp_le_conn_param_req_neg_reply { - uint16_t handle; - uint8_t reason; -} __packed; -struct bt_hci_rp_le_conn_param_req_neg_reply { - uint8_t status; - uint16_t handle; -} __packed; - -#define BT_HCI_OP_LE_SET_DATA_LEN BT_OP(BT_OGF_LE, 0x0022) -struct bt_hci_cp_le_set_data_len { - uint16_t handle; - uint16_t tx_octets; - uint16_t tx_time; -} __packed; -struct bt_hci_rp_le_set_data_len { - uint8_t status; - uint16_t handle; -} __packed; - -#define BT_HCI_OP_LE_READ_DEFAULT_DATA_LEN BT_OP(BT_OGF_LE, 0x0023) -struct bt_hci_rp_le_read_default_data_len { - uint8_t status; - uint16_t max_tx_octets; - uint16_t max_tx_time; -} __packed; - -#define BT_HCI_OP_LE_WRITE_DEFAULT_DATA_LEN BT_OP(BT_OGF_LE, 0x0024) -struct bt_hci_cp_le_write_default_data_len { - uint16_t max_tx_octets; - uint16_t max_tx_time; -} __packed; - -#define BT_HCI_OP_LE_P256_PUBLIC_KEY BT_OP(BT_OGF_LE, 0x0025) - -#define BT_HCI_OP_LE_GENERATE_DHKEY BT_OP(BT_OGF_LE, 0x0026) -struct bt_hci_cp_le_generate_dhkey { - uint8_t key[64]; -} __packed; - -#define BT_HCI_OP_LE_ADD_DEV_TO_RL BT_OP(BT_OGF_LE, 0x0027) -struct bt_hci_cp_le_add_dev_to_rl { - bt_addr_le_t peer_id_addr; - uint8_t peer_irk[16]; - uint8_t local_irk[16]; -} __packed; - -#define BT_HCI_OP_LE_REM_DEV_FROM_RL BT_OP(BT_OGF_LE, 0x0028) -struct bt_hci_cp_le_rem_dev_from_rl { - bt_addr_le_t peer_id_addr; -} __packed; - -#define BT_HCI_OP_LE_CLEAR_RL BT_OP(BT_OGF_LE, 0x0029) - -#define BT_HCI_OP_LE_READ_RL_SIZE BT_OP(BT_OGF_LE, 0x002a) -struct bt_hci_rp_le_read_rl_size { - uint8_t status; - uint8_t rl_size; -} __packed; - -#define BT_HCI_OP_LE_READ_PEER_RPA BT_OP(BT_OGF_LE, 0x002b) -struct bt_hci_cp_le_read_peer_rpa { - bt_addr_le_t peer_id_addr; -} __packed; -struct bt_hci_rp_le_read_peer_rpa { - uint8_t status; - bt_addr_t peer_rpa; -} __packed; - -#define BT_HCI_OP_LE_READ_LOCAL_RPA BT_OP(BT_OGF_LE, 0x002c) -struct bt_hci_cp_le_read_local_rpa { - bt_addr_le_t peer_id_addr; -} __packed; -struct bt_hci_rp_le_read_local_rpa { - uint8_t status; - bt_addr_t local_rpa; -} __packed; - -#define BT_HCI_ADDR_RES_DISABLE 0x00 -#define BT_HCI_ADDR_RES_ENABLE 0x01 - -#define BT_HCI_OP_LE_SET_ADDR_RES_ENABLE BT_OP(BT_OGF_LE, 0x002d) -struct bt_hci_cp_le_set_addr_res_enable { - uint8_t enable; -} __packed; - -#define BT_HCI_OP_LE_SET_RPA_TIMEOUT BT_OP(BT_OGF_LE, 0x002e) -struct bt_hci_cp_le_set_rpa_timeout { - uint16_t rpa_timeout; -} __packed; - -#define BT_HCI_OP_LE_READ_MAX_DATA_LEN BT_OP(BT_OGF_LE, 0x002f) -struct bt_hci_rp_le_read_max_data_len { - uint8_t status; - uint16_t max_tx_octets; - uint16_t max_tx_time; - uint16_t max_rx_octets; - uint16_t max_rx_time; -} __packed; - -#define BT_HCI_LE_PHY_1M 0x01 -#define BT_HCI_LE_PHY_2M 0x02 -#define BT_HCI_LE_PHY_CODED 0x03 - -#define BT_HCI_OP_LE_READ_PHY BT_OP(BT_OGF_LE, 0x0030) -struct bt_hci_cp_le_read_phy { - uint16_t handle; -} __packed; -struct bt_hci_rp_le_read_phy { - uint8_t status; - uint16_t handle; - uint8_t tx_phy; - uint8_t rx_phy; -} __packed; - -#define BT_HCI_LE_PHY_TX_ANY BIT(0) -#define BT_HCI_LE_PHY_RX_ANY BIT(1) - -#define BT_HCI_LE_PHY_PREFER_1M BIT(0) -#define BT_HCI_LE_PHY_PREFER_2M BIT(1) -#define BT_HCI_LE_PHY_PREFER_CODED BIT(2) - -#define BT_HCI_OP_LE_SET_DEFAULT_PHY BT_OP(BT_OGF_LE, 0x0031) -struct bt_hci_cp_le_set_default_phy { - uint8_t all_phys; - uint8_t tx_phys; - uint8_t rx_phys; -} __packed; - -#define BT_HCI_LE_PHY_CODED_ANY 0x00 -#define BT_HCI_LE_PHY_CODED_S2 0x01 -#define BT_HCI_LE_PHY_CODED_S8 0x02 - -#define BT_HCI_OP_LE_SET_PHY BT_OP(BT_OGF_LE, 0x0032) -struct bt_hci_cp_le_set_phy { - uint16_t handle; - uint8_t all_phys; - uint8_t tx_phys; - uint8_t rx_phys; - uint16_t phy_opts; -} __packed; - -#define BT_HCI_LE_MOD_INDEX_STANDARD 0x00 -#define BT_HCI_LE_MOD_INDEX_STABLE 0x01 - -#define BT_HCI_OP_LE_ENH_RX_TEST BT_OP(BT_OGF_LE, 0x0033) -struct bt_hci_cp_le_enh_rx_test { - uint8_t rx_ch; - uint8_t phy; - uint8_t mod_index; -} __packed; - -/* Extends BT_HCI_LE_PHY */ -#define BT_HCI_LE_TX_PHY_CODED_S8 0x03 -#define BT_HCI_LE_TX_PHY_CODED_S2 0x04 - -#define BT_HCI_OP_LE_ENH_TX_TEST BT_OP(BT_OGF_LE, 0x0034) -struct bt_hci_cp_le_enh_tx_test { - uint8_t tx_ch; - uint8_t test_data_len; - uint8_t pkt_payload; - uint8_t phy; -} __packed; - -#define BT_HCI_OP_LE_SET_ADV_SET_RANDOM_ADDR BT_OP(BT_OGF_LE, 0x0035) -struct bt_hci_cp_le_set_adv_set_random_addr { - uint8_t handle; - bt_addr_t bdaddr; -} __packed; - -#define BT_HCI_LE_ADV_PROP_CONN BIT(0) -#define BT_HCI_LE_ADV_PROP_SCAN BIT(1) -#define BT_HCI_LE_ADV_PROP_DIRECT BIT(2) -#define BT_HCI_LE_ADV_PROP_HI_DC_CONN BIT(3) -#define BT_HCI_LE_ADV_PROP_LEGACY BIT(4) -#define BT_HCI_LE_ADV_PROP_ANON BIT(5) -#define BT_HCI_LE_ADV_PROP_TX_POWER BIT(6) - -#define BT_HCI_LE_ADV_SCAN_REQ_ENABLE 1 -#define BT_HCI_LE_ADV_SCAN_REQ_DISABLE 0 - -#define BT_HCI_LE_ADV_TX_POWER_NO_PREF 0x7F - -#define BT_HCI_OP_LE_SET_EXT_ADV_PARAM BT_OP(BT_OGF_LE, 0x0036) -struct bt_hci_cp_le_set_ext_adv_param { - uint8_t handle; - uint16_t props; - uint8_t prim_min_interval[3]; - uint8_t prim_max_interval[3]; - uint8_t prim_channel_map; - uint8_t own_addr_type; - bt_addr_le_t peer_addr; - uint8_t filter_policy; - int8_t tx_power; - uint8_t prim_adv_phy; - uint8_t sec_adv_max_skip; - uint8_t sec_adv_phy; - uint8_t sid; - uint8_t scan_req_notify_enable; -} __packed; -struct bt_hci_rp_le_set_ext_adv_param { - uint8_t status; - int8_t tx_power; -} __packed; - -#define BT_HCI_LE_EXT_ADV_OP_INTERM_FRAG 0x00 -#define BT_HCI_LE_EXT_ADV_OP_FIRST_FRAG 0x01 -#define BT_HCI_LE_EXT_ADV_OP_LAST_FRAG 0x02 -#define BT_HCI_LE_EXT_ADV_OP_COMPLETE_DATA 0x03 -#define BT_HCI_LE_EXT_ADV_OP_UNCHANGED_DATA 0x04 - -#define BT_HCI_LE_EXT_ADV_FRAG_ENABLED 0x00 -#define BT_HCI_LE_EXT_ADV_FRAG_DISABLED 0x01 - -#define BT_HCI_LE_EXT_ADV_FRAG_MAX_LEN 251 - -#define BT_HCI_OP_LE_SET_EXT_ADV_DATA BT_OP(BT_OGF_LE, 0x0037) -struct bt_hci_cp_le_set_ext_adv_data { - uint8_t handle; - uint8_t op; - uint8_t frag_pref; - uint8_t len; - uint8_t data[251]; -} __packed; - -#define BT_HCI_OP_LE_SET_EXT_SCAN_RSP_DATA BT_OP(BT_OGF_LE, 0x0038) -struct bt_hci_cp_le_set_ext_scan_rsp_data { - uint8_t handle; - uint8_t op; - uint8_t frag_pref; - uint8_t len; - uint8_t data[251]; -} __packed; - -#define BT_HCI_OP_LE_SET_EXT_ADV_ENABLE BT_OP(BT_OGF_LE, 0x0039) -struct bt_hci_ext_adv_set { - uint8_t handle; - uint16_t duration; - uint8_t max_ext_adv_evts; -} __packed; - -struct bt_hci_cp_le_set_ext_adv_enable { - uint8_t enable; - uint8_t set_num; - struct bt_hci_ext_adv_set s[0]; -} __packed; - -#define BT_HCI_OP_LE_READ_MAX_ADV_DATA_LEN BT_OP(BT_OGF_LE, 0x003a) -struct bt_hci_rp_le_read_max_adv_data_len { - uint8_t status; - uint16_t max_adv_data_len; -} __packed; - -#define BT_HCI_OP_LE_READ_NUM_ADV_SETS BT_OP(BT_OGF_LE, 0x003b) -struct bt_hci_rp_le_read_num_adv_sets { - uint8_t status; - uint8_t num_sets; -} __packed; - -#define BT_HCI_OP_LE_REMOVE_ADV_SET BT_OP(BT_OGF_LE, 0x003c) -struct bt_hci_cp_le_remove_adv_set { - uint8_t handle; -} __packed; - -#define BT_HCI_OP_CLEAR_ADV_SETS BT_OP(BT_OGF_LE, 0x003d) - -#define BT_HCI_OP_LE_SET_PER_ADV_PARAM BT_OP(BT_OGF_LE, 0x003e) -struct bt_hci_cp_le_set_per_adv_param { - uint8_t handle; - uint16_t min_interval; - uint16_t max_interval; - uint16_t props; -} __packed; - -#define BT_HCI_OP_LE_SET_PER_ADV_DATA BT_OP(BT_OGF_LE, 0x003f) -struct bt_hci_cp_le_set_per_adv_data { - uint8_t handle; - uint8_t op; - uint8_t len; - uint8_t data[251]; -} __packed; - -#define BT_HCI_OP_LE_SET_PER_ADV_ENABLE BT_OP(BT_OGF_LE, 0x0040) -struct bt_hci_cp_le_set_per_adv_enable { - uint8_t enable; - uint8_t handle; -} __packed; - -#define BT_HCI_OP_LE_SET_EXT_SCAN_PARAM BT_OP(BT_OGF_LE, 0x0041) -struct bt_hci_ext_scan_phy { - uint8_t type; - uint16_t interval; - uint16_t window; -} __packed; - -#define BT_HCI_LE_EXT_SCAN_PHY_1M BIT(0) -#define BT_HCI_LE_EXT_SCAN_PHY_2M BIT(1) -#define BT_HCI_LE_EXT_SCAN_PHY_CODED BIT(2) - -struct bt_hci_cp_le_set_ext_scan_param { - uint8_t own_addr_type; - uint8_t filter_policy; - uint8_t phys; - struct bt_hci_ext_scan_phy p[0]; -} __packed; - -/* Extends BT_HCI_LE_SCAN_FILTER_DUP */ -#define BT_HCI_LE_EXT_SCAN_FILTER_DUP_ENABLE_RESET 0x02 - -#define BT_HCI_OP_LE_SET_EXT_SCAN_ENABLE BT_OP(BT_OGF_LE, 0x0042) -struct bt_hci_cp_le_set_ext_scan_enable { - uint8_t enable; - uint8_t filter_dup; - uint16_t duration; - uint16_t period; -} __packed; - -#define BT_HCI_OP_LE_EXT_CREATE_CONN BT_OP(BT_OGF_LE, 0x0043) -struct bt_hci_ext_conn_phy { - uint16_t scan_interval; - uint16_t scan_window; - uint16_t conn_interval_min; - uint16_t conn_interval_max; - uint16_t conn_latency; - uint16_t supervision_timeout; - uint16_t min_ce_len; - uint16_t max_ce_len; -} __packed; - -struct bt_hci_cp_le_ext_create_conn { - uint8_t filter_policy; - uint8_t own_addr_type; - bt_addr_le_t peer_addr; - uint8_t phys; - struct bt_hci_ext_conn_phy p[0]; -} __packed; - -#define BT_HCI_OP_LE_PER_ADV_CREATE_SYNC BT_OP(BT_OGF_LE, 0x0044) -struct bt_hci_cp_le_per_adv_create_sync { - uint8_t filter_policy; - uint8_t sid; - bt_addr_le_t addr; - uint16_t skip; - uint16_t sync_timeout; - uint8_t unused; -} __packed; - -#define BT_HCI_OP_LE_PER_ADV_CREATE_SYNC_CANCEL BT_OP(BT_OGF_LE, 0x0045) - -#define BT_HCI_OP_LE_PER_ADV_TERMINATE_SYNC BT_OP(BT_OGF_LE, 0x0046) -struct bt_hci_cp_le_per_adv_terminate_sync { - uint16_t handle; -} __packed; - -#define BT_HCI_OP_LE_ADD_DEV_TO_PER_ADV_LIST BT_OP(BT_OGF_LE, 0x0047) -struct bt_hci_cp_le_add_dev_to_per_adv_list { - bt_addr_le_t addr; - uint8_t sid; -} __packed; - -#define BT_HCI_OP_LE_REM_DEV_FROM_PER_ADV_LIST BT_OP(BT_OGF_LE, 0x0048) -struct bt_hci_cp_le_rem_dev_from_per_adv_list { - bt_addr_le_t addr; - uint8_t sid; -} __packed; - -#define BT_HCI_OP_LE_CLEAR_PER_ADV_LIST BT_OP(BT_OGF_LE, 0x0049) - -#define BT_HCI_OP_LE_READ_PER_ADV_LIST_SIZE BT_OP(BT_OGF_LE, 0x004a) -struct bt_hci_rp_le_read_per_adv_list_size { - uint8_t status; - uint8_t list_size; -} __packed; - -#define BT_HCI_OP_LE_READ_TX_POWER BT_OP(BT_OGF_LE, 0x004b) -struct bt_hci_rp_le_read_tx_power { - uint8_t status; - int8_t min_tx_power; - int8_t max_tx_power; -} __packed; - -#define BT_HCI_OP_LE_READ_RF_PATH_COMP BT_OP(BT_OGF_LE, 0x004c) -struct bt_hci_rp_le_read_rf_path_comp { - uint8_t status; - int16_t tx_path_comp; - int16_t rx_path_comp; -} __packed; - -#define BT_HCI_OP_LE_WRITE_RF_PATH_COMP BT_OP(BT_OGF_LE, 0x004d) -struct bt_hci_cp_le_write_rf_path_comp { - int16_t tx_path_comp; - int16_t rx_path_comp; -} __packed; - -#define BT_HCI_LE_PRIVACY_MODE_NETWORK 0x00 -#define BT_HCI_LE_PRIVACY_MODE_DEVICE 0x01 - -#define BT_HCI_OP_LE_SET_PRIVACY_MODE BT_OP(BT_OGF_LE, 0x004e) -struct bt_hci_cp_le_set_privacy_mode { - bt_addr_le_t id_addr; - uint8_t mode; -} __packed; - -/* Event definitions */ - -#define BT_HCI_EVT_UNKNOWN 0x00 -#define BT_HCI_EVT_VENDOR 0xff - -#define BT_HCI_EVT_INQUIRY_COMPLETE 0x01 -struct bt_hci_evt_inquiry_complete { - uint8_t status; -} __packed; - -#define BT_HCI_EVT_CONN_COMPLETE 0x03 -struct bt_hci_evt_conn_complete { - uint8_t status; - uint16_t handle; - bt_addr_t bdaddr; - uint8_t link_type; - uint8_t encr_enabled; -} __packed; - -#define BT_HCI_EVT_CONN_REQUEST 0x04 -struct bt_hci_evt_conn_request { - bt_addr_t bdaddr; - uint8_t dev_class[3]; - uint8_t link_type; -} __packed; - -#define BT_HCI_EVT_DISCONN_COMPLETE 0x05 -struct bt_hci_evt_disconn_complete { - uint8_t status; - uint16_t handle; - uint8_t reason; -} __packed; - -#define BT_HCI_EVT_AUTH_COMPLETE 0x06 -struct bt_hci_evt_auth_complete { - uint8_t status; - uint16_t handle; -} __packed; - -#define BT_HCI_EVT_REMOTE_NAME_REQ_COMPLETE 0x07 -struct bt_hci_evt_remote_name_req_complete { - uint8_t status; - bt_addr_t bdaddr; - uint8_t name[248]; -} __packed; - -#define BT_HCI_EVT_ENCRYPT_CHANGE 0x08 -struct bt_hci_evt_encrypt_change { - uint8_t status; - uint16_t handle; - uint8_t encrypt; -} __packed; - -#define BT_HCI_EVT_REMOTE_FEATURES 0x0b -struct bt_hci_evt_remote_features { - uint8_t status; - uint16_t handle; - uint8_t features[8]; -} __packed; - -#define BT_HCI_EVT_REMOTE_VERSION_INFO 0x0c -struct bt_hci_evt_remote_version_info { - uint8_t status; - uint16_t handle; - uint8_t version; - uint16_t manufacturer; - uint16_t subversion; -} __packed; - -#define BT_HCI_EVT_CMD_COMPLETE 0x0e -struct bt_hci_evt_cmd_complete { - uint8_t ncmd; - uint16_t opcode; -} __packed; - -struct bt_hci_evt_cc_status { - uint8_t status; -} __packed; - -#define BT_HCI_EVT_CMD_STATUS 0x0f -struct bt_hci_evt_cmd_status { - uint8_t status; - uint8_t ncmd; - uint16_t opcode; -} __packed; - -#define BT_HCI_EVT_ROLE_CHANGE 0x12 -struct bt_hci_evt_role_change { - uint8_t status; - bt_addr_t bdaddr; - uint8_t role; -} __packed; - -#define BT_HCI_EVT_NUM_COMPLETED_PACKETS 0x13 -struct bt_hci_evt_num_completed_packets { - uint8_t num_handles; - struct bt_hci_handle_count h[0]; -} __packed; - -#define BT_HCI_EVT_PIN_CODE_REQ 0x16 -struct bt_hci_evt_pin_code_req { - bt_addr_t bdaddr; -} __packed; - -#define BT_HCI_EVT_LINK_KEY_REQ 0x17 -struct bt_hci_evt_link_key_req { - bt_addr_t bdaddr; -} __packed; - -/* Link Key types */ -#define BT_LK_COMBINATION 0x00 -#define BT_LK_LOCAL_UNIT 0x01 -#define BT_LK_REMOTE_UNIT 0x02 -#define BT_LK_DEBUG_COMBINATION 0x03 -#define BT_LK_UNAUTH_COMBINATION_P192 0x04 -#define BT_LK_AUTH_COMBINATION_P192 0x05 -#define BT_LK_CHANGED_COMBINATION 0x06 -#define BT_LK_UNAUTH_COMBINATION_P256 0x07 -#define BT_LK_AUTH_COMBINATION_P256 0x08 - -#define BT_HCI_EVT_LINK_KEY_NOTIFY 0x18 -struct bt_hci_evt_link_key_notify { - bt_addr_t bdaddr; - uint8_t link_key[16]; - uint8_t key_type; -} __packed; - -/* Overflow link types */ -#define BT_OVERFLOW_LINK_SYNCH 0x00 -#define BT_OVERFLOW_LINK_ACL 0x01 - -#define BT_HCI_EVT_DATA_BUF_OVERFLOW 0x1a -struct bt_hci_evt_data_buf_overflow { - uint8_t link_type; -} __packed; - -#define BT_HCI_EVT_INQUIRY_RESULT_WITH_RSSI 0x22 -struct bt_hci_evt_inquiry_result_with_rssi { - bt_addr_t addr; - uint8_t pscan_rep_mode; - uint8_t reserved; - uint8_t cod[3]; - uint16_t clock_offset; - int8_t rssi; -} __packed; - -#define BT_HCI_EVT_REMOTE_EXT_FEATURES 0x23 -struct bt_hci_evt_remote_ext_features { - uint8_t status; - uint16_t handle; - uint8_t page; - uint8_t max_page; - uint8_t features[8]; -} __packed; - -#define BT_HCI_EVT_SYNC_CONN_COMPLETE 0x2c -struct bt_hci_evt_sync_conn_complete { - uint8_t status; - uint16_t handle; - bt_addr_t bdaddr; - uint8_t link_type; - uint8_t tx_interval; - uint8_t retansmission_window; - uint16_t rx_pkt_length; - uint16_t tx_pkt_length; - uint8_t air_mode; -} __packed; - -#define BT_HCI_EVT_EXTENDED_INQUIRY_RESULT 0x2f -struct bt_hci_evt_extended_inquiry_result { - uint8_t num_reports; - bt_addr_t addr; - uint8_t pscan_rep_mode; - uint8_t reserved; - uint8_t cod[3]; - uint16_t clock_offset; - int8_t rssi; - uint8_t eir[240]; -} __packed; - -#define BT_HCI_EVT_ENCRYPT_KEY_REFRESH_COMPLETE 0x30 -struct bt_hci_evt_encrypt_key_refresh_complete { - uint8_t status; - uint16_t handle; -} __packed; - -#define BT_HCI_EVT_IO_CAPA_REQ 0x31 -struct bt_hci_evt_io_capa_req { - bt_addr_t bdaddr; -} __packed; - -#define BT_HCI_EVT_IO_CAPA_RESP 0x32 -struct bt_hci_evt_io_capa_resp { - bt_addr_t bdaddr; - uint8_t capability; - uint8_t oob_data; - uint8_t authentication; -} __packed; - -#define BT_HCI_EVT_USER_CONFIRM_REQ 0x33 -struct bt_hci_evt_user_confirm_req { - bt_addr_t bdaddr; - uint32_t passkey; -} __packed; - -#define BT_HCI_EVT_USER_PASSKEY_REQ 0x34 -struct bt_hci_evt_user_passkey_req { - bt_addr_t bdaddr; -} __packed; - -#define BT_HCI_EVT_SSP_COMPLETE 0x36 -struct bt_hci_evt_ssp_complete { - uint8_t status; - bt_addr_t bdaddr; -} __packed; - -#define BT_HCI_EVT_USER_PASSKEY_NOTIFY 0x3b -struct bt_hci_evt_user_passkey_notify { - bt_addr_t bdaddr; - uint32_t passkey; -} __packed; - -#define BT_HCI_EVT_LE_META_EVENT 0x3e -struct bt_hci_evt_le_meta_event { - uint8_t subevent; -} __packed; - -#define BT_HCI_EVT_AUTH_PAYLOAD_TIMEOUT_EXP 0x57 -struct bt_hci_evt_auth_payload_timeout_exp { - uint16_t handle; -} __packed; - -#define BT_HCI_ROLE_MASTER 0x00 -#define BT_HCI_ROLE_SLAVE 0x01 - -#define BT_HCI_EVT_LE_CONN_COMPLETE 0x01 -struct bt_hci_evt_le_conn_complete { - uint8_t status; - uint16_t handle; - uint8_t role; - bt_addr_le_t peer_addr; - uint16_t interval; - uint16_t latency; - uint16_t supv_timeout; - uint8_t clock_accuracy; -} __packed; - -#define BT_HCI_EVT_LE_ADVERTISING_REPORT 0x02 -struct bt_hci_evt_le_advertising_info { - uint8_t evt_type; - bt_addr_le_t addr; - uint8_t length; - uint8_t data[0]; -} __packed; -struct bt_hci_evt_le_advertising_report { - uint8_t num_reports; - struct bt_hci_evt_le_advertising_info adv_info[0]; -} __packed; - -#define BT_HCI_EVT_LE_CONN_UPDATE_COMPLETE 0x03 -struct bt_hci_evt_le_conn_update_complete { - uint8_t status; - uint16_t handle; - uint16_t interval; - uint16_t latency; - uint16_t supv_timeout; -} __packed; - -#define BT_HCI_EV_LE_REMOTE_FEAT_COMPLETE 0x04 -struct bt_hci_evt_le_remote_feat_complete { - uint8_t status; - uint16_t handle; - uint8_t features[8]; -} __packed; - -#define BT_HCI_EVT_LE_LTK_REQUEST 0x05 -struct bt_hci_evt_le_ltk_request { - uint16_t handle; - uint64_t rand; - uint16_t ediv; -} __packed; - -#define BT_HCI_EVT_LE_CONN_PARAM_REQ 0x06 -struct bt_hci_evt_le_conn_param_req { - uint16_t handle; - uint16_t interval_min; - uint16_t interval_max; - uint16_t latency; - uint16_t timeout; -} __packed; - -#define BT_HCI_EVT_LE_DATA_LEN_CHANGE 0x07 -struct bt_hci_evt_le_data_len_change { - uint16_t handle; - uint16_t max_tx_octets; - uint16_t max_tx_time; - uint16_t max_rx_octets; - uint16_t max_rx_time; -} __packed; - -#define BT_HCI_EVT_LE_P256_PUBLIC_KEY_COMPLETE 0x08 -struct bt_hci_evt_le_p256_public_key_complete { - uint8_t status; - uint8_t key[64]; -} __packed; - -#define BT_HCI_EVT_LE_GENERATE_DHKEY_COMPLETE 0x09 -struct bt_hci_evt_le_generate_dhkey_complete { - uint8_t status; - uint8_t dhkey[32]; -} __packed; - -#define BT_HCI_EVT_LE_ENH_CONN_COMPLETE 0x0a -struct bt_hci_evt_le_enh_conn_complete { - uint8_t status; - uint16_t handle; - uint8_t role; - bt_addr_le_t peer_addr; - bt_addr_t local_rpa; - bt_addr_t peer_rpa; - uint16_t interval; - uint16_t latency; - uint16_t supv_timeout; - uint8_t clock_accuracy; -} __packed; - -#define BT_HCI_EVT_LE_DIRECT_ADV_REPORT 0x0b -struct bt_hci_evt_le_direct_adv_info { - uint8_t evt_type; - bt_addr_le_t addr; - bt_addr_le_t dir_addr; - int8_t rssi; -} __packed; -struct bt_hci_evt_le_direct_adv_report { - uint8_t num_reports; - struct bt_hci_evt_le_direct_adv_info direct_adv_info[0]; -} __packed; - -#define BT_HCI_EVT_LE_PHY_UPDATE_COMPLETE 0x0c -struct bt_hci_evt_le_phy_update_complete { - uint8_t status; - uint16_t handle; - uint8_t tx_phy; - uint8_t rx_phy; -} __packed; - -#define BT_HCI_EVT_LE_EXT_ADVERTISING_REPORT 0x0d - -#define BT_HCI_LE_ADV_EVT_TYPE_CONN BIT(0) -#define BT_HCI_LE_ADV_EVT_TYPE_SCAN BIT(1) -#define BT_HCI_LE_ADV_EVT_TYPE_DIRECT BIT(2) -#define BT_HCI_LE_ADV_EVT_TYPE_SCAN_RSP BIT(3) -#define BT_HCI_LE_ADV_EVT_TYPE_LEGACY BIT(4) - -#define BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS(ev_type) (((ev_type) >> 5) & 0x03) -#define BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS_COMPLETE 0 -#define BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS_PARTIAL 1 -#define BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS_INCOMPLETE 2 - -struct bt_hci_evt_le_ext_advertising_info { - uint16_t evt_type; - bt_addr_le_t addr; - uint8_t prim_phy; - uint8_t sec_phy; - uint8_t sid; - int8_t tx_power; - int8_t rssi; - uint16_t interval; - bt_addr_le_t direct_addr; - uint8_t length; - uint8_t data[0]; -} __packed; -struct bt_hci_evt_le_ext_advertising_report { - uint8_t num_reports; - struct bt_hci_evt_le_ext_advertising_info adv_info[0]; -} __packed; - -#define BT_HCI_EVT_LE_PER_ADV_SYNC_ESTABLISHED 0x0e -struct bt_hci_evt_le_per_adv_sync_established { - uint8_t status; - uint16_t handle; - uint8_t sid; - bt_addr_le_t adv_addr; - uint8_t phy; - uint16_t interval; - uint8_t clock_accuracy; -} __packed; - -#define BT_HCI_EVT_LE_PER_ADVERTISING_REPORT 0x0f -struct bt_hci_evt_le_per_advertising_report { - uint16_t handle; - int8_t tx_power; - int8_t rssi; - uint8_t unused; - uint8_t data_status; - uint8_t length; - uint8_t data[0]; -} __packed; - -#define BT_HCI_EVT_LE_PER_ADV_SYNC_LOST 0x10 -struct bt_hci_evt_le_per_adv_sync_lost { - uint16_t handle; -} __packed; - -#define BT_HCI_EVT_LE_SCAN_TIMEOUT 0x11 - -#define BT_HCI_EVT_LE_ADV_SET_TERMINATED 0x12 -struct bt_hci_evt_le_adv_set_terminated { - uint8_t status; - uint8_t adv_handle; - uint16_t conn_handle; - uint8_t num_completed_ext_adv_evts; -} __packed; - -#define BT_HCI_EVT_LE_SCAN_REQ_RECEIVED 0x13 -struct bt_hci_evt_le_scan_req_received { - uint8_t handle; - bt_addr_le_t addr; -} __packed; - -#define BT_HCI_LE_CHAN_SEL_ALGO_1 0x00 -#define BT_HCI_LE_CHAN_SEL_ALGO_2 0x01 - -#define BT_HCI_EVT_LE_CHAN_SEL_ALGO 0x14 -struct bt_hci_evt_le_chan_sel_algo { - uint16_t handle; - uint8_t chan_sel_algo; -} __packed; - -/* Event mask bits */ - -#define BT_EVT_BIT(n) (1ULL << (n)) - -#define BT_EVT_MASK_INQUIRY_COMPLETE BT_EVT_BIT(0) -#define BT_EVT_MASK_CONN_COMPLETE BT_EVT_BIT(2) -#define BT_EVT_MASK_CONN_REQUEST BT_EVT_BIT(3) -#define BT_EVT_MASK_DISCONN_COMPLETE BT_EVT_BIT(4) -#define BT_EVT_MASK_AUTH_COMPLETE BT_EVT_BIT(5) -#define BT_EVT_MASK_REMOTE_NAME_REQ_COMPLETE BT_EVT_BIT(6) -#define BT_EVT_MASK_ENCRYPT_CHANGE BT_EVT_BIT(7) -#define BT_EVT_MASK_REMOTE_FEATURES BT_EVT_BIT(10) -#define BT_EVT_MASK_REMOTE_VERSION_INFO BT_EVT_BIT(11) -#define BT_EVT_MASK_HARDWARE_ERROR BT_EVT_BIT(15) -#define BT_EVT_MASK_ROLE_CHANGE BT_EVT_BIT(17) -#define BT_EVT_MASK_PIN_CODE_REQ BT_EVT_BIT(21) -#define BT_EVT_MASK_LINK_KEY_REQ BT_EVT_BIT(22) -#define BT_EVT_MASK_LINK_KEY_NOTIFY BT_EVT_BIT(23) -#define BT_EVT_MASK_DATA_BUFFER_OVERFLOW BT_EVT_BIT(25) -#define BT_EVT_MASK_INQUIRY_RESULT_WITH_RSSI BT_EVT_BIT(33) -#define BT_EVT_MASK_REMOTE_EXT_FEATURES BT_EVT_BIT(34) -#define BT_EVT_MASK_SYNC_CONN_COMPLETE BT_EVT_BIT(43) -#define BT_EVT_MASK_EXTENDED_INQUIRY_RESULT BT_EVT_BIT(46) -#define BT_EVT_MASK_ENCRYPT_KEY_REFRESH_COMPLETE BT_EVT_BIT(47) -#define BT_EVT_MASK_IO_CAPA_REQ BT_EVT_BIT(48) -#define BT_EVT_MASK_IO_CAPA_RESP BT_EVT_BIT(49) -#define BT_EVT_MASK_USER_CONFIRM_REQ BT_EVT_BIT(50) -#define BT_EVT_MASK_USER_PASSKEY_REQ BT_EVT_BIT(51) -#define BT_EVT_MASK_SSP_COMPLETE BT_EVT_BIT(53) -#define BT_EVT_MASK_USER_PASSKEY_NOTIFY BT_EVT_BIT(58) -#define BT_EVT_MASK_LE_META_EVENT BT_EVT_BIT(61) - -/* Page 2 */ -#define BT_EVT_MASK_PHY_LINK_COMPLETE BT_EVT_BIT(0) -#define BT_EVT_MASK_CH_SELECTED_COMPLETE BT_EVT_BIT(1) -#define BT_EVT_MASK_DISCONN_PHY_LINK_COMPLETE BT_EVT_BIT(2) -#define BT_EVT_MASK_PHY_LINK_LOSS_EARLY_WARN BT_EVT_BIT(3) -#define BT_EVT_MASK_PHY_LINK_RECOVERY BT_EVT_BIT(4) -#define BT_EVT_MASK_LOG_LINK_COMPLETE BT_EVT_BIT(5) -#define BT_EVT_MASK_DISCONN_LOG_LINK_COMPLETE BT_EVT_BIT(6) -#define BT_EVT_MASK_FLOW_SPEC_MODIFY_COMPLETE BT_EVT_BIT(7) -#define BT_EVT_MASK_NUM_COMPLETE_DATA_BLOCKS BT_EVT_BIT(8) -#define BT_EVT_MASK_AMP_START_TEST BT_EVT_BIT(9) -#define BT_EVT_MASK_AMP_TEST_END BT_EVT_BIT(10) -#define BT_EVT_MASK_AMP_RX_REPORT BT_EVT_BIT(11) -#define BT_EVT_MASK_AMP_SR_MODE_CHANGE_COMPLETE BT_EVT_BIT(12) -#define BT_EVT_MASK_AMP_STATUS_CHANGE BT_EVT_BIT(13) -#define BT_EVT_MASK_TRIGG_CLOCK_CAPTURE BT_EVT_BIT(14) -#define BT_EVT_MASK_SYNCH_TRAIN_COMPLETE BT_EVT_BIT(15) -#define BT_EVT_MASK_SYNCH_TRAIN_RX BT_EVT_BIT(16) -#define BT_EVT_MASK_CL_SLAVE_BC_RX BT_EVT_BIT(17) -#define BT_EVT_MASK_CL_SLAVE_BC_TIMEOUT BT_EVT_BIT(18) -#define BT_EVT_MASK_TRUNC_PAGE_COMPLETE BT_EVT_BIT(19) -#define BT_EVT_MASK_SLAVE_PAGE_RSP_TIMEOUT BT_EVT_BIT(20) -#define BT_EVT_MASK_CL_SLAVE_BC_CH_MAP_CHANGE BT_EVT_BIT(21) -#define BT_EVT_MASK_INQUIRY_RSP_NOT BT_EVT_BIT(22) -#define BT_EVT_MASK_AUTH_PAYLOAD_TIMEOUT_EXP BT_EVT_BIT(23) -#define BT_EVT_MASK_SAM_STATUS_CHANGE BT_EVT_BIT(24) - -#define BT_EVT_MASK_LE_CONN_COMPLETE BT_EVT_BIT(0) -#define BT_EVT_MASK_LE_ADVERTISING_REPORT BT_EVT_BIT(1) -#define BT_EVT_MASK_LE_CONN_UPDATE_COMPLETE BT_EVT_BIT(2) -#define BT_EVT_MASK_LE_REMOTE_FEAT_COMPLETE BT_EVT_BIT(3) -#define BT_EVT_MASK_LE_LTK_REQUEST BT_EVT_BIT(4) -#define BT_EVT_MASK_LE_CONN_PARAM_REQ BT_EVT_BIT(5) -#define BT_EVT_MASK_LE_DATA_LEN_CHANGE BT_EVT_BIT(6) -#define BT_EVT_MASK_LE_P256_PUBLIC_KEY_COMPLETE BT_EVT_BIT(7) -#define BT_EVT_MASK_LE_GENERATE_DHKEY_COMPLETE BT_EVT_BIT(8) -#define BT_EVT_MASK_LE_ENH_CONN_COMPLETE BT_EVT_BIT(9) -#define BT_EVT_MASK_LE_DIRECT_ADV_REPORT BT_EVT_BIT(10) -#define BT_EVT_MASK_LE_PHY_UPDATE_COMPLETE BT_EVT_BIT(11) -#define BT_EVT_MASK_LE_EXT_ADVERTISING_REPORT BT_EVT_BIT(12) -#define BT_EVT_MASK_LE_PER_ADV_SYNC_ESTABLISHED BT_EVT_BIT(13) -#define BT_EVT_MASK_LE_PER_ADVERTISING_REPORT BT_EVT_BIT(14) -#define BT_EVT_MASK_LE_PER_ADV_SYNC_LOST BT_EVT_BIT(15) -#define BT_EVT_MASK_LE_SCAN_TIMEOUT BT_EVT_BIT(16) -#define BT_EVT_MASK_LE_ADV_SET_TERMINATED BT_EVT_BIT(17) -#define BT_EVT_MASK_LE_SCAN_REQ_RECEIVED BT_EVT_BIT(18) -#define BT_EVT_MASK_LE_CHAN_SEL_ALGO BT_EVT_BIT(19) - - // -#ifdef __cplusplus -} -#endif - -#endif /* ZEPHYR_INCLUDE_BLUETOOTH_HCI_H_ */ diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 6ad4b75456..13b84bbac7 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -68,16 +68,16 @@ //| Use `_bleio.adapter` to access the sole instance available.""" //| -//| def hci_init(self, *, uart: busio.UART, cts: Pin, baudrate: int = 115200, buffer_size: int = 256): +//| def hci_uart_init(self, *, uart: busio.UART, rts: digitalio.DigitalInOut, cts: digitalio.DigitalInOut, baudrate: int = 115200, buffer_size: int = 256): //| On boards that do not have native BLE, you can an use HCI co-processor. -//| Call `_bleio.adapter.hci_init()` passing it the uart and pins used to communicate +//| Call `_bleio.adapter.hci_uart_init()` passing it the uart and pins used to communicate //| with the co-processor, such as an Adafruit AirLift. //| The co-processor must have been reset and put into BLE mode beforehand //| by the appropriate pin manipulation. -//| The `uart` object, and `rts` and `cs` pins are used to +//| The `uart`, `rts`, and `cts` objects are used to //| communicate with the HCI co-processor in HCI mode. //| -mp_obj_t bleio_adapter_hci_init(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { +mp_obj_t bleio_adapter_hci_uart_init(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { #if CIRCUITPY_BLEIO_HCI bleio_adapter_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); @@ -95,18 +95,23 @@ mp_obj_t bleio_adapter_hci_init(mp_uint_t n_args, const mp_obj_t *pos_args, mp_m if (!MP_OBJ_IS_TYPE(uart, &busio_uart_type)) { mp_raise_ValueError(translate("Expected a UART")); } - const mcu_pin_obj_t *rts = validate_obj_is_free_pin(args[ARG_rts].u_obj); - const mcu_pin_obj_t *cts = validate_obj_is_free_pin(args[ARG_cts].u_obj); - common_hal_bleio_adapter_hci_init(self, uart, rts, cts); + digitalio_digitalinout_obj_t *rts = args[ARG_rts].u_obj; + digitalio_digitalinout_obj_t *cts = args[ARG_cts].u_obj; + if (!MP_OBJ_IS_TYPE(rts, &digitalio_digitalinout_type) || + !MP_OBJ_IS_TYPE(cts, &digitalio_digitalinout_type)) { + mp_raise_ValueError(translate("Expected a DigitalInOut")); + } + common_hal_bleio_adapter_hci_uart_init(self, uart, rts, cts); + common_hal_bleio_adapter_set_enabled(self, true); return mp_const_none; #else - mp_raise_RuntimeError(translate("hci_init not available")); + mp_raise_RuntimeError(translate("hci_uart_init not available")); return mp_const_none; #endif // CIRCUITPY_BLEIO_HCI } -STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_hci_init_obj, 1, bleio_adapter_hci_init); +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_hci_uart_init_obj, 1, bleio_adapter_hci_uart_init); //| //| enabled: Any = ... @@ -433,7 +438,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_erase_bonding_obj, bleio_adapter_ STATIC const mp_rom_map_elem_t bleio_adapter_locals_dict_table[] = { #if CIRCUITPY_BLEIO_HCI - { MP_ROM_QSTR(MP_QSTR_hci_init), MP_ROM_PTR(&bleio_adapter_hci_init_obj) }, + { MP_ROM_QSTR(MP_QSTR_hci_uart_init), MP_ROM_PTR(&bleio_adapter_hci_uart_init_obj) }, #endif { MP_ROM_QSTR(MP_QSTR_enabled), MP_ROM_PTR(&bleio_adapter_enabled_obj) }, { MP_ROM_QSTR(MP_QSTR_address), MP_ROM_PTR(&bleio_adapter_address_obj) }, diff --git a/shared-bindings/_bleio/Adapter.h b/shared-bindings/_bleio/Adapter.h index 9caca161f2..0cce55ca80 100644 --- a/shared-bindings/_bleio/Adapter.h +++ b/shared-bindings/_bleio/Adapter.h @@ -38,7 +38,7 @@ const mp_obj_type_t bleio_adapter_type; #if CIRCUITPY_BLEIO_HCI -void common_hal_bleio_adapter_hci_init(bleio_adapter_obj_t *self, busio_uart_obj_t *uart, const mcu_pin_obj_t *rts, const mcu_pin_obj_t *cts); +void common_hal_bleio_adapter_hci_uart_init(bleio_adapter_obj_t *self, busio_uart_obj_t *uart, digitalio_digitalinout_obj_t *rts, digitalio_digitalinout_obj_t *cts); #endif // CIRCUITPY_BLEIO_HCI bool common_hal_bleio_adapter_get_advertising(bleio_adapter_obj_t *self); From e81d22cd67c16f95879d8af9a4034d2566922631 Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Thu, 9 Jul 2020 10:01:04 +0000 Subject: [PATCH 0264/1293] add makerdiary nrf52840 m.2 devkit Signed-off-by: Yihui Xiong --- .../makerdiary_nrf52840_m2_devkit/README.md | 8 ++ .../makerdiary_nrf52840_m2_devkit/board.c | 103 ++++++++++++++++ .../mpconfigboard.h | 52 +++++++++ .../mpconfigboard.mk | 12 ++ .../makerdiary_nrf52840_m2_devkit/pins.c | 110 ++++++++++++++++++ 5 files changed, 285 insertions(+) create mode 100644 ports/nrf/boards/makerdiary_nrf52840_m2_devkit/README.md create mode 100644 ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c create mode 100644 ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.h create mode 100644 ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.mk create mode 100644 ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c diff --git a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/README.md b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/README.md new file mode 100644 index 0000000000..b75385414b --- /dev/null +++ b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/README.md @@ -0,0 +1,8 @@ +# Makerdiary nRF52840 M.2 Developer Kit + +The devkit is a versatile IoT prototyping platform, +including the nRF52840 M.2 Module and M.2 Dock. You can use the developer kit +to prototype your IoT products and then scale to production faster using the +nRF52840 M.2 Module combined with your custom PCB hardware. + +Refer to https://github.com/makerdiary/nrf52840-m2-devkit for more details. diff --git a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c new file mode 100644 index 0000000000..e7f946f4d0 --- /dev/null +++ b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c @@ -0,0 +1,103 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2020 Yihui Xiong for Makerdiary + * + * 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 "boards/board.h" +#include "mpconfigboard.h" + +#include "shared-bindings/busio/SPI.h" +#include "shared-bindings/displayio/FourWire.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/displayio/mipi_constants.h" + +displayio_fourwire_obj_t board_display_obj; + +#define DELAY 0x80 + +uint8_t display_init_sequence[] = { + 0x01, 0 | DELAY, 150, // SWRESET + 0x11, 0 | DELAY, 255, // SLPOUT + 0x36, 1, 0b10100000, // _MADCTL for rotation 0 + 0x3a, 1, 0x55, // COLMOD - 16bit color + 0x21, 0 | DELAY, 10, // _INVON + 0x13, 0 | DELAY, 10, // _NORON + 0x29, 0 | DELAY, 255, // _DISPON +}; + +void board_init(void) { + busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; + common_hal_busio_spi_construct(spi, &pin_P0_11, &pin_P0_12, NULL); + common_hal_busio_spi_never_reset(spi); + + displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; + bus->base.type = &displayio_fourwire_type; + common_hal_displayio_fourwire_construct(bus, + spi, + &pin_P0_08, // TFT_DC Command or data + &pin_P0_06, // TFT_CS Chip select + &pin_P1_09, // TFT_RST Reset + 60000000, // Baudrate + 0, // Polarity + 0); // Phase + + displayio_display_obj_t* display = &displays[0].display; + display->base.type = &displayio_display_type; + common_hal_displayio_display_construct(display, + bus, + 240, // Width (after rotation) + 240, // Height (after rotation) + 80, // column start + 0, // row start + 0, // rotation + 16, // Color depth + false, // Grayscale + false, // Pixels in a byte share a row. Only used for depth < 8 + 1, // bytes per cell. Only valid for depths < 8 + false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word + MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command + MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command + MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command + 37, // set vertical scroll command + display_init_sequence, + sizeof(display_init_sequence), + &pin_P0_20, // backlight pin + NO_BRIGHTNESS_COMMAND, + 1.0f, // brightness (ignored) + true, // auto_brightness + false, // single_byte_bounds + false, // data_as_commands + true, // auto_refresh + 60, // native_frames_per_second + true); // backlight_on_high +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.h b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.h new file mode 100644 index 0000000000..a3fb7643f9 --- /dev/null +++ b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.h @@ -0,0 +1,52 @@ +/* + * 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 MAKERDIARYNRF52840M2DEVKIT + +#define MICROPY_HW_BOARD_NAME "Makerdiary nRF52840 M.2 Developer Kit" +#define MICROPY_HW_MCU_NAME "nRF52840" + +#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(1, 10) +#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(1, 14) +#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(1, 15) +#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(1, 12) +#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(1, 11) +#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(1, 13) + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_UART_BUS_RX (&pin_P0_15) +#define DEFAULT_UART_BUS_TX (&pin_P0_16) + +#define DEFAULT_I2C_BUS_SCL (&pin_P1_06) +#define DEFAULT_I2C_BUS_SDA (&pin_P1_05) + +#define DEFAULT_SPI_BUS_SCK (&pin_P0_11) +#define DEFAULT_SPI_BUS_MOSI (&pin_P0_12) +#define DEFAULT_SPI_BUS_MISO (&pin_P1_08) diff --git a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.mk b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.mk new file mode 100644 index 0000000000..bc5fa3c120 --- /dev/null +++ b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.mk @@ -0,0 +1,12 @@ +USB_VID = 0x1915 +USB_PID = 0xb001 +USB_PRODUCT = "nRF52840 M.2 Developer Kit" +USB_MANUFACTURER = "Makerdiary" + +MCU_CHIP = nrf52840 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = "MX25R6435F" + +CIRCUITPY_ENABLE_MPY_NATIVE = 1 diff --git a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c new file mode 100644 index 0000000000..1032555dca --- /dev/null +++ b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c @@ -0,0 +1,110 @@ +#include "shared-bindings/board/__init__.h" + +#include "boards/board.h" +#include "shared-module/displayio/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_AIN0), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_AIN1), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_AIN2), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_AIN3), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_AIN4), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_AIN5), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_AIN6), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_AIN7), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_AREF), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_VDIV), MP_ROM_PTR(&pin_P0_05) }, + + { 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_P2), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_P6), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_P7), MP_ROM_PTR(&pin_P0_07) }, + { MP_ROM_QSTR(MP_QSTR_P8), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_P9), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_P10), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_P11), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_P12), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_P13), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_P14), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_P15), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_P16), MP_ROM_PTR(&pin_P0_16) }, + { MP_ROM_QSTR(MP_QSTR_P17), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_P18), MP_ROM_PTR(&pin_P0_18) }, + { MP_ROM_QSTR(MP_QSTR_P19), MP_ROM_PTR(&pin_P0_19) }, + { MP_ROM_QSTR(MP_QSTR_P20), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_P21), MP_ROM_PTR(&pin_P0_21) }, + { MP_ROM_QSTR(MP_QSTR_P25), MP_ROM_PTR(&pin_P0_25) }, + { MP_ROM_QSTR(MP_QSTR_P26), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_P27), MP_ROM_PTR(&pin_P0_27) }, + { MP_ROM_QSTR(MP_QSTR_P28), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_P29), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_P30), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_P31), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_P1_0), MP_ROM_PTR(&pin_P1_00) }, + { MP_ROM_QSTR(MP_QSTR_P1_1), MP_ROM_PTR(&pin_P1_01) }, + { MP_ROM_QSTR(MP_QSTR_P1_2), MP_ROM_PTR(&pin_P1_02) }, + { MP_ROM_QSTR(MP_QSTR_P1_3), MP_ROM_PTR(&pin_P1_03) }, + { MP_ROM_QSTR(MP_QSTR_P1_4), MP_ROM_PTR(&pin_P1_04) }, + { MP_ROM_QSTR(MP_QSTR_P1_5), MP_ROM_PTR(&pin_P1_05) }, + { MP_ROM_QSTR(MP_QSTR_P1_6), MP_ROM_PTR(&pin_P1_06) }, + { MP_ROM_QSTR(MP_QSTR_P1_7), MP_ROM_PTR(&pin_P1_07) }, + { MP_ROM_QSTR(MP_QSTR_P1_8), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_P1_9), MP_ROM_PTR(&pin_P1_09) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_P0_16) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P0_19) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P0_21) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P0_22) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P0_23) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P1_00) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P1_01) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_P1_02) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_P1_03) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P1_04) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P1_07) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_P1_05) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_P1_06) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_P0_27) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_04) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P1_08) }, + + { MP_ROM_QSTR(MP_QSTR_LCD_DC), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_LCD_CS), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_LCD_BL), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_LCD_RST), MP_ROM_PTR(&pin_P1_09) }, + + { MP_ROM_QSTR(MP_QSTR_TXD), MP_ROM_PTR(&pin_P0_16) }, + { MP_ROM_QSTR(MP_QSTR_RXD), MP_ROM_PTR(&pin_P0_15) }, + + { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_USR_BTN), MP_ROM_PTR(&pin_P0_19) }, + + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + + { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)} +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 96f6ce222ce057df1a1f97a8d2be51232548d26f Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Thu, 9 Jul 2020 10:02:27 +0000 Subject: [PATCH 0265/1293] add makerdiary m60 keyboard Signed-off-by: Yihui Xiong --- .../boards/makerdiary_m60_keyboard/README.md | 4 ++ .../boards/makerdiary_m60_keyboard/board.c | 38 +++++++++++++++ .../makerdiary_m60_keyboard/mpconfigboard.h | 48 +++++++++++++++++++ .../makerdiary_m60_keyboard/mpconfigboard.mk | 13 +++++ .../nrf/boards/makerdiary_m60_keyboard/pins.c | 41 ++++++++++++++++ 5 files changed, 144 insertions(+) create mode 100644 ports/nrf/boards/makerdiary_m60_keyboard/README.md create mode 100644 ports/nrf/boards/makerdiary_m60_keyboard/board.c create mode 100644 ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h create mode 100644 ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.mk create mode 100644 ports/nrf/boards/makerdiary_m60_keyboard/pins.c diff --git a/ports/nrf/boards/makerdiary_m60_keyboard/README.md b/ports/nrf/boards/makerdiary_m60_keyboard/README.md new file mode 100644 index 0000000000..04486ba210 --- /dev/null +++ b/ports/nrf/boards/makerdiary_m60_keyboard/README.md @@ -0,0 +1,4 @@ +# Makerdiary M60 Keyboard + +M60 is a USB & BLE, modular, hot-swappable, 60% keyboard powered by Python. +Refer to https://makerdiary.com/m60 for more details. diff --git a/ports/nrf/boards/makerdiary_m60_keyboard/board.c b/ports/nrf/boards/makerdiary_m60_keyboard/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/nrf/boards/makerdiary_m60_keyboard/board.c @@ -0,0 +1,38 @@ +/* + * 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 "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h b/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h new file mode 100644 index 0000000000..c59a5fdb28 --- /dev/null +++ b/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h @@ -0,0 +1,48 @@ +/* + * 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 MAKERDIARYM60KEYBOARD + +#define MICROPY_HW_BOARD_NAME "Makerdiary M60 Keyboard" +#define MICROPY_HW_MCU_NAME "nRF52840" + +#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(1, 10) +#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(1, 14) +#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(1, 15) +#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(1, 12) +#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(1, 11) +#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(1, 13) + +#define BOARD_HAS_CRYSTAL 1 + +// #define DEFAULT_UART_BUS_RX (&pin_P0_15) +// #define DEFAULT_UART_BUS_TX (&pin_P0_16) + +#define DEFAULT_I2C_BUS_SCL (&pin_P1_06) +#define DEFAULT_I2C_BUS_SDA (&pin_P1_05) diff --git a/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.mk b/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.mk new file mode 100644 index 0000000000..59eba13343 --- /dev/null +++ b/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.mk @@ -0,0 +1,13 @@ +USB_VID = 0x1915 +USB_PID = 0xb001 +USB_PRODUCT = "M60 Keyboard" +USB_MANUFACTURER = "Makerdiary" + +MCU_CHIP = nrf52840 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = "MX25R6435F" + +CIRCUITPY_ENABLE_MPY_NATIVE = 1 + diff --git a/ports/nrf/boards/makerdiary_m60_keyboard/pins.c b/ports/nrf/boards/makerdiary_m60_keyboard/pins.c new file mode 100644 index 0000000000..63c3ad1711 --- /dev/null +++ b/ports/nrf/boards/makerdiary_m60_keyboard/pins.c @@ -0,0 +1,41 @@ +#include "shared-bindings/board/__init__.h" + +#include "boards/board.h" +#include "shared-module/displayio/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_R1), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_R2), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_R3), MP_ROM_PTR(&pin_P0_07) }, + { MP_ROM_QSTR(MP_QSTR_R4), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_R5), MP_ROM_PTR(&pin_P1_09) }, + { MP_ROM_QSTR(MP_QSTR_R6), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_R7), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_R8), MP_ROM_PTR(&pin_P0_11) }, + + { MP_ROM_QSTR(MP_QSTR_C1), MP_ROM_PTR(&pin_P0_19) }, + { MP_ROM_QSTR(MP_QSTR_C2), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_C3), MP_ROM_PTR(&pin_P0_21) }, + { MP_ROM_QSTR(MP_QSTR_C4), MP_ROM_PTR(&pin_P0_22) }, + { MP_ROM_QSTR(MP_QSTR_C5), MP_ROM_PTR(&pin_P0_23) }, + { MP_ROM_QSTR(MP_QSTR_C6), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_C7), MP_ROM_PTR(&pin_P0_25) }, + { MP_ROM_QSTR(MP_QSTR_C8), MP_ROM_PTR(&pin_P0_26) }, + + { MP_ROM_QSTR(MP_QSTR_TXD), MP_ROM_PTR(&pin_P0_16) }, + { MP_ROM_QSTR(MP_QSTR_RXD), MP_ROM_PTR(&pin_P0_15) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P1_06) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P1_05) }, + + { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_BTN), MP_ROM_PTR(&pin_P0_27) }, + +// { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) } +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 8fef69809c34ff85651649790336fb7164cc38d3 Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Thu, 9 Jul 2020 10:04:26 +0000 Subject: [PATCH 0266/1293] add m60 keyboard and nrf52840 m.2 devkit to build action Signed-off-by: Yihui Xiong --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00454cc2da..f615cb7ce6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -193,6 +193,8 @@ jobs: - "itsybitsy_m4_express" - "itsybitsy_nrf52840_express" - "kicksat-sprite" + - "makerdiary_m60_keyboard" + - "makerdiary_nrf52840_m2_devkit" - "makerdiary_nrf52840_mdk" - "makerdiary_nrf52840_mdk_usb_dongle" - "meowbit_v121" From e0733d153ee159fd235794825fada7d455828007 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Wed, 8 Jul 2020 20:59:00 +0200 Subject: [PATCH 0267/1293] SAMD: configurable brownout, separate the variables --- ports/atmel-samd/boards/pewpew10/mpconfigboard.h | 2 +- ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h | 3 +-- ports/atmel-samd/mpconfigport.h | 14 ++++++++++---- ports/atmel-samd/supervisor/port.c | 10 ++++------ 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.h b/ports/atmel-samd/boards/pewpew10/mpconfigboard.h index 940e250b46..2cb097e8dc 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.h +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.h @@ -44,4 +44,4 @@ #define DEFAULT_UART_BUS_RX (&pin_PA01) #define DEFAULT_UART_BUS_TX (&pin_PA00) -#define BOARD_BROWNOUT_LEVEL (6) +#define SAMD21_BOD33_LEVEL (6) diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h index 7da5cf14c1..4b88c89f28 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h @@ -41,5 +41,4 @@ #define IGNORE_PIN_PB10 1 #define IGNORE_PIN_PB11 1 -#define BOARD_BROWNOUT_LEVEL (6) -// 1.6V +#define SAMD5x_E5x_BOD33_LEVEL (100) diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 3a5d4e1a2f..540a2f77c7 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -112,8 +112,11 @@ #define CIRCUITPY_DEFAULT_STACK_SIZE 4096 #endif -#ifndef BOARD_BROWNOUT_LEVEL ( -#define BOARD_BROWNLOUT_LEVEL (39) +#ifndef SAMD21_BOD33_LEVEL +// Set brownout detection to ~2.7V. Default from factory is 1.7V, +// which is too low for proper operation of external SPI flash chips +// (they are 2.7-3.6V). +#define SAMD21_BOD33_LEVEL (39) // 2.77V with hysteresis off. Table 37.20 in datasheet. #endif @@ -134,8 +137,11 @@ #define CIRCUITPY_DEFAULT_STACK_SIZE (24*1024) #endif -#ifndef BOARD_BROWNOUT_LEVEL ( -#define BOARD_BROWNLOUT_LEVEL (200) +#ifndef SAMD5x_E5x_BOD33_LEVEL +// Set brownout detection to ~2.7V. Default from factory is 1.7V, +// which is too low for proper operation of external SPI flash chips +// (they are 2.7-3.6V). +#define SAMD5x_E5x_BOD33_LEVEL (200) // 2.7V: 1.5V + LEVEL * 6mV. #endif diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 5b085dc81b..65501861e0 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -206,11 +206,10 @@ static void rtc_init(void) { safe_mode_t port_init(void) { #if defined(SAMD21) - // Set brownout detection. Default from factory is 1.7V, - // which is too low for proper operation of external SPI flash chips (they are 2.7-3.6V). + // Set brownout detection. // Disable while changing level. SYSCTRL->BOD33.bit.ENABLE = 0; - SYSCTRL->BOD33.bit.LEVEL = BOARD_BROWNOUT_LEVEL; + SYSCTRL->BOD33.bit.LEVEL = SAMD21_BOD33_LEVEL; SYSCTRL->BOD33.bit.ENABLE = 1; #ifdef ENABLE_MICRO_TRACE_BUFFER @@ -225,11 +224,10 @@ safe_mode_t port_init(void) { #endif #if defined(SAM_D5X_E5X) - // Set brownout detection to ~2.7V. Default from factory is 1.7V, - // which is too low for proper operation of external SPI flash chips (they are 2.7-3.6V). + // Set brownout detection. // Disable while changing level. SUPC->BOD33.bit.ENABLE = 0; - SUPC->BOD33.bit.LEVEL = BOARD_BROWNOUT_LEVEL; + SUPC->BOD33.bit.LEVEL = SAMD5x_E5x_BOD33_LEVEL; SUPC->BOD33.bit.ENABLE = 1; // MPU (Memory Protection Unit) setup. From 678f26639433ebd26259a973aacd97e1cf765d2a Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Thu, 9 Jul 2020 10:25:46 +0000 Subject: [PATCH 0268/1293] fix pre-commit check --- ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.mk | 1 - ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.mk b/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.mk index 59eba13343..46f9885cb1 100644 --- a/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.mk +++ b/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.mk @@ -10,4 +10,3 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "MX25R6435F" CIRCUITPY_ENABLE_MPY_NATIVE = 1 - diff --git a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c index 1032555dca..cb3bda35ab 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c +++ b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c @@ -103,7 +103,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, - + { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)} }; From f1509debc3ae067f7ad7ba57a70e3235f4eeb564 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 7 Jul 2020 10:11:58 -0500 Subject: [PATCH 0269/1293] lib/mp3: update to 1.2.2 release This fixes the audio clipping bug --- lib/mp3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mp3 b/lib/mp3 index c3c664bf4d..bc58a65496 160000 --- a/lib/mp3 +++ b/lib/mp3 @@ -1 +1 @@ -Subproject commit c3c664bf4db6a36d11808dfcbb5dbf7cff1715b8 +Subproject commit bc58a654964c799e972719a63ff12694998f3549 From 2bcc5c06c2efe5fb9469cab2f8f9aa801fbde14b Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 9 Jul 2020 11:41:00 -0400 Subject: [PATCH 0270/1293] Fix advanced claimed pin/package timer search --- ports/stm/common-hal/microcontroller/Pin.c | 2 + ports/stm/peripherals/timers.c | 44 +++++++++++----------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index 3e3fc05227..d919b07ea7 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -89,6 +89,8 @@ void reset_pin_number(uint8_t pin_port, uint8_t pin_number) { void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number) { never_reset_pins[pin_port] |= 1<=0; i--) { + for (size_t i = (MP_ARRAY_SIZE(mcu_tim_banks) - 1); i >= 0; i--) { if ((!stm_timer_reserved[i]) && (mcu_tim_banks[i] != NULL)) { return mcu_tim_banks[i]; } From edc48a505fd92ed246696be38cc2d3c1e2c36fcf Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 9 Jul 2020 13:10:18 -0400 Subject: [PATCH 0271/1293] Complete F405 pin and periph definitions --- ports/stm/.gitignore | 1 + .../peripherals/stm32f4/stm32f405xx/periph.c | 182 +++++++------- .../peripherals/stm32f4/stm32f405xx/periph.h | 35 +-- .../peripherals/stm32f4/stm32f405xx/pins.c | 233 +++++++++--------- .../peripherals/stm32f4/stm32f405xx/pins.h | 209 ++++++++-------- ports/stm/tools/parse_af_csv.py | 2 + ports/stm/tools/pins.csv | 93 ------- ports/stm/tools/stm32f767_af.csv | 168 ------------- 8 files changed, 348 insertions(+), 575 deletions(-) delete mode 100644 ports/stm/tools/pins.csv delete mode 100644 ports/stm/tools/stm32f767_af.csv diff --git a/ports/stm/.gitignore b/ports/stm/.gitignore index 5d645392ca..e46c927eec 100644 --- a/ports/stm/.gitignore +++ b/ports/stm/.gitignore @@ -5,5 +5,6 @@ build-*/ # Reference files ##################### ref/ +_working* .gdb_history diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c index e75f0b2062..e2124bc309 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c @@ -29,55 +29,57 @@ #include "peripherals/pins.h" #include "peripherals/periph.h" -// I2C +I2C_TypeDef * mcu_i2c_banks[I2C_BANK_ARRAY_LEN] = {I2C1, I2C2, I2C3}; -I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; - -const mcu_periph_obj_t mcu_i2c_sda_list[4] = { +const mcu_periph_obj_t mcu_i2c_sda_list[I2C_SDA_ARRAY_LEN] = { PERIPH(1, 4, &pin_PB07), PERIPH(1, 4, &pin_PB09), PERIPH(2, 4, &pin_PB11), PERIPH(3, 4, &pin_PC09), + PERIPH(2, 4, &pin_PF00), + PERIPH(2, 4, &pin_PH05), + PERIPH(3, 4, &pin_PH08), }; - -const mcu_periph_obj_t mcu_i2c_scl_list[4] = { +const mcu_periph_obj_t mcu_i2c_scl_list[I2C_SCL_ARRAY_LEN] = { + PERIPH(3, 4, &pin_PA08), PERIPH(1, 4, &pin_PB06), PERIPH(1, 4, &pin_PB08), PERIPH(2, 4, &pin_PB10), - PERIPH(3, 4, &pin_PA08) + PERIPH(2, 4, &pin_PF01), + PERIPH(2, 4, &pin_PH04), + PERIPH(3, 4, &pin_PH07), }; -SPI_TypeDef * mcu_spi_banks[3] = {SPI1, SPI2, SPI3}; +SPI_TypeDef * mcu_spi_banks[SPI_BANK_ARRAY_LEN] = {SPI1, SPI2, SPI3}; -const mcu_periph_obj_t mcu_spi_sck_list[7] = { +const mcu_periph_obj_t mcu_spi_sck_list[SPI_SCK_ARRAY_LEN] = { PERIPH(1, 5, &pin_PA05), PERIPH(1, 5, &pin_PB03), + PERIPH(3, 6, &pin_PB03), PERIPH(2, 5, &pin_PB10), PERIPH(2, 5, &pin_PB13), - PERIPH(2, 5, &pin_PC07), - PERIPH(3, 6, &pin_PB03), PERIPH(3, 6, &pin_PC10), + PERIPH(2, 5, &pin_PI01), }; - -const mcu_periph_obj_t mcu_spi_mosi_list[6] = { +const mcu_periph_obj_t mcu_spi_mosi_list[SPI_MOSI_ARRAY_LEN] = { PERIPH(1, 5, &pin_PA07), PERIPH(1, 5, &pin_PB05), + PERIPH(3, 6, &pin_PB05), PERIPH(2, 5, &pin_PB15), PERIPH(2, 5, &pin_PC03), - PERIPH(3, 6, &pin_PB05), PERIPH(3, 6, &pin_PC12), + PERIPH(2, 5, &pin_PI03), }; - -const mcu_periph_obj_t mcu_spi_miso_list[6] = { +const mcu_periph_obj_t mcu_spi_miso_list[SPI_MISO_ARRAY_LEN] = { PERIPH(1, 5, &pin_PA06), PERIPH(1, 5, &pin_PB04), + PERIPH(3, 6, &pin_PB04), PERIPH(2, 5, &pin_PB14), PERIPH(2, 5, &pin_PC02), - PERIPH(3, 6, &pin_PB04), PERIPH(3, 6, &pin_PC11), + PERIPH(2, 5, &pin_PI02), }; - -const mcu_periph_obj_t mcu_spi_nss_list[6] = { +const mcu_periph_obj_t mcu_spi_nss_list[SPI_NSS_ARRAY_LEN] = { PERIPH(1, 5, &pin_PA04), PERIPH(1, 5, &pin_PA15), PERIPH(2, 5, &pin_PB09), @@ -89,7 +91,7 @@ const mcu_periph_obj_t mcu_spi_nss_list[6] = { USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, UART4, UART5, USART6}; bool mcu_uart_has_usart[MAX_UART] = {true, true, true, false, false, true}; -const mcu_periph_obj_t mcu_uart_tx_list[12] = { +const mcu_periph_obj_t mcu_uart_tx_list[UART_TX_ARRAY_LEN] = { PERIPH(4, 8, &pin_PA00), PERIPH(2, 7, &pin_PA02), PERIPH(1, 7, &pin_PA09), @@ -103,8 +105,7 @@ const mcu_periph_obj_t mcu_uart_tx_list[12] = { PERIPH(3, 7, &pin_PD08), PERIPH(6, 8, &pin_PG14), }; - -const mcu_periph_obj_t mcu_uart_rx_list[12] = { +const mcu_periph_obj_t mcu_uart_rx_list[UART_RX_ARRAY_LEN] = { PERIPH(4, 8, &pin_PA01), PERIPH(2, 7, &pin_PA03), PERIPH(1, 7, &pin_PA10), @@ -121,74 +122,75 @@ const mcu_periph_obj_t mcu_uart_rx_list[12] = { //Timers //TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins -TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, TIM8, TIM9, TIM10, +TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, TIM8, TIM9, TIM10, TIM11, TIM12, TIM13, TIM14}; -const mcu_tim_pin_obj_t mcu_tim_pin_list[56] = { - TIM(2,1,1,&pin_PA00), - TIM(5,2,1,&pin_PA00), - TIM(2,1,2,&pin_PA01), - TIM(5,2,2,&pin_PA01), - TIM(2,1,3,&pin_PA02), - TIM(5,2,3,&pin_PA02), - TIM(2,1,4,&pin_PA03), - TIM(5,2,4,&pin_PA03), - TIM(9,3,1,&pin_PA02), - TIM(9,3,2,&pin_PA03), - TIM(3,2,1,&pin_PA06), - TIM(13,9,1,&pin_PA06), - TIM(3,2,2,&pin_PA07), - TIM(14,9,1,&pin_PA07), - TIM(1,1,1,&pin_PA08), - TIM(1,1,2,&pin_PA09), - TIM(1,1,3,&pin_PA10), - TIM(1,1,4,&pin_PA11), - TIM(2,1,1,&pin_PA15), - TIM(3,2,3,&pin_PB00), - TIM(3,2,4,&pin_PB01), - TIM(2,1,2,&pin_PB03), - TIM(3,2,1,&pin_PB04), - TIM(3,2,2,&pin_PB05), - TIM(4,2,1,&pin_PB06), - TIM(4,2,2,&pin_PB07), - TIM(4,2,3,&pin_PB08), - TIM(10,2,1,&pin_PB08), - TIM(4,2,4,&pin_PB09), - TIM(11,2,1,&pin_PB09), - TIM(2,1,3,&pin_PB10), - TIM(2,1,4,&pin_PB11), - TIM(12,9,1,&pin_PB14), - TIM(12,9,2,&pin_PB15), - TIM(3,2,1,&pin_PC06), - TIM(3,2,2,&pin_PC07), - TIM(3,2,3,&pin_PC08), - TIM(3,2,4,&pin_PC09), - TIM(8,3,1,&pin_PC06), - TIM(8,3,2,&pin_PC07), - TIM(8,3,3,&pin_PC08), - TIM(8,3,4,&pin_PC09), - TIM(4,2,1,&pin_PD12), - TIM(4,2,2,&pin_PD13), - TIM(4,2,3,&pin_PD14), - TIM(4,2,4,&pin_PD15), - TIM(9,3,1,&pin_PE05), - TIM(9,3,2,&pin_PE06), - TIM(1,1,1,&pin_PE09), - TIM(1,1,2,&pin_PE11), - TIM(1,1,3,&pin_PE13), - TIM(1,1,4,&pin_PE14), - TIM(10,3,1,&pin_PF06), - TIM(11,3,1,&pin_PF07), - TIM(13,9,1,&pin_PF08), - TIM(14,9,1,&pin_PF09), - // TIM(12,9,1,&pin_PH06), //TODO: include these when pin map is expanded - // TIM(12,9,2,&pin_PH09), - // TIM(5,2,1,&pin_PH10), - // TIM(5,2,2,&pin_PH11), - // TIM(5,2,3,&pin_PH12), - // TIM(5,2,4,&pin_PI00), - // TIM(8,3,4,&pin_PI02), - // TIM(8,3,1,&pin_PI05), - // TIM(8,3,2,&pin_PI06), - // TIM(8,3,3,&pin_PI07), +const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN] = { + TIM(2, 1, 1, &pin_PA00), + TIM(5, 2, 1, &pin_PA00), + TIM(2, 1, 2, &pin_PA01), + TIM(5, 2, 2, &pin_PA01), + TIM(2, 1, 3, &pin_PA02), + TIM(5, 2, 3, &pin_PA02), + TIM(9, 3, 1, &pin_PA02), + TIM(2, 1, 4, &pin_PA03), + TIM(5, 2, 4, &pin_PA03), + TIM(9, 3, 2, &pin_PA03), + TIM(2, 1, 1, &pin_PA05), + TIM(3, 2, 1, &pin_PA06), + TIM(13, 9, 1, &pin_PA06), + TIM(3, 2, 2, &pin_PA07), + TIM(14, 9, 1, &pin_PA07), + TIM(1, 1, 1, &pin_PA08), + TIM(1, 1, 2, &pin_PA09), + TIM(1, 1, 3, &pin_PA10), + TIM(1, 1, 4, &pin_PA11), + TIM(2, 1, 1, &pin_PA15), + TIM(3, 2, 3, &pin_PB00), + TIM(3, 2, 4, &pin_PB01), + TIM(2, 1, 2, &pin_PB03), + TIM(3, 2, 1, &pin_PB04), + TIM(3, 2, 2, &pin_PB05), + TIM(4, 2, 1, &pin_PB06), + TIM(4, 2, 2, &pin_PB07), + TIM(4, 2, 3, &pin_PB08), + TIM(10, 3, 1, &pin_PB08), + TIM(4, 2, 4, &pin_PB09), + TIM(11, 3, 1, &pin_PB09), + TIM(2, 1, 3, &pin_PB10), + TIM(2, 1, 4, &pin_PB11), + TIM(12, 9, 1, &pin_PB14), + TIM(12, 9, 2, &pin_PB15), + TIM(3, 2, 1, &pin_PC06), + TIM(8, 3, 1, &pin_PC06), + TIM(3, 2, 2, &pin_PC07), + TIM(8, 3, 2, &pin_PC07), + TIM(3, 2, 3, &pin_PC08), + TIM(8, 3, 3, &pin_PC08), + TIM(3, 2, 4, &pin_PC09), + TIM(8, 3, 4, &pin_PC09), + TIM(4, 2, 1, &pin_PD12), + TIM(4, 2, 2, &pin_PD13), + TIM(4, 2, 3, &pin_PD14), + TIM(4, 2, 4, &pin_PD15), + TIM(9, 3, 1, &pin_PE05), + TIM(9, 3, 2, &pin_PE06), + TIM(1, 1, 1, &pin_PE09), + TIM(1, 1, 2, &pin_PE11), + TIM(1, 1, 3, &pin_PE13), + TIM(1, 1, 4, &pin_PE14), + TIM(10, 3, 1, &pin_PF06), + TIM(11, 3, 1, &pin_PF07), + TIM(13, 9, 1, &pin_PF08), + TIM(14, 9, 1, &pin_PF09), + TIM(12, 9, 1, &pin_PH06), + TIM(12, 9, 2, &pin_PH09), + TIM(5, 2, 1, &pin_PH10), + TIM(5, 2, 2, &pin_PH11), + TIM(5, 2, 3, &pin_PH12), + TIM(5, 2, 4, &pin_PI00), + TIM(8, 3, 4, &pin_PI02), + TIM(8, 3, 1, &pin_PI05), + TIM(8, 3, 2, &pin_PI06), + TIM(8, 3, 3, &pin_PI07), }; diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h index df67a99d79..e52568c855 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h @@ -28,29 +28,36 @@ #define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PERIPH_H //I2C -extern I2C_TypeDef * mcu_i2c_banks[3]; - -extern const mcu_periph_obj_t mcu_i2c_sda_list[4]; -extern const mcu_periph_obj_t mcu_i2c_scl_list[4]; +#define I2C_BANK_ARRAY_LEN 3 +#define I2C_SDA_ARRAY_LEN 7 +#define I2C_SCL_ARRAY_LEN 7 +extern I2C_TypeDef * mcu_i2c_banks[I2C_BANK_ARRAY_LEN]; +extern const mcu_periph_obj_t mcu_i2c_sda_list[I2C_SDA_ARRAY_LEN]; +extern const mcu_periph_obj_t mcu_i2c_scl_list[I2C_SCL_ARRAY_LEN]; //SPI -extern SPI_TypeDef * mcu_spi_banks[3]; - -extern const mcu_periph_obj_t mcu_spi_sck_list[7]; -extern const mcu_periph_obj_t mcu_spi_mosi_list[6]; -extern const mcu_periph_obj_t mcu_spi_miso_list[6]; -extern const mcu_periph_obj_t mcu_spi_nss_list[6]; +#define SPI_BANK_ARRAY_LEN 3 +#define SPI_SCK_ARRAY_LEN 7 +#define SPI_MOSI_ARRAY_LEN 7 +#define SPI_MISO_ARRAY_LEN 7 +#define SPI_NSS_ARRAY_LEN 6 +extern SPI_TypeDef * mcu_spi_banks[SPI_BANK_ARRAY_LEN]; +extern const mcu_periph_obj_t mcu_spi_sck_list[SPI_SCK_ARRAY_LEN]; +extern const mcu_periph_obj_t mcu_spi_mosi_list[SPI_MOSI_ARRAY_LEN]; +extern const mcu_periph_obj_t mcu_spi_miso_list[SPI_MISO_ARRAY_LEN]; +extern const mcu_periph_obj_t mcu_spi_nss_list[SPI_NSS_ARRAY_LEN]; //UART +#define UART_TX_ARRAY_LEN 12 +#define UART_RX_ARRAY_LEN 12 extern USART_TypeDef * mcu_uart_banks[MAX_UART]; extern bool mcu_uart_has_usart[MAX_UART]; - -extern const mcu_periph_obj_t mcu_uart_tx_list[12]; -extern const mcu_periph_obj_t mcu_uart_rx_list[12]; +extern const mcu_periph_obj_t mcu_uart_tx_list[UART_TX_ARRAY_LEN]; +extern const mcu_periph_obj_t mcu_uart_rx_list[UART_RX_ARRAY_LEN]; //Timers #define TIM_BANK_ARRAY_LEN 14 -#define TIM_PIN_ARRAY_LEN 56 +#define TIM_PIN_ARRAY_LEN 67 TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c index 4282741a84..62acb19550 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c @@ -28,33 +28,6 @@ #include "py/mphal.h" #include "peripherals/pins.h" -const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); -const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); -const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); -const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); -const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); - -const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp -const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN -const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT - -const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3,9)); // 144 only -const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3,14)); // 144 only -const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3,15)); // 144 only -const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3,4)); // 144 only -const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3,5)); // 144 only -const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3,6)); // 144 only -const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3,7)); // 144 only -const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3,8)); // 144 only - -const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_123,10)); -const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_123,11)); -const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_123,12)); -const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_123,13)); - const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_123,0)); const mcu_pin_obj_t pin_PA01 = PIN(0, 1, ADC_INPUT(ADC_123,1)); const mcu_pin_obj_t pin_PA02 = PIN(0, 2, ADC_INPUT(ADC_123,2)); @@ -63,23 +36,69 @@ const mcu_pin_obj_t pin_PA04 = PIN(0, 4, ADC_INPUT(ADC_12,4)); const mcu_pin_obj_t pin_PA05 = PIN(0, 5, ADC_INPUT(ADC_12,5)); const mcu_pin_obj_t pin_PA06 = PIN(0, 6, ADC_INPUT(ADC_12,6)); const mcu_pin_obj_t pin_PA07 = PIN(0, 7, ADC_INPUT(ADC_12,7)); - -const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_12,14)); -const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_12,15)); - +const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); +const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); +const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); +const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); +const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); +const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); +const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); +const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_12,8)); const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_12,9)); -const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); //BOOT1 - -const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only - +const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); +const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); +const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); +const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); +const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); +const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); +const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); +const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); +const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); +const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); +const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); +const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); +const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); +const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); +const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_123,10)); +const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_123,11)); +const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_123,12)); +const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_123,13)); +const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_12,14)); +const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_12,15)); +const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); +const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); +const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); +const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); +const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); +const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); +const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); +const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); +const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); +const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); +const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); +const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); +const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); +const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); +const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); +const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); +const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); +const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); +const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); +const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); +const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); +const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); +const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); +const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); +const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); +const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); +const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); +const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); +const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); +const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); +const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); +const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); +const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); @@ -89,73 +108,63 @@ const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); - -const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); -const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); -const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); -const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); -const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); -const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); - -const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); -const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); -const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); -const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); -const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); -const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); -const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); -const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); - -const mcu_pin_obj_t pin_PG02 = PIN(6, 2, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG03 = PIN(6, 3, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG04 = PIN(6, 4, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG05 = PIN(6, 5, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG06 = PIN(6, 6, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG07 = PIN(6, 7, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG08 = PIN(6, 8, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); -const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); -const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); -const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); - -const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); -const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); -const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); -const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); -const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); -const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); -const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); -const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); - -const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); -const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); -const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); - -const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); -const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); -const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); -const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); -const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); -const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); -const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); -const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); - -const mcu_pin_obj_t pin_PG09 = PIN(6, 9, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG10 = PIN(6, 10, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG11 = PIN(6, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG12 = PIN(6, 12, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG13 = PIN(6, 13, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG14 = PIN(6, 14, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG15 = PIN(6, 15, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); -const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); -const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); -const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); -const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); -const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); -const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); - -const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); -const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); +const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); +const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); +const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); +const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3,9)); +const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3,14)); +const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3,15)); +const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3,4)); +const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3,5)); +const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3,6)); +const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3,7)); +const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3,8)); +const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); +const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); +const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); +const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); +const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); +const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); +const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); +const mcu_pin_obj_t pin_PG02 = PIN(6, 2, NO_ADC); +const mcu_pin_obj_t pin_PG03 = PIN(6, 3, NO_ADC); +const mcu_pin_obj_t pin_PG04 = PIN(6, 4, NO_ADC); +const mcu_pin_obj_t pin_PG05 = PIN(6, 5, NO_ADC); +const mcu_pin_obj_t pin_PG06 = PIN(6, 6, NO_ADC); +const mcu_pin_obj_t pin_PG07 = PIN(6, 7, NO_ADC); +const mcu_pin_obj_t pin_PG08 = PIN(6, 8, NO_ADC); +const mcu_pin_obj_t pin_PG09 = PIN(6, 9, NO_ADC); +const mcu_pin_obj_t pin_PG10 = PIN(6, 10, NO_ADC); +const mcu_pin_obj_t pin_PG11 = PIN(6, 11, NO_ADC); +const mcu_pin_obj_t pin_PG12 = PIN(6, 12, NO_ADC); +const mcu_pin_obj_t pin_PG13 = PIN(6, 13, NO_ADC); +const mcu_pin_obj_t pin_PG14 = PIN(6, 14, NO_ADC); +const mcu_pin_obj_t pin_PG15 = PIN(6, 15, NO_ADC); +const mcu_pin_obj_t pin_PH00 = PIN(7, 0, NO_ADC); +const mcu_pin_obj_t pin_PH01 = PIN(7, 1, NO_ADC); +const mcu_pin_obj_t pin_PH02 = PIN(7, 2, NO_ADC); +const mcu_pin_obj_t pin_PH03 = PIN(7, 3, NO_ADC); +const mcu_pin_obj_t pin_PH04 = PIN(7, 4, NO_ADC); +const mcu_pin_obj_t pin_PH05 = PIN(7, 5, NO_ADC); +const mcu_pin_obj_t pin_PH06 = PIN(7, 6, NO_ADC); +const mcu_pin_obj_t pin_PH07 = PIN(7, 7, NO_ADC); +const mcu_pin_obj_t pin_PH08 = PIN(7, 8, NO_ADC); +const mcu_pin_obj_t pin_PH09 = PIN(7, 9, NO_ADC); +const mcu_pin_obj_t pin_PH10 = PIN(7, 10, NO_ADC); +const mcu_pin_obj_t pin_PH11 = PIN(7, 11, NO_ADC); +const mcu_pin_obj_t pin_PH12 = PIN(7, 12, NO_ADC); +const mcu_pin_obj_t pin_PH13 = PIN(7, 13, NO_ADC); +const mcu_pin_obj_t pin_PH14 = PIN(7, 14, NO_ADC); +const mcu_pin_obj_t pin_PH15 = PIN(7, 15, NO_ADC); +const mcu_pin_obj_t pin_PI00 = PIN(8, 0, NO_ADC); +const mcu_pin_obj_t pin_PI01 = PIN(8, 1, NO_ADC); +const mcu_pin_obj_t pin_PI02 = PIN(8, 2, NO_ADC); +const mcu_pin_obj_t pin_PI03 = PIN(8, 3, NO_ADC); +const mcu_pin_obj_t pin_PI04 = PIN(8, 4, NO_ADC); +const mcu_pin_obj_t pin_PI05 = PIN(8, 5, NO_ADC); +const mcu_pin_obj_t pin_PI06 = PIN(8, 6, NO_ADC); +const mcu_pin_obj_t pin_PI07 = PIN(8, 7, NO_ADC); +const mcu_pin_obj_t pin_PI08 = PIN(8, 8, NO_ADC); +const mcu_pin_obj_t pin_PI09 = PIN(8, 9, NO_ADC); +const mcu_pin_obj_t pin_PI10 = PIN(8, 10, NO_ADC); +const mcu_pin_obj_t pin_PI11 = PIN(8, 11, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h index e722b6e5ae..fe0eb9e53e 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h @@ -27,107 +27,54 @@ #ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PINS_H #define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PINS_H -//Pins in datasheet order: DocID028087 Rev 7 page 50. LQFP100 only -//pg 50 -extern const mcu_pin_obj_t pin_PE02; -extern const mcu_pin_obj_t pin_PE03; -extern const mcu_pin_obj_t pin_PE04; -extern const mcu_pin_obj_t pin_PE05; -extern const mcu_pin_obj_t pin_PE06; -extern const mcu_pin_obj_t pin_PC13; -extern const mcu_pin_obj_t pin_PC14; -//pg 51 -extern const mcu_pin_obj_t pin_PC15; -extern const mcu_pin_obj_t pin_PF00; // 144 only -extern const mcu_pin_obj_t pin_PF01; // 144 only -extern const mcu_pin_obj_t pin_PF02; // 144 only -extern const mcu_pin_obj_t pin_PF03; // 144 only -extern const mcu_pin_obj_t pin_PF04; // 144 only -extern const mcu_pin_obj_t pin_PF05; // 144 only -extern const mcu_pin_obj_t pin_PF06; // 144 only -extern const mcu_pin_obj_t pin_PF07; // 144 only -extern const mcu_pin_obj_t pin_PF08; // 144 only -extern const mcu_pin_obj_t pin_PF09; // 144 only -extern const mcu_pin_obj_t pin_PF10; // 144 only -//pg 52 -extern const mcu_pin_obj_t pin_PC00; -extern const mcu_pin_obj_t pin_PC01; -extern const mcu_pin_obj_t pin_PC02; -extern const mcu_pin_obj_t pin_PC03; extern const mcu_pin_obj_t pin_PA00; extern const mcu_pin_obj_t pin_PA01; extern const mcu_pin_obj_t pin_PA02; -//pg 53 extern const mcu_pin_obj_t pin_PA03; extern const mcu_pin_obj_t pin_PA04; extern const mcu_pin_obj_t pin_PA05; extern const mcu_pin_obj_t pin_PA06; extern const mcu_pin_obj_t pin_PA07; -extern const mcu_pin_obj_t pin_PC04; -//pg 54 -extern const mcu_pin_obj_t pin_PC05; -extern const mcu_pin_obj_t pin_PB00; -extern const mcu_pin_obj_t pin_PB01; -extern const mcu_pin_obj_t pin_PB02; -extern const mcu_pin_obj_t pin_PF11; // 144 only -extern const mcu_pin_obj_t pin_PF12; // 144 only -extern const mcu_pin_obj_t pin_PF13; // 144 only -extern const mcu_pin_obj_t pin_PF14; // 144 only -extern const mcu_pin_obj_t pin_PF15; // 144 only -extern const mcu_pin_obj_t pin_PG00; // 144 only -extern const mcu_pin_obj_t pin_PG01; // 144 only -//pg 55 -extern const mcu_pin_obj_t pin_PE07; -extern const mcu_pin_obj_t pin_PE08; -extern const mcu_pin_obj_t pin_PE09; -extern const mcu_pin_obj_t pin_PE10; -extern const mcu_pin_obj_t pin_PE11; -extern const mcu_pin_obj_t pin_PE12; -extern const mcu_pin_obj_t pin_PE13; -extern const mcu_pin_obj_t pin_PE14; -//pg 56 -extern const mcu_pin_obj_t pin_PE15; -extern const mcu_pin_obj_t pin_PB10; -extern const mcu_pin_obj_t pin_PB11; // 144 only -extern const mcu_pin_obj_t pin_PB12; -extern const mcu_pin_obj_t pin_PB13; -//pg 57 -extern const mcu_pin_obj_t pin_PB14; -extern const mcu_pin_obj_t pin_PB15; -extern const mcu_pin_obj_t pin_PD08; -extern const mcu_pin_obj_t pin_PD09; -extern const mcu_pin_obj_t pin_PD10; -extern const mcu_pin_obj_t pin_PD11; -extern const mcu_pin_obj_t pin_PD12; -//pg 58 -extern const mcu_pin_obj_t pin_PD13; -extern const mcu_pin_obj_t pin_PD14; -extern const mcu_pin_obj_t pin_PD15; -extern const mcu_pin_obj_t pin_PG02; // 144 only -extern const mcu_pin_obj_t pin_PG03; // 144 only -extern const mcu_pin_obj_t pin_PG04; // 144 only -extern const mcu_pin_obj_t pin_PG05; // 144 only -extern const mcu_pin_obj_t pin_PG06; // 144 only -extern const mcu_pin_obj_t pin_PG07; // 144 only -extern const mcu_pin_obj_t pin_PG08; // 144 only -//pg 59 -extern const mcu_pin_obj_t pin_PC06; -extern const mcu_pin_obj_t pin_PC07; -extern const mcu_pin_obj_t pin_PC08; -extern const mcu_pin_obj_t pin_PC09; extern const mcu_pin_obj_t pin_PA08; extern const mcu_pin_obj_t pin_PA09; extern const mcu_pin_obj_t pin_PA10; -//pg 60 extern const mcu_pin_obj_t pin_PA11; extern const mcu_pin_obj_t pin_PA12; extern const mcu_pin_obj_t pin_PA13; extern const mcu_pin_obj_t pin_PA14; extern const mcu_pin_obj_t pin_PA15; +extern const mcu_pin_obj_t pin_PB00; +extern const mcu_pin_obj_t pin_PB01; +extern const mcu_pin_obj_t pin_PB02; +extern const mcu_pin_obj_t pin_PB03; +extern const mcu_pin_obj_t pin_PB04; +extern const mcu_pin_obj_t pin_PB05; +extern const mcu_pin_obj_t pin_PB06; +extern const mcu_pin_obj_t pin_PB07; +extern const mcu_pin_obj_t pin_PB08; +extern const mcu_pin_obj_t pin_PB09; +extern const mcu_pin_obj_t pin_PB10; +extern const mcu_pin_obj_t pin_PB11; +extern const mcu_pin_obj_t pin_PB12; +extern const mcu_pin_obj_t pin_PB13; +extern const mcu_pin_obj_t pin_PB14; +extern const mcu_pin_obj_t pin_PB15; +extern const mcu_pin_obj_t pin_PC00; +extern const mcu_pin_obj_t pin_PC01; +extern const mcu_pin_obj_t pin_PC02; +extern const mcu_pin_obj_t pin_PC03; +extern const mcu_pin_obj_t pin_PC04; +extern const mcu_pin_obj_t pin_PC05; +extern const mcu_pin_obj_t pin_PC06; +extern const mcu_pin_obj_t pin_PC07; +extern const mcu_pin_obj_t pin_PC08; +extern const mcu_pin_obj_t pin_PC09; extern const mcu_pin_obj_t pin_PC10; extern const mcu_pin_obj_t pin_PC11; -//pg 61 extern const mcu_pin_obj_t pin_PC12; +extern const mcu_pin_obj_t pin_PC13; +extern const mcu_pin_obj_t pin_PC14; +extern const mcu_pin_obj_t pin_PC15; extern const mcu_pin_obj_t pin_PD00; extern const mcu_pin_obj_t pin_PD01; extern const mcu_pin_obj_t pin_PD02; @@ -136,23 +83,89 @@ extern const mcu_pin_obj_t pin_PD04; extern const mcu_pin_obj_t pin_PD05; extern const mcu_pin_obj_t pin_PD06; extern const mcu_pin_obj_t pin_PD07; -//pg 62 -extern const mcu_pin_obj_t pin_PG09; // 144 only -extern const mcu_pin_obj_t pin_PG10; // 144 only -extern const mcu_pin_obj_t pin_PG11; // 144 only -extern const mcu_pin_obj_t pin_PG12; // 144 only -extern const mcu_pin_obj_t pin_PG13; // 144 only -extern const mcu_pin_obj_t pin_PG14; // 144 only -extern const mcu_pin_obj_t pin_PG15; // 144 only -extern const mcu_pin_obj_t pin_PB03; -extern const mcu_pin_obj_t pin_PB04; -//pg 63 -extern const mcu_pin_obj_t pin_PB05; -extern const mcu_pin_obj_t pin_PB06; -extern const mcu_pin_obj_t pin_PB07; -extern const mcu_pin_obj_t pin_PB08; -extern const mcu_pin_obj_t pin_PB09; +extern const mcu_pin_obj_t pin_PD08; +extern const mcu_pin_obj_t pin_PD09; +extern const mcu_pin_obj_t pin_PD10; +extern const mcu_pin_obj_t pin_PD11; +extern const mcu_pin_obj_t pin_PD12; +extern const mcu_pin_obj_t pin_PD13; +extern const mcu_pin_obj_t pin_PD14; +extern const mcu_pin_obj_t pin_PD15; extern const mcu_pin_obj_t pin_PE00; extern const mcu_pin_obj_t pin_PE01; +extern const mcu_pin_obj_t pin_PE02; +extern const mcu_pin_obj_t pin_PE03; +extern const mcu_pin_obj_t pin_PE04; +extern const mcu_pin_obj_t pin_PE05; +extern const mcu_pin_obj_t pin_PE06; +extern const mcu_pin_obj_t pin_PE07; +extern const mcu_pin_obj_t pin_PE08; +extern const mcu_pin_obj_t pin_PE09; +extern const mcu_pin_obj_t pin_PE10; +extern const mcu_pin_obj_t pin_PE11; +extern const mcu_pin_obj_t pin_PE12; +extern const mcu_pin_obj_t pin_PE13; +extern const mcu_pin_obj_t pin_PE14; +extern const mcu_pin_obj_t pin_PE15; +extern const mcu_pin_obj_t pin_PF00; +extern const mcu_pin_obj_t pin_PF01; +extern const mcu_pin_obj_t pin_PF02; +extern const mcu_pin_obj_t pin_PF03; +extern const mcu_pin_obj_t pin_PF04; +extern const mcu_pin_obj_t pin_PF05; +extern const mcu_pin_obj_t pin_PF06; +extern const mcu_pin_obj_t pin_PF07; +extern const mcu_pin_obj_t pin_PF08; +extern const mcu_pin_obj_t pin_PF09; +extern const mcu_pin_obj_t pin_PF10; +extern const mcu_pin_obj_t pin_PF11; +extern const mcu_pin_obj_t pin_PF12; +extern const mcu_pin_obj_t pin_PF13; +extern const mcu_pin_obj_t pin_PF14; +extern const mcu_pin_obj_t pin_PF15; +extern const mcu_pin_obj_t pin_PG00; +extern const mcu_pin_obj_t pin_PG01; +extern const mcu_pin_obj_t pin_PG02; +extern const mcu_pin_obj_t pin_PG03; +extern const mcu_pin_obj_t pin_PG04; +extern const mcu_pin_obj_t pin_PG05; +extern const mcu_pin_obj_t pin_PG06; +extern const mcu_pin_obj_t pin_PG07; +extern const mcu_pin_obj_t pin_PG08; +extern const mcu_pin_obj_t pin_PG09; +extern const mcu_pin_obj_t pin_PG10; +extern const mcu_pin_obj_t pin_PG11; +extern const mcu_pin_obj_t pin_PG12; +extern const mcu_pin_obj_t pin_PG13; +extern const mcu_pin_obj_t pin_PG14; +extern const mcu_pin_obj_t pin_PG15; +extern const mcu_pin_obj_t pin_PH00; +extern const mcu_pin_obj_t pin_PH01; +extern const mcu_pin_obj_t pin_PH02; +extern const mcu_pin_obj_t pin_PH03; +extern const mcu_pin_obj_t pin_PH04; +extern const mcu_pin_obj_t pin_PH05; +extern const mcu_pin_obj_t pin_PH06; +extern const mcu_pin_obj_t pin_PH07; +extern const mcu_pin_obj_t pin_PH08; +extern const mcu_pin_obj_t pin_PH09; +extern const mcu_pin_obj_t pin_PH10; +extern const mcu_pin_obj_t pin_PH11; +extern const mcu_pin_obj_t pin_PH12; +extern const mcu_pin_obj_t pin_PH13; +extern const mcu_pin_obj_t pin_PH14; +extern const mcu_pin_obj_t pin_PH15; +extern const mcu_pin_obj_t pin_PI00; +extern const mcu_pin_obj_t pin_PI01; +extern const mcu_pin_obj_t pin_PI02; +extern const mcu_pin_obj_t pin_PI03; +extern const mcu_pin_obj_t pin_PI04; +extern const mcu_pin_obj_t pin_PI05; +extern const mcu_pin_obj_t pin_PI06; +extern const mcu_pin_obj_t pin_PI07; +extern const mcu_pin_obj_t pin_PI08; +extern const mcu_pin_obj_t pin_PI09; +extern const mcu_pin_obj_t pin_PI10; +extern const mcu_pin_obj_t pin_PI11; #endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PINS_H diff --git a/ports/stm/tools/parse_af_csv.py b/ports/stm/tools/parse_af_csv.py index 4e97252602..0ff8168ec2 100644 --- a/ports/stm/tools/parse_af_csv.py +++ b/ports/stm/tools/parse_af_csv.py @@ -52,6 +52,8 @@ def evaluate_tim(inper, inlist, altfn, pin): if inper[:3] == "TIM" and inper[5:7] == "CH" and inper[-1:] != 'N': inlist.append([inper[3:4],altfn,inper[-1:],pin]) + elif inper[:3] == "TIM" and inper[6:8] == "CH" and inper[-1:] != 'N': + inlist.append([inper[3:5],altfn,inper[-1:],pin]) # Open target file with open(sys.argv[1]) as csv_file: diff --git a/ports/stm/tools/pins.csv b/ports/stm/tools/pins.csv deleted file mode 100644 index b424c2f78f..0000000000 --- a/ports/stm/tools/pins.csv +++ /dev/null @@ -1,93 +0,0 @@ -A0,PA3 -A1,PC0 -A2,PC3 -A3,PB1 -A4,PC2 -A5,PF10 -A6,PF4 -A7,PF5 -A8,PF6 -D0,PB7 -D1,PB6 -D2,PG14 -D3,PE13 -D4,PE14 -D5,PE11 -D6,PE9 -D7,PG12 -D8,PF3 -D9,PD15 -D10,PD14 -D11,PB5 -D12,PA6 -D13,PA5 -D14,PB9 -D15,PB8 -D16,PC6 -D17,PB15 -D18,PB13 -D19,PB12 -D20,PA15 -D21,PC7 -D22,PB5 -D23,PB3 -D24,PA4 -D25,PB4 -D26,PG6 -D27,PB2 -D28,PD13 -D29,PD12 -D30,PD11 -D31,PE2 -D32,PA0 -D33,PB0 -D34,PE0 -D35,PB11 -D36,PB10 -D37,PE15 -D38,PE6 -D39,PE12 -D40,PE10 -D41,PE7 -D42,PE8 -D43,PC8 -D44,PC9 -D45,PC10 -D46,PC11 -D47,PC12 -D48,PD2 -D49,PG2 -D50,PG3 -D51,PD7 -D52,PD6 -D53,PD5 -D54,PD4 -D55,PD3 -D56,PE2 -D57,PE4 -D58,PE5 -D59,PE6 -D60,PE3 -D61,PF8 -D62,PF7 -D63,PF9 -D64,PG1 -D65,PG0 -D66,PD1 -D67,PD0 -D68,PF0 -D69,PF1 -D70,PF2 -D71,PE0 -D72,PB2 -SDA,PB9 -SCL,PB8 -MOSI,PB5 -MISO,PA6 -SCK,PA5 -RX,PB7 -TX,PB6 -LED1,PB00 -LED2,PE01 -LED3,PB14 -SW,PC13 diff --git a/ports/stm/tools/stm32f767_af.csv b/ports/stm/tools/stm32f767_af.csv deleted file mode 100644 index 86f10b6dc8..0000000000 --- a/ports/stm/tools/stm32f767_af.csv +++ /dev/null @@ -1,168 +0,0 @@ -PortA,PA0,,TIM2_CH1/TIM2_ETR,TIM5_CH1,TIM8_ETR,,,,USART2_CTS,UART4_TX,,SAI2_SD_B,ETH_MII_CRS,,,,EVENTOUT,ADC123_IN0 -PortA,PA1,,TIM2_CH2,TIM5_CH2,,,,,USART2_RTS,UART4_RX,QUADSPI_BK1_IO3,SAI2_MCK_B,ETH_MII_RX_CLK/ETH_RMII_REF_CLK,,,LCD_R2,EVENTOUT,ADC123_IN1 -PortA,PA2,,TIM2_CH3,TIM5_CH3,TIM9_CH1,,,,USART2_TX,SAI2_SCK_B,,,ETH_MDIO,MDIOS_MDIO,,LCD_R1,EVENTOUT,ADC123_IN2 -PortA,PA3,,TIM2_CH4,TIM5_CH4,TIM9_CH2,,,,USART2_RX,,LCD_B2,OTG_HS_ULPI_D0,ETH_MII_COL,,,LCD_B5,EVENTOUT,ADC123_IN3 -PortA,PA4,,,,,,SPI1_NSS/I2S1_WS,SPI3_NSS/I2S3_WS,USART2_CK,SPI6_NSS,,,,OTG_HS_SOF,DCMI_HSYNC,LCD_VSYNC,EVENTOUT,ADC12_IN4 -PortA,PA5,,TIM2_CH1/TIM2_ETR,,TIM8_CH1N,,SPI1_SCK/I2S1_CK,,,SPI6_SCK,,OTG_HS_ULPI_CK,,,,LCD_R4,EVENTOUT,ADC12_IN5 -PortA,PA6,,TIM1_BKIN,TIM3_CH1,TIM8_BKIN,,SPI1_MISO,,,SPI6_MISO,TIM13_CH1,,,MDIOS_MDC,DCMI_PIXCLK,LCD_G2,EVENTOUT,ADC12_IN6 -PortA,PA7,,TIM1_CH1N,TIM3_CH2,TIM8_CH1N,,SPI1_MOSI/I2S1_SD,,,SPI6_MOSI,TIM14_CH1,,ETH_MII_RX_DV/ETH_RMII_CRS_DV,FMC_SDNWE,,,EVENTOUT,ADC12_IN7 -PortA,PA8,MCO1,TIM1_CH1,,TIM8_BKIN2,I2C3_SCL,,,USART1_CK,,,OTG_FS_SOF,CAN3_RX,UART7_RX,LCD_B3,LCD_R6,EVENTOUT, -PortA,PA9,,TIM1_CH2,,,I2C3_SMBA,SPI2_SCK/I2S2_CK,,USART1_TX,,,,,,DCMI_D0,LCD_R5,EVENTOUT, -PortA,PA10,,TIM1_CH3,,,,,,USART1_RX,,LCD_B4,OTG_FS_ID,,MDIOS_MDIO,DCMI_D1,LCD_B1,EVENTOUT, -PortA,PA11,,TIM1_CH4,,,,SPI2_NSS/I2S2_WS,UART4_RX,USART1_CTS,,CAN1_RX,OTG_FS_DM,,,,LCD_R4,EVENTOUT, -PortA,PA12,,TIM1_ETR,,,,SPI2_SCK/I2S2_CK,UART4_TX,USART1_RTS,SAI2_FS_B,CAN1_TX,OTG_FS_DP,,,,LCD_R5,EVENTOUT, -PortA,PA13,JTMS/SWDIO,,,,,,,,,,,,,,,EVENTOUT, -PortA,PA14,JTCK/SWCLK,,,,,,,,,,,,,,,EVENTOUT, -PortA,PA15,JTDI,TIM2_CH1/TIM2_ETR,,,HDMI_CEC,SPI1_NSS/I2S1_WS,SPI3_NSS/I2S3_WS,SPI6_NSS,UART4_RTS,,,CAN3_TX,UART7_TX,,,EVENTOUT, -PortB,PB0,,TIM1_CH2N,TIM3_CH3,TIM8_CH2N,,,DFSDM1_CKOUT,,UART4_CTS,LCD_R3,OTG_HS_ULPI_D1,ETH_MII_RXD2,,,LCD_G1,EVENTOUT,ADC12_IN8 -PortB,PB1,,TIM1_CH3N,TIM3_CH4,TIM8_CH3N,,,DFSDM1_DATAIN1,,,LCD_R6,OTG_HS_ULPI_D2,ETH_MII_RXD3,,,LCD_G0,EVENTOUT,ADC12_IN9 -PortB,PB2,,,,,,,SAI1_SD_A,SPI3_MOSI/I2S3_SD,,QUADSPI_CLK,DFSDM1_CKIN1,,,,,EVENTOUT, -PortB,PB3,JTDO/TRACESWO,TIM2_CH2,,,,SPI1_SCK/I2S1_CK,SPI3_SCK/I2S3_CK,,SPI6_SCK,,SDMMC2_D2,CAN3_RX,UART7_RX,,,EVENTOUT, -PortB,PB4,NJTRST,,TIM3_CH1,,,SPI1_MISO,SPI3_MISO,SPI2_NSS/I2S2_WS,SPI6_MISO,,SDMMC2_D3,CAN3_TX,UART7_TX,,,EVENTOUT, -PortB,PB5,,UART5_RX,TIM3_CH2,,I2C1_SMBA,SPI1_MOSI/I2S1_SD,SPI3_MOSI/I2S3_SD,,SPI6_MOSI,CAN2_RX,OTG_HS_ULPI_D7,ETH_PPS_OUT,FMC_SDCKE1,DCMI_D10,LCD_G7,EVENTOUT, -PortB,PB6,,UART5_TX,TIM4_CH1,HDMI_CEC,I2C1_SCL,,DFSDM1_DATAIN5,USART1_TX,,CAN2_TX,QUADSPI_BK1_NCS,I2C4_SCL,FMC_SDNE1,DCMI_D5,,EVENTOUT, -PortB,PB7,,,TIM4_CH2,,I2C1_SDA,,DFSDM1_CKIN5,USART1_RX,,,,I2C4_SDA,FMC_NL,DCMI_VSYNC,,EVENTOUT, -PortB,PB8,,I2C4_SCL,TIM4_CH3,TIM10_CH1,I2C1_SCL,,DFSDM1_CKIN7,UART5_RX,,CAN1_RX,SDMMC2_D4,ETH_MII_TXD3,SDMMC1_D4,DCMI_D6,LCD_B6,EVENTOUT, -PortB,PB9,,I2C4_SDA,TIM4_CH4,TIM11_CH1,I2C1_SDA,SPI2_NSS/I2S2_WS,DFSDM1_DATAIN7,UART5_TX,,CAN1_TX,SDMMC2_D5,I2C4_SMBA,SDMMC1_D5,DCMI_D7,LCD_B7,EVENTOUT, -PortB,PB10,,TIM2_CH3,,,I2C2_SCL,SPI2_SCK/I2S2_CK,DFSDM1_DATAIN7,USART3_TX,,QUADSPI_BK1_NCS,OTG_HS_ULPI_D3,ETH_MII_RX_ER,,,LCD_G4,EVENTOUT, -PortB,PB11,,TIM2_CH4,,,I2C2_SDA,,DFSDM1_CKIN7,USART3_RX,,,OTG_HS_ULPI_D4,ETH_MII_TX_EN/ETH_RMII_TX_EN,,DSI_TE,LCD_G5,EVENTOUT, -PortB,PB12,,TIM1_BKIN,,,I2C2_SMBA,SPI2_NSS/I2S2_WS,DFSDM1_DATAIN1,USART3_CK,UART5_RX,CAN2_RX,OTG_HS_ULPI_D5,ETH_MII_TXD0/ETH_RMII_TXD0,OTG_HS_ID,,,EVENTOUT, -PortB,PB13,,TIM1_CH1N,,,,SPI2_SCK/I2S2_CK,DFSDM1_CKIN1,USART3_CTS,UART5_TX,CAN2_TX,OTG_HS_ULPI_D6,ETH_MII_TXD1/ETH_RMII_TXD1,,,,EVENTOUT, -PortB,PB14,,TIM1_CH2N,,TIM8_CH2N,USART1_TX,SPI2_MISO,DFSDM1_DATAIN2,USART3_RTS,UART4_RTS,TIM12_CH1,SDMMC2_D0,,OTG_HS_DM,,,EVENTOUT, -PortB,PB15,RTC_REFIN,TIM1_CH3N,,TIM8_CH3N,USART1_RX,SPI2_MOSI/I2S2_SD,DFSDM1_CKIN2,,UART4_CTS,TIM12_CH2,SDMMC2_D1,,OTG_HS_DP,,,EVENTOUT, -PortC,PC0,,,,DFSDM1_CKIN0,,,DFSDM1_DATAIN4,,SAI2_FS_B,,OTG_HS_ULPI_STP,,FMC_SDNWE,,LCD_R5,EVENTOUT,ADC123_IN10 -PortC,PC1,TRACED0,,,DFSDM1_DATAIN0,,SPI2_MOSI/I2S2_SD,SAI1_SD_A,,,,DFSDM1_CKIN4,ETH_MDC,MDIOS_MDC,,,EVENTOUT,ADC123_IN11 -PortC,PC2,,,,DFSDM1_CKIN1,,SPI2_MISO,DFSDM1_CKOUT,,,,OTG_HS_ULPI_DIR,ETH_MII_TXD2,FMC_SDNE0,,,EVENTOUT,ADC123_IN12 -PortC,PC3,,,,DFSDM1_DATAIN1,,SPI2_MOSI/I2S2_SD,,,,,OTG_HS_ULPI_NXT,ETH_MII_TX_CLK,FMC_SDCKE0,,,EVENTOUT,ADC123_IN13 -PortC,PC4,,,,DFSDM1_CKIN2,,I2S1_MCK,,,SPDIFRX_IN2,,,ETH_MII_RXD0/ETH_RMII_RXD0,FMC_SDNE0,,,EVENTOUT,ADC12_IN14 -PortC,PC5,,,,DFSDM1_DATAIN2,,,,,SPDIFRX_IN3,,,ETH_MII_RXD1/ETH_RMII_RXD1,FMC_SDCKE0,,,EVENTOUT,ADC12_IN15 -PortC,PC6,,,TIM3_CH1,TIM8_CH1,,I2S2_MCK,,DFSDM1_CKIN3,USART6_TX,FMC_NWAIT,SDMMC2_D6,,SDMMC1_D6,DCMI_D0,LCD_HSYNC,EVENTOUT, -PortC,PC7,,,TIM3_CH2,TIM8_CH2,,,I2S3_MCK,DFSDM1_DATAIN3,USART6_RX,FMC_NE1,SDMMC2_D7,,SDMMC1_D7,DCMI_D1,LCD_G6,EVENTOUT, -PortC,PC8,TRACED1,,TIM3_CH3,TIM8_CH3,,,,UART5_RTS,USART6_CK,FMC_NE2/FMC_NCE,,,SDMMC1_D0,DCMI_D2,,EVENTOUT, -PortC,PC9,MCO2,,TIM3_CH4,TIM8_CH4,I2C3_SDA,I2S_CKIN,,UART5_CTS,,QUADSPI_BK1_IO0,LCD_G3,,SDMMC1_D1,DCMI_D3,LCD_B2,EVENTOUT, -PortC,PC10,,,,DFSDM1_CKIN5,,,SPI3_SCK/I2S3_CK,USART3_TX,UART4_TX,QUADSPI_BK1_IO1,,,SDMMC1_D2,DCMI_D8,LCD_R2,EVENTOUT, -PortC,PC11,,,,DFSDM1_DATAIN5,,,SPI3_MISO,USART3_RX,UART4_RX,QUADSPI_BK2_NCS,,,SDMMC1_D3,DCMI_D4,,EVENTOUT, -PortC,PC12,TRACED3,,,,,,SPI3_MOSI/I2S3_SD,USART3_CK,UART5_TX,,,,SDMMC1_CK,DCMI_D9,,EVENTOUT, -PortC,PC13,,,,,,,,,,,,,,,,EVENTOUT, -PortC,PC14,,,,,,,,,,,,,,,,EVENTOUT, -PortC,PC15,,,,,,,,,,,,,,,,EVENTOUT, -PortD,PD0,,,,DFSDM1_CKIN6,,,DFSDM1_DATAIN7,,UART4_RX,CAN1_RX,,,FMC_D2,,,EVENTOUT, -PortD,PD1,,,,DFSDM1_DATAIN6,,,DFSDM1_CKIN7,,UART4_TX,CAN1_TX,,,FMC_D3,,,EVENTOUT, -PortD,PD2,TRACED2,,TIM3_ETR,,,,,,UART5_RX,,,,SDMMC1_CMD,DCMI_D11,,EVENTOUT, -PortD,PD3,,,,DFSDM1_CKOUT,,SPI2_SCK/I2S2_CK,DFSDM1_DATAIN0,USART2_CTS,,,,,FMC_CLK,DCMI_D5,LCD_G7,EVENTOUT, -PortD,PD4,,,,,,,DFSDM1_CKIN0,USART2_RTS,,,,,FMC_NOE,,,EVENTOUT, -PortD,PD5,,,,,,,,USART2_TX,,,,,FMC_NWE,,,EVENTOUT, -PortD,PD6,,,,DFSDM1_CKIN4,,SPI3_MOSI/I2S3_SD,SAI1_SD_A,USART2_RX,,,DFSDM1_DATAIN1,SDMMC2_CK,FMC_NWAIT,DCMI_D10,LCD_B2,EVENTOUT, -PortD,PD7,,,,DFSDM1_DATAIN4,,SPI1_MOSI/I2S1_SD,DFSDM1_CKIN1,USART2_CK,SPDIFRX_IN0,,,SDMMC2_CMD,FMC_NE1,,,EVENTOUT, -PortD,PD8,,,,DFSDM1_CKIN3,,,,USART3_TX,SPDIFRX_IN1,,,,FMC_D13,,,EVENTOUT, -PortD,PD9,,,,DFSDM1_DATAIN3,,,,USART3_RX,,,,,FMC_D14,,,EVENTOUT, -PortD,PD10,,,,DFSDM1_CKOUT,,,,USART3_CK,,,,,FMC_D15,,LCD_B3,EVENTOUT, -PortD,PD11,,,,,I2C4_SMBA,,,USART3_CTS,,QUADSPI_BK1_IO0,SAI2_SD_A,,FMC_A16/FMC_CLE,,,EVENTOUT, -PortD,PD12,,,TIM4_CH1,LPTIM1_IN1,I2C4_SCL,,,USART3_RTS,,QUADSPI_BK1_IO1,SAI2_FS_A,,FMC_A17/FMC_ALE,,,EVENTOUT, -PortD,PD13,,,TIM4_CH2,LPTIM1_OUT,I2C4_SDA,,,,,QUADSPI_BK1_IO3,SAI2_SCK_A,,FMC_A18,,,EVENTOUT, -PortD,PD14,,,TIM4_CH3,,,,,,UART8_CTS,,,,FMC_D0,,,EVENTOUT, -PortD,PD15,,,TIM4_CH4,,,,,,UART8_RTS,,,,FMC_D1,,,EVENTOUT, -PortE,PE0,,,TIM4_ETR,LPTIM1_ETR,,,,,UART8_RX,,SAI2_MCK_A,,FMC_NBL0,DCMI_D2,,EVENTOUT, -PortE,PE1,,,,LPTIM1_IN2,,,,,UART8_TX,,,,FMC_NBL1,DCMI_D3,,EVENTOUT, -PortE,PE2,TRACECLK,,,,,SPI4_SCK,SAI1_MCLK_A,,,QUADSPI_BK1_IO2,,ETH_MII_TXD3,FMC_A23,,,EVENTOUT, -PortE,PE3,TRACED0,,,,,,SAI1_SD_B,,,,,,FMC_A19,,,EVENTOUT, -PortE,PE4,TRACED1,,,,,SPI4_NSS,SAI1_FS_A,,,,DFSDM1_DATAIN3,,FMC_A20,DCMI_D4,LCD_B0,EVENTOUT, -PortE,PE5,TRACED2,,,TIM9_CH1,,SPI4_MISO,SAI1_SCK_A,,,,DFSDM1_CKIN3,,FMC_A21,DCMI_D6,LCD_G0,EVENTOUT, -PortE,PE6,TRACED3,TIM1_BKIN2,,TIM9_CH2,,SPI4_MOSI,SAI1_SD_A,,,,SAI2_MCK_B,,FMC_A22,DCMI_D7,LCD_G1,EVENTOUT, -PortE,PE7,,TIM1_ETR,,,,,DFSDM1_DATAIN2,,UART7_RX,,QUADSPI_BK2_IO0,,FMC_D4,,,EVENTOUT, -PortE,PE8,,TIM1_CH1N,,,,,DFSDM1_CKIN2,,UART7_TX,,QUADSPI_BK2_IO1,,FMC_D5,,,EVENTOUT, -PortE,PE9,,TIM1_CH1,,,,,DFSDM1_CKOUT,,UART7_RTS,,QUADSPI_BK2_IO2,,FMC_D6,,,EVENTOUT, -PortE,PE10,,TIM1_CH2N,,,,,DFSDM1_DATAIN4,,UART7_CTS,,QUADSPI_BK2_IO3,,FMC_D7,,,EVENTOUT, -PortE,PE11,,TIM1_CH2,,,,SPI4_NSS,DFSDM1_CKIN4,,,,SAI2_SD_B,,FMC_D8,,LCD_G3,EVENTOUT, -PortE,PE12,,TIM1_CH3N,,,,SPI4_SCK,DFSDM1_DATAIN5,,,,SAI2_SCK_B,,FMC_D9,,LCD_B4,EVENTOUT, -PortE,PE13,,TIM1_CH3,,,,SPI4_MISO,DFSDM1_CKIN5,,,,SAI2_FS_B,,FMC_D10,,LCD_DE,EVENTOUT, -PortE,PE14,,TIM1_CH4,,,,SPI4_MOSI,,,,,SAI2_MCK_B,,FMC_D11,,LCD_CLK,EVENTOUT, -PortE,PE15,,TIM1_BKIN,,,,,,,,,,,FMC_D12,,LCD_R7,EVENTOUT, -PortF,PF0,,,,,I2C2_SDA,,,,,,,,FMC_A0,,,EVENTOUT, -PortF,PF1,,,,,I2C2_SCL,,,,,,,,FMC_A1,,,EVENTOUT, -PortF,PF2,,,,,I2C2_SMBA,,,,,,,,FMC_A2,,,EVENTOUT, -PortF,PF3,,,,,,,,,,,,,FMC_A3,,,EVENTOUT,ADC3_IN9 -PortF,PF4,,,,,,,,,,,,,FMC_A4,,,EVENTOUT,ADC3_IN14 -PortF,PF5,,,,,,,,,,,,,FMC_A5,,,EVENTOUT,ADC3_IN15 -PortF,PF6,,,,TIM10_CH1,,SPI5_NSS,SAI1_SD_B,,UART7_RX,QUADSPI_BK1_IO3,,,,,,EVENTOUT,ADC3_IN4 -PortF,PF7,,,,TIM11_CH1,,SPI5_SCK,SAI1_MCLK_B,,UART7_TX,QUADSPI_BK1_IO2,,,,,,EVENTOUT,ADC3_IN5 -PortF,PF8,,,,,,SPI5_MISO,SAI1_SCK_B,,UART7_RTS,TIM13_CH1,QUADSPI_BK1_IO0,,,,,EVENTOUT,ADC3_IN6 -PortF,PF9,,,,,,SPI5_MOSI,SAI1_FS_B,,UART7_CTS,TIM14_CH1,QUADSPI_BK1_IO1,,,,,EVENTOUT,ADC3_IN7 -PortF,PF10,,,,,,,,,,QUADSPI_CLK,,,,DCMI_D11,LCD_DE,EVENTOUT,ADC3_IN8 -PortF,PF11,,,,,,SPI5_MOSI,,,,,SAI2_SD_B,,FMC_SDNRAS,DCMI_D12,,EVENTOUT, -PortF,PF12,,,,,,,,,,,,,FMC_A6,,,EVENTOUT, -PortF,PF13,,,,,I2C4_SMBA,,DFSDM1_DATAIN6,,,,,,FMC_A7,,,EVENTOUT, -PortF,PF14,,,,,I2C4_SCL,,DFSDM1_CKIN6,,,,,,FMC_A8,,,EVENTOUT, -PortF,PF15,,,,,I2C4_SDA,,,,,,,,FMC_A9,,,EVENTOUT, -PortG,PG0,,,,,,,,,,,,,FMC_A10,,,EVENTOUT, -PortG,PG1,,,,,,,,,,,,,FMC_A11,,,EVENTOUT, -PortG,PG2,,,,,,,,,,,,,FMC_A12,,,EVENTOUT, -PortG,PG3,,,,,,,,,,,,,FMC_A13,,,EVENTOUT, -PortG,PG4,,,,,,,,,,,,,FMC_A14/FMC_BA0,,,EVENTOUT, -PortG,PG5,,,,,,,,,,,,,FMC_A15/FMC_BA1,,,EVENTOUT, -PortG,PG6,,,,,,,,,,,,,FMC_NE3,DCMI_D12,LCD_R7,EVENTOUT, -PortG,PG7,,,,,,,SAI1_MCLK_A,,USART6_CK,,,,FMC_INT,DCMI_D13,LCD_CLK,EVENTOUT, -PortG,PG8,,,,,,SPI6_NSS,,SPDIFRX_IN2,USART6_RTS,,,ETH_PPS_OUT,FMC_SDCLK,,LCD_G7,EVENTOUT, -PortG,PG9,,,,,,SPI1_MISO,,SPDIFRX_IN3,USART6_RX,QUADSPI_BK2_IO2,SAI2_FS_B,SDMMC2_D0,FMC_NE2/FMC_NCE,DCMI_VSYNC,,EVENTOUT, -PortG,PG10,,,,,,SPI1_NSS/I2S1_WS,,,,LCD_G3,SAI2_SD_B,SDMMC2_D1,FMC_NE3,DCMI_D2,LCD_B2,EVENTOUT, -PortG,PG11,,,,,,SPI1_SCK/I2S1_CK,,SPDIFRX_IN0,,,SDMMC2_D2,ETH_MII_TX_EN/ETH_RMII_TX_EN,,DCMI_D3,LCD_B3,EVENTOUT, -PortG,PG12,,,,LPTIM1_IN1,,SPI6_MISO,,SPDIFRX_IN1,USART6_RTS,LCD_B4,,SDMMC2_D3,FMC_NE4,,LCD_B1,EVENTOUT, -PortG,PG13,TRACED0,,,LPTIM1_OUT,,SPI6_SCK,,,USART6_CTS,,,ETH_MII_TXD0/ETH_RMII_TXD0,FMC_A24,,LCD_R0,EVENTOUT, -PortG,PG14,TRACED1,,,LPTIM1_ETR,,SPI6_MOSI,,,USART6_TX,QUADSPI_BK2_IO3,,ETH_MII_TXD1/ETH_RMII_TXD1,FMC_A25,,LCD_B0,EVENTOUT, -PortG,PG15,,,,,,,,,USART6_CTS,,,,FMC_SDNCAS,DCMI_D13,,EVENTOUT, -PortH,PH0,,,,,,,,,,,,,,,,EVENTOUT, -PortH,PH1,,,,,,,,,,,,,,,,EVENTOUT, -PortH,PH2,,,,LPTIM1_IN2,,,,,,QUADSPI_BK2_IO0,SAI2_SCK_B,ETH_MII_CRS,FMC_SDCKE0,,LCD_R0,EVENTOUT, -PortH,PH3,,,,,,,,,,QUADSPI_BK2_IO1,SAI2_MCK_B,ETH_MII_COL,FMC_SDNE0,,LCD_R1,EVENTOUT, -PortH,PH4,,,,,I2C2_SCL,,,,,LCD_G5,OTG_HS_ULPI_NXT,,,,LCD_G4,EVENTOUT, -PortH,PH5,,,,,I2C2_SDA,SPI5_NSS,,,,,,,FMC_SDNWE,,,EVENTOUT, -PortH,PH6,,,,,I2C2_SMBA,SPI5_SCK,,,,TIM12_CH1,,ETH_MII_RXD2,FMC_SDNE1,DCMI_D8,,EVENTOUT, -PortH,PH7,,,,,I2C3_SCL,SPI5_MISO,,,,,,ETH_MII_RXD3,FMC_SDCKE1,DCMI_D9,,EVENTOUT, -PortH,PH8,,,,,I2C3_SDA,,,,,,,,FMC_D16,DCMI_HSYNC,LCD_R2,EVENTOUT, -PortH,PH9,,,,,I2C3_SMBA,,,,,TIM12_CH2,,,FMC_D17,DCMI_D0,LCD_R3,EVENTOUT, -PortH,PH10,,,TIM5_CH1,,I2C4_SMBA,,,,,,,,FMC_D18,DCMI_D1,LCD_R4,EVENTOUT, -PortH,PH11,,,TIM5_CH2,,I2C4_SCL,,,,,,,,FMC_D19,DCMI_D2,LCD_R5,EVENTOUT, -PortH,PH12,,,TIM5_CH3,,I2C4_SDA,,,,,,,,FMC_D20,DCMI_D3,LCD_R6,EVENTOUT, -PortH,PH13,,,,TIM8_CH1N,,,,,UART4_TX,CAN1_TX,,,FMC_D21,,LCD_G2,EVENTOUT, -PortH,PH14,,,,TIM8_CH2N,,,,,UART4_RX,CAN1_RX,,,FMC_D22,DCMI_D4,LCD_G3,EVENTOUT, -PortH,PH15,,,,TIM8_CH3N,,,,,,,,,FMC_D23,DCMI_D11,LCD_G4,EVENTOUT, -PortI,PI0,,,TIM5_CH4,,,SPI2_NSS/I2S2_WS,,,,,,,FMC_D24,DCMI_D13,LCD_G5,EVENTOUT, -PortI,PI1,,,,TIM8_BKIN2,,SPI2_SCK/I2S2_CK,,,,,,,FMC_D25,DCMI_D8,LCD_G6,EVENTOUT, -PortI,PI2,,,,TIM8_CH4,,SPI2_MISO,,,,,,,FMC_D26,DCMI_D9,LCD_G7,EVENTOUT, -PortI,PI3,,,,TIM8_ETR,,SPI2_MOSI/I2S2_SD,,,,,,,FMC_D27,DCMI_D10,,EVENTOUT, -PortI,PI4,,,,TIM8_BKIN,,,,,,,SAI2_MCK_A,,FMC_NBL2,DCMI_D5,LCD_B4,EVENTOUT, -PortI,PI5,,,,TIM8_CH1,,,,,,,SAI2_SCK_A,,FMC_NBL3,DCMI_VSYNC,LCD_B5,EVENTOUT, -PortI,PI6,,,,TIM8_CH2,,,,,,,SAI2_SD_A,,FMC_D28,DCMI_D6,LCD_B6,EVENTOUT, -PortI,PI7,,,,TIM8_CH3,,,,,,,SAI2_FS_A,,FMC_D29,DCMI_D7,LCD_B7,EVENTOUT, -PortI,PI8,,,,,,,,,,,,,,,,EVENTOUT, -PortI,PI9,,,,,,,,,UART4_RX,CAN1_RX,,,FMC_D30,,LCD_VSYNC,EVENTOUT, -PortI,PI10,,,,,,,,,,,,ETH_MII_RX_ER,FMC_D31,,LCD_HSYNC,EVENTOUT, -PortI,PI11,,,,,,,,,,LCD_G6,OTG_HS_ULPI_DIR,,,,,EVENTOUT, -PortI,PI12,,,,,,,,,,,,,,,LCD_HSYNC,EVENTOUT, -PortI,PI13,,,,,,,,,,,,,,,LCD_VSYNC,EVENTOUT, -PortI,PI14,,,,,,,,,,,,,,,LCD_CLK,EVENTOUT, -PortI,PI15,,,,,,,,,,LCD_G2,,,,,LCD_R0,EVENTOUT, -PortJ,PJ0,,,,,,,,,,LCD_R7,,,,,LCD_R1,EVENTOUT, -PortJ,PJ1,,,,,,,,,,,,,,,LCD_R2,EVENTOUT, -PortJ,PJ2,,,,,,,,,,,,,,DSI_TE,LCD_R3,EVENTOUT, -PortJ,PJ3,,,,,,,,,,,,,,,LCD_R4,EVENTOUT, -PortJ,PJ4,,,,,,,,,,,,,,,LCD_R5,EVENTOUT, -PortJ,PJ5,,,,,,,,,,,,,,,LCD_R6,EVENTOUT, -PortJ,PJ6,,,,,,,,,,,,,,,LCD_R7,EVENTOUT, -PortJ,PJ7,,,,,,,,,,,,,,,LCD_G0,EVENTOUT, -PortJ,PJ8,,,,,,,,,,,,,,,LCD_G1,EVENTOUT, -PortJ,PJ9,,,,,,,,,,,,,,,LCD_G2,EVENTOUT, -PortJ,PJ10,,,,,,,,,,,,,,,LCD_G3,EVENTOUT, -PortJ,PJ11,,,,,,,,,,,,,,,LCD_G4,EVENTOUT, -PortJ,PJ12,,,,,,,,,,LCD_G3,,,,,LCD_B0,EVENTOUT, -PortJ,PJ13,,,,,,,,,,LCD_G4,,,,,LCD_B1,EVENTOUT, -PortJ,PJ14,,,,,,,,,,,,,,,LCD_B2,EVENTOUT, -PortJ,PJ15,,,,,,,,,,,,,,,LCD_B3,EVENTOUT, -PortK,PK0,,,,,,,,,,,,,,,LCD_G5,EVENTOUT, -PortK,PK1,,,,,,,,,,,,,,,LCD_G6,EVENTOUT, -PortK,PK2,,,,,,,,,,,,,,,LCD_G7,EVENTOUT, -PortK,PK3,,,,,,,,,,,,,,,LCD_B4,EVENTOUT, -PortK,PK4,,,,,,,,,,,,,,,LCD_B5,EVENTOUT, -PortK,PK5,,,,,,,,,,,,,,,LCD_B6,EVENTOUT, -PortK,PK6,,,,,,,,,,,,,,,LCD_B7,EVENTOUT, -PortK,PK7,,,,,,,,,,,,,,,LCD_DE,EVENTOUT, From a7634e8bf226e1caf965684767498ce1b74ac8e6 Mon Sep 17 00:00:00 2001 From: George Waters Date: Thu, 9 Jul 2020 15:13:48 -0400 Subject: [PATCH 0272/1293] Set version and release in build workflow --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa7dd9dd25..463f1c680a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,9 @@ jobs: fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - name: CircuitPython version - run: git describe --dirty --tags + run: | + git describe --dirty --tags + echo "::set-env name=CP_VERSION::$(git describe --dirty --tags)" - name: Set up Python 3.8 uses: actions/setup-python@v1 with: @@ -68,7 +70,7 @@ jobs: name: stubs path: circuitpython-stubs* - name: Docs - run: sphinx-build -E -W -b html . _build/html + run: sphinx-build -E -W -b html -D version=${{ env.CP_VERSION }} -D release=${{ env.CP_VERSION }} . _build/html - uses: actions/upload-artifact@v2 with: name: docs From eb860101766741fd75326577bb779d91cb3afd01 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 9 Jul 2020 16:45:39 -0400 Subject: [PATCH 0273/1293] Enable RGB Matrix --- ports/stm/common-hal/rgbmatrix/RGBMatrix.c | 5 ++--- ports/stm/mpconfigport.mk | 4 ++-- ports/stm/peripherals/timers.c | 6 ++++++ ports/stm/peripherals/timers.h | 1 + 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ports/stm/common-hal/rgbmatrix/RGBMatrix.c b/ports/stm/common-hal/rgbmatrix/RGBMatrix.c index 9e60cc3e6f..312f153580 100644 --- a/ports/stm/common-hal/rgbmatrix/RGBMatrix.c +++ b/ports/stm/common-hal/rgbmatrix/RGBMatrix.c @@ -27,17 +27,16 @@ #include #include "common-hal/rgbmatrix/RGBMatrix.h" +#include "timers.h" #include STM32_HAL_H extern void _PM_IRQ_HANDLER(void); void *common_hal_rgbmatrix_timer_allocate() { - // TODO(jepler) properly handle resource allocation including never-reset - return TIM6; + return stm_peripherals_find_timer(); } - void common_hal_rgbmatrix_timer_enable(void* ptr) { HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn); } diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 74ecf656e9..896d78bba7 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -4,8 +4,8 @@ INTERNAL_LIBM ?= 1 USB_SERIAL_NUMBER_LENGTH ?= 24 ifeq ($(MCU_VARIANT),STM32F405xx) - CIRCUITPY_FRAMEBUFFERIO ?= 0 - CIRCUITPY_RGBMATRIX ?= 0 + CIRCUITPY_FRAMEBUFFERIO ?= 1 + CIRCUITPY_RGBMATRIX ?= 1 endif ifeq ($(MCU_SERIES),F4) diff --git a/ports/stm/peripherals/timers.c b/ports/stm/peripherals/timers.c index 589c283100..924d3a16fb 100644 --- a/ports/stm/peripherals/timers.c +++ b/ports/stm/peripherals/timers.c @@ -85,6 +85,11 @@ uint32_t stm_peripherals_timer_get_source_freq(TIM_TypeDef * timer) { return source; } +size_t stm_peripherals_timer_get_irqnum(TIM_TypeDef * instance) { + size_t tim_id = stm_peripherals_timer_get_index(instance); + return irq_map[tim_id]; +} + void timers_reset(void) { uint16_t never_reset_mask = 0x00; for (size_t i = 0; i < MP_ARRAY_SIZE(mcu_tim_banks); i++) { @@ -120,6 +125,7 @@ TIM_TypeDef * stm_peripherals_find_timer(void) { return mcu_tim_banks[i]; } } + //TODO: secondary search for timers outside the pins in the board profile // Work backwards - higher index timers have fewer pin allocations for (size_t i = (MP_ARRAY_SIZE(mcu_tim_banks) - 1); i >= 0; i--) { diff --git a/ports/stm/peripherals/timers.h b/ports/stm/peripherals/timers.h index 8c8a80d53c..02e4e304e3 100644 --- a/ports/stm/peripherals/timers.h +++ b/ports/stm/peripherals/timers.h @@ -41,6 +41,7 @@ void tim_clock_enable(uint16_t mask); void tim_clock_disable(uint16_t mask); uint32_t stm_peripherals_timer_get_source_freq(TIM_TypeDef * timer); +size_t stm_peripherals_timer_get_irqnum(TIM_TypeDef * instance); void timers_reset(void); TIM_TypeDef * stm_peripherals_find_timer(void); void stm_peripherals_timer_preinit(TIM_TypeDef * instance, uint8_t prio, void (*callback)(void)); From 7ff499046ba6e15e115e5e3fca53204f1ec26cc3 Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Sat, 11 Jul 2020 00:37:45 +0800 Subject: [PATCH 0274/1293] use VID & PIDs granted by Seeed --- ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.mk | 4 ++-- .../nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.mk | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.mk b/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.mk index 46f9885cb1..fc630e5bbe 100644 --- a/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.mk +++ b/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.mk @@ -1,5 +1,5 @@ -USB_VID = 0x1915 -USB_PID = 0xb001 +USB_VID = 0x2886 +USB_PID = 0xf002 USB_PRODUCT = "M60 Keyboard" USB_MANUFACTURER = "Makerdiary" diff --git a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.mk b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.mk index bc5fa3c120..4e6aebc8e8 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.mk +++ b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.mk @@ -1,5 +1,5 @@ -USB_VID = 0x1915 -USB_PID = 0xb001 +USB_VID = 0x2886 +USB_PID = 0xf001 USB_PRODUCT = "nRF52840 M.2 Developer Kit" USB_MANUFACTURER = "Makerdiary" From 742f9cfdb0d286b8c4e1a30be6ba407f6e8ed47d Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Thu, 2 Jul 2020 22:57:58 +0200 Subject: [PATCH 0275/1293] Fluff M0: additional pins on version 1.3 of the board --- ports/atmel-samd/boards/fluff_m0/pins.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/atmel-samd/boards/fluff_m0/pins.c b/ports/atmel-samd/boards/fluff_m0/pins.c index d80d46b895..ac7811328b 100644 --- a/ports/atmel-samd/boards/fluff_m0/pins.c +++ b/ports/atmel-samd/boards/fluff_m0/pins.c @@ -30,6 +30,8 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA27) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA28) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, From b1ac6b4444eca556632839fb1c5d298f2936f8e5 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 10 Jul 2020 15:16:47 -0400 Subject: [PATCH 0276/1293] translations --- locale/circuitpython.pot | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index f3c9d04113..237741bff4 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-07 14:38-0500\n" +"POT-Creation-Date: 2020-07-10 15:16-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -307,7 +307,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "" @@ -1311,11 +1311,7 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "" - -#: ports/stm/common-hal/pulseio/PulseOut.c +#: ports/stm/ref/pulseout-pre-timeralloc.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1521,6 +1517,11 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" From 734661e79cc2b108079377642ef24fab1217c484 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 10 Jul 2020 16:42:32 -0700 Subject: [PATCH 0277/1293] Add support to json.load for any object with readinto This way we don't need to load the whole string version of the json into memory. --- extmod/modujson.c | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/extmod/modujson.c b/extmod/modujson.c index 0f93ccb110..1e831783a8 100644 --- a/extmod/modujson.c +++ b/extmod/modujson.c @@ -26,6 +26,8 @@ #include +#include "py/binary.h" +#include "py/objarray.h" #include "py/objlist.h" #include "py/objstringio.h" #include "py/parsenum.h" @@ -74,6 +76,8 @@ typedef struct _ujson_stream_t { mp_obj_t stream_obj; mp_uint_t (*read)(mp_obj_t obj, void *buf, mp_uint_t size, int *errcode); int errcode; + mp_obj_t python_readinto[2 + 1]; + mp_obj_array_t bytearray_obj; byte cur; } ujson_stream_t; @@ -94,9 +98,37 @@ STATIC byte ujson_stream_next(ujson_stream_t *s) { return s->cur; } +STATIC mp_uint_t ujson_python_readinto(mp_obj_t obj, void *buf, mp_uint_t size, int *errcode) { + ujson_stream_t* s = obj; + s->bytearray_obj.items = buf; + s->bytearray_obj.len = size; + *errcode = 0; + mp_obj_t ret = mp_call_method_n_kw(1, 0, s->python_readinto); + if (ret == mp_const_none) { + *errcode = MP_EAGAIN; + return MP_STREAM_ERROR; + } + return mp_obj_get_int(ret); +} + STATIC mp_obj_t _mod_ujson_load(mp_obj_t stream_obj, bool return_first_json) { - const mp_stream_p_t *stream_p = mp_get_stream_raise(stream_obj, MP_STREAM_OP_READ); - ujson_stream_t s = {stream_obj, stream_p->read, 0, 0}; + const mp_stream_p_t *stream_p = mp_proto_get(MP_QSTR_protocol_stream, stream_obj); + ujson_stream_t s; + if (stream_p == NULL) { + mp_load_method(stream_obj, MP_QSTR_readinto, s.python_readinto); + s.bytearray_obj.base.type = &mp_type_bytearray; + s.bytearray_obj.typecode = BYTEARRAY_TYPECODE; + s.bytearray_obj.free = 0; + // len and items are set at read time + s.python_readinto[2] = MP_OBJ_FROM_PTR(&s.bytearray_obj); + s.stream_obj = &s; + s.read = ujson_python_readinto; + } else { + stream_p = mp_get_stream_raise(stream_obj, MP_STREAM_OP_READ); + s.stream_obj = stream_obj; + s.read = stream_p->read; + } + JSON_DEBUG("got JSON stream\n"); vstr_t vstr; vstr_init(&vstr, 8); From 372bcf8a956c8b20c423333114d7aa061dd54751 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 10 Jul 2020 17:33:17 -0700 Subject: [PATCH 0278/1293] Fix stream version and add basic readinto test --- extmod/modujson.c | 2 ++ tests/extmod/ujson_load_readinto.py | 22 ++++++++++++++++++++++ tests/extmod/ujson_load_readinto.py.exp | 4 ++++ 3 files changed, 28 insertions(+) create mode 100644 tests/extmod/ujson_load_readinto.py create mode 100644 tests/extmod/ujson_load_readinto.py.exp diff --git a/extmod/modujson.c b/extmod/modujson.c index 1e831783a8..242726cca0 100644 --- a/extmod/modujson.c +++ b/extmod/modujson.c @@ -127,6 +127,8 @@ STATIC mp_obj_t _mod_ujson_load(mp_obj_t stream_obj, bool return_first_json) { stream_p = mp_get_stream_raise(stream_obj, MP_STREAM_OP_READ); s.stream_obj = stream_obj; s.read = stream_p->read; + s.errcode = 0; + s.cur = 0; } JSON_DEBUG("got JSON stream\n"); diff --git a/tests/extmod/ujson_load_readinto.py b/tests/extmod/ujson_load_readinto.py new file mode 100644 index 0000000000..a277f40efc --- /dev/null +++ b/tests/extmod/ujson_load_readinto.py @@ -0,0 +1,22 @@ +import ujson as json + +# Test that json can load from any object with readinto + +class Buffer: + def __init__(self, data): + self._data = data + self._i = 0 + + def readinto(self, buf): + end = self._i + len(buf) + remaining = len(self._data) - self._i + end = min(end, len(self._data)) + l = min(len(buf), remaining) + buf[:l] = self._data[self._i:end] + self._i += l + return l + +print(json.load(Buffer(b'null'))) +print(json.load(Buffer(b'"abc\\u0064e"'))) +print(json.load(Buffer(b'[false, true, 1, -2]'))) +print(json.load(Buffer(b'{"a":true}'))) diff --git a/tests/extmod/ujson_load_readinto.py.exp b/tests/extmod/ujson_load_readinto.py.exp new file mode 100644 index 0000000000..f8c3c693be --- /dev/null +++ b/tests/extmod/ujson_load_readinto.py.exp @@ -0,0 +1,4 @@ +None +abcde +[False, True, 1, -2] +{'a': True} From 8e26fdc0e9537f30924581a846de77cfbb5b5fb7 Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Sat, 11 Jul 2020 10:51:31 +0800 Subject: [PATCH 0279/1293] add LED status, remove unused macros --- ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h | 4 ++-- .../nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h b/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h index c59a5fdb28..bd9caf32fc 100644 --- a/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h +++ b/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h @@ -27,11 +27,11 @@ #include "nrfx/hal/nrf_gpio.h" -#define MAKERDIARYM60KEYBOARD - #define MICROPY_HW_BOARD_NAME "Makerdiary M60 Keyboard" #define MICROPY_HW_MCU_NAME "nRF52840" +#define MICROPY_HW_LED_STATUS (&pin_P0_30) + #define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(1, 10) #define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(1, 14) #define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(1, 15) diff --git a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.h b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.h index a3fb7643f9..8b8d6173a6 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.h +++ b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.h @@ -27,11 +27,11 @@ #include "nrfx/hal/nrf_gpio.h" -#define MAKERDIARYNRF52840M2DEVKIT - #define MICROPY_HW_BOARD_NAME "Makerdiary nRF52840 M.2 Developer Kit" #define MICROPY_HW_MCU_NAME "nRF52840" +#define MICROPY_HW_LED_STATUS (&pin_P0_30) + #define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(1, 10) #define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(1, 14) #define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(1, 15) From c8752ff93eb62f115e9129f7b2d20d8ed5a8ed88 Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Sat, 11 Jul 2020 21:25:32 +0800 Subject: [PATCH 0280/1293] use RGB LEDs as status indicators --- ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h | 4 +++- .../boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.h | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h b/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h index bd9caf32fc..086718089a 100644 --- a/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h +++ b/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h @@ -30,7 +30,9 @@ #define MICROPY_HW_BOARD_NAME "Makerdiary M60 Keyboard" #define MICROPY_HW_MCU_NAME "nRF52840" -#define MICROPY_HW_LED_STATUS (&pin_P0_30) +#define CP_RGB_STATUS_R (&pin_P0_30) +#define CP_RGB_STATUS_G (&pin_P0_29) +#define CP_RGB_STATUS_B (&pin_P0_31) #define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(1, 10) #define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(1, 14) diff --git a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.h b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.h index 8b8d6173a6..dab2ff042b 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.h +++ b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/mpconfigboard.h @@ -30,7 +30,12 @@ #define MICROPY_HW_BOARD_NAME "Makerdiary nRF52840 M.2 Developer Kit" #define MICROPY_HW_MCU_NAME "nRF52840" -#define MICROPY_HW_LED_STATUS (&pin_P0_30) +#define MICROPY_HW_LED_STATUS (&pin_P1_07) + +#define CP_RGB_STATUS_INVERTED_PWM +#define CP_RGB_STATUS_R (&pin_P0_30) +#define CP_RGB_STATUS_G (&pin_P0_29) +#define CP_RGB_STATUS_B (&pin_P0_31) #define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(1, 10) #define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(1, 14) From f6869c69c5fda701b57fbfca0eaf1aa03a2d164b Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 12 Jul 2020 19:45:23 -0400 Subject: [PATCH 0281/1293] wip: advertising; not tested --- devices/ble_hci/common-hal/_bleio/Adapter.c | 349 +++++++++++------- devices/ble_hci/common-hal/_bleio/Adapter.h | 18 +- devices/ble_hci/common-hal/_bleio/__init__.c | 7 + devices/ble_hci/common-hal/_bleio/__init__.h | 1 + devices/ble_hci/common-hal/_bleio/hci_api.c | 63 +++- devices/ble_hci/common-hal/_bleio/hci_api.h | 11 +- .../common-hal/_bleio/hci_include/hci.h | 2 + ports/atmel-samd/background.c | 26 +- ports/cxd56/background.c | 4 + ports/esp32s2/background.c | 4 + ports/litex/background.c | 13 +- ports/mimxrt10xx/background.c | 20 +- ports/nrf/background.c | 3 +- ports/nrf/common-hal/_bleio/__init__.c | 5 + ports/nrf/common-hal/_bleio/__init__.h | 1 + ports/stm/background.c | 13 +- shared-bindings/_bleio/Adapter.c | 14 + supervisor/shared/bluetooth.c | 1 - supervisor/shared/bluetooth.h | 3 +- 19 files changed, 379 insertions(+), 179 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index c08eb2db40..7817ea4707 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -48,6 +48,21 @@ #include "shared-bindings/_bleio/ScanEntry.h" #include "shared-bindings/time/__init__.h" +#define MSEC_TO_UNITS(TIME, RESOLUTION) (((TIME) * 1000) / (RESOLUTION)) +#define SEC_TO_UNITS(TIME, RESOLUTION) (((TIME) * 1000000) / (RESOLUTION)) +#define UNITS_TO_SEC(TIME, RESOLUTION) (((TIME) * (RESOLUTION)) / 1000000) +// 0.625 msecs (625 usecs) +#define ADV_INTERVAL_UNIT_FLOAT_SECS (0.000625) +// Microseconds is the base unit. The macros above know that. +#define UNIT_0_625_MS (625) +#define UNIT_1_25_MS (1250) +#define UNIT_10_MS (10000) + +// TODO make this settable from Python. +#define DEFAULT_TX_POWER 0 // 0 dBm +#define MAX_ANONYMOUS_ADV_TIMEOUT_SECS (60*15) +#define MAX_LIMITED_DISCOVERABLE_ADV_TIMEOUT_SECS (180) + #define BLE_MIN_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) #define BLE_MAX_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) #define BLE_SLAVE_LATENCY 0 @@ -158,32 +173,66 @@ bleio_connection_internal_t bleio_connections[BLEIO_TOTAL_CONNECTION_COUNT]; // return true; // } -// STATIC void get_address(bleio_adapter_obj_t *self, ble_gap_addr_t *address) { -// check_nrf_error(sd_ble_gap_addr_get(address)); -// } - char default_ble_name[] = { 'C', 'I', 'R', 'C', 'U', 'I', 'T', 'P', 'Y', 0, 0, 0, 0 , 0}; -// STATIC void bleio_adapter_reset_name(bleio_adapter_obj_t *self) { -// // uint8_t len = sizeof(default_ble_name) - 1; +STATIC void bleio_adapter_reset_name(bleio_adapter_obj_t *self) { + uint8_t len = sizeof(default_ble_name) - 1; -// // ble_gap_addr_t local_address; -// // get_address(self, &local_address); + bt_addr_t addr; + check_hci_error(hci_read_bd_addr(&addr)); -// // default_ble_name[len - 4] = nibble_to_hex_lower[local_address.addr[1] >> 4 & 0xf]; -// // default_ble_name[len - 3] = nibble_to_hex_lower[local_address.addr[1] & 0xf]; -// // default_ble_name[len - 2] = nibble_to_hex_lower[local_address.addr[0] >> 4 & 0xf]; -// // default_ble_name[len - 1] = nibble_to_hex_lower[local_address.addr[0] & 0xf]; -// // default_ble_name[len] = '\0'; // for now we add null for compatibility with C ASCIIZ strings + default_ble_name[len - 4] = nibble_to_hex_lower[addr.val[1] >> 4 & 0xf]; + default_ble_name[len - 3] = nibble_to_hex_lower[addr.val[1] & 0xf]; + default_ble_name[len - 2] = nibble_to_hex_lower[addr.val[0] >> 4 & 0xf]; + default_ble_name[len - 1] = nibble_to_hex_lower[addr.val[0] & 0xf]; + default_ble_name[len] = '\0'; // for now we add null for compatibility with C ASCIIZ strings -// common_hal_bleio_adapter_set_name(self, (char*) default_ble_name); -// } + common_hal_bleio_adapter_set_name(self, (char*) default_ble_name); +} + +// Get various values and limits set by the adapter. +STATIC void bleio_adapter_get_info(bleio_adapter_obj_t *self) { + + // Get ACL buffer info. + uint16_t le_max_len; + uint8_t le_max_num; + if (hci_le_read_buffer_size(&le_max_len, &le_max_num) == HCI_OK) { + self->max_acl_buffer_len = le_max_len; + self->max_acl_num_buffers = le_max_num; + } else { + // LE Read Buffer Size not available; use the general Read Buffer Size. + uint16_t acl_max_len; + uint8_t sco_max_len; + uint16_t acl_max_num; + uint16_t sco_max_num; + if (hci_read_buffer_size(&acl_max_len, &sco_max_len, &acl_max_num, &sco_max_num) != HCI_OK) { + mp_raise_bleio_BluetoothError(translate("Could not read BLE buffer info")); + } + self->max_acl_buffer_len = acl_max_len; + self->max_acl_num_buffers = acl_max_num; + } + + // Get max advertising length. + uint16_t max_adv_data_len; + if (hci_le_read_maximum_advertising_data_length(&max_adv_data_len) != HCI_OK) { + mp_raise_bleio_BluetoothError(translate("Could not get max advertising length")); + } + self->max_adv_data_len = max_adv_data_len; +} void common_hal_bleio_adapter_hci_uart_init(bleio_adapter_obj_t *self, busio_uart_obj_t *uart, digitalio_digitalinout_obj_t *rts, digitalio_digitalinout_obj_t *cts) { self->hci_uart = uart; self->rts_digitalinout = rts; self->cts_digitalinout = cts; self->enabled = false; + self->now_advertising = false; + self->circuitpython_advertising = false; + self->extended_advertising = false; + self->advertising_timeout_msecs = 0; + + bleio_adapter_get_info(self); + + bleio_adapter_reset_name(self); } void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enabled) { @@ -196,6 +245,13 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable //FIX enable/disable HCI adapter, but don't reset it, since we don't know how. self->enabled = enabled; + if (!enabled) { + // Stop any current activity. + check_hci_error(hci_reset()); + self->now_advertising = false; + self->extended_advertising = false; + self->circuitpython_advertising = false; + } } bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self) { @@ -221,6 +277,7 @@ void common_hal_bleio_adapter_set_name(bleio_adapter_obj_t *self, const char* na self->name = mp_obj_new_str(name, strlen(name)); } + // STATIC bool scan_on_ble_evt(ble_evt_t *ble_evt, void *scan_results_in) { // bleio_scanresults_obj_t *scan_results = (bleio_scanresults_obj_t*)scan_results_in; @@ -262,6 +319,7 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t* self->scan_results = NULL; } self->scan_results = shared_module_bleio_new_scanresults(buffer_size, prefixes, prefix_length, minimum_rssi); + // size_t max_packet_size = extended ? BLE_GAP_SCAN_BUFFER_EXTENDED_MAX_SUPPORTED : BLE_GAP_SCAN_BUFFER_MAX; // uint8_t *raw_data = m_malloc(sizeof(ble_data_t) + max_packet_size, false); // ble_data_t * sd_data = (ble_data_t *) raw_data; @@ -298,9 +356,8 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t* } void common_hal_bleio_adapter_stop_scan(bleio_adapter_obj_t *self) { - // sd_ble_gap_scan_stop(); + check_hci_error(hci_le_set_scan_enable(BT_HCI_LE_SCAN_DISABLE, BT_HCI_LE_SCAN_FILTER_DUP_DISABLE)); shared_module_bleio_scanresults_set_done(self->scan_results, true); - // ble_drv_remove_event_handler(scan_on_ble_evt, self->scan_results); self->scan_results = NULL; } @@ -431,99 +488,123 @@ STATIC void check_data_fit(size_t data_len, bool connectable) { // } uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, uint32_t timeout, float interval, uint8_t *advertising_data, uint16_t advertising_data_len, uint8_t *scan_response_data, uint16_t scan_response_data_len) { - // if (self->current_advertising_data != NULL && self->current_advertising_data == self->advertising_data) { - // return NRF_ERROR_BUSY; - // } + if (self->now_advertising) { + if (self->circuitpython_advertising) { + common_hal_bleio_adapter_stop_advertising(self); + } else { + // User-requested advertising. + // TODO allow multiple advertisements. + // Already advertising. Can't advertise twice. + return 1; + } + } - // // If the current advertising data isn't owned by the adapter then it must be an internal - // // advertisement that we should stop. - // if (self->current_advertising_data != NULL) { - // common_hal_bleio_adapter_stop_advertising(self); - // } + // Peer address, which we don't use (no directed advertising). + bt_addr_le_t empty_addr = { 0 }; - // uint32_t err_code; - // bool extended = advertising_data_len > BLE_GAP_ADV_SET_DATA_SIZE_MAX || - // scan_response_data_len > BLE_GAP_ADV_SET_DATA_SIZE_MAX; + bool extended = + advertising_data_len > self->max_adv_data_len || scan_response_data_len > self->max_adv_data_len; - // uint8_t adv_type; - // if (extended) { - // if (connectable) { - // adv_type = BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED; - // } else if (scan_response_data_len > 0) { - // adv_type = BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED; - // } else { - // adv_type = BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED; - // } - // } else if (connectable) { - // adv_type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED; - // } else if (scan_response_data_len > 0) { - // adv_type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED; - // } else { - // adv_type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED; - // } + if (extended) { + uint16_t props = 0; + if (connectable) { + props |= BT_HCI_LE_ADV_PROP_CONN; + } + if (scan_response_data_len > 0) { + props |= BT_HCI_LE_ADV_PROP_SCAN; + } - // if (anonymous) { - // ble_gap_privacy_params_t privacy = { - // .privacy_mode = BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY, - // .private_addr_type = BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE, - // // Rotate the keys one second after we're scheduled to stop - // // advertising. This prevents a potential race condition where we - // // fire off a beacon with the same advertising data but a new MAC - // // address just as we tear down the connection. - // .private_addr_cycle_s = timeout + 1, - // .p_device_irk = NULL, - // }; - // err_code = sd_ble_gap_privacy_set(&privacy); - // } else { - // ble_gap_privacy_params_t privacy = { - // .privacy_mode = BLE_GAP_PRIVACY_MODE_OFF, - // .private_addr_type = BLE_GAP_ADDR_TYPE_PUBLIC, - // .private_addr_cycle_s = 0, - // .p_device_irk = NULL, - // }; - // err_code = sd_ble_gap_privacy_set(&privacy); - // } - // if (err_code != NRF_SUCCESS) { - // return err_code; - // } + // Advertising interval. + uint32_t interval_units = SEC_TO_UNITS(interval, UNIT_0_625_MS); - // ble_gap_adv_params_t adv_params = { - // .interval = SEC_TO_UNITS(interval, UNIT_0_625_MS), - // .properties.type = adv_type, - // .duration = SEC_TO_UNITS(timeout, UNIT_10_MS), - // .filter_policy = BLE_GAP_ADV_FP_ANY, - // .primary_phy = BLE_GAP_PHY_1MBPS, - // }; + check_hci_error( + hci_le_set_extended_advertising_parameters( + 0, // handle + props, // adv properties + interval_units, // min interval + interval_units, // max interval + 0b111, // channel map: channels 37, 38, 39 + anonymous ? BT_ADDR_LE_RANDOM : BT_ADDR_LE_PUBLIC, + &empty_addr, // peer_addr, + 0x00, // filter policy: no filter + DEFAULT_TX_POWER, + BT_HCI_LE_EXT_SCAN_PHY_1M, // Secondary PHY to use + 0x00, // AUX_ADV_IND shall be sent prior to next adv event + BT_HCI_LE_EXT_SCAN_PHY_1M, // Secondary PHY to use + 0x00, // Advertising SID + 0x00 // Scan req notify disable + )); - // const ble_gap_adv_data_t ble_gap_adv_data = { - // .adv_data.p_data = advertising_data, - // .adv_data.len = advertising_data_len, - // .scan_rsp_data.p_data = scan_response_data_len > 0 ? scan_response_data : NULL, - // .scan_rsp_data.len = scan_response_data_len, - // }; + // We can use the duration mechanism provided, instead of our own. + self->advertising_timeout_msecs = 0; - // err_code = sd_ble_gap_adv_set_configure(&adv_handle, &ble_gap_adv_data, &adv_params); - // if (err_code != NRF_SUCCESS) { - // return err_code; - // } + uint8_t handle[1] = { 0 }; + uint16_t duration_10msec[1] = { timeout * 100 }; + uint8_t max_ext_adv_evts[1] = { 0 }; + check_hci_error( + hci_le_set_extended_advertising_enable( + BT_HCI_LE_ADV_ENABLE, + 1, // one advertising set. + handle, + duration_10msec, + max_ext_adv_evts + )); - // ble_drv_add_event_handler(advertising_on_ble_evt, self); + self->extended_advertising = true; + } else { + // Legacy advertising (not extended). - // vm_used_ble = true; - // err_code = sd_ble_gap_adv_start(adv_handle, BLE_CONN_CFG_TAG_CUSTOM); - // if (err_code != NRF_SUCCESS) { - // return err_code; - // } - // self->current_advertising_data = advertising_data; - // return NRF_SUCCESS; + uint8_t adv_type; + if (connectable) { + // Connectable, scannable, undirected. + adv_type = BT_HCI_ADV_IND; + } else if (scan_response_data_len > 0) { + // Unconnectable, scannable, undirected. + adv_type = BT_HCI_ADV_SCAN_IND; + } else { + // Unconnectable, unscannable, undirected. + adv_type = BT_HCI_ADV_NONCONN_IND; + } + + // Advertising interval. + uint16_t interval_units = SEC_TO_UNITS(interval, UNIT_0_625_MS); + + check_hci_error( + hci_le_set_advertising_parameters( + interval_units, // min interval + interval_units, // max interval + adv_type, + anonymous ? BT_ADDR_LE_RANDOM : BT_ADDR_LE_PUBLIC, + &empty_addr, + 0b111, // channel map: channels 37, 38, 39 + 0x00 // filter policy: no filter + )); + + // The HCI commands expect 31 octets, even though the actual data length may be shorter. + uint8_t full_data[31] = { 0 }; + memcpy(full_data, advertising_data, MIN(sizeof(full_data), advertising_data_len)); + check_hci_error(hci_le_set_advertising_data(advertising_data_len, full_data)); + memset(full_data, 0, sizeof(full_data)); + if (scan_response_data_len > 0) { + memcpy(full_data, advertising_data, MIN(sizeof(full_data), scan_response_data_len)); + check_hci_error(hci_le_set_scan_response_data(scan_response_data_len, full_data)); + } + + // No duration mechanism is provided for legacy advertising, so we need to do our own. + self->advertising_timeout_msecs = timeout * 1000; + self->advertising_start_ticks = supervisor_ticks_ms64(); + + // Start advertising. + check_hci_error(hci_le_set_advertising_enable(BT_HCI_LE_ADV_ENABLE)); + self->extended_advertising = false; + } // end legacy advertising setup + + vm_used_ble = true; + self->now_advertising = true; return 0; } - void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, uint32_t timeout, mp_float_t interval, mp_buffer_info_t *advertising_data_bufinfo, mp_buffer_info_t *scan_response_data_bufinfo) { - if (self->current_advertising_data != NULL && self->current_advertising_data == self->advertising_data) { - mp_raise_bleio_BluetoothError(translate("Already advertising.")); - } // interval value has already been validated. check_data_fit(advertising_data_bufinfo->len, connectable); @@ -536,58 +617,38 @@ void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool // Anonymous mode requires a timeout so that we don't continue to broadcast // the same data while cycling the MAC address -- otherwise, what's the // point of randomizing the MAC address? - if (!timeout) { - //FIX if (anonymous) { - // // The Nordic macro is in units of 10ms. Convert to seconds. - // uint32_t adv_timeout_max_secs = UNITS_TO_SEC(BLE_GAP_ADV_TIMEOUT_LIMITED_MAX, UNIT_10_MS); - // uint32_t rotate_timeout_max_secs = BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S; - // timeout = MIN(adv_timeout_max_secs, rotate_timeout_max_secs); - // } - // else { - // timeout = BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED; - // } + if (timeout == 0 && anonymous) { + timeout = MAX_ANONYMOUS_ADV_TIMEOUT_SECS; } else { - //FIX if (SEC_TO_UNITS(timeout, UNIT_10_MS) > BLE_GAP_ADV_TIMEOUT_LIMITED_MAX) { - // mp_raise_bleio_BluetoothError(translate("Timeout is too long: Maximum timeout length is %d seconds"), - // UNITS_TO_SEC(BLE_GAP_ADV_TIMEOUT_LIMITED_MAX, UNIT_10_MS)); - // } + if (timeout > MAX_LIMITED_DISCOVERABLE_ADV_TIMEOUT_SECS) { + mp_raise_bleio_BluetoothError(translate("Timeout is too long: Maximum timeout length is %d seconds"), + MAX_LIMITED_DISCOVERABLE_ADV_TIMEOUT_SECS); + } } - // The advertising data buffers must not move, because the SoftDevice depends on them. - // So make them long-lived and reuse them onwards. - //FIX GET CORRECT SIZE - // if (self->advertising_data == NULL) { - // self->advertising_data = (uint8_t *) gc_alloc(BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED * sizeof(uint8_t), false, true); - // } - // if (self->scan_response_data == NULL) { - // self->scan_response_data = (uint8_t *) gc_alloc(BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED * sizeof(uint8_t), false, true); - // } + const uint32_t result =_common_hal_bleio_adapter_start_advertising( + self, connectable, anonymous, timeout, interval, + advertising_data_bufinfo->buf, + advertising_data_bufinfo->len, + scan_response_data_bufinfo->buf, + scan_response_data_bufinfo->len); - memcpy(self->advertising_data, advertising_data_bufinfo->buf, advertising_data_bufinfo->len); - memcpy(self->scan_response_data, scan_response_data_bufinfo->buf, scan_response_data_bufinfo->len); - - // check_nrf_error(_common_hal_bleio_adapter_start_advertising(self, connectable, anonymous, timeout, interval, - // self->advertising_data, - // advertising_data_bufinfo->len, - // self->scan_response_data, - // scan_response_data_bufinfo->len)); + if (result) { + mp_raise_bleio_BluetoothError(translate("Already advertising")); + } + self->circuitpython_advertising = false; } void common_hal_bleio_adapter_stop_advertising(bleio_adapter_obj_t *self) { - // if (adv_handle == BLE_GAP_ADV_SET_HANDLE_NOT_SET) - // return; - - // // TODO: Don't actually stop. Switch to advertising CircuitPython if we don't already have a connection. - // const uint32_t err_code = sd_ble_gap_adv_stop(adv_handle); - // self->current_advertising_data = NULL; - - // if ((err_code != NRF_SUCCESS) && (err_code != NRF_ERROR_INVALID_STATE)) { - // check_nrf_error(err_code); - // } + self->now_advertising = false; + self->extended_advertising = false; + self->circuitpython_advertising = false; + check_hci_error(hci_le_set_advertising_enable(BT_HCI_LE_ADV_DISABLE)); + //TODO startup CircuitPython advertising again. } bool common_hal_bleio_adapter_get_advertising(bleio_adapter_obj_t *self) { - return self->current_advertising_data != NULL; + return self->now_advertising; } bool common_hal_bleio_adapter_get_connected(bleio_adapter_obj_t *self) { @@ -631,7 +692,7 @@ void bleio_adapter_gc_collect(bleio_adapter_obj_t* adapter) { void bleio_adapter_reset(bleio_adapter_obj_t* adapter) { common_hal_bleio_adapter_stop_scan(adapter); - if (adapter->current_advertising_data != NULL) { + if (adapter->now_advertising) { common_hal_bleio_adapter_stop_advertising(adapter); } @@ -646,3 +707,11 @@ void bleio_adapter_reset(bleio_adapter_obj_t* adapter) { connection->connection_obj = mp_const_none; } } + +void bleio_adapter_background(bleio_adapter_obj_t* adapter) { + if (adapter->advertising_timeout_msecs > 0 && + supervisor_ticks_ms64() - adapter->advertising_start_ticks > adapter->advertising_timeout_msecs) { + adapter->advertising_timeout_msecs = 0; + common_hal_bleio_adapter_stop_advertising(adapter); + } +} diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.h b/devices/ble_hci/common-hal/_bleio/Adapter.h index dbec03bd84..8e34f86631 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.h +++ b/devices/ble_hci/common-hal/_bleio/Adapter.h @@ -43,20 +43,32 @@ extern bleio_connection_internal_t bleio_connections[BLEIO_TOTAL_CONNECTION_COUNT]; + + typedef struct _bleio_adapter_obj_t { mp_obj_base_t base; - uint8_t* advertising_data; - uint8_t* scan_response_data; - uint8_t* current_advertising_data; bleio_scanresults_obj_t *scan_results; mp_obj_t name; mp_obj_tuple_t *connection_objs; busio_uart_obj_t* hci_uart; digitalio_digitalinout_obj_t *rts_digitalinout; digitalio_digitalinout_obj_t *cts_digitalinout; + bool now_advertising; + bool extended_advertising; + bool circuitpython_advertising; bool enabled; + + // Used to monitor advertising timeout for legacy avertising. + uint64_t advertising_start_ticks; + uint64_t advertising_timeout_msecs; // If zero, do not check. + + uint16_t max_acl_buffer_len; + uint16_t max_acl_num_buffers; + uint16_t max_adv_data_len; + } bleio_adapter_obj_t; +void bleio_adapter_background(bleio_adapter_obj_t* adapter); void bleio_adapter_gc_collect(bleio_adapter_obj_t* adapter); void bleio_adapter_reset(bleio_adapter_obj_t* adapter); diff --git a/devices/ble_hci/common-hal/_bleio/__init__.c b/devices/ble_hci/common-hal/_bleio/__init__.c index e32ca55ec8..07aaee747e 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.c +++ b/devices/ble_hci/common-hal/_bleio/__init__.c @@ -263,3 +263,10 @@ void common_hal_bleio_gattc_write(uint16_t handle, uint16_t conn_handle, mp_buff void common_hal_bleio_gc_collect(void) { bleio_adapter_gc_collect(&common_hal_bleio_adapter_obj); } + + +void bleio_background(void) { + supervisor_bluetooth_background(); + bleio_adapter_background(&common_hal_bleio_adapter_obj); + //FIX bonding_background(); +} diff --git a/devices/ble_hci/common-hal/_bleio/__init__.h b/devices/ble_hci/common-hal/_bleio/__init__.h index 00f5e0c68c..0d1c2785f7 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.h +++ b/devices/ble_hci/common-hal/_bleio/__init__.h @@ -31,6 +31,7 @@ #include "hci_api.h" +void bleio_background(void); void bleio_reset(void); typedef struct { diff --git a/devices/ble_hci/common-hal/_bleio/hci_api.c b/devices/ble_hci/common-hal/_bleio/hci_api.c index a82c0c93ca..4901ffeedb 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_api.c +++ b/devices/ble_hci/common-hal/_bleio/hci_api.c @@ -215,7 +215,7 @@ STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt[]) //FIX // ATT.removeConnection(disconn_complete->handle, disconn_complete->reason); // L2CAPSignaling.removeConnection(disconn_complete->handle, disconn_complete->reason); - hci_le_set_advertise_enable(0x01); + hci_le_set_advertising_enable(0x01); break; } @@ -365,7 +365,7 @@ hci_result_t hci_poll_for_incoming_pkt(void) { // Stop incoming data while processing packet. common_hal_digitalio_digitalinout_set_value(adapter->rts_digitalinout, true); size_t pkt_len = rx_idx; - // Reset for next pack + // Reset for next packet. rx_idx = 0; switch (rx_buffer[0]) { @@ -395,7 +395,6 @@ hci_result_t hci_poll_for_incoming_pkt(void) { } -// Returns STATIC hci_result_t write_pkt(uint8_t *buffer, size_t len) { // Wait for CTS to go low before writing to HCI adapter. uint64_t start = supervisor_ticks_ms64(); @@ -555,7 +554,7 @@ hci_result_t hci_set_evt_mask(uint64_t event_mask) { return send_command(BT_HCI_OP_SET_EVENT_MASK, sizeof(event_mask), &event_mask); } -hci_result_t hci_read_le_buffer_size(uint16_t *le_max_len, uint8_t *le_max_num) { +hci_result_t hci_le_read_buffer_size(uint16_t *le_max_len, uint8_t *le_max_num) { int result = send_command(BT_HCI_OP_LE_READ_BUFFER_SIZE, 0, NULL); if (result == HCI_OK) { struct bt_hci_rp_le_read_buffer_size *response = @@ -567,6 +566,20 @@ hci_result_t hci_read_le_buffer_size(uint16_t *le_max_len, uint8_t *le_max_num) return result; } +hci_result_t hci_read_buffer_size(uint16_t *acl_max_len, uint8_t *sco_max_len, uint16_t *acl_max_num, uint16_t *sco_max_num) { + int result = send_command(BT_HCI_OP_READ_BUFFER_SIZE, 0, NULL); + if (result == HCI_OK) { + struct bt_hci_rp_read_buffer_size *response = + (struct bt_hci_rp_read_buffer_size *) cmd_response_data; + *acl_max_len = response->acl_max_len; + *sco_max_len = response->sco_max_len; + *acl_max_num = response->acl_max_num; + *sco_max_num = response->sco_max_num; + } + + return result; +} + hci_result_t hci_le_set_random_address(uint8_t addr[6]) { return send_command(BT_HCI_OP_LE_SET_RANDOM_ADDRESS, 6, addr); } @@ -587,7 +600,30 @@ hci_result_t hci_le_set_advertising_parameters(uint16_t min_interval, uint16_t m return send_command(BT_HCI_OP_LE_SET_ADV_PARAM, sizeof(params), ¶ms); } -hci_result_t hci_le_read_maximum_advertising_data_length(int *max_adv_data_len) { +hci_result_t hci_le_set_extended_advertising_parameters(uint8_t handle, uint16_t props, uint32_t prim_min_interval, uint32_t prim_max_interval, uint8_t prim_channel_map, uint8_t own_addr_type, bt_addr_le_t *peer_addr, uint8_t filter_policy, int8_t tx_power, uint8_t prim_adv_phy, uint8_t sec_adv_max_skip, uint8_t sec_adv_phy, uint8_t sid, uint8_t scan_req_notify_enable) { + struct bt_hci_cp_le_set_ext_adv_param params = { + .handle = handle, + .props = props, + // .prim_min_interval and .prim_max_interval set below + .prim_channel_map = prim_channel_map, + .own_addr_type = own_addr_type, + // .peer_addr set below. + .tx_power = tx_power, + .sec_adv_max_skip = sec_adv_max_skip, + .sec_adv_phy = sec_adv_phy, + .sid = sid, + .scan_req_notify_enable = scan_req_notify_enable, + }; + // Assumes little-endian. + memcpy(params.prim_min_interval, (void *) &prim_min_interval, + sizeof_field(struct bt_hci_cp_le_set_ext_adv_param, prim_min_interval)); + memcpy(params.prim_max_interval, (void *) &prim_max_interval, + sizeof_field(struct bt_hci_cp_le_set_ext_adv_param, prim_max_interval)); + memcpy(params.peer_addr.a.val, peer_addr->a.val, sizeof_field(bt_addr_le_t, a.val)); + return send_command(BT_HCI_OP_LE_SET_EXT_ADV_PARAM, sizeof(params), ¶ms); +} + +hci_result_t hci_le_read_maximum_advertising_data_length(uint16_t *max_adv_data_len) { int result = send_command(BT_HCI_OP_LE_READ_MAX_ADV_DATA_LEN, 0, NULL); if (result == HCI_OK) { struct bt_hci_rp_le_read_max_adv_data_len *response = @@ -625,10 +661,25 @@ hci_result_t hci_le_set_scan_response_data(uint8_t len, uint8_t data[]) { return send_command(BT_HCI_OP_LE_SET_SCAN_RSP_DATA, sizeof(params), ¶ms); } -hci_result_t hci_le_set_advertise_enable(uint8_t enable) { +hci_result_t hci_le_set_advertising_enable(uint8_t enable) { return send_command(BT_HCI_OP_LE_SET_ADV_ENABLE, sizeof(enable), &enable); } +hci_result_t hci_le_set_extended_advertising_enable(uint8_t enable, uint8_t set_num, uint8_t handle[], uint16_t duration[], uint8_t max_ext_adv_evts[]) { + uint8_t params[sizeof(struct bt_hci_cp_le_set_ext_adv_enable) + + set_num * (sizeof(struct bt_hci_ext_adv_set))]; + struct bt_hci_cp_le_set_ext_adv_enable *params_p = (struct bt_hci_cp_le_set_ext_adv_enable *) ¶ms; + params_p->enable = enable; + params_p->set_num = set_num; + for (size_t i = 0; i < set_num; i++) { + params_p->s[i].handle = handle[i]; + params_p->s[i].duration = duration[i]; + params_p->s[i].max_ext_adv_evts = max_ext_adv_evts[i]; + } + + return send_command(BT_HCI_OP_LE_SET_EXT_ADV_ENABLE, sizeof(params), ¶ms); +} + hci_result_t hci_le_set_scan_parameters(uint8_t scan_type, uint16_t interval, uint16_t window, uint8_t addr_type, uint8_t filter_policy) { struct bt_hci_cp_le_set_scan_param params = { .scan_type = scan_type, diff --git a/devices/ble_hci/common-hal/_bleio/hci_api.h b/devices/ble_hci/common-hal/_bleio/hci_api.h index 303f26ba5e..23e45375cc 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_api.h +++ b/devices/ble_hci/common-hal/_bleio/hci_api.h @@ -45,11 +45,16 @@ hci_result_t hci_le_cancel_conn(void); hci_result_t hci_le_conn_update(uint16_t handle, uint16_t conn_interval_min, uint16_t conn_interval_max, uint16_t conn_latency, uint16_t supervision_timeout); hci_result_t hci_le_create_conn(uint16_t scan_interval, uint16_t scan_window, uint8_t filter_policy, bt_addr_le_t *peer_addr, uint8_t own_addr_type, uint16_t conn_interval_min, uint16_t conn_interval_max, uint16_t conn_latency, uint16_t supervision_timeout, uint16_t min_ce_len, uint16_t max_ce_len); -hci_result_t hci_le_read_maximum_advertising_data_length(int *max_adv_data_len); +hci_result_t hci_le_read_buffer_size(uint16_t *le_max_len, uint8_t *le_max_num); +hci_result_t hci_le_read_maximum_advertising_data_length(uint16_t *max_adv_data_len); -hci_result_t hci_le_set_advertise_enable(uint8_t enable); hci_result_t hci_le_set_advertising_data(uint8_t length, uint8_t data[]); +hci_result_t hci_le_set_advertising_enable(uint8_t enable); hci_result_t hci_le_set_advertising_parameters(uint16_t min_interval, uint16_t max_interval, uint8_t type, uint8_t own_addr_type, bt_addr_le_t *direct_addr, uint8_t channel_map, uint8_t filter_policy); + +hci_result_t hci_le_set_extended_advertising_enable(uint8_t enable, uint8_t set_num, uint8_t handle[], uint16_t duration[], uint8_t max_ext_adv_evts[]); +hci_result_t hci_le_set_extended_advertising_parameters(uint8_t handle, uint16_t props, uint32_t prim_min_interval, uint32_t prim_max_interval, uint8_t prim_channel_map, uint8_t own_addr_type, bt_addr_le_t *peer_addr, uint8_t filter_policy, int8_t tx_power, uint8_t prim_adv_phy, uint8_t sec_adv_max_skip, uint8_t sec_adv_phy, uint8_t sid, uint8_t scan_req_notify_enable); + hci_result_t hci_le_set_random_address(uint8_t addr[6]); hci_result_t hci_le_set_scan_enable(uint8_t enable, uint8_t filter_dup); hci_result_t hci_le_set_scan_parameters(uint8_t scan_type, uint16_t interval, uint16_t window, uint8_t addr_type, uint8_t filter_policy); @@ -58,7 +63,7 @@ hci_result_t hci_le_set_scan_response_data(uint8_t length, uint8_t data[]); hci_result_t hci_poll_for_incoming_pkt(void); hci_result_t hci_read_bd_addr(bt_addr_t *addr); -hci_result_t hci_read_le_buffer_size(uint16_t *le_max_len, uint8_t *le_max_num); +hci_result_t hci_read_buffer_size(uint16_t *acl_max_len, uint8_t *sco_max_len, uint16_t *acl_max_num, uint16_t *sco_max_num); hci_result_t hci_read_local_version(uint8_t *hci_version, uint16_t *hci_revision, uint8_t *lmp_version, uint16_t *manufacturer, uint16_t *lmp_subversion); hci_result_t hci_read_rssi(uint16_t handle, int *rssi); diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/hci.h b/devices/ble_hci/common-hal/_bleio/hci_include/hci.h index dbe233fef0..2de58b3d89 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_include/hci.h +++ b/devices/ble_hci/common-hal/_bleio/hci_include/hci.h @@ -14,6 +14,8 @@ #include #include "addr.h" +#define BIT(n) (1UL << (n)) + /* Special own address types for LL privacy (used in adv & scan parameters) */ #define BT_HCI_OWN_ADDR_RPA_OR_PUBLIC 0x02 #define BT_HCI_OWN_ADDR_RPA_OR_RANDOM 0x03 diff --git a/ports/atmel-samd/background.c b/ports/atmel-samd/background.c index 767c7f3b6b..0608cb9bd1 100644 --- a/ports/atmel-samd/background.c +++ b/ports/atmel-samd/background.c @@ -35,7 +35,11 @@ #include "supervisor/shared/stack.h" #include "supervisor/port.h" -#ifdef CIRCUITPY_DISPLAYIO +#if CIRCUITPY_BLEIO +#include "common-hal/_bleio/__init__.h" +#endif + +#if CIRCUITPY_DISPLAYIO #include "shared-module/displayio/__init__.h" #endif @@ -77,16 +81,22 @@ void run_background_tasks(void) { assert_heap_ok(); running_background_tasks = true; - #if CIRCUITPY_AUDIOIO || CIRCUITPY_AUDIOBUSIO +#if CIRCUITPY_AUDIOIO || CIRCUITPY_AUDIOBUSIO audio_dma_background(); - #endif - #if CIRCUITPY_DISPLAYIO - displayio_background(); - #endif +#endif - #if CIRCUITPY_NETWORK +#if CIRCUITPY_BLEIO + bleio_background(); +#endif + +#if CIRCUITPY_DISPLAYIO + displayio_background(); +#endif + +#if CIRCUITPY_NETWORK network_module_background(); - #endif +#endif + filesystem_background(); usb_background(); running_background_tasks = false; diff --git a/ports/cxd56/background.c b/ports/cxd56/background.c index ade257dd24..af0957bd07 100644 --- a/ports/cxd56/background.c +++ b/ports/cxd56/background.c @@ -45,6 +45,10 @@ void run_background_tasks(void) { assert_heap_ok(); running_background_tasks = true; +#if CIRCUITPY_BLEIO + bleio_background(); +#endif + usb_background(); filesystem_background(); diff --git a/ports/esp32s2/background.c b/ports/esp32s2/background.c index e22cf4aacc..81ebf960ff 100644 --- a/ports/esp32s2/background.c +++ b/ports/esp32s2/background.c @@ -54,6 +54,10 @@ void run_background_tasks(void) { running_background_tasks = true; filesystem_background(); +#if CIRCUITPY_BLEIO + bleio_background(); +#endif + // #if CIRCUITPY_DISPLAYIO // displayio_background(); // #endif diff --git a/ports/litex/background.c b/ports/litex/background.c index 8c18970434..b1b765536d 100644 --- a/ports/litex/background.c +++ b/ports/litex/background.c @@ -47,13 +47,18 @@ void run_background_tasks(void) { running_background_tasks = true; filesystem_background(); - #if USB_AVAILABLE +#if USB_AVAILABLE usb_background(); - #endif +#endif - #if CIRCUITPY_DISPLAYIO +#if CIRCUITPY_BLEIO + bleio_background(); +#endif + +#if CIRCUITPY_DISPLAYIO displayio_background(); - #endif +#endif + running_background_tasks = false; assert_heap_ok(); diff --git a/ports/mimxrt10xx/background.c b/ports/mimxrt10xx/background.c index ff53ea44f4..550009473e 100644 --- a/ports/mimxrt10xx/background.c +++ b/ports/mimxrt10xx/background.c @@ -58,16 +58,22 @@ void PLACE_IN_ITCM(run_background_tasks)(void) { assert_heap_ok(); running_background_tasks = true; - #if CIRCUITPY_AUDIOIO || CIRCUITPY_AUDIOBUSIO +#if CIRCUITPY_AUDIOIO || CIRCUITPY_AUDIOBUSIO audio_dma_background(); - #endif - #if CIRCUITPY_DISPLAYIO - displayio_background(); - #endif +#endif - #if CIRCUITPY_NETWORK +#if CIRCUITPY_BLEIO + bleio_background(); +#endif + +#if CIRCUITPY_DISPLAYIO + displayio_background(); +#endif + +#if CIRCUITPY_NETWORK network_module_background(); - #endif +#endif + filesystem_background(); usb_background(); running_background_tasks = false; diff --git a/ports/nrf/background.c b/ports/nrf/background.c index 966c56e0b7..faaf80b6c3 100644 --- a/ports/nrf/background.c +++ b/ports/nrf/background.c @@ -68,8 +68,7 @@ void run_background_tasks(void) { #endif #if CIRCUITPY_BLEIO - supervisor_bluetooth_background(); - bonding_background(); + bleio_background(); #endif #if CIRCUITPY_DISPLAYIO diff --git a/ports/nrf/common-hal/_bleio/__init__.c b/ports/nrf/common-hal/_bleio/__init__.c index e84bba6626..9ac26aee3c 100644 --- a/ports/nrf/common-hal/_bleio/__init__.c +++ b/ports/nrf/common-hal/_bleio/__init__.c @@ -244,3 +244,8 @@ void common_hal_bleio_gattc_write(uint16_t handle, uint16_t conn_handle, mp_buff void common_hal_bleio_gc_collect(void) { bleio_adapter_gc_collect(&common_hal_bleio_adapter_obj); } + +void bleio_background(void) { + supervisor_bluetooth_background(); + bonding_background(); +} diff --git a/ports/nrf/common-hal/_bleio/__init__.h b/ports/nrf/common-hal/_bleio/__init__.h index e216795fcd..0b2c5334bb 100644 --- a/ports/nrf/common-hal/_bleio/__init__.h +++ b/ports/nrf/common-hal/_bleio/__init__.h @@ -27,6 +27,7 @@ #ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_BLEIO_INIT_H #define MICROPY_INCLUDED_NRF_COMMON_HAL_BLEIO_INIT_H +void bleio_background(void); void bleio_reset(void); typedef struct { diff --git a/ports/stm/background.c b/ports/stm/background.c index 8c18970434..b1b765536d 100644 --- a/ports/stm/background.c +++ b/ports/stm/background.c @@ -47,13 +47,18 @@ void run_background_tasks(void) { running_background_tasks = true; filesystem_background(); - #if USB_AVAILABLE +#if USB_AVAILABLE usb_background(); - #endif +#endif - #if CIRCUITPY_DISPLAYIO +#if CIRCUITPY_BLEIO + bleio_background(); +#endif + +#if CIRCUITPY_DISPLAYIO displayio_background(); - #endif +#endif + running_background_tasks = false; assert_heap_ok(); diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 13b84bbac7..8673044165 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -47,6 +47,12 @@ #define INTERVAL_MAX_STRING "40.959375" #define WINDOW_DEFAULT (0.1f) +STATIC void check_enabled(bleio_adapter_obj_t *self) { + if (!common_hal_bleio_adapter_get_enabled(self)) { + mp_raise_bleio_BluetoothError(translate("Adapter not enabled")); + } +} + //| class Adapter: //| """BLE adapter //| @@ -102,6 +108,7 @@ mp_obj_t bleio_adapter_hci_uart_init(mp_uint_t n_args, const mp_obj_t *pos_args, !MP_OBJ_IS_TYPE(cts, &digitalio_digitalinout_type)) { mp_raise_ValueError(translate("Expected a DigitalInOut")); } + check_enabled(self); common_hal_bleio_adapter_hci_uart_init(self, uart, rts, cts); common_hal_bleio_adapter_set_enabled(self, true); @@ -238,6 +245,7 @@ STATIC mp_obj_t bleio_adapter_start_advertising(mp_uint_t n_args, const mp_obj_t mp_raise_bleio_BluetoothError(translate("Cannot have scan responses for extended, connectable advertisements.")); } + check_enabled(self); common_hal_bleio_adapter_start_advertising(self, connectable, anonymous, timeout, interval, &data_bufinfo, &scan_response_bufinfo); @@ -252,6 +260,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_start_advertising_obj, 2, bleio_ STATIC mp_obj_t bleio_adapter_stop_advertising(mp_obj_t self_in) { bleio_adapter_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_enabled(self); common_hal_bleio_adapter_stop_advertising(self); return mp_const_none; @@ -327,6 +336,7 @@ STATIC mp_obj_t bleio_adapter_start_scan(size_t n_args, const mp_obj_t *pos_args } } + check_enabled(self); return common_hal_bleio_adapter_start_scan(self, prefix_bufinfo.buf, prefix_bufinfo.len, args[ARG_extended].u_bool, args[ARG_buffer_size].u_int, timeout, interval, window, args[ARG_minimum_rssi].u_int, args[ARG_active].u_bool); } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_start_scan_obj, 1, bleio_adapter_start_scan); @@ -338,6 +348,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_start_scan_obj, 1, bleio_adapter STATIC mp_obj_t bleio_adapter_stop_scan(mp_obj_t self_in) { bleio_adapter_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_enabled(self); common_hal_bleio_adapter_stop_scan(self); return mp_const_none; @@ -365,6 +376,7 @@ const mp_obj_property_t bleio_adapter_advertising_obj = { //| connection. (read-only)""" //| STATIC mp_obj_t bleio_adapter_get_connected(mp_obj_t self) { + check_enabled(self); return mp_obj_new_bool(common_hal_bleio_adapter_get_connected(self)); } @@ -382,6 +394,7 @@ const mp_obj_property_t bleio_adapter_connected_obj = { //| :py:meth:`_bleio.Adapter.connect`. (read-only)""" //| STATIC mp_obj_t bleio_adapter_get_connections(mp_obj_t self) { + check_enabled(self); return common_hal_bleio_adapter_get_connections(self); } MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_get_connections_obj, bleio_adapter_get_connections); @@ -419,6 +432,7 @@ STATIC mp_obj_t bleio_adapter_connect(mp_uint_t n_args, const mp_obj_t *pos_args bleio_address_obj_t *address = MP_OBJ_TO_PTR(args[ARG_address].u_obj); mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj); + check_enabled(self); return common_hal_bleio_adapter_connect(self, address, timeout); } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_connect_obj, 2, bleio_adapter_connect); diff --git a/supervisor/shared/bluetooth.c b/supervisor/shared/bluetooth.c index d2ff55377a..56bf321173 100644 --- a/supervisor/shared/bluetooth.c +++ b/supervisor/shared/bluetooth.c @@ -214,7 +214,6 @@ STATIC void close_current_file(void) { uint32_t current_command[1024 / sizeof(uint32_t)]; volatile size_t current_offset; - void supervisor_bluetooth_background(void) { if (!run_ble_background) { return; diff --git a/supervisor/shared/bluetooth.h b/supervisor/shared/bluetooth.h index aa5ae60bf7..4c40c65d2d 100644 --- a/supervisor/shared/bluetooth.h +++ b/supervisor/shared/bluetooth.h @@ -27,7 +27,8 @@ #ifndef MICROPY_INCLUDED_SUPERVISOR_SHARED_BLUETOOTH_H #define MICROPY_INCLUDED_SUPERVISOR_SHARED_BLUETOOTH_H -void supervisor_start_bluetooth(void); +void bleio_background(void); void supervisor_bluetooth_background(void); +void supervisor_start_bluetooth(void); #endif // MICROPY_INCLUDED_SUPERVISOR_SHARED_BLUETOOTH_H From b8910676db54ab260b55b756bf3ea3fcd599c995 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 13 Jul 2020 11:52:30 -0400 Subject: [PATCH 0282/1293] Add missing enum preprocessor protection --- ports/stm/peripherals/timers.c | 71 +++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/ports/stm/peripherals/timers.c b/ports/stm/peripherals/timers.c index 924d3a16fb..1bcee36455 100644 --- a/ports/stm/peripherals/timers.c +++ b/ports/stm/peripherals/timers.c @@ -35,30 +35,97 @@ #include "shared-bindings/microcontroller/Pin.h" #define ALL_CLOCKS 0xFFFF +#define NULL_IRQ 0xFF static bool stm_timer_reserved[MP_ARRAY_SIZE(mcu_tim_banks)]; static bool stm_timer_never_reset[MP_ARRAY_SIZE(mcu_tim_banks)]; static void (*stm_timer_callback[MP_ARRAY_SIZE(mcu_tim_banks)])(void); static size_t irq_map[] = { + #ifdef TIM1 TIM1_CC_IRQn, + #else + NULL_IRQ, + #endif + #ifdef TIM2 TIM2_IRQn, + #else + NULL_IRQ, + #endif + #ifdef TIM3 TIM3_IRQn, + #else + NULL_IRQ, + #endif + #ifdef TIM4 TIM4_IRQn, + #else + NULL_IRQ, + #endif + #ifdef TIM5 TIM5_IRQn, + #else + NULL_IRQ, + #endif + #ifdef TIM6 TIM6_DAC_IRQn, + #else + NULL_IRQ, + #endif + #ifdef TIM7 TIM7_IRQn, + #else + NULL_IRQ, + #endif + #ifdef TIM8 TIM8_CC_IRQn, + #else + NULL_IRQ, + #endif + #ifdef TIM9 TIM1_BRK_TIM9_IRQn, + #else + NULL_IRQ, + #endif + #ifdef TIM10 TIM1_UP_TIM10_IRQn, + #else + NULL_IRQ, + #endif + #ifdef TIM11 TIM1_TRG_COM_TIM11_IRQn, + #else + NULL_IRQ, + #endif + #ifdef TIM12 TIM8_BRK_TIM12_IRQn, + #else + NULL_IRQ, + #endif + #ifdef TIM13 TIM8_UP_TIM13_IRQn, + #else + NULL_IRQ, + #endif + #ifdef TIM14 TIM8_TRG_COM_TIM14_IRQn, -#if (CPY_STM32H7) + #else + NULL_IRQ, + #endif + #ifdef TIM15 TIM15_IRQn, + #else + NULL_IRQ, + #endif + #ifdef TIM16 TIM16_IRQn, + #else + NULL_IRQ, + #endif + #ifdef TIM17 TIM17_IRQn, -#endif + #else + NULL_IRQ, + #endif }; // Get the frequency (in Hz) of the source clock for the given timer. From 0354d4a2250eab3d9e7ef8599d322c394fb0690f Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 8 Jul 2020 20:32:36 +0200 Subject: [PATCH 0283/1293] 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 | 6 +++++- locale/de_DE.po | 6 +++++- locale/es.po | 6 +++++- locale/fil.po | 6 +++++- locale/fr.po | 6 +++++- locale/it_IT.po | 6 +++++- locale/ko.po | 6 +++++- locale/nl.po | 6 +++++- locale/pl.po | 6 +++++- locale/pt_BR.po | 6 +++++- locale/sv.po | 6 +++++- locale/zh_Latn_pinyin.po | 6 +++++- 13 files changed, 67 insertions(+), 14 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index aab5f82810..a72e63eec8 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-02 15:29+0200\n" +"POT-Creation-Date: 2020-07-07 14:38-0500\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -824,7 +824,8 @@ msgstr "File sudah ada" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." -msgstr "Frekuensi yang ditangkap berada di atas kemampuan. Penangkapan Ditunda." +msgstr "" +"Frekuensi yang ditangkap berada di atas kemampuan. Penangkapan Ditunda." #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" @@ -1116,6 +1117,10 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide SCK pin" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/cs.po b/locale/cs.po index dfe1cfa384..b6206da297 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-02 15:29+0200\n" +"POT-Creation-Date: 2020-07-07 14:38-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -1100,6 +1100,10 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide SCK pin" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/de_DE.po b/locale/de_DE.po index f2d9258566..72d0329487 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-02 15:29+0200\n" +"POT-Creation-Date: 2020-07-07 14:38-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -1119,6 +1119,10 @@ msgstr "Muss eine %q Unterklasse sein." msgid "Must provide MISO or MOSI pin" msgstr "Muss MISO- oder MOSI-Pin bereitstellen" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide SCK pin" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/es.po b/locale/es.po index 2778c53315..4f618c9d37 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-02 15:29+0200\n" +"POT-Creation-Date: 2020-07-07 14:38-0500\n" "PO-Revision-Date: 2020-07-07 15:59+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -1116,6 +1116,10 @@ msgstr "Debe de ser una subclase de %q" msgid "Must provide MISO or MOSI pin" msgstr "Debe proporcionar un pin MISO o MOSI" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide SCK pin" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/fil.po b/locale/fil.po index 3489316130..4738619fff 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-02 15:29+0200\n" +"POT-Creation-Date: 2020-07-07 14:38-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -1108,6 +1108,10 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide SCK pin" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/fr.po b/locale/fr.po index 2db7f47222..c3aa827df6 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-02 15:29+0200\n" +"POT-Creation-Date: 2020-07-07 14:38-0500\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" "Language: fr\n" @@ -1121,6 +1121,10 @@ msgstr "Doit être une sous-classe de %q." msgid "Must provide MISO or MOSI pin" msgstr "Doit fournir une broche MISO ou MOSI" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide SCK pin" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/it_IT.po b/locale/it_IT.po index bd49e2388b..fd5d61a1a7 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-02 15:29+0200\n" +"POT-Creation-Date: 2020-07-07 14:38-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -1112,6 +1112,10 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide SCK pin" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/ko.po b/locale/ko.po index 4bd56cde1e..975e1087df 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-02 15:29+0200\n" +"POT-Creation-Date: 2020-07-07 14:38-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -1096,6 +1096,10 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide SCK pin" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/nl.po b/locale/nl.po index 34e9c835a2..9810c471c0 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-02 15:29+0200\n" +"POT-Creation-Date: 2020-07-07 14:38-0500\n" "PO-Revision-Date: 2020-07-02 20:42+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -1112,6 +1112,10 @@ msgstr "%q moet een subklasse zijn." msgid "Must provide MISO or MOSI pin" msgstr "MISO of MOSI moeten worden gegeven" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide SCK pin" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/pl.po b/locale/pl.po index 7724481314..8fea2d8152 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-02 15:29+0200\n" +"POT-Creation-Date: 2020-07-07 14:38-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -1097,6 +1097,10 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide SCK pin" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index f25d2d86e6..ace88d1e3b 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-02 15:29+0200\n" +"POT-Creation-Date: 2020-07-07 14:38-0500\n" "PO-Revision-Date: 2020-07-03 22:53+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -1119,6 +1119,10 @@ msgstr "Deve ser uma subclasse %q." msgid "Must provide MISO or MOSI pin" msgstr "Deve informar os pinos MISO ou MOSI" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide SCK pin" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/sv.po b/locale/sv.po index 3ec91c19ee..299fc796f3 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-02 15:29+0200\n" +"POT-Creation-Date: 2020-07-07 14:38-0500\n" "PO-Revision-Date: 2020-06-03 18:59+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -1111,6 +1111,10 @@ msgstr "Måste vara en %q-subklass." msgid "Must provide MISO or MOSI pin" msgstr "Måste ange MISO- eller MOSI-pinne" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide SCK pin" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index db41adb536..1928ff2b61 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-02 15:29+0200\n" +"POT-Creation-Date: 2020-07-07 14:38-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -1105,6 +1105,10 @@ msgstr "Bìxū shì %q zi lèi." msgid "Must provide MISO or MOSI pin" msgstr "Bìxū tígōng MISO huò MOSI yǐn jiǎo" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide SCK pin" +msgstr "" + #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" From 9f81922be38c1a28dce54bcb0612175513fc15ce Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Wed, 8 Jul 2020 18:40:31 +0000 Subject: [PATCH 0284/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (779 of 779 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 ace88d1e3b..da57f725de 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-07 14:38-0500\n" -"PO-Revision-Date: 2020-07-03 22:53+0000\n" +"PO-Revision-Date: 2020-07-09 17:23+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -1121,7 +1121,7 @@ msgstr "Deve informar os pinos MISO ou MOSI" #: ports/stm/common-hal/busio/SPI.c msgid "Must provide SCK pin" -msgstr "" +msgstr "É obrigatório informar o pino SCK" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format From 8e7dab34c251ee5df3e26d453dfd6782f32d7789 Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Thu, 9 Jul 2020 19:37:05 +0000 Subject: [PATCH 0285/1293] Translated using Weblate (Spanish) Currently translated at 99.8% (778 of 779 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/locale/es.po b/locale/es.po index 4f618c9d37..bfa2c21cc2 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-07 14:38-0500\n" -"PO-Revision-Date: 2020-07-07 15:59+0000\n" +"PO-Revision-Date: 2020-07-10 18:15+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" @@ -576,7 +576,7 @@ msgstr "Iniciado de pin de reloj fallido." #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" -msgstr "Clock stretch demasiado largo " +msgstr "Estirado de reloj demasiado largo" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Clock unit in use" @@ -692,7 +692,7 @@ msgstr "Trozo de datos debe seguir fmt chunk" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Data too large for advertisement packet" -msgstr "Data es muy grande para el paquete de advertisement." +msgstr "Data es muy grande para el paquete de anuncio" #: shared-bindings/audiobusio/PDMIn.c msgid "Destination capacity is smaller than destination_length." @@ -746,7 +746,7 @@ msgstr "Se espera un %q" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c msgid "Expected a Characteristic" -msgstr "Se esperaba una Característica." +msgstr "Se esperaba una Característica" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" @@ -776,7 +776,7 @@ msgstr "FFT se define solo para ndarrays" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." -msgstr "Fallo enviando comando" +msgstr "Fallo enviando comando." #: ports/nrf/sd_mutex.c #, c-format @@ -873,7 +873,7 @@ msgid "" "mpy-update for more info." msgstr "" "Archivo .mpy incompatible. Actualice todos los archivos .mpy. Consulte " -"http://adafru.it/mpy-update para más información" +"http://adafru.it/mpy-update para más información." #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" @@ -981,7 +981,7 @@ msgstr "Frecuencia suministrada no válida" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "Acceso a memoria no válido" +msgstr "Acceso a memoria no válido." #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid number of bits" @@ -1065,7 +1065,7 @@ msgstr "LHS del agumento por palabra clave deberia ser un identificador" #: shared-module/displayio/Group.c msgid "Layer already in a group." -msgstr "Layer ya pertenece a un grupo" +msgstr "La capa ya pertenece a un grupo." #: shared-module/displayio/Group.c msgid "Layer must be a Group or TileGrid subclass." @@ -1110,7 +1110,7 @@ msgstr "Falta el pin MISO o MOSI" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." -msgstr "Debe de ser una subclase de %q" +msgstr "Debe de ser una subclase de %q." #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" @@ -1118,7 +1118,7 @@ msgstr "Debe proporcionar un pin MISO o MOSI" #: ports/stm/common-hal/busio/SPI.c msgid "Must provide SCK pin" -msgstr "" +msgstr "Debes proveer un pin para SCK" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1239,7 +1239,7 @@ msgid "" "Object has been deinitialized and can no longer be used. Create a new object." msgstr "" "El objeto se ha desinicializado y ya no se puede utilizar. Crea un nuevo " -"objeto" +"objeto." #: ports/nrf/common-hal/busio/UART.c msgid "Odd parity is not supported" @@ -1268,7 +1268,7 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." -msgstr "El sobremuestreo debe ser un múltiplo de 8" +msgstr "El sobremuestreo debe ser un múltiplo de 8." #: shared-bindings/pulseio/PWMOut.c msgid "" @@ -1279,8 +1279,8 @@ msgstr "PWM duty_cycle debe ser entre 0 y 65535 inclusivo (16 bit resolution)" msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" -"PWM frecuencia no esta escrito cuando el variable_frequency es falso en " -"construcion" +"La frecuencia de PWM no se puede escribir variable_frequency es False en la " +"construcción." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c @@ -1465,7 +1465,7 @@ msgstr "Serializer está siendo utilizado" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." -msgstr "Slice y value tienen diferentes longitudes" +msgstr "Slice y value tienen tamaños diferentes." #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c @@ -1657,7 +1657,7 @@ msgstr "No se pudo leer los datos de la paleta de colores" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." -msgstr "Imposible escribir en nvm" +msgstr "Imposible escribir en nvm." #: ports/nrf/common-hal/_bleio/UUID.c msgid "Unexpected nrfx uuid type" @@ -2280,9 +2280,9 @@ msgid "end_x should be an int" msgstr "end_x debe ser un int" #: ports/nrf/common-hal/busio/UART.c -#, c-format +#, c-format, fuzzy msgid "error = 0x%08lX" -msgstr "error = 0x%08lx" +msgstr "error = 0x%08lX" #: py/runtime.c msgid "exceptions must derive from BaseException" From 7b31ededcd066e9eb7222a5f644ee9d521e14d7c Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Mon, 13 Jul 2020 17:00:41 +0000 Subject: [PATCH 0286/1293] Translated using Weblate (Swedish) Currently translated at 100.0% (779 of 779 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 299fc796f3..1ea1bb1de5 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-07 14:38-0500\n" -"PO-Revision-Date: 2020-06-03 18:59+0000\n" +"PO-Revision-Date: 2020-07-13 17:39+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -16,7 +16,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.1-dev\n" +"X-Generator: Weblate 4.2-dev\n" #: main.c msgid "" @@ -68,7 +68,7 @@ msgstr "%d adresspinnar och %d RGB-pinnar indikerar en höjd av %d, inte %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" -msgstr "" +msgstr "%q-fel: %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -99,7 +99,7 @@ msgstr "%q måste vara en tuple av längd 2" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q pin invalid" -msgstr "" +msgstr "Pinne %q ogiltig" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" @@ -438,7 +438,7 @@ msgstr "Buffertlängd %d för stor. Den måste vara mindre än %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" -msgstr "" +msgstr "Buffertlängd måste vara en multipel av 512" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -604,11 +604,11 @@ msgstr "Korrupt rå kod" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" -msgstr "" +msgstr "Kan inte initiera GNSS" #: ports/cxd56/common-hal/sdioio/SDCard.c msgid "Could not initialize SDCard" -msgstr "" +msgstr "Kan inte initiera SD-kort" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" @@ -896,7 +896,7 @@ msgstr "Internt fel #%d" #: shared-bindings/sdioio/SDCard.c msgid "Invalid %q" -msgstr "" +msgstr "Ogiltig %q" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1113,7 +1113,7 @@ msgstr "Måste ange MISO- eller MOSI-pinne" #: ports/stm/common-hal/busio/SPI.c msgid "Must provide SCK pin" -msgstr "" +msgstr "Måste ange SCK-pinne" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1417,7 +1417,7 @@ msgstr "Kör i säkert läge! Sparad kod körs inte.\n" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" -msgstr "" +msgstr "SD-kort CSD-format stöds inte" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c @@ -1489,7 +1489,7 @@ msgstr "Ange minst en UART-pinne" #: shared-bindings/gnss/GNSS.c msgid "System entry must be gnss.SatelliteSystem" -msgstr "" +msgstr "Systeminträdet måste vara gnss. SatellitSystem" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" @@ -2058,7 +2058,7 @@ msgstr "kan inte skicka icke-None värde till nystartad generator" #: shared-module/sdcardio/SDCard.c msgid "can't set 512 block size" -msgstr "" +msgstr "kan inte sätta blockstorlek 512" #: py/objnamedtuple.c msgid "can't set attribute" @@ -2190,7 +2190,7 @@ msgstr "kan inte invertera Vandermonde-matris" #: shared-module/sdcardio/SDCard.c msgid "couldn't determine SD card version" -msgstr "" +msgstr "kan inte avgöra SD-kortversion" #: extmod/ulab/code/approx.c msgid "data must be iterable" @@ -2757,7 +2757,7 @@ msgstr "negativt skiftantal" #: shared-module/sdcardio/SDCard.c msgid "no SD card" -msgstr "" +msgstr "inget SD-kort" #: py/vm.c msgid "no active exception to reraise" @@ -2782,7 +2782,7 @@ msgstr "ingen reset-pinne tillgänglig" #: shared-module/sdcardio/SDCard.c msgid "no response from SD card" -msgstr "" +msgstr "inget svar från SD-kort" #: py/runtime.c msgid "no such attribute" @@ -3078,15 +3078,15 @@ msgstr "värdet för sleep måste vara positivt" #: extmod/ulab/code/ndarray.c msgid "slice step can't be zero" -msgstr "" +msgstr "segmentsteg kan inte vara noll" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" -msgstr "segmentsteg får inte vara noll" +msgstr "segmentsteg kan inte vara noll" #: py/objint.c py/sequence.c msgid "small int overflow" -msgstr "värdet för konvertering till small int överskreds" +msgstr "värdet för small int överskreds" #: main.c msgid "soft reboot\n" @@ -3098,15 +3098,15 @@ msgstr "argumentet sort måste vara en ndarray" #: extmod/ulab/code/filter.c msgid "sos array must be of shape (n_section, 6)" -msgstr "" +msgstr "sos array måste ha form (n_section, 6)" #: extmod/ulab/code/filter.c msgid "sos[:, 3] should be all ones" -msgstr "" +msgstr "sos[:, 3] måste vara ettor" #: extmod/ulab/code/filter.c msgid "sosfilt requires iterable arguments" -msgstr "" +msgstr "sosfilt kräver iterable argument" #: py/objstr.c msgid "start/end indices" @@ -3195,11 +3195,11 @@ msgstr "timeout måste vara >= 0.0" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" -msgstr "" +msgstr "timeout för v1-kort" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v2 card" -msgstr "" +msgstr "timeout för v2-kort" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" @@ -3400,15 +3400,15 @@ msgstr "noll steg" #: extmod/ulab/code/filter.c msgid "zi must be an ndarray" -msgstr "" +msgstr "zi måste vara en ndarray" #: extmod/ulab/code/filter.c msgid "zi must be of float type" -msgstr "" +msgstr "zi måste vara av typ float" #: extmod/ulab/code/filter.c msgid "zi must be of shape (n_section, 2)" -msgstr "" +msgstr "zi måste vara i formen (n_section, 2)" #~ msgid "I2C operation not supported" #~ msgstr "I2C-åtgärd stöds inte" From f1b3c88d6e2f29b94c69aa5e23c269b7f31f769f Mon Sep 17 00:00:00 2001 From: _fonzlate Date: Mon, 13 Jul 2020 17:26:13 +0000 Subject: [PATCH 0287/1293] Translated using Weblate (Dutch) Currently translated at 100.0% (779 of 779 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/nl/ --- locale/nl.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index 9810c471c0..44d829041d 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-07 14:38-0500\n" -"PO-Revision-Date: 2020-07-02 20:42+0000\n" +"PO-Revision-Date: 2020-07-13 17:39+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" "Language: nl\n" @@ -1114,7 +1114,7 @@ msgstr "MISO of MOSI moeten worden gegeven" #: ports/stm/common-hal/busio/SPI.c msgid "Must provide SCK pin" -msgstr "" +msgstr "SCK pin moet opgegeven worden" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format From 0ab2c7b10a68977b750b5ccd8b7475ad2162085d Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Mon, 13 Jul 2020 18:15:53 +0000 Subject: [PATCH 0288/1293] Translated using Weblate (Spanish) Currently translated at 100.0% (779 of 779 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/locale/es.po b/locale/es.po index bfa2c21cc2..38c6ecf7ee 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-07 14:38-0500\n" -"PO-Revision-Date: 2020-07-10 18:15+0000\n" +"PO-Revision-Date: 2020-07-13 19:24+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" @@ -536,7 +536,7 @@ msgstr "No se puede especificar RTS o CTS en modo RS485" #: py/objslice.c msgid "Cannot subclass slice" -msgstr "Cannot subclass slice" +msgstr "No se puede manejar la partición en una subclase" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins." @@ -1279,7 +1279,7 @@ msgstr "PWM duty_cycle debe ser entre 0 y 65535 inclusivo (16 bit resolution)" msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" -"La frecuencia de PWM no se puede escribir variable_frequency es False en la " +"La frecuencia de PWM no se puede escribir variable_frequency es False en la " "construcción." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c @@ -1685,7 +1685,7 @@ msgstr "Error suave desconocido en dispositivo: %04x" #: shared-bindings/_pixelbuf/PixelBuf.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)" +msgstr "Número incomparable de elementos en RHS (%d esperado,%d obtenido)." #: ports/nrf/common-hal/_bleio/__init__.c msgid "" @@ -1728,7 +1728,7 @@ msgstr "Tamaño de valor > max_length" #: py/emitnative.c msgid "Viper functions don't currently support more than 4 arguments" -msgstr "funciones Viper actualmente no soportan más de 4 argumentos." +msgstr "funciones Viper no soportan por el momento, más de 4 argumentos" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Voltage read timed out" @@ -2280,7 +2280,7 @@ msgid "end_x should be an int" msgstr "end_x debe ser un int" #: ports/nrf/common-hal/busio/UART.c -#, c-format, fuzzy +#, c-format msgid "error = 0x%08lX" msgstr "error = 0x%08lX" @@ -2439,7 +2439,7 @@ msgstr "la función toma %d argumentos posicionales pero le fueron dados %d" #: shared-bindings/time/__init__.c msgid "function takes exactly 9 arguments" -msgstr "la función toma exactamente 9 argumentos." +msgstr "la función toma exactamente 9 argumentos" #: py/objgenerator.c msgid "generator already executing" From a2233ced87700e50fb70c124d0f42eefb4c0c487 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 14 Jul 2020 01:28:58 +0200 Subject: [PATCH 0289/1293] 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 | 1 - locale/cs.po | 1 - locale/de_DE.po | 1 - locale/es.po | 1 - locale/fil.po | 1 - locale/fr.po | 1 - locale/it_IT.po | 1 - locale/ko.po | 1 - locale/nl.po | 1 - locale/pl.po | 1 - locale/pt_BR.po | 1 - locale/sv.po | 1 - locale/zh_Latn_pinyin.po | 1 - 13 files changed, 13 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index edca87f830..9e10156e6a 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # # SPDX-License-Identifier: MIT - msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" diff --git a/locale/cs.po b/locale/cs.po index cfd0038f00..d09cf1e94b 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # # SPDX-License-Identifier: MIT - msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" diff --git a/locale/de_DE.po b/locale/de_DE.po index 041b1ae510..1e168db528 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # # SPDX-License-Identifier: MIT - msgid "" msgstr "" "Project-Id-Version: \n" diff --git a/locale/es.po b/locale/es.po index 6245c70686..0dd09a98df 100644 --- a/locale/es.po +++ b/locale/es.po @@ -4,7 +4,6 @@ # # SPDX-License-Identifier: MIT #, fuzzy - msgid "" msgstr "" "Project-Id-Version: \n" diff --git a/locale/fil.po b/locale/fil.po index 2b2ade0316..1297ce186d 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # # SPDX-License-Identifier: MIT - msgid "" msgstr "" "Project-Id-Version: \n" diff --git a/locale/fr.po b/locale/fr.po index 58714abbf0..4582974d45 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -3,7 +3,6 @@ # SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # # SPDX-License-Identifier: MIT - msgid "" msgstr "" "Project-Id-Version: 0.1\n" diff --git a/locale/it_IT.po b/locale/it_IT.po index df3000a47a..2358433825 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -2,7 +2,6 @@ # SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # # SPDX-License-Identifier: MIT - msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" diff --git a/locale/ko.po b/locale/ko.po index 17bcd9837d..6829f6819f 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -2,7 +2,6 @@ # SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # # SPDX-License-Identifier: MIT - msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" diff --git a/locale/nl.po b/locale/nl.po index 6d08b44966..d39d0bb189 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # # SPDX-License-Identifier: MIT - msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" diff --git a/locale/pl.po b/locale/pl.po index 966b65965a..e8b7298a2a 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -2,7 +2,6 @@ # SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # # SPDX-License-Identifier: MIT - msgid "" msgstr "" "Project-Id-Version: \n" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index c9cd065427..024608b3db 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # # SPDX-License-Identifier: MIT - msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" diff --git a/locale/sv.po b/locale/sv.po index 4973cf52a0..b588cbea7e 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # # SPDX-License-Identifier: MIT - msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 64af0c2db8..0f6d55fd16 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -2,7 +2,6 @@ # SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # # SPDX-License-Identifier: MIT - msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" From e963cff72de0efbd4e9c0b177caab88363f67d2e Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 13 Jul 2020 22:27:06 -0500 Subject: [PATCH 0290/1293] Issue #2949 Run background checks during long multiplications --- py/mpz.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/py/mpz.c b/py/mpz.c index 7800cdcc45..8b8541c737 100644 --- a/py/mpz.c +++ b/py/mpz.c @@ -443,8 +443,11 @@ STATIC size_t mpn_mul(mpz_dig_t *idig, mpz_dig_t *jdig, size_t jlen, mpz_dig_t * *id++ = carry; } - ilen = id - oidig; + ilen = id - oidig; + // check to prevent usb starvation + RUN_BACKGROUND_TASKS; } + return ilen; } From 30361f6f2a9cea4ae2aeb6dc41f5872d1f6fadee Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 13 Jul 2020 22:39:30 -0500 Subject: [PATCH 0291/1293] Fix formatting --- py/mpz.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/py/mpz.c b/py/mpz.c index 8b8541c737..05827d1045 100644 --- a/py/mpz.c +++ b/py/mpz.c @@ -443,12 +443,11 @@ STATIC size_t mpn_mul(mpz_dig_t *idig, mpz_dig_t *jdig, size_t jlen, mpz_dig_t * *id++ = carry; } - ilen = id - oidig; - // check to prevent usb starvation - RUN_BACKGROUND_TASKS; + ilen = id - oidig; + // check to prevent usb starvation + RUN_BACKGROUND_TASKS; } - return ilen; } From 14799f9ee6e634d73463a9ed401b5cc9a3219749 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 13 Jul 2020 22:43:46 -0500 Subject: [PATCH 0292/1293] more formatting fix --- py/mpz.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/mpz.c b/py/mpz.c index 05827d1045..4ef00f73c9 100644 --- a/py/mpz.c +++ b/py/mpz.c @@ -447,7 +447,7 @@ STATIC size_t mpn_mul(mpz_dig_t *idig, mpz_dig_t *jdig, size_t jlen, mpz_dig_t * // check to prevent usb starvation RUN_BACKGROUND_TASKS; } - + return ilen; } From e5f7adcf5d1257cefd33831d541b829ca8267aca Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 13 Jul 2020 22:54:52 -0500 Subject: [PATCH 0293/1293] Fix to pass mpy-cross build --- py/mpz.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py/mpz.c b/py/mpz.c index 4ef00f73c9..41b46f92ff 100644 --- a/py/mpz.c +++ b/py/mpz.c @@ -445,7 +445,9 @@ STATIC size_t mpn_mul(mpz_dig_t *idig, mpz_dig_t *jdig, size_t jlen, mpz_dig_t * ilen = id - oidig; // check to prevent usb starvation + #ifdef RUN_BACKGROUND_TASKS RUN_BACKGROUND_TASKS; + #endif } return ilen; From 818b96ae615b074f77d5069337c790aa1dea8e39 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 14 Jul 2020 16:33:36 -0400 Subject: [PATCH 0294/1293] Fix IRQ enum protections --- ports/stm/common-hal/pulseio/PulseIn.c | 2 +- ports/stm/peripherals/timers.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c index 8b93e52f20..478077eda7 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.c +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -133,7 +133,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu self->last_count = 0; self->last_overflow = 0; - if (HAL_TIM_Base_GetState(&tim_handle) == HAL_TIM_STATE_RESET) { + if (HAL_TIM_Base_GetState(&tim_handle) == HAL_TIM_STATE_RESET) { //TODO: there's no state yet // Find a suitable timer TIM_TypeDef * tim_instance = stm_peripherals_find_timer(); stm_peripherals_timer_reserve(tim_instance); diff --git a/ports/stm/peripherals/timers.c b/ports/stm/peripherals/timers.c index 1bcee36455..54b1fd18ab 100644 --- a/ports/stm/peripherals/timers.c +++ b/ports/stm/peripherals/timers.c @@ -67,7 +67,11 @@ static size_t irq_map[] = { NULL_IRQ, #endif #ifdef TIM6 - TIM6_DAC_IRQn, + #if !defined(DAC_BASE) || !defined(DAC1_BASE) + TIM6_IRQn, + #else + TIM6_DAC_IRQn, + #endif #else NULL_IRQ, #endif From b08b0264cce3fae379035da4d53b8e96174405aa Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 15 Jul 2020 09:46:13 -0400 Subject: [PATCH 0295/1293] back to working; check for extended advertising support --- devices/ble_hci/common-hal/_bleio/Adapter.c | 66 +++++++++------------ devices/ble_hci/common-hal/_bleio/Adapter.h | 1 + devices/ble_hci/common-hal/_bleio/hci_api.c | 30 +++++++++- devices/ble_hci/common-hal/_bleio/hci_api.h | 2 + shared-bindings/_bleio/Adapter.c | 6 +- 5 files changed, 62 insertions(+), 43 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index 7817ea4707..92eb42ee0f 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -68,26 +68,6 @@ #define BLE_SLAVE_LATENCY 0 #define BLE_CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS) -#ifndef BLEIO_VS_UUID_COUNT -#define BLEIO_VS_UUID_COUNT 75 -#endif - -#ifndef BLEIO_HVN_TX_QUEUE_SIZE -#define BLEIO_HVN_TX_QUEUE_SIZE 9 -#endif - -#ifndef BLEIO_CENTRAL_ROLE_COUNT -#define BLEIO_CENTRAL_ROLE_COUNT 4 -#endif - -#ifndef BLEIO_PERIPH_ROLE_COUNT -#define BLEIO_PERIPH_ROLE_COUNT 4 -#endif - -#ifndef BLEIO_ATTR_TAB_SIZE -#define BLEIO_ATTR_TAB_SIZE (BLE_GATTS_ATTR_TAB_SIZE_DEFAULT * 5) -#endif - bleio_connection_internal_t bleio_connections[BLEIO_TOTAL_CONNECTION_COUNT]; // STATIC bool adapter_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { @@ -193,6 +173,11 @@ STATIC void bleio_adapter_reset_name(bleio_adapter_obj_t *self) { // Get various values and limits set by the adapter. STATIC void bleio_adapter_get_info(bleio_adapter_obj_t *self) { + // Get supported features. + if (hci_le_read_local_supported_features(self->features) != HCI_OK) { + mp_raise_bleio_BluetoothError(translate("Could not read BLE features")); + } + // Get ACL buffer info. uint16_t le_max_len; uint8_t le_max_num; @@ -212,26 +197,28 @@ STATIC void bleio_adapter_get_info(bleio_adapter_obj_t *self) { self->max_acl_num_buffers = acl_max_num; } - // Get max advertising length. - uint16_t max_adv_data_len; - if (hci_le_read_maximum_advertising_data_length(&max_adv_data_len) != HCI_OK) { - mp_raise_bleio_BluetoothError(translate("Could not get max advertising length")); + // Get max advertising length if extended advertising is supported. + if (BT_FEAT_LE_EXT_ADV(self->features)) { + uint16_t max_adv_data_len; + if (hci_le_read_maximum_advertising_data_length(&max_adv_data_len) != HCI_OK) { + mp_raise_bleio_BluetoothError(translate("Could not get max advertising length")); + } + self->max_adv_data_len = max_adv_data_len; + } else { + self->max_adv_data_len = 31; } - self->max_adv_data_len = max_adv_data_len; } void common_hal_bleio_adapter_hci_uart_init(bleio_adapter_obj_t *self, busio_uart_obj_t *uart, digitalio_digitalinout_obj_t *rts, digitalio_digitalinout_obj_t *cts) { self->hci_uart = uart; self->rts_digitalinout = rts; self->cts_digitalinout = cts; + + // Advertising-related fields are initialized by common_hal_bleio_adapter_set_enabled(). self->enabled = false; - self->now_advertising = false; - self->circuitpython_advertising = false; - self->extended_advertising = false; - self->advertising_timeout_msecs = 0; + common_hal_bleio_adapter_set_enabled(self, true); bleio_adapter_get_info(self); - bleio_adapter_reset_name(self); } @@ -243,15 +230,14 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable return; } - //FIX enable/disable HCI adapter, but don't reset it, since we don't know how. self->enabled = enabled; - if (!enabled) { - // Stop any current activity. - check_hci_error(hci_reset()); - self->now_advertising = false; - self->extended_advertising = false; - self->circuitpython_advertising = false; - } + + // Stop any current activity; reset to known state. + check_hci_error(hci_reset()); + self->now_advertising = false; + self->extended_advertising = false; + self->circuitpython_advertising = false; + self->advertising_timeout_msecs = 0; } bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self) { @@ -506,6 +492,10 @@ uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, advertising_data_len > self->max_adv_data_len || scan_response_data_len > self->max_adv_data_len; if (extended) { + if (!BT_FEAT_LE_EXT_ADV(self->features)) { + mp_raise_bleio_BluetoothError(translate("Data length needs extended advertising, but this adapter does not support it")); + } + uint16_t props = 0; if (connectable) { props |= BT_HCI_LE_ADV_PROP_CONN; diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.h b/devices/ble_hci/common-hal/_bleio/Adapter.h index 8e34f86631..10a398b24f 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.h +++ b/devices/ble_hci/common-hal/_bleio/Adapter.h @@ -65,6 +65,7 @@ typedef struct _bleio_adapter_obj_t { uint16_t max_acl_buffer_len; uint16_t max_acl_num_buffers; uint16_t max_adv_data_len; + uint8_t features[8]; // Supported BLE features. } bleio_adapter_obj_t; diff --git a/devices/ble_hci/common-hal/_bleio/hci_api.c b/devices/ble_hci/common-hal/_bleio/hci_api.c index 4901ffeedb..ece06f169f 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_api.c +++ b/devices/ble_hci/common-hal/_bleio/hci_api.c @@ -628,9 +628,19 @@ hci_result_t hci_le_read_maximum_advertising_data_length(uint16_t *max_adv_data_ if (result == HCI_OK) { struct bt_hci_rp_le_read_max_adv_data_len *response = (struct bt_hci_rp_le_read_max_adv_data_len *) cmd_response_data; - if (response->status == BT_HCI_ERR_SUCCESS) { - *max_adv_data_len = response->max_adv_data_len; - } + *max_adv_data_len = response->max_adv_data_len; + } + + return result; +} + +hci_result_t hci_le_read_local_supported_features(uint8_t features[8]) { + int result = send_command(BT_HCI_OP_LE_READ_LOCAL_FEATURES, 0, NULL); + if (result == HCI_OK) { + struct bt_hci_rp_le_read_local_features *response = + (struct bt_hci_rp_le_read_local_features *) cmd_response_data; + memcpy(features, response->features, + sizeof_field(struct bt_hci_rp_le_read_local_features, features)); } return result; @@ -649,6 +659,20 @@ hci_result_t hci_le_set_advertising_data(uint8_t len, uint8_t data[]) { return send_command(BT_HCI_OP_LE_SET_ADV_DATA, sizeof(params), ¶ms); } +hci_result_t hci_le_set_extended_advertising_data(uint8_t handle, uint8_t op, uint8_t frag_pref, uint8_t len, uint8_t data[]) { + const uint8_t max_len = sizeof_field(struct bt_hci_cp_le_set_ext_adv_data, data); + uint8_t valid_len = MIN(len, max_len); + struct bt_hci_cp_le_set_ext_adv_data params = { + .handle = handle, + .op = op, + .frag_pref = frag_pref, + .len = valid_len, + }; + memcpy(params.data, data, valid_len); + return send_command(BT_HCI_OP_LE_SET_EXT_ADV_DATA, sizeof(params) - (max_len - valid_len), ¶ms); +} + + hci_result_t hci_le_set_scan_response_data(uint8_t len, uint8_t data[]) { struct bt_hci_cp_le_set_scan_rsp_data params = { // Zero out unused data bytes. diff --git a/devices/ble_hci/common-hal/_bleio/hci_api.h b/devices/ble_hci/common-hal/_bleio/hci_api.h index 23e45375cc..3e53a37752 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_api.h +++ b/devices/ble_hci/common-hal/_bleio/hci_api.h @@ -47,11 +47,13 @@ hci_result_t hci_le_create_conn(uint16_t scan_interval, uint16_t scan_window, ui hci_result_t hci_le_read_buffer_size(uint16_t *le_max_len, uint8_t *le_max_num); hci_result_t hci_le_read_maximum_advertising_data_length(uint16_t *max_adv_data_len); +hci_result_t hci_le_read_local_supported_features(uint8_t features[8]); hci_result_t hci_le_set_advertising_data(uint8_t length, uint8_t data[]); hci_result_t hci_le_set_advertising_enable(uint8_t enable); hci_result_t hci_le_set_advertising_parameters(uint16_t min_interval, uint16_t max_interval, uint8_t type, uint8_t own_addr_type, bt_addr_le_t *direct_addr, uint8_t channel_map, uint8_t filter_policy); +hci_result_t hci_le_set_extended_advertising_data(uint8_t handle, uint8_t op, uint8_t frag_pref, uint8_t len, uint8_t data[]); hci_result_t hci_le_set_extended_advertising_enable(uint8_t enable, uint8_t set_num, uint8_t handle[], uint16_t duration[], uint8_t max_ext_adv_evts[]); hci_result_t hci_le_set_extended_advertising_parameters(uint8_t handle, uint16_t props, uint32_t prim_min_interval, uint32_t prim_max_interval, uint8_t prim_channel_map, uint8_t own_addr_type, bt_addr_le_t *peer_addr, uint8_t filter_policy, int8_t tx_power, uint8_t prim_adv_phy, uint8_t sec_adv_max_skip, uint8_t sec_adv_phy, uint8_t sid, uint8_t scan_req_notify_enable); diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 8673044165..61999282c8 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -83,6 +83,8 @@ STATIC void check_enabled(bleio_adapter_obj_t *self) { //| The `uart`, `rts`, and `cts` objects are used to //| communicate with the HCI co-processor in HCI mode. //| +//| The `_bleio.adapter` object is enabled during this call. +//| mp_obj_t bleio_adapter_hci_uart_init(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { #if CIRCUITPY_BLEIO_HCI bleio_adapter_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); @@ -108,9 +110,9 @@ mp_obj_t bleio_adapter_hci_uart_init(mp_uint_t n_args, const mp_obj_t *pos_args, !MP_OBJ_IS_TYPE(cts, &digitalio_digitalinout_type)) { mp_raise_ValueError(translate("Expected a DigitalInOut")); } - check_enabled(self); + + // Will enable the adapter. common_hal_bleio_adapter_hci_uart_init(self, uart, rts, cts); - common_hal_bleio_adapter_set_enabled(self, true); return mp_const_none; #else From 51b9a1aeca51c34e0894a08f88888eb4173af32a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 13 Jul 2020 10:32:52 -0500 Subject: [PATCH 0296/1293] tick.c: adjust whitespace --- supervisor/shared/tick.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index dd7dba8f3e..01a554e156 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -104,13 +104,13 @@ void mp_hal_delay_ms(mp_uint_t delay) { // Check to see if we've been CTRL-Ced by autoreload or the user. if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) { - // clear exception and generate stacktrace + // clear exception and generate stacktrace MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; nlr_raise(&MP_STATE_VM(mp_kbd_exception)); } if( MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || WATCHDOG_EXCEPTION_CHECK()) { - // stop sleeping immediately + // stop sleeping immediately break; } remaining = end_tick - port_get_raw_ticks(NULL); From dc74ae83da6f519a36d75388b5be9923a10bf063 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 14 Jul 2020 17:34:45 -0500 Subject: [PATCH 0297/1293] nRF: Always use sd_nvic_critical_region calls The motivation for doing this is so that we can allow common_hal_mcu_disable_interrupts in IRQ context, something that works on other ports, but not on nRF with SD enabled. This is because when SD is enabled, calling sd_softdevice_is_enabled in the context of an interrupt with priority 2 or 3 causes a HardFault. We have chosen to give the USB interrupt priority 2 on nRF, the highest priority that is compatible with SD. Since at least SoftDevice s130 v2.0.1, sd_nvic_critical_region_enter/exit have been implemented as inline functions and are safe to call even if softdevice is not enabled. Reference kindly provided by danh: https://devzone.nordicsemi.com/f/nordic-q-a/29553/sd_nvic_critical_region_enter-exit-missing-in-s130-v2 Switching to these as the default/only way to enable/disable interrupts simplifies things, and fixes several problems and potential problems: * Interrupts at priority 2 or 3 could not call common_hal_mcu_disable_interrupts because the call to sd_softdevice_is_enabled would HardFault * Hypothetically, the state of sd_softdevice_is_enabled could change from the disable to the enable call, meaning the calls would not match (__disable_irq() could be balanced with sd_nvic_critical_region_exit). This also fixes a problem I believe would exist if disable() were called twice when SD is enabled. There is a single "is_nested_critical_region" flag, and the second call would set it to 1. Both of the enable() calls that followed would call critical_region_exit(1), and interrupts would not properly be reenabled. In the new version of the code, we use our own nesting_count value to track the intended state, so now nested disable()s only call critical_region_enter() once, only updating is_nested_critical_region once; and only the second enable() call will call critical_region_exit, with the right value of i_n_c_r. Finally, in port_sleep_until_interrupt, if !sd_enabled, we really do need to __disable_irq, rather than using the common_hal_mcu routines; the reason why is documented in a comment. --- .../nrf/common-hal/microcontroller/__init__.c | 44 +++++++++---------- ports/nrf/supervisor/port.c | 13 +++++- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index f5caf68ef8..06aac9409d 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -50,36 +50,34 @@ void common_hal_mcu_delay_us(uint32_t delay) { static volatile uint32_t nesting_count = 0; static uint8_t is_nested_critical_region; -static uint8_t sd_is_enabled = false; void common_hal_mcu_disable_interrupts() { - sd_softdevice_is_enabled(&sd_is_enabled); - if (sd_is_enabled) { + if (nesting_count == 0) { + // Unlike __disable_irq(), this should only be called the first time + // "is_nested_critical_region" is sd's equivalent of our nesting count + // so a nested call would store 0 in the global and make the later + // exit call not actually reenable interrupts + // + // This only disables interrupts of priority 2 through 7; levels 0, 1, + // and 4, are exclusive to softdevice and should never be used, so + // this limitation is not important. sd_nvic_critical_region_enter(&is_nested_critical_region); - } else { - __disable_irq(); - __DMB(); - nesting_count++; } + __DMB(); + nesting_count++; } void common_hal_mcu_enable_interrupts() { - // Don't check here if SD is enabled, because we'll crash if interrupts - // were turned off and sd_softdevice_is_enabled is called. - if (sd_is_enabled) { - sd_nvic_critical_region_exit(is_nested_critical_region); - } else { - if (nesting_count == 0) { - // This is very very bad because it means there was mismatched disable/enables so we - // crash. - reset_into_safe_mode(HARD_CRASH); - } - nesting_count--; - if (nesting_count > 0) { - return; - } - __DMB(); - __enable_irq(); + if (nesting_count == 0) { + // This is very very bad because it means there was mismatched disable/enables so we + // crash. + reset_into_safe_mode(HARD_CRASH); } + nesting_count--; + if (nesting_count > 0) { + return; + } + __DMB(); + sd_nvic_critical_region_exit(is_nested_critical_region); } void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index aee2d63e1d..e681e6825f 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -313,12 +313,21 @@ void port_sleep_until_interrupt(void) { // instruction will returned as long as an interrupt is // available, even though the actual handler won't fire until // we re-enable interrupts. - common_hal_mcu_disable_interrupts(); + // + // We do not use common_hal_mcu_disable_interrupts here because + // we truly require that interrupts be disabled, while + // common_hal_mcu_disable_interrupts actually just masks the + // interrupts that are not required to allow the softdevice to + // function (whether or not SD is enabled) + int nested = __get_PRIMASK(); + __disable_irq(); if (!tud_task_event_ready()) { __DSB(); __WFI(); } - common_hal_mcu_enable_interrupts(); + if (!nested) { + __enable_irq(); + } } } From 1474fccd2fb1cf6ccd14979a3b5405d2a355054b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 11 May 2020 08:37:20 -0500 Subject: [PATCH 0298/1293] supervisor: Add a linked list of background callbacks In time, we should transition interrupt driven background tasks out of the overall run_background_tasks into distinct background callbacks, so that the number of checks that occur with each tick is reduced. --- main.c | 3 + supervisor/background_callback.h | 82 +++++++++++++++++++ supervisor/shared/background_callback.c | 104 ++++++++++++++++++++++++ supervisor/shared/tick.c | 6 +- supervisor/supervisor.mk | 1 + 5 files changed, 192 insertions(+), 4 deletions(-) create mode 100644 supervisor/background_callback.h create mode 100644 supervisor/shared/background_callback.c diff --git a/main.c b/main.c index c3787122d3..201022f1af 100755 --- a/main.c +++ b/main.c @@ -45,6 +45,7 @@ #include "background.h" #include "mpconfigboard.h" +#include "supervisor/background_callback.h" #include "supervisor/cpu.h" #include "supervisor/memory.h" #include "supervisor/port.h" @@ -161,6 +162,8 @@ void stop_mp(void) { MP_STATE_VM(vfs_cur) = vfs; #endif + background_callback_reset(); + gc_deinit(); } diff --git a/supervisor/background_callback.h b/supervisor/background_callback.h new file mode 100644 index 0000000000..82025f6b7a --- /dev/null +++ b/supervisor/background_callback.h @@ -0,0 +1,82 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 CIRCUITPY_INCLUDED_SUPERVISOR_BACKGROUND_CALLBACK_H +#define CIRCUITPY_INCLUDED_SUPERVISOR_BACKGROUND_CALLBACK_H + +/** Background callbacks are a linked list of tasks to call in the background. + * + * Include a member of type `background_callback_t` inside an object + * which needs to queue up background work, and zero-initialize it. + * + * To schedule the work, use background_callback_add, with fun as the + * function to call and data pointing to the object itself. + * + * Next time run_background_tasks_if_tick is called, the callback will + * be run and removed from the linked list. + * + * Queueing a task that is already queued does nothing. Unconditionally + * re-queueing it from its own background task will cause it to run during the + * very next background-tasks invocation, leading to a CircuitPython freeze, so + * don't do that. + * + * background_callback_add can be called from interrupt context. + */ +typedef void (*background_callback_fun)(void *data); +typedef struct background_callback { + background_callback_fun fun; + void *data; + struct background_callback *next; + struct background_callback *prev; +} background_callback_t; + +/* Add a background callback for which 'fun' and 'data' were previously set */ +void background_callback_add_core(background_callback_t *cb); + +/* Add a background callback to the given function with the given data. When + * the callback involves an object on the GC heap, the 'data' must be a pointer + * to that object itself, not an internal pointer. Otherwise, it can be the + * case that no other references to the object itself survive, and the object + * becomes garbage collected while an outstanding background callback still + * exists. + */ +void background_callback_add(background_callback_t *cb, background_callback_fun fun, void *data); + +/* Run all background callbacks. Normally, this is done by the supervisor + * whenever the list is non-empty */ +void background_callback_run_all(void); + +/* During soft reset, remove all pending callbacks and clear the critical section flag */ +void background_callback_reset(void); + +/* Sometimes background callbacks must be blocked. Use these functions to + * bracket the section of code where this is the case. These calls nest, and + * begins must be balanced with ends. + */ +void background_callback_begin_critical_section(void); +void background_callback_end_critical_section(void); + +#endif diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c new file mode 100644 index 0000000000..99607b7a85 --- /dev/null +++ b/supervisor/shared/background_callback.c @@ -0,0 +1,104 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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/mpconfig.h" +#include "supervisor/background_callback.h" +#include "supervisor/shared/tick.h" +#include "shared-bindings/microcontroller/__init__.h" + +STATIC volatile background_callback_t *callback_head, *callback_tail; + +#define CALLBACK_CRITICAL_BEGIN (common_hal_mcu_disable_interrupts()) +#define CALLBACK_CRITICAL_END (common_hal_mcu_enable_interrupts()) + +void background_callback_add_core(background_callback_t *cb) { + CALLBACK_CRITICAL_BEGIN; + if (cb->prev || callback_head == cb) { + CALLBACK_CRITICAL_END; + return; + } + cb->next = 0; + cb->prev = (background_callback_t*)callback_tail; + if (callback_tail) { + callback_tail->next = cb; + cb->prev = (background_callback_t*)callback_tail; + } + if (!callback_head) { + callback_head = cb; + } + callback_tail = cb; + CALLBACK_CRITICAL_END; +} + +void background_callback_add(background_callback_t *cb, background_callback_fun fun, void *data) { + cb->fun = fun; + cb->data = data; + background_callback_add_core(cb); +} + +static bool in_background_callback; +void background_callback_run_all() { + CALLBACK_CRITICAL_BEGIN; + if(in_background_callback) { + CALLBACK_CRITICAL_END; + return; + } + in_background_callback = true; + background_callback_t *cb = (background_callback_t*)callback_head; + callback_head = NULL; + callback_tail = NULL; + while (cb) { + background_callback_t *next = cb->next; + cb->next = cb->prev = NULL; + background_callback_fun fun = cb->fun; + void *data = cb->data; + CALLBACK_CRITICAL_END; + // Leave the critical section in order to run the callback function + if (fun) { + fun(data); + } + CALLBACK_CRITICAL_BEGIN; + cb = next; + } + in_background_callback = false; + CALLBACK_CRITICAL_END; +} + +void background_callback_begin_critical_section() { + CALLBACK_CRITICAL_BEGIN; +} + +void background_callback_end_critical_section() { + CALLBACK_CRITICAL_END; +} + +void background_callback_reset() { + CALLBACK_CRITICAL_BEGIN; + callback_head = NULL; + callback_tail = NULL; + in_background_callback = false; + CALLBACK_CRITICAL_END; +} diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 01a554e156..7a2f313eb8 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -29,6 +29,7 @@ #include "py/mpstate.h" #include "supervisor/linker.h" #include "supervisor/filesystem.h" +#include "supervisor/background_callback.h" #include "supervisor/port.h" #include "supervisor/shared/autoreload.h" @@ -86,10 +87,7 @@ uint32_t supervisor_ticks_ms32() { extern void run_background_tasks(void); void PLACE_IN_ITCM(supervisor_run_background_tasks_if_tick)() { - // TODO: Add a global that can be set by anyone to indicate we should run background tasks. That - // way we can short circuit the background tasks early. We used to do it based on time but it - // breaks cases where we wake up for a short period and then sleep. If we skipped the last - // background task or more before sleeping we may end up starving a task like USB. + background_callback_run_all(); run_background_tasks(); } diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 21803ae0a3..1885366865 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -2,6 +2,7 @@ SRC_SUPERVISOR = \ main.c \ supervisor/port.c \ supervisor/shared/autoreload.c \ + supervisor/shared/background_callback.c \ supervisor/shared/board.c \ supervisor/shared/filesystem.c \ supervisor/shared/flash.c \ From 8c4a9f644407ee6fccf3720fd3b727085a2ff109 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 9 Jul 2020 09:47:10 -0500 Subject: [PATCH 0299/1293] supervisor: tick: only run background tasks once per tick --- supervisor/shared/tick.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 7a2f313eb8..46172d0f30 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -52,6 +52,14 @@ static volatile uint64_t PLACE_IN_DTCM_BSS(background_ticks); #define WATCHDOG_EXCEPTION_CHECK() 0 #endif +static background_callback_t callback; + +extern void run_background_tasks(void); + +void background_task_tick(void *unused) { + run_background_tasks(); +} + void supervisor_tick(void) { #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); @@ -69,6 +77,7 @@ void supervisor_tick(void) { #endif } #endif + background_callback_add(&callback, background_task_tick, NULL); } uint64_t supervisor_ticks_ms64() { @@ -84,11 +93,9 @@ uint32_t supervisor_ticks_ms32() { return supervisor_ticks_ms64(); } -extern void run_background_tasks(void); void PLACE_IN_ITCM(supervisor_run_background_tasks_if_tick)() { background_callback_run_all(); - run_background_tasks(); } void mp_hal_delay_ms(mp_uint_t delay) { From 742aa740f651c72a5991250d9ac898492e99389d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 7 Jul 2020 10:11:29 -0500 Subject: [PATCH 0300/1293] samd: audio: Move to background callback Testing performed: Played half of the Bartlebeats album :) :) --- ports/atmel-samd/audio_dma.c | 54 +++++++++++++++++++++++------------ ports/atmel-samd/audio_dma.h | 2 ++ ports/atmel-samd/background.c | 3 -- 3 files changed, 37 insertions(+), 22 deletions(-) diff --git a/ports/atmel-samd/audio_dma.c b/ports/atmel-samd/audio_dma.c index 93cd96b985..c6c636160d 100644 --- a/ports/atmel-samd/audio_dma.c +++ b/ports/atmel-samd/audio_dma.c @@ -31,7 +31,7 @@ #include "shared-bindings/audiocore/RawSample.h" #include "shared-bindings/audiocore/WaveFile.h" -#include "supervisor/shared/tick.h" +#include "supervisor/background_callback.h" #include "py/mpstate.h" #include "py/runtime.h" @@ -61,7 +61,6 @@ void audio_dma_free_channel(uint8_t channel) { assert(audio_dma_allocated[channel]); audio_dma_disable_channel(channel); audio_dma_allocated[channel] = false; - supervisor_disable_tick(); } void audio_dma_disable_channel(uint8_t channel) { @@ -73,7 +72,6 @@ void audio_dma_disable_channel(uint8_t channel) { void audio_dma_enable_channel(uint8_t channel) { if (channel >= AUDIO_DMA_CHANNEL_COUNT) return; - supervisor_enable_tick(); dma_enable_channel(channel); } @@ -259,6 +257,15 @@ audio_dma_result audio_dma_setup_playback(audio_dma_t* dma, dma->beat_size *= 2; } +#ifdef SAM_D5X_E5X + int irq = dma->event_channel < 4 ? EVSYS_0_IRQn + dma->event_channel : EVSYS_4_IRQn; +#else + int irq = EVSYS_IRQn; +#endif + + NVIC_DisableIRQ(irq); + NVIC_ClearPendingIRQ(irq); + DmacDescriptor* first_descriptor = dma_descriptor(dma_channel); setup_audio_descriptor(first_descriptor, dma->beat_size, output_spacing, output_register_address); if (single_buffer) { @@ -281,6 +288,8 @@ audio_dma_result audio_dma_setup_playback(audio_dma_t* dma, dma_configure(dma_channel, dma_trigger_source, true); audio_dma_enable_channel(dma_channel); + NVIC_EnableIRQ(irq); + return AUDIO_DMA_OK; } @@ -321,9 +330,6 @@ void audio_dma_reset(void) { for (uint8_t i = 0; i < AUDIO_DMA_CHANNEL_COUNT; i++) { audio_dma_state[i] = NULL; audio_dma_pending[i] = false; - if (audio_dma_allocated[i]) { - supervisor_disable_tick(); - } audio_dma_allocated[i] = false; audio_dma_disable_channel(i); dma_descriptor(i)->BTCTRL.bit.VALID = false; @@ -343,29 +349,39 @@ bool audio_dma_get_playing(audio_dma_t* dma) { return (status & DMAC_CHINTFLAG_TERR) == 0; } -// WARN(tannewt): DO NOT print from here. Printing calls background tasks such as this and causes a -// stack overflow. +// WARN(tannewt): DO NOT print from here, or anything it calls. Printing calls +// background tasks such as this and causes a stack overflow. +STATIC void dma_callback_fun(void *arg) { + audio_dma_t* dma = arg; + if (dma == NULL) { + return; + } -void audio_dma_background(void) { + audio_dma_load_next_block(dma); +} + +void evsyshandler_common(void) { for (uint8_t i = 0; i < AUDIO_DMA_CHANNEL_COUNT; i++) { - if (audio_dma_pending[i]) { - continue; - } audio_dma_t* dma = audio_dma_state[i]; if (dma == NULL) { continue; } - bool block_done = event_interrupt_active(dma->event_channel); if (!block_done) { continue; } - - // audio_dma_load_next_block() can call Python code, which can call audio_dma_background() - // recursively at the next background processing time. So disallow recursive calls to here. - audio_dma_pending[i] = true; - audio_dma_load_next_block(dma); - audio_dma_pending[i] = false; + background_callback_add(&dma->callback, dma_callback_fun, (void*)dma); } } + +#ifdef SAM_D5X_E5X +void EVSYS_0_Handler(void) { evsyshandler_common(); } +void EVSYS_1_Handler(void) { evsyshandler_common(); } +void EVSYS_2_Handler(void) { evsyshandler_common(); } +void EVSYS_3_Handler(void) { evsyshandler_common(); } +void EVSYS_4_Handler(void) { evsyshandler_common(); } +#else +void EVSYS_Handler(void) { evsyshandler_common(); } +#endif + #endif diff --git a/ports/atmel-samd/audio_dma.h b/ports/atmel-samd/audio_dma.h index 1ebec6f7e9..4fffd06b8f 100644 --- a/ports/atmel-samd/audio_dma.h +++ b/ports/atmel-samd/audio_dma.h @@ -31,6 +31,7 @@ #include "py/obj.h" #include "shared-module/audiocore/RawSample.h" #include "shared-module/audiocore/WaveFile.h" +#include "supervisor/background_callback.h" typedef struct { mp_obj_t sample; @@ -49,6 +50,7 @@ typedef struct { uint8_t* second_buffer; bool first_descriptor_free; DmacDescriptor* second_descriptor; + background_callback_t callback; } audio_dma_t; typedef enum { diff --git a/ports/atmel-samd/background.c b/ports/atmel-samd/background.c index 767c7f3b6b..b903456ee8 100644 --- a/ports/atmel-samd/background.c +++ b/ports/atmel-samd/background.c @@ -77,9 +77,6 @@ void run_background_tasks(void) { assert_heap_ok(); running_background_tasks = true; - #if CIRCUITPY_AUDIOIO || CIRCUITPY_AUDIOBUSIO - audio_dma_background(); - #endif #if CIRCUITPY_DISPLAYIO displayio_background(); #endif From bdab6c12d4332523fdbd8967c1233b3708f4883e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 11 May 2020 08:51:41 -0500 Subject: [PATCH 0301/1293] MP3Decoder: take advantage of background callback Before this, the mp3 file would be read into the in-memory buffer only when new samples were actually needed. This meant that the time to read mp3 content always counted against the ~22ms audio buffer length. Now, when there's at least 1 full disk block of free space in the input buffer, we can request that the buffer be filled _after_ returning from audiomp3_mp3file_get_buffer and actually filling the DMA pointers. In this way, the time taken for reading MP3 data from flash/SD is less likely to cause an underrun of audio DMA. The existing calls to fill the inbuf remain, but in most cases during streaming these become no-ops because the buffer will be over half full. --- shared-module/audiomp3/MP3Decoder.c | 54 +++++++++++++++++++++++------ shared-module/audiomp3/MP3Decoder.h | 2 ++ 2 files changed, 45 insertions(+), 11 deletions(-) diff --git a/shared-module/audiomp3/MP3Decoder.c b/shared-module/audiomp3/MP3Decoder.c index 30357c6161..5f3f42a51b 100644 --- a/shared-module/audiomp3/MP3Decoder.c +++ b/shared-module/audiomp3/MP3Decoder.c @@ -36,11 +36,12 @@ #include "shared-module/audiomp3/MP3Decoder.h" #include "supervisor/shared/translate.h" +#include "supervisor/background_callback.h" #include "lib/mp3/src/mp3common.h" #define MAX_BUFFER_LEN (MAX_NSAMP * MAX_NGRAN * MAX_NCHAN * sizeof(int16_t)) -/** Fill the input buffer if it is less than half full. +/** Fill the input buffer unconditionally. * * Returns true if the input buffer contains any useful data, * false otherwise. (The input buffer will be padded to the end with @@ -50,10 +51,7 @@ * * Sets self->eof if any read of the file returns 0 bytes */ -STATIC bool mp3file_update_inbuf(audiomp3_mp3file_obj_t* self) { - // If buffer is over half full, do nothing - if (self->inbuf_offset < self->inbuf_length/2) return true; - +STATIC bool mp3file_update_inbuf_always(audiomp3_mp3file_obj_t* self) { // If we didn't previously reach the end of file, we can try reading now if (!self->eof) { @@ -87,6 +85,26 @@ STATIC bool mp3file_update_inbuf(audiomp3_mp3file_obj_t* self) { return self->inbuf_offset < self->inbuf_length; } +/** Update the inbuf from a background callback. + * + * This variant is introduced so that at the site of the + * add_background_callback_core call, the prototype matches. + */ +STATIC void mp3file_update_inbuf_cb(void* self) { + mp3file_update_inbuf_always(self); +} + +/** Fill the input buffer if it is less than half full. + * + * Returns the same as mp3file_update_inbuf_always. + */ +STATIC bool mp3file_update_inbuf_half(audiomp3_mp3file_obj_t* self) { + // If buffer is over half full, do nothing + if (self->inbuf_offset < self->inbuf_length/2) return true; + + return mp3file_update_inbuf_always(self); +} + #define READ_PTR(self) (self->inbuf + self->inbuf_offset) #define BYTES_LEFT(self) (self->inbuf_length - self->inbuf_offset) #define CONSUME(self, n) (self->inbuf_offset += n) @@ -94,7 +112,7 @@ STATIC bool mp3file_update_inbuf(audiomp3_mp3file_obj_t* self) { // http://id3.org/d3v2.3.0 // http://id3.org/id3v2.3.0 STATIC void mp3file_skip_id3v2(audiomp3_mp3file_obj_t* self) { - mp3file_update_inbuf(self); + mp3file_update_inbuf_half(self); if (BYTES_LEFT(self) < 10) { return; } @@ -129,11 +147,11 @@ STATIC void mp3file_skip_id3v2(audiomp3_mp3file_obj_t* self) { */ STATIC bool mp3file_find_sync_word(audiomp3_mp3file_obj_t* self) { do { - mp3file_update_inbuf(self); + mp3file_update_inbuf_half(self); int offset = MP3FindSyncWord(READ_PTR(self), BYTES_LEFT(self)); if (offset >= 0) { CONSUME(self, offset); - mp3file_update_inbuf(self); + mp3file_update_inbuf_half(self); return true; } CONSUME(self, MAX(0, BYTES_LEFT(self) - 16)); @@ -209,12 +227,14 @@ void common_hal_audiomp3_mp3file_construct(audiomp3_mp3file_obj_t* self, } void common_hal_audiomp3_mp3file_set_file(audiomp3_mp3file_obj_t* self, pyb_file_obj_t* file) { + background_callback_begin_critical_section(); + self->file = file; f_lseek(&self->file->fp, 0); self->inbuf_offset = self->inbuf_length; self->eof = 0; self->other_channel = -1; - mp3file_update_inbuf(self); + mp3file_update_inbuf_half(self); mp3file_find_sync_word(self); // It **SHOULD** not be necessary to do this; the buffer should be filled // with fresh content before it is returned by get_buffer(). The fact that @@ -224,7 +244,9 @@ void common_hal_audiomp3_mp3file_set_file(audiomp3_mp3file_obj_t* self, pyb_file memset(self->buffers[0], 0, MAX_BUFFER_LEN); memset(self->buffers[1], 0, MAX_BUFFER_LEN); MP3FrameInfo fi; - if(!mp3file_get_next_frame_info(self, &fi)) { + bool result = mp3file_get_next_frame_info(self, &fi); + background_callback_end_critical_section(); + if (!result) { mp_raise_msg(&mp_type_RuntimeError, translate("Failed to parse MP3 file")); } @@ -277,13 +299,15 @@ void audiomp3_mp3file_reset_buffer(audiomp3_mp3file_obj_t* self, } // We don't reset the buffer index in case we're looping and we have an odd number of buffer // loads + background_callback_begin_critical_section(); f_lseek(&self->file->fp, 0); self->inbuf_offset = self->inbuf_length; self->eof = 0; self->other_channel = -1; - mp3file_update_inbuf(self); + mp3file_update_inbuf_half(self); mp3file_skip_id3v2(self); mp3file_find_sync_word(self); + background_callback_end_critical_section(); } audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t* self, @@ -321,6 +345,14 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t* uint8_t *inbuf = READ_PTR(self); int err = MP3Decode(self->decoder, &inbuf, &bytes_left, buffer, 0); CONSUME(self, BYTES_LEFT(self) - bytes_left); + + if (self->inbuf_offset >= 512) { + background_callback_add( + &self->inbuf_fill_cb, + mp3file_update_inbuf_cb, + self); + } + if (err) { return GET_BUFFER_DONE; } diff --git a/shared-module/audiomp3/MP3Decoder.h b/shared-module/audiomp3/MP3Decoder.h index 9ee1d0949b..f91f102a27 100644 --- a/shared-module/audiomp3/MP3Decoder.h +++ b/shared-module/audiomp3/MP3Decoder.h @@ -28,6 +28,7 @@ #ifndef MICROPY_INCLUDED_SHARED_MODULE_AUDIOIO_MP3FILE_H #define MICROPY_INCLUDED_SHARED_MODULE_AUDIOIO_MP3FILE_H +#include "supervisor/background_callback.h" #include "extmod/vfs_fat.h" #include "py/obj.h" @@ -36,6 +37,7 @@ typedef struct { mp_obj_base_t base; struct _MP3DecInfo *decoder; + background_callback_t inbuf_fill_cb; uint8_t* inbuf; uint32_t inbuf_length; uint32_t inbuf_offset; From af520729fe9d941c293942730f520b50ec1daf52 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 8 Jul 2020 10:32:06 -0500 Subject: [PATCH 0302/1293] displayio, framebufferio: Enable supervisor tick when a display is auto-refresh This is a step towards restoring the efficiency of the background tasks --- shared-module/displayio/Display.c | 12 ++++++++++-- shared-module/displayio/EPaperDisplay.c | 4 ++++ shared-module/framebufferio/FramebufferDisplay.c | 12 ++++++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index a3d877f1a9..46bb6fdb57 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -137,7 +137,7 @@ 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_show(self, &circuitpython_splash); - self->auto_refresh = auto_refresh; + common_hal_displayio_display_set_auto_refresh(self, auto_refresh); } bool common_hal_displayio_display_show(displayio_display_obj_t* self, displayio_group_t* root_group) { @@ -383,6 +383,13 @@ bool common_hal_displayio_display_get_auto_refresh(displayio_display_obj_t* self void common_hal_displayio_display_set_auto_refresh(displayio_display_obj_t* self, bool auto_refresh) { self->first_manual_refresh = !auto_refresh; + if (auto_refresh != self->auto_refresh) { + if (auto_refresh) { + supervisor_enable_tick(); + } else { + supervisor_disable_tick(); + } + } self->auto_refresh = auto_refresh; } @@ -409,6 +416,7 @@ void displayio_display_background(displayio_display_obj_t* self) { } void release_display(displayio_display_obj_t* self) { + common_hal_displayio_display_set_auto_refresh(self, false); release_display_core(&self->core); #if (CIRCUITPY_PULSEIO) if (self->backlight_pwm.base.type == &pulseio_pwmout_type) { @@ -423,7 +431,7 @@ void release_display(displayio_display_obj_t* self) { } void reset_display(displayio_display_obj_t* self) { - self->auto_refresh = true; + common_hal_displayio_display_set_auto_refresh(self, true); self->auto_brightness = true; common_hal_displayio_display_show(self, NULL); } diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 6a55687b9c..6d9e915b44 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -187,6 +187,7 @@ void displayio_epaperdisplay_finish_refresh(displayio_epaperdisplay_obj_t* self) displayio_display_core_begin_transaction(&self->core); self->core.send(self->core.bus, DISPLAY_COMMAND, self->chip_select, &self->refresh_display_command, 1); displayio_display_core_end_transaction(&self->core); + supervisor_enable_tick(); self->refreshing = true; displayio_display_core_finish_refresh(&self->core); @@ -301,6 +302,7 @@ bool common_hal_displayio_epaperdisplay_refresh(displayio_epaperdisplay_obj_t* s if (self->refreshing && self->busy.base.type == &digitalio_digitalinout_type) { if (common_hal_digitalio_digitalinout_get_value(&self->busy) != self->busy_state) { + supervisor_disable_tick(); self->refreshing = false; // Run stop sequence but don't wait for busy because busy is set when sleeping. send_command_sequence(self, false, self->stop_sequence, self->stop_sequence_len); @@ -342,6 +344,7 @@ void displayio_epaperdisplay_background(displayio_epaperdisplay_obj_t* self) { refresh_done = supervisor_ticks_ms64() - self->core.last_refresh > self->refresh_time; } if (refresh_done) { + supervisor_disable_tick(); self->refreshing = false; // Run stop sequence but don't wait for busy because busy is set when sleeping. send_command_sequence(self, false, self->stop_sequence, self->stop_sequence_len); @@ -352,6 +355,7 @@ void displayio_epaperdisplay_background(displayio_epaperdisplay_obj_t* self) { void release_epaperdisplay(displayio_epaperdisplay_obj_t* self) { if (self->refreshing) { wait_for_busy(self); + supervisor_disable_tick(); self->refreshing = false; // Run stop sequence but don't wait for busy because busy is set when sleeping. send_command_sequence(self, false, self->stop_sequence, self->stop_sequence_len); diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index f296da4095..7d09e0baeb 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -79,7 +79,7 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu // Set the group after initialization otherwise we may send pixels while we delay in // initialization. common_hal_framebufferio_framebufferdisplay_show(self, &circuitpython_splash); - self->auto_refresh = auto_refresh; + common_hal_framebufferio_framebufferdisplay_set_auto_refresh(self, auto_refresh); } bool common_hal_framebufferio_framebufferdisplay_show(framebufferio_framebufferdisplay_obj_t* self, displayio_group_t* root_group) { @@ -280,6 +280,13 @@ bool common_hal_framebufferio_framebufferdisplay_get_auto_refresh(framebufferio_ void common_hal_framebufferio_framebufferdisplay_set_auto_refresh(framebufferio_framebufferdisplay_obj_t* self, bool auto_refresh) { self->first_manual_refresh = !auto_refresh; + if (auto_refresh != self->auto_refresh) { + if (auto_refresh) { + supervisor_enable_tick(); + } else { + supervisor_disable_tick(); + } + } self->auto_refresh = auto_refresh; } @@ -297,12 +304,13 @@ void framebufferio_framebufferdisplay_background(framebufferio_framebufferdispla } void release_framebufferdisplay(framebufferio_framebufferdisplay_obj_t* self) { + common_hal_framebufferio_framebufferdisplay_set_auto_refresh(self, false); release_display_core(&self->core); self->framebuffer_protocol->deinit(self->framebuffer); } void reset_framebufferdisplay(framebufferio_framebufferdisplay_obj_t* self) { - self->auto_refresh = true; + common_hal_framebufferio_framebufferdisplay_set_auto_refresh(self, true); common_hal_framebufferio_framebufferdisplay_show(self, NULL); } From 36b46465167f15eaf8535608b16859e6de10fac8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 10 Jul 2020 14:42:21 -0500 Subject: [PATCH 0303/1293] background_callback: Avoid CALLBACK_CRITICAL_BEGIN with nothing to do CALLBACK_CRITICAL_BEGIN is heavyweight, but we can be confident we do not have work to do as long as callback_head is NULL. This gives back performance on nRF. --- supervisor/shared/background_callback.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c index 99607b7a85..e45c9b5c3d 100644 --- a/supervisor/shared/background_callback.c +++ b/supervisor/shared/background_callback.c @@ -61,8 +61,11 @@ void background_callback_add(background_callback_t *cb, background_callback_fun static bool in_background_callback; void background_callback_run_all() { + if (!callback_head) { + return; + } CALLBACK_CRITICAL_BEGIN; - if(in_background_callback) { + if (in_background_callback) { CALLBACK_CRITICAL_END; return; } From 910f69c42b1852bcbde4c4fb24ea50939ec25fac Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 15 Jul 2020 10:12:27 -0500 Subject: [PATCH 0304/1293] esp32s2: Take care to invoke the sub-build-system only once This allows "make -j" in the outer build system to function properly, with a potentially large decrease in build times on high end desktop systems. --- ports/esp32s2/Makefile | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index b296976885..29abcab8e3 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -217,8 +217,8 @@ $(BUILD)/esp-idf/config/sdkconfig.h: boards/$(BOARD)/sdkconfig | $(BUILD)/esp-id # build a lib # Adding -d explain -j 1 -v to the ninja line will output debug info -$(BUILD)/esp-idf/esp-idf/%.a: $(BUILD)/esp-idf/config/sdkconfig.h - ninja -C $(BUILD)/esp-idf esp-idf/$*.a +#$(BUILD)/esp-idf/esp-idf/%.a: $(BUILD)/esp-idf/config/sdkconfig.h +# ninja -C $(BUILD)/esp-idf esp-idf/$*.a $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld: $(BUILD)/esp-idf/config/sdkconfig.h ninja -C $(BUILD)/esp-idf esp-idf/esp32s2/esp32s2_out.ld @@ -230,9 +230,6 @@ $(BUILD)/esp-idf/esp-idf/esp32s2/ld/esp32s2.project.ld: $(BUILD)/esp-idf/config/ $(BUILD)/esp-idf/partition_table/partition-table.bin: $(BUILD)/esp-idf/config/sdkconfig.h IDF_PATH=$(IDF_PATH) ninja -C $(BUILD)/esp-idf partition_table/partition-table.bin -$(BUILD)/esp-idf/bootloader/bootloader.bin: $(BUILD)/esp-idf/config/sdkconfig.h - ninja -C $(BUILD)/esp-idf bootloader/bootloader.bin - # run menuconfig menuconfig: $(BUILD)/esp-idf/config ninja -C $(BUILD)/esp-idf menuconfig @@ -260,7 +257,18 @@ FLASH_FLAGS = --flash_mode $(CIRCUITPY_ESP_FLASH_MODE) --flash_freq $(CIRCUITPY_ all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 -$(BUILD)/firmware.elf: $(OBJ) | $(ESP_IDF_COMPONENTS_EXPANDED) $(ESP_AUTOGEN_LD) +.PHONY: esp-idf-stamp +esp-idf-stamp: $(BUILD)/esp-idf/config/sdkconfig.h + ninja -C $(BUILD)/esp-idf \ + bootloader/bootloader.bin \ + esp-idf/bootloader_support/libbootloader_support.a \ + esp-idf/esp32s2/ld/esp32s2.project.ld \ + esp-idf/esp_system/libesp_system.a \ + esp-idf/freertos/libfreertos.a \ + esp-idf/log/liblog.a \ + esp-idf/xtensa/libxtensa.a + +$(BUILD)/firmware.elf: $(OBJ) | esp-idf-stamp $(STEPECHO) "LINK $@" $(Q)$(CC) -o $@ $(LDFLAGS) $^ $(ESP_IDF_COMPONENTS_EXPANDED) $(BINARY_BLOBS) build-$(BOARD)/esp-idf/esp-idf/newlib/libnewlib.a -u newlib_include_pthread_impl # $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld @@ -271,7 +279,7 @@ $(BUILD)/circuitpython-firmware.bin: $(BUILD)/firmware.elf # $(Q)$(OBJCOPY) -O binary $^ $@ # $(Q)$(OBJCOPY) -O binary -j .vectors -j .text -j .data $^ $@ -$(BUILD)/firmware.bin: $(BUILD)/esp-idf/partition_table/partition-table.bin $(BUILD)/esp-idf/bootloader/bootloader.bin $(BUILD)/circuitpython-firmware.bin +$(BUILD)/firmware.bin: $(BUILD)/circuitpython-firmware.bin | esp-idf-stamp $(Q)$(PYTHON) ../../tools/join_bins.py $@ 0x1000 $(BUILD)/esp-idf/bootloader/bootloader.bin 0x8000 $(BUILD)/esp-idf/partition_table/partition-table.bin 0x10000 $(BUILD)/circuitpython-firmware.bin $(BUILD)/firmware.uf2: $(BUILD)/circuitpython-firmware.bin From a2919a6fb2c433cafa5c528ee03ee9c86efb93d8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 15 Jul 2020 11:45:13 -0500 Subject: [PATCH 0305/1293] esp32s2: Use the device's EUI-48 address as unique ID On my hardware, esptool reports MAC: 7c:df:a1:02:6c:b8 after this change, the USB descriptor says SerialNumber: 7CDFA1026CB8 and microcontroller.cpu.id has >>> "".join("%02x" % byte for byte in microcontroller.cpu.uid) 'c7fd1a20c68b' Note that the nibble-swapping between USB and cpu.uid is typical. For instance, an stm32 board has USB SerialNumber 24002500F005D42445632302 but hex-converted microcontroller.cpu.id 420052000f504d4254363220. --- .../common-hal/microcontroller/Processor.c | 24 ++++++++++++++++++- .../common-hal/microcontroller/Processor.h | 2 +- ports/esp32s2/mpconfigport.mk | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/ports/esp32s2/common-hal/microcontroller/Processor.c b/ports/esp32s2/common-hal/microcontroller/Processor.c index 8eaf1a33d2..39b85a18b8 100644 --- a/ports/esp32s2/common-hal/microcontroller/Processor.c +++ b/ports/esp32s2/common-hal/microcontroller/Processor.c @@ -26,10 +26,14 @@ */ #include +#include + #include "common-hal/microcontroller/Processor.h" #include "py/runtime.h" #include "supervisor/shared/translate.h" +#include "soc/efuse_reg.h" + float common_hal_mcu_processor_get_temperature(void) { return NAN; } @@ -42,5 +46,23 @@ uint32_t common_hal_mcu_processor_get_frequency(void) { return 0; } -void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) { +STATIC uint8_t swap_nibbles(uint8_t v) { + return ((v << 4) | (v >> 4)) & 0xff; +} + +void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) { + memset(raw_id, 0, COMMON_HAL_MCU_PROCESSOR_UID_LENGTH); + + uint8_t *ptr = &raw_id[COMMON_HAL_MCU_PROCESSOR_UID_LENGTH-1]; + // MAC address contains 48 bits (6 bytes), 32 in the low order word + uint32_t mac_address_part = REG_READ(EFUSE_RD_MAC_SPI_SYS_0_REG); + *ptr-- = swap_nibbles(mac_address_part & 0xff); mac_address_part >>= 8; + *ptr-- = swap_nibbles(mac_address_part & 0xff); mac_address_part >>= 8; + *ptr-- = swap_nibbles(mac_address_part & 0xff); mac_address_part >>= 8; + *ptr-- = swap_nibbles(mac_address_part & 0xff); + + // and 16 in the high order word + mac_address_part = REG_READ(EFUSE_RD_MAC_SPI_SYS_1_REG); + *ptr-- = swap_nibbles(mac_address_part & 0xff); mac_address_part >>= 8; + *ptr-- = swap_nibbles(mac_address_part & 0xff); } diff --git a/ports/esp32s2/common-hal/microcontroller/Processor.h b/ports/esp32s2/common-hal/microcontroller/Processor.h index a2ea261c8f..f6636b333c 100644 --- a/ports/esp32s2/common-hal/microcontroller/Processor.h +++ b/ports/esp32s2/common-hal/microcontroller/Processor.h @@ -27,7 +27,7 @@ #ifndef MICROPY_INCLUDED_LITEX_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H #define MICROPY_INCLUDED_LITEX_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H -#define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH 15 +#define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH 6 #include "py/obj.h" diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 5686579b45..713ccbb094 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -7,7 +7,7 @@ MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz INTERNAL_LIBM = 1 # Chip supplied serial number, in bytes -USB_SERIAL_NUMBER_LENGTH = 30 +USB_SERIAL_NUMBER_LENGTH = 12 # Longints can be implemented as mpz, as longlong, or not LONGINT_IMPL = MPZ From 6160d11c5a04f60e54ce977fd73fafa5ba858aa0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 7 Jul 2020 11:14:43 -0500 Subject: [PATCH 0306/1293] supervisor: factor out, Handle USB via background callback --- ports/atmel-samd/background.c | 1 - ports/atmel-samd/supervisor/usb.c | 12 +++++++----- ports/litex/mphalport.c | 3 ++- ports/mimxrt10xx/supervisor/usb.c | 3 ++- ports/nrf/background.c | 1 - ports/nrf/supervisor/usb.c | 7 +++++-- ports/stm/supervisor/usb.c | 2 +- supervisor/shared/usb/usb.c | 11 +++++++++++ supervisor/usb.h | 3 +++ 9 files changed, 31 insertions(+), 12 deletions(-) diff --git a/ports/atmel-samd/background.c b/ports/atmel-samd/background.c index b903456ee8..5c499ab3a8 100644 --- a/ports/atmel-samd/background.c +++ b/ports/atmel-samd/background.c @@ -85,7 +85,6 @@ void run_background_tasks(void) { network_module_background(); #endif filesystem_background(); - usb_background(); running_background_tasks = false; assert_heap_ok(); diff --git a/ports/atmel-samd/supervisor/usb.c b/ports/atmel-samd/supervisor/usb.c index 650ed6a397..ea940f8988 100644 --- a/ports/atmel-samd/supervisor/usb.c +++ b/ports/atmel-samd/supervisor/usb.c @@ -29,6 +29,8 @@ #include "hpl/gclk/hpl_gclk_base.h" #include "hal_gpio.h" #include "lib/tinyusb/src/device/usbd.h" +#include "supervisor/background_callback.h" +#include "supervisor/usb.h" void init_usb_hardware(void) { #ifdef SAMD21 @@ -61,24 +63,24 @@ void init_usb_hardware(void) { #ifdef SAMD21 void USB_Handler(void) { - tud_int_handler(0); + usb_irq_handler(); } #endif #ifdef SAM_D5X_E5X void USB_0_Handler (void) { - tud_int_handler(0); + usb_irq_handler(); } void USB_1_Handler (void) { - tud_int_handler(0); + usb_irq_handler(); } void USB_2_Handler (void) { - tud_int_handler(0); + usb_irq_handler(); } void USB_3_Handler (void) { - tud_int_handler(0); + usb_irq_handler(); } #endif diff --git a/ports/litex/mphalport.c b/ports/litex/mphalport.c index 84a5467951..862f163939 100644 --- a/ports/litex/mphalport.c +++ b/ports/litex/mphalport.c @@ -31,6 +31,7 @@ #include "py/mphal.h" #include "py/mpstate.h" #include "py/gc.h" +#include "supervisor/usb.h" #include "csr.h" #include "generated/soc.h" @@ -49,7 +50,7 @@ void isr(void) { #ifdef CFG_TUSB_MCU if (irqs & (1 << USB_INTERRUPT)) - tud_int_handler(0); + usb_irq_handler(); #endif if (irqs & (1 << TIMER0_INTERRUPT)) SysTick_Handler(); diff --git a/ports/mimxrt10xx/supervisor/usb.c b/ports/mimxrt10xx/supervisor/usb.c index 1bc7ea9b56..af259405a3 100644 --- a/ports/mimxrt10xx/supervisor/usb.c +++ b/ports/mimxrt10xx/supervisor/usb.c @@ -27,6 +27,7 @@ #include "fsl_clock.h" #include "tusb.h" +#include "supervisor/usb.h" void init_usb_hardware(void) { CLOCK_EnableUsbhs0PhyPllClock(kCLOCK_Usbphy480M, 480000000U); @@ -56,5 +57,5 @@ void init_usb_hardware(void) { } void USB_OTG1_IRQHandler(void) { - tud_int_handler(0); + usb_irq_handler(); } diff --git a/ports/nrf/background.c b/ports/nrf/background.c index 966c56e0b7..bc7c0d7d32 100644 --- a/ports/nrf/background.c +++ b/ports/nrf/background.c @@ -59,7 +59,6 @@ void run_background_tasks(void) { } running_background_tasks = true; filesystem_background(); - usb_background(); #if CIRCUITPY_AUDIOPWMIO audiopwmout_background(); #endif diff --git a/ports/nrf/supervisor/usb.c b/ports/nrf/supervisor/usb.c index 3d2527faaa..771e86ce03 100644 --- a/ports/nrf/supervisor/usb.c +++ b/ports/nrf/supervisor/usb.c @@ -30,6 +30,7 @@ #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" #include "lib/tinyusb/src/device/usbd.h" +#include "supervisor/background_callback.h" #ifdef SOFTDEVICE_PRESENT #include "nrf_sdm.h" @@ -42,7 +43,9 @@ extern void tusb_hal_nrf_power_event(uint32_t event); void init_usb_hardware(void) { - // 2 is max priority (0, 1 are reserved for SD) + // 2 is max priority (0, 1, and 4 are reserved for SD) + // 5 is max priority that still allows calling SD functions such as + // sd_softdevice_is_enabled NVIC_SetPriority(USBD_IRQn, 2); // USB power may already be ready at this time -> no event generated @@ -89,5 +92,5 @@ void init_usb_hardware(void) { } void USBD_IRQHandler(void) { - tud_int_handler(0); + usb_irq_handler(); } diff --git a/ports/stm/supervisor/usb.c b/ports/stm/supervisor/usb.c index 3dd0acafd0..3d53fa3749 100644 --- a/ports/stm/supervisor/usb.c +++ b/ports/stm/supervisor/usb.c @@ -130,5 +130,5 @@ void init_usb_hardware(void) { } void OTG_FS_IRQHandler(void) { - tud_int_handler(0); + usb_irq_handler(); } diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index edf8101188..472be96d52 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -27,6 +27,7 @@ #include "py/objstr.h" #include "shared-bindings/microcontroller/Processor.h" #include "shared-module/usb_midi/__init__.h" +#include "supervisor/background_callback.h" #include "supervisor/port.h" #include "supervisor/usb.h" #include "lib/utils/interrupt_char.h" @@ -82,6 +83,16 @@ void usb_background(void) { } } +static background_callback_t callback; +static void usb_background_do(void* unused) { + usb_background(); +} + +void usb_irq_handler(void) { + tud_int_handler(0); + background_callback_add(&callback, usb_background_do, NULL); +} + //--------------------------------------------------------------------+ // tinyusb callbacks //--------------------------------------------------------------------+ diff --git a/supervisor/usb.h b/supervisor/usb.h index 29280c725b..1bed9bbb4b 100644 --- a/supervisor/usb.h +++ b/supervisor/usb.h @@ -33,6 +33,9 @@ // alive and responsive. void usb_background(void); +// Ports must call this from their particular USB IRQ handler +void usb_irq_handler(void); + // Only inits the USB peripheral clocks and pins. The peripheral will be initialized by // TinyUSB. void init_usb_hardware(void); From 1df48176ce2e4111c4629269cb86d2a6e365a3d2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 13 Jul 2020 10:33:58 -0500 Subject: [PATCH 0307/1293] supervisor: factor supervisor_background_tasks from sundry ports --- main.c | 2 - ports/atmel-samd/background.c | 48 ++--------------- ports/atmel-samd/background.h | 5 -- .../common-hal/frequencyio/FrequencyIn.c | 3 +- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 3 +- ports/cxd56/background.c | 24 ++------- ports/cxd56/background.h | 3 -- ports/esp32s2/background.c | 25 ++------- ports/esp32s2/background.h | 3 -- ports/litex/background.c | 32 ++--------- ports/litex/background.h | 5 -- ports/mimxrt10xx/background.c | 53 ++----------------- ports/mimxrt10xx/background.h | 7 --- ports/mimxrt10xx/common-hal/pulseio/PulseIn.c | 2 +- ports/nrf/background.c | 27 ++-------- ports/nrf/background.h | 5 -- ports/stm/background.c | 28 ++-------- ports/stm/background.h | 5 -- supervisor/port.h | 8 +++ supervisor/shared/tick.c | 52 ++++++++++++++++-- supervisor/shared/tick.h | 16 +++--- 21 files changed, 95 insertions(+), 261 deletions(-) diff --git a/main.c b/main.c index 201022f1af..ce95de95f0 100755 --- a/main.c +++ b/main.c @@ -101,8 +101,6 @@ void start_mp(supervisor_allocation* heap) { reset_status_led(); autoreload_stop(); - background_tasks_reset(); - // Stack limit should be less than real stack size, so we have a chance // to recover from limit hit. (Limit is measured in bytes.) mp_stack_ctrl_init(); diff --git a/ports/atmel-samd/background.c b/ports/atmel-samd/background.c index 5c499ab3a8..62c233a3f8 100644 --- a/ports/atmel-samd/background.c +++ b/ports/atmel-samd/background.c @@ -39,59 +39,21 @@ #include "shared-module/displayio/__init__.h" #endif -volatile uint64_t last_finished_tick = 0; - -bool stack_ok_so_far = true; - -static bool running_background_tasks = false; - #ifdef MONITOR_BACKGROUND_TASKS // PB03 is physical pin "SCL" on the Metro M4 express // so you can't use this code AND an i2c peripheral // at the same time unless you change this -STATIC void start_background_task(void) { +void port_start_background_task(void) { REG_PORT_DIRSET1 = (1<<3); REG_PORT_OUTSET1 = (1<<3); } -STATIC void finish_background_task(void) { +void port_finish_background_task(void) { REG_PORT_OUTCLR1 = (1<<3); } #else -STATIC void start_background_task(void) {} -STATIC void finish_background_task(void) {} +void port_start_background_task(void) {} +void port_finish_background_task(void) {} #endif -void background_tasks_reset(void) { - running_background_tasks = false; -} - -void run_background_tasks(void) { - // Don't call ourselves recursively. - if (running_background_tasks) { - return; - } - - start_background_task(); - - assert_heap_ok(); - running_background_tasks = true; - - #if CIRCUITPY_DISPLAYIO - displayio_background(); - #endif - - #if CIRCUITPY_NETWORK - network_module_background(); - #endif - filesystem_background(); - running_background_tasks = false; - assert_heap_ok(); - - last_finished_tick = port_get_raw_ticks(NULL); - finish_background_task(); -} - -bool background_tasks_ok(void) { - return port_get_raw_ticks(NULL) - last_finished_tick < 1024; -} +void port_background_task(void) {} diff --git a/ports/atmel-samd/background.h b/ports/atmel-samd/background.h index d9866a6abc..2a89c3b1b8 100644 --- a/ports/atmel-samd/background.h +++ b/ports/atmel-samd/background.h @@ -29,9 +29,4 @@ #include -void background_tasks_reset(void); -void run_background_tasks(void); -void run_background_vm_tasks(void); -bool background_tasks_ok(void); - #endif // MICROPY_INCLUDED_ATMEL_SAMD_BACKGROUND_H diff --git a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c index 1952df5637..02d0482dca 100644 --- a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +++ b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c @@ -46,6 +46,7 @@ #include "hpl_gclk_config.h" #include "shared-bindings/time/__init__.h" +#include "supervisor/shared/tick.h" #include "supervisor/shared/translate.h" #ifdef SAMD21 @@ -132,7 +133,7 @@ void frequencyin_interrupt_handler(uint8_t index) { } // Check if we've reached the upper limit of detection - if (!background_tasks_ok() || self->errored_too_fast) { + if (!supervisor_background_tasks_ok() || self->errored_too_fast) { self->errored_too_fast = true; frequencyin_emergency_cancel_capture(i); } diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index b825579dbe..ae58b089de 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -42,6 +42,7 @@ #include "samd/timers.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/pulseio/PulseIn.h" +#include "supervisor/shared/tick.h" #include "supervisor/shared/translate.h" // This timer is shared amongst all PulseIn objects as a higher resolution clock. @@ -87,7 +88,7 @@ void pulsein_interrupt_handler(uint8_t channel) { uint32_t current_count = tc->COUNT16.COUNT.reg; pulseio_pulsein_obj_t* self = get_eic_channel_data(channel); - if (!background_tasks_ok() || self->errored_too_fast) { + if (!supervisor_background_tasks_ok() || self->errored_too_fast) { self->errored_too_fast = true; common_hal_pulseio_pulsein_pause(self); return; diff --git a/ports/cxd56/background.c b/ports/cxd56/background.c index ade257dd24..6de6d7275b 100644 --- a/ports/cxd56/background.c +++ b/ports/cxd56/background.c @@ -30,24 +30,6 @@ #include "supervisor/filesystem.h" #include "supervisor/shared/stack.h" -static bool running_background_tasks = false; - -void background_tasks_reset(void) { - running_background_tasks = false; -} - -void run_background_tasks(void) { - // Don't call ourselves recursively. - if (running_background_tasks) { - return; - } - - assert_heap_ok(); - running_background_tasks = true; - - usb_background(); - filesystem_background(); - - running_background_tasks = false; - assert_heap_ok(); -} +void port_background_task(void) {} +void port_start_background_task(void) {} +void port_finish_background_task(void) {} diff --git a/ports/cxd56/background.h b/ports/cxd56/background.h index a38e3faed4..5f76e64429 100644 --- a/ports/cxd56/background.h +++ b/ports/cxd56/background.h @@ -27,7 +27,4 @@ #ifndef MICROPY_INCLUDED_CXD56_BACKGROUND_H #define MICROPY_INCLUDED_CXD56_BACKGROUND_H -void background_tasks_reset(void); -void run_background_tasks(void); - #endif // MICROPY_INCLUDED_CXD56_BACKGROUND_H diff --git a/ports/esp32s2/background.c b/ports/esp32s2/background.c index a90fa7d0aa..40ce9ecfdf 100644 --- a/ports/esp32s2/background.c +++ b/ports/esp32s2/background.c @@ -35,27 +35,12 @@ #include "shared-module/displayio/__init__.h" #endif -static bool running_background_tasks = false; - -void background_tasks_reset(void) { - running_background_tasks = false; -} - -void run_background_tasks(void) { - // Don't call ourselves recursively. - if (running_background_tasks) { - return; - } +void port_background_task(void) { // Zero delay in case FreeRTOS wants to switch to something else. vTaskDelay(0); - running_background_tasks = true; - filesystem_background(); - - #if CIRCUITPY_DISPLAYIO - displayio_background(); - #endif - running_background_tasks = false; - - assert_heap_ok(); } + +void port_start_background_task(void) {} + +void port_finish_background_task(void) {} diff --git a/ports/esp32s2/background.h b/ports/esp32s2/background.h index 0e1fb7a568..cb850d4e5a 100644 --- a/ports/esp32s2/background.h +++ b/ports/esp32s2/background.h @@ -29,7 +29,4 @@ #include -void background_tasks_reset(void); -void run_background_tasks(void); - #endif // MICROPY_INCLUDED_ESP32S2_BACKGROUND_H diff --git a/ports/litex/background.c b/ports/litex/background.c index 8c18970434..174d9588ac 100644 --- a/ports/litex/background.c +++ b/ports/litex/background.c @@ -29,32 +29,6 @@ #include "supervisor/usb.h" #include "supervisor/shared/stack.h" -#if CIRCUITPY_DISPLAYIO -#include "shared-module/displayio/__init__.h" -#endif - -static bool running_background_tasks = false; - -void background_tasks_reset(void) { - running_background_tasks = false; -} - -void run_background_tasks(void) { - // Don't call ourselves recursively. - if (running_background_tasks) { - return; - } - running_background_tasks = true; - filesystem_background(); - - #if USB_AVAILABLE - usb_background(); - #endif - - #if CIRCUITPY_DISPLAYIO - displayio_background(); - #endif - running_background_tasks = false; - - assert_heap_ok(); -} +void port_background_task(void) {} +void port_start_background_task(void) {} +void port_finish_background_task(void) {} diff --git a/ports/litex/background.h b/ports/litex/background.h index 09551c7fbb..c80fbbe5cb 100644 --- a/ports/litex/background.h +++ b/ports/litex/background.h @@ -27,9 +27,4 @@ #ifndef MICROPY_INCLUDED_LITEX_BACKGROUND_H #define MICROPY_INCLUDED_LITEX_BACKGROUND_H -#include - -void background_tasks_reset(void); -void run_background_tasks(void); - #endif // MICROPY_INCLUDED_LITEX_BACKGROUND_H diff --git a/ports/mimxrt10xx/background.c b/ports/mimxrt10xx/background.c index ff53ea44f4..a8a613d41a 100644 --- a/ports/mimxrt10xx/background.c +++ b/ports/mimxrt10xx/background.c @@ -24,58 +24,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include "background.h" -//#include "audio_dma.h" -#include "supervisor/filesystem.h" -#include "supervisor/shared/tick.h" -#include "supervisor/usb.h" - -#include "py/runtime.h" -#include "shared-module/network/__init__.h" -#include "supervisor/linker.h" -#include "supervisor/shared/stack.h" - -#ifdef CIRCUITPY_DISPLAYIO -#include "shared-module/displayio/__init__.h" -#endif - -volatile uint64_t last_finished_tick = 0; - -bool stack_ok_so_far = true; - -static bool running_background_tasks = false; - -void background_tasks_reset(void) { - running_background_tasks = false; -} - -void PLACE_IN_ITCM(run_background_tasks)(void) { - // Don't call ourselves recursively. - if (running_background_tasks) { - return; - } - assert_heap_ok(); - running_background_tasks = true; +#include "supervisor/port.h" +void port_background_task(void) { #if CIRCUITPY_AUDIOIO || CIRCUITPY_AUDIOBUSIO audio_dma_background(); #endif - #if CIRCUITPY_DISPLAYIO - displayio_background(); - #endif - - #if CIRCUITPY_NETWORK - network_module_background(); - #endif - filesystem_background(); - usb_background(); - running_background_tasks = false; - assert_heap_ok(); - - last_finished_tick = supervisor_ticks_ms64(); -} - -bool background_tasks_ok(void) { - return supervisor_ticks_ms64() - last_finished_tick < 1000; } +void port_start_background_task(void) {} +void port_finish_background_task(void) {} diff --git a/ports/mimxrt10xx/background.h b/ports/mimxrt10xx/background.h index 52789d0389..a3fe102acc 100644 --- a/ports/mimxrt10xx/background.h +++ b/ports/mimxrt10xx/background.h @@ -28,11 +28,4 @@ #ifndef MICROPY_INCLUDED_MIMXRT10XX_BACKGROUND_H #define MICROPY_INCLUDED_MIMXRT10XX_BACKGROUND_H -#include - -void background_tasks_reset(void); -void run_background_tasks(void); -void run_background_vm_tasks(void); -bool background_tasks_ok(void); - #endif // MICROPY_INCLUDED_MIMXRT10XX_BACKGROUND_H diff --git a/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c b/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c index d8bf2017ea..ec02908612 100644 --- a/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c +++ b/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c @@ -64,7 +64,7 @@ // // last ms. // current_us = 1000 - current_us; // pulseio_pulsein_obj_t* self = get_eic_channel_data(channel); -// if (!background_tasks_ok() || self->errored_too_fast) { +// if (!supervisor_background_tasks_ok() || self->errored_too_fast) { // self->errored_too_fast = true; // common_hal_pulseio_pulsein_pause(self); // return; diff --git a/ports/nrf/background.c b/ports/nrf/background.c index bc7c0d7d32..10543ddb21 100644 --- a/ports/nrf/background.c +++ b/ports/nrf/background.c @@ -46,35 +46,14 @@ #include "common-hal/_bleio/bonding.h" #endif -static bool running_background_tasks = false; +void port_start_background_task(void) {} +void port_finish_background_task(void) {} -void background_tasks_reset(void) { - running_background_tasks = false; -} - -void run_background_tasks(void) { - // Don't call ourselves recursively. - if (running_background_tasks) { - return; - } - running_background_tasks = true; - filesystem_background(); +void port_background_task(void) { #if CIRCUITPY_AUDIOPWMIO audiopwmout_background(); #endif #if CIRCUITPY_AUDIOBUSIO i2s_background(); #endif - -#if CIRCUITPY_BLEIO - supervisor_bluetooth_background(); - bonding_background(); -#endif - - #if CIRCUITPY_DISPLAYIO - displayio_background(); - #endif - running_background_tasks = false; - - assert_heap_ok(); } diff --git a/ports/nrf/background.h b/ports/nrf/background.h index d53681c0fd..64a768cf9b 100644 --- a/ports/nrf/background.h +++ b/ports/nrf/background.h @@ -27,9 +27,4 @@ #ifndef MICROPY_INCLUDED_NRF_BACKGROUND_H #define MICROPY_INCLUDED_NRF_BACKGROUND_H -#include - -void background_tasks_reset(void); -void run_background_tasks(void); - #endif // MICROPY_INCLUDED_NRF_BACKGROUND_H diff --git a/ports/stm/background.c b/ports/stm/background.c index 8c18970434..d83a0ccec7 100644 --- a/ports/stm/background.c +++ b/ports/stm/background.c @@ -33,28 +33,6 @@ #include "shared-module/displayio/__init__.h" #endif -static bool running_background_tasks = false; - -void background_tasks_reset(void) { - running_background_tasks = false; -} - -void run_background_tasks(void) { - // Don't call ourselves recursively. - if (running_background_tasks) { - return; - } - running_background_tasks = true; - filesystem_background(); - - #if USB_AVAILABLE - usb_background(); - #endif - - #if CIRCUITPY_DISPLAYIO - displayio_background(); - #endif - running_background_tasks = false; - - assert_heap_ok(); -} +void port_background_task(void) {} +void port_start_background_task(void) {} +void port_finish_background_task(void) {} diff --git a/ports/stm/background.h b/ports/stm/background.h index 6225429f89..e57aa40dd7 100644 --- a/ports/stm/background.h +++ b/ports/stm/background.h @@ -27,9 +27,4 @@ #ifndef MICROPY_INCLUDED_STM32_BACKGROUND_H #define MICROPY_INCLUDED_STM32_BACKGROUND_H -#include - -void background_tasks_reset(void); -void run_background_tasks(void); - #endif // MICROPY_INCLUDED_STM32_BACKGROUND_H diff --git a/supervisor/port.h b/supervisor/port.h index 8a12d34c8a..ad5b3cf32a 100644 --- a/supervisor/port.h +++ b/supervisor/port.h @@ -91,4 +91,12 @@ void port_interrupt_after_ticks(uint32_t ticks); // Sleep the CPU until an interrupt is received. void port_sleep_until_interrupt(void); +// Execute port specific actions during background tasks. +void port_background_task(void); + +// Take port specific actions at the beginning and end of background tasks. +// This is used e.g., to set a monitoring pin for debug purposes. "Actual +// work" should be done in port_background_task() instead. +void port_start_background_task(void); +void port_finish_background_task(void); #endif // MICROPY_INCLUDED_SUPERVISOR_PORT_H diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 46172d0f30..bc270030f3 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -32,8 +32,16 @@ #include "supervisor/background_callback.h" #include "supervisor/port.h" #include "supervisor/shared/autoreload.h" +#include "supervisor/shared/stack.h" -static volatile uint64_t PLACE_IN_DTCM_BSS(background_ticks); +#if CIRCUITPY_BLEIO +#include "supervisor/shared/bluetooth.h" +#include "common-hal/_bleio/bonding.h" +#endif + +#if CIRCUITPY_DISPLAYIO +#include "shared-module/displayio/__init__.h" +#endif #if CIRCUITPY_GAMEPAD #include "shared-module/gamepad/__init__.h" @@ -43,6 +51,10 @@ static volatile uint64_t PLACE_IN_DTCM_BSS(background_ticks); #include "shared-module/gamepadshift/__init__.h" #endif +#if CIRCUITPY_NETWORK +#include "shared-module/network/__init__.h" +#endif + #include "shared-bindings/microcontroller/__init__.h" #if CIRCUITPY_WATCHDOG @@ -52,12 +64,42 @@ static volatile uint64_t PLACE_IN_DTCM_BSS(background_ticks); #define WATCHDOG_EXCEPTION_CHECK() 0 #endif +static volatile uint64_t PLACE_IN_DTCM_BSS(background_ticks); + static background_callback_t callback; -extern void run_background_tasks(void); +volatile uint64_t last_finished_tick = 0; -void background_task_tick(void *unused) { - run_background_tasks(); +void supervisor_background_tasks(void *unused) { + port_start_background_task(); + + assert_heap_ok(); + + #if CIRCUITPY_DISPLAYIO + displayio_background(); + #endif + + #if CIRCUITPY_NETWORK + network_module_background(); + #endif + filesystem_background(); + + #if CIRCUITPY_BLEIO + supervisor_bluetooth_background(); + bonding_background(); + #endif + + port_background_task(); + + assert_heap_ok(); + + last_finished_tick = port_get_raw_ticks(NULL); + + port_finish_background_task(); +} + +bool supervisor_background_tasks_ok(void) { + return port_get_raw_ticks(NULL) - last_finished_tick < 1024; } void supervisor_tick(void) { @@ -77,7 +119,7 @@ void supervisor_tick(void) { #endif } #endif - background_callback_add(&callback, background_task_tick, NULL); + background_callback_add(&callback, supervisor_background_tasks, NULL); } uint64_t supervisor_ticks_ms64() { diff --git a/supervisor/shared/tick.h b/supervisor/shared/tick.h index e7e8080581..3a01bd6222 100644 --- a/supervisor/shared/tick.h +++ b/supervisor/shared/tick.h @@ -28,6 +28,7 @@ #define __INCLUDED_SUPERVISOR_TICK_H #include +#include /** @brief To be called once every ms * @@ -36,13 +37,6 @@ * interrupt context. */ extern void supervisor_tick(void); -/** @brief Cause background tasks to be called soon - * - * Normally, background tasks are only run once per tick. For other cases where - * an event noticed from an interrupt context needs to be completed by a background - * task activity, the interrupt can call supervisor_fake_tick. - */ -extern void supervisor_fake_tick(void); /** @brief Get the lower 32 bits of the time in milliseconds * * This can be more efficient than supervisor_ticks_ms64, for sites where a wraparound @@ -67,4 +61,12 @@ extern void supervisor_run_background_if_tick(void); extern void supervisor_enable_tick(void); extern void supervisor_disable_tick(void); +/** + * @brief Return true if tick-based background tasks ran within the last 1s + * + * Note that when ticks are not enabled, this function can return false; this is + * intended. + */ +extern bool supervisor_background_tasks_ok(void); + #endif From 81105cb9ef68c4d88eab206f111af448440c8f30 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 14 Jul 2020 10:08:07 -0500 Subject: [PATCH 0308/1293] supervisor: usb: note that it's unusual to need to call usb_background --- supervisor/usb.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/supervisor/usb.h b/supervisor/usb.h index 1bed9bbb4b..2a447c3686 100644 --- a/supervisor/usb.h +++ b/supervisor/usb.h @@ -29,8 +29,10 @@ #include -// Ports must call this as frequently as they can in order to keep the USB connection -// alive and responsive. +// Ports must call this as frequently as they can in order to keep the USB +// connection alive and responsive. Normally this is called from background +// tasks after the USB IRQ handler is executed, but in specific circumstances +// it may be necessary to call it directly. void usb_background(void); // Ports must call this from their particular USB IRQ handler From 49fcfd14d213cb6f6441fc718ff8fc8e7a5cc5fa Mon Sep 17 00:00:00 2001 From: TinkeringTech Date: Wed, 15 Jul 2020 21:49:34 -0400 Subject: [PATCH 0309/1293] Added the TinkeringTech ScoutMakes Azul platform to CircuitPython --- .github/workflows/build.yml | 1 + .../tinkeringtech_scoutmakes_azul/README.md | 25 ++++++++ .../tinkeringtech_scoutmakes_azul/board.c | 38 +++++++++++ .../mpconfigboard.h | 63 +++++++++++++++++++ .../mpconfigboard.mk | 10 +++ .../tinkeringtech_scoutmakes_azul/pins.c | 53 ++++++++++++++++ 6 files changed, 190 insertions(+) create mode 100644 ports/nrf/boards/tinkeringtech_scoutmakes_azul/README.md create mode 100644 ports/nrf/boards/tinkeringtech_scoutmakes_azul/board.c create mode 100644 ports/nrf/boards/tinkeringtech_scoutmakes_azul/mpconfigboard.h create mode 100644 ports/nrf/boards/tinkeringtech_scoutmakes_azul/mpconfigboard.mk create mode 100644 ports/nrf/boards/tinkeringtech_scoutmakes_azul/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00454cc2da..3ad11b3ed7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -259,6 +259,7 @@ jobs: - "teensy41" - "teknikio_bluebird" - "thunderpack" + - "tinkeringtech_scoutmakes_azul" - "trellis_m4_express" - "trinket_m0" - "trinket_m0_haxpress" diff --git a/ports/nrf/boards/tinkeringtech_scoutmakes_azul/README.md b/ports/nrf/boards/tinkeringtech_scoutmakes_azul/README.md new file mode 100644 index 0000000000..614daa72cc --- /dev/null +++ b/ports/nrf/boards/tinkeringtech_scoutmakes_azul/README.md @@ -0,0 +1,25 @@ +# Setup + +The TinkeringTech ScoutMakes Azul is a bluetooth enabled, feather format, open source platform featuring the nRF52840 from Nordic Semiconductors. The design is based on the Adafruit nRF52840 feather express and uses the Raytac MDBT50Q-1MV2 module. + +Schematic, datasheet, pin mapping etc. can be found over [here](https://tinkeringtech.com/scoutmakes-azul). + +features: +- ARM Cortex M4F (with HW floating point acceleration) running at 64MHz +- Raytac MDBT50Q-1MV2 BLE module. FCC / IC / TELEC certified module +- 1MB flash and 256KB SRAM +- Native Open Source USB stack – pre-programmed with UF2 bootloader and CircuitPython +- 128×32 OLED display +- USB type-C +- On/off power switch +- Bluetooth Low Energy compatible 2.4GHz radio (Details available in the nRF52840 product specification) +- BT5.1 & BT5 Bluetooth Specification Certified +- Supports BT5 Long Range Feature +- 1.7v to 3.3v operation with internal linear and DC/DC voltage regulators +- 21 GPIO, 6 x 12-bit ADC pins, up to 12 PWM outputs (3 PWM modules with 4 outputs each) +- Pin #3 red LED for general purpose blinking, +- Programmable NeoPixel for colorful feedback +- 4 mounting holes +- Reset button +- Works out of the box with Adafruit feather wings. +- Open source design. diff --git a/ports/nrf/boards/tinkeringtech_scoutmakes_azul/board.c b/ports/nrf/boards/tinkeringtech_scoutmakes_azul/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/nrf/boards/tinkeringtech_scoutmakes_azul/board.c @@ -0,0 +1,38 @@ +/* + * 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 "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/nrf/boards/tinkeringtech_scoutmakes_azul/mpconfigboard.h b/ports/nrf/boards/tinkeringtech_scoutmakes_azul/mpconfigboard.h new file mode 100644 index 0000000000..2d66633942 --- /dev/null +++ b/ports/nrf/boards/tinkeringtech_scoutmakes_azul/mpconfigboard.h @@ -0,0 +1,63 @@ +/* + * 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 "TinkeringTech ScoutMakes Azul" +#define MICROPY_HW_MCU_NAME "nRF52840" + +#define MICROPY_HW_NEOPIXEL (&pin_P0_16) + +#define MICROPY_HW_LED_STATUS (&pin_P1_15) + +#if QSPI_FLASH_FILESYSTEM +#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 17) +#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 22) +#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 23) +#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(0, 21) +#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(0, 19) +#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 20) +#endif + +#if SPI_FLASH_FILESYSTEM +#define SPI_FLASH_MOSI_PIN &pin_P0_17 +#define SPI_FLASH_MISO_PIN &pin_P0_22 +#define SPI_FLASH_SCK_PIN &pin_P0_19 +#define SPI_FLASH_CS_PIN &pin_P0_20 +#endif + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_P0_11) +#define DEFAULT_I2C_BUS_SDA (&pin_P0_12) + +#define DEFAULT_SPI_BUS_SCK (&pin_P0_14) +#define DEFAULT_SPI_BUS_MOSI (&pin_P0_13) +#define DEFAULT_SPI_BUS_MISO (&pin_P0_15) + +#define DEFAULT_UART_BUS_RX (&pin_P0_24) +#define DEFAULT_UART_BUS_TX (&pin_P0_25) diff --git a/ports/nrf/boards/tinkeringtech_scoutmakes_azul/mpconfigboard.mk b/ports/nrf/boards/tinkeringtech_scoutmakes_azul/mpconfigboard.mk new file mode 100644 index 0000000000..e8bd636ad9 --- /dev/null +++ b/ports/nrf/boards/tinkeringtech_scoutmakes_azul/mpconfigboard.mk @@ -0,0 +1,10 @@ +USB_VID = 0x239A +USB_PID = 0x80BE +USB_PRODUCT = "TinkeringTech ScoutMakes Azul" +USB_MANUFACTURER = "TinkeringTech LLC" + +MCU_CHIP = nrf52840 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = "GD25Q16C" diff --git a/ports/nrf/boards/tinkeringtech_scoutmakes_azul/pins.c b/ports/nrf/boards/tinkeringtech_scoutmakes_azul/pins.c new file mode 100644 index 0000000000..ec2689ab45 --- /dev/null +++ b/ports/nrf/boards/tinkeringtech_scoutmakes_azul/pins.c @@ -0,0 +1,53 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_03) }, + + { MP_ROM_QSTR(MP_QSTR_AREF), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_P0_29) }, + + { MP_ROM_QSTR(MP_QSTR_SWITCH), MP_ROM_PTR(&pin_P1_02) }, + + { 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_D2), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P0_07) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_P0_27) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P1_09) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P0_16) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_15) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_25) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_24) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_12) }, + + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P1_15) }, + { MP_ROM_QSTR(MP_QSTR_RED_LED), MP_ROM_PTR(&pin_P1_15) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P1_15) }, + + { MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P1_10) }, + + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 416a32ab01631770701fe433c1e6c79a2a16b6a9 Mon Sep 17 00:00:00 2001 From: TinkeringTech Date: Wed, 15 Jul 2020 21:58:40 -0400 Subject: [PATCH 0310/1293] fixed build.yml file formatting errors --- .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 3ad11b3ed7..d3d12be096 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -259,7 +259,7 @@ jobs: - "teensy41" - "teknikio_bluebird" - "thunderpack" - - "tinkeringtech_scoutmakes_azul" + - "tinkeringtech_scoutmakes_azul" - "trellis_m4_express" - "trinket_m0" - "trinket_m0_haxpress" From cdfc3a2d37771b67f82ab810ebfefcbb9cd6a14e Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 16 Jul 2020 11:12:53 -0400 Subject: [PATCH 0311/1293] Check out active protomatter PR --- lib/protomatter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protomatter b/lib/protomatter index 9f71088d2c..761d6437e8 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit 9f71088d2c32206c6f0495704ae0c040426d5764 +Subproject commit 761d6437e8cd6a131d51de96974337121a9c7164 From 6a49766df04ba23d2c5f0bdb24f826ff1355340d Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 16 Jul 2020 15:45:18 -0400 Subject: [PATCH 0312/1293] Fix pulseIO reset and frequency issues, remove IRQ conflict --- ports/stm/common-hal/pulseio/PulseIn.c | 13 ++++++++----- ports/stm/common-hal/pulseio/PulseOut.c | 1 - ports/stm/peripherals/timers.c | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c index 478077eda7..db01968c4d 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.c +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -102,7 +102,9 @@ void pulsein_reset(void) { } memset(_objs, 0, sizeof(_objs)); + HAL_TIM_Base_DeInit(&tim_handle); tim_clock_disable(stm_peripherals_timer_get_index(tim_handle.Instance)); + memset(&tim_handle, 0, sizeof(tim_handle)); refcount = 0; } @@ -133,21 +135,22 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu self->last_count = 0; self->last_overflow = 0; - if (HAL_TIM_Base_GetState(&tim_handle) == HAL_TIM_STATE_RESET) { //TODO: there's no state yet + if (HAL_TIM_Base_GetState(&tim_handle) == HAL_TIM_STATE_RESET) { // Find a suitable timer TIM_TypeDef * tim_instance = stm_peripherals_find_timer(); stm_peripherals_timer_reserve(tim_instance); - // Calculate a 1ms period + // Set ticks to 1us uint32_t source = stm_peripherals_timer_get_source_freq(tim_instance); - uint32_t prescaler = source/1000000; // 1us intervals + uint32_t prescaler = source/1000000; + // Enable clocks and IRQ, set callback stm_peripherals_timer_preinit(tim_instance, 4, pulsein_timer_event_handler); // Set the new period tim_handle.Instance = tim_instance; - tim_handle.Init.Prescaler = prescaler; // divide down to 1mhz - tim_handle.Init.Period = 0xffff; + tim_handle.Init.Prescaler = prescaler - 1; + tim_handle.Init.Period = 0x10000 - 1; //65 ms period (maximum) HAL_TIM_Base_Init(&tim_handle); // Set registers manually diff --git a/ports/stm/common-hal/pulseio/PulseOut.c b/ports/stm/common-hal/pulseio/PulseOut.c index ba817ae263..865b41dcf5 100644 --- a/ports/stm/common-hal/pulseio/PulseOut.c +++ b/ports/stm/common-hal/pulseio/PulseOut.c @@ -73,7 +73,6 @@ STATIC void start_timer(void) { tim_handle.Instance->CR1 |= TIM_CR1_CEN; // Resume timer tim_handle.Instance->CR1 |= TIM_CR1_URS; // Disable non-overflow interrupts __HAL_TIM_ENABLE_IT(&tim_handle, TIM_IT_UPDATE); - } STATIC void pulseout_event_handler(void) { diff --git a/ports/stm/peripherals/timers.c b/ports/stm/peripherals/timers.c index 54b1fd18ab..aa189da84f 100644 --- a/ports/stm/peripherals/timers.c +++ b/ports/stm/peripherals/timers.c @@ -67,7 +67,7 @@ static size_t irq_map[] = { NULL_IRQ, #endif #ifdef TIM6 - #if !defined(DAC_BASE) || !defined(DAC1_BASE) + #if !defined(DAC_BASE) && !defined(DAC1_BASE) TIM6_IRQn, #else TIM6_DAC_IRQn, From bfcaa4b2b425626c1c4040a7e9bf67ef122d6687 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 16 Jul 2020 16:11:22 -0400 Subject: [PATCH 0313/1293] Made requested changes in displayio --- shared-bindings/displayio/Display.c | 2 +- shared-bindings/displayio/Group.c | 16 ++++++++-------- shared-bindings/displayio/TileGrid.c | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 8d5fa87184..4534babca6 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -395,7 +395,7 @@ const mp_obj_property_t displayio_display_rotation_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| bus: displayio = ... +//| bus: Union[ParallelBus, FourWire, I2CDisplay] = ... //| """The bus being used by the display""" //| //| diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index 02915da644..1176db5634 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -190,7 +190,7 @@ const mp_obj_property_t displayio_group_y_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def append(self, layer: layer) -> None: +//| def append(self, layer: Union[vectorio.Shape, Group, TileGrid]) -> None: //| """Append a layer to the group. It will be drawn above other layers.""" //| ... //| @@ -201,7 +201,7 @@ STATIC mp_obj_t displayio_group_obj_append(mp_obj_t self_in, mp_obj_t layer) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_append_obj, displayio_group_obj_append); -//| def insert(self, index: int, layer: layer) -> None: +//| def insert(self, index: int, layer: Union[vectorio.Shape, Group, TileGrid]) -> None: //| """Insert a layer into the group.""" //| ... //| @@ -214,7 +214,7 @@ STATIC mp_obj_t displayio_group_obj_insert(mp_obj_t self_in, mp_obj_t index_obj, MP_DEFINE_CONST_FUN_OBJ_3(displayio_group_insert_obj, displayio_group_obj_insert); -//| def index(self, layer: layer) -> int: +//| def index(self, layer: Union[vectorio.Shape, Group, TileGrid]) -> int: //| """Returns the index of the first copy of layer. Raises ValueError if not found.""" //| ... //| @@ -228,7 +228,7 @@ STATIC mp_obj_t displayio_group_obj_index(mp_obj_t self_in, mp_obj_t layer) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_index_obj, displayio_group_obj_index); -//| def pop(self, i: int = -1) -> group: +//| def pop(self, i: int = -1) -> Union[vectorio.Shape, Group, TileGrid]: //| """Remove the ith item and return it.""" //| ... //| @@ -251,7 +251,7 @@ STATIC mp_obj_t displayio_group_obj_pop(size_t n_args, const mp_obj_t *pos_args, MP_DEFINE_CONST_FUN_OBJ_KW(displayio_group_pop_obj, 1, displayio_group_obj_pop); -//| def remove(self, layer: layer) -> None: +//| def remove(self, layer: Union[vectorio.Shape, Group, TileGrid]) -> None: //| """Remove the first copy of layer. Raises ValueError if it is not present.""" //| ... //| @@ -280,7 +280,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -//| def __getitem__(self, index: int) -> group: +//| def __getitem__(self, index: int) -> Union[vectorio.Shape, Group, TileGrid]: //| """Returns the value at the given index. //| //| This allows you to:: @@ -288,7 +288,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { //| print(group[0])""" //| ... //| -//| def __setitem__(self, index: int, value: group) -> None: +//| def __setitem__(self, index: int, value: Union[vectorio.Shape, Group, TileGrid]) -> None: //| """Sets the value at the given index. //| //| This allows you to:: @@ -296,7 +296,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { //| group[0] = sprite""" //| ... //| -//| def __delitem__(self, index: int) -> group: +//| def __delitem__(self, index: int) -> None: //| """Deletes the value at the given index. //| //| This allows you to:: diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c index 348fcb4484..c17d984db0 100644 --- a/shared-bindings/displayio/TileGrid.c +++ b/shared-bindings/displayio/TileGrid.c @@ -289,7 +289,7 @@ const mp_obj_property_t displayio_tilegrid_transpose_xy_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| pixel_shader: pixel_shader = ... +//| pixel_shader: Union[ColorConverter, Palette] = ... //| """The pixel shader of the tilegrid.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_pixel_shader(mp_obj_t self_in) { From dc6902a33e33384e60ef825deac4fa1d9642a3b2 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 16 Jul 2020 17:11:24 -0400 Subject: [PATCH 0314/1293] Exclude timers from H7 builds --- ports/stm/peripherals/timers.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ports/stm/peripherals/timers.c b/ports/stm/peripherals/timers.c index aa189da84f..7950d8a57b 100644 --- a/ports/stm/peripherals/timers.c +++ b/ports/stm/peripherals/timers.c @@ -34,6 +34,8 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" +#if !(CPY_STM32H7) + #define ALL_CLOCKS 0xFFFF #define NULL_IRQ 0xFF @@ -193,7 +195,9 @@ TIM_TypeDef * stm_peripherals_find_timer(void) { // If no results are found, no unclaimed pins with this timer are in this package, // and it is safe to pick if (timer_in_package == false && mcu_tim_banks[i] != NULL) { + // DEBUG: print the timer return mcu_tim_banks[i]; + mp_printf(&mp_plat_print, "Timer: %d\n",i); } } //TODO: secondary search for timers outside the pins in the board profile @@ -201,6 +205,8 @@ TIM_TypeDef * stm_peripherals_find_timer(void) { // Work backwards - higher index timers have fewer pin allocations for (size_t i = (MP_ARRAY_SIZE(mcu_tim_banks) - 1); i >= 0; i--) { if ((!stm_timer_reserved[i]) && (mcu_tim_banks[i] != NULL)) { + // DEBUG: print the timer + mp_printf(&mp_plat_print, "Timer: %d\n",i); return mcu_tim_banks[i]; } } @@ -449,3 +455,5 @@ void TIM17_IRQHandler(void) { callback_router(17); } #endif + +#endif From 6494bbdc64f1633b5935c8b314139c19945328ba Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 16 Jul 2020 23:14:49 -0400 Subject: [PATCH 0315/1293] snapshot --- devices/ble_hci/common-hal/_bleio/Adapter.c | 9 +- .../common-hal/_bleio/Characteristic.c | 10 +- devices/ble_hci/common-hal/_bleio/UUID.c | 58 ++---- devices/ble_hci/common-hal/_bleio/UUID.h | 12 +- devices/ble_hci/common-hal/_bleio/hci_api.c | 165 ++++++++++-------- devices/ble_hci/common-hal/_bleio/hci_api.h | 1 + ports/nrf/common-hal/_bleio/UUID.c | 2 +- shared-bindings/_bleio/UUID.h | 2 +- 8 files changed, 131 insertions(+), 128 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index 92eb42ee0f..17b66899a5 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -633,7 +633,12 @@ void common_hal_bleio_adapter_stop_advertising(bleio_adapter_obj_t *self) { self->now_advertising = false; self->extended_advertising = false; self->circuitpython_advertising = false; - check_hci_error(hci_le_set_advertising_enable(BT_HCI_LE_ADV_DISABLE)); + int result = hci_le_set_advertising_enable(BT_HCI_LE_ADV_DISABLE); + // OK if we're already stopped. + if (result != BT_HCI_ERR_CMD_DISALLOWED) { + check_hci_error(result); + } + //TODO startup CircuitPython advertising again. } @@ -704,4 +709,6 @@ void bleio_adapter_background(bleio_adapter_obj_t* adapter) { adapter->advertising_timeout_msecs = 0; common_hal_bleio_adapter_stop_advertising(adapter); } + + hci_poll_for_incoming_pkt(); } diff --git a/devices/ble_hci/common-hal/_bleio/Characteristic.c b/devices/ble_hci/common-hal/_bleio/Characteristic.c index ff08bf15c4..74cbede0eb 100644 --- a/devices/ble_hci/common-hal/_bleio/Characteristic.c +++ b/devices/ble_hci/common-hal/_bleio/Characteristic.c @@ -91,12 +91,10 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, self->write_perm = write_perm; self->descriptor_list = NULL; - //FIX - // const mp_int_t max_length_max = fixed_length ? BLE_GATTS_FIX_ATTR_LEN_MAX : BLE_GATTS_VAR_ATTR_LEN_MAX; - // if (max_length < 0 || max_length > max_length_max) { - // mp_raise_ValueError_varg(translate("max_length must be 0-%d when fixed_length is %s"), - // max_length_max, fixed_length ? "True" : "False"); - // } + const mp_int_t max_length_max = 512; + if (max_length < 0 || max_length > max_length_max) { + mp_raise_ValueError(translate("max_length must be <= 512")); + } self->max_length = max_length; self->fixed_length = fixed_length; diff --git a/devices/ble_hci/common-hal/_bleio/UUID.c b/devices/ble_hci/common-hal/_bleio/UUID.c index 3f5fbe4fe4..d86878e472 100644 --- a/devices/ble_hci/common-hal/_bleio/UUID.c +++ b/devices/ble_hci/common-hal/_bleio/UUID.c @@ -36,55 +36,35 @@ // If uuid128 is NULL, this is a Bluetooth SIG 16-bit UUID. // If uuid128 is not NULL, it's a 128-bit (16-byte) UUID, with bytes 12 and 13 zero'd out, where // the 16-bit part goes. Those 16 bits are passed in uuid16. -void common_hal_bleio_uuid_construct(bleio_uuid_obj_t *self, uint32_t uuid16, const uint8_t uuid128[]) { - //FIX self->nrf_ble_uuid.uuid = uuid16; - // if (uuid128 == NULL) { - // self->nrf_ble_uuid.type = BLE_UUID_TYPE_BLE; - // } else { - // ble_uuid128_t vs_uuid; - // memcpy(vs_uuid.uuid128, uuid128, sizeof(vs_uuid.uuid128)); - - // // Register this vendor-specific UUID. Bytes 12 and 13 will be zero. - // check_nrf_error(sd_ble_uuid_vs_add(&vs_uuid, &self->nrf_ble_uuid.type)); - // vm_used_ble = true; - // } +void common_hal_bleio_uuid_construct(bleio_uuid_obj_t *self, uint32_t uuid16, const uint8_t uuid128[16]) { + self->size = uuid128 == NULL ? 16 : 128; + self->uuid16 = uuid16; + if (uuid128) { + memcpy(self->uuid128, uuid128, 16); + self->uuid128[12] = uuid16 & 0xff; + self->uuid128[13] = uuid16 >> 8; + } else { + memset(self->uuid128, 0, 16); + } } uint32_t common_hal_bleio_uuid_get_size(bleio_uuid_obj_t *self) { - //FIX return self->nrf_ble_uuid.type == BLE_UUID_TYPE_BLE ? 16 : 128; - return 0; + return self->size; } uint32_t common_hal_bleio_uuid_get_uuid16(bleio_uuid_obj_t *self) { - //FIX return self->nrf_ble_uuid.uuid; - return 0; + return self->uuid16; } void common_hal_bleio_uuid_get_uuid128(bleio_uuid_obj_t *self, uint8_t uuid128[16]) { - //FIX uint8_t length; - //FIX check_nrf_error(sd_ble_uuid_encode(&self->nrf_ble_uuid, &length, uuid128)); + memcpy(uuid128, self->uuid128, 16); } void common_hal_bleio_uuid_pack_into(bleio_uuid_obj_t *self, uint8_t* buf) { - //FIX if (self->nrf_ble_uuid.type == BLE_UUID_TYPE_BLE) { - // buf[0] = self->nrf_ble_uuid.uuid & 0xff; - // buf[1] = self->nrf_ble_uuid.uuid >> 8; - // } else { - // common_hal_bleio_uuid_get_uuid128(self, buf); - // } + if (self->size == 16) { + buf[0] = self->uuid16 & 0xff; + buf[1] = self->uuid16 >> 8; + } else { + common_hal_bleio_uuid_get_uuid128(self, buf); + } } - -//FIX -// void bleio_uuid_construct_from_nrf_ble_uuid(bleio_uuid_obj_t *self, ble_uuid_t *nrf_ble_uuid) { -// if (nrf_ble_uuid->type == BLE_UUID_TYPE_UNKNOWN) { -// mp_raise_bleio_BluetoothError(translate("Unexpected nrfx uuid type")); -// } -// self->nrf_ble_uuid.uuid = nrf_ble_uuid->uuid; -// self->nrf_ble_uuid.type = nrf_ble_uuid->type; -// } - -// // Fill in a ble_uuid_t from my values. -// void bleio_uuid_convert_to_nrf_ble_uuid(bleio_uuid_obj_t *self, ble_uuid_t *nrf_ble_uuid) { -// nrf_ble_uuid->uuid = self->nrf_ble_uuid.uuid; -// nrf_ble_uuid->type = self->nrf_ble_uuid.type; -// } diff --git a/devices/ble_hci/common-hal/_bleio/UUID.h b/devices/ble_hci/common-hal/_bleio/UUID.h index 4a72d38acd..deaf76d5c6 100644 --- a/devices/ble_hci/common-hal/_bleio/UUID.h +++ b/devices/ble_hci/common-hal/_bleio/UUID.h @@ -33,15 +33,9 @@ typedef struct { mp_obj_base_t base; - //FIX Use the native way of storing UUID's: - // - ble_uuid_t.uuid is a 16-bit uuid. - // - ble_uuid_t.type is BLE_UUID_TYPE_BLE if it's a 16-bit Bluetooth SIG UUID. - // or is BLE_UUID_TYPE_VENDOR_BEGIN and higher, which indexes into a table of registered - // 128-bit UUIDs. - // ble_uuid_t nrf_ble_uuid; + uint8_t size; + uint16_t uuid16; + uint8_t uuid128[16]; } bleio_uuid_obj_t; -// void bleio_uuid_construct_from_nrf_ble_uuid(bleio_uuid_obj_t *self, ble_uuid_t *nrf_uuid); -// void bleio_uuid_convert_to_nrf_ble_uuid(bleio_uuid_obj_t *self, ble_uuid_t *nrf_uuid); - #endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_UUID_H diff --git a/devices/ble_hci/common-hal/_bleio/hci_api.c b/devices/ble_hci/common-hal/_bleio/hci_api.c index ece06f169f..8155bca56e 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_api.c +++ b/devices/ble_hci/common-hal/_bleio/hci_api.c @@ -25,6 +25,7 @@ #include "supervisor/shared/tick.h" #include "shared-bindings/_bleio/__init__.h" #include "common-hal/_bleio/Adapter.h" +#include "shared-bindings/microcontroller/__init__.h" // HCI H4 protocol packet types: first byte in the packet. #define H4_CMD 0x01 @@ -61,44 +62,61 @@ STATIC uint8_t* cmd_response_data; //FIX STATIC uint8_t acl_pkt_buffer[ACL_PKT_BUFFER_SIZE]; +STATIC volatile bool hci_poll_in_progress = false; + STATIC bool debug = true; // These are the headers of the full packets that are sent over the serial interface. // They all have a one-byte type-field at the front, one of the H4_xxx packet types. typedef struct __attribute__ ((packed)) { - uint8_t pkt_type; - uint16_t opcode; - uint8_t param_len; -} h4_hci_cmd_hdr_t; + uint8_t pkt_type; + uint16_t opcode; + uint8_t param_len; + uint8_t params[]; +} h4_hci_cmd_pkt_t; + +#define ACLDATA_PB_FIRST_NON_FLUSH 0 +#define ACLDATA_HCI_PB_MIDDLE 1 +#define ACLDATA_PB_FIRST_FLUSH 2 +#define ACLDATA_PB_FULL 3 typedef struct __attribute__ ((packed)) { uint8_t pkt_type; - uint16_t handle; - uint16_t total_data_len; - uint16_t acl_data_len; - uint16_t cid; -} h4_hci_acl_hdr_t; + uint16_t handle : 12; + uint8_t pb: 2; // Packet boundary flag: ACLDATA_PB values. + uint8_t bc: 2; // Broadcast flag: always 0b00 for BLE. + uint16_t data_len; // Total data length, including acl_data header. + uint8_t data[]; // Data following the header +} h4_hci_acl_pkt_t; + +// L2CAP data, which is in h4_hci_acl_pkt_t.data +typedef struct __attribute__ ((packed)) { + uint16_t l2cap_data_len; // Length of acl_data. Does not include this header. + uint16_t cid; // Channel ID. + uint8_t l2cap_data[]; +} l2cap_data_t; + typedef struct __attribute__ ((packed)) { uint8_t pkt_type; uint8_t evt; uint8_t param_len; -} h4_hci_evt_hdr_t; + uint8_t params[]; +} h4_hci_evt_pkt_t; STATIC void dump_cmd_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { if (debug) { - h4_hci_cmd_hdr_t *pkt = (h4_hci_cmd_hdr_t *) pkt_data; + h4_hci_cmd_pkt_t *pkt = (h4_hci_cmd_pkt_t *) pkt_data; mp_printf(&mp_plat_print, "%s HCI COMMAND (%x) opcode: %04x, len: %d, data: ", tx ? "TX->" : "RX<-", pkt->pkt_type, pkt->opcode, pkt->param_len); - uint8_t i; - for (i = sizeof(h4_hci_cmd_hdr_t); i < pkt_len; i++) { - mp_printf(&mp_plat_print, "%02x ", pkt_data[i]); + for (size_t i = 0; i < pkt->param_len; i++) { + mp_printf(&mp_plat_print, "%02x ", pkt->params[i]); } - if (i != pkt->param_len + sizeof(h4_hci_cmd_hdr_t)) { + if (pkt_len != sizeof(h4_hci_cmd_pkt_t) + pkt->param_len) { mp_printf(&mp_plat_print, " LENGTH MISMATCH"); } mp_printf(&mp_plat_print, "\n"); @@ -107,16 +125,16 @@ STATIC void dump_cmd_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { STATIC void dump_acl_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { if (debug) { - h4_hci_acl_hdr_t *pkt = (h4_hci_acl_hdr_t *) pkt_data; + h4_hci_acl_pkt_t *pkt = (h4_hci_acl_pkt_t *) pkt_data; + l2cap_data_t *l2cap = (l2cap_data_t *) pkt->data; mp_printf(&mp_plat_print, - "%s HCI ACLDATA (%x) handle: %04x, total_data_len: %d, acl_data_len: %d, cid: %04x, data: ", + "%s HCI ACLDATA (%x) handle: %04x, pb: %d, bc: %d, data_len: %d, l2cap_data_len: %d, cid: %04x, l2cap_data: ", tx ? "TX->" : "RX<-", - pkt->pkt_type, pkt->handle, pkt->total_data_len, pkt->acl_data_len, pkt->cid); - uint8_t i; - for (i = sizeof(h4_hci_acl_hdr_t); i < pkt_len; i++) { - mp_printf(&mp_plat_print, "%02x ", pkt_data[i]); + pkt->pkt_type, pkt->handle, pkt->data_len, l2cap->l2cap_data_len, l2cap->cid); + for (size_t i = 0; i < l2cap->l2cap_data_len; i++) { + mp_printf(&mp_plat_print, "%02x ", l2cap->l2cap_data[i]); } - if (i != pkt->acl_data_len + sizeof(h4_hci_acl_hdr_t)) { + if (pkt_len != sizeof(h4_hci_acl_pkt_t) + pkt->data_len) { mp_printf(&mp_plat_print, " LENGTH MISMATCH"); } mp_printf(&mp_plat_print, "\n"); @@ -125,16 +143,15 @@ STATIC void dump_acl_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { STATIC void dump_evt_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { if (debug) { - h4_hci_evt_hdr_t *pkt = (h4_hci_evt_hdr_t *) pkt_data; + h4_hci_evt_pkt_t *pkt = (h4_hci_evt_pkt_t *) pkt_data; mp_printf(&mp_plat_print, "%s HCI EVENT (%x) evt: %02x, param_len: %d, data: ", tx ? "TX->" : "RX<-", pkt->pkt_type, pkt->evt, pkt->param_len); - uint8_t i; - for (i = sizeof(h4_hci_evt_hdr_t); i < pkt_len; i++) { - mp_printf(&mp_plat_print, "%02x ", pkt_data[i]); + for (size_t i = 0; i < pkt->param_len; i++) { + mp_printf(&mp_plat_print, "%02x ", pkt->params[i]); } - if (i != pkt->param_len + sizeof(h4_hci_evt_hdr_t)) { + if (pkt_len != sizeof(h4_hci_evt_pkt_t) + pkt->param_len) { mp_printf(&mp_plat_print, " LENGTH MISMATCH"); } mp_printf(&mp_plat_print, "\n"); @@ -143,7 +160,7 @@ STATIC void dump_evt_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { STATIC void process_acl_data_pkt(uint8_t pkt_len, uint8_t pkt_data[]) { //FIX pkt_len is +1 than before, because it includes the pkt_type. - // h4_hci_acl_hdr_t *aclHdr = (h4_hci_acl_hdr_t*)pkt_data; + // h4_hci_acl_pkt_t *aclHdr = (h4_hci_acl_pkt_t*)pkt_data; // uint16_t aclFlags = (aclHdr->handle & 0xf000) >> 12; @@ -202,15 +219,14 @@ STATIC void process_num_comp_pkts(uint16_t handle, uint16_t num_pkts) { } } -STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt[]) +STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt_data[]) { - h4_hci_evt_hdr_t *evt_hdr = (h4_hci_evt_hdr_t*) pkt; - // The data itself, after the header. - uint8_t *evt_data = pkt + sizeof(h4_hci_evt_hdr_t); + h4_hci_evt_pkt_t *pkt = (h4_hci_evt_pkt_t*) pkt_data; - switch (evt_hdr->evt) { + switch (pkt->evt) { case BT_HCI_EVT_DISCONN_COMPLETE: { - struct bt_hci_evt_disconn_complete *disconn_complete = (struct bt_hci_evt_disconn_complete*) evt_data; + struct bt_hci_evt_disconn_complete *disconn_complete = + (struct bt_hci_evt_disconn_complete*) pkt->params; (void) disconn_complete; //FIX // ATT.removeConnection(disconn_complete->handle, disconn_complete->reason); @@ -226,7 +242,7 @@ STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt[]) struct bt_hci_evt_cc_status cc_status; } __packed; - struct cmd_complete_with_status *evt = (struct cmd_complete_with_status *) evt_data; + struct cmd_complete_with_status *evt = (struct cmd_complete_with_status *) pkt->params; num_command_packets_allowed = evt->cmd_complete.ncmd; @@ -235,15 +251,15 @@ STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt[]) cmd_response_status = evt->cc_status.status; // All the bytes following cmd_complete, -including- the status byte, which is // included in all the _bt_hci_rp_* structs. - cmd_response_data = &evt_data[sizeof_field(struct cmd_complete_with_status, cmd_complete)]; + cmd_response_data = (uint8_t *) &evt->cc_status; // Includes status byte. - cmd_response_len = evt_hdr->param_len - sizeof_field(struct cmd_complete_with_status, cmd_complete); + cmd_response_len = pkt->param_len - sizeof_field(struct cmd_complete_with_status, cmd_complete); break; } case BT_HCI_EVT_CMD_STATUS: { - struct bt_hci_evt_cmd_status *evt = (struct bt_hci_evt_cmd_status *) evt_data; + struct bt_hci_evt_cmd_status *evt = (struct bt_hci_evt_cmd_status *) pkt->params; num_command_packets_allowed = evt->ncmd; @@ -257,7 +273,8 @@ STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt[]) } case BT_HCI_EVT_NUM_COMPLETED_PACKETS: { - struct bt_hci_evt_num_completed_packets *evt = (struct bt_hci_evt_num_completed_packets *) evt_data; + struct bt_hci_evt_num_completed_packets *evt = + (struct bt_hci_evt_num_completed_packets *) pkt->params; // Start at zero-th pair: (conn handle, num completed packets). struct bt_hci_handle_count *handle_and_count = &(evt->h[0]); @@ -269,15 +286,14 @@ STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt[]) } case BT_HCI_EVT_LE_META_EVENT: { - struct bt_hci_evt_le_meta_event *meta_evt = (struct bt_hci_evt_le_meta_event *) evt_data; - // Start of the encapsulated LE event. - uint8_t *le_evt = evt_data + sizeof (struct bt_hci_evt_le_meta_event); + struct bt_hci_evt_le_meta_event *meta_evt = (struct bt_hci_evt_le_meta_event *) pkt->params; + uint8_t *le_evt = pkt->params + sizeof (struct bt_hci_evt_le_meta_event); if (meta_evt->subevent == BT_HCI_EVT_LE_CONN_COMPLETE) { struct bt_hci_evt_le_conn_complete *le_conn_complete = (struct bt_hci_evt_le_conn_complete *) le_evt; - if (le_conn_complete->status == 0x00) { + if (le_conn_complete->status == BT_HCI_ERR_SUCCESS) { // ATT.addConnection(le_conn_complete->handle, // le_conn_complete->role, // le_conn_complete->peer_addr //FIX struct @@ -286,13 +302,6 @@ STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt[]) // le_conn_complete->supv_timeout // le_conn_complete->clock_accuracy); - // L2CAPSignaling.addConnection(le_conn_complete->handle, - // le_conn_complete->role, - // le_conn_complete->peer_addr, //FIX struct - // le_conn_complete->interval, - // le_conn_complete->latency, - // le_conn_complete->supv_timeout, - // le_conn_complete->clock_accuracy); } } else if (meta_evt->subevent == BT_HCI_EVT_LE_ADVERTISING_REPORT) { struct bt_hci_evt_le_advertising_info *le_advertising_info = @@ -319,9 +328,19 @@ STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt[]) void hci_init(void) { rx_idx = 0; pending_pkt = 0; + hci_poll_in_progress = false; } hci_result_t hci_poll_for_incoming_pkt(void) { + if (hci_poll_in_progress) { + return HCI_OK; + } + common_hal_mcu_disable_interrupts(); + if (!hci_poll_in_progress) { + hci_poll_in_progress = true; + } + common_hal_mcu_enable_interrupts(); + // Assert RTS low to say we're ready to read data. common_hal_digitalio_digitalinout_set_value(adapter->rts_digitalinout, false); @@ -332,21 +351,22 @@ hci_result_t hci_poll_for_incoming_pkt(void) { while (common_hal_busio_uart_rx_characters_available(adapter->hci_uart)) { common_hal_busio_uart_read(adapter->hci_uart, rx_buffer + rx_idx, 1, &errcode); if (errcode) { + hci_poll_in_progress = false; return HCI_READ_ERROR; } rx_idx++; switch (rx_buffer[0]) { case H4_ACL: - if (rx_idx > sizeof(h4_hci_acl_hdr_t) && - rx_idx >= sizeof(h4_hci_acl_hdr_t) + ((h4_hci_acl_hdr_t *) rx_buffer)->total_data_len) { + if (rx_idx > sizeof(h4_hci_acl_pkt_t) && + rx_idx >= sizeof(h4_hci_acl_pkt_t) + ((h4_hci_acl_pkt_t *) rx_buffer)->data_len) { packet_is_complete = true; } break; case H4_EVT: - if (rx_idx > sizeof(h4_hci_evt_hdr_t) && - rx_idx >= sizeof(h4_hci_evt_hdr_t) + ((h4_hci_evt_hdr_t *) rx_buffer)->param_len) { + if (rx_idx > sizeof(h4_hci_evt_pkt_t) && + rx_idx >= sizeof(h4_hci_evt_pkt_t) + ((h4_hci_evt_pkt_t *) rx_buffer)->param_len) { packet_is_complete = true; } break; @@ -359,6 +379,7 @@ hci_result_t hci_poll_for_incoming_pkt(void) { } if (!packet_is_complete) { + hci_poll_in_progress = false; return HCI_OK; } @@ -391,6 +412,7 @@ hci_result_t hci_poll_for_incoming_pkt(void) { common_hal_digitalio_digitalinout_set_value(adapter->rts_digitalinout, true); + hci_poll_in_progress = false; return HCI_OK; } @@ -416,22 +438,22 @@ STATIC hci_result_t write_pkt(uint8_t *buffer, size_t len) { } STATIC hci_result_t send_command(uint16_t opcode, uint8_t params_len, void* params) { - uint8_t tx_buffer[sizeof(h4_hci_cmd_hdr_t) + params_len]; + uint8_t cmd_pkt_len = sizeof(h4_hci_cmd_pkt_t) + params_len; + uint8_t tx_buffer[cmd_pkt_len]; // cmd header is at the beginning of tx_buffer - h4_hci_cmd_hdr_t *cmd_hdr = (h4_hci_cmd_hdr_t *) tx_buffer; - cmd_hdr->pkt_type = H4_CMD; - cmd_hdr->opcode = opcode; - cmd_hdr->param_len = params_len; + h4_hci_cmd_pkt_t *cmd_pkt = (h4_hci_cmd_pkt_t *) tx_buffer; + cmd_pkt->pkt_type = H4_CMD; + cmd_pkt->opcode = opcode; + cmd_pkt->param_len = params_len; - // Copy the params data into the space after the header. - memcpy(&tx_buffer[sizeof(h4_hci_cmd_hdr_t)], params, params_len); + memcpy(cmd_pkt->params, params, params_len); if (debug) { dump_cmd_pkt(true, sizeof(tx_buffer), tx_buffer); } - int result = write_pkt(tx_buffer, sizeof(h4_hci_cmd_hdr_t) + params_len); + int result = write_pkt(tx_buffer, cmd_pkt_len); if (result != HCI_OK) { return result; } @@ -477,19 +499,20 @@ STATIC int __attribute__((unused)) send_acl_pkt(uint16_t handle, uint8_t cid, vo } // data_len does not include cid. - const size_t cid_len = sizeof_field(h4_hci_acl_hdr_t, cid); + const size_t cid_len = sizeof_field(l2cap_data_t, cid); // buf_len is size of entire packet including header. - const size_t buf_len = sizeof(h4_hci_acl_hdr_t) + cid_len + data_len; + const size_t buf_len = sizeof(h4_hci_acl_pkt_t) + cid_len + data_len; uint8_t tx_buffer[buf_len]; - h4_hci_acl_hdr_t *acl_hdr = (h4_hci_acl_hdr_t *) tx_buffer; - acl_hdr->pkt_type = H4_ACL; - acl_hdr->handle = handle; - acl_hdr->total_data_len = (uint8_t)(cid_len + data_len); - acl_hdr->acl_data_len = (uint8_t) data_len; - acl_hdr->cid = cid; + h4_hci_acl_pkt_t *acl_pkt = (h4_hci_acl_pkt_t *) tx_buffer; + l2cap_data_t *l2cap = (l2cap_data_t *) acl_pkt->data; + acl_pkt->pkt_type = H4_ACL; + acl_pkt->handle = handle; + acl_pkt->data_len = (uint8_t)(cid_len + data_len); + l2cap->l2cap_data_len = (uint8_t) data_len; + l2cap->cid = cid; - memcpy(&tx_buffer[sizeof(h4_hci_acl_hdr_t)], data, data_len); + memcpy(&tx_buffer[sizeof(h4_hci_acl_pkt_t)], data, data_len); if (debug) { dump_acl_pkt(true, buf_len, tx_buffer); diff --git a/devices/ble_hci/common-hal/_bleio/hci_api.h b/devices/ble_hci/common-hal/_bleio/hci_api.h index 3e53a37752..f6d96d48fe 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_api.h +++ b/devices/ble_hci/common-hal/_bleio/hci_api.h @@ -23,6 +23,7 @@ #include #include "common-hal/_bleio/hci_include/hci.h" +#include "common-hal/_bleio/hci_include/hci_err.h" // Incomplete forward declaration to get around mutually-dependent include files. typedef struct _bleio_adapter_obj_t bleio_adapter_obj_t; diff --git a/ports/nrf/common-hal/_bleio/UUID.c b/ports/nrf/common-hal/_bleio/UUID.c index 6a3d643050..f80352ccb6 100644 --- a/ports/nrf/common-hal/_bleio/UUID.c +++ b/ports/nrf/common-hal/_bleio/UUID.c @@ -40,7 +40,7 @@ // If uuid128 is NULL, this is a Bluetooth SIG 16-bit UUID. // If uuid128 is not NULL, it's a 128-bit (16-byte) UUID, with bytes 12 and 13 zero'd out, where // the 16-bit part goes. Those 16 bits are passed in uuid16. -void common_hal_bleio_uuid_construct(bleio_uuid_obj_t *self, uint32_t uuid16, const uint8_t uuid128[]) { +void common_hal_bleio_uuid_construct(bleio_uuid_obj_t *self, uint32_t uuid16, const uint8_t uuid128[16]) { self->nrf_ble_uuid.uuid = uuid16; if (uuid128 == NULL) { self->nrf_ble_uuid.type = BLE_UUID_TYPE_BLE; diff --git a/shared-bindings/_bleio/UUID.h b/shared-bindings/_bleio/UUID.h index 1490737a71..178b0ca965 100644 --- a/shared-bindings/_bleio/UUID.h +++ b/shared-bindings/_bleio/UUID.h @@ -34,7 +34,7 @@ void bleio_uuid_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t extern const mp_obj_type_t bleio_uuid_type; -extern void common_hal_bleio_uuid_construct(bleio_uuid_obj_t *self, mp_int_t uuid16, const uint8_t uuid128[]); +extern void common_hal_bleio_uuid_construct(bleio_uuid_obj_t *self, mp_int_t uuid16, const uint8_t uuid128[16]); extern uint32_t common_hal_bleio_uuid_get_uuid16(bleio_uuid_obj_t *self); extern bool common_hal_bleio_uuid_get_uuid128(bleio_uuid_obj_t *self, uint8_t uuid128[16]); extern uint32_t common_hal_bleio_uuid_get_size(bleio_uuid_obj_t *self); From a18a39210919a886d4efb4c52b85a309b3403abf Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 17 Jul 2020 08:36:26 -0500 Subject: [PATCH 0316/1293] background_callback: Add gc collect callback A background callback must never outlive its related object. By collecting the head of the linked list of background tasks, this will not happen. One hypothetical case where this could happen is if an MP3Decoder is deleted while its callback to fill its buffer is scheduled. --- main.c | 2 ++ supervisor/background_callback.h | 5 +++++ supervisor/shared/background_callback.c | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/main.c b/main.c index ce95de95f0..f928d0d62f 100755 --- a/main.c +++ b/main.c @@ -493,6 +493,8 @@ void gc_collect(void) { // have lost their references in the VM even though they are mounted. gc_collect_root((void**)&MP_STATE_VM(vfs_mount_table), sizeof(mp_vfs_mount_t) / sizeof(mp_uint_t)); + background_callback_gc_collect(); + #if CIRCUITPY_DISPLAYIO displayio_gc_collect(); #endif diff --git a/supervisor/background_callback.h b/supervisor/background_callback.h index 82025f6b7a..535dd656be 100644 --- a/supervisor/background_callback.h +++ b/supervisor/background_callback.h @@ -79,4 +79,9 @@ void background_callback_reset(void); void background_callback_begin_critical_section(void); void background_callback_end_critical_section(void); +/* + * Background callbacks may stop objects from being collected + */ +void background_callback_gc_collect(void); + #endif diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c index e45c9b5c3d..1be3cae2ba 100644 --- a/supervisor/shared/background_callback.c +++ b/supervisor/shared/background_callback.c @@ -24,6 +24,7 @@ * THE SOFTWARE. */ +#include "py/gc.h" #include "py/mpconfig.h" #include "supervisor/background_callback.h" #include "supervisor/shared/tick.h" @@ -105,3 +106,8 @@ void background_callback_reset() { in_background_callback = false; CALLBACK_CRITICAL_END; } + +void background_callback_gc_collect(void) { + background_callback_t *cb = (background_callback_t*)callback_head; + gc_collect_ptr(cb); +} From d64b4e305929ccb68e0cf1ef977f42e213023f3b Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 17 Jul 2020 14:53:51 -0400 Subject: [PATCH 0317/1293] Made more requested changes --- shared-bindings/fontio/BuiltinFont.c | 2 +- shared-bindings/framebufferio/FramebufferDisplay.c | 4 ++-- shared-bindings/gnss/GNSS.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/fontio/BuiltinFont.c b/shared-bindings/fontio/BuiltinFont.c index 9e2f81c475..5eaae624ea 100644 --- a/shared-bindings/fontio/BuiltinFont.c +++ b/shared-bindings/fontio/BuiltinFont.c @@ -46,7 +46,7 @@ //| ... //| -//| bitmap: bitmap = ... +//| bitmap: displayio.Bitmap = ... //| """Bitmap containing all font glyphs starting with ASCII and followed by unicode. Use //| `get_glyph` in most cases. This is useful for use with `displayio.TileGrid` and //| `terminalio.Terminal`.""" diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index 737e0696f8..d687e3e95b 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -47,7 +47,7 @@ //| objects in CircuitPython, Display objects live until `displayio.release_displays()` //| is called. This is done so that CircuitPython can use the display itself.""" //| -//| def __init__(self, framebuffer: framebuffer, *, rotation: int = 0, auto_refresh: bool = True) -> None: +//| def __init__(self, framebuffer: rgbmatrix.RGBMatrix, *, rotation: int = 0, auto_refresh: bool = True) -> None: //| """Create a Display object with the given framebuffer (a buffer, array, ulab.array, etc) //| //| :param framebuffer: The framebuffer that the display is connected to @@ -299,7 +299,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_rotation_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| framebuffer: framebuffer = ... +//| framebuffer: rgbmatrix.RGBMatrix = ... //| """The framebuffer being used by the display""" //| //| diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c index 0ecc1ac6a1..41c3a80143 100644 --- a/shared-bindings/gnss/GNSS.c +++ b/shared-bindings/gnss/GNSS.c @@ -190,7 +190,7 @@ const mp_obj_property_t gnss_timestamp_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| fix: string = ... +//| fix: gnss.PositionFix = ... //| """Fix mode.""" //| STATIC mp_obj_t gnss_obj_get_fix(mp_obj_t self_in) { From 6912d31560a617a134fcadbfdc1800a259f5e465 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 17 Jul 2020 14:32:05 -0500 Subject: [PATCH 0318/1293] uchip: reclaim some flash space --- ports/atmel-samd/boards/uchip/mpconfigboard.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index 90b5600dcb..196068a1e0 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -9,3 +9,10 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 + +# Tweak inlining depending on language. +ifeq ($(TRANSLATION), zh_Latn_pinyin) +CFLAGS_INLINE_LIMIT = 45 +else +CFLAGS_INLINE_LIMIT = 70 +endif From 98eef79faaa36adbdd0b074c712aad5df7ef37a0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 17 Jul 2020 14:55:46 -0500 Subject: [PATCH 0319/1293] background_callback_gc_collect: We must traverse the whole list --- supervisor/shared/background_callback.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c index 1be3cae2ba..d10579c4f9 100644 --- a/supervisor/shared/background_callback.c +++ b/supervisor/shared/background_callback.c @@ -108,6 +108,23 @@ void background_callback_reset() { } void background_callback_gc_collect(void) { + // We don't enter the callback critical section here. We rely on + // gc_collect_ptr _NOT_ entering background callbacks, so it is not + // possible for the list to be cleared. + // + // However, it is possible for the list to be extended. We make the + // minor assumption that no newly added callback is for a + // collectable object. That is, we only plug the hole where an + // object becomes collectable AFTER it is added but before the + // callback is run, not the hole where an object was ALREADY + // collectable but adds a background task for itself. + // + // It's necessary to traverse the whole list here, as the callbacks + // themselves can be in non-gc memory, and some of the cb->data + // objects themselves might be in non-gc memory. background_callback_t *cb = (background_callback_t*)callback_head; - gc_collect_ptr(cb); + while(cb) { + gc_collect_ptr(cb->data); + cb = cb->next; + } } From 207369ec0978f87ceb5e57f42d30ae10025e5bc7 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 17 Jul 2020 17:28:23 -0400 Subject: [PATCH 0320/1293] Add boilerplate, create basic PWMOut test --- ports/esp32s2/common-hal/pulseio/PWMOut.c | 120 ++++++++++++++++++++ ports/esp32s2/common-hal/pulseio/PWMOut.h | 43 +++++++ ports/esp32s2/common-hal/pulseio/PulseIn.c | 75 ++++++++++++ ports/esp32s2/common-hal/pulseio/PulseIn.h | 53 +++++++++ ports/esp32s2/common-hal/pulseio/PulseOut.c | 60 ++++++++++ ports/esp32s2/common-hal/pulseio/PulseOut.h | 42 +++++++ ports/esp32s2/common-hal/pulseio/__init__.c | 1 + ports/esp32s2/mpconfigport.mk | 2 +- 8 files changed, 395 insertions(+), 1 deletion(-) create mode 100644 ports/esp32s2/common-hal/pulseio/PWMOut.c create mode 100644 ports/esp32s2/common-hal/pulseio/PWMOut.h create mode 100644 ports/esp32s2/common-hal/pulseio/PulseIn.c create mode 100644 ports/esp32s2/common-hal/pulseio/PulseIn.h create mode 100644 ports/esp32s2/common-hal/pulseio/PulseOut.c create mode 100644 ports/esp32s2/common-hal/pulseio/PulseOut.h create mode 100644 ports/esp32s2/common-hal/pulseio/__init__.c diff --git a/ports/esp32s2/common-hal/pulseio/PWMOut.c b/ports/esp32s2/common-hal/pulseio/PWMOut.c new file mode 100644 index 0000000000..8f96433c06 --- /dev/null +++ b/ports/esp32s2/common-hal/pulseio/PWMOut.c @@ -0,0 +1,120 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * Uses code from Micropython, Copyright (c) 2013-2016 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 "common-hal/pulseio/PWMOut.h" +#include "shared-bindings/pulseio/PWMOut.h" +#include "py/runtime.h" +#include "driver/ledc.h" + +#define LEDC_LS_TIMER LEDC_TIMER_1 +#define LEDC_LS_MODE LEDC_LOW_SPEED_MODE +#define LEDC_LS_CH0_GPIO (18) +#define LEDC_LS_CH0_CHANNEL LEDC_CHANNEL_0 +#define LEDC_LS_CH1_GPIO (19) +#define LEDC_LS_CH1_CHANNEL LEDC_CHANNEL_1 +#define LEDC_LS_CH2_GPIO (4) +#define LEDC_LS_CH2_CHANNEL LEDC_CHANNEL_2 +#define LEDC_LS_CH3_GPIO (5) +#define LEDC_LS_CH3_CHANNEL LEDC_CHANNEL_3 + +#define LEDC_TEST_CH_NUM (4) +#define LEDC_TEST_DUTY (4000) +#define LEDC_TEST_FADE_TIME (3000) + + + +void pwmout_reset(void) { +} + +pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, + const mcu_pin_obj_t* pin, + uint16_t duty, + uint32_t frequency, + bool variable_frequency) { + ledc_timer_config_t ledc_timer = { + .duty_resolution = LEDC_TIMER_16_BIT, // resolution of PWM duty + .freq_hz = frequency, // frequency of PWM signal + .speed_mode = LEDC_LS_MODE, // timer mode + .timer_num = LEDC_LS_TIMER, // timer index + .clk_cfg = LEDC_AUTO_CLK, // Auto select the source clock + }; + // Set configuration of timer0 for high speed channels + ledc_timer_config(&ledc_timer); + + ledc_channel_config_t pwm_channel = { + .channel = LEDC_LS_CH0_CHANNEL, + .duty = 0, + .gpio_num = pin->number, + .speed_mode = LEDC_LS_MODE, + .hpoint = 0, + .timer_sel = LEDC_LS_TIMER + }; + + // Set LED Controller with previously prepared configuration + for (ch = 0; ch < LEDC_TEST_CH_NUM; ch++) { + ledc_channel_config(&ledc_channel[ch]); + } + + for (ch = 0; ch < LEDC_TEST_CH_NUM; ch++) { + ledc_set_duty(ledc_channel[ch].speed_mode, ledc_channel[ch].channel, duty*2); + ledc_update_duty(ledc_channel[ch].speed_mode, ledc_channel[ch].channel); + } + + return PWMOUT_OK; +} + +void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) { +} + +void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) { +} + +bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t* self) { + return false; +} + +void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { +} + +void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty) { +} + +uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) { + return false; +} + +void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_t frequency) { +} + +uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) { + return false; +} + +bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t* self) { + return false; +} diff --git a/ports/esp32s2/common-hal/pulseio/PWMOut.h b/ports/esp32s2/common-hal/pulseio/PWMOut.h new file mode 100644 index 0000000000..28484e9238 --- /dev/null +++ b/ports/esp32s2/common-hal/pulseio/PWMOut.h @@ -0,0 +1,43 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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_ESP32S2_COMMON_HAL_PULSEIO_PWMOUT_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PWMOUT_H + +#include "common-hal/microcontroller/Pin.h" + +typedef struct { + mp_obj_base_t base; + uint8_t channel; + bool variable_frequency: 1; + uint16_t duty_cycle; + uint32_t frequency; + uint32_t period; +} pulseio_pwmout_obj_t; + +void pwmout_reset(void); + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PWMOUT_H diff --git a/ports/esp32s2/common-hal/pulseio/PulseIn.c b/ports/esp32s2/common-hal/pulseio/PulseIn.c new file mode 100644 index 0000000000..65fc6631d4 --- /dev/null +++ b/ports/esp32s2/common-hal/pulseio/PulseIn.c @@ -0,0 +1,75 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland 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 "common-hal/pulseio/PulseIn.h" +#include "py/runtime.h" + +// STATIC void pulsein_handler(uint8_t num) { +// } + +void pulsein_reset(void) { +} + +void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu_pin_obj_t* pin, + uint16_t maxlen, bool idle_state) { + mp_raise_NotImplementedError(translate("PulseIn not supported on this chip")); +} + +bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t* self) { + return false; +} + +void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) { +} + +void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t* self) { +} + +void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t* self, uint16_t trigger_duration) { +} + +void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t* self) { +} + +uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t* self, int16_t index) { + return false; +} + +uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { + return false; +} + +uint16_t common_hal_pulseio_pulsein_get_maxlen(pulseio_pulsein_obj_t* self) { + return false; +} + +bool common_hal_pulseio_pulsein_get_paused(pulseio_pulsein_obj_t* self) { + return false; +} + +uint16_t common_hal_pulseio_pulsein_get_len(pulseio_pulsein_obj_t* self) { + return false; +} diff --git a/ports/esp32s2/common-hal/pulseio/PulseIn.h b/ports/esp32s2/common-hal/pulseio/PulseIn.h new file mode 100644 index 0000000000..b317c516c1 --- /dev/null +++ b/ports/esp32s2/common-hal/pulseio/PulseIn.h @@ -0,0 +1,53 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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_ESP32S2_COMMON_HAL_PULSEIO_PULSEIN_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEIN_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + + const mcu_pin_obj_t* pin; + bool idle_state; + bool paused; + volatile bool first_edge; + + uint16_t* buffer; + uint16_t maxlen; + + volatile uint16_t start; + volatile uint16_t len; + volatile uint32_t last_overflow; + volatile uint16_t last_count; +} pulseio_pulsein_obj_t; + +void pulsein_reset(void); + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEIN_H diff --git a/ports/esp32s2/common-hal/pulseio/PulseOut.c b/ports/esp32s2/common-hal/pulseio/PulseOut.c new file mode 100644 index 0000000000..c448c578df --- /dev/null +++ b/ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -0,0 +1,60 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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 "common-hal/pulseio/PulseOut.h" + +#include "shared-bindings/pulseio/PWMOut.h" +#include "py/runtime.h" + +// STATIC void turn_on(pulseio_pulseout_obj_t *pulseout) { +// } + +// STATIC void turn_off(pulseio_pulseout_obj_t *pulseout) { +// } + +// STATIC void start_timer(void) { +// } + +// STATIC void pulseout_event_handler(void) { +// } + +void pulseout_reset() { +} + +void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, + const pulseio_pwmout_obj_t* carrier) { + mp_raise_NotImplementedError(translate("PulseOut not supported on this chip")); +} + +bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t* self) { + return false; +} + +void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t* self) { +} + +void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t* self, uint16_t* pulses, uint16_t length) { +} diff --git a/ports/esp32s2/common-hal/pulseio/PulseOut.h b/ports/esp32s2/common-hal/pulseio/PulseOut.h new file mode 100644 index 0000000000..f465d00792 --- /dev/null +++ b/ports/esp32s2/common-hal/pulseio/PulseOut.h @@ -0,0 +1,42 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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_ESP32S2_COMMON_HAL_PULSEIO_PULSEOUT_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEOUT_H + +#include "common-hal/microcontroller/Pin.h" +#include "common-hal/pulseio/PWMOut.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + pulseio_pwmout_obj_t *pwmout; +} pulseio_pulseout_obj_t; + +void pulseout_reset(void); + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEOUT_H diff --git a/ports/esp32s2/common-hal/pulseio/__init__.c b/ports/esp32s2/common-hal/pulseio/__init__.c new file mode 100644 index 0000000000..2bee925bc7 --- /dev/null +++ b/ports/esp32s2/common-hal/pulseio/__init__.c @@ -0,0 +1 @@ +// No pulseio module functions. diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 5686579b45..fccb14dedf 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -25,7 +25,7 @@ CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_MICROCONTROLLER = 1 CIRCUITPY_NVM = 0 -CIRCUITPY_PULSEIO = 0 +CIRCUITPY_PULSEIO = 1 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_TOUCHIO = 0 From 1160635608ebeaf3868a327803c0ca248f549123 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 16 Jul 2020 19:02:26 -0700 Subject: [PATCH 0321/1293] Enable PYSTACK to keep function state out of the heap --- main.c | 8 ++++++++ py/circuitpy_mpconfig.h | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/main.c b/main.c index f928d0d62f..f1dfa63c6f 100755 --- a/main.c +++ b/main.c @@ -97,6 +97,10 @@ void do_str(const char *src, mp_parse_input_kind_t input_kind) { } } +#if MICROPY_ENABLE_PYSTACK +static size_t PLACE_IN_DTCM_BSS(_pystack)[CIRCUITPY_PYSTACK_SIZE / sizeof(size_t)]; +#endif + void start_mp(supervisor_allocation* heap) { reset_status_led(); autoreload_stop(); @@ -125,6 +129,10 @@ void start_mp(supervisor_allocation* heap) { // Clear the readline history. It references the heap we're about to destroy. readline_init0(); + #if MICROPY_ENABLE_PYSTACK + mp_pystack_init(_pystack, _pystack + sizeof(_pystack)); + #endif + #if MICROPY_ENABLE_GC gc_init(heap->ptr, heap->ptr + heap->length / 4); #endif diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index d05a246fce..a7853fabda 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -119,6 +119,7 @@ #define MICROPY_QSTR_BYTES_IN_HASH (1) #define MICROPY_REPL_AUTO_INDENT (1) #define MICROPY_REPL_EVENT_DRIVEN (0) +#define MICROPY_ENABLE_PYSTACK (1) #define MICROPY_STACK_CHECK (1) #define MICROPY_STREAMS_NON_BLOCK (1) #ifndef MICROPY_USE_INTERNAL_PRINTF @@ -785,6 +786,10 @@ void supervisor_run_background_tasks_if_tick(void); #define CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS 1000 #endif +#ifndef CIRCUITPY_PYSTACK_SIZE +#define CIRCUITPY_PYSTACK_SIZE 1024 +#endif + #define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt" #define CIRCUITPY_VERBOSE_BLE 0 From 4b157aa6b8d925cbf29ceeb96da3a455f3a77f3b Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 15 Jul 2020 17:59:11 -0700 Subject: [PATCH 0322/1293] Add find varients to bytearray --- py/objarray.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/py/objarray.c b/py/objarray.c index 7dfdc5b121..b868e62f92 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -400,6 +400,70 @@ STATIC mp_obj_t array_extend(mp_obj_t self_in, mp_obj_t arg_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_2(array_extend_obj, array_extend); #endif +#if MICROPY_PY_BUILTINS_BYTEARRAY +STATIC mp_obj_t buffer_finder(size_t n_args, const mp_obj_t *args, int direction, bool is_index) { + mp_check_self(MP_OBJ_IS_TYPE(args[0], &mp_type_bytearray)); + const mp_obj_type_t *self_type = mp_obj_get_type(args[0]); + + mp_buffer_info_t haystack_bufinfo; + mp_get_buffer_raise(args[0], &haystack_bufinfo, MP_BUFFER_READ); + + mp_buffer_info_t needle_bufinfo; + mp_get_buffer_raise(args[1], &needle_bufinfo, MP_BUFFER_READ); + + if (mp_binary_get_size('@', needle_bufinfo.typecode, NULL) != 1) { + const qstr src_name = mp_obj_get_type(args[1])->name; + nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError, + translate("'%q' object is not bytes-like"), + src_name)); + } + + const byte *start = haystack_bufinfo.buf; + const byte *end = haystack_bufinfo.buf + haystack_bufinfo.len; + if (n_args >= 3 && args[2] != mp_const_none) { + start += mp_get_index(self_type, haystack_bufinfo.len, args[2], true); + } + if (n_args >= 4 && args[3] != mp_const_none) { + end = haystack_bufinfo.buf + mp_get_index(self_type, haystack_bufinfo.len, args[3], true); + } + + const byte *p = NULL; + if (end >= start) { + p = find_subbytes(start, end - start, needle_bufinfo.buf, needle_bufinfo.len, direction); + } + + if (p == NULL) { + if (is_index) { + mp_raise_ValueError(translate("substring not found")); + } else { + return MP_OBJ_NEW_SMALL_INT(-1); + } + } + return MP_OBJ_NEW_SMALL_INT(p - (const byte*) haystack_bufinfo.buf); +} + +STATIC mp_obj_t buffer_find(size_t n_args, const mp_obj_t *args) { + return buffer_finder(n_args, args, 1, false); +} +MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(buffer_find_obj, 2, 4, buffer_find); + +STATIC mp_obj_t buffer_rfind(size_t n_args, const mp_obj_t *args) { + return buffer_finder(n_args, args, -1, false); +} +MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(buffer_rfind_obj, 2, 4, buffer_rfind); + +STATIC mp_obj_t buffer_index(size_t n_args, const mp_obj_t *args) { + return buffer_finder(n_args, args, 1, true); +} +MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(buffer_index_obj, 2, 4, buffer_index); + +STATIC mp_obj_t buffer_rindex(size_t n_args, const mp_obj_t *args) { + return buffer_finder(n_args, args, -1, true); +} +MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(buffer_rindex_obj, 2, 4, buffer_rindex); + +#endif + STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value) { if (value == MP_OBJ_NULL) { // delete item @@ -580,6 +644,12 @@ STATIC MP_DEFINE_CONST_DICT(array_locals_dict, array_locals_dict_table); STATIC const mp_rom_map_elem_t bytearray_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_append), MP_ROM_PTR(&array_append_obj) }, { MP_ROM_QSTR(MP_QSTR_extend), MP_ROM_PTR(&array_extend_obj) }, + + { MP_ROM_QSTR(MP_QSTR_find), MP_ROM_PTR(&buffer_find_obj) }, + { MP_ROM_QSTR(MP_QSTR_rfind), MP_ROM_PTR(&buffer_rfind_obj) }, + { MP_ROM_QSTR(MP_QSTR_index), MP_ROM_PTR(&buffer_index_obj) }, + { MP_ROM_QSTR(MP_QSTR_rindex), MP_ROM_PTR(&buffer_rindex_obj) }, + #if MICROPY_CPYTHON_COMPAT { MP_ROM_QSTR(MP_QSTR_decode), MP_ROM_PTR(&array_decode_obj) }, #endif From 384a7f7e70e68366f7a632a98aebbe21730888ba Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 15 Jul 2020 17:57:28 -0700 Subject: [PATCH 0323/1293] Move release note converter to latest markdown helper lib --- tools/convert_release_notes.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/tools/convert_release_notes.py b/tools/convert_release_notes.py index 4b16f005ec..797e71834b 100644 --- a/tools/convert_release_notes.py +++ b/tools/convert_release_notes.py @@ -4,13 +4,14 @@ import sys import mistune +import mistune.renderers print(sys.argv[1]) with open(sys.argv[1], "r") as source_file: source = source_file.read() -html = mistune.Markdown() +html = mistune.create_markdown() print() print("HTML") @@ -19,39 +20,39 @@ print("From the GitHub release page:\n
") print(html(source)) print("
") -class AdafruitBBCodeRenderer: - def __init__(self, **kwargs): - self.options = kwargs - +class AdafruitBBCodeRenderer(mistune.renderers.BaseRenderer): def placeholder(self): return '' def paragraph(self, text): return text + "\n\n" + def block_text(self, text): + return text + def text(self, text): return text def link(self, link, title, text): - return "[url={}]{}[/url]".format(link, text) + return "[url={}]{}[/url]".format(link, title) def autolink(self, link, is_email): if not is_email: return "[url={}]{}[/url]".format(link, link) return link - def header(self, text, level, raw): + def heading(self, text, level): return "[b][size=150]{}[/size][/b]\n".format(text) def codespan(self, text): return "[color=#E74C3C][size=95]{}[/size][/color]".format(text) - def list_item(self, text): + def list_item(self, text, level): return "[*]{}[/*]\n".format(text.strip()) - def list(self, body, ordered=True): + def list(self, text, ordered, level, start=None): ordered_indicator = "=" if ordered else "" - return "[list{}]\n{}[/list]".format(ordered_indicator, body) + return "[list{}]\n{}[/list]".format(ordered_indicator, text) def double_emphasis(self, text): return "[b]{}[/b]".format(text) @@ -59,7 +60,10 @@ class AdafruitBBCodeRenderer: def emphasis(self, text): return "[b]{}[/b]".format(text) -bbcode = mistune.Markdown(renderer=AdafruitBBCodeRenderer()) + def strong(self, text): + return "[i]{}[/i]".format(text) + +bbcode = mistune.create_markdown(renderer=AdafruitBBCodeRenderer()) print() print("BBCode") From 518d909b2c20aed5b3ff1ca849731cdadea4ba4c Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 15 Jul 2020 17:58:38 -0700 Subject: [PATCH 0324/1293] Add memorymonitor module --- py/circuitpy_defns.mk | 6 + py/circuitpy_mpconfig.h | 12 + py/circuitpy_mpconfig.mk | 3 + py/gc.c | 16 ++ .../memorymonitor/AllocationAlarm.c | 113 +++++++++ .../memorymonitor/AllocationAlarm.h | 38 +++ .../memorymonitor/AllocationSize.c | 222 ++++++++++++++++++ .../memorymonitor/AllocationSize.h | 42 ++++ shared-bindings/memorymonitor/__init__.c | 77 ++++++ shared-bindings/memorymonitor/__init__.h | 49 ++++ shared-module/memorymonitor/AllocationAlarm.c | 73 ++++++ shared-module/memorymonitor/AllocationAlarm.h | 49 ++++ shared-module/memorymonitor/AllocationSize.c | 87 +++++++ shared-module/memorymonitor/AllocationSize.h | 50 ++++ shared-module/memorymonitor/__init__.c | 34 +++ shared-module/memorymonitor/__init__.h | 34 +++ 16 files changed, 905 insertions(+) create mode 100644 shared-bindings/memorymonitor/AllocationAlarm.c create mode 100644 shared-bindings/memorymonitor/AllocationAlarm.h create mode 100644 shared-bindings/memorymonitor/AllocationSize.c create mode 100644 shared-bindings/memorymonitor/AllocationSize.h create mode 100644 shared-bindings/memorymonitor/__init__.c create mode 100644 shared-bindings/memorymonitor/__init__.h create mode 100644 shared-module/memorymonitor/AllocationAlarm.c create mode 100644 shared-module/memorymonitor/AllocationAlarm.h create mode 100644 shared-module/memorymonitor/AllocationSize.c create mode 100644 shared-module/memorymonitor/AllocationSize.h create mode 100644 shared-module/memorymonitor/__init__.c create mode 100644 shared-module/memorymonitor/__init__.h diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 815ee2e62b..a39e0c9ddf 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -174,6 +174,9 @@ endif ifeq ($(CIRCUITPY__EVE),1) SRC_PATTERNS += _eve/% endif +ifeq ($(CIRCUITPY_MEMORYMONITOR),1) +SRC_PATTERNS += memorymonitor/% +endif ifeq ($(CIRCUITPY_MICROCONTROLLER),1) SRC_PATTERNS += microcontroller/% endif @@ -398,6 +401,9 @@ SRC_SHARED_MODULE_ALL = \ gamepad/__init__.c \ gamepadshift/GamePadShift.c \ gamepadshift/__init__.c \ + memorymonitor/__init__.c \ + memorymonitor/AllocationAlarm.c \ + memorymonitor/AllocationSize.c \ network/__init__.c \ os/__init__.c \ random/__init__.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index d05a246fce..3c2df37ffc 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -429,6 +429,16 @@ extern const struct _mp_obj_module_t _eve_module; #define _EVE_MODULE #endif +#if CIRCUITPY_MEMORYMONITOR +extern const struct _mp_obj_module_t memorymonitor_module; +#define MEMORYMONITOR_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_memorymonitor), (mp_obj_t)&memorymonitor_module }, +#define MEMORYMONITOR_ROOT_POINTERS mp_obj_t active_allocationsizes; \ + mp_obj_t active_allocationalarms; +#else +#define MEMORYMONITOR_MODULE +#define MEMORYMONITOR_ROOT_POINTERS +#endif + #if CIRCUITPY_MICROCONTROLLER extern const struct _mp_obj_module_t microcontroller_module; #define MICROCONTROLLER_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_microcontroller), (mp_obj_t)µcontroller_module }, @@ -708,6 +718,7 @@ extern const struct _mp_obj_module_t watchdog_module; JSON_MODULE \ MATH_MODULE \ _EVE_MODULE \ + MEMORYMONITOR_MODULE \ MICROCONTROLLER_MODULE \ NEOPIXEL_WRITE_MODULE \ NETWORK_MODULE \ @@ -765,6 +776,7 @@ extern const struct _mp_obj_module_t watchdog_module; mp_obj_t terminal_tilegrid_tiles; \ BOARD_UART_ROOT_POINTER \ FLASH_ROOT_POINTERS \ + MEMORYMONITOR_ROOT_POINTERS \ NETWORK_ROOT_POINTERS \ void supervisor_run_background_tasks_if_tick(void); diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 2d4a5ecee9..baa29e26b4 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -118,6 +118,9 @@ CFLAGS += -DCIRCUITPY_MATH=$(CIRCUITPY_MATH) CIRCUITPY__EVE ?= 0 CFLAGS += -DCIRCUITPY__EVE=$(CIRCUITPY__EVE) +CIRCUITPY_MEMORYMONITOR ?= 0 +CFLAGS += -DCIRCUITPY_MEMORYMONITOR=$(CIRCUITPY_MEMORYMONITOR) + CIRCUITPY_MICROCONTROLLER ?= 1 CFLAGS += -DCIRCUITPY_MICROCONTROLLER=$(CIRCUITPY_MICROCONTROLLER) diff --git a/py/gc.c b/py/gc.c index 2f3f63522e..0f08ffb2e3 100755 --- a/py/gc.c +++ b/py/gc.c @@ -33,6 +33,10 @@ #include "supervisor/shared/safe_mode.h" +#if CIRCUITPY_MEMORYMONITOR +#include "shared-module/memorymonitor/AllocationSize.h" +#endif + #if MICROPY_ENABLE_GC #if MICROPY_DEBUG_VERBOSE // print debugging info @@ -653,6 +657,10 @@ void *gc_alloc(size_t n_bytes, bool has_finaliser, bool long_lived) { gc_dump_alloc_table(); #endif + #if CIRCUITPY_MEMORYMONITOR + memorymonitor_allocationsizes_track_allocation(end_block - start_block + 1); + #endif + return ret_ptr; } @@ -906,6 +914,10 @@ void *gc_realloc(void *ptr_in, size_t n_bytes, bool allow_move) { gc_log_change(block, new_blocks); #endif + #if CIRCUITPY_MEMORYMONITOR + memorymonitor_allocationsizes_track_allocation(new_blocks); + #endif + return ptr_in; } @@ -935,6 +947,10 @@ void *gc_realloc(void *ptr_in, size_t n_bytes, bool allow_move) { gc_log_change(block, new_blocks); #endif + #if CIRCUITPY_MEMORYMONITOR + memorymonitor_allocationsizes_track_allocation(new_blocks); + #endif + return ptr_in; } diff --git a/shared-bindings/memorymonitor/AllocationAlarm.c b/shared-bindings/memorymonitor/AllocationAlarm.c new file mode 100644 index 0000000000..836bf78333 --- /dev/null +++ b/shared-bindings/memorymonitor/AllocationAlarm.c @@ -0,0 +1,113 @@ +/* + * This file is part of the Micro Python 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 + +#include "py/objproperty.h" +#include "py/runtime.h" +#include "py/runtime0.h" +#include "shared-bindings/memorymonitor/AllocationAlarm.h" +#include "shared-bindings/util.h" +#include "supervisor/shared/translate.h" + +//| class AllocationAlarm: +//| +//| def __init__(self, *, minimum_block_count=1): +//| """Throw an exception when an allocation of ``minimum_block_count`` or more blocks +//| occurs while active. +//| +//| Track allocations:: +//| +//| import memorymonitor +//| +//| aa = memorymonitor.AllocationAlarm(minimum_block_count=2) +//| x = 2 +//| # Should not allocate any blocks. +//| with aa: +//| x = 5 +//| +//| # Should throw an exception when allocating storage for the 20 bytes. +//| with aa: +//| x = bytearray(20) +//| +//| """ +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationalarm_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_minimum_block_count }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_minimum_block_count, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + mp_int_t minimum_block_count = args[ARG_minimum_block_count].u_int; + if (minimum_block_count < 1) { + mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_minimum_block_count); + } + + memorymonitor_allocationalarm_obj_t *self = m_new_obj(memorymonitor_allocationalarm_obj_t); + self->base.type = &memorymonitor_allocationalarm_type; + + common_hal_memorymonitor_allocationalarm_construct(self, minimum_block_count); + + return MP_OBJ_FROM_PTR(self); +} + +//| def __enter__(self) -> memorymonitor.AllocationAlarm: +//| """Enables the alarm.""" +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationalarm_obj___enter__(mp_obj_t self_in) { + common_hal_memorymonitor_allocationalarm_resume(self_in); + return self_in; +} +MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationalarm___enter___obj, memorymonitor_allocationalarm_obj___enter__); + +//| def __exit__(self) -> None: +//| """Automatically disables the allocation alarm when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationalarm_obj___exit__(size_t n_args, const mp_obj_t *args) { + (void)n_args; + common_hal_memorymonitor_allocationalarm_pause(args[0]); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(memorymonitor_allocationalarm___exit___obj, 4, 4, memorymonitor_allocationalarm_obj___exit__); + +STATIC const mp_rom_map_elem_t memorymonitor_allocationalarm_locals_dict_table[] = { + // Methods + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&memorymonitor_allocationalarm___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&memorymonitor_allocationalarm___exit___obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(memorymonitor_allocationalarm_locals_dict, memorymonitor_allocationalarm_locals_dict_table); + +const mp_obj_type_t memorymonitor_allocationalarm_type = { + { &mp_type_type }, + .name = MP_QSTR_AllocationAlarm, + .make_new = memorymonitor_allocationalarm_make_new, + .locals_dict = (mp_obj_dict_t*)&memorymonitor_allocationalarm_locals_dict, +}; diff --git a/shared-bindings/memorymonitor/AllocationAlarm.h b/shared-bindings/memorymonitor/AllocationAlarm.h new file mode 100644 index 0000000000..40f5a48c5b --- /dev/null +++ b/shared-bindings/memorymonitor/AllocationAlarm.h @@ -0,0 +1,38 @@ +/* + * This file is part of the Micro Python 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONALARM_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONALARM_H + +#include "shared-module/memorymonitor/AllocationAlarm.h" + +extern const mp_obj_type_t memorymonitor_allocationalarm_type; + +void common_hal_memorymonitor_allocationalarm_construct(memorymonitor_allocationalarm_obj_t* self, size_t minimum_block_count); +void common_hal_memorymonitor_allocationalarm_pause(memorymonitor_allocationalarm_obj_t* self); +void common_hal_memorymonitor_allocationalarm_resume(memorymonitor_allocationalarm_obj_t* self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONALARM_H diff --git a/shared-bindings/memorymonitor/AllocationSize.c b/shared-bindings/memorymonitor/AllocationSize.c new file mode 100644 index 0000000000..411e27e157 --- /dev/null +++ b/shared-bindings/memorymonitor/AllocationSize.c @@ -0,0 +1,222 @@ +/* + * This file is part of the Micro Python 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 + +#include "py/objproperty.h" +#include "py/runtime.h" +#include "py/runtime0.h" +#include "shared-bindings/memorymonitor/AllocationSize.h" +#include "shared-bindings/util.h" +#include "supervisor/shared/translate.h" + +//| class AllocationSize: +//| +//| def __init__(self): +//| """Tracks the number of allocations in power of two buckets. +//| +//| It will have 32 16bit buckets to track allocation counts. It is total allocations +//| meaning frees are ignored. Reallocated memory is counted twice, at allocation and when +//| reallocated with the larger size. +//| +//| The buckets are measured in terms of blocks which is the finest granularity of the heap. +//| This means bucket 0 will count all allocations less than or equal to the number of bytes +//| per block, typically 16. Bucket 2 will be less than or equal to 4 blocks. See +//| `bytes_per_block` to convert blocks to bytes. +//| +//| Multiple AllocationSizes can be used to track different boundaries. +//| +//| Active AllocationSizes will not be freed so make sure and pause before deleting. +//| +//| Track allocations:: +//| +//| import memorymonitor +//| +//| mm = memorymonitor.AllocationSizes() +//| print("hello world" * 3) +//| mm.pause() +//| for bucket in mm: +//| print("<", 2 ** bucket, mm[bucket]) +//| +//| # Clear the buckets +//| mm.clear() +//| +//| # Resume allocation tracking +//| mm.resume()""" +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationsize_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + memorymonitor_allocationsize_obj_t *self = m_new_obj(memorymonitor_allocationsize_obj_t); + self->base.type = &memorymonitor_allocationsize_type; + + common_hal_memorymonitor_allocationsize_construct(self); + + return MP_OBJ_FROM_PTR(self); +} + +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationsize_obj___enter__(mp_obj_t self_in) { + common_hal_memorymonitor_allocationsize_resume(self_in); + return self_in; +} +MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationsize___enter___obj, memorymonitor_allocationsize_obj___enter__); + +//| def __exit__(self, ) -> Any: +//| """Automatically pauses allocation tracking when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationsize_obj___exit__(size_t n_args, const mp_obj_t *args) { + (void)n_args; + common_hal_memorymonitor_allocationsize_pause(args[0]); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(memorymonitor_allocationsize___exit___obj, 4, 4, memorymonitor_allocationsize_obj___exit__); + +//| def pause(self) -> None: +//| """Pause allocation tracking""" +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationsize_obj_pause(mp_obj_t self_in) { + memorymonitor_allocationsize_obj_t *self = MP_OBJ_TO_PTR(self_in); + + common_hal_memorymonitor_allocationsize_pause(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationsize_pause_obj, memorymonitor_allocationsize_obj_pause); + +//| def resume(self) -> None: +//| """Resumes allocation tracking.""" +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationsize_obj_resume(mp_obj_t self_in) { + common_hal_memorymonitor_allocationsize_resume(self_in); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationsize_resume_obj, memorymonitor_allocationsize_obj_resume); + +//| def clear(self) -> Any: +//| """Clears all captured pulses""" +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationsize_obj_clear(mp_obj_t self_in) { + memorymonitor_allocationsize_obj_t *self = MP_OBJ_TO_PTR(self_in); + + common_hal_memorymonitor_allocationsize_clear(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationsize_clear_obj, memorymonitor_allocationsize_obj_clear); + + +//| bytes_per_block: int = ... +//| """Number of bytes per block""" +//| +STATIC mp_obj_t memorymonitor_allocationsize_obj_get_bytes_per_block(mp_obj_t self_in) { + memorymonitor_allocationsize_obj_t *self = MP_OBJ_TO_PTR(self_in); + + return mp_obj_new_bool(common_hal_memorymonitor_allocationsize_get_bytes_per_block(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationsize_get_bytes_per_block_obj, memorymonitor_allocationsize_obj_get_bytes_per_block); + +const mp_obj_property_t memorymonitor_allocationsize_bytes_per_block_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&memorymonitor_allocationsize_get_bytes_per_block_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| def __len__(self, ) -> Any: +//| """Returns the current pulse length +//| +//| This allows you to:: +//| +//| pulses = pulseio.PulseIn(pin) +//| print(len(pulses))""" +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationsize_unary_op(mp_unary_op_t op, mp_obj_t self_in) { + memorymonitor_allocationsize_obj_t *self = MP_OBJ_TO_PTR(self_in); + uint16_t len = common_hal_memorymonitor_allocationsize_get_len(self); + switch (op) { + case MP_UNARY_OP_BOOL: return mp_obj_new_bool(len != 0); + case MP_UNARY_OP_LEN: return MP_OBJ_NEW_SMALL_INT(len); + default: return MP_OBJ_NULL; // op not supported + } +} + +//| def __getitem__(self, index: Any) -> Any: +//| """Returns the value at the given index or values in slice. +//| +//| This allows you to:: +//| +//| pulses = pulseio.PulseIn(pin) +//| print(pulses[0])""" +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationsize_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t value) { + if (value == mp_const_none) { + // delete item + mp_raise_AttributeError(translate("Cannot delete values")); + } else { + memorymonitor_allocationsize_obj_t *self = MP_OBJ_TO_PTR(self_in); + + if (MP_OBJ_IS_TYPE(index_obj, &mp_type_slice)) { + mp_raise_NotImplementedError(translate("Slices not supported")); + } else { + size_t index = mp_get_index(&memorymonitor_allocationsize_type, common_hal_memorymonitor_allocationsize_get_len(self), index_obj, false); + if (value == MP_OBJ_SENTINEL) { + // load + return MP_OBJ_NEW_SMALL_INT(common_hal_memorymonitor_allocationsize_get_item(self, index)); + } else { + mp_raise_AttributeError(translate("Read-only")); + } + } + } + return mp_const_none; +} + +STATIC const mp_rom_map_elem_t memorymonitor_allocationsize_locals_dict_table[] = { + // Methods + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&memorymonitor_allocationsize___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&memorymonitor_allocationsize___exit___obj) }, + + // Properties + { MP_ROM_QSTR(MP_QSTR_bytes_per_block), MP_ROM_PTR(&memorymonitor_allocationsize_bytes_per_block_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(memorymonitor_allocationsize_locals_dict, memorymonitor_allocationsize_locals_dict_table); + +const mp_obj_type_t memorymonitor_allocationsize_type = { + { &mp_type_type }, + .name = MP_QSTR_AllocationSize, + .make_new = memorymonitor_allocationsize_make_new, + .subscr = memorymonitor_allocationsize_subscr, + .unary_op = memorymonitor_allocationsize_unary_op, + .getiter = mp_obj_new_generic_iterator, + .locals_dict = (mp_obj_dict_t*)&memorymonitor_allocationsize_locals_dict, +}; diff --git a/shared-bindings/memorymonitor/AllocationSize.h b/shared-bindings/memorymonitor/AllocationSize.h new file mode 100644 index 0000000000..bcd9514bf2 --- /dev/null +++ b/shared-bindings/memorymonitor/AllocationSize.h @@ -0,0 +1,42 @@ +/* + * This file is part of the Micro Python 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONSIZE_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONSIZE_H + +#include "shared-module/memorymonitor/AllocationSize.h" + +extern const mp_obj_type_t memorymonitor_allocationsize_type; + +extern void common_hal_memorymonitor_allocationsize_construct(memorymonitor_allocationsize_obj_t* self); +extern void common_hal_memorymonitor_allocationsize_pause(memorymonitor_allocationsize_obj_t* self); +extern void common_hal_memorymonitor_allocationsize_resume(memorymonitor_allocationsize_obj_t* self); +extern void common_hal_memorymonitor_allocationsize_clear(memorymonitor_allocationsize_obj_t* self); +extern size_t common_hal_memorymonitor_allocationsize_get_bytes_per_block(memorymonitor_allocationsize_obj_t* self); +extern uint16_t common_hal_memorymonitor_allocationsize_get_len(memorymonitor_allocationsize_obj_t* self); +extern uint16_t common_hal_memorymonitor_allocationsize_get_item(memorymonitor_allocationsize_obj_t* self, int16_t index); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONSIZE_H diff --git a/shared-bindings/memorymonitor/__init__.c b/shared-bindings/memorymonitor/__init__.c new file mode 100644 index 0000000000..bfd5bf6d83 --- /dev/null +++ b/shared-bindings/memorymonitor/__init__.c @@ -0,0 +1,77 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft + * + * 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 "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/memorymonitor/__init__.h" +#include "shared-bindings/memorymonitor/AllocationAlarm.h" +#include "shared-bindings/memorymonitor/AllocationSize.h" + +//| """Memory monitoring helpers""" +//| + +//| class AllocationException: +//| def __init__(self, Exception: Any): +//| """Catch all exception for Bluetooth related errors.""" +//| ... +MP_DEFINE_MEMORYMONITOR_EXCEPTION(AllocationError, Exception) + +NORETURN void mp_raise_memorymonitor_AllocationError(const compressed_string_t* fmt, ...) { + va_list argptr; + va_start(argptr,fmt); + mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_memorymonitor_AllocationError, fmt, argptr); + va_end(argptr); + nlr_raise(exception); +} + +STATIC const mp_rom_map_elem_t memorymonitor_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_memorymonitor) }, + { MP_ROM_QSTR(MP_QSTR_AllocationAlarm), MP_ROM_PTR(&memorymonitor_allocationalarm_type) }, + { MP_ROM_QSTR(MP_QSTR_AllocationSize), MP_ROM_PTR(&memorymonitor_allocationsize_type) }, + + // Errors + { MP_ROM_QSTR(MP_QSTR_AllocationError), MP_ROM_PTR(&mp_type_memorymonitor_AllocationError) }, +}; + +STATIC MP_DEFINE_CONST_DICT(memorymonitor_module_globals, memorymonitor_module_globals_table); + +void memorymonitor_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) { + mp_print_kind_t k = kind & ~PRINT_EXC_SUBCLASS; + bool is_subclass = kind & PRINT_EXC_SUBCLASS; + if (!is_subclass && (k == PRINT_EXC)) { + mp_print_str(print, qstr_str(MP_OBJ_QSTR_VALUE(memorymonitor_module_globals_table[0].value))); + mp_print_str(print, "."); + } + mp_obj_exception_print(print, o_in, kind); +} + +const mp_obj_module_t memorymonitor_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&memorymonitor_module_globals, +}; diff --git a/shared-bindings/memorymonitor/__init__.h b/shared-bindings/memorymonitor/__init__.h new file mode 100644 index 0000000000..60fcdc3f62 --- /dev/null +++ b/shared-bindings/memorymonitor/__init__.h @@ -0,0 +1,49 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * 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_MEMORYMONITOR___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR___INIT___H + +#include "py/obj.h" + + +void memorymonitor_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind); + +#define MP_DEFINE_MEMORYMONITOR_EXCEPTION(exc_name, base_name) \ +const mp_obj_type_t mp_type_memorymonitor_ ## exc_name = { \ + { &mp_type_type }, \ + .name = MP_QSTR_ ## exc_name, \ + .print = memorymonitor_exception_print, \ + .make_new = mp_obj_exception_make_new, \ + .attr = mp_obj_exception_attr, \ + .parent = &mp_type_ ## base_name, \ +}; + +extern const mp_obj_type_t mp_type_memorymonitor_AllocationError; + +NORETURN void mp_raise_memorymonitor_AllocationError(const compressed_string_t* msg, ...); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR___INIT___H diff --git a/shared-module/memorymonitor/AllocationAlarm.c b/shared-module/memorymonitor/AllocationAlarm.c new file mode 100644 index 0000000000..bbd33f2b04 --- /dev/null +++ b/shared-module/memorymonitor/AllocationAlarm.c @@ -0,0 +1,73 @@ +/* + * This file is part of the Micro Python 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 "shared-bindings/memorymonitor/__init__.h" +#include "shared-bindings/memorymonitor/AllocationAlarm.h" + +#include "py/gc.h" +#include "py/mpstate.h" +#include "py/runtime.h" + +void common_hal_memorymonitor_allocationalarm_construct(memorymonitor_allocationalarm_obj_t* self, size_t minimum_block_count) { + self->minimum_block_count = minimum_block_count; + self->next = NULL; + self->previous = NULL; +} + +void common_hal_memorymonitor_allocationalarm_pause(memorymonitor_allocationalarm_obj_t* self) { + *self->previous = self->next; + self->next = NULL; + self->previous = NULL; +} + +void common_hal_memorymonitor_allocationalarm_resume(memorymonitor_allocationalarm_obj_t* self) { + if (self->previous != NULL) { + mp_raise_RuntimeError(translate("Already running")); + } + self->next = MP_STATE_VM(active_allocationalarms); + self->previous = (memorymonitor_allocationalarm_obj_t**) &MP_STATE_VM(active_allocationalarms); + if (self->next != NULL) { + self->next->previous = &self->next; + } + MP_STATE_VM(active_allocationalarms) = self; +} + +void memorymonitor_allocationalarms_allocation(size_t block_count) { + memorymonitor_allocationalarm_obj_t* alarm = MP_OBJ_TO_PTR(MP_STATE_VM(active_allocationalarms)); + size_t alert_count = 0; + while (alarm != NULL) { + // Hold onto next in case we remove the alarm from the list. + memorymonitor_allocationalarm_obj_t* next = alarm->next; + if (block_count >= alarm->minimum_block_count) { + common_hal_memorymonitor_allocationalarm_pause(alarm); + alert_count++; + } + alarm = next; + } + if (alert_count > 0) { + mp_raise_memorymonitor_AllocationError(translate("Attempt to allocate %d blocks"), block_count); + } +} diff --git a/shared-module/memorymonitor/AllocationAlarm.h b/shared-module/memorymonitor/AllocationAlarm.h new file mode 100644 index 0000000000..ebdc0d8015 --- /dev/null +++ b/shared-module/memorymonitor/AllocationAlarm.h @@ -0,0 +1,49 @@ +/* + * This file is part of the Micro Python 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONALARM_H +#define MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONALARM_H + +#include +#include + +#include "py/obj.h" + +typedef struct _memorymonitor_allocationalarm_obj_t memorymonitor_allocationalarm_obj_t; + +#define ALLOCATION_SIZE_BUCKETS 16 + +typedef struct _memorymonitor_allocationalarm_obj_t { + mp_obj_base_t base; + size_t minimum_block_count; + // Store the location that points to us so we can remove ourselves. + memorymonitor_allocationalarm_obj_t** previous; + memorymonitor_allocationalarm_obj_t* next; +} memorymonitor_allocationalarm_obj_t; + +void memorymonitor_allocationalarms_allocation(size_t block_count); + +#endif // MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONALARM_H diff --git a/shared-module/memorymonitor/AllocationSize.c b/shared-module/memorymonitor/AllocationSize.c new file mode 100644 index 0000000000..fb11471fd4 --- /dev/null +++ b/shared-module/memorymonitor/AllocationSize.c @@ -0,0 +1,87 @@ +/* + * This file is part of the Micro Python 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 "shared-bindings/memorymonitor/AllocationSize.h" + +#include "py/gc.h" +#include "py/mpstate.h" +#include "py/runtime.h" + +void common_hal_memorymonitor_allocationsize_construct(memorymonitor_allocationsize_obj_t* self) { + common_hal_memorymonitor_allocationsize_clear(self); + self->next = NULL; + self->previous = NULL; +} + +void common_hal_memorymonitor_allocationsize_pause(memorymonitor_allocationsize_obj_t* self) { + *self->previous = self->next; + self->next = NULL; + self->previous = NULL; +} + +void common_hal_memorymonitor_allocationsize_resume(memorymonitor_allocationsize_obj_t* self) { + if (self->previous != NULL) { + mp_raise_RuntimeError(translate("Already running")); + } + self->next = MP_STATE_VM(active_allocationsizes); + self->previous = (memorymonitor_allocationsize_obj_t**) &MP_STATE_VM(active_allocationsizes); + if (self->next != NULL) { + self->next->previous = &self->next; + } + MP_STATE_VM(active_allocationsizes) = self; +} + +void common_hal_memorymonitor_allocationsize_clear(memorymonitor_allocationsize_obj_t* self) { + for (size_t i = 0; i < ALLOCATION_SIZE_BUCKETS; i++) { + self->buckets[i] = 0; + } +} + +uint16_t common_hal_memorymonitor_allocationsize_get_len(memorymonitor_allocationsize_obj_t* self) { + return ALLOCATION_SIZE_BUCKETS; +} + +size_t common_hal_memorymonitor_allocationsize_get_bytes_per_block(memorymonitor_allocationsize_obj_t* self) { + return BYTES_PER_BLOCK; +} + +uint16_t common_hal_memorymonitor_allocationsize_get_item(memorymonitor_allocationsize_obj_t* self, int16_t index) { + return self->buckets[index]; +} + +void memorymonitor_allocationsizes_track_allocation(size_t block_count) { + memorymonitor_allocationsize_obj_t* as = MP_OBJ_TO_PTR(MP_STATE_VM(active_allocationsizes)); + size_t power_of_two = 0; + block_count >>= 1; + while (block_count != 0) { + power_of_two++; + block_count >>= 1; + } + while (as != NULL) { + as->buckets[power_of_two]++; + as = as->next; + } +} diff --git a/shared-module/memorymonitor/AllocationSize.h b/shared-module/memorymonitor/AllocationSize.h new file mode 100644 index 0000000000..3fa4e04652 --- /dev/null +++ b/shared-module/memorymonitor/AllocationSize.h @@ -0,0 +1,50 @@ +/* + * This file is part of the Micro Python 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONSIZE_H +#define MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONSIZE_H + +#include +#include + +#include "py/obj.h" + +typedef struct _memorymonitor_allocationsize_obj_t memorymonitor_allocationsize_obj_t; + +#define ALLOCATION_SIZE_BUCKETS 16 + +typedef struct _memorymonitor_allocationsize_obj_t { + mp_obj_base_t base; + uint16_t buckets[ALLOCATION_SIZE_BUCKETS]; + // Store the location that points to us so we can remove ourselves. + memorymonitor_allocationsize_obj_t** previous; + memorymonitor_allocationsize_obj_t* next; + bool paused; +} memorymonitor_allocationsize_obj_t; + +void memorymonitor_allocationsizes_track_allocation(size_t block_count); + +#endif // MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONSIZE_H diff --git a/shared-module/memorymonitor/__init__.c b/shared-module/memorymonitor/__init__.c new file mode 100644 index 0000000000..4c24c25879 --- /dev/null +++ b/shared-module/memorymonitor/__init__.c @@ -0,0 +1,34 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft + * + * 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-module/memorymonitor/__init__.h" +#include "shared-module/memorymonitor/AllocationAlarm.h" +#include "shared-module/memorymonitor/AllocationSize.h" + +void memorymonitor_track_allocation(size_t block_count) { + memorymonitor_allocationalarms_allocation(block_count); + memorymonitor_allocationsizes_track_allocation(block_count); +} diff --git a/shared-module/memorymonitor/__init__.h b/shared-module/memorymonitor/__init__.h new file mode 100644 index 0000000000..cf76f88f86 --- /dev/null +++ b/shared-module/memorymonitor/__init__.h @@ -0,0 +1,34 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 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 MICROPY_INCLUDED_MEMORYMONITOR___INIT___H +#define MICROPY_INCLUDED_MEMORYMONITOR___INIT___H + +#include + +void memorymonitor_track_allocation(size_t block_count); + +#endif // MICROPY_INCLUDED_MEMORYMONITOR___INIT___H From a1e4814a27713bd08b836cbae2afa9c858bfd4e4 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 16 Jul 2020 19:01:43 -0700 Subject: [PATCH 0325/1293] Get AllocationAlarm working --- main.c | 7 ++++ py/gc.c | 8 ++-- .../memorymonitor/AllocationAlarm.c | 2 + .../memorymonitor/AllocationSize.c | 38 +------------------ shared-module/memorymonitor/AllocationAlarm.c | 13 +++++++ shared-module/memorymonitor/AllocationAlarm.h | 1 + shared-module/memorymonitor/AllocationSize.c | 4 ++ shared-module/memorymonitor/AllocationSize.h | 1 + shared-module/memorymonitor/__init__.c | 5 +++ shared-module/memorymonitor/__init__.h | 1 + 10 files changed, 40 insertions(+), 40 deletions(-) diff --git a/main.c b/main.c index f928d0d62f..5ad146c9ce 100755 --- a/main.c +++ b/main.c @@ -64,6 +64,10 @@ #include "shared-module/displayio/__init__.h" #endif +#if CIRCUITPY_MEMORYMONITOR +#include "shared-module/memorymonitor/__init__.h" +#endif + #if CIRCUITPY_NETWORK #include "shared-module/network/__init__.h" #endif @@ -198,6 +202,9 @@ void cleanup_after_vm(supervisor_allocation* heap) { #if CIRCUITPY_DISPLAYIO reset_displays(); #endif + #if CIRCUITPY_MEMORYMONITOR + memorymonitor_reset(); + #endif filesystem_flush(); stop_mp(); free_memory(heap); diff --git a/py/gc.c b/py/gc.c index 0f08ffb2e3..69327060f7 100755 --- a/py/gc.c +++ b/py/gc.c @@ -34,7 +34,7 @@ #include "supervisor/shared/safe_mode.h" #if CIRCUITPY_MEMORYMONITOR -#include "shared-module/memorymonitor/AllocationSize.h" +#include "shared-module/memorymonitor/__init__.h" #endif #if MICROPY_ENABLE_GC @@ -658,7 +658,7 @@ void *gc_alloc(size_t n_bytes, bool has_finaliser, bool long_lived) { #endif #if CIRCUITPY_MEMORYMONITOR - memorymonitor_allocationsizes_track_allocation(end_block - start_block + 1); + memorymonitor_track_allocation(end_block - start_block + 1); #endif return ret_ptr; @@ -915,7 +915,7 @@ void *gc_realloc(void *ptr_in, size_t n_bytes, bool allow_move) { #endif #if CIRCUITPY_MEMORYMONITOR - memorymonitor_allocationsizes_track_allocation(new_blocks); + memorymonitor_track_allocation(new_blocks); #endif return ptr_in; @@ -948,7 +948,7 @@ void *gc_realloc(void *ptr_in, size_t n_bytes, bool allow_move) { #endif #if CIRCUITPY_MEMORYMONITOR - memorymonitor_allocationsizes_track_allocation(new_blocks); + memorymonitor_track_allocation(new_blocks); #endif return ptr_in; diff --git a/shared-bindings/memorymonitor/AllocationAlarm.c b/shared-bindings/memorymonitor/AllocationAlarm.c index 836bf78333..71a156f328 100644 --- a/shared-bindings/memorymonitor/AllocationAlarm.c +++ b/shared-bindings/memorymonitor/AllocationAlarm.c @@ -76,6 +76,8 @@ STATIC mp_obj_t memorymonitor_allocationalarm_make_new(const mp_obj_type_t *type return MP_OBJ_FROM_PTR(self); } +// TODO: Add .countdown(count) to skip allocations and alarm on something after the first. + //| def __enter__(self) -> memorymonitor.AllocationAlarm: //| """Enables the alarm.""" //| ... diff --git a/shared-bindings/memorymonitor/AllocationSize.c b/shared-bindings/memorymonitor/AllocationSize.c index 411e27e157..25ecae97b8 100644 --- a/shared-bindings/memorymonitor/AllocationSize.c +++ b/shared-bindings/memorymonitor/AllocationSize.c @@ -82,6 +82,7 @@ STATIC mp_obj_t memorymonitor_allocationsize_make_new(const mp_obj_type_t *type, //| ... //| STATIC mp_obj_t memorymonitor_allocationsize_obj___enter__(mp_obj_t self_in) { + common_hal_memorymonitor_allocationsize_clear(self_in); common_hal_memorymonitor_allocationsize_resume(self_in); return self_in; } @@ -99,48 +100,13 @@ STATIC mp_obj_t memorymonitor_allocationsize_obj___exit__(size_t n_args, const m } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(memorymonitor_allocationsize___exit___obj, 4, 4, memorymonitor_allocationsize_obj___exit__); -//| def pause(self) -> None: -//| """Pause allocation tracking""" -//| ... -//| -STATIC mp_obj_t memorymonitor_allocationsize_obj_pause(mp_obj_t self_in) { - memorymonitor_allocationsize_obj_t *self = MP_OBJ_TO_PTR(self_in); - - common_hal_memorymonitor_allocationsize_pause(self); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationsize_pause_obj, memorymonitor_allocationsize_obj_pause); - -//| def resume(self) -> None: -//| """Resumes allocation tracking.""" -//| ... -//| -STATIC mp_obj_t memorymonitor_allocationsize_obj_resume(mp_obj_t self_in) { - common_hal_memorymonitor_allocationsize_resume(self_in); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationsize_resume_obj, memorymonitor_allocationsize_obj_resume); - -//| def clear(self) -> Any: -//| """Clears all captured pulses""" -//| ... -//| -STATIC mp_obj_t memorymonitor_allocationsize_obj_clear(mp_obj_t self_in) { - memorymonitor_allocationsize_obj_t *self = MP_OBJ_TO_PTR(self_in); - - common_hal_memorymonitor_allocationsize_clear(self); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationsize_clear_obj, memorymonitor_allocationsize_obj_clear); - - //| bytes_per_block: int = ... //| """Number of bytes per block""" //| STATIC mp_obj_t memorymonitor_allocationsize_obj_get_bytes_per_block(mp_obj_t self_in) { memorymonitor_allocationsize_obj_t *self = MP_OBJ_TO_PTR(self_in); - return mp_obj_new_bool(common_hal_memorymonitor_allocationsize_get_bytes_per_block(self)); + return MP_OBJ_NEW_SMALL_INT(common_hal_memorymonitor_allocationsize_get_bytes_per_block(self)); } MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationsize_get_bytes_per_block_obj, memorymonitor_allocationsize_obj_get_bytes_per_block); diff --git a/shared-module/memorymonitor/AllocationAlarm.c b/shared-module/memorymonitor/AllocationAlarm.c index bbd33f2b04..ed7ab75ab2 100644 --- a/shared-module/memorymonitor/AllocationAlarm.c +++ b/shared-module/memorymonitor/AllocationAlarm.c @@ -38,6 +38,11 @@ void common_hal_memorymonitor_allocationalarm_construct(memorymonitor_allocation } void common_hal_memorymonitor_allocationalarm_pause(memorymonitor_allocationalarm_obj_t* self) { + // Check to make sure we aren't already paused. We can be if we're exiting from an exception we + // caused. + if (self->previous == NULL) { + return; + } *self->previous = self->next; self->next = NULL; self->previous = NULL; @@ -62,6 +67,10 @@ void memorymonitor_allocationalarms_allocation(size_t block_count) { // Hold onto next in case we remove the alarm from the list. memorymonitor_allocationalarm_obj_t* next = alarm->next; if (block_count >= alarm->minimum_block_count) { + // Uncomment the breakpoint below if you want to use a C debugger to figure out the C + // call stack for an allocation. + // asm("bkpt"); + // Pause now because we may alert when throwing the exception too. common_hal_memorymonitor_allocationalarm_pause(alarm); alert_count++; } @@ -71,3 +80,7 @@ void memorymonitor_allocationalarms_allocation(size_t block_count) { mp_raise_memorymonitor_AllocationError(translate("Attempt to allocate %d blocks"), block_count); } } + +void memorymonitor_allocationalarms_reset(void) { + MP_STATE_VM(active_allocationalarms) = NULL; +} diff --git a/shared-module/memorymonitor/AllocationAlarm.h b/shared-module/memorymonitor/AllocationAlarm.h index ebdc0d8015..95381c6609 100644 --- a/shared-module/memorymonitor/AllocationAlarm.h +++ b/shared-module/memorymonitor/AllocationAlarm.h @@ -45,5 +45,6 @@ typedef struct _memorymonitor_allocationalarm_obj_t { } memorymonitor_allocationalarm_obj_t; void memorymonitor_allocationalarms_allocation(size_t block_count); +void memorymonitor_allocationalarms_reset(void); #endif // MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONALARM_H diff --git a/shared-module/memorymonitor/AllocationSize.c b/shared-module/memorymonitor/AllocationSize.c index fb11471fd4..c28e65592c 100644 --- a/shared-module/memorymonitor/AllocationSize.c +++ b/shared-module/memorymonitor/AllocationSize.c @@ -85,3 +85,7 @@ void memorymonitor_allocationsizes_track_allocation(size_t block_count) { as = as->next; } } + +void memorymonitor_allocationsizes_reset(void) { + MP_STATE_VM(active_allocationsizes) = NULL; +} diff --git a/shared-module/memorymonitor/AllocationSize.h b/shared-module/memorymonitor/AllocationSize.h index 3fa4e04652..3baab2213e 100644 --- a/shared-module/memorymonitor/AllocationSize.h +++ b/shared-module/memorymonitor/AllocationSize.h @@ -46,5 +46,6 @@ typedef struct _memorymonitor_allocationsize_obj_t { } memorymonitor_allocationsize_obj_t; void memorymonitor_allocationsizes_track_allocation(size_t block_count); +void memorymonitor_allocationsizes_reset(void); #endif // MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONSIZE_H diff --git a/shared-module/memorymonitor/__init__.c b/shared-module/memorymonitor/__init__.c index 4c24c25879..6cb424153d 100644 --- a/shared-module/memorymonitor/__init__.c +++ b/shared-module/memorymonitor/__init__.c @@ -32,3 +32,8 @@ void memorymonitor_track_allocation(size_t block_count) { memorymonitor_allocationalarms_allocation(block_count); memorymonitor_allocationsizes_track_allocation(block_count); } + +void memorymonitor_reset(void) { + memorymonitor_allocationalarms_reset(); + memorymonitor_allocationsizes_reset(); +} diff --git a/shared-module/memorymonitor/__init__.h b/shared-module/memorymonitor/__init__.h index cf76f88f86..f47f6434bf 100644 --- a/shared-module/memorymonitor/__init__.h +++ b/shared-module/memorymonitor/__init__.h @@ -30,5 +30,6 @@ #include void memorymonitor_track_allocation(size_t block_count); +void memorymonitor_reset(void); #endif // MICROPY_INCLUDED_MEMORYMONITOR___INIT___H From 07f031c70840352893e7137abbf7d564c3d4a0b7 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 17 Jul 2020 17:02:13 -0700 Subject: [PATCH 0326/1293] Add ignore() and fix docs --- .../memorymonitor/AllocationAlarm.c | 26 ++++++++++++- .../memorymonitor/AllocationAlarm.h | 1 + .../memorymonitor/AllocationSize.c | 37 ++++++++----------- shared-module/memorymonitor/AllocationAlarm.c | 20 +++++++--- shared-module/memorymonitor/AllocationAlarm.h | 1 + 5 files changed, 56 insertions(+), 29 deletions(-) diff --git a/shared-bindings/memorymonitor/AllocationAlarm.c b/shared-bindings/memorymonitor/AllocationAlarm.c index 71a156f328..36e2cb5b23 100644 --- a/shared-bindings/memorymonitor/AllocationAlarm.c +++ b/shared-bindings/memorymonitor/AllocationAlarm.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * 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 @@ -76,7 +76,27 @@ STATIC mp_obj_t memorymonitor_allocationalarm_make_new(const mp_obj_type_t *type return MP_OBJ_FROM_PTR(self); } -// TODO: Add .countdown(count) to skip allocations and alarm on something after the first. +//| def ignore(self, count) -> AllocationAlarm: +//| """Sets the number of applicable allocations to ignore before raising the exception. +//| Automatically set back to zero at context exit. +//| +//| Use it within a ``with`` block:: +//| +//| # Will not alarm because the bytearray allocation will be ignored. +//| with aa.ignore(2): +//| x = bytearray(20) +//| """ +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationalarm_obj_ignore(mp_obj_t self_in, mp_obj_t count_obj) { + mp_int_t count = mp_obj_get_int(count_obj); + if (count < 0) { + mp_raise_ValueError_varg(translate("%q must be >= 0"), MP_QSTR_count); + } + common_hal_memorymonitor_allocationalarm_set_ignore(self_in, count); + return self_in; +} +MP_DEFINE_CONST_FUN_OBJ_2(memorymonitor_allocationalarm_ignore_obj, memorymonitor_allocationalarm_obj_ignore); //| def __enter__(self) -> memorymonitor.AllocationAlarm: //| """Enables the alarm.""" @@ -95,6 +115,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationalarm___enter___obj, memorymon //| STATIC mp_obj_t memorymonitor_allocationalarm_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; + common_hal_memorymonitor_allocationalarm_set_ignore(args[0], 0); common_hal_memorymonitor_allocationalarm_pause(args[0]); return mp_const_none; } @@ -102,6 +123,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(memorymonitor_allocationalarm___exit_ STATIC const mp_rom_map_elem_t memorymonitor_allocationalarm_locals_dict_table[] = { // Methods + { MP_ROM_QSTR(MP_QSTR_ignore), MP_ROM_PTR(&memorymonitor_allocationalarm_ignore_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&memorymonitor_allocationalarm___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&memorymonitor_allocationalarm___exit___obj) }, }; diff --git a/shared-bindings/memorymonitor/AllocationAlarm.h b/shared-bindings/memorymonitor/AllocationAlarm.h index 40f5a48c5b..304b9c5a72 100644 --- a/shared-bindings/memorymonitor/AllocationAlarm.h +++ b/shared-bindings/memorymonitor/AllocationAlarm.h @@ -34,5 +34,6 @@ extern const mp_obj_type_t memorymonitor_allocationalarm_type; void common_hal_memorymonitor_allocationalarm_construct(memorymonitor_allocationalarm_obj_t* self, size_t minimum_block_count); void common_hal_memorymonitor_allocationalarm_pause(memorymonitor_allocationalarm_obj_t* self); void common_hal_memorymonitor_allocationalarm_resume(memorymonitor_allocationalarm_obj_t* self); +void common_hal_memorymonitor_allocationalarm_set_ignore(memorymonitor_allocationalarm_obj_t* self, mp_int_t count); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONALARM_H diff --git a/shared-bindings/memorymonitor/AllocationSize.c b/shared-bindings/memorymonitor/AllocationSize.c index 25ecae97b8..3e0e31336f 100644 --- a/shared-bindings/memorymonitor/AllocationSize.c +++ b/shared-bindings/memorymonitor/AllocationSize.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * 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 @@ -38,7 +38,7 @@ //| def __init__(self): //| """Tracks the number of allocations in power of two buckets. //| -//| It will have 32 16bit buckets to track allocation counts. It is total allocations +//| It will have 16 16bit buckets to track allocation counts. It is total allocations //| meaning frees are ignored. Reallocated memory is counted twice, at allocation and when //| reallocated with the larger size. //| @@ -47,25 +47,20 @@ //| per block, typically 16. Bucket 2 will be less than or equal to 4 blocks. See //| `bytes_per_block` to convert blocks to bytes. //| -//| Multiple AllocationSizes can be used to track different boundaries. -//| -//| Active AllocationSizes will not be freed so make sure and pause before deleting. +//| Multiple AllocationSizes can be used to track different code boundaries. //| //| Track allocations:: //| //| import memorymonitor //| -//| mm = memorymonitor.AllocationSizes() -//| print("hello world" * 3) -//| mm.pause() -//| for bucket in mm: -//| print("<", 2 ** bucket, mm[bucket]) +//| mm = memorymonitor.AllocationSize() +//| with mm: +//| print("hello world" * 3) //| -//| # Clear the buckets -//| mm.clear() +//| for bucket, count in enumerate(mm): +//| print("<", 2 ** bucket, count) //| -//| # Resume allocation tracking -//| mm.resume()""" +//| """ //| ... //| STATIC mp_obj_t memorymonitor_allocationsize_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -78,7 +73,7 @@ STATIC mp_obj_t memorymonitor_allocationsize_make_new(const mp_obj_type_t *type, } //| def __enter__(self, ) -> Any: -//| """No-op used by Context Managers.""" +//| """Clears counts and resumes tracking.""" //| ... //| STATIC mp_obj_t memorymonitor_allocationsize_obj___enter__(mp_obj_t self_in) { @@ -118,12 +113,12 @@ const mp_obj_property_t memorymonitor_allocationsize_bytes_per_block_obj = { }; //| def __len__(self, ) -> Any: -//| """Returns the current pulse length +//| """Returns the number of allocation buckets. //| //| This allows you to:: //| -//| pulses = pulseio.PulseIn(pin) -//| print(len(pulses))""" +//| mm = memorymonitor.AllocationSize() +//| print(len(mm))""" //| ... //| STATIC mp_obj_t memorymonitor_allocationsize_unary_op(mp_unary_op_t op, mp_obj_t self_in) { @@ -137,12 +132,12 @@ STATIC mp_obj_t memorymonitor_allocationsize_unary_op(mp_unary_op_t op, mp_obj_t } //| def __getitem__(self, index: Any) -> Any: -//| """Returns the value at the given index or values in slice. +//| """Returns the allocation count for the given bucket. //| //| This allows you to:: //| -//| pulses = pulseio.PulseIn(pin) -//| print(pulses[0])""" +//| mm = memorymonitor.AllocationSize() +//| print(mm[0])""" //| ... //| STATIC mp_obj_t memorymonitor_allocationsize_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t value) { diff --git a/shared-module/memorymonitor/AllocationAlarm.c b/shared-module/memorymonitor/AllocationAlarm.c index ed7ab75ab2..35f4e4c636 100644 --- a/shared-module/memorymonitor/AllocationAlarm.c +++ b/shared-module/memorymonitor/AllocationAlarm.c @@ -37,6 +37,10 @@ void common_hal_memorymonitor_allocationalarm_construct(memorymonitor_allocation self->previous = NULL; } +void common_hal_memorymonitor_allocationalarm_set_ignore(memorymonitor_allocationalarm_obj_t* self, mp_int_t count) { + self->count = count; +} + void common_hal_memorymonitor_allocationalarm_pause(memorymonitor_allocationalarm_obj_t* self) { // Check to make sure we aren't already paused. We can be if we're exiting from an exception we // caused. @@ -67,12 +71,16 @@ void memorymonitor_allocationalarms_allocation(size_t block_count) { // Hold onto next in case we remove the alarm from the list. memorymonitor_allocationalarm_obj_t* next = alarm->next; if (block_count >= alarm->minimum_block_count) { - // Uncomment the breakpoint below if you want to use a C debugger to figure out the C - // call stack for an allocation. - // asm("bkpt"); - // Pause now because we may alert when throwing the exception too. - common_hal_memorymonitor_allocationalarm_pause(alarm); - alert_count++; + if (alarm->count > 0) { + alarm->count--; + } else { + // Uncomment the breakpoint below if you want to use a C debugger to figure out the C + // call stack for an allocation. + // asm("bkpt"); + // Pause now because we may alert when throwing the exception too. + common_hal_memorymonitor_allocationalarm_pause(alarm); + alert_count++; + } } alarm = next; } diff --git a/shared-module/memorymonitor/AllocationAlarm.h b/shared-module/memorymonitor/AllocationAlarm.h index 95381c6609..172c24f6c8 100644 --- a/shared-module/memorymonitor/AllocationAlarm.h +++ b/shared-module/memorymonitor/AllocationAlarm.h @@ -39,6 +39,7 @@ typedef struct _memorymonitor_allocationalarm_obj_t memorymonitor_allocationalar typedef struct _memorymonitor_allocationalarm_obj_t { mp_obj_base_t base; size_t minimum_block_count; + mp_int_t count; // Store the location that points to us so we can remove ourselves. memorymonitor_allocationalarm_obj_t** previous; memorymonitor_allocationalarm_obj_t* next; From 610e0171aac69f7cd7b7c46eb776a3624ce224a3 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 17 Jul 2020 17:43:02 -0700 Subject: [PATCH 0327/1293] Disable existing native networking. We're moving towards a co-processor model and a Wiznet library is already available. New native APIs will replace these for chips with networking like the ESP32S2 but they won't be these. --- .../aloriumtech_evo_m51/mpconfigboard.mk | 2 -- .../circuitbrains_deluxe_m4/mpconfigboard.mk | 2 -- .../boards/kicksat-sprite/mpconfigboard.mk | 1 - .../boards/pewpew_m4/mpconfigboard.mk | 18 +++++++----------- .../mpconfigboard.mk | 2 -- .../mpconfigboard.mk | 1 - .../boards/winterbloom_sol/mpconfigboard.mk | 1 - ports/atmel-samd/mpconfigport.mk | 3 +-- .../nrf/boards/particle_argon/mpconfigboard.mk | 4 ---- .../nrf/boards/particle_boron/mpconfigboard.mk | 4 ---- .../nrf/boards/particle_xenon/mpconfigboard.mk | 4 ---- shared-bindings/network/__init__.c | 3 +++ shared-bindings/socket/__init__.c | 3 +++ shared-bindings/wiznet/__init__.c | 7 ++++++- 14 files changed, 20 insertions(+), 35 deletions(-) diff --git a/ports/atmel-samd/boards/aloriumtech_evo_m51/mpconfigboard.mk b/ports/atmel-samd/boards/aloriumtech_evo_m51/mpconfigboard.mk index 28b1434fb7..34301da3f0 100644 --- a/ports/atmel-samd/boards/aloriumtech_evo_m51/mpconfigboard.mk +++ b/ports/atmel-samd/boards/aloriumtech_evo_m51/mpconfigboard.mk @@ -13,6 +13,4 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = GD25Q16C LONGINT_IMPL = MPZ -CIRCUITPY_NETWORK = 1 -MICROPY_PY_WIZNET5K = 5500 CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/circuitbrains_deluxe_m4/mpconfigboard.mk b/ports/atmel-samd/boards/circuitbrains_deluxe_m4/mpconfigboard.mk index 7a9e5a7808..13ae59de46 100755 --- a/ports/atmel-samd/boards/circuitbrains_deluxe_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitbrains_deluxe_m4/mpconfigboard.mk @@ -11,6 +11,4 @@ EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, S25FL064L" LONGINT_IMPL = MPZ -CIRCUITPY_NETWORK = 1 -MICROPY_PY_WIZNET5K = 5500 CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index febd2a6c36..9c7fe3398a 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -13,7 +13,6 @@ LONGINT_IMPL = MPZ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_DISPLAYIO = 0 -CIRCUITPY_NETWORK = 0 CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_AUDIOMP3 = 0 diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index b6490433e5..c322897628 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -14,34 +14,30 @@ CIRCUITPY_FULL_BUILD = 0 # when frozen module gets smaller. CIRCUITPY_ANALOGIO = 0 CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_AUDIOPWMIO = 0 +CIRCUITPY_AUDIOMP3 = 0 CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITBANG_APA102 = 0 CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_GAMEPADSHIFT = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 -CIRCUITPY_NETWORK = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_PS2IO = 0 +CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 +CIRCUITPY_SAMD = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_USB_MIDI = 0 -CIRCUITPY_AUDIOPWMIO = 0 -CIRCUITPY_AUDIOMP3 = 0 -CIRCUITPY_BITBANG_APA102 = 0 -CIRCUITPY_BLEIO = 0 -CIRCUITPY_GAMEPADSHIFT = 0 -CIRCUITPY_NETWORK = 0 -CIRCUITPY_ROTARYIO = 0 -CIRCUITPY_SAMD = 0 -CIRCUITPY_TOUCHIO = 0 CIRCUITPY_VECTORIO = 0 CIRCUITPY_AUDIOMIXER = 1 CIRCUITPY_AUDIOIO = 1 CIRCUITPY_DISPLAYIO = 1 CIRCUITPY_GAMEPAD = 1 -CIRCUITPY_STAGE = 1 CIRCUITPY_MATH = 1 +CIRCUITPY_STAGE = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pewpew_m4 CIRCUITPY_DISPLAY_FONT = $(TOP)/ports/atmel-samd/boards/ugame10/brutalist-6.bdf diff --git a/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/mpconfigboard.mk index 13863e565f..567f1db205 100644 --- a/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/mpconfigboard.mk @@ -12,6 +12,4 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = AT25SF041A LONGINT_IMPL = MPZ -CIRCUITPY_NETWORK = 1 -MICROPY_PY_WIZNET5K = 5500 CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk index e06a2af7ee..7ab0ccfc9d 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk @@ -24,7 +24,6 @@ CIRCUITPY_BLEIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CPERIPHERAL = 0 -CIRCUITPY_NETWORK = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_PS2IO = 0 diff --git a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk index 11592073f9..9217cdf23d 100644 --- a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk @@ -23,7 +23,6 @@ CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CPERIPHERAL = 0 -CIRCUITPY_NETWORK = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_PS2IO = 0 diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index face79fad7..e4cf9ca833 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -54,8 +54,7 @@ CIRCUITPY_TOUCHIO_USE_NATIVE = 0 # The ifndef's allow overriding in mpconfigboard.mk. ifndef CIRCUITPY_NETWORK -CIRCUITPY_NETWORK = 1 -MICROPY_PY_WIZNET5K = 5500 +CIRCUITPY_NETWORK = 0 endif ifndef CIRCUITPY_PS2IO diff --git a/ports/nrf/boards/particle_argon/mpconfigboard.mk b/ports/nrf/boards/particle_argon/mpconfigboard.mk index 2ca08b9829..f8d3d2aca2 100644 --- a/ports/nrf/boards/particle_argon/mpconfigboard.mk +++ b/ports/nrf/boards/particle_argon/mpconfigboard.mk @@ -8,7 +8,3 @@ MCU_CHIP = nrf52840 QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "MX25L3233F" - -# Support for the Ethernet FeatherWing -CIRCUITPY_NETWORK = 1 -MICROPY_PY_WIZNET5K = 5500 diff --git a/ports/nrf/boards/particle_boron/mpconfigboard.mk b/ports/nrf/boards/particle_boron/mpconfigboard.mk index f03f43a7bc..eada97a730 100644 --- a/ports/nrf/boards/particle_boron/mpconfigboard.mk +++ b/ports/nrf/boards/particle_boron/mpconfigboard.mk @@ -8,7 +8,3 @@ MCU_CHIP = nrf52840 QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "MX25L3233F" - -# Support for the Ethernet FeatherWing -CIRCUITPY_NETWORK = 1 -MICROPY_PY_WIZNET5K = 5500 diff --git a/ports/nrf/boards/particle_xenon/mpconfigboard.mk b/ports/nrf/boards/particle_xenon/mpconfigboard.mk index 44309bbca2..6062da378f 100644 --- a/ports/nrf/boards/particle_xenon/mpconfigboard.mk +++ b/ports/nrf/boards/particle_xenon/mpconfigboard.mk @@ -8,7 +8,3 @@ MCU_CHIP = nrf52840 QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "MX25L3233F" - -# Support for the Ethernet FeatherWing -CIRCUITPY_NETWORK = 1 -MICROPY_PY_WIZNET5K = 5500 diff --git a/shared-bindings/network/__init__.c b/shared-bindings/network/__init__.c index 58aa13473e..4bd543a0a5 100644 --- a/shared-bindings/network/__init__.c +++ b/shared-bindings/network/__init__.c @@ -40,6 +40,9 @@ //| """Network Interface Management //| +//| .. warning:: This module is disabled in 6.x and will removed in 7.x. Please use networking +//| libraries instead. +//| //| This module provides a registry of configured NICs. //| It is used by the 'socket' module to look up a suitable //| NIC when a socket is created.""" diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c index 0ded0218bb..2485d8ef8c 100644 --- a/shared-bindings/socket/__init__.c +++ b/shared-bindings/socket/__init__.c @@ -39,6 +39,9 @@ //| """TCP, UDP and RAW socket support //| +//| .. warning:: This module is disabled in 6.x and will removed in 7.x. Please use networking +//| libraries instead. (Native networking will provide a socket compatible class.) +//| //| Create TCP, UDP and RAW sockets for communicating over the Internet.""" //| diff --git a/shared-bindings/wiznet/__init__.c b/shared-bindings/wiznet/__init__.c index bc7ff150fe..8df06b5467 100644 --- a/shared-bindings/wiznet/__init__.c +++ b/shared-bindings/wiznet/__init__.c @@ -35,7 +35,12 @@ #include "shared-module/network/__init__.h" -//| """Support for WizNet hardware, including the WizNet 5500 Ethernet adaptor.""" +//| """Support for WizNet hardware, including the WizNet 5500 Ethernet adaptor. +//| +//| +//| .. warning:: This module is disabled in 6.x and will removed in 7.x. Please use networking +//| libraries instead. +//| """ //| extern const mod_network_nic_type_t mod_network_nic_type_wiznet5k; From f38a9c8d2991a94df9d629ae33ec25fa32b61af9 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 17 Jul 2020 17:55:06 -0700 Subject: [PATCH 0328/1293] Add cast for mpy-cross warning --- py/objarray.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/objarray.c b/py/objarray.c index b868e62f92..83defa343d 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -419,12 +419,12 @@ STATIC mp_obj_t buffer_finder(size_t n_args, const mp_obj_t *args, int direction } const byte *start = haystack_bufinfo.buf; - const byte *end = haystack_bufinfo.buf + haystack_bufinfo.len; + const byte *end = ((const byte*)haystack_bufinfo.buf) + haystack_bufinfo.len; if (n_args >= 3 && args[2] != mp_const_none) { start += mp_get_index(self_type, haystack_bufinfo.len, args[2], true); } if (n_args >= 4 && args[3] != mp_const_none) { - end = haystack_bufinfo.buf + mp_get_index(self_type, haystack_bufinfo.len, args[3], true); + end = ((const byte*)haystack_bufinfo.buf) + mp_get_index(self_type, haystack_bufinfo.len, args[3], true); } const byte *p = NULL; From 693b3e7704e1c7a9bea25d3b43c3771123e8c214 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 17 Jul 2020 18:00:58 -0700 Subject: [PATCH 0329/1293] Update translations --- locale/circuitpython.pot | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 6bdc91bf17..95ebeb1db2 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1,12 +1,14 @@ -# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. # -# SPDX-License-Identifier: MIT - +#, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-07 14:38-0500\n" +"POT-Creation-Date: 2020-07-17 18:00-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -76,10 +78,15 @@ msgstr "" msgid "%q list must be a list" msgstr "" +#: shared-bindings/memorymonitor/AllocationAlarm.c +msgid "%q must be >= 0" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c -#: shared-bindings/vectorio/Rectangle.c +#: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm.c +#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "" @@ -313,6 +320,11 @@ msgstr "" msgid "Already advertising." msgstr "" +#: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize.c +msgid "Already running" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "" @@ -348,6 +360,11 @@ msgstr "" msgid "At most %d %q may be specified (not %d)" msgstr "" +#: shared-module/memorymonitor/AllocationAlarm.c +#, c-format +msgid "Attempt to allocate %d blocks" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -467,7 +484,9 @@ msgstr "" msgid "Can't set CCCD on local Characteristic" msgstr "" -#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" msgstr "" @@ -1347,6 +1366,7 @@ msgstr "" msgid "Random number generation error" msgstr "" +#: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "" @@ -1431,7 +1451,9 @@ msgid "Slice and value different lengths." msgstr "" #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" msgstr "" From 6ac2fe58fd316d88d545410807069a9563e0bfd5 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 17 Jul 2020 18:03:52 -0700 Subject: [PATCH 0330/1293] Update translations --- locale/circuitpython.pot | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 6bdc91bf17..988f89a059 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1,12 +1,14 @@ -# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. # -# SPDX-License-Identifier: MIT - +#, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-07 14:38-0500\n" +"POT-Creation-Date: 2020-07-17 18:03-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -103,6 +105,10 @@ msgstr "" msgid "'%q' argument required" msgstr "" +#: py/objarray.c +msgid "'%q' object is not bytes-like" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -3098,7 +3104,7 @@ msgstr "" msgid "struct: no fields" msgstr "" -#: py/objstr.c +#: py/objarray.c py/objstr.c msgid "substring not found" msgstr "" From 90ae1efa001a590a758e125726e67023b69e2779 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 17 Jul 2020 21:28:24 -0400 Subject: [PATCH 0331/1293] revamp ACLDATA reassembly --- devices/ble_hci/common-hal/_bleio/hci_api.c | 124 +++++++++++--------- 1 file changed, 68 insertions(+), 56 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/hci_api.c b/devices/ble_hci/common-hal/_bleio/hci_api.c index 8155bca56e..854f7c0a00 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_api.c +++ b/devices/ble_hci/common-hal/_bleio/hci_api.c @@ -1,3 +1,4 @@ +// This file is derived from the ArduinoBLE library. Its header is below. /* This file is part of the ArduinoBLE library. Copyright (c) 2018 Arduino SA. All rights reserved. @@ -39,7 +40,7 @@ #define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER)) #define RX_BUFFER_SIZE (3 + 255) -#define ACL_PKT_BUFFER_SIZE (255) +#define ACL_DATA_BUFFER_SIZE (255 + 1) #define CTS_TIMEOUT_MSECS (1000) #define RESPONSE_TIMEOUT_MSECS (1000) @@ -60,7 +61,8 @@ STATIC uint8_t cmd_response_status; STATIC size_t cmd_response_len; STATIC uint8_t* cmd_response_data; -//FIX STATIC uint8_t acl_pkt_buffer[ACL_PKT_BUFFER_SIZE]; +STATIC uint8_t acl_data_buffer[ACL_DATA_BUFFER_SIZE]; +STATIC size_t acl_data_len; STATIC volatile bool hci_poll_in_progress = false; @@ -76,27 +78,28 @@ typedef struct __attribute__ ((packed)) { uint8_t params[]; } h4_hci_cmd_pkt_t; -#define ACLDATA_PB_FIRST_NON_FLUSH 0 -#define ACLDATA_HCI_PB_MIDDLE 1 -#define ACLDATA_PB_FIRST_FLUSH 2 -#define ACLDATA_PB_FULL 3 +#define ACL_DATA_PB_FIRST_NON_FLUSH 0 +#define ACL_DATA_PB_MIDDLE 1 +#define ACL_DATA_PB_FIRST_FLUSH 2 +#define ACL_DATA_PB_FULL 3 typedef struct __attribute__ ((packed)) { uint8_t pkt_type; uint16_t handle : 12; - uint8_t pb: 2; // Packet boundary flag: ACLDATA_PB values. - uint8_t bc: 2; // Broadcast flag: always 0b00 for BLE. - uint16_t data_len; // Total data length, including acl_data header. - uint8_t data[]; // Data following the header + uint8_t pb: 2; // Packet boundary flag: ACL_DATA_PB values. + uint8_t bc: 2; // Broadcast flag: always 0b00 for BLE. + uint16_t data_len; // length of data[] in this packet. + uint8_t data[]; } h4_hci_acl_pkt_t; -// L2CAP data, which is in h4_hci_acl_pkt_t.data +// The ACL data in an h4_hci_acl_pkt_t may be fragmented across +// multiple ACL_DATA packets, and need to be recombined. This is the +// structure of the combined packet or the first fragment. typedef struct __attribute__ ((packed)) { - uint16_t l2cap_data_len; // Length of acl_data. Does not include this header. - uint16_t cid; // Channel ID. - uint8_t l2cap_data[]; -} l2cap_data_t; - + uint16_t acl_data_len; // Length of acl_data. Does not include this header. + uint16_t cid; // Channel ID. + uint8_t acl_data[]; // Length is acl_data_len of full packet. +} acl_data_t; typedef struct __attribute__ ((packed)) { uint8_t pkt_type; @@ -125,15 +128,31 @@ STATIC void dump_cmd_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { STATIC void dump_acl_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { if (debug) { + // mp_printf(&mp_plat_print, "\\ PKT_DATA: "); + // for (size_t i = 0; i < pkt_len; i++) { + // mp_printf(&mp_plat_print, "%02x ", pkt_data[i]); + // } + // mp_printf(&mp_plat_print, "\n"); h4_hci_acl_pkt_t *pkt = (h4_hci_acl_pkt_t *) pkt_data; - l2cap_data_t *l2cap = (l2cap_data_t *) pkt->data; mp_printf(&mp_plat_print, - "%s HCI ACLDATA (%x) handle: %04x, pb: %d, bc: %d, data_len: %d, l2cap_data_len: %d, cid: %04x, l2cap_data: ", - tx ? "TX->" : "RX<-", - pkt->pkt_type, pkt->handle, pkt->data_len, l2cap->l2cap_data_len, l2cap->cid); - for (size_t i = 0; i < l2cap->l2cap_data_len; i++) { - mp_printf(&mp_plat_print, "%02x ", l2cap->l2cap_data[i]); + "%s HCI ACLDATA (%x) handle: %04x, pb: %d, bc: %d, data_len: %d, ", + tx ? "TX->" : "RX<-", pkt->pkt_type, pkt->handle, pkt->pb, pkt->bc, pkt->data_len); + + if (pkt->pb != ACL_DATA_PB_MIDDLE) { + // This is the start of a fragmented acl_data packet or is a full packet. + acl_data_t *acl = (acl_data_t *) pkt->data; + mp_printf(&mp_plat_print, + "acl data_len: %d, cid: %04x, data: ", + acl->acl_data_len, acl->cid); + for (size_t i = 0; i < acl->acl_data_len; i++) { + mp_printf(&mp_plat_print, "%02x ", acl->acl_data[i]); + } + } else { + for (size_t i = 0; i < pkt->data_len; i++) { + mp_printf(&mp_plat_print, "more data: %02x ", pkt->data[i]); + } } + if (pkt_len != sizeof(h4_hci_acl_pkt_t) + pkt->data_len) { mp_printf(&mp_plat_print, " LENGTH MISMATCH"); } @@ -159,40 +178,27 @@ STATIC void dump_evt_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { } STATIC void process_acl_data_pkt(uint8_t pkt_len, uint8_t pkt_data[]) { - //FIX pkt_len is +1 than before, because it includes the pkt_type. - // h4_hci_acl_pkt_t *aclHdr = (h4_hci_acl_pkt_t*)pkt_data; + h4_hci_acl_pkt_t *pkt = (h4_hci_acl_pkt_t*) pkt_data; - // uint16_t aclFlags = (aclHdr->handle & 0xf000) >> 12; + if (pkt->pb != ACL_DATA_PB_MIDDLE) { + // This is the start of a fragmented acl_data packet or is a full packet. + memcpy(acl_data_buffer, pkt->data, pkt->data_len); + acl_data_len = pkt->data_len; + } else { + // This is a middle or end fragment of acl data. + // Append to the accumulated data so far. + memcpy(&acl_data_buffer[acl_data_len], pkt->data, pkt->data_len); + acl_data_len += pkt->data_len; + } - // if ((aclHdr->data_len - 4) != aclHdr->len) { - // // packet is fragmented - // if (aclFlags != 0x01) { - // // copy into ACL buffer - // memcpy(acl_pkt_buffer, &rx_buffer[1], sizeof(HCIACLHdr) + aclHdr->data_len - 4); - // } else { - // // copy next chunk into the buffer - // HCIACLHdr* aclBufferHeader = (HCIACLHdr*)acl_pkt_buffer; - - // memcpy(&acl_pkt_buffer[sizeof(HCIACLHdr) + aclBufferHeader->data_len - 4], &rx_buffer[1 + sizeof(aclHdr->handle) + sizeof(aclHdr->data_len)], aclHdr->data_len); - - // aclBufferHeader->data_len += aclHdr->data_len; - // aclHdr = aclBufferHeader; - // } - // } - - // if ((aclHdr->data_len - 4) != aclHdr->len) { - // // don't have the full packet yet - // return; - // } + acl_data_t *acl_so_far = (acl_data_t *) acl_data_buffer; + if (acl_data_len != acl_so_far->acl_data_len) { + // We don't have the full packet yet. + return; + } // if (aclHdr->cid == ATT_CID) { - // if (aclFlags == 0x01) { - // // use buffered packet - // ATT.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &acl_pkt_buffer[sizeof(HCIACLHdr)]); - // } else { - // // use the rx buffer - // ATT.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &rx_buffer[1 + sizeof(HCIACLHdr)]); - // } + // ATT.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &rx_buffer[1 + sizeof(HCIACLHdr)]); // } else if (aclHdr->cid == SIGNALING_CID) { // L2CAPSignaling.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &rx_buffer[1 + sizeof(HCIACLHdr)]); // } else { @@ -321,6 +327,9 @@ STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt_data[]) } default: + if (debug) { + mp_printf(&mp_plat_print, "process_evt_pkt: Unknown event: %02x\n"); + } break; } } @@ -407,6 +416,9 @@ hci_result_t hci_poll_for_incoming_pkt(void) { break; default: + if (debug) { + mp_printf(&mp_plat_print, "Unknown HCI packet type: %d\n", rx_buffer[0]); + } break; } @@ -499,18 +511,18 @@ STATIC int __attribute__((unused)) send_acl_pkt(uint16_t handle, uint8_t cid, vo } // data_len does not include cid. - const size_t cid_len = sizeof_field(l2cap_data_t, cid); + const size_t cid_len = sizeof_field(acl_data_t, cid); // buf_len is size of entire packet including header. const size_t buf_len = sizeof(h4_hci_acl_pkt_t) + cid_len + data_len; uint8_t tx_buffer[buf_len]; h4_hci_acl_pkt_t *acl_pkt = (h4_hci_acl_pkt_t *) tx_buffer; - l2cap_data_t *l2cap = (l2cap_data_t *) acl_pkt->data; + acl_data_t *acl_data = (acl_data_t *) acl_pkt->data; acl_pkt->pkt_type = H4_ACL; acl_pkt->handle = handle; acl_pkt->data_len = (uint8_t)(cid_len + data_len); - l2cap->l2cap_data_len = (uint8_t) data_len; - l2cap->cid = cid; + acl_data->acl_data_len = (uint8_t) data_len; + acl_data->cid = cid; memcpy(&tx_buffer[sizeof(h4_hci_acl_pkt_t)], data, data_len); From 8d692f33a8b9638e37ba6e311432eeb96c0ec825 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Sat, 18 Jul 2020 19:30:40 +0200 Subject: [PATCH 0332/1293] pewpew_m4: Enable analogio and usb_hid The newest version for the Stage library for PewPewM4 no longer contains embedded graphics, which frees enough space in flash to enabled back AnalogIO and also add USB_HID. There is still ~192 bytes left free. If new additions to CircuitPython make it grow further, we can disable USB_HID again. --- frozen/circuitpython-stage | 2 +- ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/frozen/circuitpython-stage b/frozen/circuitpython-stage index 0d2c083a2f..9596a5904e 160000 --- a/frozen/circuitpython-stage +++ b/frozen/circuitpython-stage @@ -1 +1 @@ -Subproject commit 0d2c083a2fb57a1562d4806775f45273abbfbfae +Subproject commit 9596a5904ed757e6fbffcf03e7aa77ae9ecf5223 diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index b6490433e5..b1a8f7c72f 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -10,20 +10,15 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 -# TODO: Turn off analogio for now for space reasons, but restore it -# when frozen module gets smaller. -CIRCUITPY_ANALOGIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 -CIRCUITPY_NETWORK = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_TOUCHIO = 0 -CIRCUITPY_USB_HID = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY_AUDIOPWMIO = 0 CIRCUITPY_AUDIOMP3 = 0 @@ -33,7 +28,6 @@ CIRCUITPY_GAMEPADSHIFT = 0 CIRCUITPY_NETWORK = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_SAMD = 0 -CIRCUITPY_TOUCHIO = 0 CIRCUITPY_VECTORIO = 0 CIRCUITPY_AUDIOMIXER = 1 @@ -42,6 +36,8 @@ CIRCUITPY_DISPLAYIO = 1 CIRCUITPY_GAMEPAD = 1 CIRCUITPY_STAGE = 1 CIRCUITPY_MATH = 1 +CIRCUITPY_ANALOGIO = 1 +CIRCUITPY_USB_HID = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pewpew_m4 CIRCUITPY_DISPLAY_FONT = $(TOP)/ports/atmel-samd/boards/ugame10/brutalist-6.bdf From 11ef43b071f275ee470d1339cc7a2392281b9528 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Sat, 18 Jul 2020 20:09:30 +0200 Subject: [PATCH 0333/1293] pewpew_m4: Disable USB_HID back German translation fails to build, so I have to disabled USB_HID after all. --- ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index b1a8f7c72f..8a67f127fb 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -19,6 +19,7 @@ CIRCUITPY_PIXELBUF = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_TOUCHIO = 0 +CIRCUITPY_USB_HID = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY_AUDIOPWMIO = 0 CIRCUITPY_AUDIOMP3 = 0 @@ -37,7 +38,6 @@ CIRCUITPY_GAMEPAD = 1 CIRCUITPY_STAGE = 1 CIRCUITPY_MATH = 1 CIRCUITPY_ANALOGIO = 1 -CIRCUITPY_USB_HID = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pewpew_m4 CIRCUITPY_DISPLAY_FONT = $(TOP)/ports/atmel-samd/boards/ugame10/brutalist-6.bdf From 7ba89f5330fb2a7d48efb56f1b5920e8dfffedef Mon Sep 17 00:00:00 2001 From: Thea Flowers Date: Sat, 18 Jul 2020 22:33:06 -0700 Subject: [PATCH 0334/1293] Add _bhb user module for Big Honking Button BHB needs better accuracy from the ADC readings. To avoid changing the ADC configuration for all boards or adding complexity to AnalogIn, I implemented a custom user module to allow the BHB to talk to the ADC in the way that it needs to. I'm open to other approaches here, but this seemed like the least invasive and complex option. --- .../mpconfigboard.mk | 4 + .../usermods/_bhb/bhb.c | 120 ++++++++++++++++++ .../usermods/_bhb/micropython.mk | 6 + 3 files changed, 130 insertions(+) create mode 100644 ports/atmel-samd/boards/winterbloom_big_honking_button/usermods/_bhb/bhb.c create mode 100644 ports/atmel-samd/boards/winterbloom_big_honking_button/usermods/_bhb/micropython.mk diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk index 466e345911..35a72819b8 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk @@ -32,3 +32,7 @@ CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_RTC = 0 + +# Enable board-specific modules +USER_C_MODULES = boards/winterbloom_big_honking_button/usermods +CFLAGS += -DMODULE_BHB_ENABLED=1 diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/usermods/_bhb/bhb.c b/ports/atmel-samd/boards/winterbloom_big_honking_button/usermods/_bhb/bhb.c new file mode 100644 index 0000000000..54ce173d81 --- /dev/null +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/usermods/_bhb/bhb.c @@ -0,0 +1,120 @@ +#include "py/obj.h" +#include "py/runtime.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "samd/pins.h" +#include "sam.h" + +STATIC mp_obj_t _bhb_read_adc(void); + +STATIC mp_obj_t _bhb_init_adc(void) { + claim_pin(&pin_PB08); + common_hal_never_reset_pin(&pin_PB08); + + /* Enable the APB clock for the ADC. */ + PM->APBCMASK.reg |= PM_APBCMASK_ADC; + + /* Enable GCLK0 for the ADC */ + GCLK->CLKCTRL.reg = GCLK_CLKCTRL_CLKEN | + GCLK_CLKCTRL_GEN_GCLK0 | + GCLK_CLKCTRL_ID_ADC; + + /* Wait for bus synchronization. */ + while (GCLK->STATUS.bit.SYNCBUSY) {}; + + uint32_t bias = (*((uint32_t *) ADC_FUSES_BIASCAL_ADDR) & ADC_FUSES_BIASCAL_Msk) >> ADC_FUSES_BIASCAL_Pos; + uint32_t linearity = (*((uint32_t *) ADC_FUSES_LINEARITY_0_ADDR) & ADC_FUSES_LINEARITY_0_Msk) >> ADC_FUSES_LINEARITY_0_Pos; + linearity |= ((*((uint32_t *) ADC_FUSES_LINEARITY_1_ADDR) & ADC_FUSES_LINEARITY_1_Msk) >> ADC_FUSES_LINEARITY_1_Pos) << 5; + + /* Wait for bus synchronization. */ + while (ADC->STATUS.bit.SYNCBUSY) {}; + + /* Write the calibration data. */ + ADC->CALIB.reg = ADC_CALIB_BIAS_CAL(bias) | ADC_CALIB_LINEARITY_CAL(linearity); + + /* Use the internal VCC reference. This is 1/2 of what's on VCCA. + since VCCA is 3.3v, this is 1.65v. + */ + ADC->REFCTRL.reg = ADC_REFCTRL_REFSEL_INTVCC1; + + /* Capture 64 samples. */ + ADC->AVGCTRL.reg = ADC_AVGCTRL_SAMPLENUM_64 | ADC_AVGCTRL_ADJRES(4); + + /* Set the clock prescaler to 32, which is the same as the CircuitPython default. + Set the resolution to 16 for averaging + */ + ADC->CTRLB.reg = ADC_CTRLB_PRESCALER_DIV32 | + ADC_CTRLB_RESSEL_16BIT; + + /* Configure the input parameters. + + - GAIN_DIV2 means that the input voltage is halved. This is important + because the voltage reference is 1/2 of VCCA. So if you want to + measure 0-3.3v, you need to halve the input as well. + + - MUXNEG_GND means that the ADC should compare the input value to GND. + + - MUXPOS_PIN3 means that the ADC should read from AIN2, or PB08. + */ + ADC->INPUTCTRL.reg = ADC_INPUTCTRL_GAIN_DIV2 | + ADC_INPUTCTRL_MUXNEG_GND | + ADC_INPUTCTRL_MUXPOS_PIN2; + + + /* Set PB08 as an input pin. */ + PORT->Group[1].DIRCLR.reg = PORT_PB08; + + /* Enable the peripheral multiplexer for PB08. */ + PORT->Group[1].PINCFG[8].reg |= PORT_PINCFG_PMUXEN; + + /* Set PB08 to function B which is analog input. */ + PORT->Group[1].PMUX[4].reg |= PORT_PMUX_PMUXE_B; + + /* Wait for bus synchronization. */ + while (ADC->STATUS.bit.SYNCBUSY) {}; + + /* Enable the ADC. */ + ADC->CTRLA.bit.ENABLE = true; + + /* Make one read and throw it away, as per the datasheet. */ + _bhb_read_adc(); + + return mp_const_none; +} + +STATIC mp_obj_t _bhb_read_adc(void) { + /* Wait for bus synchronization. */ + while (ADC->STATUS.bit.SYNCBUSY) {}; + + /* Start the ADC using a software trigger. */ + ADC->SWTRIG.bit.START = true; + + /* Wait for the result ready flag to be set. */ + while (ADC->INTFLAG.bit.RESRDY == 0); + + /* Clear the flag. */ + ADC->INTFLAG.reg = ADC_INTFLAG_RESRDY; + + /* Read the value. */ + uint32_t result = ADC->RESULT.reg; + + return MP_OBJ_NEW_SMALL_INT(result); +} + + +STATIC MP_DEFINE_CONST_FUN_OBJ_0(_bhb_init_adc_obj, _bhb_init_adc); +STATIC MP_DEFINE_CONST_FUN_OBJ_0(_bhb_read_adc_obj, _bhb_read_adc); + +STATIC const mp_rom_map_elem_t _bhb_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__bhb) }, + { MP_ROM_QSTR(MP_QSTR_init_adc), MP_ROM_PTR(&_bhb_init_adc_obj) }, + { MP_ROM_QSTR(MP_QSTR_read_adc), MP_ROM_PTR(&_bhb_read_adc_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(_bhb_module_globals, _bhb_module_globals_table); + +const mp_obj_module_t _bhb_user_cmodule = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&_bhb_module_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR__bhb, _bhb_user_cmodule, MODULE_BHB_ENABLED); diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/usermods/_bhb/micropython.mk b/ports/atmel-samd/boards/winterbloom_big_honking_button/usermods/_bhb/micropython.mk new file mode 100644 index 0000000000..9374ec34ea --- /dev/null +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/usermods/_bhb/micropython.mk @@ -0,0 +1,6 @@ +USERMODULES_DIR := $(USERMOD_DIR) + +# Add all C files to SRC_USERMOD. +SRC_USERMOD += $(USERMODULES_DIR)/bhb.c + +CFLAGS_USERMOD += -I$(USERMODULES_DIR) From efeae0d84fa1745595d26e66590c1944269b6aae Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Sun, 19 Jul 2020 12:27:35 -0700 Subject: [PATCH 0335/1293] fix 3169: Polygon.points property The getter for vectorio.Polygon#points was not updated with the data type change of the stored points list. This moves the implementation to shared_module and updates the data type to reflect the actual state. --- shared-bindings/vectorio/Polygon.c | 15 +-------------- shared-module/vectorio/Polygon.c | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/shared-bindings/vectorio/Polygon.c b/shared-bindings/vectorio/Polygon.c index 3443d9e426..1aca4611ea 100644 --- a/shared-bindings/vectorio/Polygon.c +++ b/shared-bindings/vectorio/Polygon.c @@ -49,20 +49,7 @@ static mp_obj_t vectorio_polygon_make_new(const mp_obj_type_t *type, size_t n_ar //| STATIC mp_obj_t vectorio_polygon_obj_get_points(mp_obj_t self_in) { vectorio_polygon_t *self = MP_OBJ_TO_PTR(self_in); - mp_obj_t list = mp_obj_new_list(0, NULL); - - size_t len = 0; - mp_obj_t *items; - mp_obj_list_get(common_hal_vectorio_polygon_get_points(self), &len, &items); - - for (size_t i = 0; i < len; i += 2) { - mp_obj_t tuple[] = { items[i], items[i+1] }; - mp_obj_list_append( - list, - mp_obj_new_tuple(2, tuple) - ); - } - return list; + return common_hal_vectorio_polygon_get_points(self); } MP_DEFINE_CONST_FUN_OBJ_1(vectorio_polygon_get_points_obj, vectorio_polygon_obj_get_points); diff --git a/shared-module/vectorio/Polygon.c b/shared-module/vectorio/Polygon.c index 0025d4bfc4..aeeaf02240 100644 --- a/shared-module/vectorio/Polygon.c +++ b/shared-module/vectorio/Polygon.c @@ -20,7 +20,7 @@ static void _clobber_points_list(vectorio_polygon_t *self, mp_obj_t points_tuple size_t len = 0; mp_obj_t *items; mp_obj_list_get(points_tuple_list, &len, &items); - VECTORIO_POLYGON_DEBUG("polygon_points_list len: %d\n", len); + VECTORIO_POLYGON_DEBUG(" self.len: %d, len: %d, ", self->len, len); if ( len < 3 ) { mp_raise_TypeError_varg(translate("Polygon needs at least 3 points")); @@ -28,9 +28,11 @@ static void _clobber_points_list(vectorio_polygon_t *self, mp_obj_t points_tuple if ( self->len < 2*len ) { if ( self->points_list != NULL ) { + VECTORIO_POLYGON_DEBUG("free(%d), ", sizeof(self->points_list)); gc_free( self->points_list ); } self->points_list = gc_alloc( 2 * len * sizeof(int), false, false ); + VECTORIO_POLYGON_DEBUG("alloc(%p, %d)", self->points_list, 2 * len * sizeof(int)); } self->len = 2*len; @@ -56,22 +58,35 @@ static void _clobber_points_list(vectorio_polygon_t *self, mp_obj_t points_tuple void common_hal_vectorio_polygon_construct(vectorio_polygon_t *self, mp_obj_t points_list) { - VECTORIO_POLYGON_DEBUG("%p polygon_construct\n", self); + VECTORIO_POLYGON_DEBUG("%p polygon_construct: ", self); self->points_list = NULL; self->len = 0; self->on_dirty.obj = NULL; _clobber_points_list( self, points_list ); + VECTORIO_POLYGON_DEBUG("\n"); } mp_obj_t common_hal_vectorio_polygon_get_points(vectorio_polygon_t *self) { - return self->points_list; + VECTORIO_POLYGON_DEBUG("%p common_hal_vectorio_polygon_get_points {len: %d, points_list: %p}\n", self, self->len, self->points_list); + mp_obj_t list = mp_obj_new_list(0, NULL); + + for (size_t i = 0; i < self->len; i += 2) { + mp_obj_t tuple[] = { mp_obj_new_int(self->points_list[i]), mp_obj_new_int(self->points_list[i+1]) }; + mp_obj_list_append( + list, + mp_obj_new_tuple(2, tuple) + ); + } + return list; } void common_hal_vectorio_polygon_set_points(vectorio_polygon_t *self, mp_obj_t points_list) { + VECTORIO_POLYGON_DEBUG("%p common_hal_vectorio_polygon_set_points: ", self); _clobber_points_list( self, points_list ); if (self->on_dirty.obj != NULL) { self->on_dirty.event(self->on_dirty.obj); } + VECTORIO_POLYGON_DEBUG("\n"); } void common_hal_vectorio_polygon_set_on_dirty(vectorio_polygon_t *self, vectorio_event_t notification) { From db43c56f794508689b07d931c16cadd3e98aad87 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 20 Jul 2020 08:44:39 -0500 Subject: [PATCH 0336/1293] background callbacks: Clear any callbacks that were queued Before this, a background callback that was on the list when background_callback_reset was called could have ended up in a state that made it "un-queueable": its "prev" pointer could have been non-NULL. --- supervisor/shared/background_callback.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c index d10579c4f9..8e12dd3625 100644 --- a/supervisor/shared/background_callback.c +++ b/supervisor/shared/background_callback.c @@ -24,6 +24,8 @@ * THE SOFTWARE. */ +#include + #include "py/gc.h" #include "py/mpconfig.h" #include "supervisor/background_callback.h" @@ -101,6 +103,12 @@ void background_callback_end_critical_section() { void background_callback_reset() { CALLBACK_CRITICAL_BEGIN; + background_callback_t *cb = (background_callback_t*)callback_head; + while(cb) { + background_callback_t *next = cb->next; + memset(cb, 0, sizeof(*cb)); + cb = next; + } callback_head = NULL; callback_tail = NULL; in_background_callback = false; From 9fd10322fedc4a7736118fdb6cb1480ad8da94f1 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 20 Jul 2020 08:45:31 -0500 Subject: [PATCH 0337/1293] supervisor: rename some locals for clarity It's perfectly OK for these variables with static linkage to have the same name, but it's inconvenient for humans like me. --- supervisor/shared/tick.c | 4 ++-- supervisor/shared/usb/usb.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index bc270030f3..4af59f78e3 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -66,7 +66,7 @@ static volatile uint64_t PLACE_IN_DTCM_BSS(background_ticks); -static background_callback_t callback; +static background_callback_t tick_callback; volatile uint64_t last_finished_tick = 0; @@ -119,7 +119,7 @@ void supervisor_tick(void) { #endif } #endif - background_callback_add(&callback, supervisor_background_tasks, NULL); + background_callback_add(&tick_callback, supervisor_background_tasks, NULL); } uint64_t supervisor_ticks_ms64() { diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index 472be96d52..36b5ec05d6 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -64,8 +64,8 @@ void usb_init(void) { tusb_init(); #if MICROPY_KBD_EXCEPTION - // Set Ctrl+C as wanted char, tud_cdc_rx_wanted_cb() callback will be invoked when Ctrl+C is received - // This callback always got invoked regardless of mp_interrupt_char value since we only set it once here + // Set Ctrl+C as wanted char, tud_cdc_rx_wanted_cb() usb_callback will be invoked when Ctrl+C is received + // This usb_callback always got invoked regardless of mp_interrupt_char value since we only set it once here tud_cdc_set_wanted_char(CHAR_CTRL_C); #endif @@ -83,14 +83,14 @@ void usb_background(void) { } } -static background_callback_t callback; +static background_callback_t usb_callback; static void usb_background_do(void* unused) { usb_background(); } void usb_irq_handler(void) { tud_int_handler(0); - background_callback_add(&callback, usb_background_do, NULL); + background_callback_add(&usb_callback, usb_background_do, NULL); } //--------------------------------------------------------------------+ From c243c13f026a4bd915f241e5fff5400aabea11ad Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 20 Jul 2020 08:52:35 -0500 Subject: [PATCH 0338/1293] framebufferio: Handle auto refresh flag at reset if we don't set the flag via accessor fn the tick enable might become wrong --- shared-module/displayio/__init__.c | 4 +--- shared-module/framebufferio/FramebufferDisplay.c | 5 +++++ shared-module/framebufferio/FramebufferDisplay.h | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index c898bbb98f..efc28470fb 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -190,9 +190,7 @@ void reset_displays(void) { common_hal_displayio_epaperdisplay_show(display, NULL); #if CIRCUITPY_FRAMEBUFFERIO } else if (displays[i].framebuffer_display.base.type == &framebufferio_framebufferdisplay_type) { - framebufferio_framebufferdisplay_obj_t* display = &displays[i].framebuffer_display; - display->auto_refresh = true; - common_hal_framebufferio_framebufferdisplay_show(display, NULL); + framebufferio_framebufferdisplay_reset(&displays[i].framebuffer_display); #endif } } diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 7d09e0baeb..2a90fa0d4a 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -318,3 +318,8 @@ void framebufferio_framebufferdisplay_collect_ptrs(framebufferio_framebufferdisp gc_collect_ptr(self->framebuffer); displayio_display_core_collect_ptrs(&self->core); } + +void framebufferio_framebufferdisplay_reset(framebufferio_framebufferdisplay_obj_t* self) { + common_hal_framebufferio_framebufferdisplay_set_auto_refresh(self, true); + common_hal_framebufferio_framebufferdisplay_show(self, NULL); +} diff --git a/shared-module/framebufferio/FramebufferDisplay.h b/shared-module/framebufferio/FramebufferDisplay.h index 1b68d2ab02..ca1ab984a3 100644 --- a/shared-module/framebufferio/FramebufferDisplay.h +++ b/shared-module/framebufferio/FramebufferDisplay.h @@ -55,6 +55,7 @@ typedef struct { void framebufferio_framebufferdisplay_background(framebufferio_framebufferdisplay_obj_t* self); void release_framebufferdisplay(framebufferio_framebufferdisplay_obj_t* self); void reset_framebufferdisplay(framebufferio_framebufferdisplay_obj_t* self); +void framebufferio_framebufferdisplay_reset(framebufferio_framebufferdisplay_obj_t* self); void framebufferio_framebufferdisplay_collect_ptrs(framebufferio_framebufferdisplay_obj_t* self); From e2d252a6d5f4b2425215e0a79f78b8cbfa657f9a Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Mon, 20 Jul 2020 10:12:29 -0700 Subject: [PATCH 0339/1293] pre-allocate list of known size --- shared-module/vectorio/Polygon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/vectorio/Polygon.c b/shared-module/vectorio/Polygon.c index aeeaf02240..c44c13fd73 100644 --- a/shared-module/vectorio/Polygon.c +++ b/shared-module/vectorio/Polygon.c @@ -69,7 +69,7 @@ void common_hal_vectorio_polygon_construct(vectorio_polygon_t *self, mp_obj_t po mp_obj_t common_hal_vectorio_polygon_get_points(vectorio_polygon_t *self) { VECTORIO_POLYGON_DEBUG("%p common_hal_vectorio_polygon_get_points {len: %d, points_list: %p}\n", self, self->len, self->points_list); - mp_obj_t list = mp_obj_new_list(0, NULL); + mp_obj_t list = mp_obj_new_list(self->len/2, NULL); for (size_t i = 0; i < self->len; i += 2) { mp_obj_t tuple[] = { mp_obj_new_int(self->points_list[i]), mp_obj_new_int(self->points_list[i+1]) }; From 389c81341dc7267a7f51c468d5e90602b76569ab Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 20 Jul 2020 18:16:20 -0700 Subject: [PATCH 0340/1293] Tweak declaration for boards with TCM --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index f1dfa63c6f..a571c547ab 100755 --- a/main.c +++ b/main.c @@ -98,7 +98,7 @@ void do_str(const char *src, mp_parse_input_kind_t input_kind) { } #if MICROPY_ENABLE_PYSTACK -static size_t PLACE_IN_DTCM_BSS(_pystack)[CIRCUITPY_PYSTACK_SIZE / sizeof(size_t)]; +static size_t PLACE_IN_DTCM_BSS(_pystack[CIRCUITPY_PYSTACK_SIZE / sizeof(size_t)]); #endif void start_mp(supervisor_allocation* heap) { @@ -130,7 +130,7 @@ void start_mp(supervisor_allocation* heap) { readline_init0(); #if MICROPY_ENABLE_PYSTACK - mp_pystack_init(_pystack, _pystack + sizeof(_pystack)); + mp_pystack_init(_pystack, _pystack + (sizeof(_pystack) / sizeof(size_t))); #endif #if MICROPY_ENABLE_GC From e977b427aa6783858ecccd4a69e17d08f039122c Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Mon, 20 Jul 2020 20:25:31 -0700 Subject: [PATCH 0341/1293] vectorio: fix VectorShape non-transposed pixel placement Fixes https://github.com/adafruit/circuitpython/issues/3170 The absolute transform needs to be subtracted in all cases, not only when the coordinate system is transposed. --- shared-module/vectorio/VectorShape.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-module/vectorio/VectorShape.c b/shared-module/vectorio/VectorShape.c index bfe8a7b259..81f46b3fa0 100644 --- a/shared-module/vectorio/VectorShape.c +++ b/shared-module/vectorio/VectorShape.c @@ -223,8 +223,8 @@ bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displ pixel_to_get_x = (input_pixel.y - self->absolute_transform->dy * self->x - self->absolute_transform->y) / self->absolute_transform->dy; pixel_to_get_y = (input_pixel.x - self->absolute_transform->dx * self->y - self->absolute_transform->x) / self->absolute_transform->dx; } else { - pixel_to_get_x = (input_pixel.x - self->absolute_transform->dx * self->x) / self->absolute_transform->dx; - pixel_to_get_y = (input_pixel.y - self->absolute_transform->dy * self->y) / self->absolute_transform->dy; + pixel_to_get_x = (input_pixel.x - self->absolute_transform->dx * self->x - self->absolute_transform->x) / self->absolute_transform->dx; + pixel_to_get_y = (input_pixel.y - self->absolute_transform->dy * self->y - self->absolute_transform->y) / self->absolute_transform->dy; } VECTORIO_SHAPE_PIXEL_DEBUG(" get_pixel %p (%3d, %3d) -> ( %3d, %3d )", self->ishape.shape, input_pixel.x, input_pixel.y, pixel_to_get_x, pixel_to_get_y); #ifdef VECTORIO_PERF From 49decf90c940f2e9810abcf40939db33a5803ab0 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 21 Jul 2020 10:11:08 -0500 Subject: [PATCH 0342/1293] Add option for higher optimization levels --- ports/atmel-samd/Makefile | 5 +++++ .../atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/pybadge/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/pyportal/mpconfigboard.mk | 2 ++ ports/cxd56/Makefile | 5 +++++ ports/esp32s2/Makefile | 4 ++++ ports/litex/Makefile | 4 ++++ ports/mimxrt10xx/Makefile | 4 ++++ ports/nrf/Makefile | 3 +++ ports/stm/Makefile | 4 ++++ 10 files changed, 35 insertions(+) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index eedcc94a92..9fa43af21e 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -106,6 +106,11 @@ CFLAGS += -Os -DNDEBUG CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD51 -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 +ifdef OPTIMIZATION_LEVEL +CFLAGS += -O$(OPTIMIZATION_LEVEL) +endif + + $(echo PERIPHERALS_CHIP_FAMILY=$(PERIPHERALS_CHIP_FAMILY)) #Debugging/Optimization ifeq ($(DEBUG), 1) diff --git a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk index eb02d3c270..d32dcf3d19 100644 --- a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk @@ -15,3 +15,5 @@ LONGINT_IMPL = MPZ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANG_APA102 = 1 + +OPTIMIZATION_LEVEL = 2 diff --git a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk index 7a213faf4c..e898d0dda5 100644 --- a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk @@ -16,3 +16,5 @@ CIRCUITPY_GAMEPADSHIFT = 1 CIRCUITPY_STAGE = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pybadge + +OPTIMIZATION_LEVEL = 2 diff --git a/ports/atmel-samd/boards/pyportal/mpconfigboard.mk b/ports/atmel-samd/boards/pyportal/mpconfigboard.mk index 149141a4e3..8a197fbf02 100644 --- a/ports/atmel-samd/boards/pyportal/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyportal/mpconfigboard.mk @@ -10,3 +10,5 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C" LONGINT_IMPL = MPZ + +OPTIMIZATION_LEVEL = 2 diff --git a/ports/cxd56/Makefile b/ports/cxd56/Makefile index 3766d42228..6838270a61 100644 --- a/ports/cxd56/Makefile +++ b/ports/cxd56/Makefile @@ -123,6 +123,11 @@ CFLAGS += \ -fdata-sections \ -Wall \ +ifdef OPTIMIZATION_LEVEL +CFLAGS += -O$(OPTIMIZATION_LEVEL) +endif + + LIBM = "${shell "$(CC)" $(CFLAGS) -print-file-name=libm.a}" LIBGCC = "${shell "$(CC)" $(CFLAGS) -print-libgcc-file-name}" diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 29abcab8e3..ec6a8fc0c4 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -109,6 +109,10 @@ else ### CFLAGS += -flto endif +ifdef OPTIMIZATION_LEVEL +CFLAGS += -O$(OPTIMIZATION_LEVEL) +endif + CFLAGS += $(INC) -Werror -Wall -mlongcalls -std=gnu11 -Wl,--gc-sections $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) LDFLAGS = $(CFLAGS) -Wl,-nostdlib -Wl,-Map=$@.map -Wl,-cref diff --git a/ports/litex/Makefile b/ports/litex/Makefile index 29149942c9..7ddf3c0610 100644 --- a/ports/litex/Makefile +++ b/ports/litex/Makefile @@ -83,6 +83,10 @@ else ### CFLAGS += -flto endif +ifdef OPTIMIZATION_LEVEL +CFLAGS += -O$(OPTIMIZATION_LEVEL) +endif + CFLAGS += $(INC) -Werror -Wall -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) # TODO: check this diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index d82b625e74..2201d92a31 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -108,6 +108,10 @@ CFLAGS += \ -Os -g3 -Wno-unused-parameter \ -ffunction-sections -fdata-sections -fstack-usage +ifdef OPTIMIZATION_LEVEL +CFLAGS += -O$(OPTIMIZATION_LEVEL) +endif + LD_FILES = $(wildcard boards/$(BOARD)/*.ld) $(addprefix linking/, flash/$(FLASH).ld chip_family/$(CHIP_FAMILY).ld common.ld) LD_SCRIPT_FLAG := -Wl,-T, diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index e1d86f7bc1..28fd44b852 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -92,6 +92,9 @@ else CFLAGS += -flto -flto-partition=none endif +ifdef OPTIMIZATION_LEVEL +CFLAGS += -O$(OPTIMIZATION_LEVEL) +endif CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) diff --git a/ports/stm/Makefile b/ports/stm/Makefile index e2dc2346e2..8753bd8f84 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -91,6 +91,10 @@ else # CFLAGS += -flto endif +ifdef OPTIMIZATION_LEVEL +CFLAGS += -O$(OPTIMIZATION_LEVEL) +endif + # MCU Series is defined by the HAL package and doesn't need to be specified here C_DEFS = -D$(MCU_PACKAGE) -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -D$(MCU_VARIANT) From a29105fefd4fdf791376edf2df1a5d8b4c976974 Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Wed, 22 Jul 2020 00:37:22 +0900 Subject: [PATCH 0343/1293] Improve .pyi generation --- .github/workflows/build.yml | 2 +- tools/extract_pyi.py | 142 ++++++++++++++++++++++++++++-------- 2 files changed, 112 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5ccfb71c8..d809ba8cb6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: run: | sudo apt-get install -y eatmydata sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 - pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid + pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort - name: Versions run: | gcc --version diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index b9366f6bab..e5da610352 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -2,24 +2,91 @@ # # SPDX-License-Identifier: MIT +import ast import os +import re import sys -import astroid import traceback -top_level = sys.argv[1].strip("/") -stub_directory = sys.argv[2] +import isort + + +IMPORTS_IGNORE = frozenset({'int', 'float', 'bool', 'str', 'bytes', 'tuple', 'list', 'set', 'dict', 'bytearray', 'file', 'buffer'}) +IMPORTS_TYPING = frozenset({'Any', 'Optional', 'Union', 'Tuple', 'List', 'Sequence'}) +IMPORTS_TYPESHED = frozenset({'ReadableBuffer', 'WritableBuffer'}) + + +def is_any(node): + node_type = type(node) + if node is None: + return True + if node_type == ast.Name and node.id == "Any": + return True + if (node_type == ast.Attribute and type(node.value) == ast.Name + and node.value.id == "typing" and node.attr == "Any"): + return True + return False + + +def report_missing_annotations(tree): + for node in ast.walk(tree): + node_type = type(node) + if node_type == ast.AnnAssign: + if is_any(node.annotation): + print(f"Missing attribute type on line {node.lineno}") + elif node_type == ast.arg: + if is_any(node.annotation) and node.arg != "self": + print(f"Missing argument type: {node.arg} on line {node.lineno}") + elif node_type == ast.FunctionDef: + if is_any(node.returns) and node.name != "__init__": + print(f"Missing return type: {node.name} on line {node.lineno}") + + +def extract_imports(tree): + modules = set() + typing = set() + typeshed = set() + + def collect_annotations(anno_tree): + if anno_tree is None: + return + for node in ast.walk(anno_tree): + node_type = type(node) + if node_type == ast.Name: + if node.id in IMPORTS_IGNORE: + continue + elif node.id in IMPORTS_TYPING: + typing.add(node.id) + elif node.id in IMPORTS_TYPESHED: + typeshed.add(node.id) + elif not node.id[0].isupper(): + modules.add(node.id) + + for node in ast.walk(tree): + node_type = type(node) + if (node_type == ast.AnnAssign) or (node_type == ast.arg): + collect_annotations(node.annotation) + elif node_type == ast.FunctionDef: + collect_annotations(node.returns) + + return { + "modules": sorted(modules), + "typing": sorted(typing), + "typeshed": sorted(typeshed), + } + def convert_folder(top_level, stub_directory): ok = 0 total = 0 filenames = sorted(os.listdir(top_level)) pyi_lines = [] + for filename in filenames: full_path = os.path.join(top_level, filename) file_lines = [] if os.path.isdir(full_path): - mok, mtotal = convert_folder(full_path, os.path.join(stub_directory, filename)) + (mok, mtotal) = convert_folder(full_path, os.path.join(stub_directory, filename)) ok += mok total += mtotal elif filename.endswith(".c"): @@ -44,44 +111,57 @@ def convert_folder(top_level, stub_directory): pyi_lines.extend(file_lines) if not pyi_lines: - return ok, total + return (ok, total) stub_filename = os.path.join(stub_directory, "__init__.pyi") print(stub_filename) stub_contents = "".join(pyi_lines) - os.makedirs(stub_directory, exist_ok=True) - with open(stub_filename, "w") as f: - f.write(stub_contents) # Validate that the module is a parseable stub. total += 1 try: - tree = astroid.parse(stub_contents) - for i in tree.body: - if 'name' in i.__dict__: - print(i.__dict__['name']) - for j in i.body: - if isinstance(j, astroid.scoped_nodes.FunctionDef): - if None in j.args.__dict__['annotations']: - print(f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n") - if j.returns: - if 'Any' in j.returns.__dict__.values(): - print(f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}") - elif isinstance(j, astroid.node_classes.AnnAssign): - if 'name' in j.__dict__['annotation'].__dict__: - if j.__dict__['annotation'].__dict__['name'] == 'Any': - print(f"missing attribute type on line {j.__dict__['lineno']}") - + tree = ast.parse(stub_contents) + imports = extract_imports(tree) + report_missing_annotations(tree) ok += 1 - except astroid.exceptions.AstroidSyntaxError as e: - e = e.__cause__ + except SyntaxError as e: traceback.print_exception(type(e), e, e.__traceback__) + return (ok, total) + + # Add import statements + import_lines = ["from __future__ import annotations"] + import_lines.extend(f"import {m}" for m in imports["modules"]) + import_lines.append("from typing import " + ", ".join(imports["typing"])) + import_lines.append("from _typeshed import " + ", ".join(imports["typeshed"])) + import_body = "\n".join(import_lines) + m = re.match(r'(\s*""".*?""")', stub_contents, flags=re.DOTALL) + if m: + stub_contents = m.group(1) + "\n\n" + import_body + "\n\n" + stub_contents[m.end():] + else: + stub_contents = import_body + "\n\n" + stub_contents + stub_contents = isort.code(stub_contents) + + # Adjust blank lines + stub_contents = re.sub(r"\n+class", "\n\n\nclass", stub_contents) + stub_contents = re.sub(r"\n+def", "\n\n\ndef", stub_contents) + stub_contents = re.sub(r"\n+^(\s+)def", lambda m: f"\n\n{m.group(1)}def", stub_contents, flags=re.M) + stub_contents = stub_contents.strip() + "\n" + + os.makedirs(stub_directory, exist_ok=True) + with open(stub_filename, "w") as f: + f.write(stub_contents) + print() - return ok, total + return (ok, total) -ok, total = convert_folder(top_level, stub_directory) -print(f"{ok} ok out of {total}") +if __name__ == "__main__": + top_level = sys.argv[1].strip("/") + stub_directory = sys.argv[2] -if ok != total: - sys.exit(total - ok) + (ok, total) = convert_folder(top_level, stub_directory) + + print(f"Parsing .pyi files: {total - ok} failed, {ok} passed") + + if ok != total: + sys.exit(total - ok) From 678faff464fa7810dfc12e75f73029d8e3106f0c Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 21 Jul 2020 11:02:23 -0700 Subject: [PATCH 0344/1293] Be more aggressive with uChip build --- ports/atmel-samd/boards/uchip/mpconfigboard.mk | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index 196068a1e0..0e5eda0b8d 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -10,9 +10,5 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 -# Tweak inlining depending on language. -ifeq ($(TRANSLATION), zh_Latn_pinyin) +# Always use aggressive inlining CFLAGS_INLINE_LIMIT = 45 -else -CFLAGS_INLINE_LIMIT = 70 -endif From 5e3a853db4ad735e3ae1c115cab3ef213a338f0d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 21 Jul 2020 12:51:59 -0700 Subject: [PATCH 0345/1293] Turn off GC opt on uchip board --- ports/atmel-samd/boards/uchip/mpconfigboard.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index 0e5eda0b8d..d08690a15a 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -12,3 +12,5 @@ CIRCUITPY_FULL_BUILD = 0 # Always use aggressive inlining CFLAGS_INLINE_LIMIT = 45 + +SUPEROPT_GC = 0 From 900edb2b8e118ff36b708afe65363e5929f00ad8 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 21 Jul 2020 13:08:42 -0700 Subject: [PATCH 0346/1293] Only add .find without CPYTHON_COMPAT --- py/objarray.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/py/objarray.c b/py/objarray.c index 83defa343d..7bd8bacb0c 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -412,10 +412,7 @@ STATIC mp_obj_t buffer_finder(size_t n_args, const mp_obj_t *args, int direction mp_get_buffer_raise(args[1], &needle_bufinfo, MP_BUFFER_READ); if (mp_binary_get_size('@', needle_bufinfo.typecode, NULL) != 1) { - const qstr src_name = mp_obj_get_type(args[1])->name; - nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError, - translate("'%q' object is not bytes-like"), - src_name)); + mp_raise_TypeError(translate("a bytes-like object is required")); } const byte *start = haystack_bufinfo.buf; @@ -447,6 +444,7 @@ STATIC mp_obj_t buffer_find(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(buffer_find_obj, 2, 4, buffer_find); +#if MICROPY_CPYTHON_COMPAT STATIC mp_obj_t buffer_rfind(size_t n_args, const mp_obj_t *args) { return buffer_finder(n_args, args, -1, false); } @@ -461,6 +459,7 @@ STATIC mp_obj_t buffer_rindex(size_t n_args, const mp_obj_t *args) { return buffer_finder(n_args, args, -1, true); } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(buffer_rindex_obj, 2, 4, buffer_rindex); +#endif #endif @@ -646,11 +645,11 @@ STATIC const mp_rom_map_elem_t bytearray_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_extend), MP_ROM_PTR(&array_extend_obj) }, { MP_ROM_QSTR(MP_QSTR_find), MP_ROM_PTR(&buffer_find_obj) }, +#if MICROPY_CPYTHON_COMPAT { MP_ROM_QSTR(MP_QSTR_rfind), MP_ROM_PTR(&buffer_rfind_obj) }, { MP_ROM_QSTR(MP_QSTR_index), MP_ROM_PTR(&buffer_index_obj) }, { MP_ROM_QSTR(MP_QSTR_rindex), MP_ROM_PTR(&buffer_rindex_obj) }, -#if MICROPY_CPYTHON_COMPAT { MP_ROM_QSTR(MP_QSTR_decode), MP_ROM_PTR(&array_decode_obj) }, #endif }; From 6db10f9c7deba015dc89090f0957ebbd742cfa8e Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 21 Jul 2020 15:40:51 -0700 Subject: [PATCH 0347/1293] Turn off find when CPYTHON_COMPAT is off --- py/objarray.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/py/objarray.c b/py/objarray.c index 7bd8bacb0c..5d83f06977 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -400,7 +400,7 @@ STATIC mp_obj_t array_extend(mp_obj_t self_in, mp_obj_t arg_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_2(array_extend_obj, array_extend); #endif -#if MICROPY_PY_BUILTINS_BYTEARRAY +#if MICROPY_PY_BUILTINS_BYTEARRAY && MICROPY_CPYTHON_COMPAT STATIC mp_obj_t buffer_finder(size_t n_args, const mp_obj_t *args, int direction, bool is_index) { mp_check_self(MP_OBJ_IS_TYPE(args[0], &mp_type_bytearray)); const mp_obj_type_t *self_type = mp_obj_get_type(args[0]); @@ -444,7 +444,6 @@ STATIC mp_obj_t buffer_find(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(buffer_find_obj, 2, 4, buffer_find); -#if MICROPY_CPYTHON_COMPAT STATIC mp_obj_t buffer_rfind(size_t n_args, const mp_obj_t *args) { return buffer_finder(n_args, args, -1, false); } @@ -461,8 +460,6 @@ STATIC mp_obj_t buffer_rindex(size_t n_args, const mp_obj_t *args) { MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(buffer_rindex_obj, 2, 4, buffer_rindex); #endif -#endif - STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value) { if (value == MP_OBJ_NULL) { // delete item @@ -644,8 +641,8 @@ STATIC const mp_rom_map_elem_t bytearray_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_append), MP_ROM_PTR(&array_append_obj) }, { MP_ROM_QSTR(MP_QSTR_extend), MP_ROM_PTR(&array_extend_obj) }, - { MP_ROM_QSTR(MP_QSTR_find), MP_ROM_PTR(&buffer_find_obj) }, #if MICROPY_CPYTHON_COMPAT + { MP_ROM_QSTR(MP_QSTR_find), MP_ROM_PTR(&buffer_find_obj) }, { MP_ROM_QSTR(MP_QSTR_rfind), MP_ROM_PTR(&buffer_rfind_obj) }, { MP_ROM_QSTR(MP_QSTR_index), MP_ROM_PTR(&buffer_index_obj) }, { MP_ROM_QSTR(MP_QSTR_rindex), MP_ROM_PTR(&buffer_rindex_obj) }, From db5c3c967685036a5512406ebd3955c3f12b776d Mon Sep 17 00:00:00 2001 From: root Date: Tue, 21 Jul 2020 17:54:47 -0500 Subject: [PATCH 0348/1293] dded optimization for esp32s2 --- ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk index 6e76272659..0ccfe06ed7 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk @@ -17,3 +17,5 @@ CIRCUITPY_ESP_FLASH_FREQ=40m CIRCUITPY_ESP_FLASH_SIZE=4MB CIRCUITPY_MODULE=wroom + +OPTIMIZATION_LEVEL = 2 From ee019a96bae776661a7401e0f34cf633c908a42b Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 21 Jul 2020 16:08:41 -0700 Subject: [PATCH 0349/1293] Updates based on review --- shared-bindings/memorymonitor/AllocationSize.c | 2 +- shared-bindings/memorymonitor/__init__.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/memorymonitor/AllocationSize.c b/shared-bindings/memorymonitor/AllocationSize.c index 3e0e31336f..5016744413 100644 --- a/shared-bindings/memorymonitor/AllocationSize.c +++ b/shared-bindings/memorymonitor/AllocationSize.c @@ -38,7 +38,7 @@ //| def __init__(self): //| """Tracks the number of allocations in power of two buckets. //| -//| It will have 16 16bit buckets to track allocation counts. It is total allocations +//| It will have 16 16-bit buckets to track allocation counts. It is total allocations //| meaning frees are ignored. Reallocated memory is counted twice, at allocation and when //| reallocated with the larger size. //| diff --git a/shared-bindings/memorymonitor/__init__.c b/shared-bindings/memorymonitor/__init__.c index bfd5bf6d83..98f48f5251 100644 --- a/shared-bindings/memorymonitor/__init__.c +++ b/shared-bindings/memorymonitor/__init__.c @@ -36,9 +36,9 @@ //| """Memory monitoring helpers""" //| -//| class AllocationException: +//| class AllocationError: //| def __init__(self, Exception: Any): -//| """Catch all exception for Bluetooth related errors.""" +//| """Catchall exception for allocation related errors.""" //| ... MP_DEFINE_MEMORYMONITOR_EXCEPTION(AllocationError, Exception) From 8ff2846bb2a54ed34a9a73fffc3e154382d89e58 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 21 Jul 2020 16:21:49 -0700 Subject: [PATCH 0350/1293] Disable countio on circuitbrains basic --- ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk index da5f1ffac8..619b7d6944 100755 --- a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk @@ -12,6 +12,7 @@ EXTERNAL_FLASH_DEVICES = "W25Q32JV_IQ" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 From eb24653d3ffa85dbe5209d5834bb87f76a7c57e1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 21 Jul 2020 18:30:29 -0700 Subject: [PATCH 0351/1293] Fix BluetoothError doc typo we copied --- shared-bindings/_bleio/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/_bleio/__init__.c b/shared-bindings/_bleio/__init__.c index 90b185f79a..91e94e25cd 100644 --- a/shared-bindings/_bleio/__init__.c +++ b/shared-bindings/_bleio/__init__.c @@ -61,7 +61,7 @@ //| class BluetoothError: //| def __init__(self, Exception: Any): -//| """Catch all exception for Bluetooth related errors.""" +//| """Catchall exception for Bluetooth related errors.""" //| ... MP_DEFINE_BLEIO_EXCEPTION(BluetoothError, Exception) From 946373fdcd0d29fabbee7953099b8056c6a29cd8 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 22 Jul 2020 14:17:06 +0200 Subject: [PATCH 0352/1293] 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 | 8 ++++++-- locale/cs.po | 8 ++++++-- locale/de_DE.po | 8 ++++++-- locale/es.po | 8 ++++++-- locale/fil.po | 8 ++++++-- locale/fr.po | 8 ++++++-- locale/it_IT.po | 8 ++++++-- locale/ko.po | 8 ++++++-- locale/nl.po | 8 ++++++-- locale/pl.po | 8 ++++++-- locale/pt_BR.po | 8 ++++++-- locale/sv.po | 8 ++++++-- locale/zh_Latn_pinyin.po | 8 ++++++-- 13 files changed, 78 insertions(+), 26 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 9e10156e6a..c85b8edfe5 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-07 14:38-0500\n" +"POT-Creation-Date: 2020-07-17 18:03-0700\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -111,6 +111,10 @@ msgstr "%q() mengambil posisi argumen %d tapi %d yang diberikan" msgid "'%q' argument required" msgstr "'%q' argumen dibutuhkan" +#: py/objarray.c +msgid "'%q' object is not bytes-like" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -3137,7 +3141,7 @@ msgstr "struct: index keluar dari jangkauan" msgid "struct: no fields" msgstr "struct: tidak ada fields" -#: py/objstr.c +#: py/objarray.c py/objstr.c msgid "substring not found" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index d09cf1e94b..2cecbcc109 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-07 14:38-0500\n" +"POT-Creation-Date: 2020-07-17 18:03-0700\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -111,6 +111,10 @@ msgstr "" msgid "'%q' argument required" msgstr "" +#: py/objarray.c +msgid "'%q' object is not bytes-like" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -3106,7 +3110,7 @@ msgstr "" msgid "struct: no fields" msgstr "" -#: py/objstr.c +#: py/objarray.c py/objstr.c msgid "substring not found" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 1e168db528..014cd749f7 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-07 14:38-0500\n" +"POT-Creation-Date: 2020-07-17 18:03-0700\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -110,6 +110,10 @@ msgstr "%q() nimmt %d Argumente ohne Keyword an, aber es wurden %d angegeben" msgid "'%q' argument required" msgstr "'%q' Argument erforderlich" +#: py/objarray.c +msgid "'%q' object is not bytes-like" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -3190,7 +3194,7 @@ msgstr "struct: index außerhalb gültigen Bereichs" msgid "struct: no fields" msgstr "struct: keine Felder" -#: py/objstr.c +#: py/objarray.c py/objstr.c msgid "substring not found" msgstr "substring nicht gefunden" diff --git a/locale/es.po b/locale/es.po index 0dd09a98df..2ebad85e90 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-07 14:38-0500\n" +"POT-Creation-Date: 2020-07-17 18:03-0700\n" "PO-Revision-Date: 2020-07-13 19:24+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -115,6 +115,10 @@ msgstr "%q() toma %d argumentos posicionales pero %d fueron dados" msgid "'%q' argument required" msgstr "argumento '%q' requerido" +#: py/objarray.c +msgid "'%q' object is not bytes-like" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -3174,7 +3178,7 @@ msgstr "struct: index fuera de rango" msgid "struct: no fields" msgstr "struct: sin campos" -#: py/objstr.c +#: py/objarray.c py/objstr.c msgid "substring not found" msgstr "substring no encontrado" diff --git a/locale/fil.po b/locale/fil.po index 1297ce186d..e359829309 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-07 14:38-0500\n" +"POT-Creation-Date: 2020-07-17 18:03-0700\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -106,6 +106,10 @@ msgstr "" msgid "'%q' argument required" msgstr "'%q' argument kailangan" +#: py/objarray.c +msgid "'%q' object is not bytes-like" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -3153,7 +3157,7 @@ msgstr "struct: index hindi maabot" msgid "struct: no fields" msgstr "struct: walang fields" -#: py/objstr.c +#: py/objarray.c py/objstr.c msgid "substring not found" msgstr "substring hindi nahanap" diff --git a/locale/fr.po b/locale/fr.po index 4582974d45..6dffd41eb5 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-07 14:38-0500\n" +"POT-Creation-Date: 2020-07-17 18:03-0700\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" "Language: fr\n" @@ -115,6 +115,10 @@ msgstr "%q() prend %d arguments positionnels mais %d ont été donnés" msgid "'%q' argument required" msgstr "'%q' argument requis" +#: py/objarray.c +msgid "'%q' object is not bytes-like" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -3197,7 +3201,7 @@ msgstr "struct : index hors limites" msgid "struct: no fields" msgstr "struct : aucun champs" -#: py/objstr.c +#: py/objarray.c py/objstr.c msgid "substring not found" msgstr "sous-chaîne non trouvée" diff --git a/locale/it_IT.po b/locale/it_IT.po index 2358433825..92b8fbaaa3 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-07 14:38-0500\n" +"POT-Creation-Date: 2020-07-17 18:03-0700\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -105,6 +105,10 @@ msgstr "%q() prende %d argomenti posizionali ma ne sono stati forniti %d" msgid "'%q' argument required" msgstr "'%q' argomento richiesto" +#: py/objarray.c +msgid "'%q' object is not bytes-like" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -3160,7 +3164,7 @@ msgstr "struct: indice fuori intervallo" msgid "struct: no fields" msgstr "struct: nessun campo" -#: py/objstr.c +#: py/objarray.c py/objstr.c msgid "substring not found" msgstr "sottostringa non trovata" diff --git a/locale/ko.po b/locale/ko.po index 6829f6819f..8aa96e9017 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-07 14:38-0500\n" +"POT-Creation-Date: 2020-07-17 18:03-0700\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -105,6 +105,10 @@ msgstr "" msgid "'%q' argument required" msgstr "" +#: py/objarray.c +msgid "'%q' object is not bytes-like" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -3103,7 +3107,7 @@ msgstr "" msgid "struct: no fields" msgstr "" -#: py/objstr.c +#: py/objarray.c py/objstr.c msgid "substring not found" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index d39d0bb189..253d18a04c 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-07 14:38-0500\n" +"POT-Creation-Date: 2020-07-17 18:03-0700\n" "PO-Revision-Date: 2020-07-13 17:39+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -111,6 +111,10 @@ msgstr "%q() verwacht %d positionele argumenten maar kreeg %d" msgid "'%q' argument required" msgstr "'%q' argument vereist" +#: py/objarray.c +msgid "'%q' object is not bytes-like" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -3162,7 +3166,7 @@ msgstr "struct: index buiten bereik" msgid "struct: no fields" msgstr "struct: geen velden" -#: py/objstr.c +#: py/objarray.c py/objstr.c msgid "substring not found" msgstr "deelreeks niet gevonden" diff --git a/locale/pl.po b/locale/pl.po index e8b7298a2a..b2b2d7a16d 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-07 14:38-0500\n" +"POT-Creation-Date: 2020-07-17 18:03-0700\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -105,6 +105,10 @@ msgstr "%q() bierze %d argumentów pozycyjnych, lecz podano %d" msgid "'%q' argument required" msgstr "'%q' wymaga argumentu" +#: py/objarray.c +msgid "'%q' object is not bytes-like" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -3110,7 +3114,7 @@ msgstr "struct: indeks poza zakresem" msgid "struct: no fields" msgstr "struct: brak pól" -#: py/objstr.c +#: py/objarray.c py/objstr.c msgid "substring not found" msgstr "brak pod-łańcucha" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 024608b3db..b7062f5f0a 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-07 14:38-0500\n" +"POT-Creation-Date: 2020-07-17 18:03-0700\n" "PO-Revision-Date: 2020-07-09 17:23+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -111,6 +111,10 @@ msgstr "%q() recebe %d argumentos posicionais, porém %d foram informados" msgid "'%q' argument required" msgstr "'%q' argumento(s) requerido(s)" +#: py/objarray.c +msgid "'%q' object is not bytes-like" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -3186,7 +3190,7 @@ msgstr "struct: índice fora do intervalo" msgid "struct: no fields" msgstr "struct: sem campos" -#: py/objstr.c +#: py/objarray.c py/objstr.c msgid "substring not found" msgstr "a substring não foi encontrada" diff --git a/locale/sv.po b/locale/sv.po index b588cbea7e..ffec64bfea 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-07 14:38-0500\n" +"POT-Creation-Date: 2020-07-17 18:03-0700\n" "PO-Revision-Date: 2020-07-13 17:39+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -111,6 +111,10 @@ msgstr "%q() kräver %d positionsargument men %d gavs" msgid "'%q' argument required" msgstr "'%q' argument krävs" +#: py/objarray.c +msgid "'%q' object is not bytes-like" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -3155,7 +3159,7 @@ msgstr "struct: index utanför intervallet" msgid "struct: no fields" msgstr "struct: inga fält" -#: py/objstr.c +#: py/objarray.c py/objstr.c msgid "substring not found" msgstr "det gick inte att hitta delsträng" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 0f6d55fd16..6c19fb67cd 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-07 14:38-0500\n" +"POT-Creation-Date: 2020-07-17 18:03-0700\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -111,6 +111,10 @@ msgstr "%q() cǎiyòng %d wèizhì cānshù, dàn gěi chū %d" msgid "'%q' argument required" msgstr "xūyào '%q' cānshù" +#: py/objarray.c +msgid "'%q' object is not bytes-like" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -3140,7 +3144,7 @@ msgstr "jiégòu: suǒyǐn chāochū fànwéi" msgid "struct: no fields" msgstr "jiégòu: méiyǒu zìduàn" -#: py/objstr.c +#: py/objarray.c py/objstr.c msgid "substring not found" msgstr "wèi zhǎodào zi zìfú chuàn" From 2aef9b02bd8774bf98bb98a150160fdfa8b44f54 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 22 Jul 2020 11:33:19 -0500 Subject: [PATCH 0353/1293] update --- frozen/circuitpython-stage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frozen/circuitpython-stage b/frozen/circuitpython-stage index 9596a5904e..0d2c083a2f 160000 --- a/frozen/circuitpython-stage +++ b/frozen/circuitpython-stage @@ -1 +1 @@ -Subproject commit 9596a5904ed757e6fbffcf03e7aa77ae9ecf5223 +Subproject commit 0d2c083a2fb57a1562d4806775f45273abbfbfae From d83a4ac72db90253089fb33e6f01d6da8f99f8b3 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 22 Jul 2020 12:44:41 -0500 Subject: [PATCH 0354/1293] Changes to add compiler optimization option --- ports/atmel-samd/Makefile | 2 +- ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk | 1 - ports/atmel-samd/boards/pybadge/mpconfigboard.mk | 1 - ports/atmel-samd/boards/pyportal/mpconfigboard.mk | 1 - ports/cxd56/Makefile | 1 + ports/esp32s2/Makefile | 1 + ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk | 1 - ports/litex/Makefile | 1 + ports/mimxrt10xx/Makefile | 1 + ports/nrf/Makefile | 1 + ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk | 2 ++ ports/stm/Makefile | 1 + ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk | 2 ++ 13 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 9fa43af21e..f92e993331 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -106,11 +106,11 @@ CFLAGS += -Os -DNDEBUG CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD51 -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 +# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk ifdef OPTIMIZATION_LEVEL CFLAGS += -O$(OPTIMIZATION_LEVEL) endif - $(echo PERIPHERALS_CHIP_FAMILY=$(PERIPHERALS_CHIP_FAMILY)) #Debugging/Optimization ifeq ($(DEBUG), 1) diff --git a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk index d32dcf3d19..7e44d0c721 100644 --- a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk @@ -15,5 +15,4 @@ LONGINT_IMPL = MPZ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANG_APA102 = 1 - OPTIMIZATION_LEVEL = 2 diff --git a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk index e898d0dda5..d766dbe582 100644 --- a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk @@ -16,5 +16,4 @@ CIRCUITPY_GAMEPADSHIFT = 1 CIRCUITPY_STAGE = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pybadge - OPTIMIZATION_LEVEL = 2 diff --git a/ports/atmel-samd/boards/pyportal/mpconfigboard.mk b/ports/atmel-samd/boards/pyportal/mpconfigboard.mk index 8a197fbf02..66badb7412 100644 --- a/ports/atmel-samd/boards/pyportal/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyportal/mpconfigboard.mk @@ -10,5 +10,4 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C" LONGINT_IMPL = MPZ - OPTIMIZATION_LEVEL = 2 diff --git a/ports/cxd56/Makefile b/ports/cxd56/Makefile index 6838270a61..8a23059b72 100644 --- a/ports/cxd56/Makefile +++ b/ports/cxd56/Makefile @@ -123,6 +123,7 @@ CFLAGS += \ -fdata-sections \ -Wall \ +# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk ifdef OPTIMIZATION_LEVEL CFLAGS += -O$(OPTIMIZATION_LEVEL) endif diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index ec6a8fc0c4..f094150d7a 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -109,6 +109,7 @@ else ### CFLAGS += -flto endif +# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk ifdef OPTIMIZATION_LEVEL CFLAGS += -O$(OPTIMIZATION_LEVEL) endif diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk index 0ccfe06ed7..70caacf87e 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk @@ -17,5 +17,4 @@ CIRCUITPY_ESP_FLASH_FREQ=40m CIRCUITPY_ESP_FLASH_SIZE=4MB CIRCUITPY_MODULE=wroom - OPTIMIZATION_LEVEL = 2 diff --git a/ports/litex/Makefile b/ports/litex/Makefile index 7ddf3c0610..6f083e5d4d 100644 --- a/ports/litex/Makefile +++ b/ports/litex/Makefile @@ -83,6 +83,7 @@ else ### CFLAGS += -flto endif +# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk ifdef OPTIMIZATION_LEVEL CFLAGS += -O$(OPTIMIZATION_LEVEL) endif diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 2201d92a31..bfc73d6382 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -108,6 +108,7 @@ CFLAGS += \ -Os -g3 -Wno-unused-parameter \ -ffunction-sections -fdata-sections -fstack-usage +# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk ifdef OPTIMIZATION_LEVEL CFLAGS += -O$(OPTIMIZATION_LEVEL) endif diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 28fd44b852..d3c311e3fc 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -92,6 +92,7 @@ else CFLAGS += -flto -flto-partition=none endif +# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk ifdef OPTIMIZATION_LEVEL CFLAGS += -O$(OPTIMIZATION_LEVEL) endif diff --git a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk index 38c9933340..db0259423d 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk +++ b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk @@ -14,3 +14,5 @@ EXTERNAL_FLASH_DEVICES = "GD25Q16C" # We use a CFLAGS define here because there are include order issues # if we try to include "mpconfigport.h" into nrfx_config.h . CFLAGS += -DCIRCUITPY_NRF_NUM_I2C=2 + +OPTIMIZATION_LEVEL = 2 diff --git a/ports/stm/Makefile b/ports/stm/Makefile index 8753bd8f84..411d8146ce 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -91,6 +91,7 @@ else # CFLAGS += -flto endif +# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk ifdef OPTIMIZATION_LEVEL CFLAGS += -O$(OPTIMIZATION_LEVEL) endif diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk index 2b2c0d6db5..e7b54af5c8 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk @@ -15,3 +15,5 @@ LD_COMMON = boards/common_default.ld LD_DEFAULT = boards/STM32F405_default.ld LD_BOOT = boards/STM32F405_boot.ld # UF2 boot option UF2_OFFSET = 0x8010000 + +OPTIMIZATION_LEVEL = 2 From 138189bad130569ac9a9b3051543b804db54ec6f Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 22 Jul 2020 13:58:57 -0400 Subject: [PATCH 0355/1293] Free timers when modules de-init --- ports/stm/.gitignore | 1 - ports/stm/common-hal/microcontroller/Pin.c | 4 ++++ ports/stm/common-hal/microcontroller/Pin.h | 1 + ports/stm/common-hal/pulseio/PWMOut.c | 2 +- ports/stm/common-hal/pulseio/PulseIn.c | 3 +-- ports/stm/common-hal/pulseio/PulseOut.c | 2 +- ports/stm/common-hal/rgbmatrix/RGBMatrix.c | 11 +++++++---- ports/stm/peripherals/timers.c | 1 + ports/stm/peripherals/timers.h | 8 -------- 9 files changed, 16 insertions(+), 17 deletions(-) diff --git a/ports/stm/.gitignore b/ports/stm/.gitignore index e46c927eec..5d645392ca 100644 --- a/ports/stm/.gitignore +++ b/ports/stm/.gitignore @@ -5,6 +5,5 @@ build-*/ # Reference files ##################### ref/ -_working* .gdb_history diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index d919b07ea7..00763208d9 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -116,6 +116,10 @@ bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number) { return !(claimed_pins[pin_port] & 1<tim->tim_index - 1]) { tim_frequencies[self->tim->tim_index - 1] = 0x00; - tim_clock_disable(1 << (self->tim->tim_index - 1)); + stm_peripherals_timer_free(self->handle.Instance); } } diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c index db01968c4d..811fc8c492 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.c +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -186,14 +186,13 @@ void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) { return; } //Remove pulsein slot from shared array - HAL_NVIC_DisableIRQ(self->irq); _objs[self->pin->number] = NULL; reset_pin_number(self->pin->port, self->pin->number); self->pin = NULL; refcount--; if (refcount == 0) { - tim_clock_disable(1<< stm_peripherals_timer_get_index(tim_handle.Instance)); + stm_peripherals_timer_free(tim_handle.Instance); } } diff --git a/ports/stm/common-hal/pulseio/PulseOut.c b/ports/stm/common-hal/pulseio/PulseOut.c index 865b41dcf5..bf578bed22 100644 --- a/ports/stm/common-hal/pulseio/PulseOut.c +++ b/ports/stm/common-hal/pulseio/PulseOut.c @@ -152,7 +152,7 @@ void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t* self) { refcount--; if (refcount == 0) { - tim_clock_disable(1<< stm_peripherals_timer_get_index(tim_handle.Instance)); + stm_peripherals_timer_free(tim_handle.Instance); } } diff --git a/ports/stm/common-hal/rgbmatrix/RGBMatrix.c b/ports/stm/common-hal/rgbmatrix/RGBMatrix.c index 312f153580..3b42631adc 100644 --- a/ports/stm/common-hal/rgbmatrix/RGBMatrix.c +++ b/ports/stm/common-hal/rgbmatrix/RGBMatrix.c @@ -34,20 +34,23 @@ extern void _PM_IRQ_HANDLER(void); void *common_hal_rgbmatrix_timer_allocate() { - return stm_peripherals_find_timer(); + TIM_TypeDef * timer = stm_peripherals_find_timer(); + stm_peripherals_timer_reserve(timer); + return timer; } void common_hal_rgbmatrix_timer_enable(void* ptr) { - HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn); + TIM_TypeDef *tim = (TIM_TypeDef*)ptr; + HAL_NVIC_EnableIRQ(stm_peripherals_timer_get_irqnum(tim)); } void common_hal_rgbmatrix_timer_disable(void* ptr) { TIM_TypeDef *tim = (TIM_TypeDef*)ptr; tim->DIER &= ~TIM_DIER_UIE; - HAL_NVIC_DisableIRQ(TIM6_DAC_IRQn); } void common_hal_rgbmatrix_timer_free(void* ptr) { + TIM_TypeDef *tim = (TIM_TypeDef*)ptr; + stm_peripherals_timer_free(tim); common_hal_rgbmatrix_timer_disable(ptr); - // TODO(jepler) properly handle resource allocation including never-reset } diff --git a/ports/stm/peripherals/timers.c b/ports/stm/peripherals/timers.c index 7950d8a57b..baa81d2b5f 100644 --- a/ports/stm/peripherals/timers.c +++ b/ports/stm/peripherals/timers.c @@ -233,6 +233,7 @@ void stm_peripherals_timer_set_callback(void(*callback)(void), TIM_TypeDef * tim void stm_peripherals_timer_free(TIM_TypeDef * instance) { size_t tim_idx = stm_peripherals_timer_get_index(instance); + HAL_NVIC_DisableIRQ(irq_map[tim_idx]); stm_timer_callback[tim_idx] = NULL; tim_clock_disable(1 << tim_idx); stm_timer_reserved[tim_idx] = false; diff --git a/ports/stm/peripherals/timers.h b/ports/stm/peripherals/timers.h index 02e4e304e3..c4b6c63673 100644 --- a/ports/stm/peripherals/timers.h +++ b/ports/stm/peripherals/timers.h @@ -24,14 +24,6 @@ * THE SOFTWARE. */ -// typedef struct { -// TIM_TypeDef * timer; -// bool reserved; -// bool never_reset; -// void (*stm_timer_callback)(void); -// size_t irq; -// } stm_timer_t; - #include #include "py/mphal.h" #include "peripherals/periph.h" From c1f731d62e6d7bce385baec9ead3bafc46234805 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 22 Jul 2020 14:11:00 -0400 Subject: [PATCH 0356/1293] Claim USB pins at startup to prevent overwrites --- ports/stm/common-hal/analogio/AnalogIn.c | 4 ++-- ports/stm/common-hal/analogio/AnalogOut.c | 2 +- ports/stm/common-hal/busio/I2C.c | 6 +++--- ports/stm/common-hal/busio/SPI.c | 8 +++---- ports/stm/common-hal/busio/UART.c | 5 +++-- ports/stm/common-hal/digitalio/DigitalInOut.c | 3 ++- ports/stm/common-hal/microcontroller/Pin.c | 21 +++++++------------ ports/stm/common-hal/microcontroller/Pin.h | 3 +-- ports/stm/common-hal/pulseio/PWMOut.c | 2 +- ports/stm/common-hal/pulseio/PulseIn.c | 3 ++- ports/stm/common-hal/pulseio/PulseOut.c | 2 +- ports/stm/supervisor/usb.c | 5 +++++ shared-module/touchio/TouchIn.c | 3 ++- 13 files changed, 35 insertions(+), 32 deletions(-) diff --git a/ports/stm/common-hal/analogio/AnalogIn.c b/ports/stm/common-hal/analogio/AnalogIn.c index 1d1b308b66..588d687ee1 100644 --- a/ports/stm/common-hal/analogio/AnalogIn.c +++ b/ports/stm/common-hal/analogio/AnalogIn.c @@ -29,7 +29,7 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -#include "common-hal/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/Pin.h" #include "stm32f4xx_hal.h" #include "stm32f4xx_ll_gpio.h" @@ -57,7 +57,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t* self, } else { mp_raise_ValueError(translate("Invalid ADC Unit value")); } - claim_pin(pin); + common_hal_mcu_pin_claim(pin); self->pin = pin; } diff --git a/ports/stm/common-hal/analogio/AnalogOut.c b/ports/stm/common-hal/analogio/AnalogOut.c index a505b2bf0f..69c1f3e045 100644 --- a/ports/stm/common-hal/analogio/AnalogOut.c +++ b/ports/stm/common-hal/analogio/AnalogOut.c @@ -86,7 +86,7 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, dac_on[self->dac_index] = true; self->pin = pin; - claim_pin(pin); + common_hal_mcu_pin_claim(pin); #endif } diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 6adcf55750..b05d28c852 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -32,7 +32,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "supervisor/shared/translate.h" -#include "common-hal/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/Pin.h" // I2C timing specs for the H7 and F7 // Configured for maximum possible clock settings for the family @@ -161,8 +161,8 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, if (HAL_I2C_Init(&(self->handle)) != HAL_OK) { mp_raise_RuntimeError(translate("I2C Init Error")); } - claim_pin(sda); - claim_pin(scl); + common_hal_mcu_pin_claim(sda); + common_hal_mcu_pin_claim(scl); } void common_hal_busio_i2c_never_reset(busio_i2c_obj_t *self) { diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index d4dd6cb3fc..15c746b62a 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -33,7 +33,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "boards/board.h" #include "supervisor/shared/translate.h" -#include "common-hal/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/Pin.h" // Note that any bugs introduced in this file can cause crashes at startup // for chips using external SPI flash. @@ -233,12 +233,12 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->phase = 0; self->bits = 8; - claim_pin(sck); + common_hal_mcu_pin_claim(sck); if (self->mosi != NULL) { - claim_pin(mosi); + common_hal_mcu_pin_claim(mosi); } if (self->miso != NULL) { - claim_pin(miso); + common_hal_mcu_pin_claim(miso); } } diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index 7450f9897a..08dae7e425 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -25,6 +25,7 @@ */ #include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/busio/UART.h" #include "mpconfigport.h" @@ -224,10 +225,10 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_raise_ValueError(translate("UART Buffer allocation error")); } } - claim_pin(rx); + common_hal_mcu_pin_claim(rx); } if (self->tx != NULL) { - claim_pin(tx); + common_hal_mcu_pin_claim(tx); } self->baudrate = baudrate; self->timeout_ms = timeout * 1000; diff --git a/ports/stm/common-hal/digitalio/DigitalInOut.c b/ports/stm/common-hal/digitalio/DigitalInOut.c index 1354e1a326..a676aeb155 100644 --- a/ports/stm/common-hal/digitalio/DigitalInOut.c +++ b/ports/stm/common-hal/digitalio/DigitalInOut.c @@ -26,6 +26,7 @@ */ #include "shared-bindings/digitalio/DigitalInOut.h" +#include "shared-bindings/microcontroller/Pin.h" #include "py/runtime.h" #include "supervisor/shared/translate.h" @@ -46,7 +47,7 @@ void common_hal_digitalio_digitalinout_never_reset( digitalinout_result_t common_hal_digitalio_digitalinout_construct( digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin) { - claim_pin(pin); + common_hal_mcu_pin_claim(pin); self->pin = pin; GPIO_InitTypeDef GPIO_InitStruct = {0}; diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index 00763208d9..9fbdedeade 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -101,25 +101,15 @@ void common_hal_reset_pin(const mcu_pin_obj_t* pin) { reset_pin_number(pin->port, pin->number); } -void claim_pin(const mcu_pin_obj_t* pin) { +void claim_pin(uint8_t pin_port, uint8_t pin_number) { // Set bit in claimed_pins bitmask. - claimed_pins[pin->port] |= 1<number; - - #ifdef MICROPY_HW_NEOPIXEL - if (pin == MICROPY_HW_NEOPIXEL) { - neopixel_in_use = true; - } - #endif + claimed_pins[pin_port] |= 1<port, pin->number); + #ifdef MICROPY_HW_NEOPIXEL + if (pin == MICROPY_HW_NEOPIXEL) { + neopixel_in_use = true; + } + #endif } void common_hal_mcu_pin_reset_number(uint8_t pin_no) { diff --git a/ports/stm/common-hal/microcontroller/Pin.h b/ports/stm/common-hal/microcontroller/Pin.h index 73e5457a5d..f461d3813f 100644 --- a/ports/stm/common-hal/microcontroller/Pin.h +++ b/ports/stm/common-hal/microcontroller/Pin.h @@ -43,9 +43,8 @@ void reset_all_pins(void); // reset_pin_number takes the pin number instead of the pointer so that objects don't // need to store a full pointer. void reset_pin_number(uint8_t pin_port, uint8_t pin_number); -void claim_pin(const mcu_pin_obj_t* pin); +void claim_pin(uint8_t pin_port, uint8_t pin_number); bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number); -bool pin_number_is_resettable(uint8_t pin_port, uint8_t pin_number) void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number); GPIO_TypeDef * pin_port(uint8_t pin_port); uint16_t pin_mask(uint8_t pin_number); diff --git a/ports/stm/common-hal/pulseio/PWMOut.c b/ports/stm/common-hal/pulseio/PWMOut.c index 4df896feb0..ddbadaf4ce 100644 --- a/ports/stm/common-hal/pulseio/PWMOut.c +++ b/ports/stm/common-hal/pulseio/PWMOut.c @@ -33,7 +33,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include STM32_HAL_H -#include "common-hal/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/Pin.h" #include "timers.h" diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c index 811fc8c492..4052c240fe 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.c +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -31,6 +31,7 @@ #include "py/gc.h" #include "py/runtime.h" #include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/pulseio/PulseIn.h" #include "timers.h" @@ -174,7 +175,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu // Interrupt starts immediately assign_EXTI_Interrupt(self, pin->number); HAL_NVIC_EnableIRQ(self->irq); - claim_pin(pin); + common_hal_mcu_pin_claim(pin); } bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t* self) { diff --git a/ports/stm/common-hal/pulseio/PulseOut.c b/ports/stm/common-hal/pulseio/PulseOut.c index bf578bed22..bcc25d8177 100644 --- a/ports/stm/common-hal/pulseio/PulseOut.c +++ b/ports/stm/common-hal/pulseio/PulseOut.c @@ -36,7 +36,7 @@ #include "supervisor/shared/translate.h" #include STM32_HAL_H -#include "common-hal/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/Pin.h" #include "timers.h" // A single timer is shared amongst all PulseOut objects under the assumption that diff --git a/ports/stm/supervisor/usb.c b/ports/stm/supervisor/usb.c index 3d53fa3749..c0e012cc62 100644 --- a/ports/stm/supervisor/usb.c +++ b/ports/stm/supervisor/usb.c @@ -86,6 +86,8 @@ void init_usb_hardware(void) { HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); never_reset_pin_number(0, 11); never_reset_pin_number(0, 12); + claim_pin(0, 11); + claim_pin(0, 12); /* Configure VBUS Pin */ #if !(BOARD_NO_VBUS_SENSE) @@ -94,6 +96,7 @@ void init_usb_hardware(void) { GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); never_reset_pin_number(0, 9); + claim_pin(0, 9); #endif /* This for ID line debug */ @@ -108,6 +111,7 @@ void init_usb_hardware(void) { #endif HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); never_reset_pin_number(0, 10); + claim_pin(0, 10); #ifdef STM32F412Zx /* Configure POWER_SWITCH IO pin (F412 ONLY)*/ @@ -116,6 +120,7 @@ void init_usb_hardware(void) { GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); never_reset_pin_number(0, 8); + claim_pin(0, 8); #endif #if CPY_STM32H7 diff --git a/shared-module/touchio/TouchIn.c b/shared-module/touchio/TouchIn.c index 88d12b8b81..3fdf3e0ca1 100644 --- a/shared-module/touchio/TouchIn.c +++ b/shared-module/touchio/TouchIn.c @@ -31,6 +31,7 @@ #include "py/runtime.h" #include "py/mphal.h" #include "shared-bindings/touchio/TouchIn.h" +#include "shared-bindings/microcontroller/Pin.h" // This is a capacitive touch sensing routine using a single digital // pin. The pin should be connected to the sensing pad, and to ground @@ -67,7 +68,7 @@ static uint16_t get_raw_reading(touchio_touchin_obj_t *self) { } void common_hal_touchio_touchin_construct(touchio_touchin_obj_t* self, const mcu_pin_obj_t *pin) { - claim_pin(pin); + common_hal_mcu_pin_claim(pin); self->digitalinout = m_new_obj(digitalio_digitalinout_obj_t); self->digitalinout->base.type = &digitalio_digitalinout_type; From 61a2e4f94b58d8f7ad09782b0a4e4bb4414b591f Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 21 Jul 2020 20:43:28 -0400 Subject: [PATCH 0357/1293] Add PWMOut --- ports/esp32s2/Makefile | 2 +- ports/esp32s2/common-hal/pulseio/PWMOut.c | 169 ++++++++++++++++------ ports/esp32s2/common-hal/pulseio/PWMOut.h | 10 +- ports/esp32s2/supervisor/port.c | 4 + 4 files changed, 135 insertions(+), 50 deletions(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index b296976885..09c35fd3ad 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -262,7 +262,7 @@ all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 $(BUILD)/firmware.elf: $(OBJ) | $(ESP_IDF_COMPONENTS_EXPANDED) $(ESP_AUTOGEN_LD) $(STEPECHO) "LINK $@" - $(Q)$(CC) -o $@ $(LDFLAGS) $^ $(ESP_IDF_COMPONENTS_EXPANDED) $(BINARY_BLOBS) build-$(BOARD)/esp-idf/esp-idf/newlib/libnewlib.a -u newlib_include_pthread_impl + $(Q)$(CC) -o $@ $(LDFLAGS) $^ $(ESP_IDF_COMPONENTS_EXPANDED) $(BINARY_BLOBS) build-$(BOARD)/esp-idf/esp-idf/newlib/libnewlib.a -u newlib_include_pthread_impl -Wl,--start-group $(LIBS) -Wl,--end-group # $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld $(BUILD)/circuitpython-firmware.bin: $(BUILD)/firmware.elf diff --git a/ports/esp32s2/common-hal/pulseio/PWMOut.c b/ports/esp32s2/common-hal/pulseio/PWMOut.c index 8f96433c06..15fe96a229 100644 --- a/ports/esp32s2/common-hal/pulseio/PWMOut.c +++ b/ports/esp32s2/common-hal/pulseio/PWMOut.c @@ -24,31 +24,33 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - +#include #include "common-hal/pulseio/PWMOut.h" #include "shared-bindings/pulseio/PWMOut.h" #include "py/runtime.h" #include "driver/ledc.h" -#define LEDC_LS_TIMER LEDC_TIMER_1 -#define LEDC_LS_MODE LEDC_LOW_SPEED_MODE -#define LEDC_LS_CH0_GPIO (18) -#define LEDC_LS_CH0_CHANNEL LEDC_CHANNEL_0 -#define LEDC_LS_CH1_GPIO (19) -#define LEDC_LS_CH1_CHANNEL LEDC_CHANNEL_1 -#define LEDC_LS_CH2_GPIO (4) -#define LEDC_LS_CH2_CHANNEL LEDC_CHANNEL_2 -#define LEDC_LS_CH3_GPIO (5) -#define LEDC_LS_CH3_CHANNEL LEDC_CHANNEL_3 - -#define LEDC_TEST_CH_NUM (4) -#define LEDC_TEST_DUTY (4000) -#define LEDC_TEST_FADE_TIME (3000) - +#define INDEX_EMPTY 0xFF +STATIC uint32_t reserved_timer_freq[LEDC_TIMER_MAX]; +STATIC uint8_t reserved_channels[LEDC_CHANNEL_MAX] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; +STATIC bool never_reset_tim[LEDC_TIMER_MAX]; +STATIC bool never_reset_chan[LEDC_CHANNEL_MAX]; void pwmout_reset(void) { + for (size_t i = 0; i < LEDC_CHANNEL_MAX; i++ ) { + ledc_stop(LEDC_LOW_SPEED_MODE, i, 0); + if (!never_reset_chan[i]) { + reserved_channels[i] = INDEX_EMPTY; + } + } + for (size_t i = 0; i < LEDC_TIMER_MAX; i++ ) { + ledc_timer_rst(LEDC_LOW_SPEED_MODE, i); + if (!never_reset_tim[i]) { + reserved_timer_freq[i] = 0; + } + } } pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, @@ -56,65 +58,142 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, uint16_t duty, uint32_t frequency, bool variable_frequency) { - ledc_timer_config_t ledc_timer = { - .duty_resolution = LEDC_TIMER_16_BIT, // resolution of PWM duty - .freq_hz = frequency, // frequency of PWM signal - .speed_mode = LEDC_LS_MODE, // timer mode - .timer_num = LEDC_LS_TIMER, // timer index - .clk_cfg = LEDC_AUTO_CLK, // Auto select the source clock - }; - // Set configuration of timer0 for high speed channels - ledc_timer_config(&ledc_timer); - - ledc_channel_config_t pwm_channel = { - .channel = LEDC_LS_CH0_CHANNEL, - .duty = 0, - .gpio_num = pin->number, - .speed_mode = LEDC_LS_MODE, - .hpoint = 0, - .timer_sel = LEDC_LS_TIMER - }; - - // Set LED Controller with previously prepared configuration - for (ch = 0; ch < LEDC_TEST_CH_NUM; ch++) { - ledc_channel_config(&ledc_channel[ch]); + // Calculate duty cycle + uint32_t duty_bits = 0; + uint32_t interval = LEDC_APB_CLK_HZ/frequency; + for (size_t i = 0; i < 32; i++) { + if(!(interval >> i)) { + duty_bits = i - 1; + break; + } + } + if (duty_bits < 1) { + mp_raise_ValueError(translate("Invalid frequency")); + } else if (duty_bits >= LEDC_TIMER_14_BIT) { + duty_bits = LEDC_TIMER_13_BIT; } - for (ch = 0; ch < LEDC_TEST_CH_NUM; ch++) { - ledc_set_duty(ledc_channel[ch].speed_mode, ledc_channel[ch].channel, duty*2); - ledc_update_duty(ledc_channel[ch].speed_mode, ledc_channel[ch].channel); + // Find a viable timer + size_t timer_index = INDEX_EMPTY; + size_t channel_index = INDEX_EMPTY; + for (size_t i = 0; i < LEDC_TIMER_MAX; i++) { + if ((reserved_timer_freq[i] == frequency) && !variable_frequency) { + //prioritize matched frequencies so we don't needlessly take slots + timer_index = i; + break; + } else if (reserved_timer_freq[i] == 0) { + timer_index = i; + break; + } } + if (timer_index == INDEX_EMPTY) { + // Running out of timers isn't pin related on ESP32S2 so we can't re-use error messages + mp_raise_ValueError(translate("No more timers available")); + } + + // Find a viable channel + for (size_t i = 0; i < LEDC_CHANNEL_MAX; i++) { + if (reserved_channels[i] == INDEX_EMPTY) { + channel_index = i; + break; + } + } + if (channel_index == INDEX_EMPTY) { + mp_raise_ValueError(translate("No more channels available")); + } + + // Run configuration + self->tim_handle.timer_num = timer_index; + self->tim_handle.duty_resolution = duty_bits; + self->tim_handle.freq_hz = frequency; + self->tim_handle.speed_mode = LEDC_LOW_SPEED_MODE; + self->tim_handle.clk_cfg = LEDC_AUTO_CLK; + + if (ledc_timer_config(&(self->tim_handle)) != ESP_OK) { + mp_raise_ValueError(translate("Could not initialize timer")); + } + + self->chan_handle.channel = channel_index; + self->chan_handle.duty = duty >> (16 - duty_bits); + self->chan_handle.gpio_num = pin->number; + self->chan_handle.speed_mode = LEDC_LOW_SPEED_MODE; // Only LS is allowed on ESP32-S2 + self->chan_handle.hpoint = 0; + self->chan_handle.timer_sel = timer_index; + + if (ledc_channel_config(&(self->chan_handle))) { + mp_raise_ValueError(translate("Could not initialize channel")); + } + + // Make reservations + reserved_timer_freq[timer_index] = frequency; + reserved_channels[channel_index] = timer_index; + + self->variable_frequency = variable_frequency; + self->pin_number = pin->number; + self->deinited = false; + self->duty_resolution = duty_bits; + claim_pin(pin); + + // Set initial duty + ledc_set_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel, duty >> (16 - duty_bits)); + ledc_update_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel); return PWMOUT_OK; } void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) { + never_reset_tim[self->tim_handle.timer_num] = true; + never_reset_chan[self->chan_handle.channel] = true; } void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) { + never_reset_tim[self->tim_handle.timer_num] = false; + never_reset_chan[self->chan_handle.channel] = false; } bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t* self) { - return false; + return self->deinited == true; } void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { + if (common_hal_pulseio_pwmout_deinited(self)) { + return; + } + ledc_stop(LEDC_LOW_SPEED_MODE, self->chan_handle.channel, 0); + ledc_timer_rst(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num); + // 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; + } + } + // Variable frequency means there's only one channel on the timer + if (!taken || self->variable_frequency) { + reserved_timer_freq[self->tim_handle.timer_num] = 0; + } + reset_pin_number(self->pin_number); + reserved_channels[self->chan_handle.channel] = INDEX_EMPTY; + self->deinited = true; } void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty) { + ledc_set_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel, duty >> (16 - self->duty_resolution)); + ledc_update_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel); } uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) { - return false; + return ledc_get_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel) << (16 - self->duty_resolution); } void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_t frequency) { + ledc_set_freq(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num, frequency); } uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) { - return false; + return ledc_get_freq(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num); } bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t* self) { - return false; + return self->variable_frequency; } diff --git a/ports/esp32s2/common-hal/pulseio/PWMOut.h b/ports/esp32s2/common-hal/pulseio/PWMOut.h index 28484e9238..90a0c3ed96 100644 --- a/ports/esp32s2/common-hal/pulseio/PWMOut.h +++ b/ports/esp32s2/common-hal/pulseio/PWMOut.h @@ -28,14 +28,16 @@ #define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PWMOUT_H #include "common-hal/microcontroller/Pin.h" +#include "driver/ledc.h" typedef struct { mp_obj_base_t base; - uint8_t channel; + ledc_timer_config_t tim_handle; + ledc_channel_config_t chan_handle; + uint16_t pin_number; + uint8_t duty_resolution; bool variable_frequency: 1; - uint16_t duty_cycle; - uint32_t frequency; - uint32_t period; + bool deinited: 1; } pulseio_pwmout_obj_t; void pwmout_reset(void); diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index a80550b309..e4767e5146 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -38,6 +38,7 @@ #include "common-hal/busio/I2C.h" #include "common-hal/busio/SPI.h" #include "common-hal/busio/UART.h" +#include "common-hal/pulseio/PWMOut.h" #include "supervisor/memory.h" #include "supervisor/shared/tick.h" @@ -64,6 +65,9 @@ void reset_port(void) { // A larger delay so the idle task can run and do any IDF cleanup needed. vTaskDelay(4); +#if CIRCUITPY_PULSEIO + pwmout_reset(); +#endif #if CIRCUITPY_BUSIO i2c_reset(); spi_reset(); From b42dc3b884876ba6484165e5905202cf7b902a57 Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Wed, 22 Jul 2020 19:59:14 +0000 Subject: [PATCH 0358/1293] Translated using Weblate (Spanish) Currently translated at 100.0% (780 of 780 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/locale/es.po b/locale/es.po index 2ebad85e90..68f44c20d8 100644 --- a/locale/es.po +++ b/locale/es.po @@ -3,13 +3,12 @@ # SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # # SPDX-License-Identifier: MIT -#, fuzzy msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-17 18:03-0700\n" -"PO-Revision-Date: 2020-07-13 19:24+0000\n" +"PO-Revision-Date: 2020-07-22 20:48+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" @@ -117,7 +116,7 @@ msgstr "argumento '%q' requerido" #: py/objarray.c msgid "'%q' object is not bytes-like" -msgstr "" +msgstr "el objeto '%q' no es similar a bytes" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format From 441d9d2286df2094cb6df3410114bb4e79da837f Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 23 Jul 2020 01:21:48 +0200 Subject: [PATCH 0359/1293] 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 | 28 ++++++++++++++++++++++++---- locale/cs.po | 28 ++++++++++++++++++++++++---- locale/de_DE.po | 28 ++++++++++++++++++++++++---- locale/es.po | 28 ++++++++++++++++++++++++---- locale/fil.po | 28 ++++++++++++++++++++++++---- locale/fr.po | 28 ++++++++++++++++++++++++---- locale/it_IT.po | 28 ++++++++++++++++++++++++---- locale/ko.po | 28 ++++++++++++++++++++++++---- locale/nl.po | 28 ++++++++++++++++++++++++---- locale/pl.po | 28 ++++++++++++++++++++++++---- locale/pt_BR.po | 28 ++++++++++++++++++++++++---- locale/sv.po | 28 ++++++++++++++++++++++++---- locale/zh_Latn_pinyin.po | 28 ++++++++++++++++++++++++---- 13 files changed, 312 insertions(+), 52 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index c85b8edfe5..bd865c0548 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -84,10 +84,15 @@ msgstr "indeks %q harus bilangan bulat, bukan %s" msgid "%q list must be a list" msgstr "daftar %q harus berupa daftar" +#: shared-bindings/memorymonitor/AllocationAlarm.c +msgid "%q must be >= 0" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c -#: shared-bindings/vectorio/Rectangle.c +#: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm.c +#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q harus >= 1" @@ -325,6 +330,11 @@ msgstr "Semua timer sedang digunakan" msgid "Already advertising." msgstr "Sudah disebarkan." +#: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize.c +msgid "Already running" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "AnalogIn tidak didukung pada pin yang diberikan" @@ -360,6 +370,11 @@ msgstr "Nilai array harus berupa byte tunggal." 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" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "Mencoba alokasi heap ketika MicroPython VM tidak berjalan." @@ -481,7 +496,9 @@ msgstr "Panggil super().__init__() sebelum mengakses objek asli." msgid "Can't set CCCD on local Characteristic" msgstr "Tidak dapat mengatur CCCD pada Karakteristik lokal" -#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" msgstr "Tidak dapat menghapus nilai" @@ -1379,6 +1396,7 @@ msgstr "" msgid "Random number generation error" msgstr "" +#: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "" @@ -1465,7 +1483,9 @@ msgid "Slice and value different lengths." msgstr "" #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 2cecbcc109..cf91416270 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -84,10 +84,15 @@ msgstr "Indexy% q musí být celá čísla, nikoli% s" msgid "%q list must be a list" msgstr "Seznam% q musí být seznam" +#: shared-bindings/memorymonitor/AllocationAlarm.c +msgid "%q must be >= 0" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c -#: shared-bindings/vectorio/Rectangle.c +#: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm.c +#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "% q musí být > = 1" @@ -325,6 +330,11 @@ msgstr "" msgid "Already advertising." msgstr "" +#: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize.c +msgid "Already running" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "" @@ -360,6 +370,11 @@ msgstr "" msgid "At most %d %q may be specified (not %d)" msgstr "" +#: shared-module/memorymonitor/AllocationAlarm.c +#, c-format +msgid "Attempt to allocate %d blocks" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -479,7 +494,9 @@ msgstr "" msgid "Can't set CCCD on local Characteristic" msgstr "" -#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" msgstr "" @@ -1359,6 +1376,7 @@ msgstr "" msgid "Random number generation error" msgstr "" +#: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "" @@ -1443,7 +1461,9 @@ msgid "Slice and value different lengths." msgstr "" #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 014cd749f7..9b07989ca6 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -83,10 +83,15 @@ msgstr "%q Indizes müssen Integer sein, nicht %s" msgid "%q list must be a list" msgstr "%q Liste muss eine Liste sein" +#: shared-bindings/memorymonitor/AllocationAlarm.c +msgid "%q must be >= 0" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c -#: shared-bindings/vectorio/Rectangle.c +#: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm.c +#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q muss >= 1 sein" @@ -324,6 +329,11 @@ msgstr "Alle timer werden benutzt" msgid "Already advertising." msgstr "Bereits am anbieten (advertising)." +#: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize.c +msgid "Already running" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "AnalogIn ist an diesem Pin nicht unterstützt" @@ -359,6 +369,11 @@ msgstr "Array-Werte sollten aus Einzelbytes bestehen." 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" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -482,7 +497,9 @@ msgstr "Rufe super().__init__() vor dem Zugriff auf ein natives Objekt auf." msgid "Can't set CCCD on local Characteristic" msgstr "CCCD kann nicht auf lokales Merkmal eingestellt werden" -#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" msgstr "Kann Werte nicht löschen" @@ -1389,6 +1406,7 @@ msgstr "RTS / CTS / RS485 Wird von diesem Gerät noch nicht unterstützt" msgid "Random number generation error" msgstr "Fehler bei der Erzeugung von Zufallszahlen" +#: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Nur lesen möglich, da Schreibgeschützt" @@ -1473,7 +1491,9 @@ msgid "Slice and value different lengths." msgstr "Slice und Wert (value) haben unterschiedliche Längen." #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" msgstr "Slices werden nicht unterstützt" diff --git a/locale/es.po b/locale/es.po index 68f44c20d8..8d19b0ab01 100644 --- a/locale/es.po +++ b/locale/es.po @@ -87,10 +87,15 @@ msgstr "%q indices deben ser enteros, no %s" msgid "%q list must be a list" msgstr "%q lista debe ser una lista" +#: shared-bindings/memorymonitor/AllocationAlarm.c +msgid "%q must be >= 0" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c -#: shared-bindings/vectorio/Rectangle.c +#: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm.c +#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q debe ser >= 1" @@ -330,6 +335,11 @@ msgstr "Todos los timers en uso" msgid "Already advertising." msgstr "Ya se encuentra publicando." +#: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize.c +msgid "Already running" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "El pin proporcionado no soporta AnalogIn" @@ -365,6 +375,11 @@ msgstr "Valores del array deben ser bytes individuales." 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" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -488,7 +503,9 @@ msgstr "Llame a super().__ init __() antes de acceder al objeto nativo." msgid "Can't set CCCD on local Characteristic" msgstr "No se puede configurar CCCD en la característica local" -#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" msgstr "No se puede eliminar valores" @@ -1388,6 +1405,7 @@ msgstr "Sin capacidad de RTS/CTS/RS485 para este dispositivo" msgid "Random number generation error" msgstr "Error de generación de números aleatorios" +#: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Solo-lectura" @@ -1472,7 +1490,9 @@ msgid "Slice and value different lengths." msgstr "Slice y value tienen tamaños diferentes." #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" msgstr "Rebanadas no soportadas" diff --git a/locale/fil.po b/locale/fil.po index e359829309..92dc9cc910 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -76,10 +76,15 @@ msgstr "%q indeks ay dapat integers, hindi %s" msgid "%q list must be a list" msgstr "" +#: shared-bindings/memorymonitor/AllocationAlarm.c +msgid "%q must be >= 0" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c -#: shared-bindings/vectorio/Rectangle.c +#: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm.c +#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c #, fuzzy msgid "%q must be >= 1" msgstr "aarehas na haba dapat ang buffer slices" @@ -321,6 +326,11 @@ msgstr "Lahat ng timer ginagamit" msgid "Already advertising." msgstr "" +#: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize.c +msgid "Already running" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "" @@ -356,6 +366,11 @@ msgstr "Array values ay dapat single bytes." msgid "At most %d %q may be specified (not %d)" msgstr "" +#: shared-module/memorymonitor/AllocationAlarm.c +#, c-format +msgid "Attempt to allocate %d blocks" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -478,7 +493,9 @@ msgstr "" msgid "Can't set CCCD on local Characteristic" msgstr "" -#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" msgstr "Hindi mabura ang values" @@ -1373,6 +1390,7 @@ msgstr "" msgid "Random number generation error" msgstr "" +#: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Basahin-lamang" @@ -1458,7 +1476,9 @@ msgid "Slice and value different lengths." msgstr "Slice at value iba't ibang haba." #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" msgstr "Hindi suportado ang Slices" diff --git a/locale/fr.po b/locale/fr.po index 6dffd41eb5..8953efe37e 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -88,10 +88,15 @@ msgstr "les indices %q doivent être des entiers, pas %s" msgid "%q list must be a list" msgstr "La liste %q doit être une liste" +#: shared-bindings/memorymonitor/AllocationAlarm.c +msgid "%q must be >= 0" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c -#: shared-bindings/vectorio/Rectangle.c +#: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm.c +#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q doit être >=1" @@ -329,6 +334,11 @@ msgstr "Tous les timers sont utilisés" msgid "Already advertising." msgstr "S'annonce déjà." +#: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize.c +msgid "Already running" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "'AnalogOut' n'est pas supporté sur la broche indiquée" @@ -365,6 +375,11 @@ msgstr "Les valeurs du tableau doivent être des octets simples 'bytes'." 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" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -488,7 +503,9 @@ msgstr "Appelez super () .__ init __ () avant d'accéder à l'objet natif." msgid "Can't set CCCD on local Characteristic" msgstr "Impossible de définir CCCD sur une caractéristique locale" -#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" msgstr "Impossible de supprimer les valeurs" @@ -1394,6 +1411,7 @@ msgstr "RTS / CTS / RS485 Pas encore pris en charge sur cet appareil" msgid "Random number generation error" msgstr "Erreur de génération de nombres aléatoires" +#: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Lecture seule" @@ -1478,7 +1496,9 @@ msgid "Slice and value different lengths." msgstr "Tranche et valeur de tailles différentes." #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" msgstr "Tranches non supportées" diff --git a/locale/it_IT.po b/locale/it_IT.po index 92b8fbaaa3..9f0aea9e9b 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -76,10 +76,15 @@ msgstr "gli indici %q devono essere interi, non %s" msgid "%q list must be a list" msgstr "" +#: shared-bindings/memorymonitor/AllocationAlarm.c +msgid "%q must be >= 0" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c -#: shared-bindings/vectorio/Rectangle.c +#: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm.c +#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c #, fuzzy msgid "%q must be >= 1" msgstr "slice del buffer devono essere della stessa lunghezza" @@ -320,6 +325,11 @@ msgstr "Tutti i timer utilizzati" msgid "Already advertising." msgstr "" +#: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize.c +msgid "Already running" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "" @@ -355,6 +365,11 @@ msgstr "Valori di Array dovrebbero essere bytes singulari" msgid "At most %d %q may be specified (not %d)" msgstr "" +#: shared-module/memorymonitor/AllocationAlarm.c +#, c-format +msgid "Attempt to allocate %d blocks" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -478,7 +493,9 @@ msgstr "" msgid "Can't set CCCD on local Characteristic" msgstr "" -#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" msgstr "Impossibile cancellare valori" @@ -1382,6 +1399,7 @@ msgstr "" msgid "Random number generation error" msgstr "" +#: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Sola lettura" @@ -1469,7 +1487,9 @@ msgid "Slice and value different lengths." msgstr "" #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" msgstr "Slice non supportate" diff --git a/locale/ko.po b/locale/ko.po index 8aa96e9017..e0f4dd9cb8 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -78,10 +78,15 @@ msgstr "%q 인덱스는 %s 가 아닌 정수 여야합니다" msgid "%q list must be a list" msgstr "" +#: shared-bindings/memorymonitor/AllocationAlarm.c +msgid "%q must be >= 0" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c -#: shared-bindings/vectorio/Rectangle.c +#: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm.c +#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q 는 >=1이어야합니다" @@ -319,6 +324,11 @@ msgstr "모든 타이머가 사용 중입니다" msgid "Already advertising." msgstr "" +#: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize.c +msgid "Already running" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "" @@ -354,6 +364,11 @@ msgstr "" msgid "At most %d %q may be specified (not %d)" msgstr "" +#: shared-module/memorymonitor/AllocationAlarm.c +#, c-format +msgid "Attempt to allocate %d blocks" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -475,7 +490,9 @@ msgstr "" msgid "Can't set CCCD on local Characteristic" msgstr "" -#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" msgstr "값을 삭제할 수 없습니다" @@ -1355,6 +1372,7 @@ msgstr "" msgid "Random number generation error" msgstr "" +#: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "" @@ -1439,7 +1457,9 @@ msgid "Slice and value different lengths." msgstr "" #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 253d18a04c..29591dfd80 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -84,10 +84,15 @@ msgstr "%q indexen moeten integers zijn, niet %s" msgid "%q list must be a list" msgstr "%q lijst moet een lijst zijn" +#: shared-bindings/memorymonitor/AllocationAlarm.c +msgid "%q must be >= 0" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c -#: shared-bindings/vectorio/Rectangle.c +#: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm.c +#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q moet >= 1 zijn" @@ -325,6 +330,11 @@ msgstr "Alle timers zijn in gebruik" msgid "Already advertising." msgstr "Advertising is al bezig." +#: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize.c +msgid "Already running" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "AnalogIn niet ondersteund door gegeven pin" @@ -360,6 +370,11 @@ msgstr "Array waardes moet enkele bytes zijn." 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" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "heap allocatie geprobeerd terwijl MicroPython VM niet draait." @@ -481,7 +496,9 @@ msgstr "Roep super().__init__() aan voor toegang native object." msgid "Can't set CCCD on local Characteristic" msgstr "Kan CCCD niet toewijzen aan lokaal Characteristic" -#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" msgstr "Kan waardes niet verwijderen" @@ -1385,6 +1402,7 @@ msgstr "RTS/CTS/RS485 Nog niet ondersteund door dit apparaat" msgid "Random number generation error" msgstr "Random number generatie fout" +#: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Alleen-lezen" @@ -1469,7 +1487,9 @@ msgid "Slice and value different lengths." msgstr "Slice en waarde hebben verschillende lengtes." #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" msgstr "Slices niet ondersteund" diff --git a/locale/pl.po b/locale/pl.po index b2b2d7a16d..e359e71b67 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -78,10 +78,15 @@ msgstr "%q indeks musi być liczbą całkowitą, a nie %s" msgid "%q list must be a list" msgstr "" +#: shared-bindings/memorymonitor/AllocationAlarm.c +msgid "%q must be >= 0" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c -#: shared-bindings/vectorio/Rectangle.c +#: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm.c +#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q musi być >= 1" @@ -319,6 +324,11 @@ msgstr "Wszystkie timery w użyciu" msgid "Already advertising." msgstr "" +#: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize.c +msgid "Already running" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "" @@ -354,6 +364,11 @@ msgstr "Wartości powinny być bajtami." msgid "At most %d %q may be specified (not %d)" msgstr "" +#: shared-module/memorymonitor/AllocationAlarm.c +#, c-format +msgid "Attempt to allocate %d blocks" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -475,7 +490,9 @@ msgstr "" msgid "Can't set CCCD on local Characteristic" msgstr "" -#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" msgstr "Nie można usunąć" @@ -1357,6 +1374,7 @@ msgstr "" msgid "Random number generation error" msgstr "" +#: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Tylko do odczytu" @@ -1441,7 +1459,9 @@ msgid "Slice and value different lengths." msgstr "Fragment i wartość są różnych długości." #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" msgstr "Fragmenty nieobsługiwane" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index b7062f5f0a..484764ac2b 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -84,10 +84,15 @@ msgstr "Os índices %q devem ser inteiros, e não %s" msgid "%q list must be a list" msgstr "A lista %q deve ser uma lista" +#: shared-bindings/memorymonitor/AllocationAlarm.c +msgid "%q must be >= 0" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c -#: shared-bindings/vectorio/Rectangle.c +#: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm.c +#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q deve ser >= 1" @@ -327,6 +332,11 @@ msgstr "Todos os temporizadores em uso" msgid "Already advertising." msgstr "Já está anunciando." +#: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize.c +msgid "Already running" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "O AnalogIn não é compatível no pino informado" @@ -362,6 +372,11 @@ msgstr "Os valores das matrizes devem ser bytes simples." 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" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -487,7 +502,9 @@ msgstr "Chame super().__init__() antes de acessar o objeto nativo." msgid "Can't set CCCD on local Characteristic" msgstr "Não é possível definir o CCCD com a característica local" -#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" msgstr "Não é possível excluir valores" @@ -1393,6 +1410,7 @@ msgstr "RTS/CTS/RS485 Ainda não é compatível neste dispositivo" 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 msgid "Read-only" msgstr "Somente leitura" @@ -1477,7 +1495,9 @@ msgid "Slice and value different lengths." msgstr "Fatie e avalie os diferentes comprimentos." #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" msgstr "Fatiamento não compatível" diff --git a/locale/sv.po b/locale/sv.po index ffec64bfea..075db8ab09 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -84,10 +84,15 @@ msgstr "Indexet %q måste vara ett heltal, inte %s" msgid "%q list must be a list" msgstr "%q-listan måste vara en lista" +#: shared-bindings/memorymonitor/AllocationAlarm.c +msgid "%q must be >= 0" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c -#: shared-bindings/vectorio/Rectangle.c +#: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm.c +#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q måste vara >= 1" @@ -325,6 +330,11 @@ msgstr "Alla timers används" msgid "Already advertising." msgstr "Annonserar redan." +#: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize.c +msgid "Already running" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "AnalogIn stöds inte på angiven pinne" @@ -360,6 +370,11 @@ msgstr "Matrisvärden ska bestå av enstaka bytes." 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" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "Försökte tilldela heap när MicroPython VM inte körs." @@ -481,7 +496,9 @@ msgstr "Anropa super().__init__() innan du använder det ursprungliga objektet." msgid "Can't set CCCD on local Characteristic" msgstr "Kan inte ställa in CCCD på lokal karaktäristik" -#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" msgstr "Kan inte radera värden" @@ -1381,6 +1398,7 @@ msgstr "RTS/CTS/RS485 Stöds ännu inte på den här enheten" msgid "Random number generation error" msgstr "Fel vid generering av slumptal" +#: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Skrivskyddad" @@ -1465,7 +1483,9 @@ msgid "Slice and value different lengths." msgstr "Slice och värde har olika längd." #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" msgstr "Slice stöds inte" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 6c19fb67cd..a820c142c6 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -84,10 +84,15 @@ msgstr "%q suǒyǐn bìxū shì zhěngshù, ér bùshì %s" msgid "%q list must be a list" msgstr "" +#: shared-bindings/memorymonitor/AllocationAlarm.c +msgid "%q must be >= 0" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c -#: shared-bindings/vectorio/Rectangle.c +#: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm.c +#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q bìxū dàyú huò děngyú 1" @@ -325,6 +330,11 @@ msgstr "Suǒyǒu jìshí qì shǐyòng" msgid "Already advertising." msgstr "Mùqián zhèngzài guǎngbò" +#: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize.c +msgid "Already running" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "Gěi dìng de yǐn jiǎo bù zhīchí AnalogIn" @@ -360,6 +370,11 @@ msgstr "Shùzǔ zhí yīnggāi shì dāngè zì jié." msgid "At most %d %q may be specified (not %d)" msgstr "" +#: shared-module/memorymonitor/AllocationAlarm.c +#, c-format +msgid "Attempt to allocate %d blocks" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "MicroPython VM zài wèi yùnxíng shí chángshì fēnpèi duī." @@ -481,7 +496,9 @@ msgstr "Zài fǎngwèn běn jī wùjiàn zhīqián diàoyòng super().__init__() msgid "Can't set CCCD on local Characteristic" msgstr "Wúfǎ jiāng CCCD shèzhì wéi běndì tèzhēng" -#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" msgstr "Wúfǎ shānchú zhí" @@ -1371,6 +1388,7 @@ msgstr "" msgid "Random number generation error" msgstr "Suíjī shù shēngchéng cuòwù" +#: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Zhǐ dú" @@ -1455,7 +1473,9 @@ msgid "Slice and value different lengths." msgstr "Qiēpiàn hé zhí bùtóng chángdù." #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c +#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" msgstr "Qiēpiàn bù shòu zhīchí" From 2bd6d056638f05185eb497ca2d039ebe9f386327 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 21 Jul 2020 16:26:46 -0700 Subject: [PATCH 0360/1293] Add externs. GCC10 complains about duplicate defines --- main.c | 2 ++ ports/atmel-samd/mphalport.h | 4 ++-- py/objstr.h | 4 ++-- shared-bindings/_pixelbuf/PixelBuf.h | 2 +- shared-bindings/digitalio/Direction.h | 2 +- shared-bindings/digitalio/DriveMode.h | 2 +- shared-bindings/digitalio/Pull.h | 2 +- shared-bindings/microcontroller/Processor.h | 2 +- shared-bindings/microcontroller/RunMode.h | 2 +- shared-bindings/nvm/ByteArray.h | 2 +- shared-bindings/os/__init__.h | 2 +- shared-bindings/supervisor/Runtime.h | 2 +- shared-bindings/usb_hid/Device.h | 2 +- supervisor/serial.h | 2 +- tools/gen_usb_descriptor.py | 10 +++++----- 15 files changed, 22 insertions(+), 20 deletions(-) diff --git a/main.c b/main.c index 2fb4689136..8c5c9ac37d 100755 --- a/main.c +++ b/main.c @@ -331,6 +331,8 @@ bool run_code_py(safe_mode_t safe_mode) { } } +FIL* boot_output_file; + void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { // If not in safe mode, run boot before initing USB and capture output in a // file. diff --git a/ports/atmel-samd/mphalport.h b/ports/atmel-samd/mphalport.h index f119717499..adc65ade53 100644 --- a/ports/atmel-samd/mphalport.h +++ b/ports/atmel-samd/mphalport.h @@ -37,8 +37,8 @@ #define mp_hal_ticks_ms() ((mp_uint_t) supervisor_ticks_ms32()) // Number of bytes in receive buffer -volatile uint8_t usb_rx_count; -volatile bool mp_cdc_enabled; +extern volatile uint8_t usb_rx_count; +extern volatile bool mp_cdc_enabled; int receive_usb(void); diff --git a/py/objstr.h b/py/objstr.h index 4b5e2054e0..cddc6a83a1 100644 --- a/py/objstr.h +++ b/py/objstr.h @@ -77,8 +77,8 @@ const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, s mp_obj_t index, bool is_slice); const byte *find_subbytes(const byte *haystack, size_t hlen, const byte *needle, size_t nlen, int direction); -const char nibble_to_hex_upper[16]; -const char nibble_to_hex_lower[16]; +extern const char nibble_to_hex_upper[16]; +extern const char nibble_to_hex_lower[16]; MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_encode_obj); MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_find_obj); diff --git a/shared-bindings/_pixelbuf/PixelBuf.h b/shared-bindings/_pixelbuf/PixelBuf.h index 14ee2e900b..0b09a57715 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.h +++ b/shared-bindings/_pixelbuf/PixelBuf.h @@ -29,7 +29,7 @@ #include "shared-module/_pixelbuf/PixelBuf.h" -const mp_obj_type_t pixelbuf_pixelbuf_type; +extern const mp_obj_type_t pixelbuf_pixelbuf_type; void common_hal__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, diff --git a/shared-bindings/digitalio/Direction.h b/shared-bindings/digitalio/Direction.h index d71f48c2ed..17e1eda8db 100644 --- a/shared-bindings/digitalio/Direction.h +++ b/shared-bindings/digitalio/Direction.h @@ -37,7 +37,7 @@ typedef struct { mp_obj_base_t base; } digitalio_direction_obj_t; -const mp_obj_type_t digitalio_direction_type; +extern const mp_obj_type_t digitalio_direction_type; extern const digitalio_direction_obj_t digitalio_direction_input_obj; extern const digitalio_direction_obj_t digitalio_direction_output_obj; diff --git a/shared-bindings/digitalio/DriveMode.h b/shared-bindings/digitalio/DriveMode.h index 47d036b3ae..01ecaa4ae9 100644 --- a/shared-bindings/digitalio/DriveMode.h +++ b/shared-bindings/digitalio/DriveMode.h @@ -38,7 +38,7 @@ typedef struct { mp_obj_base_t base; } digitalio_drive_mode_obj_t; -const mp_obj_type_t digitalio_drive_mode_type; +extern const mp_obj_type_t digitalio_drive_mode_type; extern const digitalio_drive_mode_obj_t digitalio_drive_mode_push_pull_obj; extern const digitalio_drive_mode_obj_t digitalio_drive_mode_open_drain_obj; diff --git a/shared-bindings/digitalio/Pull.h b/shared-bindings/digitalio/Pull.h index 22fb6cd0e7..b97e8fb255 100644 --- a/shared-bindings/digitalio/Pull.h +++ b/shared-bindings/digitalio/Pull.h @@ -35,7 +35,7 @@ typedef enum _digitalio_pull_t { PULL_DOWN } digitalio_pull_t; -const mp_obj_type_t digitalio_pull_type; +extern const mp_obj_type_t digitalio_pull_type; typedef struct { mp_obj_base_t base; diff --git a/shared-bindings/microcontroller/Processor.h b/shared-bindings/microcontroller/Processor.h index 1088112f43..0f520f940c 100644 --- a/shared-bindings/microcontroller/Processor.h +++ b/shared-bindings/microcontroller/Processor.h @@ -31,7 +31,7 @@ #include "common-hal/microcontroller/Processor.h" -const mp_obj_type_t mcu_processor_type; +extern const mp_obj_type_t mcu_processor_type; uint32_t common_hal_mcu_processor_get_frequency(void); float common_hal_mcu_processor_get_temperature(void); diff --git a/shared-bindings/microcontroller/RunMode.h b/shared-bindings/microcontroller/RunMode.h index 5e8b6e6465..ce90ab93a7 100644 --- a/shared-bindings/microcontroller/RunMode.h +++ b/shared-bindings/microcontroller/RunMode.h @@ -35,7 +35,7 @@ typedef enum { RUNMODE_BOOTLOADER } mcu_runmode_t; -const mp_obj_type_t mcu_runmode_type; +extern const mp_obj_type_t mcu_runmode_type; typedef struct { mp_obj_base_t base; diff --git a/shared-bindings/nvm/ByteArray.h b/shared-bindings/nvm/ByteArray.h index 5eee3ab502..9375bcb857 100644 --- a/shared-bindings/nvm/ByteArray.h +++ b/shared-bindings/nvm/ByteArray.h @@ -29,7 +29,7 @@ #include "common-hal/nvm/ByteArray.h" -const mp_obj_type_t nvm_bytearray_type; +extern const mp_obj_type_t nvm_bytearray_type; uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self); diff --git a/shared-bindings/os/__init__.h b/shared-bindings/os/__init__.h index 3776fef643..8394890def 100644 --- a/shared-bindings/os/__init__.h +++ b/shared-bindings/os/__init__.h @@ -32,7 +32,7 @@ #include "py/objtuple.h" -const mp_rom_obj_tuple_t common_hal_os_uname_info_obj; +extern const mp_rom_obj_tuple_t common_hal_os_uname_info_obj; mp_obj_t common_hal_os_uname(void); void common_hal_os_chdir(const char* path); diff --git a/shared-bindings/supervisor/Runtime.h b/shared-bindings/supervisor/Runtime.h index 864b070cdb..2dc59c3ab6 100755 --- a/shared-bindings/supervisor/Runtime.h +++ b/shared-bindings/supervisor/Runtime.h @@ -31,7 +31,7 @@ #include "py/obj.h" -const mp_obj_type_t supervisor_runtime_type; +extern const mp_obj_type_t supervisor_runtime_type; bool common_hal_get_serial_connected(void); diff --git a/shared-bindings/usb_hid/Device.h b/shared-bindings/usb_hid/Device.h index cb9a64b5ea..017995ccc3 100644 --- a/shared-bindings/usb_hid/Device.h +++ b/shared-bindings/usb_hid/Device.h @@ -29,7 +29,7 @@ #include "shared-module/usb_hid/Device.h" -const mp_obj_type_t usb_hid_device_type; +extern const mp_obj_type_t usb_hid_device_type; void common_hal_usb_hid_device_send_report(usb_hid_device_obj_t *self, uint8_t* report, uint8_t len); uint8_t common_hal_usb_hid_device_get_usage_page(usb_hid_device_obj_t *self); diff --git a/supervisor/serial.h b/supervisor/serial.h index ef88ad346d..066886303e 100644 --- a/supervisor/serial.h +++ b/supervisor/serial.h @@ -35,7 +35,7 @@ #ifdef CIRCUITPY_BOOT_OUTPUT_FILE #include "lib/oofatfs/ff.h" -FIL* boot_output_file; +extern FIL* boot_output_file; #endif void serial_early_init(void); diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index 9a8423c323..adec33100e 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -539,14 +539,14 @@ h_file.write("""\ #include -const uint8_t usb_desc_dev[{device_length}]; +extern const uint8_t usb_desc_dev[{device_length}]; // Make sure the control buffer is big enough to fit the descriptor. #define CFG_TUD_ENUM_BUFFER_SIZE {max_configuration_length} -const uint8_t usb_desc_cfg[{configuration_length}]; -uint16_t usb_serial_number[{serial_number_length}]; -uint16_t const * const string_desc_arr [{string_descriptor_length}]; +extern const uint8_t usb_desc_cfg[{configuration_length}]; +extern uint16_t usb_serial_number[{serial_number_length}]; +extern uint16_t const * const string_desc_arr [{string_descriptor_length}]; -const uint8_t hid_report_descriptor[{hid_report_descriptor_length}]; +extern const uint8_t hid_report_descriptor[{hid_report_descriptor_length}]; #define USB_HID_NUM_DEVICES {hid_num_devices} From f43834aba2ed9f8f69d961a6554bc81ecaa98f08 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 21 May 2020 11:27:09 +1000 Subject: [PATCH 0361/1293] py/py.mk: Use additional CFLAGS to compile string0.c. Otherwise functions like memset might get optimised to call themselves (eg with gcc 10). And provide CFLAGS_BUILTIN so these options can be changed by a port if needed. Fixes issue #6053. --- py/py.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/py/py.mk b/py/py.mk index 3cb505920c..3e1d7989f9 100644 --- a/py/py.mk +++ b/py/py.mk @@ -346,6 +346,11 @@ $(HEADER_BUILD)/qstrdefs.generated.h: $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/ $(PY_BUILD)/qstr.o: $(HEADER_BUILD)/qstrdefs.generated.h +# Standard C functions like memset need to be compiled with special flags so +# the compiler does not optimise these functions in terms of themselves. +CFLAGS_BUILTIN ?= -ffreestanding -fno-builtin -fno-lto +$(BUILD)/lib/libc/string0.o: CFLAGS += $(CFLAGS_BUILTIN) + # Force nlr code to always be compiled with space-saving optimisation so # that the function preludes are of a minimal and predictable form. $(PY_BUILD)/nlr%.o: CFLAGS += -Os From 226efb37bc771119093ac693a54dd7ce9c504ade Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Thu, 23 Jul 2020 00:34:30 +0000 Subject: [PATCH 0362/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (783 of 783 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 484764ac2b..10f3bf6113 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: 2020-07-17 18:03-0700\n" -"PO-Revision-Date: 2020-07-09 17:23+0000\n" +"PO-Revision-Date: 2020-07-23 02:57+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -86,7 +86,7 @@ msgstr "A lista %q deve ser uma lista" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" -msgstr "" +msgstr "%q deve ser >= 0" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -118,7 +118,7 @@ msgstr "'%q' argumento(s) requerido(s)" #: py/objarray.c msgid "'%q' object is not bytes-like" -msgstr "" +msgstr "objetos '%q' não são bytes-like" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -335,7 +335,7 @@ msgstr "Já está anunciando." #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" -msgstr "" +msgstr "Já está em execução" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -375,7 +375,7 @@ msgstr "Pelo menos %d %q pode ser definido (não %d)" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" -msgstr "" +msgstr "Tentativa de alocar %d blocos" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." From cf0a4d208e71260b6f2796ba4f1f0edc36f2dc04 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 23 Jul 2020 11:21:19 -0400 Subject: [PATCH 0363/1293] Fix unintended timer reset, style changes --- ports/esp32s2/common-hal/pulseio/PWMOut.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ports/esp32s2/common-hal/pulseio/PWMOut.c b/ports/esp32s2/common-hal/pulseio/PWMOut.c index 15fe96a229..c4f5e18dd4 100644 --- a/ports/esp32s2/common-hal/pulseio/PWMOut.c +++ b/ports/esp32s2/common-hal/pulseio/PWMOut.c @@ -34,7 +34,7 @@ #define INDEX_EMPTY 0xFF STATIC uint32_t reserved_timer_freq[LEDC_TIMER_MAX]; -STATIC uint8_t reserved_channels[LEDC_CHANNEL_MAX] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; +STATIC uint8_t reserved_channels[LEDC_CHANNEL_MAX]; STATIC bool never_reset_tim[LEDC_TIMER_MAX]; STATIC bool never_reset_chan[LEDC_CHANNEL_MAX]; @@ -135,8 +135,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, claim_pin(pin); // Set initial duty - ledc_set_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel, duty >> (16 - duty_bits)); - ledc_update_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel); + common_hal_pulseio_pwmout_set_duty_cycle(self, duty); return PWMOUT_OK; } @@ -160,7 +159,6 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { return; } ledc_stop(LEDC_LOW_SPEED_MODE, self->chan_handle.channel, 0); - ledc_timer_rst(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num); // Search if any other channel is using the timer bool taken = false; for (size_t i =0; i < LEDC_CHANNEL_MAX; i++) { @@ -170,6 +168,7 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { } // Variable frequency means there's only one channel on the timer if (!taken || self->variable_frequency) { + ledc_timer_rst(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num); reserved_timer_freq[self->tim_handle.timer_num] = 0; } reset_pin_number(self->pin_number); @@ -178,7 +177,7 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { } void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty) { - ledc_set_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel, duty >> (16 - self->duty_resolution)); + ledc_set_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel, duty >> (16 - self->duty_resolution)); ledc_update_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel); } From 4b6e02949d04d68bbd053436f4ea8fe2ecba38df Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 23 Jul 2020 11:06:14 -0700 Subject: [PATCH 0364/1293] Remove stop kwarg from I2C writeto. Fixes #2082 --- shared-bindings/bitbangio/I2C.c | 9 +++------ shared-bindings/busio/I2C.c | 15 +++++---------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index a9ab475bdb..212956726a 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -232,9 +232,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_readfrom_into_obj, 3, bitbangio_i2c_rea //| :param int address: 7-bit device address //| :param bytearray buffer: buffer containing the bytes to write //| :param int start: Index to start writing from -//| :param int end: Index to read up to but not include -//| :param bool stop: If true, output an I2C stop condition after the buffer is written. -//| Deprecated. Will be removed in 6.x and act as stop=True.""" +//| :param int end: Index to read up to but not include""" //| ... //| // Shared arg parsing for writeto and writeto_then_readfrom. @@ -256,13 +254,12 @@ STATIC void writeto(bitbangio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer } STATIC mp_obj_t bitbangio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_address, ARG_buffer, ARG_start, ARG_end, ARG_stop }; + enum { ARG_address, ARG_buffer, ARG_start, ARG_end }; static const mp_arg_t allowed_args[] = { { MP_QSTR_address, MP_ARG_REQUIRED | MP_ARG_INT, {.u_int = 0} }, { MP_QSTR_buffer, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, { MP_QSTR_start, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, { MP_QSTR_end, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = INT_MAX} }, - { MP_QSTR_stop, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} }, }; bitbangio_i2c_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); check_for_deinit(self); @@ -271,7 +268,7 @@ STATIC mp_obj_t bitbangio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, m mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); writeto(self, args[ARG_address].u_int, args[ARG_buffer].u_obj, args[ARG_start].u_int, - args[ARG_end].u_int, args[ARG_stop].u_bool); + args[ARG_end].u_int, true); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_writeto_obj, 1, bitbangio_i2c_writeto); diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index d34386a685..2b965fbe98 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -229,10 +229,8 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args, MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_into); //| def writeto(self, address: int, buffer: ReadableBuffer, *, start: int = 0, end: int = None, stop: bool = True) -> None: -//| """Write the bytes from ``buffer`` to the device selected by ``address``. -//| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be -//| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and -//| repeated start before a read. +//| """Write the bytes from ``buffer`` to the device selected by ``address`` and +//| then transmit a stop bit. //| //| If ``start`` or ``end`` is provided, then the buffer will be sliced //| as if ``buffer[start:end]``. This will not cause an allocation like @@ -244,9 +242,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_in //| :param int address: 7-bit device address //| :param bytearray buffer: buffer containing the bytes to write //| :param int start: Index to start writing from -//| :param int end: Index to read up to but not include. Defaults to ``len(buffer)`` -//| :param bool stop: If true, output an I2C stop condition after the buffer is written. -//| Deprecated. Will be removed in 6.x and act as stop=True.""" +//| :param int end: Index to read up to but not include. Defaults to ``len(buffer)``""" //| ... //| // Shared arg parsing for writeto and writeto_then_readfrom. @@ -267,13 +263,12 @@ STATIC void writeto(busio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, in } STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_address, ARG_buffer, ARG_start, ARG_end, ARG_stop }; + enum { ARG_address, ARG_buffer, ARG_start, ARG_end }; static const mp_arg_t allowed_args[] = { { MP_QSTR_address, MP_ARG_REQUIRED | MP_ARG_INT, {.u_int = 0} }, { MP_QSTR_buffer, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, { MP_QSTR_start, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, { MP_QSTR_end, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = INT_MAX} }, - { MP_QSTR_stop, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} }, }; busio_i2c_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); check_for_deinit(self); @@ -282,7 +277,7 @@ STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_ma mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); writeto(self, args[ARG_address].u_int, args[ARG_buffer].u_obj, args[ARG_start].u_int, - args[ARG_end].u_int, args[ARG_stop].u_bool); + args[ARG_end].u_int, true); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto); From 1ee8a09da251d428dbb1f2670f427772ce6d8e50 Mon Sep 17 00:00:00 2001 From: ikigaisense Date: Thu, 23 Jul 2020 14:39:59 -0600 Subject: [PATCH 0365/1293] add-ikigaisense_vita-nRF52840 --- .github/workflows/build.yml | 1 + ports/nrf/boards/ikigaisense_vita/board.c | 38 +++++++++++++++++++ .../boards/ikigaisense_vita/mpconfigboard.h | 20 ++++++++++ .../boards/ikigaisense_vita/mpconfigboard.mk | 8 ++++ ports/nrf/boards/ikigaisense_vita/pins.c | 36 ++++++++++++++++++ 5 files changed, 103 insertions(+) create mode 100644 ports/nrf/boards/ikigaisense_vita/board.c create mode 100644 ports/nrf/boards/ikigaisense_vita/mpconfigboard.h create mode 100644 ports/nrf/boards/ikigaisense_vita/mpconfigboard.mk create mode 100644 ports/nrf/boards/ikigaisense_vita/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d809ba8cb6..00932e4603 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -195,6 +195,7 @@ jobs: - "hallowing_m0_express" - "hallowing_m4_express" - "hiibot_bluefi" + - "ikigaisense_vita" - "imxrt1010_evk" - "imxrt1020_evk" - "imxrt1060_evk" diff --git a/ports/nrf/boards/ikigaisense_vita/board.c b/ports/nrf/boards/ikigaisense_vita/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/nrf/boards/ikigaisense_vita/board.c @@ -0,0 +1,38 @@ +/* + * 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 "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/nrf/boards/ikigaisense_vita/mpconfigboard.h b/ports/nrf/boards/ikigaisense_vita/mpconfigboard.h new file mode 100644 index 0000000000..14798aeee2 --- /dev/null +++ b/ports/nrf/boards/ikigaisense_vita/mpconfigboard.h @@ -0,0 +1,20 @@ +#include "nrfx/hal/nrf_gpio.h" + +#define MICROPY_HW_BOARD_NAME "IkigaiSense Vita nRF52840" +#define MICROPY_HW_MCU_NAME "nRF52840" + +#define MICROPY_HW_LED_STATUS (&pin_P0_27) + +#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 + +#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) + +#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_P0_08) +#define DEFAULT_I2C_BUS_SDA (&pin_P0_04) + +#define DEFAULT_UART_BUS_RX (&pin_P0_24) +#define DEFAULT_UART_BUS_TX (&pin_P0_22) diff --git a/ports/nrf/boards/ikigaisense_vita/mpconfigboard.mk b/ports/nrf/boards/ikigaisense_vita/mpconfigboard.mk new file mode 100644 index 0000000000..28bdee952d --- /dev/null +++ b/ports/nrf/boards/ikigaisense_vita/mpconfigboard.mk @@ -0,0 +1,8 @@ +USB_VID = 0x239A +USB_PID = 0x8094 +USB_PRODUCT = "IkigaiSense Vita nRF52840" +USB_MANUFACTURER = "IkigaiSense Technologies LTD" + +MCU_CHIP = nrf52840 + +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/ikigaisense_vita/pins.c b/ports/nrf/boards/ikigaisense_vita/pins.c new file mode 100644 index 0000000000..021f94f306 --- /dev/null +++ b/ports/nrf/boards/ikigaisense_vita/pins.c @@ -0,0 +1,36 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P1_15) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P1_13) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_P0_22) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_22) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_04) }, + + { MP_ROM_QSTR(MP_QSTR_MAXTEMP_SCL), MP_ROM_PTR(&pin_P0_31) }, + { MP_ROM_QSTR(MP_QSTR_MAXTEMP_SDA), MP_ROM_PTR(&pin_P0_30) }, + + { MP_ROM_QSTR(MP_QSTR_ACC_SCL), MP_ROM_PTR(&pin_P1_11) }, + { MP_ROM_QSTR(MP_QSTR_ACC_SDA), MP_ROM_PTR(&pin_P1_10) }, + + { MP_ROM_QSTR(MP_QSTR_ADDON_SCL), MP_ROM_PTR(&pin_P1_09) }, + { MP_ROM_QSTR(MP_QSTR_ADDON_SDA), MP_ROM_PTR(&pin_P0_06) }, + + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P0_27) }, + { MP_ROM_QSTR(MP_QSTR_YELLOW_LED), MP_ROM_PTR(&pin_P0_27) }, + + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 703fb9d4a102ed7065fb2f031c8224494c733681 Mon Sep 17 00:00:00 2001 From: ikigaisense Date: Thu, 23 Jul 2020 16:08:30 -0600 Subject: [PATCH 0366/1293] update-ndGarage_ndbit6_v2 --- ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.h | 2 +- ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/ndgarage_ndbit6_v2/pins.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.h b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.h index ed2d779f5b..0dc7f5d196 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.h +++ b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.h @@ -1,4 +1,4 @@ -#define MICROPY_HW_BOARD_NAME "ndGarage[n°]Bit6:FeatherSnow-v2" +#define MICROPY_HW_BOARD_NAME "ndGarage[n°] Bit6: FeatherSnow-v2" #define MICROPY_HW_MCU_NAME "samd21e18" #define MICROPY_HW_LED_STATUS (&pin_PA23) diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk index 90c000418a..193a0cf991 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk @@ -1,7 +1,7 @@ LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x80B9 -USB_PRODUCT = "Bit7" +USB_PRODUCT = "Bit6" USB_MANUFACTURER = "ndGarage" CHIP_VARIANT = SAMD21E18A diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/pins.c b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/pins.c index 562684fd8c..f0615df5aa 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/pins.c +++ b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/pins.c @@ -10,6 +10,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA01) }, { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA03) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA09) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA23) }, From f6f45c82a118f59d5d155fbbbe091580ba0dcf31 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 23 Jul 2020 18:54:26 -0400 Subject: [PATCH 0367/1293] wip: ATT protocol --- devices/ble_hci/common-hal/_bleio/Adapter.c | 2 +- .../ble_hci/common-hal/_bleio/Connection.h | 5 +- devices/ble_hci/common-hal/_bleio/__init__.h | 2 +- devices/ble_hci/common-hal/_bleio/att.c | 1621 +++++++++++++++++ devices/ble_hci/common-hal/_bleio/att.h | 57 + .../common-hal/_bleio/{hci_api.c => hci.c} | 94 +- .../common-hal/_bleio/{hci_api.h => hci.h} | 8 +- .../common-hal/_bleio/hci_include/addr.h | 1 + .../common-hal/_bleio/hci_include/att.h | 41 + .../_bleio/hci_include/att_internal.h | 266 +++ .../common-hal/_bleio/hci_include/hci.h | 1 + .../_bleio/hci_include/l2cap_internal.h | 230 +++ py/circuitpy_defns.mk | 4 +- py/misc.h | 2 + py/py.mk | 2 +- 15 files changed, 2290 insertions(+), 46 deletions(-) create mode 100644 devices/ble_hci/common-hal/_bleio/att.c create mode 100644 devices/ble_hci/common-hal/_bleio/att.h rename devices/ble_hci/common-hal/_bleio/{hci_api.c => hci.c} (96%) rename devices/ble_hci/common-hal/_bleio/{hci_api.h => hci.h} (93%) create mode 100644 devices/ble_hci/common-hal/_bleio/hci_include/att.h create mode 100644 devices/ble_hci/common-hal/_bleio/hci_include/att_internal.h create mode 100644 devices/ble_hci/common-hal/_bleio/hci_include/l2cap_internal.h diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index 17b66899a5..55e0bde017 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -31,7 +31,7 @@ #include #include -#include "hci_api.h" +#include "hci.h" #include "py/gc.h" #include "py/mphal.h" diff --git a/devices/ble_hci/common-hal/_bleio/Connection.h b/devices/ble_hci/common-hal/_bleio/Connection.h index bb0c140c55..8b9790d9ed 100644 --- a/devices/ble_hci/common-hal/_bleio/Connection.h +++ b/devices/ble_hci/common-hal/_bleio/Connection.h @@ -64,13 +64,16 @@ typedef struct { //REMOVE ble_gap_conn_params_t conn_params; volatile bool conn_params_updating; uint16_t mtu; - // Request that CCCD values for this conenction be saved, using sys_attr values. + // Request that CCCD values for this connection be saved, using sys_attr values. volatile bool do_bond_cccds; // Request that security key info for this connection be saved. volatile bool do_bond_keys; // Time of setting do_bond_ccds: we delay a bit to consolidate multiple CCCD changes // into one write. Time is currently in ticks_ms. uint64_t do_bond_cccds_request_time; + //FIX from att.c + uint8_t role; + bt_addr_le_t addr; } bleio_connection_internal_t; typedef struct { diff --git a/devices/ble_hci/common-hal/_bleio/__init__.h b/devices/ble_hci/common-hal/_bleio/__init__.h index 0d1c2785f7..18b4289e9a 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.h +++ b/devices/ble_hci/common-hal/_bleio/__init__.h @@ -29,7 +29,7 @@ #include -#include "hci_api.h" +#include "hci.h" void bleio_background(void); void bleio_reset(void); diff --git a/devices/ble_hci/common-hal/_bleio/att.c b/devices/ble_hci/common-hal/_bleio/att.c new file mode 100644 index 0000000000..d37012a0ad --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/att.c @@ -0,0 +1,1621 @@ +// Derived from ArduinoBLE. +// Copyright 2020 Dan Halbert for Adafruit Industries + +/* + This file is part of the ArduinoBLE library. + Copyright (c) 2018 Arduino SA. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "hci.h" +#include "att.h" + +// Zephyr include files to define HCI communication values and structs. +//#include "hci_include/hci.h" +//#include "hci_include/hci_err.h" +#include "hci_include/l2cap_internal.h" + +#include "py/obj.h" +#include "common-hal/_bleio/Adapter.h" +#include "supervisor/shared/tick.h" + +enum ble_attribute_type { + BLE_TYPE_UNKNOWN = 0x0000, + BLE_TYPE_PRIMARY_SERVICE = 0x2800, + BLE_TYPE_SECONDARY_SERVICE = 0x2801, + BLE_TYPE_CHARACTERISTIC = 0x2803, + BLE_TYPE_DESCRIPTOR = 0x2900 +}; + +STATIC uint16_t max_mtu = BT_ATT_DEFAULT_LE_MTU; // 23 +STATIC unsigned long timeout = 5000; + +STATIC volatile bool cnf; + +STATIC uint16_t long_write_handle = 0x0000; +STATIC uint8_t* long_write_value = NULL; +STATIC uint16_t long_write_value_length = 0; + +// When we send a request, fill this struct with info about the expected response. +// We check this against the actual received response. +STATIC struct { + uint16_t conn_handle; // Expected handle. + uint8_t opcode; // Expected RSP opcode. + uint8_t* buffer; // Pointer to response packet + uint8_t length; // Length of response packet. +} expected_rsp; + +//FIX BLEDeviceEventHandler event_handlers[2]; + + +STATIC void send_error(uint16_t conn_handle, uint8_t opcode, uint16_t handle, uint8_t code) { + struct __packed { + struct bt_att_hdr h; + struct bt_att_error_rsp r; + } rsp = { { + .code = BT_ATT_OP_ERROR_RSP, + }, { + .request = opcode, + } + }; + + hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, sizeof(rsp), (uint8_t *) &rsp); +} + +STATIC int send_req_wait_for_rsp(uint16_t conn_handle, int request_length, uint8_t* request_buffer, uint8_t response_buffer[]) { + // We expect a particular kind of response after this request. + expected_rsp.conn_handle = conn_handle; + // The response opcode is the request opcode + 1. + expected_rsp.opcode = request_buffer[0] + 1; + expected_rsp.buffer = response_buffer; + expected_rsp.length = 0; + + hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, request_length, request_buffer); + + if (response_buffer == NULL) { + // not expecting a response. + return 0; + } + + for (uint64_t start = supervisor_ticks_ms64(); supervisor_ticks_ms64() - start < timeout;) { + hci_poll_for_incoming_pkt(); + + if (!att_handle_is_connected(conn_handle)) { + break; + } + + if (expected_rsp.length != 0) { + expected_rsp.conn_handle = 0xffff; + return expected_rsp.length; + } + } + + expected_rsp.conn_handle = 0xffff; + return 0; +} + +// If a response matches what is in expected_rsp, copy the rest of it into the buffer. +STATIC void check_and_save_expected_rsp(uint16_t conn_handle, uint8_t opcode, uint8_t dlen, uint8_t data[]) { + if (conn_handle == expected_rsp.conn_handle && expected_rsp.opcode == opcode) { + expected_rsp.buffer[0] = opcode; + memcpy(&expected_rsp.buffer[1], data, dlen); + expected_rsp.length = dlen + 1; + } +} + +void att_init(void) { + max_mtu = BT_ATT_DEFAULT_LE_MTU; + timeout = 5000; + long_write_handle = 0x0000; + long_write_value = NULL; + long_write_value_length = 0; + + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + bleio_connections[i].conn_handle = BLE_CONN_HANDLE_INVALID; + bleio_connections[i].role = 0x00; + bleio_connections[i].addr.type = 0; + memset(bleio_connections[i].addr.a.val, 0, sizeof_field(bt_addr_t, val)); + bleio_connections[i].mtu = BT_ATT_DEFAULT_LE_MTU; + } + + //FIX memset(event_handlers, 0x00, sizeof(event_handlers)); +} + +bool att_connect_to_address(bt_addr_le_t *addr) { + //FIX + if (hci_le_create_conn(0x0060, 0x0030, 0x00, addr, 0x00, + 0x0006, 0x000c, 0x0000, 0x00c8, 0x0004, 0x0006) != 0) { + return false; + } + + bool is_connected = false; + + for (uint64_t start = supervisor_ticks_ms64(); supervisor_ticks_ms64() - start < timeout;) { + hci_poll_for_incoming_pkt(); + + is_connected = att_address_is_connected(addr); + + if (is_connected) { + break; + } + } + + if (!is_connected) { + hci_le_cancel_conn(); + } + + return is_connected; +} + +bool att_disconnect_from_address(bt_addr_le_t *addr) { + uint16_t conn_handle = att_conn_handle(addr); + if (conn_handle == 0xffff) { + return false; + } + + hci_disconnect(conn_handle); + + hci_poll_for_incoming_pkt_timeout(timeout); + + if (!att_handle_is_connected(conn_handle)) { + return true; + } + + return false; +} + +//FIX +// STATIC bool discover_services(uint16_t conn_handle, BLERemoteDevice* device, const char* serviceUuidFilter) { +// uint16_t reqStart_handle = 0x0001; +// uint16_t reqEnd_handle = 0xffff; + +// uint8_t response_buffer[max_mtu]; + +// BLEUuid serviceUuid(serviceUuidFilter); + +// while (reqEnd_handle == 0xffff) { +// int respLength = readByGroupReq(conn_handle, reqStart_handle, reqEnd_handle, BLE_TYPE_PRIMARY_SERVICE, response_buffer); + +// if (respLength == 0) { +// return false; +// } + +// if (response_buffer[0] == BT_ATT_OP_READ_BY_GROUP_RSP) { +// uint16_t lengthPerService = response_buffer[1]; +// uint8_t uuidLen = lengthPerService - 4; + +// for (size_t i = 2; i < respLength; i += lengthPerService) { +// struct __attribute__ ((packed)) RawService { +// uint16_t start_handle; +// uint16_t end_handle; +// uint8_t uuid[16]; +// } *rawService = (RawService*)&response_buffer[i]; + +// if (serviceUuidFilter == NULL || +// (uuidLen == serviceUuid.length() && memcmp(rawService->uuid, serviceUuid.data(), uuidLen) == 0)) { + +// BLERemoteService* service = new BLERemoteService(rawService->uuid, uuidLen, +// rawService->start_handle, +// rawService->end_handle); + +// if (service == NULL) { +// return false; +// } + +// device->addService(service); + +// } + +// reqStart_handle = rawService->end_handle + 1; + +// if (reqStart_handle == 0x0000) { +// reqEnd_handle = 0x0000; +// } +// } +// } else { +// reqEnd_handle = 0x0000; +// } +// } + +// return true; +// } + +// STATIC bool discover_characteristics(uint16_t conn_handle, BLERemoteDevice* device) { +// uint16_t reqStart_handle = 0x0001; +// uint16_t reqEnd_handle = 0xffff; + +// uint8_t response_buffer[max_mtu]; + +// int serviceCount = device->serviceCount(); + +// for (size_t i = 0; i < serviceCount; i++) { +// BLERemoteService* service = device->service(i); + +// reqStart_handle = service->start_handle(); +// reqEnd_handle = service->end_handle(); + +// while (1) { +// int respLength = readByTypeReq(conn_handle, reqStart_handle, reqEnd_handle, BLE_TYPE_CHARACTERISTIC, response_buffer); + +// if (respLength == 0) { +// return false; +// } + +// if (response_buffer[0] == BT_ATT_OP_READ_BY_TYPE_RSP) { +// uint16_t lengthPerCharacteristic = response_buffer[1]; +// uint8_t uuidLen = lengthPerCharacteristic - 5; + +// for (size_t i = 2; i < respLength; i += lengthPerCharacteristic) { +// struct __attribute__ ((packed)) RawCharacteristic { +// uint16_t start_handle; +// uint8_t properties; +// uint16_t value_handle; +// uint8_t uuid[16]; +// } *rawCharacteristic = (RawCharacteristic*)&response_buffer[i]; + +// BLERemoteCharacteristic* characteristic = new BLERemoteCharacteristic(rawCharacteristic->uuid, uuidLen, +// conn_handle, +// rawCharacteristic->start_handle, +// rawCharacteristic->properties, +// rawCharacteristic->value_handle); + +// if (characteristic == NULL) { +// return false; +// } + +// service->addCharacteristic(characteristic); + +// reqStart_handle = rawCharacteristic->value_handle + 1; +// } +// } else { +// break; +// } +// } +// } + +// return true; +// } + +// STATIC bool discover_descriptors(uint16_t conn_handle, BLERemoteDevice* device) { +// uint16_t reqStart_handle = 0x0001; +// uint16_t reqEnd_handle = 0xffff; + +// uint8_t response_buffer[max_mtu]; + +// int serviceCount = device->serviceCount(); + +// for (size_t i = 0; i < serviceCount; i++) { +// BLERemoteService* service = device->service(i); + +// uint16_t serviceEnd_handle = service->end_handle(); + +// int characteristicCount = service->characteristicCount(); + +// for (int j = 0; j < characteristicCount; j++) { +// BLERemoteCharacteristic* characteristic = service->characteristic(j); +// BLERemoteCharacteristic* nextCharacteristic = (j == (characteristicCount - 1)) ? NULL : service->characteristic(j); + +// reqStart_handle = characteristic->value_handle() + 1; +// reqEnd_handle = nextCharacteristic ? nextCharacteristic->value_handle() : serviceEnd_handle; + +// if (reqStart_handle > reqEnd_handle) { +// continue; +// } + +// while (1) { +// int respLength = findInfoReq(conn_handle, reqStart_handle, reqEnd_handle, response_buffer); + +// if (respLength == 0) { +// return false; +// } + +// if (response_buffer[0] == BT_ATT_OP_FIND_INFO_RSP) { +// uint16_t lengthPerDescriptor = response_buffer[1] * 4; +// uint8_t uuidLen = 2; + +// for (size_t i = 2; i < respLength; i += lengthPerDescriptor) { +// struct __attribute__ ((packed)) RawDescriptor { +// uint16_t handle; +// uint8_t uuid[16]; +// } *rawDescriptor = (RawDescriptor*)&response_buffer[i]; + +// BLERemoteDescriptor* descriptor = new BLERemoteDescriptor(rawDescriptor->uuid, uuidLen, +// conn_handle, +// rawDescriptor->handle); + +// if (descriptor == NULL) { +// return false; +// } + +// characteristic->addDescriptor(descriptor); + +// reqStart_handle = rawDescriptor->handle + 1; +// } +// } else { +// break; +// } +// } +// } +// } + +// return true; +// } + +bool att_discover_attributes(bt_addr_le_t *addr, const char* service_uuid_filter) { + uint16_t conn_handle = att_conn_handle(addr); + if (conn_handle == 0xffff) { + return false; + } + + // send MTU request + if (!att_exchange_mtu(conn_handle)) { + return false; + } + + // find the device entry for the peeer + //FIX BLERemoteDevice* device = NULL; + + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + // if (bleio_connections[i].conn_handle == conn_handle) { + // //FIX if (bleio_connections[i].device == NULL) { + // //FIX + // //bleio_connections[i].device = new BLERemoteDevice(); + // //} + + // //device = bleio_connections[i].device; + + // break; + // } + // } + + // //FIX if (device == NULL) { + // // return false; + // // } + + // if (service_uuid_filter == NULL) { + // // clear existing services + // //FIX device->clear_services(); + // } else { + // //FIX int service_count = device->service_count(); + + // for (size_t i = 0; i < service_count; i++) { + // //FIX BLERemoteService* service = device->service(i); + + // if (strcasecmp(service->uuid(), service_uuid_filter) == 0) { + // // found an existing service with same UUID + // return true; + // } + // } + } + + // discover services + //FIX + // if (!att_discover_services(conn_handle, device, service_uuid_filter)) { + // return false; + // } + + // // discover characteristics + // if (!discover_characteristics(conn_handle, device)) { + // return false; + // } + + // // discover descriptors396 + // if (!discover_descriptors(conn_handle, device)) { + // return false; + // } + + return true; +} + +void att_set_max_mtu(uint16_t max_mtu_in) { + max_mtu = max_mtu_in; +} + +void att_set_timeout(unsigned long timeout_in) { + timeout = timeout_in; +} + +void att_add_connection(uint16_t handle, uint8_t role, bt_addr_le_t *peer_addr, uint16_t interval, uint16_t latency, uint16_t supervision_timeout, uint8_t master_clock_accuracy) { + (void) interval; + (void) latency; + (void) supervision_timeout; + (void) master_clock_accuracy; + + int peer_index = -1; + + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + if (bleio_connections[i].conn_handle == 0xffff) { + peer_index = i; + break; + } + } + + if (peer_index == -1) { + // bail, no space + return; + } + + bleio_connections[peer_index].conn_handle = handle; + bleio_connections[peer_index].role = role; + bleio_connections[peer_index].mtu = 23; + memcpy(&bleio_connections[peer_index].addr, peer_addr, sizeof(bleio_connections[peer_index].addr)); + + //FIX if (event_handlers[BLEConnected]) { + // event_handlers[BLEConnected](BLEDevice(peer_bdaddr_type, peer_bdaddr)); + // } +} + + +void att_remove_connection(uint16_t handle, uint8_t reason) { + (void) reason; + int peer_index = -1; + int peer_count = 0; + + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + if (bleio_connections[i].conn_handle == handle) { + peer_index = i; + } + + if (bleio_connections[i].conn_handle != 0xffff) { + peer_count++; + } + } + + if (peer_index == -1) { + // bail not found + return; + } + + //FIX BLEDevice bleDevice(bleio_connections[peer_index].address_type, bleio_connections[peer_index].address); + + if (peer_count == 1) { + //FIX + // clear CCCD values on disconnect + // for (uint16_t i = 0; i < GATT.attributeCount(); i++) { + // BLELocalAttribute* attribute = GATT.attribute(i); + + // if (attribute->type() == BLE_TYPE_CHARACTERISTIC) { + // BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)attribute; + + // characteristic->writeCccdValue(bleDevice, 0x0000); + // } + // } + + long_write_handle = 0x0000; + long_write_value_length = 0; + } + + //FIX + // if (event_handlers[BLEDisconnected]) { + // event_handlers[BLEDisconnected](bleDevice); + // } + + bleio_connections[peer_index].conn_handle = 0xffff; + bleio_connections[peer_index].role = 0x00; + memset(&bleio_connections[peer_index].addr, 0x00, sizeof(bleio_connections[peer_index].addr)); + bleio_connections[peer_index].mtu = 23; + + //FIX if (bleio_connections[peer_index].device) { + //FIX delete bleio_connections[peer_index].device; + // } + //FIX bleio_connections[peer_index].device = NULL; +} + +uint16_t att_conn_handle(bt_addr_le_t *addr) { + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + if (bleio_connections[i].addr.type == addr->type && + memcmp(&bleio_connections[i].addr.a.val, addr->a.val, sizeof(addr->a.val)) == 0) { + return bleio_connections[i].conn_handle; + } + } + + return 0xffff; +} + +//FIX +// BLERemoteDevice* att_device(uint8_t address_type, const uint8_t address[6]) { +// for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { +// if (bleio_connections[i].addr.type == addr->type && +// memcmp(&bleio_connections[i].addr.a.val, addr->a.val, sizeof(addr->a.val)) == 0) { +// } +// } + +// return NULL; +// } + +bool att_is_connected(void) { + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + if (bleio_connections[i].conn_handle != 0xffff) { + return true; + } + } + + return false; +} + +bool att_address_is_connected(bt_addr_le_t *addr) { + return (att_conn_handle(addr) != 0xffff); +} + +bool att_handle_is_connected(uint16_t handle) { + hci_poll_for_incoming_pkt(); + + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + if (bleio_connections[i].conn_handle == handle) { + return true; + } + } + + return false; +} + +uint16_t att_mtu(uint16_t handle) { + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + if (bleio_connections[i].conn_handle == handle) { + return bleio_connections[i].mtu; + } + } + + return 23; +} + +bool att_disconnect_all(void) { + int num_disconnects = 0; + + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + if (bleio_connections[i].conn_handle == 0xffff) { + continue; + } + + if (hci_disconnect(bleio_connections[i].conn_handle) != 0) { + continue; + } + + num_disconnects++; + + bleio_connections[i].conn_handle = 0xffff; + bleio_connections[i].role = 0x00; + bleio_connections[i].addr.type = 0; + memset(bleio_connections[i].addr.a.val, 0, sizeof(bleio_connections[i].addr.a.val)); + bleio_connections[i].mtu = 23; + + //FIX + // if (bleio_connections[i].device) { + // delete bleio_connections[i].device; + // } + // bleio_connections[i].device = NULL; + } + + return (num_disconnects > 0); +} + +// FIX +// BLEDevice att_central() { +// for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { +// if (bleio_connections[i].conn_handle == 0xffff || bleio_connections[i].role != 0x01) { +// continue; +// } + +// return BLEDevice(bleio_connections[i].address_type, bleio_connections[i].address); +// } + +// return BLEDevice(); +// } + +bool att_handle_notify(uint16_t handle, const uint8_t* value, int length) { + int num_notifications = 0; + + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + if (bleio_connections[i].conn_handle == 0xffff) { + continue; + } + + //FIX This seems fishy. Why just .mtu instead of .mtu + 1 for opcode + uint8_t notification[bleio_connections[i].mtu]; + uint16_t notification_length = 0; + + notification[0] = BT_ATT_OP_NOTIFY; + notification_length++; + + memcpy(¬ification[1], &handle, sizeof(handle)); + notification_length += sizeof(handle); + + length = MIN((uint16_t)(bleio_connections[i].mtu - notification_length), (uint16_t)length); + memcpy(¬ification[notification_length], value, length); + notification_length += length; + + hci_send_acl_pkt(bleio_connections[i].conn_handle, BT_L2CAP_CID_ATT, notification_length, notification); + + num_notifications++; + } + + return (num_notifications > 0); +} + +bool att_handle_ind(uint16_t handle, const uint8_t* value, int length) { + int num_indications = 0; + + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + if (bleio_connections[i].conn_handle == 0xffff) { + continue; + } + + uint8_t indication[bleio_connections[i].mtu]; + uint16_t indication_length = 0; + + indication[0] = BT_ATT_OP_INDICATE; + indication_length++; + + memcpy(&indication[1], &handle, sizeof(handle)); + indication_length += sizeof(handle); + + length = MIN((uint16_t)(bleio_connections[i].mtu - indication_length), (uint16_t)length); + memcpy(&indication[indication_length], value, length); + indication_length += length; + + cnf = false; + + hci_send_acl_pkt(bleio_connections[i].conn_handle, BT_L2CAP_CID_ATT, indication_length, indication); + + while (!cnf) { + hci_poll_for_incoming_pkt(); + + if (!att_address_is_connected(&bleio_connections[i].addr)) { + break; + } + } + + num_indications++; + } + + return (num_indications > 0); +} + +STATIC void process_error(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { + struct bt_att_error_rsp *rsp = (struct bt_att_error_rsp *) data; + if (dlen != sizeof(struct bt_att_error_rsp)) { + // Incorrect size; ignore. + return; + } + + // expected_rsp.opcode is an RSP opcode. Does it match the REQ opcode in this response? + if (expected_rsp.conn_handle == conn_handle && (expected_rsp.opcode - 1) == rsp->request) { + expected_rsp.buffer[0] = BT_ATT_OP_ERROR_RSP; + memcpy(&expected_rsp.buffer[1], data, dlen); + expected_rsp.length = dlen + 1; + } +} + +STATIC void process_mtu_req(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { + struct bt_att_exchange_mtu_req *req = (struct bt_att_exchange_mtu_req *) data; + if (dlen != sizeof(req)) { + send_error(conn_handle, BT_ATT_OP_MTU_REQ, 0x0000, BT_ATT_ERR_INVALID_PDU); + return; + } + + uint16_t mtu = req->mtu; + + if (mtu > max_mtu) { + mtu = max_mtu; + } + + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + if (bleio_connections[i].conn_handle == conn_handle) { + bleio_connections[i].mtu = mtu; + break; + } + } + + struct __packed { + struct bt_att_hdr h; + struct bt_att_exchange_mtu_req r; + } rsp = { { + .code = BT_ATT_OP_MTU_RSP, + }, { + .mtu = mtu, + } + }; + + hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, sizeof(rsp), (uint8_t *) &rsp); +} + +STATIC void process_mtu_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { + if (dlen != sizeof(struct bt_att_exchange_mtu_rsp)) { + return; + } + + struct bt_att_exchange_mtu_rsp *rsp = (struct bt_att_exchange_mtu_rsp *) data; + + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + if (bleio_connections[i].conn_handle == conn_handle) { + bleio_connections[i].mtu = rsp->mtu; + break; + } + } + + check_and_save_expected_rsp(conn_handle, BT_ATT_OP_MTU_RSP, dlen, data); +} + +STATIC void process_find_info_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { + struct bt_att_find_info_req *req = (struct bt_att_find_info_req *) data; + + if (dlen != sizeof(struct bt_att_find_info_req)) { + send_error(conn_handle, BT_ATT_OP_FIND_INFO_REQ, req->start_handle, BT_ATT_ERR_INVALID_PDU); + return; + } + + //FIX + // uint8_t response[mtu]; + // uint16_t response_length; + + // response[0] = BT_ATT_OP_FIND_INFO_RSP; + // response[1] = 0x00; + // response_length = 2; + + // for (uint16_t i = (req->start_handle - 1); i < GATT.attributeCount() && i <= (req->end_handle - 1); i++) { + // BLELocalAttribute* attribute = GATT.attribute(i); + // uint16_t handle = (i + 1); + // bool is_value_handle = (attribute->type() == BLE_TYPE_CHARACTERISTIC) && (((BLELocalCharacteristic*)attribute)->valueHandle() == handle); + // int uuid_len = is_value_handle ? 2 : attribute->uuid_length(); + // size_t info_type = (uuidLen == 2) ? 0x01 : 0x02; + + // if (response[1] == 0) { + // response[1] = info_type; + // } + + // if (response[1] != info_type) { + // // different type + // break; + // } + + // // add the handle + // memcpy(&response[response_length], &handle, sizeof(handle)); + // response_length += sizeof(handle); + + // if (is_value_handle || attribute->type() == BLE_TYPE_DESCRIPTOR) { + // // add the UUID + // memcpy(&response[response_length], attribute->uuid_data(), uuid_len); + // response_length += uuidLen; + // } else { + // // add the type + // uint16_t type = attribute->type(); + + // memcpy(&response[response_length], &type, sizeof(type)); + // response_length += sizeof(type); + // } + + // if ((response_length + (2 + uuidLen)) > mtu) { + // break; + // } + // } + + // if (response_length == 2) { + // send_error(conn_handle, BT_ATT_OP_FIND_INFO_REQ, findInfoReq->start_handle, BT_ATT_ERR_ATTR_NOT_FOUND); + // } else { + // hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, response_length, response); + // } +} + +int att_find_info_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint8_t response_buffer[]) { + struct __packed req { + struct bt_att_hdr h; + struct bt_att_find_info_req r; + } req = { { + .code = BT_ATT_OP_FIND_INFO_REQ, + }, { + .start_handle = start_handle, + .end_handle = end_handle, + } + }; + + return send_req_wait_for_rsp(conn_handle, sizeof(req), (uint8_t *) &req, response_buffer); +} + +STATIC void process_find_info_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { + if (dlen < 2) { + return; // invalid, drop + } + + check_and_save_expected_rsp(conn_handle, BT_ATT_OP_FIND_INFO_RSP, dlen, data); +} + +STATIC void process_find_by_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { + struct bt_att_find_type_req *req = (struct bt_att_find_type_req *) data; + + if (dlen < sizeof(struct bt_att_find_type_req)) { + send_error(conn_handle, BT_ATT_OP_FIND_TYPE_RSP, req->start_handle, BT_ATT_ERR_INVALID_PDU); + return; + } + + uint8_t response[mtu]; + uint16_t response_length; + + response[0] = BT_ATT_OP_FIND_TYPE_RSP; + response_length = 1; + + //FIX + // if (find_by_type_req->type == BLE_TYPE_PRIMARY_SERVICE) { + // for (uint16_t i = (find_by_type_req->start_handle - 1); i < GATT.attributeCount() && i <= (find_by_type_req->end_handle - 1); i++) { + // BLELocalAttribute* attribute = GATT.attribute(i); + + // if ((attribute->type() == find_by_type_req->type) && (attribute->uuidLength() == value_length) && memcmp(attribute->uuidData(), value, value_length) == 0) { + // BLELocalService* service = (BLELocalService*)attribute; + + // // add the start handle + // uint16_t start_handle = service->start_handle(); + // memcpy(&response[response_length], &start_handle, sizeof(start_handle)); + // response_length += sizeof(start_handle); + + // // add the end handle + // uint16_t end_handle = service->end_handle(); + // memcpy(&response[response_length], &end_handle, sizeof(end_handle)); + // response_length += sizeof(end_handle); + // } + + // if ((response_length + 4) > mtu) { + // break; + // } + // } + // } + + if (response_length == 1) { + send_error(conn_handle, BT_ATT_OP_FIND_TYPE_RSP, req->start_handle, BT_ATT_ERR_ATTRIBUTE_NOT_FOUND); + } else { + hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, response_length, response); + } +} + +void process_read_by_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { + struct bt_att_read_group_req *req = (struct bt_att_read_group_req *) data; + uint16_t uuid = req->uuid[0] | (req->uuid[1] << 8); + + if (dlen != sizeof(struct bt_att_find_type_req) || + (uuid != BLE_TYPE_PRIMARY_SERVICE && + uuid != BLE_TYPE_SECONDARY_SERVICE)) { + send_error(conn_handle, BT_ATT_OP_READ_GROUP_REQ, req->start_handle, BT_ATT_ERR_UNSUPPORTED_GROUP_TYPE); + return; + } + + uint8_t response[mtu]; + uint16_t response_length; + + response[0] = BT_ATT_OP_READ_GROUP_RSP; + response[1] = 0x00; + response_length = 2; + + // FIX + // for (uint16_t i = (readByGroupReq->start_handle - 1); i < GATT.attributeCount() && i <= (readByGroupReq->end_handle - 1); i++) { + //FIX + // BLELocalAttribute* attribute = GATT.attribute(i); + + // if (readByGroupReq->uuid != attribute->type()) { + // // not the type + // continue; + // } + + // int uuidLen = attribute->uuidLength(); + // size_t infoSize = (uuidLen == 2) ? 6 : 20; + + // if (response[1] == 0) { + // response[1] = infoSize; + // } + + // if (response[1] != infoSize) { + // // different size + // break; + // } + + // BLELocalService* service = (BLELocalService*)attribute; + + // // add the start handle + // uint16_t start_handle = service->start_handle(); + // memcpy(&response[response_length], &start_handle, sizeof(start_handle)); + // response_length += sizeof(start_handle); + + // // add the end handle + // uint16_t end_handle = service->end_handle(); + // memcpy(&response[response_length], &end_handle, sizeof(end_handle)); + // response_length += sizeof(end_handle); + + // // add the UUID + // memcpy(&response[response_length], service->uuidData(), uuidLen); + // response_length += uuidLen; + + // if ((response_length + infoSize) > mtu) { + // break; + // } + // } + + if (response_length == 2) { + send_error(conn_handle, BT_ATT_OP_READ_GROUP_REQ, req->start_handle, BT_ATT_ERR_ATTRIBUTE_NOT_FOUND); + } else { + hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, response_length, response); + } +} + +int att_read_by_group_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint16_t uuid, uint8_t response_buffer[]) { + struct __packed { + struct bt_att_hdr h; + struct bt_att_read_group_req r; + } req = { { + .code = BT_ATT_OP_ERROR_RSP, + }, { + .start_handle = start_handle, + .end_handle = end_handle, + } + }; + req.r.uuid[0] = uuid & 0xff; + req.r.uuid[1] = uuid >> 8; + + + return send_req_wait_for_rsp(conn_handle, sizeof(req), (uint8_t *) &req, response_buffer); +} + +STATIC void process_read_by_group_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { + if (dlen < 2) { + return; // invalid, drop + } + + check_and_save_expected_rsp(conn_handle, BT_ATT_OP_READ_GROUP_RSP, dlen, data); +} + +STATIC void process_read_or_read_blob_req(uint16_t conn_handle, uint16_t mtu, uint8_t opcode, uint8_t dlen, uint8_t data[]) { + uint16_t handle; + uint16_t offset = 0; + uint8_t response_opcode; + + if (opcode == BT_ATT_OP_READ_REQ) { + if (dlen != sizeof(struct bt_att_read_req)) { + send_error(conn_handle, BT_ATT_OP_READ_REQ, 0x0000, BT_ATT_ERR_INVALID_PDU); + return; + } + + struct bt_att_read_req *req = (struct bt_att_read_req *) data; + handle = req->handle; + response_opcode = BT_ATT_OP_READ_RSP; + + } else { + if (dlen != sizeof(struct bt_att_read_blob_req)) { + send_error(conn_handle, BT_ATT_OP_READ_BLOB_REQ, 0x0000, BT_ATT_ERR_INVALID_PDU); + return; + } + + struct bt_att_read_blob_req *req = (struct bt_att_read_blob_req *) data; + handle = req->handle; + offset = req->offset; + response_opcode = BT_ATT_OP_READ_BLOB_RSP; + } + + //FIX + (void) offset; + (void) handle; + //FIX if ((uint16_t)(handle - 1) > GATT.attributeCount()) { + // send_error(conn_handle, opcode, handle, BT_ATT_ERR_ATTR_NOT_FOUND); + // return; + // } + + uint8_t response[mtu]; + uint16_t response_length; + + response[0] = response_opcode; + response_length = 1; + + //FIX BLELocalAttribute* attribute = GATT.attribute(handle - 1); + // enum BLEAttributeType attributeType = attribute->type(); + + // if (attributeType == BLE_TYPE_PRIMARY_SERVICE) { + // if (offset) { + // send_error(conn_handle, BT_ATT_ERR_ATTR_NOT_LONG, handle, BT_ATT_ERR_INVALID_PDU); + // return; + // } + + // BLELocalService* service = (BLELocalService*)attribute; + + // // add the UUID + // uint8_t uuidLen = service->uuidLength(); + // memcpy(&response[response_length], service->uuidData(), uuidLen); + // response_length += uuidLen; + // } else if (attributeType == BLE_TYPE_CHARACTERISTIC) { + // BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)attribute; + + // if (characteristic->handle() == handle) { + // if (offset) { + // send_error(conn_handle, opcode, handle, BT_ATT_ERR_ATTR_NOT_LONG); + // return; + // } + + // // add the properties + // response[response_length++] = characteristic->properties(); + + // // add the value handle + // uint16_t value_handle = characteristic->value_handle(); + // memcpy(&response[response_length], &value_handle, sizeof(value_handle)); + // response_length += sizeof(value_handle); + + // // add the UUID + // uint8_t uuidLen = characteristic->uuidLength(); + // memcpy(&response[response_length], characteristic->uuidData(), uuidLen); + // response_length += uuidLen; + // } else { + // if ((characteristic->properties() & BLERead) == 0) { + // send_error(conn_handle, opcode, handle, BT_ATT_ERR_READ_NOT_PERM); + // return; + // } + + // uint16_t value_length = characteristic->value_length(); + + // if (offset >= value_length) { + // send_error(conn_handle, opcode, handle, BT_ATT_ERR_INVALID_OFFSET); + // return; + // } + + // value_length = min(mtu - response_length, value_length - offset); + + // for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + // if (bleio_connections[i].conn_handle == conn_handle) { + // // FIX characteristic->readValue(BLEDevice(bleio_connections[i].address_type, bleio_connections[i].address), offset, &response[response_length], value_length); + // response_length += value_length; + // } + // } + // } + // } else if (attributeType == BLE_TYPE_DESCRIPTOR) { + // BLELocalDescriptor* descriptor = (BLELocalDescriptor*)attribute; + + // uint16_t value_length = descriptor->valueSize(); + + // if (offset >= value_length) { + // send_error(conn_handle, opcode, handle, BT_ATT_ERR_INVALID_OFFSET); + // return; + // } + + // value_length = min(mtu - response_length, value_length - offset); + + // memcpy(&response[response_length], descriptor->value() + offset, value_length); + // response_length += value_length; + // } + + hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, response_length, response); +} + +STATIC void process_read_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { + check_and_save_expected_rsp(conn_handle, BT_ATT_OP_READ_RSP, dlen, data); +} + +STATIC void process_read_by_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { + struct bt_att_read_type_req *req = (struct bt_att_read_type_req *) data; + + if (dlen != sizeof(struct bt_att_read_type_req)) { + send_error(conn_handle, BT_ATT_OP_READ_TYPE_REQ, req->start_handle, BT_ATT_ERR_INVALID_PDU); + return; + } + + // uint8_t response[mtu]; + // uint16_t response_length; + + // response[0] = BT_ATT_OP_READ_TYPE_RSP; + // response[1] = 0x00; + // response_length = 2; + + // for (uint16_t i = (req->start_handle - 1); i < GATT.attributeCount() && i <= (req->end_handle - 1); i++) { + // BLELocalAttribute* attribute = GATT.attribute(i); + // uint16_t handle = (i + 1); + + // if (attribute->type() == readByTypeReq->uuid) { + // if (attribute->type() == BLE_TYPE_CHARACTERISTIC) { + // BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)attribute; + + // if (characteristic->value_handle() == handle) { + // // value handle, skip + // continue; + // } + + // int uuidLen = attribute->uuidLength(); + // int typeSize = (uuidLen == 2) ? 7 : 21; + + // if (response[1] == 0) { + // response[1] = typeSize; + // } + + // if (response[1] != typeSize) { + // // all done, wrong size + // break; + // } + + // // add the handle + // memcpy(&response[response_length], &handle, sizeof(handle)); + // response_length += sizeof(handle); + + // // add the properties + // response[response_length++] = characteristic->properties(); + + // // add the value handle + // uint16_t value_handle = (handle + 1); + // memcpy(&response[response_length], &value_handle, sizeof(value_handle)); + // response_length += sizeof(value_handle); + + // // add the UUID + // memcpy(&response[response_length], characteristic->uuidData(), uuidLen); + // response_length += uuidLen; + + // // skip the next handle, it's a value handle + // i++; + + // if ((response_length + typeSize) > mtu) { + // break; + // } + // } else if (attribute->type() == 0x2902) { + // BLELocalDescriptor* descriptor = (BLELocalDescriptor*)attribute; + + // // add the handle + // memcpy(&response[response_length], &handle, sizeof(handle)); + // response_length += sizeof(handle); + + // // add the value + // int valueSize = min((uint16_t)(mtu - response_length), (uint16_t)descriptor->valueSize()); + // memcpy(&response[response_length], descriptor->value(), valueSize); + // response_length += valueSize; + + // response[1] = 2 + valueSize; + + // break; // all done + // } + // } else if (attribute->type() == BLE_TYPE_CHARACTERISTIC && attribute->uuidLength() == 2 && memcmp(&readByTypeReq->uuid, attribute->uuidData(), 2) == 0) { + // BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)attribute; + + // // add the handle + // memcpy(&response[response_length], &handle, sizeof(handle)); + // response_length += sizeof(handle); + + // // add the value + // int value_length = min((uint16_t)(mtu - response_length), (uint16_t)characteristic->value_length()); + // memcpy(&response[response_length], characteristic->value(), value_length); + // response_length += value_length; + + // response[1] = 2 + value_length; + + // break; // all done + // } + // } + + // if (response_length == 2) { + // send_error(conn_handle, BT_ATT_OP_READ_BY_TYPE_REQ, readByTypeReq->start_handle, BT_ATT_ERR_ATTR_NOT_FOUND); + // } else { + // hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, response_length, response); + // } +} + +int att_read_by_type_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint16_t type, uint8_t response_buffer[]) { + struct __packed { + struct bt_att_hdr h; + struct bt_att_read_type_req r; + } req = { { + .code = BT_ATT_OP_READ_TYPE_REQ, + }, { + .start_handle = start_handle, + .end_handle = end_handle, + } + }; + req.r.uuid[0] = type & 0xff; + req.r.uuid[1] = type >> 8; + + return send_req_wait_for_rsp(conn_handle, sizeof(req), (uint8_t *) &req, response_buffer); +} + +void att_read_by_type_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { + if (dlen < 1) { + return; // invalid, drop + } + + check_and_save_expected_rsp(conn_handle, BT_ATT_OP_READ_TYPE_RSP, dlen, data); +} + +// Handles BT_ATT_OP_WRITE_REQ or BT_ATT_OP_WRITE_ +STATIC void process_req_or_cmd(uint16_t conn_handle, uint16_t mtu, uint8_t op, uint8_t dlen, uint8_t data[]) { + boolean with_response = (op == BT_ATT_OP_WRITE_REQ); + + if (dlen < sizeof(struct bt_att_write_req)) { + if (with_response) { + send_error(conn_handle, BT_ATT_OP_WRITE_REQ, 0x0000, BT_ATT_ERR_INVALID_PDU); + } + return; + } + + uint16_t handle = *(uint16_t*)data; + + // if ((uint16_t)(handle - 1) > GATT.attributeCount()) { + // if (with_response) { + // send_error(conn_handle, BT_ATT_OP_WRITE_REQ, handle, BT_ATT_ERR_ATTR_NOT_FOUND); + // } + // return; + // } + + // uint8_t value_length = dlen - sizeof(handle); + // uint8_t* value = &data[sizeof(handle)]; + + // BLELocalAttribute* attribute = GATT.attribute(handle - 1); + + // if (attribute->type() == BLE_TYPE_CHARACTERISTIC) { + // BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)attribute; + + // if (handle != characteristic->value_handle() || + // withResponse ? ((characteristic->properties() & BLEWrite) == 0) : + // ((characteristic->properties() & BLEWriteWithoutResponse) == 0)) { + // if (withResponse) { + // send_error(conn_handle, BT_ATT_OP_WRITE_REQ, handle, BT_ATT_ERR_WRITE_NOT_PERM); + // } + // return; + // } + + // for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + // if (bleio_connections[i].conn_handle == conn_handle) { + // // FIX characteristic->writeValue(BLEDevice(bleio_connections[i].address_type, bleio_connections[i].address), value, value_length); + // break; + // } + // } + // } else if (attribute->type() == BLE_TYPE_DESCRIPTOR) { + // BLELocalDescriptor* descriptor = (BLELocalDescriptor*)attribute; + + // // only CCCD's are writable + // if (descriptor->uuidLength() != 2 || *((uint16_t*)(descriptor->uuidData())) != 0x2902) { + // if (withResponse) { + // send_error(conn_handle, BT_ATT_OP_WRITE_REQ, handle, BT_ATT_ERR_WRITE_NOT_PERM); + // } + // return; + // } + + // // get the previous handle, should be the characteristic for the CCCD + // attribute = GATT.attribute(handle - 2); + + // if (attribute->type() != BLE_TYPE_CHARACTERISTIC) { + // if (withResponse) { + // send_error(conn_handle, BT_ATT_OP_WRITE_REQ, handle, BT_ATT_ERR_WRITE_NOT_PERM); + // } + // return; + // } + + // BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)attribute; + + // for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + // if (bleio_connections[i].conn_handle == conn_handle) { + // //FIX characteristic->writeCccdValue(BLEDevice(bleio_connections[i].address_type, bleio_connections[i].address), *((uint16_t*)value)); + // break; + // } + // } + // } else { + // if (withResponse) { + // send_error(conn_handle, BT_ATT_OP_WRITE_REQ, handle, BT_ATT_ERR_WRITE_NOT_PERM); + // } + // return; + // } + + if (withResponse) { + uint8_t response[mtu]; + uint16_t response_length; + + response[0] = BT_ATT_OP_WRITE_RSP; + response_length = 1; + + hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, response_length, response); + } +} + +STATIC void process_write_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { + if (dlen != 0) { + return; // drop + } + + check_and_save_expected_rsp(conn_handle, BT_ATT_OP_WRITE_RSP, dlen, data); +} + +STATIC void process_prep_write_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { + struct __attribute__ ((packed)) PrepWriteReq { + uint16_t handle; + uint16_t offset; + } *prepWriteReq = (PrepWriteReq*)data; + + if (dlen < sizeof(PrepWriteReq)) { + send_error(conn_handle, BT_ATT_OP_PREP_WRITE_REQ, 0x0000, BT_ATT_ERR_INVALID_PDU); + return; + } + + uint16_t handle = prepWriteReq->handle; + uint16_t offset = prepWriteReq->offset; + + if ((uint16_t)(handle - 1) > GATT.attributeCount()) { + send_error(conn_handle, BT_ATT_OP_PREP_WRITE_REQ, handle, BT_ATT_ERR_ATTR_NOT_FOUND); + return; + } + + BLELocalAttribute* attribute = GATT.attribute(handle - 1); + + if (attribute->type() != BLE_TYPE_CHARACTERISTIC) { + send_error(conn_handle, BT_ATT_OP_PREP_WRITE_REQ, handle, BT_ATT_ERR_ATTR_NOT_LONG); + return; + } + + BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)attribute; + + if (handle != characteristic->value_handle()) { + send_error(conn_handle, BT_ATT_OP_PREP_WRITE_REQ, handle, BT_ATT_ERR_ATTR_NOT_LONG); + return; + } + + if ((characteristic->properties() & BLEWrqite) == 0) { + send_error(conn_handle, BT_ATT_OP_PREP_WRITE_REQ, handle, BT_ATT_ERR_WRITE_NOT_PERM); + return; + } + + if (long_write_handle == 0) { + int valueSize = characteristic->valueSize(); + + long_write_value = (uint8_t*)realloc(long_write_value, valueSize); + long_write_value_length = 0; + long_write_handle = handle; + + memset(long_write_value, 0x00, valueSize); + } else if (long_write_handle != handle) { + send_error(conn_handle, BT_ATT_OP_PREP_WRITE_REQ, handle, BT_ATT_ERR_UNLIKELY); + return; + } + + uint8_t value_length = dlen - sizeof(PrepWriteReq); + uint8_t* value = &data[sizeof(PrepWriteReq)]; + + if ((offset != long_write_value_length) || ((offset + value_length) > (uint16_t)characteristic->valueSize())) { + send_error(conn_handle, BT_ATT_OP_PREP_WRITE_REQ, handle, BT_ATT_ERR_INVALID_OFFSET); + return; + } + + memcpy(long_write_value + offset, value, value_length); + long_write_value_length += value_length; + + uint8_t response[mtu]; + uint16_t response_length; + + response[0] = BT_ATT_OP_PREP_WRITE_RSP; + memcpy(&response[1], data, dlen); + response_length = dlen + 1; + + hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, response_length, response); +} + +STATIC void process_exec_write_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { + if (dlen != sizeof(uint8_t)) { + send_error(conn_handle, BT_ATT_OP_EXEC_WRITE_REQ, 0x0000, BT_ATT_ERR_INVALID_PDU); + return; + } + + uint8_t flag = data[0]; + + if (long_write_handle && (flag & 0x01)) { + BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)GATT.attribute(long_write_handle - 1); + + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + if (bleio_connections[i].conn_handle == conn_handle) { + //FIX characteristic->writeValue(BLEDevice(bleio_connections[i].address_type, bleio_connections[i].address), long_write_value, long_write_value_length); + break; + } + } + } + + long_write_handle = 0x0000; + long_write_value_length = 0; + + uint8_t response[mtu]; + uint16_t response_length; + + response[0] = BT_ATT_OP_EXEC_WRITE_RSP; + response_length = 1; + + hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, response_length, response); +} + +STATIC void process_handle_notify_or_ind(uint16_t conn_handle, uint8_t opcode, uint8_t dlen, uint8_t data[]) { + if (dlen < 2) { + return; // drop + } + + struct __attribute__ ((packed)) _handleNotifyOrInd { + uint16_t handle; + } *handleNotifyOrInd = (_handleNotifyOrInd*)data; + + uint8_t handle = handleNotifyOrInd->handle; + + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + if (bleio_connections[i].conn_handle != conn_handle) { + continue; + } + + BLERemoteDevice* device = bleio_connections[i].device; + + if (!device) { + break; + } + + int serviceCount = device->serviceCount(); + + for (size_t i = 0; i < serviceCount; i++) { + BLERemoteService* s = device->service(i); + + if (s->start_handle() < handle && s->end_handle() >= handle) { + int characteristicCount = s->characteristicCount(); + + for (int j = 0; j < characteristicCount; j++) { + BLERemoteCharacteristic* c = s->characteristic(j); + + if (c->value_handle() == handle) { + //FIX c->writeValue(BLEDevice(bleio_connections[i].address_type, bleio_connections[i].address), &data[2], dlen - 2); + } + } + + break; + } + } + } + + if (opcode == BT_ATT_OP_HANDLE_IND) { + // send CNF for IND + + uint8_t cnf = BT_ATT_OP_HANDLE_CNF; + + hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, sizeof(cnf), &cnf); + } +} + +STATIC void process_handle_cnf(uint16_t /*conn_handle*/, uint8_t /*dlen*/, uint8_t /*data*/[]) { + cnf = true; +} + +bool att_exchange_mtu(uint16_t conn_handle) { + uint8_t response_buffer[max_mtu]; + struct bt_att_exchange_mtu_req req; + req->mtu = max_mtu; + return send_req_wait_for_rsp(conn_handle, BT_ATT_OP_MTU_REQ, &req, sizeof(req), response_buffer); +} + + + +void att_set_event_handler(BLEDeviceEvent event, BLEDeviceEventHandler event_handler) { + if (event < (sizeof(event_handlers) / (sizeof(event_handlers[0])))) { + event_handlers[event] = event_handler; + } +} + +int att_read_req(uint16_t conn_handle, uint16_t handle, uint8_t response_buffer[]) { + struct __attribute__ ((packed)) { + uint8_t op; + uint16_t handle; + } read_req = { BT_ATT_OP_READ_REQ, handle }; + + return send_req_wait_for_rsp(conn_handle, &read_req, sizeof(read_req), response_buffer); +} + +int att_write_req(uint16_t conn_handle, uint16_t handle, const uint8_t* data, uint8_t data_len, uint8_t response_buffer[]) { + struct __attribute__ ((packed)) { + uint8_t op; + uint16_t handle; + uint8_t data[255]; + } write_req; + + write_req.opcode = BT_ATT_OP_WRITE_REQ; + write_req.handle = handle; + memcpy(write_req.data, data, data_len); + + return send_req_wait_for_rsp(conn_handle, &write_req, 3 + data_len, response_buffer); +} + +void att_write_cmd(uint16_t conn_handle, uint16_t handle, const uint8_t* data, uint8_t data_len) { + struct bt_att_write_cmd req = { + .handle = handle, + }; + memcpy(req.value, data, data_len); + + send_req_wait_for_rsp(conn_handle, &req, data_len + sizeof(req), NULL); +} + +void att_process_data(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { + // Opcode is a single byte at the front of the data. + uint8_t opcode = data[0]; + + // Skip over opcode. + dlen--; + data++; + + uint16_t mtu = this->mtu(conn_handle); + + switch (opcode) { + case BT_ATT_OP_ERROR_RSP: + process_error(conn_handle, dlen, data); + break; + + case BT_ATT_OP_MTU_REQ: + process_mtu_req(conn_handle, dlen, data); + break; + + case BT_ATT_OP_MTU_RSP: + process_mtu_rsp(conn_handle, dlen, data); + break; + + case BT_ATT_OP_FIND_INFO_REQ: + process_find_info_req(conn_handle, mtu, dlen, data); + break; + + case BT_ATT_OP_FIND_INFO_RSP: + process_find_info_rsp(conn_handle, dlen, data); + break; + + case BT_ATT_OP_FIND_BY_TYPE_REQ: + process_find_by_type_req(conn_handle, mtu, dlen, data); + break; + + case BT_ATT_OP_READ_BY_TYPE_REQ: + process_read_by_type_req(conn_handle, mtu, dlen, data); + break; + + case BT_ATT_OP_READ_BY_TYPE_RSP: + process_read_by_type_rsp(conn_handle, dlen, data); + break; + + case BT_ATT_OP_READ_BY_GROUP_REQ: + att_read_by_group_req(conn_handle, mtu, dlen, data); + break; + + case BT_ATT_OP_READ_BY_GROUP_RSP: + prcoess_read_by_group_rsp(conn_handle, dlen, data); + break; + + case BT_ATT_OP_READ_REQ: + case BT_ATT_OP_READ_BLOB_REQ: + process_read_or_read_blob_req(conn_handle, mtu, opcode, dlen, data); + break; + + case BT_ATT_OP_READ_RSP: + process_read_rsp(conn_handle, dlen, data); + break; + + case BT_ATT_OP_WRITE_REQ: + case BT_ATT_OP_WRITE_CMD: + process_write_req_or_cmd(conn_handle, mtu, opcode, dlen, data); + break; + + case BT_ATT_OP_WRITE_RSP: + process_write_rsp(conn_handle, dlen, data); + break; + + case BT_ATT_OP_PREP_WRITE_REQ: + process_prep_write_req(conn_handle, mtu, dlen, data); + break; + + case BT_ATT_OP_EXEC_WRITE_REQ: + process_exec_write_req(conn_handle, mtu, dlen, data); + break; + + case BT_ATT_OP_HANDLE_NOTIFY: + case BT_ATT_OP_HANDLE_IND: + process_handle_notify_or_ind(conn_handle, opcode, dlen, data); + break; + + case BT_ATT_OP_HANDLE_CNF: + process_handle_cnf(conn_handle, dlen, data); + break; + + case BT_ATT_OP_READ_MULTI_REQ: + case BT_ATT_OP_SIGNED_WRITE_CMD: + default: + send_error(conn_handle, opcode, 0x00, BT_ATT_ERR_REQ_NOT_SUPP); + break; + } +} diff --git a/devices/ble_hci/common-hal/_bleio/att.h b/devices/ble_hci/common-hal/_bleio/att.h new file mode 100644 index 0000000000..108c44929f --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/att.h @@ -0,0 +1,57 @@ +// Derived from ArduinoBLE. +// Copyright 2020 Dan Halbert for Adafruit Industries + +/* + This file is part of the ArduinoBLE library. + Copyright (c) 2018 Arduino SA. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_ATT_H +#define MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_ATT_H + +#include +#include + +#include "hci_include/addr.h" +#include "hci_include/att.h" +#include "hci_include/att_internal.h" + +//FIX BLEDevice att_central(void); +//FIX BLERemoteDevice* att_device(uint8_t address_type, const uint8_t address[6]); +//FIX void att_set_event_handler(BLEDeviceEvent event, BLEDeviceEventHandler eventHandler); +bool att_address_is_connected(bt_addr_le_t *addr); +bool att_connect_to_address(bt_addr_le_t *addr); +bool att_disconnect_all(void); +bool att_disconnect_from_address(bt_addr_le_t *addr); +bool att_discover_attributes(bt_addr_le_t *addr, const char* service_uuid_filter); +bool att_exchange_mtu(uint16_t conn_handle); +bool att_handle_ind(uint16_t handle, const uint8_t* value, int length); +bool att_handle_is_connected(uint16_t handle); +bool att_handle_notify(uint16_t handle, const uint8_t* value, int length); +bool att_is_connected(void); +int att_read_req(uint16_t conn_handle, uint16_t handle, uint8_t response_buffer[]); +int att_write_req(uint16_t conn_handle, uint16_t handle, const uint8_t* data, uint8_t data_len, uint8_t response_buffer[]); +uint16_t att_conn_handle(bt_addr_le_t *addr); +uint16_t att_mtu(uint16_t handle); +void att_add_connection(uint16_t handle, uint8_t role, bt_addr_le_t *peer_addr, uint16_t interval, uint16_t latency, uint16_t supervision_timeout, uint8_t master_clock_accuracy); +void att_process_data(uint16_t conn_handle, uint8_t dlen, uint8_t data[]); +void att_remove_connection(uint16_t handle, uint8_t reason); +void att_set_max_mtu(uint16_t max_mtu); +void att_set_timeout(unsigned long timeout); +void att_write_cmd(uint16_t conn_handle, uint16_t handle, const uint8_t* data, uint8_t data_len); + +#endif // MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_ATT_H diff --git a/devices/ble_hci/common-hal/_bleio/hci_api.c b/devices/ble_hci/common-hal/_bleio/hci.c similarity index 96% rename from devices/ble_hci/common-hal/_bleio/hci_api.c rename to devices/ble_hci/common-hal/_bleio/hci.c index 854f7c0a00..83aba883ad 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_api.c +++ b/devices/ble_hci/common-hal/_bleio/hci.c @@ -13,13 +13,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "hci_api.h" +#include "att.h" +#include "hci.h" #include "py/obj.h" // Zephyr include files to define HCI communication values and structs. #include "hci_include/hci.h" #include "hci_include/hci_err.h" +#include "hci_include/l2cap_internal.h" #include @@ -28,46 +30,18 @@ #include "common-hal/_bleio/Adapter.h" #include "shared-bindings/microcontroller/__init__.h" + // HCI H4 protocol packet types: first byte in the packet. #define H4_CMD 0x01 #define H4_ACL 0x02 #define H4_SCO 0x03 #define H4_EVT 0x04 -//FIX replace -#define ATT_CID 0x0004 - -#define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER)) - -#define RX_BUFFER_SIZE (3 + 255) -#define ACL_DATA_BUFFER_SIZE (255 + 1) - #define CTS_TIMEOUT_MSECS (1000) #define RESPONSE_TIMEOUT_MSECS (1000) #define adapter (&common_hal_bleio_adapter_obj) -STATIC uint8_t rx_buffer[RX_BUFFER_SIZE]; -STATIC size_t rx_idx; - -STATIC size_t num_command_packets_allowed; -STATIC size_t max_pkt; -STATIC size_t pending_pkt; - -// Results from parsing a command response packet. -STATIC bool cmd_response_received; -STATIC uint16_t cmd_response_opcode; -STATIC uint8_t cmd_response_status; -STATIC size_t cmd_response_len; -STATIC uint8_t* cmd_response_data; - -STATIC uint8_t acl_data_buffer[ACL_DATA_BUFFER_SIZE]; -STATIC size_t acl_data_len; - -STATIC volatile bool hci_poll_in_progress = false; - -STATIC bool debug = true; - // These are the headers of the full packets that are sent over the serial interface. // They all have a one-byte type-field at the front, one of the H4_xxx packet types. @@ -109,6 +83,36 @@ typedef struct __attribute__ ((packed)) { } h4_hci_evt_pkt_t; +////////////////////////////////////////////////////////////////////// +// Static storage: + +//FIX size +#define RX_BUFFER_SIZE (3 + 255) +#define ACL_DATA_BUFFER_SIZE (255) + +STATIC uint8_t rx_buffer[RX_BUFFER_SIZE]; +STATIC size_t rx_idx; + +STATIC uint8_t acl_data_buffer[ACL_DATA_BUFFER_SIZE]; +STATIC size_t acl_data_len; + +STATIC size_t num_command_packets_allowed; +STATIC size_t max_pkt; +STATIC size_t pending_pkt; + +// Results from parsing a command response packet. +STATIC bool cmd_response_received; +STATIC uint16_t cmd_response_opcode; +STATIC uint8_t cmd_response_status; +STATIC size_t cmd_response_len; +STATIC uint8_t* cmd_response_data; + +STATIC volatile bool hci_poll_in_progress = false; + +STATIC bool debug = true; + +////////////////////////////////////////////////////////////////////// + STATIC void dump_cmd_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { if (debug) { h4_hci_cmd_pkt_t *pkt = (h4_hci_cmd_pkt_t *) pkt_data; @@ -191,15 +195,16 @@ STATIC void process_acl_data_pkt(uint8_t pkt_len, uint8_t pkt_data[]) { acl_data_len += pkt->data_len; } - acl_data_t *acl_so_far = (acl_data_t *) acl_data_buffer; - if (acl_data_len != acl_so_far->acl_data_len) { + acl_data_t *acl = (acl_data_t *) &acl_data_buffer; + if (acl_data_len != acl->acl_data_len) { // We don't have the full packet yet. return; } - // if (aclHdr->cid == ATT_CID) { - // ATT.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &rx_buffer[1 + sizeof(HCIACLHdr)]); - // } else if (aclHdr->cid == SIGNALING_CID) { + if (acl->cid == BT_L2CAP_CID_ATT) { + att_process_data(pkt->handle, acl->acl_data_len, acl->acl_data); + } + // } else if (aclHdr->cid == BT_L2CAP_CID_LE_SIG) { // L2CAPSignaling.handleData(aclHdr->handle & 0x0fff, aclHdr->len, &rx_buffer[1 + sizeof(HCIACLHdr)]); // } else { // struct __attribute__ ((packed)) { @@ -340,6 +345,20 @@ void hci_init(void) { hci_poll_in_progress = false; } +hci_result_t hci_poll_for_incoming_pkt_timeout(uint32_t timeout_msecs) { + uint64_t start = supervisor_ticks_ms64(); + + hci_result_t result; + + while (supervisor_ticks_ms64() -start < timeout_msecs) { + result = hci_poll_for_incoming_pkt(); + RUN_BACKGROUND_TASKS; + } + + return result; +} + + hci_result_t hci_poll_for_incoming_pkt(void) { if (hci_poll_in_progress) { return HCI_OK; @@ -500,8 +519,7 @@ STATIC hci_result_t send_command(uint16_t opcode, uint8_t params_len, void* para return HCI_NO_RESPONSE; } -//FIX remove unused -STATIC int __attribute__((unused)) send_acl_pkt(uint16_t handle, uint8_t cid, void* data, uint8_t data_len) { +hci_result_t hci_send_acl_pkt(uint16_t handle, uint8_t cid, uint8_t data_len, uint8_t *data) { int result; while (pending_pkt >= max_pkt) { result = hci_poll_for_incoming_pkt(); @@ -510,7 +528,7 @@ STATIC int __attribute__((unused)) send_acl_pkt(uint16_t handle, uint8_t cid, vo } } - // data_len does not include cid. + // data_len does not include cid const size_t cid_len = sizeof_field(acl_data_t, cid); // buf_len is size of entire packet including header. const size_t buf_len = sizeof(h4_hci_acl_pkt_t) + cid_len + data_len; diff --git a/devices/ble_hci/common-hal/_bleio/hci_api.h b/devices/ble_hci/common-hal/_bleio/hci.h similarity index 93% rename from devices/ble_hci/common-hal/_bleio/hci_api.h rename to devices/ble_hci/common-hal/_bleio/hci.h index f6d96d48fe..736877ddc6 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_api.h +++ b/devices/ble_hci/common-hal/_bleio/hci.h @@ -17,8 +17,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_HCI_API_H -#define MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_HCI_API_H +#ifndef MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_HCI_H +#define MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_HCI_H #include @@ -64,6 +64,7 @@ hci_result_t hci_le_set_scan_parameters(uint8_t scan_type, uint16_t interval, ui hci_result_t hci_le_set_scan_response_data(uint8_t length, uint8_t data[]); hci_result_t hci_poll_for_incoming_pkt(void); +hci_result_t hci_poll_for_incoming_pkt_timeout(uint32_t timeout_msecs); hci_result_t hci_read_bd_addr(bt_addr_t *addr); hci_result_t hci_read_buffer_size(uint16_t *acl_max_len, uint8_t *sco_max_len, uint16_t *acl_max_num, uint16_t *sco_max_num); @@ -72,6 +73,7 @@ hci_result_t hci_read_rssi(uint16_t handle, int *rssi); hci_result_t hci_reset(void); +hci_result_t hci_send_acl_pkt(uint16_t handle, uint8_t cid, uint8_t data_len, uint8_t *data); hci_result_t hci_set_evt_mask(uint64_t event_mask); -#endif // MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_HCI_API_H +#endif // MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_HCI_H diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/addr.h b/devices/ble_hci/common-hal/_bleio/hci_include/addr.h index 8f503b8a17..fd74a95e8d 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_include/addr.h +++ b/devices/ble_hci/common-hal/_bleio/hci_include/addr.h @@ -12,6 +12,7 @@ #ifndef ZEPHYR_INCLUDE_BLUETOOTH_ADDR_H_ #define ZEPHYR_INCLUDE_BLUETOOTH_ADDR_H_ +#include #include /** diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/att.h b/devices/ble_hci/common-hal/_bleio/hci_include/att.h new file mode 100644 index 0000000000..8117a48f45 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/hci_include/att.h @@ -0,0 +1,41 @@ +// CircuitPython: Adapted from Zephyr include file. +/** @file + * @brief Attribute Protocol handling. + */ + +/* + * Copyright (c) 2016 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef ZEPHYR_INCLUDE_BLUETOOTH_ATT_H_ +#define ZEPHYR_INCLUDE_BLUETOOTH_ATT_H_ + +/* Error codes for Error response PDU */ +#define BT_ATT_ERR_INVALID_HANDLE 0x01 +#define BT_ATT_ERR_READ_NOT_PERMITTED 0x02 +#define BT_ATT_ERR_WRITE_NOT_PERMITTED 0x03 +#define BT_ATT_ERR_INVALID_PDU 0x04 +#define BT_ATT_ERR_AUTHENTICATION 0x05 +#define BT_ATT_ERR_NOT_SUPPORTED 0x06 +#define BT_ATT_ERR_INVALID_OFFSET 0x07 +#define BT_ATT_ERR_AUTHORIZATION 0x08 +#define BT_ATT_ERR_PREPARE_QUEUE_FULL 0x09 +#define BT_ATT_ERR_ATTRIBUTE_NOT_FOUND 0x0a +#define BT_ATT_ERR_ATTRIBUTE_NOT_LONG 0x0b +#define BT_ATT_ERR_ENCRYPTION_KEY_SIZE 0x0c +#define BT_ATT_ERR_INVALID_ATTRIBUTE_LEN 0x0d +#define BT_ATT_ERR_UNLIKELY 0x0e +#define BT_ATT_ERR_INSUFFICIENT_ENCRYPTION 0x0f +#define BT_ATT_ERR_UNSUPPORTED_GROUP_TYPE 0x10 +#define BT_ATT_ERR_INSUFFICIENT_RESOURCES 0x11 +#define BT_ATT_ERR_DB_OUT_OF_SYNC 0x12 +#define BT_ATT_ERR_VALUE_NOT_ALLOWED 0x13 + +/* Common Profile Error Codes (from CSS) */ +#define BT_ATT_ERR_WRITE_REQ_REJECTED 0xfc +#define BT_ATT_ERR_CCC_IMPROPER_CONF 0xfd +#define BT_ATT_ERR_PROCEDURE_IN_PROGRESS 0xfe +#define BT_ATT_ERR_OUT_OF_RANGE 0xff + +#endif /* ZEPHYR_INCLUDE_BLUETOOTH_ATT_H_ */ diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/att_internal.h b/devices/ble_hci/common-hal/_bleio/hci_include/att_internal.h new file mode 100644 index 0000000000..1c75275daa --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/hci_include/att_internal.h @@ -0,0 +1,266 @@ +// CircuitPython: Adapted from Zephyr include file. + +/* att_internal.h - Attribute protocol handling */ + +/* + * Copyright (c) 2015-2016 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ + + +#include +// for __packed +#include + +#define BT_EATT_PSM 0x27 +#define BT_ATT_DEFAULT_LE_MTU 23 +#define BT_ATT_TIMEOUT K_SECONDS(30) + +//FIX #if BT_L2CAP_RX_MTU < CONFIG_BT_L2CAP_TX_MTU +// #define BT_ATT_MTU BT_L2CAP_RX_MTU +// #else +// #define BT_ATT_MTU CONFIG_BT_L2CAP_TX_MTU +// #endif + +struct bt_att_hdr { + uint8_t code; +} __packed; + +#define BT_ATT_OP_ERROR_RSP 0x01 +struct bt_att_error_rsp { + uint8_t request; + uint16_t handle; + uint8_t error; +} __packed; + +#define BT_ATT_OP_MTU_REQ 0x02 +struct bt_att_exchange_mtu_req { + uint16_t mtu; +} __packed; + +#define BT_ATT_OP_MTU_RSP 0x03 +struct bt_att_exchange_mtu_rsp { + uint16_t mtu; +} __packed; + +/* Find Information Request */ +#define BT_ATT_OP_FIND_INFO_REQ 0x04 +struct bt_att_find_info_req { + uint16_t start_handle; + uint16_t end_handle; +} __packed; + +/* Format field values for BT_ATT_OP_FIND_INFO_RSP */ +#define BT_ATT_INFO_16 0x01 +#define BT_ATT_INFO_128 0x02 + +struct bt_att_info_16 { + uint16_t handle; + uint16_t uuid; +} __packed; + +struct bt_att_info_128 { + uint16_t handle; + uint8_t uuid[16]; +} __packed; + +/* Find Information Response */ +#define BT_ATT_OP_FIND_INFO_RSP 0x05 +struct bt_att_find_info_rsp { + uint8_t format; + uint8_t info[0]; +} __packed; + +/* Find By Type Value Request */ +#define BT_ATT_OP_FIND_TYPE_REQ 0x06 +struct bt_att_find_type_req { + uint16_t start_handle; + uint16_t end_handle; + uint16_t type; + uint8_t value[0]; +} __packed; + +struct bt_att_handle_group { + uint16_t start_handle; + uint16_t end_handle; +} __packed; + +/* Find By Type Value Response */ +#define BT_ATT_OP_FIND_TYPE_RSP 0x07 +struct bt_att_find_type_rsp { + struct bt_att_handle_group list[0]; +} __packed; + +/* Read By Type Request */ +#define BT_ATT_OP_READ_TYPE_REQ 0x08 +struct bt_att_read_type_req { + uint16_t start_handle; + uint16_t end_handle; + uint8_t uuid[0]; +} __packed; + +struct bt_att_data { + uint16_t handle; + uint8_t value[0]; +} __packed; + +/* Read By Type Response */ +#define BT_ATT_OP_READ_TYPE_RSP 0x09 +struct bt_att_read_type_rsp { + uint8_t len; + struct bt_att_data data[0]; +} __packed; + +/* Read Request */ +#define BT_ATT_OP_READ_REQ 0x0a +struct bt_att_read_req { + uint16_t handle; +} __packed; + +/* Read Response */ +#define BT_ATT_OP_READ_RSP 0x0b +struct bt_att_read_rsp { + uint8_t value[0]; +} __packed; + +/* Read Blob Request */ +#define BT_ATT_OP_READ_BLOB_REQ 0x0c +struct bt_att_read_blob_req { + uint16_t handle; + uint16_t offset; +} __packed; + +/* Read Blob Response */ +#define BT_ATT_OP_READ_BLOB_RSP 0x0d +struct bt_att_read_blob_rsp { + uint8_t value[0]; +} __packed; + +/* Read Multiple Request */ +#define BT_ATT_READ_MULT_MIN_LEN_REQ 0x04 + +#define BT_ATT_OP_READ_MULT_REQ 0x0e +struct bt_att_read_mult_req { + uint16_t handles[0]; +} __packed; + +/* Read Multiple Respose */ +#define BT_ATT_OP_READ_MULT_RSP 0x0f +struct bt_att_read_mult_rsp { + uint8_t value[0]; +} __packed; + +/* Read by Group Type Request */ +#define BT_ATT_OP_READ_GROUP_REQ 0x10 +struct bt_att_read_group_req { + uint16_t start_handle; + uint16_t end_handle; + uint8_t uuid[0]; +} __packed; + +struct bt_att_group_data { + uint16_t start_handle; + uint16_t end_handle; + uint8_t value[0]; +} __packed; + +/* Read by Group Type Response */ +#define BT_ATT_OP_READ_GROUP_RSP 0x11 +struct bt_att_read_group_rsp { + uint8_t len; + struct bt_att_group_data data[0]; +} __packed; + +/* Write Request */ +#define BT_ATT_OP_WRITE_REQ 0x12 +struct bt_att_write_req { + uint16_t handle; + uint8_t value[0]; +} __packed; + +/* Write Response */ +#define BT_ATT_OP_WRITE_RSP 0x13 + +/* Prepare Write Request */ +#define BT_ATT_OP_PREPARE_WRITE_REQ 0x16 +struct bt_att_prepare_write_req { + uint16_t handle; + uint16_t offset; + uint8_t value[0]; +} __packed; + +/* Prepare Write Respond */ +#define BT_ATT_OP_PREPARE_WRITE_RSP 0x17 +struct bt_att_prepare_write_rsp { + uint16_t handle; + uint16_t offset; + uint8_t value[0]; +} __packed; + +/* Execute Write Request */ +#define BT_ATT_FLAG_CANCEL 0x00 +#define BT_ATT_FLAG_EXEC 0x01 + +#define BT_ATT_OP_EXEC_WRITE_REQ 0x18 +struct bt_att_exec_write_req { + uint8_t flags; +} __packed; + +/* Execute Write Response */ +#define BT_ATT_OP_EXEC_WRITE_RSP 0x19 + +/* Handle Value Notification */ +#define BT_ATT_OP_NOTIFY 0x1b +struct bt_att_notify { + uint16_t handle; + uint8_t value[0]; +} __packed; + +/* Handle Value Indication */ +#define BT_ATT_OP_INDICATE 0x1d +struct bt_att_indicate { + uint16_t handle; + uint8_t value[0]; +} __packed; + +/* Handle Value Confirm */ +#define BT_ATT_OP_CONFIRM 0x1e + +struct bt_att_signature { + uint8_t value[12]; +} __packed; + +#define BT_ATT_OP_READ_MULT_VL_REQ 0x20 +struct bt_att_read_mult_vl_req { + uint16_t handles[0]; +} __packed; + +/* Read Multiple Respose */ +#define BT_ATT_OP_READ_MULT_VL_RSP 0x21 +struct bt_att_read_mult_vl_rsp { + uint16_t len; + uint8_t value[0]; +} __packed; + +/* Handle Multiple Value Notification */ +#define BT_ATT_OP_NOTIFY_MULT 0x23 +struct bt_att_notify_mult { + uint16_t handle; + uint16_t len; + uint8_t value[0]; +} __packed; + +/* Write Command */ +#define BT_ATT_OP_WRITE_CMD 0x52 +struct bt_att_write_cmd { + uint16_t handle; + uint8_t value[0]; +} __packed; + +/* Signed Write Command */ +#define BT_ATT_OP_SIGNED_WRITE_CMD 0xd2 +struct bt_att_signed_write_cmd { + uint16_t handle; + uint8_t value[0]; +} __packed; diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/hci.h b/devices/ble_hci/common-hal/_bleio/hci_include/hci.h index 2de58b3d89..6c3a2b5bd0 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_include/hci.h +++ b/devices/ble_hci/common-hal/_bleio/hci_include/hci.h @@ -1,4 +1,5 @@ // CircuitPython: Adapted from Zephyr include file. + /* hci.h - Bluetooth Host Control Interface definitions */ /* diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/l2cap_internal.h b/devices/ble_hci/common-hal/_bleio/hci_include/l2cap_internal.h new file mode 100644 index 0000000000..bed311cf3c --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/hci_include/l2cap_internal.h @@ -0,0 +1,230 @@ +// CircuitPython: Adapted from Zephyr include file. + +/** @file + * @brief Internal APIs for Bluetooth L2CAP handling. + */ + +/* + * Copyright (c) 2015-2016 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +// for __packed +#include + +enum l2cap_conn_list_action { + BT_L2CAP_CHAN_LOOKUP, + BT_L2CAP_CHAN_DETACH, +}; + +#define BT_L2CAP_CID_BR_SIG 0x0001 +#define BT_L2CAP_CID_ATT 0x0004 +#define BT_L2CAP_CID_LE_SIG 0x0005 +#define BT_L2CAP_CID_SMP 0x0006 +#define BT_L2CAP_CID_BR_SMP 0x0007 + +#define BT_L2CAP_PSM_RFCOMM 0x0003 + +struct bt_l2cap_hdr { + uint16_t len; + uint16_t cid; +} __packed; + +struct bt_l2cap_sig_hdr { + uint8_t code; + uint8_t ident; + uint16_t len; +} __packed; + +#define BT_L2CAP_REJ_NOT_UNDERSTOOD 0x0000 +#define BT_L2CAP_REJ_MTU_EXCEEDED 0x0001 +#define BT_L2CAP_REJ_INVALID_CID 0x0002 + +#define BT_L2CAP_CMD_REJECT 0x01 +struct bt_l2cap_cmd_reject { + uint16_t reason; + uint8_t data[0]; +} __packed; + +struct bt_l2cap_cmd_reject_cid_data { + uint16_t scid; + uint16_t dcid; +} __packed; + +#define BT_L2CAP_CONN_REQ 0x02 +struct bt_l2cap_conn_req { + uint16_t psm; + uint16_t scid; +} __packed; + +/* command statuses in reposnse */ +#define BT_L2CAP_CS_NO_INFO 0x0000 +#define BT_L2CAP_CS_AUTHEN_PEND 0x0001 + +/* valid results in conn response on BR/EDR */ +#define BT_L2CAP_BR_SUCCESS 0x0000 +#define BT_L2CAP_BR_PENDING 0x0001 +#define BT_L2CAP_BR_ERR_PSM_NOT_SUPP 0x0002 +#define BT_L2CAP_BR_ERR_SEC_BLOCK 0x0003 +#define BT_L2CAP_BR_ERR_NO_RESOURCES 0x0004 +#define BT_L2CAP_BR_ERR_INVALID_SCID 0x0006 +#define BT_L2CAP_BR_ERR_SCID_IN_USE 0x0007 + +#define BT_L2CAP_CONN_RSP 0x03 +struct bt_l2cap_conn_rsp { + uint16_t dcid; + uint16_t scid; + uint16_t result; + uint16_t status; +} __packed; + +#define BT_L2CAP_CONF_SUCCESS 0x0000 +#define BT_L2CAP_CONF_UNACCEPT 0x0001 +#define BT_L2CAP_CONF_REJECT 0x0002 + +#define BT_L2CAP_CONF_REQ 0x04 +struct bt_l2cap_conf_req { + uint16_t dcid; + uint16_t flags; + uint8_t data[0]; +} __packed; + +#define BT_L2CAP_CONF_RSP 0x05 +struct bt_l2cap_conf_rsp { + uint16_t scid; + uint16_t flags; + uint16_t result; + uint8_t data[0]; +} __packed; + +/* Option type used by MTU config request data */ +#define BT_L2CAP_CONF_OPT_MTU 0x01 +/* Options bits selecting most significant bit (hint) in type field */ +#define BT_L2CAP_CONF_HINT 0x80 +#define BT_L2CAP_CONF_MASK 0x7f + +struct bt_l2cap_conf_opt { + uint8_t type; + uint8_t len; + uint8_t data[0]; +} __packed; + +#define BT_L2CAP_DISCONN_REQ 0x06 +struct bt_l2cap_disconn_req { + uint16_t dcid; + uint16_t scid; +} __packed; + +#define BT_L2CAP_DISCONN_RSP 0x07 +struct bt_l2cap_disconn_rsp { + uint16_t dcid; + uint16_t scid; +} __packed; + +#define BT_L2CAP_INFO_FEAT_MASK 0x0002 +#define BT_L2CAP_INFO_FIXED_CHAN 0x0003 + +#define BT_L2CAP_INFO_REQ 0x0a +struct bt_l2cap_info_req { + uint16_t type; +} __packed; + +/* info result */ +#define BT_L2CAP_INFO_SUCCESS 0x0000 +#define BT_L2CAP_INFO_NOTSUPP 0x0001 + +#define BT_L2CAP_INFO_RSP 0x0b +struct bt_l2cap_info_rsp { + uint16_t type; + uint16_t result; + uint8_t data[0]; +} __packed; + +#define BT_L2CAP_CONN_PARAM_REQ 0x12 +struct bt_l2cap_conn_param_req { + uint16_t min_interval; + uint16_t max_interval; + uint16_t latency; + uint16_t timeout; +} __packed; + +#define BT_L2CAP_CONN_PARAM_ACCEPTED 0x0000 +#define BT_L2CAP_CONN_PARAM_REJECTED 0x0001 + +#define BT_L2CAP_CONN_PARAM_RSP 0x13 +struct bt_l2cap_conn_param_rsp { + uint16_t result; +} __packed; + +#define BT_L2CAP_LE_CONN_REQ 0x14 +struct bt_l2cap_le_conn_req { + uint16_t psm; + uint16_t scid; + uint16_t mtu; + uint16_t mps; + uint16_t credits; +} __packed; + +/* valid results in conn response on LE */ +#define BT_L2CAP_LE_SUCCESS 0x0000 +#define BT_L2CAP_LE_ERR_PSM_NOT_SUPP 0x0002 +#define BT_L2CAP_LE_ERR_NO_RESOURCES 0x0004 +#define BT_L2CAP_LE_ERR_AUTHENTICATION 0x0005 +#define BT_L2CAP_LE_ERR_AUTHORIZATION 0x0006 +#define BT_L2CAP_LE_ERR_KEY_SIZE 0x0007 +#define BT_L2CAP_LE_ERR_ENCRYPTION 0x0008 +#define BT_L2CAP_LE_ERR_INVALID_SCID 0x0009 +#define BT_L2CAP_LE_ERR_SCID_IN_USE 0x000A +#define BT_L2CAP_LE_ERR_UNACCEPT_PARAMS 0x000B +#define BT_L2CAP_LE_ERR_INVALID_PARAMS 0x000C + +#define BT_L2CAP_LE_CONN_RSP 0x15 +struct bt_l2cap_le_conn_rsp { + uint16_t dcid; + uint16_t mtu; + uint16_t mps; + uint16_t credits; + uint16_t result; +} __packed; + +#define BT_L2CAP_LE_CREDITS 0x16 +struct bt_l2cap_le_credits { + uint16_t cid; + uint16_t credits; +} __packed; + +#define BT_L2CAP_ECRED_CONN_REQ 0x17 +struct bt_l2cap_ecred_conn_req { + uint16_t psm; + uint16_t mtu; + uint16_t mps; + uint16_t credits; + uint16_t scid[0]; +} __packed; + +#define BT_L2CAP_ECRED_CONN_RSP 0x18 +struct bt_l2cap_ecred_conn_rsp { + uint16_t mtu; + uint16_t mps; + uint16_t credits; + uint16_t result; + uint16_t dcid[0]; +} __packed; + +#define BT_L2CAP_ECRED_RECONF_REQ 0x19 +struct bt_l2cap_ecred_reconf_req { + uint16_t mtu; + uint16_t mps; + uint16_t scid[0]; +} __packed; + +#define BT_L2CAP_RECONF_SUCCESS 0x0000 +#define BT_L2CAP_RECONF_INVALID_MTU 0x0001 +#define BT_L2CAP_RECONF_INVALID_MPS 0x0002 + +#define BT_L2CAP_ECRED_RECONF_RSP 0x1a +struct bt_l2cap_ecred_reconf_rsp { + uint16_t result; +} __packed; diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 0dd31904f2..e2850e63fc 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -318,8 +318,10 @@ SRC_COMMON_HAL_ALL = \ watchdog/__init__.c \ ifeq ($(CIRCUITPY_BLEIO_HCI),1) +# Helper code for _bleio HCI. SRC_C += \ - common-hal/_bleio/hci_api.c \ + common-hal/_bleio/att.c \ + common-hal/_bleio/hci.c \ endif diff --git a/py/misc.h b/py/misc.h index 673568f226..abcc7edf74 100644 --- a/py/misc.h +++ b/py/misc.h @@ -120,6 +120,8 @@ size_t m_get_peak_bytes_allocated(void); // align ptr to the nearest multiple of "alignment" #define MP_ALIGN(ptr, alignment) (void*)(((uintptr_t)(ptr) + ((alignment) - 1)) & ~((alignment) - 1)) +#define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER)) + /** unichar / UTF-8 *********************************************/ #if MICROPY_PY_BUILTINS_STR_UNICODE diff --git a/py/py.mk b/py/py.mk index 3cb505920c..62050519b3 100644 --- a/py/py.mk +++ b/py/py.mk @@ -19,7 +19,7 @@ endif QSTR_GLOBAL_DEPENDENCIES += $(PY_SRC)/mpconfig.h mpconfigport.h # some code is performance bottleneck and compiled with other optimization options -CSUPEROPT = -O3 +_CSUPEROPT = -O3 # this sets the config file for FatFs CFLAGS_MOD += -DFFCONF_H=\"lib/oofatfs/ffconf.h\" From 778e8bfda97868b6a29fe5e4656aa2c2e2dd4378 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 23 Jul 2020 19:27:02 -0500 Subject: [PATCH 0368/1293] Changes to optimization option --- ports/atmel-samd/Makefile | 12 +++++------- .../boards/itsybitsy_m4_express/mpconfigboard.mk | 1 - .../boards/kicksat-sprite/mpconfigboard.mk | 4 ++++ .../boards/loc_ber_m4_base_board/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/pybadge/mpconfigboard.mk | 1 - ports/atmel-samd/boards/pyportal/mpconfigboard.mk | 1 - ports/cxd56/Makefile | 7 +++---- ports/esp32s2/Makefile | 8 ++++---- .../boards/espressif_saola_1_wroom/mpconfigboard.mk | 1 - ports/litex/Makefile | 8 ++++---- ports/mimxrt10xx/Makefile | 8 ++++---- ports/nrf/Makefile | 10 +++++----- ports/nrf/boards/pca10100/mpconfigboard.mk | 3 +++ ports/nrf/boards/simmel/mpconfigboard.mk | 4 ++++ ports/stm/Makefile | 9 ++++----- 16 files changed, 46 insertions(+), 37 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index f92e993331..25ab2c4aa7 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -87,29 +87,27 @@ INC += -I. \ ifeq ($(CHIP_FAMILY), samd21) PERIPHERALS_CHIP_FAMILY=samd21 -CFLAGS += -Os -DNDEBUG +OPTIMIZATION_FLAGS ?= -Os # TinyUSB defines CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 endif ifeq ($(CHIP_FAMILY), samd51) PERIPHERALS_CHIP_FAMILY=sam_d5x_e5x -CFLAGS += -Os -DNDEBUG +OPTIMIZATION_FLAGS ?= -O2 # TinyUSB defines CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD51 -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 ifeq ($(CHIP_FAMILY), same54) PERIPHERALS_CHIP_FAMILY=sam_d5x_e5x -CFLAGS += -Os -DNDEBUG +OPTIMIZATION_FLAGS ?= -O2 # TinyUSB defines CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD51 -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 -# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk -ifdef OPTIMIZATION_LEVEL -CFLAGS += -O$(OPTIMIZATION_LEVEL) -endif +# option to override default optimization level, set in boards/$(BOARD)/mpconfigboard.mk +CFLAGS += $(OPTIMIZATION_FLAGS) -DNDEBUG $(echo PERIPHERALS_CHIP_FAMILY=$(PERIPHERALS_CHIP_FAMILY)) #Debugging/Optimization diff --git a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk index 7e44d0c721..eb02d3c270 100644 --- a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk @@ -15,4 +15,3 @@ LONGINT_IMPL = MPZ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANG_APA102 = 1 -OPTIMIZATION_LEVEL = 2 diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index 9c7fe3398a..71d45990b4 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -18,3 +18,7 @@ CIRCUITPY_PS2IO = 0 CIRCUITPY_AUDIOMP3 = 0 CIRCUITPY_ULAB = 0 + +# Override optimization to keep binary small +OPTIMIZATION_FLAGS = -Os + diff --git a/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk b/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk index 55d6fa78e6..19e341428b 100644 --- a/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk +++ b/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk @@ -15,3 +15,6 @@ LONGINT_IMPL = MPZ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANG_APA102 = 1 +# Override optimization to keep binary small +OPTIMIZATION_FLAGS = -Os + diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index e0adc11b06..c1fe011c40 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -46,3 +46,6 @@ CFLAGS_INLINE_LIMIT = 45 else CFLAGS_INLINE_LIMIT = 70 endif + +# Override optimization to keep binary small +OPTIMIZATION_FLAGS = -Os diff --git a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk index d766dbe582..7a213faf4c 100644 --- a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk @@ -16,4 +16,3 @@ CIRCUITPY_GAMEPADSHIFT = 1 CIRCUITPY_STAGE = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pybadge -OPTIMIZATION_LEVEL = 2 diff --git a/ports/atmel-samd/boards/pyportal/mpconfigboard.mk b/ports/atmel-samd/boards/pyportal/mpconfigboard.mk index 66badb7412..149141a4e3 100644 --- a/ports/atmel-samd/boards/pyportal/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyportal/mpconfigboard.mk @@ -10,4 +10,3 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C" LONGINT_IMPL = MPZ -OPTIMIZATION_LEVEL = 2 diff --git a/ports/cxd56/Makefile b/ports/cxd56/Makefile index 8a23059b72..b3e104e1ea 100644 --- a/ports/cxd56/Makefile +++ b/ports/cxd56/Makefile @@ -107,7 +107,6 @@ CFLAGS += \ -Dmain=spresense_main \ -D_estack=__stack \ -c \ - -Os \ -pipe \ -std=gnu11 \ -mcpu=cortex-m4 \ @@ -123,10 +122,10 @@ CFLAGS += \ -fdata-sections \ -Wall \ +OPTIMIZATION_FLAGS ?= -O2 + # option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk -ifdef OPTIMIZATION_LEVEL -CFLAGS += -O$(OPTIMIZATION_LEVEL) -endif +CFLAGS += $(OPTIMIZATION_FLAGS) LIBM = "${shell "$(CC)" $(CFLAGS) -print-file-name=libm.a}" diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index f094150d7a..9415f42f26 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -101,18 +101,18 @@ CFLAGS += -DSTACK_CANARY_VALUE=0xa5a5a5a5 #Debugging/Optimization ifeq ($(DEBUG), 1) CFLAGS += -ggdb + OPTIMIZATION_FLAGS ?= -Og # You may want to enable these flags to make setting breakpoints easier. # CFLAGS += -fno-inline -fno-ipa-sra else - CFLAGS += -Os -DNDEBUG -ggdb3 + CFLAGS += -DNDEBUG -ggdb3 + OPTIMIZATION_FLAGS ?= -O2 # TODO: Test with -flto ### CFLAGS += -flto endif # option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk -ifdef OPTIMIZATION_LEVEL -CFLAGS += -O$(OPTIMIZATION_LEVEL) -endif +CFLAGS += $(OPTIMIZATION_FLAGS) CFLAGS += $(INC) -Werror -Wall -mlongcalls -std=gnu11 -Wl,--gc-sections $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk index 70caacf87e..6e76272659 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk @@ -17,4 +17,3 @@ CIRCUITPY_ESP_FLASH_FREQ=40m CIRCUITPY_ESP_FLASH_SIZE=4MB CIRCUITPY_MODULE=wroom -OPTIMIZATION_LEVEL = 2 diff --git a/ports/litex/Makefile b/ports/litex/Makefile index 6f083e5d4d..612953daaf 100644 --- a/ports/litex/Makefile +++ b/ports/litex/Makefile @@ -77,16 +77,16 @@ ifeq ($(DEBUG), 1) CFLAGS += -ggdb # You may want to enable these flags to make setting breakpoints easier. CFLAGS += -fno-inline -fno-ipa-sra + OPTIMIZATION_FLAGS ?= -Og else - CFLAGS += -Os -DNDEBUG -ggdb3 + CFLAGS += -DNDEBUG -ggdb3 + OPTIMIZATION_FLAGS ?= -O2 # TODO: Test with -flto ### CFLAGS += -flto endif # option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk -ifdef OPTIMIZATION_LEVEL -CFLAGS += -O$(OPTIMIZATION_LEVEL) -endif +CFLAGS += $(OPTIMIZATION_FLAGS) CFLAGS += $(INC) -Werror -Wall -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index bfc73d6382..9177188100 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -105,13 +105,13 @@ CFLAGS += \ -DCPU_$(CHIP_VARIANT) \ -DDEBUG \ -DIMXRT10XX \ - -Os -g3 -Wno-unused-parameter \ + -g3 -Wno-unused-parameter \ -ffunction-sections -fdata-sections -fstack-usage +OPTIMIZATION_FLAGS ?= -O2 + # option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk -ifdef OPTIMIZATION_LEVEL -CFLAGS += -O$(OPTIMIZATION_LEVEL) -endif +CFLAGS += $(OPTIMIZATION_FLAGS) LD_FILES = $(wildcard boards/$(BOARD)/*.ld) $(addprefix linking/, flash/$(FLASH).ld chip_family/$(CHIP_FAMILY).ld common.ld) diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index d3c311e3fc..3251aaa8eb 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -86,16 +86,16 @@ INC += -I../../supervisor/shared/usb #Debugging/Optimization ifeq ($(DEBUG), 1) - CFLAGS += -ggdb3 -Og + CFLAGS += -ggdb3 + OPTIMIZATION_FLAGS = -Og else - CFLAGS += -Os -DNDEBUG -ggdb3 + OPTIMIZATION_FLAGS ?= -O2 + CFLAGS += -DNDEBUG -ggdb3 CFLAGS += -flto -flto-partition=none endif # option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk -ifdef OPTIMIZATION_LEVEL -CFLAGS += -O$(OPTIMIZATION_LEVEL) -endif +CFLAGS += $(OPTIMIZATION_FLAGS) CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 318bc02065..e15bf3a67c 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -30,3 +30,6 @@ SUPEROPT_GC = 0 # These defines must be overridden before mpconfigboard.h is included, which is # why they are passed on the command line. CFLAGS += -DSPIM3_BUFFER_SIZE=0 -DSOFTDEVICE_RAM_SIZE='(32*1024)' + +# Override optimization to keep binary small +OPTIMIZATION_FLAGS = -Os diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index 2bca2492fc..cad3a965c0 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -32,3 +32,7 @@ CIRCUITPY_WATCHDOG = 1 # These defines must be overridden before mpconfigboard.h is included, which is # why they are passed on the command line. CFLAGS += -DSPIM3_BUFFER_SIZE=0 -DSOFTDEVICE_RAM_SIZE='(32*1024)' -DNRFX_SPIM3_ENABLED=0 + +# Override optimization to keep binary small +OPTIMIZATION_FLAGS = -Os + diff --git a/ports/stm/Makefile b/ports/stm/Makefile index 411d8146ce..5865ca8450 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -85,16 +85,15 @@ ifeq ($(DEBUG), 1) # You may want to enable these flags to make setting breakpoints easier. CFLAGS += -fno-inline -fno-ipa-sra else - CFLAGS += -Os -DNDEBUG + CFLAGS += -DNDEBUG + OPTIMIZATION_FLAGS ?= -O2 CFLAGS += -ggdb3 # TODO: Test with -flto # CFLAGS += -flto endif -# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk -ifdef OPTIMIZATION_LEVEL -CFLAGS += -O$(OPTIMIZATION_LEVEL) -endif +# to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk +CFLAGS += $(OPTIMIZATION_FLAGS) # MCU Series is defined by the HAL package and doesn't need to be specified here C_DEFS = -D$(MCU_PACKAGE) -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -D$(MCU_VARIANT) From c937fa17606312b20b41ac29e14e465c4f6d2be6 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 23 Jul 2020 19:29:57 -0500 Subject: [PATCH 0369/1293] fix formatting --- ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk | 1 - ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk | 1 - ports/nrf/boards/simmel/mpconfigboard.mk | 1 - 3 files changed, 3 deletions(-) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index 71d45990b4..18cef738e8 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -21,4 +21,3 @@ CIRCUITPY_ULAB = 0 # Override optimization to keep binary small OPTIMIZATION_FLAGS = -Os - diff --git a/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk b/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk index 19e341428b..3c407f5306 100644 --- a/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk +++ b/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk @@ -17,4 +17,3 @@ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANG_APA102 = 1 # Override optimization to keep binary small OPTIMIZATION_FLAGS = -Os - diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index cad3a965c0..8dd284d578 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -35,4 +35,3 @@ CFLAGS += -DSPIM3_BUFFER_SIZE=0 -DSOFTDEVICE_RAM_SIZE='(32*1024)' -DNRFX_SPIM3_E # Override optimization to keep binary small OPTIMIZATION_FLAGS = -Os - From ce37a442e894ca2784ae1358947b8153dfe06d9c Mon Sep 17 00:00:00 2001 From: root Date: Thu, 23 Jul 2020 19:35:04 -0500 Subject: [PATCH 0370/1293] format fix --- ports/nrf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 3251aaa8eb..13a148df3b 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -86,7 +86,7 @@ INC += -I../../supervisor/shared/usb #Debugging/Optimization ifeq ($(DEBUG), 1) - CFLAGS += -ggdb3 + CFLAGS += -ggdb3 OPTIMIZATION_FLAGS = -Og else OPTIMIZATION_FLAGS ?= -O2 From 51a79b1af7fa663bb078136611705c04df12970a Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Tue, 21 Jul 2020 00:01:22 -0700 Subject: [PATCH 0371/1293] add coroutine behavior for generators coroutines don't have __next__; they also call themselves coroutines. This does not change the fact that `async def` methods are generators, but it does make them behave more like CPython. --- mpy-cross/mpconfigport.h | 1 + py/compile.c | 2 +- py/emitglue.c | 2 +- py/obj.h | 2 +- py/objgenerator.c | 16 ++++++++++++++-- py/runtime0.h | 1 + tests/basics/async_coroutine.py | 13 +++++++++++++ tests/basics/async_coroutine.py.exp | 1 + 8 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 tests/basics/async_coroutine.py create mode 100644 tests/basics/async_coroutine.py.exp diff --git a/mpy-cross/mpconfigport.h b/mpy-cross/mpconfigport.h index 0b07a5b442..464c9113d5 100644 --- a/mpy-cross/mpconfigport.h +++ b/mpy-cross/mpconfigport.h @@ -40,6 +40,7 @@ #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE) #define MICROPY_CPYTHON_COMPAT (1) +#define MICROPY_PY_ASYNC_AWAIT (1) #define MICROPY_USE_INTERNAL_PRINTF (0) #define MICROPY_PY_BUILTINS_STR_UNICODE (1) diff --git a/py/compile.c b/py/compile.c index 4708110056..9b0d29998a 100644 --- a/py/compile.c +++ b/py/compile.c @@ -1890,7 +1890,7 @@ STATIC void compile_async_stmt(compiler_t *comp, mp_parse_node_struct_t *pns) { // async def compile_funcdef(comp, pns0); scope_t *fscope = (scope_t*)pns0->nodes[4]; - fscope->scope_flags |= MP_SCOPE_FLAG_GENERATOR; + fscope->scope_flags |= MP_SCOPE_FLAG_GENERATOR | MP_SCOPE_FLAG_ASYNC; } else if (MP_PARSE_NODE_STRUCT_KIND(pns0) == PN_for_stmt) { // async for compile_async_for_stmt(comp, pns0); diff --git a/py/emitglue.c b/py/emitglue.c index 3a3174b0f8..7635a73d6a 100644 --- a/py/emitglue.c +++ b/py/emitglue.c @@ -152,7 +152,7 @@ mp_obj_t mp_make_function_from_raw_code(const mp_raw_code_t *rc, mp_obj_t def_ar // check for generator functions and if so wrap in generator object if ((rc->scope_flags & MP_SCOPE_FLAG_GENERATOR) != 0) { - fun = mp_obj_new_gen_wrap(fun); + fun = mp_obj_new_gen_wrap(fun, (rc->scope_flags & MP_SCOPE_FLAG_ASYNC) != 0); } return fun; diff --git a/py/obj.h b/py/obj.h index 8536e33335..e603d4a496 100644 --- a/py/obj.h +++ b/py/obj.h @@ -665,7 +665,7 @@ mp_obj_t mp_obj_new_fun_bc(mp_obj_t def_args, mp_obj_t def_kw_args, const byte * mp_obj_t mp_obj_new_fun_native(mp_obj_t def_args_in, mp_obj_t def_kw_args, const void *fun_data, const mp_uint_t *const_table); mp_obj_t mp_obj_new_fun_viper(size_t n_args, void *fun_data, mp_uint_t type_sig); mp_obj_t mp_obj_new_fun_asm(size_t n_args, void *fun_data, mp_uint_t type_sig); -mp_obj_t mp_obj_new_gen_wrap(mp_obj_t fun); +mp_obj_t mp_obj_new_gen_wrap(mp_obj_t fun, bool is_coroutine); mp_obj_t mp_obj_new_closure(mp_obj_t fun, size_t n_closed, const mp_obj_t *closed); mp_obj_t mp_obj_new_tuple(size_t n, const mp_obj_t *items); mp_obj_t mp_obj_new_list(size_t n, mp_obj_t *items); diff --git a/py/objgenerator.c b/py/objgenerator.c index 6ffcfae46a..57d20e3db8 100644 --- a/py/objgenerator.c +++ b/py/objgenerator.c @@ -42,11 +42,13 @@ typedef struct _mp_obj_gen_wrap_t { mp_obj_base_t base; mp_obj_t *fun; + bool coroutine_generator; } mp_obj_gen_wrap_t; typedef struct _mp_obj_gen_instance_t { mp_obj_base_t base; mp_obj_dict_t *globals; + bool coroutine_generator; mp_code_state_t code_state; } mp_obj_gen_instance_t; @@ -64,6 +66,7 @@ STATIC mp_obj_t gen_wrap_call(mp_obj_t self_in, size_t n_args, size_t n_kw, cons n_state * sizeof(mp_obj_t) + n_exc_stack * sizeof(mp_exc_stack_t)); o->base.type = &mp_type_gen_instance; + o->coroutine_generator = self->coroutine_generator; o->globals = self_fun->globals; o->code_state.fun_bc = self_fun; o->code_state.ip = 0; @@ -78,10 +81,11 @@ const mp_obj_type_t mp_type_gen_wrap = { .unary_op = mp_generic_unary_op, }; -mp_obj_t mp_obj_new_gen_wrap(mp_obj_t fun) { +mp_obj_t mp_obj_new_gen_wrap(mp_obj_t fun, bool is_coroutine) { mp_obj_gen_wrap_t *o = m_new_obj(mp_obj_gen_wrap_t); o->base.type = &mp_type_gen_wrap; o->fun = MP_OBJ_TO_PTR(fun); + o->coroutine_generator = is_coroutine; return MP_OBJ_FROM_PTR(o); } @@ -91,7 +95,11 @@ mp_obj_t mp_obj_new_gen_wrap(mp_obj_t fun) { STATIC void gen_instance_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { (void)kind; mp_obj_gen_instance_t *self = MP_OBJ_TO_PTR(self_in); - mp_printf(print, "", mp_obj_fun_get_name(MP_OBJ_FROM_PTR(self->code_state.fun_bc)), self); + if (self->coroutine_generator) { + mp_printf(print, "", mp_obj_fun_get_name(MP_OBJ_FROM_PTR(self->code_state.fun_bc)), self); + } else { + mp_printf(print, "", mp_obj_fun_get_name(MP_OBJ_FROM_PTR(self->code_state.fun_bc)), self); + } } mp_vm_return_kind_t mp_obj_gen_resume(mp_obj_t self_in, mp_obj_t send_value, mp_obj_t throw_value, mp_obj_t *ret_val) { @@ -194,6 +202,10 @@ STATIC mp_obj_t gen_resume_and_raise(mp_obj_t self_in, mp_obj_t send_value, mp_o } STATIC mp_obj_t gen_instance_iternext(mp_obj_t self_in) { + mp_obj_gen_instance_t *self = MP_OBJ_TO_PTR(self_in); + if (self->coroutine_generator) { + mp_raise_TypeError(translate("'coroutine' object is not an iterator")); + } return gen_resume_and_raise(self_in, mp_const_none, MP_OBJ_NULL); } diff --git a/py/runtime0.h b/py/runtime0.h index a8089ea646..fb35c8a9f4 100644 --- a/py/runtime0.h +++ b/py/runtime0.h @@ -33,6 +33,7 @@ #define MP_SCOPE_FLAG_VARKEYWORDS (0x02) #define MP_SCOPE_FLAG_GENERATOR (0x04) #define MP_SCOPE_FLAG_DEFKWARGS (0x08) +#define MP_SCOPE_FLAG_ASYNC (0x10) // types for native (viper) function signature #define MP_NATIVE_TYPE_OBJ (0x00) diff --git a/tests/basics/async_coroutine.py b/tests/basics/async_coroutine.py new file mode 100644 index 0000000000..791f6df14c --- /dev/null +++ b/tests/basics/async_coroutine.py @@ -0,0 +1,13 @@ +async def f(): + pass + +try: + f() # Should not crash +except Exception as e: + print('failed to invoke') + +try: + next(f()) + print('This should fail because async def returns a coroutine, and next() is not allowed') +except Exception as e: + print('pass') diff --git a/tests/basics/async_coroutine.py.exp b/tests/basics/async_coroutine.py.exp new file mode 100644 index 0000000000..2ae28399f5 --- /dev/null +++ b/tests/basics/async_coroutine.py.exp @@ -0,0 +1 @@ +pass From 764d49e6416fe5b35b61a30981f326435a9a5c91 Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Tue, 21 Jul 2020 18:31:18 -0700 Subject: [PATCH 0372/1293] also disable async_coroutine test in native emitter --- tests/run-tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run-tests b/tests/run-tests index 151d48095b..e28600361b 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -362,7 +362,7 @@ def run_tests(pyb, tests, args, base_path=".", num_threads=1): if args.emit == 'native': skip_tests.update({'basics/%s.py' % t for t in 'gen_yield_from gen_yield_from_close gen_yield_from_ducktype gen_yield_from_exc gen_yield_from_executing gen_yield_from_iter gen_yield_from_send gen_yield_from_stopped gen_yield_from_throw gen_yield_from_throw2 gen_yield_from_throw3 generator1 generator2 generator_args generator_close generator_closure generator_exc generator_pend_throw generator_return generator_send'.split()}) # require yield skip_tests.update({'basics/%s.py' % t for t in 'bytes_gen class_store_class globals_del string_join gen_stack_overflow'.split()}) # require yield - skip_tests.update({'basics/async_%s.py' % t for t in 'def await await2 for for2 with with2'.split()}) # require yield + skip_tests.update({'basics/async_%s.py' % t for t in 'def await await2 for for2 with with2 coroutine'.split()}) # require yield skip_tests.update({'basics/%s.py' % t for t in 'try_reraise try_reraise2'.split()}) # require raise_varargs skip_tests.update({'basics/%s.py' % t for t in 'with_break with_continue with_return'.split()}) # require complete with support skip_tests.add('basics/array_construct2.py') # requires generators From 652767fb1c9c489f2a2b2fb1f4971c09c6da66bc Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Tue, 21 Jul 2020 18:43:48 -0700 Subject: [PATCH 0373/1293] translations --- locale/circuitpython.pot | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 71c360889e..c7ff3def50 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-21 18:43-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -234,6 +234,10 @@ msgstr "" msgid "'continue' outside loop" msgstr "" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "" From e9b4e0bd35b6c3024a662580e547df62ab95acd1 Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Tue, 21 Jul 2020 22:34:34 -0700 Subject: [PATCH 0374/1293] remove new char*s because m0 is way oversubscribed --- py/objgenerator.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/py/objgenerator.c b/py/objgenerator.c index 57d20e3db8..df421b60c8 100644 --- a/py/objgenerator.c +++ b/py/objgenerator.c @@ -95,11 +95,13 @@ mp_obj_t mp_obj_new_gen_wrap(mp_obj_t fun, bool is_coroutine) { STATIC void gen_instance_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { (void)kind; mp_obj_gen_instance_t *self = MP_OBJ_TO_PTR(self_in); +#if MICROPY_PY_ASYNC_AWAIT if (self->coroutine_generator) { mp_printf(print, "", mp_obj_fun_get_name(MP_OBJ_FROM_PTR(self->code_state.fun_bc)), self); - } else { - mp_printf(print, "", mp_obj_fun_get_name(MP_OBJ_FROM_PTR(self->code_state.fun_bc)), self); + return; } +#endif + mp_printf(print, "", mp_obj_fun_get_name(MP_OBJ_FROM_PTR(self->code_state.fun_bc)), self); } mp_vm_return_kind_t mp_obj_gen_resume(mp_obj_t self_in, mp_obj_t send_value, mp_obj_t throw_value, mp_obj_t *ret_val) { @@ -202,10 +204,13 @@ STATIC mp_obj_t gen_resume_and_raise(mp_obj_t self_in, mp_obj_t send_value, mp_o } STATIC mp_obj_t gen_instance_iternext(mp_obj_t self_in) { +#if MICROPY_PY_ASYNC_AWAIT + // This translate is literally too much for m0 boards mp_obj_gen_instance_t *self = MP_OBJ_TO_PTR(self_in); if (self->coroutine_generator) { mp_raise_TypeError(translate("'coroutine' object is not an iterator")); } +#endif return gen_resume_and_raise(self_in, mp_const_none, MP_OBJ_NULL); } From 54a342a7f5b74f32c7a53ea483d9046e688b9830 Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Fri, 24 Jul 2020 03:22:41 +0900 Subject: [PATCH 0375/1293] Add and correct some type hints --- .github/workflows/build.yml | 2 +- ports/atmel-samd/bindings/samd/Clock.c | 3 +- shared-bindings/_bleio/Adapter.c | 8 +- shared-bindings/_bleio/Address.c | 2 +- shared-bindings/_bleio/Characteristic.c | 2 +- shared-bindings/_bleio/Connection.c | 8 +- shared-bindings/_bleio/UUID.c | 2 +- shared-bindings/_pew/PewPew.c | 27 +++++- shared-bindings/_pixelbuf/PixelBuf.c | 14 ++- shared-bindings/_pixelbuf/__init__.c | 4 +- shared-bindings/_stage/__init__.c | 2 +- shared-bindings/aesio/aes.c | 7 +- shared-bindings/audiomixer/Mixer.c | 2 +- shared-bindings/busio/I2C.c | 85 +++++++++---------- shared-bindings/countio/Counter.c | 8 +- shared-bindings/digitalio/DigitalInOut.c | 14 +-- shared-bindings/displayio/Display.c | 4 +- shared-bindings/displayio/EPaperDisplay.c | 2 +- shared-bindings/displayio/Group.c | 3 +- shared-bindings/displayio/OnDiskBitmap.c | 2 +- shared-bindings/displayio/Palette.c | 21 ++--- shared-bindings/displayio/TileGrid.c | 2 +- .../framebufferio/FramebufferDisplay.c | 2 +- shared-bindings/gamepad/GamePad.c | 13 ++- shared-bindings/gamepadshift/GamePadShift.c | 2 +- shared-bindings/gnss/GNSS.c | 2 +- shared-bindings/gnss/PositionFix.c | 12 +-- shared-bindings/gnss/SatelliteSystem.c | 30 +++---- shared-bindings/math/__init__.c | 6 +- .../memorymonitor/AllocationAlarm.c | 6 +- .../memorymonitor/AllocationSize.c | 10 +-- shared-bindings/memorymonitor/__init__.c | 7 +- shared-bindings/microcontroller/__init__.c | 2 +- shared-bindings/multiterminal/__init__.c | 4 +- shared-bindings/neopixel_write/__init__.c | 8 +- shared-bindings/nvm/ByteArray.c | 15 +++- shared-bindings/os/__init__.c | 24 +++--- shared-bindings/pulseio/PulseOut.c | 2 +- shared-bindings/random/__init__.c | 5 +- shared-bindings/rgbmatrix/RGBMatrix.c | 2 +- shared-bindings/sdcardio/SDCard.c | 10 +-- shared-bindings/sdioio/SDCard.c | 12 +-- shared-bindings/socket/__init__.c | 2 +- shared-bindings/storage/__init__.c | 32 +++---- shared-bindings/struct/__init__.c | 8 +- shared-bindings/uheap/__init__.c | 2 +- shared-bindings/usb_hid/__init__.c | 2 +- shared-bindings/vectorio/Polygon.c | 6 +- shared-bindings/vectorio/VectorShape.c | 2 +- shared-bindings/watchdog/WatchDogMode.c | 8 +- shared-bindings/watchdog/WatchDogTimer.c | 6 +- tools/extract_pyi.py | 30 ++++--- 52 files changed, 266 insertions(+), 230 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d809ba8cb6..480d7da289 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: run: | sudo apt-get install -y eatmydata sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 - pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort + pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black - name: Versions run: | gcc --version diff --git a/ports/atmel-samd/bindings/samd/Clock.c b/ports/atmel-samd/bindings/samd/Clock.c index e1022c52f7..e8a468d77f 100644 --- a/ports/atmel-samd/bindings/samd/Clock.c +++ b/ports/atmel-samd/bindings/samd/Clock.c @@ -30,7 +30,6 @@ #include "py/objproperty.h" #include "py/runtime.h" -//| import typing //| class Clock: //| """Identifies a clock on the microcontroller. //| @@ -62,7 +61,7 @@ const mp_obj_property_t samd_clock_enabled_obj = { }, }; -//| parent: typing.Union(Clock | None) = ... +//| parent: Union[Clock, None] = ... //| """Clock parent. (read-only)""" //| STATIC mp_obj_t samd_clock_get_parent(mp_obj_t self_in) { diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 75212fa91f..9177a9a69d 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -135,7 +135,7 @@ const mp_obj_property_t bleio_adapter_name_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| def start_advertising(self, data: buf, *, scan_response: buf = None, connectable: bool = True, anonymous: bool = False, timeout: int = 0, interval: float = 0.1) -> None: +//| def start_advertising(self, data: ReadableBuffer, *, scan_response: Optional[ReadableBuffer] = None, connectable: bool = True, anonymous: bool = False, timeout: int = 0, interval: float = 0.1) -> None: //| """Starts advertising until `stop_advertising` is called or if connectable, another device //| connects to us. //| @@ -215,7 +215,7 @@ STATIC mp_obj_t bleio_adapter_stop_advertising(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_stop_advertising_obj, bleio_adapter_stop_advertising); -//| def start_scan(self, prefixes: sequence = b"", *, buffer_size: int = 512, extended: bool = False, timeout: float = None, interval: float = 0.1, window: float = 0.1, minimum_rssi: int = -80, active: bool = True) -> iterable: +//| def start_scan(self, prefixes: ReadableBuffer = b"", *, buffer_size: int = 512, extended: bool = False, timeout: float = None, interval: float = 0.1, window: float = 0.1, minimum_rssi: int = -80, active: bool = True) -> Iterable[ScanEntry]: //| """Starts a BLE scan and returns an iterator of results. Advertisements and scan responses are //| filtered and returned separately. //| @@ -350,11 +350,11 @@ const mp_obj_property_t bleio_adapter_connections_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| def connect(self, address: Address, *, timeout: float/int) -> Connection: +//| def connect(self, address: Address, *, timeout: float) -> Connection: //| """Attempts a connection to the device with the given address. //| //| :param Address address: The address of the peripheral to connect to -//| :param float/int timeout: Try to connect for timeout seconds.""" +//| :param float timeout: Try to connect for timeout seconds.""" //| ... //| STATIC mp_obj_t bleio_adapter_connect(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c index 2481a9199c..290b0fd09a 100644 --- a/shared-bindings/_bleio/Address.c +++ b/shared-bindings/_bleio/Address.c @@ -128,7 +128,7 @@ const mp_obj_property_t bleio_address_type_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def __eq__(self, other: Any) -> bool: +//| def __eq__(self, other: Address) -> bool: //| """Two Address objects are equal if their addresses and address types are equal.""" //| ... //| diff --git a/shared-bindings/_bleio/Characteristic.c b/shared-bindings/_bleio/Characteristic.c index 593d8edcb4..2cdedaf99c 100644 --- a/shared-bindings/_bleio/Characteristic.c +++ b/shared-bindings/_bleio/Characteristic.c @@ -45,7 +45,7 @@ //| ... //| -//| def add_to_service(self, service: Service, uuid: UUID, *, properties: int = 0, read_perm: int = Attribute.OPEN, write_perm: int = Attribute.OPEN, max_length: int = 20, fixed_length: bool = False, initial_value: buf = None) -> Characteristic: +//| def add_to_service(self, service: Service, uuid: UUID, *, properties: int = 0, read_perm: int = Attribute.OPEN, write_perm: int = Attribute.OPEN, max_length: int = 20, fixed_length: bool = False, initial_value: Optional[ReadableBuffer] = None) -> Characteristic: //| """Create a new Characteristic object, and add it to this Service. //| //| :param Service service: The service that will provide this characteristic diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index 5dfbc5a36c..f610d65079 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -71,11 +71,11 @@ void bleio_connection_ensure_connected(bleio_connection_obj_t *self) { //| def __init__(self) -> None: //| """Connections cannot be made directly. Instead, to initiate a connection use `Adapter.connect`. //| Connections may also be made when another device initiates a connection. To use a Connection -//| created by a peer, read the `Adapter.connections` property. +//| created by a peer, read the `Adapter.connections` property.""" //| ... //| -//| def disconnect(self) -> Any: -//| ""Disconnects from the remote peripheral. Does nothing if already disconnected.""" +//| def disconnect(self) -> None: +//| """Disconnects from the remote peripheral. Does nothing if already disconnected.""" //| ... //| STATIC mp_obj_t bleio_connection_disconnect(mp_obj_t self_in) { @@ -109,7 +109,7 @@ STATIC mp_obj_t bleio_connection_pair(mp_uint_t n_args, const mp_obj_t *pos_args } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_connection_pair_obj, 1, bleio_connection_pair); -//| def discover_remote_services(self, service_uuids_whitelist: iterable = None) -> Service: +//| def discover_remote_services(self, service_uuids_whitelist: Iterable[UUID] = None) -> Tuple[Service, ...]: //| """Do BLE discovery for all services or for the given service UUIDS, //| to find their handles and characteristics, and return the discovered services. //| `Connection.connected` must be True. diff --git a/shared-bindings/_bleio/UUID.c b/shared-bindings/_bleio/UUID.c index c6706e46a7..fa1e298a9a 100644 --- a/shared-bindings/_bleio/UUID.c +++ b/shared-bindings/_bleio/UUID.c @@ -248,7 +248,7 @@ STATIC mp_obj_t bleio_uuid_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -//| def __eq__(self, other: Any) -> bool: +//| def __eq__(self, other: UUID) -> bool: //| """Two UUID objects are equal if their values match and they are both 128-bit or both 16-bit.""" //| ... //| diff --git a/shared-bindings/_pew/PewPew.c b/shared-bindings/_pew/PewPew.c index 32a956c93c..0563181d9f 100644 --- a/shared-bindings/_pew/PewPew.c +++ b/shared-bindings/_pew/PewPew.c @@ -45,8 +45,31 @@ //| used internally by it. All user-visible interactions are done through //| that library.""" //| - -//| def __init__(self, buffer: ReadableBuffer, rows: List[DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut], cols: List[DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut], buttons: DigitalInOut) -> None: +//| def __init__( +//| self, +//| buffer: ReadableBuffer, +//| rows: List[ +//| digitalio.DigitalInOut, +//| digitalio.DigitalInOut, +//| digitalio.DigitalInOut, +//| digitalio.DigitalInOut, +//| digitalio.DigitalInOut, +//| digitalio.DigitalInOut, +//| digitalio.DigitalInOut, +//| digitalio.DigitalInOut, +//| ], +//| cols: List[ +//| digitalio.DigitalInOut, +//| digitalio.DigitalInOut, +//| digitalio.DigitalInOut, +//| digitalio.DigitalInOut, +//| digitalio.DigitalInOut, +//| digitalio.DigitalInOut, +//| digitalio.DigitalInOut, +//| digitalio.DigitalInOut, +//| ], +//| buttons: digitalio.DigitalInOut, +//| ) -> None: //| """Initializes matrix scanning routines. //| //| The ``buffer`` is a 64 byte long ``bytearray`` that stores what should diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 951395acba..598c68d1de 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -221,7 +221,7 @@ const mp_obj_property_t pixelbuf_pixelbuf_auto_write_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| byteorder: string = ... +//| byteorder: str = ... //| """byteorder string for the buffer (read-only)""" //| STATIC mp_obj_t pixelbuf_pixelbuf_obj_get_byteorder(mp_obj_t self_in) { @@ -257,7 +257,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(color: Union[int, Tuple[int, int, int]]) -> None: +//| def fill(self, color: Union[int, Tuple[int, int, int]]) -> None: //| """Fills the given pixelbuf with the given color.""" //| ... //| @@ -269,13 +269,19 @@ 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); -//| def __getitem__(self, index: int) -> Tuple[int, int, int, Union[int, float]]: +//| @overload +//| def __getitem__(self, index: slice) -> Tuple[Tuple, ...]: ... +//| def __getitem__(self, index: int) -> Tuple: //| """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.""" //| ... //| -//| def __setitem__(self, index: int, value: Union[int, Tuple[int, int, int, Union[int, float]]]) -> PixelBuf: +//| @overload +//| def __setitem__(self, index: slice, value: Tuple[Union[int, Tuple, List], ...]) -> None: ... +//| @overload +//| def __setitem__(self, index: slice, value: List[Union[int, Tuple, List]]) -> None: ... +//| def __setitem__(self, index: int, value: Union[int, Tuple, List]) -> 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/_pixelbuf/__init__.c b/shared-bindings/_pixelbuf/__init__.c index 6038fdfdcc..c714cade41 100644 --- a/shared-bindings/_pixelbuf/__init__.c +++ b/shared-bindings/_pixelbuf/__init__.c @@ -41,12 +41,12 @@ //| Byteorders are configured with strings, such as "RGB" or "RGBD".""" // TODO: Pull in docs from pypixelbuf. -//| def colorwheel(n: int) -> int: +//| def colorwheel(n: float) -> int: //| """C implementation of the common wheel() function found in many examples. //| Returns the colorwheel RGB value as an integer value for n (usable in :py:class:`PixelBuf`, neopixel, and dotstar).""" //| ... //| -//| def wheel(n: Any) -> Any: +//| def wheel(n: float) -> int: //| """Use of wheel() is deprecated. Please use colorwheel().""" //| diff --git a/shared-bindings/_stage/__init__.c b/shared-bindings/_stage/__init__.c index 6a56381856..6af0e6dbf2 100644 --- a/shared-bindings/_stage/__init__.c +++ b/shared-bindings/_stage/__init__.c @@ -39,7 +39,7 @@ //| The `_stage` module contains native code to speed-up the ```stage`` Library //| `_.""" //| -//| def render(x0: int, y0: int, x1: int, y1: int, layers: list, buffer: bytearray, display: displayio.Display, scale: int, background: int) -> Any: +//| def render(x0: int, y0: int, x1: int, y1: int, layers: list, buffer: bytearray, display: displayio.Display, scale: int, background: int) -> None: //| """Render and send to the display a fragment of the screen. //| //| :param int x0: Left edge of the fragment. diff --git a/shared-bindings/aesio/aes.c b/shared-bindings/aesio/aes.c index e580be38be..9881bd0edc 100644 --- a/shared-bindings/aesio/aes.c +++ b/shared-bindings/aesio/aes.c @@ -12,7 +12,7 @@ //| class AES: //| """Encrypt and decrypt AES streams""" //| -//| def __init__(self, key: Optional[ReadableBuffer], mode: int=0, iv: ReadableBuffer=None, segment_size: int=8) -> None: +//| def __init__(self, key: Optional[ReadableBuffer], mode: int = 0, iv: ReadableBuffer = None, segment_size: int = 8) -> None: //| """Create a new AES state with the given key. //| //| :param bytearray key: A 16-, 24-, or 32-byte key @@ -152,7 +152,7 @@ STATIC void validate_length(aesio_aes_obj_t *self, size_t src_length, } } -//| def encrypt_into(src: ReadableBuffer, dest: WriteableBuffer) -> None: +//| def encrypt_into(self, src: ReadableBuffer, dest: WriteableBuffer) -> None: //| """Encrypt the buffer from ``src`` into ``dest``. //| //| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the @@ -183,8 +183,7 @@ STATIC mp_obj_t aesio_aes_encrypt_into(mp_obj_t aesio_obj, mp_obj_t src, STATIC MP_DEFINE_CONST_FUN_OBJ_3(aesio_aes_encrypt_into_obj, aesio_aes_encrypt_into); -//| def decrypt_into(src: ReadableBuffer, dest: WriteableBuffer) -> None: -//| +//| def decrypt_into(self, src: ReadableBuffer, dest: WriteableBuffer) -> None: //| """Decrypt the buffer from ``src`` into ``dest``. //| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the //| buffers must be a multiple of 16 bytes, and must be equal length. For diff --git a/shared-bindings/audiomixer/Mixer.c b/shared-bindings/audiomixer/Mixer.c index 0d7712b036..0356edde4d 100644 --- a/shared-bindings/audiomixer/Mixer.c +++ b/shared-bindings/audiomixer/Mixer.c @@ -211,7 +211,7 @@ const mp_obj_property_t audiomixer_mixer_voice_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def play(self, sample: Union[audiomixer.WaveFile, audiocore.RawSample, audiomixer.Mixer], *, voice: int = 0, loop: bool = False) -> None: +//| def play(self, sample: Union[audiocore.WaveFile, audiocore.RawSample, Mixer], *, voice: int = 0, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 2b965fbe98..8a0414b5a0 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -126,13 +126,12 @@ static void check_lock(busio_i2c_obj_t *self) { } //| def scan(self) -> list: +//| """Scan all I2C addresses between 0x08 and 0x77 inclusive and return a +//| list of those that respond. //| -//| """Scan all I2C addresses between 0x08 and 0x77 inclusive and return a -//| list of those that respond. -//| -//| :return: List of device ids on the I2C bus -//| :rtype: list""" -//| ... +//| :return: List of device ids on the I2C bus +//| :rtype: list""" +//| ... //| STATIC mp_obj_t busio_i2c_scan(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -177,19 +176,19 @@ STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock); //| def readfrom_into(self, address: int, buffer: WriteableBuffer, *, start: int = 0, end: int = None) -> None: -//| """Read into ``buffer`` from the device selected by ``address``. -//| The number of bytes read will be the length of ``buffer``. -//| At least one byte must be read. +//| """Read into ``buffer`` from the device selected by ``address``. +//| The number of bytes read will be the length of ``buffer``. +//| At least one byte must be read. //| -//| If ``start`` or ``end`` is provided, then the buffer will be sliced -//| as if ``buffer[start:end]``. This will not cause an allocation like -//| ``buf[start:end]`` will so it saves memory. +//| If ``start`` or ``end`` is provided, then the buffer will be sliced +//| as if ``buffer[start:end]``. This will not cause an allocation like +//| ``buf[start:end]`` will so it saves memory. //| -//| :param int address: 7-bit device address -//| :param bytearray buffer: buffer to write into -//| :param int start: Index to start writing at -//| :param int end: Index to write up to but not include. Defaults to ``len(buffer)``""" -//| ... +//| :param int address: 7-bit device address +//| :param bytearray buffer: buffer to write into +//| :param int start: Index to start writing at +//| :param int end: Index to write up to but not include. Defaults to ``len(buffer)``""" +//| ... //| // Shared arg parsing for readfrom_into and writeto_then_readfrom. STATIC void readfrom(busio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, int32_t start, mp_int_t end) { @@ -229,21 +228,21 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args, MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_into); //| def writeto(self, address: int, buffer: ReadableBuffer, *, start: int = 0, end: int = None, stop: bool = True) -> None: -//| """Write the bytes from ``buffer`` to the device selected by ``address`` and -//| then transmit a stop bit. +//| """Write the bytes from ``buffer`` to the device selected by ``address`` and +//| then transmit a stop bit. //| -//| If ``start`` or ``end`` is provided, then the buffer will be sliced -//| as if ``buffer[start:end]``. This will not cause an allocation like -//| ``buffer[start:end]`` will so it saves memory. +//| If ``start`` or ``end`` is provided, then the buffer will be sliced +//| as if ``buffer[start:end]``. This will not cause an allocation like +//| ``buffer[start:end]`` will so it saves memory. //| -//| Writing a buffer or slice of length zero is permitted, as it can be used -//| to poll for the existence of a device. +//| riting a buffer or slice of length zero is permitted, as it can be used +//| to poll for the existence of a device. //| -//| :param int address: 7-bit device address -//| :param bytearray buffer: buffer containing the bytes to write -//| :param int start: Index to start writing from -//| :param int end: Index to read up to but not include. Defaults to ``len(buffer)``""" -//| ... +//| :param int address: 7-bit device address +//| :param bytearray buffer: buffer containing the bytes to write +//| :param int start: Index to start writing from +//| :param int end: Index to read up to but not include. Defaults to ``len(buffer)``""" +//| ... //| // Shared arg parsing for writeto and writeto_then_readfrom. STATIC void writeto(busio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, int32_t start, mp_int_t end, bool stop) { @@ -283,22 +282,22 @@ STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_ma STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto); //| def writeto_then_readfrom(self, address: int, out_buffer: ReadableBuffer, in_buffer: WriteableBuffer, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: -//| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop -//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and -//| ``in_buffer`` can be the same buffer because they are used sequentially. +//| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop +//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and +//| ``in_buffer`` can be the same buffer because they are used sequentially. //| -//| If ``start`` or ``end`` is provided, then the corresponding buffer will be sliced -//| as if ``buffer[start:end]``. This will not cause an allocation like ``buf[start:end]`` -//| will so it saves memory. +//| f ``start`` or ``end`` is provided, then the corresponding buffer will be sliced +//| as if ``buffer[start:end]``. This will not cause an allocation like ``buf[start:end]`` +//| will so it saves memory. //| -//| :param int address: 7-bit device address -//| :param bytearray out_buffer: buffer containing the bytes to write -//| :param bytearray in_buffer: buffer to write into -//| :param int out_start: Index to start writing from -//| :param int out_end: Index to read up to but not include. Defaults to ``len(buffer)`` -//| :param int in_start: Index to start writing at -//| :param int in_end: Index to write up to but not include. Defaults to ``len(buffer)``""" -//| ... +//| :param int address: 7-bit device address +//| :param bytearray out_buffer: buffer containing the bytes to write +//| :param bytearray in_buffer: buffer to write into +//| :param int out_start: Index to start writing from +//| :param int out_end: Index to read up to but not include. Defaults to ``len(buffer)`` +//| :param int in_start: Index to start writing at +//| :param int in_end: Index to write up to but not include. Defaults to ``len(buffer)``""" +//| ... //| STATIC mp_obj_t busio_i2c_writeto_then_readfrom(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_address, ARG_out_buffer, ARG_in_buffer, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end }; diff --git a/shared-bindings/countio/Counter.c b/shared-bindings/countio/Counter.c index e40ec3b64f..616307a4bc 100644 --- a/shared-bindings/countio/Counter.c +++ b/shared-bindings/countio/Counter.c @@ -53,7 +53,7 @@ STATIC mp_obj_t countio_counter_make_new(const mp_obj_type_t *type, size_t n_arg return MP_OBJ_FROM_PTR(self); } -//| def deinit(self): +//| def deinit(self) -> None: //| """Deinitializes the Counter and releases any hardware resources for reuse.""" //| STATIC mp_obj_t countio_counter_deinit(mp_obj_t self_in) { @@ -69,12 +69,12 @@ STATIC void check_for_deinit(countio_counter_obj_t *self) { } } -//| def __enter__(self): +//| def __enter__(self) -> Counter: //| """No-op used by Context Managers.""" //| // Provided by context manager helper. -//| def __exit__(self): +//| def __exit__(self) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| @@ -113,7 +113,7 @@ const mp_obj_property_t countio_counter_count_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def reset(self): +//| def reset(self) -> None: //| """Resets the count back to 0.""" //| STATIC mp_obj_t countio_counter_reset(mp_obj_t self_in){ diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index 603f008e3c..e37f57220c 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -107,13 +107,13 @@ STATIC void check_for_deinit(digitalio_digitalinout_obj_t *self) { } //| def switch_to_output(self, value: bool = False, drive_mode: digitalio.DriveMode = digitalio.DriveMode.PUSH_PULL) -> None: -//| """Set the drive mode and value and then switch to writing out digital -//| values. +//| """Set the drive mode and value and then switch to writing out digital +//| values. //| -//| :param bool value: default value to set upon switching -//| :param ~digitalio.DriveMode drive_mode: drive mode for the output -//| """ -//| ... +//| :param bool value: default value to set upon switching +//| :param ~digitalio.DriveMode drive_mode: drive mode for the output +//| """ +//| ... //| STATIC mp_obj_t digitalio_digitalinout_switch_to_output(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_value, ARG_drive_mode }; @@ -228,7 +228,7 @@ const mp_obj_property_t digitalio_digitalio_direction_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| value: Bool = ... +//| value: bool = ... //| """The digital logic level of the pin.""" //| STATIC mp_obj_t digitalio_digitalinout_obj_get_value(mp_obj_t self_in) { diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 4534babca6..2d2b92325c 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -49,7 +49,7 @@ //| Most people should not use this class directly. Use a specific display driver instead that will //| contain the initialization sequence at minimum.""" //| -//| def __init__(self, display_bus: displayio, init_sequence: buffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: Optional[microcontroller.Pin] = None, brightness_command: int = None, brightness: bool = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60) -> None: +//| def __init__(self, display_bus: Union[FourWire, ParallelBus], init_sequence: ReadableBuffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: Optional[microcontroller.Pin] = None, brightness_command: int = None, brightness: bool = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60) -> None: //| r"""Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). //| //| The ``init_sequence`` is bitpacked to minimize the ram impact. Every command begins with a @@ -341,7 +341,6 @@ const mp_obj_property_t displayio_display_auto_brightness_obj = { //| width: int = ... //| Gets the width of the board //| -//| STATIC mp_obj_t displayio_display_obj_get_width(mp_obj_t self_in) { displayio_display_obj_t *self = native_display(self_in); return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_display_get_width(self)); @@ -358,7 +357,6 @@ const mp_obj_property_t displayio_display_width_obj = { //| height: int = ... //| """Gets the height of the board""" //| -//| STATIC mp_obj_t displayio_display_obj_get_height(mp_obj_t self_in) { displayio_display_obj_t *self = native_display(self_in); return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_display_get_height(self)); diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index 21eaf14daa..9bfc6b05d2 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -49,7 +49,7 @@ //| Most people should not use this class directly. Use a specific display driver instead that will //| contain the startup and shutdown sequences at minimum.""" //| -//| def __init__(self, display_bus: displayio, start_sequence: buffer, stop_sequence: buffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: Optional[int] = None, set_row_window_command: Optional[int] = None, single_byte_bounds: bool = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: Optional[int] = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: Optional[microcontroller.Pin] = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False) -> None: +//| def __init__(self, display_bus: displayio, start_sequence: ReadableBuffer, stop_sequence: ReadableBuffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: Optional[int] = None, set_row_window_command: Optional[int] = None, single_byte_bounds: bool = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: Optional[int] = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: Optional[microcontroller.Pin] = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False) -> None: //| """Create a EPaperDisplay object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). //| //| The ``start_sequence`` and ``stop_sequence`` are bitpacked to minimize the ram impact. Every diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index 1176db5634..31affc6b6a 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -264,7 +264,8 @@ STATIC mp_obj_t displayio_group_obj_remove(mp_obj_t self_in, mp_obj_t layer) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_remove_obj, displayio_group_obj_remove); -//| def __bool__(self) -> bool: ... +//| def __bool__(self) -> bool: +//| ... //| //| def __len__(self) -> int: //| """Returns the number of layers in a Group""" diff --git a/shared-bindings/displayio/OnDiskBitmap.c b/shared-bindings/displayio/OnDiskBitmap.c index 7e94a0401a..8a4cb8e743 100644 --- a/shared-bindings/displayio/OnDiskBitmap.c +++ b/shared-bindings/displayio/OnDiskBitmap.c @@ -69,7 +69,7 @@ //| while True: //| pass""" //| -//| def __init__(self, file: file) -> None: +//| def __init__(self, file: typing.BinaryIO) -> None: //| """Create an OnDiskBitmap object with the given file. //| //| :param file file: The open bitmap file""" diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c index 5418133e1e..c868aea9cf 100644 --- a/shared-bindings/displayio/Palette.c +++ b/shared-bindings/displayio/Palette.c @@ -36,12 +36,6 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" - - - - - - //| class Palette: //| """Map a pixel palette_index to a full color. Colors are transformed to the display's format internally to //| save memory.""" @@ -70,7 +64,8 @@ STATIC mp_obj_t displayio_palette_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(self); } -//| def __bool__(self) -> bool: ... +//| def __bool__(self) -> bool: +//| ... //| //| def __len__(self) -> int: //| """Returns the number of colors in a Palette""" @@ -86,7 +81,11 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -//| def __setitem__(self, index: int, value: Union[int, ReadableBuffer]) -> Optional[int]: +//| def __getitem__(self, index: int) -> Optional[int]: +//| r"""Return the pixel color at the given index as an integer.""" +//| ... +//| +//| def __setitem__(self, index: int, value: Union[int, ReadableBuffer, Tuple[int, int, int]]) -> None: //| r"""Sets the pixel color at the given index. The index should be an integer in the range 0 to color_count-1. //| //| The value argument represents a color, and can be from 0x000000 to 0xFFFFFF (to represent an RGB value). @@ -149,7 +148,8 @@ STATIC mp_obj_t palette_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t val return mp_const_none; } -//| def make_transparent(self, palette_index: int) -> None: ... +//| def make_transparent(self, palette_index: int) -> None: +//| ... //| STATIC mp_obj_t displayio_palette_obj_make_transparent(mp_obj_t self_in, mp_obj_t palette_index_obj) { displayio_palette_t *self = MP_OBJ_TO_PTR(self_in); @@ -163,7 +163,8 @@ STATIC mp_obj_t displayio_palette_obj_make_transparent(mp_obj_t self_in, mp_obj_ } MP_DEFINE_CONST_FUN_OBJ_2(displayio_palette_make_transparent_obj, displayio_palette_obj_make_transparent); -//| def make_opaque(self, palette_index: int) -> None: ... +//| def make_opaque(self, palette_index: int) -> None: +//| ... //| STATIC mp_obj_t displayio_palette_obj_make_opaque(mp_obj_t self_in, mp_obj_t palette_index_obj) { displayio_palette_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c index c17d984db0..e03a46dbaf 100644 --- a/shared-bindings/displayio/TileGrid.c +++ b/shared-bindings/displayio/TileGrid.c @@ -48,7 +48,7 @@ //| //| A single tile grid is also known as a Sprite.""" //| -//| def __init__(self, bitmap: displayio.Bitmap, *, pixel_shader: displayio.Palette, width: int = 1, height: int = 1, tile_width: int = None, tile_height: int = None, default_tile: int = 0, x: int = 0, y: int = 0) -> None: +//| def __init__(self, bitmap: Bitmap, *, pixel_shader: Palette, width: int = 1, height: int = 1, tile_width: int = None, tile_height: int = None, default_tile: int = 0, x: int = 0, y: int = 0) -> None: //| """Create a TileGrid object. The bitmap is source for 2d pixels. The pixel_shader is used to //| convert the value and its location to a display native pixel color. This may be a simple color //| palette lookup, a gradient, a pattern or a color transformer. diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index d687e3e95b..8c19603422 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -94,7 +94,7 @@ static framebufferio_framebufferdisplay_obj_t* native_display(mp_obj_t display_o return MP_OBJ_TO_PTR(native_display); } -//| def show(self, group: Group) -> None: +//| def show(self, group: displayio.Group) -> None: //| """Switches to displaying the given group of layers. When group is None, the default //| CircuitPython terminal will be shown. //| diff --git a/shared-bindings/gamepad/GamePad.c b/shared-bindings/gamepad/GamePad.c index f03a6cd33e..dca1eb1e89 100644 --- a/shared-bindings/gamepad/GamePad.c +++ b/shared-bindings/gamepad/GamePad.c @@ -69,8 +69,17 @@ //| buttons = pad.get_pressed() //| time.sleep(0.1)""" //| - -//| def __init__(self, b1: DigitalInOut, b2: DigitalInOut, b3: DigitalInOut, b4: DigitalInOut, b5: DigitalInOut, b6: DigitalInOut, b7: DigitalInOut, b8: DigitalInOut) -> None: +//| def __init__( +//| self, +//| b1: digitalio.DigitalInOut, +//| b2: digitalio.DigitalInOut, +//| b3: digitalio.DigitalInOut, +//| b4: digitalio.DigitalInOut, +//| b5: digitalio.DigitalInOut, +//| b6: digitalio.DigitalInOut, +//| b7: digitalio.DigitalInOut, +//| b8: digitalio.DigitalInOut, +//| ) -> None: //| """Initializes button scanning routines. //| //| The ``b1``-``b8`` parameters are ``DigitalInOut`` objects, which diff --git a/shared-bindings/gamepadshift/GamePadShift.c b/shared-bindings/gamepadshift/GamePadShift.c index e05a95865c..f6488bbd75 100644 --- a/shared-bindings/gamepadshift/GamePadShift.c +++ b/shared-bindings/gamepadshift/GamePadShift.c @@ -36,7 +36,7 @@ //| class GamePadShift: //| """Scan buttons for presses through a shift register""" //| -//| def __init__(self, clock: DigitalInOut, data: DigitalInOut, latch: DigitalInOut) -> None: +//| def __init__(self, clock: digitalio.DigitalInOut, data: digitalio.DigitalInOut, latch: digitalio.DigitalInOut) -> None: //| """Initializes button scanning routines. //| //| The ``clock``, ``data`` and ``latch`` parameters are ``DigitalInOut`` diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c index f87a943b03..72aa71b8d3 100644 --- a/shared-bindings/gnss/GNSS.c +++ b/shared-bindings/gnss/GNSS.c @@ -168,7 +168,7 @@ const mp_obj_property_t gnss_timestamp_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| fix: gnss.PositionFix = ... +//| fix: PositionFix = ... //| """Fix mode.""" //| STATIC mp_obj_t gnss_obj_get_fix(mp_obj_t self_in) { diff --git a/shared-bindings/gnss/PositionFix.c b/shared-bindings/gnss/PositionFix.c index 867911f019..7a69dfece8 100644 --- a/shared-bindings/gnss/PositionFix.c +++ b/shared-bindings/gnss/PositionFix.c @@ -11,19 +11,13 @@ //| """Enum-like class to define the position fix mode.""" //| //| INVALID: PositionFix = ... -//| """No measurement. -//| -//| :type PositionFix:""" +//| """No measurement.""" //| //| FIX_2D: PositionFix = ... -//| """2D fix. -//| -//| :type PositionFix:""" +//| """2D fix.""" //| //| FIX_3D: PositionFix = ... -//| """3D fix. -//| -//| :type gnss.PositionFix:""" +//| """3D fix.""" //| const mp_obj_type_t gnss_positionfix_type; diff --git a/shared-bindings/gnss/SatelliteSystem.c b/shared-bindings/gnss/SatelliteSystem.c index 951c5a0e89..7d66727b8d 100644 --- a/shared-bindings/gnss/SatelliteSystem.c +++ b/shared-bindings/gnss/SatelliteSystem.c @@ -10,30 +10,20 @@ //| def __init__(self) -> None: //| """Enum-like class to define the satellite system type.""" //| -//| GPS: SatelliteSystem = ... -//| """Global Positioning System. +//| GPS: SatelliteSystem +//| """Global Positioning System.""" //| -//| :type gnss.SatelliteSystem:""" +//| GLONASS: SatelliteSystem +//| """GLObal NAvigation Satellite System.""" //| -//| GLONASS: SatelliteSystem = ... -//| """GLObal NAvigation Satellite System. +//| SBAS: SatelliteSystem +//| """Satellite Based Augmentation System.""" //| -//| :type gnss.SatelliteSystem:""" +//| QZSS_L1CA: SatelliteSystem +//| """Quasi-Zenith Satellite System L1C/A.""" //| -//| SBAS: SatelliteSystem = ... -//| """Satellite Based Augmentation System. -//| -//| :type gnss.SatelliteSystem:""" -//| -//| QZSS_L1CA: SatelliteSystem = ... -//| """Quasi-Zenith Satellite System L1C/A. -//| -//| :type gnss.SatelliteSystem:""" -//| -//| QZSS_L1S: SatelliteSystem = ... -//| """Quasi-Zenith Satellite System L1S. -//| -//| :type gnss.SatelliteSystem:""" +//| QZSS_L1S: SatelliteSystem +//| """Quasi-Zenith Satellite System L1S.""" //| const mp_obj_type_t gnss_satellitesystem_type; diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c index 968da0d613..3883c03c11 100644 --- a/shared-bindings/math/__init__.c +++ b/shared-bindings/math/__init__.c @@ -79,10 +79,10 @@ STATIC NORETURN void math_error(void) { #define log2(x) (log(x) * 1.442695040888963407354163704) #endif -//| e: float = ... +//| e: float //| """base of the natural logarithm""" //| -//| pi: float = ... +//| pi: float //| """the ratio of a circle's circumference to its diameter""" //| @@ -126,7 +126,7 @@ STATIC NORETURN void math_error(void) { //| """Return the absolute value of ``x``.""" //| ... //| -//| def floor(x: float) -> float: +//| def floor(x: float) -> int: //| """Return an integer, being ``x`` rounded towards negative infinity.""" //| ... //| diff --git a/shared-bindings/memorymonitor/AllocationAlarm.c b/shared-bindings/memorymonitor/AllocationAlarm.c index 36e2cb5b23..7de8c12874 100644 --- a/shared-bindings/memorymonitor/AllocationAlarm.c +++ b/shared-bindings/memorymonitor/AllocationAlarm.c @@ -35,7 +35,7 @@ //| class AllocationAlarm: //| -//| def __init__(self, *, minimum_block_count=1): +//| def __init__(self, *, minimum_block_count: int = 1) -> None: //| """Throw an exception when an allocation of ``minimum_block_count`` or more blocks //| occurs while active. //| @@ -76,7 +76,7 @@ STATIC mp_obj_t memorymonitor_allocationalarm_make_new(const mp_obj_type_t *type return MP_OBJ_FROM_PTR(self); } -//| def ignore(self, count) -> AllocationAlarm: +//| def ignore(self, count: int) -> AllocationAlarm: //| """Sets the number of applicable allocations to ignore before raising the exception. //| Automatically set back to zero at context exit. //| @@ -98,7 +98,7 @@ STATIC mp_obj_t memorymonitor_allocationalarm_obj_ignore(mp_obj_t self_in, mp_ob } MP_DEFINE_CONST_FUN_OBJ_2(memorymonitor_allocationalarm_ignore_obj, memorymonitor_allocationalarm_obj_ignore); -//| def __enter__(self) -> memorymonitor.AllocationAlarm: +//| def __enter__(self) -> AllocationAlarm: //| """Enables the alarm.""" //| ... //| diff --git a/shared-bindings/memorymonitor/AllocationSize.c b/shared-bindings/memorymonitor/AllocationSize.c index 5016744413..a7d14e4f55 100644 --- a/shared-bindings/memorymonitor/AllocationSize.c +++ b/shared-bindings/memorymonitor/AllocationSize.c @@ -35,7 +35,7 @@ //| class AllocationSize: //| -//| def __init__(self): +//| def __init__(self) -> None: //| """Tracks the number of allocations in power of two buckets. //| //| It will have 16 16-bit buckets to track allocation counts. It is total allocations @@ -72,7 +72,7 @@ STATIC mp_obj_t memorymonitor_allocationsize_make_new(const mp_obj_type_t *type, return MP_OBJ_FROM_PTR(self); } -//| def __enter__(self, ) -> Any: +//| def __enter__(self) -> AllocationSize: //| """Clears counts and resumes tracking.""" //| ... //| @@ -83,7 +83,7 @@ STATIC mp_obj_t memorymonitor_allocationsize_obj___enter__(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationsize___enter___obj, memorymonitor_allocationsize_obj___enter__); -//| def __exit__(self, ) -> Any: +//| def __exit__(self) -> None: //| """Automatically pauses allocation tracking when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -112,7 +112,7 @@ const mp_obj_property_t memorymonitor_allocationsize_bytes_per_block_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def __len__(self, ) -> Any: +//| def __len__(self) -> int: //| """Returns the number of allocation buckets. //| //| This allows you to:: @@ -131,7 +131,7 @@ STATIC mp_obj_t memorymonitor_allocationsize_unary_op(mp_unary_op_t op, mp_obj_t } } -//| def __getitem__(self, index: Any) -> Any: +//| def __getitem__(self, index: int) -> Optional[int]: //| """Returns the allocation count for the given bucket. //| //| This allows you to:: diff --git a/shared-bindings/memorymonitor/__init__.c b/shared-bindings/memorymonitor/__init__.c index 98f48f5251..c101ba5e0d 100644 --- a/shared-bindings/memorymonitor/__init__.c +++ b/shared-bindings/memorymonitor/__init__.c @@ -36,10 +36,9 @@ //| """Memory monitoring helpers""" //| -//| class AllocationError: -//| def __init__(self, Exception: Any): -//| """Catchall exception for allocation related errors.""" -//| ... +//| class AllocationError(Exception): +//| """Catchall exception for allocation related errors.""" +//| ... MP_DEFINE_MEMORYMONITOR_EXCEPTION(AllocationError, Exception) NORETURN void mp_raise_memorymonitor_AllocationError(const compressed_string_t* fmt, ...) { diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c index 6d556cdd75..a750823400 100644 --- a/shared-bindings/microcontroller/__init__.c +++ b/shared-bindings/microcontroller/__init__.c @@ -133,7 +133,7 @@ STATIC mp_obj_t mcu_reset(void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(mcu_reset_obj, mcu_reset); -//| nvm: Any = ... +//| nvm: Optional[nvm.ByteArray] = ... //| """Available non-volatile memory. //| This object is the sole instance of `nvm.ByteArray` when available or ``None`` otherwise. //| diff --git a/shared-bindings/multiterminal/__init__.c b/shared-bindings/multiterminal/__init__.c index e4d6768ada..0f493fe2ea 100644 --- a/shared-bindings/multiterminal/__init__.c +++ b/shared-bindings/multiterminal/__init__.c @@ -37,7 +37,7 @@ //| serial connection and the optional secondary connection.""" //| -//| def get_secondary_terminal() -> secondary_terminal: +//| def get_secondary_terminal() -> Optional[typing.BinaryIO]: //| """Returns the current secondary terminal.""" //| ... //| @@ -46,7 +46,7 @@ STATIC mp_obj_t multiterminal_obj_get_secondary_terminal() { } MP_DEFINE_CONST_FUN_OBJ_0(multiterminal_get_secondary_terminal_obj, multiterminal_obj_get_secondary_terminal); -//| def set_secondary_terminal(stream: stream) -> None: +//| def set_secondary_terminal(stream: Optional[typing.BinaryIO]) -> None: //| """Read additional input from the given stream and write out back to it. //| This doesn't replace the core stream (usually UART or native USB) but is //| mixed in instead. diff --git a/shared-bindings/neopixel_write/__init__.c b/shared-bindings/neopixel_write/__init__.c index 5e5bc31eb7..f3f5c20373 100644 --- a/shared-bindings/neopixel_write/__init__.c +++ b/shared-bindings/neopixel_write/__init__.c @@ -51,11 +51,11 @@ //| neopixel_write.neopixel_write(pin, pixel_off)""" //| //| def neopixel_write(digitalinout: digitalio.DigitalInOut, buf: bytearray) -> None: -//| """Write buf out on the given DigitalInOut. +//| """Write buf out on the given DigitalInOut. //| -//| :param digitalinout: the DigitalInOut to output with -//| :param buf: The bytes to clock out. No assumption is made about color order""" -//| ... +//| :param digitalinout: the DigitalInOut to output with +//| :param buf: The bytes to clock out. No assumption is made about color order""" +//| ... STATIC mp_obj_t neopixel_write_neopixel_write_(mp_obj_t digitalinout_obj, mp_obj_t buf) { if (!MP_OBJ_IS_TYPE(digitalinout_obj, &digitalio_digitalinout_type)) { mp_raise_TypeError_varg(translate("Expected a %q"), digitalio_digitalinout_type.name); diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c index 278ac4d739..994ce70458 100644 --- a/shared-bindings/nvm/ByteArray.c +++ b/shared-bindings/nvm/ByteArray.c @@ -49,7 +49,8 @@ //| ... //| -//| def __bool__(self) -> bool: ... +//| def __bool__(self) -> bool: +//| ... //| //| def __len__(self) -> int: //| """Return the length. This is used by (`len`)""" @@ -70,6 +71,18 @@ STATIC const mp_rom_map_elem_t nvm_bytearray_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(nvm_bytearray_locals_dict, nvm_bytearray_locals_dict_table); +//| @overload +//| def __getitem__(self, index: slice) -> bytearray: ... +//| def __getitem__(self, index: int) -> int: +//| """Returns the value at the given index.""" +//| ... +//| +//| @overload +//| def __setitem__(self, index: slice, value: ReadableBuffer) -> None: ... +//| def __setitem__(self, index: int, value: int) -> None: +//| """Set the value at the given index.""" +//| ... +//| STATIC mp_obj_t nvm_bytearray_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value) { if (value == MP_OBJ_NULL) { // delete item diff --git a/shared-bindings/os/__init__.c b/shared-bindings/os/__init__.c index c9aaf3b2c2..9fad6e83df 100644 --- a/shared-bindings/os/__init__.c +++ b/shared-bindings/os/__init__.c @@ -54,7 +54,7 @@ STATIC mp_obj_t os_uname(void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(os_uname_obj, os_uname); -//| def chdir(path: string) -> None: +//| def chdir(path: str) -> None: //| """Change current directory.""" //| ... //| @@ -65,7 +65,7 @@ mp_obj_t os_chdir(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_chdir_obj, os_chdir); -//| def getcwd() -> string: +//| def getcwd() -> str: //| """Get the current directory.""" //| ... //| @@ -74,7 +74,7 @@ mp_obj_t os_getcwd(void) { } MP_DEFINE_CONST_FUN_OBJ_0(os_getcwd_obj, os_getcwd); -//| def listdir(dir: string) -> string: +//| def listdir(dir: str) -> str: //| """With no argument, list the current directory. Otherwise list the given directory.""" //| ... //| @@ -89,7 +89,7 @@ mp_obj_t os_listdir(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(os_listdir_obj, 0, 1, os_listdir); -//| def mkdir(path: string) -> None: +//| def mkdir(path: str) -> None: //| """Create a new directory.""" //| ... //| @@ -100,7 +100,7 @@ mp_obj_t os_mkdir(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_mkdir_obj, os_mkdir); -//| def remove(path: string) -> None: +//| def remove(path: str) -> None: //| """Remove a file.""" //| ... //| @@ -111,7 +111,7 @@ mp_obj_t os_remove(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_remove_obj, os_remove); -//| def rmdir(path: string) -> None: +//| def rmdir(path: str) -> None: //| """Remove a directory.""" //| ... //| @@ -123,7 +123,7 @@ mp_obj_t os_rename(mp_obj_t old_path_in, mp_obj_t new_path_in) { } MP_DEFINE_CONST_FUN_OBJ_2(os_rename_obj, os_rename); -//| def rename(old_path: string, new_path: string) -> string: +//| def rename(old_path: str, new_path: str) -> str: //| """Rename a file.""" //| ... //| @@ -134,7 +134,7 @@ mp_obj_t os_rmdir(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_rmdir_obj, os_rmdir); -//| def stat(path: string) -> string: +//| def stat(path: str) -> str: //| """Get the status of a file or directory. //| //| .. note:: On builds without long integers, the number of seconds @@ -149,7 +149,7 @@ mp_obj_t os_stat(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_stat_obj, os_stat); -//| def statvfs(path: string) -> Tuple[string, string, string, string, string, string, string, string, string, string]: +//| def statvfs(path: str) -> Tuple[str, str, str, str, str, str, str, str, str, str]: //| """Get the status of a fileystem. //| //| Returns a tuple with the filesystem information in the following order: @@ -189,7 +189,7 @@ STATIC mp_obj_t os_sync(void) { } MP_DEFINE_CONST_FUN_OBJ_0(os_sync_obj, os_sync); -//| def urandom(size: int) -> string: +//| def urandom(size: int) -> str: //| """Returns a string of *size* random bytes based on a hardware True Random //| Number Generator. When not available, it will raise a NotImplementedError.""" //| ... @@ -224,9 +224,9 @@ STATIC const mp_rom_map_elem_t os_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_urandom), MP_ROM_PTR(&os_urandom_obj) }, -//| """.. data:: sep //| -//| Separator used to delineate path components such as folder and file names.""" +//| sep: str +//| """Separator used to delineate path components such as folder and file names.""" //| { MP_ROM_QSTR(MP_QSTR_sep), MP_ROM_QSTR(MP_QSTR__slash_) }, }; diff --git a/shared-bindings/pulseio/PulseOut.c b/shared-bindings/pulseio/PulseOut.c index 9e2d687449..ca1369d932 100644 --- a/shared-bindings/pulseio/PulseOut.c +++ b/shared-bindings/pulseio/PulseOut.c @@ -41,7 +41,7 @@ //| pulsed signal consists of timed on and off periods. Unlike PWM, there is no set duration //| for on and off pairs.""" //| -//| def __init__(self, carrier: pulseio.PWMOut) -> None: +//| def __init__(self, carrier: PWMOut) -> None: //| """Create a PulseOut object associated with the given PWMout object. //| //| :param ~pulseio.PWMOut carrier: PWMOut that is set to output on the desired pin. diff --git a/shared-bindings/random/__init__.c b/shared-bindings/random/__init__.c index 10ddca4991..35756eef16 100644 --- a/shared-bindings/random/__init__.c +++ b/shared-bindings/random/__init__.c @@ -46,6 +46,9 @@ //| .. warning:: Numbers from this module are not cryptographically strong! Use //| bytes from `os.urandom` directly for true randomness.""" //| +//| from typing import TypeVar +//| _T = TypeVar('_T') +//| //| def seed(seed: int) -> None: //| """Sets the starting seed of the random number generation. Further calls to @@ -129,7 +132,7 @@ STATIC mp_obj_t random_randint(mp_obj_t a_in, mp_obj_t b_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(random_randint_obj, random_randint); -//| def choice(seq: list) -> Any: +//| def choice(seq: Sequence[_T]) -> _T: //| """Returns a randomly selected element from the given sequence. Raises //| IndexError when the sequence is empty.""" //| ... diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index e04336351d..fcf597bcbc 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -128,7 +128,7 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_ } } -//| def __init__(self, *, width: int, bit_depth: List[digitalio.DigitalInOut], rgb_pins: List[digitalio.DigitalInOut], addr_pins: List[digitalio.DigitalInOut], clock_pin: digitalio.DigitalInOut, latch_pin: digitalio.DigitalInOut, output_enable_pin: digitalio.DigitalInOut, doublebuffer: bool = True, framebuffer: Optional[WriteableBuffer] = None, height: int = 0) -> None: +//| def __init__(self, *, width: int, bit_depth: int, rgb_pins: Sequence[digitalio.DigitalInOut], addr_pins: List[digitalio.DigitalInOut], clock_pin: digitalio.DigitalInOut, latch_pin: digitalio.DigitalInOut, output_enable_pin: digitalio.DigitalInOut, doublebuffer: bool = True, framebuffer: Optional[WriteableBuffer] = None, height: int = 0) -> None: //| """Create a RGBMatrix object with the given attributes. The height of //| the display is determined by the number of rgb and address pins: //| len(rgb_pins) // 3 * 2 ** len(address_pins). With 6 RGB pins and 4 diff --git a/shared-bindings/sdcardio/SDCard.c b/shared-bindings/sdcardio/SDCard.c index 7f53f741dd..75db6b1817 100644 --- a/shared-bindings/sdcardio/SDCard.c +++ b/shared-bindings/sdcardio/SDCard.c @@ -44,7 +44,7 @@ //| `busio.SPI`, not `bitbangio.SPI`. Usually an SDCard object is used //| with ``storage.VfsFat`` to allow file I/O to an SD card.""" //| -//| def __init__(bus:busio.SPI, cs: digitalio.DigitalInOut=digitalio.DigitalInOut, baudrate: int=8000000) -> None: +//| def __init__(self, bus: busio.SPI, cs: microcontroller.Pin, baudrate: int = 8000000) -> None: //| """Construct an SPI SD Card object with the given properties //| //| :param busio.SPI spi: The SPI bus @@ -94,7 +94,7 @@ STATIC mp_obj_t sdcardio_sdcard_make_new(const mp_obj_type_t *type, size_t n_arg } -//| def count() -> int: +//| def count(self) -> int: //| """Returns the total number of sectors //| //| Due to technical limitations, this is a function and not a property. @@ -107,7 +107,7 @@ mp_obj_t sdcardio_sdcard_count(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_count_obj, sdcardio_sdcard_count); -//| def deinit() -> None: +//| def deinit(self) -> None: //| """Disable permanently. //| //| :return: None""" @@ -120,7 +120,7 @@ mp_obj_t sdcardio_sdcard_deinit(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_deinit_obj, sdcardio_sdcard_deinit); -//| def readblocks(start_block: int, buf: bytearray) -> None: +//| def readblocks(self, start_block: int, buf: bytearray) -> None: //| //| """Read one or more blocks from the card //| @@ -144,7 +144,7 @@ mp_obj_t sdcardio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, m MP_DEFINE_CONST_FUN_OBJ_3(sdcardio_sdcard_readblocks_obj, sdcardio_sdcard_readblocks); -//| def writeblocks(start_block: int, buf: bytearray) -> None: +//| def writeblocks(self, start_block: int, buf: bytearray) -> None: //| //| """Write one or more blocks to the card //| diff --git a/shared-bindings/sdioio/SDCard.c b/shared-bindings/sdioio/SDCard.c index 94ba1c3871..215f914fac 100644 --- a/shared-bindings/sdioio/SDCard.c +++ b/shared-bindings/sdioio/SDCard.c @@ -49,7 +49,7 @@ //| 25MHz. Usually an SDCard object is used with ``storage.VfsFat`` //| to allow file I/O to an SD card.""" //| -//| def __init__(*, clock: digitalio.DigitalInOut, command: digitalio.DigitalInOut, data: List[digitalio.DigitalInOut], frequency: int) -> None: +//| def __init__(self, clock: microcontroller.Pin, command: microcontroller.Pin, data: Sequence[microcontroller.Pin], frequency: int) -> None: //| """Construct an SDIO SD Card object with the given properties //| //| :param ~microcontroller.Pin clock: the pin to use for the clock. @@ -109,7 +109,7 @@ STATIC void check_for_deinit(sdioio_sdcard_obj_t *self) { } } -//| def configure(*, frequency: int=0, width: int=0) -> None: +//| def configure(self, frequency: int = 0, width: int = 0) -> None: //| """Configures the SDIO bus. //| //| :param int frequency: the desired clock rate in Hertz. The actual clock rate may be higher or lower due to the granularity of available clock settings. Check the `frequency` attribute for the actual clock rate. @@ -146,7 +146,7 @@ STATIC mp_obj_t sdioio_sdcard_configure(size_t n_args, const mp_obj_t *pos_args, } MP_DEFINE_CONST_FUN_OBJ_KW(sdioio_sdcard_configure_obj, 1, sdioio_sdcard_configure); -//| def count() -> int: +//| def count(self) -> int: //| """Returns the total number of sectors //| //| Due to technical limitations, this is a function and not a property. @@ -160,7 +160,7 @@ STATIC mp_obj_t sdioio_sdcard_count(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_count_obj, sdioio_sdcard_count); -//| def readblocks(start_block: int, buf: bytearray) -> None: +//| def readblocks(self, start_block: int, buf: bytearray) -> None: //| //| """Read one or more blocks from the card //| @@ -182,7 +182,7 @@ mp_obj_t sdioio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_ MP_DEFINE_CONST_FUN_OBJ_3(sdioio_sdcard_readblocks_obj, sdioio_sdcard_readblocks); -//| def writeblocks(start_block: int, buf: bytearray) -> None: +//| def writeblocks(self, start_block: int, buf: bytearray) -> None: //| //| """Write one or more blocks to the card //| @@ -244,7 +244,7 @@ const mp_obj_property_t sdioio_sdcard_width_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def deinit() -> None: +//| def deinit(self) -> None: //| """Disable permanently. //| //| :return: None""" diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c index a2007edf69..dbadb19558 100644 --- a/shared-bindings/socket/__init__.c +++ b/shared-bindings/socket/__init__.c @@ -512,7 +512,7 @@ STATIC const mp_obj_type_t socket_type = { .locals_dict = (mp_obj_dict_t*)&socket_locals_dict, }; -//| def getaddrinfo(host: string, port: string) -> tuple: +//| def getaddrinfo(host: str, port: int) -> tuple: //| """Gets the address information for a hostname and port //| //| Returns the appropriate family, socket type, socket protocol and diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c index 2defdbb625..79c5274aae 100644 --- a/shared-bindings/storage/__init__.c +++ b/shared-bindings/storage/__init__.c @@ -43,7 +43,7 @@ //| directly.""" //| -//| def mount(filesystem: VfsFat, mount_path: string, *, readonly: bool = False) -> None: +//| def mount(filesystem: VfsFat, mount_path: str, *, readonly: bool = False) -> None: //| """Mounts the given filesystem object at the given path. //| //| This is the CircuitPython analog to the UNIX ``mount`` command. @@ -80,7 +80,7 @@ mp_obj_t storage_mount(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_arg } MP_DEFINE_CONST_FUN_OBJ_KW(storage_mount_obj, 2, storage_mount); -//| def umount(mount: Union[string, VfsFat]) -> None: +//| def umount(mount: Union[str, VfsFat]) -> None: //| """Unmounts the given filesystem object or if *mount* is a path, then unmount //| the filesystem mounted at that location. //| @@ -98,7 +98,7 @@ mp_obj_t storage_umount(mp_obj_t mnt_in) { } MP_DEFINE_CONST_FUN_OBJ_1(storage_umount_obj, storage_umount); -//| def remount(mount_path: string, readonly: bool = False, *, disable_concurrent_write_protection: bool = False) -> None: +//| def remount(mount_path: str, readonly: bool = False, *, disable_concurrent_write_protection: bool = False) -> None: //| """Remounts the given path with new parameters. //| //| :param bool readonly: True when the filesystem should be readonly to CircuitPython. @@ -128,7 +128,7 @@ mp_obj_t storage_remount(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_a } MP_DEFINE_CONST_FUN_OBJ_KW(storage_remount_obj, 1, storage_remount); -//| def getmount(mount_path: string) -> VfsFat: +//| def getmount(mount_path: str) -> VfsFat: //| """Retrieves the mount object associated with the mount path""" //| ... //| @@ -168,43 +168,43 @@ STATIC const mp_rom_map_elem_t storage_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_erase_filesystem), MP_ROM_PTR(&storage_erase_filesystem_obj) }, //| class VfsFat: -//| def __init__(self, block_device: string) -> None: +//| def __init__(self, block_device: str) -> None: //| """Create a new VfsFat filesystem around the given block device. //| //| :param block_device: Block device the the filesystem lives on""" //| -//| label: string = ... -//| """The filesystem label, up to 11 case-insensitive bytes. Note that -//| this property can only be set when the device is writable by the -//| microcontroller.""" -//| ... +//| label: str +//| """The filesystem label, up to 11 case-insensitive bytes. Note that +//| this property can only be set when the device is writable by the +//| microcontroller.""" +//| ... //| //| def mkfs(self) -> None: //| """Format the block device, deleting any data that may have been there""" //| ... //| -//| def open(self, path: string, mode: string) -> None: +//| def open(self, path: str, mode: str) -> None: //| """Like builtin ``open()``""" //| ... //| -//| def ilistdir(self, path: string) -> iterator: +//| def ilistdir(self, path: str) -> Iterator[Tuple[AnyStr, int, int, int]]: //| """Return an iterator whose values describe files and folders within //| ``path``""" //| ... //| -//| def mkdir(self, path: string) -> None: +//| def mkdir(self, path: str) -> None: //| """Like `os.mkdir`""" //| ... //| -//| def rmdir(self, path: string) -> None: +//| def rmdir(self, path: str) -> None: //| """Like `os.rmdir`""" //| ... //| -//| def stat(self, path: string) -> string: +//| def stat(self, path: str) -> str: //| """Like `os.stat`""" //| ... //| -//| def statvfs(self, path: string) -> Tuple[string, string, string, string, string, string, string, string, string, string]: +//| def statvfs(self, path: str) -> Tuple[str, str, str, str, str, str, str, str, str, str]: //| """Like `os.statvfs`""" //| ... //| diff --git a/shared-bindings/struct/__init__.c b/shared-bindings/struct/__init__.c index de357dde4d..d74b962125 100644 --- a/shared-bindings/struct/__init__.c +++ b/shared-bindings/struct/__init__.c @@ -62,7 +62,7 @@ STATIC mp_obj_t struct_calcsize(mp_obj_t fmt_in) { } MP_DEFINE_CONST_FUN_OBJ_1(struct_calcsize_obj, struct_calcsize); -//| def pack(fmt: string, *values: ReadableBuffer) -> bytes: +//| def pack(fmt: str, *values: ReadableBuffer) -> bytes: //| """Pack the values according to the format string fmt. //| The return value is a bytes object encoding the values.""" //| ... @@ -80,7 +80,7 @@ STATIC mp_obj_t struct_pack(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(struct_pack_obj, 1, MP_OBJ_FUN_ARGS_MAX, struct_pack); -//| def pack_into(fmt: string, buffer: WriteableBuffer, offset: int, *values: readableBuffer) -> None: +//| def pack_into(fmt: str, buffer: WriteableBuffer, offset: int, *values: ReadableBuffer) -> None: //| """Pack the values according to the format string fmt into a buffer //| starting at offset. offset may be negative to count from the end of buffer.""" //| ... @@ -106,7 +106,7 @@ STATIC mp_obj_t struct_pack_into(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(struct_pack_into_obj, 3, MP_OBJ_FUN_ARGS_MAX, struct_pack_into); -//| def unpack(fmt: string, data: ReadableBuffer) -> tuple: +//| def unpack(fmt: str, data: ReadableBuffer) -> tuple: //| """Unpack from the data according to the format string fmt. The return value //| is a tuple of the unpacked values. The buffer size must match the size //| required by the format.""" @@ -124,7 +124,7 @@ STATIC mp_obj_t struct_unpack(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(struct_unpack_obj, 2, 3, struct_unpack); -//| def unpack_from(fmt: string, data: ReadableBuffer, offset: int = 0) -> tuple: +//| def unpack_from(fmt: str, data: ReadableBuffer, offset: int = 0) -> tuple: //| """Unpack from the data starting at offset according to the format string fmt. //| offset may be negative to count from the end of buffer. The return value is //| a tuple of the unpacked values. The buffer size must be at least as big diff --git a/shared-bindings/uheap/__init__.c b/shared-bindings/uheap/__init__.c index 0559d974ab..daf55a6138 100644 --- a/shared-bindings/uheap/__init__.c +++ b/shared-bindings/uheap/__init__.c @@ -34,7 +34,7 @@ //| """Heap size analysis""" //| -//| def info(object: Any) -> int: +//| def info(object: object) -> int: //| """Prints memory debugging info for the given object and returns the //| estimated size.""" //| ... diff --git a/shared-bindings/usb_hid/__init__.c b/shared-bindings/usb_hid/__init__.c index e12ea8da4e..36111e9194 100644 --- a/shared-bindings/usb_hid/__init__.c +++ b/shared-bindings/usb_hid/__init__.c @@ -36,7 +36,7 @@ //| The `usb_hid` module allows you to output data as a HID device.""" //| -//| usb_hid.devices: Any = ... +//| devices: Tuple[Device, ...] //| """Tuple of all active HID device interfaces.""" //| STATIC const mp_rom_map_elem_t usb_hid_module_globals_table[] = { diff --git a/shared-bindings/vectorio/Polygon.c b/shared-bindings/vectorio/Polygon.c index b5c9d1c423..c46e49d3e8 100644 --- a/shared-bindings/vectorio/Polygon.c +++ b/shared-bindings/vectorio/Polygon.c @@ -15,10 +15,8 @@ // #define VECTORIO_POLYGON_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) -//| from typing import List, Tuple -//| //| class Polygon: -//| def __init__(self, points: List[ Tuple[ x, y ], ... ] ) -> None: +//| def __init__(self, points: List[Tuple[int, int]]) -> None: //| """Represents a closed shape by ordered vertices //| //| :param points: Vertices for the polygon""" @@ -44,7 +42,7 @@ static mp_obj_t vectorio_polygon_make_new(const mp_obj_type_t *type, size_t n_ar } -//| points: List[ Tuple[ x, y ], ... ] = ... +//| points: List[Tuple[int, int]] = ... //| """Set a new look and shape for this polygon""" //| STATIC mp_obj_t vectorio_polygon_obj_get_points(mp_obj_t self_in) { diff --git a/shared-bindings/vectorio/VectorShape.c b/shared-bindings/vectorio/VectorShape.c index d1042b1c63..43571094ff 100644 --- a/shared-bindings/vectorio/VectorShape.c +++ b/shared-bindings/vectorio/VectorShape.c @@ -20,7 +20,7 @@ //| class VectorShape: -//| def __init__(self, shape: vectorio.Polygon, pixel_shader: displayio.Palette, x: int=0, y: int=0) -> None: +//| def __init__(self, shape: Polygon, pixel_shader: displayio.Palette, x: int=0, y: int=0) -> None: //| """Binds a vector shape to a location and pixel color //| //| :param shape: The shape to draw. diff --git a/shared-bindings/watchdog/WatchDogMode.c b/shared-bindings/watchdog/WatchDogMode.c index 9b9999d8bf..25476039ab 100644 --- a/shared-bindings/watchdog/WatchDogMode.c +++ b/shared-bindings/watchdog/WatchDogMode.c @@ -32,15 +32,15 @@ //| def __init__(self) -> None: //| """Enum-like class to define the run mode of the watchdog timer.""" //| -//| RAISE: watchdog.WatchDogMode = ... +//| RAISE: WatchDogMode = ... //| """Raise an exception when the WatchDogTimer expires. //| -//| :type watchdog.WatchDogMode:""" +//| :type WatchDogMode:""" //| -//| RESET: watchdog.WatchDogMode = ... +//| RESET: WatchDogMode = ... //| """Reset the system if the WatchDogTimer expires. //| -//| :type watchdog.WatchDogMode:""" +//| :type WatchDogMode:""" //| const mp_obj_type_t watchdog_watchdogmode_type; diff --git a/shared-bindings/watchdog/WatchDogTimer.c b/shared-bindings/watchdog/WatchDogTimer.c index 20bead106c..fe53b864b7 100644 --- a/shared-bindings/watchdog/WatchDogTimer.c +++ b/shared-bindings/watchdog/WatchDogTimer.c @@ -54,7 +54,7 @@ //| ... //| -//| def feed(self): +//| def feed(self) -> None: //| """Feed the watchdog timer. This must be called regularly, otherwise //| the timer will expire.""" //| ... @@ -71,7 +71,7 @@ STATIC mp_obj_t watchdog_watchdogtimer_feed(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_feed_obj, watchdog_watchdogtimer_feed); -//| def deinit(self): +//| def deinit(self) -> None: //| """Stop the watchdog timer. This may raise an error if the watchdog //| timer cannot be disabled on this platform.""" //| ... @@ -119,7 +119,7 @@ const mp_obj_property_t watchdog_watchdogtimer_timeout_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| mode: watchdog.WatchDogMode = ... +//| mode: WatchDogMode = ... //| """The current operating mode of the WatchDogTimer `watchdog.WatchDogMode`. //| //| Setting a WatchDogMode activates the WatchDog:: diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index ab223877e6..d29c3444f4 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -13,11 +13,12 @@ import sys import traceback import isort +import black -IMPORTS_IGNORE = frozenset({'int', 'float', 'bool', 'str', 'bytes', 'tuple', 'list', 'set', 'dict', 'bytearray', 'file', 'buffer'}) -IMPORTS_TYPING = frozenset({'Any', 'Optional', 'Union', 'Tuple', 'List', 'Sequence'}) -IMPORTS_TYPESHED = frozenset({'ReadableBuffer', 'WritableBuffer'}) +IMPORTS_IGNORE = frozenset({'int', 'float', 'bool', 'str', 'bytes', 'tuple', 'list', 'set', 'dict', 'bytearray', 'slice', 'file', 'buffer', 'range', 'array', 'struct_time'}) +IMPORTS_TYPING = frozenset({'Any', 'Optional', 'Union', 'Tuple', 'List', 'Sequence', 'Iterable', 'Iterator', 'overload'}) +IMPORTS_TYPESHED = frozenset({'ReadableBuffer', 'WriteableBuffer'}) def is_any(node): @@ -63,8 +64,9 @@ def extract_imports(tree): typing.add(node.id) elif node.id in IMPORTS_TYPESHED: typeshed.add(node.id) - elif not node.id[0].isupper(): - modules.add(node.id) + if node_type == ast.Attribute: + if type(node.value) == ast.Name: + modules.add(node.value.id) for node in ast.walk(tree): node_type = type(node) @@ -72,6 +74,9 @@ def extract_imports(tree): collect_annotations(node.annotation) elif node_type == ast.FunctionDef: collect_annotations(node.returns) + for deco in node.decorator_list: + if deco.id in IMPORTS_TYPING: + typing.add(deco.id) return { "modules": sorted(modules), @@ -134,22 +139,21 @@ def convert_folder(top_level, stub_directory): # Add import statements import_lines = ["from __future__ import annotations"] + if imports["typing"]: + import_lines.append("from typing import " + ", ".join(imports["typing"])) + if imports["typeshed"]: + import_lines.append("from _typeshed import " + ", ".join(imports["typeshed"])) import_lines.extend(f"import {m}" for m in imports["modules"]) - import_lines.append("from typing import " + ", ".join(imports["typing"])) - import_lines.append("from _typeshed import " + ", ".join(imports["typeshed"])) import_body = "\n".join(import_lines) m = re.match(r'(\s*""".*?""")', stub_contents, flags=re.DOTALL) if m: stub_contents = m.group(1) + "\n\n" + import_body + "\n\n" + stub_contents[m.end():] else: stub_contents = import_body + "\n\n" + stub_contents - stub_contents = isort.code(stub_contents) - # Adjust blank lines - stub_contents = re.sub(r"\n+class", "\n\n\nclass", stub_contents) - stub_contents = re.sub(r"\n+def", "\n\n\ndef", stub_contents) - stub_contents = re.sub(r"\n+^(\s+)def", lambda m: f"\n\n{m.group(1)}def", stub_contents, flags=re.M) - stub_contents = stub_contents.strip() + "\n" + # Code formatting + stub_contents = isort.code(stub_contents) + stub_contents = black.format_str(stub_contents, mode=black.FileMode(is_pyi=True)) os.makedirs(stub_directory, exist_ok=True) with open(stub_filename, "w") as f: From 204cdada7c20404f9e6d4c7a16b42904b7b92659 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 24 Jul 2020 09:53:40 -0500 Subject: [PATCH 0376/1293] remove unnecessary mk files parameters --- ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk | 2 -- ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk | 2 -- 2 files changed, 4 deletions(-) diff --git a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk index db0259423d..38c9933340 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk +++ b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk @@ -14,5 +14,3 @@ EXTERNAL_FLASH_DEVICES = "GD25Q16C" # We use a CFLAGS define here because there are include order issues # if we try to include "mpconfigport.h" into nrfx_config.h . CFLAGS += -DCIRCUITPY_NRF_NUM_I2C=2 - -OPTIMIZATION_LEVEL = 2 diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk index e7b54af5c8..2b2c0d6db5 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk @@ -15,5 +15,3 @@ LD_COMMON = boards/common_default.ld LD_DEFAULT = boards/STM32F405_default.ld LD_BOOT = boards/STM32F405_boot.ld # UF2 boot option UF2_OFFSET = 0x8010000 - -OPTIMIZATION_LEVEL = 2 From b9cdf195e2faa1d7d140b1f6a1f6850eb0e6c731 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 24 Jul 2020 10:00:42 -0500 Subject: [PATCH 0377/1293] board mk file changes --- .../boards/pewpew_m4/mpconfigboard.mk | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index c1fe011c40..b19a6d92d6 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -10,32 +10,38 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 +# TODO: Turn off analogio for now for space reasons, but restore it +# when frozen module gets smaller. +CIRCUITPY_ANALOGIO = 0 CIRCUITPY_AUDIOBUSIO = 0 -CIRCUITPY_AUDIOPWMIO = 0 -CIRCUITPY_AUDIOMP3 = 0 CIRCUITPY_BITBANGIO = 0 -CIRCUITPY_BITBANG_APA102 = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_GAMEPADSHIFT = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 +CIRCUITPY_NETWORK = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_PS2IO = 0 -CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 -CIRCUITPY_SAMD = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_USB_MIDI = 0 +CIRCUITPY_AUDIOPWMIO = 0 +CIRCUITPY_AUDIOMP3 = 0 +CIRCUITPY_BITBANG_APA102 = 0 +CIRCUITPY_BLEIO = 0 +CIRCUITPY_GAMEPADSHIFT = 0 +CIRCUITPY_NETWORK = 0 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_SAMD = 0 +CIRCUITPY_TOUCHIO = 0 CIRCUITPY_VECTORIO = 0 -CIRCUITPY_ANALOGIO = 1 CIRCUITPY_AUDIOMIXER = 1 CIRCUITPY_AUDIOIO = 1 CIRCUITPY_DISPLAYIO = 1 CIRCUITPY_GAMEPAD = 1 -CIRCUITPY_MATH = 1 CIRCUITPY_STAGE = 1 +CIRCUITPY_MATH = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pewpew_m4 CIRCUITPY_DISPLAY_FONT = $(TOP)/ports/atmel-samd/boards/ugame10/brutalist-6.bdf @@ -47,5 +53,4 @@ else CFLAGS_INLINE_LIMIT = 70 endif -# Override optimization to keep binary small OPTIMIZATION_FLAGS = -Os From 356b1a8d6dd9830d452eddc63f3c8bc890fa12f8 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 24 Jul 2020 12:29:18 -0400 Subject: [PATCH 0378/1293] Finish common-hal pin API --- ports/litex/common-hal/microcontroller/Pin.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ports/litex/common-hal/microcontroller/Pin.c b/ports/litex/common-hal/microcontroller/Pin.c index 632468f6d0..38601e0d3c 100644 --- a/ports/litex/common-hal/microcontroller/Pin.c +++ b/ports/litex/common-hal/microcontroller/Pin.c @@ -41,12 +41,19 @@ void reset_pin_number(uint8_t pin_port, uint8_t pin_number) { claimed_pins[pin_port] &= ~(1<number); +} void claim_pin(const mcu_pin_obj_t* pin) { // Set bit in claimed_pins bitmask. claimed_pins[0] |= 1<number; } +void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) { + claim_pin(pin); +} + bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number) { return !(claimed_pins[pin_port] & 1< Date: Fri, 24 Jul 2020 14:09:09 -0500 Subject: [PATCH 0379/1293] Use current mpconfigboard.mk with optimization change --- .../boards/pewpew_m4/mpconfigboard.mk | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index b19a6d92d6..fd91a46e43 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -10,38 +10,32 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 -# TODO: Turn off analogio for now for space reasons, but restore it -# when frozen module gets smaller. -CIRCUITPY_ANALOGIO = 0 CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_AUDIOPWMIO = 0 +CIRCUITPY_AUDIOMP3 = 0 CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITBANG_APA102 = 0 CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_GAMEPADSHIFT = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 -CIRCUITPY_NETWORK = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_PS2IO = 0 +CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 +CIRCUITPY_SAMD = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_USB_MIDI = 0 -CIRCUITPY_AUDIOPWMIO = 0 -CIRCUITPY_AUDIOMP3 = 0 -CIRCUITPY_BITBANG_APA102 = 0 -CIRCUITPY_BLEIO = 0 -CIRCUITPY_GAMEPADSHIFT = 0 -CIRCUITPY_NETWORK = 0 -CIRCUITPY_ROTARYIO = 0 -CIRCUITPY_SAMD = 0 -CIRCUITPY_TOUCHIO = 0 CIRCUITPY_VECTORIO = 0 +CIRCUITPY_ANALOGIO = 1 CIRCUITPY_AUDIOMIXER = 1 CIRCUITPY_AUDIOIO = 1 CIRCUITPY_DISPLAYIO = 1 CIRCUITPY_GAMEPAD = 1 -CIRCUITPY_STAGE = 1 CIRCUITPY_MATH = 1 +CIRCUITPY_STAGE = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pewpew_m4 CIRCUITPY_DISPLAY_FONT = $(TOP)/ports/atmel-samd/boards/ugame10/brutalist-6.bdf From 739981b34e617cb66d721d1922c0f8c7c61dc794 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 24 Jul 2020 17:27:25 -0500 Subject: [PATCH 0380/1293] update for pewpew --- .../boards/pewpew_m4/mpconfigboard.mk | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index b19a6d92d6..1ea4a7601f 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -10,38 +10,32 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 -# TODO: Turn off analogio for now for space reasons, but restore it -# when frozen module gets smaller. -CIRCUITPY_ANALOGIO = 0 CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_AUDIOPWMIO = 0 +CIRCUITPY_AUDIOMP3 = 0 CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITBANG_APA102 = 0 CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_GAMEPADSHIFT = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 -CIRCUITPY_NETWORK = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_PS2IO = 0 +CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 +CIRCUITPY_SAMD = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_USB_MIDI = 0 -CIRCUITPY_AUDIOPWMIO = 0 -CIRCUITPY_AUDIOMP3 = 0 -CIRCUITPY_BITBANG_APA102 = 0 -CIRCUITPY_BLEIO = 0 -CIRCUITPY_GAMEPADSHIFT = 0 -CIRCUITPY_NETWORK = 0 -CIRCUITPY_ROTARYIO = 0 -CIRCUITPY_SAMD = 0 -CIRCUITPY_TOUCHIO = 0 CIRCUITPY_VECTORIO = 0 +CIRCUITPY_ANALOGIO = 1 CIRCUITPY_AUDIOMIXER = 1 CIRCUITPY_AUDIOIO = 1 CIRCUITPY_DISPLAYIO = 1 CIRCUITPY_GAMEPAD = 1 -CIRCUITPY_STAGE = 1 CIRCUITPY_MATH = 1 +CIRCUITPY_STAGE = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pewpew_m4 CIRCUITPY_DISPLAY_FONT = $(TOP)/ports/atmel-samd/boards/ugame10/brutalist-6.bdf @@ -52,5 +46,5 @@ CFLAGS_INLINE_LIMIT = 45 else CFLAGS_INLINE_LIMIT = 70 endif - +# Override optimization to keep binary small OPTIMIZATION_FLAGS = -Os From 9a1f1236ccf9fd525675b8b8ea34178851f968cc Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Tue, 21 Jul 2020 22:43:15 -0700 Subject: [PATCH 0381/1293] require async for and async with to actually be in an async def method instead of just a generator --- py/compile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/py/compile.c b/py/compile.c index 9b0d29998a..fade4c01a4 100644 --- a/py/compile.c +++ b/py/compile.c @@ -1713,11 +1713,11 @@ STATIC void compile_yield_from(compiler_t *comp) { #if MICROPY_PY_ASYNC_AWAIT STATIC bool compile_require_async_context(compiler_t *comp, mp_parse_node_struct_t *pns) { int scope_flags = comp->scope_cur->scope_flags; - if(scope_flags & MP_SCOPE_FLAG_GENERATOR) { + if(scope_flags & MP_SCOPE_FLAG_ASYNC) { return true; } compile_syntax_error(comp, (mp_parse_node_t)pns, - translate("'async for' or 'async with' outside async function")); + translate("'await', 'async for' or 'async with' outside async function")); return false; } @@ -2645,6 +2645,7 @@ STATIC void compile_atom_expr_await(compiler_t *comp, mp_parse_node_struct_t *pn compile_syntax_error(comp, (mp_parse_node_t)pns, translate("'await' outside function")); return; } + compile_require_async_context(comp, pns); compile_atom_expr_normal(comp, pns); compile_yield_from(comp); } From a6b5870514c3e5cf05aa9b8a5ee53ff45936a86f Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Fri, 24 Jul 2020 19:58:20 -0700 Subject: [PATCH 0382/1293] translations --- locale/circuitpython.pot | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 4d3a877069..153f0edad2 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-21 18:43-0700\n" +"POT-Creation-Date: 2020-07-24 19:58-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -110,10 +110,6 @@ msgstr "" msgid "'%q' argument required" msgstr "" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -219,11 +215,11 @@ msgid "'align' requires 1 argument" msgstr "" #: py/compile.c -msgid "'async for' or 'async with' outside async function" +msgid "'await' outside function" msgstr "" #: py/compile.c -msgid "'await' outside function" +msgid "'await', 'async for' or 'async with' outside async function" msgstr "" #: py/compile.c @@ -1336,10 +1332,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -1773,7 +1765,7 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "" From d9503e579b72d8bad6f556589da50ba9833b4574 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 24 Jul 2020 23:27:22 -0500 Subject: [PATCH 0383/1293] latest frozen/circuitpython-stage --- frozen/circuitpython-stage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frozen/circuitpython-stage b/frozen/circuitpython-stage index 0d2c083a2f..9596a5904e 160000 --- a/frozen/circuitpython-stage +++ b/frozen/circuitpython-stage @@ -1 +1 @@ -Subproject commit 0d2c083a2fb57a1562d4806775f45273abbfbfae +Subproject commit 9596a5904ed757e6fbffcf03e7aa77ae9ecf5223 From 11d225fe6238d7af0e189232766c16b089d63c59 Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Fri, 24 Jul 2020 20:44:55 -0700 Subject: [PATCH 0384/1293] Use 2 cores per job in github build As of today, https://docs.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners states that hosted runners have a 2-core CPU. This uses make -j $physical_cores to try and be better about utilizing the time spent on those machines. When github upgrades runners to have more cores we'll benefit from that too. --- tools/build_release_files.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/build_release_files.py b/tools/build_release_files.py index 3563dd99f1..1209c18ada 100755 --- a/tools/build_release_files.py +++ b/tools/build_release_files.py @@ -5,6 +5,7 @@ # SPDX-License-Identifier: MIT import os +import multiprocessing import sys import subprocess import shutil @@ -27,6 +28,8 @@ sha, version = build_info.get_version_info() languages = build_info.get_languages() exit_status = 0 +cores = multiprocessing.cpu_count() +print('building boards with parallelism {}'.format(cores)) for board in build_boards: bin_directory = "../bin/{}/".format(board) os.makedirs(bin_directory, exist_ok=True) @@ -41,8 +44,8 @@ for board in build_boards: # But sometimes a particular language needs to be built from scratch, if, for instance, # CFLAGS_INLINE_LIMIT is set for a particular language to make it fit. clean_build_check_result = subprocess.run( - "make -C ../ports/{port} TRANSLATION={language} BOARD={board} check-release-needs-clean-build | fgrep 'RELEASE_NEEDS_CLEAN_BUILD = 1'".format( - port = board_info["port"], language=language, board=board), + "make -C ../ports/{port} TRANSLATION={language} BOARD={board} check-release-needs-clean-build -j {cores} | fgrep 'RELEASE_NEEDS_CLEAN_BUILD = 1'".format( + port = board_info["port"], language=language, board=board, cores=cores), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) clean_build = clean_build_check_result.returncode == 0 From 901f3dce6e5e7c1501550ca0b7f3283848194a2e Mon Sep 17 00:00:00 2001 From: Jonathan Hogg Date: Tue, 21 Jul 2020 18:47:28 +0100 Subject: [PATCH 0385/1293] py/compile: Don't await __aiter__ special method in async-for. MicroPython's original implementation of __aiter__ was correct for an earlier (provisional) version of PEP492 (CPython 3.5), where __aiter__ was an async-def function. But that changed in the final version of PEP492 (in CPython 3.5.2) where the function was changed to a normal one. See https://www.python.org/dev/peps/pep-0492/#why-aiter-does-not-return-an-awaitable See also the note at the end of this subsection in the docs: https://docs.python.org/3.5/reference/datamodel.html#asynchronous-iterators And for completeness the BPO: https://bugs.python.org/issue27243 To be consistent with the Python spec as it stands today (and now that PEP492 is final) this commit changes MicroPython's behaviour to match CPython: __aiter__ should return an async-iterable object, but is not itself awaitable. The relevant tests are updated to match. See #6267. --- py/compile.c | 3 ++- tests/basics/async_for.py | 2 +- tests/basics/async_for2.py | 5 ++--- tests/basics/async_for2.py.exp | 4 ---- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/py/compile.c b/py/compile.c index 9b0d29998a..58b1813c77 100644 --- a/py/compile.c +++ b/py/compile.c @@ -1741,7 +1741,8 @@ STATIC void compile_async_for_stmt(compiler_t *comp, mp_parse_node_struct_t *pns uint try_finally_label = comp_next_label(comp); compile_node(comp, pns->nodes[1]); // iterator - compile_await_object_method(comp, MP_QSTR___aiter__); + EMIT_ARG(load_method, MP_QSTR___aiter__, false); + EMIT_ARG(call_method, 0, 0, 0); compile_store_id(comp, context); START_BREAK_CONTINUE_BLOCK diff --git a/tests/basics/async_for.py b/tests/basics/async_for.py index 6b4e136d59..5fd0540828 100644 --- a/tests/basics/async_for.py +++ b/tests/basics/async_for.py @@ -6,7 +6,7 @@ class AsyncIteratorWrapper: print('init') self._it = iter(obj) - async def __aiter__(self): + def __aiter__(self): print('aiter') return self diff --git a/tests/basics/async_for2.py b/tests/basics/async_for2.py index 025ff9c4da..add74dd388 100644 --- a/tests/basics/async_for2.py +++ b/tests/basics/async_for2.py @@ -1,4 +1,4 @@ -# test waiting within "async for" aiter/anext functions +# test waiting within "async for" __anext__ function import sys if sys.implementation.name in ('micropython', 'circuitpython'): @@ -21,9 +21,8 @@ class ARange: self.cur = 0 self.high = high - async def __aiter__(self): + def __aiter__(self): print('aiter') - print('f returned:', await f(10)) return self async def __anext__(self): diff --git a/tests/basics/async_for2.py.exp b/tests/basics/async_for2.py.exp index 886232f7ba..52bbe90c85 100644 --- a/tests/basics/async_for2.py.exp +++ b/tests/basics/async_for2.py.exp @@ -1,9 +1,5 @@ init aiter -f start: 10 -coro yielded: 11 -coro yielded: 12 -f returned: 13 anext f start: 20 coro yielded: 21 From 6696915801d84b41164edafc282779085a452c2f Mon Sep 17 00:00:00 2001 From: ikigaisense Date: Sat, 25 Jul 2020 10:07:33 -0600 Subject: [PATCH 0386/1293] fix-ndbit6-for-ndbit6_v2 --- ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h | 1 - ports/atmel-samd/boards/ndgarage_ndbit6/pins.c | 1 - 2 files changed, 2 deletions(-) diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h index 869f207a16..51be8d7c06 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h +++ b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h @@ -29,4 +29,3 @@ // USB is always used. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 - diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c b/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c index 8b3898b185..2ea5630079 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c +++ b/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c @@ -37,4 +37,3 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); - From ebc1373c08509c3c5eb1420b8a91fe5329d6718a Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Sat, 25 Jul 2020 10:23:42 -0700 Subject: [PATCH 0387/1293] use -j2 in the actual build also --- tools/build_release_files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/build_release_files.py b/tools/build_release_files.py index 1209c18ada..98e81499ed 100755 --- a/tools/build_release_files.py +++ b/tools/build_release_files.py @@ -54,8 +54,8 @@ for board in build_boards: build_dir += "-{language}".format(language=language) make_result = subprocess.run( - "make -C ../ports/{port} TRANSLATION={language} BOARD={board} BUILD={build}".format( - port = board_info["port"], language=language, board=board, build=build_dir), + "make -C ../ports/{port} TRANSLATION={language} BOARD={board} BUILD={build} -j {cores}".format( + port = board_info["port"], language=language, board=board, build=build_dir, cores=cores), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) build_duration = time.monotonic() - start_time From c4a5297ee2777596081ae247e43f4a8b5746a14a Mon Sep 17 00:00:00 2001 From: Chris Burton Date: Sat, 25 Jul 2020 17:53:27 +0000 Subject: [PATCH 0388/1293] Add GamePad to Commander --- ports/atmel-samd/boards/8086_commander/mpconfigboard.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk index dcc62fc9bc..5a1bc1c4dd 100644 --- a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk +++ b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk @@ -19,6 +19,8 @@ SUPEROPT_GC = 0 CFLAGS_INLINE_LIMIT = 60 +CIRCUITPY_GAMEPAD = 1 + # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID From b1b253c012e75e35a6a307a994e736fd9d7cc9bc Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Sun, 26 Jul 2020 13:39:42 +0200 Subject: [PATCH 0389/1293] fluff_m0: add pin aliases Add aliases for SDI, SDO and EN, so that pin names match the text on the PCB to avoid confusion. Also disable all pins from port B, because that package of SAMD21 doesn't have port B. --- .../boards/fluff_m0/mpconfigboard.h | 24 +++++++++++++++++++ ports/atmel-samd/boards/fluff_m0/pins.c | 3 +++ 2 files changed, 27 insertions(+) diff --git a/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h b/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h index 0782c980df..810abc0a2f 100644 --- a/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h @@ -18,3 +18,27 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 + +// There is no port B +#define IGNORE_PIN_PB00 1 +#define IGNORE_PIN_PB01 1 +#define IGNORE_PIN_PB02 1 +#define IGNORE_PIN_PB03 1 +#define IGNORE_PIN_PB04 1 +#define IGNORE_PIN_PB05 1 +#define IGNORE_PIN_PB06 1 +#define IGNORE_PIN_PB07 1 +#define IGNORE_PIN_PB08 1 +#define IGNORE_PIN_PB09 1 +#define IGNORE_PIN_PB10 1 +#define IGNORE_PIN_PB11 1 +#define IGNORE_PIN_PB12 1 +#define IGNORE_PIN_PB13 1 +#define IGNORE_PIN_PB14 1 +#define IGNORE_PIN_PB15 1 +#define IGNORE_PIN_PB16 1 +#define IGNORE_PIN_PB17 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PB30 1 +#define IGNORE_PIN_PB31 1 diff --git a/ports/atmel-samd/boards/fluff_m0/pins.c b/ports/atmel-samd/boards/fluff_m0/pins.c index ac7811328b..6b56297afe 100644 --- a/ports/atmel-samd/boards/fluff_m0/pins.c +++ b/ports/atmel-samd/boards/fluff_m0/pins.c @@ -13,7 +13,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA31) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_SDO), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA30) }, + { MP_ROM_QSTR(MP_QSTR_SDI), MP_ROM_PTR(&pin_PA30) }, { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, @@ -31,6 +33,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) }, { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA27) }, + { MP_ROM_QSTR(MP_QSTR_EN), MP_ROM_PTR(&pin_PA27) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA28) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, From b2c4b0bcfa40b0247e9e4f48dc05a175fc5b044e Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Sun, 26 Jul 2020 17:26:32 +0200 Subject: [PATCH 0390/1293] fluff_m0: don't exclude portb pins explicitly --- .../boards/fluff_m0/mpconfigboard.h | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h b/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h index 810abc0a2f..0782c980df 100644 --- a/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h @@ -18,27 +18,3 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 - -// There is no port B -#define IGNORE_PIN_PB00 1 -#define IGNORE_PIN_PB01 1 -#define IGNORE_PIN_PB02 1 -#define IGNORE_PIN_PB03 1 -#define IGNORE_PIN_PB04 1 -#define IGNORE_PIN_PB05 1 -#define IGNORE_PIN_PB06 1 -#define IGNORE_PIN_PB07 1 -#define IGNORE_PIN_PB08 1 -#define IGNORE_PIN_PB09 1 -#define IGNORE_PIN_PB10 1 -#define IGNORE_PIN_PB11 1 -#define IGNORE_PIN_PB12 1 -#define IGNORE_PIN_PB13 1 -#define IGNORE_PIN_PB14 1 -#define IGNORE_PIN_PB15 1 -#define IGNORE_PIN_PB16 1 -#define IGNORE_PIN_PB17 1 -#define IGNORE_PIN_PB22 1 -#define IGNORE_PIN_PB23 1 -#define IGNORE_PIN_PB30 1 -#define IGNORE_PIN_PB31 1 From d356581651e4a11dc18787da95e2f96bfde3575d Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Sat, 25 Jul 2020 17:58:37 +0900 Subject: [PATCH 0391/1293] Fix several type hints --- ports/atmel-samd/bindings/samd/Clock.c | 8 ++-- shared-bindings/_bleio/Adapter.c | 14 +++---- shared-bindings/_bleio/Address.c | 12 +++--- shared-bindings/_bleio/Attribute.c | 14 +++---- shared-bindings/_bleio/Characteristic.c | 24 +++++------ shared-bindings/_bleio/CharacteristicBuffer.c | 4 +- shared-bindings/_bleio/Connection.c | 10 ++--- shared-bindings/_bleio/Descriptor.c | 42 +++++++++---------- shared-bindings/_bleio/PacketBuffer.c | 8 ++-- shared-bindings/_bleio/ScanEntry.c | 10 ++--- shared-bindings/_bleio/Service.c | 8 ++-- shared-bindings/_bleio/UUID.c | 6 +-- shared-bindings/_eve/__init__.c | 2 +- shared-bindings/_pixelbuf/PixelBuf.c | 10 ++--- shared-bindings/_stage/Layer.c | 2 +- shared-bindings/_stage/Text.c | 2 +- shared-bindings/_stage/__init__.c | 2 +- shared-bindings/aesio/aes.c | 2 +- shared-bindings/analogio/AnalogIn.c | 4 +- shared-bindings/analogio/AnalogOut.c | 2 +- shared-bindings/audiobusio/I2SOut.c | 6 +-- shared-bindings/audiobusio/PDMIn.c | 2 +- shared-bindings/audiocore/RawSample.c | 6 +-- shared-bindings/audiocore/WaveFile.c | 6 +-- shared-bindings/audiocore/__init__.c | 7 ++++ shared-bindings/audioio/AudioOut.c | 8 ++-- shared-bindings/audiomixer/Mixer.c | 8 ++-- shared-bindings/audiomixer/MixerVoice.c | 6 +-- shared-bindings/audiomp3/MP3Decoder.c | 12 +++--- shared-bindings/audiopwmio/PWMAudioOut.c | 8 ++-- shared-bindings/bitbangio/I2C.c | 8 ++-- shared-bindings/bitbangio/SPI.c | 4 +- shared-bindings/busio/I2C.c | 10 ++--- shared-bindings/busio/SPI.c | 8 ++-- shared-bindings/busio/UART.c | 12 +++--- shared-bindings/countio/Counter.c | 2 +- shared-bindings/digitalio/DigitalInOut.c | 12 +++--- shared-bindings/digitalio/Direction.c | 4 +- shared-bindings/digitalio/DriveMode.c | 4 +- shared-bindings/digitalio/Pull.c | 4 +- shared-bindings/displayio/Bitmap.c | 4 +- shared-bindings/displayio/ColorConverter.c | 2 +- shared-bindings/displayio/Display.c | 29 +++++++------ shared-bindings/displayio/EPaperDisplay.c | 10 ++--- shared-bindings/displayio/FourWire.c | 2 +- shared-bindings/displayio/Group.c | 8 ++-- shared-bindings/displayio/I2CDisplay.c | 2 +- shared-bindings/displayio/OnDiskBitmap.c | 4 +- shared-bindings/displayio/TileGrid.c | 22 +++++----- shared-bindings/fontio/BuiltinFont.c | 2 +- .../framebufferio/FramebufferDisplay.c | 14 +++---- shared-bindings/frequencyio/FrequencyIn.c | 2 +- shared-bindings/gnss/GNSS.c | 14 +++---- shared-bindings/gnss/PositionFix.c | 6 +-- shared-bindings/i2cperipheral/I2CPeripheral.c | 8 ++-- .../memorymonitor/AllocationSize.c | 2 +- shared-bindings/microcontroller/Pin.c | 2 +- shared-bindings/microcontroller/Processor.c | 8 ++-- shared-bindings/microcontroller/RunMode.c | 6 +-- shared-bindings/microcontroller/__init__.c | 10 ++++- shared-bindings/multiterminal/__init__.c | 2 +- shared-bindings/neopixel_write/__init__.c | 2 +- shared-bindings/os/__init__.c | 2 +- shared-bindings/pulseio/PWMOut.c | 4 +- shared-bindings/pulseio/PulseIn.c | 4 +- shared-bindings/pulseio/PulseOut.c | 2 +- shared-bindings/rgbmatrix/RGBMatrix.c | 6 +-- shared-bindings/rotaryio/IncrementalEncoder.c | 2 +- shared-bindings/rtc/RTC.c | 4 +- shared-bindings/sdcardio/SDCard.c | 4 +- shared-bindings/sdioio/SDCard.c | 6 +-- shared-bindings/socket/__init__.c | 4 +- shared-bindings/supervisor/Runtime.c | 4 +- shared-bindings/supervisor/__init__.c | 2 +- shared-bindings/terminalio/Terminal.c | 2 +- shared-bindings/touchio/TouchIn.c | 6 +-- shared-bindings/usb_hid/Device.c | 4 +- shared-bindings/usb_midi/PortIn.c | 2 +- shared-bindings/vectorio/Circle.c | 2 +- shared-bindings/vectorio/Polygon.c | 2 +- shared-bindings/vectorio/VectorShape.c | 6 +-- shared-bindings/watchdog/WatchDogMode.c | 4 +- shared-bindings/watchdog/WatchDogTimer.c | 4 +- shared-bindings/wiznet/wiznet5k.c | 6 +-- 84 files changed, 292 insertions(+), 274 deletions(-) diff --git a/ports/atmel-samd/bindings/samd/Clock.c b/ports/atmel-samd/bindings/samd/Clock.c index e8a468d77f..478a10fcd4 100644 --- a/ports/atmel-samd/bindings/samd/Clock.c +++ b/ports/atmel-samd/bindings/samd/Clock.c @@ -43,7 +43,7 @@ STATIC void samd_clock_print(const mp_print_t *print, mp_obj_t self_in, mp_print mp_printf(print, "%q.%q.%q", MP_QSTR_samd, MP_QSTR_clock, self->name); } -//| enabled: bool = ... +//| enabled: bool //| """Is the clock enabled? (read-only)""" //| STATIC mp_obj_t samd_clock_get_enabled(mp_obj_t self_in) { @@ -61,7 +61,7 @@ const mp_obj_property_t samd_clock_enabled_obj = { }, }; -//| parent: Union[Clock, None] = ... +//| parent: Union[Clock, None] //| """Clock parent. (read-only)""" //| STATIC mp_obj_t samd_clock_get_parent(mp_obj_t self_in) { @@ -89,7 +89,7 @@ const mp_obj_property_t samd_clock_parent_obj = { }, }; -//| frequency: int = ... +//| frequency: int //| """Clock frequency in Herz. (read-only)""" //| STATIC mp_obj_t samd_clock_get_frequency(mp_obj_t self_in) { @@ -107,7 +107,7 @@ const mp_obj_property_t samd_clock_frequency_obj = { }, }; -//| calibration: int = ... +//| calibration: int //| """Clock calibration. Not all clocks can be calibrated.""" //| STATIC mp_obj_t samd_clock_get_calibration(mp_obj_t self_in) { diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 9177a9a69d..f898d404a0 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -71,7 +71,7 @@ //| ... //| -//| enabled: bool = ... +//| enabled: bool //| """State of the BLE adapter.""" //| STATIC mp_obj_t bleio_adapter_get_enabled(mp_obj_t self) { @@ -95,7 +95,7 @@ const mp_obj_property_t bleio_adapter_enabled_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| address: Address = ... +//| address: Address //| """MAC address of the BLE adapter. (read-only)""" //| STATIC mp_obj_t bleio_adapter_get_address(mp_obj_t self) { @@ -111,7 +111,7 @@ const mp_obj_property_t bleio_adapter_address_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| name: str = ... +//| name: str //| """name of the BLE adapter used once connected. //| The name is "CIRCUITPY" + the last four hex digits of ``adapter.address``, //| to make it easy to distinguish multiple CircuitPython boards.""" @@ -215,7 +215,7 @@ STATIC mp_obj_t bleio_adapter_stop_advertising(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_stop_advertising_obj, bleio_adapter_stop_advertising); -//| def start_scan(self, prefixes: ReadableBuffer = b"", *, buffer_size: int = 512, extended: bool = False, timeout: float = None, interval: float = 0.1, window: float = 0.1, minimum_rssi: int = -80, active: bool = True) -> Iterable[ScanEntry]: +//| def start_scan(self, prefixes: ReadableBuffer = b"", *, buffer_size: int = 512, extended: bool = False, timeout: Optional[float] = None, interval: float = 0.1, window: float = 0.1, minimum_rssi: int = -80, active: bool = True) -> Iterable[ScanEntry]: //| """Starts a BLE scan and returns an iterator of results. Advertisements and scan responses are //| filtered and returned separately. //| @@ -301,7 +301,7 @@ STATIC mp_obj_t bleio_adapter_stop_scan(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_stop_scan_obj, bleio_adapter_stop_scan); -//| advertising: bool = ... +//| advertising: bool //| """True when the adapter is currently advertising. (read-only)""" //| STATIC mp_obj_t bleio_adapter_get_advertising(mp_obj_t self) { @@ -317,7 +317,7 @@ const mp_obj_property_t bleio_adapter_advertising_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| connected: bool = ... +//| connected: bool //| """True when the adapter is connected to another device regardless of who initiated the //| connection. (read-only)""" //| @@ -334,7 +334,7 @@ const mp_obj_property_t bleio_adapter_connected_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| connections: tuple = ... +//| connections: tuple //| """Tuple of active connections including those initiated through //| :py:meth:`_bleio.Adapter.connect`. (read-only)""" //| diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c index 290b0fd09a..94994fb702 100644 --- a/shared-bindings/_bleio/Address.c +++ b/shared-bindings/_bleio/Address.c @@ -77,7 +77,7 @@ STATIC mp_obj_t bleio_address_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(self); } -//| address_bytes: bytes = ... +//| address_bytes: bytes //| """The bytes that make up the device address (read-only). //| //| Note that the ``bytes`` object returned is in little-endian order: @@ -108,7 +108,7 @@ const mp_obj_property_t bleio_address_address_bytes_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| type: int = ... +//| type: int //| """The address type (read-only). //| //| One of the integer values: `PUBLIC`, `RANDOM_STATIC`, `RANDOM_PRIVATE_RESOLVABLE`, @@ -187,17 +187,17 @@ STATIC void bleio_address_print(const mp_print_t *print, mp_obj_t self_in, mp_pr buf[5], buf[4], buf[3], buf[2], buf[1], buf[0]); } -//| PUBLIC: int = ... +//| PUBLIC: int //| """A publicly known address, with a company ID (high 24 bits)and company-assigned part (low 24 bits).""" //| -//| RANDOM_STATIC: int = ... +//| RANDOM_STATIC: int //| """A randomly generated address that does not change often. It may never change or may change after //| a power cycle.""" //| -//| RANDOM_PRIVATE_RESOLVABLE: int = ... +//| RANDOM_PRIVATE_RESOLVABLE: int //| """An address that is usable when the peer knows the other device's secret Identity Resolving Key (IRK).""" //| -//| RANDOM_PRIVATE_NON_RESOLVABLE: int = ... +//| RANDOM_PRIVATE_NON_RESOLVABLE: int //| """A randomly generated address that changes on every connection.""" //| STATIC const mp_rom_map_elem_t bleio_address_locals_dict_table[] = { diff --git a/shared-bindings/_bleio/Attribute.c b/shared-bindings/_bleio/Attribute.c index 7d91c93780..2c144c71b9 100644 --- a/shared-bindings/_bleio/Attribute.c +++ b/shared-bindings/_bleio/Attribute.c @@ -43,25 +43,25 @@ STATIC const mp_rom_map_elem_t bleio_attribute_locals_dict_table[] = { -//| NO_ACCESS: int = ... +//| NO_ACCESS: int //| """security mode: access not allowed""" //| -//| OPEN: int = ... +//| OPEN: int //| """security_mode: no security (link is not encrypted)""" //| -//| ENCRYPT_NO_MITM: int = ... +//| ENCRYPT_NO_MITM: int //| """security_mode: unauthenticated encryption, without man-in-the-middle protection""" //| -//| ENCRYPT_WITH_MITM: int = ... +//| ENCRYPT_WITH_MITM: int //| """security_mode: authenticated encryption, with man-in-the-middle protection""" //| -//| LESC_ENCRYPT_WITH_MITM: int = ... +//| LESC_ENCRYPT_WITH_MITM: int //| """security_mode: LESC encryption, with man-in-the-middle protection""" //| -//| SIGNED_NO_MITM: int = ... +//| SIGNED_NO_MITM: int //| """security_mode: unauthenticated data signing, without man-in-the-middle protection""" //| -//| SIGNED_WITH_MITM: int = ... +//| SIGNED_WITH_MITM: int //| """security_mode: authenticated data signing, without man-in-the-middle protection""" //| { MP_ROM_QSTR(MP_QSTR_NO_ACCESS), MP_ROM_INT(SECURITY_MODE_NO_ACCESS) }, diff --git a/shared-bindings/_bleio/Characteristic.c b/shared-bindings/_bleio/Characteristic.c index 2cdedaf99c..557a356b69 100644 --- a/shared-bindings/_bleio/Characteristic.c +++ b/shared-bindings/_bleio/Characteristic.c @@ -141,7 +141,7 @@ STATIC MP_DEFINE_CONST_CLASSMETHOD_OBJ(bleio_characteristic_add_to_service_obj, -//| properties: int = ... +//| properties: int //| """An int bitmask representing which properties are set, specified as bitwise or'ing of //| of these possible values. //| `BROADCAST`, `INDICATE`, `NOTIFY`, `READ`, `WRITE`, `WRITE_NO_RESPONSE`.""" @@ -160,7 +160,7 @@ const mp_obj_property_t bleio_characteristic_properties_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| uuid: Optional[UUID] = ... +//| uuid: Optional[UUID] //| """The UUID of this characteristic. (read-only) //| //| Will be ``None`` if the 128-bit UUID for this characteristic is not known.""" @@ -180,7 +180,7 @@ const mp_obj_property_t bleio_characteristic_uuid_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| value: bytearray = ... +//| value: bytearray //| """The value of this characteristic.""" //| STATIC mp_obj_t bleio_characteristic_get_value(mp_obj_t self_in) { @@ -211,7 +211,7 @@ const mp_obj_property_t bleio_characteristic_value_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| descriptors: Descriptor = ... +//| descriptors: Descriptor //| """A tuple of :py:class:`Descriptor` that describe this characteristic. (read-only)""" //| STATIC mp_obj_t bleio_characteristic_get_descriptors(mp_obj_t self_in) { @@ -241,7 +241,7 @@ const mp_obj_property_t bleio_characteristic_descriptors_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| service: Service = ... +//| service: Service //| """The Service this Characteristic is a part of.""" //| STATIC mp_obj_t bleio_characteristic_get_service(mp_obj_t self_in) { @@ -258,7 +258,7 @@ const mp_obj_property_t bleio_characteristic_service_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| def set_cccd(self, *, notify: bool = False, indicate: float = False) -> None: +//| def set_cccd(self, *, notify: bool = False, indicate: bool = False) -> None: //| """Set the remote characteristic's CCCD to enable or disable notification and indication. //| //| :param bool notify: True if Characteristic should receive notifications of remote writes @@ -291,22 +291,22 @@ STATIC const mp_rom_map_elem_t bleio_characteristic_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_set_cccd), MP_ROM_PTR(&bleio_characteristic_set_cccd_obj) }, // Bitmask constants to represent properties -//| BROADCAST: int = ... +//| BROADCAST: int //| """property: allowed in advertising packets""" //| -//| INDICATE: int = ... +//| INDICATE: int //| """property: server will indicate to the client when the value is set and wait for a response""" //| -//| NOTIFY: int = ... +//| NOTIFY: int //| """property: server will notify the client when the value is set""" //| -//| READ: int = ... +//| READ: int //| """property: clients may read this characteristic""" //| -//| WRITE: int = ... +//| WRITE: int //| """property: clients may write this characteristic; a response will be sent back""" //| -//| WRITE_NO_RESPONSE: int = ... +//| WRITE_NO_RESPONSE: int //| """property: clients may write this characteristic; no response will be sent back""" //| { MP_ROM_QSTR(MP_QSTR_BROADCAST), MP_ROM_INT(CHAR_PROP_BROADCAST) }, diff --git a/shared-bindings/_bleio/CharacteristicBuffer.c b/shared-bindings/_bleio/CharacteristicBuffer.c index 24d7a26b64..7bcbc807e6 100644 --- a/shared-bindings/_bleio/CharacteristicBuffer.c +++ b/shared-bindings/_bleio/CharacteristicBuffer.c @@ -100,7 +100,7 @@ STATIC void check_for_deinit(bleio_characteristic_buffer_obj_t *self) { // These are standard stream methods. Code is in py/stream.c. // -//| def read(self, nbytes: int = None) -> Optional[bytes]: +//| def read(self, nbytes: Optional[int] = None) -> Optional[bytes]: //| """Read characters. If ``nbytes`` is specified then read at most that many //| bytes. Otherwise, read everything that arrives until the connection //| times out. Providing the number of bytes expected is highly recommended @@ -167,7 +167,7 @@ STATIC mp_uint_t bleio_characteristic_buffer_ioctl(mp_obj_t self_in, mp_uint_t r return ret; } -//| in_waiting: int = ... +//| in_waiting: int //| """The number of bytes in the input buffer, available to be read""" //| STATIC mp_obj_t bleio_characteristic_buffer_obj_get_in_waiting(mp_obj_t self_in) { diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index f610d65079..ed480ec04d 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -109,7 +109,7 @@ STATIC mp_obj_t bleio_connection_pair(mp_uint_t n_args, const mp_obj_t *pos_args } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_connection_pair_obj, 1, bleio_connection_pair); -//| def discover_remote_services(self, service_uuids_whitelist: Iterable[UUID] = None) -> Tuple[Service, ...]: +//| def discover_remote_services(self, service_uuids_whitelist: Optional[Iterable[UUID]] = None) -> Tuple[Service, ...]: //| """Do BLE discovery for all services or for the given service UUIDS, //| to find their handles and characteristics, and return the discovered services. //| `Connection.connected` must be True. @@ -152,7 +152,7 @@ STATIC mp_obj_t bleio_connection_discover_remote_services(mp_uint_t n_args, cons } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_connection_discover_remote_services_obj, 1, bleio_connection_discover_remote_services); -//| connected: bool = ... +//| connected: bool //| """True if connected to the remote peer.""" //| STATIC mp_obj_t bleio_connection_get_connected(mp_obj_t self_in) { @@ -170,7 +170,7 @@ const mp_obj_property_t bleio_connection_connected_obj = { }; -//| paired: bool = ... +//| paired: bool //| """True if paired to the remote peer.""" //| STATIC mp_obj_t bleio_connection_get_paired(mp_obj_t self_in) { @@ -188,7 +188,7 @@ const mp_obj_property_t bleio_connection_paired_obj = { }; -//| connection_interval: float = ... +//| connection_interval: float //| """Time between transmissions in milliseconds. Will be multiple of 1.25ms. Lower numbers //| increase speed and decrease latency but increase power consumption. //| @@ -206,7 +206,7 @@ STATIC mp_obj_t bleio_connection_get_connection_interval(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_get_connection_interval_obj, bleio_connection_get_connection_interval); -//| attribute: int = ... +//| attribute: int //| """The maximum number of data bytes that can be sent in a single transmission, //| not including overhead bytes. //| diff --git a/shared-bindings/_bleio/Descriptor.c b/shared-bindings/_bleio/Descriptor.c index b709fea6dd..e24751f759 100644 --- a/shared-bindings/_bleio/Descriptor.c +++ b/shared-bindings/_bleio/Descriptor.c @@ -43,27 +43,27 @@ //| """There is no regular constructor for a Descriptor. A new local Descriptor can be created //| and attached to a Characteristic by calling `add_to_characteristic()`. //| Remote Descriptor objects are created by `Connection.discover_remote_services()` -//| as part of remote Characteristics in the remote Services that are discovered. +//| as part of remote Characteristics in the remote Services that are discovered.""" //| -//| .. classmethod:: add_to_characteristic(characteristic, uuid, *, read_perm=`Attribute.OPEN`, write_perm=`Attribute.OPEN`, max_length=20, fixed_length=False, initial_value=b'') +//| @classmethod +//| def add_to_characteristic(characteristic: Characteristic, uuid: UUID, *, read_perm: int = Attribute.OPEN, write_perm: int = Attribute.OPEN, max_length = 20, fixed_length: bool = False, initial_value: ReadableBuffer = b'') -> Descriptor: +//| """Create a new Descriptor object, and add it to this Service. //| -//| Create a new Descriptor object, and add it to this Service. +//| :param Characteristic characteristic: The characteristic that will hold this descriptor +//| :param UUID uuid: The uuid of the descriptor +//| :param int read_perm: Specifies whether the descriptor can be read by a client, and if so, which +//| security mode is required. Must be one of the integer values `Attribute.NO_ACCESS`, `Attribute.OPEN`, +//| `Attribute.ENCRYPT_NO_MITM`, `Attribute.ENCRYPT_WITH_MITM`, `Attribute.LESC_ENCRYPT_WITH_MITM`, +//| `Attribute.SIGNED_NO_MITM`, or `Attribute.SIGNED_WITH_MITM`. +//| :param int write_perm: Specifies whether the descriptor can be written by a client, and if so, which +//| security mode is required. Values allowed are the same as ``read_perm``. +//| :param int max_length: Maximum length in bytes of the descriptor value. The maximum allowed is +//| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum +//| number of data bytes that fit in a single BLE 4.x ATT packet. +//| :param bool fixed_length: True if the descriptor value is of fixed length. +//| :param buf initial_value: The initial value for this descriptor. //| -//| :param Characteristic characteristic: The characteristic that will hold this descriptor -//| :param UUID uuid: The uuid of the descriptor -//| :param int read_perm: Specifies whether the descriptor can be read by a client, and if so, which -//| security mode is required. Must be one of the integer values `Attribute.NO_ACCESS`, `Attribute.OPEN`, -//| `Attribute.ENCRYPT_NO_MITM`, `Attribute.ENCRYPT_WITH_MITM`, `Attribute.LESC_ENCRYPT_WITH_MITM`, -//| `Attribute.SIGNED_NO_MITM`, or `Attribute.SIGNED_WITH_MITM`. -//| :param int write_perm: Specifies whether the descriptor can be written by a client, and if so, which -//| security mode is required. Values allowed are the same as ``read_perm``. -//| :param int max_length: Maximum length in bytes of the descriptor value. The maximum allowed is -//| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum -//| number of data bytes that fit in a single BLE 4.x ATT packet. -//| :param bool fixed_length: True if the descriptor value is of fixed length. -//| :param buf initial_value: The initial value for this descriptor. -//| -//| :return: the new Descriptor.""" +//| :return: the new Descriptor.""" //| ... //| STATIC mp_obj_t bleio_descriptor_add_to_characteristic(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -132,7 +132,7 @@ STATIC mp_obj_t bleio_descriptor_add_to_characteristic(size_t n_args, const mp_o STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_descriptor_add_to_characteristic_fun_obj, 3, bleio_descriptor_add_to_characteristic); STATIC MP_DEFINE_CONST_CLASSMETHOD_OBJ(bleio_descriptor_add_to_characteristic_obj, MP_ROM_PTR(&bleio_descriptor_add_to_characteristic_fun_obj)); -//| uuid: UUID = ... +//| uuid: UUID //| """The descriptor uuid. (read-only)""" //| STATIC mp_obj_t bleio_descriptor_get_uuid(mp_obj_t self_in) { @@ -150,7 +150,7 @@ const mp_obj_property_t bleio_descriptor_uuid_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| characteristic: Characteristic = ... +//| characteristic: Characteristic //| """The Characteristic this Descriptor is a part of.""" //| STATIC mp_obj_t bleio_descriptor_get_characteristic(mp_obj_t self_in) { @@ -167,7 +167,7 @@ const mp_obj_property_t bleio_descriptor_characteristic_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| value: WriteableBuffer = ... +//| value: bytearray //| """The value of this descriptor.""" //| STATIC mp_obj_t bleio_descriptor_get_value(mp_obj_t self_in) { diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index bbdde37d5b..8c8970939a 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -117,7 +117,7 @@ STATIC mp_obj_t bleio_packet_buffer_readinto(mp_obj_t self_in, mp_obj_t buffer_o } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bleio_packet_buffer_readinto_obj, bleio_packet_buffer_readinto); -//| def write(self, data: bytes, *, header: Optional[bytes] = None) -> int: +//| def write(self, data: ReadableBuffer, *, header: Optional[bytes] = None) -> int: //| """Writes all bytes from data into the same outgoing packet. The bytes from header are included //| before data when the pending packet is currently empty. //| @@ -179,12 +179,12 @@ STATIC mp_obj_t bleio_packet_buffer_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_deinit_obj, bleio_packet_buffer_deinit); -//| packet_size: int = ... +//| packet_size: int //| """`packet_size` is the same as `incoming_packet_length`. //| The name `packet_size` is deprecated and //| will be removed in CircuitPython 6.0.0.""" //| -//| incoming_packet_length: int = ... +//| incoming_packet_length: int //| """Maximum length in bytes of a packet we are reading.""" //| STATIC mp_obj_t bleio_packet_buffer_get_incoming_packet_length(mp_obj_t self_in) { @@ -205,7 +205,7 @@ const mp_obj_property_t bleio_packet_buffer_incoming_packet_length_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| outgoing_packet_length: int = ... +//| outgoing_packet_length: int //| """Maximum length in bytes of a packet we are writing.""" //| STATIC mp_obj_t bleio_packet_buffer_get_outgoing_packet_length(mp_obj_t self_in) { diff --git a/shared-bindings/_bleio/ScanEntry.c b/shared-bindings/_bleio/ScanEntry.c index d2f0e77fd1..4f07890190 100644 --- a/shared-bindings/_bleio/ScanEntry.c +++ b/shared-bindings/_bleio/ScanEntry.c @@ -70,7 +70,7 @@ STATIC mp_obj_t bleio_scanentry_matches(mp_uint_t n_args, const mp_obj_t *pos_ar } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_scanentry_matches_obj, 2, bleio_scanentry_matches); -//| address: Address = ... +//| address: Address //| """The address of the device (read-only), of type `_bleio.Address`.""" //| STATIC mp_obj_t bleio_scanentry_get_address(mp_obj_t self_in) { @@ -86,7 +86,7 @@ const mp_obj_property_t bleio_scanentry_address_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| advertisement_bytes: bytes = ... +//| advertisement_bytes: bytes //| """All the advertisement data present in the packet, returned as a ``bytes`` object. (read-only)""" //| STATIC mp_obj_t scanentry_get_advertisement_bytes(mp_obj_t self_in) { @@ -102,7 +102,7 @@ const mp_obj_property_t bleio_scanentry_advertisement_bytes_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| rssi: int = ... +//| rssi: int //| """The signal strength of the device at the time of the scan, in integer dBm. (read-only)""" //| STATIC mp_obj_t scanentry_get_rssi(mp_obj_t self_in) { @@ -118,7 +118,7 @@ const mp_obj_property_t bleio_scanentry_rssi_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| connectable: bool = ... +//| connectable: bool //| """True if the device can be connected to. (read-only)""" //| STATIC mp_obj_t scanentry_get_connectable(mp_obj_t self_in) { @@ -134,7 +134,7 @@ const mp_obj_property_t bleio_scanentry_connectable_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| scan_response: bool = ... +//| scan_response: bool //| """True if the entry was a scan response. (read-only)""" //| STATIC mp_obj_t scanentry_get_scan_response(mp_obj_t self_in) { diff --git a/shared-bindings/_bleio/Service.c b/shared-bindings/_bleio/Service.c index 65f920c583..f410b1798e 100644 --- a/shared-bindings/_bleio/Service.c +++ b/shared-bindings/_bleio/Service.c @@ -73,7 +73,7 @@ STATIC mp_obj_t bleio_service_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(service); } -//| characteristics: Tuple[Characteristic, ...] = ... +//| characteristics: Tuple[Characteristic, ...] //| """A tuple of :py:class:`Characteristic` designating the characteristics that are offered by //| this service. (read-only)""" //| @@ -92,7 +92,7 @@ const mp_obj_property_t bleio_service_characteristics_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| remote: bool = ... +//| remote: bool //| """True if this is a service provided by a remote device. (read-only)""" //| STATIC mp_obj_t bleio_service_get_remote(mp_obj_t self_in) { @@ -109,7 +109,7 @@ const mp_obj_property_t bleio_service_remote_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| secondary: bool = ... +//| secondary: bool //| """True if this is a secondary service. (read-only)""" //| STATIC mp_obj_t bleio_service_get_secondary(mp_obj_t self_in) { @@ -126,7 +126,7 @@ const mp_obj_property_t bleio_service_secondary_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| uuid: Optional[UUID] = ... +//| uuid: Optional[UUID] //| """The UUID of this service. (read-only) //| //| Will be ``None`` if the 128-bit UUID for this service is not known.""" diff --git a/shared-bindings/_bleio/UUID.c b/shared-bindings/_bleio/UUID.c index fa1e298a9a..6d92cf7931 100644 --- a/shared-bindings/_bleio/UUID.c +++ b/shared-bindings/_bleio/UUID.c @@ -120,7 +120,7 @@ STATIC mp_obj_t bleio_uuid_make_new(const mp_obj_type_t *type, size_t n_args, co return MP_OBJ_FROM_PTR(self); } -//| uuid16: int = ... +//| uuid16: int //| """The 16-bit part of the UUID. (read-only) //| //| :type: int""" @@ -139,7 +139,7 @@ const mp_obj_property_t bleio_uuid_uuid16_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| uuid128: bytes = ... +//| uuid128: bytes //| """The 128-bit value of the UUID //| Raises AttributeError if this is a 16-bit UUID. (read-only) //| @@ -165,7 +165,7 @@ const mp_obj_property_t bleio_uuid_uuid128_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| size: int = ... +//| size: int //| """128 if this UUID represents a 128-bit vendor-specific UUID. 16 if this UUID represents a //| 16-bit Bluetooth SIG assigned UUID. (read-only) 32-bit UUIDs are not currently supported. //| diff --git a/shared-bindings/_eve/__init__.c b/shared-bindings/_eve/__init__.c index dd7f6f8bd1..51d3d65aee 100644 --- a/shared-bindings/_eve/__init__.c +++ b/shared-bindings/_eve/__init__.c @@ -70,7 +70,7 @@ STATIC mp_obj_t _flush(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(flush_obj, _flush); -//| def cc(self, b: bytes) -> None: +//| def cc(self, b: ReadableBuffer) -> None: //| """Append bytes to the command FIFO. //| //| :param bytes b: The bytes to add""" diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 598c68d1de..abfe190d80 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -47,7 +47,7 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t //| class PixelBuf: //| """A fast RGB[W] pixel buffer for LED and similar devices.""" //| -//| def __init__(self, size: int, *, byteorder: str = "BGR", brightness: float = 0, auto_write: bool = False, header: bytes = b"", trailer: bytes = b"") -> None: +//| def __init__(self, size: int, *, byteorder: str = "BGR", brightness: float = 0, auto_write: bool = False, header: ReadableBuffer = b"", trailer: ReadableBuffer = b"") -> None: //| """Create a PixelBuf object of the specified size, byteorder, and bits per pixel. //| //| When brightness is less than 1.0, a second buffer will be used to store the color values @@ -152,7 +152,7 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t } } -//| bpp: int = ... +//| bpp: int //| """The number of bytes per pixel in the buffer (read-only)""" //| STATIC mp_obj_t pixelbuf_pixelbuf_obj_get_bpp(mp_obj_t self_in) { @@ -168,7 +168,7 @@ const mp_obj_property_t pixelbuf_pixelbuf_bpp_obj = { }; -//| brightness: float = ... +//| brightness: float //| """Float value between 0 and 1. Output brightness. //| //| When brightness is less than 1.0, a second buffer will be used to store the color values @@ -199,7 +199,7 @@ const mp_obj_property_t pixelbuf_pixelbuf_brightness_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| auto_write: bool = ... +//| auto_write: bool //| """Whether to automatically write the pixels after each update.""" //| STATIC mp_obj_t pixelbuf_pixelbuf_obj_get_auto_write(mp_obj_t self_in) { @@ -221,7 +221,7 @@ const mp_obj_property_t pixelbuf_pixelbuf_auto_write_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| byteorder: str = ... +//| byteorder: str //| """byteorder string for the buffer (read-only)""" //| STATIC mp_obj_t pixelbuf_pixelbuf_obj_get_byteorder(mp_obj_t self_in) { diff --git a/shared-bindings/_stage/Layer.c b/shared-bindings/_stage/Layer.c index 5828669a78..269005ccff 100644 --- a/shared-bindings/_stage/Layer.c +++ b/shared-bindings/_stage/Layer.c @@ -33,7 +33,7 @@ //| class Layer: //| """Keep information about a single layer of graphics""" //| -//| def __init__(self, width: int, height: int, graphic: bytearray, palette: bytearray, grid: bytearray) -> None: +//| def __init__(self, width: int, height: int, graphic: ReadableBuffer, palette: ReadableBuffer, grid: ReadableBuffer) -> None: //| """Keep internal information about a layer of graphics (either a //| ``Grid`` or a ``Sprite``) in a format suitable for fast rendering //| with the ``render()`` function. diff --git a/shared-bindings/_stage/Text.c b/shared-bindings/_stage/Text.c index 555eb58310..464af1b98f 100644 --- a/shared-bindings/_stage/Text.c +++ b/shared-bindings/_stage/Text.c @@ -33,7 +33,7 @@ //| class Text: //| """Keep information about a single grid of text""" //| -//| def __init__(self, width: int, height: int, font: bytearray, palette: bytearray, chars: bytearray) -> None: +//| def __init__(self, width: int, height: int, font: ReadableBuffer, palette: ReadableBuffer, chars: ReadableBuffer) -> None: //| """Keep internal information about a grid of text //| in a format suitable for fast rendering //| with the ``render()`` function. diff --git a/shared-bindings/_stage/__init__.c b/shared-bindings/_stage/__init__.c index 6af0e6dbf2..6651b3e0ba 100644 --- a/shared-bindings/_stage/__init__.c +++ b/shared-bindings/_stage/__init__.c @@ -39,7 +39,7 @@ //| The `_stage` module contains native code to speed-up the ```stage`` Library //| `_.""" //| -//| def render(x0: int, y0: int, x1: int, y1: int, layers: list, buffer: bytearray, display: displayio.Display, scale: int, background: int) -> None: +//| def render(x0: int, y0: int, x1: int, y1: int, layers: list, buffer: WriteableBuffer, display: displayio.Display, scale: int, background: int) -> None: //| """Render and send to the display a fragment of the screen. //| //| :param int x0: Left edge of the fragment. diff --git a/shared-bindings/aesio/aes.c b/shared-bindings/aesio/aes.c index 9881bd0edc..7c10693fec 100644 --- a/shared-bindings/aesio/aes.c +++ b/shared-bindings/aesio/aes.c @@ -12,7 +12,7 @@ //| class AES: //| """Encrypt and decrypt AES streams""" //| -//| def __init__(self, key: Optional[ReadableBuffer], mode: int = 0, iv: ReadableBuffer = None, segment_size: int = 8) -> None: +//| def __init__(self, key: ReadableBuffer, mode: int = 0, iv: Optional[ReadableBuffer] = None, segment_size: int = 8) -> None: //| """Create a new AES state with the given key. //| //| :param bytearray key: A 16-, 24-, or 32-byte key diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index 2164bdf3e4..2cda9355ab 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -104,7 +104,7 @@ STATIC mp_obj_t analogio_analogin___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogin___exit___obj, 4, 4, analogio_analogin___exit__); -//| value: int = ... +//| value: int //| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (read-only) //| //| Even if the underlying analog to digital converter (ADC) is lower @@ -124,7 +124,7 @@ const mp_obj_property_t analogio_analogin_value_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| reference_voltage: Optional[float] = ... +//| reference_voltage: Optional[float] //| """The maximum voltage measurable (also known as the reference voltage) as a //| `float` in Volts.""" //| diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index 7b960d2edf..787905c3c5 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -97,7 +97,7 @@ STATIC mp_obj_t analogio_analogout___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogout___exit___obj, 4, 4, analogio_analogout___exit__); -//| value: int = ... +//| value: int //| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (write-only) //| //| Even if the underlying digital to analog converter (DAC) is lower diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index 304c737f62..73a78ab065 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -147,7 +147,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj___exit__(size_t n_args, const mp_obj_t *ar STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_i2sout___exit___obj, 4, 4, audiobusio_i2sout_obj___exit__); -//| def play(self, sample: Union[audiocore.WaveFile, audiocore.RawSample, audiomixer.Mixer], *, loop: bool = False) -> None: +//| def play(self, sample: audiocore._AudioSample, *, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| @@ -186,7 +186,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj_stop(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_stop_obj, audiobusio_i2sout_obj_stop); -//| playing: bool = ... +//| playing: bool //| """True when the audio sample is being output. (read-only)""" //| STATIC mp_obj_t audiobusio_i2sout_obj_get_playing(mp_obj_t self_in) { @@ -235,7 +235,7 @@ STATIC mp_obj_t audiobusio_i2sout_obj_resume(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_resume_obj, audiobusio_i2sout_obj_resume); -//| paused: bool = ... +//| paused: bool //| """True when playback is paused. (read-only)""" //| STATIC mp_obj_t audiobusio_i2sout_obj_get_paused(mp_obj_t self_in) { diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c index 9a963bcfa9..6c5fa79394 100644 --- a/shared-bindings/audiobusio/PDMIn.c +++ b/shared-bindings/audiobusio/PDMIn.c @@ -210,7 +210,7 @@ STATIC mp_obj_t audiobusio_pdmin_obj_record(mp_obj_t self_obj, mp_obj_t destinat } MP_DEFINE_CONST_FUN_OBJ_3(audiobusio_pdmin_record_obj, audiobusio_pdmin_obj_record); -//| sample_rate: int = ... +//| sample_rate: int //| """The actual sample_rate of the recording. This may not match the constructed //| sample rate due to internal clock limitations.""" //| diff --git a/shared-bindings/audiocore/RawSample.c b/shared-bindings/audiocore/RawSample.c index 20ebae0015..fd8652c143 100644 --- a/shared-bindings/audiocore/RawSample.c +++ b/shared-bindings/audiocore/RawSample.c @@ -38,13 +38,13 @@ //| class RawSample: //| """A raw audio sample buffer in memory""" //| -//| def __init__(self, buffer: array.array, *, channel_count: int = 1, sample_rate: int = 8000) -> None: +//| def __init__(self, buffer: ReadableBuffer, *, channel_count: int = 1, sample_rate: int = 8000) -> None: //| """Create a RawSample based on the given buffer of signed values. If channel_count is more than //| 1 then each channel's samples should alternate. In other words, for a two channel buffer, the //| first sample will be for channel 1, the second sample will be for channel two, the third for //| channel 1 and so on. //| -//| :param array.array buffer: An `array.array` with samples +//| :param ReadableBuffer buffer: A buffer with samples //| :param int channel_count: The number of channels in the buffer //| :param int sample_rate: The desired playback sample rate //| @@ -136,7 +136,7 @@ STATIC mp_obj_t audioio_rawsample_obj___exit__(size_t n_args, const mp_obj_t *ar } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_rawsample___exit___obj, 4, 4, audioio_rawsample_obj___exit__); -//| sample_rate: Optional(int) = ... +//| sample_rate: Optional[int] //| """32 bit value that dictates how quickly samples are played in Hertz (cycles per second). //| When the sample is looped, this can change the pitch output without changing the underlying //| sample. This will not change the sample rate of any active playback. Call ``play`` again to diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index d986d6db5c..89c731c68b 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -125,7 +125,7 @@ STATIC mp_obj_t audioio_wavefile_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_wavefile___exit___obj, 4, 4, audioio_wavefile_obj___exit__); -//| sample_rate: int = ... +//| sample_rate: int //| """32 bit value that dictates how quickly samples are loaded into the DAC //| in Hertz (cycles per second). When the sample is looped, this can change //| the pitch output without changing the underlying sample.""" @@ -152,7 +152,7 @@ const mp_obj_property_t audioio_wavefile_sample_rate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| bits_per_sample: int = ... +//| bits_per_sample: int //| """Bits per sample. (read only)""" //| STATIC mp_obj_t audioio_wavefile_obj_get_bits_per_sample(mp_obj_t self_in) { @@ -168,7 +168,7 @@ const mp_obj_property_t audioio_wavefile_bits_per_sample_obj = { (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj}, }; -//| channel_count: int = ... +//| channel_count: int //| """Number of audio channels. (read only)""" //| STATIC mp_obj_t audioio_wavefile_obj_get_channel_count(mp_obj_t self_in) { diff --git a/shared-bindings/audiocore/__init__.c b/shared-bindings/audiocore/__init__.c index b400b94548..a27dcefa44 100644 --- a/shared-bindings/audiocore/__init__.c +++ b/shared-bindings/audiocore/__init__.c @@ -38,6 +38,13 @@ //| """Support for audio samples""" //| +//| _AudioSample = Union[audiocore.WaveFile, audiocore.RawSample, audiomixer.Mixer, audiomp3.MP3Decoder] +//| """An audio sample for playback with `audioio.AudioOut`, `audiobusio.I2SOut` or `audiopwmio.PWMAudioOut`. +//| +//| Supported sources are :py:class:`audiocore.WaveFile`, :py:class:`audiocore.RawSample`, +//| :py:class:`audiomixer.Mixer` and :py:class:`audiomp3.MP3Decoder`.""" +//| + STATIC const mp_rom_map_elem_t audiocore_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_audiocore) }, { MP_ROM_QSTR(MP_QSTR_RawSample), MP_ROM_PTR(&audioio_rawsample_type) }, diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index e1a78c44c4..25620a491f 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -39,7 +39,7 @@ //| class AudioOut: //| """Output an analog audio signal""" //| -//| def __init__(self, left_channel: microcontroller.Pin, *, right_channel: microcontroller.Pin = None, quiescent_value: int = 0x8000) -> None: +//| def __init__(self, left_channel: microcontroller.Pin, *, right_channel: Optional[microcontroller.Pin] = None, quiescent_value: int = 0x8000) -> None: //| """Create a AudioOut object associated with the given pin(s). This allows you to //| play audio signals out on the given pin(s). //| @@ -146,7 +146,7 @@ STATIC mp_obj_t audioio_audioout_obj___exit__(size_t n_args, const mp_obj_t *arg STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_audioout___exit___obj, 4, 4, audioio_audioout_obj___exit__); -//| def play(self, sample: Union[audiocore.WaveFile, audiocore.RawSample, audiomixer.Mixer], *, loop: bool = False) -> None: +//| def play(self, sample: audiocore._AudioSample, *, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| @@ -187,7 +187,7 @@ STATIC mp_obj_t audioio_audioout_obj_stop(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_stop_obj, audioio_audioout_obj_stop); -//| playing: bool = ... +//| playing: bool //| """True when an audio sample is being output even if `paused`. (read-only)""" //| STATIC mp_obj_t audioio_audioout_obj_get_playing(mp_obj_t self_in) { @@ -236,7 +236,7 @@ STATIC mp_obj_t audioio_audioout_obj_resume(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_resume_obj, audioio_audioout_obj_resume); -//| paused: bool = ... +//| paused: bool //| """True when playback is paused. (read-only)""" //| STATIC mp_obj_t audioio_audioout_obj_get_paused(mp_obj_t self_in) { diff --git a/shared-bindings/audiomixer/Mixer.c b/shared-bindings/audiomixer/Mixer.c index 0356edde4d..9a78c7fad6 100644 --- a/shared-bindings/audiomixer/Mixer.c +++ b/shared-bindings/audiomixer/Mixer.c @@ -156,7 +156,7 @@ STATIC mp_obj_t audiomixer_mixer_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiomixer_mixer___exit___obj, 4, 4, audiomixer_mixer_obj___exit__); -//| playing: bool = ... +//| playing: bool //| """True when any voice is being output. (read-only)""" //| STATIC mp_obj_t audiomixer_mixer_obj_get_playing(mp_obj_t self_in) { @@ -173,7 +173,7 @@ const mp_obj_property_t audiomixer_mixer_playing_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| sample_rate: int = ... +//| sample_rate: int //| """32 bit value that dictates how quickly samples are played in Hertz (cycles per second).""" //| STATIC mp_obj_t audiomixer_mixer_obj_get_sample_rate(mp_obj_t self_in) { @@ -190,7 +190,7 @@ const mp_obj_property_t audiomixer_mixer_sample_rate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| voice: Tuple[MixerVoice, ...] = ... +//| voice: Tuple[MixerVoice, ...] //| """A tuple of the mixer's `audiomixer.MixerVoice` object(s). //| //| .. code-block:: python @@ -211,7 +211,7 @@ const mp_obj_property_t audiomixer_mixer_voice_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def play(self, sample: Union[audiocore.WaveFile, audiocore.RawSample, Mixer], *, voice: int = 0, loop: bool = False) -> None: +//| def play(self, sample: audiocore._AudioSample, *, voice: int = 0, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| diff --git a/shared-bindings/audiomixer/MixerVoice.c b/shared-bindings/audiomixer/MixerVoice.c index 26a044d464..335949bb68 100644 --- a/shared-bindings/audiomixer/MixerVoice.c +++ b/shared-bindings/audiomixer/MixerVoice.c @@ -56,7 +56,7 @@ STATIC mp_obj_t audiomixer_mixervoice_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(self); } -//| def play(self, sample: Union[audiocore.WaveFile, Mixer, audiocore.RawSample], *, loop: bool = False) -> None: +//| def play(self, sample: audiocore._AudioSample, *, loop: bool = False) -> None: //| """Plays the sample once when ``loop=False``, and continuously when ``loop=True``. //| Does not block. Use `playing` to block. //| @@ -100,7 +100,7 @@ STATIC mp_obj_t audiomixer_mixervoice_obj_stop(size_t n_args, const mp_obj_t *po } MP_DEFINE_CONST_FUN_OBJ_KW(audiomixer_mixervoice_stop_obj, 1, audiomixer_mixervoice_obj_stop); -//| level: float = ... +//| level: float //| """The volume level of a voice, as a floating point number between 0 and 1.""" //| STATIC mp_obj_t audiomixer_mixervoice_obj_get_level(mp_obj_t self_in) { @@ -136,7 +136,7 @@ const mp_obj_property_t audiomixer_mixervoice_level_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| playing: bool = ... +//| playing: bool //| """True when this voice is being output. (read-only)""" //| diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index b7bb449572..0e427951c0 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -34,7 +34,7 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| class MP3: +//| class MP3Decoder: //| """Load a mp3 file for audio playback""" //| //| def __init__(self, file: typing.BinaryIO, buffer: WriteableBuffer) -> None: @@ -124,7 +124,7 @@ STATIC mp_obj_t audiomp3_mp3file_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiomp3_mp3file___exit___obj, 4, 4, audiomp3_mp3file_obj___exit__); -//| file: file = ... +//| file: file //| """File to play back.""" //| STATIC mp_obj_t audiomp3_mp3file_obj_get_file(mp_obj_t self_in) { @@ -154,7 +154,7 @@ const mp_obj_property_t audiomp3_mp3file_file_obj = { -//| sample_rate: int = ... +//| sample_rate: int //| """32 bit value that dictates how quickly samples are loaded into the DAC //| in Hertz (cycles per second). When the sample is looped, this can change //| the pitch output without changing the underlying sample.""" @@ -181,7 +181,7 @@ const mp_obj_property_t audiomp3_mp3file_sample_rate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| bits_per_sample: int = ... +//| bits_per_sample: int //| """Bits per sample. (read only)""" //| STATIC mp_obj_t audiomp3_mp3file_obj_get_bits_per_sample(mp_obj_t self_in) { @@ -198,7 +198,7 @@ const mp_obj_property_t audiomp3_mp3file_bits_per_sample_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| channel_count: int = ... +//| channel_count: int //| """Number of audio channels. (read only)""" //| STATIC mp_obj_t audiomp3_mp3file_obj_get_channel_count(mp_obj_t self_in) { @@ -215,7 +215,7 @@ const mp_obj_property_t audiomp3_mp3file_channel_count_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| rms_level: float = ... +//| rms_level: float //| """The RMS audio level of a recently played moment of audio. (read only)""" //| STATIC mp_obj_t audiomp3_mp3file_obj_get_rms_level(mp_obj_t self_in) { diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index 1d740823a9..74545a4ebb 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -39,7 +39,7 @@ //| class PWMAudioOut: //| """Output an analog audio signal by varying the PWM duty cycle.""" //| -//| def __init__(self, left_channel: microcontroller.Pin, *, right_channel: microcontroller.Pin = None, quiescent_value: int = 0x8000) -> None: +//| def __init__(self, left_channel: microcontroller.Pin, *, right_channel: Optional[microcontroller.Pin] = None, quiescent_value: int = 0x8000) -> None: //| """Create a PWMAudioOut object associated with the given pin(s). This allows you to //| play audio signals out on the given pin(s). In contrast to mod:`audioio`, //| the pin(s) specified are digital pins, and are driven with a device-dependent PWM @@ -148,7 +148,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj___exit__(size_t n_args, const mp_obj_ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiopwmio_pwmaudioout___exit___obj, 4, 4, audiopwmio_pwmaudioout_obj___exit__); -//| def play(self, sample: Union[audiocore.WaveFile, audiocore.RawSample, audiomixer.Mixer], *, loop: bool = False) -> None: +//| def play(self, sample: audiocore._AudioSample, *, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| @@ -189,7 +189,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj_stop(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiopwmio_pwmaudioout_stop_obj, audiopwmio_pwmaudioout_obj_stop); -//| playing: bool = ... +//| playing: bool //| """True when an audio sample is being output even if `paused`. (read-only)""" //| STATIC mp_obj_t audiopwmio_pwmaudioout_obj_get_playing(mp_obj_t self_in) { @@ -238,7 +238,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj_resume(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiopwmio_pwmaudioout_resume_obj, audiopwmio_pwmaudioout_obj_resume); -//| paused: bool = ... +//| paused: bool //| """True when playback is paused. (read-only)""" //| STATIC mp_obj_t audiopwmio_pwmaudioout_obj_get_paused(mp_obj_t self_in) { diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index 212956726a..28ccb4746f 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -40,7 +40,7 @@ //| class I2C: //| """Two wire serial protocol""" //| -//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int) -> None: +//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int = 255) -> None: //| """I2C is a two-wire protocol for communicating between devices. At the //| physical level it consists of 2 wires: SCL and SDA, the clock and data //| lines respectively. @@ -165,7 +165,7 @@ STATIC mp_obj_t bitbangio_i2c_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_unlock_obj, bitbangio_i2c_obj_unlock); -//| def readfrom_into(self, address: int, buffer: WriteableBuffer, *, start: int = 0, end: int = None) -> None: +//| def readfrom_into(self, address: int, buffer: WriteableBuffer, *, start: int = 0, end: Optional[int] = None) -> None: //| """Read into ``buffer`` from the device selected by ``address``. //| The number of bytes read will be the length of ``buffer``. //| At least one byte must be read. @@ -217,7 +217,7 @@ STATIC mp_obj_t bitbangio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_a } MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_readfrom_into_obj, 3, bitbangio_i2c_readfrom_into); -//| def writeto(self, address: int, buffer: ReadableBuffer, *, start: int = 0, end: int = None, stop: bool = True) -> None: +//| def writeto(self, address: int, buffer: ReadableBuffer, *, start: int = 0, end: Optional[int] = None, stop: bool = True) -> None: //| """Write the bytes from ``buffer`` to the device selected by ``address`` and then transmits a //| stop bit. Use `writeto_then_readfrom` when needing a write, no stop and repeated start //| before a read. @@ -274,7 +274,7 @@ STATIC mp_obj_t bitbangio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, m STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_writeto_obj, 1, bitbangio_i2c_writeto); -//| def writeto_then_readfrom(self, address: int, out_buffer: WriteableBuffer, in_buffer: ReadableBuffer, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: +//| def writeto_then_readfrom(self, address: int, out_buffer: WriteableBuffer, in_buffer: ReadableBuffer, *, out_start: int = 0, out_end: Optional[int] = None, in_start: int = 0, in_end: Optional[int] = None) -> None: //| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and //| ``in_buffer`` can be the same buffer because they are used sequentially. diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index 0a4d62361a..3e071ed743 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -51,7 +51,7 @@ //| multiple secondaries can share the `!clock`, `!MOSI` and `!MISO` lines //| and therefore the hardware.)""" //| -//| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None) -> None: +//| def __init__(self, clock: microcontroller.Pin, MOSI: Optional[microcontroller.Pin] = None, MISO: Optional[microcontroller.Pin] = None) -> None: //| """Construct an SPI object on the given pins. //| //| .. seealso:: Using this class directly requires careful lock management. @@ -248,7 +248,7 @@ STATIC mp_obj_t bitbangio_spi_readinto(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitbangio_spi_readinto_obj, 2, 2, bitbangio_spi_readinto); -//| def write_readinto(self, buffer_out: ReadableBuffer, buffer_in: WriteableBuffer, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: +//| def write_readinto(self, buffer_out: ReadableBuffer, buffer_in: WriteableBuffer, *, out_start: int = 0, out_end: Optional[int] = None, in_start: int = 0, in_end: Optional[int] = None) -> None: //| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. //| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` //| must be equal. diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 8a0414b5a0..4a5d39c52a 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -175,7 +175,7 @@ STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock); -//| def readfrom_into(self, address: int, buffer: WriteableBuffer, *, start: int = 0, end: int = None) -> None: +//| def readfrom_into(self, address: int, buffer: WriteableBuffer, *, start: int = 0, end: Optional[int] = None) -> None: //| """Read into ``buffer`` from the device selected by ``address``. //| The number of bytes read will be the length of ``buffer``. //| At least one byte must be read. @@ -227,7 +227,7 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args, } MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_into); -//| def writeto(self, address: int, buffer: ReadableBuffer, *, start: int = 0, end: int = None, stop: bool = True) -> None: +//| def writeto(self, address: int, buffer: ReadableBuffer, *, start: int = 0, end: Optional[int] = None, stop: bool = True) -> None: //| """Write the bytes from ``buffer`` to the device selected by ``address`` and //| then transmit a stop bit. //| @@ -235,7 +235,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_in //| as if ``buffer[start:end]``. This will not cause an allocation like //| ``buffer[start:end]`` will so it saves memory. //| -//| riting a buffer or slice of length zero is permitted, as it can be used +//| Writing a buffer or slice of length zero is permitted, as it can be used //| to poll for the existence of a device. //| //| :param int address: 7-bit device address @@ -281,12 +281,12 @@ STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_ma } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto); -//| def writeto_then_readfrom(self, address: int, out_buffer: ReadableBuffer, in_buffer: WriteableBuffer, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None: +//| def writeto_then_readfrom(self, address: int, out_buffer: ReadableBuffer, in_buffer: WriteableBuffer, *, out_start: int = 0, out_end: Optional[int] = None, in_start: int = 0, in_end: Optional[int] = None) -> None: //| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and //| ``in_buffer`` can be the same buffer because they are used sequentially. //| -//| f ``start`` or ``end`` is provided, then the corresponding buffer will be sliced +//| if ``start`` or ``end`` is provided, then the corresponding buffer will be sliced //| as if ``buffer[start:end]``. This will not cause an allocation like ``buf[start:end]`` //| will so it saves memory. //| diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 173f8aa6df..93dc64d50b 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -53,7 +53,7 @@ //| multiple secondaries can share the `!clock`, `!MOSI` and `!MISO` lines //| and therefore the hardware.)""" //| -//| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None) -> None: +//| def __init__(self, clock: microcontroller.Pin, MOSI: Optional[microcontroller.Pin] = None, MISO: Optional[microcontroller.Pin] = None) -> None: //| //| """Construct an SPI object on the given pins. //| @@ -153,7 +153,7 @@ STATIC void check_for_deinit(busio_spi_obj_t *self) { //| or second (1). Rising or falling depends on clock polarity. //| :param int bits: the number of bits per word //| -//| .. note:: On the SAMD21, it is possible to set the baudrate to 24 MHz, but that +//| .. note:: On the SAMD21, it is possible to set the baudrate to 24 MHz, but that //| speed is not guaranteed to work. 12 MHz is the next available lower speed, and is //| within spec for the SAMD21. //| @@ -270,7 +270,7 @@ STATIC mp_obj_t busio_spi_write(size_t n_args, const mp_obj_t *pos_args, mp_map_ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_obj, 2, busio_spi_write); -//| def readinto(self, buffer: bytearray, *, start: int = 0, end: Optional[int] = None, write_value: int = 0) -> None: +//| def readinto(self, buffer: WriteableBuffer, *, start: int = 0, end: Optional[int] = None, write_value: int = 0) -> None: //| """Read into ``buffer`` while writing ``write_value`` for each byte read. //| The SPI object must be locked. //| If the number of bytes to read is 0, nothing happens. @@ -377,7 +377,7 @@ STATIC mp_obj_t busio_spi_write_readinto(size_t n_args, const mp_obj_t *pos_args } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_readinto_obj, 2, busio_spi_write_readinto); -//| frequency: int = ... +//| frequency: int //| """The actual SPI bus frequency. This may not match the frequency requested //| due to internal limitations.""" //| diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index c4e1f51348..bf0b7e721d 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -44,7 +44,7 @@ //| class UART: //| """A bidirectional serial protocol""" -//| def __init__(self, tx: microcontroller.Pin, rx: microcontroller.Pin, *, baudrate: int = 9600, bits: int = 8, parity: Parity = None, stop: int = 1, timeout: float = 1, receiver_buffer_size: int = 64) -> None: +//| def __init__(self, tx: microcontroller.Pin, rx: microcontroller.Pin, *, baudrate: int = 9600, bits: int = 8, parity: Optional[Parity] = None, stop: int = 1, timeout: float = 1, receiver_buffer_size: int = 64) -> None: //| """A common bidirectional serial protocol that uses an an agreed upon speed //| rather than a shared clock line. //| @@ -263,7 +263,7 @@ STATIC mp_uint_t busio_uart_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint_t return ret; } -//| baudrate: int = ... +//| baudrate: int //| """The current baudrate.""" //| STATIC mp_obj_t busio_uart_obj_get_baudrate(mp_obj_t self_in) { @@ -289,7 +289,7 @@ const mp_obj_property_t busio_uart_baudrate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| in_waiting: int = ... +//| in_waiting: int //| """The number of bytes in the input buffer, available to be read""" //| STATIC mp_obj_t busio_uart_obj_get_in_waiting(mp_obj_t self_in) { @@ -306,7 +306,7 @@ const mp_obj_property_t busio_uart_in_waiting_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| timeout: float = ... +//| timeout: float //| """The current timeout, in seconds (float).""" //| STATIC mp_obj_t busio_uart_obj_get_timeout(mp_obj_t self_in) { @@ -349,10 +349,10 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(busio_uart_reset_input_buffer_obj, busio_uart_o //| class Parity: //| """Enum-like class to define the parity used to verify correct data transfer.""" //| -//| ODD: int = ... +//| ODD: int //| """Total number of ones should be odd.""" //| -//| EVEN: int = ... +//| EVEN: int //| """Total number of ones should be even.""" //| const mp_obj_type_t busio_uart_parity_type; diff --git a/shared-bindings/countio/Counter.c b/shared-bindings/countio/Counter.c index 616307a4bc..e51db26440 100644 --- a/shared-bindings/countio/Counter.c +++ b/shared-bindings/countio/Counter.c @@ -86,7 +86,7 @@ STATIC mp_obj_t countio_counter_obj___exit__(size_t n_args, const mp_obj_t *args STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(countio_counter___exit___obj, 4, 4, countio_counter_obj___exit__); -//| count: int = ... +//| count: int //| """The current count in terms of pulses.""" //| STATIC mp_obj_t countio_counter_obj_get_count(mp_obj_t self_in) { diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index e37f57220c..351e122e0a 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -106,7 +106,7 @@ STATIC void check_for_deinit(digitalio_digitalinout_obj_t *self) { } } -//| def switch_to_output(self, value: bool = False, drive_mode: digitalio.DriveMode = digitalio.DriveMode.PUSH_PULL) -> None: +//| def switch_to_output(self, value: bool = False, drive_mode: DriveMode = DriveMode.PUSH_PULL) -> None: //| """Set the drive mode and value and then switch to writing out digital //| values. //| @@ -139,7 +139,7 @@ STATIC mp_obj_t digitalio_digitalinout_switch_to_output(size_t n_args, const mp_ } MP_DEFINE_CONST_FUN_OBJ_KW(digitalio_digitalinout_switch_to_output_obj, 1, digitalio_digitalinout_switch_to_output); -//| def switch_to_input(self, pull: Pull = None) -> None: +//| def switch_to_input(self, pull: Optional[Pull] = None) -> None: //| """Set the pull and then switch to read in digital values. //| //| :param Pull pull: pull configuration for the input @@ -179,7 +179,7 @@ STATIC mp_obj_t digitalio_digitalinout_switch_to_input(size_t n_args, const mp_o } MP_DEFINE_CONST_FUN_OBJ_KW(digitalio_digitalinout_switch_to_input_obj, 1, digitalio_digitalinout_switch_to_input); -//| direction: Direction = ... +//| direction: Direction //| """The direction of the pin. //| //| Setting this will use the defaults from the corresponding @@ -228,7 +228,7 @@ const mp_obj_property_t digitalio_digitalio_direction_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| value: bool = ... +//| value: bool //| """The digital logic level of the pin.""" //| STATIC mp_obj_t digitalio_digitalinout_obj_get_value(mp_obj_t self_in) { @@ -258,7 +258,7 @@ const mp_obj_property_t digitalio_digitalinout_value_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| drive_mode: DriveMode = ... +//| drive_mode: DriveMode //| """The pin drive mode. One of: //| //| - `digitalio.DriveMode.PUSH_PULL` @@ -302,7 +302,7 @@ const mp_obj_property_t digitalio_digitalio_drive_mode_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| pull: Optional[Pull] = ... +//| pull: Optional[Pull] //| """The pin pull direction. One of: //| //| - `digitalio.Pull.UP` diff --git a/shared-bindings/digitalio/Direction.c b/shared-bindings/digitalio/Direction.c index 173ebfb2b4..0c2448ca9a 100644 --- a/shared-bindings/digitalio/Direction.c +++ b/shared-bindings/digitalio/Direction.c @@ -46,10 +46,10 @@ //| going.""" //| ... //| -//| INPUT: Direction = ... +//| INPUT: Direction //| """Read digital data in""" //| -//| OUTPUT: Direction = ... +//| OUTPUT: Direction //| """Write digital data out""" //| const mp_obj_type_t digitalio_direction_type; diff --git a/shared-bindings/digitalio/DriveMode.c b/shared-bindings/digitalio/DriveMode.c index 2f22029b0b..39b940d7f9 100644 --- a/shared-bindings/digitalio/DriveMode.c +++ b/shared-bindings/digitalio/DriveMode.c @@ -34,10 +34,10 @@ //| digital values.""" //| ... //| -//| PUSH_PULL: DriveMode = ... +//| PUSH_PULL: DriveMode //| """Output both high and low digital values""" //| -//| OPEN_DRAIN: DriveMode = ... +//| OPEN_DRAIN: DriveMode //| """Output low digital values but go into high z for digital high. This is //| useful for i2c and other protocols that share a digital line.""" //| diff --git a/shared-bindings/digitalio/Pull.c b/shared-bindings/digitalio/Pull.c index 87e2a8f1ee..ed08b0f6bc 100644 --- a/shared-bindings/digitalio/Pull.c +++ b/shared-bindings/digitalio/Pull.c @@ -34,11 +34,11 @@ //| digital values in.""" //| ... //| -//| UP: Pull = ... +//| UP: Pull //| """When the input line isn't being driven the pull up can pull the state //| of the line high so it reads as true.""" //| -//| DOWN: Pull = ... +//| DOWN: Pull //| """When the input line isn't being driven the pull down can pull the //| state of the line low so it reads as false.""" //| diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index b2cda21536..65d80fba62 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -73,7 +73,7 @@ STATIC mp_obj_t displayio_bitmap_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| width: int = ... +//| width: int //| """Width of the bitmap. (read only)""" //| STATIC mp_obj_t displayio_bitmap_obj_get_width(mp_obj_t self_in) { @@ -91,7 +91,7 @@ const mp_obj_property_t displayio_bitmap_width_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| height: int = ... +//| height: int //| """Height of the bitmap. (read only)""" //| STATIC mp_obj_t displayio_bitmap_obj_get_height(mp_obj_t self_in) { diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index 17eed1a9b1..a2b6699efc 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -84,7 +84,7 @@ STATIC mp_obj_t displayio_colorconverter_obj_convert(mp_obj_t self_in, mp_obj_t } MP_DEFINE_CONST_FUN_OBJ_2(displayio_colorconverter_convert_obj, displayio_colorconverter_obj_convert); -//| dither: bool = ... +//| dither: bool //| """When true the color converter dithers the output by adding random noise when //| truncating to display bitdepth""" //| diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 2d2b92325c..70e29ff3e0 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -39,6 +39,11 @@ #include "shared-module/displayio/__init__.h" #include "supervisor/shared/translate.h" +//| _DisplayBus = Union[FourWire, ParallelBus, I2CDisplay] +//| """:py:class:`FourWire`, :py:class:`ParallelBus` or :py:class:`I2CDisplay`""" +//| + +//| //| class Display: //| """Manage updating a display over a display bus //| @@ -49,8 +54,8 @@ //| Most people should not use this class directly. Use a specific display driver instead that will //| contain the initialization sequence at minimum.""" //| -//| def __init__(self, display_bus: Union[FourWire, ParallelBus], init_sequence: ReadableBuffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: Optional[microcontroller.Pin] = None, brightness_command: int = None, brightness: bool = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60) -> None: -//| r"""Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). +//| def __init__(self, display_bus: _DisplayBus, init_sequence: ReadableBuffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: Optional[microcontroller.Pin] = None, brightness_command: Optional[int] = None, brightness: float = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60) -> None: +//| r"""Create a Display object on the given display bus (`FourWire`, `ParallelBus` or `I2CDisplay`). //| //| The ``init_sequence`` is bitpacked to minimize the ram impact. Every command begins with a //| command byte followed by a byte to determine the parameter count and if a delay is need after. @@ -76,7 +81,7 @@ //| of the display to minimize tearing artifacts. //| //| :param display_bus: The bus that the display is connected to -//| :type display_bus: displayio.FourWire or displayio.ParallelBus +//| :type display_bus: FourWire, ParallelBus or I2CDisplay //| :param buffer init_sequence: Byte-packed initialization sequence. //| :param int width: Width in pixels //| :param int height: Height in pixels @@ -96,7 +101,7 @@ //| :param int set_vertical_scroll: Command used to set the first row to show //| :param microcontroller.Pin backlight_pin: Pin connected to the display's backlight //| :param int brightness_command: Command to set display brightness. Usually available in OLED controllers. -//| :param bool brightness: Initial display brightness. This value is ignored if auto_brightness is True. +//| :param float brightness: Initial display brightness. This value is ignored if auto_brightness is True. //| :param bool auto_brightness: If True, brightness is controlled via an ambient light sensor or other mechanism. //| :param bool single_byte_bounds: Display column and row commands use single bytes //| :param bool data_as_commands: Treat all init and boundary data as SPI commands. Certain displays require this. @@ -245,7 +250,7 @@ STATIC mp_obj_t displayio_display_obj_refresh(size_t n_args, const mp_obj_t *pos } MP_DEFINE_CONST_FUN_OBJ_KW(displayio_display_refresh_obj, 1, displayio_display_obj_refresh); -//| auto_refresh: None = ... +//| auto_refresh: bool //| """True when the display is refreshed automatically.""" //| STATIC mp_obj_t displayio_display_obj_get_auto_refresh(mp_obj_t self_in) { @@ -270,7 +275,7 @@ const mp_obj_property_t displayio_display_auto_refresh_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| brightness: float = ... +//| brightness: float //| """The brightness of the display as a float. 0.0 is off and 1.0 is full brightness. When //| `auto_brightness` is True, the value of `brightness` will change automatically. //| If `brightness` is set, `auto_brightness` will be disabled and will be set to False.""" @@ -307,7 +312,7 @@ const mp_obj_property_t displayio_display_brightness_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| auto_brightness: Optional[bool] = ... +//| auto_brightness: bool //| """True when the display brightness is adjusted automatically, based on an ambient //| light sensor or other method. Note that some displays may have this set to True by default, //| but not actually implement automatic brightness adjustment. `auto_brightness` is set to False @@ -338,7 +343,7 @@ const mp_obj_property_t displayio_display_auto_brightness_obj = { -//| width: int = ... +//| width: int //| Gets the width of the board //| STATIC mp_obj_t displayio_display_obj_get_width(mp_obj_t self_in) { @@ -354,7 +359,7 @@ const mp_obj_property_t displayio_display_width_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| height: int = ... +//| height: int //| """Gets the height of the board""" //| STATIC mp_obj_t displayio_display_obj_get_height(mp_obj_t self_in) { @@ -370,7 +375,7 @@ const mp_obj_property_t displayio_display_height_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| rotation: int = ... +//| rotation: int //| """The rotation of the display as an int in degrees.""" //| STATIC mp_obj_t displayio_display_obj_get_rotation(mp_obj_t self_in) { @@ -393,7 +398,7 @@ const mp_obj_property_t displayio_display_rotation_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| bus: Union[ParallelBus, FourWire, I2CDisplay] = ... +//| bus: _DisplayBus //| """The bus being used by the display""" //| //| @@ -411,7 +416,7 @@ const mp_obj_property_t displayio_display_bus_obj = { }; -//| def fill_row(self, y: int, buffer: WriteableBuffer) -> bytearray: +//| def fill_row(self, y: int, buffer: WriteableBuffer) -> WriteableBuffer: //| """Extract the pixels from a single row //| //| :param int y: The top edge of the area diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index 9bfc6b05d2..ee1586fe67 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -49,7 +49,7 @@ //| Most people should not use this class directly. Use a specific display driver instead that will //| contain the startup and shutdown sequences at minimum.""" //| -//| def __init__(self, display_bus: displayio, start_sequence: ReadableBuffer, stop_sequence: ReadableBuffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: Optional[int] = None, set_row_window_command: Optional[int] = None, single_byte_bounds: bool = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: Optional[int] = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: Optional[microcontroller.Pin] = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False) -> None: +//| def __init__(self, display_bus: _DisplayBus, start_sequence: ReadableBuffer, stop_sequence: ReadableBuffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: Optional[int] = None, set_row_window_command: Optional[int] = None, single_byte_bounds: bool = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: Optional[int] = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: Optional[microcontroller.Pin] = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False) -> None: //| """Create a EPaperDisplay object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). //| //| The ``start_sequence`` and ``stop_sequence`` are bitpacked to minimize the ram impact. Every @@ -205,7 +205,7 @@ STATIC mp_obj_t displayio_epaperdisplay_obj_refresh(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_refresh_obj, displayio_epaperdisplay_obj_refresh); -//| time_to_refresh: float = ... +//| time_to_refresh: float //| """Time, in fractional seconds, until the ePaper display can be refreshed.""" //| STATIC mp_obj_t displayio_epaperdisplay_obj_get_time_to_refresh(mp_obj_t self_in) { @@ -221,7 +221,7 @@ const mp_obj_property_t displayio_epaperdisplay_time_to_refresh_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| width: int = ... +//| width: int //| """Gets the width of the display in pixels""" //| STATIC mp_obj_t displayio_epaperdisplay_obj_get_width(mp_obj_t self_in) { @@ -237,7 +237,7 @@ const mp_obj_property_t displayio_epaperdisplay_width_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| height: int = ... +//| height: int //| """Gets the height of the display in pixels""" //| STATIC mp_obj_t displayio_epaperdisplay_obj_get_height(mp_obj_t self_in) { @@ -253,7 +253,7 @@ const mp_obj_property_t displayio_epaperdisplay_height_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| bus: displayio = ... +//| bus: _DisplayBus //| """The bus being used by the display""" //| STATIC mp_obj_t displayio_epaperdisplay_obj_get_bus(mp_obj_t self_in) { diff --git a/shared-bindings/displayio/FourWire.c b/shared-bindings/displayio/FourWire.c index 83d260c0f6..455d22e725 100644 --- a/shared-bindings/displayio/FourWire.c +++ b/shared-bindings/displayio/FourWire.c @@ -42,7 +42,7 @@ //| """Manage updating a display over SPI four wire protocol in the background while Python code runs. //| It doesn't handle display initialization.""" //| -//| def __init__(self, spi_bus: busio.SPI, *, command: microcontroller.Pin, chip_select: microcontroller.Pin, reset: microcontroller.Pin = None, baudrate: int = 24000000, polarity: int = 0, phase: int = 0) -> None: +//| def __init__(self, spi_bus: busio.SPI, *, command: microcontroller.Pin, chip_select: microcontroller.Pin, reset: Optional[microcontroller.Pin] = None, baudrate: int = 24000000, polarity: int = 0, phase: int = 0) -> None: //| """Create a FourWire object associated with the given pins. //| //| The SPI bus and pins are then in use by the display until `displayio.release_displays()` is diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index 31affc6b6a..31d4f5b91a 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -86,7 +86,7 @@ displayio_group_t* native_group(mp_obj_t group_obj) { return MP_OBJ_TO_PTR(native_group); } -//| hidden: bool = ... +//| hidden: bool //| """True when the Group and all of it's layers are not visible. When False, the Group's layers //| are visible if they haven't been hidden.""" //| @@ -111,7 +111,7 @@ const mp_obj_property_t displayio_group_hidden_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| scale: int = ... +//| scale: int //| """Scales each pixel within the Group in both directions. For example, when scale=2 each pixel //| will be represented by 2x2 pixels.""" //| @@ -140,7 +140,7 @@ const mp_obj_property_t displayio_group_scale_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| x: int = ... +//| x: int //| """X position of the Group in the parent.""" //| STATIC mp_obj_t displayio_group_obj_get_x(mp_obj_t self_in) { @@ -165,7 +165,7 @@ const mp_obj_property_t displayio_group_x_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| y: int = ... +//| y: int //| """Y position of the Group in the parent.""" //| STATIC mp_obj_t displayio_group_obj_get_y(mp_obj_t self_in) { diff --git a/shared-bindings/displayio/I2CDisplay.c b/shared-bindings/displayio/I2CDisplay.c index c8b6702a15..5dc4711b3b 100644 --- a/shared-bindings/displayio/I2CDisplay.c +++ b/shared-bindings/displayio/I2CDisplay.c @@ -42,7 +42,7 @@ //| """Manage updating a display over I2C in the background while Python code runs. //| It doesn't handle display initialization.""" //| -//| def __init__(self, i2c_bus: busio.I2C, *, device_address: int, reset: microcontroller.Pin = None) -> None: +//| def __init__(self, i2c_bus: busio.I2C, *, device_address: int, reset: Optional[microcontroller.Pin] = None) -> None: //| """Create a I2CDisplay object associated with the given I2C bus and reset pin. //| //| The I2C bus and pins are then in use by the display until `displayio.release_displays()` is diff --git a/shared-bindings/displayio/OnDiskBitmap.c b/shared-bindings/displayio/OnDiskBitmap.c index 8a4cb8e743..938e408ab5 100644 --- a/shared-bindings/displayio/OnDiskBitmap.c +++ b/shared-bindings/displayio/OnDiskBitmap.c @@ -89,7 +89,7 @@ STATIC mp_obj_t displayio_ondiskbitmap_make_new(const mp_obj_type_t *type, size_ return MP_OBJ_FROM_PTR(self); } -//| width: int = ... +//| width: int //| """Width of the bitmap. (read only)""" //| STATIC mp_obj_t displayio_ondiskbitmap_obj_get_width(mp_obj_t self_in) { @@ -108,7 +108,7 @@ const mp_obj_property_t displayio_ondiskbitmap_width_obj = { }; -//| height: int = ... +//| height: int //| """Height of the bitmap. (read only)""" //| STATIC mp_obj_t displayio_ondiskbitmap_obj_get_height(mp_obj_t self_in) { diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c index e03a46dbaf..73a08f5567 100644 --- a/shared-bindings/displayio/TileGrid.c +++ b/shared-bindings/displayio/TileGrid.c @@ -48,15 +48,15 @@ //| //| A single tile grid is also known as a Sprite.""" //| -//| def __init__(self, bitmap: Bitmap, *, pixel_shader: Palette, width: int = 1, height: int = 1, tile_width: int = None, tile_height: int = None, default_tile: int = 0, x: int = 0, y: int = 0) -> None: +//| def __init__(self, bitmap: Bitmap, *, pixel_shader: Union[ColorConverter, Palette], width: int = 1, height: int = 1, tile_width: Optional[int] = None, tile_height: Optional[int] = None, default_tile: int = 0, x: int = 0, y: int = 0) -> None: //| """Create a TileGrid object. The bitmap is source for 2d pixels. The pixel_shader is used to //| convert the value and its location to a display native pixel color. This may be a simple color //| palette lookup, a gradient, a pattern or a color transformer. //| //| tile_width and tile_height match the height of the bitmap by default. //| -//| :param displayio.Bitmap bitmap: The bitmap storing one or more tiles. -//| :param displayio.Palette pixel_shader: The pixel shader that produces colors from values +//| :param Bitmap bitmap: The bitmap storing one or more tiles. +//| :param ColorConverter or Palette pixel_shader: The pixel shader that produces colors from values //| :param int width: Width of the grid in tiles. //| :param int height: Height of the grid in tiles. //| :param int tile_width: Width of a single tile in pixels. Defaults to the full Bitmap and must evenly divide into the Bitmap's dimensions. @@ -141,7 +141,7 @@ static displayio_tilegrid_t* native_tilegrid(mp_obj_t tilegrid_obj) { mp_obj_assert_native_inited(native_tilegrid); return MP_OBJ_TO_PTR(native_tilegrid); } -//| hidden: bool = ... +//| hidden: bool //| """True when the TileGrid is hidden. This may be False even when a part of a hidden Group.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_hidden(mp_obj_t self_in) { @@ -165,7 +165,7 @@ const mp_obj_property_t displayio_tilegrid_hidden_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| x: int = ... +//| x: int //| """X position of the left edge in the parent.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_x(mp_obj_t self_in) { @@ -190,7 +190,7 @@ const mp_obj_property_t displayio_tilegrid_x_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| y: int = ... +//| y: int //| """Y position of the top edge in the parent.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_y(mp_obj_t self_in) { @@ -215,7 +215,7 @@ const mp_obj_property_t displayio_tilegrid_y_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| flip_x: bool = ... +//| flip_x: bool //| """If true, the left edge rendered will be the right edge of the right-most tile.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_flip_x(mp_obj_t self_in) { @@ -239,7 +239,7 @@ const mp_obj_property_t displayio_tilegrid_flip_x_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| flip_y: bool = ... +//| flip_y: bool //| """If true, the top edge rendered will be the bottom edge of the bottom-most tile.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_flip_y(mp_obj_t self_in) { @@ -264,7 +264,7 @@ const mp_obj_property_t displayio_tilegrid_flip_y_obj = { }; -//| transpose_xy: bool = ... +//| transpose_xy: bool //| """If true, the TileGrid's axis will be swapped. When combined with mirroring, any 90 degree //| rotation can be achieved along with the corresponding mirrored version.""" //| @@ -289,7 +289,7 @@ const mp_obj_property_t displayio_tilegrid_transpose_xy_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| pixel_shader: Union[ColorConverter, Palette] = ... +//| pixel_shader: Union[ColorConverter, Palette] //| """The pixel shader of the tilegrid.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_pixel_shader(mp_obj_t self_in) { @@ -326,7 +326,7 @@ const mp_obj_property_t displayio_tilegrid_pixel_shader_obj = { //| print(grid[0])""" //| ... //| -//| def __setitem__(self, index: Union[Tuple[int, int], int], tile_index: int) -> None: +//| def __setitem__(self, index: Union[Tuple[int, int], int], value: int) -> None: //| """Sets the tile index at the given index. The index can either be an x,y tuple or an int equal //| to ``y * width + x``. //| diff --git a/shared-bindings/fontio/BuiltinFont.c b/shared-bindings/fontio/BuiltinFont.c index 5eaae624ea..8ae2356bbf 100644 --- a/shared-bindings/fontio/BuiltinFont.c +++ b/shared-bindings/fontio/BuiltinFont.c @@ -46,7 +46,7 @@ //| ... //| -//| bitmap: displayio.Bitmap = ... +//| bitmap: displayio.Bitmap //| """Bitmap containing all font glyphs starting with ASCII and followed by unicode. Use //| `get_glyph` in most cases. This is useful for use with `displayio.TileGrid` and //| `terminalio.Terminal`.""" diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index 8c19603422..e29718fdf3 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -151,7 +151,7 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_obj_refresh(size_t n_args, cons } MP_DEFINE_CONST_FUN_OBJ_KW(framebufferio_framebufferdisplay_refresh_obj, 1, framebufferio_framebufferdisplay_obj_refresh); -//| auto_refresh: bool = ... +//| auto_refresh: bool //| """True when the display is refreshed automatically.""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_auto_refresh(mp_obj_t self_in) { @@ -176,7 +176,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_auto_refresh_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| brightness: float = ... +//| brightness: float //| """The brightness of the display as a float. 0.0 is off and 1.0 is full brightness. When //| `auto_brightness` is True, the value of `brightness` will change automatically. //| If `brightness` is set, `auto_brightness` will be disabled and will be set to False.""" @@ -213,7 +213,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_brightness_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| auto_brightness: bool = ... +//| auto_brightness: bool //| """True when the display brightness is adjusted automatically, based on an ambient //| light sensor or other method. Note that some displays may have this set to True by default, //| but not actually implement automatic brightness adjustment. `auto_brightness` is set to False @@ -244,7 +244,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_auto_brightness_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| width: int = ... +//| width: int //| """Gets the width of the framebuffer""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_width(mp_obj_t self_in) { @@ -260,7 +260,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_width_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| height: int = ... +//| height: int //| """Gets the height of the framebuffer""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_height(mp_obj_t self_in) { @@ -276,7 +276,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_height_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| rotation: int = ... +//| rotation: int //| """The rotation of the display as an int in degrees.""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_rotation(mp_obj_t self_in) { @@ -299,7 +299,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_rotation_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| framebuffer: rgbmatrix.RGBMatrix = ... +//| framebuffer: rgbmatrix.RGBMatrix //| """The framebuffer being used by the display""" //| //| diff --git a/shared-bindings/frequencyio/FrequencyIn.c b/shared-bindings/frequencyio/FrequencyIn.c index 5f99b166c7..8b0e2b41c9 100644 --- a/shared-bindings/frequencyio/FrequencyIn.c +++ b/shared-bindings/frequencyio/FrequencyIn.c @@ -169,7 +169,7 @@ STATIC mp_obj_t frequencyio_frequencyin_obj_clear(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(frequencyio_frequencyin_clear_obj, frequencyio_frequencyin_obj_clear); -//| capture_period: int = ... +//| capture_period: int //| """The capture measurement period. Lower incoming frequencies will be measured //| more accurately with longer capture periods. Higher frequencies are more //| accurate with shorter capture periods. diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c index 72aa71b8d3..087c353953 100644 --- a/shared-bindings/gnss/GNSS.c +++ b/shared-bindings/gnss/GNSS.c @@ -31,10 +31,10 @@ //| print("Longitude: {0:.6f} degrees".format(nav.longitude))""" //| -//| def __init__(self) -> None: +//| def __init__(self, system: Union[SatelliteSystem, List[SatelliteSystem]]) -> None: //| """Turn on the GNSS. //| -//| :param gnss.SatelliteSystem system: satellite system to use""" +//| :param system: satellite system to use""" //| ... //| STATIC mp_obj_t gnss_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -98,7 +98,7 @@ STATIC mp_obj_t gnss_obj_update(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(gnss_update_obj, gnss_obj_update); -//| latitude: float = ... +//| latitude: float //| """Latitude of current position in degrees (float).""" //| STATIC mp_obj_t gnss_obj_get_latitude(mp_obj_t self_in) { @@ -115,7 +115,7 @@ const mp_obj_property_t gnss_latitude_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| longitude: float = ... +//| longitude: float //| """Longitude of current position in degrees (float).""" //| STATIC mp_obj_t gnss_obj_get_longitude(mp_obj_t self_in) { @@ -132,7 +132,7 @@ const mp_obj_property_t gnss_longitude_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| altitude: float = ... +//| altitude: float //| """Altitude of current position in meters (float).""" //| STATIC mp_obj_t gnss_obj_get_altitude(mp_obj_t self_in) { @@ -149,7 +149,7 @@ const mp_obj_property_t gnss_altitude_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| timestamp: time.struct_time = ... +//| timestamp: time.struct_time //| """Time when the position data was updated.""" //| STATIC mp_obj_t gnss_obj_get_timestamp(mp_obj_t self_in) { @@ -168,7 +168,7 @@ const mp_obj_property_t gnss_timestamp_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| fix: PositionFix = ... +//| fix: PositionFix //| """Fix mode.""" //| STATIC mp_obj_t gnss_obj_get_fix(mp_obj_t self_in) { diff --git a/shared-bindings/gnss/PositionFix.c b/shared-bindings/gnss/PositionFix.c index 7a69dfece8..e60611d705 100644 --- a/shared-bindings/gnss/PositionFix.c +++ b/shared-bindings/gnss/PositionFix.c @@ -10,13 +10,13 @@ //| def __init__(self) -> None: //| """Enum-like class to define the position fix mode.""" //| -//| INVALID: PositionFix = ... +//| INVALID: PositionFix //| """No measurement.""" //| -//| FIX_2D: PositionFix = ... +//| FIX_2D: PositionFix //| """2D fix.""" //| -//| FIX_3D: PositionFix = ... +//| FIX_3D: PositionFix //| """3D fix.""" //| const mp_obj_type_t gnss_positionfix_type; diff --git a/shared-bindings/i2cperipheral/I2CPeripheral.c b/shared-bindings/i2cperipheral/I2CPeripheral.c index b528ca9c39..cfebd472ee 100644 --- a/shared-bindings/i2cperipheral/I2CPeripheral.c +++ b/shared-bindings/i2cperipheral/I2CPeripheral.c @@ -259,7 +259,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_obj___exit__(size_t n_args, } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral_request___exit___obj, 4, 4, i2cperipheral_i2c_peripheral_request_obj___exit__); -//| address: int = ... +//| address: int //| """The I2C address of the request.""" //| STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_address(mp_obj_t self_in) { @@ -269,7 +269,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_address(mp_obj_t self_i } MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_address_obj, i2cperipheral_i2c_peripheral_request_get_address); -//| is_read: bool = ... +//| is_read: bool //| """The I2C main controller is reading from this peripheral.""" //| STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_is_read(mp_obj_t self_in) { @@ -279,7 +279,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_is_read(mp_obj_t self_i } MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_is_read_obj, i2cperipheral_i2c_peripheral_request_get_is_read); -//| is_restart: bool = ... +//| is_restart: bool //| """Is Repeated Start Condition.""" //| STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_is_restart(mp_obj_t self_in) { @@ -349,7 +349,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_read(size_t n_args, const m } MP_DEFINE_CONST_FUN_OBJ_KW(i2cperipheral_i2c_peripheral_request_read_obj, 1, i2cperipheral_i2c_peripheral_request_read); -//| def write(self, buffer: bytearray) -> int: +//| def write(self, buffer: ReadableBuffer) -> int: //| """Write the data contained in buffer. //| //| :param buffer: Write out the data in this buffer diff --git a/shared-bindings/memorymonitor/AllocationSize.c b/shared-bindings/memorymonitor/AllocationSize.c index a7d14e4f55..b35bae3602 100644 --- a/shared-bindings/memorymonitor/AllocationSize.c +++ b/shared-bindings/memorymonitor/AllocationSize.c @@ -95,7 +95,7 @@ STATIC mp_obj_t memorymonitor_allocationsize_obj___exit__(size_t n_args, const m } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(memorymonitor_allocationsize___exit___obj, 4, 4, memorymonitor_allocationsize_obj___exit__); -//| bytes_per_block: int = ... +//| bytes_per_block: int //| """Number of bytes per block""" //| STATIC mp_obj_t memorymonitor_allocationsize_obj_get_bytes_per_block(mp_obj_t self_in) { diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index 931c0b4c45..1294b78f00 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -39,7 +39,7 @@ //| def __init__(self) -> None: //| """Identifies an IO pin on the microcontroller. They are fixed by the //| hardware so they cannot be constructed on demand. Instead, use -//| `board` or `microcontroller.pin` to reference the desired pin.""" +//| :mod:`board` or :mod:`microcontroller.pin` to reference the desired pin.""" //| ... //| diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c index d9f780f846..8c703891d7 100644 --- a/shared-bindings/microcontroller/Processor.c +++ b/shared-bindings/microcontroller/Processor.c @@ -50,7 +50,7 @@ //| ... //| -//| frequency: int = ... +//| frequency: int //| """The CPU operating frequency in Hertz. (read-only)""" //| STATIC mp_obj_t mcu_processor_get_frequency(mp_obj_t self) { @@ -67,7 +67,7 @@ const mp_obj_property_t mcu_processor_frequency_obj = { }, }; -//| temperature: Optional[float] = ... +//| temperature: Optional[float] //| """The on-chip temperature, in Celsius, as a float. (read-only) //| //| Is `None` if the temperature is not available.""" @@ -87,7 +87,7 @@ const mp_obj_property_t mcu_processor_temperature_obj = { }, }; -//| uid: bytearray = ... +//| uid: bytearray //| """The unique id (aka serial number) of the chip as a `bytearray`. (read-only)""" //| STATIC mp_obj_t mcu_processor_get_uid(mp_obj_t self) { @@ -106,7 +106,7 @@ const mp_obj_property_t mcu_processor_uid_obj = { }, }; -//| voltage: Optional[float] = ... +//| voltage: Optional[float] //| """The input voltage to the microcontroller, as a float. (read-only) //| //| Is `None` if the voltage is not available.""" diff --git a/shared-bindings/microcontroller/RunMode.c b/shared-bindings/microcontroller/RunMode.c index 38bbb612b0..a54f40cac8 100644 --- a/shared-bindings/microcontroller/RunMode.c +++ b/shared-bindings/microcontroller/RunMode.c @@ -33,18 +33,18 @@ //| """Enum-like class to define the run mode of the microcontroller and //| CircuitPython.""" //| -//| NORMAL: RunMode = ... +//| NORMAL: RunMode //| """Run CircuitPython as normal. //| //| :type microcontroller.RunMode:""" //| -//| SAFE_MODE: RunMode = ... +//| SAFE_MODE: RunMode //| """Run CircuitPython in safe mode. User code will not be run and the //| file system will be writeable over USB. //| //| :type microcontroller.RunMode:""" //| -//| BOOTLOADER: RunMode = ... +//| BOOTLOADER: RunMode //| """Run the bootloader. //| //| :type microcontroller.RunMode:""" diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c index a750823400..c00b1e314d 100644 --- a/shared-bindings/microcontroller/__init__.c +++ b/shared-bindings/microcontroller/__init__.c @@ -48,7 +48,7 @@ //| microcontroller. See `board` for board-specific pin mappings.""" //| -//| cpu: Processor = ... +//| cpu: Processor //| """CPU information and control, such as ``cpu.temperature`` and ``cpu.frequency`` //| (clock frequency). //| This object is the sole instance of `microcontroller.Processor`.""" @@ -133,13 +133,19 @@ STATIC mp_obj_t mcu_reset(void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(mcu_reset_obj, mcu_reset); -//| nvm: Optional[nvm.ByteArray] = ... +//| nvm: Optional[nvm.ByteArray] //| """Available non-volatile memory. //| This object is the sole instance of `nvm.ByteArray` when available or ``None`` otherwise. //| //| :type: nvm.ByteArray or None""" //| +//| watchdog: Optional[watchdog.WatchDogTimer] +//| """Available watchdog timer. +//| This object is the sole instance of `watchdog.WatchDogTimer` when available or ``None`` otherwise.""" +//| + + //| """:mod:`microcontroller.pin` --- Microcontroller pin names //| -------------------------------------------------------- //| diff --git a/shared-bindings/multiterminal/__init__.c b/shared-bindings/multiterminal/__init__.c index 0f493fe2ea..1fbeca79cc 100644 --- a/shared-bindings/multiterminal/__init__.c +++ b/shared-bindings/multiterminal/__init__.c @@ -46,7 +46,7 @@ STATIC mp_obj_t multiterminal_obj_get_secondary_terminal() { } MP_DEFINE_CONST_FUN_OBJ_0(multiterminal_get_secondary_terminal_obj, multiterminal_obj_get_secondary_terminal); -//| def set_secondary_terminal(stream: Optional[typing.BinaryIO]) -> None: +//| def set_secondary_terminal(stream: typing.BinaryIO) -> None: //| """Read additional input from the given stream and write out back to it. //| This doesn't replace the core stream (usually UART or native USB) but is //| mixed in instead. diff --git a/shared-bindings/neopixel_write/__init__.c b/shared-bindings/neopixel_write/__init__.c index f3f5c20373..8eb426c2b7 100644 --- a/shared-bindings/neopixel_write/__init__.c +++ b/shared-bindings/neopixel_write/__init__.c @@ -50,7 +50,7 @@ //| pixel_off = bytearray([0, 0, 0]) //| neopixel_write.neopixel_write(pin, pixel_off)""" //| -//| def neopixel_write(digitalinout: digitalio.DigitalInOut, buf: bytearray) -> None: +//| def neopixel_write(digitalinout: digitalio.DigitalInOut, buf: ReadableBuffer) -> None: //| """Write buf out on the given DigitalInOut. //| //| :param digitalinout: the DigitalInOut to output with diff --git a/shared-bindings/os/__init__.c b/shared-bindings/os/__init__.c index 9fad6e83df..2406dbc371 100644 --- a/shared-bindings/os/__init__.c +++ b/shared-bindings/os/__init__.c @@ -149,7 +149,7 @@ mp_obj_t os_stat(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_stat_obj, os_stat); -//| def statvfs(path: str) -> Tuple[str, str, str, str, str, str, str, str, str, str]: +//| def statvfs(path: str) -> Tuple[int, int, int, int, int, int, int, int, int, int]: //| """Get the status of a fileystem. //| //| Returns a tuple with the filesystem information in the following order: diff --git a/shared-bindings/pulseio/PWMOut.c b/shared-bindings/pulseio/PWMOut.c index 07b47c133d..e9b6c45d20 100644 --- a/shared-bindings/pulseio/PWMOut.c +++ b/shared-bindings/pulseio/PWMOut.c @@ -150,7 +150,7 @@ STATIC mp_obj_t pulseio_pwmout_obj___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pulseio_pwmout___exit___obj, 4, 4, pulseio_pwmout_obj___exit__); -//| duty_cycle: int = ... +//| duty_cycle: int //| """16 bit value that dictates how much of one cycle is high (1) versus low //| (0). 0xffff will always be high, 0 will always be low and 0x7fff will //| be half high and then half low. @@ -186,7 +186,7 @@ const mp_obj_property_t pulseio_pwmout_duty_cycle_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| frequency: int = ... +//| frequency: int //| """32 bit value that dictates the PWM frequency in Hertz (cycles per //| second). Only writeable when constructed with ``variable_frequency=True``. //| diff --git a/shared-bindings/pulseio/PulseIn.c b/shared-bindings/pulseio/PulseIn.c index 4bcff06ee2..3e44a14791 100644 --- a/shared-bindings/pulseio/PulseIn.c +++ b/shared-bindings/pulseio/PulseIn.c @@ -196,7 +196,7 @@ STATIC mp_obj_t pulseio_pulsein_obj_popleft(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(pulseio_pulsein_popleft_obj, pulseio_pulsein_obj_popleft); -//| maxlen: int = ... +//| maxlen: int //| """The maximum length of the PulseIn. When len() is equal to maxlen, //| it is unclear which pulses are active and which are idle.""" //| @@ -215,7 +215,7 @@ const mp_obj_property_t pulseio_pulsein_maxlen_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| paused: bool = ... +//| paused: bool //| """True when pulse capture is paused as a result of :py:func:`pause` or an error during capture //| such as a signal that is too fast.""" //| diff --git a/shared-bindings/pulseio/PulseOut.c b/shared-bindings/pulseio/PulseOut.c index ca1369d932..3d35f05445 100644 --- a/shared-bindings/pulseio/PulseOut.c +++ b/shared-bindings/pulseio/PulseOut.c @@ -110,7 +110,7 @@ STATIC mp_obj_t pulseio_pulseout_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pulseio_pulseout___exit___obj, 4, 4, pulseio_pulseout_obj___exit__); -//| def send(self, pulses: array.array) -> None: +//| def send(self, pulses: ReadableBuffer) -> None: //| """Pulse alternating on and off durations in microseconds starting with on. //| ``pulses`` must be an `array.array` with data type 'H' for unsigned //| halfword (two bytes). diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index fcf597bcbc..b2dd80682b 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -257,7 +257,7 @@ static void check_for_deinit(rgbmatrix_rgbmatrix_obj_t *self) { } } -//| brightness: float = ... +//| brightness: float //| """In the current implementation, 0.0 turns the display off entirely //| and any other value up to 1.0 turns the display on fully.""" //| @@ -301,7 +301,7 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_refresh(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(rgbmatrix_rgbmatrix_refresh_obj, rgbmatrix_rgbmatrix_refresh); -//| width: int = ... +//| width: int //| """The width of the display, in pixels""" //| STATIC mp_obj_t rgbmatrix_rgbmatrix_get_width(mp_obj_t self_in) { @@ -317,7 +317,7 @@ const mp_obj_property_t rgbmatrix_rgbmatrix_width_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| height: int = ... +//| height: int //| """The height of the display, in pixels""" //| STATIC mp_obj_t rgbmatrix_rgbmatrix_get_height(mp_obj_t self_in) { diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c index 37c4ee324e..8b0badbe82 100644 --- a/shared-bindings/rotaryio/IncrementalEncoder.c +++ b/shared-bindings/rotaryio/IncrementalEncoder.c @@ -116,7 +116,7 @@ STATIC mp_obj_t rotaryio_incrementalencoder_obj___exit__(size_t n_args, const mp STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(rotaryio_incrementalencoder___exit___obj, 4, 4, rotaryio_incrementalencoder_obj___exit__); -//| position: int = ... +//| position: int //| """The current position in terms of pulses. The number of pulses per rotation is defined by the //| specific hardware.""" //| diff --git a/shared-bindings/rtc/RTC.c b/shared-bindings/rtc/RTC.c index 5af1f4267a..4a792484d6 100644 --- a/shared-bindings/rtc/RTC.c +++ b/shared-bindings/rtc/RTC.c @@ -53,7 +53,7 @@ STATIC mp_obj_t rtc_rtc_make_new(const mp_obj_type_t *type, size_t n_args, const return (mp_obj_t)&rtc_rtc_obj; } -//| datetime: time.struct_time = ... +//| datetime: time.struct_time //| """The current date and time of the RTC as a `time.struct_time`. //| //| This must be set to the current date and time whenever the board loses power:: @@ -94,7 +94,7 @@ const mp_obj_property_t rtc_rtc_datetime_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| calibration: int = ... +//| calibration: int //| """The RTC calibration value as an `int`. //| //| A positive value speeds up the clock and a negative value slows it down. diff --git a/shared-bindings/sdcardio/SDCard.c b/shared-bindings/sdcardio/SDCard.c index 75db6b1817..a0582d1435 100644 --- a/shared-bindings/sdcardio/SDCard.c +++ b/shared-bindings/sdcardio/SDCard.c @@ -120,7 +120,7 @@ mp_obj_t sdcardio_sdcard_deinit(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_deinit_obj, sdcardio_sdcard_deinit); -//| def readblocks(self, start_block: int, buf: bytearray) -> None: +//| def readblocks(self, start_block: int, buf: WriteableBuffer) -> None: //| //| """Read one or more blocks from the card //| @@ -144,7 +144,7 @@ mp_obj_t sdcardio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, m MP_DEFINE_CONST_FUN_OBJ_3(sdcardio_sdcard_readblocks_obj, sdcardio_sdcard_readblocks); -//| def writeblocks(self, start_block: int, buf: bytearray) -> None: +//| def writeblocks(self, start_block: int, buf: ReadableBuffer) -> None: //| //| """Write one or more blocks to the card //| diff --git a/shared-bindings/sdioio/SDCard.c b/shared-bindings/sdioio/SDCard.c index 215f914fac..594fa71fff 100644 --- a/shared-bindings/sdioio/SDCard.c +++ b/shared-bindings/sdioio/SDCard.c @@ -160,7 +160,7 @@ STATIC mp_obj_t sdioio_sdcard_count(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_count_obj, sdioio_sdcard_count); -//| def readblocks(self, start_block: int, buf: bytearray) -> None: +//| def readblocks(self, start_block: int, buf: WriteableBuffer) -> None: //| //| """Read one or more blocks from the card //| @@ -182,7 +182,7 @@ mp_obj_t sdioio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_ MP_DEFINE_CONST_FUN_OBJ_3(sdioio_sdcard_readblocks_obj, sdioio_sdcard_readblocks); -//| def writeblocks(self, start_block: int, buf: bytearray) -> None: +//| def writeblocks(self, start_block: int, buf: WriteableBuffer) -> None: //| //| """Write one or more blocks to the card //| @@ -194,7 +194,7 @@ MP_DEFINE_CONST_FUN_OBJ_3(sdioio_sdcard_readblocks_obj, sdioio_sdcard_readblocks mp_obj_t sdioio_sdcard_writeblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { uint32_t start_block = mp_obj_get_int(start_block_in); mp_buffer_info_t bufinfo; - mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE); + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); sdioio_sdcard_obj_t *self = (sdioio_sdcard_obj_t*)self_in; int result = common_hal_sdioio_sdcard_writeblocks(self, start_block, &bufinfo); if (result < 0) { diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c index dbadb19558..53ac57d11a 100644 --- a/shared-bindings/socket/__init__.c +++ b/shared-bindings/socket/__init__.c @@ -212,7 +212,7 @@ STATIC mp_obj_t socket_connect(mp_obj_t self_in, mp_obj_t addr_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_connect_obj, socket_connect); -//| def send(self, bytes: bytes) -> int: +//| def send(self, bytes: ReadableBuffer) -> int: //| """Send some bytes to the connected remote address. //| Suits sockets of type SOCK_STREAM //| @@ -312,7 +312,7 @@ STATIC mp_obj_t socket_recv(mp_obj_t self_in, mp_obj_t len_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_recv_obj, socket_recv); -//| def sendto(self, bytes: bytes, address: tuple) -> int: +//| def sendto(self, bytes: ReadableBuffer, address: tuple) -> int: //| """Send some bytes to a specific address. //| Suits sockets of type SOCK_DGRAM //| diff --git a/shared-bindings/supervisor/Runtime.c b/shared-bindings/supervisor/Runtime.c index 689c299ef8..84d8370dd5 100755 --- a/shared-bindings/supervisor/Runtime.c +++ b/shared-bindings/supervisor/Runtime.c @@ -45,7 +45,7 @@ //| ... //| -//| serial_connected: bool = ... +//| serial_connected: bool //| """Returns the USB serial communication status (read-only). //| //| .. note:: @@ -73,7 +73,7 @@ const mp_obj_property_t supervisor_serial_connected_obj = { }; -//| serial_bytes_available: int = ... +//| serial_bytes_available: int //| """Returns the whether any bytes are available to read //| on the USB serial input. Allows for polling to see whether //| to call the built-in input() or wait. (read-only)""" diff --git a/shared-bindings/supervisor/__init__.c b/shared-bindings/supervisor/__init__.c index 1830308b7d..b59394bbcd 100644 --- a/shared-bindings/supervisor/__init__.c +++ b/shared-bindings/supervisor/__init__.c @@ -39,7 +39,7 @@ //| """Supervisor settings""" //| -//| runtime: Runtime = ... +//| runtime: Runtime //| """Runtime information, such as ``runtime.serial_connected`` //| (USB serial connection status). //| This object is the sole instance of `supervisor.Runtime`.""" diff --git a/shared-bindings/terminalio/Terminal.c b/shared-bindings/terminalio/Terminal.c index 623b99e096..3d53e3cce7 100644 --- a/shared-bindings/terminalio/Terminal.c +++ b/shared-bindings/terminalio/Terminal.c @@ -40,7 +40,7 @@ //| class Terminal: //| """Display a character stream with a TileGrid""" //| -//| def __init__(self, tilegrid: bitmap, font: fontio.BuiltinFont) -> None: +//| def __init__(self, tilegrid: displayio.TileGrid, font: fontio.BuiltinFont) -> 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.""" //| ... diff --git a/shared-bindings/touchio/TouchIn.c b/shared-bindings/touchio/TouchIn.c index e05490ced5..ff723ccc74 100644 --- a/shared-bindings/touchio/TouchIn.c +++ b/shared-bindings/touchio/TouchIn.c @@ -108,7 +108,7 @@ STATIC mp_obj_t touchio_touchin_obj___exit__(size_t n_args, const mp_obj_t *args } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(touchio_touchin___exit___obj, 4, 4, touchio_touchin_obj___exit__); -//| value: bool = ... +//| value: bool //| """Whether the touch pad is being touched or not. (read-only) //| //| True when `raw_value` > `threshold`.""" @@ -128,7 +128,7 @@ const mp_obj_property_t touchio_touchin_value_obj = { }; -//| raw_value: int = ... +//| raw_value: int //| """The raw touch measurement as an `int`. (read-only)""" //| STATIC mp_obj_t touchio_touchin_obj_get_raw_value(mp_obj_t self_in) { @@ -147,7 +147,7 @@ const mp_obj_property_t touchio_touchin_raw_value_obj = { }; -//| threshold: Optional[int] = ... +//| threshold: Optional[int] //| """Minimum `raw_value` needed to detect a touch (and for `value` to be `True`). //| //| When the **TouchIn** object is created, an initial `raw_value` is read from the pin, diff --git a/shared-bindings/usb_hid/Device.c b/shared-bindings/usb_hid/Device.c index d071716efa..83c0df4ae4 100644 --- a/shared-bindings/usb_hid/Device.c +++ b/shared-bindings/usb_hid/Device.c @@ -58,7 +58,7 @@ STATIC mp_obj_t usb_hid_device_send_report(mp_obj_t self_in, mp_obj_t buffer) { } MP_DEFINE_CONST_FUN_OBJ_2(usb_hid_device_send_report_obj, usb_hid_device_send_report); -//| usage_page: int = ... +//| usage_page: int //| """The usage page of the device as an `int`. Can be thought of a category. (read-only)""" //| STATIC mp_obj_t usb_hid_device_obj_get_usage_page(mp_obj_t self_in) { @@ -74,7 +74,7 @@ const mp_obj_property_t usb_hid_device_usage_page_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| usage: int = ... +//| usage: int //| """The functionality of the device as an int. (read-only) //| //| For example, Keyboard is 0x06 within the generic desktop usage page 0x01. diff --git a/shared-bindings/usb_midi/PortIn.c b/shared-bindings/usb_midi/PortIn.c index 5b26a94c43..c621c8c502 100644 --- a/shared-bindings/usb_midi/PortIn.c +++ b/shared-bindings/usb_midi/PortIn.c @@ -48,7 +48,7 @@ // These are standard stream methods. Code is in py/stream.c. // -//| def read(self, nbytes: int = None) -> Optional[bytes]: +//| def read(self, nbytes: Optional[int] = None) -> Optional[bytes]: //| """Read characters. If ``nbytes`` is specified then read at most that many //| bytes. Otherwise, read everything that arrives until the connection //| times out. Providing the number of bytes expected is highly recommended diff --git a/shared-bindings/vectorio/Circle.c b/shared-bindings/vectorio/Circle.c index 7b010591d2..8f0d58d873 100644 --- a/shared-bindings/vectorio/Circle.c +++ b/shared-bindings/vectorio/Circle.c @@ -37,7 +37,7 @@ static mp_obj_t vectorio_circle_make_new(const mp_obj_type_t *type, size_t n_arg } -//| radius : int = ... +//| radius : int //| """The radius of the circle in pixels.""" //| STATIC mp_obj_t vectorio_circle_obj_get_radius(mp_obj_t self_in) { diff --git a/shared-bindings/vectorio/Polygon.c b/shared-bindings/vectorio/Polygon.c index c46e49d3e8..6a72f91246 100644 --- a/shared-bindings/vectorio/Polygon.c +++ b/shared-bindings/vectorio/Polygon.c @@ -42,7 +42,7 @@ static mp_obj_t vectorio_polygon_make_new(const mp_obj_type_t *type, size_t n_ar } -//| points: List[Tuple[int, int]] = ... +//| points: List[Tuple[int, int]] //| """Set a new look and shape for this polygon""" //| STATIC mp_obj_t vectorio_polygon_obj_get_points(mp_obj_t self_in) { diff --git a/shared-bindings/vectorio/VectorShape.c b/shared-bindings/vectorio/VectorShape.c index 43571094ff..957e9dc089 100644 --- a/shared-bindings/vectorio/VectorShape.c +++ b/shared-bindings/vectorio/VectorShape.c @@ -93,7 +93,7 @@ STATIC mp_obj_t vectorio_vector_shape_make_new(const mp_obj_type_t *type, size_t } -//| x: int = ... +//| x: int //| """X position of the center point of the shape in the parent.""" //| STATIC mp_obj_t vectorio_vector_shape_obj_get_x(mp_obj_t self_in) { @@ -119,7 +119,7 @@ const mp_obj_property_t vectorio_vector_shape_x_obj = { }; -//| y: int = ... +//| y: int //| """Y position of the center point of the shape in the parent.""" //| STATIC mp_obj_t vectorio_vector_shape_obj_get_y(mp_obj_t self_in) { @@ -145,7 +145,7 @@ const mp_obj_property_t vectorio_vector_shape_y_obj = { }; -//| pixel_shader: displayio.Palette = ... +//| pixel_shader: displayio.Palette //| """The pixel shader of the shape.""" //| STATIC mp_obj_t vectorio_vector_shape_obj_get_pixel_shader(mp_obj_t self_in) { diff --git a/shared-bindings/watchdog/WatchDogMode.c b/shared-bindings/watchdog/WatchDogMode.c index 25476039ab..71512bdf8d 100644 --- a/shared-bindings/watchdog/WatchDogMode.c +++ b/shared-bindings/watchdog/WatchDogMode.c @@ -32,12 +32,12 @@ //| def __init__(self) -> None: //| """Enum-like class to define the run mode of the watchdog timer.""" //| -//| RAISE: WatchDogMode = ... +//| RAISE: WatchDogMode //| """Raise an exception when the WatchDogTimer expires. //| //| :type WatchDogMode:""" //| -//| RESET: WatchDogMode = ... +//| RESET: WatchDogMode //| """Reset the system if the WatchDogTimer expires. //| //| :type WatchDogMode:""" diff --git a/shared-bindings/watchdog/WatchDogTimer.c b/shared-bindings/watchdog/WatchDogTimer.c index fe53b864b7..09219f7109 100644 --- a/shared-bindings/watchdog/WatchDogTimer.c +++ b/shared-bindings/watchdog/WatchDogTimer.c @@ -89,7 +89,7 @@ STATIC mp_obj_t watchdog_watchdogtimer_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_deinit_obj, watchdog_watchdogtimer_deinit); -//| timeout: float = ... +//| timeout: float //| """The maximum number of seconds that can elapse between calls //| to feed()""" //| @@ -119,7 +119,7 @@ const mp_obj_property_t watchdog_watchdogtimer_timeout_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| mode: WatchDogMode = ... +//| mode: WatchDogMode //| """The current operating mode of the WatchDogTimer `watchdog.WatchDogMode`. //| //| Setting a WatchDogMode activates the WatchDog:: diff --git a/shared-bindings/wiznet/wiznet5k.c b/shared-bindings/wiznet/wiznet5k.c index 5254681782..4e5744d827 100644 --- a/shared-bindings/wiznet/wiznet5k.c +++ b/shared-bindings/wiznet/wiznet5k.c @@ -84,7 +84,7 @@ STATIC mp_obj_t wiznet5k_make_new(const mp_obj_type_t *type, size_t n_args, cons return ret; } -//| connected: bool = ... +//| connected: bool //| """(boolean, readonly) is this device physically connected?""" //| @@ -101,7 +101,7 @@ const mp_obj_property_t wiznet5k_connected_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| dhcp: bool = ... +//| dhcp: bool //| """(boolean, readwrite) is DHCP active on this device? //| //| * set to True to activate DHCP, False to turn it off""" @@ -134,7 +134,7 @@ const mp_obj_property_t wiznet5k_dhcp_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def ifconfig(self, params: tuple = None) -> Optional[tuple]: +//| def ifconfig(self, params: Optional[Tuple] = None) -> Optional[Tuple]: //| """Called without parameters, returns a tuple of //| (ip_address, subnet_mask, gateway_address, dns_server) //| From 01cd1c5b347544e5f987fc836bf23864b55a3c29 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 27 Jul 2020 18:42:24 -0700 Subject: [PATCH 0392/1293] add isort to doc deps Fixes #3200 --- docs/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/requirements.txt b/docs/requirements.txt index 51029bcba8..f2d0682eec 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -3,3 +3,4 @@ recommonmark==0.6.0 sphinxcontrib-svg2pdfconverter==0.1.0 astroid sphinx-autoapi +isort From 2bdd62220e1a6b5072d59cbab53730f852670df9 Mon Sep 17 00:00:00 2001 From: Jerry Needell Date: Mon, 27 Jul 2020 21:50:36 -0400 Subject: [PATCH 0393/1293] adjust stack for SAMD21 to accomodate larger pystack -- update frozen module adafruit_busdevice --- frozen/Adafruit_CircuitPython_BusDevice | 2 +- .../atmel-samd/boards/circuitplayground_express/mpconfigboard.h | 2 +- ports/atmel-samd/mpconfigport.h | 2 +- py/circuitpy_mpconfig.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frozen/Adafruit_CircuitPython_BusDevice b/frozen/Adafruit_CircuitPython_BusDevice index e9411c4244..eb4b21e216 160000 --- a/frozen/Adafruit_CircuitPython_BusDevice +++ b/frozen/Adafruit_CircuitPython_BusDevice @@ -1 +1 @@ -Subproject commit e9411c4244984b69ec6928370ede40cec014c10b +Subproject commit eb4b21e216efd8ec0c4862a938e81b56be961724 diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h index 0c5e5b7622..12c48b1e39 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h @@ -28,7 +28,7 @@ #define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up" // Increase stack size slightly due to CPX library import nesting -#define CIRCUITPY_DEFAULT_STACK_SIZE (4760) //divisible by 8 +#define CIRCUITPY_DEFAULT_STACK_SIZE (4248) //divisible by 8 #define USER_NEOPIXELS_PIN (&pin_PB23) diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 540a2f77c7..2a2428d679 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -109,7 +109,7 @@ #endif #ifndef CIRCUITPY_DEFAULT_STACK_SIZE -#define CIRCUITPY_DEFAULT_STACK_SIZE 4096 +#define CIRCUITPY_DEFAULT_STACK_SIZE 3584 #endif #ifndef SAMD21_BOD33_LEVEL diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index a1a7ec2389..255ab99b93 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -799,7 +799,7 @@ void supervisor_run_background_tasks_if_tick(void); #endif #ifndef CIRCUITPY_PYSTACK_SIZE -#define CIRCUITPY_PYSTACK_SIZE 1024 +#define CIRCUITPY_PYSTACK_SIZE 1536 #endif #define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt" From 945736e9bb1cbab62d4ab5c4d426c125aa530288 Mon Sep 17 00:00:00 2001 From: Jerry Needell Date: Mon, 27 Jul 2020 22:13:04 -0400 Subject: [PATCH 0394/1293] add adjustments for crickit and displayio variants of CPX --- .../boards/circuitplayground_express_crickit/mpconfigboard.h | 2 +- .../boards/circuitplayground_express_displayio/mpconfigboard.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h index 312fd26268..95b4ec110e 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h @@ -30,7 +30,7 @@ #define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up" // Increase stack size slightly due to CPX library import nesting -#define CIRCUITPY_DEFAULT_STACK_SIZE (4760) // divisible by 8 +#define CIRCUITPY_DEFAULT_STACK_SIZE (4248) // divisible by 8 #define DEFAULT_I2C_BUS_SCL (&pin_PB03) #define DEFAULT_I2C_BUS_SDA (&pin_PB02) diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h index 4796e90a51..d478ea38b4 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h @@ -28,7 +28,7 @@ #define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up" // Increase stack size slightly due to CPX library import nesting. -#define CIRCUITPY_DEFAULT_STACK_SIZE (4760) // divisible by 8 +#define CIRCUITPY_DEFAULT_STACK_SIZE (4248) // divisible by 8 #define USER_NEOPIXELS_PIN (&pin_PB23) From db26e894fbded0abee713138dc16b63a047aba52 Mon Sep 17 00:00:00 2001 From: Margaret Matocha Date: Mon, 27 Jul 2020 22:25:21 -0500 Subject: [PATCH 0395/1293] Updated Group.c to correct bug with insert into groups --- mpy-cross/mpy-cross-3.x-macos-high-sierra | Bin 0 -> 211959 bytes shared-bindings/displayio/Group.c | 11 ++++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100755 mpy-cross/mpy-cross-3.x-macos-high-sierra diff --git a/mpy-cross/mpy-cross-3.x-macos-high-sierra b/mpy-cross/mpy-cross-3.x-macos-high-sierra new file mode 100755 index 0000000000000000000000000000000000000000..5f461a238b57fb4de214ef4d3c5bfb8fab0109f9 GIT binary patch literal 211959 zcmeFad3+RA)<4|U>5vW(DlAG=gn&VbYr-V@+gkuGtB5b;`kc~QL&p~7H}jG2M`njC{$ah0W=Fs`u(0;-C0oQ^ZfJv z_wXU9s=J(f?z!ild(OG%-t0R2RcD&R!KFAHL8rsv;PJDzkHZmmWaG`@xC}oceo9Mc z3dO#k`Tk=DrS|^E_5S?9FM=}$4V0G7^39pmy9lelo?7qmFYyiB9I5yLO6*^0X<+{1 zK;i?Bi{WMVMQ4zHve1S{->&ZB^bzd&Sz1~iP#!4nO1c={`P-cgUL;W>`JJrbPQdHN zkKmOqod3uZ^UF}^VtDUPv*FE55RJZj_56GI%_|R-J^a{1i3Tr*m+80R@seGDzI*n! z7i@;lyvH9a?@DgZrJxWWJ$0{Cv?7`B9A6xJ^gWr36H@j<_+&8(l$LshSwfE-@B<^+eTg)Dvww+i;uG+&gP!!SwDhq@O3R;m z^nu48DSaYP_M`AJ?cxpx;8FeLKN`>M@z z@Z5PYynEJue>|S}*2b@A zAA9m$f~;K-yXBlLO`qoTN?kH4g|&TtQnILxRq~t0p(iYiaWIb+O>yi;gZrH+j)}>t zcxI-gINDLcotolUd%eR!IA!6d>L)3V96bMUON!$@>(u{0r53`YXDpuAhuQS%P`L}mRcQP!UZqatx%^0Hq{ix`w$1Pqr-NSZoGEJO3i(ZY^IOgDuzHK(gMn0PAWc-ayYE4}+F^6R zr5r14mn(^Vh=M&Ux0-Lop`j=>1J>D#8En;rFxFsH((#*G~bc$_9#ORl4qH*QSFF;!DSJ`M%)ZWQrk47=t zoF;0g#N4Q;>0?;h+j;D<*USY)#5#3hV)+zxmDM%GILbbOR8~1fwX3P5u`H-lXR_k8 z>VM$LiFFasA-+K5AB!yD%iG;&_!a6Ls%q1c9}!|qNcdy)|Mt1lu^=8K5G6GW7A&~& zqI`qpSN>@Jqm-{!F%FxI`mJdTUCfI&_Bso zCE``mR*A^WKj=5M(n~CiJbr|i2v{#&w~9K>KfR19OnR26Rvz%{t8B{FiqWsr1b)+y zJS`fHxzr{S<8#y>$#{`< z%d@*@SM4-(HAkphO=E!n4r^#neDr>-yAM)#M<7>JYur-&BjtF{?*2f3W#h^@N1Z_V zS9bF%8&}UZe$@kLM5;PZ>=}=b5VlZ;oRaa^UxGQ-%37mr%xw2-teUJZZujeNQ>P`P zm@|eswlJ|3$6(m}D{3D>=7`allZJeN_DS$apQbO>qbZ_V=Td8&Vmu-m(_QLWXW(Nw zT*rqF5>cZkQvE6K5S8VTwPM?$Zu})ZZNrGbWs+Lw7UQ)_OYC)&?@14>PP&fOEITMo zQW@{I^;3>)<{Fq)NtZ zU_q79OuI$Wwk0s(!w-O3#FA=qoVs#E#)$pU@zn>u#?Wqd_p$<`lI(MaiKejQ0!?U3%xr>F9OPFl@I+73gk!f_xSQ5)kq%r^=A_8?*sXW35I#JC{6l9 zOZ%Mp#Q3(ZUKssZ7t{!Pu!DcP6lhBz;6iE<|HSx5lJ@^{p1>!>;4?WS2kmJz zS19>`@eBjgmRa6uo8)VJDG1iGfUGvkI zzek=lJHo3b;J5nraeSx&`LWADM}9;hR1N~+T35K4Ls5LyWA*7V-wIpnxWIoRecf%~ ztt{RDF1W5oeqyM?wSh}epGqrNSmV0KONwu!_REJdK$i=~_~9~VdASa?(^a<3N|(8s ze4t*k0py_8?P7k;l07ABD+cKWB9Rh{c%AWm|CHwf*pJR%OngZx&_|^O9LtkmnBj38# z8jcSiV`;wiw;KiPHrllD*DqMRfeS1Vb^p4l{HFewff_UsdeY+^H0WqL<_+%*GbGszZPJY#WM3sX`u=zn(Hi({DK6E4K6xtKWmkfDqTvV4u zunddF)HqgLr)*@5{nUx|ekD;#f(oU5WEJEejGaI?@afNOlpw)brQs0d90?gzx^R#x zX+&i!!>)$Z6G-)HQAY#h4^!}(j!L>lWRVUC|!v`f}%#OSe9Ddo3p22J`c&8PB= z;Ic+XAWhQPCm1UtacnBexzJCJr;2KAHmS2yCXi~lA3{L9N9Ym)qA_{=%`{Ob{DeI+ zZo#AaTL3oQsL&H%roV;be5eH&%SP(w2O!k>%}kSHf?+?>!PF!8a3hga4-%T9r=4FN zp>IzWQ!iG%jSn%m&aYS6T-XkB(MmR+(>fwC7YX#Q)#E8@Cs^~psp6y{5x*Q=WG`&( zniQl_TtsQ~;x&d$F}zcpJ@NHwyJ>Kc>u5UKwnx-D5^MMP^pSfZj?=|>HxkLbA?aF_ zFral^P`5cDUui*qn@o|(6EOinss8MdF&2;Nc^E$P&^St;e3_m76%pFVxQeppQ}+AF z=117J1jrL`k;Q`&uYQ7p`Y(w}knNtc6%UA>EkvV5KNWNL$;nxoq>szdMIU>?(TJCY4y<-sou9aI4s!jT zw(<;Fi<@(>(8s1C1s^hL!3WGgkA-Teb;k0L3ijxh*UA3d`U-3+NsBXx-w=ahr3;ac zDlmqog$68tY9C~QUdcx6Aar?tH3<)YlCuxcht?tGHu&{*L=RbOAbJpU_w#BENs3@y z5t0^6_%&2YviooGE=6Oh&`U>1(Jxc|`g+oor0C~P$#{yBJtuf|HOgSTg{{bNKsD-G z|GLM2SU;PfR`6I#pl|S;Q@K})*IF6V40!@4#Xpdtn#;rywN8L6tF@-&w_-)q>UwJk zu>)<4kfswFG!z3SJirWH!UL__Xvo@LIk#0wm9=x$eqJ30)co9TSvxJ~?%_k90a5gx z$;v7=9h=)4ZPJhyHNM}-T1>}&lGY@}ciM`Vq}Fx{Se#^SS70o49nypds&z0ZU0PG3 z&rrqOBhOS0bBpS>PQdYd_F^SB?sgjE2N_GJI7Q=UalgLShJcyTg$0yoLZScVBcnoP z|I3qQX!azQx3(rx+no>`uD&Dp3ze?EXvL}4x}f$;YE7r|3Wm(-pHyi}DZj>E@J)h= zUuDu7rm+u@C$@<#Y2W!hUoP_I9}Iy!e?m%v{^r6~V(jhy@aKH!8Kg@P;Iei?);d8< z^V6F!L&4=`XK7rH#r_i|rWySQ__-YzQeIU-Xi?ii3kW*p8q767J588q;W|Z>xTa~w ztO1-+Fz6jxcAAc**9etY$eumr(-H(ubXGQoxkR5wzy%wK^#TWGIA^wgLALUv z?lNCnw>2hctu}cBWxh~r;8BL!IfhPgmZZ;scda2H3!NX)lzx|J=i@iE<{!LWA2LQ% zcerKG(ZEQe!0r0dF)+JYO%FpR%F;A>3}^))@fu0}AXD`0EUP8terJp6A4ZP(;K+M6 zxV0uFFbHCu^`Ip7AZq0ww5E!Bia05C>eEg~;7YvwnqEfXkMX9r{go6%} z{;>Hv7|iOQ{2Im(geQ+w9_G{2mt>h~04{1pS=Mt*{NHsaIRZhE+eCedyRh>kFjOmb z?`O2;Xhm=~F3F_t+wJd6d}FLz&0FkmaKK^n?RF|lEn%TdcsawZ%SVe`XI1JYG-g;8 zkEDuRl;4yl=GQ~=ik`MIliwV%Qtc9IJ144*aELJ_%SdfT*RUk7+>M7Oj1lWrwxc`r z&o0t6vas8-B<(v%JMRyFwLBNn;CcoT;(_EjybmH*$8Smz^V`Yr#mJ!9{Z{Hb3^DZ_ znr%W$sY9tHy>N_mA4~@<=Y?6ABFkkc;&75Y1ttwdvt?~ry`)b;C-_Y>pdKG_i|J9( z^NBKy-&Bm1#8d{ugiMjO|^iUH>f+nAq`Am`84^%r(QRB4DDYWzlt#_D`8RPOIc$)BmLnaFndY zWbPGKrW?TZ2>`KY0a4Q5BfygW4}zJ$#~g^dQe8MXoWgrSWcxiQ{e1CBwxrA2H)c47 z28@iScTumwSV`oRYZFCIm=D-RN-r+r*S_FGZvv*Q{e>Y`$9jVVQZl(3iQ6t~uMjfO zbr{3knqZjIL|rl%xLSUbQ_OFHw1;ouhxoKIrE(tUtz3eIbqU71Ro2d$Q*xb-+iJa& zQrJK-tud)6#I8Z>STqLOmd0har7?mmjrWjazJy>8ta9cbpk^heB~wYST=@|VO%a^> zi!t-WEYZ_ZRt%) zt}u(}fO$P8zd<+Qpayx7y2CJFJA{!gNNAqWYQcsds45omposF&fh zv*KGxYnO6ckaN2}Yg;zIY0#o!G_&o}72jF|MD47YyF=7xHBzpayGzu)?RYJO*l32> zXzY@7FMWun)CijDuHU1)v#X#&1$A)@L`Q!NFc3MrsIQ2PqHu%qjpc^Lgf=>|iTYi2 zgntWM1f>UbmrpE6t?y%G9U|}R6tziYRTa50!nI!zv5GQ-^RhY<>q!@<5=W336ptjU zwxg<8S48Wm1C_NNm1V7*?5PBb+Rb8JF)Jo&cV`A?WN~%|b}=MvFL7Gr$hO;OZwHVhe4cuS6-`W80&&Zx?X#mX_qZj{oV)Bi>KG$NYf%=b zq*Dd+A!@I#i0$tGQ2$v`3?g9b<7BSYyzn_H=z~S0f2Pbqvqhb>C?h;m=v^piQLOb9|w4~Y< zH)@OH+152Ea#5}Y!Nzj0>ygn~lj+k=1_}hVJu`3#e!Bx%`0Z4#txd}l41u#Qw_k=@ z1M$*Y=TuT*3t0V-H=wc@s(76si0TgQfV#6#z^*et{Xk)*@@8vIp{Tw01WNH+5jCNCbKC;IHA>+S#(NBg z@ehIlsFl9_26M3pX{gl(Z@oeJ3HBmueQ(|%#{HF6?!T=m8~)eL$#zv=KFp?NYk`AP zAe|1JaAN5%bYG?JU+anT{wPoiWTb=%r{JhnH*TeYfW4w^gL}_ZF^rHVw2O9`G;fy(hF9B1 zRAkh8Gd7N{^`>s5Twng@-~h_5}sAS$h%Z&?hraj3Fm?kH4DlVc1CEH4n~DJ`)>Y zTgT@V@>?M}mSL6t(xc3MXJ!;3u6VR3W)y27A{%>*x4O^)lWBAphsimI4 zNA+y_=8JR3BcWh4AC6N7bPiFU$R;@ic6_EAEBD7jyf(Iq<@OwPS)T~`I~?u_v%R0Dxc#i=B;xEOhidyiKS(#2k7Fncz; z#!=~G0PI~R)}GQ7`}lhW)rs&+{{_hmIi@k&$fXf-fBIf|^qT~nx$qP%EWB8<5t#ZC zm}1qn0=>}`=h;IH{2f~m1?Ui}?q@)k)%&!VaMw)pTI!m*J=5~_uGyo5j5mZT0Trze z7@~AACPBq{SJUQoj8>kjzKh4%P;j+Ue7j#eVWrrD1Jcn|Fj_ec&%K;`Y|-V35yap@ zHKg(5&S?8J-^W&(S5rPlMIkuFfzTnWWV-KTVAoSs#AvbEiv-;qfy)hf515@RByM>jJ zR-&!p-vy0mBe@7$q_)%Q+4Og40f1h;pKGeTOf-HPmpyyS`pF)6qdvjFSA4w2_a>Y) z79uxGcGafjL21caGdmMYVk6owRI(t90T$Z8&P7u&Ad@PK;$nQKH4g9BV^9$+lh9~v zWyXuWM_5WT;MgHBv~t!8@ei#Oz>#u4V>PrxaL%Hj56a2axPU%N!$sBN5KNkLjpq#zi;+ShI;Vi1O`nU0Qs6g+}>tYAlw z|MfPJYa~z93A+e}V)+QT+w&u9_=^f9eC?Jq8D^};S5yqbc8QU3u+-^T<8tRX8_nL? zgIV^wiEMYoOzF;F8K*As&qry;CDI7TT3`P8NOrxA2m!ZiFHh7ijF^3XtoHk;eR+@C zyNQW9v7x}4) zdPKV^jCP?2#wOqnH9R%3v)&pR?1+?I8tiDRxHb}l*4L*B-W5lanUiAm$&Y{$E=lZT z)Km9R_k~DzKgn-KLE*(%#?x&4;4ZN}JY;GQXYLQu@pc0!Qs6gTjNOA~?B4dVhDdc& znN!Td=2Ja~By9gD(NctkTIRS8hnA*&VdOzlSP>*!do`=>?(x;+p zMQ}>pg`Y*4aJ)Lrf5(xOU)B3ah?WfO)*tVjDQNp_ zN;4vxkE7Q%g`XPe3sKu$G==1`NuD1;n{FDJOMjTYkO|~jq=@5Q@)YixPDFk$2Tkg+ z_c=wk7%Jl+T>2?XB9(}!)iB>+%c$` z97nEl1#_x_O?v0X-hfy)){ewN5j{I1`sEc~oFzme5fCWMVf~#x@M=8GBwkedqK-0e#QiK3Gsg_r(!WQ*PGZrZM&fT z6K))PdRWdkYU zWhDHCC0tffBEsYA*-<{*uTRa?_W7~5oFi+%W`{mp6t=SHPyhtsc3M}TxhMj+YKkDvt^;YN%byO;&)#V%&^PWXg9 zG7jNU{h#00;+cTuLkbnSUv{>^!8(JcM| zgQX0h@r!{H*1NRACPJJy5)!r>-g71ZNqN}(FBs{;t9ovp^v+*K`QzXOW1IEguV2E9 z{5z>zfk|)+BEEDE?NE~Lzt>ztxrYDSI*!Iu)KLz55jHj=rfw>!%#hdCh%P_<-3(w+ zW*u$i!If4-o1%_jKhC;_q@svO3&Y=%1lSW;KPnGk30x&@H(1pVp(b}t*I9SoZn#z> z7*@hT46PQM(?0zg{W2-{Q$Kgqrwx{(XR{GJgaD#CY-UDXbk5;3MA5EFZpT@DC`egr zr^z!~0?TVr{Zg6RqYV^Mm8#I>LBy)0?NPo!W0j&Io~I4cOH>bImMDFdgIQ1%!Z{Zb zqTN}8;{M!igshZAHi0U5Jb|j9kC3^YUL8TXpZKuWMPuK?^-~*HS`Y|RXtcm|PvEK~ zrV_W?tEE%T9;hlOfahB35sU^m~`!hvM~=)aVJx; z4^M{QiwL_w_zB5iz&bX9d84pzcjk6u*fn5HI8Pb_G8X7eCVIu(Q`3z{)}JTUq*Gt| z_w!A zrC|ri@*0Fj+-yw88V&TxaB9SK4m)TLW47$1X^b4@8^k1OrO+No!H{%BCottg!l}6L zPw3=k9`*#WONKZ_oKRTBIK7+^XBkl>3>*>JgNaJ)Uk(f4lu1e(MMgn`k@TT#ZN@nk z^*AS{??sCcLpSpwI!b^kOudHKtMh%1Z%m?T?m#gG22pTKCNqoGr7xa$D5FKs>GB&O z;YH&=xH8K^90aI+$VQu3BDN86Yyd+ODlrE=AC(UWUYTr*)T^CpIuYL$F8F&OJyFa` zrSlLsAx?vO5EzQN_j%X!#rCsVgmuj7R|n@m4nWf{)+it(inZ{nGq@A_$A*-g`ZUk1b*@LKW?JSg*=+SIBeTUferJxOx)NSxG zVr!U9Fy)BU1Y5bUXcVkgSDc50+TSw@hj#Bj##%xGRnp}gNY(nXd@){+XE}~VK-%lG zax(RTmHM!!#oWWto6%9MX!W$#nXsJU=!4Y_YfVoR#<_5aC6MEWbQ_acz~6+4&h!j` zK?{MLOg}cbDBjAv39M#aMXUUpA1_n_wT6}n2}d;j7Z*3?7FcHT292>y)idz{? z9ccJA*~{6$R6!rT)LS_x)BFPjwRLrZ8n66#xshER^*PW{Ilo<^K}`1bM`jfhIrf$w zY|e8MwJT1dqfvYP{B7UL{B4NrN1D*;%Hb5C^b<@TE7e{`xLR7;GJuneO=Z7cfYC!) zpLR}AkD+(B3ffsgJ<4Gh!P5klVJD~~YxCitQX2Wt2AXAB$wr~=pwM6jSB=V(eqgs&Q6M6!=v;v7tsS0Cle$HD@Ee`ZmtS8KHT3VI)J zej~zYT{w=w)j^*9DH@HISCzwmP+_^^?p||Q_3C?*iaad zo=&1(Yk)lAt4dZbZQXj*S_9LUQ;&gH}hEhQ`2y8f*58RK*I`YHBQ1GG6 z$sxcXVGJ-5M1KrVgvJ07Z&i|Bk%?isXe6L_;1rKBv-e2Ud-Yp=`TP9b3DMI;Be6d* z68n3MM0@(hBLPLYYb2OL%tm6HUpvo60-jS^LWZ!Bz}`}otSb>3ksUxvnU2i?QVTH# z-%}DHH)Vw3M9;FQ0`P>;FAd{B2JMfH0(5B;W-MHF276?Dfk*Y75V&TW^CDf^4nBk; zeW7dCK(&_m+djQ`)*vXP*Q}u+w|yyECYN#Y^3Ox%Zjl>FL5AN)g^OHGKUc2&iq5zCt!2K!rbUNBG6I*IKE5v9G0|0%3BzXdd!QU ztUt;|A<}zZB<4i4*PMvI&%i1N@$^1KEDhH-WK;o-L5-e9VP%5ik<9=NQk|ASe@3YydZUNF~+D~(n}!urb1{fz&NbP zoNf$LY3!h5O4=uZ3Hc5A5q-RlutGr}@{FDa3lQ$R7R{x@WQEQZl|1#zAqYl4N~iga zX)Xb(H*{lo4Jp7L%k&QA@A7s2MzRJWjp}JtY4B@)H(N2`Q~}K}8OZOTHgFp_ShqVE zAz>TzqGfC``pD?XoHOrd;S)hfvG-v-Xf?JbMy?+92(&}n&2y`$o?xn?meS?(QI}^r z0@14bpACze8A z?6rG2o&~2FlwouXb{rp~qbaQ^I2eVnDe%b>N;^rf7}gwcyB#iLUdCRxC%q@;(v#SZ zGEj~!sI43q7zswOqesj?Fb4rvEeru4qSINdlztggnffN|rCrvIvLT#jT7Y&)AGQVC z0HidD>8HirUuv_qoM-O9cIBvK6a=wU?Y6WL>e7{@FC7A3VU7oeG0nP@qD8Oi*=Tq^ z@Ff=f1Rf8>G$yr@SOdP34x(gYO|nT$H62<41chH z4rfb*LjG+PuZ0Sk9H7(YFnoa-7xoZDz*ok+ zF2ZSdAd8dRBIieR73{g?<0w#kx-oa9iv?$Ra~tWX>rQ>Jwin0n;1TK6#=*JM^d-$} z*>h0aS9VOsOfJ%Ay?!1gL>z!rFK~+n7wO*D+nI^w%|)sSN1{JB29;@@UxRM#*B=6% zPx7mt#DWBBR$_(Th}C)n!N4ks^SwdRTc#U<%JY6LCbi*|#G`8kz3{xC=ZV^Bn`Ike zTDK{cz5VecA(so6g(UK5B)hI`;Fenz{TM*9R5 zODd>!mLIb<1WW7k_pylj3`n^K z>=lta%NSA#$3^r=wqACgFcs5Jk+173Y-7NmQ7^XbhmJ{}QrqW^IwT^OUn7&#!59*R z2VgR~u%hBdavtcnCxFzW#}!}DUWf>z9)Z(s2jEu&9Qbf9-Nn5Rc1U7di&%OXIfH2(v&<;@iiY@eJx$v8r z0}^;bt5u%s;qOlpZmdnX{*?qv!d%_na2_YxkVy=iux> zwBmEiMJ0h|z>SyGb_70Lw1YsJKK$B}_Al)WxrX{1MV*KnD(ffIayYgXTZ@@aB2l@+^)0wzvV@e6w`CK{i zbsmOSJ?nXgB%#0;@8=HSJZR;mi-y7#Pl|X3b8kT{KaC~9xepY%7wK};#pV}0J z`_+g>5jLn>77ded_`Pt=lkqi~m3PDoD^VD}jHqZxT$x#$;*fI@+)0P3e$aR$cL=VY zuy-iVzn=~AKv7z~iMj=$GY7ulIhjz#WoyEUu7;Hyh5n1!(Iee6Ko z`S+^K3-FTRTfdt0?>fShj z1F-~)+O$k?bRY#MSz7Fk!ouc&Wqf8KlaRa3JFp%h`%P-OIWErskIUKS66J{3x zYrD)+lREdPaIx}KI1 z!XWxf>e3t$TJYbXvI+X!94x#z6#fNzFg zQO}hHhN*h>f&{*7+I< z=sTdB!%ELTnD`dZtHl_|bWb$UH&z7Bg{K)Q2LqQ7Vy^%(^_)|Ijdj9&0Uvg&*`xSh z*HF?*BndETv%SV6zaQnr*}5FT?goYP%k{dhax}{ZwvS^#?2wTM|UsAf_C<7KKusDUYfJGpE79cTzrry%G?Fx zVJ>3}R8?^279NXbqkw72RcOQkJF*=CiG)%;_IMd-p}XX0J2~v462w^x6^IL9gnC>3ryVu!vVP z)#i4!J&zCnj%9q%NaTaV(@tb3U+QY0H$ZgO@S&$sh|s-^p$j_Gc;z6VW4dv@sUB%p zJMsd1tx^fMP$+{b#v@b;M9HB)AT}FsGA>h5WxUYP3wdxTJx>j;{tzf2#^5lfl{gPhK(0RCEWAh4B{q|oS-sFVFb=;* z@u5Qd`x-v<6THQqq$X_86|br7{gm}MjQ$;A`kN04Q^fjzOoVv}^PI6bF>CmF)B;h< z(-|_DuEcv-khDnX*lpTnTPht#+ z4untKaw!fzz@-ZwoI{H8ef;KGVkdlvd?+17`Bgf~kwbWgZ8JY*`<5Sq%qg?pLg^c-5j3mN*iqcm%f z#6+xszDTO6?KdhziSjw-pARrZ!*>%GQ68wd43_s>V<;4P({2QeTpsM0A4m;$%u`5{ z!BrM(rh!~Fp#}wN#0hgYxMfXB!Hu{J1lSggL4vC)Qi|wI{R$|24#|u zrsRKU=s;>o_2$fkmv~lAA)`O-DH~5>Uo4O_XMr|Mlr-eTo<>~;iDZx3nWtP!xaJt* zR<+~C@xGy;Wtg= z1dp7Ptqh`4%TOvfX+AD*QTkXz3+4q7T2$kN1%tt!AJ~J0kH{v)-8HF=xNMBByy(MN z8B#lyU%d;vp~(6IS-0!17K!ubh_PyxIJx9J6tdcFVC@l(Ycaz<0PT}MbZY^-RCLkJXDX@N=O{v|k0^JS5R3^phpV13!Ui zRV?c!bxBTNC7&{Xi%fd{5>IO=-OZ2&x1Na8PL#R?slsMXU&2Jri_j;r`Z5<`cPN%V zBYPuf-0_lnc5uZQ2+DMvs@hvVT)#Uw{jwW1tS$>VosYDHtv^9qA|4aSjW1_Pr*C+@%Psw8A|1tzhbCy^O*)elrI~t zyYG5l0MhZV$U3 zSTU(_fO~H%L>%^?2?QLH11MHegfzpi{y8KA|JD;6?waiyZ_;zFwFd?iWVA4kGcqi> z&z#GMghb}Fo=#u(m?a>HE8~YiBE_{4wwXwW(q2Gd5Wz+c1*_RPbhQkOUu3`76+TN> z;wd-6{J_q59u-KT9j>c`D_kBZS>(LY25jWuO;HB5MpFVjOlw3%?Sc(-D{D;Wa9B{j z72}Lx)NiOsSx+Oc>KLIll0s{Jp^M)HYxa}^!yy9Y+X+7ij-6-Q1AYkDG2aeD3_7ZyxT-Ms*BJt zoYJkS_!x_vto`FYO6oq>M+O*k1>ix_`kicoY7~5i2l45AfQ3Uq8Q%qyo#sox+zUwL zN1(!Riaj`oImL?GA@W|@K-jTd;1oE5Q;h3zRdX}l?o`^2pB6xWItqd1e;4=RR22{i z-d7WD*m8^gitQc+kvJ2+E~cxnhI|AEGxdi&W{_7{9l^k$>lvU&+je|Ng8oan{zf~T zBj$wkpsfXd)h=X-x*To6VA{Lk+79(7!e7oh`H(Fcqi}nRnteJew3W)M5rk$jssO6- z9wVl%V9W24dAMgS_C7R2^hRfAB;mFwhm2zVweq^o*Ny)mh|ZWl`)@2_Y}}L7R#`1f zJ=UOoL&UFX07PvVTDY=fDq2{G7QmLU2%vWm!eG)pe3*{02A^_y_%L0B6cebHjUI)L zc0ltaS58w4meY4hsfJUTl~*v2E0x<-QdT)jOyF?gyK}hZ+2B^ z(UnIWEr`zVp!@Ur@Inm8XvE7p1dneqAEN8iP{(g9;>vc#eu0VvmJc?%vo-7$|;obh0Cxdhn7>BH4J2cnStUmMuZp6m{s@dI1=95hjie3m zOE1{rP5>czd}s#VaH1Hyb5BEv89jb;1IW(Wdjy}LbNLlLxH!?= zI5fAQNOx86n_CjO=EG>0#FnTojkY`Z5E*iar{+WN0@q|&ofV-?npUvj_=mK% zl_wZ4$BCDf!7Gmwx@u>dG8%n?E^l24pC-TRLBOZ*wzj?4hn79AQ=)o+_zIgH$|gF> z2%*C%bLsNO!oX~>c|r!@E*+qe;9wjgz|mbCsYmeLSVGvqu@qZ4iF%-=oq`tV@>N^} z>p6|WW&etmqc(vDzA#8MGN%BHN$Vc7WQ*NH>V0e<-hYq>hl707=L*t|?*Y+c`%&~Q z%yI0Dg8^+y^C24B*d0J`BSIw3!=|INg>2%!gcmq><2V@2;b=O)`EJ+BqeMMv_tz`W z5&;HU0yy18ec3wF5}>72Ao{a56IUy3T2CY8TgUF9p__pGYjIQ; zPbA?!Tmd{xaL5~$WG5BNP&Jhw%0SRRP#?D@6 zXD_AfTOdfypCOxR#B@tXaub3bp@xqgW&t#5&#Cf0q+VNOkKn}4ah&t5rQmOKCN-@U zWwKL~B8Rg+D9-MOLLhDQh)b*n6VgA2H1cDy8WW8E#l@?JxaIVtqBaEAD{LBy?V^c^ zPh2YHcK6!Cpv^vp7o9us>&x>5y>zir)Sc!!&H=G8sMou=`T5_eH#I`AAm>>=+(Ceh&qvyiF?Ver>t{&7 zINwVr<$3SqO%Sw_{-RBe%|s6KJJ_GNB(oPfzkqKAxO%lobwvy#S)1nu3)*CIT0|_| zCQ9~Ea#&(z00#Si8>}F@H-T3DU*Vm8w3gA1W1BMo2GfaWm&aWKK86n;eh1F$1Z)oIzJs1k3E zu@EG^WDLgYgCJGd{CmcjV??zm3u-9}+FY3}Yvb$f%^n>G0%76ca;_Puhk!)w?rhwI z6>YaoE@Sc_8<_<*GCU!}1kRWwGCl6KfwyZHc49Ga$Sl=Uvv6EKaY&Xn5a}9#W5Et* z+0=p&eCP%Ye8Kg6_#?)GQwa?|WCCp%onsgZEagS0avQJ=?Zq>=*tM1qh4B`v!!N{j zRADc`cCJfCF`27G3x3rr0E3{iF<23>e~w5DQ4da|y z>;*g#K*q+Zu8TnL5Yl7}1+Eh(GaRoHCsP{vy4s!m(?7#fNYQ~r+Ua7x%uf`rA_8GAGo6&&$ZUJSKVyw^`&whT@cZ3Q~xKpoW95c}iqUMdT zbD;2qeh1l1Q1crKu7Yo=dMMD(-BB>A>Jq&0zHM~jI}TsKsN*Y#qAYO)?8f!LVx#aL z8h7|}FEH15qOnRe#u}on@B$#FM9e5`1ZwPWSSPS7NAzU?dfZHbQw?$gyWa3;tf&U) zjj^{;L^5V1kgw-gP5c4mpG?5}j1?~KB*rk|X9PDD3|9N3NL zR~;u}(+uGDi~7$&LHkubOS^DUsOj3Wi+GEx-?9$!8s6k6 z|8xW1VDdrhi6Gcvop~I`AaGd`!X2GZ*ZL~yh#||0y^2y>+VM-~Up-RpCZ1VKAdJ-G zxM2}XQ~@kZT$QiS1_W$ZGk2=t??f040tj%!CI8%5G#y)mN(HHW_%l2cJj;jpB%=D< zC^TK%$xFve>5`^_)x@z^-HAVaau>{aq_TOfowTj|z1X8cF+NP@kgPuvZDE^rF!RCS z;W8u!m$eA+uE=0k5$zZWBLGQ6MF_M@igCe7|wZ{plMcG26+ zKSR~TGkC6)57&bUO}fPw9tI9KlHn2}oQ!NUqezM&BD$MGUy-Gdm1 z2L(GpL3Z(mF7Lpgz$uZ7n%z!`EAR!UL_QxLh&LJ*{EaN!F1phqGS zMA|cx=!PQm){Xcg7HXp8C{|D%ceEPwL9RoxcGO(_3iSyA98~5_l);geERyrDQh6OQ z`x)D=b%M;lqHlFsJzi-Qw{F7h*?<|d(Q?t0ge|?^DuW+=fZ9F<8|_ck*FPIzo5D`yZ#wvjH3y1Gjvsi3ZqCFQU+5;#%jU|g}}*IILE`L}SL zt+K&f(oVr+@C?qc0&83Vw}CKiCX@;^1r6dVT!w~ADluLBj`XND%|(q5q#|ok^LEX3 zju7~UK|W;OfHcVAZ!p0Uau~*OFX>xjnsA+fux}k_TES;H76p0wcYIaPLQl*m0C`581`$?0Qxejt>d!maTmW)6eOf^#X-3&}5fa83VEHr^&TxP~m z-bv~Kh2pZH>q4mJZb`ehPAgt%cY zScFdJ!|J(%&X~{)vIgLg4aW6Z$OyVReSuaq%FGKAQx%QzR+i^4s4KeF<#@l)ZbkVe zp?cWw)(A+R;w>64Bhnz#O*6Ar{3~axCa3 z#l7}vL9+A<>D=s9Kvsmd>Y3vX3_wr~*4<3(D3^T=$2W9HSAK&v3xz9gU4R3Ah^wC= zTBx!@WVVu8d!Km?YYrOF3=x0Ap!n843k3b{LgO}WfuI!^@|!7S4zk2Gu+B9Q2&3~p#1`)J)-9chS4?~qa9^mCq3|VG!udc?1!sGHjBwh zh5xpaeOeMh-$~9bP6RLpZk3G{;H7r_l@=TpOadGMYZQMdQ1twaVG%)mALvpKy5O$@ z?on`#2yO)IL^Ra)fhgMh< z%pN+TfkO_)K->_y5hg;~B{2&h0BbuN0wqQ8$_=t|?sF4=( z-mN%bO8OXO?{&undfg4m1nLC-KvJqZKN6heQZAEqk34CKTghxK;$Z3Dhjnm)cBd1j z4mNTL15ZoYUL5X_J^RZ365g}C$cMm-Yk`Fb$|F=dxVY1$^l2@OBgU8CJdxYCK%3Yl zTTYcV)4-198qx8>u>#k`dgj*)Gb!ph+=4|0_vs^ewUSoYEq7wb^pXg1&K%+~XuRub z?$4qVlk9ILCAcl0mTO`pzQOwU7~`%#+Qwl2FL-!iKjxbnlZCn9`4Y#pJ*)=6TB~$5*uz(QfARJF&i}>Rn4O`3O?9 z22x`n&9|8aP=K(wO=O>_>Kf6U2f*r`tPl^Xm=Bg&w_y*^=Yeh}_=z zapsz)t66Y~aB?#(2cOjrOjhBlyIgQhLsanL8<9wd%$OW{4Pd?6(PV|+P%FWuIj-0F z@EW`W=j+fD+`Lw@7eNtdRXboF!Jq{vfyYMyQmq4Xv95S5xi)#VBb5*R9Ocvw7ayWc zE8GW&xEQ<;J)jjVoR7ZD!Z$M#zRq ztb7_9gyKlW#)kPa+Kv4b-weMMj5=NT(O;t3Vv}>a3;R#_Rlo?yY;lp+Kq%b8{!8AThmI*@@st7}MJ5U{;Qw_WvTc$HyXC!d#$8g=wa6K4% z1?3a8ockcm09;4F2wQ~@HUfP}s4OcqpZzIr2S#Dm-~Heembw_J?B#L1SjmflK#)WM zR>QpO0V;JDu774^Ic{%Ps8jmzp~(Oln~GnIK+DkSE*9p)j}Z;P#y9if!*~VvWP@|| zZKbdisMN$fe}dniF%MbAU>+76LPIhE7;GJp!1o2PJfX=ht%!c@G9RCV+?+)2B9^-d zHs&|x*8r1*Z^md-fn@q^NDWTJpAlGAXdelIe0Q>9=6XPig#n2)&?|m`IcT5x#c9<3 zqHJp68NgyBdjk_0`#HB-cVc)^_4{K*?vlB7Rmib#OxivYT8r~s0q8y$ll3JwsI3Fg zz8RdI032M9c)9)#EEo#!tYr9uYQ2@-?fxJ`8_*( zyPZA!Q)K5Le#~5LXTM};zh-B@PPJ1gd!e1Z!p>fm$i}034*{3#?ECEOhwSWBs{Ju# zUu$OzcD86|-+@Q9M%n%B>```huAQArwVNsX#?Ov-+jvj4}<{=m-u(9S-EN41MO_MDyl-*)!j?CkF-`$ek#gq^+G&VJU;CQPcg zQuZBo_Ch=RaXWh}WoHrav39m(XV0{=pQP+Qls(wazShppx3lvpyB}qLyPb192R}pv z%Hqp-&cu4x^CymPGC=rE4d#P5L74cvR=9etJaOs)&StV+aNY%OH8_!I9Va{fc5)Gg zX#W6u6>cGMsmHKp)Znj3)!+#3IRu34qC6a{Lts0-p>p_ZypSE!WsWUq*t z_<5}Sl&X(2YarnGO+|3q+`_AWAzX}%$KmR*Jp$cz;yG|nPRN+aa;*Cq%x-{p&0-=a z-K7-B#Ju(j9tNJxaIrH+Gi}ugRj3-HhBQZ%^7kgI4h@Wcl z>{YJC8W5P!wN#<&xa>`cBe45Oa(ObXOQ=5N3H2k>bbe6#l_w3gtCbPmU*^cB!) zYD;1zBJkAjhSI*G5ac@!!s70ulGt{nCv98%njk^@5K0>EZ}|>8DP9Cg`iu$=@yt%d z9by-ykm&hSjFtV~YCeJ!4Rqm%?SJTV6C^3FowuO9CDL#$rupK{EE!AoR{;UqkE`H~ zz@Y+Y6|~ual8B}|Y>tK2N>J@Z=g2)6N&L+(`a1<*L#J%S^=alEP+qJ_G_&iifD%pwSOEAuwP^%_TG4~nzspU~dJfXNXib}`IFE<} zv{PL)>H==QBP%3u2uj`w^J=mi5iFePKrAO6NIO?{%(@a$?1#uo2@Ga_TdAL%lcl8T z@XdI0*b$ztJ9~PXt`kWr(4RaoaHW$md&AZ#Ac#4BKh25h6ZuV2zUIf(d$2|MXIU5- z=Cp4kPLEK;mv6&#y})Fu))q*CF1F>vf5oSOAi`Vu@XL6WV32S9Ih(h$Bj#Sj?K0Q8 zy)BJnfa;MJTman+d8bTd@j{o`h9b+U0sy$FI~volNrNzD{2hWzo`b?9d%qY75655R*({yQXnYPWu57A_|pyc z`H~*$+yOMl=HzjG_Q&Qm&`p>t(VH_SDCW7W>ybwp1MCbyur4dOnE-`X+BGS6+W*Jf zn?OfZWDnfwED)CPB7%aV1`JAA6cCh1B56oNHzeSQ2rh^t5|?pdpdX-Y!6cfdZDmHC zVMd+7aT#aS5jVi7F<}XTQ3!~Lq7YZAZ3P4k0W|r3x9WAL1I+)N?|kQc9z(zPYQJ^s z)~&mhNzKoSEF$#5BC`@CuDyB}RsrVpJKaQ+!ovl1TC0Gvpz32gG!@#mU8Cv;yj5^< zRDybp6-Babl3z2)_eye>B-X8#W~QZ`I@5uPzjUG&U%rGCwg) zLR9C3(;ktzXt1-&|1WqaV|h%b}uU9%FD;Xe!AlJ_n1 z%uCPe$}YOyqwVK*)-spsM&vGO?-M#PIAn>;uBx8wv`JkF;m(v5yzC-f*HX~-@Xp!B z6G(c|nO;QtRk9*<2TuoerN@$V1Oxom2=frsOQXNuzG6ge02{75@R_^%`_yqk|2MiK zvEE;DyqSSp4?L(9f%I)9+^y8^4(uJYTTg@Pn?+e}f@9Wa^+OG-SDqe7iO%f*91Vx` z#zjVFwbg4aqyO{N@E{T39dBcmb>~4x9FRlNKNw8hDteUHz^>kMsLD0RQ&}DEB^*K9 z03>@()ZrZ{IhrfGJzA@tR_R)ngru^zt4>aRR;P+%;1RW%V?lIgEA=zuwV)6>W{w%c z6@AQWdiY*S#=0v}u;aQrp4TN`NpF`NH^;vmzL@R;C97-zum8KtM)~)@y8NST0SpKs z$|(l)p-wdeItou19ncTvSu5PW(9aC+9fa_DqO$Y@Vn{Q}DHl4UG_OAAwOhE9+MyWp z^kN@cj4cAFyMVU}yDe*e6strQGkc%-iLad+F6?jiHlkUw$E3Z+YlZCXQ^UUk;TV0e zR*&kFD>l?(>)3U(=wR6Rf8?BJt)AGQ)QgI;*UsX`0UQZd&+g;RLUgSS;vX}7*2`LJ zGxWd*xB2?9LAl_d928^J!WI=@B=84f0AYxP zI}6Ruld-FXG4`ZMeeZE5Npf|PT!F)p%K_gxW@J&$FZ}OwHO&>d#lFL`Kdj4(V89}b z&AL2u#_TbMEWzQiB3)@G1~-{I^|F+VGDFNBypd!uahJVB@e(0oz9^`(P%uvwd(+u^ zRrz&636FS0-Nv&fM?%;l1gJsIwntqR{VF6jB2k+W0g1UyxDrArtvJ|I025hphsK`w z7_V+W&YT7hclhF85Srlz?riv-Y`4fVk)dPENU*3$wUxI}ff|q2A0O|rm@U=@*6PTz zOR~2lCnV%qkJp6qXJVm>EdimBzKw7P9#iP=853aGXSkP+PcAH_ZD6Oe%Lt@>?W@g)K5@b0JM3P!Kyq6B%P{*wUg<2N6$N%)ifqI ze26UY_r%VaR9AUBFQRXJ3=d7L{iioB62Z8RypX(0OEcO~Wt93^WsT&A0^)qUpC`>z z!SU#}l~<-)bB_z&)n9~pe?w#Wq*|vh1L=#0ODl^6b~H0K*yEr+Lsn8s96Vbs^wIzUz82(({nJ;b6){GUA@b;sG-WO@3o7k^DViGY)EzE9O@RaG;^95vY z?RL&y&N@IJLdYjsN@bU@Pe6m7sFSrm^p{O~$v@3o#RTS0z4xYk$X#HPKR3xQO7dJu zUSX1_n&e88{E#HyFUd3(gdZm6i z3mgy_{bWCX0%T6=r|woj1I_?W>kiPpbFbVs`B*8_u#U3od?h6HS`n(PuS){9c zPS#F!&gad1R=xC4HZtAzqbCdns&xxlqV=@Gfbe(S9a^KM87y+4u%VRg$X}yAvwjJ0 z7}a>@2WLZ8M;o&0aBkGh`c)SS2LctVyh7&g@0x-duAfLDdsXdzL*!sx#dH(?da5i? zDWI3@MQ};-CbsRd_QKQiTKX4@Z%H3x#Qzb}PF=6rpRIbVC;XOl<@cxw4cmeV#pJ(r$VrpT=FG7{3luZR`z{}GOp&9o@s z+0JiYes}2YGvL{YK_jlVA-6uU6UeeCFphk)`;y)t{W%I6wgh4^sy}iNG{fAl8pg>U zJgR?l61)roK#KpRO2X9wlbAA)U!e&bWL~FiZ|DHs*TTShI(c zvbH#`rMH-NDQjl4Yc68cAY&I%uvqdm*P1c1(N1vst5TdkNvH3lIFr;(VEzf)w7dd4OQt!t|^=$g>Pypyaq(-Bm1tgM+l#xyJ${J8omwc z5Y~G}!1H@V>J0UIEVBTD_tdAr}z?K@p!&s+1#3>t+Z)lRNo+ zO+ep9$Ovb418)^$g^63VQWMZ&CizK|e2XMsBgxZDa*0V^Xp$e5b zUM@0wyEEZSnb0~lmhC%|EXmR;UuF8|nSK4H5LaIw|AOhXl9Nc|a-E|X!( zjMN<;VLHx_OF{u~nRDX&m@I%CsMaP2>j%V{_QiX_o ztM&j0&ZSyl=wfW<`+ikpzMJzq%Rw-u=lM*GwR*-*nv)*ug)0kI7VbsVqF4CaDq4#} z>|<+m7ImJ8#6)30Y$uB|H705@(>z*Eo>u7}ne!IztduvnvwpA?OXj6+Ph%J5Vye7! zv9z@B;E8Q|VY!!URYWlN47t@4SQLl6%@`8S^=VHUkH%?CdV?7&U0N-#=^Fkfbo^#wSD-jv5&V2o@QE9F6Ui#75fGgpPn1o3cw z=gJRFPsEJip1zXOUrdiK3hYWtC>9-5U`(ITs3d+eWb+dCv}~W?)nbRl4q+Y1o6J^D zcJ%pMH9>zjh~BKi-6Ta6bVte~mT|(z!IAk1soN>5?rEE~ox(yhFU4$`Jp8_%gm+C-*&=6LEy+SQL zQ=c4o#t``%0||+q^CH=G9_~m3F#mOu%!x2p(-E0DT$Cjvp%leznda(n0p_ z$Ycz<(gWMHhxsw%VXg&kWxq$vf#}LAy^RORaOq9_TC32CM{&_ADdZF0o1^(r6RDOS z$*6Pb4Vo%URn}Ogo4|k09@02r85^8<;OZ}|e{1#Bo$_6yKHFZcIzlA?dzx9;4nFMA z_#o#v?kE64xnyEE#Hg3Ii=*u}s13r^g87;n3tFQW0XW&@(9OW7B@|@sSG$HVa0J3S zgYW=TFLgljB_L_3dWU}F*s_2DhP8Y)l)G<(rmT6G+_Uu_&g%$!R4R~%)%S^^em zhEOa#F?rFauUBZl<@EJ5Z%aod=gju^$(d{4sHF(RMrQ-jH>t`2yJUSVx?4D3w#X2- zk%t!Us+=Pu;b1bV3j7k=@8Cp4O51fET#(=&R1h31CwRXutqQL(+zfcaJ9@xZ$bfHd!+<-ZLDZB~M^=D%YfU9RgzPE9(meZ~W@*l5 zZk3qZNRMh%vM};`Xj}kA1FK8}`;k2Y(aT^vDxQ`GUj1hrM5E$m_9{obY{;^tab zHIe4jvxB9KQEE+XDZ@B8y2N&uE>bF#i`OVWLwlGJ{VF5cAsp1+=VKr?)P=k0mt2Q3r<)u_=fKEZllm5%tz^&wmJd6colHx&r-pa;F|UKR zPYrK%o*nr;BA|bNVTP%rpXp9d4Ttki*b0Rg(9GO4TAZ7zYziR+O-44{$rH5o!A#h@ zh~}9fR|AjQ!9hy<+iKer$P*KlppLQhrRRhK5!)M? zkrmQ?K_{+%Bnb;p>;BW};F5(qni=$*8$H2=fJh<^c)+)Xkl!ZtuCQ_Xxj`KnWS-3l zX5v8erf%0<4)B=~%S#aJR%rDuC0l=zb@QcW?uM>H(Z;&j$6H13RQi7Jv+^N#ok{+) zNj@OS{UrH1l4ad;Za>J!so~M>9Yo@+!fVG1o!2w;>#vXm$*vueriS-BuQ6pLNFy$A z9;8NK4Pt0@#a@w@8=bF($c?1?ZdsPte~QAi>SQo@%{X6Kt-&xx#(A@hbJjDl#pci^4jAg` zJ+crmn3rZ72l+eVNn&@lYJWWiP`xV+US;#D`-lS z+o;r3uU1XP7S^fFpKFZ;*5Tc28d^q~UFLufiuB@W?t z@J)4at6JK9wr|Pe)YmLnS$qeRGc_yANek~Ee_KN4iS3EDt>PS3Cmp_n*%N_+wc4F0 z@-Hs$@p*{@ETY#2H*WF$c)}#N%KlM|-WbhKRg5Nx9Je)UZ(_N5gM%bRbrqB-`89FQ zSgl{76NBs#diz95d9ghNhN4a;B`Ofrluu=9Nu@DBL@u_hBD^UWaV<>?vK zVxiG_(HN9B7KG*#gyFz!4}JWM;~mXmr}|l{9Q7`?@r7ovT26pCANeP~KC3SgyqFVh zOhB=P<-=6~5zcW#KGWmK{S4rUh&D3osn)|amK?&40<-g9NV0EZkjroghY1t6gLw^W zll*5o`j-zn3uqQYex`;$gf=W43mtpWe_`>_$Nb%jk3MRD>@B$uV|hx?WOJJueo_~h znL0K6N1n`Wz+xyeg`EQYU5Z5_yV3)1=!NnDbfLo24*d14kPo@PGs(A_&#w2O$Dyt!Yr73cYaj=TS|Afv&zt=|{+DRB!PPd5t*Xh*}vf zCrdiAC7R_ge5Pih(K(O=so5Qzn_Rs=wYetpf@3Hx4aYT+4q5@I`A`esc*W})j`#Cc zafd*{_4gJ?L}iKSHDUni4?z6v3VJx*qur9#NE>nI_wZJ|BZwyDgoHv8gk^lnKP2Z; z`^^|Q)DRM!imN^`qdB4I1Pz|~U>OFsej1J1Dp_Skyvbawu&*NkyOA+JO|R59Z$iie zgowuD2=04!Oo@Fv>*G>;x&|5>o_G2|^%^I{C~R|`E~roWxY8wN9;3xDs0R&c+AC-3 z7ighnpZ+UvEQL$0GC>DzkRA^5#GurEtXiCVC?z1RC^oJxn0{BSBeNMB970Iduce2b zV?9ij9=ff^)=LF1Q$g{<9SQz)i7S1rbX$#}Yuuz&`ZZD{5wjdv@VaEN3nf*AEzMOj ztbECqUBR~G!1n~Oic=iK?L(O32O$|?mMULB3;PGm(&(Y*cDD2em95imG z2*)6b2?gW6F;qi(xx%#@j-A<6L0#0Sdd`Reu_GhV8{o9_WR$tXP3JtOb3>%>7eM?} zs?#~GP(*ipTzX-SqKo@dQaD}O4 zVhP1TfIxaJyDF}ej2M*g$Z6Id3OfA9HXk9`Ptt%?WdL=si;S-8cfzg5KFW^AoBBOj ziH;B((0{V{E_;G0I}o}Y4`e8HKWB(q;}NLSJav;8QM$OLRhUbL$=NMXtwy29#37Hn z?fM9hKdp~1I63{TQ88Ro2YEyohv$7vL8778QZ>NVXNVq}gQ3Hw<}ixJ!qD6dZhp%U zS?Jsh>9finASQd43Ige@4eD`0Qj!pS%)xns+0ueI02gPng8R#&b2^kf@ ze9ZnzsnI8OE*7z&WImQ|{lJ?Z+*~eKPd@UZ6dfh1K>z8EbhX1MtlhYigYS^Q=#9W} zJdWVgpsHb`+RFtGBBspbpWj_jKC1o3QJM6GsY|&__h~0L+W^&@WO8-eW3e|NURHzu zydt70CfG130HNGD*{KPPwkSCJ0z?4~*6N+s>T$&S6I4};nf(0n`RzrWck9sr*LvLtwdO>g?09`t&y?+3v>w^oB zO@lL;f$HXJv_zR`NbJ!LAY}ahEcF0POyoiYbkBsv__C;Z)CFeXEp3JG{ScYX00-Ie z>ex;h2Rb*BBsFp82P)wvwW<$EyvLRPLUM<4E0H#{Q+9bte$wW=2*H>L{-}@tEFW_J zZjyiIJISx`RxwYK*N_~=^SF%^OjuZl16TREOb;I1Z8BJ|u%6g_?VwCo5<2F*N`faCLxGg54pZ(%`t$ zxp8BGMDfvFHk@G^iD5)zhJrtE&hoc|F0TnrJ{Lx z-s#)D)A8CkF;5TjU=b0V^nT)iIc&or@mH0=0(y)KnB;RY2C36M# z!^A%#`9#=zu^+}mRPK%l5lkv@84{i~MzFp1WurzJ%v4~>DW>C|6>Q8pUf1}vF z42nwR>G?;G6zae&9P)-KD$z z?NxuKGyDh*tH)VP+MOlZAcSQaOG+~wzn8T|jk+?dUL&tYt5f$N`QxREmPzoVeZh%S z8h?s?ClZL|8$-VETn0_OTUd(`j8?k-M;?Tu*&(abnV25OgtW#7Oo^j}ZgIOih#p1z zPo3`-_bD*SD*LCNuPIFYZvSG5sDQX`lWlV{c+tKGYhyOX^YEb7R?A3`adH&*y$g^9 zApr9RX0wAaiy5+Ok*vPNQrOIDv-*&I&Mijb2zTV5q!zQoX<07_p{)Soh*BXUJQl`p zHMtqO80jJlV>HNCktHnF$Vc_U7-^DkGRaN+RP>SL^GR;CFj{Vp*TUV7?1#eOUm^J9 z*em~qUPwR)cgfboHNc{UhfH;6Z?wwJBRx)fxMUlK%M+7}kM*@4{({`a#|BuX?a5Po ztUtl~^+P`#=Xf9nc_R1I!@I#vsP{2sk<0xMU0bD@B*#fbyGrgL*7*`PIg(3yqqUK7afgcGQtp#51FW6fcyz>K0;%H+kgNbWn zJg?G5esJNA93ph2(Pj=84E%*bNJD0UYQ8%KLMabnIfE1*d%~Yme5{Q<8>ZgA8$ktf zo>URHaYp(i+>tDC;Avp8CEw`S8RARo=MddS4$=Mz20^jj)?F)jxVS--tR~H|9%qmUQ zgLo9NaLK)LaFxnYMMcJQKS*r8t0SXD{2WKF#KR7_;GnZ42BE+6B!J;!sXR3a$|Ys= zRdnJSq~#h0mt&oj?N2fZ25ct2zSJl+*ge!iU7mxCW*%ZCrk_vuT7P;E9!gKlqfQa2 zQK;t$`R4T^A6*kI`^l*nQH#tT(drNY>3a`YX|lH1{<~^-Q3dgPI4S)RbxY!70~fP{R%aHd0|ETG*N z9=oTVDVMU8i8Y3%+_K%XcW_U4pZvfv*&Fw9ynw@SH*YP>{$|!1A&paODa6iKWp^Fa zu+;N$UU`k)1C#7EY600%|E*-z`g=fs+ly)u**tM9WTN$(>a8iNXAL{l#ev{_o-v-0HA?*s!D7ZSvSL4mM90@u9pblh1Y4768-{1(N=IrRHUy? z1_+`TQmLE3U}Q|Nrur&mI-G^UNV1r<`+MXEzTy&69B6G>uxdA(gS?A#Z^Yx;rx(uj z6TJ%l2CX@TAfyoIauM5YQ$3NNxAQu3ob zi32sn_}546DUOJ1GbOdST!teY zN8}QB^$!dX3A%jB=M#EBpwKTr5OMsRC7~Y)QOB|GiFVLYT*MJ&yu~J!5U9CKLY6A#O7iHJhIlH`|378HiFI>96DujxV~V%~p!4pUOR|7!T&3hCvNDV)J#1P(iM zj_-eZ+89>_fVbvfp5`G+=}ai9AnfqDiw5MJXM2eVfl&M>7+@?GbxD7Pj*W|+J6?3T zF6SJA7E)8rx%Na9g0HzGmsR#EpTO07bNbsk(S7+n*_Y1%)6BjsD66Y{S*zuz+dEoU z9iEjT{1Y^JkNOOA8k1|%4tMd_E{tS|;t=1F@XO?;14PuJ1OCAxag?*JJFo$!n_IxX z7#s8-2D4x{zYG@cQ2GK@vDMwb;G6J;viP=pf^*U5jYpq1Aw!IJ8eMZP$BQyhH^fyi z{R>Rfkw8jSs--G)DuuObp{y;b>)Qoi0hxB06|sgG z42Vuod(7@tr^|BG>*16hhJ6rR5seg1Ny2xYIq+5+K^3<`ipDmOScnbSt1j}{ zUAPi}?$N$u(h>Adjlh72C`ko@%Owx81KN)_pe$zG?uL!vg~kTt@p;8f zzq87ksFi{+`6hxC&2k!D;|}~RG}9BZ;R}BtxO2eX;Xlt4_}&+q1}`$43qO-po?gQFq_GTh%#>Z$W{ zeYaifI9hR3g~0CB9GB|S9pH)H=T0=%8#}_dFa8n!qs`@G2a$T=fYtBOyN4Njhz$h@nW5EpFKvim{5|g)v}{3#OvSym;{P8 zsYR@8=dmrk^!~RPTj}9WaRh;z3CQ9+-Vm=4`ugQ|NM39hk(_n*@;D<=SE zxHc)s4QT#iXo;2qru{|O3^{A4(f12c$t^cIw z7MOr6!syC4KDYy;GlZRz&fWtiiKak6$M^o?q2A(%0COi>dOL<81=LyOmItgHF^pWJ zu=&>SQq!9NLTBp1X%sK}3{FsVkoV=;S%@v7N*zg5`5~GTC3R(mZ%0U9FWt&VLUvN2^W< z8276ySq>+H@pYF5WTtp@5D+`N@C8D>3Je62UFimXzVzI~&W045cy+=`|LtwlC&Y|1 z)r;&DI`KT;lMrdc3s+bV4TY|?H1M|* z8kiCtNv8~_M(j`3{Zy&D%a;FKg&DZC%lh!P99+ZKlZ`_}+EdX(gc^tuYqT-{P-i5q zOUbTWu9>r;gS7B4EyPn$?FqeUcQ(m=cry#`Ba&OKDA+iz+Wi^Y12frt9A_)I=!DJ`LA7&W<@U!j8#u5k62o z6_>3ly1DFQ&;MWa&CTuMVi_PN`1p?k);+7QNGlxH4z5m`9w<%gCNcUJ0O*hvvkWs9vm7;YbWxo)F{MLH5S6GUO=poS z4{%ml{c2_sv&861J%?4I-)J9cDW11=&=pZ-{KelbXSrS5lJyXy5s`5uD=IjCl**zy znQ<|ljGGhLUoi#|eE|sfG%c&!$*F6S{W|hzX3K3b|FUIzw#EzQH;SPA*nIhr+sh<( zGs$gbGHG7zHmOM_^{5usrAbv4mL$JJa%^2(t*xkynF4JOTRLXo3yJoez#b=}vs~!D zN3PT$I?^G!B?;&jFxdW@H*3}GWa95|-o$)`Q$1^?eS*JDQS+D~+_m03X0ZDW9ku=% zPDm_^V=BT0ZQQq$;2%uTvi$O!T#@0~TkL#O?rNw*AEd};7C@7jjdVCgEdD}W$1n(I zjt6U)a8bia`jS>mo4je=MD2bi}=oItULO|;u~bde>}RogCH z3qp*wC+bg8I}Z07N#Q(Mf1%uQPv}MS%ENjZPUELS*hV$$K0OWnP4Y66Z1Yy}g(Ocj z$!R9}_a^x~N&Zxlhmahdhv*R#I3YParq;dSz^Rj7%r(MYz5?vb+G#mVM(x7o#yyzc zLu#omctt|617?>x%x1!-^3+HgL!Omd%vJD70N%hY&JaM3DgQNA6egCa`kHz~opv=* ztAJPX+&cjO{Y<%cdPgE9ZfpJmby8|12}^hh3KyF)R<`s`lE)D7k$)wm0yxyt^X7U$ zda(gYuKr1TQ9ybHwX5^))gVnb$>*BnzWh{pB{_lQ=b4n3_zUs(pz|kid~YT>#E|c+ zVev*QI8yX%2u}F*Ny)^dqO8vED;SNHv((625zez-`9GcB% zY2ZQ{jihNiPkHUdXZkd!m%QBVykyABZ_UeS)csX{AJRi@pA1*(End)___7ybV3N}v z3ub|aRZ_vfu|C{NBl+bTC@A{ZTdVO(T!*6n{RQvE@{A(SpiR=xngm#gK;cdD&n>pL zF&HfH91>XT+U%c1beY1S=Qe>HvYR3kc6yN)D}h0~8``@3?TG#C@@8-G%eC2<<`H1_ z!v){I*PjlF+vRX)O^Y+SA>#7_N_wuhgJTLFQ( za*m4~e@y${zfeURHcsChIk0_9ww3kxBVu}K10up3bH85yOqx~b}icf;~`Vc zrKXzYQcbB;vofw4teo1TE~}BA&hLn(Z5>Y<;;adEDV37Mt+?$my}-13ZW~ycn~Vn3qMD=MBui((BsDGRzyQm*EuI z7%|rvOjO<>OcnM)Hvtf9_554BuB}{KnMB?$Chu*Liyb$dD}BLveIV&myh#&baL3)| zu~y{`1f#~?QV>WM+odWsO-{OIjRVEs>Qm~_%gkZ*R(>itf8qXuhLq%yCb^qQzEP5) zIE23?Stx+aV6Mj0KXVl)Hy#3lTBxf((>r}aN3ZM0c|8LBVp(Rbo^^TlkBd@^0%I?i zd_{pV?W0rq8`H{b=Hz#iv{ECj^mkf`nfr@08H=m*vtkbXiPnSr1-Np(4j0Ike4$^a zdAjqAC;kCh9LaVSw5zvDwPqG8PT~_<`6VtQGgXCD*`HOA zJ-g4GJ}f~{Zs6Ep$AkF7mK<&7*3#fO?^qT$;S7h5^V*}dg&d9T)2$3mGL8MnPenwg zYaxx1Tx*iQeoXfzBFXzD`9_ocFO$5%B>yDIXb%W~cVbtg&QH$+_R8BB4U3J9TyvQM zNWBAzA?b&5$+NT2yBQ%zF5;>D@`2@3T;=l;qy4rGnvF9pzYMlj91tLF`27h$GE;Jq zw0nE&cFUO!Y1izGj(1jyWMl}^LA4HHQ%%Ahal0snsoK`n)Vhm_E?M^zcfiiQ0aUi7 z*z}IeS=-HD=o~NwYLTuaJ<==oFjGr8l0q8d5_rBWtB4|M4D z=J>aRw~90fw)$u$;pnliXnu@8;Tbq2nEhO!i7?+#9;n64AwJg@A!Z@33v<4ke6AWu zVKO@U;HcZi28JBey^&$RFY=+#&<*_5Bp7LwnW;{EiSi16iRxbdV4zzWV43Er$v3qtu_ce3FUO3=pGXyej}?PUF*$&M*IWcD8WhXPks z1jpP@mbNPgL@CAV%?O8k>TQWLA~vS5fa}!4drpaQ@1WnV1Tjk4yGGji-FZ2 z#288+sP&9r!J3ZYrO9!RR2Id`0Su@np<8RLWaTguCbwJaD>ZAFR>lMQFjTQz zIzDxs&MDy8%Qq%_7e6%#-T6Y`W!;UQe2H}y7#%m2e| zR#>!3rtm+dFrq65C@O^o#KQUI^h9)bF3jq6Ho-x!u2LUETTZks72PNmA&HDu^o|%F zgi>BVxuRxz!j7&7-Ks}W&u&r+GUsS5b4)FFom|UXC)T13r~qiN@mm=@tJE*k(tHQtVT%Y3u2ko zQ)C1^9wX4s33w(UN8`~Wx*4!in^j{&-1t`MoENqRx4!SiLGH)N0Q?@-`TE2G;9~?U zu`vn!%wm{f^53ZQXT|0JXMBDE7^r%ebfs@>M0$m8WOifqI{7@3uV3qYe?KvwY5%PF z(e0v5h>AFj?Ntf!DH7qjCgBp@KjV85h$m3=Z5!g+7zRJ$WIq9eO_TqO&p9K$$xwXC zIGr*CJdtUT9^DedNL+HTZ&W5DSL8Ge9qknDryo=IxQPc@i6hpVxxOi z=NuG=1W|;cqg(?OpSMis9UPZ8=GH=2pOmaaTTc{kQAB|aik+wi?dHbPSy^`T8qX)_+mm(mg*%9q93*S$0}>OMyD ze^l}n_E)BoVWyJoQ&loFt`dC*>&Kc{{vv9M5keD}eA&Dh2#lsMc4R7r{6%QLtmRcz z^=++HyYkzaWg>~g*|mjQ-C(v{QF?G4GyRYf_x9DZBcDzuUroYb?XVg9*p#Y2Y6CAH z_lZiY0(T1N-O5xNE_IMPHb-Xme?~!EiPLR7+2QR})5IjrP9C%yqi20xX^%Sii(fgr zI5Rbeew<>a;+Xk>v=!au$LMb7$KLOZPwcA`xi5tc*Ti$wy_J=cAD=H#=evT1#6~L% z$?WW8kqM5jn$zNoY~`3#laT*Eu=ZO_pmc<2-L&Bfe>@R#V0WeD%WDlbF^q{d8{GpQ zmyFRdPt(#q$1R|c+z0#)ua(+b4CF|;_Kh~cR`CIqLxW}12yyW=# z{!S&wGwlKDFO+?KPo%9{CJ&#-Dk#tuXyavNOVWpt4(d+b(8uu&WuDYf99LP8)u4t^ zM%OBc(U79Irvv=dBp^?T@oK~Pax&nge51s4i%!leQ~niQ{x@;u8vGBeGpIKJo=y3EzB!GFR)C&U*>Gi|le<*tcqOCm#_dZ1Q(`47m( zK3>C5O#;HISYNGZd2uR}5be;kCWv!WlE1Uu5zzT9R(41yyuFuy;%jz9LbBDsSatq@nsyj8%k<@~AhnyFW-_T zWQz&2Cy9;7k)1M>W5nmfkFrnYbh;VoZa|c!8Kk|@q?^rXwA?V(4Y>qH+84&d>{uM& zFE0}j%Fw@JID%9spSOx~`l-4gL>7qp0(er^c>_OU@P7-n`T|ug23Af`;R12-eBa<* zK^B2Ilh5{M)fD1Za2ofUH3@!s=$X5DV+4&M_iOTECb$LD4lqjkq4*IQmBZybm^Of~ ztvch(Y(-JDM|ZP6B}a6<@(R+R6RsK6!4-pmnEloyT;F=l8uc5;ktBR6QI#Cg$MeT1 zt2Zy{@Kw6p4TyRKKSUTduvCL>x;86G8_rwB3j(&!rx~zC_pm~$5n+eK(~or{Nmn;D zt{bho-ThQ$wldP1gd5|^RI;duW)dOvo{Suj2v<5a{HgOnPF*G6XJAbD;7S!9YX9yw!5b72;A5rLyN47s_yH7{%Dc7lHJ?6Fm$Vn!~sRt zfs`x%jhk3s57L`n^4U|~Hqt|snaO0(hS}U1?zaBCKD-UO&gJCpz;<`>ml;LYJ!!pH zx)O@4-L+Jomc{ezd!!+2X$c)19lG<1W>3~PWt-NpTP9e(>f+5AWmRq?V6r^5#m8>V z=Z7wAqExj#_ddJ$7=es`B)6L|sqWCiru=M`Z%x?h4&Cc=j9>y=imX1nu!RYq0XF6b z>N@(|3mGiF4-g5q;TvLWt-K*L*)hC%mC^cJRF*l(LW?>=9_WmfT&sk!RbSc5YYGp^?_L9TT4du=jX~ncc3mj1;PgL`uRV)J6BNApxsoNoH{GjbzC};+|r4CGN2d9IjD*( z>#Rqs_>lGwJ{+>HrT=SpwJEZ$URPvI`lQIZW|wOnElG$^tMmanqNm_4;E*4FJ5lQ|vS%{4TVHh{(e)+bD{ z^;i|&eJR$HG*jfiJY$!ADW+LR-PzTPI=M?W93zX{%HQA)R5MP>tP9^seNGnUzSjNv zjBq_26Ju>mxtj^QEoI7cGS~1m!OE{58S0TbGPEEy5i4Ra=0LtR{;(WqN(X}>1%Zgn zx9cM2JJJ2FP)&VvG)aNN^+i_J)D?kARr%$USabH83L!9AYxA=*Y(!YfwL zpM-vsYP0LCF?C0_dz;r*4%GeGr$${bOW#w=jqVVOw}jQt`eaa5KyH)F-sTtEg~P$Z z^;y;Vfg@QPeXjL^TCwE9cxg@k(n%jIGoU%m^AE}|5Rc|2Yx4Iaz; zBYDekSvo9$6&v=&6T*L`@2~dr1b&QuV=Z~gHo4#CdxFREeL`)wa*=0o;|%)_H_>%S zcdwig=}e|I0t&#p%f0f}{J>s!V3VNMh?n$i@8XKoLstL)hTH=SLepKIvfbrLi_$TL zvOCm_a&c4Ixrqt+4coBu7SSnt!T-bH!XGLT;x9zSXaERuK0MnIbRgt z>l$cZh1pr8T~k%LD>9}aa8$tLKbMq?>~2LHT^9{>7atv9cXl^#akJ9W+^-IZU|+sI zk^~l`4witL^-HIq>J%fy?Ap19Yg~gQdYG#qt5MWs4;}&<;G*4)u`W7YypFI?dOv5N z|0g<=L{(fKYJ4dmKpszdmrPH20Ys>z>6Qh!Lml+qUUgnsCCnPY zRp0a)(r+y)D#9m(D@{gts~dZ9m&tPP?X~9XW_C5c9_{7Y=GqkM7znJ*+FY`hdb(t~ zszS-dM|QD%+vs{-8vARKGj;egX8?1r_GJAcHkPg2yw=fg&;}e5gbDwSbAchf;BfdK ztPgmDN3iCCm07NT(w^g|;vrCjn^WX_?o5+>uStGDlAo32e~_#E|@G`+A6_02^E)+^yc*U#fZ`2!LP2B~@H&^DJb&H7hCKoJQ{qUrb` z&TveG#_!1$wad9Y6_WaGK~|HsY7!Tq9Z*+?gk{EEaVlnb$L-T1m&s5Ux%E)-?$Z^1 zPp$U3=5APTi_NC+nSuGlrvFTg_^2KY)SAk{K%biB9?H)y#+{nshlZAsP4IB9>Ya_V zK-MpskI*L#*zYgZ(*MW~nR`AuRI#+}@~VD)e>;Q4gJTVBG|DCjZ>^$sjfI9I1?SF1 zKs|h$WJGz}#v8omHXU0<%GIN}ls0ebaxxP1DGb!O16#H2H1<*bow;7KsGn6iTrI@5 z3zo{vb%eR@s^_{RbKL=;xL3JQ2sewBBQeIrn|t;Yt1_viHlw8Rc7IVx|w&q*Xc2RkA6geriIa|#h>9#7{ znl9UyT9sT9DBZu??#pwE^Zi_&+vsP%-I-^}Pe)Tr8t)~5-EmJTH-6E=0d_<(Kd0ysy9ash6>AXG}gW!}D2{BLYW@tLuu7wj)?h z$;P^pV=n&o(H`C5`vD3kfz$Jfn=i7{P^IcEUI(l4mTb+CJhVP231wXK*eSgTB@-x5n zy3$B@9uJ=)-;|$eH*&Vr<6h~)XxuoPXYc2;Rl0#T320^Ae?HVlXOf#pMoiC=s`M8xFnC+K5aPnAC?`$Xoe*wZBs4tdCp@)Td=} zhY$TuP%PKGRW^m8`{#m|6Q=V?ufsKJ9_*43*7y1_SOj_xoyJ;EE%~CcWRok9YHa87 zgOk$NB#`m^w(gQI7mp0(*Ci5^J0O8yC!~7=le-bxXN-h3pU^Ab+D^<#|0OfX^6son zFmIBjJv`-lT$}ByB~IUI#Obqd_XZRB`Yvc?PYouO)VCGRwhWR6Uq^&V0^V|0rE?qg z9xS68k}@QGy;c&+K=f1iW?PT6H$!Bkx%wyVDt;>Nr6%=n%-#S*8=ScFMCb`xm*PG<~C3%@77m}>^Cy~A)J~`a5(Pg)hfCG`Xcz#RF zS@jiL2TDXCgZ(MgV z-rT2VnCDbPJ{T9~WV)NL&g2C@!H|T;#uR`nOWgp6->>91NVmM~;~j{&>w=5tjZ7Wb z3uj_`T7@GT85XYb2HL9Eb^Z>4DsQL@uCJ$iL-{TV@x8Kmo^UdGE*oDT&l;>yDeNMk zP^!1x7U|R=I%QJ4i6kY(CCR}P--(q3F-F+4u(mMio^BBF*+a0dU8cd&q$Z7aVUOps z&%{Q^g&A|ADUYG;KD85aiqqjT2`-6e>0Py0584@$ay=>Xf)03}l879*)}`ks+3Wp% z@o|H>+`zu?4PGJy6nkjQV)vGj9y!Z9Jne6kSvi~gq9KMWZw?RVhr-jfYaKWuFz2UO7={<|`!z!m zwA`6jEa8eH!$oJf> zv!RYVJDji-f7F&Gh)*>CEbPx#wOa~I-^EnbdjrC{^pHUWMr*m_C6G#1$vu)MelboB z*YnBn-Xbug;zn<_Jo265jEmkhmff+&O=xq8hRIj8pMqG0ikrrKhAkixSH`8N{_yYzbSkg`IY{3 z8=2At??Q`a8vShgZ{+Q7%PAQXOa8(}Re3*OD(=%j+pETqOLk|(Av3G;#jLtbjDp2) zD4~=u4$7E^d56zS$;$+D}p&_j)f6`TP z6%@4)7vxP-3+qe0X(}SjT`2dq{W6IgbItWbcG86IB3Ygi)2PtU&oI3kR0Tm- z$FCP$*r-;vb3~@0l%C%bAllf7a^ei7b=QrzL#wCljzKAXQ{WYVM&m~)<;VduyRjS_ z2{0W^)^&WObNC?8tt&Y?Ay&z2I*Z(+5zRs^2~I5{v(zpLf#V3Jh4vj$H3N{yaEEkC z)f+B6#W|CuJP*$jp1`b12rqkLiCj}DE@Pg+5qHVHB+Sqf?Rg?duRf5d2K0iU3;F3T zXrLn&HIdf`nS?mhYkB(~wN-Kn19D0Dds0h|x3wO0Q2=qSciYhb%c^S^UcJ+Y-0yYm znH#zavL z;ItHad>~2Qz(^vQdH6Ikb>qn7fz)jd^uTH!$X`H6%BQat=xtQ*v^n{VhCsYQaICGJ z>C4`U$HTZqztHkH{uYp9}az3qQUJ`c@TKp58~EK(PK-O7S(qS84Y{`SyU|v%gy* zR@K{nX;_PhOW+JYYL({mpz-`3B-2_E@Sz$FgN!+(zPNbIKtZV<@3ANF4Nm0{h$U(3 z#WA)l3z!j|#tSMwFBOFB7i7ld=>ULlMbq?+uG3fkbz}hsY{RmKHSsoFd3v_7i*&RUcd_RTI^k8}7*-n2Kxm z5f~AI1&s~faEQ6wtJ+^@z$ft=nt6n|2>FLQ!u<38EFKqWsxFa-_wo7R{oGByH{rcgra2@?wojZ8o%uK=|pVfE0 zHF*;(gLvC~tUertc<3x7li}~##C38k?Qhehd&hvTTtfLZ^4L&E^oMxGZYntn<+w^( z3Z*pBIn0mCwfV6)igPoA>ZTaR4EgKqX~ ztzFQ~zA7Nnfuq#RIej!*%s#a?CHZUfBotRV$&Y z{O5xPvWouVWS|=fzHL8{rN*-Ia3d9Cm)>tAEP|iB~A$4 zf=DY+FH)^`K5k13cY-w%zPHti53l2ZMjPLdKhqWd4kJ^YuJwj8Op8B}wUC>$>&a2`-b_*}3#=`9HLCsHI778$-_ZNQ#_T202d|s}n|tAzk1`X`aO zYw3&L8sWGxMt~O;!J@btYi3tCA!E=l)*lb-8HZ6(7K z{8!4wyh8QwzZC?6uyZa*>!|zC4wwBCOzzu3VHm|kCV)99#|I5o=1SfwUS=~;RU>3e zZdTiSMyI@*EOKtyqCUeiSdUnbccwNtNqOe6=wOxl;0!6WS6w58gLzlVM#sH6X^V9p z>5MY$ADLLiGldCmuIH3dR|#mOs75RB-dA!(f`0)6D^??$nwqKST#oYP!o7!v=E2CR zv)H%U(*0rtl@J+-hOLeqyD-8ntCA~-y&J`pyjf&w-cUhWJv{yr-NrhVLyb&RSo}d8 zt$#;6qoO@pr@py@6vpvEMidA`Zi@opW9)lrtXy@X7L66mV4C^>zFAn9Mi58!g-Mo| z2rrVw#Ey(RMu0Nf2xHZj?rN(3^#k zAL@T8S0@nLaRut`WmI2mmCELq2Sa0@;|;bIHlAse zvd!jv5K2#Y6njNDk>;JAx?1;i|M64xR5u@#_>?*IQo+bj7tuS=->J*xL^_d;7=pp- zc){cPDf|pch`CmJLyynYGk~W>liHifkb`aAu00-CL!s+iU#Mf7@u39+UC7)&NR`^& z6I8)mG{M_*qXFEsQ+9{raO-Yp=)rX1PWK+n_UYyk@8I{uKqGvm5|xv;u401%k(`OX9F*d0O(4>`0Q56_n z#RpKTaLvi96LSM>mqNslc2(2E3Q$fM$-t)tfy~WVU?k#<=?x@r)@XG-y`~L(I+Lw3 zpG+_);m-Qmy$u%ZU0HMR=A1XwY^u@txK~{!y$+`AdRS&bWI}aT*=h~8gV2xL;*M8p zZ=PNn$RmBhPRNxI(Kn@T)!>)*|PM%C`x$MU8$pX7xQE^eODIY6%N-Nnxm{xuM!6cacsd z!x!ExPImbpNWc+DmM-#EOA!e&x2<%Oe+poZ)4Qx=ebyn)TPZ8k(^G(YSwVKgtn=qy zERAeuDX$zGEI8Qc3ly?d5|I_@@%~5!Q%$klg$#I5l{yW`^Y%ymMm%rDyAcrm|9Hgj z_@?j^JJq{BI>Y?#;;^cD2-yPVIzhuZq4hXub_!T?PhC7czau2e8O~kkd2jvlJ}+p{ zq22S@{q(W;E;-%#an<$IjSVHEJ@3Jd?C98=)mXR|b57QKLIA4{Wbk)YA%Sm{=)Jp% zli#53g@Ux$! z$B+1i-9fF7OTTba?&$Ib3U)S%ZJD=uvmF*9FrSu~Ztap`uB=A5Jhh7Ht`%y1&3QB& z>?i2MKsZw!@MdkCh17nxzYn8>5*8>ndDeb|H`ra|$0gM?Ai;n)+Y;5dPNEV>z9IGM znYl8m4za;MMh1f!%Ahj>dQ(e5cTfP;UN>f;bXw>Lb`_nI=6wkcM}c z8qyH(928NU@Sh^dkv-c9oWkb6QO)Qt-_jn@xrN_5s8wyznrwIH4dF0uZg2b^>k)=OZYPCkKTOp0xok-dz=Dt%A}Iy_~petE#W ze9nvieR$0I0=XnFg5aa)Sr3+xTETd#yw)?DXWz&6Wam9 zFX{S4>Yz*qUi=H_l>~bB1+EC+C@rDU^aa|4uaalHfl^hZtIROcP@Pa1Sd zuV)iY<3B`#15u zn?xm$kBX3B462Vagp%XE2&P|hyghd>2XZna3lM`{nc(kC!{^F2O5VZ%fte%I8PG6? zNoE4~U_8>oBooVZrhw)OL&TpYN~=Bm1Yv(V-k(zbEN&qYr3+*hQXQ=$EXW^y5yemF zdW~~8Tqi$ikMUM<9h6`LpzL-wgBm$ow>V*1Ycy0$OM6DMptkRa`5tKUf()oV)0lte> zbyXBAM&dNauwEmTyn)@cwDtb(%h9 z+F0Dl2~!(#pM1i+g9(-p`k={3sN(;5Xe_|Ni^|_YXefssj5Ha8 z?VX`+Q7@}F+;_IRc@Q4Xd|E~S3*(ugtEDJ$Pj!@f5g0sPJ+Rs;O-8;T`$apcdU(p& zG9MRtho5sDMeHfjflnYybKRg#+^8e6;K$dYb*c3QI)(2LvKmZDb{fz;9pq7})JsN= zmOyA;3v(BK@M>x4oTH_*G)2er(vl0#3YB3Hj*^^6)iBLqPD}R%M~H_1WL}yBx3H@P zX~IsY;T;CWdYhJwyb>F+mHM==tNTvv5jM1BA$JIcyrFk*f}*G^_sfajDy`L6Uv`_2 zFo@oxylQz$J3WkMbs(Mo;%~D;=3t{r-7BwCS0WV{Rat5}EF0AVT97!z%=VScwq~$T zB_gOIOe6gNLETzpKxI=)71=FSAe14jKGlR1=~rRk3LUoyNNevDmOGHPM{8+99BdK# z2zUQ~HNIVafhQFMRZsrV)EwT7;7Q$Zkt~Ybk0#5{(A|^dCv6*V6`fO9BBz_=RVMiz zll+4udnEa%0cHhhU9OrkQVUGF7-5829}@1rF)*_m+M$g1=o~Xv zqyGIpzrnPdbRDv`j4pa0+``RH-{a*E#s)<~W?U3&6@C}qiCO-W$Qn!Lqq8W>(5SDk z+_B0W^^Q6mG5U%mNu*3=hMr#bk5AQgQWjlyXhyjN(%P|H_S6mTV2@1UFA~s7<%j%9 zE?;Q0<$VkMXclbt_N?{>zVc@M*BkiE7wm#@1=6ei>YM&-Rl(%Un&hO53PQJZL!8>I zzD<#th3#xsukol+f4|(XvzpwxV1wH2q7$LyGL}6Zw2^MK5fJ`vNec)^r>>EfMcZ9P zTH0itc4zHjYw`GQ8mekC!vv&hq!@BlXItLTj9o3ue4T0|jS@QWS@{{7h?R+`o{zO` z;pTks|3&}zf9U>LvuzVOp-lVW}(JcvWV+%ZyB^Zb`e`zQc>1?YV6=JIFoY^7nhGvi6Rx|RE5l-);?PTyQk}Y>=14N zQD!atcPjD*e-FSgatY<`o+v|8nS_SaT@9stzJ(S;g};cR+A*mJrPRvDz&uP~Os?Eo z%BiSpHglg2T0J9~f~dDclYa4LZSxNIX3Q4D8KkRf0~0PqeaJyLpL3yUmA@~+cI@s2 z*_*{UIk!sp1bt-zW&w}YLjtlk&pq9jy=m@wn$FIZ7R4}$ydOmKs^5{35Br@D=!!S1 z$$XQx;t3WQK(z`ER08vBz1j<`Hl%gY%iwCc4{gott^`6$Y}kOAGYApG!YZYpMZzav;cZ3+#UZvRI4+U3RZL*Bj>Uw?JVV_ID;?>h zHZwaCk9K5v^3h073G4P-LC&#(oW@A!hEYi_dx0ELB+J-9@=>f+W!cHmM%&010l-K* zEma{%^4A5!XRMhuf(oi+YpGUA-fU0ptZ_g)UPuCD&H^%m&iW_qB7Q3F7V>iJ0{Nc% z8$PJXFniYOOL+YVnIP!Ub+3l%BuTv7Ip@Yh6RrN1Lag+~Tl6E=k1urf=hOx~*ablp zA@g7XB=d{HKw}|i%sXY`S|8~hOzI?!h-q1L$|ic3e7{S89%uqd`de9Ld5qo43SFsx z9=}QdJS8LqTZ>|BEwH_?S72+g(iO`DE9^73E9*EhwMm?CP}6IFJ}BmH*mBdm?c-0S=t6Ok9Ay3C}UME|+C zW6(P>Mt%io`8&u>VE)wbIpjr2f(|{I$*GeCYP~vsZtgmHUVWQ;(++NbTM50z_cz3a&Hi5)L@T_3g-8z_ITt;bXMr-z1%SJ zZL<0d`(vrY8*sDHisC2R{E(;mK$16$n>_a=6S-06UUI%*i)mG=4*ovfs1HEj#i$Ro zJS@QG&|?t>y(M2VSPb^HNon|Qy5rc!>{NgF1nk?^h;zmJ(p*8%t!?Q%DMR|MpvUG*N3x%x6$ zx{`B70!~j_W+{tc*NK#sj_dyV0z)!=8{t5ta(@y%#(aY7+e5ia#%mf`b14BndR6Sq4~FR%L{!rQIY-M!hn=A4BqCQ?XDzK`{s6A^vSHhiW_?tz}lCy0!o#6%Xt`ahcyO?y(L3|U` z|FNAK`NdS5{W##Mikyw~-zuxo<2a!H%de9tJLM59g8v`Z&ILNE>g@XoVIUx3qJRWN zK?NmV5DHOah?0`XL}vtxC|2X8h}tS%$PA!}1d}Mk^wfK6ZB<&|w%VJtwi>Zw!YvU| z0=0sofH&OZSd3aBfM&kmf1h(E3EFpk-&!AQg>z<~ec#W1_H*A@e;kmV7V&+tmfspq z9E%<(H%hq=qG!N$0MjjI3G5fRit7*~TrNtL0QBeRC)CJRszER+H?S4N&drKBsU!4^ z4kRCd{6=NELgZ)*m;a>3j%`exvZtc8M|4DGI>Nd{XmwIH?mT;ALh`i}Hg$qo&o>p# zv-=_GR|eCY`oKRStyTa5El_i6Brz|)l4~GyF5fVjslX6=z+)1XkG?3PO~TZYQ*BN#<+0e;JfVl?{L8) zoCqp%#BpJOv_bHuIq%0t#ji$MtyP=^7{L|4HpgJeGc1&z!ohZqote+*UG0Qce_|l( zDc0hWp5C#=0rwkv?H!XkNZF*FP=;_XJ2oKRJ|ZW2_=FxP&Yi&SXRt{e&dWnk=c&P= z1Uz4$@=>-ZR;B^m)JX6f`Ih2O`^7KnQoQfM#U(JTN*=k_odTVe(-er`!g<%&>tp%En{U~9uc|*J>b0$CYU-LP%;t#)f|EWKF-wSQ}7((THbTe4LT;H9d&nxLR zVw4JWsSOZ(Xay=->Ko@@6P~$KF2P}^^b4|tol~;us<4&RFy_07@Xj`^G$_8q972!% zPuz>VIU4jn?KW*`NGMiu2W_o98mjVbZWN^Aui4=}7CpTJ+Cl9@#hEJ0M-)9wF7@ac zGBPXO6;7oC)n7@pu|m-%Rx z8SA9HA7X!+8U;?6u{=9P%pn}Vf7X~fPjs4-_m4+t4$jR2BS%gX2eP%T9{Li(Ui!IR zRq24p==#kotpp#61_3>7BcL-->FB(KA9aG6mP0|Hz#_m zc$3kz`o?m)q`oc0H&IbLCW4_bpH7_;O7NCzl3u+WJ;aw$5vP7E z5uJsczGdUgRsGs`N2z{q-);K2hT3J{S+ky!z{{9pN70QpGLov*Rmpw-U|_|2qbIV) zC8f1|4b~0j6bO|R&9y)J^20WIs&G}jBQ<_`Hov);txaBO%=t?v^7L0 zXi`H=+Ty1fYlUApnomKPJr#V8f-$BFq1w7+;#c(1$;)}noteXVf9_$;j5pnfyVE^J z(|wHQ*IH>J6hjSS0pZpgeL$#+^%&c@nn}8dBt-TlrB!+=*~MHgMCcDMn7Xa5z*fgRsk%R_nO;>%qR=dhiQ8{EEJslJrcm%(}=XP|?ea2rzLx$*E;qYKnB<%lF0<9kcA zolOdUWZp1S{mdx!KVa%W;Tm*hb1xRt4OD9eXZpLj-0$x(^w)O9GZGs_4}x`nd0M+I z&`K|YbsJ}RK(j^m8FsvX&Xj-mwJt}=h0==Wm&G?^l-N4+0C280Wxn17`!kO>qKn^} z>K)p20K<>19F4d34rhO%_lmj?q60{nKNkCsxkxi(TOmnOr|_#fpp3_P%IxOV!h!RT&g{D|H*1dCFq15W=N*@18gzN)~`3iy#ZJl0-}E$X6W_l`P^QB zn~BiTxJV~-A21Kg_z6b7cNaidDO(6TF`rNJC$@$7*#aYo0V}gRps5&O&jp`2x!@1L zsE}kkh*3yVr~Dt`L^DXzJ>@4(RD-y(afrz$f*%3bO)9N7UPlx8|`f2ISI>3|tw zKOie6+C+c2lgI35a}wY9^%wWoQC?Ts?w+JiFBVL@Q&Y=+?{#>x*I`jp2Oj9sVNp|H zb(Ca{(f%5Kx)rqkU}IHEh)N0Of85>F!;1GVqX*_SPs%yAu{PZc{n%-8_-?9NZH22= z^dJQ}UbY?Fq?>4XCdEqW4PM?iht%e_D9A$^8)HTp( zD9`h=qSujrq*uWoRDn&MGdKNU^5>x7D|-36ZqL3)L4N+j{h1NQmXK^gBO^l}Zp|(@=f4=c*$x5cf0kQy zzbN3QGm9dLvoQX^p+@JAH3RAAnt>eqLy*RNHd#xCTAv7^BMMFm^Oq*_pRcN3zg`kH zOm!++#f?Dmt+wbMOk8 z5ld%H^SahV%}Wo{e2B?G@9c@_RW1y4N|Ujv19*YiYO{@qQY&(6P`Jvpd76XCbMg7< zW@ZC@ZglzBZGe9C2wfXj;0@s|YfIK-oQ>c>-(KkguaB2`C5iiT3lOOJuT2M{N7kl$ z#*PWq-jNTa1co8=ktbYlOuJKgAt_HRRRr+5JENN*%*AqL@vjN#)UgTqESK=+1@D&O z0cU!%9=;!sHvbS=^KyR5n)gN;h~`ovdAG8Go@`WY3?zdq=jPfaL*+X3Wp71@*Askt zS6S`X`H{qp1!YUm$qm+j45$ZJw)uJ6T11)OQ4k6~y_%Jy=K#-Hn>x_MvUAo&;`4Ao zM{=OgaDD8g$*5)E1{F_0QDKN7hk0ufeFc8nT{`hIRUBW7k_gVdq5+SR8}loIEAPnF zU9=YBEMnSajz)ao^`;z>{R+wfUREIl2fY`jAJ}3f+1x^zHq(&Hu&7w22-q5sA!~lwb@)Tce_zb(@wwo&i}G3K?3pj~R(v|25EfZ zN-e451%BiBbt=CEg&1-Q3Jq09kL2ZXy&Pusf88_*W7Fo^57X&KK_?%vX#)J|>HjSy z{kt6M{%`-;Mw-%nB7iHVI~qk5wGK3U-9 z?!L|b&YEjZk!4Q;7Pp2@inX$4cjTHsYc=E8C@c_=BHW$66;E-NZf|AITrJ@i)4x9* z`89{>1Em~g#UIdfr?i205dUTwm_yz3Yef=JH4E}w9uidZw|RVv_X=T{CS0%0r9Io` z;Tcg4;>Uw4t25{zkAC6;Q-Bo<;4mp4H*rEcOv>dF%lxs8mLlkWWbP@8f0fyhyUeR= z>^Oa=n&&r2PKPl=AT(Ef$pI&G*ZaL=vIJPhFK{tD;JXTz)b^7Naox)lVc-=8t<1;5P*dOEnFhozuriXvf!?mm zcF}50J5i*t3DTJhsIiI=5-n)(atXLrjSG(etQy?d!I<`#yI#@KOe)~YsN59R{xwxXRN!16L znUDHjY|eSa}692;Z=feYVbQ>_gj_z@t@mxxH{a zX+B%eq;O4WT{=dlkIZr!qMsLd{gfdU+`!h*LFOxysmtz6A9?tOsvBFhEO{58VZi<< z6rVw@H+KnV>9riSXkJ&+05;H*B$YhN_$ahnU(PueSNw+eISC5%|&zp4F}vtNPI=< z)8lEx8M&K0kge|&bnjYYlCHTdM~5k(4STBZGI{Eun2W0XIf!D5>L|`97m@iF=_Nn< z;Gj;!iHA_DJ`A8*Yi=2d=3|fS0lKi|6zAl5l|%yuDW-c>e?R0@7s%-dx^CI?qnLSt z-bcMu1T^a0zIGWJ)f_U`FR*sB|W*>Dt2IZ2G}1{HxjS4Hf)3^)ae5ZDUfwd)uP6>)pw# z%^2#*tfx3hCgeY;QSi6=u)qbdKd+@GdlVjpHYF6NU$h&anSZV`@I$hI2No2FFBz^r zbvX!K10XB%XTnGMfEf7g_cZ}zt=Ngw2*u{bZXn>%x1FrtOs8jPx8hoAe_n9zvV11z zcXk&oI1RGmR*n|e9knZNJ$C!nL)#t+mYK=BuJJ$-#HC?mh40 ze{Xt;TW4RtPBDM?Qzvu$#wG4}{EMnEH?f3(`Df1z&XMe=D<2D`>J3Wt*q7VrFrsfv zb>TSbALQfMZ9ak;y@pntynbT$6ND6&3{(%DgNUavf?nE zp>bPfZ}(btV?cix7~Zj(*`-{>K*hWEAyJgt8Zdxo`SYhEYNJif7V=j0m(v%D{^g^A1axWpS%iM2NTFC z)Op$DeB0rqq7v1nd(XQ-25fmN>0yR3wfL8X3+6*hUK}`j3R7BG(dN(DLqz6e^_Yy? z5n)5G21ix21rI$39We%8C_49~PNCiNDNFRc(Jiqa3nl?{TaY5A1|oVr`J7z+e|~;w zEa!T(57PIx)f6C^Qu)O3YvhmloM8j}1utky{&c7!?u{1fop%rQ(Dr;ig190E&uv;w zxRw_f&w2bU_5Ob1J=r?xm-y45Ivc^MyfZ5{ zq(N|y3RuM@<$LxvedrA6pv!S1DA)40X-V7td79m1Ve4Y#+8%7R^L?USSmi{$VlCn< zY#qsvPEpR{-e_`kBEkn)t$q(HB7<1lfQ>)%xYa)LKH#xJrWWSRYtnrwi8|X~JC4Jet_fbglNlk9#tAlgR0U%gE#IuXao1}~0~7S{V2Mw&xD?I>tmGg{ zm=oYtw6YBhy`nKViksy3r0s<4v_0X!+4{DY8DUrFPiM%Z-sZ^C6$l8^a&7kCB$ z51rL$Ua^H)BJx%=n#cJ0dGN65gaaSga!v4(^{Hd*IF7w-IAa|7_<1%Ks8)602J-Q| zoNR@W*3|cDXA^ZZ52F-bdK+!f=H;)@j-8;Ren4Ro=)|E~2zTXHQ4>pfScH^IsA}MQ z{Lpe=LV)mA=8LZRK>XxN3&i(phT^%@P(e3^Aa$Txac%vn&_BcerK6{`1Zo@*eL+ci z(A^}Ba+B^+(tb8#4Fn#?_5bzXuaFs>NSOtcK`fuvl{zZ_Jn7$7&;OQRIKWjJ**IgS zNETB_rMty3b4p*Fr@?MFw*Mk?tMMuoi6-@drMW20RWJE{CE| z`{on6f~99=&gIZIm{FjPUyqf|d$In$S!eOaIUlAj62Ef+N$6#fxqM3151mZaBdFTP z_A-BYdWXz$^m&n54%pAtKH2%HxrguS3U(9Jdnft6Pd=5fJZ^?G-0;>xLjrf4VU0Mq zcw zjtmobakClFa^J~0 z+!bE45(lREOHXcOWyjEVtO#jmYbbtJIF2-0gq$^_FiAb!H1AQs+RKR{@Cs>e5z&a-`t|w##B%&p>Ys)B2m3qw*3<)K0w#8&1UpEZI zPJybG03$1PoQ)+IR4O`oCvQ?cdj?PF^OP|=hB+(c;Lp1V##Fac`fFGrb4g!!HHsVj z)$n=suBs43k^~7r7j~c$^ME+s8HpICxx3v9CY~1nxgu_}8+|iihEc0F6ViW|gdQkG zxRW;>`FyB2R1mBKCdB#w?K!PUMT=1LBMmBw?uQTpShPA<$;FQJd&z@LOkYgjb<^urw%`E*!eP73&hOyuXx>y=uznzK9?*WIlc3)}y;bFE3Uj>IX6!*s2W6rX z#RRybRhpZ!m73od^q)2GOGJmXXK?=K(Idi%5kqXfvZ6H4qJ9d;uSA?(fejr7d6-xh zH_urM%>K0&IO%SNR9SL%^e2`iq{aHoaJRW_A_fmNz1uUCgIF#xwzJLHp^_xkHsy0! z`J4}v=W=q|W2#Iqk};LB&=oEIV9l{oi6tUTZis%N+7t~+(Z`cPm2gV?F<<7$XERb7 zFzu9rFji;b;+LyW#%4rD&7qu|3(8#NOvK2z8@?jl6voyMqIaG0&iT+28CpqV{T>@6 z#MSY-{0DG+IZ8ez<2QHuAw6A~XX8c^cjWtRx;D{|G^cY8~6iqur`qHEv7zU1AnLVb`%Ddl{ka`z1NX$|#Z8gLa)T!bEZuH+y+ z&A2^+ec1qehI20d%$zGew{MTdzJIq+2z2Gl=@m{~pP%Z@+3|*TH(QWvu6j$K*ANsD zAmW7C>5pjK-z5|ghjsrCI9B4lWQ19}nw8oi-Sa=#FR6hp9JvbN8yIOgejVb8w7Hu` z1;sJ!L|n_1jHRya>)6dzN!?=X6GI1lQt!pTF^^7O@M=vWZOzE_m|#2DE(hp^-eH0E zuEUCf@-9`G#P}u?-K;u_@{V@}472Rdz=itkI&+a<3P#E1(Kv>hCtGxF#A^uw6W=F# zHu2%fj8yFYVTM%`JOg*ula+M)Ig7)`ezMRKM=GH8NL&QqMkQ_M^qgiJcAY^-YM@o%xyICooYXtRVj$tI z&vB0zvlcoe^@=&|i%zCDv-GR}YL|W>(AK&1;6ULZ|9)tD+GE{?Uf9TY-R$r9F&a_0cwG!zUbcQC2xL7mqMg#Ku^nP{4j%yu+5HS)3MPZVn4H@ll&U?} z7A)*#r$@4jCLA^0V1%YGU8g6WgNp@$s$_fnx4`hezu1ACcU9Mc=&0#35MMIKvf%tp z+~vS8D*zV^lI)>mx#c%NT5?v(dj;u%ClGv8b?YE0K_J9Abn;&qfyED^J&@m7wBT!3 z?DpzB_@6q*2az@@TdxMhMr*ciyBHD4)Q z%;x9Q@TCYK*kv<06q|q^0`RzS5&XfKrEysrN zoaV{>7)e%0<|shYX=ItFz~;>bsSyaia@qOVzc_)O!rOEY(*P_oY8Nrv#2jg6-$T$@ zW351+1yGKkt2Mdhx>5V2)^qY6g+UJ$PbrA?m9Ioo(&4x5l~cL|r*p>h3;W3XEsqsb zY17=i+l5ND4UkWe_V{;J3JaOvi}uJM0MK+&9k;b*+^>(vJ@88M;U4HZ1Wv~xunLF3 zSvUmFUXEj6BaVUetbPo+zTp^{$m=zUUM1udh(vVyPGT_AiGyM>3z*H({0H)VXA^N|WlPWakvT`--~+D!-hy?@Xc1m}S=qXZtn5g9R&Hf;g?dPt3N*EfUvetV zd`$|cEz|+}u<5Pl22MqJy+EQCtm_FQix?_Dc<3Z-W7xisN2%`--NE`<`$)i?yQXvd zH~mo^M0Oi^;eMuoySxBaiOj&*Zn-%{ro+B zhQrJPKiE@_Io&UMhGm@7+W^X1I*hq3d$+coQd%3O>EDvJig;s~Zw3%ccWT!28?NqAx4+ zg*}tq^vW{!B>M8e^)e$Zo?Kv+=M7a>d5$r%&llo+8+a z5sShoUJ6>`#A9AA4?EX0aOi6Md73^RUb`x%c>Ua4h;Q+#&dtzDj%hCv;%jzN#h&f@ zy*sHl+jA2gturSl^gP+K$ea!xvnkZ)GtuIyLjUlMsDut#nmkhuW-$Fad~%=HOJ)2W zuX#6IwEdXP&|-)WMqmqZdn?c%ZI#3wx;=A}05?w!wO|#rkGvQU*DU7)P>erU3V|hY z5ny9}2SuPE$oYwxF4aswpfo4%4-EC26O@}cuOGg5senAKdPB^+eXy!B+7G$y-*cq8 zk@qE!6>@?#S9|RvuS^^rN^g_}jLELiP6h^@z`c^Ic2Z|PXSC5C;_mHAmYlIFM0>W~ z-PlRXYB@a~KN73L)_90$*#2zpwfyp&{&43hcbr_ga&%bP=ZauM=Q~lg3Qay>! z2~i;)rgQVS#!OaRH3p0d@jXR$RhIZRkZ$HNChxziGoOzO^;_=YW%Ro%M+=Hr!TSwQ zj&NjLXjf;EY8H7(+?_|#jY_(~OOmlb`w=d6aHrJ7iNMPf++O&%;*PP>AJg)Y2Sv8W z`CV0^niN;RE5hUBl}rqXeMT4EX7qaWn&2CGi^Lga^ipJc%dVjzF56`5G@I+-1SQ%x zzE#A&-_jfW|CFh#J~LJ3=h))rxWvtokqB|zXH<;Y)0m9JxUrkLS5tOq1e&~$-q~gF zZ#(kG!*v4^NRDDOTststEX10VSHsXU+C)z+1jzmi0V=ngtkfe|(H0J#+m<>P56o1B z^noyZx^}PFQ&i6#6C9QI#CK3VUfhDRW2fK$!Svtdjek1J^2Vqnc9sPP=t39|ROsV1 z_kIo{!OABMY}r2+-ah}tlT*#dpNKrm03(K=MekybdoM?_+}H&x7I|t=^sP(E-5B-> zMTlI{Dzy83tp1H%g)c=uxvSu6{xpSEGNRAHR)_iU$g5uHfhOm=WGze*8gAh0M*GN{ z&tt_Vnl{ru>_kXz0JVvT>aA2U4AJRs0klBqsbCnEYgM+`T^2nVt)DIxIE$@;n8+El zTzh0@zont$g>7ujs*1kPf$Qbk>|O*ISN*MPK|GG_3* z^2c9WFt&WED-eR}-HEA@YsRxRHWh%Ln4xRBHKywyq>b4`_7plstL<&U$5Bd1U}Ln@ z&Fh0dYdWJTx>TzE-*)BLUGZzj#$#IrxoZ!7=5<-eCQ9^J*BAMV<@GVC0yGW{Gny1!7BX?xf1 zfmu5lV-@<+Q7B|D1As2y;OVSm`M32aIk5T^?T-uBq>i=#tJxX-x;rU&md!v(J0ovc zk#L}3e7%ZM%i9z=Y6(SC!-5xcFZP*-yxE5aULi}~KJ3ZnqD!A~)IH;@*7``gb*N|# zgkZitVk$&}#X_e5M9o(+*TuouF&TW150)huE|Q?zJtX5SOul{OUCd)e zk&x4~J2U5;d&b%7$5Z`IuliAz`0KP-@f-O}l6t}my805gl~dhTevgw0HH=p)lhn%8 zgIj?T5z6M&&TF&n91<(Ea;k$!pC3zQfXtDGkmQQ2A(TGD>Ekw3<~Gz{4O#KXM>`H0 zj@J-=*?DQNp;K0f%CzKXCyjMn_l6`o&NQ~ewo>%^VRlp>@N2~t8r5xnW4;g>*g|;% z^(yIw*YYCv`Pa7PoLF@^Ln)81+Vt___tJ}W^GQ=v63xv{g-;Wzcogyc^6a`vxm>IT znQl|%rGsqBCwOT%uS!M-% zf;|Qki}KB_oK>P2Zqd`3-_u;ji@k1eBG(P>%tfZ|Ns^%;+`AV+{4cUUEk{{YPPJCX zA$mUkragI&#o)*%#eHktQLyO^3J)V2TuYD!&KbwVy83E!vxMNHEnDEqMK0+59p2Tq zzww0a`;yMn$DR|p%(jV3SuP<0UDK#Jhq;{g+c-G54gj%%mGO^o9>-?)gSJQ^Dr^bJ zD&xZ{nnE|(`CLuBcQ_YfBSj7;#wZK}WKG(vrZZ?@Pk_+85|T)xv`TW3JO>&4Ui6MSwAcI+ ze9EHrwX0QhMZN{PTz;(>&8cJpWa~DkusE`5ph;%7H9CS2JlN~I+H8BbVUX!{9nAnt zE^5q8_2LDk7wQcFuRT<|l?ErQ9nOrvN!+CNv#vrK6PsJfwUg$t*90A`3GdI?_hz$HPawnwe{pW#dIkgg z=`ZZS7|T2EsH_&y3NmE%dOcc#Nmi-Bu7dxU-@#m49emQk%;y%nEJfSh)%k?Siqjan zxfTjTo$qGxe3Tk?@;+sFo{-*F=xrw-d9aRMSo-V!%08%FP@u@biAlpl&Us@9ET9WB zhI1Kjb1#XIq4@6Ce3y(od5o4=W|%Ang4~hYY7pcmZctD?kf$J3_8YVDc!t*GpDQp$!K!R%eH?Tl3ulss(shc-h-1zIgAxj`z zAF_ROzHVW8%`?k8Phl5>Xmj5tp^=1AMH|R;Fbdh>neg!WVmKdPQt8dH6KONgakgtb z6EvPu+>zTvkv{(dwK_!yL^^>vHpi_4k!AYlCizqnXlFacPPPh}6h0djZ7DdmNE$$6%BOj68l`{cBN^PSx5fTbA7m&|oBByqtl|&b} znST@fPvCJQ;1P{sOp7@kwDKy+x|_^!Vwdz8nU&Rst4eC{*q7@!6PLJ8)7~b|wMEhX zi<|hgXfcKxjg#i}v&?SDxeR9aaB~dWM+xaLAhDI2`7&Vli7p|y3-g$>-~Ut#S2~mV zV`@h!>2u>w<1;_)aynW84HML+Xpo7#aoCW#BJHh6WR}C4JWLQ?*u!O^=3c|ug!sTY z)1NGBz@j6o%nIPFbfjt8G;@~SqiaBEm_V#EkDwifd#5y zX4?Gd)*IhA2>nV59*)0KDL0u8UHWk1o+d@2a02}=rIupCf&GldM*Kk>4o@=?NsLb3 zOd{v}^75s#3YJ#nFR9pKout~&=Kf020C?q~DXUmkIkp-9ybUi+q}%23iZ$gdFt+Mf zs7`cwCDS=jVl8uz(fPY29H0KAdG#TdJ2Cx9Ff`B*j*pGRrxW8Mk~r-==k~+Xlh&0V zp0;YN8$vT9Yq)SBvZZWs6Z(HDY?nBzo%m0+`}?dMLsD6A%4b}l>D(k0)5In7(u8@! z0&iHP_{+IRa7j?O@MGe3<;41zFS)h@9ZCmhE!8N`VDea7l~3nAmFl~0a(WEnKA9In z6-;C^MhIos@h_oV4wGc45HpI;pf{ES_6>7SSek>9 z6noLlNce(V4^wCGV6Ip;;*_!_71-dt%8wRSFr3}0swL2F3dQ?}<7j2O-4qE_a2{78 zJ?NI6d=MJgp0biew>sx^)V2q!r-f!>yD(@jLZRTZ(fqXZKg<>6#kxuYJ9UWQjX>2-%1%G zV*tyuqym=GXA@KQGw6fE*QZRq|F6>;&lib;YAyg?tD!x(N9Ke_+e9s#7pj z$c{|~*0FAw>$@^UZ>4wW_u;b!?Y~%iVpH^zP~w6y3}!uZ$&Zq}KI+@`LZ3%iT(0;$ z- zfT?U2UQ9=V6&s~RB{<^rR__yN@jF~YR`J$YkRT`UK5or94d0G5evu#H@OVh5&&F`} zD-zYdhgoOZ{JsxTk;5QD-Kr-BA8I!L6w1hW0b9A6r~Prc_Pr8zo3|`?yPEX~E)mH? z+&xI1SffRN+fDl)aFds7x+^W-1{*_=D|P*PvAQxFe8Zi94jpw$Bld`oHJZpNw&R`VDhzP>z3x;`n`(tt z5TJwZ(+R=R5O{q$P~zGiOLe|}T-|-^(?z9jM zGX*7O4UL*U3X}&|#tOisuY*YmncG4r(q{E}H&bBDOBQXO&;g!>kU6{Ci< zNc8OBN+R6FcO+u3v%W1A@wN!^|F^g3;D|Ja;x5b3l_k|-x1yKb_edk&!d=a56A09ryUt^5TVdTBMkQxi#lN`{Bm?AIs=kdVH-sGrYO#WF|88 zOG_y3yDY3Rde6aiReQ+F$7YsQZM zPVjDy%Pi}|qmwBkb@yk*{KOZR|8ANUmn-xGHlpGxPmwh@BM|?}&YuLEoto)K` z)@t_)fCnNbNDH3WKp_#1l0XSwMzIjy<`WkE>}%NE+yPH(b{#^;t~= zeS&v3G7^80ntyEN9AJ~X(91|e=_sHLckcCHLAMA*y0^ByAb7Wx%{zH-Qf&sv*a_xj z^%7%*B~rXmeL=J@|M$b9URYR^xvuwKW&Xn|Cog6(IQ5v?#q^bcJ0*cL^m08f!+0SG z8w`VH^eQY{BsFFh?J2^NCJ(1{7(zJ-0t8~&a=T3uv`2eAgLhv-qVB?yKyQf{>LfXjgX;!y*fTj6b!5UFo#@)Bjymb7T=Ln7$bAbdS(=l zxQRlmMb777)W;HhcS=9ZvPnO-kGxNKtN^aE%pkW!KV_{#7kICszLThH2!F@&r%An( zzgqrY;%^M!^#`Yuh7?HO#2-+TMv0z2gJ(aU|F8Map^R`52eP&HiVcPnfZU6;_C`?)tQoyLgq2#2q0yZ5yZM@MJcd?)OUq1r;xHL{k*w}69q15ky` ztvpfjy7?uLT$zoO?^_Rgd+>7es(eEJfsLLU+0awYV(%uyoOh1mxbLGp$<43%vWn6j z9fG~06YV4KG#)E{D+qfAyFEKuzEO^K$BOY{zN|1xEJP?I26mU0$WWA{<8BA=kTYAPD1xor zo-2X#z2b5dk|=L3=eW06CbZTCN{^XJP~#l_Zi62{z0y>bd~HDnYW+L{P3)}p1ncT; z10|tm8B#DWlc0bN#2!NG-xN-q&Yg;`$#S$QH&nPvp&U$K+DFdj zW^3-*Bn;)cDRl(q923fJ3>B}NiyfTZ97y7JwVTH{Q5j}IXp_kIHlO=ne1JXnYb19* zLV~feF&h+vW4=DN|B4M?%T*^?(PA50V;ZLJVz*uYfey1p84~4+WH)}RhxPWF%M{^2 zu{16lkw2%E%7#%4Jdz>hmr=}bR9MinlkSYl2fCAl?1W!%atvpHFeA5cjDT?EjI_h- zManL7=s}f<)A-HWc!pKU-v+d#o?;*qMd_O{=zf7HnLQb(g|PhZG3YF(mv3*$-ZOSv zZ8~oezKwxkE$omR955f~;9gvr90%(TCsnz6h|E5bijxQnvue}*-E~KB60Ez2(bT4o z2-Y9!RS~R5GXa(e-0D?hoxR06M{=&oc;r;yX-98Kv|XlM6e26!#g8V(q*jTa#$gZB zZy8Ja!5S^pyvE1mV>D#Zd58H269|WpOxU(%6qYv2p0f6LQ`p6bjncOs;z#?0R40sE zr+d(@#hsn$FxS%=wSuZJBdou&tO)>u3V=SB?Ba&#WSogrHpT$-yBmBblAqjY5l|Vs+Qw_7dL1>7 zP+hR@PIr8b;rMBt)X(KG+{rT`X}jkCkPf+S^s|*6J<6O6cwM28gLf7P&Mf~}k(_THQGaFO<3E+wGR7>Qy)-Xs+_t`=M52cef zFF;+HBLI`|l`=ww>6d`7Thv|aOvVJ88<`u%pSni7AX7k@H;~x{LQOB4?i^$$T4zX05Uw;KJtoqtoSVxXEv<#P896dzyYoc?kk#bX>PvF1=q&< z0uiFL34FI)MRIHy^U7iZn@z^{PNXO&4s!tJJpB&A#H0dTN7{5!gbVlBv3#F)GgOan z?TSb_gK|3-b_J$d4lHSoxy>ORJsi{9L_ZWh(>V9~tqP^_j&F{A@=eTZy|<)?!ns5a z4%*S7_&m??Na`mWtyJ5&lnqsoy(HFA*Mcz=K+Fk1vZDe0vAi#?T3z zK8dL)&WR4T#kU)dHs(FhQ0Y;37O-`~Iz7*=9h8?zbWSc_h zw@`ldq1KBn(UZ$6VS}d>cphjTHK>v4CJnoaY~Gc&gKymKE+l&0T<|vt{AMU90&wE+ zEJpz+@G9_=SyI<=4!;^1xEDY$xpNN;xMYx(wr^&G+sQ=Q?ipn>>~*1F<@QkVE1}?IHbv1)TH;b;VT&njKUO#WatcIqVM}``K9Eu2YeQo3n~PEq z*<0z`SiyGYpmqU4O+Z86UP9=y$|iGmCD#9&+GXk9&ZI$0%g-m#?~PERCwr?W&&iCq zpPc*f>qFPm8he|n-H1xjTR!L>=C=1oq*pq*B+bAcXcqY<6q>c zq~aYy;>W?^r^aiV{14J!?J&7sPln5U1*?YCVE??JB_hlTrbXrTlGd}?450gB3G8f< zAZg=FzUk(l?%2)RmYl4Tcd6uWC~4v8qG?@*o{+^1LzjqPk9qb1ySA9PJEgZ$xvrE| z`eSaocnv~DbPc31RqFQmfsCc1-5XEe1Klk{EWmW%JWU8{eQU{JQHT?m#i8Tja#!$@ z6Fbf2@F!tA5j)YM`;x%rXw~sZaB%->&Q^VP34p-|FJN|jSO^tHL( zD53erScg&wzPuOuF;44BX5h&G^j&@t+|6}y*J1GnfQB;F{2AqrPYj(!*M%2}_^#*+ z)}scdT_OS;si^cCuTuY3E7f6=|0>b71@BpRna^N7Ny3v^vyTpDhm^-02+Pn#TI&XLc)pP&qlwdaL6U ztw5Vml^p$`w}<^R)An35;S^2Zt^IELKcXRVo-6YE0Mf7j(6S4vEV=suJ~~CkHY*6n zCcgdiPQ>7caO`w>EqhTL%Wg^Eq|;;TraGN#^hiwLh1<+=I@Kt^sdha_@LA@^zl7f4 zW;3DWqTTl zk6tN?H87W9$k?Yuyv{1~2$Cj+JSGh7B*bSZ!r7y!P5~x_@LREA#yiGiJ5X*(23&qvHtrZ9 zIf~h%(W9+I=t#;|DK#^4Her{lTpzpabOBbN+i8RRI1*wmfd%8Vt~`M+GK2ZeA|{In zcLhMjtAVGK4E8@!J1`Gnm;0>6&%AuY)8Cz5D(!yy_>Cn z^^lRMN8o#C$O%yn!b#Kw4nFA>+BO{1Yyxkbo$)gLZTTO@=}B@HvXAe7-)?O)7(KH! zs8!9E{w14hj_v(*sAR5tSNzh2RTOiUQT60N`4T_QK$E>cmk8I8&W#qszpJjG_b z7m1(#?Zn(S1xeqtvflE*nP{T_t02h(IA9*5j=-m)v)F)yEk%0UstZ^YL4$A;tL^=g z@a}ueNw()wjD#x}`EHy~#Q0_Ny0+*a6u~V<;NW?Q#`iNI)NyW}!{UN}wI{+V! z$W)s?a^4$|s7@XPUZ={@0(@$)`>@vS@J9K;`WMJ#=`?zivQfM^X1AMZ2-uQ8vzx&7 zb2Xeu>L{j9oxT97FO`X9tdxgHsYJ>2ePLFtSgfekZ3`5+!;GUilo}_4a?j;g@>FHz zQ$e>+dl*u3AfNm`8A)(pIs8f?E50L9RJ=L)Z?srEZf_s;D^T5+tS@#a6@X`E@ z^QfIuYtIb+}ym$K`QBY zGJi{px0Gx_VY22NS?OF3%e0YWo}QZ;)oPijjffDOK<_h|G0~f@7{%*kS3yC}Y=MY6 zYd+Si+-13Ia$T;qE3@qXI+MhZOgUP-9I^MP`wy%}=cs&Kqw_#}vv^0a4%VG9E^LWU zf8Ae(FK^H?Na6YcU4t=0;fk@g`14QAg*4+zrDxxe>D7g_DFy`E!QKtp5_WEO_mI%$ z6!i>@o54a#Jk#s$kj|p9R})pQ*KLa)gWqlolum)^Hyh=AFdy8C4-z5qBzu?4qHbF_ zSTS;CHW=cNy3NrcSeiGTA*Z;VOe8qKN3+BO>iRSJH*dK*6@{!34j`@J#PM~T6({H; zb1!)qyFY{!vv+*MT$FO&$+#1xih`=A!wJ^Jv5x!_F_(|lGu&;j1a_-zeX2auQfsnj8z-eJje6`yc0B5Ry@u8aWWY5A)f-c% z2FNkf%Mp7o16`TDX0A{sCvfWNom>;KxZ+xHCom+Fnpp(E(Y^m!@t`;!8aO5zE#e2= z1+HXab?b?>iGjAA%5QkA2A{cl7TF0iQTDfN*YJk8ILg6g5p|I7WGy|~Ez#(gsG|hi zsqF9B1jCOGK#a?kZIkk2eL$i=7z9i$BneGu=`4N-aA%jtXJf@St2Kny8`m8-GN0I&z zkTIQq7)h;Pr5Z^6PGAPD2`Qz3Yg3W4Y^p9K@|qWE%~Dg9iGhgz-f%-oVJN&V)}L$) zsK5OTMWcHg;;lYA41N{(o9m@Hbpj>$8oHk>+BNrlWs^sAPp(SNKHy`^XhlAx%^s}z9aY!WNXn-Dpk~(hZCJ-pFJbQ-#A6*s?A&L+0q!g+L_ZZ za@a>KkvERVioXkNUP2{s@4@st#v9lJSV}m3zBB%$v5n~I?>G)NWNF`t&t})` zJ0Y4|v+vmGfQd`i*|=w)Ph8SA=Y9SogwV@RW@CKil*f;qShuI_AL3uiiHt|%Up%Qb zV8;&x(zk;ZK4G2Cvpse`y z*kLvmLo{{jwm5c>GR9Bcy0tz=0}ZRn*(B{Yr&4Uz26x}d@RN4V&FP`%xRMd`b-M$OMK#FM`5Zpxzf zYLM0r!uByv9ENp97X%kZiXX<9A>Lk#s!T3c++g!*4|9#xVyscDk85@PJLt-#t?!#} zi5TzKXxmWq*q4UW5{LI;S4&nl%2g-KN63C@+*3IrpNOV(`_#B&m~6^(F~weSNRV5OZ%nw&+%hcaLNz?-v~%!o*Csf6!*A}edsx}Fo%U^f(+k@7)-ix>2=r-VvIpr$}j+5@mw_WKj#@CEaUCCwkmNSAqaCPZrc1o9OT6{9tS& zhUBdk^-R^5;oubFt53mjzM|zkXXvT6HIV%0X49{;vS<(8_xs_Qv*0urwoY*-oDeRa z-4Y#ko-^UpNH*FywQGKBv&KH)WJCd*!Zv!FJE2{v$IPT!v){#^wAg94X20?24Oop1 z)4j)p%ZOJz9E#TuXB?sC`cXVYGVNIf3Gy{B(k@ioo8-7+4tJQ}qFRJtiEs5Gne%jq zfH~y+9ezD+zP~`r(9D%GGJJ{GD^XFkXmDuk`*xq;fMs?pkpV-n?g8~Gfkze=H$Umy zn;*faZABsH(KFN~+Pt1BLy3n}6B^)U@};oU5ZlB2-cOO!R*3tBK&C#AIp|jWK9?u zD~dP^vm?cOgS9=GlCq_}Cya^~O&A%h{|Vh(IZ}Ofn=&B7jqmCnK*VmF+lhEQ{qi<}Vn($2j$!=h|rhb_vEeZsyB6~Z4$ zQtXVk`-X+N*VOz>Ra$;^D;XM(V2mL8UV}d*XA$D-?L=gR-T; z`1+bvZ`ADXHSe(Cvzxi5;ek;0Tj}@8YB%&q71rz<9vxn@@3>(7eJnwly)Py;fN$BU zJpP|J@wqXnp1kx_XyLT#pYx|wA6xqewt;QeWeLg2&N(SqiLyIQco2L7cy{)%}MR8bax)18skK#8|L z$q&9xrzgzdUJV3PwN1&2KJQkM`j;z$<@iQ2kKmVX^Ej<+ znt4We3(Z;5n#RXFxFX#Ree``i%|pe#EK?FJhcSE6j;r;KbUIN#pCMwX6WUt5Iyh-7 zxUr_JVK}vGs-a{s^0!m{T~LHKFXlKVB#BHBuZz|ZITN_0eF+6Xul14{R9Yl<4uZsJ z6leg0_24~N_Zz;I$2Zl!n~i`zSpQSCQ4+Z0GkwD~IxE?a8NfZSsg-ry$2y+F%m|pd zXg2<}(~p&GbS?|AkO1?Ed=seJ{1LEF&Az^Kwk8LVOq)Os7*T6zel1*GYu6LYdJzK_ z8FwAyy3|<80MvNJF0mVMi#hSmbb5(BOb*WO*2}c8n&xCQ#w@V9bf?*mD!Z49CIJ98 zZ^iOp{Uj>n6yJhPVaajtAb3u-+^EgY{pr0lh`aQVh0*4cv}l zp2FUNE6u{iZEgt}EXTJ7>#z<7JKE(9XYcMjxK-xQQaQ=5F4H6PZ#+V5QjUcJ8z|yq zvxQVEr`eul4gLDc>;Y?O`1Sbcn)|diD94;YeNSc>qtMyNNs?h(g6LS2^x~AhjRUQz zo?+j2>HS*X!zbCJlFz5XRgP_pzZSQ34!FwZyHEKpyve?=(R;{!-=X&j?)xWtALG6s zPbFrA-bH!LWd^Ug_bwy@Gg-P^o{PMv-s^dvi8SH+z`_e%{v@hanw|&$HB-({8_m1^ z4$l7!X`=H?|J&3Ll-rBo#81NaA1rf-B?xQ_!dWy`@@^df#Cbt#B zsu*@U9G|t^Jb$YW?dDF>W=P1AHnCRGH8)#L&N^(ym#5I~iP)<^6j@zRwr35rc)Up0_<1__lnJ#~Nmav~Kc|k@jVz$Jz9^WZi@hI3 z{0P>6j|E5~7DNX10f_cqnb3bhEs#MCIA}qlER#|7ESZ0bV4Mzp4*$sYcc@pwIkQ{8 z*_A;SMNrRV)gx)=^cGFj#Z1(6=mtea{?zOQ?NXl8-tFb%=tyWiZO+22kHaI>6$Lq^ zhinAso<=^~ow`Q`>DnAf8Q+5wL~8*v++$9Vy8?1!Ln@nzU<*1N>b)SD3BxF+P%gvp zZGeAfO{`+{kuA0~BJ8s|rxhzyQTW8FW1;5Z3`AI7q_-N51SS;?ASA3wFAESyrSyGt zhQYe!td_Zn4T@xc1uhgx#HsXn zBOd>R!WMnS@5=bw(eDr?s1)S7l^^p)M&i(%KDXyQWLc^9D4^axvAN!~)QGVB=JS(s&>f|7wZK=Xl2^qn~$^Ix#` zG4e#>AKCuiZ{K&5Uj0LgoMqS=}$4)@7?hzNu(rVyRI zP>1y$D(QsI!(8Z$HJG=p@@H*#xYSu=WZ5Z>YsoGPmkKTU3XIOI1 z+!03L8wMN!_=nvi$)q?}0M>8ClS+k3ZC&vJwYIpJax zyz_37nV(kvp0sGsht+ohAlQAtWkaO+lj>cmtIu=BPY4$t2p7K3>NRTV-ruc(M?e;p z9KzG7q~|8H$OF1e#X!yB`Ukt;qllhuF0YYyqP0Sd00L zV;gJ-crwDBb5P&14hX+|%4DyOirq&G9>D7Hrf}iAvScZVw9f4VnerOGIrvCPYrfn3 zn?unOFAb!McxeRdFj3zowy|aib_f`~d`rJ~noobIem7_Oy;CAauisluvHH!`E7cR} z*j9jLXQ*&fwYpTIE)A>9-e>`2ow?ZW)v;c$PR#Vm57Yb=#IU*X8h5!|Pbtq23mY=x zfV|+%zxzqiE8O%ax}{s|P5;x9u1j{IMmrJToo^X1M2AT2Sz9&H2d=YcDT>9nZ`*FJXlLqn= z_JQqRZ+ZWCWVv-|`7#vuL^U2q>Pu{n)?(<4*pf?23AYq+JK{DfKZL)SAK2)Iuz zZSb6t#_mjKa)dZ5>gm9AZb`jFS>&o{w7bhPkIvtfm|RXiY@m^Qv?j3t&59I*lMYl5 z;=iRi6Glh-O}G?UujKXb&)F@BVri1K;KyjMMPqm*V$vTw5=q@%Q z1ShYgRx3eS5IuIn!r0C3AsVdRN6TW{7Y6Hh^SW{&158biII(P>SYOLKBpDVl%5i#G%~{99##SnfPVv@Y?cbP}rTOr@9TVmR>;K9xG><(} zh>P0P;|_o&Swcf-FeyEZ(r3no;0m8zw)A`$RJ!pL^;^!XHPy#`+GCk@yhMGCzu|TF zVt!f7FL@=xkF!lP!eR+9@xa%Sy1e#`tl&M@sxgF3A2AEnr}=^ngdp<@kuXSGa=__X zg9OAWFKcCfs|PJT#EMG7&H^j@*q#E*9DrFXcEsle@A?=4S?FQ5FMskZq^0I8zQ6*a z_@{=FWQVelo&dK5mt0O4Ld6#9=!9|w@A{2$%xpzjVWh~a%}a! zktuOXYtbr-M2>zW$mi^gwbEd)u1;VbC*VuV5BN~~33&EV0VYg^WsButx;*S|Aw(Sy zr(^l%GO!sNmV*WPlT>_|p(cJ4qEuz}+kkmVg^uOBsd+^})gz{FmUN@TRO2>>^DK8# z%BnItSIFrVdyjI1rcs14pLF9x*-J`D{!-w#AXvACdL}Fk)-AMBkF|*KK1ua1TS~a% z^qL9B1nXAm`S-{)M1yrN$@aZgxe7{T0xJXb_N0>#k;D*WlN8aZ|&Loyr4j| z(u6+qO1O6bu{VlYr)L~-rxTXka#!_GFE7(Sq3@jcEoGH{4Q>kaI|Mk9R=yKo1#_UW z^m;|U7Sbslww6=${Uv~jb3QV+##rD5O>me_fts?Sy_1WPxLI|8_JcVOjJtID#yXH~ ztg$>1dl1P^tV~kGXm6%^XLjo3kPRpD@;jUu4>rX==PtM0^>Dbux7!5X-msql*)hR;9-{%m#_>SWhW96~h_Plu$;VZHjeXBE^uN7y5yi7&C5=!q=F~==t^uEC@_Kd2Cx#eZb14h&e~_)Y;?zVT70d zwm;;%OBp~*IRwaPiG#nla$R6OYl!z}suJ1q*HOvGbC%ur*TnDI-||rD!*;Gcnsb3rFI+gY`2RdMXc@XKRXZAz#{j z?kG7OAa}#rFbqf!_M2nXh^OjKEUYo{cPPo4V^NSG4jv*x@PGiZJ02L$_F-SIgTi57 zAI+~7cR^#C*^AX@AZ}EWDG;CyHexpXEgy;zK5Db_H%Ql<&;#16Zp`kUNtV;I&}cph+fd`Tz+9<`CK} z)<{&9%0zesXI?>3K;WJ^|gXxyPVaSQ6112T@frJI@u; zxXG9J$shOYG$8jvfp$))l^@G5N&LX+msq(4daumPZk6Z)Gs$Hi0|1QYI0@TF{+eHi zRwoQIN77%UvHe^r`PMnfjA7(A<4^qWjjx#TUmHKJTjL`$jlYO|=>JdSrT@M0-zK|` z{7HVfBfs+hTjPyrdjx>rGVO(4;}fms#cjA5fd->K^#5@7Ch$=eS>yH%Nhe{69TX68 zp;5M=AgB={1QJL?2NHs8t{6kofoL|9ZU_nz?L=wX9&yGQoy8eOM`dR8m2ng!jt~|} za6xcIQC7v9_M~21d$6Toj#y?dW;9 zsy6kc36`>FrGD`qPi3t7f1Q*5zudBisayb}eai-)(Xv1C_6seWZMAITFSHEa)1f6+ zu0VGinOuQ$VL4jF)ep|e0x+g>>L<~~#o>oRV#=o!OW_~fBOr!^$hg*-IifEKByGad zU0)2-B6ms3U9@KNLTjb8|IQOCV~`j<%(D zg%+QAkqRF%|1$#^2%HnXOk^FL8}!FEjY|gGM>I!yQG01ViE;@Y8OG9g3Ph#&QG7gY zivN9V-h~shPA+l7WH5Eut5UH@5}<9< z@-w(t-Hcg)1|49J0ruTE{>aX*f>-w+2GRHDeU0tIELS|ni^v450;UH zr6>jr>U0$yQaKVs^Zas9;iOYFCGtEjwp!Rtl|@25dWsA{QAp z#bpP&O!|nrPr@DVCOw$Gl|$daMR>80eDB_-=nk-~xOEWMm7BuIix+7-T63i|4bxZ4 zj^pw)a_eI~=Uyk1f^qv`zDBVo^Pby@Nf*Ip^)*TuchtNKU=Zoemr_p5+p!2qpThT% zvac|wd?>LSYpi2LBwh3h1i?yp4RZ&|St9yM#7lWUOAmagwbo_=3;@&Erm;o|8wMnW z*xF^Tnc51EQEfG@mwc!60o@^@xArDkYTl$+L3EfvSXU?2xdXBot}oV;7a$bpg+B={s41z9b_8i z>{*(K>wd|f46Clyia4s4JtR}Q`+6B*v^7`Dwu;*jzxR-MP&1#)6)@38tZMC8#~;Ae zIC%@Ezr_i}s8s$g)>m|WM-8x1*NbBgZV~qFW1*ku;O*}8|Cs6f5|0|EI(U2Jru`85 z2k@3FM3j{hwu@FDn#;UziW+p4^&Ejji7X{j?s<`8Bu$=9Le<)2soklo&tCV9nl$P# zJJK!D&YUCXr|1+e?E*y{q>@kf%m(2g=obhV(*1M!R^WWmYIAEaT6VsGUy~VIz2_<; zgH7h0^MzirKiVk%gc*$XniosWc`<6vKH5P-*LOJijXOl`gC$gmnTf&}{uXsKz`Sp# zMIqr>p`DVHyFNrodbi*zQIb-dTJbGHKXUFAkC$o`hR|HvfPWoxxK&eo1s2DOwrD?) zs3;pa(`*ieM`6t=2i_N{Fr*=Z@OqpULhz1hgN!zMcXOVMUzE#R9NJ9Yv*=xw`F~XAO=27QO>WBmD%8q|fR$b!Di?>A8_mbwqwi1x=aRIQ zs=RMWRXHgpmo{r>0JV!64LNe1e%=4Dvb@&_JEzXI{pxmE06$%`Y8+qx?57ZaqxO*O zU-W_4Q@l7+kjfkCY{3OA&wn?|@^r4$CRtc(aqurZ70jAwK1fzk`_{jtCgk3>LB@(o zaUipn%UZogA#+6bvEgJ3IF^ec7mVpjYV$Wz|Ksf~FyJwkcr8ts*lC_Nzmrw%cdo#P zqtv0a@YJCglodGGS37#t+QZJCEKDqN6Yzamqbr!nMc*-6&P*-KAmCc~I2Nn#2n~2d z=|VtW&J|opG(zpbtsDvf;eFgp*rw*g+Z!1oEW``g)8B9mZ`EJyQo{l%hfp|ox7U2CBl#bJM2#}sJ^h>Id0ay zOBZ|_Z*0e$s#*NUr^E--FVNp|=xo$%m(uI>0hC{T`>pxf{`aM>3l zx6^5th2Ma%gf?0(Fc?_0J$xyB+`>3d0smY=cxk~U1Uph%t4z+ubeb#yoi{pab&blMsE5dl}sXMLjG zv`&cOgmOiS1|24f%0V0yyOJt^+aLixz-7~i}}IHMQ0O03qlGXUfSzl z=qmPcR*PMs0kyQH~l|B_~rTzwyQumFxiVM>#B;d51PUpNVI7DC@fw{UpzO-(0=Gp-aI7%95y42?YT~!R7i`h&WKJBdxeL#*(->HtC3;9j*^x?M? zZd8yx1XCA4ri30KgMO{#HGH=Y7f85V)t7nSsR()ILocRIk?8pnLzId+L~Fxtk`71! zfyq(RhhQbs&k@q2=BET1B4^quZ&y_r8BZc8qmALKY09nmUs6p86KUGPd*MEra2aSQ z><>C&UZRDz+$Dv+HV;DQp{1#MjEYth*V^NcNMOzr+bwumE|661W{^dqxR^s07qi5r zML>#$Ipl((@SU)EE)+f{g(WLqgKaIJFh1CG?A}2CAQ+&$Seq6F9xQfyF{poTnhQ+6C5-U$=^uZC+qn-Zl+tf zOYbiNLSoA_GHE^0I5cIi*6q5PcIn+k@Y0joUdh_#e@9-)=IKQThMkdd0U3cCWL+^I zWvA?{?xePn(0Cw%yf*T(ro>q3Pn+SquGG=hC}#nS`RbAM0FTvTBX1rqmH6~seQQi&{!VwFT)rNG{#t)H-?CZ2Sa=c6(H`64vmwnBFAe#)K zx~_Uab_`y;zcM!=5`hTA7EF!1qF#5JW9bMUEzd;8?al>T&1iKD{2$12b7wZ6#4#|Q z>vEN2;Iu!|69kIlxl!8mx?~7=K8t!dIBJfc%n;%fSp32WX5GdV#vpbNrj}BptXV&0 zc>Vql>NN@^p(>)I5Ux%g;w#1D5JxPNME!7mw(s6VSuf4lPRn{(*~ogCq+&fIut~k0 zNfYmSo}I~SVS>0_vkxu7zaboyI4Qm@v1)I)hwu%0T_q!d??SnOl*8zAj5tAJb+`Hw zZY8IusD;LT(dd$WCoZx-IF9Aj(3?-#pW0pxM*7NpOX+Kpo?wfIYIniD1ygs!lS$h1 z7b;?wUC3SsL>T^Ea2ScG;*)b_jBxV-UT0P9F&}jp#x;n=(!WHs8+xC-4Mv6$$5*N< zQHaGP6SDhI1Tzd6a8UOL*Xw-|`*&F&$a**1f3=Di`Gk0;vcK>N(`B#QrwWbwT(p^R z|D6X3C^a#f*U?Hm>4@7qRfbBGqE%}DaT2>(aPawxxnvhSV0P}MxKr*+q6dLnncBIc(5h`8(gSfW%lE5Pb zvV)70vxB&i5{IpaOQc(HeZhrIoHd=Uhfb1Yul#`2@bi?rNy^FK1}7vd_rwBnPhCXn z!wR~h9^M3shqr5a%Rqt3q(Kz74u6Zs74EdaUJPN~bc_=?RF(FY_aIvOpzSaMiZh5A z5hFo^V=;!LNcrvB5$?Z2T=*ah9GP^O4s)@YzC~B|;`Qda5D5(8retmL2s^1@Psm7x z6)`a$M7xm&Oos?%<6pELi%QQByjh;I=5d@f8bM0XRz-V|x?wxf=jK)$h*5JokChw0vn=a8Fvmh6K;*Dw17?za4(-R8D66hb4Ueb?j z)~>WfdtFe#Ye!VZ^z;A$1{5q~0J-4<1mgll5%Ur(e*}?n`G{wfxS~QYYviPbtIh|; zFb9px3ziO6sNyYML$1HCxX6^UdsQ{6tQWUY&@e~LzNcxG_?A0rzE1%m(`1VBq*XuN zu}PWn9VrSk|C%rVEM`_`xmm`x3sm0{z+l!fe_s<5c3t#*|L>osf?(=X>XGz3kJTrr z)7)9Cq#+I?3O$SFJ|URE9SJsX2wCj8lcGW%$f zuIS5>6)!sGD2x-Zf#)2UgSnKcd)-ZazC|lz;I?2GUA_@O(G!eAwtuJnhDM?yHm zSZibpZc3nfuKljCRU_y9-o98IFXZ>!G{FJ195A1k#vx^dI_{6kI#DhS3d~yR?TvtK zIr}*$tHpUg3SD)MBq6*=lEd>wRoij9XQmj^O$;uq=DKC&Q29#$OTpFUter&Kx00n* zDHun1L9;;GuB@T4aXc*4%LDxtU<<`b#pZZMAbf#*6|XHh{uJvRi4M-|>9g89kWX}jiKLB(u= zC#9mmNQD$G&q=$|+h2fp9x$27At4;pa9Ksw&MY+y?Kd<=pzBl8hSV?rDvzYzysgfa z5qN#}S&{(A3^+@;ZX6_tL1_Kt4ixd#aG_QGY=Sf+cw8Ro&xGaC?^=j(Ma3gI>6)8X z+|$!J+czqn>_zm3ZKP7VI+Wq4M<6Zur~Y*k#HkC#*kkk=Yurv0r&AN6&3dgZiWOPe z(As+(czDHelc%4moK;lgP&ZHnru8&~L)6Eurh?yOZ)R*^(m}3Z^MNRq(^^3P_WBzb zr_c^!T>)3(k&I;S&?#+ZoNrHtB*;zsa^7w5oFc-ej%)hTUg;-iT(R_3Rh`C_CajA- zDmaM~i!NW9!IioAdlW*CW21W#YLCTx;RsB9a9*KA_r}Osu-?O`f9WoknP(pmbA`_w& zk#L5Zt0p6n3eMVSEHrc;XF^QqF~rm|KWJtaGlWvdq@F;~nT0|dE*GdxcPLOv{r6v} zHJJ46av(;`q0GST5|JLGlONT|rGAnhkmORGymz_eO7-gG7kFF!h9u|eWc*RhSA|=KC3qj@fq#8J2z0As4@6*jlso; zJ;#4#jvsfHO%sHG0rzO+Eq4%^2NgIg?A=2xG`2rsLswEW=0*Y?IN^qjjyjL_Ot<)( zgXYs{k;Iir=w-5rkW%)iYcpjylkCTMq`BCq` z%aev|^svkKCMaUBr|ZN(w>0*Q$IT-Y=K6DpN;%`tO-CE5wt%J|&-TZMj>^zztN*hG zEXO}z?RILw)(8(97%hwZP8l$JJv1hhAcJ-fjH$gI*^^;j@GQ-Q4j7sKz`tcAKU1}H zM1UTliZ-|P2ELb=ho6xll#z2cGsvFn#ceo+uBQ;!%>^j{5;DSh7_OY_xdEnh`I>Wy zu;ihO2GJPb7{im!uCYAFKRa2S*kCK#PyL~OOgW+seOY$ zc}T<|YtgdP`okQHh zC8w0ozg)~m&t4lYc71i7j2wvNB`^UH;yD{>7E@d3GOv zg_>dUm-so53$z)^Z?Fqx*99`y6WP6+fK zR9dS?($#*0o^vZL0;}dh{_8DvSzUCCy{Vfe#Lzyx20tMQvqJBWu{d<$p&+HU!Xl_8 z*v_94ieK{vyl#rdgDZi3Ct|$=0aA0v7t$AT@*~={CSjdIH^`a_j8Y<8qZCSwr5L6C8_|exx3?FPNEg z!7~9q*$(Y>f0QV-Mh?o5*8`1uOZ43%;)QEo7AW`3R{b(_ucg&UVBrLd#kg!uClbx; zhX`>sJ~2EAjlKg3BZ#9_N$QUcqvu}K?1JpV+xuClj@!sKnYI?DtcP|V7fz+G^fSTL z6ieN*j|^3OCA~dCTY>U_{9YbOM|oTQXEK@h-z*X7pXua)PL4?OE0SDDaw|Me7w|_^ zD6Y;>#EN{+UjKy}c)=6ZY79Q$UEB`Z>pxN{a?Rv6vI-ca3KPFwkz;C& zWb;ma;_igh?T?YVT2h1Q-$?j>bT~&!JxTaXND-ZcB?1iCh9Gg*NNfABMmZ$&Xd|Mt zjQ+*;g9K&?uL5hf=yCWI7u<#Na!!E8Mz{5A`kFl%D#}6-VL@CU@j4p%(@DkBNLj_! z2-#;I{DDS_!6P`Xudr|4v0_W;Fw4d2Band(*!IP9tj%;}e0?3^eBqxSku*`Xqz+~o zD0?7SJQ1e#9|;RHUN-ow3lQ_O)gvn36uwe)Cx}cr%+LO2{(GpLJ(3jj@HH~%)SP+W zyR|ftXwh`cQ(w1T%9mvgX(b2r)5JPO+)6$;z5=rfR%soE-= z#cr>hx@NOb;wW?U%(m`DNxvI0kXRvhGXY!2);?|(i=osMk@BLJWRI&2cL|Q;4&2W3 zXTc+N8B5QvX7^*`TZv_PBaLN{-L)=18rCM~vZ3mI(c_z(%M~LaG~A~O*^r;5`ft`| zq8AA+b0i%0j1}fJ=P(Et(MOQOjFqhE6)ykSR?4IFd>Oo?IkZTd*XeDrz0TIWeMVdF zWbzs#x`<=@-Iae4=#u8|x zM2{VvBla82OBZs7WquRSBP3gU2l}PysqPZ3rk&_8XXDp^&B%jE5Rl3>rz`~cR@vSW z5+65zWWNp%qRagup;o&59DBbDs$l_l#+dOvIMtj;@$9sBIj&^;Em8#rpjbWHrWT4y zPi^7!GdmB}V)guLRV3PT=5s6b3PLrp>=JV2ycJP$WpOLHGK9v9=7_1fP)!x*o$qm& zFUSt3+aHM*ksFXC&2fRDksg{uE;94 zkX0=0RyXM=7qaCqbJp;>DA;#DaAhlnCl-LQzNi^2~2&-<8OITelp`0Ad7FikZ?@VI1xCu;uFJ9DDsGLIVVCM^*Jm zFXX_nNN9x8>q8hmy^yq=G>5)s(K1E=M6qyaayC#A2*%sE$=OV~8<9@z@Z3PNg+Br= zJUui#?=(FJ1agIw@@9uqaj*xQ`K<@pPXq?;1Q!nDd&`@X*53;O!1dnFw(Pwy58(2W zDhv`+?Vn0>N$*E`_*%uo4%MXQH_x!|_ced@dl@!i#ZElU_ZPE*w?^5piRTK{Am+a# z+L7t(+Q0j?RGa#@hvkv)?Cfd-?e4-b_a&+Jc;XTJI7BV40Q-zFU<2uiDUX~` z7ND`$vtR)|3^S8nRh@1|GCk6E>TiI1N=uk7mLWY5-}Bn)m8K)9KPSn!ui#!Y&)U}`7HrP z3Jp`#TP`Z2^e>k&9)Ib3)_P^4yVoq3zuLWZxMn0Z4I*rxR=HDQw=HslI5 z6m;tPv`oefqW-_UK26lVEJOrEY<(jkgeMBuhz3dBoiaCu{Ij> zn;|;0%BO_=3hbm>t3YeL>#VE_#hzJdYn~@`o}o%jt?dlX{5CsX4yKxx2;roRYp)#p z3tad}JC(81mpODV=7d~F_jM~J8U;n6V*o>15At_ny&(qk@NkOG6+Ol9r=>q5!9&%5 z1rIqOGGaZw%$TcXw6RsenigZl^cz7MW=Urvo5m*#FzQoj=piYYCM7$W?_5Py9EnQG z4(3HTeq7(ky-J@zzU(GXcgb_U`FF`v-&k|Lx^Zz`Xbjgbg*)N>Hx2K<_Pi$Wa!o%G z3?N0vm2f?@`mx0*jq)h<9(NgW#q|l7ee7G|WV%fI7a&ELj8gd67^yW$#LV^y98Q^; z9CqZya0Ek6C2nG|a?4TPAuVy(%FXF~_Yj5>a)TWk;FiVb%K2{n35j>va}QCH8mk3`JAKBQ_m z`bpcj@SAYAXzV$yv5W9PMT380R-_>?ms176u&gL7r)@cDhrN?UqylBZZFk+2Uxlzu zT&}XcV?_5ch9UkfoZV6z>N>>NP>k93vFxtzn$JxXBtSh0+K4&6zHvd4$kJP_9?-&l zCl@u)eS|k(gumdW>htjDQMigy|G?He@&&vui3Rs2kCc5%gNE4V;|chX5AN~e3=wj_@%*R1N+S3tXOp6L*#T? z+R3W@qST^{aAS+MqCXG~VYs85;k&<#;L4bgI)*8PG!3=a-ALr5fJbWUw$D5s19U(K zAUb5CL-0dqk|k51fArn#qR{7rg9)vc6DVXKIu%=mqG(#OBIcw=YI`_sjs?u|GpNjc zkHva$%{r~8&O;l72kS!yKt%SgZ*$X5RbM(OcG}piV7a#?E(Tc2O;QER>EHF~`tQab_ui_YiQd4mki+4X9UtbtMH7~8W zW7#raWRwTM%P zyiI5E@ow*J{Fy$i{h2=*`%l}&?`s$Smhi*;AwP+*SR;%1E3%#y*7I(j4_M*FJoDOx zT*0aAPI!iw z12AGYz24k24%kyiU|L7oVklvuVP0o!RpX8GYy|Q%n#~JEU*_MKS$j$iIVKUooCJn^ zyQ@!g=F6kN%#(s~NHSyb(X`3eQtV0gwG??S@wMb(tczV7L^+7u9E_IsFk?|{zjs}D zh>Ge(6a&NiCGxJg5bVB0!2TX`R!^$=j4;gpby_i)c9K2$OWON1|aYU?hoK<$# z9@;*GXnV{@s~D?KTRSUA|7|U<@}KaX$fKzziafo2CyKrJK>o_CW5<$)em~CMHEvC~ zTb{q~X(5rnGVhQSi9Ovmb?pzZT`Y~pVdPilfq~*>0++5Ld!hr;{EAV+Jx)0VOXCn&vfJ16 zXJ5oVAN*k}Rq>;^GQKH7U0ps34+U#@Y`(}?Z~rA-dW8EF`@75xU+C}hyKs-gF8iQ$ zhw05n;ZEO6_?o3#NP@G0wLH-F5$`V-t84a-yBUITeEh4f}LSH1lvv#k!O#0&g)Vw80W;m)zd{5?x^+2)>^l^0+&G1#8siN=7gHRUOC{D3&<|vjDRD1+o=T@Cz$_=pt1Yd`DLccqBu4m3XoqB2{4?0p`vqgf=_SN9~0{4%YPCX=z?tSBBU!3?*wdB?;Q(f zOQe}MMQYQAc!miP?*C-|!7w*-{}@^?0~btB_Q@l)w|XQE;j#L1Xb^MZ7~;{MN8aI7 zSlWhpM_dsW{U_1NzG$uNQ&-9cZcB(IdmyN~U%xq+(>X>EY954(y#W9;EM1}~7brXq73x3*M)J+EcBIV~U z$NzeCtamoaI5nAl**C-_4)wZgjffgV#63mT9aOV8GHEYFlfC{+QErJX&1VESr>0wC zULw^~&u8_jo{&h8UBTCv$tVYZD}%kp09?$M&>y)1_40W!H4Uzm3{u@Z3g}DSGPOg+ zVA8NJsKd9el59&P|9k2Ng&hC$wY^*B4N&@o&M~cc5NM``4#nnYhcmRT}Nz z6~>pt(^3K~Vi~55B}I@?FKNC14bGj|>%OKj!tHOXiw>#1p4(Mb+*;TxLG->;F&<8i z*d7oGZkk#H`0h$m)8frhQl&Nb)5O&Zn2W|Sd=hd6UYC)OW4lv`Q~5CbQ;K1g!Av7M z1g*#!t4*P9d{sW>UFZtDEIp_Eavm&%Ey(-S`qvoIOzlLqI@8%>vqtwGK>uScGidZu zgJEW>XpU5jRJN90bu>2kvW$vz=@8p;S{@;4UPm*3}|FE(slyb6Xyo^fZ3V}YR#HuNr<~n*=A;0 zN{Tgf9W-$4-||SEyI8CF4x0^jT7Y|UBFv3!p9%-Vww*A$oG-0yGM~IojKdTI1I_Qj ziZgX0xuti@^>CYedg!e4Rn}pRzGGsh9;3P9wi7oZ3_|*H)clu~|2OJnF;c;!=8pSh zz&0q7OR31YMfVf4Uvlg4?J|9c$;c|mq?OwaeNH)Pvy!jR3fTcC^~&sV%P&7?De;r> zCGLz~CU{eX#VX#vz&Bh%;8EV-C!r@3V)T?*JnTkTXft(vxNFN-&?NfQuE z@3crBsh6ln(&ao>Uqy$^@CZxP>~C3{Km?;VE0lWB(x_OTCI*TLfjOu}Hv~xRdQ9Bu zq#k~X0wUAw&qn;Aya2$TUZg}Gkj1;qkQ5Q$2m9ruGlCtFZ4N|kh!C>%WSGz(`U}lR zTfguECHX>a`!D#cFVv_nV8qWC9{k_FK;;gG>HHwAQv?nGm)gy{$rLTI zXH4zp+9kQCRH0a^)PjL=QYhJ&KTYR5w|4WP)~pz81#uZbMzv$uw=~)kZQFV z#q)@iJfP$VKDs!O0_mnim^)B8$qDMJoLmL3wQ-DRTV0WQ2OdTC3S3KG3MlSzDA>aqjl&Q94(QQ^jkILztiXSV+ai0DdChuNg6v1W z)hWY{a6jb_I;`MlR;UCsAwg*3NPLzRHb01!>12)SYcqTQ17HlMZe>d`Z?fi9zN|i? zOfjWRk60gR^|FJ8*lU^}EtiSG+lX?H-w(MT45K>t2wmY3iGZnG360{QGwLHT)fkB3 zAC%xx^J0grZMoq|=fRZts9E0oG@H8F>rQE-brmscDRht&=_|RvctLgPV+xrM{HUYb<8;^!-1dlOXw5%ZI9iW9kPQK3yyiB@Gab`I zwg~?Qwetc{%>q=QwXsFudlah|C==R|=|`5(Rg~l)#HPPU9ZkTs>sp$CqE;00Vt=|# zGI2B*SGP}+iK@8W;0v@vsKEwjK`l#W94^h^gfj|i?&q?|(OV&FMBuKlzxjd~8UR#j zpLwyfl{2U52^5Z&VQ3r8K|%-xZ53;&^ek~Ua*2_)@zRv5WT?;{1}|B|S=4zUb)JExN3b=b0Bm6U+OAzA%Yn+{=DCmxs#43^?r1lu zG`+f+)ef&w^ebMKintB$TL<<7mmJv;2Tqs;CUzW2NL^7mReM7Ez=FszUD*$g$RO!Uygf?RBhXbo6Q7 z*gNO~%dFi3vCRY4e~)-w)okt3JzW9Y&E2C*WrZch)dPbC)K(lu{_Y|Trdv<^fdpn*Z6Gz=ehoqYQvh^R(1&G0mSXyNNce>Bv>H)N zQ`P4MU6~X4zMN+pX>0b;goK>H<@5r2dIQ(YyzN~j=fHkqI`W??V0#4{kbvN20vaqn zvzNkCNh3aBr2O}ZVwc&udo^4KWQwhiL zAEvXA>S=Q$bdZ>-u`lIvaxyyx^8!?QoXuU>H`zROo&vE2kR!RZ=&9{XdddLBs!gn! z=Q7bSKFFDIs4wqIRP*+_PZi8zr{Qa4gLFO)VFg3gjAwcC^Pb8RBARCI`Rd4ch;~q% zFvsh=ESGk!Jyz`%sWE_dz+C73NLLt<2vgb9`e3eTnf5)s^R5UbX__>2WeF&k0^bgRZuU7ElypBS;U~qKG`oh|&-g;&@hA3@o@C6u&JJ$=9%!Br@6TcrJB-8|ruD z21@%TF0i4oubEB18?s~Gz@?1vq}R*LDAz3XV859wI7f_#5f$L^E@nH2IOktUMuzkh z1T}Dg{{OHropN%CrE>w>(^(Cr8!uKcdhu*}XE&M(unrP5K5OgJSo@mh;Po4Q$78Fw z2qObW|F5Go35is0FLAa zOOqnmeLj@I!T#h>Zp_hkO@Nv6zvX=}9M9Kj1EUCJ57br;?G2Ek9af?hxDat$v}R%N z81o<9!B>$DP{apdTl_oKHKW5en}2zacyZ^jE7w1okrcba_PlR&x?ReE34h8MVVQqG zf=_o@CJo#W!p*mG@1)B@BrSqST0kTNnIb_X@Gg=QgMwyGEXW#{rR*RC{yq#k6u#VAM$lR#S;VJYP)^at;?*jQ?^@yl30T zea_lv$UZgCO%aGb;7Zx)ik(FaLaKqp#FRCL@5~vwsJYrLc;I%XVkH&~$EX&3;HE=| z1XX6%HYDON{pu zYYe0w`~7jU{*^6wt2|Dv{ZCo@GJ&{>^hGXPJOEQ2-?8rVZ)?C-9ANK`Oj*>zOHn*V z_B342Tj*VWe32{fy)-ystFNW&{7mSk?y@urg+;l4<*H=$t$p|Dr68sYK=S(o8C4NiI7-Y``jH#KC+V`@XTJSH_v zkw;d;WO<}F24U>4x+Q2YG z`tc_^W%*myE-delwR`_F;iucZOFB9jRqo%`6N)mjjz5@D?$bE)uab8d^vJzdJUW2Z zJlGyZkTtZvOW8m07hPm}ZQS<_dOcSEDVD|x4j-~P*Cd;}dJ-4RdBXt?X~0L{8=Tj2 z_LM`lF>JgpA8H@AN_NotZ||SHyTf4!zJ#OzqCgNBd4`YNlSk8@ifY#cktfU*(Fi zubR>Up9P7oj&DMVC1X?I#E8k6ygS^7{_A1cceQMVxyi2J^|W;c?apLFaI)b>%z=CX z-BJD5T}4{!P0Z!?CNSg*!;{I)Be!`*g1|U^!pR5znTL@Yu$PAZOl~!ffuU+#!`(ng z$Z4~iCM4R(C_<<3&RjqB1&d=4a&Tj0+@Vo7+aG);iSDjy1U?_% z$z^?`*70>uU&ir!*U|T-ewV)KD>Sc*tkryM8izx<@VKGHd~TpDfnA|hjGNQGN)6_1 zIA`A!tH_b27V|e)GyyR6chbJlLu5Mw0Nd-XjnmCt+8+Kx4q}HjwvI=%y$r?~&Ba`! zr33y_?e+boO)PZ22AOl!|Hvr9tFAX6xmy~R5W1Kzax+kG@VMA_tlKSv+oiAnUEf!9 zze&2kx#mmrFYv{oo>caIroCc93%|Jcz-M1_=rj33ptruxTTEb&n-?In$_*mlXZEO- zxV@&0IFVyY_^y3mpI}}hUz#aUGY_cQ&r$?rTpd5k4o<%oo8(R62m`3-v2@1AwR>Y~ z-|QfF#j{KlJY5g009Q?!t+0YpAsP22p={NjgwUOxL4X!mS|8{LGa&5G zesO;B4XV)hI($+FW;Ec07(=J#6#ix0!eN?C9q`ZBx0rve`za7|jx^Z+rf)B8-3qbC+6yTT zJ#+^($|4?_KC2qR;VjIUz!E{)ssKSqJ-{$c28+8v6e7ic@cmZ+fvw|VZG|g3NHTi{ zni|=1Ahs~3CTZGYnN@ppVt!lf~e^Fn%n`b-*H`T z@NehD)-qPjq=^jW7vYy~%Eq9_UT(~?*S|(dcI|`yy@~?XV~kK_?Q@&NjsY2)=7Hk9M$swb^V>u{xq|XFb>j* zBk|Pn@=+#5m`xVPWeBW7a!u2)#&-M5Pw;iy_7b-)^e-xrome$!1us84BGKh{xeUy7 zzQ8Ae)v_IeO%g&*9Rs`!zDp>SFQ`YsO#KU_nD?Vpl_mZtNI=?(-w*RCWRMg^8`)`v z;H~+1B+Eav7P$y}urNWdelFxglert}Q3^jo6Lb9Hgx5kjZVLgOfoNp=d!=13&O*jx zWXJgGOF9u~m+8#OAGnR=N|F%`sSW6m+JIU>n}K`1 zc~E`@c==L>AT*nw=*XVkCNq`>$uOP(1r9qBg@;3DfY>k7AHsRG(I3L49yVY6j6U2V z`!~C7t<3HJW4~1rc~{B_AumL;u=5sH)g=^`xeDf^Q#x(>K0)Y+4M*K@+L*1qZ%Kz` zyeAO#6WneNJgw*L_aIixPqRAiW5r%#$cpVD{oEnws0|;9y!#jMC(TeYl;h?ryJfFm zxT_`fKFu?8-ldm^M3kmBRJ9qXQ#|IU=;uNi&}aV@{n8#kq(wn}V=`5g$`J0b_s)R4 zM~ZXk7n-=Yt%=L_aNu#(hRkgTnC>mE81U4ncSC)tr)`LG{fhvQ#U?A|Th;o-X2>Kk zY;*hZfE-ybXqqmx`}XMeeFvo*E8esN zW2A{&g&Z@BfG7ca5rqoA(vuIe+NOGH(ZZ&P)qJ~KShqrV1g>-W_QcxjVkjg^Q6|e? z|0iBF{d+Mhp{Y?81f$**`X5H1ZPYb6HpYAyn-W1Nb0FN+-czRrN`Yhh{{2_ug^%<1 z%vEnN+;aum(15j$_b<}7XRo&kY)(TE%fE~u3bD=)eW*V0|D*ng=U{e))6^*MaTdMz z-|!z+lfTy};;{KTJa?vhsczr?4b?e5&F!$Oe?E0}YpwmkY$l~)r2uY9i`p~;aqAStwDAzd z1@pi*hTfJ8fssmuvJA=BN@nBO7m8f2-}VF5LM032`!>e`E^&D33EKYfS2mKsB6djh zZrfjD7twd}%C|)x8ca1GkgXA7gONT=l42KIen$vL~9p9ZDvopLE;5WCRi483$D?FIJei>*69(*Nzc*qZeyij$( zUUw;Nm3Y(ER}FQv-!cqXX4vaRx`(bQ#Fa!`_(HpczPpl_>_9$p8(T4-5PN@^g=jBj zKg5mT4W`voGm&oM>eXbj1t-g79|~a(A2B^{wJr(jbqR&b(GS{tEA7peUDD%(vpAE! z5{@fvoBjS9RG)I2k7OoNV%ekNcV+rugn~^UG$9K$~^iar=V@Wx~`} zs1W#lO-z5p?DZDN~;V7HWH~lHqKu68v@ZHoNq1`dhlQ05I54+qF(;S zORLB+D6O+;DtRh6-dm+$z| z(i`LI@I{*}-|;oZ$z6ph+VZMhf1JbKYs2sMRVOn2$1>_7HQh6PdwS!>&6cS}$CoJl zNF*-DzN&-=jkB-1F~-$#SEjPB%uRcnGaJWUF~@UL-nQTWd^i%poykQ8mkbznJG{?^ z{z#0Oz4a7p-i_rUA~Iosv;+$AQ?@_XItY1@d6~*3IRJLw1`|A%_KCgzNm+&WZ4?o0 zJM-7*pb7`!k5O$2W8LoyzDe^Cp@6yTl>f}F4@_j(D*+(Z&)yerfdATG%EXf^o^3^&yLnmiRaEu2-`LrZI!Hk+4b@GqMFlbr_ojgvG&jEp$PwV85bn-s+Na`!e-6Z(|o&1VU z-l&tWl;rM`JVz%#u9KhE$;WxD{#csk(#Z>S@&h`#Ns^zE z$s={LODDf0$xi857+Dl&POfC9TLr>e&+}{ezdOO?@_dxI1)!1@{M|uXU!LoUdy24~ zUF)9jBazYM&HphHDdF#LU>YCKYsvF6c@MC}ZY8{h{CjvVC%>1c)ZPAXKlw8G>rcLs z{H-P5WS$FICU)|N`BokLWBW2Q$^R|ixB)1Zzt?HU4&Ki>5{aDVeGhHq7X)`8Pw-T2%}KtL5mR%-6?B~fGbCo&SJhxP>N;(` z+>Z*=K(Iq-+Py z<=KAr@Gbd=++%e^aHX&>PypPKpT zyfKP>59F>u&eZI1`M2ey?BSHmhtg)P@thdE^@zh2xCZX$YEWVeb1BzgY*lJ%2sYW* zJr_<2=KM(UPhEklT>fD$-+G2~9eJC*-&!r8W3aT4tvFdc701u+JUMAN1U}Z^6!$>*9_y+4YOdZez50!IaxQ2D?>!o zRNs~-4jAtsRvh>wu0!*?Y*Ntk<3QnK1G64?rEEuMq5xt=-Fu$vvV&cExKchr0r<{9 zaXT!wgE%h?Ed02q%RfSNSFXsLUhZ*i4xgjk64xDI)>M4jp{j3XIJu`OIO;R#R2=@8 z)X!wnbB2R;AqU>Puy2c&LlC?pB}I}Wpb%IHC_v3a)Ih#}0r{>7{lBX`DASi7Npfelv9)gc#y{b>U0;Q61?Z5~Fl3pi7T|onU_ps06vw`@voUUrpvHNH;6b7%Op$ z`4#-D47}KubeADOk4mCx$mfYSiPPsnEK|Vm&GpcE!sP_hw?(T_Cp5k@|3GDe89^%v z;%#A_NrRFaZxwQ?TVj@fow2!gPyG8|3!aQcx8TLVI4?GwnW>DQGizIJFGw^nA+nVy!P5Onwbs4497|NoS4l*Tl>$k4E*XN_d2k6 zymzFl0SZ(8jlmZ2C}O^KD`Q+~#}-WvPnPtQ))T{xuHUxB4Gj^Du=q#u6odWmrqvA zVl2}W8p0CJjBIqKowNt9B~y0cMwS7WI$W_%*()D0C&Ockasa_7Sn(jRvz_wha4TAl zKIrIoB-&v`|5`#4FCN!MB4dXYqVRU z@3f-#5^b5GNs$~$yTwX-ueHbsi5_7^f72S>SEBn^(Q*3;R^iwq8oPI#^$PXg!231E%k|a0Opii*eIBv9J&;yO(dI zZZNvK-}PA(1WE*_F60sTzW4%R{)Gf+7F^iLJn%8rA99UVZeaKt8pC`?%o}n-Y4Zl&C1KK{7~%Rri&%z~HsK2gn7Y+g&>hV3vvSjFj-?LWuf zVw3ncnxQ%x{*1oYJS&5mx-465v-w}1iYV&}Q{17^^R1?r>^e%ky|eshN(nwFBha?| zck^ZQeQ8VZ;v7|HbonorlkN9y(92&6J}ePITMu%zu6|l_;2G)*rd~u#LU%DSn%j`G z2Kl;iKKWoU{Ucc!i&R@u-&AGNYlsq;+2T818DS~sUz|<-^kW8M7ZV|;8A4B@T$SXu zz3UkDt#(OaA@W3or@Q(lotB*Hh~2DETD0DFEXoL1z;@3JS`=V3oLkKZ10eH>$4-~O z0_n;eEQBk1;zQnn6Ml{f+ES&lfy$n)l+(~LvF1B~r|AN1QqwT2rl=eCGfqMdqBW6z z;}JeY`nlBaMD?4aekZHnDe8Bs`kk(RXR6;D)$h&f_g3|LoBF+7{mxduMe4U${mxat zcc|Y|^;@ofE7fn6`t_*adFr=D{obv97pmWT)o-o(y7oXkxD5RCPn$+zTZ%O5z4d=qd?a zCm~FMB6G7Pbcuv!NT{2HW=n{Z2$8wv5`qMd%oT_Y9bqS(yHrA0&qU@vCZW9&dPYLq zB_yjXv_(Q2CA3jO;xRn5T0;9Iw2~0*H0BiM7nGJ(6dFT@Tv@r`$~lEY3XS3lZ+TJv zY+~SXxkBP1Li; zNG_x;lJyPBMH4pVcj2X?+*43eE*VdycFxZ)a+mUrGF}%?r(97bZo=CK4{u zgD_$=gHTddSy3gq@}HKJay15tH4?7&&L;ldt0b(4MkcZYpz5} z6~8)(On#jBsUvXD;!{oe5XD zE2Ucn5k{}dJX}1%-D~ z>fx7T1{ud+j>$Kcz8rI87kaCzODf78Mea(^T!*`+(CsdA7a6ZVnm9^#ZnRPRP~xc4g0k5~1*44*x_25? zT2k#PtSGA-ZM+@qG)g8`zfHfs<0#s#U#_{M za~eo=+Vk;F=Z)FZrW+6R>*93fO`ASrG8K+<8Gl&b*_l0g%GA6G^$S?JR+uLWluHsJ(%E}oHusH_-V$fIq?LuoHLEv+!At5o^JfDUP8IfTw}q< ziG-$0>x@U%COY%R>#jfdSSM%R6jG+mm@>uqda=zp#W^+Ch_rNcPS4JDX64P8ZXDX3 z=qxQQsjM!kHV&tBY#XK?vy&z;HB|+kiYg~a!EpSkbGBM0y7F5c$=T&atkQzE(f2*y zN#bgBju-ZJo#b9HyP}|~C|ht$mABGkL`pj6R8-vQt<-rw^L5U3msM0P(66fpcbv@n z&@boDO`Kd&?w-D&(rs*d{JhB(9=>1dE)&d9q_h0hosc(82k+aHl*jTYF0GiaBVyOv zr@Bik3X0nLRPbGwsoru=N%RZf96EQJr=l{mdO>+%HZ4?LF}}ViNn+a~9(}m;v;}n3 z>X#$ZY1)En(3TpO;z?bmQ(=YIqd(j4cO9k0`sLDXU1pS*6jl^j@4tJn)69ZWul2TS zK-ZhyRTWt!^GalS=_0?qDz;#DwUNc6sL05=Iu=}NoX4YlfpO<6{d*O0h zVJX!aSI;3(QSCN7Zzf2_0$X#6EE%g{XnhBN)HaE(5NYKs17-LSx2@Wv^|GlHyB<7X4=NnahI~A1_ z7rU$6<%MqJPsh8qz2$o=iwZn$AcXXF~%LFvs#vh-FbI&U%H7;q4bJw^FjY2aX ztSv?Qt%)yYm}zKgmJJXr@EHBCjxVmLDkGHY=~P@*QI@XD!%JAP24>{ri;z#~9o)MEF-t?ADxAewt~ll zb2?U3dLSR>xl4_UZi}q|IRCRPj7MO@`MucR2YM*V=F5vjkQ-K@R0r*gC%CZ zF@2M*lKs+StWQa-qy@~~0;AV$wyJ{iIc{U^u{a?Ljl!kzRiM~;ZX>&20^~%g4EENe zBvvwDgNRa8h4I(+Gby!R(tRWV>;gf5Tg3j!Wr^|Mt8YB5IsHonRlhvuvKZRgC%e(TSc4Ybl?~ zw0XSXIOB=MaUR*Fjx4l!%Z0{B7!~g=S2KA|S!W%Bu&*dHUYZwgVWt6(+B6VPNKEk3 zRxcni`5GJe#p^Z}t%+BGYGeO%v3JvryU3wx5Gt?SVkRUKb^;J~jB*Sd<`~8A2*)5t zZuYpTc~fr6zkb^Esrh4Xn(myIpFKH0$2mDAMOUOrc0IiFq-G(73+IB%HJ2iBR9r~4 zLu-Z&8_GYUtTJB#TRs7SIi0htQbm$^Hbj>2Bv&~WE_6g+Mznt!HuQ|QYYjT>Hi}tg zZew7%x3n}xJ~B^LSZoX`F7rrz1Nse+Vtp?4mdmPFP~wm@Y44?!xLfGp*0E`A*WJ-J zjY@Z1eXYu;@jk7uEH(N_!IJ9yyV-yTR?V%JZ{H0S4s{IzGy2>;cyw_|jrCSmS)N}} zMd}=bJ)~+ui8O4eF)-zpS@$fu;<}L;_l|O>7xFin2Y-Wj@OQa8eXu*-J-WX;eW5%3 zN+S8|=T5)Pou2Ma?=!>zSY+dI2v6W}vp-d`3y)U=B9xCYT?RH2Tf)aOW zkujrO(6GZ(;ShexQCR@?u96v6A#0vgn3=j0BqM`5bw-XeKXdAYd`{;L!zz9!GyG-#E5gH{2+Rmb z+FeAeg}RkFQUOO%g}d6p5Wp9C3grt(AyYGaTl*U+18$9|a zZ5!>Vtf)5FaQ=&&LxCg_0SJ{>Q0}QVJQa6J=W?gyPtTj=oSdIWAUh|^X+*O)%0PLJ z*=|OW;q$oX02xqvWrIg6v}YC08#^(7@(gqVR5T@X>NID*@Id+5ptG!jmF3mL29GXh z`BdLBbXJN{4Q=Tbj@p7O^$ukHq%25r#<=N}kCsuyYd#xf6{ta=lWDIust1qOK@riY zR+JPC9vy|#>?}~~_&g0#B3zM)_{9w4oOD9yVU|d~YM9kXD~@KW*tYtojmw+j%+Jls zl4bBqU9ieXPtMGuyQrl_jFVa#QzqvNttm+1XERTpk*kJxnvAR}arJ+j@v5^jGC^mx zAUaXQW?kW+A=2%9uuqD?#>1xnvz;H8lL>$Pvu#ykuxK--J`p}i&scNO*^+Mz9*yJz zk&$3MO=t;Z4Q-tYfu8^E3v3^%#lUvHMZiU8QkWNE42sUGHSg3N312h3KUClQXuh*Ku&ISLd zmmoEj$i`8fkCez@Jyuk+0jm7fj?prEe0cs@QH2HN13Zqo1@qis7T8^gGRL4AHtU~> zCO*eC%~4V8fCrcl)h*3910fZu*0)bBC>BIN=*mHZej%w{=GJkO@vCyrb(afs-x@2z zF7|*j&sh`3{3~Sn6U2r9xw^V!PPx(N%o(PDpe2RKev)$5^tZu@T7NM69yL|c#Iqr% zt={UZ+RCL^gQ?phySjA5P0OTjRul6P7L~EyU@U&2MQ8M`+%ecO49IOaW$XqH{RsgW zDu#ghh0!{*i~py7ow0FfAkl(`_MIA_h^hgy$yb*^q?J~{UPRY~O4ALKsGmVJfT~W> zS))|h8Q91e5RLx-+WQjts*1Dyb8Z5J$Z`k}b{GO7iwWE;AdMs>K-dW(gdI(CvyebG zauW=w7;z~gmAC;?wGl-rqNTVLDOE&^Sglf}ic2+B+YkAyqE$b%F5mmkJad4dP}=ntAI1iBTDouA;1h#{5NjO1G72&HweD|^kk()d}#bAy>6;{zFsiRY2m}aSRit@&c9A1 z%wu@|#2QHvrNWEy^bs`Lpr#2Ainj=~3Ae8NJf5i?)Ft4lL>L)){Q6~zL#A%gO-*eZ znevrj8A;HmYi7@RG>)eUU2MH458g&rkd}p&jo#$fRJ1mNpEO}64M=l%5U-ku5}Jxp z?MO7D?ZIydUXqT~dWII;*OqFP*NFEQ(Q+)jcmmA=+P@L znK~(2sr2g}X3UaWtKte;GNxcEswm_ldfYIIpbG$Ro56?J( zl*{*&85xbMPztJ+3WXFgN)N{tF5X+faY$`V9xYpt{w{I!Xx6!CkEE_u-q;{MP3aAy%z6A5GFW8-WiIa+c^ji&8O zjK_7`X;Jwor_rI?P`^nM?iFR#JOJW{NLq15wV_I=5|$?d{-N?k^@3VxQtIWYg*){? zDI;k@PgOLhhiYrIo1~dQ(-v1bfZQ ziLBS-l?wjBGfhF``_;nD6M9`_1~YD3kW1<(Y10BNzfuER#CfH(k}WIsWwAw9#i+g{ zDsp9%C{wyy${Nor*lk^90S!w%Ep?6B7(n4D%`ByAURFlVB353~293;|Tv7#lS0Gp_ zvIrwrrqCLNJIbKd0n!0eg59NMCA2&tm$=zRP^xI0p_9NJk6fU%2j}(+FHVI@YZh{I z0Et2HT7}U{h@ORdUcL~tn}W3Nr6j}1A~k4n^K>2SQMFZ7q`)TKwH(g)*obH~;-L^C zi()9RG%qQV8hl>LlN)MSYO?iHYj3p4X|;=1{Yet&b4XJ|r5m5d%ReKfgs75u>W~~( zNmB?!77VRg(>zUhBB5-rjPlE6>nPUP)u)W#*!G9oQ<$EV3*7`0!@QU=Nnl|Ij1 zT2)tGB=z{R*r*_Rq%2GDth>i_6Xso5sikhxS1BhWaT^|oZ13h;O*+9cmP$c6r%O4b zrnr{vXjeh8SVq#W^m?RuEA2iYK@^c{VP#zz=@(iJ!|TKIEELdsPZf21FY-n@5w9pNngCv8;W1UlsLjRODnsJ))GZn^Y{+$`%wE z3kqszEo>R}Pn1Eb9Ml%@MlR%z3@BqmWu@UJm={lFcPt%wbj6gRSsB@RGiT49F)y2z zeamRocU_J?pesL#Y3LaBa^GNb+rD62UBW17T>!9_pys878Z8dzUGB?hemv1uN*ws}fin)1V<_cPFz zh6(eg&CH#aHCGN6GIDY<7KsrfbgQk$FRWvrPQYi-;YmVF4A)8D5ZfP!Ob>0LP^rbv zFEvi#iM3me;#l*Qnm~)PD+)vwE#mW_kj4ah>jHc$nH%mkQf)WRchjDTtQN*dBh46B zSWLB<**MG{ghBlznNWSfBqEjCc0)dp{P3VQa#!ema9~J+MCaDFnBbK3EOOzbs7la` zxsrMydXzl_5vqm-G`f-Xo@W+3EY;NGNRL*WBb_|>@Oq$qOXNP%z1)bV`hFq*iZL!X zs8PAn-~obA+ha&iw6c!3_0ggZ3AUz+T5qcB%VgY~UEQ7rO!l$f z!cgWEF8z=r>-aP|o+m%tu%Qw3`qq}ZdGrsv!o4hSm26yiLyTVeL?F}%d&ALt?`XIq zpAAo9y-s)!kY}^Fj?Zh&^G>hz656avqqfMROQNF_l7 z4({H)&yvRhRS{XAC`oP2JydE9dD=iu0raFy4dJ*^O*1?J3R-TZsYQ{PqIcxVt=|3v z08+Vd)7Em#kX4YSEvVX)z1A;CrG}@KAqz@)qSPYr-Z|>WbdTA^OBct7n)MduG8Crs-+$q-pbMM~cCED|(7A zqfS5$o_J(k&J8q$%o(pJC?v&cvEa3J-+a(YpK2jwHmH48^C8(Dt0B@7L#|4rbM#1x z4Jnt@{pgbSBo5UW|G|>S<}BB4@?C zMOvttkDIz|7CR3@N%=R52T*Q2Gj1+;s9rGUp-u&sMvdIQ8_kb)9B;9r1rJgmQ0?H! zhFXV}PxvTq1TY{r$O-9V%2-3sdv@hfIcolia=FuZK5to7mD-}p8$wt)TvA56ko}Em zV`B?5HC^D@A58_Ku8b1A*Pm29G)v^@S>-~iKh7gLp;18*=NN`^OCzuQ(`uSpP*ycw zo`rJL+L2tXCRNFb%BssM@i_Qf3X*(XrQ9({@kL!uvjZI`4FRyzFe-&+k#dKLPK_sQ z)#UKjXWDWo)dvN2w8w%sK$8S$nD8!;wR-%8&Plq+Dx5p2)LwGF7;ZMk4$L<6jc*tXhmrYY4A1}S&uM%W?`z5 z(?#Yjl@@O0B!!wN-fY;yxrm|}i7rUQ%W6e>;0vSJweBx`Ct*L#gKYaqvz1DPT}~O1 zJEEk*q+IF(&Xk!SlroY?lrb(X^-{w{+x;?2CNG;(S>>)@7-=A5(1GwX&O>98w;I3K zN{uEz4m6r>X=-p{iz}<@meKB4kJ^Q0gK+T>MMf6t$sa2Zs12!+o3$xKC48-eA^CZ0 z8^YjS-L$SuMI(mA$X=EmMhl3#2mrzW$7?v-qfXd_NPg|ad5?^>i$d%6}3 zv@vKe3FX|_~%{ixvV$j14H;s*`E1*f9oC(RP390O9t*TNg((`yY zL`z>Hkvd#;CYP32pmS8?O*z9>+7s@XWxmxij8af~*J5NkTi7RgR59{FkYdy78`_9g z$Qwtc4qT4RWZy2`$kINGL(i@@l?}N$QD>NRRIB5;o>A2;p<2SvAVeX1CqD_;Cor)* zuk}%GaEd%*7rD1nYvz=KEW517HQW;b)!D!djP;PMK8wYi&Ev*l337 zNj4{fmsr_cP8FH!Ssu+HWV+~?UP;3zDMF>pP2k2M$^WV12b_0BQFEl^j0DiWatc)G z`_HP%P(tAZw0~`4T%;c2C^ZYIV5og6t|8@w99ejh$xpbnp}MAZc^n~)cF1`7oez*pUT9X? zh&y~}h74Chk>DJ2Kh2E_PP*n%W1)}ptC1uulqt84rBrj}PV1GnH6L!&IT|WO?vJP& zqm!t-a-;lG-$Sbbe41ab)X;#A*Q#{mG?LD?^6i%tb<|2dm3e3iDF`IVO{tMHK()+o z&@o$-88WM868aDp>mF&EMIE2FrKmg7IJq){u7!FqrAFfg4K*51 ziswK{FGv14R;rikl$9Z?Hm?TQ*AC=>hzy0+3>dTy&dOh2U3AmJK{>T8G+Cz(Rc+=b zLE@M$uNIML>Ewsp)GT-TlEC;pEpNH;EcU9BTU9{YV~CZ0eve$?*!1*ELCVLiNY%l$wqjT7|^vsk13eSRT|#@EI|#{j79l zkKRW%(Rf!`tvi)WDy!lP zNo7$SkN%Jpknt5QO~@GrSY)k#dE`rn3aLA%L*T{kP;Mr?Jk*$+k()6yMX)BF#?G}O zYi17Vn?mKjlvGcR=bbmHYUHDAR+UjRWblG7D~?i)I(Nac;uK!0S~8Ay5liA1 zig8>kh!Y*>jg_0Xw9wh|l^5=m(D*8m!i!2ek@5-VQ9rLLd$w2z-ul6NUa=a+uI038 zWJUFAs>8I|f~U7Jq491CPVM@Zd6s+jsAd<_YJi+p*Oqd%ZAb7dF$!-Lg-2>77aaqk zMR#7@lWj*;9reg01-S<9j=7k72JRNL*hAxIFUh)u{LQd{Rf|kq@3+@@T7dn2}%!cG>sR<}EOYuNJ08km-MAdM=nRl2^Z0F6E$1UNNm) zY>x;}W!PeF0B_JP=yg)^qHj&fOPf#1oIGXfwCOWuWsM)3{*%Qi85b`~%1K_5kexVZ z>A3l+3r5c!lY7y;w1u-L`1?a}-|KMN;zoh#G!rit4%c{*E`oOUvpQLmtclJ{Yl3rz zb%h8{$`!M$4iO#2JZHzG#bUbEDWbpia}hE$*6KVo+zK7q*Sa7g&Km9PGIXry8gZd@ ziL+b8Fl)K!K3rJ&VwmL;R>V-NT=a;DqW@vTdRl8mg|lZwFRM!Q8WBN^e)rh{sM_H?-X}`oA(cd*lT;&{a-w104rFX3uh+hq2 zP{LplV+~HYTJ*4nL_}Lx3y}~Z*3n7xBr8HhBn%U&*06-(BF!3}5Glr4kqINj^5Yh89S`Eb(7fWywJt}tM%^bEGDSg@5N#<@m|RA=hYU@L8SmbF5Rat2%D6VpU`&x=Hm$PgJM z$sjSowUlx{F=-NoJE>=;m@KA<%)(CAROdA3WXkb$=agZ|6wg%WR2R!>nrk-wpB}*` zGm>VKubDk(i7YW&%yMu!iDXL-vFbh%3UbB-veA6l`^{ z`iYL#+OPqlzqo36gf&PEq<9*_28u!A>aZcy;H~R7)=IG^Sm{=VHPISwT_dg)*H9fE zZe1G@X;rAC0L2p`d&%aXzL&CEH+U&J4 z@pkbuSF&}3xM^S~E5zz-g<2Poyt-N4t*%xajde$gO;k#aqS1A;xW#$1EUR0>9u&8V zTS-#4Id4n4nR0V`&r!4mH$iL;OQt#fmawhj4zZQ$^IGQ}l+SI>ZSwcelkOz9cTyM; z;x5-1@eAkOvc~;_!fO&u5!0=EocAP+AvfEp1o>&XH|aiN_x0Q%?iUY;9aQtyiu%S{FJ&#|rrlJRHHbrvHF}-+w=7 z$oGA}?}zr(NH#`~xoGT9x)JYAH@^s!z8q`tn`C>^eF5E_>E`ygE8Sh_))&2k*Wh-P z(SCE6LT`wbZvm#a&>H>e9zgd%{2oj=i0&caeStb%XqT_jNY-?nx(Ya6;qdfrckuPZ z_+I>C#P2_Wd9UT^B;SQfqYp_d(iml2Y)mr>jH`?XjCYMl^E$J$;}OS}pyz^@ zbX*y7SC@CgW(=%|y?OkCyzg(i{52Jp`u{Zb=)U})vSfTs`1h%&lu7e=!!#Xq$swxZ}uM)ia#nm0-pYY z;`@Nk7Zu+L?E8}9jV~+Qb5vpas|v+2*#B9f6Zt;?*{G%J_kGo{44MuKqE_q(*@WM7y}#&oCKT$ zTmoDMTnTIdZUWu`+yVSG@G0O6z}JEA1OEX$4Rp*_>Ffp^2#f|M0mlQKkV`sn2Fw=# zmjPD+uLf=e-UZwad;qu`_y}-6@EPC{;77pIz~F3^{xF~b#sgD;lYw)9i-8rutAIBH zw*z+r_XD2=9tFMu{1EsRu+tost{%XlKqoK-m;sytoDa+gE(g{E8-N>u+kp21_W%z7 zp9j7P{1EspFbCy$L5@nV0FDBt0cQXg04ss3fg6B#0UrWB13U(NANVQIoQwJg91M&D zW&o!GX9MR0F99wCRsmN5*8*<>ZUa65d<1v^cm#M1_!jUa@SnhMfSqzt|9}I4!+>$X zF~AJqOyB}w968LN2e&Dmf7l3a8KLdUX44JRe9}XN290g1P zP6g%yUBC+9D&Sh+2H;dct90rU9 zUIa`7P6o~eE(R6@%Yk*ktAQJUw*c=1J^=g`a6j-c@MYi|z)Lr)^uGuG5%6>1zkrT~ z%3W9B0AM6=BybEc9XJh`1I!0j1M7hez@Gvefm?u0zKMq8zxt-<{mZ)&20%rkpfJ=e-z(U}1U^Q?R@Cx8M;Eljdz*~V^ zfp-D#1MUXy0X_yi0DKB~82CK!Mc}Kzw}H*T_kkyX9|OMteg*s<7`#-;<>(fL$AHIy z?*LB$zXW~*bZk}rLV#U>7O)qvKX5Q`I4~BN3`_y01E&JBfJ=d;zUu8 z$H32lUjx4b25(dH3k41YMgXIMall02SYR4(A+QLz99Rup1-t^d4!8k$3ve^=PT+Rn zPT<49M}hl+2Z4uyF9Mr^Cx9OTzXW~*4F0*2LpNYAU|*mBMgvCzlYuF~bl`MgHgGX8 zA6Noh18e|Z58ME31a1a40q+Ms415&05BMbTIPe|d2f&lSQ@}5Q-vEQ}M7;o7z;NI| zU<5E4I1-o)OaZ0?Cj(~!bAgM2E?_CJ5?Bjd18e|Z54;7q4cG+iq#sz|KA3-UgX+ID z&fTE+?>G9Je+2$SqcVR1sQvv7eEQAG{#U?t^tm;jir)+De5>NafS2D6zFA@SEed}H zd~2KHzqnIj6MfZ0lO6c6!)D7+E)2jKqzfBvqre*yR};IL+8uJu-ppQ`6V>!V2QtzN$# zs`PKITK*e`TJP2edO#hNPR|uE*bV!i(r4LN-umi9--BYF0@UW^`WE!+{ym&pPr)l2U8XP3;6HGdlLc} zHcN&3B~XX^V3sof8&I2nJ6oAQl&w&kw}p*Q_&?9x@PHnKc?9@T@D1R5z-ihnuhZb) zfm{1kxZ%7wLYMQmio3wm!ArmwfnkY?mZx4WBil{_`y0j}3Qg5|eN4I`DlsK(ET-TXtCYyV$>>w2~c z=@>Ep%;k2n4f`$&&g>7tw}8?sRKDH7D}g#)hg$gfVFtS09o^3KY5AOjd%GNmF7z)4 zC%E0+E}MA}ebA0mo|)tC{|UI$`MtxIy_2xF8MjGwesi%t*QP^Q=y(gj|F~GCPp|K_ z<^RvYj7s=Ursy0Wnjs^j0+&UB^2!?{YAPEXVG z{_-e4$MM?bq01rfJjJ{0JjJ`{JjGjfj^njIhq`>1pQm_J&r`f5=Q!T2*zbU73@zuC z=PBN_a~yA5^=kZiiZ}N>#k=G@#hZVg;=SY?$J_jj|2RQEN0*+bcwOf>-nO2j;{R~G zh|be)mHvn0*X3Mvj^j-~+v*4QJ-?ObI$qoOUzcz7d5X8{9LKx$ zh`*c>9lhE>T?a9)*ZP3&FxPXWM%e3lr33TFtp#e{rR7KJdB5u^*!vltf#~_7aJ6qf zr{nzv!rTpimlpc_A6caM=fE>0puz1C(y!NV!fO=Q?Pst& z^+Ebkm}|NJU+EX`L%2G>ZJ~~LFC0AWR_PpnnZNuWyj=0-EBwvd3b!qD=TZND=z7RM z8|L3Zp!MKd-uCq}3-($+oe!?%+Y#~|U9Zw>H-87_&l*881^Rr!dxnV=sT^qeJckTD zbiE2M;-~&{xDotGoB5O*lso4}fA?+4r}-7i$J_7bm@EY)R z@I&C);56KnS1Gt&kEjP-OLUdn4P)hX3Y@xib-kt1LB}NJWr2SN zF2KJ8cY^EjL^`-0Ph@NVcwY0hfADJXP;?Xx;ClZ$quspwc7Ok$!krFpgw1}mjgPm*KLcE+ z_hFm+Kil|=w)ke=<)5Ah+DLb2xYN&>*8haxtNcTp=L~kDT=n^9osLfsWBh+89Xf;h zT(IUEkKgWJpT65`uOF%+KmKUz=GDLPH`n9WwNJEezNroKrZ&tUZDFp`bEFOPP5b@h z)#K#&-?nZ(wGH!po4Fo0Uv4wk^Rpv|{lnLCxaWCguIu}t7yNm$jnA<0BQ~D-qQCz` zHoo+a{^@XFobhEF=9f}K%+H3dpKDPu5?)s32Y|Z1Xw>J?HUIUWl>4h+QK-$IM);a* zJgCou!yp#zZ4=I~uhH%EUsV0P1?_1xxSs!|gKviYLhx?jN8eWd{{Y?$emD4O@K?aA z;opV$*Mt8Z_D$d;!S{i02R{nF4*pMQ4toRn)AQTD;IXiGg7-&%kq&+m;bnuW zdo#>+K1~cD-XcW-|NIQN_!GtL^Pp{i>-y|4)cbMfhN|b-Ypyz+bgOmq*)Z4n)&7F9UfQLH@~6i&J;MC? z2peB-<0ox=OizFR^T2hy>eP;5jP9k}>HOFC_V;(IjqkMaL*P1GJ+6DH4fDU){C{ZU zUBmt3j{?`>>;2=uvYDHZW3$cwi9Y_}jqIzq4o{C~8`?1M+t1&<&R>nqT&L?rnCtpg z*kAeA^1a2zp9I(M4T>C~+-p7tT-S?UqgDOXd=P=!zr&wCNAorKQH&Qp1J8d{xu;~yYu|4aPXX8cL<#uL-zxi6;K#9FU@f?Qf6^bo z_4|+pWBjJyipMQ@0I&o!1o%-3xZYoN7<@g_quWWE9?DDa$4y6l z)aPkWQN?Djnm1tmY@PCE=ykQh2xltV=N#0RgK+;a?3=*%g6{#>=^2G^^;-a)u-E<3 z2Ln}lH2)G@_osSXu@mM9&d~i;$ROokyVw0@g3Vm-BkMB6-+f2)^S8rX%ViJN5p{f8 zK6;&zhH>(0Mt&AUJ|XaTDYyXdhW7gu+=tn?me)myup=pcKtKWk z2?Qh%kU&5J0SN>o5RgDX0s#pGBoL6m|GyIG5z#k)a%TRGj*RM%{7W+O>n7w+pIDup zLo_FY|Eewe3(1)S!6t#Oi4BYEk&UznmT(0`v2WoNtxBABKH%CQwdvUNds0R`<=B*5W4N zX1=AmVQsH9y@PB^+IyWH&u{DGDONr$fX&a8m>%~Rr#0SePY8R z@;^_Dt2$(^w3s`I>LrOIWR858d!*BMMdjxs^9oB>5UrmBYRo5Aa= z6P(OXC|*)6KO|aKvbu;(Pbt%i;)=rR)toFgJgp4ri}!_9Zb}z@D4C5Lf^0b`DJUyv zi}h?lU&O9VWY);6u$(@_$80OJ;`%ZfLX#rZY_XGnm(X`ine1UwUbT#W@8jS60nn;K zrUxaZ^p(nN9nrKxhH_L>`oJ7HJ`P$@wMxd`3{KzQW9t)4D+{FjPVsO0FrXx-nb7x3 z*-=9<|K=~pl`vf|Xfu-W&dzI>-faHjw0D@K4fk-?{eJlsCwD_ z%)B{hN6sKB`y8)ye8{n;WTRt!(8ZIU zH+w{hXM-0_x!Vzzd&u#i89(d7xLxMb+Z`8!le5jjddl%KM{~~c* z`K9?w^N^W%%*?MI{g`88=Sc&zXZ0^1m{wW$oMXk%ht0aOq#J@h><~M5VXx3sO55b# zed}^=H80P)!Q5b`q|8e0njLbj8JeCxw#U3ZW?}Y8b6Dy=Gx2frZZqlIpxBb0k&#`x zOq{>LajV&-_ng@S!oP524d~N-byP;5>&*15mmPm_{L-wNbG!Lr&$N9(?*uQsDY!?E zUcH_p{{#9C*kC@>`;89YIQsOt^2#f>(SuW3Sbd}UMbJ?*cG{rR=9uYUJN5=|GnajB zz7$lwGbr|_<_+e0^R=LPzc){qv6Frh)pzLA9iB5E?(j&5vRBMLr9hoOarAUr=*G)X=coI>%kPI(p>#E*A|6iBMk>TbgVbOX-^|$LR%Sag6kV zw_b!VUS=54gdy~y1wr`DpOks@n}%T#?-gW9^PQbdV<++Cai%er@LBqE`d`bfLQ|-QDQsr-o}+54!ms_C4wDMR#wy!|Cor zH`lp-boZxw0Nn%W9z^$Gy7~JSg6^SoN6#=!ZIx$3NsrJo@2#1dpiC**ju>hwhly78I_K=LO|yJ3kY3f)FR~aO6&%wd2SP zb-GR-tJCM{WMp)ZP9hydL*x?WnK?G#!*cSJoH`yS&&BBjae38z5>6d~(`Vl#a$s~8 nj!(NW%42T)gU`3&U|Wk*jx_~EH7TP;jUJPbJUTg%MQi*oM*FDG literal 0 HcmV?d00001 diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index dd7600eb9c..5c6f25dba8 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -215,9 +215,14 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_append_obj, displayio_group_obj_append //| STATIC mp_obj_t displayio_group_obj_insert(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t layer) { displayio_group_t *self = native_group(self_in); - size_t index = mp_get_index(&displayio_group_type, common_hal_displayio_group_get_len(self), index_obj, false); - common_hal_displayio_group_insert(self, index, layer); - return mp_const_none; + if ((size_t) MP_OBJ_SMALL_INT_VALUE(index_obj) == common_hal_displayio_group_get_len(self)){ + return displayio_group_obj_append(self_in, layer); + } + else { + size_t index = mp_get_index(&displayio_group_type, common_hal_displayio_group_get_len(self), index_obj, false); + common_hal_displayio_group_insert(self, index, layer); + return mp_const_none; + } } MP_DEFINE_CONST_FUN_OBJ_3(displayio_group_insert_obj, displayio_group_obj_insert); From d37326326dba329392964d283eb13507643bfbec Mon Sep 17 00:00:00 2001 From: sabas1080 Date: Tue, 28 Jul 2020 00:56:37 -0500 Subject: [PATCH 0396/1293] init bastwifi --- .../boards/electroniccats_bastwifi/board.c | 47 +++++++++++++++++++ .../electroniccats_bastwifi/mpconfigboard.h | 32 +++++++++++++ .../electroniccats_bastwifi/mpconfigboard.mk | 19 ++++++++ .../boards/electroniccats_bastwifi/pins.c | 46 ++++++++++++++++++ .../boards/electroniccats_bastwifi/sdkconfig | 0 5 files changed, 144 insertions(+) create mode 100644 ports/esp32s2/boards/electroniccats_bastwifi/board.c create mode 100644 ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h create mode 100644 ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.mk create mode 100644 ports/esp32s2/boards/electroniccats_bastwifi/pins.c create mode 100644 ports/esp32s2/boards/electroniccats_bastwifi/sdkconfig diff --git a/ports/esp32s2/boards/electroniccats_bastwifi/board.c b/ports/esp32s2/boards/electroniccats_bastwifi/board.c new file mode 100644 index 0000000000..9f708874bf --- /dev/null +++ b/ports/esp32s2/boards/electroniccats_bastwifi/board.c @@ -0,0 +1,47 @@ +/* + * 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 "boards/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h b/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h new file mode 100644 index 0000000000..ed3f23a3c4 --- /dev/null +++ b/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h @@ -0,0 +1,32 @@ +/* + * 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 "BastWiFi" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.mk b/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.mk new file mode 100644 index 0000000000..4a2e8ecd8a --- /dev/null +++ b/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.mk @@ -0,0 +1,19 @@ +USB_VID = 0x239A +USB_PID = 0x80A6 +USB_PRODUCT = "Bast WiFi" +USB_MANUFACTURER = "ElectronicCats" + +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_NEOPIXEL_WRITE = 0 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=4MB + +CIRCUITPY_MODULE=wrover diff --git a/ports/esp32s2/boards/electroniccats_bastwifi/pins.c b/ports/esp32s2/boards/electroniccats_bastwifi/pins.c new file mode 100644 index 0000000000..1d4e2c4eba --- /dev/null +++ b/ports/esp32s2/boards/electroniccats_bastwifi/pins.c @@ -0,0 +1,46 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { 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_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_IO17), MP_ROM_PTR(&pin_GPIO17) }, + + + { 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_IO20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_IO26), MP_ROM_PTR(&pin_GPIO26) }, + { 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_IO37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/esp32s2/boards/electroniccats_bastwifi/sdkconfig b/ports/esp32s2/boards/electroniccats_bastwifi/sdkconfig new file mode 100644 index 0000000000..e69de29bb2 From e15bcebb6efe54f82fa7ac0da4f18b7a482e2f57 Mon Sep 17 00:00:00 2001 From: ansonhe97 Date: Tue, 28 Jul 2020 17:31:17 +0800 Subject: [PATCH 0397/1293] Added display QSTR to Wio Terminal --- ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c index 254d730a89..0558191e63 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c @@ -1,4 +1,5 @@ #include "shared-bindings/board/__init__.h" +#include "shared-module/displayio/__init__.h" STATIC const mp_rom_map_elem_t board_global_dict_table[] = { @@ -86,5 +87,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_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_DISPLAY), MP_ROM_PTR(&displays[0].display) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From e5e132a36436aa5aa0a6124b28edd44536fc38c7 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 26 Jul 2020 21:27:32 -0400 Subject: [PATCH 0398/1293] add blm_badge; add CIRCUITPY_AUDIOBUSIOIO_I2SOUT --- ports/atmel-samd/boards/blm_badge/board.c | 39 +++++++++++++++++ .../boards/blm_badge/mpconfigboard.h | 37 ++++++++++++++++ .../boards/blm_badge/mpconfigboard.mk | 24 +++++++++++ ports/atmel-samd/boards/blm_badge/pins.c | 43 +++++++++++++++++++ .../atmel-samd/common-hal/audiobusio/I2SOut.c | 7 +++ .../atmel-samd/common-hal/audiobusio/I2SOut.h | 5 +++ .../atmel-samd/common-hal/audiobusio/PDMIn.c | 30 ++++++++----- ports/atmel-samd/supervisor/port.c | 4 +- py/circuitpy_mpconfig.mk | 4 ++ shared-bindings/audiobusio/I2SOut.c | 11 +++++ shared-bindings/audiobusio/I2SOut.h | 5 +++ 11 files changed, 198 insertions(+), 11 deletions(-) create mode 100644 ports/atmel-samd/boards/blm_badge/board.c create mode 100644 ports/atmel-samd/boards/blm_badge/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/blm_badge/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/blm_badge/pins.c diff --git a/ports/atmel-samd/boards/blm_badge/board.c b/ports/atmel-samd/boards/blm_badge/board.c new file mode 100644 index 0000000000..ee353c8108 --- /dev/null +++ b/ports/atmel-samd/boards/blm_badge/board.c @@ -0,0 +1,39 @@ +/* + * 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 "boards/board.h" +#include "supervisor/shared/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + board_reset_user_neopixels(); +} diff --git a/ports/atmel-samd/boards/blm_badge/mpconfigboard.h b/ports/atmel-samd/boards/blm_badge/mpconfigboard.h new file mode 100644 index 0000000000..4f56d23b0a --- /dev/null +++ b/ports/atmel-samd/boards/blm_badge/mpconfigboard.h @@ -0,0 +1,37 @@ +#define MICROPY_HW_BOARD_NAME "Adafruit BLM Badge" +#define MICROPY_HW_MCU_NAME "samd21e18" + +#define MICROPY_HW_LED_STATUS (&pin_PA03) + +#define MICROPY_PORT_A (PORT_PA24 | PORT_PA25) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define DEFAULT_I2C_BUS_SCL (&pin_PA01) +#define DEFAULT_I2C_BUS_SDA (&pin_PA00) + +#define DEFAULT_UART_BUS_RX (&pin_PA01) +#define DEFAULT_UART_BUS_TX (&pin_PA00) + +#define USER_NEOPIXELS_PIN (&pin_PA05) + +#define IGNORE_PIN_PA09 1 +#define IGNORE_PIN_PA12 1 +#define IGNORE_PIN_PA13 1 +#define IGNORE_PIN_PA14 1 +#define IGNORE_PIN_PA15 1 +#define IGNORE_PIN_PA16 1 +#define IGNORE_PIN_PA17 1 +#define IGNORE_PIN_PA18 1 +#define IGNORE_PIN_PA19 1 +#define IGNORE_PIN_PA20 1 +#define IGNORE_PIN_PA21 1 +#define IGNORE_PIN_PA22 1 +#define IGNORE_PIN_PA23 1 +// USB is always used. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 +#define IGNORE_PIN_PA27 1 +#define IGNORE_PIN_PA28 1 +#define IGNORE_PIN_PA30 1 +#define IGNORE_PIN_PA31 1 diff --git a/ports/atmel-samd/boards/blm_badge/mpconfigboard.mk b/ports/atmel-samd/boards/blm_badge/mpconfigboard.mk new file mode 100644 index 0000000000..794e38d792 --- /dev/null +++ b/ports/atmel-samd/boards/blm_badge/mpconfigboard.mk @@ -0,0 +1,24 @@ +USB_VID = 0x239A +USB_PID = 0x80C0 +USB_PRODUCT = "BLM Badge" +USB_MANUFACTURER = "Adafruit Industries LLC" + +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE +CIRCUITPY_FULL_BUILD = 0 + +CIRCUITPY_AUDIOIO = 1 +CIRCUITPY_AUDIOBUSIO = 1 +# Pins for I2SOut are not available. +CIRCUITPY_AUDIOBUSIO_I2SOUT = 0 +CIRCUITPY_PULSEIO = 0 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_RTC = 0 +CIRCUITPY_SAMD = 0 +CIRCUITPY_USB_HID = 1 +CIRCUITPY_USB_MIDI = 0 + +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/blm_badge/pins.c b/ports/atmel-samd/boards/blm_badge/pins.c new file mode 100644 index 0000000000..af1b693584 --- /dev/null +++ b/ports/atmel-samd/boards/blm_badge/pins.c @@ -0,0 +1,43 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA01) }, // pad 1 + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA01) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA00) }, // pad 0 + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA00) }, + + { MP_ROM_QSTR(MP_QSTR_CAP1), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, + + { MP_ROM_QSTR(MP_QSTR_CAP2), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA04) }, + + { MP_ROM_QSTR(MP_QSTR_CAP3), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA06) }, + + { MP_ROM_QSTR(MP_QSTR_CAP4), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA07) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA05) }, + + { MP_ROM_QSTR(MP_QSTR_MICROPHONE_CLOCK), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA10) }, + + { MP_ROM_QSTR(MP_QSTR_MICROPHONE_DATA), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA08) }, + + { MP_ROM_QSTR(MP_QSTR_LIGHT), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA11) }, + + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA03) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c index 20fa624edf..0aa48c8047 100644 --- a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c +++ b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -27,6 +27,11 @@ #include #include +#include "mpconfigport.h" + +// Some boards don't implement I2SOut, so suppress any routines from here. +#if CIRCUITPY_AUDIOBUSIO_I2SOUT + #include "extmod/vfs_fat.h" #include "py/gc.h" #include "py/mperrno.h" @@ -382,3 +387,5 @@ bool common_hal_audiobusio_i2sout_get_playing(audiobusio_i2sout_obj_t* self) { } return still_playing; } + +#endif // CIRCUITPY_AUDIOBUSIO_I2SOUT diff --git a/ports/atmel-samd/common-hal/audiobusio/I2SOut.h b/ports/atmel-samd/common-hal/audiobusio/I2SOut.h index ce88f4de69..a66dae9bbd 100644 --- a/ports/atmel-samd/common-hal/audiobusio/I2SOut.h +++ b/ports/atmel-samd/common-hal/audiobusio/I2SOut.h @@ -32,6 +32,9 @@ #include "audio_dma.h" #include "py/obj.h" +// Some boards don't implement I2SOut, so suppress any routines from here. +#if CIRCUITPY_AUDIOBUSIO_I2SOUT + // We don't bit pack because we'll only have two at most. Its better to save code size instead. typedef struct { mp_obj_base_t base; @@ -48,4 +51,6 @@ typedef struct { void i2sout_reset(void); +#endif // CIRCUITPY_AUDIOBUSIO_I2SOUT + #endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_AUDIOBUSIO_I2SOUT_H diff --git a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c index 474512f5ea..21474ab3b1 100644 --- a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c +++ b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -84,12 +84,12 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, self->clock_pin = clock_pin; // PA10, PA20 -> SCK0, PB11 -> SCK1 #ifdef SAMD21 if (clock_pin == &pin_PA10 - #ifdef PIN_PA20 + #if defined(PIN_PA20) && !defined(IGNORE_PIN_PA20) || clock_pin == &pin_PA20 #endif ) { self->clock_unit = 0; - #ifdef PIN_PB11 + #if defined(PIN_PB11) && !defined(IGNORE_PIN_PB11) } else if (clock_pin == &pin_PB11) { self->clock_unit = 1; #endif @@ -98,7 +98,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, if (clock_pin == &pin_PA10 || clock_pin == &pin_PB16) { self->clock_unit = 0; } else if (clock_pin == &pin_PB12 - #ifdef PIN_PB28 + #if defined(PIN_PB28) && !defined(IGNORE_PIN_PB28) || data_pin == &pin_PB28) { #else ) { @@ -112,14 +112,24 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, self->data_pin = data_pin; // PA07, PA19 -> SD0, PA08, PB16 -> SD1 #ifdef SAMD21 - if (data_pin == &pin_PA07 || data_pin == &pin_PA19) { - self->serializer = 0; - } else if (data_pin == &pin_PA08 - #ifdef PIN_PB16 - || data_pin == &pin_PB16) { - #else - ) { + if (false + #if defined(PIN_PA07) && !defined(IGNORE_PIN_PA07) + || data_pin == &pin_PA07 #endif + #if defined(PIN_PA19) && !defined(IGNORE_PIN_PA19) + || data_pin == &pin_PA19 + #endif + ) { + self->serializer = 0; + } + else if (false + #if defined(PIN_PA08) && !defined(IGNORE_PIN_PA08) + || data_pin == &pin_PA08 + #endif + #if defined (PIN_PB16) && !defined(IGNORE_PIN_PB16) + || data_pin == &pin_PB16 + #endif + ) { self->serializer = 1; #endif #ifdef SAM_D5X_E5X diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 65501861e0..591a858536 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -322,9 +322,11 @@ void reset_port(void) { audioout_reset(); #endif #if CIRCUITPY_AUDIOBUSIO - i2sout_reset(); //pdmin_reset(); #endif +#if CIRCUITPY_AUDIOBUSIO_I2SOUT + i2sout_reset(); +#endif #if CIRCUITPY_TOUCHIO && CIRCUITPY_TOUCHIO_USE_NATIVE touchin_reset(); diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index baa29e26b4..2cf8426e5f 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -42,6 +42,10 @@ CFLAGS += -DCIRCUITPY_ANALOGIO=$(CIRCUITPY_ANALOGIO) CIRCUITPY_AUDIOBUSIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_AUDIOBUSIO=$(CIRCUITPY_AUDIOBUSIO) +# Some boards have PDMIn but do not implement I2SOut. +CIRCUITPY_AUDIOBUSIO_I2SOUT ?= $(CIRCUITPY_AUDIOBUSIO) +CFLAGS += -DCIRCUITPY_AUDIOBUSIO_I2SOUT=$(CIRCUITPY_AUDIOBUSIO_I2SOUT) + CIRCUITPY_AUDIOIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_AUDIOIO=$(CIRCUITPY_AUDIOIO) diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index 304c737f62..dbe02b874b 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -91,6 +91,10 @@ //| ... //| STATIC mp_obj_t audiobusio_i2sout_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { +#if !CIRCUITPY_AUDIOBUSIO_I2SOUT + mp_raise_NotImplementedError(translate("I2SOut not available")); + return NULL; // Not reachable. +#else enum { ARG_bit_clock, ARG_word_select, ARG_data, ARG_left_justified }; static const mp_arg_t allowed_args[] = { { MP_QSTR_bit_clock, MP_ARG_OBJ | MP_ARG_REQUIRED }, @@ -110,8 +114,11 @@ STATIC mp_obj_t audiobusio_i2sout_make_new(const mp_obj_type_t *type, size_t n_a common_hal_audiobusio_i2sout_construct(self, bit_clock, word_select, data, args[ARG_left_justified].u_bool); return MP_OBJ_FROM_PTR(self); +#endif } +#if CIRCUITPY_AUDIOBUSIO_I2SOUT + //| def deinit(self) -> None: //| """Deinitialises the I2SOut and releases any hardware resources for reuse.""" //| ... @@ -120,6 +127,7 @@ STATIC mp_obj_t audiobusio_i2sout_deinit(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audiobusio_i2sout_deinit(self); return mp_const_none; + } STATIC MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_deinit_obj, audiobusio_i2sout_deinit); @@ -251,9 +259,11 @@ const mp_obj_property_t audiobusio_i2sout_paused_obj = { (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj}, }; +#endif // CIRCUITPY_AUDIOBUSIO_I2SOUT STATIC const mp_rom_map_elem_t audiobusio_i2sout_locals_dict_table[] = { // Methods +#if CIRCUITPY_AUDIOBUSIO_I2SOUT { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&audiobusio_i2sout_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&audiobusio_i2sout_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, @@ -266,6 +276,7 @@ STATIC const mp_rom_map_elem_t audiobusio_i2sout_locals_dict_table[] = { // Properties { MP_ROM_QSTR(MP_QSTR_playing), MP_ROM_PTR(&audiobusio_i2sout_playing_obj) }, { MP_ROM_QSTR(MP_QSTR_paused), MP_ROM_PTR(&audiobusio_i2sout_paused_obj) }, +#endif // CIRCUITPY_AUDIOBUSIO_I2SOUT }; STATIC MP_DEFINE_CONST_DICT(audiobusio_i2sout_locals_dict, audiobusio_i2sout_locals_dict_table); diff --git a/shared-bindings/audiobusio/I2SOut.h b/shared-bindings/audiobusio/I2SOut.h index edf4ecfa0b..55527dc730 100644 --- a/shared-bindings/audiobusio/I2SOut.h +++ b/shared-bindings/audiobusio/I2SOut.h @@ -32,6 +32,9 @@ extern const mp_obj_type_t audiobusio_i2sout_type; +// Some boards don't have the I2SOut pins available. +#if CIRCUITPY_AUDIOBUSIO_I2SOUT + void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t* self, const mcu_pin_obj_t* bit_clock, const mcu_pin_obj_t* word_select, const mcu_pin_obj_t* data, bool left_justified); @@ -45,4 +48,6 @@ void common_hal_audiobusio_i2sout_pause(audiobusio_i2sout_obj_t* self); void common_hal_audiobusio_i2sout_resume(audiobusio_i2sout_obj_t* self); bool common_hal_audiobusio_i2sout_get_paused(audiobusio_i2sout_obj_t* self); +#endif // CIRCUITPY_AUDIOBUSIO_I2SOUT + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_AUDIOBUSIO_I2SOUT_H From 9572f306d3a4cbbbb662961890147b7793e740a9 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 28 Jul 2020 11:56:00 -0400 Subject: [PATCH 0399/1293] ATT WIP --- devices/ble_hci/common-hal/_bleio/Adapter.c | 3 + devices/ble_hci/common-hal/_bleio/Adapter.h | 3 + devices/ble_hci/common-hal/_bleio/Service.c | 47 ++- devices/ble_hci/common-hal/_bleio/att.c | 318 +++++++++++--------- devices/ble_hci/common-hal/_bleio/att.h | 2 +- 5 files changed, 206 insertions(+), 167 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index 55e0bde017..6c94bb1a92 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -238,6 +238,9 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable self->extended_advertising = false; self->circuitpython_advertising = false; self->advertising_timeout_msecs = 0; + + // Reset list of known attributes. + self->attributes = mp_obj_new_list(0, NULL); } bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self) { diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.h b/devices/ble_hci/common-hal/_bleio/Adapter.h index 10a398b24f..d2f38b757c 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.h +++ b/devices/ble_hci/common-hal/_bleio/Adapter.h @@ -67,6 +67,9 @@ typedef struct _bleio_adapter_obj_t { uint16_t max_adv_data_len; uint8_t features[8]; // Supported BLE features. + // All the local attributes for this device. The index into the list + // corresponds to the handle. + mp_obj_list_t *attributes; } bleio_adapter_obj_t; void bleio_adapter_background(bleio_adapter_obj_t* adapter); diff --git a/devices/ble_hci/common-hal/_bleio/Service.c b/devices/ble_hci/common-hal/_bleio/Service.c index 1f9649b6c3..07a9b4de25 100644 --- a/devices/ble_hci/common-hal/_bleio/Service.c +++ b/devices/ble_hci/common-hal/_bleio/Service.c @@ -40,24 +40,18 @@ uint32_t _common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uu self->connection = NULL; self->is_secondary = is_secondary; - //FIX - // ble_uuid_t nordic_uuid; - // bleio_uuid_convert_to_nrf_ble_uuid(uuid, &nordic_uuid); - - // uint8_t service_type = BLE_GATTS_SRVC_TYPE_PRIMARY; - // if (is_secondary) { - // service_type = BLE_GATTS_SRVC_TYPE_SECONDARY; - // } - vm_used_ble = true; - //FIX return sd_ble_gatts_service_add(service_type, &nordic_uuid, &self->handle); - return 0; + uint32_t status; + self->handle = bleio_adapter_add_attribute( + is_secondary ? BLE_TYPE_SECONDARY_SERVICE : BLE_TYPE_PRIMARY_SERVICE, + uuid, &status); + return status; } void common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uuid_obj_t *uuid, bool is_secondary) { - //FIX check_nrf_error(_common_hal_bleio_service_construct(self, uuid, is_secondary, - // mp_obj_new_list(0, NULL))); + check_hci_error(_common_hal_bleio_service_construct(self, uuid, is_secondary, + mp_obj_new_list(0, NULL))); } void bleio_service_from_connection(bleio_service_obj_t *self, mp_obj_t connection) { @@ -88,6 +82,30 @@ bool common_hal_bleio_service_get_is_secondary(bleio_service_obj_t *self) { void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, bleio_characteristic_obj_t *characteristic, mp_buffer_info_t *initial_value_bufinfo) { + common_hal_bleio_adapter_obj + //FIX how it's done by ArduinoBLE when a service is added. + // uint16_t startHandle = attributeCount(); + + // for (unsigned int i = 0; i < service->characteristicCount(); i++) { + // BLELocalCharacteristic* characteristic = service->characteristic(i); + + // characteristic->retain(); + // _attributes.add(characteristic); + // characteristic->setHandle(attributeCount()); + + // // add the characteristic again to make space of the characteristic value handle + // _attributes.add(characteristic); + + // for (unsigned int j = 0; j < characteristic->descriptorCount(); j++) { + // BLELocalDescriptor* descriptor = characteristic->descriptor(j); + + // descriptor->retain(); + // _attributes.add(descriptor); + // descriptor->setHandle(attributeCount()); + // } + // } + + service->setHandles(startHandle, attributeCount()); // ble_gatts_char_md_t char_md = { // .char_props.broadcast = (characteristic->props & CHAR_PROP_BROADCAST) ? 1 : 0, // .char_props.read = (characteristic->props & CHAR_PROP_READ) ? 1 : 0, @@ -101,9 +119,6 @@ void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, // .vloc = BLE_GATTS_VLOC_STACK, // }; - // ble_uuid_t char_uuid; - // bleio_uuid_convert_to_nrf_ble_uuid(characteristic->uuid, &char_uuid); - // ble_gatts_attr_md_t char_attr_md = { // .vloc = BLE_GATTS_VLOC_STACK, // .vlen = !characteristic->fixed_length, diff --git a/devices/ble_hci/common-hal/_bleio/att.c b/devices/ble_hci/common-hal/_bleio/att.c index d37012a0ad..ad1dddca22 100644 --- a/devices/ble_hci/common-hal/_bleio/att.c +++ b/devices/ble_hci/common-hal/_bleio/att.c @@ -43,7 +43,7 @@ enum ble_attribute_type { STATIC uint16_t max_mtu = BT_ATT_DEFAULT_LE_MTU; // 23 STATIC unsigned long timeout = 5000; -STATIC volatile bool cnf; +STATIC volatile bool confirm; STATIC uint16_t long_write_handle = 0x0000; STATIC uint8_t* long_write_value = NULL; @@ -75,7 +75,11 @@ STATIC void send_error(uint16_t conn_handle, uint8_t opcode, uint16_t handle, ui hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, sizeof(rsp), (uint8_t *) &rsp); } -STATIC int send_req_wait_for_rsp(uint16_t conn_handle, int request_length, uint8_t* request_buffer, uint8_t response_buffer[]) { +STATIC void send_req(uint16_t conn_handle, size_t request_length, uint8_t* request_buffer) { + hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, request_length, request_buffer); +} + +STATIC int send_req_wait_for_rsp(uint16_t conn_handle, size_t request_length, uint8_t* request_buffer, uint8_t response_buffer[]) { // We expect a particular kind of response after this request. expected_rsp.conn_handle = conn_handle; // The response opcode is the request opcode + 1. @@ -83,7 +87,7 @@ STATIC int send_req_wait_for_rsp(uint16_t conn_handle, int request_length, uint expected_rsp.buffer = response_buffer; expected_rsp.length = 0; - hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, request_length, request_buffer); + send_req(conn_handle, request_length, request_buffer); if (response_buffer == NULL) { // not expecting a response. @@ -450,7 +454,7 @@ void att_add_connection(uint16_t handle, uint8_t role, bt_addr_le_t *peer_addr, bleio_connections[peer_index].conn_handle = handle; bleio_connections[peer_index].role = role; - bleio_connections[peer_index].mtu = 23; + bleio_connections[peer_index].mtu = BT_ATT_DEFAULT_LE_MTU; memcpy(&bleio_connections[peer_index].addr, peer_addr, sizeof(bleio_connections[peer_index].addr)); //FIX if (event_handlers[BLEConnected]) { @@ -506,7 +510,7 @@ void att_remove_connection(uint16_t handle, uint8_t reason) { bleio_connections[peer_index].conn_handle = 0xffff; bleio_connections[peer_index].role = 0x00; memset(&bleio_connections[peer_index].addr, 0x00, sizeof(bleio_connections[peer_index].addr)); - bleio_connections[peer_index].mtu = 23; + bleio_connections[peer_index].mtu = BT_ATT_DEFAULT_LE_MTU; //FIX if (bleio_connections[peer_index].device) { //FIX delete bleio_connections[peer_index].device; @@ -569,7 +573,7 @@ uint16_t att_mtu(uint16_t handle) { } } - return 23; + return BT_ATT_DEFAULT_LE_MTU; } bool att_disconnect_all(void) { @@ -590,7 +594,7 @@ bool att_disconnect_all(void) { bleio_connections[i].role = 0x00; bleio_connections[i].addr.type = 0; memset(bleio_connections[i].addr.a.val, 0, sizeof(bleio_connections[i].addr.a.val)); - bleio_connections[i].mtu = 23; + bleio_connections[i].mtu = BT_ATT_DEFAULT_LE_MTU; //FIX // if (bleio_connections[i].device) { @@ -645,7 +649,7 @@ bool att_handle_notify(uint16_t handle, const uint8_t* value, int length) { return (num_notifications > 0); } -bool att_handle_ind(uint16_t handle, const uint8_t* value, int length) { +bool att_handle_indicate(uint16_t handle, const uint8_t* value, int length) { int num_indications = 0; for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { @@ -666,11 +670,11 @@ bool att_handle_ind(uint16_t handle, const uint8_t* value, int length) { memcpy(&indication[indication_length], value, length); indication_length += length; - cnf = false; + confirm = false; hci_send_acl_pkt(bleio_connections[i].conn_handle, BT_L2CAP_CID_ATT, indication_length, indication); - while (!cnf) { + while (!confirm) { hci_poll_for_incoming_pkt(); if (!att_address_is_connected(&bleio_connections[i].addr)) { @@ -1214,7 +1218,7 @@ int att_read_by_type_req(uint16_t conn_handle, uint16_t start_handle, uint16_t e return send_req_wait_for_rsp(conn_handle, sizeof(req), (uint8_t *) &req, response_buffer); } -void att_read_by_type_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { +STATIC void process_read_by_type_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { if (dlen < 1) { return; // invalid, drop } @@ -1223,8 +1227,10 @@ void att_read_by_type_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { } // Handles BT_ATT_OP_WRITE_REQ or BT_ATT_OP_WRITE_ -STATIC void process_req_or_cmd(uint16_t conn_handle, uint16_t mtu, uint8_t op, uint8_t dlen, uint8_t data[]) { - boolean with_response = (op == BT_ATT_OP_WRITE_REQ); +STATIC void process_write_req_or_cmd(uint16_t conn_handle, uint16_t mtu, uint8_t op, uint8_t dlen, uint8_t data[]) { + // struct bt_att_write_cmd is identical, so don't bother to split code paths based on opcode. + //FIX REMOVE this later struct bt_att_write_req *req = (struct bt_att_write_req *) data; + bool with_response = (op == BT_ATT_OP_WRITE_REQ); if (dlen < sizeof(struct bt_att_write_req)) { if (with_response) { @@ -1233,24 +1239,23 @@ STATIC void process_req_or_cmd(uint16_t conn_handle, uint16_t mtu, uint8_t op, u return; } - uint16_t handle = *(uint16_t*)data; - - // if ((uint16_t)(handle - 1) > GATT.attributeCount()) { + //FIX why cast? + // if ((uint16_t)(req->handle - 1) > GATT.attributeCount()) { // if (with_response) { // send_error(conn_handle, BT_ATT_OP_WRITE_REQ, handle, BT_ATT_ERR_ATTR_NOT_FOUND); // } // return; // } - // uint8_t value_length = dlen - sizeof(handle); - // uint8_t* value = &data[sizeof(handle)]; + // uint8_t value_length = dlen - sizeof(req->handle); + // uint8_t* value = &data[sizeof(req->handle)]; - // BLELocalAttribute* attribute = GATT.attribute(handle - 1); + // BLELocalAttribute* attribute = GATT.attribute(req->handle - 1); // if (attribute->type() == BLE_TYPE_CHARACTERISTIC) { // BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)attribute; - // if (handle != characteristic->value_handle() || + // if (req->handle != characteristic->value_handle() || // withResponse ? ((characteristic->properties() & BLEWrite) == 0) : // ((characteristic->properties() & BLEWriteWithoutResponse) == 0)) { // if (withResponse) { @@ -1301,7 +1306,7 @@ STATIC void process_req_or_cmd(uint16_t conn_handle, uint16_t mtu, uint8_t op, u // return; // } - if (withResponse) { + if (with_response) { uint8_t response[mtu]; uint16_t response_length; @@ -1320,88 +1325,85 @@ STATIC void process_write_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[] check_and_save_expected_rsp(conn_handle, BT_ATT_OP_WRITE_RSP, dlen, data); } -STATIC void process_prep_write_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { - struct __attribute__ ((packed)) PrepWriteReq { - uint16_t handle; - uint16_t offset; - } *prepWriteReq = (PrepWriteReq*)data; +STATIC void process_prepare_write_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { + //FIX struct bt_att_prepare_write_req *req = (struct bt_att_prepare_write_req *) data; - if (dlen < sizeof(PrepWriteReq)) { - send_error(conn_handle, BT_ATT_OP_PREP_WRITE_REQ, 0x0000, BT_ATT_ERR_INVALID_PDU); + if (dlen < sizeof(struct bt_att_prepare_write_req)) { + send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, 0x0000, BT_ATT_ERR_INVALID_PDU); return; } - uint16_t handle = prepWriteReq->handle; - uint16_t offset = prepWriteReq->offset; + // uint16_t handle = req->handle; + // uint16_t offset = req->offset; - if ((uint16_t)(handle - 1) > GATT.attributeCount()) { - send_error(conn_handle, BT_ATT_OP_PREP_WRITE_REQ, handle, BT_ATT_ERR_ATTR_NOT_FOUND); - return; - } + // if ((uint16_t)(handle - 1) > GATT.attributeCount()) { + // send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, handle, BT_ATT_ERR_ATTR_NOT_FOUND); + // return; + // } - BLELocalAttribute* attribute = GATT.attribute(handle - 1); + // BLELocalAttribute* attribute = GATT.attribute(handle - 1); - if (attribute->type() != BLE_TYPE_CHARACTERISTIC) { - send_error(conn_handle, BT_ATT_OP_PREP_WRITE_REQ, handle, BT_ATT_ERR_ATTR_NOT_LONG); - return; - } + // if (attribute->type() != BLE_TYPE_CHARACTERISTIC) { + // send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, handle, BT_ATT_ERR_ATTR_NOT_LONG); + // return; + // } - BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)attribute; + // BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)attribute; - if (handle != characteristic->value_handle()) { - send_error(conn_handle, BT_ATT_OP_PREP_WRITE_REQ, handle, BT_ATT_ERR_ATTR_NOT_LONG); - return; - } + // if (handle != characteristic->value_handle()) { + // send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, handle, BT_ATT_ERR_ATTR_NOT_LONG); + // return; + // } - if ((characteristic->properties() & BLEWrqite) == 0) { - send_error(conn_handle, BT_ATT_OP_PREP_WRITE_REQ, handle, BT_ATT_ERR_WRITE_NOT_PERM); - return; - } + // if ((characteristic->properties() & BLEWrqite) == 0) { + // send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, handle, BT_ATT_ERR_WRITE_NOT_PERM); + // return; + // } - if (long_write_handle == 0) { - int valueSize = characteristic->valueSize(); + // if (long_write_handle == 0) { + // int valueSize = characteristic->valueSize(); - long_write_value = (uint8_t*)realloc(long_write_value, valueSize); - long_write_value_length = 0; - long_write_handle = handle; + // long_write_value = (uint8_t*)realloc(long_write_value, valueSize); + // long_write_value_length = 0; + // long_write_handle = handle; - memset(long_write_value, 0x00, valueSize); - } else if (long_write_handle != handle) { - send_error(conn_handle, BT_ATT_OP_PREP_WRITE_REQ, handle, BT_ATT_ERR_UNLIKELY); - return; - } + // memset(long_write_value, 0x00, valueSize); + // } else if (long_write_handle != handle) { + // send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, handle, BT_ATT_ERR_UNLIKELY); + // return; + // } - uint8_t value_length = dlen - sizeof(PrepWriteReq); - uint8_t* value = &data[sizeof(PrepWriteReq)]; + // uint8_t value_length = dlen - sizeof(struct bt_att_prepare_write_req); + // uint8_t* value = &data[sizeof(struct bt_att_prepare_write_req)]; - if ((offset != long_write_value_length) || ((offset + value_length) > (uint16_t)characteristic->valueSize())) { - send_error(conn_handle, BT_ATT_OP_PREP_WRITE_REQ, handle, BT_ATT_ERR_INVALID_OFFSET); - return; - } + // if ((offset != long_write_value_length) || ((offset + value_length) > (uint16_t)characteristic->valueSize())) { + // send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, handle, BT_ATT_ERR_INVALID_OFFSET); + // return; + // } - memcpy(long_write_value + offset, value, value_length); - long_write_value_length += value_length; + // memcpy(long_write_value + offset, value, value_length); + // long_write_value_length += value_length; - uint8_t response[mtu]; - uint16_t response_length; + // uint8_t response[mtu]; + // uint16_t response_length; - response[0] = BT_ATT_OP_PREP_WRITE_RSP; - memcpy(&response[1], data, dlen); - response_length = dlen + 1; + // response[0] = BT_ATT_OP_PREP_WRITE_RSP; + // memcpy(&response[1], data, dlen); + // response_length = dlen + 1; - hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, response_length, response); + // hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, response_length, response); } STATIC void process_exec_write_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { - if (dlen != sizeof(uint8_t)) { + struct bt_att_exec_write_req *req = (struct bt_att_exec_write_req *) data; + + if (dlen != sizeof(struct bt_att_exec_write_req)) { send_error(conn_handle, BT_ATT_OP_EXEC_WRITE_REQ, 0x0000, BT_ATT_ERR_INVALID_PDU); return; } - uint8_t flag = data[0]; - - if (long_write_handle && (flag & 0x01)) { - BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)GATT.attribute(long_write_handle - 1); + if (long_write_handle && (req->flags & 0x01)) { + //FIX BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)GATT.attribute(long_write_handle - 1); for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { if (bleio_connections[i].conn_handle == conn_handle) { @@ -1423,107 +1425,123 @@ STATIC void process_exec_write_req(uint16_t conn_handle, uint16_t mtu, uint8_t d hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, response_length, response); } -STATIC void process_handle_notify_or_ind(uint16_t conn_handle, uint8_t opcode, uint8_t dlen, uint8_t data[]) { +STATIC void process_handle_notify_or_indicate(uint16_t conn_handle, uint8_t opcode, uint8_t dlen, uint8_t data[]) { if (dlen < 2) { return; // drop } - struct __attribute__ ((packed)) _handleNotifyOrInd { - uint16_t handle; - } *handleNotifyOrInd = (_handleNotifyOrInd*)data; + // struct bt_att_notify and bt_att_indicate are identical. + //FIXunused struct bt_att_notify *req = (struct bt_att_notify *) data; - uint8_t handle = handleNotifyOrInd->handle; + //FIXunused uint8_t handle = req->handle; for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { if (bleio_connections[i].conn_handle != conn_handle) { continue; } - BLERemoteDevice* device = bleio_connections[i].device; + //FIX BLERemoteDevice* device = bleio_connections[i].device; - if (!device) { - break; - } + // if (!device) { + // break; + // } - int serviceCount = device->serviceCount(); + // int serviceCount = device->serviceCount(); - for (size_t i = 0; i < serviceCount; i++) { - BLERemoteService* s = device->service(i); + // for (size_t i = 0; i < serviceCount; i++) { + // BLERemoteService* s = device->service(i); - if (s->start_handle() < handle && s->end_handle() >= handle) { - int characteristicCount = s->characteristicCount(); + // if (s->start_handle() < handle && s->end_handle() >= handle) { + // int characteristicCount = s->characteristicCount(); - for (int j = 0; j < characteristicCount; j++) { - BLERemoteCharacteristic* c = s->characteristic(j); + // for (int j = 0; j < characteristicCount; j++) { + // BLERemoteCharacteristic* c = s->characteristic(j); - if (c->value_handle() == handle) { - //FIX c->writeValue(BLEDevice(bleio_connections[i].address_type, bleio_connections[i].address), &data[2], dlen - 2); - } - } + // if (c->value_handle() == handle) { + // //FIX c->writeValue(BLEDevice(bleio_connections[i].address_type, bleio_connections[i].address), &data[2], dlen - 2); + // } + // } - break; - } - } + // break; + // } + // } } - if (opcode == BT_ATT_OP_HANDLE_IND) { - // send CNF for IND + if (opcode == BT_ATT_OP_INDICATE) { + // send CONFIRM for INDICATE - uint8_t cnf = BT_ATT_OP_HANDLE_CNF; + uint8_t op_confirm = BT_ATT_OP_CONFIRM; - hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, sizeof(cnf), &cnf); + hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, sizeof(op_confirm), &op_confirm); } } -STATIC void process_handle_cnf(uint16_t /*conn_handle*/, uint8_t /*dlen*/, uint8_t /*data*/[]) { - cnf = true; +STATIC void process_handle_confirm(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { + (void) conn_handle; + (void) dlen; + (void) data; + + confirm = true; } bool att_exchange_mtu(uint16_t conn_handle) { uint8_t response_buffer[max_mtu]; - struct bt_att_exchange_mtu_req req; - req->mtu = max_mtu; - return send_req_wait_for_rsp(conn_handle, BT_ATT_OP_MTU_REQ, &req, sizeof(req), response_buffer); + struct bt_att_exchange_mtu_req req = { + .mtu = max_mtu, + }; + return send_req_wait_for_rsp(conn_handle, sizeof(req), (uint8_t *) &req, response_buffer); } -void att_set_event_handler(BLEDeviceEvent event, BLEDeviceEventHandler event_handler) { - if (event < (sizeof(event_handlers) / (sizeof(event_handlers[0])))) { - event_handlers[event] = event_handler; - } -} +//FIX void att_set_event_handler(BLEDeviceEvent event, BLEDeviceEventHandler event_handler) { +// if (event < (sizeof(event_handlers) / (sizeof(event_handlers[0])))) { +// event_handlers[event] = event_handler; +// } +// } int att_read_req(uint16_t conn_handle, uint16_t handle, uint8_t response_buffer[]) { - struct __attribute__ ((packed)) { - uint8_t op; - uint16_t handle; - } read_req = { BT_ATT_OP_READ_REQ, handle }; + struct __packed { + struct bt_att_hdr h; + struct bt_att_read_req r; + } req = { { + .code = BT_ATT_OP_READ_REQ, + }, { + .handle = handle, + } + }; - return send_req_wait_for_rsp(conn_handle, &read_req, sizeof(read_req), response_buffer); + return send_req_wait_for_rsp(conn_handle, sizeof(req), (uint8_t *) &req, response_buffer); } int att_write_req(uint16_t conn_handle, uint16_t handle, const uint8_t* data, uint8_t data_len, uint8_t response_buffer[]) { - struct __attribute__ ((packed)) { - uint8_t op; - uint16_t handle; - uint8_t data[255]; - } write_req; + struct __packed { + struct bt_att_hdr h; + struct bt_att_write_req r; + } req = { { + .code = BT_ATT_OP_WRITE_REQ, + }, { + .handle = handle, + } + }; + memcpy(req.r.value, data, data_len); - write_req.opcode = BT_ATT_OP_WRITE_REQ; - write_req.handle = handle; - memcpy(write_req.data, data, data_len); - - return send_req_wait_for_rsp(conn_handle, &write_req, 3 + data_len, response_buffer); + return send_req_wait_for_rsp(conn_handle, sizeof(req) + data_len, (uint8_t *) &req, response_buffer); } void att_write_cmd(uint16_t conn_handle, uint16_t handle, const uint8_t* data, uint8_t data_len) { - struct bt_att_write_cmd req = { - .handle = handle, + struct __packed { + struct bt_att_hdr h; + struct bt_att_write_cmd r; + } req = { { + .code = BT_ATT_OP_WRITE_CMD, + }, { + .handle = handle, + } }; - memcpy(req.value, data, data_len); + memcpy(req.r.value, data, data_len); - send_req_wait_for_rsp(conn_handle, &req, data_len + sizeof(req), NULL); + return send_req(conn_handle, sizeof(req) + data_len, (uint8_t *) &req); } void att_process_data(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { @@ -1534,7 +1552,7 @@ void att_process_data(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { dlen--; data++; - uint16_t mtu = this->mtu(conn_handle); + uint16_t mtu = att_mtu(conn_handle); switch (opcode) { case BT_ATT_OP_ERROR_RSP: @@ -1557,24 +1575,24 @@ void att_process_data(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { process_find_info_rsp(conn_handle, dlen, data); break; - case BT_ATT_OP_FIND_BY_TYPE_REQ: + case BT_ATT_OP_FIND_TYPE_REQ: process_find_by_type_req(conn_handle, mtu, dlen, data); break; - case BT_ATT_OP_READ_BY_TYPE_REQ: + case BT_ATT_OP_READ_TYPE_REQ: process_read_by_type_req(conn_handle, mtu, dlen, data); break; - case BT_ATT_OP_READ_BY_TYPE_RSP: + case BT_ATT_OP_READ_TYPE_RSP: process_read_by_type_rsp(conn_handle, dlen, data); break; - case BT_ATT_OP_READ_BY_GROUP_REQ: - att_read_by_group_req(conn_handle, mtu, dlen, data); + case BT_ATT_OP_READ_GROUP_REQ: + process_read_by_group_req(conn_handle, mtu, dlen, data); break; - case BT_ATT_OP_READ_BY_GROUP_RSP: - prcoess_read_by_group_rsp(conn_handle, dlen, data); + case BT_ATT_OP_READ_GROUP_RSP: + process_read_by_group_rsp(conn_handle, dlen, data); break; case BT_ATT_OP_READ_REQ: @@ -1595,27 +1613,27 @@ void att_process_data(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { process_write_rsp(conn_handle, dlen, data); break; - case BT_ATT_OP_PREP_WRITE_REQ: - process_prep_write_req(conn_handle, mtu, dlen, data); + case BT_ATT_OP_PREPARE_WRITE_REQ: + process_prepare_write_req(conn_handle, mtu, dlen, data); break; case BT_ATT_OP_EXEC_WRITE_REQ: process_exec_write_req(conn_handle, mtu, dlen, data); break; - case BT_ATT_OP_HANDLE_NOTIFY: - case BT_ATT_OP_HANDLE_IND: - process_handle_notify_or_ind(conn_handle, opcode, dlen, data); + case BT_ATT_OP_NOTIFY: + case BT_ATT_OP_INDICATE: + process_handle_notify_or_indicate(conn_handle, opcode, dlen, data); break; - case BT_ATT_OP_HANDLE_CNF: - process_handle_cnf(conn_handle, dlen, data); + case BT_ATT_OP_CONFIRM: + process_handle_confirm(conn_handle, dlen, data); break; - case BT_ATT_OP_READ_MULTI_REQ: + case BT_ATT_OP_READ_MULT_REQ: case BT_ATT_OP_SIGNED_WRITE_CMD: default: - send_error(conn_handle, opcode, 0x00, BT_ATT_ERR_REQ_NOT_SUPP); + send_error(conn_handle, opcode, 0x00, BT_ATT_ERR_NOT_SUPPORTED); break; } } diff --git a/devices/ble_hci/common-hal/_bleio/att.h b/devices/ble_hci/common-hal/_bleio/att.h index 108c44929f..ee01e33f60 100644 --- a/devices/ble_hci/common-hal/_bleio/att.h +++ b/devices/ble_hci/common-hal/_bleio/att.h @@ -39,7 +39,7 @@ bool att_disconnect_all(void); bool att_disconnect_from_address(bt_addr_le_t *addr); bool att_discover_attributes(bt_addr_le_t *addr, const char* service_uuid_filter); bool att_exchange_mtu(uint16_t conn_handle); -bool att_handle_ind(uint16_t handle, const uint8_t* value, int length); +bool att_handle_indicate(uint16_t handle, const uint8_t* value, int length); bool att_handle_is_connected(uint16_t handle); bool att_handle_notify(uint16_t handle, const uint8_t* value, int length); bool att_is_connected(void); From 92216d64171a668772488f1ae1b88ddb2779d950 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 28 Jul 2020 11:14:25 -0700 Subject: [PATCH 0400/1293] Use samd peripherals fixed for gcc 10 --- ports/atmel-samd/peripherals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index e4161d7d6d..0f5f1522d0 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit e4161d7d6d98d78eddcccb82128856af4baf7e50 +Subproject commit 0f5f1522d09c8fa7d858edec484a994c21c59668 From 649e6d59ce19cabb9dd4527641653e1eccb4a788 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 28 Jul 2020 14:15:33 -0400 Subject: [PATCH 0401/1293] Merge from upstream and make translate --- frozen/Adafruit_CircuitPython_BusDevice | 2 +- locale/circuitpython.pot | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frozen/Adafruit_CircuitPython_BusDevice b/frozen/Adafruit_CircuitPython_BusDevice index eb4b21e216..e9411c4244 160000 --- a/frozen/Adafruit_CircuitPython_BusDevice +++ b/frozen/Adafruit_CircuitPython_BusDevice @@ -1 +1 @@ -Subproject commit eb4b21e216efd8ec0c4862a938e81b56be961724 +Subproject commit e9411c4244984b69ec6928370ede40cec014c10b diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 153f0edad2..c716d587b0 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 19:58-0700\n" +"POT-Creation-Date: 2020-07-28 14:15-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -861,6 +861,10 @@ msgstr "" msgid "I2C Init Error" msgstr "" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" From 5b675cc83f6d7892563a360d23dfed6c89f0f003 Mon Sep 17 00:00:00 2001 From: lady ada Date: Tue, 28 Jul 2020 14:19:43 -0400 Subject: [PATCH 0402/1293] fix windows' encoding defaults --- tools/gen_usb_descriptor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index adec33100e..36650d18da 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -62,8 +62,8 @@ parser.add_argument('--midi_ep_num_out', type=int, default=0, help='endpoint number of MIDI OUT') parser.add_argument('--midi_ep_num_in', type=int, default=0, help='endpoint number of MIDI IN') -parser.add_argument('--output_c_file', type=argparse.FileType('w'), required=True) -parser.add_argument('--output_h_file', type=argparse.FileType('w'), required=True) +parser.add_argument('--output_c_file', type=argparse.FileType('w', encoding='UTF-8'), required=True) +parser.add_argument('--output_h_file', type=argparse.FileType('w', encoding='UTF-8'), required=True) args = parser.parse_args() From 57464998c0c97010f6fc5ed1aea009ce6b010272 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 28 Jul 2020 14:23:01 -0400 Subject: [PATCH 0403/1293] add to build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 406f6c43ba..e9281fd16b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -154,6 +154,7 @@ jobs: - "bast_pro_mini_m0" - "bdmicro_vina_m0" - "bless_dev_board_multi_sensor" + - "blm_badge" - "capablerobot_usbhub" - "catwan_usbstick" - "circuitbrains_basic_m0" From 0619966c19bb9aeba7ec4fc19562878ca77e15ab Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 28 Jul 2020 14:28:09 -0400 Subject: [PATCH 0404/1293] wip --- devices/ble_hci/common-hal/_bleio/Service.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Service.c b/devices/ble_hci/common-hal/_bleio/Service.c index 07a9b4de25..938f687119 100644 --- a/devices/ble_hci/common-hal/_bleio/Service.c +++ b/devices/ble_hci/common-hal/_bleio/Service.c @@ -44,6 +44,7 @@ uint32_t _common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uu uint32_t status; self->handle = bleio_adapter_add_attribute( + common_hal_bleio_adapter_obj, is_secondary ? BLE_TYPE_SECONDARY_SERVICE : BLE_TYPE_PRIMARY_SERVICE, uuid, &status); return status; @@ -82,9 +83,10 @@ bool common_hal_bleio_service_get_is_secondary(bleio_service_obj_t *self) { void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, bleio_characteristic_obj_t *characteristic, mp_buffer_info_t *initial_value_bufinfo) { - common_hal_bleio_adapter_obj + //FIX how it's done by ArduinoBLE when a service is added. - // uint16_t startHandle = attributeCount(); + // uint16_t startHandle = attributeCount(); + uint16_t start_handle bleio_adapter_num_attributes(common_hal_bleio_adapter_obj); // for (unsigned int i = 0; i < service->characteristicCount(); i++) { // BLELocalCharacteristic* characteristic = service->characteristic(i); From efee11dffe3843ea3e8ce8650543caba5074e1cd Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 28 Jul 2020 11:42:58 -0700 Subject: [PATCH 0405/1293] Add black too --- docs/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/requirements.txt b/docs/requirements.txt index f2d0682eec..d98e2b30c3 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -4,3 +4,4 @@ sphinxcontrib-svg2pdfconverter==0.1.0 astroid sphinx-autoapi isort +black From fd7801415aae3342bbb0b0f6f88fe28a5e093afe Mon Sep 17 00:00:00 2001 From: Margaret Matocha Date: Mon, 27 Jul 2020 22:25:21 -0500 Subject: [PATCH 0406/1293] Deleted mpy-cross file --- shared-bindings/displayio/Group.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index dd7600eb9c..5c6f25dba8 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -215,9 +215,14 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_append_obj, displayio_group_obj_append //| STATIC mp_obj_t displayio_group_obj_insert(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t layer) { displayio_group_t *self = native_group(self_in); - size_t index = mp_get_index(&displayio_group_type, common_hal_displayio_group_get_len(self), index_obj, false); - common_hal_displayio_group_insert(self, index, layer); - return mp_const_none; + if ((size_t) MP_OBJ_SMALL_INT_VALUE(index_obj) == common_hal_displayio_group_get_len(self)){ + return displayio_group_obj_append(self_in, layer); + } + else { + size_t index = mp_get_index(&displayio_group_type, common_hal_displayio_group_get_len(self), index_obj, false); + common_hal_displayio_group_insert(self, index, layer); + return mp_const_none; + } } MP_DEFINE_CONST_FUN_OBJ_3(displayio_group_insert_obj, displayio_group_obj_insert); From 076c5f946f1239a593ae8a51d4d8648ef6620406 Mon Sep 17 00:00:00 2001 From: Margaret Matocha Date: Tue, 28 Jul 2020 14:53:50 -0500 Subject: [PATCH 0407/1293] Updated to remove unnecessary else statement --- shared-bindings/displayio/Group.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index 5c6f25dba8..f501453245 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -218,11 +218,11 @@ STATIC mp_obj_t displayio_group_obj_insert(mp_obj_t self_in, mp_obj_t index_obj, if ((size_t) MP_OBJ_SMALL_INT_VALUE(index_obj) == common_hal_displayio_group_get_len(self)){ return displayio_group_obj_append(self_in, layer); } - else { - size_t index = mp_get_index(&displayio_group_type, common_hal_displayio_group_get_len(self), index_obj, false); - common_hal_displayio_group_insert(self, index, layer); - return mp_const_none; - } + + size_t index = mp_get_index(&displayio_group_type, common_hal_displayio_group_get_len(self), index_obj, false); + common_hal_displayio_group_insert(self, index, layer); + return mp_const_none; + } MP_DEFINE_CONST_FUN_OBJ_3(displayio_group_insert_obj, displayio_group_obj_insert); From 65c22aa4347abc145493f44a4bc8d91a4f200860 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 28 Jul 2020 17:52:56 -0400 Subject: [PATCH 0408/1293] storage.erase_filesystem(): unmount and wait 1 second before resetting --- shared-module/storage/__init__.c | 3 +++ supervisor/shared/usb/usb.c | 4 ++++ supervisor/usb.h | 1 + 3 files changed, 8 insertions(+) diff --git a/shared-module/storage/__init__.c b/shared-module/storage/__init__.c index c3d4b50c8e..1ffd7d4cb8 100644 --- a/shared-module/storage/__init__.c +++ b/shared-module/storage/__init__.c @@ -30,6 +30,7 @@ #include "extmod/vfs.h" #include "py/mperrno.h" +#include "py/mphal.h" #include "py/obj.h" #include "py/runtime.h" #include "shared-bindings/microcontroller/__init__.h" @@ -159,6 +160,8 @@ void common_hal_storage_remount(const char *mount_path, bool readonly, bool disa } void common_hal_storage_erase_filesystem(void) { + usb_disconnect(); + mp_hal_delay_ms(1000); filesystem_init(false, true); // Force a re-format. common_hal_mcu_reset(); // We won't actually get here, since we're resetting. diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index edf8101188..3282bd22b9 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -73,6 +73,10 @@ void usb_init(void) { #endif } +void usb_disconnect(void) { + tud_disconnect(); +} + void usb_background(void) { if (usb_enabled()) { #if CFG_TUSB_OS == OPT_OS_NONE diff --git a/supervisor/usb.h b/supervisor/usb.h index 29280c725b..fb8d5b45f0 100644 --- a/supervisor/usb.h +++ b/supervisor/usb.h @@ -40,6 +40,7 @@ void init_usb_hardware(void); // Shared implementation. bool usb_enabled(void); void usb_init(void); +void usb_disconnect(void); // Propagate plug/unplug events to the MSC logic. void usb_msc_mount(void); From 9b8df7f6356aada4ce2cf89d24ea1cf635e9efe7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 22 Jul 2020 14:02:26 -0500 Subject: [PATCH 0409/1293] Upgrade ulab This version * moves source files to reflect module structure * adds inline documentation suitable for extract_pyi * incompatibly moves spectrogram to fft * incompatibly removes "extras" There are some remaining markup errors in the specific revision of extmod/ulab but they do not prevent the doc building process from completing. --- Makefile | 1 + extmod/ulab | 2 +- locale/circuitpython.pot | 126 ++++++++------- py/py.mk | 1 + shared-bindings/ulab/__init__.pyi | 169 -------------------- shared-bindings/ulab/approx/__init__.pyi | 51 ------ shared-bindings/ulab/compare/__init__.pyi | 38 ----- shared-bindings/ulab/extras/__init__.pyi | 10 -- shared-bindings/ulab/fft/__init__.pyi | 22 --- shared-bindings/ulab/filter/__init__.pyi | 36 ----- shared-bindings/ulab/linalg/__init__.pyi | 57 ------- shared-bindings/ulab/numerical/__init__.pyi | 57 ------- shared-bindings/ulab/poly/__init__.pyi | 10 -- shared-bindings/ulab/vector/__init__.pyi | 118 -------------- 14 files changed, 72 insertions(+), 626 deletions(-) delete mode 100644 shared-bindings/ulab/__init__.pyi delete mode 100644 shared-bindings/ulab/approx/__init__.pyi delete mode 100644 shared-bindings/ulab/compare/__init__.pyi delete mode 100644 shared-bindings/ulab/extras/__init__.pyi delete mode 100644 shared-bindings/ulab/fft/__init__.pyi delete mode 100644 shared-bindings/ulab/filter/__init__.pyi delete mode 100644 shared-bindings/ulab/linalg/__init__.pyi delete mode 100644 shared-bindings/ulab/numerical/__init__.pyi delete mode 100644 shared-bindings/ulab/poly/__init__.pyi delete mode 100644 shared-bindings/ulab/vector/__init__.pyi diff --git a/Makefile b/Makefile index 74d3d88c77..1a3cca95d6 100644 --- a/Makefile +++ b/Makefile @@ -241,6 +241,7 @@ check-translate: stubs: @mkdir -p circuitpython-stubs @$(PYTHON) tools/extract_pyi.py shared-bindings/ $(STUBDIR) + @$(PYTHON) tools/extract_pyi.py extmod/ulab/code/ $(STUBDIR)/ulab @$(PYTHON) tools/extract_pyi.py ports/atmel-samd/bindings $(STUBDIR) @$(PYTHON) setup.py -q sdist diff --git a/extmod/ulab b/extmod/ulab index 48cb939839..11a7ecff6d 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 48cb939839fcf091fcdcdf742530b1b650066a15 +Subproject commit 11a7ecff6d76a02644ff23a734b792afaa615e44 diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 153f0edad2..10907842cc 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 19:58-0700\n" +"POT-Creation-Date: 2020-07-28 16:57-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -770,7 +770,7 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "" @@ -1786,7 +1786,7 @@ msgstr "" msgid "addresses is empty" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "" @@ -1794,7 +1794,7 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "" @@ -1802,6 +1802,10 @@ msgstr "" msgid "argument has wrong type" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1811,7 +1815,7 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "" @@ -1819,7 +1823,7 @@ msgstr "" msgid "array/bytes required on right side" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -1827,15 +1831,15 @@ msgstr "" msgid "attributes not supported yet" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "" @@ -2141,15 +2145,15 @@ msgstr "" msgid "conversion to object" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "" @@ -2157,7 +2161,7 @@ msgstr "" msgid "could not broadast input array from shape" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2165,15 +2169,15 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2202,7 +2206,7 @@ msgstr "" msgid "dict update sequence has wrong length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "" @@ -2305,11 +2309,11 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "" @@ -2317,7 +2321,7 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "" @@ -2329,7 +2333,7 @@ msgstr "" msgid "flattening order must be either 'C', or 'F'" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "" @@ -2362,11 +2366,11 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2452,7 +2456,7 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "" @@ -2460,35 +2464,35 @@ msgstr "" msgid "inline assembler must be a function" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "" @@ -2500,7 +2504,7 @@ msgstr "" msgid "integer required" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "" @@ -2570,7 +2574,7 @@ msgstr "" msgid "iterables are not of the same length" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "" @@ -2634,11 +2638,11 @@ msgstr "" msgid "math domain error" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "" @@ -2665,7 +2669,7 @@ msgstr "" msgid "module not found" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "" @@ -2689,7 +2693,7 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "" @@ -2787,11 +2791,11 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -2862,12 +2866,12 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -2959,7 +2963,7 @@ msgstr "" msgid "raw f-strings are not implemented" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" @@ -3032,7 +3036,7 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "" @@ -3056,19 +3060,19 @@ msgstr "" msgid "soft reboot\n" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3182,7 +3186,11 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -3310,6 +3318,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" @@ -3318,7 +3330,7 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "" @@ -3326,11 +3338,11 @@ msgstr "" msgid "wrong index type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3342,7 +3354,7 @@ msgstr "" msgid "wrong operand type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "" @@ -3362,14 +3374,14 @@ msgstr "" msgid "zero step" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" diff --git a/py/py.mk b/py/py.mk index 3e1d7989f9..c5073d0f02 100644 --- a/py/py.mk +++ b/py/py.mk @@ -107,6 +107,7 @@ endif ifeq ($(CIRCUITPY_ULAB),1) SRC_MOD += $(patsubst $(TOP)/%,%,$(wildcard $(TOP)/extmod/ulab/code/*.c)) +SRC_MOD += $(patsubst $(TOP)/%,%,$(wildcard $(TOP)/extmod/ulab/code/*/*.c)) CFLAGS_MOD += -DCIRCUITPY_ULAB=1 -DMODULE_ULAB_ENABLED=1 $(BUILD)/extmod/ulab/code/%.o: CFLAGS += -Wno-float-equal -Wno-sign-compare -DCIRCUITPY endif diff --git a/shared-bindings/ulab/__init__.pyi b/shared-bindings/ulab/__init__.pyi deleted file mode 100644 index 03bfe36108..0000000000 --- a/shared-bindings/ulab/__init__.pyi +++ /dev/null @@ -1,169 +0,0 @@ -"""Manipulate numeric data similar to numpy - -`ulab` is a numpy-like module for micropython, meant to simplify and -speed up common mathematical operations on arrays. The primary goal was to -implement a small subset of numpy that might be useful in the context of a -microcontroller. This means low-level data processing of linear (array) and -two-dimensional (matrix) data. - -`ulab` is adapted from micropython-ulab, and the original project's -documentation can be found at -https://micropython-ulab.readthedocs.io/en/latest/ - -`ulab` is modeled after numpy, and aims to be a compatible subset where -possible. Numpy's documentation can be found at -https://docs.scipy.org/doc/numpy/index.html""" - - -class array: - """1- and 2- dimensional array""" - def __init__(self, values, *, dtype=float) -> None: - """:param sequence values: Sequence giving the initial content of the array. - :param dtype: The type of array values, ``int8``, ``uint8``, ``int16``, ``uint16``, or ``float`` - - The `values` sequence can either be another ~ulab.array, sequence of numbers - (in which case a 1-dimensional array is created), or a sequence where each - subsequence has the same length (in which case a 2-dimensional array is - created). - - Passing a ~ulab.array and a different dtype can be used to convert an array - from one dtype to another. - - In many cases, it is more convenient to create an array from a function - like `zeros` or `linspace`. - - `ulab.array` implements the buffer protocol, so it can be used in many - places an `array.array` can be used.""" - ... - - shape: tuple = ... - """The size of the array, a tuple of length 1 or 2""" - - size: int = ... - """The number of elements in the array""" - - itemsize: int = ... - """The number of elements in the array""" - - def flatten(self, *, order='C'): - """:param order: Whether to flatten by rows ('C') or columns ('F') - - Returns a new `ulab.array` object which is always 1 dimensional. - If order is 'C' (the default", then the data is ordered in rows; - If it is 'F', then the data is ordered in columns. "C" and "F" refer - to the typical storage organization of the C and Fortran languages.""" - ... - - def sort(self, *, axis=1): - """:param axis: Whether to sort elements within rows (0), columns (1), or elements (None)""" - ... - - def transpose(self): - """Swap the rows and columns of a 2-dimensional array""" - ... - - def __add__(self): - """Adds corresponding elements of the two arrays, or adds a number to all - elements of the array. If both arguments are arrays, their sizes must match.""" - ... - - def __sub__(self): - """Subtracts corresponding elements of the two arrays, or adds a number to all - elements of the array. If both arguments are arrays, their sizes must match.""" - ... - - def __mul__(self): - """Multiplies corresponding elements of the two arrays, or multiplies - all elements of the array by a number. If both arguments are arrays, - their sizes must match.""" - ... - - def __div__(self): - """Multiplies corresponding elements of the two arrays, or divides - all elements of the array by a number. If both arguments are arrays, - their sizes must match.""" - ... - - def __pow__(): - """Computes the power (x**y) of corresponding elements of the the two arrays, - or one number and one array. If both arguments are arrays, their sizes - must match.""" - ... - - def __getitem__(): - """Retrieve an element of the array.""" - ... - - def __setitem__(): - """Set an element of the array.""" - ... - -int8 = ... -"""Type code for signed integers in the range -128 .. 127 inclusive, like the 'b' typecode of `array.array`""" - -int16 = ... -"""Type code for signed integers in the range -32768 .. 32767 inclusive, like the 'h' typecode of `array.array`""" - -float = ... -"""Type code for floating point values, like the 'f' typecode of `array.array`""" - -uint8 = ... -"""Type code for unsigned integers in the range 0 .. 255 inclusive, like the 'H' typecode of `array.array`""" - -uint16 = ... -"""Type code for unsigned integers in the range 0 .. 65535 inclusive, like the 'h' typecode of `array.array`""" - -def ones(shape, *, dtype=float): - """ - .. param: shape - Shape of the array, either an integer (for a 1-D array) or a tuple of 2 integers (for a 2-D array) - - .. param: dtype - Type of values in the array - - Return a new array of the given shape with all elements set to 1.""" - ... - -def zeros(shape, *, dtype): - """ - .. param: shape - Shape of the array, either an integer (for a 1-D array) or a tuple of 2 integers (for a 2-D array) - - .. param: dtype - Type of values in the array - - Return a new array of the given shape with all elements set to 0.""" - ... - - -def eye(size, *, dtype=float): - """Return a new square array of size, with the diagonal elements set to 1 - and the other elements set to 0.""" - ... - -def linspace(start, stop, *, dtype=float, num=50, endpoint=True): - """ - .. param: start - - First value in the array - - .. param: stop - - Final value in the array - - .. param int: num - - Count of values in the array - - .. param: dtype - - Type of values in the array - - .. param bool: endpoint - - Whether the ``stop`` value is included. Note that even when - endpoint=True, the exact ``stop`` value may not be included due to the - inaccuracy of floating point arithmetic. - - Return a new 1-D array with ``num`` elements ranging from ``start`` to ``stop`` linearly.""" - ... diff --git a/shared-bindings/ulab/approx/__init__.pyi b/shared-bindings/ulab/approx/__init__.pyi deleted file mode 100644 index 7e012690f3..0000000000 --- a/shared-bindings/ulab/approx/__init__.pyi +++ /dev/null @@ -1,51 +0,0 @@ -"""Numerical approximation methods""" - -def bisect(fun, a, b, *, xtol=2.4e-7, maxiter=100) -> float: - """ - :param callable f: The function to bisect - :param float a: The left side of the interval - :param float b: The right side of the interval - :param float xtol: The tolerance value - :param float maxiter: The maximum number of iterations to perform - - Find a solution (zero) of the function ``f(x)`` on the interval - (``a``..``b``) using the bisection method. The result is accurate to within - ``xtol`` unless more than ``maxiter`` steps are required.""" - ... - -def newton(fun, x0, *, xtol=2.4e-7, rtol=0.0, maxiter=50) -> float: - """ - :param callable f: The function to bisect - :param float x0: The initial x value - :param float xtol: The absolute tolerance value - :param float rtol: The relative tolerance value - :param float maxiter: The maximum number of iterations to perform - - Find a solution (zero) of the function ``f(x)`` using Newton's Method. - The result is accurate to within ``xtol * rtol * |f(x)|`` unless more than - ``maxiter`` steps are requried.""" - ... - -def fmin(fun, x0, *, xatol=2.4e-7, fatol=2.4e-7, maxiter=200) -> float: - """ - :param callable f: The function to bisect - :param float x0: The initial x value - :param float xatol: The absolute tolerance value - :param float fatol: The relative tolerance value - - Find a minimum of the function ``f(x)`` using the downhill simplex method. - The located ``x`` is within ``fxtol`` of the actual minimum, and ``f(x)`` - is within ``fatol`` of the actual minimum unless more than ``maxiter`` - steps are requried.""" - ... - -def interp(x: ulab.array, xp:ulab.array, fp:ulab.array, *, left=None, right=None) -> ulab.array: - """ - :param ulab.array x: The x-coordinates at which to evaluate the interpolated values. - :param ulab.array xp: The x-coordinates of the data points, must be increasing - :param ulab.array fp: The y-coordinates of the data points, same length as xp - :param left: Value to return for ``x < xp[0]``, default is ``fp[0]``. - :param right: Value to return for ``x > xp[-1]``, default is ``fp[-1]``. - - Returns the one-dimensional piecewise linear interpolant to a function with given discrete data points (xp, fp), evaluated at x.""" - ... diff --git a/shared-bindings/ulab/compare/__init__.pyi b/shared-bindings/ulab/compare/__init__.pyi deleted file mode 100644 index 1606e43c20..0000000000 --- a/shared-bindings/ulab/compare/__init__.pyi +++ /dev/null @@ -1,38 +0,0 @@ -"""Comparison functions""" - -def clip(x1, x2, x3): - """ - Constrain the values from ``x1`` to be between ``x2`` and ``x3``. - ``x2`` is assumed to be less than or equal to ``x3``. - - Arguments may be ulab arrays or numbers. All array arguments - must be the same size. If the inputs are all scalars, a 1-element - array is returned. - - Shorthand for ``ulab.maximum(x2, ulab.minimum(x1, x3))``""" - ... - -def maximum(x1, x2): - """ - Compute the element by element maximum of the arguments. - - Arguments may be ulab arrays or numbers. All array arguments - must be the same size. If the inputs are both scalars, a number is - returned""" - ... - -def minimum(x1, x2): - """Compute the element by element minimum of the arguments. - - Arguments may be ulab arrays or numbers. All array arguments - must be the same size. If the inputs are both scalars, a number is - returned""" - ... - -def equal(x1, x2): - """Return an array of bool which is true where x1[i] == x2[i] and false elsewhere""" - ... - -def not_equal(x1, x2): - """Return an array of bool which is false where x1[i] == x2[i] and true elsewhere""" - ... diff --git a/shared-bindings/ulab/extras/__init__.pyi b/shared-bindings/ulab/extras/__init__.pyi deleted file mode 100644 index 4da56a5822..0000000000 --- a/shared-bindings/ulab/extras/__init__.pyi +++ /dev/null @@ -1,10 +0,0 @@ -"""Additional functions not in numpy""" - -def spectrum(r): - """ - :param ulab.array r: A 1-dimension array of values whose size is a power of 2 - - Computes the spectrum of the input signal. This is the absolute value of the (complex-valued) fft of the signal. - - This function is similar to scipy's ``scipy.signal.spectrogram``.""" - ... diff --git a/shared-bindings/ulab/fft/__init__.pyi b/shared-bindings/ulab/fft/__init__.pyi deleted file mode 100644 index 401ecb6445..0000000000 --- a/shared-bindings/ulab/fft/__init__.pyi +++ /dev/null @@ -1,22 +0,0 @@ -"""Frequency-domain functions""" - -def fft(r, c=None): - """ - :param ulab.array r: A 1-dimension array of values whose size is a power of 2 - :param ulab.array c: An optional 1-dimension array of values whose size is a power of 2, giving the complex part of the value - :return tuple (r, c): The real and complex parts of the FFT - - Perform a Fast Fourier Transform from the time domain into the frequency domain - - See also ~ulab.extras.spectrum, which computes the magnitude of the fft, - rather than separately returning its real and imaginary parts.""" - ... - -def ifft(r, c=None): - """ - :param ulab.array r: A 1-dimension array of values whose size is a power of 2 - :param ulab.array c: An optional 1-dimension array of values whose size is a power of 2, giving the complex part of the value - :return tuple (r, c): The real and complex parts of the inverse FFT - - Perform an Inverse Fast Fourier Transform from the frequeny domain into the time domain""" - ... diff --git a/shared-bindings/ulab/filter/__init__.pyi b/shared-bindings/ulab/filter/__init__.pyi deleted file mode 100644 index 5e7202e06c..0000000000 --- a/shared-bindings/ulab/filter/__init__.pyi +++ /dev/null @@ -1,36 +0,0 @@ -"""Filtering functions""" - -def convolve(r, c=None): - """ - :param ulab.array a: - :param ulab.array v: - - Returns the discrete, linear convolution of two one-dimensional sequences. - The result is always an array of float. Only the ``full`` mode is supported, - and the ``mode`` named parameter of numpy is not accepted. Note that all other - modes can be had by slicing a ``full`` result. - - Convolution filters can implement high pass, low pass, band pass, etc., - filtering operations. Convolution filters are typically constructed ahead - of time. This can be done using desktop python with scipy, or on web pages - such as https://fiiir.com/ - - Convolution is most time-efficient when both inputs are of float type.""" - ... - -def sosfilt(sos : ulab.array, x : ulab.array, *, xi : Optional[ulab.array] = None) -> Union[ulab.array, Tuple[ulab.array, ulab.array]]: - """ - :param ulab.array sos: Array of second-order filter coefficients, must have shape (n_sections, 6). Each row corresponds to a second-order section, with the first three columns providing the numerator coefficients and the last three providing the denominator coefficients. - :param ulab.array x: The data to be filtered - :param ulab.array zi: Optional initial conditions for the filter - - :return: If ``xi`` is not specified, the filter result alone is returned. If ``xi`` is specified, the return value is a 2-tuple of the filter result and the final filter conditions. - - Filter data along one dimension using cascaded second-order sections. - - Filter a data sequence, x, using a digital IIR filter defined by sos. - - The filter function is implemented as a series of second-order filters with direct-form II transposed structure. It is designed to minimize numerical precision errors for high-order filters. - - Filter coefficients can be generated by using scipy's filter generators such as ``signal.ellip(..., output='sos')``.""" - ... diff --git a/shared-bindings/ulab/linalg/__init__.pyi b/shared-bindings/ulab/linalg/__init__.pyi deleted file mode 100644 index d16e61807b..0000000000 --- a/shared-bindings/ulab/linalg/__init__.pyi +++ /dev/null @@ -1,57 +0,0 @@ -"""Linear algebra functions""" - - -def cholesky(A): - """ - :param ~ulab.array A: a positive definite, symmetric square matrix - :return ~ulab.array L: a square root matrix in the lower triangular form - :raises ValueError: If the input does not fulfill the necessary conditions - - The returned matrix satisfies the equation m=LL*""" - ... - -def det(): - """ - :param: m, a square matrix - :return float: The determinant of the matrix - - Computes the eigenvalues and eigenvectors of a square matrix""" - ... - -def dot(m1, m2): - """ - :param ~ulab.array m1: a matrix - :param ~ulab.array m2: a matrix - - Computes the matrix product of two matrices - - **WARNING:** Unlike ``numpy``, this function cannot be used to compute the dot product of two vectors""" - ... - -def eig(m): - """ - :param m: a square matrix - :return tuple (eigenvectors, eigenvalues): - - Computes the eigenvalues and eigenvectors of a square matrix""" - ... - -def inv(m): - """ - :param ~ulab.array m: a square matrix - :return: The inverse of the matrix, if it exists - :raises ValueError: if the matrix is not invertible - - Computes the inverse of a square matrix""" - ... - -def size(array): - """Return the total number of elements in the array, as an integer.""" - ... - -def trace(m): - """ - :param m: a square matrix - - Compute the trace of the matrix, the sum of its diagonal elements.""" - ... diff --git a/shared-bindings/ulab/numerical/__init__.pyi b/shared-bindings/ulab/numerical/__init__.pyi deleted file mode 100644 index 7596789218..0000000000 --- a/shared-bindings/ulab/numerical/__init__.pyi +++ /dev/null @@ -1,57 +0,0 @@ -"""Numerical and Statistical functions - -Most of these functions take an "axis" argument, which indicates whether to -operate over the flattened array (None), rows (0), or columns (1).""" - -def argmax(array, *, axis=None): - """Return the index of the maximum element of the 1D array""" - ... - -def argmin(array, *, axis=None): - """Return the index of the minimum element of the 1D array""" - ... - -def argsort(array, *, axis=None): - """Returns an array which gives indices into the input array from least to greatest.""" - ... - -def diff(array, *, axis=1): - """Return the numerical derivative of successive elements of the array, as - an array. axis=None is not supported.""" - ... - -def flip(array, *, axis=None): - """Returns a new array that reverses the order of the elements along the - given axis, or along all axes if axis is None.""" - ... - -def max(array, *, axis=None): - """Return the maximum element of the 1D array""" - ... - -def mean(array, *, axis=None): - """Return the mean element of the 1D array, as a number if axis is None, otherwise as an array.""" - ... - -def min(array, *, axis=None): - """Return the minimum element of the 1D array""" - ... - -def roll(array, distance, *, axis=None): - """Shift the content of a vector by the positions given as the second - argument. If the ``axis`` keyword is supplied, the shift is applied to - the given axis. The array is modified in place.""" - ... - -def std(array, *, axis=None): - """Return the standard deviation of the array, as a number if axis is None, otherwise as an array.""" - ... - -def sum(array, *, axis=None): - """Return the sum of the array, as a number if axis is None, otherwise as an array.""" - ... - -def sort(array, *, axis=0): - """Sort the array along the given axis, or along all axes if axis is None. - The array is modified in place.""" - ... diff --git a/shared-bindings/ulab/poly/__init__.pyi b/shared-bindings/ulab/poly/__init__.pyi deleted file mode 100644 index d051bbded4..0000000000 --- a/shared-bindings/ulab/poly/__init__.pyi +++ /dev/null @@ -1,10 +0,0 @@ -"""Polynomial functions""" - -def polyfit(x, y, degree): - """Return a polynomial of given degree that approximates the function - f(x)=y. If x is not supplied, it is the range(len(y)).""" - ... - -def polyval(p, x): - """Evaluate the polynomial p at the points x. x must be an array.""" - ... diff --git a/shared-bindings/ulab/vector/__init__.pyi b/shared-bindings/ulab/vector/__init__.pyi deleted file mode 100644 index bf57e419cd..0000000000 --- a/shared-bindings/ulab/vector/__init__.pyi +++ /dev/null @@ -1,118 +0,0 @@ -"""Element-by-element functions - -These functions can operate on numbers, 1-D arrays, or 2-D arrays by -applying the function to every element in the array. This is typically -much more efficient than expressing the same operation as a Python loop.""" - -def acos(): - """Computes the inverse cosine function""" - ... - -def acosh(): - """Computes the inverse hyperbolic cosine function""" - ... - -def asin(): - """Computes the inverse sine function""" - ... - -def asinh(): - """Computes the inverse hyperbolic sine function""" - ... - -def around(a, *, decimals): - """Returns a new float array in which each element is rounded to - ``decimals`` places.""" - ... - -def atan(): - """Computes the inverse tangent function; the return values are in the - range [-pi/2,pi/2].""" - ... - -def atan2(y,x): - """Computes the inverse tangent function of y/x; the return values are in - the range [-pi, pi].""" - ... - -def atanh(): - """Computes the inverse hyperbolic tangent function""" - ... - -def ceil(): - """Rounds numbers up to the next whole number""" - ... - -def cos(): - """Computes the cosine function""" - ... - -def erf(): - """Computes the error function, which has applications in statistics""" - ... - -def erfc(): - """Computes the complementary error function, which has applications in statistics""" - ... - -def exp(): - """Computes the exponent function.""" - ... - -def expm1(): - """Computes $e^x-1$. In certain applications, using this function preserves numeric accuracy better than the `exp` function.""" - ... - -def floor(): - """Rounds numbers up to the next whole number""" - ... - -def gamma(): - """Computes the gamma function""" - ... - -def lgamma(): - """Computes the natural log of the gamma function""" - ... - -def log(): - """Computes the natural log""" - ... - -def log10(): - """Computes the log base 10""" - ... - -def log2(): - """Computes the log base 2""" - ... - -def sin(): - """Computes the sine""" - ... - -def sinh(): - """Computes the hyperbolic sine""" - ... - -def sqrt(): - """Computes the square root""" - ... - -def tan(): - """Computes the tangent""" - ... - -def tanh(): - """Computes the hyperbolic tangent""" - ... - -def vectorize(f, *, otypes=None): - """ - :param callable f: The function to wrap - :param otypes: List of array types that may be returned by the function. None is intepreted to mean the return value is float. - - Wrap a Python function ``f`` so that it can be applied to arrays. - - The callable must return only values of the types specified by otypes, or the result is undefined.""" - ... From e6bd99a5ee1e2ada3ad99e1de429c13e1b9d47cf Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 28 Jul 2020 18:18:41 -0400 Subject: [PATCH 0410/1293] wip --- devices/ble_hci/common-hal/_bleio/Adapter.h | 2 -- devices/ble_hci/common-hal/_bleio/Attribute.c | 4 ++++ devices/ble_hci/common-hal/_bleio/Service.c | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.h b/devices/ble_hci/common-hal/_bleio/Adapter.h index d2f38b757c..9ff122d26a 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.h +++ b/devices/ble_hci/common-hal/_bleio/Adapter.h @@ -43,8 +43,6 @@ extern bleio_connection_internal_t bleio_connections[BLEIO_TOTAL_CONNECTION_COUNT]; - - typedef struct _bleio_adapter_obj_t { mp_obj_base_t base; bleio_scanresults_obj_t *scan_results; diff --git a/devices/ble_hci/common-hal/_bleio/Attribute.c b/devices/ble_hci/common-hal/_bleio/Attribute.c index 30a0ebcf05..d9041da717 100644 --- a/devices/ble_hci/common-hal/_bleio/Attribute.c +++ b/devices/ble_hci/common-hal/_bleio/Attribute.c @@ -26,6 +26,10 @@ #include "shared-bindings/_bleio/Attribute.h" +// Return the type of the attribute +bleio_attribute_type_uuid(mp_obj_t *attribute) { + if mp_is_o + // Convert a _bleio security mode to a ble_gap_conn_sec_mode_t setting. // void bleio_attribute_gatts_set_security_mode(ble_gap_conn_sec_mode_t *perm, bleio_attribute_security_mode_t security_mode) { // switch (security_mode) { diff --git a/devices/ble_hci/common-hal/_bleio/Service.c b/devices/ble_hci/common-hal/_bleio/Service.c index 938f687119..ef2de6ee7d 100644 --- a/devices/ble_hci/common-hal/_bleio/Service.c +++ b/devices/ble_hci/common-hal/_bleio/Service.c @@ -42,7 +42,6 @@ uint32_t _common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uu vm_used_ble = true; - uint32_t status; self->handle = bleio_adapter_add_attribute( common_hal_bleio_adapter_obj, is_secondary ? BLE_TYPE_SECONDARY_SERVICE : BLE_TYPE_PRIMARY_SERVICE, From 715ea1327392f998d17641a702af21249e054561 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 28 Jul 2020 18:17:05 -0400 Subject: [PATCH 0411/1293] Upload mpy-cross builds to S3 --- .github/workflows/build.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 406f6c43ba..0a17dacf94 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -105,6 +105,18 @@ jobs: name: mpy-cross.static-x64-windows path: mpy-cross/mpy-cross.static.exe + - name: Upload mpy-cross builds to S3 + run: | + "[ -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-mingw s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-mingw-${{ 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" + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) + + mpy-cross-mac: runs-on: macos-10.15 steps: @@ -127,13 +139,22 @@ jobs: fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - name: CircuitPython version - run: git describe --dirty --tags + run: | + git describe --dirty --tags + echo "::set-env name=CP_VERSION::$(git describe --dirty --tags)" - name: Build mpy-cross run: make -C mpy-cross -j2 - uses: actions/upload-artifact@v1.0.0 with: name: mpy-cross-macos-catalina path: mpy-cross/mpy-cross + - name: Upload mpy-cross build to S3 + run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp mpy-cross/mpy-cross s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross-macos-catalina-${{ env.CP_VERSION }} --no-progress --region us-east-1" + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) + build-arm: runs-on: ubuntu-18.04 From 4c2d0c3dc5635a13e7151efe01b6634c0e375af5 Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Tue, 28 Jul 2020 22:58:28 -0700 Subject: [PATCH 0412/1293] use top-left heuristic for vectorio.Polygon this flips the bottom-right style to top-left which is at least kind of normal. A 2x2 square at (0,0) would be defined like (0,0), (3,0), (3,3), (0,3) Which seems kind of surprising but at least less bonkers than that square being defined at (1,1), which is the current behavior. --- shared-module/vectorio/Polygon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-module/vectorio/Polygon.c b/shared-module/vectorio/Polygon.c index c44c13fd73..e00a4696b2 100644 --- a/shared-module/vectorio/Polygon.c +++ b/shared-module/vectorio/Polygon.c @@ -143,13 +143,13 @@ uint32_t common_hal_vectorio_polygon_get_pixel(void *obj, int16_t x, int16_t y) int y2 = self->points_list[i % self->len]; VECTORIO_POLYGON_DEBUG(" (%3d, %3d)}\n", x2, y2); if ( y1 <= y ) { - if ( y2 > y && line_side(x1, y1, x2, y2, x, y) > 0 ) { - // Wind up, point is to the right of the edge vector + if ( y2 > y && line_side(x1, y1, x2, y2, x, y) < 0 ) { + // Wind up, point is to the left of the edge vector ++winding_number; VECTORIO_POLYGON_DEBUG(" wind:%2d winding_number:%2d\n", 1, winding_number); } - } else if ( y2 <= y && line_side(x1, y1, x2, y2, x, y) < 0 ) { - // Wind down, point is to the left of the edge vector + } else if ( y2 <= y && line_side(x1, y1, x2, y2, x, y) > 0 ) { + // Wind down, point is to the right of the edge vector --winding_number; VECTORIO_POLYGON_DEBUG(" wind:%2d winding_number:%2d\n", -1, winding_number); } From 60638282799675272d2d25ed938edb30250bc578 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 29 Jul 2020 15:38:55 +0700 Subject: [PATCH 0413/1293] replace USB_MSC_MAX_PACKET_SIZE with USB_HIGHSPEED in descriptor gen tool --- ports/cxd56/mpconfigport.mk | 2 +- ports/mimxrt10xx/mpconfigport.mk | 2 +- supervisor/supervisor.mk | 9 ++++++--- tools/gen_usb_descriptor.py | 16 ++++++++++------ 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index eb077c07bd..914e0b37d5 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -1,5 +1,5 @@ USB_SERIAL_NUMBER_LENGTH = 10 -USB_MSC_MAX_PACKET_SIZE = 512 +USB_HIGHSPEED = 1 USB_RENUMBER_ENDPOINTS = 0 USB_CDC_EP_NUM_NOTIFICATION = 3 USB_CDC_EP_NUM_DATA_OUT = 2 diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index 12f34343b9..b4cc9586ac 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -15,7 +15,7 @@ endif INTERNAL_LIBM = 1 USB_SERIAL_NUMBER_LENGTH = 32 -USB_MSC_MAX_PACKET_SIZE = 512 +USB_HIGHSPEED = 1 INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 1885366865..a066fc0fd4 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -129,8 +129,8 @@ ifndef USB_HID_DEVICES USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD" endif -ifndef USB_MSC_MAX_PACKET_SIZE -USB_MSC_MAX_PACKET_SIZE = 64 +ifndef USB_HIGHSPEED +USB_HIGHSPEED = 0 endif ifndef USB_CDC_EP_NUM_NOTIFICATION @@ -178,7 +178,6 @@ USB_DESCRIPTOR_ARGS = \ --interface_name $(USB_INTERFACE_NAME)\ --devices $(USB_DEVICES)\ --hid_devices $(USB_HID_DEVICES)\ - --msc_max_packet_size $(USB_MSC_MAX_PACKET_SIZE)\ --cdc_ep_num_notification $(USB_CDC_EP_NUM_NOTIFICATION)\ --cdc_ep_num_data_out $(USB_CDC_EP_NUM_DATA_OUT)\ --cdc_ep_num_data_in $(USB_CDC_EP_NUM_DATA_IN)\ @@ -195,6 +194,10 @@ ifeq ($(USB_RENUMBER_ENDPOINTS), 0) USB_DESCRIPTOR_ARGS += --no-renumber_endpoints endif +ifeq ($(USB_HIGHSPEED), 1) +USB_DESCRIPTOR_ARGS += --highspeed +endif + $(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h $(BUILD)/autogen_usb_descriptor.c $(BUILD)/genhdr/autogen_usb_descriptor.h: autogen_usb_descriptor.intermediate diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index adec33100e..af4e9e329f 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -23,6 +23,8 @@ ALL_HID_DEVICES_SET=frozenset(ALL_HID_DEVICES.split(',')) DEFAULT_HID_DEVICES='KEYBOARD,MOUSE,CONSUMER,GAMEPAD' parser = argparse.ArgumentParser(description='Generate USB descriptors.') +parser.add_argument('--highspeed', default=False, action='store_true', + help='descriptor for highspeed device') parser.add_argument('--manufacturer', type=str, help='manufacturer of the device') parser.add_argument('--product', type=str, @@ -40,8 +42,6 @@ parser.add_argument('--hid_devices', type=lambda l: tuple(l.split(',')), default parser.add_argument('--interface_name', type=str, help='The name/prefix to use in the interface descriptions', default=DEFAULT_INTERFACE_NAME) -parser.add_argument('--msc_max_packet_size', type=int, default=64, - help='Max packet size for MSC') parser.add_argument('--no-renumber_endpoints', dest='renumber_endpoints', action='store_false', help='use to not renumber endpoint') parser.add_argument('--cdc_ep_num_notification', type=int, default=0, @@ -185,11 +185,15 @@ cdc_data_interface = standard.InterfaceDescriptor( standard.EndpointDescriptor( description="CDC data out", bEndpointAddress=args.cdc_ep_num_data_out | standard.EndpointDescriptor.DIRECTION_OUT, - bmAttributes=standard.EndpointDescriptor.TYPE_BULK), + bmAttributes=standard.EndpointDescriptor.TYPE_BULK, + bInterval=0, + wMaxPacketSize=512 if args.highspeed else 64), standard.EndpointDescriptor( description="CDC data in", bEndpointAddress=args.cdc_ep_num_data_in | standard.EndpointDescriptor.DIRECTION_IN, - bmAttributes=standard.EndpointDescriptor.TYPE_BULK), + bmAttributes=standard.EndpointDescriptor.TYPE_BULK, + bInterval=0, + wMaxPacketSize=512 if args.highspeed else 64), ]) cdc_interfaces = [cdc_comm_interface, cdc_data_interface] @@ -207,13 +211,13 @@ msc_interfaces = [ bEndpointAddress=args.msc_ep_num_in | standard.EndpointDescriptor.DIRECTION_IN, bmAttributes=standard.EndpointDescriptor.TYPE_BULK, bInterval=0, - wMaxPacketSize=args.msc_max_packet_size), + wMaxPacketSize=512 if args.highspeed else 64), standard.EndpointDescriptor( description="MSC out", bEndpointAddress=(args.msc_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT), bmAttributes=standard.EndpointDescriptor.TYPE_BULK, bInterval=0, - wMaxPacketSize=args.msc_max_packet_size) + wMaxPacketSize=512 if args.highspeed else 64), ] ) ] From d8fef207d254e03571e596795e93cbf99981bab5 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 29 Jul 2020 15:45:01 +0700 Subject: [PATCH 0414/1293] remove obsolete CFG in tusb_config.h --- supervisor/shared/usb/tusb_config.h | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/supervisor/shared/usb/tusb_config.h b/supervisor/shared/usb/tusb_config.h index 5b7230983e..e34a02714a 100644 --- a/supervisor/shared/usb/tusb_config.h +++ b/supervisor/shared/usb/tusb_config.h @@ -58,8 +58,6 @@ #define CFG_TUSB_OS OPT_OS_NONE #endif //#define CFG_TUD_TASK_QUEUE_SZ 16 -//#define CFG_TUD_TASK_PRIO 0 -//#define CFG_TUD_TASK_STACK_SZ 150 //--------------------------------------------------------------------+ // DEVICE CONFIGURATION @@ -67,14 +65,6 @@ #define CFG_TUD_ENDOINT0_SIZE 64 -/*------------- Descriptors -------------*/ -/* Enable auto generated descriptor, tinyusb will try its best to create - * descriptor ( device, configuration, hid ) that matches enabled CFG_* in this file - * - * Note: All CFG_TUD_DESC_* are relevant only if CFG_TUD_DESC_AUTO is enabled - */ -#define CFG_TUD_DESC_AUTO 0 - //------------- CLASS -------------// #define CFG_TUD_CDC 1 #define CFG_TUD_MSC 1 @@ -86,23 +76,6 @@ /* CLASS DRIVER *------------------------------------------------------------------*/ -/* TX is sent automatically on every Start of Frame event ~ 1ms. - * If not enabled, application must call tud_cdc_flush() periodically - * Note: Enabled this could overflow device task, if it does, define - * CFG_TUD_TASK_QUEUE_SZ with large value - */ -#define CFG_TUD_CDC_FLUSH_ON_SOF 0 - - -/*------------- MSC -------------*/ -// Number of supported Logical Unit Number (At least 1) -#define CFG_TUD_MSC_MAXLUN 1 - -// Number of Blocks -#define CFG_TUD_MSC_BLOCK_NUM (256*1024)/512 - - - // Product revision string included in Inquiry response, max 4 bytes #define CFG_TUD_MSC_PRODUCT_REV "1.0" From 1f4fcb399b077ea783219428bfd334808660667d Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 29 Jul 2020 16:05:31 +0700 Subject: [PATCH 0415/1293] move CFG_TUSB_RHPORT0_MODE into generated header --- supervisor/shared/usb/tusb_config.h | 2 -- tools/gen_usb_descriptor.py | 14 +++++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/supervisor/shared/usb/tusb_config.h b/supervisor/shared/usb/tusb_config.h index e34a02714a..15d9fabafe 100644 --- a/supervisor/shared/usb/tusb_config.h +++ b/supervisor/shared/usb/tusb_config.h @@ -47,8 +47,6 @@ //--------------------------------------------------------------------+ // COMMON CONFIGURATION //--------------------------------------------------------------------+ -#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE - #ifndef CFG_TUSB_DEBUG #define CFG_TUSB_DEBUG 0 #endif diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index af4e9e329f..762f2ea282 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -323,13 +323,16 @@ audio_midi_interface = standard.InterfaceDescriptor( standard.EndpointDescriptor( description="MIDI data out to {}".format(args.interface_name), bEndpointAddress=args.midi_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT, - bmAttributes=standard.EndpointDescriptor.TYPE_BULK), + bmAttributes=standard.EndpointDescriptor.TYPE_BULK, + bInterval=0, + wMaxPacketSize=512 if args.highspeed else 64), midi.DataEndpointDescriptor(baAssocJack=[midi_in_jack_emb]), standard.EndpointDescriptor( description="MIDI data in from {}".format(args.interface_name), bEndpointAddress=args.midi_ep_num_in | standard.EndpointDescriptor.DIRECTION_IN, bmAttributes=standard.EndpointDescriptor.TYPE_BULK, - bInterval = 0x0), + bInterval = 0x0, + wMaxPacketSize=512 if args.highspeed else 64), midi.DataEndpointDescriptor(baAssocJack=[midi_out_jack_emb]), ]) @@ -544,15 +547,15 @@ h_file.write("""\ #include extern const uint8_t usb_desc_dev[{device_length}]; -// Make sure the control buffer is big enough to fit the descriptor. -#define CFG_TUD_ENUM_BUFFER_SIZE {max_configuration_length} extern const uint8_t usb_desc_cfg[{configuration_length}]; extern uint16_t usb_serial_number[{serial_number_length}]; extern uint16_t const * const string_desc_arr [{string_descriptor_length}]; extern const uint8_t hid_report_descriptor[{hid_report_descriptor_length}]; -#define USB_HID_NUM_DEVICES {hid_num_devices} +#define CFG_TUSB_RHPORT0_MODE ({rhport0_mode}) + +#define USB_HID_NUM_DEVICES {hid_num_devices} // Vendor name included in Inquiry response, max 8 bytes #define CFG_TUD_MSC_VENDOR "{msc_vendor}" @@ -567,6 +570,7 @@ extern const uint8_t hid_report_descriptor[{hid_report_descriptor_length}]; max_configuration_length=max(hid_descriptor_length, descriptor_length), string_descriptor_length=len(pointers_to_strings), hid_report_descriptor_length=len(bytes(combined_hid_report_descriptor)), + rhport0_mode='OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED' if args.highspeed else 'OPT_MODE_DEVICE', hid_num_devices=len(args.hid_devices), msc_vendor=args.manufacturer[:8], msc_product=args.product[:16])) From b6724e843c43bec8eb1baae4be6acd940ecbecf2 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 29 Jul 2020 16:22:27 +0700 Subject: [PATCH 0416/1293] update CDC/MIDI bufsize to at least 512 for highspeed port --- ports/cxd56/Makefile | 2 +- ports/mimxrt10xx/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/cxd56/Makefile b/ports/cxd56/Makefile index b3e104e1ea..bb3958af4f 100644 --- a/ports/cxd56/Makefile +++ b/ports/cxd56/Makefile @@ -151,7 +151,7 @@ LDFLAGS = \ --end-group \ -L$(BUILD) \ -CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_CXD56 -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=512 $(CFLAGS_MOD) +CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_CXD56 -DCFG_TUD_MIDI_RX_BUFSIZE=512 -DCFG_TUD_CDC_RX_BUFSIZE=512 -DCFG_TUD_MIDI_TX_BUFSIZE=512 -DCFG_TUD_CDC_TX_BUFSIZE=512 -DCFG_TUD_MSC_BUFSIZE=512 $(CFLAGS_MOD) SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \ $(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \ diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 9177188100..248798f634 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -78,7 +78,7 @@ INC += \ CFLAGS += -Os -DNDEBUG # TinyUSB defines -CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_MIMXRT10XX -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 +CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_MIMXRT10XX -DCFG_TUD_MIDI_RX_BUFSIZE=512 -DCFG_TUD_CDC_RX_BUFSIZE=512 -DCFG_TUD_MIDI_TX_BUFSIZE=512 -DCFG_TUD_CDC_TX_BUFSIZE=512 -DCFG_TUD_MSC_BUFSIZE=1024 #Debugging/Optimization ifeq ($(DEBUG), 1) From 9f3bddbcb2ac67c9a0232b2fe16bf6f6a423e684 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 29 Jul 2020 16:23:21 +0700 Subject: [PATCH 0417/1293] update tinyusb from commmit dc5445e2f to 78f1576e9 --- lib/tinyusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index dc5445e2f4..78f1576e93 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit dc5445e2f45cb348a44fe24fc1be4bc8b5ba5bab +Subproject commit 78f1576e933c92d467b36b4fb699e23de67708ab From 93cc50514425047b8d098350dea9bf5dd7d32373 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 29 Jul 2020 19:18:46 +0700 Subject: [PATCH 0418/1293] update tinyusb to commit 22100b252 fix warnings on esp32s2 and stm32 --- lib/tinyusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index 78f1576e93..22100b252f 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit 78f1576e933c92d467b36b4fb699e23de67708ab +Subproject commit 22100b252fc2eb8f51ed407949645653c4880fd9 From 2b6b0e949db793f88aee28bc0afe46c86cde3e25 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 29 Jul 2020 09:08:36 -0400 Subject: [PATCH 0419/1293] temporary change to test uploads --- .github/workflows/build.yml | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a17dacf94..e3db966b58 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: run: | sudo apt-get install -y eatmydata sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 - pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black + pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli - name: Versions run: | gcc --version @@ -86,35 +86,35 @@ jobs: working-directory: tools - name: Build mpy-cross.static-raspbian run: make -C mpy-cross -j2 -f Makefile.static-raspbian - - uses: actions/upload-artifact@v1.0.0 + - uses: actions/upload-artifact@v2 with: name: mpy-cross.static-raspbian path: mpy-cross/mpy-cross.static-raspbian - name: Build mpy-cross.static run: make -C mpy-cross -j2 -f Makefile.static - - uses: actions/upload-artifact@v1.0.0 + - uses: actions/upload-artifact@v2 with: name: mpy-cross.static-amd64-linux path: mpy-cross/mpy-cross.static - name: Build mpy-cross.static-mingw run: make -C mpy-cross -j2 -f Makefile.static-mingw - - uses: actions/upload-artifact@v1.0.0 + - uses: actions/upload-artifact@v2 with: name: mpy-cross.static-x64-windows path: mpy-cross/mpy-cross.static.exe - name: Upload mpy-cross builds to S3 run: | - "[ -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-mingw s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-mingw-${{ 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" + [ -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-mingw s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-mingw-${{ 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 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) + if: true || github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) mpy-cross-mac: @@ -124,9 +124,9 @@ jobs: env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - name: Make gettext programs available + - name: Install dependencies run: | - brew install gettext + brew install gettext awscli echo "::set-env name=PATH::/usr/local/opt/gettext/bin:$PATH" - name: Versions run: | @@ -144,16 +144,17 @@ jobs: echo "::set-env name=CP_VERSION::$(git describe --dirty --tags)" - name: Build mpy-cross run: make -C mpy-cross -j2 - - uses: actions/upload-artifact@v1.0.0 + - uses: actions/upload-artifact@v2 with: name: mpy-cross-macos-catalina path: mpy-cross/mpy-cross - name: Upload mpy-cross build to S3 - run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp mpy-cross/mpy-cross s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross-macos-catalina-${{ env.CP_VERSION }} --no-progress --region us-east-1" + run: | + [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross-macos-catalina-${{ env.CP_VERSION }} --no-progress --region us-east-1 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) + if: true || github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) build-arm: @@ -337,7 +338,7 @@ jobs: working-directory: tools env: BOARDS: ${{ matrix.board }} - - uses: actions/upload-artifact@v1.0.0 + - uses: actions/upload-artifact@v2 with: name: ${{ matrix.board }} path: bin/${{ matrix.board }} @@ -385,7 +386,7 @@ jobs: working-directory: tools env: BOARDS: ${{ matrix.board }} - - uses: actions/upload-artifact@v1.0.0 + - uses: actions/upload-artifact@v2 with: name: ${{ matrix.board }} path: bin/${{ matrix.board }} @@ -465,7 +466,7 @@ jobs: IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf IDF_TOOLS_PATH: ${{ github.workspace }}/.idf_tools BOARDS: ${{ matrix.board }} - - uses: actions/upload-artifact@v1.0.0 + - uses: actions/upload-artifact@v2 with: name: ${{ matrix.board }} path: bin/${{ matrix.board }} From b93ee1e6f8895e9875f7633475f7dda8ad42225b Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 29 Jul 2020 10:35:58 -0400 Subject: [PATCH 0420/1293] remove temp upload check; can't be tested from fork --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3db966b58..59262b8420 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,7 +114,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - if: true || github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) + if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) mpy-cross-mac: @@ -154,7 +154,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - if: true || github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) + if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) build-arm: From 4d54cbc6a78b45b280da936bbf58b24477766ff0 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 29 Jul 2020 12:30:48 -0400 Subject: [PATCH 0421/1293] Remove extra and incorrect upload line --- .github/workflows/build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 59262b8420..dd121b87e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,26 +90,22 @@ jobs: with: name: mpy-cross.static-raspbian path: mpy-cross/mpy-cross.static-raspbian - - name: Build mpy-cross.static run: make -C mpy-cross -j2 -f Makefile.static - uses: actions/upload-artifact@v2 with: name: mpy-cross.static-amd64-linux path: mpy-cross/mpy-cross.static - - name: Build mpy-cross.static-mingw run: make -C mpy-cross -j2 -f Makefile.static-mingw - uses: actions/upload-artifact@v2 with: name: mpy-cross.static-x64-windows path: mpy-cross/mpy-cross.static.exe - - name: Upload mpy-cross builds to S3 run: | [ -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-mingw s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-mingw-${{ 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 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} From ea9bc9b4b64e276e0fa00b3d0c4c48579533a66b Mon Sep 17 00:00:00 2001 From: Joey Castillo Date: Wed, 29 Jul 2020 13:46:10 -0400 Subject: [PATCH 0422/1293] set screen orientation to portrait --- ports/atmel-samd/boards/openbook_m4/board.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/atmel-samd/boards/openbook_m4/board.c b/ports/atmel-samd/boards/openbook_m4/board.c index 9c71ee5640..f0010f6d78 100644 --- a/ports/atmel-samd/boards/openbook_m4/board.c +++ b/ports/atmel-samd/boards/openbook_m4/board.c @@ -76,13 +76,13 @@ void board_init(void) { sizeof(start_sequence), stop_sequence, sizeof(stop_sequence), - 400, // width - 300, // height - 400, // RAM width - 300, // RAM height + 300, // width + 400, // height + 300, // RAM width + 400, // RAM height 0, // colstart 0, // rowstart - 0, // rotation + 270, // rotation NO_COMMAND, // set_column_window_command NO_COMMAND, // set_row_window_command NO_COMMAND, // set_current_column_command From 8acec2ca356f0d8a74f5497ace5ea69c27a76d03 Mon Sep 17 00:00:00 2001 From: Joey Castillo Date: Wed, 29 Jul 2020 13:49:08 -0400 Subject: [PATCH 0423/1293] add descriptive pin names --- ports/atmel-samd/boards/openbook_m4/pins.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/atmel-samd/boards/openbook_m4/pins.c b/ports/atmel-samd/boards/openbook_m4/pins.c index 3fbb67860b..47de3043d9 100644 --- a/ports/atmel-samd/boards/openbook_m4/pins.c +++ b/ports/atmel-samd/boards/openbook_m4/pins.c @@ -53,6 +53,10 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_EBSY), MP_ROM_PTR(&pin_PA01) }, // Special named pins + { MP_OBJ_NEW_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PB01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_USB), MP_ROM_PTR(&pin_PB00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MICIN), MP_ROM_PTR(&pin_PB04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MICOUT), MP_ROM_PTR(&pin_PA07) }, { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA15) }, { MP_OBJ_NEW_QSTR(MP_QSTR_LOCK_BUTTON), MP_ROM_PTR(&pin_PA27) }, { MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_LATCH), MP_ROM_PTR(&pin_PB12) }, From 9f8823e45575707a8d69890e24368e8bde05fab2 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 24 Jul 2020 13:49:27 +0000 Subject: [PATCH 0424/1293] Translated using Weblate (Spanish) Currently translated at 99.8% (782 of 783 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/es.po b/locale/es.po index 8d19b0ab01..fc62d4b43d 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-17 18:03-0700\n" -"PO-Revision-Date: 2020-07-22 20:48+0000\n" -"Last-Translator: Alvaro Figueroa \n" +"PO-Revision-Date: 2020-07-24 15:16+0000\n" +"Last-Translator: dherrada \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" @@ -89,7 +89,7 @@ msgstr "%q lista debe ser una lista" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" -msgstr "" +msgstr "%q debe ser >= 0" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -338,7 +338,7 @@ msgstr "Ya se encuentra publicando." #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" -msgstr "" +msgstr "Ya está en ejecución" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" From 1ea227716d0ed6a038f7c4b1670612771ae54a25 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Fri, 24 Jul 2020 17:16:48 +0200 Subject: [PATCH 0425/1293] 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 | 16 ++++++++++------ locale/es.po | 16 ++++++++++------ locale/fil.po | 13 +++++++------ locale/fr.po | 16 ++++++++++------ locale/it_IT.po | 13 +++++++------ locale/ko.po | 13 +++++++------ locale/nl.po | 16 ++++++++++------ locale/pl.po | 13 +++++++------ locale/pt_BR.po | 16 ++++++++++------ locale/sv.po | 16 ++++++++++------ locale/zh_Latn_pinyin.po | 13 +++++++------ 13 files changed, 109 insertions(+), 78 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index bd865c0548..e2b7ae082c 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -322,7 +322,7 @@ msgstr "Semua timer untuk pin ini sedang digunakan" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Semua timer sedang digunakan" @@ -1358,11 +1358,7 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "" - -#: ports/stm/common-hal/pulseio/PulseOut.c +#: ports/stm/ref/pulseout-pre-timeralloc.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1573,6 +1569,11 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Terlalu banyak channel dalam sampel" diff --git a/locale/cs.po b/locale/cs.po index cf91416270..29c19130d8 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -322,7 +322,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "" @@ -1338,11 +1338,7 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "" - -#: ports/stm/common-hal/pulseio/PulseOut.c +#: ports/stm/ref/pulseout-pre-timeralloc.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1551,6 +1547,11 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 9b07989ca6..1f496a4e28 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -321,7 +321,7 @@ msgstr "Alle timer für diesen Pin werden bereits benutzt" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Alle timer werden benutzt" @@ -1368,11 +1368,7 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "PulseIn wird auf diesem Chip nicht unterstützt" - -#: ports/stm/common-hal/pulseio/PulseOut.c +#: ports/stm/ref/pulseout-pre-timeralloc.c msgid "PulseOut not supported on this chip" msgstr "PulseOut wird auf diesem Chip nicht unterstützt" @@ -1593,6 +1589,11 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" "Zeitbeschränkung ist zu groß: Maximale Zeitbeschränkung ist %d Sekunden" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Zu viele Kanäle im sample." @@ -3471,6 +3472,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "PulseIn not supported on this chip" +#~ msgstr "PulseIn wird auf diesem Chip nicht unterstützt" + #~ msgid "AP required" #~ msgstr "AP erforderlich" diff --git a/locale/es.po b/locale/es.po index fc62d4b43d..035406b7f5 100644 --- a/locale/es.po +++ b/locale/es.po @@ -327,7 +327,7 @@ msgstr "Todos los timers para este pin están siendo utilizados" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Todos los timers en uso" @@ -1367,11 +1367,7 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull no se usa cuando la dirección es output." -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "PulseIn no es compatible con este chip" - -#: ports/stm/common-hal/pulseio/PulseOut.c +#: ports/stm/ref/pulseout-pre-timeralloc.c msgid "PulseOut not supported on this chip" msgstr "PulseOut no es compatible con este chip" @@ -1591,6 +1587,11 @@ msgstr "" "Tiempo de espera demasiado largo: El tiempo máximo de espera es de %d " "segundos" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Demasiados canales en sample." @@ -3451,6 +3452,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 "PulseIn not supported on this chip" +#~ msgstr "PulseIn no es compatible con este chip" + #~ msgid "AP required" #~ msgstr "AP requerido" diff --git a/locale/fil.po b/locale/fil.po index 92dc9cc910..48e48cd144 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -318,7 +318,7 @@ msgstr "Lahat ng timers para sa pin na ito ay ginagamit" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Lahat ng timer ginagamit" @@ -1352,11 +1352,7 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull hindi ginagamit kapag ang direksyon ay output." -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "" - -#: ports/stm/common-hal/pulseio/PulseOut.c +#: ports/stm/ref/pulseout-pre-timeralloc.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1566,6 +1562,11 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Sobra ang channels sa sample." diff --git a/locale/fr.po b/locale/fr.po index 8953efe37e..b64e28fa39 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -326,7 +326,7 @@ msgstr "Tous les timers pour cette broche sont utilisés" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Tous les timers sont utilisés" @@ -1373,11 +1373,7 @@ msgstr "Appuyez sur une touche pour entrer sur REPL ou CTRL-D pour recharger." msgid "Pull not used when direction is output." msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'." -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "PulseIn non pris en charge sur cette puce" - -#: ports/stm/common-hal/pulseio/PulseOut.c +#: ports/stm/ref/pulseout-pre-timeralloc.c msgid "PulseOut not supported on this chip" msgstr "PulseOut non pris en charge sur cette puce" @@ -1595,6 +1591,11 @@ msgstr "La largeur de la tuile doit diviser exactement la largeur de l'image" 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" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Trop de canaux dans l'échantillon." @@ -3474,6 +3475,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "PulseIn not supported on this chip" +#~ msgstr "PulseIn non pris en charge sur cette puce" + #~ msgid "AP required" #~ msgstr "'AP' requis" diff --git a/locale/it_IT.po b/locale/it_IT.po index 9f0aea9e9b..eaa19db06f 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -317,7 +317,7 @@ msgstr "Tutti i timer per questo pin sono in uso" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Tutti i timer utilizzati" @@ -1361,11 +1361,7 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "" - -#: ports/stm/common-hal/pulseio/PulseOut.c +#: ports/stm/ref/pulseout-pre-timeralloc.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1577,6 +1573,11 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" diff --git a/locale/ko.po b/locale/ko.po index e0f4dd9cb8..b831701331 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -316,7 +316,7 @@ msgstr "핀의 모든 타이머가 사용 중입니다" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "모든 타이머가 사용 중입니다" @@ -1334,11 +1334,7 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "" - -#: ports/stm/common-hal/pulseio/PulseOut.c +#: ports/stm/ref/pulseout-pre-timeralloc.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1547,6 +1543,11 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 29591dfd80..88dec5e99b 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -322,7 +322,7 @@ msgstr "Alle timers voor deze pin zijn in gebruik" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Alle timers zijn in gebruik" @@ -1364,11 +1364,7 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull niet gebruikt wanneer de richting output is." -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "PusleIn niet ondersteund door deze chip" - -#: ports/stm/common-hal/pulseio/PulseOut.c +#: ports/stm/ref/pulseout-pre-timeralloc.c msgid "PulseOut not supported on this chip" msgstr "PulseOut niet ondersteund door deze chip" @@ -1585,6 +1581,11 @@ msgstr "Tile breedte moet exact de bitmap breedte verdelen" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "Time-out is te lang. Maximale time-out lengte is %d seconden" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Teveel kanalen in sample." @@ -3439,6 +3440,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 "PulseIn not supported on this chip" +#~ msgstr "PusleIn niet ondersteund door deze chip" + #~ msgid "I2C operation not supported" #~ msgstr "I2C actie niet ondersteund" diff --git a/locale/pl.po b/locale/pl.po index e359e71b67..d20e544bc2 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -316,7 +316,7 @@ msgstr "Wszystkie timery tej nóżki w użyciu" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Wszystkie timery w użyciu" @@ -1336,11 +1336,7 @@ msgstr "Dowolny klawisz aby uruchomić konsolę. CTRL-D aby przeładować." msgid "Pull not used when direction is output." msgstr "Podciągnięcie nieużywane w trybie wyjścia." -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "" - -#: ports/stm/common-hal/pulseio/PulseOut.c +#: ports/stm/ref/pulseout-pre-timeralloc.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1549,6 +1545,11 @@ msgstr "Szerokość bitmapy musi być wielokrotnością szerokości kafelka" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Zbyt wiele kanałów." diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 10f3bf6113..5b3317759b 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -324,7 +324,7 @@ msgstr "Todos os temporizadores para este pino estão em uso" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Todos os temporizadores em uso" @@ -1372,11 +1372,7 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "O Pull não foi usado quando a direção for gerada." -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "O PulseIn não é compatível neste CI" - -#: ports/stm/common-hal/pulseio/PulseOut.c +#: ports/stm/ref/pulseout-pre-timeralloc.c msgid "PulseOut not supported on this chip" msgstr "O PulseOut não é compatível neste CI" @@ -1596,6 +1592,11 @@ msgstr "" "O tempo limite é long demais: O comprimento máximo do tempo limite é de %d " "segundos" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Muitos canais na amostra." @@ -3463,6 +3464,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 "PulseIn not supported on this chip" +#~ msgstr "O PulseIn não é compatível neste CI" + #~ msgid "AP required" #~ msgstr "AP requerido" diff --git a/locale/sv.po b/locale/sv.po index 075db8ab09..d39b9da57b 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -322,7 +322,7 @@ msgstr "Alla timers för denna pinne är i bruk" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Alla timers används" @@ -1360,11 +1360,7 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull används inte när riktningen är output." -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "PulseIn stöds inte av detta chip" - -#: ports/stm/common-hal/pulseio/PulseOut.c +#: ports/stm/ref/pulseout-pre-timeralloc.c msgid "PulseOut not supported on this chip" msgstr "PulseIn stöds inte av detta chip" @@ -1581,6 +1577,11 @@ msgstr "Tile-bredd måste vara jämnt delbar med bredd på bitmap" 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" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "För många kanaler i sampling." @@ -3432,6 +3433,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 "PulseIn not supported on this chip" +#~ msgstr "PulseIn stöds inte av detta chip" + #~ msgid "I2C operation not supported" #~ msgstr "I2C-åtgärd stöds inte" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index a820c142c6..5ed23c3ddc 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -322,7 +322,7 @@ msgstr "Cǐ yǐn jiǎo de suǒyǒu jìshí qì zhèngzài shǐyòng" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Suǒyǒu jìshí qì shǐyòng" @@ -1350,11 +1350,7 @@ msgstr "Àn xià rènhé jiàn jìnrù REPL. Shǐyòng CTRL-D chóngxīn jiāzà msgid "Pull not used when direction is output." msgstr "Fāngxiàng shūchū shí Pull méiyǒu shǐyòng." -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "" - -#: ports/stm/common-hal/pulseio/PulseOut.c +#: ports/stm/ref/pulseout-pre-timeralloc.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1570,6 +1566,11 @@ msgstr "Píng pū kuāndù bìxū huàfēn wèi tú kuāndù" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Chōuyàng zhōng de píndào tài duō." From 06f820c0d6370faf8c38cbe6cb3bb06d2b29bba5 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Fri, 24 Jul 2020 16:30:50 +0000 Subject: [PATCH 0426/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (783 of 783 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 5b3317759b..8b4b9cbff4 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: 2020-07-17 18:03-0700\n" -"PO-Revision-Date: 2020-07-23 02:57+0000\n" +"PO-Revision-Date: 2020-07-24 17:34+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -1596,6 +1596,8 @@ msgstr "" msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +"O temporizador foi reservado para uso interno - declare os pinos PWM no " +"início do programa" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." From 6dc01e179a50d97fb2b530d5ee8f22fc554e1089 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Fri, 24 Jul 2020 21:37:19 +0200 Subject: [PATCH 0427/1293] 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 | 6 +++++- locale/cs.po | 6 +++++- locale/de_DE.po | 6 +++++- locale/es.po | 6 +++++- locale/fil.po | 6 +++++- locale/fr.po | 6 +++++- locale/it_IT.po | 6 +++++- locale/ko.po | 6 +++++- locale/nl.po | 6 +++++- locale/pl.po | 6 +++++- locale/pt_BR.po | 6 +++++- locale/sv.po | 6 +++++- locale/zh_Latn_pinyin.po | 6 +++++- 13 files changed, 65 insertions(+), 13 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index e2b7ae082c..182e3638c2 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-21 18:43-0700\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -240,6 +240,10 @@ msgstr "'break' diluar loop" msgid "'continue' outside loop" msgstr "'continue' diluar loop" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' membutuhkan setidaknya 2 argumen" diff --git a/locale/cs.po b/locale/cs.po index 29c19130d8..d23739d1a0 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-21 18:43-0700\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -240,6 +240,10 @@ msgstr "" msgid "'continue' outside loop" msgstr "" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 1f496a4e28..2dc54cf98b 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-21 18:43-0700\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -239,6 +239,10 @@ msgstr "'break' außerhalb einer Schleife" msgid "'continue' outside loop" msgstr "'continue' außerhalb einer Schleife" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' erfordert mindestens zwei Argumente" diff --git a/locale/es.po b/locale/es.po index 035406b7f5..d0d1c04f40 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-21 18:43-0700\n" "PO-Revision-Date: 2020-07-24 15:16+0000\n" "Last-Translator: dherrada \n" "Language-Team: \n" @@ -243,6 +243,10 @@ msgstr "'break' fuera de un bucle" msgid "'continue' outside loop" msgstr "'continue' fuera de un bucle" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' requiere como minomo 2 argumentos" diff --git a/locale/fil.po b/locale/fil.po index 48e48cd144..a64065914b 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-21 18:43-0700\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -235,6 +235,10 @@ msgstr "'break' sa labas ng loop" msgid "'continue' outside loop" msgstr "'continue' sa labas ng loop" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' kailangan ng hindi bababa sa 2 argument" diff --git a/locale/fr.po b/locale/fr.po index b64e28fa39..afd9c0b616 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-21 18:43-0700\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" "Language: fr\n" @@ -244,6 +244,10 @@ msgstr "'break' en dehors d'une boucle" msgid "'continue' outside loop" msgstr "'continue' en dehors d'une boucle" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' nécessite au moins 2 arguments" diff --git a/locale/it_IT.po b/locale/it_IT.po index eaa19db06f..08958c29e1 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-21 18:43-0700\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -234,6 +234,10 @@ msgstr "'break' al di fuori del ciclo" msgid "'continue' outside loop" msgstr "'continue' al di fuori del ciclo" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' richiede almeno 2 argomento" diff --git a/locale/ko.po b/locale/ko.po index b831701331..2bbd854a28 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-21 18:43-0700\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -234,6 +234,10 @@ msgstr "'break' 는 루프 외부에 있습니다" msgid "'continue' outside loop" msgstr "'continue' 는 루프 외부에 있습니다" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' 에는 >=2 개의 독립변수가 필요합니다" diff --git a/locale/nl.po b/locale/nl.po index 88dec5e99b..0333125e70 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-21 18:43-0700\n" "PO-Revision-Date: 2020-07-13 17:39+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -240,6 +240,10 @@ msgstr "'break' buiten de loop" msgid "'continue' outside loop" msgstr "'continue' buiten de loop" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' vereist op zijn minst 2 argumenten" diff --git a/locale/pl.po b/locale/pl.po index d20e544bc2..a5f1973fd0 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-21 18:43-0700\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -234,6 +234,10 @@ msgstr "'break' poza pętlą" msgid "'continue' outside loop" msgstr "'continue' poza pętlą" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' wymaga 2 lub więcej argumentów" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 8b4b9cbff4..3a2cc80ef3 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-21 18:43-0700\n" "PO-Revision-Date: 2020-07-24 17:34+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -242,6 +242,10 @@ msgstr "'break' fora do loop" msgid "'continue' outside loop" msgstr "'continue' fora do loop" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' exige pelo menos 2 argumentos" diff --git a/locale/sv.po b/locale/sv.po index d39b9da57b..acebae5cef 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-21 18:43-0700\n" "PO-Revision-Date: 2020-07-13 17:39+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -240,6 +240,10 @@ msgstr "'break' utanför loop" msgid "'continue' outside loop" msgstr "'continue' utanför loop" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' kräver minst 2 argument" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 5ed23c3ddc..660d2249f8 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-21 18:43-0700\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -240,6 +240,10 @@ msgstr "'break' wàibù xúnhuán" msgid "'continue' outside loop" msgstr "'continue' wàibù xúnhuán" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' xūyào zhìshǎo 2 gè cānshù" From 3563c3725ce1ac2f25cb6011daa8e7f862bf1044 Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Fri, 24 Jul 2020 20:50:39 +0000 Subject: [PATCH 0428/1293] Translated using Weblate (Spanish) Currently translated at 100.0% (784 of 784 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/locale/es.po b/locale/es.po index d0d1c04f40..c42b1ad20e 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-21 18:43-0700\n" -"PO-Revision-Date: 2020-07-24 15:16+0000\n" -"Last-Translator: dherrada \n" +"PO-Revision-Date: 2020-07-24 21:12+0000\n" +"Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" @@ -245,7 +245,7 @@ msgstr "'continue' fuera de un bucle" #: py/objgenerator.c msgid "'coroutine' object is not an iterator" -msgstr "" +msgstr "el objeto 'coroutine' no es un iterador" #: py/compile.c msgid "'data' requires at least 2 arguments" @@ -382,7 +382,7 @@ msgstr "Como máximo %d %q se puede especificar (no %d)" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" -msgstr "" +msgstr "Tratando de localizar %d bloques" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." @@ -1595,6 +1595,8 @@ msgstr "" msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +"El temporizador es utilizado para uso interno - declare los pines para PWM " +"más temprano en el programa" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." From 7316644bb4cff38d8a64e694a755cea290a54705 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Fri, 24 Jul 2020 21:35:43 +0000 Subject: [PATCH 0429/1293] Translated using Weblate (Swedish) Currently translated at 100.0% (784 of 784 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index acebae5cef..f2788114d9 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: 2020-07-21 18:43-0700\n" -"PO-Revision-Date: 2020-07-13 17:39+0000\n" +"PO-Revision-Date: 2020-07-25 20:58+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -86,7 +86,7 @@ msgstr "%q-listan måste vara en lista" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" -msgstr "" +msgstr "%q måste vara >= 0" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -118,7 +118,7 @@ msgstr "'%q' argument krävs" #: py/objarray.c msgid "'%q' object is not bytes-like" -msgstr "" +msgstr "%q-objektet är inte byte-lik" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -242,7 +242,7 @@ msgstr "'continue' utanför loop" #: py/objgenerator.c msgid "'coroutine' object is not an iterator" -msgstr "" +msgstr "objektet 'coroutine\" är inte en iterator" #: py/compile.c msgid "'data' requires at least 2 arguments" @@ -337,7 +337,7 @@ msgstr "Annonserar redan." #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" -msgstr "" +msgstr "Kör redan" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -377,7 +377,7 @@ msgstr "Högst %d %q kan anges (inte %d)" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" -msgstr "" +msgstr "Försök att tilldela %d block" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." @@ -1585,6 +1585,8 @@ msgstr "Åtgärden tog för lång tid: Max väntetid är %d sekunder" msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +"Timern är reserverad för internt bruk - deklarera PWM-pinne tidigare i " +"programmet" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." From 1c6bff67552d214772070f8d823adf517fd80263 Mon Sep 17 00:00:00 2001 From: Nathan Date: Sun, 26 Jul 2020 08:48:36 +0000 Subject: [PATCH 0430/1293] Translated using Weblate (French) Currently translated at 98.5% (773 of 784 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index afd9c0b616..ea784ca157 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: 2020-07-21 18:43-0700\n" -"PO-Revision-Date: 2020-06-05 17:29+0000\n" -"Last-Translator: aberwag \n" +"PO-Revision-Date: 2020-07-27 21:27+0000\n" +"Last-Translator: Nathan \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.1-dev\n" +"X-Generator: Weblate 4.2-dev\n" #: main.c msgid "" @@ -70,7 +70,7 @@ msgstr "" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" -msgstr "" +msgstr "Échec de %q : %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -90,7 +90,7 @@ msgstr "La liste %q doit être une liste" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" -msgstr "" +msgstr "%q doit être >= 0" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -106,7 +106,7 @@ msgstr "%q doit être un tuple de longueur 2" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q pin invalid" -msgstr "" +msgstr "PIN %q invalide" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" @@ -246,7 +246,7 @@ msgstr "'continue' en dehors d'une boucle" #: py/objgenerator.c msgid "'coroutine' object is not an iterator" -msgstr "" +msgstr "L'objet « coroutine » n'est pas un itérateur" #: py/compile.c msgid "'data' requires at least 2 arguments" @@ -341,7 +341,7 @@ msgstr "S'annonce déjà." #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" -msgstr "" +msgstr "Déjà en cours d'exécution" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -382,7 +382,7 @@ msgstr "Au plus %d %q peut être spécifié (pas %d)" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" -msgstr "" +msgstr "Tentative d'allocation de %d blocs" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." @@ -466,7 +466,7 @@ msgstr "La longueur du tampon %d est trop grande. Il doit être inférieur à %d #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" -msgstr "" +msgstr "La longueur de la mémoire tampon doit être un multiple de 512" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -637,11 +637,11 @@ msgstr "Code brut corrompu" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" -msgstr "" +msgstr "Impossible d'initialiser GNSS" #: ports/cxd56/common-hal/sdioio/SDCard.c msgid "Could not initialize SDCard" -msgstr "" +msgstr "Impossible d'initialiser la carte SD" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" @@ -931,7 +931,7 @@ msgstr "Erreur interne #%d" #: shared-bindings/sdioio/SDCard.c msgid "Invalid %q" -msgstr "" +msgstr "%q invalide" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1147,7 +1147,7 @@ msgstr "Doit fournir une broche MISO ou MOSI" #: ports/stm/common-hal/busio/SPI.c msgid "Must provide SCK pin" -msgstr "" +msgstr "Vous devez fournir un code PIN SCK" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1450,7 +1450,7 @@ msgstr "Mode sans-échec ! Le code sauvegardé n'est pas éxecuté.\n" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" -msgstr "" +msgstr "Le format de carte SD CSD n'est pas pris en charge" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c @@ -1524,7 +1524,7 @@ msgstr "Fournissez au moins une broche UART" #: shared-bindings/gnss/GNSS.c msgid "System entry must be gnss.SatelliteSystem" -msgstr "" +msgstr "L'entrée du système doit être gnss.SatelliteSystem" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" @@ -2113,7 +2113,7 @@ msgstr "" #: shared-module/sdcardio/SDCard.c msgid "can't set 512 block size" -msgstr "" +msgstr "impossible de définir une taille de bloc de 512" #: py/objnamedtuple.c msgid "can't set attribute" @@ -2250,7 +2250,7 @@ msgstr "n'a pas pu inverser la matrice Vandermonde" #: shared-module/sdcardio/SDCard.c msgid "couldn't determine SD card version" -msgstr "" +msgstr "impossible de déterminer la version de la carte SD" #: extmod/ulab/code/approx.c msgid "data must be iterable" @@ -2821,7 +2821,7 @@ msgstr "compte de décalage négatif" #: shared-module/sdcardio/SDCard.c msgid "no SD card" -msgstr "" +msgstr "pas de carte SD" #: py/vm.c msgid "no active exception to reraise" @@ -2846,7 +2846,7 @@ msgstr "pas de broche de réinitialisation disponible" #: shared-module/sdcardio/SDCard.c msgid "no response from SD card" -msgstr "" +msgstr "pas de réponse de la carte SD" #: py/runtime.c msgid "no such attribute" From 5c4fab744e050a1ba2815c7f8fdd583f6e954612 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Sun, 26 Jul 2020 20:10:36 +0000 Subject: [PATCH 0431/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (784 of 784 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 3a2cc80ef3..76beb24584 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: 2020-07-21 18:43-0700\n" -"PO-Revision-Date: 2020-07-24 17:34+0000\n" +"PO-Revision-Date: 2020-07-27 21:27+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -244,7 +244,7 @@ msgstr "'continue' fora do loop" #: py/objgenerator.c msgid "'coroutine' object is not an iterator" -msgstr "" +msgstr "O objeto 'corrotina' não é um iterador" #: py/compile.c msgid "'data' requires at least 2 arguments" From 31bea079cf529c56f1428db8d60eef6567402441 Mon Sep 17 00:00:00 2001 From: _fonzlate Date: Mon, 27 Jul 2020 18:35:45 +0000 Subject: [PATCH 0432/1293] Translated using Weblate (Dutch) Currently translated at 100.0% (784 of 784 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/nl/ --- locale/nl.po | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index 0333125e70..40100842b5 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-21 18:43-0700\n" -"PO-Revision-Date: 2020-07-13 17:39+0000\n" +"PO-Revision-Date: 2020-07-27 21:27+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" "Language: nl\n" @@ -86,7 +86,7 @@ msgstr "%q lijst moet een lijst zijn" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" -msgstr "" +msgstr "%q moet >= 0 zijn" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -118,7 +118,7 @@ msgstr "'%q' argument vereist" #: py/objarray.c msgid "'%q' object is not bytes-like" -msgstr "" +msgstr "'%q' object is niet bytes-achtig" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -242,7 +242,7 @@ msgstr "'continue' buiten de loop" #: py/objgenerator.c msgid "'coroutine' object is not an iterator" -msgstr "" +msgstr "'coroutine' object is geen iterator" #: py/compile.c msgid "'data' requires at least 2 arguments" @@ -337,7 +337,7 @@ msgstr "Advertising is al bezig." #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" -msgstr "" +msgstr "Wordt al uitgevoerd" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -377,7 +377,7 @@ msgstr "Op zijn meest %d %q mogen worden gespecificeerd (niet %d)" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" -msgstr "" +msgstr "Poging om %d blokken toe te wijzen" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." @@ -1589,6 +1589,8 @@ msgstr "Time-out is te lang. Maximale time-out lengte is %d seconden" msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +"Timer is gereserveerd voor intern gebruik - wijs PWM pins eerder in het " +"programma toe" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." From 7c387c6d2bf4d7c7f91bea84ac9bab590b957294 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 28 Jul 2020 01:02:33 +0200 Subject: [PATCH 0433/1293] 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 | 16 ++++------------ locale/de_DE.po | 26 ++++++++++++-------------- locale/es.po | 29 +++++++++++++++-------------- locale/fil.po | 20 ++++++-------------- locale/fr.po | 26 ++++++++++++-------------- locale/it_IT.po | 20 ++++++-------------- locale/ko.po | 20 ++++++-------------- locale/nl.po | 29 +++++++++++++++-------------- locale/pl.po | 20 ++++++-------------- locale/pt_BR.po | 29 +++++++++++++++-------------- locale/sv.po | 29 +++++++++++++++-------------- locale/zh_Latn_pinyin.po | 20 ++++++-------------- 13 files changed, 127 insertions(+), 180 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 182e3638c2..42ff9897f8 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-21 18:43-0700\n" +"POT-Creation-Date: 2020-07-24 19:58-0700\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -116,10 +116,6 @@ msgstr "%q() mengambil posisi argumen %d tapi %d yang diberikan" msgid "'%q' argument required" msgstr "'%q' argumen dibutuhkan" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -224,14 +220,14 @@ msgstr "'S' dan 'O' bukan tipe format yang didukung" msgid "'align' requires 1 argument" msgstr "'align' membutuhkan 1 argumen" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "'async for' atau 'async with' di luar fungsi async" - #: py/compile.c msgid "'await' outside function" msgstr "'await' diluar fungsi" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' diluar loop" @@ -1362,10 +1358,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -1808,7 +1800,7 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "sebuah objek menyerupai byte (bytes-like) dibutuhkan" @@ -3420,6 +3412,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "'async for' or 'async with' outside async function" +#~ msgstr "'async for' atau 'async with' di luar fungsi async" + #~ msgid "AP required" #~ msgstr "AP dibutuhkan" diff --git a/locale/cs.po b/locale/cs.po index d23739d1a0..2e3eb5a787 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-21 18:43-0700\n" +"POT-Creation-Date: 2020-07-24 19:58-0700\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -116,10 +116,6 @@ msgstr "" msgid "'%q' argument required" msgstr "" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -225,11 +221,11 @@ msgid "'align' requires 1 argument" msgstr "" #: py/compile.c -msgid "'async for' or 'async with' outside async function" +msgid "'await' outside function" msgstr "" #: py/compile.c -msgid "'await' outside function" +msgid "'await', 'async for' or 'async with' outside async function" msgstr "" #: py/compile.c @@ -1342,10 +1338,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -1779,7 +1771,7 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 2dc54cf98b..ff6d78bb6f 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-21 18:43-0700\n" +"POT-Creation-Date: 2020-07-24 19:58-0700\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -115,10 +115,6 @@ msgstr "%q() nimmt %d Argumente ohne Keyword an, aber es wurden %d angegeben" msgid "'%q' argument required" msgstr "'%q' Argument erforderlich" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -223,14 +219,14 @@ msgstr "'S' und 'O' sind keine unterstützten Formattypen" msgid "'align' requires 1 argument" msgstr "'align' erfordert genau ein Argument" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "'async for' oder 'async with' außerhalb der asynchronen Funktion" - #: py/compile.c msgid "'await' outside function" msgstr "'await' außerhalb einer Funktion" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' außerhalb einer Schleife" @@ -1372,10 +1368,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "PulseOut wird auf diesem Chip nicht unterstützt" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG DeInit-Fehler" @@ -1836,7 +1828,7 @@ msgstr "__init__() sollte None zurückgeben, nicht '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ arg muss user-type sein" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "ein Byte-ähnliches Objekt ist erforderlich" @@ -3476,6 +3468,12 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "'async for' or 'async with' outside async function" +#~ msgstr "'async for' oder 'async with' außerhalb der asynchronen Funktion" + +#~ msgid "PulseOut not supported on this chip" +#~ msgstr "PulseOut wird auf diesem Chip nicht unterstützt" + #~ msgid "PulseIn not supported on this chip" #~ msgstr "PulseIn wird auf diesem Chip nicht unterstützt" diff --git a/locale/es.po b/locale/es.po index c42b1ad20e..72632ab6e4 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-21 18:43-0700\n" +"POT-Creation-Date: 2020-07-24 19:58-0700\n" "PO-Revision-Date: 2020-07-24 21:12+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -119,10 +119,6 @@ msgstr "%q() toma %d argumentos posicionales pero %d fueron dados" msgid "'%q' argument required" msgstr "argumento '%q' requerido" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "el objeto '%q' no es similar a bytes" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -227,14 +223,14 @@ msgstr "'S' y 'O' no son compatibles con los tipos de formato" msgid "'align' requires 1 argument" msgstr "'align' requiere 1 argumento" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "'async for' o 'async with' fuera de la función async" - #: py/compile.c msgid "'await' outside function" msgstr "'await' fuera de la función" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' fuera de un bucle" @@ -1371,10 +1367,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull no se usa cuando la dirección es output." -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "PulseOut no es compatible con este chip" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "Error de desinicializado del RNG" @@ -1833,7 +1825,7 @@ msgstr "__init__() deberia devolver None, no '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ arg debe ser un user-type" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "se requiere un objeto bytes-like" @@ -3458,6 +3450,15 @@ 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' object is not bytes-like" +#~ msgstr "el objeto '%q' no es similar a bytes" + +#~ msgid "'async for' or 'async with' outside async function" +#~ msgstr "'async for' o 'async with' fuera de la función async" + +#~ msgid "PulseOut not supported on this chip" +#~ msgstr "PulseOut no es compatible con este chip" + #~ msgid "PulseIn not supported on this chip" #~ msgstr "PulseIn no es compatible con este chip" diff --git a/locale/fil.po b/locale/fil.po index a64065914b..566b24783f 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-21 18:43-0700\n" +"POT-Creation-Date: 2020-07-24 19:58-0700\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -111,10 +111,6 @@ msgstr "" msgid "'%q' argument required" msgstr "'%q' argument kailangan" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -219,14 +215,14 @@ msgstr "Ang 'S' at 'O' ay hindi suportadong uri ng format" msgid "'align' requires 1 argument" msgstr "'align' kailangan ng 1 argument" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "" - #: py/compile.c msgid "'await' outside function" msgstr "'await' sa labas ng function" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' sa labas ng loop" @@ -1356,10 +1352,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull hindi ginagamit kapag ang direksyon ay output." -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -1804,7 +1796,7 @@ msgstr "__init__() dapat magbalink na None, hindi '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ arg ay dapat na user-type" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "a bytes-like object ay kailangan" diff --git a/locale/fr.po b/locale/fr.po index ea784ca157..291bd2990a 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-21 18:43-0700\n" +"POT-Creation-Date: 2020-07-24 19:58-0700\n" "PO-Revision-Date: 2020-07-27 21:27+0000\n" "Last-Translator: Nathan \n" "Language: fr\n" @@ -120,10 +120,6 @@ msgstr "%q() prend %d arguments positionnels mais %d ont été donnés" msgid "'%q' argument required" msgstr "'%q' argument requis" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -228,14 +224,14 @@ msgstr "'S' et 'O' ne sont pas des types de format supportés" msgid "'align' requires 1 argument" msgstr "'align' nécessite 1 argument" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "'async for' ou 'async with' sans fonction asynchrone extérieure" - #: py/compile.c msgid "'await' outside function" msgstr "'await' en dehors d'une fonction" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' en dehors d'une boucle" @@ -1377,10 +1373,6 @@ msgstr "Appuyez sur une touche pour entrer sur REPL ou CTRL-D pour recharger." msgid "Pull not used when direction is output." msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'." -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "PulseOut non pris en charge sur cette puce" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "Erreur RNG DeInit" @@ -1840,7 +1832,7 @@ msgstr "__init__() doit retourner None, pas '%s'" msgid "__new__ arg must be a user-type" msgstr "l'argument __new__ doit être d'un type défini par l'utilisateur" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "un objet 'bytes-like' est requis" @@ -3479,6 +3471,12 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "'async for' or 'async with' outside async function" +#~ msgstr "'async for' ou 'async with' sans fonction asynchrone extérieure" + +#~ msgid "PulseOut not supported on this chip" +#~ msgstr "PulseOut non pris en charge sur cette puce" + #~ msgid "PulseIn not supported on this chip" #~ msgstr "PulseIn non pris en charge sur cette puce" diff --git a/locale/it_IT.po b/locale/it_IT.po index 08958c29e1..2dbf994593 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-21 18:43-0700\n" +"POT-Creation-Date: 2020-07-24 19:58-0700\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -110,10 +110,6 @@ msgstr "%q() prende %d argomenti posizionali ma ne sono stati forniti %d" msgid "'%q' argument required" msgstr "'%q' argomento richiesto" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -218,14 +214,14 @@ msgstr "'S' e 'O' non sono formati supportati" msgid "'align' requires 1 argument" msgstr "'align' richiede 1 argomento" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "" - #: py/compile.c msgid "'await' outside function" msgstr "'await' al di fuori della funzione" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' al di fuori del ciclo" @@ -1365,10 +1361,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -1807,7 +1799,7 @@ msgstr "__init__() deve ritornare None, non '%s'" msgid "__new__ arg must be a user-type" msgstr "" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "un oggetto byte-like è richiesto" diff --git a/locale/ko.po b/locale/ko.po index 2bbd854a28..9b2dea98f9 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-21 18:43-0700\n" +"POT-Creation-Date: 2020-07-24 19:58-0700\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -110,10 +110,6 @@ msgstr "" msgid "'%q' argument required" msgstr "" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -218,14 +214,14 @@ msgstr "" msgid "'align' requires 1 argument" msgstr "'align' 에는 1 개의 독립변수가 필요합니다" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "" - #: py/compile.c msgid "'await' outside function" msgstr "'await' 는 펑크션 외부에 있습니다" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' 는 루프 외부에 있습니다" @@ -1338,10 +1334,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -1776,7 +1768,7 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 40100842b5..e09fc2b2de 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-21 18:43-0700\n" +"POT-Creation-Date: 2020-07-24 19:58-0700\n" "PO-Revision-Date: 2020-07-27 21:27+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -116,10 +116,6 @@ msgstr "%q() verwacht %d positionele argumenten maar kreeg %d" msgid "'%q' argument required" msgstr "'%q' argument vereist" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "'%q' object is niet bytes-achtig" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -224,14 +220,14 @@ msgstr "'S' and 'O' zijn niet ondersteunde format types" msgid "'align' requires 1 argument" msgstr "'align' vereist 1 argument" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "'async for' of 'async with' buiten async functie" - #: py/compile.c msgid "'await' outside function" msgstr "'await' buiten de functie" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' buiten de loop" @@ -1368,10 +1364,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull niet gebruikt wanneer de richting output is." -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "PulseOut niet ondersteund door deze chip" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG DeInit Fout" @@ -1826,7 +1818,7 @@ msgstr "__init __ () zou None moeten retouneren, niet '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ arg moet een user-type zijn" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "een bytes-achtig object is vereist" @@ -3446,6 +3438,15 @@ 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' object is not bytes-like" +#~ msgstr "'%q' object is niet bytes-achtig" + +#~ msgid "'async for' or 'async with' outside async function" +#~ msgstr "'async for' of 'async with' buiten async functie" + +#~ msgid "PulseOut not supported on this chip" +#~ msgstr "PulseOut niet ondersteund door deze chip" + #~ msgid "PulseIn not supported on this chip" #~ msgstr "PusleIn niet ondersteund door deze chip" diff --git a/locale/pl.po b/locale/pl.po index a5f1973fd0..43e1570966 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-21 18:43-0700\n" +"POT-Creation-Date: 2020-07-24 19:58-0700\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -110,10 +110,6 @@ msgstr "%q() bierze %d argumentów pozycyjnych, lecz podano %d" msgid "'%q' argument required" msgstr "'%q' wymaga argumentu" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -218,14 +214,14 @@ msgstr "typy formatowania 'S' oraz 'O' są niewspierane" msgid "'align' requires 1 argument" msgstr "'align' wymaga 1 argumentu" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "" - #: py/compile.c msgid "'await' outside function" msgstr "'await' poza funkcją" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' poza pętlą" @@ -1340,10 +1336,6 @@ msgstr "Dowolny klawisz aby uruchomić konsolę. CTRL-D aby przeładować." msgid "Pull not used when direction is output." msgstr "Podciągnięcie nieużywane w trybie wyjścia." -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -1780,7 +1772,7 @@ msgstr "__init__() powinien zwracać None, nie '%s'" msgid "__new__ arg must be a user-type" msgstr "Argument __new__ musi być typu użytkownika" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "wymagany obiekt typu bytes" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 76beb24584..d5a77064de 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-21 18:43-0700\n" +"POT-Creation-Date: 2020-07-24 19:58-0700\n" "PO-Revision-Date: 2020-07-27 21:27+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -116,10 +116,6 @@ msgstr "%q() recebe %d argumentos posicionais, porém %d foram informados" msgid "'%q' argument required" msgstr "'%q' argumento(s) requerido(s)" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "objetos '%q' não são bytes-like" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -226,14 +222,14 @@ msgstr "'S' e 'O' não são tipos de formato suportados" msgid "'align' requires 1 argument" msgstr "O 'align' exige 1 argumento" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "'assíncrono para' ou 'assíncrono com' função assíncrona externa" - #: py/compile.c msgid "'await' outside function" msgstr "'aguardar' fora da função" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' fora do loop" @@ -1376,10 +1372,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "O Pull não foi usado quando a direção for gerada." -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "O PulseOut não é compatível neste CI" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "Erro DeInit RNG" @@ -1839,7 +1831,7 @@ msgstr "O __init__() deve retornar Nenhum, não '%s'" msgid "__new__ arg must be a user-type" msgstr "O argumento __new__ deve ser um tipo usuário" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "é necessário objetos tipo bytes" @@ -3470,6 +3462,15 @@ 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' object is not bytes-like" +#~ msgstr "objetos '%q' não são bytes-like" + +#~ msgid "'async for' or 'async with' outside async function" +#~ msgstr "'assíncrono para' ou 'assíncrono com' função assíncrona externa" + +#~ msgid "PulseOut not supported on this chip" +#~ msgstr "O PulseOut não é compatível neste CI" + #~ msgid "PulseIn not supported on this chip" #~ msgstr "O PulseIn não é compatível neste CI" diff --git a/locale/sv.po b/locale/sv.po index f2788114d9..9d60245bb5 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-21 18:43-0700\n" +"POT-Creation-Date: 2020-07-24 19:58-0700\n" "PO-Revision-Date: 2020-07-25 20:58+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -116,10 +116,6 @@ msgstr "%q() kräver %d positionsargument men %d gavs" msgid "'%q' argument required" msgstr "'%q' argument krävs" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "%q-objektet är inte byte-lik" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -224,14 +220,14 @@ msgstr "'S' och 'O' stöds inte som formattyper" msgid "'align' requires 1 argument" msgstr "'align' kräver 1 argument" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "'async for' eller 'async with' utanför async-funktion" - #: py/compile.c msgid "'await' outside function" msgstr "'await' utanför funktion" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' utanför loop" @@ -1364,10 +1360,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull används inte när riktningen är output." -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "PulseIn stöds inte av detta chip" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG DeInit-fel" @@ -1819,7 +1811,7 @@ msgstr "__init __ () ska returnera None, inte '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ arg måste vara en användartyp" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "ett bytesliknande objekt krävs" @@ -3439,6 +3431,15 @@ 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' object is not bytes-like" +#~ msgstr "%q-objektet är inte byte-lik" + +#~ msgid "'async for' or 'async with' outside async function" +#~ msgstr "'async for' eller 'async with' utanför async-funktion" + +#~ msgid "PulseOut not supported on this chip" +#~ msgstr "PulseIn stöds inte av detta chip" + #~ msgid "PulseIn not supported on this chip" #~ msgstr "PulseIn stöds inte av detta chip" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 660d2249f8..2a9d07b29a 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-21 18:43-0700\n" +"POT-Creation-Date: 2020-07-24 19:58-0700\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -116,10 +116,6 @@ msgstr "%q() cǎiyòng %d wèizhì cānshù, dàn gěi chū %d" msgid "'%q' argument required" msgstr "xūyào '%q' cānshù" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -224,14 +220,14 @@ msgstr "'S' hé 'O' bù zhīchí géshì lèixíng" msgid "'align' requires 1 argument" msgstr "'align' xūyào 1 gè cānshù" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "" - #: py/compile.c msgid "'await' outside function" msgstr "'await' wàibù gōngnéng" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' wàibù xúnhuán" @@ -1354,10 +1350,6 @@ msgstr "Àn xià rènhé jiàn jìnrù REPL. Shǐyòng CTRL-D chóngxīn jiāzà msgid "Pull not used when direction is output." msgstr "Fāngxiàng shūchū shí Pull méiyǒu shǐyòng." -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG qǔxiāo chūshǐhuà cuòwù" @@ -1805,7 +1797,7 @@ msgstr "__Init__() yīnggāi fǎnhuí not, ér bùshì '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ cānshù bìxū shì yònghù lèixíng" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "xūyào yīgè zì jié lèi duìxiàng" From 887f6f3f23e4ee486f02fce90c0875d947a5292f Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Mon, 27 Jul 2020 23:58:13 +0000 Subject: [PATCH 0434/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (782 of 782 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index d5a77064de..d3e0275d73 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: 2020-07-24 19:58-0700\n" -"PO-Revision-Date: 2020-07-27 21:27+0000\n" +"PO-Revision-Date: 2020-07-28 15:41+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -229,6 +229,8 @@ msgstr "'aguardar' fora da função" #: py/compile.c msgid "'await', 'async for' or 'async with' outside async function" msgstr "" +"'await', 'async for' (async para) ou 'async with' (async com) estão fora da " +"função async" #: py/compile.c msgid "'break' outside loop" From 1b5f171081c34cb6e6f2e3f1c3db8f2f4985c574 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 29 Jul 2020 19:48:34 +0200 Subject: [PATCH 0435/1293] 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 | 126 +++++++++++++++++++++------------------ locale/cs.po | 126 +++++++++++++++++++++------------------ locale/de_DE.po | 126 +++++++++++++++++++++------------------ locale/es.po | 126 +++++++++++++++++++++------------------ locale/fil.po | 126 +++++++++++++++++++++------------------ locale/fr.po | 126 +++++++++++++++++++++------------------ locale/it_IT.po | 126 +++++++++++++++++++++------------------ locale/ko.po | 126 +++++++++++++++++++++------------------ locale/nl.po | 126 +++++++++++++++++++++------------------ locale/pl.po | 126 +++++++++++++++++++++------------------ locale/pt_BR.po | 126 +++++++++++++++++++++------------------ locale/sv.po | 126 +++++++++++++++++++++------------------ locale/zh_Latn_pinyin.po | 126 +++++++++++++++++++++------------------ 13 files changed, 897 insertions(+), 741 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 42ff9897f8..9a1d86d26f 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 19:58-0700\n" +"POT-Creation-Date: 2020-07-28 16:57-0500\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -790,7 +790,7 @@ msgstr "Diharapkan tuple dengan panjang %d, didapatkan %d" msgid "Extended advertisements with scan response not supported." msgstr "Penyebaran yang diperluas dengan respon pindai tidak didukung." -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "FFT didefinisikan hanya untuk ndarrays" @@ -1821,7 +1821,7 @@ msgstr "" msgid "addresses is empty" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "" @@ -1829,7 +1829,7 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "" @@ -1837,6 +1837,10 @@ msgstr "" msgid "argument has wrong type" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1846,7 +1850,7 @@ msgstr "argumen num/types tidak cocok" msgid "argument should be a '%q' not a '%q'" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "" @@ -1854,7 +1858,7 @@ msgstr "" msgid "array/bytes required on right side" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -1862,15 +1866,15 @@ msgstr "" msgid "attributes not supported yet" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "" @@ -2177,15 +2181,15 @@ msgstr "" msgid "conversion to object" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "" @@ -2193,7 +2197,7 @@ msgstr "" msgid "could not broadast input array from shape" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2201,15 +2205,15 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2238,7 +2242,7 @@ msgstr "" msgid "dict update sequence has wrong length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "" @@ -2341,11 +2345,11 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "" @@ -2353,7 +2357,7 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "" @@ -2365,7 +2369,7 @@ msgstr "" msgid "flattening order must be either 'C', or 'F'" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "" @@ -2398,11 +2402,11 @@ msgstr "fungsi diharapkan setidaknya %d argumen, hanya mendapatkan %d" msgid "function got multiple values for argument '%q'" msgstr "fungsi mendapatkan nilai ganda untuk argumen '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2488,7 +2492,7 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "" @@ -2496,35 +2500,35 @@ msgstr "" msgid "inline assembler must be a function" msgstr "inline assembler harus sebuah fungsi" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "" @@ -2536,7 +2540,7 @@ msgstr "" msgid "integer required" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "" @@ -2606,7 +2610,7 @@ msgstr "" msgid "iterables are not of the same length" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "" @@ -2670,11 +2674,11 @@ msgstr "" msgid "math domain error" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "" @@ -2701,7 +2705,7 @@ msgstr "" msgid "module not found" msgstr "modul tidak ditemukan" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "" @@ -2725,7 +2729,7 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "" @@ -2823,11 +2827,11 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -2899,12 +2903,12 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -2996,7 +3000,7 @@ msgstr "antrian meluap (overflow)" msgid "raw f-strings are not implemented" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" @@ -3069,7 +3073,7 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "" @@ -3093,19 +3097,19 @@ msgstr "" msgid "soft reboot\n" msgstr "memulai ulang software(soft reboot)\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3220,7 +3224,11 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -3348,6 +3356,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" @@ -3356,7 +3368,7 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "" @@ -3364,11 +3376,11 @@ msgstr "" msgid "wrong index type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3380,7 +3392,7 @@ msgstr "" msgid "wrong operand type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "" @@ -3400,15 +3412,15 @@ msgstr "" msgid "zero step" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 2e3eb5a787..195968e207 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 19:58-0700\n" +"POT-Creation-Date: 2020-07-28 16:57-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -776,7 +776,7 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "" @@ -1792,7 +1792,7 @@ msgstr "" msgid "addresses is empty" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "" @@ -1800,7 +1800,7 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "" @@ -1808,6 +1808,10 @@ msgstr "" msgid "argument has wrong type" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1817,7 +1821,7 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "" @@ -1825,7 +1829,7 @@ msgstr "" msgid "array/bytes required on right side" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -1833,15 +1837,15 @@ msgstr "" msgid "attributes not supported yet" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "" @@ -2147,15 +2151,15 @@ msgstr "" msgid "conversion to object" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "" @@ -2163,7 +2167,7 @@ msgstr "" msgid "could not broadast input array from shape" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2171,15 +2175,15 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2208,7 +2212,7 @@ msgstr "" msgid "dict update sequence has wrong length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "" @@ -2311,11 +2315,11 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "" @@ -2323,7 +2327,7 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "" @@ -2335,7 +2339,7 @@ msgstr "" msgid "flattening order must be either 'C', or 'F'" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "" @@ -2368,11 +2372,11 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2458,7 +2462,7 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "" @@ -2466,35 +2470,35 @@ msgstr "" msgid "inline assembler must be a function" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "" @@ -2506,7 +2510,7 @@ msgstr "" msgid "integer required" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "" @@ -2576,7 +2580,7 @@ msgstr "" msgid "iterables are not of the same length" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "" @@ -2640,11 +2644,11 @@ msgstr "" msgid "math domain error" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "" @@ -2671,7 +2675,7 @@ msgstr "" msgid "module not found" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "" @@ -2695,7 +2699,7 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "" @@ -2793,11 +2797,11 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -2868,12 +2872,12 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -2965,7 +2969,7 @@ msgstr "" msgid "raw f-strings are not implemented" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" @@ -3038,7 +3042,7 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "" @@ -3062,19 +3066,19 @@ msgstr "" msgid "soft reboot\n" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3188,7 +3192,11 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -3316,6 +3324,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" @@ -3324,7 +3336,7 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "" @@ -3332,11 +3344,11 @@ msgstr "" msgid "wrong index type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3348,7 +3360,7 @@ msgstr "" msgid "wrong operand type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "" @@ -3368,14 +3380,14 @@ msgstr "" msgid "zero step" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index ff6d78bb6f..8ba5e4bd3b 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 19:58-0700\n" +"POT-Creation-Date: 2020-07-28 16:57-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -787,7 +787,7 @@ msgid "Extended advertisements with scan response not supported." msgstr "" "Erweiterte Werbung (advertising) mit Scanantwort wird nicht unterstützt." -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "FFT ist nur für ndarrays definiert" @@ -1849,7 +1849,7 @@ msgstr "Adresse außerhalb der Grenzen" msgid "addresses is empty" msgstr "adresses ist leer" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "arctan2 ist nur für Skalare und ndarrays implementiert" @@ -1857,7 +1857,7 @@ msgstr "arctan2 ist nur für Skalare und ndarrays implementiert" msgid "arg is an empty sequence" msgstr "arg ist eine leere Sequenz" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "Das Argument argsort muss ein ndarray sein" @@ -1865,6 +1865,10 @@ msgstr "Das Argument argsort muss ein ndarray sein" msgid "argument has wrong type" msgstr "Argument hat falschen Typ" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1874,7 +1878,7 @@ msgstr "Anzahl/Type der Argumente passen nicht" msgid "argument should be a '%q' not a '%q'" msgstr "Argument sollte '%q' sein, nicht '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "Argumente müssen ndarrays sein" @@ -1882,7 +1886,7 @@ msgstr "Argumente müssen ndarrays sein" msgid "array/bytes required on right side" msgstr "Array/Bytes auf der rechten Seite erforderlich" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "Sie haben versucht argmin/argmax von einer leeren Sequenz zu bekommen" @@ -1890,15 +1894,15 @@ msgstr "Sie haben versucht argmin/argmax von einer leeren Sequenz zu bekommen" msgid "attributes not supported yet" msgstr "Attribute werden noch nicht unterstützt" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "Die Achse muss -1, 0, Keine oder 1 sein" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "Die Achse muss -1, 0 oder 1 sein" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "Die Achse muss None, 0 oder 1 sein" @@ -2215,15 +2219,15 @@ msgstr "constant muss ein integer sein" msgid "conversion to object" msgstr "Umwandlung zu Objekt" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "Convolve-Argumente müssen lineare Arrays sein" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "Convolve-Argumente müssen ndarrays sein" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "Convolve Argumente dürfen nicht leer sein" @@ -2231,7 +2235,7 @@ msgstr "Convolve Argumente dürfen nicht leer sein" msgid "could not broadast input array from shape" msgstr "Eingabearray konnte nicht aus der Form übertragen werden" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "Vandermonde-Matrix konnte nicht invertiert werden" @@ -2239,15 +2243,15 @@ msgstr "Vandermonde-Matrix konnte nicht invertiert werden" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "ddof muss kleiner als die Länge des Datensatzes sein" @@ -2278,7 +2282,7 @@ msgstr "destination_length muss ein int >= 0 sein" msgid "dict update sequence has wrong length" msgstr "Die Wörterbuch-Aktualisierungssequenz hat eine falsche Länge" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "diff Argument muss ein ndarray sein" @@ -2381,11 +2385,11 @@ msgstr "Die Datei muss eine im Byte-Modus geöffnete Datei sein" msgid "filesystem must provide mount method" msgstr "Das Dateisystem muss eine Mount-Methode bereitstellen" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "" @@ -2393,7 +2397,7 @@ msgstr "" msgid "first argument must be an iterable" msgstr "Das erste Argument muss iterierbar sein" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "Das erste Argument muss ein Ndarray sein" @@ -2405,7 +2409,7 @@ msgstr "Das erste Argument für super() muss type sein" msgid "flattening order must be either 'C', or 'F'" msgstr "Die Abflachungsreihenfolge muss entweder \"C\" oder \"F\" sein" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "Das Flip-Argument muss ein Ndarray sein" @@ -2438,11 +2442,11 @@ msgstr "Funktion erwartet maximal %d Argumente, aber hat %d erhalten" msgid "function got multiple values for argument '%q'" msgstr "Funktion hat mehrere Werte für Argument '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "Die Funktion ist nur für Skalare und Ndarrays implementiert" @@ -2529,7 +2533,7 @@ msgstr "Indizes müssen Integer sein" msgid "indices must be integers, slices, or Boolean lists" msgstr "Indizes müssen Integer, Slices oder Boolesche Listen sein" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "" @@ -2537,35 +2541,35 @@ msgstr "" msgid "inline assembler must be a function" msgstr "inline assembler muss eine function sein" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "Das Eingabeargument muss eine Ganzzahl oder ein 2-Tupel sein" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "Die Länge des Eingabearrays muss eine Potenz von 2 sein" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "Eingabedaten müssen iterierbar sein" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "Eingabematrix ist asymmetrisch" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "Eingabematrix ist singulär" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "Die Eingabe muss eine quadratische Matrix sein" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "Die Eingabe muss Tupel, Liste, Bereich oder Ndarray sein" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "Eingabevektoren müssen gleich lang sein" @@ -2577,7 +2581,7 @@ msgstr "int() arg 2 muss >= 2 und <= 36 sein" msgid "integer required" msgstr "integer erforderlich" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "" @@ -2647,7 +2651,7 @@ msgstr "issubclass() arg 2 muss eine Klasse oder ein Tupel von Klassen sein" msgid "iterables are not of the same length" msgstr "iterables sind nicht gleich lang" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "Iterationen sind nicht konvergiert (converged)" @@ -2717,11 +2721,11 @@ msgstr "map buffer zu klein" msgid "math domain error" msgstr "Mathe-Domain-Fehler" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "Matrix Dimensionen stimmen nicht überein" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "Matrix ist nicht positiv definitiv" @@ -2748,7 +2752,7 @@ msgstr "Speicherzuweisung fehlgeschlagen, der Heap ist gesperrt" msgid "module not found" msgstr "Modul nicht gefunden" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "mehr Freiheitsgrade als Datenpunkte" @@ -2772,7 +2776,7 @@ msgstr "muss ein Objekt verursachen (raise)" msgid "must use keyword argument for key function" msgstr "muss Schlüsselwortargument für key function verwenden" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "n muss zwischen 0 und 9 liegen" @@ -2871,11 +2875,11 @@ msgstr "" msgid "not enough arguments for format string" msgstr "Nicht genügend Argumente für den Formatierungs-String" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "Die Anzahl der Argumente muss 2 oder 3 sein" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "Die Anzahl der Punkte muss mindestens 2 betragen" @@ -2947,12 +2951,12 @@ msgid "only slices with step=1 (aka None) are supported" msgstr "" "Es werden nur Slices mit Schritt = 1 (auch bekannt als None) unterstützt" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "Operanden konnten nicht zusammen gesendet werden" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "Die Operation ist für ndarrays nicht implementiert" @@ -3046,7 +3050,7 @@ msgstr "Warteschlangenüberlauf" msgid "raw f-strings are not implemented" msgstr "rohe F-Strings sind nicht implementiert" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "Real- und Imaginärteile müssen gleich lang sein" @@ -3121,7 +3125,7 @@ msgstr "Vorzeichen mit ganzzahligem Formatbezeichner 'c' nicht erlaubt" msgid "single '}' encountered in format string" msgstr "einzelne '}' in Formatierungs-String gefunden" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "Größe ist nur für ndarrays definiert" @@ -3145,19 +3149,19 @@ msgstr "small int Überlauf" msgid "soft reboot\n" msgstr "weicher reboot\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "sortierungs Argument muss ein ndarray sein" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3272,7 +3276,11 @@ msgstr "zu viele Indizes" msgid "too many values to unpack (expected %d)" msgstr "zu viele Werte zum Auspacken (erwartet %d)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "Tupelindex außerhalb des Bereichs" @@ -3404,6 +3412,10 @@ msgstr "Wert muss in %d Byte(s) passen" msgid "value_count must be > 0" msgstr "value_count muss größer als 0 sein" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" @@ -3412,7 +3424,7 @@ msgstr "" msgid "window must be <= interval" msgstr "Fenster muss <= Intervall sein" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "falscher Argumenttyp" @@ -3420,11 +3432,11 @@ msgstr "falscher Argumenttyp" msgid "wrong index type" msgstr "falscher Indextyp" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "falsche Anzahl an Argumenten" @@ -3436,7 +3448,7 @@ msgstr "falsche Anzahl zu entpackender Werte" msgid "wrong operand type" msgstr "falscher Operandentyp" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "" @@ -3456,15 +3468,15 @@ msgstr "y Wert außerhalb der Grenzen" msgid "zero step" msgstr "Nullschritt" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" diff --git a/locale/es.po b/locale/es.po index 72632ab6e4..1294473af7 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 19:58-0700\n" +"POT-Creation-Date: 2020-07-28 16:57-0500\n" "PO-Revision-Date: 2020-07-24 21:12+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -791,7 +791,7 @@ msgstr "Se esperaba un tuple de %d, se obtuvo %d" msgid "Extended advertisements with scan response not supported." msgstr "No se admiten anuncios extendidos con respuesta de escaneo." -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "FFT se define solo para ndarrays" @@ -1846,7 +1846,7 @@ msgstr "address fuera de límites" msgid "addresses is empty" msgstr "addresses esta vacío" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "arctan2 se encuentra implementado solo para escalares y ndarrays" @@ -1854,7 +1854,7 @@ msgstr "arctan2 se encuentra implementado solo para escalares y ndarrays" msgid "arg is an empty sequence" msgstr "argumento es una secuencia vacía" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "El argumento para argsort debe ser un ndarray" @@ -1862,6 +1862,10 @@ msgstr "El argumento para argsort debe ser un ndarray" msgid "argument has wrong type" msgstr "el argumento tiene un tipo erroneo" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1871,7 +1875,7 @@ msgstr "argumento número/tipos no coinciden" msgid "argument should be a '%q' not a '%q'" msgstr "argumento deberia ser un '%q' no un '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "argumentos deben ser ndarrays" @@ -1879,7 +1883,7 @@ msgstr "argumentos deben ser ndarrays" msgid "array/bytes required on right side" msgstr "array/bytes requeridos en el lado derecho" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "se trató de traer argmin/argmax de una secuencia vacía" @@ -1887,15 +1891,15 @@ msgstr "se trató de traer argmin/argmax de una secuencia vacía" msgid "attributes not supported yet" msgstr "atributos aún no soportados" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "eje debe ser -1, 0, None o 1" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "eje debe ser -1, 0, o 1" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "eje debe ser None, 0, o 1" @@ -2206,15 +2210,15 @@ msgstr "constant debe ser un entero" msgid "conversion to object" msgstr "conversión a objeto" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "los argumentos para convolve deben ser arreglos lineares" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "los argumentos para convolve deben ser ndarrays" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "los argumentos para convolve no deben estar vacíos" @@ -2222,7 +2226,7 @@ msgstr "los argumentos para convolve no deben estar vacíos" msgid "could not broadast input array from shape" msgstr "no se pudo anunciar la matriz de entrada desde la forma" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "no se pudo invertir la matriz de Vandermonde" @@ -2230,15 +2234,15 @@ msgstr "no se pudo invertir la matriz de Vandermonde" msgid "couldn't determine SD card version" msgstr "no se pudo determinar la versión de la tarjeta SD" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "los datos deben permitir iteración" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "los datos deben ser de igual tamaño" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "ddof debe ser menor que la longitud del conjunto de datos" @@ -2269,7 +2273,7 @@ msgstr "destination_length debe ser un int >= 0" msgid "dict update sequence has wrong length" msgstr "la secuencia de actualizacion del dict tiene una longitud incorrecta" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "El argumento diff debe ser un ndarray" @@ -2372,11 +2376,11 @@ msgstr "el archivo deberia ser una archivo abierto en modo byte" msgid "filesystem must provide mount method" msgstr "sistema de archivos debe proporcionar método de montaje" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "se debe poder llamar al primer argumento" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "el primer argumento debe ser una función" @@ -2384,7 +2388,7 @@ msgstr "el primer argumento debe ser una función" msgid "first argument must be an iterable" msgstr "el primer argumento debe permitir iteración" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "el primer argumento debe ser ndarray" @@ -2396,7 +2400,7 @@ msgstr "primer argumento para super() debe ser de tipo" msgid "flattening order must be either 'C', or 'F'" msgstr "el orden de aplanamiento debe ser 'C' o 'F'" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "el argumento invertido debe ser un ndarray" @@ -2429,11 +2433,11 @@ msgstr "la función esperaba minimo %d argumentos, tiene %d" msgid "function got multiple values for argument '%q'" msgstr "la función tiene múltiples valores para el argumento '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "la función tiene el mismo signo a extremos del intervalo" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "la función está implementada solo para escalares y ndarrays" @@ -2519,7 +2523,7 @@ msgstr "indices deben ser enteros" msgid "indices must be integers, slices, or Boolean lists" msgstr "los índices deben ser enteros, particiones o listas de booleanos" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "los valores iniciales deben permitir iteración" @@ -2527,35 +2531,35 @@ msgstr "los valores iniciales deben permitir iteración" msgid "inline assembler must be a function" msgstr "ensamblador en línea debe ser una función" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "el argumento de entrada debe ser un entero o una tupla de par" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "el tamaño del arreglo de entrada debe ser potencia de 2" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "los datos de entrada deben permitir iteración" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "la matriz de entrada es asimétrica" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "la matriz de entrada es singular" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "la entrada debe ser una matriz cuadrada" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "la entrada debe ser una tupla, lista, rango o ndarray" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "los vectores de entrada deben ser de igual tamaño" @@ -2567,7 +2571,7 @@ msgstr "int() arg 2 debe ser >= 2 y <= 36" msgid "integer required" msgstr "Entero requerido" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "interp está definido para arreglos de 1D del mismo tamaño" @@ -2637,7 +2641,7 @@ msgstr "issubclass() arg 2 debe ser una clase o tuple de clases" msgid "iterables are not of the same length" msgstr "los iterables no son del mismo tamaño" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "las iteraciones no convergen" @@ -2704,11 +2708,11 @@ msgstr "map buffer muy pequeño" msgid "math domain error" msgstr "error de dominio matemático" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "las dimensiones de la matriz no coinciden" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "matrix no es definida positiva" @@ -2735,7 +2739,7 @@ msgstr "la asignación de memoria falló, el heap está bloqueado" msgid "module not found" msgstr "módulo no encontrado" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "más grados de libertad que los puntos de datos" @@ -2759,7 +2763,7 @@ msgstr "debe hacer un raise de un objeto" msgid "must use keyword argument for key function" msgstr "debe utilizar argumento de palabra clave para la función clave" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "n debe estar entre 0 y 9" @@ -2860,11 +2864,11 @@ msgstr "" msgid "not enough arguments for format string" msgstr "no suficientes argumentos para format string" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "el número de argumentos debe ser 2 o 3" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "el número de puntos debe ser al menos 2" @@ -2935,12 +2939,12 @@ msgstr "solo se admite sample_rate=16000" msgid "only slices with step=1 (aka None) are supported" msgstr "solo se admiten segmentos con step=1 (alias None)" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "los operandos no se pueden transmitir juntos" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "la operación no está implementada para ndarrays" @@ -3032,7 +3036,7 @@ msgstr "desbordamiento de cola(queue)" msgid "raw f-strings are not implemented" msgstr "no está implementado cadenas-f sin procesar" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "las partes reales e imaginarias deben ser de igual longitud" @@ -3107,7 +3111,7 @@ msgstr "signo no permitido con el especificador integer format 'c'" msgid "single '}' encountered in format string" msgstr "un solo '}' encontrado en format string" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "el tamaño se define solo para ndarrays" @@ -3131,19 +3135,19 @@ msgstr "pequeño int desbordamiento" msgid "soft reboot\n" msgstr "reinicio suave\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "argumento de ordenado debe ser un ndarray" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "el arreglo sos debe de forma (n_section, 6)" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "sos[:, 3] deberían ser todos unos" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "sosfilt requiere argumentos iterables" @@ -3258,7 +3262,11 @@ msgstr "demasiados índices" msgid "too many values to unpack (expected %d)" msgstr "demasiados valores para descomprimir (%d esperado)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "tuple index fuera de rango" @@ -3386,6 +3394,10 @@ msgstr "el valor debe caber en %d byte(s)" msgid "value_count must be > 0" msgstr "value_count debe ser > 0" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: 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" @@ -3394,7 +3406,7 @@ msgstr "el tiempo de espera del perro guardián debe ser mayor a 0" msgid "window must be <= interval" msgstr "la ventana debe ser <= intervalo" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "tipo de argumento incorrecto" @@ -3402,11 +3414,11 @@ msgstr "tipo de argumento incorrecto" msgid "wrong index type" msgstr "tipo de índice incorrecto" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "tipo de entrada incorrecta" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "numero erroneo de argumentos" @@ -3418,7 +3430,7 @@ msgstr "numero erroneo de valores a descomprimir" msgid "wrong operand type" msgstr "tipo de operando incorrecto" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "tipo de salida incorrecta" @@ -3438,15 +3450,15 @@ msgstr "valor y fuera de límites" msgid "zero step" msgstr "paso cero" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "zi debe ser un ndarray" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "zi debe ser de tipo flotante" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "zi debe ser una forma (n_section,2)" diff --git a/locale/fil.po b/locale/fil.po index 566b24783f..07c8d270e0 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 19:58-0700\n" +"POT-Creation-Date: 2020-07-28 16:57-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -782,7 +782,7 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "" @@ -1817,7 +1817,7 @@ msgstr "wala sa sakop ang address" msgid "addresses is empty" msgstr "walang laman ang address" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "" @@ -1825,7 +1825,7 @@ msgstr "" msgid "arg is an empty sequence" msgstr "arg ay walang laman na sequence" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "" @@ -1833,6 +1833,10 @@ msgstr "" msgid "argument has wrong type" msgstr "may maling type ang argument" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1842,7 +1846,7 @@ msgstr "hindi tugma ang argument num/types" msgid "argument should be a '%q' not a '%q'" msgstr "argument ay dapat na '%q' hindi '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "" @@ -1850,7 +1854,7 @@ msgstr "" msgid "array/bytes required on right side" msgstr "array/bytes kinakailangan sa kanang bahagi" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -1858,15 +1862,15 @@ msgstr "" msgid "attributes not supported yet" msgstr "attributes hindi sinusuportahan" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "" @@ -2179,15 +2183,15 @@ msgstr "constant ay dapat na integer" msgid "conversion to object" msgstr "kombersyon to object" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "" @@ -2195,7 +2199,7 @@ msgstr "" msgid "could not broadast input array from shape" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2203,15 +2207,15 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2244,7 +2248,7 @@ msgstr "ang destination_length ay dapat na isang int >= 0" msgid "dict update sequence has wrong length" msgstr "may mali sa haba ng dict update sequence" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "" @@ -2348,11 +2352,11 @@ msgstr "file ay dapat buksan sa byte mode" msgid "filesystem must provide mount method" msgstr "ang filesystem dapat mag bigay ng mount method" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "" @@ -2360,7 +2364,7 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "" @@ -2372,7 +2376,7 @@ msgstr "unang argument ng super() ay dapat type" msgid "flattening order must be either 'C', or 'F'" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "" @@ -2405,11 +2409,11 @@ msgstr "function na inaasahang %d ang argumento, ngunit %d ang nakuha" msgid "function got multiple values for argument '%q'" msgstr "ang function ay nakakuha ng maraming values para sa argument '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2496,7 +2500,7 @@ msgstr "ang mga indeks ay dapat na integer" msgid "indices must be integers, slices, or Boolean lists" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "" @@ -2504,35 +2508,35 @@ msgstr "" msgid "inline assembler must be a function" msgstr "inline assembler ay dapat na function" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "" @@ -2544,7 +2548,7 @@ msgstr "int() arg 2 ay dapat >=2 at <= 36" msgid "integer required" msgstr "kailangan ng int" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "" @@ -2614,7 +2618,7 @@ msgstr "issubclass() arg 2 ay dapat na class o tuple ng classes" msgid "iterables are not of the same length" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "" @@ -2682,11 +2686,11 @@ msgstr "masyadong maliit ang buffer map" msgid "math domain error" msgstr "may pagkakamali sa math domain" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "" @@ -2713,7 +2717,7 @@ msgstr "abigo ang paglalaan ng memorya, ang heap ay naka-lock" msgid "module not found" msgstr "module hindi nakita" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "" @@ -2737,7 +2741,7 @@ msgstr "dapat itaas ang isang object" msgid "must use keyword argument for key function" msgstr "dapat gumamit ng keyword argument para sa key function" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "" @@ -2835,11 +2839,11 @@ msgstr "hindi lahat ng arguments na i-convert habang string formatting" msgid "not enough arguments for format string" msgstr "kulang sa arguments para sa format string" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -2911,12 +2915,12 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "ang mga slices lamang na may hakbang = 1 (aka None) ang sinusuportahan" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3009,7 +3013,7 @@ msgstr "puno na ang pila (overflow)" msgid "raw f-strings are not implemented" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" @@ -3084,7 +3088,7 @@ msgstr "sign hindi maari sa integer format specifier 'c'" msgid "single '}' encountered in format string" msgstr "isang '}' nasalubong sa format string" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "" @@ -3108,19 +3112,19 @@ msgstr "small int overflow" msgid "soft reboot\n" msgstr "malambot na reboot\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3236,7 +3240,11 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "masyadong maraming values para i-unpact (umaasa ng %d)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "indeks ng tuple wala sa sakop" @@ -3364,6 +3372,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" @@ -3372,7 +3384,7 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "" @@ -3380,11 +3392,11 @@ msgstr "" msgid "wrong index type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "mali ang bilang ng argumento" @@ -3396,7 +3408,7 @@ msgstr "maling number ng value na i-unpack" msgid "wrong operand type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "" @@ -3418,15 +3430,15 @@ msgstr "wala sa sakop ang address" msgid "zero step" msgstr "zero step" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 291bd2990a..f164501055 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 19:58-0700\n" +"POT-Creation-Date: 2020-07-28 16:57-0500\n" "PO-Revision-Date: 2020-07-27 21:27+0000\n" "Last-Translator: Nathan \n" "Language: fr\n" @@ -795,7 +795,7 @@ msgid "Extended advertisements with scan response not supported." msgstr "" "Les publicités étendues avec réponse d'analyse ne sont pas prises en charge." -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "La FFT est définie pour les ndarrays uniquement" @@ -1853,7 +1853,7 @@ msgstr "adresse hors limites" msgid "addresses is empty" msgstr "adresses vides" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "arctan2 est implémenté uniquement pour les scalaires et les ndarrays" @@ -1861,7 +1861,7 @@ msgstr "arctan2 est implémenté uniquement pour les scalaires et les ndarrays" msgid "arg is an empty sequence" msgstr "l'argument est une séquence vide" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "L'argument argsort doit être un ndarray" @@ -1869,6 +1869,10 @@ msgstr "L'argument argsort doit être un ndarray" msgid "argument has wrong type" msgstr "l'argument est d'un mauvais type" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1878,7 +1882,7 @@ msgstr "argument num/types ne correspond pas" msgid "argument should be a '%q' not a '%q'" msgstr "l'argument devrait être un(e) '%q', pas '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "les arguments doivent être des ndarrays" @@ -1886,7 +1890,7 @@ msgstr "les arguments doivent être des ndarrays" msgid "array/bytes required on right side" msgstr "tableau/octets requis à droite" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "tenter d'obtenir argmin / argmax d'une séquence vide" @@ -1894,15 +1898,15 @@ msgstr "tenter d'obtenir argmin / argmax d'une séquence vide" msgid "attributes not supported yet" msgstr "attribut pas encore supporté" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "l'axe doit être -1, 0, None ou 1" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "l'axe doit être -1, 0 ou 1" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "l'axe doit être None, 0 ou 1" @@ -2220,15 +2224,15 @@ msgstr "constante doit être un entier" msgid "conversion to object" msgstr "conversion en objet" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "les arguments convolve doivent être des tableaux linéaires" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "les arguments convolve doivent être des ndarrays" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "les arguments convolve ne doivent pas être vides" @@ -2236,7 +2240,7 @@ msgstr "les arguments convolve ne doivent pas être vides" msgid "could not broadast input array from shape" msgstr "n'a pas pu diffuser le tableau d'entrée à partir de la forme" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "n'a pas pu inverser la matrice Vandermonde" @@ -2244,15 +2248,15 @@ msgstr "n'a pas pu inverser la matrice Vandermonde" msgid "couldn't determine SD card version" msgstr "impossible de déterminer la version de la carte SD" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "les données doivent être les objets iterables" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "les données doivent être de longueur égale" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "ddof doit être inférieur à la longueur de l'ensemble de données" @@ -2283,7 +2287,7 @@ msgstr "destination_length doit être un entier >= 0" msgid "dict update sequence has wrong length" msgstr "la séquence de mise à jour de dict a une mauvaise longueur" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "l'argument diff doit être un ndarray" @@ -2388,11 +2392,11 @@ msgstr "le fichier doit être un fichier ouvert en mode 'byte'" msgid "filesystem must provide mount method" msgstr "le system de fichier doit fournir une méthode 'mount'" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "le premier argument doit être un appelable" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "le premier argument doit être une fonction" @@ -2400,7 +2404,7 @@ msgstr "le premier argument doit être une fonction" msgid "first argument must be an iterable" msgstr "le premier argument doit être un itérable" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "le premier argument doit être un ndarray" @@ -2412,7 +2416,7 @@ msgstr "le premier argument de super() doit être un type" msgid "flattening order must be either 'C', or 'F'" msgstr "l'ordre d'aplatissement doit être «C» ou «F»" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "l'argument flip doit être un ndarray" @@ -2445,11 +2449,11 @@ msgstr "la fonction attendait au plus %d arguments, reçu %d" msgid "function got multiple values for argument '%q'" msgstr "la fonction a reçu plusieurs valeurs pour l'argument '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.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" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" "la fonction est implémentée pour les scalaires et les ndarrays uniquement" @@ -2537,7 +2541,7 @@ msgid "indices must be integers, slices, or Boolean lists" msgstr "" "les indices doivent être des entiers, des tranches ou des listes booléennes" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "les valeurs initiales doivent être itérables" @@ -2545,35 +2549,35 @@ msgstr "les valeurs initiales doivent être itérables" msgid "inline assembler must be a function" msgstr "l'assembleur doit être une fonction" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "l'argument d'entrée doit être un entier ou un tuple 2" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "la longueur du tableau d'entrée doit être une puissance de 2" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "les données d'entrée doivent être un itérable" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "la matrice d'entrée est asymétrique" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "la matrice d'entrée est singulière" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "l'entrée doit être une matrice carrée" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "l'entrée doit être tuple, list, range ou ndarray" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "les vecteurs d'entrée doivent être de longueur égale" @@ -2585,7 +2589,7 @@ msgstr "l'argument 2 de int() doit être >=2 et <=36" msgid "integer required" msgstr "entier requis" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "interp est défini pour les tableaux 1D de longueur égale" @@ -2656,7 +2660,7 @@ msgstr "" msgid "iterables are not of the same length" msgstr "les itérables ne sont pas de la même longueur" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "les itérations n'ont pas convergé" @@ -2723,11 +2727,11 @@ msgstr "tampon trop petit" msgid "math domain error" msgstr "erreur de domaine math" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "les dimensions de la matrice ne correspondent pas" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "la matrice n'est pas définie positive" @@ -2754,7 +2758,7 @@ msgstr "l'allocation de mémoire a échoué, le tas est vérrouillé" msgid "module not found" msgstr "module introuvable" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "plus de degrés de liberté que de points de données" @@ -2778,7 +2782,7 @@ msgstr "doit lever un objet" msgid "must use keyword argument for key function" msgstr "doit utiliser un argument nommé pour une fonction key" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "n doit être compris entre 0 et 9" @@ -2878,11 +2882,11 @@ msgstr "" msgid "not enough arguments for format string" msgstr "pas assez d'arguments pour la chaîne de format" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "le nombre d'arguments doit être 2 ou 3" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "le nombre de points doit être d'au moins 2" @@ -2953,12 +2957,12 @@ msgstr "seul sample_rate = 16000 est pris en charge" msgid "only slices with step=1 (aka None) are supported" msgstr "seules les tranches avec 'step=1' (cad None) sont supportées" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "les opérandes ne pouvaient pas être diffusés ensemble" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "l'opération n'est pas implémentée sur les ndarrays" @@ -3053,7 +3057,7 @@ msgstr "dépassement de file" msgid "raw f-strings are not implemented" msgstr "les chaînes f brutes ne sont pas implémentées" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "les parties réelles et imaginaires doivent être de longueur égale" @@ -3128,7 +3132,7 @@ msgstr "signe non autorisé avec la spéc. de format d'entier 'c'" msgid "single '}' encountered in format string" msgstr "'}' seule rencontrée dans une chaîne de format" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "la taille est définie pour les ndarrays uniquement" @@ -3152,19 +3156,19 @@ msgstr "dépassement de capacité d'un entier court" msgid "soft reboot\n" msgstr "redémarrage logiciel\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "l'argument de «sort» doit être un ndarray" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3279,7 +3283,11 @@ msgstr "trop d'indices" msgid "too many values to unpack (expected %d)" msgstr "trop de valeur à dégrouper (%d attendues)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "index du tuple hors gamme" @@ -3407,6 +3415,10 @@ msgstr "la valeur doit tenir dans %d octet(s)" msgid "value_count must be > 0" msgstr "'value_count' doit être > 0" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "watchdog timeout doit être supérieur à 0" @@ -3415,7 +3427,7 @@ msgstr "watchdog timeout doit être supérieur à 0" msgid "window must be <= interval" msgstr "la fenêtre doit être <= intervalle" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "type d'argument incorrect" @@ -3423,11 +3435,11 @@ msgstr "type d'argument incorrect" msgid "wrong index type" msgstr "type d'index incorrect" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "type d'entrée incorrect" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "mauvais nombres d'arguments" @@ -3439,7 +3451,7 @@ msgstr "mauvais nombre de valeurs à dégrouper" msgid "wrong operand type" msgstr "type d'opérande incorrect" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "type de sortie incorrect" @@ -3459,15 +3471,15 @@ msgstr "valeur y hors limites" msgid "zero step" msgstr "'step' nul" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 2dbf994593..3862d382f2 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 19:58-0700\n" +"POT-Creation-Date: 2020-07-28 16:57-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -782,7 +782,7 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "" @@ -1820,7 +1820,7 @@ msgstr "indirizzo fuori limite" msgid "addresses is empty" msgstr "gli indirizzi sono vuoti" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "" @@ -1828,7 +1828,7 @@ msgstr "" msgid "arg is an empty sequence" msgstr "l'argomento è una sequenza vuota" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "" @@ -1836,6 +1836,10 @@ msgstr "" msgid "argument has wrong type" msgstr "il tipo dell'argomento è errato" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1845,7 +1849,7 @@ msgstr "discrepanza di numero/tipo di argomenti" msgid "argument should be a '%q' not a '%q'" msgstr "l'argomento dovrebbe essere un '%q' e non un '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "" @@ -1853,7 +1857,7 @@ msgstr "" msgid "array/bytes required on right side" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -1861,15 +1865,15 @@ msgstr "" msgid "attributes not supported yet" msgstr "attributi non ancora supportati" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "" @@ -2181,15 +2185,15 @@ msgstr "la costante deve essere un intero" msgid "conversion to object" msgstr "conversione in oggetto" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "" @@ -2197,7 +2201,7 @@ msgstr "" msgid "could not broadast input array from shape" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2205,15 +2209,15 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2245,7 +2249,7 @@ msgstr "destination_length deve essere un int >= 0" msgid "dict update sequence has wrong length" msgstr "sequanza di aggiornamento del dizionario ha la lunghezza errata" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "" @@ -2349,11 +2353,11 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "il filesystem deve fornire un metodo di mount" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "" @@ -2361,7 +2365,7 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "" @@ -2373,7 +2377,7 @@ msgstr "" msgid "flattening order must be either 'C', or 'F'" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "" @@ -2406,11 +2410,11 @@ msgstr "la funzione prevede al massimo %d argmoneti, ma ne ha ricevuti %d" msgid "function got multiple values for argument '%q'" msgstr "la funzione ha ricevuto valori multipli per l'argomento '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2497,7 +2501,7 @@ msgstr "gli indici devono essere interi" msgid "indices must be integers, slices, or Boolean lists" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "" @@ -2505,35 +2509,35 @@ msgstr "" msgid "inline assembler must be a function" msgstr "inline assembler deve essere una funzione" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "" @@ -2545,7 +2549,7 @@ msgstr "il secondo argomanto di int() deve essere >= 2 e <= 36" msgid "integer required" msgstr "intero richiesto" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "" @@ -2617,7 +2621,7 @@ msgstr "" msgid "iterables are not of the same length" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "" @@ -2684,11 +2688,11 @@ msgstr "map buffer troppo piccolo" msgid "math domain error" msgstr "errore di dominio matematico" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "" @@ -2715,7 +2719,7 @@ msgstr "allocazione di memoria fallita, l'heap è bloccato" msgid "module not found" msgstr "modulo non trovato" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "" @@ -2739,7 +2743,7 @@ msgstr "deve lanciare un oggetto" msgid "must use keyword argument for key function" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "" @@ -2840,11 +2844,11 @@ msgstr "" msgid "not enough arguments for format string" msgstr "argomenti non sufficienti per la stringa di formattazione" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -2916,12 +2920,12 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "solo slice con step=1 (aka None) sono supportate" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3016,7 +3020,7 @@ msgstr "overflow della coda" msgid "raw f-strings are not implemented" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" @@ -3091,7 +3095,7 @@ msgstr "segno non permesso nello spcificatore di formato 'c' della stringa" msgid "single '}' encountered in format string" msgstr "'}' singolo presente nella stringa di formattazione" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "" @@ -3115,19 +3119,19 @@ msgstr "small int overflow" msgid "soft reboot\n" msgstr "soft reboot\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3243,7 +3247,11 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "troppi valori da scompattare (%d attesi)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "indice della tupla fuori intervallo" @@ -3371,6 +3379,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" @@ -3379,7 +3391,7 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "" @@ -3387,11 +3399,11 @@ msgstr "" msgid "wrong index type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "numero di argomenti errato" @@ -3403,7 +3415,7 @@ msgstr "numero di valori da scompattare non corretto" msgid "wrong operand type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "" @@ -3425,15 +3437,15 @@ msgstr "indirizzo fuori limite" msgid "zero step" msgstr "zero step" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 9b2dea98f9..51a5237861 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 19:58-0700\n" +"POT-Creation-Date: 2020-07-28 16:57-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -772,7 +772,7 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "" @@ -1789,7 +1789,7 @@ msgstr "" msgid "addresses is empty" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "" @@ -1797,7 +1797,7 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "" @@ -1805,6 +1805,10 @@ msgstr "" msgid "argument has wrong type" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1814,7 +1818,7 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "" @@ -1822,7 +1826,7 @@ msgstr "" msgid "array/bytes required on right side" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -1830,15 +1834,15 @@ msgstr "" msgid "attributes not supported yet" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "" @@ -2144,15 +2148,15 @@ msgstr "" msgid "conversion to object" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "" @@ -2160,7 +2164,7 @@ msgstr "" msgid "could not broadast input array from shape" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2168,15 +2172,15 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2205,7 +2209,7 @@ msgstr "" msgid "dict update sequence has wrong length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "" @@ -2308,11 +2312,11 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "" @@ -2320,7 +2324,7 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "" @@ -2332,7 +2336,7 @@ msgstr "" msgid "flattening order must be either 'C', or 'F'" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "" @@ -2365,11 +2369,11 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2455,7 +2459,7 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "" @@ -2463,35 +2467,35 @@ msgstr "" msgid "inline assembler must be a function" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "" @@ -2503,7 +2507,7 @@ msgstr "" msgid "integer required" msgstr "정수가 필요합니다" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "" @@ -2573,7 +2577,7 @@ msgstr "" msgid "iterables are not of the same length" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "" @@ -2637,11 +2641,11 @@ msgstr "" msgid "math domain error" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "" @@ -2668,7 +2672,7 @@ msgstr "" msgid "module not found" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "" @@ -2692,7 +2696,7 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "" @@ -2790,11 +2794,11 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -2865,12 +2869,12 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -2962,7 +2966,7 @@ msgstr "" msgid "raw f-strings are not implemented" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" @@ -3035,7 +3039,7 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "" @@ -3059,19 +3063,19 @@ msgstr "" msgid "soft reboot\n" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3185,7 +3189,11 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -3313,6 +3321,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" @@ -3321,7 +3333,7 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "" @@ -3329,11 +3341,11 @@ msgstr "" msgid "wrong index type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3345,7 +3357,7 @@ msgstr "" msgid "wrong operand type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "" @@ -3365,15 +3377,15 @@ msgstr "" msgid "zero step" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index e09fc2b2de..6240fce1b5 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 19:58-0700\n" +"POT-Creation-Date: 2020-07-28 16:57-0500\n" "PO-Revision-Date: 2020-07-27 21:27+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -784,7 +784,7 @@ msgstr "Verwachtte een tuple met lengte %d, maar kreeg %d" msgid "Extended advertisements with scan response not supported." msgstr "Extended advertisements met scan antwoord niet ondersteund." -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "FFT alleen voor ndarrays gedefineerd" @@ -1839,7 +1839,7 @@ msgstr "adres buiten bereik" msgid "addresses is empty" msgstr "adressen zijn leeg" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "arctan2 is alleen geïmplementeerd voor scalars en ndarrays" @@ -1847,7 +1847,7 @@ msgstr "arctan2 is alleen geïmplementeerd voor scalars en ndarrays" msgid "arg is an empty sequence" msgstr "arg is een lege sequentie" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "argsort argument moet een ndarray zijn" @@ -1855,6 +1855,10 @@ msgstr "argsort argument moet een ndarray zijn" msgid "argument has wrong type" msgstr "argument heeft onjuist type" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1864,7 +1868,7 @@ msgstr "argument num/typen komen niet overeen" msgid "argument should be a '%q' not a '%q'" msgstr "argument moet een '%q' zijn en niet een '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "argumenten moeten ndarrays zijn" @@ -1872,7 +1876,7 @@ msgstr "argumenten moeten ndarrays zijn" msgid "array/bytes required on right side" msgstr "array/bytes vereist aan de rechterkant" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "poging om argmin/argmax van een lege sequentie te krijgen" @@ -1880,15 +1884,15 @@ msgstr "poging om argmin/argmax van een lege sequentie te krijgen" msgid "attributes not supported yet" msgstr "attributen nog niet ondersteund" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "as moet -1, 0, None, of 1 zijn" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "as moet -1, 0, of 1 zijn" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "as moet None, 0, of 1 zijn" @@ -2196,15 +2200,15 @@ msgstr "constant moet een integer zijn" msgid "conversion to object" msgstr "conversie naar object" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "convolutie argumenten moeten lineaire arrays zijn" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "convolutie argumenten moeten ndarrays zijn" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "convolutie argumenten mogen niet leeg zijn" @@ -2212,7 +2216,7 @@ msgstr "convolutie argumenten mogen niet leeg zijn" msgid "could not broadast input array from shape" msgstr "kon de invoerarray niet vanuit vorm uitzenden" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "kon de Vandermonde matrix niet omkeren" @@ -2220,15 +2224,15 @@ msgstr "kon de Vandermonde matrix niet omkeren" msgid "couldn't determine SD card version" msgstr "kon SD kaart versie niet bepalen" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "data moet itereerbaar zijn" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "data moet van gelijke lengte zijn" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "ddof kleiner dan de lengte van de data set" @@ -2259,7 +2263,7 @@ msgstr "destination_lengte moest een int groter dan of gelijk zijn aan 0 zijn" msgid "dict update sequence has wrong length" msgstr "dict update sequence heeft de verkeerde lengte" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "diff argument moet een ndarray zijn" @@ -2362,11 +2366,11 @@ msgstr "bestand moet een bestand zijn geopend in byte modus" msgid "filesystem must provide mount method" msgstr "bestandssysteem moet een mount methode bieden" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "eerste argument moet een aanroepbare (callable) zijn" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "eerste argument moet een functie zijn" @@ -2374,7 +2378,7 @@ msgstr "eerste argument moet een functie zijn" msgid "first argument must be an iterable" msgstr "eerst argument moet een iterabel zijn" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "eerst argument moet een ndarray zijn" @@ -2386,7 +2390,7 @@ msgstr "eerste argument voor super() moet een type zijn" msgid "flattening order must be either 'C', or 'F'" msgstr "De afvlakkingsvolgorde moet ofwel \"C\", ofwel \"F\" zijn" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "flip argumenten moeten een ndarray zijn" @@ -2419,11 +2423,11 @@ msgstr "functie verwachtte op zijn meest %d argumenten, maar kreeg %d" msgid "function got multiple values for argument '%q'" msgstr "functie kreeg meedere waarden voor argument '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "functie heeft hetzelfde teken aan beide uiteinden van het interval" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "funtie is alleen geïmplementeerd voor scalars en ndarrays" @@ -2510,7 +2514,7 @@ msgstr "indices moeten integers zijn" msgid "indices must be integers, slices, or Boolean lists" msgstr "indices moeten integers, segmenten (slices) of Boolean lijsten zijn" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "oorspronkelijke waarden moeten itereerbaar zijn" @@ -2518,35 +2522,35 @@ msgstr "oorspronkelijke waarden moeten itereerbaar zijn" msgid "inline assembler must be a function" msgstr "inline assembler moet een functie zijn" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "invoerargument moet een integer of 2-tuple zijn" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "invoer array lengte moet een macht van 2 zijn" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "invoerdata moet itereerbaar zijn" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "invoermatrix is asymmetrisch" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "invoermatrix is singulier" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "invoer moet een vierkante matrix zijn" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "invoer moet een tuple, lijst, bereik of ndarray zijn" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "invoervectors moeten van gelijke lengte zijn" @@ -2558,7 +2562,7 @@ msgstr "int() argument 2 moet >=2 en <= 36 zijn" msgid "integer required" msgstr "integer vereist" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "interp is gedefinieerd for eendimensionale arrays van gelijke lengte" @@ -2628,7 +2632,7 @@ msgstr "issubclass() argument 2 moet een klasse of tuple van klassen zijn" msgid "iterables are not of the same length" msgstr "itereerbare objecten hebben niet dezelfde lengte" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "itereerbare objecten convergeren niet" @@ -2695,11 +2699,11 @@ msgstr "map buffer te klein" msgid "math domain error" msgstr "fout in het wiskundig domein (math domain error)" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "matrix afmetingen komen niet overeen" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "matrix is niet positief-definiet" @@ -2726,7 +2730,7 @@ msgstr "geheugentoewijzing mislukt, heap is vergrendeld" msgid "module not found" msgstr "module niet gevonden" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "meer vrijheidsgraden dan datapunten" @@ -2750,7 +2754,7 @@ msgstr "moet een object oproepen (raise)" msgid "must use keyword argument for key function" msgstr "voor sleutelfunctie moet een trefwoordargument gebruikt worden" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "n moet tussen 0 en 9 liggen" @@ -2848,11 +2852,11 @@ msgstr "niet alle argumenten omgezet bij formattering van string" msgid "not enough arguments for format string" msgstr "niet genoeg argumenten om string te formatteren" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "aantal argumenten moet 2 of 3 zijn" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "aantal punten moet minimaal 2 zijn" @@ -2923,12 +2927,12 @@ msgstr "alleen sample_rate=16000 wordt ondersteund" msgid "only slices with step=1 (aka None) are supported" msgstr "alleen segmenten met step=1 (ook wel None) worden ondersteund" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "operands konden niet samen verzonden worden" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "bewerking is voor ndarrays niet geïmplementeerd" @@ -3021,7 +3025,7 @@ msgstr "wachtrij overloop" msgid "raw f-strings are not implemented" msgstr "ruwe f-strings zijn niet geïmplementeerd" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "reëel en imaginair deel moeten gelijke lengte hebben" @@ -3096,7 +3100,7 @@ msgstr "teken niet toegestaan bij integer formaatspecificatie 'c'" msgid "single '}' encountered in format string" msgstr "enkele '}' aangetroffen in formaat tekenreeks (string)" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "omvang is alleen voor ndarrays gedefinieerd" @@ -3120,19 +3124,19 @@ msgstr "small int overloop" msgid "soft reboot\n" msgstr "zachte herstart\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "sorteerargument moet een ndarray zijn" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "sos array moet vorm (n_section, 6) hebben" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "sos[:, 3] moeten allemaal 1 zijn" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "sosfilt vereist itereerbare argumenten" @@ -3246,7 +3250,11 @@ msgstr "te veel indices" msgid "too many values to unpack (expected %d)" msgstr "te veel waarden om uit te pakken (%d verwacht)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "tuple index buiten bereik" @@ -3374,6 +3382,10 @@ msgstr "waarde moet in %d byte(s) passen" msgid "value_count must be > 0" msgstr "value_count moet groter dan 0 zijn" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "watchdog time-out moet groter zijn dan 0" @@ -3382,7 +3394,7 @@ msgstr "watchdog time-out moet groter zijn dan 0" msgid "window must be <= interval" msgstr "window moet <= interval zijn" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "onjuist argumenttype" @@ -3390,11 +3402,11 @@ msgstr "onjuist argumenttype" msgid "wrong index type" msgstr "onjuist indextype" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "onjuist invoertype" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "onjuist aantal argumenten" @@ -3406,7 +3418,7 @@ msgstr "verkeerd aantal waarden om uit te pakken" msgid "wrong operand type" msgstr "verkeerd operandtype" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "onjuist uitvoer type" @@ -3426,15 +3438,15 @@ msgstr "y-waarde buiten bereik" msgid "zero step" msgstr "nul-stap" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "zi moet een ndarray zijn" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "zi moet van type float zijn" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "zi moet vorm (n_section, 2) hebben" diff --git a/locale/pl.po b/locale/pl.po index 43e1570966..fdb3749187 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 19:58-0700\n" +"POT-Creation-Date: 2020-07-28 16:57-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -772,7 +772,7 @@ msgstr "Oczekiwano krotkę długości %d, otrzymano %d" msgid "Extended advertisements with scan response not supported." msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "" @@ -1793,7 +1793,7 @@ msgstr "adres poza zakresem" msgid "addresses is empty" msgstr "adres jest pusty" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "" @@ -1801,7 +1801,7 @@ msgstr "" msgid "arg is an empty sequence" msgstr "arg jest puste" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "" @@ -1809,6 +1809,10 @@ msgstr "" msgid "argument has wrong type" msgstr "argument ma zły typ" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1818,7 +1822,7 @@ msgstr "zła liczba lub typ argumentów" msgid "argument should be a '%q' not a '%q'" msgstr "argument powinien być '%q' a nie '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "" @@ -1826,7 +1830,7 @@ msgstr "" msgid "array/bytes required on right side" msgstr "tablica/bytes wymagane po prawej stronie" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -1834,15 +1838,15 @@ msgstr "" msgid "attributes not supported yet" msgstr "atrybuty nie są jeszcze obsługiwane" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "" @@ -2148,15 +2152,15 @@ msgstr "stała musi być liczbą całkowitą" msgid "conversion to object" msgstr "konwersja do obiektu" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "" @@ -2164,7 +2168,7 @@ msgstr "" msgid "could not broadast input array from shape" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2172,15 +2176,15 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2210,7 +2214,7 @@ msgstr "destination_length musi być nieujemną liczbą całkowitą" msgid "dict update sequence has wrong length" msgstr "sekwencja ma złą długość" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "" @@ -2313,11 +2317,11 @@ msgstr "file musi być otwarte w trybie bajtowym" msgid "filesystem must provide mount method" msgstr "system plików musi mieć metodę mount" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "" @@ -2325,7 +2329,7 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "" @@ -2337,7 +2341,7 @@ msgstr "pierwszy argument super() musi być typem" msgid "flattening order must be either 'C', or 'F'" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "" @@ -2370,11 +2374,11 @@ msgstr "funkcja bierze najwyżej %d argumentów, jest %d" msgid "function got multiple values for argument '%q'" msgstr "funkcja dostała wiele wartości dla argumentu '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2460,7 +2464,7 @@ msgstr "indeksy muszą być całkowite" msgid "indices must be integers, slices, or Boolean lists" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "" @@ -2468,35 +2472,35 @@ msgstr "" msgid "inline assembler must be a function" msgstr "wtrącony asembler musi być funkcją" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "" @@ -2508,7 +2512,7 @@ msgstr "argument 2 do int() busi być pomiędzy 2 a 36" msgid "integer required" msgstr "wymagana liczba całkowita" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "" @@ -2578,7 +2582,7 @@ msgstr "argument 2 dla issubclass() musi być klasą lub krotką klas" msgid "iterables are not of the same length" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "" @@ -2642,11 +2646,11 @@ msgstr "bufor mapy zbyt mały" msgid "math domain error" msgstr "błąd domeny" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "" @@ -2673,7 +2677,7 @@ msgstr "alokacja pamięci nie powiodła się, sterta zablokowana" msgid "module not found" msgstr "brak modułu" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "" @@ -2697,7 +2701,7 @@ msgstr "wyjątek musi być obiektem" msgid "must use keyword argument for key function" msgstr "funkcja key musi być podana jako argument nazwany" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "" @@ -2795,11 +2799,11 @@ msgstr "nie wszystkie argumenty wykorzystane w formatowaniu" msgid "not enough arguments for format string" msgstr "nie dość argumentów przy formatowaniu" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -2870,12 +2874,12 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "tylko fragmenty ze step=1 (lub None) są wspierane" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -2968,7 +2972,7 @@ msgstr "przepełnienie kolejki" msgid "raw f-strings are not implemented" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" @@ -3042,7 +3046,7 @@ msgstr "znak jest niedopuszczalny w specyfikacji 'c'" msgid "single '}' encountered in format string" msgstr "pojedynczy '}' w specyfikacji formatu" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "" @@ -3066,19 +3070,19 @@ msgstr "przepełnienie small int" msgid "soft reboot\n" msgstr "programowy reset\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3192,7 +3196,11 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "zbyt wiele wartości do rozpakowania (oczekiwano %d)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "indeks krotki poza zakresem" @@ -3320,6 +3328,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "value_count musi być > 0" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" @@ -3328,7 +3340,7 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "" @@ -3336,11 +3348,11 @@ msgstr "" msgid "wrong index type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "zła liczba argumentów" @@ -3352,7 +3364,7 @@ msgstr "zła liczba wartości do rozpakowania" msgid "wrong operand type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "" @@ -3372,15 +3384,15 @@ msgstr "y poza zakresem" msgid "zero step" msgstr "zerowy krok" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index d3e0275d73..3ecca12dff 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 19:58-0700\n" +"POT-Creation-Date: 2020-07-28 16:57-0500\n" "PO-Revision-Date: 2020-07-28 15:41+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -793,7 +793,7 @@ msgstr "Tupla esperada com comprimento %d, obteve %d" msgid "Extended advertisements with scan response not supported." msgstr "Anúncios estendidos não compatíveis com a resposta da varredura." -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "O FFT é definido apenas para ndarrays" @@ -1854,7 +1854,7 @@ msgstr "endereço fora dos limites" msgid "addresses is empty" msgstr "os endereços estão vazios" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "O arctan2 está implementado apenas para escalares e ndarrays" @@ -1862,7 +1862,7 @@ msgstr "O arctan2 está implementado apenas para escalares e ndarrays" msgid "arg is an empty sequence" msgstr "o arg é uma sequência vazia" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "O argumento argsort deve ser um ndarray" @@ -1870,6 +1870,10 @@ msgstr "O argumento argsort deve ser um ndarray" msgid "argument has wrong type" msgstr "argumento tem tipo errado" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1879,7 +1883,7 @@ msgstr "o argumento num/tipos não combinam" msgid "argument should be a '%q' not a '%q'" msgstr "o argumento deve ser um '%q' e não um '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "os argumentos devem ser ndarrays" @@ -1887,7 +1891,7 @@ msgstr "os argumentos devem ser ndarrays" msgid "array/bytes required on right side" msgstr "matriz/bytes são necessários no lado direito" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "tente obter argmin/argmax de uma sequência vazia" @@ -1895,15 +1899,15 @@ msgstr "tente obter argmin/argmax de uma sequência vazia" msgid "attributes not supported yet" msgstr "atributos ainda não suportados" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "o eixo deve ser -1, 0, Nenhum ou 1" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "o eixo deve ser -1, 0 ou 1" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "o eixo deve ser Nenhum, 0 ou 1" @@ -2216,15 +2220,15 @@ msgstr "constante deve ser um inteiro" msgid "conversion to object" msgstr "conversão para o objeto" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "os argumentos convolutivos devem ser matrizes lineares" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "os argumentos convolutivos devem ser ndarrays" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "os argumentos convolutivos não devem estar vazios" @@ -2232,7 +2236,7 @@ msgstr "os argumentos convolutivos não devem estar vazios" msgid "could not broadast input array from shape" msgstr "não foi possível transmitir a matriz da entrada a partir da forma" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "não foi possível inverter a matriz Vandermonde" @@ -2240,15 +2244,15 @@ msgstr "não foi possível inverter a matriz Vandermonde" msgid "couldn't determine SD card version" msgstr "não foi possível determinar a versão do cartão SD" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "os dados devem ser iteráveis" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "os dados devem ser de igual comprimento" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "O ddof deve ser menor que o comprimento do conjunto dos dados" @@ -2280,7 +2284,7 @@ msgstr "destination_length deve ser um int >= 0" msgid "dict update sequence has wrong length" msgstr "sequência da atualização dict tem o comprimento errado" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "O argumento diff deve ser um ndarray" @@ -2383,11 +2387,11 @@ msgstr "o arquivo deve ser um arquivo aberto no modo byte" msgid "filesystem must provide mount method" msgstr "sistema de arquivos deve fornecer método de montagem" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "o primeiro argumento deve ser chamável" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "o primeiro argumento deve ser uma função" @@ -2395,7 +2399,7 @@ msgstr "o primeiro argumento deve ser uma função" msgid "first argument must be an iterable" msgstr "o primeiro argumento deve ser um iterável" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "o primeiro argumento deve ser um ndarray" @@ -2407,7 +2411,7 @@ msgstr "o primeiro argumento para super() deve ser um tipo" msgid "flattening order must be either 'C', or 'F'" msgstr "a ordem do nivelamento deve ser 'C' ou 'F'" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "o argumento flip deve ser um ndarray" @@ -2440,11 +2444,11 @@ msgstr "função esperada na maioria dos %d argumentos, obteve %d" msgid "function got multiple values for argument '%q'" msgstr "A função obteve vários valores para o argumento '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "a função tem o mesmo sinal nas extremidades do intervalo" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "A função foi implementada apenas para escalares e ndarrays" @@ -2530,7 +2534,7 @@ msgstr "os índices devem ser inteiros" msgid "indices must be integers, slices, or Boolean lists" msgstr "os índices devem ser números inteiros, fatias ou listas booleanas" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "os valores iniciais devem ser iteráveis" @@ -2538,35 +2542,35 @@ msgstr "os valores iniciais devem ser iteráveis" msgid "inline assembler must be a function" msgstr "o assembler em linha deve ser uma função" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "o argumento da entrada deve ser um número inteiro ou uma tupla de 2" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "comprimento da matriz da entrada deve ter potência de 2" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "os dados da entrada devem ser iteráveis" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "a matriz da entrada é assimétrica" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "a matriz da entrada é singular" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "a entrada deve ser uma matriz quadrada" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "A entrada deve ser tupla, lista, intervalo ou matriz" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "os vetores da entrada devem ter o mesmo comprimento" @@ -2578,7 +2582,7 @@ msgstr "int() arg 2 deve ser >= 2 e <= 36" msgid "integer required" msgstr "inteiro requerido" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "o interp é definido para matrizes 1D de igual comprimento" @@ -2648,7 +2652,7 @@ msgstr "issubclass() arg 2 deve ser uma classe ou uma tupla de classes" msgid "iterables are not of the same length" msgstr "os iteráveis não têm o mesmo comprimento" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "as iterações não convergiram" @@ -2715,11 +2719,11 @@ msgstr "o mapa do buffer é muito pequeno" msgid "math domain error" msgstr "erro de domínio matemático" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "as dimensões da matriz não coincidem" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "a matriz não é definitiva positiva" @@ -2748,7 +2752,7 @@ msgstr "" msgid "module not found" msgstr "o módulo não foi encontrado" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "mais graus de liberdade do que pontos de dados" @@ -2772,7 +2776,7 @@ msgstr "deve levantar um objeto" msgid "must use keyword argument for key function" msgstr "deve usar o argumento da palavra-chave para a função da chave" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "n deve estar entre 0 e 9" @@ -2870,11 +2874,11 @@ msgstr "nem todos os argumentos são convertidos durante a formatação da strin msgid "not enough arguments for format string" msgstr "argumentos insuficientes para o formato da string" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "a quantidade dos argumentos deve ser 2 ou 3" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "a quantidade dos pontos deve ser pelo menos 2" @@ -2946,12 +2950,12 @@ msgid "only slices with step=1 (aka None) are supported" msgstr "" "apenas fatias com a etapa=1 (também conhecida como Nenhuma) são compatíveis" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "os operandos não puderam ser transmitidos juntos" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "a operação não foi implementada nos ndarrays" @@ -3047,7 +3051,7 @@ msgstr "estouro de fila" msgid "raw f-strings are not implemented" msgstr "o f-strings bruto não estão implementados" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "partes reais e imaginárias devem ter o mesmo comprimento" @@ -3122,7 +3126,7 @@ msgstr "sinal não permitido com o especificador no formato inteiro 'c'" msgid "single '}' encountered in format string" msgstr "único '}' encontrado na string do formato" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "o tamanho é definido apenas para os ndarrays" @@ -3146,19 +3150,19 @@ msgstr "transbordamento int pequeno" msgid "soft reboot\n" msgstr "reinicialização soft\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "o argumento da classificação deve ser um ndarray" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "o sos da matriz deve estar na forma (n_section, 6)" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "sos[:, 3] deve ser um em todos" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "o sosfilt requer que os argumentos sejam iteráveis" @@ -3272,7 +3276,11 @@ msgstr "índices demais" msgid "too many values to unpack (expected %d)" msgstr "valores demais para descompactar (esperado %d)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "o índice da tupla está fora do intervalo" @@ -3400,6 +3408,10 @@ msgstr "o valor deve caber em %d byte(s)" msgid "value_count must be > 0" msgstr "o value_count deve ser > 0" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "o tempo limite do watchdog deve ser maior que 0" @@ -3408,7 +3420,7 @@ msgstr "o tempo limite do watchdog deve ser maior que 0" msgid "window must be <= interval" msgstr "a janela deve ser <= intervalo" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "tipo do argumento errado" @@ -3416,11 +3428,11 @@ msgstr "tipo do argumento errado" msgid "wrong index type" msgstr "tipo do índice errado" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "tipo da entrada incorreta" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "quantidade errada dos argumentos" @@ -3432,7 +3444,7 @@ msgstr "quantidade incorreta dos valores para descompressão" msgid "wrong operand type" msgstr "tipo do operando errado" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "tipo da saída incorreta" @@ -3452,15 +3464,15 @@ msgstr "o valor y está fora dos limites" msgid "zero step" msgstr "passo zero" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "zi deve ser um ndarray" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "zi deve ser de um tipo float" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "zi deve estar na forma (n_section, 2)" diff --git a/locale/sv.po b/locale/sv.po index 9d60245bb5..0210094a9b 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 19:58-0700\n" +"POT-Creation-Date: 2020-07-28 16:57-0500\n" "PO-Revision-Date: 2020-07-25 20:58+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -784,7 +784,7 @@ msgstr "Förväntad tupel med längd %d, fick %d" msgid "Extended advertisements with scan response not supported." msgstr "Utökad annonsering i kombination med skanningssvar stöds inte." -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "FFT är enbart definierade för ndarrays" @@ -1832,7 +1832,7 @@ msgstr "adress utanför gränsen" msgid "addresses is empty" msgstr "adresserna är tomma" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "arctan2 är enbart implementerad för scalar och ndarray" @@ -1840,7 +1840,7 @@ msgstr "arctan2 är enbart implementerad för scalar och ndarray" msgid "arg is an empty sequence" msgstr "arg är en tom sekvens" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "argumentet argsort måste vara en ndarray" @@ -1848,6 +1848,10 @@ msgstr "argumentet argsort måste vara en ndarray" msgid "argument has wrong type" msgstr "argumentet har fel typ" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1857,7 +1861,7 @@ msgstr "argument antal/typ matchar inte" msgid "argument should be a '%q' not a '%q'" msgstr "argumentet skall vara en '%q', inte en '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "argumenten måste vara ndarray" @@ -1865,7 +1869,7 @@ msgstr "argumenten måste vara ndarray" msgid "array/bytes required on right side" msgstr "array/bytes krävs på höger sida" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "försök att få argmin/argmax för en tom sekvens" @@ -1873,15 +1877,15 @@ msgstr "försök att få argmin/argmax för en tom sekvens" msgid "attributes not supported yet" msgstr "attribut stöds inte än" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "axis ska vara -1, 0, None eller 1" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "axis ska vara -1, 0 eller 1" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "axis ska vara None, 0, eller 1" @@ -2189,15 +2193,15 @@ msgstr "konstant måste vara ett heltal" msgid "conversion to object" msgstr "konvertering till objekt" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "Argumenten convolve måste vara linjära matriser" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "Argumenten convolve måste vara ndarray:er" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "Argumenten convolve kan inte vara tomma" @@ -2205,7 +2209,7 @@ msgstr "Argumenten convolve kan inte vara tomma" msgid "could not broadast input array from shape" msgstr "Kan inte sända indatamatris från form" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "kan inte invertera Vandermonde-matris" @@ -2213,15 +2217,15 @@ msgstr "kan inte invertera Vandermonde-matris" msgid "couldn't determine SD card version" msgstr "kan inte avgöra SD-kortversion" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "data måste vara itererbar" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "data måste vara av samma längd" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "ddof måste vara mindre än längden på datauppsättningen" @@ -2253,7 +2257,7 @@ msgstr "destination_length måste vara ett heltal >= 0" msgid "dict update sequence has wrong length" msgstr "uppdateringssekvensen för dict har fel längd" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "argumentet diff måste vara en ndarray" @@ -2356,11 +2360,11 @@ msgstr "filen måste vara en fil som öppnats i byte-läge" msgid "filesystem must provide mount method" msgstr "filsystemet måste tillhandahålla mount-metod" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "första argumentet måste vara en callable" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "första argumentet måste vara en funktion" @@ -2368,7 +2372,7 @@ msgstr "första argumentet måste vara en funktion" msgid "first argument must be an iterable" msgstr "första argumentet måste vara en iterable" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "första argumentet måste vara en ndarray" @@ -2380,7 +2384,7 @@ msgstr "första argumentet till super() måste vara typ" msgid "flattening order must be either 'C', or 'F'" msgstr "förenklingsordningen måste vara antingen \"C\" eller \"F\"" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "Argumentet flip måste vara en ndarray" @@ -2413,11 +2417,11 @@ msgstr "funktionen förväntar som mest %d argument, fick %d" msgid "function got multiple values for argument '%q'" msgstr "funktionen fick flera värden för argumentet '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "funktionen har samma teckenvärden vid slutet av intervall" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "funktionen är endast implementerad för scalar och ndarray" @@ -2503,7 +2507,7 @@ msgstr "index måste vara heltal" msgid "indices must be integers, slices, or Boolean lists" msgstr "index måste vara heltal, slices, eller Boolean-listor" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "initialvärden måste vara iterable" @@ -2511,35 +2515,35 @@ msgstr "initialvärden måste vara iterable" msgid "inline assembler must be a function" msgstr "inline assembler måste vara en funktion" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "indataargumentet måste vara ett heltal eller en 2-tupel" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "indataarraylängden måste vara en multipel av 2" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "indata måste vara en iterable" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "indatamatrisen är asymmetrisk" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "indatamatrisen är singulär" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "indata måste vara kvadratmatris" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "indata måste vara tupel, lista, range, eller ndarray" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "indatavektorer måste ha samma längd" @@ -2551,7 +2555,7 @@ msgstr "int() arg 2 måste vara >= 2 och <= 36" msgid "integer required" msgstr "heltal krävs" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "interp är definierad för 1D-matriser med samma längd" @@ -2621,7 +2625,7 @@ msgstr "issubclass() arg 2 måste vara en klass eller en tupel av klasser" msgid "iterables are not of the same length" msgstr "iterables är inte av samma längd" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "iterations konvergerar inte" @@ -2688,11 +2692,11 @@ msgstr "map-buffert för liten" msgid "math domain error" msgstr "matematikdomänfel" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "matrisdimensioner matchar inte" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "matrisen är inte positiv bestämd" @@ -2719,7 +2723,7 @@ msgstr "minnesallokeringen misslyckades, heapen är låst" msgid "module not found" msgstr "modulen hittades inte" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "fler frihetsgrader än datapunkter" @@ -2743,7 +2747,7 @@ msgstr "måste ge ett objekt" msgid "must use keyword argument for key function" msgstr "måste använda nyckelordsargument för nyckelfunktion" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "n måste vara mellan 0 och 9" @@ -2841,11 +2845,11 @@ msgstr "inte alla argument omvandlade under strängformatering" msgid "not enough arguments for format string" msgstr "inte tillräckligt med argument för formatsträng" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "antal argument måste vara 2 eller 3" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "antal punkter måste vara minst 2" @@ -2916,12 +2920,12 @@ msgstr "enbart sample_rate=16000 stöds" msgid "only slices with step=1 (aka None) are supported" msgstr "endast segment med steg=1 (aka Ingen) stöds" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "operander kan inte sändas tillsammans" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "åtgärden är inte implementerad för ndarray:er" @@ -3014,7 +3018,7 @@ msgstr "köstorlek överskreds" msgid "raw f-strings are not implemented" msgstr "råa f-strängar inte implementerade" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "verkliga och imaginära delar måste ha samma längd" @@ -3089,7 +3093,7 @@ msgstr "tecken tillåts inte med heltalsformatspecificeraren 'c'" msgid "single '}' encountered in format string" msgstr "Enkelt '}' påträffades i formatsträngen" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "storlek är enbart definierad ndarrays" @@ -3113,19 +3117,19 @@ msgstr "värdet för small int överskreds" msgid "soft reboot\n" msgstr "mjuk omstart\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "argumentet sort måste vara en ndarray" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "sos array måste ha form (n_section, 6)" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "sos[:, 3] måste vara ettor" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "sosfilt kräver iterable argument" @@ -3239,7 +3243,11 @@ msgstr "för många index" msgid "too many values to unpack (expected %d)" msgstr "för många värden att packa upp (förväntat %d)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "tupelindex utanför intervallet" @@ -3367,6 +3375,10 @@ msgstr "värdet måste passa i %d byte(s)" msgid "value_count must be > 0" msgstr "value_count måste vara > 0" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "watchdog timeout måste vara större än 0" @@ -3375,7 +3387,7 @@ msgstr "watchdog timeout måste vara större än 0" msgid "window must be <= interval" msgstr "window måste vara <= interval" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "fel typ av argument" @@ -3383,11 +3395,11 @@ msgstr "fel typ av argument" msgid "wrong index type" msgstr "fel indextyp" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "fel indatatyp" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "fel antal argument" @@ -3399,7 +3411,7 @@ msgstr "fel antal värden för att packa upp" msgid "wrong operand type" msgstr "fel operandtyp" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "fel utdatatyp" @@ -3419,15 +3431,15 @@ msgstr "y-värde utanför intervall" msgid "zero step" msgstr "noll steg" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "zi måste vara en ndarray" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "zi måste vara av typ float" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "zi måste vara i formen (n_section, 2)" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 2a9d07b29a..32928976d0 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-24 19:58-0700\n" +"POT-Creation-Date: 2020-07-28 16:57-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -780,7 +780,7 @@ msgstr "Qīwàng de chángdù wèi %d de yuán zǔ, dédào %d" msgid "Extended advertisements with scan response not supported." msgstr "Bù zhīchí dài yǒu sǎomiáo xiǎngyìng de kuòzhǎn guǎngbò." -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "" @@ -1818,7 +1818,7 @@ msgstr "dìzhǐ chāochū biānjiè" msgid "addresses is empty" msgstr "dìzhǐ wèi kōng" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "" @@ -1826,7 +1826,7 @@ msgstr "" msgid "arg is an empty sequence" msgstr "cānshù shì yīgè kōng de xùliè" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "" @@ -1834,6 +1834,10 @@ msgstr "" msgid "argument has wrong type" msgstr "cānshù lèixíng cuòwù" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1843,7 +1847,7 @@ msgstr "cānshù biānhào/lèixíng bù pǐpèi" msgid "argument should be a '%q' not a '%q'" msgstr "cānshù yīnggāi shì '%q', 'bùshì '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "" @@ -1851,7 +1855,7 @@ msgstr "" msgid "array/bytes required on right side" msgstr "yòu cè xūyào shùzǔ/zì jié" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -1859,15 +1863,15 @@ msgstr "" msgid "attributes not supported yet" msgstr "shǔxìng shàngwèi zhīchí" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "" @@ -2176,15 +2180,15 @@ msgstr "chángshù bìxū shì yīgè zhěngshù" msgid "conversion to object" msgstr "zhuǎnhuàn wèi duìxiàng" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "" @@ -2192,7 +2196,7 @@ msgstr "" msgid "could not broadast input array from shape" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2200,15 +2204,15 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2238,7 +2242,7 @@ msgstr "mùbiāo chángdù bìxū shì > = 0 de zhěngshù" msgid "dict update sequence has wrong length" msgstr "yǔfǎ gēngxīn xùliè de chángdù cuòwù" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "" @@ -2341,11 +2345,11 @@ msgstr "wénjiàn bìxū shì zài zì jié móshì xià dǎkāi de wénjiàn" msgid "filesystem must provide mount method" msgstr "wénjiàn xìtǒng bìxū tígōng guà zài fāngfǎ" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "" @@ -2353,7 +2357,7 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "" @@ -2365,7 +2369,7 @@ msgstr "chāojí () de dì yī gè cānshù bìxū shì lèixíng" msgid "flattening order must be either 'C', or 'F'" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "" @@ -2398,11 +2402,11 @@ msgstr "hánshù yùjì zuìduō %d cānshù, huòdé %d" msgid "function got multiple values for argument '%q'" msgstr "hánshù huòdé cānshù '%q' de duōchóng zhí" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2488,7 +2492,7 @@ msgstr "suǒyǐn bìxū shì zhěngshù" msgid "indices must be integers, slices, or Boolean lists" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "" @@ -2496,35 +2500,35 @@ msgstr "" msgid "inline assembler must be a function" msgstr "nèi lián jíhé bìxū shì yīgè hánshù" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "" @@ -2536,7 +2540,7 @@ msgstr "zhěngshù() cānshù 2 bìxū > = 2 qiě <= 36" msgid "integer required" msgstr "xūyào zhěngshù" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "" @@ -2606,7 +2610,7 @@ msgstr "issubclass() cānshù 2 bìxū shì lèi de lèi huò yuán zǔ" msgid "iterables are not of the same length" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "" @@ -2671,11 +2675,11 @@ msgstr "dìtú huǎnchōng qū tài xiǎo" msgid "math domain error" msgstr "shùxué yù cuòwù" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "" @@ -2702,7 +2706,7 @@ msgstr "jìyì tǐ fēnpèi shībài, duī bèi suǒdìng" msgid "module not found" msgstr "zhǎo bù dào mókuài" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "" @@ -2726,7 +2730,7 @@ msgstr "bìxū tíchū duìxiàng" msgid "must use keyword argument for key function" msgstr "bìxū shǐyòng guānjiàn cí cānshù" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "" @@ -2825,11 +2829,11 @@ msgstr "bùshì zì chuàn géshì huà guòchéng zhōng zhuǎnhuàn de suǒyǒ msgid "not enough arguments for format string" msgstr "géshì zìfú chuàn cān shǔ bùzú" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -2900,12 +2904,12 @@ msgstr "Jǐn zhīchí cǎiyàng lǜ = 16000" 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" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -2997,7 +3001,7 @@ msgstr "duìliè yìchū" msgid "raw f-strings are not implemented" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" @@ -3072,7 +3076,7 @@ msgstr "zhěngshù géshì shuōmíng fú 'c' bù yǔnxǔ shǐyòng fúhào" 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/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "" @@ -3096,19 +3100,19 @@ msgstr "xiǎo zhěngshù yìchū" msgid "soft reboot\n" msgstr "ruǎn chóngqǐ\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3222,7 +3226,11 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "dǎkāi tài duō zhí (yùqí %d)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "yuán zǔ suǒyǐn chāochū fànwéi" @@ -3350,6 +3358,10 @@ msgstr "Zhí bìxū fúhé %d zì jié" msgid "value_count must be > 0" msgstr "zhí jìshù bìxū wèi > 0" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" @@ -3358,7 +3370,7 @@ msgstr "" msgid "window must be <= interval" msgstr "Chuāngkǒu bìxū shì <= jiàngé" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "" @@ -3366,11 +3378,11 @@ msgstr "" msgid "wrong index type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "cānshù shù cuòwù" @@ -3382,7 +3394,7 @@ msgstr "wúfǎ jiě bāo de zhí shù" msgid "wrong operand type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "" @@ -3402,15 +3414,15 @@ msgstr "y zhí chāochū biānjiè" msgid "zero step" msgstr "líng bù" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" From 8498e7f2cd896cf92c2fe17f7d8601ce9fff41b2 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Wed, 29 Jul 2020 23:35:45 +0200 Subject: [PATCH 0436/1293] Fix inability to set values in 32-bit Bitmap. --- shared-bindings/displayio/Bitmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 65d80fba62..0a45bbdfdb 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -163,8 +163,8 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val // load return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_bitmap_get_pixel(self, x, y)); } else { - mp_int_t value = mp_obj_get_int(value_obj); - if (value >= 1 << common_hal_displayio_bitmap_get_bits_per_value(self)) { + mp_uint_t value = (mp_uint_t)mp_obj_get_int(value_obj); + if ((value >> common_hal_displayio_bitmap_get_bits_per_value(self)) != 0) { mp_raise_ValueError(translate("pixel value requires too many bits")); } common_hal_displayio_bitmap_set_pixel(self, x, y, value); @@ -179,8 +179,8 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val STATIC mp_obj_t displayio_bitmap_obj_fill(mp_obj_t self_in, mp_obj_t value_obj) { displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); - mp_int_t value = mp_obj_get_int(value_obj); - if (value >= 1 << common_hal_displayio_bitmap_get_bits_per_value(self)) { + mp_uint_t value = (mp_uint_t)mp_obj_get_int(value_obj); + if ((value >> common_hal_displayio_bitmap_get_bits_per_value(self)) != 0) { mp_raise_ValueError(translate("pixel value requires too many bits")); } common_hal_displayio_bitmap_fill(self, value); From 40eab95d3df5fc9b71e800f1af306ea391747cd8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 30 Jul 2020 04:27:32 +0200 Subject: [PATCH 0437/1293] Added translation using Weblate (Hindi) --- locale/hi.po | 3386 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 3386 insertions(+) create mode 100644 locale/hi.po diff --git a/locale/hi.po b/locale/hi.po new file mode 100644 index 0000000000..79b9748036 --- /dev/null +++ b/locale/hi.po @@ -0,0 +1,3386 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-07-28 16:57-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: hi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: main.c +msgid "" +"\n" +"Code done running. Waiting for reload.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + +#: py/obj.c +msgid " File \"%q\"" +msgstr "" + +#: py/obj.c +msgid " File \"%q\", line %d" +msgstr "" + +#: main.c +msgid " output:\n" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "%%c requires int or char" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q in use" +msgstr "" + +#: py/obj.c +msgid "%q index out of range" +msgstr "" + +#: py/obj.c +msgid "%q indices must be integers, not %s" +msgstr "" + +#: shared-bindings/vectorio/Polygon.c +msgid "%q list must be a list" +msgstr "" + +#: shared-bindings/memorymonitor/AllocationAlarm.c +msgid "%q must be >= 0" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c +#: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm.c +#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c +msgid "%q must be >= 1" +msgstr "" + +#: shared-module/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + +#: shared-bindings/fontio/BuiltinFont.c +msgid "%q should be an int" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "%q() takes %d positional arguments but %d were given" +msgstr "" + +#: py/argcheck.c +msgid "'%q' argument required" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects a label" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects a register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects a special register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects an FPU register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects an address of the form [a, b]" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects an integer" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects at most r%d" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects {r0, r1, ...}" +msgstr "" + +#: py/emitinlinextensa.c +#, c-format +msgid "'%s' integer %d is not within range %d..%d" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' integer 0x%x does not fit in mask 0x%x" +msgstr "" + +#: py/runtime.c +msgid "'%s' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%s' object does not support '%q'" +msgstr "" + +#: py/obj.c +#, c-format +msgid "'%s' object does not support item assignment" +msgstr "" + +#: py/obj.c +#, c-format +msgid "'%s' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%s' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "'%s' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +#, c-format +msgid "'%s' object is not callable" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "'%s' object is not iterable" +msgstr "" + +#: py/obj.c +#, c-format +msgid "'%s' object is not subscriptable" +msgstr "" + +#: py/objstr.c +msgid "'=' alignment not allowed in string format specifier" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "'S' and 'O' are not supported format types" +msgstr "" + +#: py/compile.c +msgid "'align' requires 1 argument" +msgstr "" + +#: py/compile.c +msgid "'await' outside function" +msgstr "" + +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + +#: py/compile.c +msgid "'break' outside loop" +msgstr "" + +#: py/compile.c +msgid "'continue' outside loop" +msgstr "" + +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + +#: py/compile.c +msgid "'data' requires at least 2 arguments" +msgstr "" + +#: py/compile.c +msgid "'data' requires integer arguments" +msgstr "" + +#: py/compile.c +msgid "'label' requires 1 argument" +msgstr "" + +#: py/compile.c +msgid "'return' outside function" +msgstr "" + +#: py/compile.c +msgid "'yield' outside function" +msgstr "" + +#: py/compile.c +msgid "*x must be assignment target" +msgstr "" + +#: py/obj.c +msgid ", in %q\n" +msgstr "" + +#: py/objcomplex.c +msgid "0.0 to a complex power" +msgstr "" + +#: py/modbuiltins.c +msgid "3-arg pow() not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/countio/Counter.c +#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +msgid "A hardware interrupt channel is already in use" +msgstr "" + +#: shared-bindings/_bleio/Address.c +#, c-format +msgid "Address must be %d bytes long" +msgstr "" + +#: shared-bindings/_bleio/Address.c +msgid "Address type out of range" +msgstr "" + +#: ports/nrf/common-hal/busio/I2C.c +msgid "All I2C peripherals are in use" +msgstr "" + +#: ports/nrf/common-hal/busio/SPI.c +msgid "All SPI peripherals are in use" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +msgid "All UART peripherals are in use" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "All event channels in use" +msgstr "" + +#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "All sync event channels in use" +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "All timers for this pin are in use" +msgstr "" + +#: ports/atmel-samd/common-hal/_pew/PewPew.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +msgid "All timers in use" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Already advertising." +msgstr "" + +#: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize.c +msgid "Already running" +msgstr "" + +#: ports/cxd56/common-hal/analogio/AnalogIn.c +msgid "AnalogIn not supported on given pin" +msgstr "" + +#: ports/cxd56/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/nrf/common-hal/analogio/AnalogOut.c +msgid "AnalogOut functionality not supported" +msgstr "" + +#: shared-bindings/analogio/AnalogOut.c +msgid "AnalogOut is only 16 bits. Value must be less than 65536." +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogOut.c +msgid "AnalogOut not supported on given pin" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +msgid "Another send is already active" +msgstr "" + +#: shared-bindings/pulseio/PulseOut.c +msgid "Array must contain halfwords (type 'H')" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +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" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Attempted heap allocation when MicroPython VM not running." +msgstr "" + +#: main.c +msgid "Auto-reload is off.\n" +msgstr "" + +#: main.c +msgid "" +"Auto-reload is on. Simply save files over USB to run them or enter REPL to " +"disable.\n" +msgstr "" + +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c +msgid "Below minimum frame rate" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must share a clock unit" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Bit depth must be multiple of 8." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + +#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +msgid "Both pins must support hardware interrupts" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "Brightness must be 0-1.0" +msgstr "" + +#: shared-bindings/supervisor/__init__.c +msgid "Brightness must be between 0 and 255" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Brightness not adjustable" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +#, c-format +msgid "Buffer + offset too small %d %d %d" +msgstr "" + +#: shared-module/usb_hid/Device.c +#, c-format +msgid "Buffer incorrect size. Should be %d bytes." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Buffer is not a bytearray." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Buffer is too small" +msgstr "" + +#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#, c-format +msgid "Buffer length %d too big. It must be less than %d" +msgstr "" + +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + +#: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c +msgid "Buffer must be at least length 1" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Buffer too large and unable to allocate" +msgstr "" + +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + +#: ports/atmel-samd/common-hal/displayio/ParallelBus.c +#: ports/nrf/common-hal/displayio/ParallelBus.c +#, c-format +msgid "Bus pin %d is already in use" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "Byte buffer must be 16 bytes." +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Bytes must be between 0 and 255." +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + +#: py/objtype.c +msgid "Call super().__init__() before accessing native object." +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +msgid "Can't set CCCD on local Characteristic" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c +msgid "Cannot delete values" +msgstr "" + +#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c +#: ports/nrf/common-hal/digitalio/DigitalInOut.c +msgid "Cannot get pull while in output mode" +msgstr "" + +#: ports/nrf/common-hal/microcontroller/Processor.c +msgid "Cannot get temperature" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Cannot output both channels on the same pin" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot read without MISO pin." +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Cannot record to a file" +msgstr "" + +#: shared-module/storage/__init__.c +msgid "Cannot remount '/' when USB is active." +msgstr "" + +#: 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 "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Cannot set value when direction is input." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Cannot specify RTS or CTS in RS485 mode" +msgstr "" + +#: py/objslice.c +msgid "Cannot subclass slice" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot transfer without MOSI and MISO pins." +msgstr "" + +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot write without MOSI pin." +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "CharacteristicBuffer writing not provided" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Clock pin init failed." +msgstr "" + +#: shared-module/bitbangio/I2C.c +msgid "Clock stretch too long" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Clock unit in use" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Column entry must be digitalio.DigitalInOut" +msgstr "" + +#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c +#: shared-bindings/displayio/ParallelBus.c +msgid "Command must be an int between 0 and 255" +msgstr "" + +#: shared-bindings/_bleio/Connection.c +msgid "" +"Connection has been disconnected and can no longer be used. Create a new " +"connection." +msgstr "" + +#: py/persistentcode.c +msgid "Corrupt .mpy file" +msgstr "" + +#: py/emitglue.c +msgid "Corrupt raw code" +msgstr "" + +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +msgid "Could not initialize UART" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate decoder" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate first buffer" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate input buffer" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate second buffer" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Crash into the HardFault_Handler." +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "DAC already in use" +msgstr "" + +#: ports/atmel-samd/common-hal/displayio/ParallelBus.c +#: ports/nrf/common-hal/displayio/ParallelBus.c +msgid "Data 0 pin must be byte aligned" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Data chunk must follow fmt chunk" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Data too large for advertisement packet" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Destination capacity is smaller than destination_length." +msgstr "" + +#: ports/nrf/common-hal/audiobusio/I2SOut.c +msgid "Device in use" +msgstr "" + +#: ports/cxd56/common-hal/digitalio/DigitalInOut.c +msgid "DigitalInOut not supported on given pin" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Display must have a 16 bit colorspace." +msgstr "" + +#: 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 "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Drive mode not used when direction is input." +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +msgid "EXTINT channel already in use" +msgstr "" + +#: extmod/modure.c +msgid "Error in regex" +msgstr "" + +#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/terminalio/Terminal.c +msgid "Expected a %q" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c +msgid "Expected a Characteristic" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c +msgid "Expected a Service" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +#: shared-bindings/_bleio/Service.c +msgid "Expected a UUID" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Expected an Address" +msgstr "" + +#: shared-module/_pixelbuf/PixelBuf.c +#, c-format +msgid "Expected tuple of length %d, got %d" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Extended advertisements with scan response not supported." +msgstr "" + +#: extmod/ulab/code/fft/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + +#: ports/nrf/sd_mutex.c +#, c-format +msgid "Failed to acquire mutex, err 0x%04x" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +msgid "Failed to allocate RX buffer" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c +#, c-format +msgid "Failed to allocate RX buffer of %d bytes" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to connect: internal error" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to connect: timeout" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Failed to parse MP3 file" +msgstr "" + +#: ports/nrf/sd_mutex.c +#, c-format +msgid "Failed to release mutex, err 0x%04x" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + +#: py/moduerrno.c +msgid "File exists" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "Frequency captured is above capability. Capture Paused." +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + +#: 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 "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Group already used" +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Group full" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + +#: extmod/vfs_posix_file.c py/objstringio.c +msgid "I/O operation on closed file" +msgstr "" + +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + +#: py/persistentcode.c +msgid "" +"Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" +"mpy-update for more info." +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Incorrect buffer size" +msgstr "" + +#: py/moduerrno.c +msgid "Input/output error" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Invalid %q pin" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +msgid "Invalid BMP file" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/stm/common-hal/busio/I2C.c +msgid "Invalid I2C pin selection" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PWMOut.c +#: ports/cxd56/common-hal/pulseio/PWMOut.c +#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +msgid "Invalid PWM frequency" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "Invalid SPI pin selection" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid UART pin selection" +msgstr "" + +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c +msgid "Invalid argument" +msgstr "" + +#: shared-module/displayio/Bitmap.c +msgid "Invalid bits per value" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Invalid buffer size" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Invalid byteorder string" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "Invalid capture period. Valid range: 1 - 500" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid channel count" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Invalid direction." +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid file" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid format chunk size" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Invalid memory access." +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +msgid "Invalid number of bits" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c +msgid "Invalid phase" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +msgid "Invalid pin" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Invalid pin for left channel" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Invalid pin for right channel" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/SPI.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +msgid "Invalid pins" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c +msgid "Invalid polarity" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c +msgid "Invalid properties" +msgstr "" + +#: shared-bindings/microcontroller/__init__.c +msgid "Invalid run mode." +msgstr "" + +#: shared-module/_bleio/Attribute.c +msgid "Invalid security_mode" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid voice" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid voice count" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid wave file" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + +#: py/compile.c +msgid "LHS of keyword arg must be an id" +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Layer already in a group." +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Layer must be a Group or TileGrid subclass." +msgstr "" + +#: py/objslice.c +msgid "Length must be an int" +msgstr "" + +#: py/objslice.c +msgid "Length must be non-negative" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "MISO pin init failed." +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "MOSI pin init failed." +msgstr "" + +#: shared-module/displayio/Shape.c +#, c-format +msgid "Maximum x value when mirrored is %d" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "MicroPython NLR jump failed. Likely memory corruption." +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "MicroPython fatal error." +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Microphone startup delay must be in range 0.0 to 1.0" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + +#: shared-bindings/displayio/Group.c +msgid "Must be a %q subclass." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide SCK pin" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + +#: py/parse.c +msgid "Name too long" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +msgid "No CCCD for this Characteristic" +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "No DAC on chip" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "No DMA channel found" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c +msgid "No RX pin" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c +msgid "No TX pin" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "No available clocks" +msgstr "" + +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + +#: shared-bindings/board/__init__.c +msgid "No default %q bus" +msgstr "" + +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +msgid "No free GCLKs" +msgstr "" + +#: shared-bindings/os/__init__.c +msgid "No hardware random available" +msgstr "" + +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "No hardware support on pin" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "No long integer support" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + +#: shared-module/touchio/TouchIn.c +msgid "No pulldown on pin; 1Mohm recommended" +msgstr "" + +#: py/moduerrno.c +msgid "No space left on device" +msgstr "" + +#: py/moduerrno.c +msgid "No such file/directory" +msgstr "" + +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "No timer available" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "Not connected" +msgstr "" + +#: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c +#: shared-bindings/audiopwmio/PWMAudioOut.c +msgid "Not playing" +msgstr "" + +#: shared-bindings/util.c +msgid "" +"Object has been deinitialized and can no longer be used. Create a new object." +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +msgid "Odd parity is not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Only 8 or 16 bit mono with " +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +#, c-format +msgid "" +"Only Windows format, uncompressed BMP supported: given header size is %d" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +#, c-format +msgid "" +"Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " +"%d bpp given" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Oversample must be multiple of 8." +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "" +"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "" +"PWM frequency not writable when variable_frequency is False on construction." +msgstr "" + +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c +msgid "ParallelBus not yet supported" +msgstr "" + +#: py/moduerrno.c +msgid "Permission denied" +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogIn.c +#: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c +#: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Pin does not have ADC capabilities" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + +#: py/builtinhelp.c +msgid "Plus any modules on the filesystem\n" +msgstr "" + +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + +#: shared-bindings/ps2io/Ps2.c +msgid "Pop from an empty Ps2 buffer" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Prefix buffer must be on the heap" +msgstr "" + +#: main.c +msgid "Press any key to enter the REPL. Use CTRL-D to reload." +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pull not used when direction is output." +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "RS485 inversion specified when not in RS485 mode" +msgstr "" + +#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/rtc/RTC.c +msgid "RTC calibration is not supported on this board" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "RTC is not supported on this board" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "RTS/CTS/RS485 Not yet supported on this device" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c +msgid "Read-only" +msgstr "" + +#: extmod/vfs_fat.c py/moduerrno.c +msgid "Read-only filesystem" +msgstr "" + +#: shared-module/displayio/Bitmap.c +msgid "Read-only object" +msgstr "" + +#: shared-bindings/displayio/EPaperDisplay.c +msgid "Refresh too soon" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Right channel unsupported" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Row entry must be digitalio.DigitalInOut" +msgstr "" + +#: main.c +msgid "Running in safe mode! Auto-reload is off.\n" +msgstr "" + +#: main.c +msgid "Running in safe mode! Not running saved code.\n" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +msgid "SDA or SCL needs a pull up" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Sample rate must be positive" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#, c-format +msgid "Sample rate too high. It must be less than %d" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Scan already in progess. Stop with stop_scan." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Selected CTS pin not valid" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Selected RTS pin not valid" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Serializer in use" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Slice and value different lengths." +msgstr "" + +#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c +#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c +msgid "Slices not supported" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "" + +#: shared-bindings/supervisor/__init__.c +msgid "Stack size must be at least 256" +msgstr "" + +#: shared-bindings/multiterminal/__init__.c +msgid "Stream missing readinto() or write() method." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The CircuitPython heap was corrupted because the stack was too small.\n" +"Please increase the stack size if you know how, or if not:" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The `microcontroller` module was used to boot into safe mode. Press reset to " +"exit safe mode.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The microcontroller's power dipped. Make sure your power supply provides\n" +"enough power for the whole circuit and press reset (after ejecting " +"CIRCUITPY).\n" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's bits_per_sample does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's channel count does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's sample rate does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's signedness does not match the mixer's" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile height must exactly divide bitmap height" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c +msgid "Tile index out of bounds" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile value out of bounds" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile width must exactly divide bitmap width" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +#, c-format +msgid "Timeout is too long: Maximum timeout length is %d seconds" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample." +msgstr "" + +#: shared-module/displayio/__init__.c +msgid "Too many display busses" +msgstr "" + +#: shared-module/displayio/__init__.c +msgid "Too many displays" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + +#: py/obj.c +msgid "Traceback (most recent call last):\n" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "Tuple or struct_time argument required" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + +#: shared-module/usb_hid/Device.c +msgid "USB Busy" +msgstr "" + +#: shared-module/usb_hid/Device.c +msgid "USB Error" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID integer value must be 0-0xffff" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID value is not str, int or byte buffer" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Unable to allocate buffers for signed conversion" +msgstr "" + +#: shared-module/displayio/I2CDisplay.c +#, c-format +msgid "Unable to find I2C Display at %x" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Unable to find free GCLK" +msgstr "" + +#: py/parse.c +msgid "Unable to init parser" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +msgid "Unable to read color palette data" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Unable to write to nvm." +msgstr "" + +#: ports/nrf/common-hal/_bleio/UUID.c +msgid "Unexpected nrfx uuid type" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown security error: 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown soft device error: %04x" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +#, c-format +msgid "Unmatched number of items on RHS (expected %d, got %d)." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "" +"Unspecified issue. Can be that the pairing prompt on the other device was " +"declined or ignored." +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c +msgid "Unsupported baudrate" +msgstr "" + +#: shared-module/displayio/display_core.c +msgid "Unsupported display bus type" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Unsupported format" +msgstr "" + +#: py/moduerrno.c +msgid "Unsupported operation" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Unsupported pull value." +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +msgid "Value length != required fixed length" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +msgid "Value length > max_length" +msgstr "" + +#: py/emitnative.c +msgid "Viper functions don't currently support more than 4 arguments" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + +#: main.c +msgid "WARNING: Your code filename has two extensions\n" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +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 "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + +#: py/builtinhelp.c +#, c-format +msgid "" +"Welcome to Adafruit CircuitPython %s!\n" +"\n" +"Please visit learn.adafruit.com/category/circuitpython for project guides.\n" +"\n" +"To list built-in modules please do `help(\"modules\")`.\n" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Writes not supported on Characteristic" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "You are in safe mode: something unanticipated happened.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "You requested starting safe mode by " +msgstr "" + +#: py/objtype.c +msgid "__init__() should return None" +msgstr "" + +#: py/objtype.c +#, c-format +msgid "__init__() should return None, not '%s'" +msgstr "" + +#: py/objobject.c +msgid "__new__ arg must be a user-type" +msgstr "" + +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c +msgid "a bytes-like object is required" +msgstr "" + +#: lib/embed/abort_.c +msgid "abort() called" +msgstr "" + +#: extmod/machine_mem.c +#, c-format +msgid "address %08x is not aligned to %d bytes" +msgstr "" + +#: shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "address out of bounds" +msgstr "" + +#: shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "addresses is empty" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + +#: py/modbuiltins.c +msgid "arg is an empty sequence" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + +#: py/runtime.c +msgid "argument has wrong type" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + +#: py/argcheck.c shared-bindings/_stage/__init__.c +#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +msgid "argument num/types mismatch" +msgstr "" + +#: py/runtime.c +msgid "argument should be a '%q' not a '%q'" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + +#: py/objarray.c shared-bindings/nvm/ByteArray.c +msgid "array/bytes required on right side" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + +#: py/objstr.c +msgid "attributes not supported yet" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + +#: py/builtinevex.c +msgid "bad compile mode" +msgstr "" + +#: py/objstr.c +msgid "bad conversion specifier" +msgstr "" + +#: py/objstr.c +msgid "bad format string" +msgstr "" + +#: py/binary.c +msgid "bad typecode" +msgstr "" + +#: py/emitnative.c +msgid "binary op %q not implemented" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "bits must be 7, 8 or 9" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "bits_per_sample must be 8 or 16" +msgstr "" + +#: py/emitinlinethumb.c +msgid "branch not in range" +msgstr "" + +#: shared-bindings/audiocore/RawSample.c +msgid "buffer must be a bytes-like object" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "buffer size must match format" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +msgid "buffer slices must be of equal length" +msgstr "" + +#: py/modstruct.c shared-bindings/struct/__init__.c +#: shared-module/struct/__init__.c +msgid "buffer too small" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "buttons must be digitalio.DigitalInOut" +msgstr "" + +#: py/vm.c +msgid "byte code not implemented" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "byteorder is not a string" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +msgid "bytes > 8 bits not supported" +msgstr "" + +#: py/objstr.c +msgid "bytes value out of range" +msgstr "" + +#: ports/atmel-samd/bindings/samd/Clock.c +msgid "calibration is out of range" +msgstr "" + +#: ports/atmel-samd/bindings/samd/Clock.c +msgid "calibration is read only" +msgstr "" + +#: ports/atmel-samd/common-hal/rtc/RTC.c +msgid "calibration value out of range +/-127" +msgstr "" + +#: py/emitinlinethumb.c +msgid "can only have up to 4 parameters to Thumb assembly" +msgstr "" + +#: py/emitinlinextensa.c +msgid "can only have up to 4 parameters to Xtensa assembly" +msgstr "" + +#: py/persistentcode.c +msgid "can only save bytecode" +msgstr "" + +#: py/objtype.c +msgid "can't add special method to already-subclassed class" +msgstr "" + +#: py/compile.c +msgid "can't assign to expression" +msgstr "" + +#: py/obj.c +#, c-format +msgid "can't convert %s to complex" +msgstr "" + +#: py/obj.c +#, c-format +msgid "can't convert %s to float" +msgstr "" + +#: py/obj.c +#, c-format +msgid "can't convert %s to int" +msgstr "" + +#: py/objstr.c +msgid "can't convert '%q' object to %q implicitly" +msgstr "" + +#: py/objint.c +msgid "can't convert NaN to int" +msgstr "" + +#: shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert address to int" +msgstr "" + +#: py/objint.c +msgid "can't convert inf to int" +msgstr "" + +#: py/obj.c +msgid "can't convert to complex" +msgstr "" + +#: py/obj.c +msgid "can't convert to float" +msgstr "" + +#: py/obj.c +msgid "can't convert to int" +msgstr "" + +#: py/objstr.c +msgid "can't convert to str implicitly" +msgstr "" + +#: py/compile.c +msgid "can't declare nonlocal in outer code" +msgstr "" + +#: py/compile.c +msgid "can't delete expression" +msgstr "" + +#: py/emitnative.c +msgid "can't do binary op between '%q' and '%q'" +msgstr "" + +#: py/objcomplex.c +msgid "can't do truncated division of a complex number" +msgstr "" + +#: py/compile.c +msgid "can't have multiple **x" +msgstr "" + +#: py/compile.c +msgid "can't have multiple *x" +msgstr "" + +#: py/emitnative.c +msgid "can't implicitly convert '%q' to 'bool'" +msgstr "" + +#: py/emitnative.c +msgid "can't load from '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't load with '%q' index" +msgstr "" + +#: py/objgenerator.c +msgid "can't pend throw to just-started generator" +msgstr "" + +#: py/objgenerator.c +msgid "can't send non-None value to a just-started generator" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + +#: py/objnamedtuple.c +msgid "can't set attribute" +msgstr "" + +#: py/emitnative.c +msgid "can't store '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't store to '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't store with '%q' index" +msgstr "" + +#: py/objstr.c +msgid "" +"can't switch from automatic field numbering to manual field specification" +msgstr "" + +#: py/objstr.c +msgid "" +"can't switch from manual field specification to automatic field numbering" +msgstr "" + +#: py/objtype.c +msgid "cannot create '%q' instances" +msgstr "" + +#: py/objtype.c +msgid "cannot create instance" +msgstr "" + +#: py/runtime.c +msgid "cannot import name %q" +msgstr "" + +#: py/builtinimport.c +msgid "cannot perform relative import" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + +#: py/emitnative.c +msgid "casting" +msgstr "" + +#: shared-bindings/_stage/Text.c +msgid "chars buffer too small" +msgstr "" + +#: py/modbuiltins.c +msgid "chr() arg not in range(0x110000)" +msgstr "" + +#: py/modbuiltins.c +msgid "chr() arg not in range(256)" +msgstr "" + +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be a buffer, tuple, list, or int" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be a bytearray or array of type 'b' or 'B'" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color must be between 0x000000 and 0xffffff" +msgstr "" + +#: shared-bindings/displayio/ColorConverter.c +msgid "color should be an int" +msgstr "" + +#: py/objcomplex.c +msgid "complex division by zero" +msgstr "" + +#: py/objfloat.c py/parsenum.c +msgid "complex values not supported" +msgstr "" + +#: extmod/moduzlib.c +msgid "compression header" +msgstr "" + +#: py/parse.c +msgid "constant must be an integer" +msgstr "" + +#: py/emitnative.c +msgid "conversion to object" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "data must be of equal length" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + +#: py/parsenum.c +msgid "decimal numbers not supported" +msgstr "" + +#: py/compile.c +msgid "default 'except' must be last" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "" +"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "destination buffer must be an array of type 'H' for bit_depth = 16" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "destination_length must be an int >= 0" +msgstr "" + +#: py/objdict.c +msgid "dict update sequence has wrong length" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + +#: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c +#: shared-bindings/math/__init__.c +msgid "division by zero" +msgstr "" + +#: py/objdeque.c +msgid "empty" +msgstr "" + +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "" + +#: py/objstr.c +msgid "empty separator" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "empty sequence" +msgstr "" + +#: py/objstr.c +msgid "end of format while looking for conversion specifier" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "end_x should be an int" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +#, c-format +msgid "error = 0x%08lX" +msgstr "" + +#: py/runtime.c +msgid "exceptions must derive from BaseException" +msgstr "" + +#: py/objstr.c +msgid "expected ':' after format specifier" +msgstr "" + +#: py/obj.c +msgid "expected tuple/list" +msgstr "" + +#: py/modthread.c +msgid "expecting a dict for keyword args" +msgstr "" + +#: py/compile.c +msgid "expecting an assembler instruction" +msgstr "" + +#: py/compile.c +msgid "expecting just a value for set" +msgstr "" + +#: py/compile.c +msgid "expecting key:value for dict" +msgstr "" + +#: py/argcheck.c +msgid "extra keyword arguments given" +msgstr "" + +#: py/argcheck.c +msgid "extra positional arguments given" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c +#: shared-bindings/displayio/OnDiskBitmap.c +msgid "file must be a file opened in byte mode" +msgstr "" + +#: shared-bindings/storage/__init__.c +msgid "filesystem must provide mount method" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "first argument must be a function" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + +#: py/objtype.c +msgid "first argument to super() must be type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + +#: py/objint.c +msgid "float too big" +msgstr "" + +#: shared-bindings/_stage/Text.c +msgid "font must be 2048 bytes long" +msgstr "" + +#: py/objstr.c +msgid "format requires a dict" +msgstr "" + +#: py/objdeque.c +msgid "full" +msgstr "" + +#: py/argcheck.c +msgid "function does not take keyword arguments" +msgstr "" + +#: py/argcheck.c +#, c-format +msgid "function expected at most %d arguments, got %d" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "function got multiple values for argument '%q'" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + +#: extmod/ulab/code/compare/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + +#: py/argcheck.c +#, c-format +msgid "function missing %d required positional arguments" +msgstr "" + +#: py/bc.c +msgid "function missing keyword-only argument" +msgstr "" + +#: py/bc.c +msgid "function missing required keyword argument '%q'" +msgstr "" + +#: py/bc.c +#, c-format +msgid "function missing required positional argument #%d" +msgstr "" + +#: py/argcheck.c py/bc.c py/objnamedtuple.c +#, c-format +msgid "function takes %d positional arguments but %d were given" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "function takes exactly 9 arguments" +msgstr "" + +#: py/objgenerator.c +msgid "generator already executing" +msgstr "" + +#: py/objgenerator.c +msgid "generator ignored GeneratorExit" +msgstr "" + +#: shared-bindings/_stage/Layer.c +msgid "graphic must be 2048 bytes long" +msgstr "" + +#: extmod/moduheapq.c +msgid "heap must be a list" +msgstr "" + +#: py/compile.c +msgid "identifier redefined as global" +msgstr "" + +#: py/compile.c +msgid "identifier redefined as nonlocal" +msgstr "" + +#: py/objstr.c +msgid "incomplete format" +msgstr "" + +#: py/objstr.c +msgid "incomplete format key" +msgstr "" + +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +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 "" + +#: extmod/ulab/code/approx/approx.c +msgid "initial values must be iterable" +msgstr "" + +#: py/compile.c +msgid "inline assembler must be a function" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "input vectors must be of equal length" +msgstr "" + +#: py/parsenum.c +msgid "int() arg 2 must be >= 2 and <= 36" +msgstr "" + +#: py/objstr.c +msgid "integer required" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +#, c-format +msgid "interval must be in range %s-%s" +msgstr "" + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "" + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "" + +#: py/objstr.c +msgid "invalid format specifier" +msgstr "" + +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "" + +#: py/compile.c +msgid "invalid micropython decorator" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "invalid step" +msgstr "" + +#: py/compile.c py/parse.c +msgid "invalid syntax" +msgstr "" + +#: py/parsenum.c +msgid "invalid syntax for integer" +msgstr "" + +#: py/parsenum.c +#, c-format +msgid "invalid syntax for integer with base %d" +msgstr "" + +#: py/parsenum.c +msgid "invalid syntax for number" +msgstr "" + +#: py/objtype.c +msgid "issubclass() arg 1 must be a class" +msgstr "" + +#: py/objtype.c +msgid "issubclass() arg 2 must be a class or a tuple of classes" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "iterations did not converge" +msgstr "" + +#: py/objstr.c +msgid "join expects a list of str/bytes objects consistent with self object" +msgstr "" + +#: py/argcheck.c +msgid "keyword argument(s) not yet implemented - use normal args instead" +msgstr "" + +#: py/bc.c +msgid "keywords must be strings" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +msgid "label '%q' not defined" +msgstr "" + +#: py/compile.c +msgid "label redefined" +msgstr "" + +#: py/stream.c +msgid "length argument not allowed for this type" +msgstr "" + +#: shared-bindings/audiomixer/MixerVoice.c +msgid "level must be between 0 and 1" +msgstr "" + +#: py/objarray.c +msgid "lhs and rhs should be compatible" +msgstr "" + +#: py/emitnative.c +msgid "local '%q' has type '%q' but source is '%q'" +msgstr "" + +#: py/emitnative.c +msgid "local '%q' used before type known" +msgstr "" + +#: py/vm.c +msgid "local variable referenced before assignment" +msgstr "" + +#: py/objint.c +msgid "long int not supported in this build" +msgstr "" + +#: py/parse.c +msgid "malformed f-string" +msgstr "" + +#: shared-bindings/_stage/Layer.c +msgid "map buffer too small" +msgstr "" + +#: py/modmath.c shared-bindings/math/__init__.c +msgid "math domain error" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "matrix is not positive definite" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +#, c-format +msgid "max_length must be 0-%d when fixed_length is %s" +msgstr "" + +#: py/runtime.c +msgid "maximum recursion depth exceeded" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "memory allocation failed, allocating %u bytes" +msgstr "" + +#: py/runtime.c +msgid "memory allocation failed, heap is locked" +msgstr "" + +#: py/builtinimport.c +msgid "module not found" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + +#: py/compile.c +msgid "multiple *x in assignment" +msgstr "" + +#: py/objtype.c +msgid "multiple bases have instance lay-out conflict" +msgstr "" + +#: py/objtype.c +msgid "multiple inheritance not supported" +msgstr "" + +#: py/emitnative.c +msgid "must raise an object" +msgstr "" + +#: py/modbuiltins.c +msgid "must use keyword argument for key function" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + +#: py/runtime.c +msgid "name '%q' is not defined" +msgstr "" + +#: py/runtime.c +msgid "name not defined" +msgstr "" + +#: py/compile.c +msgid "name reused for argument" +msgstr "" + +#: py/emitnative.c +msgid "native yield" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "need more than %d values to unpack" +msgstr "" + +#: py/objint_longlong.c py/objint_mpz.c py/runtime.c +msgid "negative power with no float support" +msgstr "" + +#: py/objint_mpz.c py/runtime.c +msgid "negative shift count" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + +#: py/vm.c +msgid "no active exception to reraise" +msgstr "" + +#: shared-bindings/socket/__init__.c shared-module/network/__init__.c +msgid "no available NIC" +msgstr "" + +#: py/compile.c +msgid "no binding for nonlocal found" +msgstr "" + +#: py/builtinimport.c +msgid "no module named '%q'" +msgstr "" + +#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c +#: shared-bindings/displayio/ParallelBus.c +msgid "no reset pin available" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + +#: py/runtime.c +msgid "no such attribute" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Connection.c +msgid "non-UUID found in service_uuids_whitelist" +msgstr "" + +#: py/compile.c +msgid "non-default argument follows default argument" +msgstr "" + +#: extmod/modubinascii.c +msgid "non-hex digit found" +msgstr "" + +#: py/compile.c +msgid "non-keyword arg after */**" +msgstr "" + +#: py/compile.c +msgid "non-keyword arg after keyword arg" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "not a 128-bit UUID" +msgstr "" + +#: py/objstr.c +msgid "not all arguments converted during string formatting" +msgstr "" + +#: py/objstr.c +msgid "not enough arguments for format string" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "number of points must be at least 2" +msgstr "" + +#: py/obj.c +#, c-format +msgid "object '%s' is not a tuple or list" +msgstr "" + +#: py/obj.c +msgid "object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "object does not support item deletion" +msgstr "" + +#: py/obj.c +msgid "object has no len" +msgstr "" + +#: py/obj.c +msgid "object is not subscriptable" +msgstr "" + +#: py/runtime.c +msgid "object not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "object not callable" +msgstr "" + +#: py/sequence.c shared-bindings/displayio/Group.c +msgid "object not in sequence" +msgstr "" + +#: py/runtime.c +msgid "object not iterable" +msgstr "" + +#: py/obj.c +#, c-format +msgid "object of type '%s' has no len()" +msgstr "" + +#: py/obj.c +msgid "object with buffer protocol required" +msgstr "" + +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "" + +#: py/objstr.c py/objstrunicode.c +msgid "offset out of bounds" +msgstr "" + +#: ports/nrf/common-hal/audiobusio/PDMIn.c +msgid "only bit_depth=16 is supported" +msgstr "" + +#: ports/nrf/common-hal/audiobusio/PDMIn.c +msgid "only sample_rate=16000 is supported" +msgstr "" + +#: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c +#: shared-bindings/nvm/ByteArray.c +msgid "only slices with step=1 (aka None) are supported" +msgstr "" + +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + +#: py/modbuiltins.c +msgid "ord expects a character" +msgstr "" + +#: py/modbuiltins.c +#, c-format +msgid "ord() expected a character, but string of length %d found" +msgstr "" + +#: py/objint_mpz.c +msgid "overflow converting long int to machine word" +msgstr "" + +#: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c +msgid "palette must be 32 bytes long" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "palette_index should be an int" +msgstr "" + +#: py/compile.c +msgid "parameter annotation must be an identifier" +msgstr "" + +#: py/emitinlinextensa.c +msgid "parameters must be registers in sequence a2 to a5" +msgstr "" + +#: py/emitinlinethumb.c +msgid "parameters must be registers in sequence r0 to r3" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "pixel coordinates out of bounds" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "pixel value requires too many bits" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" +msgstr "" + +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "" + +#: py/objset.c +msgid "pop from an empty set" +msgstr "" + +#: py/objlist.c +msgid "pop from empty list" +msgstr "" + +#: py/objdict.c +msgid "popitem(): dictionary is empty" +msgstr "" + +#: py/objint_mpz.c +msgid "pow() 3rd argument cannot be 0" +msgstr "" + +#: py/objint_mpz.c +msgid "pow() with 3 arguments requires integers" +msgstr "" + +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "" + +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + +#: extmod/ulab/code/fft/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + +#: py/builtinimport.c +msgid "relative import" +msgstr "" + +#: py/obj.c +#, c-format +msgid "requested length %d but object has length %d" +msgstr "" + +#: py/compile.c +msgid "return annotation must be an identifier" +msgstr "" + +#: py/emitnative.c +msgid "return expected '%q' but got '%q'" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + +#: py/objstr.c +msgid "rsplit(None,n)" +msgstr "" + +#: shared-bindings/audiocore/RawSample.c +msgid "" +"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " +"'B'" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "sampling rate out of range" +msgstr "" + +#: py/modmicropython.c +msgid "schedule stack full" +msgstr "" + +#: lib/utils/pyexec.c py/builtinimport.c +msgid "script compilation not supported" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + +#: py/objstr.c +msgid "sign not allowed in string format specifier" +msgstr "" + +#: py/objstr.c +msgid "sign not allowed with integer format specifier 'c'" +msgstr "" + +#: py/objstr.c +msgid "single '}' encountered in format string" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "sleep length must be non-negative" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + +#: py/objslice.c py/sequence.c +msgid "slice step cannot be zero" +msgstr "" + +#: py/objint.c py/sequence.c +msgid "small int overflow" +msgstr "" + +#: main.c +msgid "soft reboot\n" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + +#: py/objstr.c +msgid "start/end indices" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "start_x should be an int" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "step must be non-zero" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "stop must be 1 or 2" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "stop not reachable from start" +msgstr "" + +#: py/stream.c +msgid "stream operation not supported" +msgstr "" + +#: py/objstrunicode.c +msgid "string index out of range" +msgstr "" + +#: py/objstrunicode.c +#, c-format +msgid "string indices must be integers, not %s" +msgstr "" + +#: py/stream.c +msgid "string not supported; use bytes or bytearray" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: index out of range" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "" + +#: py/objarray.c py/objstr.c +msgid "substring not found" +msgstr "" + +#: py/compile.c +msgid "super() can't find self" +msgstr "" + +#: extmod/modujson.c +msgid "syntax error in JSON" +msgstr "" + +#: extmod/moductypes.c +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 "" + +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "timeout must be 0.0-100.0 seconds" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "timeout must be >= 0.0" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "timestamp out of range for platform time_t" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "too many arguments provided with the given format" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "too many values to unpack (expected %d)" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c +msgid "tuple index out of range" +msgstr "" + +#: py/obj.c +msgid "tuple/list has wrong length" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "tuple/list required on RHS" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c +msgid "tx and rx cannot both be None" +msgstr "" + +#: py/objtype.c +msgid "type '%q' is not an acceptable base type" +msgstr "" + +#: py/objtype.c +msgid "type is not an acceptable base type" +msgstr "" + +#: py/runtime.c +msgid "type object '%q' has no attribute '%q'" +msgstr "" + +#: py/objtype.c +msgid "type takes 1 or 3 arguments" +msgstr "" + +#: py/objint_longlong.c +msgid "ulonglong too large" +msgstr "" + +#: py/emitnative.c +msgid "unary op %q not implemented" +msgstr "" + +#: py/parse.c +msgid "unexpected indent" +msgstr "" + +#: py/bc.c +msgid "unexpected keyword argument" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "unexpected keyword argument '%q'" +msgstr "" + +#: py/lexer.c +msgid "unicode name escapes" +msgstr "" + +#: py/parse.c +msgid "unindent does not match any outer indentation level" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unknown conversion specifier %c" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unknown format code '%c' for object of type '%s'" +msgstr "" + +#: py/compile.c +msgid "unknown type" +msgstr "" + +#: py/emitnative.c +msgid "unknown type '%q'" +msgstr "" + +#: py/objstr.c +msgid "unmatched '{' in format" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "unreadable attribute" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c +msgid "unsupported %q type" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "unsupported Thumb instruction '%s' with %d arguments" +msgstr "" + +#: py/emitinlinextensa.c +#, c-format +msgid "unsupported Xtensa instruction '%s' with %d arguments" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unsupported format character '%c' (0x%x) at index %d" +msgstr "" + +#: py/runtime.c +msgid "unsupported type for %q: '%s'" +msgstr "" + +#: py/runtime.c +msgid "unsupported type for operator" +msgstr "" + +#: py/runtime.c +msgid "unsupported types for %q: '%s', '%s'" +msgstr "" + +#: py/objint.c +#, c-format +msgid "value must fit in %d byte(s)" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "value_count must be > 0" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "window must be <= interval" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "wrong input type" +msgstr "" + +#: extmod/ulab/code/ulab_create.c py/objstr.c +msgid "wrong number of arguments" +msgstr "" + +#: py/runtime.c +msgid "wrong number of values to unpack" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "wrong output type" +msgstr "" + +#: shared-module/displayio/Shape.c +msgid "x value out of bounds" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "y should be an int" +msgstr "" + +#: shared-module/displayio/Shape.c +msgid "y value out of bounds" +msgstr "" + +#: py/objrange.c +msgid "zero step" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" From af135a75607f150632cbfa049f79cb72190f86fd Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 23 Jul 2020 10:39:14 -0500 Subject: [PATCH 0438/1293] atmel-samd: move samd-specific script --- ports/atmel-samd/Makefile | 2 +- {tools => ports/atmel-samd/tools}/mksdiodata.py | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename {tools => ports/atmel-samd/tools}/mksdiodata.py (100%) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 25ab2c4aa7..65542354e6 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -361,7 +361,7 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) SRC_QSTR += $(HEADER_BUILD)/sdiodata.h -$(HEADER_BUILD)/sdiodata.h: $(TOP)/tools/mksdiodata.py | $(HEADER_BUILD) +$(HEADER_BUILD)/sdiodata.h: tools/mksdiodata.py | $(HEADER_BUILD) $(Q)$(PYTHON3) $< > $@ SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) diff --git a/tools/mksdiodata.py b/ports/atmel-samd/tools/mksdiodata.py similarity index 100% rename from tools/mksdiodata.py rename to ports/atmel-samd/tools/mksdiodata.py From d30f11163c60bbbb85606b8343a89ef646c100d4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 27 May 2020 09:09:52 -0500 Subject: [PATCH 0439/1293] stm: enable SD module in HAL --- ports/stm/hal_conf/stm32_hal_conf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm/hal_conf/stm32_hal_conf.h b/ports/stm/hal_conf/stm32_hal_conf.h index b78afc64b3..c91be86fdf 100644 --- a/ports/stm/hal_conf/stm32_hal_conf.h +++ b/ports/stm/hal_conf/stm32_hal_conf.h @@ -61,7 +61,7 @@ #define HAL_RTC_MODULE_ENABLED // #define HAL_SAI_MODULE_ENABLED // #define HAL_SDRAM_MODULE_ENABLED -// #define HAL_SD_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED // #define HAL_SMARTCARD_MODULE_ENABLED // #define HAL_SMBUS_MODULE_ENABLED // #define HAL_SPDIFRX_MODULE_ENABLED From 4adbd23b75df7e484b8264563d5c7e51c0f6a3b2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 26 Jun 2020 10:13:02 -0500 Subject: [PATCH 0440/1293] stm: Add sdioio support for feather_stm32f405_express Currently, only the bus specs of the stm32f405xx have been coded. Other stm-family chips need (at a minimum) the specs added in their periph.[ch] files. --- .../boards/feather_stm32f405_express/pins.c | 16 + ports/stm/common-hal/busio/SPI.c | 2 +- ports/stm/common-hal/sdioio/SDCard.c | 356 ++++++++++++++++++ ports/stm/common-hal/sdioio/SDCard.h | 50 +++ ports/stm/common-hal/sdioio/__init__.c | 0 ports/stm/common-hal/sdioio/__init__.h | 0 ports/stm/mpconfigport.mk | 1 + .../peripherals/stm32f4/stm32f405xx/periph.c | 22 ++ .../peripherals/stm32f4/stm32f405xx/periph.h | 11 + ports/stm/supervisor/port.c | 6 + 10 files changed, 463 insertions(+), 1 deletion(-) create mode 100644 ports/stm/common-hal/sdioio/SDCard.c create mode 100644 ports/stm/common-hal/sdioio/SDCard.h create mode 100644 ports/stm/common-hal/sdioio/__init__.c create mode 100644 ports/stm/common-hal/sdioio/__init__.h diff --git a/ports/stm/boards/feather_stm32f405_express/pins.c b/ports/stm/boards/feather_stm32f405_express/pins.c index ebc8fa337e..866b276510 100644 --- a/ports/stm/boards/feather_stm32f405_express/pins.c +++ b/ports/stm/boards/feather_stm32f405_express/pins.c @@ -1,5 +1,17 @@ +#include "py/objtuple.h" #include "shared-bindings/board/__init__.h" +const mp_rom_obj_tuple_t sdio_data_tuple = { + {&mp_type_tuple}, + 4, + { + MP_ROM_PTR(&pin_PC08), + MP_ROM_PTR(&pin_PC09), + MP_ROM_PTR(&pin_PC10), + MP_ROM_PTR(&pin_PC11), + } +}; + STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, @@ -31,5 +43,9 @@ 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_SDIO_CLOCK), MP_ROM_PTR(&pin_PC12) }, + { MP_ROM_QSTR(MP_QSTR_SDIO_COMMAND), MP_ROM_PTR(&pin_PD02) }, + { MP_ROM_QSTR(MP_QSTR_SDIO_DATA), MP_ROM_PTR(&sdio_data_tuple) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index 15c746b62a..0354d64ad3 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -169,7 +169,7 @@ STATIC int check_pins(busio_spi_obj_t *self, if (spi_taken) { mp_raise_ValueError(translate("Hardware busy, try alternative pins")); } else { - mp_raise_ValueError(translate("Invalid SPI pin selection")); + mp_raise_ValueError_varg(translate("Invalid %q pin selection"), MP_QSTR_SPI); } } diff --git a/ports/stm/common-hal/sdioio/SDCard.c b/ports/stm/common-hal/sdioio/SDCard.c new file mode 100644 index 0000000000..1f99b34cbe --- /dev/null +++ b/ports/stm/common-hal/sdioio/SDCard.c @@ -0,0 +1,356 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "shared-bindings/sdioio/SDCard.h" +#include "py/mperrno.h" +#include "py/runtime.h" + +#include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/util.h" +#include "boards/board.h" +#include "supervisor/shared/translate.h" +#include "common-hal/microcontroller/Pin.h" + +#ifndef DEBUG_SDIO +#define DEBUG_SDIO (0) +#endif + +#if DEBUG_SDIO +#define DEBUG_PRINT(...) ((void)mp_printf(&mp_plat_print, __VA_ARGS__)) +#else +#define DEBUG_PRINT(...) ((void)0) +#endif + +STATIC bool reserved_sdio[MP_ARRAY_SIZE(mcu_sdio_banks)]; +STATIC bool never_reset_sdio[MP_ARRAY_SIZE(mcu_sdio_banks)]; + +STATIC const mcu_periph_obj_t *find_pin_function(const mcu_periph_obj_t *table, size_t sz, const mcu_pin_obj_t *pin, int periph_index) { + for(size_t i = 0; iperiph_index && pin == table->pin ) { + return table; + } + } + return NULL; +} + +//match pins to SDIO objects +STATIC int check_pins(sdioio_sdcard_obj_t *self, + const mcu_pin_obj_t * clock, const mcu_pin_obj_t * command, + uint8_t num_data, mcu_pin_obj_t ** data) { + bool sdio_taken = false; + + const uint8_t sdio_clock_len = MP_ARRAY_SIZE(mcu_sdio_clock_list); + const uint8_t sdio_command_len = MP_ARRAY_SIZE(mcu_sdio_command_list); + const uint8_t sdio_data0_len = MP_ARRAY_SIZE(mcu_sdio_data0_list); + const uint8_t sdio_data1_len = MP_ARRAY_SIZE(mcu_sdio_data1_list); + const uint8_t sdio_data2_len = MP_ARRAY_SIZE(mcu_sdio_data2_list); + const uint8_t sdio_data3_len = MP_ARRAY_SIZE(mcu_sdio_data3_list); + + + // Loop over each possibility for clock. Check whether all other pins can + // be used on the same peripheral + for (uint i = 0; i < sdio_clock_len; i++) { + const mcu_periph_obj_t *mcu_sdio_clock = &mcu_sdio_clock_list[i]; + if (mcu_sdio_clock->pin != clock) { + continue; + } + + int periph_index = mcu_sdio_clock->periph_index; + + const mcu_periph_obj_t *mcu_sdio_command = NULL; + if (!(mcu_sdio_command = find_pin_function(mcu_sdio_command_list, sdio_command_len, command, periph_index))) { + continue; + } + + const mcu_periph_obj_t *mcu_sdio_data0 = NULL; + if(!(mcu_sdio_data0 = find_pin_function(mcu_sdio_data0_list, sdio_data0_len, data[0], periph_index))) { + continue; + } + + const mcu_periph_obj_t *mcu_sdio_data1 = NULL; + if(num_data > 1 && !(mcu_sdio_data1 = find_pin_function(mcu_sdio_data1_list, sdio_data1_len, data[1], periph_index))) { + continue; + } + + const mcu_periph_obj_t *mcu_sdio_data2 = NULL; + if(num_data > 2 && !(mcu_sdio_data2 = find_pin_function(mcu_sdio_data2_list, sdio_data2_len, data[2], periph_index))) { + continue; + } + + const mcu_periph_obj_t *mcu_sdio_data3 = NULL; + if(num_data > 3 && !(mcu_sdio_data3 = find_pin_function(mcu_sdio_data3_list, sdio_data3_len, data[3], periph_index))) { + continue; + } + + if (reserved_sdio[periph_index-1]) { + sdio_taken = true; + continue; + } + + self->clock = mcu_sdio_clock; + self->command = mcu_sdio_command; + self->data[0] = mcu_sdio_data0; + self->data[1] = mcu_sdio_data1; + self->data[2] = mcu_sdio_data2; + self->data[3] = mcu_sdio_data3; + + return periph_index; + } + + if (sdio_taken) { + mp_raise_ValueError(translate("Hardware busy, try alternative pins")); + } else { + mp_raise_ValueError_varg(translate("Invalid %q pin selection"), MP_QSTR_SDIO); + } +} + + +void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, + const mcu_pin_obj_t * clock, const mcu_pin_obj_t * command, + uint8_t num_data, mcu_pin_obj_t ** data, uint32_t frequency) { + + int periph_index = check_pins(self, clock, command, num_data, data); + SDIO_TypeDef * SDIOx = mcu_sdio_banks[periph_index - 1]; + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + + // /* GPIOC and GPIOD Periph clock enable */ + // RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD | SD_DETECT_GPIO_CLK, ENABLE); + + /* Configure data PC.08, PC.09, PC.10, PC.11 pins: D0, D1, D2, D3 pins */ + for (int i=0; inumber); + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Alternate = self->data[i]->altfn_index; + HAL_GPIO_Init(pin_port(data[i]->port), &GPIO_InitStruct); + } + + /* Configure PD.02 CMD line */ + GPIO_InitStruct.Alternate = self->command->altfn_index; + GPIO_InitStruct.Pin = pin_mask(command->number); + HAL_GPIO_Init(pin_port(command->port), &GPIO_InitStruct); + + /* Configure PC.12 pin: CLK pin */ + GPIO_InitStruct.Alternate = self->clock->altfn_index; + GPIO_InitStruct.Pin = pin_mask(clock->number); + HAL_GPIO_Init(pin_port(clock->port), &GPIO_InitStruct); + +// XXX hard coded pin +#define SD_DETECT_PIN GPIO_PIN_12 +#define SD_DETECT_GPIO_PORT GPIOB + + /*!< Configure SD_SPI_DETECT_PIN pin: SD Card detect pin */ + GPIO_InitStruct.Pin = SD_DETECT_PIN; + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; + GPIO_InitStruct.Pull = GPIO_PULLUP; + HAL_GPIO_Init(SD_DETECT_GPIO_PORT, &GPIO_InitStruct); + + __HAL_RCC_SDIO_CLK_ENABLE(); + + self->handle.Init.ClockDiv = SDIO_TRANSFER_CLK_DIV; + self->handle.Init.ClockEdge = SDIO_CLOCK_EDGE_RISING; + self->handle.Init.ClockBypass = SDIO_CLOCK_BYPASS_DISABLE; + self->handle.Init.ClockPowerSave = SDIO_CLOCK_POWER_SAVE_DISABLE; + self->handle.Init.BusWide = SDIO_BUS_WIDE_1B; + self->handle.Init.HardwareFlowControl = SDIO_HARDWARE_FLOW_CONTROL_DISABLE; + self->handle.Instance = SDIOx; + + HAL_StatusTypeDef r = HAL_SD_Init(&self->handle); + if (r != HAL_OK) { + mp_raise_ValueError_varg(translate("SDIO Init Error %d"), (int)r); + } + + HAL_SD_CardInfoTypeDef info; + r = HAL_SD_GetCardInfo(&self->handle, &info); + if (r != HAL_OK) { + mp_raise_ValueError_varg(translate("SDIO GetCardInfo Error %d"), (int)r); + } + + self->num_data = 1; + if (num_data == 4) { + if ((r = HAL_SD_ConfigWideBusOperation(&self->handle, SDIO_BUS_WIDE_4B)) == HAL_SD_ERROR_NONE) { + DEBUG_PRINT("Switched bus to 4B mode\n"); + self->handle.Init.BusWide = SDIO_BUS_WIDE_4B; + self->num_data = 4; + } else { + DEBUG_PRINT("WideBus_Enable returned %r, leaving at 1B mode\n", (int)r); + } + } + + self->capacity = info.BlockNbr * (info.BlockSize / 512); + self->frequency = 25000000; + + reserved_sdio[periph_index - 1] = true; + + return; +} + +uint32_t common_hal_sdioio_sdcard_get_count(sdioio_sdcard_obj_t *self) { + return self->capacity; +} + +uint32_t common_hal_sdioio_sdcard_get_frequency(sdioio_sdcard_obj_t *self) { + return self->frequency; // self->frequency; +} + +uint8_t common_hal_sdioio_sdcard_get_width(sdioio_sdcard_obj_t *self) { + return self->num_data; // self->width; +} + +STATIC void check_whole_block(mp_buffer_info_t *bufinfo) { + if (bufinfo->len % 512) { + mp_raise_ValueError(translate("Buffer must be a multiple of 512 bytes")); + } +} + +STATIC void wait_write_complete(sdioio_sdcard_obj_t *self) { + if (self->state_programming) { + HAL_SD_CardStateTypedef st = HAL_SD_CARD_PROGRAMMING; + // This waits up to 60s for programming to complete. This seems like + // an extremely long time, but this is the timeout that micropython's + // implementation uses + for (int i=0; i < 60000 && st == HAL_SD_CARD_PROGRAMMING; i++) { + st = HAL_SD_GetCardState(&self->handle); + HAL_Delay(1); + }; + self->state_programming = false; + } +} + +STATIC void debug_print_state(sdioio_sdcard_obj_t *self, const char *what) { +#if DEBUG_SDIO + HAL_SD_CardStateTypedef st = HAL_SD_GetCardState(&self->handle); + DEBUG_PRINT("%s, st=0x%x State=0x%x ErrorCode=0x%x\n", what, (int)st, self->handle.State, self->handle.ErrorCode); +#endif +} + +STATIC void check_for_deinit(sdioio_sdcard_obj_t *self) { + if (common_hal_sdioio_sdcard_deinited(self)) { + raise_deinited_error(); + } +} + +int common_hal_sdioio_sdcard_writeblocks(sdioio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *bufinfo) { + check_for_deinit(self); + check_whole_block(bufinfo); + wait_write_complete(self); + self->state_programming = true; + common_hal_mcu_disable_interrupts(); + HAL_StatusTypeDef r = HAL_SD_WriteBlocks(&self->handle, bufinfo->buf, start_block, bufinfo->len / 512, 1000); + common_hal_mcu_enable_interrupts(); + if (r != HAL_OK) { + debug_print_state(self, "after writeblocks error"); + return -EIO; + } + // debug_print_state(self, "after writeblocks OK"); + // debug_print_state(self, "after writeblocks complete"); + return 0; +} + +int common_hal_sdioio_sdcard_readblocks(sdioio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *bufinfo) { + check_for_deinit(self); + check_whole_block(bufinfo); + wait_write_complete(self); + common_hal_mcu_disable_interrupts(); + HAL_StatusTypeDef r = HAL_SD_ReadBlocks(&self->handle, bufinfo->buf, start_block, bufinfo->len / 512, 1000); + common_hal_mcu_enable_interrupts(); + if (r != HAL_OK) { + debug_print_state(self, "after readblocks error"); + return -EIO; + } + return 0; +} + +bool common_hal_sdioio_sdcard_configure(sdioio_sdcard_obj_t *self, uint32_t frequency, uint8_t bits) { + check_for_deinit(self); + return true; +} + +bool common_hal_sdioio_sdcard_deinited(sdioio_sdcard_obj_t *self) { + return self->command == NULL; +} + +STATIC void never_reset_mcu_periph(const mcu_periph_obj_t *periph) { + if (periph) { + never_reset_pin_number(periph->pin->port,periph->pin->number); + } +} + +STATIC void reset_mcu_periph(const mcu_periph_obj_t *periph) { + if (periph) { + reset_pin_number(periph->pin->port,periph->pin->number); + } +} + +void common_hal_sdioio_sdcard_deinit(sdioio_sdcard_obj_t *self) { + if (common_hal_sdioio_sdcard_deinited(self)) { + return; + } + + reserved_sdio[self->command->periph_index - 1] = false; + never_reset_sdio[self->command->periph_index - 1] = false; + + reset_mcu_periph(self->command); + self->command = NULL; + + reset_mcu_periph(self->clock); + self->command = NULL; + + for (size_t i=0; idata); i++) { + reset_mcu_periph(self->data[i]); + self->data[i] = NULL; + } +} + +void common_hal_sdioio_sdcard_never_reset(sdioio_sdcard_obj_t *self) { + if (common_hal_sdioio_sdcard_deinited(self)) { + return; + } + + if (never_reset_sdio[self->command->periph_index] - 1) { + return; + } + + never_reset_sdio[self->command->periph_index - 1] = true; + + never_reset_mcu_periph(self->command); + never_reset_mcu_periph(self->clock); + + for (size_t i=0; idata); i++) { + never_reset_mcu_periph(self->data[i]); + } +} + +void sdioio_reset() { + for (size_t i=0; i Date: Thu, 23 Jul 2020 13:25:52 -0500 Subject: [PATCH 0441/1293] feather_stm32f405_express: sdio_data_tuple should be static --- ports/stm/boards/feather_stm32f405_express/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm/boards/feather_stm32f405_express/pins.c b/ports/stm/boards/feather_stm32f405_express/pins.c index 866b276510..571076c339 100644 --- a/ports/stm/boards/feather_stm32f405_express/pins.c +++ b/ports/stm/boards/feather_stm32f405_express/pins.c @@ -1,7 +1,7 @@ #include "py/objtuple.h" #include "shared-bindings/board/__init__.h" -const mp_rom_obj_tuple_t sdio_data_tuple = { +STATIC const mp_rom_obj_tuple_t sdio_data_tuple = { {&mp_type_tuple}, 4, { From 6a99a7b551ebba0c0d6ce31316315d4ba2c17878 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 23 Jul 2020 17:58:08 -0500 Subject: [PATCH 0442/1293] stm: Use 'Invalid %q pin selection' more places --- ports/stm/common-hal/busio/I2C.c | 2 +- ports/stm/common-hal/busio/UART.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index b05d28c852..de69da211a 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -112,7 +112,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, if (i2c_taken) { mp_raise_ValueError(translate("Hardware busy, try alternative pins")); } else { - mp_raise_ValueError(translate("Invalid I2C pin selection")); + mp_raise_ValueError_varg(translate("Invalid %q pin selection"), MP_QSTR_I2C); } } diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index 08dae7e425..0cd9061819 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -58,7 +58,7 @@ STATIC USART_TypeDef * assign_uart_or_throw(busio_uart_obj_t* self, bool pin_eva if (uart_taken) { mp_raise_ValueError(translate("Hardware in use, try alternative pins")); } else { - mp_raise_ValueError(translate("Invalid UART pin selection")); + mp_raise_ValueError_varg(translate("Invalid %q pin selection"), MP_QSTR_UART); } } } From 3cf1258c8782f510628d23c4e7b816f18af4fedd Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 23 Jul 2020 17:58:35 -0500 Subject: [PATCH 0443/1293] stm: sdioio: Get rid of debug code and useless comments --- ports/stm/common-hal/sdioio/SDCard.c | 36 ++++------------------------ 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/ports/stm/common-hal/sdioio/SDCard.c b/ports/stm/common-hal/sdioio/SDCard.c index 1f99b34cbe..ceafa8ddca 100644 --- a/ports/stm/common-hal/sdioio/SDCard.c +++ b/ports/stm/common-hal/sdioio/SDCard.c @@ -35,16 +35,6 @@ #include "supervisor/shared/translate.h" #include "common-hal/microcontroller/Pin.h" -#ifndef DEBUG_SDIO -#define DEBUG_SDIO (0) -#endif - -#if DEBUG_SDIO -#define DEBUG_PRINT(...) ((void)mp_printf(&mp_plat_print, __VA_ARGS__)) -#else -#define DEBUG_PRINT(...) ((void)0) -#endif - STATIC bool reserved_sdio[MP_ARRAY_SIZE(mcu_sdio_banks)]; STATIC bool never_reset_sdio[MP_ARRAY_SIZE(mcu_sdio_banks)]; @@ -138,10 +128,7 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, GPIO_InitTypeDef GPIO_InitStruct = {0}; - // /* GPIOC and GPIOD Periph clock enable */ - // RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD | SD_DETECT_GPIO_CLK, ENABLE); - - /* Configure data PC.08, PC.09, PC.10, PC.11 pins: D0, D1, D2, D3 pins */ + /* Configure data pins */ for (int i=0; inumber); GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; @@ -151,12 +138,12 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, HAL_GPIO_Init(pin_port(data[i]->port), &GPIO_InitStruct); } - /* Configure PD.02 CMD line */ + /* Configure command pin */ GPIO_InitStruct.Alternate = self->command->altfn_index; GPIO_InitStruct.Pin = pin_mask(command->number); HAL_GPIO_Init(pin_port(command->port), &GPIO_InitStruct); - /* Configure PC.12 pin: CLK pin */ + /* Configure clock */ GPIO_InitStruct.Alternate = self->clock->altfn_index; GPIO_InitStruct.Pin = pin_mask(clock->number); HAL_GPIO_Init(pin_port(clock->port), &GPIO_InitStruct); @@ -195,11 +182,9 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, self->num_data = 1; if (num_data == 4) { if ((r = HAL_SD_ConfigWideBusOperation(&self->handle, SDIO_BUS_WIDE_4B)) == HAL_SD_ERROR_NONE) { - DEBUG_PRINT("Switched bus to 4B mode\n"); self->handle.Init.BusWide = SDIO_BUS_WIDE_4B; self->num_data = 4; } else { - DEBUG_PRINT("WideBus_Enable returned %r, leaving at 1B mode\n", (int)r); } } @@ -216,11 +201,11 @@ uint32_t common_hal_sdioio_sdcard_get_count(sdioio_sdcard_obj_t *self) { } uint32_t common_hal_sdioio_sdcard_get_frequency(sdioio_sdcard_obj_t *self) { - return self->frequency; // self->frequency; + return self->frequency; } uint8_t common_hal_sdioio_sdcard_get_width(sdioio_sdcard_obj_t *self) { - return self->num_data; // self->width; + return self->num_data; } STATIC void check_whole_block(mp_buffer_info_t *bufinfo) { @@ -243,13 +228,6 @@ STATIC void wait_write_complete(sdioio_sdcard_obj_t *self) { } } -STATIC void debug_print_state(sdioio_sdcard_obj_t *self, const char *what) { -#if DEBUG_SDIO - HAL_SD_CardStateTypedef st = HAL_SD_GetCardState(&self->handle); - DEBUG_PRINT("%s, st=0x%x State=0x%x ErrorCode=0x%x\n", what, (int)st, self->handle.State, self->handle.ErrorCode); -#endif -} - STATIC void check_for_deinit(sdioio_sdcard_obj_t *self) { if (common_hal_sdioio_sdcard_deinited(self)) { raise_deinited_error(); @@ -265,11 +243,8 @@ int common_hal_sdioio_sdcard_writeblocks(sdioio_sdcard_obj_t *self, uint32_t sta HAL_StatusTypeDef r = HAL_SD_WriteBlocks(&self->handle, bufinfo->buf, start_block, bufinfo->len / 512, 1000); common_hal_mcu_enable_interrupts(); if (r != HAL_OK) { - debug_print_state(self, "after writeblocks error"); return -EIO; } - // debug_print_state(self, "after writeblocks OK"); - // debug_print_state(self, "after writeblocks complete"); return 0; } @@ -281,7 +256,6 @@ int common_hal_sdioio_sdcard_readblocks(sdioio_sdcard_obj_t *self, uint32_t star HAL_StatusTypeDef r = HAL_SD_ReadBlocks(&self->handle, bufinfo->buf, start_block, bufinfo->len / 512, 1000); common_hal_mcu_enable_interrupts(); if (r != HAL_OK) { - debug_print_state(self, "after readblocks error"); return -EIO; } return 0; From ccd3013396e1e36f2cce5956c301e50ff1b4324d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 23 Jul 2020 17:58:43 -0500 Subject: [PATCH 0444/1293] stm: stioio: correctly claim pins --- ports/stm/common-hal/sdioio/SDCard.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/stm/common-hal/sdioio/SDCard.c b/ports/stm/common-hal/sdioio/SDCard.c index ceafa8ddca..a1e87ec4e4 100644 --- a/ports/stm/common-hal/sdioio/SDCard.c +++ b/ports/stm/common-hal/sdioio/SDCard.c @@ -193,6 +193,12 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, reserved_sdio[periph_index - 1] = true; + claim_pin(clock); + claim_pin(command); + for (int i=0; i Date: Thu, 23 Jul 2020 18:08:45 -0500 Subject: [PATCH 0445/1293] stm: sdioio: remove unused code related to "SD Card detect pin" .. this probably came from the examples that I studied at the beginning of implementation. The card detection feature is unused. As a "detect pin" is not sent from the shared-bindings, there is no way to get the correct pin anyway. Instead, if code needs to detect the insertion state it can directly use the pin as GPIO in Python code. --- ports/stm/common-hal/sdioio/SDCard.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/ports/stm/common-hal/sdioio/SDCard.c b/ports/stm/common-hal/sdioio/SDCard.c index a1e87ec4e4..32b1e01be2 100644 --- a/ports/stm/common-hal/sdioio/SDCard.c +++ b/ports/stm/common-hal/sdioio/SDCard.c @@ -148,16 +148,6 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, GPIO_InitStruct.Pin = pin_mask(clock->number); HAL_GPIO_Init(pin_port(clock->port), &GPIO_InitStruct); -// XXX hard coded pin -#define SD_DETECT_PIN GPIO_PIN_12 -#define SD_DETECT_GPIO_PORT GPIOB - - /*!< Configure SD_SPI_DETECT_PIN pin: SD Card detect pin */ - GPIO_InitStruct.Pin = SD_DETECT_PIN; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_PULLUP; - HAL_GPIO_Init(SD_DETECT_GPIO_PORT, &GPIO_InitStruct); - __HAL_RCC_SDIO_CLK_ENABLE(); self->handle.Init.ClockDiv = SDIO_TRANSFER_CLK_DIV; From d73505a027ee61c215ac8b20e3d404c99ffca33c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 24 Jul 2020 16:34:13 -0500 Subject: [PATCH 0446/1293] stm: fix if-guard of conditional code --- ports/stm/supervisor/port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 45bc17737f..5ce92f70a4 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -227,7 +227,7 @@ void reset_port(void) { spi_reset(); uart_reset(); #endif -#ifdef CIRCUITPY_SDIOIO +#if CIRCUITPY_SDIOIO sdioio_reset(); #endif #if CIRCUITPY_PULSEIO From b57e6e9856c5e65cfeca40ad548a9804056dd9df Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 29 Jul 2020 21:32:24 -0500 Subject: [PATCH 0447/1293] stm: sdioio: call common_hal_mcu_pin_claim --- ports/stm/common-hal/sdioio/SDCard.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/stm/common-hal/sdioio/SDCard.c b/ports/stm/common-hal/sdioio/SDCard.c index 32b1e01be2..f1801b138a 100644 --- a/ports/stm/common-hal/sdioio/SDCard.c +++ b/ports/stm/common-hal/sdioio/SDCard.c @@ -183,10 +183,10 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, reserved_sdio[periph_index - 1] = true; - claim_pin(clock); - claim_pin(command); + common_hal_mcu_pin_claim(clock); + common_hal_mcu_pin_claim(command); for (int i=0; i Date: Wed, 29 Jul 2020 21:35:47 -0500 Subject: [PATCH 0448/1293] stm: sdioio: include header for common_hal_mcu_pin_claim --- ports/stm/common-hal/sdioio/SDCard.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/stm/common-hal/sdioio/SDCard.c b/ports/stm/common-hal/sdioio/SDCard.c index f1801b138a..5f6010f01a 100644 --- a/ports/stm/common-hal/sdioio/SDCard.c +++ b/ports/stm/common-hal/sdioio/SDCard.c @@ -34,6 +34,7 @@ #include "boards/board.h" #include "supervisor/shared/translate.h" #include "common-hal/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/Pin.h" STATIC bool reserved_sdio[MP_ARRAY_SIZE(mcu_sdio_banks)]; STATIC bool never_reset_sdio[MP_ARRAY_SIZE(mcu_sdio_banks)]; From 59ebad6acb855017a446974be6ca2e30fa69beb1 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 30 Jul 2020 07:19:19 -0500 Subject: [PATCH 0449/1293] make translate --- locale/circuitpython.pot | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 10907842cc..7a036900aa 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-28 16:57-0500\n" +"POT-Creation-Date: 2020-07-30 07:18-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -449,6 +449,10 @@ msgstr "" msgid "Buffer length must be a multiple of 512" msgstr "" +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Buffer must be a multiple of 512 bytes" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "" @@ -845,7 +849,7 @@ msgid "Group full" msgstr "" #: 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/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -906,6 +910,11 @@ msgstr "" msgid "Invalid %q pin" msgstr "" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +msgid "Invalid %q pin selection" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "" @@ -918,24 +927,12 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/stm/common-hal/busio/I2C.c -msgid "Invalid I2C pin selection" -msgstr "" - #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c msgid "Invalid PWM frequency" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "Invalid SPI pin selection" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid UART pin selection" -msgstr "" - #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "" @@ -1408,6 +1405,16 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "" +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO GetCardInfo Error %d" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO Init Error %d" +msgstr "" + #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" msgstr "" From b49f7d1da539f57206cc912cf3d669229e684343 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 30 Jul 2020 14:26:05 +0200 Subject: [PATCH 0450/1293] 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 | 166 ++++++++++++++++++++----------------- locale/cs.po | 159 +++++++++++++++++++---------------- locale/de_DE.po | 172 +++++++++++++++++++++----------------- locale/es.po | 175 ++++++++++++++++++++++----------------- locale/fil.po | 163 +++++++++++++++++++----------------- locale/fr.po | 172 +++++++++++++++++++++----------------- locale/hi.po | 6 +- locale/it_IT.po | 163 +++++++++++++++++++----------------- locale/ko.po | 163 +++++++++++++++++++----------------- locale/nl.po | 172 +++++++++++++++++++++----------------- locale/pl.po | 163 +++++++++++++++++++----------------- locale/pt_BR.po | 175 ++++++++++++++++++++++----------------- locale/sv.po | 172 +++++++++++++++++++++----------------- locale/zh_Latn_pinyin.po | 163 +++++++++++++++++++----------------- 14 files changed, 1210 insertions(+), 974 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index bd865c0548..05999b9c8c 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-30 07:23-0500\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -116,10 +116,6 @@ msgstr "%q() mengambil posisi argumen %d tapi %d yang diberikan" msgid "'%q' argument required" msgstr "'%q' argumen dibutuhkan" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -224,14 +220,14 @@ msgstr "'S' dan 'O' bukan tipe format yang didukung" msgid "'align' requires 1 argument" msgstr "'align' membutuhkan 1 argumen" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "'async for' atau 'async with' di luar fungsi async" - #: py/compile.c msgid "'await' outside function" msgstr "'await' diluar fungsi" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' diluar loop" @@ -240,6 +236,10 @@ msgstr "'break' diluar loop" msgid "'continue' outside loop" msgstr "'continue' diluar loop" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' membutuhkan setidaknya 2 argumen" @@ -322,7 +322,7 @@ msgstr "Semua timer untuk pin ini sedang digunakan" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Semua timer sedang digunakan" @@ -790,7 +790,7 @@ msgstr "Diharapkan tuple dengan panjang %d, didapatkan %d" msgid "Extended advertisements with scan response not supported." msgstr "Penyebaran yang diperluas dengan respon pindai tidak didukung." -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "FFT didefinisikan hanya untuk ndarrays" @@ -882,6 +882,10 @@ msgstr "operasi I/O pada file tertutup" msgid "I2C Init Error" msgstr "Gagal Inisialisasi I2C" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -1358,14 +1362,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "" - -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -1573,6 +1569,11 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Terlalu banyak channel dalam sampel" @@ -1803,7 +1804,7 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "sebuah objek menyerupai byte (bytes-like) dibutuhkan" @@ -1824,7 +1825,7 @@ msgstr "" msgid "addresses is empty" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "" @@ -1832,7 +1833,7 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "" @@ -1840,6 +1841,10 @@ msgstr "" msgid "argument has wrong type" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1849,7 +1854,7 @@ msgstr "argumen num/types tidak cocok" msgid "argument should be a '%q' not a '%q'" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "" @@ -1857,7 +1862,7 @@ msgstr "" msgid "array/bytes required on right side" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -1865,15 +1870,15 @@ msgstr "" msgid "attributes not supported yet" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "" @@ -2180,15 +2185,15 @@ msgstr "" msgid "conversion to object" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "" @@ -2196,7 +2201,7 @@ msgstr "" msgid "could not broadast input array from shape" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2204,15 +2209,15 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2241,7 +2246,7 @@ msgstr "" msgid "dict update sequence has wrong length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "" @@ -2344,11 +2349,11 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "" @@ -2356,7 +2361,7 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "" @@ -2368,7 +2373,7 @@ msgstr "" msgid "flattening order must be either 'C', or 'F'" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "" @@ -2401,11 +2406,11 @@ msgstr "fungsi diharapkan setidaknya %d argumen, hanya mendapatkan %d" msgid "function got multiple values for argument '%q'" msgstr "fungsi mendapatkan nilai ganda untuk argumen '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2491,7 +2496,7 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "" @@ -2499,35 +2504,35 @@ msgstr "" msgid "inline assembler must be a function" msgstr "inline assembler harus sebuah fungsi" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "" @@ -2539,7 +2544,7 @@ msgstr "" msgid "integer required" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "" @@ -2609,7 +2614,7 @@ msgstr "" msgid "iterables are not of the same length" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "" @@ -2673,11 +2678,11 @@ msgstr "" msgid "math domain error" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "" @@ -2704,7 +2709,7 @@ msgstr "" msgid "module not found" msgstr "modul tidak ditemukan" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "" @@ -2728,7 +2733,7 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "" @@ -2826,11 +2831,11 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -2902,12 +2907,12 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -2999,7 +3004,7 @@ msgstr "antrian meluap (overflow)" msgid "raw f-strings are not implemented" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" @@ -3072,7 +3077,7 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "" @@ -3096,19 +3101,19 @@ msgstr "" msgid "soft reboot\n" msgstr "memulai ulang software(soft reboot)\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3223,7 +3228,11 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -3351,6 +3360,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" @@ -3359,7 +3372,7 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "" @@ -3367,11 +3380,11 @@ msgstr "" msgid "wrong index type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3383,7 +3396,7 @@ msgstr "" msgid "wrong operand type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "" @@ -3403,18 +3416,21 @@ msgstr "" msgid "zero step" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "'async for' or 'async with' outside async function" +#~ msgstr "'async for' atau 'async with' di luar fungsi async" + #~ msgid "AP required" #~ msgstr "AP dibutuhkan" diff --git a/locale/cs.po b/locale/cs.po index cf91416270..a971375fba 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-30 07:23-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -116,10 +116,6 @@ msgstr "" msgid "'%q' argument required" msgstr "" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -225,11 +221,11 @@ msgid "'align' requires 1 argument" msgstr "" #: py/compile.c -msgid "'async for' or 'async with' outside async function" +msgid "'await' outside function" msgstr "" #: py/compile.c -msgid "'await' outside function" +msgid "'await', 'async for' or 'async with' outside async function" msgstr "" #: py/compile.c @@ -240,6 +236,10 @@ msgstr "" msgid "'continue' outside loop" msgstr "" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "" @@ -322,7 +322,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "" @@ -776,7 +776,7 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "" @@ -867,6 +867,10 @@ msgstr "" msgid "I2C Init Error" msgstr "" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -1338,14 +1342,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "" - -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -1551,6 +1547,11 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -1774,7 +1775,7 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "" @@ -1795,7 +1796,7 @@ msgstr "" msgid "addresses is empty" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "" @@ -1803,7 +1804,7 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "" @@ -1811,6 +1812,10 @@ msgstr "" msgid "argument has wrong type" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1820,7 +1825,7 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "" @@ -1828,7 +1833,7 @@ msgstr "" msgid "array/bytes required on right side" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -1836,15 +1841,15 @@ msgstr "" msgid "attributes not supported yet" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "" @@ -2150,15 +2155,15 @@ msgstr "" msgid "conversion to object" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "" @@ -2166,7 +2171,7 @@ msgstr "" msgid "could not broadast input array from shape" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2174,15 +2179,15 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2211,7 +2216,7 @@ msgstr "" msgid "dict update sequence has wrong length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "" @@ -2314,11 +2319,11 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "" @@ -2326,7 +2331,7 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "" @@ -2338,7 +2343,7 @@ msgstr "" msgid "flattening order must be either 'C', or 'F'" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "" @@ -2371,11 +2376,11 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2461,7 +2466,7 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "" @@ -2469,35 +2474,35 @@ msgstr "" msgid "inline assembler must be a function" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "" @@ -2509,7 +2514,7 @@ msgstr "" msgid "integer required" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "" @@ -2579,7 +2584,7 @@ msgstr "" msgid "iterables are not of the same length" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "" @@ -2643,11 +2648,11 @@ msgstr "" msgid "math domain error" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "" @@ -2674,7 +2679,7 @@ msgstr "" msgid "module not found" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "" @@ -2698,7 +2703,7 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "" @@ -2796,11 +2801,11 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -2871,12 +2876,12 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -2968,7 +2973,7 @@ msgstr "" msgid "raw f-strings are not implemented" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" @@ -3041,7 +3046,7 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "" @@ -3065,19 +3070,19 @@ msgstr "" msgid "soft reboot\n" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3191,7 +3196,11 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -3319,6 +3328,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" @@ -3327,7 +3340,7 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "" @@ -3335,11 +3348,11 @@ msgstr "" msgid "wrong index type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3351,7 +3364,7 @@ msgstr "" msgid "wrong operand type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "" @@ -3371,14 +3384,14 @@ msgstr "" msgid "zero step" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 9b07989ca6..30f970aeae 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-30 07:23-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -115,10 +115,6 @@ msgstr "%q() nimmt %d Argumente ohne Keyword an, aber es wurden %d angegeben" msgid "'%q' argument required" msgstr "'%q' Argument erforderlich" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -223,14 +219,14 @@ msgstr "'S' und 'O' sind keine unterstützten Formattypen" msgid "'align' requires 1 argument" msgstr "'align' erfordert genau ein Argument" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "'async for' oder 'async with' außerhalb der asynchronen Funktion" - #: py/compile.c msgid "'await' outside function" msgstr "'await' außerhalb einer Funktion" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' außerhalb einer Schleife" @@ -239,6 +235,10 @@ msgstr "'break' außerhalb einer Schleife" msgid "'continue' outside loop" msgstr "'continue' außerhalb einer Schleife" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' erfordert mindestens zwei Argumente" @@ -321,7 +321,7 @@ msgstr "Alle timer für diesen Pin werden bereits benutzt" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Alle timer werden benutzt" @@ -787,7 +787,7 @@ msgid "Extended advertisements with scan response not supported." msgstr "" "Erweiterte Werbung (advertising) mit Scanantwort wird nicht unterstützt." -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "FFT ist nur für ndarrays definiert" @@ -882,6 +882,10 @@ msgstr "Lese/Schreibe-operation an geschlossener Datei" msgid "I2C Init Error" msgstr "I2C-Init-Fehler" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -1368,14 +1372,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "PulseIn wird auf diesem Chip nicht unterstützt" - -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "PulseOut wird auf diesem Chip nicht unterstützt" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG DeInit-Fehler" @@ -1593,6 +1589,11 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" "Zeitbeschränkung ist zu groß: Maximale Zeitbeschränkung ist %d Sekunden" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Zu viele Kanäle im sample." @@ -1831,7 +1832,7 @@ msgstr "__init__() sollte None zurückgeben, nicht '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ arg muss user-type sein" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "ein Byte-ähnliches Objekt ist erforderlich" @@ -1852,7 +1853,7 @@ msgstr "Adresse außerhalb der Grenzen" msgid "addresses is empty" msgstr "adresses ist leer" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "arctan2 ist nur für Skalare und ndarrays implementiert" @@ -1860,7 +1861,7 @@ msgstr "arctan2 ist nur für Skalare und ndarrays implementiert" msgid "arg is an empty sequence" msgstr "arg ist eine leere Sequenz" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "Das Argument argsort muss ein ndarray sein" @@ -1868,6 +1869,10 @@ msgstr "Das Argument argsort muss ein ndarray sein" msgid "argument has wrong type" msgstr "Argument hat falschen Typ" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1877,7 +1882,7 @@ msgstr "Anzahl/Type der Argumente passen nicht" msgid "argument should be a '%q' not a '%q'" msgstr "Argument sollte '%q' sein, nicht '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "Argumente müssen ndarrays sein" @@ -1885,7 +1890,7 @@ msgstr "Argumente müssen ndarrays sein" msgid "array/bytes required on right side" msgstr "Array/Bytes auf der rechten Seite erforderlich" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "Sie haben versucht argmin/argmax von einer leeren Sequenz zu bekommen" @@ -1893,15 +1898,15 @@ msgstr "Sie haben versucht argmin/argmax von einer leeren Sequenz zu bekommen" msgid "attributes not supported yet" msgstr "Attribute werden noch nicht unterstützt" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "Die Achse muss -1, 0, Keine oder 1 sein" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "Die Achse muss -1, 0 oder 1 sein" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "Die Achse muss None, 0 oder 1 sein" @@ -2218,15 +2223,15 @@ msgstr "constant muss ein integer sein" msgid "conversion to object" msgstr "Umwandlung zu Objekt" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "Convolve-Argumente müssen lineare Arrays sein" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "Convolve-Argumente müssen ndarrays sein" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "Convolve Argumente dürfen nicht leer sein" @@ -2234,7 +2239,7 @@ msgstr "Convolve Argumente dürfen nicht leer sein" msgid "could not broadast input array from shape" msgstr "Eingabearray konnte nicht aus der Form übertragen werden" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "Vandermonde-Matrix konnte nicht invertiert werden" @@ -2242,15 +2247,15 @@ msgstr "Vandermonde-Matrix konnte nicht invertiert werden" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "ddof muss kleiner als die Länge des Datensatzes sein" @@ -2281,7 +2286,7 @@ msgstr "destination_length muss ein int >= 0 sein" msgid "dict update sequence has wrong length" msgstr "Die Wörterbuch-Aktualisierungssequenz hat eine falsche Länge" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "diff Argument muss ein ndarray sein" @@ -2384,11 +2389,11 @@ msgstr "Die Datei muss eine im Byte-Modus geöffnete Datei sein" msgid "filesystem must provide mount method" msgstr "Das Dateisystem muss eine Mount-Methode bereitstellen" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "" @@ -2396,7 +2401,7 @@ msgstr "" msgid "first argument must be an iterable" msgstr "Das erste Argument muss iterierbar sein" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "Das erste Argument muss ein Ndarray sein" @@ -2408,7 +2413,7 @@ msgstr "Das erste Argument für super() muss type sein" msgid "flattening order must be either 'C', or 'F'" msgstr "Die Abflachungsreihenfolge muss entweder \"C\" oder \"F\" sein" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "Das Flip-Argument muss ein Ndarray sein" @@ -2441,11 +2446,11 @@ msgstr "Funktion erwartet maximal %d Argumente, aber hat %d erhalten" msgid "function got multiple values for argument '%q'" msgstr "Funktion hat mehrere Werte für Argument '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "Die Funktion ist nur für Skalare und Ndarrays implementiert" @@ -2532,7 +2537,7 @@ msgstr "Indizes müssen Integer sein" msgid "indices must be integers, slices, or Boolean lists" msgstr "Indizes müssen Integer, Slices oder Boolesche Listen sein" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "" @@ -2540,35 +2545,35 @@ msgstr "" msgid "inline assembler must be a function" msgstr "inline assembler muss eine function sein" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "Das Eingabeargument muss eine Ganzzahl oder ein 2-Tupel sein" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "Die Länge des Eingabearrays muss eine Potenz von 2 sein" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "Eingabedaten müssen iterierbar sein" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "Eingabematrix ist asymmetrisch" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "Eingabematrix ist singulär" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "Die Eingabe muss eine quadratische Matrix sein" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "Die Eingabe muss Tupel, Liste, Bereich oder Ndarray sein" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "Eingabevektoren müssen gleich lang sein" @@ -2580,7 +2585,7 @@ msgstr "int() arg 2 muss >= 2 und <= 36 sein" msgid "integer required" msgstr "integer erforderlich" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "" @@ -2650,7 +2655,7 @@ msgstr "issubclass() arg 2 muss eine Klasse oder ein Tupel von Klassen sein" msgid "iterables are not of the same length" msgstr "iterables sind nicht gleich lang" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "Iterationen sind nicht konvergiert (converged)" @@ -2720,11 +2725,11 @@ msgstr "map buffer zu klein" msgid "math domain error" msgstr "Mathe-Domain-Fehler" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "Matrix Dimensionen stimmen nicht überein" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "Matrix ist nicht positiv definitiv" @@ -2751,7 +2756,7 @@ msgstr "Speicherzuweisung fehlgeschlagen, der Heap ist gesperrt" msgid "module not found" msgstr "Modul nicht gefunden" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "mehr Freiheitsgrade als Datenpunkte" @@ -2775,7 +2780,7 @@ msgstr "muss ein Objekt verursachen (raise)" msgid "must use keyword argument for key function" msgstr "muss Schlüsselwortargument für key function verwenden" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "n muss zwischen 0 und 9 liegen" @@ -2874,11 +2879,11 @@ msgstr "" msgid "not enough arguments for format string" msgstr "Nicht genügend Argumente für den Formatierungs-String" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "Die Anzahl der Argumente muss 2 oder 3 sein" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "Die Anzahl der Punkte muss mindestens 2 betragen" @@ -2950,12 +2955,12 @@ msgid "only slices with step=1 (aka None) are supported" msgstr "" "Es werden nur Slices mit Schritt = 1 (auch bekannt als None) unterstützt" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "Operanden konnten nicht zusammen gesendet werden" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "Die Operation ist für ndarrays nicht implementiert" @@ -3049,7 +3054,7 @@ msgstr "Warteschlangenüberlauf" msgid "raw f-strings are not implemented" msgstr "rohe F-Strings sind nicht implementiert" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "Real- und Imaginärteile müssen gleich lang sein" @@ -3124,7 +3129,7 @@ msgstr "Vorzeichen mit ganzzahligem Formatbezeichner 'c' nicht erlaubt" msgid "single '}' encountered in format string" msgstr "einzelne '}' in Formatierungs-String gefunden" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "Größe ist nur für ndarrays definiert" @@ -3148,19 +3153,19 @@ msgstr "small int Überlauf" msgid "soft reboot\n" msgstr "weicher reboot\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "sortierungs Argument muss ein ndarray sein" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3275,7 +3280,11 @@ msgstr "zu viele Indizes" msgid "too many values to unpack (expected %d)" msgstr "zu viele Werte zum Auspacken (erwartet %d)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "Tupelindex außerhalb des Bereichs" @@ -3407,6 +3416,10 @@ msgstr "Wert muss in %d Byte(s) passen" msgid "value_count must be > 0" msgstr "value_count muss größer als 0 sein" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" @@ -3415,7 +3428,7 @@ msgstr "" msgid "window must be <= interval" msgstr "Fenster muss <= Intervall sein" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "falscher Argumenttyp" @@ -3423,11 +3436,11 @@ msgstr "falscher Argumenttyp" msgid "wrong index type" msgstr "falscher Indextyp" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "falsche Anzahl an Argumenten" @@ -3439,7 +3452,7 @@ msgstr "falsche Anzahl zu entpackender Werte" msgid "wrong operand type" msgstr "falscher Operandentyp" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "" @@ -3459,18 +3472,27 @@ msgstr "y Wert außerhalb der Grenzen" msgid "zero step" msgstr "Nullschritt" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "'async for' or 'async with' outside async function" +#~ msgstr "'async for' oder 'async with' außerhalb der asynchronen Funktion" + +#~ msgid "PulseIn not supported on this chip" +#~ msgstr "PulseIn wird auf diesem Chip nicht unterstützt" + +#~ msgid "PulseOut not supported on this chip" +#~ msgstr "PulseOut wird auf diesem Chip nicht unterstützt" + #~ msgid "AP required" #~ msgstr "AP erforderlich" diff --git a/locale/es.po b/locale/es.po index 8d19b0ab01..1ac9cd0098 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-30 07:23-0500\n" "PO-Revision-Date: 2020-07-22 20:48+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -119,10 +119,6 @@ msgstr "%q() toma %d argumentos posicionales pero %d fueron dados" msgid "'%q' argument required" msgstr "argumento '%q' requerido" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "el objeto '%q' no es similar a bytes" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -227,14 +223,14 @@ msgstr "'S' y 'O' no son compatibles con los tipos de formato" msgid "'align' requires 1 argument" msgstr "'align' requiere 1 argumento" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "'async for' o 'async with' fuera de la función async" - #: py/compile.c msgid "'await' outside function" msgstr "'await' fuera de la función" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' fuera de un bucle" @@ -243,6 +239,10 @@ msgstr "'break' fuera de un bucle" msgid "'continue' outside loop" msgstr "'continue' fuera de un bucle" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' requiere como minomo 2 argumentos" @@ -327,7 +327,7 @@ msgstr "Todos los timers para este pin están siendo utilizados" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Todos los timers en uso" @@ -791,7 +791,7 @@ msgstr "Se esperaba un tuple de %d, se obtuvo %d" msgid "Extended advertisements with scan response not supported." msgstr "No se admiten anuncios extendidos con respuesta de escaneo." -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "FFT se define solo para ndarrays" @@ -883,6 +883,10 @@ msgstr "Operación I/O en archivo cerrado" msgid "I2C Init Error" msgstr "Error de inicio de I2C" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -1367,14 +1371,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull no se usa cuando la dirección es output." -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "PulseIn no es compatible con este chip" - -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "PulseOut no es compatible con este chip" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "Error de desinicializado del RNG" @@ -1591,6 +1587,11 @@ msgstr "" "Tiempo de espera demasiado largo: El tiempo máximo de espera es de %d " "segundos" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Demasiados canales en sample." @@ -1826,7 +1827,7 @@ msgstr "__init__() deberia devolver None, no '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ arg debe ser un user-type" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "se requiere un objeto bytes-like" @@ -1847,7 +1848,7 @@ msgstr "address fuera de límites" msgid "addresses is empty" msgstr "addresses esta vacío" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "arctan2 se encuentra implementado solo para escalares y ndarrays" @@ -1855,7 +1856,7 @@ msgstr "arctan2 se encuentra implementado solo para escalares y ndarrays" msgid "arg is an empty sequence" msgstr "argumento es una secuencia vacía" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "El argumento para argsort debe ser un ndarray" @@ -1863,6 +1864,10 @@ msgstr "El argumento para argsort debe ser un ndarray" msgid "argument has wrong type" msgstr "el argumento tiene un tipo erroneo" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1872,7 +1877,7 @@ msgstr "argumento número/tipos no coinciden" msgid "argument should be a '%q' not a '%q'" msgstr "argumento deberia ser un '%q' no un '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "argumentos deben ser ndarrays" @@ -1880,7 +1885,7 @@ msgstr "argumentos deben ser ndarrays" msgid "array/bytes required on right side" msgstr "array/bytes requeridos en el lado derecho" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "se trató de traer argmin/argmax de una secuencia vacía" @@ -1888,15 +1893,15 @@ msgstr "se trató de traer argmin/argmax de una secuencia vacía" msgid "attributes not supported yet" msgstr "atributos aún no soportados" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "eje debe ser -1, 0, None o 1" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "eje debe ser -1, 0, o 1" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "eje debe ser None, 0, o 1" @@ -2207,15 +2212,15 @@ msgstr "constant debe ser un entero" msgid "conversion to object" msgstr "conversión a objeto" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "los argumentos para convolve deben ser arreglos lineares" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "los argumentos para convolve deben ser ndarrays" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "los argumentos para convolve no deben estar vacíos" @@ -2223,7 +2228,7 @@ msgstr "los argumentos para convolve no deben estar vacíos" msgid "could not broadast input array from shape" msgstr "no se pudo anunciar la matriz de entrada desde la forma" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "no se pudo invertir la matriz de Vandermonde" @@ -2231,15 +2236,15 @@ msgstr "no se pudo invertir la matriz de Vandermonde" msgid "couldn't determine SD card version" msgstr "no se pudo determinar la versión de la tarjeta SD" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "los datos deben permitir iteración" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "los datos deben ser de igual tamaño" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "ddof debe ser menor que la longitud del conjunto de datos" @@ -2270,7 +2275,7 @@ msgstr "destination_length debe ser un int >= 0" msgid "dict update sequence has wrong length" msgstr "la secuencia de actualizacion del dict tiene una longitud incorrecta" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "El argumento diff debe ser un ndarray" @@ -2373,11 +2378,11 @@ msgstr "el archivo deberia ser una archivo abierto en modo byte" msgid "filesystem must provide mount method" msgstr "sistema de archivos debe proporcionar método de montaje" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "se debe poder llamar al primer argumento" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "el primer argumento debe ser una función" @@ -2385,7 +2390,7 @@ msgstr "el primer argumento debe ser una función" msgid "first argument must be an iterable" msgstr "el primer argumento debe permitir iteración" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "el primer argumento debe ser ndarray" @@ -2397,7 +2402,7 @@ msgstr "primer argumento para super() debe ser de tipo" msgid "flattening order must be either 'C', or 'F'" msgstr "el orden de aplanamiento debe ser 'C' o 'F'" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "el argumento invertido debe ser un ndarray" @@ -2430,11 +2435,11 @@ msgstr "la función esperaba minimo %d argumentos, tiene %d" msgid "function got multiple values for argument '%q'" msgstr "la función tiene múltiples valores para el argumento '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "la función tiene el mismo signo a extremos del intervalo" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "la función está implementada solo para escalares y ndarrays" @@ -2520,7 +2525,7 @@ msgstr "indices deben ser enteros" msgid "indices must be integers, slices, or Boolean lists" msgstr "los índices deben ser enteros, particiones o listas de booleanos" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "los valores iniciales deben permitir iteración" @@ -2528,35 +2533,35 @@ msgstr "los valores iniciales deben permitir iteración" msgid "inline assembler must be a function" msgstr "ensamblador en línea debe ser una función" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "el argumento de entrada debe ser un entero o una tupla de par" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "el tamaño del arreglo de entrada debe ser potencia de 2" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "los datos de entrada deben permitir iteración" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "la matriz de entrada es asimétrica" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "la matriz de entrada es singular" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "la entrada debe ser una matriz cuadrada" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "la entrada debe ser una tupla, lista, rango o ndarray" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "los vectores de entrada deben ser de igual tamaño" @@ -2568,7 +2573,7 @@ msgstr "int() arg 2 debe ser >= 2 y <= 36" msgid "integer required" msgstr "Entero requerido" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "interp está definido para arreglos de 1D del mismo tamaño" @@ -2638,7 +2643,7 @@ msgstr "issubclass() arg 2 debe ser una clase o tuple de clases" msgid "iterables are not of the same length" msgstr "los iterables no son del mismo tamaño" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "las iteraciones no convergen" @@ -2705,11 +2710,11 @@ msgstr "map buffer muy pequeño" msgid "math domain error" msgstr "error de dominio matemático" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "las dimensiones de la matriz no coinciden" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "matrix no es definida positiva" @@ -2736,7 +2741,7 @@ msgstr "la asignación de memoria falló, el heap está bloqueado" msgid "module not found" msgstr "módulo no encontrado" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "más grados de libertad que los puntos de datos" @@ -2760,7 +2765,7 @@ msgstr "debe hacer un raise de un objeto" msgid "must use keyword argument for key function" msgstr "debe utilizar argumento de palabra clave para la función clave" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "n debe estar entre 0 y 9" @@ -2861,11 +2866,11 @@ msgstr "" msgid "not enough arguments for format string" msgstr "no suficientes argumentos para format string" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "el número de argumentos debe ser 2 o 3" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "el número de puntos debe ser al menos 2" @@ -2936,12 +2941,12 @@ msgstr "solo se admite sample_rate=16000" msgid "only slices with step=1 (aka None) are supported" msgstr "solo se admiten segmentos con step=1 (alias None)" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "los operandos no se pueden transmitir juntos" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "la operación no está implementada para ndarrays" @@ -3033,7 +3038,7 @@ msgstr "desbordamiento de cola(queue)" msgid "raw f-strings are not implemented" msgstr "no está implementado cadenas-f sin procesar" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "las partes reales e imaginarias deben ser de igual longitud" @@ -3108,7 +3113,7 @@ msgstr "signo no permitido con el especificador integer format 'c'" msgid "single '}' encountered in format string" msgstr "un solo '}' encontrado en format string" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "el tamaño se define solo para ndarrays" @@ -3132,19 +3137,19 @@ msgstr "pequeño int desbordamiento" msgid "soft reboot\n" msgstr "reinicio suave\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "argumento de ordenado debe ser un ndarray" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "el arreglo sos debe de forma (n_section, 6)" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "sos[:, 3] deberían ser todos unos" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "sosfilt requiere argumentos iterables" @@ -3259,7 +3264,11 @@ msgstr "demasiados índices" msgid "too many values to unpack (expected %d)" msgstr "demasiados valores para descomprimir (%d esperado)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "tuple index fuera de rango" @@ -3387,6 +3396,10 @@ msgstr "el valor debe caber en %d byte(s)" msgid "value_count must be > 0" msgstr "value_count debe ser > 0" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: 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" @@ -3395,7 +3408,7 @@ msgstr "el tiempo de espera del perro guardián debe ser mayor a 0" msgid "window must be <= interval" msgstr "la ventana debe ser <= intervalo" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "tipo de argumento incorrecto" @@ -3403,11 +3416,11 @@ msgstr "tipo de argumento incorrecto" msgid "wrong index type" msgstr "tipo de índice incorrecto" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "tipo de entrada incorrecta" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "numero erroneo de argumentos" @@ -3419,7 +3432,7 @@ msgstr "numero erroneo de valores a descomprimir" msgid "wrong operand type" msgstr "tipo de operando incorrecto" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "tipo de salida incorrecta" @@ -3439,18 +3452,30 @@ msgstr "valor y fuera de límites" msgid "zero step" msgstr "paso cero" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "zi debe ser un ndarray" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "zi debe ser de tipo flotante" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "zi debe ser una forma (n_section,2)" +#~ msgid "'%q' object is not bytes-like" +#~ msgstr "el objeto '%q' no es similar a bytes" + +#~ msgid "'async for' or 'async with' outside async function" +#~ msgstr "'async for' o 'async with' fuera de la función async" + +#~ msgid "PulseIn not supported on this chip" +#~ msgstr "PulseIn no es compatible con este chip" + +#~ msgid "PulseOut not supported on this chip" +#~ msgstr "PulseOut no es compatible con este chip" + #~ msgid "AP required" #~ msgstr "AP requerido" diff --git a/locale/fil.po b/locale/fil.po index 92dc9cc910..91d7334e9f 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-30 07:23-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -111,10 +111,6 @@ msgstr "" msgid "'%q' argument required" msgstr "'%q' argument kailangan" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -219,14 +215,14 @@ msgstr "Ang 'S' at 'O' ay hindi suportadong uri ng format" msgid "'align' requires 1 argument" msgstr "'align' kailangan ng 1 argument" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "" - #: py/compile.c msgid "'await' outside function" msgstr "'await' sa labas ng function" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' sa labas ng loop" @@ -235,6 +231,10 @@ msgstr "'break' sa labas ng loop" msgid "'continue' outside loop" msgstr "'continue' sa labas ng loop" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' kailangan ng hindi bababa sa 2 argument" @@ -318,7 +318,7 @@ msgstr "Lahat ng timers para sa pin na ito ay ginagamit" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Lahat ng timer ginagamit" @@ -782,7 +782,7 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "" @@ -873,6 +873,10 @@ msgstr "I/O operasyon sa saradong file" msgid "I2C Init Error" msgstr "" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -1352,14 +1356,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull hindi ginagamit kapag ang direksyon ay output." -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "" - -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -1566,6 +1562,11 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Sobra ang channels sa sample." @@ -1799,7 +1800,7 @@ msgstr "__init__() dapat magbalink na None, hindi '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ arg ay dapat na user-type" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "a bytes-like object ay kailangan" @@ -1820,7 +1821,7 @@ msgstr "wala sa sakop ang address" msgid "addresses is empty" msgstr "walang laman ang address" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "" @@ -1828,7 +1829,7 @@ msgstr "" msgid "arg is an empty sequence" msgstr "arg ay walang laman na sequence" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "" @@ -1836,6 +1837,10 @@ msgstr "" msgid "argument has wrong type" msgstr "may maling type ang argument" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1845,7 +1850,7 @@ msgstr "hindi tugma ang argument num/types" msgid "argument should be a '%q' not a '%q'" msgstr "argument ay dapat na '%q' hindi '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "" @@ -1853,7 +1858,7 @@ msgstr "" msgid "array/bytes required on right side" msgstr "array/bytes kinakailangan sa kanang bahagi" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -1861,15 +1866,15 @@ msgstr "" msgid "attributes not supported yet" msgstr "attributes hindi sinusuportahan" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "" @@ -2182,15 +2187,15 @@ msgstr "constant ay dapat na integer" msgid "conversion to object" msgstr "kombersyon to object" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "" @@ -2198,7 +2203,7 @@ msgstr "" msgid "could not broadast input array from shape" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2206,15 +2211,15 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2247,7 +2252,7 @@ msgstr "ang destination_length ay dapat na isang int >= 0" msgid "dict update sequence has wrong length" msgstr "may mali sa haba ng dict update sequence" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "" @@ -2351,11 +2356,11 @@ msgstr "file ay dapat buksan sa byte mode" msgid "filesystem must provide mount method" msgstr "ang filesystem dapat mag bigay ng mount method" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "" @@ -2363,7 +2368,7 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "" @@ -2375,7 +2380,7 @@ msgstr "unang argument ng super() ay dapat type" msgid "flattening order must be either 'C', or 'F'" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "" @@ -2408,11 +2413,11 @@ msgstr "function na inaasahang %d ang argumento, ngunit %d ang nakuha" msgid "function got multiple values for argument '%q'" msgstr "ang function ay nakakuha ng maraming values para sa argument '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2499,7 +2504,7 @@ msgstr "ang mga indeks ay dapat na integer" msgid "indices must be integers, slices, or Boolean lists" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "" @@ -2507,35 +2512,35 @@ msgstr "" msgid "inline assembler must be a function" msgstr "inline assembler ay dapat na function" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "" @@ -2547,7 +2552,7 @@ msgstr "int() arg 2 ay dapat >=2 at <= 36" msgid "integer required" msgstr "kailangan ng int" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "" @@ -2617,7 +2622,7 @@ msgstr "issubclass() arg 2 ay dapat na class o tuple ng classes" msgid "iterables are not of the same length" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "" @@ -2685,11 +2690,11 @@ msgstr "masyadong maliit ang buffer map" msgid "math domain error" msgstr "may pagkakamali sa math domain" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "" @@ -2716,7 +2721,7 @@ msgstr "abigo ang paglalaan ng memorya, ang heap ay naka-lock" msgid "module not found" msgstr "module hindi nakita" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "" @@ -2740,7 +2745,7 @@ msgstr "dapat itaas ang isang object" msgid "must use keyword argument for key function" msgstr "dapat gumamit ng keyword argument para sa key function" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "" @@ -2838,11 +2843,11 @@ msgstr "hindi lahat ng arguments na i-convert habang string formatting" msgid "not enough arguments for format string" msgstr "kulang sa arguments para sa format string" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -2914,12 +2919,12 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "ang mga slices lamang na may hakbang = 1 (aka None) ang sinusuportahan" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3012,7 +3017,7 @@ msgstr "puno na ang pila (overflow)" msgid "raw f-strings are not implemented" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" @@ -3087,7 +3092,7 @@ msgstr "sign hindi maari sa integer format specifier 'c'" msgid "single '}' encountered in format string" msgstr "isang '}' nasalubong sa format string" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "" @@ -3111,19 +3116,19 @@ msgstr "small int overflow" msgid "soft reboot\n" msgstr "malambot na reboot\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3239,7 +3244,11 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "masyadong maraming values para i-unpact (umaasa ng %d)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "indeks ng tuple wala sa sakop" @@ -3367,6 +3376,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" @@ -3375,7 +3388,7 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "" @@ -3383,11 +3396,11 @@ msgstr "" msgid "wrong index type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "mali ang bilang ng argumento" @@ -3399,7 +3412,7 @@ msgstr "maling number ng value na i-unpack" msgid "wrong operand type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "" @@ -3421,15 +3434,15 @@ msgstr "wala sa sakop ang address" msgid "zero step" msgstr "zero step" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 8953efe37e..40e6bbfcee 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-30 07:23-0500\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" "Language: fr\n" @@ -120,10 +120,6 @@ msgstr "%q() prend %d arguments positionnels mais %d ont été donnés" msgid "'%q' argument required" msgstr "'%q' argument requis" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -228,14 +224,14 @@ msgstr "'S' et 'O' ne sont pas des types de format supportés" msgid "'align' requires 1 argument" msgstr "'align' nécessite 1 argument" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "'async for' ou 'async with' sans fonction asynchrone extérieure" - #: py/compile.c msgid "'await' outside function" msgstr "'await' en dehors d'une fonction" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' en dehors d'une boucle" @@ -244,6 +240,10 @@ msgstr "'break' en dehors d'une boucle" msgid "'continue' outside loop" msgstr "'continue' en dehors d'une boucle" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' nécessite au moins 2 arguments" @@ -326,7 +326,7 @@ msgstr "Tous les timers pour cette broche sont utilisés" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Tous les timers sont utilisés" @@ -795,7 +795,7 @@ msgid "Extended advertisements with scan response not supported." msgstr "" "Les publicités étendues avec réponse d'analyse ne sont pas prises en charge." -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "La FFT est définie pour les ndarrays uniquement" @@ -887,6 +887,10 @@ msgstr "opération d'E/S sur un fichier fermé" msgid "I2C Init Error" msgstr "Erreur d'initialisation I2C" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -1373,14 +1377,6 @@ msgstr "Appuyez sur une touche pour entrer sur REPL ou CTRL-D pour recharger." msgid "Pull not used when direction is output." msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'." -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "PulseIn non pris en charge sur cette puce" - -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "PulseOut non pris en charge sur cette puce" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "Erreur RNG DeInit" @@ -1595,6 +1591,11 @@ msgstr "La largeur de la tuile doit diviser exactement la largeur de l'image" 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" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Trop de canaux dans l'échantillon." @@ -1835,7 +1836,7 @@ msgstr "__init__() doit retourner None, pas '%s'" msgid "__new__ arg must be a user-type" msgstr "l'argument __new__ doit être d'un type défini par l'utilisateur" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "un objet 'bytes-like' est requis" @@ -1856,7 +1857,7 @@ msgstr "adresse hors limites" msgid "addresses is empty" msgstr "adresses vides" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "arctan2 est implémenté uniquement pour les scalaires et les ndarrays" @@ -1864,7 +1865,7 @@ msgstr "arctan2 est implémenté uniquement pour les scalaires et les ndarrays" msgid "arg is an empty sequence" msgstr "l'argument est une séquence vide" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "L'argument argsort doit être un ndarray" @@ -1872,6 +1873,10 @@ msgstr "L'argument argsort doit être un ndarray" msgid "argument has wrong type" msgstr "l'argument est d'un mauvais type" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1881,7 +1886,7 @@ msgstr "argument num/types ne correspond pas" msgid "argument should be a '%q' not a '%q'" msgstr "l'argument devrait être un(e) '%q', pas '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "les arguments doivent être des ndarrays" @@ -1889,7 +1894,7 @@ msgstr "les arguments doivent être des ndarrays" msgid "array/bytes required on right side" msgstr "tableau/octets requis à droite" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "tenter d'obtenir argmin / argmax d'une séquence vide" @@ -1897,15 +1902,15 @@ msgstr "tenter d'obtenir argmin / argmax d'une séquence vide" msgid "attributes not supported yet" msgstr "attribut pas encore supporté" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "l'axe doit être -1, 0, None ou 1" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "l'axe doit être -1, 0 ou 1" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "l'axe doit être None, 0 ou 1" @@ -2223,15 +2228,15 @@ msgstr "constante doit être un entier" msgid "conversion to object" msgstr "conversion en objet" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "les arguments convolve doivent être des tableaux linéaires" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "les arguments convolve doivent être des ndarrays" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "les arguments convolve ne doivent pas être vides" @@ -2239,7 +2244,7 @@ msgstr "les arguments convolve ne doivent pas être vides" msgid "could not broadast input array from shape" msgstr "n'a pas pu diffuser le tableau d'entrée à partir de la forme" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "n'a pas pu inverser la matrice Vandermonde" @@ -2247,15 +2252,15 @@ msgstr "n'a pas pu inverser la matrice Vandermonde" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "les données doivent être les objets iterables" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "les données doivent être de longueur égale" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "ddof doit être inférieur à la longueur de l'ensemble de données" @@ -2286,7 +2291,7 @@ msgstr "destination_length doit être un entier >= 0" msgid "dict update sequence has wrong length" msgstr "la séquence de mise à jour de dict a une mauvaise longueur" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "l'argument diff doit être un ndarray" @@ -2391,11 +2396,11 @@ msgstr "le fichier doit être un fichier ouvert en mode 'byte'" msgid "filesystem must provide mount method" msgstr "le system de fichier doit fournir une méthode 'mount'" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "le premier argument doit être un appelable" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "le premier argument doit être une fonction" @@ -2403,7 +2408,7 @@ msgstr "le premier argument doit être une fonction" msgid "first argument must be an iterable" msgstr "le premier argument doit être un itérable" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "le premier argument doit être un ndarray" @@ -2415,7 +2420,7 @@ msgstr "le premier argument de super() doit être un type" msgid "flattening order must be either 'C', or 'F'" msgstr "l'ordre d'aplatissement doit être «C» ou «F»" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "l'argument flip doit être un ndarray" @@ -2448,11 +2453,11 @@ msgstr "la fonction attendait au plus %d arguments, reçu %d" msgid "function got multiple values for argument '%q'" msgstr "la fonction a reçu plusieurs valeurs pour l'argument '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.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" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" "la fonction est implémentée pour les scalaires et les ndarrays uniquement" @@ -2540,7 +2545,7 @@ msgid "indices must be integers, slices, or Boolean lists" msgstr "" "les indices doivent être des entiers, des tranches ou des listes booléennes" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "les valeurs initiales doivent être itérables" @@ -2548,35 +2553,35 @@ msgstr "les valeurs initiales doivent être itérables" msgid "inline assembler must be a function" msgstr "l'assembleur doit être une fonction" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "l'argument d'entrée doit être un entier ou un tuple 2" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "la longueur du tableau d'entrée doit être une puissance de 2" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "les données d'entrée doivent être un itérable" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "la matrice d'entrée est asymétrique" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "la matrice d'entrée est singulière" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "l'entrée doit être une matrice carrée" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "l'entrée doit être tuple, list, range ou ndarray" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "les vecteurs d'entrée doivent être de longueur égale" @@ -2588,7 +2593,7 @@ msgstr "l'argument 2 de int() doit être >=2 et <=36" msgid "integer required" msgstr "entier requis" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "interp est défini pour les tableaux 1D de longueur égale" @@ -2659,7 +2664,7 @@ msgstr "" msgid "iterables are not of the same length" msgstr "les itérables ne sont pas de la même longueur" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "les itérations n'ont pas convergé" @@ -2726,11 +2731,11 @@ msgstr "tampon trop petit" msgid "math domain error" msgstr "erreur de domaine math" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "les dimensions de la matrice ne correspondent pas" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "la matrice n'est pas définie positive" @@ -2757,7 +2762,7 @@ msgstr "l'allocation de mémoire a échoué, le tas est vérrouillé" msgid "module not found" msgstr "module introuvable" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "plus de degrés de liberté que de points de données" @@ -2781,7 +2786,7 @@ msgstr "doit lever un objet" msgid "must use keyword argument for key function" msgstr "doit utiliser un argument nommé pour une fonction key" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "n doit être compris entre 0 et 9" @@ -2881,11 +2886,11 @@ msgstr "" msgid "not enough arguments for format string" msgstr "pas assez d'arguments pour la chaîne de format" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "le nombre d'arguments doit être 2 ou 3" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "le nombre de points doit être d'au moins 2" @@ -2956,12 +2961,12 @@ msgstr "seul sample_rate = 16000 est pris en charge" msgid "only slices with step=1 (aka None) are supported" msgstr "seules les tranches avec 'step=1' (cad None) sont supportées" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "les opérandes ne pouvaient pas être diffusés ensemble" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "l'opération n'est pas implémentée sur les ndarrays" @@ -3056,7 +3061,7 @@ msgstr "dépassement de file" msgid "raw f-strings are not implemented" msgstr "les chaînes f brutes ne sont pas implémentées" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "les parties réelles et imaginaires doivent être de longueur égale" @@ -3131,7 +3136,7 @@ msgstr "signe non autorisé avec la spéc. de format d'entier 'c'" msgid "single '}' encountered in format string" msgstr "'}' seule rencontrée dans une chaîne de format" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "la taille est définie pour les ndarrays uniquement" @@ -3155,19 +3160,19 @@ msgstr "dépassement de capacité d'un entier court" msgid "soft reboot\n" msgstr "redémarrage logiciel\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "l'argument de «sort» doit être un ndarray" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3282,7 +3287,11 @@ msgstr "trop d'indices" msgid "too many values to unpack (expected %d)" msgstr "trop de valeur à dégrouper (%d attendues)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "index du tuple hors gamme" @@ -3410,6 +3419,10 @@ msgstr "la valeur doit tenir dans %d octet(s)" msgid "value_count must be > 0" msgstr "'value_count' doit être > 0" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "watchdog timeout doit être supérieur à 0" @@ -3418,7 +3431,7 @@ msgstr "watchdog timeout doit être supérieur à 0" msgid "window must be <= interval" msgstr "la fenêtre doit être <= intervalle" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "type d'argument incorrect" @@ -3426,11 +3439,11 @@ msgstr "type d'argument incorrect" msgid "wrong index type" msgstr "type d'index incorrect" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "type d'entrée incorrect" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "mauvais nombres d'arguments" @@ -3442,7 +3455,7 @@ msgstr "mauvais nombre de valeurs à dégrouper" msgid "wrong operand type" msgstr "type d'opérande incorrect" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "type de sortie incorrect" @@ -3462,18 +3475,27 @@ msgstr "valeur y hors limites" msgid "zero step" msgstr "'step' nul" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "'async for' or 'async with' outside async function" +#~ msgstr "'async for' ou 'async with' sans fonction asynchrone extérieure" + +#~ msgid "PulseIn not supported on this chip" +#~ msgstr "PulseIn non pris en charge sur cette puce" + +#~ msgid "PulseOut not supported on this chip" +#~ msgstr "PulseOut non pris en charge sur cette puce" + #~ msgid "AP required" #~ msgstr "'AP' requis" diff --git a/locale/hi.po b/locale/hi.po index 79b9748036..003f9a9ec6 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-28 16:57-0500\n" +"POT-Creation-Date: 2020-07-30 07:23-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -860,6 +860,10 @@ msgstr "" msgid "I2C Init Error" msgstr "" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" diff --git a/locale/it_IT.po b/locale/it_IT.po index 9f0aea9e9b..c0f826e8f1 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-30 07:23-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -110,10 +110,6 @@ msgstr "%q() prende %d argomenti posizionali ma ne sono stati forniti %d" msgid "'%q' argument required" msgstr "'%q' argomento richiesto" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -218,14 +214,14 @@ msgstr "'S' e 'O' non sono formati supportati" msgid "'align' requires 1 argument" msgstr "'align' richiede 1 argomento" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "" - #: py/compile.c msgid "'await' outside function" msgstr "'await' al di fuori della funzione" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' al di fuori del ciclo" @@ -234,6 +230,10 @@ msgstr "'break' al di fuori del ciclo" msgid "'continue' outside loop" msgstr "'continue' al di fuori del ciclo" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' richiede almeno 2 argomento" @@ -317,7 +317,7 @@ msgstr "Tutti i timer per questo pin sono in uso" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Tutti i timer utilizzati" @@ -782,7 +782,7 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "" @@ -873,6 +873,10 @@ msgstr "operazione I/O su file chiuso" msgid "I2C Init Error" msgstr "" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -1361,14 +1365,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "" - -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -1577,6 +1573,11 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -1802,7 +1803,7 @@ msgstr "__init__() deve ritornare None, non '%s'" msgid "__new__ arg must be a user-type" msgstr "" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "un oggetto byte-like è richiesto" @@ -1823,7 +1824,7 @@ msgstr "indirizzo fuori limite" msgid "addresses is empty" msgstr "gli indirizzi sono vuoti" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "" @@ -1831,7 +1832,7 @@ msgstr "" msgid "arg is an empty sequence" msgstr "l'argomento è una sequenza vuota" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "" @@ -1839,6 +1840,10 @@ msgstr "" msgid "argument has wrong type" msgstr "il tipo dell'argomento è errato" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1848,7 +1853,7 @@ msgstr "discrepanza di numero/tipo di argomenti" msgid "argument should be a '%q' not a '%q'" msgstr "l'argomento dovrebbe essere un '%q' e non un '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "" @@ -1856,7 +1861,7 @@ msgstr "" msgid "array/bytes required on right side" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -1864,15 +1869,15 @@ msgstr "" msgid "attributes not supported yet" msgstr "attributi non ancora supportati" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "" @@ -2184,15 +2189,15 @@ msgstr "la costante deve essere un intero" msgid "conversion to object" msgstr "conversione in oggetto" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "" @@ -2200,7 +2205,7 @@ msgstr "" msgid "could not broadast input array from shape" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2208,15 +2213,15 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2248,7 +2253,7 @@ msgstr "destination_length deve essere un int >= 0" msgid "dict update sequence has wrong length" msgstr "sequanza di aggiornamento del dizionario ha la lunghezza errata" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "" @@ -2352,11 +2357,11 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "il filesystem deve fornire un metodo di mount" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "" @@ -2364,7 +2369,7 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "" @@ -2376,7 +2381,7 @@ msgstr "" msgid "flattening order must be either 'C', or 'F'" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "" @@ -2409,11 +2414,11 @@ msgstr "la funzione prevede al massimo %d argmoneti, ma ne ha ricevuti %d" msgid "function got multiple values for argument '%q'" msgstr "la funzione ha ricevuto valori multipli per l'argomento '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2500,7 +2505,7 @@ msgstr "gli indici devono essere interi" msgid "indices must be integers, slices, or Boolean lists" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "" @@ -2508,35 +2513,35 @@ msgstr "" msgid "inline assembler must be a function" msgstr "inline assembler deve essere una funzione" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "" @@ -2548,7 +2553,7 @@ msgstr "il secondo argomanto di int() deve essere >= 2 e <= 36" msgid "integer required" msgstr "intero richiesto" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "" @@ -2620,7 +2625,7 @@ msgstr "" msgid "iterables are not of the same length" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "" @@ -2687,11 +2692,11 @@ msgstr "map buffer troppo piccolo" msgid "math domain error" msgstr "errore di dominio matematico" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "" @@ -2718,7 +2723,7 @@ msgstr "allocazione di memoria fallita, l'heap è bloccato" msgid "module not found" msgstr "modulo non trovato" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "" @@ -2742,7 +2747,7 @@ msgstr "deve lanciare un oggetto" msgid "must use keyword argument for key function" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "" @@ -2843,11 +2848,11 @@ msgstr "" msgid "not enough arguments for format string" msgstr "argomenti non sufficienti per la stringa di formattazione" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -2919,12 +2924,12 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "solo slice con step=1 (aka None) sono supportate" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3019,7 +3024,7 @@ msgstr "overflow della coda" msgid "raw f-strings are not implemented" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" @@ -3094,7 +3099,7 @@ msgstr "segno non permesso nello spcificatore di formato 'c' della stringa" msgid "single '}' encountered in format string" msgstr "'}' singolo presente nella stringa di formattazione" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "" @@ -3118,19 +3123,19 @@ msgstr "small int overflow" msgid "soft reboot\n" msgstr "soft reboot\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3246,7 +3251,11 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "troppi valori da scompattare (%d attesi)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "indice della tupla fuori intervallo" @@ -3374,6 +3383,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" @@ -3382,7 +3395,7 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "" @@ -3390,11 +3403,11 @@ msgstr "" msgid "wrong index type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "numero di argomenti errato" @@ -3406,7 +3419,7 @@ msgstr "numero di valori da scompattare non corretto" msgid "wrong operand type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "" @@ -3428,15 +3441,15 @@ msgstr "indirizzo fuori limite" msgid "zero step" msgstr "zero step" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index e0f4dd9cb8..0d5e53ba0e 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-30 07:23-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -110,10 +110,6 @@ msgstr "" msgid "'%q' argument required" msgstr "" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -218,14 +214,14 @@ msgstr "" msgid "'align' requires 1 argument" msgstr "'align' 에는 1 개의 독립변수가 필요합니다" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "" - #: py/compile.c msgid "'await' outside function" msgstr "'await' 는 펑크션 외부에 있습니다" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' 는 루프 외부에 있습니다" @@ -234,6 +230,10 @@ msgstr "'break' 는 루프 외부에 있습니다" msgid "'continue' outside loop" msgstr "'continue' 는 루프 외부에 있습니다" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' 에는 >=2 개의 독립변수가 필요합니다" @@ -316,7 +316,7 @@ msgstr "핀의 모든 타이머가 사용 중입니다" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "모든 타이머가 사용 중입니다" @@ -772,7 +772,7 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "" @@ -863,6 +863,10 @@ msgstr "" msgid "I2C Init Error" msgstr "" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -1334,14 +1338,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "" - -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -1547,6 +1543,11 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -1771,7 +1772,7 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "" @@ -1792,7 +1793,7 @@ msgstr "" msgid "addresses is empty" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "" @@ -1800,7 +1801,7 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "" @@ -1808,6 +1809,10 @@ msgstr "" msgid "argument has wrong type" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1817,7 +1822,7 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "" @@ -1825,7 +1830,7 @@ msgstr "" msgid "array/bytes required on right side" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -1833,15 +1838,15 @@ msgstr "" msgid "attributes not supported yet" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "" @@ -2147,15 +2152,15 @@ msgstr "" msgid "conversion to object" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "" @@ -2163,7 +2168,7 @@ msgstr "" msgid "could not broadast input array from shape" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2171,15 +2176,15 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2208,7 +2213,7 @@ msgstr "" msgid "dict update sequence has wrong length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "" @@ -2311,11 +2316,11 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "" @@ -2323,7 +2328,7 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "" @@ -2335,7 +2340,7 @@ msgstr "" msgid "flattening order must be either 'C', or 'F'" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "" @@ -2368,11 +2373,11 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2458,7 +2463,7 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "" @@ -2466,35 +2471,35 @@ msgstr "" msgid "inline assembler must be a function" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "" @@ -2506,7 +2511,7 @@ msgstr "" msgid "integer required" msgstr "정수가 필요합니다" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "" @@ -2576,7 +2581,7 @@ msgstr "" msgid "iterables are not of the same length" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "" @@ -2640,11 +2645,11 @@ msgstr "" msgid "math domain error" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "" @@ -2671,7 +2676,7 @@ msgstr "" msgid "module not found" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "" @@ -2695,7 +2700,7 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "" @@ -2793,11 +2798,11 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -2868,12 +2873,12 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -2965,7 +2970,7 @@ msgstr "" msgid "raw f-strings are not implemented" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" @@ -3038,7 +3043,7 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "" @@ -3062,19 +3067,19 @@ msgstr "" msgid "soft reboot\n" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3188,7 +3193,11 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -3316,6 +3325,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" @@ -3324,7 +3337,7 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "" @@ -3332,11 +3345,11 @@ msgstr "" msgid "wrong index type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3348,7 +3361,7 @@ msgstr "" msgid "wrong operand type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "" @@ -3368,15 +3381,15 @@ msgstr "" msgid "zero step" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 29591dfd80..292bf677f8 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-30 07:23-0500\n" "PO-Revision-Date: 2020-07-13 17:39+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -116,10 +116,6 @@ msgstr "%q() verwacht %d positionele argumenten maar kreeg %d" msgid "'%q' argument required" msgstr "'%q' argument vereist" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -224,14 +220,14 @@ msgstr "'S' and 'O' zijn niet ondersteunde format types" msgid "'align' requires 1 argument" msgstr "'align' vereist 1 argument" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "'async for' of 'async with' buiten async functie" - #: py/compile.c msgid "'await' outside function" msgstr "'await' buiten de functie" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' buiten de loop" @@ -240,6 +236,10 @@ msgstr "'break' buiten de loop" msgid "'continue' outside loop" msgstr "'continue' buiten de loop" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' vereist op zijn minst 2 argumenten" @@ -322,7 +322,7 @@ msgstr "Alle timers voor deze pin zijn in gebruik" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Alle timers zijn in gebruik" @@ -784,7 +784,7 @@ msgstr "Verwachtte een tuple met lengte %d, maar kreeg %d" msgid "Extended advertisements with scan response not supported." msgstr "Extended advertisements met scan antwoord niet ondersteund." -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "FFT alleen voor ndarrays gedefineerd" @@ -877,6 +877,10 @@ msgstr "I/O actie op gesloten bestand" msgid "I2C Init Error" msgstr "I2C Init Fout" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -1364,14 +1368,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull niet gebruikt wanneer de richting output is." -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "PusleIn niet ondersteund door deze chip" - -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "PulseOut niet ondersteund door deze chip" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG DeInit Fout" @@ -1585,6 +1581,11 @@ msgstr "Tile breedte moet exact de bitmap breedte verdelen" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "Time-out is te lang. Maximale time-out lengte is %d seconden" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Teveel kanalen in sample." @@ -1819,7 +1820,7 @@ msgstr "__init __ () zou None moeten retouneren, niet '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ arg moet een user-type zijn" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "een bytes-achtig object is vereist" @@ -1840,7 +1841,7 @@ msgstr "adres buiten bereik" msgid "addresses is empty" msgstr "adressen zijn leeg" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "arctan2 is alleen geïmplementeerd voor scalars en ndarrays" @@ -1848,7 +1849,7 @@ msgstr "arctan2 is alleen geïmplementeerd voor scalars en ndarrays" msgid "arg is an empty sequence" msgstr "arg is een lege sequentie" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "argsort argument moet een ndarray zijn" @@ -1856,6 +1857,10 @@ msgstr "argsort argument moet een ndarray zijn" msgid "argument has wrong type" msgstr "argument heeft onjuist type" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1865,7 +1870,7 @@ msgstr "argument num/typen komen niet overeen" msgid "argument should be a '%q' not a '%q'" msgstr "argument moet een '%q' zijn en niet een '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "argumenten moeten ndarrays zijn" @@ -1873,7 +1878,7 @@ msgstr "argumenten moeten ndarrays zijn" msgid "array/bytes required on right side" msgstr "array/bytes vereist aan de rechterkant" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "poging om argmin/argmax van een lege sequentie te krijgen" @@ -1881,15 +1886,15 @@ msgstr "poging om argmin/argmax van een lege sequentie te krijgen" msgid "attributes not supported yet" msgstr "attributen nog niet ondersteund" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "as moet -1, 0, None, of 1 zijn" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "as moet -1, 0, of 1 zijn" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "as moet None, 0, of 1 zijn" @@ -2197,15 +2202,15 @@ msgstr "constant moet een integer zijn" msgid "conversion to object" msgstr "conversie naar object" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "convolutie argumenten moeten lineaire arrays zijn" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "convolutie argumenten moeten ndarrays zijn" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "convolutie argumenten mogen niet leeg zijn" @@ -2213,7 +2218,7 @@ msgstr "convolutie argumenten mogen niet leeg zijn" msgid "could not broadast input array from shape" msgstr "kon de invoerarray niet vanuit vorm uitzenden" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "kon de Vandermonde matrix niet omkeren" @@ -2221,15 +2226,15 @@ msgstr "kon de Vandermonde matrix niet omkeren" msgid "couldn't determine SD card version" msgstr "kon SD kaart versie niet bepalen" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "data moet itereerbaar zijn" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "data moet van gelijke lengte zijn" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "ddof kleiner dan de lengte van de data set" @@ -2260,7 +2265,7 @@ msgstr "destination_lengte moest een int groter dan of gelijk zijn aan 0 zijn" msgid "dict update sequence has wrong length" msgstr "dict update sequence heeft de verkeerde lengte" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "diff argument moet een ndarray zijn" @@ -2363,11 +2368,11 @@ msgstr "bestand moet een bestand zijn geopend in byte modus" msgid "filesystem must provide mount method" msgstr "bestandssysteem moet een mount methode bieden" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "eerste argument moet een aanroepbare (callable) zijn" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "eerste argument moet een functie zijn" @@ -2375,7 +2380,7 @@ msgstr "eerste argument moet een functie zijn" msgid "first argument must be an iterable" msgstr "eerst argument moet een iterabel zijn" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "eerst argument moet een ndarray zijn" @@ -2387,7 +2392,7 @@ msgstr "eerste argument voor super() moet een type zijn" msgid "flattening order must be either 'C', or 'F'" msgstr "De afvlakkingsvolgorde moet ofwel \"C\", ofwel \"F\" zijn" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "flip argumenten moeten een ndarray zijn" @@ -2420,11 +2425,11 @@ msgstr "functie verwachtte op zijn meest %d argumenten, maar kreeg %d" msgid "function got multiple values for argument '%q'" msgstr "functie kreeg meedere waarden voor argument '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "functie heeft hetzelfde teken aan beide uiteinden van het interval" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "funtie is alleen geïmplementeerd voor scalars en ndarrays" @@ -2511,7 +2516,7 @@ msgstr "indices moeten integers zijn" msgid "indices must be integers, slices, or Boolean lists" msgstr "indices moeten integers, segmenten (slices) of Boolean lijsten zijn" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "oorspronkelijke waarden moeten itereerbaar zijn" @@ -2519,35 +2524,35 @@ msgstr "oorspronkelijke waarden moeten itereerbaar zijn" msgid "inline assembler must be a function" msgstr "inline assembler moet een functie zijn" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "invoerargument moet een integer of 2-tuple zijn" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "invoer array lengte moet een macht van 2 zijn" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "invoerdata moet itereerbaar zijn" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "invoermatrix is asymmetrisch" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "invoermatrix is singulier" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "invoer moet een vierkante matrix zijn" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "invoer moet een tuple, lijst, bereik of ndarray zijn" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "invoervectors moeten van gelijke lengte zijn" @@ -2559,7 +2564,7 @@ msgstr "int() argument 2 moet >=2 en <= 36 zijn" msgid "integer required" msgstr "integer vereist" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "interp is gedefinieerd for eendimensionale arrays van gelijke lengte" @@ -2629,7 +2634,7 @@ msgstr "issubclass() argument 2 moet een klasse of tuple van klassen zijn" msgid "iterables are not of the same length" msgstr "itereerbare objecten hebben niet dezelfde lengte" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "itereerbare objecten convergeren niet" @@ -2696,11 +2701,11 @@ msgstr "map buffer te klein" msgid "math domain error" msgstr "fout in het wiskundig domein (math domain error)" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "matrix afmetingen komen niet overeen" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "matrix is niet positief-definiet" @@ -2727,7 +2732,7 @@ msgstr "geheugentoewijzing mislukt, heap is vergrendeld" msgid "module not found" msgstr "module niet gevonden" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "meer vrijheidsgraden dan datapunten" @@ -2751,7 +2756,7 @@ msgstr "moet een object oproepen (raise)" msgid "must use keyword argument for key function" msgstr "voor sleutelfunctie moet een trefwoordargument gebruikt worden" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "n moet tussen 0 en 9 liggen" @@ -2849,11 +2854,11 @@ msgstr "niet alle argumenten omgezet bij formattering van string" msgid "not enough arguments for format string" msgstr "niet genoeg argumenten om string te formatteren" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "aantal argumenten moet 2 of 3 zijn" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "aantal punten moet minimaal 2 zijn" @@ -2924,12 +2929,12 @@ msgstr "alleen sample_rate=16000 wordt ondersteund" msgid "only slices with step=1 (aka None) are supported" msgstr "alleen segmenten met step=1 (ook wel None) worden ondersteund" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "operands konden niet samen verzonden worden" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "bewerking is voor ndarrays niet geïmplementeerd" @@ -3022,7 +3027,7 @@ msgstr "wachtrij overloop" msgid "raw f-strings are not implemented" msgstr "ruwe f-strings zijn niet geïmplementeerd" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "reëel en imaginair deel moeten gelijke lengte hebben" @@ -3097,7 +3102,7 @@ msgstr "teken niet toegestaan bij integer formaatspecificatie 'c'" msgid "single '}' encountered in format string" msgstr "enkele '}' aangetroffen in formaat tekenreeks (string)" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "omvang is alleen voor ndarrays gedefinieerd" @@ -3121,19 +3126,19 @@ msgstr "small int overloop" msgid "soft reboot\n" msgstr "zachte herstart\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "sorteerargument moet een ndarray zijn" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "sos array moet vorm (n_section, 6) hebben" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "sos[:, 3] moeten allemaal 1 zijn" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "sosfilt vereist itereerbare argumenten" @@ -3247,7 +3252,11 @@ msgstr "te veel indices" msgid "too many values to unpack (expected %d)" msgstr "te veel waarden om uit te pakken (%d verwacht)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "tuple index buiten bereik" @@ -3375,6 +3384,10 @@ msgstr "waarde moet in %d byte(s) passen" msgid "value_count must be > 0" msgstr "value_count moet groter dan 0 zijn" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "watchdog time-out moet groter zijn dan 0" @@ -3383,7 +3396,7 @@ msgstr "watchdog time-out moet groter zijn dan 0" msgid "window must be <= interval" msgstr "window moet <= interval zijn" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "onjuist argumenttype" @@ -3391,11 +3404,11 @@ msgstr "onjuist argumenttype" msgid "wrong index type" msgstr "onjuist indextype" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "onjuist invoertype" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "onjuist aantal argumenten" @@ -3407,7 +3420,7 @@ msgstr "verkeerd aantal waarden om uit te pakken" msgid "wrong operand type" msgstr "verkeerd operandtype" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "onjuist uitvoer type" @@ -3427,18 +3440,27 @@ msgstr "y-waarde buiten bereik" msgid "zero step" msgstr "nul-stap" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "zi moet een ndarray zijn" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "zi moet van type float zijn" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "zi moet vorm (n_section, 2) hebben" +#~ msgid "'async for' or 'async with' outside async function" +#~ msgstr "'async for' of 'async with' buiten async functie" + +#~ msgid "PulseIn not supported on this chip" +#~ msgstr "PusleIn niet ondersteund door deze chip" + +#~ msgid "PulseOut not supported on this chip" +#~ msgstr "PulseOut niet ondersteund door deze chip" + #~ msgid "I2C operation not supported" #~ msgstr "I2C actie niet ondersteund" diff --git a/locale/pl.po b/locale/pl.po index e359e71b67..09571db1eb 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-30 07:23-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -110,10 +110,6 @@ msgstr "%q() bierze %d argumentów pozycyjnych, lecz podano %d" msgid "'%q' argument required" msgstr "'%q' wymaga argumentu" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -218,14 +214,14 @@ msgstr "typy formatowania 'S' oraz 'O' są niewspierane" msgid "'align' requires 1 argument" msgstr "'align' wymaga 1 argumentu" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "" - #: py/compile.c msgid "'await' outside function" msgstr "'await' poza funkcją" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' poza pętlą" @@ -234,6 +230,10 @@ msgstr "'break' poza pętlą" msgid "'continue' outside loop" msgstr "'continue' poza pętlą" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' wymaga 2 lub więcej argumentów" @@ -316,7 +316,7 @@ msgstr "Wszystkie timery tej nóżki w użyciu" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Wszystkie timery w użyciu" @@ -772,7 +772,7 @@ msgstr "Oczekiwano krotkę długości %d, otrzymano %d" msgid "Extended advertisements with scan response not supported." msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "" @@ -863,6 +863,10 @@ msgstr "Operacja I/O na zamkniętym pliku" msgid "I2C Init Error" msgstr "" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -1336,14 +1340,6 @@ msgstr "Dowolny klawisz aby uruchomić konsolę. CTRL-D aby przeładować." msgid "Pull not used when direction is output." msgstr "Podciągnięcie nieużywane w trybie wyjścia." -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "" - -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -1549,6 +1545,11 @@ msgstr "Szerokość bitmapy musi być wielokrotnością szerokości kafelka" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Zbyt wiele kanałów." @@ -1775,7 +1776,7 @@ msgstr "__init__() powinien zwracać None, nie '%s'" msgid "__new__ arg must be a user-type" msgstr "Argument __new__ musi być typu użytkownika" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "wymagany obiekt typu bytes" @@ -1796,7 +1797,7 @@ msgstr "adres poza zakresem" msgid "addresses is empty" msgstr "adres jest pusty" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "" @@ -1804,7 +1805,7 @@ msgstr "" msgid "arg is an empty sequence" msgstr "arg jest puste" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "" @@ -1812,6 +1813,10 @@ msgstr "" msgid "argument has wrong type" msgstr "argument ma zły typ" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1821,7 +1826,7 @@ msgstr "zła liczba lub typ argumentów" msgid "argument should be a '%q' not a '%q'" msgstr "argument powinien być '%q' a nie '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "" @@ -1829,7 +1834,7 @@ msgstr "" msgid "array/bytes required on right side" msgstr "tablica/bytes wymagane po prawej stronie" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -1837,15 +1842,15 @@ msgstr "" msgid "attributes not supported yet" msgstr "atrybuty nie są jeszcze obsługiwane" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "" @@ -2151,15 +2156,15 @@ msgstr "stała musi być liczbą całkowitą" msgid "conversion to object" msgstr "konwersja do obiektu" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "" @@ -2167,7 +2172,7 @@ msgstr "" msgid "could not broadast input array from shape" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2175,15 +2180,15 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2213,7 +2218,7 @@ msgstr "destination_length musi być nieujemną liczbą całkowitą" msgid "dict update sequence has wrong length" msgstr "sekwencja ma złą długość" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "" @@ -2316,11 +2321,11 @@ msgstr "file musi być otwarte w trybie bajtowym" msgid "filesystem must provide mount method" msgstr "system plików musi mieć metodę mount" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "" @@ -2328,7 +2333,7 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "" @@ -2340,7 +2345,7 @@ msgstr "pierwszy argument super() musi być typem" msgid "flattening order must be either 'C', or 'F'" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "" @@ -2373,11 +2378,11 @@ msgstr "funkcja bierze najwyżej %d argumentów, jest %d" msgid "function got multiple values for argument '%q'" msgstr "funkcja dostała wiele wartości dla argumentu '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2463,7 +2468,7 @@ msgstr "indeksy muszą być całkowite" msgid "indices must be integers, slices, or Boolean lists" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "" @@ -2471,35 +2476,35 @@ msgstr "" msgid "inline assembler must be a function" msgstr "wtrącony asembler musi być funkcją" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "" @@ -2511,7 +2516,7 @@ msgstr "argument 2 do int() busi być pomiędzy 2 a 36" msgid "integer required" msgstr "wymagana liczba całkowita" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "" @@ -2581,7 +2586,7 @@ msgstr "argument 2 dla issubclass() musi być klasą lub krotką klas" msgid "iterables are not of the same length" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "" @@ -2645,11 +2650,11 @@ msgstr "bufor mapy zbyt mały" msgid "math domain error" msgstr "błąd domeny" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "" @@ -2676,7 +2681,7 @@ msgstr "alokacja pamięci nie powiodła się, sterta zablokowana" msgid "module not found" msgstr "brak modułu" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "" @@ -2700,7 +2705,7 @@ msgstr "wyjątek musi być obiektem" msgid "must use keyword argument for key function" msgstr "funkcja key musi być podana jako argument nazwany" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "" @@ -2798,11 +2803,11 @@ msgstr "nie wszystkie argumenty wykorzystane w formatowaniu" msgid "not enough arguments for format string" msgstr "nie dość argumentów przy formatowaniu" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -2873,12 +2878,12 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "tylko fragmenty ze step=1 (lub None) są wspierane" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -2971,7 +2976,7 @@ msgstr "przepełnienie kolejki" msgid "raw f-strings are not implemented" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" @@ -3045,7 +3050,7 @@ msgstr "znak jest niedopuszczalny w specyfikacji 'c'" msgid "single '}' encountered in format string" msgstr "pojedynczy '}' w specyfikacji formatu" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "" @@ -3069,19 +3074,19 @@ msgstr "przepełnienie small int" msgid "soft reboot\n" msgstr "programowy reset\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3195,7 +3200,11 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "zbyt wiele wartości do rozpakowania (oczekiwano %d)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "indeks krotki poza zakresem" @@ -3323,6 +3332,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "value_count musi być > 0" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" @@ -3331,7 +3344,7 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "" @@ -3339,11 +3352,11 @@ msgstr "" msgid "wrong index type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "zła liczba argumentów" @@ -3355,7 +3368,7 @@ msgstr "zła liczba wartości do rozpakowania" msgid "wrong operand type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "" @@ -3375,15 +3388,15 @@ msgstr "y poza zakresem" msgid "zero step" msgstr "zerowy krok" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 10f3bf6113..020cf20ae8 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-30 07:23-0500\n" "PO-Revision-Date: 2020-07-23 02:57+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -116,10 +116,6 @@ msgstr "%q() recebe %d argumentos posicionais, porém %d foram informados" msgid "'%q' argument required" msgstr "'%q' argumento(s) requerido(s)" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "objetos '%q' não são bytes-like" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -226,14 +222,14 @@ msgstr "'S' e 'O' não são tipos de formato suportados" msgid "'align' requires 1 argument" msgstr "O 'align' exige 1 argumento" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "'assíncrono para' ou 'assíncrono com' função assíncrona externa" - #: py/compile.c msgid "'await' outside function" msgstr "'aguardar' fora da função" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' fora do loop" @@ -242,6 +238,10 @@ msgstr "'break' fora do loop" msgid "'continue' outside loop" msgstr "'continue' fora do loop" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' exige pelo menos 2 argumentos" @@ -324,7 +324,7 @@ msgstr "Todos os temporizadores para este pino estão em uso" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Todos os temporizadores em uso" @@ -791,7 +791,7 @@ msgstr "Tupla esperada com comprimento %d, obteve %d" msgid "Extended advertisements with scan response not supported." msgstr "Anúncios estendidos não compatíveis com a resposta da varredura." -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "O FFT é definido apenas para ndarrays" @@ -884,6 +884,10 @@ msgstr "Operação I/O no arquivo fechado" msgid "I2C Init Error" msgstr "Erro de inicialização do I2C" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -1372,14 +1376,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "O Pull não foi usado quando a direção for gerada." -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "O PulseIn não é compatível neste CI" - -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "O PulseOut não é compatível neste CI" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "Erro DeInit RNG" @@ -1596,6 +1592,11 @@ msgstr "" "O tempo limite é long demais: O comprimento máximo do tempo limite é de %d " "segundos" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Muitos canais na amostra." @@ -1832,7 +1833,7 @@ msgstr "O __init__() deve retornar Nenhum, não '%s'" msgid "__new__ arg must be a user-type" msgstr "O argumento __new__ deve ser um tipo usuário" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "é necessário objetos tipo bytes" @@ -1853,7 +1854,7 @@ msgstr "endereço fora dos limites" msgid "addresses is empty" msgstr "os endereços estão vazios" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "O arctan2 está implementado apenas para escalares e ndarrays" @@ -1861,7 +1862,7 @@ msgstr "O arctan2 está implementado apenas para escalares e ndarrays" msgid "arg is an empty sequence" msgstr "o arg é uma sequência vazia" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "O argumento argsort deve ser um ndarray" @@ -1869,6 +1870,10 @@ msgstr "O argumento argsort deve ser um ndarray" msgid "argument has wrong type" msgstr "argumento tem tipo errado" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1878,7 +1883,7 @@ msgstr "o argumento num/tipos não combinam" msgid "argument should be a '%q' not a '%q'" msgstr "o argumento deve ser um '%q' e não um '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "os argumentos devem ser ndarrays" @@ -1886,7 +1891,7 @@ msgstr "os argumentos devem ser ndarrays" msgid "array/bytes required on right side" msgstr "matriz/bytes são necessários no lado direito" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "tente obter argmin/argmax de uma sequência vazia" @@ -1894,15 +1899,15 @@ msgstr "tente obter argmin/argmax de uma sequência vazia" msgid "attributes not supported yet" msgstr "atributos ainda não suportados" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "o eixo deve ser -1, 0, Nenhum ou 1" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "o eixo deve ser -1, 0 ou 1" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "o eixo deve ser Nenhum, 0 ou 1" @@ -2215,15 +2220,15 @@ msgstr "constante deve ser um inteiro" msgid "conversion to object" msgstr "conversão para o objeto" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "os argumentos convolutivos devem ser matrizes lineares" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "os argumentos convolutivos devem ser ndarrays" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "os argumentos convolutivos não devem estar vazios" @@ -2231,7 +2236,7 @@ msgstr "os argumentos convolutivos não devem estar vazios" msgid "could not broadast input array from shape" msgstr "não foi possível transmitir a matriz da entrada a partir da forma" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "não foi possível inverter a matriz Vandermonde" @@ -2239,15 +2244,15 @@ msgstr "não foi possível inverter a matriz Vandermonde" msgid "couldn't determine SD card version" msgstr "não foi possível determinar a versão do cartão SD" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "os dados devem ser iteráveis" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "os dados devem ser de igual comprimento" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "O ddof deve ser menor que o comprimento do conjunto dos dados" @@ -2279,7 +2284,7 @@ msgstr "destination_length deve ser um int >= 0" msgid "dict update sequence has wrong length" msgstr "sequência da atualização dict tem o comprimento errado" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "O argumento diff deve ser um ndarray" @@ -2382,11 +2387,11 @@ msgstr "o arquivo deve ser um arquivo aberto no modo byte" msgid "filesystem must provide mount method" msgstr "sistema de arquivos deve fornecer método de montagem" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "o primeiro argumento deve ser chamável" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "o primeiro argumento deve ser uma função" @@ -2394,7 +2399,7 @@ msgstr "o primeiro argumento deve ser uma função" msgid "first argument must be an iterable" msgstr "o primeiro argumento deve ser um iterável" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "o primeiro argumento deve ser um ndarray" @@ -2406,7 +2411,7 @@ msgstr "o primeiro argumento para super() deve ser um tipo" msgid "flattening order must be either 'C', or 'F'" msgstr "a ordem do nivelamento deve ser 'C' ou 'F'" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "o argumento flip deve ser um ndarray" @@ -2439,11 +2444,11 @@ msgstr "função esperada na maioria dos %d argumentos, obteve %d" msgid "function got multiple values for argument '%q'" msgstr "A função obteve vários valores para o argumento '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "a função tem o mesmo sinal nas extremidades do intervalo" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "A função foi implementada apenas para escalares e ndarrays" @@ -2529,7 +2534,7 @@ msgstr "os índices devem ser inteiros" msgid "indices must be integers, slices, or Boolean lists" msgstr "os índices devem ser números inteiros, fatias ou listas booleanas" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "os valores iniciais devem ser iteráveis" @@ -2537,35 +2542,35 @@ msgstr "os valores iniciais devem ser iteráveis" msgid "inline assembler must be a function" msgstr "o assembler em linha deve ser uma função" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "o argumento da entrada deve ser um número inteiro ou uma tupla de 2" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "comprimento da matriz da entrada deve ter potência de 2" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "os dados da entrada devem ser iteráveis" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "a matriz da entrada é assimétrica" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "a matriz da entrada é singular" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "a entrada deve ser uma matriz quadrada" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "A entrada deve ser tupla, lista, intervalo ou matriz" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "os vetores da entrada devem ter o mesmo comprimento" @@ -2577,7 +2582,7 @@ msgstr "int() arg 2 deve ser >= 2 e <= 36" msgid "integer required" msgstr "inteiro requerido" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "o interp é definido para matrizes 1D de igual comprimento" @@ -2647,7 +2652,7 @@ msgstr "issubclass() arg 2 deve ser uma classe ou uma tupla de classes" msgid "iterables are not of the same length" msgstr "os iteráveis não têm o mesmo comprimento" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "as iterações não convergiram" @@ -2714,11 +2719,11 @@ msgstr "o mapa do buffer é muito pequeno" msgid "math domain error" msgstr "erro de domínio matemático" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "as dimensões da matriz não coincidem" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "a matriz não é definitiva positiva" @@ -2747,7 +2752,7 @@ msgstr "" msgid "module not found" msgstr "o módulo não foi encontrado" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "mais graus de liberdade do que pontos de dados" @@ -2771,7 +2776,7 @@ msgstr "deve levantar um objeto" msgid "must use keyword argument for key function" msgstr "deve usar o argumento da palavra-chave para a função da chave" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "n deve estar entre 0 e 9" @@ -2869,11 +2874,11 @@ msgstr "nem todos os argumentos são convertidos durante a formatação da strin msgid "not enough arguments for format string" msgstr "argumentos insuficientes para o formato da string" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "a quantidade dos argumentos deve ser 2 ou 3" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "a quantidade dos pontos deve ser pelo menos 2" @@ -2945,12 +2950,12 @@ msgid "only slices with step=1 (aka None) are supported" msgstr "" "apenas fatias com a etapa=1 (também conhecida como Nenhuma) são compatíveis" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "os operandos não puderam ser transmitidos juntos" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "a operação não foi implementada nos ndarrays" @@ -3046,7 +3051,7 @@ msgstr "estouro de fila" msgid "raw f-strings are not implemented" msgstr "o f-strings bruto não estão implementados" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "partes reais e imaginárias devem ter o mesmo comprimento" @@ -3121,7 +3126,7 @@ msgstr "sinal não permitido com o especificador no formato inteiro 'c'" msgid "single '}' encountered in format string" msgstr "único '}' encontrado na string do formato" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "o tamanho é definido apenas para os ndarrays" @@ -3145,19 +3150,19 @@ msgstr "transbordamento int pequeno" msgid "soft reboot\n" msgstr "reinicialização soft\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "o argumento da classificação deve ser um ndarray" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "o sos da matriz deve estar na forma (n_section, 6)" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "sos[:, 3] deve ser um em todos" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "o sosfilt requer que os argumentos sejam iteráveis" @@ -3271,7 +3276,11 @@ msgstr "índices demais" msgid "too many values to unpack (expected %d)" msgstr "valores demais para descompactar (esperado %d)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "o índice da tupla está fora do intervalo" @@ -3399,6 +3408,10 @@ msgstr "o valor deve caber em %d byte(s)" msgid "value_count must be > 0" msgstr "o value_count deve ser > 0" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "o tempo limite do watchdog deve ser maior que 0" @@ -3407,7 +3420,7 @@ msgstr "o tempo limite do watchdog deve ser maior que 0" msgid "window must be <= interval" msgstr "a janela deve ser <= intervalo" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "tipo do argumento errado" @@ -3415,11 +3428,11 @@ msgstr "tipo do argumento errado" msgid "wrong index type" msgstr "tipo do índice errado" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "tipo da entrada incorreta" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "quantidade errada dos argumentos" @@ -3431,7 +3444,7 @@ msgstr "quantidade incorreta dos valores para descompressão" msgid "wrong operand type" msgstr "tipo do operando errado" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "tipo da saída incorreta" @@ -3451,18 +3464,30 @@ msgstr "o valor y está fora dos limites" msgid "zero step" msgstr "passo zero" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "zi deve ser um ndarray" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "zi deve ser de um tipo float" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "zi deve estar na forma (n_section, 2)" +#~ msgid "'%q' object is not bytes-like" +#~ msgstr "objetos '%q' não são bytes-like" + +#~ msgid "'async for' or 'async with' outside async function" +#~ msgstr "'assíncrono para' ou 'assíncrono com' função assíncrona externa" + +#~ msgid "PulseIn not supported on this chip" +#~ msgstr "O PulseIn não é compatível neste CI" + +#~ msgid "PulseOut not supported on this chip" +#~ msgstr "O PulseOut não é compatível neste CI" + #~ msgid "AP required" #~ msgstr "AP requerido" diff --git a/locale/sv.po b/locale/sv.po index 075db8ab09..b2e7ff317a 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-30 07:23-0500\n" "PO-Revision-Date: 2020-07-13 17:39+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -116,10 +116,6 @@ msgstr "%q() kräver %d positionsargument men %d gavs" msgid "'%q' argument required" msgstr "'%q' argument krävs" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -224,14 +220,14 @@ msgstr "'S' och 'O' stöds inte som formattyper" msgid "'align' requires 1 argument" msgstr "'align' kräver 1 argument" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "'async for' eller 'async with' utanför async-funktion" - #: py/compile.c msgid "'await' outside function" msgstr "'await' utanför funktion" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' utanför loop" @@ -240,6 +236,10 @@ msgstr "'break' utanför loop" msgid "'continue' outside loop" msgstr "'continue' utanför loop" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' kräver minst 2 argument" @@ -322,7 +322,7 @@ msgstr "Alla timers för denna pinne är i bruk" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Alla timers används" @@ -784,7 +784,7 @@ msgstr "Förväntad tupel med längd %d, fick %d" msgid "Extended advertisements with scan response not supported." msgstr "Utökad annonsering i kombination med skanningssvar stöds inte." -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "FFT är enbart definierade för ndarrays" @@ -875,6 +875,10 @@ msgstr "I/O-operation på stängd fil" msgid "I2C Init Error" msgstr "I2C init-fel" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -1360,14 +1364,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull används inte när riktningen är output." -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "PulseIn stöds inte av detta chip" - -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "PulseIn stöds inte av detta chip" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG DeInit-fel" @@ -1581,6 +1577,11 @@ msgstr "Tile-bredd måste vara jämnt delbar med bredd på bitmap" 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" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "För många kanaler i sampling." @@ -1812,7 +1813,7 @@ msgstr "__init __ () ska returnera None, inte '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ arg måste vara en användartyp" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "ett bytesliknande objekt krävs" @@ -1833,7 +1834,7 @@ msgstr "adress utanför gränsen" msgid "addresses is empty" msgstr "adresserna är tomma" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "arctan2 är enbart implementerad för scalar och ndarray" @@ -1841,7 +1842,7 @@ msgstr "arctan2 är enbart implementerad för scalar och ndarray" msgid "arg is an empty sequence" msgstr "arg är en tom sekvens" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "argumentet argsort måste vara en ndarray" @@ -1849,6 +1850,10 @@ msgstr "argumentet argsort måste vara en ndarray" msgid "argument has wrong type" msgstr "argumentet har fel typ" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1858,7 +1863,7 @@ msgstr "argument antal/typ matchar inte" msgid "argument should be a '%q' not a '%q'" msgstr "argumentet skall vara en '%q', inte en '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "argumenten måste vara ndarray" @@ -1866,7 +1871,7 @@ msgstr "argumenten måste vara ndarray" msgid "array/bytes required on right side" msgstr "array/bytes krävs på höger sida" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "försök att få argmin/argmax för en tom sekvens" @@ -1874,15 +1879,15 @@ msgstr "försök att få argmin/argmax för en tom sekvens" msgid "attributes not supported yet" msgstr "attribut stöds inte än" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "axis ska vara -1, 0, None eller 1" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "axis ska vara -1, 0 eller 1" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "axis ska vara None, 0, eller 1" @@ -2190,15 +2195,15 @@ msgstr "konstant måste vara ett heltal" msgid "conversion to object" msgstr "konvertering till objekt" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "Argumenten convolve måste vara linjära matriser" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "Argumenten convolve måste vara ndarray:er" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "Argumenten convolve kan inte vara tomma" @@ -2206,7 +2211,7 @@ msgstr "Argumenten convolve kan inte vara tomma" msgid "could not broadast input array from shape" msgstr "Kan inte sända indatamatris från form" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "kan inte invertera Vandermonde-matris" @@ -2214,15 +2219,15 @@ msgstr "kan inte invertera Vandermonde-matris" msgid "couldn't determine SD card version" msgstr "kan inte avgöra SD-kortversion" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "data måste vara itererbar" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "data måste vara av samma längd" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "ddof måste vara mindre än längden på datauppsättningen" @@ -2254,7 +2259,7 @@ msgstr "destination_length måste vara ett heltal >= 0" msgid "dict update sequence has wrong length" msgstr "uppdateringssekvensen för dict har fel längd" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "argumentet diff måste vara en ndarray" @@ -2357,11 +2362,11 @@ msgstr "filen måste vara en fil som öppnats i byte-läge" msgid "filesystem must provide mount method" msgstr "filsystemet måste tillhandahålla mount-metod" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "första argumentet måste vara en callable" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "första argumentet måste vara en funktion" @@ -2369,7 +2374,7 @@ msgstr "första argumentet måste vara en funktion" msgid "first argument must be an iterable" msgstr "första argumentet måste vara en iterable" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "första argumentet måste vara en ndarray" @@ -2381,7 +2386,7 @@ msgstr "första argumentet till super() måste vara typ" msgid "flattening order must be either 'C', or 'F'" msgstr "förenklingsordningen måste vara antingen \"C\" eller \"F\"" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "Argumentet flip måste vara en ndarray" @@ -2414,11 +2419,11 @@ msgstr "funktionen förväntar som mest %d argument, fick %d" msgid "function got multiple values for argument '%q'" msgstr "funktionen fick flera värden för argumentet '%q'" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "funktionen har samma teckenvärden vid slutet av intervall" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "funktionen är endast implementerad för scalar och ndarray" @@ -2504,7 +2509,7 @@ msgstr "index måste vara heltal" msgid "indices must be integers, slices, or Boolean lists" msgstr "index måste vara heltal, slices, eller Boolean-listor" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "initialvärden måste vara iterable" @@ -2512,35 +2517,35 @@ msgstr "initialvärden måste vara iterable" msgid "inline assembler must be a function" msgstr "inline assembler måste vara en funktion" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "indataargumentet måste vara ett heltal eller en 2-tupel" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "indataarraylängden måste vara en multipel av 2" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "indata måste vara en iterable" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "indatamatrisen är asymmetrisk" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "indatamatrisen är singulär" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "indata måste vara kvadratmatris" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "indata måste vara tupel, lista, range, eller ndarray" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "indatavektorer måste ha samma längd" @@ -2552,7 +2557,7 @@ msgstr "int() arg 2 måste vara >= 2 och <= 36" msgid "integer required" msgstr "heltal krävs" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "interp är definierad för 1D-matriser med samma längd" @@ -2622,7 +2627,7 @@ msgstr "issubclass() arg 2 måste vara en klass eller en tupel av klasser" msgid "iterables are not of the same length" msgstr "iterables är inte av samma längd" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "iterations konvergerar inte" @@ -2689,11 +2694,11 @@ msgstr "map-buffert för liten" msgid "math domain error" msgstr "matematikdomänfel" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "matrisdimensioner matchar inte" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "matrisen är inte positiv bestämd" @@ -2720,7 +2725,7 @@ msgstr "minnesallokeringen misslyckades, heapen är låst" msgid "module not found" msgstr "modulen hittades inte" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "fler frihetsgrader än datapunkter" @@ -2744,7 +2749,7 @@ msgstr "måste ge ett objekt" msgid "must use keyword argument for key function" msgstr "måste använda nyckelordsargument för nyckelfunktion" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "n måste vara mellan 0 och 9" @@ -2842,11 +2847,11 @@ msgstr "inte alla argument omvandlade under strängformatering" msgid "not enough arguments for format string" msgstr "inte tillräckligt med argument för formatsträng" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "antal argument måste vara 2 eller 3" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "antal punkter måste vara minst 2" @@ -2917,12 +2922,12 @@ msgstr "enbart sample_rate=16000 stöds" msgid "only slices with step=1 (aka None) are supported" msgstr "endast segment med steg=1 (aka Ingen) stöds" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "operander kan inte sändas tillsammans" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "åtgärden är inte implementerad för ndarray:er" @@ -3015,7 +3020,7 @@ msgstr "köstorlek överskreds" msgid "raw f-strings are not implemented" msgstr "råa f-strängar inte implementerade" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "verkliga och imaginära delar måste ha samma längd" @@ -3090,7 +3095,7 @@ msgstr "tecken tillåts inte med heltalsformatspecificeraren 'c'" msgid "single '}' encountered in format string" msgstr "Enkelt '}' påträffades i formatsträngen" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "storlek är enbart definierad ndarrays" @@ -3114,19 +3119,19 @@ msgstr "värdet för small int överskreds" msgid "soft reboot\n" msgstr "mjuk omstart\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "argumentet sort måste vara en ndarray" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "sos array måste ha form (n_section, 6)" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "sos[:, 3] måste vara ettor" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "sosfilt kräver iterable argument" @@ -3240,7 +3245,11 @@ msgstr "för många index" msgid "too many values to unpack (expected %d)" msgstr "för många värden att packa upp (förväntat %d)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "tupelindex utanför intervallet" @@ -3368,6 +3377,10 @@ msgstr "värdet måste passa i %d byte(s)" msgid "value_count must be > 0" msgstr "value_count måste vara > 0" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "watchdog timeout måste vara större än 0" @@ -3376,7 +3389,7 @@ msgstr "watchdog timeout måste vara större än 0" msgid "window must be <= interval" msgstr "window måste vara <= interval" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "fel typ av argument" @@ -3384,11 +3397,11 @@ msgstr "fel typ av argument" msgid "wrong index type" msgstr "fel indextyp" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "fel indatatyp" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "fel antal argument" @@ -3400,7 +3413,7 @@ msgstr "fel antal värden för att packa upp" msgid "wrong operand type" msgstr "fel operandtyp" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "fel utdatatyp" @@ -3420,18 +3433,27 @@ msgstr "y-värde utanför intervall" msgid "zero step" msgstr "noll steg" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "zi måste vara en ndarray" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "zi måste vara av typ float" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "zi måste vara i formen (n_section, 2)" +#~ msgid "'async for' or 'async with' outside async function" +#~ msgstr "'async for' eller 'async with' utanför async-funktion" + +#~ msgid "PulseIn not supported on this chip" +#~ msgstr "PulseIn stöds inte av detta chip" + +#~ msgid "PulseOut not supported on this chip" +#~ msgstr "PulseIn stöds inte av detta chip" + #~ msgid "I2C operation not supported" #~ msgstr "I2C-åtgärd stöds inte" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index a820c142c6..7558fbb674 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-17 18:03-0700\n" +"POT-Creation-Date: 2020-07-30 07:23-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -116,10 +116,6 @@ msgstr "%q() cǎiyòng %d wèizhì cānshù, dàn gěi chū %d" msgid "'%q' argument required" msgstr "xūyào '%q' cānshù" -#: py/objarray.c -msgid "'%q' object is not bytes-like" -msgstr "" - #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -224,14 +220,14 @@ msgstr "'S' hé 'O' bù zhīchí géshì lèixíng" msgid "'align' requires 1 argument" msgstr "'align' xūyào 1 gè cānshù" -#: py/compile.c -msgid "'async for' or 'async with' outside async function" -msgstr "" - #: py/compile.c msgid "'await' outside function" msgstr "'await' wàibù gōngnéng" +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'break' outside loop" msgstr "'break' wàibù xúnhuán" @@ -240,6 +236,10 @@ msgstr "'break' wàibù xúnhuán" msgid "'continue' outside loop" msgstr "'continue' wàibù xúnhuán" +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + #: py/compile.c msgid "'data' requires at least 2 arguments" msgstr "'data' xūyào zhìshǎo 2 gè cānshù" @@ -322,7 +322,7 @@ msgstr "Cǐ yǐn jiǎo de suǒyǒu jìshí qì zhèngzài shǐyòng" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Suǒyǒu jìshí qì shǐyòng" @@ -780,7 +780,7 @@ msgstr "Qīwàng de chángdù wèi %d de yuán zǔ, dédào %d" msgid "Extended advertisements with scan response not supported." msgstr "Bù zhīchí dài yǒu sǎomiáo xiǎngyìng de kuòzhǎn guǎngbò." -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" msgstr "" @@ -871,6 +871,10 @@ msgstr "Wénjiàn shàng de I/ O cāozuò" msgid "I2C Init Error" msgstr "I2C chūshǐhuà cuòwù" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -1350,14 +1354,6 @@ msgstr "Àn xià rènhé jiàn jìnrù REPL. Shǐyòng CTRL-D chóngxīn jiāzà msgid "Pull not used when direction is output." msgstr "Fāngxiàng shūchū shí Pull méiyǒu shǐyòng." -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "PulseIn not supported on this chip" -msgstr "" - -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG qǔxiāo chūshǐhuà cuòwù" @@ -1570,6 +1566,11 @@ msgstr "Píng pū kuāndù bìxū huàfēn wèi tú kuāndù" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Chōuyàng zhōng de píndào tài duō." @@ -1800,7 +1801,7 @@ msgstr "__Init__() yīnggāi fǎnhuí not, ér bùshì '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ cānshù bìxū shì yònghù lèixíng" -#: extmod/modubinascii.c extmod/moduhashlib.c +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" msgstr "xūyào yīgè zì jié lèi duìxiàng" @@ -1821,7 +1822,7 @@ msgstr "dìzhǐ chāochū biānjiè" msgid "addresses is empty" msgstr "dìzhǐ wèi kōng" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" msgstr "" @@ -1829,7 +1830,7 @@ msgstr "" msgid "arg is an empty sequence" msgstr "cānshù shì yīgè kōng de xùliè" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" msgstr "" @@ -1837,6 +1838,10 @@ msgstr "" msgid "argument has wrong type" msgstr "cānshù lèixíng cuòwù" +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" @@ -1846,7 +1851,7 @@ msgstr "cānshù biānhào/lèixíng bù pǐpèi" msgid "argument should be a '%q' not a '%q'" msgstr "cānshù yīnggāi shì '%q', 'bùshì '%q'" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" msgstr "" @@ -1854,7 +1859,7 @@ msgstr "" msgid "array/bytes required on right side" msgstr "yòu cè xūyào shùzǔ/zì jié" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -1862,15 +1867,15 @@ msgstr "" msgid "attributes not supported yet" msgstr "shǔxìng shàngwèi zhīchí" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" msgstr "" @@ -2179,15 +2184,15 @@ msgstr "chángshù bìxū shì yīgè zhěngshù" msgid "conversion to object" msgstr "zhuǎnhuàn wèi duìxiàng" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" msgstr "" @@ -2195,7 +2200,7 @@ msgstr "" msgid "could not broadast input array from shape" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2203,15 +2208,15 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be iterable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2241,7 +2246,7 @@ msgstr "mùbiāo chángdù bìxū shì > = 0 de zhěngshù" msgid "dict update sequence has wrong length" msgstr "yǔfǎ gēngxīn xùliè de chángdù cuòwù" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" msgstr "" @@ -2344,11 +2349,11 @@ msgstr "wénjiàn bìxū shì zài zì jié móshì xià dǎkāi de wénjiàn" msgid "filesystem must provide mount method" msgstr "wénjiàn xìtǒng bìxū tígōng guà zài fāngfǎ" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" msgstr "" @@ -2356,7 +2361,7 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" msgstr "" @@ -2368,7 +2373,7 @@ msgstr "chāojí () de dì yī gè cānshù bìxū shì lèixíng" msgid "flattening order must be either 'C', or 'F'" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" msgstr "" @@ -2401,11 +2406,11 @@ msgstr "hánshù yùjì zuìduō %d cānshù, huòdé %d" msgid "function got multiple values for argument '%q'" msgstr "hánshù huòdé cānshù '%q' de duōchóng zhí" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" msgstr "" -#: extmod/ulab/code/compare.c +#: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2491,7 +2496,7 @@ msgstr "suǒyǐn bìxū shì zhěngshù" msgid "indices must be integers, slices, or Boolean lists" msgstr "" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" msgstr "" @@ -2499,35 +2504,35 @@ msgstr "" msgid "inline assembler must be a function" msgstr "nèi lián jíhé bìxū shì yīgè hánshù" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" msgstr "" @@ -2539,7 +2544,7 @@ msgstr "zhěngshù() cānshù 2 bìxū > = 2 qiě <= 36" msgid "integer required" msgstr "xūyào zhěngshù" -#: extmod/ulab/code/approx.c +#: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" msgstr "" @@ -2609,7 +2614,7 @@ msgstr "issubclass() cānshù 2 bìxū shì lèi de lèi huò yuán zǔ" msgid "iterables are not of the same length" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" msgstr "" @@ -2674,11 +2679,11 @@ msgstr "dìtú huǎnchōng qū tài xiǎo" msgid "math domain error" msgstr "shùxué yù cuòwù" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" msgstr "" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" msgstr "" @@ -2705,7 +2710,7 @@ msgstr "jìyì tǐ fēnpèi shībài, duī bèi suǒdìng" msgid "module not found" msgstr "zhǎo bù dào mókuài" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" msgstr "" @@ -2729,7 +2734,7 @@ msgstr "bìxū tíchū duìxiàng" msgid "must use keyword argument for key function" msgstr "bìxū shǐyòng guānjiàn cí cānshù" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" msgstr "" @@ -2828,11 +2833,11 @@ msgstr "bùshì zì chuàn géshì huà guòchéng zhōng zhuǎnhuàn de suǒyǒ msgid "not enough arguments for format string" msgstr "géshì zìfú chuàn cān shǔ bùzú" -#: extmod/ulab/code/poly.c +#: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" msgstr "" -#: extmod/ulab/code/create.c +#: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" msgstr "" @@ -2903,12 +2908,12 @@ msgstr "Jǐn zhīchí cǎiyàng lǜ = 16000" 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" -#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" msgstr "" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3000,7 +3005,7 @@ msgstr "duìliè yìchū" msgid "raw f-strings are not implemented" msgstr "" -#: extmod/ulab/code/fft.c +#: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" @@ -3075,7 +3080,7 @@ msgstr "zhěngshù géshì shuōmíng fú 'c' bù yǔnxǔ shǐyòng fúhào" 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/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" msgstr "" @@ -3099,19 +3104,19 @@ msgstr "xiǎo zhěngshù yìchū" msgid "soft reboot\n" msgstr "ruǎn chóngqǐ\n" -#: extmod/ulab/code/numerical.c +#: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" msgstr "" @@ -3225,7 +3230,11 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "dǎkāi tài duō zhí (yùqí %d)" -#: extmod/ulab/code/linalg.c py/objstr.c +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "yuán zǔ suǒyǐn chāochū fànwéi" @@ -3353,6 +3362,10 @@ msgstr "Zhí bìxū fúhé %d zì jié" msgid "value_count must be > 0" msgstr "zhí jìshù bìxū wèi > 0" +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" msgstr "" @@ -3361,7 +3374,7 @@ msgstr "" msgid "window must be <= interval" msgstr "Chuāngkǒu bìxū shì <= jiàngé" -#: extmod/ulab/code/linalg.c +#: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" msgstr "" @@ -3369,11 +3382,11 @@ msgstr "" msgid "wrong index type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" msgstr "cānshù shù cuòwù" @@ -3385,7 +3398,7 @@ msgstr "wúfǎ jiě bāo de zhí shù" msgid "wrong operand type" msgstr "" -#: extmod/ulab/code/vectorise.c +#: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" msgstr "" @@ -3405,15 +3418,15 @@ msgstr "y zhí chāochū biānjiè" msgid "zero step" msgstr "líng bù" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" msgstr "" -#: extmod/ulab/code/filter.c +#: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" From 27c6ffb9a24b7f99903fc18c1def9f0502e7cd86 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 30 Jul 2020 11:29:47 -0500 Subject: [PATCH 0451/1293] atmel-samd: gemma, trinket: Make space for de_DE translation --- ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk | 8 ++++++++ ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk | 3 +++ 2 files changed, 11 insertions(+) diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk index ca3eccbe4f..ae1cb0969f 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk @@ -11,3 +11,11 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), zh_Latn_pinyin) +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +CFLAGS_INLINE_LIMIT = 35 +endif diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index aab5efd5dc..2c9413d653 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -16,3 +16,6 @@ CFLAGS_BOARD = --param max-inline-insns-auto=15 ifeq ($(TRANSLATION), zh_Latn_pinyin) CFLAGS_INLINE_LIMIT = 35 endif +ifeq ($(TRANSLATION), de_DE) +CFLAGS_INLINE_LIMIT = 35 +endif From a76ad3415c6aeae7bb9c915f20220d32001e8094 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 30 Jul 2020 22:07:55 -0400 Subject: [PATCH 0452/1293] wip: implementing functionality --- devices/ble_hci/common-hal/_bleio/Adapter.c | 24 +++ devices/ble_hci/common-hal/_bleio/Adapter.h | 7 + devices/ble_hci/common-hal/_bleio/Attribute.c | 20 ++- devices/ble_hci/common-hal/_bleio/Attribute.h | 11 +- .../common-hal/_bleio/Characteristic.c | 129 +++---------- .../common-hal/_bleio/Characteristic.h | 1 + devices/ble_hci/common-hal/_bleio/Service.c | 106 ++++------- devices/ble_hci/common-hal/_bleio/__init__.c | 4 + devices/ble_hci/common-hal/_bleio/att.c | 169 +++++++++--------- devices/ble_hci/common-hal/_bleio/att.h | 4 +- devices/ble_hci/common-hal/_bleio/hci.h | 1 + 11 files changed, 206 insertions(+), 270 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index 6c94bb1a92..2e1baea041 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -240,7 +240,12 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable self->advertising_timeout_msecs = 0; // Reset list of known attributes. + // Indices into the list are handles. Handle 0x0000 designates an invalid handle, + // so store None there to skip it. self->attributes = mp_obj_new_list(0, NULL); + bleio_adapter_add_attribute(mp_const_none); + self->last_added_service_handle = BLE_GATT_HANDLE_INVALID; + self->last_added_characteristic_handle = BLE_GATT_HANDLE_INVALID; } bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self) { @@ -683,6 +688,25 @@ void common_hal_bleio_adapter_erase_bonding(bleio_adapter_obj_t *self) { //FIX bonding_erase_storage(); } +uint16_t bleio_adapter_add_attribute(bleio_adapter_obj_t *adapter, mp_obj_t *attribute) { + // The handle is the index of this attribute in the attributes list. + uint16_t handle = (uint16_t) adapter->attributes->len; + mp_obj_list_append(adapter->attributes, attribute); + return handle; +} + +mp_obj_t* bleio_adapter_get_attribute(bleio_adapter_obj_t *adapter, uint16_t handle) { + if (handle == 0 || handle >= adapter->attributes->len) { + return mp_const_none; + } + return adapter->attributes->items[handle]; +} + +uint16_t bleio_adapter_max_attribute_handle(bleio_adapter_obj_t *adapter) { + return adapter->attributes->len - 1; +} + + void bleio_adapter_gc_collect(bleio_adapter_obj_t* adapter) { gc_collect_root((void**)adapter, sizeof(bleio_adapter_obj_t) / sizeof(size_t)); gc_collect_root((void**)bleio_connections, sizeof(bleio_connections) / sizeof(size_t)); diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.h b/devices/ble_hci/common-hal/_bleio/Adapter.h index 9ff122d26a..1fae5f6829 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.h +++ b/devices/ble_hci/common-hal/_bleio/Adapter.h @@ -68,8 +68,15 @@ typedef struct _bleio_adapter_obj_t { // All the local attributes for this device. The index into the list // corresponds to the handle. mp_obj_list_t *attributes; + // Handle for last added service. Characteristics can only be added immediately after + // the service they belong to. This vets that. + uint16_t last_added_service_handle; + uint16_t last_added_characteristic_handle; } bleio_adapter_obj_t; +uint16_t bleio_adapter_add_attribute(bleio_adapter_obj_t *adapter, mp_obj_t *attribute); +mp_obj_t* bleio_adapter_get_attribute(bleio_adapter_obj_t *adapter, uint16_t handle); +uint16_t bleio_adapter_max_attribute_handle(bleio_adapter_obj_t *adapter); void bleio_adapter_background(bleio_adapter_obj_t* adapter); void bleio_adapter_gc_collect(bleio_adapter_obj_t* adapter); void bleio_adapter_reset(bleio_adapter_obj_t* adapter); diff --git a/devices/ble_hci/common-hal/_bleio/Attribute.c b/devices/ble_hci/common-hal/_bleio/Attribute.c index d9041da717..0c56c08a88 100644 --- a/devices/ble_hci/common-hal/_bleio/Attribute.c +++ b/devices/ble_hci/common-hal/_bleio/Attribute.c @@ -25,10 +25,24 @@ */ #include "shared-bindings/_bleio/Attribute.h" +#include "shared-bindings/_bleio/Characteristic.h" +#include "shared-bindings/_bleio/Descriptor.h" +#include "shared-bindings/_bleio/Service.h" -// Return the type of the attribute -bleio_attribute_type_uuid(mp_obj_t *attribute) { - if mp_is_o +// Return the type of the attribute. +ble_attribute_type bleio_attribute_type_uuid(mp_obj_t *attribute) { + if (MP_OBJ_IS_TYPE(attribute, &bleio_characteristic_type)) { + return BLE_TYPE_CHARACTERISTIC; + } + if (MP_OBJ_IS_TYPE(attribute, &bleio_descriptor_type)) { + return BLE_TYPE_DESCRIPTOR; + } + if (MP_OBJ_IS_TYPE(attribute, &bleio_service_type)) { + bleio_service_obj_t *service = MP_OBJ_TO_PTR(attribute); + return service->is_secondary ? BLE_TYPE_SECONDARY_SERVICE : BLE_TYPE_PRIMARY_SERVICE; + } + return BLE_TYPE_UNKNOWN; +} // Convert a _bleio security mode to a ble_gap_conn_sec_mode_t setting. // void bleio_attribute_gatts_set_security_mode(ble_gap_conn_sec_mode_t *perm, bleio_attribute_security_mode_t security_mode) { diff --git a/devices/ble_hci/common-hal/_bleio/Attribute.h b/devices/ble_hci/common-hal/_bleio/Attribute.h index f527bcf740..5ad2142d3e 100644 --- a/devices/ble_hci/common-hal/_bleio/Attribute.h +++ b/devices/ble_hci/common-hal/_bleio/Attribute.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * Copyright (c) 2020 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 @@ -29,6 +29,15 @@ #include "shared-module/_bleio/Attribute.h" +// Types returned by attribute table lookups. These are UUIDs. +enum ble_attribute_type { + BLE_TYPE_UNKNOWN = 0x0000, + BLE_TYPE_PRIMARY_SERVICE = 0x2800, + BLE_TYPE_SECONDARY_SERVICE = 0x2801, + BLE_TYPE_CHARACTERISTIC = 0x2803, + BLE_TYPE_DESCRIPTOR = 0x2900 +}; + // typedef struct // { // uint8_t sm : 4; /**< Security Mode (1 or 2), 0 for no permissions at all. */ diff --git a/devices/ble_hci/common-hal/_bleio/Characteristic.c b/devices/ble_hci/common-hal/_bleio/Characteristic.c index 74cbede0eb..1c678b7617 100644 --- a/devices/ble_hci/common-hal/_bleio/Characteristic.c +++ b/devices/ble_hci/common-hal/_bleio/Characteristic.c @@ -34,58 +34,10 @@ #include "common-hal/_bleio/Adapter.h" -// STATIC uint16_t characteristic_get_cccd(uint16_t cccd_handle, uint16_t conn_handle) { -// uint16_t cccd; -// // ble_gatts_value_t value = { -// // .p_value = (uint8_t*) &cccd, -// // .len = 2, -// // }; - -// // const uint32_t err_code = sd_ble_gatts_value_get(conn_handle, cccd_handle, &value); - -// // if (err_code == BLE_ERROR_GATTS_SYS_ATTR_MISSING) { -// // // CCCD is not set, so say that neither Notify nor Indicate is enabled. -// // cccd = 0; -// // } else { -// // check_nrf_error(err_code); -// // } - -// return cccd; -// } - - -// STATIC void characteristic_gatts_notify_indicate(uint16_t handle, uint16_t conn_handle, mp_buffer_info_t *bufinfo, uint16_t hvx_type) { -// uint16_t hvx_len = bufinfo->len; - -// ble_gatts_hvx_params_t hvx_params = { -// .handle = handle, -// .type = hvx_type, -// .offset = 0, -// .p_len = &hvx_len, -// .p_data = bufinfo->buf, -// }; - -// while (1) { -// const uint32_t err_code = sd_ble_gatts_hvx(conn_handle, &hvx_params); -// if (err_code == NRF_SUCCESS) { -// break; -// } -// // TX buffer is full -// // We could wait for an event indicating the write is complete, but just retrying is easier. -// if (err_code == NRF_ERROR_RESOURCES) { -// RUN_BACKGROUND_TASKS; -// continue; -// } - -// // Some real error has occurred. -// check_nrf_error(err_code); -// } -// } - void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, bleio_service_obj_t *service, uint16_t handle, bleio_uuid_obj_t *uuid, bleio_characteristic_properties_t props, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_buffer_info_t *initial_value_bufinfo) { self->service = service; self->uuid = uuid; - //FIX self->handle = BLE_GATT_HANDLE_INVALID; + self->handle = BLE_GATT_HANDLE_INVALID; self->props = props; self->read_perm = read_perm; self->write_perm = write_perm; @@ -153,30 +105,23 @@ void common_hal_bleio_characteristic_set_value(bleio_characteristic_obj_t *self, // Always write the value locally even if no connections are active. // conn_handle is ignored for non-system attributes, so we use BLE_CONN_HANDLE_INVALID. common_hal_bleio_gatts_write(self->handle, BLE_CONN_HANDLE_INVALID, bufinfo); - // Check to see if we need to notify or indicate any active connections. - for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { - bleio_connection_internal_t *connection = &bleio_connections[i]; - uint16_t conn_handle = connection->conn_handle; - if (conn_handle == BLE_CONN_HANDLE_INVALID) { - continue; - } + // Notify or indicate all active connections. + uint16_t cccd = 0; - //FIX - // uint16_t cccd = 0; + const bool notify = self->props & CHAR_PROP_NOTIFY; + const bool indicate = self->props & CHAR_PROP_INDICATE; + // Read the CCCD value, if there is one. + if ((notify | indicate) && self->cccd_handle != BLE_GATT_HANDLE_INVALID) { + common_hal_bleio_gatts_read(self->cccd_handle, conn_handle, &cccd, sizeof(cccd)); + } - // const bool notify = self->props & CHAR_PROP_NOTIFY; - // const bool indicate = self->props & CHAR_PROP_INDICATE; - // if (notify | indicate) { - // cccd = characteristic_get_cccd(self->cccd_handle, conn_handle); - // } + // It's possible that both notify and indicate are set. + if (notify && (cccd & BLE_GATT_HVX_NOTIFICATION)) { + att_notify(self->handle, bufinfo->buf, MIN(bufinfo->len, self->max_length)); + } + if (indicate && (cccd & BLE_GATT_HVX_INDICATION)) { + att_indicate(self->handle, bufinfo->buf, MIN(bufinfo->len, self->max_length)); - // // It's possible that both notify and indicate are set. - // if (notify && (cccd & BLE_GATT_HVX_NOTIFICATION)) { - // characteristic_gatts_notify_indicate(self->handle, conn_handle, bufinfo, BLE_GATT_HVX_NOTIFICATION); - // } - // if (indicate && (cccd & BLE_GATT_HVX_INDICATION)) { - // characteristic_gatts_notify_indicate(self->handle, conn_handle, bufinfo, BLE_GATT_HVX_INDICATION); - // } } } } @@ -191,35 +136,16 @@ bleio_characteristic_properties_t common_hal_bleio_characteristic_get_properties } void common_hal_bleio_characteristic_add_descriptor(bleio_characteristic_obj_t *self, bleio_descriptor_obj_t *descriptor) { - //FIX - // ble_uuid_t desc_uuid; - // bleio_uuid_convert_to_nrf_ble_uuid(descriptor->uuid, &desc_uuid); + if (self->handle != common_hal_bleio_adapter_obj->last_added_characteristic_handle) { + mp_raise_bleio_BluetoothError( + translate("Descriptor can only be added to most recently added characteristic")); + } - // ble_gatts_attr_md_t desc_attr_md = { - // // Data passed is not in a permanent location and should be copied. - // .vloc = BLE_GATTS_VLOC_STACK, - // .vlen = !descriptor->fixed_length, - // }; + descriptor->handle = bleio_adapter_add_attribute(common_hal_bleio_adapter_obj, descriptor); - // bleio_attribute_gatts_set_security_mode(&desc_attr_md.read_perm, descriptor->read_perm); - // bleio_attribute_gatts_set_security_mode(&desc_attr_md.write_perm, descriptor->write_perm); - - // mp_buffer_info_t desc_value_bufinfo; - // mp_get_buffer_raise(descriptor->value, &desc_value_bufinfo, MP_BUFFER_READ); - - // ble_gatts_attr_t desc_attr = { - // .p_uuid = &desc_uuid, - // .p_attr_md = &desc_attr_md, - // .init_len = desc_value_bufinfo.len, - // .p_value = desc_value_bufinfo.buf, - // .init_offs = 0, - // .max_len = descriptor->max_length, - // }; - - // check_nrf_error(sd_ble_gatts_descriptor_add(self->handle, &desc_attr, &descriptor->handle)); - - // descriptor->next = self->descriptor_list; - // self->descriptor_list = descriptor; + // Link together all the descriptors for this characteristic. + descriptor->next = self->descriptor_list; + self->descriptor_list = descriptor; } void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, bool notify, bool indicate) { @@ -234,11 +160,12 @@ void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, const uint16_t conn_handle = bleio_connection_get_conn_handle(self->service->connection); common_hal_bleio_check_connected(conn_handle); - //FIX - // uint16_t cccd_value = - // (notify ? BLE_GATT_HVX_NOTIFICATION : 0) | - // (indicate ? BLE_GATT_HVX_INDICATION : 0); + uint16_t cccd_value = + (notify ? BLE_GATT_HVX_NOTIFICATION : 0) | + (indicate ? BLE_GATT_HVX_INDICATION : 0); + (void) cccd_value; + //FIX call att_something to set remote CCCD // ble_gattc_write_params_t write_params = { // .write_op = BLE_GATT_OP_WRITE_REQ, // .handle = self->cccd_handle, diff --git a/devices/ble_hci/common-hal/_bleio/Characteristic.h b/devices/ble_hci/common-hal/_bleio/Characteristic.h index 4d5fa02f05..7887afdfba 100644 --- a/devices/ble_hci/common-hal/_bleio/Characteristic.h +++ b/devices/ble_hci/common-hal/_bleio/Characteristic.h @@ -43,6 +43,7 @@ typedef struct _bleio_characteristic_obj { uint16_t max_length; bool fixed_length; uint16_t handle; + uint16_t value_handle; // Should be handle+1. bleio_characteristic_properties_t props; bleio_attribute_security_mode_t read_perm; bleio_attribute_security_mode_t write_perm; diff --git a/devices/ble_hci/common-hal/_bleio/Service.c b/devices/ble_hci/common-hal/_bleio/Service.c index ef2de6ee7d..696b8b943e 100644 --- a/devices/ble_hci/common-hal/_bleio/Service.c +++ b/devices/ble_hci/common-hal/_bleio/Service.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * Copyright (c) 2020 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -33,7 +33,6 @@ #include "shared-bindings/_bleio/Adapter.h" uint32_t _common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uuid_obj_t *uuid, bool is_secondary, mp_obj_list_t * characteristic_list) { - self->handle = 0xFFFF; self->uuid = uuid; self->characteristic_list = characteristic_list; self->is_remote = false; @@ -42,16 +41,18 @@ uint32_t _common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uu vm_used_ble = true; - self->handle = bleio_adapter_add_attribute( - common_hal_bleio_adapter_obj, - is_secondary ? BLE_TYPE_SECONDARY_SERVICE : BLE_TYPE_PRIMARY_SERVICE, - uuid, &status); - return status; + self->handle = bleio_adapter_add_attribute(common_hal_bleio_adapter_obj, self); + if (self->handle = BLE_GATT_HANDLE_INVALID) { + return 1; + } + return 0; } void common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uuid_obj_t *uuid, bool is_secondary) { - check_hci_error(_common_hal_bleio_service_construct(self, uuid, is_secondary, - mp_obj_new_list(0, NULL))); + if (_common_hal_bleio_service_construct(self, uuid, is_secondary, + mp_obj_new_list(0, NULL)) != 0) { + mp_raise_RuntimeError(translate("Failed to add service")); + } } void bleio_service_from_connection(bleio_service_obj_t *self, mp_obj_t connection) { @@ -83,83 +84,36 @@ void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, bleio_characteristic_obj_t *characteristic, mp_buffer_info_t *initial_value_bufinfo) { - //FIX how it's done by ArduinoBLE when a service is added. - // uint16_t startHandle = attributeCount(); - uint16_t start_handle bleio_adapter_num_attributes(common_hal_bleio_adapter_obj); + if (self->handle != common_hal_bleio_adapter_obj->last_added_service_handle) { + mp_raise_bleio_BluetoothError( + translate("Characteristic can only be added to most recently added service")); + } + characteristic->decl_handle = bleio_adapter_add_attribute(common_hal_bleio_adapter_obj, characteristic); + // This is the value handle + characteristic->value_handle = bleio_adapter_add_attribute(common_hal_bleio_adapter_obj, characteristic); - // for (unsigned int i = 0; i < service->characteristicCount(); i++) { - // BLELocalCharacteristic* characteristic = service->characteristic(i); + if (characteristic->props & (CHAR_PROP_NOTIFY | CHAR_PROP_INDICATE)) { + // We need a CCCD. + bleio_descriptor_obj_t *cccd = m_new_obj(bleio_descriptor_obj_t); + cccd->base.type = &bleio_descriptor_type; + cccd->read_perm = SECURITY_MODE_OPEN; + // Make CCCD write permission match characteristic read permission. + cccd->write_perm = characteristic->read_perm; + characteristic->cccd_handle = common_hal_bleio_characteristic_add_descriptor(characteristic, cccd); + } - // characteristic->retain(); - // _attributes.add(characteristic); - // characteristic->setHandle(attributeCount()); - - // // add the characteristic again to make space of the characteristic value handle - // _attributes.add(characteristic); - - // for (unsigned int j = 0; j < characteristic->descriptorCount(); j++) { - // BLELocalDescriptor* descriptor = characteristic->descriptor(j); - - // descriptor->retain(); - // _attributes.add(descriptor); - // descriptor->setHandle(attributeCount()); - // } - // } - - service->setHandles(startHandle, attributeCount()); - // ble_gatts_char_md_t char_md = { - // .char_props.broadcast = (characteristic->props & CHAR_PROP_BROADCAST) ? 1 : 0, - // .char_props.read = (characteristic->props & CHAR_PROP_READ) ? 1 : 0, - // .char_props.write_wo_resp = (characteristic->props & CHAR_PROP_WRITE_NO_RESPONSE) ? 1 : 0, - // .char_props.write = (characteristic->props & CHAR_PROP_WRITE) ? 1 : 0, - // .char_props.notify = (characteristic->props & CHAR_PROP_NOTIFY) ? 1 : 0, - // .char_props.indicate = (characteristic->props & CHAR_PROP_INDICATE) ? 1 : 0, - // }; - - // ble_gatts_attr_md_t cccd_md = { - // .vloc = BLE_GATTS_VLOC_STACK, - // }; - - // ble_gatts_attr_md_t char_attr_md = { - // .vloc = BLE_GATTS_VLOC_STACK, - // .vlen = !characteristic->fixed_length, - // }; - - // if (char_md.char_props.notify || char_md.char_props.indicate) { - // BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cccd_md.read_perm); - // // Make CCCD write permission match characteristic read permission. - // bleio_attribute_gatts_set_security_mode(&cccd_md.write_perm, characteristic->read_perm); - - // char_md.p_cccd_md = &cccd_md; - // } - - // bleio_attribute_gatts_set_security_mode(&char_attr_md.read_perm, characteristic->read_perm); - // bleio_attribute_gatts_set_security_mode(&char_attr_md.write_perm, characteristic->write_perm); // #if CIRCUITPY_VERBOSE_BLE // // Turn on read authorization so that we receive an event to print on every read. // char_attr_md.rd_auth = true; // #endif - // ble_gatts_attr_t char_attr = { - // .p_uuid = &char_uuid, - // .p_attr_md = &char_attr_md, - // .init_len = 0, - // .p_value = NULL, - // .init_offs = 0, - // .max_len = characteristic->max_length, - // }; + // These are not supplied or available. + characteristic->user_desc_handle = BLE_GATT_HANDLE_INVALID; + characteristic->sccd_handle = BLE_GATT_HANDLE_INVALID; - // ble_gatts_char_handles_t char_handles; - - // check_nrf_error(sd_ble_gatts_characteristic_add(self->handle, &char_md, &char_attr, &char_handles)); - - // characteristic->user_desc_handle = char_handles.user_desc_handle; - // characteristic->cccd_handle = char_handles.cccd_handle; - // characteristic->sccd_handle = char_handles.sccd_handle; - // characteristic->handle = char_handles.value_handle; // #if CIRCUITPY_VERBOSE_BLE // mp_printf(&mp_plat_print, "Char handle %x user %x cccd %x sccd %x\n", characteristic->handle, characteristic->user_desc_handle, characteristic->cccd_handle, characteristic->sccd_handle); // #endif - // mp_obj_list_append(self->characteristic_list, MP_OBJ_FROM_PTR(characteristic)); + mp_obj_list_append(self->characteristic_list, MP_OBJ_FROM_PTR(characteristic)); } diff --git a/devices/ble_hci/common-hal/_bleio/__init__.c b/devices/ble_hci/common-hal/_bleio/__init__.c index 07aaee747e..c647190994 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.c +++ b/devices/ble_hci/common-hal/_bleio/__init__.c @@ -63,6 +63,10 @@ void check_hci_error(hci_result_t result) { mp_raise_bleio_BluetoothError(translate("Error writing to HCI adapter")); return; + case HCI_ATT_ERROR: + mp_raise_RuntimeError(translate("Error in ATT protocol code")); + return; + default: // Should be an HCI status error, > 0. if (result > 0) { diff --git a/devices/ble_hci/common-hal/_bleio/att.c b/devices/ble_hci/common-hal/_bleio/att.c index ad1dddca22..013a517378 100644 --- a/devices/ble_hci/common-hal/_bleio/att.c +++ b/devices/ble_hci/common-hal/_bleio/att.c @@ -30,22 +30,15 @@ #include "py/obj.h" #include "common-hal/_bleio/Adapter.h" +#include "common-hal/_bleio/Attribute.h" #include "supervisor/shared/tick.h" -enum ble_attribute_type { - BLE_TYPE_UNKNOWN = 0x0000, - BLE_TYPE_PRIMARY_SERVICE = 0x2800, - BLE_TYPE_SECONDARY_SERVICE = 0x2801, - BLE_TYPE_CHARACTERISTIC = 0x2803, - BLE_TYPE_DESCRIPTOR = 0x2900 -}; - STATIC uint16_t max_mtu = BT_ATT_DEFAULT_LE_MTU; // 23 STATIC unsigned long timeout = 5000; STATIC volatile bool confirm; -STATIC uint16_t long_write_handle = 0x0000; +STATIC uint16_t long_write_handle = BLE_GATT_HANDLE_INVALID; STATIC uint8_t* long_write_value = NULL; STATIC uint16_t long_write_value_length = 0; @@ -123,7 +116,7 @@ STATIC void check_and_save_expected_rsp(uint16_t conn_handle, uint8_t opcode, ui void att_init(void) { max_mtu = BT_ATT_DEFAULT_LE_MTU; timeout = 5000; - long_write_handle = 0x0000; + long_write_handle = BLE_GATT_HANDLE_INVALID; long_write_value = NULL; long_write_value_length = 0; @@ -225,12 +218,12 @@ bool att_disconnect_from_address(bt_addr_le_t *addr) { // reqStart_handle = rawService->end_handle + 1; -// if (reqStart_handle == 0x0000) { -// reqEnd_handle = 0x0000; +// if (reqStart_handle == BLE_GATT_HANDLE_INVALID) { +// reqEnd_handle = BLE_GATT_HANDLE_INVALID; // } // } // } else { -// reqEnd_handle = 0x0000; +// reqEnd_handle = BLE_GATT_HANDLE_INVALID; // } // } @@ -498,7 +491,7 @@ void att_remove_connection(uint16_t handle, uint8_t reason) { // } // } - long_write_handle = 0x0000; + long_write_handle = BLE_GATT_HANDLE_INVALID; long_write_value_length = 0; } @@ -619,7 +612,7 @@ bool att_disconnect_all(void) { // return BLEDevice(); // } -bool att_handle_notify(uint16_t handle, const uint8_t* value, int length) { +bool att_notify(uint16_t handle, const uint8_t* value, int length) { int num_notifications = 0; for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { @@ -627,21 +620,20 @@ bool att_handle_notify(uint16_t handle, const uint8_t* value, int length) { continue; } - //FIX This seems fishy. Why just .mtu instead of .mtu + 1 for opcode - uint8_t notification[bleio_connections[i].mtu]; - uint16_t notification_length = 0; + typedef struct notify_t __packed { + struct bt_att_hdr hdr; + struct bt_att_notify ntf; + }; - notification[0] = BT_ATT_OP_NOTIFY; - notification_length++; + size_t allowed_length = MIN((uint16_t)(bleio_connections[i].mtu - sizeof(notify_t)), (uint16_t)length); - memcpy(¬ification[1], &handle, sizeof(handle)); - notification_length += sizeof(handle); - - length = MIN((uint16_t)(bleio_connections[i].mtu - notification_length), (uint16_t)length); - memcpy(¬ification[notification_length], value, length); - notification_length += length; - - hci_send_acl_pkt(bleio_connections[i].conn_handle, BT_L2CAP_CID_ATT, notification_length, notification); + uint8_t notify_bytes[sizeof(cmd_s) + allowed_length]; + notify_t *notify_p = (notify_t *) notify_bytes; + notify_p->hdr.code = BT_ATT_OP_NOTIFY;; + notify_p->ntf.handle = handle; + memcpy(notify_p->ntf.value, data, allowed_length); + hci_send_acl_pkt(bleio_connections[i].conn_handle, BT_L2CAP_CID_ATT, + size_of(notify_bytes), notify_bytes); num_notifications++; } @@ -649,7 +641,7 @@ bool att_handle_notify(uint16_t handle, const uint8_t* value, int length) { return (num_notifications > 0); } -bool att_handle_indicate(uint16_t handle, const uint8_t* value, int length) { +bool att_indicate(conn_handle, uint16_t handle, const uint8_t* value, int length) { int num_indications = 0; for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { @@ -657,22 +649,23 @@ bool att_handle_indicate(uint16_t handle, const uint8_t* value, int length) { continue; } - uint8_t indication[bleio_connections[i].mtu]; - uint16_t indication_length = 0; + typedef struct indicate_t __packed { + struct bt_att_hdr hdr; + struct bt_att_indicate ind; + }; - indication[0] = BT_ATT_OP_INDICATE; - indication_length++; + size_t allowed_length = MIN((uint16_t)(bleio_connections[i].mtu - sizeof(indicate_t)), (uint16_t)length); - memcpy(&indication[1], &handle, sizeof(handle)); - indication_length += sizeof(handle); - - length = MIN((uint16_t)(bleio_connections[i].mtu - indication_length), (uint16_t)length); - memcpy(&indication[indication_length], value, length); - indication_length += length; + uint8_t indicate_bytes[sizeof(cmd_s) + allowed_length]; + struct indicate_s *indicate_p = (indicate_s *) indicate_bytes; + indicate_p->hdr.code = BT_ATT_OP_INDICATE;; + indicate_p->ind.handle = handle; + memcpy(indicate->ind.value, data, allowed_length); confirm = false; - hci_send_acl_pkt(bleio_connections[i].conn_handle, BT_L2CAP_CID_ATT, indication_length, indication); + hci_send_acl_pkt(bleio_connections[i].conn_handle, BT_L2CAP_CID_ATT, + sizeof(indicate_bytes), indicate_bytes); while (!confirm) { hci_poll_for_incoming_pkt(); @@ -706,7 +699,7 @@ STATIC void process_error(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { STATIC void process_mtu_req(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { struct bt_att_exchange_mtu_req *req = (struct bt_att_exchange_mtu_req *) data; if (dlen != sizeof(req)) { - send_error(conn_handle, BT_ATT_OP_MTU_REQ, 0x0000, BT_ATT_ERR_INVALID_PDU); + send_error(conn_handle, BT_ATT_OP_MTU_REQ, BLE_GATT_HANDLE_INVALID, BT_ATT_ERR_INVALID_PDU); return; } @@ -983,7 +976,7 @@ STATIC void process_read_or_read_blob_req(uint16_t conn_handle, uint16_t mtu, ui if (opcode == BT_ATT_OP_READ_REQ) { if (dlen != sizeof(struct bt_att_read_req)) { - send_error(conn_handle, BT_ATT_OP_READ_REQ, 0x0000, BT_ATT_ERR_INVALID_PDU); + send_error(conn_handle, BT_ATT_OP_READ_REQ, BLE_GATT_HANDLE_INVALID, BT_ATT_ERR_INVALID_PDU); return; } @@ -993,7 +986,7 @@ STATIC void process_read_or_read_blob_req(uint16_t conn_handle, uint16_t mtu, ui } else { if (dlen != sizeof(struct bt_att_read_blob_req)) { - send_error(conn_handle, BT_ATT_OP_READ_BLOB_REQ, 0x0000, BT_ATT_ERR_INVALID_PDU); + send_error(conn_handle, BT_ATT_OP_READ_BLOB_REQ, BLE_GATT_HANDLE_INVALID, BT_ATT_ERR_INVALID_PDU); return; } @@ -1234,7 +1227,7 @@ STATIC void process_write_req_or_cmd(uint16_t conn_handle, uint16_t mtu, uint8_t if (dlen < sizeof(struct bt_att_write_req)) { if (with_response) { - send_error(conn_handle, BT_ATT_OP_WRITE_REQ, 0x0000, BT_ATT_ERR_INVALID_PDU); + send_error(conn_handle, BT_ATT_OP_WRITE_REQ, BLE_GATT_HANDLE_INVALID, BT_ATT_ERR_INVALID_PDU); } return; } @@ -1326,41 +1319,41 @@ STATIC void process_write_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[] } STATIC void process_prepare_write_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { - //FIX struct bt_att_prepare_write_req *req = (struct bt_att_prepare_write_req *) data; + FIX struct bt_att_prepare_write_req *req = (struct bt_att_prepare_write_req *) data; if (dlen < sizeof(struct bt_att_prepare_write_req)) { - send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, 0x0000, BT_ATT_ERR_INVALID_PDU); + send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, BLE_GATT_HANDLE_INVALID, BT_ATT_ERR_INVALID_PDU); return; } - // uint16_t handle = req->handle; - // uint16_t offset = req->offset; + uint16_t handle = req->handle; + uint16_t offset = req->offset; - // if ((uint16_t)(handle - 1) > GATT.attributeCount()) { - // send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, handle, BT_ATT_ERR_ATTR_NOT_FOUND); - // return; - // } + if (handle > bleio_adapter_max_attribute_handle(common_hal_bleio_adapter_obj)) { + send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, handle, BT_ATT_ERR_ATTR_NOT_FOUND); + return; + } - // BLELocalAttribute* attribute = GATT.attribute(handle - 1); + mp_obj_t *attribute = bleio_adapter_get_attribute(common_hal_bleio_adapter_obj, handle); - // if (attribute->type() != BLE_TYPE_CHARACTERISTIC) { - // send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, handle, BT_ATT_ERR_ATTR_NOT_LONG); - // return; - // } + if (!MP_OBJ_IS_TYPE(attribute, &bleio_characteristic_type)) { + send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, handle, BT_ATT_ERR_ATTR_NOT_LONG); + return; + } - // BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)attribute; + bleio_characteristic_obj_t* characteristic = MP_OBJ_TO_PTR(attribute); - // if (handle != characteristic->value_handle()) { - // send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, handle, BT_ATT_ERR_ATTR_NOT_LONG); - // return; - // } + if (handle != characteristic->value_handle) { + send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, handle, BT_ATT_ERR_ATTR_NOT_LONG); + return; + } - // if ((characteristic->properties() & BLEWrqite) == 0) { - // send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, handle, BT_ATT_ERR_WRITE_NOT_PERM); - // return; - // } + if (characteristic->props & CHAR_PROP_WRITE) { + send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, handle, BT_ATT_ERR_WRITE_NOT_PERM); + return; + } - // if (long_write_handle == 0) { + if (long_write_handle == BLE_GATT_HANDLE_INVALID) // int valueSize = characteristic->valueSize(); // long_write_value = (uint8_t*)realloc(long_write_value, valueSize); @@ -1398,7 +1391,7 @@ STATIC void process_exec_write_req(uint16_t conn_handle, uint16_t mtu, uint8_t d struct bt_att_exec_write_req *req = (struct bt_att_exec_write_req *) data; if (dlen != sizeof(struct bt_att_exec_write_req)) { - send_error(conn_handle, BT_ATT_OP_EXEC_WRITE_REQ, 0x0000, BT_ATT_ERR_INVALID_PDU); + send_error(conn_handle, BT_ATT_OP_EXEC_WRITE_REQ, BLE_GATT_HANDLE_INVALID, BT_ATT_ERR_INVALID_PDU); return; } @@ -1413,7 +1406,7 @@ STATIC void process_exec_write_req(uint16_t conn_handle, uint16_t mtu, uint8_t d } } - long_write_handle = 0x0000; + long_write_handle = BLE_GATT_HANDLE_INVALID; long_write_value_length = 0; uint8_t response[mtu]; @@ -1515,33 +1508,35 @@ int att_read_req(uint16_t conn_handle, uint16_t handle, uint8_t response_buffer[ } int att_write_req(uint16_t conn_handle, uint16_t handle, const uint8_t* data, uint8_t data_len, uint8_t response_buffer[]) { - struct __packed { - struct bt_att_hdr h; - struct bt_att_write_req r; - } req = { { - .code = BT_ATT_OP_WRITE_REQ, - }, { - .handle = handle, - } + typedef struct write_req_t __packed { + struct bt_att_hdr hdr; + struct bt_att_write_req req; }; - memcpy(req.r.value, data, data_len); - return send_req_wait_for_rsp(conn_handle, sizeof(req) + data_len, (uint8_t *) &req, response_buffer); + uint8_t req_bytes[sizeof(write_req_t) + data_len]; + struct write_req_t *write_req_P = (write_req_t *) req_bytes; + req_p->hdr.code = BT_ATT_OP_WRITE_REQ; + req_p->req.handle = handle; + memcpy(req_p->req.value, data, data_len); + + memcpy(req.req.value, data, data_len); + + return send_req_wait_for_rsp(conn_handle, sizeof(req_bytes), req, response_buffer); } void att_write_cmd(uint16_t conn_handle, uint16_t handle, const uint8_t* data, uint8_t data_len) { - struct __packed { + struct cmd_s __packed { struct bt_att_hdr h; struct bt_att_write_cmd r; - } req = { { - .code = BT_ATT_OP_WRITE_CMD, - }, { - .handle = handle, - } }; - memcpy(req.r.value, data, data_len); - return send_req(conn_handle, sizeof(req) + data_len, (uint8_t *) &req); + uint8_t cmd_bytes[sizeof(cmd_s) + data_len]; + struct cmd_s *cmd_p = (cmd_s *) cmd_bytes; + cmd_p->h.code = BT_ATT_OP_WRITE_CMD; + cmd_p->r.handle = handle; + memcpy(cmd_p->r.value, data, data_len); + + return send_cmd(conn_handle, sizeof(cmd_bytes), cmd_bytes); } void att_process_data(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { diff --git a/devices/ble_hci/common-hal/_bleio/att.h b/devices/ble_hci/common-hal/_bleio/att.h index ee01e33f60..6cf9b305b2 100644 --- a/devices/ble_hci/common-hal/_bleio/att.h +++ b/devices/ble_hci/common-hal/_bleio/att.h @@ -39,10 +39,10 @@ bool att_disconnect_all(void); bool att_disconnect_from_address(bt_addr_le_t *addr); bool att_discover_attributes(bt_addr_le_t *addr, const char* service_uuid_filter); bool att_exchange_mtu(uint16_t conn_handle); -bool att_handle_indicate(uint16_t handle, const uint8_t* value, int length); bool att_handle_is_connected(uint16_t handle); -bool att_handle_notify(uint16_t handle, const uint8_t* value, int length); +bool att_indicate(uint16_t handle, const uint8_t* value, int length); bool att_is_connected(void); +bool att_notify(uint16_t handle, const uint8_t* value, int length); int att_read_req(uint16_t conn_handle, uint16_t handle, uint8_t response_buffer[]); int att_write_req(uint16_t conn_handle, uint16_t handle, const uint8_t* data, uint8_t data_len, uint8_t response_buffer[]); uint16_t att_conn_handle(bt_addr_le_t *addr); diff --git a/devices/ble_hci/common-hal/_bleio/hci.h b/devices/ble_hci/common-hal/_bleio/hci.h index 736877ddc6..89a2b3304a 100644 --- a/devices/ble_hci/common-hal/_bleio/hci.h +++ b/devices/ble_hci/common-hal/_bleio/hci.h @@ -37,6 +37,7 @@ typedef int hci_result_t; #define HCI_WRITE_TIMEOUT (-3) #define HCI_READ_ERROR (-4) #define HCI_WRITE_ERROR (-5) +#define HCI_ATT_ERROR (-6) void hci_init(void); From 1c1df053d5b7eabb42a0ecc6c958d226c0500d4e Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 31 Jul 2020 14:50:18 -0400 Subject: [PATCH 0453/1293] Add neopixel support --- ports/esp32s2/Makefile | 1 + .../espressif_saola_1_wrover/mpconfigboard.h | 2 + .../boards/espressif_saola_1_wrover/pins.c | 2 + .../esp32s2/common-hal/microcontroller/Pin.c | 29 ++++++ .../esp32s2/common-hal/microcontroller/Pin.h | 4 + .../common-hal/neopixel_write/__init__.c | 97 ++++++++++++++++++- ports/esp32s2/common-hal/pulseio/PWMOut.c | 3 +- ports/esp32s2/mpconfigport.mk | 2 + ports/esp32s2/peripherals/rmt.c | 45 +++++++++ ports/esp32s2/peripherals/rmt.h | 37 +++++++ 10 files changed, 217 insertions(+), 5 deletions(-) create mode 100644 ports/esp32s2/peripherals/rmt.c create mode 100644 ports/esp32s2/peripherals/rmt.h diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 55db73604c..19b89a13a1 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -171,6 +171,7 @@ SRC_C += \ lib/utils/stdout_helpers.c \ lib/utils/sys_stdio_mphal.c \ peripherals/pins.c \ + peripherals/rmt.c \ supervisor/shared/memory.c ifneq ($(USB),FALSE) diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h index 7d08ccf7f1..338186dc52 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h @@ -29,4 +29,6 @@ #define MICROPY_HW_BOARD_NAME "Saola 1 w/Wrover" #define MICROPY_HW_MCU_NAME "ESP32S2" +#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) + #define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/pins.c b/ports/esp32s2/boards/espressif_saola_1_wrover/pins.c index 1d4e2c4eba..0562d9331f 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/pins.c +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/pins.c @@ -42,5 +42,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index 5a059f0bbc..2b2b70a45a 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -26,12 +26,18 @@ */ #include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "supervisor/shared/rgb_led_status.h" #include "py/mphal.h" #include "esp-idf/components/driver/include/driver/gpio.h" #include "esp-idf/components/soc/include/hal/gpio_hal.h" +#ifdef MICROPY_HW_NEOPIXEL +bool neopixel_in_use; +#endif + STATIC uint32_t never_reset_pins[2]; STATIC uint32_t in_use[2]; @@ -50,6 +56,14 @@ void common_hal_never_reset_pin(const mcu_pin_obj_t* pin) { void reset_pin_number(gpio_num_t pin_number) { never_reset_pins[pin_number / 32] &= ~(1 << pin_number % 32); in_use[pin_number / 32] &= ~(1 << pin_number % 32); + + #ifdef MICROPY_HW_NEOPIXEL + if (pin_number == MICROPY_HW_NEOPIXEL->number) { + neopixel_in_use = false; + rgb_led_status_init(); + return; + } + #endif } void common_hal_reset_pin(const mcu_pin_obj_t* pin) { @@ -69,13 +83,28 @@ void reset_all_pins(void) { } in_use[0] = 0; in_use[1] = 0; + + #ifdef MICROPY_HW_NEOPIXEL + neopixel_in_use = false; + #endif } void claim_pin(const mcu_pin_obj_t* pin) { in_use[pin->number / 32] |= (1 << pin->number % 32); + #ifdef MICROPY_HW_NEOPIXEL + if (pin == MICROPY_HW_NEOPIXEL) { + neopixel_in_use = true; + } + #endif } bool pin_number_is_free(gpio_num_t pin_number) { + #ifdef MICROPY_HW_NEOPIXEL + if (pin_number == MICROPY_HW_NEOPIXEL->number) { + return !neopixel_in_use; + } + #endif + uint8_t offset = pin_number / 32; uint8_t mask = 1 << pin_number % 32; return (never_reset_pins[offset] & mask) == 0 && (in_use[offset] & mask) == 0; diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.h b/ports/esp32s2/common-hal/microcontroller/Pin.h index 19985bda6f..f6c0087031 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.h +++ b/ports/esp32s2/common-hal/microcontroller/Pin.h @@ -34,6 +34,10 @@ extern bool apa102_mosi_in_use; extern bool apa102_sck_in_use; +#ifdef MICROPY_HW_NEOPIXEL +extern bool neopixel_in_use; +#endif + void reset_all_pins(void); // reset_pin_number takes the pin number instead of the pointer so that objects don't // need to store a full pointer. diff --git a/ports/esp32s2/common-hal/neopixel_write/__init__.c b/ports/esp32s2/common-hal/neopixel_write/__init__.c index a9b42fc96a..beff528566 100644 --- a/ports/esp32s2/common-hal/neopixel_write/__init__.c +++ b/ports/esp32s2/common-hal/neopixel_write/__init__.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2018 hathach for Adafruit Industries + * Copyright (c) 2020 Lucian Copeland 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,10 +24,101 @@ * THE SOFTWARE. */ +/* Uses code from Espressif RGB LED Strip demo and drivers + * Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD + * + * 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. + */ + #include "py/mphal.h" #include "shared-bindings/neopixel_write/__init__.h" +#include "driver/rmt.h" +#include "rmt.h" + +#define WS2812_T0H_NS (350) +#define WS2812_T0L_NS (1000) +#define WS2812_T1H_NS (1000) +#define WS2812_T1L_NS (350) +#define WS2812_RESET_US (280) + +static uint32_t ws2812_t0h_ticks = 0; +static uint32_t ws2812_t1h_ticks = 0; +static uint32_t ws2812_t0l_ticks = 0; +static uint32_t ws2812_t1l_ticks = 0; + +static void IRAM_ATTR ws2812_rmt_adapter(const void *src, rmt_item32_t *dest, size_t src_size, + size_t wanted_num, size_t *translated_size, size_t *item_num) +{ + if (src == NULL || dest == NULL) { + *translated_size = 0; + *item_num = 0; + return; + } + const rmt_item32_t bit0 = {{{ ws2812_t0h_ticks, 1, ws2812_t0l_ticks, 0 }}}; //Logical 0 + const rmt_item32_t bit1 = {{{ ws2812_t1h_ticks, 1, ws2812_t1l_ticks, 0 }}}; //Logical 1 + size_t size = 0; + size_t num = 0; + uint8_t *psrc = (uint8_t *)src; + rmt_item32_t *pdest = dest; + while (size < src_size && num < wanted_num) { + for (int i = 0; i < 8; i++) { + // MSB first + if (*psrc & (1 << (7 - i))) { + pdest->val = bit1.val; + } else { + pdest->val = bit0.val; + } + num++; + pdest++; + } + size++; + psrc++; + } + *translated_size = size; + *item_num = num; +} void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, uint32_t numBytes) { - (void)digitalinout; - (void)numBytes; + // Reserve channel + uint8_t number = digitalinout->pin->number; + rmt_channel_t channel = esp32s2_peripherals_find_and_reserve_rmt(); + + // Configure Channel + rmt_config_t config = RMT_DEFAULT_CONFIG_TX(number, channel); + config.clk_div = 2; // set counter clock to 40MHz + rmt_config(&config); + rmt_driver_install(config.channel, 0, 0); + + // Convert NS timings to ticks + uint32_t counter_clk_hz = 0; + if (rmt_get_counter_clock(config.channel, &counter_clk_hz) != ESP_OK) { + mp_raise_ValueError(translate("Could not retrieve clock")); + } + float ratio = (float)counter_clk_hz / 1e9; + ws2812_t0h_ticks = (uint32_t)(ratio * WS2812_T0H_NS); + ws2812_t0l_ticks = (uint32_t)(ratio * WS2812_T0L_NS); + ws2812_t1h_ticks = (uint32_t)(ratio * WS2812_T1H_NS); + ws2812_t1l_ticks = (uint32_t)(ratio * WS2812_T1L_NS); + + // Initialize automatic timing translator + rmt_translator_init(config.channel, ws2812_rmt_adapter); + + // Write and wait to finish + if(rmt_write_sample(config.channel, pixels, (size_t)numBytes, true) != ESP_OK) { + mp_raise_ValueError(translate("Input/output error")); + } + rmt_wait_tx_done(config.channel, pdMS_TO_TICKS(100)); + + // Free channel again + esp32s2_peripherals_free_rmt(config.channel); } diff --git a/ports/esp32s2/common-hal/pulseio/PWMOut.c b/ports/esp32s2/common-hal/pulseio/PWMOut.c index c4f5e18dd4..f38bd44340 100644 --- a/ports/esp32s2/common-hal/pulseio/PWMOut.c +++ b/ports/esp32s2/common-hal/pulseio/PWMOut.c @@ -3,8 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * Uses code from Micropython, Copyright (c) 2013-2016 Damien P. George + * Copyright (c) 2020 Lucian Copeland 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 diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index c2d21e0841..21d6e7cffd 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -12,6 +12,8 @@ USB_SERIAL_NUMBER_LENGTH = 12 # Longints can be implemented as mpz, as longlong, or not LONGINT_IMPL = MPZ +CIRCUITPY_NEOPIXEL_WRITE = 1 + CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_ANALOGIO = 0 CIRCUITPY_AUDIOBUSIO = 0 diff --git a/ports/esp32s2/peripherals/rmt.c b/ports/esp32s2/peripherals/rmt.c new file mode 100644 index 0000000000..e9ad2c32ed --- /dev/null +++ b/ports/esp32s2/peripherals/rmt.c @@ -0,0 +1,45 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland 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 "rmt.h" +#include "py/runtime.h" + +bool rmt_reserved_channels[RMT_CHANNEL_MAX]; + +rmt_channel_t esp32s2_peripherals_find_and_reserve_rmt(void) { + for (size_t i = 0; i < RMT_CHANNEL_MAX; i++) { + if (!rmt_reserved_channels[i]) { + rmt_reserved_channels[i] = true; + return i; + } + } + mp_raise_RuntimeError(translate("All timers in use")); + return false; +} + +void esp32s2_peripherals_free_rmt(rmt_channel_t chan) { + rmt_reserved_channels[chan] = false; +} diff --git a/ports/esp32s2/peripherals/rmt.h b/ports/esp32s2/peripherals/rmt.h new file mode 100644 index 0000000000..4741a5bc59 --- /dev/null +++ b/ports/esp32s2/peripherals/rmt.h @@ -0,0 +1,37 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland 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_ESP32S2_PERIPHERALS_RMT_H +#define MICROPY_INCLUDED_ESP32S2_PERIPHERALS_RMT_H + +#include "py/mphal.h" +#include "driver/rmt.h" +#include + +rmt_channel_t esp32s2_peripherals_find_and_reserve_rmt(void); +void esp32s2_peripherals_free_rmt(rmt_channel_t chan); + +#endif From 94b2561860d92881e45b252e09cda5f5edaad090 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Sat, 1 Aug 2020 09:22:18 -0400 Subject: [PATCH 0454/1293] Fix include error --- ports/esp32s2/common-hal/neopixel_write/__init__.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/common-hal/neopixel_write/__init__.c b/ports/esp32s2/common-hal/neopixel_write/__init__.c index beff528566..1fc976ec36 100644 --- a/ports/esp32s2/common-hal/neopixel_write/__init__.c +++ b/ports/esp32s2/common-hal/neopixel_write/__init__.c @@ -41,6 +41,7 @@ */ #include "py/mphal.h" +#include "py/runtime.h" #include "shared-bindings/neopixel_write/__init__.h" #include "driver/rmt.h" #include "rmt.h" @@ -102,7 +103,7 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout // Convert NS timings to ticks uint32_t counter_clk_hz = 0; if (rmt_get_counter_clock(config.channel, &counter_clk_hz) != ESP_OK) { - mp_raise_ValueError(translate("Could not retrieve clock")); + mp_raise_RuntimeError(translate("Could not retrieve clock")); } float ratio = (float)counter_clk_hz / 1e9; ws2812_t0h_ticks = (uint32_t)(ratio * WS2812_T0H_NS); @@ -115,7 +116,7 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout // Write and wait to finish if(rmt_write_sample(config.channel, pixels, (size_t)numBytes, true) != ESP_OK) { - mp_raise_ValueError(translate("Input/output error")); + mp_raise_RuntimeError(translate("Input/output error")); } rmt_wait_tx_done(config.channel, pdMS_TO_TICKS(100)); From 4b71831d8b73fbf2506755c117732c1c08fddc8b Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 1 Aug 2020 12:36:20 -0400 Subject: [PATCH 0455/1293] SUPEROPT_VM = 0 for de_DE --- ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index 2c9413d653..9ab16fe447 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -18,4 +18,5 @@ CFLAGS_INLINE_LIMIT = 35 endif ifeq ($(TRANSLATION), de_DE) CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 endif From 1771858f4a480647e3c4a46f61b2b245dc4e57e6 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 1 Aug 2020 13:20:46 -0400 Subject: [PATCH 0456/1293] add RELEASE_NEEDS_CLEAN_BUILD for lang-specific CFLAGS_INLINE_LIMIT changes --- ports/atmel-samd/boards/fluff_m0/mpconfigboard.mk | 1 + ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk | 1 + ports/atmel-samd/boards/pyruler/mpconfigboard.mk | 1 + ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/ugame10/mpconfigboard.mk | 1 + 6 files changed, 8 insertions(+) diff --git a/ports/atmel-samd/boards/fluff_m0/mpconfigboard.mk b/ports/atmel-samd/boards/fluff_m0/mpconfigboard.mk index 8efc1b5759..c040eb4304 100644 --- a/ports/atmel-samd/boards/fluff_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/fluff_m0/mpconfigboard.mk @@ -14,5 +14,6 @@ SUPEROPT_GC = 0 CFLAGS_BOARD = --param max-inline-insns-auto=15 ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 endif diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk index ae1cb0969f..0345417a98 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk @@ -14,8 +14,10 @@ SUPEROPT_GC = 0 CFLAGS_BOARD = --param max-inline-insns-auto=15 ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 endif ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 endif diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index 1ea4a7601f..1614779684 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -42,6 +42,7 @@ CIRCUITPY_DISPLAY_FONT = $(TOP)/ports/atmel-samd/boards/ugame10/brutalist-6.bdf # Tweak inlining depending on language. ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 45 else CFLAGS_INLINE_LIMIT = 70 diff --git a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk index 885f58e4e1..4484b4ed94 100644 --- a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk @@ -15,5 +15,6 @@ SUPEROPT_GC = 0 CFLAGS_BOARD = --param max-inline-insns-auto=15 ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 endif diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index 9ab16fe447..735d422973 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -14,9 +14,11 @@ SUPEROPT_GC = 0 CFLAGS_BOARD = --param max-inline-insns-auto=15 ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 endif ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 SUPEROPT_VM = 0 endif diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index d641a89ebd..bd320d9e47 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -35,6 +35,7 @@ CIRCUITPY_DISPLAY_FONT = $(TOP)/ports/atmel-samd/boards/ugame10/brutalist-6.bdf # Tweak inlining depending on language. ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 45 else CFLAGS_INLINE_LIMIT = 70 From 4860e0cf629a285685e2bc633c747d08925c83c2 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 1 Aug 2020 13:21:20 -0400 Subject: [PATCH 0457/1293] change esp-idf cache tag --- .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 0f204556a3..feb6a7f633 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -421,7 +421,7 @@ jobs: id: idf-cache with: path: ${{ github.workspace }}/.idf_tools - key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20200523 + key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20200801 - name: Install IDF tools run: | $IDF_PATH/tools/idf_tools.py --non-interactive install required From 9477f222bee71ff3746dae02ac06d5cd317a2da0 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Thu, 30 Jul 2020 14:10:44 +0000 Subject: [PATCH 0458/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (786 of 786 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 020cf20ae8..1bf2a13f6e 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: 2020-07-30 07:23-0500\n" -"PO-Revision-Date: 2020-07-23 02:57+0000\n" +"PO-Revision-Date: 2020-07-31 14:41+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -229,6 +229,8 @@ msgstr "'aguardar' fora da função" #: py/compile.c msgid "'await', 'async for' or 'async with' outside async function" msgstr "" +"'await', 'async for' (async para) ou 'async with' (async com) estão fora da " +"função async" #: py/compile.c msgid "'break' outside loop" @@ -240,7 +242,7 @@ msgstr "'continue' fora do loop" #: py/objgenerator.c msgid "'coroutine' object is not an iterator" -msgstr "" +msgstr "O objeto 'corrotina' não é um iterador" #: py/compile.c msgid "'data' requires at least 2 arguments" @@ -886,7 +888,7 @@ msgstr "Erro de inicialização do I2C" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" -msgstr "" +msgstr "O I2SOut não está disponível" #: shared-bindings/aesio/aes.c #, c-format @@ -1596,6 +1598,8 @@ msgstr "" msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +"O temporizador foi reservado para uso interno - declare os pinos PWM no " +"início do programa" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1872,7 +1876,7 @@ msgstr "argumento tem tipo errado" #: extmod/ulab/code/linalg/linalg.c msgid "argument must be ndarray" -msgstr "" +msgstr "o argumento deve ser um ndarray" #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c @@ -3278,7 +3282,7 @@ msgstr "valores demais para descompactar (esperado %d)" #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" -msgstr "" +msgstr "o trapz está definido para 1D arrays de igual tamanho" #: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" @@ -3410,7 +3414,7 @@ msgstr "o value_count deve ser > 0" #: extmod/ulab/code/linalg/linalg.c msgid "vectors must have same lengths" -msgstr "" +msgstr "os vetores devem ter os mesmos comprimentos" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" From 12b81618a3a4d914114aae4ebc647a4f8bd9dc3f Mon Sep 17 00:00:00 2001 From: root Date: Sat, 1 Aug 2020 13:27:02 -0500 Subject: [PATCH 0459/1293] Changes for getting supervisor ticks --- lib/protomatter | 2 +- locale/circuitpython.pot | 2 +- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 9 ++------- supervisor/background_callback.h | 4 ++++ supervisor/port.h | 3 +++ supervisor/shared/background_callback.c | 7 +++++++ supervisor/shared/tick.c | 6 +----- 7 files changed, 19 insertions(+), 14 deletions(-) diff --git a/lib/protomatter b/lib/protomatter index 761d6437e8..00e00ee8ac 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit 761d6437e8cd6a131d51de96974337121a9c7164 +Subproject commit 00e00ee8acb043b976302051291bc236ae2676cb diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 5ed32d6382..6176a18dac 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-30 07:23-0500\n" +"POT-Creation-Date: 2020-08-01 12:58-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index ae58b089de..5bd3cc7de1 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -88,9 +88,8 @@ void pulsein_interrupt_handler(uint8_t channel) { uint32_t current_count = tc->COUNT16.COUNT.reg; pulseio_pulsein_obj_t* self = get_eic_channel_data(channel); - if (!supervisor_background_tasks_ok() || self->errored_too_fast) { - self->errored_too_fast = true; - common_hal_pulseio_pulsein_pause(self); + if (!supervisor_background_tasks_ok() ) { + mp_raise_RuntimeError(translate("Input taking too long")); return; } if (self->first_edge) { @@ -154,7 +153,6 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, self->start = 0; self->len = 0; self->first_edge = true; - self->errored_too_fast = false; if (refcount == 0) { // Find a spare timer. @@ -264,9 +262,6 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t* self, // Make sure we're paused. common_hal_pulseio_pulsein_pause(self); - // Reset erroring - self->errored_too_fast = false; - // Send the trigger pulse. if (trigger_duration > 0) { gpio_set_pin_pull_mode(self->pin, GPIO_PULL_OFF); diff --git a/supervisor/background_callback.h b/supervisor/background_callback.h index 535dd656be..e943830fd0 100644 --- a/supervisor/background_callback.h +++ b/supervisor/background_callback.h @@ -27,6 +27,8 @@ #ifndef CIRCUITPY_INCLUDED_SUPERVISOR_BACKGROUND_CALLBACK_H #define CIRCUITPY_INCLUDED_SUPERVISOR_BACKGROUND_CALLBACK_H +#include "supervisor/port.h" + /** Background callbacks are a linked list of tasks to call in the background. * * Include a member of type `background_callback_t` inside an object @@ -84,4 +86,6 @@ void background_callback_end_critical_section(void); */ void background_callback_gc_collect(void); +uint64_t background_get_ticks(void); + #endif diff --git a/supervisor/port.h b/supervisor/port.h index ad5b3cf32a..c95e43fd2e 100644 --- a/supervisor/port.h +++ b/supervisor/port.h @@ -73,6 +73,9 @@ uint32_t *port_heap_get_top(void); void port_set_saved_word(uint32_t); uint32_t port_get_saved_word(void); +// Used to keep track of last time background was run +uint64_t get_background_ticks(void); + // Get the raw tick count since start up. A tick is 1/1024 of a second, a common low frequency // clock rate. If subticks is not NULL then the port will fill in the number of subticks where each // tick is 32 subticks (for a resolution of 1/32768 or 30.5ish microseconds.) diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c index 8e12dd3625..4502424acc 100644 --- a/supervisor/shared/background_callback.c +++ b/supervisor/shared/background_callback.c @@ -37,6 +37,12 @@ STATIC volatile background_callback_t *callback_head, *callback_tail; #define CALLBACK_CRITICAL_BEGIN (common_hal_mcu_disable_interrupts()) #define CALLBACK_CRITICAL_END (common_hal_mcu_enable_interrupts()) +volatile uint64_t last_background_tick = 0; + +uint64_t get_background_ticks(void) { + return last_background_tick; +} + void background_callback_add_core(background_callback_t *cb) { CALLBACK_CRITICAL_BEGIN; if (cb->prev || callback_head == cb) { @@ -64,6 +70,7 @@ void background_callback_add(background_callback_t *cb, background_callback_fun static bool in_background_callback; void background_callback_run_all() { + last_background_tick = port_get_raw_ticks(NULL); if (!callback_head) { return; } diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 4af59f78e3..eac5104a5c 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -68,8 +68,6 @@ static volatile uint64_t PLACE_IN_DTCM_BSS(background_ticks); static background_callback_t tick_callback; -volatile uint64_t last_finished_tick = 0; - void supervisor_background_tasks(void *unused) { port_start_background_task(); @@ -93,13 +91,11 @@ void supervisor_background_tasks(void *unused) { assert_heap_ok(); - last_finished_tick = port_get_raw_ticks(NULL); - port_finish_background_task(); } bool supervisor_background_tasks_ok(void) { - return port_get_raw_ticks(NULL) - last_finished_tick < 1024; + return port_get_raw_ticks(NULL) - get_background_ticks() < 1024; } void supervisor_tick(void) { From a3d8567d2c3c83f247a2018804a81ee646724e1d Mon Sep 17 00:00:00 2001 From: root Date: Sat, 1 Aug 2020 13:45:31 -0500 Subject: [PATCH 0460/1293] Adding error message for PulseIn --- locale/circuitpython.pot | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 6176a18dac..8c88ca5be2 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-01 12:58-0500\n" +"POT-Creation-Date: 2020-08-01 13:45-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -880,6 +880,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "Input taking too long" +msgstr "" + #: py/moduerrno.c msgid "Input/output error" msgstr "" From 0ef68d6aea57d87e253df69ad6d4566585fcd858 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 1 Aug 2020 16:35:42 -0500 Subject: [PATCH 0461/1293] Improved performance for background task tick counter. --- supervisor/shared/background_callback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c index 4502424acc..ddf723697b 100644 --- a/supervisor/shared/background_callback.c +++ b/supervisor/shared/background_callback.c @@ -70,10 +70,10 @@ void background_callback_add(background_callback_t *cb, background_callback_fun static bool in_background_callback; void background_callback_run_all() { - last_background_tick = port_get_raw_ticks(NULL); if (!callback_head) { return; } + last_background_tick = port_get_raw_ticks(NULL); CALLBACK_CRITICAL_BEGIN; if (in_background_callback) { CALLBACK_CRITICAL_END; From 32bcf88e1847ba9c5460cad4a8244c8d5419384b Mon Sep 17 00:00:00 2001 From: root Date: Sat, 1 Aug 2020 17:08:48 -0500 Subject: [PATCH 0462/1293] Fixinf up submodules --- extmod/ulab | 2 +- frozen/Adafruit_CircuitPython_BLE | 2 +- frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center | 2 +- frozen/Adafruit_CircuitPython_BusDevice | 2 +- lib/protomatter | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extmod/ulab b/extmod/ulab index 11a7ecff6d..4a771347bb 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 11a7ecff6d76a02644ff23a734b792afaa615e44 +Subproject commit 4a771347bb49ec0335feb567465a690ef1ba8e5a diff --git a/frozen/Adafruit_CircuitPython_BLE b/frozen/Adafruit_CircuitPython_BLE index 5d584576ef..41f7a3530d 160000 --- a/frozen/Adafruit_CircuitPython_BLE +++ b/frozen/Adafruit_CircuitPython_BLE @@ -1 +1 @@ -Subproject commit 5d584576ef79ca36506e6c7470e7ac5204cf0a8d +Subproject commit 41f7a3530d4cacdbf668399d3a015ea29c7e169b diff --git a/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center index 3ffb3f02d2..6a034887e3 160000 --- a/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center +++ b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center @@ -1 +1 @@ -Subproject commit 3ffb3f02d2046910e09d1f5a74721bd1a4cdf8cf +Subproject commit 6a034887e370caa61fee5f51db8dd393d3e72542 diff --git a/frozen/Adafruit_CircuitPython_BusDevice b/frozen/Adafruit_CircuitPython_BusDevice index e9411c4244..eb4b21e216 160000 --- a/frozen/Adafruit_CircuitPython_BusDevice +++ b/frozen/Adafruit_CircuitPython_BusDevice @@ -1 +1 @@ -Subproject commit e9411c4244984b69ec6928370ede40cec014c10b +Subproject commit eb4b21e216efd8ec0c4862a938e81b56be961724 diff --git a/lib/protomatter b/lib/protomatter index 00e00ee8ac..2408e9c033 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit 00e00ee8acb043b976302051291bc236ae2676cb +Subproject commit 2408e9c033f5ec050967b1592b29a950a831d6c2 From 64df244cf5562b66211369c2869ea79b1bde423f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 1 Aug 2020 17:10:05 -0500 Subject: [PATCH 0463/1293] restore protomatter submodule ref --- lib/protomatter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protomatter b/lib/protomatter index 00e00ee8ac..761d6437e8 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit 00e00ee8acb043b976302051291bc236ae2676cb +Subproject commit 761d6437e8cd6a131d51de96974337121a9c7164 From fea1cad02cba369f3b9c0da8da5829a5066fc318 Mon Sep 17 00:00:00 2001 From: sabas1080 Date: Sat, 1 Aug 2020 17:51:45 -0500 Subject: [PATCH 0464/1293] add support for Bast Wifi Electronic Cats --- .github/workflows/build.yml | 1 + .../boards/electroniccats_bastwifi/pins.c | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 406f6c43ba..aa743f87b6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -384,6 +384,7 @@ jobs: - "espressif_saola_1_wroom" - "espressif_saola_1_wrover" - "unexpectedmaker_feathers2" + - "electroniccats_bastwifi" steps: - name: Set up Python 3.8 diff --git a/ports/esp32s2/boards/electroniccats_bastwifi/pins.c b/ports/esp32s2/boards/electroniccats_bastwifi/pins.c index 1d4e2c4eba..0b19346455 100644 --- a/ports/esp32s2/boards/electroniccats_bastwifi/pins.c +++ b/ports/esp32s2/boards/electroniccats_bastwifi/pins.c @@ -2,12 +2,19 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO0) }, { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO1) }, { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO3) }, { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_A6), 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) }, @@ -18,6 +25,8 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_SDA), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO16) }, { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, @@ -31,6 +40,14 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_IO37), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) }, { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) }, @@ -42,5 +59,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) }, + + { 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_global_dict_table); From b074f8a1618e765307f01ac99bd7a37f0663cf68 Mon Sep 17 00:00:00 2001 From: sabas1080 Date: Sun, 2 Aug 2020 00:42:36 -0500 Subject: [PATCH 0465/1293] update for build test --- .github/workflows/build.yml | 2 +- ports/esp32s2/boards/electroniccats_bastwifi/pins.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aa743f87b6..435dae2bb2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -381,10 +381,10 @@ jobs: fail-fast: false matrix: board: + - "electroniccats_bastwifi" - "espressif_saola_1_wroom" - "espressif_saola_1_wrover" - "unexpectedmaker_feathers2" - - "electroniccats_bastwifi" steps: - name: Set up Python 3.8 diff --git a/ports/esp32s2/boards/electroniccats_bastwifi/pins.c b/ports/esp32s2/boards/electroniccats_bastwifi/pins.c index 0b19346455..2f9987b0ed 100644 --- a/ports/esp32s2/boards/electroniccats_bastwifi/pins.c +++ b/ports/esp32s2/boards/electroniccats_bastwifi/pins.c @@ -40,14 +40,11 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_IO37), MP_ROM_PTR(&pin_GPIO37) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO37) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO35) }, { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_GPIO11) }, - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO14) }, - { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) }, { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) }, From accc454644386e10890542d6c02c6e7d897ffb4e Mon Sep 17 00:00:00 2001 From: _fonzlate Date: Sat, 1 Aug 2020 19:57:31 +0000 Subject: [PATCH 0466/1293] Translated using Weblate (Dutch) Currently translated at 100.0% (786 of 786 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/nl/ --- locale/nl.po | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index 292bf677f8..33cb3702de 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-30 07:23-0500\n" -"PO-Revision-Date: 2020-07-13 17:39+0000\n" +"PO-Revision-Date: 2020-08-02 20:41+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" "Language: nl\n" @@ -86,7 +86,7 @@ msgstr "%q lijst moet een lijst zijn" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" -msgstr "" +msgstr "%q moet >= 0 zijn" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -226,7 +226,7 @@ msgstr "'await' buiten de functie" #: py/compile.c msgid "'await', 'async for' or 'async with' outside async function" -msgstr "" +msgstr "'await', 'async for' of 'async with' buiten async functie" #: py/compile.c msgid "'break' outside loop" @@ -238,7 +238,7 @@ msgstr "'continue' buiten de loop" #: py/objgenerator.c msgid "'coroutine' object is not an iterator" -msgstr "" +msgstr "'coroutine' object is geen iterator" #: py/compile.c msgid "'data' requires at least 2 arguments" @@ -333,7 +333,7 @@ msgstr "Advertising is al bezig." #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" -msgstr "" +msgstr "Wordt al uitgevoerd" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -373,7 +373,7 @@ msgstr "Op zijn meest %d %q mogen worden gespecificeerd (niet %d)" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" -msgstr "" +msgstr "Poging om %d blokken toe te wijzen" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." @@ -879,7 +879,7 @@ msgstr "I2C Init Fout" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" -msgstr "" +msgstr "I2SOut is niet beschikbaar" #: shared-bindings/aesio/aes.c #, c-format @@ -1585,6 +1585,8 @@ msgstr "Time-out is te lang. Maximale time-out lengte is %d seconden" msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +"Timer is gereserveerd voor intern gebruik - wijs PWM pins eerder in het " +"programma toe" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1859,7 +1861,7 @@ msgstr "argument heeft onjuist type" #: extmod/ulab/code/linalg/linalg.c msgid "argument must be ndarray" -msgstr "" +msgstr "argument moet ndarray zijn" #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c @@ -2566,7 +2568,7 @@ msgstr "integer vereist" #: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" -msgstr "interp is gedefinieerd for eendimensionale arrays van gelijke lengte" +msgstr "interp is gedefinieerd voor eendimensionale arrays van gelijke lengte" #: shared-bindings/_bleio/Adapter.c #, c-format @@ -3254,7 +3256,7 @@ msgstr "te veel waarden om uit te pakken (%d verwacht)" #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" -msgstr "" +msgstr "trapz is gedefinieerd voor eendimensionale arrays van gelijke lengte" #: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" @@ -3386,7 +3388,7 @@ msgstr "value_count moet groter dan 0 zijn" #: extmod/ulab/code/linalg/linalg.c msgid "vectors must have same lengths" -msgstr "" +msgstr "vectoren moeten van gelijke lengte zijn" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" From 0e30fe1cc56ae48b1e1ea4b4ef07ffdfdf928fc4 Mon Sep 17 00:00:00 2001 From: sabas1080 Date: Sun, 2 Aug 2020 19:54:11 -0500 Subject: [PATCH 0467/1293] Update VID & PID codes --- ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.mk b/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.mk index 4a2e8ecd8a..6a6ae7937e 100644 --- a/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.mk +++ b/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.mk @@ -1,5 +1,5 @@ -USB_VID = 0x239A -USB_PID = 0x80A6 +USB_VID = 0x1209 +USB_PID = 0xBAB0 USB_PRODUCT = "Bast WiFi" USB_MANUFACTURER = "ElectronicCats" From e666e86035d533acf657c4ef1e247f84ea0a6f2d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 2 Aug 2020 20:42:10 -0500 Subject: [PATCH 0468/1293] mpy-cross: fix dependency analysis Closes: #3074 --- mpy-cross/mpy-cross.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mpy-cross/mpy-cross.mk b/mpy-cross/mpy-cross.mk index c813dae9eb..b4c8e34a2e 100644 --- a/mpy-cross/mpy-cross.mk +++ b/mpy-cross/mpy-cross.mk @@ -82,4 +82,6 @@ endif OBJ = $(PY_O) OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) +$(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h + include $(TOP)/py/mkrules.mk From 9b3af2b7e300699efec4d4a496bcafab479444f4 Mon Sep 17 00:00:00 2001 From: Jerry Needell Date: Mon, 3 Aug 2020 06:25:29 -0400 Subject: [PATCH 0469/1293] update frozen submodules --- frozen/Adafruit_CircuitPython_BLE | 2 +- frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center | 2 +- frozen/Adafruit_CircuitPython_BusDevice | 2 +- frozen/Adafruit_CircuitPython_CircuitPlayground | 2 +- frozen/Adafruit_CircuitPython_Crickit | 2 +- frozen/Adafruit_CircuitPython_DRV2605 | 2 +- frozen/Adafruit_CircuitPython_DS3231 | 2 +- frozen/Adafruit_CircuitPython_ESP32SPI | 2 +- frozen/Adafruit_CircuitPython_FocalTouch | 2 +- frozen/Adafruit_CircuitPython_HID | 2 +- frozen/Adafruit_CircuitPython_IRRemote | 2 +- frozen/Adafruit_CircuitPython_LIS3DH | 2 +- frozen/Adafruit_CircuitPython_LSM6DS | 2 +- frozen/Adafruit_CircuitPython_Motor | 2 +- frozen/Adafruit_CircuitPython_Register | 2 +- frozen/Adafruit_CircuitPython_Requests | 2 +- frozen/Adafruit_CircuitPython_Thermistor | 2 +- frozen/Adafruit_CircuitPython_seesaw | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/frozen/Adafruit_CircuitPython_BLE b/frozen/Adafruit_CircuitPython_BLE index 5d584576ef..41f7a3530d 160000 --- a/frozen/Adafruit_CircuitPython_BLE +++ b/frozen/Adafruit_CircuitPython_BLE @@ -1 +1 @@ -Subproject commit 5d584576ef79ca36506e6c7470e7ac5204cf0a8d +Subproject commit 41f7a3530d4cacdbf668399d3a015ea29c7e169b diff --git a/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center index 3ffb3f02d2..6a034887e3 160000 --- a/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center +++ b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center @@ -1 +1 @@ -Subproject commit 3ffb3f02d2046910e09d1f5a74721bd1a4cdf8cf +Subproject commit 6a034887e370caa61fee5f51db8dd393d3e72542 diff --git a/frozen/Adafruit_CircuitPython_BusDevice b/frozen/Adafruit_CircuitPython_BusDevice index e9411c4244..eb4b21e216 160000 --- a/frozen/Adafruit_CircuitPython_BusDevice +++ b/frozen/Adafruit_CircuitPython_BusDevice @@ -1 +1 @@ -Subproject commit e9411c4244984b69ec6928370ede40cec014c10b +Subproject commit eb4b21e216efd8ec0c4862a938e81b56be961724 diff --git a/frozen/Adafruit_CircuitPython_CircuitPlayground b/frozen/Adafruit_CircuitPython_CircuitPlayground index e9f15d6150..3c540329b6 160000 --- a/frozen/Adafruit_CircuitPython_CircuitPlayground +++ b/frozen/Adafruit_CircuitPython_CircuitPlayground @@ -1 +1 @@ -Subproject commit e9f15d61502f34173912ba271aaaf9446dae8da1 +Subproject commit 3c540329b63163e45f108df4bfebc387d5352c4f diff --git a/frozen/Adafruit_CircuitPython_Crickit b/frozen/Adafruit_CircuitPython_Crickit index 0e1230676a..809646ba11 160000 --- a/frozen/Adafruit_CircuitPython_Crickit +++ b/frozen/Adafruit_CircuitPython_Crickit @@ -1 +1 @@ -Subproject commit 0e1230676a54da17a309d1dfffdd7fa90240191c +Subproject commit 809646ba11366b5aedbc8a90be1da1829304bf62 diff --git a/frozen/Adafruit_CircuitPython_DRV2605 b/frozen/Adafruit_CircuitPython_DRV2605 index 7914a63903..209edd164e 160000 --- a/frozen/Adafruit_CircuitPython_DRV2605 +++ b/frozen/Adafruit_CircuitPython_DRV2605 @@ -1 +1 @@ -Subproject commit 7914a6390318687bb8e2e9c4119aa932fea01531 +Subproject commit 209edd164eb640a8ced561a54505792fc99a67b9 diff --git a/frozen/Adafruit_CircuitPython_DS3231 b/frozen/Adafruit_CircuitPython_DS3231 index 0d49a1fcd9..5d81a9ea82 160000 --- a/frozen/Adafruit_CircuitPython_DS3231 +++ b/frozen/Adafruit_CircuitPython_DS3231 @@ -1 +1 @@ -Subproject commit 0d49a1fcd96c13a94e8bdf26f92abe79b8517906 +Subproject commit 5d81a9ea822a85e46be4a512ac44abf21e77d816 diff --git a/frozen/Adafruit_CircuitPython_ESP32SPI b/frozen/Adafruit_CircuitPython_ESP32SPI index 94b03517c1..01f3f6674b 160000 --- a/frozen/Adafruit_CircuitPython_ESP32SPI +++ b/frozen/Adafruit_CircuitPython_ESP32SPI @@ -1 +1 @@ -Subproject commit 94b03517c1f4ff68cc2bb09b0963f7e7e3ce3d04 +Subproject commit 01f3f6674b4493ba29b857e0f43deb69975736ec diff --git a/frozen/Adafruit_CircuitPython_FocalTouch b/frozen/Adafruit_CircuitPython_FocalTouch index 72968d3546..1e3312ab1c 160000 --- a/frozen/Adafruit_CircuitPython_FocalTouch +++ b/frozen/Adafruit_CircuitPython_FocalTouch @@ -1 +1 @@ -Subproject commit 72968d3546f9d6c5af138d4c179343007cb9662c +Subproject commit 1e3312ab1cba0b1d3bb1f559c52acfdc1a6d57b8 diff --git a/frozen/Adafruit_CircuitPython_HID b/frozen/Adafruit_CircuitPython_HID index 65fb213b8c..829ba0f0a2 160000 --- a/frozen/Adafruit_CircuitPython_HID +++ b/frozen/Adafruit_CircuitPython_HID @@ -1 +1 @@ -Subproject commit 65fb213b8c554181d54b77f75335e16e2f4c0987 +Subproject commit 829ba0f0a2d8a63f7d0215c6c9fc821e14e52a93 diff --git a/frozen/Adafruit_CircuitPython_IRRemote b/frozen/Adafruit_CircuitPython_IRRemote index d435fc9a9d..fc3a7b4798 160000 --- a/frozen/Adafruit_CircuitPython_IRRemote +++ b/frozen/Adafruit_CircuitPython_IRRemote @@ -1 +1 @@ -Subproject commit d435fc9a9d90cb063608ae037bf5284b33bc5e84 +Subproject commit fc3a7b479874a1ea315ddb3bf6c5e281e16ef097 diff --git a/frozen/Adafruit_CircuitPython_LIS3DH b/frozen/Adafruit_CircuitPython_LIS3DH index 457aba6dd5..9fe8f314c0 160000 --- a/frozen/Adafruit_CircuitPython_LIS3DH +++ b/frozen/Adafruit_CircuitPython_LIS3DH @@ -1 +1 @@ -Subproject commit 457aba6dd59ad00502b80c9031655d3d26ecc82b +Subproject commit 9fe8f314c032cee89b9ad7697d61e9cba76431ff diff --git a/frozen/Adafruit_CircuitPython_LSM6DS b/frozen/Adafruit_CircuitPython_LSM6DS index ee8f2187d4..f1cc47f024 160000 --- a/frozen/Adafruit_CircuitPython_LSM6DS +++ b/frozen/Adafruit_CircuitPython_LSM6DS @@ -1 +1 @@ -Subproject commit ee8f2187d4795b08ae4aa60558f564d26c997be9 +Subproject commit f1cc47f024b27e670b9bf2a51c89e32f93c1b957 diff --git a/frozen/Adafruit_CircuitPython_Motor b/frozen/Adafruit_CircuitPython_Motor index 5fd72fb963..434e5b5346 160000 --- a/frozen/Adafruit_CircuitPython_Motor +++ b/frozen/Adafruit_CircuitPython_Motor @@ -1 +1 @@ -Subproject commit 5fd72fb963c4a0318d29282ca2cc988f19787fda +Subproject commit 434e5b5346cb0a1a9eb15989b00278be87cb2ff1 diff --git a/frozen/Adafruit_CircuitPython_Register b/frozen/Adafruit_CircuitPython_Register index 56358b4494..6143ec2a96 160000 --- a/frozen/Adafruit_CircuitPython_Register +++ b/frozen/Adafruit_CircuitPython_Register @@ -1 +1 @@ -Subproject commit 56358b4494da825cd99a56a854119f926abca670 +Subproject commit 6143ec2a96a6d218041e9cab5968de26702d7bbf diff --git a/frozen/Adafruit_CircuitPython_Requests b/frozen/Adafruit_CircuitPython_Requests index 41de8b3c05..43017e30a1 160000 --- a/frozen/Adafruit_CircuitPython_Requests +++ b/frozen/Adafruit_CircuitPython_Requests @@ -1 +1 @@ -Subproject commit 41de8b3c05dd78d7be8893a0f6cb47a7e9b421a2 +Subproject commit 43017e30a1e772b67ac68293a944e863c031e389 diff --git a/frozen/Adafruit_CircuitPython_Thermistor b/frozen/Adafruit_CircuitPython_Thermistor index b5bbdbd56c..fb773e0ed1 160000 --- a/frozen/Adafruit_CircuitPython_Thermistor +++ b/frozen/Adafruit_CircuitPython_Thermistor @@ -1 +1 @@ -Subproject commit b5bbdbd56ca205c581ba2c84d927ef99befce88e +Subproject commit fb773e0ed1891cda2ace6271fafc5312e167d275 diff --git a/frozen/Adafruit_CircuitPython_seesaw b/frozen/Adafruit_CircuitPython_seesaw index 76c0dd1329..88738da275 160000 --- a/frozen/Adafruit_CircuitPython_seesaw +++ b/frozen/Adafruit_CircuitPython_seesaw @@ -1 +1 @@ -Subproject commit 76c0dd13294ce8ae0518cb9882dcad5d3668977e +Subproject commit 88738da275a83acabb14b7140d1c79b33cdc7b02 From 04734ca7aeaadd1f52fb5448bd7f2800065037e1 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 24 Jul 2020 11:09:18 -0500 Subject: [PATCH 0470/1293] locale: Fix percent-space in several translations --- locale/cs.po | 16 ++++++++-------- locale/es.po | 4 ++-- locale/fil.po | 2 +- locale/pt_BR.po | 2 +- locale/sv.po | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/locale/cs.po b/locale/cs.po index a971375fba..26c8dd4490 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -44,11 +44,11 @@ msgstr "" #: py/obj.c msgid " File \"%q\"" -msgstr "  Soubor \"% q\"" +msgstr "  Soubor \"%q\"" #: py/obj.c msgid " File \"%q\", line %d" -msgstr "  Soubor \"% q\", řádek% d" +msgstr "  Soubor \"%q\", řádek %d" #: main.c msgid " output:\n" @@ -57,7 +57,7 @@ msgstr " výstup:\n" #: py/objstr.c #, c-format msgid "%%c requires int or char" -msgstr "%% c vyžaduje int nebo char" +msgstr "%%c vyžaduje int nebo char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -78,11 +78,11 @@ msgstr "%q index je mimo rozsah" #: py/obj.c msgid "%q indices must be integers, not %s" -msgstr "Indexy% q musí být celá čísla, nikoli% s" +msgstr "Indexy %q musí být celá čísla, nikoli %s" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "Seznam% q musí být seznam" +msgstr "Seznam %q musí být seznam" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" @@ -94,11 +94,11 @@ msgstr "" #: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" -msgstr "% q musí být > = 1" +msgstr " %q musí být > = 1" #: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "% q musí být n-tice délky 2" +msgstr " %q musí být n-tice délky 2" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q pin invalid" @@ -106,7 +106,7 @@ msgstr "" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" -msgstr "% q by měl být int" +msgstr " %q by měl být int" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" diff --git a/locale/es.po b/locale/es.po index 1ac9cd0098..6ed41b4a89 100644 --- a/locale/es.po +++ b/locale/es.po @@ -3719,8 +3719,8 @@ msgstr "zi debe ser una forma (n_section,2)" #~ "Only monochrome, indexed 8bpp, and 16bpp or greater BMPs supported: %d " #~ "bpp given" #~ msgstr "" -#~ "Solo se admiten BMP monocromos, indexados de 8bpp y 16bpp o superiores:% " -#~ "d bppdado" +#~ "Solo se admiten BMP monocromos, indexados de 8bpp y 16bpp o superiores:%d " +#~ "bppdado" #, fuzzy #~ msgid "Only slices with step=1 (aka None) are supported" diff --git a/locale/fil.po b/locale/fil.po index 91d7334e9f..ecffec523f 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -2055,7 +2055,7 @@ msgstr "hindi puede ang maraming *x" #: py/emitnative.c msgid "can't implicitly convert '%q' to 'bool'" -msgstr "hindi maaaring ma-convert ang '% qt' sa 'bool'" +msgstr "hindi maaaring ma-convert ang ' %q' sa 'bool'" #: py/emitnative.c msgid "can't load from '%q'" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 1bf2a13f6e..3cae15510e 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -3074,7 +3074,7 @@ msgstr "a anotação do retorno deve ser um identificador" #: py/emitnative.c msgid "return expected '%q' but got '%q'" -msgstr "o retorno esperado era '%q', porém obteve '% q'" +msgstr "o retorno esperado era '%q', porém obteve '%q'" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format diff --git a/locale/sv.po b/locale/sv.po index b2e7ff317a..3af263686d 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -2117,7 +2117,7 @@ msgstr "" #: py/objtype.c msgid "cannot create '%q' instances" -msgstr "kan inte skapa instanser av '% q'" +msgstr "kan inte skapa instanser av '%q'" #: py/objtype.c msgid "cannot create instance" From 9203a778042c584138f2852c108b58e900047ac4 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 3 Aug 2020 11:31:12 -0500 Subject: [PATCH 0471/1293] Turn off interrupts while in handler --- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index 5bd3cc7de1..a47135d566 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -77,6 +77,8 @@ static void pulsein_set_config(pulseio_pulsein_obj_t* self, bool first_edge) { } void pulsein_interrupt_handler(uint8_t channel) { + // turn off interrupts while in the handler + common_hal_mcu_disable_interrupts(); // Grab the current time first. uint32_t current_overflow = overflow_count; Tc* tc = tc_insts[pulsein_tc_index]; @@ -89,6 +91,7 @@ void pulsein_interrupt_handler(uint8_t channel) { pulseio_pulsein_obj_t* self = get_eic_channel_data(channel); if (!supervisor_background_tasks_ok() ) { + common_hal_mcu_enable_interrupts(); mp_raise_RuntimeError(translate("Input taking too long")); return; } @@ -122,6 +125,7 @@ void pulsein_interrupt_handler(uint8_t channel) { } self->last_overflow = current_overflow; self->last_count = current_count; + common_hal_mcu_enable_interrupts(); } void pulsein_reset() { From a995a5c58fa4c231fcfb8c5e0eb6a3847faabbcc Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 3 Aug 2020 21:02:57 -0400 Subject: [PATCH 0472/1293] wip: partial discovery responses; compiles; not tested --- devices/ble_hci/common-hal/_bleio/Adapter.c | 60 ++++ devices/ble_hci/common-hal/_bleio/Attribute.c | 2 +- devices/ble_hci/common-hal/_bleio/Attribute.h | 4 +- devices/ble_hci/common-hal/_bleio/att.c | 117 +++--- devices/ble_hci/common-hal/_bleio/hci.c | 123 ++----- devices/ble_hci/common-hal/_bleio/hci_debug.c | 335 ++++++++++++++++++ ports/atmel-samd/Makefile | 2 +- 7 files changed, 496 insertions(+), 147 deletions(-) create mode 100644 devices/ble_hci/common-hal/_bleio/hci_debug.c diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index 3acae9bebb..c8147fbc1b 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -43,6 +43,8 @@ #include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/Adapter.h" #include "shared-bindings/_bleio/Address.h" +#include "shared-bindings/_bleio/Characteristic.h" +#include "shared-bindings/_bleio/Service.h" #include "shared-bindings/nvm/ByteArray.h" #include "shared-bindings/_bleio/Connection.h" #include "shared-bindings/_bleio/ScanEntry.h" @@ -70,6 +72,12 @@ bleio_connection_internal_t bleio_connections[BLEIO_TOTAL_CONNECTION_COUNT]; +STATIC void check_enabled(bleio_adapter_obj_t *adapter) { + if (!common_hal_bleio_adapter_get_enabled(adapter)) { + mp_raise_bleio_BluetoothError(translate("Adapter not enabled")); + } +} + // STATIC bool adapter_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { // bleio_adapter_obj_t *self = (bleio_adapter_obj_t*)self_in; @@ -232,6 +240,14 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable self->enabled = enabled; + // We must poll for input from the HCI adapter. + // TODO Can we instead trigger an interrupt on UART input traffic? + if (enabled) { + supervisor_enable_tick(); + } else { + supervisor_disable_tick(); + } + // Stop any current activity; reset to known state. check_hci_error(hci_reset()); self->now_advertising = false; @@ -253,6 +269,8 @@ bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self) { } bleio_address_obj_t *common_hal_bleio_adapter_get_address(bleio_adapter_obj_t *self) { + check_enabled(self); + bt_addr_t addr; check_hci_error(hci_read_bd_addr(&addr)); @@ -306,6 +324,8 @@ void common_hal_bleio_adapter_set_name(bleio_adapter_obj_t *self, const char* na // } mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t* prefixes, size_t prefix_length, bool extended, mp_int_t buffer_size, mp_float_t timeout, mp_float_t interval, mp_float_t window, mp_int_t minimum_rssi, bool active) { + check_enabled(self); + if (self->scan_results != NULL) { if (!shared_module_bleio_scanresults_get_done(self->scan_results)) { mp_raise_bleio_BluetoothError(translate("Scan already in progess. Stop with stop_scan.")); @@ -350,6 +370,8 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t* } void common_hal_bleio_adapter_stop_scan(bleio_adapter_obj_t *self) { + check_enabled(self); + check_hci_error(hci_le_set_scan_enable(BT_HCI_LE_SCAN_DISABLE, BT_HCI_LE_SCAN_FILTER_DUP_DISABLE)); shared_module_bleio_scanresults_set_done(self->scan_results, true); self->scan_results = NULL; @@ -385,6 +407,8 @@ void common_hal_bleio_adapter_stop_scan(bleio_adapter_obj_t *self) { mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_address_obj_t *address, mp_float_t timeout) { + check_enabled(self); + // ble_gap_addr_t addr; // addr.addr_type = address->type; @@ -482,6 +506,8 @@ STATIC void check_data_fit(size_t data_len, bool connectable) { // } uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, uint32_t timeout, float interval, uint8_t *advertising_data, uint16_t advertising_data_len, uint8_t *scan_response_data, uint16_t scan_response_data_len) { + check_enabled(self); + if (self->now_advertising) { if (self->circuitpython_advertising) { common_hal_bleio_adapter_stop_advertising(self); @@ -603,6 +629,8 @@ uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, } void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, uint32_t timeout, mp_float_t interval, mp_buffer_info_t *advertising_data_bufinfo, mp_buffer_info_t *scan_response_data_bufinfo) { + check_enabled(self); + // interval value has already been validated. check_data_fit(advertising_data_bufinfo->len, connectable); @@ -638,6 +666,8 @@ void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool } void common_hal_bleio_adapter_stop_advertising(bleio_adapter_obj_t *self) { + check_enabled(self); + self->now_advertising = false; self->extended_advertising = false; self->circuitpython_advertising = false; @@ -651,10 +681,14 @@ void common_hal_bleio_adapter_stop_advertising(bleio_adapter_obj_t *self) { } bool common_hal_bleio_adapter_get_advertising(bleio_adapter_obj_t *self) { + check_enabled(self); + return self->now_advertising; } bool common_hal_bleio_adapter_get_connected(bleio_adapter_obj_t *self) { + check_enabled(self); + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { bleio_connection_internal_t *connection = &bleio_connections[i]; if (connection->conn_handle != BLE_CONN_HANDLE_INVALID) { @@ -665,6 +699,8 @@ bool common_hal_bleio_adapter_get_connected(bleio_adapter_obj_t *self) { } mp_obj_t common_hal_bleio_adapter_get_connections(bleio_adapter_obj_t *self) { + check_enabled(self); + if (self->connection_objs != NULL) { return self->connection_objs; } @@ -685,17 +721,31 @@ mp_obj_t common_hal_bleio_adapter_get_connections(bleio_adapter_obj_t *self) { } void common_hal_bleio_adapter_erase_bonding(bleio_adapter_obj_t *self) { + check_enabled(self); + //FIX bonding_erase_storage(); } uint16_t bleio_adapter_add_attribute(bleio_adapter_obj_t *adapter, mp_obj_t *attribute) { + check_enabled(adapter); + // The handle is the index of this attribute in the attributes list. uint16_t handle = (uint16_t) adapter->attributes->len; mp_obj_list_append(adapter->attributes, attribute); + + if (MP_OBJ_IS_TYPE(attribute, &bleio_service_type)) { + adapter->last_added_service_handle = handle; + } + if (MP_OBJ_IS_TYPE(attribute, &bleio_characteristic_type)) { + adapter->last_added_characteristic_handle = handle; + } + return handle; } mp_obj_t* bleio_adapter_get_attribute(bleio_adapter_obj_t *adapter, uint16_t handle) { + check_enabled(adapter); + if (handle == 0 || handle >= adapter->attributes->len) { return mp_const_none; } @@ -703,6 +753,8 @@ mp_obj_t* bleio_adapter_get_attribute(bleio_adapter_obj_t *adapter, uint16_t han } uint16_t bleio_adapter_max_attribute_handle(bleio_adapter_obj_t *adapter) { + check_enabled(adapter); + return adapter->attributes->len - 1; } @@ -713,6 +765,10 @@ void bleio_adapter_gc_collect(bleio_adapter_obj_t* adapter) { } void bleio_adapter_reset(bleio_adapter_obj_t* adapter) { + if (!common_hal_bleio_adapter_get_enabled(adapter)) { + return; + } + common_hal_bleio_adapter_stop_scan(adapter); if (adapter->now_advertising) { common_hal_bleio_adapter_stop_advertising(adapter); @@ -731,6 +787,10 @@ void bleio_adapter_reset(bleio_adapter_obj_t* adapter) { } void bleio_adapter_background(bleio_adapter_obj_t* adapter) { + if (!common_hal_bleio_adapter_get_enabled(adapter)) { + return; + } + if (adapter->advertising_timeout_msecs > 0 && supervisor_ticks_ms64() - adapter->advertising_start_ticks > adapter->advertising_timeout_msecs) { adapter->advertising_timeout_msecs = 0; diff --git a/devices/ble_hci/common-hal/_bleio/Attribute.c b/devices/ble_hci/common-hal/_bleio/Attribute.c index 0c56c08a88..d32ed11679 100644 --- a/devices/ble_hci/common-hal/_bleio/Attribute.c +++ b/devices/ble_hci/common-hal/_bleio/Attribute.c @@ -30,7 +30,7 @@ #include "shared-bindings/_bleio/Service.h" // Return the type of the attribute. -ble_attribute_type bleio_attribute_type_uuid(mp_obj_t *attribute) { +ble_attribute_type_uuid bleio_attribute_type_uuid(mp_obj_t *attribute) { if (MP_OBJ_IS_TYPE(attribute, &bleio_characteristic_type)) { return BLE_TYPE_CHARACTERISTIC; } diff --git a/devices/ble_hci/common-hal/_bleio/Attribute.h b/devices/ble_hci/common-hal/_bleio/Attribute.h index 4301614fca..47327437bc 100644 --- a/devices/ble_hci/common-hal/_bleio/Attribute.h +++ b/devices/ble_hci/common-hal/_bleio/Attribute.h @@ -36,7 +36,7 @@ typedef enum { BLE_TYPE_SECONDARY_SERVICE = 0x2801, BLE_TYPE_CHARACTERISTIC = 0x2803, BLE_TYPE_DESCRIPTOR = 0x2900 -} ble_attribute_type; +} ble_attribute_type_uuid; // typedef struct // { @@ -45,6 +45,6 @@ typedef enum { // } ble_gap_conn_sec_mode_t; -// extern void bleio_attribute_gatts_set_security_mode(ble_gap_conn_sec_mode_t *perm, bleio_attribute_security_mode_t security_mode); +ble_attribute_type_uuid bleio_attribute_type_uuid(mp_obj_t *attribute); #endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_ATTRIBUTE_H diff --git a/devices/ble_hci/common-hal/_bleio/att.c b/devices/ble_hci/common-hal/_bleio/att.c index 2982861f76..08324c37ed 100644 --- a/devices/ble_hci/common-hal/_bleio/att.c +++ b/devices/ble_hci/common-hal/_bleio/att.c @@ -33,6 +33,7 @@ #include "common-hal/_bleio/Attribute.h" #include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/Characteristic.h" +#include "shared-bindings/_bleio/UUID.h" #include "supervisor/shared/tick.h" STATIC uint16_t max_mtu = BT_ATT_DEFAULT_LE_MTU; // 23 @@ -685,6 +686,7 @@ bool att_indicate(uint16_t handle, const uint8_t* value, int length) { STATIC void process_error(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { struct bt_att_error_rsp *rsp = (struct bt_att_error_rsp *) data; + if (dlen != sizeof(struct bt_att_error_rsp)) { // Incorrect size; ignore. return; @@ -700,7 +702,8 @@ STATIC void process_error(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { STATIC void process_mtu_req(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { struct bt_att_exchange_mtu_req *req = (struct bt_att_exchange_mtu_req *) data; - if (dlen != sizeof(req)) { + + if (dlen != sizeof(struct bt_att_exchange_mtu_req)) { send_error(conn_handle, BT_ATT_OP_MTU_REQ, BLE_GATT_HANDLE_INVALID, BT_ATT_ERR_INVALID_PDU); return; } @@ -720,7 +723,7 @@ STATIC void process_mtu_req(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) struct __packed { struct bt_att_hdr h; - struct bt_att_exchange_mtu_req r; + struct bt_att_exchange_mtu_rsp r; } rsp = { { .code = BT_ATT_OP_MTU_RSP, }, { @@ -732,12 +735,12 @@ STATIC void process_mtu_req(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) } STATIC void process_mtu_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { + struct bt_att_exchange_mtu_rsp *rsp = (struct bt_att_exchange_mtu_rsp *) data; + if (dlen != sizeof(struct bt_att_exchange_mtu_rsp)) { return; } - struct bt_att_exchange_mtu_rsp *rsp = (struct bt_att_exchange_mtu_rsp *) data; - for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { if (bleio_connections[i].conn_handle == conn_handle) { bleio_connections[i].mtu = rsp->mtu; @@ -879,69 +882,82 @@ STATIC void process_find_by_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t void process_read_by_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { struct bt_att_read_group_req *req = (struct bt_att_read_group_req *) data; - uint16_t uuid = req->uuid[0] | (req->uuid[1] << 8); + uint16_t type_uuid = req->uuid[0] | (req->uuid[1] << 8); - if (dlen != sizeof(struct bt_att_find_type_req) || - (uuid != BLE_TYPE_PRIMARY_SERVICE && - uuid != BLE_TYPE_SECONDARY_SERVICE)) { + if (dlen != sizeof(struct bt_att_read_group_req) + sizeof(type_uuid) || + (type_uuid != BLE_TYPE_PRIMARY_SERVICE && + type_uuid != BLE_TYPE_SECONDARY_SERVICE)) { send_error(conn_handle, BT_ATT_OP_READ_GROUP_REQ, req->start_handle, BT_ATT_ERR_UNSUPPORTED_GROUP_TYPE); return; } - uint8_t response[mtu]; - uint16_t response_length; + typedef struct __packed { + struct bt_att_hdr h; + struct bt_att_read_group_rsp r; + } rsp_t; - response[0] = BT_ATT_OP_READ_GROUP_RSP; - response[1] = 0x00; - response_length = 2; + uint8_t rsp_bytes[mtu]; + rsp_t *rsp = (rsp_t *) &rsp_bytes; + rsp->h.code = BT_ATT_OP_READ_GROUP_RSP; + rsp->r.len = 0; - // FIX - // for (uint16_t i = (readByGroupReq->start_handle - 1); i < GATT.attributeCount() && i <= (readByGroupReq->end_handle - 1); i++) { - //FIX - // BLELocalAttribute* attribute = GATT.attribute(i); + // Keeps track of total length of the response. + size_t rsp_length = sizeof(rsp_t); - // if (readByGroupReq->uuid != attribute->type()) { - // // not the type - // continue; - // } + bool no_data = true; - // int uuidLen = attribute->uuidLength(); - // size_t infoSize = (uuidLen == 2) ? 6 : 20; + // All the data chunks must have uuid's that are the same size. + // Keep track fo the first one to make sure. + size_t sizeof_first_service_uuid = 0; + const uint16_t max_attribute_handle = bleio_adapter_max_attribute_handle(&common_hal_bleio_adapter_obj); + for (uint16_t handle = req->start_handle; + handle <= max_attribute_handle && handle <= req->end_handle; + handle++) { + no_data = false; - // if (response[1] == 0) { - // response[1] = infoSize; - // } + mp_obj_t *attribute_obj = bleio_adapter_get_attribute(&common_hal_bleio_adapter_obj, handle); + if (type_uuid != bleio_attribute_type_uuid(attribute_obj)) { + // Not a primary or secondary service. + continue; + } + // Now we know it's a service. + bleio_service_obj_t *service = MP_OBJ_TO_PTR(attribute_obj); - // if (response[1] != infoSize) { - // // different size - // break; - // } + // Is this a 16-bit or a 128-bit uuid? It must match in size with any previous attribute + // in this transmission. + const uint8_t sizeof_service_uuid = common_hal_bleio_uuid_get_size(service->uuid) / 8; + if (sizeof_first_service_uuid == 0) { + sizeof_first_service_uuid = sizeof_service_uuid; + } else if (sizeof_first_service_uuid != sizeof_service_uuid) { + // Mismatched sizes. Transmit just what we have so far in this batch. + break; + } - // BLELocalService* service = (BLELocalService*)attribute; + // Size of bt_att_group_data chunk with uuid. + const uint16_t data_length = sizeof(struct bt_att_group_data) + sizeof_service_uuid; - // // add the start handle - // uint16_t start_handle = service->start_handle(); - // memcpy(&response[response_length], &start_handle, sizeof(start_handle)); - // response_length += sizeof(start_handle); + if (rsp_length + data_length > mtu) { + // No room for another bt_att_group_data chunk. + break; + } - // // add the end handle - // uint16_t end_handle = service->end_handle(); - // memcpy(&response[response_length], &end_handle, sizeof(end_handle)); - // response_length += sizeof(end_handle); + // Pass the length of ONE bt_att_group_data chunk. There may be multiple ones in this transmission. + rsp->r.len = data_length; - // // add the UUID - // memcpy(&response[response_length], service->uuidData(), uuidLen); - // response_length += uuidLen; + uint8_t group_data_bytes[data_length]; + struct bt_att_group_data *group_data = (struct bt_att_group_data *) group_data_bytes; - // if ((response_length + infoSize) > mtu) { - // break; - // } - // } + group_data->start_handle = service->start_handle; + group_data->end_handle = service->end_handle; + common_hal_bleio_uuid_pack_into(service->uuid, group_data->value); - if (response_length == 2) { + rsp_length += data_length; + } + + if (no_data) { send_error(conn_handle, BT_ATT_OP_READ_GROUP_REQ, req->start_handle, BT_ATT_ERR_ATTRIBUTE_NOT_FOUND); } else { - hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, response_length, response); + hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, rsp_length, rsp_bytes); } } @@ -986,7 +1002,7 @@ STATIC void process_read_or_read_blob_req(uint16_t conn_handle, uint16_t mtu, ui handle = req->handle; response_opcode = BT_ATT_OP_READ_RSP; - } else { + } else if (opcode == BT_ATT_OP_READ_BLOB_REQ) { if (dlen != sizeof(struct bt_att_read_blob_req)) { send_error(conn_handle, BT_ATT_OP_READ_BLOB_REQ, BLE_GATT_HANDLE_INVALID, BT_ATT_ERR_INVALID_PDU); return; @@ -996,8 +1012,11 @@ STATIC void process_read_or_read_blob_req(uint16_t conn_handle, uint16_t mtu, ui handle = req->handle; offset = req->offset; response_opcode = BT_ATT_OP_READ_BLOB_RSP; + } else { + return; } + //FIX (void) offset; (void) handle; diff --git a/devices/ble_hci/common-hal/_bleio/hci.c b/devices/ble_hci/common-hal/_bleio/hci.c index 9c8d7f692a..7b4adaa79a 100644 --- a/devices/ble_hci/common-hal/_bleio/hci.c +++ b/devices/ble_hci/common-hal/_bleio/hci.c @@ -95,7 +95,6 @@ STATIC uint8_t acl_data_buffer[ACL_DATA_BUFFER_SIZE]; STATIC size_t acl_data_len; STATIC size_t num_command_packets_allowed; -STATIC size_t max_pkt; STATIC size_t pending_pkt; // Results from parsing a command response packet. @@ -107,77 +106,13 @@ STATIC uint8_t* cmd_response_data; STATIC volatile bool hci_poll_in_progress = false; -STATIC bool debug = true; +#define DEBUG_HCI 1 ////////////////////////////////////////////////////////////////////// -STATIC void dump_cmd_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { - if (debug) { - h4_hci_cmd_pkt_t *pkt = (h4_hci_cmd_pkt_t *) pkt_data; - mp_printf(&mp_plat_print, - "%s HCI COMMAND (%x) opcode: %04x, len: %d, data: ", - tx ? "TX->" : "RX<-", - pkt->pkt_type, pkt->opcode, pkt->param_len); - for (size_t i = 0; i < pkt->param_len; i++) { - mp_printf(&mp_plat_print, "%02x ", pkt->params[i]); - } - if (pkt_len != sizeof(h4_hci_cmd_pkt_t) + pkt->param_len) { - mp_printf(&mp_plat_print, " LENGTH MISMATCH"); - } - mp_printf(&mp_plat_print, "\n"); - } -} - -STATIC void dump_acl_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { - if (debug) { - // mp_printf(&mp_plat_print, "\\ PKT_DATA: "); - // for (size_t i = 0; i < pkt_len; i++) { - // mp_printf(&mp_plat_print, "%02x ", pkt_data[i]); - // } - // mp_printf(&mp_plat_print, "\n"); - h4_hci_acl_pkt_t *pkt = (h4_hci_acl_pkt_t *) pkt_data; - mp_printf(&mp_plat_print, - "%s HCI ACLDATA (%x) handle: %04x, pb: %d, bc: %d, data_len: %d, ", - tx ? "TX->" : "RX<-", pkt->pkt_type, pkt->handle, pkt->pb, pkt->bc, pkt->data_len); - - if (pkt->pb != ACL_DATA_PB_MIDDLE) { - // This is the start of a fragmented acl_data packet or is a full packet. - acl_data_t *acl = (acl_data_t *) pkt->data; - mp_printf(&mp_plat_print, - "acl data_len: %d, cid: %04x, data: ", - acl->acl_data_len, acl->cid); - for (size_t i = 0; i < acl->acl_data_len; i++) { - mp_printf(&mp_plat_print, "%02x ", acl->acl_data[i]); - } - } else { - for (size_t i = 0; i < pkt->data_len; i++) { - mp_printf(&mp_plat_print, "more data: %02x ", pkt->data[i]); - } - } - - if (pkt_len != sizeof(h4_hci_acl_pkt_t) + pkt->data_len) { - mp_printf(&mp_plat_print, " LENGTH MISMATCH"); - } - mp_printf(&mp_plat_print, "\n"); - } -} - -STATIC void dump_evt_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { - if (debug) { - h4_hci_evt_pkt_t *pkt = (h4_hci_evt_pkt_t *) pkt_data; - mp_printf(&mp_plat_print, - "%s HCI EVENT (%x) evt: %02x, param_len: %d, data: ", - tx ? "TX->" : "RX<-", - pkt->pkt_type, pkt->evt, pkt->param_len); - for (size_t i = 0; i < pkt->param_len; i++) { - mp_printf(&mp_plat_print, "%02x ", pkt->params[i]); - } - if (pkt_len != sizeof(h4_hci_evt_pkt_t) + pkt->param_len) { - mp_printf(&mp_plat_print, " LENGTH MISMATCH"); - } - mp_printf(&mp_plat_print, "\n"); - } -} +#if DEBUG_HCI +#include "hci_debug.c" +#endif // DEBUG_HCI STATIC void process_acl_data_pkt(uint8_t pkt_len, uint8_t pkt_data[]) { h4_hci_acl_pkt_t *pkt = (h4_hci_acl_pkt_t*) pkt_data; @@ -194,7 +129,7 @@ STATIC void process_acl_data_pkt(uint8_t pkt_len, uint8_t pkt_data[]) { } acl_data_t *acl = (acl_data_t *) &acl_data_buffer; - if (acl_data_len != acl->acl_data_len) { + if (acl_data_len != sizeof(acl) + acl->acl_data_len) { // We don't have the full packet yet. return; } @@ -330,9 +265,9 @@ STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt_data[]) } default: - if (debug) { - mp_printf(&mp_plat_print, "process_evt_pkt: Unknown event: %02x\n"); - } +#if DEBUG_HCI + mp_printf(&mp_plat_print, "process_evt_pkt: Unknown event: %02x\n"); +#endif break; } } @@ -374,7 +309,8 @@ hci_result_t hci_poll_for_incoming_pkt(void) { bool packet_is_complete = false; // Read bytes until we run out, or accumulate a complete packet. - while (common_hal_busio_uart_rx_characters_available(common_hal_bleio_adapter_obj.hci_uart)) { + while (!packet_is_complete && + common_hal_busio_uart_rx_characters_available(common_hal_bleio_adapter_obj.hci_uart)) { common_hal_busio_uart_read(common_hal_bleio_adapter_obj.hci_uart, rx_buffer + rx_idx, 1, &errcode); if (errcode) { hci_poll_in_progress = false; @@ -417,25 +353,25 @@ hci_result_t hci_poll_for_incoming_pkt(void) { switch (rx_buffer[0]) { case H4_ACL: - if (debug) { - dump_acl_pkt(false, pkt_len, rx_buffer); - } +#if DEBUG_HCI + dump_acl_pkt(false, pkt_len, rx_buffer); +#endif process_acl_data_pkt(pkt_len, rx_buffer); break; case H4_EVT: - if (debug) { - dump_evt_pkt(false, pkt_len, rx_buffer); - } +#if DEBUG_HCI + dump_evt_pkt(false, pkt_len, rx_buffer); +#endif process_evt_pkt(pkt_len, rx_buffer); break; default: - if (debug) { - mp_printf(&mp_plat_print, "Unknown HCI packet type: %d\n", rx_buffer[0]); - } +#if DEBUG_HCI + mp_printf(&mp_plat_print, "Unknown HCI packet type: %d\n", rx_buffer[0]); +#endif break; } @@ -478,9 +414,9 @@ STATIC hci_result_t send_command(uint16_t opcode, uint8_t params_len, void* para memcpy(cmd_pkt->params, params, params_len); - if (debug) { +#if DEBUG_HCI dump_cmd_pkt(true, sizeof(tx_buffer), tx_buffer); - } +#endif int result = write_pkt(tx_buffer, cmd_pkt_len); if (result != HCI_OK) { @@ -519,32 +455,31 @@ STATIC hci_result_t send_command(uint16_t opcode, uint8_t params_len, void* para hci_result_t hci_send_acl_pkt(uint16_t handle, uint8_t cid, uint8_t data_len, uint8_t *data) { int result; - while (pending_pkt >= max_pkt) { + while (pending_pkt >= common_hal_bleio_adapter_obj.max_acl_num_buffers) { result = hci_poll_for_incoming_pkt(); if (result != HCI_OK) { return result; } } - // data_len does not include cid - const size_t cid_len = sizeof_field(acl_data_t, cid); // buf_len is size of entire packet including header. - const size_t buf_len = sizeof(h4_hci_acl_pkt_t) + cid_len + data_len; + const size_t buf_len = sizeof(h4_hci_acl_pkt_t) + sizeof(acl_data_t) + data_len; uint8_t tx_buffer[buf_len]; h4_hci_acl_pkt_t *acl_pkt = (h4_hci_acl_pkt_t *) tx_buffer; acl_data_t *acl_data = (acl_data_t *) acl_pkt->data; acl_pkt->pkt_type = H4_ACL; acl_pkt->handle = handle; - acl_pkt->data_len = (uint8_t)(cid_len + data_len); - acl_data->acl_data_len = (uint8_t) data_len; + acl_pkt->pb = ACL_DATA_PB_FIRST_FLUSH; + acl_pkt->data_len = (uint8_t)(sizeof(acl_data_t) + data_len); + acl_data->acl_data_len = data_len; acl_data->cid = cid; - memcpy(&tx_buffer[sizeof(h4_hci_acl_pkt_t)], data, data_len); + memcpy(&acl_data->acl_data, data, data_len); - if (debug) { +#if DEBUG_HCI dump_acl_pkt(true, buf_len, tx_buffer); - } +#endif pending_pkt++; diff --git a/devices/ble_hci/common-hal/_bleio/hci_debug.c b/devices/ble_hci/common-hal/_bleio/hci_debug.c new file mode 100644 index 0000000000..8231bc5cc1 --- /dev/null +++ b/devices/ble_hci/common-hal/_bleio/hci_debug.c @@ -0,0 +1,335 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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. + */ + +// This file is #include'd in hci.c when HCI_DEBUG is non-zero. + +STATIC const char* att_opcode_name(uint16_t opcode) { + switch (opcode) { + case BT_ATT_OP_ERROR_RSP: return "ERROR_RSP"; + case BT_ATT_OP_MTU_REQ: return "MTU_REQ"; + case BT_ATT_OP_MTU_RSP: return "MTU_RSP"; + case BT_ATT_OP_FIND_INFO_REQ: return "FIND_INFO_REQ"; + case BT_ATT_OP_FIND_INFO_RSP: return "FIND_INFO_RSP"; + case BT_ATT_OP_FIND_TYPE_REQ: return "FIND_TYPE_REQ"; + case BT_ATT_OP_FIND_TYPE_RSP: return "FIND_TYPE_RSP"; + case BT_ATT_OP_READ_TYPE_REQ: return "READ_TYPE_REQ"; + case BT_ATT_OP_READ_TYPE_RSP: return "READ_TYPE_RSP"; + case BT_ATT_OP_READ_REQ: return "READ_REQ"; + case BT_ATT_OP_READ_RSP: return "READ_RSP"; + case BT_ATT_OP_READ_BLOB_REQ: return "READ_BLOB_REQ"; + case BT_ATT_OP_READ_BLOB_RSP: return "READ_BLOB_RSP"; + case BT_ATT_OP_READ_MULT_REQ: return "READ_MULT_REQ"; + case BT_ATT_OP_READ_MULT_RSP: return "READ_MULT_RSP"; + case BT_ATT_OP_READ_GROUP_REQ: return "READ_GROUP_REQ"; + case BT_ATT_OP_READ_GROUP_RSP: return "READ_GROUP_RSP"; + case BT_ATT_OP_WRITE_REQ: return "WRITE_REQ"; + case BT_ATT_OP_WRITE_RSP: return "WRITE_RSP"; + case BT_ATT_OP_PREPARE_WRITE_REQ: return "PREPARE_WRITE_REQ"; + case BT_ATT_OP_PREPARE_WRITE_RSP: return "PREPARE_WRITE_RSP"; + case BT_ATT_OP_EXEC_WRITE_REQ: return "EXEC_WRITE_REQ"; + case BT_ATT_OP_EXEC_WRITE_RSP: return "EXEC_WRITE_RSP"; + case BT_ATT_OP_NOTIFY: return "NOTIFY"; + case BT_ATT_OP_INDICATE: return "INDICATE"; + case BT_ATT_OP_CONFIRM: return "CONFIRM"; + case BT_ATT_OP_READ_MULT_VL_REQ: return "READ_MULT_VL_REQ"; + case BT_ATT_OP_READ_MULT_VL_RSP: return "READ_MULT_VL_RSP"; + case BT_ATT_OP_NOTIFY_MULT: return "NOTIFY_MULT"; + case BT_ATT_OP_WRITE_CMD: return "WRITE_CMD"; + case BT_ATT_OP_SIGNED_WRITE_CMD: return "SIGNED_WRITE_CMD"; + default: return ""; + } +} + +STATIC const char* hci_evt_name(uint8_t evt) { + switch (evt) { + case BT_HCI_EVT_UNKNOWN: return "UNKNOWN"; + case BT_HCI_EVT_VENDOR: return "VENDOR"; + case BT_HCI_EVT_INQUIRY_COMPLETE: return "INQUIRY_COMPLETE"; + case BT_HCI_EVT_CONN_COMPLETE: return "CONN_COMPLETE"; + case BT_HCI_EVT_CONN_REQUEST: return "CONN_REQUEST"; + case BT_HCI_EVT_DISCONN_COMPLETE: return "DISCONN_COMPLETE"; + case BT_HCI_EVT_AUTH_COMPLETE: return "AUTH_COMPLETE"; + case BT_HCI_EVT_REMOTE_NAME_REQ_COMPLETE: return "REMOTE_NAME_REQ_COMPLETE"; + case BT_HCI_EVT_ENCRYPT_CHANGE: return "ENCRYPT_CHANGE"; + case BT_HCI_EVT_REMOTE_FEATURES: return "REMOTE_FEATURES"; + case BT_HCI_EVT_REMOTE_VERSION_INFO: return "REMOTE_VERSION_INFO"; + case BT_HCI_EVT_CMD_COMPLETE: return "CMD_COMPLETE"; + case BT_HCI_EVT_CMD_STATUS: return "CMD_STATUS"; + case BT_HCI_EVT_ROLE_CHANGE: return "ROLE_CHANGE"; + case BT_HCI_EVT_NUM_COMPLETED_PACKETS: return "NUM_COMPLETED_PACKETS"; + case BT_HCI_EVT_PIN_CODE_REQ: return "PIN_CODE_REQ"; + case BT_HCI_EVT_LINK_KEY_REQ: return "LINK_KEY_REQ"; + case BT_HCI_EVT_LINK_KEY_NOTIFY: return "LINK_KEY_NOTIFY"; + case BT_HCI_EVT_DATA_BUF_OVERFLOW: return "DATA_BUF_OVERFLOW"; + case BT_HCI_EVT_INQUIRY_RESULT_WITH_RSSI: return "INQUIRY_RESULT_WITH_RSSI"; + case BT_HCI_EVT_REMOTE_EXT_FEATURES: return "REMOTE_EXT_FEATURES"; + case BT_HCI_EVT_SYNC_CONN_COMPLETE: return "SYNC_CONN_COMPLETE"; + case BT_HCI_EVT_EXTENDED_INQUIRY_RESULT: return "EXTENDED_INQUIRY_RESULT"; + case BT_HCI_EVT_ENCRYPT_KEY_REFRESH_COMPLETE: return "ENCRYPT_KEY_REFRESH_COMPLETE"; + case BT_HCI_EVT_IO_CAPA_REQ: return "IO_CAPA_REQ"; + case BT_HCI_EVT_IO_CAPA_RESP: return "IO_CAPA_RESP"; + case BT_HCI_EVT_USER_CONFIRM_REQ: return "USER_CONFIRM_REQ"; + case BT_HCI_EVT_USER_PASSKEY_REQ: return "USER_PASSKEY_REQ"; + case BT_HCI_EVT_SSP_COMPLETE: return "SSP_COMPLETE"; + case BT_HCI_EVT_USER_PASSKEY_NOTIFY: return "USER_PASSKEY_NOTIFY"; + case BT_HCI_EVT_LE_META_EVENT: return "LE_META_EVENT"; + case BT_HCI_EVT_AUTH_PAYLOAD_TIMEOUT_EXP: return "AUTH_PAYLOAD_TIMEOUT_EXP"; + default: return ""; + } +} + +STATIC const char* hci_evt_le_name(uint8_t evt_le) { + switch (evt_le) { + case BT_HCI_EVT_LE_CONN_COMPLETE: return "LE_CONN_COMPLETE"; + case BT_HCI_EVT_LE_ADVERTISING_REPORT: return "LE_ADVERTISING_REPORT"; + case BT_HCI_EVT_LE_CONN_UPDATE_COMPLETE: return "LE_CONN_UPDATE_COMPLETE"; + case BT_HCI_EVT_LE_LTK_REQUEST: return "LE_LTK_REQUEST"; + case BT_HCI_EVT_LE_CONN_PARAM_REQ: return "LE_CONN_PARAM_REQ"; + case BT_HCI_EVT_LE_DATA_LEN_CHANGE: return "LE_DATA_LEN_CHANGE"; + case BT_HCI_EVT_LE_P256_PUBLIC_KEY_COMPLETE: return "LE_P256_PUBLIC_KEY_COMPLETE"; + case BT_HCI_EVT_LE_GENERATE_DHKEY_COMPLETE: return "LE_GENERATE_DHKEY_COMPLETE"; + case BT_HCI_EVT_LE_ENH_CONN_COMPLETE: return "LE_ENH_CONN_COMPLETE"; + case BT_HCI_EVT_LE_DIRECT_ADV_REPORT: return "LE_DIRECT_ADV_REPORT"; + case BT_HCI_EVT_LE_PHY_UPDATE_COMPLETE: return "LE_PHY_UPDATE_COMPLETE"; + case BT_HCI_EVT_LE_EXT_ADVERTISING_REPORT: return "LE_EXT_ADVERTISING_REPORT"; + case BT_HCI_EVT_LE_PER_ADV_SYNC_ESTABLISHED: return "LE_PER_ADV_SYNC_ESTABLISHED"; + case BT_HCI_EVT_LE_PER_ADVERTISING_REPORT: return "LE_PER_ADVERTISING_REPORT"; + case BT_HCI_EVT_LE_PER_ADV_SYNC_LOST: return "LE_PER_ADV_SYNC_LOST"; + case BT_HCI_EVT_LE_SCAN_TIMEOUT: return "LE_SCAN_TIMEOUT"; + case BT_HCI_EVT_LE_ADV_SET_TERMINATED: return "LE_ADV_SET_TERMINATED"; + case BT_HCI_EVT_LE_SCAN_REQ_RECEIVED: return "LE_SCAN_REQ_RECEIVED"; + case BT_HCI_EVT_LE_CHAN_SEL_ALGO: return "LE_CHAN_SEL_ALGO"; + default: return ""; + } +} + +STATIC const char* hci_opcode_name(uint16_t opcode) { + switch (opcode) { + case BT_OP_NOP: return "NOP"; + case BT_HCI_OP_INQUIRY: return "INQUIRY"; + case BT_HCI_OP_INQUIRY_CANCEL: return "INQUIRY_CANCEL"; + case BT_HCI_OP_CONNECT: return "CONNECT"; + case BT_HCI_OP_DISCONNECT: return "DISCONNECT"; + case BT_HCI_OP_CONNECT_CANCEL: return "CONNECT_CANCEL"; + case BT_HCI_OP_ACCEPT_CONN_REQ: return "ACCEPT_CONN_REQ"; + case BT_HCI_OP_SETUP_SYNC_CONN: return "SETUP_SYNC_CONN"; + case BT_HCI_OP_ACCEPT_SYNC_CONN_REQ: return "ACCEPT_SYNC_CONN_REQ"; + case BT_HCI_OP_REJECT_CONN_REQ: return "REJECT_CONN_REQ"; + case BT_HCI_OP_LINK_KEY_REPLY: return "LINK_KEY_REPLY"; + case BT_HCI_OP_LINK_KEY_NEG_REPLY: return "LINK_KEY_NEG_REPLY"; + case BT_HCI_OP_PIN_CODE_REPLY: return "PIN_CODE_REPLY"; + case BT_HCI_OP_PIN_CODE_NEG_REPLY: return "PIN_CODE_NEG_REPLY"; + case BT_HCI_OP_AUTH_REQUESTED: return "AUTH_REQUESTED"; + case BT_HCI_OP_SET_CONN_ENCRYPT: return "SET_CONN_ENCRYPT"; + case BT_HCI_OP_REMOTE_NAME_REQUEST: return "REMOTE_NAME_REQUEST"; + case BT_HCI_OP_REMOTE_NAME_CANCEL: return "REMOTE_NAME_CANCEL"; + case BT_HCI_OP_READ_REMOTE_FEATURES: return "READ_REMOTE_FEATURES"; + case BT_HCI_OP_READ_REMOTE_EXT_FEATURES: return "READ_REMOTE_EXT_FEATURES"; + case BT_HCI_OP_READ_REMOTE_VERSION_INFO: return "READ_REMOTE_VERSION_INFO"; + case BT_HCI_OP_IO_CAPABILITY_REPLY: return "IO_CAPABILITY_REPLY"; + case BT_HCI_OP_USER_CONFIRM_REPLY: return "USER_CONFIRM_REPLY"; + case BT_HCI_OP_USER_CONFIRM_NEG_REPLY: return "USER_CONFIRM_NEG_REPLY"; + case BT_HCI_OP_USER_PASSKEY_REPLY: return "USER_PASSKEY_REPLY"; + case BT_HCI_OP_USER_PASSKEY_NEG_REPLY: return "USER_PASSKEY_NEG_REPLY"; + case BT_HCI_OP_IO_CAPABILITY_NEG_REPLY: return "IO_CAPABILITY_NEG_REPLY"; + case BT_HCI_OP_SET_EVENT_MASK: return "SET_EVENT_MASK"; + case BT_HCI_OP_RESET: return "RESET"; + case BT_HCI_OP_WRITE_LOCAL_NAME: return "WRITE_LOCAL_NAME"; + case BT_HCI_OP_WRITE_PAGE_TIMEOUT: return "WRITE_PAGE_TIMEOUT"; + case BT_HCI_OP_WRITE_SCAN_ENABLE: return "WRITE_SCAN_ENABLE"; + case BT_HCI_OP_READ_TX_POWER_LEVEL: return "READ_TX_POWER_LEVEL"; + case BT_HCI_OP_SET_CTL_TO_HOST_FLOW: return "SET_CTL_TO_HOST_FLOW"; + case BT_HCI_OP_HOST_BUFFER_SIZE: return "HOST_BUFFER_SIZE"; + case BT_HCI_OP_HOST_NUM_COMPLETED_PACKETS: return "HOST_NUM_COMPLETED_PACKETS"; + case BT_HCI_OP_WRITE_INQUIRY_MODE: return "WRITE_INQUIRY_MODE"; + case BT_HCI_OP_WRITE_SSP_MODE: return "WRITE_SSP_MODE"; + case BT_HCI_OP_SET_EVENT_MASK_PAGE_2: return "SET_EVENT_MASK_PAGE_2"; + case BT_HCI_OP_LE_WRITE_LE_HOST_SUPP: return "LE_WRITE_LE_HOST_SUPP"; + case BT_HCI_OP_WRITE_SC_HOST_SUPP: return "WRITE_SC_HOST_SUPP"; + case BT_HCI_OP_READ_AUTH_PAYLOAD_TIMEOUT: return "READ_AUTH_PAYLOAD_TIMEOUT"; + case BT_HCI_OP_WRITE_AUTH_PAYLOAD_TIMEOUT: return "WRITE_AUTH_PAYLOAD_TIMEOUT"; + case BT_HCI_OP_READ_LOCAL_VERSION_INFO: return "READ_LOCAL_VERSION_INFO"; + case BT_HCI_OP_READ_SUPPORTED_COMMANDS: return "READ_SUPPORTED_COMMANDS"; + case BT_HCI_OP_READ_LOCAL_EXT_FEATURES: return "READ_LOCAL_EXT_FEATURES"; + case BT_HCI_OP_READ_LOCAL_FEATURES: return "READ_LOCAL_FEATURES"; + case BT_HCI_OP_READ_BUFFER_SIZE: return "READ_BUFFER_SIZE"; + case BT_HCI_OP_READ_BD_ADDR: return "READ_BD_ADDR"; + case BT_HCI_OP_READ_RSSI: return "READ_RSSI"; + case BT_HCI_OP_READ_ENCRYPTION_KEY_SIZE: return "READ_ENCRYPTION_KEY_SIZE"; + case BT_HCI_OP_LE_SET_EVENT_MASK: return "LE_SET_EVENT_MASK"; + case BT_HCI_OP_LE_READ_BUFFER_SIZE: return "LE_READ_BUFFER_SIZE"; + case BT_HCI_OP_LE_READ_LOCAL_FEATURES: return "LE_READ_LOCAL_FEATURES"; + case BT_HCI_OP_LE_SET_RANDOM_ADDRESS: return "LE_SET_RANDOM_ADDRESS"; + case BT_HCI_OP_LE_SET_ADV_PARAM: return "LE_SET_ADV_PARAM"; + case BT_HCI_OP_LE_READ_ADV_CHAN_TX_POWER: return "LE_READ_ADV_CHAN_TX_POWER"; + case BT_HCI_OP_LE_SET_ADV_DATA: return "LE_SET_ADV_DATA"; + case BT_HCI_OP_LE_SET_SCAN_RSP_DATA: return "LE_SET_SCAN_RSP_DATA"; + case BT_HCI_OP_LE_SET_ADV_ENABLE: return "LE_SET_ADV_ENABLE"; + case BT_HCI_OP_LE_SET_SCAN_PARAM: return "LE_SET_SCAN_PARAM"; + case BT_HCI_OP_LE_SET_SCAN_ENABLE: return "LE_SET_SCAN_ENABLE"; + case BT_HCI_OP_LE_CREATE_CONN: return "LE_CREATE_CONN"; + case BT_HCI_OP_LE_CREATE_CONN_CANCEL: return "LE_CREATE_CONN_CANCEL"; + case BT_HCI_OP_LE_READ_WL_SIZE: return "LE_READ_WL_SIZE"; + case BT_HCI_OP_LE_CLEAR_WL: return "LE_CLEAR_WL"; + case BT_HCI_OP_LE_ADD_DEV_TO_WL: return "LE_ADD_DEV_TO_WL"; + case BT_HCI_OP_LE_REM_DEV_FROM_WL: return "LE_REM_DEV_FROM_WL"; + case BT_HCI_OP_LE_CONN_UPDATE: return "LE_CONN_UPDATE"; + case BT_HCI_OP_LE_SET_HOST_CHAN_CLASSIF: return "LE_SET_HOST_CHAN_CLASSIF"; + case BT_HCI_OP_LE_READ_CHAN_MAP: return "LE_READ_CHAN_MAP"; + case BT_HCI_OP_LE_READ_REMOTE_FEATURES: return "LE_READ_REMOTE_FEATURES"; + case BT_HCI_OP_LE_ENCRYPT: return "LE_ENCRYPT"; + case BT_HCI_OP_LE_RAND: return "LE_RAND"; + case BT_HCI_OP_LE_START_ENCRYPTION: return "LE_START_ENCRYPTION"; + case BT_HCI_OP_LE_LTK_REQ_REPLY: return "LE_LTK_REQ_REPLY"; + case BT_HCI_OP_LE_LTK_REQ_NEG_REPLY: return "LE_LTK_REQ_NEG_REPLY"; + case BT_HCI_OP_LE_READ_SUPP_STATES: return "LE_READ_SUPP_STATES"; + case BT_HCI_OP_LE_RX_TEST: return "LE_RX_TEST"; + case BT_HCI_OP_LE_TX_TEST: return "LE_TX_TEST"; + case BT_HCI_OP_LE_TEST_END: return "LE_TEST_END"; + case BT_HCI_OP_LE_CONN_PARAM_REQ_REPLY: return "LE_CONN_PARAM_REQ_REPLY"; + case BT_HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY: return "LE_CONN_PARAM_REQ_NEG_REPLY"; + case BT_HCI_OP_LE_SET_DATA_LEN: return "LE_SET_DATA_LEN"; + case BT_HCI_OP_LE_READ_DEFAULT_DATA_LEN: return "LE_READ_DEFAULT_DATA_LEN"; + case BT_HCI_OP_LE_WRITE_DEFAULT_DATA_LEN: return "LE_WRITE_DEFAULT_DATA_LEN"; + case BT_HCI_OP_LE_P256_PUBLIC_KEY: return "LE_P256_PUBLIC_KEY"; + case BT_HCI_OP_LE_GENERATE_DHKEY: return "LE_GENERATE_DHKEY"; + case BT_HCI_OP_LE_ADD_DEV_TO_RL: return "LE_ADD_DEV_TO_RL"; + case BT_HCI_OP_LE_REM_DEV_FROM_RL: return "LE_REM_DEV_FROM_RL"; + case BT_HCI_OP_LE_CLEAR_RL: return "LE_CLEAR_RL"; + case BT_HCI_OP_LE_READ_RL_SIZE: return "LE_READ_RL_SIZE"; + case BT_HCI_OP_LE_READ_PEER_RPA: return "LE_READ_PEER_RPA"; + case BT_HCI_OP_LE_READ_LOCAL_RPA: return "LE_READ_LOCAL_RPA"; + case BT_HCI_OP_LE_SET_ADDR_RES_ENABLE: return "LE_SET_ADDR_RES_ENABLE"; + case BT_HCI_OP_LE_SET_RPA_TIMEOUT: return "LE_SET_RPA_TIMEOUT"; + case BT_HCI_OP_LE_READ_MAX_DATA_LEN: return "LE_READ_MAX_DATA_LEN"; + case BT_HCI_OP_LE_READ_PHY: return "LE_READ_PHY"; + case BT_HCI_OP_LE_SET_DEFAULT_PHY: return "LE_SET_DEFAULT_PHY"; + case BT_HCI_OP_LE_SET_PHY: return "LE_SET_PHY"; + case BT_HCI_OP_LE_ENH_RX_TEST: return "LE_ENH_RX_TEST"; + case BT_HCI_OP_LE_ENH_TX_TEST: return "LE_ENH_TX_TEST"; + case BT_HCI_OP_LE_SET_ADV_SET_RANDOM_ADDR: return "LE_SET_ADV_SET_RANDOM_ADDR"; + case BT_HCI_OP_LE_SET_EXT_ADV_PARAM: return "LE_SET_EXT_ADV_PARAM"; + case BT_HCI_OP_LE_SET_EXT_ADV_DATA: return "LE_SET_EXT_ADV_DATA"; + case BT_HCI_OP_LE_SET_EXT_SCAN_RSP_DATA: return "LE_SET_EXT_SCAN_RSP_DATA"; + case BT_HCI_OP_LE_SET_EXT_ADV_ENABLE: return "LE_SET_EXT_ADV_ENABLE"; + case BT_HCI_OP_LE_READ_MAX_ADV_DATA_LEN: return "LE_READ_MAX_ADV_DATA_LEN"; + case BT_HCI_OP_LE_READ_NUM_ADV_SETS: return "LE_READ_NUM_ADV_SETS"; + case BT_HCI_OP_LE_REMOVE_ADV_SET: return "LE_REMOVE_ADV_SET"; + case BT_HCI_OP_CLEAR_ADV_SETS: return "CLEAR_ADV_SETS"; + case BT_HCI_OP_LE_SET_PER_ADV_PARAM: return "LE_SET_PER_ADV_PARAM"; + case BT_HCI_OP_LE_SET_PER_ADV_DATA: return "LE_SET_PER_ADV_DATA"; + case BT_HCI_OP_LE_SET_PER_ADV_ENABLE: return "LE_SET_PER_ADV_ENABLE"; + case BT_HCI_OP_LE_SET_EXT_SCAN_PARAM: return "LE_SET_EXT_SCAN_PARAM"; + case BT_HCI_OP_LE_SET_EXT_SCAN_ENABLE: return "LE_SET_EXT_SCAN_ENABLE"; + case BT_HCI_OP_LE_EXT_CREATE_CONN: return "LE_EXT_CREATE_CONN"; + case BT_HCI_OP_LE_PER_ADV_CREATE_SYNC: return "LE_PER_ADV_CREATE_SYNC"; + case BT_HCI_OP_LE_PER_ADV_CREATE_SYNC_CANCEL: return "LE_PER_ADV_CREATE_SYNC_CANCEL"; + case BT_HCI_OP_LE_PER_ADV_TERMINATE_SYNC: return "LE_PER_ADV_TERMINATE_SYNC"; + case BT_HCI_OP_LE_ADD_DEV_TO_PER_ADV_LIST: return "LE_ADD_DEV_TO_PER_ADV_LIST"; + case BT_HCI_OP_LE_REM_DEV_FROM_PER_ADV_LIST: return "LE_REM_DEV_FROM_PER_ADV_LIST"; + case BT_HCI_OP_LE_CLEAR_PER_ADV_LIST: return "LE_CLEAR_PER_ADV_LIST"; + case BT_HCI_OP_LE_READ_PER_ADV_LIST_SIZE: return "LE_READ_PER_ADV_LIST_SIZE"; + case BT_HCI_OP_LE_READ_TX_POWER: return "LE_READ_TX_POWER"; + case BT_HCI_OP_LE_READ_RF_PATH_COMP: return "LE_READ_RF_PATH_COMP"; + case BT_HCI_OP_LE_WRITE_RF_PATH_COMP: return "LE_WRITE_RF_PATH_COMP"; + case BT_HCI_OP_LE_SET_PRIVACY_MODE: return "LE_SET_PRIVACY_MODE"; + default: return ""; + } +} + + +STATIC void dump_cmd_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { + h4_hci_cmd_pkt_t *pkt = (h4_hci_cmd_pkt_t *) pkt_data; + mp_printf(&mp_plat_print, + "%s HCI COMMAND (%x) op: %s (%04x), len: %d, data: ", + tx ? "TX->" : "RX<-", + pkt->pkt_type, + hci_opcode_name(pkt->opcode), pkt->opcode, pkt->param_len); + for (size_t i = 0; i < pkt->param_len; i++) { + mp_printf(&mp_plat_print, "%02x ", pkt->params[i]); + } + if (pkt_len != sizeof(h4_hci_cmd_pkt_t) + pkt->param_len) { + mp_printf(&mp_plat_print, " LENGTH MISMATCH, pkt_len: %d", pkt_len); + } + mp_printf(&mp_plat_print, "\n"); +} + +STATIC void dump_acl_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { + h4_hci_acl_pkt_t *pkt = (h4_hci_acl_pkt_t *) pkt_data; + acl_data_t *acl = (acl_data_t *) pkt->data; + + mp_printf(&mp_plat_print, + "%s HCI ACLDATA (%x) ", + tx ? "TX->" : "RX<-", pkt->pkt_type); + + if (pkt->pb != ACL_DATA_PB_MIDDLE && acl->cid == BT_L2CAP_CID_ATT) { + // This is the start of a fragmented acl_data packet or is a full packet, + // and is an ATT protocol packet. + mp_printf(&mp_plat_print, "att: %s, ", att_opcode_name(acl->acl_data[0])); + } + + mp_printf(&mp_plat_print, + "handle: %04x, pb: %d, bc: %d, data_len: %d, ", + pkt->handle, pkt->pb, pkt->bc, pkt->data_len); + + if (pkt->pb != ACL_DATA_PB_MIDDLE) { + // This is the start of a fragmented acl_data packet or is a full packet. + mp_printf(&mp_plat_print, + "acl data_len: %d, cid: %04x, data: ", + acl->acl_data_len, acl->cid); + for (size_t i = 0; i < acl->acl_data_len; i++) { + mp_printf(&mp_plat_print, "%02x ", acl->acl_data[i]); + } + } else { + for (size_t i = 0; i < pkt->data_len; i++) { + mp_printf(&mp_plat_print, "more data: %02x ", pkt->data[i]); + } + } + + if (pkt_len != sizeof(h4_hci_acl_pkt_t) + pkt->data_len) { + mp_printf(&mp_plat_print, " LENGTH MISMATCH, pkt_len: %d", pkt_len); + } + mp_printf(&mp_plat_print, "\n"); +} + +STATIC void dump_evt_pkt(bool tx, uint8_t pkt_len, uint8_t pkt_data[]) { + h4_hci_evt_pkt_t *pkt = (h4_hci_evt_pkt_t *) pkt_data; + mp_printf(&mp_plat_print, + "%s HCI EVENT (%x) evt: %s (%02x), param_len: %d, data: ", + tx ? "TX->" : "RX<-", + pkt->pkt_type, + pkt->evt == BT_HCI_EVT_LE_META_EVENT + ? hci_evt_le_name(pkt->params[0]) + : hci_evt_name(pkt->evt), + pkt->evt, pkt->param_len); + for (size_t i = 0; i < pkt->param_len; i++) { + mp_printf(&mp_plat_print, "%02x ", pkt->params[i]); + } + if (pkt_len != sizeof(h4_hci_evt_pkt_t) + pkt->param_len) { + mp_printf(&mp_plat_print, " LENGTH MISMATCH, pkt_len: %d", pkt_len); + } + mp_printf(&mp_plat_print, "\n"); +} diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index f63698eba5..db26df570b 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -112,7 +112,7 @@ CFLAGS += $(OPTIMIZATION_FLAGS) -DNDEBUG $(echo PERIPHERALS_CHIP_FAMILY=$(PERIPHERALS_CHIP_FAMILY)) #Debugging/Optimization ifeq ($(DEBUG), 1) - CFLAGS += -ggdb + CFLAGS += -ggdb -Og # You may want to disable -flto if it interferes with debugging. CFLAGS += -flto -flto-partition=none # You may want to enable these flags to make setting breakpoints easier. From 19af89cbeeb0c2a75c207e4c64719d7361348321 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Mon, 3 Aug 2020 23:01:51 -0500 Subject: [PATCH 0473/1293] .gitignore: only ignore autoapi generated .rst files in shared-bindings; ignore common python venv's --- .gitignore | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 475a1183ff..03cd38f35d 100644 --- a/.gitignore +++ b/.gitignore @@ -57,7 +57,7 @@ _build ###################### genrst/ /autoapi/ -/shared-bindings/**/*.rst +/shared-bindings/*/**/*.rst # ctags and similar ################### @@ -80,3 +80,8 @@ TAGS *.mo .vscode + +# Python Virtual Environments +#################### +.venv +.env From 9582cc5bd599c16d43a54d499ebda2a54c9f4bfd Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Tue, 4 Aug 2020 14:53:42 +0900 Subject: [PATCH 0474/1293] Add `make check-stubs` for validating Python stubs --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 1a3cca95d6..d016b770fc 100644 --- a/Makefile +++ b/Makefile @@ -245,6 +245,10 @@ stubs: @$(PYTHON) tools/extract_pyi.py ports/atmel-samd/bindings $(STUBDIR) @$(PYTHON) setup.py -q sdist +.PHONY: check-stubs +check-stubs: stubs + MYPYPATH=$(STUBDIR) mypy --strict $(STUBDIR) + update-frozen-libraries: @echo "Updating all frozen libraries to latest tagged version." cd frozen; for library in *; do cd $$library; ../../tools/git-checkout-latest-tag.sh; cd ..; done From 6dc0f4f1b68f4ac24bf85cc51252106ccfe43776 Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Wed, 5 Aug 2020 01:10:58 +0800 Subject: [PATCH 0475/1293] add an option to turn off QSPI when sleep --- .../makerdiary_m60_keyboard/mpconfigboard.h | 1 + ports/nrf/supervisor/port.c | 13 ++++++++ ports/nrf/supervisor/qspi_flash.c | 33 +++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h b/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h index 086718089a..04a49e5e23 100644 --- a/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h +++ b/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h @@ -40,6 +40,7 @@ #define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(1, 12) #define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(1, 11) #define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(1, 13) +#define MICROPY_QSPI_OFF_WHEN_SLEEP #define BOARD_HAS_CRYSTAL 1 diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index e681e6825f..68d6f5f712 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -295,6 +295,19 @@ void port_interrupt_after_ticks(uint32_t ticks) { } void port_sleep_until_interrupt(void) { +#if defined(MICROPY_QSPI_CS) && defined(MICROPY_QSPI_OFF_WHEN_SLEEP) + // Turn off QSPI when USB is disconnected + if (NRF_QSPI->ENABLE && !(NRF_POWER->USBREGSTATUS & POWER_USBREGSTATUS_VBUSDETECT_Msk)) { + // Keep CS high when QSPI is diabled + nrf_gpio_cfg_output(MICROPY_QSPI_CS); + nrf_gpio_pin_write(MICROPY_QSPI_CS, 1); + + *(volatile uint32_t *)0x40029010 = 1; + *(volatile uint32_t *)0x40029054 = 1; + NRF_QSPI->ENABLE = 0; + } +#endif + // Clear the FPU interrupt because it can prevent us from sleeping. if (NVIC_GetPendingIRQ(FPU_IRQn)) { __set_FPSCR(__get_FPSCR() & ~(0x9f)); diff --git a/ports/nrf/supervisor/qspi_flash.c b/ports/nrf/supervisor/qspi_flash.c index 90260b0912..83261f0800 100644 --- a/ports/nrf/supervisor/qspi_flash.c +++ b/ports/nrf/supervisor/qspi_flash.c @@ -38,7 +38,35 @@ #include "supervisor/shared/external_flash/common_commands.h" #include "supervisor/shared/external_flash/qspi_flash.h" +#if defined(MICROPY_QSPI_OFF_WHEN_SLEEP) +#define QSPI_ENABLE qspi_enable + +static void qspi_enable(void) +{ + if (NRF_QSPI->ENABLE) { + return; + } + + nrf_qspi_enable(NRF_QSPI); + + nrf_qspi_event_clear(NRF_QSPI, NRF_QSPI_EVENT_READY); + nrf_qspi_task_trigger(NRF_QSPI, NRF_QSPI_TASK_ACTIVATE); + + uint32_t remaining_attempts = 100; + do { + if (nrf_qspi_event_check(NRF_QSPI, NRF_QSPI_EVENT_READY)) { + break; + } + NRFX_DELAY_US(10); + } while (--remaining_attempts); +} + +#else +#define QSPI_ENABLE() +#endif + bool spi_flash_command(uint8_t command) { + QSPI_ENABLE(); nrf_qspi_cinstr_conf_t cinstr_cfg = { .opcode = command, .length = 1, @@ -51,6 +79,7 @@ bool spi_flash_command(uint8_t command) { } bool spi_flash_read_command(uint8_t command, uint8_t* response, uint32_t length) { + QSPI_ENABLE(); nrf_qspi_cinstr_conf_t cinstr_cfg = { .opcode = command, .length = length + 1, @@ -64,6 +93,7 @@ bool spi_flash_read_command(uint8_t command, uint8_t* response, uint32_t length) } bool spi_flash_write_command(uint8_t command, uint8_t* data, uint32_t length) { + QSPI_ENABLE(); nrf_qspi_cinstr_conf_t cinstr_cfg = { .opcode = command, .length = length + 1, @@ -76,6 +106,7 @@ bool spi_flash_write_command(uint8_t command, uint8_t* data, uint32_t length) { } bool spi_flash_sector_command(uint8_t command, uint32_t address) { + QSPI_ENABLE(); if (command != CMD_SECTOR_ERASE) { return false; } @@ -83,6 +114,7 @@ bool spi_flash_sector_command(uint8_t command, uint32_t address) { } bool spi_flash_write_data(uint32_t address, uint8_t* data, uint32_t length) { + QSPI_ENABLE(); // TODO: In theory, this also needs to handle unaligned data and // non-multiple-of-4 length. (in practice, I don't think the fat layer // generates such writes) @@ -90,6 +122,7 @@ bool spi_flash_write_data(uint32_t address, uint8_t* data, uint32_t length) { } bool spi_flash_read_data(uint32_t address, uint8_t* data, uint32_t length) { + QSPI_ENABLE(); int misaligned = ((intptr_t)data) & 3; // If the data is misaligned, we need to read 4 bytes // into an aligned buffer, and then copy 1, 2, or 3 bytes from the aligned From dddd25a776fb0d9c002c1b6b039e24bb3048e6ff Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 1 Aug 2020 12:14:55 -0500 Subject: [PATCH 0476/1293] Combine similar strings to reduce size of translations This is a slight trade-off with code size, in places where a "_varg" mp_raise variant is now used. The net savings on trinket_m0 is just 32 bytes. It also means that the translation will include the original English text, and cannot be translated. These are usually names of Python types such as int, set, or dict or special values such as "inf" or "Nan". --- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 2 +- ports/atmel-samd/common-hal/rtc/RTC.c | 4 ++++ ports/cxd56/common-hal/pulseio/PulseIn.c | 2 +- ports/mimxrt10xx/common-hal/pulseio/PulseIn.c | 2 +- ports/nrf/common-hal/pulseio/PulseIn.c | 2 +- ports/stm/common-hal/pulseio/PulseIn.c | 2 +- py/obj.c | 6 +++--- py/objdict.c | 2 +- py/objint.c | 4 ++-- py/objlist.c | 2 +- py/objset.c | 2 +- py/runtime.c | 8 ++++++++ py/runtime.h | 1 + shared-bindings/i2cperipheral/I2CPeripheral.c | 2 +- shared-bindings/ps2io/Ps2.c | 2 +- shared-bindings/time/__init__.c | 2 +- 16 files changed, 29 insertions(+), 16 deletions(-) diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index ae58b089de..be8165a5aa 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -298,7 +298,7 @@ void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t* self) { uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { if (self->len == 0) { - mp_raise_IndexError(translate("pop from an empty PulseIn")); + mp_raise_IndexError_varg(translate("pop from empty %s"), "PulseIn"); } common_hal_mcu_disable_interrupts(); uint16_t value = self->buffer[self->start]; diff --git a/ports/atmel-samd/common-hal/rtc/RTC.c b/ports/atmel-samd/common-hal/rtc/RTC.c index 203187b4ff..3473165db2 100644 --- a/ports/atmel-samd/common-hal/rtc/RTC.c +++ b/ports/atmel-samd/common-hal/rtc/RTC.c @@ -68,7 +68,11 @@ int common_hal_rtc_get_calibration(void) { void common_hal_rtc_set_calibration(int calibration) { if (calibration > 127 || calibration < -127) { +#if CIRCUITPY_FULL_BUILD mp_raise_ValueError(translate("calibration value out of range +/-127")); +#else + mp_raise_ValueError(translate("calibration is out of range")); +#endif } hri_rtcmode0_write_FREQCORR_SIGN_bit(RTC, calibration < 0 ? 0 : 1); diff --git a/ports/cxd56/common-hal/pulseio/PulseIn.c b/ports/cxd56/common-hal/pulseio/PulseIn.c index 221fa5b6eb..045acc9d2c 100644 --- a/ports/cxd56/common-hal/pulseio/PulseIn.c +++ b/ports/cxd56/common-hal/pulseio/PulseIn.c @@ -160,7 +160,7 @@ void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t *self) { uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t *self) { if (self->len == 0) { - mp_raise_IndexError(translate("pop from an empty PulseIn")); + mp_raise_IndexError_varg(translate("pop from empty %s"), "PulseIn"); } common_hal_mcu_disable_interrupts(); uint16_t value = self->buffer[self->start]; diff --git a/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c b/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c index ec02908612..e89a49e808 100644 --- a/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c +++ b/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c @@ -201,7 +201,7 @@ void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t* self) { uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { // if (self->len == 0) { -// mp_raise_IndexError(translate("pop from an empty PulseIn")); +// mp_raise_IndexError_varg(translate("pop from empty %s"), "PulseIn"); // } // common_hal_mcu_disable_interrupts(); // uint16_t value = self->buffer[self->start]; diff --git a/ports/nrf/common-hal/pulseio/PulseIn.c b/ports/nrf/common-hal/pulseio/PulseIn.c index be2903e444..80ff2c5291 100644 --- a/ports/nrf/common-hal/pulseio/PulseIn.c +++ b/ports/nrf/common-hal/pulseio/PulseIn.c @@ -284,7 +284,7 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t* self, int16_ uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { if (self->len == 0) { - mp_raise_IndexError(translate("pop from an empty PulseIn")); + mp_raise_IndexError_varg(translate("pop from empty %s"), "PulseIn"); } if ( !self->paused ) { diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c index 4052c240fe..b43fdd5547 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.c +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -258,7 +258,7 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t* self, int16_ uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { if (self->len == 0) { - mp_raise_IndexError(translate("pop from an empty PulseIn")); + mp_raise_IndexError_varg(translate("pop from empty %s"), "PulseIn"); } HAL_NVIC_DisableIRQ(self->irq); uint16_t value = self->buffer[self->start]; diff --git a/py/obj.c b/py/obj.c index 7644b5de8e..2b0c46f495 100644 --- a/py/obj.c +++ b/py/obj.c @@ -263,7 +263,7 @@ mp_int_t mp_obj_get_int(mp_const_obj_t arg) { mp_raise_TypeError(translate("can't convert to int")); } else { mp_raise_TypeError_varg( - translate("can't convert %s to int"), mp_obj_get_type_str(arg)); + translate("can't convert %s to %s"), mp_obj_get_type_str(arg), "int"); } } } @@ -326,7 +326,7 @@ mp_float_t mp_obj_get_float(mp_obj_t arg) { mp_raise_TypeError(translate("can't convert to float")); } else { mp_raise_TypeError_varg( - translate("can't convert %s to float"), mp_obj_get_type_str(arg)); + translate("can't convert %s to %s"), mp_obj_get_type_str(arg), "float"); } } @@ -359,7 +359,7 @@ void mp_obj_get_complex(mp_obj_t arg, mp_float_t *real, mp_float_t *imag) { mp_raise_TypeError(translate("can't convert to complex")); } else { mp_raise_TypeError_varg( - translate("can't convert %s to complex"), mp_obj_get_type_str(arg)); + translate("can't convert %s to %s"), mp_obj_get_type_str(arg), "complex"); } } } diff --git a/py/objdict.c b/py/objdict.c index 39169fe1ad..6ddf7ddde5 100644 --- a/py/objdict.c +++ b/py/objdict.c @@ -313,7 +313,7 @@ STATIC mp_obj_t dict_popitem(mp_obj_t self_in) { size_t cur = 0; mp_map_elem_t *next = dict_iter_next(self, &cur); if (next == NULL) { - mp_raise_msg(&mp_type_KeyError, translate("popitem(): dictionary is empty")); + mp_raise_msg_varg(&mp_type_KeyError, translate("pop from empty %s"), "dict"); } self->map.used--; mp_obj_t items[] = {next->key, next->value}; diff --git a/py/objint.c b/py/objint.c index 82f5aadd18..7726fb8d85 100644 --- a/py/objint.c +++ b/py/objint.c @@ -141,9 +141,9 @@ STATIC mp_fp_as_int_class_t mp_classify_fp_as_int(mp_float_t val) { mp_obj_t mp_obj_new_int_from_float(mp_float_t val) { int cl = fpclassify(val); if (cl == FP_INFINITE) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_OverflowError, translate("can't convert inf to int"))); + mp_raise_OverflowError_varg(translate("can't convert %s to %s"), "inf", "int"); } else if (cl == FP_NAN) { - mp_raise_ValueError(translate("can't convert NaN to int")); + mp_raise_ValueError_varg(translate("can't convert %s to %s"), "NaN", "int"); } else { mp_fp_as_int_class_t icl = mp_classify_fp_as_int(val); if (icl == MP_FP_CLASS_FIT_SMALLINT) { diff --git a/py/objlist.c b/py/objlist.c index 9242020d45..b2de72374b 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -274,7 +274,7 @@ STATIC mp_obj_t list_pop(size_t n_args, const mp_obj_t *args) { mp_check_self(MP_OBJ_IS_TYPE(args[0], &mp_type_list)); mp_obj_list_t *self = mp_instance_cast_to_native_base(args[0], &mp_type_list); if (self->len == 0) { - mp_raise_IndexError(translate("pop from empty list")); + mp_raise_IndexError_varg(translate("pop from empty %s"), "list"); } size_t index = mp_get_index(self->base.type, self->len, n_args == 1 ? MP_OBJ_NEW_SMALL_INT(-1) : args[1], false); mp_obj_t ret = self->items[index]; diff --git a/py/objset.c b/py/objset.c index d986c6ddaf..82b10e7e89 100644 --- a/py/objset.c +++ b/py/objset.c @@ -368,7 +368,7 @@ STATIC mp_obj_t set_pop(mp_obj_t self_in) { mp_obj_set_t *self = MP_OBJ_TO_PTR(self_in); mp_obj_t obj = mp_set_remove_first(&self->set); if (obj == MP_OBJ_NULL) { - mp_raise_msg(&mp_type_KeyError, translate("pop from an empty set")); + mp_raise_IndexError_varg(translate("pop from empty %s"), "set"); } return obj; } diff --git a/py/runtime.c b/py/runtime.c index 91ead1fba9..c0a4f44a18 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -1546,6 +1546,14 @@ NORETURN void mp_raise_IndexError(const compressed_string_t *msg) { mp_raise_msg(&mp_type_IndexError, msg); } +NORETURN void mp_raise_IndexError_varg(const compressed_string_t *fmt, ...) { + va_list argptr; + va_start(argptr,fmt); + mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_IndexError, fmt, argptr); + va_end(argptr); + nlr_raise(exception); +} + NORETURN void mp_raise_ValueError(const compressed_string_t *msg) { mp_raise_msg(&mp_type_ValueError, msg); } diff --git a/py/runtime.h b/py/runtime.h index d3a82333e7..ed37f90d94 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -160,6 +160,7 @@ NORETURN void mp_raise_AttributeError(const compressed_string_t *msg); NORETURN void mp_raise_RuntimeError(const compressed_string_t *msg); NORETURN void mp_raise_ImportError(const compressed_string_t *msg); NORETURN void mp_raise_IndexError(const compressed_string_t *msg); +NORETURN void mp_raise_IndexError_varg(const compressed_string_t *msg, ...); NORETURN void mp_raise_OSError(int errno_); NORETURN void mp_raise_OSError_errno_str(int errno_, mp_obj_t str); NORETURN void mp_raise_OSError_msg(const compressed_string_t *msg); diff --git a/shared-bindings/i2cperipheral/I2CPeripheral.c b/shared-bindings/i2cperipheral/I2CPeripheral.c index cfebd472ee..39f787062f 100644 --- a/shared-bindings/i2cperipheral/I2CPeripheral.c +++ b/shared-bindings/i2cperipheral/I2CPeripheral.c @@ -86,7 +86,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_make_new(const mp_obj_type_t *type, while ((item = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) { mp_int_t value; if (!mp_obj_get_int_maybe(item, &value)) { - mp_raise_TypeError(translate("can't convert address to int")); + mp_raise_TypeError_varg(translate("can't convert %s to %s"), "address", "int"); } if (value < 0x00 || value > 0x7f) { mp_raise_ValueError(translate("address out of bounds")); diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c index 15731ea404..64d93f6ad5 100644 --- a/shared-bindings/ps2io/Ps2.c +++ b/shared-bindings/ps2io/Ps2.c @@ -133,7 +133,7 @@ STATIC mp_obj_t ps2io_ps2_obj_popleft(mp_obj_t self_in) { int b = common_hal_ps2io_ps2_popleft(self); if (b < 0) { - mp_raise_IndexError(translate("Pop from an empty Ps2 buffer")); + mp_raise_IndexError_varg(translate("pop from empty %s"), "Ps2 buffer"); } return MP_OBJ_NEW_SMALL_INT(b); } diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 262da17fd2..f7382b1ac1 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -280,7 +280,7 @@ STATIC mp_obj_t time_mktime(mp_obj_t t) { mp_obj_tuple_get(t, &len, &elem); if (len != 9) { - mp_raise_TypeError(translate("function takes exactly 9 arguments")); + mp_raise_TypeError_varg(translate("function takes %d positional arguments but %d were given"), 9); } if (mp_obj_get_int(elem[0]) < 2000) { From 67eb93fc98325697876f581c8e4879bd1b88368f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 1 Aug 2020 13:05:30 -0500 Subject: [PATCH 0477/1293] py: introduce, use mp_raise_msg_vlist This saves a very small amount of flash, 8 bytes on trinket_m0 --- py/runtime.c | 26 ++++++++++++-------------- py/runtime.h | 1 + 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/py/runtime.c b/py/runtime.c index c0a4f44a18..87c24dc562 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -1522,12 +1522,16 @@ NORETURN void mp_raise_msg(const mp_obj_type_t *exc_type, const compressed_strin } } +NORETURN void mp_raise_msg_vlist(const mp_obj_type_t *exc_type, const compressed_string_t *fmt, va_list argptr) { + mp_obj_t exception = mp_obj_new_exception_msg_vlist(exc_type, fmt, argptr); + nlr_raise(exception); +} + NORETURN void mp_raise_msg_varg(const mp_obj_type_t *exc_type, const compressed_string_t *fmt, ...) { va_list argptr; va_start(argptr,fmt); - mp_obj_t exception = mp_obj_new_exception_msg_vlist(exc_type, fmt, argptr); + mp_raise_msg_vlist(exc_type, fmt, argptr); va_end(argptr); - nlr_raise(exception); } NORETURN void mp_raise_AttributeError(const compressed_string_t *msg) { @@ -1549,9 +1553,8 @@ NORETURN void mp_raise_IndexError(const compressed_string_t *msg) { NORETURN void mp_raise_IndexError_varg(const compressed_string_t *fmt, ...) { va_list argptr; va_start(argptr,fmt); - mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_IndexError, fmt, argptr); + mp_raise_msg_vlist(&mp_type_IndexError, fmt, argptr); va_end(argptr); - nlr_raise(exception); } NORETURN void mp_raise_ValueError(const compressed_string_t *msg) { @@ -1561,9 +1564,8 @@ NORETURN void mp_raise_ValueError(const compressed_string_t *msg) { NORETURN void mp_raise_ValueError_varg(const compressed_string_t *fmt, ...) { va_list argptr; va_start(argptr,fmt); - mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_ValueError, fmt, argptr); + mp_raise_msg_vlist(&mp_type_ValueError, fmt, argptr); va_end(argptr); - nlr_raise(exception); } NORETURN void mp_raise_TypeError(const compressed_string_t *msg) { @@ -1573,9 +1575,8 @@ NORETURN void mp_raise_TypeError(const compressed_string_t *msg) { NORETURN void mp_raise_TypeError_varg(const compressed_string_t *fmt, ...) { va_list argptr; va_start(argptr,fmt); - mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_TypeError, fmt, argptr); + mp_raise_msg_vlist(&mp_type_TypeError, fmt, argptr); va_end(argptr); - nlr_raise(exception); } NORETURN void mp_raise_OSError(int errno_) { @@ -1597,9 +1598,8 @@ NORETURN void mp_raise_OSError_errno_str(int errno_, mp_obj_t str) { NORETURN void mp_raise_OSError_msg_varg(const compressed_string_t *fmt, ...) { va_list argptr; va_start(argptr,fmt); - mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_OSError, fmt, argptr); + mp_raise_msg_vlist(&mp_type_OSError, fmt, argptr); va_end(argptr); - nlr_raise(exception); } NORETURN void mp_raise_NotImplementedError(const compressed_string_t *msg) { @@ -1609,17 +1609,15 @@ NORETURN void mp_raise_NotImplementedError(const compressed_string_t *msg) { NORETURN void mp_raise_NotImplementedError_varg(const compressed_string_t *fmt, ...) { va_list argptr; va_start(argptr,fmt); - mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_NotImplementedError, fmt, argptr); + mp_raise_msg_vlist(&mp_type_NotImplementedError, fmt, argptr); va_end(argptr); - nlr_raise(exception); } NORETURN void mp_raise_OverflowError_varg(const compressed_string_t *fmt, ...) { va_list argptr; va_start(argptr,fmt); - mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_OverflowError, fmt, argptr); + mp_raise_msg_vlist(&mp_type_OverflowError, fmt, argptr); va_end(argptr); - nlr_raise(exception); } NORETURN void mp_raise_MpyError(const compressed_string_t *msg) { diff --git a/py/runtime.h b/py/runtime.h index ed37f90d94..dbc04b94ec 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -152,6 +152,7 @@ void mp_import_all(mp_obj_t module); NORETURN void mp_raise_msg(const mp_obj_type_t *exc_type, const compressed_string_t *msg); NORETURN void mp_raise_msg_varg(const mp_obj_type_t *exc_type, const compressed_string_t *fmt, ...); +NORETURN void mp_raise_msg_vlist(const mp_obj_type_t *exc_type, const compressed_string_t *fmt, va_list argptr); NORETURN void mp_raise_ValueError(const compressed_string_t *msg); NORETURN void mp_raise_ValueError_varg(const compressed_string_t *fmt, ...); NORETURN void mp_raise_TypeError(const compressed_string_t *msg); From 92917b84f1a173a06d337d82a7a5568f680ff268 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 1 Aug 2020 16:03:00 -0500 Subject: [PATCH 0478/1293] fix exception type for pop from empty set --- py/objset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/objset.c b/py/objset.c index 82b10e7e89..6764a5c6f6 100644 --- a/py/objset.c +++ b/py/objset.c @@ -368,7 +368,7 @@ STATIC mp_obj_t set_pop(mp_obj_t self_in) { mp_obj_set_t *self = MP_OBJ_TO_PTR(self_in); mp_obj_t obj = mp_set_remove_first(&self->set); if (obj == MP_OBJ_NULL) { - mp_raise_IndexError_varg(translate("pop from empty %s"), "set"); + mp_raise_msg_varg(&mp_type_KeyError, translate("pop from empty %s"), "set"); } return obj; } From c37a25f0e5d1c877909855f6a3294e43b854bbbd Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 4 Aug 2020 10:59:31 -0500 Subject: [PATCH 0479/1293] Use qstrs to save an additional 4 bytes --- py/obj.c | 12 ++++++++---- py/obj.h | 1 + py/objint.c | 4 ++-- shared-bindings/i2cperipheral/I2CPeripheral.c | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/py/obj.c b/py/obj.c index 2b0c46f495..404fdd5d9d 100644 --- a/py/obj.c +++ b/py/obj.c @@ -57,8 +57,12 @@ mp_obj_type_t *mp_obj_get_type(mp_const_obj_t o_in) { } } +qstr mp_obj_get_type_qstr(mp_const_obj_t o_in) { + return mp_obj_get_type(o_in)->name; +} + const char *mp_obj_get_type_str(mp_const_obj_t o_in) { - return qstr_str(mp_obj_get_type(o_in)->name); + return qstr_str(mp_obj_get_type_qstr(o_in)); } void mp_obj_print_helper(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) { @@ -263,7 +267,7 @@ mp_int_t mp_obj_get_int(mp_const_obj_t arg) { mp_raise_TypeError(translate("can't convert to int")); } else { mp_raise_TypeError_varg( - translate("can't convert %s to %s"), mp_obj_get_type_str(arg), "int"); + translate("can't convert %q to %q"), mp_obj_get_type_qstr(arg), MP_QSTR_int); } } } @@ -326,7 +330,7 @@ mp_float_t mp_obj_get_float(mp_obj_t arg) { mp_raise_TypeError(translate("can't convert to float")); } else { mp_raise_TypeError_varg( - translate("can't convert %s to %s"), mp_obj_get_type_str(arg), "float"); + translate("can't convert %q to %q"), mp_obj_get_type_qstr(arg), MP_QSTR_float); } } @@ -359,7 +363,7 @@ void mp_obj_get_complex(mp_obj_t arg, mp_float_t *real, mp_float_t *imag) { mp_raise_TypeError(translate("can't convert to complex")); } else { mp_raise_TypeError_varg( - translate("can't convert %s to %s"), mp_obj_get_type_str(arg), "complex"); + translate("can't convert %q to %q"), mp_obj_get_type_qstr(arg), MP_QSTR_complex); } } } diff --git a/py/obj.h b/py/obj.h index e603d4a496..656190cb31 100644 --- a/py/obj.h +++ b/py/obj.h @@ -680,6 +680,7 @@ mp_obj_t mp_obj_new_memoryview(byte typecode, size_t nitems, void *items); mp_obj_type_t *mp_obj_get_type(mp_const_obj_t o_in); const char *mp_obj_get_type_str(mp_const_obj_t o_in); +qstr mp_obj_get_type_qstr(mp_const_obj_t o_in); bool mp_obj_is_subclass_fast(mp_const_obj_t object, mp_const_obj_t classinfo); // arguments should be type objects mp_obj_t mp_instance_cast_to_native_base(mp_obj_t self_in, mp_const_obj_t native_type); diff --git a/py/objint.c b/py/objint.c index 7726fb8d85..b12bb39952 100644 --- a/py/objint.c +++ b/py/objint.c @@ -141,9 +141,9 @@ STATIC mp_fp_as_int_class_t mp_classify_fp_as_int(mp_float_t val) { mp_obj_t mp_obj_new_int_from_float(mp_float_t val) { int cl = fpclassify(val); if (cl == FP_INFINITE) { - mp_raise_OverflowError_varg(translate("can't convert %s to %s"), "inf", "int"); + mp_raise_OverflowError_varg(translate("can't convert %q to %q"), MP_QSTR_inf, MP_QSTR_int); } else if (cl == FP_NAN) { - mp_raise_ValueError_varg(translate("can't convert %s to %s"), "NaN", "int"); + mp_raise_ValueError_varg(translate("can't convert %q to %q"), MP_QSTR_NaN, MP_QSTR_int); } else { mp_fp_as_int_class_t icl = mp_classify_fp_as_int(val); if (icl == MP_FP_CLASS_FIT_SMALLINT) { diff --git a/shared-bindings/i2cperipheral/I2CPeripheral.c b/shared-bindings/i2cperipheral/I2CPeripheral.c index 39f787062f..dfc58cd242 100644 --- a/shared-bindings/i2cperipheral/I2CPeripheral.c +++ b/shared-bindings/i2cperipheral/I2CPeripheral.c @@ -86,7 +86,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_make_new(const mp_obj_type_t *type, while ((item = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) { mp_int_t value; if (!mp_obj_get_int_maybe(item, &value)) { - mp_raise_TypeError_varg(translate("can't convert %s to %s"), "address", "int"); + mp_raise_TypeError_varg(translate("can't convert %q to %q"), MP_QSTR_address, MP_QSTR_int); } if (value < 0x00 || value > 0x7f) { mp_raise_ValueError(translate("address out of bounds")); From 89797fd3f9d36cd7e2e7a125dbbe02f598874060 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 4 Aug 2020 11:15:22 -0500 Subject: [PATCH 0480/1293] various: Use mp_obj_get_type_qstr more widely This removes runtime allocations of the cstring version of the qstring. It is not a size improvement --- extmod/vfs_fat_file.c | 2 +- extmod/vfs_posix_file.c | 2 +- ports/unix/file.c | 2 +- py/obj.c | 14 +++++++------- py/objstr.c | 14 +++++++------- py/objstrunicode.c | 2 +- py/objtype.c | 12 ++++++------ py/proto.c | 4 ++-- py/runtime.c | 28 ++++++++++++++-------------- 9 files changed, 40 insertions(+), 40 deletions(-) diff --git a/extmod/vfs_fat_file.c b/extmod/vfs_fat_file.c index 0642f4a9ce..89786bfa36 100644 --- a/extmod/vfs_fat_file.c +++ b/extmod/vfs_fat_file.c @@ -42,7 +42,7 @@ const byte fresult_to_errno_table[20] = { STATIC void file_obj_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { (void)kind; - mp_printf(print, "", mp_obj_get_type_str(self_in), MP_OBJ_TO_PTR(self_in)); + mp_printf(print, "", mp_obj_get_type_qstr(self_in), MP_OBJ_TO_PTR(self_in)); } STATIC mp_uint_t file_obj_read(mp_obj_t self_in, void *buf, mp_uint_t size, int *errcode) { diff --git a/extmod/vfs_posix_file.c b/extmod/vfs_posix_file.c index eefc1d905a..3f887785e7 100644 --- a/extmod/vfs_posix_file.c +++ b/extmod/vfs_posix_file.c @@ -34,7 +34,7 @@ STATIC void check_fd_is_open(const mp_obj_vfs_posix_file_t *o) { STATIC void vfs_posix_file_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { (void)kind; mp_obj_vfs_posix_file_t *self = MP_OBJ_TO_PTR(self_in); - mp_printf(print, "", mp_obj_get_type_str(self_in), self->fd); + mp_printf(print, "", mp_obj_get_type_qstr(self_in), self->fd); } mp_obj_t mp_vfs_posix_file_open(const mp_obj_type_t *type, mp_obj_t file_in, mp_obj_t mode_in) { diff --git a/ports/unix/file.c b/ports/unix/file.c index e4f62e3d5a..222dca4621 100644 --- a/ports/unix/file.c +++ b/ports/unix/file.c @@ -60,7 +60,7 @@ extern const mp_obj_type_t mp_type_textio; STATIC void fdfile_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { (void)kind; mp_obj_fdfile_t *self = MP_OBJ_TO_PTR(self_in); - mp_printf(print, "", mp_obj_get_type_str(self_in), self->fd); + mp_printf(print, "", mp_obj_get_type_qstr(self_in), self->fd); } STATIC mp_uint_t fdfile_read(mp_obj_t o_in, void *buf, mp_uint_t size, int *errcode) { diff --git a/py/obj.c b/py/obj.c index 404fdd5d9d..41fdaf6330 100644 --- a/py/obj.c +++ b/py/obj.c @@ -381,7 +381,7 @@ void mp_obj_get_array(mp_obj_t o, size_t *len, mp_obj_t **items) { mp_raise_TypeError(translate("expected tuple/list")); } else { mp_raise_TypeError_varg( - translate("object '%s' is not a tuple or list"), mp_obj_get_type_str(o)); + translate("object '%q' is not a tuple or list"), mp_obj_get_type_qstr(o)); } } } @@ -410,8 +410,8 @@ size_t mp_get_index(const mp_obj_type_t *type, size_t len, mp_obj_t index, bool mp_raise_TypeError(translate("indices must be integers")); } else { mp_raise_TypeError_varg( - translate("%q indices must be integers, not %s"), - type->name, mp_obj_get_type_str(index)); + translate("%q indices must be integers, not %q"), + type->name, mp_obj_get_type_qstr(index)); } } @@ -465,7 +465,7 @@ mp_obj_t mp_obj_len(mp_obj_t o_in) { mp_raise_TypeError(translate("object has no len")); } else { mp_raise_TypeError_varg( - translate("object of type '%s' has no len()"), mp_obj_get_type_str(o_in)); + translate("object of type '%q' has no len()"), mp_obj_get_type_qstr(o_in)); } } else { return len; @@ -508,21 +508,21 @@ mp_obj_t mp_obj_subscr(mp_obj_t base, mp_obj_t index, mp_obj_t value) { mp_raise_TypeError(translate("object does not support item deletion")); } else { mp_raise_TypeError_varg( - translate("'%s' object does not support item deletion"), mp_obj_get_type_str(base)); + translate("'%q' object does not support item deletion"), mp_obj_get_type_qstr(base)); } } else if (value == MP_OBJ_SENTINEL) { if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { mp_raise_TypeError(translate("object is not subscriptable")); } else { mp_raise_TypeError_varg( - translate("'%s' object is not subscriptable"), mp_obj_get_type_str(base)); + translate("'%q' object is not subscriptable"), mp_obj_get_type_qstr(base)); } } else { if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { mp_raise_TypeError(translate("object does not support item assignment")); } else { mp_raise_TypeError_varg( - translate("'%s' object does not support item assignment"), mp_obj_get_type_str(base)); + translate("'%q' object does not support item assignment"), mp_obj_get_type_qstr(base)); } } } diff --git a/py/objstr.c b/py/objstr.c index 5e0c6fdfaa..572bf299d4 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -1280,8 +1280,8 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar terse_str_format_value_error(); } else { mp_raise_ValueError_varg( - translate("unknown format code '%c' for object of type '%s'"), - type, mp_obj_get_type_str(arg)); + translate("unknown format code '%c' for object of type '%q'"), + type, mp_obj_get_type_qstr(arg)); } } } @@ -1352,8 +1352,8 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar terse_str_format_value_error(); } else { mp_raise_ValueError_varg( - translate("unknown format code '%c' for object of type '%s'"), - type, mp_obj_get_type_str(arg)); + translate("unknown format code '%c' for object of type '%q'"), + type, mp_obj_get_type_qstr(arg)); } } } else { @@ -1388,8 +1388,8 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar terse_str_format_value_error(); } else { mp_raise_ValueError_varg( - translate("unknown format code '%c' for object of type '%s'"), - type, mp_obj_get_type_str(arg)); + translate("unknown format code '%c' for object of type '%q'"), + type, mp_obj_get_type_qstr(arg)); } } } @@ -2133,7 +2133,7 @@ STATIC NORETURN void bad_implicit_conversion(mp_obj_t self_in) { if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { mp_raise_TypeError(translate("can't convert to str implicitly")); } else { - const qstr src_name = mp_obj_get_type(self_in)->name; + const qstr src_name = mp_obj_get_type_qstr(self_in); nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError, translate("can't convert '%q' object to %q implicitly"), src_name, src_name == MP_QSTR_str ? MP_QSTR_bytes : MP_QSTR_str)); diff --git a/py/objstrunicode.c b/py/objstrunicode.c index 351a67e913..19d89a31ce 100644 --- a/py/objstrunicode.c +++ b/py/objstrunicode.c @@ -151,7 +151,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(translate("string indices must be integers, not %s"), mp_obj_get_type_str(index)); + mp_raise_TypeError_varg(translate("string indices must be integers, not %q"), mp_obj_get_type_qstr(index)); } const byte *s, *top = self_data + self_len; if (i < 0) diff --git a/py/objtype.c b/py/objtype.c index fd51ce36b8..ccd014c335 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -193,7 +193,7 @@ STATIC void mp_obj_class_lookup(struct class_lookup_data *lookup, const mp_obj_ printf("mp_obj_class_lookup: Returning: "); mp_obj_print(lookup->dest[0], PRINT_REPR); printf(" "); // Don't try to repr() lookup->dest[1], as we can be called recursively - printf("<%s @%p>\n", mp_obj_get_type_str(lookup->dest[1]), lookup->dest[1]); + printf("<%q @%p>\n", mp_obj_get_type_qstr(lookup->dest[1]), lookup->dest[1]); #endif return; } @@ -285,7 +285,7 @@ STATIC void instance_print(const mp_print_t *print, mp_obj_t self_in, mp_print_k } // TODO: CPython prints fully-qualified type name - mp_printf(print, "<%s object at %p>", mp_obj_get_type_str(self_in), self); + mp_printf(print, "<%q object at %p>", mp_obj_get_type_qstr(self_in), self); } mp_obj_t mp_obj_instance_make_new(const mp_obj_type_t *self, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { @@ -376,8 +376,8 @@ mp_obj_t mp_obj_instance_make_new(const mp_obj_type_t *self, size_t n_args, cons if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { mp_raise_TypeError(translate("__init__() should return None")); } else { - mp_raise_TypeError_varg(translate("__init__() should return None, not '%s'"), - mp_obj_get_type_str(init_ret)); + mp_raise_TypeError_varg(translate("__init__() should return None, not '%q'"), + mp_obj_get_type_qstr(init_ret)); } } @@ -891,8 +891,8 @@ mp_obj_t mp_obj_instance_call(mp_obj_t self_in, size_t n_args, size_t n_kw, cons if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { mp_raise_TypeError(translate("object not callable")); } else { - mp_raise_TypeError_varg(translate("'%s' object is not callable"), - mp_obj_get_type_str(self_in)); + mp_raise_TypeError_varg(translate("'%q' object is not callable"), + mp_obj_get_type_qstr(self_in)); } } mp_obj_instance_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/py/proto.c b/py/proto.c index e5053130b8..e4da157f05 100644 --- a/py/proto.c +++ b/py/proto.c @@ -45,6 +45,6 @@ const void *mp_proto_get_or_throw(uint16_t name, mp_const_obj_t obj) { if (proto) { return proto; } - mp_raise_TypeError_varg(translate("'%s' object does not support '%q'"), - mp_obj_get_type_str(obj), name); + mp_raise_TypeError_varg(translate("'%q' object does not support '%q'"), + mp_obj_get_type_qstr(obj), name); } diff --git a/py/runtime.c b/py/runtime.c index 87c24dc562..f9ef7819d1 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -279,8 +279,8 @@ mp_obj_t mp_unary_op(mp_unary_op_t op, mp_obj_t arg) { mp_raise_TypeError(translate("unsupported type for operator")); } else { mp_raise_TypeError_varg( - translate("unsupported type for %q: '%s'"), - mp_unary_op_method_name[op], mp_obj_get_type_str(arg)); + translate("unsupported type for %q: '%q'"), + mp_unary_op_method_name[op], mp_obj_get_type_qstr(arg)); } } } @@ -586,8 +586,8 @@ unsupported_op: mp_raise_TypeError(translate("unsupported type for operator")); } else { mp_raise_TypeError_varg( - translate("unsupported types for %q: '%s', '%s'"), - mp_binary_op_method_name[op], mp_obj_get_type_str(lhs), mp_obj_get_type_str(rhs)); + translate("unsupported types for %q: '%q', '%q'"), + mp_binary_op_method_name[op], mp_obj_get_type_qstr(lhs), mp_obj_get_type_qstr(rhs)); } zero_division: @@ -627,7 +627,7 @@ mp_obj_t mp_call_function_n_kw(mp_obj_t fun_in, size_t n_args, size_t n_kw, cons if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { mp_raise_TypeError(translate("object not callable")); } else { - mp_raise_TypeError_varg(translate("'%s' object is not callable"), mp_obj_get_type_str(fun_in)); + mp_raise_TypeError_varg(translate("'%q' object is not callable"), mp_obj_get_type_qstr(fun_in)); } } @@ -1104,8 +1104,8 @@ void mp_load_method(mp_obj_t base, qstr attr, mp_obj_t *dest) { ((mp_obj_type_t*)MP_OBJ_TO_PTR(base))->name, attr)); } else { nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_AttributeError, - translate("'%s' object has no attribute '%q'"), - mp_obj_get_type_str(base), attr)); + translate("'%q' object has no attribute '%q'"), + mp_obj_get_type_qstr(base), attr)); } } } @@ -1172,8 +1172,8 @@ void mp_store_attr(mp_obj_t base, qstr attr, mp_obj_t value) { mp_raise_AttributeError(translate("no such attribute")); } else { nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_AttributeError, - translate("'%s' object cannot assign attribute '%q'"), - mp_obj_get_type_str(base), attr)); + translate("'%q' object cannot assign attribute '%q'"), + mp_obj_get_type_qstr(base), attr)); } } @@ -1213,7 +1213,7 @@ mp_obj_t mp_getiter(mp_obj_t o_in, mp_obj_iter_buf_t *iter_buf) { mp_raise_TypeError(translate("object not iterable")); } else { mp_raise_TypeError_varg( - translate("'%s' object is not iterable"), mp_obj_get_type_str(o_in)); + translate("'%q' object is not iterable"), mp_obj_get_type_qstr(o_in)); } } @@ -1234,8 +1234,8 @@ mp_obj_t mp_iternext_allow_raise(mp_obj_t o_in) { if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { mp_raise_TypeError(translate("object not an iterator")); } else { - mp_raise_TypeError_varg(translate("'%s' object is not an iterator"), - mp_obj_get_type_str(o_in)); + mp_raise_TypeError_varg(translate("'%q' object is not an iterator"), + mp_obj_get_type_qstr(o_in)); } } } @@ -1270,8 +1270,8 @@ mp_obj_t mp_iternext(mp_obj_t o_in) { if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { mp_raise_TypeError(translate("object not an iterator")); } else { - mp_raise_TypeError_varg(translate("'%s' object is not an iterator"), - mp_obj_get_type_str(o_in)); + mp_raise_TypeError_varg(translate("'%q' object is not an iterator"), + mp_obj_get_type_qstr(o_in)); } } } From c849b781c0186d93a1165784ce4e22d2178d5ccb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 4 Aug 2020 11:27:36 -0500 Subject: [PATCH 0481/1293] Combine 'index out of range' messages --- extmod/moductypes.c | 2 +- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 2 +- ports/cxd56/common-hal/pulseio/PulseIn.c | 2 +- ports/mimxrt10xx/common-hal/pulseio/PulseIn.c | 2 +- ports/nrf/common-hal/pulseio/PulseIn.c | 2 +- ports/stm/common-hal/pulseio/PulseIn.c | 2 +- py/objstr.c | 4 ++-- py/objstrunicode.c | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/extmod/moductypes.c b/extmod/moductypes.c index a384f1e2c2..dc8ac4c721 100644 --- a/extmod/moductypes.c +++ b/extmod/moductypes.c @@ -520,7 +520,7 @@ STATIC mp_obj_t uctypes_struct_subscr(mp_obj_t base_in, mp_obj_t index_in, mp_ob uint val_type = GET_TYPE(arr_sz, VAL_TYPE_BITS); arr_sz &= VALUE_MASK(VAL_TYPE_BITS); if (index >= arr_sz) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_IndexError, translate("struct: index out of range"))); + mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_struct); } if (t->len == 2) { diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index be8165a5aa..81ccc4fecf 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -330,7 +330,7 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t* self, } if (index < 0 || index >= self->len) { common_hal_mcu_enable_interrupts(); - mp_raise_IndexError(translate("index out of range")); + mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_PulseIn); } uint16_t value = self->buffer[(self->start + index) % self->maxlen]; common_hal_mcu_enable_interrupts(); diff --git a/ports/cxd56/common-hal/pulseio/PulseIn.c b/ports/cxd56/common-hal/pulseio/PulseIn.c index 045acc9d2c..e54b5083db 100644 --- a/ports/cxd56/common-hal/pulseio/PulseIn.c +++ b/ports/cxd56/common-hal/pulseio/PulseIn.c @@ -190,7 +190,7 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t *self, int16_ } if (index < 0 || index >= self->len) { common_hal_mcu_enable_interrupts(); - mp_raise_IndexError(translate("index out of range")); + mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_PulseIn); } uint16_t value = self->buffer[(self->start + index) % self->maxlen]; common_hal_mcu_enable_interrupts(); diff --git a/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c b/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c index e89a49e808..f5757ab788 100644 --- a/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c +++ b/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c @@ -237,7 +237,7 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t* self, // } // if (index < 0 || index >= self->len) { // common_hal_mcu_enable_interrupts(); -// mp_raise_IndexError(translate("index out of range")); +// mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_PulseIn); // } // uint16_t value = self->buffer[(self->start + index) % self->maxlen]; // common_hal_mcu_enable_interrupts(); diff --git a/ports/nrf/common-hal/pulseio/PulseIn.c b/ports/nrf/common-hal/pulseio/PulseIn.c index 80ff2c5291..c5de3a4b43 100644 --- a/ports/nrf/common-hal/pulseio/PulseIn.c +++ b/ports/nrf/common-hal/pulseio/PulseIn.c @@ -271,7 +271,7 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t* self, int16_ if ( !self->paused ) { nrfx_gpiote_in_event_enable(self->pin, true); } - mp_raise_IndexError(translate("index out of range")); + mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_PulseIn); } uint16_t value = self->buffer[(self->start + index) % self->maxlen]; diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c index b43fdd5547..a667cf0102 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.c +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -249,7 +249,7 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t* self, int16_ } if (index < 0 || index >= self->len) { HAL_NVIC_EnableIRQ(self->irq); - mp_raise_IndexError(translate("index out of range")); + mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_PulseIn); } uint16_t value = self->buffer[(self->start + index) % self->maxlen]; HAL_NVIC_EnableIRQ(self->irq); diff --git a/py/objstr.c b/py/objstr.c index 572bf299d4..edb562df27 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -1076,7 +1076,7 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar } field_name = str_to_int(field_name, field_name_top, &index); if ((uint)index >= n_args - 1) { - mp_raise_IndexError(translate("tuple index out of range")); + mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_tuple); } arg = args[index + 1]; *arg_i = -1; @@ -1104,7 +1104,7 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar } } if ((uint)*arg_i >= n_args - 1) { - mp_raise_IndexError(translate("tuple index out of range")); + mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_tuple); } arg = args[(*arg_i) + 1]; (*arg_i)++; diff --git a/py/objstrunicode.c b/py/objstrunicode.c index 19d89a31ce..50250abfa9 100644 --- a/py/objstrunicode.c +++ b/py/objstrunicode.c @@ -162,7 +162,7 @@ const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, s if (is_slice) { return self_data; } - mp_raise_IndexError(translate("string index out of range")); + mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_str); } if (!UTF8_IS_CONT(*s)) { ++i; @@ -181,7 +181,7 @@ const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, s if (is_slice) { return top; } - mp_raise_IndexError(translate("string index out of range")); + mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_str); } // Then check completion if (i-- == 0) { From d0427cf60c150a51f652f145425aeb4df9ee602b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 4 Aug 2020 11:40:47 -0500 Subject: [PATCH 0482/1293] Combine some "safe mode" messages --- main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 8c5c9ac37d..11399bbb57 100755 --- a/main.c +++ b/main.c @@ -234,7 +234,8 @@ bool run_code_py(safe_mode_t safe_mode) { if (autoreload_is_enabled()) { serial_write_compressed(translate("Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.\n")); } else if (safe_mode != NO_SAFE_MODE) { - serial_write_compressed(translate("Running in safe mode! Auto-reload is off.\n")); + serial_write_compressed(translate("Running in safe mode! ")); + serial_write_compressed(translate("Auto-reload is off.\n")); } else if (!autoreload_is_enabled()) { serial_write_compressed(translate("Auto-reload is off.\n")); } @@ -250,7 +251,8 @@ bool run_code_py(safe_mode_t safe_mode) { bool found_main = false; if (safe_mode != NO_SAFE_MODE) { - serial_write_compressed(translate("Running in safe mode! Not running saved code.\n")); + serial_write_compressed(translate("Running in safe mode! ")); + serial_write_compressed(translate("Not running saved code.\n")); } else { new_status_color(MAIN_RUNNING); From 024c8da57869b2aa49004f091520aaf5dacb26e6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 4 Aug 2020 11:41:04 -0500 Subject: [PATCH 0483/1293] Combine some "can't convert" messages --- py/obj.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py/obj.c b/py/obj.c index 41fdaf6330..6fa11f0253 100644 --- a/py/obj.c +++ b/py/obj.c @@ -264,7 +264,7 @@ mp_int_t mp_obj_get_int(mp_const_obj_t arg) { return mp_obj_int_get_checked(arg); } else { if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { - mp_raise_TypeError(translate("can't convert to int")); + mp_raise_TypeError_varg(translate("can't convert to %q"), MP_QSTR_int); } else { mp_raise_TypeError_varg( translate("can't convert %q to %q"), mp_obj_get_type_qstr(arg), MP_QSTR_int); @@ -327,7 +327,7 @@ mp_float_t mp_obj_get_float(mp_obj_t arg) { if (!mp_obj_get_float_maybe(arg, &val)) { if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { - mp_raise_TypeError(translate("can't convert to float")); + mp_raise_TypeError_varg(translate("can't convert to %q"), MP_QSTR_float); } else { mp_raise_TypeError_varg( translate("can't convert %q to %q"), mp_obj_get_type_qstr(arg), MP_QSTR_float); @@ -360,7 +360,7 @@ void mp_obj_get_complex(mp_obj_t arg, mp_float_t *real, mp_float_t *imag) { mp_obj_complex_get(arg, real, imag); } else { if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { - mp_raise_TypeError(translate("can't convert to complex")); + mp_raise_TypeError_varg(translate("can't convert to %q"), MP_QSTR_complex); } else { mp_raise_TypeError_varg( translate("can't convert %q to %q"), mp_obj_get_type_qstr(arg), MP_QSTR_complex); From a85b6441fc6373689d793cd0904382464a5d58b7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 4 Aug 2020 12:39:55 -0500 Subject: [PATCH 0484/1293] main: Drop "double extension" detection if not FULL_BUILD This saves nearly 200 bytes. Curiously, it also saves RAM. --- main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.c b/main.c index 11399bbb57..1363ce636e 100755 --- a/main.c +++ b/main.c @@ -257,20 +257,24 @@ bool run_code_py(safe_mode_t safe_mode) { new_status_color(MAIN_RUNNING); static const char *supported_filenames[] = STRING_LIST("code.txt", "code.py", "main.py", "main.txt"); + #if CIRCUITPY_FULL_BUILD static const char *double_extension_filenames[] = STRING_LIST("code.txt.py", "code.py.txt", "code.txt.txt","code.py.py", "main.txt.py", "main.py.txt", "main.txt.txt","main.py.py"); + #endif stack_resize(); filesystem_flush(); supervisor_allocation* heap = allocate_remaining_memory(); start_mp(heap); found_main = maybe_run_list(supported_filenames, &result); + #if CIRCUITPY_FULL_BUILD if (!found_main){ found_main = maybe_run_list(double_extension_filenames, &result); if (found_main) { serial_write_compressed(translate("WARNING: Your code filename has two extensions\n")); } } + #endif cleanup_after_vm(heap); if (result.return_code & PYEXEC_FORCED_EXIT) { From d92a77fdd3864d51b5774d65d4020965b85e095d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 4 Aug 2020 14:21:36 -0500 Subject: [PATCH 0485/1293] main: Allow these arrays to reside in ROM The missing second "const" made these mutable arrays pointing to const string data. --- main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index 1363ce636e..d206d4f160 100755 --- a/main.c +++ b/main.c @@ -181,7 +181,7 @@ void stop_mp(void) { // 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. -const char* first_existing_file_in_list(const char ** filenames) { +const char* first_existing_file_in_list(const char * const * filenames) { for (int i = 0; filenames[i] != (char*)""; i++) { mp_import_stat_t stat = mp_import_stat(filenames[i]); if (stat == MP_IMPORT_STAT_FILE) { @@ -191,7 +191,7 @@ const char* first_existing_file_in_list(const char ** filenames) { return NULL; } -bool maybe_run_list(const char ** filenames, pyexec_result_t* exec_result) { +bool maybe_run_list(const char * const * filenames, pyexec_result_t* exec_result) { const char* filename = first_existing_file_in_list(filenames); if (filename == NULL) { return false; @@ -256,9 +256,9 @@ bool run_code_py(safe_mode_t safe_mode) { } else { new_status_color(MAIN_RUNNING); - static const char *supported_filenames[] = STRING_LIST("code.txt", "code.py", "main.py", "main.txt"); + static const char * const supported_filenames[] = STRING_LIST("code.txt", "code.py", "main.py", "main.txt"); #if CIRCUITPY_FULL_BUILD - static const char *double_extension_filenames[] = STRING_LIST("code.txt.py", "code.py.txt", "code.txt.txt","code.py.py", + static const char * const double_extension_filenames[] = STRING_LIST("code.txt.py", "code.py.txt", "code.txt.txt","code.py.py", "main.txt.py", "main.py.txt", "main.txt.txt","main.py.py"); #endif @@ -343,7 +343,7 @@ void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { // If not in safe mode, run boot before initing USB and capture output in a // file. if (filesystem_present() && safe_mode == NO_SAFE_MODE && MP_STATE_VM(vfs_mount_table) != NULL) { - static const char *boot_py_filenames[] = STRING_LIST("settings.txt", "settings.py", "boot.py", "boot.txt"); + static const char * const boot_py_filenames[] = STRING_LIST("settings.txt", "settings.py", "boot.py", "boot.txt"); new_status_color(BOOT_RUNNING); From 710c2dc54b7c97088890b084f0ed0ab5132011e8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 4 Aug 2020 12:46:07 -0500 Subject: [PATCH 0486/1293] safe_mode: Exclude NORDIC_SOFT_DEVICE_ASSERT str if possible --- supervisor/shared/safe_mode.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index a167ab392c..3275cc66f3 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -151,9 +151,13 @@ void print_safe_mode_message(safe_mode_t reason) { case GC_ALLOC_OUTSIDE_VM: serial_write_compressed(translate("Attempted heap allocation when MicroPython VM not running.")); break; +#ifdef SOFTDEVICE_PRESENT + // defined in ports/nrf/bluetooth/bluetooth_common.mk + // will print "Unknown reason" if somehow encountered on other ports case NORDIC_SOFT_DEVICE_ASSERT: serial_write_compressed(translate("Nordic Soft Device failure assertion.")); break; +#endif case FLASH_WRITE_FAIL: serial_write_compressed(translate("Failed to write internal flash.")); break; From d3fb6c96da9dc38ea24a221e11f05cdbbddb34c9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 4 Aug 2020 13:06:46 -0500 Subject: [PATCH 0487/1293] libm: ef_rem_pio2.c: Save ROM-tables at the expense of speed This function computes the remainder of a value `x` modulo pi/2, to high precision. It does this by dividing the flotaing point values into several ranges by magnitude, and applies successively slower but more accurate algorithms. The last two steps, one covering values up to around 2^7 * pi/2 (called "medium size") and a final one covering all possible float values, require big tables. By eliminating the "medium size" case, a table and some code are removed from the binary. This makes some cases take longer, but saves hundreds of bytes. It does _NOT_ affect the result, only the speed. ``` [desktop python] >>> sum(math.sin(2.**i) for i in range(21)) 1.4206898748939305 [trinket m0, before change to ef_rem_pio2.c] >>> sum(math.sin(2.**i) for i in range(21)) 1.42069 [trinket m0, after change to ef_rem_pio2.c] >>> sum(math.sin(2.**i) for i in range(21)) 1.42069 ``` --- lib/libm/ef_rem_pio2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/libm/ef_rem_pio2.c b/lib/libm/ef_rem_pio2.c index bbb73097d6..c6dbe45878 100644 --- a/lib/libm/ef_rem_pio2.c +++ b/lib/libm/ef_rem_pio2.c @@ -145,6 +145,7 @@ pio2_3t = 6.1232342629e-17; /* 0x248d3132 */ return -1; } } +#if CIRCUITPY_FULL_BUILD if(ix<=0x43490f80) { /* |x| ~<= 2^7*(pi/2), medium size */ t = fabsf(x); n = (__int32_t) (t*invpio2+half); @@ -180,6 +181,11 @@ pio2_3t = 6.1232342629e-17; /* 0x248d3132 */ if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;} else return n; } +#else + // Suppress "defined but not used" diagnostics + (void) j; (void) fn; (void) r; (void) t; (void) w; (void) pio2_3t; + (void) pio2_3; (void) invpio2; (void)half; (void)npio2_hw; +#endif /* * all other (large) arguments */ From c0b32976e8bff4a04cd4f172535e3b153143b417 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 4 Aug 2020 13:12:44 -0500 Subject: [PATCH 0488/1293] libm: rem_pio2: Reduce size of static array This array was of 32-bit values, but the entries were only ever in the 0-255 range. Convert to uint8_t. Testing performed: The result of the sum-of-sin was unchanged >>> import math; sum(math.sin(2.**i) for i in range(21)) 1.42069 --- lib/libm/ef_rem_pio2.c | 4 ++-- lib/libm/fdlibm.h | 2 +- lib/libm/kf_rem_pio2.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libm/ef_rem_pio2.c b/lib/libm/ef_rem_pio2.c index c6dbe45878..1a95475032 100644 --- a/lib/libm/ef_rem_pio2.c +++ b/lib/libm/ef_rem_pio2.c @@ -35,9 +35,9 @@ * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi */ #ifdef __STDC__ -static const __int32_t two_over_pi[] = { +static const __uint8_t two_over_pi[] = { #else -static __int32_t two_over_pi[] = { +static __uint8_t two_over_pi[] = { #endif 0xA2, 0xF9, 0x83, 0x6E, 0x4E, 0x44, 0x15, 0x29, 0xFC, 0x27, 0x57, 0xD1, 0xF5, 0x34, 0xDD, 0xC0, 0xDB, 0x62, diff --git a/lib/libm/fdlibm.h b/lib/libm/fdlibm.h index 67bc622ea5..91698a6f9c 100644 --- a/lib/libm/fdlibm.h +++ b/lib/libm/fdlibm.h @@ -188,7 +188,7 @@ extern float __ieee754_scalbf __P((float,float)); extern float __kernel_sinf __P((float,float,int)); extern float __kernel_cosf __P((float,float)); extern float __kernel_tanf __P((float,float,int)); -extern int __kernel_rem_pio2f __P((float*,float*,int,int,int,const __int32_t*)); +extern int __kernel_rem_pio2f __P((float*,float*,int,int,int,const __uint8_t*)); /* A union which permits us to convert between a float and a 32 bit int. */ diff --git a/lib/libm/kf_rem_pio2.c b/lib/libm/kf_rem_pio2.c index 62aa242bc7..b27e47ea89 100644 --- a/lib/libm/kf_rem_pio2.c +++ b/lib/libm/kf_rem_pio2.c @@ -62,10 +62,10 @@ two8 = 2.5600000000e+02, /* 0x43800000 */ twon8 = 3.9062500000e-03; /* 0x3b800000 */ #ifdef __STDC__ - int __kernel_rem_pio2f(float *x, float *y, int e0, int nx, int prec, const __int32_t *ipio2) + int __kernel_rem_pio2f(float *x, float *y, int e0, int nx, int prec, const __uint8_t *ipio2) #else int __kernel_rem_pio2f(x,y,e0,nx,prec,ipio2) - float x[], y[]; int e0,nx,prec; __int32_t ipio2[]; + float x[], y[]; int e0,nx,prec; __uint8_t ipio2[]; #endif { __int32_t jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih; From 65e26f4a068129662c9793fd070530a35cc568b1 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 4 Aug 2020 14:05:32 -0500 Subject: [PATCH 0489/1293] py: mp_obj_get_type_qstr as macro saves 24 bytes --- py/obj.c | 4 ---- py/obj.h | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/py/obj.c b/py/obj.c index 6fa11f0253..0cff2f1a4b 100644 --- a/py/obj.c +++ b/py/obj.c @@ -57,10 +57,6 @@ mp_obj_type_t *mp_obj_get_type(mp_const_obj_t o_in) { } } -qstr mp_obj_get_type_qstr(mp_const_obj_t o_in) { - return mp_obj_get_type(o_in)->name; -} - const char *mp_obj_get_type_str(mp_const_obj_t o_in) { return qstr_str(mp_obj_get_type_qstr(o_in)); } diff --git a/py/obj.h b/py/obj.h index 656190cb31..e9d867f77b 100644 --- a/py/obj.h +++ b/py/obj.h @@ -680,7 +680,7 @@ mp_obj_t mp_obj_new_memoryview(byte typecode, size_t nitems, void *items); mp_obj_type_t *mp_obj_get_type(mp_const_obj_t o_in); const char *mp_obj_get_type_str(mp_const_obj_t o_in); -qstr mp_obj_get_type_qstr(mp_const_obj_t o_in); +#define mp_obj_get_type_qstr(o_in) (mp_obj_get_type((o_in))->name) bool mp_obj_is_subclass_fast(mp_const_obj_t object, mp_const_obj_t classinfo); // arguments should be type objects mp_obj_t mp_instance_cast_to_native_base(mp_obj_t self_in, mp_const_obj_t native_type); From 6669cedf5ba257c23218a680e2b1d054de5179fb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 4 Aug 2020 13:58:43 -0500 Subject: [PATCH 0490/1293] make translate --- locale/circuitpython.pot | 195 +++++++++++++-------------------------- 1 file changed, 66 insertions(+), 129 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 5ed32d6382..e40b8a614e 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-30 07:23-0500\n" +"POT-Creation-Date: 2020-08-04 13:58-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -66,12 +66,16 @@ msgstr "" msgid "%q in use" msgstr "" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c msgid "%q index out of range" msgstr "" #: py/obj.c -msgid "%q indices must be integers, not %s" +msgid "%q indices must be integers, not %q" msgstr "" #: shared-bindings/vectorio/Polygon.c @@ -110,6 +114,42 @@ msgstr "" msgid "'%q' argument required" msgstr "" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -160,48 +200,6 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "" @@ -1235,6 +1233,10 @@ msgstr "" msgid "Not playing" msgstr "" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1320,10 +1322,6 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1396,11 +1394,7 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" +msgid "Running in safe mode! " msgstr "" #: shared-module/sdcardio/SDCard.c @@ -1761,8 +1755,7 @@ msgid "__init__() should return None" msgstr "" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" +msgid "__init__() should return None, not '%q'" msgstr "" #: py/objobject.c @@ -1916,7 +1909,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "" @@ -1948,47 +1941,16 @@ msgstr "" msgid "can't assign to expression" msgstr "" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "" - #: py/obj.c -msgid "can't convert to complex" -msgstr "" - -#: py/obj.c -msgid "can't convert to float" -msgstr "" - -#: py/obj.c -msgid "can't convert to int" +msgid "can't convert to %q" msgstr "" #: py/objstr.c @@ -2396,7 +2358,7 @@ msgstr "" msgid "function missing required positional argument #%d" msgstr "" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "" @@ -2445,10 +2407,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "" @@ -2804,8 +2763,7 @@ msgid "number of points must be at least 2" msgstr "" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" +msgid "object '%q' is not a tuple or list" msgstr "" #: py/obj.c @@ -2841,8 +2799,7 @@ msgid "object not iterable" msgstr "" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" +msgid "object of type '%q' has no len()" msgstr "" #: py/obj.c @@ -2935,20 +2892,10 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +#, c-format +msgid "pop from empty %s" msgstr "" #: py/objint_mpz.c @@ -3105,12 +3052,7 @@ msgid "stream operation not supported" msgstr "" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" +msgid "string indices must be integers, not %q" msgstr "" #: py/stream.c @@ -3121,10 +3063,6 @@ msgstr "" msgid "struct: cannot index" msgstr "" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "" @@ -3194,7 +3132,7 @@ msgstr "" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "" @@ -3261,8 +3199,7 @@ msgid "unknown conversion specifier %c" msgstr "" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" +msgid "unknown format code '%c' for object of type '%q'" msgstr "" #: py/compile.c @@ -3302,7 +3239,7 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "" #: py/runtime.c -msgid "unsupported type for %q: '%s'" +msgid "unsupported type for %q: '%q'" msgstr "" #: py/runtime.c @@ -3310,7 +3247,7 @@ msgid "unsupported type for operator" msgstr "" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" msgstr "" #: py/objint.c From ac95106b8867072cb40043a1a4298aa0317f101c Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 4 Aug 2020 18:24:37 -0400 Subject: [PATCH 0491/1293] service discovery works; need to work on char and descriptor discovery --- .../common-hal/_bleio/Characteristic.c | 2 ++ devices/ble_hci/common-hal/_bleio/Service.c | 8 ++++- devices/ble_hci/common-hal/_bleio/Service.h | 2 +- devices/ble_hci/common-hal/_bleio/__init__.c | 4 +++ devices/ble_hci/common-hal/_bleio/__init__.h | 2 +- devices/ble_hci/common-hal/_bleio/att.c | 36 +++++++++++-------- devices/ble_hci/common-hal/_bleio/att.h | 2 ++ devices/ble_hci/common-hal/_bleio/hci.c | 8 +++-- devices/ble_hci/common-hal/_bleio/hci.h | 2 +- main.c | 8 +++++ ports/atmel-samd/Makefile | 2 +- 11 files changed, 53 insertions(+), 23 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Characteristic.c b/devices/ble_hci/common-hal/_bleio/Characteristic.c index e2cdac08cc..2f4a81f9a2 100644 --- a/devices/ble_hci/common-hal/_bleio/Characteristic.c +++ b/devices/ble_hci/common-hal/_bleio/Characteristic.c @@ -149,6 +149,8 @@ void common_hal_bleio_characteristic_add_descriptor(bleio_characteristic_obj_t * } descriptor->handle = bleio_adapter_add_attribute(&common_hal_bleio_adapter_obj, MP_OBJ_TO_PTR(descriptor)); + // Include this desriptor in the service handles range. + self->service->end_handle = descriptor->handle; // Link together all the descriptors for this characteristic. descriptor->next = self->descriptor_list; diff --git a/devices/ble_hci/common-hal/_bleio/Service.c b/devices/ble_hci/common-hal/_bleio/Service.c index c683557912..abccfd5c4e 100644 --- a/devices/ble_hci/common-hal/_bleio/Service.c +++ b/devices/ble_hci/common-hal/_bleio/Service.c @@ -42,6 +42,8 @@ uint32_t _common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uu vm_used_ble = true; self->handle = bleio_adapter_add_attribute(&common_hal_bleio_adapter_obj, MP_OBJ_TO_PTR(self)); + self->start_handle = self->handle; + self->end_handle = self->handle; if (self->handle == BLE_GATT_HANDLE_INVALID) { return 1; } @@ -90,10 +92,12 @@ void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, } characteristic->decl_handle = bleio_adapter_add_attribute( &common_hal_bleio_adapter_obj, MP_OBJ_TO_PTR(characteristic)); - // This is the value handle + // This is the value handle. characteristic->handle = bleio_adapter_add_attribute( &common_hal_bleio_adapter_obj, MP_OBJ_TO_PTR(characteristic)); + self->end_handle = characteristic->handle; + if (characteristic->props & (CHAR_PROP_NOTIFY | CHAR_PROP_INDICATE)) { // We need a CCCD. bleio_descriptor_obj_t *cccd = m_new_obj(bleio_descriptor_obj_t); @@ -107,6 +111,8 @@ void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, cccd->handle = cccd_handle; characteristic->cccd_handle = cccd_handle; common_hal_bleio_characteristic_add_descriptor(characteristic, cccd); + + self->end_handle = cccd_handle; } // #if CIRCUITPY_VERBOSE_BLE diff --git a/devices/ble_hci/common-hal/_bleio/Service.h b/devices/ble_hci/common-hal/_bleio/Service.h index bb8bc61edc..11e7d1c960 100644 --- a/devices/ble_hci/common-hal/_bleio/Service.h +++ b/devices/ble_hci/common-hal/_bleio/Service.h @@ -43,7 +43,7 @@ typedef struct bleio_service_obj { // A local service doesn't know the connection. mp_obj_t connection; mp_obj_list_t *characteristic_list; - // Range of attribute handles of this remote service. + // Range of attribute handles of this service. uint16_t start_handle; uint16_t end_handle; struct bleio_service_obj* next; diff --git a/devices/ble_hci/common-hal/_bleio/__init__.c b/devices/ble_hci/common-hal/_bleio/__init__.c index 7139e61932..ee953cfeb9 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.c +++ b/devices/ble_hci/common-hal/_bleio/__init__.c @@ -38,6 +38,8 @@ #include "shared-bindings/_bleio/UUID.h" #include "supervisor/shared/bluetooth.h" +bool vm_used_ble; + void check_hci_error(hci_result_t result) { switch (result) { case HCI_OK: @@ -110,6 +112,8 @@ void check_hci_error(hci_result_t result) { // Turn off BLE on a reset or reload. void bleio_reset() { + bleio_hci_reset(); + if (!common_hal_bleio_adapter_get_enabled(&common_hal_bleio_adapter_obj)) { return; } diff --git a/devices/ble_hci/common-hal/_bleio/__init__.h b/devices/ble_hci/common-hal/_bleio/__init__.h index 18b4289e9a..5873675af8 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.h +++ b/devices/ble_hci/common-hal/_bleio/__init__.h @@ -57,6 +57,6 @@ void check_gatt_status(uint16_t gatt_status); void check_sec_status(uint8_t sec_status); // Track if the user code modified the BLE state to know if we need to undo it on reload. -bool vm_used_ble; +extern bool vm_used_ble; #endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_INIT_H diff --git a/devices/ble_hci/common-hal/_bleio/att.c b/devices/ble_hci/common-hal/_bleio/att.c index 08324c37ed..ba6c7c3d06 100644 --- a/devices/ble_hci/common-hal/_bleio/att.c +++ b/devices/ble_hci/common-hal/_bleio/att.c @@ -116,7 +116,7 @@ STATIC void check_and_save_expected_rsp(uint16_t conn_handle, uint8_t opcode, ui } } -void att_init(void) { +void bleio_att_reset(void) { max_mtu = BT_ATT_DEFAULT_LE_MTU; timeout = 5000; long_write_handle = BLE_GATT_HANDLE_INVALID; @@ -884,6 +884,8 @@ void process_read_by_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, struct bt_att_read_group_req *req = (struct bt_att_read_group_req *) data; uint16_t type_uuid = req->uuid[0] | (req->uuid[1] << 8); + // We only support returning services for BT_ATT_OP_READ_GROUP_REQ, which is typically used + // for service discovery. if (dlen != sizeof(struct bt_att_read_group_req) + sizeof(type_uuid) || (type_uuid != BLE_TYPE_PRIMARY_SERVICE && type_uuid != BLE_TYPE_SECONDARY_SERVICE)) { @@ -897,7 +899,7 @@ void process_read_by_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, } rsp_t; uint8_t rsp_bytes[mtu]; - rsp_t *rsp = (rsp_t *) &rsp_bytes; + rsp_t *rsp = (rsp_t *) rsp_bytes; rsp->h.code = BT_ATT_OP_READ_GROUP_RSP; rsp->r.len = 0; @@ -907,13 +909,22 @@ void process_read_by_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, bool no_data = true; // All the data chunks must have uuid's that are the same size. - // Keep track fo the first one to make sure. + // Keep track of the first one to make sure. size_t sizeof_first_service_uuid = 0; + + // Size of a single bt_att_group_data chunk. Start with the intial size, and + // add the uuid size in the loop below. + size_t data_length = sizeof(struct bt_att_group_data); + const uint16_t max_attribute_handle = bleio_adapter_max_attribute_handle(&common_hal_bleio_adapter_obj); for (uint16_t handle = req->start_handle; handle <= max_attribute_handle && handle <= req->end_handle; handle++) { - no_data = false; + + if (rsp_length + data_length > mtu) { + // The next possible bt_att_group_data chunk won't fit. The response is full. + break; + } mp_obj_t *attribute_obj = bleio_adapter_get_attribute(&common_hal_bleio_adapter_obj, handle); if (type_uuid != bleio_attribute_type_uuid(attribute_obj)) { @@ -925,33 +936,28 @@ void process_read_by_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, // Is this a 16-bit or a 128-bit uuid? It must match in size with any previous attribute // in this transmission. - const uint8_t sizeof_service_uuid = common_hal_bleio_uuid_get_size(service->uuid) / 8; + const uint32_t sizeof_service_uuid = common_hal_bleio_uuid_get_size(service->uuid) / 8; if (sizeof_first_service_uuid == 0) { sizeof_first_service_uuid = sizeof_service_uuid; + data_length += sizeof_service_uuid; } else if (sizeof_first_service_uuid != sizeof_service_uuid) { - // Mismatched sizes. Transmit just what we have so far in this batch. + // Mismatched sizes, which can't be in the same batch. + // Transmit just what we have so far in this batch. break; } - // Size of bt_att_group_data chunk with uuid. - const uint16_t data_length = sizeof(struct bt_att_group_data) + sizeof_service_uuid; - - if (rsp_length + data_length > mtu) { - // No room for another bt_att_group_data chunk. - break; - } // Pass the length of ONE bt_att_group_data chunk. There may be multiple ones in this transmission. rsp->r.len = data_length; - uint8_t group_data_bytes[data_length]; - struct bt_att_group_data *group_data = (struct bt_att_group_data *) group_data_bytes; + struct bt_att_group_data *group_data = (struct bt_att_group_data *) &rsp_bytes[rsp_length]; group_data->start_handle = service->start_handle; group_data->end_handle = service->end_handle; common_hal_bleio_uuid_pack_into(service->uuid, group_data->value); rsp_length += data_length; + no_data = false; } if (no_data) { diff --git a/devices/ble_hci/common-hal/_bleio/att.h b/devices/ble_hci/common-hal/_bleio/att.h index 6cf9b305b2..48f7836e0e 100644 --- a/devices/ble_hci/common-hal/_bleio/att.h +++ b/devices/ble_hci/common-hal/_bleio/att.h @@ -30,6 +30,8 @@ #include "hci_include/att.h" #include "hci_include/att_internal.h" +void bleio_att_reset(void); + //FIX BLEDevice att_central(void); //FIX BLERemoteDevice* att_device(uint8_t address_type, const uint8_t address[6]); //FIX void att_set_event_handler(BLEDeviceEvent event, BLEDeviceEventHandler eventHandler); diff --git a/devices/ble_hci/common-hal/_bleio/hci.c b/devices/ble_hci/common-hal/_bleio/hci.c index 7b4adaa79a..52452a26d1 100644 --- a/devices/ble_hci/common-hal/_bleio/hci.c +++ b/devices/ble_hci/common-hal/_bleio/hci.c @@ -272,18 +272,20 @@ STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt_data[]) } } -void hci_init(void) { +void bleio_hci_reset(void) { rx_idx = 0; pending_pkt = 0; hci_poll_in_progress = false; + + bleio_att_reset(); } hci_result_t hci_poll_for_incoming_pkt_timeout(uint32_t timeout_msecs) { uint64_t start = supervisor_ticks_ms64(); - hci_result_t result; + hci_result_t result = HCI_OK; - while (supervisor_ticks_ms64() -start < timeout_msecs) { + while (supervisor_ticks_ms64() - start < timeout_msecs) { result = hci_poll_for_incoming_pkt(); RUN_BACKGROUND_TASKS; } diff --git a/devices/ble_hci/common-hal/_bleio/hci.h b/devices/ble_hci/common-hal/_bleio/hci.h index 89a2b3304a..d907a84b7d 100644 --- a/devices/ble_hci/common-hal/_bleio/hci.h +++ b/devices/ble_hci/common-hal/_bleio/hci.h @@ -39,7 +39,7 @@ typedef int hci_result_t; #define HCI_WRITE_ERROR (-5) #define HCI_ATT_ERROR (-6) -void hci_init(void); +void bleio_hci_reset(void); hci_result_t hci_disconnect(uint16_t handle); diff --git a/main.c b/main.c index 8c5c9ac37d..4dd93374e3 100755 --- a/main.c +++ b/main.c @@ -105,6 +105,12 @@ void do_str(const char *src, mp_parse_input_kind_t input_kind) { static size_t PLACE_IN_DTCM_BSS(_pystack[CIRCUITPY_PYSTACK_SIZE / sizeof(size_t)]); #endif +static void reset_devices(void) { +#if CIRCUITPY_BLEIO_HCI + bleio_reset(); +#endif +} + void start_mp(supervisor_allocation* heap) { reset_status_led(); autoreload_stop(); @@ -459,6 +465,8 @@ int __attribute__((used)) main(void) { // Reset everything and prep MicroPython to run boot.py. reset_port(); + // Port-independent devices, like CIRCUITPY_BLEIO_HCI. + reset_devices(); reset_board(); // Turn on autoreload by default but before boot.py in case it wants to change it. diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index db26df570b..038585fc3a 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -112,7 +112,7 @@ CFLAGS += $(OPTIMIZATION_FLAGS) -DNDEBUG $(echo PERIPHERALS_CHIP_FAMILY=$(PERIPHERALS_CHIP_FAMILY)) #Debugging/Optimization ifeq ($(DEBUG), 1) - CFLAGS += -ggdb -Og + CFLAGS += -ggdb3 -Og # You may want to disable -flto if it interferes with debugging. CFLAGS += -flto -flto-partition=none # You may want to enable these flags to make setting breakpoints easier. From 14b3b51c58ca368227d8890a2aa32e7acb94175b Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 4 Aug 2020 18:40:24 -0400 Subject: [PATCH 0492/1293] Rework build flags, prevent idf errors --- .../esp32s2/common-hal/microcontroller/Pin.c | 4 +++ ports/esp32s2/common-hal/pulseio/PWMOut.c | 17 ++++++++++--- ports/esp32s2/mpconfigport.mk | 25 ++++++++----------- ports/esp32s2/peripherals/rmt.c | 1 + supervisor/shared/rgb_led_status.c | 1 + 5 files changed, 29 insertions(+), 19 deletions(-) diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index 2b2b70a45a..03a83cfe67 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -98,6 +98,10 @@ void claim_pin(const mcu_pin_obj_t* pin) { #endif } +void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) { + claim_pin(pin); +} + bool pin_number_is_free(gpio_num_t pin_number) { #ifdef MICROPY_HW_NEOPIXEL if (pin_number == MICROPY_HW_NEOPIXEL->number) { diff --git a/ports/esp32s2/common-hal/pulseio/PWMOut.c b/ports/esp32s2/common-hal/pulseio/PWMOut.c index f38bd44340..3172023b6b 100644 --- a/ports/esp32s2/common-hal/pulseio/PWMOut.c +++ b/ports/esp32s2/common-hal/pulseio/PWMOut.c @@ -39,13 +39,17 @@ STATIC bool never_reset_chan[LEDC_CHANNEL_MAX]; void pwmout_reset(void) { for (size_t i = 0; i < LEDC_CHANNEL_MAX; i++ ) { - ledc_stop(LEDC_LOW_SPEED_MODE, i, 0); + if (reserved_channels[i] != INDEX_EMPTY) { + ledc_stop(LEDC_LOW_SPEED_MODE, i, 0); + } if (!never_reset_chan[i]) { reserved_channels[i] = INDEX_EMPTY; } } for (size_t i = 0; i < LEDC_TIMER_MAX; i++ ) { - ledc_timer_rst(LEDC_LOW_SPEED_MODE, i); + if (reserved_timer_freq[i]) { + ledc_timer_rst(LEDC_LOW_SPEED_MODE, i); + } if (!never_reset_tim[i]) { reserved_timer_freq[i] = 0; } @@ -157,7 +161,10 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { if (common_hal_pulseio_pwmout_deinited(self)) { return; } - ledc_stop(LEDC_LOW_SPEED_MODE, self->chan_handle.channel, 0); + + if (reserved_channels[self->chan_handle.channel] != INDEX_EMPTY) { + ledc_stop(LEDC_LOW_SPEED_MODE, self->chan_handle.channel, 0); + } // Search if any other channel is using the timer bool taken = false; for (size_t i =0; i < LEDC_CHANNEL_MAX; i++) { @@ -167,7 +174,9 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { } // Variable frequency means there's only one channel on the timer if (!taken || self->variable_frequency) { - ledc_timer_rst(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num); + if (reserved_timer_freq[self->tim_handle.timer_num] != 0) { + ledc_timer_rst(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num); + } reserved_timer_freq[self->tim_handle.timer_num] = 0; } reset_pin_number(self->pin_number); diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 21d6e7cffd..20a30c82ec 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -14,26 +14,21 @@ LONGINT_IMPL = MPZ CIRCUITPY_NEOPIXEL_WRITE = 1 -CIRCUITPY_FULL_BUILD = 0 +# These modules are implemented in ports//common-hal: CIRCUITPY_ANALOGIO = 0 +CIRCUITPY_NVM = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 -CIRCUITPY_BITBANGIO = 1 -CIRCUITPY_BOARD = 1 -CIRCUITPY_DIGITALIO = 1 -CIRCUITPY_BUSIO = 1 -CIRCUITPY_DISPLAYIO = 1 -CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CPERIPHERAL = 0 -CIRCUITPY_MICROCONTROLLER = 1 -CIRCUITPY_NVM = 0 -CIRCUITPY_PULSEIO = 1 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 -CIRCUITPY_TOUCHIO = 0 +CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_COUNTIO = 0 -# Enable USB HID support -CIRCUITPY_USB_HID = 1 -CIRCUITPY_USB_MIDI = 0 +# These modules are implemented in shared-module/ - they can be included in +# any port once their prerequisites in common-hal are complete. +CIRCUITPY_RANDOM = 0 # Requires OS +CIRCUITPY_USB_MIDI = 0 # Requires USB +CIRCUITPY_ULAB = 0 # No requirements, but takes extra flash CIRCUITPY_MODULE ?= none diff --git a/ports/esp32s2/peripherals/rmt.c b/ports/esp32s2/peripherals/rmt.c index e9ad2c32ed..f17957c1c4 100644 --- a/ports/esp32s2/peripherals/rmt.c +++ b/ports/esp32s2/peripherals/rmt.c @@ -42,4 +42,5 @@ rmt_channel_t esp32s2_peripherals_find_and_reserve_rmt(void) { void esp32s2_peripherals_free_rmt(rmt_channel_t chan) { rmt_reserved_channels[chan] = false; + rmt_driver_uninstall(chan); } diff --git a/supervisor/shared/rgb_led_status.c b/supervisor/shared/rgb_led_status.c index f3c2106471..1de745a567 100644 --- a/supervisor/shared/rgb_led_status.c +++ b/supervisor/shared/rgb_led_status.c @@ -28,6 +28,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "rgb_led_status.h" #include "supervisor/shared/tick.h" +#include "py/obj.h" #ifdef MICROPY_HW_NEOPIXEL uint8_t rgb_status_brightness = 63; From 93b373d617ff7a99eb936628d50d954f5db53f43 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 4 Aug 2020 18:34:59 -0500 Subject: [PATCH 0493/1293] "pop from empty %q" Saves 12 bytes code on trinket m0 --- locale/circuitpython.pot | 5 ++--- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 2 +- ports/cxd56/common-hal/pulseio/PulseIn.c | 2 +- ports/mimxrt10xx/common-hal/pulseio/PulseIn.c | 2 +- ports/nrf/common-hal/pulseio/PulseIn.c | 2 +- ports/stm/common-hal/pulseio/PulseIn.c | 2 +- py/objdict.c | 2 +- py/objlist.c | 2 +- py/objset.c | 2 +- shared-bindings/ps2io/Ps2.c | 2 +- 10 files changed, 11 insertions(+), 12 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index e40b8a614e..fb9869bd46 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-04 13:58-0500\n" +"POT-Creation-Date: 2020-08-04 18:42-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2894,8 +2894,7 @@ msgstr "" #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c #: shared-bindings/ps2io/Ps2.c -#, c-format -msgid "pop from empty %s" +msgid "pop from empty %q" msgstr "" #: py/objint_mpz.c diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index 81ccc4fecf..d3d9936725 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -298,7 +298,7 @@ void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t* self) { uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { if (self->len == 0) { - mp_raise_IndexError_varg(translate("pop from empty %s"), "PulseIn"); + mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_PulseIn); } common_hal_mcu_disable_interrupts(); uint16_t value = self->buffer[self->start]; diff --git a/ports/cxd56/common-hal/pulseio/PulseIn.c b/ports/cxd56/common-hal/pulseio/PulseIn.c index e54b5083db..7c3e4a9d05 100644 --- a/ports/cxd56/common-hal/pulseio/PulseIn.c +++ b/ports/cxd56/common-hal/pulseio/PulseIn.c @@ -160,7 +160,7 @@ void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t *self) { uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t *self) { if (self->len == 0) { - mp_raise_IndexError_varg(translate("pop from empty %s"), "PulseIn"); + mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_PulseIn); } common_hal_mcu_disable_interrupts(); uint16_t value = self->buffer[self->start]; diff --git a/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c b/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c index f5757ab788..cea11a4b9a 100644 --- a/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c +++ b/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c @@ -201,7 +201,7 @@ void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t* self) { uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { // if (self->len == 0) { -// mp_raise_IndexError_varg(translate("pop from empty %s"), "PulseIn"); +// mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_PulseIn); // } // common_hal_mcu_disable_interrupts(); // uint16_t value = self->buffer[self->start]; diff --git a/ports/nrf/common-hal/pulseio/PulseIn.c b/ports/nrf/common-hal/pulseio/PulseIn.c index c5de3a4b43..ca44a20b4a 100644 --- a/ports/nrf/common-hal/pulseio/PulseIn.c +++ b/ports/nrf/common-hal/pulseio/PulseIn.c @@ -284,7 +284,7 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t* self, int16_ uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { if (self->len == 0) { - mp_raise_IndexError_varg(translate("pop from empty %s"), "PulseIn"); + mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_PulseIn); } if ( !self->paused ) { diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c index a667cf0102..015ee8536d 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.c +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -258,7 +258,7 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t* self, int16_ uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { if (self->len == 0) { - mp_raise_IndexError_varg(translate("pop from empty %s"), "PulseIn"); + mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_PulseIn); } HAL_NVIC_DisableIRQ(self->irq); uint16_t value = self->buffer[self->start]; diff --git a/py/objdict.c b/py/objdict.c index 6ddf7ddde5..63fd86f357 100644 --- a/py/objdict.c +++ b/py/objdict.c @@ -313,7 +313,7 @@ STATIC mp_obj_t dict_popitem(mp_obj_t self_in) { size_t cur = 0; mp_map_elem_t *next = dict_iter_next(self, &cur); if (next == NULL) { - mp_raise_msg_varg(&mp_type_KeyError, translate("pop from empty %s"), "dict"); + mp_raise_msg_varg(&mp_type_KeyError, translate("pop from empty %q"), MP_QSTR_dict); } self->map.used--; mp_obj_t items[] = {next->key, next->value}; diff --git a/py/objlist.c b/py/objlist.c index b2de72374b..51ec920be1 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -274,7 +274,7 @@ STATIC mp_obj_t list_pop(size_t n_args, const mp_obj_t *args) { mp_check_self(MP_OBJ_IS_TYPE(args[0], &mp_type_list)); mp_obj_list_t *self = mp_instance_cast_to_native_base(args[0], &mp_type_list); if (self->len == 0) { - mp_raise_IndexError_varg(translate("pop from empty %s"), "list"); + mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_list); } size_t index = mp_get_index(self->base.type, self->len, n_args == 1 ? MP_OBJ_NEW_SMALL_INT(-1) : args[1], false); mp_obj_t ret = self->items[index]; diff --git a/py/objset.c b/py/objset.c index 6764a5c6f6..b8f0f07ede 100644 --- a/py/objset.c +++ b/py/objset.c @@ -368,7 +368,7 @@ STATIC mp_obj_t set_pop(mp_obj_t self_in) { mp_obj_set_t *self = MP_OBJ_TO_PTR(self_in); mp_obj_t obj = mp_set_remove_first(&self->set); if (obj == MP_OBJ_NULL) { - mp_raise_msg_varg(&mp_type_KeyError, translate("pop from empty %s"), "set"); + mp_raise_msg_varg(&mp_type_KeyError, translate("pop from empty %q"), MP_QSTR_set); } return obj; } diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c index 64d93f6ad5..0977e08ff7 100644 --- a/shared-bindings/ps2io/Ps2.c +++ b/shared-bindings/ps2io/Ps2.c @@ -133,7 +133,7 @@ STATIC mp_obj_t ps2io_ps2_obj_popleft(mp_obj_t self_in) { int b = common_hal_ps2io_ps2_popleft(self); if (b < 0) { - mp_raise_IndexError_varg(translate("pop from empty %s"), "Ps2 buffer"); + mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_Ps2_space_buffer); } return MP_OBJ_NEW_SMALL_INT(b); } From d8d36a4fb0814a90b3c14e1f5302205483ca9355 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Tue, 4 Aug 2020 20:55:20 -0500 Subject: [PATCH 0494/1293] conf.py: set the version for sphinx, based on the current git tag --- conf.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 37e611dbb8..9b2efa8afe 100644 --- a/conf.py +++ b/conf.py @@ -20,6 +20,7 @@ import json import logging import os +import re import subprocess import sys import urllib.parse @@ -106,7 +107,25 @@ copyright = '2014-2020, MicroPython & CircuitPython contributors (https://github # # We don't follow "The short X.Y version" vs "The full version, including alpha/beta/rc tags" # breakdown, so use the same version identifier for both to avoid confusion. -version = release = '0.0.0' + +final_version = "" +git_describe = subprocess.run( + ["git", "describe", "--dirty", "--tags"], + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + encoding="utf-8" +) +if git_describe.returncode == 0: + git_version = re.search( + r"^\d(?:\.\d){0,2}(?:\-(?:alpha|beta)\.\d+){0,1}", + str(git_describe.stdout) + ) + if git_version: + final_version = git_version[0] +else: + print("Failed to retrieve git version:", git_describe.stdout) + +version = release = final_version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From 3a954801788d052ed15bca2ec4d5e6aed7d09583 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Tue, 4 Aug 2020 21:05:03 -0500 Subject: [PATCH 0495/1293] conf.py: also include 'rc' versions for sphinx versioning --- conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 9b2efa8afe..cbdc715248 100644 --- a/conf.py +++ b/conf.py @@ -117,7 +117,7 @@ git_describe = subprocess.run( ) if git_describe.returncode == 0: git_version = re.search( - r"^\d(?:\.\d){0,2}(?:\-(?:alpha|beta)\.\d+){0,1}", + r"^\d(?:\.\d){0,2}(?:\-(?:alpha|beta|rc)\.\d+){0,1}", str(git_describe.stdout) ) if git_version: From dbe47a6a2a3a5e34f11cc18c397dbdedff2ad462 Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Wed, 5 Aug 2020 16:07:18 +0800 Subject: [PATCH 0496/1293] adjust --- ports/nrf/supervisor/port.c | 3 ++- ports/nrf/supervisor/qspi_flash.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 68d6f5f712..05970a3edf 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -302,7 +302,8 @@ void port_sleep_until_interrupt(void) { nrf_gpio_cfg_output(MICROPY_QSPI_CS); nrf_gpio_pin_write(MICROPY_QSPI_CS, 1); - *(volatile uint32_t *)0x40029010 = 1; + // Workaround to disable QSPI according to nRF52840 Revision 1 Errata V1.4 - 3.8 + NRF_QSPI->TASKS_DEACTIVATE = 1; *(volatile uint32_t *)0x40029054 = 1; NRF_QSPI->ENABLE = 0; } diff --git a/ports/nrf/supervisor/qspi_flash.c b/ports/nrf/supervisor/qspi_flash.c index 83261f0800..d5c60ac9ee 100644 --- a/ports/nrf/supervisor/qspi_flash.c +++ b/ports/nrf/supervisor/qspi_flash.c @@ -39,7 +39,7 @@ #include "supervisor/shared/external_flash/qspi_flash.h" #if defined(MICROPY_QSPI_OFF_WHEN_SLEEP) -#define QSPI_ENABLE qspi_enable +#define QSPI_ENABLE() qspi_enable() static void qspi_enable(void) { @@ -62,7 +62,7 @@ static void qspi_enable(void) } #else -#define QSPI_ENABLE() +#define QSPI_ENABLE() ((void)0) #endif bool spi_flash_command(uint8_t command) { From 7854625c4edac2dff663d693232e8c05380d960a Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Wed, 5 Aug 2020 16:08:13 +0800 Subject: [PATCH 0497/1293] avoid using the RGB LEDs to save energy --- ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h b/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h index 04a49e5e23..e8c268d5bf 100644 --- a/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h +++ b/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h @@ -30,9 +30,10 @@ #define MICROPY_HW_BOARD_NAME "Makerdiary M60 Keyboard" #define MICROPY_HW_MCU_NAME "nRF52840" -#define CP_RGB_STATUS_R (&pin_P0_30) -#define CP_RGB_STATUS_G (&pin_P0_29) -#define CP_RGB_STATUS_B (&pin_P0_31) +// not use the RGB LEDs to save energy +// #define CP_RGB_STATUS_R (&pin_P0_30) +// #define CP_RGB_STATUS_G (&pin_P0_29) +// #define CP_RGB_STATUS_B (&pin_P0_31) #define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(1, 10) #define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(1, 14) From c7b6e66426dbff05b10e1f5aa64320f2071e8878 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 5 Aug 2020 10:03:20 -0500 Subject: [PATCH 0498/1293] Fixes for pulsein tick handling --- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 15 +++++++++------ ports/atmel-samd/common-hal/pulseio/PulseIn.h | 1 + supervisor/shared/background_callback.c | 6 +++++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index a47135d566..79f66ceaee 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -44,6 +44,7 @@ #include "shared-bindings/pulseio/PulseIn.h" #include "supervisor/shared/tick.h" #include "supervisor/shared/translate.h" +#include "supervisor/port.h" // This timer is shared amongst all PulseIn objects as a higher resolution clock. static uint8_t refcount = 0; @@ -77,7 +78,7 @@ static void pulsein_set_config(pulseio_pulsein_obj_t* self, bool first_edge) { } void pulsein_interrupt_handler(uint8_t channel) { - // turn off interrupts while in the handler + // Turn off interrupts while in handler common_hal_mcu_disable_interrupts(); // Grab the current time first. uint32_t current_overflow = overflow_count; @@ -90,10 +91,8 @@ void pulsein_interrupt_handler(uint8_t channel) { uint32_t current_count = tc->COUNT16.COUNT.reg; pulseio_pulsein_obj_t* self = get_eic_channel_data(channel); - if (!supervisor_background_tasks_ok() ) { - common_hal_mcu_enable_interrupts(); - mp_raise_RuntimeError(translate("Input taking too long")); - return; + if (self->len == 0) { + update_background_ticks(); } if (self->first_edge) { self->first_edge = false; @@ -123,6 +122,11 @@ void pulsein_interrupt_handler(uint8_t channel) { self->start++; } } + if (!supervisor_background_tasks_ok() ) { + common_hal_mcu_enable_interrupts(); + mp_raise_RuntimeError(translate("Input taking too long")); + return; + } self->last_overflow = current_overflow; self->last_count = current_count; common_hal_mcu_enable_interrupts(); @@ -304,7 +308,6 @@ uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { self->start = (self->start + 1) % self->maxlen; self->len--; common_hal_mcu_enable_interrupts(); - return value; } diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.h b/ports/atmel-samd/common-hal/pulseio/PulseIn.h index 99358178f2..a0f838b373 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.h +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.h @@ -50,6 +50,7 @@ void pulsein_reset(void); void pulsein_interrupt_handler(uint8_t channel); void pulsein_timer_interrupt_handler(uint8_t index); +void update_background_ticks(void); #ifdef SAMD21 void rtc_set_continuous(void); void rtc_start_pulsein(void); diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c index ddf723697b..af64f99aa6 100644 --- a/supervisor/shared/background_callback.c +++ b/supervisor/shared/background_callback.c @@ -37,12 +37,16 @@ STATIC volatile background_callback_t *callback_head, *callback_tail; #define CALLBACK_CRITICAL_BEGIN (common_hal_mcu_disable_interrupts()) #define CALLBACK_CRITICAL_END (common_hal_mcu_enable_interrupts()) -volatile uint64_t last_background_tick = 0; +uint64_t last_background_tick = 0; uint64_t get_background_ticks(void) { return last_background_tick; } +void update_background_ticks(void) { + last_background_tick = port_get_raw_ticks(NULL); +} + void background_callback_add_core(background_callback_t *cb) { CALLBACK_CRITICAL_BEGIN; if (cb->prev || callback_head == cb) { From a778163d0f7888570c3799d4905cf981cba8619d Mon Sep 17 00:00:00 2001 From: root Date: Wed, 5 Aug 2020 10:23:31 -0500 Subject: [PATCH 0499/1293] Trying to get protomnatter submodule in sync --- lib/protomatter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protomatter b/lib/protomatter index 2408e9c033..761d6437e8 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit 2408e9c033f5ec050967b1592b29a950a831d6c2 +Subproject commit 761d6437e8cd6a131d51de96974337121a9c7164 From 432f43a4725d145a69f8cc128ae96d2f7e2530ec Mon Sep 17 00:00:00 2001 From: Jerry Needell Date: Wed, 5 Aug 2020 11:37:57 -0400 Subject: [PATCH 0500/1293] freeze rfm9x and BusDevice, remove many built-in modules --- .gitmodules | 3 +++ frozen/Adafruit_CircuitPython_RFM9x | 1 + .../boards/feather_m0_rfm9x/mpconfigboard.mk | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+) create mode 160000 frozen/Adafruit_CircuitPython_RFM9x diff --git a/.gitmodules b/.gitmodules index f09a1e4c68..f922aae1db 100644 --- a/.gitmodules +++ b/.gitmodules @@ -147,3 +147,6 @@ [submodule "ports/esp32s2/esp-idf"] path = ports/esp32s2/esp-idf url = https://github.com/tannewt/esp-idf.git +[submodule "frozen/Adafruit_CircuitPython_RFM9x"] + path = frozen/Adafruit_CircuitPython_RFM9x + url = https://github.com/adafruit/Adafruit_CircuitPython_RFM9x.git diff --git a/frozen/Adafruit_CircuitPython_RFM9x b/frozen/Adafruit_CircuitPython_RFM9x new file mode 160000 index 0000000000..b3d270f743 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_RFM9x @@ -0,0 +1 @@ +Subproject commit b3d270f743fafa0ed4b3374fadcea350f05be0b8 diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index de79638bd3..4d51177dcc 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -10,4 +10,22 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 + +# A number of modules are removed for RFM9x to make room for frozen libraries. +# Many I/O functions are not available. +# math is very large and is also removed. +CIRCUITPY_ANALOGIO = 0 +CIRCUITPY_PULSEIO = 0 +CIRCUITPY_NEOPIXEL_WRITE = 1 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_RTC = 0 +CIRCUITPY_SAMD = 0 +CIRCUITPY_USB_MIDI = 0 +CIRCUITPY_TOUCHIO = 0 +CFLAGS_INLINE_LIMIT = 35 +# Make more room. SUPEROPT_GC = 0 + +# Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_RFM9x From 333a10deda918129138144390646952a15aa053d Mon Sep 17 00:00:00 2001 From: root Date: Wed, 5 Aug 2020 10:59:33 -0500 Subject: [PATCH 0501/1293] getting ulab in sync --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index 4a771347bb..11a7ecff6d 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 4a771347bb49ec0335feb567465a690ef1ba8e5a +Subproject commit 11a7ecff6d76a02644ff23a734b792afaa615e44 From 78d049d0f14206d653b89c8cdcc91199954858c1 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 5 Aug 2020 14:05:53 -0400 Subject: [PATCH 0502/1293] Fix pwm reset spew, protect against null reference in led status --- ports/esp32s2/common-hal/pulseio/PWMOut.c | 4 ++- supervisor/shared/rgb_led_status.c | 30 ++++++++++++----------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/ports/esp32s2/common-hal/pulseio/PWMOut.c b/ports/esp32s2/common-hal/pulseio/PWMOut.c index 3172023b6b..0ac42852ae 100644 --- a/ports/esp32s2/common-hal/pulseio/PWMOut.c +++ b/ports/esp32s2/common-hal/pulseio/PWMOut.c @@ -32,6 +32,7 @@ #define INDEX_EMPTY 0xFF +STATIC bool not_first_reset = false; STATIC uint32_t reserved_timer_freq[LEDC_TIMER_MAX]; STATIC uint8_t reserved_channels[LEDC_CHANNEL_MAX]; STATIC bool never_reset_tim[LEDC_TIMER_MAX]; @@ -39,7 +40,7 @@ STATIC bool never_reset_chan[LEDC_CHANNEL_MAX]; void pwmout_reset(void) { for (size_t i = 0; i < LEDC_CHANNEL_MAX; i++ ) { - if (reserved_channels[i] != INDEX_EMPTY) { + if (reserved_channels[i] != INDEX_EMPTY && not_first_reset) { ledc_stop(LEDC_LOW_SPEED_MODE, i, 0); } if (!never_reset_chan[i]) { @@ -54,6 +55,7 @@ void pwmout_reset(void) { reserved_timer_freq[i] = 0; } } + not_first_reset = true; } pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, diff --git a/supervisor/shared/rgb_led_status.c b/supervisor/shared/rgb_led_status.c index 1de745a567..b66bbd9d56 100644 --- a/supervisor/shared/rgb_led_status.c +++ b/supervisor/shared/rgb_led_status.c @@ -387,20 +387,22 @@ void prep_rgb_status_animation(const pyexec_result_t* result, if (!status->ok) { status->total_exception_cycle = EXCEPTION_TYPE_LENGTH_MS * 3 + LINE_NUMBER_TOGGLE_LENGTH * status->digit_sum + LINE_NUMBER_TOGGLE_LENGTH * num_places; } - if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_IndentationError)) { - status->exception_color = INDENTATION_ERROR; - } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_SyntaxError)) { - status->exception_color = SYNTAX_ERROR; - } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_NameError)) { - status->exception_color = NAME_ERROR; - } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_OSError)) { - status->exception_color = OS_ERROR; - } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_ValueError)) { - status->exception_color = VALUE_ERROR; - } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_MpyError)) { - status->exception_color = MPY_ERROR; - } else { - status->exception_color = OTHER_ERROR; + if (result->exception_type) { + if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_IndentationError)) { + status->exception_color = INDENTATION_ERROR; + } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_SyntaxError)) { + status->exception_color = SYNTAX_ERROR; + } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_NameError)) { + status->exception_color = NAME_ERROR; + } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_OSError)) { + status->exception_color = OS_ERROR; + } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_ValueError)) { + status->exception_color = VALUE_ERROR; + } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_MpyError)) { + status->exception_color = MPY_ERROR; + } else { + status->exception_color = OTHER_ERROR; + } } #endif } From c69dd3c32b901b9d93fbc3fcafcd207f5be709ab Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Tue, 4 Aug 2020 19:51:22 +0000 Subject: [PATCH 0503/1293] Translated using Weblate (Swedish) Currently translated at 100.0% (786 of 786 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 3af263686d..26c4263915 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: 2020-07-30 07:23-0500\n" -"PO-Revision-Date: 2020-07-13 17:39+0000\n" +"PO-Revision-Date: 2020-08-05 20:32+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -86,7 +86,7 @@ msgstr "%q-listan måste vara en lista" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" -msgstr "" +msgstr "%q måste vara >= 0" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -226,7 +226,7 @@ msgstr "'await' utanför funktion" #: py/compile.c msgid "'await', 'async for' or 'async with' outside async function" -msgstr "" +msgstr "'await', 'async for' eller 'async with' utanför async-funktion" #: py/compile.c msgid "'break' outside loop" @@ -238,7 +238,7 @@ msgstr "'continue' utanför loop" #: py/objgenerator.c msgid "'coroutine' object is not an iterator" -msgstr "" +msgstr "objektet 'coroutine\" är inte en iterator" #: py/compile.c msgid "'data' requires at least 2 arguments" @@ -333,7 +333,7 @@ msgstr "Annonserar redan." #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" -msgstr "" +msgstr "Kör redan" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -373,7 +373,7 @@ msgstr "Högst %d %q kan anges (inte %d)" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" -msgstr "" +msgstr "Försök att tilldela %d block" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." @@ -877,7 +877,7 @@ msgstr "I2C init-fel" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" -msgstr "" +msgstr "I2SOut är inte tillgängligt" #: shared-bindings/aesio/aes.c #, c-format @@ -1581,6 +1581,8 @@ msgstr "Åtgärden tog för lång tid: Max väntetid är %d sekunder" msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +"Timern är reserverad för internt bruk - deklarera PWM-pinne tidigare i " +"programmet" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1852,7 +1854,7 @@ msgstr "argumentet har fel typ" #: extmod/ulab/code/linalg/linalg.c msgid "argument must be ndarray" -msgstr "" +msgstr "argumentet måste vara ndarray" #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c @@ -3247,7 +3249,7 @@ msgstr "för många värden att packa upp (förväntat %d)" #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" -msgstr "" +msgstr "interp är definierad för 1D-matriser med samma längd" #: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" @@ -3379,7 +3381,7 @@ msgstr "value_count måste vara > 0" #: extmod/ulab/code/linalg/linalg.c msgid "vectors must have same lengths" -msgstr "" +msgstr "vektorer måste ha samma längd" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" From d8257380d7e1658d710bf841424a64c2c6451d5f Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Thu, 6 Aug 2020 09:56:05 +0800 Subject: [PATCH 0504/1293] add qspi_disable() --- ports/nrf/supervisor/port.c | 16 ++++--------- ports/nrf/supervisor/qspi_flash.c | 39 +++++++++++++++++++++++-------- 2 files changed, 34 insertions(+), 21 deletions(-) diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 05970a3edf..36c9f836ea 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -65,6 +65,10 @@ #include "common-hal/audiopwmio/PWMAudioOut.h" #endif +#if defined(MICROPY_QSPI_CS) && defined(MICROPY_QSPI_OFF_WHEN_SLEEP) +extern void qspi_disable(void); +#endif + static void power_warning_handler(void) { reset_into_safe_mode(BROWNOUT); } @@ -296,17 +300,7 @@ void port_interrupt_after_ticks(uint32_t ticks) { void port_sleep_until_interrupt(void) { #if defined(MICROPY_QSPI_CS) && defined(MICROPY_QSPI_OFF_WHEN_SLEEP) - // Turn off QSPI when USB is disconnected - if (NRF_QSPI->ENABLE && !(NRF_POWER->USBREGSTATUS & POWER_USBREGSTATUS_VBUSDETECT_Msk)) { - // Keep CS high when QSPI is diabled - nrf_gpio_cfg_output(MICROPY_QSPI_CS); - nrf_gpio_pin_write(MICROPY_QSPI_CS, 1); - - // Workaround to disable QSPI according to nRF52840 Revision 1 Errata V1.4 - 3.8 - NRF_QSPI->TASKS_DEACTIVATE = 1; - *(volatile uint32_t *)0x40029054 = 1; - NRF_QSPI->ENABLE = 0; - } + qspi_disable(); #endif // Clear the FPU interrupt because it can prevent us from sleeping. diff --git a/ports/nrf/supervisor/qspi_flash.c b/ports/nrf/supervisor/qspi_flash.c index d5c60ac9ee..852f0c44a5 100644 --- a/ports/nrf/supervisor/qspi_flash.c +++ b/ports/nrf/supervisor/qspi_flash.c @@ -38,10 +38,9 @@ #include "supervisor/shared/external_flash/common_commands.h" #include "supervisor/shared/external_flash/qspi_flash.h" +// When USB is disconnected, disable QSPI in sleep mode to save energy #if defined(MICROPY_QSPI_OFF_WHEN_SLEEP) -#define QSPI_ENABLE() qspi_enable() - -static void qspi_enable(void) +void qspi_enable(void) { if (NRF_QSPI->ENABLE) { return; @@ -61,12 +60,32 @@ static void qspi_enable(void) } while (--remaining_attempts); } +void qspi_disable(void) +{ + // Turn off QSPI when USB is disconnected + if (NRF_QSPI->ENABLE && !(NRF_POWER->USBREGSTATUS & POWER_USBREGSTATUS_VBUSDETECT_Msk)) { + // Keep CS high when QSPI is diabled + nrf_gpio_cfg_output(MICROPY_QSPI_CS); + nrf_gpio_pin_write(MICROPY_QSPI_CS, 1); + + // Workaround to disable QSPI according to nRF52840 Revision 1 Errata V1.4 - 3.8 + NRF_QSPI->TASKS_DEACTIVATE = 1; + *(volatile uint32_t *)0x40029054 = 1; + NRF_QSPI->ENABLE = 0; + } +} #else -#define QSPI_ENABLE() ((void)0) +void qspi_enable(void) +{ +} + +void qspi_disable(void) +{ +} #endif bool spi_flash_command(uint8_t command) { - QSPI_ENABLE(); + qspi_enable(); nrf_qspi_cinstr_conf_t cinstr_cfg = { .opcode = command, .length = 1, @@ -79,7 +98,7 @@ bool spi_flash_command(uint8_t command) { } bool spi_flash_read_command(uint8_t command, uint8_t* response, uint32_t length) { - QSPI_ENABLE(); + qspi_enable(); nrf_qspi_cinstr_conf_t cinstr_cfg = { .opcode = command, .length = length + 1, @@ -93,7 +112,7 @@ bool spi_flash_read_command(uint8_t command, uint8_t* response, uint32_t length) } bool spi_flash_write_command(uint8_t command, uint8_t* data, uint32_t length) { - QSPI_ENABLE(); + qspi_enable(); nrf_qspi_cinstr_conf_t cinstr_cfg = { .opcode = command, .length = length + 1, @@ -106,7 +125,7 @@ bool spi_flash_write_command(uint8_t command, uint8_t* data, uint32_t length) { } bool spi_flash_sector_command(uint8_t command, uint32_t address) { - QSPI_ENABLE(); + qspi_enable(); if (command != CMD_SECTOR_ERASE) { return false; } @@ -114,7 +133,7 @@ bool spi_flash_sector_command(uint8_t command, uint32_t address) { } bool spi_flash_write_data(uint32_t address, uint8_t* data, uint32_t length) { - QSPI_ENABLE(); + qspi_enable(); // TODO: In theory, this also needs to handle unaligned data and // non-multiple-of-4 length. (in practice, I don't think the fat layer // generates such writes) @@ -122,7 +141,7 @@ bool spi_flash_write_data(uint32_t address, uint8_t* data, uint32_t length) { } bool spi_flash_read_data(uint32_t address, uint8_t* data, uint32_t length) { - QSPI_ENABLE(); + qspi_enable(); int misaligned = ((intptr_t)data) & 3; // If the data is misaligned, we need to read 4 bytes // into an aligned buffer, and then copy 1, 2, or 3 bytes from the aligned From c42ffb8f3d763ae7516d7530d99748653dcef2d7 Mon Sep 17 00:00:00 2001 From: Jerry Needell Date: Thu, 6 Aug 2020 05:44:26 -0400 Subject: [PATCH 0505/1293] remove usb_hid --- ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index 4d51177dcc..6982eeb640 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -21,6 +21,7 @@ CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_SAMD = 0 CIRCUITPY_USB_MIDI = 0 +CIRCUITPY_USB_HID = 0 CIRCUITPY_TOUCHIO = 0 CFLAGS_INLINE_LIMIT = 35 # Make more room. From f7961b96a9345226f4d588046ed036a38d0bbd2f Mon Sep 17 00:00:00 2001 From: Jerry Needell Date: Thu, 6 Aug 2020 10:05:18 -0400 Subject: [PATCH 0506/1293] update comment --- ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index 6982eeb640..512bc533ce 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -13,7 +13,6 @@ CIRCUITPY_FULL_BUILD = 0 # A number of modules are removed for RFM9x to make room for frozen libraries. # Many I/O functions are not available. -# math is very large and is also removed. CIRCUITPY_ANALOGIO = 0 CIRCUITPY_PULSEIO = 0 CIRCUITPY_NEOPIXEL_WRITE = 1 From 887eb3b6d9a3ef8c6300448492f1177a609feef6 Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Tue, 4 Aug 2020 15:41:49 +0900 Subject: [PATCH 0507/1293] Apply a Sphinx transform to make the core module docs look better --- conf.py | 36 +++++++++++++++++++++++++++++++++++- docs/requirements.txt | 2 +- shared-bindings/help.rst | 2 +- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/conf.py b/conf.py index 37e611dbb8..933072f7a9 100644 --- a/conf.py +++ b/conf.py @@ -17,7 +17,6 @@ # # SPDX-License-Identifier: MIT -import json import logging import os import subprocess @@ -25,6 +24,9 @@ import sys import urllib.parse import recommonmark +from sphinx.transforms import SphinxTransform +from docutils import nodes +from sphinx import addnodes # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -84,6 +86,7 @@ autoapi_dirs = [os.path.join('circuitpython-stubs', x) for x in os.listdir('circ autoapi_add_toctree_entry = False autoapi_options = ['members', 'undoc-members', 'private-members', 'show-inheritance', 'special-members', 'show-module-summary'] autoapi_template_dir = 'docs/autoapi/templates' +autoapi_python_class_content = "both" autoapi_python_use_implicit_namespaces = True autoapi_root = "shared-bindings" @@ -423,7 +426,38 @@ def generate_redirects(app): with open(redirected_filename, 'w') as f: f.write(TEMPLATE % urllib.parse.quote(to_path, '#/')) + +class CoreModuleTransform(SphinxTransform): + default_priority = 870 + + def _convert_first_paragraph_into_title(self): + title = self.document.next_node(nodes.title) + paragraph = self.document.next_node(nodes.paragraph) + if not title or not paragraph: + return + if isinstance(paragraph[0], nodes.paragraph): + paragraph = paragraph[0] + if all(isinstance(child, nodes.Text) for child in paragraph.children): + for child in paragraph.children: + title.append(nodes.Text(" \u2013 ")) + title.append(child) + paragraph.parent.remove(paragraph) + + def _enable_linking_to_nonclass_targets(self): + for desc in self.document.traverse(addnodes.desc): + for xref in desc.traverse(addnodes.pending_xref): + if xref.attributes.get("reftype") == "class": + xref.attributes.pop("refspecific", None) + + def apply(self, **kwargs): + docname = self.env.docname + if docname.startswith(autoapi_root) and docname.endswith("/index"): + self._convert_first_paragraph_into_title() + self._enable_linking_to_nonclass_targets() + + def setup(app): app.add_css_file("customstyle.css") app.add_config_value('redirects_file', 'redirects', 'env') app.connect('builder-inited', generate_redirects) + app.add_transform(CoreModuleTransform) diff --git a/docs/requirements.txt b/docs/requirements.txt index d98e2b30c3..f234638ea1 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,4 @@ -sphinx<3 +sphinx<4 recommonmark==0.6.0 sphinxcontrib-svg2pdfconverter==0.1.0 astroid diff --git a/shared-bindings/help.rst b/shared-bindings/help.rst index f6d72a5568..ccc3790a5a 100644 --- a/shared-bindings/help.rst +++ b/shared-bindings/help.rst @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -:func:`help` - Built-in method to provide helpful information +:func:`help` -- Built-in method to provide helpful information ============================================================== .. function:: help(object=None) From 56c898da80df57d0e83f4e8d1ee44f4351ce1d8c Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Mon, 3 Aug 2020 13:35:43 +0900 Subject: [PATCH 0508/1293] Modify some Python stubs --- docs/autoapi/templates/python/module.rst | 3 +- shared-bindings/_bleio/Adapter.c | 8 +- shared-bindings/_bleio/Address.c | 4 +- shared-bindings/_bleio/Characteristic.c | 2 +- shared-bindings/_bleio/Connection.c | 8 +- shared-bindings/_bleio/Descriptor.c | 4 +- shared-bindings/_bleio/UUID.c | 4 +- shared-bindings/_bleio/__init__.c | 13 +- shared-bindings/_eve/__init__.c | 581 +++++++++--------- shared-bindings/_pew/PewPew.c | 22 +- shared-bindings/_pixelbuf/PixelBuf.c | 26 +- shared-bindings/_pixelbuf/__init__.c | 2 +- shared-bindings/_stage/Layer.c | 6 +- shared-bindings/_stage/Text.c | 6 +- shared-bindings/_stage/__init__.c | 7 +- shared-bindings/_typing/__init__.pyi | 54 ++ shared-bindings/aesio/aes.c | 4 +- shared-bindings/audiobusio/I2SOut.c | 4 +- shared-bindings/audiocore/RawSample.c | 2 +- shared-bindings/audiocore/WaveFile.c | 4 +- shared-bindings/audiocore/__init__.c | 7 - shared-bindings/audioio/AudioOut.c | 4 +- shared-bindings/audiomixer/Mixer.c | 4 +- shared-bindings/audiomixer/MixerVoice.c | 4 +- shared-bindings/audiomp3/MP3Decoder.c | 6 +- shared-bindings/audiopwmio/PWMAudioOut.c | 4 +- shared-bindings/bitbangio/I2C.c | 12 +- shared-bindings/bitbangio/SPI.c | 4 +- shared-bindings/busio/I2C.c | 10 +- shared-bindings/busio/SPI.c | 10 +- shared-bindings/displayio/Display.c | 12 +- shared-bindings/displayio/EPaperDisplay.c | 10 +- shared-bindings/displayio/Group.c | 14 +- shared-bindings/fontio/Glyph.c | 2 +- .../framebufferio/FramebufferDisplay.c | 17 +- shared-bindings/i2cperipheral/I2CPeripheral.c | 7 +- shared-bindings/microcontroller/__init__.c | 7 +- shared-bindings/multiterminal/__init__.c | 2 +- shared-bindings/neopixel_write/__init__.c | 4 +- shared-bindings/network/__init__.c | 2 +- shared-bindings/nvm/ByteArray.c | 2 + shared-bindings/os/__init__.c | 14 +- shared-bindings/rgbmatrix/RGBMatrix.c | 2 +- shared-bindings/rotaryio/__init__.c | 3 +- shared-bindings/sdcardio/SDCard.c | 4 +- shared-bindings/sdioio/SDCard.c | 6 +- shared-bindings/socket/__init__.c | 49 +- shared-bindings/storage/__init__.c | 6 +- shared-bindings/struct/__init__.c | 8 +- shared-bindings/supervisor/__init__.c | 10 +- shared-bindings/terminalio/__init__.c | 3 + shared-bindings/time/__init__.c | 2 +- shared-bindings/usb_midi/__init__.c | 8 +- shared-bindings/vectorio/VectorShape.c | 4 +- shared-bindings/wiznet/wiznet5k.c | 2 +- tools/extract_pyi.py | 148 +++-- 56 files changed, 643 insertions(+), 534 deletions(-) create mode 100644 shared-bindings/_typing/__init__.pyi diff --git a/docs/autoapi/templates/python/module.rst b/docs/autoapi/templates/python/module.rst index 7ede6bdfdf..63a1aaa76d 100644 --- a/docs/autoapi/templates/python/module.rst +++ b/docs/autoapi/templates/python/module.rst @@ -18,8 +18,7 @@ {% set visible_subpackages = obj.subpackages|selectattr("display")|list %} {% if visible_subpackages %} .. toctree:: - :titlesonly: - :maxdepth: 3 + :maxdepth: 2 {% for subpackage in visible_subpackages %} {{ subpackage.short_name }}/index.rst diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index f898d404a0..7a44d560fd 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -145,8 +145,8 @@ const mp_obj_property_t bleio_adapter_name_obj = { //| .. note: If you set ``anonymous=True``, then a timeout must be specified. If no timeout is //| specified, then the maximum allowed timeout will be selected automatically. //| -//| :param buf data: advertising data packet bytes -//| :param buf scan_response: scan response data packet bytes. ``None`` if no scan response is needed. +//| :param ~_typing.ReadableBuffer data: advertising data packet bytes +//| :param ~_typing.ReadableBuffer scan_response: scan response data packet bytes. ``None`` if no scan response is needed. //| :param bool connectable: If `True` then other devices are allowed to connect to this peripheral. //| :param bool anonymous: If `True` then this device's MAC address is randomized before advertising. //| :param int timeout: If set, we will only advertise for this many seconds. @@ -219,7 +219,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_stop_advertising_obj, bleio_adapt //| """Starts a BLE scan and returns an iterator of results. Advertisements and scan responses are //| filtered and returned separately. //| -//| :param sequence prefixes: Sequence of byte string prefixes to filter advertising packets +//| :param ~_typing.ReadableBuffer prefixes: Sequence of byte string prefixes to filter advertising packets //| with. A packet without an advertising structure that matches one of the prefixes is //| ignored. Format is one byte for length (n) and n bytes of prefix and can be repeated. //| :param int buffer_size: the maximum number of advertising bytes to buffer. @@ -334,7 +334,7 @@ const mp_obj_property_t bleio_adapter_connected_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| connections: tuple +//| connections: Tuple[Connection] //| """Tuple of active connections including those initiated through //| :py:meth:`_bleio.Adapter.connect`. (read-only)""" //| diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c index 94994fb702..1f168d31af 100644 --- a/shared-bindings/_bleio/Address.c +++ b/shared-bindings/_bleio/Address.c @@ -42,7 +42,7 @@ //| """Create a new Address object encapsulating the address value. //| The value itself can be one of: //| -//| :param buf address: The address value to encapsulate. A buffer object (bytearray, bytes) of 6 bytes. +//| :param ~_typing.ReadableBuffer address: The address value to encapsulate. A buffer object (bytearray, bytes) of 6 bytes. //| :param int address_type: one of the integer values: `PUBLIC`, `RANDOM_STATIC`, //| `RANDOM_PRIVATE_RESOLVABLE`, or `RANDOM_PRIVATE_NON_RESOLVABLE`.""" //| ... @@ -128,7 +128,7 @@ const mp_obj_property_t bleio_address_type_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def __eq__(self, other: Address) -> bool: +//| def __eq__(self, other: object) -> bool: //| """Two Address objects are equal if their addresses and address types are equal.""" //| ... //| diff --git a/shared-bindings/_bleio/Characteristic.c b/shared-bindings/_bleio/Characteristic.c index 557a356b69..dbbacb7d57 100644 --- a/shared-bindings/_bleio/Characteristic.c +++ b/shared-bindings/_bleio/Characteristic.c @@ -63,7 +63,7 @@ //| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum //| number of data bytes that fit in a single BLE 4.x ATT packet. //| :param bool fixed_length: True if the characteristic value is of fixed length. -//| :param buf initial_value: The initial value for this characteristic. If not given, will be +//| :param ~_typing.ReadableBuffer initial_value: The initial value for this characteristic. If not given, will be //| filled with zeros. //| //| :return: the new Characteristic.""" diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index ed480ec04d..5d1b63bdd6 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -111,12 +111,12 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_connection_pair_obj, 1, bleio_connection //| def discover_remote_services(self, service_uuids_whitelist: Optional[Iterable[UUID]] = None) -> Tuple[Service, ...]: //| """Do BLE discovery for all services or for the given service UUIDS, -//| to find their handles and characteristics, and return the discovered services. -//| `Connection.connected` must be True. +//| to find their handles and characteristics, and return the discovered services. +//| `Connection.connected` must be True. //| //| :param iterable service_uuids_whitelist: //| -//| an iterable of :py:class:~`UUID` objects for the services provided by the peripheral +//| an iterable of :py:class:`UUID` objects for the services provided by the peripheral //| that you want to use. //| //| The peripheral may provide more services, but services not listed are ignored @@ -126,7 +126,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_connection_pair_obj, 1, bleio_connection //| slow. //| //| If the service UUID is 128-bit, or its characteristic UUID's are 128-bit, you -//| you must have already created a :py:class:~`UUID` object for that UUID in order for the +//| you must have already created a :py:class:`UUID` object for that UUID in order for the //| service or characteristic to be discovered. Creating the UUID causes the UUID to be //| registered for use. (This restriction may be lifted in the future.) //| diff --git a/shared-bindings/_bleio/Descriptor.c b/shared-bindings/_bleio/Descriptor.c index e24751f759..97422f1630 100644 --- a/shared-bindings/_bleio/Descriptor.c +++ b/shared-bindings/_bleio/Descriptor.c @@ -46,7 +46,7 @@ //| as part of remote Characteristics in the remote Services that are discovered.""" //| //| @classmethod -//| def add_to_characteristic(characteristic: Characteristic, uuid: UUID, *, read_perm: int = Attribute.OPEN, write_perm: int = Attribute.OPEN, max_length = 20, fixed_length: bool = False, initial_value: ReadableBuffer = b'') -> Descriptor: +//| def add_to_characteristic(cls, characteristic: Characteristic, uuid: UUID, *, read_perm: int = Attribute.OPEN, write_perm: int = Attribute.OPEN, max_length: int = 20, fixed_length: bool = False, initial_value: ReadableBuffer = b'') -> Descriptor: //| """Create a new Descriptor object, and add it to this Service. //| //| :param Characteristic characteristic: The characteristic that will hold this descriptor @@ -61,7 +61,7 @@ //| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum //| number of data bytes that fit in a single BLE 4.x ATT packet. //| :param bool fixed_length: True if the descriptor value is of fixed length. -//| :param buf initial_value: The initial value for this descriptor. +//| :param ~_typing.ReadableBuffer initial_value: The initial value for this descriptor. //| //| :return: the new Descriptor.""" //| ... diff --git a/shared-bindings/_bleio/UUID.c b/shared-bindings/_bleio/UUID.c index 6d92cf7931..18eda0b33b 100644 --- a/shared-bindings/_bleio/UUID.c +++ b/shared-bindings/_bleio/UUID.c @@ -48,7 +48,7 @@ //| temporary 16-bit UUID that can be used in place of the full 128-bit UUID. //| //| :param value: The uuid value to encapsulate -//| :type value: int or typing.ByteString""" +//| :type value: int, ~_typing.ReadableBuffer or str""" //| ... //| STATIC mp_obj_t bleio_uuid_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -248,7 +248,7 @@ STATIC mp_obj_t bleio_uuid_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -//| def __eq__(self, other: UUID) -> bool: +//| def __eq__(self, other: object) -> bool: //| """Two UUID objects are equal if their values match and they are both 128-bit or both 16-bit.""" //| ... //| diff --git a/shared-bindings/_bleio/__init__.c b/shared-bindings/_bleio/__init__.c index 3002ecd18c..ee9c4bf4a6 100644 --- a/shared-bindings/_bleio/__init__.c +++ b/shared-bindings/_bleio/__init__.c @@ -41,7 +41,8 @@ #include "shared-bindings/_bleio/Service.h" #include "shared-bindings/_bleio/UUID.h" -//| """ +//| """Bluetooth Low Energy (BLE) communication +//| //| The `_bleio` module provides necessary low-level functionality for communicating //| using Bluetooth Low Energy (BLE). The '_' prefix indicates this module is meant //| for internal use by libraries but not by the end user. Its API may change incompatibly @@ -50,12 +51,12 @@ //| `adafruit_ble `_ //| CircuitPython library instead, which builds on `_bleio`, and //| provides higher-level convenience functionality, including predefined beacons, clients, -//| servers. +//| servers.""" //| -//| .. attribute:: adapter -//| -//| BLE Adapter used to manage device discovery and connections. -//| This object is the sole instance of `_bleio.Adapter`.""" + +//| adapter: Adapter +//| """BLE Adapter used to manage device discovery and connections. +//| This object is the sole instance of `_bleio.Adapter`.""" //| //| class BluetoothError(Exception): diff --git a/shared-bindings/_eve/__init__.c b/shared-bindings/_eve/__init__.c index 51d3d65aee..0f628b6fb0 100644 --- a/shared-bindings/_eve/__init__.c +++ b/shared-bindings/_eve/__init__.c @@ -41,6 +41,9 @@ //| buffers and appending basic graphics commands.""" //| +//| class _EVE: +//| + typedef struct _mp_obj__EVE_t { mp_obj_base_t base; common_hal__eve_t _eve; @@ -51,6 +54,9 @@ STATIC const mp_obj_type_t _EVE_type; #define EVEHAL(s) \ (&((mp_obj__EVE_t*)mp_instance_cast_to_native_base((s), &_EVE_type))->_eve) +//| def register(self, o: object) -> None: +//| ... +//| STATIC mp_obj_t _register(mp_obj_t self, mp_obj_t o) { common_hal__eve_t *eve = EVEHAL(self); mp_load_method(o, MP_QSTR_write, eve->dest); @@ -58,11 +64,11 @@ STATIC mp_obj_t _register(mp_obj_t self, mp_obj_t o) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(register_obj, _register); -//| def flush(self) -> None: -//| """Send any queued drawing commands directly to the hardware. +//| def flush(self) -> None: +//| """Send any queued drawing commands directly to the hardware. //| -//| :param int width: The width of the grid in tiles, or 1 for sprites.""" -//| ... +//| :param int width: The width of the grid in tiles, or 1 for sprites.""" +//| ... //| STATIC mp_obj_t _flush(mp_obj_t self) { common_hal__eve_flush(EVEHAL(self)); @@ -70,11 +76,11 @@ STATIC mp_obj_t _flush(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(flush_obj, _flush); -//| def cc(self, b: ReadableBuffer) -> None: -//| """Append bytes to the command FIFO. +//| def cc(self, b: ReadableBuffer) -> None: +//| """Append bytes to the command FIFO. //| -//| :param bytes b: The bytes to add""" -//| ... +//| :param ~_typing.ReadableBuffer b: The bytes to add""" +//| ... //| STATIC mp_obj_t _cc(mp_obj_t self, mp_obj_t b) { mp_buffer_info_t buffer_info; @@ -86,14 +92,14 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(cc_obj, _cc); //{ -//| def AlphaFunc(self, func: int, ref: int) -> None: -//| """Set the alpha test function +//| def AlphaFunc(self, func: int, ref: int) -> None: +//| """Set the alpha test function //| -//| :param int func: specifies the test function, one of ``NEVER``, ``LESS``, ``LEQUAL``, ``GREATER``, ``GEQUAL``, ``EQUAL``, ``NOTEQUAL``, or ``ALWAYS``. Range 0-7. The initial value is ALWAYS(7) -//| :param int ref: specifies the reference value for the alpha test. Range 0-255. The initial value is 0 +//| :param int func: specifies the test function, one of ``NEVER``, ``LESS``, ``LEQUAL``, ``GREATER``, ``GEQUAL``, ``EQUAL``, ``NOTEQUAL``, or ``ALWAYS``. Range 0-7. The initial value is ALWAYS(7) +//| :param int ref: specifies the reference value for the alpha test. Range 0-255. The initial value is 0 //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _alphafunc(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -104,13 +110,13 @@ STATIC mp_obj_t _alphafunc(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(alphafunc_obj, _alphafunc); -//| def Begin(self, prim: int) -> None: -//| """Begin drawing a graphics primitive +//| def Begin(self, prim: int) -> None: +//| """Begin drawing a graphics primitive //| -//| :param int prim: graphics primitive. +//| :param int prim: graphics primitive. //| -//| Valid primitives are ``BITMAPS``, ``POINTS``, ``LINES``, ``LINE_STRIP``, ``EDGE_STRIP_R``, ``EDGE_STRIP_L``, ``EDGE_STRIP_A``, ``EDGE_STRIP_B`` and ``RECTS``.""" -//| ... +//| Valid primitives are ``BITMAPS``, ``POINTS``, ``LINES``, ``LINE_STRIP``, ``EDGE_STRIP_R``, ``EDGE_STRIP_L``, ``EDGE_STRIP_A``, ``EDGE_STRIP_B`` and ``RECTS``.""" +//| ... //| STATIC mp_obj_t _begin(mp_obj_t self, mp_obj_t a0) { @@ -120,11 +126,11 @@ STATIC mp_obj_t _begin(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(begin_obj, _begin); -//| def BitmapExtFormat(self, format: int) -> None: -//| """Set the bitmap format +//| def BitmapExtFormat(self, format: int) -> None: +//| """Set the bitmap format //| -//| :param int format: bitmap pixel format.""" -//| ... +//| :param int format: bitmap pixel format.""" +//| ... //| STATIC mp_obj_t _bitmapextformat(mp_obj_t self, mp_obj_t a0) { @@ -134,13 +140,13 @@ STATIC mp_obj_t _bitmapextformat(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmapextformat_obj, _bitmapextformat); -//| def BitmapHandle(self, handle: int) -> None: -//| """Set the bitmap handle +//| def BitmapHandle(self, handle: int) -> None: +//| """Set the bitmap handle //| -//| :param int handle: bitmap handle. Range 0-31. The initial value is 0 +//| :param int handle: bitmap handle. Range 0-31. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _bitmaphandle(mp_obj_t self, mp_obj_t a0) { @@ -150,12 +156,12 @@ STATIC mp_obj_t _bitmaphandle(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmaphandle_obj, _bitmaphandle); -//| def BitmapLayoutH(self, linestride: int, height: int) -> None: -//| """Set the source bitmap memory format and layout for the current handle. high bits for large bitmaps +//| def BitmapLayoutH(self, linestride: int, height: int) -> None: +//| """Set the source bitmap memory format and layout for the current handle. high bits for large bitmaps //| -//| :param int linestride: high part of bitmap line stride, in bytes. Range 0-7 -//| :param int height: high part of bitmap height, in lines. Range 0-3""" -//| ... +//| :param int linestride: high part of bitmap line stride, in bytes. Range 0-7 +//| :param int height: high part of bitmap height, in lines. Range 0-3""" +//| ... //| STATIC mp_obj_t _bitmaplayouth(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -166,13 +172,13 @@ STATIC mp_obj_t _bitmaplayouth(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaplayouth_obj, _bitmaplayouth); -//| def BitmapLayout(self, format: int, linestride: int, height: int) -> None: -//| """Set the source bitmap memory format and layout for the current handle +//| def BitmapLayout(self, format: int, linestride: int, height: int) -> None: +//| """Set the source bitmap memory format and layout for the current handle //| -//| :param int format: bitmap pixel format, or GLFORMAT to use BITMAP_EXT_FORMAT instead. Range 0-31 -//| :param int linestride: bitmap line stride, in bytes. Range 0-1023 -//| :param int height: bitmap height, in lines. Range 0-511""" -//| ... +//| :param int format: bitmap pixel format, or GLFORMAT to use BITMAP_EXT_FORMAT instead. Range 0-31 +//| :param int linestride: bitmap line stride, in bytes. Range 0-1023 +//| :param int height: bitmap height, in lines. Range 0-511""" +//| ... //| STATIC mp_obj_t _bitmaplayout(size_t n_args, const mp_obj_t *args) { @@ -184,12 +190,12 @@ STATIC mp_obj_t _bitmaplayout(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitmaplayout_obj, 4, 4, _bitmaplayout); -//| def BitmapSizeH(self, width: int, height: int) -> None: -//| """Set the screen drawing of bitmaps for the current handle. high bits for large bitmaps +//| def BitmapSizeH(self, width: int, height: int) -> None: +//| """Set the screen drawing of bitmaps for the current handle. high bits for large bitmaps //| -//| :param int width: high part of drawn bitmap width, in pixels. Range 0-3 -//| :param int height: high part of drawn bitmap height, in pixels. Range 0-3""" -//| ... +//| :param int width: high part of drawn bitmap width, in pixels. Range 0-3 +//| :param int height: high part of drawn bitmap height, in pixels. Range 0-3""" +//| ... //| STATIC mp_obj_t _bitmapsizeh(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -200,15 +206,15 @@ STATIC mp_obj_t _bitmapsizeh(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmapsizeh_obj, _bitmapsizeh); -//| def BitmapSize(self, filter: int, wrapx: int, wrapy: int, width: int, height: int) -> None: -//| """Set the screen drawing of bitmaps for the current handle +//| def BitmapSize(self, filter: int, wrapx: int, wrapy: int, width: int, height: int) -> None: +//| """Set the screen drawing of bitmaps for the current handle //| -//| :param int filter: bitmap filtering mode, one of ``NEAREST`` or ``BILINEAR``. Range 0-1 -//| :param int wrapx: bitmap :math:`x` wrap mode, one of ``REPEAT`` or ``BORDER``. Range 0-1 -//| :param int wrapy: bitmap :math:`y` wrap mode, one of ``REPEAT`` or ``BORDER``. Range 0-1 -//| :param int width: drawn bitmap width, in pixels. Range 0-511 -//| :param int height: drawn bitmap height, in pixels. Range 0-511""" -//| ... +//| :param int filter: bitmap filtering mode, one of ``NEAREST`` or ``BILINEAR``. Range 0-1 +//| :param int wrapx: bitmap :math:`x` wrap mode, one of ``REPEAT`` or ``BORDER``. Range 0-1 +//| :param int wrapy: bitmap :math:`y` wrap mode, one of ``REPEAT`` or ``BORDER``. Range 0-1 +//| :param int width: drawn bitmap width, in pixels. Range 0-511 +//| :param int height: drawn bitmap height, in pixels. Range 0-511""" +//| ... //| STATIC mp_obj_t _bitmapsize(size_t n_args, const mp_obj_t *args) { @@ -222,11 +228,11 @@ STATIC mp_obj_t _bitmapsize(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitmapsize_obj, 6, 6, _bitmapsize); -//| def BitmapSource(self, addr: int) -> None: -//| """Set the source address for bitmap graphics +//| def BitmapSource(self, addr: int) -> None: +//| """Set the source address for bitmap graphics //| -//| :param int addr: Bitmap start address, pixel-aligned. May be in SRAM or flash. Range 0-16777215""" -//| ... +//| :param int addr: Bitmap start address, pixel-aligned. May be in SRAM or flash. Range 0-16777215""" +//| ... //| STATIC mp_obj_t _bitmapsource(mp_obj_t self, mp_obj_t a0) { @@ -236,14 +242,14 @@ STATIC mp_obj_t _bitmapsource(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmapsource_obj, _bitmapsource); -//| def BitmapSwizzle(self, r: int, g: int, b: int, a: int) -> None: -//| """Set the source for the r,g,b and a channels of a bitmap +//| def BitmapSwizzle(self, r: int, g: int, b: int, a: int) -> None: +//| """Set the source for the r,g,b and a channels of a bitmap //| -//| :param int r: red component source channel. Range 0-7 -//| :param int g: green component source channel. Range 0-7 -//| :param int b: blue component source channel. Range 0-7 -//| :param int a: alpha component source channel. Range 0-7""" -//| ... +//| :param int r: red component source channel. Range 0-7 +//| :param int g: green component source channel. Range 0-7 +//| :param int b: blue component source channel. Range 0-7 +//| :param int a: alpha component source channel. Range 0-7""" +//| ... //| STATIC mp_obj_t _bitmapswizzle(size_t n_args, const mp_obj_t *args) { @@ -256,16 +262,16 @@ STATIC mp_obj_t _bitmapswizzle(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitmapswizzle_obj, 5, 5, _bitmapswizzle); -//| def BitmapTransformA(self, p: int, v: int) -> None: -//| """Set the :math:`a` component of the bitmap transform matrix +//| def BitmapTransformA(self, p: int, v: int) -> None: +//| """Set the :math:`a` component of the bitmap transform matrix //| -//| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0 -//| :param int v: The :math:`a` component of the bitmap transform matrix, in signed 8.8 or 1.15 bit fixed-point form. Range 0-131071. The initial value is 256 +//| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0 +//| :param int v: The :math:`a` component of the bitmap transform matrix, in signed 8.8 or 1.15 bit fixed-point form. Range 0-131071. The initial value is 256 //| -//| The initial value is **p** = 0, **v** = 256. This represents the value 1.0. +//| The initial value is **p** = 0, **v** = 256. This represents the value 1.0. //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _bitmaptransforma(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -276,16 +282,16 @@ STATIC mp_obj_t _bitmaptransforma(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaptransforma_obj, _bitmaptransforma); -//| def BitmapTransformB(self, p: int, v: int) -> None: -//| """Set the :math:`b` component of the bitmap transform matrix +//| def BitmapTransformB(self, p: int, v: int) -> None: +//| """Set the :math:`b` component of the bitmap transform matrix //| -//| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0 -//| :param int v: The :math:`b` component of the bitmap transform matrix, in signed 8.8 or 1.15 bit fixed-point form. Range 0-131071. The initial value is 0 +//| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0 +//| :param int v: The :math:`b` component of the bitmap transform matrix, in signed 8.8 or 1.15 bit fixed-point form. Range 0-131071. The initial value is 0 //| -//| The initial value is **p** = 0, **v** = 0. This represents the value 0.0. +//| The initial value is **p** = 0, **v** = 0. This represents the value 0.0. //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _bitmaptransformb(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -296,13 +302,13 @@ STATIC mp_obj_t _bitmaptransformb(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaptransformb_obj, _bitmaptransformb); -//| def BitmapTransformC(self, v: int) -> None: -//| """Set the :math:`c` component of the bitmap transform matrix +//| def BitmapTransformC(self, v: int) -> None: +//| """Set the :math:`c` component of the bitmap transform matrix //| -//| :param int v: The :math:`c` component of the bitmap transform matrix, in signed 15.8 bit fixed-point form. Range 0-16777215. The initial value is 0 +//| :param int v: The :math:`c` component of the bitmap transform matrix, in signed 15.8 bit fixed-point form. Range 0-16777215. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _bitmaptransformc(mp_obj_t self, mp_obj_t a0) { @@ -312,16 +318,16 @@ STATIC mp_obj_t _bitmaptransformc(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmaptransformc_obj, _bitmaptransformc); -//| def BitmapTransformD(self, p: int, v: int) -> None: -//| """Set the :math:`d` component of the bitmap transform matrix +//| def BitmapTransformD(self, p: int, v: int) -> None: +//| """Set the :math:`d` component of the bitmap transform matrix //| -//| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0 -//| :param int v: The :math:`d` component of the bitmap transform matrix, in signed 8.8 or 1.15 bit fixed-point form. Range 0-131071. The initial value is 0 +//| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0 +//| :param int v: The :math:`d` component of the bitmap transform matrix, in signed 8.8 or 1.15 bit fixed-point form. Range 0-131071. The initial value is 0 //| -//| The initial value is **p** = 0, **v** = 0. This represents the value 0.0. +//| The initial value is **p** = 0, **v** = 0. This represents the value 0.0. //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _bitmaptransformd(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -332,16 +338,16 @@ STATIC mp_obj_t _bitmaptransformd(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaptransformd_obj, _bitmaptransformd); -//| def BitmapTransformE(self, p: int, v: int) -> None: -//| """Set the :math:`e` component of the bitmap transform matrix +//| def BitmapTransformE(self, p: int, v: int) -> None: +//| """Set the :math:`e` component of the bitmap transform matrix //| -//| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0 -//| :param int v: The :math:`e` component of the bitmap transform matrix, in signed 8.8 or 1.15 bit fixed-point form. Range 0-131071. The initial value is 256 +//| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0 +//| :param int v: The :math:`e` component of the bitmap transform matrix, in signed 8.8 or 1.15 bit fixed-point form. Range 0-131071. The initial value is 256 //| -//| The initial value is **p** = 0, **v** = 256. This represents the value 1.0. +//| The initial value is **p** = 0, **v** = 256. This represents the value 1.0. //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _bitmaptransforme(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -352,13 +358,13 @@ STATIC mp_obj_t _bitmaptransforme(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaptransforme_obj, _bitmaptransforme); -//| def BitmapTransformF(self, v: int) -> None: -//| """Set the :math:`f` component of the bitmap transform matrix +//| def BitmapTransformF(self, v: int) -> None: +//| """Set the :math:`f` component of the bitmap transform matrix //| -//| :param int v: The :math:`f` component of the bitmap transform matrix, in signed 15.8 bit fixed-point form. Range 0-16777215. The initial value is 0 +//| :param int v: The :math:`f` component of the bitmap transform matrix, in signed 15.8 bit fixed-point form. Range 0-16777215. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _bitmaptransformf(mp_obj_t self, mp_obj_t a0) { @@ -368,14 +374,14 @@ STATIC mp_obj_t _bitmaptransformf(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmaptransformf_obj, _bitmaptransformf); -//| def BlendFunc(self, src: int, dst: int) -> None: -//| """Set pixel arithmetic +//| def BlendFunc(self, src: int, dst: int) -> None: +//| """Set pixel arithmetic //| -//| :param int src: specifies how the source blending factor is computed. One of ``ZERO``, ``ONE``, ``SRC_ALPHA``, ``DST_ALPHA``, ``ONE_MINUS_SRC_ALPHA`` or ``ONE_MINUS_DST_ALPHA``. Range 0-7. The initial value is SRC_ALPHA(2) -//| :param int dst: specifies how the destination blending factor is computed, one of the same constants as **src**. Range 0-7. The initial value is ONE_MINUS_SRC_ALPHA(4) +//| :param int src: specifies how the source blending factor is computed. One of ``ZERO``, ``ONE``, ``SRC_ALPHA``, ``DST_ALPHA``, ``ONE_MINUS_SRC_ALPHA`` or ``ONE_MINUS_DST_ALPHA``. Range 0-7. The initial value is SRC_ALPHA(2) +//| :param int dst: specifies how the destination blending factor is computed, one of the same constants as **src**. Range 0-7. The initial value is ONE_MINUS_SRC_ALPHA(4) //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _blendfunc(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -386,11 +392,11 @@ STATIC mp_obj_t _blendfunc(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(blendfunc_obj, _blendfunc); -//| def Call(self, dest: int) -> None: -//| """Execute a sequence of commands at another location in the display list +//| def Call(self, dest: int) -> None: +//| """Execute a sequence of commands at another location in the display list //| -//| :param int dest: display list address. Range 0-65535""" -//| ... +//| :param int dest: display list address. Range 0-65535""" +//| ... //| STATIC mp_obj_t _call(mp_obj_t self, mp_obj_t a0) { @@ -400,13 +406,13 @@ STATIC mp_obj_t _call(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(call_obj, _call); -//| def Cell(self, cell: int) -> None: -//| """Set the bitmap cell number for the vertex2f command +//| def Cell(self, cell: int) -> None: +//| """Set the bitmap cell number for the vertex2f command //| -//| :param int cell: bitmap cell number. Range 0-127. The initial value is 0 +//| :param int cell: bitmap cell number. Range 0-127. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _cell(mp_obj_t self, mp_obj_t a0) { @@ -416,13 +422,13 @@ STATIC mp_obj_t _cell(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(cell_obj, _cell); -//| def ClearColorA(self, alpha: int) -> None: -//| """Set clear value for the alpha channel +//| def ClearColorA(self, alpha: int) -> None: +//| """Set clear value for the alpha channel //| -//| :param int alpha: alpha value used when the color buffer is cleared. Range 0-255. The initial value is 0 +//| :param int alpha: alpha value used when the color buffer is cleared. Range 0-255. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _clearcolora(mp_obj_t self, mp_obj_t a0) { @@ -432,15 +438,15 @@ STATIC mp_obj_t _clearcolora(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(clearcolora_obj, _clearcolora); -//| def ClearColorRGB(self, red: int, green: int, blue: int) -> None: -//| """Set clear values for red, green and blue channels +//| def ClearColorRGB(self, red: int, green: int, blue: int) -> None: +//| """Set clear values for red, green and blue channels //| -//| :param int red: red value used when the color buffer is cleared. Range 0-255. The initial value is 0 -//| :param int green: green value used when the color buffer is cleared. Range 0-255. The initial value is 0 -//| :param int blue: blue value used when the color buffer is cleared. Range 0-255. The initial value is 0 +//| :param int red: red value used when the color buffer is cleared. Range 0-255. The initial value is 0 +//| :param int green: green value used when the color buffer is cleared. Range 0-255. The initial value is 0 +//| :param int blue: blue value used when the color buffer is cleared. Range 0-255. The initial value is 0 //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _clearcolorrgb(size_t n_args, const mp_obj_t *args) { @@ -452,13 +458,13 @@ STATIC mp_obj_t _clearcolorrgb(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(clearcolorrgb_obj, 4, 4, _clearcolorrgb); -//| def Clear(self, c: int, s: int, t: int) -> None: -//| """Clear buffers to preset values +//| def Clear(self, c: int, s: int, t: int) -> None: +//| """Clear buffers to preset values //| -//| :param int c: clear color buffer. Range 0-1 -//| :param int s: clear stencil buffer. Range 0-1 -//| :param int t: clear tag buffer. Range 0-1""" -//| ... +//| :param int c: clear color buffer. Range 0-1 +//| :param int s: clear stencil buffer. Range 0-1 +//| :param int t: clear tag buffer. Range 0-1""" +//| ... //| STATIC mp_obj_t _clear(size_t n_args, const mp_obj_t *args) { @@ -470,13 +476,13 @@ STATIC mp_obj_t _clear(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(clear_obj, 1, 4, _clear); -//| def ClearStencil(self, s: int) -> None: -//| """Set clear value for the stencil buffer +//| def ClearStencil(self, s: int) -> None: +//| """Set clear value for the stencil buffer //| -//| :param int s: value used when the stencil buffer is cleared. Range 0-255. The initial value is 0 +//| :param int s: value used when the stencil buffer is cleared. Range 0-255. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _clearstencil(mp_obj_t self, mp_obj_t a0) { @@ -486,12 +492,12 @@ STATIC mp_obj_t _clearstencil(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(clearstencil_obj, _clearstencil); -//| def ClearTag(self, s: int) -> None: -//| """Set clear value for the tag buffer +//| def ClearTag(self, s: int) -> None: +//| """Set clear value for the tag buffer //| -//| :param int s: value used when the tag buffer is cleared. Range 0-255. The initial value is 0 +//| :param int s: value used when the tag buffer is cleared. Range 0-255. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" //| STATIC mp_obj_t _cleartag(mp_obj_t self, mp_obj_t a0) { @@ -501,13 +507,13 @@ STATIC mp_obj_t _cleartag(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(cleartag_obj, _cleartag); -//| def ColorA(self, alpha: int) -> None: -//| """Set the current color alpha +//| def ColorA(self, alpha: int) -> None: +//| """Set the current color alpha //| -//| :param int alpha: alpha for the current color. Range 0-255. The initial value is 255 +//| :param int alpha: alpha for the current color. Range 0-255. The initial value is 255 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _colora(mp_obj_t self, mp_obj_t a0) { @@ -517,16 +523,16 @@ STATIC mp_obj_t _colora(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(colora_obj, _colora); -//| def ColorMask(self, r: int, g: int, b: int, a: int) -> None: -//| """Enable and disable writing of frame buffer color components +//| def ColorMask(self, r: int, g: int, b: int, a: int) -> None: +//| """Enable and disable writing of frame buffer color components //| -//| :param int r: allow updates to the frame buffer red component. Range 0-1. The initial value is 1 -//| :param int g: allow updates to the frame buffer green component. Range 0-1. The initial value is 1 -//| :param int b: allow updates to the frame buffer blue component. Range 0-1. The initial value is 1 -//| :param int a: allow updates to the frame buffer alpha component. Range 0-1. The initial value is 1 +//| :param int r: allow updates to the frame buffer red component. Range 0-1. The initial value is 1 +//| :param int g: allow updates to the frame buffer green component. Range 0-1. The initial value is 1 +//| :param int b: allow updates to the frame buffer blue component. Range 0-1. The initial value is 1 +//| :param int a: allow updates to the frame buffer alpha component. Range 0-1. The initial value is 1 //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _colormask(size_t n_args, const mp_obj_t *args) { @@ -539,15 +545,15 @@ STATIC mp_obj_t _colormask(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(colormask_obj, 5, 5, _colormask); -//| def ColorRGB(self, red: int, green: int, blue: int) -> None: -//| """Set the drawing color +//| def ColorRGB(self, red: int, green: int, blue: int) -> None: +//| """Set the drawing color //| -//| :param int red: red value for the current color. Range 0-255. The initial value is 255 -//| :param int green: green for the current color. Range 0-255. The initial value is 255 -//| :param int blue: blue for the current color. Range 0-255. The initial value is 255 +//| :param int red: red value for the current color. Range 0-255. The initial value is 255 +//| :param int green: green for the current color. Range 0-255. The initial value is 255 +//| :param int blue: blue for the current color. Range 0-255. The initial value is 255 //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _colorrgb(size_t n_args, const mp_obj_t *args) { @@ -559,9 +565,9 @@ STATIC mp_obj_t _colorrgb(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(colorrgb_obj, 4, 4, _colorrgb); -//| def Display(self) -> None: -//| """End the display list""" -//| ... +//| def Display(self) -> None: +//| """End the display list""" +//| ... STATIC mp_obj_t _display(mp_obj_t self) { @@ -570,11 +576,11 @@ STATIC mp_obj_t _display(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(display_obj, _display); -//| def End(self) -> None: -//| """End drawing a graphics primitive +//| def End(self) -> None: +//| """End drawing a graphics primitive //| -//| :meth:`Vertex2ii` and :meth:`Vertex2f` calls are ignored until the next :meth:`Begin`.""" -//| ... +//| :meth:`Vertex2ii` and :meth:`Vertex2f` calls are ignored until the next :meth:`Begin`.""" +//| ... //| STATIC mp_obj_t _end(mp_obj_t self) { @@ -584,11 +590,11 @@ STATIC mp_obj_t _end(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(end_obj, _end); -//| def Jump(self, dest: int) -> None: -//| """Execute commands at another location in the display list +//| def Jump(self, dest: int) -> None: +//| """Execute commands at another location in the display list //| -//| :param int dest: display list address. Range 0-65535""" -//| ... +//| :param int dest: display list address. Range 0-65535""" +//| ... //| STATIC mp_obj_t _jump(mp_obj_t self, mp_obj_t a0) { @@ -598,13 +604,13 @@ STATIC mp_obj_t _jump(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(jump_obj, _jump); -//| def LineWidth(self, width: int) -> None: -//| """Set the width of rasterized lines +//| def LineWidth(self, width: int) -> None: +//| """Set the width of rasterized lines //| -//| :param int width: line width in :math:`1/16` pixel. Range 0-4095. The initial value is 16 +//| :param int width: line width in :math:`1/16` pixel. Range 0-4095. The initial value is 16 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _linewidth(mp_obj_t self, mp_obj_t a0) { @@ -614,11 +620,11 @@ STATIC mp_obj_t _linewidth(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(linewidth_obj, _linewidth); -//| def Macro(self, m: int) -> None: -//| """Execute a single command from a macro register +//| def Macro(self, m: int) -> None: +//| """Execute a single command from a macro register //| -//| :param int m: macro register to read. Range 0-1""" -//| ... +//| :param int m: macro register to read. Range 0-1""" +//| ... //| STATIC mp_obj_t _macro(mp_obj_t self, mp_obj_t a0) { @@ -628,9 +634,9 @@ STATIC mp_obj_t _macro(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(macro_obj, _macro); -//| def Nop(self) -> None: -//| """No operation""" -//| ... +//| def Nop(self) -> None: +//| """No operation""" +//| ... //| STATIC mp_obj_t _nop(mp_obj_t self) { @@ -640,13 +646,13 @@ STATIC mp_obj_t _nop(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(nop_obj, _nop); -//| def PaletteSource(self, addr: int) -> None: -//| """Set the base address of the palette +//| def PaletteSource(self, addr: int) -> None: +//| """Set the base address of the palette //| -//| :param int addr: Address in graphics SRAM, 2-byte aligned. Range 0-4194303. The initial value is 0 +//| :param int addr: Address in graphics SRAM, 2-byte aligned. Range 0-4194303. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _palettesource(mp_obj_t self, mp_obj_t a0) { @@ -656,13 +662,13 @@ STATIC mp_obj_t _palettesource(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(palettesource_obj, _palettesource); -//| def PointSize(self, size: int) -> None: -//| """Set the radius of rasterized points +//| def PointSize(self, size: int) -> None: +//| """Set the radius of rasterized points //| -//| :param int size: point radius in :math:`1/16` pixel. Range 0-8191. The initial value is 16 +//| :param int size: point radius in :math:`1/16` pixel. Range 0-8191. The initial value is 16 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _pointsize(mp_obj_t self, mp_obj_t a0) { @@ -672,9 +678,9 @@ STATIC mp_obj_t _pointsize(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(pointsize_obj, _pointsize); -//| def RestoreContext(self) -> None: -//| """Restore the current graphics context from the context stack""" -//| ... +//| def RestoreContext(self) -> None: +//| """Restore the current graphics context from the context stack""" +//| ... //| STATIC mp_obj_t _restorecontext(mp_obj_t self) { @@ -684,9 +690,9 @@ STATIC mp_obj_t _restorecontext(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(restorecontext_obj, _restorecontext); -//| def Return(self) -> None: -//| """Return from a previous call command""" -//| ... +//| def Return(self) -> None: +//| """Return from a previous call command""" +//| ... //| STATIC mp_obj_t _return(mp_obj_t self) { @@ -696,9 +702,9 @@ STATIC mp_obj_t _return(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(return_obj, _return); -//| def SaveContext(self) -> None: -//| """Push the current graphics context on the context stack""" -//| ... +//| def SaveContext(self) -> None: +//| """Push the current graphics context on the context stack""" +//| ... //| STATIC mp_obj_t _savecontext(mp_obj_t self) { @@ -708,14 +714,14 @@ STATIC mp_obj_t _savecontext(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(savecontext_obj, _savecontext); -//| def ScissorSize(self, width: int, height: int) -> None: -//| """Set the size of the scissor clip rectangle +//| def ScissorSize(self, width: int, height: int) -> None: +//| """Set the size of the scissor clip rectangle //| -//| :param int width: The width of the scissor clip rectangle, in pixels. Range 0-4095. The initial value is hsize -//| :param int height: The height of the scissor clip rectangle, in pixels. Range 0-4095. The initial value is 2048 +//| :param int width: The width of the scissor clip rectangle, in pixels. Range 0-4095. The initial value is hsize +//| :param int height: The height of the scissor clip rectangle, in pixels. Range 0-4095. The initial value is 2048 //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _scissorsize(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -726,14 +732,14 @@ STATIC mp_obj_t _scissorsize(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(scissorsize_obj, _scissorsize); -//| def ScissorXY(self, x: int, y: int) -> None: -//| """Set the top left corner of the scissor clip rectangle +//| def ScissorXY(self, x: int, y: int) -> None: +//| """Set the top left corner of the scissor clip rectangle //| -//| :param int x: The :math:`x` coordinate of the scissor clip rectangle, in pixels. Range 0-2047. The initial value is 0 -//| :param int y: The :math:`y` coordinate of the scissor clip rectangle, in pixels. Range 0-2047. The initial value is 0 +//| :param int x: The :math:`x` coordinate of the scissor clip rectangle, in pixels. Range 0-2047. The initial value is 0 +//| :param int y: The :math:`y` coordinate of the scissor clip rectangle, in pixels. Range 0-2047. The initial value is 0 //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _scissorxy(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -744,15 +750,15 @@ STATIC mp_obj_t _scissorxy(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(scissorxy_obj, _scissorxy); -//| def StencilFunc(self, func: int, ref: int, mask: int) -> None: -//| """Set function and reference value for stencil testing +//| def StencilFunc(self, func: int, ref: int, mask: int) -> None: +//| """Set function and reference value for stencil testing //| -//| :param int func: specifies the test function, one of ``NEVER``, ``LESS``, ``LEQUAL``, ``GREATER``, ``GEQUAL``, ``EQUAL``, ``NOTEQUAL``, or ``ALWAYS``. Range 0-7. The initial value is ALWAYS(7) -//| :param int ref: specifies the reference value for the stencil test. Range 0-255. The initial value is 0 -//| :param int mask: specifies a mask that is ANDed with the reference value and the stored stencil value. Range 0-255. The initial value is 255 +//| :param int func: specifies the test function, one of ``NEVER``, ``LESS``, ``LEQUAL``, ``GREATER``, ``GEQUAL``, ``EQUAL``, ``NOTEQUAL``, or ``ALWAYS``. Range 0-7. The initial value is ALWAYS(7) +//| :param int ref: specifies the reference value for the stencil test. Range 0-255. The initial value is 0 +//| :param int mask: specifies a mask that is ANDed with the reference value and the stored stencil value. Range 0-255. The initial value is 255 //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _stencilfunc(size_t n_args, const mp_obj_t *args) { @@ -764,13 +770,13 @@ STATIC mp_obj_t _stencilfunc(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(stencilfunc_obj, 4, 4, _stencilfunc); -//| def StencilMask(self, mask: int) -> None: -//| """Control the writing of individual bits in the stencil planes +//| def StencilMask(self, mask: int) -> None: +//| """Control the writing of individual bits in the stencil planes //| -//| :param int mask: the mask used to enable writing stencil bits. Range 0-255. The initial value is 255 +//| :param int mask: the mask used to enable writing stencil bits. Range 0-255. The initial value is 255 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _stencilmask(mp_obj_t self, mp_obj_t a0) { @@ -780,14 +786,14 @@ STATIC mp_obj_t _stencilmask(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(stencilmask_obj, _stencilmask); -//| def StencilOp(self, sfail: int, spass: int) -> None: -//| """Set stencil test actions +//| def StencilOp(self, sfail: int, spass: int) -> None: +//| """Set stencil test actions //| -//| :param int sfail: specifies the action to take when the stencil test fails, one of ``KEEP``, ``ZERO``, ``REPLACE``, ``INCR``, ``INCR_WRAP``, ``DECR``, ``DECR_WRAP``, and ``INVERT``. Range 0-7. The initial value is KEEP(1) -//| :param int spass: specifies the action to take when the stencil test passes, one of the same constants as **sfail**. Range 0-7. The initial value is KEEP(1) +//| :param int sfail: specifies the action to take when the stencil test fails, one of ``KEEP``, ``ZERO``, ``REPLACE``, ``INCR``, ``INCR_WRAP``, ``DECR``, ``DECR_WRAP``, and ``INVERT``. Range 0-7. The initial value is KEEP(1) +//| :param int spass: specifies the action to take when the stencil test passes, one of the same constants as **sfail**. Range 0-7. The initial value is KEEP(1) //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _stencilop(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -798,13 +804,13 @@ STATIC mp_obj_t _stencilop(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(stencilop_obj, _stencilop); -//| def TagMask(self, mask: int) -> None: -//| """Control the writing of the tag buffer +//| def TagMask(self, mask: int) -> None: +//| """Control the writing of the tag buffer //| -//| :param int mask: allow updates to the tag buffer. Range 0-1. The initial value is 1 +//| :param int mask: allow updates to the tag buffer. Range 0-1. The initial value is 1 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _tagmask(mp_obj_t self, mp_obj_t a0) { @@ -814,13 +820,13 @@ STATIC mp_obj_t _tagmask(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(tagmask_obj, _tagmask); -//| def Tag(self, s: int) -> None: -//| """Set the current tag value +//| def Tag(self, s: int) -> None: +//| """Set the current tag value //| -//| :param int s: tag value. Range 0-255. The initial value is 255 +//| :param int s: tag value. Range 0-255. The initial value is 255 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _tag(mp_obj_t self, mp_obj_t a0) { @@ -830,13 +836,13 @@ STATIC mp_obj_t _tag(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(tag_obj, _tag); -//| def VertexTranslateX(self, x: int) -> None: -//| """Set the vertex transformation's x translation component +//| def VertexTranslateX(self, x: int) -> None: +//| """Set the vertex transformation's x translation component //| -//| :param int x: signed x-coordinate in :math:`1/16` pixel. Range 0-131071. The initial value is 0 +//| :param int x: signed x-coordinate in :math:`1/16` pixel. Range 0-131071. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _vertextranslatex(mp_obj_t self, mp_obj_t a0) { @@ -846,13 +852,13 @@ STATIC mp_obj_t _vertextranslatex(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(vertextranslatex_obj, _vertextranslatex); -//| def VertexTranslateY(self, y: int) -> None: -//| """Set the vertex transformation's y translation component +//| def VertexTranslateY(self, y: int) -> None: +//| """Set the vertex transformation's y translation component //| -//| :param int y: signed y-coordinate in :math:`1/16` pixel. Range 0-131071. The initial value is 0 +//| :param int y: signed y-coordinate in :math:`1/16` pixel. Range 0-131071. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| @@ -863,13 +869,13 @@ STATIC mp_obj_t _vertextranslatey(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(vertextranslatey_obj, _vertextranslatey); -//| def VertexFormat(self, frac: int) -> None: -//| """Set the precision of vertex2f coordinates +//| def VertexFormat(self, frac: int) -> None: +//| """Set the precision of vertex2f coordinates //| -//| :param int frac: Number of fractional bits in X,Y coordinates, 0-4. Range 0-7. The initial value is 4 +//| :param int frac: Number of fractional bits in X,Y coordinates, 0-4. Range 0-7. The initial value is 4 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" -//| ... +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _vertexformat(mp_obj_t self, mp_obj_t a0) { @@ -879,14 +885,14 @@ STATIC mp_obj_t _vertexformat(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(vertexformat_obj, _vertexformat); -//| def Vertex2ii(self, x: int, y: int, handle: int, cell: int) -> None: -//| """:param int x: x-coordinate in pixels. Range 0-511 -//| :param int y: y-coordinate in pixels. Range 0-511 -//| :param int handle: bitmap handle. Range 0-31 -//| :param int cell: cell number. Range 0-127 +//| def Vertex2ii(self, x: int, y: int, handle: int, cell: int) -> None: +//| """:param int x: x-coordinate in pixels. Range 0-511 +//| :param int y: y-coordinate in pixels. Range 0-511 +//| :param int handle: bitmap handle. Range 0-31 +//| :param int cell: cell number. Range 0-127 //| -//| This method is an alternative to :meth:`Vertex2f`.""" -//| ... +//| This method is an alternative to :meth:`Vertex2f`.""" +//| ... //| STATIC mp_obj_t _vertex2ii(size_t n_args, const mp_obj_t *args) { @@ -954,12 +960,12 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(vertex2ii_obj, 3, 5, _vertex2ii); // Hand-written functions { -//| def Vertex2f(self, b: float) -> None: -//| """Draw a point. +//| def Vertex2f(self, b: float) -> None: +//| """Draw a point. //| -//| :param float x: pixel x-coordinate -//| :param float y: pixel y-coordinate""" -//| ... +//| :param float x: pixel x-coordinate +//| :param float y: pixel y-coordinate""" +//| ... //| STATIC mp_obj_t _vertex2f(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { mp_float_t x = mp_obj_get_float(a0); @@ -973,14 +979,14 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_3(vertex2f_obj, _vertex2f); #define ADD_X(self, x) \ common_hal__eve_add(EVEHAL(self), sizeof(x), &(x)); -//| def cmd0(self, n: int) -> None: -//| """Append the command word n to the FIFO +//| def cmd0(self, n: int) -> None: +//| """Append the command word n to the FIFO //| -//| :param int n: The command code +//| :param int n: The command code //| -//| This method is used by the ``eve`` module to efficiently add -//| commands to the FIFO.""" -//| ... +//| This method is used by the ``eve`` module to efficiently add +//| commands to the FIFO.""" +//| ... //| STATIC mp_obj_t _cmd0(mp_obj_t self, mp_obj_t n) { @@ -990,18 +996,19 @@ STATIC mp_obj_t _cmd0(mp_obj_t self, mp_obj_t n) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(cmd0_obj, _cmd0); -//| def cmd(self, n: int, fmt: str, args: tuple) -> None: -//| """Append a command packet to the FIFO. +//| def cmd(self, n: int, fmt: str, args: Tuple[str, ...]) -> None: +//| """Append a command packet to the FIFO. //| -//| :param int n: The command code -//| :param str fmt: The command format `struct` layout -//| :param tuple args: The command's arguments +//| :param int n: The command code +//| :param str fmt: The command format `struct` layout +//| :param args: The command's arguments +//| :type args: tuple(str, ...) //| -//| Supported format codes: h, H, i, I. +//| Supported format codes: h, H, i, I. //| -//| This method is used by the ``eve`` module to efficiently add -//| commands to the FIFO.""" -//| ... +//| This method is used by the ``eve`` module to efficiently add +//| commands to the FIFO.""" +//| ... //| STATIC mp_obj_t _cmd(size_t n_args, const mp_obj_t *args) { mp_obj_t self = args[0]; diff --git a/shared-bindings/_pew/PewPew.c b/shared-bindings/_pew/PewPew.c index 0563181d9f..a8a43e1571 100644 --- a/shared-bindings/_pew/PewPew.c +++ b/shared-bindings/_pew/PewPew.c @@ -48,26 +48,8 @@ //| def __init__( //| self, //| buffer: ReadableBuffer, -//| rows: List[ -//| digitalio.DigitalInOut, -//| digitalio.DigitalInOut, -//| digitalio.DigitalInOut, -//| digitalio.DigitalInOut, -//| digitalio.DigitalInOut, -//| digitalio.DigitalInOut, -//| digitalio.DigitalInOut, -//| digitalio.DigitalInOut, -//| ], -//| cols: List[ -//| digitalio.DigitalInOut, -//| digitalio.DigitalInOut, -//| digitalio.DigitalInOut, -//| digitalio.DigitalInOut, -//| digitalio.DigitalInOut, -//| digitalio.DigitalInOut, -//| digitalio.DigitalInOut, -//| digitalio.DigitalInOut, -//| ], +//| rows: List[digitalio.DigitalInOut], +//| cols: List[digitalio.DigitalInOut], //| buttons: digitalio.DigitalInOut, //| ) -> None: //| """Initializes matrix scanning routines. diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index abfe190d80..4fc6f7cbf6 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -58,12 +58,12 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t //| brightness (0.0-1.0) and will enable a Dotstar compatible 1st byte for each //| pixel. //| -//| :param ~int size: Number of pixels -//| :param ~str byteorder: Byte order string (such as "RGB", "RGBW" or "PBGR") -//| :param ~float brightness: Brightness (0 to 1.0, default 1.0) -//| :param ~bool auto_write: Whether to automatically write pixels (Default False) -//| :param bytes header: Sequence of bytes to always send before pixel values. -//| :param bytes trailer: Sequence of bytes to always send after pixel values.""" +//| :param int size: Number of pixels +//| :param str byteorder: Byte order string (such as "RGB", "RGBW" or "PBGR") +//| :param float brightness: Brightness (0 to 1.0, default 1.0) +//| :param bool auto_write: Whether to automatically write pixels (Default False) +//| :param ~_typing.ReadableBuffer header: Sequence of bytes to always send before pixel values. +//| :param ~_typing.ReadableBuffer trailer: Sequence of bytes to always send after pixel values.""" //| ... //| STATIC mp_obj_t pixelbuf_pixelbuf_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -257,7 +257,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]]) -> None: +//| def fill(self, color: Union[int, Tuple[int, int, int], Tuple[int, int, int, float]]) -> None: //| """Fills the given pixelbuf with the given color.""" //| ... //| @@ -270,18 +270,20 @@ 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) -> Tuple[Tuple, ...]: ... -//| def __getitem__(self, index: int) -> Tuple: +//| 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]]: //| """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, List], ...]) -> None: ... +//| def __setitem__(self, index: slice, value: Tuple[Union[int, Tuple[float, ...], List[float]], ...]) -> None: ... //| @overload -//| def __setitem__(self, index: slice, value: List[Union[int, Tuple, List]]) -> None: ... -//| def __setitem__(self, index: int, value: Union[int, Tuple, List]) -> None: +//| def __setitem__(self, index: slice, value: List[Union[int, Tuple[float, ...], List[float]]]) -> None: ... +//| @overload +//| def __setitem__(self, index: int, value: Union[int, Tuple[float, ...], List[float]]) -> 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/_pixelbuf/__init__.c b/shared-bindings/_pixelbuf/__init__.c index c714cade41..c61acc939f 100644 --- a/shared-bindings/_pixelbuf/__init__.c +++ b/shared-bindings/_pixelbuf/__init__.c @@ -33,7 +33,7 @@ #include "shared-bindings/_pixelbuf/PixelBuf.h" -//| """A fast RGB(W) pixel buffer library for like NeoPixel and DotStar. +//| """A fast RGB(W) pixel buffer library for like NeoPixel and DotStar //| //| The `_pixelbuf` module provides the :py:class:`PixelBuf` class to accelerate //| RGB(W) strip/matrix manipulation, such as DotStar and Neopixel. diff --git a/shared-bindings/_stage/Layer.c b/shared-bindings/_stage/Layer.c index 269005ccff..612323a4e4 100644 --- a/shared-bindings/_stage/Layer.c +++ b/shared-bindings/_stage/Layer.c @@ -40,9 +40,9 @@ //| //| :param int width: The width of the grid in tiles, or 1 for sprites. //| :param int height: The height of the grid in tiles, or 1 for sprites. -//| :param bytearray graphic: The graphic data of the tiles. -//| :param bytearray palette: The color palette to be used. -//| :param bytearray grid: The contents of the grid map. +//| :param ~_typing.ReadableBuffer graphic: The graphic data of the tiles. +//| :param ~_typing.ReadableBuffer palette: The color palette to be used. +//| :param ~_typing.ReadableBuffer grid: The contents of the grid map. //| //| This class is intended for internal use in the ``stage`` library and //| it shouldn't be used on its own.""" diff --git a/shared-bindings/_stage/Text.c b/shared-bindings/_stage/Text.c index 464af1b98f..d1e50fa236 100644 --- a/shared-bindings/_stage/Text.c +++ b/shared-bindings/_stage/Text.c @@ -40,9 +40,9 @@ //| //| :param int width: The width of the grid in tiles, or 1 for sprites. //| :param int height: The height of the grid in tiles, or 1 for sprites. -//| :param bytearray font: The font data of the characters. -//| :param bytearray palette: The color palette to be used. -//| :param bytearray chars: The contents of the character grid. +//| :param ~_typing.ReadableBuffer font: The font data of the characters. +//| :param ~_typing.ReadableBuffer palette: The color palette to be used. +//| :param ~_typing.ReadableBuffer chars: The contents of the character grid. //| //| This class is intended for internal use in the ``stage`` library and //| it shouldn't be used on its own.""" diff --git a/shared-bindings/_stage/__init__.c b/shared-bindings/_stage/__init__.c index 6651b3e0ba..f173147e31 100644 --- a/shared-bindings/_stage/__init__.c +++ b/shared-bindings/_stage/__init__.c @@ -39,15 +39,16 @@ //| The `_stage` module contains native code to speed-up the ```stage`` Library //| `_.""" //| -//| def render(x0: int, y0: int, x1: int, y1: int, layers: list, buffer: WriteableBuffer, display: displayio.Display, scale: int, background: int) -> None: +//| def render(x0: int, y0: int, x1: int, y1: int, layers: List[Layer], buffer: WriteableBuffer, display: displayio.Display, scale: int, background: int) -> None: //| """Render and send to the display a fragment of the screen. //| //| :param int x0: Left edge of the fragment. //| :param int y0: Top edge of the fragment. //| :param int x1: Right edge of the fragment. //| :param int y1: Bottom edge of the fragment. -//| :param list layers: A list of the :py:class:`~_stage.Layer` objects. -//| :param bytearray buffer: A buffer to use for rendering. +//| :param layers: A list of the :py:class:`~_stage.Layer` objects. +//| :type layers: list[Layer] +//| :param ~_typing.WriteableBuffer buffer: A buffer to use for rendering. //| :param ~displayio.Display display: The display to use. //| :param int scale: How many times should the image be scaled up. //| :param int background: What color to display when nothing is there. diff --git a/shared-bindings/_typing/__init__.pyi b/shared-bindings/_typing/__init__.pyi new file mode 100644 index 0000000000..48e68a8d57 --- /dev/null +++ b/shared-bindings/_typing/__init__.pyi @@ -0,0 +1,54 @@ +"""Types for the C-level protocols""" + +from typing import Union + +import array +import audiocore +import audiomixer +import audiomp3 +import rgbmatrix +import ulab + +ReadableBuffer = Union[ + bytes, bytearray, memoryview, array.array, ulab.array, rgbmatrix.RGBMatrix +] +"""Classes that implement the readable buffer protocol + + - `bytes` + - `bytearray` + - `memoryview` + - `array.array` + - `ulab.array` + - `rgbmatrix.RGBMatrix` +""" + +WriteableBuffer = Union[ + bytearray, memoryview, array.array, ulab.array, rgbmatrix.RGBMatrix +] +"""Classes that implement the writeable buffer protocol + + - `bytearray` + - `memoryview` + - `array.array` + - `ulab.array` + - `rgbmatrix.RGBMatrix` +""" + +AudioSample = Union[ + audiocore.WaveFile, audiocore.RawSample, audiomixer.Mixer, audiomp3.MP3Decoder +] +"""Classes that implement the audiosample protocol + + - `audiocore.WaveFile` + - `audiocore.RawSample` + - `audiomixer.Mixer` + - `audiomp3.MP3Decoder` + + You can play these back with `audioio.AudioOut`, `audiobusio.I2SOut` or `audiopwmio.PWMAudioOut`. +""" + +FrameBuffer = Union[rgbmatrix.RGBMatrix] +"""Classes that implement the framebuffer protocol + + - `rgbmatrix.RGBMatrix` +""" diff --git a/shared-bindings/aesio/aes.c b/shared-bindings/aesio/aes.c index 7c10693fec..a121845e34 100644 --- a/shared-bindings/aesio/aes.c +++ b/shared-bindings/aesio/aes.c @@ -15,10 +15,10 @@ //| def __init__(self, key: ReadableBuffer, mode: int = 0, iv: Optional[ReadableBuffer] = None, segment_size: int = 8) -> None: //| """Create a new AES state with the given key. //| -//| :param bytearray key: A 16-, 24-, or 32-byte key +//| :param ~_typing.ReadableBuffer key: A 16-, 24-, or 32-byte key //| :param int mode: AES mode to use. One of: AES.MODE_ECB, AES.MODE_CBC, or //| AES.MODE_CTR -//| :param bytearray iv: Initialization vector to use for CBC or CTR mode +//| :param ~_typing.ReadableBuffer iv: Initialization vector to use for CBC or CTR mode //| //| Additional arguments are supported for legacy reasons. //| diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index 797d782d58..25b536c344 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -155,11 +155,11 @@ STATIC mp_obj_t audiobusio_i2sout_obj___exit__(size_t n_args, const mp_obj_t *ar STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_i2sout___exit___obj, 4, 4, audiobusio_i2sout_obj___exit__); -//| def play(self, sample: audiocore._AudioSample, *, loop: bool = False) -> None: +//| def play(self, sample: _typing.AudioSample, *, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| -//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. +//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, `audiomixer.Mixer` or `audiomp3.MP3Decoder`. //| //| The sample itself should consist of 8 bit or 16 bit samples.""" //| ... diff --git a/shared-bindings/audiocore/RawSample.c b/shared-bindings/audiocore/RawSample.c index fd8652c143..df31ee2e07 100644 --- a/shared-bindings/audiocore/RawSample.c +++ b/shared-bindings/audiocore/RawSample.c @@ -44,7 +44,7 @@ //| first sample will be for channel 1, the second sample will be for channel two, the third for //| channel 1 and so on. //| -//| :param ReadableBuffer buffer: A buffer with samples +//| :param ~_typing.ReadableBuffer buffer: A buffer with samples //| :param int channel_count: The number of channels in the buffer //| :param int sample_rate: The desired playback sample rate //| diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index 89c731c68b..3b4c9fd978 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -40,11 +40,11 @@ //| be 8 bit unsigned or 16 bit signed. If a buffer is provided, it will be used instead of allocating //| an internal buffer.""" //| -//| def __init__(self, file: typing.BinaryIO, buffer: ReadableBuffer) -> None: +//| def __init__(self, file: typing.BinaryIO, buffer: WriteableBuffer) -> None: //| """Load a .wav file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. //| //| :param typing.BinaryIO file: Already opened wave file -//| :param bytearray buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two 512 byte buffers are allocated internally. +//| :param ~_typing.WriteableBuffer buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two 512 byte buffers are allocated internally. //| //| //| Playing a wave file from flash:: diff --git a/shared-bindings/audiocore/__init__.c b/shared-bindings/audiocore/__init__.c index a27dcefa44..b400b94548 100644 --- a/shared-bindings/audiocore/__init__.c +++ b/shared-bindings/audiocore/__init__.c @@ -38,13 +38,6 @@ //| """Support for audio samples""" //| -//| _AudioSample = Union[audiocore.WaveFile, audiocore.RawSample, audiomixer.Mixer, audiomp3.MP3Decoder] -//| """An audio sample for playback with `audioio.AudioOut`, `audiobusio.I2SOut` or `audiopwmio.PWMAudioOut`. -//| -//| Supported sources are :py:class:`audiocore.WaveFile`, :py:class:`audiocore.RawSample`, -//| :py:class:`audiomixer.Mixer` and :py:class:`audiomp3.MP3Decoder`.""" -//| - STATIC const mp_rom_map_elem_t audiocore_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_audiocore) }, { MP_ROM_QSTR(MP_QSTR_RawSample), MP_ROM_PTR(&audioio_rawsample_type) }, diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index 25620a491f..0d479be097 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -146,11 +146,11 @@ STATIC mp_obj_t audioio_audioout_obj___exit__(size_t n_args, const mp_obj_t *arg STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_audioout___exit___obj, 4, 4, audioio_audioout_obj___exit__); -//| def play(self, sample: audiocore._AudioSample, *, loop: bool = False) -> None: +//| def play(self, sample: _typing.AudioSample, *, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| -//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. +//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, `audiomixer.Mixer` or `audiomp3.MP3Decoder`. //| //| The sample itself should consist of 16 bit samples. Microcontrollers with a lower output //| resolution will use the highest order bits to output. For example, the SAMD21 has a 10 bit diff --git a/shared-bindings/audiomixer/Mixer.c b/shared-bindings/audiomixer/Mixer.c index 9a78c7fad6..293b19b055 100644 --- a/shared-bindings/audiomixer/Mixer.c +++ b/shared-bindings/audiomixer/Mixer.c @@ -211,11 +211,11 @@ const mp_obj_property_t audiomixer_mixer_voice_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def play(self, sample: audiocore._AudioSample, *, voice: int = 0, loop: bool = False) -> None: +//| def play(self, sample: _typing.AudioSample, *, voice: int = 0, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| -//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. +//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, `audiomixer.Mixer` or `audiomp3.MP3Decoder`. //| //| The sample must match the Mixer's encoding settings given in the constructor.""" //| ... diff --git a/shared-bindings/audiomixer/MixerVoice.c b/shared-bindings/audiomixer/MixerVoice.c index 335949bb68..af00e10551 100644 --- a/shared-bindings/audiomixer/MixerVoice.c +++ b/shared-bindings/audiomixer/MixerVoice.c @@ -56,11 +56,11 @@ STATIC mp_obj_t audiomixer_mixervoice_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(self); } -//| def play(self, sample: audiocore._AudioSample, *, loop: bool = False) -> None: +//| def play(self, sample: _typing.AudioSample, *, loop: bool = False) -> None: //| """Plays the sample once when ``loop=False``, and continuously when ``loop=True``. //| Does not block. Use `playing` to block. //| -//| Sample must be an `audiocore.WaveFile`, `audiomixer.Mixer` or `audiocore.RawSample`. +//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, `audiomixer.Mixer` or `audiomp3.MP3Decoder`. //| //| The sample must match the `audiomixer.Mixer`'s encoding settings given in the constructor.""" //| ... diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index 0e427951c0..85073bf89c 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -42,7 +42,7 @@ //| """Load a .mp3 file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. //| //| :param typing.BinaryIO file: Already opened mp3 file -//| :param bytearray buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two buffers are allocated internally. The specific buffer size required depends on the mp3 file. +//| :param ~_typing.WriteableBuffer buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two buffers are allocated internally. The specific buffer size required depends on the mp3 file. //| //| //| Playing a mp3 file from flash:: @@ -106,7 +106,7 @@ STATIC void check_for_deinit(audiomp3_mp3file_obj_t *self) { } } -//| def __enter__(self) -> MP3: +//| def __enter__(self) -> MP3Decoder: //| """No-op used by Context Managers.""" //| ... //| @@ -124,7 +124,7 @@ STATIC mp_obj_t audiomp3_mp3file_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiomp3_mp3file___exit___obj, 4, 4, audiomp3_mp3file_obj___exit__); -//| file: file +//| file: typing.BinaryIO //| """File to play back.""" //| STATIC mp_obj_t audiomp3_mp3file_obj_get_file(mp_obj_t self_in) { diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index 74545a4ebb..06571fae1e 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -148,11 +148,11 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj___exit__(size_t n_args, const mp_obj_ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiopwmio_pwmaudioout___exit___obj, 4, 4, audiopwmio_pwmaudioout_obj___exit__); -//| def play(self, sample: audiocore._AudioSample, *, loop: bool = False) -> None: +//| def play(self, sample: _typing.AudioSample, *, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. //| Does not block. Use `playing` to block. //| -//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. +//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, `audiomixer.Mixer` or `audiomp3.MP3Decoder`. //| //| The sample itself should consist of 16 bit samples. Microcontrollers with a lower output //| resolution will use the highest order bits to output. For example, the SAMD21 has a 10 bit diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index 28ccb4746f..17005f63a8 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -120,7 +120,7 @@ static void check_lock(bitbangio_i2c_obj_t *self) { } } -//| def scan(self) -> list: +//| def scan(self) -> List[int]: //| """Scan all I2C addresses between 0x08 and 0x77 inclusive and return a list of //| those that respond. A device responds if it pulls the SDA line low after //| its address (including a read bit) is sent on the bus.""" @@ -175,7 +175,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_unlock_obj, bitbangio_i2c_obj_unlock); //| ``buf[start:end]`` will so it saves memory. //| //| :param int address: 7-bit device address -//| :param bytearray buffer: buffer to write into +//| :param ~_typing.WriteableBuffer buffer: buffer to write into //| :param int start: Index to start writing at //| :param int end: Index to write up to but not include""" //| ... @@ -230,7 +230,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_readfrom_into_obj, 3, bitbangio_i2c_rea //| to poll for the existence of a device. //| //| :param int address: 7-bit device address -//| :param bytearray buffer: buffer containing the bytes to write +//| :param ~_typing.ReadableBuffer buffer: buffer containing the bytes to write //| :param int start: Index to start writing from //| :param int end: Index to read up to but not include""" //| ... @@ -274,7 +274,7 @@ STATIC mp_obj_t bitbangio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, m STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_writeto_obj, 1, bitbangio_i2c_writeto); -//| def writeto_then_readfrom(self, address: int, out_buffer: WriteableBuffer, in_buffer: ReadableBuffer, *, out_start: int = 0, out_end: Optional[int] = None, in_start: int = 0, in_end: Optional[int] = None) -> None: +//| def writeto_then_readfrom(self, address: int, out_buffer: ReadableBuffer, in_buffer: ReadableBuffer, *, out_start: int = 0, out_end: Optional[int] = None, in_start: int = 0, in_end: Optional[int] = None) -> None: //| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and //| ``in_buffer`` can be the same buffer because they are used sequentially. @@ -284,8 +284,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_writeto_obj, 1, bitbangio_i2c_wr //| will so it saves memory. //| //| :param int address: 7-bit device address -//| :param bytearray out_buffer: buffer containing the bytes to write -//| :param bytearray in_buffer: buffer to write into +//| :param ~_typing.ReadableBuffer out_buffer: buffer containing the bytes to write +//| :param ~_typing.WriteableBuffer in_buffer: buffer to write into //| :param int out_start: Index to start writing from //| :param int out_end: Index to read up to but not include. Defaults to ``len(buffer)`` //| :param int in_start: Index to start writing at diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index 3e071ed743..fea88bbd40 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -254,8 +254,8 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitbangio_spi_readinto_obj, 2, 2, bitbangio_ //| must be equal. //| If buffer slice lengths are both 0, nothing happens. //| -//| :param bytearray buffer_out: Write out the data in this buffer -//| :param bytearray buffer_in: Read data into this buffer +//| :param ~_typing.ReadableBuffer buffer_out: Write out the data in this buffer +//| :param ~_typing.WriteableBuffer buffer_in: Read data into this buffer //| :param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]`` //| :param int out_end: End of the slice; this index is not included. Defaults to ``len(buffer_out)`` //| :param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]`` diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 4a5d39c52a..157e779fdc 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -125,7 +125,7 @@ static void check_lock(busio_i2c_obj_t *self) { } } -//| def scan(self) -> list: +//| def scan(self) -> List[int]: //| """Scan all I2C addresses between 0x08 and 0x77 inclusive and return a //| list of those that respond. //| @@ -185,7 +185,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock); //| ``buf[start:end]`` will so it saves memory. //| //| :param int address: 7-bit device address -//| :param bytearray buffer: buffer to write into +//| :param ~_typing.WriteableBuffer buffer: buffer to write into //| :param int start: Index to start writing at //| :param int end: Index to write up to but not include. Defaults to ``len(buffer)``""" //| ... @@ -239,7 +239,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_in //| to poll for the existence of a device. //| //| :param int address: 7-bit device address -//| :param bytearray buffer: buffer containing the bytes to write +//| :param ~_typing.ReadbleBuffer buffer: buffer containing the bytes to write //| :param int start: Index to start writing from //| :param int end: Index to read up to but not include. Defaults to ``len(buffer)``""" //| ... @@ -291,8 +291,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto); //| will so it saves memory. //| //| :param int address: 7-bit device address -//| :param bytearray out_buffer: buffer containing the bytes to write -//| :param bytearray in_buffer: buffer to write into +//| :param ~_typing.ReadbleBuffer out_buffer: buffer containing the bytes to write +//| :param ~_typing.WriteableBuffer in_buffer: buffer to write into //| :param int out_start: Index to start writing from //| :param int out_end: Index to read up to but not include. Defaults to ``len(buffer)`` //| :param int in_start: Index to start writing at diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 93dc64d50b..aefe4f5a77 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -232,7 +232,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_unlock_obj, busio_spi_obj_unlock); //| """Write the data contained in ``buffer``. The SPI object must be locked. //| If the buffer is empty, nothing happens. //| -//| :param bytearray buffer: Write out the data in this buffer +//| :param ~_typing.ReadableBuffer buffer: Write out the data in this buffer //| :param int start: Start of the slice of ``buffer`` to write out: ``buffer[start:end]`` //| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``""" //| ... @@ -275,7 +275,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_obj, 2, busio_spi_write); //| The SPI object must be locked. //| If the number of bytes to read is 0, nothing happens. //| -//| :param bytearray buffer: Read data into this buffer +//| :param ~_typing.WriteableBuffer buffer: Read data into this buffer //| :param int start: Start of the slice of ``buffer`` to read into: ``buffer[start:end]`` //| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)`` //| :param int write_value: Value to write while reading. (Usually ignored.)""" @@ -314,15 +314,15 @@ STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_m } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_readinto_obj, 2, busio_spi_readinto); -//| def write_readinto(self, buffer_out: ReadableBuffer, buffer_in: ReadableBuffer, *, out_start: int = 0, out_end: Optional[int] = None, in_start: int = 0, in_end: Optional[int] = None) -> None: +//| def write_readinto(self, buffer_out: ReadableBuffer, buffer_in: WriteableBuffer, *, out_start: int = 0, out_end: Optional[int] = None, in_start: int = 0, in_end: Optional[int] = None) -> None: //| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. //| The SPI object must be locked. //| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` //| must be equal. //| If buffer slice lengths are both 0, nothing happens. //| -//| :param bytearray buffer_out: Write out the data in this buffer -//| :param bytearray buffer_in: Read data into this buffer +//| :param ~_typing.ReadableBuffer buffer_out: Write out the data in this buffer +//| :param ~_typing.WriteableBuffer buffer_in: Read data into this buffer //| :param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]`` //| :param int out_end: End of the slice; this index is not included. Defaults to ``len(buffer_out)`` //| :param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]`` diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 70e29ff3e0..c4fbdab2e4 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -81,8 +81,8 @@ //| of the display to minimize tearing artifacts. //| //| :param display_bus: The bus that the display is connected to -//| :type display_bus: FourWire, ParallelBus or I2CDisplay -//| :param buffer init_sequence: Byte-packed initialization sequence. +//| :type _DisplayBus: FourWire, ParallelBus or I2CDisplay +//| :param ~_typing.ReadableBuffer init_sequence: Byte-packed initialization sequence. //| :param int width: Width in pixels //| :param int height: Height in pixels //| :param int colstart: The index if the first visible column @@ -344,7 +344,7 @@ const mp_obj_property_t displayio_display_auto_brightness_obj = { //| width: int -//| Gets the width of the board +//| """Gets the width of the board""" //| STATIC mp_obj_t displayio_display_obj_get_width(mp_obj_t self_in) { displayio_display_obj_t *self = native_display(self_in); @@ -360,7 +360,7 @@ const mp_obj_property_t displayio_display_width_obj = { }; //| height: int -//| """Gets the height of the board""" +//| """Gets the height of the board""" //| STATIC mp_obj_t displayio_display_obj_get_height(mp_obj_t self_in) { displayio_display_obj_t *self = native_display(self_in); @@ -399,7 +399,7 @@ const mp_obj_property_t displayio_display_rotation_obj = { }; //| bus: _DisplayBus -//| """The bus being used by the display""" +//| """The bus being used by the display""" //| //| STATIC mp_obj_t displayio_display_obj_get_bus(mp_obj_t self_in) { @@ -420,7 +420,7 @@ const mp_obj_property_t displayio_display_bus_obj = { //| """Extract the pixels from a single row //| //| :param int y: The top edge of the area -//| :param bytearray buffer: The buffer in which to place the pixel data""" +//| :param ~_typing.WriteableBuffer buffer: The buffer in which to place the pixel data""" //| ... //| STATIC mp_obj_t displayio_display_obj_fill_row(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index ee1586fe67..8be4ee4c4a 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -60,9 +60,9 @@ //| begin a new command definition. //| //| :param display_bus: The bus that the display is connected to -//| :type display_bus: displayio.FourWire or displayio.ParallelBus -//| :param buffer start_sequence: Byte-packed initialization sequence. -//| :param buffer stop_sequence: Byte-packed initialization sequence. +//| :type _DisplayBus: displayio.FourWire or displayio.ParallelBus +//| :param ~_typing.ReadableBuffer start_sequence: Byte-packed initialization sequence. +//| :param ~_typing.ReadableBuffer stop_sequence: Byte-packed initialization sequence. //| :param int width: Width in pixels //| :param int height: Height in pixels //| :param int ram_width: RAM width in pixels @@ -238,7 +238,7 @@ const mp_obj_property_t displayio_epaperdisplay_width_obj = { }; //| height: int -//| """Gets the height of the display in pixels""" +//| """Gets the height of the display in pixels""" //| STATIC mp_obj_t displayio_epaperdisplay_obj_get_height(mp_obj_t self_in) { displayio_epaperdisplay_obj_t *self = native_display(self_in); @@ -254,7 +254,7 @@ const mp_obj_property_t displayio_epaperdisplay_height_obj = { }; //| bus: _DisplayBus -//| """The bus being used by the display""" +//| """The bus being used by the display""" //| STATIC mp_obj_t displayio_epaperdisplay_obj_get_bus(mp_obj_t self_in) { displayio_epaperdisplay_obj_t *self = native_display(self_in); diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index a7810df5fd..386e270abd 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -190,7 +190,7 @@ const mp_obj_property_t displayio_group_y_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def append(self, layer: Union[vectorio.Shape, Group, TileGrid]) -> None: +//| def append(self, layer: Union[vectorio.VectorShape, Group, TileGrid]) -> None: //| """Append a layer to the group. It will be drawn above other layers.""" //| ... //| @@ -201,7 +201,7 @@ STATIC mp_obj_t displayio_group_obj_append(mp_obj_t self_in, mp_obj_t layer) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_append_obj, displayio_group_obj_append); -//| def insert(self, index: int, layer: Union[vectorio.Shape, Group, TileGrid]) -> None: +//| def insert(self, index: int, layer: Union[vectorio.VectorShape, Group, TileGrid]) -> None: //| """Insert a layer into the group.""" //| ... //| @@ -217,7 +217,7 @@ STATIC mp_obj_t displayio_group_obj_insert(mp_obj_t self_in, mp_obj_t index_obj, MP_DEFINE_CONST_FUN_OBJ_3(displayio_group_insert_obj, displayio_group_obj_insert); -//| def index(self, layer: Union[vectorio.Shape, Group, TileGrid]) -> int: +//| def index(self, layer: Union[vectorio.VectorShape, Group, TileGrid]) -> int: //| """Returns the index of the first copy of layer. Raises ValueError if not found.""" //| ... //| @@ -231,7 +231,7 @@ STATIC mp_obj_t displayio_group_obj_index(mp_obj_t self_in, mp_obj_t layer) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_index_obj, displayio_group_obj_index); -//| def pop(self, i: int = -1) -> Union[vectorio.Shape, Group, TileGrid]: +//| def pop(self, i: int = -1) -> Union[vectorio.VectorShape, Group, TileGrid]: //| """Remove the ith item and return it.""" //| ... //| @@ -254,7 +254,7 @@ STATIC mp_obj_t displayio_group_obj_pop(size_t n_args, const mp_obj_t *pos_args, MP_DEFINE_CONST_FUN_OBJ_KW(displayio_group_pop_obj, 1, displayio_group_obj_pop); -//| def remove(self, layer: Union[vectorio.Shape, Group, TileGrid]) -> None: +//| def remove(self, layer: Union[vectorio.VectorShape, Group, TileGrid]) -> None: //| """Remove the first copy of layer. Raises ValueError if it is not present.""" //| ... //| @@ -284,7 +284,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -//| def __getitem__(self, index: int) -> Union[vectorio.Shape, Group, TileGrid]: +//| def __getitem__(self, index: int) -> Union[vectorio.VectorShape, Group, TileGrid]: //| """Returns the value at the given index. //| //| This allows you to:: @@ -292,7 +292,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { //| print(group[0])""" //| ... //| -//| def __setitem__(self, index: int, value: Union[vectorio.Shape, Group, TileGrid]) -> None: +//| def __setitem__(self, index: int, value: Union[vectorio.VectorShape, Group, TileGrid]) -> None: //| """Sets the value at the given index. //| //| This allows you to:: diff --git a/shared-bindings/fontio/Glyph.c b/shared-bindings/fontio/Glyph.c index 6558e2e7a1..486cebd719 100644 --- a/shared-bindings/fontio/Glyph.c +++ b/shared-bindings/fontio/Glyph.c @@ -39,7 +39,7 @@ //| dx: int, //| dy: int, //| shift_x: int, -//| shift_y: int): +//| shift_y: int) -> None: //| """Named tuple used to capture a single glyph and its attributes. //| //| :param bitmap: the bitmap including the glyph diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index e29718fdf3..8d1e2ac9c3 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -47,11 +47,10 @@ //| objects in CircuitPython, Display objects live until `displayio.release_displays()` //| is called. This is done so that CircuitPython can use the display itself.""" //| -//| def __init__(self, framebuffer: rgbmatrix.RGBMatrix, *, rotation: int = 0, auto_refresh: bool = True) -> None: +//| def __init__(self, framebuffer: _typing.FrameBuffer, *, rotation: int = 0, auto_refresh: bool = True) -> None: //| """Create a Display object with the given framebuffer (a buffer, array, ulab.array, etc) //| -//| :param framebuffer: The framebuffer that the display is connected to -//| :type framebuffer: any core object implementing the framebuffer protocol +//| :param ~_typing.FrameBuffer framebuffer: The framebuffer that the display is connected to //| :param bool auto_refresh: Automatically refresh the screen //| :param int rotation: The rotation of the display in degrees clockwise. Must be in 90 degree increments (0, 90, 180, 270)""" //| ... @@ -245,7 +244,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_auto_brightness_obj = { }; //| width: int -//| """Gets the width of the framebuffer""" +//| """Gets the width of the framebuffer""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_width(mp_obj_t self_in) { framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); @@ -261,7 +260,7 @@ const mp_obj_property_t framebufferio_framebufferdisplay_width_obj = { }; //| height: int -//| """Gets the height of the framebuffer""" +//| """Gets the height of the framebuffer""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_height(mp_obj_t self_in) { framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); @@ -299,8 +298,8 @@ const mp_obj_property_t framebufferio_framebufferdisplay_rotation_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| framebuffer: rgbmatrix.RGBMatrix -//| """The framebuffer being used by the display""" +//| framebuffer: _typing.FrameBuffer +//| """The framebuffer being used by the display""" //| //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_framebuffer(mp_obj_t self_in) { @@ -317,11 +316,11 @@ const mp_obj_property_t framebufferio_framebufferframebuffer_obj = { }; -//| def fill_row(self, y: int, buffer: WriteableBuffer) -> displayio: +//| def fill_row(self, y: int, buffer: WriteableBuffer) -> WriteableBuffer: //| """Extract the pixels from a single row //| //| :param int y: The top edge of the area -//| :param bytearray buffer: The buffer in which to place the pixel data""" +//| :param ~_typing.WriteableBuffer buffer: The buffer in which to place the pixel data""" //| ... //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_fill_row(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { diff --git a/shared-bindings/i2cperipheral/I2CPeripheral.c b/shared-bindings/i2cperipheral/I2CPeripheral.c index cfebd472ee..13ef2ef390 100644 --- a/shared-bindings/i2cperipheral/I2CPeripheral.c +++ b/shared-bindings/i2cperipheral/I2CPeripheral.c @@ -52,13 +52,14 @@ STATIC mp_obj_t mp_obj_new_i2cperipheral_i2c_peripheral_request(i2cperipheral_i2 //| class I2CPeripheral: //| """Two wire serial protocol peripheral""" //| -//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, addresses: tuple, smbus: bool = False) -> None: +//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, addresses: Sequence[int], smbus: bool = False) -> None: //| """I2C is a two-wire protocol for communicating between devices. //| This implements the peripheral (sensor, secondary) side. //| //| :param ~microcontroller.Pin scl: The clock pin //| :param ~microcontroller.Pin sda: The data pin -//| :param tuple addresses: The I2C addresses to respond to (how many is hw dependent). +//| :param addresses: The I2C addresses to respond to (how many is hw dependent). +//| :type addresses: list[int] //| :param bool smbus: Use SMBUS timings if the hardware supports it""" //| ... //| @@ -352,7 +353,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(i2cperipheral_i2c_peripheral_request_read_obj, 1, i2c //| def write(self, buffer: ReadableBuffer) -> int: //| """Write the data contained in buffer. //| -//| :param buffer: Write out the data in this buffer +//| :param ~_typing.ReadableBuffer buffer: Write out the data in this buffer //| :return: Number of bytes written""" //| ... //| diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c index c00b1e314d..2e58bdcc29 100644 --- a/shared-bindings/microcontroller/__init__.c +++ b/shared-bindings/microcontroller/__init__.c @@ -47,6 +47,9 @@ //| The `microcontroller` module defines the pins from the perspective of the //| microcontroller. See `board` for board-specific pin mappings.""" //| +//| from nvm import ByteArray +//| from watchdog import WatchDogTimer +//| //| cpu: Processor //| """CPU information and control, such as ``cpu.temperature`` and ``cpu.frequency`` @@ -133,14 +136,14 @@ STATIC mp_obj_t mcu_reset(void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(mcu_reset_obj, mcu_reset); -//| nvm: Optional[nvm.ByteArray] +//| nvm: Optional[ByteArray] //| """Available non-volatile memory. //| This object is the sole instance of `nvm.ByteArray` when available or ``None`` otherwise. //| //| :type: nvm.ByteArray or None""" //| -//| watchdog: Optional[watchdog.WatchDogTimer] +//| watchdog: Optional[WatchDogTimer] //| """Available watchdog timer. //| This object is the sole instance of `watchdog.WatchDogTimer` when available or ``None`` otherwise.""" //| diff --git a/shared-bindings/multiterminal/__init__.c b/shared-bindings/multiterminal/__init__.c index 1fbeca79cc..689d3d7618 100644 --- a/shared-bindings/multiterminal/__init__.c +++ b/shared-bindings/multiterminal/__init__.c @@ -78,7 +78,7 @@ STATIC mp_obj_t multiterminal_obj_clear_secondary_terminal() { } MP_DEFINE_CONST_FUN_OBJ_0(multiterminal_clear_secondary_terminal_obj, multiterminal_obj_clear_secondary_terminal); -//| def schedule_secondary_terminal_read(socket: secondary_terminal) -> None: +//| def schedule_secondary_terminal_read(socket: socket.socket) -> None: //| """In cases where the underlying OS is doing task scheduling, this notifies //| the OS when more data is available on the socket to read. This is useful //| as a callback for lwip sockets.""" diff --git a/shared-bindings/neopixel_write/__init__.c b/shared-bindings/neopixel_write/__init__.c index 8eb426c2b7..a353e34aee 100644 --- a/shared-bindings/neopixel_write/__init__.c +++ b/shared-bindings/neopixel_write/__init__.c @@ -53,8 +53,8 @@ //| def neopixel_write(digitalinout: digitalio.DigitalInOut, buf: ReadableBuffer) -> None: //| """Write buf out on the given DigitalInOut. //| -//| :param digitalinout: the DigitalInOut to output with -//| :param buf: The bytes to clock out. No assumption is made about color order""" +//| :param ~digitalio.DigitalInOut digitalinout: the DigitalInOut to output with +//| :param ~_typing.ReadableBuffer buf: The bytes to clock out. No assumption is made about color order""" //| ... STATIC mp_obj_t neopixel_write_neopixel_write_(mp_obj_t digitalinout_obj, mp_obj_t buf) { if (!MP_OBJ_IS_TYPE(digitalinout_obj, &digitalio_digitalinout_type)) { diff --git a/shared-bindings/network/__init__.c b/shared-bindings/network/__init__.c index 35bbaa510d..cfcadd98f9 100644 --- a/shared-bindings/network/__init__.c +++ b/shared-bindings/network/__init__.c @@ -47,7 +47,7 @@ //| It is used by the 'socket' module to look up a suitable //| NIC when a socket is created.""" //| -//| def route() -> list: +//| def route() -> List[object]: //| """Returns a list of all configured NICs.""" //| ... //| diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c index 994ce70458..bed15c9ede 100644 --- a/shared-bindings/nvm/ByteArray.c +++ b/shared-bindings/nvm/ByteArray.c @@ -73,12 +73,14 @@ STATIC MP_DEFINE_CONST_DICT(nvm_bytearray_locals_dict, nvm_bytearray_locals_dict //| @overload //| def __getitem__(self, index: slice) -> bytearray: ... +//| @overload //| def __getitem__(self, index: int) -> int: //| """Returns the value at the given index.""" //| ... //| //| @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.""" //| ... diff --git a/shared-bindings/os/__init__.c b/shared-bindings/os/__init__.c index 2406dbc371..c499df9724 100644 --- a/shared-bindings/os/__init__.c +++ b/shared-bindings/os/__init__.c @@ -43,12 +43,22 @@ //| code written in CircuitPython will work in CPython but not necessarily the //| other way around.""" //| +//| import typing -//| def uname() -> tuple: +//| def uname() -> _Uname: //| """Returns a named tuple of operating specific and CircuitPython port //| specific information.""" //| ... //| +//| class _Uname(typing.NamedTuple): +//| """The type of values that :py:func:`.uname()` returns""" +//| +//| sysname: str +//| nodename: str +//| release: str +//| version: str +//| machine: str +//| STATIC mp_obj_t os_uname(void) { return common_hal_os_uname(); } @@ -134,7 +144,7 @@ mp_obj_t os_rmdir(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_rmdir_obj, os_rmdir); -//| def stat(path: str) -> str: +//| def stat(path: str) -> Tuple[int, int, int, int, int, int, int, int, int, int]: //| """Get the status of a file or directory. //| //| .. note:: On builds without long integers, the number of seconds diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index b2dd80682b..d6b79f5ebb 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -128,7 +128,7 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_ } } -//| def __init__(self, *, width: int, bit_depth: int, rgb_pins: Sequence[digitalio.DigitalInOut], addr_pins: List[digitalio.DigitalInOut], clock_pin: digitalio.DigitalInOut, latch_pin: digitalio.DigitalInOut, output_enable_pin: digitalio.DigitalInOut, doublebuffer: bool = True, framebuffer: Optional[WriteableBuffer] = None, height: int = 0) -> None: +//| def __init__(self, *, width: int, bit_depth: int, rgb_pins: Sequence[digitalio.DigitalInOut], addr_pins: Sequence[digitalio.DigitalInOut], clock_pin: digitalio.DigitalInOut, latch_pin: digitalio.DigitalInOut, output_enable_pin: digitalio.DigitalInOut, doublebuffer: bool = True, framebuffer: Optional[WriteableBuffer] = None, height: int = 0) -> None: //| """Create a RGBMatrix object with the given attributes. The height of //| the display is determined by the number of rgb and address pins: //| len(rgb_pins) // 3 * 2 ** len(address_pins). With 6 RGB pins and 4 diff --git a/shared-bindings/rotaryio/__init__.c b/shared-bindings/rotaryio/__init__.c index 0fa457ca73..fd8578753d 100644 --- a/shared-bindings/rotaryio/__init__.c +++ b/shared-bindings/rotaryio/__init__.c @@ -38,10 +38,9 @@ //| The `rotaryio` module contains classes to read different rotation encoding schemes. See //| `Wikipedia's Rotary Encoder page `_ for more //| background. - +//| //| .. warning:: This module is not available in some SAMD21 (aka M0) builds. See the :ref:`module-support-matrix` for more info. //| - //| All classes change hardware state and should be deinitialized when they //| are no longer needed if the program continues after use. To do so, either //| call :py:meth:`!deinit` or use a context manager. See diff --git a/shared-bindings/sdcardio/SDCard.c b/shared-bindings/sdcardio/SDCard.c index a0582d1435..975f8b0953 100644 --- a/shared-bindings/sdcardio/SDCard.c +++ b/shared-bindings/sdcardio/SDCard.c @@ -125,7 +125,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_deinit_obj, sdcardio_sdcard_deinit); //| """Read one or more blocks from the card //| //| :param int start_block: The block to start reading from -//| :param bytearray buf: The buffer to write into. Length must be multiple of 512. +//| :param ~_typing.WriteableBuffer buf: The buffer to write into. Length must be multiple of 512. //| //| :return: None""" //| @@ -149,7 +149,7 @@ MP_DEFINE_CONST_FUN_OBJ_3(sdcardio_sdcard_readblocks_obj, sdcardio_sdcard_readbl //| """Write one or more blocks to the card //| //| :param int start_block: The block to start writing from -//| :param bytearray buf: The buffer to read from. Length must be multiple of 512. +//| :param ~_typing.ReadableBuffer buf: The buffer to read from. Length must be multiple of 512. //| //| :return: None""" //| diff --git a/shared-bindings/sdioio/SDCard.c b/shared-bindings/sdioio/SDCard.c index 594fa71fff..aba414cd63 100644 --- a/shared-bindings/sdioio/SDCard.c +++ b/shared-bindings/sdioio/SDCard.c @@ -165,7 +165,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_count_obj, sdioio_sdcard_count); //| """Read one or more blocks from the card //| //| :param int start_block: The block to start reading from -//| :param bytearray buf: The buffer to write into. Length must be multiple of 512. +//| :param ~_typing.WriteableBuffer buf: The buffer to write into. Length must be multiple of 512. //| //| :return: None""" mp_obj_t sdioio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { @@ -182,12 +182,12 @@ mp_obj_t sdioio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_ MP_DEFINE_CONST_FUN_OBJ_3(sdioio_sdcard_readblocks_obj, sdioio_sdcard_readblocks); -//| def writeblocks(self, start_block: int, buf: WriteableBuffer) -> None: +//| def writeblocks(self, start_block: int, buf: ReadableBuffer) -> None: //| //| """Write one or more blocks to the card //| //| :param int start_block: The block to start writing from -//| :param bytearray buf: The buffer to read from. Length must be multiple of 512. +//| :param ~_typing.ReadableBuffer buf: The buffer to read from. Length must be multiple of 512. //| //| :return: None""" //| diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c index 53ac57d11a..38840da5ea 100644 --- a/shared-bindings/socket/__init__.c +++ b/shared-bindings/socket/__init__.c @@ -52,11 +52,17 @@ STATIC const mp_obj_type_t socket_type; //| def __init__(self, family: int, type: int, proto: int) -> None: //| """Create a new socket //| -//| :param ~int family: AF_INET or AF_INET6 -//| :param ~int type: SOCK_STREAM, SOCK_DGRAM or SOCK_RAW -//| :param ~int proto: IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW (ignored)""" +//| :param int family: AF_INET or AF_INET6 +//| :param int type: SOCK_STREAM, SOCK_DGRAM or SOCK_RAW +//| :param int proto: IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW (ignored)""" //| ... //| +//| AF_INET: int +//| AF_INET6: int +//| SOCK_STREAM: int +//| SOCK_DGRAM: int +//| SOCK_RAW: int +//| STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 0, 4, false); @@ -96,10 +102,11 @@ STATIC void socket_select_nic(mod_network_socket_obj_t *self, const byte *ip) { } } -//| def bind(self, address: tuple) -> None: +//| def bind(self, address: Tuple[str, int]) -> None: //| """Bind a socket to an address //| -//| :param ~tuple address: tuple of (remote_address, remote_port)""" +//| :param address: tuple of (remote_address, remote_port) +//| :type address: tuple(str, int)""" //| ... //| @@ -126,7 +133,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_bind_obj, socket_bind); //| def listen(self, backlog: int) -> None: //| """Set socket to listen for incoming connections //| -//| :param ~int backlog: length of backlog queue for waiting connetions""" +//| :param int backlog: length of backlog queue for waiting connetions""" //| ... //| @@ -148,7 +155,7 @@ STATIC mp_obj_t socket_listen(mp_obj_t self_in, mp_obj_t backlog) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_listen_obj, socket_listen); -//| def accept(self) -> tuple: +//| def accept(self) -> Tuple[socket, str]: //| """Accept a connection on a listening socket of type SOCK_STREAM, //| creating a new socket of type SOCK_STREAM. //| Returns a tuple of (new_socket, remote_address)""" @@ -185,10 +192,11 @@ STATIC mp_obj_t socket_accept(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(socket_accept_obj, socket_accept); -//| def connect(self, address: tuple) -> None: +//| def connect(self, address: Tuple[str, int]) -> None: //| """Connect a socket to a remote address //| -//| :param ~tuple address: tuple of (remote_address, remote_port)""" +//| :param address: tuple of (remote_address, remote_port) +//| :type address: tuple(str, int)""" //| ... //| @@ -216,7 +224,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_connect_obj, socket_connect); //| """Send some bytes to the connected remote address. //| Suits sockets of type SOCK_STREAM //| -//| :param ~bytes bytes: some bytes to send""" +//| :param ~_typing.ReadableBuffer bytes: some bytes to send""" //| ... //| @@ -259,7 +267,7 @@ STATIC mp_int_t _socket_recv_into(mod_network_socket_obj_t *sock, byte *buf, mp_ //| Suits sockets of type SOCK_STREAM //| Returns an int of number of bytes read. //| -//| :param bytearray buffer: buffer to receive into +//| :param ~_typing.WriteableBuffer buffer: buffer to receive into //| :param int bufsize: optionally, a maximum number of bytes to read.""" //| ... //| @@ -290,7 +298,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_recv_into_obj, 2, 3, socket_re //| Suits sockets of type SOCK_STREAM //| Returns a bytes() of length <= bufsize //| -//| :param ~int bufsize: maximum number of bytes to receive""" +//| :param int bufsize: maximum number of bytes to receive""" //| ... //| @@ -312,12 +320,13 @@ STATIC mp_obj_t socket_recv(mp_obj_t self_in, mp_obj_t len_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_recv_obj, socket_recv); -//| def sendto(self, bytes: ReadableBuffer, address: tuple) -> int: +//| def sendto(self, bytes: ReadableBuffer, address: Tuple[str, int]) -> int: //| """Send some bytes to a specific address. //| Suits sockets of type SOCK_DGRAM //| -//| :param ~bytes bytes: some bytes to send -//| :param ~tuple address: tuple of (remote_address, remote_port)""" +//| :param ~_typing.ReadableBuffer bytes: some bytes to send +//| :param address: tuple of (remote_address, remote_port) +//| :type address: tuple(str, int)""" //| ... //| @@ -346,7 +355,7 @@ STATIC mp_obj_t socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_obj_t addr_ } STATIC MP_DEFINE_CONST_FUN_OBJ_3(socket_sendto_obj, socket_sendto); -//| def recvfrom(self, bufsize: int) -> Tuple[bytes, tuple]: +//| def recvfrom(self, bufsize: int) -> Tuple[bytes, Tuple[str, int]]: //| """Reads some bytes from the connected remote address. //| Suits sockets of type SOCK_STREAM //| @@ -354,7 +363,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_3(socket_sendto_obj, socket_sendto); //| * a bytes() of length <= bufsize //| * a remote_address, which is a tuple of ip address and port number //| -//| :param ~int bufsize: maximum number of bytes to receive""" +//| :param int bufsize: maximum number of bytes to receive""" //| ... //| @@ -422,7 +431,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_setsockopt_obj, 4, 4, socket_s //| def settimeout(self, value: int) -> None: //| """Set the timeout value for this socket. //| -//| :param ~int value: timeout in seconds. 0 means non-blocking. None means block indefinitely.""" +//| :param int value: timeout in seconds. 0 means non-blocking. None means block indefinitely.""" //| ... //| @@ -453,7 +462,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_settimeout_obj, socket_settimeout); //| def setblocking(self, flag: bool) -> Optional[int]: //| """Set the blocking behaviour of this socket. //| -//| :param ~bool flag: False means non-blocking, True means block indefinitely.""" +//| :param bool flag: False means non-blocking, True means block indefinitely.""" //| ... //| @@ -512,7 +521,7 @@ STATIC const mp_obj_type_t socket_type = { .locals_dict = (mp_obj_dict_t*)&socket_locals_dict, }; -//| def getaddrinfo(host: str, port: int) -> tuple: +//| def getaddrinfo(host: str, port: int) -> Tuple[int, int, int, str, str]: //| """Gets the address information for a hostname and port //| //| Returns the appropriate family, socket type, socket protocol and diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c index 79c5274aae..cafaf59869 100644 --- a/shared-bindings/storage/__init__.c +++ b/shared-bindings/storage/__init__.c @@ -187,7 +187,7 @@ STATIC const mp_rom_map_elem_t storage_module_globals_table[] = { //| """Like builtin ``open()``""" //| ... //| -//| def ilistdir(self, path: str) -> Iterator[Tuple[AnyStr, int, int, int]]: +//| def ilistdir(self, path: str) -> Iterator[Union[Tuple[AnyStr, int, int, int], Tuple[AnyStr, int, int]]]: //| """Return an iterator whose values describe files and folders within //| ``path``""" //| ... @@ -200,11 +200,11 @@ STATIC const mp_rom_map_elem_t storage_module_globals_table[] = { //| """Like `os.rmdir`""" //| ... //| -//| def stat(self, path: str) -> str: +//| def stat(self, path: str) -> Tuple[int, int, int, int, int, int, int, int, int, int]: //| """Like `os.stat`""" //| ... //| -//| def statvfs(self, path: str) -> Tuple[str, str, str, str, str, str, str, str, str, str]: +//| def statvfs(self, path: int) -> Tuple[int, int, int, int, int, int, int, int, int, int]: //| """Like `os.statvfs`""" //| ... //| diff --git a/shared-bindings/struct/__init__.c b/shared-bindings/struct/__init__.c index d74b962125..b886a662e8 100644 --- a/shared-bindings/struct/__init__.c +++ b/shared-bindings/struct/__init__.c @@ -62,7 +62,7 @@ STATIC mp_obj_t struct_calcsize(mp_obj_t fmt_in) { } MP_DEFINE_CONST_FUN_OBJ_1(struct_calcsize_obj, struct_calcsize); -//| def pack(fmt: str, *values: ReadableBuffer) -> bytes: +//| def pack(fmt: str, *values: Any) -> bytes: //| """Pack the values according to the format string fmt. //| The return value is a bytes object encoding the values.""" //| ... @@ -80,7 +80,7 @@ STATIC mp_obj_t struct_pack(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(struct_pack_obj, 1, MP_OBJ_FUN_ARGS_MAX, struct_pack); -//| def pack_into(fmt: str, buffer: WriteableBuffer, offset: int, *values: ReadableBuffer) -> None: +//| def pack_into(fmt: str, buffer: WriteableBuffer, offset: int, *values: Any) -> None: //| """Pack the values according to the format string fmt into a buffer //| starting at offset. offset may be negative to count from the end of buffer.""" //| ... @@ -106,7 +106,7 @@ STATIC mp_obj_t struct_pack_into(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(struct_pack_into_obj, 3, MP_OBJ_FUN_ARGS_MAX, struct_pack_into); -//| def unpack(fmt: str, data: ReadableBuffer) -> tuple: +//| def unpack(fmt: str, data: ReadableBuffer) -> Tuple[Any, ...]: //| """Unpack from the data according to the format string fmt. The return value //| is a tuple of the unpacked values. The buffer size must match the size //| required by the format.""" @@ -124,7 +124,7 @@ STATIC mp_obj_t struct_unpack(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(struct_unpack_obj, 2, 3, struct_unpack); -//| def unpack_from(fmt: str, data: ReadableBuffer, offset: int = 0) -> tuple: +//| def unpack_from(fmt: str, data: ReadableBuffer, offset: int = 0) -> Tuple[Any, ...]: //| """Unpack from the data starting at offset according to the format string fmt. //| offset may be negative to count from the end of buffer. The return value is //| a tuple of the unpacked values. The buffer size must be at least as big diff --git a/shared-bindings/supervisor/__init__.c b/shared-bindings/supervisor/__init__.c index b59394bbcd..bc6fdbff5a 100644 --- a/shared-bindings/supervisor/__init__.c +++ b/shared-bindings/supervisor/__init__.c @@ -45,7 +45,7 @@ //| This object is the sole instance of `supervisor.Runtime`.""" //| -//| def enable_autoreload(self) -> None: +//| def enable_autoreload() -> None: //| """Enable autoreload based on USB file write activity.""" //| ... //| @@ -55,7 +55,7 @@ STATIC mp_obj_t supervisor_enable_autoreload(void) { } MP_DEFINE_CONST_FUN_OBJ_0(supervisor_enable_autoreload_obj, supervisor_enable_autoreload); -//| def disable_autoreload(self) -> None: +//| def disable_autoreload() -> None: //| """Disable autoreload based on USB file write activity until //| `enable_autoreload` is called.""" //| ... @@ -66,7 +66,7 @@ STATIC mp_obj_t supervisor_disable_autoreload(void) { } MP_DEFINE_CONST_FUN_OBJ_0(supervisor_disable_autoreload_obj, supervisor_disable_autoreload); -//| def set_rgb_status_brightness(self, brightness: int) -> None: +//| def set_rgb_status_brightness(brightness: int) -> None: //| """Set brightness of status neopixel from 0-255 //| `set_rgb_status_brightness` is called.""" //| ... @@ -82,7 +82,7 @@ STATIC mp_obj_t supervisor_set_rgb_status_brightness(mp_obj_t lvl){ } MP_DEFINE_CONST_FUN_OBJ_1(supervisor_set_rgb_status_brightness_obj, supervisor_set_rgb_status_brightness); -//| def reload(self) -> None: +//| def reload() -> None: //| """Reload the main Python code and run it (equivalent to hitting Ctrl-D at the REPL).""" //| ... //| @@ -93,7 +93,7 @@ STATIC mp_obj_t supervisor_reload(void) { } MP_DEFINE_CONST_FUN_OBJ_0(supervisor_reload_obj, supervisor_reload); -//| def set_next_stack_limit(self, size: int) -> None: +//| def set_next_stack_limit(size: int) -> None: //| """Set the size of the stack for the next vm run. If its too large, the default will be used.""" //| ... //| diff --git a/shared-bindings/terminalio/__init__.c b/shared-bindings/terminalio/__init__.c index 5892111395..9cd1da5b67 100644 --- a/shared-bindings/terminalio/__init__.c +++ b/shared-bindings/terminalio/__init__.c @@ -40,6 +40,9 @@ //| The `terminalio` module contains classes to display a character stream on a display. The built //| in font is available as ``terminalio.FONT``.""" //| +//| FONT: fontio.BuiltinFont +//| """The built in font""" +//| STATIC const mp_rom_map_elem_t terminalio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_terminalio) }, { MP_ROM_QSTR(MP_QSTR_Terminal), MP_OBJ_FROM_PTR(&terminalio_terminal_type) }, diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 262da17fd2..e30cf60358 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -93,7 +93,7 @@ mp_obj_t struct_time_make_new(const mp_obj_type_t *type, size_t n_args, const mp } //| class struct_time: -//| def __init__(self, time_tuple: tuple) -> None: +//| def __init__(self, time_tuple: Tuple[int, int, int, int, int, int, int, int, int]) -> None: //| """Structure used to capture a date and time. Note that it takes a tuple! //| //| :param tuple time_tuple: Tuple of time info: ``(tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec, tm_wday, tm_yday, tm_isdst)`` diff --git a/shared-bindings/usb_midi/__init__.c b/shared-bindings/usb_midi/__init__.c index 5570b601ca..e61086f84f 100644 --- a/shared-bindings/usb_midi/__init__.c +++ b/shared-bindings/usb_midi/__init__.c @@ -35,8 +35,14 @@ #include "py/runtime.h" -//| """Classes to transmit and receive MIDI messages over USB""" +//| """MIDI over USB //| +//| The `usb_midi` module contains classes to transmit and receive MIDI messages over USB.""" +//| +//| ports: Tuple[Union[PortIn, PortOut], ...] +//| """Tuple of all MIDI ports. Each item is ether `PortIn` or `PortOut`.""" +//| + mp_map_elem_t usb_midi_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_usb_midi) }, { MP_ROM_QSTR(MP_QSTR_ports), mp_const_empty_tuple }, diff --git a/shared-bindings/vectorio/VectorShape.c b/shared-bindings/vectorio/VectorShape.c index 957e9dc089..bc8c8d29c7 100644 --- a/shared-bindings/vectorio/VectorShape.c +++ b/shared-bindings/vectorio/VectorShape.c @@ -20,7 +20,7 @@ //| class VectorShape: -//| def __init__(self, shape: Polygon, pixel_shader: displayio.Palette, x: int=0, y: int=0) -> None: +//| def __init__(self, shape: Union[Polygon, Rectangle, Circle], pixel_shader: Union[displayio.ColorConverter, displayio.Palette], x: int=0, y: int=0) -> None: //| """Binds a vector shape to a location and pixel color //| //| :param shape: The shape to draw. @@ -145,7 +145,7 @@ const mp_obj_property_t vectorio_vector_shape_y_obj = { }; -//| pixel_shader: displayio.Palette +//| pixel_shader: Union[displayio.ColorConverter, displayio.Palette] //| """The pixel shader of the shape.""" //| STATIC mp_obj_t vectorio_vector_shape_obj_get_pixel_shader(mp_obj_t self_in) { diff --git a/shared-bindings/wiznet/wiznet5k.c b/shared-bindings/wiznet/wiznet5k.c index 4e5744d827..5e9a3a9fbc 100644 --- a/shared-bindings/wiznet/wiznet5k.c +++ b/shared-bindings/wiznet/wiznet5k.c @@ -134,7 +134,7 @@ const mp_obj_property_t wiznet5k_dhcp_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def ifconfig(self, params: Optional[Tuple] = None) -> Optional[Tuple]: +//| def ifconfig(self, params: Optional[Tuple[str, str, str, str]] = None) -> Optional[Tuple[str, str, str, str]]: //| """Called without parameters, returns a tuple of //| (ip_address, subnet_mask, gateway_address, dns_server) //| diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index d29c3444f4..4d82e9e5d3 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -17,79 +17,99 @@ import black IMPORTS_IGNORE = frozenset({'int', 'float', 'bool', 'str', 'bytes', 'tuple', 'list', 'set', 'dict', 'bytearray', 'slice', 'file', 'buffer', 'range', 'array', 'struct_time'}) -IMPORTS_TYPING = frozenset({'Any', 'Optional', 'Union', 'Tuple', 'List', 'Sequence', 'Iterable', 'Iterator', 'overload'}) -IMPORTS_TYPESHED = frozenset({'ReadableBuffer', 'WriteableBuffer'}) +IMPORTS_TYPING = frozenset({'Any', 'Optional', 'Union', 'Tuple', 'List', 'Sequence', 'NamedTuple', 'Iterable', 'Iterator', 'Callable', 'AnyStr', 'overload'}) +CPY_TYPING = frozenset({'ReadableBuffer', 'WriteableBuffer', 'AudioSample', 'FrameBuffer'}) -def is_any(node): - node_type = type(node) +def is_typed(node, allow_any=False): if node is None: + return False + if allow_any: return True - if node_type == ast.Name and node.id == "Any": - return True - if (node_type == ast.Attribute and type(node.value) == ast.Name - and node.value.id == "typing" and node.attr == "Any"): - return True - return False + elif isinstance(node, ast.Name) and node.id == "Any": + return False + elif isinstance(node, ast.Attribute) and type(node.value) == ast.Name \ + and node.value.id == "typing" and node.attr == "Any": + return False + return True -def report_missing_annotations(tree): +def find_stub_issues(tree): for node in ast.walk(tree): - node_type = type(node) - if node_type == ast.AnnAssign: - if is_any(node.annotation): - print(f"Missing attribute type on line {node.lineno}") - elif node_type == ast.arg: - if is_any(node.annotation) and node.arg != "self": - print(f"Missing argument type: {node.arg} on line {node.lineno}") - elif node_type == ast.FunctionDef: - if is_any(node.returns) and node.name != "__init__": - print(f"Missing return type: {node.name} on line {node.lineno}") + if isinstance(node, ast.AnnAssign): + if not is_typed(node.annotation): + yield ("WARN", f"Missing attribute type on line {node.lineno}") + if isinstance(node.value, ast.Constant) and node.value.value == Ellipsis: + yield ("WARN", f"Unnecessary Ellipsis assignment (= ...) on line {node.lineno}.") + elif isinstance(node, ast.Assign): + if isinstance(node.value, ast.Constant) and node.value.value == Ellipsis: + yield ("WARN", f"Unnecessary Ellipsis assignment (= ...) on line {node.lineno}.") + elif isinstance(node, ast.arguments): + for arg_node in (node.args + node.posonlyargs + node.kwonlyargs): + if not is_typed(arg_node.annotation) and (arg_node.arg != "self" and arg_node.arg != "cls"): + yield ("WARN", f"Missing argument type: {arg_node.arg} on line {arg_node.lineno}") + if node.vararg and not is_typed(node.vararg.annotation, allow_any=True): + yield ("WARN", f"Missing argument type: *{node.vararg.arg} on line {node.vararg.lineno}") + if node.kwarg and not is_typed(node.kwarg.annotation, allow_any=True): + yield ("WARN", f"Missing argument type: **{node.kwarg.arg} on line {node.kwarg.lineno}") + elif isinstance(node, ast.FunctionDef): + if not is_typed(node.returns): + yield ("WARN", f"Missing return type: {node.name} on line {node.lineno}") def extract_imports(tree): modules = set() typing = set() - typeshed = set() + cpy_typing = set() def collect_annotations(anno_tree): if anno_tree is None: return for node in ast.walk(anno_tree): - node_type = type(node) - if node_type == ast.Name: + if isinstance(node, ast.Name): if node.id in IMPORTS_IGNORE: continue elif node.id in IMPORTS_TYPING: typing.add(node.id) - elif node.id in IMPORTS_TYPESHED: - typeshed.add(node.id) - if node_type == ast.Attribute: - if type(node.value) == ast.Name: + elif node.id in CPY_TYPING: + cpy_typing.add(node.id) + elif isinstance(node, ast.Attribute): + if isinstance(node.value, ast.Name): modules.add(node.value.id) for node in ast.walk(tree): - node_type = type(node) - if (node_type == ast.AnnAssign) or (node_type == ast.arg): + if isinstance(node, (ast.AnnAssign, ast.arg)): collect_annotations(node.annotation) - elif node_type == ast.FunctionDef: + elif isinstance(node, ast.Assign): + collect_annotations(node.value) + elif isinstance(node, ast.FunctionDef): collect_annotations(node.returns) for deco in node.decorator_list: - if deco.id in IMPORTS_TYPING: + if isinstance(deco, ast.Name) and (deco.id in IMPORTS_TYPING): typing.add(deco.id) return { "modules": sorted(modules), "typing": sorted(typing), - "typeshed": sorted(typeshed), + "cpy_typing": sorted(cpy_typing), } +def find_references(tree): + for node in ast.walk(tree): + if isinstance(node, ast.arguments): + for node in ast.walk(node): + if isinstance(node, ast.Attribute): + if isinstance(node.value, ast.Name) and node.value.id[0].isupper(): + yield node.value.id + + def convert_folder(top_level, stub_directory): ok = 0 total = 0 filenames = sorted(os.listdir(top_level)) - pyi_lines = [] + stub_fragments = [] + references = set() for filename in filenames: full_path = os.path.join(top_level, filename) @@ -99,50 +119,69 @@ def convert_folder(top_level, stub_directory): ok += mok total += mtotal elif filename.endswith(".c"): - with open(full_path, "r") as f: + with open(full_path, "r", encoding="utf-8") as f: for line in f: + line = line.rstrip() if line.startswith("//|"): - if line[3] == " ": + if len(line) == 3: + line = "" + elif line[3] == " ": line = line[4:] - elif line[3] == "\n": - line = line[3:] else: - continue + line = line[3:] + print("[WARN] There must be at least one space after '//|'") file_lines.append(line) elif filename.endswith(".pyi"): with open(full_path, "r") as f: - file_lines.extend(f.readlines()) + file_lines.extend(line.rstrip() for line in f) - # Always put the contents from an __init__ first. - if filename.startswith("__init__."): - pyi_lines = file_lines + pyi_lines - else: - pyi_lines.extend(file_lines) + fragment = "\n".join(file_lines).strip() + try: + tree = ast.parse(fragment) + except SyntaxError as e: + print(f"[ERROR] Failed to parse a Python stub from {full_path}") + traceback.print_exception(type(e), e, e.__traceback__) + return (ok, total + 1) + references.update(find_references(tree)) - if not pyi_lines: + if fragment: + name = os.path.splitext(os.path.basename(filename))[0] + if name == "__init__" or (name in references): + stub_fragments.insert(0, fragment) + else: + stub_fragments.append(fragment) + + if not stub_fragments: return (ok, total) stub_filename = os.path.join(stub_directory, "__init__.pyi") print(stub_filename) - stub_contents = "".join(pyi_lines) + stub_contents = "\n\n".join(stub_fragments) - # Validate that the module is a parseable stub. - total += 1 + # Validate the stub code. try: tree = ast.parse(stub_contents) - imports = extract_imports(tree) - report_missing_annotations(tree) - ok += 1 except SyntaxError as e: traceback.print_exception(type(e), e, e.__traceback__) return (ok, total) + error = False + for (level, msg) in find_stub_issues(tree): + if level == "ERROR": + error = True + print(f"[{level}] {msg}") + + total += 1 + if not error: + ok += 1 + # Add import statements + imports = extract_imports(tree) import_lines = ["from __future__ import annotations"] if imports["typing"]: import_lines.append("from typing import " + ", ".join(imports["typing"])) - if imports["typeshed"]: - import_lines.append("from _typeshed import " + ", ".join(imports["typeshed"])) + if imports["cpy_typing"]: + import_lines.append("from _typing import " + ", ".join(imports["cpy_typing"])) import_lines.extend(f"import {m}" for m in imports["modules"]) import_body = "\n".join(import_lines) m = re.match(r'(\s*""".*?""")', stub_contents, flags=re.DOTALL) @@ -159,7 +198,6 @@ def convert_folder(top_level, stub_directory): with open(stub_filename, "w") as f: f.write(stub_contents) - print() return (ok, total) From af1291ec28a8d2881e820fc1ce9b938ab5a6f097 Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Fri, 7 Aug 2020 16:23:42 +0800 Subject: [PATCH 0509/1293] dynamically enable or disable QSPI by default --- .../makerdiary_m60_keyboard/mpconfigboard.h | 3 +- ports/nrf/supervisor/port.c | 4 +- ports/nrf/supervisor/qspi_flash.c | 40 +++++++------------ 3 files changed, 18 insertions(+), 29 deletions(-) diff --git a/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h b/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h index e8c268d5bf..4fb6049c5f 100644 --- a/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h +++ b/ports/nrf/boards/makerdiary_m60_keyboard/mpconfigboard.h @@ -30,7 +30,7 @@ #define MICROPY_HW_BOARD_NAME "Makerdiary M60 Keyboard" #define MICROPY_HW_MCU_NAME "nRF52840" -// not use the RGB LEDs to save energy +// RGB LEDs use PWM peripheral, avoid using them to save energy // #define CP_RGB_STATUS_R (&pin_P0_30) // #define CP_RGB_STATUS_G (&pin_P0_29) // #define CP_RGB_STATUS_B (&pin_P0_31) @@ -41,7 +41,6 @@ #define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(1, 12) #define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(1, 11) #define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(1, 13) -#define MICROPY_QSPI_OFF_WHEN_SLEEP #define BOARD_HAS_CRYSTAL 1 diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 36c9f836ea..87a4d7396f 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -65,7 +65,7 @@ #include "common-hal/audiopwmio/PWMAudioOut.h" #endif -#if defined(MICROPY_QSPI_CS) && defined(MICROPY_QSPI_OFF_WHEN_SLEEP) +#if defined(MICROPY_QSPI_CS) extern void qspi_disable(void); #endif @@ -299,7 +299,7 @@ void port_interrupt_after_ticks(uint32_t ticks) { } void port_sleep_until_interrupt(void) { -#if defined(MICROPY_QSPI_CS) && defined(MICROPY_QSPI_OFF_WHEN_SLEEP) +#if defined(MICROPY_QSPI_CS) qspi_disable(); #endif diff --git a/ports/nrf/supervisor/qspi_flash.c b/ports/nrf/supervisor/qspi_flash.c index 852f0c44a5..5ab56c6bc4 100644 --- a/ports/nrf/supervisor/qspi_flash.c +++ b/ports/nrf/supervisor/qspi_flash.c @@ -39,7 +39,21 @@ #include "supervisor/shared/external_flash/qspi_flash.h" // When USB is disconnected, disable QSPI in sleep mode to save energy -#if defined(MICROPY_QSPI_OFF_WHEN_SLEEP) +void qspi_disable(void) +{ + // If VBUS is detected, no need to disable QSPI + if (NRF_QSPI->ENABLE && !(NRF_POWER->USBREGSTATUS & POWER_USBREGSTATUS_VBUSDETECT_Msk)) { + // Keep CS high when QSPI is diabled + nrf_gpio_cfg_output(MICROPY_QSPI_CS); + nrf_gpio_pin_write(MICROPY_QSPI_CS, 1); + + // Workaround to disable QSPI according to nRF52840 Revision 1 Errata V1.4 - 3.8 + NRF_QSPI->TASKS_DEACTIVATE = 1; + *(volatile uint32_t *)0x40029054 = 1; + NRF_QSPI->ENABLE = 0; + } +} + void qspi_enable(void) { if (NRF_QSPI->ENABLE) { @@ -60,30 +74,6 @@ void qspi_enable(void) } while (--remaining_attempts); } -void qspi_disable(void) -{ - // Turn off QSPI when USB is disconnected - if (NRF_QSPI->ENABLE && !(NRF_POWER->USBREGSTATUS & POWER_USBREGSTATUS_VBUSDETECT_Msk)) { - // Keep CS high when QSPI is diabled - nrf_gpio_cfg_output(MICROPY_QSPI_CS); - nrf_gpio_pin_write(MICROPY_QSPI_CS, 1); - - // Workaround to disable QSPI according to nRF52840 Revision 1 Errata V1.4 - 3.8 - NRF_QSPI->TASKS_DEACTIVATE = 1; - *(volatile uint32_t *)0x40029054 = 1; - NRF_QSPI->ENABLE = 0; - } -} -#else -void qspi_enable(void) -{ -} - -void qspi_disable(void) -{ -} -#endif - bool spi_flash_command(uint8_t command) { qspi_enable(); nrf_qspi_cinstr_conf_t cinstr_cfg = { From 49969e08c32367af9d5929ba85d971f2500b1d73 Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Thu, 6 Aug 2020 22:55:39 +0000 Subject: [PATCH 0510/1293] Translated using Weblate (Spanish) Currently translated at 100.0% (786 of 786 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/locale/es.po b/locale/es.po index 6ed41b4a89..6e95e0321f 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-30 07:23-0500\n" -"PO-Revision-Date: 2020-07-22 20:48+0000\n" +"PO-Revision-Date: 2020-08-07 15:06+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" @@ -89,7 +89,7 @@ msgstr "%q lista debe ser una lista" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" -msgstr "" +msgstr "%q debe ser >= 0" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -229,7 +229,7 @@ msgstr "'await' fuera de la función" #: py/compile.c msgid "'await', 'async for' or 'async with' outside async function" -msgstr "" +msgstr "'await', 'async for' o 'async with' fuera de la función async" #: py/compile.c msgid "'break' outside loop" @@ -241,7 +241,7 @@ msgstr "'continue' fuera de un bucle" #: py/objgenerator.c msgid "'coroutine' object is not an iterator" -msgstr "" +msgstr "el objeto 'coroutine' no es un iterador" #: py/compile.c msgid "'data' requires at least 2 arguments" @@ -338,7 +338,7 @@ msgstr "Ya se encuentra publicando." #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" -msgstr "" +msgstr "Ya está ejecutando" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -378,7 +378,7 @@ msgstr "Como máximo %d %q se puede especificar (no %d)" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" -msgstr "" +msgstr "Tratando de soliciar %d bloques" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." @@ -885,7 +885,7 @@ msgstr "Error de inicio de I2C" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" -msgstr "" +msgstr "I2SOut no disponible" #: shared-bindings/aesio/aes.c #, c-format @@ -1591,6 +1591,8 @@ msgstr "" msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +"Temporizador declarado para uso interno - declare los pines de PWM más " +"temprano en el programa" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1866,7 +1868,7 @@ msgstr "el argumento tiene un tipo erroneo" #: extmod/ulab/code/linalg/linalg.c msgid "argument must be ndarray" -msgstr "" +msgstr "el argumento debe ser ndarray" #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c @@ -3266,7 +3268,7 @@ msgstr "demasiados valores para descomprimir (%d esperado)" #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" -msgstr "" +msgstr "trapz está definido para arreglos 1D de tamaño igual" #: extmod/ulab/code/linalg/linalg.c py/objstr.c msgid "tuple index out of range" @@ -3398,7 +3400,7 @@ msgstr "value_count debe ser > 0" #: extmod/ulab/code/linalg/linalg.c msgid "vectors must have same lengths" -msgstr "" +msgstr "los vectores deben tener el mismo tamaño" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" From 5eef3c47ebd2a2a793877109fedaa6b56f4c204c Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Fri, 7 Aug 2020 17:06:49 +0200 Subject: [PATCH 0511/1293] 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 | 240 +++++++++++++---------------- locale/cs.po | 199 +++++++++--------------- locale/de_DE.po | 323 +++++++++++++++++++++----------------- locale/es.po | 324 ++++++++++++++++++++++----------------- locale/fil.po | 314 ++++++++++++++++++++----------------- locale/fr.po | 324 ++++++++++++++++++++++----------------- locale/hi.po | 194 ++++++++--------------- locale/it_IT.po | 315 ++++++++++++++++++++----------------- locale/ko.po | 214 ++++++++++---------------- locale/nl.po | 324 ++++++++++++++++++++++----------------- locale/pl.po | 315 ++++++++++++++++++++----------------- locale/pt_BR.po | 323 +++++++++++++++++++++----------------- locale/sv.po | 323 +++++++++++++++++++++----------------- locale/zh_Latn_pinyin.po | 321 +++++++++++++++++++++----------------- 14 files changed, 2123 insertions(+), 1930 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 05999b9c8c..d39cc055dd 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-30 07:23-0500\n" +"POT-Creation-Date: 2020-08-04 18:42-0500\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -72,13 +72,17 @@ msgstr "" msgid "%q in use" msgstr "%q sedang digunakan" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -116,6 +120,42 @@ msgstr "%q() mengambil posisi argumen %d tapi %d yang diberikan" msgid "'%q' argument required" msgstr "'%q' argumen dibutuhkan" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -166,48 +206,6 @@ msgstr "'%s' integer %d tidak dalam kisaran %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' integer 0x%x tidak cukup didalam mask 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "Objek '%s' tidak dapat menetapkan atribut '%q'" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "Objek '%s' tidak mendukung '%q'" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "Objek '%s' tidak mendukung penetapan item" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "Objek '%s' tidak mendukung penghapusan item" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "Objek '%s' tidak memiliki atribut '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "Objek '%s' bukan iterator" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "Objek '%s' tidak dapat dipanggil" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "'%s' objek tidak dapat diulang" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "Objek '%s' tidak dapat disubkripsikan" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "'=' perataan tidak diizinkan dalam penentu format string" @@ -1259,6 +1257,10 @@ msgstr "Tidak dapat menyambungkan ke AP" msgid "Not playing" msgstr "" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1344,10 +1346,6 @@ msgstr "Tambahkan module apapun pada filesystem\n" msgid "Polygon needs at least 3 points" msgstr "" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1423,13 +1421,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Berjalan di mode aman(safe mode)! Auto-reload tidak aktif.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" +msgid "Running in safe mode! " msgstr "" -"Berjalan di mode aman(safe mode)! tidak menjalankan kode yang tersimpan.\n" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1796,8 +1789,7 @@ msgid "__init__() should return None" msgstr "" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" +msgid "__init__() should return None, not '%q'" msgstr "" #: py/objobject.c @@ -1952,7 +1944,7 @@ msgstr "byte > 8 bit tidak didukung" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "kalibrasi keluar dari jangkauan" @@ -1984,47 +1976,16 @@ msgstr "" msgid "can't assign to expression" msgstr "tidak dapat menetapkan ke ekspresi" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "" - #: py/obj.c -msgid "can't convert to complex" -msgstr "" - -#: py/obj.c -msgid "can't convert to float" -msgstr "" - -#: py/obj.c -msgid "can't convert to int" +msgid "can't convert to %q" msgstr "" #: py/objstr.c @@ -2432,7 +2393,7 @@ msgstr "fungsi kehilangan argumen keyword '%q' yang dibutuhkan" msgid "function missing required positional argument #%d" msgstr "fungsi kehilangan argumen posisi #%d yang dibutuhkan" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "fungsi mengambil posisi argumen %d tapi %d yang diberikan" @@ -2481,10 +2442,7 @@ msgstr "lapisan (padding) tidak benar" msgid "index is out of bounds" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "index keluar dari jangkauan" @@ -2840,8 +2798,7 @@ msgid "number of points must be at least 2" msgstr "" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" +msgid "object '%q' is not a tuple or list" msgstr "" #: py/obj.c @@ -2877,8 +2834,7 @@ msgid "object not iterable" msgstr "" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" +msgid "object of type '%q' has no len()" msgstr "" #: py/obj.c @@ -2972,20 +2928,9 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "Muncul dari PulseIn yang kosong" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" msgstr "" #: py/objint_mpz.c @@ -3142,12 +3087,7 @@ msgid "stream operation not supported" msgstr "" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" +msgid "string indices must be integers, not %q" msgstr "" #: py/stream.c @@ -3158,10 +3098,6 @@ msgstr "" msgid "struct: cannot index" msgstr "struct: tidak bisa melakukan index" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: index keluar dari jangkauan" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct: tidak ada fields" @@ -3232,7 +3168,7 @@ msgstr "" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "" @@ -3299,8 +3235,7 @@ msgid "unknown conversion specifier %c" msgstr "" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" +msgid "unknown format code '%c' for object of type '%q'" msgstr "" #: py/compile.c @@ -3340,7 +3275,7 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "" #: py/runtime.c -msgid "unsupported type for %q: '%s'" +msgid "unsupported type for %q: '%q'" msgstr "" #: py/runtime.c @@ -3348,7 +3283,7 @@ msgid "unsupported type for operator" msgstr "" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" msgstr "" #: py/objint.c @@ -3428,6 +3363,49 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "indeks %q harus bilangan bulat, bukan %s" + +#~ msgid "'%s' object cannot assign attribute '%q'" +#~ msgstr "Objek '%s' tidak dapat menetapkan atribut '%q'" + +#~ msgid "'%s' object does not support '%q'" +#~ msgstr "Objek '%s' tidak mendukung '%q'" + +#~ msgid "'%s' object does not support item assignment" +#~ msgstr "Objek '%s' tidak mendukung penetapan item" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "Objek '%s' tidak mendukung penghapusan item" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "Objek '%s' tidak memiliki atribut '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "Objek '%s' bukan iterator" + +#~ msgid "'%s' object is not callable" +#~ msgstr "Objek '%s' tidak dapat dipanggil" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "'%s' objek tidak dapat diulang" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "Objek '%s' tidak dapat disubkripsikan" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Berjalan di mode aman(safe mode)! Auto-reload tidak aktif.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "" +#~ "Berjalan di mode aman(safe mode)! tidak menjalankan kode yang tersimpan.\n" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "Muncul dari PulseIn yang kosong" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: index keluar dari jangkauan" + #~ msgid "'async for' or 'async with' outside async function" #~ msgstr "'async for' atau 'async with' di luar fungsi async" diff --git a/locale/cs.po b/locale/cs.po index 26c8dd4490..9af10ce951 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-30 07:23-0500\n" +"POT-Creation-Date: 2020-08-04 18:42-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -72,13 +72,17 @@ msgstr "" msgid "%q in use" msgstr "%q se nyní používá" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c msgid "%q index out of range" msgstr "%q index je mimo rozsah" #: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "Indexy %q musí být celá čísla, nikoli %s" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -116,6 +120,42 @@ msgstr "" msgid "'%q' argument required" msgstr "" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -166,48 +206,6 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "" @@ -1241,6 +1239,10 @@ msgstr "" msgid "Not playing" msgstr "" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1326,10 +1328,6 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1402,11 +1400,7 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" +msgid "Running in safe mode! " msgstr "" #: shared-module/sdcardio/SDCard.c @@ -1767,8 +1761,7 @@ msgid "__init__() should return None" msgstr "" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" +msgid "__init__() should return None, not '%q'" msgstr "" #: py/objobject.c @@ -1922,7 +1915,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "" @@ -1954,47 +1947,16 @@ msgstr "" msgid "can't assign to expression" msgstr "" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "" - #: py/obj.c -msgid "can't convert to complex" -msgstr "" - -#: py/obj.c -msgid "can't convert to float" -msgstr "" - -#: py/obj.c -msgid "can't convert to int" +msgid "can't convert to %q" msgstr "" #: py/objstr.c @@ -2402,7 +2364,7 @@ msgstr "" msgid "function missing required positional argument #%d" msgstr "" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "" @@ -2451,10 +2413,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "" @@ -2810,8 +2769,7 @@ msgid "number of points must be at least 2" msgstr "" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" +msgid "object '%q' is not a tuple or list" msgstr "" #: py/obj.c @@ -2847,8 +2805,7 @@ msgid "object not iterable" msgstr "" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" +msgid "object of type '%q' has no len()" msgstr "" #: py/obj.c @@ -2941,20 +2898,9 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" msgstr "" #: py/objint_mpz.c @@ -3111,12 +3057,7 @@ msgid "stream operation not supported" msgstr "" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" +msgid "string indices must be integers, not %q" msgstr "" #: py/stream.c @@ -3127,10 +3068,6 @@ msgstr "" msgid "struct: cannot index" msgstr "" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "" @@ -3200,7 +3137,7 @@ msgstr "" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "" @@ -3267,8 +3204,7 @@ msgid "unknown conversion specifier %c" msgstr "" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" +msgid "unknown format code '%c' for object of type '%q'" msgstr "" #: py/compile.c @@ -3308,7 +3244,7 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "" #: py/runtime.c -msgid "unsupported type for %q: '%s'" +msgid "unsupported type for %q: '%q'" msgstr "" #: py/runtime.c @@ -3316,7 +3252,7 @@ msgid "unsupported type for operator" msgstr "" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" msgstr "" #: py/objint.c @@ -3395,3 +3331,6 @@ msgstr "" #: extmod/ulab/code/filter/filter.c 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" diff --git a/locale/de_DE.po b/locale/de_DE.po index 30f970aeae..9472d3f0f5 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-30 07:23-0500\n" +"POT-Creation-Date: 2020-08-04 18:42-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -71,13 +71,17 @@ msgstr "" msgid "%q in use" msgstr "%q in Benutzung" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -115,6 +119,42 @@ msgstr "%q() nimmt %d Argumente ohne Keyword an, aber es wurden %d angegeben" msgid "'%q' argument required" msgstr "'%q' Argument erforderlich" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -165,48 +205,6 @@ msgstr "'%s' integer %d ist nicht im Bereich %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' Integer 0x%x passt nicht in Maske 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "Das Objekt '%s' kann das Attribut '%q' nicht zuweisen" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "Das Objekt '%s' unterstützt '%q' nicht" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "'%s' Objekt unterstützt keine Zuweisung von Elementen" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "'%s' Objekt unterstützt das Löschen von Elementen nicht" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "'%s' Objekt hat kein Attribut '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "'%s' Objekt ist kein Iterator" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "'%s' object ist nicht aufrufbar" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "'%s' Objekt nicht iterierbar" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "'%s' Objekt hat keine '__getitem__'-Methode (not subscriptable)" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "'='-Ausrichtung ist im String-Formatbezeichner nicht zulässig" @@ -1260,6 +1258,10 @@ msgstr "Nicht verbunden" msgid "Not playing" msgstr "Spielt nicht ab" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1354,10 +1356,6 @@ msgstr "und alle Module im Dateisystem \n" msgid "Polygon needs at least 3 points" msgstr "Polygone brauchen mindestens 3 Punkte" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "Pop aus einem leeren Ps2-Puffer" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Der Präfixbuffer muss sich auf dem Heap befinden" @@ -1432,12 +1430,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "Zeileneintrag muss ein digitalio.DigitalInOut sein" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Sicherheitsmodus aktiv! Automatisches Neuladen ist deaktiviert.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Sicherheitsmodus aktiv! Gespeicherter Code wird nicht ausgeführt\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1824,9 +1818,8 @@ msgid "__init__() should return None" msgstr "__init__() sollte None zurückgeben" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "__init__() sollte None zurückgeben, nicht '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1979,7 +1972,7 @@ msgstr "bytes mit mehr als 8 bits werden nicht unterstützt" msgid "bytes value out of range" msgstr "Byte-Wert außerhalb des Bereichs" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "Kalibrierung ist außerhalb der Reichweite" @@ -2013,48 +2006,17 @@ msgstr "" msgid "can't assign to expression" msgstr "kann keinem Ausdruck zuweisen" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "kann %s nicht nach complex konvertieren" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "kann %s nicht nach float konvertieren" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "kann %s nicht nach int konvertieren" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "Kann '%q' Objekt nicht implizit nach %q konvertieren" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "kann NaN nicht nach int konvertieren" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "kann Adresse nicht in int konvertieren" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "kann inf nicht nach int konvertieren" - #: py/obj.c -msgid "can't convert to complex" -msgstr "kann nicht nach complex konvertieren" - -#: py/obj.c -msgid "can't convert to float" -msgstr "kann nicht nach float konvertieren" - -#: py/obj.c -msgid "can't convert to int" -msgstr "kann nicht nach int konvertieren" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2472,7 +2434,7 @@ msgstr "Funktion vermisst benötigtes Keyword-Argumente '%q'" msgid "function missing required positional argument #%d" msgstr "Funktion vermisst benötigtes Argumente ohne Keyword #%d" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "" @@ -2522,10 +2484,7 @@ msgstr "padding ist inkorrekt" msgid "index is out of bounds" msgstr "Index ist außerhalb der Grenzen" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "index außerhalb der Reichweite" @@ -2888,9 +2847,8 @@ msgid "number of points must be at least 2" msgstr "Die Anzahl der Punkte muss mindestens 2 betragen" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "Objekt '%s' ist weder tupel noch list" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2925,9 +2883,8 @@ msgid "object not iterable" msgstr "Objekt nicht iterierbar" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "Objekt vom Typ '%s' hat keine len()" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -3022,21 +2979,10 @@ msgstr "Polygon kann nur in einem übergeordneten Element registriert werden" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "pop von einem leeren PulseIn" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "pop von einer leeren Menge (set)" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "pop von einer leeren Liste" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "popitem(): dictionary ist leer" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3194,13 +3140,8 @@ msgid "stream operation not supported" msgstr "stream operation ist nicht unterstützt" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "String index außerhalb des Bereiches" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "String indizes müssen Integer sein, nicht %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3211,10 +3152,6 @@ msgstr "" msgid "struct: cannot index" msgstr "struct: kann nicht indexieren" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: index außerhalb gültigen Bereichs" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct: keine Felder" @@ -3284,7 +3221,7 @@ msgstr "zu viele Werte zum Auspacken (erwartet %d)" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "Tupelindex außerhalb des Bereichs" @@ -3355,9 +3292,8 @@ msgid "unknown conversion specifier %c" msgstr "unbekannter Konvertierungs specifier %c" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "unbekannter Formatcode '%c' für Objekt vom Typ '%s'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3396,16 +3332,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "nicht unterstütztes Formatzeichen '%c' (0x%x) bei Index %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "nicht unterstützter Type für %q: '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "nicht unterstützter Typ für Operator" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "nicht unterstützte Typen für %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3484,6 +3420,111 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "%q Indizes müssen Integer sein, nicht %s" + +#~ msgid "'%s' object cannot assign attribute '%q'" +#~ msgstr "Das Objekt '%s' kann das Attribut '%q' nicht zuweisen" + +#~ msgid "'%s' object does not support '%q'" +#~ msgstr "Das Objekt '%s' unterstützt '%q' nicht" + +#~ msgid "'%s' object does not support item assignment" +#~ msgstr "'%s' Objekt unterstützt keine Zuweisung von Elementen" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "'%s' Objekt unterstützt das Löschen von Elementen nicht" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "'%s' Objekt hat kein Attribut '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "'%s' Objekt ist kein Iterator" + +#~ msgid "'%s' object is not callable" +#~ msgstr "'%s' object ist nicht aufrufbar" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "'%s' Objekt nicht iterierbar" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "'%s' Objekt hat keine '__getitem__'-Methode (not subscriptable)" + +#~ msgid "Pop from an empty Ps2 buffer" +#~ msgstr "Pop aus einem leeren Ps2-Puffer" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Sicherheitsmodus aktiv! Automatisches Neuladen ist deaktiviert.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "Sicherheitsmodus aktiv! Gespeicherter Code wird nicht ausgeführt\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "__init__() sollte None zurückgeben, nicht '%s'" + +#~ msgid "can't convert %s to complex" +#~ msgstr "kann %s nicht nach complex konvertieren" + +#~ msgid "can't convert %s to float" +#~ msgstr "kann %s nicht nach float konvertieren" + +#~ msgid "can't convert %s to int" +#~ msgstr "kann %s nicht nach int konvertieren" + +#~ msgid "can't convert NaN to int" +#~ msgstr "kann NaN nicht nach int konvertieren" + +#~ msgid "can't convert address to int" +#~ msgstr "kann Adresse nicht in int konvertieren" + +#~ msgid "can't convert inf to int" +#~ msgstr "kann inf nicht nach int konvertieren" + +#~ msgid "can't convert to complex" +#~ msgstr "kann nicht nach complex konvertieren" + +#~ msgid "can't convert to float" +#~ msgstr "kann nicht nach float konvertieren" + +#~ msgid "can't convert to int" +#~ msgstr "kann nicht nach int konvertieren" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "Objekt '%s' ist weder tupel noch list" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "Objekt vom Typ '%s' hat keine len()" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "pop von einem leeren PulseIn" + +#~ msgid "pop from an empty set" +#~ msgstr "pop von einer leeren Menge (set)" + +#~ msgid "pop from empty list" +#~ msgstr "pop von einer leeren Liste" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "popitem(): dictionary ist leer" + +#~ msgid "string index out of range" +#~ msgstr "String index außerhalb des Bereiches" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "String indizes müssen Integer sein, nicht %s" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: index außerhalb gültigen Bereichs" + +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "unbekannter Formatcode '%c' für Objekt vom Typ '%s'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "nicht unterstützter Type für %q: '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "nicht unterstützte Typen für %q: '%s', '%s'" + #~ msgid "'async for' or 'async with' outside async function" #~ msgstr "'async for' oder 'async with' außerhalb der asynchronen Funktion" diff --git a/locale/es.po b/locale/es.po index 6e95e0321f..23aa0c932a 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-30 07:23-0500\n" +"POT-Creation-Date: 2020-08-04 18:42-0500\n" "PO-Revision-Date: 2020-08-07 15:06+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -75,13 +75,17 @@ msgstr "%q fallo: %d" msgid "%q in use" msgstr "%q está siendo utilizado" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -119,6 +123,42 @@ msgstr "%q() toma %d argumentos posicionales pero %d fueron dados" msgid "'%q' argument required" msgstr "argumento '%q' requerido" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -169,48 +209,6 @@ msgstr "'%s' entero %d no esta dentro del rango %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' entero 0x%x no cabe en la máscara 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "El objeto '%s' no puede asignar al atributo '%q'" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "El objeto '%s' no admite '%q'" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "el objeto '%s' no soporta la asignación de elementos" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "objeto '%s' no soporta la eliminación de elementos" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "objeto '%s' no tiene atributo '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "objeto '%s' no es un iterator" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "objeto '%s' no puede ser llamado" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "objeto '%s' no es iterable" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "el objeto '%s' no es suscriptable" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "'=' alineación no permitida en el especificador string format" @@ -1259,6 +1257,10 @@ msgstr "No conectado" msgid "Not playing" msgstr "No reproduciendo" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1354,10 +1356,6 @@ msgstr "Además de cualquier módulo en el sistema de archivos\n" msgid "Polygon needs at least 3 points" msgstr "El polígono necesita al menos 3 puntos" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "Pop de un buffer Ps2 vacio" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "El búfer de prefijo debe estar en el montículo" @@ -1431,12 +1429,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "La entrada de la fila debe ser digitalio.DigitalInOut" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Ejecutando en modo seguro! La auto-recarga esta deshabilitada.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Ejecutando en modo seguro! No se esta ejecutando el código guardado.\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1821,9 +1815,8 @@ msgid "__init__() should return None" msgstr "__init__() deberia devolver None" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "__init__() deberia devolver None, no '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1976,7 +1969,7 @@ msgstr "bytes > 8 bits no soportados" msgid "bytes value out of range" msgstr "valor de bytes fuera de rango" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "calibration esta fuera de rango" @@ -2008,48 +2001,17 @@ msgstr "no se puede agregar un método a una clase ya subclasificada" msgid "can't assign to expression" msgstr "no se puede asignar a la expresión" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "no se puede convertir %s a complejo" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "no se puede convertir %s a float" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "no se puede convertir %s a int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "no se puede convertir el objeto '%q' a %q implícitamente" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "no se puede convertir Nan a int" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "no se puede convertir address a int" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "no se puede convertir inf en int" - #: py/obj.c -msgid "can't convert to complex" -msgstr "no se puede convertir a complejo" - -#: py/obj.c -msgid "can't convert to float" -msgstr "no se puede convertir a float" - -#: py/obj.c -msgid "can't convert to int" -msgstr "no se puede convertir a int" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2463,7 +2425,7 @@ msgstr "la función requiere del argumento por palabra clave '%q'" msgid "function missing required positional argument #%d" msgstr "la función requiere del argumento posicional #%d" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "la función toma %d argumentos posicionales pero le fueron dados %d" @@ -2512,10 +2474,7 @@ msgstr "relleno (padding) incorrecto" msgid "index is out of bounds" msgstr "el índice está fuera de límites" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "index fuera de rango" @@ -2877,9 +2836,8 @@ msgid "number of points must be at least 2" msgstr "el número de puntos debe ser al menos 2" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "el objeto '%s' no es una tupla o lista" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2914,9 +2872,8 @@ msgid "object not iterable" msgstr "objeto no iterable" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "el objeto de tipo '%s' no tiene len()" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -3008,21 +2965,10 @@ msgstr "el polígono solo se puede registrar en uno de los padres" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "pop de un PulseIn vacío" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "pop desde un set vacío" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "pop desde una lista vacía" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "popitem(): diccionario vacío" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3180,13 +3126,8 @@ msgid "stream operation not supported" msgstr "operación stream no soportada" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "string index fuera de rango" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "índices de string deben ser enteros, no %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3196,10 +3137,6 @@ msgstr "string no soportado; usa bytes o bytearray" msgid "struct: cannot index" msgstr "struct: no se puede indexar" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: index fuera de rango" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct: sin campos" @@ -3270,7 +3207,7 @@ msgstr "demasiados valores para descomprimir (%d esperado)" msgid "trapz is defined for 1D arrays of equal length" msgstr "trapz está definido para arreglos 1D de tamaño igual" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "tuple index fuera de rango" @@ -3337,9 +3274,8 @@ msgid "unknown conversion specifier %c" msgstr "especificador de conversión %c desconocido" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "codigo format desconocido '%c' para el typo de objeto '%s'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3378,16 +3314,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "carácter no soportado '%c' (0x%x) en índice %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "tipo no soportado para %q: '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "tipo de operador no soportado" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "tipos no soportados para %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3466,6 +3402,112 @@ 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 "'%s' object cannot assign attribute '%q'" +#~ msgstr "El objeto '%s' no puede asignar al atributo '%q'" + +#~ msgid "'%s' object does not support '%q'" +#~ msgstr "El objeto '%s' no admite '%q'" + +#~ msgid "'%s' object does not support item assignment" +#~ msgstr "el objeto '%s' no soporta la asignación de elementos" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "objeto '%s' no soporta la eliminación de elementos" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "objeto '%s' no tiene atributo '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "objeto '%s' no es un iterator" + +#~ msgid "'%s' object is not callable" +#~ msgstr "objeto '%s' no puede ser llamado" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "objeto '%s' no es iterable" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "el objeto '%s' no es suscriptable" + +#~ msgid "Pop from an empty Ps2 buffer" +#~ msgstr "Pop de un buffer Ps2 vacio" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Ejecutando en modo seguro! La auto-recarga esta deshabilitada.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "" +#~ "Ejecutando en modo seguro! No se esta ejecutando el código guardado.\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "__init__() deberia devolver None, no '%s'" + +#~ msgid "can't convert %s to complex" +#~ msgstr "no se puede convertir %s a complejo" + +#~ msgid "can't convert %s to float" +#~ msgstr "no se puede convertir %s a float" + +#~ msgid "can't convert %s to int" +#~ msgstr "no se puede convertir %s a int" + +#~ msgid "can't convert NaN to int" +#~ msgstr "no se puede convertir Nan a int" + +#~ msgid "can't convert address to int" +#~ msgstr "no se puede convertir address a int" + +#~ msgid "can't convert inf to int" +#~ msgstr "no se puede convertir inf en int" + +#~ msgid "can't convert to complex" +#~ msgstr "no se puede convertir a complejo" + +#~ msgid "can't convert to float" +#~ msgstr "no se puede convertir a float" + +#~ msgid "can't convert to int" +#~ msgstr "no se puede convertir a int" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "el objeto '%s' no es una tupla o lista" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "el objeto de tipo '%s' no tiene len()" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "pop de un PulseIn vacío" + +#~ msgid "pop from an empty set" +#~ msgstr "pop desde un set vacío" + +#~ msgid "pop from empty list" +#~ msgstr "pop desde una lista vacía" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "popitem(): diccionario vacío" + +#~ msgid "string index out of range" +#~ msgstr "string index fuera de rango" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "índices de string deben ser enteros, no %s" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: index fuera de rango" + +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "codigo format desconocido '%c' para el typo de objeto '%s'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "tipo no soportado para %q: '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "tipos no soportados para %q: '%s', '%s'" + #~ msgid "'%q' object is not bytes-like" #~ msgstr "el objeto '%q' no es similar a bytes" diff --git a/locale/fil.po b/locale/fil.po index ecffec523f..619fefc9e9 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-30 07:23-0500\n" +"POT-Creation-Date: 2020-08-04 18:42-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -64,13 +64,17 @@ msgstr "" msgid "%q in use" msgstr "%q ay ginagamit" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -111,6 +115,42 @@ msgstr "" msgid "'%q' argument required" msgstr "'%q' argument kailangan" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -161,48 +201,6 @@ msgstr "'%s' integer %d ay wala sa sakop ng %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' integer 0x%x ay wala sa mask na sakop ng 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "'%s' object hindi sumusuporta ng item assignment" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "'%s' object ay hindi sumusuporta sa pagtanggal ng item" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "'%s' object ay walang attribute '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "'%s' object ay hindi iterator" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "'%s' object hindi matatawag" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "'%s' object ay hindi ma i-iterable" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "'%s' object ay hindi maaaring i-subscript" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "'=' Gindi pinapayagan ang alignment sa pag specify ng string format" @@ -1250,6 +1248,10 @@ msgstr "Hindi maka connect sa AP" msgid "Not playing" msgstr "Hindi playing" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1338,10 +1340,6 @@ msgstr "Kasama ang kung ano pang modules na sa filesystem\n" msgid "Polygon needs at least 3 points" msgstr "" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1417,12 +1415,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Tumatakbo sa safe mode! Awtomatikong pag re-reload ay OFF.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Tumatakbo sa safe mode! Hindi tumatakbo ang nai-save na code.\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1792,9 +1786,8 @@ msgid "__init__() should return None" msgstr "__init __ () dapat magbalik na None" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "__init__() dapat magbalink na None, hindi '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1948,7 +1941,7 @@ msgstr "hindi sinusuportahan ang bytes > 8 bits" msgid "bytes value out of range" msgstr "bytes value wala sa sakop" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "kalibrasion ay wala sa sakop" @@ -1981,48 +1974,17 @@ msgstr "" msgid "can't assign to expression" msgstr "hindi ma i-assign sa expression" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "hindi ma-convert %s sa complex" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "hindi ma-convert %s sa int" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "hindi ma-convert %s sa int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "hindi maaaring i-convert ang '%q' na bagay sa %q nang walang pahiwatig" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "hindi ma i-convert NaN sa int" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "hindi ma i-convert ang address sa INT" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "hindi ma i-convert inf sa int" - #: py/obj.c -msgid "can't convert to complex" -msgstr "hindi ma-convert sa complex" - -#: py/obj.c -msgid "can't convert to float" -msgstr "hindi ma-convert sa float" - -#: py/obj.c -msgid "can't convert to int" -msgstr "hindi ma-convert sa int" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2439,7 +2401,7 @@ msgstr "function nangangailangan ng keyword argument '%q'" msgid "function missing required positional argument #%d" msgstr "function nangangailangan ng positional argument #%d" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "" @@ -2489,10 +2451,7 @@ msgstr "mali ang padding" msgid "index is out of bounds" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "index wala sa sakop" @@ -2852,9 +2811,8 @@ msgid "number of points must be at least 2" msgstr "" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "object '%s' ay hindi tuple o list" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2889,9 +2847,8 @@ msgid "object not iterable" msgstr "object hindi ma i-iterable" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "object na type '%s' walang len()" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -2985,21 +2942,10 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "pop mula sa walang laman na PulseIn" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "pop sa walang laman na set" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "pop galing sa walang laman na list" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "popitem(): dictionary ay walang laman" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3158,13 +3104,8 @@ msgid "stream operation not supported" msgstr "stream operation hindi sinusuportahan" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "indeks ng string wala sa sakop" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "ang indeks ng string ay dapat na integer, hindi %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3174,10 +3115,6 @@ msgstr "string hindi supportado; gumamit ng bytes o kaya bytearray" msgid "struct: cannot index" msgstr "struct: hindi ma-index" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: index hindi maabot" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct: walang fields" @@ -3248,7 +3185,7 @@ msgstr "masyadong maraming values para i-unpact (umaasa ng %d)" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "indeks ng tuple wala sa sakop" @@ -3315,9 +3252,8 @@ msgid "unknown conversion specifier %c" msgstr "hindi alam ang conversion specifier na %c" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "hindi alam ang format code '%c' para sa object na ang type ay '%s'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3356,16 +3292,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "hindi sinusuportahan ang format character na '%c' (0x%x) sa index %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "hindi sinusuportahang type para sa %q: '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "hindi sinusuportahang type para sa operator" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "hindi sinusuportahang type para sa %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3446,6 +3382,102 @@ 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 "'%s' object does not support item assignment" +#~ msgstr "'%s' object hindi sumusuporta ng item assignment" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "'%s' object ay hindi sumusuporta sa pagtanggal ng item" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "'%s' object ay walang attribute '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "'%s' object ay hindi iterator" + +#~ msgid "'%s' object is not callable" +#~ msgstr "'%s' object hindi matatawag" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "'%s' object ay hindi ma i-iterable" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "'%s' object ay hindi maaaring i-subscript" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Tumatakbo sa safe mode! Awtomatikong pag re-reload ay OFF.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "Tumatakbo sa safe mode! Hindi tumatakbo ang nai-save na code.\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "__init__() dapat magbalink na None, hindi '%s'" + +#~ msgid "can't convert %s to complex" +#~ msgstr "hindi ma-convert %s sa complex" + +#~ msgid "can't convert %s to float" +#~ msgstr "hindi ma-convert %s sa int" + +#~ msgid "can't convert %s to int" +#~ msgstr "hindi ma-convert %s sa int" + +#~ msgid "can't convert NaN to int" +#~ msgstr "hindi ma i-convert NaN sa int" + +#~ msgid "can't convert address to int" +#~ msgstr "hindi ma i-convert ang address sa INT" + +#~ msgid "can't convert inf to int" +#~ msgstr "hindi ma i-convert inf sa int" + +#~ msgid "can't convert to complex" +#~ msgstr "hindi ma-convert sa complex" + +#~ msgid "can't convert to float" +#~ msgstr "hindi ma-convert sa float" + +#~ msgid "can't convert to int" +#~ msgstr "hindi ma-convert sa int" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "object '%s' ay hindi tuple o list" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "object na type '%s' walang len()" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "pop mula sa walang laman na PulseIn" + +#~ msgid "pop from an empty set" +#~ msgstr "pop sa walang laman na set" + +#~ msgid "pop from empty list" +#~ msgstr "pop galing sa walang laman na list" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "popitem(): dictionary ay walang laman" + +#~ msgid "string index out of range" +#~ msgstr "indeks ng string wala sa sakop" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "ang indeks ng string ay dapat na integer, hindi %s" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: index hindi maabot" + +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "hindi alam ang format code '%c' para sa object na ang type ay '%s'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "hindi sinusuportahang type para sa %q: '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "hindi sinusuportahang type para sa %q: '%s', '%s'" + #~ msgid "AP required" #~ msgstr "AP kailangan" diff --git a/locale/fr.po b/locale/fr.po index 40e6bbfcee..08a47bb9bd 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-30 07:23-0500\n" +"POT-Creation-Date: 2020-08-04 18:42-0500\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" "Language: fr\n" @@ -76,13 +76,17 @@ msgstr "" msgid "%q in use" msgstr "%q utilisé" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c msgid "%q index out of range" msgstr "index %q hors gamme" #: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "les indices %q doivent être des entiers, pas %s" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -120,6 +124,42 @@ msgstr "%q() prend %d arguments positionnels mais %d ont été donnés" msgid "'%q' argument required" msgstr "'%q' argument requis" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -170,48 +210,6 @@ msgstr "'%s' l'entier %d n'est pas dans la gamme %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' l'entier 0x%x ne correspond pas au masque 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "L'objet '%s' ne peut pas attribuer '%q'" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "L'objet '%s' ne prend pas en charge '%q'" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "l'objet '%s' ne supporte pas l'assignation d'éléments" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "l'objet '%s' ne supporte pas la suppression d'éléments" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "l'objet '%s' n'a pas d'attribut '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "l'objet '%s' n'est pas un itérateur" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "l'objet '%s' n'est pas appelable" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "l'objet '%s' n'est pas itérable" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "l'objet '%s' n'est pas sous-scriptable" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "'=' alignement non autorisé dans la spéc. de format de chaîne" @@ -1263,6 +1261,10 @@ msgstr "Non connecté" msgid "Not playing" msgstr "Ne joue pas" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1361,10 +1363,6 @@ msgstr "Ainsi que tout autre module présent sur le système de fichiers\n" msgid "Polygon needs at least 3 points" msgstr "Polygone a besoin d’au moins 3 points" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "Pop à partir d'un tampon Ps2 vide" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Le tampon de préfixe doit être sur le tas" @@ -1437,12 +1435,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "L'entrée de ligne 'Row' doit être un digitalio.DigitalInOut" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Mode sans-échec ! Auto-chargement désactivé.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Mode sans-échec ! Le code sauvegardé n'est pas éxecuté.\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1828,9 +1822,8 @@ msgid "__init__() should return None" msgstr "__init__() doit retourner None" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "__init__() doit retourner None, pas '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1983,7 +1976,7 @@ msgstr "octets > 8 bits non supporté" msgid "bytes value out of range" msgstr "valeur des octets hors bornes" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "étalonnage hors bornes" @@ -2016,48 +2009,17 @@ msgstr "" msgid "can't assign to expression" msgstr "ne peut pas assigner à une expression" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "ne peut convertir %s en nombre complexe" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "ne peut convertir %s en nombre à virgule flottante 'float'" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "ne peut convertir %s en entier 'int'" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "impossible de convertir l'objet '%q' en '%q' implicitement" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "on ne peut convertir NaN en entier 'int'" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "ne peut convertir l'adresse en entier 'int'" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "on ne peut convertir l'infini 'inf' en entier 'int'" - #: py/obj.c -msgid "can't convert to complex" -msgstr "ne peut convertir en nombre complexe" - -#: py/obj.c -msgid "can't convert to float" -msgstr "ne peut convertir en nombre à virgule flottante 'float'" - -#: py/obj.c -msgid "can't convert to int" -msgstr "ne peut convertir en entier 'int'" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2480,7 +2442,7 @@ msgstr "il manque l'argument nommé obligatoire '%q'" msgid "function missing required positional argument #%d" msgstr "il manque l'argument positionnel obligatoire #%d" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "la fonction prend %d argument(s) positionnels mais %d ont été donné(s)" @@ -2529,10 +2491,7 @@ msgstr "espacement incorrect" msgid "index is out of bounds" msgstr "l'index est hors limites" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "index hors gamme" @@ -2895,9 +2854,8 @@ msgid "number of points must be at least 2" msgstr "le nombre de points doit être d'au moins 2" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "l'objet '%s' n'est pas un tuple ou une liste" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2932,9 +2890,8 @@ msgid "object not iterable" msgstr "objet non itérable" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "l'objet de type '%s' n'a pas de len()" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -3029,21 +2986,10 @@ msgstr "le polygone ne peut être enregistré que dans un parent" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "'pop' d'une entrée PulseIn vide" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "'pop' d'un ensemble set vide" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "'pop' d'une liste vide" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "popitem() : dictionnaire vide" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3201,13 +3147,8 @@ msgid "stream operation not supported" msgstr "opération de flux non supportée" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "index de chaîne hors gamme" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "les indices de chaîne de caractères doivent être des entiers, pas %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3218,10 +3159,6 @@ msgstr "" msgid "struct: cannot index" msgstr "struct : indexage impossible" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct : index hors limites" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct : aucun champs" @@ -3291,7 +3228,7 @@ msgstr "trop de valeur à dégrouper (%d attendues)" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "index du tuple hors gamme" @@ -3358,9 +3295,8 @@ msgid "unknown conversion specifier %c" msgstr "spécification %c de conversion inconnue" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "code de format '%c' inconnu pour un objet de type '%s'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3399,16 +3335,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "caractère de format '%c' (0x%x) non supporté à l'index %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "type non supporté pour %q : '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "type non supporté pour l'opérateur" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "type non supporté pour %q : '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3487,6 +3423,112 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "les indices %q doivent être des entiers, pas %s" + +#~ msgid "'%s' object cannot assign attribute '%q'" +#~ msgstr "L'objet '%s' ne peut pas attribuer '%q'" + +#~ msgid "'%s' object does not support '%q'" +#~ msgstr "L'objet '%s' ne prend pas en charge '%q'" + +#~ msgid "'%s' object does not support item assignment" +#~ msgstr "l'objet '%s' ne supporte pas l'assignation d'éléments" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "l'objet '%s' ne supporte pas la suppression d'éléments" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "l'objet '%s' n'a pas d'attribut '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "l'objet '%s' n'est pas un itérateur" + +#~ msgid "'%s' object is not callable" +#~ msgstr "l'objet '%s' n'est pas appelable" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "l'objet '%s' n'est pas itérable" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "l'objet '%s' n'est pas sous-scriptable" + +#~ msgid "Pop from an empty Ps2 buffer" +#~ msgstr "Pop à partir d'un tampon Ps2 vide" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Mode sans-échec ! Auto-chargement désactivé.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "Mode sans-échec ! Le code sauvegardé n'est pas éxecuté.\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "__init__() doit retourner None, pas '%s'" + +#~ msgid "can't convert %s to complex" +#~ msgstr "ne peut convertir %s en nombre complexe" + +#~ msgid "can't convert %s to float" +#~ msgstr "ne peut convertir %s en nombre à virgule flottante 'float'" + +#~ msgid "can't convert %s to int" +#~ msgstr "ne peut convertir %s en entier 'int'" + +#~ msgid "can't convert NaN to int" +#~ msgstr "on ne peut convertir NaN en entier 'int'" + +#~ msgid "can't convert address to int" +#~ msgstr "ne peut convertir l'adresse en entier 'int'" + +#~ msgid "can't convert inf to int" +#~ msgstr "on ne peut convertir l'infini 'inf' en entier 'int'" + +#~ msgid "can't convert to complex" +#~ msgstr "ne peut convertir en nombre complexe" + +#~ msgid "can't convert to float" +#~ msgstr "ne peut convertir en nombre à virgule flottante 'float'" + +#~ msgid "can't convert to int" +#~ msgstr "ne peut convertir en entier 'int'" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "l'objet '%s' n'est pas un tuple ou une liste" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "l'objet de type '%s' n'a pas de len()" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "'pop' d'une entrée PulseIn vide" + +#~ msgid "pop from an empty set" +#~ msgstr "'pop' d'un ensemble set vide" + +#~ msgid "pop from empty list" +#~ msgstr "'pop' d'une liste vide" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "popitem() : dictionnaire vide" + +#~ msgid "string index out of range" +#~ msgstr "index de chaîne hors gamme" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "" +#~ "les indices de chaîne de caractères doivent être des entiers, pas %s" + +#~ msgid "struct: index out of range" +#~ msgstr "struct : index hors limites" + +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "code de format '%c' inconnu pour un objet de type '%s'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "type non supporté pour %q : '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "type non supporté pour %q : '%s', '%s'" + #~ msgid "'async for' or 'async with' outside async function" #~ msgstr "'async for' ou 'async with' sans fonction asynchrone extérieure" diff --git a/locale/hi.po b/locale/hi.po index 003f9a9ec6..956248fd31 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-30 07:23-0500\n" +"POT-Creation-Date: 2020-08-04 18:42-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -65,12 +65,16 @@ msgstr "" msgid "%q in use" msgstr "" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c msgid "%q index out of range" msgstr "" #: py/obj.c -msgid "%q indices must be integers, not %s" +msgid "%q indices must be integers, not %q" msgstr "" #: shared-bindings/vectorio/Polygon.c @@ -109,6 +113,42 @@ msgstr "" msgid "'%q' argument required" msgstr "" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -159,48 +199,6 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "" @@ -1234,6 +1232,10 @@ msgstr "" msgid "Not playing" msgstr "" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1319,10 +1321,6 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1395,11 +1393,7 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" +msgid "Running in safe mode! " msgstr "" #: shared-module/sdcardio/SDCard.c @@ -1760,8 +1754,7 @@ msgid "__init__() should return None" msgstr "" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" +msgid "__init__() should return None, not '%q'" msgstr "" #: py/objobject.c @@ -1915,7 +1908,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "" @@ -1947,47 +1940,16 @@ msgstr "" msgid "can't assign to expression" msgstr "" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "" - #: py/obj.c -msgid "can't convert to complex" -msgstr "" - -#: py/obj.c -msgid "can't convert to float" -msgstr "" - -#: py/obj.c -msgid "can't convert to int" +msgid "can't convert to %q" msgstr "" #: py/objstr.c @@ -2395,7 +2357,7 @@ msgstr "" msgid "function missing required positional argument #%d" msgstr "" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "" @@ -2444,10 +2406,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "" @@ -2803,8 +2762,7 @@ msgid "number of points must be at least 2" msgstr "" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" +msgid "object '%q' is not a tuple or list" msgstr "" #: py/obj.c @@ -2840,8 +2798,7 @@ msgid "object not iterable" msgstr "" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" +msgid "object of type '%q' has no len()" msgstr "" #: py/obj.c @@ -2934,20 +2891,9 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" msgstr "" #: py/objint_mpz.c @@ -3104,12 +3050,7 @@ msgid "stream operation not supported" msgstr "" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" +msgid "string indices must be integers, not %q" msgstr "" #: py/stream.c @@ -3120,10 +3061,6 @@ msgstr "" msgid "struct: cannot index" msgstr "" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "" @@ -3193,7 +3130,7 @@ msgstr "" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "" @@ -3260,8 +3197,7 @@ msgid "unknown conversion specifier %c" msgstr "" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" +msgid "unknown format code '%c' for object of type '%q'" msgstr "" #: py/compile.c @@ -3301,7 +3237,7 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "" #: py/runtime.c -msgid "unsupported type for %q: '%s'" +msgid "unsupported type for %q: '%q'" msgstr "" #: py/runtime.c @@ -3309,7 +3245,7 @@ msgid "unsupported type for operator" msgstr "" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" msgstr "" #: py/objint.c diff --git a/locale/it_IT.po b/locale/it_IT.po index c0f826e8f1..8f6c006aa6 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-30 07:23-0500\n" +"POT-Creation-Date: 2020-08-04 18:42-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -64,13 +64,17 @@ msgstr "" msgid "%q in use" msgstr "%q in uso" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -110,6 +114,42 @@ msgstr "%q() prende %d argomenti posizionali ma ne sono stati forniti %d" msgid "'%q' argument required" msgstr "'%q' argomento richiesto" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -160,48 +200,6 @@ msgstr "intero '%s' non è nell'intervallo %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "intero '%s' non è nell'intervallo %d..%d" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "oggeto '%s' non supporta assengnamento di item" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "oggeto '%s' non supporta eliminamento di item" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "l'oggetto '%s' non ha l'attributo '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "l'oggetto '%s' non è un iteratore" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "oggeto '%s' non è chiamabile" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "l'oggetto '%s' non è iterabile" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "oggeto '%s' non è " - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "aligniamento '=' non è permesso per il specificatore formato string" @@ -1254,6 +1252,10 @@ msgstr "Impossible connettersi all'AP" msgid "Not playing" msgstr "In pausa" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1348,10 +1350,6 @@ msgstr "Imposssibile rimontare il filesystem" msgid "Polygon needs at least 3 points" msgstr "" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1426,12 +1424,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Modalità sicura in esecuzione! Auto-reload disattivato.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Modalità sicura in esecuzione! Codice salvato non in esecuzione.\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1795,9 +1789,8 @@ msgid "__init__() should return None" msgstr "__init__() deve ritornare None" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "__init__() deve ritornare None, non '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1953,7 +1946,7 @@ msgstr "byte > 8 bit non supportati" msgid "bytes value out of range" msgstr "valore byte fuori intervallo" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "la calibrazione è fuori intervallo" @@ -1986,48 +1979,17 @@ msgstr "" msgid "can't assign to expression" msgstr "impossibile assegnare all'espressione" -#: py/obj.c -#, fuzzy, c-format -msgid "can't convert %s to complex" -msgstr "non è possibile convertire a complex" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "non è possibile convertire %s a float" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "non è possibile convertire %s a int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "impossibile convertire l'oggetto '%q' implicitamente in %q" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "impossibile convertire NaN in int" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "impossible convertire indirizzo in int" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "impossibile convertire inf in int" - #: py/obj.c -msgid "can't convert to complex" -msgstr "non è possibile convertire a complex" - -#: py/obj.c -msgid "can't convert to float" -msgstr "non è possibile convertire a float" - -#: py/obj.c -msgid "can't convert to int" -msgstr "non è possibile convertire a int" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2440,7 +2402,7 @@ msgstr "argomento nominato '%q' mancante alla funzione" msgid "function missing required positional argument #%d" msgstr "mancante il #%d argomento posizonale obbligatorio della funzione" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "" @@ -2490,10 +2452,7 @@ msgstr "padding incorretto" msgid "index is out of bounds" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "indice fuori intervallo" @@ -2857,9 +2816,8 @@ msgid "number of points must be at least 2" msgstr "" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "oggetto '%s' non è una tupla o una lista" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2894,9 +2852,8 @@ msgid "object not iterable" msgstr "oggetto non iterabile" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "l'oggetto di tipo '%s' non implementa len()" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -2992,21 +2949,10 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "pop sun un PulseIn vuoto" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "pop da un set vuoto" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "pop da una lista vuota" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "popitem(): il dizionario è vuoto" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3165,13 +3111,8 @@ msgid "stream operation not supported" msgstr "operazione di stream non supportata" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "indice della stringa fuori intervallo" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "indici della stringa devono essere interi, non %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3181,10 +3122,6 @@ msgstr "" msgid "struct: cannot index" msgstr "struct: impossibile indicizzare" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: indice fuori intervallo" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct: nessun campo" @@ -3255,7 +3192,7 @@ msgstr "troppi valori da scompattare (%d attesi)" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "indice della tupla fuori intervallo" @@ -3322,9 +3259,8 @@ msgid "unknown conversion specifier %c" msgstr "specificatore di conversione %s sconosciuto" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "codice di formattaione '%c' sconosciuto per oggetto di tipo '%s'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3363,16 +3299,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "carattere di formattazione '%c' (0x%x) non supportato all indice %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "tipo non supportato per %q: '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "tipo non supportato per l'operando" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "tipi non supportati per %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3453,6 +3389,103 @@ 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 "'%s' object does not support item assignment" +#~ msgstr "oggeto '%s' non supporta assengnamento di item" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "oggeto '%s' non supporta eliminamento di item" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "l'oggetto '%s' non ha l'attributo '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "l'oggetto '%s' non è un iteratore" + +#~ msgid "'%s' object is not callable" +#~ msgstr "oggeto '%s' non è chiamabile" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "l'oggetto '%s' non è iterabile" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "oggeto '%s' non è " + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Modalità sicura in esecuzione! Auto-reload disattivato.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "Modalità sicura in esecuzione! Codice salvato non in esecuzione.\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "__init__() deve ritornare None, non '%s'" + +#, fuzzy +#~ msgid "can't convert %s to complex" +#~ msgstr "non è possibile convertire a complex" + +#~ msgid "can't convert %s to float" +#~ msgstr "non è possibile convertire %s a float" + +#~ msgid "can't convert %s to int" +#~ msgstr "non è possibile convertire %s a int" + +#~ msgid "can't convert NaN to int" +#~ msgstr "impossibile convertire NaN in int" + +#~ msgid "can't convert address to int" +#~ msgstr "impossible convertire indirizzo in int" + +#~ msgid "can't convert inf to int" +#~ msgstr "impossibile convertire inf in int" + +#~ msgid "can't convert to complex" +#~ msgstr "non è possibile convertire a complex" + +#~ msgid "can't convert to float" +#~ msgstr "non è possibile convertire a float" + +#~ msgid "can't convert to int" +#~ msgstr "non è possibile convertire a int" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "oggetto '%s' non è una tupla o una lista" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "l'oggetto di tipo '%s' non implementa len()" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "pop sun un PulseIn vuoto" + +#~ msgid "pop from an empty set" +#~ msgstr "pop da un set vuoto" + +#~ msgid "pop from empty list" +#~ msgstr "pop da una lista vuota" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "popitem(): il dizionario è vuoto" + +#~ msgid "string index out of range" +#~ msgstr "indice della stringa fuori intervallo" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "indici della stringa devono essere interi, non %s" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: indice fuori intervallo" + +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "codice di formattaione '%c' sconosciuto per oggetto di tipo '%s'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "tipo non supportato per %q: '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "tipi non supportati per %q: '%s', '%s'" + #~ msgid "AP required" #~ msgstr "AP richiesto" diff --git a/locale/ko.po b/locale/ko.po index 0d5e53ba0e..6884b97fd5 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-30 07:23-0500\n" +"POT-Creation-Date: 2020-08-04 18:42-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -66,13 +66,17 @@ msgstr "" msgid "%q in use" msgstr "%q 사용 중입니다" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c msgid "%q index out of range" msgstr "%q 인덱스 범위를 벗어났습니다" #: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "%q 인덱스는 %s 가 아닌 정수 여야합니다" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -110,6 +114,42 @@ msgstr "" msgid "'%q' argument required" msgstr "" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -160,48 +200,6 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "'%s' 을 지정할 수 없습니다" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "'%s' 은 삭제할 수 없습니다" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "'%s' 은 수정할 수 없습니다" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "'%s' 을 검색 할 수 없습니다" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "'%s' 은 변경할 수 없습니다" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "" @@ -1237,6 +1235,10 @@ msgstr "" msgid "Not playing" msgstr "" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1322,10 +1324,6 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1398,11 +1396,7 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" +msgid "Running in safe mode! " msgstr "" #: shared-module/sdcardio/SDCard.c @@ -1764,8 +1758,7 @@ msgid "__init__() should return None" msgstr "" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" +msgid "__init__() should return None, not '%q'" msgstr "" #: py/objobject.c @@ -1919,7 +1912,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "" @@ -1951,47 +1944,16 @@ msgstr "" msgid "can't assign to expression" msgstr "" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "" - #: py/obj.c -msgid "can't convert to complex" -msgstr "" - -#: py/obj.c -msgid "can't convert to float" -msgstr "" - -#: py/obj.c -msgid "can't convert to int" +msgid "can't convert to %q" msgstr "" #: py/objstr.c @@ -2399,7 +2361,7 @@ msgstr "" msgid "function missing required positional argument #%d" msgstr "" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "" @@ -2448,10 +2410,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "" @@ -2807,8 +2766,7 @@ msgid "number of points must be at least 2" msgstr "" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" +msgid "object '%q' is not a tuple or list" msgstr "" #: py/obj.c @@ -2844,8 +2802,7 @@ msgid "object not iterable" msgstr "" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" +msgid "object of type '%q' has no len()" msgstr "" #: py/obj.c @@ -2938,20 +2895,9 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" msgstr "" #: py/objint_mpz.c @@ -3108,12 +3054,7 @@ msgid "stream operation not supported" msgstr "" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" +msgid "string indices must be integers, not %q" msgstr "" #: py/stream.c @@ -3124,10 +3065,6 @@ msgstr "" msgid "struct: cannot index" msgstr "" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "" @@ -3197,7 +3134,7 @@ msgstr "" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "" @@ -3264,8 +3201,7 @@ msgid "unknown conversion specifier %c" msgstr "" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" +msgid "unknown format code '%c' for object of type '%q'" msgstr "" #: py/compile.c @@ -3305,7 +3241,7 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "" #: py/runtime.c -msgid "unsupported type for %q: '%s'" +msgid "unsupported type for %q: '%q'" msgstr "" #: py/runtime.c @@ -3313,7 +3249,7 @@ msgid "unsupported type for operator" msgstr "" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" msgstr "" #: py/objint.c @@ -3393,6 +3329,24 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "%q 인덱스는 %s 가 아닌 정수 여야합니다" + +#~ msgid "'%s' object does not support item assignment" +#~ msgstr "'%s' 을 지정할 수 없습니다" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "'%s' 은 삭제할 수 없습니다" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "'%s' 은 수정할 수 없습니다" + +#~ msgid "'%s' object is not callable" +#~ msgstr "'%s' 을 검색 할 수 없습니다" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "'%s' 은 변경할 수 없습니다" + #~ msgid "Can't add services in Central mode" #~ msgstr "센트랄(중앙) 모드에서는 서비스를 추가 할 수 없습니다" diff --git a/locale/nl.po b/locale/nl.po index 33cb3702de..f9f0ddf893 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-30 07:23-0500\n" +"POT-Creation-Date: 2020-08-04 18:42-0500\n" "PO-Revision-Date: 2020-08-02 20:41+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -72,13 +72,17 @@ msgstr "%q fout: %d" msgid "%q in use" msgstr "%q in gebruik" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -116,6 +120,42 @@ msgstr "%q() verwacht %d positionele argumenten maar kreeg %d" msgid "'%q' argument required" msgstr "'%q' argument vereist" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -166,48 +206,6 @@ msgstr "'%s' integer %d is niet in bereik %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' integer 0x%x past niet in mask 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "'%s' object kan niet aan attribuut '%q' toewijzen" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "'%s' object ondersteunt '%q' niet" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "'%s' object ondersteunt item toewijzing niet" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "'%s' object ondersteunt item verwijdering niet" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "'%s' object heeft geen attribuut '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "'%s' object is geen iterator" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "'%s' object is niet aanroepbaar" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "'%s' object is niet itereerbaar" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "'%s' object is niet onderschrijfbaar" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "'=' uitlijning niet toegestaan in string format specifier" @@ -1253,6 +1251,10 @@ msgstr "Niet verbonden" msgid "Not playing" msgstr "Wordt niet afgespeeld" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1350,10 +1352,6 @@ msgstr "En iedere module in het bestandssysteem\n" msgid "Polygon needs at least 3 points" msgstr "Polygon heeft op zijn minst 3 punten nodig" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "Pop van een lege Ps2 buffer" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Prefix buffer moet op de heap zijn" @@ -1428,12 +1426,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "Rij invoeging moet digitalio.DigitalInOut zijn" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Draaiende in veilige modus! Auto-herlaad is uit.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Draaiende in veilige modus! Opgeslagen code wordt niet uitgevoerd.\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1814,9 +1808,8 @@ msgid "__init__() should return None" msgstr "__init __ () zou None moeten retourneren" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "__init __ () zou None moeten retouneren, niet '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1969,7 +1962,7 @@ msgstr "butes > 8 niet ondersteund" msgid "bytes value out of range" msgstr "bytes waarde buiten bereik" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "calibration is buiten bereik" @@ -2002,48 +1995,17 @@ msgstr "" msgid "can't assign to expression" msgstr "kan niet toewijzen aan expressie" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "kan %s niet converteren naar een complex" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "kan %s niet omzetten naar een float" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "kan %s niet omzetten naar een int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "kan '%q' object niet omzetten naar %q impliciet" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "kan NaN niet omzetten naar int" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "kan adres niet omzetten naar int" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "kan inf niet omzetten naar int" - #: py/obj.c -msgid "can't convert to complex" -msgstr "kan niet omzetten naar complex" - -#: py/obj.c -msgid "can't convert to float" -msgstr "kan niet omzetten naar float" - -#: py/obj.c -msgid "can't convert to int" -msgstr "kan niet omzetten naar int" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2453,7 +2415,7 @@ msgstr "functie mist vereist sleutelwoord argument \"%q" msgid "function missing required positional argument #%d" msgstr "functie mist vereist positie-argument #%d" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "" @@ -2503,10 +2465,7 @@ msgstr "vulling (padding) is onjuist" msgid "index is out of bounds" msgstr "index is buiten bereik" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "index is buiten bereik" @@ -2865,9 +2824,8 @@ msgid "number of points must be at least 2" msgstr "aantal punten moet minimaal 2 zijn" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "object '%s' is geen tuple of lijst" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2902,9 +2860,8 @@ msgid "object not iterable" msgstr "object niet itereerbaar" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "object van type '%s' heeft geen len()" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -2997,21 +2954,10 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "pop van een lege PulseIn" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "pop van een lege set" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "pop van een lege lijst" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "popitem(): dictionary is leeg" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3169,13 +3115,8 @@ msgid "stream operation not supported" msgstr "stream operatie niet ondersteund" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "string index buiten bereik" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "string indices moeten integer zijn, niet %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3185,10 +3126,6 @@ msgstr "string niet ondersteund; gebruik bytes of bytearray" msgid "struct: cannot index" msgstr "struct: kan niet indexeren" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: index buiten bereik" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct: geen velden" @@ -3258,7 +3195,7 @@ msgstr "te veel waarden om uit te pakken (%d verwacht)" msgid "trapz is defined for 1D arrays of equal length" msgstr "trapz is gedefinieerd voor eendimensionale arrays van gelijke lengte" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "tuple index buiten bereik" @@ -3325,9 +3262,8 @@ msgid "unknown conversion specifier %c" msgstr "onbekende conversiespecificatie %c" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "onbekende formaatcode '%c' voor object van type '%s'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3366,16 +3302,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "niet ondersteund formaatkarakter '%c' (0x%x) op index %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "niet ondersteund type voor %q: '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "niet ondersteund type voor operator" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "niet ondersteunde types voor %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3454,6 +3390,112 @@ 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 "'%s' object cannot assign attribute '%q'" +#~ msgstr "'%s' object kan niet aan attribuut '%q' toewijzen" + +#~ msgid "'%s' object does not support '%q'" +#~ msgstr "'%s' object ondersteunt '%q' niet" + +#~ msgid "'%s' object does not support item assignment" +#~ msgstr "'%s' object ondersteunt item toewijzing niet" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "'%s' object ondersteunt item verwijdering niet" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "'%s' object heeft geen attribuut '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "'%s' object is geen iterator" + +#~ msgid "'%s' object is not callable" +#~ msgstr "'%s' object is niet aanroepbaar" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "'%s' object is niet itereerbaar" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "'%s' object is niet onderschrijfbaar" + +#~ msgid "Pop from an empty Ps2 buffer" +#~ msgstr "Pop van een lege Ps2 buffer" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Draaiende in veilige modus! Auto-herlaad is uit.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "" +#~ "Draaiende in veilige modus! Opgeslagen code wordt niet uitgevoerd.\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "__init __ () zou None moeten retouneren, niet '%s'" + +#~ msgid "can't convert %s to complex" +#~ msgstr "kan %s niet converteren naar een complex" + +#~ msgid "can't convert %s to float" +#~ msgstr "kan %s niet omzetten naar een float" + +#~ msgid "can't convert %s to int" +#~ msgstr "kan %s niet omzetten naar een int" + +#~ msgid "can't convert NaN to int" +#~ msgstr "kan NaN niet omzetten naar int" + +#~ msgid "can't convert address to int" +#~ msgstr "kan adres niet omzetten naar int" + +#~ msgid "can't convert inf to int" +#~ msgstr "kan inf niet omzetten naar int" + +#~ msgid "can't convert to complex" +#~ msgstr "kan niet omzetten naar complex" + +#~ msgid "can't convert to float" +#~ msgstr "kan niet omzetten naar float" + +#~ msgid "can't convert to int" +#~ msgstr "kan niet omzetten naar int" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "object '%s' is geen tuple of lijst" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "object van type '%s' heeft geen len()" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "pop van een lege PulseIn" + +#~ msgid "pop from an empty set" +#~ msgstr "pop van een lege set" + +#~ msgid "pop from empty list" +#~ msgstr "pop van een lege lijst" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "popitem(): dictionary is leeg" + +#~ msgid "string index out of range" +#~ msgstr "string index buiten bereik" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "string indices moeten integer zijn, niet %s" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: index buiten bereik" + +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "onbekende formaatcode '%c' voor object van type '%s'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "niet ondersteund type voor %q: '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "niet ondersteunde types voor %q: '%s', '%s'" + #~ msgid "'async for' or 'async with' outside async function" #~ msgstr "'async for' of 'async with' buiten async functie" diff --git a/locale/pl.po b/locale/pl.po index 09571db1eb..325de7b87c 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-30 07:23-0500\n" +"POT-Creation-Date: 2020-08-04 18:42-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -66,13 +66,17 @@ msgstr "" msgid "%q in use" msgstr "%q w użyciu" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -110,6 +114,42 @@ msgstr "%q() bierze %d argumentów pozycyjnych, lecz podano %d" msgid "'%q' argument required" msgstr "'%q' wymaga argumentu" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -160,48 +200,6 @@ msgstr "'%s' liczba %d poza zakresem %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' liczba 0x%x nie pasuje do maski 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "'%s' obiekt nie wspiera przypisania do elementów" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "'%s' obiekt nie wspiera usuwania elementów" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "'%s' obiekt nie ma atrybutu '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "'%s' obiekt nie jest iteratorem" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "'%s' nie można wywoływać obiektu" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "'%s' nie można iterować po obiekcie" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "'%s' nie można indeksować obiektu" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "wyrównanie '=' niedozwolone w specyfikacji formatu" @@ -1239,6 +1237,10 @@ msgstr "Nie podłączono" msgid "Not playing" msgstr "Nic nie jest odtwarzane" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1324,10 +1326,6 @@ msgstr "Oraz moduły w systemie plików\n" msgid "Polygon needs at least 3 points" msgstr "" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1400,12 +1398,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "Rzędy muszą być digitalio.DigitalInOut" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Uruchomiony tryb bezpieczeństwa! Samo-przeładowanie wyłączone.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Uruchomiony tryb bezpieczeństwa! Zapisany kod nie jest uruchamiany.\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1768,9 +1762,8 @@ msgid "__init__() should return None" msgstr "__init__() powinien zwracać None" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "__init__() powinien zwracać None, nie '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1923,7 +1916,7 @@ msgstr "bajty większe od 8 bitów są niewspierane" msgid "bytes value out of range" msgstr "wartość bytes poza zakresem" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "kalibracja poza zakresem" @@ -1955,48 +1948,17 @@ msgstr "nie można dodać specjalnej metody do podklasy" msgid "can't assign to expression" msgstr "przypisanie do wyrażenia" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "nie można skonwertować %s do complex" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "nie można skonwertować %s do float" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "nie można skonwertować %s do int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "nie można automatycznie skonwertować '%q' do '%q'" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "nie można skonwertować NaN do int" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "nie można skonwertować adresu do int" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "nie można skonwertować inf do int" - #: py/obj.c -msgid "can't convert to complex" -msgstr "nie można skonwertować do complex" - -#: py/obj.c -msgid "can't convert to float" -msgstr "nie można skonwertować do float" - -#: py/obj.c -msgid "can't convert to int" -msgstr "nie można skonwertować do int" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2404,7 +2366,7 @@ msgstr "brak wymaganego argumentu nazwanego '%q' funkcji" msgid "function missing required positional argument #%d" msgstr "brak wymaganego argumentu pozycyjnego #%d funkcji" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "funkcja wymaga %d argumentów pozycyjnych, ale jest %d" @@ -2453,10 +2415,7 @@ msgstr "złe wypełnienie" msgid "index is out of bounds" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "indeks poza zakresem" @@ -2812,9 +2771,8 @@ msgid "number of points must be at least 2" msgstr "" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "obiekt '%s' nie jest krotką ani listą" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2849,9 +2807,8 @@ msgid "object not iterable" msgstr "obiekt nie jest iterowalny" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "obiekt typu '%s' nie ma len()" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -2944,21 +2901,10 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "pop z pustego PulseIn" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "pop z pustego zbioru" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "pop z pustej listy" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "popitem(): słownik jest pusty" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3115,13 +3061,8 @@ msgid "stream operation not supported" msgstr "operacja na strumieniu nieobsługiwana" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "indeks łańcucha poza zakresem" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "indeksy łańcucha muszą być całkowite, nie %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3131,10 +3072,6 @@ msgstr "łańcuchy nieobsługiwane; użyj bytes lub bytearray" msgid "struct: cannot index" msgstr "struct: nie można indeksować" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: indeks poza zakresem" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct: brak pól" @@ -3204,7 +3141,7 @@ msgstr "zbyt wiele wartości do rozpakowania (oczekiwano %d)" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "indeks krotki poza zakresem" @@ -3271,9 +3208,8 @@ msgid "unknown conversion specifier %c" msgstr "zła specyfikacja konwersji %c" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "zły kod formatowania '%c' dla obiektu typu '%s'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3312,16 +3248,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "zły znak formatowania '%c' (0x%x) na pozycji %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "zły typ dla %q: '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "zły typ dla operatora" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "złe typy dla %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3400,6 +3336,103 @@ 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 "'%s' object does not support item assignment" +#~ msgstr "'%s' obiekt nie wspiera przypisania do elementów" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "'%s' obiekt nie wspiera usuwania elementów" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "'%s' obiekt nie ma atrybutu '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "'%s' obiekt nie jest iteratorem" + +#~ msgid "'%s' object is not callable" +#~ msgstr "'%s' nie można wywoływać obiektu" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "'%s' nie można iterować po obiekcie" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "'%s' nie można indeksować obiektu" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Uruchomiony tryb bezpieczeństwa! Samo-przeładowanie wyłączone.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "" +#~ "Uruchomiony tryb bezpieczeństwa! Zapisany kod nie jest uruchamiany.\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "__init__() powinien zwracać None, nie '%s'" + +#~ msgid "can't convert %s to complex" +#~ msgstr "nie można skonwertować %s do complex" + +#~ msgid "can't convert %s to float" +#~ msgstr "nie można skonwertować %s do float" + +#~ msgid "can't convert %s to int" +#~ msgstr "nie można skonwertować %s do int" + +#~ msgid "can't convert NaN to int" +#~ msgstr "nie można skonwertować NaN do int" + +#~ msgid "can't convert address to int" +#~ msgstr "nie można skonwertować adresu do int" + +#~ msgid "can't convert inf to int" +#~ msgstr "nie można skonwertować inf do int" + +#~ msgid "can't convert to complex" +#~ msgstr "nie można skonwertować do complex" + +#~ msgid "can't convert to float" +#~ msgstr "nie można skonwertować do float" + +#~ msgid "can't convert to int" +#~ msgstr "nie można skonwertować do int" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "obiekt '%s' nie jest krotką ani listą" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "obiekt typu '%s' nie ma len()" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "pop z pustego PulseIn" + +#~ msgid "pop from an empty set" +#~ msgstr "pop z pustego zbioru" + +#~ msgid "pop from empty list" +#~ msgstr "pop z pustej listy" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "popitem(): słownik jest pusty" + +#~ msgid "string index out of range" +#~ msgstr "indeks łańcucha poza zakresem" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "indeksy łańcucha muszą być całkowite, nie %s" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: indeks poza zakresem" + +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "zły kod formatowania '%c' dla obiektu typu '%s'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "zły typ dla %q: '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "złe typy dla %q: '%s', '%s'" + #~ msgid "Address is not %d bytes long or is in wrong format" #~ msgstr "Adres nie ma długości %d bajtów lub zły format" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 3cae15510e..976bab0ca5 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-30 07:23-0500\n" +"POT-Creation-Date: 2020-08-04 18:42-0500\n" "PO-Revision-Date: 2020-07-31 14:41+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -72,13 +72,17 @@ msgstr "%q falha: %d" msgid "%q in use" msgstr "%q em uso" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -116,6 +120,42 @@ msgstr "%q() recebe %d argumentos posicionais, porém %d foram informados" msgid "'%q' argument required" msgstr "'%q' argumento(s) requerido(s)" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -166,48 +206,6 @@ msgstr "O número inteiro '%s' %d não está dentro do intervalo %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "O número inteiro '%s' 0x%x não cabe na máscara 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "O objeto '%s' não pode definir o atributo '%q'" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "O objeto '%s' não é compatível com '%q'" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "O objeto '%s' não compatível com a atribuição dos itens" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "O objeto '%s' não é compatível com exclusão do item" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "O objeto '%s' não possui o atributo '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "O objeto '%s' não é um iterador" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "O objeto '%s' não é invocável" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "O objeto '%s' não é iterável" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "O objeto '%s' não é subroteirizável" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "" @@ -1262,6 +1260,10 @@ msgstr "Não Conectado" msgid "Not playing" msgstr "Não está jogando" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1359,10 +1361,6 @@ msgstr "Além de quaisquer módulos no sistema de arquivos\n" msgid "Polygon needs at least 3 points" msgstr "O Polígono precisa de pelo menos 3 pontos" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "Buffer Ps2 vazio" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1438,12 +1436,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "A entrada da linha deve ser digitalio.DigitalInOut" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Rodando em modo seguro! Atualização automática está desligada.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Rodando em modo seguro! Não está executando o código salvo.\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1829,9 +1823,8 @@ msgid "__init__() should return None" msgstr "O __init__() deve retornar Nenhum" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "O __init__() deve retornar Nenhum, não '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1984,7 +1977,7 @@ msgstr "bytes > 8 bits não suportado" msgid "bytes value out of range" msgstr "o valor dos bytes estão fora do alcance" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "Calibração está fora do intervalo" @@ -2016,48 +2009,17 @@ msgstr "não é possível adicionar o método especial à classe já subclassifi msgid "can't assign to expression" msgstr "a expressão não pode ser atribuída" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "Não é possível converter %s para complex" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "Não é possível converter %s para float" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "Não é possível converter %s para int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "não é possível converter implicitamente o objeto '%q' para %q" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "Não é possível converter NaN para int" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "não é possível converter o endereço para int" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "não é possível converter inf para int" - #: py/obj.c -msgid "can't convert to complex" -msgstr "não é possível converter para complex" - -#: py/obj.c -msgid "can't convert to float" -msgstr "não é possível converter para float" - -#: py/obj.c -msgid "can't convert to int" -msgstr "não é possível converter para int" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2474,7 +2436,7 @@ msgstr "falta apenas a palavra chave do argumento '%q' da função" msgid "function missing required positional argument #%d" msgstr "falta o argumento #%d da posição necessária da função" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "função leva %d argumentos posicionais, mas apenas %d foram passadas" @@ -2523,10 +2485,7 @@ msgstr "preenchimento incorreto" msgid "index is out of bounds" msgstr "o índice está fora dos limites" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "Índice fora do intervalo" @@ -2887,9 +2846,8 @@ msgid "number of points must be at least 2" msgstr "a quantidade dos pontos deve ser pelo menos 2" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "o objeto '%s' não é uma tupla ou uma lista" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2924,9 +2882,8 @@ msgid "object not iterable" msgstr "objeto não iterável" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "O objeto do tipo '%s' não possui len()" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -3023,21 +2980,10 @@ msgstr "o polígono só pode ser registrado em um pai" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "pop a partir de um PulseIn vazio" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "pop a partir de um conjunto vazio" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "pop a partir da lista vazia" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "popitem(): o dicionário está vazio" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3195,13 +3141,8 @@ msgid "stream operation not supported" msgstr "a operação do fluxo não é compatível" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "o índice da string está fora do intervalo" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "o índices das string devem ser números inteiros, não %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3211,10 +3152,6 @@ msgstr "a string não é compatível; use bytes ou bytearray" msgid "struct: cannot index" msgstr "struct: não pode indexar" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: índice fora do intervalo" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct: sem campos" @@ -3284,7 +3221,7 @@ msgstr "valores demais para descompactar (esperado %d)" msgid "trapz is defined for 1D arrays of equal length" msgstr "o trapz está definido para 1D arrays de igual tamanho" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "o índice da tupla está fora do intervalo" @@ -3351,9 +3288,8 @@ msgid "unknown conversion specifier %c" msgstr "especificador de conversão desconhecido %c" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "código de formato desconhecido '%c' para o objeto do tipo '%s'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3392,16 +3328,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "o caractere do formato não é compatível '%c' (0x%x) no índice %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "tipo não compatível para %q: '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "tipo não compatível para o operador" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "tipos não compatíveis para %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3480,6 +3416,111 @@ 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 "'%s' object cannot assign attribute '%q'" +#~ msgstr "O objeto '%s' não pode definir o atributo '%q'" + +#~ msgid "'%s' object does not support '%q'" +#~ msgstr "O objeto '%s' não é compatível com '%q'" + +#~ msgid "'%s' object does not support item assignment" +#~ msgstr "O objeto '%s' não compatível com a atribuição dos itens" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "O objeto '%s' não é compatível com exclusão do item" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "O objeto '%s' não possui o atributo '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "O objeto '%s' não é um iterador" + +#~ msgid "'%s' object is not callable" +#~ msgstr "O objeto '%s' não é invocável" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "O objeto '%s' não é iterável" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "O objeto '%s' não é subroteirizável" + +#~ msgid "Pop from an empty Ps2 buffer" +#~ msgstr "Buffer Ps2 vazio" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Rodando em modo seguro! Atualização automática está desligada.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "Rodando em modo seguro! Não está executando o código salvo.\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "O __init__() deve retornar Nenhum, não '%s'" + +#~ msgid "can't convert %s to complex" +#~ msgstr "Não é possível converter %s para complex" + +#~ msgid "can't convert %s to float" +#~ msgstr "Não é possível converter %s para float" + +#~ msgid "can't convert %s to int" +#~ msgstr "Não é possível converter %s para int" + +#~ msgid "can't convert NaN to int" +#~ msgstr "Não é possível converter NaN para int" + +#~ msgid "can't convert address to int" +#~ msgstr "não é possível converter o endereço para int" + +#~ msgid "can't convert inf to int" +#~ msgstr "não é possível converter inf para int" + +#~ msgid "can't convert to complex" +#~ msgstr "não é possível converter para complex" + +#~ msgid "can't convert to float" +#~ msgstr "não é possível converter para float" + +#~ msgid "can't convert to int" +#~ msgstr "não é possível converter para int" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "o objeto '%s' não é uma tupla ou uma lista" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "O objeto do tipo '%s' não possui len()" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "pop a partir de um PulseIn vazio" + +#~ msgid "pop from an empty set" +#~ msgstr "pop a partir de um conjunto vazio" + +#~ msgid "pop from empty list" +#~ msgstr "pop a partir da lista vazia" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "popitem(): o dicionário está vazio" + +#~ msgid "string index out of range" +#~ msgstr "o índice da string está fora do intervalo" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "o índices das string devem ser números inteiros, não %s" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: índice fora do intervalo" + +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "código de formato desconhecido '%c' para o objeto do tipo '%s'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "tipo não compatível para %q: '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "tipos não compatíveis para %q: '%s', '%s'" + #~ msgid "'%q' object is not bytes-like" #~ msgstr "objetos '%q' não são bytes-like" diff --git a/locale/sv.po b/locale/sv.po index 26c4263915..01a095b2de 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-30 07:23-0500\n" +"POT-Creation-Date: 2020-08-04 18:42-0500\n" "PO-Revision-Date: 2020-08-05 20:32+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -72,13 +72,17 @@ msgstr "%q-fel: %d" msgid "%q in use" msgstr "%q används redan" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -116,6 +120,42 @@ msgstr "%q() kräver %d positionsargument men %d gavs" msgid "'%q' argument required" msgstr "'%q' argument krävs" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -166,48 +206,6 @@ msgstr "'%s' heltal %d ligger inte inom intervallet %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' heltal 0x%x ryms inte i mask 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "Objektet '%s' kan inte tilldela attributet '%q'" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "Objektet '%s' har inte stöd för '%q'" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "Objektet '%s' stöder inte tilldelningen" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "Objektet '%s' stöder inte borttagning av objekt" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "Objektet '%s' har inget attribut '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "Objektet '%s' är inte en iterator" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "Objektet '%s' kan inte anropas" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "Objektet '%s' är inte itererable" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "Objektet '%s' är inte indexbar" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "'='-justering tillåts inte i strängformatspecifikation" @@ -1252,6 +1250,10 @@ msgstr "Inte ansluten" msgid "Not playing" msgstr "Ingen uppspelning" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1347,10 +1349,6 @@ msgstr "Plus eventuella moduler i filsystemet\n" msgid "Polygon needs at least 3 points" msgstr "Polygonen behöver minst 3 punkter" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "Pop från en tom Ps2-buffert" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Prefixbufferten måste finnas på heap" @@ -1424,12 +1422,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "Radvärdet måste vara digitalio.DigitalInOut" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Kör i säkert läge! Autoladdning är avstängd.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Kör i säkert läge! Sparad kod körs inte.\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1807,9 +1801,8 @@ msgid "__init__() should return None" msgstr "__init __ () ska returnera None" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "__init __ () ska returnera None, inte '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1962,7 +1955,7 @@ msgstr "bytes> 8 bitar stöds inte" msgid "bytes value out of range" msgstr "bytevärde utanför intervallet" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "kalibrering är utanför intervallet" @@ -1994,48 +1987,17 @@ msgstr "kan inte lägga till särskild metod för redan subklassad klass" msgid "can't assign to expression" msgstr "kan inte tilldela uttryck" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "kan inte konvertera %s till komplex" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "kan inte konvertera %s till float" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "kan inte konvertera %s till int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "kan inte konvertera '%q' objekt implicit till %q" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "kan inte konvertera NaN till int" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "kan inte konvertera address till int" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "kan inte konvertera inf till int" - #: py/obj.c -msgid "can't convert to complex" -msgstr "kan inte konvertera till komplex" - -#: py/obj.c -msgid "can't convert to float" -msgstr "kan inte konvertera till float" - -#: py/obj.c -msgid "can't convert to int" -msgstr "kan inte konvertera till int" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2447,7 +2409,7 @@ msgstr "funktionen saknar det obligatoriska nyckelordsargumentet '%q'" msgid "function missing required positional argument #%d" msgstr "funktionen saknar det obligatoriska positionsargumentet #%d" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "funktionen kräver %d positionsargument men %d angavs" @@ -2496,10 +2458,7 @@ msgstr "felaktig utfyllnad" msgid "index is out of bounds" msgstr "index är utanför gränserna" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "index utanför intervallet" @@ -2858,9 +2817,8 @@ msgid "number of points must be at least 2" msgstr "antal punkter måste vara minst 2" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "objektet '%s' är inte en tupel eller lista" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2895,9 +2853,8 @@ msgid "object not iterable" msgstr "objektet är inte iterable" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "objekt av typen '%s' har ingen len()" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -2990,21 +2947,10 @@ msgstr "polygon kan endast registreras i en förälder" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "pop från en tom PulseIn" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "pop från en tom uppsättning" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "pop från tom lista" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "popitem(): ordlistan är tom" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3162,13 +3108,8 @@ msgid "stream operation not supported" msgstr "stream-åtgärd stöds inte" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "strängindex utanför intervallet" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "strängindex måste vara heltal, inte %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3178,10 +3119,6 @@ msgstr "sträng stöds inte; använd bytes eller bytearray" msgid "struct: cannot index" msgstr "struct: kan inte indexera" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: index utanför intervallet" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct: inga fält" @@ -3251,7 +3188,7 @@ msgstr "för många värden att packa upp (förväntat %d)" msgid "trapz is defined for 1D arrays of equal length" msgstr "interp är definierad för 1D-matriser med samma längd" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "tupelindex utanför intervallet" @@ -3318,9 +3255,8 @@ msgid "unknown conversion specifier %c" msgstr "okänd konverteringsspecificerare %c" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "okänt format '%c' för objekt av typ '%s'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3359,16 +3295,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "Formattecknet '%c' (0x%x) stöds inte vid index %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "typ som inte stöds för %q: '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "typ stöds inte för operatören" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "typ som inte stöds för %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3447,6 +3383,111 @@ 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 "'%s' object cannot assign attribute '%q'" +#~ msgstr "Objektet '%s' kan inte tilldela attributet '%q'" + +#~ msgid "'%s' object does not support '%q'" +#~ msgstr "Objektet '%s' har inte stöd för '%q'" + +#~ msgid "'%s' object does not support item assignment" +#~ msgstr "Objektet '%s' stöder inte tilldelningen" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "Objektet '%s' stöder inte borttagning av objekt" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "Objektet '%s' har inget attribut '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "Objektet '%s' är inte en iterator" + +#~ msgid "'%s' object is not callable" +#~ msgstr "Objektet '%s' kan inte anropas" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "Objektet '%s' är inte itererable" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "Objektet '%s' är inte indexbar" + +#~ msgid "Pop from an empty Ps2 buffer" +#~ msgstr "Pop från en tom Ps2-buffert" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Kör i säkert läge! Autoladdning är avstängd.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "Kör i säkert läge! Sparad kod körs inte.\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "__init __ () ska returnera None, inte '%s'" + +#~ msgid "can't convert %s to complex" +#~ msgstr "kan inte konvertera %s till komplex" + +#~ msgid "can't convert %s to float" +#~ msgstr "kan inte konvertera %s till float" + +#~ msgid "can't convert %s to int" +#~ msgstr "kan inte konvertera %s till int" + +#~ msgid "can't convert NaN to int" +#~ msgstr "kan inte konvertera NaN till int" + +#~ msgid "can't convert address to int" +#~ msgstr "kan inte konvertera address till int" + +#~ msgid "can't convert inf to int" +#~ msgstr "kan inte konvertera inf till int" + +#~ msgid "can't convert to complex" +#~ msgstr "kan inte konvertera till komplex" + +#~ msgid "can't convert to float" +#~ msgstr "kan inte konvertera till float" + +#~ msgid "can't convert to int" +#~ msgstr "kan inte konvertera till int" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "objektet '%s' är inte en tupel eller lista" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "objekt av typen '%s' har ingen len()" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "pop från en tom PulseIn" + +#~ msgid "pop from an empty set" +#~ msgstr "pop från en tom uppsättning" + +#~ msgid "pop from empty list" +#~ msgstr "pop från tom lista" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "popitem(): ordlistan är tom" + +#~ msgid "string index out of range" +#~ msgstr "strängindex utanför intervallet" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "strängindex måste vara heltal, inte %s" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: index utanför intervallet" + +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "okänt format '%c' för objekt av typ '%s'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "typ som inte stöds för %q: '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "typ som inte stöds för %q: '%s', '%s'" + #~ msgid "'async for' or 'async with' outside async function" #~ msgstr "'async for' eller 'async with' utanför async-funktion" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 7558fbb674..c2856ace20 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-30 07:23-0500\n" +"POT-Creation-Date: 2020-08-04 18:42-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -72,13 +72,17 @@ msgstr "" msgid "%q in use" msgstr "%q zhèngzài shǐyòng" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -116,6 +120,42 @@ msgstr "%q() cǎiyòng %d wèizhì cānshù, dàn gěi chū %d" msgid "'%q' argument required" msgstr "xūyào '%q' cānshù" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -166,48 +206,6 @@ msgstr "'%s' zhěngshù %d bùzài fànwéi nèi %d.%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' zhěngshù 0x%x bù shìyòng yú yǎn mǎ 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "'%s' duì xiàng bù zhīchí '%q'" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "'%s' duìxiàng bù zhīchí xiàngmù fēnpèi" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "'%s' duìxiàng bù zhīchí shānchú xiàngmù" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "'%s' duìxiàng méiyǒu shǔxìng '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "'%s' duìxiàng bùshì yīgè diédài qì" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "'%s' duìxiàng wúfǎ diàoyòng" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "'%s' duìxiàng bùnéng diédài" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "'%s' duìxiàng bùnéng fēnshù" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "zìfú chuàn géshì shuōmíng fú zhōng bù yǔnxǔ '=' duìqí" @@ -1247,6 +1245,10 @@ msgstr "Wèi liánjiē" msgid "Not playing" msgstr "Wèi bòfàng" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1338,10 +1340,6 @@ msgstr "Zài wénjiàn xìtǒng shàng tiānjiā rènhé mókuài\n" msgid "Polygon needs at least 3 points" msgstr "" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "Cóng kōng de Ps2 huǎnchōng qū dànchū" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Qiánzhuì huǎnchōng qū bìxū zài duī shàng" @@ -1414,12 +1412,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "Xíng xiàng bìxū shì digitalio.DigitalInOut" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Zài ānquán móshì xià yùnxíng! Zìdòng chóngxīn jiāzài yǐ guānbì.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Zài ānquán móshì xià yùnxíng! Bù yùnxíng yǐ bǎocún de dàimǎ.\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1793,9 +1787,8 @@ msgid "__init__() should return None" msgstr "__init__() fǎnhuí not" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "__Init__() yīnggāi fǎnhuí not, ér bùshì '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1948,7 +1941,7 @@ msgstr "zì jié > 8 wèi" msgid "bytes value out of range" msgstr "zì jié zhí chāochū fànwéi" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "jiàozhǔn fànwéi chāochū fànwéi" @@ -1980,48 +1973,17 @@ msgstr "wúfǎ tiānjiā tèshū fāngfǎ dào zi fēnlèi lèi" msgid "can't assign to expression" msgstr "bùnéng fēnpèi dào biǎodá shì" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "wúfǎ zhuǎnhuàn%s dào fùzá" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "wúfǎ zhuǎnhuàn %s dào fú diǎn xíng biànliàng" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "wúfǎ zhuǎnhuàn%s dào int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "wúfǎ jiāng '%q' duìxiàng zhuǎnhuàn wèi %q yǐn hán" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "wúfǎ jiāng dǎoháng zhuǎnhuàn wèi int" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "wúfǎ jiāng dìzhǐ zhuǎnhuàn wèi int" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "bùnéng jiāng inf zhuǎnhuàn wèi int" - #: py/obj.c -msgid "can't convert to complex" -msgstr "bùnéng zhuǎnhuàn wèi fùzá" - -#: py/obj.c -msgid "can't convert to float" -msgstr "bùnéng zhuǎnhuàn wèi fú diǎn" - -#: py/obj.c -msgid "can't convert to int" -msgstr "bùnéng zhuǎnhuàn wèi int" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2432,7 +2394,7 @@ msgstr "hánshù quēshǎo suǒ xū guānjiàn zì cānshù '%q'" msgid "function missing required positional argument #%d" msgstr "hánshù quēshǎo suǒ xū de wèizhì cānshù #%d" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "hánshù xūyào %d gè wèizhì cānshù, dàn %d bèi gěi chū" @@ -2481,10 +2443,7 @@ msgstr "bù zhèngquè de tiánchōng" msgid "index is out of bounds" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "suǒyǐn chāochū fànwéi" @@ -2842,9 +2801,8 @@ msgid "number of points must be at least 2" msgstr "" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "duìxiàng '%s' bùshì yuán zǔ huò lièbiǎo" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2879,9 +2837,8 @@ msgid "object not iterable" msgstr "duìxiàng bùnéng diédài" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "lèixíng '%s' de duìxiàng méiyǒu chángdù" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -2973,21 +2930,10 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "cóng kōng de PulseIn dànchū dànchū" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "cóng kōng jí dànchū" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "cóng kōng lièbiǎo zhòng dànchū" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "dànchū xiàngmù (): Zìdiǎn wèi kōng" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3145,13 +3091,8 @@ msgid "stream operation not supported" msgstr "bù zhīchí liú cāozuò" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "zìfú chuàn suǒyǐn chāochū fànwéi" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "zìfú chuàn zhǐshù bìxū shì zhěngshù, ér bùshì %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3161,10 +3102,6 @@ msgstr "zìfú chuàn bù zhīchí; shǐyòng zì jié huò zì jié zǔ" msgid "struct: cannot index" msgstr "jiégòu: bùnéng suǒyǐn" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "jiégòu: suǒyǐn chāochū fànwéi" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "jiégòu: méiyǒu zìduàn" @@ -3234,7 +3171,7 @@ msgstr "dǎkāi tài duō zhí (yùqí %d)" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "yuán zǔ suǒyǐn chāochū fànwéi" @@ -3301,9 +3238,8 @@ msgid "unknown conversion specifier %c" msgstr "wèizhī de zhuǎnhuàn biāozhù %c" #: py/objstr.c -#, fuzzy, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "lèixíng '%s' duìxiàng wèizhī de géshì dàimǎ '%c'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3342,16 +3278,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "bù zhīchí de géshì zìfú '%c' (0x%x) suǒyǐn %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "bù zhīchí de lèixíng %q: '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "bù zhīchí de cāozuò zhě lèixíng" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "bù zhīchí de lèixíng wèi %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3430,6 +3366,109 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "%q suǒyǐn bìxū shì zhěngshù, ér bùshì %s" + +#~ msgid "'%s' object does not support '%q'" +#~ msgstr "'%s' duì xiàng bù zhīchí '%q'" + +#~ msgid "'%s' object does not support item assignment" +#~ msgstr "'%s' duìxiàng bù zhīchí xiàngmù fēnpèi" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "'%s' duìxiàng bù zhīchí shānchú xiàngmù" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "'%s' duìxiàng méiyǒu shǔxìng '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "'%s' duìxiàng bùshì yīgè diédài qì" + +#~ msgid "'%s' object is not callable" +#~ msgstr "'%s' duìxiàng wúfǎ diàoyòng" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "'%s' duìxiàng bùnéng diédài" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "'%s' duìxiàng bùnéng fēnshù" + +#~ msgid "Pop from an empty Ps2 buffer" +#~ msgstr "Cóng kōng de Ps2 huǎnchōng qū dànchū" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Zài ānquán móshì xià yùnxíng! Zìdòng chóngxīn jiāzài yǐ guānbì.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "Zài ānquán móshì xià yùnxíng! Bù yùnxíng yǐ bǎocún de dàimǎ.\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "__Init__() yīnggāi fǎnhuí not, ér bùshì '%s'" + +#~ msgid "can't convert %s to complex" +#~ msgstr "wúfǎ zhuǎnhuàn%s dào fùzá" + +#~ msgid "can't convert %s to float" +#~ msgstr "wúfǎ zhuǎnhuàn %s dào fú diǎn xíng biànliàng" + +#~ msgid "can't convert %s to int" +#~ msgstr "wúfǎ zhuǎnhuàn%s dào int" + +#~ msgid "can't convert NaN to int" +#~ msgstr "wúfǎ jiāng dǎoháng zhuǎnhuàn wèi int" + +#~ msgid "can't convert address to int" +#~ msgstr "wúfǎ jiāng dìzhǐ zhuǎnhuàn wèi int" + +#~ msgid "can't convert inf to int" +#~ msgstr "bùnéng jiāng inf zhuǎnhuàn wèi int" + +#~ msgid "can't convert to complex" +#~ msgstr "bùnéng zhuǎnhuàn wèi fùzá" + +#~ msgid "can't convert to float" +#~ msgstr "bùnéng zhuǎnhuàn wèi fú diǎn" + +#~ msgid "can't convert to int" +#~ msgstr "bùnéng zhuǎnhuàn wèi int" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "duìxiàng '%s' bùshì yuán zǔ huò lièbiǎo" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "lèixíng '%s' de duìxiàng méiyǒu chángdù" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "cóng kōng de PulseIn dànchū dànchū" + +#~ msgid "pop from an empty set" +#~ msgstr "cóng kōng jí dànchū" + +#~ msgid "pop from empty list" +#~ msgstr "cóng kōng lièbiǎo zhòng dànchū" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "dànchū xiàngmù (): Zìdiǎn wèi kōng" + +#~ msgid "string index out of range" +#~ msgstr "zìfú chuàn suǒyǐn chāochū fànwéi" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "zìfú chuàn zhǐshù bìxū shì zhěngshù, ér bùshì %s" + +#~ msgid "struct: index out of range" +#~ msgstr "jiégòu: suǒyǐn chāochū fànwéi" + +#, fuzzy +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "lèixíng '%s' duìxiàng wèizhī de géshì dàimǎ '%c'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "bù zhīchí de lèixíng %q: '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "bù zhīchí de lèixíng wèi %q: '%s', '%s'" + #~ msgid "Address is not %d bytes long or is in wrong format" #~ msgstr "Dìzhǐ bùshì %d zì jié zhǎng, huòzhě géshì cuòwù" From 272d300fc8984434fa683caeb5b7bc52effe4dd9 Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Sat, 8 Aug 2020 01:33:24 +0900 Subject: [PATCH 0512/1293] Fix Read the Docs bulid failing --- .readthedocs.yml | 4 ++++ extmod/ulab | 2 +- tools/extract_pyi.py | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 4030bc3178..2a0640782f 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -8,6 +8,10 @@ version: 2 +submodules: + include: + - extmod/ulab + python: version: 3 install: diff --git a/extmod/ulab b/extmod/ulab index 11a7ecff6d..a2f27760c6 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 11a7ecff6d76a02644ff23a734b792afaa615e44 +Subproject commit a2f27760c68a7222f4c53a7fb7bdfd898ce797ec diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index 4d82e9e5d3..651216e11a 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -45,7 +45,10 @@ def find_stub_issues(tree): if isinstance(node.value, ast.Constant) and node.value.value == Ellipsis: yield ("WARN", f"Unnecessary Ellipsis assignment (= ...) on line {node.lineno}.") elif isinstance(node, ast.arguments): - for arg_node in (node.args + node.posonlyargs + node.kwonlyargs): + allargs = list(node.args + node.kwonlyargs) + if sys.version_info >= (3, 8): + allargs.extend(node.posonlyargs) + for arg_node in allargs: if not is_typed(arg_node.annotation) and (arg_node.arg != "self" and arg_node.arg != "cls"): yield ("WARN", f"Missing argument type: {arg_node.arg} on line {arg_node.lineno}") if node.vararg and not is_typed(node.vararg.annotation, allow_any=True): From 64c9baa6aa6203e21ff0420ce5a9889f44422334 Mon Sep 17 00:00:00 2001 From: Margaret Matocha Date: Fri, 7 Aug 2020 15:46:00 -0500 Subject: [PATCH 0513/1293] Added bitmap.insert function for slice copy into a bitmap from another bitmap --- shared-bindings/displayio/Bitmap.c | 72 ++++++++++++++++++++++++++++++ shared-bindings/displayio/Bitmap.h | 4 ++ shared-module/displayio/Bitmap.c | 71 +++++++++++++++++++++++++++++ 3 files changed, 147 insertions(+) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index a52840f2e0..d62502b17f 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -172,6 +172,77 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val return mp_const_none; } +//| def insert(self, x: int, y: int, source_bitmap: bitmap, x1: int, y1: int, x2: int, y2:int) -> Any: +//| """Inserts the source_bitmap region defined by rectangular boundaries +//| (x1,y1) and (x2,y2) into the bitmap at the specified (x,y) location. +//| :param int x: Horizontal pixel location in bitmap where source_bitmap upper-left +//| corner will be placed +//| :param int y: Vertical pixel location in bitmap where source_bitmap upper-left +//| corner will be placed +//| :param bitmap source_bitmap: Source bitmap that contains the graphical region to be copied +//| : param x1: Minimum x-value for rectangular bounding box to be copied from the source bitmap +//| : param y1: Minimum y-value for rectangular bounding box to be copied from the source bitmap +//| : param x2: Maximum x-value for rectangular bounding box to be copied from the source bitmap +//| : param y2: Maximum y-value for rectangular bounding box to be copied from the source bitmap +//| +//| ... +//| + +//STATIC mp_obj_t displayio_bitmap_obj_insert(mp_obj_t self_in, mp_obj_t x_obj, mp_obj_t y_obj, mp_obj_t source_in, mp_obj_t x1_obj, mp_obj_t y1_obj, mp_obj_t x2_obj, mp_obj_t y2_obj){ +STATIC mp_obj_t displayio_bitmap_obj_insert(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args){ + + // // convert the inputs into the correct type + // displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); + // int16_t x = mp_obj_get_int(x_obj); + // int16_t y = mp_obj_get_int(y_obj); + // displayio_bitmap_t *source = MP_OBJ_TO_PTR(source_in); + // int16_t x1 = mp_obj_get_int(x1_obj); + // int16_t y1 = mp_obj_get_int(y1_obj); + // int16_t x2 = mp_obj_get_int(x2_obj); + // int16_t y2 = mp_obj_get_int(y2_obj); + displayio_bitmap_t *self = MP_OBJ_TO_PTR(pos_args[0]); + int16_t x = mp_obj_get_int(pos_args[1]); + int16_t y = mp_obj_get_int(pos_args[2]); + displayio_bitmap_t *source = MP_OBJ_TO_PTR(pos_args[3]); + int16_t x1 = mp_obj_get_int(pos_args[4]); + int16_t y1 = mp_obj_get_int(pos_args[5]); + int16_t x2 = mp_obj_get_int(pos_args[6]); + int16_t y2 = mp_obj_get_int(pos_args[7]); + + + + + if ( (x<0) || (y<0) || (x > self-> width) || (y > self->height) ) { + mp_raise_ValueError(translate("(x,y): out of range of target bitmap")); + } + if ( (x1 < 0) || (x1 > source->width) || + (y1 < 0) || (y1 > source->height) || + (x2 < 0) || (x2 > source->width) || + (y2 < 0) || (y2 > source->height) ) { + mp_raise_ValueError(translate("(x1,y1) or (x2,y2): out of range of source bitmap")); + } + + // Ensure x1 < x2 and y1 < y2 + if (x1 > x2) { + int16_t temp=x2; + x2=x1; + x1=temp; + } + if (y1 > y2) { + int16_t temp=y2; + y2=y1; + y1=temp; + } + + common_hal_displayio_bitmap_insert(self, x, y, source, x1, y1, x2, y2); + + return mp_const_none; +} + +MP_DEFINE_CONST_FUN_OBJ_KW(displayio_bitmap_insert_obj, 8, displayio_bitmap_obj_insert); +/// What should this number value be? **** + + //| def fill(self, value: Any) -> Any: //| """Fills the bitmap with the supplied palette index value.""" //| ... @@ -192,6 +263,7 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_bitmap_fill_obj, displayio_bitmap_obj_fill); STATIC const mp_rom_map_elem_t displayio_bitmap_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&displayio_bitmap_height_obj) }, { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&displayio_bitmap_width_obj) }, + { MP_ROM_QSTR(MP_QSTR_insert), MP_ROM_PTR(&displayio_bitmap_insert_obj) }, // Added insert function 8/7/2020 { MP_ROM_QSTR(MP_QSTR_fill), MP_ROM_PTR(&displayio_bitmap_fill_obj) }, }; diff --git a/shared-bindings/displayio/Bitmap.h b/shared-bindings/displayio/Bitmap.h index 46c3373292..d6183f7d00 100644 --- a/shared-bindings/displayio/Bitmap.h +++ b/shared-bindings/displayio/Bitmap.h @@ -40,6 +40,10 @@ uint16_t common_hal_displayio_bitmap_get_height(displayio_bitmap_t *self); uint16_t common_hal_displayio_bitmap_get_width(displayio_bitmap_t *self); uint32_t common_hal_displayio_bitmap_get_bits_per_value(displayio_bitmap_t *self); void common_hal_displayio_bitmap_set_pixel(displayio_bitmap_t *bitmap, int16_t x, int16_t y, uint32_t value); +void common_hal_displayio_bitmap_insert(displayio_bitmap_t *self, int16_t x, int16_t y, displayio_bitmap_t *source, + int16_t x1, int16_t y1, int16_t x2, int16_t y2); +// New selective bitmap copy function "insert": KMatocha 8/7/2020 + uint32_t common_hal_displayio_bitmap_get_pixel(displayio_bitmap_t *bitmap, int16_t x, int16_t y); void common_hal_displayio_bitmap_fill(displayio_bitmap_t *bitmap, uint32_t value); diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index 8bcda6086f..ab6e4f5dd5 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -105,6 +105,77 @@ uint32_t common_hal_displayio_bitmap_get_pixel(displayio_bitmap_t *self, int16_t return 0; } +void common_hal_displayio_bitmap_insert(displayio_bitmap_t *self, int16_t x, int16_t y, displayio_bitmap_t *source, + int16_t x1, int16_t y1, int16_t x2, int16_t y2) { + // Copy complete "source" bitmap into "self" bitmap at location x,y in the "self" + // Add a boolean to determine if all values are copied, or only if non-zero + // Default is copy all values, but for text glyphs this should copy only non-zero values + + if (self->read_only) { + mp_raise_RuntimeError(translate("Read-only object")); + } + + //// check for zero width, this would be a single pixel + // if (x1_source == x2_source) || (y1_source == y2_source) { + // return 0 + // } + + // Dirty area update is unnecessary with simplest version. + // int16_t x_max=x+(x2_source-x1_source); + // int16_t y_max=y+(y2_source-y1_source); + // + // + // // Update the dirty area. + // if (x < self->dirty_area.x1) { + // self->dirty_area.x1 = x; + // } else if (x_max >= self->dirty_area.x2) { + // self->dirty_area.x2 = x_max); + // } + // if (y < self->dirty_area.y1) { + // self->dirty_area.y1 = y; + // } else if (y_max >= self->dirty_area.y2) { + // self->dirty_area.y2 = y_max; + // } + + // simplest version - use internal functions for get/set pixels + for (uint16_t i=0; i<= (x2-x1) ; i++) { + for (uint16_t j=0; j<= (y2-y1) ; j++){ + uint16_t value = common_hal_displayio_bitmap_get_pixel(source, x1+i, y1+j); + if ( (x+i >= 0) && (y+j >= 0) && (x+i <= self->width-1) && (y+j <= self->height-1) ){ + common_hal_displayio_bitmap_set_pixel(self, x+i, y+j, value); + } + } + } + + // Would be faster if copying a full word at a time. + /// Hard work here!!!! + // index into the original row + // figure out how to shift the bits into the right location + // check the boolean and don't update any zero's + + // // Update our data + // int32_t row_start = y * self->stride; + // uint32_t bytes_per_value = self->bits_per_value / 8; + // if (bytes_per_value < 1) { + // uint32_t bit_position = (sizeof(size_t) * 8 - ((x & self->x_mask) + 1) * self->bits_per_value); + // uint32_t index = row_start + (x >> self->x_shift); + // uint32_t word = self->data[index]; + // word &= ~(self->bitmask << bit_position); + // word |= (value & self->bitmask) << bit_position; + // self->data[index] = word; + // } else { + // size_t* row = self->data + row_start; + // if (bytes_per_value == 1) { + // ((uint8_t*) row)[x] = value; + // } else if (bytes_per_value == 2) { + // ((uint16_t*) row)[x] = value; + // } else if (bytes_per_value == 4) { + // ((uint32_t*) row)[x] = value; + // } + // } +} + + void common_hal_displayio_bitmap_set_pixel(displayio_bitmap_t *self, int16_t x, int16_t y, uint32_t value) { if (self->read_only) { mp_raise_RuntimeError(translate("Read-only object")); From b6008d0032a49e6b5c332576fa2f141d353b9fd3 Mon Sep 17 00:00:00 2001 From: Margaret Matocha Date: Fri, 7 Aug 2020 15:59:42 -0500 Subject: [PATCH 0514/1293] Adding bitmap.insert to copy a slice of a source bitmap into another bitmap --- shared-module/displayio/Bitmap.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index ab6e4f5dd5..75f352b30c 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -115,6 +115,10 @@ void common_hal_displayio_bitmap_insert(displayio_bitmap_t *self, int16_t x, int mp_raise_RuntimeError(translate("Read-only object")); } + // If this value is encountered in the source bitmap, it will not be copied (for text glyphs) + // This should be added as an optional parameter, and if it is `None`, then all pixels are copied + uint32_t skip_value=0; + //// check for zero width, this would be a single pixel // if (x1_source == x2_source) || (y1_source == y2_source) { // return 0 @@ -140,9 +144,11 @@ void common_hal_displayio_bitmap_insert(displayio_bitmap_t *self, int16_t x, int // simplest version - use internal functions for get/set pixels for (uint16_t i=0; i<= (x2-x1) ; i++) { for (uint16_t j=0; j<= (y2-y1) ; j++){ - uint16_t value = common_hal_displayio_bitmap_get_pixel(source, x1+i, y1+j); - if ( (x+i >= 0) && (y+j >= 0) && (x+i <= self->width-1) && (y+j <= self->height-1) ){ - common_hal_displayio_bitmap_set_pixel(self, x+i, y+j, value); + uint32_t value = common_hal_displayio_bitmap_get_pixel(source, x1+i, y1+j); + if (value != skip_value) { + if ( (x+i >= 0) && (y+j >= 0) && (x+i <= self->width-1) && (y+j <= self->height-1) ){ + common_hal_displayio_bitmap_set_pixel(self, x+i, y+j, value); + } } } } From e73dba21d26b93ce1140faecb4820ae46ce4c742 Mon Sep 17 00:00:00 2001 From: Roy Hooper Date: Fri, 7 Aug 2020 18:42:06 -0400 Subject: [PATCH 0515/1293] make pixelbuf handle floats and iterables --- shared-bindings/_pixelbuf/PixelBuf.c | 30 +++++++---------- shared-bindings/_pixelbuf/PixelBuf.h | 2 +- shared-module/_pixelbuf/PixelBuf.c | 49 +++++++++++++++++++++++----- 3 files changed, 52 insertions(+), 29 deletions(-) diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 4fc6f7cbf6..ee7dac4b38 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -40,6 +40,10 @@ #include "shared-module/_pixelbuf/PixelBuf.h" #include "shared-bindings/digitalio/DigitalInOut.h" +#ifdef CIRCUITPY_ULAB +#include "extmod/ulab/code/ndarray.h" +#endif + extern const int32_t colorwheel(float pos); static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t* parsed); @@ -326,27 +330,15 @@ STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp } else { // Set #if MICROPY_PY_ARRAY_SLICE_ASSIGN - if (!(MP_OBJ_IS_TYPE(value, &mp_type_list) || MP_OBJ_IS_TYPE(value, &mp_type_tuple))) { - mp_raise_ValueError(translate("tuple/list required on RHS")); + size_t num_items = mp_obj_get_int(mp_obj_len(value)); + + if (num_items != slice_len && num_items != (slice_len * common_hal__pixelbuf_pixelbuf_get_bpp(self_in))) { + mp_raise_ValueError_varg(translate("Unmatched number of items on RHS (expected %d or %d, got %d)."), + slice_len, slice_len * common_hal__pixelbuf_pixelbuf_get_bpp(self_in), + num_items); } - mp_obj_t *src_objs; - size_t num_items; - if (MP_OBJ_IS_TYPE(value, &mp_type_list)) { - mp_obj_list_t *t = MP_OBJ_TO_PTR(value); - num_items = t->len; - src_objs = t->items; - } else { - mp_obj_tuple_t *l = MP_OBJ_TO_PTR(value); - num_items = l->len; - src_objs = l->items; - } - if (num_items != slice_len) { - mp_raise_ValueError_varg(translate("Unmatched number of items on RHS (expected %d, got %d)."), - slice_len, num_items); - } - - common_hal__pixelbuf_pixelbuf_set_pixels(self_in, slice.start, slice.step, slice_len, src_objs); + common_hal__pixelbuf_pixelbuf_set_pixels(self_in, slice.start, slice.step, slice_len, value, num_items != slice_len); return mp_const_none; #else return MP_OBJ_NULL; // op not supported diff --git a/shared-bindings/_pixelbuf/PixelBuf.h b/shared-bindings/_pixelbuf/PixelBuf.h index 0b09a57715..111223be0d 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.h +++ b/shared-bindings/_pixelbuf/PixelBuf.h @@ -47,6 +47,6 @@ void common_hal__pixelbuf_pixelbuf_fill(mp_obj_t self, mp_obj_t item); void common_hal__pixelbuf_pixelbuf_show(mp_obj_t self); mp_obj_t common_hal__pixelbuf_pixelbuf_get_pixel(mp_obj_t self, size_t index); void common_hal__pixelbuf_pixelbuf_set_pixel(mp_obj_t self, size_t index, mp_obj_t item); -void common_hal__pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, size_t start, mp_int_t step, size_t slice_len, mp_obj_t* values); +void common_hal__pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, size_t start, mp_int_t step, size_t slice_len, mp_obj_t* values, bool flattened); #endif // CP_SHARED_BINDINGS_PIXELBUF_PIXELBUF_H diff --git a/shared-module/_pixelbuf/PixelBuf.c b/shared-module/_pixelbuf/PixelBuf.c index 9d671e454b..50906fcc1d 100644 --- a/shared-module/_pixelbuf/PixelBuf.c +++ b/shared-module/_pixelbuf/PixelBuf.c @@ -132,6 +132,18 @@ void common_hal__pixelbuf_pixelbuf_set_brightness(mp_obj_t self_in, mp_float_t b } } +uint8_t _pixelbuf_get_as_uint8(mp_obj_t obj) { + if (MP_OBJ_IS_SMALL_INT(obj)) { + return MP_OBJ_SMALL_INT_VALUE(obj); + } else if (MP_OBJ_IS_INT(obj)) { + return mp_obj_get_int_truncated(obj); + } else if (mp_obj_is_float(obj)) { + return (uint8_t)mp_obj_get_float(obj); + } + mp_raise_TypeError_varg( + translate("can't convert %q to %q"), mp_obj_get_type_qstr(obj), MP_QSTR_int); +} + 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 @@ -142,8 +154,8 @@ void _pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t* self, mp_obj_t color, uint8_ *w = 0; } - if (MP_OBJ_IS_INT(color)) { - mp_int_t value = mp_obj_get_int_truncated(color); + 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_obj_get_float(color); *r = value >> 16 & 0xff; *g = (value >> 8) & 0xff; *b = value & 0xff; @@ -155,9 +167,9 @@ void _pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t* self, mp_obj_t color, uint8_ mp_raise_ValueError_varg(translate("Expected tuple of length %d, got %d"), byteorder->bpp, len); } - *r = mp_obj_get_int_truncated(items[PIXEL_R]); - *g = mp_obj_get_int_truncated(items[PIXEL_G]); - *b = mp_obj_get_int_truncated(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])) { *w = 255 * mp_obj_get_float(items[PIXEL_W]); @@ -218,17 +230,36 @@ void _pixelbuf_set_pixel(pixelbuf_pixelbuf_obj_t* self, size_t index, mp_obj_t v _pixelbuf_set_pixel_color(self, index, r, g, b, w); } -void common_hal__pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, size_t start, mp_int_t step, size_t slice_len, mp_obj_t* values) { +void common_hal__pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, size_t start, mp_int_t step, size_t slice_len, mp_obj_t* values, bool flattened) { pixelbuf_pixelbuf_obj_t* self = native_pixelbuf(self_in); - for (size_t i = 0; i < slice_len; i++) { - _pixelbuf_set_pixel(self, start, values[i]); - start+=step; + mp_obj_iter_buf_t iter_buf; + mp_obj_t iterable = mp_getiter(values, &iter_buf); + mp_obj_t item; + size_t i = 0; + mp_obj_tuple_t *tuple; + uint bpp = self->bytes_per_pixel; + if (flattened) { + tuple = MP_OBJ_TO_PTR(mp_obj_new_tuple(bpp, NULL)); + } + while ((item = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) { + if (flattened) { + tuple->items[i % bpp] = item; + if (++i % bpp == 0) { + _pixelbuf_set_pixel(self, start, tuple); + start+=step; + } + } else { + _pixelbuf_set_pixel(self, start, item); + start+=step; + } } if (self->auto_write) { common_hal__pixelbuf_pixelbuf_show(self_in); } } + + void common_hal__pixelbuf_pixelbuf_set_pixel(mp_obj_t self_in, size_t index, mp_obj_t value) { pixelbuf_pixelbuf_obj_t* self = native_pixelbuf(self_in); _pixelbuf_set_pixel(self, index, value); From ad04b8cfd37697cf50bebf649b3ecabb7c182b92 Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Sat, 8 Aug 2020 11:33:12 +0900 Subject: [PATCH 0516/1293] Revert the ulab update --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index a2f27760c6..11a7ecff6d 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit a2f27760c68a7222f4c53a7fb7bdfd898ce797ec +Subproject commit 11a7ecff6d76a02644ff23a734b792afaa615e44 From c3743680539808881ad1328b10523b4825578f72 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 7 Aug 2020 22:52:34 -0500 Subject: [PATCH 0517/1293] support_matrix.rst: add internal links to boards in the table --- shared-bindings/support_matrix.rst | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/shared-bindings/support_matrix.rst b/shared-bindings/support_matrix.rst index 124f3a8104..e77d15162b 100644 --- a/shared-bindings/support_matrix.rst +++ b/shared-bindings/support_matrix.rst @@ -6,11 +6,16 @@ Support Matrix The following table lists the available built-in modules for each CircuitPython capable board. -.. csv-table:: +.. list-table:: :header-rows: 1 :widths: 7, 50 - "Board", "Modules Available" - {% for key, value in support_matrix|dictsort -%} - "{{ key }}", "{{ '`' ~ value|join("`, `") ~ '`' }}" - {% endfor -%} + * - Board + - Modules Available + + {% for key, value in support_matrix|dictsort %} + {{ '.. _' ~ key ~ ':' }} + * - {{ key }} + - {{ '`' ~ value|join("`, `") ~ '`' }} + + {% endfor %} From 0f4b969d62b5eb933a674a23a338d9d420cf61b4 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 8 Aug 2020 00:29:37 -0400 Subject: [PATCH 0518/1293] discovery of Nordic UART service working --- devices/ble_hci/common-hal/_bleio/Attribute.c | 49 +- devices/ble_hci/common-hal/_bleio/Attribute.h | 26 +- .../common-hal/_bleio/Characteristic.c | 2 +- devices/ble_hci/common-hal/_bleio/Service.c | 30 +- devices/ble_hci/common-hal/_bleio/UUID.c | 2 +- devices/ble_hci/common-hal/_bleio/__init__.c | 8 + devices/ble_hci/common-hal/_bleio/__init__.h | 5 + devices/ble_hci/common-hal/_bleio/att.c | 460 +++++++++++------- ports/nrf/common-hal/_bleio/UUID.c | 2 +- shared-bindings/_bleio/UUID.c | 2 +- shared-bindings/_bleio/UUID.h | 2 +- shared-module/_bleio/Characteristic.h | 13 + 12 files changed, 370 insertions(+), 231 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Attribute.c b/devices/ble_hci/common-hal/_bleio/Attribute.c index d32ed11679..26fabed098 100644 --- a/devices/ble_hci/common-hal/_bleio/Attribute.c +++ b/devices/ble_hci/common-hal/_bleio/Attribute.c @@ -24,55 +24,26 @@ * THE SOFTWARE. */ +#include "py/runtime.h" + #include "shared-bindings/_bleio/Attribute.h" #include "shared-bindings/_bleio/Characteristic.h" #include "shared-bindings/_bleio/Descriptor.h" #include "shared-bindings/_bleio/Service.h" -// Return the type of the attribute. -ble_attribute_type_uuid bleio_attribute_type_uuid(mp_obj_t *attribute) { + +bleio_uuid_obj_t *bleio_attribute_get_uuid(mp_obj_t *attribute) { if (MP_OBJ_IS_TYPE(attribute, &bleio_characteristic_type)) { - return BLE_TYPE_CHARACTERISTIC; + bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(attribute); + return characteristic->uuid; } if (MP_OBJ_IS_TYPE(attribute, &bleio_descriptor_type)) { - return BLE_TYPE_DESCRIPTOR; + bleio_descriptor_obj_t *descriptor = MP_OBJ_TO_PTR(attribute); + return descriptor->uuid; } if (MP_OBJ_IS_TYPE(attribute, &bleio_service_type)) { bleio_service_obj_t *service = MP_OBJ_TO_PTR(attribute); - return service->is_secondary ? BLE_TYPE_SECONDARY_SERVICE : BLE_TYPE_PRIMARY_SERVICE; + return service->uuid; } - return BLE_TYPE_UNKNOWN; + mp_raise_RuntimeError(translate("Invalid BLE attribute")); } - -// Convert a _bleio security mode to a ble_gap_conn_sec_mode_t setting. -// void bleio_attribute_gatts_set_security_mode(ble_gap_conn_sec_mode_t *perm, bleio_attribute_security_mode_t security_mode) { -// switch (security_mode) { -// case SECURITY_MODE_NO_ACCESS: -// BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(perm); -// break; - -// case SECURITY_MODE_OPEN: -// BLE_GAP_CONN_SEC_MODE_SET_OPEN(perm); -// break; - -// case SECURITY_MODE_ENC_NO_MITM: -// BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(perm); -// break; - -// case SECURITY_MODE_ENC_WITH_MITM: -// BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM(perm); -// break; - -// case SECURITY_MODE_LESC_ENC_WITH_MITM: -// BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM(perm); -// break; - -// case SECURITY_MODE_SIGNED_NO_MITM: -// BLE_GAP_CONN_SEC_MODE_SET_SIGNED_NO_MITM(perm); -// break; - -// case SECURITY_MODE_SIGNED_WITH_MITM: -// BLE_GAP_CONN_SEC_MODE_SET_SIGNED_WITH_MITM(perm); -// break; -// } -// } diff --git a/devices/ble_hci/common-hal/_bleio/Attribute.h b/devices/ble_hci/common-hal/_bleio/Attribute.h index 47327437bc..f4b0b7dbba 100644 --- a/devices/ble_hci/common-hal/_bleio/Attribute.h +++ b/devices/ble_hci/common-hal/_bleio/Attribute.h @@ -28,23 +28,23 @@ #define MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_ATTRIBUTE_H #include "shared-module/_bleio/Attribute.h" +#include "shared-bindings/_bleio/UUID.h" // Types returned by attribute table lookups. These are UUIDs. typedef enum { - BLE_TYPE_UNKNOWN = 0x0000, - BLE_TYPE_PRIMARY_SERVICE = 0x2800, - BLE_TYPE_SECONDARY_SERVICE = 0x2801, - BLE_TYPE_CHARACTERISTIC = 0x2803, - BLE_TYPE_DESCRIPTOR = 0x2900 + BLE_TYPE_UNKNOWN = 0x0000, + BLE_TYPE_SERVICE_PRIMARY = 0x2800, + BLE_TYPE_SERVICE_SECONDARY = 0x2801, + BLE_TYPE_SERVICE_INCLUDE = 0x2802, // not yet implemented by us + BLE_TYPE_CHARACTERISTIC = 0x2803, + BLE_TYPE_CHAR_EXTENDED_PROPS = 0x2900, // not yet implemented by us + BLE_TYPE_CHAR_USER_DESC = 0x2901, // not yet implemented by us + BLE_TYPE_CCCD = 0x2902, + BLE_TYPE_SCCD = 0x2903, // not yet implemented by us + BLE_TYPE_CHAR_PRESENTATION_FMT = 0x2904, // not yet implemented by us + BLE_TYPE_CHAR_AGGREGATE_FMT = 0x2905, // not yet implemented by us } ble_attribute_type_uuid; -// typedef struct -// { -// uint8_t sm : 4; /**< Security Mode (1 or 2), 0 for no permissions at all. */ -// uint8_t lv : 4; /**< Level (1, 2, 3 or 4), 0 for no permissions at all. */ - -// } ble_gap_conn_sec_mode_t; - -ble_attribute_type_uuid bleio_attribute_type_uuid(mp_obj_t *attribute); +bleio_uuid_obj_t *bleio_attribute_get_uuid(mp_obj_t *attribute); #endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_ATTRIBUTE_H diff --git a/devices/ble_hci/common-hal/_bleio/Characteristic.c b/devices/ble_hci/common-hal/_bleio/Characteristic.c index 2f4a81f9a2..b62957ea6a 100644 --- a/devices/ble_hci/common-hal/_bleio/Characteristic.c +++ b/devices/ble_hci/common-hal/_bleio/Characteristic.c @@ -149,7 +149,7 @@ void common_hal_bleio_characteristic_add_descriptor(bleio_characteristic_obj_t * } descriptor->handle = bleio_adapter_add_attribute(&common_hal_bleio_adapter_obj, MP_OBJ_TO_PTR(descriptor)); - // Include this desriptor in the service handles range. + // Include this descriptor in the service handle's range. self->service->end_handle = descriptor->handle; // Link together all the descriptors for this characteristic. diff --git a/devices/ble_hci/common-hal/_bleio/Service.c b/devices/ble_hci/common-hal/_bleio/Service.c index abccfd5c4e..b6963b7a4a 100644 --- a/devices/ble_hci/common-hal/_bleio/Service.c +++ b/devices/ble_hci/common-hal/_bleio/Service.c @@ -99,20 +99,30 @@ void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, self->end_handle = characteristic->handle; if (characteristic->props & (CHAR_PROP_NOTIFY | CHAR_PROP_INDICATE)) { - // We need a CCCD. + // We need a CCCD if this characteristic is doing notify or indicate. bleio_descriptor_obj_t *cccd = m_new_obj(bleio_descriptor_obj_t); cccd->base.type = &bleio_descriptor_type; - cccd->read_perm = SECURITY_MODE_OPEN; - // Make CCCD write permission match characteristic read permission. - cccd->write_perm = characteristic->read_perm; - const uint16_t cccd_handle = bleio_adapter_add_attribute( - &common_hal_bleio_adapter_obj, MP_OBJ_TO_PTR(cccd)); - cccd->handle = cccd_handle; - characteristic->cccd_handle = cccd_handle; + uint16_t zero = 0; + mp_buffer_info_t zero_cccd = { + .buf = &zero, + .len = sizeof(zero), + }; + + common_hal_bleio_descriptor_construct( + cccd, + characteristic, + &cccd_uuid, // 0x2902 + SECURITY_MODE_OPEN, // CCCD read perm + characteristic->read_perm, // Make CCCD write perm match characteristic read perm. + 2, // 2 bytes + true, // fixed length + &zero_cccd // Initial value is 0. + ); + + // Adds CCCD to attribute table, and also extends self->end_handle to include the CCCD. common_hal_bleio_characteristic_add_descriptor(characteristic, cccd); - - self->end_handle = cccd_handle; + characteristic->cccd_handle = cccd->handle; } // #if CIRCUITPY_VERBOSE_BLE diff --git a/devices/ble_hci/common-hal/_bleio/UUID.c b/devices/ble_hci/common-hal/_bleio/UUID.c index d86878e472..fd8d8bfe9e 100644 --- a/devices/ble_hci/common-hal/_bleio/UUID.c +++ b/devices/ble_hci/common-hal/_bleio/UUID.c @@ -36,7 +36,7 @@ // If uuid128 is NULL, this is a Bluetooth SIG 16-bit UUID. // If uuid128 is not NULL, it's a 128-bit (16-byte) UUID, with bytes 12 and 13 zero'd out, where // the 16-bit part goes. Those 16 bits are passed in uuid16. -void common_hal_bleio_uuid_construct(bleio_uuid_obj_t *self, uint32_t uuid16, const uint8_t uuid128[16]) { +void common_hal_bleio_uuid_construct(bleio_uuid_obj_t *self, mp_int_t uuid16, const uint8_t uuid128[16]) { self->size = uuid128 == NULL ? 16 : 128; self->uuid16 = uuid16; if (uuid128) { diff --git a/devices/ble_hci/common-hal/_bleio/__init__.c b/devices/ble_hci/common-hal/_bleio/__init__.c index ee953cfeb9..16b4a26e29 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.c +++ b/devices/ble_hci/common-hal/_bleio/__init__.c @@ -38,6 +38,9 @@ #include "shared-bindings/_bleio/UUID.h" #include "supervisor/shared/bluetooth.h" +// UUID shared by all cccd's. +bleio_uuid_obj_t cccd_uuid; + bool vm_used_ble; void check_hci_error(hci_result_t result) { @@ -112,6 +115,10 @@ void check_hci_error(hci_result_t result) { // Turn off BLE on a reset or reload. void bleio_reset() { + // Create a UUID object for all CCCD's. + cccd_uuid.base.type = &bleio_uuid_type; + common_hal_bleio_uuid_construct(&cccd_uuid, BLE_TYPE_CCCD, NULL); + bleio_hci_reset(); if (!common_hal_bleio_adapter_get_enabled(&common_hal_bleio_adapter_obj)) { @@ -123,6 +130,7 @@ void bleio_reset() { return; } common_hal_bleio_adapter_set_enabled(&common_hal_bleio_adapter_obj, false); + //FIX bonding_reset(); supervisor_start_bluetooth(); } diff --git a/devices/ble_hci/common-hal/_bleio/__init__.h b/devices/ble_hci/common-hal/_bleio/__init__.h index 5873675af8..e84320e30c 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.h +++ b/devices/ble_hci/common-hal/_bleio/__init__.h @@ -29,6 +29,8 @@ #include +#include "shared-bindings/_bleio/UUID.h" + #include "hci.h" void bleio_background(void); @@ -59,4 +61,7 @@ void check_sec_status(uint8_t sec_status); // Track if the user code modified the BLE state to know if we need to undo it on reload. extern bool vm_used_ble; +// UUID shared by all CCCD's. +extern bleio_uuid_obj_t cccd_uuid; + #endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_INIT_H diff --git a/devices/ble_hci/common-hal/_bleio/att.c b/devices/ble_hci/common-hal/_bleio/att.c index ba6c7c3d06..8daddd3a96 100644 --- a/devices/ble_hci/common-hal/_bleio/att.c +++ b/devices/ble_hci/common-hal/_bleio/att.c @@ -33,6 +33,8 @@ #include "common-hal/_bleio/Attribute.h" #include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/Characteristic.h" +#include "shared-bindings/_bleio/Descriptor.h" +#include "shared-bindings/_bleio/Service.h" #include "shared-bindings/_bleio/UUID.h" #include "supervisor/shared/tick.h" @@ -54,8 +56,63 @@ STATIC struct { uint8_t length; // Length of response packet. } expected_rsp; +// A characteristic declaration has this data, in this order: +// See Bluetooth v5.1 spec, section 3.3.1 Characteristic declaration. +typedef struct __packed { + uint8_t properties; + uint16_t value_handle; + uint8_t uuid[0]; // 2 or 16 bytes +} characteristic_declaration_t; + //FIX BLEDeviceEventHandler event_handlers[2]; +STATIC uint8_t bleio_properties_to_ble_spec_properties(uint8_t bleio_properties) { + uint8_t ble_spec_properties = 0; + if (bleio_properties & CHAR_PROP_BROADCAST) { + ble_spec_properties |= BT_GATT_CHRC_BROADCAST; + } + if (bleio_properties & CHAR_PROP_INDICATE) { + ble_spec_properties |= BT_GATT_CHRC_INDICATE; + } + if (bleio_properties & CHAR_PROP_NOTIFY) { + ble_spec_properties |= BT_GATT_CHRC_NOTIFY; + } + if (bleio_properties & CHAR_PROP_READ) { + ble_spec_properties |= BT_GATT_CHRC_READ; + } + if (bleio_properties & CHAR_PROP_WRITE) { + ble_spec_properties |= BT_GATT_CHRC_WRITE; + } + if (bleio_properties & CHAR_PROP_WRITE_NO_RESPONSE) { + ble_spec_properties |= BT_GATT_CHRC_WRITE_WITHOUT_RESP; + } + + return ble_spec_properties; +} + +// STATIC uint8_t ble_spec_properties_to_bleio_properties(uint8_t ble_spec_properties) { +// uint8_t bleio_properties = 0; +// if (ble_spec_properties & BT_GATT_CHRC_BROADCAST) { +// bleio_properties |= CHAR_PROP_BROADCAST; +// } +// if (ble_spec_properties & BT_GATT_CHRC_INDICATE) { +// bleio_properties |= CHAR_PROP_INDICATE; +// } +// if (ble_spec_properties & BT_GATT_CHRC_NOTIFY) { +// bleio_properties |= CHAR_PROP_NOTIFY; +// } +// if (ble_spec_properties & BT_GATT_CHRC_READ) { +// bleio_properties |= CHAR_PROP_READ; +// } +// if (ble_spec_properties & BT_GATT_CHRC_WRITE) { +// bleio_properties |= CHAR_PROP_WRITE; +// } +// if (ble_spec_properties & BT_GATT_CHRC_WRITE_WITHOUT_RESP) { +// bleio_properties |= CHAR_PROP_WRITE_NO_RESPONSE; +// } + +// return bleio_properties; +// } STATIC void send_error(uint16_t conn_handle, uint8_t opcode, uint16_t handle, uint8_t code) { struct __packed { @@ -187,13 +244,13 @@ bool att_disconnect_from_address(bt_addr_le_t *addr) { // BLEUuid serviceUuid(serviceUuidFilter); // while (reqEnd_handle == 0xffff) { -// int respLength = readByGroupReq(conn_handle, reqStart_handle, reqEnd_handle, BLE_TYPE_PRIMARY_SERVICE, response_buffer); +// int respLength = readByGroupReq(conn_handle, reqStart_handle, reqEnd_handle, BLE_TYPE_SERVICE_PRIMARY, response_buffer); // if (respLength == 0) { // return false; // } -// if (response_buffer[0] == BT_ATT_OP_READ_BY_GROUP_RSP) { +// if (response_buffer[0] == BT_ATT_OP_READ_GROUP_RSP) { // uint16_t lengthPerService = response_buffer[1]; // uint8_t uuidLen = lengthPerService - 4; @@ -254,7 +311,7 @@ bool att_disconnect_from_address(bt_addr_le_t *addr) { // return false; // } -// if (response_buffer[0] == BT_ATT_OP_READ_BY_TYPE_RSP) { +// if (response_buffer[0] == BT_ATT_OP_READ_TYPE_RSP) { // uint16_t lengthPerCharacteristic = response_buffer[1]; // uint8_t uuidLen = lengthPerCharacteristic - 5; @@ -759,56 +816,88 @@ STATIC void process_find_info_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl return; } - //FIX - // uint8_t response[mtu]; - // uint16_t response_length; + typedef struct __packed { + struct bt_att_hdr h; + struct bt_att_find_info_rsp r; + } rsp_t; - // response[0] = BT_ATT_OP_FIND_INFO_RSP; - // response[1] = 0x00; - // response_length = 2; + uint8_t rsp_bytes[mtu]; + rsp_t *rsp = (rsp_t *) rsp_bytes; + rsp->h.code = BT_ATT_OP_FIND_INFO_RSP; - // for (uint16_t i = (req->start_handle - 1); i < GATT.attributeCount() && i <= (req->end_handle - 1); i++) { - // BLELocalAttribute* attribute = GATT.attribute(i); - // uint16_t handle = (i + 1); - // bool is_value_handle = (attribute->type() == BLE_TYPE_CHARACTERISTIC) && (((BLELocalCharacteristic*)attribute)->valueHandle() == handle); - // int uuid_len = is_value_handle ? 2 : attribute->uuid_length(); - // size_t info_type = (uuidLen == 2) ? 0x01 : 0x02; + // Keeps track of total length of the response. + size_t rsp_length = sizeof(rsp_t); - // if (response[1] == 0) { - // response[1] = info_type; - // } + bool no_data = true; - // if (response[1] != info_type) { - // // different type - // break; - // } + // All the data chunks must have uuid's that are the same size. + // Keep track of the first one to make sure. + size_t sizeof_first_uuid = 0; - // // add the handle - // memcpy(&response[response_length], &handle, sizeof(handle)); - // response_length += sizeof(handle); + const uint16_t max_attribute_handle = bleio_adapter_max_attribute_handle(&common_hal_bleio_adapter_obj); + for (uint16_t handle = req->start_handle; + handle <= max_attribute_handle && handle <= req->end_handle; + handle++) { - // if (is_value_handle || attribute->type() == BLE_TYPE_DESCRIPTOR) { - // // add the UUID - // memcpy(&response[response_length], attribute->uuid_data(), uuid_len); - // response_length += uuidLen; - // } else { - // // add the type - // uint16_t type = attribute->type(); + mp_obj_t *attribute_obj = bleio_adapter_get_attribute(&common_hal_bleio_adapter_obj, handle); - // memcpy(&response[response_length], &type, sizeof(type)); - // response_length += sizeof(type); - // } + // Fetch the uuid for the given attribute, which might be a characteristic or a descriptor. + bleio_uuid_obj_t *uuid; - // if ((response_length + (2 + uuidLen)) > mtu) { - // break; - // } - // } + if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_characteristic_type)) { + bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(attribute_obj); + if (characteristic->handle != handle) { + // If the handles don't match, this is the characteristic definition attribute. + // Skip it. We want the characteristic value attribute. + continue; + } + uuid = characteristic->uuid; - // if (response_length == 2) { - // send_error(conn_handle, BT_ATT_OP_FIND_INFO_REQ, findInfoReq->start_handle, BT_ATT_ERR_ATTR_NOT_FOUND); - // } else { - // hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, response_length, response); - // } + } else { + uuid = bleio_attribute_get_uuid(attribute_obj); + } + + const uint32_t sizeof_uuid = common_hal_bleio_uuid_get_size(uuid) / 8; + if (sizeof_first_uuid == 0) { + sizeof_first_uuid = sizeof_uuid; + // All the uuids in the response will be the same size. + rsp->r.format = sizeof_uuid == 2 ? BT_ATT_INFO_16 : BT_ATT_INFO_128; + } + + if (sizeof_uuid != sizeof_first_uuid) { + // Previous UUID was a different size. We can't mix sizes. + // Stop and send what we have so far. + break; + } + + if (rsp_length + sizeof_uuid > mtu) { + // No remaining room in response for this uuid. + break; + } + + if (sizeof_uuid == 2) { + struct bt_att_info_16 *info_16 = (struct bt_att_info_16 *) &rsp_bytes[rsp_length]; + info_16->handle = handle; + info_16->uuid = common_hal_bleio_uuid_get_uuid16(uuid); + + rsp_length += sizeof(struct bt_att_info_16); + } else { + struct bt_att_info_128 *info_128 = (struct bt_att_info_128 *) &rsp_bytes[rsp_length]; + info_128->handle = handle; + common_hal_bleio_uuid_get_uuid128(uuid, info_128->uuid); + + rsp_length += sizeof(struct bt_att_info_128); + } + + no_data =false; + } // end for + + + if (no_data) { + send_error(conn_handle, BT_ATT_OP_FIND_INFO_REQ, req->start_handle, BT_ATT_ERR_ATTRIBUTE_NOT_FOUND); + } else { + hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, rsp_length, rsp_bytes); + } } int att_find_info_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint8_t response_buffer[]) { @@ -834,7 +923,7 @@ STATIC void process_find_info_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t da check_and_save_expected_rsp(conn_handle, BT_ATT_OP_FIND_INFO_RSP, dlen, data); } -STATIC void process_find_by_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { +STATIC void process_find_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { struct bt_att_find_type_req *req = (struct bt_att_find_type_req *) data; if (dlen < sizeof(struct bt_att_find_type_req)) { @@ -849,11 +938,11 @@ STATIC void process_find_by_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t response_length = 1; //FIX - // if (find_by_type_req->type == BLE_TYPE_PRIMARY_SERVICE) { - // for (uint16_t i = (find_by_type_req->start_handle - 1); i < GATT.attributeCount() && i <= (find_by_type_req->end_handle - 1); i++) { + // if (find_type_req->type == BLE_TYPE_SERVICE_PRIMARY) { + // for (uint16_t i = (find_type_req->start_handle - 1); i < GATT.attributeCount() && i <= (find_type_req->end_handle - 1); i++) { // BLELocalAttribute* attribute = GATT.attribute(i); - // if ((attribute->type() == find_by_type_req->type) && (attribute->uuidLength() == value_length) && memcmp(attribute->uuidData(), value, value_length) == 0) { + // if ((attribute->type() == find_type_req->type) && (attribute->uuidLength() == value_length) && memcmp(attribute->uuidData(), value, value_length) == 0) { // BLELocalService* service = (BLELocalService*)attribute; // // add the start handle @@ -880,15 +969,15 @@ STATIC void process_find_by_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t } } -void process_read_by_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { +void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { struct bt_att_read_group_req *req = (struct bt_att_read_group_req *) data; uint16_t type_uuid = req->uuid[0] | (req->uuid[1] << 8); // We only support returning services for BT_ATT_OP_READ_GROUP_REQ, which is typically used // for service discovery. if (dlen != sizeof(struct bt_att_read_group_req) + sizeof(type_uuid) || - (type_uuid != BLE_TYPE_PRIMARY_SERVICE && - type_uuid != BLE_TYPE_SECONDARY_SERVICE)) { + (type_uuid != BLE_TYPE_SERVICE_PRIMARY && + type_uuid != BLE_TYPE_SERVICE_SECONDARY)) { send_error(conn_handle, BT_ATT_OP_READ_GROUP_REQ, req->start_handle, BT_ATT_ERR_UNSUPPORTED_GROUP_TYPE); return; } @@ -927,37 +1016,34 @@ void process_read_by_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, } mp_obj_t *attribute_obj = bleio_adapter_get_attribute(&common_hal_bleio_adapter_obj, handle); - if (type_uuid != bleio_attribute_type_uuid(attribute_obj)) { - // Not a primary or secondary service. - continue; + if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_service_type)) { + bleio_service_obj_t *service = MP_OBJ_TO_PTR(attribute_obj); + + // Is this a 16-bit or a 128-bit uuid? It must match in size with any previous attribute + // in this transmission. + const uint32_t sizeof_service_uuid = common_hal_bleio_uuid_get_size(service->uuid) / 8; + if (sizeof_first_service_uuid == 0) { + sizeof_first_service_uuid = sizeof_service_uuid; + data_length += sizeof_service_uuid; + } else if (sizeof_first_service_uuid != sizeof_service_uuid) { + // Mismatched sizes, which can't be in the same batch. + // Transmit just what we have so far in this batch. + break; + } + + // Pass the length of ONE bt_att_group_data chunk. + // There may be multiple chunks in this transmission. + rsp->r.len = data_length; + + struct bt_att_group_data *group_data = (struct bt_att_group_data *) &rsp_bytes[rsp_length]; + + group_data->start_handle = service->start_handle; + group_data->end_handle = service->end_handle; + common_hal_bleio_uuid_pack_into(service->uuid, group_data->value); + + rsp_length += data_length; + no_data = false; } - // Now we know it's a service. - bleio_service_obj_t *service = MP_OBJ_TO_PTR(attribute_obj); - - // Is this a 16-bit or a 128-bit uuid? It must match in size with any previous attribute - // in this transmission. - const uint32_t sizeof_service_uuid = common_hal_bleio_uuid_get_size(service->uuid) / 8; - if (sizeof_first_service_uuid == 0) { - sizeof_first_service_uuid = sizeof_service_uuid; - data_length += sizeof_service_uuid; - } else if (sizeof_first_service_uuid != sizeof_service_uuid) { - // Mismatched sizes, which can't be in the same batch. - // Transmit just what we have so far in this batch. - break; - } - - - // Pass the length of ONE bt_att_group_data chunk. There may be multiple ones in this transmission. - rsp->r.len = data_length; - - struct bt_att_group_data *group_data = (struct bt_att_group_data *) &rsp_bytes[rsp_length]; - - group_data->start_handle = service->start_handle; - group_data->end_handle = service->end_handle; - common_hal_bleio_uuid_pack_into(service->uuid, group_data->value); - - rsp_length += data_length; - no_data = false; } if (no_data) { @@ -967,7 +1053,7 @@ void process_read_by_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, } } -int att_read_by_group_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint16_t uuid, uint8_t response_buffer[]) { +int att_read_group_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint16_t uuid, uint8_t response_buffer[]) { struct __packed { struct bt_att_hdr h; struct bt_att_read_group_req r; @@ -985,7 +1071,7 @@ int att_read_by_group_req(uint16_t conn_handle, uint16_t start_handle, uint16_t return send_req_wait_for_rsp(conn_handle, sizeof(req), (uint8_t *) &req, response_buffer); } -STATIC void process_read_by_group_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { +STATIC void process_read_group_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { if (dlen < 2) { return; // invalid, drop } @@ -1040,7 +1126,7 @@ STATIC void process_read_or_read_blob_req(uint16_t conn_handle, uint16_t mtu, ui //FIX BLELocalAttribute* attribute = GATT.attribute(handle - 1); // enum BLEAttributeType attributeType = attribute->type(); - // if (attributeType == BLE_TYPE_PRIMARY_SERVICE) { + // if (attributeType == BLE_TYPE_SERVICE_PRIMARY) { // if (offset) { // send_error(conn_handle, BT_ATT_ERR_ATTR_NOT_LONG, handle, BT_ATT_ERR_INVALID_PDU); // return; @@ -1118,110 +1204,156 @@ STATIC void process_read_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) check_and_save_expected_rsp(conn_handle, BT_ATT_OP_READ_RSP, dlen, data); } -STATIC void process_read_by_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { +STATIC void process_read_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) { struct bt_att_read_type_req *req = (struct bt_att_read_type_req *) data; + uint16_t type_uuid = req->uuid[0] | (req->uuid[1] << 8); - if (dlen != sizeof(struct bt_att_read_type_req)) { + if (dlen != sizeof(struct bt_att_read_type_req) + sizeof(type_uuid)) { send_error(conn_handle, BT_ATT_OP_READ_TYPE_REQ, req->start_handle, BT_ATT_ERR_INVALID_PDU); return; } - // uint8_t response[mtu]; - // uint16_t response_length; + typedef struct __packed { + struct bt_att_hdr h; + struct bt_att_read_type_rsp r; + } rsp_t; - // response[0] = BT_ATT_OP_READ_TYPE_RSP; - // response[1] = 0x00; - // response_length = 2; + uint8_t rsp_bytes[mtu]; + rsp_t *rsp = (rsp_t *) rsp_bytes; + rsp->h.code = BT_ATT_OP_READ_TYPE_RSP; + rsp->r.len = 0; - // for (uint16_t i = (req->start_handle - 1); i < GATT.attributeCount() && i <= (req->end_handle - 1); i++) { - // BLELocalAttribute* attribute = GATT.attribute(i); - // uint16_t handle = (i + 1); + // Keeps track of total length of the response. + size_t rsp_length = sizeof(rsp_t); - // if (attribute->type() == readByTypeReq->uuid) { - // if (attribute->type() == BLE_TYPE_CHARACTERISTIC) { - // BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)attribute; + bool no_data = true; - // if (characteristic->value_handle() == handle) { - // // value handle, skip - // continue; - // } + // All the data chunks must have uuid's that are the same size. + // Keep track of the first one to make sure. + size_t sizeof_first_uuid = 0; - // int uuidLen = attribute->uuidLength(); - // int typeSize = (uuidLen == 2) ? 7 : 21; + // Size of a single bt_att_data chunk. Start with the initial size, and + // add the uuid size and other data sizes in the loop below. + size_t data_length = sizeof(struct bt_att_data); - // if (response[1] == 0) { - // response[1] = typeSize; - // } + const uint16_t max_attribute_handle = bleio_adapter_max_attribute_handle(&common_hal_bleio_adapter_obj); + for (uint16_t handle = req->start_handle; + handle <= max_attribute_handle && handle <= req->end_handle; + handle++) { - // if (response[1] != typeSize) { - // // all done, wrong size - // break; - // } + if (rsp_length + data_length > mtu) { + // The next possible bt_att_data chunk won't fit. The response is full. + break; + } - // // add the handle - // memcpy(&response[response_length], &handle, sizeof(handle)); - // response_length += sizeof(handle); + mp_obj_t *attribute_obj = bleio_adapter_get_attribute(&common_hal_bleio_adapter_obj, handle); - // // add the properties - // response[response_length++] = characteristic->properties(); + if (type_uuid == BLE_TYPE_CHARACTERISTIC && + MP_OBJ_IS_TYPE(attribute_obj, &bleio_characteristic_type)) { + // Request is for characteristic declarations. + bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(attribute_obj); - // // add the value handle - // uint16_t value_handle = (handle + 1); - // memcpy(&response[response_length], &value_handle, sizeof(value_handle)); - // response_length += sizeof(value_handle); + if (characteristic->handle == handle) { + // If the characteristic's handle is this attribute's handle, skip it: + // it's the attribute for characteristic value. We want to return the declaration + // handle attribute instead. (It will probably get skipped below, by the + // handle++). + continue; + } - // // add the UUID - // memcpy(&response[response_length], characteristic->uuidData(), uuidLen); - // response_length += uuidLen; + // Is this a 16-bit or a 128-bit uuid? It must match in size with any previous attribute + // in this transmission. + const uint32_t sizeof_uuid = common_hal_bleio_uuid_get_size(characteristic->uuid) / 8; + if (sizeof_first_uuid == 0) { + sizeof_first_uuid = sizeof_uuid; + data_length += sizeof_uuid; + data_length += sizeof(characteristic_declaration_t); + } else if (sizeof_first_uuid != sizeof_uuid) { + // Mismatched sizes, which can't be in the same batch. + // Transmit just what we have so far in this batch. + break; + } - // // skip the next handle, it's a value handle - // i++; + // Pass the length of ONE bt_att_data chunk. + // There may be multiple chunks in this transmission. + rsp->r.len = data_length; - // if ((response_length + typeSize) > mtu) { - // break; - // } - // } else if (attribute->type() == 0x2902) { - // BLELocalDescriptor* descriptor = (BLELocalDescriptor*)attribute; + struct bt_att_data *att_data = (struct bt_att_data *) &rsp_bytes[rsp_length]; - // // add the handle - // memcpy(&response[response_length], &handle, sizeof(handle)); - // response_length += sizeof(handle); + att_data->handle = characteristic->decl_handle; - // // add the value - // int valueSize = min((uint16_t)(mtu - response_length), (uint16_t)descriptor->valueSize()); - // memcpy(&response[response_length], descriptor->value(), valueSize); - // response_length += valueSize; + characteristic_declaration_t *char_decl = (characteristic_declaration_t *) att_data->value; - // response[1] = 2 + valueSize; + // Convert from the bleio properties bit values to the BLE spec properties bit values. + // They are not the same :(. + char_decl->properties = bleio_properties_to_ble_spec_properties(characteristic->props); + char_decl->value_handle = characteristic->handle; + common_hal_bleio_uuid_pack_into(characteristic->uuid, char_decl->uuid); - // break; // all done - // } - // } else if (attribute->type() == BLE_TYPE_CHARACTERISTIC && attribute->uuidLength() == 2 && memcmp(&readByTypeReq->uuid, attribute->uuidData(), 2) == 0) { - // BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)attribute; + // We know the next handle will be the characteristic value handle, so skip it. + handle++; - // // add the handle - // memcpy(&response[response_length], &handle, sizeof(handle)); - // response_length += sizeof(handle); + rsp_length += data_length; + no_data = false; - // // add the value - // int value_length = min((uint16_t)(mtu - response_length), (uint16_t)characteristic->value_length()); - // memcpy(&response[response_length], characteristic->value(), value_length); - // response_length += value_length; + } else if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_descriptor_type)) { + // See if request is for a descriptor value with a 16-bit UUID, such as the CCCD. + bleio_descriptor_obj_t *descriptor = MP_OBJ_TO_PTR(attribute_obj); + if (common_hal_bleio_uuid_get_size(descriptor->uuid) == 16 && + common_hal_bleio_uuid_get_uuid16(descriptor->uuid) == type_uuid) { - // response[1] = 2 + value_length; + struct bt_att_data *att_data = (struct bt_att_data *) &rsp_bytes[rsp_length]; - // break; // all done - // } - // } + att_data->handle = handle; - // if (response_length == 2) { - // send_error(conn_handle, BT_ATT_OP_READ_BY_TYPE_REQ, readByTypeReq->start_handle, BT_ATT_ERR_ATTR_NOT_FOUND); - // } else { - // hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, response_length, response); - // } + mp_buffer_info_t bufinfo; + if (!mp_get_buffer(descriptor->value, &bufinfo, MP_BUFFER_READ)) { + break; + } + uint16_t value_size = MIN(mtu - rsp_length, bufinfo.len); + memcpy(att_data->value, bufinfo.buf, value_size); + rsp_length += value_size; + + // Only return one descriptor value. + no_data = false; + break; + } + + } else if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_characteristic_type)) { + // See if request is for a characteristic value with a 16-bit UUID. + bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(attribute_obj); + if (common_hal_bleio_uuid_get_size(characteristic->uuid) == 16 && + common_hal_bleio_uuid_get_uuid16(characteristic->uuid) == type_uuid) { + + struct bt_att_data *att_data = (struct bt_att_data *) &rsp_bytes[rsp_length]; + + att_data->handle = handle; + + mp_buffer_info_t bufinfo; + if (!mp_get_buffer(characteristic->value, &bufinfo, MP_BUFFER_READ)) { + // This shouldn't happen. There should be a buf in characteristic->value. + break; + } + uint16_t value_size = MIN(mtu - rsp_length, bufinfo.len); + memcpy(att_data->value, bufinfo.buf, value_size); + rsp_length += value_size; + + // Only return one characteristic value. + no_data = false; + break; + } + } + } // end for loop + + if (no_data) { + send_error(conn_handle, BT_ATT_OP_READ_TYPE_REQ, + req->start_handle, BT_ATT_ERR_ATTRIBUTE_NOT_FOUND); + } else { + hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, rsp_length, rsp_bytes); + } } -int att_read_by_type_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint16_t type, uint8_t response_buffer[]) { +int att_read_type_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint16_t type, uint8_t response_buffer[]) { struct __packed { struct bt_att_hdr h; struct bt_att_read_type_req r; @@ -1238,7 +1370,7 @@ int att_read_by_type_req(uint16_t conn_handle, uint16_t start_handle, uint16_t e return send_req_wait_for_rsp(conn_handle, sizeof(req), (uint8_t *) &req, response_buffer); } -STATIC void process_read_by_type_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { +STATIC void process_read_type_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { if (dlen < 1) { return; // invalid, drop } @@ -1597,23 +1729,23 @@ void att_process_data(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { break; case BT_ATT_OP_FIND_TYPE_REQ: - process_find_by_type_req(conn_handle, mtu, dlen, data); + process_find_type_req(conn_handle, mtu, dlen, data); break; case BT_ATT_OP_READ_TYPE_REQ: - process_read_by_type_req(conn_handle, mtu, dlen, data); + process_read_type_req(conn_handle, mtu, dlen, data); break; case BT_ATT_OP_READ_TYPE_RSP: - process_read_by_type_rsp(conn_handle, dlen, data); + process_read_type_rsp(conn_handle, dlen, data); break; case BT_ATT_OP_READ_GROUP_REQ: - process_read_by_group_req(conn_handle, mtu, dlen, data); + process_read_group_req(conn_handle, mtu, dlen, data); break; case BT_ATT_OP_READ_GROUP_RSP: - process_read_by_group_rsp(conn_handle, dlen, data); + process_read_group_rsp(conn_handle, dlen, data); break; case BT_ATT_OP_READ_REQ: diff --git a/ports/nrf/common-hal/_bleio/UUID.c b/ports/nrf/common-hal/_bleio/UUID.c index f80352ccb6..0c79e980ee 100644 --- a/ports/nrf/common-hal/_bleio/UUID.c +++ b/ports/nrf/common-hal/_bleio/UUID.c @@ -40,7 +40,7 @@ // If uuid128 is NULL, this is a Bluetooth SIG 16-bit UUID. // If uuid128 is not NULL, it's a 128-bit (16-byte) UUID, with bytes 12 and 13 zero'd out, where // the 16-bit part goes. Those 16 bits are passed in uuid16. -void common_hal_bleio_uuid_construct(bleio_uuid_obj_t *self, uint32_t uuid16, const uint8_t uuid128[16]) { +void common_hal_bleio_uuid_construct(bleio_uuid_obj_t *self, mp_int_t uuid16, const uint8_t uuid128[16]) { self->nrf_ble_uuid.uuid = uuid16; if (uuid128 == NULL) { self->nrf_ble_uuid.type = BLE_UUID_TYPE_BLE; diff --git a/shared-bindings/_bleio/UUID.c b/shared-bindings/_bleio/UUID.c index 6d92cf7931..93f89403b1 100644 --- a/shared-bindings/_bleio/UUID.c +++ b/shared-bindings/_bleio/UUID.c @@ -283,7 +283,7 @@ void bleio_uuid_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t mp_printf(print, "UUID(0x%04x)", common_hal_bleio_uuid_get_uuid16(self)); } else { uint8_t uuid128[16]; - (void) common_hal_bleio_uuid_get_uuid128(self, uuid128); + common_hal_bleio_uuid_get_uuid128(self, uuid128); mp_printf(print, "UUID('" "%02x%02x%02x%02x-" "%02x%02x-" diff --git a/shared-bindings/_bleio/UUID.h b/shared-bindings/_bleio/UUID.h index 178b0ca965..b10cce67f3 100644 --- a/shared-bindings/_bleio/UUID.h +++ b/shared-bindings/_bleio/UUID.h @@ -36,7 +36,7 @@ extern const mp_obj_type_t bleio_uuid_type; extern void common_hal_bleio_uuid_construct(bleio_uuid_obj_t *self, mp_int_t uuid16, const uint8_t uuid128[16]); extern uint32_t common_hal_bleio_uuid_get_uuid16(bleio_uuid_obj_t *self); -extern bool common_hal_bleio_uuid_get_uuid128(bleio_uuid_obj_t *self, uint8_t uuid128[16]); +extern void common_hal_bleio_uuid_get_uuid128(bleio_uuid_obj_t *self, uint8_t uuid128[16]); extern uint32_t common_hal_bleio_uuid_get_size(bleio_uuid_obj_t *self); void common_hal_bleio_uuid_pack_into(bleio_uuid_obj_t *self, uint8_t* buf); diff --git a/shared-module/_bleio/Characteristic.h b/shared-module/_bleio/Characteristic.h index 409a57c76e..7776b1fa57 100644 --- a/shared-module/_bleio/Characteristic.h +++ b/shared-module/_bleio/Characteristic.h @@ -27,6 +27,9 @@ #ifndef MICROPY_INCLUDED_SHARED_MODULE_BLEIO_CHARACTERISTIC_H #define MICROPY_INCLUDED_SHARED_MODULE_BLEIO_CHARACTERISTIC_H +// These are not the Bluetooth spec values. They are what is used by the Nordic SoftDevice. +// The bit values are in different positions. + typedef enum { CHAR_PROP_NONE = 0, CHAR_PROP_BROADCAST = 1u << 0, @@ -40,4 +43,14 @@ typedef enum { } bleio_characteristic_properties_enum_t; typedef uint8_t bleio_characteristic_properties_t; +// Bluetooth spec property values +#define BT_GATT_CHRC_BROADCAST 0x01 +#define BT_GATT_CHRC_READ 0x02 +#define BT_GATT_CHRC_WRITE_WITHOUT_RESP 0x04 +#define BT_GATT_CHRC_WRITE 0x08 +#define BT_GATT_CHRC_NOTIFY 0x10 +#define BT_GATT_CHRC_INDICATE 0x20 +#define BT_GATT_CHRC_AUTH 0x40 +#define BT_GATT_CHRC_EXT_PROP 0x80 + #endif // MICROPY_INCLUDED_SHARED_MODULE_BLEIO_CHARACTERISTIC_H From ce9bc1258a1579ed05c6fbedfb5cb11ba6eb6a4c Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 8 Aug 2020 11:37:49 -0500 Subject: [PATCH 0519/1293] =?UTF-8?q?support=5Fmatrix.rst:=20pre-process?= =?UTF-8?q?=20space=20chars=20in=20internal=20link=20names;=20would=20caus?= =?UTF-8?q?e=20a=20no-id=20situation=20when=20names=20like=20'ndGarage[n?= =?UTF-8?q?=C2=B0]=20Bit6:=20FeatherSnow-v2'=20were=20parsed.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared-bindings/support_matrix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/support_matrix.rst b/shared-bindings/support_matrix.rst index e77d15162b..1b75e02567 100644 --- a/shared-bindings/support_matrix.rst +++ b/shared-bindings/support_matrix.rst @@ -14,7 +14,7 @@ capable board. - Modules Available {% for key, value in support_matrix|dictsort %} - {{ '.. _' ~ key ~ ':' }} + {{ '.. _' ~ key|replace(" ", "-") ~ ':' }} * - {{ key }} - {{ '`' ~ value|join("`, `") ~ '`' }} From 00a3a25b945605dd47e56476f0545a50d9f542d3 Mon Sep 17 00:00:00 2001 From: Roy Hooper Date: Sat, 8 Aug 2020 18:40:45 -0400 Subject: [PATCH 0520/1293] revert error to avoid translation changes --- locale/circuitpython.pot | 7 ++----- shared-bindings/_pixelbuf/PixelBuf.c | 4 +--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index fb9869bd46..f1f6bec5bc 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-04 18:42-0500\n" +"POT-Creation-Date: 2020-08-08 18:40-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1942,6 +1942,7 @@ msgid "can't assign to expression" msgstr "" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -3139,10 +3140,6 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "tuple/list required on RHS" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index ee7dac4b38..758801e516 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -333,9 +333,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp size_t num_items = mp_obj_get_int(mp_obj_len(value)); if (num_items != slice_len && num_items != (slice_len * common_hal__pixelbuf_pixelbuf_get_bpp(self_in))) { - mp_raise_ValueError_varg(translate("Unmatched number of items on RHS (expected %d or %d, got %d)."), - slice_len, slice_len * common_hal__pixelbuf_pixelbuf_get_bpp(self_in), - num_items); + mp_raise_ValueError_varg(translate("Unmatched number of items on RHS (expected %d, got %d)."), slice_len, num_items); } common_hal__pixelbuf_pixelbuf_set_pixels(self_in, slice.start, slice.step, slice_len, value, num_items != slice_len); From 71698c5d469e5237db3592f0120396a46405729e Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Sat, 8 Aug 2020 10:44:20 +0000 Subject: [PATCH 0521/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (773 of 773 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 976bab0ca5..02d4a5d896 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: 2020-08-04 18:42-0500\n" -"PO-Revision-Date: 2020-07-31 14:41+0000\n" +"PO-Revision-Date: 2020-08-09 11:32+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -82,7 +82,7 @@ msgstr "O índice %q está fora do intervalo" #: py/obj.c msgid "%q indices must be integers, not %q" -msgstr "" +msgstr "Os indicadores %q devem ser inteiros, não %q" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -122,39 +122,39 @@ msgstr "'%q' argumento(s) requerido(s)" #: py/runtime.c msgid "'%q' object cannot assign attribute '%q'" -msgstr "" +msgstr "O objeto '%q' não pode definir o atributo '%q'" #: py/proto.c msgid "'%q' object does not support '%q'" -msgstr "" +msgstr "O objeto '%q' não suporta '%q'" #: py/obj.c msgid "'%q' object does not support item assignment" -msgstr "" +msgstr "O objeto '%q' não suporta a atribuição do item" #: py/obj.c msgid "'%q' object does not support item deletion" -msgstr "" +msgstr "O objeto '%q' não suporta exclusão dos itens" #: py/runtime.c msgid "'%q' object has no attribute '%q'" -msgstr "" +msgstr "Objeto '%q' não possui qualquer atributo '%q'" #: py/runtime.c msgid "'%q' object is not an iterator" -msgstr "" +msgstr "O objeto '%q' não é um iterador" #: py/objtype.c py/runtime.c msgid "'%q' object is not callable" -msgstr "" +msgstr "O objeto '%s' não é invocável" #: py/runtime.c msgid "'%q' object is not iterable" -msgstr "" +msgstr "O objeto '%q' não é iterável" #: py/obj.c msgid "'%q' object is not subscriptable" -msgstr "" +msgstr "O objeto '%q' não é subscritível" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -1262,7 +1262,7 @@ msgstr "Não está jogando" #: main.c msgid "Not running saved code.\n" -msgstr "" +msgstr "O código salvo não está em execução.\n" #: shared-bindings/util.c msgid "" @@ -1437,7 +1437,7 @@ msgstr "A entrada da linha deve ser digitalio.DigitalInOut" #: main.c msgid "Running in safe mode! " -msgstr "" +msgstr "Executando no modo de segurança! " #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1824,7 +1824,7 @@ msgstr "O __init__() deve retornar Nenhum" #: py/objtype.c msgid "__init__() should return None, not '%q'" -msgstr "" +msgstr "O __init__() deve retornar Nenhum, não '%q'" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -2011,7 +2011,7 @@ msgstr "a expressão não pode ser atribuída" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert %q to %q" -msgstr "" +msgstr "não é possível converter %q para %q" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" @@ -2019,7 +2019,7 @@ msgstr "não é possível converter implicitamente o objeto '%q' para %q" #: py/obj.c msgid "can't convert to %q" -msgstr "" +msgstr "não é possível converter para %q" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2847,7 +2847,7 @@ msgstr "a quantidade dos pontos deve ser pelo menos 2" #: py/obj.c msgid "object '%q' is not a tuple or list" -msgstr "" +msgstr "o objeto '%q' não é uma tupla ou uma lista" #: py/obj.c msgid "object does not support item assignment" @@ -2883,7 +2883,7 @@ msgstr "objeto não iterável" #: py/obj.c msgid "object of type '%q' has no len()" -msgstr "" +msgstr "o objeto do tipo '%q' não tem len()" #: py/obj.c msgid "object with buffer protocol required" @@ -2983,7 +2983,7 @@ msgstr "o polígono só pode ser registrado em um pai" #: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c #: shared-bindings/ps2io/Ps2.c msgid "pop from empty %q" -msgstr "" +msgstr "pop a partir do %q vazio" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3142,7 +3142,7 @@ msgstr "a operação do fluxo não é compatível" #: py/objstrunicode.c msgid "string indices must be integers, not %q" -msgstr "" +msgstr "a sequência dos índices devem ser inteiros, não %q" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3289,7 +3289,7 @@ msgstr "especificador de conversão desconhecido %c" #: py/objstr.c msgid "unknown format code '%c' for object of type '%q'" -msgstr "" +msgstr "o formato do código '%c' é desconhecido para o objeto do tipo '%q'" #: py/compile.c msgid "unknown type" @@ -3329,7 +3329,7 @@ msgstr "o caractere do formato não é compatível '%c' (0x%x) no índice %d" #: py/runtime.c msgid "unsupported type for %q: '%q'" -msgstr "" +msgstr "tipo sem suporte para %q: '%q'" #: py/runtime.c msgid "unsupported type for operator" @@ -3337,7 +3337,7 @@ msgstr "tipo não compatível para o operador" #: py/runtime.c msgid "unsupported types for %q: '%q', '%q'" -msgstr "" +msgstr "tipo sem suporte para %q: '%q', '%q'" #: py/objint.c #, c-format From 5f60bec85b69106fcee6d5bc9cad0c617e690c14 Mon Sep 17 00:00:00 2001 From: Jerry Needell Date: Sun, 9 Aug 2020 11:07:41 -0400 Subject: [PATCH 0522/1293] update frozen Adafruit_CircutPython_RFM9x library --- frozen/Adafruit_CircuitPython_RFM9x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frozen/Adafruit_CircuitPython_RFM9x b/frozen/Adafruit_CircuitPython_RFM9x index b3d270f743..cfffc23378 160000 --- a/frozen/Adafruit_CircuitPython_RFM9x +++ b/frozen/Adafruit_CircuitPython_RFM9x @@ -1 +1 @@ -Subproject commit b3d270f743fafa0ed4b3374fadcea350f05be0b8 +Subproject commit cfffc233784961929d722ea4e9acfe5786790609 From 1d410bb68b3630984804f12ebc4d8194410eb87f Mon Sep 17 00:00:00 2001 From: George Waters Date: Wed, 22 Jul 2020 14:06:04 -0400 Subject: [PATCH 0523/1293] Fix repl support for unicode Currently when a utf8 character that is bigger than 1 byte is typed in the repl, it isn't handled how it should be. If you try to move the cursor in any direction the text gets messed up. This fixes that. --- lib/mp-readline/readline.c | 89 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 3 deletions(-) diff --git a/lib/mp-readline/readline.c b/lib/mp-readline/readline.c index 432413d501..95a810e839 100644 --- a/lib/mp-readline/readline.c +++ b/lib/mp-readline/readline.c @@ -100,6 +100,7 @@ STATIC readline_t rl; int readline_process_char(int c) { size_t last_line_len = rl.line->len; + int cont_chars = 0; int redraw_step_back = 0; bool redraw_from_cursor = false; int redraw_step_forward = 0; @@ -178,6 +179,13 @@ int readline_process_char(int c) { int nspace = 1; #endif + // Check if we have moved into a UTF-8 continuation byte + while (UTF8_IS_CONT(rl.line->buf[rl.cursor_pos-nspace]) && + rl.cursor_pos-nspace > rl.orig_line_len) { + nspace++; + cont_chars++; + } + // do the backspace vstr_cut_out_bytes(rl.line, rl.cursor_pos - nspace, nspace); // set redraw parameters @@ -206,12 +214,37 @@ int readline_process_char(int c) { redraw_step_forward = compl_len; } #endif - } else if (32 <= c ) { + } else if (32 <= c && c <= 126) { // printable character vstr_ins_char(rl.line, rl.cursor_pos, c); // set redraw parameters redraw_from_cursor = true; redraw_step_forward = 1; + }else if (c >= 128) { + // utf-8 character + if (c >= 0xc0 && c < 0xf8) { + // First Code Point + vstr_ins_char(rl.line, rl.cursor_pos, c); + }else if (UTF8_IS_CONT(c)) { + char fcp = rl.line->buf[rl.cursor_pos]; + if (fcp >= 0xc0 && fcp < 0xf8) { + int need = (0xe5 >> ((fcp >> 3) & 0x6)) & 3; // From unicode.c L195 + cont_chars++; + while (UTF8_IS_CONT(rl.line->buf[rl.cursor_pos+cont_chars]) && + rl.cursor_pos+cont_chars < rl.line->len && cont_chars < need) { + cont_chars++; + } + vstr_ins_char(rl.line, rl.cursor_pos+cont_chars, c); + if (cont_chars == need) { + redraw_from_cursor = true; + redraw_step_forward = cont_chars+1; + } + }else{ + //ignore, for now (invalid first code point) + } + }else { + // ignore, invalid + } } } else if (rl.escape_seq == ESEQ_ESC) { switch (c) { @@ -237,6 +270,12 @@ up_arrow_key: #endif // up arrow if (rl.hist_cur + 1 < (int)READLINE_HIST_SIZE && MP_STATE_PORT(readline_hist)[rl.hist_cur + 1] != NULL) { + for (char *ch = rl.line->buf+rl.cursor_pos-1; ch > rl.line->buf+rl.orig_line_len; ch--) { + // printf("char: %d\n", ch); + if (UTF8_IS_CONT(*ch)) { + cont_chars++; + } + } // increase hist num rl.hist_cur += 1; // set line to history @@ -253,6 +292,12 @@ down_arrow_key: #endif // down arrow if (rl.hist_cur >= 0) { + for (char *ch = rl.line->buf+rl.cursor_pos-1; ch > rl.line->buf+rl.orig_line_len; ch--) { + // printf("char: %d\n", ch); + if (UTF8_IS_CONT(*ch)) { + cont_chars++; + } + } // decrease hist num rl.hist_cur -= 1; // set line to history @@ -272,6 +317,12 @@ right_arrow_key: // right arrow if (rl.cursor_pos < rl.line->len) { redraw_step_forward = 1; + // Check if we have moved into a UTF-8 continuation byte + while (UTF8_IS_CONT(rl.line->buf[rl.cursor_pos+redraw_step_forward]) && + rl.cursor_pos+redraw_step_forward < rl.line->len) { + redraw_step_forward++; + cont_chars++; + } } } else if (c == 'D') { #if MICROPY_REPL_EMACS_KEYS @@ -280,6 +331,12 @@ left_arrow_key: // left arrow if (rl.cursor_pos > rl.orig_line_len) { redraw_step_back = 1; + // Check if we have moved into a UTF-8 continuation byte + while (UTF8_IS_CONT(rl.line->buf[rl.cursor_pos-redraw_step_back]) && + rl.cursor_pos-redraw_step_back > rl.orig_line_len) { + redraw_step_back++; + cont_chars++; + } } } else if (c == 'H') { // home @@ -295,9 +352,21 @@ left_arrow_key: if (c == '~') { if (rl.escape_seq_buf[0] == '1' || rl.escape_seq_buf[0] == '7') { home_key: + for (char *ch = rl.line->buf+rl.cursor_pos-1; ch > rl.line->buf+rl.orig_line_len; ch--) { + // printf("char: %d\n", ch); + if (UTF8_IS_CONT(*ch)) { + cont_chars++; + } + } redraw_step_back = rl.cursor_pos - rl.orig_line_len; } else if (rl.escape_seq_buf[0] == '4' || rl.escape_seq_buf[0] == '8') { end_key: + for (char *ch = rl.line->buf+rl.cursor_pos-1; ch > rl.line->buf+rl.orig_line_len; ch--) { + // printf("char: %d\n", ch); + if (UTF8_IS_CONT(*ch)) { + cont_chars++; + } + } redraw_step_forward = rl.line->len - rl.cursor_pos; } else if (rl.escape_seq_buf[0] == '3') { // delete @@ -331,7 +400,7 @@ delete_key: // redraw command prompt, efficiently if (redraw_step_back > 0) { - mp_hal_move_cursor_back(redraw_step_back); + mp_hal_move_cursor_back(redraw_step_back-cont_chars); rl.cursor_pos -= redraw_step_back; } if (redraw_from_cursor) { @@ -339,10 +408,24 @@ delete_key: // erase old chars mp_hal_erase_line_from_cursor(last_line_len - rl.cursor_pos); } + // Check if we have moved into a UTF-8 continuation byte + // while (rl.cursor_pos+redraw_step_forward < rl.line->len && + // UTF8_IS_CONT(rl.line->buf[rl.cursor_pos]) && rl.cursor_pos > 0) { + // rl.cursor_pos--; + // redraw_step_forward++; + // } + + cont_chars = 0; + for (char *ch = rl.line->buf+rl.cursor_pos+redraw_step_forward; ch < rl.line->buf+rl.line->len; ch++) { + // printf("char: %d\n", ch); + if (UTF8_IS_CONT(*ch)) { + cont_chars++; + } + } // draw new chars mp_hal_stdout_tx_strn(rl.line->buf + rl.cursor_pos, rl.line->len - rl.cursor_pos); // move cursor forward if needed (already moved forward by length of line, so move it back) - mp_hal_move_cursor_back(rl.line->len - (rl.cursor_pos + redraw_step_forward)); + mp_hal_move_cursor_back(rl.line->len - (rl.cursor_pos + redraw_step_forward) - cont_chars); rl.cursor_pos += redraw_step_forward; } else if (redraw_step_forward > 0) { // draw over old chars to move cursor forwards From 71ce480dbbf8999b964214a5465640ffa038a0c2 Mon Sep 17 00:00:00 2001 From: George Waters Date: Sun, 2 Aug 2020 21:26:09 -0400 Subject: [PATCH 0524/1293] Refactor utf-8 code, reduce impact on code size --- lib/mp-readline/readline.c | 88 +++++++++++++------------------------- 1 file changed, 29 insertions(+), 59 deletions(-) diff --git a/lib/mp-readline/readline.c b/lib/mp-readline/readline.c index 95a810e839..042694162f 100644 --- a/lib/mp-readline/readline.c +++ b/lib/mp-readline/readline.c @@ -92,12 +92,21 @@ typedef struct _readline_t { int escape_seq; int hist_cur; size_t cursor_pos; + uint8_t utf8_cont_chars; char escape_seq_buf[1]; const char *prompt; } readline_t; STATIC readline_t rl; +int readline_count_cont_byte(char *start, char *end) { + int count = 0; + for (char *pos = start; pos < end; pos++) { + count += UTF8_IS_CONT(*pos); + } + return count; +} + int readline_process_char(int c) { size_t last_line_len = rl.line->len; int cont_chars = 0; @@ -180,8 +189,7 @@ int readline_process_char(int c) { #endif // Check if we have moved into a UTF-8 continuation byte - while (UTF8_IS_CONT(rl.line->buf[rl.cursor_pos-nspace]) && - rl.cursor_pos-nspace > rl.orig_line_len) { + while (UTF8_IS_CONT(rl.line->buf[rl.cursor_pos-nspace])) { nspace++; cont_chars++; } @@ -223,27 +231,23 @@ int readline_process_char(int c) { }else if (c >= 128) { // utf-8 character if (c >= 0xc0 && c < 0xf8) { - // First Code Point + // Lead code point vstr_ins_char(rl.line, rl.cursor_pos, c); + rl.utf8_cont_chars = 0; }else if (UTF8_IS_CONT(c)) { - char fcp = rl.line->buf[rl.cursor_pos]; - if (fcp >= 0xc0 && fcp < 0xf8) { - int need = (0xe5 >> ((fcp >> 3) & 0x6)) & 3; // From unicode.c L195 - cont_chars++; - while (UTF8_IS_CONT(rl.line->buf[rl.cursor_pos+cont_chars]) && - rl.cursor_pos+cont_chars < rl.line->len && cont_chars < need) { - cont_chars++; - } - vstr_ins_char(rl.line, rl.cursor_pos+cont_chars, c); - if (cont_chars == need) { + char lcp = rl.line->buf[rl.cursor_pos]; + // Check for valid lead code point + if (lcp >= 0xc0 && lcp < 0xf8) { + rl.utf8_cont_chars += 1; + vstr_ins_char(rl.line, rl.cursor_pos+rl.utf8_cont_chars, c); + // set redraw parameters if we have the entire character + uint8_t need = (0xe5 >> ((lcp >> 3) & 0x6)) & 3; // From unicode.c L195 + if (rl.utf8_cont_chars == need) { redraw_from_cursor = true; - redraw_step_forward = cont_chars+1; + redraw_step_forward = rl.utf8_cont_chars+1; + cont_chars = rl.utf8_cont_chars; } - }else{ - //ignore, for now (invalid first code point) } - }else { - // ignore, invalid } } } else if (rl.escape_seq == ESEQ_ESC) { @@ -270,12 +274,8 @@ up_arrow_key: #endif // up arrow if (rl.hist_cur + 1 < (int)READLINE_HIST_SIZE && MP_STATE_PORT(readline_hist)[rl.hist_cur + 1] != NULL) { - for (char *ch = rl.line->buf+rl.cursor_pos-1; ch > rl.line->buf+rl.orig_line_len; ch--) { - // printf("char: %d\n", ch); - if (UTF8_IS_CONT(*ch)) { - cont_chars++; - } - } + // Check for continuation characters through the cursor_pos + cont_chars = readline_count_cont_byte(rl.line->buf+rl.orig_line_len, rl.line->buf+rl.cursor_pos); // increase hist num rl.hist_cur += 1; // set line to history @@ -292,12 +292,8 @@ down_arrow_key: #endif // down arrow if (rl.hist_cur >= 0) { - for (char *ch = rl.line->buf+rl.cursor_pos-1; ch > rl.line->buf+rl.orig_line_len; ch--) { - // printf("char: %d\n", ch); - if (UTF8_IS_CONT(*ch)) { - cont_chars++; - } - } + // Check for continuation characters through the cursor_pos + cont_chars = readline_count_cont_byte(rl.line->buf+rl.orig_line_len, rl.line->buf+rl.cursor_pos); // decrease hist num rl.hist_cur -= 1; // set line to history @@ -321,7 +317,6 @@ right_arrow_key: while (UTF8_IS_CONT(rl.line->buf[rl.cursor_pos+redraw_step_forward]) && rl.cursor_pos+redraw_step_forward < rl.line->len) { redraw_step_forward++; - cont_chars++; } } } else if (c == 'D') { @@ -332,8 +327,7 @@ left_arrow_key: if (rl.cursor_pos > rl.orig_line_len) { redraw_step_back = 1; // Check if we have moved into a UTF-8 continuation byte - while (UTF8_IS_CONT(rl.line->buf[rl.cursor_pos-redraw_step_back]) && - rl.cursor_pos-redraw_step_back > rl.orig_line_len) { + while (UTF8_IS_CONT(rl.line->buf[rl.cursor_pos-redraw_step_back])) { redraw_step_back++; cont_chars++; } @@ -352,21 +346,9 @@ left_arrow_key: if (c == '~') { if (rl.escape_seq_buf[0] == '1' || rl.escape_seq_buf[0] == '7') { home_key: - for (char *ch = rl.line->buf+rl.cursor_pos-1; ch > rl.line->buf+rl.orig_line_len; ch--) { - // printf("char: %d\n", ch); - if (UTF8_IS_CONT(*ch)) { - cont_chars++; - } - } redraw_step_back = rl.cursor_pos - rl.orig_line_len; } else if (rl.escape_seq_buf[0] == '4' || rl.escape_seq_buf[0] == '8') { end_key: - for (char *ch = rl.line->buf+rl.cursor_pos-1; ch > rl.line->buf+rl.orig_line_len; ch--) { - // printf("char: %d\n", ch); - if (UTF8_IS_CONT(*ch)) { - cont_chars++; - } - } redraw_step_forward = rl.line->len - rl.cursor_pos; } else if (rl.escape_seq_buf[0] == '3') { // delete @@ -408,20 +390,8 @@ delete_key: // erase old chars mp_hal_erase_line_from_cursor(last_line_len - rl.cursor_pos); } - // Check if we have moved into a UTF-8 continuation byte - // while (rl.cursor_pos+redraw_step_forward < rl.line->len && - // UTF8_IS_CONT(rl.line->buf[rl.cursor_pos]) && rl.cursor_pos > 0) { - // rl.cursor_pos--; - // redraw_step_forward++; - // } - - cont_chars = 0; - for (char *ch = rl.line->buf+rl.cursor_pos+redraw_step_forward; ch < rl.line->buf+rl.line->len; ch++) { - // printf("char: %d\n", ch); - if (UTF8_IS_CONT(*ch)) { - cont_chars++; - } - } + // Check for continuation characters from the new cursor_pos to the EOL + cont_chars = readline_count_cont_byte(rl.line->buf+rl.cursor_pos+redraw_step_forward, rl.line->buf+rl.line->len); // draw new chars mp_hal_stdout_tx_strn(rl.line->buf + rl.cursor_pos, rl.line->len - rl.cursor_pos); // move cursor forward if needed (already moved forward by length of line, so move it back) From 41ccbbd4e92437a5d4153759e244067a869da277 Mon Sep 17 00:00:00 2001 From: George Waters Date: Sun, 2 Aug 2020 21:41:23 -0400 Subject: [PATCH 0525/1293] Fix failed unix build --- lib/mp-readline/readline.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/mp-readline/readline.c b/lib/mp-readline/readline.c index 042694162f..070fb86765 100644 --- a/lib/mp-readline/readline.c +++ b/lib/mp-readline/readline.c @@ -58,6 +58,14 @@ STATIC char *str_dup_maybe(const char *str) { return s2; } +STATIC int count_cont_bytes(char *start, char *end) { + int count = 0; + for (char *pos = start; pos < end; pos++) { + count += UTF8_IS_CONT(*pos); + } + return count; +} + // By default assume terminal which implements VT100 commands... #ifndef MICROPY_HAL_HAS_VT100 #define MICROPY_HAL_HAS_VT100 (1) @@ -99,14 +107,6 @@ typedef struct _readline_t { STATIC readline_t rl; -int readline_count_cont_byte(char *start, char *end) { - int count = 0; - for (char *pos = start; pos < end; pos++) { - count += UTF8_IS_CONT(*pos); - } - return count; -} - int readline_process_char(int c) { size_t last_line_len = rl.line->len; int cont_chars = 0; @@ -275,7 +275,7 @@ up_arrow_key: // up arrow if (rl.hist_cur + 1 < (int)READLINE_HIST_SIZE && MP_STATE_PORT(readline_hist)[rl.hist_cur + 1] != NULL) { // Check for continuation characters through the cursor_pos - cont_chars = readline_count_cont_byte(rl.line->buf+rl.orig_line_len, rl.line->buf+rl.cursor_pos); + cont_chars = count_cont_bytes(rl.line->buf+rl.orig_line_len, rl.line->buf+rl.cursor_pos); // increase hist num rl.hist_cur += 1; // set line to history @@ -293,7 +293,7 @@ down_arrow_key: // down arrow if (rl.hist_cur >= 0) { // Check for continuation characters through the cursor_pos - cont_chars = readline_count_cont_byte(rl.line->buf+rl.orig_line_len, rl.line->buf+rl.cursor_pos); + cont_chars = count_cont_bytes(rl.line->buf+rl.orig_line_len, rl.line->buf+rl.cursor_pos); // decrease hist num rl.hist_cur -= 1; // set line to history @@ -391,7 +391,7 @@ delete_key: mp_hal_erase_line_from_cursor(last_line_len - rl.cursor_pos); } // Check for continuation characters from the new cursor_pos to the EOL - cont_chars = readline_count_cont_byte(rl.line->buf+rl.cursor_pos+redraw_step_forward, rl.line->buf+rl.line->len); + cont_chars = count_cont_bytes(rl.line->buf+rl.cursor_pos+redraw_step_forward, rl.line->buf+rl.line->len); // draw new chars mp_hal_stdout_tx_strn(rl.line->buf + rl.cursor_pos, rl.line->len - rl.cursor_pos); // move cursor forward if needed (already moved forward by length of line, so move it back) From 93829e57b22831fecbcceb2970753bc4668d5e70 Mon Sep 17 00:00:00 2001 From: George Waters Date: Mon, 3 Aug 2020 15:09:54 -0400 Subject: [PATCH 0526/1293] Try too make new utf-8 code smaller again --- lib/mp-readline/readline.c | 48 +++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/lib/mp-readline/readline.c b/lib/mp-readline/readline.c index 070fb86765..78295bd098 100644 --- a/lib/mp-readline/readline.c +++ b/lib/mp-readline/readline.c @@ -222,32 +222,26 @@ int readline_process_char(int c) { redraw_step_forward = compl_len; } #endif - } else if (32 <= c && c <= 126) { + } else if (32 <= c) { // printable character - vstr_ins_char(rl.line, rl.cursor_pos, c); - // set redraw parameters - redraw_from_cursor = true; - redraw_step_forward = 1; - }else if (c >= 128) { - // utf-8 character - if (c >= 0xc0 && c < 0xf8) { - // Lead code point - vstr_ins_char(rl.line, rl.cursor_pos, c); + char lcp = rl.line->buf[rl.cursor_pos]; + uint8_t cont_need = 0; + if (!UTF8_IS_CONT(c)) { + // ASCII or Lead code point rl.utf8_cont_chars = 0; - }else if (UTF8_IS_CONT(c)) { - char lcp = rl.line->buf[rl.cursor_pos]; - // Check for valid lead code point - if (lcp >= 0xc0 && lcp < 0xf8) { - rl.utf8_cont_chars += 1; - vstr_ins_char(rl.line, rl.cursor_pos+rl.utf8_cont_chars, c); - // set redraw parameters if we have the entire character - uint8_t need = (0xe5 >> ((lcp >> 3) & 0x6)) & 3; // From unicode.c L195 - if (rl.utf8_cont_chars == need) { - redraw_from_cursor = true; - redraw_step_forward = rl.utf8_cont_chars+1; - cont_chars = rl.utf8_cont_chars; - } - } + lcp = c; + }else { + rl.utf8_cont_chars += 1; + } + if (lcp >= 0xc0 && lcp < 0xf8) { + cont_need = (0xe5 >> ((lcp >> 3) & 0x6)) & 3; // From unicode.c L195 + } + vstr_ins_char(rl.line, rl.cursor_pos+rl.utf8_cont_chars, c); + // set redraw parameters if we have the entire character + if (rl.utf8_cont_chars == cont_need) { + redraw_from_cursor = true; + redraw_step_forward = rl.utf8_cont_chars+1; + cont_chars = rl.utf8_cont_chars; } } } else if (rl.escape_seq == ESEQ_ESC) { @@ -274,7 +268,7 @@ up_arrow_key: #endif // up arrow if (rl.hist_cur + 1 < (int)READLINE_HIST_SIZE && MP_STATE_PORT(readline_hist)[rl.hist_cur + 1] != NULL) { - // Check for continuation characters through the cursor_pos + // Check for continuation characters cont_chars = count_cont_bytes(rl.line->buf+rl.orig_line_len, rl.line->buf+rl.cursor_pos); // increase hist num rl.hist_cur += 1; @@ -292,7 +286,7 @@ down_arrow_key: #endif // down arrow if (rl.hist_cur >= 0) { - // Check for continuation characters through the cursor_pos + // Check for continuation characters cont_chars = count_cont_bytes(rl.line->buf+rl.orig_line_len, rl.line->buf+rl.cursor_pos); // decrease hist num rl.hist_cur -= 1; @@ -390,7 +384,7 @@ delete_key: // erase old chars mp_hal_erase_line_from_cursor(last_line_len - rl.cursor_pos); } - // Check for continuation characters from the new cursor_pos to the EOL + // Check for continuation characters cont_chars = count_cont_bytes(rl.line->buf+rl.cursor_pos+redraw_step_forward, rl.line->buf+rl.line->len); // draw new chars mp_hal_stdout_tx_strn(rl.line->buf + rl.cursor_pos, rl.line->len - rl.cursor_pos); From 398be76bf6311f1667141051e38e3feced1d75fc Mon Sep 17 00:00:00 2001 From: George Waters Date: Sun, 9 Aug 2020 14:06:49 -0400 Subject: [PATCH 0527/1293] Count utf8 chars, not every byte for line --- lib/mp-readline/readline.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/mp-readline/readline.c b/lib/mp-readline/readline.c index 78295bd098..464916ca4e 100644 --- a/lib/mp-readline/readline.c +++ b/lib/mp-readline/readline.c @@ -58,10 +58,12 @@ STATIC char *str_dup_maybe(const char *str) { return s2; } -STATIC int count_cont_bytes(char *start, char *end) { +STATIC size_t count_cont_bytes(char *start, char *end) { int count = 0; for (char *pos = start; pos < end; pos++) { - count += UTF8_IS_CONT(*pos); + if(UTF8_IS_CONT(*pos)) { + count++; + } } return count; } @@ -108,7 +110,7 @@ typedef struct _readline_t { STATIC readline_t rl; int readline_process_char(int c) { - size_t last_line_len = rl.line->len; + size_t last_line_len = utf8_charlen((byte *)rl.line->buf, rl.line->len); int cont_chars = 0; int redraw_step_back = 0; bool redraw_from_cursor = false; @@ -380,7 +382,7 @@ delete_key: rl.cursor_pos -= redraw_step_back; } if (redraw_from_cursor) { - if (rl.line->len < last_line_len) { + if (utf8_charlen((byte *)rl.line->buf, rl.line->len) < last_line_len) { // erase old chars mp_hal_erase_line_from_cursor(last_line_len - rl.cursor_pos); } From ef1782f85e9020a01658d28708b44444915f74b2 Mon Sep 17 00:00:00 2001 From: Roy Hooper Date: Mon, 10 Aug 2020 12:04:44 -0400 Subject: [PATCH 0528/1293] fix trailing whitespace --- shared-bindings/_pixelbuf/PixelBuf.c | 2 +- shared-module/_pixelbuf/PixelBuf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 758801e516..1ffca7edf4 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -331,7 +331,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp #if MICROPY_PY_ARRAY_SLICE_ASSIGN size_t num_items = mp_obj_get_int(mp_obj_len(value)); - + if (num_items != slice_len && num_items != (slice_len * common_hal__pixelbuf_pixelbuf_get_bpp(self_in))) { mp_raise_ValueError_varg(translate("Unmatched number of items on RHS (expected %d, got %d)."), slice_len, num_items); } diff --git a/shared-module/_pixelbuf/PixelBuf.c b/shared-module/_pixelbuf/PixelBuf.c index 50906fcc1d..0dc2a5ab8f 100644 --- a/shared-module/_pixelbuf/PixelBuf.c +++ b/shared-module/_pixelbuf/PixelBuf.c @@ -139,7 +139,7 @@ uint8_t _pixelbuf_get_as_uint8(mp_obj_t obj) { return mp_obj_get_int_truncated(obj); } else if (mp_obj_is_float(obj)) { return (uint8_t)mp_obj_get_float(obj); - } + } mp_raise_TypeError_varg( translate("can't convert %q to %q"), mp_obj_get_type_qstr(obj), MP_QSTR_int); } From 8a9a44731b3dd2e4e2c8e7cea412d3a164d043e2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 9 Aug 2020 23:42:13 +0200 Subject: [PATCH 0529/1293] Added translation using Weblate (Japanese) --- locale/ja.po | 3326 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 3326 insertions(+) create mode 100644 locale/ja.po diff --git a/locale/ja.po b/locale/ja.po new file mode 100644 index 0000000000..09e7375580 --- /dev/null +++ b/locale/ja.po @@ -0,0 +1,3326 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-08-04 18:42-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: main.c +msgid "" +"\n" +"Code done running. Waiting for reload.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + +#: py/obj.c +msgid " File \"%q\"" +msgstr "" + +#: py/obj.c +msgid " File \"%q\", line %d" +msgstr "" + +#: main.c +msgid " output:\n" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "%%c requires int or char" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q in use" +msgstr "" + +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c +msgid "%q index out of range" +msgstr "" + +#: py/obj.c +msgid "%q indices must be integers, not %q" +msgstr "" + +#: shared-bindings/vectorio/Polygon.c +msgid "%q list must be a list" +msgstr "" + +#: shared-bindings/memorymonitor/AllocationAlarm.c +msgid "%q must be >= 0" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c +#: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm.c +#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c +msgid "%q must be >= 1" +msgstr "" + +#: shared-module/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + +#: shared-bindings/fontio/BuiltinFont.c +msgid "%q should be an int" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "%q() takes %d positional arguments but %d were given" +msgstr "" + +#: py/argcheck.c +msgid "'%q' argument required" +msgstr "" + +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects a label" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects a register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects a special register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects an FPU register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects an address of the form [a, b]" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects an integer" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects at most r%d" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects {r0, r1, ...}" +msgstr "" + +#: py/emitinlinextensa.c +#, c-format +msgid "'%s' integer %d is not within range %d..%d" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' integer 0x%x does not fit in mask 0x%x" +msgstr "" + +#: py/objstr.c +msgid "'=' alignment not allowed in string format specifier" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "'S' and 'O' are not supported format types" +msgstr "" + +#: py/compile.c +msgid "'align' requires 1 argument" +msgstr "" + +#: py/compile.c +msgid "'await' outside function" +msgstr "" + +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + +#: py/compile.c +msgid "'break' outside loop" +msgstr "" + +#: py/compile.c +msgid "'continue' outside loop" +msgstr "" + +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + +#: py/compile.c +msgid "'data' requires at least 2 arguments" +msgstr "" + +#: py/compile.c +msgid "'data' requires integer arguments" +msgstr "" + +#: py/compile.c +msgid "'label' requires 1 argument" +msgstr "" + +#: py/compile.c +msgid "'return' outside function" +msgstr "" + +#: py/compile.c +msgid "'yield' outside function" +msgstr "" + +#: py/compile.c +msgid "*x must be assignment target" +msgstr "" + +#: py/obj.c +msgid ", in %q\n" +msgstr "" + +#: py/objcomplex.c +msgid "0.0 to a complex power" +msgstr "" + +#: py/modbuiltins.c +msgid "3-arg pow() not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/countio/Counter.c +#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +msgid "A hardware interrupt channel is already in use" +msgstr "" + +#: shared-bindings/_bleio/Address.c +#, c-format +msgid "Address must be %d bytes long" +msgstr "" + +#: shared-bindings/_bleio/Address.c +msgid "Address type out of range" +msgstr "" + +#: ports/nrf/common-hal/busio/I2C.c +msgid "All I2C peripherals are in use" +msgstr "" + +#: ports/nrf/common-hal/busio/SPI.c +msgid "All SPI peripherals are in use" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +msgid "All UART peripherals are in use" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "All event channels in use" +msgstr "" + +#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "All sync event channels in use" +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "All timers for this pin are in use" +msgstr "" + +#: ports/atmel-samd/common-hal/_pew/PewPew.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +msgid "All timers in use" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Already advertising." +msgstr "" + +#: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize.c +msgid "Already running" +msgstr "" + +#: ports/cxd56/common-hal/analogio/AnalogIn.c +msgid "AnalogIn not supported on given pin" +msgstr "" + +#: ports/cxd56/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/nrf/common-hal/analogio/AnalogOut.c +msgid "AnalogOut functionality not supported" +msgstr "" + +#: shared-bindings/analogio/AnalogOut.c +msgid "AnalogOut is only 16 bits. Value must be less than 65536." +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogOut.c +msgid "AnalogOut not supported on given pin" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +msgid "Another send is already active" +msgstr "" + +#: shared-bindings/pulseio/PulseOut.c +msgid "Array must contain halfwords (type 'H')" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +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" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Attempted heap allocation when MicroPython VM not running." +msgstr "" + +#: main.c +msgid "Auto-reload is off.\n" +msgstr "" + +#: main.c +msgid "" +"Auto-reload is on. Simply save files over USB to run them or enter REPL to " +"disable.\n" +msgstr "" + +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c +msgid "Below minimum frame rate" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must share a clock unit" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Bit depth must be multiple of 8." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + +#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +msgid "Both pins must support hardware interrupts" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "Brightness must be 0-1.0" +msgstr "" + +#: shared-bindings/supervisor/__init__.c +msgid "Brightness must be between 0 and 255" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Brightness not adjustable" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +#, c-format +msgid "Buffer + offset too small %d %d %d" +msgstr "" + +#: shared-module/usb_hid/Device.c +#, c-format +msgid "Buffer incorrect size. Should be %d bytes." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Buffer is not a bytearray." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Buffer is too small" +msgstr "" + +#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#, c-format +msgid "Buffer length %d too big. It must be less than %d" +msgstr "" + +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + +#: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c +msgid "Buffer must be at least length 1" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Buffer too large and unable to allocate" +msgstr "" + +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + +#: ports/atmel-samd/common-hal/displayio/ParallelBus.c +#: ports/nrf/common-hal/displayio/ParallelBus.c +#, c-format +msgid "Bus pin %d is already in use" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "Byte buffer must be 16 bytes." +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Bytes must be between 0 and 255." +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + +#: py/objtype.c +msgid "Call super().__init__() before accessing native object." +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +msgid "Can't set CCCD on local Characteristic" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c +msgid "Cannot delete values" +msgstr "" + +#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c +#: ports/nrf/common-hal/digitalio/DigitalInOut.c +msgid "Cannot get pull while in output mode" +msgstr "" + +#: ports/nrf/common-hal/microcontroller/Processor.c +msgid "Cannot get temperature" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Cannot output both channels on the same pin" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot read without MISO pin." +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Cannot record to a file" +msgstr "" + +#: shared-module/storage/__init__.c +msgid "Cannot remount '/' when USB is active." +msgstr "" + +#: 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 "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Cannot set value when direction is input." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Cannot specify RTS or CTS in RS485 mode" +msgstr "" + +#: py/objslice.c +msgid "Cannot subclass slice" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot transfer without MOSI and MISO pins." +msgstr "" + +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot write without MOSI pin." +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "CharacteristicBuffer writing not provided" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Clock pin init failed." +msgstr "" + +#: shared-module/bitbangio/I2C.c +msgid "Clock stretch too long" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Clock unit in use" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Column entry must be digitalio.DigitalInOut" +msgstr "" + +#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c +#: shared-bindings/displayio/ParallelBus.c +msgid "Command must be an int between 0 and 255" +msgstr "" + +#: shared-bindings/_bleio/Connection.c +msgid "" +"Connection has been disconnected and can no longer be used. Create a new " +"connection." +msgstr "" + +#: py/persistentcode.c +msgid "Corrupt .mpy file" +msgstr "" + +#: py/emitglue.c +msgid "Corrupt raw code" +msgstr "" + +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +msgid "Could not initialize UART" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate decoder" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate first buffer" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate input buffer" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate second buffer" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Crash into the HardFault_Handler." +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "DAC already in use" +msgstr "" + +#: ports/atmel-samd/common-hal/displayio/ParallelBus.c +#: ports/nrf/common-hal/displayio/ParallelBus.c +msgid "Data 0 pin must be byte aligned" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Data chunk must follow fmt chunk" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Data too large for advertisement packet" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Destination capacity is smaller than destination_length." +msgstr "" + +#: ports/nrf/common-hal/audiobusio/I2SOut.c +msgid "Device in use" +msgstr "" + +#: ports/cxd56/common-hal/digitalio/DigitalInOut.c +msgid "DigitalInOut not supported on given pin" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Display must have a 16 bit colorspace." +msgstr "" + +#: 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 "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Drive mode not used when direction is input." +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +msgid "EXTINT channel already in use" +msgstr "" + +#: extmod/modure.c +msgid "Error in regex" +msgstr "" + +#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/terminalio/Terminal.c +msgid "Expected a %q" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c +msgid "Expected a Characteristic" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c +msgid "Expected a Service" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +#: shared-bindings/_bleio/Service.c +msgid "Expected a UUID" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Expected an Address" +msgstr "" + +#: shared-module/_pixelbuf/PixelBuf.c +#, c-format +msgid "Expected tuple of length %d, got %d" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Extended advertisements with scan response not supported." +msgstr "" + +#: extmod/ulab/code/fft/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + +#: ports/nrf/sd_mutex.c +#, c-format +msgid "Failed to acquire mutex, err 0x%04x" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +msgid "Failed to allocate RX buffer" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c +#, c-format +msgid "Failed to allocate RX buffer of %d bytes" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to connect: internal error" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to connect: timeout" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Failed to parse MP3 file" +msgstr "" + +#: ports/nrf/sd_mutex.c +#, c-format +msgid "Failed to release mutex, err 0x%04x" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + +#: py/moduerrno.c +msgid "File exists" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "Frequency captured is above capability. Capture Paused." +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + +#: 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 "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Group already used" +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Group full" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + +#: extmod/vfs_posix_file.c py/objstringio.c +msgid "I/O operation on closed file" +msgstr "" + +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + +#: py/persistentcode.c +msgid "" +"Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" +"mpy-update for more info." +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Incorrect buffer size" +msgstr "" + +#: py/moduerrno.c +msgid "Input/output error" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Invalid %q pin" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +msgid "Invalid BMP file" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/stm/common-hal/busio/I2C.c +msgid "Invalid I2C pin selection" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PWMOut.c +#: ports/cxd56/common-hal/pulseio/PWMOut.c +#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +msgid "Invalid PWM frequency" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "Invalid SPI pin selection" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid UART pin selection" +msgstr "" + +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c +msgid "Invalid argument" +msgstr "" + +#: shared-module/displayio/Bitmap.c +msgid "Invalid bits per value" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Invalid buffer size" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Invalid byteorder string" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "Invalid capture period. Valid range: 1 - 500" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid channel count" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Invalid direction." +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid file" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid format chunk size" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Invalid memory access." +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +msgid "Invalid number of bits" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c +msgid "Invalid phase" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +msgid "Invalid pin" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Invalid pin for left channel" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Invalid pin for right channel" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/SPI.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +msgid "Invalid pins" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c +msgid "Invalid polarity" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c +msgid "Invalid properties" +msgstr "" + +#: shared-bindings/microcontroller/__init__.c +msgid "Invalid run mode." +msgstr "" + +#: shared-module/_bleio/Attribute.c +msgid "Invalid security_mode" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid voice" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid voice count" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid wave file" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + +#: py/compile.c +msgid "LHS of keyword arg must be an id" +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Layer already in a group." +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Layer must be a Group or TileGrid subclass." +msgstr "" + +#: py/objslice.c +msgid "Length must be an int" +msgstr "" + +#: py/objslice.c +msgid "Length must be non-negative" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "MISO pin init failed." +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "MOSI pin init failed." +msgstr "" + +#: shared-module/displayio/Shape.c +#, c-format +msgid "Maximum x value when mirrored is %d" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "MicroPython NLR jump failed. Likely memory corruption." +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "MicroPython fatal error." +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Microphone startup delay must be in range 0.0 to 1.0" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + +#: shared-bindings/displayio/Group.c +msgid "Must be a %q subclass." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide SCK pin" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + +#: py/parse.c +msgid "Name too long" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +msgid "No CCCD for this Characteristic" +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "No DAC on chip" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "No DMA channel found" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c +msgid "No RX pin" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c +msgid "No TX pin" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "No available clocks" +msgstr "" + +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + +#: shared-bindings/board/__init__.c +msgid "No default %q bus" +msgstr "" + +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +msgid "No free GCLKs" +msgstr "" + +#: shared-bindings/os/__init__.c +msgid "No hardware random available" +msgstr "" + +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "No hardware support on pin" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "No long integer support" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + +#: shared-module/touchio/TouchIn.c +msgid "No pulldown on pin; 1Mohm recommended" +msgstr "" + +#: py/moduerrno.c +msgid "No space left on device" +msgstr "" + +#: py/moduerrno.c +msgid "No such file/directory" +msgstr "" + +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "No timer available" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "Not connected" +msgstr "" + +#: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c +#: shared-bindings/audiopwmio/PWMAudioOut.c +msgid "Not playing" +msgstr "" + +#: main.c +msgid "Not running saved code.\n" +msgstr "" + +#: shared-bindings/util.c +msgid "" +"Object has been deinitialized and can no longer be used. Create a new object." +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +msgid "Odd parity is not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Only 8 or 16 bit mono with " +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +#, c-format +msgid "" +"Only Windows format, uncompressed BMP supported: given header size is %d" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +#, c-format +msgid "" +"Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " +"%d bpp given" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Oversample must be multiple of 8." +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "" +"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "" +"PWM frequency not writable when variable_frequency is False on construction." +msgstr "" + +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c +msgid "ParallelBus not yet supported" +msgstr "" + +#: py/moduerrno.c +msgid "Permission denied" +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogIn.c +#: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c +#: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Pin does not have ADC capabilities" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + +#: py/builtinhelp.c +msgid "Plus any modules on the filesystem\n" +msgstr "" + +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Prefix buffer must be on the heap" +msgstr "" + +#: main.c +msgid "Press any key to enter the REPL. Use CTRL-D to reload." +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pull not used when direction is output." +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "RS485 inversion specified when not in RS485 mode" +msgstr "" + +#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/rtc/RTC.c +msgid "RTC calibration is not supported on this board" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "RTC is not supported on this board" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "RTS/CTS/RS485 Not yet supported on this device" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c +msgid "Read-only" +msgstr "" + +#: extmod/vfs_fat.c py/moduerrno.c +msgid "Read-only filesystem" +msgstr "" + +#: shared-module/displayio/Bitmap.c +msgid "Read-only object" +msgstr "" + +#: shared-bindings/displayio/EPaperDisplay.c +msgid "Refresh too soon" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Right channel unsupported" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Row entry must be digitalio.DigitalInOut" +msgstr "" + +#: main.c +msgid "Running in safe mode! " +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +msgid "SDA or SCL needs a pull up" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Sample rate must be positive" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#, c-format +msgid "Sample rate too high. It must be less than %d" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Scan already in progess. Stop with stop_scan." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Selected CTS pin not valid" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Selected RTS pin not valid" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Serializer in use" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Slice and value different lengths." +msgstr "" + +#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c +#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c +msgid "Slices not supported" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "" + +#: shared-bindings/supervisor/__init__.c +msgid "Stack size must be at least 256" +msgstr "" + +#: shared-bindings/multiterminal/__init__.c +msgid "Stream missing readinto() or write() method." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The CircuitPython heap was corrupted because the stack was too small.\n" +"Please increase the stack size if you know how, or if not:" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The `microcontroller` module was used to boot into safe mode. Press reset to " +"exit safe mode.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The microcontroller's power dipped. Make sure your power supply provides\n" +"enough power for the whole circuit and press reset (after ejecting " +"CIRCUITPY).\n" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's bits_per_sample does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's channel count does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's sample rate does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's signedness does not match the mixer's" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile height must exactly divide bitmap height" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c +msgid "Tile index out of bounds" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile value out of bounds" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile width must exactly divide bitmap width" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +#, c-format +msgid "Timeout is too long: Maximum timeout length is %d seconds" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample." +msgstr "" + +#: shared-module/displayio/__init__.c +msgid "Too many display busses" +msgstr "" + +#: shared-module/displayio/__init__.c +msgid "Too many displays" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + +#: py/obj.c +msgid "Traceback (most recent call last):\n" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "Tuple or struct_time argument required" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + +#: shared-module/usb_hid/Device.c +msgid "USB Busy" +msgstr "" + +#: shared-module/usb_hid/Device.c +msgid "USB Error" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID integer value must be 0-0xffff" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID value is not str, int or byte buffer" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Unable to allocate buffers for signed conversion" +msgstr "" + +#: shared-module/displayio/I2CDisplay.c +#, c-format +msgid "Unable to find I2C Display at %x" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Unable to find free GCLK" +msgstr "" + +#: py/parse.c +msgid "Unable to init parser" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +msgid "Unable to read color palette data" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Unable to write to nvm." +msgstr "" + +#: ports/nrf/common-hal/_bleio/UUID.c +msgid "Unexpected nrfx uuid type" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown security error: 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown soft device error: %04x" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +#, c-format +msgid "Unmatched number of items on RHS (expected %d, got %d)." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "" +"Unspecified issue. Can be that the pairing prompt on the other device was " +"declined or ignored." +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c +msgid "Unsupported baudrate" +msgstr "" + +#: shared-module/displayio/display_core.c +msgid "Unsupported display bus type" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Unsupported format" +msgstr "" + +#: py/moduerrno.c +msgid "Unsupported operation" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Unsupported pull value." +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +msgid "Value length != required fixed length" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +msgid "Value length > max_length" +msgstr "" + +#: py/emitnative.c +msgid "Viper functions don't currently support more than 4 arguments" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + +#: main.c +msgid "WARNING: Your code filename has two extensions\n" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +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 "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + +#: py/builtinhelp.c +#, c-format +msgid "" +"Welcome to Adafruit CircuitPython %s!\n" +"\n" +"Please visit learn.adafruit.com/category/circuitpython for project guides.\n" +"\n" +"To list built-in modules please do `help(\"modules\")`.\n" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Writes not supported on Characteristic" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "You are in safe mode: something unanticipated happened.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "You requested starting safe mode by " +msgstr "" + +#: py/objtype.c +msgid "__init__() should return None" +msgstr "" + +#: py/objtype.c +msgid "__init__() should return None, not '%q'" +msgstr "" + +#: py/objobject.c +msgid "__new__ arg must be a user-type" +msgstr "" + +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c +msgid "a bytes-like object is required" +msgstr "" + +#: lib/embed/abort_.c +msgid "abort() called" +msgstr "" + +#: extmod/machine_mem.c +#, c-format +msgid "address %08x is not aligned to %d bytes" +msgstr "" + +#: shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "address out of bounds" +msgstr "" + +#: shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "addresses is empty" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + +#: py/modbuiltins.c +msgid "arg is an empty sequence" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + +#: py/runtime.c +msgid "argument has wrong type" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + +#: py/argcheck.c shared-bindings/_stage/__init__.c +#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +msgid "argument num/types mismatch" +msgstr "" + +#: py/runtime.c +msgid "argument should be a '%q' not a '%q'" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + +#: py/objarray.c shared-bindings/nvm/ByteArray.c +msgid "array/bytes required on right side" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + +#: py/objstr.c +msgid "attributes not supported yet" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + +#: py/builtinevex.c +msgid "bad compile mode" +msgstr "" + +#: py/objstr.c +msgid "bad conversion specifier" +msgstr "" + +#: py/objstr.c +msgid "bad format string" +msgstr "" + +#: py/binary.c +msgid "bad typecode" +msgstr "" + +#: py/emitnative.c +msgid "binary op %q not implemented" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "bits must be 7, 8 or 9" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "bits_per_sample must be 8 or 16" +msgstr "" + +#: py/emitinlinethumb.c +msgid "branch not in range" +msgstr "" + +#: shared-bindings/audiocore/RawSample.c +msgid "buffer must be a bytes-like object" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "buffer size must match format" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +msgid "buffer slices must be of equal length" +msgstr "" + +#: py/modstruct.c shared-bindings/struct/__init__.c +#: shared-module/struct/__init__.c +msgid "buffer too small" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "buttons must be digitalio.DigitalInOut" +msgstr "" + +#: py/vm.c +msgid "byte code not implemented" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "byteorder is not a string" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +msgid "bytes > 8 bits not supported" +msgstr "" + +#: py/objstr.c +msgid "bytes value out of range" +msgstr "" + +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +msgid "calibration is out of range" +msgstr "" + +#: ports/atmel-samd/bindings/samd/Clock.c +msgid "calibration is read only" +msgstr "" + +#: ports/atmel-samd/common-hal/rtc/RTC.c +msgid "calibration value out of range +/-127" +msgstr "" + +#: py/emitinlinethumb.c +msgid "can only have up to 4 parameters to Thumb assembly" +msgstr "" + +#: py/emitinlinextensa.c +msgid "can only have up to 4 parameters to Xtensa assembly" +msgstr "" + +#: py/persistentcode.c +msgid "can only save bytecode" +msgstr "" + +#: py/objtype.c +msgid "can't add special method to already-subclassed class" +msgstr "" + +#: py/compile.c +msgid "can't assign to expression" +msgstr "" + +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" + +#: py/objstr.c +msgid "can't convert '%q' object to %q implicitly" +msgstr "" + +#: py/obj.c +msgid "can't convert to %q" +msgstr "" + +#: py/objstr.c +msgid "can't convert to str implicitly" +msgstr "" + +#: py/compile.c +msgid "can't declare nonlocal in outer code" +msgstr "" + +#: py/compile.c +msgid "can't delete expression" +msgstr "" + +#: py/emitnative.c +msgid "can't do binary op between '%q' and '%q'" +msgstr "" + +#: py/objcomplex.c +msgid "can't do truncated division of a complex number" +msgstr "" + +#: py/compile.c +msgid "can't have multiple **x" +msgstr "" + +#: py/compile.c +msgid "can't have multiple *x" +msgstr "" + +#: py/emitnative.c +msgid "can't implicitly convert '%q' to 'bool'" +msgstr "" + +#: py/emitnative.c +msgid "can't load from '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't load with '%q' index" +msgstr "" + +#: py/objgenerator.c +msgid "can't pend throw to just-started generator" +msgstr "" + +#: py/objgenerator.c +msgid "can't send non-None value to a just-started generator" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + +#: py/objnamedtuple.c +msgid "can't set attribute" +msgstr "" + +#: py/emitnative.c +msgid "can't store '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't store to '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't store with '%q' index" +msgstr "" + +#: py/objstr.c +msgid "" +"can't switch from automatic field numbering to manual field specification" +msgstr "" + +#: py/objstr.c +msgid "" +"can't switch from manual field specification to automatic field numbering" +msgstr "" + +#: py/objtype.c +msgid "cannot create '%q' instances" +msgstr "" + +#: py/objtype.c +msgid "cannot create instance" +msgstr "" + +#: py/runtime.c +msgid "cannot import name %q" +msgstr "" + +#: py/builtinimport.c +msgid "cannot perform relative import" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + +#: py/emitnative.c +msgid "casting" +msgstr "" + +#: shared-bindings/_stage/Text.c +msgid "chars buffer too small" +msgstr "" + +#: py/modbuiltins.c +msgid "chr() arg not in range(0x110000)" +msgstr "" + +#: py/modbuiltins.c +msgid "chr() arg not in range(256)" +msgstr "" + +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be a buffer, tuple, list, or int" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be a bytearray or array of type 'b' or 'B'" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color must be between 0x000000 and 0xffffff" +msgstr "" + +#: shared-bindings/displayio/ColorConverter.c +msgid "color should be an int" +msgstr "" + +#: py/objcomplex.c +msgid "complex division by zero" +msgstr "" + +#: py/objfloat.c py/parsenum.c +msgid "complex values not supported" +msgstr "" + +#: extmod/moduzlib.c +msgid "compression header" +msgstr "" + +#: py/parse.c +msgid "constant must be an integer" +msgstr "" + +#: py/emitnative.c +msgid "conversion to object" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "data must be of equal length" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + +#: py/parsenum.c +msgid "decimal numbers not supported" +msgstr "" + +#: py/compile.c +msgid "default 'except' must be last" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "" +"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "destination buffer must be an array of type 'H' for bit_depth = 16" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "destination_length must be an int >= 0" +msgstr "" + +#: py/objdict.c +msgid "dict update sequence has wrong length" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + +#: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c +#: shared-bindings/math/__init__.c +msgid "division by zero" +msgstr "" + +#: py/objdeque.c +msgid "empty" +msgstr "" + +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "" + +#: py/objstr.c +msgid "empty separator" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "empty sequence" +msgstr "" + +#: py/objstr.c +msgid "end of format while looking for conversion specifier" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "end_x should be an int" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +#, c-format +msgid "error = 0x%08lX" +msgstr "" + +#: py/runtime.c +msgid "exceptions must derive from BaseException" +msgstr "" + +#: py/objstr.c +msgid "expected ':' after format specifier" +msgstr "" + +#: py/obj.c +msgid "expected tuple/list" +msgstr "" + +#: py/modthread.c +msgid "expecting a dict for keyword args" +msgstr "" + +#: py/compile.c +msgid "expecting an assembler instruction" +msgstr "" + +#: py/compile.c +msgid "expecting just a value for set" +msgstr "" + +#: py/compile.c +msgid "expecting key:value for dict" +msgstr "" + +#: py/argcheck.c +msgid "extra keyword arguments given" +msgstr "" + +#: py/argcheck.c +msgid "extra positional arguments given" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c +#: shared-bindings/displayio/OnDiskBitmap.c +msgid "file must be a file opened in byte mode" +msgstr "" + +#: shared-bindings/storage/__init__.c +msgid "filesystem must provide mount method" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "first argument must be a function" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + +#: py/objtype.c +msgid "first argument to super() must be type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + +#: py/objint.c +msgid "float too big" +msgstr "" + +#: shared-bindings/_stage/Text.c +msgid "font must be 2048 bytes long" +msgstr "" + +#: py/objstr.c +msgid "format requires a dict" +msgstr "" + +#: py/objdeque.c +msgid "full" +msgstr "" + +#: py/argcheck.c +msgid "function does not take keyword arguments" +msgstr "" + +#: py/argcheck.c +#, c-format +msgid "function expected at most %d arguments, got %d" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "function got multiple values for argument '%q'" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + +#: extmod/ulab/code/compare/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + +#: py/argcheck.c +#, c-format +msgid "function missing %d required positional arguments" +msgstr "" + +#: py/bc.c +msgid "function missing keyword-only argument" +msgstr "" + +#: py/bc.c +msgid "function missing required keyword argument '%q'" +msgstr "" + +#: py/bc.c +#, c-format +msgid "function missing required positional argument #%d" +msgstr "" + +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c +#, c-format +msgid "function takes %d positional arguments but %d were given" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "function takes exactly 9 arguments" +msgstr "" + +#: py/objgenerator.c +msgid "generator already executing" +msgstr "" + +#: py/objgenerator.c +msgid "generator ignored GeneratorExit" +msgstr "" + +#: shared-bindings/_stage/Layer.c +msgid "graphic must be 2048 bytes long" +msgstr "" + +#: extmod/moduheapq.c +msgid "heap must be a list" +msgstr "" + +#: py/compile.c +msgid "identifier redefined as global" +msgstr "" + +#: py/compile.c +msgid "identifier redefined as nonlocal" +msgstr "" + +#: py/objstr.c +msgid "incomplete format" +msgstr "" + +#: py/objstr.c +msgid "incomplete format key" +msgstr "" + +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + +#: py/obj.c +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 "" + +#: extmod/ulab/code/approx/approx.c +msgid "initial values must be iterable" +msgstr "" + +#: py/compile.c +msgid "inline assembler must be a function" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "input vectors must be of equal length" +msgstr "" + +#: py/parsenum.c +msgid "int() arg 2 must be >= 2 and <= 36" +msgstr "" + +#: py/objstr.c +msgid "integer required" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +#, c-format +msgid "interval must be in range %s-%s" +msgstr "" + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "" + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "" + +#: py/objstr.c +msgid "invalid format specifier" +msgstr "" + +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "" + +#: py/compile.c +msgid "invalid micropython decorator" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "invalid step" +msgstr "" + +#: py/compile.c py/parse.c +msgid "invalid syntax" +msgstr "" + +#: py/parsenum.c +msgid "invalid syntax for integer" +msgstr "" + +#: py/parsenum.c +#, c-format +msgid "invalid syntax for integer with base %d" +msgstr "" + +#: py/parsenum.c +msgid "invalid syntax for number" +msgstr "" + +#: py/objtype.c +msgid "issubclass() arg 1 must be a class" +msgstr "" + +#: py/objtype.c +msgid "issubclass() arg 2 must be a class or a tuple of classes" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "iterations did not converge" +msgstr "" + +#: py/objstr.c +msgid "join expects a list of str/bytes objects consistent with self object" +msgstr "" + +#: py/argcheck.c +msgid "keyword argument(s) not yet implemented - use normal args instead" +msgstr "" + +#: py/bc.c +msgid "keywords must be strings" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +msgid "label '%q' not defined" +msgstr "" + +#: py/compile.c +msgid "label redefined" +msgstr "" + +#: py/stream.c +msgid "length argument not allowed for this type" +msgstr "" + +#: shared-bindings/audiomixer/MixerVoice.c +msgid "level must be between 0 and 1" +msgstr "" + +#: py/objarray.c +msgid "lhs and rhs should be compatible" +msgstr "" + +#: py/emitnative.c +msgid "local '%q' has type '%q' but source is '%q'" +msgstr "" + +#: py/emitnative.c +msgid "local '%q' used before type known" +msgstr "" + +#: py/vm.c +msgid "local variable referenced before assignment" +msgstr "" + +#: py/objint.c +msgid "long int not supported in this build" +msgstr "" + +#: py/parse.c +msgid "malformed f-string" +msgstr "" + +#: shared-bindings/_stage/Layer.c +msgid "map buffer too small" +msgstr "" + +#: py/modmath.c shared-bindings/math/__init__.c +msgid "math domain error" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "matrix is not positive definite" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +#, c-format +msgid "max_length must be 0-%d when fixed_length is %s" +msgstr "" + +#: py/runtime.c +msgid "maximum recursion depth exceeded" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "memory allocation failed, allocating %u bytes" +msgstr "" + +#: py/runtime.c +msgid "memory allocation failed, heap is locked" +msgstr "" + +#: py/builtinimport.c +msgid "module not found" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + +#: py/compile.c +msgid "multiple *x in assignment" +msgstr "" + +#: py/objtype.c +msgid "multiple bases have instance lay-out conflict" +msgstr "" + +#: py/objtype.c +msgid "multiple inheritance not supported" +msgstr "" + +#: py/emitnative.c +msgid "must raise an object" +msgstr "" + +#: py/modbuiltins.c +msgid "must use keyword argument for key function" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + +#: py/runtime.c +msgid "name '%q' is not defined" +msgstr "" + +#: py/runtime.c +msgid "name not defined" +msgstr "" + +#: py/compile.c +msgid "name reused for argument" +msgstr "" + +#: py/emitnative.c +msgid "native yield" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "need more than %d values to unpack" +msgstr "" + +#: py/objint_longlong.c py/objint_mpz.c py/runtime.c +msgid "negative power with no float support" +msgstr "" + +#: py/objint_mpz.c py/runtime.c +msgid "negative shift count" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + +#: py/vm.c +msgid "no active exception to reraise" +msgstr "" + +#: shared-bindings/socket/__init__.c shared-module/network/__init__.c +msgid "no available NIC" +msgstr "" + +#: py/compile.c +msgid "no binding for nonlocal found" +msgstr "" + +#: py/builtinimport.c +msgid "no module named '%q'" +msgstr "" + +#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c +#: shared-bindings/displayio/ParallelBus.c +msgid "no reset pin available" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + +#: py/runtime.c +msgid "no such attribute" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Connection.c +msgid "non-UUID found in service_uuids_whitelist" +msgstr "" + +#: py/compile.c +msgid "non-default argument follows default argument" +msgstr "" + +#: extmod/modubinascii.c +msgid "non-hex digit found" +msgstr "" + +#: py/compile.c +msgid "non-keyword arg after */**" +msgstr "" + +#: py/compile.c +msgid "non-keyword arg after keyword arg" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "not a 128-bit UUID" +msgstr "" + +#: py/objstr.c +msgid "not all arguments converted during string formatting" +msgstr "" + +#: py/objstr.c +msgid "not enough arguments for format string" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "number of points must be at least 2" +msgstr "" + +#: py/obj.c +msgid "object '%q' is not a tuple or list" +msgstr "" + +#: py/obj.c +msgid "object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "object does not support item deletion" +msgstr "" + +#: py/obj.c +msgid "object has no len" +msgstr "" + +#: py/obj.c +msgid "object is not subscriptable" +msgstr "" + +#: py/runtime.c +msgid "object not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "object not callable" +msgstr "" + +#: py/sequence.c shared-bindings/displayio/Group.c +msgid "object not in sequence" +msgstr "" + +#: py/runtime.c +msgid "object not iterable" +msgstr "" + +#: py/obj.c +msgid "object of type '%q' has no len()" +msgstr "" + +#: py/obj.c +msgid "object with buffer protocol required" +msgstr "" + +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "" + +#: py/objstr.c py/objstrunicode.c +msgid "offset out of bounds" +msgstr "" + +#: ports/nrf/common-hal/audiobusio/PDMIn.c +msgid "only bit_depth=16 is supported" +msgstr "" + +#: ports/nrf/common-hal/audiobusio/PDMIn.c +msgid "only sample_rate=16000 is supported" +msgstr "" + +#: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c +#: shared-bindings/nvm/ByteArray.c +msgid "only slices with step=1 (aka None) are supported" +msgstr "" + +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + +#: py/modbuiltins.c +msgid "ord expects a character" +msgstr "" + +#: py/modbuiltins.c +#, c-format +msgid "ord() expected a character, but string of length %d found" +msgstr "" + +#: py/objint_mpz.c +msgid "overflow converting long int to machine word" +msgstr "" + +#: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c +msgid "palette must be 32 bytes long" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "palette_index should be an int" +msgstr "" + +#: py/compile.c +msgid "parameter annotation must be an identifier" +msgstr "" + +#: py/emitinlinextensa.c +msgid "parameters must be registers in sequence a2 to a5" +msgstr "" + +#: py/emitinlinethumb.c +msgid "parameters must be registers in sequence r0 to r3" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "pixel coordinates out of bounds" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "pixel value requires too many bits" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" +msgstr "" + +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" + +#: py/objint_mpz.c +msgid "pow() 3rd argument cannot be 0" +msgstr "" + +#: py/objint_mpz.c +msgid "pow() with 3 arguments requires integers" +msgstr "" + +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "" + +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + +#: extmod/ulab/code/fft/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + +#: py/builtinimport.c +msgid "relative import" +msgstr "" + +#: py/obj.c +#, c-format +msgid "requested length %d but object has length %d" +msgstr "" + +#: py/compile.c +msgid "return annotation must be an identifier" +msgstr "" + +#: py/emitnative.c +msgid "return expected '%q' but got '%q'" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + +#: py/objstr.c +msgid "rsplit(None,n)" +msgstr "" + +#: shared-bindings/audiocore/RawSample.c +msgid "" +"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " +"'B'" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "sampling rate out of range" +msgstr "" + +#: py/modmicropython.c +msgid "schedule stack full" +msgstr "" + +#: lib/utils/pyexec.c py/builtinimport.c +msgid "script compilation not supported" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + +#: py/objstr.c +msgid "sign not allowed in string format specifier" +msgstr "" + +#: py/objstr.c +msgid "sign not allowed with integer format specifier 'c'" +msgstr "" + +#: py/objstr.c +msgid "single '}' encountered in format string" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "sleep length must be non-negative" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + +#: py/objslice.c py/sequence.c +msgid "slice step cannot be zero" +msgstr "" + +#: py/objint.c py/sequence.c +msgid "small int overflow" +msgstr "" + +#: main.c +msgid "soft reboot\n" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + +#: py/objstr.c +msgid "start/end indices" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "start_x should be an int" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "step must be non-zero" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "stop must be 1 or 2" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "stop not reachable from start" +msgstr "" + +#: py/stream.c +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 "" + +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "" + +#: py/objarray.c py/objstr.c +msgid "substring not found" +msgstr "" + +#: py/compile.c +msgid "super() can't find self" +msgstr "" + +#: extmod/modujson.c +msgid "syntax error in JSON" +msgstr "" + +#: extmod/moductypes.c +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 "" + +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "timeout must be 0.0-100.0 seconds" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "timeout must be >= 0.0" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "timestamp out of range for platform time_t" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "too many arguments provided with the given format" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "too many values to unpack (expected %d)" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "tuple index out of range" +msgstr "" + +#: py/obj.c +msgid "tuple/list has wrong length" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "tuple/list required on RHS" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c +msgid "tx and rx cannot both be None" +msgstr "" + +#: py/objtype.c +msgid "type '%q' is not an acceptable base type" +msgstr "" + +#: py/objtype.c +msgid "type is not an acceptable base type" +msgstr "" + +#: py/runtime.c +msgid "type object '%q' has no attribute '%q'" +msgstr "" + +#: py/objtype.c +msgid "type takes 1 or 3 arguments" +msgstr "" + +#: py/objint_longlong.c +msgid "ulonglong too large" +msgstr "" + +#: py/emitnative.c +msgid "unary op %q not implemented" +msgstr "" + +#: py/parse.c +msgid "unexpected indent" +msgstr "" + +#: py/bc.c +msgid "unexpected keyword argument" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "unexpected keyword argument '%q'" +msgstr "" + +#: py/lexer.c +msgid "unicode name escapes" +msgstr "" + +#: py/parse.c +msgid "unindent does not match any outer indentation level" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unknown conversion specifier %c" +msgstr "" + +#: py/objstr.c +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" + +#: py/compile.c +msgid "unknown type" +msgstr "" + +#: py/emitnative.c +msgid "unknown type '%q'" +msgstr "" + +#: py/objstr.c +msgid "unmatched '{' in format" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "unreadable attribute" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c +msgid "unsupported %q type" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "unsupported Thumb instruction '%s' with %d arguments" +msgstr "" + +#: py/emitinlinextensa.c +#, c-format +msgid "unsupported Xtensa instruction '%s' with %d arguments" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unsupported format character '%c' (0x%x) at index %d" +msgstr "" + +#: py/runtime.c +msgid "unsupported type for %q: '%q'" +msgstr "" + +#: py/runtime.c +msgid "unsupported type for operator" +msgstr "" + +#: py/runtime.c +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" + +#: py/objint.c +#, c-format +msgid "value must fit in %d byte(s)" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "value_count must be > 0" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "window must be <= interval" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "wrong input type" +msgstr "" + +#: extmod/ulab/code/ulab_create.c py/objstr.c +msgid "wrong number of arguments" +msgstr "" + +#: py/runtime.c +msgid "wrong number of values to unpack" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "wrong output type" +msgstr "" + +#: shared-module/displayio/Shape.c +msgid "x value out of bounds" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "y should be an int" +msgstr "" + +#: shared-module/displayio/Shape.c +msgid "y value out of bounds" +msgstr "" + +#: py/objrange.c +msgid "zero step" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" From fbcbc93b6e23d5c583727d0d9ff72904a838aa58 Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Mon, 10 Aug 2020 16:22:15 +0000 Subject: [PATCH 0530/1293] Translated using Weblate (Japanese) Currently translated at 57.6% (446 of 773 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ja/ --- locale/ja.po | 914 ++++++++++++++++++++++++++------------------------- 1 file changed, 467 insertions(+), 447 deletions(-) diff --git a/locale/ja.po b/locale/ja.po index 09e7375580..9c027fc5ab 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -8,19 +8,23 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-08-04 18:42-0500\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2020-08-10 16:59+0000\n" +"Last-Translator: Taku Fukada \n" "Language-Team: none\n" "Language: ja\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.2-dev\n" #: main.c msgid "" "\n" "Code done running. Waiting for reload.\n" msgstr "" +"\n" +"コードの実行が完了しました。リロードを待っています。\n" #: supervisor/shared/safe_mode.c msgid "" @@ -28,29 +32,34 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"CIRCUITPYドライブの内容を添えて問題を以下で報告してください:\n" +"https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c msgid "" "\n" "To exit, please reset the board without " msgstr "" +"\n" +"終了するには、次の操作なしにリセットしてください: " #: py/obj.c msgid " File \"%q\"" -msgstr "" +msgstr " ファイル \"%q\"" #: py/obj.c msgid " File \"%q\", line %d" -msgstr "" +msgstr " ファイル \"%q\", 行 %d" #: main.c msgid " output:\n" -msgstr "" +msgstr " 出力:\n" #: py/objstr.c #, c-format msgid "%%c requires int or char" -msgstr "" +msgstr "%%c にはintまたはcharが必要です" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -63,7 +72,7 @@ msgstr "" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" -msgstr "" +msgstr "%q は使用中です" #: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -71,19 +80,19 @@ msgstr "" #: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c #: py/objstrunicode.c msgid "%q index out of range" -msgstr "" +msgstr "%q インデックスは範囲外です" #: py/obj.c msgid "%q indices must be integers, not %q" -msgstr "" +msgstr "%q インデクスは、%qでなく整数でなければなりません" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "" +msgstr "%q のリストはリスト型でなければなりません" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" -msgstr "" +msgstr "%qは0以上でなければなりません" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -91,63 +100,64 @@ msgstr "" #: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" -msgstr "" +msgstr "%qは1以上でなければなりません" #: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "" +msgstr "%qは長さ2のタプルでなければなりません" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q pin invalid" -msgstr "" +msgstr "%q ピンは無効です" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" -msgstr "" +msgstr "%qはint型でなければなりません" #: py/bc.c py/objnamedtuple.c +#, fuzzy msgid "%q() takes %d positional arguments but %d were given" -msgstr "" +msgstr "%q() は %d個の位置引数 (positional arguments) を受け取りますが、%d 個しか与えられていません" #: py/argcheck.c msgid "'%q' argument required" -msgstr "" +msgstr "引数 '%q' が必要です" #: py/runtime.c msgid "'%q' object cannot assign attribute '%q'" -msgstr "" +msgstr "オブジェクト '%q' には属性 '%q' を割り当てられません" #: py/proto.c msgid "'%q' object does not support '%q'" -msgstr "" +msgstr "オブジェクト '%q' は '%q' をサポートしていません" #: py/obj.c msgid "'%q' object does not support item assignment" -msgstr "" +msgstr "オブジェクト '%q' は要素の代入をサポートしていません" #: py/obj.c msgid "'%q' object does not support item deletion" -msgstr "" +msgstr "オブジェクト '%q' は要素の削除をサポートしていません" #: py/runtime.c msgid "'%q' object has no attribute '%q'" -msgstr "" +msgstr "オブジェクト '%q' は属性 '%q' を持ちません" #: py/runtime.c msgid "'%q' object is not an iterator" -msgstr "" +msgstr "オブジェクト '%q' はイテレータではありません" #: py/objtype.c py/runtime.c msgid "'%q' object is not callable" -msgstr "" +msgstr "オブジェクト '%q' は呼び出し可能ではありません" #: py/runtime.c msgid "'%q' object is not iterable" -msgstr "" +msgstr "オブジェクト '%q' はイテレート可能ではありません" #: py/obj.c msgid "'%q' object is not subscriptable" -msgstr "" +msgstr "オブジェクト '%q' は要素の取得ができません" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -213,23 +223,23 @@ msgstr "" #: py/compile.c msgid "'await' outside function" -msgstr "" +msgstr "関数外での 'await'" #: py/compile.c msgid "'await', 'async for' or 'async with' outside async function" -msgstr "" +msgstr "async関数外での 'await', 'async for', 'async with'" #: py/compile.c msgid "'break' outside loop" -msgstr "" +msgstr "ループ外での 'break'" #: py/compile.c msgid "'continue' outside loop" -msgstr "" +msgstr "ループ外での 'continue'" #: py/objgenerator.c msgid "'coroutine' object is not an iterator" -msgstr "" +msgstr "'coroutine' オブジェクトはイテレータではありません" #: py/compile.c msgid "'data' requires at least 2 arguments" @@ -245,11 +255,11 @@ msgstr "" #: py/compile.c msgid "'return' outside function" -msgstr "" +msgstr "関数外での 'return'" #: py/compile.c msgid "'yield' outside function" -msgstr "" +msgstr "関数外での 'yield'" #: py/compile.c msgid "*x must be assignment target" @@ -265,17 +275,17 @@ msgstr "" #: py/modbuiltins.c msgid "3-arg pow() not supported" -msgstr "" +msgstr "引数3つの pow() はサポートされていません" #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" -msgstr "" +msgstr "ハードウェア割り込みチャネルは使用中です" #: shared-bindings/_bleio/Address.c #, c-format msgid "Address must be %d bytes long" -msgstr "" +msgstr "アドレスの長さは %d バイトでなければなりません" #: shared-bindings/_bleio/Address.c msgid "Address type out of range" @@ -283,27 +293,27 @@ msgstr "" #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" -msgstr "" +msgstr "すべてのI2C周辺機器が使用中です" #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" -msgstr "" +msgstr "すべてのSPI周辺機器が使用中です" #: ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" -msgstr "" +msgstr "すべてのUART周辺機器が使用中です" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "All event channels in use" -msgstr "" +msgstr "すべてのイベントチャネルが使用中です" #: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "All sync event channels in use" -msgstr "" +msgstr "すべての同期イベントチャネルが使用中です" #: shared-bindings/pulseio/PWMOut.c msgid "All timers for this pin are in use" -msgstr "" +msgstr "このピン用のすべてのタイマが使用中です" #: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -315,75 +325,75 @@ msgstr "" #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" -msgstr "" +msgstr "すべてのタイマーが使用中です" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." -msgstr "" +msgstr "すでにアドバータイズ中です。" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" -msgstr "" +msgstr "すでに実行中です" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" -msgstr "" +msgstr "指定のピンはAnalogInに対応していません" #: ports/cxd56/common-hal/analogio/AnalogOut.c #: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c #: ports/nrf/common-hal/analogio/AnalogOut.c msgid "AnalogOut functionality not supported" -msgstr "" +msgstr "AnalogOut機能はサポートされていません" #: shared-bindings/analogio/AnalogOut.c msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "" +msgstr "AnalogOutは16ビットです。値は 65536 以下でなければなりません。" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c msgid "AnalogOut not supported on given pin" -msgstr "" +msgstr "指定のピンはAnalogOutをサポートしていません" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c msgid "Another send is already active" -msgstr "" +msgstr "他のsendがすでにアクティブです" #: shared-bindings/pulseio/PulseOut.c msgid "Array must contain halfwords (type 'H')" -msgstr "" +msgstr "array のタイプは16ビット ('H') でなければなりません" #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." -msgstr "" +msgstr "Arrayの各値は1バイトでなければなりません。" #: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" -msgstr "" +msgstr "最大で %d 個の %q が指定できます(%d個でなく)" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" -msgstr "" +msgstr "%d 個のブロックの確保を試みました" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." -msgstr "" +msgstr "MicroPython VMの非実行時にヒープの確保を試みました。" #: main.c msgid "Auto-reload is off.\n" -msgstr "" +msgstr "オートリロードはオフです。\n" #: main.c msgid "" "Auto-reload is on. Simply save files over USB to run them or enter REPL to " "disable.\n" -msgstr "" +msgstr "オートリロードが有効です。ファイルをUSB経由で保存するだけで実行できます。REPLに入ると無効化します。\n" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" -msgstr "" +msgstr "最低のフレームレート未満です" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" @@ -391,30 +401,30 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." -msgstr "" +msgstr "ビット深度は8の倍数でなければなりません。" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "" +msgstr "RXとTXの両方がフロー制御のために必要です" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" -msgstr "" +msgstr "両方のピンがハードウェア割り込みをサポートしなければなりません" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "" +msgstr "Brightnessは0から1.0まででなければなりません" #: shared-bindings/supervisor/__init__.c msgid "Brightness must be between 0 and 255" -msgstr "" +msgstr "Brightnessは0から255の間でなければなりません" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" -msgstr "" +msgstr "Brightnessは調整可能ではありません" #: shared-bindings/_bleio/UUID.c #, c-format @@ -424,35 +434,35 @@ msgstr "" #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." -msgstr "" +msgstr "バッファサイズが正しくありません。%dバイトでなければなりません。" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "" +msgstr "バッファが bytearray ではありません。" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" -msgstr "" +msgstr "バッファが小さすぎます" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "" +msgstr "バッファ長 %d は大きすぎます。%d 以下でなければなりません" #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" -msgstr "" +msgstr "バッファ長は512の倍数でなければなりません" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" -msgstr "" +msgstr "バッファ長は少なくとも1以上でなければなりません" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Buffer too large and unable to allocate" -msgstr "" +msgstr "バッファが大きすぎて確保できません" #: shared-bindings/_bleio/PacketBuffer.c #, c-format @@ -463,43 +473,43 @@ msgstr "" #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" -msgstr "" +msgstr "Busピン %d はすでに使用中です" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." -msgstr "" +msgstr "バイトバッファは16バイトでなければなりません。" #: shared-bindings/nvm/ByteArray.c msgid "Bytes must be between 0 and 255." -msgstr "" +msgstr "バイト値は0から255の間でなければなりません。" #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "CBCブロックは16バイトの整数倍でなければなりません" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "" +msgstr "ネイティブオブジェクトにアクセスする前に super().__init__() を呼び出してください。" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" -msgstr "" +msgstr "ローカルのCharacteristicにはCCCDを設定できません" #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" -msgstr "" +msgstr "値を削除できません" #: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c #: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c #: ports/nrf/common-hal/digitalio/DigitalInOut.c msgid "Cannot get pull while in output mode" -msgstr "" +msgstr "出力モード時はpullを取得できません" #: ports/nrf/common-hal/microcontroller/Processor.c msgid "Cannot get temperature" -msgstr "" +msgstr "温度を取得できません" #: shared-bindings/_bleio/Adapter.c msgid "Cannot have scan responses for extended, connectable advertisements." @@ -507,53 +517,53 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" -msgstr "" +msgstr "同じピン上の両方のチャネルに出力できません" #: shared-module/bitbangio/SPI.c msgid "Cannot read without MISO pin." -msgstr "" +msgstr "MISOピンなしで読み込みはできません。" #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" -msgstr "" +msgstr "ファイルへ記録できません" #: shared-module/storage/__init__.c msgid "Cannot remount '/' when USB is active." -msgstr "" +msgstr "USBがアクティブな時に '/' を再マウントできません。" #: 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 "ブートローダが存在しないためブートローダへとリセットできません。" #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." -msgstr "" +msgstr "方向がINPUTのときは値を設定できません。" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "" +msgstr "RS485モードにRTSまたはCTSを指定できません" #: py/objslice.c msgid "Cannot subclass slice" -msgstr "" +msgstr "sliceをサブクラス化することはできません" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins." -msgstr "" +msgstr "MOSIピンとMISOピンがなければ転送できません。" #: extmod/moductypes.c msgid "Cannot unambiguously get sizeof scalar" -msgstr "" +msgstr "スカラのサイズを曖昧さなしに取得できません" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" +msgstr "使用中のタイマー上で周波数を変えられません" #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." -msgstr "" +msgstr "MOSIピンなしに書き込みできません。" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -561,17 +571,17 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" -msgstr "" +msgstr "CircuitPythonのコアコードが激しくクラッシュしました。おっと!\n" #: supervisor/shared/safe_mode.c msgid "" "CircuitPython is in safe mode because you pressed the reset button during " "boot. Press again to exit safe mode.\n" -msgstr "" +msgstr "起動中にリセットボタンを押したためCircuitPythonはセーフモードにいます。もう一度押すとセーフモードを終了します。\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." -msgstr "" +msgstr "クロックピンの初期化に失敗しました。" #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" @@ -579,117 +589,117 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Clock unit in use" -msgstr "" +msgstr "クロックユニットが使用中です" #: shared-bindings/_pew/PewPew.c msgid "Column entry must be digitalio.DigitalInOut" -msgstr "" +msgstr "Columnの要素は digitalio.DigitalInOut でなければなりません" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c msgid "Command must be an int between 0 and 255" -msgstr "" +msgstr "commandは0から255の間の整数でなければなりません" #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " "connection." -msgstr "" +msgstr "接続は切断済みのためもう使えません。新たな接続を作成してください。" #: py/persistentcode.c msgid "Corrupt .mpy file" -msgstr "" +msgstr "破損した .mpy ファイル" #: py/emitglue.c msgid "Corrupt raw code" -msgstr "" +msgstr "破損した raw code" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" -msgstr "" +msgstr "GNSSを初期化できませんでした" #: ports/cxd56/common-hal/sdioio/SDCard.c msgid "Could not initialize SDCard" -msgstr "" +msgstr "SDカードを初期化できませんでした" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" -msgstr "" +msgstr "UARTを初期化できませんでした" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize channel" -msgstr "" +msgstr "チャネルを初期化できませんでした" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize timer" -msgstr "" +msgstr "タイマーを初期化できませんでした" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init channel" -msgstr "" +msgstr "チャネルを再初期化できませんでした" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init timer" -msgstr "" +msgstr "タイマーを再初期化できませんでした" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not restart PWM" -msgstr "" +msgstr "PWMを再スタートできませんでした" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" -msgstr "" +msgstr "PWMをスタートできませんでした" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" -msgstr "" +msgstr "割り込みをスタートできませんでした。RXビジー" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" -msgstr "" +msgstr "デコーダを確保できませんでした" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate first buffer" -msgstr "" +msgstr "1つ目のバッファを確保できませんでした" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate input buffer" -msgstr "" +msgstr "入力バッファを確保できませんでした" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate second buffer" -msgstr "" +msgstr "2つ目のバッファを確保できませんでした" #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." -msgstr "" +msgstr "クラッシュして HardFault_Handler に入りました。" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" -msgstr "" +msgstr "DACチャネル初期化エラー" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" -msgstr "" +msgstr "DACデバイス初期化エラー" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" -msgstr "" +msgstr "DACはすでに使用中です" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c msgid "Data 0 pin must be byte aligned" -msgstr "" +msgstr "Data 0 ピンは、バイト整列されていなければなりません" #: shared-module/audiocore/WaveFile.c msgid "Data chunk must follow fmt chunk" -msgstr "" +msgstr "fmtチャンクの後にdataチャンクが続かなければなりません" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Data too large for advertisement packet" -msgstr "" +msgstr "データが、アドバタイズメントパケットには大きすぎます" #: shared-bindings/audiobusio/PDMIn.c msgid "Destination capacity is smaller than destination_length." @@ -697,41 +707,41 @@ msgstr "" #: ports/nrf/common-hal/audiobusio/I2SOut.c msgid "Device in use" -msgstr "" +msgstr "デバイス使用中" #: ports/cxd56/common-hal/digitalio/DigitalInOut.c msgid "DigitalInOut not supported on given pin" -msgstr "" +msgstr "指定されたピンはDigitalInOutをサポートしていません" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." -msgstr "" +msgstr "ディスプレイは16ビット色空間を持たなければなりません。" #: 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 "ディスプレイの回転は90度の整数倍でなければなりません" #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." -msgstr "" +msgstr "方向がINPUTのときドライブモードは使われません。" #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" -msgstr "" +msgstr "ECBは一度に16バイトの演算のみを行います" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c msgid "EXTINT channel already in use" -msgstr "" +msgstr "EXTINTチャネルはすでに使用されています" #: extmod/modure.c msgid "Error in regex" -msgstr "" +msgstr "正規表現にエラーがあります" #: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c #: shared-bindings/microcontroller/Pin.c @@ -769,20 +779,20 @@ msgstr "" #: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" -msgstr "" +msgstr "FFTは ndarray に対してのみ定義されています" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." -msgstr "" +msgstr "コマンドの送信に失敗しました。" #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to acquire mutex, err 0x%04x" -msgstr "" +msgstr "ミューテックスの取得に失敗しました。エラー 0x%04x" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" -msgstr "" +msgstr "RXバッファの確保に失敗しました" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -791,32 +801,32 @@ msgstr "" #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" -msgstr "" +msgstr "%d バイトのRXバッファの確保に失敗しました" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" -msgstr "" +msgstr "接続失敗: 内部エラー" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: timeout" -msgstr "" +msgstr "接続失敗: タイムアウト" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" -msgstr "" +msgstr "MP3ファイルのパーズに失敗しました" #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" -msgstr "" +msgstr "ミューテックスの開放に失敗しました。エラー 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "" +msgstr "内部フラッシュの書き込みに失敗しました。" #: py/moduerrno.c msgid "File exists" -msgstr "" +msgstr "ファイルが存在します。" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." @@ -824,7 +834,7 @@ msgstr "" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" -msgstr "" +msgstr "周波数は、このタイマーを使っている既存のPWMOutと一致しなければなりません" #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c @@ -835,155 +845,157 @@ msgstr "" #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" -msgstr "" +msgstr "グループは既に使われています" #: shared-module/displayio/Group.c msgid "Group full" -msgstr "" +msgstr "グループが一杯です" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" -msgstr "" +msgstr "ハードウェアビジー。代替のピンを試してください" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" -msgstr "" +msgstr "ハードウェア使用中。代替のピンを試してください" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" -msgstr "" +msgstr "閉じられたファイルに対するI/O操作" #: ports/stm/common-hal/busio/I2C.c msgid "I2C Init Error" -msgstr "" +msgstr "I2C初期化エラー" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" -msgstr "" +msgstr "I2SOutが利用できません" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "" +msgstr "IV の長さは %d バイトでなければなりません" #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" +"非互換の .mpy ファイルです。すべての .mpy ファイルをアップデートしてください。詳細は http://adafru.it/mpy-update " +"を参照。" #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" -msgstr "" +msgstr "バッファサイズが正しくありません" #: py/moduerrno.c msgid "Input/output error" -msgstr "" +msgstr "入力/出力エラー" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" -msgstr "" +msgstr "認証が不十分です" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" -msgstr "" +msgstr "暗号化が不十分です" #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" -msgstr "" +msgstr "内部定義エラー" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format msgid "Internal error #%d" -msgstr "" +msgstr "内部エラー #%d" #: shared-bindings/sdioio/SDCard.c msgid "Invalid %q" -msgstr "" +msgstr "不正な %q" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" -msgstr "" +msgstr "不正な %q ピン" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" -msgstr "" +msgstr "不正なADCユニット値" #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" -msgstr "" +msgstr "不正なBMPファイル" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" -msgstr "" +msgstr "無効なDACピンが与えられました" #: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" -msgstr "" +msgstr "I2Cピンの選択が不正です" #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c msgid "Invalid PWM frequency" -msgstr "" +msgstr "無効なPWM周波数です" #: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" -msgstr "" +msgstr "SPIピンの選択が不正です" #: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" -msgstr "" +msgstr "UARTピンの選択が不正です" #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" -msgstr "" +msgstr "不正な引数" #: shared-module/displayio/Bitmap.c msgid "Invalid bits per value" -msgstr "" +msgstr "値ごとのビット数が不正です" #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" -msgstr "" +msgstr "不正なバッファサイズ" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Invalid byteorder string" -msgstr "" +msgstr "不正なバイトオーダー文字列" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" +msgstr "不正なキャプチャ周期。有効な周期: 1 - 500" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid channel count" -msgstr "" +msgstr "不正なチャンネル数" #: shared-bindings/digitalio/DigitalInOut.c msgid "Invalid direction." -msgstr "" +msgstr "不正な方向。" #: shared-module/audiocore/WaveFile.c msgid "Invalid file" -msgstr "" +msgstr "不正なファイル" #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" -msgstr "" +msgstr "フォーマットチャンクのサイズが不正です" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid frequency supplied" -msgstr "" +msgstr "不正な周波数が与えられました" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "" +msgstr "不正なメモリアクセスです。" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid number of bits" -msgstr "" +msgstr "不正なビット数" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c @@ -994,15 +1006,15 @@ msgstr "" #: ports/atmel-samd/common-hal/touchio/TouchIn.c #: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" -msgstr "" +msgstr "不正なピン" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Invalid pin for left channel" -msgstr "" +msgstr "左チャネルのピンが不正です" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Invalid pin for right channel" -msgstr "" +msgstr "右チャネルのピンが不正です" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c @@ -1014,76 +1026,76 @@ msgstr "" #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" -msgstr "" +msgstr "ピンが不正です" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid pins for PWMOut" -msgstr "" +msgstr "PWMOutのピンが不正です" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" -msgstr "" +msgstr "不正な極性" #: shared-bindings/_bleio/Characteristic.c msgid "Invalid properties" -msgstr "" +msgstr "不正なプロパティ" #: shared-bindings/microcontroller/__init__.c msgid "Invalid run mode." -msgstr "" +msgstr "不正な Run Mode" #: shared-module/_bleio/Attribute.c msgid "Invalid security_mode" -msgstr "" +msgstr "不正な security_mode" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice" -msgstr "" +msgstr "不正なボイス" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice count" -msgstr "" +msgstr "不正なボイス数" #: shared-module/audiocore/WaveFile.c msgid "Invalid wave file" -msgstr "" +msgstr "不正なWaveファイルです" #: ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" -msgstr "" +msgstr "不正なワード/ビット長" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" -msgstr "" +msgstr "Keyの長さは、16, 24, 32バイトのいずれかでなければなりません" #: py/compile.c msgid "LHS of keyword arg must be an id" -msgstr "" +msgstr "キーワード引数の左辺はidです" #: shared-module/displayio/Group.c msgid "Layer already in a group." -msgstr "" +msgstr "レイヤーはすでにグループに含まれています。" #: shared-module/displayio/Group.c msgid "Layer must be a Group or TileGrid subclass." -msgstr "" +msgstr "レイヤーはGroupかTileGridのサブクラスでなければなりません。" #: py/objslice.c msgid "Length must be an int" -msgstr "" +msgstr "Lengthはint型でなければなりません" #: py/objslice.c msgid "Length must be non-negative" -msgstr "" +msgstr "Lengthは非負数でなければなりません" #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." -msgstr "" +msgstr "MISOピンの初期化に失敗しました。" #: shared-module/bitbangio/SPI.c msgid "MOSI pin init failed." -msgstr "" +msgstr "MOSIピンの初期化に失敗しました。" #: shared-module/displayio/Shape.c #, c-format @@ -1092,40 +1104,40 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." -msgstr "" +msgstr "MicroPythonのNLRジャンプに失敗しました。メモリ破壊かもしれません。" #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error." -msgstr "" +msgstr "MicroPythonの致命的エラーです。" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" -msgstr "" +msgstr "マイクのスタートアップディレイは 0.0 から 1.0 の間でなければなりません" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" -msgstr "" +msgstr "MISOまたはMOSIピンがありません" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." -msgstr "" +msgstr "%q のサブクラスでなければなりません。" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" -msgstr "" +msgstr "MISOピンまたはMOSIピンが必要です" #: ports/stm/common-hal/busio/SPI.c msgid "Must provide SCK pin" -msgstr "" +msgstr "SCKピンが必要です" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" -msgstr "" +msgstr "%d個でなく、6の倍数個のrgbピンを使わなければなりません" #: py/parse.c msgid "Name too long" -msgstr "" +msgstr "名前が長すぎます" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" @@ -1134,89 +1146,89 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" -msgstr "" +msgstr "チップにDACがありません" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "No DMA channel found" -msgstr "" +msgstr "DMAチャネルが見つかりません" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" -msgstr "" +msgstr "MISOピンがありません" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" -msgstr "" +msgstr "MOSIピンがありません" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" -msgstr "" +msgstr "RXピンがありません" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" -msgstr "" +msgstr "TXピンがありません" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "No available clocks" -msgstr "" +msgstr "利用できるクロックがありません" #: shared-bindings/_bleio/PacketBuffer.c msgid "No connection: length cannot be determined" -msgstr "" +msgstr "接続なし: 長さが決定できません" #: shared-bindings/board/__init__.c msgid "No default %q bus" -msgstr "" +msgstr "デフォルトの %q バスがありません" #: ports/atmel-samd/common-hal/touchio/TouchIn.c msgid "No free GCLKs" -msgstr "" +msgstr "使われていないGCLKがありません" #: shared-bindings/os/__init__.c msgid "No hardware random available" -msgstr "" +msgstr "ハードウェア乱数が利用できません" #: ports/atmel-samd/common-hal/ps2io/Ps2.c msgid "No hardware support on clk pin" -msgstr "" +msgstr "clkピン上のハードウェアサポートがありません" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "No hardware support on pin" -msgstr "" +msgstr "ピン上のハードウェアサポートがありません" #: shared-bindings/aesio/aes.c msgid "No key was specified" -msgstr "" +msgstr "キーが指定されていません" #: shared-bindings/time/__init__.c msgid "No long integer support" -msgstr "" +msgstr "long integer はサポートされていません" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." -msgstr "" +msgstr "このピンには利用可能なタイマーがもうありません。" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" -msgstr "" +msgstr "ピンにプルダウンがありません。1Mオーム推奨" #: py/moduerrno.c msgid "No space left on device" -msgstr "" +msgstr "デバイスに空き容量が残っていません" #: py/moduerrno.c msgid "No such file/directory" -msgstr "" +msgstr "指定されたファイル/ディレクトリはありません" #: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" -msgstr "" +msgstr "タイマーが利用できません" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." @@ -1225,29 +1237,29 @@ msgstr "" #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" -msgstr "" +msgstr "接続されていません" #: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c #: shared-bindings/audiopwmio/PWMAudioOut.c msgid "Not playing" -msgstr "" +msgstr "再生中ではありません" #: main.c msgid "Not running saved code.\n" -msgstr "" +msgstr "保存されたコードは実行していません。\n" #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." -msgstr "" +msgstr "オブジェクトは解体済みでもう使われていません。新たなオブジェクトを作成してください。" #: ports/nrf/common-hal/busio/UART.c msgid "Odd parity is not supported" -msgstr "" +msgstr "奇数パリティはサポートされていません" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " -msgstr "" +msgstr "8または16ビットの " #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1264,26 +1276,26 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." -msgstr "" +msgstr "オーバーサンプルは8の倍数でなければなりません。" #: shared-bindings/pulseio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "" +msgstr "PWMの duty_cycle 値は 0 から 65535 の間でなければなりません(16ビット解像度)" #: shared-bindings/pulseio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." -msgstr "" +msgstr "PWM周波数は、生成時の variable_frequency が False の場合、書き換えられません。" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" -msgstr "" +msgstr "ParallelBusはまだサポートされていません" #: py/moduerrno.c msgid "Permission denied" -msgstr "" +msgstr "パーミッション拒否" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c @@ -1291,19 +1303,19 @@ msgstr "" #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" -msgstr "" +msgstr "ピンにADCの能力がありません" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pin is input only" -msgstr "" +msgstr "ピンは入力専用です" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" -msgstr "" +msgstr "ピンはハードウェア割り込みをサポートしていなければなりません" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" -msgstr "" +msgstr "ピン番号はすでにEXTIによって予約されています" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1319,27 +1331,28 @@ msgstr "" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" -msgstr "" +msgstr "ポリゴンには少なくとも3つの点が必要です" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" -msgstr "" +msgstr "Prefixバッファはヒープ上になければなりません" #: main.c +#, fuzzy msgid "Press any key to enter the REPL. Use CTRL-D to reload." -msgstr "" +msgstr "何らかのキーを押すとREPLに入ります。CTRL-Dでリロードします。" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." -msgstr "" +msgstr "出力方向がOutputのときPullは使われません。" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" -msgstr "" +msgstr "乱数生成器の解体エラー" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" -msgstr "" +msgstr "乱数生成器の初期化エラー" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" @@ -1348,107 +1361,107 @@ msgstr "" #: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c #: ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" -msgstr "" +msgstr "RTCのキャリブレーションはこのボードではサポートされていません" #: shared-bindings/time/__init__.c msgid "RTC is not supported on this board" -msgstr "" +msgstr "このボードではRTCがサポートされていません" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" +msgstr "RTS/CTS/RS485 はまだこのデバイスでサポートされていません" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" -msgstr "" +msgstr "乱数生成エラー" #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" -msgstr "" +msgstr "読み込み専用" #: extmod/vfs_fat.c py/moduerrno.c msgid "Read-only filesystem" -msgstr "" +msgstr "読み込み専用のファイルシステム" #: shared-module/displayio/Bitmap.c msgid "Read-only object" -msgstr "" +msgstr "読み込み専用のオブジェクト" #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" -msgstr "" +msgstr "リフレッシュが早すぎです" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" -msgstr "" +msgstr "要求されたAESモードはサポートされていません" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" -msgstr "" +msgstr "右チャネルはサポートされていません" #: shared-bindings/_pew/PewPew.c msgid "Row entry must be digitalio.DigitalInOut" -msgstr "" +msgstr "Rowの各要素は digitalio.DigitalInOut でなければなりません" #: main.c msgid "Running in safe mode! " -msgstr "" +msgstr "セーフモードで実行中です! " #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" -msgstr "" +msgstr "SDカードのCSDフォーマットはサポートされていません" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" -msgstr "" +msgstr "SDAとSCLはプルアップが必要です" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" -msgstr "" +msgstr "SPI初期化エラー" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Re-initialization error" -msgstr "" +msgstr "SPI再初期化エラー" #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" -msgstr "" +msgstr "サンプルレートは正数でなければなりません" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #, c-format msgid "Sample rate too high. It must be less than %d" -msgstr "" +msgstr "サンプルレートが高すぎです。%d 以下でなければなりません" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." -msgstr "" +msgstr "スキャンがすでに進行中です。stop_scanで停止してください。" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" -msgstr "" +msgstr "選択されたCTSピンが正しくありません" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected RTS pin not valid" -msgstr "" +msgstr "選択されたRTSピンが正しくありません" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Serializer in use" -msgstr "" +msgstr "シリアライザは使用中です" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." -msgstr "" +msgstr "スライスと値の長さが一致しません。" #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/TileGrid.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" -msgstr "" +msgstr "スライスはサポートされていません" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" @@ -1460,7 +1473,7 @@ msgstr "" #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" -msgstr "" +msgstr "スタックサイズは少なくとも256以上でなければなりません" #: shared-bindings/multiterminal/__init__.c msgid "Stream missing readinto() or write() method." @@ -1468,7 +1481,7 @@ msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" -msgstr "" +msgstr "少なくとも1つのUARTピンが必要です" #: shared-bindings/gnss/GNSS.c msgid "System entry must be gnss.SatelliteSystem" @@ -1476,30 +1489,35 @@ msgstr "" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" -msgstr "" +msgstr "温度読み取りがタイムアウトしました" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Please increase the stack size if you know how, or if not:" msgstr "" +"スタックが小さすぎたことによりCircuitPythonのヒープが破損しました。\n" +"スタックサイズを上げるか、その方法が分からなければ:" #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode.\n" -msgstr "" +msgstr "`microcontroller` モジュールが使われてセーフモードで起動しました。セーフモードを抜けるにはリセットを押します。\n" #: supervisor/shared/safe_mode.c +#, fuzzy msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" +"マイクロコントローラの電力が降下しました。電源が回路全体が求める十分な電力を供給できることを確認してリセットを押してください(CIRCUITPYを取り出し" +"た後)。\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" -msgstr "" +msgstr "サンプルのビット数/サンプルがミキサーのそれと一致しません" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's channel count does not match the mixer's" @@ -1511,28 +1529,28 @@ msgstr "" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's signedness does not match the mixer's" -msgstr "" +msgstr "サンプルの符号の有無がミキサーのそれと一致しません" #: shared-bindings/displayio/TileGrid.c msgid "Tile height must exactly divide bitmap height" -msgstr "" +msgstr "タイルの高さはビットマップの高さを割り切れる値でなければなりません" #: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c msgid "Tile index out of bounds" -msgstr "" +msgstr "タイルのインデクスが範囲外です" #: shared-bindings/displayio/TileGrid.c msgid "Tile value out of bounds" -msgstr "" +msgstr "タイルの値が範囲外です" #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" -msgstr "" +msgstr "タイルの幅はビットマップの幅を割り切れる値でなければなりません" #: ports/nrf/common-hal/_bleio/Adapter.c #, c-format msgid "Timeout is too long: Maximum timeout length is %d seconds" -msgstr "" +msgstr "タイムアウトが長すぎます。最大のタイムアウト長は %d 秒です" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "" @@ -1541,7 +1559,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." -msgstr "" +msgstr "サンプル中のチャンネル数が多すぎます。" #: shared-module/displayio/__init__.c msgid "Too many display busses" @@ -1565,43 +1583,44 @@ msgstr "" #: ports/stm/common-hal/busio/UART.c msgid "UART Buffer allocation error" -msgstr "" +msgstr "UARTバッファの確保エラー" #: ports/stm/common-hal/busio/UART.c +#, fuzzy msgid "UART De-init error" -msgstr "" +msgstr "UARTの解体エラー" #: ports/stm/common-hal/busio/UART.c msgid "UART Init Error" -msgstr "" +msgstr "UARTの初期化エラー" #: ports/stm/common-hal/busio/UART.c msgid "UART Re-init error" -msgstr "" +msgstr "UARTの再初期化エラー" #: ports/stm/common-hal/busio/UART.c msgid "UART write error" -msgstr "" +msgstr "UART書き込みエラー" #: shared-module/usb_hid/Device.c msgid "USB Busy" -msgstr "" +msgstr "USBビジー" #: shared-module/usb_hid/Device.c msgid "USB Error" -msgstr "" +msgstr "USBエラー" #: shared-bindings/_bleio/UUID.c msgid "UUID integer value must be 0-0xffff" -msgstr "" +msgstr "UUIDの整数値は0から0xffffの間でなければなりません" #: shared-bindings/_bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" -msgstr "" +msgstr "UUID文字列が 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' の形式になっていません" #: shared-bindings/_bleio/UUID.c msgid "UUID value is not str, int or byte buffer" -msgstr "" +msgstr "UUIDの値が str, int, buffer のいずれでもありません" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -1620,43 +1639,43 @@ msgstr "" #: py/parse.c msgid "Unable to init parser" -msgstr "" +msgstr "パーザを初期化できません" #: shared-module/displayio/OnDiskBitmap.c msgid "Unable to read color palette data" -msgstr "" +msgstr "カラーパレットのデータを読み込めません" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." -msgstr "" +msgstr "nvm に書き込みできません。" #: ports/nrf/common-hal/_bleio/UUID.c msgid "Unexpected nrfx uuid type" -msgstr "" +msgstr "想定されていない nrfx UUID 型" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" -msgstr "" +msgstr "不明なGATTエラー: 0x%04x" #: supervisor/shared/safe_mode.c msgid "Unknown reason." -msgstr "" +msgstr "理由不明。" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" -msgstr "" +msgstr "不明なセキュリティエラー: 0x%04x" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown soft device error: %04x" -msgstr "" +msgstr "不明なソフトデバイスエラー: %04x" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." -msgstr "" +msgstr "右辺の要素数が一致しません (expected %d, got %d)" #: ports/nrf/common-hal/_bleio/__init__.c msgid "" @@ -1683,7 +1702,7 @@ msgstr "" #: shared-bindings/digitalio/DigitalInOut.c msgid "Unsupported pull value." -msgstr "" +msgstr "サポートされていない pull 値です。" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -1713,11 +1732,11 @@ msgstr "" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer is not currently running" -msgstr "" +msgstr "WatchDogTimerは現在動作していません" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" -msgstr "" +msgstr "WatchDogTimer.mode は一度 WatchDogMode.RESET に設定されると変更できません" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.timeout must be greater than 0" @@ -1829,15 +1848,15 @@ msgstr "" #: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" -msgstr "" +msgstr "axisは -1, 0, 1, None のいずれかでなければなりません" #: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" -msgstr "" +msgstr "axisは -1, 0, 1 のいずれかでなければなりません" #: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" -msgstr "" +msgstr "axisは None, 0, 1 のいずれかでなければなりません" #: py/builtinevex.c msgid "bad compile mode" @@ -1853,7 +1872,7 @@ msgstr "" #: py/binary.c msgid "bad typecode" -msgstr "" +msgstr "typecodeが正しくありません" #: py/emitnative.c msgid "binary op %q not implemented" @@ -2178,7 +2197,7 @@ msgstr "" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" -msgstr "" +msgstr "ゼロ除算 (division by zero)" #: py/objdeque.c msgid "empty" @@ -2202,24 +2221,24 @@ msgstr "" #: shared-bindings/displayio/Shape.c msgid "end_x should be an int" -msgstr "" +msgstr "end_x は int でなければなりません" #: ports/nrf/common-hal/busio/UART.c #, c-format msgid "error = 0x%08lX" -msgstr "" +msgstr "error = 0x1%08lX" #: py/runtime.c msgid "exceptions must derive from BaseException" -msgstr "" +msgstr "例外はBaseExceptionから派生していなければなりません" #: py/objstr.c msgid "expected ':' after format specifier" -msgstr "" +msgstr "書式化指定子の後に ':' が必要です" #: py/obj.c msgid "expected tuple/list" -msgstr "" +msgstr "タプルまたはリストが必要です" #: py/modthread.c msgid "expecting a dict for keyword args" @@ -2227,7 +2246,7 @@ msgstr "" #: py/compile.c msgid "expecting an assembler instruction" -msgstr "" +msgstr "アセンブラ命令が必要です" #: py/compile.c msgid "expecting just a value for set" @@ -2235,15 +2254,15 @@ msgstr "" #: py/compile.c msgid "expecting key:value for dict" -msgstr "" +msgstr "dictには key:value が必要です" #: py/argcheck.c msgid "extra keyword arguments given" -msgstr "" +msgstr "余計なキーワード引数が与えられました" #: py/argcheck.c msgid "extra positional arguments given" -msgstr "" +msgstr "余分な位置引数 (positional arguments) が与えられました" #: py/parse.c msgid "f-string expression part cannot include a '#'" @@ -2259,16 +2278,16 @@ msgstr "" #: py/parse.c msgid "f-string: expecting '}'" -msgstr "" +msgstr "f-string: '}' が必要です" #: py/parse.c msgid "f-string: single '}' is not allowed" -msgstr "" +msgstr "f-string: 1つだけの '}' は許されません" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" -msgstr "" +msgstr "fileはバイトモードで開かれたファイルでなければなりません" #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" @@ -2276,19 +2295,19 @@ msgstr "" #: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" -msgstr "" +msgstr "1つ目の引数は呼び出し可能でなければなりません" #: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" -msgstr "" +msgstr "1つ目の引数は関数でなければなりません" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" -msgstr "" +msgstr "1つ目の引数はイテレート可能でなければなりません" #: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" -msgstr "" +msgstr "1つ目の引数は ndarray でなければなりません" #: py/objtype.c msgid "first argument to super() must be type" @@ -2300,11 +2319,11 @@ msgstr "" #: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" -msgstr "" +msgstr "flipの引数はndarrayでなければなりません" #: py/objint.c msgid "float too big" -msgstr "" +msgstr "floatの値が大きすぎます" #: shared-bindings/_stage/Text.c msgid "font must be 2048 bytes long" @@ -2345,12 +2364,13 @@ msgid "function missing %d required positional arguments" msgstr "" #: py/bc.c +#, fuzzy msgid "function missing keyword-only argument" -msgstr "" +msgstr "キーワード専用引数が不足しています" #: py/bc.c msgid "function missing required keyword argument '%q'" -msgstr "" +msgstr "必須のキーワード引数 '%q' が与えられていません" #: py/bc.c #, c-format @@ -2364,7 +2384,7 @@ msgstr "" #: shared-bindings/time/__init__.c msgid "function takes exactly 9 arguments" -msgstr "" +msgstr "この関数はちょうど9個の引数をとります" #: py/objgenerator.c msgid "generator already executing" @@ -2408,15 +2428,15 @@ msgstr "" #: py/obj.c msgid "index out of range" -msgstr "" +msgstr "インデクスが範囲外です" #: py/obj.c msgid "indices must be integers" -msgstr "" +msgstr "インデクスは整数でなければなりません" #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" -msgstr "" +msgstr "インデクスは、整数、スライス、boolのリストのいずれかでなければなりません" #: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" @@ -2432,7 +2452,7 @@ msgstr "" #: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" -msgstr "" +msgstr "入力 array の長さは2の累乗でなければなりません" #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" @@ -2440,7 +2460,7 @@ msgstr "" #: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" -msgstr "" +msgstr "入力行列は非対称です" #: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" @@ -2460,11 +2480,11 @@ msgstr "" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "" +msgstr "int() の2番目の引数は 2 以上 36 以下でなければなりません" #: py/objstr.c msgid "integer required" -msgstr "" +msgstr "整数が必要です" #: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" @@ -2477,15 +2497,15 @@ msgstr "" #: lib/netutils/netutils.c msgid "invalid arguments" -msgstr "" +msgstr "不正な引数" #: extmod/modussl_axtls.c msgid "invalid cert" -msgstr "" +msgstr "不正な証明書" #: extmod/uos_dupterm.c msgid "invalid dupterm index" -msgstr "" +msgstr "不正なduptermインデクス" #: extmod/modframebuf.c msgid "invalid format" @@ -2497,7 +2517,7 @@ msgstr "" #: extmod/modussl_axtls.c msgid "invalid key" -msgstr "" +msgstr "不正な鍵" #: py/compile.c msgid "invalid micropython decorator" @@ -2505,15 +2525,15 @@ msgstr "" #: shared-bindings/random/__init__.c msgid "invalid step" -msgstr "" +msgstr "不正なステップ" #: py/compile.c py/parse.c msgid "invalid syntax" -msgstr "" +msgstr "不正な構文" #: py/parsenum.c msgid "invalid syntax for integer" -msgstr "" +msgstr "整数の構文が不正です" #: py/parsenum.c #, c-format @@ -2522,11 +2542,11 @@ msgstr "" #: py/parsenum.c msgid "invalid syntax for number" -msgstr "" +msgstr "数字として不正な構文です" #: py/objtype.c msgid "issubclass() arg 1 must be a class" -msgstr "" +msgstr "issubclass() の1つ目の引数はクラスでなければなりません" #: py/objtype.c msgid "issubclass() arg 2 must be a class or a tuple of classes" @@ -2534,7 +2554,7 @@ msgstr "" #: extmod/ulab/code/ndarray.c msgid "iterables are not of the same length" -msgstr "" +msgstr "イテレート可能なオブジェクトが同じ長さではありません" #: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" @@ -2550,7 +2570,7 @@ msgstr "" #: py/bc.c msgid "keywords must be strings" -msgstr "" +msgstr "キーワードは文字列でなければなりません" #: py/emitinlinethumb.c py/emitinlinextensa.c msgid "label '%q' not defined" @@ -2558,7 +2578,7 @@ msgstr "" #: py/compile.c msgid "label redefined" -msgstr "" +msgstr "ラベルが再定義されました" #: py/stream.c msgid "length argument not allowed for this type" @@ -2566,11 +2586,11 @@ msgstr "" #: shared-bindings/audiomixer/MixerVoice.c msgid "level must be between 0 and 1" -msgstr "" +msgstr "levelは0から1の間でなければなりません" #: py/objarray.c msgid "lhs and rhs should be compatible" -msgstr "" +msgstr "左辺と右辺が互換でなければなりません" #: py/emitnative.c msgid "local '%q' has type '%q' but source is '%q'" @@ -2586,11 +2606,11 @@ msgstr "" #: py/objint.c msgid "long int not supported in this build" -msgstr "" +msgstr "long int はこのビルドではサポートされていません" #: py/parse.c msgid "malformed f-string" -msgstr "" +msgstr "不正な形式のf-stringです" #: shared-bindings/_stage/Layer.c msgid "map buffer too small" @@ -2598,15 +2618,15 @@ msgstr "" #: py/modmath.c shared-bindings/math/__init__.c msgid "math domain error" -msgstr "" +msgstr "定義域エラー" #: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" -msgstr "" +msgstr "行列の次元が一致しません" #: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" -msgstr "" +msgstr "行列が正定値行列ではありません" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -2616,7 +2636,7 @@ msgstr "" #: py/runtime.c msgid "maximum recursion depth exceeded" -msgstr "" +msgstr "最大の再帰深度を超えました" #: py/runtime.c #, c-format @@ -2625,11 +2645,11 @@ msgstr "" #: py/runtime.c msgid "memory allocation failed, heap is locked" -msgstr "" +msgstr "メモリ確保に失敗。ヒープがロックされています" #: py/builtinimport.c msgid "module not found" -msgstr "" +msgstr "モジュールが見つかりません" #: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" @@ -2645,7 +2665,7 @@ msgstr "" #: py/objtype.c msgid "multiple inheritance not supported" -msgstr "" +msgstr "複数継承はサポートされていません" #: py/emitnative.c msgid "must raise an object" @@ -2657,19 +2677,19 @@ msgstr "" #: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" -msgstr "" +msgstr "nは0から9の間でなければなりません" #: py/runtime.c msgid "name '%q' is not defined" -msgstr "" +msgstr "名前 '%q' は定義されていません" #: py/runtime.c msgid "name not defined" -msgstr "" +msgstr "名前が定義されていません" #: py/compile.c msgid "name reused for argument" -msgstr "" +msgstr "名前が引数で再利用されています" #: py/emitnative.c msgid "native yield" @@ -2686,11 +2706,11 @@ msgstr "" #: py/objint_mpz.c py/runtime.c msgid "negative shift count" -msgstr "" +msgstr "シフトカウントが負数です" #: shared-module/sdcardio/SDCard.c msgid "no SD card" -msgstr "" +msgstr "SDカードがありません" #: py/vm.c msgid "no active exception to reraise" @@ -2698,7 +2718,7 @@ msgstr "" #: shared-bindings/socket/__init__.c shared-module/network/__init__.c msgid "no available NIC" -msgstr "" +msgstr "利用可能なNICがありません" #: py/compile.c msgid "no binding for nonlocal found" @@ -2706,20 +2726,20 @@ msgstr "" #: py/builtinimport.c msgid "no module named '%q'" -msgstr "" +msgstr "'%q' という名前のモジュールはありません" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c msgid "no reset pin available" -msgstr "" +msgstr "利用可能なリセットピンがありません" #: shared-module/sdcardio/SDCard.c msgid "no response from SD card" -msgstr "" +msgstr "SDカードからの応答がありません" #: py/runtime.c msgid "no such attribute" -msgstr "" +msgstr "そのような属性はありません" #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -2731,19 +2751,19 @@ msgstr "" #: extmod/modubinascii.c msgid "non-hex digit found" -msgstr "" +msgstr "16進数以外の桁があります" #: py/compile.c msgid "non-keyword arg after */**" -msgstr "" +msgstr "*/** の後に非キーワード引数は置けません" #: py/compile.c msgid "non-keyword arg after keyword arg" -msgstr "" +msgstr "キーワード引数の後に非キーワード引数は置けません" #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" -msgstr "" +msgstr "128ビットのUUIDではありません" #: py/objstr.c msgid "not all arguments converted during string formatting" @@ -2755,7 +2775,7 @@ msgstr "" #: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" -msgstr "" +msgstr "引数の数は2個または3個でなければなりません" #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" @@ -2763,31 +2783,31 @@ msgstr "" #: py/obj.c msgid "object '%q' is not a tuple or list" -msgstr "" +msgstr "オブジェクト '%q' がタプルでもリストでもありません" #: py/obj.c msgid "object does not support item assignment" -msgstr "" +msgstr "オブジェクトは要素の代入をサポートしていません" #: py/obj.c msgid "object does not support item deletion" -msgstr "" +msgstr "オブジェクトは要素の削除をサポートしていません" #: py/obj.c msgid "object has no len" -msgstr "" +msgstr "オブジェクトがlenを持っていません" #: py/obj.c msgid "object is not subscriptable" -msgstr "" +msgstr "オブジェクトは要素の取得をサポートしていません" #: py/runtime.c msgid "object not an iterator" -msgstr "" +msgstr "オブジェクトはイテレータではありません" #: py/objtype.c py/runtime.c msgid "object not callable" -msgstr "" +msgstr "オブジェクトは呼び出し可能ではありません" #: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" @@ -2807,7 +2827,7 @@ msgstr "" #: extmod/modubinascii.c msgid "odd-length string" -msgstr "" +msgstr "奇数長の文字列です" #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" @@ -2833,36 +2853,36 @@ msgstr "" #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" -msgstr "" +msgstr "この演算はndarray上で実装されていません" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" -msgstr "" +msgstr "この演算は与えられた型をサポートしていません" #: py/modbuiltins.c msgid "ord expects a character" -msgstr "" +msgstr "ord() は1文字を受け取ります" #: py/modbuiltins.c #, c-format msgid "ord() expected a character, but string of length %d found" -msgstr "" +msgstr "ord() は1文字を要求しますが、長さ %d の文字列が与えられました" #: py/objint_mpz.c msgid "overflow converting long int to machine word" -msgstr "" +msgstr "long int をマシンの word に変換する際にオーバーフローしました" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" -msgstr "" +msgstr "パレットの長さは32バイトでなければなりません" #: shared-bindings/displayio/Palette.c msgid "palette_index should be an int" -msgstr "" +msgstr "palette_index は int でなければなりません" #: py/compile.c msgid "parameter annotation must be an identifier" -msgstr "" +msgstr "引数アノテーションは識別子でなければなりません" #: py/emitinlinextensa.c msgid "parameters must be registers in sequence a2 to a5" @@ -2898,15 +2918,15 @@ msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" -msgstr "" +msgstr "pow() の3番目の引数は0にはできません" #: py/objint_mpz.c msgid "pow() with 3 arguments requires integers" -msgstr "" +msgstr "pow() の3番目の引数には整数が必要です" #: extmod/modutimeq.c msgid "queue overflow" -msgstr "" +msgstr "キューがオーバーフローしました" #: py/parse.c msgid "raw f-strings are not implemented" @@ -2914,20 +2934,20 @@ msgstr "" #: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" -msgstr "" +msgstr "実数部と虚数部は同じ長さでなければなりません" #: py/builtinimport.c msgid "relative import" -msgstr "" +msgstr "相対インポート" #: py/obj.c #, c-format msgid "requested length %d but object has length %d" -msgstr "" +msgstr "長さ %d が要求されていますがオブジェクトの長さは %d です" #: py/compile.c msgid "return annotation must be an identifier" -msgstr "" +msgstr "戻り値のアノテーションは識別子でなければなりません" #: py/emitnative.c msgid "return expected '%q' but got '%q'" @@ -2941,49 +2961,49 @@ msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "" +msgstr "rgb_pins[%d] はクロックと同じポートではありません" #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" -msgstr "" +msgstr "右辺は ndarray またはスカラ値でなければなりません" #: py/objstr.c msgid "rsplit(None,n)" -msgstr "" +msgstr "rsplit(None,n)" #: shared-bindings/audiocore/RawSample.c msgid "" "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " "'B'" -msgstr "" +msgstr "sample_source バッファは、bytearray または 'h', 'H', 'b', 'B'型のarrayでなければなりません" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" -msgstr "" +msgstr "サンプリングレートが範囲外です" #: py/modmicropython.c msgid "schedule stack full" -msgstr "" +msgstr "スケジュールスタックが一杯です" #: lib/utils/pyexec.c py/builtinimport.c msgid "script compilation not supported" -msgstr "" +msgstr "スクリプトのコンパイルはサポートされていません" #: extmod/ulab/code/ndarray.c msgid "shape must be a 2-tuple" -msgstr "" +msgstr "shapeは 2値のタプルでなければなりません" #: py/objstr.c msgid "sign not allowed in string format specifier" -msgstr "" +msgstr "文字列フォーマット指定子で符号は使えません" #: py/objstr.c msgid "sign not allowed with integer format specifier 'c'" -msgstr "" +msgstr "整数フォーマット指定子 'c' と共に符号は使えません" #: py/objstr.c msgid "single '}' encountered in format string" -msgstr "" +msgstr "文字列フォーマット中に孤立した '}' があります" #: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" @@ -2991,11 +3011,11 @@ msgstr "" #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" -msgstr "" +msgstr "sleepの長さは非負数でなければなりません" #: extmod/ulab/code/ndarray.c msgid "slice step can't be zero" -msgstr "" +msgstr "スライスのステップは0にできません" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" @@ -3003,11 +3023,11 @@ msgstr "" #: py/objint.c py/sequence.c msgid "small int overflow" -msgstr "" +msgstr "small int オーバーフロー" #: main.c msgid "soft reboot\n" -msgstr "" +msgstr "ソフトリブート\n" #: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" @@ -3039,7 +3059,7 @@ msgstr "" #: shared-bindings/busio/UART.c msgid "stop must be 1 or 2" -msgstr "" +msgstr "stop は1または2でなければなりません" #: shared-bindings/random/__init__.c msgid "stop not reachable from start" @@ -3047,7 +3067,7 @@ msgstr "" #: py/stream.c msgid "stream operation not supported" -msgstr "" +msgstr "ストリーム操作がサポートされていません" #: py/objstrunicode.c msgid "string indices must be integers, not %q" @@ -3067,7 +3087,7 @@ msgstr "" #: py/objarray.c py/objstr.c msgid "substring not found" -msgstr "" +msgstr "部分文字列が見つかりません" #: py/compile.c msgid "super() can't find self" @@ -3075,19 +3095,19 @@ msgstr "" #: extmod/modujson.c msgid "syntax error in JSON" -msgstr "" +msgstr "JSONに構文エラーがあります" #: extmod/moductypes.c msgid "syntax error in uctypes descriptor" -msgstr "" +msgstr "uctypedディスクリプタの構文エラー" #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" -msgstr "" +msgstr "threshould は 0 から 65536 の範囲になければなりません" #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" -msgstr "" +msgstr "time.struct_time() は 要素9個のシーケンスを受け取ります" #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -3099,15 +3119,15 @@ msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" -msgstr "" +msgstr "timeout は 0.0 以上でなければなりません" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" -msgstr "" +msgstr "v1カードの待機がタイムアウトしました" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v2 card" -msgstr "" +msgstr "v2カードの待機がタイムアウトしました" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" @@ -3119,7 +3139,7 @@ msgstr "" #: extmod/ulab/code/ndarray.c msgid "too many indices" -msgstr "" +msgstr "インデクスが多すぎです" #: py/runtime.c #, c-format @@ -3136,7 +3156,7 @@ msgstr "" #: py/obj.c msgid "tuple/list has wrong length" -msgstr "" +msgstr "タプル/リストの長さが正しくありません" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "tuple/list required on RHS" @@ -3145,11 +3165,11 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" -msgstr "" +msgstr "tx と rx の両方を None にすることはできません" #: py/objtype.c msgid "type '%q' is not an acceptable base type" -msgstr "" +msgstr "型 '%q' はベース型として認められません" #: py/objtype.c msgid "type is not an acceptable base type" @@ -3161,7 +3181,7 @@ msgstr "" #: py/objtype.c msgid "type takes 1 or 3 arguments" -msgstr "" +msgstr "typeは1つまたは3つの引数をとります" #: py/objint_longlong.c msgid "ulonglong too large" @@ -3169,7 +3189,7 @@ msgstr "" #: py/emitnative.c msgid "unary op %q not implemented" -msgstr "" +msgstr "単項演算子 %q は実装されていません" #: py/parse.c msgid "unexpected indent" @@ -3181,7 +3201,7 @@ msgstr "" #: py/bc.c py/objnamedtuple.c msgid "unexpected keyword argument '%q'" -msgstr "" +msgstr "キーワード引数 '%q' は使えません" #: py/lexer.c msgid "unicode name escapes" @@ -3189,7 +3209,7 @@ msgstr "" #: py/parse.c msgid "unindent does not match any outer indentation level" -msgstr "" +msgstr "インデントの解除が、外側のどのインデントレベルにも一致しません" #: py/objstr.c #, c-format @@ -3202,24 +3222,24 @@ msgstr "" #: py/compile.c msgid "unknown type" -msgstr "" +msgstr "不明な型" #: py/emitnative.c msgid "unknown type '%q'" -msgstr "" +msgstr "不明な型 '%q'" #: py/objstr.c msgid "unmatched '{' in format" -msgstr "" +msgstr "書式中にマッチしない '{' があります" #: py/objtype.c py/runtime.c msgid "unreadable attribute" -msgstr "" +msgstr "読み込み不可能な属性" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c #: shared-module/vectorio/Polygon.c msgid "unsupported %q type" -msgstr "" +msgstr "サポートされない型 %q" #: py/emitinlinethumb.c #, c-format @@ -3238,11 +3258,11 @@ msgstr "" #: py/runtime.c msgid "unsupported type for %q: '%q'" -msgstr "" +msgstr "%q がサポートしていない型: '%q'" #: py/runtime.c msgid "unsupported type for operator" -msgstr "" +msgstr "演算子がサポートしていない型" #: py/runtime.c msgid "unsupported types for %q: '%q', '%q'" @@ -3251,7 +3271,7 @@ msgstr "" #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" -msgstr "" +msgstr "値は %d バイトに収まらなければなりません" #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" @@ -3271,11 +3291,11 @@ msgstr "" #: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" -msgstr "" +msgstr "引数の型が正しくありません" #: extmod/ulab/code/ndarray.c msgid "wrong index type" -msgstr "" +msgstr "インデクスの型が正しくありません" #: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" @@ -3303,7 +3323,7 @@ msgstr "" #: shared-bindings/displayio/Shape.c msgid "y should be an int" -msgstr "" +msgstr "yは整数でなければなりません" #: shared-module/displayio/Shape.c msgid "y value out of bounds" @@ -3315,11 +3335,11 @@ msgstr "" #: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" -msgstr "" +msgstr "zi はndarrayでなければなりません" #: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" -msgstr "" +msgstr "zi はfloat型でなければなりません" #: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" From d47bd5529c8e2944f5e18dec87ed432c742622ee Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 10 Aug 2020 13:16:20 -0400 Subject: [PATCH 0531/1293] Fix neopixel macro issue, set default neopixel color --- .../espressif_saola_1_wroom/mpconfigboard.h | 2 ++ .../espressif_saola_1_wroom/mpconfigboard.mk | 2 -- .../espressif_saola_1_wrover/mpconfigboard.mk | 2 -- .../mpconfigboard.mk | 3 -- ports/esp32s2/mpconfigport.mk | 2 -- supervisor/shared/rgb_led_status.c | 32 +++++++++---------- 6 files changed, 18 insertions(+), 25 deletions(-) diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h index 78652e215b..a94f10ea49 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -29,4 +29,6 @@ #define MICROPY_HW_BOARD_NAME "Saola 1 w/Wroom" #define MICROPY_HW_MCU_NAME "ESP32S2" +#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) + #define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk index 6e76272659..9c9ca61694 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk @@ -10,8 +10,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_NEOPIXEL_WRITE = 0 - CIRCUITPY_ESP_FLASH_MODE=dio CIRCUITPY_ESP_FLASH_FREQ=40m CIRCUITPY_ESP_FLASH_SIZE=4MB diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk index 1437df7f4b..d5ff1c5ac8 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk @@ -10,8 +10,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_NEOPIXEL_WRITE = 0 - CIRCUITPY_ESP_FLASH_MODE=dio CIRCUITPY_ESP_FLASH_FREQ=40m CIRCUITPY_ESP_FLASH_SIZE=4MB diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk index ea3484d2fa..294736d17c 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk @@ -4,7 +4,6 @@ USB_PRODUCT = "FeatherS2" USB_MANUFACTURER = "UnexpectedMaker" USB_DEVICES = "CDC,MSC,HID" - INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ @@ -12,8 +11,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_NEOPIXEL_WRITE = 0 - CIRCUITPY_ESP_FLASH_MODE=qio CIRCUITPY_ESP_FLASH_FREQ=40m CIRCUITPY_ESP_FLASH_SIZE=16MB diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 20a30c82ec..a7873aa468 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -12,8 +12,6 @@ USB_SERIAL_NUMBER_LENGTH = 12 # Longints can be implemented as mpz, as longlong, or not LONGINT_IMPL = MPZ -CIRCUITPY_NEOPIXEL_WRITE = 1 - # These modules are implemented in ports//common-hal: CIRCUITPY_ANALOGIO = 0 CIRCUITPY_NVM = 0 diff --git a/supervisor/shared/rgb_led_status.c b/supervisor/shared/rgb_led_status.c index b66bbd9d56..fe99129f8a 100644 --- a/supervisor/shared/rgb_led_status.c +++ b/supervisor/shared/rgb_led_status.c @@ -387,22 +387,22 @@ void prep_rgb_status_animation(const pyexec_result_t* result, if (!status->ok) { status->total_exception_cycle = EXCEPTION_TYPE_LENGTH_MS * 3 + LINE_NUMBER_TOGGLE_LENGTH * status->digit_sum + LINE_NUMBER_TOGGLE_LENGTH * num_places; } - if (result->exception_type) { - if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_IndentationError)) { - status->exception_color = INDENTATION_ERROR; - } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_SyntaxError)) { - status->exception_color = SYNTAX_ERROR; - } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_NameError)) { - status->exception_color = NAME_ERROR; - } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_OSError)) { - status->exception_color = OS_ERROR; - } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_ValueError)) { - status->exception_color = VALUE_ERROR; - } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_MpyError)) { - status->exception_color = MPY_ERROR; - } else { - status->exception_color = OTHER_ERROR; - } + if (!result->exception_type) { + status->exception_color = OTHER_ERROR; + } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_IndentationError)) { + status->exception_color = INDENTATION_ERROR; + } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_SyntaxError)) { + status->exception_color = SYNTAX_ERROR; + } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_NameError)) { + status->exception_color = NAME_ERROR; + } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_OSError)) { + status->exception_color = OS_ERROR; + } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_ValueError)) { + status->exception_color = VALUE_ERROR; + } else if (mp_obj_is_subclass_fast(result->exception_type, &mp_type_MpyError)) { + status->exception_color = MPY_ERROR; + } else { + status->exception_color = OTHER_ERROR; } #endif } From 1607100fc23a6954bb2c69491d67b396d7f63d2c Mon Sep 17 00:00:00 2001 From: _fonzlate Date: Mon, 10 Aug 2020 19:17:26 +0000 Subject: [PATCH 0532/1293] Translated using Weblate (Dutch) Currently translated at 100.0% (773 of 773 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/nl/ --- locale/nl.po | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index f9f0ddf893..c43b9c8970 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-08-04 18:42-0500\n" -"PO-Revision-Date: 2020-08-02 20:41+0000\n" +"PO-Revision-Date: 2020-08-10 19:59+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" "Language: nl\n" @@ -82,7 +82,7 @@ msgstr "%q index buiten bereik" #: py/obj.c msgid "%q indices must be integers, not %q" -msgstr "" +msgstr "%q indices moeten integers zijn, geen %q" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -122,39 +122,39 @@ msgstr "'%q' argument vereist" #: py/runtime.c msgid "'%q' object cannot assign attribute '%q'" -msgstr "" +msgstr "'%q' object kan attribuut ' %q' niet toewijzen" #: py/proto.c msgid "'%q' object does not support '%q'" -msgstr "" +msgstr "'%q' object ondersteunt geen '%q'" #: py/obj.c msgid "'%q' object does not support item assignment" -msgstr "" +msgstr "'%q' object ondersteunt toewijzing van items niet" #: py/obj.c msgid "'%q' object does not support item deletion" -msgstr "" +msgstr "'%q' object ondersteunt verwijderen van items niet" #: py/runtime.c msgid "'%q' object has no attribute '%q'" -msgstr "" +msgstr "'%q' object heeft geen attribuut '%q'" #: py/runtime.c msgid "'%q' object is not an iterator" -msgstr "" +msgstr "'%q' object is geen iterator" #: py/objtype.c py/runtime.c msgid "'%q' object is not callable" -msgstr "" +msgstr "'%q' object is niet aanroepbaar" #: py/runtime.c msgid "'%q' object is not iterable" -msgstr "" +msgstr "'%q' object is niet itereerbaar" #: py/obj.c msgid "'%q' object is not subscriptable" -msgstr "" +msgstr "kan niet abonneren op '%q' object" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -1253,7 +1253,7 @@ msgstr "Wordt niet afgespeeld" #: main.c msgid "Not running saved code.\n" -msgstr "" +msgstr "Opgeslagen code wordt niet uitgevoerd.\n" #: shared-bindings/util.c msgid "" @@ -1427,7 +1427,7 @@ msgstr "Rij invoeging moet digitalio.DigitalInOut zijn" #: main.c msgid "Running in safe mode! " -msgstr "" +msgstr "Veilige modus wordt uitgevoerd! " #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1809,7 +1809,7 @@ msgstr "__init __ () zou None moeten retourneren" #: py/objtype.c msgid "__init__() should return None, not '%q'" -msgstr "" +msgstr "__init__() moet None teruggeven, niet '%q'" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1997,7 +1997,7 @@ msgstr "kan niet toewijzen aan expressie" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert %q to %q" -msgstr "" +msgstr "kan %q niet naar %q converteren" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" @@ -2005,7 +2005,7 @@ msgstr "kan '%q' object niet omzetten naar %q impliciet" #: py/obj.c msgid "can't convert to %q" -msgstr "" +msgstr "kan niet naar %q converteren" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2825,7 +2825,7 @@ msgstr "aantal punten moet minimaal 2 zijn" #: py/obj.c msgid "object '%q' is not a tuple or list" -msgstr "" +msgstr "object '%q' is geen tuple of lijst" #: py/obj.c msgid "object does not support item assignment" @@ -2861,7 +2861,7 @@ msgstr "object niet itereerbaar" #: py/obj.c msgid "object of type '%q' has no len()" -msgstr "" +msgstr "object van type '%q' heeft geen len()" #: py/obj.c msgid "object with buffer protocol required" @@ -2957,7 +2957,7 @@ msgstr "" #: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c #: shared-bindings/ps2io/Ps2.c msgid "pop from empty %q" -msgstr "" +msgstr "pop van een lege %q" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3116,7 +3116,7 @@ msgstr "stream operatie niet ondersteund" #: py/objstrunicode.c msgid "string indices must be integers, not %q" -msgstr "" +msgstr "string indices moeten integers zijn, geen %q" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3263,7 +3263,7 @@ msgstr "onbekende conversiespecificatie %c" #: py/objstr.c msgid "unknown format code '%c' for object of type '%q'" -msgstr "" +msgstr "onbekende formaatcode '%c' voor object van type '%q'" #: py/compile.c msgid "unknown type" @@ -3303,7 +3303,7 @@ msgstr "niet ondersteund formaatkarakter '%c' (0x%x) op index %d" #: py/runtime.c msgid "unsupported type for %q: '%q'" -msgstr "" +msgstr "niet ondersteund type voor %q: '%q'" #: py/runtime.c msgid "unsupported type for operator" @@ -3311,7 +3311,7 @@ msgstr "niet ondersteund type voor operator" #: py/runtime.c msgid "unsupported types for %q: '%q', '%q'" -msgstr "" +msgstr "niet ondersteunde types voor %q: '%q', '%q'" #: py/objint.c #, c-format From 4613b58a31c8d439d92961f2034eb9f60b0d97c1 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 10 Aug 2020 18:00:50 -0400 Subject: [PATCH 0533/1293] Add skip for rgb matrix exception handling --- main.c | 2 +- supervisor/shared/rgb_led_status.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 8c5c9ac37d..7c69cde083 100755 --- a/main.c +++ b/main.c @@ -276,7 +276,7 @@ bool run_code_py(safe_mode_t safe_mode) { } } - // Wait for connection or character. + // Display a different completion message if the user has no USB attached (cannot save files) if (!serial_connected_at_start) { serial_write_compressed(translate("\nCode done running. Waiting for reload.\n")); } diff --git a/supervisor/shared/rgb_led_status.c b/supervisor/shared/rgb_led_status.c index fe99129f8a..2f23e31258 100644 --- a/supervisor/shared/rgb_led_status.c +++ b/supervisor/shared/rgb_led_status.c @@ -366,6 +366,11 @@ void prep_rgb_status_animation(const pyexec_result_t* result, status->safe_mode = safe_mode; status->found_main = found_main; status->total_exception_cycle = 0; + status->ok = result->return_code != PYEXEC_EXCEPTION; + if (status->ok) { + // If this isn't an exception, skip exception sorting and handling + return; + } status->ones = result->exception_line % 10; status->ones += status->ones > 0 ? 1 : 0; status->tens = (result->exception_line / 10) % 10; @@ -383,7 +388,6 @@ void prep_rgb_status_animation(const pyexec_result_t* result, } line /= 10; } - status->ok = result->return_code != PYEXEC_EXCEPTION; if (!status->ok) { status->total_exception_cycle = EXCEPTION_TYPE_LENGTH_MS * 3 + LINE_NUMBER_TOGGLE_LENGTH * status->digit_sum + LINE_NUMBER_TOGGLE_LENGTH * num_places; } From 1b7709f3250289ac746090306425734a5e4294a3 Mon Sep 17 00:00:00 2001 From: Roy Hooper Date: Mon, 10 Aug 2020 18:05:13 -0400 Subject: [PATCH 0534/1293] use the stack --- shared-bindings/_pixelbuf/PixelBuf.c | 14 ++++++++++++-- shared-bindings/_pixelbuf/PixelBuf.h | 2 +- shared-module/_pixelbuf/PixelBuf.c | 17 ++++++++--------- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 1ffca7edf4..88e8aa8010 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -309,6 +309,16 @@ STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp size_t length = common_hal__pixelbuf_pixelbuf_get_len(self_in); mp_seq_get_fast_slice_indexes(length, index_in, &slice); + static mp_obj_tuple_t flat_item_tuple = { + .base = {&mp_type_tuple}, + .len = 0, + .items = { + mp_const_none, + mp_const_none, + mp_const_none, + mp_const_none, + } + }; size_t slice_len; if (slice.step > 0) { @@ -335,8 +345,8 @@ STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp if (num_items != slice_len && num_items != (slice_len * common_hal__pixelbuf_pixelbuf_get_bpp(self_in))) { mp_raise_ValueError_varg(translate("Unmatched number of items on RHS (expected %d, got %d)."), slice_len, num_items); } - - common_hal__pixelbuf_pixelbuf_set_pixels(self_in, slice.start, slice.step, slice_len, value, num_items != slice_len); + common_hal__pixelbuf_pixelbuf_set_pixels(self_in, slice.start, slice.step, slice_len, value, + num_items != slice_len ? &flat_item_tuple : mp_const_none); return mp_const_none; #else return MP_OBJ_NULL; // op not supported diff --git a/shared-bindings/_pixelbuf/PixelBuf.h b/shared-bindings/_pixelbuf/PixelBuf.h index 111223be0d..d410820591 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.h +++ b/shared-bindings/_pixelbuf/PixelBuf.h @@ -47,6 +47,6 @@ void common_hal__pixelbuf_pixelbuf_fill(mp_obj_t self, mp_obj_t item); void common_hal__pixelbuf_pixelbuf_show(mp_obj_t self); mp_obj_t common_hal__pixelbuf_pixelbuf_get_pixel(mp_obj_t self, size_t index); void common_hal__pixelbuf_pixelbuf_set_pixel(mp_obj_t self, size_t index, mp_obj_t item); -void common_hal__pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, size_t start, mp_int_t step, size_t slice_len, mp_obj_t* values, bool flattened); +void common_hal__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); #endif // CP_SHARED_BINDINGS_PIXELBUF_PIXELBUF_H diff --git a/shared-module/_pixelbuf/PixelBuf.c b/shared-module/_pixelbuf/PixelBuf.c index 0dc2a5ab8f..f3e679631e 100644 --- a/shared-module/_pixelbuf/PixelBuf.c +++ b/shared-module/_pixelbuf/PixelBuf.c @@ -230,22 +230,21 @@ void _pixelbuf_set_pixel(pixelbuf_pixelbuf_obj_t* self, size_t index, mp_obj_t v _pixelbuf_set_pixel_color(self, index, r, g, b, w); } -void common_hal__pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, size_t start, mp_int_t step, size_t slice_len, mp_obj_t* values, bool flattened) { +void common_hal__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) +{ pixelbuf_pixelbuf_obj_t* self = native_pixelbuf(self_in); mp_obj_iter_buf_t iter_buf; mp_obj_t iterable = mp_getiter(values, &iter_buf); mp_obj_t item; size_t i = 0; - mp_obj_tuple_t *tuple; - uint bpp = self->bytes_per_pixel; - if (flattened) { - tuple = MP_OBJ_TO_PTR(mp_obj_new_tuple(bpp, NULL)); - } + bool flattened = flatten_to != mp_const_none; + if (flattened) flatten_to->len = self->bytes_per_pixel; while ((item = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) { if (flattened) { - tuple->items[i % bpp] = item; - if (++i % bpp == 0) { - _pixelbuf_set_pixel(self, start, tuple); + flatten_to->items[i % self->bytes_per_pixel] = item; + if (++i % self->bytes_per_pixel == 0) { + _pixelbuf_set_pixel(self, start, flatten_to); start+=step; } } else { From 74034d6b9d14bf70a5a65e3f001998f6716c7d46 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 10 Aug 2020 19:46:18 -0400 Subject: [PATCH 0535/1293] characteristic/cccd r/w; not tested --- devices/ble_hci/common-hal/_bleio/Attribute.h | 15 - devices/ble_hci/common-hal/_bleio/Service.c | 4 +- devices/ble_hci/common-hal/_bleio/UUID.c | 5 + devices/ble_hci/common-hal/_bleio/UUID.h | 17 + devices/ble_hci/common-hal/_bleio/__init__.c | 2 +- devices/ble_hci/common-hal/_bleio/att.c | 388 ++++++++---------- devices/ble_hci/common-hal/_bleio/att.h | 2 - 7 files changed, 193 insertions(+), 240 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Attribute.h b/devices/ble_hci/common-hal/_bleio/Attribute.h index f4b0b7dbba..b8702cae45 100644 --- a/devices/ble_hci/common-hal/_bleio/Attribute.h +++ b/devices/ble_hci/common-hal/_bleio/Attribute.h @@ -30,21 +30,6 @@ #include "shared-module/_bleio/Attribute.h" #include "shared-bindings/_bleio/UUID.h" -// Types returned by attribute table lookups. These are UUIDs. -typedef enum { - BLE_TYPE_UNKNOWN = 0x0000, - BLE_TYPE_SERVICE_PRIMARY = 0x2800, - BLE_TYPE_SERVICE_SECONDARY = 0x2801, - BLE_TYPE_SERVICE_INCLUDE = 0x2802, // not yet implemented by us - BLE_TYPE_CHARACTERISTIC = 0x2803, - BLE_TYPE_CHAR_EXTENDED_PROPS = 0x2900, // not yet implemented by us - BLE_TYPE_CHAR_USER_DESC = 0x2901, // not yet implemented by us - BLE_TYPE_CCCD = 0x2902, - BLE_TYPE_SCCD = 0x2903, // not yet implemented by us - BLE_TYPE_CHAR_PRESENTATION_FMT = 0x2904, // not yet implemented by us - BLE_TYPE_CHAR_AGGREGATE_FMT = 0x2905, // not yet implemented by us -} ble_attribute_type_uuid; - bleio_uuid_obj_t *bleio_attribute_get_uuid(mp_obj_t *attribute); #endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_ATTRIBUTE_H diff --git a/devices/ble_hci/common-hal/_bleio/Service.c b/devices/ble_hci/common-hal/_bleio/Service.c index b6963b7a4a..0b6c830022 100644 --- a/devices/ble_hci/common-hal/_bleio/Service.c +++ b/devices/ble_hci/common-hal/_bleio/Service.c @@ -104,7 +104,7 @@ void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, cccd->base.type = &bleio_descriptor_type; uint16_t zero = 0; - mp_buffer_info_t zero_cccd = { + mp_buffer_info_t zero_cccd_value = { .buf = &zero, .len = sizeof(zero), }; @@ -117,7 +117,7 @@ void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, characteristic->read_perm, // Make CCCD write perm match characteristic read perm. 2, // 2 bytes true, // fixed length - &zero_cccd // Initial value is 0. + &zero_cccd_value // Initial value is 0. ); // Adds CCCD to attribute table, and also extends self->end_handle to include the CCCD. diff --git a/devices/ble_hci/common-hal/_bleio/UUID.c b/devices/ble_hci/common-hal/_bleio/UUID.c index fd8d8bfe9e..a50efc3b1e 100644 --- a/devices/ble_hci/common-hal/_bleio/UUID.c +++ b/devices/ble_hci/common-hal/_bleio/UUID.c @@ -68,3 +68,8 @@ void common_hal_bleio_uuid_pack_into(bleio_uuid_obj_t *self, uint8_t* buf) { common_hal_bleio_uuid_get_uuid128(self, buf); } } + +// Return a uui16 only if this is a standard uuid. Otherwise return BLE_UUID_UNKNOWN. +uint16_t bleio_uuid_get_uuid16_or_unknown(bleio_uuid_obj_t *uuid) { + return uuid->size == 16 ? uuid->uuid16 : BLE_UUID_UNKNOWN; +} diff --git a/devices/ble_hci/common-hal/_bleio/UUID.h b/devices/ble_hci/common-hal/_bleio/UUID.h index deaf76d5c6..1a0ab91c44 100644 --- a/devices/ble_hci/common-hal/_bleio/UUID.h +++ b/devices/ble_hci/common-hal/_bleio/UUID.h @@ -31,6 +31,21 @@ #include "py/obj.h" +// Types returned by attribute table lookups. These are UUIDs. +typedef enum { + BLE_UUID_UNKNOWN = 0x0000, + BLE_UUID_SERVICE_PRIMARY = 0x2800, + BLE_UUID_SERVICE_SECONDARY = 0x2801, + BLE_UUID_SERVICE_INCLUDE = 0x2802, // not yet implemented by us + BLE_UUID_CHARACTERISTIC = 0x2803, + BLE_UUID_CHAR_EXTENDED_PROPS = 0x2900, // not yet implemented by us + BLE_UUID_CHAR_USER_DESC = 0x2901, // not yet implemented by us + BLE_UUID_CCCD = 0x2902, + BLE_UUID_SCCD = 0x2903, // not yet implemented by us + BLE_UUID_CHAR_PRESENTATION_FMT = 0x2904, // not yet implemented by us + BLE_UUID_CHAR_AGGREGATE_FMT = 0x2905, // not yet implemented by us +} ble_standard_uuid; + typedef struct { mp_obj_base_t base; uint8_t size; @@ -38,4 +53,6 @@ typedef struct { uint8_t uuid128[16]; } bleio_uuid_obj_t; +uint16_t bleio_uuid_get_uuid16_or_unknown(bleio_uuid_obj_t *uuid); + #endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_UUID_H diff --git a/devices/ble_hci/common-hal/_bleio/__init__.c b/devices/ble_hci/common-hal/_bleio/__init__.c index 16b4a26e29..e2b463af8a 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.c +++ b/devices/ble_hci/common-hal/_bleio/__init__.c @@ -117,7 +117,7 @@ void check_hci_error(hci_result_t result) { void bleio_reset() { // Create a UUID object for all CCCD's. cccd_uuid.base.type = &bleio_uuid_type; - common_hal_bleio_uuid_construct(&cccd_uuid, BLE_TYPE_CCCD, NULL); + common_hal_bleio_uuid_construct(&cccd_uuid, BLE_UUID_CCCD, NULL); bleio_hci_reset(); diff --git a/devices/ble_hci/common-hal/_bleio/att.c b/devices/ble_hci/common-hal/_bleio/att.c index 8daddd3a96..e19a73558e 100644 --- a/devices/ble_hci/common-hal/_bleio/att.c +++ b/devices/ble_hci/common-hal/_bleio/att.c @@ -90,29 +90,32 @@ STATIC uint8_t bleio_properties_to_ble_spec_properties(uint8_t bleio_properties) return ble_spec_properties; } -// STATIC uint8_t ble_spec_properties_to_bleio_properties(uint8_t ble_spec_properties) { -// uint8_t bleio_properties = 0; -// if (ble_spec_properties & BT_GATT_CHRC_BROADCAST) { -// bleio_properties |= CHAR_PROP_BROADCAST; -// } -// if (ble_spec_properties & BT_GATT_CHRC_INDICATE) { -// bleio_properties |= CHAR_PROP_INDICATE; -// } -// if (ble_spec_properties & BT_GATT_CHRC_NOTIFY) { -// bleio_properties |= CHAR_PROP_NOTIFY; -// } -// if (ble_spec_properties & BT_GATT_CHRC_READ) { -// bleio_properties |= CHAR_PROP_READ; -// } -// if (ble_spec_properties & BT_GATT_CHRC_WRITE) { -// bleio_properties |= CHAR_PROP_WRITE; -// } -// if (ble_spec_properties & BT_GATT_CHRC_WRITE_WITHOUT_RESP) { -// bleio_properties |= CHAR_PROP_WRITE_NO_RESPONSE; -// } +//FIX not currently used; reenable when used. +#if 0 +STATIC uint8_t ble_spec_properties_to_bleio_properties(uint8_t ble_spec_properties) { + uint8_t bleio_properties = 0; + if (ble_spec_properties & BT_GATT_CHRC_BROADCAST) { + bleio_properties |= CHAR_PROP_BROADCAST; + } + if (ble_spec_properties & BT_GATT_CHRC_INDICATE) { + bleio_properties |= CHAR_PROP_INDICATE; + } + if (ble_spec_properties & BT_GATT_CHRC_NOTIFY) { + bleio_properties |= CHAR_PROP_NOTIFY; + } + if (ble_spec_properties & BT_GATT_CHRC_READ) { + bleio_properties |= CHAR_PROP_READ; + } + if (ble_spec_properties & BT_GATT_CHRC_WRITE) { + bleio_properties |= CHAR_PROP_WRITE; + } + if (ble_spec_properties & BT_GATT_CHRC_WRITE_WITHOUT_RESP) { + bleio_properties |= CHAR_PROP_WRITE_NO_RESPONSE; + } -// return bleio_properties; -// } + return bleio_properties; +} +#endif // #if 0 STATIC void send_error(uint16_t conn_handle, uint8_t opcode, uint16_t handle, uint8_t code) { struct __packed { @@ -244,7 +247,7 @@ bool att_disconnect_from_address(bt_addr_le_t *addr) { // BLEUuid serviceUuid(serviceUuidFilter); // while (reqEnd_handle == 0xffff) { -// int respLength = readByGroupReq(conn_handle, reqStart_handle, reqEnd_handle, BLE_TYPE_SERVICE_PRIMARY, response_buffer); +// int respLength = readByGroupReq(conn_handle, reqStart_handle, reqEnd_handle, BLE_UUID_SERVICE_PRIMARY, response_buffer); // if (respLength == 0) { // return false; @@ -305,7 +308,7 @@ bool att_disconnect_from_address(bt_addr_le_t *addr) { // reqEnd_handle = service->end_handle(); // while (1) { -// int respLength = readByTypeReq(conn_handle, reqStart_handle, reqEnd_handle, BLE_TYPE_CHARACTERISTIC, response_buffer); +// int respLength = readByTypeReq(conn_handle, reqStart_handle, reqEnd_handle, BLE_UUID_CHARACTERISTIC, response_buffer); // if (respLength == 0) { // return false; @@ -532,24 +535,30 @@ void att_remove_connection(uint16_t handle, uint8_t reason) { } if (peer_index == -1) { - // bail not found + // Peer not found return; } - //FIX BLEDevice bleDevice(bleio_connections[peer_index].address_type, bleio_connections[peer_index].address); - if (peer_count == 1) { - //FIX - // clear CCCD values on disconnect - // for (uint16_t i = 0; i < GATT.attributeCount(); i++) { - // BLELocalAttribute* attribute = GATT.attribute(i); - // if (attribute->type() == BLE_TYPE_CHARACTERISTIC) { - // BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)attribute; + // Clear CCCD values on disconnect. + size_t max_attribute_handle = bleio_adapter_max_attribute_handle(&common_hal_bleio_adapter_obj); + for (size_t i = 1; handle <= max_attribute_handle; i++) { + mp_obj_t attribute_obj = bleio_adapter_get_attribute(&common_hal_bleio_adapter_obj, handle); - // characteristic->writeCccdValue(bleDevice, 0x0000); - // } - // } + uint16_t zero = 0; + mp_buffer_info_t zero_cccd_value = { + .buf = &zero, + .len = sizeof(zero), + }; + + if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_descriptor_type)) { + bleio_descriptor_obj_t *descriptor = MP_OBJ_TO_PTR(attribute_obj); + if (bleio_uuid_get_uuid16_or_unknown(descriptor->uuid) == BLE_UUID_CCCD) { + common_hal_bleio_descriptor_set_value(descriptor, &zero_cccd_value); + } + } + } long_write_handle = BLE_GATT_HANDLE_INVALID; long_write_value_length = 0; @@ -564,11 +573,6 @@ void att_remove_connection(uint16_t handle, uint8_t reason) { bleio_connections[peer_index].role = 0x00; memset(&bleio_connections[peer_index].addr, 0x00, sizeof(bleio_connections[peer_index].addr)); bleio_connections[peer_index].mtu = BT_ATT_DEFAULT_LE_MTU; - - //FIX if (bleio_connections[peer_index].device) { - //FIX delete bleio_connections[peer_index].device; - // } - //FIX bleio_connections[peer_index].device = NULL; } uint16_t att_conn_handle(bt_addr_le_t *addr) { @@ -582,17 +586,6 @@ uint16_t att_conn_handle(bt_addr_le_t *addr) { return 0xffff; } -//FIX -// BLERemoteDevice* att_device(uint8_t address_type, const uint8_t address[6]) { -// for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { -// if (bleio_connections[i].addr.type == addr->type && -// memcmp(&bleio_connections[i].addr.a.val, addr->a.val, sizeof(addr->a.val)) == 0) { -// } -// } - -// return NULL; -// } - bool att_is_connected(void) { for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { if (bleio_connections[i].conn_handle != 0xffff) { @@ -648,30 +641,11 @@ bool att_disconnect_all(void) { bleio_connections[i].addr.type = 0; memset(bleio_connections[i].addr.a.val, 0, sizeof(bleio_connections[i].addr.a.val)); bleio_connections[i].mtu = BT_ATT_DEFAULT_LE_MTU; - - //FIX - // if (bleio_connections[i].device) { - // delete bleio_connections[i].device; - // } - // bleio_connections[i].device = NULL; } return (num_disconnects > 0); } -// FIX -// BLEDevice att_central() { -// for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { -// if (bleio_connections[i].conn_handle == 0xffff || bleio_connections[i].role != 0x01) { -// continue; -// } - -// return BLEDevice(bleio_connections[i].address_type, bleio_connections[i].address); -// } - -// return BLEDevice(); -// } - bool att_notify(uint16_t handle, const uint8_t* value, int length) { int num_notifications = 0; @@ -938,7 +912,7 @@ STATIC void process_find_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl response_length = 1; //FIX - // if (find_type_req->type == BLE_TYPE_SERVICE_PRIMARY) { + // if (find_type_req->type == BLE_UUID_SERVICE_PRIMARY) { // for (uint16_t i = (find_type_req->start_handle - 1); i < GATT.attributeCount() && i <= (find_type_req->end_handle - 1); i++) { // BLELocalAttribute* attribute = GATT.attribute(i); @@ -976,8 +950,8 @@ void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, ui // We only support returning services for BT_ATT_OP_READ_GROUP_REQ, which is typically used // for service discovery. if (dlen != sizeof(struct bt_att_read_group_req) + sizeof(type_uuid) || - (type_uuid != BLE_TYPE_SERVICE_PRIMARY && - type_uuid != BLE_TYPE_SERVICE_SECONDARY)) { + (type_uuid != BLE_UUID_SERVICE_PRIMARY && + type_uuid != BLE_UUID_SERVICE_SECONDARY)) { send_error(conn_handle, BT_ATT_OP_READ_GROUP_REQ, req->start_handle, BT_ATT_ERR_UNSUPPORTED_GROUP_TYPE); return; } @@ -1109,95 +1083,93 @@ STATIC void process_read_or_read_blob_req(uint16_t conn_handle, uint16_t mtu, ui } - //FIX - (void) offset; - (void) handle; - //FIX if ((uint16_t)(handle - 1) > GATT.attributeCount()) { - // send_error(conn_handle, opcode, handle, BT_ATT_ERR_ATTR_NOT_FOUND); - // return; - // } + if (handle > bleio_adapter_max_attribute_handle(&common_hal_bleio_adapter_obj)) { + send_error(conn_handle, opcode, handle, BT_ATT_ERR_ATTRIBUTE_NOT_FOUND); + return; + } - uint8_t response[mtu]; - uint16_t response_length; + typedef struct __packed { + struct bt_att_hdr h; + struct bt_att_read_rsp r; // Same as bt_att_read_blob_rsp. + } rsp_t; - response[0] = response_opcode; - response_length = 1; + uint8_t rsp_bytes[mtu]; + rsp_t *rsp = (rsp_t *) rsp_bytes; + rsp->h.code = response_opcode; - //FIX BLELocalAttribute* attribute = GATT.attribute(handle - 1); - // enum BLEAttributeType attributeType = attribute->type(); + // Keeps track of total length of the response. + size_t rsp_length = sizeof(rsp_t); - // if (attributeType == BLE_TYPE_SERVICE_PRIMARY) { - // if (offset) { - // send_error(conn_handle, BT_ATT_ERR_ATTR_NOT_LONG, handle, BT_ATT_ERR_INVALID_PDU); - // return; - // } + mp_obj_t *attribute_obj = bleio_adapter_get_attribute(&common_hal_bleio_adapter_obj, handle); + if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_service_type)) { + if (offset) { + send_error(conn_handle, BT_ATT_ERR_ATTRIBUTE_NOT_LONG, handle, BT_ATT_ERR_INVALID_PDU); + return; + } - // BLELocalService* service = (BLELocalService*)attribute; + bleio_service_obj_t *service = MP_OBJ_TO_PTR(attribute_obj); + const uint32_t sizeof_service_uuid = common_hal_bleio_uuid_get_size(service->uuid) / 8; - // // add the UUID - // uint8_t uuidLen = service->uuidLength(); - // memcpy(&response[response_length], service->uuidData(), uuidLen); - // response_length += uuidLen; - // } else if (attributeType == BLE_TYPE_CHARACTERISTIC) { - // BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)attribute; + common_hal_bleio_uuid_pack_into(service->uuid, rsp->r.value); + rsp_length += sizeof_service_uuid; - // if (characteristic->handle() == handle) { - // if (offset) { - // send_error(conn_handle, opcode, handle, BT_ATT_ERR_ATTR_NOT_LONG); - // return; - // } + } else if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_characteristic_type)) { + bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(attribute_obj); + if (characteristic->decl_handle == handle) { + // Read characteristic declaration. Return properties, value handle, and uuid. + if (offset) { + send_error(conn_handle, opcode, handle, BT_ATT_ERR_ATTRIBUTE_NOT_LONG); + return; + } - // // add the properties - // response[response_length++] = characteristic->properties(); + characteristic_declaration_t *char_decl = (characteristic_declaration_t *) rsp->r.value; - // // add the value handle - // uint16_t value_handle = characteristic->value_handle(); - // memcpy(&response[response_length], &value_handle, sizeof(value_handle)); - // response_length += sizeof(value_handle); + // Convert from the bleio properties bit values to the BLE spec properties bit values. + // They are not the same :(. + char_decl->properties = bleio_properties_to_ble_spec_properties(characteristic->props); + char_decl->value_handle = characteristic->handle; - // // add the UUID - // uint8_t uuidLen = characteristic->uuidLength(); - // memcpy(&response[response_length], characteristic->uuidData(), uuidLen); - // response_length += uuidLen; - // } else { - // if ((characteristic->properties() & BLERead) == 0) { - // send_error(conn_handle, opcode, handle, BT_ATT_ERR_READ_NOT_PERM); - // return; - // } + const uint32_t sizeof_char_uuid = common_hal_bleio_uuid_get_size(characteristic->uuid) / 8; + common_hal_bleio_uuid_pack_into(characteristic->uuid, char_decl->uuid); + rsp_length += sizeof_char_uuid; - // uint16_t value_length = characteristic->value_length(); + } else { + // Read characteristic value. - // if (offset >= value_length) { - // send_error(conn_handle, opcode, handle, BT_ATT_ERR_INVALID_OFFSET); - // return; - // } + if ((characteristic->props & CHAR_PROP_READ) == 0) { + send_error(conn_handle, opcode, handle, BT_ATT_ERR_READ_NOT_PERMITTED); + return; + } - // value_length = min(mtu - response_length, value_length - offset); + mp_buffer_info_t bufinfo; + mp_get_buffer(characteristic->value, &bufinfo, MP_BUFFER_READ); - // for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { - // if (bleio_connections[i].conn_handle == conn_handle) { - // // FIX characteristic->readValue(BLEDevice(bleio_connections[i].address_type, bleio_connections[i].address), offset, &response[response_length], value_length); - // response_length += value_length; - // } - // } - // } - // } else if (attributeType == BLE_TYPE_DESCRIPTOR) { - // BLELocalDescriptor* descriptor = (BLELocalDescriptor*)attribute; + if (offset >= bufinfo.len) { + send_error(conn_handle, opcode, handle, BT_ATT_ERR_INVALID_OFFSET); + return; + } - // uint16_t value_length = descriptor->valueSize(); + size_t value_length = MIN(mtu - rsp_length, bufinfo.len - offset); + memcpy(rsp->r.value, bufinfo.buf + offset, value_length); + rsp_length += value_length; + } + } else if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_descriptor_type)) { + bleio_descriptor_obj_t *descriptor = MP_OBJ_TO_PTR(attribute_obj); - // if (offset >= value_length) { - // send_error(conn_handle, opcode, handle, BT_ATT_ERR_INVALID_OFFSET); - // return; - // } + mp_buffer_info_t bufinfo; + mp_get_buffer(descriptor->value, &bufinfo, MP_BUFFER_READ); - // value_length = min(mtu - response_length, value_length - offset); + if (offset >= bufinfo.len) { + send_error(conn_handle, opcode, handle, BT_ATT_ERR_INVALID_OFFSET); + return; + } - // memcpy(&response[response_length], descriptor->value() + offset, value_length); - // response_length += value_length; - // } + size_t value_length = MIN(mtu - rsp_length, bufinfo.len - offset); + memcpy(rsp->r.value, bufinfo.buf + offset, value_length); + rsp_length += value_length; + } - hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, response_length, response); + hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, rsp_length, rsp_bytes); } STATIC void process_read_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { @@ -1248,7 +1220,7 @@ STATIC void process_read_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl mp_obj_t *attribute_obj = bleio_adapter_get_attribute(&common_hal_bleio_adapter_obj, handle); - if (type_uuid == BLE_TYPE_CHARACTERISTIC && + if (type_uuid == BLE_UUID_CHARACTERISTIC && MP_OBJ_IS_TYPE(attribute_obj, &bleio_characteristic_type)) { // Request is for characteristic declarations. bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(attribute_obj); @@ -1299,9 +1271,7 @@ STATIC void process_read_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl } else if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_descriptor_type)) { // See if request is for a descriptor value with a 16-bit UUID, such as the CCCD. bleio_descriptor_obj_t *descriptor = MP_OBJ_TO_PTR(attribute_obj); - if (common_hal_bleio_uuid_get_size(descriptor->uuid) == 16 && - common_hal_bleio_uuid_get_uuid16(descriptor->uuid) == type_uuid) { - + if (bleio_uuid_get_uuid16_or_unknown(descriptor->uuid) == type_uuid) { struct bt_att_data *att_data = (struct bt_att_data *) &rsp_bytes[rsp_length]; att_data->handle = handle; @@ -1322,8 +1292,7 @@ STATIC void process_read_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl } else if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_characteristic_type)) { // See if request is for a characteristic value with a 16-bit UUID. bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(attribute_obj); - if (common_hal_bleio_uuid_get_size(characteristic->uuid) == 16 && - common_hal_bleio_uuid_get_uuid16(characteristic->uuid) == type_uuid) { + if (bleio_uuid_get_uuid16_or_unknown(characteristic->uuid) == type_uuid) { struct bt_att_data *att_data = (struct bt_att_data *) &rsp_bytes[rsp_length]; @@ -1381,7 +1350,8 @@ STATIC void process_read_type_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t da // Handles BT_ATT_OP_WRITE_REQ or BT_ATT_OP_WRITE_ STATIC void process_write_req_or_cmd(uint16_t conn_handle, uint16_t mtu, uint8_t op, uint8_t dlen, uint8_t data[]) { // struct bt_att_write_cmd is identical, so don't bother to split code paths based on opcode. - //FIX REMOVE this later struct bt_att_write_req *req = (struct bt_att_write_req *) data; + struct bt_att_write_req *req = (struct bt_att_write_req *) data; + bool with_response = (op == BT_ATT_OP_WRITE_REQ); if (dlen < sizeof(struct bt_att_write_req)) { @@ -1391,81 +1361,59 @@ STATIC void process_write_req_or_cmd(uint16_t conn_handle, uint16_t mtu, uint8_t return; } - //FIX why cast? - // if ((uint16_t)(req->handle - 1) > GATT.attributeCount()) { - // if (with_response) { - // send_error(conn_handle, BT_ATT_OP_WRITE_REQ, handle, BT_ATT_ERR_ATTR_NOT_FOUND); - // } - // return; - // } + if (req->handle > bleio_adapter_max_attribute_handle(&common_hal_bleio_adapter_obj)) { + if (with_response) { + send_error(conn_handle, BT_ATT_OP_WRITE_REQ, req->handle, BT_ATT_ERR_ATTRIBUTE_NOT_FOUND); + } + return; + } - // uint8_t value_length = dlen - sizeof(req->handle); - // uint8_t* value = &data[sizeof(req->handle)]; + size_t value_length = dlen - sizeof(struct bt_att_write_req); - // BLELocalAttribute* attribute = GATT.attribute(req->handle - 1); + mp_buffer_info_t bufinfo; + bufinfo.buf = req->value; + bufinfo.len = value_length; - // if (attribute->type() == BLE_TYPE_CHARACTERISTIC) { - // BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)attribute; + mp_obj_t attribute_obj = bleio_adapter_get_attribute(&common_hal_bleio_adapter_obj, req->handle); - // if (req->handle != characteristic->value_handle() || - // withResponse ? ((characteristic->properties() & BLEWrite) == 0) : - // ((characteristic->properties() & BLEWriteWithoutResponse) == 0)) { - // if (withResponse) { - // send_error(conn_handle, BT_ATT_OP_WRITE_REQ, handle, BT_ATT_ERR_WRITE_NOT_PERM); - // } - // return; - // } + if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_characteristic_type)) { + bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(attribute_obj); - // for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { - // if (bleio_connections[i].conn_handle == conn_handle) { - // // FIX characteristic->writeValue(BLEDevice(bleio_connections[i].address_type, bleio_connections[i].address), value, value_length); - // break; - // } - // } - // } else if (attribute->type() == BLE_TYPE_DESCRIPTOR) { - // BLELocalDescriptor* descriptor = (BLELocalDescriptor*)attribute; + // Don't write the characteristic declaration. + // Also, this must be a writable characteristic. + if (req->handle != characteristic->handle || + (with_response + ? (characteristic->props & CHAR_PROP_WRITE) == 0 + : (characteristic->props & CHAR_PROP_WRITE_NO_RESPONSE) == 0)) { + if (with_response) { + send_error(conn_handle, BT_ATT_OP_WRITE_REQ, req->handle, BT_ATT_ERR_WRITE_NOT_PERMITTED); + } + return; + } - // // only CCCD's are writable - // if (descriptor->uuidLength() != 2 || *((uint16_t*)(descriptor->uuidData())) != 0x2902) { - // if (withResponse) { - // send_error(conn_handle, BT_ATT_OP_WRITE_REQ, handle, BT_ATT_ERR_WRITE_NOT_PERM); - // } - // return; - // } + common_hal_bleio_characteristic_set_value(characteristic, &bufinfo); - // // get the previous handle, should be the characteristic for the CCCD - // attribute = GATT.attribute(handle - 2); + } else if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_descriptor_type)) { + bleio_descriptor_obj_t *descriptor = MP_OBJ_TO_PTR(attribute_obj); + // Only CCCD's are writable. + if (bleio_uuid_get_uuid16_or_unknown(descriptor->uuid) != BLE_UUID_CCCD) { + if (with_response) { + send_error(conn_handle, BT_ATT_OP_WRITE_REQ, req->handle, BT_ATT_ERR_WRITE_NOT_PERMITTED); + } + return; + } - // if (attribute->type() != BLE_TYPE_CHARACTERISTIC) { - // if (withResponse) { - // send_error(conn_handle, BT_ATT_OP_WRITE_REQ, handle, BT_ATT_ERR_WRITE_NOT_PERM); - // } - // return; - // } - - // BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)attribute; - - // for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { - // if (bleio_connections[i].conn_handle == conn_handle) { - // //FIX characteristic->writeCccdValue(BLEDevice(bleio_connections[i].address_type, bleio_connections[i].address), *((uint16_t*)value)); - // break; - // } - // } - // } else { - // if (withResponse) { - // send_error(conn_handle, BT_ATT_OP_WRITE_REQ, handle, BT_ATT_ERR_WRITE_NOT_PERM); - // } - // return; - // } + //FIX need to set up event handlers, etc.? + common_hal_bleio_descriptor_set_value(descriptor, &bufinfo); + } if (with_response) { - uint8_t response[mtu]; - uint16_t response_length; + // There's no data in the response. We just indicate the write happened. + struct bt_att_hdr rsp = { + .code = BT_ATT_OP_READ_REQ, + }; - response[0] = BT_ATT_OP_WRITE_RSP; - response_length = 1; - - hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, response_length, response); + hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, sizeof(rsp), (uint8_t *) &rsp); } } @@ -1508,7 +1456,7 @@ STATIC void process_prepare_write_req(uint16_t conn_handle, uint16_t mtu, uint8_ return; } - if (characteristic->props & CHAR_PROP_WRITE) { + if ((characteristic->props & CHAR_PROP_WRITE) == 0) { send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, handle, BT_ATT_ERR_WRITE_NOT_PERMITTED); return; } @@ -1578,7 +1526,7 @@ STATIC void process_exec_write_req(uint16_t conn_handle, uint16_t mtu, uint8_t d hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, response_length, response); } -STATIC void process_handle_notify_or_indicate(uint16_t conn_handle, uint8_t opcode, uint8_t dlen, uint8_t data[]) { +STATIC void process_notify_or_indicate(uint16_t conn_handle, uint8_t opcode, uint8_t dlen, uint8_t data[]) { if (dlen < 2) { return; // drop } @@ -1629,7 +1577,7 @@ STATIC void process_handle_notify_or_indicate(uint16_t conn_handle, uint8_t opco } } -STATIC void process_handle_confirm(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { +STATIC void process_confirm(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { (void) conn_handle; (void) dlen; (void) data; @@ -1776,11 +1724,11 @@ void att_process_data(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { case BT_ATT_OP_NOTIFY: case BT_ATT_OP_INDICATE: - process_handle_notify_or_indicate(conn_handle, opcode, dlen, data); + process_notify_or_indicate(conn_handle, opcode, dlen, data); break; case BT_ATT_OP_CONFIRM: - process_handle_confirm(conn_handle, dlen, data); + process_confirm(conn_handle, dlen, data); break; case BT_ATT_OP_READ_MULT_REQ: diff --git a/devices/ble_hci/common-hal/_bleio/att.h b/devices/ble_hci/common-hal/_bleio/att.h index 48f7836e0e..820e86bfb6 100644 --- a/devices/ble_hci/common-hal/_bleio/att.h +++ b/devices/ble_hci/common-hal/_bleio/att.h @@ -32,8 +32,6 @@ void bleio_att_reset(void); -//FIX BLEDevice att_central(void); -//FIX BLERemoteDevice* att_device(uint8_t address_type, const uint8_t address[6]); //FIX void att_set_event_handler(BLEDeviceEvent event, BLEDeviceEventHandler eventHandler); bool att_address_is_connected(bt_addr_le_t *addr); bool att_connect_to_address(bt_addr_le_t *addr); From 87c78be8f4ba73d2c2745fb563926c9cb655cd7a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 10 Aug 2020 17:08:33 -0700 Subject: [PATCH 0536/1293] Fix writing sector 0 as the first write. This was the FS issue I saw when debugging wifi and only happens when the first write is to sector 0. It causes issues because it blanks all of sector 0 after the first block. Fixes #3133 --- ports/esp32s2/supervisor/internal_flash.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ports/esp32s2/supervisor/internal_flash.c b/ports/esp32s2/supervisor/internal_flash.c index 26774efac8..abc84eb7d9 100644 --- a/ports/esp32s2/supervisor/internal_flash.c +++ b/ports/esp32s2/supervisor/internal_flash.c @@ -43,10 +43,16 @@ STATIC const esp_partition_t * _partition; +// TODO: Split the caching out of supervisor/shared/external_flash so we can use it. +#define SECTOR_SIZE 4096 +STATIC uint8_t _cache[SECTOR_SIZE]; +STATIC uint32_t _cache_lba; + void supervisor_flash_init(void) { _partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_FAT, NULL); + _cache_lba = 0xffffffff; } uint32_t supervisor_flash_get_block_size(void) { @@ -61,11 +67,6 @@ void port_internal_flash_flush(void) { } -// TODO: Split the caching out of supervisor/shared/external_flash so we can use it. -#define SECTOR_SIZE 4096 -STATIC uint8_t _cache[SECTOR_SIZE]; -STATIC uint32_t _cache_lba; - mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { esp_partition_read(_partition, block * FILESYSTEM_BLOCK_SIZE, From 92cf56004fedb412cde1ac5159ef23df7398fa20 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 10 Aug 2020 22:33:20 -0400 Subject: [PATCH 0537/1293] blue_uart_echo_test from Bluefruit app is working --- devices/ble_hci/common-hal/_bleio/att.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/att.c b/devices/ble_hci/common-hal/_bleio/att.c index e19a73558e..603f1dde34 100644 --- a/devices/ble_hci/common-hal/_bleio/att.c +++ b/devices/ble_hci/common-hal/_bleio/att.c @@ -1032,7 +1032,7 @@ int att_read_group_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end struct bt_att_hdr h; struct bt_att_read_group_req r; } req = { { - .code = BT_ATT_OP_ERROR_RSP, + .code = BT_ATT_OP_READ_GROUP_REQ, }, { .start_handle = start_handle, .end_handle = end_handle, @@ -1410,7 +1410,7 @@ STATIC void process_write_req_or_cmd(uint16_t conn_handle, uint16_t mtu, uint8_t if (with_response) { // There's no data in the response. We just indicate the write happened. struct bt_att_hdr rsp = { - .code = BT_ATT_OP_READ_REQ, + .code = BT_ATT_OP_WRITE_RSP, }; hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, sizeof(rsp), (uint8_t *) &rsp); From 8488b31aa0671427f1f2b36b9c41d6a8b7b48ae7 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 11 Aug 2020 11:19:40 -0700 Subject: [PATCH 0538/1293] Init directly --- ports/esp32s2/supervisor/internal_flash.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/esp32s2/supervisor/internal_flash.c b/ports/esp32s2/supervisor/internal_flash.c index abc84eb7d9..4b216a095a 100644 --- a/ports/esp32s2/supervisor/internal_flash.c +++ b/ports/esp32s2/supervisor/internal_flash.c @@ -46,13 +46,12 @@ STATIC const esp_partition_t * _partition; // TODO: Split the caching out of supervisor/shared/external_flash so we can use it. #define SECTOR_SIZE 4096 STATIC uint8_t _cache[SECTOR_SIZE]; -STATIC uint32_t _cache_lba; +STATIC uint32_t _cache_lba = 0xffffffff; void supervisor_flash_init(void) { _partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_FAT, NULL); - _cache_lba = 0xffffffff; } uint32_t supervisor_flash_get_block_size(void) { From 00676ff5a90be956b982b39ae69d8251a5d83f9f Mon Sep 17 00:00:00 2001 From: bleeptrack Date: Tue, 11 Aug 2020 21:49:52 +0200 Subject: [PATCH 0539/1293] PicoPlanet --- ports/atmel-samd/boards/picoplanet/board.c | 37 ++++++++++ .../boards/picoplanet/mpconfigboard.h | 69 +++++++++++++++++++ .../boards/picoplanet/mpconfigboard.mk | 24 +++++++ ports/atmel-samd/boards/picoplanet/pins.c | 36 ++++++++++ 4 files changed, 166 insertions(+) create mode 100644 ports/atmel-samd/boards/picoplanet/board.c create mode 100644 ports/atmel-samd/boards/picoplanet/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/picoplanet/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/picoplanet/pins.c diff --git a/ports/atmel-samd/boards/picoplanet/board.c b/ports/atmel-samd/boards/picoplanet/board.c new file mode 100644 index 0000000000..d7e856d611 --- /dev/null +++ b/ports/atmel-samd/boards/picoplanet/board.c @@ -0,0 +1,37 @@ +/* + * 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 "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/picoplanet/mpconfigboard.h b/ports/atmel-samd/boards/picoplanet/mpconfigboard.h new file mode 100644 index 0000000000..9bcb78e44a --- /dev/null +++ b/ports/atmel-samd/boards/picoplanet/mpconfigboard.h @@ -0,0 +1,69 @@ +#define MICROPY_HW_BOARD_NAME "PicoPlanet" +#define MICROPY_HW_MCU_NAME "samd21e18" + + + +#define MICROPY_PORT_A (PORT_PA00 | PORT_PA01) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define IGNORE_PIN_PA00 1 +#define IGNORE_PIN_PA01 1 +#define IGNORE_PIN_PA10 1 +#define IGNORE_PIN_PA11 1 +#define IGNORE_PIN_PA12 1 +#define IGNORE_PIN_PA13 1 +#define IGNORE_PIN_PA14 1 +#define IGNORE_PIN_PA15 1 +#define IGNORE_PIN_PA18 1 +#define IGNORE_PIN_PA19 1 +#define IGNORE_PIN_PA20 1 +#define IGNORE_PIN_PA21 1 +#define IGNORE_PIN_PA22 1 +#define IGNORE_PIN_PA23 1 +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 +#define IGNORE_PIN_PA27 1 +#define IGNORE_PIN_PA28 1 +//#define IGNORE_PIN_PA30 1 +#define IGNORE_PIN_PA31 1 +#define IGNORE_PIN_PB01 1 +#define IGNORE_PIN_PB02 1 +#define IGNORE_PIN_PB03 1 +#define IGNORE_PIN_PB04 1 +#define IGNORE_PIN_PB05 1 +#define IGNORE_PIN_PB06 1 +#define IGNORE_PIN_PB07 1 +#define IGNORE_PIN_PB08 1 +#define IGNORE_PIN_PB09 1 +#define IGNORE_PIN_PB10 1 +#define IGNORE_PIN_PB11 1 +#define IGNORE_PIN_PB12 1 +#define IGNORE_PIN_PB13 1 +#define IGNORE_PIN_PB14 1 +#define IGNORE_PIN_PB15 1 +#define IGNORE_PIN_PB16 1 +#define IGNORE_PIN_PB17 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PB30 1 +#define IGNORE_PIN_PB31 1 +#define IGNORE_PIN_PB00 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA09) +#define DEFAULT_I2C_BUS_SDA (&pin_PA08) + +#define DEFAULT_SPI_BUS_MISO (&pin_PA30) +#define DEFAULT_SPI_BUS_SCK (&pin_PA17) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA16) + +//#define CP_RGB_STATUS_R (&pin_PA06) +//#define CP_RGB_STATUS_G (&pin_PA05) +//#define CP_RGB_STATUS_B (&pin_PA07) +//#define CP_RGB_STATUS_INVERTED_PWM +//#define CP_RGB_STATUS_LED + +#define MICROPY_HW_LED_STATUS (&pin_PA06) + + diff --git a/ports/atmel-samd/boards/picoplanet/mpconfigboard.mk b/ports/atmel-samd/boards/picoplanet/mpconfigboard.mk new file mode 100644 index 0000000000..da97b90cc2 --- /dev/null +++ b/ports/atmel-samd/boards/picoplanet/mpconfigboard.mk @@ -0,0 +1,24 @@ +USB_VID = 0x239A +USB_PID = 0x80C2 +USB_PRODUCT = "PicoPlanet" +USB_MANUFACTURER = "bleeptrack" + +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE +CIRCUITPY_FULL_BUILD = 0 + +SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif diff --git a/ports/atmel-samd/boards/picoplanet/pins.c b/ports/atmel-samd/boards/picoplanet/pins.c new file mode 100644 index 0000000000..9102bdf3af --- /dev/null +++ b/ports/atmel-samd/boards/picoplanet/pins.c @@ -0,0 +1,36 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, + + + { MP_ROM_QSTR(MP_QSTR_D5),MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_D6),MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D7),MP_ROM_PTR(&pin_PA07) }, + + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA16) }, + + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA17) }, + + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA30) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA30) }, + + { 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_global_dict_table); From 795ee3d36a5c3686f4656d09664d7660d0aec68d Mon Sep 17 00:00:00 2001 From: bleeptrack Date: Tue, 11 Aug 2020 21:51:11 +0200 Subject: [PATCH 0540/1293] update build.yml with picoplanet --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index feb6a7f633..bf9c1623f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -253,6 +253,7 @@ jobs: - "pca10100" - "pewpew10" - "pewpew_m4" + - "picoplanet" - "pirkey_m0" - "pitaya_go" - "pyb_nano_v2" From 22ae1dbac805e6474e892d0239c3ef21a3d71700 Mon Sep 17 00:00:00 2001 From: bleeptrack Date: Tue, 11 Aug 2020 22:17:17 +0200 Subject: [PATCH 0541/1293] Removing unnecessary pin ignored --- .../boards/picoplanet/mpconfigboard.h | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/ports/atmel-samd/boards/picoplanet/mpconfigboard.h b/ports/atmel-samd/boards/picoplanet/mpconfigboard.h index 9bcb78e44a..c5addf6394 100644 --- a/ports/atmel-samd/boards/picoplanet/mpconfigboard.h +++ b/ports/atmel-samd/boards/picoplanet/mpconfigboard.h @@ -26,30 +26,7 @@ #define IGNORE_PIN_PA25 1 #define IGNORE_PIN_PA27 1 #define IGNORE_PIN_PA28 1 -//#define IGNORE_PIN_PA30 1 #define IGNORE_PIN_PA31 1 -#define IGNORE_PIN_PB01 1 -#define IGNORE_PIN_PB02 1 -#define IGNORE_PIN_PB03 1 -#define IGNORE_PIN_PB04 1 -#define IGNORE_PIN_PB05 1 -#define IGNORE_PIN_PB06 1 -#define IGNORE_PIN_PB07 1 -#define IGNORE_PIN_PB08 1 -#define IGNORE_PIN_PB09 1 -#define IGNORE_PIN_PB10 1 -#define IGNORE_PIN_PB11 1 -#define IGNORE_PIN_PB12 1 -#define IGNORE_PIN_PB13 1 -#define IGNORE_PIN_PB14 1 -#define IGNORE_PIN_PB15 1 -#define IGNORE_PIN_PB16 1 -#define IGNORE_PIN_PB17 1 -#define IGNORE_PIN_PB22 1 -#define IGNORE_PIN_PB23 1 -#define IGNORE_PIN_PB30 1 -#define IGNORE_PIN_PB31 1 -#define IGNORE_PIN_PB00 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA09) #define DEFAULT_I2C_BUS_SDA (&pin_PA08) From 228d9b5a12194b23c36d568a5e6a1fa2d672ba03 Mon Sep 17 00:00:00 2001 From: bleeptrack Date: Tue, 11 Aug 2020 22:18:15 +0200 Subject: [PATCH 0542/1293] Fixing indentation --- ports/atmel-samd/boards/picoplanet/pins.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/ports/atmel-samd/boards/picoplanet/pins.c b/ports/atmel-samd/boards/picoplanet/pins.c index 9102bdf3af..512bd379e1 100644 --- a/ports/atmel-samd/boards/picoplanet/pins.c +++ b/ports/atmel-samd/boards/picoplanet/pins.c @@ -1,19 +1,15 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, - + { MP_ROM_QSTR(MP_QSTR_D5),MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_D6),MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D7),MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_D5),MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_D6),MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_D7),MP_ROM_PTR(&pin_PA07) }, - - - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, From 06f3b4048a4ec18d9e46444972d12dc677745793 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 11 Aug 2020 16:21:16 -0400 Subject: [PATCH 0543/1293] fix #3228 for nrf; still needs to be fixed for HCI; tested --- .../common-hal/_bleio/Characteristic.c | 28 ++++++++++--- .../common-hal/_bleio/Characteristic.h | 4 +- .../ble_hci/common-hal/_bleio/Connection.c | 22 +++++----- .../ble_hci/common-hal/_bleio/Connection.h | 2 +- ports/nrf/common-hal/_bleio/Adapter.c | 3 ++ ports/nrf/common-hal/_bleio/Characteristic.c | 10 ++--- ports/nrf/common-hal/_bleio/Characteristic.h | 2 +- ports/nrf/common-hal/_bleio/Connection.c | 42 ++++++++++--------- ports/nrf/common-hal/_bleio/Connection.h | 5 ++- ports/nrf/common-hal/_bleio/Descriptor.h | 1 - ports/nrf/common-hal/_bleio/Service.c | 4 +- ports/nrf/common-hal/_bleio/Service.h | 1 - shared-bindings/_bleio/Characteristic.c | 18 ++------ shared-bindings/_bleio/Characteristic.h | 10 ++--- shared-bindings/_bleio/Service.c | 24 +---------- shared-bindings/_bleio/Service.h | 4 +- shared-bindings/_bleio/__init__.h | 1 - 17 files changed, 85 insertions(+), 96 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Characteristic.c b/devices/ble_hci/common-hal/_bleio/Characteristic.c index b62957ea6a..4e69c3522c 100644 --- a/devices/ble_hci/common-hal/_bleio/Characteristic.c +++ b/devices/ble_hci/common-hal/_bleio/Characteristic.c @@ -47,7 +47,8 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, self->props = props; self->read_perm = read_perm; self->write_perm = write_perm; - self->descriptor_list = NULL; + self->descriptor_linked_list = mp_obj_new_list(0, NULL); + self->watchers_list = mp_obj_new_list(0, NULL); const mp_int_t max_length_max = 512; if (max_length < 0 || max_length > max_length_max) { @@ -67,8 +68,8 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, } } -bleio_descriptor_obj_t *common_hal_bleio_characteristic_get_descriptor_list(bleio_characteristic_obj_t *self) { - return self->descriptor_list; +bleio_descriptor_obj_t *common_hal_bleio_characteristic_get_descriptor_linked_list(bleio_characteristic_obj_t *self) { + return self->descriptor_linked_list; } bleio_service_obj_t *common_hal_bleio_characteristic_get_service(bleio_characteristic_obj_t *self) { @@ -153,8 +154,8 @@ void common_hal_bleio_characteristic_add_descriptor(bleio_characteristic_obj_t * self->service->end_handle = descriptor->handle; // Link together all the descriptors for this characteristic. - descriptor->next = self->descriptor_list; - self->descriptor_list = descriptor; + descriptor->next = self->descriptor_linked_list; + self->descriptor_linked_list = descriptor; } void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, bool notify, bool indicate) { @@ -201,3 +202,20 @@ void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, // } } + +bool bleio_characteristic_set_local_value(bleio_characteristic_obj_t *self, mp_buffer_info_t *bufinfo) { + if (self->fixed_length && bufinfo->len != self->max_length) { + return false; + } + if (bufinfo->len > self->max_length) { + bool + } + + mp_buffer_info_t char_bufinfo; + if (!mp_get_buffer(characteristic->value, &bufinfo, MP_BUFFER_WRITE)) { + return false; + } + memcpy(&char_bufinfo->buf, bufinfo->buf, bufinfo->len); + + for (size_t i; i < characteristic->set_callbacks. +} diff --git a/devices/ble_hci/common-hal/_bleio/Characteristic.h b/devices/ble_hci/common-hal/_bleio/Characteristic.h index ce8302fcf8..cc5ba4108b 100644 --- a/devices/ble_hci/common-hal/_bleio/Characteristic.h +++ b/devices/ble_hci/common-hal/_bleio/Characteristic.h @@ -40,6 +40,8 @@ typedef struct _bleio_characteristic_obj { bleio_service_obj_t *service; bleio_uuid_obj_t *uuid; mp_obj_t value; + mp_obj_list_t watcher_list; + mp_obj_list_t descriptor_linked_list; uint16_t max_length; bool fixed_length; uint16_t decl_handle; @@ -47,7 +49,7 @@ typedef struct _bleio_characteristic_obj { bleio_characteristic_properties_t props; bleio_attribute_security_mode_t read_perm; bleio_attribute_security_mode_t write_perm; - bleio_descriptor_obj_t *descriptor_list; + bleio_descriptor_obj_t *descriptor_linked_list; uint16_t user_desc_handle; uint16_t cccd_handle; uint16_t sccd_handle; diff --git a/devices/ble_hci/common-hal/_bleio/Connection.c b/devices/ble_hci/common-hal/_bleio/Connection.c index 6b528552ae..98fa4d1f72 100644 --- a/devices/ble_hci/common-hal/_bleio/Connection.c +++ b/devices/ble_hci/common-hal/_bleio/Connection.c @@ -319,7 +319,7 @@ static volatile bool m_discovery_successful; // } void bleio_connection_clear(bleio_connection_internal_t *self) { - self->remote_service_list = NULL; + self->remote_service_linked_list = NULL; //FIX self->conn_handle = BLE_CONN_HANDLE_INVALID; self->pair_status = PAIR_NOT_PAIRED; @@ -449,7 +449,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern // } // STATIC void on_primary_srv_discovery_rsp(ble_gattc_evt_prim_srvc_disc_rsp_t *response, bleio_connection_internal_t* connection) { -// bleio_service_obj_t* tail = connection->remote_service_list; +// bleio_service_obj_t* tail = connection->remote_service_linked_list; // for (size_t i = 0; i < response->count; ++i) { // ble_gattc_service_t *gattc_service = &response->services[i]; @@ -482,7 +482,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern // tail = service; // } -// connection->remote_service_list = tail; +// connection->remote_service_linked_list = tail; // if (response->count > 0) { // m_discovery_successful = true; @@ -581,7 +581,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern // GATT_MAX_DATA_LENGTH, false, mp_const_empty_bytes); // descriptor->handle = gattc_desc->handle; -// mp_obj_list_append(m_desc_discovery_characteristic->descriptor_list, MP_OBJ_FROM_PTR(descriptor)); +// mp_obj_list_append(m_desc_discovery_characteristic->descriptor_linked_list, MP_OBJ_FROM_PTR(descriptor)); // } // if (response->count > 0) { @@ -622,7 +622,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern // ble_drv_add_event_handler(discovery_on_ble_evt, self); // // Start over with an empty list. -// self->remote_service_list = NULL; +// self->remote_service_linked_list = NULL; // if (service_uuids_whitelist == mp_const_none) { // // List of service UUID's not given, so discover all available services. @@ -634,7 +634,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern // // Get the most recently discovered service, and then ask for services // // whose handles start after the last attribute handle inside that service. -// const bleio_service_obj_t *service = self->remote_service_list; +// const bleio_service_obj_t *service = self->remote_service_linked_list; // next_service_start_handle = service->end_handle + 1; // } // } else { @@ -658,7 +658,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern // } -// bleio_service_obj_t *service = self->remote_service_list; +// bleio_service_obj_t *service = self->remote_service_linked_list; // while (service != NULL) { // // Skip the service if it had an unknown (unregistered) UUID. // if (service->uuid == NULL) { @@ -707,14 +707,14 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern // // Stop when we go past the end of the range of handles for this service or // // discovery call returns nothing. -// // discover_next_descriptors() appends to the descriptor_list. +// // discover_next_descriptors() appends to the descriptor_linked_list. // while (next_desc_start_handle <= service->end_handle && // next_desc_start_handle <= next_desc_end_handle && // discover_next_descriptors(self, characteristic, // next_desc_start_handle, next_desc_end_handle)) { // // Get the most recently discovered descriptor, and then ask for descriptors // // whose handles start after that descriptor's handle. -// const bleio_descriptor_obj_t *descriptor = characteristic->descriptor_list; +// const bleio_descriptor_obj_t *descriptor = characteristic->descriptor_linked_list; // next_desc_start_handle = descriptor->handle + 1; // } // } @@ -730,8 +730,8 @@ mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(bleio_conne //FIX discover_remote_services(self->connection, service_uuids_whitelist); bleio_connection_ensure_connected(self); // Convert to a tuple and then clear the list so the callee will take ownership. - mp_obj_tuple_t *services_tuple = service_linked_list_to_tuple(self->connection->remote_service_list); - self->connection->remote_service_list = NULL; + mp_obj_tuple_t *services_tuple = service_linked_list_to_tuple(self->connection->remote_service_linked_list); + self->connection->remote_service_linked_list = NULL; return services_tuple; } diff --git a/devices/ble_hci/common-hal/_bleio/Connection.h b/devices/ble_hci/common-hal/_bleio/Connection.h index 8b9790d9ed..efd496ecc5 100644 --- a/devices/ble_hci/common-hal/_bleio/Connection.h +++ b/devices/ble_hci/common-hal/_bleio/Connection.h @@ -50,7 +50,7 @@ typedef struct { uint16_t conn_handle; bool is_central; // Remote services discovered when this peripheral is acting as a client. - bleio_service_obj_t *remote_service_list; + bleio_service_obj_t *remote_service_linked_list; // The advertising data and scan response buffers are held by us, not by the SD, so we must // maintain them and not change it. If we need to change the contents during advertising, // there are tricks to get the SD to notice (see DevZone - TBS). diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 0b23bb7bfa..dffaaf8b85 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -352,6 +352,8 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable if (enabled) { for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { bleio_connection_internal_t *connection = &bleio_connections[i]; + // Reset connection. + bleio_connection_clear(connection); connection->conn_handle = BLE_CONN_HANDLE_INVALID; } bleio_adapter_reset_name(self); @@ -576,6 +578,7 @@ mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_addre for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { bleio_connection_internal_t *connection = &bleio_connections[i]; if (connection->conn_handle == conn_handle) { + connection->is_central = true; return bleio_connection_new_from_internal(connection); } } diff --git a/ports/nrf/common-hal/_bleio/Characteristic.c b/ports/nrf/common-hal/_bleio/Characteristic.c index d507cecca4..cacd53417a 100644 --- a/ports/nrf/common-hal/_bleio/Characteristic.c +++ b/ports/nrf/common-hal/_bleio/Characteristic.c @@ -90,7 +90,7 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, self->props = props; self->read_perm = read_perm; self->write_perm = write_perm; - self->descriptor_list = NULL; + self->descriptor_list = mp_obj_new_list(0, NULL); const mp_int_t max_length_max = fixed_length ? BLE_GATTS_FIX_ATTR_LEN_MAX : BLE_GATTS_VAR_ATTR_LEN_MAX; if (max_length < 0 || max_length > max_length_max) { @@ -111,8 +111,8 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, } } -bleio_descriptor_obj_t *common_hal_bleio_characteristic_get_descriptor_list(bleio_characteristic_obj_t *self) { - return self->descriptor_list; +mp_obj_tuple_t *common_hal_bleio_characteristic_get_descriptors(bleio_characteristic_obj_t *self) { + return mp_obj_new_tuple(self->descriptor_list->len, self->descriptor_list->items); } bleio_service_obj_t *common_hal_bleio_characteristic_get_service(bleio_characteristic_obj_t *self) { @@ -218,8 +218,8 @@ void common_hal_bleio_characteristic_add_descriptor(bleio_characteristic_obj_t * check_nrf_error(sd_ble_gatts_descriptor_add(self->handle, &desc_attr, &descriptor->handle)); - descriptor->next = self->descriptor_list; - self->descriptor_list = descriptor; + mp_obj_list_append(MP_OBJ_FROM_PTR(self->descriptor_list), + MP_OBJ_FROM_PTR(descriptor)); } void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, bool notify, bool indicate) { diff --git a/ports/nrf/common-hal/_bleio/Characteristic.h b/ports/nrf/common-hal/_bleio/Characteristic.h index bb8f28495e..19970ef820 100644 --- a/ports/nrf/common-hal/_bleio/Characteristic.h +++ b/ports/nrf/common-hal/_bleio/Characteristic.h @@ -46,7 +46,7 @@ typedef struct _bleio_characteristic_obj { bleio_characteristic_properties_t props; bleio_attribute_security_mode_t read_perm; bleio_attribute_security_mode_t write_perm; - bleio_descriptor_obj_t *descriptor_list; + mp_obj_list_t *descriptor_list; uint16_t user_desc_handle; uint16_t cccd_handle; uint16_t sccd_handle; diff --git a/ports/nrf/common-hal/_bleio/Connection.c b/ports/nrf/common-hal/_bleio/Connection.c index 00c1acd4d4..fccb5a22a7 100644 --- a/ports/nrf/common-hal/_bleio/Connection.c +++ b/ports/nrf/common-hal/_bleio/Connection.c @@ -325,10 +325,11 @@ bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { } void bleio_connection_clear(bleio_connection_internal_t *self) { - self->remote_service_list = NULL; + mp_obj_list_clear(MP_OBJ_FROM_PTR(self->remote_service_list)); self->conn_handle = BLE_CONN_HANDLE_INVALID; self->pair_status = PAIR_NOT_PAIRED; + self->is_central = false; bonding_clear_keys(&self->bonding_keys); } @@ -452,8 +453,6 @@ STATIC bool discover_next_descriptors(bleio_connection_internal_t* connection, b } STATIC void on_primary_srv_discovery_rsp(ble_gattc_evt_prim_srvc_disc_rsp_t *response, bleio_connection_internal_t* connection) { - bleio_service_obj_t* tail = connection->remote_service_list; - for (size_t i = 0; i < response->count; ++i) { ble_gattc_service_t *gattc_service = &response->services[i]; @@ -481,12 +480,10 @@ STATIC void on_primary_srv_discovery_rsp(ble_gattc_evt_prim_srvc_disc_rsp_t *res service->uuid = NULL; } - service->next = tail; - tail = service; + mp_obj_list_append(MP_OBJ_FROM_PTR(connection->remote_service_list), + MP_OBJ_FROM_PTR(service)); } - connection->remote_service_list = tail; - if (response->count > 0) { m_discovery_successful = true; } @@ -528,7 +525,8 @@ STATIC void on_char_discovery_rsp(ble_gattc_evt_char_disc_rsp_t *response, bleio GATT_MAX_DATA_LENGTH, false, // max_length, fixed_length: values may not matter for gattc NULL); - mp_obj_list_append(m_char_discovery_service->characteristic_list, MP_OBJ_FROM_PTR(characteristic)); + mp_obj_list_append(MP_OBJ_FROM_PTR(m_char_discovery_service->characteristic_list), + MP_OBJ_FROM_PTR(characteristic)); } if (response->count > 0) { @@ -584,7 +582,8 @@ STATIC void on_desc_discovery_rsp(ble_gattc_evt_desc_disc_rsp_t *response, bleio GATT_MAX_DATA_LENGTH, false, mp_const_empty_bytes); descriptor->handle = gattc_desc->handle; - mp_obj_list_append(m_desc_discovery_characteristic->descriptor_list, MP_OBJ_FROM_PTR(descriptor)); + mp_obj_list_append(MP_OBJ_FROM_PTR(m_desc_discovery_characteristic->descriptor_list), + MP_OBJ_FROM_PTR(descriptor)); } if (response->count > 0) { @@ -625,7 +624,7 @@ STATIC void discover_remote_services(bleio_connection_internal_t *self, mp_obj_t ble_drv_add_event_handler(discovery_on_ble_evt, self); // Start over with an empty list. - self->remote_service_list = NULL; + self->remote_service_list = mp_obj_new_list(0, NULL); if (service_uuids_whitelist == mp_const_none) { // List of service UUID's not given, so discover all available services. @@ -637,7 +636,9 @@ STATIC void discover_remote_services(bleio_connection_internal_t *self, mp_obj_t // Get the most recently discovered service, and then ask for services // whose handles start after the last attribute handle inside that service. - const bleio_service_obj_t *service = self->remote_service_list; + // There must be at least one if discover_next_services() returned true. + const bleio_service_obj_t *service = + self->remote_service_list->items[self->remote_service_list->len - 1]; next_service_start_handle = service->end_handle + 1; } } else { @@ -661,11 +662,10 @@ STATIC void discover_remote_services(bleio_connection_internal_t *self, mp_obj_t } - bleio_service_obj_t *service = self->remote_service_list; - while (service != NULL) { + for (size_t i = 0; i < self->remote_service_list->len; i++) { + bleio_service_obj_t *service = MP_OBJ_TO_PTR(self->remote_service_list->items[i]); // Skip the service if it had an unknown (unregistered) UUID. if (service->uuid == NULL) { - service = service->next; continue; } @@ -677,9 +677,9 @@ STATIC void discover_remote_services(bleio_connection_internal_t *self, mp_obj_t while (next_char_start_handle <= service->end_handle && discover_next_characteristics(self, service, next_char_start_handle)) { - // Get the most recently discovered characteristic, and then ask for characteristics // whose handles start after the last attribute handle inside that characteristic. + // There must be at least one if discover_next_characteristics() returned true. const bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(service->characteristic_list->items[service->characteristic_list->len - 1]); @@ -717,24 +717,26 @@ STATIC void discover_remote_services(bleio_connection_internal_t *self, mp_obj_t next_desc_start_handle, next_desc_end_handle)) { // Get the most recently discovered descriptor, and then ask for descriptors // whose handles start after that descriptor's handle. - const bleio_descriptor_obj_t *descriptor = characteristic->descriptor_list; + // There must be at least one if discover_next_descriptors() returned true. + const bleio_descriptor_obj_t *descriptor = + characteristic->descriptor_list->items[characteristic->descriptor_list->len - 1]; next_desc_start_handle = descriptor->handle + 1; } } - service = service->next; } // This event handler is no longer needed. ble_drv_remove_event_handler(discovery_on_ble_evt, self); - } mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(bleio_connection_obj_t *self, mp_obj_t service_uuids_whitelist) { discover_remote_services(self->connection, service_uuids_whitelist); bleio_connection_ensure_connected(self); // Convert to a tuple and then clear the list so the callee will take ownership. - mp_obj_tuple_t *services_tuple = service_linked_list_to_tuple(self->connection->remote_service_list); - self->connection->remote_service_list = NULL; + mp_obj_tuple_t *services_tuple = + mp_obj_new_tuple(self->connection->remote_service_list->len, + self->connection->remote_service_list->items); + mp_obj_list_clear(MP_OBJ_FROM_PTR(self->connection->remote_service_list)); return services_tuple; } diff --git a/ports/nrf/common-hal/_bleio/Connection.h b/ports/nrf/common-hal/_bleio/Connection.h index b051e5c511..180b2727ca 100644 --- a/ports/nrf/common-hal/_bleio/Connection.h +++ b/ports/nrf/common-hal/_bleio/Connection.h @@ -53,7 +53,7 @@ typedef struct { uint16_t conn_handle; bool is_central; // Remote services discovered when this peripheral is acting as a client. - bleio_service_obj_t *remote_service_list; + mp_obj_list_t *remote_service_list; // The advertising data and scan response buffers are held by us, not by the SD, so we must // maintain them and not change it. If we need to change the contents during advertising, // there are tricks to get the SD to notice (see DevZone - TBS). @@ -67,7 +67,7 @@ typedef struct { ble_gap_conn_params_t conn_params; volatile bool conn_params_updating; uint16_t mtu; - // Request that CCCD values for this conenction be saved, using sys_attr values. + // Request that CCCD values for this connection be saved, using sys_attr values. volatile bool do_bond_cccds; // Request that security key info for this connection be saved. volatile bool do_bond_keys; @@ -83,6 +83,7 @@ typedef struct { uint8_t disconnect_reason; } bleio_connection_obj_t; +void bleio_connection_clear(bleio_connection_internal_t *self); bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in); uint16_t bleio_connection_get_conn_handle(bleio_connection_obj_t *self); diff --git a/ports/nrf/common-hal/_bleio/Descriptor.h b/ports/nrf/common-hal/_bleio/Descriptor.h index c70547c08e..f76510d128 100644 --- a/ports/nrf/common-hal/_bleio/Descriptor.h +++ b/ports/nrf/common-hal/_bleio/Descriptor.h @@ -47,7 +47,6 @@ typedef struct _bleio_descriptor_obj { uint16_t handle; bleio_attribute_security_mode_t read_perm; bleio_attribute_security_mode_t write_perm; - struct _bleio_descriptor_obj* next; } bleio_descriptor_obj_t; #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_BLEIO_DESCRIPTOR_H diff --git a/ports/nrf/common-hal/_bleio/Service.c b/ports/nrf/common-hal/_bleio/Service.c index 19288f7479..8c57442f29 100644 --- a/ports/nrf/common-hal/_bleio/Service.c +++ b/ports/nrf/common-hal/_bleio/Service.c @@ -73,8 +73,8 @@ bleio_uuid_obj_t *common_hal_bleio_service_get_uuid(bleio_service_obj_t *self) { return self->uuid; } -mp_obj_list_t *common_hal_bleio_service_get_characteristic_list(bleio_service_obj_t *self) { - return self->characteristic_list; +mp_obj_tuple_t *common_hal_bleio_service_get_characteristics(bleio_service_obj_t *self) { + return mp_obj_new_tuple(self->characteristic_list->len, self->characteristic_list->items); } bool common_hal_bleio_service_get_is_remote(bleio_service_obj_t *self) { diff --git a/ports/nrf/common-hal/_bleio/Service.h b/ports/nrf/common-hal/_bleio/Service.h index 6ee9fe63de..00f611dd9d 100644 --- a/ports/nrf/common-hal/_bleio/Service.h +++ b/ports/nrf/common-hal/_bleio/Service.h @@ -46,7 +46,6 @@ typedef struct bleio_service_obj { // Range of attribute handles of this remote service. uint16_t start_handle; uint16_t end_handle; - struct bleio_service_obj* next; } bleio_service_obj_t; void bleio_service_from_connection(bleio_service_obj_t *self, mp_obj_t connection); diff --git a/shared-bindings/_bleio/Characteristic.c b/shared-bindings/_bleio/Characteristic.c index 557a356b69..24b127e4a3 100644 --- a/shared-bindings/_bleio/Characteristic.c +++ b/shared-bindings/_bleio/Characteristic.c @@ -212,26 +212,14 @@ const mp_obj_property_t bleio_characteristic_value_obj = { }; //| descriptors: Descriptor -//| """A tuple of :py:class:`Descriptor` that describe this characteristic. (read-only)""" +//| """A tuple of :py:class:`Descriptor` objects related to this characteristic. (read-only)""" //| STATIC mp_obj_t bleio_characteristic_get_descriptors(mp_obj_t self_in) { bleio_characteristic_obj_t *self = MP_OBJ_TO_PTR(self_in); // Return list as a tuple so user won't be able to change it. - bleio_descriptor_obj_t *descriptors = common_hal_bleio_characteristic_get_descriptor_list(self); - bleio_descriptor_obj_t *head = descriptors; - size_t len = 0; - while (head != NULL) { - len++; - head = head->next; - } - mp_obj_tuple_t * t = MP_OBJ_TO_PTR(mp_obj_new_tuple(len, NULL)); - head = descriptors; - for (size_t i = len - 1; i >= 0; i--) { - t->items[i] = MP_OBJ_FROM_PTR(head); - head = head->next; - } - return MP_OBJ_FROM_PTR(t); + return MP_OBJ_FROM_PTR(common_hal_bleio_characteristic_get_descriptors(self)); } + STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_characteristic_get_descriptors_obj, bleio_characteristic_get_descriptors); const mp_obj_property_t bleio_characteristic_descriptors_obj = { diff --git a/shared-bindings/_bleio/Characteristic.h b/shared-bindings/_bleio/Characteristic.h index c4356fd4b9..e28d61e1f0 100644 --- a/shared-bindings/_bleio/Characteristic.h +++ b/shared-bindings/_bleio/Characteristic.h @@ -36,14 +36,14 @@ extern const mp_obj_type_t bleio_characteristic_type; -extern void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, bleio_service_obj_t *service, uint16_t handle, bleio_uuid_obj_t *uuid, bleio_characteristic_properties_t props, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_buffer_info_t *initial_value_bufinfo); -extern size_t common_hal_bleio_characteristic_get_value(bleio_characteristic_obj_t *self, uint8_t* buf, size_t len); -extern void common_hal_bleio_characteristic_set_value(bleio_characteristic_obj_t *self, mp_buffer_info_t *bufinfo); extern bleio_characteristic_properties_t common_hal_bleio_characteristic_get_properties(bleio_characteristic_obj_t *self); -extern bleio_uuid_obj_t *common_hal_bleio_characteristic_get_uuid(bleio_characteristic_obj_t *self); -extern bleio_descriptor_obj_t *common_hal_bleio_characteristic_get_descriptor_list(bleio_characteristic_obj_t *self); +extern mp_obj_tuple_t *common_hal_bleio_characteristic_get_descriptors(bleio_characteristic_obj_t *self); extern bleio_service_obj_t *common_hal_bleio_characteristic_get_service(bleio_characteristic_obj_t *self); +extern bleio_uuid_obj_t *common_hal_bleio_characteristic_get_uuid(bleio_characteristic_obj_t *self); +extern size_t common_hal_bleio_characteristic_get_value(bleio_characteristic_obj_t *self, uint8_t* buf, size_t len); extern void common_hal_bleio_characteristic_add_descriptor(bleio_characteristic_obj_t *self, bleio_descriptor_obj_t *descriptor); +extern void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, bleio_service_obj_t *service, uint16_t handle, bleio_uuid_obj_t *uuid, bleio_characteristic_properties_t props, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_buffer_info_t *initial_value_bufinfo); extern void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, bool notify, bool indicate); +extern void common_hal_bleio_characteristic_set_value(bleio_characteristic_obj_t *self, mp_buffer_info_t *bufinfo); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_CHARACTERISTIC_H diff --git a/shared-bindings/_bleio/Service.c b/shared-bindings/_bleio/Service.c index f410b1798e..2ddf1a7126 100644 --- a/shared-bindings/_bleio/Service.c +++ b/shared-bindings/_bleio/Service.c @@ -79,9 +79,7 @@ STATIC mp_obj_t bleio_service_make_new(const mp_obj_type_t *type, size_t n_args, //| STATIC mp_obj_t bleio_service_get_characteristics(mp_obj_t self_in) { bleio_service_obj_t *self = MP_OBJ_TO_PTR(self_in); - // Return list as a tuple so user won't be able to change it. - mp_obj_list_t *char_list = common_hal_bleio_service_get_characteristic_list(self); - return mp_obj_new_tuple(char_list->len, char_list->items); + return MP_OBJ_FROM_PTR(common_hal_bleio_service_get_characteristics(self)); } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_service_get_characteristics_obj, bleio_service_get_characteristics); @@ -151,7 +149,7 @@ STATIC const mp_rom_map_elem_t bleio_service_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_characteristics), MP_ROM_PTR(&bleio_service_characteristics_obj) }, { MP_ROM_QSTR(MP_QSTR_secondary), MP_ROM_PTR(&bleio_service_secondary_obj) }, { MP_ROM_QSTR(MP_QSTR_uuid), MP_ROM_PTR(&bleio_service_uuid_obj) }, - { MP_ROM_QSTR(MP_QSTR_remote), MP_ROM_PTR(&bleio_service_remote_obj) }, + { MP_ROM_QSTR(MP_QSTR_remote), MP_ROM_PTR(&bleio_service_remote_obj) }, }; STATIC MP_DEFINE_CONST_DICT(bleio_service_locals_dict, bleio_service_locals_dict_table); @@ -173,21 +171,3 @@ const mp_obj_type_t bleio_service_type = { .print = bleio_service_print, .locals_dict = (mp_obj_dict_t*)&bleio_service_locals_dict }; - -// Helper for classes that store lists of services. -mp_obj_tuple_t* service_linked_list_to_tuple(bleio_service_obj_t * services) { - // Return list as a tuple so user won't be able to change it. - bleio_service_obj_t *head = services; - size_t len = 0; - while (head != NULL) { - len++; - head = head->next; - } - mp_obj_tuple_t * t = MP_OBJ_TO_PTR(mp_obj_new_tuple(len, NULL)); - head = services; - for (int32_t i = len - 1; i >= 0; i--) { - t->items[i] = MP_OBJ_FROM_PTR(head); - head = head->next; - } - return t; -} diff --git a/shared-bindings/_bleio/Service.h b/shared-bindings/_bleio/Service.h index 273c6bd989..8b8a6ce773 100644 --- a/shared-bindings/_bleio/Service.h +++ b/shared-bindings/_bleio/Service.h @@ -41,11 +41,9 @@ extern uint32_t _common_hal_bleio_service_construct(bleio_service_obj_t *self, b extern void common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uuid_obj_t *uuid, bool is_secondary); extern void common_hal_bleio_service_from_remote_service(bleio_service_obj_t *self, bleio_connection_obj_t* connection, bleio_uuid_obj_t *uuid, bool is_secondary); extern bleio_uuid_obj_t *common_hal_bleio_service_get_uuid(bleio_service_obj_t *self); -extern mp_obj_list_t *common_hal_bleio_service_get_characteristic_list(bleio_service_obj_t *self); +extern mp_obj_tuple_t *common_hal_bleio_service_get_characteristics(bleio_service_obj_t *self); extern bool common_hal_bleio_service_get_is_remote(bleio_service_obj_t *self); extern bool common_hal_bleio_service_get_is_secondary(bleio_service_obj_t *self); extern void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, bleio_characteristic_obj_t *characteristic, mp_buffer_info_t *initial_value_bufinfo); -mp_obj_tuple_t* service_linked_list_to_tuple(bleio_service_obj_t * services); - #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_SERVICE_H diff --git a/shared-bindings/_bleio/__init__.h b/shared-bindings/_bleio/__init__.h index 5256bdaa0e..969d2efb1c 100644 --- a/shared-bindings/_bleio/__init__.h +++ b/shared-bindings/_bleio/__init__.h @@ -63,7 +63,6 @@ NORETURN void mp_raise_bleio_SecurityError(const compressed_string_t* msg, ...); void common_hal_bleio_check_connected(uint16_t conn_handle); uint16_t common_hal_bleio_device_get_conn_handle(mp_obj_t device); -mp_obj_list_t *common_hal_bleio_device_get_remote_service_list(mp_obj_t device); void common_hal_bleio_device_discover_remote_services(mp_obj_t device, mp_obj_t service_uuids_whitelist); size_t common_hal_bleio_gatts_read(uint16_t handle, uint16_t conn_handle, uint8_t* buf, size_t len); From e34fac6645c871cf1459ce746c7298c233e25147 Mon Sep 17 00:00:00 2001 From: bleeptrack Date: Tue, 11 Aug 2020 23:59:32 +0200 Subject: [PATCH 0544/1293] Whitespace and Newline fix --- ports/atmel-samd/boards/picoplanet/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/picoplanet/pins.c b/ports/atmel-samd/boards/picoplanet/pins.c index 512bd379e1..0d9350dd2a 100644 --- a/ports/atmel-samd/boards/picoplanet/pins.c +++ b/ports/atmel-samd/boards/picoplanet/pins.c @@ -3,7 +3,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_D5),MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_D6),MP_ROM_PTR(&pin_PA06) }, From 49407b6c069e11b23811c64d4d4c62b5e7516610 Mon Sep 17 00:00:00 2001 From: bleeptrack Date: Wed, 12 Aug 2020 13:42:45 +0200 Subject: [PATCH 0545/1293] trailing spaces fix --- ports/atmel-samd/boards/picoplanet/mpconfigboard.h | 8 ++------ ports/atmel-samd/boards/picoplanet/pins.c | 10 +++++----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/ports/atmel-samd/boards/picoplanet/mpconfigboard.h b/ports/atmel-samd/boards/picoplanet/mpconfigboard.h index c5addf6394..61430e06c2 100644 --- a/ports/atmel-samd/boards/picoplanet/mpconfigboard.h +++ b/ports/atmel-samd/boards/picoplanet/mpconfigboard.h @@ -1,8 +1,6 @@ #define MICROPY_HW_BOARD_NAME "PicoPlanet" #define MICROPY_HW_MCU_NAME "samd21e18" - - #define MICROPY_PORT_A (PORT_PA00 | PORT_PA01) #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) @@ -38,9 +36,7 @@ //#define CP_RGB_STATUS_R (&pin_PA06) //#define CP_RGB_STATUS_G (&pin_PA05) //#define CP_RGB_STATUS_B (&pin_PA07) -//#define CP_RGB_STATUS_INVERTED_PWM -//#define CP_RGB_STATUS_LED +//#define CP_RGB_STATUS_INVERTED_PWM +//#define CP_RGB_STATUS_LED #define MICROPY_HW_LED_STATUS (&pin_PA06) - - diff --git a/ports/atmel-samd/boards/picoplanet/pins.c b/ports/atmel-samd/boards/picoplanet/pins.c index 0d9350dd2a..4c9b11e3d5 100644 --- a/ports/atmel-samd/boards/picoplanet/pins.c +++ b/ports/atmel-samd/boards/picoplanet/pins.c @@ -12,20 +12,20 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, - + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA09) }, { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA09) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) }, - + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA16) }, - + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA17) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA17) }, - + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA30) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA30) }, - + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) } }; From 760a171903e0fe314b6795669893850bf46cad78 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 11 Aug 2020 09:14:13 -0500 Subject: [PATCH 0546/1293] nrf: Make port build with -Werror=undef .. build-tested on particle_xenon --- ports/nrf/Makefile | 16 +++++++++------- ports/nrf/common-hal/busio/SPI.c | 16 ++++++++++++++++ ports/nrf/supervisor/qspi_flash.c | 2 +- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 13a148df3b..d1745a70ef 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -73,11 +73,11 @@ INC += -I$(BUILD) INC += -I$(BUILD)/genhdr INC += -I./../../lib/cmsis/inc INC += -I./boards/$(BOARD) -INC += -I./nrfx -INC += -I./nrfx/hal -INC += -I./nrfx/mdk -INC += -I./nrfx/drivers/include -INC += -I./nrfx/drivers/src +INC += -isystem ./nrfx +INC += -isystem ./nrfx/hal +INC += -isystem ./nrfx/mdk +INC += -isystem ./nrfx/drivers/include +INC += -isystem ./nrfx/drivers/src INC += -I./bluetooth INC += -I./peripherals INC += -I../../lib/mp-readline @@ -100,8 +100,8 @@ CFLAGS += $(OPTIMIZATION_FLAGS) CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) # Undo some warnings. -# nrfx uses undefined preprocessor variables quite casually, so we can't do warning checks for these. -CFLAGS += -Wno-undef +## nrfx uses undefined preprocessor variables quite casually, so we can't do warning checks for these. +#CFLAGS += -Wno-undef # nrfx does casts that increase alignment requirements. CFLAGS += -Wno-cast-align @@ -240,6 +240,8 @@ endif OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) +$(addprefix $(BUILD)/, $(SRC_NRFX:.c=.o)): CFLAGS += -Wno-undef + $(BUILD)/$(FATFS_DIR)/ff.o: COPT += -Os $(filter $(PY_BUILD)/../extmod/vfs_fat_%.o, $(PY_O)): COPT += -Os diff --git a/ports/nrf/common-hal/busio/SPI.c b/ports/nrf/common-hal/busio/SPI.c index f27f0e267b..fdfe61811b 100644 --- a/ports/nrf/common-hal/busio/SPI.c +++ b/ports/nrf/common-hal/busio/SPI.c @@ -34,6 +34,22 @@ #include "nrfx_spim.h" #include "nrf_gpio.h" +#ifndef NRFX_SPIM3_ENABLED +#define NRFX_SPIM3_ENABLED (0) +#endif + +#ifndef NRFX_SPIM2_ENABLED +#define NRFX_SPIM2_ENABLED (0) +#endif + +#ifndef NRFX_SPIM1_ENABLED +#define NRFX_SPIM1_ENABLED (0) +#endif + +#ifndef NRFX_SPIM0_ENABLED +#define NRFX_SPIM0_ENABLED (0) +#endif + // These are in order from highest available frequency to lowest (32MHz first, then 8MHz). STATIC spim_peripheral_t spim_peripherals[] = { #if NRFX_CHECK(NRFX_SPIM3_ENABLED) diff --git a/ports/nrf/supervisor/qspi_flash.c b/ports/nrf/supervisor/qspi_flash.c index 5ab56c6bc4..7ca27d56c4 100644 --- a/ports/nrf/supervisor/qspi_flash.c +++ b/ports/nrf/supervisor/qspi_flash.c @@ -201,7 +201,7 @@ void spi_flash_init(void) { .irq_priority = 7, }; -#if EXTERNAL_FLASH_QSPI_DUAL +#if defined(EXTERNAL_FLASH_QSPI_DUAL) qspi_cfg.pins.io1_pin = MICROPY_QSPI_DATA1; qspi_cfg.prot_if.readoc = NRF_QSPI_READOC_READ2O; qspi_cfg.prot_if.writeoc = NRF_QSPI_WRITEOC_PP2O; From 32fc8b0676eac575a184f529aae6848f189ea71a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 11 Aug 2020 14:16:05 -0500 Subject: [PATCH 0547/1293] nrf: reset_pin_number: reset pin clears never-reset, mirroring samd --- ports/nrf/common-hal/microcontroller/Pin.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/nrf/common-hal/microcontroller/Pin.c b/ports/nrf/common-hal/microcontroller/Pin.c index 3132c76318..d294c1dd5d 100644 --- a/ports/nrf/common-hal/microcontroller/Pin.c +++ b/ports/nrf/common-hal/microcontroller/Pin.c @@ -93,6 +93,7 @@ void reset_pin_number(uint8_t pin_number) { // Clear claimed bit. claimed_pins[nrf_pin_port(pin_number)] &= ~(1 << nrf_relative_pin_number(pin_number)); + never_reset_pins[nrf_pin_port(pin_number)] &= ~(1 << nrf_relative_pin_number(pin_number)); #ifdef MICROPY_HW_NEOPIXEL if (pin_number == MICROPY_HW_NEOPIXEL->number) { From ffc488e748890976fe1923c5503300f66064d904 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 31 Jul 2020 14:34:24 -0500 Subject: [PATCH 0548/1293] framebufferio: Fix crash calling unimplemented get_brightness If set_brightness was implemented but get_brightness wasn't, this would hard fault --- shared-module/framebufferio/FramebufferDisplay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 2a90fa0d4a..73917b1a32 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -109,7 +109,7 @@ bool common_hal_framebufferio_framebufferdisplay_set_auto_brightness(framebuffer } mp_float_t common_hal_framebufferio_framebufferdisplay_get_brightness(framebufferio_framebufferdisplay_obj_t* self) { - if (self->framebuffer_protocol->set_brightness) { + if (self->framebuffer_protocol->get_brightness) { return self->framebuffer_protocol->get_brightness(self->framebuffer); } return -1; From 5a7b2a20381513797b4e548684f8af5af46be0fa Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 31 Jul 2020 14:35:00 -0500 Subject: [PATCH 0549/1293] framebufferio: Don't call swapbuffers unnecessarily --- shared-module/framebufferio/FramebufferDisplay.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 73917b1a32..fed3352aa0 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -219,12 +219,14 @@ STATIC void _refresh_display(framebufferio_framebufferdisplay_obj_t* self) { displayio_display_core_start_refresh(&self->core); self->framebuffer_protocol->get_bufinfo(self->framebuffer, &self->bufinfo); const displayio_area_t* current_area = _get_refresh_areas(self); - while (current_area != NULL) { - _refresh_area(self, current_area); - current_area = current_area->next; + if (current_area) { + while (current_area != NULL) { + _refresh_area(self, current_area); + current_area = current_area->next; + } + self->framebuffer_protocol->swapbuffers(self->framebuffer); } displayio_display_core_finish_refresh(&self->core); - self->framebuffer_protocol->swapbuffers(self->framebuffer); } void common_hal_framebufferio_framebufferdisplay_set_rotation(framebufferio_framebufferdisplay_obj_t* self, int rotation){ From 6d19a098888236c7442e563bae90b09630fbefe2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 31 Jul 2020 14:35:50 -0500 Subject: [PATCH 0550/1293] framebufferio: Set type to none when releasing This avoids the message "Too many displays in use" when they are released directly, rather than via release_displays(). --- shared-module/framebufferio/FramebufferDisplay.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index fed3352aa0..d21a103e2a 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -309,6 +309,7 @@ void release_framebufferdisplay(framebufferio_framebufferdisplay_obj_t* self) { common_hal_framebufferio_framebufferdisplay_set_auto_refresh(self, false); release_display_core(&self->core); self->framebuffer_protocol->deinit(self->framebuffer); + self->base.type = &mp_type_NoneType; } void reset_framebufferdisplay(framebufferio_framebufferdisplay_obj_t* self) { From a84cc19499e1cb71387cb5be379676d0c8b84f9a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 31 Jul 2020 15:46:07 -0500 Subject: [PATCH 0551/1293] framebufferio: Handle 1 (tested), 2, and 4 bpp displays --- .../framebufferio/FramebufferDisplay.c | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index d21a103e2a..b007975377 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -147,6 +147,14 @@ STATIC bool _refresh_area(framebufferio_framebufferdisplay_obj_t* self, const di return true; } uint16_t subrectangles = 1; + + // If pixels are packed by row then rows are on byte boundaries + if (self->core.colorspace.depth < 8 && self->core.colorspace.pixels_in_byte_share_row) { + int div = 8 / self->core.colorspace.depth; + clipped.x1 = (clipped.x1 / div) * div; + clipped.x2 = ((clipped.x2 + div - 1) / div) * div; + } + uint16_t rows_per_buffer = displayio_area_height(&clipped); uint8_t pixels_per_word = (sizeof(uint32_t) * 8) / self->core.colorspace.depth; uint16_t pixels_per_buffer = displayio_area_size(&clipped); @@ -187,6 +195,7 @@ STATIC bool _refresh_area(framebufferio_framebufferdisplay_obj_t* self, const di .x2 = clipped.x2, .y2 = clipped.y1 + rows_per_buffer * (j + 1) }; + if (remaining_rows < rows_per_buffer) { subrectangle.y2 = subrectangle.y1 + remaining_rows; } @@ -197,12 +206,15 @@ STATIC bool _refresh_area(framebufferio_framebufferdisplay_obj_t* self, const di displayio_display_core_fill_area(&self->core, &subrectangle, mask, buffer); - // COULDDO: this arithmetic only supports multiple-of-8 bpp - uint8_t *dest = self->bufinfo.buf + (subrectangle.y1 * self->core.width + subrectangle.x1) * (self->core.colorspace.depth / 8); + uint8_t *buf = (uint8_t *)self->bufinfo.buf, *endbuf = buf + self->bufinfo.len; + (void)endbuf; // Hint to compiler that endbuf is "used" even if NDEBUG + + uint8_t *dest = self->bufinfo.buf + (subrectangle.y1 * self->core.width + subrectangle.x1) * self->core.colorspace.depth / 8; uint8_t *src = (uint8_t*)buffer; - size_t rowsize = (subrectangle.x2 - subrectangle.x1) * (self->core.colorspace.depth / 8); - size_t rowstride = self->core.width * (self->core.colorspace.depth/8); + size_t rowsize = (subrectangle.x2 - subrectangle.x1) * self->core.colorspace.depth / 8; + size_t rowstride = self->core.width * self->core.colorspace.depth/8; for (uint16_t i = subrectangle.y1; i < subrectangle.y2; i++) { + assert(dest >= buf && dest < endbuf && dest+rowsize <= endbuf); memcpy(dest, src, rowsize); dest += rowstride; src += rowsize; From 8021f3b4cbb96e0edaf139fa88ea7273c92a5493 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 31 Jul 2020 15:46:39 -0500 Subject: [PATCH 0552/1293] framebufferio: handle sharp memory displays A bit of cheating; we need to add a protocol getter for reverse_bytes_in_word --- shared-module/framebufferio/FramebufferDisplay.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index b007975377..190d3cb9dc 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -51,7 +51,7 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu uint16_t ram_width = 0x100; uint16_t ram_height = 0x100; - + uint16_t depth = self->framebuffer_protocol->get_color_depth(self->framebuffer); displayio_display_core_construct( &self->core, NULL, @@ -62,12 +62,13 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu 0, 0, rotation, - self->framebuffer_protocol->get_color_depth(self->framebuffer), - false, - false, + depth, + (depth < 12), // grayscale + true, // pixels_in_byte_share_row self->framebuffer_protocol->get_bytes_per_cell(self->framebuffer), - false, - false); + true, // reverse_pixels_in_byte + false // reverse_bytes_in_word + ); self->first_manual_refresh = !auto_refresh; From a33e48c065093212729e620bb22da5ca327fabe4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 6 Aug 2020 14:28:10 -0500 Subject: [PATCH 0553/1293] framebufferio: add "first pixel offset" and "row stride" --- .../framebufferio/FramebufferDisplay.c | 17 ++++++++++++++--- .../framebufferio/FramebufferDisplay.h | 5 +++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 190d3cb9dc..e16777b83b 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -70,6 +70,15 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu false // reverse_bytes_in_word ); + self->first_pixel_offset = self->framebuffer_protocol->get_first_pixel_offset + ? self->framebuffer_protocol->get_first_pixel_offset(self->framebuffer) + : 0; + self->row_stride = self->framebuffer_protocol->get_row_stride + ? self->framebuffer_protocol->get_row_stride(self->framebuffer) + : 0; + if (self->row_stride == 0) { + self->row_stride = self->core.width * self->core.colorspace.depth/8; + } self->first_manual_refresh = !auto_refresh; self->native_frames_per_second = self->framebuffer_protocol->get_native_frames_per_second(self->framebuffer); @@ -209,11 +218,13 @@ STATIC bool _refresh_area(framebufferio_framebufferdisplay_obj_t* self, const di uint8_t *buf = (uint8_t *)self->bufinfo.buf, *endbuf = buf + self->bufinfo.len; (void)endbuf; // Hint to compiler that endbuf is "used" even if NDEBUG + buf += self->first_pixel_offset; - uint8_t *dest = self->bufinfo.buf + (subrectangle.y1 * self->core.width + subrectangle.x1) * self->core.colorspace.depth / 8; + size_t rowstride = self->row_stride; + uint8_t *dest = buf + subrectangle.y1 * rowstride + subrectangle.x1 * self->core.colorspace.depth / 8; uint8_t *src = (uint8_t*)buffer; size_t rowsize = (subrectangle.x2 - subrectangle.x1) * self->core.colorspace.depth / 8; - size_t rowstride = self->core.width * self->core.colorspace.depth/8; + for (uint16_t i = subrectangle.y1; i < subrectangle.y2; i++) { assert(dest >= buf && dest < endbuf && dest+rowsize <= endbuf); memcpy(dest, src, rowsize); @@ -230,9 +241,9 @@ STATIC bool _refresh_area(framebufferio_framebufferdisplay_obj_t* self, const di STATIC void _refresh_display(framebufferio_framebufferdisplay_obj_t* self) { displayio_display_core_start_refresh(&self->core); - self->framebuffer_protocol->get_bufinfo(self->framebuffer, &self->bufinfo); const displayio_area_t* current_area = _get_refresh_areas(self); if (current_area) { + self->framebuffer_protocol->get_bufinfo(self->framebuffer, &self->bufinfo); while (current_area != NULL) { _refresh_area(self, current_area); current_area = current_area->next; diff --git a/shared-module/framebufferio/FramebufferDisplay.h b/shared-module/framebufferio/FramebufferDisplay.h index ca1ab984a3..1d207039ac 100644 --- a/shared-module/framebufferio/FramebufferDisplay.h +++ b/shared-module/framebufferio/FramebufferDisplay.h @@ -48,6 +48,7 @@ typedef struct { uint64_t last_refresh_call; uint16_t native_frames_per_second; uint16_t native_ms_per_frame; + uint16_t first_pixel_offset, row_stride; bool auto_refresh; bool first_manual_refresh; } framebufferio_framebufferdisplay_obj_t; @@ -70,6 +71,8 @@ typedef bool (*framebuffer_set_auto_brightness_fun)(mp_obj_t, bool); typedef bool (*framebuffer_get_auto_brightness_fun)(mp_obj_t); typedef int (*framebuffer_get_width_fun)(mp_obj_t); typedef int (*framebuffer_get_height_fun)(mp_obj_t); +typedef int (*framebuffer_get_row_stride_fun)(mp_obj_t); +typedef int (*framebuffer_get_first_pixel_offset_fun)(mp_obj_t); typedef int (*framebuffer_get_color_depth_fun)(mp_obj_t); typedef int (*framebuffer_get_bytes_per_cell_fun)(mp_obj_t); typedef int (*framebuffer_get_native_frames_per_second_fun)(mp_obj_t); @@ -86,6 +89,8 @@ typedef struct _framebuffer_p_t { framebuffer_get_native_frames_per_second_fun get_native_frames_per_second; framebuffer_get_brightness_fun get_brightness; framebuffer_set_brightness_fun set_brightness; + framebuffer_get_row_stride_fun get_row_stride; + framebuffer_get_first_pixel_offset_fun get_first_pixel_offset; framebuffer_get_auto_brightness_fun get_auto_brightness; framebuffer_set_auto_brightness_fun set_auto_brightness; } framebuffer_p_t; From 1ee2062c1b64ecfda0af49cb0f721573aad7dea4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 6 Aug 2020 14:28:22 -0500 Subject: [PATCH 0554/1293] framebufferio: Check early if framebuffer is big enough --- shared-module/framebufferio/FramebufferDisplay.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index e16777b83b..230dd6991d 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -79,6 +79,13 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu if (self->row_stride == 0) { self->row_stride = self->core.width * self->core.colorspace.depth/8; } + + self->framebuffer_protocol->get_bufinfo(self->framebuffer, &self->bufinfo); + size_t framebuffer_size = self->first_pixel_offset + self->row_stride * self->core.height; + if (self->bufinfo.len < framebuffer_size) { + mp_raise_IndexError_varg(translate("Framebuffer requires %d bytes"), framebuffer_size); + } + self->first_manual_refresh = !auto_refresh; self->native_frames_per_second = self->framebuffer_protocol->get_native_frames_per_second(self->framebuffer); From 5e4ed9341586c3444409feeb61237e86a5c74c6f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 6 Aug 2020 14:46:54 -0500 Subject: [PATCH 0555/1293] framebufferio: Add getters for remaining displayio_display_core_construct arguments .. and introduce a convenience macro that helps many of them be required (if their values match defaults or are inapplicable) --- .../framebufferio/FramebufferDisplay.c | 27 +++++----- .../framebufferio/FramebufferDisplay.h | 50 ++++++++++++------- 2 files changed, 47 insertions(+), 30 deletions(-) diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 230dd6991d..37989c29f7 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -40,6 +40,11 @@ #include #include +#define fb_getter_default(method, default_value) \ + (self->framebuffer_protocol->method \ + ? self->framebuffer_protocol->method(self->framebuffer) \ + : (default_value)) + void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebufferdisplay_obj_t* self, mp_obj_t framebuffer, uint16_t rotation, @@ -51,7 +56,7 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu uint16_t ram_width = 0x100; uint16_t ram_height = 0x100; - uint16_t depth = self->framebuffer_protocol->get_color_depth(self->framebuffer); + uint16_t depth = fb_getter_default(get_color_depth, 16); displayio_display_core_construct( &self->core, NULL, @@ -63,19 +68,15 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu 0, rotation, depth, - (depth < 12), // grayscale - true, // pixels_in_byte_share_row - self->framebuffer_protocol->get_bytes_per_cell(self->framebuffer), - true, // reverse_pixels_in_byte - false // reverse_bytes_in_word + fb_getter_default(get_grayscale, (depth < 8)), + fb_getter_default(get_pixels_in_byte_share_row, false), + fb_getter_default(get_bytes_per_cell, 2), + fb_getter_default(get_reverse_pixels_in_byte, false), + fb_getter_default(get_reverse_pixels_in_word, false) ); - self->first_pixel_offset = self->framebuffer_protocol->get_first_pixel_offset - ? self->framebuffer_protocol->get_first_pixel_offset(self->framebuffer) - : 0; - self->row_stride = self->framebuffer_protocol->get_row_stride - ? self->framebuffer_protocol->get_row_stride(self->framebuffer) - : 0; + self->first_pixel_offset = fb_getter_default(get_first_pixel_offset, 0); + self->row_stride = fb_getter_default(get_row_stride, 0); if (self->row_stride == 0) { self->row_stride = self->core.width * self->core.colorspace.depth/8; } @@ -88,7 +89,7 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu self->first_manual_refresh = !auto_refresh; - self->native_frames_per_second = self->framebuffer_protocol->get_native_frames_per_second(self->framebuffer); + self->native_frames_per_second = fb_getter_default(get_native_frames_per_second, 60); self->native_ms_per_frame = 1000 / self->native_frames_per_second; supervisor_start_terminal(self->core.width, self->core.height); diff --git a/shared-module/framebufferio/FramebufferDisplay.h b/shared-module/framebufferio/FramebufferDisplay.h index 1d207039ac..93ad0118af 100644 --- a/shared-module/framebufferio/FramebufferDisplay.h +++ b/shared-module/framebufferio/FramebufferDisplay.h @@ -62,35 +62,51 @@ void framebufferio_framebufferdisplay_collect_ptrs(framebufferio_framebufferdisp mp_obj_t common_hal_framebufferio_framebufferdisplay_get_framebuffer(framebufferio_framebufferdisplay_obj_t* self); +typedef bool (*framebuffer_get_auto_brightness_fun)(mp_obj_t); +typedef bool (*framebuffer_get_reverse_pixels_in_byte_fun)(mp_obj_t); +typedef bool (*framebuffer_get_reverse_pixels_in_word_fun)(mp_obj_t); +typedef bool (*framebuffer_set_auto_brightness_fun)(mp_obj_t, bool); +typedef bool (*framebuffer_set_brightness_fun)(mp_obj_t, mp_float_t); +typedef int (*framebuffer_get_bytes_per_cell_fun)(mp_obj_t); +typedef int (*framebuffer_get_color_depth_fun)(mp_obj_t); +typedef int (*framebuffer_get_first_pixel_offset_fun)(mp_obj_t); +typedef int (*framebuffer_get_grayscale_fun)(mp_obj_t); +typedef int (*framebuffer_get_height_fun)(mp_obj_t); +typedef int (*framebuffer_get_native_frames_per_second_fun)(mp_obj_t); +typedef int (*framebuffer_get_pixels_in_byte_share_row_fun)(mp_obj_t); +typedef int (*framebuffer_get_row_stride_fun)(mp_obj_t); +typedef int (*framebuffer_get_width_fun)(mp_obj_t); +typedef mp_float_t (*framebuffer_get_brightness_fun)(mp_obj_t); +typedef void (*framebuffer_deinit_fun)(mp_obj_t); typedef void (*framebuffer_get_bufinfo_fun)(mp_obj_t, mp_buffer_info_t *bufinfo); typedef void (*framebuffer_swapbuffers_fun)(mp_obj_t); -typedef void (*framebuffer_deinit_fun)(mp_obj_t); -typedef bool (*framebuffer_set_brightness_fun)(mp_obj_t, mp_float_t); -typedef mp_float_t (*framebuffer_get_brightness_fun)(mp_obj_t); -typedef bool (*framebuffer_set_auto_brightness_fun)(mp_obj_t, bool); -typedef bool (*framebuffer_get_auto_brightness_fun)(mp_obj_t); -typedef int (*framebuffer_get_width_fun)(mp_obj_t); -typedef int (*framebuffer_get_height_fun)(mp_obj_t); -typedef int (*framebuffer_get_row_stride_fun)(mp_obj_t); -typedef int (*framebuffer_get_first_pixel_offset_fun)(mp_obj_t); -typedef int (*framebuffer_get_color_depth_fun)(mp_obj_t); -typedef int (*framebuffer_get_bytes_per_cell_fun)(mp_obj_t); -typedef int (*framebuffer_get_native_frames_per_second_fun)(mp_obj_t); typedef struct _framebuffer_p_t { MP_PROTOCOL_HEAD // MP_QSTR_protocol_framebuffer + + // Mandatory framebuffer_get_bufinfo_fun get_bufinfo; framebuffer_swapbuffers_fun swapbuffers; framebuffer_deinit_fun deinit; framebuffer_get_width_fun get_width; framebuffer_get_height_fun get_height; - framebuffer_get_color_depth_fun get_color_depth; - framebuffer_get_bytes_per_cell_fun get_bytes_per_cell; - framebuffer_get_native_frames_per_second_fun get_native_frames_per_second; + + // Optional getters + framebuffer_get_bytes_per_cell_fun get_bytes_per_cell; // default: 2 + framebuffer_get_color_depth_fun get_color_depth; // default: 16 + framebuffer_get_first_pixel_offset_fun get_first_pixel_offset; // default: 0 + framebuffer_get_grayscale_fun get_grayscale; // default: grayscale if depth < 8 + framebuffer_get_native_frames_per_second_fun get_native_frames_per_second; // default: 60 + framebuffer_get_pixels_in_byte_share_row_fun get_pixels_in_byte_share_row; // default: false + framebuffer_get_reverse_pixels_in_byte_fun get_reverse_pixels_in_byte; // default: false + framebuffer_get_reverse_pixels_in_word_fun get_reverse_pixels_in_word; // default: false + framebuffer_get_row_stride_fun get_row_stride; // default: 0 (no extra row padding) + + // Optional -- default is no brightness control framebuffer_get_brightness_fun get_brightness; framebuffer_set_brightness_fun set_brightness; - framebuffer_get_row_stride_fun get_row_stride; - framebuffer_get_first_pixel_offset_fun get_first_pixel_offset; + + // Optional -- default is no automatic brightness control framebuffer_get_auto_brightness_fun get_auto_brightness; framebuffer_set_auto_brightness_fun set_auto_brightness; } framebuffer_p_t; From 9c4f644641400c7b7eea37ace73782bc1cec2691 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 6 Aug 2020 14:51:52 -0500 Subject: [PATCH 0556/1293] framebufferio: add dirty row tracking --- shared-bindings/rgbmatrix/RGBMatrix.c | 3 ++- shared-module/framebufferio/FramebufferDisplay.c | 10 +++++++--- shared-module/framebufferio/FramebufferDisplay.h | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index d6b79f5ebb..9cfc0d4095 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -352,7 +352,8 @@ STATIC void rgbmatrix_rgbmatrix_get_bufinfo(mp_obj_t self_in, mp_buffer_info_t * // These version exists so that the prototype matches the protocol, // avoiding a type cast that can hide errors -STATIC void rgbmatrix_rgbmatrix_swapbuffers(mp_obj_t self_in) { +STATIC void rgbmatrix_rgbmatrix_swapbuffers(mp_obj_t self_in, uint8_t *dirty_row_bitmap) { + (void)dirty_row_bitmap; common_hal_rgbmatrix_rgbmatrix_refresh(self_in); } diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 37989c29f7..9a6797cd8c 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -156,7 +156,8 @@ STATIC const displayio_area_t* _get_refresh_areas(framebufferio_framebufferdispl return NULL; } -STATIC bool _refresh_area(framebufferio_framebufferdisplay_obj_t* self, const displayio_area_t* area) { +#define MARK_ROW_DIRTY(r) (dirty_row_bitmask[r/8] = (1 << (r & 7))) +STATIC bool _refresh_area(framebufferio_framebufferdisplay_obj_t* self, const displayio_area_t* area, uint8_t *dirty_row_bitmask) { uint16_t buffer_size = 128; // In uint32_ts displayio_area_t clipped; @@ -235,6 +236,7 @@ STATIC bool _refresh_area(framebufferio_framebufferdisplay_obj_t* self, const di for (uint16_t i = subrectangle.y1; i < subrectangle.y2; i++) { assert(dest >= buf && dest < endbuf && dest+rowsize <= endbuf); + MARK_ROW_DIRTY(i); memcpy(dest, src, rowsize); dest += rowstride; src += rowsize; @@ -251,12 +253,14 @@ STATIC void _refresh_display(framebufferio_framebufferdisplay_obj_t* self) { displayio_display_core_start_refresh(&self->core); const displayio_area_t* current_area = _get_refresh_areas(self); if (current_area) { + uint8_t dirty_row_bitmask[(self->core.height + 7) / 8]; + memset(dirty_row_bitmask, 0, sizeof(dirty_row_bitmask)); self->framebuffer_protocol->get_bufinfo(self->framebuffer, &self->bufinfo); while (current_area != NULL) { - _refresh_area(self, current_area); + _refresh_area(self, current_area, dirty_row_bitmask); current_area = current_area->next; } - self->framebuffer_protocol->swapbuffers(self->framebuffer); + self->framebuffer_protocol->swapbuffers(self->framebuffer, dirty_row_bitmask); } displayio_display_core_finish_refresh(&self->core); } diff --git a/shared-module/framebufferio/FramebufferDisplay.h b/shared-module/framebufferio/FramebufferDisplay.h index 93ad0118af..027086b5a1 100644 --- a/shared-module/framebufferio/FramebufferDisplay.h +++ b/shared-module/framebufferio/FramebufferDisplay.h @@ -79,7 +79,7 @@ typedef int (*framebuffer_get_width_fun)(mp_obj_t); typedef mp_float_t (*framebuffer_get_brightness_fun)(mp_obj_t); typedef void (*framebuffer_deinit_fun)(mp_obj_t); typedef void (*framebuffer_get_bufinfo_fun)(mp_obj_t, mp_buffer_info_t *bufinfo); -typedef void (*framebuffer_swapbuffers_fun)(mp_obj_t); +typedef void (*framebuffer_swapbuffers_fun)(mp_obj_t, uint8_t *dirty_row_bitmask); typedef struct _framebuffer_p_t { MP_PROTOCOL_HEAD // MP_QSTR_protocol_framebuffer From c1400bae9bbdd55f650ddfe24edf6778f08c35b8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 6 Aug 2020 16:03:31 -0500 Subject: [PATCH 0557/1293] sharpmemory: Implement support for Sharp Memory Displays in framebufferio --- py/circuitpy_defns.mk | 5 + py/circuitpy_mpconfig.h | 22 +- py/circuitpy_mpconfig.mk | 6 +- py/qstr.c | 1 + .../sharpdisplay/SharpMemoryFramebuffer.c | 92 ++++++ .../sharpdisplay/SharpMemoryFramebuffer.h | 34 +++ shared-bindings/sharpdisplay/__init__.c | 47 +++ shared-bindings/sharpdisplay/__init__.h | 0 shared-module/displayio/__init__.c | 33 +- shared-module/displayio/__init__.h | 10 + .../framebufferio/FramebufferDisplay.c | 21 +- .../framebufferio/FramebufferDisplay.h | 3 +- .../sharpdisplay/SharpMemoryFramebuffer.c | 282 ++++++++++++++++++ .../sharpdisplay/SharpMemoryFramebuffer.h | 60 ++++ shared-module/sharpdisplay/__init__.c | 0 shared-module/sharpdisplay/__init__.h | 0 supervisor/shared/display.c | 21 +- 17 files changed, 608 insertions(+), 29 deletions(-) create mode 100644 shared-bindings/sharpdisplay/SharpMemoryFramebuffer.c create mode 100644 shared-bindings/sharpdisplay/SharpMemoryFramebuffer.h create mode 100644 shared-bindings/sharpdisplay/__init__.c create mode 100644 shared-bindings/sharpdisplay/__init__.h create mode 100644 shared-module/sharpdisplay/SharpMemoryFramebuffer.c create mode 100644 shared-module/sharpdisplay/SharpMemoryFramebuffer.h create mode 100644 shared-module/sharpdisplay/__init__.c create mode 100644 shared-module/sharpdisplay/__init__.h diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index a39e0c9ddf..515b386f9e 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -222,6 +222,9 @@ endif ifeq ($(CIRCUITPY_SDIOIO),1) SRC_PATTERNS += sdioio/% endif +ifeq ($(CIRCUITPY_SHARPDISPLAY),1) +SRC_PATTERNS += sharpdisplay/% +endif ifeq ($(CIRCUITPY_STAGE),1) SRC_PATTERNS += _stage/% endif @@ -409,6 +412,8 @@ SRC_SHARED_MODULE_ALL = \ random/__init__.c \ rgbmatrix/RGBMatrix.c \ rgbmatrix/__init__.c \ + sharpdisplay/SharpMemoryFramebuffer.c \ + sharpdisplay/__init__.c \ socket/__init__.c \ storage/__init__.c \ struct/__init__.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 255ab99b93..f0e8adffa1 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -499,13 +499,6 @@ extern const struct _mp_obj_module_t pixelbuf_module; #define PIXELBUF_MODULE #endif -#if CIRCUITPY_RGBMATRIX -extern const struct _mp_obj_module_t rgbmatrix_module; -#define RGBMATRIX_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_rgbmatrix),(mp_obj_t)&rgbmatrix_module }, -#else -#define RGBMATRIX_MODULE -#endif - #if CIRCUITPY_PULSEIO extern const struct _mp_obj_module_t pulseio_module; #define PULSEIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_pulseio), (mp_obj_t)&pulseio_module }, @@ -520,6 +513,13 @@ extern const struct _mp_obj_module_t ps2io_module; #define PS2IO_MODULE #endif +#if CIRCUITPY_RGBMATRIX +extern const struct _mp_obj_module_t rgbmatrix_module; +#define RGBMATRIX_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_rgbmatrix),(mp_obj_t)&rgbmatrix_module }, +#else +#define RGBMATRIX_MODULE +#endif + #if CIRCUITPY_RANDOM extern const struct _mp_obj_module_t random_module; #define RANDOM_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_random), (mp_obj_t)&random_module }, @@ -562,6 +562,13 @@ extern const struct _mp_obj_module_t sdioio_module; #define SDIOIO_MODULE #endif +#if CIRCUITPY_SHARPDISPLAY +extern const struct _mp_obj_module_t sharpdisplay_module; +#define SHARPDISPLAY_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_sharpdisplay),(mp_obj_t)&sharpdisplay_module }, +#else +#define SHARPDISPLAY_MODULE +#endif + #if CIRCUITPY_STAGE extern const struct _mp_obj_module_t stage_module; #define STAGE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__stage), (mp_obj_t)&stage_module }, @@ -737,6 +744,7 @@ extern const struct _mp_obj_module_t watchdog_module; SAMD_MODULE \ SDCARDIO_MODULE \ SDIOIO_MODULE \ + SHARPDISPLAY_MODULE \ STAGE_MODULE \ STORAGE_MODULE \ STRUCT_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 2cf8426e5f..1ba71fa023 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -95,7 +95,7 @@ CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO) CIRCUITPY_DISPLAYIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_DISPLAYIO=$(CIRCUITPY_DISPLAYIO) -CIRCUITPY_FRAMEBUFFERIO ?= 0 +CIRCUITPY_FRAMEBUFFERIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_FRAMEBUFFERIO=$(CIRCUITPY_FRAMEBUFFERIO) CIRCUITPY_VECTORIO ?= $(CIRCUITPY_DISPLAYIO) @@ -144,7 +144,6 @@ CFLAGS += -DCIRCUITPY_OS=$(CIRCUITPY_OS) CIRCUITPY_PIXELBUF ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_PIXELBUF=$(CIRCUITPY_PIXELBUF) -# Only for SAMD boards for the moment CIRCUITPY_RGBMATRIX ?= 0 CFLAGS += -DCIRCUITPY_RGBMATRIX=$(CIRCUITPY_RGBMATRIX) @@ -176,6 +175,9 @@ CFLAGS += -DCIRCUITPY_SDCARDIO=$(CIRCUITPY_SDCARDIO) CIRCUITPY_SDIOIO ?= 0 CFLAGS += -DCIRCUITPY_SDIOIO=$(CIRCUITPY_SDIOIO) +CIRCUITPY_SHARPDISPLAY ?= $(CIRCUITPY_FRAMEBUFFERIO) +CFLAGS += -DCIRCUITPY_SHARPDISPLAY=$(CIRCUITPY_SHARPDISPLAY) + # Currently always off. CIRCUITPY_STAGE ?= 0 CFLAGS += -DCIRCUITPY_STAGE=$(CIRCUITPY_STAGE) diff --git a/py/qstr.c b/py/qstr.c index 17d8517c93..c9ba298fb7 100755 --- a/py/qstr.c +++ b/py/qstr.c @@ -137,6 +137,7 @@ STATIC const byte *find_qstr(qstr q) { while (q < pool->total_prev_len) { pool = pool->prev; } + assert(q - pool->total_prev_len < pool->len); return pool->qstrs[q - pool->total_prev_len]; } diff --git a/shared-bindings/sharpdisplay/SharpMemoryFramebuffer.c b/shared-bindings/sharpdisplay/SharpMemoryFramebuffer.c new file mode 100644 index 0000000000..e8f4e970a2 --- /dev/null +++ b/shared-bindings/sharpdisplay/SharpMemoryFramebuffer.c @@ -0,0 +1,92 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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/objarray.h" +#include "py/runtime.h" + +#include "shared-bindings/busio/SPI.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/sharpdisplay/SharpMemoryFramebuffer.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/sharpdisplay/SharpMemoryFramebuffer.h" + +STATIC mp_obj_t sharpdisplay_framebuffer_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_spi_bus, ARG_chip_select, ARG_width, ARG_height, ARG_baudrate, NUM_ARGS }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_spi_bus, MP_ARG_OBJ | MP_ARG_REQUIRED, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_chip_select, MP_ARG_OBJ | MP_ARG_REQUIRED, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_width, MP_ARG_INT | MP_ARG_REQUIRED, {.u_int = 0} }, + { MP_QSTR_height, MP_ARG_INT | MP_ARG_REQUIRED, {.u_int = 0} }, + { MP_QSTR_baudrate, MP_ARG_INT, {.u_int = 2000000} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); + + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + mcu_pin_obj_t *chip_select = validate_obj_is_free_pin(args[ARG_chip_select].u_obj); + busio_spi_obj_t *spi = validate_obj_is_spi_bus(args[ARG_spi_bus].u_obj); + + sharpdisplay_framebuffer_obj_t* self = &allocate_display_bus_or_raise()->sharpdisplay; + self->base.type = &sharpdisplay_framebuffer_type; + + common_hal_sharpdisplay_framebuffer_construct(self, spi, chip_select, args[ARG_baudrate].u_int, args[ARG_width].u_int, args[ARG_height].u_int); + + return MP_OBJ_FROM_PTR(self); +} + + +STATIC mp_int_t sharpdisplay_framebuffer_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bufinfo, mp_uint_t flags) { + sharpdisplay_framebuffer_obj_t *self = (sharpdisplay_framebuffer_obj_t*)self_in; + // a readonly framebuffer would be unusual but not impossible + if ((flags & MP_BUFFER_WRITE) && !(self->bufinfo.typecode & MP_OBJ_ARRAY_TYPECODE_FLAG_RW)) { + return 1; + } + *bufinfo = self->bufinfo; + return 0; +} + +STATIC mp_obj_t sharpdisplay_framebuffer_deinit(mp_obj_t self_in) { + sharpdisplay_framebuffer_obj_t *self = (sharpdisplay_framebuffer_obj_t*)self_in; + common_hal_sharpdisplay_framebuffer_deinit(self); + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(sharpdisplay_framebuffer_deinit_obj, sharpdisplay_framebuffer_deinit); + +STATIC const mp_rom_map_elem_t sharpdisplay_framebuffer_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&sharpdisplay_framebuffer_deinit_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(sharpdisplay_framebuffer_locals_dict, sharpdisplay_framebuffer_locals_dict_table); + +const mp_obj_type_t sharpdisplay_framebuffer_type = { + { &mp_type_type }, + .name = MP_QSTR_SharpMemoryFramebuffer, + .buffer_p = { .get_buffer = sharpdisplay_framebuffer_get_buffer, }, + .make_new = sharpdisplay_framebuffer_make_new, + .protocol = &sharpdisplay_framebuffer_proto, + .locals_dict = (mp_obj_dict_t*)&sharpdisplay_framebuffer_locals_dict, +}; diff --git a/shared-bindings/sharpdisplay/SharpMemoryFramebuffer.h b/shared-bindings/sharpdisplay/SharpMemoryFramebuffer.h new file mode 100644 index 0000000000..30f1b867b1 --- /dev/null +++ b/shared-bindings/sharpdisplay/SharpMemoryFramebuffer.h @@ -0,0 +1,34 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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/sharpdisplay/SharpMemoryFramebuffer.h" +// #include "shared-module/framebufferio/FramebufferDisplay.h" + +#include "py/objtype.h" + +extern const mp_obj_type_t sharpdisplay_framebuffer_type; diff --git a/shared-bindings/sharpdisplay/__init__.c b/shared-bindings/sharpdisplay/__init__.c new file mode 100644 index 0000000000..d1f728c61b --- /dev/null +++ b/shared-bindings/sharpdisplay/__init__.c @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/sharpdisplay/SharpMemoryFramebuffer.h" + +//| """Support for Sharp Memory Display framebuffers""" +//| + +STATIC const mp_rom_map_elem_t sharpdisplay_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_sharpdisplay) }, + { MP_ROM_QSTR(MP_QSTR_SharpMemoryFramebuffer), MP_ROM_PTR(&sharpdisplay_framebuffer_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(sharpdisplay_module_globals, sharpdisplay_module_globals_table); + +const mp_obj_module_t sharpdisplay_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&sharpdisplay_module_globals, +}; diff --git a/shared-bindings/sharpdisplay/__init__.h b/shared-bindings/sharpdisplay/__init__.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index efc28470fb..e52ec5b9e3 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -19,14 +19,19 @@ #include "supervisor/spi_flash_api.h" #include "py/mpconfig.h" +#if CIRCUITPY_SHARPDISPLAY +#include "shared-bindings/sharpdisplay/SharpMemoryFramebuffer.h" +#include "shared-module/sharpdisplay/SharpMemoryFramebuffer.h" +#endif + primary_display_t displays[CIRCUITPY_DISPLAY_LIMIT]; -#if CIRCUITPY_RGBMATRIX -STATIC bool any_display_uses_this_rgbmatrix(rgbmatrix_rgbmatrix_obj_t* pm) { +#if CIRCUITPY_RGBMATRIX || CIRCUITPY_SHARPDISPLAY +STATIC bool any_display_uses_this_framebuffer(mp_obj_base_t *obj) { for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { - if (displays[i].framebuffer_display.base.type == &framebufferio_framebufferdisplay_type) { + if (displays[i].display_base.type == &framebufferio_framebufferdisplay_type) { framebufferio_framebufferdisplay_obj_t* display = &displays[i].framebuffer_display; - if (display->framebuffer == pm) { + if (display->framebuffer == obj) { return true; } } @@ -105,6 +110,10 @@ void common_hal_displayio_release_displays(void) { #if CIRCUITPY_FRAMEBUFFERIO } else if (bus_type == &rgbmatrix_RGBMatrix_type) { common_hal_rgbmatrix_rgbmatrix_deinit(&displays[i].rgbmatrix); +#endif +#if CIRCUITPY_SHARPDISPLAY + } else if (displays[i].bus_base.type == &sharpdisplay_framebuffer_type) { + common_hal_sharpdisplay_framebuffer_deinit(&displays[i].sharpdisplay); #endif } displays[i].fourwire_bus.base.type = &mp_type_NoneType; @@ -170,9 +179,18 @@ void reset_displays(void) { #if CIRCUITPY_RGBMATRIX } else if (displays[i].rgbmatrix.base.type == &rgbmatrix_RGBMatrix_type) { rgbmatrix_rgbmatrix_obj_t * pm = &displays[i].rgbmatrix; - if(!any_display_uses_this_rgbmatrix(pm)) { + if(!any_display_uses_this_framebuffer(&pm->base)) { common_hal_rgbmatrix_rgbmatrix_deinit(pm); } +#endif +#if CIRCUITPY_SHARPDISPLAY + } else if (displays[i].bus_base.type == &sharpdisplay_framebuffer_type) { + sharpdisplay_framebuffer_obj_t * sharp = &displays[i].sharpdisplay; + if(any_display_uses_this_framebuffer(&sharp->base)) { + common_hal_sharpdisplay_framebuffer_reset(sharp); + } else { + common_hal_sharpdisplay_framebuffer_deinit(sharp); + } #endif } else { // Not an active display bus. @@ -203,6 +221,11 @@ void displayio_gc_collect(void) { rgbmatrix_rgbmatrix_collect_ptrs(&displays[i].rgbmatrix); } #endif +#if CIRCUITPY_SHARPDISPLAY + if (displays[i].rgbmatrix.base.type == &sharpdisplay_framebuffer_type) { + common_hal_sharpdisplay_framebuffer_collect_ptrs(&displays[i].sharpdisplay); + } +#endif if (displays[i].display.base.type == NULL) { continue; diff --git a/shared-module/displayio/__init__.h b/shared-module/displayio/__init__.h index 9eb10c28b2..44ad5a9a98 100644 --- a/shared-module/displayio/__init__.h +++ b/shared-module/displayio/__init__.h @@ -36,18 +36,28 @@ #include "shared-bindings/displayio/Group.h" #include "shared-bindings/displayio/I2CDisplay.h" #include "shared-bindings/displayio/ParallelBus.h" +#if CIRCUITPY_RGBMATRIX #include "shared-bindings/rgbmatrix/RGBMatrix.h" +#endif +#if CIRCUITPY_SHARPDISPLAY +#include "shared-module/sharpdisplay/SharpMemoryFramebuffer.h" +#endif typedef struct { union { + mp_obj_base_t bus_base; displayio_fourwire_obj_t fourwire_bus; displayio_i2cdisplay_obj_t i2cdisplay_bus; displayio_parallelbus_obj_t parallel_bus; #if CIRCUITPY_RGBMATRIX rgbmatrix_rgbmatrix_obj_t rgbmatrix; +#endif +#if CIRCUITPY_SHARPDISPLAY + sharpdisplay_framebuffer_obj_t sharpdisplay; #endif }; union { + mp_obj_base_t display_base; displayio_display_obj_t display; displayio_epaperdisplay_obj_t epaper_display; #if CIRCUITPY_FRAMEBUFFERIO diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 9a6797cd8c..6b5346877c 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -156,7 +156,7 @@ STATIC const displayio_area_t* _get_refresh_areas(framebufferio_framebufferdispl return NULL; } -#define MARK_ROW_DIRTY(r) (dirty_row_bitmask[r/8] = (1 << (r & 7))) +#define MARK_ROW_DIRTY(r) (dirty_row_bitmask[r/8] |= (1 << (r & 7))) STATIC bool _refresh_area(framebufferio_framebufferdisplay_obj_t* self, const displayio_area_t* area, uint8_t *dirty_row_bitmask) { uint16_t buffer_size = 128; // In uint32_ts @@ -250,6 +250,10 @@ STATIC bool _refresh_area(framebufferio_framebufferdisplay_obj_t* self, const di } STATIC void _refresh_display(framebufferio_framebufferdisplay_obj_t* self) { + self->framebuffer_protocol->get_bufinfo(self->framebuffer, &self->bufinfo); + if(!self->bufinfo.buf) { + return; + } displayio_display_core_start_refresh(&self->core); const displayio_area_t* current_area = _get_refresh_areas(self); if (current_area) { @@ -348,17 +352,18 @@ void release_framebufferdisplay(framebufferio_framebufferdisplay_obj_t* self) { self->base.type = &mp_type_NoneType; } -void reset_framebufferdisplay(framebufferio_framebufferdisplay_obj_t* self) { - common_hal_framebufferio_framebufferdisplay_set_auto_refresh(self, true); - common_hal_framebufferio_framebufferdisplay_show(self, NULL); -} - void framebufferio_framebufferdisplay_collect_ptrs(framebufferio_framebufferdisplay_obj_t* self) { gc_collect_ptr(self->framebuffer); displayio_display_core_collect_ptrs(&self->core); } void framebufferio_framebufferdisplay_reset(framebufferio_framebufferdisplay_obj_t* self) { - common_hal_framebufferio_framebufferdisplay_set_auto_refresh(self, true); - common_hal_framebufferio_framebufferdisplay_show(self, NULL); + mp_obj_type_t *fb_type = mp_obj_get_type(self->framebuffer); + if(fb_type != NULL && fb_type != &mp_type_NoneType) { + common_hal_framebufferio_framebufferdisplay_set_auto_refresh(self, true); + common_hal_framebufferio_framebufferdisplay_show(self, NULL); + self->core.full_refresh = true; + } else { + release_framebufferdisplay(self); + } } diff --git a/shared-module/framebufferio/FramebufferDisplay.h b/shared-module/framebufferio/FramebufferDisplay.h index 027086b5a1..111c9f670d 100644 --- a/shared-module/framebufferio/FramebufferDisplay.h +++ b/shared-module/framebufferio/FramebufferDisplay.h @@ -55,7 +55,6 @@ typedef struct { void framebufferio_framebufferdisplay_background(framebufferio_framebufferdisplay_obj_t* self); void release_framebufferdisplay(framebufferio_framebufferdisplay_obj_t* self); -void reset_framebufferdisplay(framebufferio_framebufferdisplay_obj_t* self); void framebufferio_framebufferdisplay_reset(framebufferio_framebufferdisplay_obj_t* self); void framebufferio_framebufferdisplay_collect_ptrs(framebufferio_framebufferdisplay_obj_t* self); @@ -73,7 +72,7 @@ typedef int (*framebuffer_get_first_pixel_offset_fun)(mp_obj_t); typedef int (*framebuffer_get_grayscale_fun)(mp_obj_t); typedef int (*framebuffer_get_height_fun)(mp_obj_t); typedef int (*framebuffer_get_native_frames_per_second_fun)(mp_obj_t); -typedef int (*framebuffer_get_pixels_in_byte_share_row_fun)(mp_obj_t); +typedef bool (*framebuffer_get_pixels_in_byte_share_row_fun)(mp_obj_t); typedef int (*framebuffer_get_row_stride_fun)(mp_obj_t); typedef int (*framebuffer_get_width_fun)(mp_obj_t); typedef mp_float_t (*framebuffer_get_brightness_fun)(mp_obj_t); diff --git a/shared-module/sharpdisplay/SharpMemoryFramebuffer.c b/shared-module/sharpdisplay/SharpMemoryFramebuffer.c new file mode 100644 index 0000000000..ac9c225729 --- /dev/null +++ b/shared-module/sharpdisplay/SharpMemoryFramebuffer.c @@ -0,0 +1,282 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "py/gc.h" + +#include "shared-bindings/board/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/sharpdisplay/SharpMemoryFramebuffer.h" +#include "shared-module/sharpdisplay/SharpMemoryFramebuffer.h" + +#include "supervisor/memory.h" + +#define SHARPMEM_BIT_WRITECMD_LSB (0x80) +#define SHARPMEM_BIT_VCOM_LSB (0x40) + +static inline void *hybrid_alloc(size_t sz) { + if (gc_alloc_possible()) { + return m_malloc(sz + sizeof(void*), true); + } else { + supervisor_allocation *allocation = allocate_memory(align32_size(sz), false); + if (!allocation) { + return NULL; + } + memset(allocation->ptr, 0, sz); + return allocation->ptr; + } +} + +static inline void hybrid_free(void *ptr_in) { + supervisor_allocation *allocation = allocation_from_ptr(ptr_in); + + if (allocation) { + free_memory(allocation); + } +} + +STATIC uint8_t bitrev(uint8_t n) { + uint8_t r = 0; + for(int i=0;i<8;i++) r |= ((n>>i) & 1)<<(7-i); + return r; +} + +int common_hal_sharpdisplay_framebuffer_get_width(sharpdisplay_framebuffer_obj_t *self) { + return self->width; +} + +int common_hal_sharpdisplay_framebuffer_get_height(sharpdisplay_framebuffer_obj_t *self) { + return self->height; +} + +int common_hal_sharpdisplay_framebuffer_get_row_stride(sharpdisplay_framebuffer_obj_t *self) { + return (self->width + 7) / 8 + 2; +} + +int common_hal_sharpdisplay_framebuffer_get_first_pixel_offset(sharpdisplay_framebuffer_obj_t *self) { + return 2; +} + +bool common_hal_sharpdisplay_framebuffer_get_reverse_pixels_in_byte(sharpdisplay_framebuffer_obj_t *self) { + return true; +} + +bool common_hal_sharpdisplay_framebuffer_get_pixels_in_byte_share_row(sharpdisplay_framebuffer_obj_t *self) { + return true; +} + +void common_hal_sharpdisplay_framebuffer_reset(sharpdisplay_framebuffer_obj_t *self) { + if (!allocation_from_ptr(self->bufinfo.buf)) { + self->bufinfo.buf = NULL; + } + + if (self->bus != &self->inline_bus +#if BOARD_SPI + && self->bus != common_hal_board_get_spi() +#endif + ) { + memcpy(&self->inline_bus, self->bus, sizeof(busio_spi_obj_t)); + self->bus = &self->inline_bus; + } +} + +void common_hal_sharpdisplay_framebuffer_reconstruct(sharpdisplay_framebuffer_obj_t *self) { + +} + +void common_hal_sharpdisplay_framebuffer_get_bufinfo(sharpdisplay_framebuffer_obj_t *self, mp_buffer_info_t *bufinfo) { + if (!self->bufinfo.buf) { + int row_stride = common_hal_sharpdisplay_framebuffer_get_row_stride(self); + int height = common_hal_sharpdisplay_framebuffer_get_height(self); + self->bufinfo.len = row_stride * height + 2; + self->bufinfo.buf = hybrid_alloc(self->bufinfo.len); + + uint8_t *data = self->bufinfo.buf; + *data++ = SHARPMEM_BIT_WRITECMD_LSB; + + for(int y=0; yfull_refresh = true; + } + *bufinfo = self->bufinfo; +} + +void common_hal_sharpdisplay_framebuffer_deinit(sharpdisplay_framebuffer_obj_t *self) { + if (self->base.type != &sharpdisplay_framebuffer_type) { + return; + } + + if (self->bus == &self->inline_bus) { + common_hal_busio_spi_deinit(self->bus); + } + + common_hal_reset_pin(self->chip_select.pin); + + hybrid_free(self->bufinfo.buf); + + memset(self, 0, sizeof(*self)); +} + +void common_hal_sharpdisplay_framebuffer_construct(sharpdisplay_framebuffer_obj_t *self, busio_spi_obj_t *spi, mcu_pin_obj_t *chip_select, int baudrate, int width, int height) { + common_hal_digitalio_digitalinout_construct(&self->chip_select, chip_select); + common_hal_digitalio_digitalinout_switch_to_output(&self->chip_select, true, DRIVE_MODE_PUSH_PULL); + common_hal_never_reset_pin(chip_select); + + self->bus = spi; + common_hal_busio_spi_never_reset(self->bus); + + self->width = width; + self->height = height; + self->baudrate = baudrate; + + int row_stride = common_hal_sharpdisplay_framebuffer_get_row_stride(self); + self->bufinfo.len = row_stride * height + 2; + self->bufinfo.buf = gc_alloc(self->bufinfo.len, false, true); + + uint8_t *data = self->bufinfo.buf; + *data++ = SHARPMEM_BIT_WRITECMD_LSB; + + for(int y=0; yheight; y++) { + *data = bitrev(y+1); + data += row_stride; + } + self->full_refresh = true; +} + +void common_hal_sharpdisplay_framebuffer_swapbuffers(sharpdisplay_framebuffer_obj_t *self, uint8_t *dirty_row_bitmask) { + // claim SPI bus + if (!common_hal_busio_spi_try_lock(self->bus)) { + return; + } + common_hal_busio_spi_configure(self->bus, self->baudrate, 0, 0, 8); + + // set chip select high + common_hal_digitalio_digitalinout_set_value(&self->chip_select, true); + + // output the toggling signal + uint8_t *data = self->bufinfo.buf; + data[0] ^= SHARPMEM_BIT_VCOM_LSB; + +#define PARTIAL_UPDATES (1) +#if PARTIAL_UPDATES + common_hal_busio_spi_write(self->bus, data++, 1); + + // output each changed row + size_t row_stride = common_hal_sharpdisplay_framebuffer_get_row_stride(self); + for(int y=0; yheight; y++) { + if(self->full_refresh || (dirty_row_bitmask[y/8] & (1 << (y & 7)))) { + common_hal_busio_spi_write(self->bus, data, row_stride); + } + data += row_stride; + } + + // output a trailing zero + common_hal_busio_spi_write(self->bus, data, 1); +#else + common_hal_busio_spi_write(self->bus, data, self->bufinfo.len); +#endif + + // set chip select low + common_hal_digitalio_digitalinout_set_value(&self->chip_select, false); + + // release SPI bus + common_hal_busio_spi_unlock(self->bus); + + self->full_refresh = false; +} + +STATIC void sharpdisplay_framebuffer_deinit(mp_obj_t self_in) { + sharpdisplay_framebuffer_obj_t *self = self_in; + common_hal_sharpdisplay_framebuffer_deinit(self); +} + +STATIC void sharpdisplay_framebuffer_get_bufinfo(mp_obj_t self_in, mp_buffer_info_t *bufinfo) { + sharpdisplay_framebuffer_obj_t *self = self_in; + common_hal_sharpdisplay_framebuffer_get_bufinfo(self, bufinfo); +} + +STATIC int sharpdisplay_framebuffer_get_color_depth(mp_obj_t self_in) { + return 1; +} + +STATIC int sharpdisplay_framebuffer_get_height(mp_obj_t self_in) { + sharpdisplay_framebuffer_obj_t *self = self_in; + return common_hal_sharpdisplay_framebuffer_get_height(self); +} + +STATIC int sharpdisplay_framebuffer_get_width(mp_obj_t self_in) { + sharpdisplay_framebuffer_obj_t *self = self_in; + return common_hal_sharpdisplay_framebuffer_get_width(self); +} + +STATIC int sharpdisplay_framebuffer_get_first_pixel_offset(mp_obj_t self_in) { + sharpdisplay_framebuffer_obj_t *self = self_in; + return common_hal_sharpdisplay_framebuffer_get_first_pixel_offset(self); +} + +STATIC bool sharpdisplay_framebuffer_get_pixels_in_byte_share_row(mp_obj_t self_in) { + sharpdisplay_framebuffer_obj_t *self = self_in; + return common_hal_sharpdisplay_framebuffer_get_pixels_in_byte_share_row(self); +} + +STATIC bool sharpdisplay_framebuffer_get_reverse_pixels_in_byte(mp_obj_t self_in) { + sharpdisplay_framebuffer_obj_t *self = self_in; + return common_hal_sharpdisplay_framebuffer_get_reverse_pixels_in_byte(self); +} + +STATIC int sharpdisplay_framebuffer_get_row_stride(mp_obj_t self_in) { + sharpdisplay_framebuffer_obj_t *self = self_in; + return common_hal_sharpdisplay_framebuffer_get_row_stride(self); +} + +STATIC void sharpdisplay_framebuffer_swapbuffers(mp_obj_t self_in, uint8_t *dirty_row_bitmask) { + sharpdisplay_framebuffer_obj_t *self = self_in; + common_hal_sharpdisplay_framebuffer_swapbuffers(self, dirty_row_bitmask); +} + +const framebuffer_p_t sharpdisplay_framebuffer_proto = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_framebuffer) + .deinit = sharpdisplay_framebuffer_deinit, + .get_bufinfo = sharpdisplay_framebuffer_get_bufinfo, + .get_color_depth = sharpdisplay_framebuffer_get_color_depth, + .get_height = sharpdisplay_framebuffer_get_height, + .get_width = sharpdisplay_framebuffer_get_width, + .swapbuffers = sharpdisplay_framebuffer_swapbuffers, + + .get_first_pixel_offset = sharpdisplay_framebuffer_get_first_pixel_offset, + .get_pixels_in_byte_share_row = sharpdisplay_framebuffer_get_pixels_in_byte_share_row, + .get_reverse_pixels_in_byte = sharpdisplay_framebuffer_get_reverse_pixels_in_byte, + .get_row_stride = sharpdisplay_framebuffer_get_row_stride, +}; + +void common_hal_sharpdisplay_framebuffer_collect_ptrs(sharpdisplay_framebuffer_obj_t *self) { + gc_collect_ptr(self->framebuffer); + gc_collect_ptr(self->bus); + gc_collect_ptr(self->bufinfo.buf); +} diff --git a/shared-module/sharpdisplay/SharpMemoryFramebuffer.h b/shared-module/sharpdisplay/SharpMemoryFramebuffer.h new file mode 100644 index 0000000000..8acacc94e1 --- /dev/null +++ b/shared-module/sharpdisplay/SharpMemoryFramebuffer.h @@ -0,0 +1,60 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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" +#include "shared-bindings/busio/SPI.h" +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "shared-module/framebufferio/FramebufferDisplay.h" + +typedef struct { + mp_obj_base_t base; + mp_obj_t framebuffer; + busio_spi_obj_t* bus; + busio_spi_obj_t inline_bus; + digitalio_digitalinout_obj_t chip_select; + mp_buffer_info_t bufinfo; + + uint16_t width, height; + uint32_t baudrate; + + bool full_refresh:1; +} sharpdisplay_framebuffer_obj_t; + +void common_hal_sharpdisplay_framebuffer_construct(sharpdisplay_framebuffer_obj_t *self, busio_spi_obj_t *spi, mcu_pin_obj_t *chip_select, int baudrate, int width, int height); +void common_hal_sharpdisplay_framebuffer_swap_buffers(sharpdisplay_framebuffer_obj_t *self, uint8_t *dirty_row_bitmask); +void common_hal_sharpdisplay_framebuffer_deinit(sharpdisplay_framebuffer_obj_t *self); +void common_hal_sharpdisplay_framebuffer_get_bufinfo(sharpdisplay_framebuffer_obj_t *self, mp_buffer_info_t *bufinfo); +int common_hal_sharpdisplay_framebuffer_get_height(sharpdisplay_framebuffer_obj_t *self); +int common_hal_sharpdisplay_framebuffer_get_width(sharpdisplay_framebuffer_obj_t *self); +void common_hal_sharpdisplay_framebuffer_swap_buffers(sharpdisplay_framebuffer_obj_t *self, uint8_t *dirty_row_bitmask); +void common_hal_sharpdisplay_framebuffer_reset(sharpdisplay_framebuffer_obj_t *self); +void common_hal_sharpdisplay_framebuffer_reconstruct(sharpdisplay_framebuffer_obj_t *self); + +extern const framebuffer_p_t sharpdisplay_framebuffer_proto; + +void common_hal_sharpdisplay_framebuffer_collect_ptrs(sharpdisplay_framebuffer_obj_t*); diff --git a/shared-module/sharpdisplay/__init__.c b/shared-module/sharpdisplay/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shared-module/sharpdisplay/__init__.h b/shared-module/sharpdisplay/__init__.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index 9c074209b8..a86ef6396f 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -38,6 +38,11 @@ #include "shared-module/displayio/__init__.h" #endif +#if CIRCUITPY_SHARPDISPLAY +#include "shared-bindings/sharpdisplay/SharpMemoryFramebuffer.h" +#include "shared-module/sharpdisplay/SharpMemoryFramebuffer.h" +#endif + extern size_t blinka_bitmap_data[]; extern displayio_bitmap_t blinka_bitmap; extern displayio_group_t circuitpython_splash; @@ -116,15 +121,21 @@ void supervisor_display_move_memory(void) { grid->inline_tiles = false; } MP_STATE_VM(terminal_tilegrid_tiles) = NULL; - #if CIRCUITPY_RGBMATRIX for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { - if (displays[i].rgbmatrix.base.type == &rgbmatrix_RGBMatrix_type) { - rgbmatrix_rgbmatrix_obj_t * pm = &displays[i].rgbmatrix; + #if CIRCUITPY_RGBMATRIX + if (displays[i].rgbmatrix.base.type == &rgbmatrix_RGBMatrix_type) { + rgbmatrix_rgbmatrix_obj_t * pm = &displays[i].rgbmatrix; common_hal_rgbmatrix_rgbmatrix_reconstruct(pm, NULL); - } + } + #endif + #if CIRCUITPY_SHARPDISPLAY + if (displays[i].bus_base.type == &sharpdisplay_framebuffer_type) { + sharpdisplay_framebuffer_obj_t * sharp = &displays[i].sharpdisplay; + common_hal_sharpdisplay_framebuffer_reconstruct(sharp); + } + #endif } #endif - #endif } size_t blinka_bitmap_data[32] = { From 65f91f69ccdb3489f5ba649c939b8e3e96cc74e4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 11 Aug 2020 15:37:10 -0500 Subject: [PATCH 0558/1293] make translate --- locale/circuitpython.pot | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 510facece6..32b5df5ee3 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-10 12:54-0500\n" +"POT-Creation-Date: 2020-08-11 15:37-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -823,6 +823,11 @@ msgstr "" msgid "File exists" msgstr "" +#: shared-module/framebufferio/FramebufferDisplay.c +#, c-format +msgid "Framebuffer requires %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" From 759ded9c38390c6d4328bd34aa211499b7e9f4f6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 07:39:12 -0500 Subject: [PATCH 0559/1293] Fix build errors when SHARPDISPLAY && !RGBMATRIX --- shared-module/displayio/__init__.c | 4 ++-- supervisor/shared/display.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index e52ec5b9e3..5afcba35ec 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -107,7 +107,7 @@ void common_hal_displayio_release_displays(void) { common_hal_displayio_i2cdisplay_deinit(&displays[i].i2cdisplay_bus); } else if (bus_type == &displayio_parallelbus_type) { common_hal_displayio_parallelbus_deinit(&displays[i].parallel_bus); -#if CIRCUITPY_FRAMEBUFFERIO +#if CIRCUITPY_RGBMATRIX } else if (bus_type == &rgbmatrix_RGBMatrix_type) { common_hal_rgbmatrix_rgbmatrix_deinit(&displays[i].rgbmatrix); #endif @@ -222,7 +222,7 @@ void displayio_gc_collect(void) { } #endif #if CIRCUITPY_SHARPDISPLAY - if (displays[i].rgbmatrix.base.type == &sharpdisplay_framebuffer_type) { + if (displays[i].bus_base.type == &sharpdisplay_framebuffer_type) { common_hal_sharpdisplay_framebuffer_collect_ptrs(&displays[i].sharpdisplay); } #endif diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index a86ef6396f..08dd71404b 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -39,6 +39,7 @@ #endif #if CIRCUITPY_SHARPDISPLAY +#include "shared-module/displayio/__init__.h" #include "shared-bindings/sharpdisplay/SharpMemoryFramebuffer.h" #include "shared-module/sharpdisplay/SharpMemoryFramebuffer.h" #endif From cff448205f165dfd5ec40cc5b336decff045d4cd Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 07:39:28 -0500 Subject: [PATCH 0560/1293] Don't define SHARPDISPLAY when !DISPLAYIO .. even if FULL_BUILD --- py/circuitpy_mpconfig.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 1ba71fa023..56060fa594 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -95,7 +95,11 @@ CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO) CIRCUITPY_DISPLAYIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_DISPLAYIO=$(CIRCUITPY_DISPLAYIO) +ifeq ($(CIRCUITPY_DISPLAYIO),1) CIRCUITPY_FRAMEBUFFERIO ?= $(CIRCUITPY_FULL_BUILD) +else +CIRCUITPY_FRAMEBUFFERIO ?= 0 +endif CFLAGS += -DCIRCUITPY_FRAMEBUFFERIO=$(CIRCUITPY_FRAMEBUFFERIO) CIRCUITPY_VECTORIO ?= $(CIRCUITPY_DISPLAYIO) From 454e616d13e6db762271b9e1ea8191407228e0ae Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 10:46:56 -0500 Subject: [PATCH 0561/1293] atmel-samd: disable FRAMEBUFFERIO on samd21 .. this disables SHARPMEMORY as well. --- ports/atmel-samd/mpconfigport.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index e4cf9ca833..5788a160b1 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -39,6 +39,9 @@ endif CIRCUITPY_SDCARDIO ?= 0 +# Not enough RAM for framebuffers +CIRCUITPY_FRAMEBUFFERIO ?= 0 + # SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic. USB_MSC_EP_NUM_OUT = 1 From f9d1d9d114dd28c3abb62795b31a0a0ea36bc548 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 10:46:56 -0500 Subject: [PATCH 0562/1293] atmel-samd: disable FRAMEBUFFERIO on samd21 .. this disables SHARPMEMORY as well. --- ports/atmel-samd/mpconfigport.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index e4cf9ca833..5788a160b1 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -39,6 +39,9 @@ endif CIRCUITPY_SDCARDIO ?= 0 +# Not enough RAM for framebuffers +CIRCUITPY_FRAMEBUFFERIO ?= 0 + # SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic. USB_MSC_EP_NUM_OUT = 1 From f3748fe20d59347e49b5a26bceecd4c7f3ce03b3 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 11:46:31 -0500 Subject: [PATCH 0563/1293] circuitbrains_basic_m0: Use optimization flags to let ja translation fit --- .../circuitbrains_basic_m0/mpconfigboard.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk index 619b7d6944..5656d4cb86 100755 --- a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk @@ -16,3 +16,20 @@ CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 + +SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), ja) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif From 8865e4ca97de35457b955767f4aa3c99b3eeb8d7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 11:46:52 -0500 Subject: [PATCH 0564/1293] circuitplayground_express_displayio: make ja translation fit --- .../mpconfigboard.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index 863b97d315..3e3256e5b1 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -12,7 +12,9 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" # Turn off features and optimizations for Crickit build to make room for additional frozen libs. LONGINT_IMPL = NONE +CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_PIXELBUF = 0 @@ -29,3 +31,18 @@ FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Thermistor + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), ja) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 15 +endif +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif From 27c2eb1869fbbffdf85cab5e95e50f1ad5839a50 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 11:51:56 -0500 Subject: [PATCH 0565/1293] feather_m0_express: make ja translation fit --- .../boards/feather_m0_express/mpconfigboard.mk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk index cec87f2bf9..dc02e1f60d 100644 --- a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk @@ -13,8 +13,24 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_COUNTIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), ja) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif From 58afda342d9d3aeb2d74900d1ab0a6a0707621b9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 11:53:34 -0500 Subject: [PATCH 0566/1293] feather_m0_supersized: make ja translation fit --- .../feather_m0_supersized/mpconfigboard.mk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk index 8bd4b818df..6f7f2d8b67 100644 --- a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk @@ -13,9 +13,25 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_COUNTIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 # supersized, not ultra-supersized CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), ja) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif From 6b9f7c9047d73b5f89856758f30c8fe53a3e7906 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 12:29:30 -0500 Subject: [PATCH 0567/1293] hallowing_m0_express: make ja translation fit --- .../hallowing_m0_express/mpconfigboard.mk | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk index 15c5ad817c..1931ceb9a8 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk @@ -9,11 +9,12 @@ CHIP_FAMILY = samd21 SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C" -LONGINT_IMPL = MPZ +LONGINT_IMPL = NONE # To keep the build small CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CPERIPHERAL = 0 @@ -29,3 +30,18 @@ SUPEROPT_GC = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), ja) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif From ba91023fff6e6823eaa3491ab56be11c4efbc660 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 12:35:29 -0500 Subject: [PATCH 0568/1293] itsybitsy_m0_express: make ja translation fit --- .../boards/itsybitsy_m0_express/mpconfigboard.mk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk index 09420ed3da..e66f8040c9 100644 --- a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk @@ -14,6 +14,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANG_APA102 = 1 CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_COUNTIO = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_RTC = 0 @@ -22,3 +23,18 @@ CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), ja) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif From 88f222f1a1ddb945919b221aee5fda6c2db50350 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 12:38:17 -0500 Subject: [PATCH 0569/1293] metro_m0_express: make ja translation fit --- .../boards/metro_m0_express/mpconfigboard.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk index e3948565d1..bac404d76b 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk @@ -12,8 +12,25 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_COUNTIO = 0 +CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), ja) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif From 813dcd1b732443a54cdfc8ab1b9503e4e72dac5d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 12:40:43 -0500 Subject: [PATCH 0570/1293] trinket_m0_haxpress: make ja translation fit --- .../sparkfun_redboard_turbo/mpconfigboard.mk | 17 +++++++++++++++++ .../boards/trinket_m0_haxpress/mpconfigboard.mk | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk index c17600fc75..5170f8a233 100755 --- a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk @@ -12,8 +12,25 @@ EXTERNAL_FLASH_DEVICES = "W25Q32FV" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_COUNTIO = 0 +CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), ja) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk index 9e0621810c..402db7ebc0 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk @@ -11,6 +11,7 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = W25Q32BV LONGINT_IMPL = MPZ +CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_RTC = 0 @@ -18,3 +19,18 @@ CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), ja) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif From d61f66d173c956b10679e83b93d7f84fbc6f0bb4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 12:50:08 -0500 Subject: [PATCH 0571/1293] Update shared-module/framebufferio/FramebufferDisplay.h Co-authored-by: Scott Shawcroft --- shared-module/framebufferio/FramebufferDisplay.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared-module/framebufferio/FramebufferDisplay.h b/shared-module/framebufferio/FramebufferDisplay.h index 111c9f670d..89df0d27c1 100644 --- a/shared-module/framebufferio/FramebufferDisplay.h +++ b/shared-module/framebufferio/FramebufferDisplay.h @@ -48,7 +48,8 @@ typedef struct { uint64_t last_refresh_call; uint16_t native_frames_per_second; uint16_t native_ms_per_frame; - uint16_t first_pixel_offset, row_stride; + uint16_t first_pixel_offset; + uint16_t row_stride; bool auto_refresh; bool first_manual_refresh; } framebufferio_framebufferdisplay_obj_t; From 06f6cd067dbf3c3f01d6f85445a190ee18e58b01 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 12:51:35 -0500 Subject: [PATCH 0572/1293] nrf: Improve commenting about disabled warnings --- ports/nrf/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index d1745a70ef..3fef68e88e 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -100,8 +100,6 @@ CFLAGS += $(OPTIMIZATION_FLAGS) CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) # Undo some warnings. -## nrfx uses undefined preprocessor variables quite casually, so we can't do warning checks for these. -#CFLAGS += -Wno-undef # nrfx does casts that increase alignment requirements. CFLAGS += -Wno-cast-align @@ -240,6 +238,9 @@ endif OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) +# nrfx uses undefined preprocessor variables quite casually, so we can't do +# warning checks for these. Happily, we've confined the offenders to the NRFX +# source files themselves. $(addprefix $(BUILD)/, $(SRC_NRFX:.c=.o)): CFLAGS += -Wno-undef $(BUILD)/$(FATFS_DIR)/ff.o: COPT += -Os From 195c0ea986fd44f3b56cc57f23e8259df1e18202 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 13:01:43 -0500 Subject: [PATCH 0573/1293] sharpdisplay: Make PARTIAL_UPDATES unconditional --- shared-module/sharpdisplay/SharpMemoryFramebuffer.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/shared-module/sharpdisplay/SharpMemoryFramebuffer.c b/shared-module/sharpdisplay/SharpMemoryFramebuffer.c index ac9c225729..71e00d7f01 100644 --- a/shared-module/sharpdisplay/SharpMemoryFramebuffer.c +++ b/shared-module/sharpdisplay/SharpMemoryFramebuffer.c @@ -183,8 +183,6 @@ void common_hal_sharpdisplay_framebuffer_swapbuffers(sharpdisplay_framebuffer_ob uint8_t *data = self->bufinfo.buf; data[0] ^= SHARPMEM_BIT_VCOM_LSB; -#define PARTIAL_UPDATES (1) -#if PARTIAL_UPDATES common_hal_busio_spi_write(self->bus, data++, 1); // output each changed row @@ -198,9 +196,6 @@ void common_hal_sharpdisplay_framebuffer_swapbuffers(sharpdisplay_framebuffer_ob // output a trailing zero common_hal_busio_spi_write(self->bus, data, 1); -#else - common_hal_busio_spi_write(self->bus, data, self->bufinfo.len); -#endif // set chip select low common_hal_digitalio_digitalinout_set_value(&self->chip_select, false); From 36bfbaae695b80372e5acf040aaec3eea5ad7280 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 13:28:30 -0500 Subject: [PATCH 0574/1293] feather_radiofruit_zigbee: make ja translation fit --- .../mpconfigboard.mk | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk index e9d94638af..754594f346 100755 --- a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk @@ -15,6 +15,25 @@ LONGINT_IMPL = MPZ CIRCUITPY_AUDIOBUSIO = 0 # No DAC on SAMR21G CIRCUITPY_AUDIOIO = 0 +CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_COUNTIO = 0 +CIRCUITPY_RTC = 0 +CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_I2CPERIPHERAL = 0 -# Too much flash for Korean translations -CIRCUITPY_VECTORIO = 0 +SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), ja) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif From 45f6bc1f3e2c3a98ec56cfafb8c6d16193288641 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 13:32:08 -0500 Subject: [PATCH 0575/1293] serpente: make ja translation fit --- .../atmel-samd/boards/serpente/mpconfigboard.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ports/atmel-samd/boards/serpente/mpconfigboard.mk b/ports/atmel-samd/boards/serpente/mpconfigboard.mk index a5adb17a1e..6e953adf72 100644 --- a/ports/atmel-samd/boards/serpente/mpconfigboard.mk +++ b/ports/atmel-samd/boards/serpente/mpconfigboard.mk @@ -14,3 +14,20 @@ LONGINT_IMPL = NONE CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_GAMEPAD = 0 + +SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), ja) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif From 7bd42244c9b88a60631891ddf71dc8ae83dbf041 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 13:34:36 -0500 Subject: [PATCH 0576/1293] snekboard: make ja translation fit --- .../atmel-samd/boards/snekboard/mpconfigboard.mk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk index eae50d70bf..e0262b6b22 100644 --- a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk +++ b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk @@ -17,4 +17,20 @@ CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 + SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), ja) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif From f08ee0db20227ef53af182ee69fa1a3c9ad6a648 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 13:44:00 -0500 Subject: [PATCH 0577/1293] itsybitsy_m0_express: make ja translation fit again --- ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk index e66f8040c9..0c0d6053e4 100644 --- a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk @@ -13,8 +13,10 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANG_APA102 = 1 +CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_COUNTIO = 0 +CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_RTC = 0 From 299894025a9e4a7fa0ebfb67d9b3cc8484c7fbb3 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 13:47:10 -0500 Subject: [PATCH 0578/1293] stringcar_m0_express: make ja translation fit --- .../boards/stringcar_m0_express/mpconfigboard.mk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk index 6f3febfe56..68031e4a18 100644 --- a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk @@ -14,6 +14,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANG_APA102 = 1 +CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CPERIPHERAL = 0 @@ -22,3 +23,18 @@ CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), ja) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif From ea8e9b8cef887a66542c96f60b181ca43c452d57 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 16:17:13 -0500 Subject: [PATCH 0579/1293] metro_m0_express: Put back GAMEPAD, take away AUDIOBUSIO Dan notes that this is more frequently the solution we've chosen --- ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk index bac404d76b..0f4925b936 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk @@ -11,9 +11,9 @@ EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" LONGINT_IMPL = MPZ +CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_COUNTIO = 0 -CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 From aa0b4f7045e6f15ff4f6135563510698081b95e7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 16:17:48 -0500 Subject: [PATCH 0580/1293] cpx_display: Put back AUDIOBUSIO, take away ROTARYIO AUDIOBUSIO is needed for the on-board mic using PDMIn --- .../boards/circuitplayground_express_displayio/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index 3e3256e5b1..3a43093a98 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -12,12 +12,12 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" # Turn off features and optimizations for Crickit build to make room for additional frozen libs. LONGINT_IMPL = NONE -CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_PIXELBUF = 0 +CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 # So not all of displayio, sorry! CIRCUITPY_VECTORIO = 0 From 239c8ff87fb43a4bcb68a318cb1d539d3752d94f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 12 Aug 2020 19:11:33 -0500 Subject: [PATCH 0581/1293] metro_m0_express: put back audiobusio this now fits locally (though it's very close to capacity); let's see what the CI says. ``` make BOARD=metro_m0_express clean && make BOARD=metro_m0_express TRANSLATION=ja ... 253448 bytes used, 248 bytes free in flash firmware space out of 253696 bytes (247.75kB). ``` --- ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk index 0f4925b936..7dd9650003 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk @@ -11,7 +11,6 @@ EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" LONGINT_IMPL = MPZ -CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 From 44c9c43cd15ea7be3192313b1a1bb204743492a1 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 13 Aug 2020 00:03:39 -0400 Subject: [PATCH 0582/1293] ble_uart_echo_test works --- devices/ble_hci/common-hal/_bleio/Adapter.c | 43 +++- devices/ble_hci/common-hal/_bleio/Adapter.h | 7 + .../common-hal/_bleio/Characteristic.c | 129 +++++----- .../common-hal/_bleio/Characteristic.h | 15 +- .../common-hal/_bleio/CharacteristicBuffer.c | 63 +---- .../common-hal/_bleio/CharacteristicBuffer.h | 2 + .../ble_hci/common-hal/_bleio/Connection.c | 73 +++--- .../ble_hci/common-hal/_bleio/Connection.h | 3 +- .../ble_hci/common-hal/_bleio/Descriptor.c | 33 ++- .../ble_hci/common-hal/_bleio/PacketBuffer.c | 232 ++++-------------- .../ble_hci/common-hal/_bleio/PacketBuffer.h | 2 + devices/ble_hci/common-hal/_bleio/Service.c | 19 +- devices/ble_hci/common-hal/_bleio/__init__.c | 143 ----------- devices/ble_hci/common-hal/_bleio/__init__.h | 3 +- devices/ble_hci/common-hal/_bleio/att.c | 113 ++++++--- devices/ble_hci/common-hal/_bleio/att.h | 2 +- devices/ble_hci/common-hal/_bleio/hci.c | 27 +- devices/ble_hci/common-hal/_bleio/hci.h | 2 +- ports/nrf/common-hal/_bleio/Characteristic.c | 8 +- ports/nrf/common-hal/_bleio/Characteristic.h | 2 +- ports/nrf/common-hal/_bleio/Connection.c | 2 +- ports/nrf/common-hal/_bleio/Descriptor.c | 5 +- ports/nrf/common-hal/_bleio/Descriptor.h | 2 +- ports/nrf/common-hal/_bleio/Service.c | 7 +- 24 files changed, 350 insertions(+), 587 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index c8147fbc1b..4ed85f7540 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -60,6 +60,8 @@ #define UNIT_1_25_MS (1250) #define UNIT_10_MS (10000) +#define MAX_ADVERTISEMENT_SIZE (31) + // TODO make this settable from Python. #define DEFAULT_TX_POWER 0 // 0 dBm #define MAX_ANONYMOUS_ADV_TIMEOUT_SECS (60*15) @@ -179,13 +181,31 @@ STATIC void bleio_adapter_reset_name(bleio_adapter_obj_t *self) { } // Get various values and limits set by the adapter. -STATIC void bleio_adapter_get_info(bleio_adapter_obj_t *self) { +// Set event mask. +STATIC void bleio_adapter_setup(bleio_adapter_obj_t *self) { + // Get version information. + if (hci_read_local_version(&self->hci_version, &self->hci_revision, &self->lmp_version, + &self->manufacturer, &self->lmp_subversion) != HCI_OK) { + mp_raise_bleio_BluetoothError(translate("Could not read HCI version")); + } // Get supported features. if (hci_le_read_local_supported_features(self->features) != HCI_OK) { mp_raise_bleio_BluetoothError(translate("Could not read BLE features")); } + // Enabled desired events. + // Most importantly, includes: + // BT_EVT_MASK_LE_META_EVENT BT_EVT_BIT(61) + if (hci_set_event_mask(0x3FFFFFFFFFFFFFFF) != HCI_OK) { + mp_raise_bleio_BluetoothError(translate("Could not set event mask")); + } + // The default events for LE are: + // BT_EVT_MASK_LE_CONN_COMPLETE, BT_EVT_MASK_LE_ADVERTISING_REPORT, + // BT_EVT_MASK_LE_CONN_UPDATE_COMPLETE, BT_EVT_MASK_LE_REMOTE_FEAT_COMPLETE + // BT_EVT_MASK_LE_LTK_REQUEST. + // That's all we need right now, so we don't bother to set the LE event mask. + // Get ACL buffer info. uint16_t le_max_len; uint8_t le_max_num; @@ -213,7 +233,7 @@ STATIC void bleio_adapter_get_info(bleio_adapter_obj_t *self) { } self->max_adv_data_len = max_adv_data_len; } else { - self->max_adv_data_len = 31; + self->max_adv_data_len = MAX_ADVERTISEMENT_SIZE; } } @@ -226,7 +246,7 @@ void common_hal_bleio_adapter_hci_uart_init(bleio_adapter_obj_t *self, busio_uar self->enabled = false; common_hal_bleio_adapter_set_enabled(self, true); - bleio_adapter_get_info(self); + bleio_adapter_setup(self); bleio_adapter_reset_name(self); } @@ -477,14 +497,10 @@ mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_addre return mp_const_none; } -// The nRF SD 6.1.0 can only do one concurrent advertisement so share the advertising handle. -//FIX uint8_t adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET; - STATIC void check_data_fit(size_t data_len, bool connectable) { - //FIX if (data_len > BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED || - // (connectable && data_len > BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_CONNECTABLE_MAX_SUPPORTED)) { - // mp_raise_ValueError(translate("Data too large for advertisement packet")); - // } + if (data_len > MAX_ADVERTISEMENT_SIZE) { + mp_raise_ValueError(translate("Data too large for advertisement packet")); + } } // STATIC bool advertising_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { @@ -604,8 +620,9 @@ uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, 0x00 // filter policy: no filter )); - // The HCI commands expect 31 octets, even though the actual data length may be shorter. - uint8_t full_data[31] = { 0 }; + // The HCI commands expect MAX_ADVERTISEMENT_SIZE (31)octets, + // even though the actual data length may be shorter. + uint8_t full_data[MAX_ADVERTISEMENT_SIZE] = { 0 }; memcpy(full_data, advertising_data, MIN(sizeof(full_data), advertising_data_len)); check_hci_error(hci_le_set_advertising_data(advertising_data_len, full_data)); memset(full_data, 0, sizeof(full_data)); @@ -636,7 +653,7 @@ void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool check_data_fit(advertising_data_bufinfo->len, connectable); check_data_fit(scan_response_data_bufinfo->len, connectable); - if (advertising_data_bufinfo->len > 31 && scan_response_data_bufinfo->len > 0) { + if (advertising_data_bufinfo->len > MAX_ADVERTISEMENT_SIZE && scan_response_data_bufinfo->len > 0) { mp_raise_bleio_BluetoothError(translate("Extended advertisements with scan response not supported.")); } diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.h b/devices/ble_hci/common-hal/_bleio/Adapter.h index 1fae5f6829..a6a78f67e7 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.h +++ b/devices/ble_hci/common-hal/_bleio/Adapter.h @@ -56,6 +56,13 @@ typedef struct _bleio_adapter_obj_t { bool circuitpython_advertising; bool enabled; + // HCI adapter version info. + uint8_t hci_version; + uint8_t lmp_version; + uint16_t hci_revision; + uint16_t manufacturer; + uint16_t lmp_subversion; + // Used to monitor advertising timeout for legacy avertising. uint64_t advertising_start_ticks; uint64_t advertising_timeout_msecs; // If zero, do not check. diff --git a/devices/ble_hci/common-hal/_bleio/Characteristic.c b/devices/ble_hci/common-hal/_bleio/Characteristic.c index 4e69c3522c..5f9b96b354 100644 --- a/devices/ble_hci/common-hal/_bleio/Characteristic.c +++ b/devices/ble_hci/common-hal/_bleio/Characteristic.c @@ -29,7 +29,9 @@ #include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/Characteristic.h" +#include "shared-bindings/_bleio/CharacteristicBuffer.h" #include "shared-bindings/_bleio/Descriptor.h" +#include "shared-bindings/_bleio/PacketBuffer.h" #include "shared-bindings/_bleio/Service.h" #include "common-hal/_bleio/Adapter.h" @@ -47,8 +49,12 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, self->props = props; self->read_perm = read_perm; self->write_perm = write_perm; - self->descriptor_linked_list = mp_obj_new_list(0, NULL); - self->watchers_list = mp_obj_new_list(0, NULL); + self->descriptor_list = mp_obj_new_list(0, NULL); + self->observer = mp_const_none; + self->user_desc = NULL; + self->cccd = NULL; + self->sccd = NULL; + self->value = mp_obj_new_bytes(initial_value_bufinfo->buf, initial_value_bufinfo->len); const mp_int_t max_length_max = 512; if (max_length < 0 || max_length > max_length_max) { @@ -62,14 +68,10 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, } else { common_hal_bleio_service_add_characteristic(self->service, self, initial_value_bufinfo); } - - if (initial_value_bufinfo != NULL) { - common_hal_bleio_characteristic_set_value(self, initial_value_bufinfo); - } } -bleio_descriptor_obj_t *common_hal_bleio_characteristic_get_descriptor_linked_list(bleio_characteristic_obj_t *self) { - return self->descriptor_linked_list; +mp_obj_tuple_t *common_hal_bleio_characteristic_get_descriptors(bleio_characteristic_obj_t *self) { + return mp_obj_new_tuple(self->descriptor_list->len, self->descriptor_list->items); } bleio_service_obj_t *common_hal_bleio_characteristic_get_service(bleio_characteristic_obj_t *self) { @@ -79,13 +81,19 @@ bleio_service_obj_t *common_hal_bleio_characteristic_get_service(bleio_character size_t common_hal_bleio_characteristic_get_value(bleio_characteristic_obj_t *self, uint8_t* buf, size_t len) { // Do GATT operations only if this characteristic has been added to a registered service. if (self->handle != BLE_GATT_HANDLE_INVALID) { - uint16_t conn_handle = bleio_connection_get_conn_handle(self->service->connection); + //FIX uint16_t conn_handle = bleio_connection_get_conn_handle(self->service->connection); if (common_hal_bleio_service_get_is_remote(self->service)) { - // self->value is set by evt handler. - return common_hal_bleio_gattc_read(self->handle, conn_handle, buf, len); + //FIX read remote chars + //uint8_t rsp[MAX(len, 512)]; + //FIX improve att_read_req to write into our requested buffer. + // return att_read_req(conn_handle, self->handle, rsp); + return 0; //FIX } else { - // conn_handle is ignored for non-system attributes. - return common_hal_bleio_gatts_read(self->handle, conn_handle, buf, len); + mp_buffer_info_t bufinfo; + if (!mp_get_buffer(self->value, &bufinfo, MP_BUFFER_READ)) { + return 0; + } + memcpy(buf, bufinfo.buf, MIN(len, bufinfo.len)); } } @@ -102,32 +110,40 @@ void common_hal_bleio_characteristic_set_value(bleio_characteristic_obj_t *self, // Do GATT operations only if this characteristic has been added to a registered service. if (self->handle != BLE_GATT_HANDLE_INVALID) { - if (common_hal_bleio_service_get_is_remote(self->service)) { - uint16_t conn_handle = bleio_connection_get_conn_handle(self->service->connection); - // Last argument is true if write-no-reponse desired. - common_hal_bleio_gattc_write(self->handle, conn_handle, bufinfo, - (self->props & CHAR_PROP_WRITE_NO_RESPONSE)); + //FIX uint16_t conn_handle = bleio_connection_get_conn_handle(self->service->connection); + if (self->props & CHAR_PROP_WRITE) { + //FIX writing remote chars + //uint8_t rsp[sizeof(bt_att_error_rsp)]; + //att_write_req(conn_handle, self->handle, bufinfo->buf, bufinfo->len, rsp); + } else if (self->props & CHAR_PROP_WRITE_NO_RESPONSE) { + //att_write_cmd(conn_handle, self->handle, bufinfo->buff, bufinfo->len); + } else { + mp_raise_bleio_BluetoothError(translate("Characteristic not writable")); + } } else { // Always write the value locally even if no connections are active. - // conn_handle is ignored for non-system attributes, so we use BLE_CONN_HANDLE_INVALID. - common_hal_bleio_gatts_write(self->handle, BLE_CONN_HANDLE_INVALID, bufinfo); + bleio_characteristic_set_local_value(self, bufinfo); // Notify or indicate all active connections. - uint16_t cccd = 0; + + uint16_t cccd_value = 0; + mp_buffer_info_t cccd_bufinfo = { + .buf = &cccd_value, + .len = sizeof(cccd_value), + }; const bool notify = self->props & CHAR_PROP_NOTIFY; const bool indicate = self->props & CHAR_PROP_INDICATE; // Read the CCCD value, if there is one. - if ((notify | indicate) && self->cccd_handle != BLE_GATT_HANDLE_INVALID) { - common_hal_bleio_gatts_read(self->cccd_handle, BLE_CONN_HANDLE_INVALID, - (uint8_t *) &cccd, sizeof(cccd)); + if ((notify | indicate) && self->cccd != NULL) { + common_hal_bleio_descriptor_get_value(self->cccd, cccd_bufinfo.buf, cccd_bufinfo.len); } // It's possible that both notify and indicate are set. - if (notify && (cccd & CCCD_NOTIFY)) { + if (notify && (cccd_value & CCCD_NOTIFY)) { att_notify(self->handle, bufinfo->buf, MIN(bufinfo->len, self->max_length)); } - if (indicate && (cccd & CCCD_INDICATE)) { + if (indicate && (cccd_value & CCCD_INDICATE)) { att_indicate(self->handle, bufinfo->buf, MIN(bufinfo->len, self->max_length)); } @@ -153,13 +169,12 @@ void common_hal_bleio_characteristic_add_descriptor(bleio_characteristic_obj_t * // Include this descriptor in the service handle's range. self->service->end_handle = descriptor->handle; - // Link together all the descriptors for this characteristic. - descriptor->next = self->descriptor_linked_list; - self->descriptor_linked_list = descriptor; + mp_obj_list_append(MP_OBJ_FROM_PTR(self->descriptor_list), + MP_OBJ_FROM_PTR(descriptor)); } void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, bool notify, bool indicate) { - if (self->cccd_handle == BLE_GATT_HANDLE_INVALID) { + if (self->cccd == NULL) { mp_raise_bleio_BluetoothError(translate("No CCCD for this Characteristic")); } @@ -174,33 +189,12 @@ void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, (notify ? CCCD_NOTIFY : 0) | (indicate ? CCCD_INDICATE : 0); + //FIX do remote (void) cccd_value; - //FIX call att_something to set remote CCCD - // ble_gattc_write_params_t write_params = { - // .write_op = BLE_GATT_OP_WRITE_REQ, - // .handle = self->cccd_handle, - // .p_value = (uint8_t *) &cccd_value, - // .len = 2, - // }; - - // while (1) { - // uint32_t err_code = sd_ble_gattc_write(conn_handle, &write_params); - // if (err_code == NRF_SUCCESS) { - // break; - // } - - // // Write with response will return NRF_ERROR_BUSY if the response has not been received. - // // Write without reponse will return NRF_ERROR_RESOURCES if too many writes are pending. - // if (err_code == NRF_ERROR_BUSY || err_code == NRF_ERROR_RESOURCES) { - // // We could wait for an event indicating the write is complete, but just retrying is easier. - // RUN_BACKGROUND_TASKS; - // continue; - // } - - // // Some real error occurred. - // check_nrf_error(err_code); + // uint8_t rsp[sizeof(bt_att_error_rsp)]; + // if (att_write_req(conn_handle, self->cccd->handle, &cccd_value, sizeof(cccd_value)) == 0) { + // mp_raise_bleio_BluetoothError(translate("Could not write CCCD")); // } - } bool bleio_characteristic_set_local_value(bleio_characteristic_obj_t *self, mp_buffer_info_t *bufinfo) { @@ -208,14 +202,25 @@ bool bleio_characteristic_set_local_value(bleio_characteristic_obj_t *self, mp_b return false; } if (bufinfo->len > self->max_length) { - bool - } - - mp_buffer_info_t char_bufinfo; - if (!mp_get_buffer(characteristic->value, &bufinfo, MP_BUFFER_WRITE)) { return false; } - memcpy(&char_bufinfo->buf, bufinfo->buf, bufinfo->len); - for (size_t i; i < characteristic->set_callbacks. + self->value = mp_obj_new_bytes(bufinfo->buf, bufinfo->len); + + if (MP_OBJ_IS_TYPE(self->observer, &bleio_characteristic_buffer_type)) { + bleio_characteristic_buffer_update(MP_OBJ_FROM_PTR(self->observer), bufinfo); + } else if (MP_OBJ_IS_TYPE(self->observer, &bleio_packet_buffer_type)) { + bleio_packet_buffer_update(MP_OBJ_FROM_PTR(self->observer), bufinfo); + } else { + return false; + } + return true; +} + +void bleio_characteristic_set_observer(bleio_characteristic_obj_t *self, mp_obj_t observer) { + self->observer = observer; +} + +void bleio_characteristic_clear_observer(bleio_characteristic_obj_t *self) { + self->observer = mp_const_none; } diff --git a/devices/ble_hci/common-hal/_bleio/Characteristic.h b/devices/ble_hci/common-hal/_bleio/Characteristic.h index cc5ba4108b..6d5a12509c 100644 --- a/devices/ble_hci/common-hal/_bleio/Characteristic.h +++ b/devices/ble_hci/common-hal/_bleio/Characteristic.h @@ -40,8 +40,8 @@ typedef struct _bleio_characteristic_obj { bleio_service_obj_t *service; bleio_uuid_obj_t *uuid; mp_obj_t value; - mp_obj_list_t watcher_list; - mp_obj_list_t descriptor_linked_list; + mp_obj_t observer; + mp_obj_list_t *descriptor_list; uint16_t max_length; bool fixed_length; uint16_t decl_handle; @@ -50,9 +50,14 @@ typedef struct _bleio_characteristic_obj { bleio_attribute_security_mode_t read_perm; bleio_attribute_security_mode_t write_perm; bleio_descriptor_obj_t *descriptor_linked_list; - uint16_t user_desc_handle; - uint16_t cccd_handle; - uint16_t sccd_handle; + bleio_descriptor_obj_t *user_desc; + bleio_descriptor_obj_t *cccd; + bleio_descriptor_obj_t *sccd; } bleio_characteristic_obj_t; +bool bleio_characteristic_set_local_value(bleio_characteristic_obj_t *self, mp_buffer_info_t *bufinfo); + +void bleio_characteristic_set_observer(bleio_characteristic_obj_t *self, mp_obj_t observer); +void bleio_characteristic_clear_observer(bleio_characteristic_obj_t *self); + #endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_CHARACTERISTIC_H diff --git a/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c b/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c index c4eb6a19fe..e8cd518808 100644 --- a/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c +++ b/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c @@ -37,44 +37,13 @@ #include "common-hal/_bleio/CharacteristicBuffer.h" // Push all the data onto the ring buffer. When the buffer is full, new bytes will be dropped. -// STATIC void write_to_ringbuf(bleio_characteristic_buffer_obj_t *self, uint8_t *data, uint16_t len) { -// uint8_t is_nested_critical_region; -// sd_nvic_critical_region_enter(&is_nested_critical_region); -// ringbuf_put_n(&self->ringbuf, data, len); -// sd_nvic_critical_region_exit(is_nested_critical_region); -// } +STATIC void write_to_ringbuf(bleio_characteristic_buffer_obj_t *self, uint8_t *data, uint16_t len) { + ringbuf_put_n(&self->ringbuf, data, len); +} -// STATIC bool characteristic_buffer_on_ble_evt(ble_evt_t *ble_evt, void *param) { -// bleio_characteristic_buffer_obj_t *self = (bleio_characteristic_buffer_obj_t *) param; -// switch (ble_evt->header.evt_id) { -// case BLE_GATTS_EVT_WRITE: { -// // A client wrote to this server characteristic. - -// ble_gatts_evt_write_t *evt_write = &ble_evt->evt.gatts_evt.params.write; -// // Event handle must match the handle for my characteristic. -// if (evt_write->handle == self->characteristic->handle) { -// write_to_ringbuf(self, evt_write->data, evt_write->len); -// } -// break; -// } - -// case BLE_GATTC_EVT_HVX: { -// // A remote service wrote to this characteristic. - -// ble_gattc_evt_hvx_t* evt_hvx = &ble_evt->evt.gattc_evt.params.hvx; -// // Must be a notification, and event handle must match the handle for my characteristic. -// if (evt_hvx->type == BLE_GATT_HVX_NOTIFICATION && -// evt_hvx->handle == self->characteristic->handle) { -// write_to_ringbuf(self, evt_hvx->data, evt_hvx->len); -// } -// break; -// } -// default: -// return false; -// break; -// } -// return true; -// } +void bleio_characteristic_buffer_update(bleio_characteristic_buffer_obj_t *self, mp_buffer_info_t *bufinfo) { + write_to_ringbuf(self, bufinfo->buf, bufinfo->len); +} // Assumes that timeout and buffer_size have been validated before call. void common_hal_bleio_characteristic_buffer_construct(bleio_characteristic_buffer_obj_t *self, @@ -88,8 +57,7 @@ void common_hal_bleio_characteristic_buffer_construct(bleio_characteristic_buffe // true means long-lived, so it won't be moved. ringbuf_alloc(&self->ringbuf, buffer_size, true); - // FIX ble_drv_add_event_handler(characteristic_buffer_on_ble_evt, self); - + bleio_characteristic_set_observer(characteristic, self); } uint32_t common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer_obj_t *self, uint8_t *data, size_t len, int *errcode) { @@ -104,32 +72,17 @@ uint32_t common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer } } - // Copy received data. Lock out write interrupt handler while copying. - // FIX uint8_t is_nested_critical_region; - // FIX sd_nvic_critical_region_enter(&is_nested_critical_region); - uint32_t num_bytes_read = ringbuf_get_n(&self->ringbuf, data, len); - - // Writes now OK. - // FIX sd_nvic_critical_region_exit(is_nested_critical_region); - return num_bytes_read; } uint32_t common_hal_bleio_characteristic_buffer_rx_characters_available(bleio_characteristic_buffer_obj_t *self) { - //FIX uint8_t is_nested_critical_region; - //FIX sd_nvic_critical_region_enter(&is_nested_critical_region); uint16_t count = ringbuf_num_filled(&self->ringbuf); - //FIX sd_nvic_critical_region_exit(is_nested_critical_region); return count; } void common_hal_bleio_characteristic_buffer_clear_rx_buffer(bleio_characteristic_buffer_obj_t *self) { - // prevent conflict with uart irq - //FIX uint8_t is_nested_critical_region; - //FIX sd_nvic_critical_region_enter(&is_nested_critical_region); ringbuf_clear(&self->ringbuf); - //FIX sd_nvic_critical_region_exit(is_nested_critical_region); } bool common_hal_bleio_characteristic_buffer_deinited(bleio_characteristic_buffer_obj_t *self) { @@ -138,7 +91,7 @@ bool common_hal_bleio_characteristic_buffer_deinited(bleio_characteristic_buffer void common_hal_bleio_characteristic_buffer_deinit(bleio_characteristic_buffer_obj_t *self) { if (!common_hal_bleio_characteristic_buffer_deinited(self)) { - //FIX ble_drv_remove_event_handler(characteristic_buffer_on_ble_evt, self); + bleio_characteristic_clear_observer(self->characteristic); } } diff --git a/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.h b/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.h index 8738d2c59c..107e5801f8 100644 --- a/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.h +++ b/devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.h @@ -38,4 +38,6 @@ typedef struct { ringbuf_t ringbuf; } bleio_characteristic_buffer_obj_t; +void bleio_characteristic_buffer_update(bleio_characteristic_buffer_obj_t *self, mp_buffer_info_t *bufinfo); + #endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_CHARACTERISTICBUFFER_H diff --git a/devices/ble_hci/common-hal/_bleio/Connection.c b/devices/ble_hci/common-hal/_bleio/Connection.c index 98fa4d1f72..ba4eb477d9 100644 --- a/devices/ble_hci/common-hal/_bleio/Connection.c +++ b/devices/ble_hci/common-hal/_bleio/Connection.c @@ -27,6 +27,8 @@ #include "shared-bindings/_bleio/Connection.h" +#include "att.h" + #include #include @@ -319,10 +321,11 @@ static volatile bool m_discovery_successful; // } void bleio_connection_clear(bleio_connection_internal_t *self) { - self->remote_service_linked_list = NULL; + mp_obj_list_clear(MP_OBJ_FROM_PTR(self->remote_service_list)); - //FIX self->conn_handle = BLE_CONN_HANDLE_INVALID; + self->conn_handle = BLE_CONN_HANDLE_INVALID; self->pair_status = PAIR_NOT_PAIRED; + self->is_central = false; //FIX bonding_clear_keys(&self->bonding_keys); } @@ -337,12 +340,11 @@ bool common_hal_bleio_connection_get_connected(bleio_connection_obj_t *self) { if (self->connection == NULL) { return false; } - return false; - //FIX return self->connection->conn_handle != BLE_CONN_HANDLE_INVALID; + return self->connection->conn_handle != BLE_CONN_HANDLE_INVALID; } void common_hal_bleio_connection_disconnect(bleio_connection_internal_t *self) { - //FIX sd_ble_gap_disconnect(self->conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION); + hci_disconnect(self->conn_handle); } void common_hal_bleio_connection_pair(bleio_connection_internal_t *self, bool bond) { @@ -369,8 +371,7 @@ mp_float_t common_hal_bleio_connection_get_connection_interval(bleio_connection_ // Return the current negotiated MTU length, minus overhead. mp_int_t common_hal_bleio_connection_get_max_packet_length(bleio_connection_internal_t *self) { - /// FIX return (self->mtu == 0 ? BLE_GATT_ATT_MTU_DEFAULT : self->mtu) - 3; - return 0; + return (self->mtu == 0 ? BT_ATT_DEFAULT_LE_MTU : self->mtu) - 3; } void common_hal_bleio_connection_set_connection_interval(bleio_connection_internal_t *self, mp_float_t new_interval) { @@ -449,8 +450,6 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern // } // STATIC void on_primary_srv_discovery_rsp(ble_gattc_evt_prim_srvc_disc_rsp_t *response, bleio_connection_internal_t* connection) { -// bleio_service_obj_t* tail = connection->remote_service_linked_list; - // for (size_t i = 0; i < response->count; ++i) { // ble_gattc_service_t *gattc_service = &response->services[i]; @@ -477,13 +476,11 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern // // For now, just set the UUID to NULL. // service->uuid = NULL; // } - -// service->next = tail; -// tail = service; +// +// mp_obj_list_append(MP_OBJ_FROM_PTR(connection->remote_service_list), +// MP_OBJ_FROM_PTR(service)); // } - -// connection->remote_service_linked_list = tail; - +// // if (response->count > 0) { // m_discovery_successful = true; // } @@ -525,7 +522,8 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern // GATT_MAX_DATA_LENGTH, false, // max_length, fixed_length: values may not matter for gattc // NULL); -// mp_obj_list_append(m_char_discovery_service->characteristic_list, MP_OBJ_FROM_PTR(characteristic)); +// mp_obj_list_append(MP_OBJ_FROM_PTR(m_char_discovery_service->characteristic_list), +// MP_OBJ_FROM_PTR(characteristic)); // } // if (response->count > 0) { @@ -581,7 +579,8 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern // GATT_MAX_DATA_LENGTH, false, mp_const_empty_bytes); // descriptor->handle = gattc_desc->handle; -// mp_obj_list_append(m_desc_discovery_characteristic->descriptor_linked_list, MP_OBJ_FROM_PTR(descriptor)); +// mp_obj_list_append(MP_OBJ_FROM_PTR(m_desc_discovery_characteristic->descriptor_list), +// MP_OBJ_FROM_PTR(descriptor)); // } // if (response->count > 0) { @@ -622,7 +621,8 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern // ble_drv_add_event_handler(discovery_on_ble_evt, self); // // Start over with an empty list. -// self->remote_service_linked_list = NULL; +// self->remote_service_list = mp_obj_new_list(0, NULL); + // if (service_uuids_whitelist == mp_const_none) { // // List of service UUID's not given, so discover all available services. @@ -634,7 +634,9 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern // // Get the most recently discovered service, and then ask for services // // whose handles start after the last attribute handle inside that service. -// const bleio_service_obj_t *service = self->remote_service_linked_list; +// // There must be at least one if discover_next_services() returned true. +// const bleio_service_obj_t *service = +// self->remote_service_list->items[self->remote_service_list->len - 1]; // next_service_start_handle = service->end_handle + 1; // } // } else { @@ -658,11 +660,10 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern // } -// bleio_service_obj_t *service = self->remote_service_linked_list; -// while (service != NULL) { +// for (size_t i = 0; i < self->remote_service_list->len; i++) { +// bleio_service_obj_t *service = MP_OBJ_TO_PTR(self->remote_service_list->items[i]); // // Skip the service if it had an unknown (unregistered) UUID. // if (service->uuid == NULL) { -// service = service->next; // continue; // } @@ -714,11 +715,12 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern // next_desc_start_handle, next_desc_end_handle)) { // // Get the most recently discovered descriptor, and then ask for descriptors // // whose handles start after that descriptor's handle. -// const bleio_descriptor_obj_t *descriptor = characteristic->descriptor_linked_list; +// // There must be at least one if discover_next_descriptors() returned true. +// const bleio_descriptor_obj_t *descriptor = +// characteristic->descriptor_list->items[characteristic->descriptor_list->len - 1]; // next_desc_start_handle = descriptor->handle + 1; // } // } -// service = service->next; // } // // This event handler is no longer needed. @@ -730,10 +732,11 @@ mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(bleio_conne //FIX discover_remote_services(self->connection, service_uuids_whitelist); bleio_connection_ensure_connected(self); // Convert to a tuple and then clear the list so the callee will take ownership. - mp_obj_tuple_t *services_tuple = service_linked_list_to_tuple(self->connection->remote_service_linked_list); - self->connection->remote_service_linked_list = NULL; - - return services_tuple; + mp_obj_tuple_t *services_tuple = + mp_obj_new_tuple(self->connection->remote_service_list->len, + self->connection->remote_service_list->items); + mp_obj_list_clear(MP_OBJ_FROM_PTR(self->connection->remote_service_list)); + return services_tuple; } uint16_t bleio_connection_get_conn_handle(bleio_connection_obj_t *self) { @@ -757,13 +760,13 @@ mp_obj_t bleio_connection_new_from_internal(bleio_connection_internal_t* interna // Find the connection that uses the given conn_handle. Return NULL if not found. bleio_connection_internal_t *bleio_conn_handle_to_connection(uint16_t conn_handle) { - //FIX bleio_connection_internal_t *connection; - // for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { - // connection = &bleio_connections[i]; - // if (connection->conn_handle == conn_handle) { - // return connection; - // } - // } + bleio_connection_internal_t *connection; + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + connection = &bleio_connections[i]; + if (connection->conn_handle == conn_handle) { + return connection; + } + } return NULL; } diff --git a/devices/ble_hci/common-hal/_bleio/Connection.h b/devices/ble_hci/common-hal/_bleio/Connection.h index efd496ecc5..0b1f26a213 100644 --- a/devices/ble_hci/common-hal/_bleio/Connection.h +++ b/devices/ble_hci/common-hal/_bleio/Connection.h @@ -50,7 +50,7 @@ typedef struct { uint16_t conn_handle; bool is_central; // Remote services discovered when this peripheral is acting as a client. - bleio_service_obj_t *remote_service_linked_list; + mp_obj_list_t *remote_service_list; // The advertising data and scan response buffers are held by us, not by the SD, so we must // maintain them and not change it. If we need to change the contents during advertising, // there are tricks to get the SD to notice (see DevZone - TBS). @@ -60,7 +60,6 @@ typedef struct { volatile pair_status_t pair_status; uint8_t sec_status; // Internal security status. mp_obj_t connection_obj; - //REMOVE ble_drv_evt_handler_entry_t handler_entry; //REMOVE ble_gap_conn_params_t conn_params; volatile bool conn_params_updating; uint16_t mtu; diff --git a/devices/ble_hci/common-hal/_bleio/Descriptor.c b/devices/ble_hci/common-hal/_bleio/Descriptor.c index faf50c658c..cc45a89857 100644 --- a/devices/ble_hci/common-hal/_bleio/Descriptor.c +++ b/devices/ble_hci/common-hal/_bleio/Descriptor.c @@ -39,6 +39,7 @@ void common_hal_bleio_descriptor_construct(bleio_descriptor_obj_t *self, bleio_c self->handle = BLE_GATT_HANDLE_INVALID; self->read_perm = read_perm; self->write_perm = write_perm; + self->value = mp_obj_new_bytes(initial_value_bufinfo->buf, initial_value_bufinfo->len); const mp_int_t max_length_max = fixed_length ? BLE_GATTS_FIX_ATTR_LEN_MAX : BLE_GATTS_VAR_ATTR_LEN_MAX; if (max_length < 0 || max_length > max_length_max) { @@ -62,11 +63,20 @@ bleio_characteristic_obj_t *common_hal_bleio_descriptor_get_characteristic(bleio size_t common_hal_bleio_descriptor_get_value(bleio_descriptor_obj_t *self, uint8_t* buf, size_t len) { // Do GATT operations only if this descriptor has been registered if (self->handle != BLE_GATT_HANDLE_INVALID) { - uint16_t conn_handle = bleio_connection_get_conn_handle(self->characteristic->service->connection); if (common_hal_bleio_service_get_is_remote(self->characteristic->service)) { - return common_hal_bleio_gattc_read(self->handle, conn_handle, buf, len); + //uint16_t conn_handle = bleio_connection_get_conn_handle(self->characteristic->service->connection); + //FIX have att_read_req fill in a buffer + //uint8_t rsp[MAX(len, 512)]; + //return att_read_req(conn_handle, self->handle, rsp, len); + return 0; } else { - return common_hal_bleio_gatts_read(self->handle, conn_handle, buf, len); + mp_buffer_info_t bufinfo; + if (!mp_get_buffer(self->value, &bufinfo, MP_BUFFER_READ)) { + return 0; + } + size_t actual_length = MIN(len, bufinfo.len); + memcpy(buf, bufinfo.buf, actual_length); + return actual_length; } } @@ -85,13 +95,20 @@ void common_hal_bleio_descriptor_set_value(bleio_descriptor_obj_t *self, mp_buff // Do GATT operations only if this descriptor has been registered. if (self->handle != BLE_GATT_HANDLE_INVALID) { - uint16_t conn_handle = bleio_connection_get_conn_handle(self->characteristic->service->connection); if (common_hal_bleio_service_get_is_remote(self->characteristic->service)) { - // false means WRITE_REQ, not write-no-response - common_hal_bleio_gattc_write(self->handle, conn_handle, bufinfo, false); + //FIX + // uint16_t conn_handle = bleio_connection_get_conn_handle(self->service->connection); + // att_write_req(conn_handle, self->handle, bufinfo->buf, bufinfo->len, rsp); } else { - common_hal_bleio_gatts_write(self->handle, conn_handle, bufinfo); + // Always write the value locally even if no connections are active. + if (self->fixed_length && bufinfo->len != self->max_length) { + return; + } + if (bufinfo->len > self->max_length) { + return; + } + + self->value = mp_obj_new_bytes(bufinfo->buf, bufinfo->len); } } - } diff --git a/devices/ble_hci/common-hal/_bleio/PacketBuffer.c b/devices/ble_hci/common-hal/_bleio/PacketBuffer.c index 65d4139605..98912ba902 100644 --- a/devices/ble_hci/common-hal/_bleio/PacketBuffer.c +++ b/devices/ble_hci/common-hal/_bleio/PacketBuffer.c @@ -36,152 +36,48 @@ #include "shared-bindings/_bleio/PacketBuffer.h" #include "supervisor/shared/tick.h" -// STATIC void write_to_ringbuf(bleio_packet_buffer_obj_t *self, uint8_t *data, uint16_t len) { -// if (len + sizeof(uint16_t) > ringbuf_capacity(&self->ringbuf)) { -// // This shouldn't happen. -// return; -// } -// // Push all the data onto the ring buffer. -// //FIX uint8_t is_nested_critical_region; -// //FIX sd_nvic_critical_region_enter(&is_nested_critical_region); -// // Make room for the new value by dropping the oldest packets first. -// while (ringbuf_capacity(&self->ringbuf) - ringbuf_num_filled(&self->ringbuf) < len + sizeof(uint16_t)) { -// uint16_t packet_length; -// ringbuf_get_n(&self->ringbuf, (uint8_t*) &packet_length, sizeof(uint16_t)); -// for (uint16_t i = 0; i < packet_length; i++) { -// ringbuf_get(&self->ringbuf); -// } -// // set an overflow flag? -// } -// ringbuf_put_n(&self->ringbuf, (uint8_t*) &len, sizeof(uint16_t)); -// ringbuf_put_n(&self->ringbuf, data, len); -// //FIX sd_nvic_critical_region_exit(is_nested_critical_region); -// } +STATIC void write_to_ringbuf(bleio_packet_buffer_obj_t *self, uint8_t *data, uint16_t len) { + if (len + sizeof(uint16_t) > ringbuf_capacity(&self->ringbuf)) { + // This shouldn't happen. + return; + } + // Push all the data onto the ring buffer. + // Make room for the new value by dropping the oldest packets first. + while (ringbuf_capacity(&self->ringbuf) - ringbuf_num_filled(&self->ringbuf) < len + sizeof(uint16_t)) { + uint16_t packet_length; + ringbuf_get_n(&self->ringbuf, (uint8_t*) &packet_length, sizeof(uint16_t)); + for (uint16_t i = 0; i < packet_length; i++) { + ringbuf_get(&self->ringbuf); + } + // set an overflow flag? + } + ringbuf_put_n(&self->ringbuf, (uint8_t*) &len, sizeof(uint16_t)); + ringbuf_put_n(&self->ringbuf, data, len); +} -//FIX -// STATIC uint32_t queue_next_write(bleio_packet_buffer_obj_t *self) { -// // Queue up the next outgoing buffer. We use two, one that has been passed to the SD for -// // transmission (when packet_queued is true) and the other is `pending` and can still be -// // modified. By primarily appending to the `pending` buffer we can reduce the protocol overhead -// // of the lower level link and ATT layers. -// self->packet_queued = false; -// if (self->pending_size > 0) { -// uint16_t conn_handle = self->conn_handle; -// uint32_t err_code; -// if (self->client) { -// ble_gattc_write_params_t write_params = { -// .write_op = self->write_type, -// .handle = self->characteristic->handle, -// .p_value = self->outgoing[self->pending_index], -// .len = self->pending_size, -// }; +STATIC uint32_t queue_next_write(bleio_packet_buffer_obj_t *self) { + // Queue up the next outgoing buffer. We use two, one that has been passed to the SD for + // transmission (when packet_queued is true) and the other is `pending` and can still be + // modified. By primarily appending to the `pending` buffer we can reduce the protocol overhead + // of the lower level link and ATT layers. + self->packet_queued = false; + if (self->pending_size > 0) { + mp_buffer_info_t bufinfo = { + .buf = self->outgoing[self->pending_index], + .len = self->pending_size, + }; + common_hal_bleio_characteristic_set_value(self->characteristic, &bufinfo); -// err_code = sd_ble_gattc_write(conn_handle, &write_params); -// } else { -// uint16_t hvx_len = self->pending_size; + self->pending_size = 0; + self->pending_index = (self->pending_index + 1) % 2; + self->packet_queued = true; + } + return 0; +} -// ble_gatts_hvx_params_t hvx_params = { -// .handle = self->characteristic->handle, -// .type = self->write_type, -// .offset = 0, -// .p_len = &hvx_len, -// .p_data = self->outgoing[self->pending_index], -// }; -// err_code = sd_ble_gatts_hvx(conn_handle, &hvx_params); -// } -// if (err_code != NRF_SUCCESS) { -// // On error, simply skip updating the pending buffers so that the next HVC or WRITE -// // complete event triggers another attempt. -// return err_code; -// } -// self->pending_size = 0; -// self->pending_index = (self->pending_index + 1) % 2; -// self->packet_queued = true; -// } -// return NRF_SUCCESS; -// } - -// STATIC bool packet_buffer_on_ble_client_evt(ble_evt_t *ble_evt, void *param) { -// const uint16_t evt_id = ble_evt->header.evt_id; -// // Check if this is a GATTC event so we can make sure the conn_handle is valid. -// if (evt_id < BLE_GATTC_EVT_BASE || evt_id > BLE_GATTC_EVT_LAST) { -// return false; -// } - -// uint16_t conn_handle = ble_evt->evt.gattc_evt.conn_handle; -// bleio_packet_buffer_obj_t *self = (bleio_packet_buffer_obj_t *) param; -// if (conn_handle != self->conn_handle) { -// return false; -// } -// switch (evt_id) { -// case BLE_GATTC_EVT_HVX: { -// // A remote service wrote to this characteristic. -// ble_gattc_evt_hvx_t* evt_hvx = &ble_evt->evt.gattc_evt.params.hvx; -// // Must be a notification, and event handle must match the handle for my characteristic. -// if (evt_hvx->handle == self->characteristic->handle) { -// write_to_ringbuf(self, evt_hvx->data, evt_hvx->len); -// if (evt_hvx->type == BLE_GATT_HVX_INDICATION) { -// sd_ble_gattc_hv_confirm(conn_handle, evt_hvx->handle); -// } -// } -// break; -// } -// case BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE: { -// queue_next_write(self); -// break; -// } -// case BLE_GATTC_EVT_WRITE_RSP: { -// queue_next_write(self); -// break; -// } -// default: -// return false; -// break; -// } -// return true; -// } - -// STATIC bool packet_buffer_on_ble_server_evt(ble_evt_t *ble_evt, void *param) { -// bleio_packet_buffer_obj_t *self = (bleio_packet_buffer_obj_t *) param; -// switch (ble_evt->header.evt_id) { -// case BLE_GATTS_EVT_WRITE: { -// uint16_t conn_handle = ble_evt->evt.gatts_evt.conn_handle; -// // A client wrote to this server characteristic. - -// ble_gatts_evt_write_t *evt_write = &ble_evt->evt.gatts_evt.params.write; - -// // Event handle must match the handle for my characteristic. -// if (evt_write->handle == self->characteristic->handle) { -// if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { -// self->conn_handle = conn_handle; -// } else if (self->conn_handle != conn_handle) { -// return false; -// } -// write_to_ringbuf(self, evt_write->data, evt_write->len); -// } else if (evt_write->handle == self->characteristic->cccd_handle) { -// uint16_t cccd = *((uint16_t*) evt_write->data); -// if (cccd & BLE_GATT_HVX_NOTIFICATION) { -// self->conn_handle = conn_handle; -// } else { -// self->conn_handle = BLE_CONN_HANDLE_INVALID; -// } -// } -// break; -// } -// case BLE_GAP_EVT_DISCONNECTED: { -// if (self->conn_handle == ble_evt->evt.gap_evt.conn_handle) { -// self->conn_handle = BLE_CONN_HANDLE_INVALID; -// } -// } -// case BLE_GATTS_EVT_HVN_TX_COMPLETE: { -// queue_next_write(self); -// } -// default: -// return false; -// break; -// } -// return true; -// } +void bleio_packet_buffer_update(bleio_packet_buffer_obj_t *self, mp_buffer_info_t *bufinfo) { + write_to_ringbuf(self, bufinfo->buf, bufinfo->len); +} void common_hal_bleio_packet_buffer_construct( bleio_packet_buffer_obj_t *self, bleio_characteristic_obj_t *characteristic, @@ -189,8 +85,10 @@ void common_hal_bleio_packet_buffer_construct( self->characteristic = characteristic; self->client = self->characteristic->service->is_remote; - bleio_characteristic_properties_t incoming = self->characteristic->props & (CHAR_PROP_WRITE_NO_RESPONSE | CHAR_PROP_WRITE); - bleio_characteristic_properties_t outgoing = self->characteristic->props & (CHAR_PROP_NOTIFY | CHAR_PROP_INDICATE); + bleio_characteristic_properties_t incoming = + self->characteristic->props & (CHAR_PROP_WRITE_NO_RESPONSE | CHAR_PROP_WRITE); + bleio_characteristic_properties_t outgoing = + self->characteristic->props & (CHAR_PROP_NOTIFY | CHAR_PROP_INDICATE); if (self->client) { // Swap if we're the client. @@ -219,32 +117,7 @@ void common_hal_bleio_packet_buffer_construct( self->outgoing[1] = NULL; } - //FIX if (self->client) { - // ble_drv_add_event_handler(packet_buffer_on_ble_client_evt, self); - // if (incoming) { - // // Prefer notify if both are available. - // if (incoming & CHAR_PROP_NOTIFY) { - // self->write_type = BLE_GATT_HVX_NOTIFICATION; - // common_hal_bleio_characteristic_set_cccd(self->characteristic, true, false); - // } else { - // common_hal_bleio_characteristic_set_cccd(self->characteristic, false, true); - // } - // } - // if (outgoing) { - // self->write_type = BLE_GATT_OP_WRITE_REQ; - // if (outgoing & CHAR_PROP_WRITE_NO_RESPONSE) { - // self->write_type = BLE_GATT_OP_WRITE_CMD; - // } - // } - // } else { - // ble_drv_add_event_handler(packet_buffer_on_ble_server_evt, self); - // if (outgoing) { - // self->write_type = BLE_GATT_HVX_INDICATION; - // if (outgoing & CHAR_PROP_NOTIFY) { - // self->write_type = BLE_GATT_HVX_NOTIFICATION; - // } - // } - // } + bleio_characteristic_set_observer(self->characteristic, self); } mp_int_t common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len) { @@ -252,10 +125,7 @@ mp_int_t common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self return 0; } - // Copy received data. Lock out write interrupt handler while copying. - //FIX uint8_t is_nested_critical_region; - //FIX sd_nvic_critical_region_enter(&is_nested_critical_region); - + // Copy received data. // Get packet length, which is in first two bytes of packet. uint16_t packet_length; ringbuf_get_n(&self->ringbuf, (uint8_t*) &packet_length, sizeof(uint16_t)); @@ -274,9 +144,6 @@ mp_int_t common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self ret = packet_length; } - // Writes now OK. - //FIX sd_nvic_critical_region_exit(is_nested_critical_region); - return ret; } @@ -307,9 +174,6 @@ mp_int_t common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, u size_t num_bytes_written = 0; - //FIX uint8_t is_nested_critical_region; - //FIX sd_nvic_critical_region_enter(&is_nested_critical_region); - uint8_t* pending = self->outgoing[self->pending_index]; if (self->pending_size == 0) { @@ -321,11 +185,9 @@ mp_int_t common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, u self->pending_size += len; num_bytes_written += len; - //FIX sd_nvic_critical_region_exit(is_nested_critical_region); - // If no writes are queued then sneak in this data. if (!self->packet_queued) { - //FIX queue_next_write(self); + queue_next_write(self); } return num_bytes_written; } @@ -398,6 +260,6 @@ bool common_hal_bleio_packet_buffer_deinited(bleio_packet_buffer_obj_t *self) { void common_hal_bleio_packet_buffer_deinit(bleio_packet_buffer_obj_t *self) { if (!common_hal_bleio_packet_buffer_deinited(self)) { - //FIX ble_drv_remove_event_handler(packet_buffer_on_ble_client_evt, self); + bleio_characteristic_clear_observer(self->characteristic); } } diff --git a/devices/ble_hci/common-hal/_bleio/PacketBuffer.h b/devices/ble_hci/common-hal/_bleio/PacketBuffer.h index e1577a9957..074c03dc69 100644 --- a/devices/ble_hci/common-hal/_bleio/PacketBuffer.h +++ b/devices/ble_hci/common-hal/_bleio/PacketBuffer.h @@ -48,4 +48,6 @@ typedef struct { bool packet_queued; } bleio_packet_buffer_obj_t; +void bleio_packet_buffer_update(bleio_packet_buffer_obj_t *self, mp_buffer_info_t *bufinfo); + #endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_PACKETBUFFER_H diff --git a/devices/ble_hci/common-hal/_bleio/Service.c b/devices/ble_hci/common-hal/_bleio/Service.c index 0b6c830022..5803f5309d 100644 --- a/devices/ble_hci/common-hal/_bleio/Service.c +++ b/devices/ble_hci/common-hal/_bleio/Service.c @@ -70,8 +70,8 @@ bleio_uuid_obj_t *common_hal_bleio_service_get_uuid(bleio_service_obj_t *self) { return self->uuid; } -mp_obj_list_t *common_hal_bleio_service_get_characteristic_list(bleio_service_obj_t *self) { - return self->characteristic_list; +mp_obj_tuple_t *common_hal_bleio_service_get_characteristics(bleio_service_obj_t *self) { + return mp_obj_new_tuple(self->characteristic_list->len, self->characteristic_list->items); } bool common_hal_bleio_service_get_is_remote(bleio_service_obj_t *self) { @@ -122,21 +122,8 @@ void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, // Adds CCCD to attribute table, and also extends self->end_handle to include the CCCD. common_hal_bleio_characteristic_add_descriptor(characteristic, cccd); - characteristic->cccd_handle = cccd->handle; + characteristic->cccd = cccd; } - // #if CIRCUITPY_VERBOSE_BLE - // // Turn on read authorization so that we receive an event to print on every read. - // char_attr_md.rd_auth = true; - // #endif - - // These are not supplied or available. - characteristic->user_desc_handle = BLE_GATT_HANDLE_INVALID; - characteristic->sccd_handle = BLE_GATT_HANDLE_INVALID; - - // #if CIRCUITPY_VERBOSE_BLE - // mp_printf(&mp_plat_print, "Char handle %x user %x cccd %x sccd %x\n", characteristic->handle, characteristic->user_desc_handle, characteristic->cccd_handle, characteristic->sccd_handle); - // #endif - mp_obj_list_append(self->characteristic_list, MP_OBJ_FROM_PTR(characteristic)); } diff --git a/devices/ble_hci/common-hal/_bleio/__init__.c b/devices/ble_hci/common-hal/_bleio/__init__.c index e2b463af8a..3c23c160ea 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.c +++ b/devices/ble_hci/common-hal/_bleio/__init__.c @@ -83,21 +83,6 @@ void check_hci_error(hci_result_t result) { } } -// void check_gatt_status(uint16_t gatt_status) { -// if (gatt_status == BLE_GATT_STATUS_SUCCESS) { -// return; -// } -// switch (gatt_status) { -// case BLE_GATT_STATUS_ATTERR_INSUF_AUTHENTICATION: -// mp_raise_bleio_SecurityError(translate("Insufficient authentication")); -// return; -// case BLE_GATT_STATUS_ATTERR_INSUF_ENCRYPTION: -// mp_raise_bleio_SecurityError(translate("Insufficient encryption")); -// return; -// default: -// mp_raise_bleio_BluetoothError(translate("Unknown gatt error: 0x%04x"), gatt_status); -// } -// } // void check_sec_status(uint8_t sec_status) { // if (sec_status == BLE_GAP_SEC_STATUS_SUCCESS) { @@ -148,134 +133,6 @@ void common_hal_bleio_check_connected(uint16_t conn_handle) { } } -// GATTS read of a Characteristic or Descriptor. -size_t common_hal_bleio_gatts_read(uint16_t handle, uint16_t conn_handle, uint8_t* buf, size_t len) { - // conn_handle is ignored unless this is a system attribute. - // If we're not connected, that's OK, because we can still read and write the local value. - - //FIX ble_gatts_value_t gatts_value = { - // .p_value = buf, - // .len = len, - // }; - - // check_nrf_error(sd_ble_gatts_value_get(conn_handle, handle, &gatts_value)); - - // return gatts_value.len; - return 0; -} - -void common_hal_bleio_gatts_write(uint16_t handle, uint16_t conn_handle, mp_buffer_info_t *bufinfo) { - // conn_handle is ignored unless this is a system attribute. - // If we're not connected, that's OK, because we can still read and write the local value. - - //FIX ble_gatts_value_t gatts_value = { - // .p_value = bufinfo->buf, - // .len = bufinfo->len, - // }; - - // check_nrf_error(sd_ble_gatts_value_set(conn_handle, handle, &gatts_value)); -} - -//FIX -// typedef struct { -// uint8_t* buf; -// size_t len; -// size_t final_len; -// uint16_t conn_handle; -// volatile uint16_t status; -// volatile bool done; -// } read_info_t; - -// STATIC bool _on_gattc_read_rsp_evt(ble_evt_t *ble_evt, void *param) { -// read_info_t* read = param; -// switch (ble_evt->header.evt_id) { - -// // More events may be handled later, so keep this as a switch. - -// case BLE_GATTC_EVT_READ_RSP: { -// ble_gattc_evt_t* evt = &ble_evt->evt.gattc_evt; -// ble_gattc_evt_read_rsp_t *response = &evt->params.read_rsp; -// if (read && evt->conn_handle == read->conn_handle) { -// read->status = evt->gatt_status; -// size_t len = MIN(read->len, response->len); -// memcpy(read->buf, response->data, len); -// read->final_len = len; -// // Indicate to busy-wait loop that we've read the attribute value. -// read->done = true; -// } -// break; -// } - -// default: -// // For debugging. -// // mp_printf(&mp_plat_print, "Unhandled characteristic event: 0x%04x\n", ble_evt->header.evt_id); -// return false; -// break; -// } -// return true; -// } - -size_t common_hal_bleio_gattc_read(uint16_t handle, uint16_t conn_handle, uint8_t* buf, size_t len) { - common_hal_bleio_check_connected(conn_handle); - - //FIX read_info_t read_info; - // read_info.buf = buf; - // read_info.len = len; - // read_info.final_len = 0; - // read_info.conn_handle = conn_handle; - // // Set to true by the event handler. - // read_info.done = false; - // ble_drv_add_event_handler(_on_gattc_read_rsp_evt, &read_info); - - // uint32_t nrf_error = NRF_ERROR_BUSY; - // while (nrf_error == NRF_ERROR_BUSY) { - // nrf_error = sd_ble_gattc_read(conn_handle, handle, 0); - // } - // if (nrf_error != NRF_SUCCESS) { - // ble_drv_remove_event_handler(_on_gattc_read_rsp_evt, &read_info); - // check_nrf_error(nrf_error); - // } - - // while (!read_info.done) { - // RUN_BACKGROUND_TASKS; - // } - - // ble_drv_remove_event_handler(_on_gattc_read_rsp_evt, &read_info); - // check_gatt_status(read_info.status); - // return read_info.final_len; - return 0; -} - -void common_hal_bleio_gattc_write(uint16_t handle, uint16_t conn_handle, mp_buffer_info_t *bufinfo, bool write_no_response) { - common_hal_bleio_check_connected(conn_handle); - - //FIX - // ble_gattc_write_params_t write_params = { - // .write_op = write_no_response ? BLE_GATT_OP_WRITE_CMD: BLE_GATT_OP_WRITE_REQ, - // .handle = handle, - // .p_value = bufinfo->buf, - // .len = bufinfo->len, - // }; - - // while (1) { - // uint32_t err_code = sd_ble_gattc_write(conn_handle, &write_params); - // if (err_code == NRF_SUCCESS) { - // break; - // } - - // // Write with response will return NRF_ERROR_BUSY if the response has not been received. - // // Write without reponse will return NRF_ERROR_RESOURCES if too many writes are pending. - // if (err_code == NRF_ERROR_BUSY || err_code == NRF_ERROR_RESOURCES) { - // // We could wait for an event indicating the write is complete, but just retrying is easier. - // MICROPY_VM_HOOK_LOOP; - // continue; - // } - - // // Some real error occurred. - // check_nrf_error(err_code); - // } -} - void common_hal_bleio_gc_collect(void) { bleio_adapter_gc_collect(&common_hal_bleio_adapter_obj); } diff --git a/devices/ble_hci/common-hal/_bleio/__init__.h b/devices/ble_hci/common-hal/_bleio/__init__.h index e84320e30c..086d56a4b0 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.h +++ b/devices/ble_hci/common-hal/_bleio/__init__.h @@ -31,6 +31,7 @@ #include "shared-bindings/_bleio/UUID.h" +#include "att.h" #include "hci.h" void bleio_background(void); @@ -44,7 +45,7 @@ typedef struct { // We assume variable length data. // 20 bytes max (23 - 3). -#define GATT_MAX_DATA_LENGTH (BLE_GATT_ATT_MTU_DEFAULT - 3) +#define GATT_MAX_DATA_LENGTH (BT_ATT_DEFAULT_LE_MTU - 3) //FIX #define BLE_GATT_HANDLE_INVALID 0x0000 diff --git a/devices/ble_hci/common-hal/_bleio/att.c b/devices/ble_hci/common-hal/_bleio/att.c index 603f1dde34..aa436faa58 100644 --- a/devices/ble_hci/common-hal/_bleio/att.c +++ b/devices/ble_hci/common-hal/_bleio/att.c @@ -64,8 +64,6 @@ typedef struct __packed { uint8_t uuid[0]; // 2 or 16 bytes } characteristic_declaration_t; -//FIX BLEDeviceEventHandler event_handlers[2]; - STATIC uint8_t bleio_properties_to_ble_spec_properties(uint8_t bleio_properties) { uint8_t ble_spec_properties = 0; if (bleio_properties & CHAR_PROP_BROADCAST) { @@ -220,21 +218,16 @@ bool att_connect_to_address(bt_addr_le_t *addr) { return is_connected; } -bool att_disconnect_from_address(bt_addr_le_t *addr) { - uint16_t conn_handle = att_conn_handle(addr); - if (conn_handle == 0xffff) { +bool att_disconnect(uint16_t conn_handle) { + if (conn_handle == BLE_CONN_HANDLE_INVALID) { return false; } hci_disconnect(conn_handle); - hci_poll_for_incoming_pkt_timeout(timeout); - if (!att_handle_is_connected(conn_handle)) { - return true; - } - - return false; + // Confirm we're now disconnected. + return !att_handle_is_connected(conn_handle); } //FIX @@ -512,10 +505,6 @@ void att_add_connection(uint16_t handle, uint8_t role, bt_addr_le_t *peer_addr, bleio_connections[peer_index].role = role; bleio_connections[peer_index].mtu = BT_ATT_DEFAULT_LE_MTU; memcpy(&bleio_connections[peer_index].addr, peer_addr, sizeof(bleio_connections[peer_index].addr)); - - //FIX if (event_handlers[BLEConnected]) { - // event_handlers[BLEConnected](BLEDevice(peer_bdaddr_type, peer_bdaddr)); - // } } @@ -564,11 +553,6 @@ void att_remove_connection(uint16_t handle, uint8_t reason) { long_write_value_length = 0; } - //FIX - // if (event_handlers[BLEDisconnected]) { - // event_handlers[BLEDisconnected](bleDevice); - // } - bleio_connections[peer_index].conn_handle = 0xffff; bleio_connections[peer_index].role = 0x00; memset(&bleio_connections[peer_index].addr, 0x00, sizeof(bleio_connections[peer_index].addr)); @@ -630,7 +614,7 @@ bool att_disconnect_all(void) { continue; } - if (hci_disconnect(bleio_connections[i].conn_handle) != 0) { + if (att_disconnect(bleio_connections[i].conn_handle) != 0) { continue; } @@ -1391,7 +1375,8 @@ STATIC void process_write_req_or_cmd(uint16_t conn_handle, uint16_t mtu, uint8_t return; } - common_hal_bleio_characteristic_set_value(characteristic, &bufinfo); + // Just change the local value. Don't fire off notifications, etc. + bleio_characteristic_set_local_value(characteristic, &bufinfo); } else if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_descriptor_type)) { bleio_descriptor_obj_t *descriptor = MP_OBJ_TO_PTR(attribute_obj); @@ -1403,7 +1388,6 @@ STATIC void process_write_req_or_cmd(uint16_t conn_handle, uint16_t mtu, uint8_t return; } - //FIX need to set up event handlers, etc.? common_hal_bleio_descriptor_set_value(descriptor, &bufinfo); } @@ -1593,14 +1577,6 @@ bool att_exchange_mtu(uint16_t conn_handle) { return send_req_wait_for_rsp(conn_handle, sizeof(req), (uint8_t *) &req, response_buffer); } - - -//FIX void att_set_event_handler(BLEDeviceEvent event, BLEDeviceEventHandler event_handler) { -// if (event < (sizeof(event_handlers) / (sizeof(event_handlers[0])))) { -// event_handlers[event] = event_handler; -// } -// } - int att_read_req(uint16_t conn_handle, uint16_t handle, uint8_t response_buffer[]) { struct __packed { struct bt_att_hdr h; @@ -1642,7 +1618,7 @@ void att_write_cmd(uint16_t conn_handle, uint16_t handle, const uint8_t* data, u cmd->r.handle = handle; memcpy(cmd->r.value, data, data_len); - return send_req(conn_handle, sizeof(cmd_bytes), cmd_bytes); + send_req(conn_handle, sizeof(cmd_bytes), cmd_bytes); } void att_process_data(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { @@ -1738,3 +1714,76 @@ void att_process_data(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) { break; } } + +//FIX Do we need all of these? +void check_att_err(uint8_t err) { + const compressed_string_t *msg = NULL; + switch (err) { + case 0: + return; + case BT_ATT_ERR_INVALID_HANDLE: + msg = translate("Invalid handle"); + break; + case BT_ATT_ERR_READ_NOT_PERMITTED: + msg = translate("Read not permitted"); + break; + case BT_ATT_ERR_WRITE_NOT_PERMITTED: + msg = translate("Write not permitted"); + break; + case BT_ATT_ERR_INVALID_PDU: + msg = translate("Invalid PDU"); + break; + case BT_ATT_ERR_NOT_SUPPORTED: + msg = translate("Not supported"); + break; + case BT_ATT_ERR_INVALID_OFFSET: + msg = translate("Invalid offset"); + break; + case BT_ATT_ERR_PREPARE_QUEUE_FULL: + msg = translate("Prepare queue full"); + break; + case BT_ATT_ERR_ATTRIBUTE_NOT_FOUND: + msg = translate("Attribute not found"); + break; + case BT_ATT_ERR_ATTRIBUTE_NOT_LONG: + msg = translate("Attribute not long"); + break; + case BT_ATT_ERR_ENCRYPTION_KEY_SIZE: + msg = translate("Encryption key size"); + case BT_ATT_ERR_INVALID_ATTRIBUTE_LEN: + msg = translate("Invalid attribute length"); + break; + case BT_ATT_ERR_UNLIKELY: + msg = translate("Unlikely"); + break; + case BT_ATT_ERR_UNSUPPORTED_GROUP_TYPE: + msg = translate("Unsupported group type"); + break; + case BT_ATT_ERR_INSUFFICIENT_RESOURCES: + msg = translate("Insufficient resources"); + break; + case BT_ATT_ERR_DB_OUT_OF_SYNC: + msg = translate("DB out of sync"); + break; + case BT_ATT_ERR_VALUE_NOT_ALLOWED: + msg = translate("Value not allowed"); + break; + } + if (msg) { + mp_raise_bleio_BluetoothError(msg); + } + + switch (err) { + case BT_ATT_ERR_AUTHENTICATION: + msg = translate("Insufficient authentication"); + break; + case BT_ATT_ERR_INSUFFICIENT_ENCRYPTION: + msg = translate("Insufficient encryption"); + break; + } + if (msg) { + mp_raise_bleio_SecurityError(msg); + } + + mp_raise_bleio_BluetoothError(translate("Unknown ATT error: 0x%02x"), err); +} diff --git a/devices/ble_hci/common-hal/_bleio/att.h b/devices/ble_hci/common-hal/_bleio/att.h index 820e86bfb6..2b1723440f 100644 --- a/devices/ble_hci/common-hal/_bleio/att.h +++ b/devices/ble_hci/common-hal/_bleio/att.h @@ -35,8 +35,8 @@ void bleio_att_reset(void); //FIX void att_set_event_handler(BLEDeviceEvent event, BLEDeviceEventHandler eventHandler); bool att_address_is_connected(bt_addr_le_t *addr); bool att_connect_to_address(bt_addr_le_t *addr); +bool att_disconnect(uint16_t conn_handle); bool att_disconnect_all(void); -bool att_disconnect_from_address(bt_addr_le_t *addr); bool att_discover_attributes(bt_addr_le_t *addr, const char* service_uuid_filter); bool att_exchange_mtu(uint16_t conn_handle); bool att_handle_is_connected(uint16_t handle); diff --git a/devices/ble_hci/common-hal/_bleio/hci.c b/devices/ble_hci/common-hal/_bleio/hci.c index 52452a26d1..f29121aaa2 100644 --- a/devices/ble_hci/common-hal/_bleio/hci.c +++ b/devices/ble_hci/common-hal/_bleio/hci.c @@ -172,15 +172,14 @@ STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt_data[]) struct bt_hci_evt_disconn_complete *disconn_complete = (struct bt_hci_evt_disconn_complete*) pkt->params; (void) disconn_complete; - //FIX - // ATT.removeConnection(disconn_complete->handle, disconn_complete->reason); - // L2CAPSignaling.removeConnection(disconn_complete->handle, disconn_complete->reason); + + att_remove_connection(disconn_complete->handle, disconn_complete->reason); + //FIX L2CAPSignaling.removeConnection(disconn_complete->handle, disconn_complete->reason); hci_le_set_advertising_enable(0x01); break; } case BT_HCI_EVT_CMD_COMPLETE: { - struct cmd_complete_with_status { struct bt_hci_evt_cmd_complete cmd_complete; struct bt_hci_evt_cc_status cc_status; @@ -238,19 +237,21 @@ STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt_data[]) (struct bt_hci_evt_le_conn_complete *) le_evt; if (le_conn_complete->status == BT_HCI_ERR_SUCCESS) { - // ATT.addConnection(le_conn_complete->handle, - // le_conn_complete->role, - // le_conn_complete->peer_addr //FIX struct - // le_conn_complete->interval, - // le_conn_complete->latency, - // le_conn_complete->supv_timeout - // le_conn_complete->clock_accuracy); + att_add_connection( + le_conn_complete->handle, + le_conn_complete->role, + &le_conn_complete->peer_addr, + le_conn_complete->interval, + le_conn_complete->latency, + le_conn_complete->supv_timeout, + le_conn_complete->clock_accuracy); } } else if (meta_evt->subevent == BT_HCI_EVT_LE_ADVERTISING_REPORT) { struct bt_hci_evt_le_advertising_info *le_advertising_info = (struct bt_hci_evt_le_advertising_info *) le_evt; - if (le_advertising_info->evt_type == BT_HCI_ADV_DIRECT_IND) { //FIX handle kind of advertising + if (le_advertising_info->evt_type == BT_HCI_ADV_DIRECT_IND) { + //FIX // last byte is RSSI // GAP.handleLeAdvertisingReport(leAdvertisingReport->type, // leAdvertisingReport->peerBdaddrType, @@ -538,7 +539,7 @@ hci_result_t hci_read_rssi(uint16_t handle, int *rssi) { return result; } -hci_result_t hci_set_evt_mask(uint64_t event_mask) { +hci_result_t hci_set_event_mask(uint64_t event_mask) { return send_command(BT_HCI_OP_SET_EVENT_MASK, sizeof(event_mask), &event_mask); } diff --git a/devices/ble_hci/common-hal/_bleio/hci.h b/devices/ble_hci/common-hal/_bleio/hci.h index d907a84b7d..5dc831eb48 100644 --- a/devices/ble_hci/common-hal/_bleio/hci.h +++ b/devices/ble_hci/common-hal/_bleio/hci.h @@ -75,6 +75,6 @@ hci_result_t hci_read_rssi(uint16_t handle, int *rssi); hci_result_t hci_reset(void); hci_result_t hci_send_acl_pkt(uint16_t handle, uint8_t cid, uint8_t data_len, uint8_t *data); -hci_result_t hci_set_evt_mask(uint64_t event_mask); +hci_result_t hci_set_event_mask(uint64_t event_mask); #endif // MICROPY_INCLUDED_DEVICES_BLE_HCI_COMMON_HAL_BLEIO_HCI_H diff --git a/ports/nrf/common-hal/_bleio/Characteristic.c b/ports/nrf/common-hal/_bleio/Characteristic.c index cacd53417a..57c4814489 100644 --- a/ports/nrf/common-hal/_bleio/Characteristic.c +++ b/ports/nrf/common-hal/_bleio/Characteristic.c @@ -90,6 +90,7 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, self->props = props; self->read_perm = read_perm; self->write_perm = write_perm; + self->initial_value = mp_obj_new_bytes(initial_value_bufinfo->buf, initial_value_bufinfo->len); self->descriptor_list = mp_obj_new_list(0, NULL); const mp_int_t max_length_max = fixed_length ? BLE_GATTS_FIX_ATTR_LEN_MAX : BLE_GATTS_VAR_ATTR_LEN_MAX; @@ -105,10 +106,6 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, } else { common_hal_bleio_service_add_characteristic(self->service, self, initial_value_bufinfo); } - - if (initial_value_bufinfo != NULL) { - common_hal_bleio_characteristic_set_value(self, initial_value_bufinfo); - } } mp_obj_tuple_t *common_hal_bleio_characteristic_get_descriptors(bleio_characteristic_obj_t *self) { @@ -124,7 +121,6 @@ size_t common_hal_bleio_characteristic_get_value(bleio_characteristic_obj_t *sel if (self->handle != BLE_GATT_HANDLE_INVALID) { uint16_t conn_handle = bleio_connection_get_conn_handle(self->service->connection); if (common_hal_bleio_service_get_is_remote(self->service)) { - // self->value is set by evt handler. return common_hal_bleio_gattc_read(self->handle, conn_handle, buf, len); } else { // conn_handle is ignored for non-system attributes. @@ -205,7 +201,7 @@ void common_hal_bleio_characteristic_add_descriptor(bleio_characteristic_obj_t * bleio_attribute_gatts_set_security_mode(&desc_attr_md.write_perm, descriptor->write_perm); mp_buffer_info_t desc_value_bufinfo; - mp_get_buffer_raise(descriptor->value, &desc_value_bufinfo, MP_BUFFER_READ); + mp_get_buffer_raise(descriptor->initial_value, &desc_value_bufinfo, MP_BUFFER_READ); ble_gatts_attr_t desc_attr = { .p_uuid = &desc_uuid, diff --git a/ports/nrf/common-hal/_bleio/Characteristic.h b/ports/nrf/common-hal/_bleio/Characteristic.h index 19970ef820..382fd4a81e 100644 --- a/ports/nrf/common-hal/_bleio/Characteristic.h +++ b/ports/nrf/common-hal/_bleio/Characteristic.h @@ -39,7 +39,7 @@ typedef struct _bleio_characteristic_obj { // Will be MP_OBJ_NULL before being assigned to a Service. bleio_service_obj_t *service; bleio_uuid_obj_t *uuid; - mp_obj_t value; + mp_obj_t initial_value; uint16_t max_length; bool fixed_length; uint16_t handle; diff --git a/ports/nrf/common-hal/_bleio/Connection.c b/ports/nrf/common-hal/_bleio/Connection.c index fccb5a22a7..4f747bf976 100644 --- a/ports/nrf/common-hal/_bleio/Connection.c +++ b/ports/nrf/common-hal/_bleio/Connection.c @@ -523,7 +523,7 @@ STATIC void on_char_discovery_rsp(ble_gattc_evt_char_disc_rsp_t *response, bleio characteristic, m_char_discovery_service, gattc_char->handle_value, uuid, props, SECURITY_MODE_OPEN, SECURITY_MODE_OPEN, GATT_MAX_DATA_LENGTH, false, // max_length, fixed_length: values may not matter for gattc - NULL); + mp_const_empty_bytes); mp_obj_list_append(MP_OBJ_FROM_PTR(m_char_discovery_service->characteristic_list), MP_OBJ_FROM_PTR(characteristic)); diff --git a/ports/nrf/common-hal/_bleio/Descriptor.c b/ports/nrf/common-hal/_bleio/Descriptor.c index faf50c658c..9e91107231 100644 --- a/ports/nrf/common-hal/_bleio/Descriptor.c +++ b/ports/nrf/common-hal/_bleio/Descriptor.c @@ -39,6 +39,7 @@ void common_hal_bleio_descriptor_construct(bleio_descriptor_obj_t *self, bleio_c self->handle = BLE_GATT_HANDLE_INVALID; self->read_perm = read_perm; self->write_perm = write_perm; + self->initial_value = mp_obj_new_bytes(initial_value_bufinfo->buf, initial_value_bufinfo->len); const mp_int_t max_length_max = fixed_length ? BLE_GATTS_FIX_ATTR_LEN_MAX : BLE_GATTS_VAR_ATTR_LEN_MAX; if (max_length < 0 || max_length > max_length_max) { @@ -47,8 +48,6 @@ void common_hal_bleio_descriptor_construct(bleio_descriptor_obj_t *self, bleio_c } self->max_length = max_length; self->fixed_length = fixed_length; - - common_hal_bleio_descriptor_set_value(self, initial_value_bufinfo); } bleio_uuid_obj_t *common_hal_bleio_descriptor_get_uuid(bleio_descriptor_obj_t *self) { @@ -81,8 +80,6 @@ void common_hal_bleio_descriptor_set_value(bleio_descriptor_obj_t *self, mp_buff mp_raise_ValueError(translate("Value length > max_length")); } - self->value = mp_obj_new_bytes(bufinfo->buf, bufinfo->len); - // Do GATT operations only if this descriptor has been registered. if (self->handle != BLE_GATT_HANDLE_INVALID) { uint16_t conn_handle = bleio_connection_get_conn_handle(self->characteristic->service->connection); diff --git a/ports/nrf/common-hal/_bleio/Descriptor.h b/ports/nrf/common-hal/_bleio/Descriptor.h index f76510d128..4d6ac2543f 100644 --- a/ports/nrf/common-hal/_bleio/Descriptor.h +++ b/ports/nrf/common-hal/_bleio/Descriptor.h @@ -41,7 +41,7 @@ typedef struct _bleio_descriptor_obj { // Will be MP_OBJ_NULL before being assigned to a Characteristic. struct _bleio_characteristic_obj *characteristic; bleio_uuid_obj_t *uuid; - mp_obj_t value; + mp_obj_t initial_value; uint16_t max_length; bool fixed_length; uint16_t handle; diff --git a/ports/nrf/common-hal/_bleio/Service.c b/ports/nrf/common-hal/_bleio/Service.c index 8c57442f29..3159d3392f 100644 --- a/ports/nrf/common-hal/_bleio/Service.c +++ b/ports/nrf/common-hal/_bleio/Service.c @@ -124,11 +124,14 @@ void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, char_attr_md.rd_auth = true; #endif + mp_buffer_info_t char_value_bufinfo; + mp_get_buffer_raise(characteristic->initial_value, &char_value_bufinfo, MP_BUFFER_READ); + ble_gatts_attr_t char_attr = { .p_uuid = &char_uuid, .p_attr_md = &char_attr_md, - .init_len = 0, - .p_value = NULL, + .init_len = char_value_bufinfo.len, + .p_value = char_value_bufinfo.buf, .init_offs = 0, .max_len = characteristic->max_length, }; From e7da652711f8d7ccdffce1a4da2a25aaf61ae150 Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Fri, 7 Aug 2020 23:01:49 +0800 Subject: [PATCH 0583/1293] able to change ble mac address --- ports/nrf/common-hal/_bleio/Adapter.c | 9 +++++++++ shared-bindings/_bleio/Adapter.c | 10 ++++++++-- shared-bindings/_bleio/Adapter.h | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 0b23bb7bfa..d34f5d2877 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -386,6 +386,15 @@ bleio_address_obj_t *common_hal_bleio_adapter_get_address(bleio_adapter_obj_t *s return address; } +uint32_t common_hal_bleio_adapter_set_address(bleio_adapter_obj_t *self, bleio_address_obj_t *address) +{ + ble_gap_addr_t local_address; + local_address.addr_type = address->type; + const char *data = mp_obj_str_get_str(address->bytes); + memcpy(local_address.addr, data, NUM_BLEIO_ADDRESS_BYTES); + return sd_ble_gap_addr_set(&local_address); +} + mp_obj_str_t* common_hal_bleio_adapter_get_name(bleio_adapter_obj_t *self) { uint16_t len = 0; sd_ble_gap_device_name_get(NULL, &len); diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 7a44d560fd..861b640b5b 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -96,7 +96,7 @@ const mp_obj_property_t bleio_adapter_enabled_obj = { }; //| address: Address -//| """MAC address of the BLE adapter. (read-only)""" +//| """MAC address of the BLE adapter.""" //| STATIC mp_obj_t bleio_adapter_get_address(mp_obj_t self) { return MP_OBJ_FROM_PTR(common_hal_bleio_adapter_get_address(self)); @@ -104,10 +104,16 @@ STATIC mp_obj_t bleio_adapter_get_address(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_get_address_obj, bleio_adapter_get_address); +STATIC mp_obj_t bleio_adapter_set_address(mp_obj_t self, mp_obj_t new_address) { + common_hal_bleio_adapter_set_address(self, new_address); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(bleio_adapter_set_address_obj, bleio_adapter_set_address); + const mp_obj_property_t bleio_adapter_address_obj = { .base.type = &mp_type_property, .proxy = { (mp_obj_t)&bleio_adapter_get_address_obj, - (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&bleio_adapter_set_address_obj, (mp_obj_t)&mp_const_none_obj }, }; diff --git a/shared-bindings/_bleio/Adapter.h b/shared-bindings/_bleio/Adapter.h index 39147b6ebc..ad84bf9aa9 100644 --- a/shared-bindings/_bleio/Adapter.h +++ b/shared-bindings/_bleio/Adapter.h @@ -42,6 +42,7 @@ extern bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self); extern void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enabled); extern bool common_hal_bleio_adapter_get_connected(bleio_adapter_obj_t *self); extern bleio_address_obj_t *common_hal_bleio_adapter_get_address(bleio_adapter_obj_t *self); +extern uint32_t common_hal_bleio_adapter_set_address(bleio_adapter_obj_t *self, bleio_address_obj_t *address); extern mp_obj_str_t* common_hal_bleio_adapter_get_name(bleio_adapter_obj_t *self); extern void common_hal_bleio_adapter_set_name(bleio_adapter_obj_t *self, const char* name); From 42b860e91a15a6de4ef7ae4755b7dd3e563efc64 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 13 Aug 2020 07:49:45 -0500 Subject: [PATCH 0584/1293] stm: meowbit_v121: remove _pixelbuf to fit ja translation --- ports/stm/boards/meowbit_v121/mpconfigboard.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk index 127cdb60e2..a14c05a6a8 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -14,6 +14,8 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F401xE MCU_PACKAGE = LQFP64 +CIRCUITPY_PIXELBUF = 0 + LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F401xe_boot.ld # LD_FILE = boards/STM32F401xe_fs.ld # use for internal flash From 329f4fb2e6d6ac4c5d293d1be4cd986a3ab16ef5 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 13 Aug 2020 10:09:46 -0400 Subject: [PATCH 0585/1293] Update mpconfigboard.mk The stm boards default to `-O2`. Changing to `-Os` brings it back to ~43kB (!) free even for ja. --- ports/stm/boards/meowbit_v121/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk index a14c05a6a8..852836ef8f 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -14,7 +14,7 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F401xE MCU_PACKAGE = LQFP64 -CIRCUITPY_PIXELBUF = 0 +OPTIMIZATION_FLAGS = -Os LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F401xe_boot.ld From d0ffdda5bb8f81fcf5002e2a75b4fef5b652fd7a Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 13 Aug 2020 17:47:35 -0400 Subject: [PATCH 0586/1293] fix reset logic to not do pin ops or heap ops at bad times --- devices/ble_hci/common-hal/_bleio/Adapter.c | 34 ++++++++++++--------- main.c | 2 ++ 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index 4ed85f7540..fe32241d17 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -268,20 +268,22 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable supervisor_disable_tick(); } - // Stop any current activity; reset to known state. + // Enabling or disabling: stop any current activity; reset to known state. check_hci_error(hci_reset()); self->now_advertising = false; self->extended_advertising = false; self->circuitpython_advertising = false; self->advertising_timeout_msecs = 0; - // Reset list of known attributes. - // Indices into the list are handles. Handle 0x0000 designates an invalid handle, - // so store None there to skip it. - self->attributes = mp_obj_new_list(0, NULL); - bleio_adapter_add_attribute(self, mp_const_none); - self->last_added_service_handle = BLE_GATT_HANDLE_INVALID; - self->last_added_characteristic_handle = BLE_GATT_HANDLE_INVALID; + if (enabled) { + // Reset list of known attributes. + // Indices into the list are handles. Handle 0x0000 designates an invalid handle, + // so store None there to skip it. + self->attributes = mp_obj_new_list(0, NULL); + bleio_adapter_add_attribute(self, mp_const_none); + self->last_added_service_handle = BLE_GATT_HANDLE_INVALID; + self->last_added_characteristic_handle = BLE_GATT_HANDLE_INVALID; + } } bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self) { @@ -392,9 +394,11 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t* void common_hal_bleio_adapter_stop_scan(bleio_adapter_obj_t *self) { check_enabled(self); - check_hci_error(hci_le_set_scan_enable(BT_HCI_LE_SCAN_DISABLE, BT_HCI_LE_SCAN_FILTER_DUP_DISABLE)); - shared_module_bleio_scanresults_set_done(self->scan_results, true); - self->scan_results = NULL; + // If not already scanning, no problem. + if (hci_le_set_scan_enable(BT_HCI_LE_SCAN_DISABLE, BT_HCI_LE_SCAN_FILTER_DUP_DISABLE) == HCI_OK) { + shared_module_bleio_scanresults_set_done(self->scan_results, true); + self->scan_results = NULL; + } } // typedef struct { @@ -782,14 +786,13 @@ void bleio_adapter_gc_collect(bleio_adapter_obj_t* adapter) { } void bleio_adapter_reset(bleio_adapter_obj_t* adapter) { + if (!common_hal_bleio_adapter_get_enabled(adapter)) { return; } - common_hal_bleio_adapter_stop_scan(adapter); - if (adapter->now_advertising) { - common_hal_bleio_adapter_stop_advertising(adapter); - } + // Adapter will be reset. + common_hal_bleio_adapter_set_enabled(adapter, false); adapter->connection_objs = NULL; for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { @@ -801,6 +804,7 @@ void bleio_adapter_reset(bleio_adapter_obj_t* adapter) { } connection->connection_obj = mp_const_none; } + } void bleio_adapter_background(bleio_adapter_obj_t* adapter) { diff --git a/main.c b/main.c index 4dd93374e3..e1078edc14 100755 --- a/main.c +++ b/main.c @@ -212,6 +212,8 @@ bool maybe_run_list(const char ** filenames, pyexec_result_t* exec_result) { } void cleanup_after_vm(supervisor_allocation* heap) { + // Reset port-independent devices, like CIRCUITPY_BLEIO_HCI. + reset_devices(); // Turn off the display and flush the fileystem before the heap disappears. #if CIRCUITPY_DISPLAYIO reset_displays(); From 14f5d03b6dd947bd82d2daf88ca398d7d3b44930 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Thu, 13 Aug 2020 18:59:00 -0500 Subject: [PATCH 0587/1293] bringing up to date --- extmod/ulab | 2 +- frozen/Adafruit_CircuitPython_BLE | 2 +- ...ircuitPython_BLE_Apple_Notification_Center | 2 +- frozen/Adafruit_CircuitPython_BusDevice | 2 +- .../Adafruit_CircuitPython_CircuitPlayground | 2 +- frozen/Adafruit_CircuitPython_Crickit | 2 +- frozen/Adafruit_CircuitPython_DRV2605 | 2 +- frozen/Adafruit_CircuitPython_DS3231 | 2 +- frozen/Adafruit_CircuitPython_ESP32SPI | 2 +- frozen/Adafruit_CircuitPython_FocalTouch | 2 +- frozen/Adafruit_CircuitPython_HID | 2 +- frozen/Adafruit_CircuitPython_IRRemote | 2 +- frozen/Adafruit_CircuitPython_LIS3DH | 2 +- frozen/Adafruit_CircuitPython_LSM6DS | 2 +- frozen/Adafruit_CircuitPython_Motor | 2 +- frozen/Adafruit_CircuitPython_Register | 2 +- frozen/Adafruit_CircuitPython_Requests | 2 +- frozen/Adafruit_CircuitPython_Thermistor | 2 +- frozen/Adafruit_CircuitPython_seesaw | 2 +- frozen/circuitpython-stage | 2 +- lib/mp3 | 2 +- lib/protomatter | 2 +- lib/tinyusb | 2 +- ports/atmel-samd/asf4 | 2 +- ports/atmel-samd/peripherals | 2 +- ports/cxd56/spresense-exported-sdk | 2 +- ports/esp32s2/esp-idf | 2 +- ports/stm/st_driver | 2 +- shared-bindings/_typing/__init__ 2.pyi | 54 ++ shared-bindings/gnss/GNSS 2.c | 205 ++++++++ shared-bindings/gnss/GNSS 2.h | 27 + shared-bindings/gnss/PositionFix 2.c | 80 +++ shared-bindings/gnss/PositionFix 2.h | 28 ++ shared-bindings/gnss/SatelliteSystem 2.c | 113 +++++ shared-bindings/gnss/SatelliteSystem 2.h | 33 ++ shared-bindings/gnss/__init__ 2.c | 31 ++ .../i2cperipheral/I2CPeripheral 2.c | 436 ++++++++++++++++ .../i2cperipheral/I2CPeripheral 2.h | 60 +++ shared-bindings/i2cperipheral/__init__ 2.c | 106 ++++ .../memorymonitor/AllocationAlarm 2.c | 137 +++++ .../memorymonitor/AllocationAlarm 2.h | 39 ++ .../memorymonitor/AllocationSize 2.c | 183 +++++++ .../memorymonitor/AllocationSize 2.h | 42 ++ shared-bindings/memorymonitor/__init__ 2.c | 76 +++ shared-bindings/memorymonitor/__init__ 2.h | 49 ++ shared-bindings/sdcardio/SDCard 2.c | 183 +++++++ shared-bindings/sdcardio/SDCard 2.h | 30 ++ shared-bindings/sdcardio/__init__ 2.c | 47 ++ shared-bindings/sdcardio/__init__ 2.h | 0 shared-bindings/sdioio/SDCard 2.c | 296 +++++++++++ shared-bindings/sdioio/SDCard 2.h | 66 +++ shared-bindings/sdioio/__init__ 2.c | 47 ++ shared-bindings/sdioio/__init__ 2.h | 0 .../memorymonitor/AllocationAlarm 2.c | 94 ++++ .../memorymonitor/AllocationAlarm 2.h | 51 ++ .../memorymonitor/AllocationSize 2.c | 91 ++++ .../memorymonitor/AllocationSize 2.h | 51 ++ shared-module/memorymonitor/__init__ 2.c | 39 ++ shared-module/memorymonitor/__init__ 2.h | 35 ++ shared-module/sdcardio/SDCard 2.c | 466 ++++++++++++++++++ shared-module/sdcardio/SDCard 2.h | 51 ++ shared-module/sdcardio/__init__ 2.c | 0 shared-module/sdcardio/__init__ 2.h | 0 supervisor/background_callback 2.h | 87 ++++ supervisor/shared/background_callback 2.c | 138 ++++++ 65 files changed, 3499 insertions(+), 28 deletions(-) create mode 100644 shared-bindings/_typing/__init__ 2.pyi create mode 100644 shared-bindings/gnss/GNSS 2.c create mode 100644 shared-bindings/gnss/GNSS 2.h create mode 100644 shared-bindings/gnss/PositionFix 2.c create mode 100644 shared-bindings/gnss/PositionFix 2.h create mode 100644 shared-bindings/gnss/SatelliteSystem 2.c create mode 100644 shared-bindings/gnss/SatelliteSystem 2.h create mode 100644 shared-bindings/gnss/__init__ 2.c create mode 100644 shared-bindings/i2cperipheral/I2CPeripheral 2.c create mode 100644 shared-bindings/i2cperipheral/I2CPeripheral 2.h create mode 100644 shared-bindings/i2cperipheral/__init__ 2.c create mode 100644 shared-bindings/memorymonitor/AllocationAlarm 2.c create mode 100644 shared-bindings/memorymonitor/AllocationAlarm 2.h create mode 100644 shared-bindings/memorymonitor/AllocationSize 2.c create mode 100644 shared-bindings/memorymonitor/AllocationSize 2.h create mode 100644 shared-bindings/memorymonitor/__init__ 2.c create mode 100644 shared-bindings/memorymonitor/__init__ 2.h create mode 100644 shared-bindings/sdcardio/SDCard 2.c create mode 100644 shared-bindings/sdcardio/SDCard 2.h create mode 100644 shared-bindings/sdcardio/__init__ 2.c create mode 100644 shared-bindings/sdcardio/__init__ 2.h create mode 100644 shared-bindings/sdioio/SDCard 2.c create mode 100644 shared-bindings/sdioio/SDCard 2.h create mode 100644 shared-bindings/sdioio/__init__ 2.c create mode 100644 shared-bindings/sdioio/__init__ 2.h create mode 100644 shared-module/memorymonitor/AllocationAlarm 2.c create mode 100644 shared-module/memorymonitor/AllocationAlarm 2.h create mode 100644 shared-module/memorymonitor/AllocationSize 2.c create mode 100644 shared-module/memorymonitor/AllocationSize 2.h create mode 100644 shared-module/memorymonitor/__init__ 2.c create mode 100644 shared-module/memorymonitor/__init__ 2.h create mode 100644 shared-module/sdcardio/SDCard 2.c create mode 100644 shared-module/sdcardio/SDCard 2.h create mode 100644 shared-module/sdcardio/__init__ 2.c create mode 100644 shared-module/sdcardio/__init__ 2.h create mode 100644 supervisor/background_callback 2.h create mode 100644 supervisor/shared/background_callback 2.c diff --git a/extmod/ulab b/extmod/ulab index 11a7ecff6d..cf61d728e7 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 11a7ecff6d76a02644ff23a734b792afaa615e44 +Subproject commit cf61d728e70b9ec57e5711b40540793a89296f5d diff --git a/frozen/Adafruit_CircuitPython_BLE b/frozen/Adafruit_CircuitPython_BLE index 41f7a3530d..5d584576ef 160000 --- a/frozen/Adafruit_CircuitPython_BLE +++ b/frozen/Adafruit_CircuitPython_BLE @@ -1 +1 @@ -Subproject commit 41f7a3530d4cacdbf668399d3a015ea29c7e169b +Subproject commit 5d584576ef79ca36506e6c7470e7ac5204cf0a8d diff --git a/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center index 6a034887e3..3ffb3f02d2 160000 --- a/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center +++ b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center @@ -1 +1 @@ -Subproject commit 6a034887e370caa61fee5f51db8dd393d3e72542 +Subproject commit 3ffb3f02d2046910e09d1f5a74721bd1a4cdf8cf diff --git a/frozen/Adafruit_CircuitPython_BusDevice b/frozen/Adafruit_CircuitPython_BusDevice index eb4b21e216..e9411c4244 160000 --- a/frozen/Adafruit_CircuitPython_BusDevice +++ b/frozen/Adafruit_CircuitPython_BusDevice @@ -1 +1 @@ -Subproject commit eb4b21e216efd8ec0c4862a938e81b56be961724 +Subproject commit e9411c4244984b69ec6928370ede40cec014c10b diff --git a/frozen/Adafruit_CircuitPython_CircuitPlayground b/frozen/Adafruit_CircuitPython_CircuitPlayground index 3c540329b6..e9f15d6150 160000 --- a/frozen/Adafruit_CircuitPython_CircuitPlayground +++ b/frozen/Adafruit_CircuitPython_CircuitPlayground @@ -1 +1 @@ -Subproject commit 3c540329b63163e45f108df4bfebc387d5352c4f +Subproject commit e9f15d61502f34173912ba271aaaf9446dae8da1 diff --git a/frozen/Adafruit_CircuitPython_Crickit b/frozen/Adafruit_CircuitPython_Crickit index 809646ba11..0e1230676a 160000 --- a/frozen/Adafruit_CircuitPython_Crickit +++ b/frozen/Adafruit_CircuitPython_Crickit @@ -1 +1 @@ -Subproject commit 809646ba11366b5aedbc8a90be1da1829304bf62 +Subproject commit 0e1230676a54da17a309d1dfffdd7fa90240191c diff --git a/frozen/Adafruit_CircuitPython_DRV2605 b/frozen/Adafruit_CircuitPython_DRV2605 index 209edd164e..7914a63903 160000 --- a/frozen/Adafruit_CircuitPython_DRV2605 +++ b/frozen/Adafruit_CircuitPython_DRV2605 @@ -1 +1 @@ -Subproject commit 209edd164eb640a8ced561a54505792fc99a67b9 +Subproject commit 7914a6390318687bb8e2e9c4119aa932fea01531 diff --git a/frozen/Adafruit_CircuitPython_DS3231 b/frozen/Adafruit_CircuitPython_DS3231 index 5d81a9ea82..0d49a1fcd9 160000 --- a/frozen/Adafruit_CircuitPython_DS3231 +++ b/frozen/Adafruit_CircuitPython_DS3231 @@ -1 +1 @@ -Subproject commit 5d81a9ea822a85e46be4a512ac44abf21e77d816 +Subproject commit 0d49a1fcd96c13a94e8bdf26f92abe79b8517906 diff --git a/frozen/Adafruit_CircuitPython_ESP32SPI b/frozen/Adafruit_CircuitPython_ESP32SPI index 01f3f6674b..94b03517c1 160000 --- a/frozen/Adafruit_CircuitPython_ESP32SPI +++ b/frozen/Adafruit_CircuitPython_ESP32SPI @@ -1 +1 @@ -Subproject commit 01f3f6674b4493ba29b857e0f43deb69975736ec +Subproject commit 94b03517c1f4ff68cc2bb09b0963f7e7e3ce3d04 diff --git a/frozen/Adafruit_CircuitPython_FocalTouch b/frozen/Adafruit_CircuitPython_FocalTouch index 1e3312ab1c..72968d3546 160000 --- a/frozen/Adafruit_CircuitPython_FocalTouch +++ b/frozen/Adafruit_CircuitPython_FocalTouch @@ -1 +1 @@ -Subproject commit 1e3312ab1cba0b1d3bb1f559c52acfdc1a6d57b8 +Subproject commit 72968d3546f9d6c5af138d4c179343007cb9662c diff --git a/frozen/Adafruit_CircuitPython_HID b/frozen/Adafruit_CircuitPython_HID index 829ba0f0a2..65fb213b8c 160000 --- a/frozen/Adafruit_CircuitPython_HID +++ b/frozen/Adafruit_CircuitPython_HID @@ -1 +1 @@ -Subproject commit 829ba0f0a2d8a63f7d0215c6c9fc821e14e52a93 +Subproject commit 65fb213b8c554181d54b77f75335e16e2f4c0987 diff --git a/frozen/Adafruit_CircuitPython_IRRemote b/frozen/Adafruit_CircuitPython_IRRemote index fc3a7b4798..d435fc9a9d 160000 --- a/frozen/Adafruit_CircuitPython_IRRemote +++ b/frozen/Adafruit_CircuitPython_IRRemote @@ -1 +1 @@ -Subproject commit fc3a7b479874a1ea315ddb3bf6c5e281e16ef097 +Subproject commit d435fc9a9d90cb063608ae037bf5284b33bc5e84 diff --git a/frozen/Adafruit_CircuitPython_LIS3DH b/frozen/Adafruit_CircuitPython_LIS3DH index 9fe8f314c0..457aba6dd5 160000 --- a/frozen/Adafruit_CircuitPython_LIS3DH +++ b/frozen/Adafruit_CircuitPython_LIS3DH @@ -1 +1 @@ -Subproject commit 9fe8f314c032cee89b9ad7697d61e9cba76431ff +Subproject commit 457aba6dd59ad00502b80c9031655d3d26ecc82b diff --git a/frozen/Adafruit_CircuitPython_LSM6DS b/frozen/Adafruit_CircuitPython_LSM6DS index f1cc47f024..ee8f2187d4 160000 --- a/frozen/Adafruit_CircuitPython_LSM6DS +++ b/frozen/Adafruit_CircuitPython_LSM6DS @@ -1 +1 @@ -Subproject commit f1cc47f024b27e670b9bf2a51c89e32f93c1b957 +Subproject commit ee8f2187d4795b08ae4aa60558f564d26c997be9 diff --git a/frozen/Adafruit_CircuitPython_Motor b/frozen/Adafruit_CircuitPython_Motor index 434e5b5346..5fd72fb963 160000 --- a/frozen/Adafruit_CircuitPython_Motor +++ b/frozen/Adafruit_CircuitPython_Motor @@ -1 +1 @@ -Subproject commit 434e5b5346cb0a1a9eb15989b00278be87cb2ff1 +Subproject commit 5fd72fb963c4a0318d29282ca2cc988f19787fda diff --git a/frozen/Adafruit_CircuitPython_Register b/frozen/Adafruit_CircuitPython_Register index 6143ec2a96..56358b4494 160000 --- a/frozen/Adafruit_CircuitPython_Register +++ b/frozen/Adafruit_CircuitPython_Register @@ -1 +1 @@ -Subproject commit 6143ec2a96a6d218041e9cab5968de26702d7bbf +Subproject commit 56358b4494da825cd99a56a854119f926abca670 diff --git a/frozen/Adafruit_CircuitPython_Requests b/frozen/Adafruit_CircuitPython_Requests index 43017e30a1..41de8b3c05 160000 --- a/frozen/Adafruit_CircuitPython_Requests +++ b/frozen/Adafruit_CircuitPython_Requests @@ -1 +1 @@ -Subproject commit 43017e30a1e772b67ac68293a944e863c031e389 +Subproject commit 41de8b3c05dd78d7be8893a0f6cb47a7e9b421a2 diff --git a/frozen/Adafruit_CircuitPython_Thermistor b/frozen/Adafruit_CircuitPython_Thermistor index fb773e0ed1..b5bbdbd56c 160000 --- a/frozen/Adafruit_CircuitPython_Thermistor +++ b/frozen/Adafruit_CircuitPython_Thermistor @@ -1 +1 @@ -Subproject commit fb773e0ed1891cda2ace6271fafc5312e167d275 +Subproject commit b5bbdbd56ca205c581ba2c84d927ef99befce88e diff --git a/frozen/Adafruit_CircuitPython_seesaw b/frozen/Adafruit_CircuitPython_seesaw index 88738da275..76c0dd1329 160000 --- a/frozen/Adafruit_CircuitPython_seesaw +++ b/frozen/Adafruit_CircuitPython_seesaw @@ -1 +1 @@ -Subproject commit 88738da275a83acabb14b7140d1c79b33cdc7b02 +Subproject commit 76c0dd13294ce8ae0518cb9882dcad5d3668977e diff --git a/frozen/circuitpython-stage b/frozen/circuitpython-stage index 9596a5904e..0d2c083a2f 160000 --- a/frozen/circuitpython-stage +++ b/frozen/circuitpython-stage @@ -1 +1 @@ -Subproject commit 9596a5904ed757e6fbffcf03e7aa77ae9ecf5223 +Subproject commit 0d2c083a2fb57a1562d4806775f45273abbfbfae diff --git a/lib/mp3 b/lib/mp3 index bc58a65496..c3c664bf4d 160000 --- a/lib/mp3 +++ b/lib/mp3 @@ -1 +1 @@ -Subproject commit bc58a654964c799e972719a63ff12694998f3549 +Subproject commit c3c664bf4db6a36d11808dfcbb5dbf7cff1715b8 diff --git a/lib/protomatter b/lib/protomatter index 761d6437e8..9f71088d2c 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit 761d6437e8cd6a131d51de96974337121a9c7164 +Subproject commit 9f71088d2c32206c6f0495704ae0c040426d5764 diff --git a/lib/tinyusb b/lib/tinyusb index 22100b252f..dc5445e2f4 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit 22100b252fc2eb8f51ed407949645653c4880fd9 +Subproject commit dc5445e2f45cb348a44fe24fc1be4bc8b5ba5bab diff --git a/ports/atmel-samd/asf4 b/ports/atmel-samd/asf4 index 35a1525796..039b5f3bbc 160000 --- a/ports/atmel-samd/asf4 +++ b/ports/atmel-samd/asf4 @@ -1 +1 @@ -Subproject commit 35a1525796c7ef8a3893d90befdad2f267fca20e +Subproject commit 039b5f3bbc3f4ba4421e581db290560d59fef625 diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 0f5f1522d0..6b531fc923 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 0f5f1522d09c8fa7d858edec484a994c21c59668 +Subproject commit 6b531fc923d9f02b14bd731a5f584ddf716e8773 diff --git a/ports/cxd56/spresense-exported-sdk b/ports/cxd56/spresense-exported-sdk index c991d439fa..7f6568c7f4 160000 --- a/ports/cxd56/spresense-exported-sdk +++ b/ports/cxd56/spresense-exported-sdk @@ -1 +1 @@ -Subproject commit c991d439fac9c23cfcac0da16fe8055f818d40a4 +Subproject commit 7f6568c7f4898cdb24a2f06040784a836050686e diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index 160ba4924d..0daf6e0e41 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit 160ba4924d8b588e718f76e3a0d0e92c11052fa3 +Subproject commit 0daf6e0e41f95d22d193d08941a00df9525bc405 diff --git a/ports/stm/st_driver b/ports/stm/st_driver index 1900834751..3fc2e0f3db 160000 --- a/ports/stm/st_driver +++ b/ports/stm/st_driver @@ -1 +1 @@ -Subproject commit 1900834751fd6754457874b8c971690bab33e0a7 +Subproject commit 3fc2e0f3db155b33177bb0705e0dd65cadb58412 diff --git a/shared-bindings/_typing/__init__ 2.pyi b/shared-bindings/_typing/__init__ 2.pyi new file mode 100644 index 0000000000..48e68a8d57 --- /dev/null +++ b/shared-bindings/_typing/__init__ 2.pyi @@ -0,0 +1,54 @@ +"""Types for the C-level protocols""" + +from typing import Union + +import array +import audiocore +import audiomixer +import audiomp3 +import rgbmatrix +import ulab + +ReadableBuffer = Union[ + bytes, bytearray, memoryview, array.array, ulab.array, rgbmatrix.RGBMatrix +] +"""Classes that implement the readable buffer protocol + + - `bytes` + - `bytearray` + - `memoryview` + - `array.array` + - `ulab.array` + - `rgbmatrix.RGBMatrix` +""" + +WriteableBuffer = Union[ + bytearray, memoryview, array.array, ulab.array, rgbmatrix.RGBMatrix +] +"""Classes that implement the writeable buffer protocol + + - `bytearray` + - `memoryview` + - `array.array` + - `ulab.array` + - `rgbmatrix.RGBMatrix` +""" + +AudioSample = Union[ + audiocore.WaveFile, audiocore.RawSample, audiomixer.Mixer, audiomp3.MP3Decoder +] +"""Classes that implement the audiosample protocol + + - `audiocore.WaveFile` + - `audiocore.RawSample` + - `audiomixer.Mixer` + - `audiomp3.MP3Decoder` + + You can play these back with `audioio.AudioOut`, `audiobusio.I2SOut` or `audiopwmio.PWMAudioOut`. +""" + +FrameBuffer = Union[rgbmatrix.RGBMatrix] +"""Classes that implement the framebuffer protocol + + - `rgbmatrix.RGBMatrix` +""" diff --git a/shared-bindings/gnss/GNSS 2.c b/shared-bindings/gnss/GNSS 2.c new file mode 100644 index 0000000000..087c353953 --- /dev/null +++ b/shared-bindings/gnss/GNSS 2.c @@ -0,0 +1,205 @@ +// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation +// +// SPDX-License-Identifier: MIT + +#include "shared-bindings/gnss/GNSS.h" +#include "shared-bindings/time/__init__.h" +#include "shared-bindings/util.h" + +#include "py/objproperty.h" +#include "py/runtime.h" + +//| class GNSS: +//| """Get updated positioning information from Global Navigation Satellite System (GNSS) +//| +//| Usage:: +//| +//| import gnss +//| import time +//| +//| nav = gnss.GNSS([gnss.SatelliteSystem.GPS, gnss.SatelliteSystem.GLONASS]) +//| last_print = time.monotonic() +//| while True: +//| nav.update() +//| current = time.monotonic() +//| if current - last_print >= 1.0: +//| last_print = current +//| if nav.fix is gnss.PositionFix.INVALID: +//| print("Waiting for fix...") +//| continue +//| print("Latitude: {0:.6f} degrees".format(nav.latitude)) +//| print("Longitude: {0:.6f} degrees".format(nav.longitude))""" +//| + +//| def __init__(self, system: Union[SatelliteSystem, List[SatelliteSystem]]) -> None: +//| """Turn on the GNSS. +//| +//| :param system: satellite system to use""" +//| ... +//| +STATIC mp_obj_t gnss_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + gnss_obj_t *self = m_new_obj(gnss_obj_t); + self->base.type = &gnss_type; + enum { ARG_system }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_system, MP_ARG_REQUIRED | MP_ARG_OBJ }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + unsigned long selection = 0; + if (MP_OBJ_IS_TYPE(args[ARG_system].u_obj, &gnss_satellitesystem_type)) { + selection |= gnss_satellitesystem_obj_to_type(args[ARG_system].u_obj); + } else if (MP_OBJ_IS_TYPE(args[ARG_system].u_obj, &mp_type_list)) { + size_t systems_size = 0; + mp_obj_t *systems; + mp_obj_list_get(args[ARG_system].u_obj, &systems_size, &systems); + for (size_t i = 0; i < systems_size; ++i) { + if (!MP_OBJ_IS_TYPE(systems[i], &gnss_satellitesystem_type)) { + mp_raise_TypeError(translate("System entry must be gnss.SatelliteSystem")); + } + selection |= gnss_satellitesystem_obj_to_type(systems[i]); + } + } else { + mp_raise_TypeError(translate("System entry must be gnss.SatelliteSystem")); + } + + common_hal_gnss_construct(self, selection); + return MP_OBJ_FROM_PTR(self); +} + +//| def deinit(self) -> None: +//| """Turn off the GNSS.""" +//| ... +//| +STATIC mp_obj_t gnss_obj_deinit(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_gnss_deinit(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_deinit_obj, gnss_obj_deinit); + +STATIC void check_for_deinit(gnss_obj_t *self) { + if (common_hal_gnss_deinited(self)) { + raise_deinited_error(); + } +} + +//| def update(self) -> None: +//| """Update GNSS positioning information.""" +//| ... +//| +STATIC mp_obj_t gnss_obj_update(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + common_hal_gnss_update(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_update_obj, gnss_obj_update); + +//| latitude: float +//| """Latitude of current position in degrees (float).""" +//| +STATIC mp_obj_t gnss_obj_get_latitude(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_float(common_hal_gnss_get_latitude(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_latitude_obj, gnss_obj_get_latitude); + +const mp_obj_property_t gnss_latitude_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&gnss_get_latitude_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| longitude: float +//| """Longitude of current position in degrees (float).""" +//| +STATIC mp_obj_t gnss_obj_get_longitude(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_float(common_hal_gnss_get_longitude(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_longitude_obj, gnss_obj_get_longitude); + +const mp_obj_property_t gnss_longitude_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&gnss_get_longitude_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| altitude: float +//| """Altitude of current position in meters (float).""" +//| +STATIC mp_obj_t gnss_obj_get_altitude(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_float(common_hal_gnss_get_altitude(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_altitude_obj, gnss_obj_get_altitude); + +const mp_obj_property_t gnss_altitude_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&gnss_get_altitude_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| timestamp: time.struct_time +//| """Time when the position data was updated.""" +//| +STATIC mp_obj_t gnss_obj_get_timestamp(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + timeutils_struct_time_t tm; + common_hal_gnss_get_timestamp(self, &tm); + return struct_time_from_tm(&tm); +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_timestamp_obj, gnss_obj_get_timestamp); + +const mp_obj_property_t gnss_timestamp_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&gnss_get_timestamp_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| fix: PositionFix +//| """Fix mode.""" +//| +STATIC mp_obj_t gnss_obj_get_fix(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return gnss_positionfix_type_to_obj(common_hal_gnss_get_fix(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_fix_obj, gnss_obj_get_fix); + +const mp_obj_property_t gnss_fix_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&gnss_get_fix_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +STATIC const mp_rom_map_elem_t gnss_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&gnss_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_update), MP_ROM_PTR(&gnss_update_obj) }, + + { MP_ROM_QSTR(MP_QSTR_latitude), MP_ROM_PTR(&gnss_latitude_obj) }, + { MP_ROM_QSTR(MP_QSTR_longitude), MP_ROM_PTR(&gnss_longitude_obj) }, + { MP_ROM_QSTR(MP_QSTR_altitude), MP_ROM_PTR(&gnss_altitude_obj) }, + { MP_ROM_QSTR(MP_QSTR_timestamp), MP_ROM_PTR(&gnss_timestamp_obj) }, + { MP_ROM_QSTR(MP_QSTR_fix), MP_ROM_PTR(&gnss_fix_obj) } +}; +STATIC MP_DEFINE_CONST_DICT(gnss_locals_dict, gnss_locals_dict_table); + +const mp_obj_type_t gnss_type = { + { &mp_type_type }, + .name = MP_QSTR_GNSS, + .make_new = gnss_make_new, + .locals_dict = (mp_obj_dict_t*)&gnss_locals_dict, +}; diff --git a/shared-bindings/gnss/GNSS 2.h b/shared-bindings/gnss/GNSS 2.h new file mode 100644 index 0000000000..60069a90a9 --- /dev/null +++ b/shared-bindings/gnss/GNSS 2.h @@ -0,0 +1,27 @@ +// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation +// +// SPDX-License-Identifier: MIT + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_GNSS_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_GNSS_H + +#include "common-hal/gnss/GNSS.h" +#include "shared-bindings/gnss/SatelliteSystem.h" +#include "shared-bindings/gnss/PositionFix.h" + +#include "lib/timeutils/timeutils.h" + +extern const mp_obj_type_t gnss_type; + +void common_hal_gnss_construct(gnss_obj_t *self, unsigned long selection); +void common_hal_gnss_deinit(gnss_obj_t *self); +bool common_hal_gnss_deinited(gnss_obj_t *self); +void common_hal_gnss_update(gnss_obj_t *self); + +mp_float_t common_hal_gnss_get_latitude(gnss_obj_t *self); +mp_float_t common_hal_gnss_get_longitude(gnss_obj_t *self); +mp_float_t common_hal_gnss_get_altitude(gnss_obj_t *self); +void common_hal_gnss_get_timestamp(gnss_obj_t *self, timeutils_struct_time_t *tm); +gnss_positionfix_t common_hal_gnss_get_fix(gnss_obj_t *self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_GNSS_H diff --git a/shared-bindings/gnss/PositionFix 2.c b/shared-bindings/gnss/PositionFix 2.c new file mode 100644 index 0000000000..e60611d705 --- /dev/null +++ b/shared-bindings/gnss/PositionFix 2.c @@ -0,0 +1,80 @@ +// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation +// +// SPDX-License-Identifier: MIT + +#include "shared-bindings/gnss/PositionFix.h" + +//| class PositionFix: +//| """Position fix mode""" +//| +//| def __init__(self) -> None: +//| """Enum-like class to define the position fix mode.""" +//| +//| INVALID: PositionFix +//| """No measurement.""" +//| +//| FIX_2D: PositionFix +//| """2D fix.""" +//| +//| FIX_3D: PositionFix +//| """3D fix.""" +//| +const mp_obj_type_t gnss_positionfix_type; + +const gnss_positionfix_obj_t gnss_positionfix_invalid_obj = { + { &gnss_positionfix_type }, +}; + +const gnss_positionfix_obj_t gnss_positionfix_fix2d_obj = { + { &gnss_positionfix_type }, +}; + +const gnss_positionfix_obj_t gnss_positionfix_fix3d_obj = { + { &gnss_positionfix_type }, +}; + +gnss_positionfix_t gnss_positionfix_obj_to_type(mp_obj_t obj) { + gnss_positionfix_t posfix = POSITIONFIX_INVALID; + if (obj == MP_ROM_PTR(&gnss_positionfix_fix2d_obj)) { + posfix = POSITIONFIX_2D; + } else if (obj == MP_ROM_PTR(&gnss_positionfix_fix3d_obj)) { + posfix = POSITIONFIX_3D; + } + return posfix; +} + +mp_obj_t gnss_positionfix_type_to_obj(gnss_positionfix_t posfix) { + switch (posfix) { + case POSITIONFIX_2D: + return (mp_obj_t)MP_ROM_PTR(&gnss_positionfix_fix2d_obj); + case POSITIONFIX_3D: + return (mp_obj_t)MP_ROM_PTR(&gnss_positionfix_fix3d_obj); + case POSITIONFIX_INVALID: + default: + return (mp_obj_t)MP_ROM_PTR(&gnss_positionfix_invalid_obj); + } +} + +STATIC const mp_rom_map_elem_t gnss_positionfix_locals_dict_table[] = { + {MP_ROM_QSTR(MP_QSTR_INVALID), MP_ROM_PTR(&gnss_positionfix_invalid_obj)}, + {MP_ROM_QSTR(MP_QSTR_FIX_2D), MP_ROM_PTR(&gnss_positionfix_fix2d_obj)}, + {MP_ROM_QSTR(MP_QSTR_FIX_3D), MP_ROM_PTR(&gnss_positionfix_fix3d_obj)}, +}; +STATIC MP_DEFINE_CONST_DICT(gnss_positionfix_locals_dict, gnss_positionfix_locals_dict_table); + +STATIC void gnss_positionfix_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { + qstr posfix = MP_QSTR_INVALID; + if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_positionfix_fix2d_obj)) { + posfix = MP_QSTR_FIX_2D; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_positionfix_fix3d_obj)) { + posfix = MP_QSTR_FIX_3D; + } + mp_printf(print, "%q.%q.%q", MP_QSTR_gnss, MP_QSTR_PositionFix, posfix); +} + +const mp_obj_type_t gnss_positionfix_type = { + { &mp_type_type }, + .name = MP_QSTR_PositionFix, + .print = gnss_positionfix_print, + .locals_dict = (mp_obj_t)&gnss_positionfix_locals_dict, +}; diff --git a/shared-bindings/gnss/PositionFix 2.h b/shared-bindings/gnss/PositionFix 2.h new file mode 100644 index 0000000000..34090872cc --- /dev/null +++ b/shared-bindings/gnss/PositionFix 2.h @@ -0,0 +1,28 @@ +// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation +// +// SPDX-License-Identifier: MIT + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_POSITIONFIX_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_POSITIONFIX_H + +#include "py/obj.h" + +typedef enum { + POSITIONFIX_INVALID, + POSITIONFIX_2D, + POSITIONFIX_3D, +} gnss_positionfix_t; + +const mp_obj_type_t gnss_positionfix_type; + +gnss_positionfix_t gnss_positionfix_obj_to_type(mp_obj_t obj); +mp_obj_t gnss_positionfix_type_to_obj(gnss_positionfix_t mode); + +typedef struct { + mp_obj_base_t base; +} gnss_positionfix_obj_t; +extern const gnss_positionfix_obj_t gnss_positionfix_invalid_obj; +extern const gnss_positionfix_obj_t gnss_positionfix_fix2d_obj; +extern const gnss_positionfix_obj_t gnss_positionfix_fix3d_obj; + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_POSITIONFIX_H diff --git a/shared-bindings/gnss/SatelliteSystem 2.c b/shared-bindings/gnss/SatelliteSystem 2.c new file mode 100644 index 0000000000..7d66727b8d --- /dev/null +++ b/shared-bindings/gnss/SatelliteSystem 2.c @@ -0,0 +1,113 @@ +// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation +// +// SPDX-License-Identifier: MIT + +#include "shared-bindings/gnss/SatelliteSystem.h" + +//| class SatelliteSystem: +//| """Satellite system type""" +//| +//| def __init__(self) -> None: +//| """Enum-like class to define the satellite system type.""" +//| +//| GPS: SatelliteSystem +//| """Global Positioning System.""" +//| +//| GLONASS: SatelliteSystem +//| """GLObal NAvigation Satellite System.""" +//| +//| SBAS: SatelliteSystem +//| """Satellite Based Augmentation System.""" +//| +//| QZSS_L1CA: SatelliteSystem +//| """Quasi-Zenith Satellite System L1C/A.""" +//| +//| QZSS_L1S: SatelliteSystem +//| """Quasi-Zenith Satellite System L1S.""" +//| +const mp_obj_type_t gnss_satellitesystem_type; + +const gnss_satellitesystem_obj_t gnss_satellitesystem_gps_obj = { + { &gnss_satellitesystem_type }, +}; + +const gnss_satellitesystem_obj_t gnss_satellitesystem_glonass_obj = { + { &gnss_satellitesystem_type }, +}; + +const gnss_satellitesystem_obj_t gnss_satellitesystem_sbas_obj = { + { &gnss_satellitesystem_type }, +}; + +const gnss_satellitesystem_obj_t gnss_satellitesystem_qzss_l1ca_obj = { + { &gnss_satellitesystem_type }, +}; + +const gnss_satellitesystem_obj_t gnss_satellitesystem_qzss_l1s_obj = { + { &gnss_satellitesystem_type }, +}; + +gnss_satellitesystem_t gnss_satellitesystem_obj_to_type(mp_obj_t obj) { + if (obj == MP_ROM_PTR(&gnss_satellitesystem_gps_obj)) { + return SATELLITESYSTEM_GPS; + } else if (obj == MP_ROM_PTR(&gnss_satellitesystem_glonass_obj)) { + return SATELLITESYSTEM_GLONASS; + } else if (obj == MP_ROM_PTR(&gnss_satellitesystem_sbas_obj)) { + return SATELLITESYSTEM_SBAS; + } else if (obj == MP_ROM_PTR(&gnss_satellitesystem_qzss_l1ca_obj)) { + return SATELLITESYSTEM_QZSS_L1CA; + } else if (obj == MP_ROM_PTR(&gnss_satellitesystem_qzss_l1s_obj)) { + return SATELLITESYSTEM_QZSS_L1S; + } + return SATELLITESYSTEM_NONE; +} + +mp_obj_t gnss_satellitesystem_type_to_obj(gnss_satellitesystem_t system) { + switch (system) { + case SATELLITESYSTEM_GPS: + return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_gps_obj); + case SATELLITESYSTEM_GLONASS: + return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_glonass_obj); + case SATELLITESYSTEM_SBAS: + return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_sbas_obj); + case SATELLITESYSTEM_QZSS_L1CA: + return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_qzss_l1ca_obj); + case SATELLITESYSTEM_QZSS_L1S: + return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_qzss_l1s_obj); + case SATELLITESYSTEM_NONE: + default: + return (mp_obj_t)MP_ROM_PTR(&mp_const_none_obj); + } +} + +STATIC const mp_rom_map_elem_t gnss_satellitesystem_locals_dict_table[] = { + {MP_ROM_QSTR(MP_QSTR_GPS), MP_ROM_PTR(&gnss_satellitesystem_gps_obj)}, + {MP_ROM_QSTR(MP_QSTR_GLONASS), MP_ROM_PTR(&gnss_satellitesystem_glonass_obj)}, + {MP_ROM_QSTR(MP_QSTR_SBAS), MP_ROM_PTR(&gnss_satellitesystem_sbas_obj)}, + {MP_ROM_QSTR(MP_QSTR_QZSS_L1CA), MP_ROM_PTR(&gnss_satellitesystem_qzss_l1ca_obj)}, + {MP_ROM_QSTR(MP_QSTR_QZSS_L1S), MP_ROM_PTR(&gnss_satellitesystem_qzss_l1s_obj)}, +}; +STATIC MP_DEFINE_CONST_DICT(gnss_satellitesystem_locals_dict, gnss_satellitesystem_locals_dict_table); + +STATIC void gnss_satellitesystem_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { + qstr system = MP_QSTR_None; + if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_gps_obj)) { + system = MP_QSTR_GPS; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_glonass_obj)) { + system = MP_QSTR_GLONASS; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_sbas_obj)) { + system = MP_QSTR_SBAS; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_qzss_l1ca_obj)) { + system = MP_QSTR_QZSS_L1CA; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_qzss_l1s_obj)) { + system = MP_QSTR_QZSS_L1S; + } + mp_printf(print, "%q.%q.%q", MP_QSTR_gnss, MP_QSTR_SatelliteSystem, system); +} + +const mp_obj_type_t gnss_satellitesystem_type = { + { &mp_type_type }, + .name = MP_QSTR_SatelliteSystem, + .print = gnss_satellitesystem_print, + .locals_dict = (mp_obj_t)&gnss_satellitesystem_locals_dict, +}; diff --git a/shared-bindings/gnss/SatelliteSystem 2.h b/shared-bindings/gnss/SatelliteSystem 2.h new file mode 100644 index 0000000000..17f1550028 --- /dev/null +++ b/shared-bindings/gnss/SatelliteSystem 2.h @@ -0,0 +1,33 @@ +// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation +// +// SPDX-License-Identifier: MIT + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_SATELLITESYSTEM_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_SATELLITESYSTEM_H + +#include "py/obj.h" + +typedef enum { + SATELLITESYSTEM_NONE = 0, + SATELLITESYSTEM_GPS = (1U << 0), + SATELLITESYSTEM_GLONASS = (1U << 1), + SATELLITESYSTEM_SBAS = (1U << 2), + SATELLITESYSTEM_QZSS_L1CA = (1U << 3), + SATELLITESYSTEM_QZSS_L1S = (1U << 4), +} gnss_satellitesystem_t; + +const mp_obj_type_t gnss_satellitesystem_type; + +gnss_satellitesystem_t gnss_satellitesystem_obj_to_type(mp_obj_t obj); +mp_obj_t gnss_satellitesystem_type_to_obj(gnss_satellitesystem_t mode); + +typedef struct { + mp_obj_base_t base; +} gnss_satellitesystem_obj_t; +extern const gnss_satellitesystem_obj_t gnss_satellitesystem_gps_obj; +extern const gnss_satellitesystem_obj_t gnss_satellitesystem_glonass_obj; +extern const gnss_satellitesystem_obj_t gnss_satellitesystem_sbas_obj; +extern const gnss_satellitesystem_obj_t gnss_satellitesystem_qzss_l1ca_obj; +extern const gnss_satellitesystem_obj_t gnss_satellitesystem_qzss_l1s_obj; + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_SATELLITESYSTEM_H diff --git a/shared-bindings/gnss/__init__ 2.c b/shared-bindings/gnss/__init__ 2.c new file mode 100644 index 0000000000..4b0d312ae6 --- /dev/null +++ b/shared-bindings/gnss/__init__ 2.c @@ -0,0 +1,31 @@ +// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation +// +// SPDX-License-Identifier: MIT + +#include "py/obj.h" +#include "py/runtime.h" +#include "py/mphal.h" +#include "shared-bindings/gnss/GNSS.h" +#include "shared-bindings/gnss/SatelliteSystem.h" +#include "shared-bindings/gnss/PositionFix.h" +#include "shared-bindings/util.h" + +//| """Global Navigation Satellite System +//| +//| The `gnss` module contains classes to control the GNSS and acquire positioning information.""" +//| +STATIC const mp_rom_map_elem_t gnss_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_gnss) }, + { MP_ROM_QSTR(MP_QSTR_GNSS), MP_ROM_PTR(&gnss_type) }, + + // Enum-like Classes. + { MP_ROM_QSTR(MP_QSTR_SatelliteSystem), MP_ROM_PTR(&gnss_satellitesystem_type) }, + { MP_ROM_QSTR(MP_QSTR_PositionFix), MP_ROM_PTR(&gnss_positionfix_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(gnss_module_globals, gnss_module_globals_table); + +const mp_obj_module_t gnss_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&gnss_module_globals, +}; diff --git a/shared-bindings/i2cperipheral/I2CPeripheral 2.c b/shared-bindings/i2cperipheral/I2CPeripheral 2.c new file mode 100644 index 0000000000..b5ac861b4e --- /dev/null +++ b/shared-bindings/i2cperipheral/I2CPeripheral 2.c @@ -0,0 +1,436 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Noralf Trønnes + * + * 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/i2cperipheral/I2CPeripheral.h" +#include "shared-bindings/time/__init__.h" +#include "shared-bindings/util.h" + +#include "lib/utils/buffer_helper.h" +#include "lib/utils/context_manager_helpers.h" +#include "lib/utils/interrupt_char.h" + +#include "py/mperrno.h" +#include "py/mphal.h" +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/runtime.h" + +STATIC mp_obj_t mp_obj_new_i2cperipheral_i2c_peripheral_request(i2cperipheral_i2c_peripheral_obj_t *peripheral, uint8_t address, bool is_read, bool is_restart) { + i2cperipheral_i2c_peripheral_request_obj_t *self = m_new_obj(i2cperipheral_i2c_peripheral_request_obj_t); + self->base.type = &i2cperipheral_i2c_peripheral_request_type; + self->peripheral = peripheral; + self->address = address; + self->is_read = is_read; + self->is_restart = is_restart; + return (mp_obj_t)self; +} + +//| class I2CPeripheral: +//| """Two wire serial protocol peripheral""" +//| +//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, addresses: Sequence[int], smbus: bool = False) -> None: +//| """I2C is a two-wire protocol for communicating between devices. +//| This implements the peripheral (sensor, secondary) side. +//| +//| :param ~microcontroller.Pin scl: The clock pin +//| :param ~microcontroller.Pin sda: The data pin +//| :param addresses: The I2C addresses to respond to (how many is hw dependent). +//| :type addresses: list[int] +//| :param bool smbus: Use SMBUS timings if the hardware supports it""" +//| ... +//| +STATIC mp_obj_t i2cperipheral_i2c_peripheral_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + i2cperipheral_i2c_peripheral_obj_t *self = m_new_obj(i2cperipheral_i2c_peripheral_obj_t); + self->base.type = &i2cperipheral_i2c_peripheral_type; + enum { ARG_scl, ARG_sda, ARG_addresses, ARG_smbus }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_scl, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_sda, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_addresses, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_smbus, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + const mcu_pin_obj_t* scl = validate_obj_is_free_pin(args[ARG_scl].u_obj); + const mcu_pin_obj_t* sda = validate_obj_is_free_pin(args[ARG_sda].u_obj); + + mp_obj_iter_buf_t iter_buf; + mp_obj_t iterable = mp_getiter(args[ARG_addresses].u_obj, &iter_buf); + mp_obj_t item; + uint8_t *addresses = NULL; + unsigned int i = 0; + while ((item = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) { + mp_int_t value; + if (!mp_obj_get_int_maybe(item, &value)) { + mp_raise_TypeError_varg(translate("can't convert %q to %q"), MP_QSTR_address, MP_QSTR_int); + } + if (value < 0x00 || value > 0x7f) { + mp_raise_ValueError(translate("address out of bounds")); + } + addresses = m_renew(uint8_t, addresses, i, i + 1); + addresses[i++] = value; + } + if (i == 0) { + mp_raise_ValueError(translate("addresses is empty")); + } + + common_hal_i2cperipheral_i2c_peripheral_construct(self, scl, sda, addresses, i, args[ARG_smbus].u_bool); + return (mp_obj_t)self; +} + +//| def deinit(self) -> None: +//| """Releases control of the underlying hardware so other classes can use it.""" +//| ... +//| +STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj_deinit(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_type)); + i2cperipheral_i2c_peripheral_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_i2cperipheral_i2c_peripheral_deinit(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(i2cperipheral_i2c_peripheral_deinit_obj, i2cperipheral_i2c_peripheral_obj_deinit); + +//| def __enter__(self) -> I2CPeripheral: +//| """No-op used in Context Managers.""" +//| ... +//| +// Provided by context manager helper. + +//| def __exit__(self) -> None: +//| """Automatically deinitializes the hardware on context exit. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| +STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj___exit__(size_t n_args, const mp_obj_t *args) { + mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cperipheral_i2c_peripheral_type)); + i2cperipheral_i2c_peripheral_obj_t *self = MP_OBJ_TO_PTR(args[0]); + common_hal_i2cperipheral_i2c_peripheral_deinit(self); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral___exit___obj, 4, 4, i2cperipheral_i2c_peripheral_obj___exit__); + +//| def request(self, timeout: float = -1) -> I2CPeripheralRequest: +//| """Wait for an I2C request. +//| +//| :param float timeout: Timeout in seconds. Zero means wait forever, a negative value means check once +//| :return: I2C Slave Request or None if timeout=-1 and there's no request +//| :rtype: ~i2cperipheral.I2CPeripheralRequest""" +//| +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + mp_check_self(MP_OBJ_IS_TYPE(pos_args[0], &i2cperipheral_i2c_peripheral_type)); + i2cperipheral_i2c_peripheral_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + if(common_hal_i2cperipheral_i2c_peripheral_deinited(self)) { + raise_deinited_error(); + } + enum { ARG_timeout }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NEW_SMALL_INT(-1)} }, + }; + 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); + + #if MICROPY_PY_BUILTINS_FLOAT + float f = mp_obj_get_float(args[ARG_timeout].u_obj) * 1000; + int timeout_ms = (int)f; + #else + int timeout_ms = mp_obj_get_int(args[ARG_timeout].u_obj) * 1000; + #endif + + bool forever = false; + uint64_t timeout_end = 0; + if (timeout_ms == 0) { + forever = true; + } else if (timeout_ms > 0) { + timeout_end = common_hal_time_monotonic() + timeout_ms; + } + + int last_error = 0; + + do { + uint8_t address; + bool is_read; + bool is_restart; + + RUN_BACKGROUND_TASKS; + if (mp_hal_is_interrupted()) { + return mp_const_none; + } + + int status = common_hal_i2cperipheral_i2c_peripheral_is_addressed(self, &address, &is_read, &is_restart); + if (status < 0) { + // On error try one more time before bailing out + if (last_error) { + mp_raise_OSError(last_error); + } + last_error = -status; + mp_hal_delay_ms(10); + continue; + } + + last_error = 0; + + if (status == 0) { + mp_hal_delay_us(10); + continue; + } + + return mp_obj_new_i2cperipheral_i2c_peripheral_request(self, address, is_read, is_restart); + } while (forever || common_hal_time_monotonic() < timeout_end); + + if (timeout_ms > 0) { + mp_raise_OSError(MP_ETIMEDOUT); + } + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(i2cperipheral_i2c_peripheral_request_obj, 1, i2cperipheral_i2c_peripheral_request); + +STATIC const mp_rom_map_elem_t i2cperipheral_i2c_peripheral_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2cperipheral_i2c_peripheral___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_request), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_obj) }, + +}; + +STATIC MP_DEFINE_CONST_DICT(i2cperipheral_i2c_peripheral_locals_dict, i2cperipheral_i2c_peripheral_locals_dict_table); + +const mp_obj_type_t i2cperipheral_i2c_peripheral_type = { + { &mp_type_type }, + .name = MP_QSTR_I2CPeripheral, + .make_new = i2cperipheral_i2c_peripheral_make_new, + .locals_dict = (mp_obj_dict_t*)&i2cperipheral_i2c_peripheral_locals_dict, +}; + +//| class I2CPeripheralRequest: +//| +//| def __init__(self, peripheral: i2cperipheral.I2CPeripheral, address: int, is_read: bool, is_restart: bool) -> None: +//| """Information about an I2C transfer request +//| This cannot be instantiated directly, but is returned by :py:meth:`I2CPeripheral.request`. +//| +//| :param peripheral: The I2CPeripheral object receiving this request +//| :param address: I2C address +//| :param is_read: True if the main peripheral is requesting data +//| :param is_restart: Repeated Start Condition""" +//| +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { + mp_arg_check_num(n_args, kw_args, 4, 4, false); + return mp_obj_new_i2cperipheral_i2c_peripheral_request(args[0], mp_obj_get_int(args[1]), mp_obj_is_true(args[2]), mp_obj_is_true(args[3])); +} + +//| def __enter__(self) -> I2CPeripheralRequest: +//| """No-op used in Context Managers.""" +//| ... +//| +// Provided by context manager helper. + +//| def __exit__(self) -> None: +//| """Close the request.""" +//| ... +//| +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_obj___exit__(size_t n_args, const mp_obj_t *args) { + mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); + common_hal_i2cperipheral_i2c_peripheral_close(self->peripheral); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral_request___exit___obj, 4, 4, i2cperipheral_i2c_peripheral_request_obj___exit__); + +//| address: int +//| """The I2C address of the request.""" +//| +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_address(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_int(self->address); +} +MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_address_obj, i2cperipheral_i2c_peripheral_request_get_address); + +//| is_read: bool +//| """The I2C main controller is reading from this peripheral.""" +//| +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_is_read(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_bool(self->is_read); +} +MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_is_read_obj, i2cperipheral_i2c_peripheral_request_get_is_read); + +//| is_restart: bool +//| """Is Repeated Start Condition.""" +//| +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_is_restart(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_bool(self->is_restart); +} +MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_is_restart_obj, i2cperipheral_i2c_peripheral_request_get_is_restart); + +//| def read(self, n: int = -1, ack: bool = True) -> bytearray: +//| """Read data. +//| If ack=False, the caller is responsible for calling :py:meth:`I2CPeripheralRequest.ack`. +//| +//| :param n: Number of bytes to read (negative means all) +//| :param ack: Whether or not to send an ACK after the n'th byte +//| :return: Bytes read""" +//| ... +//| +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + mp_check_self(MP_OBJ_IS_TYPE(pos_args[0], &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + enum { ARG_n, ARG_ack }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_n, MP_ARG_INT, {.u_int = -1} }, + { MP_QSTR_ack, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} }, + }; + 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); + + if (self->is_read) { + mp_raise_OSError(MP_EACCES); + } + + int n = args[ARG_n].u_int; + if (n == 0) { + return mp_obj_new_bytearray(0, NULL); + } + bool ack = args[ARG_ack].u_bool; + + int i = 0; + uint8_t *buffer = NULL; + uint64_t timeout_end = common_hal_time_monotonic() + 10 * 1000; + while (common_hal_time_monotonic() < timeout_end) { + RUN_BACKGROUND_TASKS; + if (mp_hal_is_interrupted()) { + break; + } + + uint8_t data; + int num = common_hal_i2cperipheral_i2c_peripheral_read_byte(self->peripheral, &data); + if (num == 0) { + break; + } + + buffer = m_renew(uint8_t, buffer, i, i + 1); + buffer[i++] = data; + if (i == n) { + if (ack) { + common_hal_i2cperipheral_i2c_peripheral_ack(self->peripheral, true); + } + break; + } + common_hal_i2cperipheral_i2c_peripheral_ack(self->peripheral, true); + } + + return mp_obj_new_bytearray(i, buffer); +} +MP_DEFINE_CONST_FUN_OBJ_KW(i2cperipheral_i2c_peripheral_request_read_obj, 1, i2cperipheral_i2c_peripheral_request_read); + +//| def write(self, buffer: ReadableBuffer) -> int: +//| """Write the data contained in buffer. +//| +//| :param ~_typing.ReadableBuffer buffer: Write out the data in this buffer +//| :return: Number of bytes written""" +//| ... +//| +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_write(mp_obj_t self_in, mp_obj_t buf_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); + + if (!self->is_read) { + mp_raise_OSError(MP_EACCES); + } + + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); + + for (size_t i = 0; i < bufinfo.len; i++) { + RUN_BACKGROUND_TASKS; + if (mp_hal_is_interrupted()) { + break; + } + + int num = common_hal_i2cperipheral_i2c_peripheral_write_byte(self->peripheral, ((uint8_t *)(bufinfo.buf))[i]); + if (num == 0) { + return mp_obj_new_int(i); + } + } + + return mp_obj_new_int(bufinfo.len); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(i2cperipheral_i2c_peripheral_request_write_obj, i2cperipheral_i2c_peripheral_request_write); + +//| def ack(self, ack: bool = True) -> None: +//| """Acknowledge or Not Acknowledge last byte received. +//| Use together with :py:meth:`I2CPeripheralRequest.read` ack=False. +//| +//| :param ack: Whether to send an ACK or NACK""" +//| ... +//| +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_ack(uint n_args, const mp_obj_t *args) { + mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); + bool ack = (n_args == 1) ? true : mp_obj_is_true(args[1]); + + if (self->is_read) { + mp_raise_OSError(MP_EACCES); + } + + common_hal_i2cperipheral_i2c_peripheral_ack(self->peripheral, ack); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral_request_ack_obj, 1, 2, i2cperipheral_i2c_peripheral_request_ack); + +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_close(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); + + common_hal_i2cperipheral_i2c_peripheral_close(self->peripheral); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(i2cperipheral_i2c_peripheral_request_close_obj, i2cperipheral_i2c_peripheral_request_close); + +STATIC const mp_rom_map_elem_t i2cperipheral_i2c_peripheral_request_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_address), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_address_obj) }, + { MP_ROM_QSTR(MP_QSTR_is_read), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_is_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_is_restart), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_is_restart_obj) }, + { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_write_obj) }, + { MP_ROM_QSTR(MP_QSTR_ack), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_ack_obj) }, + { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_close_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(i2cperipheral_i2c_peripheral_request_locals_dict, i2cperipheral_i2c_peripheral_request_locals_dict_table); + +const mp_obj_type_t i2cperipheral_i2c_peripheral_request_type = { + { &mp_type_type }, + .name = MP_QSTR_I2CPeripheralRequest, + .make_new = i2cperipheral_i2c_peripheral_request_make_new, + .locals_dict = (mp_obj_dict_t*)&i2cperipheral_i2c_peripheral_request_locals_dict, +}; diff --git a/shared-bindings/i2cperipheral/I2CPeripheral 2.h b/shared-bindings/i2cperipheral/I2CPeripheral 2.h new file mode 100644 index 0000000000..3035cfbfe7 --- /dev/null +++ b/shared-bindings/i2cperipheral/I2CPeripheral 2.h @@ -0,0 +1,60 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Noralf Trønnes + * + * 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_BUSIO_I2C_SLAVE_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_I2C_SLAVE_H + +#include "py/obj.h" + +#include "common-hal/microcontroller/Pin.h" +#include "common-hal/i2cperipheral/I2CPeripheral.h" + +typedef struct { + mp_obj_base_t base; + i2cperipheral_i2c_peripheral_obj_t *peripheral; + uint16_t address; + bool is_read; + bool is_restart; +} i2cperipheral_i2c_peripheral_request_obj_t; + +extern const mp_obj_type_t i2cperipheral_i2c_peripheral_request_type; + +extern const mp_obj_type_t i2cperipheral_i2c_peripheral_type; + +extern void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_peripheral_obj_t *self, + const mcu_pin_obj_t* scl, const mcu_pin_obj_t* sda, + uint8_t *addresses, unsigned int num_addresses, bool smbus); +extern void common_hal_i2cperipheral_i2c_peripheral_deinit(i2cperipheral_i2c_peripheral_obj_t *self); +extern bool common_hal_i2cperipheral_i2c_peripheral_deinited(i2cperipheral_i2c_peripheral_obj_t *self); + +extern int common_hal_i2cperipheral_i2c_peripheral_is_addressed(i2cperipheral_i2c_peripheral_obj_t *self, + uint8_t *address, bool *is_read, bool *is_restart); +extern int common_hal_i2cperipheral_i2c_peripheral_read_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *data); +extern int common_hal_i2cperipheral_i2c_peripheral_write_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t data); +extern void common_hal_i2cperipheral_i2c_peripheral_ack(i2cperipheral_i2c_peripheral_obj_t *self, bool ack); +extern void common_hal_i2cperipheral_i2c_peripheral_close(i2cperipheral_i2c_peripheral_obj_t *self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_I2C_SLAVE_H diff --git a/shared-bindings/i2cperipheral/__init__ 2.c b/shared-bindings/i2cperipheral/__init__ 2.c new file mode 100644 index 0000000000..e2cb8509d6 --- /dev/null +++ b/shared-bindings/i2cperipheral/__init__ 2.c @@ -0,0 +1,106 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Noralf Trønnes + * + * 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 "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/microcontroller/Pin.h" +//#include "shared-bindings/i2cperipheral/__init__.h" +#include "shared-bindings/i2cperipheral/I2CPeripheral.h" + +#include "py/runtime.h" + +//| """Two wire serial protocol peripheral +//| +//| The `i2cperipheral` module contains classes to support an I2C peripheral. +//| +//| Example emulating a peripheral with 2 addresses (read and write):: +//| +//| import board +//| from i2cperipheral import I2CPeripheral +//| +//| regs = [0] * 16 +//| index = 0 +//| +//| with I2CPeripheral(board.SCL, board.SDA, (0x40, 0x41)) as device: +//| while True: +//| r = device.request() +//| if not r: +//| # Maybe do some housekeeping +//| continue +//| with r: # Closes the transfer if necessary by sending a NACK or feeding dummy bytes +//| if r.address == 0x40: +//| if not r.is_read: # Main write which is Selected read +//| b = r.read(1) +//| if not b or b[0] > 15: +//| break +//| index = b[0] +//| b = r.read(1) +//| if b: +//| regs[index] = b[0] +//| elif r.is_restart: # Combined transfer: This is the Main read message +//| n = r.write(bytes([regs[index]])) +//| #else: +//| # A read transfer is not supported in this example +//| # If the microcontroller tries, it will get 0xff byte(s) by the ctx manager (r.close()) +//| elif r.address == 0x41: +//| if not r.is_read: +//| b = r.read(1) +//| if b and b[0] == 0xde: +//| # do something +//| pass +//| +//| This example sets up an I2C device that can be accessed from Linux like this:: +//| +//| $ i2cget -y 1 0x40 0x01 +//| 0x00 +//| $ i2cset -y 1 0x40 0x01 0xaa +//| $ i2cget -y 1 0x40 0x01 +//| 0xaa +//| +//| .. warning:: +//| I2CPeripheral makes use of clock stretching in order to slow down +//| the host. +//| Make sure the I2C host supports this. +//| +//| Raspberry Pi in particular does not support this with its I2C hw block. +//| This can be worked around by using the ``i2c-gpio`` bit banging driver. +//| Since the RPi firmware uses the hw i2c, it's not possible to emulate a HAT eeprom.""" +//| + +STATIC const mp_rom_map_elem_t i2cperipheral_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_i2cperipheral) }, + { MP_ROM_QSTR(MP_QSTR_I2CPeripheral), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(i2cperipheral_module_globals, i2cperipheral_module_globals_table); + +const mp_obj_module_t i2cperipheral_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&i2cperipheral_module_globals, +}; diff --git a/shared-bindings/memorymonitor/AllocationAlarm 2.c b/shared-bindings/memorymonitor/AllocationAlarm 2.c new file mode 100644 index 0000000000..7de8c12874 --- /dev/null +++ b/shared-bindings/memorymonitor/AllocationAlarm 2.c @@ -0,0 +1,137 @@ +/* + * This file is part of the Micro Python 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 + +#include "py/objproperty.h" +#include "py/runtime.h" +#include "py/runtime0.h" +#include "shared-bindings/memorymonitor/AllocationAlarm.h" +#include "shared-bindings/util.h" +#include "supervisor/shared/translate.h" + +//| class AllocationAlarm: +//| +//| def __init__(self, *, minimum_block_count: int = 1) -> None: +//| """Throw an exception when an allocation of ``minimum_block_count`` or more blocks +//| occurs while active. +//| +//| Track allocations:: +//| +//| import memorymonitor +//| +//| aa = memorymonitor.AllocationAlarm(minimum_block_count=2) +//| x = 2 +//| # Should not allocate any blocks. +//| with aa: +//| x = 5 +//| +//| # Should throw an exception when allocating storage for the 20 bytes. +//| with aa: +//| x = bytearray(20) +//| +//| """ +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationalarm_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_minimum_block_count }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_minimum_block_count, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + mp_int_t minimum_block_count = args[ARG_minimum_block_count].u_int; + if (minimum_block_count < 1) { + mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_minimum_block_count); + } + + memorymonitor_allocationalarm_obj_t *self = m_new_obj(memorymonitor_allocationalarm_obj_t); + self->base.type = &memorymonitor_allocationalarm_type; + + common_hal_memorymonitor_allocationalarm_construct(self, minimum_block_count); + + return MP_OBJ_FROM_PTR(self); +} + +//| def ignore(self, count: int) -> AllocationAlarm: +//| """Sets the number of applicable allocations to ignore before raising the exception. +//| Automatically set back to zero at context exit. +//| +//| Use it within a ``with`` block:: +//| +//| # Will not alarm because the bytearray allocation will be ignored. +//| with aa.ignore(2): +//| x = bytearray(20) +//| """ +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationalarm_obj_ignore(mp_obj_t self_in, mp_obj_t count_obj) { + mp_int_t count = mp_obj_get_int(count_obj); + if (count < 0) { + mp_raise_ValueError_varg(translate("%q must be >= 0"), MP_QSTR_count); + } + common_hal_memorymonitor_allocationalarm_set_ignore(self_in, count); + return self_in; +} +MP_DEFINE_CONST_FUN_OBJ_2(memorymonitor_allocationalarm_ignore_obj, memorymonitor_allocationalarm_obj_ignore); + +//| def __enter__(self) -> AllocationAlarm: +//| """Enables the alarm.""" +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationalarm_obj___enter__(mp_obj_t self_in) { + common_hal_memorymonitor_allocationalarm_resume(self_in); + return self_in; +} +MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationalarm___enter___obj, memorymonitor_allocationalarm_obj___enter__); + +//| def __exit__(self) -> None: +//| """Automatically disables the allocation alarm when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationalarm_obj___exit__(size_t n_args, const mp_obj_t *args) { + (void)n_args; + common_hal_memorymonitor_allocationalarm_set_ignore(args[0], 0); + common_hal_memorymonitor_allocationalarm_pause(args[0]); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(memorymonitor_allocationalarm___exit___obj, 4, 4, memorymonitor_allocationalarm_obj___exit__); + +STATIC const mp_rom_map_elem_t memorymonitor_allocationalarm_locals_dict_table[] = { + // Methods + { MP_ROM_QSTR(MP_QSTR_ignore), MP_ROM_PTR(&memorymonitor_allocationalarm_ignore_obj) }, + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&memorymonitor_allocationalarm___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&memorymonitor_allocationalarm___exit___obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(memorymonitor_allocationalarm_locals_dict, memorymonitor_allocationalarm_locals_dict_table); + +const mp_obj_type_t memorymonitor_allocationalarm_type = { + { &mp_type_type }, + .name = MP_QSTR_AllocationAlarm, + .make_new = memorymonitor_allocationalarm_make_new, + .locals_dict = (mp_obj_dict_t*)&memorymonitor_allocationalarm_locals_dict, +}; diff --git a/shared-bindings/memorymonitor/AllocationAlarm 2.h b/shared-bindings/memorymonitor/AllocationAlarm 2.h new file mode 100644 index 0000000000..304b9c5a72 --- /dev/null +++ b/shared-bindings/memorymonitor/AllocationAlarm 2.h @@ -0,0 +1,39 @@ +/* + * This file is part of the Micro Python 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONALARM_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONALARM_H + +#include "shared-module/memorymonitor/AllocationAlarm.h" + +extern const mp_obj_type_t memorymonitor_allocationalarm_type; + +void common_hal_memorymonitor_allocationalarm_construct(memorymonitor_allocationalarm_obj_t* self, size_t minimum_block_count); +void common_hal_memorymonitor_allocationalarm_pause(memorymonitor_allocationalarm_obj_t* self); +void common_hal_memorymonitor_allocationalarm_resume(memorymonitor_allocationalarm_obj_t* self); +void common_hal_memorymonitor_allocationalarm_set_ignore(memorymonitor_allocationalarm_obj_t* self, mp_int_t count); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONALARM_H diff --git a/shared-bindings/memorymonitor/AllocationSize 2.c b/shared-bindings/memorymonitor/AllocationSize 2.c new file mode 100644 index 0000000000..b35bae3602 --- /dev/null +++ b/shared-bindings/memorymonitor/AllocationSize 2.c @@ -0,0 +1,183 @@ +/* + * This file is part of the Micro Python 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 + +#include "py/objproperty.h" +#include "py/runtime.h" +#include "py/runtime0.h" +#include "shared-bindings/memorymonitor/AllocationSize.h" +#include "shared-bindings/util.h" +#include "supervisor/shared/translate.h" + +//| class AllocationSize: +//| +//| def __init__(self) -> None: +//| """Tracks the number of allocations in power of two buckets. +//| +//| It will have 16 16-bit buckets to track allocation counts. It is total allocations +//| meaning frees are ignored. Reallocated memory is counted twice, at allocation and when +//| reallocated with the larger size. +//| +//| The buckets are measured in terms of blocks which is the finest granularity of the heap. +//| This means bucket 0 will count all allocations less than or equal to the number of bytes +//| per block, typically 16. Bucket 2 will be less than or equal to 4 blocks. See +//| `bytes_per_block` to convert blocks to bytes. +//| +//| Multiple AllocationSizes can be used to track different code boundaries. +//| +//| Track allocations:: +//| +//| import memorymonitor +//| +//| mm = memorymonitor.AllocationSize() +//| with mm: +//| print("hello world" * 3) +//| +//| for bucket, count in enumerate(mm): +//| print("<", 2 ** bucket, count) +//| +//| """ +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationsize_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + memorymonitor_allocationsize_obj_t *self = m_new_obj(memorymonitor_allocationsize_obj_t); + self->base.type = &memorymonitor_allocationsize_type; + + common_hal_memorymonitor_allocationsize_construct(self); + + return MP_OBJ_FROM_PTR(self); +} + +//| def __enter__(self) -> AllocationSize: +//| """Clears counts and resumes tracking.""" +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationsize_obj___enter__(mp_obj_t self_in) { + common_hal_memorymonitor_allocationsize_clear(self_in); + common_hal_memorymonitor_allocationsize_resume(self_in); + return self_in; +} +MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationsize___enter___obj, memorymonitor_allocationsize_obj___enter__); + +//| def __exit__(self) -> None: +//| """Automatically pauses allocation tracking when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationsize_obj___exit__(size_t n_args, const mp_obj_t *args) { + (void)n_args; + common_hal_memorymonitor_allocationsize_pause(args[0]); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(memorymonitor_allocationsize___exit___obj, 4, 4, memorymonitor_allocationsize_obj___exit__); + +//| bytes_per_block: int +//| """Number of bytes per block""" +//| +STATIC mp_obj_t memorymonitor_allocationsize_obj_get_bytes_per_block(mp_obj_t self_in) { + memorymonitor_allocationsize_obj_t *self = MP_OBJ_TO_PTR(self_in); + + return MP_OBJ_NEW_SMALL_INT(common_hal_memorymonitor_allocationsize_get_bytes_per_block(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationsize_get_bytes_per_block_obj, memorymonitor_allocationsize_obj_get_bytes_per_block); + +const mp_obj_property_t memorymonitor_allocationsize_bytes_per_block_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&memorymonitor_allocationsize_get_bytes_per_block_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| def __len__(self) -> int: +//| """Returns the number of allocation buckets. +//| +//| This allows you to:: +//| +//| mm = memorymonitor.AllocationSize() +//| print(len(mm))""" +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationsize_unary_op(mp_unary_op_t op, mp_obj_t self_in) { + memorymonitor_allocationsize_obj_t *self = MP_OBJ_TO_PTR(self_in); + uint16_t len = common_hal_memorymonitor_allocationsize_get_len(self); + switch (op) { + case MP_UNARY_OP_BOOL: return mp_obj_new_bool(len != 0); + case MP_UNARY_OP_LEN: return MP_OBJ_NEW_SMALL_INT(len); + default: return MP_OBJ_NULL; // op not supported + } +} + +//| def __getitem__(self, index: int) -> Optional[int]: +//| """Returns the allocation count for the given bucket. +//| +//| This allows you to:: +//| +//| mm = memorymonitor.AllocationSize() +//| print(mm[0])""" +//| ... +//| +STATIC mp_obj_t memorymonitor_allocationsize_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t value) { + if (value == mp_const_none) { + // delete item + mp_raise_AttributeError(translate("Cannot delete values")); + } else { + memorymonitor_allocationsize_obj_t *self = MP_OBJ_TO_PTR(self_in); + + if (MP_OBJ_IS_TYPE(index_obj, &mp_type_slice)) { + mp_raise_NotImplementedError(translate("Slices not supported")); + } else { + size_t index = mp_get_index(&memorymonitor_allocationsize_type, common_hal_memorymonitor_allocationsize_get_len(self), index_obj, false); + if (value == MP_OBJ_SENTINEL) { + // load + return MP_OBJ_NEW_SMALL_INT(common_hal_memorymonitor_allocationsize_get_item(self, index)); + } else { + mp_raise_AttributeError(translate("Read-only")); + } + } + } + return mp_const_none; +} + +STATIC const mp_rom_map_elem_t memorymonitor_allocationsize_locals_dict_table[] = { + // Methods + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&memorymonitor_allocationsize___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&memorymonitor_allocationsize___exit___obj) }, + + // Properties + { MP_ROM_QSTR(MP_QSTR_bytes_per_block), MP_ROM_PTR(&memorymonitor_allocationsize_bytes_per_block_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(memorymonitor_allocationsize_locals_dict, memorymonitor_allocationsize_locals_dict_table); + +const mp_obj_type_t memorymonitor_allocationsize_type = { + { &mp_type_type }, + .name = MP_QSTR_AllocationSize, + .make_new = memorymonitor_allocationsize_make_new, + .subscr = memorymonitor_allocationsize_subscr, + .unary_op = memorymonitor_allocationsize_unary_op, + .getiter = mp_obj_new_generic_iterator, + .locals_dict = (mp_obj_dict_t*)&memorymonitor_allocationsize_locals_dict, +}; diff --git a/shared-bindings/memorymonitor/AllocationSize 2.h b/shared-bindings/memorymonitor/AllocationSize 2.h new file mode 100644 index 0000000000..bcd9514bf2 --- /dev/null +++ b/shared-bindings/memorymonitor/AllocationSize 2.h @@ -0,0 +1,42 @@ +/* + * This file is part of the Micro Python 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONSIZE_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONSIZE_H + +#include "shared-module/memorymonitor/AllocationSize.h" + +extern const mp_obj_type_t memorymonitor_allocationsize_type; + +extern void common_hal_memorymonitor_allocationsize_construct(memorymonitor_allocationsize_obj_t* self); +extern void common_hal_memorymonitor_allocationsize_pause(memorymonitor_allocationsize_obj_t* self); +extern void common_hal_memorymonitor_allocationsize_resume(memorymonitor_allocationsize_obj_t* self); +extern void common_hal_memorymonitor_allocationsize_clear(memorymonitor_allocationsize_obj_t* self); +extern size_t common_hal_memorymonitor_allocationsize_get_bytes_per_block(memorymonitor_allocationsize_obj_t* self); +extern uint16_t common_hal_memorymonitor_allocationsize_get_len(memorymonitor_allocationsize_obj_t* self); +extern uint16_t common_hal_memorymonitor_allocationsize_get_item(memorymonitor_allocationsize_obj_t* self, int16_t index); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONSIZE_H diff --git a/shared-bindings/memorymonitor/__init__ 2.c b/shared-bindings/memorymonitor/__init__ 2.c new file mode 100644 index 0000000000..c101ba5e0d --- /dev/null +++ b/shared-bindings/memorymonitor/__init__ 2.c @@ -0,0 +1,76 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft + * + * 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 "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/memorymonitor/__init__.h" +#include "shared-bindings/memorymonitor/AllocationAlarm.h" +#include "shared-bindings/memorymonitor/AllocationSize.h" + +//| """Memory monitoring helpers""" +//| + +//| class AllocationError(Exception): +//| """Catchall exception for allocation related errors.""" +//| ... +MP_DEFINE_MEMORYMONITOR_EXCEPTION(AllocationError, Exception) + +NORETURN void mp_raise_memorymonitor_AllocationError(const compressed_string_t* fmt, ...) { + va_list argptr; + va_start(argptr,fmt); + mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_memorymonitor_AllocationError, fmt, argptr); + va_end(argptr); + nlr_raise(exception); +} + +STATIC const mp_rom_map_elem_t memorymonitor_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_memorymonitor) }, + { MP_ROM_QSTR(MP_QSTR_AllocationAlarm), MP_ROM_PTR(&memorymonitor_allocationalarm_type) }, + { MP_ROM_QSTR(MP_QSTR_AllocationSize), MP_ROM_PTR(&memorymonitor_allocationsize_type) }, + + // Errors + { MP_ROM_QSTR(MP_QSTR_AllocationError), MP_ROM_PTR(&mp_type_memorymonitor_AllocationError) }, +}; + +STATIC MP_DEFINE_CONST_DICT(memorymonitor_module_globals, memorymonitor_module_globals_table); + +void memorymonitor_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) { + mp_print_kind_t k = kind & ~PRINT_EXC_SUBCLASS; + bool is_subclass = kind & PRINT_EXC_SUBCLASS; + if (!is_subclass && (k == PRINT_EXC)) { + mp_print_str(print, qstr_str(MP_OBJ_QSTR_VALUE(memorymonitor_module_globals_table[0].value))); + mp_print_str(print, "."); + } + mp_obj_exception_print(print, o_in, kind); +} + +const mp_obj_module_t memorymonitor_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&memorymonitor_module_globals, +}; diff --git a/shared-bindings/memorymonitor/__init__ 2.h b/shared-bindings/memorymonitor/__init__ 2.h new file mode 100644 index 0000000000..60fcdc3f62 --- /dev/null +++ b/shared-bindings/memorymonitor/__init__ 2.h @@ -0,0 +1,49 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * 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_MEMORYMONITOR___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR___INIT___H + +#include "py/obj.h" + + +void memorymonitor_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind); + +#define MP_DEFINE_MEMORYMONITOR_EXCEPTION(exc_name, base_name) \ +const mp_obj_type_t mp_type_memorymonitor_ ## exc_name = { \ + { &mp_type_type }, \ + .name = MP_QSTR_ ## exc_name, \ + .print = memorymonitor_exception_print, \ + .make_new = mp_obj_exception_make_new, \ + .attr = mp_obj_exception_attr, \ + .parent = &mp_type_ ## base_name, \ +}; + +extern const mp_obj_type_t mp_type_memorymonitor_AllocationError; + +NORETURN void mp_raise_memorymonitor_AllocationError(const compressed_string_t* msg, ...); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR___INIT___H diff --git a/shared-bindings/sdcardio/SDCard 2.c b/shared-bindings/sdcardio/SDCard 2.c new file mode 100644 index 0000000000..975f8b0953 --- /dev/null +++ b/shared-bindings/sdcardio/SDCard 2.c @@ -0,0 +1,183 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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/obj.h" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "py/objarray.h" + +#include "shared-bindings/sdcardio/SDCard.h" +#include "shared-module/sdcardio/SDCard.h" +#include "common-hal/busio/SPI.h" +#include "shared-bindings/busio/SPI.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/flash.h" + +//| class SDCard: +//| """SD Card Block Interface +//| +//| Controls an SD card over SPI. This built-in module has higher read +//| performance than the library adafruit_sdcard, but it is only compatible with +//| `busio.SPI`, not `bitbangio.SPI`. Usually an SDCard object is used +//| with ``storage.VfsFat`` to allow file I/O to an SD card.""" +//| +//| def __init__(self, bus: busio.SPI, cs: microcontroller.Pin, baudrate: int = 8000000) -> None: +//| """Construct an SPI SD Card object with the given properties +//| +//| :param busio.SPI spi: The SPI bus +//| :param microcontroller.Pin cs: The chip select connected to the card +//| :param int baudrate: The SPI data rate to use after card setup +//| +//| Note that during detection and configuration, a hard-coded low baudrate is used. +//| Data transfers use the specified baurate (rounded down to one that is supported by +//| the microcontroller) +//| +//| Example usage: +//| +//| .. code-block:: python +//| +//| import os +//| +//| import board +//| import sdcardio +//| import storage +//| +//| sd = sdcardio.SDCard(board.SPI(), board.SD_CS) +//| vfs = storage.VfsFat(sd) +//| storage.mount(vfs, '/sd') +//| os.listdir('/sd')""" + +STATIC mp_obj_t sdcardio_sdcard_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_spi, ARG_cs, ARG_baudrate, ARG_sdio, NUM_ARGS }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_spi, MP_ARG_OBJ, {.u_obj = mp_const_none } }, + { MP_QSTR_cs, MP_ARG_OBJ, {.u_obj = mp_const_none } }, + { MP_QSTR_baudrate, MP_ARG_INT, {.u_int = 8000000} }, + { MP_QSTR_sdio, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_int = 8000000} }, + }; + MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + busio_spi_obj_t *spi = validate_obj_is_spi_bus(args[ARG_spi].u_obj); + mcu_pin_obj_t *cs = validate_obj_is_free_pin(args[ARG_cs].u_obj); + + sdcardio_sdcard_obj_t *self = m_new_obj(sdcardio_sdcard_obj_t); + self->base.type = &sdcardio_SDCard_type; + + common_hal_sdcardio_sdcard_construct(self, spi, cs, args[ARG_baudrate].u_int); + + return self; +} + + +//| def count(self) -> int: +//| """Returns the total number of sectors +//| +//| Due to technical limitations, this is a function and not a property. +//| +//| :return: The number of 512-byte blocks, as a number""" +//| +mp_obj_t sdcardio_sdcard_count(mp_obj_t self_in) { + sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t*)self_in; + return mp_obj_new_int_from_ull(common_hal_sdcardio_sdcard_get_blockcount(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_count_obj, sdcardio_sdcard_count); + +//| def deinit(self) -> None: +//| """Disable permanently. +//| +//| :return: None""" +//| +mp_obj_t sdcardio_sdcard_deinit(mp_obj_t self_in) { + sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t*)self_in; + common_hal_sdcardio_sdcard_deinit(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_deinit_obj, sdcardio_sdcard_deinit); + + +//| def readblocks(self, start_block: int, buf: WriteableBuffer) -> None: +//| +//| """Read one or more blocks from the card +//| +//| :param int start_block: The block to start reading from +//| :param ~_typing.WriteableBuffer buf: The buffer to write into. Length must be multiple of 512. +//| +//| :return: None""" +//| + +mp_obj_t sdcardio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { + uint32_t start_block = mp_obj_get_int(start_block_in); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE); + sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t*)self_in; + int result = common_hal_sdcardio_sdcard_readblocks(self, start_block, &bufinfo); + if (result < 0) { + mp_raise_OSError(-result); + } + return mp_const_none; +} + +MP_DEFINE_CONST_FUN_OBJ_3(sdcardio_sdcard_readblocks_obj, sdcardio_sdcard_readblocks); + +//| def writeblocks(self, start_block: int, buf: ReadableBuffer) -> None: +//| +//| """Write one or more blocks to the card +//| +//| :param int start_block: The block to start writing from +//| :param ~_typing.ReadableBuffer buf: The buffer to read from. Length must be multiple of 512. +//| +//| :return: None""" +//| + +mp_obj_t sdcardio_sdcard_writeblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { + uint32_t start_block = mp_obj_get_int(start_block_in); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); + sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t*)self_in; + int result = common_hal_sdcardio_sdcard_writeblocks(self, start_block, &bufinfo); + if (result < 0) { + mp_raise_OSError(-result); + } + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_3(sdcardio_sdcard_writeblocks_obj, sdcardio_sdcard_writeblocks); + +STATIC const mp_rom_map_elem_t sdcardio_sdcard_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_count), MP_ROM_PTR(&sdcardio_sdcard_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&sdcardio_sdcard_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_readblocks), MP_ROM_PTR(&sdcardio_sdcard_readblocks_obj) }, + { MP_ROM_QSTR(MP_QSTR_writeblocks), MP_ROM_PTR(&sdcardio_sdcard_writeblocks_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(sdcardio_sdcard_locals_dict, sdcardio_sdcard_locals_dict_table); + +const mp_obj_type_t sdcardio_SDCard_type = { + { &mp_type_type }, + .name = MP_QSTR_SDCard, + .make_new = sdcardio_sdcard_make_new, + .locals_dict = (mp_obj_dict_t*)&sdcardio_sdcard_locals_dict, +}; diff --git a/shared-bindings/sdcardio/SDCard 2.h b/shared-bindings/sdcardio/SDCard 2.h new file mode 100644 index 0000000000..5986d5b814 --- /dev/null +++ b/shared-bindings/sdcardio/SDCard 2.h @@ -0,0 +1,30 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017, 2018 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2020 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 + +extern const mp_obj_type_t sdcardio_SDCard_type; diff --git a/shared-bindings/sdcardio/__init__ 2.c b/shared-bindings/sdcardio/__init__ 2.c new file mode 100644 index 0000000000..746aa5588e --- /dev/null +++ b/shared-bindings/sdcardio/__init__ 2.c @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/sdcardio/SDCard.h" + +//| """Interface to an SD card via the SPI bus""" + +STATIC const mp_rom_map_elem_t sdcardio_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_sdcardio) }, + { MP_ROM_QSTR(MP_QSTR_SDCard), MP_ROM_PTR(&sdcardio_SDCard_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(sdcardio_module_globals, sdcardio_module_globals_table); + +const mp_obj_module_t sdcardio_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&sdcardio_module_globals, +}; diff --git a/shared-bindings/sdcardio/__init__ 2.h b/shared-bindings/sdcardio/__init__ 2.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shared-bindings/sdioio/SDCard 2.c b/shared-bindings/sdioio/SDCard 2.c new file mode 100644 index 0000000000..aba414cd63 --- /dev/null +++ b/shared-bindings/sdioio/SDCard 2.c @@ -0,0 +1,296 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * 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. + */ + +// This file contains all of the Python API definitions for the +// sdioio.SDCard class. + +#include + +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/sdioio/SDCard.h" +#include "shared-bindings/util.h" + +#include "lib/utils/buffer_helper.h" +#include "lib/utils/context_manager_helpers.h" +#include "py/mperrno.h" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +//| class SDCard: +//| """SD Card Block Interface with SDIO +//| +//| Controls an SD card over SDIO. SDIO is a parallel protocol designed +//| for SD cards. It uses a clock pin, a command pin, and 1 or 4 +//| data pins. It can be operated at a high frequency such as +//| 25MHz. Usually an SDCard object is used with ``storage.VfsFat`` +//| to allow file I/O to an SD card.""" +//| +//| def __init__(self, clock: microcontroller.Pin, command: microcontroller.Pin, data: Sequence[microcontroller.Pin], frequency: int) -> None: +//| """Construct an SDIO SD Card object with the given properties +//| +//| :param ~microcontroller.Pin clock: the pin to use for the clock. +//| :param ~microcontroller.Pin command: the pin to use for the command. +//| :param data: A sequence of pins to use for data. +//| :param frequency: The frequency of the bus in Hz +//| +//| Example usage: +//| +//| .. code-block:: python +//| +//| import os +//| +//| import board +//| import sdioio +//| import storage +//| +//| sd = sdioio.SDCard( +//| clock=board.SDIO_CLOCK, +//| command=board.SDIO_COMMAND, +//| data=board.SDIO_DATA, +//| frequency=25000000) +//| vfs = storage.VfsFat(sd) +//| storage.mount(vfs, '/sd') +//| os.listdir('/sd')""" +//| ... +//| + +STATIC mp_obj_t sdioio_sdcard_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + sdioio_sdcard_obj_t *self = m_new_obj(sdioio_sdcard_obj_t); + self->base.type = &sdioio_SDCard_type; + enum { ARG_clock, ARG_command, ARG_data, ARG_frequency, NUM_ARGS }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_clock, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ }, + { MP_QSTR_command, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ }, + { MP_QSTR_data, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ }, + { MP_QSTR_frequency, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_INT }, + }; + MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + const mcu_pin_obj_t* clock = validate_obj_is_free_pin(args[ARG_clock].u_obj); + const mcu_pin_obj_t* command = validate_obj_is_free_pin(args[ARG_command].u_obj); + mcu_pin_obj_t *data_pins[4]; + uint8_t num_data; + validate_list_is_free_pins(MP_QSTR_data, data_pins, MP_ARRAY_SIZE(data_pins), args[ARG_data].u_obj, &num_data); + + common_hal_sdioio_sdcard_construct(self, clock, command, num_data, data_pins, args[ARG_frequency].u_int); + return MP_OBJ_FROM_PTR(self); +} + +STATIC void check_for_deinit(sdioio_sdcard_obj_t *self) { + if (common_hal_sdioio_sdcard_deinited(self)) { + raise_deinited_error(); + } +} + +//| def configure(self, frequency: int = 0, width: int = 0) -> None: +//| """Configures the SDIO bus. +//| +//| :param int frequency: the desired clock rate in Hertz. The actual clock rate may be higher or lower due to the granularity of available clock settings. Check the `frequency` attribute for the actual clock rate. +//| :param int width: the number of data lines to use. Must be 1 or 4 and must also not exceed the number of data lines at construction +//| +//| .. note:: Leaving a value unspecified or 0 means the current setting is kept""" +//| +STATIC mp_obj_t sdioio_sdcard_configure(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_frequency, ARG_width, NUM_ARGS }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_frequency, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_width, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, + }; + sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + check_for_deinit(self); + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); + mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + mp_int_t frequency = args[ARG_frequency].u_int; + if (frequency < 0) { + mp_raise_ValueError_varg(translate("Invalid %q"), MP_QSTR_baudrate); + } + + uint8_t width = args[ARG_width].u_int; + if (width != 0 && width != 1 && width != 4) { + mp_raise_ValueError_varg(translate("Invalid %q"), MP_QSTR_width); + } + + if (!common_hal_sdioio_sdcard_configure(self, frequency, width)) { + mp_raise_OSError(MP_EIO); + } + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_KW(sdioio_sdcard_configure_obj, 1, sdioio_sdcard_configure); + +//| def count(self) -> int: +//| """Returns the total number of sectors +//| +//| Due to technical limitations, this is a function and not a property. +//| +//| :return: The number of 512-byte blocks, as a number""" +//| +STATIC mp_obj_t sdioio_sdcard_count(mp_obj_t self_in) { + sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_sdioio_sdcard_get_count(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_count_obj, sdioio_sdcard_count); + +//| def readblocks(self, start_block: int, buf: WriteableBuffer) -> None: +//| +//| """Read one or more blocks from the card +//| +//| :param int start_block: The block to start reading from +//| :param ~_typing.WriteableBuffer buf: The buffer to write into. Length must be multiple of 512. +//| +//| :return: None""" +mp_obj_t sdioio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { + uint32_t start_block = mp_obj_get_int(start_block_in); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE); + sdioio_sdcard_obj_t *self = (sdioio_sdcard_obj_t*)self_in; + int result = common_hal_sdioio_sdcard_readblocks(self, start_block, &bufinfo); + if (result < 0) { + mp_raise_OSError(-result); + } + return mp_const_none; +} + +MP_DEFINE_CONST_FUN_OBJ_3(sdioio_sdcard_readblocks_obj, sdioio_sdcard_readblocks); + +//| def writeblocks(self, start_block: int, buf: ReadableBuffer) -> None: +//| +//| """Write one or more blocks to the card +//| +//| :param int start_block: The block to start writing from +//| :param ~_typing.ReadableBuffer buf: The buffer to read from. Length must be multiple of 512. +//| +//| :return: None""" +//| +mp_obj_t sdioio_sdcard_writeblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { + uint32_t start_block = mp_obj_get_int(start_block_in); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); + sdioio_sdcard_obj_t *self = (sdioio_sdcard_obj_t*)self_in; + int result = common_hal_sdioio_sdcard_writeblocks(self, start_block, &bufinfo); + if (result < 0) { + mp_raise_OSError(-result); + } + return mp_const_none; +} + +MP_DEFINE_CONST_FUN_OBJ_3(sdioio_sdcard_writeblocks_obj, sdioio_sdcard_writeblocks); + +//| @property +//| def frequency(self) -> int: +//| """The actual SDIO bus frequency. This may not match the frequency +//| requested due to internal limitations.""" +//| ... +//| +STATIC mp_obj_t sdioio_sdcard_obj_get_frequency(mp_obj_t self_in) { + sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_sdioio_sdcard_get_frequency(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_get_frequency_obj, sdioio_sdcard_obj_get_frequency); + +const mp_obj_property_t sdioio_sdcard_frequency_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&sdioio_sdcard_get_frequency_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| @property +//| def width(self) -> int: +//| """The actual SDIO bus width, in bits""" +//| ... +//| +STATIC mp_obj_t sdioio_sdcard_obj_get_width(mp_obj_t self_in) { + sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_sdioio_sdcard_get_width(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_get_width_obj, sdioio_sdcard_obj_get_width); + +const mp_obj_property_t sdioio_sdcard_width_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&sdioio_sdcard_get_width_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| def deinit(self) -> None: +//| """Disable permanently. +//| +//| :return: None""" +STATIC mp_obj_t sdioio_sdcard_obj_deinit(mp_obj_t self_in) { + sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_sdioio_sdcard_deinit(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_deinit_obj, sdioio_sdcard_obj_deinit); + +//| def __enter__(self) -> SDCard: +//| """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 sdioio_sdcard_obj___exit__(size_t n_args, const mp_obj_t *args) { + (void)n_args; + common_hal_sdioio_sdcard_deinit(args[0]); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(sdioio_sdcard_obj___exit___obj, 4, 4, sdioio_sdcard_obj___exit__); + +STATIC const mp_rom_map_elem_t sdioio_sdcard_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&sdioio_sdcard_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&sdioio_sdcard_obj___exit___obj) }, + + { MP_ROM_QSTR(MP_QSTR_configure), MP_ROM_PTR(&sdioio_sdcard_configure_obj) }, + { MP_ROM_QSTR(MP_QSTR_frequency), MP_ROM_PTR(&sdioio_sdcard_frequency_obj) }, + { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&sdioio_sdcard_width_obj) }, + + { MP_ROM_QSTR(MP_QSTR_count), MP_ROM_PTR(&sdioio_sdcard_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_readblocks), MP_ROM_PTR(&sdioio_sdcard_readblocks_obj) }, + { MP_ROM_QSTR(MP_QSTR_writeblocks), MP_ROM_PTR(&sdioio_sdcard_writeblocks_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(sdioio_sdcard_locals_dict, sdioio_sdcard_locals_dict_table); + +const mp_obj_type_t sdioio_SDCard_type = { + { &mp_type_type }, + .name = MP_QSTR_SDCard, + .make_new = sdioio_sdcard_make_new, + .locals_dict = (mp_obj_dict_t*)&sdioio_sdcard_locals_dict, +}; diff --git a/shared-bindings/sdioio/SDCard 2.h b/shared-bindings/sdioio/SDCard 2.h new file mode 100644 index 0000000000..7f62ee7a65 --- /dev/null +++ b/shared-bindings/sdioio/SDCard 2.h @@ -0,0 +1,66 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * 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_BUSIO_SDIO_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_SDIO_H + +#include "py/obj.h" + +#include "common-hal/microcontroller/Pin.h" +#include "common-hal/sdioio/SDCard.h" + +// Type object used in Python. Should be shared between ports. +extern const mp_obj_type_t sdioio_SDCard_type; + +// Construct an underlying SDIO object. +extern void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, + const mcu_pin_obj_t * clock, const mcu_pin_obj_t * command, + uint8_t num_data, mcu_pin_obj_t ** data, uint32_t frequency); + +extern void common_hal_sdioio_sdcard_deinit(sdioio_sdcard_obj_t *self); +extern bool common_hal_sdioio_sdcard_deinited(sdioio_sdcard_obj_t *self); + +extern bool common_hal_sdioio_sdcard_configure(sdioio_sdcard_obj_t *self, uint32_t baudrate, uint8_t width); + +extern void common_hal_sdioio_sdcard_unlock(sdioio_sdcard_obj_t *self); + +// Return actual SDIO bus frequency. +uint32_t common_hal_sdioio_sdcard_get_frequency(sdioio_sdcard_obj_t* self); + +// Return SDIO bus width. +uint8_t common_hal_sdioio_sdcard_get_width(sdioio_sdcard_obj_t* self); + +// Return number of device blocks +uint32_t common_hal_sdioio_sdcard_get_count(sdioio_sdcard_obj_t* self); + +// Read or write blocks +int common_hal_sdioio_sdcard_readblocks(sdioio_sdcard_obj_t* self, uint32_t start_block, mp_buffer_info_t *bufinfo); +int common_hal_sdioio_sdcard_writeblocks(sdioio_sdcard_obj_t* self, uint32_t start_block, mp_buffer_info_t *bufinfo); + +// This is used by the supervisor to claim SDIO devices indefinitely. +extern void common_hal_sdioio_sdcard_never_reset(sdioio_sdcard_obj_t *self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_SDIO_H diff --git a/shared-bindings/sdioio/__init__ 2.c b/shared-bindings/sdioio/__init__ 2.c new file mode 100644 index 0000000000..b88e5c3a96 --- /dev/null +++ b/shared-bindings/sdioio/__init__ 2.c @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/sdioio/SDCard.h" + +//| """Interface to an SD card via the SDIO bus""" + +STATIC const mp_rom_map_elem_t sdioio_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_sdio) }, + { MP_ROM_QSTR(MP_QSTR_SDCard), MP_ROM_PTR(&sdioio_SDCard_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(sdioio_module_globals, sdioio_module_globals_table); + +const mp_obj_module_t sdioio_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&sdioio_module_globals, +}; diff --git a/shared-bindings/sdioio/__init__ 2.h b/shared-bindings/sdioio/__init__ 2.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shared-module/memorymonitor/AllocationAlarm 2.c b/shared-module/memorymonitor/AllocationAlarm 2.c new file mode 100644 index 0000000000..35f4e4c636 --- /dev/null +++ b/shared-module/memorymonitor/AllocationAlarm 2.c @@ -0,0 +1,94 @@ +/* + * This file is part of the Micro Python 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 "shared-bindings/memorymonitor/__init__.h" +#include "shared-bindings/memorymonitor/AllocationAlarm.h" + +#include "py/gc.h" +#include "py/mpstate.h" +#include "py/runtime.h" + +void common_hal_memorymonitor_allocationalarm_construct(memorymonitor_allocationalarm_obj_t* self, size_t minimum_block_count) { + self->minimum_block_count = minimum_block_count; + self->next = NULL; + self->previous = NULL; +} + +void common_hal_memorymonitor_allocationalarm_set_ignore(memorymonitor_allocationalarm_obj_t* self, mp_int_t count) { + self->count = count; +} + +void common_hal_memorymonitor_allocationalarm_pause(memorymonitor_allocationalarm_obj_t* self) { + // Check to make sure we aren't already paused. We can be if we're exiting from an exception we + // caused. + if (self->previous == NULL) { + return; + } + *self->previous = self->next; + self->next = NULL; + self->previous = NULL; +} + +void common_hal_memorymonitor_allocationalarm_resume(memorymonitor_allocationalarm_obj_t* self) { + if (self->previous != NULL) { + mp_raise_RuntimeError(translate("Already running")); + } + self->next = MP_STATE_VM(active_allocationalarms); + self->previous = (memorymonitor_allocationalarm_obj_t**) &MP_STATE_VM(active_allocationalarms); + if (self->next != NULL) { + self->next->previous = &self->next; + } + MP_STATE_VM(active_allocationalarms) = self; +} + +void memorymonitor_allocationalarms_allocation(size_t block_count) { + memorymonitor_allocationalarm_obj_t* alarm = MP_OBJ_TO_PTR(MP_STATE_VM(active_allocationalarms)); + size_t alert_count = 0; + while (alarm != NULL) { + // Hold onto next in case we remove the alarm from the list. + memorymonitor_allocationalarm_obj_t* next = alarm->next; + if (block_count >= alarm->minimum_block_count) { + if (alarm->count > 0) { + alarm->count--; + } else { + // Uncomment the breakpoint below if you want to use a C debugger to figure out the C + // call stack for an allocation. + // asm("bkpt"); + // Pause now because we may alert when throwing the exception too. + common_hal_memorymonitor_allocationalarm_pause(alarm); + alert_count++; + } + } + alarm = next; + } + if (alert_count > 0) { + mp_raise_memorymonitor_AllocationError(translate("Attempt to allocate %d blocks"), block_count); + } +} + +void memorymonitor_allocationalarms_reset(void) { + MP_STATE_VM(active_allocationalarms) = NULL; +} diff --git a/shared-module/memorymonitor/AllocationAlarm 2.h b/shared-module/memorymonitor/AllocationAlarm 2.h new file mode 100644 index 0000000000..172c24f6c8 --- /dev/null +++ b/shared-module/memorymonitor/AllocationAlarm 2.h @@ -0,0 +1,51 @@ +/* + * This file is part of the Micro Python 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONALARM_H +#define MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONALARM_H + +#include +#include + +#include "py/obj.h" + +typedef struct _memorymonitor_allocationalarm_obj_t memorymonitor_allocationalarm_obj_t; + +#define ALLOCATION_SIZE_BUCKETS 16 + +typedef struct _memorymonitor_allocationalarm_obj_t { + mp_obj_base_t base; + size_t minimum_block_count; + mp_int_t count; + // Store the location that points to us so we can remove ourselves. + memorymonitor_allocationalarm_obj_t** previous; + memorymonitor_allocationalarm_obj_t* next; +} memorymonitor_allocationalarm_obj_t; + +void memorymonitor_allocationalarms_allocation(size_t block_count); +void memorymonitor_allocationalarms_reset(void); + +#endif // MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONALARM_H diff --git a/shared-module/memorymonitor/AllocationSize 2.c b/shared-module/memorymonitor/AllocationSize 2.c new file mode 100644 index 0000000000..c28e65592c --- /dev/null +++ b/shared-module/memorymonitor/AllocationSize 2.c @@ -0,0 +1,91 @@ +/* + * This file is part of the Micro Python 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 "shared-bindings/memorymonitor/AllocationSize.h" + +#include "py/gc.h" +#include "py/mpstate.h" +#include "py/runtime.h" + +void common_hal_memorymonitor_allocationsize_construct(memorymonitor_allocationsize_obj_t* self) { + common_hal_memorymonitor_allocationsize_clear(self); + self->next = NULL; + self->previous = NULL; +} + +void common_hal_memorymonitor_allocationsize_pause(memorymonitor_allocationsize_obj_t* self) { + *self->previous = self->next; + self->next = NULL; + self->previous = NULL; +} + +void common_hal_memorymonitor_allocationsize_resume(memorymonitor_allocationsize_obj_t* self) { + if (self->previous != NULL) { + mp_raise_RuntimeError(translate("Already running")); + } + self->next = MP_STATE_VM(active_allocationsizes); + self->previous = (memorymonitor_allocationsize_obj_t**) &MP_STATE_VM(active_allocationsizes); + if (self->next != NULL) { + self->next->previous = &self->next; + } + MP_STATE_VM(active_allocationsizes) = self; +} + +void common_hal_memorymonitor_allocationsize_clear(memorymonitor_allocationsize_obj_t* self) { + for (size_t i = 0; i < ALLOCATION_SIZE_BUCKETS; i++) { + self->buckets[i] = 0; + } +} + +uint16_t common_hal_memorymonitor_allocationsize_get_len(memorymonitor_allocationsize_obj_t* self) { + return ALLOCATION_SIZE_BUCKETS; +} + +size_t common_hal_memorymonitor_allocationsize_get_bytes_per_block(memorymonitor_allocationsize_obj_t* self) { + return BYTES_PER_BLOCK; +} + +uint16_t common_hal_memorymonitor_allocationsize_get_item(memorymonitor_allocationsize_obj_t* self, int16_t index) { + return self->buckets[index]; +} + +void memorymonitor_allocationsizes_track_allocation(size_t block_count) { + memorymonitor_allocationsize_obj_t* as = MP_OBJ_TO_PTR(MP_STATE_VM(active_allocationsizes)); + size_t power_of_two = 0; + block_count >>= 1; + while (block_count != 0) { + power_of_two++; + block_count >>= 1; + } + while (as != NULL) { + as->buckets[power_of_two]++; + as = as->next; + } +} + +void memorymonitor_allocationsizes_reset(void) { + MP_STATE_VM(active_allocationsizes) = NULL; +} diff --git a/shared-module/memorymonitor/AllocationSize 2.h b/shared-module/memorymonitor/AllocationSize 2.h new file mode 100644 index 0000000000..3baab2213e --- /dev/null +++ b/shared-module/memorymonitor/AllocationSize 2.h @@ -0,0 +1,51 @@ +/* + * This file is part of the Micro Python 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONSIZE_H +#define MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONSIZE_H + +#include +#include + +#include "py/obj.h" + +typedef struct _memorymonitor_allocationsize_obj_t memorymonitor_allocationsize_obj_t; + +#define ALLOCATION_SIZE_BUCKETS 16 + +typedef struct _memorymonitor_allocationsize_obj_t { + mp_obj_base_t base; + uint16_t buckets[ALLOCATION_SIZE_BUCKETS]; + // Store the location that points to us so we can remove ourselves. + memorymonitor_allocationsize_obj_t** previous; + memorymonitor_allocationsize_obj_t* next; + bool paused; +} memorymonitor_allocationsize_obj_t; + +void memorymonitor_allocationsizes_track_allocation(size_t block_count); +void memorymonitor_allocationsizes_reset(void); + +#endif // MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONSIZE_H diff --git a/shared-module/memorymonitor/__init__ 2.c b/shared-module/memorymonitor/__init__ 2.c new file mode 100644 index 0000000000..6cb424153d --- /dev/null +++ b/shared-module/memorymonitor/__init__ 2.c @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft + * + * 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-module/memorymonitor/__init__.h" +#include "shared-module/memorymonitor/AllocationAlarm.h" +#include "shared-module/memorymonitor/AllocationSize.h" + +void memorymonitor_track_allocation(size_t block_count) { + memorymonitor_allocationalarms_allocation(block_count); + memorymonitor_allocationsizes_track_allocation(block_count); +} + +void memorymonitor_reset(void) { + memorymonitor_allocationalarms_reset(); + memorymonitor_allocationsizes_reset(); +} diff --git a/shared-module/memorymonitor/__init__ 2.h b/shared-module/memorymonitor/__init__ 2.h new file mode 100644 index 0000000000..f47f6434bf --- /dev/null +++ b/shared-module/memorymonitor/__init__ 2.h @@ -0,0 +1,35 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 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 MICROPY_INCLUDED_MEMORYMONITOR___INIT___H +#define MICROPY_INCLUDED_MEMORYMONITOR___INIT___H + +#include + +void memorymonitor_track_allocation(size_t block_count); +void memorymonitor_reset(void); + +#endif // MICROPY_INCLUDED_MEMORYMONITOR___INIT___H diff --git a/shared-module/sdcardio/SDCard 2.c b/shared-module/sdcardio/SDCard 2.c new file mode 100644 index 0000000000..9e861279d3 --- /dev/null +++ b/shared-module/sdcardio/SDCard 2.c @@ -0,0 +1,466 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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. + */ + +// This implementation largely follows the structure of adafruit_sdcard.py + +#include "shared-bindings/busio/SPI.h" +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "shared-bindings/time/__init__.h" +#include "shared-bindings/util.h" +#include "shared-module/sdcardio/SDCard.h" + +#include "py/mperrno.h" + +#if 0 +#define DEBUG_PRINT(...) ((void)mp_printf(&mp_plat_print, ## __VA_ARGS__)) +#else +#define DEBUG_PRINT(...) ((void)0) +#endif + +#define CMD_TIMEOUT (200) + +#define R1_IDLE_STATE (1<<0) +#define R1_ILLEGAL_COMMAND (1<<2) + +#define TOKEN_CMD25 (0xFC) +#define TOKEN_STOP_TRAN (0xFD) +#define TOKEN_DATA (0xFE) + +STATIC bool lock_and_configure_bus(sdcardio_sdcard_obj_t *self) { + if (!common_hal_busio_spi_try_lock(self->bus)) { + return false; + } + common_hal_busio_spi_configure(self->bus, self->baudrate, 0, 0, 8); + common_hal_digitalio_digitalinout_set_value(&self->cs, false); + return true; +} + +STATIC void lock_bus_or_throw(sdcardio_sdcard_obj_t *self) { + if (!lock_and_configure_bus(self)) { + mp_raise_OSError(EAGAIN); + } +} + +STATIC void clock_card(sdcardio_sdcard_obj_t *self, int bytes) { + uint8_t buf[] = {0xff}; + common_hal_digitalio_digitalinout_set_value(&self->cs, true); + for (int i=0; ibus, buf, 1); + } +} + +STATIC void extraclock_and_unlock_bus(sdcardio_sdcard_obj_t *self) { + clock_card(self, 1); + common_hal_busio_spi_unlock(self->bus); +} + +static uint8_t CRC7(const uint8_t* data, uint8_t n) { + uint8_t crc = 0; + for (uint8_t i = 0; i < n; i++) { + uint8_t d = data[i]; + for (uint8_t j = 0; j < 8; j++) { + crc <<= 1; + if ((d & 0x80) ^ (crc & 0x80)) { + crc ^= 0x09; + } + d <<= 1; + } + } + return (crc << 1) | 1; +} + +#define READY_TIMEOUT_NS (300 * 1000 * 1000) // 300ms +STATIC void wait_for_ready(sdcardio_sdcard_obj_t *self) { + uint64_t deadline = common_hal_time_monotonic_ns() + READY_TIMEOUT_NS; + while (common_hal_time_monotonic_ns() < deadline) { + uint8_t b; + common_hal_busio_spi_read(self->bus, &b, 1, 0xff); + if (b == 0xff) { + break; + } + } +} + +// In Python API, defaults are response=None, data_block=True, wait=True +STATIC int cmd(sdcardio_sdcard_obj_t *self, int cmd, int arg, void *response_buf, size_t response_len, bool data_block, bool wait) { + DEBUG_PRINT("cmd % 3d [%02x] arg=% 11d [%08x] len=%d%s%s\n", cmd, cmd, arg, arg, response_len, data_block ? " data" : "", wait ? " wait" : ""); + uint8_t cmdbuf[6]; + cmdbuf[0] = cmd | 0x40; + cmdbuf[1] = (arg >> 24) & 0xff; + cmdbuf[2] = (arg >> 16) & 0xff; + cmdbuf[3] = (arg >> 8) & 0xff; + cmdbuf[4] = arg & 0xff; + cmdbuf[5] = CRC7(cmdbuf, 5); + + if (wait) { + wait_for_ready(self); + } + + common_hal_busio_spi_write(self->bus, cmdbuf, sizeof(cmdbuf)); + + // Wait for the response (response[7] == 0) + bool response_received = false; + for (int i=0; ibus, cmdbuf, 1, 0xff); + if ((cmdbuf[0] & 0x80) == 0) { + response_received = true; + break; + } + } + + if (!response_received) { + return -EIO; + } + + if (response_buf) { + + if (data_block) { + cmdbuf[1] = 0xff; + do { + // Wait for the start block byte + common_hal_busio_spi_read(self->bus, cmdbuf+1, 1, 0xff); + } while (cmdbuf[1] != 0xfe); + } + + common_hal_busio_spi_read(self->bus, response_buf, response_len, 0xff); + + if (data_block) { + // Read and discard the CRC-CCITT checksum + common_hal_busio_spi_read(self->bus, cmdbuf+1, 2, 0xff); + } + + } + + return cmdbuf[0]; +} + +STATIC int block_cmd(sdcardio_sdcard_obj_t *self, int cmd_, int block, void *response_buf, size_t response_len, bool data_block, bool wait) { + return cmd(self, cmd_, block * self->cdv, response_buf, response_len, true, true); +} + +STATIC bool cmd_nodata(sdcardio_sdcard_obj_t* self, int cmd, int response) { + uint8_t cmdbuf[2] = {cmd, 0xff}; + + common_hal_busio_spi_write(self->bus, cmdbuf, sizeof(cmdbuf)); + + // Wait for the response (response[7] == response) + for (int i=0; ibus, cmdbuf, 1, 0xff); + if (cmdbuf[0] == response) { + return 0; + } + } + return -EIO; +} + +STATIC const compressed_string_t *init_card_v1(sdcardio_sdcard_obj_t *self) { + for (int i=0; icdv = 1; + } + return NULL; + } + } + return translate("timeout waiting for v2 card"); +} + +STATIC const compressed_string_t *init_card(sdcardio_sdcard_obj_t *self) { + clock_card(self, 10); + + common_hal_digitalio_digitalinout_set_value(&self->cs, false); + + // CMD0: init card: should return _R1_IDLE_STATE (allow 5 attempts) + { + bool reached_idle_state = false; + for (int i=0; i<5; i++) { + if (cmd(self, 0, 0, NULL, 0, true, true) == R1_IDLE_STATE) { + reached_idle_state = true; + break; + } + } + if (!reached_idle_state) { + return translate("no SD card"); + } + } + + // CMD8: determine card version + { + uint8_t rb7[4]; + int response = cmd(self, 8, 0x1AA, rb7, sizeof(rb7), false, true); + if (response == R1_IDLE_STATE) { + const compressed_string_t *result =init_card_v2(self); + if (result != NULL) { + return result; + } + } else if (response == (R1_IDLE_STATE | R1_ILLEGAL_COMMAND)) { + const compressed_string_t *result =init_card_v1(self); + if (result != NULL) { + return result; + } + } else { + return translate("couldn't determine SD card version"); + } + } + + // CMD9: get number of sectors + { + uint8_t csd[16]; + int response = cmd(self, 9, 0, csd, sizeof(csd), true, true); + if (response != 0) { + return translate("no response from SD card"); + } + int csd_version = (csd[0] & 0xC0) >> 6; + if (csd_version >= 2) { + return translate("SD card CSD format not supported"); + } + + if (csd_version == 1) { + self->sectors = ((csd[8] << 8 | csd[9]) + 1) * 1024; + } else { + uint32_t block_length = 1 << (csd[5] & 0xF); + uint32_t c_size = ((csd[6] & 0x3) << 10) | (csd[7] << 2) | ((csd[8] & 0xC) >> 6); + uint32_t mult = 1 << (((csd[9] & 0x3) << 1 | (csd[10] & 0x80) >> 7) + 2); + self->sectors = block_length / 512 * mult * (c_size + 1); + } + } + + // CMD16: set block length to 512 bytes + { + int response = cmd(self, 16, 512, NULL, 0, true, true); + if (response != 0) { + return translate("can't set 512 block size"); + } + } + + return NULL; +} + +void common_hal_sdcardio_sdcard_construct(sdcardio_sdcard_obj_t *self, busio_spi_obj_t *bus, mcu_pin_obj_t *cs, int baudrate) { + self->bus = bus; + common_hal_digitalio_digitalinout_construct(&self->cs, cs); + common_hal_digitalio_digitalinout_switch_to_output(&self->cs, true, DRIVE_MODE_PUSH_PULL); + + self->cdv = 512; + self->sectors = 0; + self->baudrate = 250000; + + lock_bus_or_throw(self); + const compressed_string_t *result = init_card(self); + extraclock_and_unlock_bus(self); + + if (result != NULL) { + common_hal_digitalio_digitalinout_deinit(&self->cs); + mp_raise_OSError_msg(result); + } + + self->baudrate = baudrate; +} + +void common_hal_sdcardio_sdcard_deinit(sdcardio_sdcard_obj_t *self) { + if (!self->bus) { + return; + } + self->bus = 0; + common_hal_digitalio_digitalinout_deinit(&self->cs); +} + +void common_hal_sdcardio_check_for_deinit(sdcardio_sdcard_obj_t *self) { + if (!self->bus) { + raise_deinited_error(); + } +} + +int common_hal_sdcardio_sdcard_get_blockcount(sdcardio_sdcard_obj_t *self) { + common_hal_sdcardio_check_for_deinit(self); + return self->sectors; +} + +int readinto(sdcardio_sdcard_obj_t *self, void *buf, size_t size) { + uint8_t aux[2] = {0, 0}; + while (aux[0] != 0xfe) { + common_hal_busio_spi_read(self->bus, aux, 1, 0xff); + } + + common_hal_busio_spi_read(self->bus, buf, size, 0xff); + + // Read checksum and throw it away + common_hal_busio_spi_read(self->bus, aux, sizeof(aux), 0xff); + return 0; +} + +int readblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf) { + uint32_t nblocks = buf->len / 512; + if (nblocks == 1) { + // Use CMD17 to read a single block + return block_cmd(self, 17, start_block, buf->buf, buf->len, true, true); + } else { + // Use CMD18 to read multiple blocks + int r = block_cmd(self, 18, start_block, NULL, 0, true, true); + if (r < 0) { + return r; + } + + uint8_t *ptr = buf->buf; + while (nblocks--) { + r = readinto(self, ptr, 512); + if (r < 0) { + return r; + } + ptr += 512; + } + + // End the multi-block read + r = cmd(self, 12, 0, NULL, 0, true, false); + + // Return first status 0 or last before card ready (0xff) + while (r != 0) { + uint8_t single_byte; + common_hal_busio_spi_read(self->bus, &single_byte, 1, 0xff); + if (single_byte & 0x80) { + return r; + } + r = single_byte; + } + } + return 0; +} + +int common_hal_sdcardio_sdcard_readblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf) { + common_hal_sdcardio_check_for_deinit(self); + if (buf->len % 512 != 0) { + mp_raise_ValueError(translate("Buffer length must be a multiple of 512")); + } + + lock_and_configure_bus(self); + int r = readblocks(self, start_block, buf); + extraclock_and_unlock_bus(self); + return r; +} + +int _write(sdcardio_sdcard_obj_t *self, uint8_t token, void *buf, size_t size) { + wait_for_ready(self); + + uint8_t cmd[2]; + cmd[0] = token; + + common_hal_busio_spi_write(self->bus, cmd, 1); + common_hal_busio_spi_write(self->bus, buf, size); + + cmd[0] = cmd[1] = 0xff; + common_hal_busio_spi_write(self->bus, cmd, 2); + + // Check the response + // This differs from the traditional adafruit_sdcard handling, + // but adafruit_sdcard also ignored the return value of SDCard._write(!) + // so nobody noticed + // + // + // Response is as follows: + // x x x 0 STAT 1 + // 7 6 5 4 3..1 0 + // with STATUS 010 indicating "data accepted", and other status bit + // combinations indicating failure. + // In practice, I was seeing cmd[0] as 0xe5, indicating success + for (int i=0; ibus, cmd, 1, 0xff); + DEBUG_PRINT("i=%02d cmd[0] = 0x%02x\n", i, cmd[0]); + if ((cmd[0] & 0b00010001) == 0b00000001) { + if ((cmd[0] & 0x1f) != 0x5) { + return -EIO; + } else { + break; + } + } + } + + // Wait for the write to finish + do { + common_hal_busio_spi_read(self->bus, cmd, 1, 0xff); + } while (cmd[0] == 0); + + // Success + return 0; +} + +int writeblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf) { + common_hal_sdcardio_check_for_deinit(self); + uint32_t nblocks = buf->len / 512; + if (nblocks == 1) { + // Use CMD24 to write a single block + int r = block_cmd(self, 24, start_block, NULL, 0, true, true); + if (r < 0) { + return r; + } + r = _write(self, TOKEN_DATA, buf->buf, buf->len); + if (r < 0) { + return r; + } + } else { + // Use CMD25 to write multiple block + int r = block_cmd(self, 25, start_block, NULL, 0, true, true); + if (r < 0) { + return r; + } + + uint8_t *ptr = buf->buf; + while (nblocks--) { + r = _write(self, TOKEN_CMD25, ptr, 512); + if (r < 0) { + return r; + } + ptr += 512; + } + + cmd_nodata(self, TOKEN_STOP_TRAN, 0); + } + return 0; +} + +int common_hal_sdcardio_sdcard_writeblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf) { + common_hal_sdcardio_check_for_deinit(self); + if (buf->len % 512 != 0) { + mp_raise_ValueError(translate("Buffer length must be a multiple of 512")); + } + lock_and_configure_bus(self); + int r = writeblocks(self, start_block, buf); + extraclock_and_unlock_bus(self); + return r; +} diff --git a/shared-module/sdcardio/SDCard 2.h b/shared-module/sdcardio/SDCard 2.h new file mode 100644 index 0000000000..76c906029f --- /dev/null +++ b/shared-module/sdcardio/SDCard 2.h @@ -0,0 +1,51 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "py/objarray.h" + +#include "common-hal/busio/SPI.h" +#include "common-hal/digitalio/DigitalInOut.h" + +typedef struct { + mp_obj_base_t base; + busio_spi_obj_t *bus; + digitalio_digitalinout_obj_t cs; + int cdv; + int baudrate; + uint32_t sectors; +} sdcardio_sdcard_obj_t; + +void common_hal_sdcardio_sdcard_construct(sdcardio_sdcard_obj_t *self, busio_spi_obj_t *spi, mcu_pin_obj_t *cs, int baudrate); +void common_hal_sdcardio_sdcard_deinit(sdcardio_sdcard_obj_t *self); +void common_hal_sdcardio_sdcard_check_for_deinit(sdcardio_sdcard_obj_t *self); +int common_hal_sdcardio_sdcard_get_blockcount(sdcardio_sdcard_obj_t *self); +int common_hal_sdcardio_sdcard_readblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf); +int common_hal_sdcardio_sdcard_writeblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf); diff --git a/shared-module/sdcardio/__init__ 2.c b/shared-module/sdcardio/__init__ 2.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shared-module/sdcardio/__init__ 2.h b/shared-module/sdcardio/__init__ 2.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/supervisor/background_callback 2.h b/supervisor/background_callback 2.h new file mode 100644 index 0000000000..535dd656be --- /dev/null +++ b/supervisor/background_callback 2.h @@ -0,0 +1,87 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 CIRCUITPY_INCLUDED_SUPERVISOR_BACKGROUND_CALLBACK_H +#define CIRCUITPY_INCLUDED_SUPERVISOR_BACKGROUND_CALLBACK_H + +/** Background callbacks are a linked list of tasks to call in the background. + * + * Include a member of type `background_callback_t` inside an object + * which needs to queue up background work, and zero-initialize it. + * + * To schedule the work, use background_callback_add, with fun as the + * function to call and data pointing to the object itself. + * + * Next time run_background_tasks_if_tick is called, the callback will + * be run and removed from the linked list. + * + * Queueing a task that is already queued does nothing. Unconditionally + * re-queueing it from its own background task will cause it to run during the + * very next background-tasks invocation, leading to a CircuitPython freeze, so + * don't do that. + * + * background_callback_add can be called from interrupt context. + */ +typedef void (*background_callback_fun)(void *data); +typedef struct background_callback { + background_callback_fun fun; + void *data; + struct background_callback *next; + struct background_callback *prev; +} background_callback_t; + +/* Add a background callback for which 'fun' and 'data' were previously set */ +void background_callback_add_core(background_callback_t *cb); + +/* Add a background callback to the given function with the given data. When + * the callback involves an object on the GC heap, the 'data' must be a pointer + * to that object itself, not an internal pointer. Otherwise, it can be the + * case that no other references to the object itself survive, and the object + * becomes garbage collected while an outstanding background callback still + * exists. + */ +void background_callback_add(background_callback_t *cb, background_callback_fun fun, void *data); + +/* Run all background callbacks. Normally, this is done by the supervisor + * whenever the list is non-empty */ +void background_callback_run_all(void); + +/* During soft reset, remove all pending callbacks and clear the critical section flag */ +void background_callback_reset(void); + +/* Sometimes background callbacks must be blocked. Use these functions to + * bracket the section of code where this is the case. These calls nest, and + * begins must be balanced with ends. + */ +void background_callback_begin_critical_section(void); +void background_callback_end_critical_section(void); + +/* + * Background callbacks may stop objects from being collected + */ +void background_callback_gc_collect(void); + +#endif diff --git a/supervisor/shared/background_callback 2.c b/supervisor/shared/background_callback 2.c new file mode 100644 index 0000000000..8e12dd3625 --- /dev/null +++ b/supervisor/shared/background_callback 2.c @@ -0,0 +1,138 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "py/gc.h" +#include "py/mpconfig.h" +#include "supervisor/background_callback.h" +#include "supervisor/shared/tick.h" +#include "shared-bindings/microcontroller/__init__.h" + +STATIC volatile background_callback_t *callback_head, *callback_tail; + +#define CALLBACK_CRITICAL_BEGIN (common_hal_mcu_disable_interrupts()) +#define CALLBACK_CRITICAL_END (common_hal_mcu_enable_interrupts()) + +void background_callback_add_core(background_callback_t *cb) { + CALLBACK_CRITICAL_BEGIN; + if (cb->prev || callback_head == cb) { + CALLBACK_CRITICAL_END; + return; + } + cb->next = 0; + cb->prev = (background_callback_t*)callback_tail; + if (callback_tail) { + callback_tail->next = cb; + cb->prev = (background_callback_t*)callback_tail; + } + if (!callback_head) { + callback_head = cb; + } + callback_tail = cb; + CALLBACK_CRITICAL_END; +} + +void background_callback_add(background_callback_t *cb, background_callback_fun fun, void *data) { + cb->fun = fun; + cb->data = data; + background_callback_add_core(cb); +} + +static bool in_background_callback; +void background_callback_run_all() { + if (!callback_head) { + return; + } + CALLBACK_CRITICAL_BEGIN; + if (in_background_callback) { + CALLBACK_CRITICAL_END; + return; + } + in_background_callback = true; + background_callback_t *cb = (background_callback_t*)callback_head; + callback_head = NULL; + callback_tail = NULL; + while (cb) { + background_callback_t *next = cb->next; + cb->next = cb->prev = NULL; + background_callback_fun fun = cb->fun; + void *data = cb->data; + CALLBACK_CRITICAL_END; + // Leave the critical section in order to run the callback function + if (fun) { + fun(data); + } + CALLBACK_CRITICAL_BEGIN; + cb = next; + } + in_background_callback = false; + CALLBACK_CRITICAL_END; +} + +void background_callback_begin_critical_section() { + CALLBACK_CRITICAL_BEGIN; +} + +void background_callback_end_critical_section() { + CALLBACK_CRITICAL_END; +} + +void background_callback_reset() { + CALLBACK_CRITICAL_BEGIN; + background_callback_t *cb = (background_callback_t*)callback_head; + while(cb) { + background_callback_t *next = cb->next; + memset(cb, 0, sizeof(*cb)); + cb = next; + } + callback_head = NULL; + callback_tail = NULL; + in_background_callback = false; + CALLBACK_CRITICAL_END; +} + +void background_callback_gc_collect(void) { + // We don't enter the callback critical section here. We rely on + // gc_collect_ptr _NOT_ entering background callbacks, so it is not + // possible for the list to be cleared. + // + // However, it is possible for the list to be extended. We make the + // minor assumption that no newly added callback is for a + // collectable object. That is, we only plug the hole where an + // object becomes collectable AFTER it is added but before the + // callback is run, not the hole where an object was ALREADY + // collectable but adds a background task for itself. + // + // It's necessary to traverse the whole list here, as the callbacks + // themselves can be in non-gc memory, and some of the cb->data + // objects themselves might be in non-gc memory. + background_callback_t *cb = (background_callback_t*)callback_head; + while(cb) { + gc_collect_ptr(cb->data); + cb = cb->next; + } +} From 52990a332d602db17564ae3b1d27444f25f4531e Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Fri, 14 Aug 2020 17:48:15 +0800 Subject: [PATCH 0588/1293] fix --- ports/nrf/common-hal/_bleio/Adapter.c | 12 +++++++----- shared-bindings/_bleio/Adapter.c | 4 +++- shared-bindings/_bleio/Adapter.h | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index d34f5d2877..6d6669c5ea 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -386,13 +386,15 @@ bleio_address_obj_t *common_hal_bleio_adapter_get_address(bleio_adapter_obj_t *s return address; } -uint32_t common_hal_bleio_adapter_set_address(bleio_adapter_obj_t *self, bleio_address_obj_t *address) -{ +bool common_hal_bleio_adapter_set_address(bleio_adapter_obj_t *self, bleio_address_obj_t *address) { ble_gap_addr_t local_address; + mp_buffer_info_t bufinfo; + if (!mp_get_buffer(address->bytes, &bufinfo, MP_BUFFER_READ)) { + return false; + } local_address.addr_type = address->type; - const char *data = mp_obj_str_get_str(address->bytes); - memcpy(local_address.addr, data, NUM_BLEIO_ADDRESS_BYTES); - return sd_ble_gap_addr_set(&local_address); + memcpy(local_address.addr, bufinfo.buf, NUM_BLEIO_ADDRESS_BYTES); + return sd_ble_gap_addr_set(&local_address) == NRF_SUCCESS; } mp_obj_str_t* common_hal_bleio_adapter_get_name(bleio_adapter_obj_t *self) { diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 861b640b5b..3ffe65be3d 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -105,7 +105,9 @@ STATIC mp_obj_t bleio_adapter_get_address(mp_obj_t self) { MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_get_address_obj, bleio_adapter_get_address); STATIC mp_obj_t bleio_adapter_set_address(mp_obj_t self, mp_obj_t new_address) { - common_hal_bleio_adapter_set_address(self, new_address); + if (!common_hal_bleio_adapter_set_address(self, new_address)) { + mp_raise_bleio_BluetoothError(translate("Could not set address")); + } return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_2(bleio_adapter_set_address_obj, bleio_adapter_set_address); diff --git a/shared-bindings/_bleio/Adapter.h b/shared-bindings/_bleio/Adapter.h index ad84bf9aa9..3523733577 100644 --- a/shared-bindings/_bleio/Adapter.h +++ b/shared-bindings/_bleio/Adapter.h @@ -42,7 +42,7 @@ extern bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self); extern void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enabled); extern bool common_hal_bleio_adapter_get_connected(bleio_adapter_obj_t *self); extern bleio_address_obj_t *common_hal_bleio_adapter_get_address(bleio_adapter_obj_t *self); -extern uint32_t common_hal_bleio_adapter_set_address(bleio_adapter_obj_t *self, bleio_address_obj_t *address); +extern bool common_hal_bleio_adapter_set_address(bleio_adapter_obj_t *self, bleio_address_obj_t *address); extern mp_obj_str_t* common_hal_bleio_adapter_get_name(bleio_adapter_obj_t *self); extern void common_hal_bleio_adapter_set_name(bleio_adapter_obj_t *self, const char* name); From e81fa3d1818a5e2548f17b0613b20882c3e6eb0c Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 14 Aug 2020 09:37:09 -0400 Subject: [PATCH 0589/1293] make translate --- locale/circuitpython.pot | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 32b5df5ee3..a1b286e2ed 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-11 15:37-0500\n" +"POT-Creation-Date: 2020-08-14 09:36-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -641,6 +641,10 @@ msgstr "" msgid "Could not restart PWM" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Could not set address" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" msgstr "" From f9512983ff0c63a719d7708496e1a827a2ca8a64 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 4 Aug 2020 10:59:05 -0400 Subject: [PATCH 0590/1293] Add PulseOut --- ports/esp32s2/common-hal/pulseio/PulseOut.c | 54 ++++++++++++++------- ports/esp32s2/common-hal/pulseio/PulseOut.h | 6 +-- ports/esp32s2/mpconfigport.h | 13 ++--- ports/esp32s2/peripherals/rmt.c | 8 +++ ports/esp32s2/peripherals/rmt.h | 1 + ports/esp32s2/supervisor/port.c | 3 ++ shared-bindings/pulseio/PulseOut.c | 30 +++++++++--- shared-bindings/pulseio/PulseOut.h | 6 +++ 8 files changed, 87 insertions(+), 34 deletions(-) diff --git a/ports/esp32s2/common-hal/pulseio/PulseOut.c b/ports/esp32s2/common-hal/pulseio/PulseOut.c index c448c578df..dc93d7e964 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseOut.c +++ b/ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -29,32 +29,52 @@ #include "shared-bindings/pulseio/PWMOut.h" #include "py/runtime.h" -// STATIC void turn_on(pulseio_pulseout_obj_t *pulseout) { -// } - -// STATIC void turn_off(pulseio_pulseout_obj_t *pulseout) { -// } - -// STATIC void start_timer(void) { -// } - -// STATIC void pulseout_event_handler(void) { -// } - -void pulseout_reset() { -} +// Requires rmt.c void esp32s2_peripherals_reset_all(void) to reset void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, - const pulseio_pwmout_obj_t* carrier) { - mp_raise_NotImplementedError(translate("PulseOut not supported on this chip")); + const mcu_pin_obj_t* pin, + uint32_t frequency) { + + rmt_channel_t channel = esp32s2_peripherals_find_and_reserve_rmt(); + + // Configure Channel + rmt_config_t config = RMT_DEFAULT_CONFIG_TX(pin->number, channel); + config.tx_config.carrier_en = true; + config.tx_config.carrier_duty_percent = 50; + config.tx_config.carrier_freq_hz = frequency; + config.clk_div = 80; + + rmt_config(&config); + rmt_driver_install(channel, 0, 0); + + self->channel = channel; } bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t* self) { - return false; + return (self->channel == RMT_CHANNEL_MAX); } void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t* self) { + esp32s2_peripherals_free_rmt(self->channel); + self->channel = RMT_CHANNEL_MAX; + } void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t* self, uint16_t* pulses, uint16_t length) { + rmt_item32_t items[length]; + + // Circuitpython allows 16 bit pulse values, while ESP32 only allows 15 bits + // Thus, we use entire items for one pulse, rather than switching inside each item + for (size_t i = 0; i < length; i++) { + // Setting the RMT duration to 0 has undefined behavior, so avoid that pre-emptively. + if (pulses[i] == 0) { + pulses[i] = 1; + } + uint32_t level = (i % 2) ? 0 : 1; + const rmt_item32_t item = {{{ (pulses[i] & 0x8000 ? 0x7FFF : 1), level, (pulses[i] & 0x7FFF), level}}}; + items[i] = item; + } + + rmt_write_items(self->channel, items, length, true); + rmt_wait_tx_done(self->channel, pdMS_TO_TICKS(100)); } diff --git a/ports/esp32s2/common-hal/pulseio/PulseOut.h b/ports/esp32s2/common-hal/pulseio/PulseOut.h index f465d00792..5139059926 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseOut.h +++ b/ports/esp32s2/common-hal/pulseio/PulseOut.h @@ -29,14 +29,14 @@ #include "common-hal/microcontroller/Pin.h" #include "common-hal/pulseio/PWMOut.h" +#include "driver/rmt.h" +#include "rmt.h" #include "py/obj.h" typedef struct { mp_obj_base_t base; - pulseio_pwmout_obj_t *pwmout; + rmt_channel_t channel; } pulseio_pulseout_obj_t; -void pulseout_reset(void); - #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEOUT_H diff --git a/ports/esp32s2/mpconfigport.h b/ports/esp32s2/mpconfigport.h index d340bb4805..6b070afea6 100644 --- a/ports/esp32s2/mpconfigport.h +++ b/ports/esp32s2/mpconfigport.h @@ -28,19 +28,20 @@ #ifndef ESP32S2_MPCONFIGPORT_H__ #define ESP32S2_MPCONFIGPORT_H__ -#define CIRCUITPY_INTERNAL_NVM_SIZE (0) -#define MICROPY_NLR_THUMB (0) +#define CIRCUITPY_INTERNAL_NVM_SIZE (0) +#define MICROPY_NLR_THUMB (0) -#define MICROPY_PY_UJSON (0) -#define MICROPY_USE_INTERNAL_PRINTF (0) +#define MICROPY_PY_UJSON (0) +#define MICROPY_USE_INTERNAL_PRINTF (0) #include "py/circuitpy_mpconfig.h" +#define CPY_PULSEOUT_USES_DIGITALIO (1) #define MICROPY_PORT_ROOT_POINTERS \ CIRCUITPY_COMMON_ROOT_POINTERS -#define MICROPY_NLR_SETJMP (1) -#define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000 +#define MICROPY_NLR_SETJMP (1) +#define CIRCUITPY_DEFAULT_STACK_SIZE (0x6000) #endif // __INCLUDED_ESP32S2_MPCONFIGPORT_H diff --git a/ports/esp32s2/peripherals/rmt.c b/ports/esp32s2/peripherals/rmt.c index f17957c1c4..16605edf5e 100644 --- a/ports/esp32s2/peripherals/rmt.c +++ b/ports/esp32s2/peripherals/rmt.c @@ -29,6 +29,14 @@ bool rmt_reserved_channels[RMT_CHANNEL_MAX]; +void esp32s2_peripherals_rmt_reset(void) { + for (size_t i = 0; i < RMT_CHANNEL_MAX; i++) { + if (rmt_reserved_channels[i]) { + esp32s2_peripherals_free_rmt(i); + } + } +} + rmt_channel_t esp32s2_peripherals_find_and_reserve_rmt(void) { for (size_t i = 0; i < RMT_CHANNEL_MAX; i++) { if (!rmt_reserved_channels[i]) { diff --git a/ports/esp32s2/peripherals/rmt.h b/ports/esp32s2/peripherals/rmt.h index 4741a5bc59..01ed09907a 100644 --- a/ports/esp32s2/peripherals/rmt.h +++ b/ports/esp32s2/peripherals/rmt.h @@ -31,6 +31,7 @@ #include "driver/rmt.h" #include +void esp32s2_peripherals_rmt_reset(void); rmt_channel_t esp32s2_peripherals_find_and_reserve_rmt(void); void esp32s2_peripherals_free_rmt(rmt_channel_t chan); diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index e4767e5146..d287079b79 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -42,6 +42,8 @@ #include "supervisor/memory.h" #include "supervisor/shared/tick.h" +#include "rmt.h" + STATIC esp_timer_handle_t _tick_timer; void tick_timer_cb(void* arg) { @@ -66,6 +68,7 @@ void reset_port(void) { vTaskDelay(4); #if CIRCUITPY_PULSEIO + esp32s2_peripherals_rmt_reset(); pwmout_reset(); #endif #if CIRCUITPY_BUSIO diff --git a/shared-bindings/pulseio/PulseOut.c b/shared-bindings/pulseio/PulseOut.c index 3d35f05445..10524f51b3 100644 --- a/shared-bindings/pulseio/PulseOut.c +++ b/shared-bindings/pulseio/PulseOut.c @@ -64,19 +64,33 @@ //| pulse.send(pulses)""" //| ... //| -STATIC mp_obj_t pulseio_pulseout_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { - mp_arg_check_num(n_args, kw_args, 1, 1, false); - mp_obj_t carrier_obj = args[0]; +STATIC mp_obj_t pulseio_pulseout_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - if (!MP_OBJ_IS_TYPE(carrier_obj, &pulseio_pwmout_type)) { - mp_raise_TypeError_varg(translate("Expected a %q"), pulseio_pwmout_type.name); - } - - // create Pulse object from the given pin pulseio_pulseout_obj_t *self = m_new_obj(pulseio_pulseout_obj_t); self->base.type = &pulseio_pulseout_type; + #ifndef CPY_PULSEOUT_USES_DIGITALIO + // Most ports pass a PWMOut + mp_arg_check_num(n_args, kw_args, 1, 1, false); + mp_obj_t carrier_obj = args[0]; + if (!MP_OBJ_IS_TYPE(carrier_obj, &pulseio_pwmout_type)) { + mp_raise_TypeError_varg(translate("Expected a %q"), pulseio_pwmout_type.name); + } common_hal_pulseio_pulseout_construct(self, (pulseio_pwmout_obj_t *)MP_OBJ_TO_PTR(carrier_obj)); + #else + // ESP32-S2 Special Case + enum { ARG_pin, ARG_frequency}; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_pin, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_frequency, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 38000} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + const mcu_pin_obj_t* pin = validate_obj_is_free_pin(args[ARG_pin].u_obj); + + common_hal_pulseio_pulseout_construct(self, pin, args[ARG_frequency].u_int); + #endif return MP_OBJ_FROM_PTR(self); } diff --git a/shared-bindings/pulseio/PulseOut.h b/shared-bindings/pulseio/PulseOut.h index 390910ff62..090f6d15c6 100644 --- a/shared-bindings/pulseio/PulseOut.h +++ b/shared-bindings/pulseio/PulseOut.h @@ -33,8 +33,14 @@ extern const mp_obj_type_t pulseio_pulseout_type; +#ifndef CPY_PULSEOUT_USES_DIGITALIO extern void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, const pulseio_pwmout_obj_t* carrier); +#else +extern void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, + const mcu_pin_obj_t* pin, uint32_t frequency); +#endif + extern void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t* self); extern bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t* self); extern void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t* self, From 4ba9ff892c2176d4aeefe1a8287cdb899acf5da1 Mon Sep 17 00:00:00 2001 From: Margaret Matocha Date: Mon, 10 Aug 2020 11:04:56 -0500 Subject: [PATCH 0591/1293] Added bitmap.blit function for copying slices of bitmaps --- shared-bindings/displayio/Bitmap.c | 62 +++++++++++++++++++++++++++++- shared-bindings/displayio/Bitmap.h | 2 + shared-module/displayio/Bitmap.c | 31 +++++++++++++++ 3 files changed, 94 insertions(+), 1 deletion(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 0a45bbdfdb..56c6007f05 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -172,7 +172,66 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val return mp_const_none; } -//| def fill(self, value: int) -> None: +//| def blit(self, x: int, y: int, source_bitmap: bitmap, x1: int, y1: int, x2: int, y2:int) -> Any: +//| """Inserts the source_bitmap region defined by rectangular boundaries +//| (x1,y1) and (x2,y2) into the bitmap at the specified (x,y) location. +//| :param int x: Horizontal pixel location in bitmap where source_bitmap upper-left +//| corner will be placed +//| :param int y: Vertical pixel location in bitmap where source_bitmap upper-left +//| corner will be placed +//| :param bitmap source_bitmap: Source bitmap that contains the graphical region to be copied +//| : param x1: Minimum x-value for rectangular bounding box to be copied from the source bitmap +//| : param y1: Minimum y-value for rectangular bounding box to be copied from the source bitmap +//| : param x2: Maximum x-value for rectangular bounding box to be copied from the source bitmap +//| : param y2: Maximum y-value for rectangular bounding box to be copied from the source bitmap +//| +//| ... +//| + +STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args){ + + // Consider improving the input checking. + + displayio_bitmap_t *self = MP_OBJ_TO_PTR(pos_args[0]); + int16_t x = mp_obj_get_int(pos_args[1]); + int16_t y = mp_obj_get_int(pos_args[2]); + displayio_bitmap_t *source = MP_OBJ_TO_PTR(pos_args[3]); + int16_t x1 = mp_obj_get_int(pos_args[4]); + int16_t y1 = mp_obj_get_int(pos_args[5]); + int16_t x2 = mp_obj_get_int(pos_args[6]); + int16_t y2 = mp_obj_get_int(pos_args[7]); + + if ( (x<0) || (y<0) || (x > self-> width) || (y > self->height) ) { + mp_raise_ValueError(translate("(x,y): out of range of target bitmap")); + } + if ( (x1 < 0) || (x1 > source->width) || + (y1 < 0) || (y1 > source->height) || + (x2 < 0) || (x2 > source->width) || + (y2 < 0) || (y2 > source->height) ) { + mp_raise_ValueError(translate("(x1,y1) or (x2,y2): out of range of source bitmap")); + } + + // Ensure x1 < x2 and y1 < y2 + if (x1 > x2) { + int16_t temp=x2; + x2=x1; + x1=temp; + } + if (y1 > y2) { + int16_t temp=y2; + y2=y1; + y1=temp; + } + + common_hal_displayio_bitmap_blit(self, x, y, source, x1, y1, x2, y2); + + return mp_const_none; +} + +MP_DEFINE_CONST_FUN_OBJ_KW(displayio_bitmap_blit_obj, 8, displayio_bitmap_obj_blit); +// requires 8 parameters + +//| def fill(self, value: Any) -> Any: //| """Fills the bitmap with the supplied palette index value.""" //| ... //| @@ -192,6 +251,7 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_bitmap_fill_obj, displayio_bitmap_obj_fill); STATIC const mp_rom_map_elem_t displayio_bitmap_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&displayio_bitmap_height_obj) }, { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&displayio_bitmap_width_obj) }, + { MP_ROM_QSTR(MP_QSTR_blit), MP_ROM_PTR(&displayio_bitmap_blit_obj) }, { MP_ROM_QSTR(MP_QSTR_fill), MP_ROM_PTR(&displayio_bitmap_fill_obj) }, }; diff --git a/shared-bindings/displayio/Bitmap.h b/shared-bindings/displayio/Bitmap.h index 46c3373292..8225af6c6a 100644 --- a/shared-bindings/displayio/Bitmap.h +++ b/shared-bindings/displayio/Bitmap.h @@ -40,6 +40,8 @@ uint16_t common_hal_displayio_bitmap_get_height(displayio_bitmap_t *self); uint16_t common_hal_displayio_bitmap_get_width(displayio_bitmap_t *self); uint32_t common_hal_displayio_bitmap_get_bits_per_value(displayio_bitmap_t *self); void common_hal_displayio_bitmap_set_pixel(displayio_bitmap_t *bitmap, int16_t x, int16_t y, uint32_t value); +void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16_t y, displayio_bitmap_t *source, + int16_t x1, int16_t y1, int16_t x2, int16_t y2); uint32_t common_hal_displayio_bitmap_get_pixel(displayio_bitmap_t *bitmap, int16_t x, int16_t y); void common_hal_displayio_bitmap_fill(displayio_bitmap_t *bitmap, uint32_t value); diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index 8bcda6086f..dde346ad31 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -105,6 +105,37 @@ uint32_t common_hal_displayio_bitmap_get_pixel(displayio_bitmap_t *self, int16_t return 0; } +void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16_t y, displayio_bitmap_t *source, + int16_t x1, int16_t y1, int16_t x2, int16_t y2) { + // Copy complete "source" bitmap into "self" bitmap at location x,y in the "self" + // Add a boolean to determine if all values are copied, or only if non-zero + // Default is copy all values, but for text glyphs this should copy only non-zero values + + if (self->read_only) { + mp_raise_RuntimeError(translate("Read-only object")); + } + + // If this value is encountered in the source bitmap, it will not be copied (for text glyphs) + // This should be added as an optional parameter, and if it is `None`, then all pixels are copied + uint32_t skip_value=0; + + // simplest version - use internal functions for get/set pixels + for (uint16_t i=0; i<= (x2-x1) ; i++) { + if ( (x+i >= 0) && (x+i < self->width) ) { + for (uint16_t j=0; j<= (y2-y1) ; j++){ + if ((y+j >= 0) && (y+j < self->height) ) { + uint32_t value = common_hal_displayio_bitmap_get_pixel(source, x1+i, y1+j); + if ( (value != skip_value) ) { + common_hal_displayio_bitmap_set_pixel(self, x+i, y+j, value); + } + } + } + } + } + +} + + void common_hal_displayio_bitmap_set_pixel(displayio_bitmap_t *self, int16_t x, int16_t y, uint32_t value) { if (self->read_only) { mp_raise_RuntimeError(translate("Read-only object")); From 824f47d6e99d85b2b604db524c9e9178e0a99ceb Mon Sep 17 00:00:00 2001 From: Margaret Matocha Date: Wed, 12 Aug 2020 21:50:17 -0500 Subject: [PATCH 0592/1293] Added bitmap.blit function for bitmap slice copy --- shared-bindings/displayio/Bitmap.c | 98 ++++++++++++++++++++++-------- shared-bindings/displayio/Bitmap.h | 3 +- shared-module/displayio/Bitmap.c | 16 +++-- 3 files changed, 83 insertions(+), 34 deletions(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 56c6007f05..af9f6c3c8b 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -172,7 +172,7 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val return mp_const_none; } -//| def blit(self, x: int, y: int, source_bitmap: bitmap, x1: int, y1: int, x2: int, y2:int) -> Any: +//| def blit(self, x: int, y: int, source_bitmap: bitmap, x1: int, y1: int, x2: int, y2: int, skip_index: int) -> Any: //| """Inserts the source_bitmap region defined by rectangular boundaries //| (x1,y1) and (x2,y2) into the bitmap at the specified (x,y) location. //| :param int x: Horizontal pixel location in bitmap where source_bitmap upper-left @@ -180,34 +180,74 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val //| :param int y: Vertical pixel location in bitmap where source_bitmap upper-left //| corner will be placed //| :param bitmap source_bitmap: Source bitmap that contains the graphical region to be copied -//| : param x1: Minimum x-value for rectangular bounding box to be copied from the source bitmap -//| : param y1: Minimum y-value for rectangular bounding box to be copied from the source bitmap -//| : param x2: Maximum x-value for rectangular bounding box to be copied from the source bitmap -//| : param y2: Maximum y-value for rectangular bounding box to be copied from the source bitmap -//| +//| : param int x1: Minimum x-value for rectangular bounding box to be copied from the source bitmap +//| : param int y1: Minimum y-value for rectangular bounding box to be copied from the source bitmap +//| : param int x2: Maximum x-value for rectangular bounding box to be copied from the source bitmap +//| : param int y2: Maximum y-value for rectangular bounding box to be copied from the source bitmap +//| : param int skip_index: bitmap palette index in the source that will not be copied, set `None` to copy all pixels //| ... //| STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args){ + enum {ARG_x, ARG_y, ARG_source, ARG_x1, ARG_y1, ARG_x2, ARG_y2, ARG_skip_index}; + static const mp_arg_t allowed_args[] = { + {MP_QSTR_x, MP_ARG_REQUIRED | MP_ARG_INT}, + {MP_QSTR_y, MP_ARG_REQUIRED | MP_ARG_INT}, + {MP_QSTR_source, MP_ARG_REQUIRED | MP_ARG_OBJ}, + {MP_QSTR_x1, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, + {MP_QSTR_y1, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, + {MP_QSTR_x2, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to source->width + {MP_QSTR_y2, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to source->height + {MP_QSTR_skip_index, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj=mp_const_none} }, + }; + 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); - // Consider improving the input checking. + displayio_bitmap_t *self = MP_OBJ_TO_PTR(pos_args[0]); //******* - displayio_bitmap_t *self = MP_OBJ_TO_PTR(pos_args[0]); - int16_t x = mp_obj_get_int(pos_args[1]); - int16_t y = mp_obj_get_int(pos_args[2]); - displayio_bitmap_t *source = MP_OBJ_TO_PTR(pos_args[3]); - int16_t x1 = mp_obj_get_int(pos_args[4]); - int16_t y1 = mp_obj_get_int(pos_args[5]); - int16_t x2 = mp_obj_get_int(pos_args[6]); - int16_t y2 = mp_obj_get_int(pos_args[7]); + int16_t x = args[ARG_x].u_int; + int16_t y = args[ARG_y].u_int; - if ( (x<0) || (y<0) || (x > self-> width) || (y > self->height) ) { + displayio_bitmap_t *source = MP_OBJ_TO_PTR(args[ARG_source].u_obj); + + int16_t x1, y1; + // if x1 or y1 is None, then set as the zero-point of the bitmap + if ( args[ARG_x1].u_obj == mp_const_none ) { + x1 = 0; + } else { + x1 = mp_obj_get_int(args[ARG_x1].u_obj); + } + //int16_t y1; + if ( args[ARG_y1].u_obj == mp_const_none ) { + y1 = 0; + } else { + y1 = mp_obj_get_int(args[ARG_y1].u_obj); + } + + int16_t x2, y2; + // if x2 or y2 is None, then set as the maximum size of the source bitmap + if ( args[ARG_x2].u_obj == mp_const_none ) { + x2 = source->width-1; + } else { + x2 = mp_obj_get_int(args[ARG_x2].u_obj); + } + //int16_t y2; + if ( args[ARG_y2].u_obj == mp_const_none ) { + y2 = source->height-1; + } else { + y2 = mp_obj_get_int(args[ARG_y2].u_obj); + } + + + // Check x,y are within self (target) bitmap boundary + if ( (x < 0) || (y < 0) || (x >= self->width) || (y >= self->height) ) { mp_raise_ValueError(translate("(x,y): out of range of target bitmap")); } - if ( (x1 < 0) || (x1 > source->width) || - (y1 < 0) || (y1 > source->height) || - (x2 < 0) || (x2 > source->width) || - (y2 < 0) || (y2 > source->height) ) { + // Check x1,y1,x2,y2 are within source bitmap boundary + if ( (x1 < 0) || (x1 >= source->width) || + (y1 < 0) || (y1 >= source->height) || + (x2 < 0) || (x2 >= source->width) || + (y2 < 0) || (y2 >= source->height) ) { mp_raise_ValueError(translate("(x1,y1) or (x2,y2): out of range of source bitmap")); } @@ -223,13 +263,23 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg y1=temp; } - common_hal_displayio_bitmap_blit(self, x, y, source, x1, y1, x2, y2); + uint32_t skip_index; + bool skip_index_none; // flag whether skip_value was None + + if (args[ARG_skip_index].u_obj == mp_const_none ) { + skip_index = 0; + skip_index_none = true; + } else { + skip_index = mp_obj_get_int(args[ARG_skip_index].u_obj); + skip_index_none = false; + } + + common_hal_displayio_bitmap_blit(self, x, y, source, x1, y1, x2, y2, skip_index, skip_index_none); return mp_const_none; } - -MP_DEFINE_CONST_FUN_OBJ_KW(displayio_bitmap_blit_obj, 8, displayio_bitmap_obj_blit); -// requires 8 parameters +MP_DEFINE_CONST_FUN_OBJ_KW(displayio_bitmap_blit_obj, 4, displayio_bitmap_obj_blit); +// `displayio_bitmap_obj_blit` requires at least 4 arguments //| def fill(self, value: Any) -> Any: //| """Fills the bitmap with the supplied palette index value.""" diff --git a/shared-bindings/displayio/Bitmap.h b/shared-bindings/displayio/Bitmap.h index 8225af6c6a..cf75f3d764 100644 --- a/shared-bindings/displayio/Bitmap.h +++ b/shared-bindings/displayio/Bitmap.h @@ -41,7 +41,8 @@ uint16_t common_hal_displayio_bitmap_get_width(displayio_bitmap_t *self); uint32_t common_hal_displayio_bitmap_get_bits_per_value(displayio_bitmap_t *self); void common_hal_displayio_bitmap_set_pixel(displayio_bitmap_t *bitmap, int16_t x, int16_t y, uint32_t value); void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16_t y, displayio_bitmap_t *source, - int16_t x1, int16_t y1, int16_t x2, int16_t y2); + int16_t x1, int16_t y1, int16_t x2, int16_t y2, + uint32_t skip_index, bool skip_index_none); uint32_t common_hal_displayio_bitmap_get_pixel(displayio_bitmap_t *bitmap, int16_t x, int16_t y); void common_hal_displayio_bitmap_fill(displayio_bitmap_t *bitmap, uint32_t value); diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index dde346ad31..dbcba6b583 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -106,26 +106,24 @@ uint32_t common_hal_displayio_bitmap_get_pixel(displayio_bitmap_t *self, int16_t } void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16_t y, displayio_bitmap_t *source, - int16_t x1, int16_t y1, int16_t x2, int16_t y2) { + int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint32_t skip_index, bool skip_index_none) { // Copy complete "source" bitmap into "self" bitmap at location x,y in the "self" // Add a boolean to determine if all values are copied, or only if non-zero - // Default is copy all values, but for text glyphs this should copy only non-zero values + // + // If skip_value is encountered in the source bitmap, it will not be copied. + // If skip_value is `None`, then all pixels are copied. if (self->read_only) { mp_raise_RuntimeError(translate("Read-only object")); } - // If this value is encountered in the source bitmap, it will not be copied (for text glyphs) - // This should be added as an optional parameter, and if it is `None`, then all pixels are copied - uint32_t skip_value=0; - // simplest version - use internal functions for get/set pixels - for (uint16_t i=0; i<= (x2-x1) ; i++) { + for (int16_t i=0; i<= (x2-x1) ; i++) { if ( (x+i >= 0) && (x+i < self->width) ) { - for (uint16_t j=0; j<= (y2-y1) ; j++){ + for (int16_t j=0; j<= (y2-y1) ; j++){ if ((y+j >= 0) && (y+j < self->height) ) { uint32_t value = common_hal_displayio_bitmap_get_pixel(source, x1+i, y1+j); - if ( (value != skip_value) ) { + if ( (skip_index_none) || (value != skip_index) ) { // write if skip_value_none is True common_hal_displayio_bitmap_set_pixel(self, x+i, y+j, value); } } From a66ef32da2fee0077f7917071294fa54b689e2e9 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Thu, 13 Aug 2020 17:03:06 -0500 Subject: [PATCH 0593/1293] Added inclusive indexing for x2,y2, fixed default value handling for x1,y1, added bitmap palette comparison --- locale/circuitpython.pot | 40 ++++++++++++++++++++++++-- shared-bindings/displayio/Bitmap.c | 45 ++++++++++++------------------ shared-module/displayio/Bitmap.c | 4 +-- 3 files changed, 58 insertions(+), 31 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index a1b286e2ed..3eb5b1ced2 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 09:36-0400\n" +"POT-Creation-Date: 2020-08-14 13:10-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -82,6 +82,8 @@ msgstr "" msgid "%q list must be a list" msgstr "" +#: shared-bindings/memorymonitor/AllocationAlarm 3.c +#: shared-bindings/memorymonitor/AllocationAlarm 4.c #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" msgstr "" @@ -89,6 +91,8 @@ msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm 3.c +#: shared-bindings/memorymonitor/AllocationAlarm 4.c #: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" @@ -252,6 +256,14 @@ msgstr "" msgid "'yield' outside function" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "(x,y): out of range of target bitmap" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "(x1,y1) or (x2,y2): out of range of source bitmap" +msgstr "" + #: py/compile.c msgid "*x must be assignment target" msgstr "" @@ -306,6 +318,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "" +#: ports/atmel-samd/common-hal/_pew/PewPew 2.c #: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c @@ -322,7 +335,11 @@ msgstr "" msgid "Already advertising." msgstr "" +#: shared-module/memorymonitor/AllocationAlarm 3.c +#: shared-module/memorymonitor/AllocationAlarm 4.c #: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize 3.c +#: shared-module/memorymonitor/AllocationSize 4.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" msgstr "" @@ -362,6 +379,8 @@ msgstr "" msgid "At most %d %q may be specified (not %d)" msgstr "" +#: shared-module/memorymonitor/AllocationAlarm 3.c +#: shared-module/memorymonitor/AllocationAlarm 4.c #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -491,6 +510,12 @@ msgid "Can't set CCCD on local Characteristic" msgstr "" #: shared-bindings/displayio/Bitmap.c +msgid "Cannot blit: source palette too large." +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize 3.c +#: shared-bindings/memorymonitor/AllocationSize 4.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" @@ -1014,6 +1039,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral 2.c #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c @@ -1370,6 +1396,8 @@ msgstr "" msgid "Random number generation error" msgstr "" +#: shared-bindings/memorymonitor/AllocationSize 3.c +#: shared-bindings/memorymonitor/AllocationSize 4.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" @@ -1462,6 +1490,8 @@ msgstr "" #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize 3.c +#: shared-bindings/memorymonitor/AllocationSize 4.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" @@ -1791,10 +1821,14 @@ msgstr "" msgid "address %08x is not aligned to %d bytes" msgstr "" +#: shared-bindings/i2cperipheral/I2CPeripheral 3.c +#: shared-bindings/i2cperipheral/I2CPeripheral 4.c #: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" +#: shared-bindings/i2cperipheral/I2CPeripheral 3.c +#: shared-bindings/i2cperipheral/I2CPeripheral 4.c #: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1957,7 +1991,9 @@ msgstr "" msgid "can't assign to expression" msgstr "" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral 3.c +#: shared-bindings/i2cperipheral/I2CPeripheral 4.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert %q to %q" msgstr "" diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index af9f6c3c8b..5852f1a703 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -172,7 +172,7 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val return mp_const_none; } -//| def blit(self, x: int, y: int, source_bitmap: bitmap, x1: int, y1: int, x2: int, y2: int, skip_index: int) -> Any: +//| def blit(self, x: int, y: int, source_bitmap: bitmap, *, x1: int, y1: int, x2: int, y2: int, skip_index: int) -> Any: //| """Inserts the source_bitmap region defined by rectangular boundaries //| (x1,y1) and (x2,y2) into the bitmap at the specified (x,y) location. //| :param int x: Horizontal pixel location in bitmap where source_bitmap upper-left @@ -193,9 +193,9 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg static const mp_arg_t allowed_args[] = { {MP_QSTR_x, MP_ARG_REQUIRED | MP_ARG_INT}, {MP_QSTR_y, MP_ARG_REQUIRED | MP_ARG_INT}, - {MP_QSTR_source, MP_ARG_REQUIRED | MP_ARG_OBJ}, - {MP_QSTR_x1, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, - {MP_QSTR_y1, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, + {MP_QSTR_source_bitmap, MP_ARG_REQUIRED | MP_ARG_OBJ}, + {MP_QSTR_x1, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = 0} }, + {MP_QSTR_y1, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = 0} }, {MP_QSTR_x2, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to source->width {MP_QSTR_y2, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to source->height {MP_QSTR_skip_index, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj=mp_const_none} }, @@ -203,51 +203,42 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg 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); - displayio_bitmap_t *self = MP_OBJ_TO_PTR(pos_args[0]); //******* + displayio_bitmap_t *self = MP_OBJ_TO_PTR(pos_args[0]); int16_t x = args[ARG_x].u_int; int16_t y = args[ARG_y].u_int; displayio_bitmap_t *source = MP_OBJ_TO_PTR(args[ARG_source].u_obj); - int16_t x1, y1; - // if x1 or y1 is None, then set as the zero-point of the bitmap - if ( args[ARG_x1].u_obj == mp_const_none ) { - x1 = 0; - } else { - x1 = mp_obj_get_int(args[ARG_x1].u_obj); + // ensure that the target bitmap (self) has at least as many `bits_per_value` as the source + if (self->bits_per_value < source->bits_per_value) { + mp_raise_ValueError(translate("Cannot blit: source palette too large.")); } - //int16_t y1; - if ( args[ARG_y1].u_obj == mp_const_none ) { - y1 = 0; - } else { - y1 = mp_obj_get_int(args[ARG_y1].u_obj); - } - - int16_t x2, y2; + + int16_t x1, y1, x2, y2; // if x2 or y2 is None, then set as the maximum size of the source bitmap if ( args[ARG_x2].u_obj == mp_const_none ) { - x2 = source->width-1; + x2 = source->width; } else { x2 = mp_obj_get_int(args[ARG_x2].u_obj); } //int16_t y2; if ( args[ARG_y2].u_obj == mp_const_none ) { - y2 = source->height-1; + y2 = source->height; } else { y2 = mp_obj_get_int(args[ARG_y2].u_obj); } // Check x,y are within self (target) bitmap boundary - if ( (x < 0) || (y < 0) || (x >= self->width) || (y >= self->height) ) { + if ( (x < 0) || (y < 0) || (x > self->width) || (y > self->height) ) { mp_raise_ValueError(translate("(x,y): out of range of target bitmap")); } // Check x1,y1,x2,y2 are within source bitmap boundary - if ( (x1 < 0) || (x1 >= source->width) || - (y1 < 0) || (y1 >= source->height) || - (x2 < 0) || (x2 >= source->width) || - (y2 < 0) || (y2 >= source->height) ) { + if ( (x1 < 0) || (x1 > source->width) || + (y1 < 0) || (y1 > source->height) || + (x2 < 0) || (x2 > source->width) || + (y2 < 0) || (y2 > source->height) ) { mp_raise_ValueError(translate("(x1,y1) or (x2,y2): out of range of source bitmap")); } @@ -272,7 +263,7 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg } else { skip_index = mp_obj_get_int(args[ARG_skip_index].u_obj); skip_index_none = false; - } + } common_hal_displayio_bitmap_blit(self, x, y, source, x1, y1, x2, y2, skip_index, skip_index_none); diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index dbcba6b583..7de9e9755e 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -118,9 +118,9 @@ void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16 } // simplest version - use internal functions for get/set pixels - for (int16_t i=0; i<= (x2-x1) ; i++) { + for (int16_t i=0; i < (x2-x1) ; i++) { if ( (x+i >= 0) && (x+i < self->width) ) { - for (int16_t j=0; j<= (y2-y1) ; j++){ + for (int16_t j=0; j < (y2-y1) ; j++){ if ((y+j >= 0) && (y+j < self->height) ) { uint32_t value = common_hal_displayio_bitmap_get_pixel(source, x1+i, y1+j); if ( (skip_index_none) || (value != skip_index) ) { // write if skip_value_none is True From b1fce9e933275cd9d945ec46c3ea8eaa350e6a67 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Thu, 13 Aug 2020 19:56:45 -0500 Subject: [PATCH 0594/1293] Deleted trailing whitespace --- shared-bindings/displayio/Bitmap.c | 13 ++++++------- shared-bindings/displayio/Bitmap.h | 4 ++-- shared-module/displayio/Bitmap.c | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 5852f1a703..9479dc1a51 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -184,7 +184,8 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val //| : param int y1: Minimum y-value for rectangular bounding box to be copied from the source bitmap //| : param int x2: Maximum x-value for rectangular bounding box to be copied from the source bitmap //| : param int y2: Maximum y-value for rectangular bounding box to be copied from the source bitmap -//| : param int skip_index: bitmap palette index in the source that will not be copied, set `None` to copy all pixels +//| : param int skip_index: bitmap palette index in the source that will not be copied, +//| set `None` to copy all pixels""" //| ... //| @@ -229,19 +230,17 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg y2 = mp_obj_get_int(args[ARG_y2].u_obj); } - // Check x,y are within self (target) bitmap boundary if ( (x < 0) || (y < 0) || (x > self->width) || (y > self->height) ) { mp_raise_ValueError(translate("(x,y): out of range of target bitmap")); } // Check x1,y1,x2,y2 are within source bitmap boundary - if ( (x1 < 0) || (x1 > source->width) || - (y1 < 0) || (y1 > source->height) || + if ( (x1 < 0) || (x1 > source->width) || + (y1 < 0) || (y1 > source->height) || (x2 < 0) || (x2 > source->width) || (y2 < 0) || (y2 > source->height) ) { mp_raise_ValueError(translate("(x1,y1) or (x2,y2): out of range of source bitmap")); } - // Ensure x1 < x2 and y1 < y2 if (x1 > x2) { int16_t temp=x2; @@ -254,7 +253,7 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg y1=temp; } - uint32_t skip_index; + uint32_t skip_index; bool skip_index_none; // flag whether skip_value was None if (args[ARG_skip_index].u_obj == mp_const_none ) { @@ -263,7 +262,7 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg } else { skip_index = mp_obj_get_int(args[ARG_skip_index].u_obj); skip_index_none = false; - } + } common_hal_displayio_bitmap_blit(self, x, y, source, x1, y1, x2, y2, skip_index, skip_index_none); diff --git a/shared-bindings/displayio/Bitmap.h b/shared-bindings/displayio/Bitmap.h index cf75f3d764..00cd98b0a9 100644 --- a/shared-bindings/displayio/Bitmap.h +++ b/shared-bindings/displayio/Bitmap.h @@ -40,8 +40,8 @@ uint16_t common_hal_displayio_bitmap_get_height(displayio_bitmap_t *self); uint16_t common_hal_displayio_bitmap_get_width(displayio_bitmap_t *self); uint32_t common_hal_displayio_bitmap_get_bits_per_value(displayio_bitmap_t *self); void common_hal_displayio_bitmap_set_pixel(displayio_bitmap_t *bitmap, int16_t x, int16_t y, uint32_t value); -void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16_t y, displayio_bitmap_t *source, - int16_t x1, int16_t y1, int16_t x2, int16_t y2, +void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16_t y, displayio_bitmap_t *source, + int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint32_t skip_index, bool skip_index_none); uint32_t common_hal_displayio_bitmap_get_pixel(displayio_bitmap_t *bitmap, int16_t x, int16_t y); void common_hal_displayio_bitmap_fill(displayio_bitmap_t *bitmap, uint32_t value); diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index 7de9e9755e..e581d849d9 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -110,7 +110,7 @@ void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16 // Copy complete "source" bitmap into "self" bitmap at location x,y in the "self" // Add a boolean to determine if all values are copied, or only if non-zero // - // If skip_value is encountered in the source bitmap, it will not be copied. + // If skip_value is encountered in the source bitmap, it will not be copied. // If skip_value is `None`, then all pixels are copied. if (self->read_only) { From ba5dedc1df768bfac05db844f6220c4756c24223 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Thu, 13 Aug 2020 20:57:17 -0500 Subject: [PATCH 0595/1293] deleted whitespace --- shared-module/displayio/Bitmap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index e581d849d9..b470cecc35 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -105,11 +105,10 @@ uint32_t common_hal_displayio_bitmap_get_pixel(displayio_bitmap_t *self, int16_t return 0; } -void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16_t y, displayio_bitmap_t *source, - int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint32_t skip_index, bool skip_index_none) { +void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16_t y, displayio_bitmap_t *source, + int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint32_t skip_index, bool skip_index_none) { // Copy complete "source" bitmap into "self" bitmap at location x,y in the "self" // Add a boolean to determine if all values are copied, or only if non-zero - // // If skip_value is encountered in the source bitmap, it will not be copied. // If skip_value is `None`, then all pixels are copied. From fc1347ac2a0b467c1cbd9ac4a8ecf117bcdbb96a Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Thu, 13 Aug 2020 20:58:29 -0500 Subject: [PATCH 0596/1293] deleted whitespace --- shared-module/displayio/Bitmap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index b470cecc35..2f87a89448 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -129,7 +129,6 @@ void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16 } } } - } From 0c1768010bbe8cda69ebddf00c5112c3729e37bb Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Fri, 14 Aug 2020 13:43:32 -0500 Subject: [PATCH 0597/1293] Cleaning up with tannewt's help and adding the translation file --- locale/circuitpython.pot | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 3eb5b1ced2..5ee0a04859 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 13:10-0500\n" +"POT-Creation-Date: 2020-08-14 13:42-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -82,8 +82,6 @@ msgstr "" msgid "%q list must be a list" msgstr "" -#: shared-bindings/memorymonitor/AllocationAlarm 3.c -#: shared-bindings/memorymonitor/AllocationAlarm 4.c #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" msgstr "" @@ -91,8 +89,6 @@ msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm 3.c -#: shared-bindings/memorymonitor/AllocationAlarm 4.c #: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" @@ -318,7 +314,6 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "" -#: ports/atmel-samd/common-hal/_pew/PewPew 2.c #: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c @@ -335,11 +330,7 @@ msgstr "" msgid "Already advertising." msgstr "" -#: shared-module/memorymonitor/AllocationAlarm 3.c -#: shared-module/memorymonitor/AllocationAlarm 4.c #: shared-module/memorymonitor/AllocationAlarm.c -#: shared-module/memorymonitor/AllocationSize 3.c -#: shared-module/memorymonitor/AllocationSize 4.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" msgstr "" @@ -379,8 +370,6 @@ msgstr "" msgid "At most %d %q may be specified (not %d)" msgstr "" -#: shared-module/memorymonitor/AllocationAlarm 3.c -#: shared-module/memorymonitor/AllocationAlarm 4.c #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -514,8 +503,6 @@ msgid "Cannot blit: source palette too large." msgstr "" #: shared-bindings/displayio/Bitmap.c -#: shared-bindings/memorymonitor/AllocationSize 3.c -#: shared-bindings/memorymonitor/AllocationSize 4.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" @@ -1039,7 +1026,6 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral 2.c #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c @@ -1396,8 +1382,6 @@ msgstr "" msgid "Random number generation error" msgstr "" -#: shared-bindings/memorymonitor/AllocationSize 3.c -#: shared-bindings/memorymonitor/AllocationSize 4.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" @@ -1490,8 +1474,6 @@ msgstr "" #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/TileGrid.c -#: shared-bindings/memorymonitor/AllocationSize 3.c -#: shared-bindings/memorymonitor/AllocationSize 4.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" @@ -1821,14 +1803,10 @@ msgstr "" msgid "address %08x is not aligned to %d bytes" msgstr "" -#: shared-bindings/i2cperipheral/I2CPeripheral 3.c -#: shared-bindings/i2cperipheral/I2CPeripheral 4.c #: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cperipheral/I2CPeripheral 3.c -#: shared-bindings/i2cperipheral/I2CPeripheral 4.c #: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1991,9 +1969,7 @@ msgstr "" msgid "can't assign to expression" msgstr "" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral 3.c -#: shared-bindings/i2cperipheral/I2CPeripheral 4.c -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert %q to %q" msgstr "" From e84723abba89f346cd9772e217f6f2c7dcf2b703 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Fri, 14 Aug 2020 14:22:34 -0500 Subject: [PATCH 0598/1293] Bug fixes related to input parameter handling x1,y1. Update comments --- locale/circuitpython.pot | 2 +- shared-bindings/displayio/Bitmap.c | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 5ee0a04859..d697f15c81 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 13:42-0500\n" +"POT-Creation-Date: 2020-08-14 14:20-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 9479dc1a51..f2123135f6 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -182,8 +182,8 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val //| :param bitmap source_bitmap: Source bitmap that contains the graphical region to be copied //| : param int x1: Minimum x-value for rectangular bounding box to be copied from the source bitmap //| : param int y1: Minimum y-value for rectangular bounding box to be copied from the source bitmap -//| : param int x2: Maximum x-value for rectangular bounding box to be copied from the source bitmap -//| : param int y2: Maximum y-value for rectangular bounding box to be copied from the source bitmap +//| : param int x2: Maximum x-value (exclusive) for rectangular bounding box to be copied from the source bitmap +//| : param int y2: Maximum y-value (exclusive) for rectangular bounding box to be copied from the source bitmap //| : param int skip_index: bitmap palette index in the source that will not be copied, //| set `None` to copy all pixels""" //| ... @@ -195,8 +195,8 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg {MP_QSTR_x, MP_ARG_REQUIRED | MP_ARG_INT}, {MP_QSTR_y, MP_ARG_REQUIRED | MP_ARG_INT}, {MP_QSTR_source_bitmap, MP_ARG_REQUIRED | MP_ARG_OBJ}, - {MP_QSTR_x1, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = 0} }, - {MP_QSTR_y1, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = 0} }, + {MP_QSTR_x1, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, + {MP_QSTR_y1, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, {MP_QSTR_x2, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to source->width {MP_QSTR_y2, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to source->height {MP_QSTR_skip_index, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj=mp_const_none} }, @@ -216,7 +216,9 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg mp_raise_ValueError(translate("Cannot blit: source palette too large.")); } - int16_t x1, y1, x2, y2; + int16_t x1 = args[ARG_x1].u_int; + int16_t y1 = args[ARG_y1].u_int; + int16_t x2, y2; // if x2 or y2 is None, then set as the maximum size of the source bitmap if ( args[ARG_x2].u_obj == mp_const_none ) { x2 = source->width; From bfa9904f3e036d5c72cc2bd10ec4333d1f4fd58b Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Fri, 14 Aug 2020 14:28:06 -0500 Subject: [PATCH 0599/1293] Corrected erroneous edit to fill description to -> None --- shared-bindings/displayio/Bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index f2123135f6..b9a4fe47df 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -273,7 +273,7 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg MP_DEFINE_CONST_FUN_OBJ_KW(displayio_bitmap_blit_obj, 4, displayio_bitmap_obj_blit); // `displayio_bitmap_obj_blit` requires at least 4 arguments -//| def fill(self, value: Any) -> Any: +//| def fill(self, value: Any) -> None: //| """Fills the bitmap with the supplied palette index value.""" //| ... //| From 88fcc19e24597140fb3e5f45ab8d87705fb4f5ed Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 10 Aug 2020 12:14:16 -0400 Subject: [PATCH 0600/1293] Add PulseIn --- ports/esp32s2/background.c | 7 + ports/esp32s2/common-hal/pulseio/PulseIn.c | 177 +++++++++++++++++++-- ports/esp32s2/common-hal/pulseio/PulseIn.h | 6 + ports/esp32s2/peripherals/rmt.c | 1 + ports/esp32s2/supervisor/port.c | 2 + 5 files changed, 184 insertions(+), 9 deletions(-) diff --git a/ports/esp32s2/background.c b/ports/esp32s2/background.c index 40ce9ecfdf..3160d9974e 100644 --- a/ports/esp32s2/background.c +++ b/ports/esp32s2/background.c @@ -35,10 +35,17 @@ #include "shared-module/displayio/__init__.h" #endif +#if CIRCUITPY_PULSEIO +#include "common-hal/pulseio/PulseIn.h" +#endif + void port_background_task(void) { // Zero delay in case FreeRTOS wants to switch to something else. vTaskDelay(0); + #if CIRCUITPY_PULSEIO + pulsein_background(); + #endif } void port_start_background_task(void) {} diff --git a/ports/esp32s2/common-hal/pulseio/PulseIn.c b/ports/esp32s2/common-hal/pulseio/PulseIn.c index 65fc6631d4..5209c51ca4 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseIn.c +++ b/ports/esp32s2/common-hal/pulseio/PulseIn.c @@ -27,49 +27,208 @@ #include "common-hal/pulseio/PulseIn.h" #include "py/runtime.h" -// STATIC void pulsein_handler(uint8_t num) { -// } +STATIC uint8_t refcount = 0; +STATIC pulseio_pulsein_obj_t * handles[RMT_CHANNEL_MAX]; + +// Requires rmt.c void esp32s2_peripherals_reset_all(void) to reset + +STATIC void update_internal_buffer(pulseio_pulsein_obj_t* self) { + //mp_printf(&mp_plat_print, "Update internal Buffer\n"); + uint32_t length = 0; + rmt_item32_t *items = (rmt_item32_t *) xRingbufferReceive(self->buf_handle, &length, 0); + if (items) { + length /= 4; + //mp_printf(&mp_plat_print, "Length%d\n",length); + // TODO: If the size of the recieve is larger than the buffer, reset it? + + for (size_t i=0; i < length; i++) { + //mp_printf(&mp_plat_print, "Item d0:%d, l0:%d, d1:%d, l1:%d\n",(items[i].duration0 * 3), + // items[i].level0,(items[i].duration1 * 3),items[i].level1); + uint16_t pos = (self->start + self->len) % self->maxlen; + self->buffer[pos] = items[i].duration0 * 3; + // Check if second item exists before incrementing + if (items[i].duration1) { + self->buffer[pos+1] = items[i].duration1 * 3; + if (self->len < (self->maxlen - 1)) { + self->len += 2; + } else { + self->start += 2; + } + } else { + if (self->len < self->maxlen) { + self->len++; + } else { + self->start++; + } + } + } + vRingbufferReturnItem(self->buf_handle, (void *) items); + } +} + +// We can't access the RMT interrupt, so we need a global service to prevent +// the ringbuffer from overflowing and crashing the peripheral +void pulsein_background(void) { + //mp_printf(&mp_plat_print, "BG Task!\n"); + for (size_t i = 0; i < RMT_CHANNEL_MAX; i++) { + if (handles[i]) { + //mp_printf(&mp_plat_print, "Located viable handle:%d\n",i); + update_internal_buffer(handles[i]); + UBaseType_t items_waiting; + vRingbufferGetInfo(handles[i]->buf_handle, NULL, NULL, NULL, NULL, &items_waiting); + //mp_printf(&mp_plat_print, "items waiting:%d\n",items_waiting); + // if (items_waiting > handles[i]->maxlen) { + // mp_printf(&mp_plat_print, "Overage!\n"); + // mp_printf(&mp_plat_print, "Items waiting detected:%d\n", items_waiting); + // update_internal_buffer(handles[i]); + // } + } + } +} void pulsein_reset(void) { + mp_printf(&mp_plat_print, "Pulsein Reset called\n"); + for (size_t i = 0; i < RMT_CHANNEL_MAX; i++) { + handles[i] = NULL; + } + supervisor_disable_tick(); + refcount = 0; } void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu_pin_obj_t* pin, uint16_t maxlen, bool idle_state) { - mp_raise_NotImplementedError(translate("PulseIn not supported on this chip")); + self->buffer = (uint16_t *) m_malloc(maxlen * sizeof(uint16_t), false); + if (self->buffer == NULL) { + mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), maxlen * sizeof(uint16_t)); + } + self->pin = pin; + self->maxlen = maxlen; + // self->idle_state = idle_state; + self->start = 0; + self->len = 0; + // self->first_edge = true; + self->paused = false; + // self->last_overflow = 0; + // self->last_count = 0; + + rmt_channel_t channel = esp32s2_peripherals_find_and_reserve_rmt(); + mp_printf(&mp_plat_print, "Selected Channel:%d!\n",channel); + + // Configure Channel + rmt_config_t config = RMT_DEFAULT_CONFIG_RX(pin->number, channel); + config.rx_config.filter_en = true; + config.rx_config.idle_threshold = 30000; + config.clk_div = 240; + + rmt_config(&config); + size_t len = 1000; //TODO: pick a reasonable number for this? + // size_t len = maxlen * 4; + rmt_driver_install(channel, len, 0); + + self->channel = channel; + + // Store handle for background updates + handles[channel] = self; + + rmt_get_ringbuf_handle(channel, &(self->buf_handle)); + rmt_rx_start(channel, true); + + supervisor_enable_tick(); + refcount++; } bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t* self) { - return false; + return handles[self->channel] ? true : false; } void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) { + handles[self->channel] = NULL; + esp32s2_peripherals_free_rmt(self->channel); + reset_pin_number(self->pin); + refcount--; + if (refcount == 0) { + supervisor_disable_tick(); + } } void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t* self) { + self->paused = true; + rmt_rx_stop(); } void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t* self, uint16_t trigger_duration) { + // Make sure we're paused. + if ( !self->paused ) { + common_hal_pulseio_pulsein_pause(self); + } + + self->paused = false; + rmt_rx_start(); } void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t* self) { + self->start = 0; + self->len = 0; } uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t* self, int16_t index) { - return false; + //mp_printf(&mp_plat_print, "Call GetItem\n"); + update_internal_buffer(self); + if (index < 0) { + index += self->len; + } + if (index < 0 || index >= self->len) { + mp_raise_IndexError(translate("index out of range")); + } + uint16_t value = self->buffer[(self->start + index) % self->maxlen]; + return value; } uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { - return false; + mp_printf(&mp_plat_print, "Call PopLeft\n"); + update_internal_buffer(self); + + if (self->len == 0) { + mp_raise_IndexError(translate("pop from an empty PulseIn")); + } + + uint16_t value = self->buffer[self->start]; + self->start = (self->start + 1) % self->maxlen; + self->len--; + + return value; + + + // uint32_t length = 0; + // rmt_item32_t *items = (rmt_item32_t *) xRingbufferReceive(self->buf_handle, &length, 10); + // mp_printf(&mp_plat_print, "Length%d\n",length); + // if (items) { + // length /= 4; + // mp_printf(&mp_plat_print, "Length%d\n",length); + // for (size_t i=0; i < length; i++) { + // mp_printf(&mp_plat_print, "Item d0:%d, l0:%d, d1:%d, l1:%d\n",(items[i].duration0 * 3), + // items[i].level0,(items[i].duration1 * 3),items[i].level1); + // } + // vRingbufferReturnItem(self->buf_handle, (void *) items); + // } + // // while(items) { + // // mp_printf(&mp_plat_print, "Length%d",length); + // // mp_printf(&mp_plat_print, "Item val0:%d, val1:%d, val:%d",items->duration0, + // // items->duration1,items->val); + // // vRingbufferReturnItem(self->buf_handle, (void *) items); + // // items = (rmt_item32_t *) xRingbufferReceive(self->buf_handle, &length, 1); + // // } + // return items ? items[0].duration0 : false; } uint16_t common_hal_pulseio_pulsein_get_maxlen(pulseio_pulsein_obj_t* self) { - return false; + return self->maxlen; } bool common_hal_pulseio_pulsein_get_paused(pulseio_pulsein_obj_t* self) { - return false; + return self->paused; } uint16_t common_hal_pulseio_pulsein_get_len(pulseio_pulsein_obj_t* self) { - return false; + return self->len; } diff --git a/ports/esp32s2/common-hal/pulseio/PulseIn.h b/ports/esp32s2/common-hal/pulseio/PulseIn.h index b317c516c1..1ac47cfe10 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseIn.h +++ b/ports/esp32s2/common-hal/pulseio/PulseIn.h @@ -30,13 +30,18 @@ #include "common-hal/microcontroller/Pin.h" #include "py/obj.h" +#include "driver/rmt.h" +#include "rmt.h" typedef struct { mp_obj_base_t base; const mcu_pin_obj_t* pin; + rmt_channel_t channel; bool idle_state; bool paused; + + RingbufHandle_t buf_handle; volatile bool first_edge; uint16_t* buffer; @@ -49,5 +54,6 @@ typedef struct { } pulseio_pulsein_obj_t; void pulsein_reset(void); +void pulsein_background(void); #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEIN_H diff --git a/ports/esp32s2/peripherals/rmt.c b/ports/esp32s2/peripherals/rmt.c index 16605edf5e..c3a063eecc 100644 --- a/ports/esp32s2/peripherals/rmt.c +++ b/ports/esp32s2/peripherals/rmt.c @@ -30,6 +30,7 @@ bool rmt_reserved_channels[RMT_CHANNEL_MAX]; void esp32s2_peripherals_rmt_reset(void) { + mp_printf(&mp_plat_print, "RMT Reset called\n"); for (size_t i = 0; i < RMT_CHANNEL_MAX; i++) { if (rmt_reserved_channels[i]) { esp32s2_peripherals_free_rmt(i); diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index d287079b79..46590b5513 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -39,6 +39,7 @@ #include "common-hal/busio/SPI.h" #include "common-hal/busio/UART.h" #include "common-hal/pulseio/PWMOut.h" +#include "common-hal/pulseio/PulseIn.h" #include "supervisor/memory.h" #include "supervisor/shared/tick.h" @@ -70,6 +71,7 @@ void reset_port(void) { #if CIRCUITPY_PULSEIO esp32s2_peripherals_rmt_reset(); pwmout_reset(); + pulsein_reset(); #endif #if CIRCUITPY_BUSIO i2c_reset(); From 0fc730bc5aeab1187a0b175aa4d390c0e7da7e1b Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 14 Aug 2020 16:33:24 -0400 Subject: [PATCH 0601/1293] Expand PulseOut API, debug cleanup --- .../atmel-samd/common-hal/pulseio/PulseOut.c | 10 +- ports/cxd56/common-hal/pulseio/PulseOut.c | 12 ++- ports/esp32s2/common-hal/pulseio/PulseIn.c | 91 +++++++------------ ports/esp32s2/common-hal/pulseio/PulseIn.h | 3 - ports/esp32s2/common-hal/pulseio/PulseOut.c | 12 ++- ports/esp32s2/mpconfigport.h | 2 - ports/esp32s2/peripherals/rmt.c | 1 - .../mimxrt10xx/common-hal/pulseio/PulseOut.c | 5 +- ports/nrf/common-hal/pulseio/PulseOut.c | 10 +- ports/stm/common-hal/pulseio/PulseOut.c | 10 +- shared-bindings/pulseio/PulseOut.c | 39 ++++---- shared-bindings/pulseio/PulseOut.h | 10 +- 12 files changed, 102 insertions(+), 103 deletions(-) diff --git a/ports/atmel-samd/common-hal/pulseio/PulseOut.c b/ports/atmel-samd/common-hal/pulseio/PulseOut.c index e9b2137cb0..de2f7b8d2a 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseOut.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseOut.c @@ -96,7 +96,15 @@ void pulseout_reset() { } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, - const pulseio_pwmout_obj_t* carrier) { + const pulseio_pwmout_obj_t* carrier, + const mcu_pin_obj_t* pin, + uint32_t frequency, + uint16_t duty_cycle) { + if (!carrier || pin || frequency) { + mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. \ + Construct and pass a PWM Carrier instead")); + } + if (refcount == 0) { // Find a spare timer. Tc *tc = NULL; diff --git a/ports/cxd56/common-hal/pulseio/PulseOut.c b/ports/cxd56/common-hal/pulseio/PulseOut.c index 21b4c77e55..2851a04658 100644 --- a/ports/cxd56/common-hal/pulseio/PulseOut.c +++ b/ports/cxd56/common-hal/pulseio/PulseOut.c @@ -58,8 +58,16 @@ static bool pulseout_timer_handler(unsigned int *next_interval_us, void *arg) return true; } -void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self, - const pulseio_pwmout_obj_t *carrier) { +void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, + const pulseio_pwmout_obj_t* carrier, + const mcu_pin_obj_t* pin, + uint32_t frequency, + uint16_t duty_cycle) { + if (!carrier || pin || frequency) { + mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. \ + Construct and pass a PWM Carrier instead")); + } + if (pulse_fd < 0) { pulse_fd = open("/dev/timer0", O_RDONLY); } diff --git a/ports/esp32s2/common-hal/pulseio/PulseIn.c b/ports/esp32s2/common-hal/pulseio/PulseIn.c index 5209c51ca4..d741628305 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseIn.c +++ b/ports/esp32s2/common-hal/pulseio/PulseIn.c @@ -25,6 +25,7 @@ */ #include "common-hal/pulseio/PulseIn.h" +#include "shared-bindings/microcontroller/__init__.h" #include "py/runtime.h" STATIC uint8_t refcount = 0; @@ -33,17 +34,11 @@ STATIC pulseio_pulsein_obj_t * handles[RMT_CHANNEL_MAX]; // Requires rmt.c void esp32s2_peripherals_reset_all(void) to reset STATIC void update_internal_buffer(pulseio_pulsein_obj_t* self) { - //mp_printf(&mp_plat_print, "Update internal Buffer\n"); uint32_t length = 0; rmt_item32_t *items = (rmt_item32_t *) xRingbufferReceive(self->buf_handle, &length, 0); if (items) { length /= 4; - //mp_printf(&mp_plat_print, "Length%d\n",length); - // TODO: If the size of the recieve is larger than the buffer, reset it? - for (size_t i=0; i < length; i++) { - //mp_printf(&mp_plat_print, "Item d0:%d, l0:%d, d1:%d, l1:%d\n",(items[i].duration0 * 3), - // items[i].level0,(items[i].duration1 * 3),items[i].level1); uint16_t pos = (self->start + self->len) % self->maxlen; self->buffer[pos] = items[i].duration0 * 3; // Check if second item exists before incrementing @@ -69,25 +64,16 @@ STATIC void update_internal_buffer(pulseio_pulsein_obj_t* self) { // We can't access the RMT interrupt, so we need a global service to prevent // the ringbuffer from overflowing and crashing the peripheral void pulsein_background(void) { - //mp_printf(&mp_plat_print, "BG Task!\n"); for (size_t i = 0; i < RMT_CHANNEL_MAX; i++) { if (handles[i]) { - //mp_printf(&mp_plat_print, "Located viable handle:%d\n",i); update_internal_buffer(handles[i]); UBaseType_t items_waiting; vRingbufferGetInfo(handles[i]->buf_handle, NULL, NULL, NULL, NULL, &items_waiting); - //mp_printf(&mp_plat_print, "items waiting:%d\n",items_waiting); - // if (items_waiting > handles[i]->maxlen) { - // mp_printf(&mp_plat_print, "Overage!\n"); - // mp_printf(&mp_plat_print, "Items waiting detected:%d\n", items_waiting); - // update_internal_buffer(handles[i]); - // } } } } void pulsein_reset(void) { - mp_printf(&mp_plat_print, "Pulsein Reset called\n"); for (size_t i = 0; i < RMT_CHANNEL_MAX; i++) { handles[i] = NULL; } @@ -103,48 +89,48 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu } self->pin = pin; self->maxlen = maxlen; - // self->idle_state = idle_state; + self->idle_state = idle_state; self->start = 0; self->len = 0; - // self->first_edge = true; self->paused = false; - // self->last_overflow = 0; - // self->last_count = 0; + // Set pull settings + gpio_pullup_dis(pin->number); + gpio_pulldown_dis(pin->number); + if (idle_state) { + gpio_pullup_en(pin->number); + } else { + gpio_pulldown_en(pin->number); + } + + // Find a free RMT Channel and configure it rmt_channel_t channel = esp32s2_peripherals_find_and_reserve_rmt(); - mp_printf(&mp_plat_print, "Selected Channel:%d!\n",channel); - - // Configure Channel rmt_config_t config = RMT_DEFAULT_CONFIG_RX(pin->number, channel); config.rx_config.filter_en = true; - config.rx_config.idle_threshold = 30000; - config.clk_div = 240; - + config.rx_config.idle_threshold = 30000; // 30*3=90ms idle required to register a sequence + config.clk_div = 240; // All measurements are divided by 3 to accomodate 65ms pulses rmt_config(&config); - size_t len = 1000; //TODO: pick a reasonable number for this? - // size_t len = maxlen * 4; - rmt_driver_install(channel, len, 0); + rmt_driver_install(channel, 1000, 0); //TODO: pick a more specific buffer size? + // Store this object and the buffer handle for background updates self->channel = channel; - - // Store handle for background updates handles[channel] = self; - rmt_get_ringbuf_handle(channel, &(self->buf_handle)); - rmt_rx_start(channel, true); + // start RMT RX, and enable ticks so the core doesn't turn off. + rmt_rx_start(channel, true); supervisor_enable_tick(); refcount++; } bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t* self) { - return handles[self->channel] ? true : false; + return handles[self->channel] ? false : true; } void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) { handles[self->channel] = NULL; esp32s2_peripherals_free_rmt(self->channel); - reset_pin_number(self->pin); + reset_pin_number(self->pin->number); refcount--; if (refcount == 0) { supervisor_disable_tick(); @@ -153,7 +139,7 @@ void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) { void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t* self) { self->paused = true; - rmt_rx_stop(); + rmt_rx_stop(self->channel); } void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t* self, uint16_t trigger_duration) { @@ -162,17 +148,25 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t* self, uint16_t tri common_hal_pulseio_pulsein_pause(self); } + if (trigger_duration > 0) { + gpio_set_direction(self->pin->number, GPIO_MODE_DEF_OUTPUT); + gpio_set_level(self->pin->number, !self->idle_state); + common_hal_mcu_delay_us((uint32_t)trigger_duration); + gpio_set_level(self->pin->number, self->idle_state); + gpio_set_direction(self->pin->number, GPIO_MODE_INPUT); // should revert to pull direction + } + self->paused = false; - rmt_rx_start(); + rmt_rx_start(self->channel, false); } void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t* self) { + // Buffer only updates in BG tasks or fetches, so no extra protection is needed self->start = 0; self->len = 0; } uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t* self, int16_t index) { - //mp_printf(&mp_plat_print, "Call GetItem\n"); update_internal_buffer(self); if (index < 0) { index += self->len; @@ -185,7 +179,6 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t* self, int16_ } uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { - mp_printf(&mp_plat_print, "Call PopLeft\n"); update_internal_buffer(self); if (self->len == 0) { @@ -197,28 +190,6 @@ uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { self->len--; return value; - - - // uint32_t length = 0; - // rmt_item32_t *items = (rmt_item32_t *) xRingbufferReceive(self->buf_handle, &length, 10); - // mp_printf(&mp_plat_print, "Length%d\n",length); - // if (items) { - // length /= 4; - // mp_printf(&mp_plat_print, "Length%d\n",length); - // for (size_t i=0; i < length; i++) { - // mp_printf(&mp_plat_print, "Item d0:%d, l0:%d, d1:%d, l1:%d\n",(items[i].duration0 * 3), - // items[i].level0,(items[i].duration1 * 3),items[i].level1); - // } - // vRingbufferReturnItem(self->buf_handle, (void *) items); - // } - // // while(items) { - // // mp_printf(&mp_plat_print, "Length%d",length); - // // mp_printf(&mp_plat_print, "Item val0:%d, val1:%d, val:%d",items->duration0, - // // items->duration1,items->val); - // // vRingbufferReturnItem(self->buf_handle, (void *) items); - // // items = (rmt_item32_t *) xRingbufferReceive(self->buf_handle, &length, 1); - // // } - // return items ? items[0].duration0 : false; } uint16_t common_hal_pulseio_pulsein_get_maxlen(pulseio_pulsein_obj_t* self) { diff --git a/ports/esp32s2/common-hal/pulseio/PulseIn.h b/ports/esp32s2/common-hal/pulseio/PulseIn.h index 1ac47cfe10..97d70d4b03 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseIn.h +++ b/ports/esp32s2/common-hal/pulseio/PulseIn.h @@ -42,15 +42,12 @@ typedef struct { bool paused; RingbufHandle_t buf_handle; - volatile bool first_edge; uint16_t* buffer; uint16_t maxlen; volatile uint16_t start; volatile uint16_t len; - volatile uint32_t last_overflow; - volatile uint16_t last_count; } pulseio_pulsein_obj_t; void pulsein_reset(void); diff --git a/ports/esp32s2/common-hal/pulseio/PulseOut.c b/ports/esp32s2/common-hal/pulseio/PulseOut.c index dc93d7e964..463443ef0c 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseOut.c +++ b/ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -32,15 +32,21 @@ // Requires rmt.c void esp32s2_peripherals_reset_all(void) to reset void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, - const mcu_pin_obj_t* pin, - uint32_t frequency) { + const pulseio_pwmout_obj_t* carrier, + const mcu_pin_obj_t* pin, + uint32_t frequency, + uint16_t duty_cycle) { + if (carrier || !pin || !frequency) { + mp_raise_NotImplementedError(translate("Port does not accept PWM carrier. \ + Pass a pin, frequency and duty cycle instead")); + } rmt_channel_t channel = esp32s2_peripherals_find_and_reserve_rmt(); // Configure Channel rmt_config_t config = RMT_DEFAULT_CONFIG_TX(pin->number, channel); config.tx_config.carrier_en = true; - config.tx_config.carrier_duty_percent = 50; + config.tx_config.carrier_duty_percent = (duty_cycle * 100) / (1<<16); config.tx_config.carrier_freq_hz = frequency; config.clk_div = 80; diff --git a/ports/esp32s2/mpconfigport.h b/ports/esp32s2/mpconfigport.h index 6b070afea6..07f83434af 100644 --- a/ports/esp32s2/mpconfigport.h +++ b/ports/esp32s2/mpconfigport.h @@ -36,8 +36,6 @@ #include "py/circuitpy_mpconfig.h" -#define CPY_PULSEOUT_USES_DIGITALIO (1) - #define MICROPY_PORT_ROOT_POINTERS \ CIRCUITPY_COMMON_ROOT_POINTERS #define MICROPY_NLR_SETJMP (1) diff --git a/ports/esp32s2/peripherals/rmt.c b/ports/esp32s2/peripherals/rmt.c index c3a063eecc..16605edf5e 100644 --- a/ports/esp32s2/peripherals/rmt.c +++ b/ports/esp32s2/peripherals/rmt.c @@ -30,7 +30,6 @@ bool rmt_reserved_channels[RMT_CHANNEL_MAX]; void esp32s2_peripherals_rmt_reset(void) { - mp_printf(&mp_plat_print, "RMT Reset called\n"); for (size_t i = 0; i < RMT_CHANNEL_MAX; i++) { if (rmt_reserved_channels[i]) { esp32s2_peripherals_free_rmt(i); diff --git a/ports/mimxrt10xx/common-hal/pulseio/PulseOut.c b/ports/mimxrt10xx/common-hal/pulseio/PulseOut.c index ffa885688a..3aefd87662 100644 --- a/ports/mimxrt10xx/common-hal/pulseio/PulseOut.c +++ b/ports/mimxrt10xx/common-hal/pulseio/PulseOut.c @@ -94,7 +94,10 @@ void pulseout_reset() { } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, - const pulseio_pwmout_obj_t* carrier) { + const pulseio_pwmout_obj_t* carrier, + const mcu_pin_obj_t* pin, + uint32_t frequency, + uint16_t duty_cycle) { // if (refcount == 0) { // // Find a spare timer. // Tc *tc = NULL; diff --git a/ports/nrf/common-hal/pulseio/PulseOut.c b/ports/nrf/common-hal/pulseio/PulseOut.c index 270cb45d6d..9f5efcfdc6 100644 --- a/ports/nrf/common-hal/pulseio/PulseOut.c +++ b/ports/nrf/common-hal/pulseio/PulseOut.c @@ -100,7 +100,15 @@ void pulseout_reset() { } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, - const pulseio_pwmout_obj_t* carrier) { + const pulseio_pwmout_obj_t* carrier, + const mcu_pin_obj_t* pin, + uint32_t frequency, + uint16_t duty_cycle) { + if (!carrier || pin || frequency) { + mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. \ + Construct and pass a PWM Carrier instead")); + } + if (refcount == 0) { timer = nrf_peripherals_allocate_timer_or_throw(); } diff --git a/ports/stm/common-hal/pulseio/PulseOut.c b/ports/stm/common-hal/pulseio/PulseOut.c index bcc25d8177..33311fd53d 100644 --- a/ports/stm/common-hal/pulseio/PulseOut.c +++ b/ports/stm/common-hal/pulseio/PulseOut.c @@ -113,7 +113,15 @@ void pulseout_reset() { } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, - const pulseio_pwmout_obj_t* carrier) { + const pulseio_pwmout_obj_t* carrier, + const mcu_pin_obj_t* pin, + uint32_t frequency, + uint16_t duty_cycle) { + if (!carrier || pin || frequency) { + mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. \ + Construct and pass a PWM Carrier instead")); + } + // Add to active PulseOuts refcount++; TIM_TypeDef * tim_instance = stm_peripherals_find_timer(); diff --git a/shared-bindings/pulseio/PulseOut.c b/shared-bindings/pulseio/PulseOut.c index 10524f51b3..2adbc3cf6a 100644 --- a/shared-bindings/pulseio/PulseOut.c +++ b/shared-bindings/pulseio/PulseOut.c @@ -69,29 +69,24 @@ STATIC mp_obj_t pulseio_pulseout_make_new(const mp_obj_type_t *type, size_t n_ar pulseio_pulseout_obj_t *self = m_new_obj(pulseio_pulseout_obj_t); self->base.type = &pulseio_pulseout_type; - #ifndef CPY_PULSEOUT_USES_DIGITALIO - // Most ports pass a PWMOut - mp_arg_check_num(n_args, kw_args, 1, 1, false); - mp_obj_t carrier_obj = args[0]; - if (!MP_OBJ_IS_TYPE(carrier_obj, &pulseio_pwmout_type)) { - mp_raise_TypeError_varg(translate("Expected a %q"), pulseio_pwmout_type.name); + mp_obj_t carrier_obj = pos_args[0]; + if (MP_OBJ_IS_TYPE(carrier_obj, &pulseio_pwmout_type)) { + // PWM Carrier + mp_arg_check_num(n_args, kw_args, 1, 1, false); + common_hal_pulseio_pulseout_construct(self, (pulseio_pwmout_obj_t *)MP_OBJ_TO_PTR(carrier_obj), NULL, 0, 0); + } else { + // Pin and Frequency + enum { ARG_pin, ARG_frequency}; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_pin, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_frequency, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 38000} }, + { MP_QSTR_duty_cycle, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1<<15} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + const mcu_pin_obj_t* pin = validate_obj_is_free_pin(args[ARG_pin].u_obj); + common_hal_pulseio_pulseout_construct(self, NULL, pin, args[ARG_frequency].u_int, args[ARG_frequency].u_int); } - common_hal_pulseio_pulseout_construct(self, (pulseio_pwmout_obj_t *)MP_OBJ_TO_PTR(carrier_obj)); - #else - // ESP32-S2 Special Case - enum { ARG_pin, ARG_frequency}; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_pin, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_frequency, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 38000} }, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - - const mcu_pin_obj_t* pin = validate_obj_is_free_pin(args[ARG_pin].u_obj); - - common_hal_pulseio_pulseout_construct(self, pin, args[ARG_frequency].u_int); - #endif - return MP_OBJ_FROM_PTR(self); } diff --git a/shared-bindings/pulseio/PulseOut.h b/shared-bindings/pulseio/PulseOut.h index 090f6d15c6..9d4778e93d 100644 --- a/shared-bindings/pulseio/PulseOut.h +++ b/shared-bindings/pulseio/PulseOut.h @@ -33,13 +33,11 @@ extern const mp_obj_type_t pulseio_pulseout_type; -#ifndef CPY_PULSEOUT_USES_DIGITALIO extern void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, - const pulseio_pwmout_obj_t* carrier); -#else -extern void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, - const mcu_pin_obj_t* pin, uint32_t frequency); -#endif + const pulseio_pwmout_obj_t* carrier, + const mcu_pin_obj_t* pin, + uint32_t frequency, + uint16_t duty_cycle); extern void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t* self); extern bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t* self); From 7078c63062a0130bfeee3b4f8c21bab625339965 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 14 Aug 2020 16:58:24 -0400 Subject: [PATCH 0602/1293] Add missing Neopixel pin definition --- ports/esp32s2/boards/espressif_saola_1_wroom/pins.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/pins.c b/ports/esp32s2/boards/espressif_saola_1_wroom/pins.c index 1d4e2c4eba..0562d9331f 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/pins.c +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/pins.c @@ -42,5 +42,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 1c8e11b2cb74656d0dcde1ba5bec8fabb8b0461b Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 14 Aug 2020 23:38:58 -0400 Subject: [PATCH 0603/1293] bug in char get_value; raise NotImpl; better arg validation --- devices/ble_hci/common-hal/_bleio/Adapter.c | 8 ++++++++ devices/ble_hci/common-hal/_bleio/Characteristic.c | 4 +++- devices/ble_hci/common-hal/_bleio/Descriptor.c | 2 +- shared-bindings/_bleio/Characteristic.c | 12 ++++++++++-- shared-bindings/_bleio/Descriptor.c | 11 +++++++++-- 5 files changed, 31 insertions(+), 6 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index fe32241d17..b197659ac2 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -346,6 +346,8 @@ void common_hal_bleio_adapter_set_name(bleio_adapter_obj_t *self, const char* na // } mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t* prefixes, size_t prefix_length, bool extended, mp_int_t buffer_size, mp_float_t timeout, mp_float_t interval, mp_float_t window, mp_int_t minimum_rssi, bool active) { + // TODO + mp_raise_NotImplementedError(NULL); check_enabled(self); if (self->scan_results != NULL) { @@ -392,6 +394,8 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t* } void common_hal_bleio_adapter_stop_scan(bleio_adapter_obj_t *self) { + // TODO + mp_raise_NotImplementedError(NULL); check_enabled(self); // If not already scanning, no problem. @@ -430,6 +434,8 @@ void common_hal_bleio_adapter_stop_scan(bleio_adapter_obj_t *self) { // } mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_address_obj_t *address, mp_float_t timeout) { + // TODO + mp_raise_NotImplementedError(NULL); check_enabled(self); @@ -742,6 +748,8 @@ mp_obj_t common_hal_bleio_adapter_get_connections(bleio_adapter_obj_t *self) { } void common_hal_bleio_adapter_erase_bonding(bleio_adapter_obj_t *self) { + // TODO + mp_raise_NotImplementedError(NULL); check_enabled(self); //FIX bonding_erase_storage(); diff --git a/devices/ble_hci/common-hal/_bleio/Characteristic.c b/devices/ble_hci/common-hal/_bleio/Characteristic.c index 5f9b96b354..393b80459a 100644 --- a/devices/ble_hci/common-hal/_bleio/Characteristic.c +++ b/devices/ble_hci/common-hal/_bleio/Characteristic.c @@ -93,7 +93,9 @@ size_t common_hal_bleio_characteristic_get_value(bleio_characteristic_obj_t *sel if (!mp_get_buffer(self->value, &bufinfo, MP_BUFFER_READ)) { return 0; } - memcpy(buf, bufinfo.buf, MIN(len, bufinfo.len)); + const size_t actual_length = MIN(len, bufinfo.len); + memcpy(buf, bufinfo.buf, actual_length); + return actual_length; } } diff --git a/devices/ble_hci/common-hal/_bleio/Descriptor.c b/devices/ble_hci/common-hal/_bleio/Descriptor.c index cc45a89857..645273e285 100644 --- a/devices/ble_hci/common-hal/_bleio/Descriptor.c +++ b/devices/ble_hci/common-hal/_bleio/Descriptor.c @@ -74,7 +74,7 @@ size_t common_hal_bleio_descriptor_get_value(bleio_descriptor_obj_t *self, uint8 if (!mp_get_buffer(self->value, &bufinfo, MP_BUFFER_READ)) { return 0; } - size_t actual_length = MIN(len, bufinfo.len); + const size_t actual_length = MIN(len, bufinfo.len); memcpy(buf, bufinfo.buf, actual_length); return actual_length; } diff --git a/shared-bindings/_bleio/Characteristic.c b/shared-bindings/_bleio/Characteristic.c index 24b127e4a3..8372321fbf 100644 --- a/shared-bindings/_bleio/Characteristic.c +++ b/shared-bindings/_bleio/Characteristic.c @@ -109,11 +109,14 @@ STATIC mp_obj_t bleio_characteristic_add_to_service(size_t n_args, const mp_obj_ const bleio_attribute_security_mode_t write_perm = args[ARG_write_perm].u_int; common_hal_bleio_attribute_security_mode_check_valid(write_perm); - const mp_int_t max_length = args[ARG_max_length].u_int; + const mp_int_t max_length_int = args[ARG_max_length].u_int; + if (max_length_int <= 0) { + mp_raise_ValueError(translate("max_length must be > 0")); + } + const size_t max_length = (size_t) max_length_int; const bool fixed_length = args[ARG_fixed_length].u_bool; mp_obj_t initial_value = args[ARG_initial_value].u_obj; - // Length will be validated in common_hal. mp_buffer_info_t initial_value_bufinfo; if (initial_value == mp_const_none) { if (fixed_length && max_length > 0) { @@ -122,7 +125,12 @@ STATIC mp_obj_t bleio_characteristic_add_to_service(size_t n_args, const mp_obj_ initial_value = mp_const_empty_bytes; } } + mp_get_buffer_raise(initial_value, &initial_value_bufinfo, MP_BUFFER_READ); + if (initial_value_bufinfo.len > max_length || + (fixed_length && initial_value_bufinfo.len != max_length)) { + mp_raise_ValueError(translate("initial_value length is wrong")); + } bleio_characteristic_obj_t *characteristic = m_new_obj(bleio_characteristic_obj_t); characteristic->base.type = &bleio_characteristic_type; diff --git a/shared-bindings/_bleio/Descriptor.c b/shared-bindings/_bleio/Descriptor.c index e24751f759..dce618ecec 100644 --- a/shared-bindings/_bleio/Descriptor.c +++ b/shared-bindings/_bleio/Descriptor.c @@ -100,11 +100,14 @@ STATIC mp_obj_t bleio_descriptor_add_to_characteristic(size_t n_args, const mp_o const bleio_attribute_security_mode_t write_perm = args[ARG_write_perm].u_int; common_hal_bleio_attribute_security_mode_check_valid(write_perm); - const mp_int_t max_length = args[ARG_max_length].u_int; + const mp_int_t max_length_int = args[ARG_max_length].u_int; + if (max_length_int <= 0) { + mp_raise_ValueError(translate("max_length must be > 0")); + } + const size_t max_length = (size_t) max_length_int; const bool fixed_length = args[ARG_fixed_length].u_bool; mp_obj_t initial_value = args[ARG_initial_value].u_obj; - // Length will be validated in common_hal. mp_buffer_info_t initial_value_bufinfo; if (initial_value == mp_const_none) { if (fixed_length && max_length > 0) { @@ -114,6 +117,10 @@ STATIC mp_obj_t bleio_descriptor_add_to_characteristic(size_t n_args, const mp_o } } mp_get_buffer_raise(initial_value, &initial_value_bufinfo, MP_BUFFER_READ); + if (initial_value_bufinfo.len > max_length || + (fixed_length && initial_value_bufinfo.len != max_length)) { + mp_raise_ValueError(translate("initial_value length is wrong")); + } bleio_descriptor_obj_t *descriptor = m_new_obj(bleio_descriptor_obj_t); descriptor->base.type = &bleio_descriptor_type; From cf0f3d70b57b097ea7719669d81f7bea9d41f9e5 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 15 Aug 2020 10:16:57 -0400 Subject: [PATCH 0604/1293] SPIM3 buffer must be in first 64kB of RAM --- .../arduino_nano_33_ble/mpconfigboard.mk | 7 -- .../mpconfigboard.mk | 6 - ports/nrf/boards/common.template.ld | 35 +++--- .../nrf/boards/hiibot_bluefi/mpconfigboard.mk | 7 -- ports/nrf/boards/pca10100/mpconfigboard.h | 2 + ports/nrf/boards/pca10100/mpconfigboard.mk | 4 - ports/nrf/boards/simmel/mpconfigboard.h | 2 + ports/nrf/boards/simmel/mpconfigboard.mk | 4 - ports/nrf/common-hal/_bleio/Adapter.c | 28 ++--- ports/nrf/common-hal/busio/SPI.c | 5 +- ports/nrf/ld_defines.c | 9 +- ports/nrf/mpconfigport.h | 108 +++++++++++------- ports/nrf/nrfx_config.h | 2 +- 13 files changed, 117 insertions(+), 102 deletions(-) diff --git a/ports/nrf/boards/arduino_nano_33_ble/mpconfigboard.mk b/ports/nrf/boards/arduino_nano_33_ble/mpconfigboard.mk index d5e38c5b72..9b16834b50 100644 --- a/ports/nrf/boards/arduino_nano_33_ble/mpconfigboard.mk +++ b/ports/nrf/boards/arduino_nano_33_ble/mpconfigboard.mk @@ -6,10 +6,3 @@ USB_MANUFACTURER = "Arduino" MCU_CHIP = nrf52840 INTERNAL_FLASH_FILESYSTEM = 1 - -# Allocate two, not just one I2C peripheral, so that we have both -# on-board and off-board I2C available. -# When SPIM3 becomes available we'll be able to have two I2C and two SPI peripherals. -# We use a CFLAGS define here because there are include order issues -# if we try to include "mpconfigport.h" into nrfx_config.h . -CFLAGS += -DCIRCUITPY_NRF_NUM_I2C=2 diff --git a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk index 38c9933340..6b5c0424f9 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk +++ b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk @@ -8,9 +8,3 @@ MCU_CHIP = nrf52840 QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "GD25Q16C" - -# Allocate two, not just one I2C peripheral for CPB, so that we have both -# on-board and off-board I2C available. -# We use a CFLAGS define here because there are include order issues -# if we try to include "mpconfigport.h" into nrfx_config.h . -CFLAGS += -DCIRCUITPY_NRF_NUM_I2C=2 diff --git a/ports/nrf/boards/common.template.ld b/ports/nrf/boards/common.template.ld index 5982b8ba0d..192215eeee 100644 --- a/ports/nrf/boards/common.template.ld +++ b/ports/nrf/boards/common.template.ld @@ -18,13 +18,16 @@ MEMORY FLASH_BOOTLOADER_SETTINGS (r) : ORIGIN = ${BOOTLOADER_SETTINGS_START_ADDR}, LENGTH = ${BOOTLOADER_SETTINGS_SIZE} - /* 0x2000000 - RAM:ORIGIN is reserved for Softdevice */ - /* SoftDevice 6.1.0 with 5 connections and various increases takes just under 64kiB. - /* To measure the minimum required amount of memory for given configuration, set this number - high enough to work and then check the mutation of the value done by sd_ble_enable. */ - SPIM3_RAM (rw) : ORIGIN = 0x20000000 + ${SOFTDEVICE_RAM_SIZE}, LENGTH = ${SPIM3_BUFFER_SIZE} - RAM (xrw) : ORIGIN = 0x20000000 + ${SOFTDEVICE_RAM_SIZE} + ${SPIM3_BUFFER_SIZE}, LENGTH = ${RAM_SIZE} - ${SOFTDEVICE_RAM_SIZE} -${SPIM3_BUFFER_SIZE} - + /* SoftDevice RAM must start at the beginning of RAM: 0x2000000 (RAM_START_ADDR). + On nRF52840, the first 64kB of RAM is composed of 8 8kB RAM blocks. Above those is + RAM block 8, which is 192kB. + If SPIM3_BUFFER_RAM_SIZE is 8kB, as opposed to zero, it must be in the first 64kB of RAM. + So the amount of RAM reserved for the SoftDevice must be no more than 56kB. + */ + RAM (xrw) : ORIGIN = ${RAM_START_ADDR}, LENGTH = ${RAM_SIZE} + SD_RAM (rw) : ORIGIN = ${SOFTDEVICE_RAM_START_ADDR}, LENGTH = ${SOFTDEVICE_RAM_SIZE} + SPIM3_RAM (rw) : ORIGIN = ${SPIM3_BUFFER_RAM_START_ADDR}, LENGTH = ${SPIM3_BUFFER_RAM_SIZE} + APP_RAM (xrw) : ORIGIN = ${APP_RAM_START_ADDR}, LENGTH = ${APP_RAM_SIZE} } /* produce a link error if there is not this amount of RAM available */ @@ -32,16 +35,16 @@ _minimum_heap_size = 0; /* top end of the stack */ -/*_stack_end = ORIGIN(RAM) + LENGTH(RAM);*/ -_estack = ORIGIN(RAM) + LENGTH(RAM); +/*_stack_end = ORIGIN(APP_RAM) + LENGTH(APP_RAM);*/ +_estack = ORIGIN(APP_RAM) + LENGTH(APP_RAM); /* RAM extents for the garbage collector */ -_ram_end = ORIGIN(RAM) + LENGTH(RAM); +_ram_end = ORIGIN(APP_RAM) + LENGTH(APP_RAM); _heap_end = 0x20020000; /* tunable */ /* nrf52840 SPIM3 needs its own area to work around hardware problems. Nothing else may use this space. */ _spim3_ram = ORIGIN(SPIM3_RAM); -_spim3_ram_end = ORIGIN(SPIM3_RAM) + LENGTH(RAM); +_spim3_ram_end = ORIGIN(SPIM3_RAM) + LENGTH(SPIM3_RAM); /* define output sections */ SECTIONS @@ -87,7 +90,7 @@ SECTIONS . = ALIGN(4); _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM + } >APP_RAM /* Zero-initialized data section */ .bss : @@ -100,7 +103,7 @@ SECTIONS . = ALIGN(4); _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM + } >APP_RAM /* Uninitialized data section Data placed into this section will remain unchanged across reboots. */ @@ -113,7 +116,7 @@ SECTIONS . = ALIGN(4); _euninitialized = .; /* define a global symbol at uninitialized end; currently unused */ - } >RAM + } >APP_RAM /* this is to define the start of the heap, and make sure we have a minimum size */ .heap : @@ -123,7 +126,7 @@ SECTIONS PROVIDE ( _end = . ); _heap_start = .; /* define a global symbol at heap start */ . = . + _minimum_heap_size; - } >RAM + } >APP_RAM /* this just checks there is enough RAM for the stack */ .stack : @@ -131,7 +134,7 @@ SECTIONS . = ALIGN(4); . = . + ${CIRCUITPY_DEFAULT_STACK_SIZE}; . = ALIGN(4); - } >RAM + } >APP_RAM /* Remove exception unwinding information, since Circuit Python does not support this GCC feature. */ diff --git a/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk index e43639a897..d601243486 100644 --- a/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk +++ b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk @@ -8,10 +8,3 @@ MCU_CHIP = nrf52840 QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "W25Q16JV_IQ" - -# Allocate two, not just one I2C peripheral for Bluefi, so that we have both -# on-board and off-board I2C available. -# When SPIM3 becomes available we'll be able to have two I2C and two SPI peripherals. -# We use a CFLAGS define here because there are include order issues -# if we try to include "mpconfigport.h" into nrfx_config.h . -CFLAGS += -DCIRCUITPY_NRF_NUM_I2C=2 diff --git a/ports/nrf/boards/pca10100/mpconfigboard.h b/ports/nrf/boards/pca10100/mpconfigboard.h index c645b778be..4639a208b4 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.h +++ b/ports/nrf/boards/pca10100/mpconfigboard.h @@ -46,3 +46,5 @@ #define BLEIO_PERIPH_ROLE_COUNT 2 #define BLEIO_TOTAL_CONNECTION_COUNT 2 #define BLEIO_ATTR_TAB_SIZE (BLE_GATTS_ATTR_TAB_SIZE_DEFAULT * 2) + +#define SOFTDEVICE_RAM_SIZE (32*1024) diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index e15bf3a67c..a8cacbafc4 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -27,9 +27,5 @@ CIRCUITPY_ULAB = 0 SUPEROPT_GC = 0 -# These defines must be overridden before mpconfigboard.h is included, which is -# why they are passed on the command line. -CFLAGS += -DSPIM3_BUFFER_SIZE=0 -DSOFTDEVICE_RAM_SIZE='(32*1024)' - # Override optimization to keep binary small OPTIMIZATION_FLAGS = -Os diff --git a/ports/nrf/boards/simmel/mpconfigboard.h b/ports/nrf/boards/simmel/mpconfigboard.h index 28c4ee7d93..2380a8055d 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.h +++ b/ports/nrf/boards/simmel/mpconfigboard.h @@ -52,3 +52,5 @@ #define BLEIO_PERIPH_ROLE_COUNT 2 #define BLEIO_TOTAL_CONNECTION_COUNT 2 #define BLEIO_ATTR_TAB_SIZE (BLE_GATTS_ATTR_TAB_SIZE_DEFAULT * 2) + +#define SOFTDEVICE_RAM_SIZE (32*1024) diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index 8dd284d578..e34739c0f3 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -29,9 +29,5 @@ CIRCUITPY_WATCHDOG = 1 # Enable micropython.native #CIRCUITPY_ENABLE_MPY_NATIVE = 1 -# These defines must be overridden before mpconfigboard.h is included, which is -# why they are passed on the command line. -CFLAGS += -DSPIM3_BUFFER_SIZE=0 -DSOFTDEVICE_RAM_SIZE='(32*1024)' -DNRFX_SPIM3_ENABLED=0 - # Override optimization to keep binary small OPTIMIZATION_FLAGS = -Os diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 0b23bb7bfa..22cd0684f7 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -61,7 +61,7 @@ #endif #ifndef BLEIO_HVN_TX_QUEUE_SIZE -#define BLEIO_HVN_TX_QUEUE_SIZE 9 +#define BLEIO_HVN_TX_QUEUE_SIZE 5 #endif #ifndef BLEIO_CENTRAL_ROLE_COUNT @@ -120,11 +120,11 @@ STATIC uint32_t ble_stack_enable(void) { // Start with no event handlers, etc. ble_drv_reset(); - // Set everything up to have one persistent code editing connection and one user managed - // connection. In the future we could move .data and .bss to the other side of the stack and + // In the future we might move .data and .bss to the other side of the stack and // dynamically adjust for different memory requirements of the SD based on boot.py - // configuration. - uint32_t app_ram_start = (uint32_t) &_ram_start; + // configuration. But we still need to keep the SPIM3 buffer (if needed) in the first 64kB of RAM. + + uint32_t sd_ram_end = SOFTDEVICE_RAM_START_ADDR + SOFTDEVICE_RAM_SIZE; ble_cfg_t ble_conf; ble_conf.conn_cfg.conn_cfg_tag = BLE_CONN_CFG_TAG_CUSTOM; @@ -135,7 +135,7 @@ STATIC uint32_t ble_stack_enable(void) { // Event length here can influence throughput so perhaps make multiple connection profiles // available. ble_conf.conn_cfg.params.gap_conn_cfg.event_length = BLE_GAP_EVENT_LENGTH_DEFAULT; - err_code = sd_ble_cfg_set(BLE_CONN_CFG_GAP, &ble_conf, app_ram_start); + err_code = sd_ble_cfg_set(BLE_CONN_CFG_GAP, &ble_conf, sd_ram_end); if (err_code != NRF_SUCCESS) { return err_code; } @@ -147,7 +147,7 @@ STATIC uint32_t ble_stack_enable(void) { ble_conf.gap_cfg.role_count_cfg.periph_role_count = BLEIO_PERIPH_ROLE_COUNT; // central_role_count costs 648 bytes for 1 to 2, then ~1250 for each further increment. ble_conf.gap_cfg.role_count_cfg.central_role_count = BLEIO_CENTRAL_ROLE_COUNT; - err_code = sd_ble_cfg_set(BLE_GAP_CFG_ROLE_COUNT, &ble_conf, app_ram_start); + err_code = sd_ble_cfg_set(BLE_GAP_CFG_ROLE_COUNT, &ble_conf, sd_ram_end); if (err_code != NRF_SUCCESS) { return err_code; } @@ -158,7 +158,7 @@ STATIC uint32_t ble_stack_enable(void) { // DevZone recommends not setting this directly, but instead changing gap_conn_cfg.event_length. // However, we are setting connection extension, so this seems to make sense. ble_conf.conn_cfg.params.gatts_conn_cfg.hvn_tx_queue_size = BLEIO_HVN_TX_QUEUE_SIZE; - err_code = sd_ble_cfg_set(BLE_CONN_CFG_GATTS, &ble_conf, app_ram_start); + err_code = sd_ble_cfg_set(BLE_CONN_CFG_GATTS, &ble_conf, sd_ram_end); if (err_code != NRF_SUCCESS) { return err_code; } @@ -167,7 +167,7 @@ STATIC uint32_t ble_stack_enable(void) { memset(&ble_conf, 0, sizeof(ble_conf)); ble_conf.conn_cfg.conn_cfg_tag = BLE_CONN_CFG_TAG_CUSTOM; ble_conf.conn_cfg.params.gatt_conn_cfg.att_mtu = BLE_GATTS_VAR_ATTR_LEN_MAX; - err_code = sd_ble_cfg_set(BLE_CONN_CFG_GATT, &ble_conf, app_ram_start); + err_code = sd_ble_cfg_set(BLE_CONN_CFG_GATT, &ble_conf, sd_ram_end); if (err_code != NRF_SUCCESS) { return err_code; } @@ -177,7 +177,7 @@ STATIC uint32_t ble_stack_enable(void) { memset(&ble_conf, 0, sizeof(ble_conf)); // Each increment to the BLE_GATTS_ATTR_TAB_SIZE_DEFAULT multiplier costs 1408 bytes. ble_conf.gatts_cfg.attr_tab_size.attr_tab_size = BLEIO_ATTR_TAB_SIZE; - err_code = sd_ble_cfg_set(BLE_GATTS_CFG_ATTR_TAB_SIZE, &ble_conf, app_ram_start); + err_code = sd_ble_cfg_set(BLE_GATTS_CFG_ATTR_TAB_SIZE, &ble_conf, sd_ram_end); if (err_code != NRF_SUCCESS) { return err_code; } @@ -187,13 +187,15 @@ STATIC uint32_t ble_stack_enable(void) { memset(&ble_conf, 0, sizeof(ble_conf)); // Each additional vs_uuid_count costs 16 bytes. ble_conf.common_cfg.vs_uuid_cfg.vs_uuid_count = BLEIO_VS_UUID_COUNT; // Defaults to 10. - err_code = sd_ble_cfg_set(BLE_COMMON_CFG_VS_UUID, &ble_conf, app_ram_start); + err_code = sd_ble_cfg_set(BLE_COMMON_CFG_VS_UUID, &ble_conf, sd_ram_end); if (err_code != NRF_SUCCESS) { return err_code; } - // This sets app_ram_start to the minimum value needed for the settings set above. - err_code = sd_ble_enable(&app_ram_start); + // This sets sd_ram_end to the minimum value needed for the settings set above. + // You can set a breakpoint just after this call and examine sd_ram_end to see + // how much RAM the SD needs with the configuration above. + err_code = sd_ble_enable(&sd_ram_end); if (err_code != NRF_SUCCESS) { return err_code; } diff --git a/ports/nrf/common-hal/busio/SPI.c b/ports/nrf/common-hal/busio/SPI.c index f27f0e267b..521347d833 100644 --- a/ports/nrf/common-hal/busio/SPI.c +++ b/ports/nrf/common-hal/busio/SPI.c @@ -41,7 +41,7 @@ STATIC spim_peripheral_t spim_peripherals[] = { // Allocate SPIM3 first. { .spim = NRFX_SPIM_INSTANCE(3), .max_frequency = 32000000, - .max_xfer_size = MIN(SPIM3_BUFFER_SIZE, (1UL << SPIM3_EASYDMA_MAXCNT_SIZE) - 1) + .max_xfer_size = MIN(SPIM3_BUFFER_RAM_SIZE, (1UL << SPIM3_EASYDMA_MAXCNT_SIZE) - 1) }, #endif #if NRFX_CHECK(NRFX_SPIM2_ENABLED) @@ -71,8 +71,7 @@ STATIC bool never_reset[MP_ARRAY_SIZE(spim_peripherals)]; // Separate RAM area for SPIM3 transmit buffer to avoid SPIM3 hardware errata. // https://infocenter.nordicsemi.com/index.jsp?topic=%2Ferrata_nRF52840_Rev2%2FERR%2FnRF52840%2FRev2%2Flatest%2Fanomaly_840_198.html -extern uint32_t _spim3_ram; -STATIC uint8_t *spim3_transmit_buffer = (uint8_t *) &_spim3_ram; +STATIC uint8_t *spim3_transmit_buffer = (uint8_t *) SPIM3_BUFFER_RAM_START_ADDR; void spi_reset(void) { for (size_t i = 0 ; i < MP_ARRAY_SIZE(spim_peripherals); i++) { diff --git a/ports/nrf/ld_defines.c b/ports/nrf/ld_defines.c index 8430daccb9..6e266e4f7a 100644 --- a/ports/nrf/ld_defines.c +++ b/ports/nrf/ld_defines.c @@ -10,6 +10,7 @@ // START_LD_DEFINES /*FLASH_SIZE=*/ FLASH_SIZE; +/*RAM_START_ADDR=*/ RAM_START_ADDR; /*RAM_SIZE=*/ RAM_SIZE; /*MBR_START_ADDR=*/ MBR_START_ADDR; @@ -41,5 +42,11 @@ /*BOOTLOADER_SETTINGS_START_ADDR=*/ BOOTLOADER_SETTINGS_START_ADDR; /*BOOTLOADER_SETTINGS_SIZE=*/ BOOTLOADER_SETTINGS_SIZE; +/*SOFTDEVICE_RAM_START_ADDR=*/ SOFTDEVICE_RAM_START_ADDR; /*SOFTDEVICE_RAM_SIZE=*/ SOFTDEVICE_RAM_SIZE; -/*SPIM3_BUFFER_SIZE=*/ SPIM3_BUFFER_SIZE; + +/*SPIM3_BUFFER_RAM_START_ADDR=*/ SPIM3_BUFFER_RAM_START_ADDR; +/*SPIM3_BUFFER_RAM_SIZE=*/ SPIM3_BUFFER_RAM_SIZE; + +/*APP_RAM_START_ADDR=*/ APP_RAM_START_ADDR; +/*APP_RAM_SIZE=*/ APP_RAM_SIZE; diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 4e49568ed8..36a9819dc8 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -34,32 +34,6 @@ #include "nrf_sdm.h" // for SD_FLASH_SIZE #include "peripherals/nrf/nvm.h" // for FLASH_PAGE_SIZE -// Max RAM used by SoftDevice. Can be changed when SoftDevice parameters are changed. -// See common.template.ld. -#ifndef SOFTDEVICE_RAM_SIZE -#define SOFTDEVICE_RAM_SIZE (64*1024) -#endif - -#ifdef NRF52840 -#define MICROPY_PY_SYS_PLATFORM "nRF52840" -#define FLASH_SIZE (0x100000) // 1MiB -#define RAM_SIZE (0x40000) // 256 KiB -// Special RAM area for SPIM3 transmit buffer, to work around hardware bug. -// See common.template.ld. -#define SPIM3_BUFFER_SIZE (8192) -#endif - -#ifdef NRF52833 -#define MICROPY_PY_SYS_PLATFORM "nRF52833" -#define FLASH_SIZE (0x80000) // 512 KiB -#define RAM_SIZE (0x20000) // 128 KiB -// Special RAM area for SPIM3 transmit buffer, to work around hardware bug. -// See common.template.ld. -#ifndef SPIM3_BUFFER_SIZE -#define SPIM3_BUFFER_SIZE (8192) -#endif -#endif - #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #define MICROPY_PY_FUNCTION_ATTRS (1) #define MICROPY_PY_IO (1) @@ -69,7 +43,26 @@ #define MICROPY_PY_UJSON (1) // 24kiB stack -#define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000 +#define CIRCUITPY_DEFAULT_STACK_SIZE (24*1024) + +#ifdef NRF52840 +#define MICROPY_PY_SYS_PLATFORM "nRF52840" +#define FLASH_SIZE (1024*1024) // 1MiB +#define RAM_SIZE (256*1024) // 256 KiB +// Special RAM area for SPIM3 transmit buffer, to work around hardware bug. +// See common.template.ld. +#define SPIM3_BUFFER_RAM_SIZE (8*1024) // 8 KiB +#endif + +#ifdef NRF52833 +#define MICROPY_PY_SYS_PLATFORM "nRF52833" +#define FLASH_SIZE (512*1024) // 512 KiB +#define RAM_SIZE (128*1024) // 128 KiB +// SPIM3 buffer is not needed on nRF52833: the SPIM3 hw bug is not present. +#ifndef SPIM3_BUFFER_RAM_SIZE +#define SPIM3_BUFFER_RAM_SIZE (0) +#endif +#endif //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -79,7 +72,7 @@ // Definitions that might be overriden by mpconfigboard.h #ifndef CIRCUITPY_INTERNAL_NVM_SIZE -#define CIRCUITPY_INTERNAL_NVM_SIZE (8192) +#define CIRCUITPY_INTERNAL_NVM_SIZE (8*1024) #endif #ifndef BOARD_HAS_32KHZ_XTAL @@ -88,11 +81,11 @@ #endif #if INTERNAL_FLASH_FILESYSTEM - #ifndef CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE - #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (256*1024) - #endif +#ifndef CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (256*1024) +#endif #else - #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) #endif // Flash layout, starting at 0x00000000 @@ -116,7 +109,7 @@ // SD_FLASH_SIZE is from nrf_sdm.h #define ISR_START_ADDR (SD_FLASH_START_ADDR + SD_FLASH_SIZE) -#define ISR_SIZE (0x1000) // 4kiB +#define ISR_SIZE (4*1024) // 4kiB // Smallest unit of flash that can be erased. #define FLASH_ERASE_SIZE FLASH_PAGE_SIZE @@ -127,12 +120,12 @@ // Bootloader values from https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/master/src/linker/s140_v6.ld #define BOOTLOADER_START_ADDR (FLASH_SIZE - BOOTLOADER_SIZE - BOOTLOADER_SETTINGS_SIZE - BOOTLOADER_MBR_SIZE) -#define BOOTLOADER_MBR_SIZE (0x1000) // 4kib +#define BOOTLOADER_MBR_SIZE (4*1024) // 4kib #ifndef BOOTLOADER_SIZE -#define BOOTLOADER_SIZE (0xA000) // 40kiB +#define BOOTLOADER_SIZE (40*1024) // 40kiB #endif #define BOOTLOADER_SETTINGS_START_ADDR (FLASH_SIZE - BOOTLOADER_SETTINGS_SIZE) -#define BOOTLOADER_SETTINGS_SIZE (0x1000) // 4kiB +#define BOOTLOADER_SETTINGS_SIZE (4*1024) // 4kiB #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR (BOOTLOADER_START_ADDR - CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE) @@ -180,11 +173,46 @@ #error No space left in flash for firmware after specifying other regions! #endif +//////////////////////////////////////////////////////////////////////////////////////////////////// +// RAM space definitions -#define MICROPY_PORT_ROOT_POINTERS \ - CIRCUITPY_COMMON_ROOT_POINTERS \ - uint16_t* pixels_pattern_heap; \ - ble_drv_evt_handler_entry_t* ble_drv_evt_handler_entries; \ +// Max RAM used by SoftDevice. Can be changed when SoftDevice parameters are changed. +// On nRF52840, the first 64kB of RAM is composed of 8 8kB RAM blocks. Above those is +// RAM block 8, which is 192kB. +// If SPIM3_BUFFER_RAM_SIZE is 8kB, as opposed to zero, it must be in the first 64kB of RAM. +// So the amount of RAM reserved for the SoftDevice must be no more than 56kB. +// SoftDevice 6.1.0 with 5 connections and various increases can be made to use < 56kB. +// To measure the minimum required amount of memory for given configuration, set this number +// high enough to work and then check the mutation of the value done by sd_ble_enable(). +// See common.template.ld. +#ifndef SOFTDEVICE_RAM_SIZE +#define SOFTDEVICE_RAM_SIZE (56*1024) +#endif + + +#define RAM_START_ADDR (0x20000000) +#define SOFTDEVICE_RAM_START_ADDR (RAM_START_ADDR) +#define SPIM3_BUFFER_RAM_START_ADDR (SOFTDEVICE_RAM_START_ADDR + SOFTDEVICE_RAM_SIZE) +#define APP_RAM_START_ADDR (SPIM3_BUFFER_RAM_START_ADDR + SPIM3_BUFFER_RAM_SIZE) +#define APP_RAM_SIZE (RAM_START_ADDR + RAM_SIZE - APP_RAM_START_ADDR) + +#if SPIM3_BUFFER_RAM_SIZE > 0 && SOFTDEVICE_RAM_SIZE + SPIM3_BUFFER_RAM_SIZE > (64*1024) +#error SPIM3 buffer must be in the first 64kB of RAM. +#endif + +#if SOFTDEVICE_RAM_SIZE + SPIM3_BUFFER_RAM_SIZE + APP_RAM_SIZE > RAM_SIZE +#error RAM size regions overflow RAM +#endif + +#if SOFTDEVICE_RAM_SIZE + SPIM3_BUFFER_RAM_SIZE + APP_RAM_SIZE < RAM_SIZE +#error RAM size regions do not use all of RAM +#endif + + +#define MICROPY_PORT_ROOT_POINTERS \ + CIRCUITPY_COMMON_ROOT_POINTERS \ + uint16_t* pixels_pattern_heap; \ + ble_drv_evt_handler_entry_t* ble_drv_evt_handler_entries; \ #endif // NRF5_MPCONFIGPORT_H__ diff --git a/ports/nrf/nrfx_config.h b/ports/nrf/nrfx_config.h index b528a6032b..94812d5913 100644 --- a/ports/nrf/nrfx_config.h +++ b/ports/nrf/nrfx_config.h @@ -5,7 +5,7 @@ #define NRFX_POWER_ENABLED 1 #define NRFX_POWER_DEFAULT_CONFIG_IRQ_PRIORITY 7 -// NOTE: THIS WORKAROUND CAUSES BLE CODE TO CRASH. +// NOTE: THIS WORKAROUND CAUSES BLE CODE TO CRASH. DO NOT USE. // It doesn't work with the SoftDevice. // See https://devzone.nordicsemi.com/f/nordic-q-a/33982/sdk-15-software-crash-during-spi-session // Turn on nrfx supported workarounds for errata in Rev1 of nRF52840 From 4296aa262ebc77fa660db18f483b2e6a578033b3 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 24 Jul 2020 11:09:18 -0500 Subject: [PATCH 0605/1293] locale: Fix percent-space in several translations --- locale/cs.po | 16 ++++++++-------- locale/es.po | 4 ++-- locale/fil.po | 2 +- locale/pt_BR.po | 2 +- locale/sv.po | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/locale/cs.po b/locale/cs.po index 195968e207..5d9b79f681 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -44,11 +44,11 @@ msgstr "" #: py/obj.c msgid " File \"%q\"" -msgstr "  Soubor \"% q\"" +msgstr "  Soubor \"%q\"" #: py/obj.c msgid " File \"%q\", line %d" -msgstr "  Soubor \"% q\", řádek% d" +msgstr "  Soubor \"%q\", řádek %d" #: main.c msgid " output:\n" @@ -57,7 +57,7 @@ msgstr " výstup:\n" #: py/objstr.c #, c-format msgid "%%c requires int or char" -msgstr "%% c vyžaduje int nebo char" +msgstr "%%c vyžaduje int nebo char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -78,11 +78,11 @@ msgstr "%q index je mimo rozsah" #: py/obj.c msgid "%q indices must be integers, not %s" -msgstr "Indexy% q musí být celá čísla, nikoli% s" +msgstr "Indexy %q musí být celá čísla, nikoli %s" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "Seznam% q musí být seznam" +msgstr "Seznam %q musí být seznam" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" @@ -94,11 +94,11 @@ msgstr "" #: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" -msgstr "% q musí být > = 1" +msgstr " %q musí být > = 1" #: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "% q musí být n-tice délky 2" +msgstr " %q musí být n-tice délky 2" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q pin invalid" @@ -106,7 +106,7 @@ msgstr "" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" -msgstr "% q by měl být int" +msgstr " %q by měl být int" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" diff --git a/locale/es.po b/locale/es.po index 1294473af7..edecfa7033 100644 --- a/locale/es.po +++ b/locale/es.po @@ -3717,8 +3717,8 @@ msgstr "zi debe ser una forma (n_section,2)" #~ "Only monochrome, indexed 8bpp, and 16bpp or greater BMPs supported: %d " #~ "bpp given" #~ msgstr "" -#~ "Solo se admiten BMP monocromos, indexados de 8bpp y 16bpp o superiores:% " -#~ "d bppdado" +#~ "Solo se admiten BMP monocromos, indexados de 8bpp y 16bpp o superiores:%d " +#~ "bppdado" #, fuzzy #~ msgid "Only slices with step=1 (aka None) are supported" diff --git a/locale/fil.po b/locale/fil.po index 07c8d270e0..85738e0c68 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -2051,7 +2051,7 @@ msgstr "hindi puede ang maraming *x" #: py/emitnative.c msgid "can't implicitly convert '%q' to 'bool'" -msgstr "hindi maaaring ma-convert ang '% qt' sa 'bool'" +msgstr "hindi maaaring ma-convert ang ' %q' sa 'bool'" #: py/emitnative.c msgid "can't load from '%q'" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 3ecca12dff..0196a2c0bb 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -3070,7 +3070,7 @@ msgstr "a anotação do retorno deve ser um identificador" #: py/emitnative.c msgid "return expected '%q' but got '%q'" -msgstr "o retorno esperado era '%q', porém obteve '% q'" +msgstr "o retorno esperado era '%q', porém obteve '%q'" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format diff --git a/locale/sv.po b/locale/sv.po index 0210094a9b..43d6805395 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -2115,7 +2115,7 @@ msgstr "" #: py/objtype.c msgid "cannot create '%q' instances" -msgstr "kan inte skapa instanser av '% q'" +msgstr "kan inte skapa instanser av '%q'" #: py/objtype.c msgid "cannot create instance" From ef40f83f99c3e529619302a42d3532ba09420dc2 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 15 Aug 2020 14:39:53 -0400 Subject: [PATCH 0606/1293] Remove event handler before setting it to NULL --- ports/nrf/common-hal/_bleio/Adapter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 0b23bb7bfa..59cfcd37fb 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -472,8 +472,8 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t* err_code = sd_ble_gap_scan_start(&scan_params, sd_data); if (err_code != NRF_SUCCESS) { - self->scan_results = NULL; ble_drv_remove_event_handler(scan_on_ble_evt, self->scan_results); + self->scan_results = NULL; check_nrf_error(err_code); } From 6e3ac5adc82cb008cf3062381c5986902d3f01e1 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Sat, 15 Aug 2020 21:12:28 +0200 Subject: [PATCH 0607/1293] 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 | 295 +++++++++++++++--------------- locale/cs.po | 245 +++++++++++-------------- locale/de_DE.po | 378 ++++++++++++++++++++++---------------- locale/es.po | 379 +++++++++++++++++++++++---------------- locale/fil.po | 360 +++++++++++++++++++++---------------- locale/fr.po | 379 +++++++++++++++++++++++---------------- locale/hi.po | 240 ++++++++++--------------- locale/it_IT.po | 361 +++++++++++++++++++++---------------- locale/ja.po | 109 +++++++---- locale/ko.po | 260 ++++++++++++--------------- locale/pl.po | 361 +++++++++++++++++++++---------------- locale/pt_BR.po | 378 ++++++++++++++++++++++---------------- locale/sv.po | 378 ++++++++++++++++++++++---------------- locale/zh_Latn_pinyin.po | 376 ++++++++++++++++++++++---------------- 14 files changed, 2510 insertions(+), 1989 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 9a1d86d26f..95d50c1dd6 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-28 16:57-0500\n" +"POT-Creation-Date: 2020-08-14 09:36-0400\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -72,13 +72,17 @@ msgstr "" msgid "%q in use" msgstr "%q sedang digunakan" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -116,6 +120,42 @@ msgstr "%q() mengambil posisi argumen %d tapi %d yang diberikan" msgid "'%q' argument required" msgstr "'%q' argumen dibutuhkan" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -166,48 +206,6 @@ msgstr "'%s' integer %d tidak dalam kisaran %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' integer 0x%x tidak cukup didalam mask 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "Objek '%s' tidak dapat menetapkan atribut '%q'" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "Objek '%s' tidak mendukung '%q'" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "Objek '%s' tidak mendukung penetapan item" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "Objek '%s' tidak mendukung penghapusan item" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "Objek '%s' tidak memiliki atribut '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "Objek '%s' bukan iterator" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "Objek '%s' tidak dapat dipanggil" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "'%s' objek tidak dapat diulang" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "Objek '%s' tidak dapat disubkripsikan" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "'=' perataan tidak diizinkan dalam penentu format string" @@ -457,6 +455,10 @@ msgstr "Panjang buffer %d terlalu besar. Itu harus kurang dari %d" msgid "Buffer length must be a multiple of 512" msgstr "Panjang buffer harus kelipatan 512" +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Buffer must be a multiple of 512 bytes" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Penyangga harus memiliki panjang setidaknya 1" @@ -658,6 +660,10 @@ msgstr "Tidak dapat menginisialisasi ulang timer" msgid "Could not restart PWM" msgstr "Tidak dapat memulai ulang PWM" +#: shared-bindings/_bleio/Adapter.c +msgid "Could not set address" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" msgstr "Tidak dapat memulai PWM" @@ -841,6 +847,11 @@ msgstr "Gagal menulis flash internal." msgid "File exists" msgstr "File sudah ada" +#: shared-module/framebufferio/FramebufferDisplay.c +#, c-format +msgid "Framebuffer requires %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -866,7 +877,7 @@ msgid "Group full" msgstr "Grup penuh" #: 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/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "Perangkat keras sibuk, coba pin alternatif" @@ -882,6 +893,10 @@ msgstr "operasi I/O pada file tertutup" msgid "I2C Init Error" msgstr "Gagal Inisialisasi I2C" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -929,6 +944,11 @@ msgstr "" msgid "Invalid %q pin" msgstr "%q pada tidak valid" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +msgid "Invalid %q pin selection" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Nilai Unit ADC tidak valid" @@ -941,24 +961,12 @@ msgstr "File BMP tidak valid" msgid "Invalid DAC pin supplied" msgstr "Pin DAC yang diberikan tidak valid" -#: ports/stm/common-hal/busio/I2C.c -msgid "Invalid I2C pin selection" -msgstr "Pilihan pin I2C tidak valid" - #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Frekuensi PWM tidak valid" -#: ports/stm/common-hal/busio/SPI.c -msgid "Invalid SPI pin selection" -msgstr "Pilihan pin SPI tidak valid" - -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid UART pin selection" -msgstr "Pilihan pin UART tidak valid" - #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Argumen tidak valid" @@ -1255,6 +1263,10 @@ msgstr "Tidak dapat menyambungkan ke AP" msgid "Not playing" msgstr "" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1340,10 +1352,6 @@ msgstr "Tambahkan module apapun pada filesystem\n" msgid "Polygon needs at least 3 points" msgstr "" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1419,13 +1427,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Berjalan di mode aman(safe mode)! Auto-reload tidak aktif.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" +msgid "Running in safe mode! " msgstr "" -"Berjalan di mode aman(safe mode)! tidak menjalankan kode yang tersimpan.\n" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1436,6 +1439,16 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "SDA atau SCL membutuhkan pull up" +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO GetCardInfo Error %d" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO Init Error %d" +msgstr "" + #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" msgstr "" @@ -1792,8 +1805,7 @@ msgid "__init__() should return None" msgstr "" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" +msgid "__init__() should return None, not '%q'" msgstr "" #: py/objobject.c @@ -1948,7 +1960,7 @@ msgstr "byte > 8 bit tidak didukung" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "kalibrasi keluar dari jangkauan" @@ -1980,47 +1992,16 @@ msgstr "" msgid "can't assign to expression" msgstr "tidak dapat menetapkan ke ekspresi" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "" - #: py/obj.c -msgid "can't convert to complex" -msgstr "" - -#: py/obj.c -msgid "can't convert to float" -msgstr "" - -#: py/obj.c -msgid "can't convert to int" +msgid "can't convert to %q" msgstr "" #: py/objstr.c @@ -2428,7 +2409,7 @@ msgstr "fungsi kehilangan argumen keyword '%q' yang dibutuhkan" msgid "function missing required positional argument #%d" msgstr "fungsi kehilangan argumen posisi #%d yang dibutuhkan" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "fungsi mengambil posisi argumen %d tapi %d yang diberikan" @@ -2477,10 +2458,7 @@ msgstr "lapisan (padding) tidak benar" msgid "index is out of bounds" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "index keluar dari jangkauan" @@ -2836,8 +2814,7 @@ msgid "number of points must be at least 2" msgstr "" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" +msgid "object '%q' is not a tuple or list" msgstr "" #: py/obj.c @@ -2873,8 +2850,7 @@ msgid "object not iterable" msgstr "" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" +msgid "object of type '%q' has no len()" msgstr "" #: py/obj.c @@ -2968,20 +2944,9 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "Muncul dari PulseIn yang kosong" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" msgstr "" #: py/objint_mpz.c @@ -3138,12 +3103,7 @@ msgid "stream operation not supported" msgstr "" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" +msgid "string indices must be integers, not %q" msgstr "" #: py/stream.c @@ -3154,10 +3114,6 @@ msgstr "" msgid "struct: cannot index" msgstr "struct: tidak bisa melakukan index" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: index keluar dari jangkauan" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct: tidak ada fields" @@ -3228,7 +3184,7 @@ msgstr "" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "" @@ -3295,8 +3251,7 @@ msgid "unknown conversion specifier %c" msgstr "" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" +msgid "unknown format code '%c' for object of type '%q'" msgstr "" #: py/compile.c @@ -3336,7 +3291,7 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "" #: py/runtime.c -msgid "unsupported type for %q: '%s'" +msgid "unsupported type for %q: '%q'" msgstr "" #: py/runtime.c @@ -3344,7 +3299,7 @@ msgid "unsupported type for operator" msgstr "" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" msgstr "" #: py/objint.c @@ -3424,6 +3379,58 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "indeks %q harus bilangan bulat, bukan %s" + +#~ msgid "'%s' object cannot assign attribute '%q'" +#~ msgstr "Objek '%s' tidak dapat menetapkan atribut '%q'" + +#~ msgid "'%s' object does not support '%q'" +#~ msgstr "Objek '%s' tidak mendukung '%q'" + +#~ msgid "'%s' object does not support item assignment" +#~ msgstr "Objek '%s' tidak mendukung penetapan item" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "Objek '%s' tidak mendukung penghapusan item" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "Objek '%s' tidak memiliki atribut '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "Objek '%s' bukan iterator" + +#~ msgid "'%s' object is not callable" +#~ msgstr "Objek '%s' tidak dapat dipanggil" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "'%s' objek tidak dapat diulang" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "Objek '%s' tidak dapat disubkripsikan" + +#~ msgid "Invalid I2C pin selection" +#~ msgstr "Pilihan pin I2C tidak valid" + +#~ msgid "Invalid SPI pin selection" +#~ msgstr "Pilihan pin SPI tidak valid" + +#~ msgid "Invalid UART pin selection" +#~ msgstr "Pilihan pin UART tidak valid" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Berjalan di mode aman(safe mode)! Auto-reload tidak aktif.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "" +#~ "Berjalan di mode aman(safe mode)! tidak menjalankan kode yang tersimpan.\n" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "Muncul dari PulseIn yang kosong" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: index keluar dari jangkauan" + #~ msgid "'async for' or 'async with' outside async function" #~ msgstr "'async for' atau 'async with' di luar fungsi async" diff --git a/locale/cs.po b/locale/cs.po index 5d9b79f681..a6579e904e 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-28 16:57-0500\n" +"POT-Creation-Date: 2020-08-14 09:36-0400\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -72,13 +72,17 @@ msgstr "" msgid "%q in use" msgstr "%q se nyní používá" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c msgid "%q index out of range" msgstr "%q index je mimo rozsah" #: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "Indexy %q musí být celá čísla, nikoli %s" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -116,6 +120,42 @@ msgstr "" msgid "'%q' argument required" msgstr "" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -166,48 +206,6 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "" @@ -455,6 +453,10 @@ msgstr "" msgid "Buffer length must be a multiple of 512" msgstr "" +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Buffer must be a multiple of 512 bytes" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "" @@ -645,6 +647,10 @@ msgstr "" msgid "Could not restart PWM" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Could not set address" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" msgstr "" @@ -827,6 +833,11 @@ msgstr "" msgid "File exists" msgstr "" +#: shared-module/framebufferio/FramebufferDisplay.c +#, c-format +msgid "Framebuffer requires %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -851,7 +862,7 @@ msgid "Group full" msgstr "" #: 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/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -867,6 +878,10 @@ msgstr "" msgid "I2C Init Error" msgstr "" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -912,6 +927,11 @@ msgstr "" msgid "Invalid %q pin" msgstr "" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +msgid "Invalid %q pin selection" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "" @@ -924,24 +944,12 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/stm/common-hal/busio/I2C.c -msgid "Invalid I2C pin selection" -msgstr "" - #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c msgid "Invalid PWM frequency" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "Invalid SPI pin selection" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid UART pin selection" -msgstr "" - #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "" @@ -1237,6 +1245,10 @@ msgstr "" msgid "Not playing" msgstr "" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1322,10 +1334,6 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1398,11 +1406,7 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" +msgid "Running in safe mode! " msgstr "" #: shared-module/sdcardio/SDCard.c @@ -1414,6 +1418,16 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "" +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO GetCardInfo Error %d" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO Init Error %d" +msgstr "" + #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" msgstr "" @@ -1763,8 +1777,7 @@ msgid "__init__() should return None" msgstr "" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" +msgid "__init__() should return None, not '%q'" msgstr "" #: py/objobject.c @@ -1918,7 +1931,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "" @@ -1950,47 +1963,16 @@ msgstr "" msgid "can't assign to expression" msgstr "" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "" - #: py/obj.c -msgid "can't convert to complex" -msgstr "" - -#: py/obj.c -msgid "can't convert to float" -msgstr "" - -#: py/obj.c -msgid "can't convert to int" +msgid "can't convert to %q" msgstr "" #: py/objstr.c @@ -2398,7 +2380,7 @@ msgstr "" msgid "function missing required positional argument #%d" msgstr "" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "" @@ -2447,10 +2429,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "" @@ -2806,8 +2785,7 @@ msgid "number of points must be at least 2" msgstr "" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" +msgid "object '%q' is not a tuple or list" msgstr "" #: py/obj.c @@ -2843,8 +2821,7 @@ msgid "object not iterable" msgstr "" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" +msgid "object of type '%q' has no len()" msgstr "" #: py/obj.c @@ -2937,20 +2914,9 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" msgstr "" #: py/objint_mpz.c @@ -3107,12 +3073,7 @@ msgid "stream operation not supported" msgstr "" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" +msgid "string indices must be integers, not %q" msgstr "" #: py/stream.c @@ -3123,10 +3084,6 @@ msgstr "" msgid "struct: cannot index" msgstr "" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "" @@ -3196,7 +3153,7 @@ msgstr "" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "" @@ -3263,8 +3220,7 @@ msgid "unknown conversion specifier %c" msgstr "" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" +msgid "unknown format code '%c' for object of type '%q'" msgstr "" #: py/compile.c @@ -3304,7 +3260,7 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "" #: py/runtime.c -msgid "unsupported type for %q: '%s'" +msgid "unsupported type for %q: '%q'" msgstr "" #: py/runtime.c @@ -3312,7 +3268,7 @@ msgid "unsupported type for operator" msgstr "" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" msgstr "" #: py/objint.c @@ -3391,3 +3347,6 @@ msgstr "" #: extmod/ulab/code/filter/filter.c 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" diff --git a/locale/de_DE.po b/locale/de_DE.po index 8ba5e4bd3b..580e05e44f 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-28 16:57-0500\n" +"POT-Creation-Date: 2020-08-14 09:36-0400\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -71,13 +71,17 @@ msgstr "" msgid "%q in use" msgstr "%q in Benutzung" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -115,6 +119,42 @@ msgstr "%q() nimmt %d Argumente ohne Keyword an, aber es wurden %d angegeben" msgid "'%q' argument required" msgstr "'%q' Argument erforderlich" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -165,48 +205,6 @@ msgstr "'%s' integer %d ist nicht im Bereich %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' Integer 0x%x passt nicht in Maske 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "Das Objekt '%s' kann das Attribut '%q' nicht zuweisen" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "Das Objekt '%s' unterstützt '%q' nicht" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "'%s' Objekt unterstützt keine Zuweisung von Elementen" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "'%s' Objekt unterstützt das Löschen von Elementen nicht" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "'%s' Objekt hat kein Attribut '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "'%s' Objekt ist kein Iterator" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "'%s' object ist nicht aufrufbar" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "'%s' Objekt nicht iterierbar" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "'%s' Objekt hat keine '__getitem__'-Methode (not subscriptable)" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "'='-Ausrichtung ist im String-Formatbezeichner nicht zulässig" @@ -458,6 +456,10 @@ msgstr "Die Pufferlänge %d ist zu groß. Sie muss kleiner als %d sein" msgid "Buffer length must be a multiple of 512" msgstr "" +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Buffer must be a multiple of 512 bytes" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Der Puffer muss eine Mindestenslänge von 1 haben" @@ -655,6 +657,10 @@ msgstr "Timer konnte nicht neu gestartet werden" msgid "Could not restart PWM" msgstr "PWM konnte nicht neu gestartet werden" +#: shared-bindings/_bleio/Adapter.c +msgid "Could not set address" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" msgstr "PWM konnte nicht gestartet werden" @@ -838,6 +844,11 @@ msgstr "Interner Flash konnte nicht geschrieben werden." msgid "File exists" msgstr "Datei existiert" +#: shared-module/framebufferio/FramebufferDisplay.c +#, c-format +msgid "Framebuffer requires %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -866,7 +877,7 @@ msgid "Group full" msgstr "Gruppe voll" #: 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/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "Hardware beschäftigt, versuchen Sie alternative Pins" @@ -882,6 +893,10 @@ msgstr "Lese/Schreibe-operation an geschlossener Datei" msgid "I2C Init Error" msgstr "I2C-Init-Fehler" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -929,6 +944,11 @@ msgstr "" msgid "Invalid %q pin" msgstr "Ungültiger %q pin" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +msgid "Invalid %q pin selection" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Ungültiger ADC-Einheitenwert" @@ -941,24 +961,12 @@ msgstr "Ungültige BMP-Datei" msgid "Invalid DAC pin supplied" msgstr "Ungültiger DAC-Pin angegeben" -#: ports/stm/common-hal/busio/I2C.c -msgid "Invalid I2C pin selection" -msgstr "Ungültige I2C-Pinauswahl" - #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Ungültige PWM Frequenz" -#: ports/stm/common-hal/busio/SPI.c -msgid "Invalid SPI pin selection" -msgstr "Ungültige SPI-Pin-Auswahl" - -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid UART pin selection" -msgstr "Ungültige UART-Pinauswahl" - #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Ungültiges Argument" @@ -1256,6 +1264,10 @@ msgstr "Nicht verbunden" msgid "Not playing" msgstr "Spielt nicht ab" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1350,10 +1362,6 @@ msgstr "und alle Module im Dateisystem \n" msgid "Polygon needs at least 3 points" msgstr "Polygone brauchen mindestens 3 Punkte" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "Pop aus einem leeren Ps2-Puffer" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Der Präfixbuffer muss sich auf dem Heap befinden" @@ -1428,12 +1436,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "Zeileneintrag muss ein digitalio.DigitalInOut sein" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Sicherheitsmodus aktiv! Automatisches Neuladen ist deaktiviert.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Sicherheitsmodus aktiv! Gespeicherter Code wird nicht ausgeführt\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1444,6 +1448,16 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "SDA oder SCL brauchen pull up" +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO GetCardInfo Error %d" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO Init Error %d" +msgstr "" + #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" msgstr "SPI-Init-Fehler" @@ -1820,9 +1834,8 @@ msgid "__init__() should return None" msgstr "__init__() sollte None zurückgeben" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "__init__() sollte None zurückgeben, nicht '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1975,7 +1988,7 @@ msgstr "bytes mit mehr als 8 bits werden nicht unterstützt" msgid "bytes value out of range" msgstr "Byte-Wert außerhalb des Bereichs" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "Kalibrierung ist außerhalb der Reichweite" @@ -2009,48 +2022,17 @@ msgstr "" msgid "can't assign to expression" msgstr "kann keinem Ausdruck zuweisen" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "kann %s nicht nach complex konvertieren" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "kann %s nicht nach float konvertieren" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "kann %s nicht nach int konvertieren" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "Kann '%q' Objekt nicht implizit nach %q konvertieren" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "kann NaN nicht nach int konvertieren" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "kann Adresse nicht in int konvertieren" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "kann inf nicht nach int konvertieren" - #: py/obj.c -msgid "can't convert to complex" -msgstr "kann nicht nach complex konvertieren" - -#: py/obj.c -msgid "can't convert to float" -msgstr "kann nicht nach float konvertieren" - -#: py/obj.c -msgid "can't convert to int" -msgstr "kann nicht nach int konvertieren" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2468,7 +2450,7 @@ msgstr "Funktion vermisst benötigtes Keyword-Argumente '%q'" msgid "function missing required positional argument #%d" msgstr "Funktion vermisst benötigtes Argumente ohne Keyword #%d" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "" @@ -2518,10 +2500,7 @@ msgstr "padding ist inkorrekt" msgid "index is out of bounds" msgstr "Index ist außerhalb der Grenzen" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "index außerhalb der Reichweite" @@ -2884,9 +2863,8 @@ msgid "number of points must be at least 2" msgstr "Die Anzahl der Punkte muss mindestens 2 betragen" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "Objekt '%s' ist weder tupel noch list" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2921,9 +2899,8 @@ msgid "object not iterable" msgstr "Objekt nicht iterierbar" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "Objekt vom Typ '%s' hat keine len()" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -3018,21 +2995,10 @@ msgstr "Polygon kann nur in einem übergeordneten Element registriert werden" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "pop von einem leeren PulseIn" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "pop von einer leeren Menge (set)" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "pop von einer leeren Liste" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "popitem(): dictionary ist leer" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3190,13 +3156,8 @@ msgid "stream operation not supported" msgstr "stream operation ist nicht unterstützt" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "String index außerhalb des Bereiches" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "String indizes müssen Integer sein, nicht %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3207,10 +3168,6 @@ msgstr "" msgid "struct: cannot index" msgstr "struct: kann nicht indexieren" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: index außerhalb gültigen Bereichs" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct: keine Felder" @@ -3280,7 +3237,7 @@ msgstr "zu viele Werte zum Auspacken (erwartet %d)" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "Tupelindex außerhalb des Bereichs" @@ -3351,9 +3308,8 @@ msgid "unknown conversion specifier %c" msgstr "unbekannter Konvertierungs specifier %c" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "unbekannter Formatcode '%c' für Objekt vom Typ '%s'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3392,16 +3348,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "nicht unterstütztes Formatzeichen '%c' (0x%x) bei Index %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "nicht unterstützter Type für %q: '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "nicht unterstützter Typ für Operator" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "nicht unterstützte Typen für %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3480,6 +3436,120 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "%q Indizes müssen Integer sein, nicht %s" + +#~ msgid "'%s' object cannot assign attribute '%q'" +#~ msgstr "Das Objekt '%s' kann das Attribut '%q' nicht zuweisen" + +#~ msgid "'%s' object does not support '%q'" +#~ msgstr "Das Objekt '%s' unterstützt '%q' nicht" + +#~ msgid "'%s' object does not support item assignment" +#~ msgstr "'%s' Objekt unterstützt keine Zuweisung von Elementen" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "'%s' Objekt unterstützt das Löschen von Elementen nicht" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "'%s' Objekt hat kein Attribut '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "'%s' Objekt ist kein Iterator" + +#~ msgid "'%s' object is not callable" +#~ msgstr "'%s' object ist nicht aufrufbar" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "'%s' Objekt nicht iterierbar" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "'%s' Objekt hat keine '__getitem__'-Methode (not subscriptable)" + +#~ msgid "Invalid I2C pin selection" +#~ msgstr "Ungültige I2C-Pinauswahl" + +#~ msgid "Invalid SPI pin selection" +#~ msgstr "Ungültige SPI-Pin-Auswahl" + +#~ msgid "Invalid UART pin selection" +#~ msgstr "Ungültige UART-Pinauswahl" + +#~ msgid "Pop from an empty Ps2 buffer" +#~ msgstr "Pop aus einem leeren Ps2-Puffer" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Sicherheitsmodus aktiv! Automatisches Neuladen ist deaktiviert.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "Sicherheitsmodus aktiv! Gespeicherter Code wird nicht ausgeführt\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "__init__() sollte None zurückgeben, nicht '%s'" + +#~ msgid "can't convert %s to complex" +#~ msgstr "kann %s nicht nach complex konvertieren" + +#~ msgid "can't convert %s to float" +#~ msgstr "kann %s nicht nach float konvertieren" + +#~ msgid "can't convert %s to int" +#~ msgstr "kann %s nicht nach int konvertieren" + +#~ msgid "can't convert NaN to int" +#~ msgstr "kann NaN nicht nach int konvertieren" + +#~ msgid "can't convert address to int" +#~ msgstr "kann Adresse nicht in int konvertieren" + +#~ msgid "can't convert inf to int" +#~ msgstr "kann inf nicht nach int konvertieren" + +#~ msgid "can't convert to complex" +#~ msgstr "kann nicht nach complex konvertieren" + +#~ msgid "can't convert to float" +#~ msgstr "kann nicht nach float konvertieren" + +#~ msgid "can't convert to int" +#~ msgstr "kann nicht nach int konvertieren" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "Objekt '%s' ist weder tupel noch list" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "Objekt vom Typ '%s' hat keine len()" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "pop von einem leeren PulseIn" + +#~ msgid "pop from an empty set" +#~ msgstr "pop von einer leeren Menge (set)" + +#~ msgid "pop from empty list" +#~ msgstr "pop von einer leeren Liste" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "popitem(): dictionary ist leer" + +#~ msgid "string index out of range" +#~ msgstr "String index außerhalb des Bereiches" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "String indizes müssen Integer sein, nicht %s" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: index außerhalb gültigen Bereichs" + +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "unbekannter Formatcode '%c' für Objekt vom Typ '%s'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "nicht unterstützter Type für %q: '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "nicht unterstützte Typen für %q: '%s', '%s'" + #~ msgid "'async for' or 'async with' outside async function" #~ msgstr "'async for' oder 'async with' außerhalb der asynchronen Funktion" diff --git a/locale/es.po b/locale/es.po index edecfa7033..4fb9166e41 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-28 16:57-0500\n" +"POT-Creation-Date: 2020-08-14 09:36-0400\n" "PO-Revision-Date: 2020-07-24 21:12+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -75,13 +75,17 @@ msgstr "%q fallo: %d" msgid "%q in use" msgstr "%q está siendo utilizado" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -119,6 +123,42 @@ msgstr "%q() toma %d argumentos posicionales pero %d fueron dados" msgid "'%q' argument required" msgstr "argumento '%q' requerido" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -169,48 +209,6 @@ msgstr "'%s' entero %d no esta dentro del rango %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' entero 0x%x no cabe en la máscara 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "El objeto '%s' no puede asignar al atributo '%q'" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "El objeto '%s' no admite '%q'" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "el objeto '%s' no soporta la asignación de elementos" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "objeto '%s' no soporta la eliminación de elementos" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "objeto '%s' no tiene atributo '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "objeto '%s' no es un iterator" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "objeto '%s' no puede ser llamado" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "objeto '%s' no es iterable" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "el objeto '%s' no es suscriptable" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "'=' alineación no permitida en el especificador string format" @@ -464,6 +462,10 @@ msgstr "La longitud del buffer %d es muy grande. Debe ser menor a %d" msgid "Buffer length must be a multiple of 512" msgstr "El tamaño del búfer debe ser múltiplo de 512" +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Buffer must be a multiple of 512 bytes" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Buffer debe ser de longitud 1 como minimo" @@ -660,6 +662,10 @@ msgstr "No se pudo reiniciar el temporizador" msgid "Could not restart PWM" msgstr "No se pudo reiniciar el PWM" +#: shared-bindings/_bleio/Adapter.c +msgid "Could not set address" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" msgstr "No se pudo iniciar el PWM" @@ -842,6 +848,11 @@ msgstr "Error al escribir al flash interno." msgid "File exists" msgstr "El archivo ya existe" +#: shared-module/framebufferio/FramebufferDisplay.c +#, c-format +msgid "Framebuffer requires %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "Frecuencia capturada por encima de la capacidad. Captura en pausa." @@ -867,7 +878,7 @@ msgid "Group full" msgstr "Group lleno" #: 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/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "Hardware ocupado, pruebe pines alternativos" @@ -883,6 +894,10 @@ msgstr "Operación I/O en archivo cerrado" msgid "I2C Init Error" msgstr "Error de inicio de I2C" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -930,6 +945,11 @@ msgstr "%q inválido" msgid "Invalid %q pin" msgstr "Pin %q inválido" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +msgid "Invalid %q pin selection" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Valor de unidad de ADC no válido" @@ -942,24 +962,12 @@ msgstr "Archivo BMP inválido" msgid "Invalid DAC pin supplied" msgstr "Pin suministrado inválido para DAC" -#: ports/stm/common-hal/busio/I2C.c -msgid "Invalid I2C pin selection" -msgstr "Selección de pin I2C no válida" - #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Frecuencia PWM inválida" -#: ports/stm/common-hal/busio/SPI.c -msgid "Invalid SPI pin selection" -msgstr "Selección de pin SPI no válida" - -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid UART pin selection" -msgstr "Selección de pin UART no válida" - #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Argumento inválido" @@ -1255,6 +1263,10 @@ msgstr "No conectado" msgid "Not playing" msgstr "No reproduciendo" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1350,10 +1362,6 @@ msgstr "Además de cualquier módulo en el sistema de archivos\n" msgid "Polygon needs at least 3 points" msgstr "El polígono necesita al menos 3 puntos" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "Pop de un buffer Ps2 vacio" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "El búfer de prefijo debe estar en el montículo" @@ -1427,12 +1435,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "La entrada de la fila debe ser digitalio.DigitalInOut" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Ejecutando en modo seguro! La auto-recarga esta deshabilitada.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Ejecutando en modo seguro! No se esta ejecutando el código guardado.\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1443,6 +1447,16 @@ msgstr "Sin capacidad para formato CSD para tarjeta SD" msgid "SDA or SCL needs a pull up" msgstr "SDA o SCL necesitan una pull up" +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO GetCardInfo Error %d" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO Init Error %d" +msgstr "" + #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" msgstr "Error de inicio de SPI" @@ -1817,9 +1831,8 @@ msgid "__init__() should return None" msgstr "__init__() deberia devolver None" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "__init__() deberia devolver None, no '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1972,7 +1985,7 @@ msgstr "bytes > 8 bits no soportados" msgid "bytes value out of range" msgstr "valor de bytes fuera de rango" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "calibration esta fuera de rango" @@ -2004,48 +2017,17 @@ msgstr "no se puede agregar un método a una clase ya subclasificada" msgid "can't assign to expression" msgstr "no se puede asignar a la expresión" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "no se puede convertir %s a complejo" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "no se puede convertir %s a float" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "no se puede convertir %s a int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "no se puede convertir el objeto '%q' a %q implícitamente" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "no se puede convertir Nan a int" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "no se puede convertir address a int" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "no se puede convertir inf en int" - #: py/obj.c -msgid "can't convert to complex" -msgstr "no se puede convertir a complejo" - -#: py/obj.c -msgid "can't convert to float" -msgstr "no se puede convertir a float" - -#: py/obj.c -msgid "can't convert to int" -msgstr "no se puede convertir a int" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2459,7 +2441,7 @@ msgstr "la función requiere del argumento por palabra clave '%q'" msgid "function missing required positional argument #%d" msgstr "la función requiere del argumento posicional #%d" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "la función toma %d argumentos posicionales pero le fueron dados %d" @@ -2508,10 +2490,7 @@ msgstr "relleno (padding) incorrecto" msgid "index is out of bounds" msgstr "el índice está fuera de límites" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "index fuera de rango" @@ -2873,9 +2852,8 @@ msgid "number of points must be at least 2" msgstr "el número de puntos debe ser al menos 2" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "el objeto '%s' no es una tupla o lista" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2910,9 +2888,8 @@ msgid "object not iterable" msgstr "objeto no iterable" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "el objeto de tipo '%s' no tiene len()" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -3004,21 +2981,10 @@ msgstr "el polígono solo se puede registrar en uno de los padres" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "pop de un PulseIn vacío" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "pop desde un set vacío" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "pop desde una lista vacía" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "popitem(): diccionario vacío" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3176,13 +3142,8 @@ msgid "stream operation not supported" msgstr "operación stream no soportada" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "string index fuera de rango" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "índices de string deben ser enteros, no %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3192,10 +3153,6 @@ msgstr "string no soportado; usa bytes o bytearray" msgid "struct: cannot index" msgstr "struct: no se puede indexar" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: index fuera de rango" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct: sin campos" @@ -3266,7 +3223,7 @@ msgstr "demasiados valores para descomprimir (%d esperado)" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "tuple index fuera de rango" @@ -3333,9 +3290,8 @@ msgid "unknown conversion specifier %c" msgstr "especificador de conversión %c desconocido" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "codigo format desconocido '%c' para el typo de objeto '%s'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3374,16 +3330,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "carácter no soportado '%c' (0x%x) en índice %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "tipo no soportado para %q: '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "tipo de operador no soportado" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "tipos no soportados para %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3462,6 +3418,121 @@ 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 "'%s' object cannot assign attribute '%q'" +#~ msgstr "El objeto '%s' no puede asignar al atributo '%q'" + +#~ msgid "'%s' object does not support '%q'" +#~ msgstr "El objeto '%s' no admite '%q'" + +#~ msgid "'%s' object does not support item assignment" +#~ msgstr "el objeto '%s' no soporta la asignación de elementos" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "objeto '%s' no soporta la eliminación de elementos" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "objeto '%s' no tiene atributo '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "objeto '%s' no es un iterator" + +#~ msgid "'%s' object is not callable" +#~ msgstr "objeto '%s' no puede ser llamado" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "objeto '%s' no es iterable" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "el objeto '%s' no es suscriptable" + +#~ msgid "Invalid I2C pin selection" +#~ msgstr "Selección de pin I2C no válida" + +#~ msgid "Invalid SPI pin selection" +#~ msgstr "Selección de pin SPI no válida" + +#~ msgid "Invalid UART pin selection" +#~ msgstr "Selección de pin UART no válida" + +#~ msgid "Pop from an empty Ps2 buffer" +#~ msgstr "Pop de un buffer Ps2 vacio" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Ejecutando en modo seguro! La auto-recarga esta deshabilitada.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "" +#~ "Ejecutando en modo seguro! No se esta ejecutando el código guardado.\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "__init__() deberia devolver None, no '%s'" + +#~ msgid "can't convert %s to complex" +#~ msgstr "no se puede convertir %s a complejo" + +#~ msgid "can't convert %s to float" +#~ msgstr "no se puede convertir %s a float" + +#~ msgid "can't convert %s to int" +#~ msgstr "no se puede convertir %s a int" + +#~ msgid "can't convert NaN to int" +#~ msgstr "no se puede convertir Nan a int" + +#~ msgid "can't convert address to int" +#~ msgstr "no se puede convertir address a int" + +#~ msgid "can't convert inf to int" +#~ msgstr "no se puede convertir inf en int" + +#~ msgid "can't convert to complex" +#~ msgstr "no se puede convertir a complejo" + +#~ msgid "can't convert to float" +#~ msgstr "no se puede convertir a float" + +#~ msgid "can't convert to int" +#~ msgstr "no se puede convertir a int" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "el objeto '%s' no es una tupla o lista" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "el objeto de tipo '%s' no tiene len()" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "pop de un PulseIn vacío" + +#~ msgid "pop from an empty set" +#~ msgstr "pop desde un set vacío" + +#~ msgid "pop from empty list" +#~ msgstr "pop desde una lista vacía" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "popitem(): diccionario vacío" + +#~ msgid "string index out of range" +#~ msgstr "string index fuera de rango" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "índices de string deben ser enteros, no %s" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: index fuera de rango" + +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "codigo format desconocido '%c' para el typo de objeto '%s'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "tipo no soportado para %q: '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "tipos no soportados para %q: '%s', '%s'" + #~ msgid "'%q' object is not bytes-like" #~ msgstr "el objeto '%q' no es similar a bytes" diff --git a/locale/fil.po b/locale/fil.po index 85738e0c68..fe37c90c63 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-28 16:57-0500\n" +"POT-Creation-Date: 2020-08-14 09:36-0400\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -64,13 +64,17 @@ msgstr "" msgid "%q in use" msgstr "%q ay ginagamit" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -111,6 +115,42 @@ msgstr "" msgid "'%q' argument required" msgstr "'%q' argument kailangan" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -161,48 +201,6 @@ msgstr "'%s' integer %d ay wala sa sakop ng %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' integer 0x%x ay wala sa mask na sakop ng 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "'%s' object hindi sumusuporta ng item assignment" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "'%s' object ay hindi sumusuporta sa pagtanggal ng item" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "'%s' object ay walang attribute '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "'%s' object ay hindi iterator" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "'%s' object hindi matatawag" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "'%s' object ay hindi ma i-iterable" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "'%s' object ay hindi maaaring i-subscript" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "'=' Gindi pinapayagan ang alignment sa pag specify ng string format" @@ -453,6 +451,10 @@ msgstr "" msgid "Buffer length must be a multiple of 512" msgstr "" +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Buffer must be a multiple of 512 bytes" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Buffer dapat ay hindi baba sa 1 na haba" @@ -646,6 +648,10 @@ msgstr "" msgid "Could not restart PWM" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Could not set address" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" msgstr "" @@ -833,6 +839,11 @@ msgstr "" msgid "File exists" msgstr "Mayroong file" +#: shared-module/framebufferio/FramebufferDisplay.c +#, c-format +msgid "Framebuffer requires %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -857,7 +868,7 @@ msgid "Group full" msgstr "Puno ang group" #: 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/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -873,6 +884,10 @@ msgstr "I/O operasyon sa saradong file" msgid "I2C Init Error" msgstr "" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -920,6 +935,11 @@ msgstr "" msgid "Invalid %q pin" msgstr "Mali ang %q pin" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +msgid "Invalid %q pin selection" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "" @@ -932,24 +952,12 @@ msgstr "Mali ang BMP file" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/stm/common-hal/busio/I2C.c -msgid "Invalid I2C pin selection" -msgstr "" - #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Mali ang PWM frequency" -#: ports/stm/common-hal/busio/SPI.c -msgid "Invalid SPI pin selection" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid UART pin selection" -msgstr "" - #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Maling argumento" @@ -1246,6 +1254,10 @@ msgstr "Hindi maka connect sa AP" msgid "Not playing" msgstr "Hindi playing" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1334,10 +1346,6 @@ msgstr "Kasama ang kung ano pang modules na sa filesystem\n" msgid "Polygon needs at least 3 points" msgstr "" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1413,12 +1421,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Tumatakbo sa safe mode! Awtomatikong pag re-reload ay OFF.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Tumatakbo sa safe mode! Hindi tumatakbo ang nai-save na code.\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1429,6 +1433,16 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "Kailangan ng pull up resistors ang SDA o SCL" +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO GetCardInfo Error %d" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO Init Error %d" +msgstr "" + #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" msgstr "" @@ -1788,9 +1802,8 @@ msgid "__init__() should return None" msgstr "__init __ () dapat magbalik na None" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "__init__() dapat magbalink na None, hindi '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1944,7 +1957,7 @@ msgstr "hindi sinusuportahan ang bytes > 8 bits" msgid "bytes value out of range" msgstr "bytes value wala sa sakop" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "kalibrasion ay wala sa sakop" @@ -1977,48 +1990,17 @@ msgstr "" msgid "can't assign to expression" msgstr "hindi ma i-assign sa expression" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "hindi ma-convert %s sa complex" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "hindi ma-convert %s sa int" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "hindi ma-convert %s sa int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "hindi maaaring i-convert ang '%q' na bagay sa %q nang walang pahiwatig" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "hindi ma i-convert NaN sa int" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "hindi ma i-convert ang address sa INT" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "hindi ma i-convert inf sa int" - #: py/obj.c -msgid "can't convert to complex" -msgstr "hindi ma-convert sa complex" - -#: py/obj.c -msgid "can't convert to float" -msgstr "hindi ma-convert sa float" - -#: py/obj.c -msgid "can't convert to int" -msgstr "hindi ma-convert sa int" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2435,7 +2417,7 @@ msgstr "function nangangailangan ng keyword argument '%q'" msgid "function missing required positional argument #%d" msgstr "function nangangailangan ng positional argument #%d" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "" @@ -2485,10 +2467,7 @@ msgstr "mali ang padding" msgid "index is out of bounds" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "index wala sa sakop" @@ -2848,9 +2827,8 @@ msgid "number of points must be at least 2" msgstr "" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "object '%s' ay hindi tuple o list" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2885,9 +2863,8 @@ msgid "object not iterable" msgstr "object hindi ma i-iterable" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "object na type '%s' walang len()" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -2981,21 +2958,10 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "pop mula sa walang laman na PulseIn" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "pop sa walang laman na set" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "pop galing sa walang laman na list" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "popitem(): dictionary ay walang laman" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3154,13 +3120,8 @@ msgid "stream operation not supported" msgstr "stream operation hindi sinusuportahan" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "indeks ng string wala sa sakop" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "ang indeks ng string ay dapat na integer, hindi %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3170,10 +3131,6 @@ msgstr "string hindi supportado; gumamit ng bytes o kaya bytearray" msgid "struct: cannot index" msgstr "struct: hindi ma-index" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: index hindi maabot" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct: walang fields" @@ -3244,7 +3201,7 @@ msgstr "masyadong maraming values para i-unpact (umaasa ng %d)" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "indeks ng tuple wala sa sakop" @@ -3311,9 +3268,8 @@ msgid "unknown conversion specifier %c" msgstr "hindi alam ang conversion specifier na %c" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "hindi alam ang format code '%c' para sa object na ang type ay '%s'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3352,16 +3308,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "hindi sinusuportahan ang format character na '%c' (0x%x) sa index %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "hindi sinusuportahang type para sa %q: '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "hindi sinusuportahang type para sa operator" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "hindi sinusuportahang type para sa %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3442,6 +3398,102 @@ 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 "'%s' object does not support item assignment" +#~ msgstr "'%s' object hindi sumusuporta ng item assignment" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "'%s' object ay hindi sumusuporta sa pagtanggal ng item" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "'%s' object ay walang attribute '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "'%s' object ay hindi iterator" + +#~ msgid "'%s' object is not callable" +#~ msgstr "'%s' object hindi matatawag" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "'%s' object ay hindi ma i-iterable" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "'%s' object ay hindi maaaring i-subscript" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Tumatakbo sa safe mode! Awtomatikong pag re-reload ay OFF.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "Tumatakbo sa safe mode! Hindi tumatakbo ang nai-save na code.\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "__init__() dapat magbalink na None, hindi '%s'" + +#~ msgid "can't convert %s to complex" +#~ msgstr "hindi ma-convert %s sa complex" + +#~ msgid "can't convert %s to float" +#~ msgstr "hindi ma-convert %s sa int" + +#~ msgid "can't convert %s to int" +#~ msgstr "hindi ma-convert %s sa int" + +#~ msgid "can't convert NaN to int" +#~ msgstr "hindi ma i-convert NaN sa int" + +#~ msgid "can't convert address to int" +#~ msgstr "hindi ma i-convert ang address sa INT" + +#~ msgid "can't convert inf to int" +#~ msgstr "hindi ma i-convert inf sa int" + +#~ msgid "can't convert to complex" +#~ msgstr "hindi ma-convert sa complex" + +#~ msgid "can't convert to float" +#~ msgstr "hindi ma-convert sa float" + +#~ msgid "can't convert to int" +#~ msgstr "hindi ma-convert sa int" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "object '%s' ay hindi tuple o list" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "object na type '%s' walang len()" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "pop mula sa walang laman na PulseIn" + +#~ msgid "pop from an empty set" +#~ msgstr "pop sa walang laman na set" + +#~ msgid "pop from empty list" +#~ msgstr "pop galing sa walang laman na list" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "popitem(): dictionary ay walang laman" + +#~ msgid "string index out of range" +#~ msgstr "indeks ng string wala sa sakop" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "ang indeks ng string ay dapat na integer, hindi %s" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: index hindi maabot" + +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "hindi alam ang format code '%c' para sa object na ang type ay '%s'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "hindi sinusuportahang type para sa %q: '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "hindi sinusuportahang type para sa %q: '%s', '%s'" + #~ msgid "AP required" #~ msgstr "AP kailangan" diff --git a/locale/fr.po b/locale/fr.po index f164501055..089ad1f1d2 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-28 16:57-0500\n" +"POT-Creation-Date: 2020-08-14 09:36-0400\n" "PO-Revision-Date: 2020-07-27 21:27+0000\n" "Last-Translator: Nathan \n" "Language: fr\n" @@ -76,13 +76,17 @@ msgstr "Échec de %q : %d" msgid "%q in use" msgstr "%q utilisé" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c msgid "%q index out of range" msgstr "index %q hors gamme" #: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "les indices %q doivent être des entiers, pas %s" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -120,6 +124,42 @@ msgstr "%q() prend %d arguments positionnels mais %d ont été donnés" msgid "'%q' argument required" msgstr "'%q' argument requis" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -170,48 +210,6 @@ msgstr "'%s' l'entier %d n'est pas dans la gamme %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' l'entier 0x%x ne correspond pas au masque 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "L'objet '%s' ne peut pas attribuer '%q'" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "L'objet '%s' ne prend pas en charge '%q'" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "l'objet '%s' ne supporte pas l'assignation d'éléments" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "l'objet '%s' ne supporte pas la suppression d'éléments" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "l'objet '%s' n'a pas d'attribut '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "l'objet '%s' n'est pas un itérateur" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "l'objet '%s' n'est pas appelable" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "l'objet '%s' n'est pas itérable" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "l'objet '%s' n'est pas sous-scriptable" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "'=' alignement non autorisé dans la spéc. de format de chaîne" @@ -464,6 +462,10 @@ msgstr "La longueur du tampon %d est trop grande. Il doit être inférieur à %d msgid "Buffer length must be a multiple of 512" msgstr "La longueur de la mémoire tampon doit être un multiple de 512" +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Buffer must be a multiple of 512 bytes" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Le tampon doit être de longueur au moins 1" @@ -663,6 +665,10 @@ msgstr "Impossible de réinitialiser le minuteur" msgid "Could not restart PWM" msgstr "Impossible de redémarrer PWM" +#: shared-bindings/_bleio/Adapter.c +msgid "Could not set address" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" msgstr "Impossible de démarrer PWM" @@ -846,6 +852,11 @@ msgstr "Échec de l'écriture du flash interne." msgid "File exists" msgstr "Le fichier existe" +#: shared-module/framebufferio/FramebufferDisplay.c +#, c-format +msgid "Framebuffer requires %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "La fréquence capturée est au delà des capacités. Capture en pause." @@ -871,7 +882,7 @@ msgid "Group full" msgstr "Groupe plein" #: 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/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "Matériel occupé, essayez d'autres broches" @@ -887,6 +898,10 @@ msgstr "opération d'E/S sur un fichier fermé" msgid "I2C Init Error" msgstr "Erreur d'initialisation I2C" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -934,6 +949,11 @@ msgstr "%q invalide" msgid "Invalid %q pin" msgstr "Broche invalide pour '%q'" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +msgid "Invalid %q pin selection" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Valeur d'unité ADC non valide" @@ -946,24 +966,12 @@ msgstr "Fichier BMP invalide" msgid "Invalid DAC pin supplied" msgstr "Broche DAC non valide fournie" -#: ports/stm/common-hal/busio/I2C.c -msgid "Invalid I2C pin selection" -msgstr "Sélection de broches I2C non valide" - #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Fréquence de PWM invalide" -#: ports/stm/common-hal/busio/SPI.c -msgid "Invalid SPI pin selection" -msgstr "Sélection de broches SPI non valide" - -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid UART pin selection" -msgstr "Sélection de broches UART non valide" - #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Argument invalide" @@ -1259,6 +1267,10 @@ msgstr "Non connecté" msgid "Not playing" msgstr "Ne joue pas" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1357,10 +1369,6 @@ msgstr "Ainsi que tout autre module présent sur le système de fichiers\n" msgid "Polygon needs at least 3 points" msgstr "Polygone a besoin d’au moins 3 points" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "Pop à partir d'un tampon Ps2 vide" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Le tampon de préfixe doit être sur le tas" @@ -1433,12 +1441,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "L'entrée de ligne 'Row' doit être un digitalio.DigitalInOut" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Mode sans-échec ! Auto-chargement désactivé.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Mode sans-échec ! Le code sauvegardé n'est pas éxecuté.\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1449,6 +1453,16 @@ msgstr "Le format de carte SD CSD n'est pas pris en charge" msgid "SDA or SCL needs a pull up" msgstr "SDA ou SCL a besoin d'une résistance de tirage ('pull up')" +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO GetCardInfo Error %d" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO Init Error %d" +msgstr "" + #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" msgstr "Erreur d'initialisation SPI" @@ -1824,9 +1838,8 @@ msgid "__init__() should return None" msgstr "__init__() doit retourner None" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "__init__() doit retourner None, pas '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1979,7 +1992,7 @@ msgstr "octets > 8 bits non supporté" msgid "bytes value out of range" msgstr "valeur des octets hors bornes" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "étalonnage hors bornes" @@ -2012,48 +2025,17 @@ msgstr "" msgid "can't assign to expression" msgstr "ne peut pas assigner à une expression" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "ne peut convertir %s en nombre complexe" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "ne peut convertir %s en nombre à virgule flottante 'float'" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "ne peut convertir %s en entier 'int'" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "impossible de convertir l'objet '%q' en '%q' implicitement" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "on ne peut convertir NaN en entier 'int'" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "ne peut convertir l'adresse en entier 'int'" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "on ne peut convertir l'infini 'inf' en entier 'int'" - #: py/obj.c -msgid "can't convert to complex" -msgstr "ne peut convertir en nombre complexe" - -#: py/obj.c -msgid "can't convert to float" -msgstr "ne peut convertir en nombre à virgule flottante 'float'" - -#: py/obj.c -msgid "can't convert to int" -msgstr "ne peut convertir en entier 'int'" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2476,7 +2458,7 @@ msgstr "il manque l'argument nommé obligatoire '%q'" msgid "function missing required positional argument #%d" msgstr "il manque l'argument positionnel obligatoire #%d" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "la fonction prend %d argument(s) positionnels mais %d ont été donné(s)" @@ -2525,10 +2507,7 @@ msgstr "espacement incorrect" msgid "index is out of bounds" msgstr "l'index est hors limites" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "index hors gamme" @@ -2891,9 +2870,8 @@ msgid "number of points must be at least 2" msgstr "le nombre de points doit être d'au moins 2" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "l'objet '%s' n'est pas un tuple ou une liste" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2928,9 +2906,8 @@ msgid "object not iterable" msgstr "objet non itérable" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "l'objet de type '%s' n'a pas de len()" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -3025,21 +3002,10 @@ msgstr "le polygone ne peut être enregistré que dans un parent" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "'pop' d'une entrée PulseIn vide" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "'pop' d'un ensemble set vide" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "'pop' d'une liste vide" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "popitem() : dictionnaire vide" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3197,13 +3163,8 @@ msgid "stream operation not supported" msgstr "opération de flux non supportée" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "index de chaîne hors gamme" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "les indices de chaîne de caractères doivent être des entiers, pas %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3214,10 +3175,6 @@ msgstr "" msgid "struct: cannot index" msgstr "struct : indexage impossible" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct : index hors limites" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct : aucun champs" @@ -3287,7 +3244,7 @@ msgstr "trop de valeur à dégrouper (%d attendues)" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "index du tuple hors gamme" @@ -3354,9 +3311,8 @@ msgid "unknown conversion specifier %c" msgstr "spécification %c de conversion inconnue" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "code de format '%c' inconnu pour un objet de type '%s'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3395,16 +3351,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "caractère de format '%c' (0x%x) non supporté à l'index %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "type non supporté pour %q : '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "type non supporté pour l'opérateur" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "type non supporté pour %q : '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3483,6 +3439,121 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "les indices %q doivent être des entiers, pas %s" + +#~ msgid "'%s' object cannot assign attribute '%q'" +#~ msgstr "L'objet '%s' ne peut pas attribuer '%q'" + +#~ msgid "'%s' object does not support '%q'" +#~ msgstr "L'objet '%s' ne prend pas en charge '%q'" + +#~ msgid "'%s' object does not support item assignment" +#~ msgstr "l'objet '%s' ne supporte pas l'assignation d'éléments" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "l'objet '%s' ne supporte pas la suppression d'éléments" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "l'objet '%s' n'a pas d'attribut '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "l'objet '%s' n'est pas un itérateur" + +#~ msgid "'%s' object is not callable" +#~ msgstr "l'objet '%s' n'est pas appelable" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "l'objet '%s' n'est pas itérable" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "l'objet '%s' n'est pas sous-scriptable" + +#~ msgid "Invalid I2C pin selection" +#~ msgstr "Sélection de broches I2C non valide" + +#~ msgid "Invalid SPI pin selection" +#~ msgstr "Sélection de broches SPI non valide" + +#~ msgid "Invalid UART pin selection" +#~ msgstr "Sélection de broches UART non valide" + +#~ msgid "Pop from an empty Ps2 buffer" +#~ msgstr "Pop à partir d'un tampon Ps2 vide" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Mode sans-échec ! Auto-chargement désactivé.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "Mode sans-échec ! Le code sauvegardé n'est pas éxecuté.\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "__init__() doit retourner None, pas '%s'" + +#~ msgid "can't convert %s to complex" +#~ msgstr "ne peut convertir %s en nombre complexe" + +#~ msgid "can't convert %s to float" +#~ msgstr "ne peut convertir %s en nombre à virgule flottante 'float'" + +#~ msgid "can't convert %s to int" +#~ msgstr "ne peut convertir %s en entier 'int'" + +#~ msgid "can't convert NaN to int" +#~ msgstr "on ne peut convertir NaN en entier 'int'" + +#~ msgid "can't convert address to int" +#~ msgstr "ne peut convertir l'adresse en entier 'int'" + +#~ msgid "can't convert inf to int" +#~ msgstr "on ne peut convertir l'infini 'inf' en entier 'int'" + +#~ msgid "can't convert to complex" +#~ msgstr "ne peut convertir en nombre complexe" + +#~ msgid "can't convert to float" +#~ msgstr "ne peut convertir en nombre à virgule flottante 'float'" + +#~ msgid "can't convert to int" +#~ msgstr "ne peut convertir en entier 'int'" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "l'objet '%s' n'est pas un tuple ou une liste" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "l'objet de type '%s' n'a pas de len()" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "'pop' d'une entrée PulseIn vide" + +#~ msgid "pop from an empty set" +#~ msgstr "'pop' d'un ensemble set vide" + +#~ msgid "pop from empty list" +#~ msgstr "'pop' d'une liste vide" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "popitem() : dictionnaire vide" + +#~ msgid "string index out of range" +#~ msgstr "index de chaîne hors gamme" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "" +#~ "les indices de chaîne de caractères doivent être des entiers, pas %s" + +#~ msgid "struct: index out of range" +#~ msgstr "struct : index hors limites" + +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "code de format '%c' inconnu pour un objet de type '%s'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "type non supporté pour %q : '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "type non supporté pour %q : '%s', '%s'" + #~ msgid "'async for' or 'async with' outside async function" #~ msgstr "'async for' ou 'async with' sans fonction asynchrone extérieure" diff --git a/locale/hi.po b/locale/hi.po index 79b9748036..229bcff7e8 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-28 16:57-0500\n" +"POT-Creation-Date: 2020-08-14 09:36-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -65,12 +65,16 @@ msgstr "" msgid "%q in use" msgstr "" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c msgid "%q index out of range" msgstr "" #: py/obj.c -msgid "%q indices must be integers, not %s" +msgid "%q indices must be integers, not %q" msgstr "" #: shared-bindings/vectorio/Polygon.c @@ -109,6 +113,42 @@ msgstr "" msgid "'%q' argument required" msgstr "" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -159,48 +199,6 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "" @@ -448,6 +446,10 @@ msgstr "" msgid "Buffer length must be a multiple of 512" msgstr "" +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Buffer must be a multiple of 512 bytes" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "" @@ -638,6 +640,10 @@ msgstr "" msgid "Could not restart PWM" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Could not set address" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" msgstr "" @@ -820,6 +826,11 @@ msgstr "" msgid "File exists" msgstr "" +#: shared-module/framebufferio/FramebufferDisplay.c +#, c-format +msgid "Framebuffer requires %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -844,7 +855,7 @@ msgid "Group full" msgstr "" #: 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/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -860,6 +871,10 @@ msgstr "" msgid "I2C Init Error" msgstr "" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -905,6 +920,11 @@ msgstr "" msgid "Invalid %q pin" msgstr "" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +msgid "Invalid %q pin selection" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "" @@ -917,24 +937,12 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/stm/common-hal/busio/I2C.c -msgid "Invalid I2C pin selection" -msgstr "" - #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c msgid "Invalid PWM frequency" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "Invalid SPI pin selection" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid UART pin selection" -msgstr "" - #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "" @@ -1230,6 +1238,10 @@ msgstr "" msgid "Not playing" msgstr "" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1315,10 +1327,6 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1391,11 +1399,7 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" +msgid "Running in safe mode! " msgstr "" #: shared-module/sdcardio/SDCard.c @@ -1407,6 +1411,16 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "" +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO GetCardInfo Error %d" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO Init Error %d" +msgstr "" + #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" msgstr "" @@ -1756,8 +1770,7 @@ msgid "__init__() should return None" msgstr "" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" +msgid "__init__() should return None, not '%q'" msgstr "" #: py/objobject.c @@ -1911,7 +1924,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "" @@ -1943,47 +1956,16 @@ msgstr "" msgid "can't assign to expression" msgstr "" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "" - #: py/obj.c -msgid "can't convert to complex" -msgstr "" - -#: py/obj.c -msgid "can't convert to float" -msgstr "" - -#: py/obj.c -msgid "can't convert to int" +msgid "can't convert to %q" msgstr "" #: py/objstr.c @@ -2391,7 +2373,7 @@ msgstr "" msgid "function missing required positional argument #%d" msgstr "" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "" @@ -2440,10 +2422,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "" @@ -2799,8 +2778,7 @@ msgid "number of points must be at least 2" msgstr "" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" +msgid "object '%q' is not a tuple or list" msgstr "" #: py/obj.c @@ -2836,8 +2814,7 @@ msgid "object not iterable" msgstr "" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" +msgid "object of type '%q' has no len()" msgstr "" #: py/obj.c @@ -2930,20 +2907,9 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" msgstr "" #: py/objint_mpz.c @@ -3100,12 +3066,7 @@ msgid "stream operation not supported" msgstr "" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" +msgid "string indices must be integers, not %q" msgstr "" #: py/stream.c @@ -3116,10 +3077,6 @@ msgstr "" msgid "struct: cannot index" msgstr "" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "" @@ -3189,7 +3146,7 @@ msgstr "" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "" @@ -3256,8 +3213,7 @@ msgid "unknown conversion specifier %c" msgstr "" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" +msgid "unknown format code '%c' for object of type '%q'" msgstr "" #: py/compile.c @@ -3297,7 +3253,7 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "" #: py/runtime.c -msgid "unsupported type for %q: '%s'" +msgid "unsupported type for %q: '%q'" msgstr "" #: py/runtime.c @@ -3305,7 +3261,7 @@ msgid "unsupported type for operator" msgstr "" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" msgstr "" #: py/objint.c diff --git a/locale/it_IT.po b/locale/it_IT.po index 3862d382f2..dafda62f9c 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-28 16:57-0500\n" +"POT-Creation-Date: 2020-08-14 09:36-0400\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -64,13 +64,17 @@ msgstr "" msgid "%q in use" msgstr "%q in uso" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -110,6 +114,42 @@ msgstr "%q() prende %d argomenti posizionali ma ne sono stati forniti %d" msgid "'%q' argument required" msgstr "'%q' argomento richiesto" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -160,48 +200,6 @@ msgstr "intero '%s' non è nell'intervallo %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "intero '%s' non è nell'intervallo %d..%d" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "oggeto '%s' non supporta assengnamento di item" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "oggeto '%s' non supporta eliminamento di item" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "l'oggetto '%s' non ha l'attributo '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "l'oggetto '%s' non è un iteratore" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "oggeto '%s' non è chiamabile" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "l'oggetto '%s' non è iterabile" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "oggeto '%s' non è " - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "aligniamento '=' non è permesso per il specificatore formato string" @@ -453,6 +451,10 @@ msgstr "" msgid "Buffer length must be a multiple of 512" msgstr "" +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Buffer must be a multiple of 512 bytes" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Il buffer deve essere lungo almeno 1" @@ -647,6 +649,10 @@ msgstr "" msgid "Could not restart PWM" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Could not set address" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" msgstr "" @@ -833,6 +839,11 @@ msgstr "" msgid "File exists" msgstr "File esistente" +#: shared-module/framebufferio/FramebufferDisplay.c +#, c-format +msgid "Framebuffer requires %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -857,7 +868,7 @@ msgid "Group full" msgstr "Gruppo pieno" #: 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/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -873,6 +884,10 @@ msgstr "operazione I/O su file chiuso" msgid "I2C Init Error" msgstr "" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -920,6 +935,11 @@ msgstr "" msgid "Invalid %q pin" msgstr "Pin %q non valido" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +msgid "Invalid %q pin selection" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "" @@ -932,24 +952,12 @@ msgstr "File BMP non valido" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/stm/common-hal/busio/I2C.c -msgid "Invalid I2C pin selection" -msgstr "" - #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Frequenza PWM non valida" -#: ports/stm/common-hal/busio/SPI.c -msgid "Invalid SPI pin selection" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid UART pin selection" -msgstr "" - #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Argomento non valido" @@ -1250,6 +1258,10 @@ msgstr "Impossible connettersi all'AP" msgid "Not playing" msgstr "In pausa" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1344,10 +1356,6 @@ msgstr "Imposssibile rimontare il filesystem" msgid "Polygon needs at least 3 points" msgstr "" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1422,12 +1430,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Modalità sicura in esecuzione! Auto-reload disattivato.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Modalità sicura in esecuzione! Codice salvato non in esecuzione.\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1438,6 +1442,16 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "SDA o SCL necessitano un pull-up" +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO GetCardInfo Error %d" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO Init Error %d" +msgstr "" + #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" msgstr "" @@ -1791,9 +1805,8 @@ msgid "__init__() should return None" msgstr "__init__() deve ritornare None" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "__init__() deve ritornare None, non '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1949,7 +1962,7 @@ msgstr "byte > 8 bit non supportati" msgid "bytes value out of range" msgstr "valore byte fuori intervallo" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "la calibrazione è fuori intervallo" @@ -1982,48 +1995,17 @@ msgstr "" msgid "can't assign to expression" msgstr "impossibile assegnare all'espressione" -#: py/obj.c -#, fuzzy, c-format -msgid "can't convert %s to complex" -msgstr "non è possibile convertire a complex" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "non è possibile convertire %s a float" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "non è possibile convertire %s a int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "impossibile convertire l'oggetto '%q' implicitamente in %q" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "impossibile convertire NaN in int" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "impossible convertire indirizzo in int" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "impossibile convertire inf in int" - #: py/obj.c -msgid "can't convert to complex" -msgstr "non è possibile convertire a complex" - -#: py/obj.c -msgid "can't convert to float" -msgstr "non è possibile convertire a float" - -#: py/obj.c -msgid "can't convert to int" -msgstr "non è possibile convertire a int" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2436,7 +2418,7 @@ msgstr "argomento nominato '%q' mancante alla funzione" msgid "function missing required positional argument #%d" msgstr "mancante il #%d argomento posizonale obbligatorio della funzione" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "" @@ -2486,10 +2468,7 @@ msgstr "padding incorretto" msgid "index is out of bounds" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "indice fuori intervallo" @@ -2853,9 +2832,8 @@ msgid "number of points must be at least 2" msgstr "" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "oggetto '%s' non è una tupla o una lista" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2890,9 +2868,8 @@ msgid "object not iterable" msgstr "oggetto non iterabile" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "l'oggetto di tipo '%s' non implementa len()" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -2988,21 +2965,10 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "pop sun un PulseIn vuoto" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "pop da un set vuoto" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "pop da una lista vuota" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "popitem(): il dizionario è vuoto" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3161,13 +3127,8 @@ msgid "stream operation not supported" msgstr "operazione di stream non supportata" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "indice della stringa fuori intervallo" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "indici della stringa devono essere interi, non %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3177,10 +3138,6 @@ msgstr "" msgid "struct: cannot index" msgstr "struct: impossibile indicizzare" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: indice fuori intervallo" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct: nessun campo" @@ -3251,7 +3208,7 @@ msgstr "troppi valori da scompattare (%d attesi)" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "indice della tupla fuori intervallo" @@ -3318,9 +3275,8 @@ msgid "unknown conversion specifier %c" msgstr "specificatore di conversione %s sconosciuto" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "codice di formattaione '%c' sconosciuto per oggetto di tipo '%s'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3359,16 +3315,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "carattere di formattazione '%c' (0x%x) non supportato all indice %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "tipo non supportato per %q: '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "tipo non supportato per l'operando" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "tipi non supportati per %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3449,6 +3405,103 @@ 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 "'%s' object does not support item assignment" +#~ msgstr "oggeto '%s' non supporta assengnamento di item" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "oggeto '%s' non supporta eliminamento di item" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "l'oggetto '%s' non ha l'attributo '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "l'oggetto '%s' non è un iteratore" + +#~ msgid "'%s' object is not callable" +#~ msgstr "oggeto '%s' non è chiamabile" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "l'oggetto '%s' non è iterabile" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "oggeto '%s' non è " + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Modalità sicura in esecuzione! Auto-reload disattivato.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "Modalità sicura in esecuzione! Codice salvato non in esecuzione.\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "__init__() deve ritornare None, non '%s'" + +#, fuzzy +#~ msgid "can't convert %s to complex" +#~ msgstr "non è possibile convertire a complex" + +#~ msgid "can't convert %s to float" +#~ msgstr "non è possibile convertire %s a float" + +#~ msgid "can't convert %s to int" +#~ msgstr "non è possibile convertire %s a int" + +#~ msgid "can't convert NaN to int" +#~ msgstr "impossibile convertire NaN in int" + +#~ msgid "can't convert address to int" +#~ msgstr "impossible convertire indirizzo in int" + +#~ msgid "can't convert inf to int" +#~ msgstr "impossibile convertire inf in int" + +#~ msgid "can't convert to complex" +#~ msgstr "non è possibile convertire a complex" + +#~ msgid "can't convert to float" +#~ msgstr "non è possibile convertire a float" + +#~ msgid "can't convert to int" +#~ msgstr "non è possibile convertire a int" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "oggetto '%s' non è una tupla o una lista" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "l'oggetto di tipo '%s' non implementa len()" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "pop sun un PulseIn vuoto" + +#~ msgid "pop from an empty set" +#~ msgstr "pop da un set vuoto" + +#~ msgid "pop from empty list" +#~ msgstr "pop da una lista vuota" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "popitem(): il dizionario è vuoto" + +#~ msgid "string index out of range" +#~ msgstr "indice della stringa fuori intervallo" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "indici della stringa devono essere interi, non %s" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: indice fuori intervallo" + +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "codice di formattaione '%c' sconosciuto per oggetto di tipo '%s'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "tipo non supportato per %q: '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "tipi non supportati per %q: '%s', '%s'" + #~ msgid "AP required" #~ msgstr "AP richiesto" diff --git a/locale/ja.po b/locale/ja.po index 9c027fc5ab..4b4ec0833b 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-04 18:42-0500\n" +"POT-Creation-Date: 2020-08-14 09:36-0400\n" "PO-Revision-Date: 2020-08-10 16:59+0000\n" "Last-Translator: Taku Fukada \n" "Language-Team: none\n" @@ -117,7 +117,9 @@ msgstr "%qはint型でなければなりません" #: py/bc.c py/objnamedtuple.c #, fuzzy msgid "%q() takes %d positional arguments but %d were given" -msgstr "%q() は %d個の位置引数 (positional arguments) を受け取りますが、%d 個しか与えられていません" +msgstr "" +"%q() は %d個の位置引数 (positional arguments) を受け取りますが、%d 個しか与え" +"られていません" #: py/argcheck.c msgid "'%q' argument required" @@ -388,7 +390,9 @@ msgstr "オートリロードはオフです。\n" msgid "" "Auto-reload is on. Simply save files over USB to run them or enter REPL to " "disable.\n" -msgstr "オートリロードが有効です。ファイルをUSB経由で保存するだけで実行できます。REPLに入ると無効化します。\n" +msgstr "" +"オートリロードが有効です。ファイルをUSB経由で保存するだけで実行できます。REPL" +"に入ると無効化します。\n" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c @@ -456,6 +460,10 @@ msgstr "バッファ長 %d は大きすぎます。%d 以下でなければな msgid "Buffer length must be a multiple of 512" msgstr "バッファ長は512の倍数でなければなりません" +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Buffer must be a multiple of 512 bytes" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "バッファ長は少なくとも1以上でなければなりません" @@ -489,7 +497,9 @@ msgstr "CBCブロックは16バイトの整数倍でなければなりません" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "ネイティブオブジェクトにアクセスする前に super().__init__() を呼び出してください。" +msgstr "" +"ネイティブオブジェクトにアクセスする前に super().__init__() を呼び出してくだ" +"さい。" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" @@ -577,7 +587,9 @@ msgstr "CircuitPythonのコアコードが激しくクラッシュしました msgid "" "CircuitPython is in safe mode because you pressed the reset button during " "boot. Press again to exit safe mode.\n" -msgstr "起動中にリセットボタンを押したためCircuitPythonはセーフモードにいます。もう一度押すとセーフモードを終了します。\n" +msgstr "" +"起動中にリセットボタンを押したためCircuitPythonはセーフモードにいます。もう一" +"度押すとセーフモードを終了します。\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." @@ -646,6 +658,10 @@ msgstr "タイマーを再初期化できませんでした" msgid "Could not restart PWM" msgstr "PWMを再スタートできませんでした" +#: shared-bindings/_bleio/Adapter.c +msgid "Could not set address" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" msgstr "PWMをスタートできませんでした" @@ -828,13 +844,19 @@ msgstr "内部フラッシュの書き込みに失敗しました。" msgid "File exists" msgstr "ファイルが存在します。" +#: shared-module/framebufferio/FramebufferDisplay.c +#, c-format +msgid "Framebuffer requires %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" -msgstr "周波数は、このタイマーを使っている既存のPWMOutと一致しなければなりません" +msgstr "" +"周波数は、このタイマーを使っている既存のPWMOutと一致しなければなりません" #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c @@ -852,7 +874,7 @@ msgid "Group full" msgstr "グループが一杯です" #: 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/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "ハードウェアビジー。代替のピンを試してください" @@ -882,8 +904,8 @@ msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" -"非互換の .mpy ファイルです。すべての .mpy ファイルをアップデートしてください。詳細は http://adafru.it/mpy-update " -"を参照。" +"非互換の .mpy ファイルです。すべての .mpy ファイルをアップデートしてくださ" +"い。詳細は http://adafru.it/mpy-update を参照。" #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" @@ -919,6 +941,11 @@ msgstr "不正な %q" msgid "Invalid %q pin" msgstr "不正な %q ピン" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +msgid "Invalid %q pin selection" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "不正なADCユニット値" @@ -931,24 +958,12 @@ msgstr "不正なBMPファイル" msgid "Invalid DAC pin supplied" msgstr "無効なDACピンが与えられました" -#: ports/stm/common-hal/busio/I2C.c -msgid "Invalid I2C pin selection" -msgstr "I2Cピンの選択が不正です" - #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c msgid "Invalid PWM frequency" msgstr "無効なPWM周波数です" -#: ports/stm/common-hal/busio/SPI.c -msgid "Invalid SPI pin selection" -msgstr "SPIピンの選択が不正です" - -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid UART pin selection" -msgstr "UARTピンの選択が不正です" - #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "不正な引数" @@ -1251,7 +1266,9 @@ msgstr "保存されたコードは実行していません。\n" #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." -msgstr "オブジェクトは解体済みでもう使われていません。新たなオブジェクトを作成してください。" +msgstr "" +"オブジェクトは解体済みでもう使われていません。新たなオブジェクトを作成してく" +"ださい。" #: ports/nrf/common-hal/busio/UART.c msgid "Odd parity is not supported" @@ -1281,12 +1298,15 @@ msgstr "オーバーサンプルは8の倍数でなければなりません。" #: shared-bindings/pulseio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "PWMの duty_cycle 値は 0 から 65535 の間でなければなりません(16ビット解像度)" +msgstr "" +"PWMの duty_cycle 値は 0 から 65535 の間でなければなりません(16ビット解像度)" #: shared-bindings/pulseio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." -msgstr "PWM周波数は、生成時の variable_frequency が False の場合、書き換えられません。" +msgstr "" +"PWM周波数は、生成時の variable_frequency が False の場合、書き換えられませ" +"ん。" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c @@ -1418,6 +1438,16 @@ msgstr "SDカードのCSDフォーマットはサポートされていません" msgid "SDA or SCL needs a pull up" msgstr "SDAとSCLはプルアップが必要です" +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO GetCardInfo Error %d" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO Init Error %d" +msgstr "" + #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" msgstr "SPI初期化エラー" @@ -1503,7 +1533,9 @@ msgstr "" msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode.\n" -msgstr "`microcontroller` モジュールが使われてセーフモードで起動しました。セーフモードを抜けるにはリセットを押します。\n" +msgstr "" +"`microcontroller` モジュールが使われてセーフモードで起動しました。セーフモー" +"ドを抜けるにはリセットを押します。\n" #: supervisor/shared/safe_mode.c #, fuzzy @@ -1512,8 +1544,9 @@ msgid "" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" -"マイクロコントローラの電力が降下しました。電源が回路全体が求める十分な電力を供給できることを確認してリセットを押してください(CIRCUITPYを取り出し" -"た後)。\n" +"マイクロコントローラの電力が降下しました。電源が回路全体が求める十分な電力を" +"供給できることを確認してリセットを押してください(CIRCUITPYを取り出した" +"後)。\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1616,7 +1649,8 @@ msgstr "UUIDの整数値は0から0xffffの間でなければなりません" #: shared-bindings/_bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" -msgstr "UUID文字列が 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' の形式になっていません" +msgstr "" +"UUID文字列が 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' の形式になっていません" #: shared-bindings/_bleio/UUID.c msgid "UUID value is not str, int or byte buffer" @@ -1736,7 +1770,8 @@ msgstr "WatchDogTimerは現在動作していません" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" -msgstr "WatchDogTimer.mode は一度 WatchDogMode.RESET に設定されると変更できません" +msgstr "" +"WatchDogTimer.mode は一度 WatchDogMode.RESET に設定されると変更できません" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.timeout must be greater than 0" @@ -2436,7 +2471,8 @@ msgstr "インデクスは整数でなければなりません" #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" -msgstr "インデクスは、整数、スライス、boolのリストのいずれかでなければなりません" +msgstr "" +"インデクスは、整数、スライス、boolのリストのいずれかでなければなりません" #: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" @@ -2975,7 +3011,9 @@ msgstr "rsplit(None,n)" msgid "" "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " "'B'" -msgstr "sample_source バッファは、bytearray または 'h', 'H', 'b', 'B'型のarrayでなければなりません" +msgstr "" +"sample_source バッファは、bytearray または 'h', 'H', 'b', 'B'型のarrayでなけ" +"ればなりません" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -3344,3 +3382,12 @@ msgstr "zi はfloat型でなければなりません" #: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" msgstr "" + +#~ msgid "Invalid I2C pin selection" +#~ msgstr "I2Cピンの選択が不正です" + +#~ msgid "Invalid SPI pin selection" +#~ msgstr "SPIピンの選択が不正です" + +#~ msgid "Invalid UART pin selection" +#~ msgstr "UARTピンの選択が不正です" diff --git a/locale/ko.po b/locale/ko.po index 51a5237861..f47d0deeb8 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-28 16:57-0500\n" +"POT-Creation-Date: 2020-08-14 09:36-0400\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -66,13 +66,17 @@ msgstr "" msgid "%q in use" msgstr "%q 사용 중입니다" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c msgid "%q index out of range" msgstr "%q 인덱스 범위를 벗어났습니다" #: py/obj.c -msgid "%q indices must be integers, not %s" -msgstr "%q 인덱스는 %s 가 아닌 정수 여야합니다" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -110,6 +114,42 @@ msgstr "" msgid "'%q' argument required" msgstr "" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -160,48 +200,6 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "'%s' 을 지정할 수 없습니다" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "'%s' 은 삭제할 수 없습니다" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "'%s' 은 수정할 수 없습니다" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "'%s' 을 검색 할 수 없습니다" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "'%s' 은 변경할 수 없습니다" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "" @@ -451,6 +449,10 @@ msgstr "" msgid "Buffer length must be a multiple of 512" msgstr "" +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Buffer must be a multiple of 512 bytes" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "잘못된 크기의 버퍼. >1 여야합니다" @@ -641,6 +643,10 @@ msgstr "" msgid "Could not restart PWM" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Could not set address" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" msgstr "" @@ -823,6 +829,11 @@ msgstr "" msgid "File exists" msgstr "" +#: shared-module/framebufferio/FramebufferDisplay.c +#, c-format +msgid "Framebuffer requires %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -847,7 +858,7 @@ msgid "Group full" msgstr "" #: 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/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -863,6 +874,10 @@ msgstr "" msgid "I2C Init Error" msgstr "" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -908,6 +923,11 @@ msgstr "" msgid "Invalid %q pin" msgstr "" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +msgid "Invalid %q pin selection" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "" @@ -920,24 +940,12 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/stm/common-hal/busio/I2C.c -msgid "Invalid I2C pin selection" -msgstr "" - #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c msgid "Invalid PWM frequency" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "Invalid SPI pin selection" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid UART pin selection" -msgstr "" - #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "" @@ -1233,6 +1241,10 @@ msgstr "" msgid "Not playing" msgstr "" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1318,10 +1330,6 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1394,11 +1402,7 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" +msgid "Running in safe mode! " msgstr "" #: shared-module/sdcardio/SDCard.c @@ -1410,6 +1414,16 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "" +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO GetCardInfo Error %d" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO Init Error %d" +msgstr "" + #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" msgstr "" @@ -1760,8 +1774,7 @@ msgid "__init__() should return None" msgstr "" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" +msgid "__init__() should return None, not '%q'" msgstr "" #: py/objobject.c @@ -1915,7 +1928,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "" @@ -1947,47 +1960,16 @@ msgstr "" msgid "can't assign to expression" msgstr "" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "" - #: py/obj.c -msgid "can't convert to complex" -msgstr "" - -#: py/obj.c -msgid "can't convert to float" -msgstr "" - -#: py/obj.c -msgid "can't convert to int" +msgid "can't convert to %q" msgstr "" #: py/objstr.c @@ -2395,7 +2377,7 @@ msgstr "" msgid "function missing required positional argument #%d" msgstr "" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "" @@ -2444,10 +2426,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "" @@ -2803,8 +2782,7 @@ msgid "number of points must be at least 2" msgstr "" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" +msgid "object '%q' is not a tuple or list" msgstr "" #: py/obj.c @@ -2840,8 +2818,7 @@ msgid "object not iterable" msgstr "" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" +msgid "object of type '%q' has no len()" msgstr "" #: py/obj.c @@ -2934,20 +2911,9 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" msgstr "" #: py/objint_mpz.c @@ -3104,12 +3070,7 @@ msgid "stream operation not supported" msgstr "" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" +msgid "string indices must be integers, not %q" msgstr "" #: py/stream.c @@ -3120,10 +3081,6 @@ msgstr "" msgid "struct: cannot index" msgstr "" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "" @@ -3193,7 +3150,7 @@ msgstr "" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "" @@ -3260,8 +3217,7 @@ msgid "unknown conversion specifier %c" msgstr "" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" +msgid "unknown format code '%c' for object of type '%q'" msgstr "" #: py/compile.c @@ -3301,7 +3257,7 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "" #: py/runtime.c -msgid "unsupported type for %q: '%s'" +msgid "unsupported type for %q: '%q'" msgstr "" #: py/runtime.c @@ -3309,7 +3265,7 @@ msgid "unsupported type for operator" msgstr "" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" msgstr "" #: py/objint.c @@ -3389,6 +3345,24 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "%q 인덱스는 %s 가 아닌 정수 여야합니다" + +#~ msgid "'%s' object does not support item assignment" +#~ msgstr "'%s' 을 지정할 수 없습니다" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "'%s' 은 삭제할 수 없습니다" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "'%s' 은 수정할 수 없습니다" + +#~ msgid "'%s' object is not callable" +#~ msgstr "'%s' 을 검색 할 수 없습니다" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "'%s' 은 변경할 수 없습니다" + #~ msgid "Can't add services in Central mode" #~ msgstr "센트랄(중앙) 모드에서는 서비스를 추가 할 수 없습니다" diff --git a/locale/pl.po b/locale/pl.po index fdb3749187..55ecc38f55 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-28 16:57-0500\n" +"POT-Creation-Date: 2020-08-14 09:36-0400\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -66,13 +66,17 @@ msgstr "" msgid "%q in use" msgstr "%q w użyciu" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -110,6 +114,42 @@ msgstr "%q() bierze %d argumentów pozycyjnych, lecz podano %d" msgid "'%q' argument required" msgstr "'%q' wymaga argumentu" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -160,48 +200,6 @@ msgstr "'%s' liczba %d poza zakresem %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' liczba 0x%x nie pasuje do maski 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "'%s' obiekt nie wspiera przypisania do elementów" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "'%s' obiekt nie wspiera usuwania elementów" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "'%s' obiekt nie ma atrybutu '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "'%s' obiekt nie jest iteratorem" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "'%s' nie można wywoływać obiektu" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "'%s' nie można iterować po obiekcie" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "'%s' nie można indeksować obiektu" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "wyrównanie '=' niedozwolone w specyfikacji formatu" @@ -451,6 +449,10 @@ msgstr "" msgid "Buffer length must be a multiple of 512" msgstr "" +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Buffer must be a multiple of 512 bytes" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Bufor musi mieć długość 1 lub więcej" @@ -641,6 +643,10 @@ msgstr "" msgid "Could not restart PWM" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Could not set address" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" msgstr "" @@ -823,6 +829,11 @@ msgstr "" msgid "File exists" msgstr "Plik istnieje" +#: shared-module/framebufferio/FramebufferDisplay.c +#, c-format +msgid "Framebuffer requires %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "Uzyskana częstotliwość jest niemożliwa. Spauzowano." @@ -847,7 +858,7 @@ msgid "Group full" msgstr "Grupa pełna" #: 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/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -863,6 +874,10 @@ msgstr "Operacja I/O na zamkniętym pliku" msgid "I2C Init Error" msgstr "" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -910,6 +925,11 @@ msgstr "" msgid "Invalid %q pin" msgstr "Zła nóżka %q" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +msgid "Invalid %q pin selection" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "" @@ -922,24 +942,12 @@ msgstr "Zły BMP" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/stm/common-hal/busio/I2C.c -msgid "Invalid I2C pin selection" -msgstr "" - #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Zła częstotliwość PWM" -#: ports/stm/common-hal/busio/SPI.c -msgid "Invalid SPI pin selection" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid UART pin selection" -msgstr "" - #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Zły argument" @@ -1235,6 +1243,10 @@ msgstr "Nie podłączono" msgid "Not playing" msgstr "Nic nie jest odtwarzane" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1320,10 +1332,6 @@ msgstr "Oraz moduły w systemie plików\n" msgid "Polygon needs at least 3 points" msgstr "" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1396,12 +1404,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "Rzędy muszą być digitalio.DigitalInOut" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Uruchomiony tryb bezpieczeństwa! Samo-przeładowanie wyłączone.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Uruchomiony tryb bezpieczeństwa! Zapisany kod nie jest uruchamiany.\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1412,6 +1416,16 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "SDA lub SCL wymagają podciągnięcia" +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO GetCardInfo Error %d" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO Init Error %d" +msgstr "" + #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" msgstr "" @@ -1764,9 +1778,8 @@ msgid "__init__() should return None" msgstr "__init__() powinien zwracać None" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "__init__() powinien zwracać None, nie '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1919,7 +1932,7 @@ msgstr "bajty większe od 8 bitów są niewspierane" msgid "bytes value out of range" msgstr "wartość bytes poza zakresem" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "kalibracja poza zakresem" @@ -1951,48 +1964,17 @@ msgstr "nie można dodać specjalnej metody do podklasy" msgid "can't assign to expression" msgstr "przypisanie do wyrażenia" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "nie można skonwertować %s do complex" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "nie można skonwertować %s do float" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "nie można skonwertować %s do int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "nie można automatycznie skonwertować '%q' do '%q'" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "nie można skonwertować NaN do int" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "nie można skonwertować adresu do int" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "nie można skonwertować inf do int" - #: py/obj.c -msgid "can't convert to complex" -msgstr "nie można skonwertować do complex" - -#: py/obj.c -msgid "can't convert to float" -msgstr "nie można skonwertować do float" - -#: py/obj.c -msgid "can't convert to int" -msgstr "nie można skonwertować do int" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2400,7 +2382,7 @@ msgstr "brak wymaganego argumentu nazwanego '%q' funkcji" msgid "function missing required positional argument #%d" msgstr "brak wymaganego argumentu pozycyjnego #%d funkcji" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "funkcja wymaga %d argumentów pozycyjnych, ale jest %d" @@ -2449,10 +2431,7 @@ msgstr "złe wypełnienie" msgid "index is out of bounds" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "indeks poza zakresem" @@ -2808,9 +2787,8 @@ msgid "number of points must be at least 2" msgstr "" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "obiekt '%s' nie jest krotką ani listą" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2845,9 +2823,8 @@ msgid "object not iterable" msgstr "obiekt nie jest iterowalny" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "obiekt typu '%s' nie ma len()" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -2940,21 +2917,10 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "pop z pustego PulseIn" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "pop z pustego zbioru" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "pop z pustej listy" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "popitem(): słownik jest pusty" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3111,13 +3077,8 @@ msgid "stream operation not supported" msgstr "operacja na strumieniu nieobsługiwana" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "indeks łańcucha poza zakresem" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "indeksy łańcucha muszą być całkowite, nie %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3127,10 +3088,6 @@ msgstr "łańcuchy nieobsługiwane; użyj bytes lub bytearray" msgid "struct: cannot index" msgstr "struct: nie można indeksować" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: indeks poza zakresem" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct: brak pól" @@ -3200,7 +3157,7 @@ msgstr "zbyt wiele wartości do rozpakowania (oczekiwano %d)" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "indeks krotki poza zakresem" @@ -3267,9 +3224,8 @@ msgid "unknown conversion specifier %c" msgstr "zła specyfikacja konwersji %c" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "zły kod formatowania '%c' dla obiektu typu '%s'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3308,16 +3264,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "zły znak formatowania '%c' (0x%x) na pozycji %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "zły typ dla %q: '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "zły typ dla operatora" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "złe typy dla %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3396,6 +3352,103 @@ 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 "'%s' object does not support item assignment" +#~ msgstr "'%s' obiekt nie wspiera przypisania do elementów" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "'%s' obiekt nie wspiera usuwania elementów" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "'%s' obiekt nie ma atrybutu '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "'%s' obiekt nie jest iteratorem" + +#~ msgid "'%s' object is not callable" +#~ msgstr "'%s' nie można wywoływać obiektu" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "'%s' nie można iterować po obiekcie" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "'%s' nie można indeksować obiektu" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Uruchomiony tryb bezpieczeństwa! Samo-przeładowanie wyłączone.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "" +#~ "Uruchomiony tryb bezpieczeństwa! Zapisany kod nie jest uruchamiany.\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "__init__() powinien zwracać None, nie '%s'" + +#~ msgid "can't convert %s to complex" +#~ msgstr "nie można skonwertować %s do complex" + +#~ msgid "can't convert %s to float" +#~ msgstr "nie można skonwertować %s do float" + +#~ msgid "can't convert %s to int" +#~ msgstr "nie można skonwertować %s do int" + +#~ msgid "can't convert NaN to int" +#~ msgstr "nie można skonwertować NaN do int" + +#~ msgid "can't convert address to int" +#~ msgstr "nie można skonwertować adresu do int" + +#~ msgid "can't convert inf to int" +#~ msgstr "nie można skonwertować inf do int" + +#~ msgid "can't convert to complex" +#~ msgstr "nie można skonwertować do complex" + +#~ msgid "can't convert to float" +#~ msgstr "nie można skonwertować do float" + +#~ msgid "can't convert to int" +#~ msgstr "nie można skonwertować do int" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "obiekt '%s' nie jest krotką ani listą" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "obiekt typu '%s' nie ma len()" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "pop z pustego PulseIn" + +#~ msgid "pop from an empty set" +#~ msgstr "pop z pustego zbioru" + +#~ msgid "pop from empty list" +#~ msgstr "pop z pustej listy" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "popitem(): słownik jest pusty" + +#~ msgid "string index out of range" +#~ msgstr "indeks łańcucha poza zakresem" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "indeksy łańcucha muszą być całkowite, nie %s" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: indeks poza zakresem" + +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "zły kod formatowania '%c' dla obiektu typu '%s'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "zły typ dla %q: '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "złe typy dla %q: '%s', '%s'" + #~ msgid "Address is not %d bytes long or is in wrong format" #~ msgstr "Adres nie ma długości %d bajtów lub zły format" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 0196a2c0bb..a14db4fa82 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-28 16:57-0500\n" +"POT-Creation-Date: 2020-08-14 09:36-0400\n" "PO-Revision-Date: 2020-07-28 15:41+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -72,13 +72,17 @@ msgstr "%q falha: %d" msgid "%q in use" msgstr "%q em uso" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -116,6 +120,42 @@ msgstr "%q() recebe %d argumentos posicionais, porém %d foram informados" msgid "'%q' argument required" msgstr "'%q' argumento(s) requerido(s)" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -166,48 +206,6 @@ msgstr "O número inteiro '%s' %d não está dentro do intervalo %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "O número inteiro '%s' 0x%x não cabe na máscara 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "O objeto '%s' não pode definir o atributo '%q'" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "O objeto '%s' não é compatível com '%q'" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "O objeto '%s' não compatível com a atribuição dos itens" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "O objeto '%s' não é compatível com exclusão do item" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "O objeto '%s' não possui o atributo '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "O objeto '%s' não é um iterador" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "O objeto '%s' não é invocável" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "O objeto '%s' não é iterável" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "O objeto '%s' não é subroteirizável" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "" @@ -465,6 +463,10 @@ msgstr "O tamanho do buffer %d é muito grande. Deve ser menor que %d" msgid "Buffer length must be a multiple of 512" msgstr "O comprimento do Buffer deve ser um múltiplo de 512" +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Buffer must be a multiple of 512 bytes" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "O comprimento do buffer deve ter pelo menos 1" @@ -662,6 +664,10 @@ msgstr "Não foi possível reiniciar o temporizador" msgid "Could not restart PWM" msgstr "Não foi possível reiniciar o PWM" +#: shared-bindings/_bleio/Adapter.c +msgid "Could not set address" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" msgstr "Não foi possível iniciar o PWM" @@ -844,6 +850,11 @@ msgstr "Falha ao gravar o flash interno." msgid "File exists" msgstr "Arquivo já existe" +#: shared-module/framebufferio/FramebufferDisplay.c +#, c-format +msgid "Framebuffer requires %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -870,7 +881,7 @@ msgid "Group full" msgstr "Grupo cheio" #: 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/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "O hardware está ocupado, tente os pinos alternativos" @@ -886,6 +897,10 @@ msgstr "Operação I/O no arquivo fechado" msgid "I2C Init Error" msgstr "Erro de inicialização do I2C" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -933,6 +948,11 @@ msgstr "%q Inválido" msgid "Invalid %q pin" msgstr "Pino do %q inválido" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +msgid "Invalid %q pin selection" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Valor inválido da unidade ADC" @@ -945,24 +965,12 @@ msgstr "Arquivo BMP inválido" msgid "Invalid DAC pin supplied" msgstr "O pino DAC informado é inválido" -#: ports/stm/common-hal/busio/I2C.c -msgid "Invalid I2C pin selection" -msgstr "A seleção dos pinos I2C é inválido" - #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Frequência PWM inválida" -#: ports/stm/common-hal/busio/SPI.c -msgid "Invalid SPI pin selection" -msgstr "A seleção do pino SPI é inválido" - -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid UART pin selection" -msgstr "A seleção dos pinos UART é inválido" - #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Argumento inválido" @@ -1258,6 +1266,10 @@ msgstr "Não Conectado" msgid "Not playing" msgstr "Não está jogando" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1355,10 +1367,6 @@ msgstr "Além de quaisquer módulos no sistema de arquivos\n" msgid "Polygon needs at least 3 points" msgstr "O Polígono precisa de pelo menos 3 pontos" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "Buffer Ps2 vazio" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1434,12 +1442,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "A entrada da linha deve ser digitalio.DigitalInOut" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Rodando em modo seguro! Atualização automática está desligada.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Rodando em modo seguro! Não está executando o código salvo.\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1450,6 +1454,16 @@ msgstr "O formato CSD do Cartão SD não é compatível" msgid "SDA or SCL needs a pull up" msgstr "SDA ou SCL precisa de um pull up" +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO GetCardInfo Error %d" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO Init Error %d" +msgstr "" + #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" msgstr "Houve um erro na inicialização SPI" @@ -1825,9 +1839,8 @@ msgid "__init__() should return None" msgstr "O __init__() deve retornar Nenhum" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "O __init__() deve retornar Nenhum, não '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1980,7 +1993,7 @@ msgstr "bytes > 8 bits não suportado" msgid "bytes value out of range" msgstr "o valor dos bytes estão fora do alcance" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "Calibração está fora do intervalo" @@ -2012,48 +2025,17 @@ msgstr "não é possível adicionar o método especial à classe já subclassifi msgid "can't assign to expression" msgstr "a expressão não pode ser atribuída" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "Não é possível converter %s para complex" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "Não é possível converter %s para float" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "Não é possível converter %s para int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "não é possível converter implicitamente o objeto '%q' para %q" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "Não é possível converter NaN para int" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "não é possível converter o endereço para int" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "não é possível converter inf para int" - #: py/obj.c -msgid "can't convert to complex" -msgstr "não é possível converter para complex" - -#: py/obj.c -msgid "can't convert to float" -msgstr "não é possível converter para float" - -#: py/obj.c -msgid "can't convert to int" -msgstr "não é possível converter para int" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2470,7 +2452,7 @@ msgstr "falta apenas a palavra chave do argumento '%q' da função" msgid "function missing required positional argument #%d" msgstr "falta o argumento #%d da posição necessária da função" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "função leva %d argumentos posicionais, mas apenas %d foram passadas" @@ -2519,10 +2501,7 @@ msgstr "preenchimento incorreto" msgid "index is out of bounds" msgstr "o índice está fora dos limites" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "Índice fora do intervalo" @@ -2883,9 +2862,8 @@ msgid "number of points must be at least 2" msgstr "a quantidade dos pontos deve ser pelo menos 2" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "o objeto '%s' não é uma tupla ou uma lista" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2920,9 +2898,8 @@ msgid "object not iterable" msgstr "objeto não iterável" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "O objeto do tipo '%s' não possui len()" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -3019,21 +2996,10 @@ msgstr "o polígono só pode ser registrado em um pai" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "pop a partir de um PulseIn vazio" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "pop a partir de um conjunto vazio" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "pop a partir da lista vazia" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "popitem(): o dicionário está vazio" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3191,13 +3157,8 @@ msgid "stream operation not supported" msgstr "a operação do fluxo não é compatível" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "o índice da string está fora do intervalo" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "o índices das string devem ser números inteiros, não %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3207,10 +3168,6 @@ msgstr "a string não é compatível; use bytes ou bytearray" msgid "struct: cannot index" msgstr "struct: não pode indexar" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: índice fora do intervalo" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct: sem campos" @@ -3280,7 +3237,7 @@ msgstr "valores demais para descompactar (esperado %d)" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "o índice da tupla está fora do intervalo" @@ -3347,9 +3304,8 @@ msgid "unknown conversion specifier %c" msgstr "especificador de conversão desconhecido %c" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "código de formato desconhecido '%c' para o objeto do tipo '%s'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3388,16 +3344,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "o caractere do formato não é compatível '%c' (0x%x) no índice %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "tipo não compatível para %q: '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "tipo não compatível para o operador" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "tipos não compatíveis para %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3476,6 +3432,120 @@ 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 "'%s' object cannot assign attribute '%q'" +#~ msgstr "O objeto '%s' não pode definir o atributo '%q'" + +#~ msgid "'%s' object does not support '%q'" +#~ msgstr "O objeto '%s' não é compatível com '%q'" + +#~ msgid "'%s' object does not support item assignment" +#~ msgstr "O objeto '%s' não compatível com a atribuição dos itens" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "O objeto '%s' não é compatível com exclusão do item" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "O objeto '%s' não possui o atributo '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "O objeto '%s' não é um iterador" + +#~ msgid "'%s' object is not callable" +#~ msgstr "O objeto '%s' não é invocável" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "O objeto '%s' não é iterável" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "O objeto '%s' não é subroteirizável" + +#~ msgid "Invalid I2C pin selection" +#~ msgstr "A seleção dos pinos I2C é inválido" + +#~ msgid "Invalid SPI pin selection" +#~ msgstr "A seleção do pino SPI é inválido" + +#~ msgid "Invalid UART pin selection" +#~ msgstr "A seleção dos pinos UART é inválido" + +#~ msgid "Pop from an empty Ps2 buffer" +#~ msgstr "Buffer Ps2 vazio" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Rodando em modo seguro! Atualização automática está desligada.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "Rodando em modo seguro! Não está executando o código salvo.\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "O __init__() deve retornar Nenhum, não '%s'" + +#~ msgid "can't convert %s to complex" +#~ msgstr "Não é possível converter %s para complex" + +#~ msgid "can't convert %s to float" +#~ msgstr "Não é possível converter %s para float" + +#~ msgid "can't convert %s to int" +#~ msgstr "Não é possível converter %s para int" + +#~ msgid "can't convert NaN to int" +#~ msgstr "Não é possível converter NaN para int" + +#~ msgid "can't convert address to int" +#~ msgstr "não é possível converter o endereço para int" + +#~ msgid "can't convert inf to int" +#~ msgstr "não é possível converter inf para int" + +#~ msgid "can't convert to complex" +#~ msgstr "não é possível converter para complex" + +#~ msgid "can't convert to float" +#~ msgstr "não é possível converter para float" + +#~ msgid "can't convert to int" +#~ msgstr "não é possível converter para int" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "o objeto '%s' não é uma tupla ou uma lista" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "O objeto do tipo '%s' não possui len()" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "pop a partir de um PulseIn vazio" + +#~ msgid "pop from an empty set" +#~ msgstr "pop a partir de um conjunto vazio" + +#~ msgid "pop from empty list" +#~ msgstr "pop a partir da lista vazia" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "popitem(): o dicionário está vazio" + +#~ msgid "string index out of range" +#~ msgstr "o índice da string está fora do intervalo" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "o índices das string devem ser números inteiros, não %s" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: índice fora do intervalo" + +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "código de formato desconhecido '%c' para o objeto do tipo '%s'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "tipo não compatível para %q: '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "tipos não compatíveis para %q: '%s', '%s'" + #~ msgid "'%q' object is not bytes-like" #~ msgstr "objetos '%q' não são bytes-like" diff --git a/locale/sv.po b/locale/sv.po index 43d6805395..bf45f6828f 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-28 16:57-0500\n" +"POT-Creation-Date: 2020-08-14 09:36-0400\n" "PO-Revision-Date: 2020-07-25 20:58+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -72,13 +72,17 @@ msgstr "%q-fel: %d" msgid "%q in use" msgstr "%q används redan" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -116,6 +120,42 @@ msgstr "%q() kräver %d positionsargument men %d gavs" msgid "'%q' argument required" msgstr "'%q' argument krävs" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -166,48 +206,6 @@ msgstr "'%s' heltal %d ligger inte inom intervallet %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' heltal 0x%x ryms inte i mask 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "Objektet '%s' kan inte tilldela attributet '%q'" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "Objektet '%s' har inte stöd för '%q'" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "Objektet '%s' stöder inte tilldelningen" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "Objektet '%s' stöder inte borttagning av objekt" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "Objektet '%s' har inget attribut '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "Objektet '%s' är inte en iterator" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "Objektet '%s' kan inte anropas" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "Objektet '%s' är inte itererable" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "Objektet '%s' är inte indexbar" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "'='-justering tillåts inte i strängformatspecifikation" @@ -457,6 +455,10 @@ msgstr "Buffertlängd %d för stor. Den måste vara mindre än %d" msgid "Buffer length must be a multiple of 512" msgstr "Buffertlängd måste vara en multipel av 512" +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Buffer must be a multiple of 512 bytes" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Bufferten måste ha minst längd 1" @@ -653,6 +655,10 @@ msgstr "Det gick inte att återinitiera timern" msgid "Could not restart PWM" msgstr "Det gick inte att starta om PWM" +#: shared-bindings/_bleio/Adapter.c +msgid "Could not set address" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" msgstr "Det gick inte att starta PWM" @@ -835,6 +841,11 @@ msgstr "Det gick inte att skriva till intern flash." msgid "File exists" msgstr "Filen finns redan" +#: shared-module/framebufferio/FramebufferDisplay.c +#, c-format +msgid "Framebuffer requires %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "Infångningsfrekvens är för hög. Infångning pausad." @@ -859,7 +870,7 @@ msgid "Group full" msgstr "Gruppen är full" #: 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/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "Hårdvaran är upptagen, prova alternativa pinnar" @@ -875,6 +886,10 @@ msgstr "I/O-operation på stängd fil" msgid "I2C Init Error" msgstr "I2C init-fel" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -922,6 +937,11 @@ msgstr "Ogiltig %q" msgid "Invalid %q pin" msgstr "Ogiltig %q-pinne" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +msgid "Invalid %q pin selection" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Ogiltigt ADC-enhetsvärde" @@ -934,24 +954,12 @@ msgstr "Ogiltig BMP-fil" msgid "Invalid DAC pin supplied" msgstr "Ogiltig DAC-pinne angiven" -#: ports/stm/common-hal/busio/I2C.c -msgid "Invalid I2C pin selection" -msgstr "Ogiltigt val av I2C-pinne" - #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Ogiltig PWM-frekvens" -#: ports/stm/common-hal/busio/SPI.c -msgid "Invalid SPI pin selection" -msgstr "Ogiltigt val av SPI-pinne" - -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid UART pin selection" -msgstr "Ogiltigt val av UART-pinne" - #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Ogiltigt argument" @@ -1248,6 +1256,10 @@ msgstr "Inte ansluten" msgid "Not playing" msgstr "Ingen uppspelning" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1343,10 +1355,6 @@ msgstr "Plus eventuella moduler i filsystemet\n" msgid "Polygon needs at least 3 points" msgstr "Polygonen behöver minst 3 punkter" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "Pop från en tom Ps2-buffert" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Prefixbufferten måste finnas på heap" @@ -1420,12 +1428,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "Radvärdet måste vara digitalio.DigitalInOut" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Kör i säkert läge! Autoladdning är avstängd.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Kör i säkert läge! Sparad kod körs inte.\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1436,6 +1440,16 @@ msgstr "SD-kort CSD-format stöds inte" msgid "SDA or SCL needs a pull up" msgstr "SDA eller SCL behöver en pullup" +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO GetCardInfo Error %d" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO Init Error %d" +msgstr "" + #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" msgstr "SPI Init-fel" @@ -1803,9 +1817,8 @@ msgid "__init__() should return None" msgstr "__init __ () ska returnera None" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "__init __ () ska returnera None, inte '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1958,7 +1971,7 @@ msgstr "bytes> 8 bitar stöds inte" msgid "bytes value out of range" msgstr "bytevärde utanför intervallet" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "kalibrering är utanför intervallet" @@ -1990,48 +2003,17 @@ msgstr "kan inte lägga till särskild metod för redan subklassad klass" msgid "can't assign to expression" msgstr "kan inte tilldela uttryck" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "kan inte konvertera %s till komplex" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "kan inte konvertera %s till float" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "kan inte konvertera %s till int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "kan inte konvertera '%q' objekt implicit till %q" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "kan inte konvertera NaN till int" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "kan inte konvertera address till int" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "kan inte konvertera inf till int" - #: py/obj.c -msgid "can't convert to complex" -msgstr "kan inte konvertera till komplex" - -#: py/obj.c -msgid "can't convert to float" -msgstr "kan inte konvertera till float" - -#: py/obj.c -msgid "can't convert to int" -msgstr "kan inte konvertera till int" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2443,7 +2425,7 @@ msgstr "funktionen saknar det obligatoriska nyckelordsargumentet '%q'" msgid "function missing required positional argument #%d" msgstr "funktionen saknar det obligatoriska positionsargumentet #%d" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "funktionen kräver %d positionsargument men %d angavs" @@ -2492,10 +2474,7 @@ msgstr "felaktig utfyllnad" msgid "index is out of bounds" msgstr "index är utanför gränserna" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "index utanför intervallet" @@ -2854,9 +2833,8 @@ msgid "number of points must be at least 2" msgstr "antal punkter måste vara minst 2" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "objektet '%s' är inte en tupel eller lista" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2891,9 +2869,8 @@ msgid "object not iterable" msgstr "objektet är inte iterable" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "objekt av typen '%s' har ingen len()" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -2986,21 +2963,10 @@ msgstr "polygon kan endast registreras i en förälder" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "pop från en tom PulseIn" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "pop från en tom uppsättning" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "pop från tom lista" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "popitem(): ordlistan är tom" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3158,13 +3124,8 @@ msgid "stream operation not supported" msgstr "stream-åtgärd stöds inte" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "strängindex utanför intervallet" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "strängindex måste vara heltal, inte %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3174,10 +3135,6 @@ msgstr "sträng stöds inte; använd bytes eller bytearray" msgid "struct: cannot index" msgstr "struct: kan inte indexera" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: index utanför intervallet" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "struct: inga fält" @@ -3247,7 +3204,7 @@ msgstr "för många värden att packa upp (förväntat %d)" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "tupelindex utanför intervallet" @@ -3314,9 +3271,8 @@ msgid "unknown conversion specifier %c" msgstr "okänd konverteringsspecificerare %c" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "okänt format '%c' för objekt av typ '%s'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3355,16 +3311,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "Formattecknet '%c' (0x%x) stöds inte vid index %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "typ som inte stöds för %q: '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "typ stöds inte för operatören" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "typ som inte stöds för %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3443,6 +3399,120 @@ 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 "'%s' object cannot assign attribute '%q'" +#~ msgstr "Objektet '%s' kan inte tilldela attributet '%q'" + +#~ msgid "'%s' object does not support '%q'" +#~ msgstr "Objektet '%s' har inte stöd för '%q'" + +#~ msgid "'%s' object does not support item assignment" +#~ msgstr "Objektet '%s' stöder inte tilldelningen" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "Objektet '%s' stöder inte borttagning av objekt" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "Objektet '%s' har inget attribut '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "Objektet '%s' är inte en iterator" + +#~ msgid "'%s' object is not callable" +#~ msgstr "Objektet '%s' kan inte anropas" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "Objektet '%s' är inte itererable" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "Objektet '%s' är inte indexbar" + +#~ msgid "Invalid I2C pin selection" +#~ msgstr "Ogiltigt val av I2C-pinne" + +#~ msgid "Invalid SPI pin selection" +#~ msgstr "Ogiltigt val av SPI-pinne" + +#~ msgid "Invalid UART pin selection" +#~ msgstr "Ogiltigt val av UART-pinne" + +#~ msgid "Pop from an empty Ps2 buffer" +#~ msgstr "Pop från en tom Ps2-buffert" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Kör i säkert läge! Autoladdning är avstängd.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "Kör i säkert läge! Sparad kod körs inte.\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "__init __ () ska returnera None, inte '%s'" + +#~ msgid "can't convert %s to complex" +#~ msgstr "kan inte konvertera %s till komplex" + +#~ msgid "can't convert %s to float" +#~ msgstr "kan inte konvertera %s till float" + +#~ msgid "can't convert %s to int" +#~ msgstr "kan inte konvertera %s till int" + +#~ msgid "can't convert NaN to int" +#~ msgstr "kan inte konvertera NaN till int" + +#~ msgid "can't convert address to int" +#~ msgstr "kan inte konvertera address till int" + +#~ msgid "can't convert inf to int" +#~ msgstr "kan inte konvertera inf till int" + +#~ msgid "can't convert to complex" +#~ msgstr "kan inte konvertera till komplex" + +#~ msgid "can't convert to float" +#~ msgstr "kan inte konvertera till float" + +#~ msgid "can't convert to int" +#~ msgstr "kan inte konvertera till int" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "objektet '%s' är inte en tupel eller lista" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "objekt av typen '%s' har ingen len()" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "pop från en tom PulseIn" + +#~ msgid "pop from an empty set" +#~ msgstr "pop från en tom uppsättning" + +#~ msgid "pop from empty list" +#~ msgstr "pop från tom lista" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "popitem(): ordlistan är tom" + +#~ msgid "string index out of range" +#~ msgstr "strängindex utanför intervallet" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "strängindex måste vara heltal, inte %s" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: index utanför intervallet" + +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "okänt format '%c' för objekt av typ '%s'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "typ som inte stöds för %q: '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "typ som inte stöds för %q: '%s', '%s'" + #~ msgid "'%q' object is not bytes-like" #~ msgstr "%q-objektet är inte byte-lik" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 32928976d0..9aeb68cda8 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-28 16:57-0500\n" +"POT-Creation-Date: 2020-08-14 09:36-0400\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -72,13 +72,17 @@ msgstr "" msgid "%q in use" msgstr "%q zhèngzài shǐyòng" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c 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" +msgid "%q indices must be integers, not %q" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -116,6 +120,42 @@ msgstr "%q() cǎiyòng %d wèizhì cānshù, dàn gěi chū %d" msgid "'%q' argument required" msgstr "xūyào '%q' cānshù" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -166,48 +206,6 @@ msgstr "'%s' zhěngshù %d bùzài fànwéi nèi %d.%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' zhěngshù 0x%x bù shìyòng yú yǎn mǎ 0x%x" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "'%s' duì xiàng bù zhīchí '%q'" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "'%s' duìxiàng bù zhīchí xiàngmù fēnpèi" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "'%s' duìxiàng bù zhīchí shānchú xiàngmù" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "'%s' duìxiàng méiyǒu shǔxìng '%q'" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "'%s' duìxiàng bùshì yīgè diédài qì" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "'%s' duìxiàng wúfǎ diàoyòng" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "'%s' duìxiàng bùnéng diédài" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "'%s' duìxiàng bùnéng fēnshù" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "zìfú chuàn géshì shuōmíng fú zhōng bù yǔnxǔ '=' duìqí" @@ -457,6 +455,10 @@ msgstr "Huǎnchōng qū chángdù%d tài dà. Tā bìxū xiǎoyú%d" msgid "Buffer length must be a multiple of 512" msgstr "" +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Buffer must be a multiple of 512 bytes" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Huǎnchōng qū bìxū zhìshǎo chángdù 1" @@ -649,6 +651,10 @@ msgstr "Wúfǎ chóngxīn qǐdòng jìshí qì" msgid "Could not restart PWM" msgstr "Wúfǎ chóngqǐ PWM" +#: shared-bindings/_bleio/Adapter.c +msgid "Could not set address" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" msgstr "Wúfǎ qǐdòng PWM" @@ -831,6 +837,11 @@ msgstr "Wúfǎ xiě rù nèibù shǎncún." msgid "File exists" msgstr "Wénjiàn cúnzài" +#: shared-module/framebufferio/FramebufferDisplay.c +#, c-format +msgid "Framebuffer requires %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "Pínlǜ bǔhuò gāo yú nénglì. Bǔhuò zàntíng." @@ -855,7 +866,7 @@ msgid "Group full" msgstr "Fēnzǔ yǐ mǎn" #: 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/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "Yìngjiàn máng, qǐng chángshì qítā zhēnjiǎo" @@ -871,6 +882,10 @@ msgstr "Wénjiàn shàng de I/ O cāozuò" msgid "I2C Init Error" msgstr "I2C chūshǐhuà cuòwù" +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -918,6 +933,11 @@ msgstr "" msgid "Invalid %q pin" msgstr "Wúxiào de %q yǐn jiǎo" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +msgid "Invalid %q pin selection" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Wúxiào de ADC dānwèi zhí" @@ -930,24 +950,12 @@ msgstr "Wúxiào de BMP wénjiàn" msgid "Invalid DAC pin supplied" msgstr "Tí gōng liǎo wúxiào de DAC yǐn jiǎo" -#: ports/stm/common-hal/busio/I2C.c -msgid "Invalid I2C pin selection" -msgstr "Wúxiào de I2C yǐn jiǎo xuǎnzé" - #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Wúxiào de PWM pínlǜ" -#: ports/stm/common-hal/busio/SPI.c -msgid "Invalid SPI pin selection" -msgstr "Wúxiào de SPI yǐn jiǎo xuǎnzé" - -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid UART pin selection" -msgstr "Wúxiào de UART yǐn jiǎo xuǎnzé" - #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Wúxiào de cānshù" @@ -1243,6 +1251,10 @@ msgstr "Wèi liánjiē" msgid "Not playing" msgstr "Wèi bòfàng" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1334,10 +1346,6 @@ msgstr "Zài wénjiàn xìtǒng shàng tiānjiā rènhé mókuài\n" msgid "Polygon needs at least 3 points" msgstr "" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" -msgstr "Cóng kōng de Ps2 huǎnchōng qū dànchū" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Qiánzhuì huǎnchōng qū bìxū zài duī shàng" @@ -1410,12 +1418,8 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "Xíng xiàng bìxū shì digitalio.DigitalInOut" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Zài ānquán móshì xià yùnxíng! Zìdòng chóngxīn jiāzài yǐ guānbì.\n" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" -msgstr "Zài ānquán móshì xià yùnxíng! Bù yùnxíng yǐ bǎocún de dàimǎ.\n" +msgid "Running in safe mode! " +msgstr "" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1426,6 +1430,16 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "SDA huò SCL xūyào lādòng" +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO GetCardInfo Error %d" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO Init Error %d" +msgstr "" + #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" msgstr "SPI chūshǐhuà cuòwù" @@ -1789,9 +1803,8 @@ msgid "__init__() should return None" msgstr "__init__() fǎnhuí not" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" -msgstr "__Init__() yīnggāi fǎnhuí not, ér bùshì '%s'" +msgid "__init__() should return None, not '%q'" +msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1944,7 +1957,7 @@ msgstr "zì jié > 8 wèi" msgid "bytes value out of range" msgstr "zì jié zhí chāochū fànwéi" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "jiàozhǔn fànwéi chāochū fànwéi" @@ -1976,48 +1989,17 @@ msgstr "wúfǎ tiānjiā tèshū fāngfǎ dào zi fēnlèi lèi" msgid "can't assign to expression" msgstr "bùnéng fēnpèi dào biǎodá shì" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "wúfǎ zhuǎnhuàn%s dào fùzá" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "wúfǎ zhuǎnhuàn %s dào fú diǎn xíng biànliàng" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" -msgstr "wúfǎ zhuǎnhuàn%s dào int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "can't convert %q to %q" +msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "wúfǎ jiāng '%q' duìxiàng zhuǎnhuàn wèi %q yǐn hán" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "wúfǎ jiāng dǎoháng zhuǎnhuàn wèi int" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "wúfǎ jiāng dìzhǐ zhuǎnhuàn wèi int" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "bùnéng jiāng inf zhuǎnhuàn wèi int" - #: py/obj.c -msgid "can't convert to complex" -msgstr "bùnéng zhuǎnhuàn wèi fùzá" - -#: py/obj.c -msgid "can't convert to float" -msgstr "bùnéng zhuǎnhuàn wèi fú diǎn" - -#: py/obj.c -msgid "can't convert to int" -msgstr "bùnéng zhuǎnhuàn wèi int" +msgid "can't convert to %q" +msgstr "" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2428,7 +2410,7 @@ msgstr "hánshù quēshǎo suǒ xū guānjiàn zì cānshù '%q'" msgid "function missing required positional argument #%d" msgstr "hánshù quēshǎo suǒ xū de wèizhì cānshù #%d" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "hánshù xūyào %d gè wèizhì cānshù, dàn %d bèi gěi chū" @@ -2477,10 +2459,7 @@ msgstr "bù zhèngquè de tiánchōng" msgid "index is out of bounds" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "suǒyǐn chāochū fànwéi" @@ -2838,9 +2817,8 @@ msgid "number of points must be at least 2" msgstr "" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" -msgstr "duìxiàng '%s' bùshì yuán zǔ huò lièbiǎo" +msgid "object '%q' is not a tuple or list" +msgstr "" #: py/obj.c msgid "object does not support item assignment" @@ -2875,9 +2853,8 @@ msgid "object not iterable" msgstr "duìxiàng bùnéng diédài" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" -msgstr "lèixíng '%s' de duìxiàng méiyǒu chángdù" +msgid "object of type '%q' has no len()" +msgstr "" #: py/obj.c msgid "object with buffer protocol required" @@ -2969,21 +2946,10 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "cóng kōng de PulseIn dànchū dànchū" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "cóng kōng jí dànchū" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "cóng kōng lièbiǎo zhòng dànchū" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" -msgstr "dànchū xiàngmù (): Zìdiǎn wèi kōng" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3141,13 +3107,8 @@ msgid "stream operation not supported" msgstr "bù zhīchí liú cāozuò" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "zìfú chuàn suǒyǐn chāochū fànwéi" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" -msgstr "zìfú chuàn zhǐshù bìxū shì zhěngshù, ér bùshì %s" +msgid "string indices must be integers, not %q" +msgstr "" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3157,10 +3118,6 @@ msgstr "zìfú chuàn bù zhīchí; shǐyòng zì jié huò zì jié zǔ" msgid "struct: cannot index" msgstr "jiégòu: bùnéng suǒyǐn" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "jiégòu: suǒyǐn chāochū fànwéi" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "jiégòu: méiyǒu zìduàn" @@ -3230,7 +3187,7 @@ msgstr "dǎkāi tài duō zhí (yùqí %d)" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "yuán zǔ suǒyǐn chāochū fànwéi" @@ -3297,9 +3254,8 @@ msgid "unknown conversion specifier %c" msgstr "wèizhī de zhuǎnhuàn biāozhù %c" #: py/objstr.c -#, fuzzy, c-format -msgid "unknown format code '%c' for object of type '%s'" -msgstr "lèixíng '%s' duìxiàng wèizhī de géshì dàimǎ '%c'" +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" #: py/compile.c msgid "unknown type" @@ -3338,16 +3294,16 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "bù zhīchí de géshì zìfú '%c' (0x%x) suǒyǐn %d" #: py/runtime.c -msgid "unsupported type for %q: '%s'" -msgstr "bù zhīchí de lèixíng %q: '%s'" +msgid "unsupported type for %q: '%q'" +msgstr "" #: py/runtime.c msgid "unsupported type for operator" msgstr "bù zhīchí de cāozuò zhě lèixíng" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" -msgstr "bù zhīchí de lèixíng wèi %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" #: py/objint.c #, c-format @@ -3426,6 +3382,118 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q indices must be integers, not %s" +#~ msgstr "%q suǒyǐn bìxū shì zhěngshù, ér bùshì %s" + +#~ msgid "'%s' object does not support '%q'" +#~ msgstr "'%s' duì xiàng bù zhīchí '%q'" + +#~ msgid "'%s' object does not support item assignment" +#~ msgstr "'%s' duìxiàng bù zhīchí xiàngmù fēnpèi" + +#~ msgid "'%s' object does not support item deletion" +#~ msgstr "'%s' duìxiàng bù zhīchí shānchú xiàngmù" + +#~ msgid "'%s' object has no attribute '%q'" +#~ msgstr "'%s' duìxiàng méiyǒu shǔxìng '%q'" + +#~ msgid "'%s' object is not an iterator" +#~ msgstr "'%s' duìxiàng bùshì yīgè diédài qì" + +#~ msgid "'%s' object is not callable" +#~ msgstr "'%s' duìxiàng wúfǎ diàoyòng" + +#~ msgid "'%s' object is not iterable" +#~ msgstr "'%s' duìxiàng bùnéng diédài" + +#~ msgid "'%s' object is not subscriptable" +#~ msgstr "'%s' duìxiàng bùnéng fēnshù" + +#~ msgid "Invalid I2C pin selection" +#~ msgstr "Wúxiào de I2C yǐn jiǎo xuǎnzé" + +#~ msgid "Invalid SPI pin selection" +#~ msgstr "Wúxiào de SPI yǐn jiǎo xuǎnzé" + +#~ msgid "Invalid UART pin selection" +#~ msgstr "Wúxiào de UART yǐn jiǎo xuǎnzé" + +#~ msgid "Pop from an empty Ps2 buffer" +#~ msgstr "Cóng kōng de Ps2 huǎnchōng qū dànchū" + +#~ msgid "Running in safe mode! Auto-reload is off.\n" +#~ msgstr "Zài ānquán móshì xià yùnxíng! Zìdòng chóngxīn jiāzài yǐ guānbì.\n" + +#~ msgid "Running in safe mode! Not running saved code.\n" +#~ msgstr "Zài ānquán móshì xià yùnxíng! Bù yùnxíng yǐ bǎocún de dàimǎ.\n" + +#~ msgid "__init__() should return None, not '%s'" +#~ msgstr "__Init__() yīnggāi fǎnhuí not, ér bùshì '%s'" + +#~ msgid "can't convert %s to complex" +#~ msgstr "wúfǎ zhuǎnhuàn%s dào fùzá" + +#~ msgid "can't convert %s to float" +#~ msgstr "wúfǎ zhuǎnhuàn %s dào fú diǎn xíng biànliàng" + +#~ msgid "can't convert %s to int" +#~ msgstr "wúfǎ zhuǎnhuàn%s dào int" + +#~ msgid "can't convert NaN to int" +#~ msgstr "wúfǎ jiāng dǎoháng zhuǎnhuàn wèi int" + +#~ msgid "can't convert address to int" +#~ msgstr "wúfǎ jiāng dìzhǐ zhuǎnhuàn wèi int" + +#~ msgid "can't convert inf to int" +#~ msgstr "bùnéng jiāng inf zhuǎnhuàn wèi int" + +#~ msgid "can't convert to complex" +#~ msgstr "bùnéng zhuǎnhuàn wèi fùzá" + +#~ msgid "can't convert to float" +#~ msgstr "bùnéng zhuǎnhuàn wèi fú diǎn" + +#~ msgid "can't convert to int" +#~ msgstr "bùnéng zhuǎnhuàn wèi int" + +#~ msgid "object '%s' is not a tuple or list" +#~ msgstr "duìxiàng '%s' bùshì yuán zǔ huò lièbiǎo" + +#~ msgid "object of type '%s' has no len()" +#~ msgstr "lèixíng '%s' de duìxiàng méiyǒu chángdù" + +#~ msgid "pop from an empty PulseIn" +#~ msgstr "cóng kōng de PulseIn dànchū dànchū" + +#~ msgid "pop from an empty set" +#~ msgstr "cóng kōng jí dànchū" + +#~ msgid "pop from empty list" +#~ msgstr "cóng kōng lièbiǎo zhòng dànchū" + +#~ msgid "popitem(): dictionary is empty" +#~ msgstr "dànchū xiàngmù (): Zìdiǎn wèi kōng" + +#~ msgid "string index out of range" +#~ msgstr "zìfú chuàn suǒyǐn chāochū fànwéi" + +#~ msgid "string indices must be integers, not %s" +#~ msgstr "zìfú chuàn zhǐshù bìxū shì zhěngshù, ér bùshì %s" + +#~ msgid "struct: index out of range" +#~ msgstr "jiégòu: suǒyǐn chāochū fànwéi" + +#, fuzzy +#~ msgid "unknown format code '%c' for object of type '%s'" +#~ msgstr "lèixíng '%s' duìxiàng wèizhī de géshì dàimǎ '%c'" + +#~ msgid "unsupported type for %q: '%s'" +#~ msgstr "bù zhīchí de lèixíng %q: '%s'" + +#~ msgid "unsupported types for %q: '%s', '%s'" +#~ msgstr "bù zhīchí de lèixíng wèi %q: '%s', '%s'" + #~ msgid "Address is not %d bytes long or is in wrong format" #~ msgstr "Dìzhǐ bùshì %d zì jié zhǎng, huòzhě géshì cuòwù" From ffffccf7a07293870c91ba1bec91c2a99938b5e5 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 15 Aug 2020 14:29:09 -0500 Subject: [PATCH 0608/1293] docs/rstjinja.py: add jinja processing for building latex (pdf) docs --- docs/rstjinja.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/docs/rstjinja.py b/docs/rstjinja.py index 3a08b25997..7ab92a9793 100644 --- a/docs/rstjinja.py +++ b/docs/rstjinja.py @@ -6,18 +6,28 @@ def rstjinja(app, docname, source): Render our pages as a jinja template for fancy templating goodness. """ # Make sure we're outputting HTML - if app.builder.format != 'html': + if app.builder.format not in ("html", "latex"): return # we only want our one jinja template to run through this func if "shared-bindings/support_matrix" not in docname: return - src = source[0] + src = rendered = source[0] print(docname) - rendered = app.builder.templates.render_string( - src, app.config.html_context - ) + + if app.builder.format == "html": + rendered = app.builder.templates.render_string( + src, app.config.html_context + ) + else: + from sphinx.util.template import BaseRenderer + renderer = BaseRenderer() + rendered = renderer.render_string( + src, + app.config.html_context + ) + source[0] = rendered def setup(app): From 670b6ebecc9b7f685639b686c9ecfdd738e7a6d1 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 15 Aug 2020 14:29:38 -0500 Subject: [PATCH 0609/1293] build.yml: add doc building test for latex/pdf --- .github/workflows/build.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf9c1623f9..a020c91c0f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,12 +73,19 @@ jobs: with: name: stubs path: circuitpython-stubs* - - name: Docs + - name: Test Documentation Build (HTML) run: sphinx-build -E -W -b html -D version=${{ env.CP_VERSION }} -D release=${{ env.CP_VERSION }} . _build/html - uses: actions/upload-artifact@v2 with: name: docs path: _build/html + - name: Test Documentation Build (LaTeX/PDF) + run: | + make latexpdf + - uses: actions/upload-artifact@v2 + with: + name: docs + path: _build/latex - name: Translations run: make check-translate - name: New boards check From 97415fc604f7caac06e5637f7cc69518c54b4fee Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 15 Aug 2020 14:30:12 -0500 Subject: [PATCH 0610/1293] .readthedocs.yml: add directive for RTD to build a pdf version of the docs --- .readthedocs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.readthedocs.yml b/.readthedocs.yml index 2a0640782f..3f66351ce7 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -12,6 +12,9 @@ submodules: include: - extmod/ulab +formats: + - pdf + python: version: 3 install: From 6e67c4f7d4dca868571029d596759f2c38f77f6c Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 15 Aug 2020 14:42:12 -0500 Subject: [PATCH 0611/1293] build.yml: ensure 'latexmk' is installed --- .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 a020c91c0f..490e3ce73c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: - name: Install deps run: | sudo apt-get install -y eatmydata - sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 + sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 latexmk pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli - name: Versions run: | From 6c199c5d6918b00752bd03696e17607b1489512c Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Sat, 15 Aug 2020 15:58:04 -0500 Subject: [PATCH 0612/1293] Update documentation to remove whitespaces --- shared-bindings/displayio/Bitmap.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index b9a4fe47df..d732bc5f40 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -176,16 +176,16 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val //| """Inserts the source_bitmap region defined by rectangular boundaries //| (x1,y1) and (x2,y2) into the bitmap at the specified (x,y) location. //| :param int x: Horizontal pixel location in bitmap where source_bitmap upper-left -//| corner will be placed +//| corner will be placed //| :param int y: Vertical pixel location in bitmap where source_bitmap upper-left -//| corner will be placed +//| corner will be placed //| :param bitmap source_bitmap: Source bitmap that contains the graphical region to be copied -//| : param int x1: Minimum x-value for rectangular bounding box to be copied from the source bitmap -//| : param int y1: Minimum y-value for rectangular bounding box to be copied from the source bitmap -//| : param int x2: Maximum x-value (exclusive) for rectangular bounding box to be copied from the source bitmap -//| : param int y2: Maximum y-value (exclusive) for rectangular bounding box to be copied from the source bitmap -//| : param int skip_index: bitmap palette index in the source that will not be copied, -//| set `None` to copy all pixels""" +//| :param int x1: Minimum x-value for rectangular bounding box to be copied from the source bitmap +//| :param int y1: Minimum y-value for rectangular bounding box to be copied from the source bitmap +//| :param int x2: Maximum x-value (exclusive) for rectangular bounding box to be copied from the source bitmap +//| :param int y2: Maximum y-value (exclusive) for rectangular bounding box to be copied from the source bitmap +//| :param int skip_index: bitmap palette index in the source that will not be copied, +//| set `None` to copy all pixels""" //| ... //| From e0fd85bc45889cf32640c1076360221d46ed0cb7 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 15 Aug 2020 16:24:21 -0500 Subject: [PATCH 0613/1293] build.yml: more texlive/latex dependencies --- .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 490e3ce73c..ceb691a15b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: - name: Install deps run: | sudo apt-get install -y eatmydata - sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 latexmk + sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 latexmk texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli - name: Versions run: | From 407491577926f29de6bc182ea68b5ac36d6899db Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Sat, 15 Aug 2020 21:58:33 +0000 Subject: [PATCH 0614/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (776 of 776 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 66 ++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index a14db4fa82..716d446aee 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: 2020-08-14 09:36-0400\n" -"PO-Revision-Date: 2020-07-28 15:41+0000\n" +"PO-Revision-Date: 2020-08-16 02:25+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -82,7 +82,7 @@ msgstr "O índice %q está fora do intervalo" #: py/obj.c msgid "%q indices must be integers, not %q" -msgstr "" +msgstr "Os indicadores %q devem ser inteiros, não %q" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -122,39 +122,39 @@ msgstr "'%q' argumento(s) requerido(s)" #: py/runtime.c msgid "'%q' object cannot assign attribute '%q'" -msgstr "" +msgstr "O objeto '%q' não pode definir o atributo '%q'" #: py/proto.c msgid "'%q' object does not support '%q'" -msgstr "" +msgstr "O objeto '%q' não suporta '%q'" #: py/obj.c msgid "'%q' object does not support item assignment" -msgstr "" +msgstr "O objeto '%q' não suporta a atribuição do item" #: py/obj.c msgid "'%q' object does not support item deletion" -msgstr "" +msgstr "O objeto '%q' não suporta a exclusão dos itens" #: py/runtime.c msgid "'%q' object has no attribute '%q'" -msgstr "" +msgstr "O objeto '%q' não possui qualquer atributo '%q'" #: py/runtime.c msgid "'%q' object is not an iterator" -msgstr "" +msgstr "O objeto '%q' não é um iterador" #: py/objtype.c py/runtime.c msgid "'%q' object is not callable" -msgstr "" +msgstr "O objeto '%s' não é invocável" #: py/runtime.c msgid "'%q' object is not iterable" -msgstr "" +msgstr "O objeto '%q' não é iterável" #: py/obj.c msgid "'%q' object is not subscriptable" -msgstr "" +msgstr "O objeto '%q' não é subscritível" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -465,7 +465,7 @@ msgstr "O comprimento do Buffer deve ser um múltiplo de 512" #: ports/stm/common-hal/sdioio/SDCard.c msgid "Buffer must be a multiple of 512 bytes" -msgstr "" +msgstr "O buffer deve ser um múltiplo de 512 bytes" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -666,7 +666,7 @@ msgstr "Não foi possível reiniciar o PWM" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" -msgstr "" +msgstr "Não foi possível definir o endereço" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" @@ -853,7 +853,7 @@ msgstr "Arquivo já existe" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" -msgstr "" +msgstr "O Framebuffer requer %d bytes" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." @@ -899,7 +899,7 @@ msgstr "Erro de inicialização do I2C" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" -msgstr "" +msgstr "O I2SOut não está disponível" #: shared-bindings/aesio/aes.c #, c-format @@ -951,7 +951,7 @@ msgstr "Pino do %q inválido" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c #: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" -msgstr "" +msgstr "Seleção inválida dos pinos %q" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" @@ -1268,7 +1268,7 @@ msgstr "Não está jogando" #: main.c msgid "Not running saved code.\n" -msgstr "" +msgstr "O código salvo não está em execução.\n" #: shared-bindings/util.c msgid "" @@ -1443,7 +1443,7 @@ msgstr "A entrada da linha deve ser digitalio.DigitalInOut" #: main.c msgid "Running in safe mode! " -msgstr "" +msgstr "Executando no modo de segurança! " #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1457,12 +1457,12 @@ msgstr "SDA ou SCL precisa de um pull up" #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" -msgstr "" +msgstr "Erro SDIO GetCardInfo %d" #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO Init Error %d" -msgstr "" +msgstr "Erro SDIO Init %d" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" @@ -1840,7 +1840,7 @@ msgstr "O __init__() deve retornar Nenhum" #: py/objtype.c msgid "__init__() should return None, not '%q'" -msgstr "" +msgstr "O __init__() deve retornar Nenhum, não '%q'" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1885,7 +1885,7 @@ msgstr "argumento tem tipo errado" #: extmod/ulab/code/linalg/linalg.c msgid "argument must be ndarray" -msgstr "" +msgstr "o argumento deve ser ndarray" #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c @@ -2027,7 +2027,7 @@ msgstr "a expressão não pode ser atribuída" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert %q to %q" -msgstr "" +msgstr "não é possível converter %q para %q" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" @@ -2035,7 +2035,7 @@ msgstr "não é possível converter implicitamente o objeto '%q' para %q" #: py/obj.c msgid "can't convert to %q" -msgstr "" +msgstr "não é possível converter para %q" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2863,7 +2863,7 @@ msgstr "a quantidade dos pontos deve ser pelo menos 2" #: py/obj.c msgid "object '%q' is not a tuple or list" -msgstr "" +msgstr "o objeto '%q' não é uma tupla ou uma lista" #: py/obj.c msgid "object does not support item assignment" @@ -2899,7 +2899,7 @@ msgstr "objeto não iterável" #: py/obj.c msgid "object of type '%q' has no len()" -msgstr "" +msgstr "o objeto do tipo '%q' não tem len()" #: py/obj.c msgid "object with buffer protocol required" @@ -2999,7 +2999,7 @@ msgstr "o polígono só pode ser registrado em um pai" #: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c #: shared-bindings/ps2io/Ps2.c msgid "pop from empty %q" -msgstr "" +msgstr "pop a partir do %q vazio" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3158,7 +3158,7 @@ msgstr "a operação do fluxo não é compatível" #: py/objstrunicode.c msgid "string indices must be integers, not %q" -msgstr "" +msgstr "a sequência dos índices devem ser inteiros, não %q" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3235,7 +3235,7 @@ msgstr "valores demais para descompactar (esperado %d)" #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" -msgstr "" +msgstr "o trapz está definido para 1D arrays de igual tamanho" #: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" @@ -3305,7 +3305,7 @@ msgstr "especificador de conversão desconhecido %c" #: py/objstr.c msgid "unknown format code '%c' for object of type '%q'" -msgstr "" +msgstr "o formato do código '%c' é desconhecido para o objeto do tipo '%q'" #: py/compile.c msgid "unknown type" @@ -3345,7 +3345,7 @@ msgstr "o caractere do formato não é compatível '%c' (0x%x) no índice %d" #: py/runtime.c msgid "unsupported type for %q: '%q'" -msgstr "" +msgstr "tipo sem suporte para %q: '%q'" #: py/runtime.c msgid "unsupported type for operator" @@ -3353,7 +3353,7 @@ msgstr "tipo não compatível para o operador" #: py/runtime.c msgid "unsupported types for %q: '%q', '%q'" -msgstr "" +msgstr "tipo sem suporte para %q: '%q', '%q'" #: py/objint.c #, c-format @@ -3366,7 +3366,7 @@ msgstr "o value_count deve ser > 0" #: extmod/ulab/code/linalg/linalg.c msgid "vectors must have same lengths" -msgstr "" +msgstr "os vetores devem ter os mesmos comprimentos" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" From ddd79a2483b58d0a2b451db16689a115c4f4e243 Mon Sep 17 00:00:00 2001 From: hexthat Date: Sun, 16 Aug 2020 16:33:03 -0700 Subject: [PATCH 0615/1293] Update zh_Latn_pinyin.po add translations --- locale/zh_Latn_pinyin.po | 346 ++++++++++++++++++++------------------- 1 file changed, 175 insertions(+), 171 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 9aeb68cda8..d3d645d947 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -62,11 +62,11 @@ msgstr "%%c xūyào zhěngshù huò char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "" +msgstr "%d dìzhǐ yǐn jiǎo hé %d rgb yǐn jiǎo jiāng gāodù biǎoshì wèi %d, ér bùshì %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" -msgstr "" +msgstr "%q Shībài: %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -82,15 +82,15 @@ msgstr "%q suǒyǐn chāochū fànwéi" #: py/obj.c msgid "%q indices must be integers, not %q" -msgstr "" +msgstr "%q suǒyǐn bìxū shì zhěngshù, ér bùshì %q" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "" +msgstr "%q lièbiǎo bìxū shì lièbiǎo" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" -msgstr "" +msgstr "%q Bìxū > = 0" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -102,11 +102,11 @@ msgstr "%q bìxū dàyú huò děngyú 1" #: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "" +msgstr "%q bìxū shì chángdù wèi 2 de yuán zǔ" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q pin invalid" -msgstr "" +msgstr "%q yǐn jiǎo wúxiào" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" @@ -122,39 +122,39 @@ msgstr "xūyào '%q' cānshù" #: py/runtime.c msgid "'%q' object cannot assign attribute '%q'" -msgstr "" +msgstr "'%q' duì xiàng wú fǎ fēn pèi shǔ xìng '%q'" #: py/proto.c msgid "'%q' object does not support '%q'" -msgstr "" +msgstr "'%q' duì xiàng bù zhī chí '%q'" #: py/obj.c msgid "'%q' object does not support item assignment" -msgstr "" +msgstr "'%q' duì xiàng bù zhī chí xiàng mù fēn pèi" #: py/obj.c msgid "'%q' object does not support item deletion" -msgstr "" +msgstr "'%q' duì xiàng bù zhī chí xiàng mù shān chú" #: py/runtime.c msgid "'%q' object has no attribute '%q'" -msgstr "" +msgstr "%q' duì xiàng méi yǒu shǔ xìng %q'" #: py/runtime.c msgid "'%q' object is not an iterator" -msgstr "" +msgstr "%q' duì xiàng bù shì yí gè liú lǎn qì" #: py/objtype.c py/runtime.c msgid "'%q' object is not callable" -msgstr "" +msgstr "%q' duì xiàng bù kě diào yòng" #: py/runtime.c msgid "'%q' object is not iterable" -msgstr "" +msgstr "%q' duì xiàng bù kě yí dòng" #: py/obj.c msgid "'%q' object is not subscriptable" -msgstr "" +msgstr "%q' duì xiàng bù kě xià biāo" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -224,7 +224,7 @@ msgstr "'await' wàibù gōngnéng" #: py/compile.c msgid "'await', 'async for' or 'async with' outside async function" -msgstr "" +msgstr "'await', 'async for' huò 'async with' wài bù yì bù hán shù" #: py/compile.c msgid "'break' outside loop" @@ -236,7 +236,7 @@ msgstr "'continue' wàibù xúnhuán" #: py/objgenerator.c msgid "'coroutine' object is not an iterator" -msgstr "" +msgstr "'coroutine' duì xiàng bù shì yí gè liú lǎn qì" #: py/compile.c msgid "'data' requires at least 2 arguments" @@ -331,7 +331,7 @@ msgstr "Mùqián zhèngzài guǎngbò" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" -msgstr "" +msgstr "yǐ zài yùn xíng" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -366,12 +366,12 @@ msgstr "Shùzǔ zhí yīnggāi shì dāngè zì jié." #: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" -msgstr "" +msgstr "zuì duō kě yǐ zhǐ dìng %d %q (bù shì %d)" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" -msgstr "" +msgstr "cháng shì fēn pèi %d kuài" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." @@ -404,7 +404,7 @@ msgstr "Bǐtè shēndù bìxū shì 8 bèi yǐshàng." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "" +msgstr "liú liàng kòng zhì suǒ xū de RX hé TX" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -453,11 +453,11 @@ msgstr "Huǎnchōng qū chángdù%d tài dà. Tā bìxū xiǎoyú%d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" -msgstr "" +msgstr "Huǎn chōng qū cháng dù bì xū wéi 512 de bèi shù" #: ports/stm/common-hal/sdioio/SDCard.c msgid "Buffer must be a multiple of 512 bytes" -msgstr "" +msgstr "Huǎn chōng qū bì xū shì 512 zì jié de bèi shù" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -465,12 +465,12 @@ msgstr "Huǎnchōng qū bìxū zhìshǎo chángdù 1" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Buffer too large and unable to allocate" -msgstr "huǎn chōng qū tài dà , wú fǎ fēn pèi" +msgstr "Huǎn chōng qū tài dà , wú fǎ fēn pèi" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "" +msgstr "Huǎn chōng qū tài duǎn , àn %d zì jié" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -488,7 +488,7 @@ msgstr "Zì jié bìxū jiè yú 0 dào 255 zhī jiān." #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "CBC kuài bì xū shì 16 zì jié de bèi shù" #: py/objtype.c msgid "Call super().__init__() before accessing native object." @@ -546,7 +546,7 @@ msgstr "Dāng fāngxiàng xiàng nèi shí, bùnéng shèzhì gāi zhí." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "" +msgstr "wú fǎ zài RS485 mó shì xià zhǐ dìng RTS huò CTS" #: py/objslice.c msgid "Cannot subclass slice" @@ -621,11 +621,11 @@ msgstr "Sǔnhuài de yuánshǐ dàimǎ" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" -msgstr "" +msgstr "wú fǎ chū shǐ huà GNSS" #: ports/cxd56/common-hal/sdioio/SDCard.c msgid "Could not initialize SDCard" -msgstr "" +msgstr "wú fǎ chū shǐ huà SDCard" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" @@ -653,7 +653,7 @@ msgstr "Wúfǎ chóngqǐ PWM" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" -msgstr "" +msgstr "wú fǎ shè zhì dì zhǐ" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" @@ -739,7 +739,7 @@ msgstr "Fāngxiàng shūrù shí qūdòng móshì méiyǒu shǐyòng." #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" -msgstr "" +msgstr "ECB yí cì zhǐ shǐ yòng 16 gè zì jié" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -788,7 +788,7 @@ msgstr "Bù zhīchí dài yǒu sǎomiáo xiǎngyìng de kuòzhǎn guǎngbò." #: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" -msgstr "" +msgstr "FFT jǐn wéi ndarrays dìng yì" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." @@ -840,7 +840,7 @@ msgstr "Wénjiàn cúnzài" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" -msgstr "" +msgstr "zhēn huǎn chōng qū xū yào %d zì jié" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." @@ -884,12 +884,12 @@ msgstr "I2C chūshǐhuà cuòwù" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" -msgstr "" +msgstr "I2SOut bù kě yòng" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "" +msgstr "IV bì xū wéi %d zì jié cháng" #: py/persistentcode.c msgid "" @@ -922,11 +922,11 @@ msgstr "Nèibù dìngyì cuòwù" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format msgid "Internal error #%d" -msgstr "" +msgstr "nèi bù cuò wù #%d" #: shared-bindings/sdioio/SDCard.c msgid "Invalid %q" -msgstr "" +msgstr "wú xiào %q" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -936,7 +936,7 @@ msgstr "Wúxiào de %q yǐn jiǎo" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c #: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" -msgstr "" +msgstr "wú xiào %q yǐn jiǎo xuǎn zé" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" @@ -1037,7 +1037,7 @@ msgstr "Wúxiào de yǐn jiǎo" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid pins for PWMOut" -msgstr "" +msgstr "PWMOut de yǐn jiǎo wú xiào" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c @@ -1074,7 +1074,7 @@ msgstr "Wúxiào de zì/wèi chángdù" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" -msgstr "" +msgstr "mì yào bì xū wéi 16, 24 huò 32 zì jié cháng" #: py/compile.c msgid "LHS of keyword arg must be an id" @@ -1135,16 +1135,16 @@ msgstr "Bìxū tígōng MISO huò MOSI yǐn jiǎo" #: ports/stm/common-hal/busio/SPI.c msgid "Must provide SCK pin" -msgstr "" +msgstr "bì xū tí gòng SCK yǐn jiǎo" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" -msgstr "" +msgstr "bì xū shǐ yòng 6 RGB yǐn jiǎo de bèi shù, ér bù shì %d" #: py/parse.c msgid "Name too long" -msgstr "" +msgstr "Míngchēng tài zhǎng" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" @@ -1186,7 +1186,7 @@ msgstr "Méiyǒu kěyòng de shízhōng" #: shared-bindings/_bleio/PacketBuffer.c msgid "No connection: length cannot be determined" -msgstr "" +msgstr "Wú liánjiē: Wúfǎ quèdìng chángdù" #: shared-bindings/board/__init__.c msgid "No default %q bus" @@ -1211,11 +1211,11 @@ msgstr "Méiyǒu zài yǐn jiǎo shàng de yìngjiàn zhīchí" #: shared-bindings/aesio/aes.c msgid "No key was specified" -msgstr "" +msgstr "Wèi zhǐdìng mì yào" #: shared-bindings/time/__init__.c msgid "No long integer support" -msgstr "" +msgstr "Méiyǒu zhǎng zhěngshù zhīchí" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." @@ -1235,7 +1235,7 @@ msgstr "Méiyǒu cǐ lèi wénjiàn/mùlù" #: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" -msgstr "" +msgstr "Méiyǒu jìshí qì" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." @@ -1253,7 +1253,7 @@ msgstr "Wèi bòfàng" #: main.c msgid "Not running saved code.\n" -msgstr "" +msgstr "Méiyǒu yùnxíng yǐ bǎocún de dàimǎ.\n" #: shared-bindings/util.c msgid "" @@ -1320,15 +1320,15 @@ msgstr "Pin méiyǒu ADC nénglì" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pin is input only" -msgstr "" +msgstr "Yǐn jiǎo jǐn shūrù" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" -msgstr "" +msgstr "Yǐn jiǎo bìxū zhīchí yìngjiàn zhōngduàn" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" -msgstr "" +msgstr "Zhēn hào yǐ bèi EXTI bǎoliú" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1337,6 +1337,9 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" +“Chājiǎo měi gè yuánsù shǐyòng%d gè zì jié, zhè bǐ lǐxiǎng de%d xiāohào gèng duō” +“zì jié. Rúguǒ wúfǎ bìmiǎn, qǐng jiāng allow_inefficient = True chuándì gěi “ +“gòuzào hánshù” #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" @@ -1344,7 +1347,7 @@ msgstr "Zài wénjiàn xìtǒng shàng tiānjiā rènhé mókuài\n" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" -msgstr "" +msgstr "Duōbiānxíng zhìshǎo xūyào 3 diǎn" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" @@ -1368,7 +1371,7 @@ msgstr "RNG chūshǐhuà cuòwù" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" -msgstr "" +msgstr "Wèi chǔyú RS485 móshì shí zhǐdìngle RS485 fǎn zhuǎn" #: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c #: ports/nrf/common-hal/rtc/RTC.c @@ -1382,7 +1385,7 @@ msgstr "Cǐ bǎn bù zhīchí RTC" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" +msgstr "RTS/CTS/RS485 gāi shèbèi shàng bù zhīchí" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" @@ -1407,7 +1410,7 @@ msgstr "Shuāxīn tài kuàile" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" -msgstr "" +msgstr "Qǐngqiú de AES móshì bù shòu zhīchí" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" @@ -1419,11 +1422,11 @@ msgstr "Xíng xiàng bìxū shì digitalio.DigitalInOut" #: main.c msgid "Running in safe mode! " -msgstr "" +msgstr "Zài ānquán móshì xià yùnxíng!" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" -msgstr "" +msgstr "Bù zhīchí SD kǎ CSD géshì" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c @@ -1433,12 +1436,12 @@ msgstr "SDA huò SCL xūyào lādòng" #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" -msgstr "" +msgstr "SDIO GetCardInfo Cuòwù %d" #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO Init Error %d" -msgstr "" +msgstr "SDIO Init Cuòwù %d" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" @@ -1463,11 +1466,11 @@ msgstr "Zhèngzài jìn háng sǎomiáo. Shǐyòng stop_scan tíngzhǐ." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" -msgstr "" +msgstr "Suǒ xuǎn de CTS yǐn jiǎo wúxiào" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected RTS pin not valid" -msgstr "" +msgstr "Suǒ xuǎn de RTS yǐn jiǎo wúxiào" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1487,7 +1490,7 @@ msgstr "Qiēpiàn bù shòu zhīchí" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "" +msgstr "Yuán huǎnchōng qū hé mùbiāo huǎnchōng qū de chángdù bìxū xiāngtóng" #: extmod/modure.c msgid "Splitting with sub-captures" @@ -1507,11 +1510,11 @@ msgstr "Dìngyì zhìshǎo yīgè UART yǐn jiǎo" #: shared-bindings/gnss/GNSS.c msgid "System entry must be gnss.SatelliteSystem" -msgstr "" +msgstr "Xìtǒng tiáomù bìxū shì gnss.SatelliteSystem" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" -msgstr "" +msgstr "Wēndù dòu qǔ chāoshí" #: supervisor/shared/safe_mode.c msgid "" @@ -1574,12 +1577,13 @@ msgstr "Píng pū kuāndù bìxū huàfēn wèi tú kuāndù" #: ports/nrf/common-hal/_bleio/Adapter.c #, c-format msgid "Timeout is too long: Maximum timeout length is %d seconds" -msgstr "" +msgstr "Chāoshí shíjiān tài zhǎng: Zuìdà chāoshí shíjiān wèi%d miǎo" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +"Dìngshí qì bǎoliú gōng nèibù shǐyòng-zài chéngxù de qiánmiàn shēngmíng PWM yǐn jiǎo" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1595,7 +1599,7 @@ msgstr "Xiǎnshì tài duō" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Total data to write is larger than outgoing_packet_length" -msgstr "" +msgstr "Yào xiě rù de zǒng shùjù dàyú outgoing_packet_length" #: py/obj.c msgid "Traceback (most recent call last):\n" @@ -1745,7 +1749,7 @@ msgstr "Viper hánshù mùqián bù zhīchí chāoguò 4 gè cānshù" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Voltage read timed out" -msgstr "" +msgstr "Diànyā dòu qǔ chāoshí" #: main.c msgid "WARNING: Your code filename has two extensions\n" @@ -1753,23 +1757,23 @@ msgstr "Jǐnggào: Nǐ de dàimǎ wénjiàn míng yǒu liǎng gè kuòzhǎn mín #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" -msgstr "" +msgstr "Yīdàn jiāng móshì shèzhì wèi RESET, jiù wúfǎ chūshǐhuà WatchDog Timer" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer is not currently running" -msgstr "" +msgstr "WatchDogTimer dāngqián wèi yùnxíng" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" -msgstr "" +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 "" +msgstr "WatchDogTimer.Timeout bìxū dàyú 0" #: supervisor/shared/safe_mode.c msgid "Watchdog timer expired." -msgstr "" +msgstr "Kān mén gǒu dìngshí qì yǐ guòqí." #: py/builtinhelp.c #, c-format @@ -1804,7 +1808,7 @@ msgstr "__init__() fǎnhuí not" #: py/objtype.c msgid "__init__() should return None, not '%q'" -msgstr "" +msgstr "__Init __() yīnggāi fǎnhuí None, ér bùshì '%q'" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1833,7 +1837,7 @@ msgstr "dìzhǐ wèi kōng" #: extmod/ulab/code/vector/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" +msgstr "arctan2 jǐn zhēnduì biāoliàng hé ndarray shíxiàn" #: py/modbuiltins.c msgid "arg is an empty sequence" @@ -1841,7 +1845,7 @@ msgstr "cānshù shì yīgè kōng de xùliè" #: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" -msgstr "" +msgstr "argsort cānshù bìxū shì ndarray" #: py/runtime.c msgid "argument has wrong type" @@ -1849,7 +1853,7 @@ msgstr "cānshù lèixíng cuòwù" #: extmod/ulab/code/linalg/linalg.c msgid "argument must be ndarray" -msgstr "" +msgstr "Cānshù bìxū shì ndarray" #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c @@ -1862,7 +1866,7 @@ msgstr "cānshù yīnggāi shì '%q', 'bùshì '%q'" #: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" -msgstr "" +msgstr "cānshù bìxū shì ndarrays" #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -1870,7 +1874,7 @@ msgstr "yòu cè xūyào shùzǔ/zì jié" #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" -msgstr "" +msgstr "chángshì huòqǔ kōng xùliè de argmin/ argmax" #: py/objstr.c msgid "attributes not supported yet" @@ -1878,15 +1882,15 @@ msgstr "shǔxìng shàngwèi zhīchí" #: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" -msgstr "" +msgstr "zhóu bìxū wèi-1,0, wú huò 1" #: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, or 1" -msgstr "" +msgstr "zhóu bìxū wèi-1,0 huò 1" #: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" -msgstr "" +msgstr "zhóu bìxū wèi None,0 huò 1" #: py/builtinevex.c msgid "bad compile mode" @@ -1991,7 +1995,7 @@ msgstr "bùnéng fēnpèi dào biǎodá shì" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert %q to %q" -msgstr "" +msgstr "Wúfǎ jiāng %q zhuǎnhuàn wèi %q" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" @@ -1999,7 +2003,7 @@ msgstr "wúfǎ jiāng '%q' duìxiàng zhuǎnhuàn wèi %q yǐn hán" #: py/obj.c msgid "can't convert to %q" -msgstr "" +msgstr "wúfǎ zhuǎnhuàn wèi %q" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2051,7 +2055,7 @@ msgstr "wúfǎ xiàng gānggāng qǐdòng de shēngchéng qì fāsòng fēi zhí #: shared-module/sdcardio/SDCard.c msgid "can't set 512 block size" -msgstr "" +msgstr "wúfǎ shèzhì 512 kuài dàxiǎo" #: py/objnamedtuple.c msgid "can't set attribute" @@ -2097,7 +2101,7 @@ msgstr "wúfǎ zhíxíng xiāngguān dǎorù" #: extmod/ulab/code/ndarray.c msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" +msgstr "wúfǎ zhěngxíng shùzǔ (bù jiānróng de shūrù/shūchū xíngzhuàng)" #: py/emitnative.c msgid "casting" @@ -2117,7 +2121,7 @@ msgstr "chr() cān shǔ bùzài fànwéi (256)" #: shared-module/vectorio/Circle.c msgid "circle can only be registered in one parent" -msgstr "" +msgstr "quānzi zhǐ néng zài yī wèi jiāzhǎng zhōng zhùcè" #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" @@ -2164,39 +2168,39 @@ msgstr "zhuǎnhuàn wèi duìxiàng" #: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" -msgstr "" +msgstr "juàn jī cānshù bìxū shì xiànxìng shùzǔ" #: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" -msgstr "" +msgstr "juàn jī cānshù bìxū shì ndarrays" #: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" -msgstr "" +msgstr "juàn jī cān shǔ bùnéng wéi kōng" #: extmod/ulab/code/ndarray.c msgid "could not broadast input array from shape" -msgstr "" +msgstr "wúfǎ guǎngbò xíngzhuàng de shūrù shùzǔ" #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" -msgstr "" +msgstr "wúfǎ fǎn zhuǎn fàndéméng dé jǔzhèn" #: shared-module/sdcardio/SDCard.c msgid "couldn't determine SD card version" -msgstr "" +msgstr "wúfǎ quèdìng SD kǎ bǎnběn" #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" -msgstr "" +msgstr "shùjù bìxū shì kě diédài de" #: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" -msgstr "" +msgstr "shùjù chángdù bìxū xiāngděng" #: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" -msgstr "" +msgstr "ddof bìxū xiǎoyú shùjù jí de chángdù" #: py/parsenum.c msgid "decimal numbers not supported" @@ -2226,7 +2230,7 @@ msgstr "yǔfǎ gēngxīn xùliè de chángdù cuòwù" #: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" -msgstr "" +msgstr "bùtóng de cānshù bìxū shì ndarray" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c @@ -2300,23 +2304,23 @@ msgstr "gěi chūle éwài de wèizhì cānshù" #: py/parse.c msgid "f-string expression part cannot include a '#'" -msgstr "" +msgstr "f-string biǎodá shì bùfèn bùnéng bāohán '#'" #: py/parse.c msgid "f-string expression part cannot include a backslash" -msgstr "" +msgstr "f-string biǎodá shì bùfèn bùnéng bāohán fǎn xié gāng" #: py/parse.c msgid "f-string: empty expression not allowed" -msgstr "" +msgstr "f-string: bù yǔnxǔ shǐyòng kōng biǎodá shì" #: py/parse.c msgid "f-string: expecting '}'" -msgstr "" +msgstr "f-string: qídài '}'" #: py/parse.c msgid "f-string: single '}' is not allowed" -msgstr "" +msgstr "f-string: bù yǔnxǔ shǐyòng dāngè '}'" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c @@ -2329,19 +2333,19 @@ msgstr "wénjiàn xìtǒng bìxū tígōng guà zài fāngfǎ" #: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" -msgstr "" +msgstr "dì yī gè cānshù bìxū shì kě tiáo yòng de" #: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" -msgstr "" +msgstr "dì yīgè cānshù bìxū shì yī gè hánshù" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" -msgstr "" +msgstr "dì yī gè cānshù bìxū shì kě diédài de" #: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" -msgstr "" +msgstr "dì yī gè cānshù bìxū shì ndarray" #: py/objtype.c msgid "first argument to super() must be type" @@ -2349,11 +2353,11 @@ msgstr "chāojí () de dì yī gè cānshù bìxū shì lèixíng" #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" -msgstr "" +msgstr "īnhé shùnxù bìxū wèi 'C' huò 'F'" #: extmod/ulab/code/numerical/numerical.c msgid "flip argument must be an ndarray" -msgstr "" +msgstr "fānzhuǎn shēn shù bìxū shì ndarray" #: py/objint.c msgid "float too big" @@ -2386,11 +2390,11 @@ msgstr "hánshù huòdé cānshù '%q' de duōchóng zhí" #: extmod/ulab/code/approx/approx.c msgid "function has the same sign at the ends of interval" -msgstr "" +msgstr "hánshù zài jiàngé mòwěi jùyǒu xiāngtóng de fúhào" #: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" -msgstr "" +msgstr "gāi hánshù jǐn zhēnduì biāoliàng hé ndarray shíxiàn" #: py/argcheck.c #, c-format @@ -2457,7 +2461,7 @@ msgstr "bù zhèngquè de tiánchōng" #: extmod/ulab/code/ndarray.c msgid "index is out of bounds" -msgstr "" +msgstr "suǒyǐn chāochū fànwéi" #: py/obj.c msgid "index out of range" @@ -2469,11 +2473,11 @@ msgstr "suǒyǐn bìxū shì zhěngshù" #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" -msgstr "" +msgstr "suǒyǐn bìxū shì zhěngshù, qiēpiàn huò bù'ěr zhí lièbiǎo" #: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" -msgstr "" +msgstr "chūshǐ zhí bìxū shì kě diédài de" #: py/compile.c msgid "inline assembler must be a function" @@ -2481,35 +2485,35 @@ msgstr "nèi lián jíhé bìxū shì yīgè hánshù" #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" -msgstr "" +msgstr "shūrù cānshù bìxū shì zhěngshù huò 2 yuán zǔ" #: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" -msgstr "" +msgstr "shūrù shùzǔ de chángdù bìxū shì 2 de mì" #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" -msgstr "" +msgstr "shūrù shùjù bìxū shì kě diédài de" #: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" -msgstr "" +msgstr "shūrù jǔzhèn bù duìchèn" #: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" -msgstr "" +msgstr "shūrù jǔzhèn shì qíyì de" #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" -msgstr "" +msgstr "shūrù bìxū wèi fāng jǔzhèn" #: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" -msgstr "" +msgstr "shūrù bìxū shì yuán zǔ, lièbiǎo, fànwéi huò ndarray" #: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" -msgstr "" +msgstr "shūrù xiàngliàng de chángdù bìxū xiāngděng" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" @@ -2521,7 +2525,7 @@ msgstr "xūyào zhěngshù" #: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" -msgstr "" +msgstr "interp shì wèi děng zhǎng de 1D shùzǔ dìngyì de" #: shared-bindings/_bleio/Adapter.c #, c-format @@ -2587,11 +2591,11 @@ msgstr "issubclass() cānshù 2 bìxū shì lèi de lèi huò yuán zǔ" #: extmod/ulab/code/ndarray.c msgid "iterables are not of the same length" -msgstr "" +msgstr "kě diédài xiàng de chángdù bùtóng" #: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" -msgstr "" +msgstr "diédài méiyǒu shōuliǎn" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" @@ -2644,7 +2648,7 @@ msgstr "cǐ bǎnběn bù zhīchí zhǎng zhěngshù" #: py/parse.c msgid "malformed f-string" -msgstr "" +msgstr "jīxíng de f-string" #: shared-bindings/_stage/Layer.c msgid "map buffer too small" @@ -2656,11 +2660,11 @@ msgstr "shùxué yù cuòwù" #: extmod/ulab/code/linalg/linalg.c msgid "matrix dimensions do not match" -msgstr "" +msgstr "jǔzhèn chǐcùn bù pǐpèi" #: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" -msgstr "" +msgstr "jǔzhèn bùshì zhèngdìng de" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -2687,7 +2691,7 @@ msgstr "zhǎo bù dào mókuài" #: extmod/ulab/code/poly/poly.c msgid "more degrees of freedom than data points" -msgstr "" +msgstr "bǐ shùjù diǎn gèng duō de zìyóu dù" #: py/compile.c msgid "multiple *x in assignment" @@ -2711,7 +2715,7 @@ msgstr "bìxū shǐyòng guānjiàn cí cānshù" #: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" -msgstr "" +msgstr "n bìxū jiè yú 0 dào 9 zhī jiān" #: py/runtime.c msgid "name '%q' is not defined" @@ -2745,7 +2749,7 @@ msgstr "fù zhuǎnyí jìshù" #: shared-module/sdcardio/SDCard.c msgid "no SD card" -msgstr "" +msgstr "méiyǒu SD kǎ" #: py/vm.c msgid "no active exception to reraise" @@ -2770,7 +2774,7 @@ msgstr "Méiyǒu kěyòng de fùwèi yǐn jiǎo" #: shared-module/sdcardio/SDCard.c msgid "no response from SD card" -msgstr "" +msgstr "SD kǎ wú huíyīng" #: py/runtime.c msgid "no such attribute" @@ -2810,15 +2814,15 @@ msgstr "géshì zìfú chuàn cān shǔ bùzú" #: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" -msgstr "" +msgstr "cānshù shùliàng bìxū wèi 2 huò 3" #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" -msgstr "" +msgstr "diǎnshù bìxū zhìshǎo wèi 2" #: py/obj.c msgid "object '%q' is not a tuple or list" -msgstr "" +msgstr "duìxiàng '%q' bùshì yuán zǔ huò lièbiǎo" #: py/obj.c msgid "object does not support item assignment" @@ -2854,7 +2858,7 @@ msgstr "duìxiàng bùnéng diédài" #: py/obj.c msgid "object of type '%q' has no len()" -msgstr "" +msgstr "lèixíng '%q' de duìxiàng méiyǒu len()" #: py/obj.c msgid "object with buffer protocol required" @@ -2884,15 +2888,15 @@ msgstr "jǐn zhīchí bù zhǎng = 1(jí wú) de qiēpiàn" #: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c #: extmod/ulab/code/vector/vectorise.c msgid "operands could not be broadcast together" -msgstr "" +msgstr "cāozuò shǔ bùnéng yīqǐ guǎngbò" #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" -msgstr "" +msgstr "cāozuò wèi zài ndarrays shàng shíxiàn" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" -msgstr "" +msgstr "gěi dìng lèixíng bù zhīchí gāi cāozuò" #: py/modbuiltins.c msgid "ord expects a character" @@ -2941,7 +2945,7 @@ msgstr "pixel_shader bìxū shì displayio.Palette huò displayio.ColorConverter #: shared-module/vectorio/Polygon.c msgid "polygon can only be registered in one parent" -msgstr "" +msgstr "duōbiānxíng zhī néng zài yīgè fù jí zhōng zhùcè" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -2949,7 +2953,7 @@ msgstr "" #: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c #: shared-bindings/ps2io/Ps2.c msgid "pop from empty %q" -msgstr "" +msgstr "cóng kōng %q dànchū" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -2965,11 +2969,11 @@ msgstr "duìliè yìchū" #: py/parse.c msgid "raw f-strings are not implemented" -msgstr "" +msgstr "wèi zhíxíng yuánshǐ f-strings" #: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" -msgstr "" +msgstr "shí bù hé xū bù bìxū děng zhǎng" #: py/builtinimport.c msgid "relative import" @@ -2991,16 +2995,16 @@ msgstr "fǎnhuí yùqí de '%q' dàn huòdéle '%q'" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" -msgstr "" +msgstr "rgb_pins[%d] fùzhì lìng yīgè yǐn jiǎo fēnpèi" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "" +msgstr "rgb_pins[%d] yǔ shízhōng bùzài tóng yīgè duānkǒu shàng" #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" -msgstr "" +msgstr "yòubiān bìxū shì ndarray huò biāoliàng" #: py/objstr.c msgid "rsplit(None,n)" @@ -3028,7 +3032,7 @@ msgstr "bù zhīchí jiǎoběn biānyì" #: extmod/ulab/code/ndarray.c msgid "shape must be a 2-tuple" -msgstr "" +msgstr "xíngzhuàng bìxū shì 2 yuán zǔ" #: py/objstr.c msgid "sign not allowed in string format specifier" @@ -3044,7 +3048,7 @@ msgstr "zài géshì zìfú chuàn zhōng yù dào de dāngè '}'" #: extmod/ulab/code/linalg/linalg.c msgid "size is defined for ndarrays only" -msgstr "" +msgstr "dàxiǎo jǐn wèi ndarrays dìngyì" #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" @@ -3052,7 +3056,7 @@ msgstr "shuìmián chángdù bìxū shìfēi fùshù" #: extmod/ulab/code/ndarray.c msgid "slice step can't be zero" -msgstr "" +msgstr "qiēpiàn bù cháng bùnéng wéi líng" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" @@ -3068,19 +3072,19 @@ msgstr "ruǎn chóngqǐ\n" #: extmod/ulab/code/numerical/numerical.c msgid "sort argument must be an ndarray" -msgstr "" +msgstr "páixù cānshù bìxū shì ndarray" #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" -msgstr "" +msgstr "sos shùzǔ de xíngzhuàng bìxū wèi (n_section, 6)" #: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" -msgstr "" +msgstr "sos [:, 3] yīnggāi quán shì" #: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" -msgstr "" +msgstr "sosfilt xūyào diédài cānshù" #: py/objstr.c msgid "start/end indices" @@ -3108,7 +3112,7 @@ msgstr "bù zhīchí liú cāozuò" #: py/objstrunicode.c msgid "string indices must be integers, not %q" -msgstr "" +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" @@ -3148,7 +3152,7 @@ msgstr "time.struct_time() xūyào 9 xùliè" #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" -msgstr "" +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" @@ -3160,11 +3164,11 @@ msgstr "chāoshí bìxū shì >= 0.0" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" -msgstr "" +msgstr "děngdài v1 kǎ chāoshí" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v2 card" -msgstr "" +msgstr "děngdài v2 kǎ chāoshí" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" @@ -3176,7 +3180,7 @@ msgstr "tígōng jǐ dìng géshì de cānshù tài duō" #: extmod/ulab/code/ndarray.c msgid "too many indices" -msgstr "" +msgstr "suǒyǐn tài duō" #: py/runtime.c #, c-format @@ -3185,7 +3189,7 @@ msgstr "dǎkāi tài duō zhí (yùqí %d)" #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" -msgstr "" +msgstr "Trapz shì wèi děng zhǎng de 1D shùzǔ dìngyì de" #: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" @@ -3255,7 +3259,7 @@ msgstr "wèizhī de zhuǎnhuàn biāozhù %c" #: py/objstr.c msgid "unknown format code '%c' for object of type '%q'" -msgstr "" +msgstr "lèixíng '%q' de duìxiàng de wèizhī géshì dàimǎ '%c'" #: py/compile.c msgid "unknown type" @@ -3295,7 +3299,7 @@ msgstr "bù zhīchí de géshì zìfú '%c' (0x%x) suǒyǐn %d" #: py/runtime.c msgid "unsupported type for %q: '%q'" -msgstr "" +msgstr "%q de bù shòu zhīchí de lèixíng: '%q'" #: py/runtime.c msgid "unsupported type for operator" @@ -3303,7 +3307,7 @@ msgstr "bù zhīchí de cāozuò zhě lèixíng" #: py/runtime.c msgid "unsupported types for %q: '%q', '%q'" -msgstr "" +msgstr "%q bù zhīchí de lèixíng: '%q', '%q'" #: py/objint.c #, c-format @@ -3316,11 +3320,11 @@ msgstr "zhí jìshù bìxū wèi > 0" #: extmod/ulab/code/linalg/linalg.c msgid "vectors must have same lengths" -msgstr "" +msgstr "xiàngliàng bìxū jùyǒu xiāngtóng de chángdù" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" -msgstr "" +msgstr "kān mén gǒu chāoshí bìxū dàyú 0" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" @@ -3328,15 +3332,15 @@ msgstr "Chuāngkǒu bìxū shì <= jiàngé" #: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" -msgstr "" +msgstr "cuòwù de cānshù lèixíng" #: extmod/ulab/code/ndarray.c msgid "wrong index type" -msgstr "" +msgstr "cuòwù de suǒyǐn lèixíng" #: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" -msgstr "" +msgstr "shūrù lèixíng cuòwù" #: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" @@ -3348,11 +3352,11 @@ msgstr "wúfǎ jiě bāo de zhí shù" #: extmod/ulab/code/ndarray.c msgid "wrong operand type" -msgstr "" +msgstr "cuòwù de cāozuò shù lèixíng" #: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" -msgstr "" +msgstr "cuòwù de shūchū lèixíng" #: shared-module/displayio/Shape.c msgid "x value out of bounds" @@ -3372,15 +3376,15 @@ msgstr "líng bù" #: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" -msgstr "" +msgstr "zi bìxū shì ndarray" #: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" -msgstr "" +msgstr "zi bìxū wèi fú diǎn xíng" #: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" -msgstr "" +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" From d27a1aca187a276cdfd6561515bd078c641c3529 Mon Sep 17 00:00:00 2001 From: hexthat Date: Sun, 16 Aug 2020 18:18:36 -0700 Subject: [PATCH 0616/1293] Update zh_Latn_pinyin.po MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixed some “ to " --- locale/zh_Latn_pinyin.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index d3d645d947..38a7185bd2 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -1337,9 +1337,9 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" -“Chājiǎo měi gè yuánsù shǐyòng%d gè zì jié, zhè bǐ lǐxiǎng de%d xiāohào gèng duō” -“zì jié. Rúguǒ wúfǎ bìmiǎn, qǐng jiāng allow_inefficient = True chuándì gěi “ -“gòuzào hánshù” +"Chājiǎo měi gè yuánsù shǐyòng%d gè zì jié, zhè bǐ lǐxiǎng de%d xiāohào gèng duō" +"zì jié. Rúguǒ wúfǎ bìmiǎn, qǐng jiāng allow_inefficient = True chuándì gěi" +"gòuzào hánshù" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" From 08ed09acc6c73bae5475735e6e39b10ccd951d36 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 16 Aug 2020 20:38:05 -0500 Subject: [PATCH 0617/1293] makeqstrdata: don't print "compression incrased length" messages This check as implemented is misleading, because it compares the compressed size in bytes (including the length indication) with the source string length in Unicode code points. For English this is approximately fair, but for Japanese this is quite unfair and produces an excess of "increased length" messages. This message might have existed for one of two reasons: * to alert to an improperly function huffman compression * to call attention to a need for a "string is stored uncompressed" case We know by now that the huffman compression is functioning as designed and effective in general. Just to be on the safe side, I did some back-of-the-envelope estimates. I considered these three replacements for "the true source string size, in bytes": + decompressed_len_utf8 = len(decompressed.encode('utf-8')) + decompressed_len_utf16 = len(decompressed.encode('utf-16be')) + decompressed_len_bitsize = ((1+len(decompressed)) * math.ceil(math.log(1+len(values), 2)) + 7) // 8 The third counts how many bits each character requires (fewer than 128 characters in the source character set = 7, fewer than 256 = 8, fewer than 512 = 9, etc, adding a string-terminating value) and is in some way representative of the best way we would be able to store "uncompressed strings". The Japanese translation (largest as of writing) has just a few strings which increase by this metric. However, the amount of loss due to expansion in those cases is outweighed by the cost of adding 1 bit per string to indicate whether it's compressed or not. For instance, in the BOARD=trinket_m0 TRANSLATION=ja build the loss is 47 bytes over 300 strings. Adding 1 bit to each of 300 strings will cost about 37 bytes, leaving just 5 Thumb instructions to implement the code to check and decode "uncompressed" strings in order to break even. --- py/makeqstrdata.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index df2c687e5c..6132298a51 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -259,8 +259,6 @@ def compress(encoding_table, decompressed, encoded_length_bits, len_translation_ current_bit -= 1 if current_bit != 7: current_byte += 1 - if current_byte > len(decompressed): - print("Note: compression increased length", repr(decompressed), len(decompressed), current_byte, file=sys.stderr) return enc[:current_byte] def qstr_escape(qst): From 880fe1a6942a6e37a0e11b86b5773682cfa280fb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 16 Aug 2020 20:58:24 -0500 Subject: [PATCH 0618/1293] gen_display_resources: silence 'missing character' message Since we made the decision to allow translations which do not have coverage in the terminal font, these routinely occur and are expected. The message is unhelpful and due to their voume make it harder to find relevant information particularly in github actions results. --- tools/gen_display_resources.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/gen_display_resources.py b/tools/gen_display_resources.py index 478a2f22f9..e4197aabf4 100644 --- a/tools/gen_display_resources.py +++ b/tools/gen_display_resources.py @@ -61,7 +61,6 @@ f.load_glyphs(set(ord(c) for c in all_characters)) # Get each glyph. for c in set(all_characters): if ord(c) not in f._glyphs: - print("Font missing character:", c, ord(c)) filtered_characters = filtered_characters.replace(c, "") continue g = f.get_glyph(ord(c)) From ead2554c78d698bf5e70a3afd33d1154885e60d5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 16 Aug 2020 21:17:41 -0500 Subject: [PATCH 0619/1293] mpy-cross: Silently clone when building for static-raspbian Also move the construct earlier. This prevents the message ``` make: pitools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc: Command not found ``` from occurring during the first build, since make was evaluating the line ``` mpy-cross.mk:COMPILER_TARGET := $(shell $(CC) -dumpmachine) ``` before $(CC) was created by the clone. Nothing bad seems to have come of this, but it's nice to fix it anyhow. (And interesting that it was lost among the spewed messages we're removing now) --- mpy-cross/Makefile.static-raspbian | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpy-cross/Makefile.static-raspbian b/mpy-cross/Makefile.static-raspbian index f895f998b5..6329ebdb56 100644 --- a/mpy-cross/Makefile.static-raspbian +++ b/mpy-cross/Makefile.static-raspbian @@ -6,7 +6,7 @@ PROG=mpy-cross.static-raspbian BUILD=build-static-raspbian STATIC_BUILD=1 +$(shell if ! [ -d pitools ]; then echo 1>&2 "Fetching pi build tools. This may take awhile."; git clone -q https://github.com/raspberrypi/tools.git --depth=1 pitools; fi) CROSS_COMPILE = pitools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- include mpy-cross.mk -$(shell [ -d pitools ] || git clone --progress --verbose https://github.com/raspberrypi/tools.git --depth=1 pitools) From b1d210cca728066a7ab0188ab76428e96b4e0ced Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 16 Aug 2020 21:33:36 -0500 Subject: [PATCH 0620/1293] remove trailing whitespace --- mpy-cross/Makefile.static-raspbian | 1 - 1 file changed, 1 deletion(-) diff --git a/mpy-cross/Makefile.static-raspbian b/mpy-cross/Makefile.static-raspbian index 6329ebdb56..8fe78b0aff 100644 --- a/mpy-cross/Makefile.static-raspbian +++ b/mpy-cross/Makefile.static-raspbian @@ -9,4 +9,3 @@ STATIC_BUILD=1 $(shell if ! [ -d pitools ]; then echo 1>&2 "Fetching pi build tools. This may take awhile."; git clone -q https://github.com/raspberrypi/tools.git --depth=1 pitools; fi) CROSS_COMPILE = pitools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- include mpy-cross.mk - From da48ab0568cc5c42996761fd2a09c5ac804b895c Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 16 Aug 2020 23:17:08 -0400 Subject: [PATCH 0621/1293] add generic services --- devices/ble_hci/common-hal/_bleio/Adapter.c | 138 +++++++++++++++++--- devices/ble_hci/common-hal/_bleio/Adapter.h | 6 + 2 files changed, 128 insertions(+), 16 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index b197659ac2..e2296bb2aa 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -74,6 +74,114 @@ bleio_connection_internal_t bleio_connections[BLEIO_TOTAL_CONNECTION_COUNT]; +STATIC void add_generic_services(bleio_adapter_obj_t *adapter) { + // Create Generic Access UUID, Service, and Characteristics. + + // Generic Access Service setup. + + bleio_uuid_obj_t *generic_access_service_uuid = m_new_obj(bleio_uuid_obj_t); + generic_access_service_uuid->base.type = &bleio_uuid_type; + common_hal_bleio_uuid_construct(generic_access_service_uuid, 0x1800, NULL); + + bleio_uuid_obj_t *device_name_characteristic_uuid = m_new_obj(bleio_uuid_obj_t); + device_name_characteristic_uuid->base.type = &bleio_uuid_type; + common_hal_bleio_uuid_construct(device_name_characteristic_uuid, 0x2A00, NULL); + + bleio_uuid_obj_t *appearance_characteristic_uuid = m_new_obj(bleio_uuid_obj_t); + appearance_characteristic_uuid->base.type = &bleio_uuid_type; + common_hal_bleio_uuid_construct(appearance_characteristic_uuid, 0x2A01, NULL); + + // Not implemented: + // Peripheral Preferred Connection Parameters + // Central Address Resolution + + bleio_service_obj_t *generic_access_service = m_new_obj(bleio_service_obj_t); + generic_access_service->base.type = &bleio_service_type; + common_hal_bleio_service_construct(generic_access_service, generic_access_service_uuid, false); + + adapter->device_name_characteristic = m_new_obj(bleio_characteristic_obj_t); + adapter->device_name_characteristic->base.type = &bleio_characteristic_type; + + char generic_name[] = { 'C', 'I', 'R', 'C', 'U', 'I', 'T', 'P', 'Y', 'n', 'n', 'n', 'n' }; + mp_buffer_info_t generic_name_bufinfo = { + .buf = generic_name, + .len = sizeof(generic_name), + }; + + // Will be added to service by constructor. + common_hal_bleio_characteristic_construct( + adapter->device_name_characteristic, + generic_access_service, + BLE_GATT_HANDLE_INVALID, + device_name_characteristic_uuid, + CHAR_PROP_READ, + SECURITY_MODE_OPEN, + SECURITY_MODE_NO_ACCESS, + 248, // max length, from Bluetooth spec + false, // not fixed length + &generic_name_bufinfo + ); + + uint16_t zero_16 = 0; + mp_buffer_info_t zero_16_value = { + .buf = &zero_16, + .len = sizeof(zero_16), + }; + + adapter->appearance_characteristic = m_new_obj(bleio_characteristic_obj_t); + adapter->appearance_characteristic->base.type = &bleio_characteristic_type; + + common_hal_bleio_characteristic_construct( + adapter->appearance_characteristic, + generic_access_service, + BLE_GATT_HANDLE_INVALID, + appearance_characteristic_uuid, + CHAR_PROP_READ, + SECURITY_MODE_OPEN, + SECURITY_MODE_NO_ACCESS, + 2, // max length, from Bluetooth spec + true, // fixed length + &zero_16_value + ); + + // Generic Attribute Service setup. + + bleio_uuid_obj_t *generic_attribute_service_uuid = m_new_obj(bleio_uuid_obj_t); + generic_attribute_service_uuid->base.type = &bleio_uuid_type; + common_hal_bleio_uuid_construct(generic_attribute_service_uuid, 0x1801, NULL); + + bleio_uuid_obj_t *service_changed_characteristic_uuid = m_new_obj(bleio_uuid_obj_t); + service_changed_characteristic_uuid->base.type = &bleio_uuid_type; + common_hal_bleio_uuid_construct(service_changed_characteristic_uuid, 0x2A05, NULL); + + bleio_service_obj_t *generic_attribute_service = m_new_obj(bleio_service_obj_t); + generic_attribute_service->base.type = &bleio_service_type; + common_hal_bleio_service_construct(generic_attribute_service, generic_attribute_service_uuid, false); + + adapter->service_changed_characteristic = m_new_obj(bleio_characteristic_obj_t); + adapter->service_changed_characteristic->base.type = &bleio_characteristic_type; + + uint32_t zero_32 = 0; + mp_buffer_info_t zero_32_value = { + .buf = &zero_32, + .len = sizeof(zero_32), + }; + + common_hal_bleio_characteristic_construct( + adapter->service_changed_characteristic, + generic_attribute_service, + BLE_GATT_HANDLE_INVALID, + service_changed_characteristic_uuid, + CHAR_PROP_INDICATE, + SECURITY_MODE_OPEN, + SECURITY_MODE_NO_ACCESS, + 4, // max length, from Bluetooth spec + true, // fixed length + &zero_32_value + ); +} + + STATIC void check_enabled(bleio_adapter_obj_t *adapter) { if (!common_hal_bleio_adapter_get_enabled(adapter)) { mp_raise_bleio_BluetoothError(translate("Adapter not enabled")); @@ -163,10 +271,13 @@ STATIC void check_enabled(bleio_adapter_obj_t *adapter) { // return true; // } -char default_ble_name[] = { 'C', 'I', 'R', 'C', 'U', 'I', 'T', 'P', 'Y', 0, 0, 0, 0 , 0}; +char default_ble_name[] = { 'C', 'I', 'R', 'C', 'U', 'I', 'T', 'P', 'Y', 0, 0, 0, 0}; -STATIC void bleio_adapter_reset_name(bleio_adapter_obj_t *self) { - uint8_t len = sizeof(default_ble_name) - 1; +// Get various values and limits set by the adapter. +// Set event mask. +STATIC void bleio_adapter_hci_init(bleio_adapter_obj_t *self) { + + const size_t len = sizeof(default_ble_name); bt_addr_t addr; check_hci_error(hci_read_bd_addr(&addr)); @@ -175,14 +286,7 @@ STATIC void bleio_adapter_reset_name(bleio_adapter_obj_t *self) { default_ble_name[len - 3] = nibble_to_hex_lower[addr.val[1] & 0xf]; default_ble_name[len - 2] = nibble_to_hex_lower[addr.val[0] >> 4 & 0xf]; default_ble_name[len - 1] = nibble_to_hex_lower[addr.val[0] & 0xf]; - default_ble_name[len] = '\0'; // for now we add null for compatibility with C ASCIIZ strings - - common_hal_bleio_adapter_set_name(self, (char*) default_ble_name); -} - -// Get various values and limits set by the adapter. -// Set event mask. -STATIC void bleio_adapter_setup(bleio_adapter_obj_t *self) { + self->name = mp_obj_new_str(default_ble_name, len); // Get version information. if (hci_read_local_version(&self->hci_version, &self->hci_revision, &self->lmp_version, @@ -246,8 +350,8 @@ void common_hal_bleio_adapter_hci_uart_init(bleio_adapter_obj_t *self, busio_uar self->enabled = false; common_hal_bleio_adapter_set_enabled(self, true); - bleio_adapter_setup(self); - bleio_adapter_reset_name(self); + bleio_adapter_hci_init(self); + common_hal_bleio_adapter_set_name(self, default_ble_name); } void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enabled) { @@ -281,8 +385,7 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable // so store None there to skip it. self->attributes = mp_obj_new_list(0, NULL); bleio_adapter_add_attribute(self, mp_const_none); - self->last_added_service_handle = BLE_GATT_HANDLE_INVALID; - self->last_added_characteristic_handle = BLE_GATT_HANDLE_INVALID; + add_generic_services(self); } } @@ -309,6 +412,9 @@ mp_obj_str_t* common_hal_bleio_adapter_get_name(bleio_adapter_obj_t *self) { void common_hal_bleio_adapter_set_name(bleio_adapter_obj_t *self, const char* name) { self->name = mp_obj_new_str(name, strlen(name)); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(self->name, &bufinfo, MP_BUFFER_READ); + bleio_characteristic_set_local_value(self->device_name_characteristic, &bufinfo); } @@ -637,7 +743,7 @@ uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, check_hci_error(hci_le_set_advertising_data(advertising_data_len, full_data)); memset(full_data, 0, sizeof(full_data)); if (scan_response_data_len > 0) { - memcpy(full_data, advertising_data, MIN(sizeof(full_data), scan_response_data_len)); + memcpy(full_data, scan_response_data, MIN(sizeof(full_data), scan_response_data_len)); check_hci_error(hci_le_set_scan_response_data(scan_response_data_len, full_data)); } diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.h b/devices/ble_hci/common-hal/_bleio/Adapter.h index a6a78f67e7..f8748e5be1 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.h +++ b/devices/ble_hci/common-hal/_bleio/Adapter.h @@ -32,6 +32,7 @@ #include "py/obj.h" #include "py/objtuple.h" +#include "shared-bindings/_bleio/Characteristic.h" #include "shared-bindings/_bleio/Connection.h" #include "shared-bindings/_bleio/ScanResults.h" #include "shared-bindings/busio/UART.h" @@ -67,6 +68,11 @@ typedef struct _bleio_adapter_obj_t { uint64_t advertising_start_ticks; uint64_t advertising_timeout_msecs; // If zero, do not check. + // Generic services characteristics. + bleio_characteristic_obj_t *device_name_characteristic; + bleio_characteristic_obj_t *appearance_characteristic; + bleio_characteristic_obj_t * service_changed_characteristic; + uint16_t max_acl_buffer_len; uint16_t max_acl_num_buffers; uint16_t max_adv_data_len; From 16ff7b167c6431d60084373ba756db80bf2f3665 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 17 Aug 2020 10:05:25 -0400 Subject: [PATCH 0622/1293] bdmicro_vina_m0: inline limit 60 -> 50 The ja translation was not fitting. --- ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk b/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk index a36966b87c..b7ad47ff2c 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk @@ -15,5 +15,5 @@ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 -CFLAGS_INLINE_LIMIT = 60 +CFLAGS_INLINE_LIMIT = 50 SUPEROPT_GC = 0 From d0d6a951da9ef39f68a0d118db6c22c7e4ec9b2b Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 17 Aug 2020 10:10:49 -0400 Subject: [PATCH 0623/1293] Translations --- locale/circuitpython.pot | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index a1b286e2ed..b98e0e2132 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 09:36-0400\n" +"POT-Creation-Date: 2020-08-17 10:10-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -744,7 +744,7 @@ msgstr "" #: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c #: shared-bindings/microcontroller/Pin.c -#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" msgstr "" @@ -1328,6 +1328,15 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. " +"Construct and pass a PWM Carrier instead" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1340,6 +1349,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" From 1ccd2e234f336872b646ba978ac139dcdc7dc84f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 17 Aug 2020 10:48:23 -0500 Subject: [PATCH 0624/1293] allocate_display_bus: fix bug where in-use bus would be returned --- shared-module/displayio/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index 5afcba35ec..8049be5b47 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -398,7 +398,7 @@ primary_display_t *allocate_display_or_raise(void) { } primary_display_t *allocate_display_bus(void) { for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { - mp_const_obj_t display_type = displays[i].display.base.type; + mp_const_obj_t display_type = displays[i].bus_base.type; if (display_type == NULL || display_type == &mp_type_NoneType) { return &displays[i]; } From ec3d99950e9d0a1da3b108a65fadcb703d392687 Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Sun, 16 Aug 2020 08:40:12 +0000 Subject: [PATCH 0625/1293] Translated using Weblate (Japanese) Currently translated at 57.6% (447 of 776 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ja/ --- locale/ja.po | 445 +++++++++++++++++++++++++-------------------------- 1 file changed, 216 insertions(+), 229 deletions(-) diff --git a/locale/ja.po b/locale/ja.po index 4b4ec0833b..4dba019197 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-08-14 09:36-0400\n" -"PO-Revision-Date: 2020-08-10 16:59+0000\n" +"PO-Revision-Date: 2020-08-16 13:25+0000\n" "Last-Translator: Taku Fukada \n" "Language-Team: none\n" "Language: ja\n" @@ -59,7 +59,7 @@ msgstr " 出力:\n" #: py/objstr.c #, c-format msgid "%%c requires int or char" -msgstr "%%c にはintまたはcharが必要です" +msgstr "%%c にはintまたはcharが必要" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -72,7 +72,7 @@ msgstr "" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" -msgstr "%q は使用中です" +msgstr "%qは使用中" #: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -80,11 +80,11 @@ msgstr "%q は使用中です" #: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c #: py/objstrunicode.c msgid "%q index out of range" -msgstr "%q インデックスは範囲外です" +msgstr "%q インデックスは範囲外" #: py/obj.c msgid "%q indices must be integers, not %q" -msgstr "%q インデクスは、%qでなく整数でなければなりません" +msgstr "%qインデクスは、%qでなく整数が必要です" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -108,58 +108,56 @@ msgstr "%qは長さ2のタプルでなければなりません" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q pin invalid" -msgstr "%q ピンは無効です" +msgstr "%q ピンは無効" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" -msgstr "%qはint型でなければなりません" +msgstr "%qはint型が必要" #: py/bc.c py/objnamedtuple.c #, fuzzy msgid "%q() takes %d positional arguments but %d were given" -msgstr "" -"%q() は %d個の位置引数 (positional arguments) を受け取りますが、%d 個しか与え" -"られていません" +msgstr "%q()は%d個の位置引数を受け取りますが、%d個しか与えられていません" #: py/argcheck.c msgid "'%q' argument required" -msgstr "引数 '%q' が必要です" +msgstr "引数'%q'が必要" #: py/runtime.c msgid "'%q' object cannot assign attribute '%q'" -msgstr "オブジェクト '%q' には属性 '%q' を割り当てられません" +msgstr "オブジェクト'%q'に属性'%q'を割り当てられません" #: py/proto.c msgid "'%q' object does not support '%q'" -msgstr "オブジェクト '%q' は '%q' をサポートしていません" +msgstr "オブジェクト'%q'は'%q'をサポートしていません" #: py/obj.c msgid "'%q' object does not support item assignment" -msgstr "オブジェクト '%q' は要素の代入をサポートしていません" +msgstr "オブジェクト'%q'は要素の代入をサポートしていません" #: py/obj.c msgid "'%q' object does not support item deletion" -msgstr "オブジェクト '%q' は要素の削除をサポートしていません" +msgstr "オブジェクト'%q'は要素の削除をサポートしていません" #: py/runtime.c msgid "'%q' object has no attribute '%q'" -msgstr "オブジェクト '%q' は属性 '%q' を持ちません" +msgstr "オブジェクト'%q'に属性'%q'はありません" #: py/runtime.c msgid "'%q' object is not an iterator" -msgstr "オブジェクト '%q' はイテレータではありません" +msgstr "オブジェクト'%q'はイテレータではありません" #: py/objtype.c py/runtime.c msgid "'%q' object is not callable" -msgstr "オブジェクト '%q' は呼び出し可能ではありません" +msgstr "オブジェクト'%q'は呼び出し可能ではありません" #: py/runtime.c msgid "'%q' object is not iterable" -msgstr "オブジェクト '%q' はイテレート可能ではありません" +msgstr "オブジェクト'%q'はイテレート可能ではありません" #: py/obj.c msgid "'%q' object is not subscriptable" -msgstr "オブジェクト '%q' は要素の取得ができません" +msgstr "オブジェクト'%q'は要素の取得ができません" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -225,11 +223,11 @@ msgstr "" #: py/compile.c msgid "'await' outside function" -msgstr "関数外での 'await'" +msgstr "関数外でのawait" #: py/compile.c msgid "'await', 'async for' or 'async with' outside async function" -msgstr "async関数外での 'await', 'async for', 'async with'" +msgstr "async関数外でのawait, async for, async with" #: py/compile.c msgid "'break' outside loop" @@ -277,12 +275,12 @@ msgstr "" #: py/modbuiltins.c msgid "3-arg pow() not supported" -msgstr "引数3つの pow() はサポートされていません" +msgstr "引数3つのpow()はサポートされていません" #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" -msgstr "ハードウェア割り込みチャネルは使用中です" +msgstr "ハードウェア割り込みチャネルは使用中" #: shared-bindings/_bleio/Address.c #, c-format @@ -295,27 +293,27 @@ msgstr "" #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" -msgstr "すべてのI2C周辺機器が使用中です" +msgstr "全てのI2C周辺機器が使用中" #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" -msgstr "すべてのSPI周辺機器が使用中です" +msgstr "全てのSPI周辺機器が使用中" #: ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" -msgstr "すべてのUART周辺機器が使用中です" +msgstr "全てのUART周辺機器が使用中" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "All event channels in use" -msgstr "すべてのイベントチャネルが使用中です" +msgstr "全てのイベントチャネルが使用中" #: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "All sync event channels in use" -msgstr "すべての同期イベントチャネルが使用中です" +msgstr "全ての同期イベントチャネルが使用中" #: shared-bindings/pulseio/PWMOut.c msgid "All timers for this pin are in use" -msgstr "このピン用のすべてのタイマが使用中です" +msgstr "このピン用の全てのタイマが使用中" #: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -327,16 +325,16 @@ msgstr "このピン用のすべてのタイマが使用中です" #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c msgid "All timers in use" -msgstr "すべてのタイマーが使用中です" +msgstr "全てのタイマーが使用中" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." -msgstr "すでにアドバータイズ中です。" +msgstr "すでにアドバータイズ中" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" -msgstr "すでに実行中です" +msgstr "すでに実行中" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -350,7 +348,7 @@ msgstr "AnalogOut機能はサポートされていません" #: shared-bindings/analogio/AnalogOut.c msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOutは16ビットです。値は 65536 以下でなければなりません。" +msgstr "AnalogOutは16ビットです。値は65536以下にしてください" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c msgid "AnalogOut not supported on given pin" @@ -359,7 +357,7 @@ msgstr "指定のピンはAnalogOutをサポートしていません" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c msgid "Another send is already active" -msgstr "他のsendがすでにアクティブです" +msgstr "他のsendがすでにアクティブ" #: shared-bindings/pulseio/PulseOut.c msgid "Array must contain halfwords (type 'H')" @@ -367,7 +365,7 @@ msgstr "array のタイプは16ビット ('H') でなければなりません" #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." -msgstr "Arrayの各値は1バイトでなければなりません。" +msgstr "Arrayの各値は1バイトでなければなりません" #: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" @@ -380,7 +378,7 @@ msgstr "%d 個のブロックの確保を試みました" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." -msgstr "MicroPython VMの非実行時にヒープの確保を試みました。" +msgstr "MicroPython VMの非実行時にヒープの確保を試みました" #: main.c msgid "Auto-reload is off.\n" @@ -390,14 +388,12 @@ msgstr "オートリロードはオフです。\n" msgid "" "Auto-reload is on. Simply save files over USB to run them or enter REPL to " "disable.\n" -msgstr "" -"オートリロードが有効です。ファイルをUSB経由で保存するだけで実行できます。REPL" -"に入ると無効化します。\n" +msgstr "オートリロードがオンです。ファイルをUSB経由で保存するだけで実行できます。REPLに入ると無効化します。\n" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" -msgstr "最低のフレームレート未満です" +msgstr "最低のフレームレート未満" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" @@ -405,15 +401,15 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." -msgstr "ビット深度は8の倍数でなければなりません。" +msgstr "ビット深度は8の倍数でなければなりません" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "RXとTXの両方がフロー制御のために必要です" +msgstr "フロー制御のためにRXとTXの両方が必要" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" -msgstr "両方のピンがハードウェア割り込みをサポートしなければなりません" +msgstr "両方のピンにハードウェア割り込み対応が必要" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c @@ -438,12 +434,12 @@ msgstr "" #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." -msgstr "バッファサイズが正しくありません。%dバイトでなければなりません。" +msgstr "バッファサイズが正しくありません。%dバイトでなければなりません" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "バッファが bytearray ではありません。" +msgstr "バッファが bytearray ではありません" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c @@ -453,7 +449,7 @@ msgstr "バッファが小さすぎます" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "バッファ長 %d は大きすぎます。%d 以下でなければなりません" +msgstr "バッファ長%dは大きすぎます。%d以下でなければなりません" #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c @@ -481,15 +477,15 @@ msgstr "" #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" -msgstr "Busピン %d はすでに使用中です" +msgstr "Busピン%dはすでに使用中" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." -msgstr "バイトバッファは16バイトでなければなりません。" +msgstr "バッファは16バイトにしてください" #: shared-bindings/nvm/ByteArray.c msgid "Bytes must be between 0 and 255." -msgstr "バイト値は0から255の間でなければなりません。" +msgstr "バイト値は0から255の間でなければなりません" #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" @@ -497,9 +493,7 @@ msgstr "CBCブロックは16バイトの整数倍でなければなりません" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "" -"ネイティブオブジェクトにアクセスする前に super().__init__() を呼び出してくだ" -"さい。" +msgstr "ネイティブオブジェクトにアクセスする前にsuper().__init__()を呼び出してください" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" @@ -527,11 +521,11 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" -msgstr "同じピン上の両方のチャネルに出力できません" +msgstr "同じピン上の両チャネルに出力できません" #: shared-module/bitbangio/SPI.c msgid "Cannot read without MISO pin." -msgstr "MISOピンなしで読み込みはできません。" +msgstr "MISOピンなしで読み込みはできません" #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" @@ -539,17 +533,17 @@ msgstr "ファイルへ記録できません" #: shared-module/storage/__init__.c msgid "Cannot remount '/' when USB is active." -msgstr "USBがアクティブな時に '/' を再マウントできません。" +msgstr "USBがアクティブな時に '/' を再マウントできません" #: 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 "ブートローダが存在しないためブートローダへとリセットできません" #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." -msgstr "方向がINPUTのときは値を設定できません。" +msgstr "方向がINPUTのときは値を設定できません" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" @@ -561,7 +555,7 @@ msgstr "sliceをサブクラス化することはできません" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins." -msgstr "MOSIピンとMISOピンがなければ転送できません。" +msgstr "MOSIピンとMISOピンなしに転送できません" #: extmod/moductypes.c msgid "Cannot unambiguously get sizeof scalar" @@ -573,7 +567,7 @@ msgstr "使用中のタイマー上で周波数を変えられません" #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." -msgstr "MOSIピンなしに書き込みできません。" +msgstr "MOSIピンなしに書き込みできません" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -593,7 +587,7 @@ msgstr "" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." -msgstr "クロックピンの初期化に失敗しました。" +msgstr "クロックピンの初期化に失敗" #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" @@ -601,7 +595,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Clock unit in use" -msgstr "クロックユニットが使用中です" +msgstr "クロックユニットは使用中" #: shared-bindings/_pew/PewPew.c msgid "Column entry must be digitalio.DigitalInOut" @@ -616,7 +610,7 @@ msgstr "commandは0から255の間の整数でなければなりません" msgid "" "Connection has been disconnected and can no longer be used. Create a new " "connection." -msgstr "接続は切断済みのためもう使えません。新たな接続を作成してください。" +msgstr "接続は切断済みのためもう使えません。新たな接続を作成してください" #: py/persistentcode.c msgid "Corrupt .mpy file" @@ -628,35 +622,35 @@ msgstr "破損した raw code" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" -msgstr "GNSSを初期化できませんでした" +msgstr "GNSSを初期化できません" #: ports/cxd56/common-hal/sdioio/SDCard.c msgid "Could not initialize SDCard" -msgstr "SDカードを初期化できませんでした" +msgstr "SDカードを初期化できません" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" -msgstr "UARTを初期化できませんでした" +msgstr "UARTを初期化できません" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize channel" -msgstr "チャネルを初期化できませんでした" +msgstr "チャネルを初期化できません" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize timer" -msgstr "タイマーを初期化できませんでした" +msgstr "タイマーを初期化できません" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init channel" -msgstr "チャネルを再初期化できませんでした" +msgstr "チャネルを再初期化できません" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init timer" -msgstr "タイマーを再初期化できませんでした" +msgstr "タイマーを再初期化できません" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not restart PWM" -msgstr "PWMを再スタートできませんでした" +msgstr "PWMを再スタートできません" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" @@ -664,33 +658,33 @@ msgstr "" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" -msgstr "PWMをスタートできませんでした" +msgstr "PWMをスタートできません" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" -msgstr "割り込みをスタートできませんでした。RXビジー" +msgstr "割り込みをスタートできません。RXビジー" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" -msgstr "デコーダを確保できませんでした" +msgstr "デコーダを確保できません" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate first buffer" -msgstr "1つ目のバッファを確保できませんでした" +msgstr "1つ目のバッファを確保できません" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate input buffer" -msgstr "入力バッファを確保できませんでした" +msgstr "入力バッファを確保できません" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate second buffer" -msgstr "2つ目のバッファを確保できませんでした" +msgstr "2つ目のバッファを確保できません" #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." -msgstr "クラッシュして HardFault_Handler に入りました。" +msgstr "クラッシュしてHardFault_Handlerに入りました" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" @@ -702,7 +696,7 @@ msgstr "DACデバイス初期化エラー" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" -msgstr "DACはすでに使用中です" +msgstr "DACはすでに使用中" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -732,17 +726,17 @@ msgstr "指定されたピンはDigitalInOutをサポートしていません" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." -msgstr "ディスプレイは16ビット色空間を持たなければなりません。" +msgstr "ディスプレイには16ビット色空間が必要" #: 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 "ディスプレイの回転は90度の整数倍でなければなりません" +msgstr "ディスプレイの回転は90度の倍数でなければなりません" #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." -msgstr "方向がINPUTのときドライブモードは使われません。" +msgstr "方向がINPUTのときドライブモードは使われません" #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" @@ -799,16 +793,16 @@ msgstr "FFTは ndarray に対してのみ定義されています" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." -msgstr "コマンドの送信に失敗しました。" +msgstr "コマンドの送信に失敗" #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to acquire mutex, err 0x%04x" -msgstr "ミューテックスの取得に失敗しました。エラー 0x%04x" +msgstr "ミューテックスの取得に失敗。エラー 0x%04x" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" -msgstr "RXバッファの確保に失敗しました" +msgstr "RXバッファの確保に失敗" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -817,7 +811,7 @@ msgstr "RXバッファの確保に失敗しました" #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" -msgstr "%d バイトのRXバッファの確保に失敗しました" +msgstr "%d バイトのRXバッファの確保に失敗" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" @@ -829,20 +823,20 @@ msgstr "接続失敗: タイムアウト" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" -msgstr "MP3ファイルのパーズに失敗しました" +msgstr "MP3ファイルのパーズに失敗" #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" -msgstr "ミューテックスの開放に失敗しました。エラー 0x%04x" +msgstr "ミューテックスの開放に失敗。エラー 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "内部フラッシュの書き込みに失敗しました。" +msgstr "内部フラッシュの書き込みに失敗" #: py/moduerrno.c msgid "File exists" -msgstr "ファイルが存在します。" +msgstr "ファイルが存在します" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format @@ -855,8 +849,7 @@ msgstr "" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" -msgstr "" -"周波数は、このタイマーを使っている既存のPWMOutと一致しなければなりません" +msgstr "このタイマーを使う既存のPWMOutと周波数を一致させてください" #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c @@ -867,11 +860,11 @@ msgstr "" #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" -msgstr "グループは既に使われています" +msgstr "グループはすでに使われています" #: shared-module/displayio/Group.c msgid "Group full" -msgstr "グループが一杯です" +msgstr "グループが一杯" #: 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/sdioio/SDCard.c @@ -904,8 +897,7 @@ msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" -"非互換の .mpy ファイルです。すべての .mpy ファイルをアップデートしてくださ" -"い。詳細は http://adafru.it/mpy-update を参照。" +"非互換の.mpyファイルです。全ての.mpyファイルをアップデートしてください。詳細は http://adafru.it/mpy-update を参照" #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" @@ -917,11 +909,11 @@ msgstr "入力/出力エラー" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" -msgstr "認証が不十分です" +msgstr "認証が不十分" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" -msgstr "暗号化が不十分です" +msgstr "暗号化が不十分" #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" @@ -939,7 +931,7 @@ msgstr "不正な %q" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" -msgstr "不正な %q ピン" +msgstr "不正な%qピン" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c #: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c @@ -962,7 +954,7 @@ msgstr "無効なDACピンが与えられました" #: ports/cxd56/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c msgid "Invalid PWM frequency" -msgstr "無効なPWM周波数です" +msgstr "無効なPWM周波数" #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" @@ -970,7 +962,7 @@ msgstr "不正な引数" #: shared-module/displayio/Bitmap.c msgid "Invalid bits per value" -msgstr "値ごとのビット数が不正です" +msgstr "値ごとのビット数が不正" #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" @@ -982,7 +974,7 @@ msgstr "不正なバイトオーダー文字列" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "不正なキャプチャ周期。有効な周期: 1 - 500" +msgstr "不正なキャプチャ周期。有効な周期は1 - 500" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid channel count" @@ -990,7 +982,7 @@ msgstr "不正なチャンネル数" #: shared-bindings/digitalio/DigitalInOut.c msgid "Invalid direction." -msgstr "不正な方向。" +msgstr "不正な方向" #: shared-module/audiocore/WaveFile.c msgid "Invalid file" @@ -998,7 +990,7 @@ msgstr "不正なファイル" #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" -msgstr "フォーマットチャンクのサイズが不正です" +msgstr "フォーマットチャンクのサイズが不正" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid frequency supplied" @@ -1006,7 +998,7 @@ msgstr "不正な周波数が与えられました" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "不正なメモリアクセスです。" +msgstr "不正なメモリアクセス" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid number of bits" @@ -1025,11 +1017,11 @@ msgstr "不正なピン" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Invalid pin for left channel" -msgstr "左チャネルのピンが不正です" +msgstr "左チャネルのピンが不正" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Invalid pin for right channel" -msgstr "右チャネルのピンが不正です" +msgstr "右チャネルのピンが不正" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c @@ -1041,11 +1033,11 @@ msgstr "右チャネルのピンが不正です" #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" -msgstr "ピンが不正です" +msgstr "ピンが不正" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid pins for PWMOut" -msgstr "PWMOutのピンが不正です" +msgstr "PWMOutのピンが不正" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c @@ -1074,7 +1066,7 @@ msgstr "不正なボイス数" #: shared-module/audiocore/WaveFile.c msgid "Invalid wave file" -msgstr "不正なWaveファイルです" +msgstr "不正なWaveファイル" #: ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" @@ -1086,19 +1078,19 @@ msgstr "Keyの長さは、16, 24, 32バイトのいずれかでなければな #: py/compile.c msgid "LHS of keyword arg must be an id" -msgstr "キーワード引数の左辺はidです" +msgstr "キーワード引数の左辺には識別子が必要" #: shared-module/displayio/Group.c msgid "Layer already in a group." -msgstr "レイヤーはすでにグループに含まれています。" +msgstr "レイヤーはすでにグループに含まれています" #: shared-module/displayio/Group.c msgid "Layer must be a Group or TileGrid subclass." -msgstr "レイヤーはGroupかTileGridのサブクラスでなければなりません。" +msgstr "レイヤーはGroupかTileGridのサブクラスでなければなりません" #: py/objslice.c msgid "Length must be an int" -msgstr "Lengthはint型でなければなりません" +msgstr "長さには整数が必要" #: py/objslice.c msgid "Length must be non-negative" @@ -1106,11 +1098,11 @@ msgstr "Lengthは非負数でなければなりません" #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." -msgstr "MISOピンの初期化に失敗しました。" +msgstr "MISOピンの初期化に失敗" #: shared-module/bitbangio/SPI.c msgid "MOSI pin init failed." -msgstr "MOSIピンの初期化に失敗しました。" +msgstr "MOSIピンの初期化に失敗" #: shared-module/displayio/Shape.c #, c-format @@ -1119,11 +1111,11 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." -msgstr "MicroPythonのNLRジャンプに失敗しました。メモリ破壊かもしれません。" +msgstr "MicroPythonのNLRジャンプに失敗。メモリ破壊の可能性あり" #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error." -msgstr "MicroPythonの致命的エラーです。" +msgstr "MicroPythonの致命的エラー" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -1135,20 +1127,20 @@ msgstr "MISOまたはMOSIピンがありません" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." -msgstr "%q のサブクラスでなければなりません。" +msgstr "%q のサブクラスでなければなりません" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" -msgstr "MISOピンまたはMOSIピンが必要です" +msgstr "MISOピンまたはMOSIピンが必要" #: ports/stm/common-hal/busio/SPI.c msgid "Must provide SCK pin" -msgstr "SCKピンが必要です" +msgstr "SCKピンが必要" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" -msgstr "%d個でなく、6の倍数個のrgbピンを使わなければなりません" +msgstr "%d個でなく6の倍数個のrgbピンを使ってください" #: py/parse.c msgid "Name too long" @@ -1210,7 +1202,7 @@ msgstr "ハードウェア乱数が利用できません" #: ports/atmel-samd/common-hal/ps2io/Ps2.c msgid "No hardware support on clk pin" -msgstr "clkピン上のハードウェアサポートがありません" +msgstr "clkピン上にハードウェアサポートがありません" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -1223,11 +1215,11 @@ msgstr "キーが指定されていません" #: shared-bindings/time/__init__.c msgid "No long integer support" -msgstr "long integer はサポートされていません" +msgstr "long integerサポートがありません" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." -msgstr "このピンには利用可能なタイマーがもうありません。" +msgstr "このピンに利用可能なタイマーがもうありません" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" @@ -1243,7 +1235,7 @@ msgstr "指定されたファイル/ディレクトリはありません" #: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" -msgstr "タイマーが利用できません" +msgstr "利用できるタイマーなし" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." @@ -1257,7 +1249,7 @@ msgstr "接続されていません" #: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c #: shared-bindings/audiopwmio/PWMAudioOut.c msgid "Not playing" -msgstr "再生中ではありません" +msgstr "再生中していません" #: main.c msgid "Not running saved code.\n" @@ -1266,9 +1258,7 @@ msgstr "保存されたコードは実行していません。\n" #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." -msgstr "" -"オブジェクトは解体済みでもう使われていません。新たなオブジェクトを作成してく" -"ださい。" +msgstr "オブジェクトは解体済みでもう使われていません。新たなオブジェクトを作成してください" #: ports/nrf/common-hal/busio/UART.c msgid "Odd parity is not supported" @@ -1276,7 +1266,7 @@ msgstr "奇数パリティはサポートされていません" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " -msgstr "8または16ビットの " +msgstr "8または16ビットの" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1293,7 +1283,7 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." -msgstr "オーバーサンプルは8の倍数でなければなりません。" +msgstr "オーバーサンプルは8の倍数でなければなりません" #: shared-bindings/pulseio/PWMOut.c msgid "" @@ -1304,9 +1294,7 @@ msgstr "" #: shared-bindings/pulseio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." -msgstr "" -"PWM周波数は、生成時の variable_frequency が False の場合、書き換えられませ" -"ん。" +msgstr "PWM周波数は、生成時のvariable_frequencyがFalseのとき書き換え不可" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c @@ -1327,7 +1315,7 @@ msgstr "ピンにADCの能力がありません" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pin is input only" -msgstr "ピンは入力専用です" +msgstr "ピンは入力専用" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" @@ -1351,7 +1339,7 @@ msgstr "" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" -msgstr "ポリゴンには少なくとも3つの点が必要です" +msgstr "ポリゴンには少なくとも3つの点が必要" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" @@ -1360,11 +1348,11 @@ msgstr "Prefixバッファはヒープ上になければなりません" #: main.c #, fuzzy msgid "Press any key to enter the REPL. Use CTRL-D to reload." -msgstr "何らかのキーを押すとREPLに入ります。CTRL-Dでリロードします。" +msgstr "何らかのキーを押すとREPLに入ります。CTRL-Dでリロードします" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." -msgstr "出力方向がOutputのときPullは使われません。" +msgstr "方向がoutputのときpullは使われません" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" @@ -1381,7 +1369,7 @@ msgstr "" #: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c #: ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" -msgstr "RTCのキャリブレーションはこのボードではサポートされていません" +msgstr "このボードはRTCのキャリブレーションに非対応" #: shared-bindings/time/__init__.c msgid "RTC is not supported on this board" @@ -1390,7 +1378,7 @@ msgstr "このボードではRTCがサポートされていません" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "RTS/CTS/RS485 はまだこのデバイスでサポートされていません" +msgstr "RTS/CTS/RS485はこのデバイスでは未サポート" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" @@ -1411,15 +1399,15 @@ msgstr "読み込み専用のオブジェクト" #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" -msgstr "リフレッシュが早すぎです" +msgstr "リフレッシュが早すぎます" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" -msgstr "要求されたAESモードはサポートされていません" +msgstr "要求のAESモードは非サポート" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" -msgstr "右チャネルはサポートされていません" +msgstr "右チャネルは非サポート" #: shared-bindings/_pew/PewPew.c msgid "Row entry must be digitalio.DigitalInOut" @@ -1427,16 +1415,16 @@ msgstr "Rowの各要素は digitalio.DigitalInOut でなければなりません #: main.c msgid "Running in safe mode! " -msgstr "セーフモードで実行中です! " +msgstr "セーフモードで実行中! " #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" -msgstr "SDカードのCSDフォーマットはサポートされていません" +msgstr "SDカードのCSDフォーマットは非サポート" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" -msgstr "SDAとSCLはプルアップが必要です" +msgstr "SDAとSCLにプルアップが必要" #: ports/stm/common-hal/sdioio/SDCard.c #, c-format @@ -1463,15 +1451,15 @@ msgstr "サンプルレートは正数でなければなりません" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #, c-format msgid "Sample rate too high. It must be less than %d" -msgstr "サンプルレートが高すぎです。%d 以下でなければなりません" +msgstr "サンプルレートは%d以下でなければなりません" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." -msgstr "スキャンがすでに進行中です。stop_scanで停止してください。" +msgstr "スキャンはすでに進行中。stop_scanで停止してください" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" -msgstr "選択されたCTSピンが正しくありません" +msgstr "選択されたCTSピンが不正です" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected RTS pin not valid" @@ -1480,11 +1468,11 @@ msgstr "選択されたRTSピンが正しくありません" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Serializer in use" -msgstr "シリアライザは使用中です" +msgstr "シリアライザは使用中" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." -msgstr "スライスと値の長さが一致しません。" +msgstr "スライスと値の長さが一致しません" #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/TileGrid.c @@ -1503,7 +1491,7 @@ msgstr "" #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" -msgstr "スタックサイズは少なくとも256以上でなければなりません" +msgstr "スタックサイズは少なくとも256以上が必要" #: shared-bindings/multiterminal/__init__.c msgid "Stream missing readinto() or write() method." @@ -1511,7 +1499,7 @@ 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ピンが必要です" +msgstr "少なくとも1つのUARTピンが必要" #: shared-bindings/gnss/GNSS.c msgid "System entry must be gnss.SatelliteSystem" @@ -1550,7 +1538,7 @@ msgstr "" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" -msgstr "サンプルのビット数/サンプルがミキサーのそれと一致しません" +msgstr "サンプルのbits_per_sampleがミキサーのそれと一致しません" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's channel count does not match the mixer's" @@ -1562,7 +1550,7 @@ msgstr "" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's signedness does not match the mixer's" -msgstr "サンプルの符号の有無がミキサーのそれと一致しません" +msgstr "サンプルの符号有無がミキサーと一致しません" #: shared-bindings/displayio/TileGrid.c msgid "Tile height must exactly divide bitmap height" @@ -1570,11 +1558,11 @@ msgstr "タイルの高さはビットマップの高さを割り切れる値で #: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c msgid "Tile index out of bounds" -msgstr "タイルのインデクスが範囲外です" +msgstr "タイルのインデクスが範囲外" #: shared-bindings/displayio/TileGrid.c msgid "Tile value out of bounds" -msgstr "タイルの値が範囲外です" +msgstr "タイルの値が範囲外" #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" @@ -1583,7 +1571,7 @@ msgstr "タイルの幅はビットマップの幅を割り切れる値でなけ #: ports/nrf/common-hal/_bleio/Adapter.c #, c-format msgid "Timeout is too long: Maximum timeout length is %d seconds" -msgstr "タイムアウトが長すぎます。最大のタイムアウト長は %d 秒です" +msgstr "タイムアウトが長すぎ。最大のタイムアウト長は%d秒" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "" @@ -1592,7 +1580,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." -msgstr "サンプル中のチャンネル数が多すぎます。" +msgstr "サンプルのチャンネル数が多すぎます" #: shared-module/displayio/__init__.c msgid "Too many display busses" @@ -1654,7 +1642,7 @@ msgstr "" #: shared-bindings/_bleio/UUID.c msgid "UUID value is not str, int or byte buffer" -msgstr "UUIDの値が str, int, buffer のいずれでもありません" +msgstr "UUIDの値がstr, int, bufferのいずれでもありません" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -1681,11 +1669,11 @@ msgstr "カラーパレットのデータを読み込めません" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." -msgstr "nvm に書き込みできません。" +msgstr "nvm に書き込みできません" #: ports/nrf/common-hal/_bleio/UUID.c msgid "Unexpected nrfx uuid type" -msgstr "想定されていない nrfx UUID 型" +msgstr "想定されていないnrfx UUID型" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format @@ -1694,7 +1682,7 @@ msgstr "不明なGATTエラー: 0x%04x" #: supervisor/shared/safe_mode.c msgid "Unknown reason." -msgstr "理由不明。" +msgstr "理由不明" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format @@ -1736,7 +1724,7 @@ msgstr "" #: shared-bindings/digitalio/DigitalInOut.c msgid "Unsupported pull value." -msgstr "サポートされていない pull 値です。" +msgstr "サポートされていないpull値" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -1770,8 +1758,7 @@ msgstr "WatchDogTimerは現在動作していません" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" -msgstr "" -"WatchDogTimer.mode は一度 WatchDogMode.RESET に設定されると変更できません" +msgstr "WatchDogTimer.modeはいったんWatchDogMode.RESETに設定すると変更不可" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.timeout must be greater than 0" @@ -1891,7 +1878,7 @@ msgstr "axisは -1, 0, 1 のいずれかでなければなりません" #: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" -msgstr "axisは None, 0, 1 のいずれかでなければなりません" +msgstr "axisは None, 0, 1 のいずれかが必要です" #: py/builtinevex.c msgid "bad compile mode" @@ -1907,7 +1894,7 @@ msgstr "" #: py/binary.c msgid "bad typecode" -msgstr "typecodeが正しくありません" +msgstr "typecodeが不正" #: py/emitnative.c msgid "binary op %q not implemented" @@ -2090,7 +2077,7 @@ msgstr "" #: py/objtype.c msgid "cannot create instance" -msgstr "" +msgstr "インスタンスを作れません" #: py/runtime.c msgid "cannot import name %q" @@ -2256,7 +2243,7 @@ msgstr "" #: shared-bindings/displayio/Shape.c msgid "end_x should be an int" -msgstr "end_x は int でなければなりません" +msgstr "end_xは整数でなければなりません" #: ports/nrf/common-hal/busio/UART.c #, c-format @@ -2269,11 +2256,11 @@ msgstr "例外はBaseExceptionから派生していなければなりません" #: py/objstr.c msgid "expected ':' after format specifier" -msgstr "書式化指定子の後に ':' が必要です" +msgstr "書式化指定子の後に':'が必要" #: py/obj.c msgid "expected tuple/list" -msgstr "タプルまたはリストが必要です" +msgstr "タプルまたはリストが必要" #: py/modthread.c msgid "expecting a dict for keyword args" @@ -2281,23 +2268,23 @@ msgstr "" #: py/compile.c msgid "expecting an assembler instruction" -msgstr "アセンブラ命令が必要です" +msgstr "アセンブラ命令が必要" #: py/compile.c msgid "expecting just a value for set" -msgstr "" +msgstr "setには値のみが必要" #: py/compile.c msgid "expecting key:value for dict" -msgstr "dictには key:value が必要です" +msgstr "dictには key:value が必要" #: py/argcheck.c msgid "extra keyword arguments given" -msgstr "余計なキーワード引数が与えられました" +msgstr "余分なキーワード引数があります" #: py/argcheck.c msgid "extra positional arguments given" -msgstr "余分な位置引数 (positional arguments) が与えられました" +msgstr "余分な位置引数が与えられました" #: py/parse.c msgid "f-string expression part cannot include a '#'" @@ -2313,7 +2300,7 @@ msgstr "" #: py/parse.c msgid "f-string: expecting '}'" -msgstr "f-string: '}' が必要です" +msgstr "f-string: '}'が必要" #: py/parse.c msgid "f-string: single '}' is not allowed" @@ -2322,7 +2309,7 @@ msgstr "f-string: 1つだけの '}' は許されません" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" -msgstr "fileはバイトモードで開かれたファイルでなければなりません" +msgstr "fileにはバイトモードで開かれたファイルが必要" #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" @@ -2342,7 +2329,7 @@ msgstr "1つ目の引数はイテレート可能でなければなりません" #: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" -msgstr "1つ目の引数は ndarray でなければなりません" +msgstr "1つ目の引数にはndarrayが必要" #: py/objtype.c msgid "first argument to super() must be type" @@ -2401,11 +2388,11 @@ msgstr "" #: py/bc.c #, fuzzy msgid "function missing keyword-only argument" -msgstr "キーワード専用引数が不足しています" +msgstr "キーワード専用引数が足りません" #: py/bc.c msgid "function missing required keyword argument '%q'" -msgstr "必須のキーワード引数 '%q' が与えられていません" +msgstr "必須のキーワード引数'%q'が与えられていません" #: py/bc.c #, c-format @@ -2463,7 +2450,7 @@ msgstr "" #: py/obj.c msgid "index out of range" -msgstr "インデクスが範囲外です" +msgstr "インデクスが範囲外" #: py/obj.c msgid "indices must be integers" @@ -2496,7 +2483,7 @@ msgstr "" #: extmod/ulab/code/linalg/linalg.c msgid "input matrix is asymmetric" -msgstr "入力行列は非対称です" +msgstr "入力行列が非対称" #: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" @@ -2520,7 +2507,7 @@ msgstr "int() の2番目の引数は 2 以上 36 以下でなければなりま #: py/objstr.c msgid "integer required" -msgstr "整数が必要です" +msgstr "整数が必要" #: extmod/ulab/code/approx/approx.c msgid "interp is defined for 1D arrays of equal length" @@ -2569,7 +2556,7 @@ msgstr "不正な構文" #: py/parsenum.c msgid "invalid syntax for integer" -msgstr "整数の構文が不正です" +msgstr "整数の構文が不正" #: py/parsenum.c #, c-format @@ -2578,11 +2565,11 @@ msgstr "" #: py/parsenum.c msgid "invalid syntax for number" -msgstr "数字として不正な構文です" +msgstr "数字として不正な構文" #: py/objtype.c msgid "issubclass() arg 1 must be a class" -msgstr "issubclass() の1つ目の引数はクラスでなければなりません" +msgstr "issubclass()の1つ目の引数はクラスです" #: py/objtype.c msgid "issubclass() arg 2 must be a class or a tuple of classes" @@ -2614,7 +2601,7 @@ msgstr "" #: py/compile.c msgid "label redefined" -msgstr "ラベルが再定義されました" +msgstr "ラベルの再定義" #: py/stream.c msgid "length argument not allowed for this type" @@ -2642,11 +2629,11 @@ msgstr "" #: py/objint.c msgid "long int not supported in this build" -msgstr "long int はこのビルドではサポートされていません" +msgstr "このビルドはlong intをサポートしていません" #: py/parse.c msgid "malformed f-string" -msgstr "不正な形式のf-stringです" +msgstr "不正な形式のf-string" #: shared-bindings/_stage/Layer.c msgid "map buffer too small" @@ -2662,7 +2649,7 @@ msgstr "行列の次元が一致しません" #: extmod/ulab/code/linalg/linalg.c msgid "matrix is not positive definite" -msgstr "行列が正定値行列ではありません" +msgstr "正定値行列ではありません" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -2701,7 +2688,7 @@ msgstr "" #: py/objtype.c msgid "multiple inheritance not supported" -msgstr "複数継承はサポートされていません" +msgstr "複数継承は非サポート" #: py/emitnative.c msgid "must raise an object" @@ -2713,11 +2700,11 @@ msgstr "" #: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" -msgstr "nは0から9の間でなければなりません" +msgstr "nは0から9までです" #: py/runtime.c msgid "name '%q' is not defined" -msgstr "名前 '%q' は定義されていません" +msgstr "名前'%q'は定義されていません" #: py/runtime.c msgid "name not defined" @@ -2742,7 +2729,7 @@ msgstr "" #: py/objint_mpz.c py/runtime.c msgid "negative shift count" -msgstr "シフトカウントが負数です" +msgstr "シフトカウントが負数" #: shared-module/sdcardio/SDCard.c msgid "no SD card" @@ -2819,7 +2806,7 @@ msgstr "" #: py/obj.c msgid "object '%q' is not a tuple or list" -msgstr "オブジェクト '%q' がタプルでもリストでもありません" +msgstr "オブジェクト'%q'がタプルやリストでありません" #: py/obj.c msgid "object does not support item assignment" @@ -2843,7 +2830,7 @@ msgstr "オブジェクトはイテレータではありません" #: py/objtype.c py/runtime.c msgid "object not callable" -msgstr "オブジェクトは呼び出し可能ではありません" +msgstr "オブジェクトは呼び出し可能でありません" #: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" @@ -2851,7 +2838,7 @@ msgstr "" #: py/runtime.c msgid "object not iterable" -msgstr "" +msgstr "オブジェクトはイテレートできません" #: py/obj.c msgid "object of type '%q' has no len()" @@ -2863,7 +2850,7 @@ msgstr "" #: extmod/modubinascii.c msgid "odd-length string" -msgstr "奇数長の文字列です" +msgstr "奇数長の文字列" #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" @@ -2897,12 +2884,12 @@ msgstr "この演算は与えられた型をサポートしていません" #: py/modbuiltins.c msgid "ord expects a character" -msgstr "ord() は1文字を受け取ります" +msgstr "ord()は1文字を受け取ります" #: py/modbuiltins.c #, c-format msgid "ord() expected a character, but string of length %d found" -msgstr "ord() は1文字を要求しますが、長さ %d の文字列が与えられました" +msgstr "ord()は1文字を要求しますが、長さ %d の文字列が与えられました" #: py/objint_mpz.c msgid "overflow converting long int to machine word" @@ -2914,7 +2901,7 @@ msgstr "パレットの長さは32バイトでなければなりません" #: shared-bindings/displayio/Palette.c msgid "palette_index should be an int" -msgstr "palette_index は int でなければなりません" +msgstr "palette_indexは整数です" #: py/compile.c msgid "parameter annotation must be an identifier" @@ -2954,11 +2941,11 @@ msgstr "" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" -msgstr "pow() の3番目の引数は0にはできません" +msgstr "pow()の3つ目の引数は0にできません" #: py/objint_mpz.c msgid "pow() with 3 arguments requires integers" -msgstr "pow() の3番目の引数には整数が必要です" +msgstr "pow()の3番目の引数には整数が必要" #: extmod/modutimeq.c msgid "queue overflow" @@ -2979,7 +2966,7 @@ msgstr "相対インポート" #: py/obj.c #, c-format msgid "requested length %d but object has length %d" -msgstr "長さ %d が要求されていますがオブジェクトの長さは %d です" +msgstr "長さ%dが必要。オブジェクトの長さは%d" #: py/compile.c msgid "return annotation must be an identifier" @@ -2997,7 +2984,7 @@ msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "rgb_pins[%d] はクロックと同じポートではありません" +msgstr "rgb_pins[%d]はクロックと同じポートではありません" #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" @@ -3017,15 +3004,15 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" -msgstr "サンプリングレートが範囲外です" +msgstr "サンプリングレートが範囲外" #: py/modmicropython.c msgid "schedule stack full" -msgstr "スケジュールスタックが一杯です" +msgstr "スケジュールスタックが一杯" #: lib/utils/pyexec.c py/builtinimport.c msgid "script compilation not supported" -msgstr "スクリプトのコンパイルはサポートされていません" +msgstr "スクリプトのコンパイルは非サポート" #: extmod/ulab/code/ndarray.c msgid "shape must be a 2-tuple" @@ -3037,7 +3024,7 @@ msgstr "文字列フォーマット指定子で符号は使えません" #: py/objstr.c msgid "sign not allowed with integer format specifier 'c'" -msgstr "整数フォーマット指定子 'c' と共に符号は使えません" +msgstr "整数フォーマット指定子'c'で符号は使えません" #: py/objstr.c msgid "single '}' encountered in format string" @@ -3097,7 +3084,7 @@ msgstr "" #: shared-bindings/busio/UART.c msgid "stop must be 1 or 2" -msgstr "stop は1または2でなければなりません" +msgstr "stopは1または2でなければなりません" #: shared-bindings/random/__init__.c msgid "stop not reachable from start" @@ -3105,7 +3092,7 @@ msgstr "" #: py/stream.c msgid "stream operation not supported" -msgstr "ストリーム操作がサポートされていません" +msgstr "ストリーム操作はサポートされていません" #: py/objstrunicode.c msgid "string indices must be integers, not %q" @@ -3141,11 +3128,11 @@ msgstr "uctypedディスクリプタの構文エラー" #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" -msgstr "threshould は 0 から 65536 の範囲になければなりません" +msgstr "threshouldは0から65536までです" #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" -msgstr "time.struct_time() は 要素9個のシーケンスを受け取ります" +msgstr "time.struct_time()は9要素のシーケンスを受け取ります" #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -3157,11 +3144,11 @@ msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" -msgstr "timeout は 0.0 以上でなければなりません" +msgstr "timeoutは0.0以上が必要" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" -msgstr "v1カードの待機がタイムアウトしました" +msgstr "v1カードの待機がタイムアウト" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v2 card" @@ -3177,7 +3164,7 @@ msgstr "" #: extmod/ulab/code/ndarray.c msgid "too many indices" -msgstr "インデクスが多すぎです" +msgstr "インデクスが多すぎます" #: py/runtime.c #, c-format @@ -3203,15 +3190,15 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" -msgstr "tx と rx の両方を None にすることはできません" +msgstr "txとrxの両方をNoneにすることはできません" #: py/objtype.c msgid "type '%q' is not an acceptable base type" -msgstr "型 '%q' はベース型として認められません" +msgstr "型'%q'はベース型として使えません" #: py/objtype.c msgid "type is not an acceptable base type" -msgstr "" +msgstr "この型はベース型にできません" #: py/runtime.c msgid "type object '%q' has no attribute '%q'" @@ -3227,7 +3214,7 @@ msgstr "" #: py/emitnative.c msgid "unary op %q not implemented" -msgstr "単項演算子 %q は実装されていません" +msgstr "単項演算子 %q は未実装" #: py/parse.c msgid "unexpected indent" @@ -3239,7 +3226,7 @@ msgstr "" #: py/bc.c py/objnamedtuple.c msgid "unexpected keyword argument '%q'" -msgstr "キーワード引数 '%q' は使えません" +msgstr "キーワード引数'%q'は使えません" #: py/lexer.c msgid "unicode name escapes" @@ -3247,7 +3234,7 @@ msgstr "" #: py/parse.c msgid "unindent does not match any outer indentation level" -msgstr "インデントの解除が、外側のどのインデントレベルにも一致しません" +msgstr "インデントの解除が、外側のどのインデントにも一致していません" #: py/objstr.c #, c-format @@ -3296,7 +3283,7 @@ msgstr "" #: py/runtime.c msgid "unsupported type for %q: '%q'" -msgstr "%q がサポートしていない型: '%q'" +msgstr "%qがサポートしていない型: '%q'" #: py/runtime.c msgid "unsupported type for operator" @@ -3333,7 +3320,7 @@ msgstr "引数の型が正しくありません" #: extmod/ulab/code/ndarray.c msgid "wrong index type" -msgstr "インデクスの型が正しくありません" +msgstr "インデクスの型が不正です" #: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" @@ -3373,11 +3360,11 @@ msgstr "" #: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" -msgstr "zi はndarrayでなければなりません" +msgstr "ziはndarrayでなければなりません" #: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" -msgstr "zi はfloat型でなければなりません" +msgstr "ziはfloat値が必要です" #: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" From 747711c7ca894f8142c42ba55a14c3cb3de34e9d Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Mon, 17 Aug 2020 17:56:38 +0200 Subject: [PATCH 0626/1293] 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 | 5 +---- locale/cs.po | 5 +---- locale/de_DE.po | 8 ++++---- locale/es.po | 8 ++++---- locale/fil.po | 5 +---- locale/fr.po | 8 ++++---- locale/hi.po | 5 +---- locale/it_IT.po | 5 +---- locale/ja.po | 20 ++++++++++++-------- locale/ko.po | 5 +---- locale/nl.po | 8 ++++---- locale/pl.po | 8 ++++---- locale/pt_BR.po | 8 ++++---- locale/sv.po | 8 ++++---- locale/zh_Latn_pinyin.po | 23 +++++++++++++---------- 15 files changed, 59 insertions(+), 70 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 95d50c1dd6..b553c67495 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -1993,6 +1993,7 @@ msgid "can't assign to expression" msgstr "tidak dapat menetapkan ke ekspresi" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -3192,10 +3193,6 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "tuple/list required on RHS" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" diff --git a/locale/cs.po b/locale/cs.po index a6579e904e..c1a8ded4e9 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -1964,6 +1964,7 @@ msgid "can't assign to expression" msgstr "" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -3161,10 +3162,6 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "tuple/list required on RHS" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" diff --git a/locale/de_DE.po b/locale/de_DE.po index 580e05e44f..10c07f667c 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -2023,6 +2023,7 @@ msgid "can't assign to expression" msgstr "kann keinem Ausdruck zuweisen" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -3245,10 +3246,6 @@ msgstr "Tupelindex außerhalb des Bereichs" msgid "tuple/list has wrong length" msgstr "tupel/list hat falsche Länge" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "tuple/list required on RHS" -msgstr "Tupel / Liste auf RHS erforderlich" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" @@ -3436,6 +3433,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "tuple/list required on RHS" +#~ msgstr "Tupel / Liste auf RHS erforderlich" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "%q Indizes müssen Integer sein, nicht %s" diff --git a/locale/es.po b/locale/es.po index 4fb9166e41..7582d1cd37 100644 --- a/locale/es.po +++ b/locale/es.po @@ -2018,6 +2018,7 @@ msgid "can't assign to expression" msgstr "no se puede asignar a la expresión" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -3231,10 +3232,6 @@ msgstr "tuple index fuera de rango" msgid "tuple/list has wrong length" msgstr "tupla/lista tiene una longitud incorrecta" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "tuple/list required on RHS" -msgstr "tuple/lista se require en RHS" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" @@ -3418,6 +3415,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 "tuple/list required on RHS" +#~ msgstr "tuple/lista se require en RHS" + #~ 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 fe37c90c63..37a21dc6a7 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -1991,6 +1991,7 @@ msgid "can't assign to expression" msgstr "hindi ma i-assign sa expression" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -3209,10 +3210,6 @@ msgstr "indeks ng tuple wala sa sakop" msgid "tuple/list has wrong length" msgstr "mali ang haba ng tuple/list" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "tuple/list required on RHS" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" diff --git a/locale/fr.po b/locale/fr.po index 089ad1f1d2..419cef785e 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -2026,6 +2026,7 @@ msgid "can't assign to expression" msgstr "ne peut pas assigner à une expression" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -3252,10 +3253,6 @@ msgstr "index du tuple hors gamme" msgid "tuple/list has wrong length" msgstr "tuple/liste a une mauvaise longueur" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "tuple/list required on RHS" -msgstr "tuple ou liste requis en partie droite" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" @@ -3439,6 +3436,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "tuple/list required on RHS" +#~ msgstr "tuple ou liste requis en partie droite" + #~ 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 229bcff7e8..9d0dd74e90 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -1957,6 +1957,7 @@ msgid "can't assign to expression" msgstr "" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -3154,10 +3155,6 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "tuple/list required on RHS" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" diff --git a/locale/it_IT.po b/locale/it_IT.po index dafda62f9c..e128b7ef91 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -1996,6 +1996,7 @@ msgid "can't assign to expression" msgstr "impossibile assegnare all'espressione" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -3216,10 +3217,6 @@ msgstr "indice della tupla fuori intervallo" msgid "tuple/list has wrong length" msgstr "tupla/lista ha la lunghezza sbagliata" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "tuple/list required on RHS" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" diff --git a/locale/ja.po b/locale/ja.po index 4dba019197..8385cce1b9 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -388,7 +388,9 @@ msgstr "オートリロードはオフです。\n" msgid "" "Auto-reload is on. Simply save files over USB to run them or enter REPL to " "disable.\n" -msgstr "オートリロードがオンです。ファイルをUSB経由で保存するだけで実行できます。REPLに入ると無効化します。\n" +msgstr "" +"オートリロードがオンです。ファイルをUSB経由で保存するだけで実行できます。REPL" +"に入ると無効化します。\n" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c @@ -493,7 +495,9 @@ msgstr "CBCブロックは16バイトの整数倍でなければなりません" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "ネイティブオブジェクトにアクセスする前にsuper().__init__()を呼び出してください" +msgstr "" +"ネイティブオブジェクトにアクセスする前にsuper().__init__()を呼び出してくださ" +"い" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" @@ -897,7 +901,8 @@ msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" -"非互換の.mpyファイルです。全ての.mpyファイルをアップデートしてください。詳細は http://adafru.it/mpy-update を参照" +"非互換の.mpyファイルです。全ての.mpyファイルをアップデートしてください。詳細" +"は http://adafru.it/mpy-update を参照" #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" @@ -1258,7 +1263,9 @@ msgstr "保存されたコードは実行していません。\n" #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." -msgstr "オブジェクトは解体済みでもう使われていません。新たなオブジェクトを作成してください" +msgstr "" +"オブジェクトは解体済みでもう使われていません。新たなオブジェクトを作成してく" +"ださい" #: ports/nrf/common-hal/busio/UART.c msgid "Odd parity is not supported" @@ -1982,6 +1989,7 @@ msgid "can't assign to expression" msgstr "" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -3183,10 +3191,6 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "タプル/リストの長さが正しくありません" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "tuple/list required on RHS" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" diff --git a/locale/ko.po b/locale/ko.po index f47d0deeb8..e86372bcb1 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -1961,6 +1961,7 @@ msgid "can't assign to expression" msgstr "" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -3158,10 +3159,6 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "tuple/list required on RHS" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" diff --git a/locale/nl.po b/locale/nl.po index c8957ea055..b26592f1e0 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -2019,6 +2019,7 @@ msgid "can't assign to expression" msgstr "kan niet toewijzen aan expressie" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "kan %q niet naar %q converteren" @@ -3226,10 +3227,6 @@ msgstr "tuple index buiten bereik" msgid "tuple/list has wrong length" msgstr "tuple of lijst heeft onjuiste lengte" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "tuple/list required on RHS" -msgstr "tuple of lijst vereist op RHS" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" @@ -3413,6 +3410,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 "tuple/list required on RHS" +#~ msgstr "tuple of lijst vereist op RHS" + #~ msgid "Invalid SPI pin selection" #~ msgstr "Ongeldige SPI pin selectie" diff --git a/locale/pl.po b/locale/pl.po index 55ecc38f55..8250f840d2 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -1965,6 +1965,7 @@ msgid "can't assign to expression" msgstr "przypisanie do wyrażenia" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -3165,10 +3166,6 @@ msgstr "indeks krotki poza zakresem" msgid "tuple/list has wrong length" msgstr "krotka/lista ma złą długość" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "tuple/list required on RHS" -msgstr "wymagana krotka/lista po prawej stronie" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" @@ -3352,6 +3349,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "tuple/list required on RHS" +#~ msgstr "wymagana krotka/lista po prawej stronie" + #~ 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 716d446aee..459b198df3 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -2026,6 +2026,7 @@ msgid "can't assign to expression" msgstr "a expressão não pode ser atribuída" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "não é possível converter %q para %q" @@ -3245,10 +3246,6 @@ msgstr "o índice da tupla está fora do intervalo" msgid "tuple/list has wrong length" msgstr "a tupla/lista está com tamanho incorreto" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "tuple/list required on RHS" -msgstr "a tupla/lista necessária no RHS" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" @@ -3432,6 +3429,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 "tuple/list required on RHS" +#~ msgstr "a tupla/lista necessária no RHS" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "Os índices %q devem ser inteiros, e não %s" diff --git a/locale/sv.po b/locale/sv.po index bf45f6828f..d747de177a 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -2004,6 +2004,7 @@ msgid "can't assign to expression" msgstr "kan inte tilldela uttryck" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -3212,10 +3213,6 @@ msgstr "tupelindex utanför intervallet" msgid "tuple/list has wrong length" msgstr "tupel/lista har fel längd" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "tuple/list required on RHS" -msgstr "tupel/lista krävs för RHS" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" @@ -3399,6 +3396,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 "tuple/list required on RHS" +#~ msgstr "tupel/lista krävs för RHS" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "Indexet %q måste vara ett heltal, inte %s" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 38a7185bd2..3e5d21d458 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -62,7 +62,8 @@ msgstr "%%c xūyào zhěngshù huò char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "%d dìzhǐ yǐn jiǎo hé %d rgb yǐn jiǎo jiāng gāodù biǎoshì wèi %d, ér bùshì %d" +msgstr "" +"%d dìzhǐ yǐn jiǎo hé %d rgb yǐn jiǎo jiāng gāodù biǎoshì wèi %d, ér bùshì %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" @@ -1337,9 +1338,9 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" -"Chājiǎo měi gè yuánsù shǐyòng%d gè zì jié, zhè bǐ lǐxiǎng de%d xiāohào gèng duō" -"zì jié. Rúguǒ wúfǎ bìmiǎn, qǐng jiāng allow_inefficient = True chuándì gěi" -"gòuzào hánshù" +"Chājiǎo měi gè yuánsù shǐyòng%d gè zì jié, zhè bǐ lǐxiǎng de%d xiāohào gèng " +"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ù" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" @@ -1583,7 +1584,8 @@ msgstr "Chāoshí shíjiān tài zhǎng: Zuìdà chāoshí shíjiān wèi%d miǎ msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" -"Dìngshí qì bǎoliú gōng nèibù shǐyòng-zài chéngxù de qiánmiàn shēngmíng PWM yǐn jiǎo" +"Dìngshí qì bǎoliú gōng nèibù shǐyòng-zài chéngxù de qiánmiàn shēngmíng PWM " +"yǐn jiǎo" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1765,7 +1767,8 @@ msgstr "WatchDogTimer dāngqián wèi yùnxíng" #: shared-bindings/watchdog/WatchDogTimer.c 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." +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" @@ -1994,6 +1997,7 @@ msgid "can't assign to expression" msgstr "bùnéng fēnpèi dào biǎodá shì" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "Wúfǎ jiāng %q zhuǎnhuàn wèi %q" @@ -3199,10 +3203,6 @@ msgstr "yuán zǔ suǒyǐn chāochū fànwéi" msgid "tuple/list has wrong length" msgstr "yuán zǔ/lièbiǎo chángdù cuòwù" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "tuple/list required on RHS" -msgstr "RHS yāoqiú de yuán zǔ/lièbiǎo" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" @@ -3386,6 +3386,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 "tuple/list required on RHS" +#~ msgstr "RHS yāoqiú de yuán zǔ/lièbiǎo" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "%q suǒyǐn bìxū shì zhěngshù, ér bùshì %s" From 57a7114892d8efb5c509f93510a7a3fb64275953 Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Mon, 17 Aug 2020 19:14:50 +0000 Subject: [PATCH 0627/1293] Translated using Weblate (Spanish) Currently translated at 100.0% (775 of 775 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 68 ++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/locale/es.po b/locale/es.po index 7582d1cd37..5012b749be 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-08-14 09:36-0400\n" -"PO-Revision-Date: 2020-07-24 21:12+0000\n" +"PO-Revision-Date: 2020-08-17 21:11+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" @@ -85,7 +85,7 @@ msgstr "%q indice fuera de rango" #: py/obj.c msgid "%q indices must be integers, not %q" -msgstr "" +msgstr "índices %q deben ser enteros, no %q" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -125,39 +125,39 @@ msgstr "argumento '%q' requerido" #: py/runtime.c msgid "'%q' object cannot assign attribute '%q'" -msgstr "" +msgstr "el objeto '%q' no puede asignar el atributo '%q'" #: py/proto.c msgid "'%q' object does not support '%q'" -msgstr "" +msgstr "objeto '%q' no tiene capacidad '%q'" #: py/obj.c msgid "'%q' object does not support item assignment" -msgstr "" +msgstr "objeto '%q' no tiene capacidad de asignado de artículo" #: py/obj.c msgid "'%q' object does not support item deletion" -msgstr "" +msgstr "objeto '%q' no tiene capacidad de borrado de artículo" #: py/runtime.c msgid "'%q' object has no attribute '%q'" -msgstr "" +msgstr "objeto '%q' no tiene atributo '%q'" #: py/runtime.c msgid "'%q' object is not an iterator" -msgstr "" +msgstr "objeto '%q' no es un iterador" #: py/objtype.c py/runtime.c msgid "'%q' object is not callable" -msgstr "" +msgstr "objeto '%q' no es llamable" #: py/runtime.c msgid "'%q' object is not iterable" -msgstr "" +msgstr "objeto '%q' no es iterable" #: py/obj.c msgid "'%q' object is not subscriptable" -msgstr "" +msgstr "objeto '%q' no es subscribible" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -227,7 +227,7 @@ msgstr "'await' fuera de la función" #: py/compile.c msgid "'await', 'async for' or 'async with' outside async function" -msgstr "" +msgstr "'await', 'async for' o 'async with' fuera de la función async" #: py/compile.c msgid "'break' outside loop" @@ -464,7 +464,7 @@ msgstr "El tamaño del búfer debe ser múltiplo de 512" #: ports/stm/common-hal/sdioio/SDCard.c msgid "Buffer must be a multiple of 512 bytes" -msgstr "" +msgstr "Búfer deber ser un múltiplo de 512 bytes" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -664,7 +664,7 @@ msgstr "No se pudo reiniciar el PWM" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" -msgstr "" +msgstr "No se puede definir la dirección" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" @@ -851,7 +851,7 @@ msgstr "El archivo ya existe" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" -msgstr "" +msgstr "Framebuffer requiere %d bytes" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." @@ -896,7 +896,7 @@ msgstr "Error de inicio de I2C" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" -msgstr "" +msgstr "I2SOut no disponible" #: shared-bindings/aesio/aes.c #, c-format @@ -948,7 +948,7 @@ msgstr "Pin %q inválido" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c #: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" -msgstr "" +msgstr "selección inválida de pin %q" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" @@ -1265,7 +1265,7 @@ msgstr "No reproduciendo" #: main.c msgid "Not running saved code.\n" -msgstr "" +msgstr "No ejecutando el código almacenado.\n" #: shared-bindings/util.c msgid "" @@ -1436,7 +1436,7 @@ msgstr "La entrada de la fila debe ser digitalio.DigitalInOut" #: main.c msgid "Running in safe mode! " -msgstr "" +msgstr "¡Corriendo en modo seguro! " #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1450,12 +1450,12 @@ msgstr "SDA o SCL necesitan una pull up" #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" -msgstr "" +msgstr "Error SDIO GetCardInfo %d" #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO Init Error %d" -msgstr "" +msgstr "Error de iniciado de SDIO %d" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" @@ -1832,7 +1832,7 @@ msgstr "__init__() deberia devolver None" #: py/objtype.c msgid "__init__() should return None, not '%q'" -msgstr "" +msgstr "__init__() debe retornar None, no '%q'" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1877,7 +1877,7 @@ msgstr "el argumento tiene un tipo erroneo" #: extmod/ulab/code/linalg/linalg.c msgid "argument must be ndarray" -msgstr "" +msgstr "argumento debe ser ndarray" #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c @@ -2020,7 +2020,7 @@ msgstr "no se puede asignar a la expresión" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c #: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" -msgstr "" +msgstr "no puede convertir %q a %q" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" @@ -2028,7 +2028,7 @@ msgstr "no se puede convertir el objeto '%q' a %q implícitamente" #: py/obj.c msgid "can't convert to %q" -msgstr "" +msgstr "no puede convertir a %q" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2854,7 +2854,7 @@ msgstr "el número de puntos debe ser al menos 2" #: py/obj.c msgid "object '%q' is not a tuple or list" -msgstr "" +msgstr "objeto '%q' no es tupla o lista" #: py/obj.c msgid "object does not support item assignment" @@ -2890,7 +2890,7 @@ msgstr "objeto no iterable" #: py/obj.c msgid "object of type '%q' has no len()" -msgstr "" +msgstr "objeto de tipo '%q' no tiene len()" #: py/obj.c msgid "object with buffer protocol required" @@ -2985,7 +2985,7 @@ msgstr "el polígono solo se puede registrar en uno de los padres" #: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c #: shared-bindings/ps2io/Ps2.c msgid "pop from empty %q" -msgstr "" +msgstr "pop desde %q vacía" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3144,7 +3144,7 @@ msgstr "operación stream no soportada" #: py/objstrunicode.c msgid "string indices must be integers, not %q" -msgstr "" +msgstr "índices de cadena deben ser enteros, no %q" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3222,7 +3222,7 @@ msgstr "demasiados valores para descomprimir (%d esperado)" #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" -msgstr "" +msgstr "trapz está definido para arreglos 1D de igual tamaño" #: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" @@ -3288,7 +3288,7 @@ msgstr "especificador de conversión %c desconocido" #: py/objstr.c msgid "unknown format code '%c' for object of type '%q'" -msgstr "" +msgstr "formato de código desconocicdo '%c' para objeto de tipo '%q'" #: py/compile.c msgid "unknown type" @@ -3328,7 +3328,7 @@ msgstr "carácter no soportado '%c' (0x%x) en índice %d" #: py/runtime.c msgid "unsupported type for %q: '%q'" -msgstr "" +msgstr "tipo no soportado para %q: '%q'" #: py/runtime.c msgid "unsupported type for operator" @@ -3336,7 +3336,7 @@ msgstr "tipo de operador no soportado" #: py/runtime.c msgid "unsupported types for %q: '%q', '%q'" -msgstr "" +msgstr "tipos no soportados para %q: '%q', '%q'" #: py/objint.c #, c-format @@ -3349,7 +3349,7 @@ msgstr "value_count debe ser > 0" #: extmod/ulab/code/linalg/linalg.c msgid "vectors must have same lengths" -msgstr "" +msgstr "los vectores deben tener el mismo tamaño" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" From d01f5dc0bdb3ea98d4cf234b7c08c8cc36694c1a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 17 Aug 2020 17:17:59 -0700 Subject: [PATCH 0628/1293] Turn off terminalio for ja and ko The font is missing many characters and the build needs the space. We can optimize font storage when we get a good font. The serial output will work as usual. --- ports/atmel-samd/mpconfigport.mk | 10 ++++++ py/circuitpy_defns.mk | 5 ++- py/circuitpy_mpconfig.h | 10 ++++-- py/circuitpy_mpconfig.mk | 3 ++ supervisor/shared/display.c | 60 ++++++++++++++++++++++---------- supervisor/shared/display.h | 6 ++++ supervisor/shared/serial.c | 2 +- supervisor/supervisor.mk | 4 ++- 8 files changed, 75 insertions(+), 25 deletions(-) diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 5788a160b1..3fecf867e0 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -47,6 +47,16 @@ USB_MSC_EP_NUM_OUT = 1 CIRCUITPY_ULAB = 0 +ifeq ($(TRANSLATION), ja) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CIRCUITPY_TERMINALIO = 0 +endif + +ifeq ($(TRANSLATION), ko) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CIRCUITPY_TERMINALIO = 0 +endif + endif # samd21 # Put samd51-only choices here. diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 515b386f9e..b70ae64a80 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -145,7 +145,7 @@ ifeq ($(CIRCUITPY_DIGITALIO),1) SRC_PATTERNS += digitalio/% endif ifeq ($(CIRCUITPY_DISPLAYIO),1) -SRC_PATTERNS += displayio/% terminalio/% fontio/% +SRC_PATTERNS += displayio/% endif ifeq ($(CIRCUITPY_VECTORIO),1) SRC_PATTERNS += vectorio/% @@ -237,6 +237,9 @@ endif ifeq ($(CIRCUITPY_SUPERVISOR),1) SRC_PATTERNS += supervisor/% endif +ifeq ($(CIRCUITPY_TERMINALIO),1) +SRC_PATTERNS += terminalio/% fontio/% +endif ifeq ($(CIRCUITPY_TIME),1) SRC_PATTERNS += time/% endif diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index f0e8adffa1..12d667d8f8 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -347,16 +347,20 @@ extern const struct _mp_obj_module_t displayio_module; extern const struct _mp_obj_module_t fontio_module; extern const struct _mp_obj_module_t terminalio_module; #define DISPLAYIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_displayio), (mp_obj_t)&displayio_module }, -#define FONTIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_fontio), (mp_obj_t)&fontio_module }, -#define TERMINALIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_terminalio), (mp_obj_t)&terminalio_module }, #ifndef CIRCUITPY_DISPLAY_LIMIT #define CIRCUITPY_DISPLAY_LIMIT (1) #endif #else #define DISPLAYIO_MODULE +#define CIRCUITPY_DISPLAY_LIMIT (0) +#endif + +#if CIRCUITPY_DISPLAYIO && CIRCUITPY_TERMINALIO +#define FONTIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_fontio), (mp_obj_t)&fontio_module }, +#define TERMINALIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_terminalio), (mp_obj_t)&terminalio_module }, +#else #define FONTIO_MODULE #define TERMINALIO_MODULE -#define CIRCUITPY_DISPLAY_LIMIT (0) #endif #if CIRCUITPY_FRAMEBUFFERIO diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 56060fa594..bdc1e77d54 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -195,6 +195,9 @@ CFLAGS += -DCIRCUITPY_STRUCT=$(CIRCUITPY_STRUCT) CIRCUITPY_SUPERVISOR ?= 1 CFLAGS += -DCIRCUITPY_SUPERVISOR=$(CIRCUITPY_SUPERVISOR) +CIRCUITPY_TERMINALIO ?= $(CIRCUITPY_DISPLAYIO) +CFLAGS += -DCIRCUITPY_TERMINALIO=$(CIRCUITPY_TERMINALIO) + CIRCUITPY_TIME ?= 1 CFLAGS += -DCIRCUITPY_TIME=$(CIRCUITPY_TIME) diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index 08dd71404b..634720d0ab 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -29,6 +29,7 @@ #include #include "py/mpstate.h" +#include "shared-bindings/displayio/Bitmap.h" #include "shared-bindings/displayio/Group.h" #include "shared-bindings/displayio/Palette.h" #include "shared-bindings/displayio/TileGrid.h" @@ -48,15 +49,21 @@ extern size_t blinka_bitmap_data[]; extern displayio_bitmap_t blinka_bitmap; extern displayio_group_t circuitpython_splash; +#if CIRCUITPY_TERMINALIO static supervisor_allocation* tilegrid_tiles = NULL; +#endif void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { + // Default the scale to 2 because we may show blinka without the terminal for + // languages that don't have font support. + uint8_t scale = 2; + + #if CIRCUITPY_TERMINALIO displayio_tilegrid_t* grid = &supervisor_terminal_text_grid; uint16_t width_in_tiles = (width_px - blinka_bitmap.width) / grid->tile_width; // determine scale based on h - uint8_t scale = 1; - if (width_in_tiles > 80) { - scale = 2; + if (width_in_tiles < 80) { + scale = 1; } width_in_tiles = (width_px - blinka_bitmap.width * scale) / (grid->tile_width * scale); uint16_t height_in_tiles = height_px / (grid->tile_height * scale); @@ -64,7 +71,6 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { if (remaining_pixels > 0) { height_in_tiles += 1; } - circuitpython_splash.scale = scale; uint16_t total_tiles = width_in_tiles * height_in_tiles; @@ -94,34 +100,42 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { grid->full_change = true; common_hal_terminalio_terminal_construct(&supervisor_terminal, grid, &supervisor_terminal_font); + #endif + + circuitpython_splash.scale = scale; } void supervisor_stop_terminal(void) { + #if CIRCUITPY_TERMINALIO if (tilegrid_tiles != NULL) { free_memory(tilegrid_tiles); tilegrid_tiles = NULL; supervisor_terminal_text_grid.inline_tiles = false; supervisor_terminal_text_grid.tiles = NULL; } + #endif } void supervisor_display_move_memory(void) { - #if CIRCUITPY_DISPLAYIO + #if CIRCUITPY_TERMINALIO displayio_tilegrid_t* grid = &supervisor_terminal_text_grid; - if (MP_STATE_VM(terminal_tilegrid_tiles) == NULL || grid->tiles != MP_STATE_VM(terminal_tilegrid_tiles)) { - return; - } - uint16_t total_tiles = grid->width_in_tiles * grid->height_in_tiles; + if (MP_STATE_VM(terminal_tilegrid_tiles) != NULL && + grid->tiles == MP_STATE_VM(terminal_tilegrid_tiles)) { + uint16_t total_tiles = grid->width_in_tiles * grid->height_in_tiles; - tilegrid_tiles = allocate_memory(align32_size(total_tiles), false); - if (tilegrid_tiles != NULL) { - memcpy(tilegrid_tiles->ptr, grid->tiles, total_tiles); - grid->tiles = (uint8_t*) tilegrid_tiles->ptr; - } else { - grid->tiles = NULL; - grid->inline_tiles = false; + tilegrid_tiles = allocate_memory(align32_size(total_tiles), false); + if (tilegrid_tiles != NULL) { + memcpy(tilegrid_tiles->ptr, grid->tiles, total_tiles); + grid->tiles = (uint8_t*) tilegrid_tiles->ptr; + } else { + grid->tiles = NULL; + grid->inline_tiles = false; + } + MP_STATE_VM(terminal_tilegrid_tiles) = NULL; } - MP_STATE_VM(terminal_tilegrid_tiles) = NULL; + #endif + + #if CIRCUITPY_DISPLAYIO for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { #if CIRCUITPY_RGBMATRIX if (displays[i].rgbmatrix.base.type == &rgbmatrix_RGBMatrix_type) { @@ -254,18 +268,26 @@ displayio_tilegrid_t blinka_sprite = { .in_group = true }; +#if CIRCUITPY_TERMINALIO +#define CHILD_COUNT 2 displayio_group_child_t splash_children[2] = { {&blinka_sprite, &blinka_sprite}, {&supervisor_terminal_text_grid, &supervisor_terminal_text_grid} }; +#else +#define CHILD_COUNT 1 +displayio_group_child_t splash_children[1] = { + {&blinka_sprite, &blinka_sprite}, +}; +#endif displayio_group_t circuitpython_splash = { .base = {.type = &displayio_group_type }, .x = 0, .y = 0, .scale = 2, - .size = 2, - .max_size = 2, + .size = CHILD_COUNT, + .max_size = CHILD_COUNT, .children = splash_children, .item_removed = false, .in_group = false, diff --git a/supervisor/shared/display.h b/supervisor/shared/display.h index 2a2ccf46df..4110cfe8e4 100644 --- a/supervisor/shared/display.h +++ b/supervisor/shared/display.h @@ -27,6 +27,10 @@ #ifndef MICROPY_INCLUDED_SUPERVISOR_SHARED_DISPLAY_H #define MICROPY_INCLUDED_SUPERVISOR_SHARED_DISPLAY_H +#include + +#if CIRCUITPY_TERMINALIO + #include "shared-bindings/displayio/Bitmap.h" #include "shared-bindings/displayio/TileGrid.h" #include "shared-bindings/fontio/BuiltinFont.h" @@ -42,6 +46,8 @@ extern displayio_bitmap_t supervisor_terminal_font_bitmap; extern displayio_tilegrid_t supervisor_terminal_text_grid; extern terminalio_terminal_obj_t supervisor_terminal; +#endif + void supervisor_start_terminal(uint16_t width_px, uint16_t height_px); void supervisor_stop_terminal(void); diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c index 8eb78a90e5..303f89e752 100644 --- a/supervisor/shared/serial.c +++ b/supervisor/shared/serial.c @@ -99,7 +99,7 @@ void serial_write_substring(const char* text, uint32_t length) { if (length == 0) { return; } -#if CIRCUITPY_DISPLAYIO +#if CIRCUITPY_TERMINALIO int errcode; common_hal_terminalio_terminal_write(&supervisor_terminal, (const uint8_t*) text, length, &errcode); #endif diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index a066fc0fd4..25b240036d 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -110,7 +110,9 @@ ifeq ($(CIRCUITPY_DISPLAYIO), 1) SRC_SUPERVISOR += \ supervisor/shared/display.c - SUPERVISOR_O += $(BUILD)/autogen_display_resources.o + ifeq ($(CIRCUITPY_TERMINALIO), 1) + SUPERVISOR_O += $(BUILD)/autogen_display_resources.o + endif endif ifndef USB_INTERFACE_NAME USB_INTERFACE_NAME = "CircuitPython" From 6425a411ca7e53b8cdc6c8399c6cd717f39e25fe Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 17 Aug 2020 21:07:24 -0500 Subject: [PATCH 0629/1293] Update shared-module/displayio/__init__.c Co-authored-by: Scott Shawcroft --- shared-module/displayio/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index 8049be5b47..73626ce154 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -398,7 +398,7 @@ primary_display_t *allocate_display_or_raise(void) { } primary_display_t *allocate_display_bus(void) { for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { - mp_const_obj_t display_type = displays[i].bus_base.type; + mp_const_obj_t display_bus_type = displays[i].bus_base.type; if (display_type == NULL || display_type == &mp_type_NoneType) { return &displays[i]; } From 6d2d36db3d161fefadd52cc1f2d5a9da99bb2dc9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 17 Aug 2020 21:09:21 -0500 Subject: [PATCH 0630/1293] Finish implementing scott's suggestion --- shared-module/displayio/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index 73626ce154..295af3e7c4 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -399,7 +399,7 @@ primary_display_t *allocate_display_or_raise(void) { primary_display_t *allocate_display_bus(void) { for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { mp_const_obj_t display_bus_type = displays[i].bus_base.type; - if (display_type == NULL || display_type == &mp_type_NoneType) { + if (display_bus_type == NULL || display_bus_type == &mp_type_NoneType) { return &displays[i]; } } From a4508f846d57016b6fe2a82cce118da5c767b195 Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 18 Aug 2020 18:16:49 +0800 Subject: [PATCH 0631/1293] stash config --- ports/nrf/boards/simmel/mpconfigboard.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/nrf/boards/simmel/mpconfigboard.h b/ports/nrf/boards/simmel/mpconfigboard.h index 28c4ee7d93..9d4d250c1e 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.h +++ b/ports/nrf/boards/simmel/mpconfigboard.h @@ -45,6 +45,9 @@ #define BOOTLOADER_SIZE (0x4000) // 12 kiB #define CIRCUITPY_BLE_CONFIG_SIZE (12*1024) +#define DEFAULT_I2C_BUS_SCL (&pin_P0_08) +#define DEFAULT_I2C_BUS_SDA (&pin_P1_09) + // Reduce nRF SoftRadio memory usage #define BLEIO_VS_UUID_COUNT 10 #define BLEIO_HVN_TX_QUEUE_SIZE 2 From 211c134950adbdedec3d91a0f5472a56e2731c44 Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 18 Aug 2020 19:02:23 +0800 Subject: [PATCH 0632/1293] add I2C, remove unused pins --- ports/nrf/boards/simmel/pins.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ports/nrf/boards/simmel/pins.c b/ports/nrf/boards/simmel/pins.c index 6c572cae21..5d9c62bbc4 100644 --- a/ports/nrf/boards/simmel/pins.c +++ b/ports/nrf/boards/simmel/pins.c @@ -9,19 +9,15 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { 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_I2S_LRCK), MP_ROM_PTR(&pin_P0_08) }, - { MP_ROM_QSTR(MP_QSTR_I2S_SDIN), MP_ROM_PTR(&pin_P1_09) }, - { MP_ROM_QSTR(MP_QSTR_I2S_SCK), MP_ROM_PTR(&pin_P0_12) }, - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P0_06) }, - { MP_ROM_QSTR(MP_QSTR_CHG), MP_ROM_PTR(&pin_P0_04) }, - - { MP_ROM_QSTR(MP_QSTR_PWM), MP_ROM_PTR(&pin_P0_02) }, - { MP_ROM_QSTR(MP_QSTR_PWM_N), MP_ROM_PTR(&pin_P0_19) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P1_09) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 79a3796b1cd74b376e091e63c1b3a2426ec3187c Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Tue, 18 Aug 2020 23:21:14 +0900 Subject: [PATCH 0633/1293] Calculate the Huffman codebook without MP_QSTRs --- py/makeqstrdata.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 6132298a51..04c8938766 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -102,10 +102,6 @@ def translate(translation_file, i18ns): def compute_huffman_coding(translations, qstrs, compression_filename): all_strings = [x[1] for x in translations] - - # go through each qstr and print it out - for _, _, qstr in qstrs.values(): - all_strings.append(qstr) all_strings_concat = "".join(all_strings) counts = collections.Counter(all_strings_concat) cb = huffman.codebook(counts.items()) From b542c1486fd16636c697f5e295413e4895302165 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 18 Aug 2020 09:31:03 -0500 Subject: [PATCH 0634/1293] reset_board_buses: need to check if sharpdisplay uses SPI bus --- shared-module/board/__init__.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index 2c9139d8af..d981aada41 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -39,6 +39,11 @@ #include "shared-module/displayio/__init__.h" #endif +#if CIRCUITPY_SHARPDISPLAY +#include "shared-bindings/sharpdisplay/SharpMemoryFramebuffer.h" +#include "shared-module/sharpdisplay/SharpMemoryFramebuffer.h" +#endif + #if BOARD_I2C // Statically allocate the I2C object so it can live past the end of the heap and into the next VM. // That way it can be used by built-in I2CDisplay displays and be accessible through board.I2C(). @@ -148,12 +153,19 @@ void reset_board_busses(void) { bool display_using_spi = false; #if CIRCUITPY_DISPLAYIO for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { - if (displays[i].fourwire_bus.bus == spi_singleton) { + mp_const_obj_t bus_type = displays[i].bus_base.type; + if (bus_type == &displayio_fourwire_type && displays[i].fourwire_bus.bus == spi_singleton) { display_using_spi = true; break; } - } + #if CIRCUITPY_SHARPDISPLAY + if (displays[i].bus_base.type == &sharpdisplay_framebuffer_type && displays[i].sharpdisplay.bus == spi_singleton) { + display_using_spi = true; + break; + } + #endif #endif + } if (!display_using_spi) { spi_singleton = NULL; } From 0bec39118f24ca2d6c1dd8df889da5a77e28c52a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 18 Aug 2020 09:31:49 -0500 Subject: [PATCH 0635/1293] displayio: Don't need to specialcase reset of sharpdisplay framebuffer .. for the case where the bus was not in use --- shared-module/displayio/__init__.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index 5afcba35ec..13c7c231dd 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -186,11 +186,7 @@ void reset_displays(void) { #if CIRCUITPY_SHARPDISPLAY } else if (displays[i].bus_base.type == &sharpdisplay_framebuffer_type) { sharpdisplay_framebuffer_obj_t * sharp = &displays[i].sharpdisplay; - if(any_display_uses_this_framebuffer(&sharp->base)) { - common_hal_sharpdisplay_framebuffer_reset(sharp); - } else { - common_hal_sharpdisplay_framebuffer_deinit(sharp); - } + common_hal_sharpdisplay_framebuffer_reset(sharp); #endif } else { // Not an active display bus. From 9e66f71a31644c4c9d4af4e339e4077f4469f9be Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 18 Aug 2020 10:03:45 -0500 Subject: [PATCH 0636/1293] Fix build error for \!DISPLAY --- shared-module/board/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index d981aada41..265c6517fa 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -164,8 +164,8 @@ void reset_board_busses(void) { break; } #endif - #endif } + #endif if (!display_using_spi) { spi_singleton = NULL; } From da75445cd58d0fbf72c6b323b1b0bd53197f9cf3 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 18 Aug 2020 11:42:06 -0400 Subject: [PATCH 0637/1293] Style changes, reposition runtime errors --- locale/circuitpython.pot | 4 ++-- ports/atmel-samd/common-hal/pulseio/PulseOut.c | 2 +- ports/cxd56/common-hal/pulseio/PulseOut.c | 2 +- ports/esp32s2/common-hal/neopixel_write/__init__.c | 3 +++ ports/esp32s2/common-hal/pulseio/PulseIn.c | 3 +++ ports/esp32s2/common-hal/pulseio/PulseOut.c | 7 ++++++- ports/esp32s2/peripherals/rmt.c | 4 ++-- ports/nrf/common-hal/pulseio/PulseOut.c | 2 +- ports/stm/common-hal/pulseio/PulseOut.c | 2 +- shared-bindings/pulseio/PulseOut.c | 4 ++-- 10 files changed, 22 insertions(+), 11 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index b98e0e2132..d9d5d6e17d 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-17 10:10-0400\n" +"POT-Creation-Date: 2020-08-18 11:19-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1334,7 +1334,7 @@ msgstr "" #: ports/stm/common-hal/pulseio/PulseOut.c msgid "" "Port does not accept pins or frequency. " -"Construct and pass a PWM Carrier instead" +"Construct and pass a PWMOut Carrier instead" msgstr "" #: shared-bindings/_bleio/Adapter.c diff --git a/ports/atmel-samd/common-hal/pulseio/PulseOut.c b/ports/atmel-samd/common-hal/pulseio/PulseOut.c index de2f7b8d2a..b53c8da2ba 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseOut.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseOut.c @@ -102,7 +102,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, uint16_t duty_cycle) { if (!carrier || pin || frequency) { mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. \ - Construct and pass a PWM Carrier instead")); + Construct and pass a PWMOut Carrier instead")); } if (refcount == 0) { diff --git a/ports/cxd56/common-hal/pulseio/PulseOut.c b/ports/cxd56/common-hal/pulseio/PulseOut.c index 2851a04658..08081020f3 100644 --- a/ports/cxd56/common-hal/pulseio/PulseOut.c +++ b/ports/cxd56/common-hal/pulseio/PulseOut.c @@ -65,7 +65,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, uint16_t duty_cycle) { if (!carrier || pin || frequency) { mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. \ - Construct and pass a PWM Carrier instead")); + Construct and pass a PWMOut Carrier instead")); } if (pulse_fd < 0) { diff --git a/ports/esp32s2/common-hal/neopixel_write/__init__.c b/ports/esp32s2/common-hal/neopixel_write/__init__.c index 1fc976ec36..193d754f43 100644 --- a/ports/esp32s2/common-hal/neopixel_write/__init__.c +++ b/ports/esp32s2/common-hal/neopixel_write/__init__.c @@ -93,6 +93,9 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout // Reserve channel uint8_t number = digitalinout->pin->number; rmt_channel_t channel = esp32s2_peripherals_find_and_reserve_rmt(); + if (channel == RMT_CHANNEL_MAX) { + mp_raise_RuntimeError(translate("All timers in use")); + } // Configure Channel rmt_config_t config = RMT_DEFAULT_CONFIG_TX(number, channel); diff --git a/ports/esp32s2/common-hal/pulseio/PulseIn.c b/ports/esp32s2/common-hal/pulseio/PulseIn.c index d741628305..f7429ec12c 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseIn.c +++ b/ports/esp32s2/common-hal/pulseio/PulseIn.c @@ -105,6 +105,9 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu // Find a free RMT Channel and configure it rmt_channel_t channel = esp32s2_peripherals_find_and_reserve_rmt(); + if (channel == RMT_CHANNEL_MAX) { + mp_raise_RuntimeError(translate("All timers in use")); + } rmt_config_t config = RMT_DEFAULT_CONFIG_RX(pin->number, channel); config.rx_config.filter_en = true; config.rx_config.idle_threshold = 30000; // 30*3=90ms idle required to register a sequence diff --git a/ports/esp32s2/common-hal/pulseio/PulseOut.c b/ports/esp32s2/common-hal/pulseio/PulseOut.c index 463443ef0c..a07ec39dc2 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseOut.c +++ b/ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -42,6 +42,9 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, } rmt_channel_t channel = esp32s2_peripherals_find_and_reserve_rmt(); + if (channel == RMT_CHANNEL_MAX) { + mp_raise_RuntimeError(translate("All timers in use")); + } // Configure Channel rmt_config_t config = RMT_DEFAULT_CONFIG_TX(pin->number, channel); @@ -82,5 +85,7 @@ void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t* self, uint16_t* pu } rmt_write_items(self->channel, items, length, true); - rmt_wait_tx_done(self->channel, pdMS_TO_TICKS(100)); + while (rmt_wait_tx_done(self->channel, 0) != ESP_OK) { + RUN_BACKGROUND_TASKS(); + } } diff --git a/ports/esp32s2/peripherals/rmt.c b/ports/esp32s2/peripherals/rmt.c index 16605edf5e..b7629dbd5c 100644 --- a/ports/esp32s2/peripherals/rmt.c +++ b/ports/esp32s2/peripherals/rmt.c @@ -44,8 +44,8 @@ rmt_channel_t esp32s2_peripherals_find_and_reserve_rmt(void) { return i; } } - mp_raise_RuntimeError(translate("All timers in use")); - return false; + // Returning the max indicates a reservation failure. + return RMT_CHANNEL_MAX; } void esp32s2_peripherals_free_rmt(rmt_channel_t chan) { diff --git a/ports/nrf/common-hal/pulseio/PulseOut.c b/ports/nrf/common-hal/pulseio/PulseOut.c index 9f5efcfdc6..bdc5cfbef5 100644 --- a/ports/nrf/common-hal/pulseio/PulseOut.c +++ b/ports/nrf/common-hal/pulseio/PulseOut.c @@ -106,7 +106,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, uint16_t duty_cycle) { if (!carrier || pin || frequency) { mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. \ - Construct and pass a PWM Carrier instead")); + Construct and pass a PWMOut Carrier instead")); } if (refcount == 0) { diff --git a/ports/stm/common-hal/pulseio/PulseOut.c b/ports/stm/common-hal/pulseio/PulseOut.c index 33311fd53d..eec1049dd2 100644 --- a/ports/stm/common-hal/pulseio/PulseOut.c +++ b/ports/stm/common-hal/pulseio/PulseOut.c @@ -119,7 +119,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, uint16_t duty_cycle) { if (!carrier || pin || frequency) { mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. \ - Construct and pass a PWM Carrier instead")); + Construct and pass a PWMOut Carrier instead")); } // Add to active PulseOuts diff --git a/shared-bindings/pulseio/PulseOut.c b/shared-bindings/pulseio/PulseOut.c index 2adbc3cf6a..3fd722558e 100644 --- a/shared-bindings/pulseio/PulseOut.c +++ b/shared-bindings/pulseio/PulseOut.c @@ -71,11 +71,11 @@ STATIC mp_obj_t pulseio_pulseout_make_new(const mp_obj_type_t *type, size_t n_ar mp_obj_t carrier_obj = pos_args[0]; if (MP_OBJ_IS_TYPE(carrier_obj, &pulseio_pwmout_type)) { - // PWM Carrier + // Use a PWMOut Carrier mp_arg_check_num(n_args, kw_args, 1, 1, false); common_hal_pulseio_pulseout_construct(self, (pulseio_pwmout_obj_t *)MP_OBJ_TO_PTR(carrier_obj), NULL, 0, 0); } else { - // Pin and Frequency + // Use a Pin, frequency, and duty cycle enum { ARG_pin, ARG_frequency}; static const mp_arg_t allowed_args[] = { { MP_QSTR_pin, MP_ARG_REQUIRED | MP_ARG_OBJ }, From f2f18da1893275a19cda2ad19cb6754527817bf8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 18 Aug 2020 10:59:55 -0500 Subject: [PATCH 0638/1293] Fix build error for !SHARPDISPLAY --- shared-module/displayio/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index 13c7c231dd..4a6428ea00 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -26,7 +26,7 @@ primary_display_t displays[CIRCUITPY_DISPLAY_LIMIT]; -#if CIRCUITPY_RGBMATRIX || CIRCUITPY_SHARPDISPLAY +#if CIRCUITPY_RGBMATRIX STATIC bool any_display_uses_this_framebuffer(mp_obj_base_t *obj) { for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { if (displays[i].display_base.type == &framebufferio_framebufferdisplay_type) { From 771388cde2fb7ad68164c08412cbd788b5f01469 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 18 Aug 2020 11:44:31 -0700 Subject: [PATCH 0639/1293] Remove trailing space. --- ports/nrf/boards/simmel/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/boards/simmel/pins.c b/ports/nrf/boards/simmel/pins.c index 5d9c62bbc4..e9710967b6 100644 --- a/ports/nrf/boards/simmel/pins.c +++ b/ports/nrf/boards/simmel/pins.c @@ -13,7 +13,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_08) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P1_09) }, - + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, From dd425ee6c54deee72d0fa7cd42282b8157a54da6 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 18 Aug 2020 15:54:50 -0400 Subject: [PATCH 0640/1293] Remove breaking parenthesis --- ports/esp32s2/common-hal/pulseio/PulseOut.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/common-hal/pulseio/PulseOut.c b/ports/esp32s2/common-hal/pulseio/PulseOut.c index a07ec39dc2..d3c163ca8b 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseOut.c +++ b/ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -86,6 +86,6 @@ void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t* self, uint16_t* pu rmt_write_items(self->channel, items, length, true); while (rmt_wait_tx_done(self->channel, 0) != ESP_OK) { - RUN_BACKGROUND_TASKS(); + RUN_BACKGROUND_TASKS; } } From 6857f984269149b46d1cd4283506420f341b2601 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 18 Aug 2020 13:08:33 -0700 Subject: [PATCH 0641/1293] Split pulseio.PWMOut into pwmio This gives us better granularity when implementing new ports because PWMOut is commonly implemented before PulseIn and PulseOut. Fixes #3211 --- .../atmel-samd/common-hal/pulseio/PulseOut.c | 2 +- .../common-hal/{pulseio => pwmio}/PWMOut.c | 30 ++--- .../common-hal/{pulseio => pwmio}/PWMOut.h | 8 +- ports/atmel-samd/common-hal/pwmio/__init__.c | 1 + ports/atmel-samd/supervisor/port.c | 4 +- ports/cxd56/common-hal/pulseio/PulseOut.c | 2 +- .../common-hal/{pulseio => pwmio}/PWMOut.c | 24 ++-- .../common-hal/{pulseio => pwmio}/PWMOut.h | 8 +- ports/cxd56/common-hal/pwmio/__init__.c | 1 + ports/cxd56/supervisor/port.c | 4 +- ports/esp32s2/common-hal/pulseio/PulseOut.c | 4 +- ports/esp32s2/common-hal/pulseio/PulseOut.h | 4 +- .../common-hal/{pulseio => pwmio}/PWMOut.c | 28 ++--- .../common-hal/{pulseio => pwmio}/PWMOut.h | 8 +- ports/esp32s2/common-hal/pwmio/__init__.c | 1 + ports/esp32s2/supervisor/port.c | 4 +- .../mimxrt10xx/common-hal/pulseio/PulseOut.c | 2 +- .../common-hal/{pulseio => pwmio}/PWMOut.c | 32 +++--- .../common-hal/{pulseio => pwmio}/PWMOut.h | 8 +- ports/mimxrt10xx/common-hal/pwmio/__init__.c | 1 + ports/mimxrt10xx/supervisor/port.c | 4 +- ports/nrf/common-hal/audiopwmio/PWMAudioOut.c | 2 +- ports/nrf/common-hal/pulseio/PulseOut.c | 4 +- ports/nrf/common-hal/pulseio/PulseOut.h | 4 +- .../common-hal/{pulseio => pwmio}/PWMOut.c | 30 ++--- .../common-hal/{pulseio => pwmio}/PWMOut.h | 8 +- ports/nrf/common-hal/pwmio/__init__.c | 1 + ports/nrf/supervisor/port.c | 7 +- ports/stm/common-hal/pulseio/PulseOut.c | 6 +- ports/stm/common-hal/pulseio/PulseOut.h | 4 +- .../common-hal/{pulseio => pwmio}/PWMOut.c | 26 ++--- .../common-hal/{pulseio => pwmio}/PWMOut.h | 8 +- ports/stm/common-hal/pwmio/__init__.c | 1 + ports/stm/supervisor/port.c | 14 ++- py/circuitpy_defns.mk | 10 +- py/circuitpy_mpconfig.h | 16 ++- py/circuitpy_mpconfig.mk | 17 ++- shared-bindings/pulseio/PulseOut.c | 15 +-- shared-bindings/pulseio/PulseOut.h | 4 +- shared-bindings/pulseio/__init__.c | 27 ++--- shared-bindings/{pulseio => pwmio}/PWMOut.c | 104 +++++++++--------- shared-bindings/{pulseio => pwmio}/PWMOut.h | 30 ++--- shared-bindings/pwmio/__init__.c | 73 ++++++++++++ shared-bindings/pwmio/__init__.h | 34 ++++++ shared-module/displayio/Display.c | 16 +-- shared-module/displayio/Display.h | 8 +- .../framebufferio/FramebufferDisplay.h | 1 - 47 files changed, 393 insertions(+), 257 deletions(-) rename ports/atmel-samd/common-hal/{pulseio => pwmio}/PWMOut.c (94%) rename ports/atmel-samd/common-hal/{pulseio => pwmio}/PWMOut.h (87%) create mode 100644 ports/atmel-samd/common-hal/pwmio/__init__.c rename ports/cxd56/common-hal/{pulseio => pwmio}/PWMOut.c (82%) rename ports/cxd56/common-hal/{pulseio => pwmio}/PWMOut.h (88%) create mode 100644 ports/cxd56/common-hal/pwmio/__init__.c rename ports/esp32s2/common-hal/{pulseio => pwmio}/PWMOut.c (87%) rename ports/esp32s2/common-hal/{pulseio => pwmio}/PWMOut.h (88%) create mode 100644 ports/esp32s2/common-hal/pwmio/__init__.c rename ports/mimxrt10xx/common-hal/{pulseio => pwmio}/PWMOut.c (94%) rename ports/mimxrt10xx/common-hal/{pulseio => pwmio}/PWMOut.h (87%) create mode 100644 ports/mimxrt10xx/common-hal/pwmio/__init__.c rename ports/nrf/common-hal/{pulseio => pwmio}/PWMOut.c (89%) rename ports/nrf/common-hal/{pulseio => pwmio}/PWMOut.h (89%) create mode 100644 ports/nrf/common-hal/pwmio/__init__.c rename ports/stm/common-hal/{pulseio => pwmio}/PWMOut.c (92%) rename ports/stm/common-hal/{pulseio => pwmio}/PWMOut.h (88%) create mode 100644 ports/stm/common-hal/pwmio/__init__.c rename shared-bindings/{pulseio => pwmio}/PWMOut.c (67%) rename shared-bindings/{pulseio => pwmio}/PWMOut.h (60%) create mode 100644 shared-bindings/pwmio/__init__.c create mode 100644 shared-bindings/pwmio/__init__.h diff --git a/ports/atmel-samd/common-hal/pulseio/PulseOut.c b/ports/atmel-samd/common-hal/pulseio/PulseOut.c index e9b2137cb0..59714f9b50 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseOut.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseOut.c @@ -96,7 +96,7 @@ void pulseout_reset() { } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, - const pulseio_pwmout_obj_t* carrier) { + const pwmio_pwmout_obj_t* carrier) { if (refcount == 0) { // Find a spare timer. Tc *tc = NULL; diff --git a/ports/atmel-samd/common-hal/pulseio/PWMOut.c b/ports/atmel-samd/common-hal/pwmio/PWMOut.c similarity index 94% rename from ports/atmel-samd/common-hal/pulseio/PWMOut.c rename to ports/atmel-samd/common-hal/pwmio/PWMOut.c index e33437dada..2e538ccdc3 100644 --- a/ports/atmel-samd/common-hal/pulseio/PWMOut.c +++ b/ports/atmel-samd/common-hal/pwmio/PWMOut.c @@ -28,8 +28,8 @@ #include #include "py/runtime.h" -#include "common-hal/pulseio/PWMOut.h" -#include "shared-bindings/pulseio/PWMOut.h" +#include "common-hal/pwmio/PWMOut.h" +#include "shared-bindings/pwmio/PWMOut.h" #include "shared-bindings/microcontroller/Processor.h" #include "timer_handler.h" @@ -78,13 +78,13 @@ void timer_reset_ok(int index, bool is_tc) { } -void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) { +void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) { timer_never_reset(self->timer->index, self->timer->is_tc); never_reset_pin_number(self->pin->number); } -void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) { +void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self) { timer_reset_ok(self->timer->index, self->timer->is_tc); } @@ -137,7 +137,7 @@ bool channel_ok(const pin_timer_t* t) { t->is_tc; } -pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, +pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t* self, const mcu_pin_obj_t* pin, uint16_t duty, uint32_t frequency, @@ -296,16 +296,16 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, gpio_set_pin_function(pin->number, GPIO_PIN_FUNCTION_E + mux_position); - common_hal_pulseio_pwmout_set_duty_cycle(self, duty); + common_hal_pwmio_pwmout_set_duty_cycle(self, duty); return PWMOUT_OK; } -bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t* self) { +bool common_hal_pwmio_pwmout_deinited(pwmio_pwmout_obj_t* self) { return self->pin == NULL; } -void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { - if (common_hal_pulseio_pwmout_deinited(self)) { +void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self) { + if (common_hal_pwmio_pwmout_deinited(self)) { return; } const pin_timer_t* t = self->timer; @@ -331,7 +331,7 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { self->pin = NULL; } -extern void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty) { +extern void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t* self, uint16_t duty) { // Store the unadjusted duty cycle. It turns out the the process of adjusting and calculating // the duty cycle here and reading it back is lossy - the value will decay over time. // Track it here so that if frequency is changed we can use this value to recalculate the @@ -373,7 +373,7 @@ extern void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, } } -uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) { +uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t* self) { const pin_timer_t* t = self->timer; if (t->is_tc) { Tc* tc = tc_insts[t->index]; @@ -411,7 +411,7 @@ uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) { } -void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, +void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, uint32_t frequency) { if (frequency == 0 || frequency > 6000000) { mp_raise_ValueError(translate("Invalid PWM frequency")); @@ -466,10 +466,10 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, #endif } - common_hal_pulseio_pwmout_set_duty_cycle(self, self->duty_cycle); + common_hal_pwmio_pwmout_set_duty_cycle(self, self->duty_cycle); } -uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) { +uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t* self) { uint32_t system_clock = common_hal_mcu_processor_get_frequency(); const pin_timer_t* t = self->timer; uint8_t divisor; @@ -484,6 +484,6 @@ uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) { return (system_clock / prescaler[divisor]) / (top + 1); } -bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t* self) { +bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t* self) { return self->variable_frequency; } diff --git a/ports/atmel-samd/common-hal/pulseio/PWMOut.h b/ports/atmel-samd/common-hal/pwmio/PWMOut.h similarity index 87% rename from ports/atmel-samd/common-hal/pulseio/PWMOut.h rename to ports/atmel-samd/common-hal/pwmio/PWMOut.h index 09abda8196..1f5e62bae0 100644 --- a/ports/atmel-samd/common-hal/pulseio/PWMOut.h +++ b/ports/atmel-samd/common-hal/pwmio/PWMOut.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PULSEIO_PWMOUT_H -#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PULSEIO_PWMOUT_H +#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PWMIO_PWMOUT_H +#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PWMIO_PWMOUT_H #include "common-hal/microcontroller/Pin.h" @@ -37,8 +37,8 @@ typedef struct { const pin_timer_t* timer; bool variable_frequency; uint16_t duty_cycle; -} pulseio_pwmout_obj_t; +} pwmio_pwmout_obj_t; void pwmout_reset(void); -#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PULSEIO_PWMOUT_H +#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PWMIO_PWMOUT_H diff --git a/ports/atmel-samd/common-hal/pwmio/__init__.c b/ports/atmel-samd/common-hal/pwmio/__init__.c new file mode 100644 index 0000000000..9e551a1072 --- /dev/null +++ b/ports/atmel-samd/common-hal/pwmio/__init__.c @@ -0,0 +1 @@ +// No pwmio module functions. diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 591a858536..6352afb1d4 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -59,7 +59,7 @@ #include "common-hal/microcontroller/Pin.h" #include "common-hal/pulseio/PulseIn.h" #include "common-hal/pulseio/PulseOut.h" -#include "common-hal/pulseio/PWMOut.h" +#include "common-hal/pwmio/PWMOut.h" #include "common-hal/ps2io/Ps2.h" #include "common-hal/rtc/RTC.h" @@ -335,6 +335,8 @@ void reset_port(void) { #if CIRCUITPY_PULSEIO pulsein_reset(); pulseout_reset(); +#endif +#if CIRCUITPY_PWMIO pwmout_reset(); #endif diff --git a/ports/cxd56/common-hal/pulseio/PulseOut.c b/ports/cxd56/common-hal/pulseio/PulseOut.c index 21b4c77e55..a0c77b0a3d 100644 --- a/ports/cxd56/common-hal/pulseio/PulseOut.c +++ b/ports/cxd56/common-hal/pulseio/PulseOut.c @@ -59,7 +59,7 @@ static bool pulseout_timer_handler(unsigned int *next_interval_us, void *arg) } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self, - const pulseio_pwmout_obj_t *carrier) { + const pwmio_pwmout_obj_t *carrier) { if (pulse_fd < 0) { pulse_fd = open("/dev/timer0", O_RDONLY); } diff --git a/ports/cxd56/common-hal/pulseio/PWMOut.c b/ports/cxd56/common-hal/pwmio/PWMOut.c similarity index 82% rename from ports/cxd56/common-hal/pulseio/PWMOut.c rename to ports/cxd56/common-hal/pwmio/PWMOut.c index 7e0be566b4..e0eb7abde8 100644 --- a/ports/cxd56/common-hal/pulseio/PWMOut.c +++ b/ports/cxd56/common-hal/pwmio/PWMOut.c @@ -30,7 +30,7 @@ #include "py/runtime.h" -#include "shared-bindings/pulseio/PWMOut.h" +#include "shared-bindings/pwmio/PWMOut.h" typedef struct { const char* devpath; @@ -46,7 +46,7 @@ STATIC pwmout_dev_t pwmout_dev[] = { {"/dev/pwm3", &pin_PWM3, -1, true} }; -pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t *self, +pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self, const mcu_pin_obj_t *pin, uint16_t duty, uint32_t frequency, bool variable_frequency) { self->number = -1; @@ -85,8 +85,8 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t *self, return PWMOUT_OK; } -void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t *self) { - if (common_hal_pulseio_pwmout_deinited(self)) { +void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t *self) { + if (common_hal_pwmio_pwmout_deinited(self)) { return; } @@ -98,21 +98,21 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t *self) { self->pin = NULL; } -bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t *self) { +bool common_hal_pwmio_pwmout_deinited(pwmio_pwmout_obj_t *self) { return pwmout_dev[self->number].fd < 0; } -void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t *self, uint16_t duty) { +void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t *self, uint16_t duty) { self->info.duty = duty; ioctl(pwmout_dev[self->number].fd, PWMIOC_SETCHARACTERISTICS, (unsigned long)((uintptr_t)&self->info)); } -uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t *self) { +uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t *self) { return self->info.duty; } -void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t *self, uint32_t frequency) { +void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, uint32_t frequency) { self->info.frequency = frequency; if (ioctl(pwmout_dev[self->number].fd, PWMIOC_SETCHARACTERISTICS, (unsigned long)((uintptr_t)&self->info)) < 0) { @@ -120,21 +120,21 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t *self, uint32_ } } -uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t *self) { +uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t *self) { return self->info.frequency; } -bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t *self) { +bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t *self) { return self->variable_frequency; } -void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) { +void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) { never_reset_pin_number(self->pin->number); pwmout_dev[self->number].reset = false; } -void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) { +void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self) { pwmout_dev[self->number].reset = true; } diff --git a/ports/cxd56/common-hal/pulseio/PWMOut.h b/ports/cxd56/common-hal/pwmio/PWMOut.h similarity index 88% rename from ports/cxd56/common-hal/pulseio/PWMOut.h rename to ports/cxd56/common-hal/pwmio/PWMOut.h index 694acc4e0c..d9f3ea389d 100644 --- a/ports/cxd56/common-hal/pulseio/PWMOut.h +++ b/ports/cxd56/common-hal/pwmio/PWMOut.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_CXD56_COMMON_HAL_PULSEIO_PWMOUT_H -#define MICROPY_INCLUDED_CXD56_COMMON_HAL_PULSEIO_PWMOUT_H +#ifndef MICROPY_INCLUDED_CXD56_COMMON_HAL_PWMIO_PWMOUT_H +#define MICROPY_INCLUDED_CXD56_COMMON_HAL_PWMIO_PWMOUT_H #include @@ -39,10 +39,10 @@ typedef struct { struct pwm_info_s info; bool variable_frequency; int8_t number; -} pulseio_pwmout_obj_t; +} pwmio_pwmout_obj_t; void pwmout_reset(void); void pwmout_start(uint8_t pwm_num); void pwmout_stop(uint8_t pwm_num); -#endif // MICROPY_INCLUDED_CXD56_COMMON_HAL_PULSEIO_PWMOUT_H +#endif // MICROPY_INCLUDED_CXD56_COMMON_HAL_PWMIO_PWMOUT_H diff --git a/ports/cxd56/common-hal/pwmio/__init__.c b/ports/cxd56/common-hal/pwmio/__init__.c new file mode 100644 index 0000000000..2bee925bc7 --- /dev/null +++ b/ports/cxd56/common-hal/pwmio/__init__.c @@ -0,0 +1 @@ +// No pulseio module functions. diff --git a/ports/cxd56/supervisor/port.c b/ports/cxd56/supervisor/port.c index a40d31fafb..94eda66dc1 100644 --- a/ports/cxd56/supervisor/port.c +++ b/ports/cxd56/supervisor/port.c @@ -41,7 +41,7 @@ #include "common-hal/microcontroller/Pin.h" #include "common-hal/analogio/AnalogIn.h" #include "common-hal/pulseio/PulseOut.h" -#include "common-hal/pulseio/PWMOut.h" +#include "common-hal/pwmio/PWMOut.h" #include "common-hal/busio/UART.h" safe_mode_t port_init(void) { @@ -67,6 +67,8 @@ void reset_port(void) { #endif #if CIRCUITPY_PULSEIO pulseout_reset(); +#endif +#if CIRCUITPY_PWMIO pwmout_reset(); #endif #if CIRCUITPY_BUSIO diff --git a/ports/esp32s2/common-hal/pulseio/PulseOut.c b/ports/esp32s2/common-hal/pulseio/PulseOut.c index c448c578df..15eab83ddf 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseOut.c +++ b/ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -26,7 +26,7 @@ #include "common-hal/pulseio/PulseOut.h" -#include "shared-bindings/pulseio/PWMOut.h" +#include "shared-bindings/pwmio/PWMOut.h" #include "py/runtime.h" // STATIC void turn_on(pulseio_pulseout_obj_t *pulseout) { @@ -45,7 +45,7 @@ void pulseout_reset() { } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, - const pulseio_pwmout_obj_t* carrier) { + const pwmio_pwmout_obj_t* carrier) { mp_raise_NotImplementedError(translate("PulseOut not supported on this chip")); } diff --git a/ports/esp32s2/common-hal/pulseio/PulseOut.h b/ports/esp32s2/common-hal/pulseio/PulseOut.h index f465d00792..e58bb0457c 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseOut.h +++ b/ports/esp32s2/common-hal/pulseio/PulseOut.h @@ -28,13 +28,13 @@ #define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEOUT_H #include "common-hal/microcontroller/Pin.h" -#include "common-hal/pulseio/PWMOut.h" +#include "common-hal/pwmio/PWMOut.h" #include "py/obj.h" typedef struct { mp_obj_base_t base; - pulseio_pwmout_obj_t *pwmout; + pwmio_pwmout_obj_t *pwmout; } pulseio_pulseout_obj_t; void pulseout_reset(void); diff --git a/ports/esp32s2/common-hal/pulseio/PWMOut.c b/ports/esp32s2/common-hal/pwmio/PWMOut.c similarity index 87% rename from ports/esp32s2/common-hal/pulseio/PWMOut.c rename to ports/esp32s2/common-hal/pwmio/PWMOut.c index 0ac42852ae..d745b7789e 100644 --- a/ports/esp32s2/common-hal/pulseio/PWMOut.c +++ b/ports/esp32s2/common-hal/pwmio/PWMOut.c @@ -25,8 +25,8 @@ */ #include -#include "common-hal/pulseio/PWMOut.h" -#include "shared-bindings/pulseio/PWMOut.h" +#include "common-hal/pwmio/PWMOut.h" +#include "shared-bindings/pwmio/PWMOut.h" #include "py/runtime.h" #include "driver/ledc.h" @@ -58,7 +58,7 @@ void pwmout_reset(void) { not_first_reset = true; } -pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, +pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t* self, const mcu_pin_obj_t* pin, uint16_t duty, uint32_t frequency, @@ -140,27 +140,27 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, claim_pin(pin); // Set initial duty - common_hal_pulseio_pwmout_set_duty_cycle(self, duty); + common_hal_pwmio_pwmout_set_duty_cycle(self, duty); return PWMOUT_OK; } -void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) { +void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) { never_reset_tim[self->tim_handle.timer_num] = true; never_reset_chan[self->chan_handle.channel] = true; } -void common_hal_pulseio_pwmout_reset_ok(pulseio_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; } -bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t* self) { +bool common_hal_pwmio_pwmout_deinited(pwmio_pwmout_obj_t* self) { return self->deinited == true; } -void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { - if (common_hal_pulseio_pwmout_deinited(self)) { +void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self) { + if (common_hal_pwmio_pwmout_deinited(self)) { return; } @@ -186,23 +186,23 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { self->deinited = true; } -void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty) { +void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t* self, uint16_t duty) { ledc_set_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel, duty >> (16 - self->duty_resolution)); ledc_update_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel); } -uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) { +uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t* self) { return ledc_get_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel) << (16 - self->duty_resolution); } -void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_t frequency) { +void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, uint32_t frequency) { ledc_set_freq(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num, frequency); } -uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) { +uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t* self) { return ledc_get_freq(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num); } -bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t* self) { +bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t* self) { return self->variable_frequency; } diff --git a/ports/esp32s2/common-hal/pulseio/PWMOut.h b/ports/esp32s2/common-hal/pwmio/PWMOut.h similarity index 88% rename from ports/esp32s2/common-hal/pulseio/PWMOut.h rename to ports/esp32s2/common-hal/pwmio/PWMOut.h index 90a0c3ed96..c489e5a278 100644 --- a/ports/esp32s2/common-hal/pulseio/PWMOut.h +++ b/ports/esp32s2/common-hal/pwmio/PWMOut.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PWMOUT_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PWMOUT_H +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PWMIO_PWMOUT_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PWMIO_PWMOUT_H #include "common-hal/microcontroller/Pin.h" #include "driver/ledc.h" @@ -38,8 +38,8 @@ typedef struct { uint8_t duty_resolution; bool variable_frequency: 1; bool deinited: 1; -} pulseio_pwmout_obj_t; +} pwmio_pwmout_obj_t; void pwmout_reset(void); -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PWMOUT_H +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PWMIO_PWMOUT_H diff --git a/ports/esp32s2/common-hal/pwmio/__init__.c b/ports/esp32s2/common-hal/pwmio/__init__.c new file mode 100644 index 0000000000..2bee925bc7 --- /dev/null +++ b/ports/esp32s2/common-hal/pwmio/__init__.c @@ -0,0 +1 @@ +// No pulseio module functions. diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index e4767e5146..2f430c7e35 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -38,7 +38,7 @@ #include "common-hal/busio/I2C.h" #include "common-hal/busio/SPI.h" #include "common-hal/busio/UART.h" -#include "common-hal/pulseio/PWMOut.h" +#include "common-hal/pwmio/PWMOut.h" #include "supervisor/memory.h" #include "supervisor/shared/tick.h" @@ -65,7 +65,7 @@ void reset_port(void) { // A larger delay so the idle task can run and do any IDF cleanup needed. vTaskDelay(4); -#if CIRCUITPY_PULSEIO +#if CIRCUITPY_PWMIO pwmout_reset(); #endif #if CIRCUITPY_BUSIO diff --git a/ports/mimxrt10xx/common-hal/pulseio/PulseOut.c b/ports/mimxrt10xx/common-hal/pulseio/PulseOut.c index ffa885688a..2c27847eda 100644 --- a/ports/mimxrt10xx/common-hal/pulseio/PulseOut.c +++ b/ports/mimxrt10xx/common-hal/pulseio/PulseOut.c @@ -94,7 +94,7 @@ void pulseout_reset() { } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, - const pulseio_pwmout_obj_t* carrier) { + const pwmio_pwmout_obj_t* carrier) { // if (refcount == 0) { // // Find a spare timer. // Tc *tc = NULL; diff --git a/ports/mimxrt10xx/common-hal/pulseio/PWMOut.c b/ports/mimxrt10xx/common-hal/pwmio/PWMOut.c similarity index 94% rename from ports/mimxrt10xx/common-hal/pulseio/PWMOut.c rename to ports/mimxrt10xx/common-hal/pwmio/PWMOut.c index 50dd477ea6..dd464ef846 100644 --- a/ports/mimxrt10xx/common-hal/pulseio/PWMOut.c +++ b/ports/mimxrt10xx/common-hal/pwmio/PWMOut.c @@ -29,8 +29,8 @@ #include #include "py/runtime.h" -#include "common-hal/pulseio/PWMOut.h" -#include "shared-bindings/pulseio/PWMOut.h" +#include "common-hal/pwmio/PWMOut.h" +#include "shared-bindings/pwmio/PWMOut.h" #include "shared-bindings/microcontroller/Processor.h" #include "fsl_pwm.h" @@ -64,7 +64,7 @@ // //static uint8_t never_reset_tc_or_tcc[TC_INST_NUM + TCC_INST_NUM]; -void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) { +void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) { // if (self->timer->is_tc) { // never_reset_tc_or_tcc[self->timer->index] += 1; // } else { @@ -74,7 +74,7 @@ void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) { // never_reset_pin_number(self->pin->number); } -void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) { +void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self) { // if (self->timer->is_tc) { // never_reset_tc_or_tcc[self->timer->index] -= 1; // } else { @@ -133,7 +133,7 @@ void pwmout_reset(void) { #define PWM_SRC_CLK_FREQ CLOCK_GetFreq(kCLOCK_IpgClk) -pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t *self, +pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self, const mcu_pin_obj_t *pin, uint16_t duty, uint32_t frequency, @@ -359,17 +359,17 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t *self, // // gpio_set_pin_function(pin->number, GPIO_PIN_FUNCTION_E + mux_position); - common_hal_pulseio_pwmout_set_duty_cycle(self, duty); + common_hal_pwmio_pwmout_set_duty_cycle(self, duty); return PWMOUT_OK; } -bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t* self) { +bool common_hal_pwmio_pwmout_deinited(pwmio_pwmout_obj_t* self) { return self->pin == NULL; } -void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { - if (common_hal_pulseio_pwmout_deinited(self)) { +void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self) { + if (common_hal_pwmio_pwmout_deinited(self)) { return; } @@ -396,7 +396,7 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { self->pin = NULL; } -void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t *self, uint16_t duty) { +void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t *self, uint16_t duty) { PWM_UpdatePwmDutycycle(PWM1, self->pwm->submodule, self->pwm->channel, kPWM_SignedCenterAligned, duty); // const pin_timer_t* t = self->timer; @@ -433,7 +433,7 @@ void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t *self, uint16 // } } -uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) { +uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t* self) { return 0; // const pin_timer_t* t = self->timer; // if (t->is_tc) { @@ -471,7 +471,7 @@ uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) { // } } -void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, +void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, uint32_t frequency) { // if (frequency == 0 || frequency > 6000000) { // mp_raise_ValueError(translate("Invalid PWM frequency")); @@ -492,7 +492,7 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, // break; // } // } -// uint16_t old_duty = common_hal_pulseio_pwmout_get_duty_cycle(self); +// uint16_t old_duty = common_hal_pwmio_pwmout_get_duty_cycle(self); // if (t->is_tc) { // Tc* tc = tc_insts[t->index]; // uint8_t old_divisor = tc->COUNT16.CTRLA.bit.PRESCALER; @@ -527,10 +527,10 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, // #endif // } -// common_hal_pulseio_pwmout_set_duty_cycle(self, old_duty); +// common_hal_pwmio_pwmout_set_duty_cycle(self, old_duty); } -uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) { +uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t* self) { // uint32_t system_clock = common_hal_mcu_processor_get_frequency(); // const pin_timer_t* t = self->timer; // uint8_t divisor; @@ -546,6 +546,6 @@ uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) { return 0; } -bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t* self) { +bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t* self) { return self->variable_frequency; } diff --git a/ports/mimxrt10xx/common-hal/pulseio/PWMOut.h b/ports/mimxrt10xx/common-hal/pwmio/PWMOut.h similarity index 87% rename from ports/mimxrt10xx/common-hal/pulseio/PWMOut.h rename to ports/mimxrt10xx/common-hal/pwmio/PWMOut.h index 2f0fe94c44..d3954de401 100644 --- a/ports/mimxrt10xx/common-hal/pulseio/PWMOut.h +++ b/ports/mimxrt10xx/common-hal/pwmio/PWMOut.h @@ -25,8 +25,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PULSEIO_PWMOUT_H -#define MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PULSEIO_PWMOUT_H +#ifndef MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PWMIO_PWMOUT_H +#define MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PWMIO_PWMOUT_H #include "common-hal/microcontroller/Pin.h" #include "periph.h" @@ -37,8 +37,8 @@ typedef struct { const mcu_pin_obj_t *pin; const mcu_pwm_obj_t *pwm; bool variable_frequency; -} pulseio_pwmout_obj_t; +} pwmio_pwmout_obj_t; void pwmout_reset(void); -#endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PULSEIO_PWMOUT_H +#endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PWMIO_PWMOUT_H diff --git a/ports/mimxrt10xx/common-hal/pwmio/__init__.c b/ports/mimxrt10xx/common-hal/pwmio/__init__.c new file mode 100644 index 0000000000..2bee925bc7 --- /dev/null +++ b/ports/mimxrt10xx/common-hal/pwmio/__init__.c @@ -0,0 +1 @@ +// No pulseio module functions. diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 0b53a79f07..38cf16a494 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -39,7 +39,7 @@ #include "common-hal/microcontroller/Pin.h" #include "common-hal/pulseio/PulseIn.h" #include "common-hal/pulseio/PulseOut.h" -#include "common-hal/pulseio/PWMOut.h" +#include "common-hal/pwmio/PWMOut.h" #include "common-hal/rtc/RTC.h" #include "common-hal/busio/SPI.h" @@ -289,6 +289,8 @@ void reset_port(void) { #if CIRCUITPY_PULSEIO pulseout_reset(); +#endif +#if CIRCUITPY_PWMIO pwmout_reset(); #endif diff --git a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c index 7fec766fb8..ed1bf81e48 100644 --- a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c @@ -32,7 +32,7 @@ #include "py/mperrno.h" #include "py/runtime.h" #include "common-hal/audiopwmio/PWMAudioOut.h" -#include "common-hal/pulseio/PWMOut.h" +#include "common-hal/pwmio/PWMOut.h" #include "shared-bindings/audiopwmio/PWMAudioOut.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" diff --git a/ports/nrf/common-hal/pulseio/PulseOut.c b/ports/nrf/common-hal/pulseio/PulseOut.c index 270cb45d6d..16e383caf2 100644 --- a/ports/nrf/common-hal/pulseio/PulseOut.c +++ b/ports/nrf/common-hal/pulseio/PulseOut.c @@ -34,7 +34,7 @@ #include "py/gc.h" #include "py/runtime.h" #include "shared-bindings/pulseio/PulseOut.h" -#include "shared-bindings/pulseio/PWMOut.h" +#include "shared-bindings/pwmio/PWMOut.h" #include "supervisor/shared/translate.h" // A single timer is shared amongst all PulseOut objects under the assumption that @@ -100,7 +100,7 @@ void pulseout_reset() { } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, - const pulseio_pwmout_obj_t* carrier) { + const pwmio_pwmout_obj_t* carrier) { if (refcount == 0) { timer = nrf_peripherals_allocate_timer_or_throw(); } diff --git a/ports/nrf/common-hal/pulseio/PulseOut.h b/ports/nrf/common-hal/pulseio/PulseOut.h index 42ec52e30e..714f740b20 100644 --- a/ports/nrf/common-hal/pulseio/PulseOut.h +++ b/ports/nrf/common-hal/pulseio/PulseOut.h @@ -28,13 +28,13 @@ #define MICROPY_INCLUDED_NRF_COMMON_HAL_PULSEIO_PULSEOUT_H #include "common-hal/microcontroller/Pin.h" -#include "common-hal/pulseio/PWMOut.h" +#include "common-hal/pwmio/PWMOut.h" #include "py/obj.h" typedef struct { mp_obj_base_t base; - const pulseio_pwmout_obj_t *pwmout; + const pwmio_pwmout_obj_t *pwmout; } pulseio_pulseout_obj_t; void pulseout_reset(void); diff --git a/ports/nrf/common-hal/pulseio/PWMOut.c b/ports/nrf/common-hal/pwmio/PWMOut.c similarity index 89% rename from ports/nrf/common-hal/pulseio/PWMOut.c rename to ports/nrf/common-hal/pwmio/PWMOut.c index 9d42ccca0f..a9d8964883 100644 --- a/ports/nrf/common-hal/pulseio/PWMOut.c +++ b/ports/nrf/common-hal/pwmio/PWMOut.c @@ -28,8 +28,8 @@ #include "nrf.h" #include "py/runtime.h" -#include "common-hal/pulseio/PWMOut.h" -#include "shared-bindings/pulseio/PWMOut.h" +#include "common-hal/pwmio/PWMOut.h" +#include "shared-bindings/pwmio/PWMOut.h" #include "supervisor/shared/translate.h" #include "nrf_gpio.h" @@ -63,7 +63,7 @@ STATIC int pwm_idx(NRF_PWM_Type *pwm) { return -1; } -void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) { +void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) { for(size_t i=0; i < MP_ARRAY_SIZE(pwms); i++) { NRF_PWM_Type* pwm = pwms[i]; if (pwm == self->pwm) { @@ -74,7 +74,7 @@ void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) { never_reset_pin_number(self->pin_number); } -void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) { +void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self) { for(size_t i=0; i < MP_ARRAY_SIZE(pwms); i++) { NRF_PWM_Type* pwm = pwms[i]; if (pwm == self->pwm) { @@ -204,7 +204,7 @@ void pwmout_free_channel(NRF_PWM_Type *pwm, int8_t channel) { nrf_pwm_disable(pwm); } -pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, +pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t* self, const mcu_pin_obj_t* pin, uint16_t duty, uint32_t frequency, @@ -251,16 +251,16 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, nrf_pwm_enable(self->pwm); - common_hal_pulseio_pwmout_set_duty_cycle(self, duty); + common_hal_pwmio_pwmout_set_duty_cycle(self, duty); return PWMOUT_OK; } -bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t* self) { +bool common_hal_pwmio_pwmout_deinited(pwmio_pwmout_obj_t* self) { return self->pwm == NULL; } -void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { - if (common_hal_pulseio_pwmout_deinited(self)) { +void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self) { + if (common_hal_pwmio_pwmout_deinited(self)) { return; } @@ -275,7 +275,7 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { self->pin_number = NO_PIN; } -void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty_cycle) { +void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t* self, uint16_t duty_cycle) { self->duty_cycle = duty_cycle; uint16_t* p_value = ((uint16_t*)self->pwm->SEQ[0].PTR) + self->channel; @@ -284,11 +284,11 @@ void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16 self->pwm->TASKS_SEQSTART[0] = 1; } -uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) { +uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t* self) { return self->duty_cycle; } -void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_t frequency) { +void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, uint32_t frequency) { // COUNTERTOP is 3..32767, so highest available frequency is PWM_MAX_FREQ / 3. uint16_t countertop; nrf_pwm_clk_t base_clock; @@ -300,13 +300,13 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_ nrf_pwm_configure(self->pwm, base_clock, NRF_PWM_MODE_UP, countertop); // Set the duty cycle again, because it depends on COUNTERTOP, which probably changed. // Setting the duty cycle will also do a SEQSTART. - common_hal_pulseio_pwmout_set_duty_cycle(self, self->duty_cycle); + common_hal_pwmio_pwmout_set_duty_cycle(self, self->duty_cycle); } -uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) { +uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t* self) { return self->frequency; } -bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t* self) { +bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t* self) { return self->variable_frequency; } diff --git a/ports/nrf/common-hal/pulseio/PWMOut.h b/ports/nrf/common-hal/pwmio/PWMOut.h similarity index 89% rename from ports/nrf/common-hal/pulseio/PWMOut.h rename to ports/nrf/common-hal/pwmio/PWMOut.h index a0c2d87471..e910baa765 100644 --- a/ports/nrf/common-hal/pulseio/PWMOut.h +++ b/ports/nrf/common-hal/pwmio/PWMOut.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_PULSEIO_PWMOUT_H -#define MICROPY_INCLUDED_NRF_COMMON_HAL_PULSEIO_PWMOUT_H +#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_PWMIO_PWMOUT_H +#define MICROPY_INCLUDED_NRF_COMMON_HAL_PWMIO_PWMOUT_H #include "nrfx_pwm.h" #include "py/obj.h" @@ -38,7 +38,7 @@ typedef struct { bool variable_frequency: 1; uint16_t duty_cycle; uint32_t frequency; -} pulseio_pwmout_obj_t; +} pwmio_pwmout_obj_t; void pwmout_reset(void); NRF_PWM_Type *pwmout_allocate(uint16_t countertop, nrf_pwm_clk_t base_clock, @@ -46,4 +46,4 @@ NRF_PWM_Type *pwmout_allocate(uint16_t countertop, nrf_pwm_clk_t base_clock, IRQn_Type *irq); void pwmout_free_channel(NRF_PWM_Type *pwm, int8_t channel); -#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_PULSEIO_PWMOUT_H +#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_PWMIO_PWMOUT_H diff --git a/ports/nrf/common-hal/pwmio/__init__.c b/ports/nrf/common-hal/pwmio/__init__.c new file mode 100644 index 0000000000..9e551a1072 --- /dev/null +++ b/ports/nrf/common-hal/pwmio/__init__.c @@ -0,0 +1 @@ +// No pwmio module functions. diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 87a4d7396f..2945f244db 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -45,9 +45,9 @@ #include "common-hal/busio/I2C.h" #include "common-hal/busio/SPI.h" #include "common-hal/busio/UART.h" -#include "common-hal/pulseio/PWMOut.h" #include "common-hal/pulseio/PulseOut.h" #include "common-hal/pulseio/PulseIn.h" +#include "common-hal/pwmio/PWMOut.h" #include "common-hal/rtc/RTC.h" #include "common-hal/neopixel_write/__init__.h" #include "common-hal/watchdog/WatchDogTimer.h" @@ -196,11 +196,14 @@ void reset_port(void) { #if CIRCUITPY_PULSEIO - pwmout_reset(); pulseout_reset(); pulsein_reset(); #endif +#if CIRCUITPY_PWMIO + pwmout_reset(); +#endif + #if CIRCUITPY_RTC rtc_reset(); #endif diff --git a/ports/stm/common-hal/pulseio/PulseOut.c b/ports/stm/common-hal/pulseio/PulseOut.c index bcc25d8177..fb48561d89 100644 --- a/ports/stm/common-hal/pulseio/PulseOut.c +++ b/ports/stm/common-hal/pulseio/PulseOut.c @@ -32,7 +32,7 @@ #include "py/gc.h" #include "py/runtime.h" #include "shared-bindings/pulseio/PulseOut.h" -#include "shared-bindings/pulseio/PWMOut.h" +#include "shared-bindings/pwmio/PWMOut.h" #include "supervisor/shared/translate.h" #include STM32_HAL_H @@ -113,7 +113,7 @@ void pulseout_reset() { } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, - const pulseio_pwmout_obj_t* carrier) { + const pwmio_pwmout_obj_t* carrier) { // Add to active PulseOuts refcount++; TIM_TypeDef * tim_instance = stm_peripherals_find_timer(); @@ -135,7 +135,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, tim_handle.Instance->SR = 0; // The HAL can't work with const, recast required. - self->pwmout = (pulseio_pwmout_obj_t*)carrier; + self->pwmout = (pwmio_pwmout_obj_t*)carrier; turn_off(self); } diff --git a/ports/stm/common-hal/pulseio/PulseOut.h b/ports/stm/common-hal/pulseio/PulseOut.h index aa97396d00..29894f27d2 100644 --- a/ports/stm/common-hal/pulseio/PulseOut.h +++ b/ports/stm/common-hal/pulseio/PulseOut.h @@ -28,13 +28,13 @@ #define MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PULSEOUT_H #include "common-hal/microcontroller/Pin.h" -#include "common-hal/pulseio/PWMOut.h" +#include "common-hal/pwmio/PWMOut.h" #include "py/obj.h" typedef struct { mp_obj_base_t base; - pulseio_pwmout_obj_t *pwmout; + pwmio_pwmout_obj_t *pwmout; } pulseio_pulseout_obj_t; void pulseout_reset(void); diff --git a/ports/stm/common-hal/pulseio/PWMOut.c b/ports/stm/common-hal/pwmio/PWMOut.c similarity index 92% rename from ports/stm/common-hal/pulseio/PWMOut.c rename to ports/stm/common-hal/pwmio/PWMOut.c index ddbadaf4ce..065eb2a757 100644 --- a/ports/stm/common-hal/pulseio/PWMOut.c +++ b/ports/stm/common-hal/pwmio/PWMOut.c @@ -27,8 +27,8 @@ #include #include "py/runtime.h" -#include "common-hal/pulseio/PWMOut.h" -#include "shared-bindings/pulseio/PWMOut.h" +#include "common-hal/pwmio/PWMOut.h" +#include "shared-bindings/pwmio/PWMOut.h" #include "supervisor/shared/translate.h" #include "shared-bindings/microcontroller/__init__.h" @@ -75,7 +75,7 @@ void pwmout_reset(void) { } } -pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, +pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t* self, const mcu_pin_obj_t* pin, uint16_t duty, uint32_t frequency, @@ -204,7 +204,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, return PWMOUT_OK; } -void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) { +void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) { for (size_t i = 0; i < TIM_BANK_ARRAY_LEN; i++) { if (mcu_tim_banks[i] == self->handle.Instance) { never_reset_tim[i] = true; @@ -214,7 +214,7 @@ void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) { } } -void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) { +void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self) { for(size_t i = 0; i < TIM_BANK_ARRAY_LEN; i++) { if (mcu_tim_banks[i] == self->handle.Instance) { never_reset_tim[i] = false; @@ -223,12 +223,12 @@ void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) { } } -bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t* self) { +bool common_hal_pwmio_pwmout_deinited(pwmio_pwmout_obj_t* self) { return self->tim == NULL; } -void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { - if (common_hal_pulseio_pwmout_deinited(self)) { +void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self) { + if (common_hal_pwmio_pwmout_deinited(self)) { return; } //var freq shuts down entire timer, others just their channel @@ -248,17 +248,17 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { } } -void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty) { +void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t* self, uint16_t duty) { uint32_t internal_duty_cycle = timer_get_internal_duty(duty, self->period); __HAL_TIM_SET_COMPARE(&self->handle, self->channel, internal_duty_cycle); self->duty_cycle = duty; } -uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) { +uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t* self) { return self->duty_cycle; } -void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_t frequency) { +void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, uint32_t frequency) { //don't halt setup for the same frequency if (frequency == self->frequency) { return; @@ -295,10 +295,10 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_ self->period = period; } -uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) { +uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t* self) { return self->frequency; } -bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t* self) { +bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t* self) { return self->variable_frequency; } diff --git a/ports/stm/common-hal/pulseio/PWMOut.h b/ports/stm/common-hal/pwmio/PWMOut.h similarity index 88% rename from ports/stm/common-hal/pulseio/PWMOut.h rename to ports/stm/common-hal/pwmio/PWMOut.h index 57ab143b9a..5d8001202c 100644 --- a/ports/stm/common-hal/pulseio/PWMOut.h +++ b/ports/stm/common-hal/pwmio/PWMOut.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PWMOUT_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PWMOUT_H +#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_PWMIO_PWMOUT_H +#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_PWMIO_PWMOUT_H #include "common-hal/microcontroller/Pin.h" @@ -44,8 +44,8 @@ typedef struct { uint16_t duty_cycle; uint32_t frequency; uint32_t period; -} pulseio_pwmout_obj_t; +} pwmio_pwmout_obj_t; void pwmout_reset(void); -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PWMOUT_H +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_PWMIO_PWMOUT_H diff --git a/ports/stm/common-hal/pwmio/__init__.c b/ports/stm/common-hal/pwmio/__init__.c new file mode 100644 index 0000000000..9e551a1072 --- /dev/null +++ b/ports/stm/common-hal/pwmio/__init__.c @@ -0,0 +1 @@ +// No pwmio module functions. diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 5ce92f70a4..e21105001c 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -38,9 +38,13 @@ #include "common-hal/busio/UART.h" #endif #if CIRCUITPY_PULSEIO -#include "common-hal/pulseio/PWMOut.h" #include "common-hal/pulseio/PulseOut.h" #include "common-hal/pulseio/PulseIn.h" +#endif +#if CIRCUITPY_PWMIO +#include "common-hal/pwmio/PWMOut.h" +#endif +#if CIRCUITPY_PULSEIO || CIRCUITPY_PWMIO #include "timers.h" #endif #if CIRCUITPY_SDIOIO @@ -230,12 +234,16 @@ void reset_port(void) { #if CIRCUITPY_SDIOIO sdioio_reset(); #endif -#if CIRCUITPY_PULSEIO +#if CIRCUITPY_PULSEIO || CIRCUITPY_PWMIO timers_reset(); - pwmout_reset(); +#endif +#if CIRCUITPY_PULSEIO pulseout_reset(); pulsein_reset(); #endif +#if CIRCUITPY_PWMIO + pwmout_reset(); +#endif } void reset_to_bootloader(void) { diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index b70ae64a80..ab7a3af60b 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -198,11 +198,14 @@ endif ifeq ($(CIRCUITPY_RGBMATRIX),1) SRC_PATTERNS += rgbmatrix/% endif +ifeq ($(CIRCUITPY_PS2IO),1) +SRC_PATTERNS += ps2io/% +endif ifeq ($(CIRCUITPY_PULSEIO),1) SRC_PATTERNS += pulseio/% endif -ifeq ($(CIRCUITPY_PS2IO),1) -SRC_PATTERNS += ps2io/% +ifeq ($(CIRCUITPY_PWMIO),1) +SRC_PATTERNS += pwmio/% endif ifeq ($(CIRCUITPY_RANDOM),1) SRC_PATTERNS += random/% @@ -316,10 +319,11 @@ SRC_COMMON_HAL_ALL = \ os/__init__.c \ ps2io/Ps2.c \ ps2io/__init__.c \ - pulseio/PWMOut.c \ pulseio/PulseIn.c \ pulseio/PulseOut.c \ pulseio/__init__.c \ + pwmio/PWMOut.c \ + pwmio/__init__.c \ rgbmatrix/RGBMatrix.c \ rgbmatrix/__init__.c \ rotaryio/IncrementalEncoder.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 12d667d8f8..76b91defae 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -503,6 +503,13 @@ extern const struct _mp_obj_module_t pixelbuf_module; #define PIXELBUF_MODULE #endif +#if CIRCUITPY_PS2IO +extern const struct _mp_obj_module_t ps2io_module; +#define PS2IO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_ps2io), (mp_obj_t)&ps2io_module }, +#else +#define PS2IO_MODULE +#endif + #if CIRCUITPY_PULSEIO extern const struct _mp_obj_module_t pulseio_module; #define PULSEIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_pulseio), (mp_obj_t)&pulseio_module }, @@ -510,11 +517,11 @@ extern const struct _mp_obj_module_t pulseio_module; #define PULSEIO_MODULE #endif -#if CIRCUITPY_PS2IO -extern const struct _mp_obj_module_t ps2io_module; -#define PS2IO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_ps2io), (mp_obj_t)&ps2io_module }, +#if CIRCUITPY_PWMIO +extern const struct _mp_obj_module_t pwmio_module; +#define PWMIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_pwmio), (mp_obj_t)&pwmio_module }, #else -#define PS2IO_MODULE +#define PWMIO_MODULE #endif #if CIRCUITPY_RGBMATRIX @@ -740,6 +747,7 @@ extern const struct _mp_obj_module_t watchdog_module; PIXELBUF_MODULE \ PS2IO_MODULE \ PULSEIO_MODULE \ + PWMIO_MODULE \ RANDOM_MODULE \ RE_MODULE \ RGBMATRIX_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index bdc1e77d54..379c3850e3 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -148,19 +148,24 @@ CFLAGS += -DCIRCUITPY_OS=$(CIRCUITPY_OS) CIRCUITPY_PIXELBUF ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_PIXELBUF=$(CIRCUITPY_PIXELBUF) -CIRCUITPY_RGBMATRIX ?= 0 -CFLAGS += -DCIRCUITPY_RGBMATRIX=$(CIRCUITPY_RGBMATRIX) - -CIRCUITPY_PULSEIO ?= 1 -CFLAGS += -DCIRCUITPY_PULSEIO=$(CIRCUITPY_PULSEIO) - # Only for SAMD boards for the moment CIRCUITPY_PS2IO ?= 0 CFLAGS += -DCIRCUITPY_PS2IO=$(CIRCUITPY_PS2IO) +CIRCUITPY_PULSEIO ?= 1 +CFLAGS += -DCIRCUITPY_PULSEIO=$(CIRCUITPY_PULSEIO) + +# For now we tie PWMIO to PULSEIO so they always both exist. In CircuitPython 7 +# we can enable and disable them separately once PWMOut is removed from `pulseio`. +CIRCUITPY_PWMIO = $(CIRCUITPY_PULSEIO) +CFLAGS += -DCIRCUITPY_PWMIO=$(CIRCUITPY_PWMIO) + CIRCUITPY_RANDOM ?= 1 CFLAGS += -DCIRCUITPY_RANDOM=$(CIRCUITPY_RANDOM) +CIRCUITPY_RGBMATRIX ?= 0 +CFLAGS += -DCIRCUITPY_RGBMATRIX=$(CIRCUITPY_RGBMATRIX) + CIRCUITPY_ROTARYIO ?= 1 CFLAGS += -DCIRCUITPY_ROTARYIO=$(CIRCUITPY_ROTARYIO) diff --git a/shared-bindings/pulseio/PulseOut.c b/shared-bindings/pulseio/PulseOut.c index 3d35f05445..024ee613ce 100644 --- a/shared-bindings/pulseio/PulseOut.c +++ b/shared-bindings/pulseio/PulseOut.c @@ -32,7 +32,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/pulseio/PulseOut.h" -#include "shared-bindings/pulseio/PWMOut.h" +#include "shared-bindings/pwmio/PWMOut.h" #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" @@ -41,19 +41,20 @@ //| pulsed signal consists of timed on and off periods. Unlike PWM, there is no set duration //| for on and off pairs.""" //| -//| def __init__(self, carrier: PWMOut) -> None: +//| def __init__(self, carrier: pwmio.PWMOut) -> None: //| """Create a PulseOut object associated with the given PWMout object. //| -//| :param ~pulseio.PWMOut carrier: PWMOut that is set to output on the desired pin. +//| :param ~pwmio.PWMOut carrier: PWMOut that is set to output on the desired pin. //| //| Send a short series of pulses:: //| //| import array //| import pulseio +//| import pwmio //| import board //| //| # 50% duty cycle at 38kHz. -//| pwm = pulseio.PWMOut(board.D13, frequency=38000, duty_cycle=32768) +//| pwm = pwmio.PWMOut(board.D13, frequency=38000, duty_cycle=32768) //| pulse = pulseio.PulseOut(pwm) //| # on off on off on //| pulses = array.array('H', [65000, 1000, 65000, 65000, 1000]) @@ -68,15 +69,15 @@ STATIC mp_obj_t pulseio_pulseout_make_new(const mp_obj_type_t *type, size_t n_ar mp_arg_check_num(n_args, kw_args, 1, 1, false); mp_obj_t carrier_obj = args[0]; - if (!MP_OBJ_IS_TYPE(carrier_obj, &pulseio_pwmout_type)) { - mp_raise_TypeError_varg(translate("Expected a %q"), pulseio_pwmout_type.name); + if (!MP_OBJ_IS_TYPE(carrier_obj, &pwmio_pwmout_type)) { + mp_raise_TypeError_varg(translate("Expected a %q"), pwmio_pwmout_type.name); } // create Pulse object from the given pin pulseio_pulseout_obj_t *self = m_new_obj(pulseio_pulseout_obj_t); self->base.type = &pulseio_pulseout_type; - common_hal_pulseio_pulseout_construct(self, (pulseio_pwmout_obj_t *)MP_OBJ_TO_PTR(carrier_obj)); + common_hal_pulseio_pulseout_construct(self, (pwmio_pwmout_obj_t *)MP_OBJ_TO_PTR(carrier_obj)); return MP_OBJ_FROM_PTR(self); } diff --git a/shared-bindings/pulseio/PulseOut.h b/shared-bindings/pulseio/PulseOut.h index 390910ff62..80dd0e92f0 100644 --- a/shared-bindings/pulseio/PulseOut.h +++ b/shared-bindings/pulseio/PulseOut.h @@ -29,12 +29,12 @@ #include "common-hal/microcontroller/Pin.h" #include "common-hal/pulseio/PulseOut.h" -#include "common-hal/pulseio/PWMOut.h" +#include "common-hal/pwmio/PWMOut.h" extern const mp_obj_type_t pulseio_pulseout_type; extern void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, - const pulseio_pwmout_obj_t* carrier); + const pwmio_pwmout_obj_t* carrier); extern void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t* self); extern bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t* self); extern void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t* self, diff --git a/shared-bindings/pulseio/__init__.c b/shared-bindings/pulseio/__init__.c index 87946e5f0b..efef640433 100644 --- a/shared-bindings/pulseio/__init__.c +++ b/shared-bindings/pulseio/__init__.c @@ -33,40 +33,29 @@ #include "shared-bindings/pulseio/__init__.h" #include "shared-bindings/pulseio/PulseIn.h" #include "shared-bindings/pulseio/PulseOut.h" -#include "shared-bindings/pulseio/PWMOut.h" +#include "shared-bindings/pwmio/PWMOut.h" -//| """Support for pulse based protocols +//| """Support for individual pulse based protocols //| //| The `pulseio` module contains classes to provide access to basic pulse IO. +//| Individual pulses are commonly used in infrared remotes and in DHT +//| temperature sensors. //| +//| .. warning:: PWMOut is moving to `pwmio` and will be removed from `pulseio` +//| in CircuitPython 7. + //| All classes change hardware state and should be deinitialized when they //| are no longer needed if the program continues after use. To do so, either //| call :py:meth:`!deinit` or use a context manager. See //| :ref:`lifetime-and-contextmanagers` for more info. //| -//| For example:: -//| -//| import pulseio -//| import time -//| from board import * -//| -//| pwm = pulseio.PWMOut(D13) -//| pwm.duty_cycle = 2 ** 15 -//| time.sleep(0.1) -//| -//| This example will initialize the the device, set -//| :py:data:`~pulseio.PWMOut.duty_cycle`, and then sleep 0.1 seconds. -//| CircuitPython will automatically turn off the PWM when it resets all -//| hardware after program completion. Use ``deinit()`` or a ``with`` statement -//| to do it yourself.""" -//| STATIC const mp_rom_map_elem_t pulseio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_pulseio) }, { MP_ROM_QSTR(MP_QSTR_PulseIn), MP_ROM_PTR(&pulseio_pulsein_type) }, { MP_ROM_QSTR(MP_QSTR_PulseOut), MP_ROM_PTR(&pulseio_pulseout_type) }, - { MP_ROM_QSTR(MP_QSTR_PWMOut), MP_ROM_PTR(&pulseio_pwmout_type) }, + { MP_ROM_QSTR(MP_QSTR_PWMOut), MP_ROM_PTR(&pwmio_pwmout_type) }, }; STATIC MP_DEFINE_CONST_DICT(pulseio_module_globals, pulseio_module_globals_table); diff --git a/shared-bindings/pulseio/PWMOut.c b/shared-bindings/pwmio/PWMOut.c similarity index 67% rename from shared-bindings/pulseio/PWMOut.c rename to shared-bindings/pwmio/PWMOut.c index e9b6c45d20..da07555928 100644 --- a/shared-bindings/pulseio/PWMOut.c +++ b/shared-bindings/pwmio/PWMOut.c @@ -31,7 +31,7 @@ #include "py/runtime.h" #include "shared-bindings/microcontroller/Pin.h" -#include "shared-bindings/pulseio/PWMOut.h" +#include "shared-bindings/pwmio/PWMOut.h" #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" @@ -55,33 +55,33 @@ //| //| Simple LED fade:: //| -//| import pulseio +//| import pwmio //| import board //| -//| pwm = pulseio.PWMOut(board.D13) # output on D13 +//| pwm = pwmio.PWMOut(board.D13) # output on D13 //| pwm.duty_cycle = 2 ** 15 # Cycles the pin with 50% duty cycle (half of 2 ** 16) at the default 500hz //| //| PWM at specific frequency (servos and motors):: //| -//| import pulseio +//| import pwmio //| import board //| -//| pwm = pulseio.PWMOut(board.D13, frequency=50) +//| pwm = pwmio.PWMOut(board.D13, frequency=50) //| pwm.duty_cycle = 2 ** 15 # Cycles the pin with 50% duty cycle (half of 2 ** 16) at 50hz //| //| Variable frequency (usually tones):: //| -//| import pulseio +//| import pwmio //| import board //| import time //| -//| pwm = pulseio.PWMOut(board.D13, duty_cycle=2 ** 15, frequency=440, variable_frequency=True) +//| pwm = pwmio.PWMOut(board.D13, duty_cycle=2 ** 15, frequency=440, variable_frequency=True) //| time.sleep(0.2) //| pwm.frequency = 880 //| time.sleep(0.1)""" //| ... //| -STATIC mp_obj_t pulseio_pwmout_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { +STATIC mp_obj_t pwmio_pwmout_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { enum { ARG_pin, ARG_duty_cycle, ARG_frequency, ARG_variable_frequency }; static const mp_arg_t allowed_args[] = { { MP_QSTR_pin, MP_ARG_REQUIRED | MP_ARG_OBJ, }, @@ -99,9 +99,9 @@ STATIC mp_obj_t pulseio_pwmout_make_new(const mp_obj_type_t *type, size_t n_args bool variable_frequency = parsed_args[ARG_variable_frequency].u_bool; // create PWM object from the given pin - pulseio_pwmout_obj_t *self = m_new_obj(pulseio_pwmout_obj_t); - self->base.type = &pulseio_pwmout_type; - pwmout_result_t result = common_hal_pulseio_pwmout_construct(self, pin, duty_cycle, frequency, variable_frequency); + pwmio_pwmout_obj_t *self = m_new_obj(pwmio_pwmout_obj_t); + self->base.type = &pwmio_pwmout_type; + pwmout_result_t result = common_hal_pwmio_pwmout_construct(self, pin, duty_cycle, frequency, variable_frequency); if (result == PWMOUT_INVALID_PIN) { mp_raise_ValueError(translate("Invalid pin")); } else if (result == PWMOUT_INVALID_FREQUENCY) { @@ -119,15 +119,15 @@ STATIC mp_obj_t pulseio_pwmout_make_new(const mp_obj_type_t *type, size_t n_args //| """Deinitialises the PWMOut and releases any hardware resources for reuse.""" //| ... //| -STATIC mp_obj_t pulseio_pwmout_deinit(mp_obj_t self_in) { - pulseio_pwmout_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_pulseio_pwmout_deinit(self); +STATIC mp_obj_t pwmio_pwmout_deinit(mp_obj_t self_in) { + pwmio_pwmout_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_pwmio_pwmout_deinit(self); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(pulseio_pwmout_deinit_obj, pulseio_pwmout_deinit); +STATIC MP_DEFINE_CONST_FUN_OBJ_1(pwmio_pwmout_deinit_obj, pwmio_pwmout_deinit); -STATIC void check_for_deinit(pulseio_pwmout_obj_t *self) { - if (common_hal_pulseio_pwmout_deinited(self)) { +STATIC void check_for_deinit(pwmio_pwmout_obj_t *self) { + if (common_hal_pwmio_pwmout_deinited(self)) { raise_deinited_error(); } } @@ -143,12 +143,12 @@ STATIC void check_for_deinit(pulseio_pwmout_obj_t *self) { //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... //| -STATIC mp_obj_t pulseio_pwmout_obj___exit__(size_t n_args, const mp_obj_t *args) { +STATIC mp_obj_t pwmio_pwmout_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; - common_hal_pulseio_pwmout_deinit(args[0]); + common_hal_pwmio_pwmout_deinit(args[0]); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pulseio_pwmout___exit___obj, 4, 4, pulseio_pwmout_obj___exit__); +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pwmio_pwmout___exit___obj, 4, 4, pwmio_pwmout_obj___exit__); //| duty_cycle: int //| """16 bit value that dictates how much of one cycle is high (1) versus low @@ -160,29 +160,29 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pulseio_pwmout___exit___obj, 4, 4, pu //| Reading this property will return the value from the internal representation, //| so it may differ from the value set.""" //| -STATIC mp_obj_t pulseio_pwmout_obj_get_duty_cycle(mp_obj_t self_in) { - pulseio_pwmout_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t pwmio_pwmout_obj_get_duty_cycle(mp_obj_t self_in) { + pwmio_pwmout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); - return MP_OBJ_NEW_SMALL_INT(common_hal_pulseio_pwmout_get_duty_cycle(self)); + return MP_OBJ_NEW_SMALL_INT(common_hal_pwmio_pwmout_get_duty_cycle(self)); } -MP_DEFINE_CONST_FUN_OBJ_1(pulseio_pwmout_get_duty_cycle_obj, pulseio_pwmout_obj_get_duty_cycle); +MP_DEFINE_CONST_FUN_OBJ_1(pwmio_pwmout_get_duty_cycle_obj, pwmio_pwmout_obj_get_duty_cycle); -STATIC mp_obj_t pulseio_pwmout_obj_set_duty_cycle(mp_obj_t self_in, mp_obj_t duty_cycle) { - pulseio_pwmout_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t pwmio_pwmout_obj_set_duty_cycle(mp_obj_t self_in, mp_obj_t duty_cycle) { + pwmio_pwmout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); mp_int_t duty = mp_obj_get_int(duty_cycle); if (duty < 0 || duty > 0xffff) { mp_raise_ValueError(translate("PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)")); } - common_hal_pulseio_pwmout_set_duty_cycle(self, duty); + common_hal_pwmio_pwmout_set_duty_cycle(self, duty); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_2(pulseio_pwmout_set_duty_cycle_obj, pulseio_pwmout_obj_set_duty_cycle); +MP_DEFINE_CONST_FUN_OBJ_2(pwmio_pwmout_set_duty_cycle_obj, pwmio_pwmout_obj_set_duty_cycle); -const mp_obj_property_t pulseio_pwmout_duty_cycle_obj = { +const mp_obj_property_t pwmio_pwmout_duty_cycle_obj = { .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&pulseio_pwmout_get_duty_cycle_obj, - (mp_obj_t)&pulseio_pwmout_set_duty_cycle_obj, + .proxy = {(mp_obj_t)&pwmio_pwmout_get_duty_cycle_obj, + (mp_obj_t)&pwmio_pwmout_set_duty_cycle_obj, (mp_obj_t)&mp_const_none_obj}, }; @@ -196,50 +196,50 @@ const mp_obj_property_t pulseio_pwmout_duty_cycle_obj = { //| from the original duty cycle value. This should happen without any need //| to manually re-set the duty cycle.""" //| -STATIC mp_obj_t pulseio_pwmout_obj_get_frequency(mp_obj_t self_in) { - pulseio_pwmout_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t pwmio_pwmout_obj_get_frequency(mp_obj_t self_in) { + pwmio_pwmout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); - return MP_OBJ_NEW_SMALL_INT(common_hal_pulseio_pwmout_get_frequency(self)); + return MP_OBJ_NEW_SMALL_INT(common_hal_pwmio_pwmout_get_frequency(self)); } -MP_DEFINE_CONST_FUN_OBJ_1(pulseio_pwmout_get_frequency_obj, pulseio_pwmout_obj_get_frequency); +MP_DEFINE_CONST_FUN_OBJ_1(pwmio_pwmout_get_frequency_obj, pwmio_pwmout_obj_get_frequency); -STATIC mp_obj_t pulseio_pwmout_obj_set_frequency(mp_obj_t self_in, mp_obj_t frequency) { - pulseio_pwmout_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t pwmio_pwmout_obj_set_frequency(mp_obj_t self_in, mp_obj_t frequency) { + pwmio_pwmout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); - if (!common_hal_pulseio_pwmout_get_variable_frequency(self)) { + if (!common_hal_pwmio_pwmout_get_variable_frequency(self)) { mp_raise_AttributeError(translate( "PWM frequency not writable when variable_frequency is False on " "construction.")); } - common_hal_pulseio_pwmout_set_frequency(self, mp_obj_get_int(frequency)); + common_hal_pwmio_pwmout_set_frequency(self, mp_obj_get_int(frequency)); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_2(pulseio_pwmout_set_frequency_obj, pulseio_pwmout_obj_set_frequency); +MP_DEFINE_CONST_FUN_OBJ_2(pwmio_pwmout_set_frequency_obj, pwmio_pwmout_obj_set_frequency); -const mp_obj_property_t pulseio_pwmout_frequency_obj = { +const mp_obj_property_t pwmio_pwmout_frequency_obj = { .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&pulseio_pwmout_get_frequency_obj, - (mp_obj_t)&pulseio_pwmout_set_frequency_obj, + .proxy = {(mp_obj_t)&pwmio_pwmout_get_frequency_obj, + (mp_obj_t)&pwmio_pwmout_set_frequency_obj, (mp_obj_t)&mp_const_none_obj}, }; -STATIC const mp_rom_map_elem_t pulseio_pwmout_locals_dict_table[] = { +STATIC const mp_rom_map_elem_t pwmio_pwmout_locals_dict_table[] = { // Methods - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&pulseio_pwmout_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&pwmio_pwmout_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&pulseio_pwmout___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&pwmio_pwmout___exit___obj) }, // Properties - { MP_ROM_QSTR(MP_QSTR_duty_cycle), MP_ROM_PTR(&pulseio_pwmout_duty_cycle_obj) }, - { MP_ROM_QSTR(MP_QSTR_frequency), MP_ROM_PTR(&pulseio_pwmout_frequency_obj) }, + { MP_ROM_QSTR(MP_QSTR_duty_cycle), MP_ROM_PTR(&pwmio_pwmout_duty_cycle_obj) }, + { MP_ROM_QSTR(MP_QSTR_frequency), MP_ROM_PTR(&pwmio_pwmout_frequency_obj) }, // TODO(tannewt): Add enabled to determine whether the signal is output // without giving up the resources. Useful for IR output. }; -STATIC MP_DEFINE_CONST_DICT(pulseio_pwmout_locals_dict, pulseio_pwmout_locals_dict_table); +STATIC MP_DEFINE_CONST_DICT(pwmio_pwmout_locals_dict, pwmio_pwmout_locals_dict_table); -const mp_obj_type_t pulseio_pwmout_type = { +const mp_obj_type_t pwmio_pwmout_type = { { &mp_type_type }, .name = MP_QSTR_PWMOut, - .make_new = pulseio_pwmout_make_new, - .locals_dict = (mp_obj_dict_t*)&pulseio_pwmout_locals_dict, + .make_new = pwmio_pwmout_make_new, + .locals_dict = (mp_obj_dict_t*)&pwmio_pwmout_locals_dict, }; diff --git a/shared-bindings/pulseio/PWMOut.h b/shared-bindings/pwmio/PWMOut.h similarity index 60% rename from shared-bindings/pulseio/PWMOut.h rename to shared-bindings/pwmio/PWMOut.h index c72278e0e0..1a99914ea5 100644 --- a/shared-bindings/pulseio/PWMOut.h +++ b/shared-bindings/pwmio/PWMOut.h @@ -24,13 +24,13 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_PULSEIO_PWMOUT_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_PULSEIO_PWMOUT_H +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_PWMIO_PWMOUT_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_PWMIO_PWMOUT_H #include "common-hal/microcontroller/Pin.h" -#include "common-hal/pulseio/PWMOut.h" +#include "common-hal/pwmio/PWMOut.h" -extern const mp_obj_type_t pulseio_pwmout_type; +extern const mp_obj_type_t pwmio_pwmout_type; typedef enum { PWMOUT_OK, @@ -40,19 +40,19 @@ typedef enum { PWMOUT_ALL_TIMERS_IN_USE } pwmout_result_t; -extern pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, +extern pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t* self, const mcu_pin_obj_t* pin, uint16_t duty, uint32_t frequency, bool variable_frequency); -extern void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self); -extern bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t* self); -extern void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty); -extern uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self); -extern void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_t frequency); -extern uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self); -extern bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t* self); +extern void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self); +extern bool common_hal_pwmio_pwmout_deinited(pwmio_pwmout_obj_t* self); +extern void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t* self, uint16_t duty); +extern uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t* self); +extern void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, uint32_t frequency); +extern uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t* self); +extern bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t* self); // This is used by the supervisor to claim PWMOut devices indefinitely. -extern void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self); -extern void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self); +extern void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self); +extern void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self); -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_PULSEIO_PWMOUT_H +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_PWMIO_PWMOUT_H diff --git a/shared-bindings/pwmio/__init__.c b/shared-bindings/pwmio/__init__.c new file mode 100644 index 0000000000..a513837034 --- /dev/null +++ b/shared-bindings/pwmio/__init__.c @@ -0,0 +1,73 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 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 "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/pwmio/__init__.h" +#include "shared-bindings/pwmio/PWMOut.h" + +//| """Support for PWM based protocols +//| +//| The `pwmio` module contains classes to provide access to basic pulse IO. +//| + +//| All classes change hardware state and should be deinitialized when they +//| are no longer needed if the program continues after use. To do so, either +//| call :py:meth:`!deinit` or use a context manager. See +//| :ref:`lifetime-and-contextmanagers` for more info. +//| +//| For example:: +//| +//| import pwmio +//| import time +//| from board import * +//| +//| pwm = pwmio.PWMOut(D13) +//| pwm.duty_cycle = 2 ** 15 +//| time.sleep(0.1) +//| +//| This example will initialize the the device, set +//| :py:data:`~pwmio.PWMOut.duty_cycle`, and then sleep 0.1 seconds. +//| CircuitPython will automatically turn off the PWM when it resets all +//| hardware after program completion. Use ``deinit()`` or a ``with`` statement +//| to do it yourself.""" +//| + +STATIC const mp_rom_map_elem_t pwmio_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_pwmio) }, + { MP_ROM_QSTR(MP_QSTR_PWMOut), MP_ROM_PTR(&pwmio_pwmout_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(pwmio_module_globals, pwmio_module_globals_table); + +const mp_obj_module_t pwmio_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&pwmio_module_globals, +}; diff --git a/shared-bindings/pwmio/__init__.h b/shared-bindings/pwmio/__init__.h new file mode 100644 index 0000000000..93c70377d7 --- /dev/null +++ b/shared-bindings/pwmio/__init__.h @@ -0,0 +1,34 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * 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_PWMIO___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_PWMIO___INIT___H + +#include "py/obj.h" + +// Nothing now. + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_PWMIO___INIT___H diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 46bb6fdb57..4f92f249fd 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -111,14 +111,14 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, if (backlight_pin != NULL && common_hal_mcu_pin_is_free(backlight_pin)) { // Avoid PWM types and functions when the module isn't enabled #if (CIRCUITPY_PULSEIO) - pwmout_result_t result = common_hal_pulseio_pwmout_construct(&self->backlight_pwm, backlight_pin, 0, 50000, false); + pwmout_result_t result = common_hal_pwmio_pwmout_construct(&self->backlight_pwm, backlight_pin, 0, 50000, false); if (result != PWMOUT_OK) { self->backlight_inout.base.type = &digitalio_digitalinout_type; common_hal_digitalio_digitalinout_construct(&self->backlight_inout, backlight_pin); common_hal_never_reset_pin(backlight_pin); } else { - self->backlight_pwm.base.type = &pulseio_pwmout_type; - common_hal_pulseio_pwmout_never_reset(&self->backlight_pwm); + self->backlight_pwm.base.type = &pwmio_pwmout_type; + common_hal_pwmio_pwmout_never_reset(&self->backlight_pwm); } #else // Otherwise default to digital @@ -173,14 +173,14 @@ bool common_hal_displayio_display_set_brightness(displayio_display_obj_t* self, // Avoid PWM types and functions when the module isn't enabled #if (CIRCUITPY_PULSEIO) - bool ispwm = (self->backlight_pwm.base.type == &pulseio_pwmout_type) ? true : false; + bool ispwm = (self->backlight_pwm.base.type == &pwmio_pwmout_type) ? true : false; #else bool ispwm = false; #endif if (ispwm) { #if (CIRCUITPY_PULSEIO) - common_hal_pulseio_pwmout_set_duty_cycle(&self->backlight_pwm, (uint16_t) (0xffff * brightness)); + common_hal_pwmio_pwmout_set_duty_cycle(&self->backlight_pwm, (uint16_t) (0xffff * brightness)); ok = true; #else ok = false; @@ -419,9 +419,9 @@ void release_display(displayio_display_obj_t* self) { common_hal_displayio_display_set_auto_refresh(self, false); release_display_core(&self->core); #if (CIRCUITPY_PULSEIO) - if (self->backlight_pwm.base.type == &pulseio_pwmout_type) { - common_hal_pulseio_pwmout_reset_ok(&self->backlight_pwm); - common_hal_pulseio_pwmout_deinit(&self->backlight_pwm); + if (self->backlight_pwm.base.type == &pwmio_pwmout_type) { + common_hal_pwmio_pwmout_reset_ok(&self->backlight_pwm); + common_hal_pwmio_pwmout_deinit(&self->backlight_pwm); } else if (self->backlight_inout.base.type == &digitalio_digitalinout_type) { common_hal_digitalio_digitalinout_deinit(&self->backlight_inout); } diff --git a/shared-module/displayio/Display.h b/shared-module/displayio/Display.h index 861a38fd7c..bdb861aa09 100644 --- a/shared-module/displayio/Display.h +++ b/shared-module/displayio/Display.h @@ -29,8 +29,8 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/displayio/Group.h" -#if CIRCUITPY_PULSEIO -#include "shared-bindings/pulseio/PWMOut.h" +#if CIRCUITPY_PWMIO +#include "shared-bindings/pwmio/PWMOut.h" #endif #include "shared-module/displayio/area.h" @@ -41,8 +41,8 @@ typedef struct { displayio_display_core_t core; union { digitalio_digitalinout_obj_t backlight_inout; - #if CIRCUITPY_PULSEIO - pulseio_pwmout_obj_t backlight_pwm; + #if CIRCUITPY_PWMIO + pwmio_pwmout_obj_t backlight_pwm; #endif }; uint64_t last_backlight_refresh; diff --git a/shared-module/framebufferio/FramebufferDisplay.h b/shared-module/framebufferio/FramebufferDisplay.h index 89df0d27c1..d73d4b9a95 100644 --- a/shared-module/framebufferio/FramebufferDisplay.h +++ b/shared-module/framebufferio/FramebufferDisplay.h @@ -33,7 +33,6 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/displayio/Group.h" -#include "shared-bindings/pulseio/PWMOut.h" #include "shared-module/displayio/area.h" #include "shared-module/displayio/display_core.h" From dfe50d08d573f2bf49a77e22de1843eb8db4b855 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 18 Aug 2020 16:10:09 -0400 Subject: [PATCH 0642/1293] Fix a few bugs --- devices/ble_hci/common-hal/_bleio/Adapter.c | 14 ++++++- devices/ble_hci/common-hal/_bleio/Adapter.h | 1 + devices/ble_hci/common-hal/_bleio/__init__.c | 6 +-- devices/ble_hci/common-hal/_bleio/att.c | 7 ++-- devices/ble_hci/common-hal/_bleio/att.h | 2 +- devices/ble_hci/common-hal/_bleio/hci.c | 42 +++++--------------- devices/ble_hci/common-hal/_bleio/hci.h | 12 +++--- 7 files changed, 33 insertions(+), 51 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index e2296bb2aa..a86893dcde 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -804,15 +804,25 @@ void common_hal_bleio_adapter_stop_advertising(bleio_adapter_obj_t *self) { self->now_advertising = false; self->extended_advertising = false; self->circuitpython_advertising = false; + int result = hci_le_set_advertising_enable(BT_HCI_LE_ADV_DISABLE); - // OK if we're already stopped. - if (result != BT_HCI_ERR_CMD_DISALLOWED) { + // OK if we're already stopped. There seems to be an ESP32 HCI bug: + // If advertising is already off, then LE_SET_ADV_ENABLE does not return a response. + if (result != HCI_RESPONSE_TIMEOUT) { check_hci_error(result); } //TODO startup CircuitPython advertising again. } +// Note that something stopped advertising, such as a connection happening. +//Don't ask the adapter to stop. +void bleio_adapter_advertising_was_stopped(bleio_adapter_obj_t *self) { + self->now_advertising = false; + self->extended_advertising = false; + self->circuitpython_advertising = false; +} + bool common_hal_bleio_adapter_get_advertising(bleio_adapter_obj_t *self) { check_enabled(self); diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.h b/devices/ble_hci/common-hal/_bleio/Adapter.h index f8748e5be1..dbccfbfb1a 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.h +++ b/devices/ble_hci/common-hal/_bleio/Adapter.h @@ -88,6 +88,7 @@ typedef struct _bleio_adapter_obj_t { } bleio_adapter_obj_t; uint16_t bleio_adapter_add_attribute(bleio_adapter_obj_t *adapter, mp_obj_t *attribute); +void bleio_adapter_advertising_was_stopped(bleio_adapter_obj_t *self); mp_obj_t* bleio_adapter_get_attribute(bleio_adapter_obj_t *adapter, uint16_t handle); uint16_t bleio_adapter_max_attribute_handle(bleio_adapter_obj_t *adapter); void bleio_adapter_background(bleio_adapter_obj_t* adapter); diff --git a/devices/ble_hci/common-hal/_bleio/__init__.c b/devices/ble_hci/common-hal/_bleio/__init__.c index 3c23c160ea..9dd531e25d 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.c +++ b/devices/ble_hci/common-hal/_bleio/__init__.c @@ -48,11 +48,7 @@ void check_hci_error(hci_result_t result) { case HCI_OK: return; - case HCI_NO_RESPONSE: - mp_raise_bleio_BluetoothError(translate("No HCI command response received")); - return; - - case HCI_READ_TIMEOUT: + case HCI_RESPONSE_TIMEOUT: mp_raise_bleio_BluetoothError(translate("Timeout waiting for HCI response")); return; diff --git a/devices/ble_hci/common-hal/_bleio/att.c b/devices/ble_hci/common-hal/_bleio/att.c index aa436faa58..aa25680124 100644 --- a/devices/ble_hci/common-hal/_bleio/att.c +++ b/devices/ble_hci/common-hal/_bleio/att.c @@ -224,7 +224,6 @@ bool att_disconnect(uint16_t conn_handle) { } hci_disconnect(conn_handle); - hci_poll_for_incoming_pkt_timeout(timeout); // Confirm we're now disconnected. return !att_handle_is_connected(conn_handle); @@ -508,13 +507,13 @@ void att_add_connection(uint16_t handle, uint8_t role, bt_addr_le_t *peer_addr, } -void att_remove_connection(uint16_t handle, uint8_t reason) { +void att_remove_connection(uint16_t conn_handle, uint8_t reason) { (void) reason; int peer_index = -1; int peer_count = 0; for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { - if (bleio_connections[i].conn_handle == handle) { + if (bleio_connections[i].conn_handle == conn_handle) { peer_index = i; } @@ -532,7 +531,7 @@ void att_remove_connection(uint16_t handle, uint8_t reason) { // Clear CCCD values on disconnect. size_t max_attribute_handle = bleio_adapter_max_attribute_handle(&common_hal_bleio_adapter_obj); - for (size_t i = 1; handle <= max_attribute_handle; i++) { + for (size_t handle = 1; handle <= max_attribute_handle; handle++) { mp_obj_t attribute_obj = bleio_adapter_get_attribute(&common_hal_bleio_adapter_obj, handle); uint16_t zero = 0; diff --git a/devices/ble_hci/common-hal/_bleio/att.h b/devices/ble_hci/common-hal/_bleio/att.h index 2b1723440f..b34b74dc37 100644 --- a/devices/ble_hci/common-hal/_bleio/att.h +++ b/devices/ble_hci/common-hal/_bleio/att.h @@ -49,7 +49,7 @@ uint16_t att_conn_handle(bt_addr_le_t *addr); uint16_t att_mtu(uint16_t handle); void att_add_connection(uint16_t handle, uint8_t role, bt_addr_le_t *peer_addr, uint16_t interval, uint16_t latency, uint16_t supervision_timeout, uint8_t master_clock_accuracy); void att_process_data(uint16_t conn_handle, uint8_t dlen, uint8_t data[]); -void att_remove_connection(uint16_t handle, uint8_t reason); +void att_remove_connection(uint16_t conn_handle, uint8_t reason); void att_set_max_mtu(uint16_t max_mtu); void att_set_timeout(unsigned long timeout); void att_write_cmd(uint16_t conn_handle, uint16_t handle, const uint8_t* data, uint8_t data_len); diff --git a/devices/ble_hci/common-hal/_bleio/hci.c b/devices/ble_hci/common-hal/_bleio/hci.c index f29121aaa2..e8fc324e1f 100644 --- a/devices/ble_hci/common-hal/_bleio/hci.c +++ b/devices/ble_hci/common-hal/_bleio/hci.c @@ -175,7 +175,6 @@ STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt_data[]) att_remove_connection(disconn_complete->handle, disconn_complete->reason); //FIX L2CAPSignaling.removeConnection(disconn_complete->handle, disconn_complete->reason); - hci_le_set_advertising_enable(0x01); break; } @@ -233,6 +232,12 @@ STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt_data[]) uint8_t *le_evt = pkt->params + sizeof (struct bt_hci_evt_le_meta_event); if (meta_evt->subevent == BT_HCI_EVT_LE_CONN_COMPLETE) { + // Advertising stops when connection occurs. + // We don't tell the adapter to stop, because stopping advertising + // when it's already stopped seems to exercise a bug in the ESP32 HCI code: + // It doesn't return a response. + bleio_adapter_advertising_was_stopped(&common_hal_bleio_adapter_obj); + struct bt_hci_evt_le_conn_complete *le_conn_complete = (struct bt_hci_evt_le_conn_complete *) le_evt; @@ -281,29 +286,11 @@ void bleio_hci_reset(void) { bleio_att_reset(); } -hci_result_t hci_poll_for_incoming_pkt_timeout(uint32_t timeout_msecs) { - uint64_t start = supervisor_ticks_ms64(); - - hci_result_t result = HCI_OK; - - while (supervisor_ticks_ms64() - start < timeout_msecs) { - result = hci_poll_for_incoming_pkt(); - RUN_BACKGROUND_TASKS; - } - - return result; -} - - hci_result_t hci_poll_for_incoming_pkt(void) { if (hci_poll_in_progress) { return HCI_OK; } - common_hal_mcu_disable_interrupts(); - if (!hci_poll_in_progress) { - hci_poll_in_progress = true; - } - common_hal_mcu_enable_interrupts(); + hci_poll_in_progress = true; // Assert RTS low to say we're ready to read data. common_hal_digitalio_digitalinout_set_value(common_hal_bleio_adapter_obj.rts_digitalinout, false); @@ -431,7 +418,7 @@ STATIC hci_result_t send_command(uint16_t opcode, uint8_t params_len, void* para // Wait for a response. Note that other packets may be received that are not // command responses. uint64_t start = supervisor_ticks_ms64(); - while (1) { + while (supervisor_ticks_ms64() - start < RESPONSE_TIMEOUT_MSECS) { result = hci_poll_for_incoming_pkt(); if (result != HCI_OK) { // I/O error. @@ -442,18 +429,14 @@ STATIC hci_result_t send_command(uint16_t opcode, uint8_t params_len, void* para // If this is definitely a response to the command that was sent, // return the status value, which will will be // BT_HCI_ERR_SUCCESS (0x00) if the command succeeded, - // or a BT_HCI_ERR_x value (> 0x00) if there ws a problem. + // or a BT_HCI_ERR_x value (> 0x00) if there was a problem. return cmd_response_status; } - - if (supervisor_ticks_ms64() - start > RESPONSE_TIMEOUT_MSECS) { - return HCI_READ_TIMEOUT; - } RUN_BACKGROUND_TASKS; } // No I/O error, but no response sent back in time. - return HCI_NO_RESPONSE; + return HCI_RESPONSE_TIMEOUT; } hci_result_t hci_send_acl_pkt(uint16_t handle, uint8_t cid, uint8_t data_len, uint8_t *data) { @@ -528,11 +511,6 @@ hci_result_t hci_read_rssi(uint16_t handle, int *rssi) { int result = send_command(BT_HCI_OP_READ_RSSI, sizeof(handle), &handle); if (result == HCI_OK) { struct bt_hci_rp_read_rssi *response = (struct bt_hci_rp_read_rssi *) cmd_response_data; - if (response->handle != handle) { - // Handle doesn't match. - return HCI_NO_RESPONSE; - } - *rssi = response->rssi; } diff --git a/devices/ble_hci/common-hal/_bleio/hci.h b/devices/ble_hci/common-hal/_bleio/hci.h index 5dc831eb48..58aa71d3b3 100644 --- a/devices/ble_hci/common-hal/_bleio/hci.h +++ b/devices/ble_hci/common-hal/_bleio/hci.h @@ -32,12 +32,11 @@ typedef struct _bleio_adapter_obj_t bleio_adapter_obj_t; // or is it > 0 and is an HCI command status value (see hci_include/hci_err.h) typedef int hci_result_t; #define HCI_OK (0) -#define HCI_NO_RESPONSE (-1) -#define HCI_READ_TIMEOUT (-2) -#define HCI_WRITE_TIMEOUT (-3) -#define HCI_READ_ERROR (-4) -#define HCI_WRITE_ERROR (-5) -#define HCI_ATT_ERROR (-6) +#define HCI_RESPONSE_TIMEOUT (-1) +#define HCI_WRITE_TIMEOUT (-2) +#define HCI_READ_ERROR (-3) +#define HCI_WRITE_ERROR (-4) +#define HCI_ATT_ERROR (-5) void bleio_hci_reset(void); @@ -65,7 +64,6 @@ hci_result_t hci_le_set_scan_parameters(uint8_t scan_type, uint16_t interval, ui hci_result_t hci_le_set_scan_response_data(uint8_t length, uint8_t data[]); hci_result_t hci_poll_for_incoming_pkt(void); -hci_result_t hci_poll_for_incoming_pkt_timeout(uint32_t timeout_msecs); hci_result_t hci_read_bd_addr(bt_addr_t *addr); hci_result_t hci_read_buffer_size(uint16_t *acl_max_len, uint8_t *sco_max_len, uint16_t *acl_max_num, uint16_t *sco_max_num); From 50560272383f56b937c349df28e06cd73f39fd3c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 18 Aug 2020 19:17:59 -0500 Subject: [PATCH 0643/1293] gen_display_resources: report missing character count, if any --- tools/gen_display_resources.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/gen_display_resources.py b/tools/gen_display_resources.py index e4197aabf4..6657b6a272 100644 --- a/tools/gen_display_resources.py +++ b/tools/gen_display_resources.py @@ -58,15 +58,20 @@ filtered_characters = all_characters # Try to pre-load all of the glyphs. Misses will still be slow later. f.load_glyphs(set(ord(c) for c in all_characters)) +missing = 0 # Get each glyph. for c in set(all_characters): if ord(c) not in f._glyphs: + missing += 1 filtered_characters = filtered_characters.replace(c, "") continue g = f.get_glyph(ord(c)) if g["shift"][1] != 0: raise RuntimeError("y shift") +if missing > 0: + print("Font missing", missing, "characters", file=sys.stderr) + x, y, dx, dy = f.get_bounding_box() tile_x, tile_y = x - dx, y - dy total_bits = tile_x * len(all_characters) From 8bab7b664c9627dfbaa32b3bf64893d7487f1cd0 Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Wed, 19 Aug 2020 20:18:17 +0800 Subject: [PATCH 0644/1293] support to get HID OUT report --- shared-bindings/usb_hid/Device.c | 20 ++++++++++++++++++++ shared-module/usb_hid/Device.c | 17 ++++++++++------- shared-module/usb_hid/Device.h | 2 ++ tools/gen_usb_descriptor.py | 16 +++++++++++++--- tools/hid_report_descriptors.py | 18 +++++++++--------- 5 files changed, 54 insertions(+), 19 deletions(-) diff --git a/shared-bindings/usb_hid/Device.c b/shared-bindings/usb_hid/Device.c index 83c0df4ae4..2fbc5fe51b 100644 --- a/shared-bindings/usb_hid/Device.c +++ b/shared-bindings/usb_hid/Device.c @@ -58,6 +58,25 @@ STATIC mp_obj_t usb_hid_device_send_report(mp_obj_t self_in, mp_obj_t buffer) { } MP_DEFINE_CONST_FUN_OBJ_2(usb_hid_device_send_report_obj, usb_hid_device_send_report); +//|report: bytes +//| """The HID OUT report as a `bytes`. (read-only)""" +//| +STATIC mp_obj_t usb_hid_device_obj_get_report(mp_obj_t self_in) { + usb_hid_device_obj_t *self = MP_OBJ_TO_PTR(self_in); + if (self->out_report_buffer == 0) { + return mp_const_none; + } + return mp_obj_new_bytes(self->out_report_buffer, self->out_report_length); +} +MP_DEFINE_CONST_FUN_OBJ_1(usb_hid_device_get_report_obj, usb_hid_device_obj_get_report); + +const mp_obj_property_t usb_hid_device_report_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&usb_hid_device_get_report_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + //| usage_page: int //| """The usage page of the device as an `int`. Can be thought of a category. (read-only)""" //| @@ -96,6 +115,7 @@ const mp_obj_property_t usb_hid_device_usage_obj = { STATIC const mp_rom_map_elem_t usb_hid_device_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_send_report), MP_ROM_PTR(&usb_hid_device_send_report_obj) }, + { MP_ROM_QSTR(MP_QSTR_report), MP_ROM_PTR(&usb_hid_device_report_obj) }, { MP_ROM_QSTR(MP_QSTR_usage_page), MP_ROM_PTR(&usb_hid_device_usage_page_obj)}, { MP_ROM_QSTR(MP_QSTR_usage), MP_ROM_PTR(&usb_hid_device_usage_obj)}, }; diff --git a/shared-module/usb_hid/Device.c b/shared-module/usb_hid/Device.c index 8e9df6f040..943c9bfed7 100644 --- a/shared-module/usb_hid/Device.c +++ b/shared-module/usb_hid/Device.c @@ -84,14 +84,17 @@ uint16_t tud_hid_get_report_cb(uint8_t report_id, hid_report_type_t report_type, // Callbacks invoked when receive Set_Report request through control endpoint void tud_hid_set_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize) { + if (report_type == HID_REPORT_TYPE_INVALID) { + report_id = buffer[0]; + buffer++; + bufsize--; + } else if (report_type != HID_REPORT_TYPE_OUTPUT) { + return; + } + usb_hid_device_obj_t* hid_device = get_hid_device(report_id); - if ( report_type == HID_REPORT_TYPE_OUTPUT ) { - // Check if it is Keyboard device - if (hid_device->usage_page == HID_USAGE_PAGE_DESKTOP && - hid_device->usage == HID_USAGE_DESKTOP_KEYBOARD) { - // This is LED indicator (CapsLock, NumLock) - // TODO Light up some LED here - } + if (hid_device && hid_device->out_report_length >= bufsize) { + memcpy(hid_device->out_report_buffer, buffer, bufsize); } } diff --git a/shared-module/usb_hid/Device.h b/shared-module/usb_hid/Device.h index 10f2ee897d..93c3518b43 100644 --- a/shared-module/usb_hid/Device.h +++ b/shared-module/usb_hid/Device.h @@ -43,6 +43,8 @@ typedef struct { uint8_t report_length; uint8_t usage_page; uint8_t usage; + uint8_t* out_report_buffer; + uint8_t out_report_length; } usb_hid_device_obj_t; diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index fb91fd3345..4ad6cfb565 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -535,7 +535,7 @@ c_file.write(""" }; """) -c_file.write("\n"); +c_file.write("\n") hid_descriptor_length = len(bytes(combined_hid_report_descriptor)) @@ -593,12 +593,18 @@ for name in args.hid_devices: static uint8_t {name}_report_buffer[{report_length}]; """.format(name=name.lower(), report_length=hid_report_descriptors.HID_DEVICE_DATA[name].report_length)) + if hid_report_descriptors.HID_DEVICE_DATA[name].out_report_length > 0: + c_file.write("""\ +static uint8_t {name}_out_report_buffer[{report_length}]; +""".format(name=name.lower(), report_length=hid_report_descriptors.HID_DEVICE_DATA[name].out_report_length)) + # Write out table of device objects. c_file.write(""" usb_hid_device_obj_t usb_hid_devices[] = { -"""); +""") for name in args.hid_devices: device_data = hid_report_descriptors.HID_DEVICE_DATA[name] + out_report_buffer = '{}_out_report_buffer'.format(name.lower()) if device_data.out_report_length > 0 else 'NULL' c_file.write("""\ {{ .base = {{ .type = &usb_hid_device_type }}, @@ -607,11 +613,15 @@ for name in args.hid_devices: .report_length = {report_length}, .usage_page = {usage_page:#04x}, .usage = {usage:#04x}, + .out_report_buffer = {out_report_buffer}, + .out_report_length = {out_report_length}, }}, """.format(name=name.lower(), report_id=report_ids[name], report_length=device_data.report_length, usage_page=device_data.usage_page, - usage=device_data.usage)) + usage=device_data.usage, + out_report_buffer=out_report_buffer, + out_report_length=device_data.out_report_length)) c_file.write("""\ }; """) diff --git a/tools/hid_report_descriptors.py b/tools/hid_report_descriptors.py index e13e0dbdd1..aaa5b18b1f 100644 --- a/tools/hid_report_descriptors.py +++ b/tools/hid_report_descriptors.py @@ -18,16 +18,16 @@ from adafruit_usb_descriptor import hid # Information about each kind of device # report_length does not include report ID in first byte, if present when sent. -DeviceData = namedtuple('DeviceData', ('report_length', 'usage_page', 'usage')) +DeviceData = namedtuple('DeviceData', ('report_length', 'out_report_length', 'usage_page', 'usage')) HID_DEVICE_DATA = { - "KEYBOARD" : DeviceData(report_length=8, usage_page=0x01, usage=0x06), # Generic Desktop, Keyboard - "MOUSE" : DeviceData(report_length=4, usage_page=0x01, usage=0x02), # Generic Desktop, Mouse - "CONSUMER" : DeviceData(report_length=2, usage_page=0x0C, usage=0x01), # Consumer, Consumer Control - "SYS_CONTROL" : DeviceData(report_length=1, usage_page=0x01, usage=0x80), # Generic Desktop, Sys Control - "GAMEPAD" : DeviceData(report_length=6, usage_page=0x01, usage=0x05), # Generic Desktop, Game Pad - "DIGITIZER" : DeviceData(report_length=5, usage_page=0x0D, usage=0x02), # Digitizers, Pen - "XAC_COMPATIBLE_GAMEPAD" : DeviceData(report_length=3, usage_page=0x01, usage=0x05), # Generic Desktop, Game Pad - "RAW" : DeviceData(report_length=64, usage_page=0xFFAF, usage=0xAF), # Vendor 0xFFAF "Adafruit", 0xAF + "KEYBOARD" : DeviceData(report_length=8, out_report_length=1, usage_page=0x01, usage=0x06), # Generic Desktop, Keyboard + "MOUSE" : DeviceData(report_length=4, out_report_length=0, usage_page=0x01, usage=0x02), # Generic Desktop, Mouse + "CONSUMER" : DeviceData(report_length=2, out_report_length=0, usage_page=0x0C, usage=0x01), # Consumer, Consumer Control + "SYS_CONTROL" : DeviceData(report_length=1, out_report_length=0, usage_page=0x01, usage=0x80), # Generic Desktop, Sys Control + "GAMEPAD" : DeviceData(report_length=6, out_report_length=0, usage_page=0x01, usage=0x05), # Generic Desktop, Game Pad + "DIGITIZER" : DeviceData(report_length=5, out_report_length=0, usage_page=0x0D, usage=0x02), # Digitizers, Pen + "XAC_COMPATIBLE_GAMEPAD" : DeviceData(report_length=3, out_report_length=0, usage_page=0x01, usage=0x05), # Generic Desktop, Game Pad + "RAW" : DeviceData(report_length=64, out_report_length=0, usage_page=0xFFAF, usage=0xAF), # Vendor 0xFFAF "Adafruit", 0xAF } def keyboard_hid_descriptor(report_id): From 9aca580195b8381d0db6663dd0dbe22f465ce170 Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Wed, 19 Aug 2020 21:33:51 +0800 Subject: [PATCH 0645/1293] fix --- 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 2fbc5fe51b..a6c268c74d 100644 --- a/shared-bindings/usb_hid/Device.c +++ b/shared-bindings/usb_hid/Device.c @@ -58,7 +58,7 @@ STATIC mp_obj_t usb_hid_device_send_report(mp_obj_t self_in, mp_obj_t buffer) { } MP_DEFINE_CONST_FUN_OBJ_2(usb_hid_device_send_report_obj, usb_hid_device_send_report); -//|report: bytes +//| report: bytes //| """The HID OUT report as a `bytes`. (read-only)""" //| STATIC mp_obj_t usb_hid_device_obj_get_report(mp_obj_t self_in) { From 6ae5bedf3b7cc5adfd57202f757c335dce54c790 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 19 Aug 2020 11:27:52 -0500 Subject: [PATCH 0646/1293] SAM E54: Use correct CFG_TUSB_MCU This doesn't actually change the code that is built, but it is "more correct". --- 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 65542354e6..30487ae3ef 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -103,7 +103,7 @@ ifeq ($(CHIP_FAMILY), same54) PERIPHERALS_CHIP_FAMILY=sam_d5x_e5x OPTIMIZATION_FLAGS ?= -O2 # TinyUSB defines -CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD51 -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 +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 # option to override default optimization level, set in boards/$(BOARD)/mpconfigboard.mk From c5b8401a15b4a34736d0ba86691eb441f65099e2 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 28 Jul 2020 18:23:33 -0700 Subject: [PATCH 0647/1293] First crack at native wifi API --- ports/esp32s2/Makefile | 25 ++- ports/esp32s2/common-hal/wifi/Network.c | 31 ++++ ports/esp32s2/common-hal/wifi/Network.h | 37 +++++ ports/esp32s2/common-hal/wifi/Radio.c | 59 +++++++ ports/esp32s2/common-hal/wifi/Radio.h | 37 +++++ ports/esp32s2/common-hal/wifi/__init__.c | 49 ++++++ ports/esp32s2/common-hal/wifi/__init__.h | 32 ++++ ports/esp32s2/esp-idf | 2 +- ports/esp32s2/mpconfigport.mk | 2 + ports/esp32s2/sdkconfig.defaults | 6 +- py/circuitpy_defns.mk | 6 + py/circuitpy_mpconfig.h | 8 + py/circuitpy_mpconfig.mk | 3 + shared-bindings/wifi/Network.c | 70 ++++++++ shared-bindings/wifi/Network.h | 40 +++++ shared-bindings/wifi/Radio.c | 196 +++++++++++++++++++++++ shared-bindings/wifi/Radio.h | 52 ++++++ shared-bindings/wifi/__init__.c | 71 ++++++++ shared-bindings/wifi/__init__.h | 38 +++++ 19 files changed, 753 insertions(+), 11 deletions(-) create mode 100644 ports/esp32s2/common-hal/wifi/Network.c create mode 100644 ports/esp32s2/common-hal/wifi/Network.h create mode 100644 ports/esp32s2/common-hal/wifi/Radio.c create mode 100644 ports/esp32s2/common-hal/wifi/Radio.h create mode 100644 ports/esp32s2/common-hal/wifi/__init__.c create mode 100644 ports/esp32s2/common-hal/wifi/__init__.h create mode 100644 shared-bindings/wifi/Network.c create mode 100644 shared-bindings/wifi/Network.h create mode 100644 shared-bindings/wifi/Radio.c create mode 100644 shared-bindings/wifi/Radio.h create mode 100644 shared-bindings/wifi/__init__.c create mode 100644 shared-bindings/wifi/__init__.h diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 19b89a13a1..b4abac60d7 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -78,8 +78,11 @@ INC += -Iesp-idf/components/freertos/xtensa/include INC += -Iesp-idf/components/esp32s2/include INC += -Iesp-idf/components/xtensa/esp32s2/include INC += -Iesp-idf/components/esp_common/include +INC += -Iesp-idf/components/esp_event/include +INC += -Iesp-idf/components/esp_netif/include INC += -Iesp-idf/components/esp_ringbuf/include INC += -Iesp-idf/components/esp_rom/include +INC += -Iesp-idf/components/esp_wifi/include INC += -Iesp-idf/components/xtensa/include INC += -Iesp-idf/components/esp_timer/include INC += -Iesp-idf/components/soc/include @@ -129,7 +132,7 @@ LDFLAGS += -L$(BUILD)/esp-idf/esp-idf/esp32s2 \ -Tesp32s2.rom.newlib-data.ld \ -Tesp32s2.rom.newlib-funcs.ld \ -Tesp32s2.rom.spiflash.ld -LIBS := -lgcc -lc +LIBS := -lgcc -lc -lstdc++ # @@ -238,20 +241,25 @@ $(BUILD)/esp-idf/partition_table/partition-table.bin: $(BUILD)/esp-idf/config/sd # run menuconfig menuconfig: $(BUILD)/esp-idf/config - ninja -C $(BUILD)/esp-idf menuconfig - diff --old-line-format= --unchanged-line-format= sdkconfig.defaults $(BUILD)/esp-idf/sdkconfig > boards/$(BOARD)/sdkconfig || true + $(Q)ninja -C $(BUILD)/esp-idf menuconfig + $(Q)diff --old-line-format= --unchanged-line-format= sdkconfig.defaults $(BUILD)/esp-idf/sdkconfig > boards/$(BOARD)/sdkconfig || true # qstr builds include headers so we need to make sure they are up to date $(HEADER_BUILD)/qstr.i.last: | $(BUILD)/esp-idf/config/sdkconfig.h # Order here matters -ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf # +ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash ESP_IDF_COMPONENTS_INCLUDE = driver freertos log soc INC += $(foreach component, $(ESP_IDF_COMPONENTS_INCLUDE), -Iesp-idf/components/$(component)/include) ESP_IDF_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_COMPONENTS_LINK), $(BUILD)/esp-idf/esp-idf/$(component)/lib$(component).a) +ESP_IDF_WIFI_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_WIFI_COMPONENTS_LINK), $(BUILD)/esp-idf/esp-idf/$(component)/lib$(component).a) + +MBEDTLS_COMPONENTS_LINK = crypto tls x509 +MBEDTLS_COMPONENTS_LINK_EXPANDED = $(foreach component, $(MBEDTLS_COMPONENTS_LINK), $(BUILD)/esp-idf/esp-idf/mbedtls/mbedtls/library/libmbed$(component).a) + BINARY_BLOBS = esp-idf/components/xtensa/esp32s2/libhal.a BINARY_WIFI_BLOBS = libcoexist.a libcore.a libespnow.a libmesh.a libnet80211.a libpp.a librtc.a libsmartconfig.a libphy.a BINARY_BLOBS += $(addprefix esp-idf/components/esp_wifi/lib/esp32s2/, $(BINARY_WIFI_BLOBS)) @@ -265,18 +273,23 @@ all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 .PHONY: esp-idf-stamp esp-idf-stamp: $(BUILD)/esp-idf/config/sdkconfig.h - ninja -C $(BUILD)/esp-idf \ + $(Q)ninja -C $(BUILD)/esp-idf \ bootloader/bootloader.bin \ esp-idf/bootloader_support/libbootloader_support.a \ esp-idf/esp32s2/ld/esp32s2.project.ld \ + esp-idf/esp_event/libesp_event.a \ esp-idf/esp_system/libesp_system.a \ + esp-idf/esp_wifi/libesp_wifi.a \ + esp-idf/nvs_flash/libnvs_flash.a \ + esp-idf/wpa_supplicant/libwpa_supplicant.a \ + esp-idf/mbedtls/libmbedtls.a \ esp-idf/freertos/libfreertos.a \ esp-idf/log/liblog.a \ esp-idf/xtensa/libxtensa.a $(BUILD)/firmware.elf: $(OBJ) | esp-idf-stamp $(STEPECHO) "LINK $@" - $(Q)$(CC) -o $@ $(LDFLAGS) $^ $(ESP_IDF_COMPONENTS_EXPANDED) $(BINARY_BLOBS) build-$(BOARD)/esp-idf/esp-idf/newlib/libnewlib.a -u newlib_include_pthread_impl -Wl,--start-group $(LIBS) -Wl,--end-group + $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(ESP_IDF_COMPONENTS_EXPANDED) $(BINARY_BLOBS) $(MBEDTLS_COMPONENTS_LINK_EXPANDED) build-$(BOARD)/esp-idf/esp-idf/newlib/libnewlib.a -Wl,--end-group -u newlib_include_pthread_impl -Wl,--start-group $(LIBS) -Wl,--end-group build-$(BOARD)/esp-idf/esp-idf/pthread/libpthread.a -u __cxx_fatal_exception # $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld $(BUILD)/circuitpython-firmware.bin: $(BUILD)/firmware.elf diff --git a/ports/esp32s2/common-hal/wifi/Network.c b/ports/esp32s2/common-hal/wifi/Network.c new file mode 100644 index 0000000000..a270fd9dcc --- /dev/null +++ b/ports/esp32s2/common-hal/wifi/Network.c @@ -0,0 +1,31 @@ +/* + * 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 "shared-bindings/wifi/Network.h" + +mp_obj_t common_hal_wifi_network_get_ssid(wifi_network_obj_t *self) { + return mp_const_none; +} diff --git a/ports/esp32s2/common-hal/wifi/Network.h b/ports/esp32s2/common-hal/wifi/Network.h new file mode 100644 index 0000000000..26d02d3fc2 --- /dev/null +++ b/ports/esp32s2/common-hal/wifi/Network.h @@ -0,0 +1,37 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_NETWORK_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_NETWORK_H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + // Stores no state currently. +} wifi_network_obj_t; + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_NETWORK_H diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c new file mode 100644 index 0000000000..bbbeb23a20 --- /dev/null +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -0,0 +1,59 @@ +/* + * 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 "shared-bindings/wifi/Radio.h" + +bool common_hal_wifi_radio_get_enabled(wifi_radio_obj_t *self) { + return true; +} + +void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled) { + +} + +mp_obj_t common_hal_wifi_radio_get_mac_address(wifi_radio_obj_t *self) { + return mp_const_none; +} + +mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self) { + return mp_const_none; +} + +void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) { + +} + +bool common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t* ssid, size_t ssid_len, uint8_t* password, size_t password_len, mp_float_t timeout) { + return false; +} + +mp_obj_t common_hal_wifi_radio_get_ip_address(wifi_radio_obj_t *self) { + return mp_const_none; +} + +mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address) { + return 0; +} diff --git a/ports/esp32s2/common-hal/wifi/Radio.h b/ports/esp32s2/common-hal/wifi/Radio.h new file mode 100644 index 0000000000..56fc0d9d6e --- /dev/null +++ b/ports/esp32s2/common-hal/wifi/Radio.h @@ -0,0 +1,37 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_RADIO_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_RADIO_H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + // Stores no state currently. +} wifi_radio_obj_t; + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_RADIO_H diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c new file mode 100644 index 0000000000..42410f4839 --- /dev/null +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -0,0 +1,49 @@ +/* + * 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 "shared-bindings/wifi/Radio.h" + +#include "py/runtime.h" + +#include "esp-idf/components/esp_wifi/include/esp_wifi.h" + +wifi_radio_obj_t common_hal_wifi_radio_obj; + +void common_hal_wifi_init(void) { + common_hal_wifi_radio_obj.base.type = &wifi_radio_type; + wifi_init_config_t config = WIFI_INIT_CONFIG_DEFAULT(); + + esp_err_t result = esp_wifi_init(&config); + if (result == ESP_ERR_NO_MEM) { + mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate Wifi memory")); + } else if (result != ESP_OK) { + // handle this + } +} + +void wifi_reset(void) { + esp_wifi_deinit(); +} diff --git a/ports/esp32s2/common-hal/wifi/__init__.h b/ports/esp32s2/common-hal/wifi/__init__.h new file mode 100644 index 0000000000..e7ff7ec04a --- /dev/null +++ b/ports/esp32s2/common-hal/wifi/__init__.h @@ -0,0 +1,32 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI___INIT___H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI___INIT___H + +#include "py/obj.h" + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI___INIT___H diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index 160ba4924d..f5aff20b37 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit 160ba4924d8b588e718f76e3a0d0e92c11052fa3 +Subproject commit f5aff20b378f7c4002605a4158a41630c21f343d diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index a7873aa468..dcfb0ecc5c 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -29,4 +29,6 @@ CIRCUITPY_RANDOM = 0 # Requires OS CIRCUITPY_USB_MIDI = 0 # Requires USB CIRCUITPY_ULAB = 0 # No requirements, but takes extra flash +CIRCUITPY_WIFI = 1 + CIRCUITPY_MODULE ?= none diff --git a/ports/esp32s2/sdkconfig.defaults b/ports/esp32s2/sdkconfig.defaults index 729ebac889..8245c7db6c 100644 --- a/ports/esp32s2/sdkconfig.defaults +++ b/ports/esp32s2/sdkconfig.defaults @@ -279,9 +279,7 @@ CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y # # Ethernet # -CONFIG_ETH_ENABLED=y -CONFIG_ETH_USE_SPI_ETHERNET=y -# CONFIG_ETH_SPI_ETHERNET_DM9051 is not set +# CONFIG_ETH_USE_SPI_ETHERNET is not set # CONFIG_ETH_USE_OPENETH is not set # end of Ethernet @@ -299,7 +297,7 @@ CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 CONFIG_ESP_NETIF_TCPIP_LWIP=y # CONFIG_ESP_NETIF_LOOPBACK is not set -CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER=y +# CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER is not set # end of ESP NETIF Adapter # diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index b70ae64a80..5d5b6996d1 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -261,6 +261,9 @@ endif ifeq ($(CIRCUITPY_WATCHDOG),1) SRC_PATTERNS += watchdog/% endif +ifeq ($(CIRCUITPY_WIFI),1) +SRC_PATTERNS += wifi/% +endif ifeq ($(CIRCUITPY_PEW),1) SRC_PATTERNS += _pew/% endif @@ -333,6 +336,9 @@ SRC_COMMON_HAL_ALL = \ watchdog/WatchDogMode.c \ watchdog/WatchDogTimer.c \ watchdog/__init__.c \ + wifi/Network.c \ + wifi/Radio.c \ + wifi/__init__.c \ SRC_COMMON_HAL = $(filter $(SRC_PATTERNS), $(SRC_COMMON_HAL_ALL)) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 12d667d8f8..2db20ca1d1 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -683,6 +683,13 @@ extern const struct _mp_obj_module_t watchdog_module; #define WATCHDOG_MODULE #endif +#if CIRCUITPY_WIFI +extern const struct _mp_obj_module_t wifi_module; +#define WIFI_MODULE { MP_ROM_QSTR(MP_QSTR_wifi), MP_ROM_PTR(&wifi_module) }, +#else +#define WIFI_MODULE +#endif + // Define certain native modules with weak links so they can be replaced with Python // implementations. This list may grow over time. #define MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS \ @@ -759,6 +766,7 @@ extern const struct _mp_obj_module_t watchdog_module; USB_MIDI_MODULE \ USTACK_MODULE \ WATCHDOG_MODULE \ + WIFI_MODULE \ // If weak links are enabled, just include strong links in the main list of modules, // and also include the underscore alternate names. diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index bdc1e77d54..abbd5a9a0b 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -254,6 +254,9 @@ CFLAGS += -DCIRCUITPY_ULAB=$(CIRCUITPY_ULAB) CIRCUITPY_WATCHDOG ?= 0 CFLAGS += -DCIRCUITPY_WATCHDOG=$(CIRCUITPY_WATCHDOG) +CIRCUITPY_WIFI ?= 0 +CFLAGS += -DCIRCUITPY_WIFI=$(CIRCUITPY_WIFI) + # Enabled micropython.native decorator (experimental) CIRCUITPY_ENABLE_MPY_NATIVE ?= 0 CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE) diff --git a/shared-bindings/wifi/Network.c b/shared-bindings/wifi/Network.c new file mode 100644 index 0000000000..b4d389dcc9 --- /dev/null +++ b/shared-bindings/wifi/Network.c @@ -0,0 +1,70 @@ +/* + * 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 + +#include "py/objproperty.h" +#include "py/runtime.h" +#include "shared-bindings/wifi/Network.h" + +//| class Network: +//| """A wifi network provided by a nearby access point. +//| +//| """ +//| + +//| def __init__(self) -> None: +//| """You cannot create an instance of `wifi.Network`. They are returned by `wifi.Radio.start_scanning_networks`.""" +//| ... +//| + +//| ssid: str +//| """True when the wifi network is enabled.""" +//| +STATIC mp_obj_t wifi_network_get_ssid(mp_obj_t self) { + return common_hal_wifi_network_get_ssid(self); + +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_network_get_ssid_obj, wifi_network_get_ssid); + +const mp_obj_property_t wifi_network_ssid_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&wifi_network_get_ssid_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + +STATIC const mp_rom_map_elem_t wifi_network_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_ssid), MP_ROM_PTR(&wifi_network_ssid_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(wifi_network_locals_dict, wifi_network_locals_dict_table); + +const mp_obj_type_t wifi_network_type = { + .base = { &mp_type_type }, + .name = MP_QSTR_Network, + .locals_dict = (mp_obj_t)&wifi_network_locals_dict, +}; diff --git a/shared-bindings/wifi/Network.h b/shared-bindings/wifi/Network.h new file mode 100644 index 0000000000..8a3d10ca74 --- /dev/null +++ b/shared-bindings/wifi/Network.h @@ -0,0 +1,40 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WIFI_NETWORK_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_WIFI_NETWORK_H + +#include + +#include "common-hal/wifi/Network.h" + +#include "py/objstr.h" + +const mp_obj_type_t wifi_network_type; + +extern mp_obj_t common_hal_wifi_network_get_ssid(wifi_network_obj_t *self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_WIFI_NETWORK_H diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c new file mode 100644 index 0000000000..1eb07d8fcf --- /dev/null +++ b/shared-bindings/wifi/Radio.c @@ -0,0 +1,196 @@ +/* + * 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 + +#include "py/objproperty.h" +#include "py/runtime.h" +#include "shared-bindings/wifi/__init__.h" + +//| class Radio: +//| """Native wifi radio. +//| +//| This class manages the station and access point functionality of the native +//| Wifi radio. +//| +//| """ +//| + +//| def __init__(self) -> None: +//| """You cannot create an instance of `wifi.Radio`. +//| Use `wifi.radio` to access the sole instance available.""" +//| ... +//| + +//| enabled: bool +//| """True when the wifi radio is enabled.""" +//| +STATIC mp_obj_t wifi_radio_get_enabled(mp_obj_t self) { + return mp_obj_new_bool(common_hal_wifi_radio_get_enabled(self)); + +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_enabled_obj, wifi_radio_get_enabled); + +const mp_obj_property_t wifi_radio_enabled_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&wifi_radio_get_enabled_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + +//| mac_address: Address +//| """MAC address of the wifi radio. (read-only)""" +//| +STATIC mp_obj_t wifi_radio_get_mac_address(mp_obj_t self) { + 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); + +const mp_obj_property_t wifi_radio_mac_address_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&wifi_radio_get_mac_address_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + + +//| def start_scanning_networks(self) -> Iterable[Network]: +//| """""" +//| ... +//| +STATIC mp_obj_t wifi_radio_start_scanning_networks(mp_obj_t self_in) { + wifi_radio_obj_t *self = MP_OBJ_TO_PTR(self_in); + + return common_hal_wifi_radio_start_scanning_networks(self); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_start_scanning_networks_obj, wifi_radio_start_scanning_networks); + +//| def stop_scanning_networks(self) -> None: +//| """Stop scanning for Wifi networks and free any resources used to do it.""" +//| ... +//| +STATIC mp_obj_t wifi_radio_stop_scanning_networks(mp_obj_t self_in) { + wifi_radio_obj_t *self = MP_OBJ_TO_PTR(self_in); + + common_hal_wifi_radio_stop_scanning_networks(self); + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_stop_scanning_networks_obj, wifi_radio_stop_scanning_networks); + +//| def connect(self, ssid: ReadableBuffer, password: ReadableBuffer = b"", *, timeout: Optional[float] = None) -> bool: +//| """""" +//| ... +//| +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_timeout }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_ssid, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_password, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, + }; + + wifi_radio_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + 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); + + mp_float_t timeout = 0; + if (args[ARG_timeout].u_obj != mp_const_none) { + timeout = mp_obj_get_float(args[ARG_timeout].u_obj); + } + + + mp_buffer_info_t ssid; + ssid.len = 0; + if (args[ARG_ssid].u_obj != MP_OBJ_NULL) { + mp_get_buffer_raise(args[ARG_ssid].u_obj, &ssid, MP_BUFFER_READ); + } + + mp_buffer_info_t password; + password.len = 0; + if (args[ARG_password].u_obj != MP_OBJ_NULL) { + mp_get_buffer_raise(args[ARG_password].u_obj, &password, MP_BUFFER_READ); + } + + return mp_obj_new_bool(common_hal_wifi_radio_connect(self, ssid.buf, ssid.len, password.buf, password.len, timeout)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wifi_radio_connect_obj, 1, wifi_radio_connect); + +//| ip_address: Optional[ipaddress.IPAddress] +//| """IP Address of the radio when connected to an access point. None otherwise.""" +//| +STATIC mp_obj_t wifi_radio_get_ip_address(mp_obj_t self) { + return common_hal_wifi_radio_get_ip_address(self); + +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ip_address_obj, wifi_radio_get_ip_address); + +const mp_obj_property_t wifi_radio_ip_address_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&wifi_radio_get_ip_address_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + +//| def ping(self, ip) -> int: +//| """Ping an IP to test connectivity. Returns echo time in milliseconds.""" +//| ... +//| +STATIC mp_obj_t wifi_radio_ping(mp_obj_t self_in, mp_obj_t ip_address) { + wifi_radio_obj_t *self = MP_OBJ_TO_PTR(self_in); + + common_hal_wifi_radio_ping(self, ip_address); + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(wifi_radio_ping_obj, wifi_radio_ping); + +STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_enabled), MP_ROM_PTR(&wifi_radio_enabled_obj) }, + { MP_ROM_QSTR(MP_QSTR_mac_address), MP_ROM_PTR(&wifi_radio_mac_address_obj) }, + + { MP_ROM_QSTR(MP_QSTR_start_scanning_networks), MP_ROM_PTR(&wifi_radio_start_scanning_networks_obj) }, + { MP_ROM_QSTR(MP_QSTR_stop_scanning_networks), MP_ROM_PTR(&wifi_radio_stop_scanning_networks_obj) }, + + { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&wifi_radio_connect_obj) }, + // { MP_ROM_QSTR(MP_QSTR_connect_to_enterprise), MP_ROM_PTR(&wifi_radio_connect_to_enterprise_obj) }, + + { MP_ROM_QSTR(MP_QSTR_ip_address), MP_ROM_PTR(&wifi_radio_ip_address_obj) }, + + // { MP_ROM_QSTR(MP_QSTR_access_point_active), MP_ROM_PTR(&wifi_radio_access_point_active_obj) }, + // { MP_ROM_QSTR(MP_QSTR_start_access_point), MP_ROM_PTR(&wifi_radio_start_access_point_obj) }, + + { MP_ROM_QSTR(MP_QSTR_ping), MP_ROM_PTR(&wifi_radio_ping_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(wifi_radio_locals_dict, wifi_radio_locals_dict_table); + +const mp_obj_type_t wifi_radio_type = { + .base = { &mp_type_type }, + .name = MP_QSTR_Radio, + .locals_dict = (mp_obj_t)&wifi_radio_locals_dict, +}; diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h new file mode 100644 index 0000000000..c3bdac5ba8 --- /dev/null +++ b/shared-bindings/wifi/Radio.h @@ -0,0 +1,52 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WIFI_RADIO_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_WIFI_RADIO_H + +#include + +#include "common-hal/wifi/Radio.h" + +#include "py/objstr.h" + +const mp_obj_type_t wifi_radio_type; + +extern bool common_hal_wifi_radio_get_enabled(wifi_radio_obj_t *self); +extern void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled); + +extern mp_obj_t common_hal_wifi_radio_get_mac_address(wifi_radio_obj_t *self); + +extern mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self); +extern void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self); + +extern bool common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t* ssid, size_t ssid_len, uint8_t* password, size_t password_len, mp_float_t timeout); + +extern mp_obj_t common_hal_wifi_radio_get_ip_address(wifi_radio_obj_t *self); + +extern mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_WIFI_RADIO_H diff --git a/shared-bindings/wifi/__init__.c b/shared-bindings/wifi/__init__.c new file mode 100644 index 0000000000..a12881094c --- /dev/null +++ b/shared-bindings/wifi/__init__.c @@ -0,0 +1,71 @@ +/* + * 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 "py/objexcept.h" +#include "py/runtime.h" +#include "shared-bindings/wifi/__init__.h" +#include "shared-bindings/wifi/Network.h" +#include "shared-bindings/wifi/Radio.h" + +//| """ +//| The `wifi` module provides necessary low-level functionality for managing wifi +//| wifi connections. Use `socketpool` for communicating over the network. +//| +//| .. attribute:: radio +//| +//| Wifi radio used to manage both station and AP modes. +//| This object is the sole instance of `wifi.Radio`.""" +//| + + +// Called when wifi is imported. +STATIC mp_obj_t wifi___init__(void) { + common_hal_wifi_init(); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(wifi___init___obj, wifi___init__); + + +STATIC const mp_rom_map_elem_t wifi_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_wifi) }, + { MP_ROM_QSTR(MP_QSTR_Network), MP_ROM_PTR(&wifi_network_type) }, + { MP_ROM_QSTR(MP_QSTR_Radio), MP_ROM_PTR(&wifi_radio_type) }, + + // Properties + { MP_ROM_QSTR(MP_QSTR_radio), MP_ROM_PTR(&common_hal_wifi_radio_obj) }, + + // Initialization + { MP_ROM_QSTR(MP_QSTR___init__), MP_ROM_PTR(&wifi___init___obj) }, + +}; + +STATIC MP_DEFINE_CONST_DICT(wifi_module_globals, wifi_module_globals_table); + + +const mp_obj_module_t wifi_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&wifi_module_globals, +}; diff --git a/shared-bindings/wifi/__init__.h b/shared-bindings/wifi/__init__.h new file mode 100644 index 0000000000..c06ee16be7 --- /dev/null +++ b/shared-bindings/wifi/__init__.h @@ -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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WIFI___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_WIFI___INIT___H + +#include "py/objlist.h" + +#include "shared-bindings/wifi/Radio.h" + +extern wifi_radio_obj_t common_hal_wifi_radio_obj; + +void common_hal_wifi_init(void); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_WIFI___INIT___H From 1a6f4e0fe0f8417ea99a3cdb55d8764f47258bea Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 30 Jul 2020 17:58:12 -0700 Subject: [PATCH 0648/1293] Scanning WIP. Need to sort out supervisor memory --- ports/esp32s2/Makefile | 4 +- ports/esp32s2/common-hal/wifi/Network.h | 4 +- ports/esp32s2/common-hal/wifi/Radio.c | 44 ++++- ports/esp32s2/common-hal/wifi/Radio.h | 14 +- .../esp32s2/common-hal/wifi/ScannedNetworks.c | 159 ++++++++++++++++++ .../esp32s2/common-hal/wifi/ScannedNetworks.h | 62 +++++++ ports/esp32s2/common-hal/wifi/__init__.c | 72 +++++++- ports/esp32s2/common-hal/wifi/__init__.h | 2 + ports/esp32s2/esp-idf | 2 +- ports/esp32s2/partitions.csv | 10 +- ports/esp32s2/sdkconfig.defaults | 26 +-- ports/esp32s2/supervisor/port.c | 32 +++- py/circuitpy_defns.mk | 1 + shared-bindings/wifi/Radio.c | 4 +- shared-bindings/wifi/ScannedNetworks.c | 68 ++++++++ shared-bindings/wifi/ScannedNetworks.h | 39 +++++ supervisor/port.h | 2 + 17 files changed, 513 insertions(+), 32 deletions(-) create mode 100644 ports/esp32s2/common-hal/wifi/ScannedNetworks.c create mode 100644 ports/esp32s2/common-hal/wifi/ScannedNetworks.h create mode 100644 shared-bindings/wifi/ScannedNetworks.c create mode 100644 shared-bindings/wifi/ScannedNetworks.h diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index b4abac60d7..e14a737b7c 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -248,7 +248,7 @@ menuconfig: $(BUILD)/esp-idf/config $(HEADER_BUILD)/qstr.i.last: | $(BUILD)/esp-idf/config/sdkconfig.h # Order here matters -ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash +ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip ESP_IDF_COMPONENTS_INCLUDE = driver freertos log soc @@ -278,8 +278,10 @@ esp-idf-stamp: $(BUILD)/esp-idf/config/sdkconfig.h esp-idf/bootloader_support/libbootloader_support.a \ esp-idf/esp32s2/ld/esp32s2.project.ld \ esp-idf/esp_event/libesp_event.a \ + esp-idf/esp_netif/libesp_netif.a \ esp-idf/esp_system/libesp_system.a \ esp-idf/esp_wifi/libesp_wifi.a \ + esp-idf/lwip/liblwip.a \ esp-idf/nvs_flash/libnvs_flash.a \ esp-idf/wpa_supplicant/libwpa_supplicant.a \ esp-idf/mbedtls/libmbedtls.a \ diff --git a/ports/esp32s2/common-hal/wifi/Network.h b/ports/esp32s2/common-hal/wifi/Network.h index 26d02d3fc2..ab75fcafe5 100644 --- a/ports/esp32s2/common-hal/wifi/Network.h +++ b/ports/esp32s2/common-hal/wifi/Network.h @@ -29,9 +29,11 @@ #include "py/obj.h" +#include "esp-idf/components/esp_wifi/include/esp_wifi_types.h" + typedef struct { mp_obj_base_t base; - // Stores no state currently. + wifi_ap_record_t record; } wifi_network_obj_t; #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_NETWORK_H diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index bbbeb23a20..0bdcfb01a4 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -26,28 +26,62 @@ #include "shared-bindings/wifi/Radio.h" +#include "py/runtime.h" +#include "shared-bindings/wifi/ScannedNetworks.h" + +#include "esp-idf/components/esp_wifi/include/esp_wifi.h" + bool common_hal_wifi_radio_get_enabled(wifi_radio_obj_t *self) { - return true; + return self->started; } void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled) { - + if (self->started && !enabled) { + esp_wifi_stop(); + self->started = false; + return; + } + if (!self->started && enabled) { + esp_wifi_start(); + self->started = true; + return; + } } mp_obj_t common_hal_wifi_radio_get_mac_address(wifi_radio_obj_t *self) { + uint8_t mac[6]; + esp_wifi_get_mac(ESP_IF_WIFI_STA, mac); return mp_const_none; } mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self) { - return mp_const_none; + if (self->current_scan != NULL) { + mp_raise_RuntimeError(translate("Already scanning for wifi networks")); + } + // check enabled + + wifi_scannednetworks_obj_t *scan = m_new_obj(wifi_scannednetworks_obj_t); + self->current_scan = scan; + scan->base.type = &wifi_scannednetworks_type; + scan->start_channel = 1; + scan->end_channel = 11; + scan->radio_event_group = self->event_group_handle; + wifi_scannednetworks_scan_next_channel(scan); + return scan; } void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) { - + // Free the memory used to store the found aps. + wifi_scannednetworks_deinit(self->current_scan); + self->current_scan = NULL; } bool common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t* ssid, size_t ssid_len, uint8_t* password, size_t password_len, mp_float_t timeout) { - return false; + // check enabled + wifi_config_t config; + esp_err_t result = esp_wifi_set_config(ESP_IF_WIFI_STA, &config); + result = esp_wifi_connect(); + return result == ESP_OK; } mp_obj_t common_hal_wifi_radio_get_ip_address(wifi_radio_obj_t *self) { diff --git a/ports/esp32s2/common-hal/wifi/Radio.h b/ports/esp32s2/common-hal/wifi/Radio.h index 56fc0d9d6e..f681213dd8 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.h +++ b/ports/esp32s2/common-hal/wifi/Radio.h @@ -29,9 +29,21 @@ #include "py/obj.h" +#include "esp-idf/components/esp_event/include/esp_event.h" + +#include "shared-bindings/wifi/ScannedNetworks.h" + +// Event bits for the Radio event group. +#define WIFI_SCAN_DONE_BIT BIT0 + typedef struct { mp_obj_base_t base; - // Stores no state currently. + esp_event_handler_instance_t handler_instance_all_wifi; + esp_event_handler_instance_t handler_instance_got_ip; + wifi_scannednetworks_obj_t *current_scan; + StaticEventGroup_t event_group; + EventGroupHandle_t event_group_handle; + bool started; } wifi_radio_obj_t; #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_RADIO_H diff --git a/ports/esp32s2/common-hal/wifi/ScannedNetworks.c b/ports/esp32s2/common-hal/wifi/ScannedNetworks.c new file mode 100644 index 0000000000..a67a5f3bd8 --- /dev/null +++ b/ports/esp32s2/common-hal/wifi/ScannedNetworks.c @@ -0,0 +1,159 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2017 Glenn Ruben Bakke + * + * 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 "lib/utils/interrupt_char.h" +#include "py/objstr.h" +#include "py/runtime.h" +#include "shared-bindings/wifi/__init__.h" +#include "shared-bindings/wifi/Network.h" +#include "shared-bindings/wifi/Radio.h" +#include "shared-bindings/wifi/ScannedNetworks.h" + +#include "esp-idf/components/esp_wifi/include/esp_wifi.h" + +static void wifi_scannednetworks_done(wifi_scannednetworks_obj_t *self) { + self->done = true; + free(self->results); + self->results = NULL; +} + +static bool wifi_scannednetworks_wait_for_scan(wifi_scannednetworks_obj_t *self) { + EventBits_t bits = xEventGroupWaitBits(self->radio_event_group, + WIFI_SCAN_DONE_BIT, + pdTRUE, + pdTRUE, + 0); + while ((bits & WIFI_SCAN_DONE_BIT) == 0 && !mp_hal_is_interrupted()) { + RUN_BACKGROUND_TASKS; + bits = xEventGroupWaitBits(self->radio_event_group, + WIFI_SCAN_DONE_BIT, + pdTRUE, + pdTRUE, + 0); + } + return !mp_hal_is_interrupted(); +} + +mp_obj_t common_hal_wifi_scannednetworks_next(wifi_scannednetworks_obj_t *self) { + if (self->done) { + return mp_const_none; + } + // If we are scanning, wait and then load them. + if (self->scanning) { + // We may have to scan more than one channel to get a result. + while (!self->done) { + if (!wifi_scannednetworks_wait_for_scan(self)) { + wifi_scannednetworks_done(self); + return mp_const_none; + } + + esp_wifi_scan_get_ap_num(&self->total_results); + if (self->total_results > 0) { + break; + } + // If total_results is zero then we need to start a scan and wait again. + wifi_scannednetworks_scan_next_channel(self); + } + // We not have found any more results so we're done. + if (self->done) { + return mp_const_none; + } + // If we need more space than we have, realloc. + if (self->total_results > self->max_results) { + wifi_ap_record_t* results = m_renew_maybe(wifi_ap_record_t, + self->results, + self->max_results, + self->total_results, + true /* allow move */); + if (results != NULL) { + self->results = results; + self->max_results = self->total_results; + } else { + if (self->max_results == 0) { + // No room for any results should error. + mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate wifi scan memory")); + } + // Unable to allocate more results, so load what we can. + self->total_results = self->max_results; + } + } + esp_wifi_scan_get_ap_records(&self->total_results, self->results); + self->scanning = false; + } + + wifi_network_obj_t *entry = m_new_obj(wifi_network_obj_t); + entry->base.type = &wifi_network_type; + memcpy(&entry->record, &self->results[self->current_result], sizeof(wifi_ap_record_t)); + self->current_result++; + + // If we're returning our last network then start the next channel scan or + // be done. + if (self->current_result >= self->total_results) { + wifi_scannednetworks_scan_next_channel(self); + self->total_results = 0; + self->current_result = 0; + } + + return MP_OBJ_FROM_PTR(entry); +} + +// We don't do a linear scan so that we look at a variety of spectrum up front. +static uint8_t scan_pattern[] = {6, 1, 11, 3, 9, 13, 2, 4, 8, 12, 5, 7, 10, 14}; + +void wifi_scannednetworks_scan_next_channel(wifi_scannednetworks_obj_t *self) { + wifi_scan_config_t config; + uint8_t next_channel = sizeof(scan_pattern); + while (self->current_channel_index < sizeof(scan_pattern)) { + next_channel = scan_pattern[self->current_channel_index]; + self->current_channel_index++; + if (self->start_channel <= next_channel && next_channel <= self->end_channel) { + break; + } + } + if (next_channel == sizeof(scan_pattern) || + esp_wifi_scan_start(&config, false) != ESP_OK) { + wifi_scannednetworks_done(self); + } else { + self->scanning = true; + } +} + +void wifi_scannednetworks_deinit(wifi_scannednetworks_obj_t* self) { + // if a scan is active, make sure and clean up the idf's buffer of results. + if (self->scanning) { + esp_wifi_scan_stop(); + if (wifi_scannednetworks_wait_for_scan(self)) { + uint16_t number = 0; + esp_wifi_scan_get_ap_records(&number, NULL); + self->scanning = false; + } + } + wifi_scannednetworks_done(self); +} diff --git a/ports/esp32s2/common-hal/wifi/ScannedNetworks.h b/ports/esp32s2/common-hal/wifi/ScannedNetworks.h new file mode 100644 index 0000000000..cd57e95f29 --- /dev/null +++ b/ports/esp32s2/common-hal/wifi/ScannedNetworks.h @@ -0,0 +1,62 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * Copyright (c) 2018 Artur Pacholec + * + * 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_ESP32S2_COMMON_HAL_WIFI_SCANNEDNETWORKS_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_SCANNEDNETWORKS_H + +#include + +#include "py/obj.h" + +#include "FreeRTOS.h" +#include "freertos/event_groups.h" + +#include "esp-idf/components/esp_wifi/include/esp_wifi_types.h" + +typedef struct { + mp_obj_base_t base; + uint8_t current_channel_index; + EventGroupHandle_t radio_event_group; + + // Results from the last channel scan + wifi_ap_record_t* results; + uint16_t current_result; + uint16_t total_results; + uint16_t max_results; + + // Limits on what channels to scan. + uint8_t start_channel; + uint8_t end_channel; // Inclusive + + bool done; + bool scanning; +} wifi_scannednetworks_obj_t; + +void wifi_scannednetworks_scan_next_channel(wifi_scannednetworks_obj_t *self); +void wifi_scannednetworks_deinit(wifi_scannednetworks_obj_t *self); + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_SCANNEDNETWORKS_H diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index 42410f4839..9f08603b50 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -28,22 +28,88 @@ #include "py/runtime.h" +#include "esp_log.h" +static const char *TAG = "cp wifi"; + #include "esp-idf/components/esp_wifi/include/esp_wifi.h" wifi_radio_obj_t common_hal_wifi_radio_obj; -void common_hal_wifi_init(void) { - common_hal_wifi_radio_obj.base.type = &wifi_radio_type; - wifi_init_config_t config = WIFI_INIT_CONFIG_DEFAULT(); +static void event_handler(void* arg, esp_event_base_t event_base, + int32_t event_id, void* event_data) { + ESP_LOGI(TAG, "event"); + wifi_radio_obj_t* radio = arg; + if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_SCAN_DONE) { + xEventGroupSetBits(radio->event_group_handle, WIFI_SCAN_DONE_BIT); + } + // esp_wifi_connect(); + // if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) { + // esp_wifi_connect(); + // } else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) { + // if (s_retry_num < EXAMPLE_ESP_MAXIMUM_RETRY) { + // esp_wifi_connect(); + // s_retry_num++; + // ESP_LOGI(TAG, "retry to connect to the AP"); + // } else { + // xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT); + // } + // ESP_LOGI(TAG,"connect to the AP fail"); + // } else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) { + // ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data; + // ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip)); + // s_retry_num = 0; + // xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT); + // } +} +static bool wifi_inited; + +void common_hal_wifi_init(void) { + ESP_LOGI(TAG, "init"); + wifi_inited = true; + common_hal_wifi_radio_obj.base.type = &wifi_radio_type; + + ESP_ERROR_CHECK(esp_netif_init()); + + ESP_ERROR_CHECK(esp_event_loop_create_default()); + esp_netif_create_default_wifi_sta(); + + wifi_radio_obj_t* self = &common_hal_wifi_radio_obj; + self->event_group_handle = xEventGroupCreateStatic(&self->event_group); + ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, + ESP_EVENT_ANY_ID, + &event_handler, + self, + self->handler_instance_all_wifi)); + ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT, + IP_EVENT_STA_GOT_IP, + &event_handler, + self, + self->handler_instance_got_ip)); + + + wifi_init_config_t config = WIFI_INIT_CONFIG_DEFAULT(); esp_err_t result = esp_wifi_init(&config); if (result == ESP_ERR_NO_MEM) { mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate Wifi memory")); } else if (result != ESP_OK) { // handle this } + common_hal_wifi_radio_set_enabled(self, true); } void wifi_reset(void) { + ESP_LOGI(TAG, "reset"); + if (!wifi_inited) { + return; + } + wifi_radio_obj_t* radio = &common_hal_wifi_radio_obj; + common_hal_wifi_radio_set_enabled(radio, false); + ESP_ERROR_CHECK(esp_event_handler_instance_unregister(WIFI_EVENT, + ESP_EVENT_ANY_ID, + radio->handler_instance_all_wifi)); + ESP_ERROR_CHECK(esp_event_handler_instance_unregister(IP_EVENT, + IP_EVENT_STA_GOT_IP, + radio->handler_instance_got_ip)); esp_wifi_deinit(); } diff --git a/ports/esp32s2/common-hal/wifi/__init__.h b/ports/esp32s2/common-hal/wifi/__init__.h index e7ff7ec04a..bb68bcfdf0 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.h +++ b/ports/esp32s2/common-hal/wifi/__init__.h @@ -29,4 +29,6 @@ #include "py/obj.h" +void wifi_reset(void); + #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI___INIT___H diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index f5aff20b37..e15ce11ebc 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit f5aff20b378f7c4002605a4158a41630c21f343d +Subproject commit e15ce11ebca15a1f6eca22779e89f761b1fc2142 diff --git a/ports/esp32s2/partitions.csv b/ports/esp32s2/partitions.csv index 47fb295e5e..dd12c609dc 100644 --- a/ports/esp32s2/partitions.csv +++ b/ports/esp32s2/partitions.csv @@ -3,8 +3,8 @@ # bootloader.bin 0x1000 # partition table 0x8000, 0xC00 otadata, data, ota, 0xd000, 0x2000, -ota_0, 0, ota_0, 0x10000, 512K, -ota_1, 0, ota_1, 0x90000, 512K, -phy_init, data, phy, 0x110000, 0x1000, -nvs, data, nvs, 0x111000, 0x6000, -user_fs, data, fat, 0x200000, 2M, +ota_0, 0, ota_0, 0x10000, 0x100000, +ota_1, 0, ota_1, 0x110000, 0x100000, +phy_init, data, phy, 0x210000, 0x1000, +nvs, data, nvs, 0x211000, 0x6000, +user_fs, data, fat, 0x217000, 0x1e9000, diff --git a/ports/esp32s2/sdkconfig.defaults b/ports/esp32s2/sdkconfig.defaults index 8245c7db6c..f7693ce18f 100644 --- a/ports/esp32s2/sdkconfig.defaults +++ b/ports/esp32s2/sdkconfig.defaults @@ -122,8 +122,8 @@ CONFIG_PARTITION_TABLE_MD5=y # # Compiler options # -CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y -# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set +# CONFIG_COMPILER_OPTIMIZATION_DEFAULT is not set +CONFIG_COMPILER_OPTIMIZATION_SIZE=y # CONFIG_COMPILER_OPTIMIZATION_PERF is not set # CONFIG_COMPILER_OPTIMIZATION_NONE is not set # CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE is not set @@ -331,10 +331,17 @@ CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_TX_BA_WIN=6 CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP32_WIFI_RX_BA_WIN=6 -CONFIG_ESP32_WIFI_NVS_ENABLED=y +# CONFIG_ESP32_WIFI_NVS_ENABLED is not set CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 -# CONFIG_ESP32_WIFI_DEBUG_LOG_ENABLE is not set +CONFIG_ESP32_WIFI_DEBUG_LOG_ENABLE=y +CONFIG_ESP32_WIFI_DEBUG_LOG_DEBUG=y +# CONFIG_ESP32_WIFI_DEBUG_LOG_VERBOSE is not set +# CONFIG_ESP32_WIFI_DEBUG_LOG_MODULE_ALL is not set +CONFIG_ESP32_WIFI_DEBUG_LOG_MODULE_WIFI=y +# CONFIG_ESP32_WIFI_DEBUG_LOG_MODULE_COEX is not set +# CONFIG_ESP32_WIFI_DEBUG_LOG_MODULE_MESH is not set +# CONFIG_ESP32_WIFI_DEBUG_LOG_SUBMODULE is not set CONFIG_ESP32_WIFI_IRAM_OPT=y CONFIG_ESP32_WIFI_RX_IRAM_OPT=y # CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE is not set @@ -387,7 +394,6 @@ CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 # CONFIG_FREERTOS_USE_TRACE_FACILITY is not set # CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set -CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y # CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set CONFIG_FREERTOS_DEBUG_OCDAWARE=y @@ -576,8 +582,8 @@ CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y CONFIG_MBEDTLS_SSL_RENEGOTIATION=y # CONFIG_MBEDTLS_SSL_PROTO_SSL3 is not set -CONFIG_MBEDTLS_SSL_PROTO_TLS1=y -CONFIG_MBEDTLS_SSL_PROTO_TLS1_1=y +# CONFIG_MBEDTLS_SSL_PROTO_TLS1 is not set +# CONFIG_MBEDTLS_SSL_PROTO_TLS1_1 is not set CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y CONFIG_MBEDTLS_SSL_PROTO_DTLS=y CONFIG_MBEDTLS_SSL_ALPN=y @@ -708,7 +714,7 @@ CONFIG_VFS_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 CONFIG_WPA_MBEDTLS_CRYPTO=y # CONFIG_WPA_DEBUG_PRINT is not set # CONFIG_WPA_TESTING_OPTIONS is not set -# CONFIG_WPA_TLS_V12 is not set +CONFIG_WPA_TLS_V12=y # CONFIG_WPA_WPS_WARS is not set # end of Supplicant # end of Component config @@ -743,8 +749,8 @@ CONFIG_MONITOR_BAUD_115200B=y # CONFIG_MONITOR_BAUD_OTHER is not set CONFIG_MONITOR_BAUD_OTHER_VAL=115200 CONFIG_MONITOR_BAUD=115200 -CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y -# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set +CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE=y # CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED is not set CONFIG_OPTIMIZATION_ASSERTIONS_SILENT=y # CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index e4767e5146..24e826c195 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -39,15 +39,25 @@ #include "common-hal/busio/SPI.h" #include "common-hal/busio/UART.h" #include "common-hal/pulseio/PWMOut.h" +#include "common-hal/wifi/__init__.h" #include "supervisor/memory.h" #include "supervisor/shared/tick.h" +#include "esp-idf/components/heap/include/esp_heap_caps.h" + +#include "esp_log.h" +static const char *TAG = "cp port"; + +#define HEAP_SIZE (96 * 1024) + STATIC esp_timer_handle_t _tick_timer; void tick_timer_cb(void* arg) { supervisor_tick(); } +uint32_t* heap; + safe_mode_t port_init(void) { esp_timer_create_args_t args; args.callback = &tick_timer_cb; @@ -55,6 +65,12 @@ safe_mode_t port_init(void) { args.dispatch_method = ESP_TIMER_TASK; args.name = "CircuitPython Tick"; esp_timer_create(&args, &_tick_timer); + + heap = malloc(HEAP_SIZE); + if (heap == NULL) { + heap_caps_print_heap_info(MALLOC_CAP_8BIT); + ESP_LOGE(TAG, "failed to allocate heap"); + } never_reset_module_internal_pins(); return NO_SAFE_MODE; } @@ -73,6 +89,9 @@ void reset_port(void) { spi_reset(); uart_reset(); #endif +#if CIRCUITPY_WIFI + wifi_reset(); +#endif } void reset_to_bootloader(void) { @@ -81,14 +100,14 @@ void reset_to_bootloader(void) { void reset_cpu(void) { } -uint32_t heap[64 / sizeof(uint32_t) * 1024]; - uint32_t *port_heap_get_bottom(void) { + + ESP_EARLY_LOGI(TAG, "heap %x", heap); return heap; } uint32_t *port_heap_get_top(void) { - return heap + sizeof(heap) / sizeof(heap[0]); + return heap + (HEAP_SIZE / sizeof(uint32_t)); } uint32_t *port_stack_get_limit(void) { @@ -110,6 +129,13 @@ supervisor_allocation* port_fixed_stack(void) { return &_fixed_stack; } +supervisor_allocation _fixed_heap; +supervisor_allocation* port_fixed_heap(void) { + _fixed_heap.ptr = port_heap_get_bottom(); + _fixed_heap.length = (port_heap_get_top() - port_heap_get_bottom()) * sizeof(uint32_t); + return &_fixed_heap; +} + // Place the word to save just after our BSS section that gets blanked. void port_set_saved_word(uint32_t value) { } diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 5d5b6996d1..caf65d27ef 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -338,6 +338,7 @@ SRC_COMMON_HAL_ALL = \ watchdog/__init__.c \ wifi/Network.c \ wifi/Radio.c \ + wifi/ScannedNetworks.c \ wifi/__init__.c \ SRC_COMMON_HAL = $(filter $(SRC_PATTERNS), $(SRC_COMMON_HAL_ALL)) diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 1eb07d8fcf..c5bee83114 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -78,8 +78,8 @@ const mp_obj_property_t wifi_radio_mac_address_obj = { }; -//| def start_scanning_networks(self) -> Iterable[Network]: -//| """""" +//| def start_scanning_networks(self, *, start_channel=1, stop_channel=11) -> Iterable[Network]: +//| """Scans for available wifi networks over the given channel range. Make sure the channels are allowed in your country.""" //| ... //| STATIC mp_obj_t wifi_radio_start_scanning_networks(mp_obj_t self_in) { diff --git a/shared-bindings/wifi/ScannedNetworks.c b/shared-bindings/wifi/ScannedNetworks.c new file mode 100644 index 0000000000..3e60d5f108 --- /dev/null +++ b/shared-bindings/wifi/ScannedNetworks.c @@ -0,0 +1,68 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2017 Glenn Ruben Bakke + * + * 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 "py/objproperty.h" +#include "py/runtime.h" +#include "shared-bindings/wifi/ScannedNetworks.h" + +//| class ScannedNetworks: +//| """Iterates over wifi `Network`s found while scanning. This object is always created +//| by a `wifi.Radio`: it has no user-visible constructor.""" +//| +STATIC mp_obj_t scannednetworks_iternext(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &wifi_scannednetworks_type)); + wifi_scannednetworks_obj_t *self = MP_OBJ_TO_PTR(self_in); + mp_obj_t network = common_hal_wifi_scannednetworks_next(self); + if (network != mp_const_none) { + return network; + } + return MP_OBJ_STOP_ITERATION; +} + +//| def __init__(self) -> None: +//| """Cannot be instantiated directly. Use `wifi.Radio.start_scanning_networks`.""" +//| ... +//| +//| def __iter__(self) -> Iterator[Network]: +//| """Returns itself since it is the iterator.""" +//| ... +//| +//| def __next__(self) -> Network: +//| """Returns the next `wifi.Network`. +//| Raises `StopIteration` if scanning is finished and no other results are available.""" +//| ... +//| + +const mp_obj_type_t wifi_scannednetworks_type = { + { &mp_type_type }, + .name = MP_QSTR_ScannedNetworks, + .getiter = mp_identity_getiter, + .iternext = scannednetworks_iternext, +}; diff --git a/shared-bindings/wifi/ScannedNetworks.h b/shared-bindings/wifi/ScannedNetworks.h new file mode 100644 index 0000000000..8e0aa435d0 --- /dev/null +++ b/shared-bindings/wifi/ScannedNetworks.h @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2017 Glenn Ruben Bakke + * + * 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_WIFI_SCANNEDNETWORKS_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_WIFI_SCANNEDNETWORKS_H + +#include "py/obj.h" +#include "common-hal/wifi/ScannedNetworks.h" + +extern const mp_obj_type_t wifi_scannednetworks_type; + +mp_obj_t common_hal_wifi_scannednetworks_next(wifi_scannednetworks_obj_t *self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_WIFI_SCANNEDNETWORKS_H diff --git a/supervisor/port.h b/supervisor/port.h index ad5b3cf32a..ddb96bd524 100644 --- a/supervisor/port.h +++ b/supervisor/port.h @@ -69,6 +69,8 @@ uint32_t *port_heap_get_bottom(void); // Get heap top address uint32_t *port_heap_get_top(void); +supervisor_allocation* port_fixed_heap(void); + // Save and retrieve a word from memory that is preserved over reset. Used for safe mode. void port_set_saved_word(uint32_t); uint32_t port_get_saved_word(void); From ddcff85fa23f44c899c135b70603ba78b839a046 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 31 Jul 2020 19:29:22 -0700 Subject: [PATCH 0649/1293] Add debugging. Scanning doesn't crash but returns no results. Need to config station. --- main.c | 5 +-- ports/esp32s2/common-hal/wifi/Radio.c | 31 +++++++++++++++++-- ports/esp32s2/common-hal/wifi/Radio.h | 4 +++ .../esp32s2/common-hal/wifi/ScannedNetworks.c | 29 +++++++++++++---- ports/esp32s2/common-hal/wifi/__init__.c | 19 +++++++++--- ports/esp32s2/supervisor/port.c | 3 +- shared-bindings/wifi/ScannedNetworks.c | 5 +++ supervisor/shared/memory.c | 4 +++ 8 files changed, 85 insertions(+), 15 deletions(-) diff --git a/main.c b/main.c index fb73b09b1f..3a14df0fa6 100755 --- a/main.c +++ b/main.c @@ -436,11 +436,12 @@ int run_repl(void) { } int __attribute__((used)) main(void) { - memory_init(); - // initialise the cpu and peripherals safe_mode_t safe_mode = port_init(); + // Init memory after the port in case the port needs to set aside memory. + memory_init(); + // Turn on LEDs init_status_leds(); rgb_led_status_init(); diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index 0bdcfb01a4..a2944dd52c 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -31,18 +31,41 @@ #include "esp-idf/components/esp_wifi/include/esp_wifi.h" +#include "esp_log.h" +static const char *TAG = "cp radio"; + +static void start_station(wifi_radio_obj_t *self) { + if (self->sta_mode) { + return; + } + wifi_mode_t next_mode; + if (self->ap_mode) { + next_mode = WIFI_MODE_APSTA; + } else { + next_mode = WIFI_MODE_STA; + } + esp_wifi_set_mode(next_mode); + + esp_wifi_set_config(WIFI_MODE_STA, &self->sta_config); +} + bool common_hal_wifi_radio_get_enabled(wifi_radio_obj_t *self) { return self->started; } void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled) { if (self->started && !enabled) { - esp_wifi_stop(); + ESP_LOGI(TAG, "stop"); + if (self->current_scan != NULL) { + common_hal_wifi_radio_stop_scanning_networks(self); + } + ESP_ERROR_CHECK(esp_wifi_stop()); self->started = false; return; } if (!self->started && enabled) { - esp_wifi_start(); + ESP_LOGI(TAG, "start"); + ESP_ERROR_CHECK(esp_wifi_start()); self->started = true; return; } @@ -59,7 +82,9 @@ mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self) { mp_raise_RuntimeError(translate("Already scanning for wifi networks")); } // check enabled + start_station(self); + ESP_LOGI(TAG, "start scan"); wifi_scannednetworks_obj_t *scan = m_new_obj(wifi_scannednetworks_obj_t); self->current_scan = scan; scan->base.type = &wifi_scannednetworks_type; @@ -72,8 +97,10 @@ mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self) { void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) { // Free the memory used to store the found aps. + ESP_EARLY_LOGI(TAG, "stop scan"); wifi_scannednetworks_deinit(self->current_scan); self->current_scan = NULL; + ESP_EARLY_LOGI(TAG, "stop scan done"); } bool common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t* ssid, size_t ssid_len, uint8_t* password, size_t password_len, mp_float_t timeout) { diff --git a/ports/esp32s2/common-hal/wifi/Radio.h b/ports/esp32s2/common-hal/wifi/Radio.h index f681213dd8..11b30799ac 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.h +++ b/ports/esp32s2/common-hal/wifi/Radio.h @@ -43,7 +43,11 @@ typedef struct { wifi_scannednetworks_obj_t *current_scan; StaticEventGroup_t event_group; EventGroupHandle_t event_group_handle; + wifi_config_t sta_config; + esp_netif_t *netif; bool started; + bool ap_mode; + bool sta_mode; } wifi_radio_obj_t; #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_RADIO_H diff --git a/ports/esp32s2/common-hal/wifi/ScannedNetworks.c b/ports/esp32s2/common-hal/wifi/ScannedNetworks.c index a67a5f3bd8..248defa574 100644 --- a/ports/esp32s2/common-hal/wifi/ScannedNetworks.c +++ b/ports/esp32s2/common-hal/wifi/ScannedNetworks.c @@ -38,10 +38,16 @@ #include "esp-idf/components/esp_wifi/include/esp_wifi.h" +#include "esp_log.h" +static const char *TAG = "cp scannednetworks"; + static void wifi_scannednetworks_done(wifi_scannednetworks_obj_t *self) { self->done = true; - free(self->results); - self->results = NULL; + ESP_EARLY_LOGI(TAG, "free %x", self->results); + if (self->results != NULL) { + m_free(self->results); + self->results = NULL; + } } static bool wifi_scannednetworks_wait_for_scan(wifi_scannednetworks_obj_t *self) { @@ -75,6 +81,7 @@ mp_obj_t common_hal_wifi_scannednetworks_next(wifi_scannednetworks_obj_t *self) } esp_wifi_scan_get_ap_num(&self->total_results); + self->scanning = false; if (self->total_results > 0) { break; } @@ -83,6 +90,7 @@ mp_obj_t common_hal_wifi_scannednetworks_next(wifi_scannednetworks_obj_t *self) } // We not have found any more results so we're done. if (self->done) { + ESP_LOGI(TAG, "return done"); return mp_const_none; } // If we need more space than we have, realloc. @@ -92,6 +100,7 @@ mp_obj_t common_hal_wifi_scannednetworks_next(wifi_scannednetworks_obj_t *self) self->max_results, self->total_results, true /* allow move */); + ESP_EARLY_LOGI(TAG, "alloc %x", results); if (results != NULL) { self->results = results; self->max_results = self->total_results; @@ -128,7 +137,7 @@ mp_obj_t common_hal_wifi_scannednetworks_next(wifi_scannednetworks_obj_t *self) static uint8_t scan_pattern[] = {6, 1, 11, 3, 9, 13, 2, 4, 8, 12, 5, 7, 10, 14}; void wifi_scannednetworks_scan_next_channel(wifi_scannednetworks_obj_t *self) { - wifi_scan_config_t config; + uint8_t next_channel = sizeof(scan_pattern); while (self->current_channel_index < sizeof(scan_pattern)) { next_channel = scan_pattern[self->current_channel_index]; @@ -137,11 +146,19 @@ void wifi_scannednetworks_scan_next_channel(wifi_scannednetworks_obj_t *self) { break; } } - if (next_channel == sizeof(scan_pattern) || - esp_wifi_scan_start(&config, false) != ESP_OK) { + wifi_scan_config_t config = { 0 }; + config.channel = next_channel; + if (next_channel == sizeof(scan_pattern)) { + ESP_LOGI(TAG, "scan done"); wifi_scannednetworks_done(self); } else { - self->scanning = true; + esp_err_t result = esp_wifi_scan_start(&config, false); + if (result != ESP_OK) { + ESP_LOGI(TAG, "start failed 0x%x", result); + wifi_scannednetworks_done(self); + } else { + self->scanning = true; + } } } diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index 9f08603b50..d4a1d9892e 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -33,11 +33,13 @@ static const char *TAG = "cp wifi"; #include "esp-idf/components/esp_wifi/include/esp_wifi.h" +#include "esp-idf/components/heap/include/esp_heap_caps.h" + wifi_radio_obj_t common_hal_wifi_radio_obj; static void event_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data) { - ESP_LOGI(TAG, "event"); + ESP_LOGI(TAG, "event %x", event_id); wifi_radio_obj_t* radio = arg; if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_SCAN_DONE) { xEventGroupSetBits(radio->event_group_handle, WIFI_SCAN_DONE_BIT); @@ -65,16 +67,20 @@ static void event_handler(void* arg, esp_event_base_t event_base, static bool wifi_inited; void common_hal_wifi_init(void) { - ESP_LOGI(TAG, "init"); + ESP_EARLY_LOGI(TAG, "init"); + heap_caps_print_heap_info(MALLOC_CAP_8BIT); wifi_inited = true; common_hal_wifi_radio_obj.base.type = &wifi_radio_type; ESP_ERROR_CHECK(esp_netif_init()); + ESP_EARLY_LOGI(TAG, "create event loop"); ESP_ERROR_CHECK(esp_event_loop_create_default()); - esp_netif_create_default_wifi_sta(); + ESP_EARLY_LOGI(TAG, "create wifi sta"); wifi_radio_obj_t* self = &common_hal_wifi_radio_obj; + self->netif = esp_netif_create_default_wifi_sta(); + self->event_group_handle = xEventGroupCreateStatic(&self->event_group); ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, ESP_EVENT_ANY_ID, @@ -88,6 +94,7 @@ void common_hal_wifi_init(void) { self->handler_instance_got_ip)); + ESP_EARLY_LOGI(TAG, "wifi init"); wifi_init_config_t config = WIFI_INIT_CONFIG_DEFAULT(); esp_err_t result = esp_wifi_init(&config); if (result == ESP_ERR_NO_MEM) { @@ -95,6 +102,7 @@ void common_hal_wifi_init(void) { } else if (result != ESP_OK) { // handle this } + ESP_EARLY_LOGI(TAG, "enable radio"); common_hal_wifi_radio_set_enabled(self, true); } @@ -111,5 +119,8 @@ void wifi_reset(void) { ESP_ERROR_CHECK(esp_event_handler_instance_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, radio->handler_instance_got_ip)); - esp_wifi_deinit(); + ESP_ERROR_CHECK(esp_wifi_deinit()); + esp_netif_destroy(radio->netif); + radio->netif = NULL; + ESP_ERROR_CHECK(esp_netif_deinit()); } diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 24e826c195..9a1ac5e2c8 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -48,7 +48,7 @@ #include "esp_log.h" static const char *TAG = "cp port"; -#define HEAP_SIZE (96 * 1024) +#define HEAP_SIZE (64 * 1024) STATIC esp_timer_handle_t _tick_timer; @@ -92,6 +92,7 @@ void reset_port(void) { #if CIRCUITPY_WIFI wifi_reset(); #endif + heap_caps_print_heap_info(MALLOC_CAP_8BIT); } void reset_to_bootloader(void) { diff --git a/shared-bindings/wifi/ScannedNetworks.c b/shared-bindings/wifi/ScannedNetworks.c index 3e60d5f108..c6b77d70b7 100644 --- a/shared-bindings/wifi/ScannedNetworks.c +++ b/shared-bindings/wifi/ScannedNetworks.c @@ -32,6 +32,9 @@ #include "py/runtime.h" #include "shared-bindings/wifi/ScannedNetworks.h" +#include "esp_log.h" +static const char *TAG = "cp iternext"; + //| class ScannedNetworks: //| """Iterates over wifi `Network`s found while scanning. This object is always created //| by a `wifi.Radio`: it has no user-visible constructor.""" @@ -43,6 +46,8 @@ STATIC mp_obj_t scannednetworks_iternext(mp_obj_t self_in) { if (network != mp_const_none) { return network; } + + ESP_EARLY_LOGI(TAG, "stop iteration"); return MP_OBJ_STOP_ITERATION; } diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c index 8ae8a16997..79bdeef9db 100755 --- a/supervisor/shared/memory.c +++ b/supervisor/shared/memory.c @@ -31,6 +31,9 @@ #include "supervisor/shared/display.h" +#include "esp_log.h" +static const char *TAG = "memory"; + #define CIRCUITPY_SUPERVISOR_ALLOC_COUNT (12) static supervisor_allocation allocations[CIRCUITPY_SUPERVISOR_ALLOC_COUNT]; @@ -39,6 +42,7 @@ uint32_t* low_address; uint32_t* high_address; void memory_init(void) { + ESP_LOGE(TAG, "memory init"); low_address = port_heap_get_bottom(); high_address = port_heap_get_top(); } From c62ab6e09a4dda33b75bcb0ee5fed800b756e564 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 5 Aug 2020 12:53:35 -0700 Subject: [PATCH 0650/1293] Add ipaddress --- ports/esp32s2/common-hal/wifi/Network.c | 15 +- ports/esp32s2/common-hal/wifi/Radio.c | 51 ++++- ports/esp32s2/common-hal/wifi/Radio.h | 2 + .../esp32s2/common-hal/wifi/ScannedNetworks.c | 7 +- ports/esp32s2/common-hal/wifi/__init__.c | 40 +++- py/circuitpy_defns.mk | 5 + py/circuitpy_mpconfig.h | 7 + py/circuitpy_mpconfig.mk | 3 + shared-bindings/ipaddress/IPv4Address.c | 180 ++++++++++++++++++ shared-bindings/ipaddress/IPv4Address.h | 38 ++++ shared-bindings/ipaddress/__init__.c | 65 +++++++ shared-bindings/ipaddress/__init__.h | 34 ++++ shared-bindings/wifi/Network.c | 39 +++- shared-bindings/wifi/Network.h | 2 + shared-bindings/wifi/Radio.c | 28 +-- shared-bindings/wifi/Radio.h | 4 +- shared-module/ipaddress/IPv4Address.c | 39 ++++ shared-module/ipaddress/IPv4Address.h | 37 ++++ shared-module/ipaddress/__init__.c | 35 ++++ shared-module/ipaddress/__init__.h | 36 ++++ 20 files changed, 634 insertions(+), 33 deletions(-) create mode 100644 shared-bindings/ipaddress/IPv4Address.c create mode 100644 shared-bindings/ipaddress/IPv4Address.h create mode 100644 shared-bindings/ipaddress/__init__.c create mode 100644 shared-bindings/ipaddress/__init__.h create mode 100644 shared-module/ipaddress/IPv4Address.c create mode 100644 shared-module/ipaddress/IPv4Address.h create mode 100644 shared-module/ipaddress/__init__.c create mode 100644 shared-module/ipaddress/__init__.h diff --git a/ports/esp32s2/common-hal/wifi/Network.c b/ports/esp32s2/common-hal/wifi/Network.c index a270fd9dcc..0320e8f92f 100644 --- a/ports/esp32s2/common-hal/wifi/Network.c +++ b/ports/esp32s2/common-hal/wifi/Network.c @@ -26,6 +26,19 @@ #include "shared-bindings/wifi/Network.h" +#include + +#include "py/obj.h" + mp_obj_t common_hal_wifi_network_get_ssid(wifi_network_obj_t *self) { - return mp_const_none; + const char* cstr = (const char*) self->record.ssid; + return mp_obj_new_str(cstr, strlen(cstr)); +} + +mp_obj_t common_hal_wifi_network_get_rssi(wifi_network_obj_t *self) { + return mp_obj_new_int(self->record.rssi); +} + +mp_obj_t common_hal_wifi_network_get_channel(wifi_network_obj_t *self) { + return mp_obj_new_int(self->record.primary); } diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index a2944dd52c..623ba9e345 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -26,7 +26,11 @@ #include "shared-bindings/wifi/Radio.h" +#include + +#include "lib/utils/interrupt_char.h" #include "py/runtime.h" +#include "shared-bindings/ipaddress/IPv4Address.h" #include "shared-bindings/wifi/ScannedNetworks.h" #include "esp-idf/components/esp_wifi/include/esp_wifi.h" @@ -103,16 +107,51 @@ void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) { ESP_EARLY_LOGI(TAG, "stop scan done"); } -bool common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t* ssid, size_t ssid_len, uint8_t* password, size_t password_len, mp_float_t timeout) { +bool 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) { // check enabled - wifi_config_t config; - esp_err_t result = esp_wifi_set_config(ESP_IF_WIFI_STA, &config); + wifi_config_t* config = &self->sta_config; + memcpy(&config->sta.ssid, ssid, ssid_len); + config->sta.ssid[ssid_len] = 0; + if (password_len > 0) { + memcpy(&config->sta.password, password, password_len); + } + config->sta.password[password_len] = 0; + config->sta.channel = channel; + ESP_EARLY_LOGI(TAG, "connecting to %s", config->sta.ssid); + esp_err_t result = esp_wifi_set_config(ESP_IF_WIFI_STA, config); + if (result != ESP_OK) { + ESP_EARLY_LOGI(TAG, "config fail %d", result); + } result = esp_wifi_connect(); - return result == ESP_OK; + if (result != ESP_OK) { + ESP_EARLY_LOGI(TAG, "connect fail %d", result); + } + + EventBits_t bits; + do { + RUN_BACKGROUND_TASKS; + bits = xEventGroupWaitBits(self->event_group_handle, + WIFI_CONNECTED_BIT | WIFI_DISCONNECTED_BIT, + pdTRUE, + pdTRUE, + 0); + } while ((bits & (WIFI_CONNECTED_BIT | WIFI_DISCONNECTED_BIT)) == 0 && !mp_hal_is_interrupted()); + if ((bits & WIFI_DISCONNECTED_BIT) != 0) { + return false; + } + return true; } -mp_obj_t common_hal_wifi_radio_get_ip_address(wifi_radio_obj_t *self) { - return mp_const_none; +mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self) { + if (!esp_netif_is_netif_up(self->netif)) { + return mp_const_none; + } + esp_netif_ip_info_t ip_info; + esp_err_t result = esp_netif_get_ip_info(self->netif, &ip_info); + if (result != ESP_OK) { + ESP_EARLY_LOGI(TAG, "get ip fail %d", result); + } + return common_hal_ipaddress_new_ipv4address(ip_info.ip.addr); } mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address) { diff --git a/ports/esp32s2/common-hal/wifi/Radio.h b/ports/esp32s2/common-hal/wifi/Radio.h index 11b30799ac..e7dce94776 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.h +++ b/ports/esp32s2/common-hal/wifi/Radio.h @@ -35,6 +35,8 @@ // Event bits for the Radio event group. #define WIFI_SCAN_DONE_BIT BIT0 +#define WIFI_CONNECTED_BIT BIT1 +#define WIFI_DISCONNECTED_BIT BIT2 typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/common-hal/wifi/ScannedNetworks.c b/ports/esp32s2/common-hal/wifi/ScannedNetworks.c index 248defa574..060e13f8ea 100644 --- a/ports/esp32s2/common-hal/wifi/ScannedNetworks.c +++ b/ports/esp32s2/common-hal/wifi/ScannedNetworks.c @@ -29,6 +29,7 @@ #include #include "lib/utils/interrupt_char.h" +#include "py/gc.h" #include "py/objstr.h" #include "py/runtime.h" #include "shared-bindings/wifi/__init__.h" @@ -45,7 +46,10 @@ static void wifi_scannednetworks_done(wifi_scannednetworks_obj_t *self) { self->done = true; ESP_EARLY_LOGI(TAG, "free %x", self->results); if (self->results != NULL) { - m_free(self->results); + // Check to see if the heap is still active. If not, it'll be freed automatically. + if (gc_alloc_possible()) { + m_free(self->results); + } self->results = NULL; } } @@ -137,7 +141,6 @@ mp_obj_t common_hal_wifi_scannednetworks_next(wifi_scannednetworks_obj_t *self) static uint8_t scan_pattern[] = {6, 1, 11, 3, 9, 13, 2, 4, 8, 12, 5, 7, 10, 14}; void wifi_scannednetworks_scan_next_channel(wifi_scannednetworks_obj_t *self) { - uint8_t next_channel = sizeof(scan_pattern); while (self->current_channel_index < sizeof(scan_pattern)) { next_channel = scan_pattern[self->current_channel_index]; diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index d4a1d9892e..1dc9ef9a89 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -41,9 +41,32 @@ static void event_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data) { ESP_LOGI(TAG, "event %x", event_id); wifi_radio_obj_t* radio = arg; - if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_SCAN_DONE) { - xEventGroupSetBits(radio->event_group_handle, WIFI_SCAN_DONE_BIT); + if (event_base == WIFI_EVENT) { + if (event_id == WIFI_EVENT_SCAN_DONE) { + ESP_LOGI(TAG, "scan done"); + xEventGroupSetBits(radio->event_group_handle, WIFI_SCAN_DONE_BIT); + } else if (event_id == WIFI_EVENT_STA_START) { + ESP_LOGI(TAG, "station start"); + + } else if (event_id == WIFI_EVENT_STA_STOP) { + ESP_LOGI(TAG, "station stop"); + + } else if (event_id == WIFI_EVENT_STA_CONNECTED) { + ESP_LOGI(TAG, "connected to ap"); + } else if (event_id == WIFI_EVENT_STA_DISCONNECTED) { + ESP_LOGI(TAG, "disconnected"); + wifi_event_sta_disconnected_t* d = (wifi_event_sta_disconnected_t*) event_data; + ESP_LOGI(TAG, "reason %d", d->reason); + if (event_id != WIFI_REASON_ASSOC_LEAVE) { + // reconnect + } + xEventGroupSetBits(radio->event_group_handle, WIFI_DISCONNECTED_BIT); + } else if (event_id == WIFI_EVENT_STA_AUTHMODE_CHANGE) { + ESP_LOGI(TAG, "auth change"); + + } } + // esp_wifi_connect(); // if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) { // esp_wifi_connect(); @@ -56,12 +79,13 @@ static void event_handler(void* arg, esp_event_base_t event_base, // xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT); // } // ESP_LOGI(TAG,"connect to the AP fail"); - // } else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) { - // ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data; - // ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip)); - // s_retry_num = 0; - // xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT); - // } + // } else + if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) { + ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data; + ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip)); + // s_retry_num = 0; + xEventGroupSetBits(radio->event_group_handle, WIFI_CONNECTED_BIT); + } } static bool wifi_inited; diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index caf65d27ef..1a5145c8ba 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -168,6 +168,9 @@ endif ifeq ($(CIRCUITPY_I2CPERIPHERAL),1) SRC_PATTERNS += i2cperipheral/% endif +ifeq ($(CIRCUITPY_IPADDRESS),1) +SRC_PATTERNS += ipaddress/% +endif ifeq ($(CIRCUITPY_MATH),1) SRC_PATTERNS += math/% endif @@ -408,6 +411,8 @@ SRC_SHARED_MODULE_ALL = \ fontio/__init__.c \ framebufferio/FramebufferDisplay.c \ framebufferio/__init__.c \ + ipaddress/IPv4Address.c \ + ipaddress/__init__.c \ sdcardio/SDCard.c \ sdcardio/__init__.c \ gamepad/GamePad.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 2db20ca1d1..8ff2ddc67d 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -420,6 +420,13 @@ extern const struct _mp_obj_module_t i2cperipheral_module; #define I2CPERIPHERAL_MODULE #endif +#if CIRCUITPY_IPADDRESS +extern const struct _mp_obj_module_t ipaddress_module; +#define IPADDRESS_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_ipaddress), (mp_obj_t)&ipaddress_module }, +#else +#define IPADDRESS_MODULE +#endif + #if CIRCUITPY_MATH extern const struct _mp_obj_module_t math_module; #define MATH_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_math), (mp_obj_t)&math_module }, diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index abbd5a9a0b..499e87aed0 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -120,6 +120,9 @@ CFLAGS += -DCIRCUITPY_GNSS=$(CIRCUITPY_GNSS) CIRCUITPY_I2CPERIPHERAL ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_I2CPERIPHERAL=$(CIRCUITPY_I2CPERIPHERAL) +CIRCUITPY_IPADDRESS ?= $(CIRCUITPY_WIFI) +CFLAGS += -DCIRCUITPY_IPADDRESS=$(CIRCUITPY_IPADDRESS) + CIRCUITPY_MATH ?= 1 CFLAGS += -DCIRCUITPY_MATH=$(CIRCUITPY_MATH) diff --git a/shared-bindings/ipaddress/IPv4Address.c b/shared-bindings/ipaddress/IPv4Address.c new file mode 100644 index 0000000000..3cef7516df --- /dev/null +++ b/shared-bindings/ipaddress/IPv4Address.c @@ -0,0 +1,180 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * Copyright (c) 2018 Artur Pacholec + * + * 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 "py/objproperty.h" +#include "py/objstr.h" +#include "py/runtime.h" +#include "shared-bindings/ipaddress/IPv4Address.h" + +//| class IPv4Address: +//| """Encapsulates an IPv4 address.""" +//| + +//| def __init__(self, address: Union[str, int]) -> None: +//| """Create a new Address object encapsulating the address value. +//| +//| The value itself can be one of:""" +//| ... +//| +STATIC mp_obj_t ipaddress_ipv4address_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_address }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_address, MP_ARG_OBJ | MP_ARG_REQUIRED }, + }; + + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + ipaddress_ipv4address_obj_t *self = m_new_obj(ipaddress_ipv4address_obj_t); + self->base.type = &ipaddress_ipv4address_type; + + const mp_obj_t address = args[ARG_address].u_obj; + mp_buffer_info_t buf_info; + mp_get_buffer_raise(address, &buf_info, MP_BUFFER_READ); + if (buf_info.len != 4) { + mp_raise_ValueError_varg(translate("Address must be %d bytes long"), 4); + } + + common_hal_ipaddress_ipv4address_construct(self, buf_info.buf, buf_info.len); + + return MP_OBJ_FROM_PTR(self); +} + +//| packed: bytes +//| """The bytes that make up the address (read-only).""" +//| +STATIC mp_obj_t ipaddress_ipv4address_get_packed(mp_obj_t self_in) { + ipaddress_ipv4address_obj_t *self = MP_OBJ_TO_PTR(self_in); + + return common_hal_ipaddress_ipv4address_get_packed(self); +} +MP_DEFINE_CONST_FUN_OBJ_1(ipaddress_ipv4address_get_packed_obj, ipaddress_ipv4address_get_packed); + +const mp_obj_property_t ipaddress_ipv4address_packed_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&ipaddress_ipv4address_get_packed_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| version: int +//| """4 for IPv4, 6 for IPv6""" +//| +STATIC mp_obj_t ipaddress_ipv4address_get_version(mp_obj_t self_in) { + ipaddress_ipv4address_obj_t *self = MP_OBJ_TO_PTR(self_in); + mp_buffer_info_t buf_info; + mp_obj_t address_bytes = common_hal_ipaddress_ipv4address_get_packed(self); + mp_get_buffer_raise(address_bytes, &buf_info, MP_BUFFER_READ); + mp_int_t version = 6; + if (buf_info.len == 4) { + version = 4; + } + + return MP_OBJ_NEW_SMALL_INT(version); +} +MP_DEFINE_CONST_FUN_OBJ_1(ipaddress_ipv4address_get_version_obj, ipaddress_ipv4address_get_version); + +const mp_obj_property_t ipaddress_ipv4address_version_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&ipaddress_ipv4address_get_version_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| def __eq__(self, other: Address) -> bool: +//| """Two Address objects are equal if their addresses and address types are equal.""" +//| ... +//| +STATIC mp_obj_t ipaddress_ipv4address_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { + switch (op) { + // Two Addresses are equal if their address bytes and address_type are equal + case MP_BINARY_OP_EQUAL: + if (MP_OBJ_IS_TYPE(rhs_in, &ipaddress_ipv4address_type)) { + ipaddress_ipv4address_obj_t *lhs = MP_OBJ_TO_PTR(lhs_in); + ipaddress_ipv4address_obj_t *rhs = MP_OBJ_TO_PTR(rhs_in); + return mp_obj_new_bool( + mp_obj_equal(common_hal_ipaddress_ipv4address_get_packed(lhs), + common_hal_ipaddress_ipv4address_get_packed(rhs))); + + } else { + return mp_const_false; + } + + default: + return MP_OBJ_NULL; // op not supported + } +} + +//| def __hash__(self) -> int: +//| """Returns a hash for the Address data.""" +//| ... +//| +STATIC mp_obj_t ipaddress_ipv4address_unary_op(mp_unary_op_t op, mp_obj_t self_in) { + switch (op) { + // Two Addresses are equal if their address bytes and address_type are equal + case MP_UNARY_OP_HASH: { + mp_obj_t bytes = common_hal_ipaddress_ipv4address_get_packed(MP_OBJ_TO_PTR(self_in)); + GET_STR_HASH(bytes, h); + if (h == 0) { + GET_STR_DATA_LEN(bytes, data, len); + h = qstr_compute_hash(data, len); + } + return MP_OBJ_NEW_SMALL_INT(h); + } + default: + return MP_OBJ_NULL; // op not supported + } +} + +STATIC void ipaddress_ipv4address_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { + ipaddress_ipv4address_obj_t *self = MP_OBJ_TO_PTR(self_in); + mp_buffer_info_t buf_info; + mp_obj_t address_bytes = common_hal_ipaddress_ipv4address_get_packed(self); + mp_get_buffer_raise(address_bytes, &buf_info, MP_BUFFER_READ); + + const uint8_t *buf = (uint8_t *) buf_info.buf; + mp_printf(print, "%d.%d.%d.%d", buf[0], buf[1], buf[2], buf[3]); +} + +STATIC const mp_rom_map_elem_t ipaddress_ipv4address_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_packed), MP_ROM_PTR(&ipaddress_ipv4address_packed_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(ipaddress_ipv4address_locals_dict, ipaddress_ipv4address_locals_dict_table); + +const mp_obj_type_t ipaddress_ipv4address_type = { + { &mp_type_type }, + .name = MP_QSTR_Address, + .make_new = ipaddress_ipv4address_make_new, + .print = ipaddress_ipv4address_print, + .unary_op = ipaddress_ipv4address_unary_op, + .binary_op = ipaddress_ipv4address_binary_op, + .locals_dict = (mp_obj_dict_t*)&ipaddress_ipv4address_locals_dict +}; diff --git a/shared-bindings/ipaddress/IPv4Address.h b/shared-bindings/ipaddress/IPv4Address.h new file mode 100644 index 0000000000..cf66b92b35 --- /dev/null +++ b/shared-bindings/ipaddress/IPv4Address.h @@ -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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_IPADDRESS_IPV4ADDRESS_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_IPADDRESS_IPV4ADDRESS_H + +#include "shared-module/ipaddress/IPv4Address.h" + +extern const mp_obj_type_t ipaddress_ipv4address_type; + +mp_obj_t common_hal_ipaddress_new_ipv4address(mp_int_t value); +void common_hal_ipaddress_ipv4address_construct(ipaddress_ipv4address_obj_t* self, uint8_t* buf, size_t len); +mp_obj_t common_hal_ipaddress_ipv4address_get_packed(ipaddress_ipv4address_obj_t* self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_IPADDRESS_IPV4ADDRESS_H diff --git a/shared-bindings/ipaddress/__init__.c b/shared-bindings/ipaddress/__init__.c new file mode 100644 index 0000000000..f9427ab847 --- /dev/null +++ b/shared-bindings/ipaddress/__init__.c @@ -0,0 +1,65 @@ +/* + * 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 "py/objexcept.h" +#include "py/runtime.h" +#include "shared-bindings/ipaddress/__init__.h" +#include "shared-bindings/ipaddress/IPv4Address.h" + +//| """ +//| The `ipaddress` module provides types for IP addresses. It is a subset of CPython's ipaddress +//| module. +//| """ +//| + +//| def ip_address(obj: Union[int]) -> IPv4Address: +//| """Return a corresponding IP address object or raise ValueError if not possible.""" +//| ... +//| + +STATIC mp_obj_t ipaddress_ip_address(mp_obj_t ip_in) { + mp_int_t value; + if (!mp_obj_get_int_maybe(ip_in, &value)) { + mp_raise_ValueError(translate("Only raw int supported for ip.")); + } + + return common_hal_ipaddress_new_ipv4address(value); +} +MP_DEFINE_CONST_FUN_OBJ_1(ipaddress_ip_address_obj, ipaddress_ip_address); + +STATIC const mp_rom_map_elem_t ipaddress_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_ipaddress) }, + { MP_ROM_QSTR(MP_QSTR_ip_address), MP_ROM_PTR(&ipaddress_ip_address_obj) }, + { MP_ROM_QSTR(MP_QSTR_IPv4Address), MP_ROM_PTR(&ipaddress_ipv4address_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(ipaddress_module_globals, ipaddress_module_globals_table); + + +const mp_obj_module_t ipaddress_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&ipaddress_module_globals, +}; diff --git a/shared-bindings/ipaddress/__init__.h b/shared-bindings/ipaddress/__init__.h new file mode 100644 index 0000000000..a31629ccae --- /dev/null +++ b/shared-bindings/ipaddress/__init__.h @@ -0,0 +1,34 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_IPADDRESS___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_IPADDRESS___INIT___H + +#include "shared-module/ipaddress/__init__.h" + +mp_obj_t common_hal_ipaddress_new_ipv4address(mp_int_t value); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_IPADDRESS___INIT___H diff --git a/shared-bindings/wifi/Network.c b/shared-bindings/wifi/Network.c index b4d389dcc9..b6d5e0901e 100644 --- a/shared-bindings/wifi/Network.c +++ b/shared-bindings/wifi/Network.c @@ -42,7 +42,7 @@ //| //| ssid: str -//| """True when the wifi network is enabled.""" +//| """String id of the network""" //| STATIC mp_obj_t wifi_network_get_ssid(mp_obj_t self) { return common_hal_wifi_network_get_ssid(self); @@ -57,8 +57,45 @@ const mp_obj_property_t wifi_network_ssid_obj = { (mp_obj_t)&mp_const_none_obj }, }; + +//| rssi: int +//| """Signal strength of the network""" +//| +STATIC mp_obj_t wifi_network_get_rssi(mp_obj_t self) { + return common_hal_wifi_network_get_rssi(self); + +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_network_get_rssi_obj, wifi_network_get_rssi); + +const mp_obj_property_t wifi_network_rssi_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&wifi_network_get_rssi_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + + +//| channel: int +//| """Channel number the network is operating on""" +//| +STATIC mp_obj_t wifi_network_get_channel(mp_obj_t self) { + return common_hal_wifi_network_get_channel(self); + +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_network_get_channel_obj, wifi_network_get_channel); + +const mp_obj_property_t wifi_network_channel_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&wifi_network_get_channel_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + + STATIC const mp_rom_map_elem_t wifi_network_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_ssid), MP_ROM_PTR(&wifi_network_ssid_obj) }, + { MP_ROM_QSTR(MP_QSTR_rssi), MP_ROM_PTR(&wifi_network_rssi_obj) }, + { MP_ROM_QSTR(MP_QSTR_channel), MP_ROM_PTR(&wifi_network_channel_obj) }, }; STATIC MP_DEFINE_CONST_DICT(wifi_network_locals_dict, wifi_network_locals_dict_table); diff --git a/shared-bindings/wifi/Network.h b/shared-bindings/wifi/Network.h index 8a3d10ca74..6a7f7be4a0 100644 --- a/shared-bindings/wifi/Network.h +++ b/shared-bindings/wifi/Network.h @@ -36,5 +36,7 @@ const mp_obj_type_t wifi_network_type; extern mp_obj_t common_hal_wifi_network_get_ssid(wifi_network_obj_t *self); +extern mp_obj_t common_hal_wifi_network_get_rssi(wifi_network_obj_t *self); +extern mp_obj_t common_hal_wifi_network_get_channel(wifi_network_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_WIFI_NETWORK_H diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index c5bee83114..1d14235730 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -102,16 +102,18 @@ STATIC mp_obj_t wifi_radio_stop_scanning_networks(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_stop_scanning_networks_obj, wifi_radio_stop_scanning_networks); -//| def connect(self, ssid: ReadableBuffer, password: ReadableBuffer = b"", *, timeout: Optional[float] = None) -> bool: -//| """""" +//| def connect(self, ssid: ReadableBuffer, password: ReadableBuffer = b"", *, channel: Optional[int] = 0, timeout: Optional[float] = None) -> bool: +//| """Connects to the given ssid and waits for an ip address. Reconnections are handled +//| automatically once one connection succeeds.""" //| ... //| 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_timeout }; + enum { ARG_ssid, ARG_password, ARG_channel, ARG_timeout }; static const mp_arg_t allowed_args[] = { { MP_QSTR_ssid, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, { MP_QSTR_password, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, + { MP_QSTR_channel, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, }; wifi_radio_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); @@ -136,22 +138,22 @@ STATIC mp_obj_t wifi_radio_connect(size_t n_args, const mp_obj_t *pos_args, mp_m mp_get_buffer_raise(args[ARG_password].u_obj, &password, MP_BUFFER_READ); } - return mp_obj_new_bool(common_hal_wifi_radio_connect(self, ssid.buf, ssid.len, password.buf, password.len, timeout)); + return mp_obj_new_bool(common_hal_wifi_radio_connect(self, ssid.buf, ssid.len, password.buf, password.len, args[ARG_channel].u_int, timeout)); } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wifi_radio_connect_obj, 1, wifi_radio_connect); -//| ip_address: Optional[ipaddress.IPAddress] -//| """IP Address of the radio when connected to an access point. None otherwise.""" +//| ipv4_address: Optional[ipaddress.IPv4Address] +//| """IP v4 Address of the radio when connected to an access point. None otherwise.""" //| -STATIC mp_obj_t wifi_radio_get_ip_address(mp_obj_t self) { - return common_hal_wifi_radio_get_ip_address(self); +STATIC mp_obj_t wifi_radio_get_ipv4_address(mp_obj_t self) { + return common_hal_wifi_radio_get_ipv4_address(self); } -MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ip_address_obj, wifi_radio_get_ip_address); +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_address_obj, wifi_radio_get_ipv4_address); -const mp_obj_property_t wifi_radio_ip_address_obj = { +const mp_obj_property_t wifi_radio_ipv4_address_obj = { .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_radio_get_ip_address_obj, + .proxy = { (mp_obj_t)&wifi_radio_get_ipv4_address_obj, (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj }, }; @@ -179,7 +181,7 @@ STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&wifi_radio_connect_obj) }, // { MP_ROM_QSTR(MP_QSTR_connect_to_enterprise), MP_ROM_PTR(&wifi_radio_connect_to_enterprise_obj) }, - { MP_ROM_QSTR(MP_QSTR_ip_address), MP_ROM_PTR(&wifi_radio_ip_address_obj) }, + { MP_ROM_QSTR(MP_QSTR_ipv4_address), MP_ROM_PTR(&wifi_radio_ipv4_address_obj) }, // { MP_ROM_QSTR(MP_QSTR_access_point_active), MP_ROM_PTR(&wifi_radio_access_point_active_obj) }, // { MP_ROM_QSTR(MP_QSTR_start_access_point), MP_ROM_PTR(&wifi_radio_start_access_point_obj) }, diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index c3bdac5ba8..3890885aeb 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -43,9 +43,9 @@ extern mp_obj_t common_hal_wifi_radio_get_mac_address(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self); extern void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self); -extern bool common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t* ssid, size_t ssid_len, uint8_t* password, size_t password_len, mp_float_t timeout); +extern bool 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); -extern mp_obj_t common_hal_wifi_radio_get_ip_address(wifi_radio_obj_t *self); +extern mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self); extern mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address); diff --git a/shared-module/ipaddress/IPv4Address.c b/shared-module/ipaddress/IPv4Address.c new file mode 100644 index 0000000000..f573d9d0a2 --- /dev/null +++ b/shared-module/ipaddress/IPv4Address.c @@ -0,0 +1,39 @@ +/* + * 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 "py/obj.h" + +#include "shared-bindings/ipaddress/__init__.h" +#include "shared-bindings/ipaddress/IPv4Address.h" + + +void common_hal_ipaddress_ipv4address_construct(ipaddress_ipv4address_obj_t* self, uint8_t* buf, size_t len) { + self->ip_bytes = mp_obj_new_bytes(buf, len); +} + +mp_obj_t common_hal_ipaddress_ipv4address_get_packed(ipaddress_ipv4address_obj_t* self) { + return self->ip_bytes; +} diff --git a/shared-module/ipaddress/IPv4Address.h b/shared-module/ipaddress/IPv4Address.h new file mode 100644 index 0000000000..3f2bde0911 --- /dev/null +++ b/shared-module/ipaddress/IPv4Address.h @@ -0,0 +1,37 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_MODULE_IPADDRESS_IPV4ADDRESS_H +#define MICROPY_INCLUDED_SHARED_MODULE_IPADDRESS_IPV4ADDRESS_H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + mp_obj_t ip_bytes; +} ipaddress_ipv4address_obj_t; + +#endif // MICROPY_INCLUDED_SHARED_MODULE_IPADDRESS_IPV4ADDRESS_H diff --git a/shared-module/ipaddress/__init__.c b/shared-module/ipaddress/__init__.c new file mode 100644 index 0000000000..e5d857d5dd --- /dev/null +++ b/shared-module/ipaddress/__init__.c @@ -0,0 +1,35 @@ +/* + * 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 "shared-bindings/ipaddress/__init__.h" +#include "shared-bindings/ipaddress/IPv4Address.h" + +mp_obj_t common_hal_ipaddress_new_ipv4address(mp_int_t value) { + ipaddress_ipv4address_obj_t* self = m_new_obj(ipaddress_ipv4address_obj_t); + self->base.type = &ipaddress_ipv4address_type; + common_hal_ipaddress_ipv4address_construct(self, (uint8_t*) &value, 4); + return self; +} diff --git a/shared-module/ipaddress/__init__.h b/shared-module/ipaddress/__init__.h new file mode 100644 index 0000000000..7d5f2c2207 --- /dev/null +++ b/shared-module/ipaddress/__init__.h @@ -0,0 +1,36 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_MODULE_IPADDRESS___INIT___H +#define MICROPY_INCLUDED_SHARED_MODULE_IPADDRESS___INIT___H + +#include + +#include "py/obj.h" + +mp_obj_t common_hal_ipaddress_new_ipv4(uint32_t value); + +#endif // MICROPY_INCLUDED_SHARED_MODULE_IPADDRESS___INIT___H From cdab5e793e9663132f18a9de2b82ae8457e2681b Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 5 Aug 2020 13:31:35 -0700 Subject: [PATCH 0651/1293] Update to latest idf --- ports/esp32s2/Makefile | 4 +++- ports/esp32s2/esp-idf | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index e14a737b7c..23a97a6fec 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -128,6 +128,7 @@ LDFLAGS += -L$(BUILD)/esp-idf/esp-idf/esp32s2 \ -Tesp32s2.peripherals.ld \ -Lesp-idf/components/esp_rom/esp32s2/ld \ -Tesp32s2.rom.ld \ + -Tesp32s2.rom.api.ld \ -Tesp32s2.rom.libgcc.ld \ -Tesp32s2.rom.newlib-data.ld \ -Tesp32s2.rom.newlib-funcs.ld \ @@ -248,7 +249,7 @@ menuconfig: $(BUILD)/esp-idf/config $(HEADER_BUILD)/qstr.i.last: | $(BUILD)/esp-idf/config/sdkconfig.h # Order here matters -ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip +ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip esp_rom ESP_IDF_COMPONENTS_INCLUDE = driver freertos log soc @@ -279,6 +280,7 @@ esp-idf-stamp: $(BUILD)/esp-idf/config/sdkconfig.h esp-idf/esp32s2/ld/esp32s2.project.ld \ esp-idf/esp_event/libesp_event.a \ esp-idf/esp_netif/libesp_netif.a \ + esp-idf/esp_rom/libesp_rom.a \ esp-idf/esp_system/libesp_system.a \ esp-idf/esp_wifi/libesp_wifi.a \ esp-idf/lwip/liblwip.a \ diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index e15ce11ebc..7391805502 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit e15ce11ebca15a1f6eca22779e89f761b1fc2142 +Subproject commit 739180550254d4d68335cd3b443ada8909905bac From c53a72d3f5ed1f556637ebc3eca2ad27e8eb9fff Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 6 Aug 2020 16:15:35 -0700 Subject: [PATCH 0652/1293] Fix ipaddress import and parse ipv4 strings --- py/circuitpy_mpconfig.h | 1 + shared-bindings/ipaddress/__init__.c | 29 +++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 8ff2ddc67d..f2789ee587 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -741,6 +741,7 @@ extern const struct _mp_obj_module_t wifi_module; GAMEPADSHIFT_MODULE \ GNSS_MODULE \ I2CPERIPHERAL_MODULE \ + IPADDRESS_MODULE \ JSON_MODULE \ MATH_MODULE \ _EVE_MODULE \ diff --git a/shared-bindings/ipaddress/__init__.c b/shared-bindings/ipaddress/__init__.c index f9427ab847..b88b3afbb9 100644 --- a/shared-bindings/ipaddress/__init__.c +++ b/shared-bindings/ipaddress/__init__.c @@ -25,6 +25,8 @@ */ #include "py/objexcept.h" +#include "py/objstr.h" +#include "py/parsenum.h" #include "py/runtime.h" #include "shared-bindings/ipaddress/__init__.h" #include "shared-bindings/ipaddress/IPv4Address.h" @@ -42,7 +44,32 @@ STATIC mp_obj_t ipaddress_ip_address(mp_obj_t ip_in) { mp_int_t value; - if (!mp_obj_get_int_maybe(ip_in, &value)) { + if (mp_obj_get_int_maybe(ip_in, &value)) { + // We're done. + } else if (MP_OBJ_IS_STR(ip_in)) { + GET_STR_DATA_LEN(ip_in, str_data, str_len); + size_t period_count = 0; + size_t period_index[4] = {0, 0, 0, str_len}; + for (size_t i = 0; i < str_len; i++) { + if (str_data[i] == '.') { + if (period_count < 3) { + period_index[period_count] = i; + } + period_count++; + } + } + if (period_count > 3) { + mp_raise_ValueError(translate("Not a valid IP string.")); + } + + size_t last_period = 0; + for (size_t i = 0; i < 4; i++) { + mp_obj_t octet = mp_parse_num_integer((const char*) str_data + last_period, period_index[i] - last_period, 10, NULL); + last_period = period_index[i] + 1; + value |= MP_OBJ_SMALL_INT_VALUE(octet) << (24 - i * 8); + + } + } else { mp_raise_ValueError(translate("Only raw int supported for ip.")); } From 3860991111511a9e4a60ea24f208b8de8f801ce7 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 10 Aug 2020 17:56:49 -0700 Subject: [PATCH 0653/1293] Ping work and start to add socketpool --- ports/esp32s2/Makefile | 4 + ports/esp32s2/common-hal/wifi/Radio.c | 29 +- ports/esp32s2/esp-idf | 2 +- py/circuitpy_defns.mk | 3 + py/circuitpy_mpconfig.h | 9 + py/circuitpy_mpconfig.mk | 3 + shared-bindings/socketpool/__init__.c | 603 ++++++++++++++++++++++++++ shared-bindings/wifi/Radio.c | 27 +- shared-bindings/wifi/Radio.h | 2 +- shared-module/ipaddress/__init__.c | 5 + shared-module/ipaddress/__init__.h | 4 + 11 files changed, 680 insertions(+), 11 deletions(-) create mode 100644 shared-bindings/socketpool/__init__.c diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 23a97a6fec..ab470d095c 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -85,6 +85,10 @@ INC += -Iesp-idf/components/esp_rom/include INC += -Iesp-idf/components/esp_wifi/include INC += -Iesp-idf/components/xtensa/include INC += -Iesp-idf/components/esp_timer/include +INC += -Iesp-idf/components/newlib/platform_include +INC += -Iesp-idf/components/lwip/lwip/src/include +INC += -Iesp-idf/components/lwip/port/esp32/include +INC += -Iesp-idf/components/lwip/include/apps/sntp INC += -Iesp-idf/components/soc/include INC += -Iesp-idf/components/soc/src/esp32s2/include INC += -Iesp-idf/components/soc/soc/include diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index 623ba9e345..49ad0592e7 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -32,8 +32,10 @@ #include "py/runtime.h" #include "shared-bindings/ipaddress/IPv4Address.h" #include "shared-bindings/wifi/ScannedNetworks.h" +#include "shared-module/ipaddress/__init__.h" #include "esp-idf/components/esp_wifi/include/esp_wifi.h" +#include "esp-idf/components/lwip/include/apps/ping/ping_sock.h" #include "esp_log.h" static const char *TAG = "cp radio"; @@ -154,6 +156,29 @@ mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self) { return common_hal_ipaddress_new_ipv4address(ip_info.ip.addr); } -mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address) { - return 0; +mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address, mp_float_t timeout) { + esp_ping_config_t ping_config = ESP_PING_DEFAULT_CONFIG(); + ipaddress_ipaddress_to_esp_idf(ip_address, &ping_config.target_addr); + ping_config.count = 1; + + size_t timeout_ms = timeout * 1000; + + esp_ping_handle_t ping; + esp_ping_new_session(&ping_config, NULL, &ping); + esp_ping_start(ping); + + uint32_t received = 0; + uint32_t total_time_ms = 0; + while (received == 0 && total_time_ms < timeout_ms) { + RUN_BACKGROUND_TASKS; + esp_ping_get_profile(ping, ESP_PING_PROF_DURATION, &total_time_ms, sizeof(total_time_ms)); + esp_ping_get_profile(ping, ESP_PING_PROF_REPLY, &received, sizeof(received)); + } + uint32_t elapsed_time = 0xffffffff; + if (received > 0) { + esp_ping_get_profile(ping, ESP_PING_PROF_TIMEGAP, &elapsed_time, sizeof(elapsed_time)); + } + esp_ping_delete_session(ping); + + return elapsed_time; } diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index 7391805502..01c86ed7d6 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit 739180550254d4d68335cd3b443ada8909905bac +Subproject commit 01c86ed7d6f4bbbaeda0c461c5f20e3d9872b44b diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 1a5145c8ba..c1b293b94e 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -228,6 +228,9 @@ endif ifeq ($(CIRCUITPY_SHARPDISPLAY),1) SRC_PATTERNS += sharpdisplay/% endif +ifeq ($(CIRCUITPY_SOCKETPOOL),1) +SRC_PATTERNS += socketpool/% +endif ifeq ($(CIRCUITPY_STAGE),1) SRC_PATTERNS += _stage/% endif diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index f2789ee587..846328dcdf 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -573,6 +573,7 @@ extern const struct _mp_obj_module_t sdioio_module; #define SDIOIO_MODULE #endif + #if CIRCUITPY_SHARPDISPLAY extern const struct _mp_obj_module_t sharpdisplay_module; #define SHARPDISPLAY_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_sharpdisplay),(mp_obj_t)&sharpdisplay_module }, @@ -580,6 +581,13 @@ extern const struct _mp_obj_module_t sharpdisplay_module; #define SHARPDISPLAY_MODULE #endif +#if CIRCUITPY_SOCKETPOOL +extern const struct _mp_obj_module_t socketpool_module; +#define SOCKETPOOL_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_socketpool), (mp_obj_t)&socketpool_module }, +#else +#define SOCKETPOOL_MODULE +#endif + #if CIRCUITPY_STAGE extern const struct _mp_obj_module_t stage_module; #define STAGE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__stage), (mp_obj_t)&stage_module }, @@ -764,6 +772,7 @@ extern const struct _mp_obj_module_t wifi_module; SDCARDIO_MODULE \ SDIOIO_MODULE \ SHARPDISPLAY_MODULE \ + SOCKETPOOL_MODULE \ STAGE_MODULE \ STORAGE_MODULE \ STRUCT_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 499e87aed0..2ef8feb3ab 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -185,6 +185,9 @@ CFLAGS += -DCIRCUITPY_SDIOIO=$(CIRCUITPY_SDIOIO) CIRCUITPY_SHARPDISPLAY ?= $(CIRCUITPY_FRAMEBUFFERIO) CFLAGS += -DCIRCUITPY_SHARPDISPLAY=$(CIRCUITPY_SHARPDISPLAY) +CIRCUITPY_SOCKETPOOL ?= 0 +CFLAGS += -DCIRCUITPY_SOCKETPOOL=$(CIRCUITPY_SOCKETPOOL) + # Currently always off. CIRCUITPY_STAGE ?= 0 CFLAGS += -DCIRCUITPY_STAGE=$(CIRCUITPY_STAGE) diff --git a/shared-bindings/socketpool/__init__.c b/shared-bindings/socketpool/__init__.c new file mode 100644 index 0000000000..53ac57d11a --- /dev/null +++ b/shared-bindings/socketpool/__init__.c @@ -0,0 +1,603 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2014 Damien P. George + * 2018 Nick Moore 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 "py/objtuple.h" +#include "py/objlist.h" +#include "py/runtime.h" +#include "py/stream.h" +#include "py/mperrno.h" +#include "lib/netutils/netutils.h" + +#include "shared-module/network/__init__.h" + +//| """TCP, UDP and RAW socket support +//| +//| .. warning:: This module is disabled in 6.x and will removed in 7.x. Please use networking +//| libraries instead. (Native networking will provide a socket compatible class.) +//| +//| Create TCP, UDP and RAW sockets for communicating over the Internet.""" +//| + +STATIC const mp_obj_type_t socket_type; + +//| class socket: +//| +//| def __init__(self, family: int, type: int, proto: int) -> None: +//| """Create a new socket +//| +//| :param ~int family: AF_INET or AF_INET6 +//| :param ~int type: SOCK_STREAM, SOCK_DGRAM or SOCK_RAW +//| :param ~int proto: IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW (ignored)""" +//| ... +//| + +STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { + mp_arg_check_num(n_args, kw_args, 0, 4, false); + + // create socket object (not bound to any NIC yet) + mod_network_socket_obj_t *s = m_new_obj_with_finaliser(mod_network_socket_obj_t); + s->base.type = &socket_type; + s->nic = MP_OBJ_NULL; + s->nic_type = NULL; + s->u_param.domain = MOD_NETWORK_AF_INET; + s->u_param.type = MOD_NETWORK_SOCK_STREAM; + s->u_param.fileno = -1; + if (n_args >= 1) { + s->u_param.domain = mp_obj_get_int(args[0]); + if (n_args >= 2) { + s->u_param.type = mp_obj_get_int(args[1]); + if (n_args >= 4) { + s->u_param.fileno = mp_obj_get_int(args[3]); + } + } + } + + return MP_OBJ_FROM_PTR(s); +} + +STATIC void socket_select_nic(mod_network_socket_obj_t *self, const byte *ip) { + if (self->nic == MP_OBJ_NULL) { + // select NIC based on IP + self->nic = network_module_find_nic(ip); + self->nic_type = (mod_network_nic_type_t*)mp_obj_get_type(self->nic); + + // call the NIC to open the socket + int _errno; + if (self->nic_type->socket(self, &_errno) != 0) { + mp_raise_OSError(_errno); + } + } +} + +//| def bind(self, address: tuple) -> None: +//| """Bind a socket to an address +//| +//| :param ~tuple address: tuple of (remote_address, remote_port)""" +//| ... +//| + +STATIC mp_obj_t socket_bind(mp_obj_t self_in, mp_obj_t addr_in) { + mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + + // get address + uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; + mp_uint_t port = netutils_parse_inet_addr(addr_in, ip, NETUTILS_BIG); + + // check if we need to select a NIC + socket_select_nic(self, ip); + + // call the NIC to bind the socket + int _errno; + if (self->nic_type->bind(self, ip, port, &_errno) != 0) { + mp_raise_OSError(_errno); + } + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_bind_obj, socket_bind); + +//| def listen(self, backlog: int) -> None: +//| """Set socket to listen for incoming connections +//| +//| :param ~int backlog: length of backlog queue for waiting connetions""" +//| ... +//| + +STATIC mp_obj_t socket_listen(mp_obj_t self_in, mp_obj_t backlog) { + mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + + if (self->nic == MP_OBJ_NULL) { + // not connected + // TODO I think we can listen even if not bound... + mp_raise_OSError(MP_ENOTCONN); + } + + int _errno; + if (self->nic_type->listen(self, mp_obj_get_int(backlog), &_errno) != 0) { + mp_raise_OSError(_errno); + } + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_listen_obj, socket_listen); + +//| def accept(self) -> tuple: +//| """Accept a connection on a listening socket of type SOCK_STREAM, +//| creating a new socket of type SOCK_STREAM. +//| Returns a tuple of (new_socket, remote_address)""" +//| + +STATIC mp_obj_t socket_accept(mp_obj_t self_in) { + mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + + // create new socket object + // starts with empty NIC so that finaliser doesn't run close() method if accept() fails + mod_network_socket_obj_t *socket2 = m_new_obj_with_finaliser(mod_network_socket_obj_t); + socket2->base.type = &socket_type; + socket2->nic = MP_OBJ_NULL; + socket2->nic_type = NULL; + + // accept incoming connection + uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; + mp_uint_t port; + int _errno; + if (self->nic_type->accept(self, socket2, ip, &port, &_errno) != 0) { + mp_raise_OSError(_errno); + } + + // new socket has valid state, so set the NIC to the same as parent + socket2->nic = self->nic; + socket2->nic_type = self->nic_type; + + // make the return value + mp_obj_tuple_t *client = MP_OBJ_TO_PTR(mp_obj_new_tuple(2, NULL)); + client->items[0] = MP_OBJ_FROM_PTR(socket2); + client->items[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG); + + return MP_OBJ_FROM_PTR(client); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(socket_accept_obj, socket_accept); + +//| def connect(self, address: tuple) -> None: +//| """Connect a socket to a remote address +//| +//| :param ~tuple address: tuple of (remote_address, remote_port)""" +//| ... +//| + +STATIC mp_obj_t socket_connect(mp_obj_t self_in, mp_obj_t addr_in) { + mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + + // get address + uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; + mp_uint_t port = netutils_parse_inet_addr(addr_in, ip, NETUTILS_BIG); + + // check if we need to select a NIC + socket_select_nic(self, ip); + + // call the NIC to connect the socket + int _errno; + if (self->nic_type->connect(self, ip, port, &_errno) != 0) { + mp_raise_OSError(_errno); + } + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_connect_obj, socket_connect); + +//| def send(self, bytes: ReadableBuffer) -> int: +//| """Send some bytes to the connected remote address. +//| Suits sockets of type SOCK_STREAM +//| +//| :param ~bytes bytes: some bytes to send""" +//| ... +//| + +STATIC mp_obj_t socket_send(mp_obj_t self_in, mp_obj_t buf_in) { + mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + if (self->nic == MP_OBJ_NULL) { + // not connected + mp_raise_OSError(MP_EPIPE); + } + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); + int _errno; + mp_int_t ret = self->nic_type->send(self, bufinfo.buf, bufinfo.len, &_errno); + if (ret == -1) { + mp_raise_OSError(_errno); + } + return mp_obj_new_int_from_uint(ret); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_send_obj, socket_send); + + +// helper function for socket_recv and socket_recv_into to handle common operations of both +STATIC mp_int_t _socket_recv_into(mod_network_socket_obj_t *sock, byte *buf, mp_int_t len) { + int _errno; + mp_int_t ret = sock->nic_type->recv(sock, buf, len, &_errno); + if (ret == -1) { + mp_raise_OSError(_errno); + } + return ret; +} + + +//| def recv_into(self, buffer: WriteableBuffer, bufsize: int) -> int: +//| """Reads some bytes from the connected remote address, writing +//| into the provided buffer. If bufsize <= len(buffer) is given, +//| a maximum of bufsize bytes will be read into the buffer. If no +//| valid value is given for bufsize, the default is the length of +//| the given buffer. +//| +//| Suits sockets of type SOCK_STREAM +//| Returns an int of number of bytes read. +//| +//| :param bytearray buffer: buffer to receive into +//| :param int bufsize: optionally, a maximum number of bytes to read.""" +//| ... +//| + +STATIC mp_obj_t socket_recv_into(size_t n_args, const mp_obj_t *args) { + mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(args[0]); + if (self->nic == MP_OBJ_NULL) { + // not connected + mp_raise_OSError(MP_ENOTCONN); + } + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_WRITE); + mp_int_t len = bufinfo.len; + if (n_args == 3) { + mp_int_t given_len = mp_obj_get_int(args[2]); + if (given_len < len) { + len = given_len; + } + } + + mp_int_t ret = _socket_recv_into(self, (byte*)bufinfo.buf, len); + return mp_obj_new_int_from_uint(ret); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_recv_into_obj, 2, 3, socket_recv_into); + +//| def recv(self, bufsize: int) -> bytes: +//| """Reads some bytes from the connected remote address. +//| Suits sockets of type SOCK_STREAM +//| Returns a bytes() of length <= bufsize +//| +//| :param ~int bufsize: maximum number of bytes to receive""" +//| ... +//| + +STATIC mp_obj_t socket_recv(mp_obj_t self_in, mp_obj_t len_in) { + mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + if (self->nic == MP_OBJ_NULL) { + // not connected + mp_raise_OSError(MP_ENOTCONN); + } + mp_int_t len = mp_obj_get_int(len_in); + vstr_t vstr; + vstr_init_len(&vstr, len); + mp_int_t ret = _socket_recv_into(self, (byte*)vstr.buf, len); + if (ret == 0) { + return mp_const_empty_bytes; + } + vstr.len = ret; + return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_recv_obj, socket_recv); + +//| def sendto(self, bytes: ReadableBuffer, address: tuple) -> int: +//| """Send some bytes to a specific address. +//| Suits sockets of type SOCK_DGRAM +//| +//| :param ~bytes bytes: some bytes to send +//| :param ~tuple address: tuple of (remote_address, remote_port)""" +//| ... +//| + +STATIC mp_obj_t socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_obj_t addr_in) { + mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + + // get the data + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(data_in, &bufinfo, MP_BUFFER_READ); + + // get address + uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; + mp_uint_t port = netutils_parse_inet_addr(addr_in, ip, NETUTILS_BIG); + + // check if we need to select a NIC + socket_select_nic(self, ip); + + // call the NIC to sendto + int _errno; + mp_int_t ret = self->nic_type->sendto(self, bufinfo.buf, bufinfo.len, ip, port, &_errno); + if (ret == -1) { + mp_raise_OSError(_errno); + } + + return mp_obj_new_int(ret); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_3(socket_sendto_obj, socket_sendto); + +//| def recvfrom(self, bufsize: int) -> Tuple[bytes, tuple]: +//| """Reads some bytes from the connected remote address. +//| Suits sockets of type SOCK_STREAM +//| +//| Returns a tuple containing +//| * a bytes() of length <= bufsize +//| * a remote_address, which is a tuple of ip address and port number +//| +//| :param ~int bufsize: maximum number of bytes to receive""" +//| ... +//| + +STATIC mp_obj_t socket_recvfrom(mp_obj_t self_in, mp_obj_t len_in) { + mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + if (self->nic == MP_OBJ_NULL) { + // not connected + mp_raise_OSError(MP_ENOTCONN); + } + vstr_t vstr; + vstr_init_len(&vstr, mp_obj_get_int(len_in)); + byte ip[4]; + mp_uint_t port; + int _errno; + mp_int_t ret = self->nic_type->recvfrom(self, (byte*)vstr.buf, vstr.len, ip, &port, &_errno); + if (ret == -1) { + mp_raise_OSError(_errno); + } + mp_obj_t tuple[2]; + if (ret == 0) { + tuple[0] = mp_const_empty_bytes; + } else { + vstr.len = ret; + tuple[0] = mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); + } + tuple[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG); + return mp_obj_new_tuple(2, tuple); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_recvfrom_obj, socket_recvfrom); + +//| def setsockopt(self, level: int, optname: int, value: int) -> None: +//| """Sets socket options""" +//| ... +//| + +STATIC mp_obj_t socket_setsockopt(size_t n_args, const mp_obj_t *args) { + mod_network_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]); + + 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; + 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(socket_setsockopt_obj, 4, 4, socket_setsockopt); + +//| def settimeout(self, value: int) -> None: +//| """Set the timeout value for this socket. +//| +//| :param ~int value: timeout in seconds. 0 means non-blocking. None means block indefinitely.""" +//| ... +//| + +STATIC mp_obj_t socket_settimeout(mp_obj_t self_in, mp_obj_t timeout_in) { + mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + if (self->nic == MP_OBJ_NULL) { + // not connected + mp_raise_OSError(MP_ENOTCONN); + } + mp_uint_t timeout; + if (timeout_in == mp_const_none) { + timeout = -1; + } else { + #if MICROPY_PY_BUILTINS_FLOAT + timeout = 1000 * mp_obj_get_float(timeout_in); + #else + timeout = 1000 * mp_obj_get_int(timeout_in); + #endif + } + int _errno; + if (self->nic_type->settimeout(self, timeout, &_errno) != 0) { + mp_raise_OSError(_errno); + } + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_settimeout_obj, socket_settimeout); + +//| def setblocking(self, flag: bool) -> Optional[int]: +//| """Set the blocking behaviour of this socket. +//| +//| :param ~bool flag: False means non-blocking, True means block indefinitely.""" +//| ... +//| + +// method socket.setblocking(flag) +STATIC mp_obj_t socket_setblocking(mp_obj_t self_in, mp_obj_t blocking) { + if (mp_obj_is_true(blocking)) { + return socket_settimeout(self_in, mp_const_none); + } else { + return socket_settimeout(self_in, MP_OBJ_NEW_SMALL_INT(0)); + } +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_setblocking_obj, socket_setblocking); + +STATIC const mp_rom_map_elem_t socket_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mp_stream_close_obj) }, + { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&mp_stream_close_obj) }, + { MP_ROM_QSTR(MP_QSTR_bind), MP_ROM_PTR(&socket_bind_obj) }, + { MP_ROM_QSTR(MP_QSTR_listen), MP_ROM_PTR(&socket_listen_obj) }, + { MP_ROM_QSTR(MP_QSTR_accept), MP_ROM_PTR(&socket_accept_obj) }, + { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&socket_connect_obj) }, + { MP_ROM_QSTR(MP_QSTR_send), MP_ROM_PTR(&socket_send_obj) }, + { MP_ROM_QSTR(MP_QSTR_recv), MP_ROM_PTR(&socket_recv_obj) }, + { MP_ROM_QSTR(MP_QSTR_sendto), MP_ROM_PTR(&socket_sendto_obj) }, + { MP_ROM_QSTR(MP_QSTR_recvfrom), MP_ROM_PTR(&socket_recvfrom_obj) }, + { MP_ROM_QSTR(MP_QSTR_recv_into), MP_ROM_PTR(&socket_recv_into_obj) }, + { MP_ROM_QSTR(MP_QSTR_setsockopt), MP_ROM_PTR(&socket_setsockopt_obj) }, + { MP_ROM_QSTR(MP_QSTR_settimeout), MP_ROM_PTR(&socket_settimeout_obj) }, + { MP_ROM_QSTR(MP_QSTR_setblocking), MP_ROM_PTR(&socket_setblocking_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(socket_locals_dict, socket_locals_dict_table); + +mp_uint_t socket_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_t arg, int *errcode) { + mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + if (request == MP_STREAM_CLOSE) { + if (self->nic != MP_OBJ_NULL) { + self->nic_type->close(self); + self->nic = MP_OBJ_NULL; + } + return 0; + } + return self->nic_type->ioctl(self, request, arg, errcode); +} + +STATIC const mp_stream_p_t socket_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) + .ioctl = socket_ioctl, + .is_text = false, +}; + +STATIC const mp_obj_type_t socket_type = { + { &mp_type_type }, + .name = MP_QSTR_socket, + .make_new = socket_make_new, + .protocol = &socket_stream_p, + .locals_dict = (mp_obj_dict_t*)&socket_locals_dict, +}; + +//| def getaddrinfo(host: str, port: int) -> tuple: +//| """Gets the address information for a hostname and port +//| +//| Returns the appropriate family, socket type, socket protocol and +//| address information to call socket.socket() and socket.connect() with, +//| as a tuple.""" +//| ... +//| + +STATIC mp_obj_t socket_getaddrinfo(mp_obj_t host_in, mp_obj_t port_in) { + size_t hlen; + const char *host = mp_obj_str_get_data(host_in, &hlen); + mp_int_t port = mp_obj_get_int(port_in); + uint8_t out_ip[MOD_NETWORK_IPADDR_BUF_SIZE]; + bool have_ip = false; + + if (hlen > 0) { + // check if host is already in IP form + nlr_buf_t nlr; + if (nlr_push(&nlr) == 0) { + netutils_parse_ipv4_addr(host_in, out_ip, NETUTILS_BIG); + have_ip = true; + nlr_pop(); + } else { + // swallow exception: host was not in IP form so need to do DNS lookup + } + } + + if (!have_ip) { + // find a NIC that can do a name lookup + for (mp_uint_t i = 0; i < MP_STATE_PORT(mod_network_nic_list).len; i++) { + mp_obj_t nic = MP_STATE_PORT(mod_network_nic_list).items[i]; + mod_network_nic_type_t *nic_type = (mod_network_nic_type_t*)mp_obj_get_type(nic); + if (nic_type->gethostbyname != NULL) { + int ret = nic_type->gethostbyname(nic, host, hlen, out_ip); + if (ret != 0) { + mp_raise_OSError(ret); + } + have_ip = true; + break; + } + } + } + + if (!have_ip) { + nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, translate("no available NIC"))); + } + + mp_obj_tuple_t *tuple = MP_OBJ_TO_PTR(mp_obj_new_tuple(5, NULL)); + tuple->items[0] = MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_AF_INET); + tuple->items[1] = MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_STREAM); + tuple->items[2] = MP_OBJ_NEW_SMALL_INT(0); + tuple->items[3] = MP_OBJ_NEW_QSTR(MP_QSTR_); + tuple->items[4] = netutils_format_inet_addr(out_ip, port, NETUTILS_BIG); + return mp_obj_new_list(1, (mp_obj_t*)&tuple); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_getaddrinfo_obj, socket_getaddrinfo); + +STATIC const mp_rom_map_elem_t socket_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_usocket) }, + + { MP_ROM_QSTR(MP_QSTR_socket), MP_ROM_PTR(&socket_type) }, + { MP_ROM_QSTR(MP_QSTR_getaddrinfo), MP_ROM_PTR(&socket_getaddrinfo_obj) }, + + // class constants + { MP_ROM_QSTR(MP_QSTR_AF_INET), MP_ROM_INT(MOD_NETWORK_AF_INET) }, + { MP_ROM_QSTR(MP_QSTR_AF_INET6), MP_ROM_INT(MOD_NETWORK_AF_INET6) }, + + { MP_ROM_QSTR(MP_QSTR_SOCK_STREAM), MP_ROM_INT(MOD_NETWORK_SOCK_STREAM) }, + { MP_ROM_QSTR(MP_QSTR_SOCK_DGRAM), MP_ROM_INT(MOD_NETWORK_SOCK_DGRAM) }, + { MP_ROM_QSTR(MP_QSTR_SOCK_RAW), MP_ROM_INT(MOD_NETWORK_SOCK_RAW) }, + + /* + { MP_ROM_QSTR(MP_QSTR_IPPROTO_IP), MP_ROM_INT(MOD_NETWORK_IPPROTO_IP) }, + { MP_ROM_QSTR(MP_QSTR_IPPROTO_ICMP), MP_ROM_INT(MOD_NETWORK_IPPROTO_ICMP) }, + { MP_ROM_QSTR(MP_QSTR_IPPROTO_IPV4), MP_ROM_INT(MOD_NETWORK_IPPROTO_IPV4) }, + { MP_ROM_QSTR(MP_QSTR_IPPROTO_TCP), MP_ROM_INT(MOD_NETWORK_IPPROTO_TCP) }, + { MP_ROM_QSTR(MP_QSTR_IPPROTO_UDP), MP_ROM_INT(MOD_NETWORK_IPPROTO_UDP) }, + { MP_ROM_QSTR(MP_QSTR_IPPROTO_IPV6), MP_ROM_INT(MOD_NETWORK_IPPROTO_IPV6) }, + { MP_ROM_QSTR(MP_QSTR_IPPROTO_RAW), MP_ROM_INT(MOD_NETWORK_IPPROTO_RAW) }, + */ +}; + +STATIC MP_DEFINE_CONST_DICT(socket_globals, socket_globals_table); + +const mp_obj_module_t socket_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&socket_globals, +}; diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 1d14235730..6884b83de0 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -158,18 +158,31 @@ const mp_obj_property_t wifi_radio_ipv4_address_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| def ping(self, ip) -> int: -//| """Ping an IP to test connectivity. Returns echo time in milliseconds.""" +//| def ping(self, ip, *, timeout: float = 0.5) -> float: +//| """Ping an IP to test connectivity. Returns echo time in seconds.""" //| ... //| -STATIC mp_obj_t wifi_radio_ping(mp_obj_t self_in, mp_obj_t ip_address) { - wifi_radio_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t wifi_radio_ping(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_ip, ARG_timeout }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_ip, MP_ARG_REQUIRED | MP_ARG_OBJ, }, + { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, + }; - common_hal_wifi_radio_ping(self, ip_address); + wifi_radio_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + 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); - return mp_const_none; + mp_float_t timeout = 0.5; + if (args[ARG_timeout].u_obj != mp_const_none) { + timeout = mp_obj_get_float(args[ARG_timeout].u_obj); + } + + mp_int_t time_ms = common_hal_wifi_radio_ping(self, args[ARG_ip].u_obj, timeout); + + return mp_obj_new_float(time_ms / 1000); } -STATIC MP_DEFINE_CONST_FUN_OBJ_2(wifi_radio_ping_obj, wifi_radio_ping); +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wifi_radio_ping_obj, 1, wifi_radio_ping); STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_enabled), MP_ROM_PTR(&wifi_radio_enabled_obj) }, diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index 3890885aeb..c83a135a6a 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -47,6 +47,6 @@ extern bool common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t* ssid, extern mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self); -extern mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address); +extern mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address, mp_float_t timeout); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_WIFI_RADIO_H diff --git a/shared-module/ipaddress/__init__.c b/shared-module/ipaddress/__init__.c index e5d857d5dd..031f317aab 100644 --- a/shared-module/ipaddress/__init__.c +++ b/shared-module/ipaddress/__init__.c @@ -33,3 +33,8 @@ mp_obj_t common_hal_ipaddress_new_ipv4address(mp_int_t value) { common_hal_ipaddress_ipv4address_construct(self, (uint8_t*) &value, 4); return self; } + + +void ipaddress_ipaddress_to_esp_idf(mp_obj_t ip_address, ip_addr_t* esp_ip_address) { + // FIX THIS TOMORROW! +} diff --git a/shared-module/ipaddress/__init__.h b/shared-module/ipaddress/__init__.h index 7d5f2c2207..9f1e007779 100644 --- a/shared-module/ipaddress/__init__.h +++ b/shared-module/ipaddress/__init__.h @@ -31,6 +31,10 @@ #include "py/obj.h" +#include "lwip/api.h" + mp_obj_t common_hal_ipaddress_new_ipv4(uint32_t value); +void ipaddress_ipaddress_to_esp_idf(mp_obj_t ip_address, ip_addr_t* esp_ip_address); + #endif // MICROPY_INCLUDED_SHARED_MODULE_IPADDRESS___INIT___H From 7bdd243bf6f3cd84ddfd9cf6f35a2d6d8a6a415f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 11 Aug 2020 14:50:37 -0700 Subject: [PATCH 0654/1293] Ping works! --- ports/esp32s2/common-hal/wifi/Radio.c | 1 + ports/esp32s2/common-hal/wifi/__init__.c | 14 ++++++++++++++ ports/esp32s2/common-hal/wifi/__init__.h | 4 ++++ shared-bindings/ipaddress/IPv4Address.h | 2 +- shared-bindings/ipaddress/__init__.c | 9 +++++---- shared-bindings/ipaddress/__init__.h | 2 +- shared-bindings/wifi/Radio.c | 2 +- shared-module/ipaddress/__init__.c | 7 +------ shared-module/ipaddress/__init__.h | 4 ---- 9 files changed, 28 insertions(+), 17 deletions(-) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index 49ad0592e7..d4f17f2bb0 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -28,6 +28,7 @@ #include +#include "common-hal/wifi/__init__.h" #include "lib/utils/interrupt_char.h" #include "py/runtime.h" #include "shared-bindings/ipaddress/IPv4Address.h" diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index 1dc9ef9a89..eb033256d2 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -24,6 +24,9 @@ * THE SOFTWARE. */ +#include "common-hal/wifi/__init__.h" + +#include "shared-bindings/ipaddress/IPv4Address.h" #include "shared-bindings/wifi/Radio.h" #include "py/runtime.h" @@ -148,3 +151,14 @@ void wifi_reset(void) { radio->netif = NULL; ESP_ERROR_CHECK(esp_netif_deinit()); } + +void ipaddress_ipaddress_to_esp_idf(mp_obj_t ip_address, ip_addr_t* esp_ip_address) { + if (!MP_OBJ_IS_TYPE(ip_address, &ipaddress_ipv4address_type)) { + mp_raise_ValueError(translate("Only IPv4 addresses supported")); + } + mp_obj_t packed = common_hal_ipaddress_ipv4address_get_packed(ip_address); + size_t len; + const char* bytes = mp_obj_str_get_data(packed, &len); + + IP_ADDR4(esp_ip_address, bytes[0], bytes[1], bytes[2], bytes[3]); +} diff --git a/ports/esp32s2/common-hal/wifi/__init__.h b/ports/esp32s2/common-hal/wifi/__init__.h index bb68bcfdf0..d2bd06c570 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.h +++ b/ports/esp32s2/common-hal/wifi/__init__.h @@ -29,6 +29,10 @@ #include "py/obj.h" +#include "lwip/api.h" + void wifi_reset(void); +void ipaddress_ipaddress_to_esp_idf(mp_obj_t ip_address, ip_addr_t* esp_ip_address); + #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI___INIT___H diff --git a/shared-bindings/ipaddress/IPv4Address.h b/shared-bindings/ipaddress/IPv4Address.h index cf66b92b35..b45cf3bacb 100644 --- a/shared-bindings/ipaddress/IPv4Address.h +++ b/shared-bindings/ipaddress/IPv4Address.h @@ -31,7 +31,7 @@ extern const mp_obj_type_t ipaddress_ipv4address_type; -mp_obj_t common_hal_ipaddress_new_ipv4address(mp_int_t value); +mp_obj_t common_hal_ipaddress_new_ipv4address(uint32_t value); void common_hal_ipaddress_ipv4address_construct(ipaddress_ipv4address_obj_t* self, uint8_t* buf, size_t len); mp_obj_t common_hal_ipaddress_ipv4address_get_packed(ipaddress_ipv4address_obj_t* self); diff --git a/shared-bindings/ipaddress/__init__.c b/shared-bindings/ipaddress/__init__.c index b88b3afbb9..1c0ac9153b 100644 --- a/shared-bindings/ipaddress/__init__.c +++ b/shared-bindings/ipaddress/__init__.c @@ -43,8 +43,8 @@ //| STATIC mp_obj_t ipaddress_ip_address(mp_obj_t ip_in) { - mp_int_t value; - if (mp_obj_get_int_maybe(ip_in, &value)) { + uint32_t value; + if (mp_obj_get_int_maybe(ip_in, (mp_int_t*) &value)) { // We're done. } else if (MP_OBJ_IS_STR(ip_in)) { GET_STR_DATA_LEN(ip_in, str_data, str_len); @@ -63,11 +63,12 @@ STATIC mp_obj_t ipaddress_ip_address(mp_obj_t ip_in) { } size_t last_period = 0; + value = 0; for (size_t i = 0; i < 4; i++) { mp_obj_t octet = mp_parse_num_integer((const char*) str_data + last_period, period_index[i] - last_period, 10, NULL); last_period = period_index[i] + 1; - value |= MP_OBJ_SMALL_INT_VALUE(octet) << (24 - i * 8); - + mp_int_t int_octet = MP_OBJ_SMALL_INT_VALUE(octet); + value |= int_octet << (i * 8); } } else { mp_raise_ValueError(translate("Only raw int supported for ip.")); diff --git a/shared-bindings/ipaddress/__init__.h b/shared-bindings/ipaddress/__init__.h index a31629ccae..76d8bfa766 100644 --- a/shared-bindings/ipaddress/__init__.h +++ b/shared-bindings/ipaddress/__init__.h @@ -29,6 +29,6 @@ #include "shared-module/ipaddress/__init__.h" -mp_obj_t common_hal_ipaddress_new_ipv4address(mp_int_t value); +mp_obj_t common_hal_ipaddress_new_ipv4address(uint32_t value); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_IPADDRESS___INIT___H diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 6884b83de0..260a280c2b 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -180,7 +180,7 @@ STATIC mp_obj_t wifi_radio_ping(size_t n_args, const mp_obj_t *pos_args, mp_map_ mp_int_t time_ms = common_hal_wifi_radio_ping(self, args[ARG_ip].u_obj, timeout); - return mp_obj_new_float(time_ms / 1000); + return mp_obj_new_float(time_ms / 1000.0); } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wifi_radio_ping_obj, 1, wifi_radio_ping); diff --git a/shared-module/ipaddress/__init__.c b/shared-module/ipaddress/__init__.c index 031f317aab..2fce9d8f51 100644 --- a/shared-module/ipaddress/__init__.c +++ b/shared-module/ipaddress/__init__.c @@ -27,14 +27,9 @@ #include "shared-bindings/ipaddress/__init__.h" #include "shared-bindings/ipaddress/IPv4Address.h" -mp_obj_t common_hal_ipaddress_new_ipv4address(mp_int_t value) { +mp_obj_t common_hal_ipaddress_new_ipv4address(uint32_t value) { ipaddress_ipv4address_obj_t* self = m_new_obj(ipaddress_ipv4address_obj_t); self->base.type = &ipaddress_ipv4address_type; common_hal_ipaddress_ipv4address_construct(self, (uint8_t*) &value, 4); return self; } - - -void ipaddress_ipaddress_to_esp_idf(mp_obj_t ip_address, ip_addr_t* esp_ip_address) { - // FIX THIS TOMORROW! -} diff --git a/shared-module/ipaddress/__init__.h b/shared-module/ipaddress/__init__.h index 9f1e007779..7d5f2c2207 100644 --- a/shared-module/ipaddress/__init__.h +++ b/shared-module/ipaddress/__init__.h @@ -31,10 +31,6 @@ #include "py/obj.h" -#include "lwip/api.h" - mp_obj_t common_hal_ipaddress_new_ipv4(uint32_t value); -void ipaddress_ipaddress_to_esp_idf(mp_obj_t ip_address, ip_addr_t* esp_ip_address); - #endif // MICROPY_INCLUDED_SHARED_MODULE_IPADDRESS___INIT___H From c9ece21c2846d57f3c32b364be1209d884e388b1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 11 Aug 2020 16:04:55 -0700 Subject: [PATCH 0655/1293] SocketPool stubbed out --- ports/esp32s2/common-hal/socketpool/Socket.c | 25 + ports/esp32s2/common-hal/socketpool/Socket.h | 36 ++ .../common-hal/socketpool/SocketPool.c | 25 + .../common-hal/socketpool/SocketPool.h | 34 + .../esp32s2/common-hal/socketpool/__init__.c | 31 + .../esp32s2/common-hal/socketpool/__init__.h | 31 + py/circuitpy_defns.mk | 3 + py/circuitpy_mpconfig.mk | 2 +- shared-bindings/socketpool/Socket.c | 473 ++++++++++++++ shared-bindings/socketpool/Socket.h | 38 ++ shared-bindings/socketpool/SocketPool.c | 164 +++++ shared-bindings/socketpool/SocketPool.h | 48 ++ shared-bindings/socketpool/__init__.c | 586 +----------------- shared-bindings/socketpool/__init__.h | 34 + 14 files changed, 961 insertions(+), 569 deletions(-) create mode 100644 ports/esp32s2/common-hal/socketpool/Socket.c create mode 100644 ports/esp32s2/common-hal/socketpool/Socket.h create mode 100644 ports/esp32s2/common-hal/socketpool/SocketPool.c create mode 100644 ports/esp32s2/common-hal/socketpool/SocketPool.h create mode 100644 ports/esp32s2/common-hal/socketpool/__init__.c create mode 100644 ports/esp32s2/common-hal/socketpool/__init__.h create mode 100644 shared-bindings/socketpool/Socket.c create mode 100644 shared-bindings/socketpool/Socket.h create mode 100644 shared-bindings/socketpool/SocketPool.c create mode 100644 shared-bindings/socketpool/SocketPool.h create mode 100644 shared-bindings/socketpool/__init__.h diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/esp32s2/common-hal/socketpool/Socket.c new file mode 100644 index 0000000000..fa0e7d5f3f --- /dev/null +++ b/ports/esp32s2/common-hal/socketpool/Socket.c @@ -0,0 +1,25 @@ +/* + * 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. + */ diff --git a/ports/esp32s2/common-hal/socketpool/Socket.h b/ports/esp32s2/common-hal/socketpool/Socket.h new file mode 100644 index 0000000000..4540b6d439 --- /dev/null +++ b/ports/esp32s2/common-hal/socketpool/Socket.h @@ -0,0 +1,36 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL_SOCKET_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL_SOCKET_H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; +} socketpool_socket_obj_t; + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL_SOCKET_H diff --git a/ports/esp32s2/common-hal/socketpool/SocketPool.c b/ports/esp32s2/common-hal/socketpool/SocketPool.c new file mode 100644 index 0000000000..fa0e7d5f3f --- /dev/null +++ b/ports/esp32s2/common-hal/socketpool/SocketPool.c @@ -0,0 +1,25 @@ +/* + * 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. + */ diff --git a/ports/esp32s2/common-hal/socketpool/SocketPool.h b/ports/esp32s2/common-hal/socketpool/SocketPool.h new file mode 100644 index 0000000000..dc46d8958a --- /dev/null +++ b/ports/esp32s2/common-hal/socketpool/SocketPool.h @@ -0,0 +1,34 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL_SOCKETPOOL_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL_SOCKETPOOL_H + +typedef struct { + mp_obj_base_t base; +} socketpool_socketpool_obj_t; + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL_SOCKETPOOL_H diff --git a/ports/esp32s2/common-hal/socketpool/__init__.c b/ports/esp32s2/common-hal/socketpool/__init__.c new file mode 100644 index 0000000000..8f9565b46e --- /dev/null +++ b/ports/esp32s2/common-hal/socketpool/__init__.c @@ -0,0 +1,31 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H + + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H diff --git a/ports/esp32s2/common-hal/socketpool/__init__.h b/ports/esp32s2/common-hal/socketpool/__init__.h new file mode 100644 index 0000000000..8f9565b46e --- /dev/null +++ b/ports/esp32s2/common-hal/socketpool/__init__.h @@ -0,0 +1,31 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H + + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index c1b293b94e..43f6977f0f 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -337,6 +337,9 @@ SRC_COMMON_HAL_ALL = \ rtc/__init__.c \ sdioio/SDCard.c \ sdioio/__init__.c \ + socketpool/__init__.c \ + socketpool/SocketPool.c \ + socketpool/Socket.c \ supervisor/Runtime.c \ supervisor/__init__.c \ watchdog/WatchDogMode.c \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 2ef8feb3ab..35ed6df028 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -185,7 +185,7 @@ CFLAGS += -DCIRCUITPY_SDIOIO=$(CIRCUITPY_SDIOIO) CIRCUITPY_SHARPDISPLAY ?= $(CIRCUITPY_FRAMEBUFFERIO) CFLAGS += -DCIRCUITPY_SHARPDISPLAY=$(CIRCUITPY_SHARPDISPLAY) -CIRCUITPY_SOCKETPOOL ?= 0 +CIRCUITPY_SOCKETPOOL ?= $(CIRCUITPY_WIFI) CFLAGS += -DCIRCUITPY_SOCKETPOOL=$(CIRCUITPY_SOCKETPOOL) # Currently always off. diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c new file mode 100644 index 0000000000..e4d79616a6 --- /dev/null +++ b/shared-bindings/socketpool/Socket.c @@ -0,0 +1,473 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2014 Damien P. George + * 2018 Nick Moore 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/socketpool/Socket.h" + +#include +#include + +#include "lib/utils/context_manager_helpers.h" +#include "py/objtuple.h" +#include "py/objlist.h" +#include "py/runtime.h" +#include "py/mperrno.h" + +//| class Socket: +//| """TCP, UDP and RAW socket. Cannot be created directly. Instead, call +//| `SocketPool.socket()`. +//| +//| Provides a subset of CPython's `socket.socket` API. It only implements the versions of +//| recv that do not allocate bytes objects.""" +//| + +//| def __enter__(self) -> Socket: +//| """No-op used by Context Managers.""" +//| ... +//| +// Provided by context manager helper. + +//| def __exit__(self) -> None: +//| """Automatically closes the Socket when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| +STATIC mp_obj_t socketpool_socket___exit__(size_t n_args, const mp_obj_t *args) { + (void)n_args; + // common_hal_pulseio_pwmout_deinit(args[0]); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket___exit___obj, 4, 4, socketpool_socket___exit__); + +//| def bind(self, address: tuple) -> None: +//| """Bind a socket to an address +//| +//| :param ~tuple address: tuple of (remote_address, remote_port)""" +//| ... +//| + +STATIC mp_obj_t socketpool_socket_bind(mp_obj_t self_in, mp_obj_t addr_in) { + // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + + // // get address + // uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; + // mp_uint_t port = netutils_parse_inet_addr(addr_in, ip, NETUTILS_BIG); + + // // check if we need to select a NIC + // socket_select_nic(self, ip); + + // // call the NIC to bind the socket + // int _errno; + // if (self->nic_type->bind(self, ip, port, &_errno) != 0) { + // mp_raise_OSError(_errno); + // } + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_bind_obj, socketpool_socket_bind); + +//| def listen(self, backlog: int) -> None: +//| """Set socket to listen for incoming connections +//| +//| :param ~int backlog: length of backlog queue for waiting connetions""" +//| ... +//| + +STATIC mp_obj_t socketpool_socket_listen(mp_obj_t self_in, mp_obj_t backlog) { + // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + + // if (self->nic == MP_OBJ_NULL) { + // // not connected + // // TODO I think we can listen even if not bound... + // mp_raise_OSError(MP_ENOTCONN); + // } + + // int _errno; + // if (self->nic_type->listen(self, mp_obj_get_int(backlog), &_errno) != 0) { + // mp_raise_OSError(_errno); + // } + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_listen_obj, socketpool_socket_listen); + +//| def accept(self) -> tuple: +//| """Accept a connection on a listening socket of type SOCK_STREAM, +//| creating a new socket of type SOCK_STREAM. +//| Returns a tuple of (new_socket, remote_address)""" +//| + +STATIC mp_obj_t socketpool_socket_accept(mp_obj_t self_in) { + // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + + // // create new socket object + // // starts with empty NIC so that finaliser doesn't run close() method if accept() fails + // mod_network_socket_obj_t *socket2 = m_new_obj_with_finaliser(mod_network_socket_obj_t); + // socket2->base.type = &socket_type; + // socket2->nic = MP_OBJ_NULL; + // socket2->nic_type = NULL; + + // // accept incoming connection + // uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; + // mp_uint_t port; + // int _errno; + // if (self->nic_type->accept(self, socket2, ip, &port, &_errno) != 0) { + // mp_raise_OSError(_errno); + // } + + // // new socket has valid state, so set the NIC to the same as parent + // socket2->nic = self->nic; + // socket2->nic_type = self->nic_type; + + // // make the return value + // mp_obj_tuple_t *client = MP_OBJ_TO_PTR(mp_obj_new_tuple(2, NULL)); + // client->items[0] = MP_OBJ_FROM_PTR(socket2); + // client->items[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG); + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(socketpool_socket_accept_obj, socketpool_socket_accept); + +//| def close(self) -> None: +//| """Closes this Socket and makes its resources available to its SocketPool.""" +//| +STATIC mp_obj_t socketpool_socket_close(mp_obj_t self_in) { + // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + + // // create new socket object + // // starts with empty NIC so that finaliser doesn't run close() method if accept() fails + // mod_network_socket_obj_t *socket2 = m_new_obj_with_finaliser(mod_network_socket_obj_t); + // socket2->base.type = &socket_type; + // socket2->nic = MP_OBJ_NULL; + // socket2->nic_type = NULL; + + // // accept incoming connection + // uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; + // mp_uint_t port; + // int _errno; + // if (self->nic_type->accept(self, socket2, ip, &port, &_errno) != 0) { + // mp_raise_OSError(_errno); + // } + + // // new socket has valid state, so set the NIC to the same as parent + // socket2->nic = self->nic; + // socket2->nic_type = self->nic_type; + + // // make the return value + // mp_obj_tuple_t *client = MP_OBJ_TO_PTR(mp_obj_new_tuple(2, NULL)); + // client->items[0] = MP_OBJ_FROM_PTR(socket2); + // client->items[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG); + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(socketpool_socket_close_obj, socketpool_socket_close); + +//| def connect(self, address: tuple) -> None: +//| """Connect a socket to a remote address +//| +//| :param ~tuple address: tuple of (remote_address, remote_port)""" +//| ... +//| + +STATIC mp_obj_t socketpool_socket_connect(mp_obj_t self_in, mp_obj_t addr_in) { + // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + + // // get address + // uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; + // mp_uint_t port = netutils_parse_inet_addr(addr_in, ip, NETUTILS_BIG); + + // // check if we need to select a NIC + // socket_select_nic(self, ip); + + // // call the NIC to connect the socket + // int _errno; + // if (self->nic_type->connect(self, ip, port, &_errno) != 0) { + // mp_raise_OSError(_errno); + // } + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_connect_obj, socketpool_socket_connect); + +//| def send(self, bytes: ReadableBuffer) -> int: +//| """Send some bytes to the connected remote address. +//| Suits sockets of type SOCK_STREAM +//| +//| :param ~bytes bytes: some bytes to send""" +//| ... +//| + +STATIC mp_obj_t socketpool_socket_send(mp_obj_t self_in, mp_obj_t buf_in) { + mp_int_t ret = 0; + // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + // if (self->nic == MP_OBJ_NULL) { + // // not connected + // mp_raise_OSError(MP_EPIPE); + // } + // mp_buffer_info_t bufinfo; + // mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); + // int _errno; + // mp_int_t ret = self->nic_type->send(self, bufinfo.buf, bufinfo.len, &_errno); + // if (ret == -1) { + // mp_raise_OSError(_errno); + // } + return mp_obj_new_int_from_uint(ret); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_send_obj, socketpool_socket_send); + + +// helper function for socket_recv and socket_recv_into to handle common operations of both +// STATIC mp_int_t _socket_recv_into(mod_network_socket_obj_t *sock, byte *buf, mp_int_t len) { +// mp_int_t ret = 0; +// // int _errno; +// // mp_int_t ret = sock->nic_type->recv(sock, buf, len, &_errno); +// // if (ret == -1) { +// // mp_raise_OSError(_errno); +// // } +// return ret; +// } + + +//| def recv_into(self, buffer: WriteableBuffer, bufsize: int) -> int: +//| """Reads some bytes from the connected remote address, writing +//| into the provided buffer. If bufsize <= len(buffer) is given, +//| a maximum of bufsize bytes will be read into the buffer. If no +//| valid value is given for bufsize, the default is the length of +//| the given buffer. +//| +//| Suits sockets of type SOCK_STREAM +//| Returns an int of number of bytes read. +//| +//| :param bytearray buffer: buffer to receive into +//| :param int bufsize: optionally, a maximum number of bytes to read.""" +//| ... +//| + +STATIC mp_obj_t socketpool_socket_recv_into(size_t n_args, const mp_obj_t *args) { + // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(args[0]); + // if (self->nic == MP_OBJ_NULL) { + // // not connected + // mp_raise_OSError(MP_ENOTCONN); + // } + // mp_buffer_info_t bufinfo; + // mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_WRITE); + // mp_int_t len = bufinfo.len; + // if (n_args == 3) { + // mp_int_t given_len = mp_obj_get_int(args[2]); + // if (given_len < len) { + // len = given_len; + // } + // } + + // mp_int_t ret = _socket_recv_into(self, (byte*)bufinfo.buf, len); + mp_int_t ret = 0; + return mp_obj_new_int_from_uint(ret); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket_recv_into_obj, 2, 3, socketpool_socket_recv_into); + +//| def sendto(self, bytes: ReadableBuffer, address: tuple) -> int: +//| """Send some bytes to a specific address. +//| Suits sockets of type SOCK_DGRAM +//| +//| :param ~bytes bytes: some bytes to send +//| :param ~tuple address: tuple of (remote_address, remote_port)""" +//| ... +//| + +STATIC mp_obj_t socketpool_socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_obj_t addr_in) { + // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + + // // get the data + // mp_buffer_info_t bufinfo; + // mp_get_buffer_raise(data_in, &bufinfo, MP_BUFFER_READ); + + // // get address + // uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; + // mp_uint_t port = netutils_parse_inet_addr(addr_in, ip, NETUTILS_BIG); + + // // check if we need to select a NIC + // socket_select_nic(self, ip); + + // // call the NIC to sendto + // int _errno; + // mp_int_t ret = self->nic_type->sendto(self, bufinfo.buf, bufinfo.len, ip, port, &_errno); + // if (ret == -1) { + // mp_raise_OSError(_errno); + // } + mp_int_t ret = 0; + + return mp_obj_new_int(ret); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_3(socketpool_socket_sendto_obj, socketpool_socket_sendto); + +//| def recvfrom(self, bufsize: int) -> Tuple[bytes, tuple]: +//| """Reads some bytes from the connected remote address. +//| Suits sockets of type SOCK_STREAM +//| +//| Returns a tuple containing +//| * a bytes() of length <= bufsize +//| * a remote_address, which is a tuple of ip address and port number +//| +//| :param ~int bufsize: maximum number of bytes to receive""" +//| ... +//| + +STATIC mp_obj_t socketpool_socket_recvfrom_into(mp_obj_t self_in, mp_obj_t len_in) { + // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + // if (self->nic == MP_OBJ_NULL) { + // // not connected + // mp_raise_OSError(MP_ENOTCONN); + // } + // vstr_t vstr; + // vstr_init_len(&vstr, mp_obj_get_int(len_in)); + // byte ip[4]; + // mp_uint_t port; + // int _errno; + // mp_int_t ret = self->nic_type->recvfrom(self, (byte*)vstr.buf, vstr.len, ip, &port, &_errno); + // if (ret == -1) { + // mp_raise_OSError(_errno); + // } + mp_obj_t tuple[2]; + // if (ret == 0) { + // tuple[0] = mp_const_empty_bytes; + // } else { + // vstr.len = ret; + // tuple[0] = mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); + // } + // tuple[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG); + return mp_obj_new_tuple(2, tuple); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_recvfrom_into_obj, socketpool_socket_recvfrom_into); + +//| 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]); + + // 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; + // } + + // 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); + +//| def settimeout(self, value: int) -> None: +//| """Set the timeout value for this socket. +//| +//| :param ~int value: timeout in seconds. 0 means non-blocking. None means block indefinitely.""" +//| ... +//| + +STATIC mp_obj_t socketpool_socket_settimeout(mp_obj_t self_in, mp_obj_t timeout_in) { + // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + // if (self->nic == MP_OBJ_NULL) { + // // not connected + // mp_raise_OSError(MP_ENOTCONN); + // } + // mp_uint_t timeout; + // if (timeout_in == mp_const_none) { + // timeout = -1; + // } else { + // #if MICROPY_PY_BUILTINS_FLOAT + // timeout = 1000 * mp_obj_get_float(timeout_in); + // #else + // timeout = 1000 * mp_obj_get_int(timeout_in); + // #endif + // } + // int _errno; + // if (self->nic_type->settimeout(self, timeout, &_errno) != 0) { + // mp_raise_OSError(_errno); + // } + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_settimeout_obj, socketpool_socket_settimeout); + +//| def setblocking(self, flag: bool) -> Optional[int]: +//| """Set the blocking behaviour of this socket. +//| +//| :param ~bool flag: False means non-blocking, True means block indefinitely.""" +//| ... +//| + +// method socket.setblocking(flag) +STATIC mp_obj_t socketpool_socket_setblocking(mp_obj_t self_in, mp_obj_t blocking) { + // if (mp_obj_is_true(blocking)) { + // return socket_settimeout(self_in, mp_const_none); + // } else { + // return socket_settimeout(self_in, MP_OBJ_NEW_SMALL_INT(0)); + // } + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_setblocking_obj, socketpool_socket_setblocking); + +STATIC const mp_rom_map_elem_t socketpool_socket_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&socketpool_socket___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&socketpool_socket_close_obj) }, + { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&socketpool_socket_close_obj) }, + + { MP_ROM_QSTR(MP_QSTR_bind), MP_ROM_PTR(&socketpool_socket_bind_obj) }, + { MP_ROM_QSTR(MP_QSTR_listen), MP_ROM_PTR(&socketpool_socket_listen_obj) }, + { MP_ROM_QSTR(MP_QSTR_accept), MP_ROM_PTR(&socketpool_socket_accept_obj) }, + { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&socketpool_socket_connect_obj) }, + { MP_ROM_QSTR(MP_QSTR_send), MP_ROM_PTR(&socketpool_socket_send_obj) }, + { MP_ROM_QSTR(MP_QSTR_sendto), MP_ROM_PTR(&socketpool_socket_sendto_obj) }, + { MP_ROM_QSTR(MP_QSTR_recvfrom_into), MP_ROM_PTR(&socketpool_socket_recvfrom_into_obj) }, + { MP_ROM_QSTR(MP_QSTR_recv_into), MP_ROM_PTR(&socketpool_socket_recv_into_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) }, + { MP_ROM_QSTR(MP_QSTR_setblocking), MP_ROM_PTR(&socketpool_socket_setblocking_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(socketpool_socket_locals_dict, socketpool_socket_locals_dict_table); + +const mp_obj_type_t socketpool_socket_type = { + { &mp_type_type }, + .name = MP_QSTR_Socket, + .locals_dict = (mp_obj_dict_t*)&socketpool_socket_locals_dict, +}; diff --git a/shared-bindings/socketpool/Socket.h b/shared-bindings/socketpool/Socket.h new file mode 100644 index 0000000000..bbe6227efe --- /dev/null +++ b/shared-bindings/socketpool/Socket.h @@ -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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKET_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKET_H + +#include "common-hal/socketpool/Socket.h" + +extern const mp_obj_type_t socketpool_socket_type; + +// mp_obj_t common_hal_ipaddress_new_ipv4address(uint32_t value); +// void common_hal_ipaddress_ipv4address_construct(ipaddress_ipv4address_obj_t* self, uint8_t* buf, size_t len); +// mp_obj_t common_hal_ipaddress_ipv4address_get_packed(ipaddress_ipv4address_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 new file mode 100644 index 0000000000..ed5ff82750 --- /dev/null +++ b/shared-bindings/socketpool/SocketPool.c @@ -0,0 +1,164 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2014 Damien P. George + * 2018 Nick Moore 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 "py/objtuple.h" +#include "py/objlist.h" +#include "py/runtime.h" +#include "py/mperrno.h" + +#include "shared-bindings/socketpool/Socket.h" +#include "shared-bindings/socketpool/SocketPool.h" + +//| class SocketPool: +//| + +STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { + mp_arg_check_num(n_args, kw_args, 0, 4, false); + + socketpool_socketpool_obj_t *s = m_new_obj_with_finaliser(socketpool_socketpool_obj_t); + s->base.type = &socketpool_socketpool_type; + + return MP_OBJ_FROM_PTR(s); +} + + +//| def socket(self, family: int, type: int, proto: int) -> None: +//| """Create a new socket +//| +//| :param ~int family: AF_INET or AF_INET6 +//| :param ~int type: SOCK_STREAM, SOCK_DGRAM or SOCK_RAW +//| :param ~int proto: IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW (ignored)""" +//| ... +//| +STATIC mp_obj_t socketpool_socketpool_socket(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + mp_arg_check_num(n_args, kw_args, 0, 4, false); + + // create socket object (not bound to any NIC yet) + socketpool_socket_obj_t *s = m_new_obj_with_finaliser(socketpool_socket_obj_t); + s->base.type = &socketpool_socket_type; + // s->nic = MP_OBJ_NULL; + // s->nic_type = NULL; + // s->u_param.domain = MOD_NETWORK_AF_INET; + // s->u_param.type = MOD_NETWORK_SOCK_STREAM; + // s->u_param.fileno = -1; + // if (n_args >= 1) { + // s->u_param.domain = mp_obj_get_int(args[0]); + // if (n_args >= 2) { + // s->u_param.type = mp_obj_get_int(args[1]); + // if (n_args >= 4) { + // s->u_param.fileno = mp_obj_get_int(args[3]); + // } + // } + // } + + return MP_OBJ_FROM_PTR(s); +} +MP_DEFINE_CONST_FUN_OBJ_KW(socketpool_socketpool_socket_obj, 1, socketpool_socketpool_socket); + +//| def getaddrinfo(host: str, port: int) -> tuple: +//| """Gets the address information for a hostname and port +//| +//| Returns the appropriate family, socket type, socket protocol and +//| address information to call socket.socket() and socket.connect() with, +//| as a tuple.""" +//| ... +//| + +STATIC mp_obj_t socketpool_socketpool_getaddrinfo(mp_obj_t host_in, mp_obj_t port_in) { + // size_t hlen; + // const char *host = mp_obj_str_get_data(host_in, &hlen); + // mp_int_t port = mp_obj_get_int(port_in); + // uint8_t out_ip[MOD_NETWORK_IPADDR_BUF_SIZE]; + // bool have_ip = false; + + // if (hlen > 0) { + // // check if host is already in IP form + // nlr_buf_t nlr; + // if (nlr_push(&nlr) == 0) { + // netutils_parse_ipv4_addr(host_in, out_ip, NETUTILS_BIG); + // have_ip = true; + // nlr_pop(); + // } else { + // // swallow exception: host was not in IP form so need to do DNS lookup + // } + // } + + // if (!have_ip) { + // // find a NIC that can do a name lookup + // for (mp_uint_t i = 0; i < MP_STATE_PORT(mod_network_nic_list).len; i++) { + // mp_obj_t nic = MP_STATE_PORT(mod_network_nic_list).items[i]; + // mod_network_nic_type_t *nic_type = (mod_network_nic_type_t*)mp_obj_get_type(nic); + // if (nic_type->gethostbyname != NULL) { + // int ret = nic_type->gethostbyname(nic, host, hlen, out_ip); + // if (ret != 0) { + // mp_raise_OSError(ret); + // } + // have_ip = true; + // break; + // } + // } + // } + + // if (!have_ip) { + // nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, translate("no available NIC"))); + // } + + // mp_obj_tuple_t *tuple = MP_OBJ_TO_PTR(mp_obj_new_tuple(5, NULL)); + // tuple->items[0] = MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_AF_INET); + // tuple->items[1] = MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_STREAM); + // tuple->items[2] = MP_OBJ_NEW_SMALL_INT(0); + // tuple->items[3] = MP_OBJ_NEW_QSTR(MP_QSTR_); + // tuple->items[4] = netutils_format_inet_addr(out_ip, port, NETUTILS_BIG); + // return mp_obj_new_list(1, (mp_obj_t*)&tuple); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socketpool_getaddrinfo_obj, socketpool_socketpool_getaddrinfo); + +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) }, + + // class constants + { MP_ROM_QSTR(MP_QSTR_AF_INET), MP_ROM_INT(SOCKETPOOL_AF_INET) }, + { MP_ROM_QSTR(MP_QSTR_AF_INET6), MP_ROM_INT(SOCKETPOOL_AF_INET6) }, + + { MP_ROM_QSTR(MP_QSTR_SOCK_STREAM), MP_ROM_INT(SOCKETPOOL_SOCK_STREAM) }, + { MP_ROM_QSTR(MP_QSTR_SOCK_DGRAM), MP_ROM_INT(SOCKETPOOL_SOCK_DGRAM) }, + { MP_ROM_QSTR(MP_QSTR_SOCK_RAW), MP_ROM_INT(SOCKETPOOL_SOCK_RAW) }, +}; + +STATIC MP_DEFINE_CONST_DICT(socketpool_socketpool_locals_dict, socketpool_socketpool_locals_dict_table); + +const mp_obj_type_t socketpool_socketpool_type = { + { &mp_type_type }, + .name = MP_QSTR_SocketPool, + .make_new = socketpool_socketpool_make_new, + .locals_dict = (mp_obj_dict_t*)&socketpool_socketpool_locals_dict, +}; diff --git a/shared-bindings/socketpool/SocketPool.h b/shared-bindings/socketpool/SocketPool.h new file mode 100644 index 0000000000..1852cc1680 --- /dev/null +++ b/shared-bindings/socketpool/SocketPool.h @@ -0,0 +1,48 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKETPOOL_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKETPOOL_H + +#include "common-hal/socketpool/SocketPool.h" + +extern const mp_obj_type_t socketpool_socketpool_type; + +// mp_obj_t common_hal_ipaddress_new_ipv4address(uint32_t value); +// void common_hal_ipaddress_ipv4address_construct(ipaddress_ipv4address_obj_t* self, uint8_t* buf, size_t len); +// mp_obj_t common_hal_ipaddress_ipv4address_get_packed(ipaddress_ipv4address_obj_t* self); +typedef enum { + SOCKETPOOL_SOCK_STREAM, + SOCKETPOOL_SOCK_DGRAM, + SOCKETPOOL_SOCK_RAW +} socketpool_socketpool_sock_t; + +typedef enum { + SOCKETPOOL_AF_INET, + SOCKETPOOL_AF_INET6 +} socketpool_socketpool_af_t; + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKETPOOL_H diff --git a/shared-bindings/socketpool/__init__.c b/shared-bindings/socketpool/__init__.c index 53ac57d11a..06d5be5cda 100644 --- a/shared-bindings/socketpool/__init__.c +++ b/shared-bindings/socketpool/__init__.c @@ -3,8 +3,7 @@ * * The MIT License (MIT) * - * SPDX-FileCopyrightText: Copyright (c) 2014 Damien P. George - * 2018 Nick Moore for Adafruit Industries + * 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 @@ -25,579 +24,30 @@ * THE SOFTWARE. */ -#include -#include - -#include "py/objtuple.h" -#include "py/objlist.h" +#include "py/objexcept.h" +#include "py/objstr.h" +#include "py/parsenum.h" #include "py/runtime.h" -#include "py/stream.h" -#include "py/mperrno.h" -#include "lib/netutils/netutils.h" +#include "shared-bindings/socketpool/__init__.h" +#include "shared-bindings/socketpool/Socket.h" +#include "shared-bindings/socketpool/SocketPool.h" -#include "shared-module/network/__init__.h" - -//| """TCP, UDP and RAW socket support -//| -//| .. warning:: This module is disabled in 6.x and will removed in 7.x. Please use networking -//| libraries instead. (Native networking will provide a socket compatible class.) -//| -//| Create TCP, UDP and RAW sockets for communicating over the Internet.""" +//| """ +//| The `ipaddress` module provides types for IP addresses. It is a subset of CPython's ipaddress +//| module. +//| """ //| -STATIC const mp_obj_type_t socket_type; +STATIC const mp_rom_map_elem_t socketpool_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_socketpool) }, -//| class socket: -//| -//| def __init__(self, family: int, type: int, proto: int) -> None: -//| """Create a new socket -//| -//| :param ~int family: AF_INET or AF_INET6 -//| :param ~int type: SOCK_STREAM, SOCK_DGRAM or SOCK_RAW -//| :param ~int proto: IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW (ignored)""" -//| ... -//| - -STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { - mp_arg_check_num(n_args, kw_args, 0, 4, false); - - // create socket object (not bound to any NIC yet) - mod_network_socket_obj_t *s = m_new_obj_with_finaliser(mod_network_socket_obj_t); - s->base.type = &socket_type; - s->nic = MP_OBJ_NULL; - s->nic_type = NULL; - s->u_param.domain = MOD_NETWORK_AF_INET; - s->u_param.type = MOD_NETWORK_SOCK_STREAM; - s->u_param.fileno = -1; - if (n_args >= 1) { - s->u_param.domain = mp_obj_get_int(args[0]); - if (n_args >= 2) { - s->u_param.type = mp_obj_get_int(args[1]); - if (n_args >= 4) { - s->u_param.fileno = mp_obj_get_int(args[3]); - } - } - } - - return MP_OBJ_FROM_PTR(s); -} - -STATIC void socket_select_nic(mod_network_socket_obj_t *self, const byte *ip) { - if (self->nic == MP_OBJ_NULL) { - // select NIC based on IP - self->nic = network_module_find_nic(ip); - self->nic_type = (mod_network_nic_type_t*)mp_obj_get_type(self->nic); - - // call the NIC to open the socket - int _errno; - if (self->nic_type->socket(self, &_errno) != 0) { - mp_raise_OSError(_errno); - } - } -} - -//| def bind(self, address: tuple) -> None: -//| """Bind a socket to an address -//| -//| :param ~tuple address: tuple of (remote_address, remote_port)""" -//| ... -//| - -STATIC mp_obj_t socket_bind(mp_obj_t self_in, mp_obj_t addr_in) { - mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - - // get address - uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; - mp_uint_t port = netutils_parse_inet_addr(addr_in, ip, NETUTILS_BIG); - - // check if we need to select a NIC - socket_select_nic(self, ip); - - // call the NIC to bind the socket - int _errno; - if (self->nic_type->bind(self, ip, port, &_errno) != 0) { - mp_raise_OSError(_errno); - } - - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_bind_obj, socket_bind); - -//| def listen(self, backlog: int) -> None: -//| """Set socket to listen for incoming connections -//| -//| :param ~int backlog: length of backlog queue for waiting connetions""" -//| ... -//| - -STATIC mp_obj_t socket_listen(mp_obj_t self_in, mp_obj_t backlog) { - mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - - if (self->nic == MP_OBJ_NULL) { - // not connected - // TODO I think we can listen even if not bound... - mp_raise_OSError(MP_ENOTCONN); - } - - int _errno; - if (self->nic_type->listen(self, mp_obj_get_int(backlog), &_errno) != 0) { - mp_raise_OSError(_errno); - } - - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_listen_obj, socket_listen); - -//| def accept(self) -> tuple: -//| """Accept a connection on a listening socket of type SOCK_STREAM, -//| creating a new socket of type SOCK_STREAM. -//| Returns a tuple of (new_socket, remote_address)""" -//| - -STATIC mp_obj_t socket_accept(mp_obj_t self_in) { - mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - - // create new socket object - // starts with empty NIC so that finaliser doesn't run close() method if accept() fails - mod_network_socket_obj_t *socket2 = m_new_obj_with_finaliser(mod_network_socket_obj_t); - socket2->base.type = &socket_type; - socket2->nic = MP_OBJ_NULL; - socket2->nic_type = NULL; - - // accept incoming connection - uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; - mp_uint_t port; - int _errno; - if (self->nic_type->accept(self, socket2, ip, &port, &_errno) != 0) { - mp_raise_OSError(_errno); - } - - // new socket has valid state, so set the NIC to the same as parent - socket2->nic = self->nic; - socket2->nic_type = self->nic_type; - - // make the return value - mp_obj_tuple_t *client = MP_OBJ_TO_PTR(mp_obj_new_tuple(2, NULL)); - client->items[0] = MP_OBJ_FROM_PTR(socket2); - client->items[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG); - - return MP_OBJ_FROM_PTR(client); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(socket_accept_obj, socket_accept); - -//| def connect(self, address: tuple) -> None: -//| """Connect a socket to a remote address -//| -//| :param ~tuple address: tuple of (remote_address, remote_port)""" -//| ... -//| - -STATIC mp_obj_t socket_connect(mp_obj_t self_in, mp_obj_t addr_in) { - mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - - // get address - uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; - mp_uint_t port = netutils_parse_inet_addr(addr_in, ip, NETUTILS_BIG); - - // check if we need to select a NIC - socket_select_nic(self, ip); - - // call the NIC to connect the socket - int _errno; - if (self->nic_type->connect(self, ip, port, &_errno) != 0) { - mp_raise_OSError(_errno); - } - - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_connect_obj, socket_connect); - -//| def send(self, bytes: ReadableBuffer) -> int: -//| """Send some bytes to the connected remote address. -//| Suits sockets of type SOCK_STREAM -//| -//| :param ~bytes bytes: some bytes to send""" -//| ... -//| - -STATIC mp_obj_t socket_send(mp_obj_t self_in, mp_obj_t buf_in) { - mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - if (self->nic == MP_OBJ_NULL) { - // not connected - mp_raise_OSError(MP_EPIPE); - } - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); - int _errno; - mp_int_t ret = self->nic_type->send(self, bufinfo.buf, bufinfo.len, &_errno); - if (ret == -1) { - mp_raise_OSError(_errno); - } - return mp_obj_new_int_from_uint(ret); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_send_obj, socket_send); - - -// helper function for socket_recv and socket_recv_into to handle common operations of both -STATIC mp_int_t _socket_recv_into(mod_network_socket_obj_t *sock, byte *buf, mp_int_t len) { - int _errno; - mp_int_t ret = sock->nic_type->recv(sock, buf, len, &_errno); - if (ret == -1) { - mp_raise_OSError(_errno); - } - return ret; -} - - -//| def recv_into(self, buffer: WriteableBuffer, bufsize: int) -> int: -//| """Reads some bytes from the connected remote address, writing -//| into the provided buffer. If bufsize <= len(buffer) is given, -//| a maximum of bufsize bytes will be read into the buffer. If no -//| valid value is given for bufsize, the default is the length of -//| the given buffer. -//| -//| Suits sockets of type SOCK_STREAM -//| Returns an int of number of bytes read. -//| -//| :param bytearray buffer: buffer to receive into -//| :param int bufsize: optionally, a maximum number of bytes to read.""" -//| ... -//| - -STATIC mp_obj_t socket_recv_into(size_t n_args, const mp_obj_t *args) { - mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(args[0]); - if (self->nic == MP_OBJ_NULL) { - // not connected - mp_raise_OSError(MP_ENOTCONN); - } - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_WRITE); - mp_int_t len = bufinfo.len; - if (n_args == 3) { - mp_int_t given_len = mp_obj_get_int(args[2]); - if (given_len < len) { - len = given_len; - } - } - - mp_int_t ret = _socket_recv_into(self, (byte*)bufinfo.buf, len); - return mp_obj_new_int_from_uint(ret); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_recv_into_obj, 2, 3, socket_recv_into); - -//| def recv(self, bufsize: int) -> bytes: -//| """Reads some bytes from the connected remote address. -//| Suits sockets of type SOCK_STREAM -//| Returns a bytes() of length <= bufsize -//| -//| :param ~int bufsize: maximum number of bytes to receive""" -//| ... -//| - -STATIC mp_obj_t socket_recv(mp_obj_t self_in, mp_obj_t len_in) { - mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - if (self->nic == MP_OBJ_NULL) { - // not connected - mp_raise_OSError(MP_ENOTCONN); - } - mp_int_t len = mp_obj_get_int(len_in); - vstr_t vstr; - vstr_init_len(&vstr, len); - mp_int_t ret = _socket_recv_into(self, (byte*)vstr.buf, len); - if (ret == 0) { - return mp_const_empty_bytes; - } - vstr.len = ret; - return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_recv_obj, socket_recv); - -//| def sendto(self, bytes: ReadableBuffer, address: tuple) -> int: -//| """Send some bytes to a specific address. -//| Suits sockets of type SOCK_DGRAM -//| -//| :param ~bytes bytes: some bytes to send -//| :param ~tuple address: tuple of (remote_address, remote_port)""" -//| ... -//| - -STATIC mp_obj_t socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_obj_t addr_in) { - mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - - // get the data - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(data_in, &bufinfo, MP_BUFFER_READ); - - // get address - uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; - mp_uint_t port = netutils_parse_inet_addr(addr_in, ip, NETUTILS_BIG); - - // check if we need to select a NIC - socket_select_nic(self, ip); - - // call the NIC to sendto - int _errno; - mp_int_t ret = self->nic_type->sendto(self, bufinfo.buf, bufinfo.len, ip, port, &_errno); - if (ret == -1) { - mp_raise_OSError(_errno); - } - - return mp_obj_new_int(ret); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_3(socket_sendto_obj, socket_sendto); - -//| def recvfrom(self, bufsize: int) -> Tuple[bytes, tuple]: -//| """Reads some bytes from the connected remote address. -//| Suits sockets of type SOCK_STREAM -//| -//| Returns a tuple containing -//| * a bytes() of length <= bufsize -//| * a remote_address, which is a tuple of ip address and port number -//| -//| :param ~int bufsize: maximum number of bytes to receive""" -//| ... -//| - -STATIC mp_obj_t socket_recvfrom(mp_obj_t self_in, mp_obj_t len_in) { - mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - if (self->nic == MP_OBJ_NULL) { - // not connected - mp_raise_OSError(MP_ENOTCONN); - } - vstr_t vstr; - vstr_init_len(&vstr, mp_obj_get_int(len_in)); - byte ip[4]; - mp_uint_t port; - int _errno; - mp_int_t ret = self->nic_type->recvfrom(self, (byte*)vstr.buf, vstr.len, ip, &port, &_errno); - if (ret == -1) { - mp_raise_OSError(_errno); - } - mp_obj_t tuple[2]; - if (ret == 0) { - tuple[0] = mp_const_empty_bytes; - } else { - vstr.len = ret; - tuple[0] = mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); - } - tuple[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG); - return mp_obj_new_tuple(2, tuple); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_recvfrom_obj, socket_recvfrom); - -//| def setsockopt(self, level: int, optname: int, value: int) -> None: -//| """Sets socket options""" -//| ... -//| - -STATIC mp_obj_t socket_setsockopt(size_t n_args, const mp_obj_t *args) { - mod_network_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]); - - 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; - 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(socket_setsockopt_obj, 4, 4, socket_setsockopt); - -//| def settimeout(self, value: int) -> None: -//| """Set the timeout value for this socket. -//| -//| :param ~int value: timeout in seconds. 0 means non-blocking. None means block indefinitely.""" -//| ... -//| - -STATIC mp_obj_t socket_settimeout(mp_obj_t self_in, mp_obj_t timeout_in) { - mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - if (self->nic == MP_OBJ_NULL) { - // not connected - mp_raise_OSError(MP_ENOTCONN); - } - mp_uint_t timeout; - if (timeout_in == mp_const_none) { - timeout = -1; - } else { - #if MICROPY_PY_BUILTINS_FLOAT - timeout = 1000 * mp_obj_get_float(timeout_in); - #else - timeout = 1000 * mp_obj_get_int(timeout_in); - #endif - } - int _errno; - if (self->nic_type->settimeout(self, timeout, &_errno) != 0) { - mp_raise_OSError(_errno); - } - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_settimeout_obj, socket_settimeout); - -//| def setblocking(self, flag: bool) -> Optional[int]: -//| """Set the blocking behaviour of this socket. -//| -//| :param ~bool flag: False means non-blocking, True means block indefinitely.""" -//| ... -//| - -// method socket.setblocking(flag) -STATIC mp_obj_t socket_setblocking(mp_obj_t self_in, mp_obj_t blocking) { - if (mp_obj_is_true(blocking)) { - return socket_settimeout(self_in, mp_const_none); - } else { - return socket_settimeout(self_in, MP_OBJ_NEW_SMALL_INT(0)); - } -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_setblocking_obj, socket_setblocking); - -STATIC const mp_rom_map_elem_t socket_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mp_stream_close_obj) }, - { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&mp_stream_close_obj) }, - { MP_ROM_QSTR(MP_QSTR_bind), MP_ROM_PTR(&socket_bind_obj) }, - { MP_ROM_QSTR(MP_QSTR_listen), MP_ROM_PTR(&socket_listen_obj) }, - { MP_ROM_QSTR(MP_QSTR_accept), MP_ROM_PTR(&socket_accept_obj) }, - { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&socket_connect_obj) }, - { MP_ROM_QSTR(MP_QSTR_send), MP_ROM_PTR(&socket_send_obj) }, - { MP_ROM_QSTR(MP_QSTR_recv), MP_ROM_PTR(&socket_recv_obj) }, - { MP_ROM_QSTR(MP_QSTR_sendto), MP_ROM_PTR(&socket_sendto_obj) }, - { MP_ROM_QSTR(MP_QSTR_recvfrom), MP_ROM_PTR(&socket_recvfrom_obj) }, - { MP_ROM_QSTR(MP_QSTR_recv_into), MP_ROM_PTR(&socket_recv_into_obj) }, - { MP_ROM_QSTR(MP_QSTR_setsockopt), MP_ROM_PTR(&socket_setsockopt_obj) }, - { MP_ROM_QSTR(MP_QSTR_settimeout), MP_ROM_PTR(&socket_settimeout_obj) }, - { MP_ROM_QSTR(MP_QSTR_setblocking), MP_ROM_PTR(&socket_setblocking_obj) }, + { MP_ROM_QSTR(MP_QSTR_SocketPool), MP_ROM_PTR(&socketpool_socketpool_type) }, + { MP_ROM_QSTR(MP_QSTR_Socket), MP_ROM_PTR(&socketpool_socket_type) }, }; -STATIC MP_DEFINE_CONST_DICT(socket_locals_dict, socket_locals_dict_table); +STATIC MP_DEFINE_CONST_DICT(socketpool_globals, socketpool_globals_table); -mp_uint_t socket_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_t arg, int *errcode) { - mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - if (request == MP_STREAM_CLOSE) { - if (self->nic != MP_OBJ_NULL) { - self->nic_type->close(self); - self->nic = MP_OBJ_NULL; - } - return 0; - } - return self->nic_type->ioctl(self, request, arg, errcode); -} - -STATIC const mp_stream_p_t socket_stream_p = { - MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) - .ioctl = socket_ioctl, - .is_text = false, -}; - -STATIC const mp_obj_type_t socket_type = { - { &mp_type_type }, - .name = MP_QSTR_socket, - .make_new = socket_make_new, - .protocol = &socket_stream_p, - .locals_dict = (mp_obj_dict_t*)&socket_locals_dict, -}; - -//| def getaddrinfo(host: str, port: int) -> tuple: -//| """Gets the address information for a hostname and port -//| -//| Returns the appropriate family, socket type, socket protocol and -//| address information to call socket.socket() and socket.connect() with, -//| as a tuple.""" -//| ... -//| - -STATIC mp_obj_t socket_getaddrinfo(mp_obj_t host_in, mp_obj_t port_in) { - size_t hlen; - const char *host = mp_obj_str_get_data(host_in, &hlen); - mp_int_t port = mp_obj_get_int(port_in); - uint8_t out_ip[MOD_NETWORK_IPADDR_BUF_SIZE]; - bool have_ip = false; - - if (hlen > 0) { - // check if host is already in IP form - nlr_buf_t nlr; - if (nlr_push(&nlr) == 0) { - netutils_parse_ipv4_addr(host_in, out_ip, NETUTILS_BIG); - have_ip = true; - nlr_pop(); - } else { - // swallow exception: host was not in IP form so need to do DNS lookup - } - } - - if (!have_ip) { - // find a NIC that can do a name lookup - for (mp_uint_t i = 0; i < MP_STATE_PORT(mod_network_nic_list).len; i++) { - mp_obj_t nic = MP_STATE_PORT(mod_network_nic_list).items[i]; - mod_network_nic_type_t *nic_type = (mod_network_nic_type_t*)mp_obj_get_type(nic); - if (nic_type->gethostbyname != NULL) { - int ret = nic_type->gethostbyname(nic, host, hlen, out_ip); - if (ret != 0) { - mp_raise_OSError(ret); - } - have_ip = true; - break; - } - } - } - - if (!have_ip) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, translate("no available NIC"))); - } - - mp_obj_tuple_t *tuple = MP_OBJ_TO_PTR(mp_obj_new_tuple(5, NULL)); - tuple->items[0] = MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_AF_INET); - tuple->items[1] = MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_STREAM); - tuple->items[2] = MP_OBJ_NEW_SMALL_INT(0); - tuple->items[3] = MP_OBJ_NEW_QSTR(MP_QSTR_); - tuple->items[4] = netutils_format_inet_addr(out_ip, port, NETUTILS_BIG); - return mp_obj_new_list(1, (mp_obj_t*)&tuple); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_getaddrinfo_obj, socket_getaddrinfo); - -STATIC const mp_rom_map_elem_t socket_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_usocket) }, - - { MP_ROM_QSTR(MP_QSTR_socket), MP_ROM_PTR(&socket_type) }, - { MP_ROM_QSTR(MP_QSTR_getaddrinfo), MP_ROM_PTR(&socket_getaddrinfo_obj) }, - - // class constants - { MP_ROM_QSTR(MP_QSTR_AF_INET), MP_ROM_INT(MOD_NETWORK_AF_INET) }, - { MP_ROM_QSTR(MP_QSTR_AF_INET6), MP_ROM_INT(MOD_NETWORK_AF_INET6) }, - - { MP_ROM_QSTR(MP_QSTR_SOCK_STREAM), MP_ROM_INT(MOD_NETWORK_SOCK_STREAM) }, - { MP_ROM_QSTR(MP_QSTR_SOCK_DGRAM), MP_ROM_INT(MOD_NETWORK_SOCK_DGRAM) }, - { MP_ROM_QSTR(MP_QSTR_SOCK_RAW), MP_ROM_INT(MOD_NETWORK_SOCK_RAW) }, - - /* - { MP_ROM_QSTR(MP_QSTR_IPPROTO_IP), MP_ROM_INT(MOD_NETWORK_IPPROTO_IP) }, - { MP_ROM_QSTR(MP_QSTR_IPPROTO_ICMP), MP_ROM_INT(MOD_NETWORK_IPPROTO_ICMP) }, - { MP_ROM_QSTR(MP_QSTR_IPPROTO_IPV4), MP_ROM_INT(MOD_NETWORK_IPPROTO_IPV4) }, - { MP_ROM_QSTR(MP_QSTR_IPPROTO_TCP), MP_ROM_INT(MOD_NETWORK_IPPROTO_TCP) }, - { MP_ROM_QSTR(MP_QSTR_IPPROTO_UDP), MP_ROM_INT(MOD_NETWORK_IPPROTO_UDP) }, - { MP_ROM_QSTR(MP_QSTR_IPPROTO_IPV6), MP_ROM_INT(MOD_NETWORK_IPPROTO_IPV6) }, - { MP_ROM_QSTR(MP_QSTR_IPPROTO_RAW), MP_ROM_INT(MOD_NETWORK_IPPROTO_RAW) }, - */ -}; - -STATIC MP_DEFINE_CONST_DICT(socket_globals, socket_globals_table); - -const mp_obj_module_t socket_module = { +const mp_obj_module_t socketpool_module = { .base = { &mp_type_module }, - .globals = (mp_obj_dict_t*)&socket_globals, + .globals = (mp_obj_dict_t*)&socketpool_globals, }; diff --git a/shared-bindings/socketpool/__init__.h b/shared-bindings/socketpool/__init__.h new file mode 100644 index 0000000000..76d8bfa766 --- /dev/null +++ b/shared-bindings/socketpool/__init__.h @@ -0,0 +1,34 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_IPADDRESS___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_IPADDRESS___INIT___H + +#include "shared-module/ipaddress/__init__.h" + +mp_obj_t common_hal_ipaddress_new_ipv4address(uint32_t value); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_IPADDRESS___INIT___H From eb2c38825edfe28007c2bc6c37bdb0a3269f27e7 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 12 Aug 2020 16:57:39 -0700 Subject: [PATCH 0656/1293] HTTP works with my adafruit_requests --- ports/esp32s2/CMakeLists.txt | 5 +- ports/esp32s2/Makefile | 5 +- ports/esp32s2/common-hal/socketpool/Socket.c | 54 ++ ports/esp32s2/common-hal/socketpool/Socket.h | 9 + .../common-hal/socketpool/SocketPool.c | 74 +++ .../common-hal/socketpool/SocketPool.h | 2 + ports/esp32s2/common-hal/ssl/SSLContext.c | 39 ++ ports/esp32s2/common-hal/ssl/SSLContext.h | 37 ++ ports/esp32s2/common-hal/ssl/__init__.c | 31 ++ ports/esp32s2/common-hal/ssl/__init__.h | 31 ++ ports/esp32s2/common-hal/wifi/__init__.c | 4 +- ports/esp32s2/esp-idf | 2 +- ports/esp32s2/mpconfigport.mk | 17 +- ports/esp32s2/partitions.csv | 9 +- ports/esp32s2/sdkconfig.defaults | 56 ++- shared-bindings/ipaddress/__init__.c | 60 ++- shared-bindings/ipaddress/__init__.h | 2 + shared-bindings/socketpool/Socket.c | 465 +++++++++--------- shared-bindings/socketpool/Socket.h | 7 +- shared-bindings/socketpool/SocketPool.c | 118 ++--- shared-bindings/socketpool/SocketPool.h | 13 +- 21 files changed, 680 insertions(+), 360 deletions(-) create mode 100644 ports/esp32s2/common-hal/ssl/SSLContext.c create mode 100644 ports/esp32s2/common-hal/ssl/SSLContext.h create mode 100644 ports/esp32s2/common-hal/ssl/__init__.c create mode 100644 ports/esp32s2/common-hal/ssl/__init__.h diff --git a/ports/esp32s2/CMakeLists.txt b/ports/esp32s2/CMakeLists.txt index 716588cf22..0d7f48995e 100644 --- a/ports/esp32s2/CMakeLists.txt +++ b/ports/esp32s2/CMakeLists.txt @@ -3,7 +3,10 @@ cmake_minimum_required(VERSION 3.13) set(ENV{IDF_PATH} ${CMAKE_SOURCE_DIR}/esp-idf) -set(COMPONENTS esptool_py soc driver log main) + +# The component list here determines what options we get in menuconfig and what the ninja file +# can build. +set(COMPONENTS esptool_py soc driver log main esp-tls mbedtls esp_event esp_netif esp_wifi lwip wpa_supplicant freertos) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(circuitpython) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index ab470d095c..142387f63e 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -85,6 +85,8 @@ INC += -Iesp-idf/components/esp_rom/include INC += -Iesp-idf/components/esp_wifi/include INC += -Iesp-idf/components/xtensa/include INC += -Iesp-idf/components/esp_timer/include +INC += -Iesp-idf/components/mbedtls/mbedtls/include +INC += -Iesp-idf/components/mbedtls/port/include/ INC += -Iesp-idf/components/newlib/platform_include INC += -Iesp-idf/components/lwip/lwip/src/include INC += -Iesp-idf/components/lwip/port/esp32/include @@ -253,7 +255,7 @@ menuconfig: $(BUILD)/esp-idf/config $(HEADER_BUILD)/qstr.i.last: | $(BUILD)/esp-idf/config/sdkconfig.h # Order here matters -ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip esp_rom +ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip esp_rom esp-tls ESP_IDF_COMPONENTS_INCLUDE = driver freertos log soc @@ -281,6 +283,7 @@ esp-idf-stamp: $(BUILD)/esp-idf/config/sdkconfig.h $(Q)ninja -C $(BUILD)/esp-idf \ bootloader/bootloader.bin \ esp-idf/bootloader_support/libbootloader_support.a \ + esp-idf/esp-tls/libesp-tls.a \ esp-idf/esp32s2/ld/esp32s2.project.ld \ esp-idf/esp_event/libesp_event.a \ esp-idf/esp_netif/libesp_netif.a \ diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/esp32s2/common-hal/socketpool/Socket.c index fa0e7d5f3f..0ed8b09147 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.c +++ b/ports/esp32s2/common-hal/socketpool/Socket.c @@ -23,3 +23,57 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ + +#include "shared-bindings/socketpool/Socket.h" + +#include "esp_log.h" +static const char *TAG = "socket"; + +void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t* self, mp_uint_t timeout_ms) { + self->timeout_ms = timeout_ms; +} + +bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self, const char* host, mp_uint_t hostlen, mp_int_t port) { + // For simplicity we use esp_tls for all TCP connections. If it's not SSL, ssl_context will be + // NULL and should still work. This makes regular TCP connections more memory expensive but TLS + // should become more and more common. Therefore, we optimize for the TLS case. + + ESP_LOGI(TAG, "connecting to %s:%d %p", host, port, self->ssl_context); + int result = esp_tls_conn_new_sync(host, hostlen, port, self->ssl_context, self->tcp); + ESP_LOGI(TAG, "result %d", result); + return result >= 0; +} + +mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len) { + size_t sent = esp_tls_conn_write(self->tcp, buf, len); + + ESP_LOGI(TAG, "sent %d bytes", sent); + if (sent < 0) { + // raise an error + } + return sent; +} + +mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len) { + size_t received = esp_tls_conn_read(self->tcp, (void*) buf, len); + + ESP_LOGI(TAG, "received %d bytes", received); + if (received == 0) { + // socket closed + } + if (received < 0) { + // raise an error + } + return received; +} + +void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self) { + if (self->tcp != NULL) { + int status = esp_tls_conn_destroy(self->tcp); + + if (status < 0) { + // raise an error + } + self->tcp = NULL; + } +} diff --git a/ports/esp32s2/common-hal/socketpool/Socket.h b/ports/esp32s2/common-hal/socketpool/Socket.h index 4540b6d439..8a250a115a 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.h +++ b/ports/esp32s2/common-hal/socketpool/Socket.h @@ -29,8 +29,17 @@ #include "py/obj.h" +#include "common-hal/socketpool/SocketPool.h" + +#include "esp-idf/components/esp-tls/esp_tls.h" + typedef struct { mp_obj_base_t base; + int num; + esp_tls_t* tcp; + esp_tls_cfg_t* ssl_context; + socketpool_socketpool_obj_t* pool; + mp_uint_t timeout_ms; } socketpool_socket_obj_t; #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL_SOCKET_H diff --git a/ports/esp32s2/common-hal/socketpool/SocketPool.c b/ports/esp32s2/common-hal/socketpool/SocketPool.c index fa0e7d5f3f..0b9c1776bf 100644 --- a/ports/esp32s2/common-hal/socketpool/SocketPool.c +++ b/ports/esp32s2/common-hal/socketpool/SocketPool.c @@ -23,3 +23,77 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ + +#include "shared-bindings/socketpool/SocketPool.h" + +#include "py/runtime.h" + +#include "esp-idf/components/lwip/lwip/src/include/lwip/netdb.h" + +socketpool_socket_obj_t* common_hal_socketpool_socket(socketpool_socketpool_obj_t* self, + socketpool_socketpool_addressfamily_t family, socketpool_socketpool_sock_t type) { + + int addr_family; + int ipproto; + if (family == SOCKETPOOL_AF_INET) { + addr_family = AF_INET; + ipproto = IPPROTO_IP; + } else { // INET6 + addr_family = AF_INET6; + ipproto = IPPROTO_IPV6; + } + + int socket_type; + if (type == SOCKETPOOL_SOCK_STREAM) { + socket_type = SOCK_STREAM; + } else if (type == SOCKETPOOL_SOCK_DGRAM) { + socket_type = SOCK_DGRAM; + } else { // SOCKETPOOL_SOCK_RAW + socket_type = SOCK_RAW; + } + + int socknum = -1; + esp_tls_t* tcp_handle = NULL; + if (socket_type == SOCK_DGRAM || socket_type == SOCK_RAW) { + socknum = lwip_socket(addr_family, socket_type, ipproto); + } else { + tcp_handle = esp_tls_init(); + } + if (socknum < 0 && tcp_handle == NULL) { + mp_raise_RuntimeError(translate("Out of sockets")); + } + + socketpool_socket_obj_t *sock = m_new_obj_with_finaliser(socketpool_socket_obj_t); + sock->base.type = &socketpool_socket_type; + sock->num = socknum; + sock->tcp = tcp_handle; + sock->ssl_context = NULL; + sock->pool = self; + return sock; +} + + +mp_obj_t common_hal_socketpool_socketpool_gethostbyname(socketpool_socketpool_obj_t* self, + const char* host) { + + const struct addrinfo hints = { + .ai_family = AF_INET, + .ai_socktype = SOCK_STREAM, + }; + struct addrinfo *res; + int err = getaddrinfo(host, NULL, &hints, &res); + if (err != 0 || res == NULL) { + return mp_const_none; + } + + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wcast-align" + struct in_addr *addr = &((struct sockaddr_in *)res->ai_addr)->sin_addr; + #pragma GCC diagnostic pop + 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)); + freeaddrinfo(res); + + return ip_obj; +} diff --git a/ports/esp32s2/common-hal/socketpool/SocketPool.h b/ports/esp32s2/common-hal/socketpool/SocketPool.h index dc46d8958a..ae9988d593 100644 --- a/ports/esp32s2/common-hal/socketpool/SocketPool.h +++ b/ports/esp32s2/common-hal/socketpool/SocketPool.h @@ -27,6 +27,8 @@ #ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL_SOCKETPOOL_H #define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL_SOCKETPOOL_H +#include "py/obj.h" + typedef struct { mp_obj_base_t base; } socketpool_socketpool_obj_t; diff --git a/ports/esp32s2/common-hal/ssl/SSLContext.c b/ports/esp32s2/common-hal/ssl/SSLContext.c new file mode 100644 index 0000000000..98fedb3a84 --- /dev/null +++ b/ports/esp32s2/common-hal/ssl/SSLContext.c @@ -0,0 +1,39 @@ +/* + * 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 "shared-bindings/socketpool/SocketPool.h" + +#include "py/runtime.h" + +#include "esp-idf/components/lwip/lwip/src/include/lwip/netdb.h" + +socketpool_socket_obj_t* common_hal_ssl_sslcontext_wrap_socket(ssl_sslcontext_obj_t* self, + socketpool_socket_obj_t* socket, bool server_side, const char* server_hostname) { + + + // Should we store server hostname on the socket in case connect is called with an ip? + return socket; +} diff --git a/ports/esp32s2/common-hal/ssl/SSLContext.h b/ports/esp32s2/common-hal/ssl/SSLContext.h new file mode 100644 index 0000000000..e44b1f7fe7 --- /dev/null +++ b/ports/esp32s2/common-hal/ssl/SSLContext.h @@ -0,0 +1,37 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SSL_SSLCONTEXT_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SSL_SSLCONTEXT_H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + esp_tls_cfg_t ssl_config; +} ssl_sslcontext_obj_t; + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SSL_SSL_CONTEXT_H diff --git a/ports/esp32s2/common-hal/ssl/__init__.c b/ports/esp32s2/common-hal/ssl/__init__.c new file mode 100644 index 0000000000..8f9565b46e --- /dev/null +++ b/ports/esp32s2/common-hal/ssl/__init__.c @@ -0,0 +1,31 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H + + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H diff --git a/ports/esp32s2/common-hal/ssl/__init__.h b/ports/esp32s2/common-hal/ssl/__init__.h new file mode 100644 index 0000000000..8f9565b46e --- /dev/null +++ b/ports/esp32s2/common-hal/ssl/__init__.h @@ -0,0 +1,31 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H + + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index eb033256d2..b9147496b9 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -113,12 +113,12 @@ void common_hal_wifi_init(void) { ESP_EVENT_ANY_ID, &event_handler, self, - self->handler_instance_all_wifi)); + &self->handler_instance_all_wifi)); ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT, IP_EVENT_STA_GOT_IP, &event_handler, self, - self->handler_instance_got_ip)); + &self->handler_instance_got_ip)); ESP_EARLY_LOGI(TAG, "wifi init"); diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index 01c86ed7d6..83595f7659 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit 01c86ed7d6f4bbbaeda0c461c5f20e3d9872b44b +Subproject commit 83595f76591aebf0cca9a578258276e67f628b06 diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index dcfb0ecc5c..62d2da6079 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -13,22 +13,17 @@ USB_SERIAL_NUMBER_LENGTH = 12 LONGINT_IMPL = MPZ # These modules are implemented in ports//common-hal: +CIRCUITPY_FULL_BUILD = 1 CIRCUITPY_ANALOGIO = 0 -CIRCUITPY_NVM = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 -CIRCUITPY_ROTARYIO = 0 -CIRCUITPY_RTC = 0 +CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 -CIRCUITPY_COUNTIO = 0 - -# These modules are implemented in shared-module/ - they can be included in -# any port once their prerequisites in common-hal are complete. -CIRCUITPY_RANDOM = 0 # Requires OS -CIRCUITPY_USB_MIDI = 0 # Requires USB -CIRCUITPY_ULAB = 0 # No requirements, but takes extra flash - +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_RTC = 0 +CIRCUITPY_NVM = 0 +CIRCUITPY_USB_MIDI = 0 # We don't have enough endpoints to include MIDI. CIRCUITPY_WIFI = 1 CIRCUITPY_MODULE ?= none diff --git a/ports/esp32s2/partitions.csv b/ports/esp32s2/partitions.csv index dd12c609dc..6317ff52ad 100644 --- a/ports/esp32s2/partitions.csv +++ b/ports/esp32s2/partitions.csv @@ -3,8 +3,7 @@ # bootloader.bin 0x1000 # partition table 0x8000, 0xC00 otadata, data, ota, 0xd000, 0x2000, -ota_0, 0, ota_0, 0x10000, 0x100000, -ota_1, 0, ota_1, 0x110000, 0x100000, -phy_init, data, phy, 0x210000, 0x1000, -nvs, data, nvs, 0x211000, 0x6000, -user_fs, data, fat, 0x217000, 0x1e9000, +ota_0, 0, ota_0, 0x10000, 0x120000, +ota_1, 0, ota_1, 0x130000, 0x120000, +phy_init, data, phy, 0x250000, 0x1000, +user_fs, data, fat, 0x251000, 0x1af000, diff --git a/ports/esp32s2/sdkconfig.defaults b/ports/esp32s2/sdkconfig.defaults index f7693ce18f..2faaa028c1 100644 --- a/ports/esp32s2/sdkconfig.defaults +++ b/ports/esp32s2/sdkconfig.defaults @@ -37,6 +37,7 @@ CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 # # Bootloader config # +CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000 CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set @@ -64,15 +65,19 @@ CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 # # Security features # +CONFIG_SECURE_TARGET_HAS_SECURE_ROM_DL_MODE=y # CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set # CONFIG_SECURE_BOOT is not set # CONFIG_SECURE_FLASH_ENC_ENABLED is not set +# CONFIG_SECURE_DISABLE_ROM_DL_MODE is not set +# CONFIG_SECURE_ENABLE_SECURE_ROM_DL_MODE is not set # end of Security features # # Serial flasher config # CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 +CONFIG_ESPTOOLPY_WITH_STUB=y # CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set # CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set CONFIG_ESPTOOLPY_FLASHMODE_DIO=y @@ -96,6 +101,7 @@ CONFIG_ESPTOOLPY_BEFORE="default_reset" CONFIG_ESPTOOLPY_AFTER_RESET=y # CONFIG_ESPTOOLPY_AFTER_NORESET is not set CONFIG_ESPTOOLPY_AFTER="hard_reset" +# CONFIG_ESPTOOLPY_MONITOR_BAUD_CONSOLE is not set # CONFIG_ESPTOOLPY_MONITOR_BAUD_9600B is not set # CONFIG_ESPTOOLPY_MONITOR_BAUD_57600B is not set CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y @@ -186,6 +192,14 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y CONFIG_EFUSE_MAX_BLK_LEN=256 # end of eFuse Bit Manager +# +# ESP-TLS +# +CONFIG_ESP_TLS_USING_MBEDTLS=y +CONFIG_ESP_TLS_SERVER=y +# CONFIG_ESP_TLS_PSK_VERIFICATION is not set +# end of ESP-TLS + # # ESP32S2-specific # @@ -245,6 +259,10 @@ CONFIG_ESP32S2_RTC_CLK_SRC_INT_RC=y # CONFIG_ESP32S2_RTC_CLK_SRC_INT_8MD256 is not set CONFIG_ESP32S2_RTC_CLK_CAL_CYCLES=576 # CONFIG_ESP32S2_NO_BLOBS is not set +# CONFIG_ESP32S2_KEEP_USB_ALIVE is not set +# CONFIG_ESP32S2_RTCDATA_IN_FAST_MEM is not set +# CONFIG_ESP32S2_USE_FIXED_STATIC_RAM_SIZE is not set +CONFIG_ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP=y # end of ESP32S2-specific # @@ -263,15 +281,16 @@ CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192 CONFIG_ESP_IPC_TASK_STACK_SIZE=1024 CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 CONFIG_ESP_CONSOLE_UART_DEFAULT=y +# CONFIG_ESP_CONSOLE_USB_CDC is not set # CONFIG_ESP_CONSOLE_UART_CUSTOM is not set -# CONFIG_ESP_CONSOLE_UART_NONE is not set +# CONFIG_ESP_CONSOLE_NONE is not set +CONFIG_ESP_CONSOLE_UART=y CONFIG_ESP_CONSOLE_UART_NUM=0 -CONFIG_ESP_CONSOLE_UART_TX_GPIO=1 -CONFIG_ESP_CONSOLE_UART_RX_GPIO=3 CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 CONFIG_ESP_INT_WDT=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 # CONFIG_ESP_TASK_WDT is not set +# CONFIG_ESP_PANIC_HANDLER_IRAM is not set CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y # end of Common ESP-related @@ -307,6 +326,7 @@ CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y # CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT is not set # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set # CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set +CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE=y # end of ESP System Settings # @@ -436,12 +456,15 @@ CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y CONFIG_LWIP_TIMERS_ONDEMAND=y CONFIG_LWIP_MAX_SOCKETS=10 # CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set +# CONFIG_LWIP_SO_LINGER is not set CONFIG_LWIP_SO_REUSE=y CONFIG_LWIP_SO_REUSE_RXTOALL=y # CONFIG_LWIP_SO_RCVBUF is not set # CONFIG_LWIP_NETBUF_RECVINFO is not set -CONFIG_LWIP_IP_FRAG=y -# CONFIG_LWIP_IP_REASSEMBLY is not set +CONFIG_LWIP_IP4_FRAG=y +CONFIG_LWIP_IP6_FRAG=y +# CONFIG_LWIP_IP4_REASSEMBLY is not set +# CONFIG_LWIP_IP6_REASSEMBLY is not set # CONFIG_LWIP_IP_FORWARD is not set # CONFIG_LWIP_STATS is not set # CONFIG_LWIP_ETHARP_TRUST_IP_MAC is not set @@ -482,6 +505,7 @@ CONFIG_LWIP_TCP_QUEUE_OOSEQ=y CONFIG_LWIP_TCP_OVERSIZE_MSS=y # CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set # CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set +CONFIG_LWIP_TCP_RTO_TIME=3000 # end of TCP # @@ -496,6 +520,7 @@ CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y # CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF # CONFIG_LWIP_PPP_SUPPORT is not set +# CONFIG_LWIP_SLIP_SUPPORT is not set # # ICMP @@ -518,6 +543,20 @@ CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 # end of SNTP CONFIG_LWIP_ESP_LWIP_ASSERT=y + +# +# Debug +# +# CONFIG_LWIP_NETIF_DEBUG is not set +# CONFIG_LWIP_PBUF_DEBUG is not set +# CONFIG_LWIP_ETHARP_DEBUG is not set +# CONFIG_LWIP_API_LIB_DEBUG is not set +# CONFIG_LWIP_SOCKETS_DEBUG is not set +# CONFIG_LWIP_IP_DEBUG is not set +# CONFIG_LWIP_ICMP_DEBUG is not set +# CONFIG_LWIP_IP6_DEBUG is not set +# CONFIG_LWIP_ICMP6_DEBUG is not set +# end of Debug # end of LWIP # @@ -681,6 +720,7 @@ CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20 CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1 +CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192 # # Auto-detect flash chips @@ -714,7 +754,6 @@ CONFIG_VFS_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 CONFIG_WPA_MBEDTLS_CRYPTO=y # CONFIG_WPA_DEBUG_PRINT is not set # CONFIG_WPA_TESTING_OPTIONS is not set -CONFIG_WPA_TLS_V12=y # CONFIG_WPA_WPS_WARS is not set # end of Supplicant # end of Component config @@ -771,10 +810,9 @@ CONFIG_MAIN_TASK_STACK_SIZE=8192 CONFIG_IPC_TASK_STACK_SIZE=1024 CONFIG_CONSOLE_UART_DEFAULT=y # CONFIG_CONSOLE_UART_CUSTOM is not set -# CONFIG_CONSOLE_UART_NONE is not set +# CONFIG_ESP_CONSOLE_UART_NONE is not set +CONFIG_CONSOLE_UART=y CONFIG_CONSOLE_UART_NUM=0 -CONFIG_CONSOLE_UART_TX_GPIO=1 -CONFIG_CONSOLE_UART_RX_GPIO=3 CONFIG_CONSOLE_UART_BAUDRATE=115200 CONFIG_INT_WDT=y CONFIG_INT_WDT_TIMEOUT_MS=300 diff --git a/shared-bindings/ipaddress/__init__.c b/shared-bindings/ipaddress/__init__.c index 1c0ac9153b..76b63202cc 100644 --- a/shared-bindings/ipaddress/__init__.c +++ b/shared-bindings/ipaddress/__init__.c @@ -37,6 +37,45 @@ //| """ //| + +bool ipaddress_parse_ipv4address(const char* str_data, size_t str_len, uint32_t* ip_out) { + size_t period_count = 0; + size_t period_index[4] = {0, 0, 0, str_len}; + for (size_t i = 0; i < str_len; i++) { + if (str_data[i] == '.') { + if (period_count < 3) { + period_index[period_count] = i; + } + period_count++; + } + } + if (period_count > 3) { + return false; + } + + size_t last_period = 0; + if (ip_out != NULL) { + *ip_out = 0; + } + for (size_t i = 0; i < 4; i++) { + // Catch exceptions thrown by mp_parse_num_integer + nlr_buf_t nlr; + mp_obj_t octet; + if (nlr_push(&nlr) == 0) { + octet = mp_parse_num_integer((const char*) str_data + last_period, period_index[i] - last_period, 10, NULL); + nlr_pop(); + } else { + return false; + } + last_period = period_index[i] + 1; + if (ip_out != NULL) { + mp_int_t int_octet = MP_OBJ_SMALL_INT_VALUE(octet); + *ip_out |= int_octet << (i * 8); + } + } + return true; +} + //| def ip_address(obj: Union[int]) -> IPv4Address: //| """Return a corresponding IP address object or raise ValueError if not possible.""" //| ... @@ -48,28 +87,9 @@ STATIC mp_obj_t ipaddress_ip_address(mp_obj_t ip_in) { // We're done. } else if (MP_OBJ_IS_STR(ip_in)) { GET_STR_DATA_LEN(ip_in, str_data, str_len); - size_t period_count = 0; - size_t period_index[4] = {0, 0, 0, str_len}; - for (size_t i = 0; i < str_len; i++) { - if (str_data[i] == '.') { - if (period_count < 3) { - period_index[period_count] = i; - } - period_count++; - } - } - if (period_count > 3) { + if (!ipaddress_parse_ipv4address((const char*) str_data, str_len, &value)) { mp_raise_ValueError(translate("Not a valid IP string.")); } - - size_t last_period = 0; - value = 0; - for (size_t i = 0; i < 4; i++) { - mp_obj_t octet = mp_parse_num_integer((const char*) str_data + last_period, period_index[i] - last_period, 10, NULL); - last_period = period_index[i] + 1; - mp_int_t int_octet = MP_OBJ_SMALL_INT_VALUE(octet); - value |= int_octet << (i * 8); - } } else { mp_raise_ValueError(translate("Only raw int supported for ip.")); } diff --git a/shared-bindings/ipaddress/__init__.h b/shared-bindings/ipaddress/__init__.h index 76d8bfa766..a1c31775f9 100644 --- a/shared-bindings/ipaddress/__init__.h +++ b/shared-bindings/ipaddress/__init__.h @@ -29,6 +29,8 @@ #include "shared-module/ipaddress/__init__.h" +bool ipaddress_parse_ipv4address(const char* ip_str, size_t len, uint32_t* ip_out); + mp_obj_t common_hal_ipaddress_new_ipv4address(uint32_t value); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_IPADDRESS___INIT___H diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index e4d79616a6..f6f90ceb1f 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -62,94 +62,94 @@ STATIC mp_obj_t socketpool_socket___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket___exit___obj, 4, 4, socketpool_socket___exit__); -//| def bind(self, address: tuple) -> None: -//| """Bind a socket to an address -//| -//| :param ~tuple address: tuple of (remote_address, remote_port)""" -//| ... -//| +// //| def bind(self, address: tuple) -> None: +// //| """Bind a socket to an address +// //| +// //| :param ~tuple address: tuple of (remote_address, remote_port)""" +// //| ... +// //| -STATIC mp_obj_t socketpool_socket_bind(mp_obj_t self_in, mp_obj_t addr_in) { - // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); +// STATIC mp_obj_t socketpool_socket_bind(mp_obj_t self_in, mp_obj_t addr_in) { +// // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - // // get address - // uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; - // mp_uint_t port = netutils_parse_inet_addr(addr_in, ip, NETUTILS_BIG); +// // // get address +// // uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; +// // mp_uint_t port = netutils_parse_inet_addr(addr_in, ip, NETUTILS_BIG); - // // check if we need to select a NIC - // socket_select_nic(self, ip); +// // // check if we need to select a NIC +// // socket_select_nic(self, ip); - // // call the NIC to bind the socket - // int _errno; - // if (self->nic_type->bind(self, ip, port, &_errno) != 0) { - // mp_raise_OSError(_errno); - // } +// // // call the NIC to bind the socket +// // int _errno; +// // if (self->nic_type->bind(self, ip, port, &_errno) != 0) { +// // mp_raise_OSError(_errno); +// // } - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_bind_obj, socketpool_socket_bind); +// return mp_const_none; +// } +// STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_bind_obj, socketpool_socket_bind); -//| def listen(self, backlog: int) -> None: -//| """Set socket to listen for incoming connections -//| -//| :param ~int backlog: length of backlog queue for waiting connetions""" -//| ... -//| +// //| def listen(self, backlog: int) -> None: +// //| """Set socket to listen for incoming connections +// //| +// //| :param ~int backlog: length of backlog queue for waiting connetions""" +// //| ... +// //| -STATIC mp_obj_t socketpool_socket_listen(mp_obj_t self_in, mp_obj_t backlog) { - // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); +// STATIC mp_obj_t socketpool_socket_listen(mp_obj_t self_in, mp_obj_t backlog) { +// // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - // if (self->nic == MP_OBJ_NULL) { - // // not connected - // // TODO I think we can listen even if not bound... - // mp_raise_OSError(MP_ENOTCONN); - // } +// // if (self->nic == MP_OBJ_NULL) { +// // // not connected +// // // TODO I think we can listen even if not bound... +// // mp_raise_OSError(MP_ENOTCONN); +// // } - // int _errno; - // if (self->nic_type->listen(self, mp_obj_get_int(backlog), &_errno) != 0) { - // mp_raise_OSError(_errno); - // } +// // int _errno; +// // if (self->nic_type->listen(self, mp_obj_get_int(backlog), &_errno) != 0) { +// // mp_raise_OSError(_errno); +// // } - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_listen_obj, socketpool_socket_listen); +// return mp_const_none; +// } +// STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_listen_obj, socketpool_socket_listen); -//| def accept(self) -> tuple: -//| """Accept a connection on a listening socket of type SOCK_STREAM, -//| creating a new socket of type SOCK_STREAM. -//| Returns a tuple of (new_socket, remote_address)""" -//| +// //| def accept(self) -> tuple: +// //| """Accept a connection on a listening socket of type SOCK_STREAM, +// //| creating a new socket of type SOCK_STREAM. +// //| Returns a tuple of (new_socket, remote_address)""" +// //| -STATIC mp_obj_t socketpool_socket_accept(mp_obj_t self_in) { - // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); +// STATIC mp_obj_t socketpool_socket_accept(mp_obj_t self_in) { +// // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - // // create new socket object - // // starts with empty NIC so that finaliser doesn't run close() method if accept() fails - // mod_network_socket_obj_t *socket2 = m_new_obj_with_finaliser(mod_network_socket_obj_t); - // socket2->base.type = &socket_type; - // socket2->nic = MP_OBJ_NULL; - // socket2->nic_type = NULL; +// // // create new socket object +// // // starts with empty NIC so that finaliser doesn't run close() method if accept() fails +// // mod_network_socket_obj_t *socket2 = m_new_obj_with_finaliser(mod_network_socket_obj_t); +// // socket2->base.type = &socket_type; +// // socket2->nic = MP_OBJ_NULL; +// // socket2->nic_type = NULL; - // // accept incoming connection - // uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; - // mp_uint_t port; - // int _errno; - // if (self->nic_type->accept(self, socket2, ip, &port, &_errno) != 0) { - // mp_raise_OSError(_errno); - // } +// // // accept incoming connection +// // uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; +// // mp_uint_t port; +// // int _errno; +// // if (self->nic_type->accept(self, socket2, ip, &port, &_errno) != 0) { +// // mp_raise_OSError(_errno); +// // } - // // new socket has valid state, so set the NIC to the same as parent - // socket2->nic = self->nic; - // socket2->nic_type = self->nic_type; +// // // new socket has valid state, so set the NIC to the same as parent +// // socket2->nic = self->nic; +// // socket2->nic_type = self->nic_type; - // // make the return value - // mp_obj_tuple_t *client = MP_OBJ_TO_PTR(mp_obj_new_tuple(2, NULL)); - // client->items[0] = MP_OBJ_FROM_PTR(socket2); - // client->items[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG); +// // // make the return value +// // mp_obj_tuple_t *client = MP_OBJ_TO_PTR(mp_obj_new_tuple(2, NULL)); +// // client->items[0] = MP_OBJ_FROM_PTR(socket2); +// // client->items[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(socketpool_socket_accept_obj, socketpool_socket_accept); +// return mp_const_none; +// } +// STATIC MP_DEFINE_CONST_FUN_OBJ_1(socketpool_socket_accept_obj, socketpool_socket_accept); //| def close(self) -> None: //| """Closes this Socket and makes its resources available to its SocketPool.""" @@ -193,20 +193,19 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(socketpool_socket_close_obj, socketpool_socket_ //| STATIC mp_obj_t socketpool_socket_connect(mp_obj_t self_in, mp_obj_t addr_in) { - // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - // // get address - // uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; - // mp_uint_t port = netutils_parse_inet_addr(addr_in, ip, NETUTILS_BIG); + mp_obj_t *addr_items; + mp_obj_get_array_fixed_n(addr_in, 2, &addr_items); - // // check if we need to select a NIC - // socket_select_nic(self, ip); + size_t hostlen; + const char* host = mp_obj_str_get_data(addr_items[0], &hostlen); + mp_int_t port = mp_obj_get_int(addr_items[1]); - // // call the NIC to connect the socket - // int _errno; - // if (self->nic_type->connect(self, ip, port, &_errno) != 0) { - // mp_raise_OSError(_errno); - // } + bool ok = common_hal_socketpool_socket_connect(self, host, hostlen, port); + if (!ok) { + mp_raise_OSError(0); + } return mp_const_none; } @@ -221,19 +220,17 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_connect_obj, socketpool_socke //| STATIC mp_obj_t socketpool_socket_send(mp_obj_t self_in, mp_obj_t buf_in) { - mp_int_t ret = 0; - // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); // if (self->nic == MP_OBJ_NULL) { // // not connected // mp_raise_OSError(MP_EPIPE); // } - // mp_buffer_info_t bufinfo; - // mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); - // int _errno; - // mp_int_t ret = self->nic_type->send(self, bufinfo.buf, bufinfo.len, &_errno); - // if (ret == -1) { - // mp_raise_OSError(_errno); - // } + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); + mp_int_t ret = common_hal_socketpool_socket_send(self, bufinfo.buf, bufinfo.len); + if (ret == -1) { + mp_raise_OSError(0); + } return mp_obj_new_int_from_uint(ret); } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_send_obj, socketpool_socket_send); @@ -267,134 +264,133 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_send_obj, socketpool_socket_s //| STATIC mp_obj_t socketpool_socket_recv_into(size_t n_args, const mp_obj_t *args) { - // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(args[0]); + socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(args[0]); // if (self->nic == MP_OBJ_NULL) { // // not connected // mp_raise_OSError(MP_ENOTCONN); // } - // mp_buffer_info_t bufinfo; - // mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_WRITE); - // mp_int_t len = bufinfo.len; - // if (n_args == 3) { - // mp_int_t given_len = mp_obj_get_int(args[2]); - // if (given_len < len) { - // len = given_len; - // } - // } + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_WRITE); + mp_int_t len = bufinfo.len; + if (n_args == 3) { + mp_int_t given_len = mp_obj_get_int(args[2]); + if (given_len < len) { + len = given_len; + } + } - // mp_int_t ret = _socket_recv_into(self, (byte*)bufinfo.buf, len); - mp_int_t ret = 0; + mp_int_t ret = common_hal_socketpool_socket_recv_into(self, (byte*)bufinfo.buf, len); return mp_obj_new_int_from_uint(ret); } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket_recv_into_obj, 2, 3, socketpool_socket_recv_into); -//| def sendto(self, bytes: ReadableBuffer, address: tuple) -> int: -//| """Send some bytes to a specific address. -//| Suits sockets of type SOCK_DGRAM -//| -//| :param ~bytes bytes: some bytes to send -//| :param ~tuple address: tuple of (remote_address, remote_port)""" -//| ... -//| +// //| def sendto(self, bytes: ReadableBuffer, address: tuple) -> int: +// //| """Send some bytes to a specific address. +// //| Suits sockets of type SOCK_DGRAM +// //| +// //| :param ~bytes bytes: some bytes to send +// //| :param ~tuple address: tuple of (remote_address, remote_port)""" +// //| ... +// //| -STATIC mp_obj_t socketpool_socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_obj_t addr_in) { - // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); +// STATIC mp_obj_t socketpool_socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_obj_t addr_in) { +// // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - // // get the data - // mp_buffer_info_t bufinfo; - // mp_get_buffer_raise(data_in, &bufinfo, MP_BUFFER_READ); +// // // get the data +// // mp_buffer_info_t bufinfo; +// // mp_get_buffer_raise(data_in, &bufinfo, MP_BUFFER_READ); - // // get address - // uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; - // mp_uint_t port = netutils_parse_inet_addr(addr_in, ip, NETUTILS_BIG); +// // // get address +// // uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; +// // mp_uint_t port = netutils_parse_inet_addr(addr_in, ip, NETUTILS_BIG); - // // check if we need to select a NIC - // socket_select_nic(self, ip); +// // // check if we need to select a NIC +// // socket_select_nic(self, ip); - // // call the NIC to sendto - // int _errno; - // mp_int_t ret = self->nic_type->sendto(self, bufinfo.buf, bufinfo.len, ip, port, &_errno); - // if (ret == -1) { - // mp_raise_OSError(_errno); - // } - mp_int_t ret = 0; +// // // call the NIC to sendto +// // int _errno; +// // mp_int_t ret = self->nic_type->sendto(self, bufinfo.buf, bufinfo.len, ip, port, &_errno); +// // if (ret == -1) { +// // mp_raise_OSError(_errno); +// // } +// mp_int_t ret = 0; - return mp_obj_new_int(ret); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_3(socketpool_socket_sendto_obj, socketpool_socket_sendto); +// return mp_obj_new_int(ret); +// } +// STATIC MP_DEFINE_CONST_FUN_OBJ_3(socketpool_socket_sendto_obj, socketpool_socket_sendto); -//| def recvfrom(self, bufsize: int) -> Tuple[bytes, tuple]: -//| """Reads some bytes from the connected remote address. -//| Suits sockets of type SOCK_STREAM -//| -//| Returns a tuple containing -//| * a bytes() of length <= bufsize -//| * a remote_address, which is a tuple of ip address and port number -//| -//| :param ~int bufsize: maximum number of bytes to receive""" -//| ... -//| +// //| def recvfrom(self, bufsize: int) -> Tuple[bytes, tuple]: +// //| """Reads some bytes from the connected remote address. +// //| Suits sockets of type SOCK_STREAM +// //| +// //| Returns a tuple containing +// //| * a bytes() of length <= bufsize +// //| * a remote_address, which is a tuple of ip address and port number +// //| +// //| :param ~int bufsize: maximum number of bytes to receive""" +// //| ... +// //| -STATIC mp_obj_t socketpool_socket_recvfrom_into(mp_obj_t self_in, mp_obj_t len_in) { - // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - // if (self->nic == MP_OBJ_NULL) { - // // not connected - // mp_raise_OSError(MP_ENOTCONN); - // } - // vstr_t vstr; - // vstr_init_len(&vstr, mp_obj_get_int(len_in)); - // byte ip[4]; - // mp_uint_t port; - // int _errno; - // mp_int_t ret = self->nic_type->recvfrom(self, (byte*)vstr.buf, vstr.len, ip, &port, &_errno); - // if (ret == -1) { - // mp_raise_OSError(_errno); - // } - mp_obj_t tuple[2]; - // if (ret == 0) { - // tuple[0] = mp_const_empty_bytes; - // } else { - // vstr.len = ret; - // tuple[0] = mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); - // } - // tuple[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG); - return mp_obj_new_tuple(2, tuple); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_recvfrom_into_obj, socketpool_socket_recvfrom_into); +// STATIC mp_obj_t socketpool_socket_recvfrom_into(mp_obj_t self_in, mp_obj_t len_in) { +// // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); +// // if (self->nic == MP_OBJ_NULL) { +// // // not connected +// // mp_raise_OSError(MP_ENOTCONN); +// // } +// // vstr_t vstr; +// // vstr_init_len(&vstr, mp_obj_get_int(len_in)); +// // byte ip[4]; +// // mp_uint_t port; +// // int _errno; +// // mp_int_t ret = self->nic_type->recvfrom(self, (byte*)vstr.buf, vstr.len, ip, &port, &_errno); +// // if (ret == -1) { +// // mp_raise_OSError(_errno); +// // } +// mp_obj_t tuple[2]; +// // if (ret == 0) { +// // tuple[0] = mp_const_empty_bytes; +// // } else { +// // vstr.len = ret; +// // tuple[0] = mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); +// // } +// // tuple[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG); +// return mp_obj_new_tuple(2, tuple); +// } +// STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_recvfrom_into_obj, socketpool_socket_recvfrom_into); -//| def setsockopt(self, level: int, optname: int, value: int) -> None: -//| """Sets socket options""" -//| ... -//| +// //| 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]); +// 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]); - // 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; - // if (self->nic_type->setsockopt(self, level, opt, optval, optlen, &_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: //| """Set the timeout value for this socket. @@ -404,46 +400,39 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket_setsockopt_obj, 4, //| STATIC mp_obj_t socketpool_socket_settimeout(mp_obj_t self_in, mp_obj_t timeout_in) { - // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - // if (self->nic == MP_OBJ_NULL) { - // // not connected - // mp_raise_OSError(MP_ENOTCONN); - // } - // mp_uint_t timeout; - // if (timeout_in == mp_const_none) { - // timeout = -1; - // } else { - // #if MICROPY_PY_BUILTINS_FLOAT - // timeout = 1000 * mp_obj_get_float(timeout_in); - // #else - // timeout = 1000 * mp_obj_get_int(timeout_in); - // #endif - // } - // int _errno; - // if (self->nic_type->settimeout(self, timeout, &_errno) != 0) { - // mp_raise_OSError(_errno); - // } + socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + mp_uint_t timeout_ms; + if (timeout_in == mp_const_none) { + timeout_ms = -1; + } else { + #if MICROPY_PY_BUILTINS_FLOAT + timeout_ms = 1000 * mp_obj_get_float(timeout_in); + #else + timeout_ms = 1000 * mp_obj_get_int(timeout_in); + #endif + } + common_hal_socketpool_socket_settimeout(self, timeout_ms); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_settimeout_obj, socketpool_socket_settimeout); -//| def setblocking(self, flag: bool) -> Optional[int]: -//| """Set the blocking behaviour of this socket. -//| -//| :param ~bool flag: False means non-blocking, True means block indefinitely.""" -//| ... -//| +// //| def setblocking(self, flag: bool) -> Optional[int]: +// //| """Set the blocking behaviour of this socket. +// //| +// //| :param ~bool flag: False means non-blocking, True means block indefinitely.""" +// //| ... +// //| -// method socket.setblocking(flag) -STATIC mp_obj_t socketpool_socket_setblocking(mp_obj_t self_in, mp_obj_t blocking) { - // if (mp_obj_is_true(blocking)) { - // return socket_settimeout(self_in, mp_const_none); - // } else { - // return socket_settimeout(self_in, MP_OBJ_NEW_SMALL_INT(0)); - // } - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_setblocking_obj, socketpool_socket_setblocking); +// // method socket.setblocking(flag) +// STATIC mp_obj_t socketpool_socket_setblocking(mp_obj_t self_in, mp_obj_t blocking) { +// // if (mp_obj_is_true(blocking)) { +// // return socket_settimeout(self_in, mp_const_none); +// // } else { +// // return socket_settimeout(self_in, MP_OBJ_NEW_SMALL_INT(0)); +// // } +// return mp_const_none; +// } +// STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_setblocking_obj, socketpool_socket_setblocking); STATIC const mp_rom_map_elem_t socketpool_socket_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, @@ -451,17 +440,17 @@ STATIC const mp_rom_map_elem_t socketpool_socket_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&socketpool_socket_close_obj) }, { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&socketpool_socket_close_obj) }, - { MP_ROM_QSTR(MP_QSTR_bind), MP_ROM_PTR(&socketpool_socket_bind_obj) }, - { MP_ROM_QSTR(MP_QSTR_listen), MP_ROM_PTR(&socketpool_socket_listen_obj) }, - { MP_ROM_QSTR(MP_QSTR_accept), MP_ROM_PTR(&socketpool_socket_accept_obj) }, + // { MP_ROM_QSTR(MP_QSTR_bind), MP_ROM_PTR(&socketpool_socket_bind_obj) }, + // { MP_ROM_QSTR(MP_QSTR_listen), MP_ROM_PTR(&socketpool_socket_listen_obj) }, + // { MP_ROM_QSTR(MP_QSTR_accept), MP_ROM_PTR(&socketpool_socket_accept_obj) }, { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&socketpool_socket_connect_obj) }, { MP_ROM_QSTR(MP_QSTR_send), MP_ROM_PTR(&socketpool_socket_send_obj) }, - { MP_ROM_QSTR(MP_QSTR_sendto), MP_ROM_PTR(&socketpool_socket_sendto_obj) }, - { MP_ROM_QSTR(MP_QSTR_recvfrom_into), MP_ROM_PTR(&socketpool_socket_recvfrom_into_obj) }, + // { MP_ROM_QSTR(MP_QSTR_sendto), MP_ROM_PTR(&socketpool_socket_sendto_obj) }, + // { MP_ROM_QSTR(MP_QSTR_recvfrom_into), MP_ROM_PTR(&socketpool_socket_recvfrom_into_obj) }, { MP_ROM_QSTR(MP_QSTR_recv_into), MP_ROM_PTR(&socketpool_socket_recv_into_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) }, - { MP_ROM_QSTR(MP_QSTR_setblocking), MP_ROM_PTR(&socketpool_socket_setblocking_obj) }, + // { MP_ROM_QSTR(MP_QSTR_setblocking), MP_ROM_PTR(&socketpool_socket_setblocking_obj) }, }; STATIC MP_DEFINE_CONST_DICT(socketpool_socket_locals_dict, socketpool_socket_locals_dict_table); diff --git a/shared-bindings/socketpool/Socket.h b/shared-bindings/socketpool/Socket.h index bbe6227efe..94c939e7b8 100644 --- a/shared-bindings/socketpool/Socket.h +++ b/shared-bindings/socketpool/Socket.h @@ -31,8 +31,9 @@ extern const mp_obj_type_t socketpool_socket_type; -// mp_obj_t common_hal_ipaddress_new_ipv4address(uint32_t value); -// void common_hal_ipaddress_ipv4address_construct(ipaddress_ipv4address_obj_t* self, uint8_t* buf, size_t len); -// mp_obj_t common_hal_ipaddress_ipv4address_get_packed(ipaddress_ipv4address_obj_t* self); +void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t* self, mp_uint_t timeout_ms); +bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self, const char* host, size_t hostlen, mp_int_t port); +mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len); +mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKET_H diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index ed5ff82750..2be071c789 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -33,6 +33,7 @@ #include "py/runtime.h" #include "py/mperrno.h" +#include "shared-bindings/ipaddress/__init__.h" #include "shared-bindings/socketpool/Socket.h" #include "shared-bindings/socketpool/SocketPool.h" @@ -45,6 +46,8 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t socketpool_socketpool_obj_t *s = m_new_obj_with_finaliser(socketpool_socketpool_obj_t); s->base.type = &socketpool_socketpool_type; + // common_hal_socketpool_socketpool_construct(s, ); + return MP_OBJ_FROM_PTR(s); } @@ -58,31 +61,22 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t //| ... //| STATIC mp_obj_t socketpool_socketpool_socket(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - mp_arg_check_num(n_args, kw_args, 0, 4, false); + mp_arg_check_num(n_args, kw_args, 0, 5, false); - // create socket object (not bound to any NIC yet) - socketpool_socket_obj_t *s = m_new_obj_with_finaliser(socketpool_socket_obj_t); - s->base.type = &socketpool_socket_type; - // s->nic = MP_OBJ_NULL; - // s->nic_type = NULL; - // s->u_param.domain = MOD_NETWORK_AF_INET; - // s->u_param.type = MOD_NETWORK_SOCK_STREAM; - // s->u_param.fileno = -1; - // if (n_args >= 1) { - // s->u_param.domain = mp_obj_get_int(args[0]); - // if (n_args >= 2) { - // s->u_param.type = mp_obj_get_int(args[1]); - // if (n_args >= 4) { - // s->u_param.fileno = mp_obj_get_int(args[3]); - // } - // } - // } - - return MP_OBJ_FROM_PTR(s); + socketpool_socketpool_obj_t *self = pos_args[0]; + socketpool_socketpool_addressfamily_t family = SOCKETPOOL_AF_INET; + socketpool_socketpool_sock_t type = SOCKETPOOL_SOCK_STREAM; + if (n_args >= 2) { + family = mp_obj_get_int(pos_args[1]); + if (n_args >= 3) { + type = mp_obj_get_int(pos_args[2]); + } + } + return common_hal_socketpool_socket(self, family, type); } MP_DEFINE_CONST_FUN_OBJ_KW(socketpool_socketpool_socket_obj, 1, socketpool_socketpool_socket); -//| def getaddrinfo(host: str, port: int) -> tuple: +//| def getaddrinfo(host: str, port: int, family: int = 0, type: int = 0, proto: int = 0, flags: int = 0) -> tuple: //| """Gets the address information for a hostname and port //| //| Returns the appropriate family, socket type, socket protocol and @@ -91,55 +85,49 @@ MP_DEFINE_CONST_FUN_OBJ_KW(socketpool_socketpool_socket_obj, 1, socketpool_socke //| ... //| -STATIC mp_obj_t socketpool_socketpool_getaddrinfo(mp_obj_t host_in, mp_obj_t port_in) { - // size_t hlen; - // const char *host = mp_obj_str_get_data(host_in, &hlen); - // mp_int_t port = mp_obj_get_int(port_in); - // uint8_t out_ip[MOD_NETWORK_IPADDR_BUF_SIZE]; - // bool have_ip = false; +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[] = { + { MP_QSTR_host, MP_ARG_OBJ | MP_ARG_REQUIRED }, + { MP_QSTR_port, MP_ARG_INT | MP_ARG_REQUIRED }, + { MP_QSTR_family, MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_type, MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_port, MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_flags, MP_ARG_INT, {.u_int = 0} }, + }; + socketpool_socketpool_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); - // if (hlen > 0) { - // // check if host is already in IP form - // nlr_buf_t nlr; - // if (nlr_push(&nlr) == 0) { - // netutils_parse_ipv4_addr(host_in, out_ip, NETUTILS_BIG); - // have_ip = true; - // nlr_pop(); - // } else { - // // swallow exception: host was not in IP form so need to do DNS lookup - // } - // } + 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); - // if (!have_ip) { - // // find a NIC that can do a name lookup - // for (mp_uint_t i = 0; i < MP_STATE_PORT(mod_network_nic_list).len; i++) { - // mp_obj_t nic = MP_STATE_PORT(mod_network_nic_list).items[i]; - // mod_network_nic_type_t *nic_type = (mod_network_nic_type_t*)mp_obj_get_type(nic); - // if (nic_type->gethostbyname != NULL) { - // int ret = nic_type->gethostbyname(nic, host, hlen, out_ip); - // if (ret != 0) { - // mp_raise_OSError(ret); - // } - // have_ip = true; - // break; - // } - // } - // } + const char *host = mp_obj_str_get_str(args[ARG_host].u_obj); + mp_int_t port = args[ARG_port].u_int; + mp_obj_t ip_str = mp_const_none; - // if (!have_ip) { - // nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, translate("no available NIC"))); - // } + if (strlen(host) > 0 && ipaddress_parse_ipv4address(host, strlen(host), NULL)) { + ip_str = args[ARG_host].u_obj; + } - // mp_obj_tuple_t *tuple = MP_OBJ_TO_PTR(mp_obj_new_tuple(5, NULL)); - // tuple->items[0] = MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_AF_INET); - // tuple->items[1] = MP_OBJ_NEW_SMALL_INT(MOD_NETWORK_SOCK_STREAM); - // tuple->items[2] = MP_OBJ_NEW_SMALL_INT(0); - // tuple->items[3] = MP_OBJ_NEW_QSTR(MP_QSTR_); - // tuple->items[4] = netutils_format_inet_addr(out_ip, port, NETUTILS_BIG); - // return mp_obj_new_list(1, (mp_obj_t*)&tuple); - return mp_const_none; + if (ip_str == mp_const_none) { + ip_str = common_hal_socketpool_socketpool_gethostbyname(self, host); + } + + if (ip_str == mp_const_none) { + mp_raise_OSError(0); + } + + mp_obj_tuple_t *tuple = MP_OBJ_TO_PTR(mp_obj_new_tuple(5, NULL)); + tuple->items[0] = MP_OBJ_NEW_SMALL_INT(SOCKETPOOL_AF_INET); + tuple->items[1] = MP_OBJ_NEW_SMALL_INT(SOCKETPOOL_SOCK_STREAM); + tuple->items[2] = MP_OBJ_NEW_SMALL_INT(0); + tuple->items[3] = MP_OBJ_NEW_QSTR(MP_QSTR_); + mp_obj_tuple_t *sockaddr = MP_OBJ_TO_PTR(mp_obj_new_tuple(2, NULL)); + sockaddr->items[0] = ip_str; + sockaddr->items[1] = MP_OBJ_NEW_SMALL_INT(port); + tuple->items[4] = MP_OBJ_FROM_PTR(sockaddr); + return mp_obj_new_list(1, (mp_obj_t*)&tuple); } -STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socketpool_getaddrinfo_obj, socketpool_socketpool_getaddrinfo); +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(socketpool_socketpool_getaddrinfo_obj, 3, socketpool_socketpool_getaddrinfo); 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) }, diff --git a/shared-bindings/socketpool/SocketPool.h b/shared-bindings/socketpool/SocketPool.h index 1852cc1680..42bd885185 100644 --- a/shared-bindings/socketpool/SocketPool.h +++ b/shared-bindings/socketpool/SocketPool.h @@ -29,11 +29,10 @@ #include "common-hal/socketpool/SocketPool.h" +#include "shared-bindings/socketpool/Socket.h" + extern const mp_obj_type_t socketpool_socketpool_type; -// mp_obj_t common_hal_ipaddress_new_ipv4address(uint32_t value); -// void common_hal_ipaddress_ipv4address_construct(ipaddress_ipv4address_obj_t* self, uint8_t* buf, size_t len); -// mp_obj_t common_hal_ipaddress_ipv4address_get_packed(ipaddress_ipv4address_obj_t* self); typedef enum { SOCKETPOOL_SOCK_STREAM, SOCKETPOOL_SOCK_DGRAM, @@ -43,6 +42,12 @@ typedef enum { typedef enum { SOCKETPOOL_AF_INET, SOCKETPOOL_AF_INET6 -} socketpool_socketpool_af_t; +} socketpool_socketpool_addressfamily_t; + +socketpool_socket_obj_t* common_hal_socketpool_socket(socketpool_socketpool_obj_t* self, + socketpool_socketpool_addressfamily_t family, socketpool_socketpool_sock_t type); + +mp_obj_t common_hal_socketpool_socketpool_gethostbyname(socketpool_socketpool_obj_t* self, + const char* host); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKETPOOL_H From 430530c74ba0780b2afb232756d3f5cd3b417179 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 13 Aug 2020 16:55:49 -0700 Subject: [PATCH 0657/1293] SSL works until it runs out of memory --- ports/esp32s2/common-hal/socketpool/Socket.c | 6 +- ports/esp32s2/common-hal/socketpool/Socket.h | 3 +- ports/esp32s2/common-hal/ssl/SSLContext.c | 8 +- ports/esp32s2/common-hal/ssl/SSLContext.h | 2 + ports/esp32s2/common-hal/ssl/__init__.c | 9 +- ports/esp32s2/common-hal/ssl/__init__.h | 6 +- ports/esp32s2/supervisor/port.c | 2 +- py/circuitpy_defns.mk | 5 ++ py/circuitpy_mpconfig.h | 8 ++ py/circuitpy_mpconfig.mk | 3 + shared-bindings/socketpool/__init__.h | 10 +-- shared-bindings/ssl/SSLContext.c | 93 ++++++++++++++++++++ shared-bindings/ssl/SSLContext.h | 52 +++++++++++ shared-bindings/ssl/__init__.c | 74 ++++++++++++++++ shared-bindings/ssl/__init__.h | 34 +++++++ 15 files changed, 296 insertions(+), 19 deletions(-) create mode 100644 shared-bindings/ssl/SSLContext.c create mode 100644 shared-bindings/ssl/SSLContext.h create mode 100644 shared-bindings/ssl/__init__.c create mode 100644 shared-bindings/ssl/__init__.h diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/esp32s2/common-hal/socketpool/Socket.c index 0ed8b09147..83bb455693 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.c +++ b/ports/esp32s2/common-hal/socketpool/Socket.c @@ -39,7 +39,11 @@ bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self, const c // should become more and more common. Therefore, we optimize for the TLS case. ESP_LOGI(TAG, "connecting to %s:%d %p", host, port, self->ssl_context); - int result = esp_tls_conn_new_sync(host, hostlen, port, self->ssl_context, self->tcp); + esp_tls_cfg_t* tls_config = NULL; + if (self->ssl_context != NULL) { + tls_config = &self->ssl_context->ssl_config; + } + int result = esp_tls_conn_new_sync(host, hostlen, port, tls_config, self->tcp); ESP_LOGI(TAG, "result %d", result); return result >= 0; } diff --git a/ports/esp32s2/common-hal/socketpool/Socket.h b/ports/esp32s2/common-hal/socketpool/Socket.h index 8a250a115a..ba832faac2 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.h +++ b/ports/esp32s2/common-hal/socketpool/Socket.h @@ -30,6 +30,7 @@ #include "py/obj.h" #include "common-hal/socketpool/SocketPool.h" +#include "common-hal/ssl/SSLContext.h" #include "esp-idf/components/esp-tls/esp_tls.h" @@ -37,7 +38,7 @@ typedef struct { mp_obj_base_t base; int num; esp_tls_t* tcp; - esp_tls_cfg_t* ssl_context; + ssl_sslcontext_obj_t* ssl_context; socketpool_socketpool_obj_t* pool; mp_uint_t timeout_ms; } socketpool_socket_obj_t; diff --git a/ports/esp32s2/common-hal/ssl/SSLContext.c b/ports/esp32s2/common-hal/ssl/SSLContext.c index 98fedb3a84..e24fd338b6 100644 --- a/ports/esp32s2/common-hal/ssl/SSLContext.c +++ b/ports/esp32s2/common-hal/ssl/SSLContext.c @@ -24,16 +24,18 @@ * THE SOFTWARE. */ -#include "shared-bindings/socketpool/SocketPool.h" +#include "shared-bindings/ssl/SSLContext.h" #include "py/runtime.h" -#include "esp-idf/components/lwip/lwip/src/include/lwip/netdb.h" +void common_hal_ssl_sslcontext_construct(ssl_sslcontext_obj_t* self) { + +} socketpool_socket_obj_t* common_hal_ssl_sslcontext_wrap_socket(ssl_sslcontext_obj_t* self, socketpool_socket_obj_t* socket, bool server_side, const char* server_hostname) { - + socket->ssl_context = self; // Should we store server hostname on the socket in case connect is called with an ip? return socket; } diff --git a/ports/esp32s2/common-hal/ssl/SSLContext.h b/ports/esp32s2/common-hal/ssl/SSLContext.h index e44b1f7fe7..41d199f080 100644 --- a/ports/esp32s2/common-hal/ssl/SSLContext.h +++ b/ports/esp32s2/common-hal/ssl/SSLContext.h @@ -29,6 +29,8 @@ #include "py/obj.h" +#include "esp-idf/components/esp-tls/esp_tls.h" + typedef struct { mp_obj_base_t base; esp_tls_cfg_t ssl_config; diff --git a/ports/esp32s2/common-hal/ssl/__init__.c b/ports/esp32s2/common-hal/ssl/__init__.c index 8f9565b46e..a105e53624 100644 --- a/ports/esp32s2/common-hal/ssl/__init__.c +++ b/ports/esp32s2/common-hal/ssl/__init__.c @@ -24,8 +24,11 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H +#include "shared-bindings/ssl/SSLContext.h" +#include "esp-idf/components/mbedtls/esp_crt_bundle/include/esp_crt_bundle.h" -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H +void common_hal_ssl_create_default_context(ssl_sslcontext_obj_t* self) { + memset(&self->ssl_config, 0, sizeof(esp_tls_cfg_t)); + self->ssl_config.crt_bundle_attach = esp_crt_bundle_attach; +} diff --git a/ports/esp32s2/common-hal/ssl/__init__.h b/ports/esp32s2/common-hal/ssl/__init__.h index 8f9565b46e..fe83a79194 100644 --- a/ports/esp32s2/common-hal/ssl/__init__.h +++ b/ports/esp32s2/common-hal/ssl/__init__.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SSL___INIT___H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SSL___INIT___H -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SSL___INIT___H diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 9a1ac5e2c8..bebecd8ae3 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -48,7 +48,7 @@ #include "esp_log.h" static const char *TAG = "cp port"; -#define HEAP_SIZE (64 * 1024) +#define HEAP_SIZE (48 * 1024) STATIC esp_timer_handle_t _tick_timer; diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 43f6977f0f..56cd937a85 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -231,6 +231,9 @@ endif ifeq ($(CIRCUITPY_SOCKETPOOL),1) SRC_PATTERNS += socketpool/% endif +ifeq ($(CIRCUITPY_SSL),1) +SRC_PATTERNS += ssl/% +endif ifeq ($(CIRCUITPY_STAGE),1) SRC_PATTERNS += _stage/% endif @@ -340,6 +343,8 @@ SRC_COMMON_HAL_ALL = \ socketpool/__init__.c \ socketpool/SocketPool.c \ socketpool/Socket.c \ + ssl/__init__.c \ + ssl/SSLContext.c \ supervisor/Runtime.c \ supervisor/__init__.c \ watchdog/WatchDogMode.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 846328dcdf..b2543dcad8 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -588,6 +588,13 @@ extern const struct _mp_obj_module_t socketpool_module; #define SOCKETPOOL_MODULE #endif +#if CIRCUITPY_SSL +extern const struct _mp_obj_module_t ssl_module; +#define SSL_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_ssl), (mp_obj_t)&ssl_module }, +#else +#define SSL_MODULE +#endif + #if CIRCUITPY_STAGE extern const struct _mp_obj_module_t stage_module; #define STAGE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__stage), (mp_obj_t)&stage_module }, @@ -773,6 +780,7 @@ extern const struct _mp_obj_module_t wifi_module; SDIOIO_MODULE \ SHARPDISPLAY_MODULE \ SOCKETPOOL_MODULE \ + SSL_MODULE \ STAGE_MODULE \ STORAGE_MODULE \ STRUCT_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 35ed6df028..8b34dced24 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -188,6 +188,9 @@ CFLAGS += -DCIRCUITPY_SHARPDISPLAY=$(CIRCUITPY_SHARPDISPLAY) CIRCUITPY_SOCKETPOOL ?= $(CIRCUITPY_WIFI) CFLAGS += -DCIRCUITPY_SOCKETPOOL=$(CIRCUITPY_SOCKETPOOL) +CIRCUITPY_SSL ?= $(CIRCUITPY_WIFI) +CFLAGS += -DCIRCUITPY_SSL=$(CIRCUITPY_SSL) + # Currently always off. CIRCUITPY_STAGE ?= 0 CFLAGS += -DCIRCUITPY_STAGE=$(CIRCUITPY_STAGE) diff --git a/shared-bindings/socketpool/__init__.h b/shared-bindings/socketpool/__init__.h index 76d8bfa766..a017e96c6d 100644 --- a/shared-bindings/socketpool/__init__.h +++ b/shared-bindings/socketpool/__init__.h @@ -24,11 +24,7 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_IPADDRESS___INIT___H -#define MICROPY_INCLUDED_SHARED_BINDINGS_IPADDRESS___INIT___H +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL___INIT___H -#include "shared-module/ipaddress/__init__.h" - -mp_obj_t common_hal_ipaddress_new_ipv4address(uint32_t value); - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_IPADDRESS___INIT___H +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL___INIT___H diff --git a/shared-bindings/ssl/SSLContext.c b/shared-bindings/ssl/SSLContext.c new file mode 100644 index 0000000000..d47baf3455 --- /dev/null +++ b/shared-bindings/ssl/SSLContext.c @@ -0,0 +1,93 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2014 Damien P. George + * 2018 Nick Moore 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 "py/objtuple.h" +#include "py/objlist.h" +#include "py/runtime.h" +#include "py/mperrno.h" + +#include "shared-bindings/ssl/SSLContext.h" + +//| class SSLContext: +//| + +STATIC mp_obj_t ssl_sslcontext_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { + mp_arg_check_num(n_args, kw_args, 0, 1, false); + + ssl_sslcontext_obj_t *s = m_new_obj(ssl_sslcontext_obj_t); + s->base.type = &ssl_sslcontext_type; + + common_hal_ssl_sslcontext_construct(s); + + return MP_OBJ_FROM_PTR(s); +} + +//| def wrap_socket(sock: socketpool.Socket, *, server_side: bool = False, server_hostname: str = None) -> socketpool.Socket: +//| """Wraps the socket into a socket-compatible class that handles SSL negotiation. +//| The socket must be of type SOCK_STREAM.""" +//| ... +//| + +STATIC mp_obj_t ssl_sslcontext_wrap_socket(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_sock, ARG_server_side, ARG_server_hostname }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_sock, MP_ARG_OBJ | MP_ARG_REQUIRED }, + { MP_QSTR_server_side, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, + { MP_QSTR_server_hostname, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, + }; + ssl_sslcontext_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + + 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); + + const char *server_hostname = mp_obj_str_get_str(args[ARG_server_hostname].u_obj); + bool server_side = args[ARG_server_side].u_bool; + if (server_side && server_hostname != NULL) { + mp_raise_ValueError(translate("Server side context cannot have hostname.")); + } + + socketpool_socket_obj_t* sock = args[ARG_sock].u_obj; + + return common_hal_ssl_sslcontext_wrap_socket(self, sock, server_side, server_hostname); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(ssl_sslcontext_wrap_socket_obj, 2, ssl_sslcontext_wrap_socket); + +STATIC const mp_rom_map_elem_t ssl_sslcontext_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_wrap_socket), MP_ROM_PTR(&ssl_sslcontext_wrap_socket_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(ssl_sslcontext_locals_dict, ssl_sslcontext_locals_dict_table); + +const mp_obj_type_t ssl_sslcontext_type = { + { &mp_type_type }, + .name = MP_QSTR_SSLContext, + .make_new = ssl_sslcontext_make_new, + .locals_dict = (mp_obj_dict_t*)&ssl_sslcontext_locals_dict, +}; diff --git a/shared-bindings/ssl/SSLContext.h b/shared-bindings/ssl/SSLContext.h new file mode 100644 index 0000000000..3bb1391164 --- /dev/null +++ b/shared-bindings/ssl/SSLContext.h @@ -0,0 +1,52 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_SSL_SSLCONTEXT_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_SSL_SSLCONTEXT_H + +#include "common-hal/ssl/SSLContext.h" + +#include "shared-bindings/socketpool/Socket.h" + +extern const mp_obj_type_t ssl_sslcontext_type; + +// typedef enum { +// SOCKETPOOL_SOCK_STREAM, +// SOCKETPOOL_SOCK_DGRAM, +// SOCKETPOOL_SOCK_RAW +// } socketpool_socketpool_sock_t; + +// typedef enum { +// SOCKETPOOL_AF_INET, +// SOCKETPOOL_AF_INET6 +// } socketpool_socketpool_addressfamily_t; + +void common_hal_ssl_sslcontext_construct(ssl_sslcontext_obj_t* self); + +socketpool_socket_obj_t* common_hal_ssl_sslcontext_wrap_socket(ssl_sslcontext_obj_t* self, + socketpool_socket_obj_t* sock, bool server_side, const char* server_hostname); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_SSL_SSLCONTEXT_H diff --git a/shared-bindings/ssl/__init__.c b/shared-bindings/ssl/__init__.c new file mode 100644 index 0000000000..fec4c76676 --- /dev/null +++ b/shared-bindings/ssl/__init__.c @@ -0,0 +1,74 @@ +/* + * 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 "py/objexcept.h" +#include "py/objstr.h" +#include "py/parsenum.h" +#include "py/runtime.h" +#include "shared-bindings/ssl/__init__.h" +#include "shared-bindings/ssl/SSLContext.h" + +//| """ +//| The `ssl` module provides SSL contexts to wrap sockets in. +//| """ +//| + +//| def create_default_context() -> ssl.SSLContext: +//| """Return the default SSLContext.""" +//| ... +//| + +STATIC mp_obj_t ssl_create_default_context(void) { + ssl_sslcontext_obj_t *s = m_new_obj(ssl_sslcontext_obj_t); + s->base.type = &ssl_sslcontext_type; + + common_hal_ssl_create_default_context(s); + return s; +} +MP_DEFINE_CONST_FUN_OBJ_0(ssl_create_default_context_obj, ssl_create_default_context); + +STATIC const mp_rom_map_elem_t ssl_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_ssl) }, + + { MP_ROM_QSTR(MP_QSTR_create_default_context), MP_ROM_PTR(&ssl_create_default_context_obj) }, + + { MP_ROM_QSTR(MP_QSTR_SSLContext), MP_ROM_PTR(&ssl_sslcontext_type) }, + + // class constants + // { MP_ROM_QSTR(MP_QSTR_AF_INET), MP_ROM_INT(SOCKETPOOL_AF_INET) }, + // { MP_ROM_QSTR(MP_QSTR_AF_INET6), MP_ROM_INT(SOCKETPOOL_AF_INET6) }, + + // { MP_ROM_QSTR(MP_QSTR_SOCK_STREAM), MP_ROM_INT(SOCKETPOOL_SOCK_STREAM) }, + // { MP_ROM_QSTR(MP_QSTR_SOCK_DGRAM), MP_ROM_INT(SOCKETPOOL_SOCK_DGRAM) }, + // { MP_ROM_QSTR(MP_QSTR_SOCK_RAW), MP_ROM_INT(SOCKETPOOL_SOCK_RAW) }, +}; + +STATIC MP_DEFINE_CONST_DICT(ssl_globals, ssl_globals_table); + +const mp_obj_module_t ssl_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&ssl_globals, +}; diff --git a/shared-bindings/ssl/__init__.h b/shared-bindings/ssl/__init__.h new file mode 100644 index 0000000000..5ddada64e6 --- /dev/null +++ b/shared-bindings/ssl/__init__.h @@ -0,0 +1,34 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_SSL___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_SSL___INIT___H + +#include "common-hal/ssl/SSLContext.h" + +void common_hal_ssl_create_default_context(ssl_sslcontext_obj_t* self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_SSL___INIT___H From b3a449c2764f25a3c4becdbbed47e02ca36f755b Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 14 Aug 2020 15:52:18 -0700 Subject: [PATCH 0658/1293] Turn on json and enable socket.close --- ports/esp32s2/mpconfigport.h | 2 +- shared-bindings/socketpool/Socket.c | 28 ++-------------------------- shared-bindings/socketpool/Socket.h | 1 + 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/ports/esp32s2/mpconfigport.h b/ports/esp32s2/mpconfigport.h index d340bb4805..c06e63439c 100644 --- a/ports/esp32s2/mpconfigport.h +++ b/ports/esp32s2/mpconfigport.h @@ -31,7 +31,7 @@ #define CIRCUITPY_INTERNAL_NVM_SIZE (0) #define MICROPY_NLR_THUMB (0) -#define MICROPY_PY_UJSON (0) +#define MICROPY_PY_UJSON (1) #define MICROPY_USE_INTERNAL_PRINTF (0) #include "py/circuitpy_mpconfig.h" diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index f6f90ceb1f..64a051301c 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -155,32 +155,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket___exit___obj, 4, 4, //| """Closes this Socket and makes its resources available to its SocketPool.""" //| STATIC mp_obj_t socketpool_socket_close(mp_obj_t self_in) { - // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - - // // create new socket object - // // starts with empty NIC so that finaliser doesn't run close() method if accept() fails - // mod_network_socket_obj_t *socket2 = m_new_obj_with_finaliser(mod_network_socket_obj_t); - // socket2->base.type = &socket_type; - // socket2->nic = MP_OBJ_NULL; - // socket2->nic_type = NULL; - - // // accept incoming connection - // uint8_t ip[MOD_NETWORK_IPADDR_BUF_SIZE]; - // mp_uint_t port; - // int _errno; - // if (self->nic_type->accept(self, socket2, ip, &port, &_errno) != 0) { - // mp_raise_OSError(_errno); - // } - - // // new socket has valid state, so set the NIC to the same as parent - // socket2->nic = self->nic; - // socket2->nic_type = self->nic_type; - - // // make the return value - // mp_obj_tuple_t *client = MP_OBJ_TO_PTR(mp_obj_new_tuple(2, NULL)); - // client->items[0] = MP_OBJ_FROM_PTR(socket2); - // client->items[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG); - + socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_socketpool_socket_close(self); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(socketpool_socket_close_obj, socketpool_socket_close); diff --git a/shared-bindings/socketpool/Socket.h b/shared-bindings/socketpool/Socket.h index 94c939e7b8..a1aeccbe3e 100644 --- a/shared-bindings/socketpool/Socket.h +++ b/shared-bindings/socketpool/Socket.h @@ -35,5 +35,6 @@ void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t* self, mp_u bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self, const char* host, size_t hostlen, mp_int_t port); mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len); mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len); +void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKET_H From 1034cc12177d998df1c7f3381668040bb13ced58 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 14 Aug 2020 15:56:01 -0700 Subject: [PATCH 0659/1293] Add espidf module. --- ports/esp32s2/Makefile | 1 + ports/esp32s2/bindings/espidf/__init__.c | 79 ++++++++++++++++++++++++ ports/esp32s2/mpconfigport.mk | 1 + py/circuitpy_mpconfig.h | 8 +++ py/circuitpy_mpconfig.mk | 6 ++ 5 files changed, 95 insertions(+) create mode 100644 ports/esp32s2/bindings/espidf/__init__.c diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 142387f63e..ea9c685926 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -166,6 +166,7 @@ SRC_C += \ background.c \ fatfs_port.c \ mphalport.c \ + bindings/espidf/__init__.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ modules/$(CIRCUITPY_MODULE).c \ diff --git a/ports/esp32s2/bindings/espidf/__init__.c b/ports/esp32s2/bindings/espidf/__init__.c new file mode 100644 index 0000000000..11df76ec00 --- /dev/null +++ b/ports/esp32s2/bindings/espidf/__init__.c @@ -0,0 +1,79 @@ +/* + * 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 "py/obj.h" +#include "py/runtime.h" + +#include "esp-idf/components/heap/include/esp_heap_caps.h" + +//| """Direct access to a few ESP-IDF details. This module *should not* include any functionality +//| that could be implemented by other frameworks. It should only include ESP-IDF specific +//| things.""" + +//| def heap_caps_get_total_size() -> int: +//| """Return the total size of the ESP-IDF, which includes the CircuitPython heap.""" +//| ... +//| + +STATIC mp_obj_t espidf_heap_caps_get_total_size(void) { + return MP_OBJ_NEW_SMALL_INT(heap_caps_get_total_size(MALLOC_CAP_8BIT)); +} +MP_DEFINE_CONST_FUN_OBJ_0(espidf_heap_caps_get_total_size_obj, espidf_heap_caps_get_total_size); + +//| def heap_caps_get_free_size() -> int: +//| """Return total free memory in the ESP-IDF heap.""" +//| ... +//| + +STATIC mp_obj_t espidf_heap_caps_get_free_size(void) { + return MP_OBJ_NEW_SMALL_INT(heap_caps_get_free_size(MALLOC_CAP_8BIT)); +} +MP_DEFINE_CONST_FUN_OBJ_0(espidf_heap_caps_get_free_size_obj, espidf_heap_caps_get_free_size); + +//| def heap_caps_get_largest_free_block() -> int: +//| """Return the size of largest free memory block in the ESP-IDF heap.""" +//| ... +//| + +STATIC mp_obj_t espidf_heap_caps_get_largest_free_block(void) { + return MP_OBJ_NEW_SMALL_INT(heap_caps_get_largest_free_block(MALLOC_CAP_8BIT)); +} +MP_DEFINE_CONST_FUN_OBJ_0(espidf_heap_caps_get_largest_free_block_obj, espidf_heap_caps_get_largest_free_block); + +STATIC const mp_rom_map_elem_t espidf_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_espidf) }, + + { MP_ROM_QSTR(MP_QSTR_heap_caps_get_total_size), MP_ROM_PTR(&espidf_heap_caps_get_total_size_obj)}, + { MP_ROM_QSTR(MP_QSTR_heap_caps_get_free_size), MP_ROM_PTR(&espidf_heap_caps_get_free_size_obj)}, + { MP_ROM_QSTR(MP_QSTR_heap_caps_get_largest_free_block), MP_ROM_PTR(&espidf_heap_caps_get_largest_free_block_obj)}, +}; + +STATIC MP_DEFINE_CONST_DICT(espidf_module_globals, espidf_module_globals_table); + +const mp_obj_module_t espidf_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&espidf_module_globals, +}; diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 62d2da6079..5252714388 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -25,5 +25,6 @@ CIRCUITPY_RTC = 0 CIRCUITPY_NVM = 0 CIRCUITPY_USB_MIDI = 0 # We don't have enough endpoints to include MIDI. CIRCUITPY_WIFI = 1 +CIRCUITPY_ESPIDF = 1 CIRCUITPY_MODULE ?= none diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index b2543dcad8..b3fd8a05d6 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -363,6 +363,13 @@ extern const struct _mp_obj_module_t terminalio_module; #define TERMINALIO_MODULE #endif +#if CIRCUITPY_ESPIDF +extern const struct _mp_obj_module_t espidf_module; +#define ESPIDF_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_espidf),(mp_obj_t)&espidf_module }, +#else +#define ESPIDF_MODULE +#endif + #if CIRCUITPY_FRAMEBUFFERIO extern const struct _mp_obj_module_t framebufferio_module; #define FRAMEBUFFERIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_framebufferio), (mp_obj_t)&framebufferio_module }, @@ -750,6 +757,7 @@ extern const struct _mp_obj_module_t wifi_module; TERMINALIO_MODULE \ VECTORIO_MODULE \ ERRNO_MODULE \ + ESPIDF_MODULE \ FRAMEBUFFERIO_MODULE \ FREQUENCYIO_MODULE \ GAMEPAD_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 8b34dced24..b6fd805d35 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -95,6 +95,12 @@ CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO) CIRCUITPY_DISPLAYIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_DISPLAYIO=$(CIRCUITPY_DISPLAYIO) +# CIRCUITPY_ESPIDF is handled in the atmel-samd tree. +# Only for ESP32S chips. +# Assume not a ESP build. +CIRCUITPY_ESPIDF ?= 0 +CFLAGS += -DCIRCUITPY_ESPIDF=$(CIRCUITPY_ESPIDF) + ifeq ($(CIRCUITPY_DISPLAYIO),1) CIRCUITPY_FRAMEBUFFERIO ?= $(CIRCUITPY_FULL_BUILD) else From dcc42f6281ad928c6218acaab8e72bdf52038851 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 14 Aug 2020 17:03:29 -0700 Subject: [PATCH 0660/1293] Remove debug prints --- ports/esp32s2/common-hal/socketpool/Socket.c | 7 - ports/esp32s2/common-hal/wifi/Radio.c | 158 ++++++++---------- .../esp32s2/common-hal/wifi/ScannedNetworks.c | 8 - ports/esp32s2/common-hal/wifi/__init__.c | 28 +--- ports/esp32s2/supervisor/port.c | 10 -- shared-bindings/socketpool/__init__.c | 4 +- shared-bindings/ssl/__init__.c | 8 - 7 files changed, 73 insertions(+), 150 deletions(-) diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/esp32s2/common-hal/socketpool/Socket.c index 83bb455693..b9c6dca6ff 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.c +++ b/ports/esp32s2/common-hal/socketpool/Socket.c @@ -26,9 +26,6 @@ #include "shared-bindings/socketpool/Socket.h" -#include "esp_log.h" -static const char *TAG = "socket"; - void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t* self, mp_uint_t timeout_ms) { self->timeout_ms = timeout_ms; } @@ -38,20 +35,17 @@ bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self, const c // NULL and should still work. This makes regular TCP connections more memory expensive but TLS // should become more and more common. Therefore, we optimize for the TLS case. - ESP_LOGI(TAG, "connecting to %s:%d %p", host, port, self->ssl_context); esp_tls_cfg_t* tls_config = NULL; if (self->ssl_context != NULL) { tls_config = &self->ssl_context->ssl_config; } int result = esp_tls_conn_new_sync(host, hostlen, port, tls_config, self->tcp); - ESP_LOGI(TAG, "result %d", result); return result >= 0; } mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len) { size_t sent = esp_tls_conn_write(self->tcp, buf, len); - ESP_LOGI(TAG, "sent %d bytes", sent); if (sent < 0) { // raise an error } @@ -61,7 +55,6 @@ mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t* self, const mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len) { size_t received = esp_tls_conn_read(self->tcp, (void*) buf, len); - ESP_LOGI(TAG, "received %d bytes", received); if (received == 0) { // socket closed } diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index d4f17f2bb0..0f97565da0 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -38,99 +38,84 @@ #include "esp-idf/components/esp_wifi/include/esp_wifi.h" #include "esp-idf/components/lwip/include/apps/ping/ping_sock.h" -#include "esp_log.h" -static const char *TAG = "cp radio"; - static void start_station(wifi_radio_obj_t *self) { - if (self->sta_mode) { - return; - } - wifi_mode_t next_mode; - if (self->ap_mode) { - next_mode = WIFI_MODE_APSTA; - } else { - next_mode = WIFI_MODE_STA; - } - esp_wifi_set_mode(next_mode); + if (self->sta_mode) { + return; + } + wifi_mode_t next_mode; + if (self->ap_mode) { + next_mode = WIFI_MODE_APSTA; + } else { + next_mode = WIFI_MODE_STA; + } + esp_wifi_set_mode(next_mode); - esp_wifi_set_config(WIFI_MODE_STA, &self->sta_config); + esp_wifi_set_config(WIFI_MODE_STA, &self->sta_config); } bool common_hal_wifi_radio_get_enabled(wifi_radio_obj_t *self) { - return self->started; + return self->started; } void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled) { - if (self->started && !enabled) { - ESP_LOGI(TAG, "stop"); - if (self->current_scan != NULL) { - common_hal_wifi_radio_stop_scanning_networks(self); - } - ESP_ERROR_CHECK(esp_wifi_stop()); - self->started = false; - return; - } - if (!self->started && enabled) { - ESP_LOGI(TAG, "start"); - ESP_ERROR_CHECK(esp_wifi_start()); - self->started = true; - return; - } + if (self->started && !enabled) { + if (self->current_scan != NULL) { + common_hal_wifi_radio_stop_scanning_networks(self); + } + ESP_ERROR_CHECK(esp_wifi_stop()); + self->started = false; + return; + } + if (!self->started && enabled) { + ESP_ERROR_CHECK(esp_wifi_start()); + self->started = true; + return; + } } mp_obj_t common_hal_wifi_radio_get_mac_address(wifi_radio_obj_t *self) { - uint8_t mac[6]; - esp_wifi_get_mac(ESP_IF_WIFI_STA, mac); - return mp_const_none; + uint8_t mac[6]; + esp_wifi_get_mac(ESP_IF_WIFI_STA, mac); + return mp_const_none; } mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self) { - if (self->current_scan != NULL) { - mp_raise_RuntimeError(translate("Already scanning for wifi networks")); - } - // check enabled - start_station(self); + if (self->current_scan != NULL) { + mp_raise_RuntimeError(translate("Already scanning for wifi networks")); + } + // check enabled + start_station(self); - ESP_LOGI(TAG, "start scan"); - wifi_scannednetworks_obj_t *scan = m_new_obj(wifi_scannednetworks_obj_t); - self->current_scan = scan; - scan->base.type = &wifi_scannednetworks_type; - scan->start_channel = 1; - scan->end_channel = 11; - scan->radio_event_group = self->event_group_handle; - wifi_scannednetworks_scan_next_channel(scan); - return scan; + wifi_scannednetworks_obj_t *scan = m_new_obj(wifi_scannednetworks_obj_t); + self->current_scan = scan; + scan->base.type = &wifi_scannednetworks_type; + scan->start_channel = 1; + scan->end_channel = 11; + scan->radio_event_group = self->event_group_handle; + wifi_scannednetworks_scan_next_channel(scan); + return scan; } void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) { - // Free the memory used to store the found aps. - ESP_EARLY_LOGI(TAG, "stop scan"); - wifi_scannednetworks_deinit(self->current_scan); - self->current_scan = NULL; - ESP_EARLY_LOGI(TAG, "stop scan done"); + // Free the memory used to store the found aps. + wifi_scannednetworks_deinit(self->current_scan); + self->current_scan = NULL; } bool 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) { - // check enabled - wifi_config_t* config = &self->sta_config; - memcpy(&config->sta.ssid, ssid, ssid_len); - config->sta.ssid[ssid_len] = 0; - if (password_len > 0) { - memcpy(&config->sta.password, password, password_len); - } - config->sta.password[password_len] = 0; - config->sta.channel = channel; - ESP_EARLY_LOGI(TAG, "connecting to %s", config->sta.ssid); - esp_err_t result = esp_wifi_set_config(ESP_IF_WIFI_STA, config); - if (result != ESP_OK) { - ESP_EARLY_LOGI(TAG, "config fail %d", result); - } - result = esp_wifi_connect(); - if (result != ESP_OK) { - ESP_EARLY_LOGI(TAG, "connect fail %d", result); - } + // check enabled + wifi_config_t* config = &self->sta_config; + memcpy(&config->sta.ssid, ssid, ssid_len); + config->sta.ssid[ssid_len] = 0; + if (password_len > 0) { + memcpy(&config->sta.password, password, password_len); + } + config->sta.password[password_len] = 0; + config->sta.channel = channel; + esp_wifi_set_config(ESP_IF_WIFI_STA, config); + esp_wifi_connect(); - EventBits_t bits; + EventBits_t bits; do { RUN_BACKGROUND_TASKS; bits = xEventGroupWaitBits(self->event_group_handle, @@ -140,21 +125,18 @@ bool common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t* ssid, size_t 0); } while ((bits & (WIFI_CONNECTED_BIT | WIFI_DISCONNECTED_BIT)) == 0 && !mp_hal_is_interrupted()); if ((bits & WIFI_DISCONNECTED_BIT) != 0) { - return false; + return false; } - return true; + return true; } mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self) { - if (!esp_netif_is_netif_up(self->netif)) { - return mp_const_none; - } - esp_netif_ip_info_t ip_info; - esp_err_t result = esp_netif_get_ip_info(self->netif, &ip_info); - if (result != ESP_OK) { - ESP_EARLY_LOGI(TAG, "get ip fail %d", result); - } - return common_hal_ipaddress_new_ipv4address(ip_info.ip.addr); + if (!esp_netif_is_netif_up(self->netif)) { + return mp_const_none; + } + esp_netif_ip_info_t ip_info; + esp_netif_get_ip_info(self->netif, &ip_info); + return common_hal_ipaddress_new_ipv4address(ip_info.ip.addr); } mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address, mp_float_t timeout) { @@ -171,15 +153,15 @@ mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address, uint32_t received = 0; uint32_t total_time_ms = 0; while (received == 0 && total_time_ms < timeout_ms) { - RUN_BACKGROUND_TASKS; - esp_ping_get_profile(ping, ESP_PING_PROF_DURATION, &total_time_ms, sizeof(total_time_ms)); - esp_ping_get_profile(ping, ESP_PING_PROF_REPLY, &received, sizeof(received)); + RUN_BACKGROUND_TASKS; + esp_ping_get_profile(ping, ESP_PING_PROF_DURATION, &total_time_ms, sizeof(total_time_ms)); + esp_ping_get_profile(ping, ESP_PING_PROF_REPLY, &received, sizeof(received)); } - uint32_t elapsed_time = 0xffffffff; + uint32_t elapsed_time = 0xffffffff; if (received > 0) { - esp_ping_get_profile(ping, ESP_PING_PROF_TIMEGAP, &elapsed_time, sizeof(elapsed_time)); + esp_ping_get_profile(ping, ESP_PING_PROF_TIMEGAP, &elapsed_time, sizeof(elapsed_time)); } esp_ping_delete_session(ping); - return elapsed_time; + return elapsed_time; } diff --git a/ports/esp32s2/common-hal/wifi/ScannedNetworks.c b/ports/esp32s2/common-hal/wifi/ScannedNetworks.c index 060e13f8ea..c13fef0718 100644 --- a/ports/esp32s2/common-hal/wifi/ScannedNetworks.c +++ b/ports/esp32s2/common-hal/wifi/ScannedNetworks.c @@ -39,12 +39,8 @@ #include "esp-idf/components/esp_wifi/include/esp_wifi.h" -#include "esp_log.h" -static const char *TAG = "cp scannednetworks"; - static void wifi_scannednetworks_done(wifi_scannednetworks_obj_t *self) { self->done = true; - ESP_EARLY_LOGI(TAG, "free %x", self->results); if (self->results != NULL) { // Check to see if the heap is still active. If not, it'll be freed automatically. if (gc_alloc_possible()) { @@ -94,7 +90,6 @@ mp_obj_t common_hal_wifi_scannednetworks_next(wifi_scannednetworks_obj_t *self) } // We not have found any more results so we're done. if (self->done) { - ESP_LOGI(TAG, "return done"); return mp_const_none; } // If we need more space than we have, realloc. @@ -104,7 +99,6 @@ mp_obj_t common_hal_wifi_scannednetworks_next(wifi_scannednetworks_obj_t *self) self->max_results, self->total_results, true /* allow move */); - ESP_EARLY_LOGI(TAG, "alloc %x", results); if (results != NULL) { self->results = results; self->max_results = self->total_results; @@ -152,12 +146,10 @@ void wifi_scannednetworks_scan_next_channel(wifi_scannednetworks_obj_t *self) { wifi_scan_config_t config = { 0 }; config.channel = next_channel; if (next_channel == sizeof(scan_pattern)) { - ESP_LOGI(TAG, "scan done"); wifi_scannednetworks_done(self); } else { esp_err_t result = esp_wifi_scan_start(&config, false); if (result != ESP_OK) { - ESP_LOGI(TAG, "start failed 0x%x", result); wifi_scannednetworks_done(self); } else { self->scanning = true; diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index b9147496b9..95b182288e 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -31,9 +31,6 @@ #include "py/runtime.h" -#include "esp_log.h" -static const char *TAG = "cp wifi"; - #include "esp-idf/components/esp_wifi/include/esp_wifi.h" #include "esp-idf/components/heap/include/esp_heap_caps.h" @@ -42,31 +39,20 @@ wifi_radio_obj_t common_hal_wifi_radio_obj; static void event_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data) { - ESP_LOGI(TAG, "event %x", event_id); wifi_radio_obj_t* radio = arg; if (event_base == WIFI_EVENT) { if (event_id == WIFI_EVENT_SCAN_DONE) { - ESP_LOGI(TAG, "scan done"); xEventGroupSetBits(radio->event_group_handle, WIFI_SCAN_DONE_BIT); } else if (event_id == WIFI_EVENT_STA_START) { - ESP_LOGI(TAG, "station start"); - } else if (event_id == WIFI_EVENT_STA_STOP) { - ESP_LOGI(TAG, "station stop"); - } else if (event_id == WIFI_EVENT_STA_CONNECTED) { - ESP_LOGI(TAG, "connected to ap"); } else if (event_id == WIFI_EVENT_STA_DISCONNECTED) { - ESP_LOGI(TAG, "disconnected"); - wifi_event_sta_disconnected_t* d = (wifi_event_sta_disconnected_t*) event_data; - ESP_LOGI(TAG, "reason %d", d->reason); + // wifi_event_sta_disconnected_t* d = (wifi_event_sta_disconnected_t*) event_data; if (event_id != WIFI_REASON_ASSOC_LEAVE) { // reconnect } xEventGroupSetBits(radio->event_group_handle, WIFI_DISCONNECTED_BIT); } else if (event_id == WIFI_EVENT_STA_AUTHMODE_CHANGE) { - ESP_LOGI(TAG, "auth change"); - } } @@ -84,9 +70,6 @@ static void event_handler(void* arg, esp_event_base_t event_base, // ESP_LOGI(TAG,"connect to the AP fail"); // } else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) { - ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data; - ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip)); - // s_retry_num = 0; xEventGroupSetBits(radio->event_group_handle, WIFI_CONNECTED_BIT); } } @@ -94,17 +77,12 @@ static void event_handler(void* arg, esp_event_base_t event_base, static bool wifi_inited; void common_hal_wifi_init(void) { - ESP_EARLY_LOGI(TAG, "init"); - heap_caps_print_heap_info(MALLOC_CAP_8BIT); wifi_inited = true; common_hal_wifi_radio_obj.base.type = &wifi_radio_type; ESP_ERROR_CHECK(esp_netif_init()); - - ESP_EARLY_LOGI(TAG, "create event loop"); ESP_ERROR_CHECK(esp_event_loop_create_default()); - ESP_EARLY_LOGI(TAG, "create wifi sta"); wifi_radio_obj_t* self = &common_hal_wifi_radio_obj; self->netif = esp_netif_create_default_wifi_sta(); @@ -120,8 +98,6 @@ void common_hal_wifi_init(void) { self, &self->handler_instance_got_ip)); - - ESP_EARLY_LOGI(TAG, "wifi init"); wifi_init_config_t config = WIFI_INIT_CONFIG_DEFAULT(); esp_err_t result = esp_wifi_init(&config); if (result == ESP_ERR_NO_MEM) { @@ -129,12 +105,10 @@ void common_hal_wifi_init(void) { } else if (result != ESP_OK) { // handle this } - ESP_EARLY_LOGI(TAG, "enable radio"); common_hal_wifi_radio_set_enabled(self, true); } void wifi_reset(void) { - ESP_LOGI(TAG, "reset"); if (!wifi_inited) { return; } diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index bebecd8ae3..afd1234413 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -45,9 +45,6 @@ #include "esp-idf/components/heap/include/esp_heap_caps.h" -#include "esp_log.h" -static const char *TAG = "cp port"; - #define HEAP_SIZE (48 * 1024) STATIC esp_timer_handle_t _tick_timer; @@ -67,10 +64,6 @@ safe_mode_t port_init(void) { esp_timer_create(&args, &_tick_timer); heap = malloc(HEAP_SIZE); - if (heap == NULL) { - heap_caps_print_heap_info(MALLOC_CAP_8BIT); - ESP_LOGE(TAG, "failed to allocate heap"); - } never_reset_module_internal_pins(); return NO_SAFE_MODE; } @@ -92,7 +85,6 @@ void reset_port(void) { #if CIRCUITPY_WIFI wifi_reset(); #endif - heap_caps_print_heap_info(MALLOC_CAP_8BIT); } void reset_to_bootloader(void) { @@ -102,8 +94,6 @@ void reset_cpu(void) { } uint32_t *port_heap_get_bottom(void) { - - ESP_EARLY_LOGI(TAG, "heap %x", heap); return heap; } diff --git a/shared-bindings/socketpool/__init__.c b/shared-bindings/socketpool/__init__.c index 06d5be5cda..d3f8ba3028 100644 --- a/shared-bindings/socketpool/__init__.c +++ b/shared-bindings/socketpool/__init__.c @@ -33,8 +33,8 @@ #include "shared-bindings/socketpool/SocketPool.h" //| """ -//| The `ipaddress` module provides types for IP addresses. It is a subset of CPython's ipaddress -//| module. +//| The `socketpool` module provides sockets through a pool. The pools themselves +//| act like CPython's `socket` module. //| """ //| diff --git a/shared-bindings/ssl/__init__.c b/shared-bindings/ssl/__init__.c index fec4c76676..57f4e6f4af 100644 --- a/shared-bindings/ssl/__init__.c +++ b/shared-bindings/ssl/__init__.c @@ -56,14 +56,6 @@ STATIC const mp_rom_map_elem_t ssl_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_create_default_context), MP_ROM_PTR(&ssl_create_default_context_obj) }, { MP_ROM_QSTR(MP_QSTR_SSLContext), MP_ROM_PTR(&ssl_sslcontext_type) }, - - // class constants - // { MP_ROM_QSTR(MP_QSTR_AF_INET), MP_ROM_INT(SOCKETPOOL_AF_INET) }, - // { MP_ROM_QSTR(MP_QSTR_AF_INET6), MP_ROM_INT(SOCKETPOOL_AF_INET6) }, - - // { MP_ROM_QSTR(MP_QSTR_SOCK_STREAM), MP_ROM_INT(SOCKETPOOL_SOCK_STREAM) }, - // { MP_ROM_QSTR(MP_QSTR_SOCK_DGRAM), MP_ROM_INT(SOCKETPOOL_SOCK_DGRAM) }, - // { MP_ROM_QSTR(MP_QSTR_SOCK_RAW), MP_ROM_INT(SOCKETPOOL_SOCK_RAW) }, }; STATIC MP_DEFINE_CONST_DICT(ssl_globals, ssl_globals_table); From 9602ee6265ff20f6e075753bbb105578f680d519 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 18 Aug 2020 14:02:59 -0700 Subject: [PATCH 0661/1293] Disable wifi debug logging and memory log --- ports/esp32s2/sdkconfig.defaults | 9 +-------- supervisor/shared/memory.c | 4 ---- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/ports/esp32s2/sdkconfig.defaults b/ports/esp32s2/sdkconfig.defaults index 2faaa028c1..a50b61ebf4 100644 --- a/ports/esp32s2/sdkconfig.defaults +++ b/ports/esp32s2/sdkconfig.defaults @@ -354,14 +354,7 @@ CONFIG_ESP32_WIFI_RX_BA_WIN=6 # CONFIG_ESP32_WIFI_NVS_ENABLED is not set CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 -CONFIG_ESP32_WIFI_DEBUG_LOG_ENABLE=y -CONFIG_ESP32_WIFI_DEBUG_LOG_DEBUG=y -# CONFIG_ESP32_WIFI_DEBUG_LOG_VERBOSE is not set -# CONFIG_ESP32_WIFI_DEBUG_LOG_MODULE_ALL is not set -CONFIG_ESP32_WIFI_DEBUG_LOG_MODULE_WIFI=y -# CONFIG_ESP32_WIFI_DEBUG_LOG_MODULE_COEX is not set -# CONFIG_ESP32_WIFI_DEBUG_LOG_MODULE_MESH is not set -# CONFIG_ESP32_WIFI_DEBUG_LOG_SUBMODULE is not set +# CONFIG_ESP32_WIFI_DEBUG_LOG_ENABLE is not set CONFIG_ESP32_WIFI_IRAM_OPT=y CONFIG_ESP32_WIFI_RX_IRAM_OPT=y # CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE is not set diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c index 79bdeef9db..8ae8a16997 100755 --- a/supervisor/shared/memory.c +++ b/supervisor/shared/memory.c @@ -31,9 +31,6 @@ #include "supervisor/shared/display.h" -#include "esp_log.h" -static const char *TAG = "memory"; - #define CIRCUITPY_SUPERVISOR_ALLOC_COUNT (12) static supervisor_allocation allocations[CIRCUITPY_SUPERVISOR_ALLOC_COUNT]; @@ -42,7 +39,6 @@ uint32_t* low_address; uint32_t* high_address; void memory_init(void) { - ESP_LOGE(TAG, "memory init"); low_address = port_heap_get_bottom(); high_address = port_heap_get_top(); } From eb8b42aff1e887125dda56bafd2b52312c1c7e05 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 18 Aug 2020 17:06:59 -0700 Subject: [PATCH 0662/1293] Add basic error handling --- lib/tinyusb | 2 +- ports/esp32s2/bindings/espidf/__init__.c | 31 +++++++++++++ ports/esp32s2/bindings/espidf/__init__.h | 34 ++++++++++++++ ports/esp32s2/common-hal/socketpool/Socket.c | 29 ++++++++++-- ports/esp32s2/common-hal/socketpool/Socket.h | 1 + .../common-hal/socketpool/SocketPool.c | 21 ++++++++- py/modbuiltins.c | 3 ++ py/obj.h | 2 + py/objexcept.c | 10 ++-- py/runtime.c | 4 ++ py/runtime.h | 1 + shared-bindings/ipaddress/IPv4Address.c | 46 +++++++++++++------ shared-bindings/socketpool/Socket.c | 27 +++++++---- shared-bindings/socketpool/Socket.h | 2 + shared-bindings/socketpool/SocketPool.c | 10 +++- shared-bindings/socketpool/SocketPool.h | 2 + shared-bindings/ssl/SSLContext.c | 6 ++- shared-bindings/ssl/SSLContext.h | 11 ----- 18 files changed, 194 insertions(+), 48 deletions(-) create mode 100644 ports/esp32s2/bindings/espidf/__init__.h diff --git a/lib/tinyusb b/lib/tinyusb index 22100b252f..e90cf7a676 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit 22100b252fc2eb8f51ed407949645653c4880fd9 +Subproject commit e90cf7a676eddcbd9c35d2d99a0a9cd14686e2ce diff --git a/ports/esp32s2/bindings/espidf/__init__.c b/ports/esp32s2/bindings/espidf/__init__.c index 11df76ec00..7c3a8c713d 100644 --- a/ports/esp32s2/bindings/espidf/__init__.c +++ b/ports/esp32s2/bindings/espidf/__init__.c @@ -27,6 +27,8 @@ #include "py/obj.h" #include "py/runtime.h" +#include "bindings/espidf/__init__.h" + #include "esp-idf/components/heap/include/esp_heap_caps.h" //| """Direct access to a few ESP-IDF details. This module *should not* include any functionality @@ -63,12 +65,41 @@ STATIC mp_obj_t espidf_heap_caps_get_largest_free_block(void) { } MP_DEFINE_CONST_FUN_OBJ_0(espidf_heap_caps_get_largest_free_block_obj, espidf_heap_caps_get_largest_free_block); +//| class MemoryError(MemoryError): +//| """Raised when an ESP IDF memory allocation fails.""" +//| ... +//| +NORETURN void mp_raise_espidf_MemoryError(void) { + nlr_raise(mp_obj_new_exception(&mp_type_espidf_MemoryError)); +} + +void espidf_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) { + mp_print_kind_t k = kind & ~PRINT_EXC_SUBCLASS; + bool is_subclass = kind & PRINT_EXC_SUBCLASS; + if (!is_subclass && (k == PRINT_EXC)) { + mp_print_str(print, qstr_str(MP_OBJ_QSTR_VALUE(MP_QSTR_espidf))); + mp_print_str(print, "."); + } + mp_obj_exception_print(print, o_in, kind); +} + +const mp_obj_type_t mp_type_espidf_MemoryError = { + { &mp_type_type }, + .name = MP_QSTR_MemoryError, + .print = espidf_exception_print, + .make_new = mp_obj_exception_make_new, + .attr = mp_obj_exception_attr, + .parent = &mp_type_MemoryError, +}; + STATIC const mp_rom_map_elem_t espidf_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_espidf) }, { MP_ROM_QSTR(MP_QSTR_heap_caps_get_total_size), MP_ROM_PTR(&espidf_heap_caps_get_total_size_obj)}, { MP_ROM_QSTR(MP_QSTR_heap_caps_get_free_size), MP_ROM_PTR(&espidf_heap_caps_get_free_size_obj)}, { MP_ROM_QSTR(MP_QSTR_heap_caps_get_largest_free_block), MP_ROM_PTR(&espidf_heap_caps_get_largest_free_block_obj)}, + + { MP_ROM_QSTR(MP_QSTR_MemoryError), MP_ROM_PTR(&mp_type_espidf_MemoryError) }, }; STATIC MP_DEFINE_CONST_DICT(espidf_module_globals, espidf_module_globals_table); diff --git a/ports/esp32s2/bindings/espidf/__init__.h b/ports/esp32s2/bindings/espidf/__init__.h new file mode 100644 index 0000000000..356c1c8140 --- /dev/null +++ b/ports/esp32s2/bindings/espidf/__init__.h @@ -0,0 +1,34 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_BINDINGS_ESPIDF___INIT___H +#define MICROPY_INCLUDED_ESP32S2_BINDINGS_ESPIDF___INIT___H + +extern const mp_obj_type_t mp_type_espidf_MemoryError; + +NORETURN void mp_raise_espidf_MemoryError(void); + +#endif // MICROPY_INCLUDED_ESP32S2_BINDINGS_ESPIDF___INIT___H diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/esp32s2/common-hal/socketpool/Socket.c index b9c6dca6ff..36018b3d14 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.c +++ b/ports/esp32s2/common-hal/socketpool/Socket.c @@ -26,6 +26,9 @@ #include "shared-bindings/socketpool/Socket.h" +#include "py/mperrno.h" +#include "py/runtime.h" + void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t* self, mp_uint_t timeout_ms) { self->timeout_ms = timeout_ms; } @@ -40,14 +43,26 @@ bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self, const c tls_config = &self->ssl_context->ssl_config; } int result = esp_tls_conn_new_sync(host, hostlen, port, tls_config, self->tcp); - return result >= 0; + self->connected = result >= 0; + if (result < 0) { + int esp_tls_code; + esp_tls_get_and_clear_last_error(self->tcp->error_handle, &esp_tls_code, NULL); + + // mp_raise_espidf_MemoryError + mp_raise_OSError_msg_varg(translate("Unhandled ESP TLS error %d"), esp_tls_code); + } + return self->connected; +} + +bool common_hal_socketpool_socket_get_connected(socketpool_socket_obj_t* self) { + return self->connected; } mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len) { size_t sent = esp_tls_conn_write(self->tcp, buf, len); if (sent < 0) { - // raise an error + mp_raise_OSError(MP_ENOTCONN); } return sent; } @@ -57,14 +72,18 @@ mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, if (received == 0) { // socket closed + common_hal_socketpool_socket_close(self); } if (received < 0) { - // raise an error + mp_raise_BrokenPipeError(); } return received; } void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self) { + if (self->connected) { + self->connected = false; + } if (self->tcp != NULL) { int status = esp_tls_conn_destroy(self->tcp); @@ -74,3 +93,7 @@ void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self) { self->tcp = NULL; } } + +bool common_hal_socketpool_socket_get_closed(socketpool_socket_obj_t* self) { + return self->tcp == NULL; +} diff --git a/ports/esp32s2/common-hal/socketpool/Socket.h b/ports/esp32s2/common-hal/socketpool/Socket.h index ba832faac2..c23dd171cf 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.h +++ b/ports/esp32s2/common-hal/socketpool/Socket.h @@ -37,6 +37,7 @@ typedef struct { mp_obj_base_t base; int num; + bool connected; esp_tls_t* tcp; ssl_sslcontext_obj_t* ssl_context; socketpool_socketpool_obj_t* pool; diff --git a/ports/esp32s2/common-hal/socketpool/SocketPool.c b/ports/esp32s2/common-hal/socketpool/SocketPool.c index 0b9c1776bf..2af5bf7221 100644 --- a/ports/esp32s2/common-hal/socketpool/SocketPool.c +++ b/ports/esp32s2/common-hal/socketpool/SocketPool.c @@ -27,9 +27,19 @@ #include "shared-bindings/socketpool/SocketPool.h" #include "py/runtime.h" +#include "shared-bindings/wifi/__init__.h" #include "esp-idf/components/lwip/lwip/src/include/lwip/netdb.h" +#include "bindings/espidf/__init__.h" + + +void common_hal_socketpool_socketpool_construct(socketpool_socketpool_obj_t* self, mp_obj_t radio) { + if (radio != MP_OBJ_FROM_PTR(&common_hal_wifi_radio_obj)) { + mp_raise_ValueError(translate("SocketPool can only be used with wifi.radio.")); + } +} + socketpool_socket_obj_t* common_hal_socketpool_socket(socketpool_socketpool_obj_t* self, socketpool_socketpool_addressfamily_t family, socketpool_socketpool_sock_t type) { @@ -52,12 +62,21 @@ socketpool_socket_obj_t* common_hal_socketpool_socket(socketpool_socketpool_obj_ socket_type = SOCK_RAW; } + if (socket_type == SOCK_DGRAM || socket_type == SOCK_RAW || + addr_family == AF_INET6 || ipproto == IPPROTO_IPV6) { + mp_raise_NotImplementedError(translate("Only IPv4 SOCK_STREAM sockets supported.")); + } + int socknum = -1; esp_tls_t* tcp_handle = NULL; if (socket_type == SOCK_DGRAM || socket_type == SOCK_RAW) { - socknum = lwip_socket(addr_family, socket_type, ipproto); + // socknum = lwip_socket(addr_family, socket_type, ipproto); } else { tcp_handle = esp_tls_init(); + + if (tcp_handle == NULL) { + mp_raise_espidf_MemoryError(); + } } if (socknum < 0 && tcp_handle == NULL) { mp_raise_RuntimeError(translate("Out of sockets")); diff --git a/py/modbuiltins.c b/py/modbuiltins.c index 905c3471f1..41e1d4e488 100644 --- a/py/modbuiltins.c +++ b/py/modbuiltins.c @@ -726,6 +726,9 @@ STATIC const mp_rom_map_elem_t mp_module_builtins_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_NameError), MP_ROM_PTR(&mp_type_NameError) }, { MP_ROM_QSTR(MP_QSTR_NotImplementedError), MP_ROM_PTR(&mp_type_NotImplementedError) }, { MP_ROM_QSTR(MP_QSTR_OSError), MP_ROM_PTR(&mp_type_OSError) }, + { MP_ROM_QSTR(MP_QSTR_TimeoutError), MP_ROM_PTR(&mp_type_TimeoutError) }, + { MP_ROM_QSTR(MP_QSTR_ConnectionError), MP_ROM_PTR(&mp_type_ConnectionError) }, + { MP_ROM_QSTR(MP_QSTR_BrokenPipeError), MP_ROM_PTR(&mp_type_BrokenPipeError) }, { MP_ROM_QSTR(MP_QSTR_OverflowError), MP_ROM_PTR(&mp_type_OverflowError) }, { MP_ROM_QSTR(MP_QSTR_RuntimeError), MP_ROM_PTR(&mp_type_RuntimeError) }, #if MICROPY_PY_ASYNC_AWAIT diff --git a/py/obj.h b/py/obj.h index e9d867f77b..c5ef74ef3f 100644 --- a/py/obj.h +++ b/py/obj.h @@ -604,6 +604,8 @@ extern const mp_obj_type_t mp_type_NameError; extern const mp_obj_type_t mp_type_NotImplementedError; extern const mp_obj_type_t mp_type_OSError; extern const mp_obj_type_t mp_type_TimeoutError; +extern const mp_obj_type_t mp_type_ConnectionError; +extern const mp_obj_type_t mp_type_BrokenPipeError; extern const mp_obj_type_t mp_type_OverflowError; extern const mp_obj_type_t mp_type_RuntimeError; extern const mp_obj_type_t mp_type_StopAsyncIteration; diff --git a/py/objexcept.c b/py/objexcept.c index e3b953543e..01ba6da9c4 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -282,15 +282,17 @@ MP_DEFINE_EXCEPTION(Exception, BaseException) MP_DEFINE_EXCEPTION(UnboundLocalError, NameError) */ MP_DEFINE_EXCEPTION(OSError, Exception) - MP_DEFINE_EXCEPTION(TimeoutError, OSError) - /* - MP_DEFINE_EXCEPTION(BlockingIOError, OSError) - MP_DEFINE_EXCEPTION(ChildProcessError, OSError) + MP_DEFINE_EXCEPTION(TimeoutError, OSError) MP_DEFINE_EXCEPTION(ConnectionError, OSError) MP_DEFINE_EXCEPTION(BrokenPipeError, ConnectionError) + /* MP_DEFINE_EXCEPTION(ConnectionAbortedError, ConnectionError) MP_DEFINE_EXCEPTION(ConnectionRefusedError, ConnectionError) MP_DEFINE_EXCEPTION(ConnectionResetError, ConnectionError) + */ + /* + MP_DEFINE_EXCEPTION(BlockingIOError, OSError) + MP_DEFINE_EXCEPTION(ChildProcessError, OSError) MP_DEFINE_EXCEPTION(InterruptedError, OSError) MP_DEFINE_EXCEPTION(IsADirectoryError, OSError) MP_DEFINE_EXCEPTION(NotADirectoryError, OSError) diff --git a/py/runtime.c b/py/runtime.c index f9ef7819d1..216432ea42 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -1602,6 +1602,10 @@ NORETURN void mp_raise_OSError_msg_varg(const compressed_string_t *fmt, ...) { va_end(argptr); } +NORETURN void mp_raise_BrokenPipeError(void) { + nlr_raise(mp_obj_new_exception_arg1(&mp_type_BrokenPipeError, MP_OBJ_NEW_SMALL_INT(MP_EPIPE))); +} + NORETURN void mp_raise_NotImplementedError(const compressed_string_t *msg) { mp_raise_msg(&mp_type_NotImplementedError, msg); } diff --git a/py/runtime.h b/py/runtime.h index dbc04b94ec..c5d07c4175 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -166,6 +166,7 @@ NORETURN void mp_raise_OSError(int errno_); NORETURN void mp_raise_OSError_errno_str(int errno_, mp_obj_t str); NORETURN void mp_raise_OSError_msg(const compressed_string_t *msg); NORETURN void mp_raise_OSError_msg_varg(const compressed_string_t *fmt, ...); +NORETURN void mp_raise_BrokenPipeError(void); 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, ...); diff --git a/shared-bindings/ipaddress/IPv4Address.c b/shared-bindings/ipaddress/IPv4Address.c index 3cef7516df..29536dfa43 100644 --- a/shared-bindings/ipaddress/IPv4Address.c +++ b/shared-bindings/ipaddress/IPv4Address.c @@ -25,22 +25,24 @@ * THE SOFTWARE. */ +#include "shared-bindings/ipaddress/IPv4Address.h" + #include #include #include "py/objproperty.h" #include "py/objstr.h" #include "py/runtime.h" -#include "shared-bindings/ipaddress/IPv4Address.h" +#include "shared-bindings/ipaddress/__init__.h" //| class IPv4Address: //| """Encapsulates an IPv4 address.""" //| -//| def __init__(self, address: Union[str, int]) -> None: -//| """Create a new Address object encapsulating the address value. +//| def __init__(self, address: Union[str, bytes]) -> None: +//| """Create a new IPv4Address object encapsulating the address value. //| -//| The value itself can be one of:""" +//| The value itself can either be bytes or a string formatted address."" //| ... //| STATIC mp_obj_t ipaddress_ipv4address_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -52,17 +54,33 @@ STATIC mp_obj_t ipaddress_ipv4address_make_new(const mp_obj_type_t *type, size_t mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + const mp_obj_t address = args[ARG_address].u_obj; + + uint32_t value; + uint8_t* buf = NULL; + if (mp_obj_get_int_maybe(address, (mp_int_t*) &value)) { + // We're done. + buf = (uint8_t*) value; + } else if (MP_OBJ_IS_STR(address)) { + GET_STR_DATA_LEN(address, str_data, str_len); + if (!ipaddress_parse_ipv4address((const char*) str_data, str_len, &value)) { + mp_raise_ValueError(translate("Not a valid IP string.")); + } + } else { + mp_buffer_info_t buf_info; + if (mp_get_buffer(address, &buf_info, MP_BUFFER_READ)) { + if (buf_info.len != 4) { + mp_raise_ValueError_varg(translate("Address must be %d bytes long"), 4); + } + buf = buf_info.buf; + } + } + + ipaddress_ipv4address_obj_t *self = m_new_obj(ipaddress_ipv4address_obj_t); self->base.type = &ipaddress_ipv4address_type; - const mp_obj_t address = args[ARG_address].u_obj; - mp_buffer_info_t buf_info; - mp_get_buffer_raise(address, &buf_info, MP_BUFFER_READ); - if (buf_info.len != 4) { - mp_raise_ValueError_varg(translate("Address must be %d bytes long"), 4); - } - - common_hal_ipaddress_ipv4address_construct(self, buf_info.buf, buf_info.len); + common_hal_ipaddress_ipv4address_construct(self, buf, 4); return MP_OBJ_FROM_PTR(self); } @@ -108,7 +126,7 @@ const mp_obj_property_t ipaddress_ipv4address_version_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def __eq__(self, other: Address) -> bool: +//| def __eq__(self, other: IPv4Address) -> bool: //| """Two Address objects are equal if their addresses and address types are equal.""" //| ... //| @@ -133,7 +151,7 @@ STATIC mp_obj_t ipaddress_ipv4address_binary_op(mp_binary_op_t op, mp_obj_t lhs_ } //| def __hash__(self) -> int: -//| """Returns a hash for the Address data.""" +//| """Returns a hash for the IPv4Address data.""" //| ... //| STATIC mp_obj_t ipaddress_ipv4address_unary_op(mp_unary_op_t op, mp_obj_t self_in) { diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index 64a051301c..ddead95078 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -57,7 +57,7 @@ //| STATIC mp_obj_t socketpool_socket___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; - // common_hal_pulseio_pwmout_deinit(args[0]); + common_hal_socketpool_socket_close(args[0]); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket___exit___obj, 4, 4, socketpool_socket___exit__); @@ -197,15 +197,18 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_connect_obj, socketpool_socke STATIC mp_obj_t socketpool_socket_send(mp_obj_t self_in, mp_obj_t buf_in) { socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); - // if (self->nic == MP_OBJ_NULL) { - // // not connected - // mp_raise_OSError(MP_EPIPE); - // } + if (common_hal_socketpool_socket_get_closed(self)) { + // Bad file number. + mp_raise_OSError(MP_EBADF); + } + if (!common_hal_socketpool_socket_get_connected(self)) { + mp_raise_BrokenPipeError(); + } mp_buffer_info_t bufinfo; mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); mp_int_t ret = common_hal_socketpool_socket_send(self, bufinfo.buf, bufinfo.len); if (ret == -1) { - mp_raise_OSError(0); + mp_raise_BrokenPipeError(); } return mp_obj_new_int_from_uint(ret); } @@ -241,10 +244,14 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_send_obj, socketpool_socket_s STATIC mp_obj_t socketpool_socket_recv_into(size_t n_args, const mp_obj_t *args) { socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(args[0]); - // if (self->nic == MP_OBJ_NULL) { - // // not connected - // mp_raise_OSError(MP_ENOTCONN); - // } + if (common_hal_socketpool_socket_get_closed(self)) { + // Bad file number. + mp_raise_OSError(MP_EBADF); + } + if (!common_hal_socketpool_socket_get_connected(self)) { + // not connected + mp_raise_OSError(MP_ENOTCONN); + } mp_buffer_info_t bufinfo; mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_WRITE); mp_int_t len = bufinfo.len; diff --git a/shared-bindings/socketpool/Socket.h b/shared-bindings/socketpool/Socket.h index a1aeccbe3e..4597aed38d 100644 --- a/shared-bindings/socketpool/Socket.h +++ b/shared-bindings/socketpool/Socket.h @@ -36,5 +36,7 @@ bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self, const c mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len); mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len); void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self); +bool common_hal_socketpool_socket_get_closed(socketpool_socket_obj_t* self); +bool common_hal_socketpool_socket_get_connected(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 2be071c789..f8812f61f1 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -38,15 +38,21 @@ #include "shared-bindings/socketpool/SocketPool.h" //| class SocketPool: +//| """A pool of socket resources available for the given radio. Only one +//| SocketPool can be created for each radio. +//| +//| SocketPool should be used in place of CPython's socket which provides +//| a pool of sockets provided by the underlying OS.""" //| STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { - mp_arg_check_num(n_args, kw_args, 0, 4, false); + mp_arg_check_num(n_args, kw_args, 1, 1, false); socketpool_socketpool_obj_t *s = m_new_obj_with_finaliser(socketpool_socketpool_obj_t); s->base.type = &socketpool_socketpool_type; + mp_obj_t radio = args[1]; - // common_hal_socketpool_socketpool_construct(s, ); + common_hal_socketpool_socketpool_construct(s, radio); return MP_OBJ_FROM_PTR(s); } diff --git a/shared-bindings/socketpool/SocketPool.h b/shared-bindings/socketpool/SocketPool.h index 42bd885185..b007aad8f4 100644 --- a/shared-bindings/socketpool/SocketPool.h +++ b/shared-bindings/socketpool/SocketPool.h @@ -44,6 +44,8 @@ typedef enum { SOCKETPOOL_AF_INET6 } socketpool_socketpool_addressfamily_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, socketpool_socketpool_addressfamily_t family, socketpool_socketpool_sock_t type); diff --git a/shared-bindings/ssl/SSLContext.c b/shared-bindings/ssl/SSLContext.c index d47baf3455..5d44dc0f54 100644 --- a/shared-bindings/ssl/SSLContext.c +++ b/shared-bindings/ssl/SSLContext.c @@ -3,8 +3,7 @@ * * The MIT License (MIT) * - * SPDX-FileCopyrightText: Copyright (c) 2014 Damien P. George - * 2018 Nick Moore for Adafruit Industries + * 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 @@ -36,6 +35,9 @@ #include "shared-bindings/ssl/SSLContext.h" //| class SSLContext: +//| """Settings related to SSL that can be applied to a socket by wrapping it. +//| This is useful to provide SSL certificates to specific connections +//| rather than all of them.""" //| STATIC mp_obj_t ssl_sslcontext_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { diff --git a/shared-bindings/ssl/SSLContext.h b/shared-bindings/ssl/SSLContext.h index 3bb1391164..f7f985af70 100644 --- a/shared-bindings/ssl/SSLContext.h +++ b/shared-bindings/ssl/SSLContext.h @@ -33,17 +33,6 @@ extern const mp_obj_type_t ssl_sslcontext_type; -// typedef enum { -// SOCKETPOOL_SOCK_STREAM, -// SOCKETPOOL_SOCK_DGRAM, -// SOCKETPOOL_SOCK_RAW -// } socketpool_socketpool_sock_t; - -// typedef enum { -// SOCKETPOOL_AF_INET, -// SOCKETPOOL_AF_INET6 -// } socketpool_socketpool_addressfamily_t; - void common_hal_ssl_sslcontext_construct(ssl_sslcontext_obj_t* self); socketpool_socket_obj_t* common_hal_ssl_sslcontext_wrap_socket(ssl_sslcontext_obj_t* self, From 23aefe9509f7c58acd53d96b5d26a90b7b5b15db Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 19 Aug 2020 16:47:20 -0500 Subject: [PATCH 0663/1293] Add usb-endpoint-count checking .. however, the number of endpoints is only set for SAMD (8). Other ports need to set the value. Otherwise, the build will show the message ``` Unable to check whether maximum number of endpoints is respected ``` --- ports/atmel-samd/mpconfigport.mk | 2 ++ supervisor/supervisor.mk | 5 +++++ tools/gen_usb_descriptor.py | 11 +++++++++++ 3 files changed, 18 insertions(+) diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 3fecf867e0..a16daf4b00 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -91,3 +91,5 @@ endif # samd51 INTERNAL_LIBM = 1 USB_SERIAL_NUMBER_LENGTH = 32 + +USB_NUM_EP = 8 diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 25b240036d..c876a11cce 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -171,6 +171,10 @@ ifndef USB_MIDI_EP_NUM_IN USB_MIDI_EP_NUM_IN = 0 endif +ifndef USB_NUM_EP +USB_NUM_EP = 0 +endif + USB_DESCRIPTOR_ARGS = \ --manufacturer $(USB_MANUFACTURER)\ --product $(USB_PRODUCT)\ @@ -180,6 +184,7 @@ USB_DESCRIPTOR_ARGS = \ --interface_name $(USB_INTERFACE_NAME)\ --devices $(USB_DEVICES)\ --hid_devices $(USB_HID_DEVICES)\ + --max_ep $(USB_NUM_EP) \ --cdc_ep_num_notification $(USB_CDC_EP_NUM_NOTIFICATION)\ --cdc_ep_num_data_out $(USB_CDC_EP_NUM_DATA_OUT)\ --cdc_ep_num_data_in $(USB_CDC_EP_NUM_DATA_IN)\ diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index fb91fd3345..baee8cad7b 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -62,6 +62,8 @@ parser.add_argument('--midi_ep_num_out', type=int, default=0, help='endpoint number of MIDI OUT') parser.add_argument('--midi_ep_num_in', type=int, default=0, help='endpoint number of MIDI IN') +parser.add_argument('--max_ep', type=int, default=0, + help='total number of endpoints available') parser.add_argument('--output_c_file', type=argparse.FileType('w', encoding='UTF-8'), required=True) parser.add_argument('--output_h_file', type=argparse.FileType('w', encoding='UTF-8'), required=True) @@ -376,6 +378,15 @@ if 'AUDIO' in args.devices: # interface cross-references. interfaces = util.join_interfaces(interfaces_to_join, renumber_endpoints=args.renumber_endpoints) +if args.max_ep != 0: + for interface in interfaces: + for subdescriptor in interface.subdescriptors: + endpoint_address = getattr(subdescriptor, 'bEndpointAddress', 0) & 0x7f + if endpoint_address > args.max_ep: + raise ValueError("Endpoint address %d of %s may not exceed %d" % (endpoint_address & 0x7f, interface.description, args.max_ep)) +else: + print("Unable to check whether maximum number of endpoints is respected", file=sys.stderr) + # Now adjust the CDC interface cross-references. cdc_union.bMasterInterface = cdc_comm_interface.bInterfaceNumber From 80b15f6b3b8bc513e8edcec48a0c97205be27fd3 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 19 Aug 2020 17:51:33 -0700 Subject: [PATCH 0664/1293] Add error handling w/temp debug logs --- ports/esp32s2/common-hal/socketpool/Socket.c | 43 +++++++++++++++++--- ports/esp32s2/common-hal/wifi/Radio.c | 5 +++ ports/esp32s2/common-hal/wifi/__init__.c | 12 +++++- shared-bindings/socketpool/Socket.c | 9 ++++ shared-bindings/socketpool/SocketPool.c | 4 ++ shared-bindings/wifi/Radio.c | 6 ++- 6 files changed, 71 insertions(+), 8 deletions(-) diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/esp32s2/common-hal/socketpool/Socket.c index 36018b3d14..074d9885f3 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.c +++ b/ports/esp32s2/common-hal/socketpool/Socket.c @@ -26,8 +26,13 @@ #include "shared-bindings/socketpool/Socket.h" +#include "lib/utils/interrupt_char.h" #include "py/mperrno.h" #include "py/runtime.h" +#include "supervisor/shared/tick.h" + +#include "esp_log.h" +static const char* TAG = "socket"; void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t* self, mp_uint_t timeout_ms) { self->timeout_ms = timeout_ms; @@ -43,13 +48,15 @@ bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self, const c tls_config = &self->ssl_context->ssl_config; } int result = esp_tls_conn_new_sync(host, hostlen, port, tls_config, self->tcp); + ESP_EARLY_LOGW(TAG, "connect result %d", result); self->connected = result >= 0; if (result < 0) { int esp_tls_code; - esp_tls_get_and_clear_last_error(self->tcp->error_handle, &esp_tls_code, NULL); + int flags; + esp_err_t err = esp_tls_get_and_clear_last_error(self->tcp->error_handle, &esp_tls_code, &flags); // mp_raise_espidf_MemoryError - mp_raise_OSError_msg_varg(translate("Unhandled ESP TLS error %d"), esp_tls_code); + mp_raise_OSError_msg_varg(translate("Unhandled ESP TLS error %d %d %x"), esp_tls_code, flags, err); } return self->connected; } @@ -68,19 +75,44 @@ mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t* self, const } mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len) { - size_t received = esp_tls_conn_read(self->tcp, (void*) buf, len); + size_t received = 0; + ssize_t last_read = 1; + uint64_t start_ticks = supervisor_ticks_ms64(); + while (received < len && + last_read > 0 && + (self->timeout_ms == 0 || supervisor_ticks_ms64() - start_ticks <= self->timeout_ms) && + !mp_hal_is_interrupted()) { + RUN_BACKGROUND_TASKS; + size_t available = esp_tls_get_bytes_avail(self->tcp); + ESP_EARLY_LOGW(TAG, "available %d", available); + size_t remaining = len - received; + if (available > remaining) { + available = remaining; + } + if (true || available > 0) { + if (available == 0) { + available = len - received; + } + last_read = esp_tls_conn_read(self->tcp, (void*) buf + received, available); + ESP_EARLY_LOGW(TAG, "read %d out of %d", last_read, available); + received += last_read; + } + } - if (received == 0) { + if (last_read == 0) { // socket closed + ESP_EARLY_LOGW(TAG, "receive close %d %d", received, len); common_hal_socketpool_socket_close(self); } - if (received < 0) { + if (last_read < 0) { + // ESP_EARLY_LOGI(TAG, "received %d", received); mp_raise_BrokenPipeError(); } return received; } void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self) { + // ESP_EARLY_LOGW(TAG, "close"); if (self->connected) { self->connected = false; } @@ -95,5 +127,6 @@ void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self) { } bool common_hal_socketpool_socket_get_closed(socketpool_socket_obj_t* self) { + // ESP_EARLY_LOGW(TAG, "tcp %p", self->tcp); return self->tcp == NULL; } diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index 0f97565da0..be8e7e6d9f 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -38,6 +38,9 @@ #include "esp-idf/components/esp_wifi/include/esp_wifi.h" #include "esp-idf/components/lwip/include/apps/ping/ping_sock.h" +#include "esp_log.h" +static const char* TAG = "radio"; + static void start_station(wifi_radio_obj_t *self) { if (self->sta_mode) { return; @@ -160,6 +163,8 @@ mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address, uint32_t elapsed_time = 0xffffffff; if (received > 0) { esp_ping_get_profile(ping, ESP_PING_PROF_TIMEGAP, &elapsed_time, sizeof(elapsed_time)); + } else { + ESP_EARLY_LOGW(TAG, "received none - time %d timeout %d", total_time_ms, timeout_ms); } esp_ping_delete_session(ping); diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index 95b182288e..f845e092fc 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -37,6 +37,9 @@ wifi_radio_obj_t common_hal_wifi_radio_obj; +#include "esp_log.h" +static const char* TAG = "wifi"; + static void event_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data) { wifi_radio_obj_t* radio = arg; @@ -46,11 +49,15 @@ static void event_handler(void* arg, esp_event_base_t event_base, } else if (event_id == WIFI_EVENT_STA_START) { } else if (event_id == WIFI_EVENT_STA_STOP) { } else if (event_id == WIFI_EVENT_STA_CONNECTED) { + ESP_EARLY_LOGW(TAG, "connected"); } else if (event_id == WIFI_EVENT_STA_DISCONNECTED) { - // wifi_event_sta_disconnected_t* d = (wifi_event_sta_disconnected_t*) event_data; - if (event_id != WIFI_REASON_ASSOC_LEAVE) { + ESP_EARLY_LOGW(TAG, "disconnected"); + wifi_event_sta_disconnected_t* d = (wifi_event_sta_disconnected_t*) event_data; + uint8_t reason = d->reason; + if (reason != WIFI_REASON_ASSOC_LEAVE) { // reconnect } + ESP_EARLY_LOGW(TAG, "reason %d 0x%02x", reason, reason); xEventGroupSetBits(radio->event_group_handle, WIFI_DISCONNECTED_BIT); } else if (event_id == WIFI_EVENT_STA_AUTHMODE_CHANGE) { } @@ -70,6 +77,7 @@ static void event_handler(void* arg, esp_event_base_t event_base, // ESP_LOGI(TAG,"connect to the AP fail"); // } else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) { + ESP_EARLY_LOGW(TAG, "got ip"); xEventGroupSetBits(radio->event_group_handle, WIFI_CONNECTED_BIT); } } diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index ddead95078..932e8e856c 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -36,6 +36,9 @@ #include "py/runtime.h" #include "py/mperrno.h" +#include "esp_log.h" +static const char* TAG = "socket binding"; + //| class Socket: //| """TCP, UDP and RAW socket. Cannot be created directly. Instead, call //| `SocketPool.socket()`. @@ -180,6 +183,7 @@ STATIC mp_obj_t socketpool_socket_connect(mp_obj_t self_in, mp_obj_t addr_in) { bool ok = common_hal_socketpool_socket_connect(self, host, hostlen, port); if (!ok) { + ESP_EARLY_LOGW(TAG, "socket connect failed"); mp_raise_OSError(0); } @@ -262,6 +266,11 @@ STATIC mp_obj_t socketpool_socket_recv_into(size_t n_args, const mp_obj_t *args) } } + if (len == 0) { + ESP_EARLY_LOGW(TAG, "len 0"); + mp_raise_OSError(0); + } + mp_int_t ret = common_hal_socketpool_socket_recv_into(self, (byte*)bufinfo.buf, len); return mp_obj_new_int_from_uint(ret); } diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index f8812f61f1..579a4824c8 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -37,6 +37,9 @@ #include "shared-bindings/socketpool/Socket.h" #include "shared-bindings/socketpool/SocketPool.h" +#include "esp_log.h" +static const char* TAG = "socketpool binding"; + //| class SocketPool: //| """A pool of socket resources available for the given radio. Only one //| SocketPool can be created for each radio. @@ -119,6 +122,7 @@ STATIC mp_obj_t socketpool_socketpool_getaddrinfo(size_t n_args, const mp_obj_t } if (ip_str == mp_const_none) { + ESP_EARLY_LOGW(TAG, "no ip str"); mp_raise_OSError(0); } diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 260a280c2b..6fd0c33744 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -159,7 +159,8 @@ const mp_obj_property_t wifi_radio_ipv4_address_obj = { }; //| def ping(self, ip, *, timeout: float = 0.5) -> float: -//| """Ping an IP to test connectivity. Returns echo time in seconds.""" +//| """Ping an IP to test connectivity. Returns echo time in seconds. +//| Returns None when it times out.""" //| ... //| STATIC mp_obj_t wifi_radio_ping(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -179,6 +180,9 @@ STATIC mp_obj_t wifi_radio_ping(size_t n_args, const mp_obj_t *pos_args, mp_map_ } mp_int_t time_ms = common_hal_wifi_radio_ping(self, args[ARG_ip].u_obj, timeout); + if (time_ms == -1) { + return mp_const_none; + } return mp_obj_new_float(time_ms / 1000.0); } From ebabc5db37f1c8e86c099f0af386d56823eff431 Mon Sep 17 00:00:00 2001 From: George Waters Date: Wed, 19 Aug 2020 23:25:20 -0400 Subject: [PATCH 0665/1293] Handle home, delete, & emacs key w/ utf-8 in repl --- lib/mp-readline/readline.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/mp-readline/readline.c b/lib/mp-readline/readline.c index 464916ca4e..6da71c40f5 100644 --- a/lib/mp-readline/readline.c +++ b/lib/mp-readline/readline.c @@ -144,7 +144,7 @@ int readline_process_char(int c) { goto right_arrow_key; } else if (c == CHAR_CTRL_K) { // CTRL-K is kill from cursor to end-of-line, inclusive - vstr_cut_tail_bytes(rl.line, last_line_len - rl.cursor_pos); + vstr_cut_tail_bytes(rl.line, rl.line->len - rl.cursor_pos); // set redraw parameters redraw_from_cursor = true; } else if (c == CHAR_CTRL_N) { @@ -155,6 +155,7 @@ int readline_process_char(int c) { goto up_arrow_key; } else if (c == CHAR_CTRL_U) { // CTRL-U is kill from beginning-of-line up to cursor + cont_chars = count_cont_bytes(rl.line->buf+rl.orig_line_len, rl.line->buf+rl.cursor_pos); vstr_cut_out_bytes(rl.line, rl.orig_line_len, rl.cursor_pos - rl.orig_line_len); // set redraw parameters redraw_step_back = rl.cursor_pos - rl.orig_line_len; @@ -342,6 +343,7 @@ left_arrow_key: if (c == '~') { if (rl.escape_seq_buf[0] == '1' || rl.escape_seq_buf[0] == '7') { home_key: + cont_chars = count_cont_bytes(rl.line->buf+rl.orig_line_len, rl.line->buf+rl.cursor_pos); redraw_step_back = rl.cursor_pos - rl.orig_line_len; } else if (rl.escape_seq_buf[0] == '4' || rl.escape_seq_buf[0] == '8') { end_key: @@ -352,7 +354,12 @@ end_key: delete_key: #endif if (rl.cursor_pos < rl.line->len) { - vstr_cut_out_bytes(rl.line, rl.cursor_pos, 1); + size_t len = 1; + while (UTF8_IS_CONT(rl.line->buf[rl.cursor_pos+len]) && + rl.cursor_pos+len < rl.line->len) { + len++; + } + vstr_cut_out_bytes(rl.line, rl.cursor_pos, len); redraw_from_cursor = true; } } else { From e2891bc7d41a06dcee30daf521cd8693d38402bb Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Thu, 20 Aug 2020 16:21:25 +0200 Subject: [PATCH 0666/1293] spresense: call usb_background function --- ports/cxd56/supervisor/port.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ports/cxd56/supervisor/port.c b/ports/cxd56/supervisor/port.c index a40d31fafb..bbd864f903 100644 --- a/ports/cxd56/supervisor/port.c +++ b/ports/cxd56/supervisor/port.c @@ -36,6 +36,8 @@ #include "boards/board.h" #include "supervisor/port.h" +#include "supervisor/background_callback.h" +#include "supervisor/usb.h" #include "supervisor/shared/tick.h" #include "common-hal/microcontroller/Pin.h" @@ -114,6 +116,11 @@ uint32_t port_get_saved_word(void) { return _ebss; } +static background_callback_t callback; +static void usb_background_do(void* unused) { + usb_background(); +} + volatile bool _tick_enabled; void board_timerhook(void) { @@ -121,6 +128,8 @@ void board_timerhook(void) if (_tick_enabled) { supervisor_tick(); } + + background_callback_add(&callback, usb_background_do, NULL); } uint64_t port_get_raw_ticks(uint8_t* subticks) { From 135626a03822f0aa098f41800cf3a961dfa2b819 Mon Sep 17 00:00:00 2001 From: Benjamin Shockley Date: Thu, 20 Aug 2020 13:50:52 -0500 Subject: [PATCH 0667/1293] Update mpconfigboard.mk Added support for second type of memory chip. --- ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk index ae2a1e9733..393adf8397 100644 --- a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk @@ -7,8 +7,8 @@ CHIP_VARIANT = SAMD51G19A CHIP_FAMILY = samd51 QSPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICE_COUNT = 1 -EXTERNAL_FLASH_DEVICES = "W25Q16JV_IM" +EXTERNAL_FLASH_DEVICE_COUNT = 2 +EXTERNAL_FLASH_DEVICES = "W25Q16JV_IM, W25Q16JV_IQ" LONGINT_IMPL = MPZ # No I2S on SAMD51G From 6eae7ce78f8dd2c1968e54e98cfe1189c4d35062 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 20 Aug 2020 16:57:00 -0500 Subject: [PATCH 0668/1293] Requested changes to pulsein --- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 21 +++++++++---------- supervisor/shared/background_callback.c | 2 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index 79f66ceaee..772948828a 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -91,9 +91,6 @@ void pulsein_interrupt_handler(uint8_t channel) { uint32_t current_count = tc->COUNT16.COUNT.reg; pulseio_pulsein_obj_t* self = get_eic_channel_data(channel); - if (self->len == 0) { - update_background_ticks(); - } if (self->first_edge) { self->first_edge = false; pulsein_set_config(self, false); @@ -115,17 +112,14 @@ void pulsein_interrupt_handler(uint8_t channel) { } uint16_t i = (self->start + self->len) % self->maxlen; - self->buffer[i] = duration; - if (self->len < self->maxlen) { + if (self->len <= self->maxlen) { self->len++; } else { - self->start++; + self->errored_too_fast = true; + common_hal_mcu_enable_interrupts(); + return; } - } - if (!supervisor_background_tasks_ok() ) { - common_hal_mcu_enable_interrupts(); - mp_raise_RuntimeError(translate("Input taking too long")); - return; + self->buffer[i] = duration; } self->last_overflow = current_overflow; self->last_count = current_count; @@ -161,6 +155,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, self->start = 0; self->len = 0; self->first_edge = true; + self->errored_too_fast = false; if (refcount == 0) { // Find a spare timer. @@ -303,6 +298,10 @@ uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { if (self->len == 0) { mp_raise_IndexError(translate("pop from an empty PulseIn")); } + if (self->errored_too_fast) { + self->errored_too_fast = false; + mp_raise_RuntimeError(translate("Input taking too long")); + } common_hal_mcu_disable_interrupts(); uint16_t value = self->buffer[self->start]; self->start = (self->start + 1) % self->maxlen; diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c index af64f99aa6..fb46343ab1 100644 --- a/supervisor/shared/background_callback.c +++ b/supervisor/shared/background_callback.c @@ -48,6 +48,7 @@ void update_background_ticks(void) { } void background_callback_add_core(background_callback_t *cb) { + last_background_tick = port_get_raw_ticks(NULL); CALLBACK_CRITICAL_BEGIN; if (cb->prev || callback_head == cb) { CALLBACK_CRITICAL_END; @@ -77,7 +78,6 @@ void background_callback_run_all() { if (!callback_head) { return; } - last_background_tick = port_get_raw_ticks(NULL); CALLBACK_CRITICAL_BEGIN; if (in_background_callback) { CALLBACK_CRITICAL_END; From 7e7f3b41b5acfe856af45c94ee01183dd453c3c7 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 20 Aug 2020 17:13:04 -0500 Subject: [PATCH 0669/1293] Updated locale/circuitpython.pot --- locale/circuitpython.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 8c88ca5be2..99b39e7281 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-01 13:45-0500\n" +"POT-Creation-Date: 2020-08-20 17:12-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" From 5b228a77e6a35a6ec08596d3bac1935cc7fb97ce Mon Sep 17 00:00:00 2001 From: root Date: Thu, 20 Aug 2020 17:19:25 -0500 Subject: [PATCH 0670/1293] Fixing date in locale/circuitpython.pot to avoid merge conflict --- locale/circuitpython.pot | 252 +++++++++++++++++---------------------- 1 file changed, 107 insertions(+), 145 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 99b39e7281..0bf0cff1cf 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-20 17:12-0500\n" +"POT-Creation-Date: 2020-08-18 11:19-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -66,12 +66,16 @@ msgstr "" msgid "%q in use" msgstr "" -#: py/obj.c +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c msgid "%q index out of range" msgstr "" #: py/obj.c -msgid "%q indices must be integers, not %s" +msgid "%q indices must be integers, not %q" msgstr "" #: shared-bindings/vectorio/Polygon.c @@ -110,6 +114,42 @@ msgstr "" msgid "'%q' argument required" msgstr "" +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" @@ -160,48 +200,6 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" -#: py/runtime.c -msgid "'%s' object cannot assign attribute '%q'" -msgstr "" - -#: py/proto.c -msgid "'%s' object does not support '%q'" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item assignment" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object does not support item deletion" -msgstr "" - -#: py/runtime.c -msgid "'%s' object has no attribute '%q'" -msgstr "" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not an iterator" -msgstr "" - -#: py/objtype.c py/runtime.c -#, c-format -msgid "'%s' object is not callable" -msgstr "" - -#: py/runtime.c -#, c-format -msgid "'%s' object is not iterable" -msgstr "" - -#: py/obj.c -#, c-format -msgid "'%s' object is not subscriptable" -msgstr "" - #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "" @@ -449,6 +447,10 @@ msgstr "" msgid "Buffer length must be a multiple of 512" msgstr "" +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Buffer must be a multiple of 512 bytes" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "" @@ -639,6 +641,10 @@ msgstr "" msgid "Could not restart PWM" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Could not set address" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" msgstr "" @@ -738,7 +744,7 @@ msgstr "" #: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c #: shared-bindings/microcontroller/Pin.c -#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" msgstr "" @@ -821,6 +827,11 @@ msgstr "" msgid "File exists" msgstr "" +#: shared-module/framebufferio/FramebufferDisplay.c +#, c-format +msgid "Framebuffer requires %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -845,7 +856,7 @@ msgid "Group full" msgstr "" #: 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/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -914,6 +925,11 @@ msgstr "" msgid "Invalid %q pin" msgstr "" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +msgid "Invalid %q pin selection" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "" @@ -926,24 +942,12 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/stm/common-hal/busio/I2C.c -msgid "Invalid I2C pin selection" -msgstr "" - #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c msgid "Invalid PWM frequency" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "Invalid SPI pin selection" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid UART pin selection" -msgstr "" - #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "" @@ -1239,6 +1243,10 @@ msgstr "" msgid "Not playing" msgstr "" +#: main.c +msgid "Not running saved code.\n" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1324,8 +1332,13 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" -#: shared-bindings/ps2io/Ps2.c -msgid "Pop from an empty Ps2 buffer" +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. " +"Construct and pass a PWMOut Carrier instead" msgstr "" #: shared-bindings/_bleio/Adapter.c @@ -1340,6 +1353,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -1400,11 +1417,7 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "" #: main.c -msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "" - -#: main.c -msgid "Running in safe mode! Not running saved code.\n" +msgid "Running in safe mode! " msgstr "" #: shared-module/sdcardio/SDCard.c @@ -1416,6 +1429,16 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "" +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO GetCardInfo Error %d" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO Init Error %d" +msgstr "" + #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" msgstr "" @@ -1765,8 +1788,7 @@ msgid "__init__() should return None" msgstr "" #: py/objtype.c -#, c-format -msgid "__init__() should return None, not '%s'" +msgid "__init__() should return None, not '%q'" msgstr "" #: py/objobject.c @@ -1920,7 +1942,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" msgstr "" @@ -1952,47 +1974,17 @@ msgstr "" msgid "can't assign to expression" msgstr "" -#: py/obj.c -#, c-format -msgid "can't convert %s to complex" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to float" -msgstr "" - -#: py/obj.c -#, c-format -msgid "can't convert %s to int" +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c +msgid "can't convert %q to %q" msgstr "" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" msgstr "" -#: py/objint.c -msgid "can't convert NaN to int" -msgstr "" - -#: shared-bindings/i2cperipheral/I2CPeripheral.c -msgid "can't convert address to int" -msgstr "" - -#: py/objint.c -msgid "can't convert inf to int" -msgstr "" - #: py/obj.c -msgid "can't convert to complex" -msgstr "" - -#: py/obj.c -msgid "can't convert to float" -msgstr "" - -#: py/obj.c -msgid "can't convert to int" +msgid "can't convert to %q" msgstr "" #: py/objstr.c @@ -2400,7 +2392,7 @@ msgstr "" msgid "function missing required positional argument #%d" msgstr "" -#: py/argcheck.c py/bc.c py/objnamedtuple.c +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "" @@ -2449,10 +2441,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +#: py/obj.c msgid "index out of range" msgstr "" @@ -2808,8 +2797,7 @@ msgid "number of points must be at least 2" msgstr "" #: py/obj.c -#, c-format -msgid "object '%s' is not a tuple or list" +msgid "object '%q' is not a tuple or list" msgstr "" #: py/obj.c @@ -2845,8 +2833,7 @@ msgid "object not iterable" msgstr "" #: py/obj.c -#, c-format -msgid "object of type '%s' has no len()" +msgid "object of type '%q' has no len()" msgstr "" #: py/obj.c @@ -2939,20 +2926,9 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -msgid "pop from an empty PulseIn" -msgstr "" - -#: py/objset.c -msgid "pop from an empty set" -msgstr "" - -#: py/objlist.c -msgid "pop from empty list" -msgstr "" - -#: py/objdict.c -msgid "popitem(): dictionary is empty" +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" msgstr "" #: py/objint_mpz.c @@ -3109,12 +3085,7 @@ msgid "stream operation not supported" msgstr "" #: py/objstrunicode.c -msgid "string index out of range" -msgstr "" - -#: py/objstrunicode.c -#, c-format -msgid "string indices must be integers, not %s" +msgid "string indices must be integers, not %q" msgstr "" #: py/stream.c @@ -3125,10 +3096,6 @@ msgstr "" msgid "struct: cannot index" msgstr "" -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "" - #: extmod/moductypes.c msgid "struct: no fields" msgstr "" @@ -3198,7 +3165,7 @@ msgstr "" msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/linalg/linalg.c py/objstr.c +#: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" msgstr "" @@ -3206,10 +3173,6 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "tuple/list required on RHS" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" @@ -3265,8 +3228,7 @@ msgid "unknown conversion specifier %c" msgstr "" #: py/objstr.c -#, c-format -msgid "unknown format code '%c' for object of type '%s'" +msgid "unknown format code '%c' for object of type '%q'" msgstr "" #: py/compile.c @@ -3306,7 +3268,7 @@ msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "" #: py/runtime.c -msgid "unsupported type for %q: '%s'" +msgid "unsupported type for %q: '%q'" msgstr "" #: py/runtime.c @@ -3314,7 +3276,7 @@ msgid "unsupported type for operator" msgstr "" #: py/runtime.c -msgid "unsupported types for %q: '%s', '%s'" +msgid "unsupported types for %q: '%q', '%q'" msgstr "" #: py/objint.c From f62b07cc8c98c6abba4a26e0ed5aa5c23eba9bc0 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 20 Aug 2020 20:24:16 +0200 Subject: [PATCH 0671/1293] 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 | 17 +++++++++++++++-- locale/cs.po | 17 +++++++++++++++-- locale/de_DE.po | 20 +++++++++++++++----- locale/es.po | 20 +++++++++++++++----- locale/fil.po | 17 +++++++++++++++-- locale/fr.po | 20 +++++++++++++++----- locale/hi.po | 17 +++++++++++++++-- locale/it_IT.po | 17 +++++++++++++++-- locale/ja.po | 17 +++++++++++++++-- locale/ko.po | 17 +++++++++++++++-- locale/nl.po | 20 +++++++++++++++----- locale/pl.po | 17 +++++++++++++++-- locale/pt_BR.po | 20 +++++++++++++++----- locale/sv.po | 20 +++++++++++++++----- locale/zh_Latn_pinyin.po | 17 +++++++++++++++-- 15 files changed, 225 insertions(+), 48 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index b553c67495..ec5b6f6e86 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 09:36-0400\n" +"POT-Creation-Date: 2020-08-18 11:19-0400\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -764,7 +764,7 @@ msgstr "Error pada regex" #: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c #: shared-bindings/microcontroller/Pin.c -#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" msgstr "Diharapkan %q" @@ -1352,6 +1352,15 @@ msgstr "Tambahkan module apapun pada filesystem\n" msgid "Polygon needs at least 3 points" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. " +"Construct and pass a PWMOut Carrier instead" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1366,6 +1375,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index c1a8ded4e9..b353f46306 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 09:36-0400\n" +"POT-Creation-Date: 2020-08-18 11:19-0400\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -750,7 +750,7 @@ msgstr "" #: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c #: shared-bindings/microcontroller/Pin.c -#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" msgstr "" @@ -1334,6 +1334,15 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. " +"Construct and pass a PWMOut Carrier instead" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1346,6 +1355,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 10c07f667c..87cca4a77f 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 09:36-0400\n" +"POT-Creation-Date: 2020-08-18 11:19-0400\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -760,7 +760,7 @@ msgstr "Fehler in regex" #: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c #: shared-bindings/microcontroller/Pin.c -#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" msgstr "Erwartet ein(e) %q" @@ -1362,6 +1362,15 @@ msgstr "und alle Module im Dateisystem \n" msgid "Polygon needs at least 3 points" msgstr "Polygone brauchen mindestens 3 Punkte" +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. " +"Construct and pass a PWMOut Carrier instead" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Der Präfixbuffer muss sich auf dem Heap befinden" @@ -1376,6 +1385,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "PulseOut wird auf diesem Chip nicht unterstützt" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG DeInit-Fehler" @@ -3553,9 +3566,6 @@ msgstr "" #~ msgid "'async for' or 'async with' outside async function" #~ msgstr "'async for' oder 'async with' außerhalb der asynchronen Funktion" -#~ msgid "PulseOut not supported on this chip" -#~ msgstr "PulseOut wird auf diesem Chip nicht unterstützt" - #~ msgid "PulseIn not supported on this chip" #~ msgstr "PulseIn wird auf diesem Chip nicht unterstützt" diff --git a/locale/es.po b/locale/es.po index 5012b749be..882904f640 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 09:36-0400\n" +"POT-Creation-Date: 2020-08-18 11:19-0400\n" "PO-Revision-Date: 2020-08-17 21:11+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -765,7 +765,7 @@ msgstr "Error en regex" #: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c #: shared-bindings/microcontroller/Pin.c -#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" msgstr "Se espera un %q" @@ -1362,6 +1362,15 @@ msgstr "Además de cualquier módulo en el sistema de archivos\n" msgid "Polygon needs at least 3 points" msgstr "El polígono necesita al menos 3 puntos" +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. " +"Construct and pass a PWMOut Carrier instead" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "El búfer de prefijo debe estar en el montículo" @@ -1375,6 +1384,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull no se usa cuando la dirección es output." +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "PulseOut no es compatible con este chip" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "Error de desinicializado del RNG" @@ -3539,9 +3552,6 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgid "'async for' or 'async with' outside async function" #~ msgstr "'async for' o 'async with' fuera de la función async" -#~ msgid "PulseOut not supported on this chip" -#~ msgstr "PulseOut no es compatible con este chip" - #~ msgid "PulseIn not supported on this chip" #~ msgstr "PulseIn no es compatible con este chip" diff --git a/locale/fil.po b/locale/fil.po index 37a21dc6a7..ec4f9f6856 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 09:36-0400\n" +"POT-Creation-Date: 2020-08-18 11:19-0400\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -754,7 +754,7 @@ msgstr "May pagkakamali sa REGEX" #: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c #: shared-bindings/microcontroller/Pin.c -#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" msgstr "Umasa ng %q" @@ -1346,6 +1346,15 @@ msgstr "Kasama ang kung ano pang modules na sa filesystem\n" msgid "Polygon needs at least 3 points" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. " +"Construct and pass a PWMOut Carrier instead" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1360,6 +1369,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull hindi ginagamit kapag ang direksyon ay output." +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 419cef785e..0562053f15 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 09:36-0400\n" +"POT-Creation-Date: 2020-08-18 11:19-0400\n" "PO-Revision-Date: 2020-07-27 21:27+0000\n" "Last-Translator: Nathan \n" "Language: fr\n" @@ -768,7 +768,7 @@ msgstr "Erreur dans l'expression régulière" #: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c #: shared-bindings/microcontroller/Pin.c -#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" msgstr "Attendu un %q" @@ -1369,6 +1369,15 @@ msgstr "Ainsi que tout autre module présent sur le système de fichiers\n" msgid "Polygon needs at least 3 points" msgstr "Polygone a besoin d’au moins 3 points" +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. " +"Construct and pass a PWMOut Carrier instead" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Le tampon de préfixe doit être sur le tas" @@ -1381,6 +1390,10 @@ msgstr "Appuyez sur une touche pour entrer sur REPL ou CTRL-D pour recharger." msgid "Pull not used when direction is output." msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'." +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "PulseOut non pris en charge sur cette puce" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "Erreur RNG DeInit" @@ -3557,9 +3570,6 @@ msgstr "" #~ msgid "'async for' or 'async with' outside async function" #~ msgstr "'async for' ou 'async with' sans fonction asynchrone extérieure" -#~ msgid "PulseOut not supported on this chip" -#~ msgstr "PulseOut non pris en charge sur cette puce" - #~ msgid "PulseIn not supported on this chip" #~ msgstr "PulseIn non pris en charge sur cette puce" diff --git a/locale/hi.po b/locale/hi.po index 9d0dd74e90..50a1887f67 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 09:36-0400\n" +"POT-Creation-Date: 2020-08-18 11:19-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -743,7 +743,7 @@ msgstr "" #: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c #: shared-bindings/microcontroller/Pin.c -#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" msgstr "" @@ -1327,6 +1327,15 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. " +"Construct and pass a PWMOut Carrier instead" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1339,6 +1348,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index e128b7ef91..9635220af3 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 09:36-0400\n" +"POT-Creation-Date: 2020-08-18 11:19-0400\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -754,7 +754,7 @@ msgstr "Errore nella regex" #: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c #: shared-bindings/microcontroller/Pin.c -#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" msgstr "Atteso un %q" @@ -1356,6 +1356,15 @@ msgstr "Imposssibile rimontare il filesystem" msgid "Polygon needs at least 3 points" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. " +"Construct and pass a PWMOut Carrier instead" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1369,6 +1378,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 8385cce1b9..7c3b42580a 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 09:36-0400\n" +"POT-Creation-Date: 2020-08-18 11:19-0400\n" "PO-Revision-Date: 2020-08-16 13:25+0000\n" "Last-Translator: Taku Fukada \n" "Language-Team: none\n" @@ -759,7 +759,7 @@ msgstr "正規表現にエラーがあります" #: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c #: shared-bindings/microcontroller/Pin.c -#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" msgstr "" @@ -1348,6 +1348,15 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "ポリゴンには少なくとも3つの点が必要" +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. " +"Construct and pass a PWMOut Carrier instead" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Prefixバッファはヒープ上になければなりません" @@ -1361,6 +1370,10 @@ msgstr "何らかのキーを押すとREPLに入ります。CTRL-Dでリロー msgid "Pull not used when direction is output." msgstr "方向がoutputのときpullは使われません" +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "乱数生成器の解体エラー" diff --git a/locale/ko.po b/locale/ko.po index e86372bcb1..ecf539946f 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 09:36-0400\n" +"POT-Creation-Date: 2020-08-18 11:19-0400\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -746,7 +746,7 @@ msgstr "Regex에 오류가 있습니다." #: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c #: shared-bindings/microcontroller/Pin.c -#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" msgstr "%q 이 예상되었습니다." @@ -1330,6 +1330,15 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. " +"Construct and pass a PWMOut Carrier instead" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1342,6 +1351,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index b26592f1e0..3133596686 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 09:36-0400\n" +"POT-Creation-Date: 2020-08-18 11:19-0400\n" "PO-Revision-Date: 2020-08-10 19:59+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -762,7 +762,7 @@ msgstr "Fout in regex" #: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c #: shared-bindings/microcontroller/Pin.c -#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" msgstr "Verwacht een %q" @@ -1364,6 +1364,15 @@ msgstr "En iedere module in het bestandssysteem\n" msgid "Polygon needs at least 3 points" msgstr "Polygon heeft op zijn minst 3 punten nodig" +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. " +"Construct and pass a PWMOut Carrier instead" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Prefix buffer moet op de heap zijn" @@ -1378,6 +1387,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull niet gebruikt wanneer de richting output is." +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "PulseOut niet ondersteund door deze chip" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG DeInit Fout" @@ -3531,9 +3544,6 @@ msgstr "zi moet vorm (n_section, 2) hebben" #~ msgid "PulseIn not supported on this chip" #~ msgstr "PusleIn niet ondersteund door deze chip" -#~ msgid "PulseOut not supported on this chip" -#~ msgstr "PulseOut niet ondersteund door deze chip" - #~ msgid "I2C operation not supported" #~ msgstr "I2C actie niet ondersteund" diff --git a/locale/pl.po b/locale/pl.po index 8250f840d2..6c52062d9a 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 09:36-0400\n" +"POT-Creation-Date: 2020-08-18 11:19-0400\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -746,7 +746,7 @@ msgstr "Błąd w regex" #: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c #: shared-bindings/microcontroller/Pin.c -#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" msgstr "Oczekiwano %q" @@ -1332,6 +1332,15 @@ msgstr "Oraz moduły w systemie plików\n" msgid "Polygon needs at least 3 points" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. " +"Construct and pass a PWMOut Carrier instead" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1344,6 +1353,10 @@ msgstr "Dowolny klawisz aby uruchomić konsolę. CTRL-D aby przeładować." msgid "Pull not used when direction is output." msgstr "Podciągnięcie nieużywane w trybie wyjścia." +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 459b198df3..b2967cf992 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 09:36-0400\n" +"POT-Creation-Date: 2020-08-18 11:19-0400\n" "PO-Revision-Date: 2020-08-16 02:25+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -767,7 +767,7 @@ msgstr "Erro no regex" #: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c #: shared-bindings/microcontroller/Pin.c -#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" msgstr "Esperado um" @@ -1367,6 +1367,15 @@ msgstr "Além de quaisquer módulos no sistema de arquivos\n" msgid "Polygon needs at least 3 points" msgstr "O Polígono precisa de pelo menos 3 pontos" +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. " +"Construct and pass a PWMOut Carrier instead" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1382,6 +1391,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "O Pull não foi usado quando a direção for gerada." +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "O PulseOut não é compatível neste CI" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "Erro DeInit RNG" @@ -3552,9 +3565,6 @@ msgstr "zi deve estar na forma (n_section, 2)" #~ msgid "'async for' or 'async with' outside async function" #~ msgstr "'assíncrono para' ou 'assíncrono com' função assíncrona externa" -#~ msgid "PulseOut not supported on this chip" -#~ msgstr "O PulseOut não é compatível neste CI" - #~ msgid "PulseIn not supported on this chip" #~ msgstr "O PulseIn não é compatível neste CI" diff --git a/locale/sv.po b/locale/sv.po index d747de177a..df205b1095 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 09:36-0400\n" +"POT-Creation-Date: 2020-08-18 11:19-0400\n" "PO-Revision-Date: 2020-07-25 20:58+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -758,7 +758,7 @@ msgstr "Fel i regex" #: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c #: shared-bindings/microcontroller/Pin.c -#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" msgstr "Förväntade %q" @@ -1355,6 +1355,15 @@ msgstr "Plus eventuella moduler i filsystemet\n" msgid "Polygon needs at least 3 points" msgstr "Polygonen behöver minst 3 punkter" +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. " +"Construct and pass a PWMOut Carrier instead" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Prefixbufferten måste finnas på heap" @@ -1368,6 +1377,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull används inte när riktningen är output." +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "PulseIn stöds inte av detta chip" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG DeInit-fel" @@ -3519,9 +3532,6 @@ msgstr "zi måste vara i formen (n_section, 2)" #~ msgid "'async for' or 'async with' outside async function" #~ msgstr "'async for' eller 'async with' utanför async-funktion" -#~ msgid "PulseOut not supported on this chip" -#~ msgstr "PulseIn stöds inte av detta chip" - #~ msgid "PulseIn not supported on this chip" #~ msgstr "PulseIn stöds inte av detta chip" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 3e5d21d458..725491f5b2 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-14 09:36-0400\n" +"POT-Creation-Date: 2020-08-18 11:19-0400\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -755,7 +755,7 @@ msgstr "Zhèngzé biǎodá shì cuòwù" #: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c #: shared-bindings/microcontroller/Pin.c -#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" msgstr "Yùqí %q" @@ -1350,6 +1350,15 @@ msgstr "Zài wénjiàn xìtǒng shàng tiānjiā rènhé mókuài\n" msgid "Polygon needs at least 3 points" msgstr "Duōbiānxíng zhìshǎo xūyào 3 diǎn" +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. " +"Construct and pass a PWMOut Carrier instead" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Qiánzhuì huǎnchōng qū bìxū zài duī shàng" @@ -1362,6 +1371,10 @@ msgstr "Àn xià rènhé jiàn jìnrù REPL. Shǐyòng CTRL-D chóngxīn jiāzà msgid "Pull not used when direction is output." msgstr "Fāngxiàng shūchū shí Pull méiyǒu shǐyòng." +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG qǔxiāo chūshǐhuà cuòwù" From 490380a504b539adbb9e2b9902c404733ff0a03f Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 20 Aug 2020 20:41:05 -0400 Subject: [PATCH 0672/1293] remove debugging uart code --- devices/ble_hci/common-hal/_bleio/hci.c | 35 ------------------------- 1 file changed, 35 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/hci.c b/devices/ble_hci/common-hal/_bleio/hci.c index b366aa4ac9..ed9320330e 100644 --- a/devices/ble_hci/common-hal/_bleio/hci.c +++ b/devices/ble_hci/common-hal/_bleio/hci.c @@ -36,11 +36,6 @@ // Set to 1 for extensive HCI packet logging. #define HCI_DEBUG 0 -//FIX **********8 -busio_uart_obj_t debug_out; -bool debug_out_in_use; - - // HCI H4 protocol packet types: first byte in the packet. #define H4_CMD 0x01 #define H4_ACL 0x02 @@ -165,11 +160,6 @@ STATIC void process_acl_data_pkt(uint8_t pkt_len, uint8_t pkt_data[]) { // Process number of completed packets. Reduce number of pending packets by reported // number of completed. STATIC void process_num_comp_pkts(uint16_t handle, uint16_t num_pkts) { - const uint8_t ff = 0xff; - int err; - common_hal_busio_uart_write(&debug_out, (uint8_t *) &pending_pkt, 1, &err); - common_hal_busio_uart_write(&debug_out, (uint8_t *) &ff, 1, &err); - common_hal_busio_uart_write(&debug_out, (uint8_t *) &ff, 1, &err); if (num_pkts && pending_pkt > num_pkts) { pending_pkt -= num_pkts; } else { @@ -292,30 +282,14 @@ STATIC void process_evt_pkt(size_t pkt_len, uint8_t pkt_data[]) } } -//FIX -busio_uart_obj_t debug_out; -bool debug_out_in_use; - void bleio_hci_reset(void) { rx_idx = 0; pending_pkt = 0; hci_poll_in_progress = false; - debug_out_in_use = false; bleio_att_reset(); } hci_result_t hci_poll_for_incoming_pkt(void) { - if (!debug_out_in_use) { - debug_out.base.type = &busio_uart_type; - common_hal_busio_uart_construct(&debug_out, - &pin_PB12 /*D7*/, NULL, // no RX - NULL, NULL, - NULL, false, - 115200, 8, BUSIO_UART_PARITY_NONE, 1, 0, - 512, NULL, false); - debug_out_in_use = true; - } - common_hal_mcu_disable_interrupts(); if (hci_poll_in_progress) { common_hal_mcu_enable_interrupts(); @@ -394,15 +368,6 @@ hci_result_t hci_poll_for_incoming_pkt(void) { common_hal_digitalio_digitalinout_set_value(common_hal_bleio_adapter_obj.rts_digitalinout, true); size_t pkt_len = rx_idx; - //FIX output packet for debugging - int err; - common_hal_busio_uart_write(&debug_out, (uint8_t *) &rx_idx, 1, &err); - common_hal_busio_uart_write(&debug_out, (uint8_t *) &rx_idx, 1, &err); - common_hal_busio_uart_write(&debug_out, (uint8_t *) &rx_idx, 1, &err); - - common_hal_busio_uart_write(&debug_out, rx_buffer, rx_idx, &err); - - // Reset for next packet. rx_idx = 0; packet_is_complete = false; From 097f93a630199ae81732981ce3778632e7744f6c Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 21 Aug 2020 10:17:59 -0400 Subject: [PATCH 0673/1293] improve HCI packet error handling --- devices/ble_hci/common-hal/_bleio/hci.c | 12 ++++++++---- devices/ble_hci/common-hal/_bleio/hci.h | 15 ++++++++------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/hci.c b/devices/ble_hci/common-hal/_bleio/hci.c index ed9320330e..e261a98475 100644 --- a/devices/ble_hci/common-hal/_bleio/hci.c +++ b/devices/ble_hci/common-hal/_bleio/hci.c @@ -331,27 +331,27 @@ hci_result_t hci_poll_for_incoming_pkt(void) { switch (rx_buffer[0]) { case H4_ACL: - if (rx_idx > sizeof(h4_hci_acl_pkt_t)) { + if (rx_idx >= sizeof(h4_hci_acl_pkt_t)) { const size_t total_len = sizeof(h4_hci_acl_pkt_t) + ((h4_hci_acl_pkt_t *) rx_buffer)->data_len; if (rx_idx == total_len) { packet_is_complete = true; } if (rx_idx > total_len) { - mp_printf(&mp_plat_print, "acl: rx_idx > total_len\n"); + return HCI_PACKET_SIZE_ERROR; } } break; case H4_EVT: - if (rx_idx > sizeof(h4_hci_evt_pkt_t)) { + if (rx_idx >= sizeof(h4_hci_evt_pkt_t)) { const size_t total_len = sizeof(h4_hci_evt_pkt_t) + ((h4_hci_evt_pkt_t *) rx_buffer)->param_len; if (rx_idx == total_len) { packet_is_complete = true; } if (rx_idx > total_len) { - mp_printf(&mp_plat_print, "evt: rx_idx > total_len\n"); + return HCI_PACKET_SIZE_ERROR; } } break; @@ -786,6 +786,10 @@ void hci_check_error(hci_result_t result) { mp_raise_bleio_BluetoothError(translate("Error writing to HCI adapter")); return; + case HCI_PACKET_SIZE_ERROR: + mp_raise_RuntimeError(translate("HCI packet size mismatch")); + return; + case HCI_ATT_ERROR: mp_raise_RuntimeError(translate("Error in ATT protocol code")); return; diff --git a/devices/ble_hci/common-hal/_bleio/hci.h b/devices/ble_hci/common-hal/_bleio/hci.h index 3d082c49cb..c9fd2393af 100644 --- a/devices/ble_hci/common-hal/_bleio/hci.h +++ b/devices/ble_hci/common-hal/_bleio/hci.h @@ -29,14 +29,15 @@ typedef struct _bleio_adapter_obj_t bleio_adapter_obj_t; // An hci_result_t is one of the HCI_x values below, -// or is it > 0 and is an HCI command status value (see hci_include/hci_err.h) +// or it is > 0 and is an HCI command status value (see hci_include/hci_err.h) typedef int hci_result_t; -#define HCI_OK (0) -#define HCI_RESPONSE_TIMEOUT (-1) -#define HCI_WRITE_TIMEOUT (-2) -#define HCI_READ_ERROR (-3) -#define HCI_WRITE_ERROR (-4) -#define HCI_ATT_ERROR (-5) +#define HCI_OK (0) +#define HCI_RESPONSE_TIMEOUT (-1) +#define HCI_WRITE_TIMEOUT (-2) +#define HCI_READ_ERROR (-3) +#define HCI_WRITE_ERROR (-4) +#define HCI_ATT_ERROR (-5) +#define HCI_PACKET_SIZE_ERROR (-6) extern void bleio_hci_reset(void); From c21c39be5a3cdf9cc4688250bc39518c90424a89 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 21 Aug 2020 10:48:41 -0400 Subject: [PATCH 0674/1293] merge from upstream; update ulab --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index 0394801933..11a7ecff6d 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 0394801933f6e68a5bc7cdb0da76c7884e8cf70a +Subproject commit 11a7ecff6d76a02644ff23a734b792afaa615e44 From 58573a70e19d69efd78f75a4780b55dced0e3cda Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 21 Aug 2020 11:02:24 -0400 Subject: [PATCH 0675/1293] bring submodules up to date --- frozen/circuitpython-stage | 2 +- lib/mp3 | 2 +- lib/protomatter | 2 +- lib/tinyusb | 2 +- ports/atmel-samd/asf4 | 2 +- ports/atmel-samd/peripherals | 2 +- ports/cxd56/spresense-exported-sdk | 2 +- ports/esp32s2/esp-idf | 2 +- ports/stm/st_driver | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/frozen/circuitpython-stage b/frozen/circuitpython-stage index 0d2c083a2f..9596a5904e 160000 --- a/frozen/circuitpython-stage +++ b/frozen/circuitpython-stage @@ -1 +1 @@ -Subproject commit 0d2c083a2fb57a1562d4806775f45273abbfbfae +Subproject commit 9596a5904ed757e6fbffcf03e7aa77ae9ecf5223 diff --git a/lib/mp3 b/lib/mp3 index c3c664bf4d..bc58a65496 160000 --- a/lib/mp3 +++ b/lib/mp3 @@ -1 +1 @@ -Subproject commit c3c664bf4db6a36d11808dfcbb5dbf7cff1715b8 +Subproject commit bc58a654964c799e972719a63ff12694998f3549 diff --git a/lib/protomatter b/lib/protomatter index 9f71088d2c..761d6437e8 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit 9f71088d2c32206c6f0495704ae0c040426d5764 +Subproject commit 761d6437e8cd6a131d51de96974337121a9c7164 diff --git a/lib/tinyusb b/lib/tinyusb index dc5445e2f4..22100b252f 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit dc5445e2f45cb348a44fe24fc1be4bc8b5ba5bab +Subproject commit 22100b252fc2eb8f51ed407949645653c4880fd9 diff --git a/ports/atmel-samd/asf4 b/ports/atmel-samd/asf4 index c0eef7b751..35a1525796 160000 --- a/ports/atmel-samd/asf4 +++ b/ports/atmel-samd/asf4 @@ -1 +1 @@ -Subproject commit c0eef7b75124fc946af5f75e12d82d6d01315ab1 +Subproject commit 35a1525796c7ef8a3893d90befdad2f267fca20e diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index e4161d7d6d..0f5f1522d0 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit e4161d7d6d98d78eddcccb82128856af4baf7e50 +Subproject commit 0f5f1522d09c8fa7d858edec484a994c21c59668 diff --git a/ports/cxd56/spresense-exported-sdk b/ports/cxd56/spresense-exported-sdk index 7f6568c7f4..c991d439fa 160000 --- a/ports/cxd56/spresense-exported-sdk +++ b/ports/cxd56/spresense-exported-sdk @@ -1 +1 @@ -Subproject commit 7f6568c7f4898cdb24a2f06040784a836050686e +Subproject commit c991d439fac9c23cfcac0da16fe8055f818d40a4 diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index 7aae7f034b..160ba4924d 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit 7aae7f034bab68d2dd6aaa763924c91eb697d87e +Subproject commit 160ba4924d8b588e718f76e3a0d0e92c11052fa3 diff --git a/ports/stm/st_driver b/ports/stm/st_driver index 3fc2e0f3db..1900834751 160000 --- a/ports/stm/st_driver +++ b/ports/stm/st_driver @@ -1 +1 @@ -Subproject commit 3fc2e0f3db155b33177bb0705e0dd65cadb58412 +Subproject commit 1900834751fd6754457874b8c971690bab33e0a7 From 8d785cbbe577a0ee6592aa263cae45e817f3e9ee Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 21 Aug 2020 11:37:15 -0400 Subject: [PATCH 0676/1293] fix stubs; make translate --- locale/circuitpython.pot | 26 +++++++++++++++++++++----- shared-bindings/_bleio/Adapter.c | 6 ++++-- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 1e227dcbc0..f53c9c51f8 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-18 11:19-0400\n" +"POT-Creation-Date: 2020-08-21 11:37-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -754,10 +754,18 @@ msgstr "" msgid "Expected a Characteristic" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" @@ -1349,10 +1357,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -2409,6 +2413,10 @@ msgstr "" msgid "graphic must be 2048 bytes long" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "hci_uart_init not available" +msgstr "" + #: extmod/moduheapq.c msgid "heap must be a list" msgstr "" @@ -2453,6 +2461,10 @@ msgstr "" msgid "initial values must be iterable" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" @@ -2645,6 +2657,10 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be > 0" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "" diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 6942f37098..8f96d13ea1 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -71,8 +71,8 @@ //| ... //| -//| def hci_uart_init(self, *, uart: busio.UART, rts: digitalio.DigitalInOut, cts: digitalio.DigitalInOut, baudrate: int = 115200, buffer_size: int = 256): -//| On boards that do not have native BLE, you can an use HCI co-processor. +//| def hci_uart_init(self, *, uart: busio.UART, rts: digitalio.DigitalInOut, cts: digitalio.DigitalInOut, baudrate: int = 115200, buffer_size: int = 256) -> None: +//| """On boards that do not have native BLE, you can an use HCI co-processor. //| Call `_bleio.adapter.hci_uart_init()` passing it the uart and pins used to communicate //| with the co-processor, such as an Adafruit AirLift. //| The co-processor must have been reset and put into BLE mode beforehand @@ -83,6 +83,8 @@ //| The `_bleio.adapter` object is enabled during this call. //| //| Raises `RuntimeError` on boards with native BLE. +//| """ +//| ... //| STATIC mp_obj_t bleio_adapter_hci_uart_init(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { #if CIRCUITPY_BLEIO_HCI From 6553628fcb66134d43edf1ce8b02f0e010bf57ea Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 21 Aug 2020 11:51:17 -0400 Subject: [PATCH 0677/1293] rename hci_include/README.dm to avoid triggering sphinx warning --- .../ble_hci/common-hal/_bleio/hci_include/{README.md => NOTE.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename devices/ble_hci/common-hal/_bleio/hci_include/{README.md => NOTE.txt} (100%) diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/README.md b/devices/ble_hci/common-hal/_bleio/hci_include/NOTE.txt similarity index 100% rename from devices/ble_hci/common-hal/_bleio/hci_include/README.md rename to devices/ble_hci/common-hal/_bleio/hci_include/NOTE.txt From 701e80a0252dbb63d64830a8d55f76b6296cb647 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 21 Aug 2020 11:00:02 -0700 Subject: [PATCH 0678/1293] Make socket reads interruptable --- ports/esp32s2/common-hal/socketpool/Socket.c | 32 +++++++++++++++----- ports/esp32s2/common-hal/wifi/Radio.c | 13 ++++++-- ports/esp32s2/common-hal/wifi/Radio.h | 3 ++ ports/esp32s2/common-hal/wifi/__init__.c | 20 ++++++++++-- ports/esp32s2/sdkconfig.defaults | 2 +- py/runtime.c | 4 +++ py/runtime.h | 1 + shared-bindings/wifi/Radio.c | 14 ++++++++- shared-bindings/wifi/Radio.h | 10 +++++- 9 files changed, 82 insertions(+), 17 deletions(-) diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/esp32s2/common-hal/socketpool/Socket.c index 074d9885f3..db8356f66f 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.c +++ b/ports/esp32s2/common-hal/socketpool/Socket.c @@ -55,9 +55,13 @@ bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self, const c int flags; esp_err_t err = esp_tls_get_and_clear_last_error(self->tcp->error_handle, &esp_tls_code, &flags); - // mp_raise_espidf_MemoryError - mp_raise_OSError_msg_varg(translate("Unhandled ESP TLS error %d %d %x"), esp_tls_code, flags, err); + if (err == ESP_ERR_MBEDTLS_SSL_SETUP_FAILED) { + mp_raise_espidf_MemoryError(); + } else { + mp_raise_OSError_msg_varg(translate("Unhandled ESP TLS error %d %d %x"), esp_tls_code, flags, err); + } } + return self->connected; } @@ -78,23 +82,35 @@ mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, size_t received = 0; ssize_t last_read = 1; uint64_t start_ticks = supervisor_ticks_ms64(); + int sockfd; + esp_err_t err = esp_tls_get_conn_sockfd(self->tcp, &sockfd); + if (err != ESP_OK) { + mp_raise_OSError(MP_EBADF); + } while (received < len && last_read > 0 && (self->timeout_ms == 0 || supervisor_ticks_ms64() - start_ticks <= self->timeout_ms) && !mp_hal_is_interrupted()) { RUN_BACKGROUND_TASKS; size_t available = esp_tls_get_bytes_avail(self->tcp); - ESP_EARLY_LOGW(TAG, "available %d", available); + if (available == 0) { + // This reads the raw socket buffer and is used for non-TLS connections + // and between encrypted TLS blocks. + int status = lwip_ioctl(sockfd, FIONREAD, &available); + if (status < 0) { + // ESP_EARLY_LOGW(TAG, "ioctl fail. socket %d status %d errno %d available %d", sockfd, status, errno, available); + last_read = status; + break; + } + } + // ESP_EARLY_LOGW(TAG, "available %d", available); size_t remaining = len - received; if (available > remaining) { available = remaining; } - if (true || available > 0) { - if (available == 0) { - available = len - received; - } + if (available > 0) { last_read = esp_tls_conn_read(self->tcp, (void*) buf + received, available); - ESP_EARLY_LOGW(TAG, "read %d out of %d", last_read, available); + // ESP_EARLY_LOGW(TAG, "read %d out of %d", last_read, available); received += last_read; } } diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index be8e7e6d9f..038ce9e754 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -105,7 +105,7 @@ void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) { self->current_scan = NULL; } -bool 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) { +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) { // check enabled wifi_config_t* config = &self->sta_config; memcpy(&config->sta.ssid, ssid, ssid_len); @@ -116,6 +116,8 @@ bool common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t* ssid, size_t config->sta.password[password_len] = 0; config->sta.channel = channel; esp_wifi_set_config(ESP_IF_WIFI_STA, config); + self->starting_retries = 5; + self->retries_left = 5; esp_wifi_connect(); EventBits_t bits; @@ -128,9 +130,14 @@ bool common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t* ssid, size_t 0); } while ((bits & (WIFI_CONNECTED_BIT | WIFI_DISCONNECTED_BIT)) == 0 && !mp_hal_is_interrupted()); if ((bits & WIFI_DISCONNECTED_BIT) != 0) { - return false; + if (self->last_disconnect_reason == WIFI_REASON_AUTH_FAIL) { + return WIFI_RADIO_ERROR_AUTH; + } else if (self->last_disconnect_reason == WIFI_REASON_NO_AP_FOUND) { + return WIFI_RADIO_ERROR_NO_AP_FOUND; + } + return WIFI_RADIO_ERROR_UNKNOWN; } - return true; + return WIFI_RADIO_ERROR_NONE; } mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self) { diff --git a/ports/esp32s2/common-hal/wifi/Radio.h b/ports/esp32s2/common-hal/wifi/Radio.h index e7dce94776..205aef1761 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.h +++ b/ports/esp32s2/common-hal/wifi/Radio.h @@ -50,6 +50,9 @@ typedef struct { bool started; bool ap_mode; bool sta_mode; + uint8_t retries_left; + uint8_t starting_retries; + uint8_t last_disconnect_reason; } wifi_radio_obj_t; #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_WIFI_RADIO_H diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index f845e092fc..d455679467 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -54,11 +54,24 @@ static void event_handler(void* arg, esp_event_base_t event_base, ESP_EARLY_LOGW(TAG, "disconnected"); wifi_event_sta_disconnected_t* d = (wifi_event_sta_disconnected_t*) event_data; uint8_t reason = d->reason; - if (reason != WIFI_REASON_ASSOC_LEAVE) { - // reconnect - } ESP_EARLY_LOGW(TAG, "reason %d 0x%02x", reason, reason); + if (radio->retries_left > 0 && + (reason == WIFI_REASON_AUTH_EXPIRE || + reason == WIFI_REASON_ASSOC_EXPIRE || + reason == WIFI_REASON_CONNECTION_FAIL || + reason == WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT)) { + radio->retries_left--; + ESP_EARLY_LOGI(TAG, "Retrying connect. %d retries remaining", radio->retries_left); + esp_wifi_connect(); + return; + } + + radio->last_disconnect_reason = reason; xEventGroupSetBits(radio->event_group_handle, WIFI_DISCONNECTED_BIT); + + // if (reason != WIFI_REASON_ASSOC_LEAVE) { + // // reconnect + // } } else if (event_id == WIFI_EVENT_STA_AUTHMODE_CHANGE) { } } @@ -78,6 +91,7 @@ static void event_handler(void* arg, esp_event_base_t event_base, // } else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) { ESP_EARLY_LOGW(TAG, "got ip"); + radio->retries_left = radio->starting_retries; xEventGroupSetBits(radio->event_group_handle, WIFI_CONNECTED_BIT); } } diff --git a/ports/esp32s2/sdkconfig.defaults b/ports/esp32s2/sdkconfig.defaults index a50b61ebf4..c0a56c1432 100644 --- a/ports/esp32s2/sdkconfig.defaults +++ b/ports/esp32s2/sdkconfig.defaults @@ -452,7 +452,7 @@ CONFIG_LWIP_MAX_SOCKETS=10 # CONFIG_LWIP_SO_LINGER is not set CONFIG_LWIP_SO_REUSE=y CONFIG_LWIP_SO_REUSE_RXTOALL=y -# CONFIG_LWIP_SO_RCVBUF is not set +CONFIG_LWIP_SO_RCVBUF=y # CONFIG_LWIP_NETBUF_RECVINFO is not set CONFIG_LWIP_IP4_FRAG=y CONFIG_LWIP_IP6_FRAG=y diff --git a/py/runtime.c b/py/runtime.c index 216432ea42..e63e2337d9 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -1602,6 +1602,10 @@ NORETURN void mp_raise_OSError_msg_varg(const compressed_string_t *fmt, ...) { va_end(argptr); } +NORETURN void mp_raise_ConnectionError(const compressed_string_t *msg) { + mp_raise_msg(&mp_type_ConnectionError, msg); +} + NORETURN void mp_raise_BrokenPipeError(void) { nlr_raise(mp_obj_new_exception_arg1(&mp_type_BrokenPipeError, MP_OBJ_NEW_SMALL_INT(MP_EPIPE))); } diff --git a/py/runtime.h b/py/runtime.h index c5d07c4175..ad7d0feaba 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -166,6 +166,7 @@ NORETURN void mp_raise_OSError(int errno_); NORETURN void mp_raise_OSError_errno_str(int errno_, mp_obj_t str); NORETURN void mp_raise_OSError_msg(const compressed_string_t *msg); NORETURN void mp_raise_OSError_msg_varg(const compressed_string_t *fmt, ...); +NORETURN void mp_raise_ConnectionError(const compressed_string_t *msg); NORETURN void mp_raise_BrokenPipeError(void); NORETURN void mp_raise_NotImplementedError(const compressed_string_t *msg); NORETURN void mp_raise_NotImplementedError_varg(const compressed_string_t *fmt, ...); diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 6fd0c33744..2d356e5d96 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -136,9 +136,21 @@ STATIC mp_obj_t wifi_radio_connect(size_t n_args, const mp_obj_t *pos_args, mp_m password.len = 0; if (args[ARG_password].u_obj != MP_OBJ_NULL) { mp_get_buffer_raise(args[ARG_password].u_obj, &password, MP_BUFFER_READ); + if (password.len > 0 && (password.len < 8 || password.len > 63)) { + mp_raise_ValueError(translate("WiFi password must be between 8 and 63 characters.")); + } } - return mp_obj_new_bool(common_hal_wifi_radio_connect(self, ssid.buf, ssid.len, password.buf, password.len, args[ARG_channel].u_int, timeout)); + wifi_radio_error_t error = common_hal_wifi_radio_connect(self, ssid.buf, ssid.len, password.buf, password.len, args[ARG_channel].u_int, timeout); + if (error == WIFI_RADIO_ERROR_AUTH) { + mp_raise_ConnectionError(translate("Authentication failure")); + } else if (error == WIFI_RADIO_ERROR_NO_AP_FOUND) { + mp_raise_ConnectionError(translate("No network with that ssid")); + } else if (error != WIFI_RADIO_ERROR_NONE) { + mp_raise_ConnectionError(translate("Unknown failure")); + } + + return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wifi_radio_connect_obj, 1, wifi_radio_connect); diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index c83a135a6a..812814f9ea 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -35,6 +35,14 @@ const mp_obj_type_t wifi_radio_type; + +typedef enum { + WIFI_RADIO_ERROR_NONE, + WIFI_RADIO_ERROR_UNKNOWN, + WIFI_RADIO_ERROR_AUTH, + WIFI_RADIO_ERROR_NO_AP_FOUND +} wifi_radio_error_t; + extern bool common_hal_wifi_radio_get_enabled(wifi_radio_obj_t *self); extern void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled); @@ -43,7 +51,7 @@ extern mp_obj_t common_hal_wifi_radio_get_mac_address(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self); extern void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self); -extern bool 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); +extern 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); extern mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self); From 83deea0e0364cfce83d6cf1c5c5f150a1a986d93 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 21 Aug 2020 11:17:42 -0700 Subject: [PATCH 0679/1293] Fix copy pasta and stub build --- ports/cxd56/common-hal/pwmio/__init__.c | 2 +- ports/esp32s2/common-hal/pwmio/__init__.c | 2 +- ports/mimxrt10xx/common-hal/pwmio/__init__.c | 2 +- shared-bindings/pulseio/__init__.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/cxd56/common-hal/pwmio/__init__.c b/ports/cxd56/common-hal/pwmio/__init__.c index 2bee925bc7..9e551a1072 100644 --- a/ports/cxd56/common-hal/pwmio/__init__.c +++ b/ports/cxd56/common-hal/pwmio/__init__.c @@ -1 +1 @@ -// No pulseio module functions. +// No pwmio module functions. diff --git a/ports/esp32s2/common-hal/pwmio/__init__.c b/ports/esp32s2/common-hal/pwmio/__init__.c index 2bee925bc7..9e551a1072 100644 --- a/ports/esp32s2/common-hal/pwmio/__init__.c +++ b/ports/esp32s2/common-hal/pwmio/__init__.c @@ -1 +1 @@ -// No pulseio module functions. +// No pwmio module functions. diff --git a/ports/mimxrt10xx/common-hal/pwmio/__init__.c b/ports/mimxrt10xx/common-hal/pwmio/__init__.c index 2bee925bc7..9e551a1072 100644 --- a/ports/mimxrt10xx/common-hal/pwmio/__init__.c +++ b/ports/mimxrt10xx/common-hal/pwmio/__init__.c @@ -1 +1 @@ -// No pulseio module functions. +// No pwmio module functions. diff --git a/shared-bindings/pulseio/__init__.c b/shared-bindings/pulseio/__init__.c index efef640433..624cd2dfe8 100644 --- a/shared-bindings/pulseio/__init__.c +++ b/shared-bindings/pulseio/__init__.c @@ -48,7 +48,7 @@ //| All classes change hardware state and should be deinitialized when they //| are no longer needed if the program continues after use. To do so, either //| call :py:meth:`!deinit` or use a context manager. See -//| :ref:`lifetime-and-contextmanagers` for more info. +//| :ref:`lifetime-and-contextmanagers` for more info.""" //| STATIC const mp_rom_map_elem_t pulseio_module_globals_table[] = { From 1fc551054a08c90c793a9dafc7d5e3551b6a3ab2 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Fri, 21 Aug 2020 16:07:43 +0000 Subject: [PATCH 0680/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (777 of 777 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index b2967cf992..9fb4142c47 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: 2020-08-18 11:19-0400\n" -"PO-Revision-Date: 2020-08-16 02:25+0000\n" +"PO-Revision-Date: 2020-08-21 18:19+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.2-dev\n" +"X-Generator: Weblate 4.2.1-dev\n" #: main.c msgid "" @@ -1375,6 +1375,8 @@ msgid "" "Port does not accept pins or frequency. " "Construct and pass a PWMOut Carrier instead" msgstr "" +"A porta não aceita pinos ou frequência. " +"Em vez disso, Construa e encaminhe um PWMOut Carrier" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" From 9a8b4e98bf0880a5ca703077faa0028c28f17ebb Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 21 Aug 2020 11:36:50 -0700 Subject: [PATCH 0681/1293] Add empty lines --- shared-bindings/pulseio/__init__.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/pulseio/__init__.c b/shared-bindings/pulseio/__init__.c index 624cd2dfe8..bfe9635f01 100644 --- a/shared-bindings/pulseio/__init__.c +++ b/shared-bindings/pulseio/__init__.c @@ -41,10 +41,10 @@ //| Individual pulses are commonly used in infrared remotes and in DHT //| temperature sensors. //| - +//| //| .. warning:: PWMOut is moving to `pwmio` and will be removed from `pulseio` //| in CircuitPython 7. - +//| //| All classes change hardware state and should be deinitialized when they //| are no longer needed if the program continues after use. To do so, either //| call :py:meth:`!deinit` or use a context manager. See From 1e7e42b2217582fcd596dcb737dbf5cd1f7521cb Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Fri, 21 Aug 2020 14:17:17 -0500 Subject: [PATCH 0682/1293] Updating to adafruit/main --- extmod/ulab | 2 +- frozen/Adafruit_CircuitPython_BLE | 2 +- frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center | 2 +- frozen/Adafruit_CircuitPython_BusDevice | 2 +- frozen/Adafruit_CircuitPython_CircuitPlayground | 2 +- frozen/Adafruit_CircuitPython_Crickit | 2 +- frozen/Adafruit_CircuitPython_DRV2605 | 2 +- frozen/Adafruit_CircuitPython_DS3231 | 2 +- frozen/Adafruit_CircuitPython_ESP32SPI | 2 +- frozen/Adafruit_CircuitPython_FocalTouch | 2 +- frozen/Adafruit_CircuitPython_HID | 2 +- frozen/Adafruit_CircuitPython_IRRemote | 2 +- frozen/Adafruit_CircuitPython_LIS3DH | 2 +- frozen/Adafruit_CircuitPython_LSM6DS | 2 +- frozen/Adafruit_CircuitPython_Motor | 2 +- frozen/Adafruit_CircuitPython_Register | 2 +- frozen/Adafruit_CircuitPython_Requests | 2 +- frozen/Adafruit_CircuitPython_Thermistor | 2 +- frozen/Adafruit_CircuitPython_seesaw | 2 +- frozen/circuitpython-stage | 2 +- lib/mp3 | 2 +- lib/protomatter | 2 +- lib/tinyusb | 2 +- ports/atmel-samd/asf4 | 2 +- ports/atmel-samd/peripherals | 2 +- ports/cxd56/spresense-exported-sdk | 2 +- ports/esp32s2/esp-idf | 2 +- ports/stm/st_driver | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/extmod/ulab b/extmod/ulab index cf61d728e7..11a7ecff6d 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit cf61d728e70b9ec57e5711b40540793a89296f5d +Subproject commit 11a7ecff6d76a02644ff23a734b792afaa615e44 diff --git a/frozen/Adafruit_CircuitPython_BLE b/frozen/Adafruit_CircuitPython_BLE index 5d584576ef..41f7a3530d 160000 --- a/frozen/Adafruit_CircuitPython_BLE +++ b/frozen/Adafruit_CircuitPython_BLE @@ -1 +1 @@ -Subproject commit 5d584576ef79ca36506e6c7470e7ac5204cf0a8d +Subproject commit 41f7a3530d4cacdbf668399d3a015ea29c7e169b diff --git a/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center index 3ffb3f02d2..6a034887e3 160000 --- a/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center +++ b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center @@ -1 +1 @@ -Subproject commit 3ffb3f02d2046910e09d1f5a74721bd1a4cdf8cf +Subproject commit 6a034887e370caa61fee5f51db8dd393d3e72542 diff --git a/frozen/Adafruit_CircuitPython_BusDevice b/frozen/Adafruit_CircuitPython_BusDevice index e9411c4244..eb4b21e216 160000 --- a/frozen/Adafruit_CircuitPython_BusDevice +++ b/frozen/Adafruit_CircuitPython_BusDevice @@ -1 +1 @@ -Subproject commit e9411c4244984b69ec6928370ede40cec014c10b +Subproject commit eb4b21e216efd8ec0c4862a938e81b56be961724 diff --git a/frozen/Adafruit_CircuitPython_CircuitPlayground b/frozen/Adafruit_CircuitPython_CircuitPlayground index e9f15d6150..3c540329b6 160000 --- a/frozen/Adafruit_CircuitPython_CircuitPlayground +++ b/frozen/Adafruit_CircuitPython_CircuitPlayground @@ -1 +1 @@ -Subproject commit e9f15d61502f34173912ba271aaaf9446dae8da1 +Subproject commit 3c540329b63163e45f108df4bfebc387d5352c4f diff --git a/frozen/Adafruit_CircuitPython_Crickit b/frozen/Adafruit_CircuitPython_Crickit index 0e1230676a..809646ba11 160000 --- a/frozen/Adafruit_CircuitPython_Crickit +++ b/frozen/Adafruit_CircuitPython_Crickit @@ -1 +1 @@ -Subproject commit 0e1230676a54da17a309d1dfffdd7fa90240191c +Subproject commit 809646ba11366b5aedbc8a90be1da1829304bf62 diff --git a/frozen/Adafruit_CircuitPython_DRV2605 b/frozen/Adafruit_CircuitPython_DRV2605 index 7914a63903..209edd164e 160000 --- a/frozen/Adafruit_CircuitPython_DRV2605 +++ b/frozen/Adafruit_CircuitPython_DRV2605 @@ -1 +1 @@ -Subproject commit 7914a6390318687bb8e2e9c4119aa932fea01531 +Subproject commit 209edd164eb640a8ced561a54505792fc99a67b9 diff --git a/frozen/Adafruit_CircuitPython_DS3231 b/frozen/Adafruit_CircuitPython_DS3231 index 0d49a1fcd9..5d81a9ea82 160000 --- a/frozen/Adafruit_CircuitPython_DS3231 +++ b/frozen/Adafruit_CircuitPython_DS3231 @@ -1 +1 @@ -Subproject commit 0d49a1fcd96c13a94e8bdf26f92abe79b8517906 +Subproject commit 5d81a9ea822a85e46be4a512ac44abf21e77d816 diff --git a/frozen/Adafruit_CircuitPython_ESP32SPI b/frozen/Adafruit_CircuitPython_ESP32SPI index 94b03517c1..01f3f6674b 160000 --- a/frozen/Adafruit_CircuitPython_ESP32SPI +++ b/frozen/Adafruit_CircuitPython_ESP32SPI @@ -1 +1 @@ -Subproject commit 94b03517c1f4ff68cc2bb09b0963f7e7e3ce3d04 +Subproject commit 01f3f6674b4493ba29b857e0f43deb69975736ec diff --git a/frozen/Adafruit_CircuitPython_FocalTouch b/frozen/Adafruit_CircuitPython_FocalTouch index 72968d3546..1e3312ab1c 160000 --- a/frozen/Adafruit_CircuitPython_FocalTouch +++ b/frozen/Adafruit_CircuitPython_FocalTouch @@ -1 +1 @@ -Subproject commit 72968d3546f9d6c5af138d4c179343007cb9662c +Subproject commit 1e3312ab1cba0b1d3bb1f559c52acfdc1a6d57b8 diff --git a/frozen/Adafruit_CircuitPython_HID b/frozen/Adafruit_CircuitPython_HID index 65fb213b8c..829ba0f0a2 160000 --- a/frozen/Adafruit_CircuitPython_HID +++ b/frozen/Adafruit_CircuitPython_HID @@ -1 +1 @@ -Subproject commit 65fb213b8c554181d54b77f75335e16e2f4c0987 +Subproject commit 829ba0f0a2d8a63f7d0215c6c9fc821e14e52a93 diff --git a/frozen/Adafruit_CircuitPython_IRRemote b/frozen/Adafruit_CircuitPython_IRRemote index d435fc9a9d..fc3a7b4798 160000 --- a/frozen/Adafruit_CircuitPython_IRRemote +++ b/frozen/Adafruit_CircuitPython_IRRemote @@ -1 +1 @@ -Subproject commit d435fc9a9d90cb063608ae037bf5284b33bc5e84 +Subproject commit fc3a7b479874a1ea315ddb3bf6c5e281e16ef097 diff --git a/frozen/Adafruit_CircuitPython_LIS3DH b/frozen/Adafruit_CircuitPython_LIS3DH index 457aba6dd5..9fe8f314c0 160000 --- a/frozen/Adafruit_CircuitPython_LIS3DH +++ b/frozen/Adafruit_CircuitPython_LIS3DH @@ -1 +1 @@ -Subproject commit 457aba6dd59ad00502b80c9031655d3d26ecc82b +Subproject commit 9fe8f314c032cee89b9ad7697d61e9cba76431ff diff --git a/frozen/Adafruit_CircuitPython_LSM6DS b/frozen/Adafruit_CircuitPython_LSM6DS index ee8f2187d4..f1cc47f024 160000 --- a/frozen/Adafruit_CircuitPython_LSM6DS +++ b/frozen/Adafruit_CircuitPython_LSM6DS @@ -1 +1 @@ -Subproject commit ee8f2187d4795b08ae4aa60558f564d26c997be9 +Subproject commit f1cc47f024b27e670b9bf2a51c89e32f93c1b957 diff --git a/frozen/Adafruit_CircuitPython_Motor b/frozen/Adafruit_CircuitPython_Motor index 5fd72fb963..434e5b5346 160000 --- a/frozen/Adafruit_CircuitPython_Motor +++ b/frozen/Adafruit_CircuitPython_Motor @@ -1 +1 @@ -Subproject commit 5fd72fb963c4a0318d29282ca2cc988f19787fda +Subproject commit 434e5b5346cb0a1a9eb15989b00278be87cb2ff1 diff --git a/frozen/Adafruit_CircuitPython_Register b/frozen/Adafruit_CircuitPython_Register index 56358b4494..6143ec2a96 160000 --- a/frozen/Adafruit_CircuitPython_Register +++ b/frozen/Adafruit_CircuitPython_Register @@ -1 +1 @@ -Subproject commit 56358b4494da825cd99a56a854119f926abca670 +Subproject commit 6143ec2a96a6d218041e9cab5968de26702d7bbf diff --git a/frozen/Adafruit_CircuitPython_Requests b/frozen/Adafruit_CircuitPython_Requests index 41de8b3c05..43017e30a1 160000 --- a/frozen/Adafruit_CircuitPython_Requests +++ b/frozen/Adafruit_CircuitPython_Requests @@ -1 +1 @@ -Subproject commit 41de8b3c05dd78d7be8893a0f6cb47a7e9b421a2 +Subproject commit 43017e30a1e772b67ac68293a944e863c031e389 diff --git a/frozen/Adafruit_CircuitPython_Thermistor b/frozen/Adafruit_CircuitPython_Thermistor index b5bbdbd56c..fb773e0ed1 160000 --- a/frozen/Adafruit_CircuitPython_Thermistor +++ b/frozen/Adafruit_CircuitPython_Thermistor @@ -1 +1 @@ -Subproject commit b5bbdbd56ca205c581ba2c84d927ef99befce88e +Subproject commit fb773e0ed1891cda2ace6271fafc5312e167d275 diff --git a/frozen/Adafruit_CircuitPython_seesaw b/frozen/Adafruit_CircuitPython_seesaw index 76c0dd1329..88738da275 160000 --- a/frozen/Adafruit_CircuitPython_seesaw +++ b/frozen/Adafruit_CircuitPython_seesaw @@ -1 +1 @@ -Subproject commit 76c0dd13294ce8ae0518cb9882dcad5d3668977e +Subproject commit 88738da275a83acabb14b7140d1c79b33cdc7b02 diff --git a/frozen/circuitpython-stage b/frozen/circuitpython-stage index 0d2c083a2f..9596a5904e 160000 --- a/frozen/circuitpython-stage +++ b/frozen/circuitpython-stage @@ -1 +1 @@ -Subproject commit 0d2c083a2fb57a1562d4806775f45273abbfbfae +Subproject commit 9596a5904ed757e6fbffcf03e7aa77ae9ecf5223 diff --git a/lib/mp3 b/lib/mp3 index c3c664bf4d..bc58a65496 160000 --- a/lib/mp3 +++ b/lib/mp3 @@ -1 +1 @@ -Subproject commit c3c664bf4db6a36d11808dfcbb5dbf7cff1715b8 +Subproject commit bc58a654964c799e972719a63ff12694998f3549 diff --git a/lib/protomatter b/lib/protomatter index 9f71088d2c..761d6437e8 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit 9f71088d2c32206c6f0495704ae0c040426d5764 +Subproject commit 761d6437e8cd6a131d51de96974337121a9c7164 diff --git a/lib/tinyusb b/lib/tinyusb index dc5445e2f4..22100b252f 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit dc5445e2f45cb348a44fe24fc1be4bc8b5ba5bab +Subproject commit 22100b252fc2eb8f51ed407949645653c4880fd9 diff --git a/ports/atmel-samd/asf4 b/ports/atmel-samd/asf4 index 039b5f3bbc..35a1525796 160000 --- a/ports/atmel-samd/asf4 +++ b/ports/atmel-samd/asf4 @@ -1 +1 @@ -Subproject commit 039b5f3bbc3f4ba4421e581db290560d59fef625 +Subproject commit 35a1525796c7ef8a3893d90befdad2f267fca20e diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 6b531fc923..0f5f1522d0 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 6b531fc923d9f02b14bd731a5f584ddf716e8773 +Subproject commit 0f5f1522d09c8fa7d858edec484a994c21c59668 diff --git a/ports/cxd56/spresense-exported-sdk b/ports/cxd56/spresense-exported-sdk index 7f6568c7f4..c991d439fa 160000 --- a/ports/cxd56/spresense-exported-sdk +++ b/ports/cxd56/spresense-exported-sdk @@ -1 +1 @@ -Subproject commit 7f6568c7f4898cdb24a2f06040784a836050686e +Subproject commit c991d439fac9c23cfcac0da16fe8055f818d40a4 diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index 0daf6e0e41..160ba4924d 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit 0daf6e0e41f95d22d193d08941a00df9525bc405 +Subproject commit 160ba4924d8b588e718f76e3a0d0e92c11052fa3 diff --git a/ports/stm/st_driver b/ports/stm/st_driver index 3fc2e0f3db..1900834751 160000 --- a/ports/stm/st_driver +++ b/ports/stm/st_driver @@ -1 +1 @@ -Subproject commit 3fc2e0f3db155b33177bb0705e0dd65cadb58412 +Subproject commit 1900834751fd6754457874b8c971690bab33e0a7 From 644d2ba7a2075c44306583fada847047a7a44d5d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 3 Aug 2020 16:40:45 -0700 Subject: [PATCH 0683/1293] Add more "extern" declarations for gcc10 compat gcc has tightened the restrictions on forward declarations that lack "extern". Fix them up. --- .../common-hal/microcontroller/Processor.h | 2 +- ports/mimxrt10xx/mphalport.h | 4 ++-- .../peripherals/mimxrt10xx/MIMXRT1011/periph.h | 6 +++--- .../peripherals/mimxrt10xx/MIMXRT1021/periph.h | 6 +++--- .../peripherals/mimxrt10xx/MIMXRT1062/periph.h | 6 +++--- ports/nrf/common-hal/_bleio/__init__.c | 2 ++ ports/nrf/common-hal/_bleio/__init__.h | 2 +- ports/stm/common-hal/pulseio/PWMOut.c | 2 +- ports/stm/mphalport.h | 4 ++-- .../peripherals/stm32f4/stm32f401xe/periph.h | 4 ++-- .../peripherals/stm32f4/stm32f405xx/periph.h | 4 ++-- .../peripherals/stm32f4/stm32f407xx/periph.h | 4 ++-- .../peripherals/stm32f4/stm32f411xe/periph.h | 4 ++-- .../peripherals/stm32f4/stm32f412zx/periph.h | 4 ++-- .../peripherals/stm32f7/stm32f746xx/periph.h | 16 ++++++++-------- .../peripherals/stm32f7/stm32f767xx/periph.h | 18 +++++++++--------- .../peripherals/stm32h7/stm32h743xx/periph.h | 16 ++++++++-------- ports/stm/supervisor/internal_flash.c | 4 ++-- shared-bindings/_bleio/Adapter.h | 2 +- shared-bindings/_bleio/Service.h | 2 +- shared-bindings/gnss/PositionFix.h | 2 +- shared-bindings/gnss/SatelliteSystem.h | 2 +- shared-bindings/watchdog/WatchDogMode.h | 2 +- 23 files changed, 60 insertions(+), 58 deletions(-) diff --git a/ports/cxd56/common-hal/microcontroller/Processor.h b/ports/cxd56/common-hal/microcontroller/Processor.h index 12555e82c1..5d7ad56977 100644 --- a/ports/cxd56/common-hal/microcontroller/Processor.h +++ b/ports/cxd56/common-hal/microcontroller/Processor.h @@ -35,6 +35,6 @@ typedef struct { mp_obj_base_t base; } mcu_processor_obj_t; -const mp_obj_type_t mcu_processor_type; +extern const mp_obj_type_t mcu_processor_type; #endif // MICROPY_INCLUDED_CXD56_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H diff --git a/ports/mimxrt10xx/mphalport.h b/ports/mimxrt10xx/mphalport.h index 1acc461b7e..4ba3a24764 100644 --- a/ports/mimxrt10xx/mphalport.h +++ b/ports/mimxrt10xx/mphalport.h @@ -39,8 +39,8 @@ static inline mp_uint_t mp_hal_ticks_ms(void) { return supervisor_ticks_ms32(); } // Number of bytes in receive buffer -volatile uint8_t usb_rx_count; -volatile bool mp_cdc_enabled; +extern volatile uint8_t usb_rx_count; +extern volatile bool mp_cdc_enabled; int receive_usb(void); diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h index 3bc86f33a5..c3f04a0490 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h @@ -27,18 +27,18 @@ #ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H #define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H -LPI2C_Type *mcu_i2c_banks[2]; +extern LPI2C_Type *mcu_i2c_banks[2]; extern const mcu_periph_obj_t mcu_i2c_sda_list[8]; extern const mcu_periph_obj_t mcu_i2c_scl_list[8]; -LPSPI_Type *mcu_spi_banks[2]; +extern LPSPI_Type *mcu_spi_banks[2]; extern const mcu_periph_obj_t mcu_spi_sck_list[4]; extern const mcu_periph_obj_t mcu_spi_mosi_list[4]; extern const mcu_periph_obj_t mcu_spi_miso_list[4]; -LPUART_Type *mcu_uart_banks[4]; +extern LPUART_Type *mcu_uart_banks[4]; extern const mcu_periph_obj_t mcu_uart_rx_list[9]; extern const mcu_periph_obj_t mcu_uart_tx_list[9]; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h index 814bc5f6c3..6c778ad525 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h @@ -28,18 +28,18 @@ #ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PERIPH_H #define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PERIPH_H -LPI2C_Type *mcu_i2c_banks[4]; +extern LPI2C_Type *mcu_i2c_banks[4]; extern const mcu_periph_obj_t mcu_i2c_sda_list[8]; extern const mcu_periph_obj_t mcu_i2c_scl_list[8]; -LPSPI_Type *mcu_spi_banks[4]; +extern LPSPI_Type *mcu_spi_banks[4]; extern const mcu_periph_obj_t mcu_spi_sck_list[8]; extern const mcu_periph_obj_t mcu_spi_mosi_list[8]; extern const mcu_periph_obj_t mcu_spi_miso_list[8]; -LPUART_Type *mcu_uart_banks[8]; +extern LPUART_Type *mcu_uart_banks[8]; extern const mcu_periph_obj_t mcu_uart_rx_list[16]; extern const mcu_periph_obj_t mcu_uart_tx_list[16]; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h index 35ac4fc9b7..4f6ab6261e 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h @@ -27,18 +27,18 @@ #ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H #define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H -LPI2C_Type *mcu_i2c_banks[4]; +extern LPI2C_Type *mcu_i2c_banks[4]; extern const mcu_periph_obj_t mcu_i2c_sda_list[9]; extern const mcu_periph_obj_t mcu_i2c_scl_list[9]; -LPSPI_Type *mcu_spi_banks[4]; +extern LPSPI_Type *mcu_spi_banks[4]; extern const mcu_periph_obj_t mcu_spi_sck_list[8]; extern const mcu_periph_obj_t mcu_spi_mosi_list[8]; extern const mcu_periph_obj_t mcu_spi_miso_list[8]; -LPUART_Type *mcu_uart_banks[8]; +extern LPUART_Type *mcu_uart_banks[8]; extern const mcu_periph_obj_t mcu_uart_rx_list[18]; extern const mcu_periph_obj_t mcu_uart_tx_list[18]; diff --git a/ports/nrf/common-hal/_bleio/__init__.c b/ports/nrf/common-hal/_bleio/__init__.c index e84bba6626..23d7397c79 100644 --- a/ports/nrf/common-hal/_bleio/__init__.c +++ b/ports/nrf/common-hal/_bleio/__init__.c @@ -87,6 +87,8 @@ void check_sec_status(uint8_t sec_status) { } } +bool vm_used_ble; + // Turn off BLE on a reset or reload. void bleio_reset() { if (!common_hal_bleio_adapter_get_enabled(&common_hal_bleio_adapter_obj)) { diff --git a/ports/nrf/common-hal/_bleio/__init__.h b/ports/nrf/common-hal/_bleio/__init__.h index e216795fcd..6881c90e6c 100644 --- a/ports/nrf/common-hal/_bleio/__init__.h +++ b/ports/nrf/common-hal/_bleio/__init__.h @@ -45,6 +45,6 @@ void check_gatt_status(uint16_t gatt_status); void check_sec_status(uint8_t sec_status); // Track if the user code modified the BLE state to know if we need to undo it on reload. -bool vm_used_ble; +extern bool vm_used_ble; #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_BLEIO_INIT_H diff --git a/ports/stm/common-hal/pulseio/PWMOut.c b/ports/stm/common-hal/pulseio/PWMOut.c index ddbadaf4ce..c9768f4f61 100644 --- a/ports/stm/common-hal/pulseio/PWMOut.c +++ b/ports/stm/common-hal/pulseio/PWMOut.c @@ -96,7 +96,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, //if pin is same if (l_tim->pin == pin) { //check if the timer has a channel active, or is reserved by main timer system - if (reserved_tim[l_tim_index] != 0) { + if (l_tim_index < TIM_BANK_ARRAY_LEN && reserved_tim[l_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; diff --git a/ports/stm/mphalport.h b/ports/stm/mphalport.h index 69f2c489c5..2c4caf3b22 100644 --- a/ports/stm/mphalport.h +++ b/ports/stm/mphalport.h @@ -38,8 +38,8 @@ static inline mp_uint_t mp_hal_ticks_ms(void) { return supervisor_ticks_ms32(); } // Number of bytes in receive buffer -volatile uint8_t usb_rx_count; -volatile bool mp_cdc_enabled; +extern volatile uint8_t usb_rx_count; +extern volatile bool mp_cdc_enabled; int receive_usb(void); diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h b/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h index ae416bda1d..c38e9ea98b 100644 --- a/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h @@ -51,7 +51,7 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[6]; //Timers #define TIM_BANK_ARRAY_LEN 14 #define TIM_PIN_ARRAY_LEN 44 -TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; -const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; +extern TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; +extern const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; #endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F401XE_PERIPH_H diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h index 020bff3709..5b64fe10c4 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h @@ -58,8 +58,8 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[UART_RX_ARRAY_LEN]; //Timers #define TIM_BANK_ARRAY_LEN 14 #define TIM_PIN_ARRAY_LEN 67 -TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; -const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; +extern TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; +extern const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; //SDIO extern SDIO_TypeDef * mcu_sdio_banks[1]; diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h b/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h index 55c00ee936..fb6348abaa 100644 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h @@ -51,7 +51,7 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[12]; //Timers #define TIM_BANK_ARRAY_LEN 14 #define TIM_PIN_ARRAY_LEN 56 -TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; -const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; +extern TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; +extern const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; #endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F407XX_PERIPH_H diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h b/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h index 14a73d12f1..f78cb57a7b 100644 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h @@ -51,7 +51,7 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[7]; //Timers #define TIM_BANK_ARRAY_LEN 14 #define TIM_PIN_ARRAY_LEN 44 -TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; -const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; +extern TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; +extern const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; #endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F411XE_PERIPH_H diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h b/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h index f6b001a4e9..40afd27f46 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h @@ -52,7 +52,7 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[12]; //Timers #define TIM_BANK_ARRAY_LEN 14 #define TIM_PIN_ARRAY_LEN 60 -TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; -const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; +extern TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; +extern const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; #endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F412ZX_PERIPH_H diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/periph.h b/ports/stm/peripherals/stm32f7/stm32f746xx/periph.h index 26f4ad2b54..f20896e22e 100644 --- a/ports/stm/peripherals/stm32f7/stm32f746xx/periph.h +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/periph.h @@ -31,28 +31,28 @@ //I2C extern I2C_TypeDef * mcu_i2c_banks[4]; -const mcu_periph_obj_t mcu_i2c_sda_list[10]; -const mcu_periph_obj_t mcu_i2c_scl_list[10]; +extern const mcu_periph_obj_t mcu_i2c_sda_list[10]; +extern const mcu_periph_obj_t mcu_i2c_scl_list[10]; //SPI extern SPI_TypeDef * mcu_spi_banks[6]; -const mcu_periph_obj_t mcu_spi_sck_list[14]; -const mcu_periph_obj_t mcu_spi_mosi_list[15]; -const mcu_periph_obj_t mcu_spi_miso_list[12]; +extern const mcu_periph_obj_t mcu_spi_sck_list[14]; +extern const mcu_periph_obj_t mcu_spi_mosi_list[15]; +extern const mcu_periph_obj_t mcu_spi_miso_list[12]; //UART extern USART_TypeDef * mcu_uart_banks[MAX_UART]; extern bool mcu_uart_has_usart[MAX_UART]; -const mcu_periph_obj_t mcu_uart_tx_list[15]; -const mcu_periph_obj_t mcu_uart_rx_list[15]; +extern const mcu_periph_obj_t mcu_uart_tx_list[15]; +extern const mcu_periph_obj_t mcu_uart_rx_list[15]; //Timers #define TIM_BANK_ARRAY_LEN 14 #define TIM_PIN_ARRAY_LEN 55 extern TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; -const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; +extern const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; #endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F746XX_PERIPH_H diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h b/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h index 438964c3e1..70f03f2580 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h @@ -30,28 +30,28 @@ //I2C extern I2C_TypeDef * mcu_i2c_banks[4]; -const mcu_periph_obj_t mcu_i2c_sda_list[12]; -const mcu_periph_obj_t mcu_i2c_scl_list[12]; +extern const mcu_periph_obj_t mcu_i2c_sda_list[12]; +extern const mcu_periph_obj_t mcu_i2c_scl_list[12]; //SPI extern SPI_TypeDef * mcu_spi_banks[6]; -const mcu_periph_obj_t mcu_spi_sck_list[18]; -const mcu_periph_obj_t mcu_spi_mosi_list[18]; -const mcu_periph_obj_t mcu_spi_miso_list[15]; +extern const mcu_periph_obj_t mcu_spi_sck_list[18]; +extern const mcu_periph_obj_t mcu_spi_mosi_list[18]; +extern const mcu_periph_obj_t mcu_spi_miso_list[15]; //UART extern USART_TypeDef * mcu_uart_banks[MAX_UART]; extern bool mcu_uart_has_usart[MAX_UART]; -const mcu_periph_obj_t mcu_uart_tx_list[24]; -const mcu_periph_obj_t mcu_uart_rx_list[25]; +extern const mcu_periph_obj_t mcu_uart_tx_list[24]; +extern const mcu_periph_obj_t mcu_uart_rx_list[25]; //Timers #define TIM_BANK_ARRAY_LEN 14 #define TIM_PIN_ARRAY_LEN 55 -TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; +extern TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; -const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; +extern const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; #endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F767XX_PERIPH_H diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/periph.h b/ports/stm/peripherals/stm32h7/stm32h743xx/periph.h index 9aa2f7366b..e3902e7c74 100644 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/periph.h +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/periph.h @@ -30,26 +30,26 @@ //I2C extern I2C_TypeDef * mcu_i2c_banks[4]; -const mcu_periph_obj_t mcu_i2c_sda_list[12]; -const mcu_periph_obj_t mcu_i2c_scl_list[12]; +extern const mcu_periph_obj_t mcu_i2c_sda_list[12]; +extern const mcu_periph_obj_t mcu_i2c_scl_list[12]; //SPI extern SPI_TypeDef * mcu_spi_banks[6]; -const mcu_periph_obj_t mcu_spi_sck_list[19]; -const mcu_periph_obj_t mcu_spi_mosi_list[19]; -const mcu_periph_obj_t mcu_spi_miso_list[16]; +extern const mcu_periph_obj_t mcu_spi_sck_list[19]; +extern const mcu_periph_obj_t mcu_spi_mosi_list[19]; +extern const mcu_periph_obj_t mcu_spi_miso_list[16]; //UART extern USART_TypeDef * mcu_uart_banks[MAX_UART]; extern bool mcu_uart_has_usart[MAX_UART]; -const mcu_periph_obj_t mcu_uart_tx_list[25]; -const mcu_periph_obj_t mcu_uart_rx_list[26]; +extern const mcu_periph_obj_t mcu_uart_tx_list[25]; +extern const mcu_periph_obj_t mcu_uart_rx_list[26]; //Timers #define TIM_BANK_ARRAY_LEN 14 #define TIM_PIN_ARRAY_LEN 58 -TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; +extern TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; #endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32H743XX_PERIPH_H diff --git a/ports/stm/supervisor/internal_flash.c b/ports/stm/supervisor/internal_flash.c index 864403c366..78ee4f3e60 100644 --- a/ports/stm/supervisor/internal_flash.c +++ b/ports/stm/supervisor/internal_flash.c @@ -177,13 +177,13 @@ void port_internal_flash_flush(void) { EraseInitStruct.VoltageRange = VOLTAGE_RANGE_3; // voltage range needs to be 2.7V to 3.6V // get the sector information uint32_t sector_size; - uint32_t sector_start_addr; + uint32_t sector_start_addr = 0xffffffff; #if defined(STM32H7) EraseInitStruct.Banks = get_bank(_cache_flash_addr); #endif EraseInitStruct.Sector = flash_get_sector_info(_cache_flash_addr, §or_start_addr, §or_size); EraseInitStruct.NbSectors = 1; - if (sector_size > sizeof(_flash_cache)) { + if (sector_size > sizeof(_flash_cache) || sector_start_addr == 0xffffffff) { reset_into_safe_mode(FLASH_WRITE_FAIL); } diff --git a/shared-bindings/_bleio/Adapter.h b/shared-bindings/_bleio/Adapter.h index 3523733577..c56dbb01cf 100644 --- a/shared-bindings/_bleio/Adapter.h +++ b/shared-bindings/_bleio/Adapter.h @@ -35,7 +35,7 @@ #include "py/objstr.h" #include "shared-module/_bleio/Address.h" -const mp_obj_type_t bleio_adapter_type; +extern const mp_obj_type_t bleio_adapter_type; extern bool common_hal_bleio_adapter_get_advertising(bleio_adapter_obj_t *self); extern bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self); diff --git a/shared-bindings/_bleio/Service.h b/shared-bindings/_bleio/Service.h index 273c6bd989..3af427f950 100644 --- a/shared-bindings/_bleio/Service.h +++ b/shared-bindings/_bleio/Service.h @@ -34,7 +34,7 @@ #include "py/objtuple.h" -const mp_obj_type_t bleio_service_type; +extern const mp_obj_type_t bleio_service_type; // Private version that doesn't allocate on the heap extern uint32_t _common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uuid_obj_t *uuid, bool is_secondary, mp_obj_list_t * characteristic_list); diff --git a/shared-bindings/gnss/PositionFix.h b/shared-bindings/gnss/PositionFix.h index 34090872cc..0fd595fc6c 100644 --- a/shared-bindings/gnss/PositionFix.h +++ b/shared-bindings/gnss/PositionFix.h @@ -13,7 +13,7 @@ typedef enum { POSITIONFIX_3D, } gnss_positionfix_t; -const mp_obj_type_t gnss_positionfix_type; +extern const mp_obj_type_t gnss_positionfix_type; gnss_positionfix_t gnss_positionfix_obj_to_type(mp_obj_t obj); mp_obj_t gnss_positionfix_type_to_obj(gnss_positionfix_t mode); diff --git a/shared-bindings/gnss/SatelliteSystem.h b/shared-bindings/gnss/SatelliteSystem.h index 17f1550028..02cd17db2f 100644 --- a/shared-bindings/gnss/SatelliteSystem.h +++ b/shared-bindings/gnss/SatelliteSystem.h @@ -16,7 +16,7 @@ typedef enum { SATELLITESYSTEM_QZSS_L1S = (1U << 4), } gnss_satellitesystem_t; -const mp_obj_type_t gnss_satellitesystem_type; +extern const mp_obj_type_t gnss_satellitesystem_type; gnss_satellitesystem_t gnss_satellitesystem_obj_to_type(mp_obj_t obj); mp_obj_t gnss_satellitesystem_type_to_obj(gnss_satellitesystem_t mode); diff --git a/shared-bindings/watchdog/WatchDogMode.h b/shared-bindings/watchdog/WatchDogMode.h index 68022671fb..fb09445a9f 100644 --- a/shared-bindings/watchdog/WatchDogMode.h +++ b/shared-bindings/watchdog/WatchDogMode.h @@ -35,7 +35,7 @@ typedef enum { WATCHDOGMODE_RESET, } watchdog_watchdogmode_t; -const mp_obj_type_t watchdog_watchdogmode_type; +extern const mp_obj_type_t watchdog_watchdogmode_type; watchdog_watchdogmode_t watchdog_watchdogmode_obj_to_type(mp_obj_t obj); mp_obj_t watchdog_watchdogmode_type_to_obj(watchdog_watchdogmode_t mode); From 9a6a156512afefaf8413482be63e1ec73d626ee8 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Fri, 21 Aug 2020 15:26:50 -0500 Subject: [PATCH 0684/1293] Update documentation string with blank line --- shared-bindings/displayio/Bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 2fb1cd11eb..c669e5312b 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -172,10 +172,10 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val return mp_const_none; } - //| def blit(self, x: int, y: int, source_bitmap: bitmap, *, x1: int, y1: int, x2: int, y2: int, skip_index: int) -> None: //| """Inserts the source_bitmap region defined by rectangular boundaries //| (x1,y1) and (x2,y2) into the bitmap at the specified (x,y) location. +//| //| :param int x: Horizontal pixel location in bitmap where source_bitmap upper-left //| corner will be placed //| :param int y: Vertical pixel location in bitmap where source_bitmap upper-left From da61845f565ee7c5c00a15559301cc96359acbd0 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 21 Aug 2020 13:32:59 -0700 Subject: [PATCH 0685/1293] Add missing include --- ports/esp32s2/common-hal/socketpool/Socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/esp32s2/common-hal/socketpool/Socket.c index db8356f66f..003ba24434 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.c +++ b/ports/esp32s2/common-hal/socketpool/Socket.c @@ -26,6 +26,7 @@ #include "shared-bindings/socketpool/Socket.h" +#include "bindings/espidf/__init__.h" #include "lib/utils/interrupt_char.h" #include "py/mperrno.h" #include "py/runtime.h" From 770c204d5a283add29e03e421490e1d5b9663f3c Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 21 Aug 2020 17:03:45 -0400 Subject: [PATCH 0686/1293] sphinx fixes --- shared-bindings/_bleio/Adapter.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 8f96d13ea1..5b67a9ae95 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -73,11 +73,10 @@ //| def hci_uart_init(self, *, uart: busio.UART, rts: digitalio.DigitalInOut, cts: digitalio.DigitalInOut, baudrate: int = 115200, buffer_size: int = 256) -> None: //| """On boards that do not have native BLE, you can an use HCI co-processor. -//| Call `_bleio.adapter.hci_uart_init()` passing it the uart and pins used to communicate -//| with the co-processor, such as an Adafruit AirLift. +//| Pass the uart and pins used to communicate with the co-processor, such as an Adafruit AirLift. //| The co-processor must have been reset and put into BLE mode beforehand //| by the appropriate pin manipulation. -//| The `uart`, `rts`, and `cts` objects are used to +//| The ``uart``, ``rts``, and ``cts`` objects are used to //| communicate with the HCI co-processor in HCI mode. //| //| The `_bleio.adapter` object is enabled during this call. From f1fb2cde175c72d9b4fc6c88b07bf45e21376cf7 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Fri, 21 Aug 2020 16:12:40 -0500 Subject: [PATCH 0687/1293] Minor tweaks to try to fix documentation failing --- shared-bindings/displayio/Bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index c669e5312b..dad8beeaf4 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -186,7 +186,7 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val //| :param int x2: Maximum x-value (exclusive) for rectangular bounding box to be copied from the source bitmap //| :param int y2: Maximum y-value (exclusive) for rectangular bounding box to be copied from the source bitmap //| :param int skip_index: bitmap palette index in the source that will not be copied, -//| set `None` to copy all pixels""" +//| set to None to copy all pixels""" //| ... //| From 5b6313e642f90be13351a58e9a8d0ef325bdeb35 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Fri, 21 Aug 2020 16:13:18 -0500 Subject: [PATCH 0688/1293] More tweaks to try to fix documentation failing --- shared-bindings/displayio/Bitmap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index dad8beeaf4..c13ed0407e 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -189,7 +189,6 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val //| set to None to copy all pixels""" //| ... //| - STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args){ enum {ARG_x, ARG_y, ARG_source, ARG_x1, ARG_y1, ARG_x2, ARG_y2, ARG_skip_index}; static const mp_arg_t allowed_args[] = { From f39708abb23b7c7794c04de184213433de481a33 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 21 Aug 2020 16:20:58 -0700 Subject: [PATCH 0689/1293] Add PSRAM support to ESP32S2 When configured the CircuitPython heap will be on the external RAM. When not available, the heap will be 48k inside the IDF heap. --- main.c | 5 +-- .../boards/espressif_saola_1_wrover/sdkconfig | 33 +++++++++++++++++ .../unexpectedmaker_feathers2/sdkconfig | 35 +++++++++++++++++++ ports/esp32s2/supervisor/port.c | 23 +++++++++--- 4 files changed, 90 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index fb73b09b1f..3a14df0fa6 100755 --- a/main.c +++ b/main.c @@ -436,11 +436,12 @@ int run_repl(void) { } int __attribute__((used)) main(void) { - memory_init(); - // initialise the cpu and peripherals safe_mode_t safe_mode = port_init(); + // Init memory after the port in case the port needs to set aside memory. + memory_init(); + // Turn on LEDs init_status_leds(); rgb_led_status_init(); diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/sdkconfig b/ports/esp32s2/boards/espressif_saola_1_wrover/sdkconfig index e69de29bb2..9d8bbde967 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/sdkconfig +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/sdkconfig @@ -0,0 +1,33 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 + +# +# PSRAM clock and cs IO for ESP32S2 +# +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM clock and cs IO for ESP32S2 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig b/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig index e69de29bb2..b73c4a8c20 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig @@ -0,0 +1,35 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM64=y +CONFIG_SPIRAM_SIZE=8388608 + +# +# PSRAM clock and cs IO for ESP32S2 +# +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM clock and cs IO for ESP32S2 + +CONFIG_SPIRAM_SPIWP_SD3_PIN=28 +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_USE_AHB_DBUS3 is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 46590b5513..08710fe910 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -43,7 +43,14 @@ #include "supervisor/memory.h" #include "supervisor/shared/tick.h" -#include "rmt.h" +#include "peripherals/rmt.h" +#include "esp-idf/components/heap/include/esp_heap_caps.h" +#include "esp-idf/components/soc/soc/esp32s2/include/soc/cache_memory.h" + +#define HEAP_SIZE (48 * 1024) + +uint32_t* heap; +uint32_t heap_size; STATIC esp_timer_handle_t _tick_timer; @@ -59,6 +66,16 @@ safe_mode_t port_init(void) { args.name = "CircuitPython Tick"; esp_timer_create(&args, &_tick_timer); never_reset_module_internal_pins(); + + #ifdef CONFIG_SPIRAM + heap = (uint32_t*) (DRAM0_CACHE_ADDRESS_HIGH - CONFIG_SPIRAM_SIZE); + heap_size = CONFIG_SPIRAM_SIZE / sizeof(uint32_t); + #endif + + if (heap == NULL) { + heap = malloc(HEAP_SIZE); + heap_size = HEAP_SIZE / sizeof(uint32_t); + } return NO_SAFE_MODE; } @@ -86,14 +103,12 @@ void reset_to_bootloader(void) { void reset_cpu(void) { } -uint32_t heap[64 / sizeof(uint32_t) * 1024]; - uint32_t *port_heap_get_bottom(void) { return heap; } uint32_t *port_heap_get_top(void) { - return heap + sizeof(heap) / sizeof(heap[0]); + return heap + heap_size; } uint32_t *port_stack_get_limit(void) { From dc502a5f26fdf5514eb835fae5f523c1b15c23b5 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Fri, 21 Aug 2020 19:08:25 -0500 Subject: [PATCH 0690/1293] remove extraneous files --- shared-bindings/_typing/__init__ 2.pyi | 54 -- shared-bindings/gnss/GNSS 2.c | 205 -------- shared-bindings/gnss/GNSS 2.h | 27 - shared-bindings/gnss/PositionFix 2.c | 80 --- shared-bindings/gnss/PositionFix 2.h | 28 -- shared-bindings/gnss/SatelliteSystem 2.c | 113 ----- shared-bindings/gnss/SatelliteSystem 2.h | 33 -- shared-bindings/gnss/__init__ 2.c | 31 -- .../i2cperipheral/I2CPeripheral 2.c | 436 ---------------- .../i2cperipheral/I2CPeripheral 2.h | 60 --- shared-bindings/i2cperipheral/__init__ 2.c | 106 ---- .../memorymonitor/AllocationAlarm 2.c | 137 ----- .../memorymonitor/AllocationAlarm 2.h | 39 -- .../memorymonitor/AllocationSize 2.c | 183 ------- .../memorymonitor/AllocationSize 2.h | 42 -- shared-bindings/memorymonitor/__init__ 2.c | 76 --- shared-bindings/memorymonitor/__init__ 2.h | 49 -- shared-bindings/sdcardio/SDCard 2.c | 183 ------- shared-bindings/sdcardio/SDCard 2.h | 30 -- shared-bindings/sdcardio/__init__ 2.c | 47 -- shared-bindings/sdcardio/__init__ 2.h | 0 shared-module/sdcardio/SDCard 2.c | 466 ------------------ shared-module/sdcardio/SDCard 2.h | 51 -- shared-module/sdcardio/__init__ 2.c | 0 shared-module/sdcardio/__init__ 2.h | 0 supervisor/background_callback 2.h | 87 ---- supervisor/shared/background_callback 2.c | 138 ------ 27 files changed, 2701 deletions(-) delete mode 100644 shared-bindings/_typing/__init__ 2.pyi delete mode 100644 shared-bindings/gnss/GNSS 2.c delete mode 100644 shared-bindings/gnss/GNSS 2.h delete mode 100644 shared-bindings/gnss/PositionFix 2.c delete mode 100644 shared-bindings/gnss/PositionFix 2.h delete mode 100644 shared-bindings/gnss/SatelliteSystem 2.c delete mode 100644 shared-bindings/gnss/SatelliteSystem 2.h delete mode 100644 shared-bindings/gnss/__init__ 2.c delete mode 100644 shared-bindings/i2cperipheral/I2CPeripheral 2.c delete mode 100644 shared-bindings/i2cperipheral/I2CPeripheral 2.h delete mode 100644 shared-bindings/i2cperipheral/__init__ 2.c delete mode 100644 shared-bindings/memorymonitor/AllocationAlarm 2.c delete mode 100644 shared-bindings/memorymonitor/AllocationAlarm 2.h delete mode 100644 shared-bindings/memorymonitor/AllocationSize 2.c delete mode 100644 shared-bindings/memorymonitor/AllocationSize 2.h delete mode 100644 shared-bindings/memorymonitor/__init__ 2.c delete mode 100644 shared-bindings/memorymonitor/__init__ 2.h delete mode 100644 shared-bindings/sdcardio/SDCard 2.c delete mode 100644 shared-bindings/sdcardio/SDCard 2.h delete mode 100644 shared-bindings/sdcardio/__init__ 2.c delete mode 100644 shared-bindings/sdcardio/__init__ 2.h delete mode 100644 shared-module/sdcardio/SDCard 2.c delete mode 100644 shared-module/sdcardio/SDCard 2.h delete mode 100644 shared-module/sdcardio/__init__ 2.c delete mode 100644 shared-module/sdcardio/__init__ 2.h delete mode 100644 supervisor/background_callback 2.h delete mode 100644 supervisor/shared/background_callback 2.c diff --git a/shared-bindings/_typing/__init__ 2.pyi b/shared-bindings/_typing/__init__ 2.pyi deleted file mode 100644 index 48e68a8d57..0000000000 --- a/shared-bindings/_typing/__init__ 2.pyi +++ /dev/null @@ -1,54 +0,0 @@ -"""Types for the C-level protocols""" - -from typing import Union - -import array -import audiocore -import audiomixer -import audiomp3 -import rgbmatrix -import ulab - -ReadableBuffer = Union[ - bytes, bytearray, memoryview, array.array, ulab.array, rgbmatrix.RGBMatrix -] -"""Classes that implement the readable buffer protocol - - - `bytes` - - `bytearray` - - `memoryview` - - `array.array` - - `ulab.array` - - `rgbmatrix.RGBMatrix` -""" - -WriteableBuffer = Union[ - bytearray, memoryview, array.array, ulab.array, rgbmatrix.RGBMatrix -] -"""Classes that implement the writeable buffer protocol - - - `bytearray` - - `memoryview` - - `array.array` - - `ulab.array` - - `rgbmatrix.RGBMatrix` -""" - -AudioSample = Union[ - audiocore.WaveFile, audiocore.RawSample, audiomixer.Mixer, audiomp3.MP3Decoder -] -"""Classes that implement the audiosample protocol - - - `audiocore.WaveFile` - - `audiocore.RawSample` - - `audiomixer.Mixer` - - `audiomp3.MP3Decoder` - - You can play these back with `audioio.AudioOut`, `audiobusio.I2SOut` or `audiopwmio.PWMAudioOut`. -""" - -FrameBuffer = Union[rgbmatrix.RGBMatrix] -"""Classes that implement the framebuffer protocol - - - `rgbmatrix.RGBMatrix` -""" diff --git a/shared-bindings/gnss/GNSS 2.c b/shared-bindings/gnss/GNSS 2.c deleted file mode 100644 index 087c353953..0000000000 --- a/shared-bindings/gnss/GNSS 2.c +++ /dev/null @@ -1,205 +0,0 @@ -// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation -// -// SPDX-License-Identifier: MIT - -#include "shared-bindings/gnss/GNSS.h" -#include "shared-bindings/time/__init__.h" -#include "shared-bindings/util.h" - -#include "py/objproperty.h" -#include "py/runtime.h" - -//| class GNSS: -//| """Get updated positioning information from Global Navigation Satellite System (GNSS) -//| -//| Usage:: -//| -//| import gnss -//| import time -//| -//| nav = gnss.GNSS([gnss.SatelliteSystem.GPS, gnss.SatelliteSystem.GLONASS]) -//| last_print = time.monotonic() -//| while True: -//| nav.update() -//| current = time.monotonic() -//| if current - last_print >= 1.0: -//| last_print = current -//| if nav.fix is gnss.PositionFix.INVALID: -//| print("Waiting for fix...") -//| continue -//| print("Latitude: {0:.6f} degrees".format(nav.latitude)) -//| print("Longitude: {0:.6f} degrees".format(nav.longitude))""" -//| - -//| def __init__(self, system: Union[SatelliteSystem, List[SatelliteSystem]]) -> None: -//| """Turn on the GNSS. -//| -//| :param system: satellite system to use""" -//| ... -//| -STATIC mp_obj_t gnss_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - gnss_obj_t *self = m_new_obj(gnss_obj_t); - self->base.type = &gnss_type; - enum { ARG_system }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_system, MP_ARG_REQUIRED | MP_ARG_OBJ }, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - - unsigned long selection = 0; - if (MP_OBJ_IS_TYPE(args[ARG_system].u_obj, &gnss_satellitesystem_type)) { - selection |= gnss_satellitesystem_obj_to_type(args[ARG_system].u_obj); - } else if (MP_OBJ_IS_TYPE(args[ARG_system].u_obj, &mp_type_list)) { - size_t systems_size = 0; - mp_obj_t *systems; - mp_obj_list_get(args[ARG_system].u_obj, &systems_size, &systems); - for (size_t i = 0; i < systems_size; ++i) { - if (!MP_OBJ_IS_TYPE(systems[i], &gnss_satellitesystem_type)) { - mp_raise_TypeError(translate("System entry must be gnss.SatelliteSystem")); - } - selection |= gnss_satellitesystem_obj_to_type(systems[i]); - } - } else { - mp_raise_TypeError(translate("System entry must be gnss.SatelliteSystem")); - } - - common_hal_gnss_construct(self, selection); - return MP_OBJ_FROM_PTR(self); -} - -//| def deinit(self) -> None: -//| """Turn off the GNSS.""" -//| ... -//| -STATIC mp_obj_t gnss_obj_deinit(mp_obj_t self_in) { - gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_gnss_deinit(self); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(gnss_deinit_obj, gnss_obj_deinit); - -STATIC void check_for_deinit(gnss_obj_t *self) { - if (common_hal_gnss_deinited(self)) { - raise_deinited_error(); - } -} - -//| def update(self) -> None: -//| """Update GNSS positioning information.""" -//| ... -//| -STATIC mp_obj_t gnss_obj_update(mp_obj_t self_in) { - gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - common_hal_gnss_update(self); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(gnss_update_obj, gnss_obj_update); - -//| latitude: float -//| """Latitude of current position in degrees (float).""" -//| -STATIC mp_obj_t gnss_obj_get_latitude(mp_obj_t self_in) { - gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - return mp_obj_new_float(common_hal_gnss_get_latitude(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_latitude_obj, gnss_obj_get_latitude); - -const mp_obj_property_t gnss_latitude_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&gnss_get_latitude_obj, - (mp_obj_t)&mp_const_none_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - -//| longitude: float -//| """Longitude of current position in degrees (float).""" -//| -STATIC mp_obj_t gnss_obj_get_longitude(mp_obj_t self_in) { - gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - return mp_obj_new_float(common_hal_gnss_get_longitude(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_longitude_obj, gnss_obj_get_longitude); - -const mp_obj_property_t gnss_longitude_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&gnss_get_longitude_obj, - (mp_obj_t)&mp_const_none_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - -//| altitude: float -//| """Altitude of current position in meters (float).""" -//| -STATIC mp_obj_t gnss_obj_get_altitude(mp_obj_t self_in) { - gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - return mp_obj_new_float(common_hal_gnss_get_altitude(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_altitude_obj, gnss_obj_get_altitude); - -const mp_obj_property_t gnss_altitude_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&gnss_get_altitude_obj, - (mp_obj_t)&mp_const_none_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - -//| timestamp: time.struct_time -//| """Time when the position data was updated.""" -//| -STATIC mp_obj_t gnss_obj_get_timestamp(mp_obj_t self_in) { - gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - timeutils_struct_time_t tm; - common_hal_gnss_get_timestamp(self, &tm); - return struct_time_from_tm(&tm); -} -MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_timestamp_obj, gnss_obj_get_timestamp); - -const mp_obj_property_t gnss_timestamp_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&gnss_get_timestamp_obj, - (mp_obj_t)&mp_const_none_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - -//| fix: PositionFix -//| """Fix mode.""" -//| -STATIC mp_obj_t gnss_obj_get_fix(mp_obj_t self_in) { - gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - return gnss_positionfix_type_to_obj(common_hal_gnss_get_fix(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_fix_obj, gnss_obj_get_fix); - -const mp_obj_property_t gnss_fix_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&gnss_get_fix_obj, - (mp_obj_t)&mp_const_none_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - -STATIC const mp_rom_map_elem_t gnss_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&gnss_deinit_obj) }, - { MP_ROM_QSTR(MP_QSTR_update), MP_ROM_PTR(&gnss_update_obj) }, - - { MP_ROM_QSTR(MP_QSTR_latitude), MP_ROM_PTR(&gnss_latitude_obj) }, - { MP_ROM_QSTR(MP_QSTR_longitude), MP_ROM_PTR(&gnss_longitude_obj) }, - { MP_ROM_QSTR(MP_QSTR_altitude), MP_ROM_PTR(&gnss_altitude_obj) }, - { MP_ROM_QSTR(MP_QSTR_timestamp), MP_ROM_PTR(&gnss_timestamp_obj) }, - { MP_ROM_QSTR(MP_QSTR_fix), MP_ROM_PTR(&gnss_fix_obj) } -}; -STATIC MP_DEFINE_CONST_DICT(gnss_locals_dict, gnss_locals_dict_table); - -const mp_obj_type_t gnss_type = { - { &mp_type_type }, - .name = MP_QSTR_GNSS, - .make_new = gnss_make_new, - .locals_dict = (mp_obj_dict_t*)&gnss_locals_dict, -}; diff --git a/shared-bindings/gnss/GNSS 2.h b/shared-bindings/gnss/GNSS 2.h deleted file mode 100644 index 60069a90a9..0000000000 --- a/shared-bindings/gnss/GNSS 2.h +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation -// -// SPDX-License-Identifier: MIT - -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_GNSS_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_GNSS_H - -#include "common-hal/gnss/GNSS.h" -#include "shared-bindings/gnss/SatelliteSystem.h" -#include "shared-bindings/gnss/PositionFix.h" - -#include "lib/timeutils/timeutils.h" - -extern const mp_obj_type_t gnss_type; - -void common_hal_gnss_construct(gnss_obj_t *self, unsigned long selection); -void common_hal_gnss_deinit(gnss_obj_t *self); -bool common_hal_gnss_deinited(gnss_obj_t *self); -void common_hal_gnss_update(gnss_obj_t *self); - -mp_float_t common_hal_gnss_get_latitude(gnss_obj_t *self); -mp_float_t common_hal_gnss_get_longitude(gnss_obj_t *self); -mp_float_t common_hal_gnss_get_altitude(gnss_obj_t *self); -void common_hal_gnss_get_timestamp(gnss_obj_t *self, timeutils_struct_time_t *tm); -gnss_positionfix_t common_hal_gnss_get_fix(gnss_obj_t *self); - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_GNSS_H diff --git a/shared-bindings/gnss/PositionFix 2.c b/shared-bindings/gnss/PositionFix 2.c deleted file mode 100644 index e60611d705..0000000000 --- a/shared-bindings/gnss/PositionFix 2.c +++ /dev/null @@ -1,80 +0,0 @@ -// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation -// -// SPDX-License-Identifier: MIT - -#include "shared-bindings/gnss/PositionFix.h" - -//| class PositionFix: -//| """Position fix mode""" -//| -//| def __init__(self) -> None: -//| """Enum-like class to define the position fix mode.""" -//| -//| INVALID: PositionFix -//| """No measurement.""" -//| -//| FIX_2D: PositionFix -//| """2D fix.""" -//| -//| FIX_3D: PositionFix -//| """3D fix.""" -//| -const mp_obj_type_t gnss_positionfix_type; - -const gnss_positionfix_obj_t gnss_positionfix_invalid_obj = { - { &gnss_positionfix_type }, -}; - -const gnss_positionfix_obj_t gnss_positionfix_fix2d_obj = { - { &gnss_positionfix_type }, -}; - -const gnss_positionfix_obj_t gnss_positionfix_fix3d_obj = { - { &gnss_positionfix_type }, -}; - -gnss_positionfix_t gnss_positionfix_obj_to_type(mp_obj_t obj) { - gnss_positionfix_t posfix = POSITIONFIX_INVALID; - if (obj == MP_ROM_PTR(&gnss_positionfix_fix2d_obj)) { - posfix = POSITIONFIX_2D; - } else if (obj == MP_ROM_PTR(&gnss_positionfix_fix3d_obj)) { - posfix = POSITIONFIX_3D; - } - return posfix; -} - -mp_obj_t gnss_positionfix_type_to_obj(gnss_positionfix_t posfix) { - switch (posfix) { - case POSITIONFIX_2D: - return (mp_obj_t)MP_ROM_PTR(&gnss_positionfix_fix2d_obj); - case POSITIONFIX_3D: - return (mp_obj_t)MP_ROM_PTR(&gnss_positionfix_fix3d_obj); - case POSITIONFIX_INVALID: - default: - return (mp_obj_t)MP_ROM_PTR(&gnss_positionfix_invalid_obj); - } -} - -STATIC const mp_rom_map_elem_t gnss_positionfix_locals_dict_table[] = { - {MP_ROM_QSTR(MP_QSTR_INVALID), MP_ROM_PTR(&gnss_positionfix_invalid_obj)}, - {MP_ROM_QSTR(MP_QSTR_FIX_2D), MP_ROM_PTR(&gnss_positionfix_fix2d_obj)}, - {MP_ROM_QSTR(MP_QSTR_FIX_3D), MP_ROM_PTR(&gnss_positionfix_fix3d_obj)}, -}; -STATIC MP_DEFINE_CONST_DICT(gnss_positionfix_locals_dict, gnss_positionfix_locals_dict_table); - -STATIC void gnss_positionfix_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { - qstr posfix = MP_QSTR_INVALID; - if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_positionfix_fix2d_obj)) { - posfix = MP_QSTR_FIX_2D; - } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_positionfix_fix3d_obj)) { - posfix = MP_QSTR_FIX_3D; - } - mp_printf(print, "%q.%q.%q", MP_QSTR_gnss, MP_QSTR_PositionFix, posfix); -} - -const mp_obj_type_t gnss_positionfix_type = { - { &mp_type_type }, - .name = MP_QSTR_PositionFix, - .print = gnss_positionfix_print, - .locals_dict = (mp_obj_t)&gnss_positionfix_locals_dict, -}; diff --git a/shared-bindings/gnss/PositionFix 2.h b/shared-bindings/gnss/PositionFix 2.h deleted file mode 100644 index 34090872cc..0000000000 --- a/shared-bindings/gnss/PositionFix 2.h +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation -// -// SPDX-License-Identifier: MIT - -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_POSITIONFIX_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_POSITIONFIX_H - -#include "py/obj.h" - -typedef enum { - POSITIONFIX_INVALID, - POSITIONFIX_2D, - POSITIONFIX_3D, -} gnss_positionfix_t; - -const mp_obj_type_t gnss_positionfix_type; - -gnss_positionfix_t gnss_positionfix_obj_to_type(mp_obj_t obj); -mp_obj_t gnss_positionfix_type_to_obj(gnss_positionfix_t mode); - -typedef struct { - mp_obj_base_t base; -} gnss_positionfix_obj_t; -extern const gnss_positionfix_obj_t gnss_positionfix_invalid_obj; -extern const gnss_positionfix_obj_t gnss_positionfix_fix2d_obj; -extern const gnss_positionfix_obj_t gnss_positionfix_fix3d_obj; - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_POSITIONFIX_H diff --git a/shared-bindings/gnss/SatelliteSystem 2.c b/shared-bindings/gnss/SatelliteSystem 2.c deleted file mode 100644 index 7d66727b8d..0000000000 --- a/shared-bindings/gnss/SatelliteSystem 2.c +++ /dev/null @@ -1,113 +0,0 @@ -// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation -// -// SPDX-License-Identifier: MIT - -#include "shared-bindings/gnss/SatelliteSystem.h" - -//| class SatelliteSystem: -//| """Satellite system type""" -//| -//| def __init__(self) -> None: -//| """Enum-like class to define the satellite system type.""" -//| -//| GPS: SatelliteSystem -//| """Global Positioning System.""" -//| -//| GLONASS: SatelliteSystem -//| """GLObal NAvigation Satellite System.""" -//| -//| SBAS: SatelliteSystem -//| """Satellite Based Augmentation System.""" -//| -//| QZSS_L1CA: SatelliteSystem -//| """Quasi-Zenith Satellite System L1C/A.""" -//| -//| QZSS_L1S: SatelliteSystem -//| """Quasi-Zenith Satellite System L1S.""" -//| -const mp_obj_type_t gnss_satellitesystem_type; - -const gnss_satellitesystem_obj_t gnss_satellitesystem_gps_obj = { - { &gnss_satellitesystem_type }, -}; - -const gnss_satellitesystem_obj_t gnss_satellitesystem_glonass_obj = { - { &gnss_satellitesystem_type }, -}; - -const gnss_satellitesystem_obj_t gnss_satellitesystem_sbas_obj = { - { &gnss_satellitesystem_type }, -}; - -const gnss_satellitesystem_obj_t gnss_satellitesystem_qzss_l1ca_obj = { - { &gnss_satellitesystem_type }, -}; - -const gnss_satellitesystem_obj_t gnss_satellitesystem_qzss_l1s_obj = { - { &gnss_satellitesystem_type }, -}; - -gnss_satellitesystem_t gnss_satellitesystem_obj_to_type(mp_obj_t obj) { - if (obj == MP_ROM_PTR(&gnss_satellitesystem_gps_obj)) { - return SATELLITESYSTEM_GPS; - } else if (obj == MP_ROM_PTR(&gnss_satellitesystem_glonass_obj)) { - return SATELLITESYSTEM_GLONASS; - } else if (obj == MP_ROM_PTR(&gnss_satellitesystem_sbas_obj)) { - return SATELLITESYSTEM_SBAS; - } else if (obj == MP_ROM_PTR(&gnss_satellitesystem_qzss_l1ca_obj)) { - return SATELLITESYSTEM_QZSS_L1CA; - } else if (obj == MP_ROM_PTR(&gnss_satellitesystem_qzss_l1s_obj)) { - return SATELLITESYSTEM_QZSS_L1S; - } - return SATELLITESYSTEM_NONE; -} - -mp_obj_t gnss_satellitesystem_type_to_obj(gnss_satellitesystem_t system) { - switch (system) { - case SATELLITESYSTEM_GPS: - return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_gps_obj); - case SATELLITESYSTEM_GLONASS: - return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_glonass_obj); - case SATELLITESYSTEM_SBAS: - return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_sbas_obj); - case SATELLITESYSTEM_QZSS_L1CA: - return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_qzss_l1ca_obj); - case SATELLITESYSTEM_QZSS_L1S: - return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_qzss_l1s_obj); - case SATELLITESYSTEM_NONE: - default: - return (mp_obj_t)MP_ROM_PTR(&mp_const_none_obj); - } -} - -STATIC const mp_rom_map_elem_t gnss_satellitesystem_locals_dict_table[] = { - {MP_ROM_QSTR(MP_QSTR_GPS), MP_ROM_PTR(&gnss_satellitesystem_gps_obj)}, - {MP_ROM_QSTR(MP_QSTR_GLONASS), MP_ROM_PTR(&gnss_satellitesystem_glonass_obj)}, - {MP_ROM_QSTR(MP_QSTR_SBAS), MP_ROM_PTR(&gnss_satellitesystem_sbas_obj)}, - {MP_ROM_QSTR(MP_QSTR_QZSS_L1CA), MP_ROM_PTR(&gnss_satellitesystem_qzss_l1ca_obj)}, - {MP_ROM_QSTR(MP_QSTR_QZSS_L1S), MP_ROM_PTR(&gnss_satellitesystem_qzss_l1s_obj)}, -}; -STATIC MP_DEFINE_CONST_DICT(gnss_satellitesystem_locals_dict, gnss_satellitesystem_locals_dict_table); - -STATIC void gnss_satellitesystem_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { - qstr system = MP_QSTR_None; - if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_gps_obj)) { - system = MP_QSTR_GPS; - } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_glonass_obj)) { - system = MP_QSTR_GLONASS; - } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_sbas_obj)) { - system = MP_QSTR_SBAS; - } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_qzss_l1ca_obj)) { - system = MP_QSTR_QZSS_L1CA; - } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_qzss_l1s_obj)) { - system = MP_QSTR_QZSS_L1S; - } - mp_printf(print, "%q.%q.%q", MP_QSTR_gnss, MP_QSTR_SatelliteSystem, system); -} - -const mp_obj_type_t gnss_satellitesystem_type = { - { &mp_type_type }, - .name = MP_QSTR_SatelliteSystem, - .print = gnss_satellitesystem_print, - .locals_dict = (mp_obj_t)&gnss_satellitesystem_locals_dict, -}; diff --git a/shared-bindings/gnss/SatelliteSystem 2.h b/shared-bindings/gnss/SatelliteSystem 2.h deleted file mode 100644 index 17f1550028..0000000000 --- a/shared-bindings/gnss/SatelliteSystem 2.h +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation -// -// SPDX-License-Identifier: MIT - -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_SATELLITESYSTEM_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_SATELLITESYSTEM_H - -#include "py/obj.h" - -typedef enum { - SATELLITESYSTEM_NONE = 0, - SATELLITESYSTEM_GPS = (1U << 0), - SATELLITESYSTEM_GLONASS = (1U << 1), - SATELLITESYSTEM_SBAS = (1U << 2), - SATELLITESYSTEM_QZSS_L1CA = (1U << 3), - SATELLITESYSTEM_QZSS_L1S = (1U << 4), -} gnss_satellitesystem_t; - -const mp_obj_type_t gnss_satellitesystem_type; - -gnss_satellitesystem_t gnss_satellitesystem_obj_to_type(mp_obj_t obj); -mp_obj_t gnss_satellitesystem_type_to_obj(gnss_satellitesystem_t mode); - -typedef struct { - mp_obj_base_t base; -} gnss_satellitesystem_obj_t; -extern const gnss_satellitesystem_obj_t gnss_satellitesystem_gps_obj; -extern const gnss_satellitesystem_obj_t gnss_satellitesystem_glonass_obj; -extern const gnss_satellitesystem_obj_t gnss_satellitesystem_sbas_obj; -extern const gnss_satellitesystem_obj_t gnss_satellitesystem_qzss_l1ca_obj; -extern const gnss_satellitesystem_obj_t gnss_satellitesystem_qzss_l1s_obj; - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_SATELLITESYSTEM_H diff --git a/shared-bindings/gnss/__init__ 2.c b/shared-bindings/gnss/__init__ 2.c deleted file mode 100644 index 4b0d312ae6..0000000000 --- a/shared-bindings/gnss/__init__ 2.c +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-FileCopyrightText: Sony Semiconductor Solutions Corporation -// -// SPDX-License-Identifier: MIT - -#include "py/obj.h" -#include "py/runtime.h" -#include "py/mphal.h" -#include "shared-bindings/gnss/GNSS.h" -#include "shared-bindings/gnss/SatelliteSystem.h" -#include "shared-bindings/gnss/PositionFix.h" -#include "shared-bindings/util.h" - -//| """Global Navigation Satellite System -//| -//| The `gnss` module contains classes to control the GNSS and acquire positioning information.""" -//| -STATIC const mp_rom_map_elem_t gnss_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_gnss) }, - { MP_ROM_QSTR(MP_QSTR_GNSS), MP_ROM_PTR(&gnss_type) }, - - // Enum-like Classes. - { MP_ROM_QSTR(MP_QSTR_SatelliteSystem), MP_ROM_PTR(&gnss_satellitesystem_type) }, - { MP_ROM_QSTR(MP_QSTR_PositionFix), MP_ROM_PTR(&gnss_positionfix_type) }, -}; - -STATIC MP_DEFINE_CONST_DICT(gnss_module_globals, gnss_module_globals_table); - -const mp_obj_module_t gnss_module = { - .base = { &mp_type_module }, - .globals = (mp_obj_dict_t*)&gnss_module_globals, -}; diff --git a/shared-bindings/i2cperipheral/I2CPeripheral 2.c b/shared-bindings/i2cperipheral/I2CPeripheral 2.c deleted file mode 100644 index b5ac861b4e..0000000000 --- a/shared-bindings/i2cperipheral/I2CPeripheral 2.c +++ /dev/null @@ -1,436 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2018 Noralf Trønnes - * - * 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/i2cperipheral/I2CPeripheral.h" -#include "shared-bindings/time/__init__.h" -#include "shared-bindings/util.h" - -#include "lib/utils/buffer_helper.h" -#include "lib/utils/context_manager_helpers.h" -#include "lib/utils/interrupt_char.h" - -#include "py/mperrno.h" -#include "py/mphal.h" -#include "py/obj.h" -#include "py/objproperty.h" -#include "py/runtime.h" - -STATIC mp_obj_t mp_obj_new_i2cperipheral_i2c_peripheral_request(i2cperipheral_i2c_peripheral_obj_t *peripheral, uint8_t address, bool is_read, bool is_restart) { - i2cperipheral_i2c_peripheral_request_obj_t *self = m_new_obj(i2cperipheral_i2c_peripheral_request_obj_t); - self->base.type = &i2cperipheral_i2c_peripheral_request_type; - self->peripheral = peripheral; - self->address = address; - self->is_read = is_read; - self->is_restart = is_restart; - return (mp_obj_t)self; -} - -//| class I2CPeripheral: -//| """Two wire serial protocol peripheral""" -//| -//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, addresses: Sequence[int], smbus: bool = False) -> None: -//| """I2C is a two-wire protocol for communicating between devices. -//| This implements the peripheral (sensor, secondary) side. -//| -//| :param ~microcontroller.Pin scl: The clock pin -//| :param ~microcontroller.Pin sda: The data pin -//| :param addresses: The I2C addresses to respond to (how many is hw dependent). -//| :type addresses: list[int] -//| :param bool smbus: Use SMBUS timings if the hardware supports it""" -//| ... -//| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - i2cperipheral_i2c_peripheral_obj_t *self = m_new_obj(i2cperipheral_i2c_peripheral_obj_t); - self->base.type = &i2cperipheral_i2c_peripheral_type; - enum { ARG_scl, ARG_sda, ARG_addresses, ARG_smbus }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_scl, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_sda, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_addresses, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_smbus, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - - const mcu_pin_obj_t* scl = validate_obj_is_free_pin(args[ARG_scl].u_obj); - const mcu_pin_obj_t* sda = validate_obj_is_free_pin(args[ARG_sda].u_obj); - - mp_obj_iter_buf_t iter_buf; - mp_obj_t iterable = mp_getiter(args[ARG_addresses].u_obj, &iter_buf); - mp_obj_t item; - uint8_t *addresses = NULL; - unsigned int i = 0; - while ((item = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) { - mp_int_t value; - if (!mp_obj_get_int_maybe(item, &value)) { - mp_raise_TypeError_varg(translate("can't convert %q to %q"), MP_QSTR_address, MP_QSTR_int); - } - if (value < 0x00 || value > 0x7f) { - mp_raise_ValueError(translate("address out of bounds")); - } - addresses = m_renew(uint8_t, addresses, i, i + 1); - addresses[i++] = value; - } - if (i == 0) { - mp_raise_ValueError(translate("addresses is empty")); - } - - common_hal_i2cperipheral_i2c_peripheral_construct(self, scl, sda, addresses, i, args[ARG_smbus].u_bool); - return (mp_obj_t)self; -} - -//| def deinit(self) -> None: -//| """Releases control of the underlying hardware so other classes can use it.""" -//| ... -//| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj_deinit(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_type)); - i2cperipheral_i2c_peripheral_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_i2cperipheral_i2c_peripheral_deinit(self); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(i2cperipheral_i2c_peripheral_deinit_obj, i2cperipheral_i2c_peripheral_obj_deinit); - -//| def __enter__(self) -> I2CPeripheral: -//| """No-op used in Context Managers.""" -//| ... -//| -// Provided by context manager helper. - -//| def __exit__(self) -> None: -//| """Automatically deinitializes the hardware on context exit. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... -//| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj___exit__(size_t n_args, const mp_obj_t *args) { - mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cperipheral_i2c_peripheral_type)); - i2cperipheral_i2c_peripheral_obj_t *self = MP_OBJ_TO_PTR(args[0]); - common_hal_i2cperipheral_i2c_peripheral_deinit(self); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral___exit___obj, 4, 4, i2cperipheral_i2c_peripheral_obj___exit__); - -//| def request(self, timeout: float = -1) -> I2CPeripheralRequest: -//| """Wait for an I2C request. -//| -//| :param float timeout: Timeout in seconds. Zero means wait forever, a negative value means check once -//| :return: I2C Slave Request or None if timeout=-1 and there's no request -//| :rtype: ~i2cperipheral.I2CPeripheralRequest""" -//| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - mp_check_self(MP_OBJ_IS_TYPE(pos_args[0], &i2cperipheral_i2c_peripheral_type)); - i2cperipheral_i2c_peripheral_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); - if(common_hal_i2cperipheral_i2c_peripheral_deinited(self)) { - raise_deinited_error(); - } - enum { ARG_timeout }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NEW_SMALL_INT(-1)} }, - }; - 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); - - #if MICROPY_PY_BUILTINS_FLOAT - float f = mp_obj_get_float(args[ARG_timeout].u_obj) * 1000; - int timeout_ms = (int)f; - #else - int timeout_ms = mp_obj_get_int(args[ARG_timeout].u_obj) * 1000; - #endif - - bool forever = false; - uint64_t timeout_end = 0; - if (timeout_ms == 0) { - forever = true; - } else if (timeout_ms > 0) { - timeout_end = common_hal_time_monotonic() + timeout_ms; - } - - int last_error = 0; - - do { - uint8_t address; - bool is_read; - bool is_restart; - - RUN_BACKGROUND_TASKS; - if (mp_hal_is_interrupted()) { - return mp_const_none; - } - - int status = common_hal_i2cperipheral_i2c_peripheral_is_addressed(self, &address, &is_read, &is_restart); - if (status < 0) { - // On error try one more time before bailing out - if (last_error) { - mp_raise_OSError(last_error); - } - last_error = -status; - mp_hal_delay_ms(10); - continue; - } - - last_error = 0; - - if (status == 0) { - mp_hal_delay_us(10); - continue; - } - - return mp_obj_new_i2cperipheral_i2c_peripheral_request(self, address, is_read, is_restart); - } while (forever || common_hal_time_monotonic() < timeout_end); - - if (timeout_ms > 0) { - mp_raise_OSError(MP_ETIMEDOUT); - } - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_KW(i2cperipheral_i2c_peripheral_request_obj, 1, i2cperipheral_i2c_peripheral_request); - -STATIC const mp_rom_map_elem_t i2cperipheral_i2c_peripheral_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_deinit_obj) }, - { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2cperipheral_i2c_peripheral___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_request), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_obj) }, - -}; - -STATIC MP_DEFINE_CONST_DICT(i2cperipheral_i2c_peripheral_locals_dict, i2cperipheral_i2c_peripheral_locals_dict_table); - -const mp_obj_type_t i2cperipheral_i2c_peripheral_type = { - { &mp_type_type }, - .name = MP_QSTR_I2CPeripheral, - .make_new = i2cperipheral_i2c_peripheral_make_new, - .locals_dict = (mp_obj_dict_t*)&i2cperipheral_i2c_peripheral_locals_dict, -}; - -//| class I2CPeripheralRequest: -//| -//| def __init__(self, peripheral: i2cperipheral.I2CPeripheral, address: int, is_read: bool, is_restart: bool) -> None: -//| """Information about an I2C transfer request -//| This cannot be instantiated directly, but is returned by :py:meth:`I2CPeripheral.request`. -//| -//| :param peripheral: The I2CPeripheral object receiving this request -//| :param address: I2C address -//| :param is_read: True if the main peripheral is requesting data -//| :param is_restart: Repeated Start Condition""" -//| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { - mp_arg_check_num(n_args, kw_args, 4, 4, false); - return mp_obj_new_i2cperipheral_i2c_peripheral_request(args[0], mp_obj_get_int(args[1]), mp_obj_is_true(args[2]), mp_obj_is_true(args[3])); -} - -//| def __enter__(self) -> I2CPeripheralRequest: -//| """No-op used in Context Managers.""" -//| ... -//| -// Provided by context manager helper. - -//| def __exit__(self) -> None: -//| """Close the request.""" -//| ... -//| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_obj___exit__(size_t n_args, const mp_obj_t *args) { - mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cperipheral_i2c_peripheral_request_type)); - i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); - common_hal_i2cperipheral_i2c_peripheral_close(self->peripheral); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral_request___exit___obj, 4, 4, i2cperipheral_i2c_peripheral_request_obj___exit__); - -//| address: int -//| """The I2C address of the request.""" -//| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_address(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); - i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); - return mp_obj_new_int(self->address); -} -MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_address_obj, i2cperipheral_i2c_peripheral_request_get_address); - -//| is_read: bool -//| """The I2C main controller is reading from this peripheral.""" -//| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_is_read(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); - i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); - return mp_obj_new_bool(self->is_read); -} -MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_is_read_obj, i2cperipheral_i2c_peripheral_request_get_is_read); - -//| is_restart: bool -//| """Is Repeated Start Condition.""" -//| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_is_restart(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); - i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); - return mp_obj_new_bool(self->is_restart); -} -MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_is_restart_obj, i2cperipheral_i2c_peripheral_request_get_is_restart); - -//| def read(self, n: int = -1, ack: bool = True) -> bytearray: -//| """Read data. -//| If ack=False, the caller is responsible for calling :py:meth:`I2CPeripheralRequest.ack`. -//| -//| :param n: Number of bytes to read (negative means all) -//| :param ack: Whether or not to send an ACK after the n'th byte -//| :return: Bytes read""" -//| ... -//| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - mp_check_self(MP_OBJ_IS_TYPE(pos_args[0], &i2cperipheral_i2c_peripheral_request_type)); - i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); - enum { ARG_n, ARG_ack }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_n, MP_ARG_INT, {.u_int = -1} }, - { MP_QSTR_ack, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} }, - }; - 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); - - if (self->is_read) { - mp_raise_OSError(MP_EACCES); - } - - int n = args[ARG_n].u_int; - if (n == 0) { - return mp_obj_new_bytearray(0, NULL); - } - bool ack = args[ARG_ack].u_bool; - - int i = 0; - uint8_t *buffer = NULL; - uint64_t timeout_end = common_hal_time_monotonic() + 10 * 1000; - while (common_hal_time_monotonic() < timeout_end) { - RUN_BACKGROUND_TASKS; - if (mp_hal_is_interrupted()) { - break; - } - - uint8_t data; - int num = common_hal_i2cperipheral_i2c_peripheral_read_byte(self->peripheral, &data); - if (num == 0) { - break; - } - - buffer = m_renew(uint8_t, buffer, i, i + 1); - buffer[i++] = data; - if (i == n) { - if (ack) { - common_hal_i2cperipheral_i2c_peripheral_ack(self->peripheral, true); - } - break; - } - common_hal_i2cperipheral_i2c_peripheral_ack(self->peripheral, true); - } - - return mp_obj_new_bytearray(i, buffer); -} -MP_DEFINE_CONST_FUN_OBJ_KW(i2cperipheral_i2c_peripheral_request_read_obj, 1, i2cperipheral_i2c_peripheral_request_read); - -//| def write(self, buffer: ReadableBuffer) -> int: -//| """Write the data contained in buffer. -//| -//| :param ~_typing.ReadableBuffer buffer: Write out the data in this buffer -//| :return: Number of bytes written""" -//| ... -//| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_write(mp_obj_t self_in, mp_obj_t buf_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); - i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); - - if (!self->is_read) { - mp_raise_OSError(MP_EACCES); - } - - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); - - for (size_t i = 0; i < bufinfo.len; i++) { - RUN_BACKGROUND_TASKS; - if (mp_hal_is_interrupted()) { - break; - } - - int num = common_hal_i2cperipheral_i2c_peripheral_write_byte(self->peripheral, ((uint8_t *)(bufinfo.buf))[i]); - if (num == 0) { - return mp_obj_new_int(i); - } - } - - return mp_obj_new_int(bufinfo.len); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(i2cperipheral_i2c_peripheral_request_write_obj, i2cperipheral_i2c_peripheral_request_write); - -//| def ack(self, ack: bool = True) -> None: -//| """Acknowledge or Not Acknowledge last byte received. -//| Use together with :py:meth:`I2CPeripheralRequest.read` ack=False. -//| -//| :param ack: Whether to send an ACK or NACK""" -//| ... -//| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_ack(uint n_args, const mp_obj_t *args) { - mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cperipheral_i2c_peripheral_request_type)); - i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); - bool ack = (n_args == 1) ? true : mp_obj_is_true(args[1]); - - if (self->is_read) { - mp_raise_OSError(MP_EACCES); - } - - common_hal_i2cperipheral_i2c_peripheral_ack(self->peripheral, ack); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral_request_ack_obj, 1, 2, i2cperipheral_i2c_peripheral_request_ack); - -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_close(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); - i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); - - common_hal_i2cperipheral_i2c_peripheral_close(self->peripheral); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(i2cperipheral_i2c_peripheral_request_close_obj, i2cperipheral_i2c_peripheral_request_close); - -STATIC const mp_rom_map_elem_t i2cperipheral_i2c_peripheral_request_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_address), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_address_obj) }, - { MP_ROM_QSTR(MP_QSTR_is_read), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_is_read_obj) }, - { MP_ROM_QSTR(MP_QSTR_is_restart), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_is_restart_obj) }, - { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_read_obj) }, - { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_write_obj) }, - { MP_ROM_QSTR(MP_QSTR_ack), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_ack_obj) }, - { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_close_obj) }, -}; - -STATIC MP_DEFINE_CONST_DICT(i2cperipheral_i2c_peripheral_request_locals_dict, i2cperipheral_i2c_peripheral_request_locals_dict_table); - -const mp_obj_type_t i2cperipheral_i2c_peripheral_request_type = { - { &mp_type_type }, - .name = MP_QSTR_I2CPeripheralRequest, - .make_new = i2cperipheral_i2c_peripheral_request_make_new, - .locals_dict = (mp_obj_dict_t*)&i2cperipheral_i2c_peripheral_request_locals_dict, -}; diff --git a/shared-bindings/i2cperipheral/I2CPeripheral 2.h b/shared-bindings/i2cperipheral/I2CPeripheral 2.h deleted file mode 100644 index 3035cfbfe7..0000000000 --- a/shared-bindings/i2cperipheral/I2CPeripheral 2.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2018 Noralf Trønnes - * - * 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_BUSIO_I2C_SLAVE_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_I2C_SLAVE_H - -#include "py/obj.h" - -#include "common-hal/microcontroller/Pin.h" -#include "common-hal/i2cperipheral/I2CPeripheral.h" - -typedef struct { - mp_obj_base_t base; - i2cperipheral_i2c_peripheral_obj_t *peripheral; - uint16_t address; - bool is_read; - bool is_restart; -} i2cperipheral_i2c_peripheral_request_obj_t; - -extern const mp_obj_type_t i2cperipheral_i2c_peripheral_request_type; - -extern const mp_obj_type_t i2cperipheral_i2c_peripheral_type; - -extern void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_peripheral_obj_t *self, - const mcu_pin_obj_t* scl, const mcu_pin_obj_t* sda, - uint8_t *addresses, unsigned int num_addresses, bool smbus); -extern void common_hal_i2cperipheral_i2c_peripheral_deinit(i2cperipheral_i2c_peripheral_obj_t *self); -extern bool common_hal_i2cperipheral_i2c_peripheral_deinited(i2cperipheral_i2c_peripheral_obj_t *self); - -extern int common_hal_i2cperipheral_i2c_peripheral_is_addressed(i2cperipheral_i2c_peripheral_obj_t *self, - uint8_t *address, bool *is_read, bool *is_restart); -extern int common_hal_i2cperipheral_i2c_peripheral_read_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *data); -extern int common_hal_i2cperipheral_i2c_peripheral_write_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t data); -extern void common_hal_i2cperipheral_i2c_peripheral_ack(i2cperipheral_i2c_peripheral_obj_t *self, bool ack); -extern void common_hal_i2cperipheral_i2c_peripheral_close(i2cperipheral_i2c_peripheral_obj_t *self); - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_I2C_SLAVE_H diff --git a/shared-bindings/i2cperipheral/__init__ 2.c b/shared-bindings/i2cperipheral/__init__ 2.c deleted file mode 100644 index e2cb8509d6..0000000000 --- a/shared-bindings/i2cperipheral/__init__ 2.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2018 Noralf Trønnes - * - * 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 "py/obj.h" -#include "py/runtime.h" - -#include "shared-bindings/microcontroller/Pin.h" -//#include "shared-bindings/i2cperipheral/__init__.h" -#include "shared-bindings/i2cperipheral/I2CPeripheral.h" - -#include "py/runtime.h" - -//| """Two wire serial protocol peripheral -//| -//| The `i2cperipheral` module contains classes to support an I2C peripheral. -//| -//| Example emulating a peripheral with 2 addresses (read and write):: -//| -//| import board -//| from i2cperipheral import I2CPeripheral -//| -//| regs = [0] * 16 -//| index = 0 -//| -//| with I2CPeripheral(board.SCL, board.SDA, (0x40, 0x41)) as device: -//| while True: -//| r = device.request() -//| if not r: -//| # Maybe do some housekeeping -//| continue -//| with r: # Closes the transfer if necessary by sending a NACK or feeding dummy bytes -//| if r.address == 0x40: -//| if not r.is_read: # Main write which is Selected read -//| b = r.read(1) -//| if not b or b[0] > 15: -//| break -//| index = b[0] -//| b = r.read(1) -//| if b: -//| regs[index] = b[0] -//| elif r.is_restart: # Combined transfer: This is the Main read message -//| n = r.write(bytes([regs[index]])) -//| #else: -//| # A read transfer is not supported in this example -//| # If the microcontroller tries, it will get 0xff byte(s) by the ctx manager (r.close()) -//| elif r.address == 0x41: -//| if not r.is_read: -//| b = r.read(1) -//| if b and b[0] == 0xde: -//| # do something -//| pass -//| -//| This example sets up an I2C device that can be accessed from Linux like this:: -//| -//| $ i2cget -y 1 0x40 0x01 -//| 0x00 -//| $ i2cset -y 1 0x40 0x01 0xaa -//| $ i2cget -y 1 0x40 0x01 -//| 0xaa -//| -//| .. warning:: -//| I2CPeripheral makes use of clock stretching in order to slow down -//| the host. -//| Make sure the I2C host supports this. -//| -//| Raspberry Pi in particular does not support this with its I2C hw block. -//| This can be worked around by using the ``i2c-gpio`` bit banging driver. -//| Since the RPi firmware uses the hw i2c, it's not possible to emulate a HAT eeprom.""" -//| - -STATIC const mp_rom_map_elem_t i2cperipheral_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_i2cperipheral) }, - { MP_ROM_QSTR(MP_QSTR_I2CPeripheral), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_type) }, -}; - -STATIC MP_DEFINE_CONST_DICT(i2cperipheral_module_globals, i2cperipheral_module_globals_table); - -const mp_obj_module_t i2cperipheral_module = { - .base = { &mp_type_module }, - .globals = (mp_obj_dict_t*)&i2cperipheral_module_globals, -}; diff --git a/shared-bindings/memorymonitor/AllocationAlarm 2.c b/shared-bindings/memorymonitor/AllocationAlarm 2.c deleted file mode 100644 index 7de8c12874..0000000000 --- a/shared-bindings/memorymonitor/AllocationAlarm 2.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - * This file is part of the Micro Python 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 - -#include "py/objproperty.h" -#include "py/runtime.h" -#include "py/runtime0.h" -#include "shared-bindings/memorymonitor/AllocationAlarm.h" -#include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" - -//| class AllocationAlarm: -//| -//| def __init__(self, *, minimum_block_count: int = 1) -> None: -//| """Throw an exception when an allocation of ``minimum_block_count`` or more blocks -//| occurs while active. -//| -//| Track allocations:: -//| -//| import memorymonitor -//| -//| aa = memorymonitor.AllocationAlarm(minimum_block_count=2) -//| x = 2 -//| # Should not allocate any blocks. -//| with aa: -//| x = 5 -//| -//| # Should throw an exception when allocating storage for the 20 bytes. -//| with aa: -//| x = bytearray(20) -//| -//| """ -//| ... -//| -STATIC mp_obj_t memorymonitor_allocationalarm_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_minimum_block_count }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_minimum_block_count, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} }, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_int_t minimum_block_count = args[ARG_minimum_block_count].u_int; - if (minimum_block_count < 1) { - mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_minimum_block_count); - } - - memorymonitor_allocationalarm_obj_t *self = m_new_obj(memorymonitor_allocationalarm_obj_t); - self->base.type = &memorymonitor_allocationalarm_type; - - common_hal_memorymonitor_allocationalarm_construct(self, minimum_block_count); - - return MP_OBJ_FROM_PTR(self); -} - -//| def ignore(self, count: int) -> AllocationAlarm: -//| """Sets the number of applicable allocations to ignore before raising the exception. -//| Automatically set back to zero at context exit. -//| -//| Use it within a ``with`` block:: -//| -//| # Will not alarm because the bytearray allocation will be ignored. -//| with aa.ignore(2): -//| x = bytearray(20) -//| """ -//| ... -//| -STATIC mp_obj_t memorymonitor_allocationalarm_obj_ignore(mp_obj_t self_in, mp_obj_t count_obj) { - mp_int_t count = mp_obj_get_int(count_obj); - if (count < 0) { - mp_raise_ValueError_varg(translate("%q must be >= 0"), MP_QSTR_count); - } - common_hal_memorymonitor_allocationalarm_set_ignore(self_in, count); - return self_in; -} -MP_DEFINE_CONST_FUN_OBJ_2(memorymonitor_allocationalarm_ignore_obj, memorymonitor_allocationalarm_obj_ignore); - -//| def __enter__(self) -> AllocationAlarm: -//| """Enables the alarm.""" -//| ... -//| -STATIC mp_obj_t memorymonitor_allocationalarm_obj___enter__(mp_obj_t self_in) { - common_hal_memorymonitor_allocationalarm_resume(self_in); - return self_in; -} -MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationalarm___enter___obj, memorymonitor_allocationalarm_obj___enter__); - -//| def __exit__(self) -> None: -//| """Automatically disables the allocation alarm when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... -//| -STATIC mp_obj_t memorymonitor_allocationalarm_obj___exit__(size_t n_args, const mp_obj_t *args) { - (void)n_args; - common_hal_memorymonitor_allocationalarm_set_ignore(args[0], 0); - common_hal_memorymonitor_allocationalarm_pause(args[0]); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(memorymonitor_allocationalarm___exit___obj, 4, 4, memorymonitor_allocationalarm_obj___exit__); - -STATIC const mp_rom_map_elem_t memorymonitor_allocationalarm_locals_dict_table[] = { - // Methods - { MP_ROM_QSTR(MP_QSTR_ignore), MP_ROM_PTR(&memorymonitor_allocationalarm_ignore_obj) }, - { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&memorymonitor_allocationalarm___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&memorymonitor_allocationalarm___exit___obj) }, -}; -STATIC MP_DEFINE_CONST_DICT(memorymonitor_allocationalarm_locals_dict, memorymonitor_allocationalarm_locals_dict_table); - -const mp_obj_type_t memorymonitor_allocationalarm_type = { - { &mp_type_type }, - .name = MP_QSTR_AllocationAlarm, - .make_new = memorymonitor_allocationalarm_make_new, - .locals_dict = (mp_obj_dict_t*)&memorymonitor_allocationalarm_locals_dict, -}; diff --git a/shared-bindings/memorymonitor/AllocationAlarm 2.h b/shared-bindings/memorymonitor/AllocationAlarm 2.h deleted file mode 100644 index 304b9c5a72..0000000000 --- a/shared-bindings/memorymonitor/AllocationAlarm 2.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) 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. - */ - -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONALARM_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONALARM_H - -#include "shared-module/memorymonitor/AllocationAlarm.h" - -extern const mp_obj_type_t memorymonitor_allocationalarm_type; - -void common_hal_memorymonitor_allocationalarm_construct(memorymonitor_allocationalarm_obj_t* self, size_t minimum_block_count); -void common_hal_memorymonitor_allocationalarm_pause(memorymonitor_allocationalarm_obj_t* self); -void common_hal_memorymonitor_allocationalarm_resume(memorymonitor_allocationalarm_obj_t* self); -void common_hal_memorymonitor_allocationalarm_set_ignore(memorymonitor_allocationalarm_obj_t* self, mp_int_t count); - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONALARM_H diff --git a/shared-bindings/memorymonitor/AllocationSize 2.c b/shared-bindings/memorymonitor/AllocationSize 2.c deleted file mode 100644 index b35bae3602..0000000000 --- a/shared-bindings/memorymonitor/AllocationSize 2.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - * This file is part of the Micro Python 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 - -#include "py/objproperty.h" -#include "py/runtime.h" -#include "py/runtime0.h" -#include "shared-bindings/memorymonitor/AllocationSize.h" -#include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" - -//| class AllocationSize: -//| -//| def __init__(self) -> None: -//| """Tracks the number of allocations in power of two buckets. -//| -//| It will have 16 16-bit buckets to track allocation counts. It is total allocations -//| meaning frees are ignored. Reallocated memory is counted twice, at allocation and when -//| reallocated with the larger size. -//| -//| The buckets are measured in terms of blocks which is the finest granularity of the heap. -//| This means bucket 0 will count all allocations less than or equal to the number of bytes -//| per block, typically 16. Bucket 2 will be less than or equal to 4 blocks. See -//| `bytes_per_block` to convert blocks to bytes. -//| -//| Multiple AllocationSizes can be used to track different code boundaries. -//| -//| Track allocations:: -//| -//| import memorymonitor -//| -//| mm = memorymonitor.AllocationSize() -//| with mm: -//| print("hello world" * 3) -//| -//| for bucket, count in enumerate(mm): -//| print("<", 2 ** bucket, count) -//| -//| """ -//| ... -//| -STATIC mp_obj_t memorymonitor_allocationsize_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - memorymonitor_allocationsize_obj_t *self = m_new_obj(memorymonitor_allocationsize_obj_t); - self->base.type = &memorymonitor_allocationsize_type; - - common_hal_memorymonitor_allocationsize_construct(self); - - return MP_OBJ_FROM_PTR(self); -} - -//| def __enter__(self) -> AllocationSize: -//| """Clears counts and resumes tracking.""" -//| ... -//| -STATIC mp_obj_t memorymonitor_allocationsize_obj___enter__(mp_obj_t self_in) { - common_hal_memorymonitor_allocationsize_clear(self_in); - common_hal_memorymonitor_allocationsize_resume(self_in); - return self_in; -} -MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationsize___enter___obj, memorymonitor_allocationsize_obj___enter__); - -//| def __exit__(self) -> None: -//| """Automatically pauses allocation tracking when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... -//| -STATIC mp_obj_t memorymonitor_allocationsize_obj___exit__(size_t n_args, const mp_obj_t *args) { - (void)n_args; - common_hal_memorymonitor_allocationsize_pause(args[0]); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(memorymonitor_allocationsize___exit___obj, 4, 4, memorymonitor_allocationsize_obj___exit__); - -//| bytes_per_block: int -//| """Number of bytes per block""" -//| -STATIC mp_obj_t memorymonitor_allocationsize_obj_get_bytes_per_block(mp_obj_t self_in) { - memorymonitor_allocationsize_obj_t *self = MP_OBJ_TO_PTR(self_in); - - return MP_OBJ_NEW_SMALL_INT(common_hal_memorymonitor_allocationsize_get_bytes_per_block(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationsize_get_bytes_per_block_obj, memorymonitor_allocationsize_obj_get_bytes_per_block); - -const mp_obj_property_t memorymonitor_allocationsize_bytes_per_block_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&memorymonitor_allocationsize_get_bytes_per_block_obj, - (mp_obj_t)&mp_const_none_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - -//| def __len__(self) -> int: -//| """Returns the number of allocation buckets. -//| -//| This allows you to:: -//| -//| mm = memorymonitor.AllocationSize() -//| print(len(mm))""" -//| ... -//| -STATIC mp_obj_t memorymonitor_allocationsize_unary_op(mp_unary_op_t op, mp_obj_t self_in) { - memorymonitor_allocationsize_obj_t *self = MP_OBJ_TO_PTR(self_in); - uint16_t len = common_hal_memorymonitor_allocationsize_get_len(self); - switch (op) { - case MP_UNARY_OP_BOOL: return mp_obj_new_bool(len != 0); - case MP_UNARY_OP_LEN: return MP_OBJ_NEW_SMALL_INT(len); - default: return MP_OBJ_NULL; // op not supported - } -} - -//| def __getitem__(self, index: int) -> Optional[int]: -//| """Returns the allocation count for the given bucket. -//| -//| This allows you to:: -//| -//| mm = memorymonitor.AllocationSize() -//| print(mm[0])""" -//| ... -//| -STATIC mp_obj_t memorymonitor_allocationsize_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t value) { - if (value == mp_const_none) { - // delete item - mp_raise_AttributeError(translate("Cannot delete values")); - } else { - memorymonitor_allocationsize_obj_t *self = MP_OBJ_TO_PTR(self_in); - - if (MP_OBJ_IS_TYPE(index_obj, &mp_type_slice)) { - mp_raise_NotImplementedError(translate("Slices not supported")); - } else { - size_t index = mp_get_index(&memorymonitor_allocationsize_type, common_hal_memorymonitor_allocationsize_get_len(self), index_obj, false); - if (value == MP_OBJ_SENTINEL) { - // load - return MP_OBJ_NEW_SMALL_INT(common_hal_memorymonitor_allocationsize_get_item(self, index)); - } else { - mp_raise_AttributeError(translate("Read-only")); - } - } - } - return mp_const_none; -} - -STATIC const mp_rom_map_elem_t memorymonitor_allocationsize_locals_dict_table[] = { - // Methods - { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&memorymonitor_allocationsize___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&memorymonitor_allocationsize___exit___obj) }, - - // Properties - { MP_ROM_QSTR(MP_QSTR_bytes_per_block), MP_ROM_PTR(&memorymonitor_allocationsize_bytes_per_block_obj) }, -}; -STATIC MP_DEFINE_CONST_DICT(memorymonitor_allocationsize_locals_dict, memorymonitor_allocationsize_locals_dict_table); - -const mp_obj_type_t memorymonitor_allocationsize_type = { - { &mp_type_type }, - .name = MP_QSTR_AllocationSize, - .make_new = memorymonitor_allocationsize_make_new, - .subscr = memorymonitor_allocationsize_subscr, - .unary_op = memorymonitor_allocationsize_unary_op, - .getiter = mp_obj_new_generic_iterator, - .locals_dict = (mp_obj_dict_t*)&memorymonitor_allocationsize_locals_dict, -}; diff --git a/shared-bindings/memorymonitor/AllocationSize 2.h b/shared-bindings/memorymonitor/AllocationSize 2.h deleted file mode 100644 index bcd9514bf2..0000000000 --- a/shared-bindings/memorymonitor/AllocationSize 2.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of the Micro Python 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. - */ - -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONSIZE_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONSIZE_H - -#include "shared-module/memorymonitor/AllocationSize.h" - -extern const mp_obj_type_t memorymonitor_allocationsize_type; - -extern void common_hal_memorymonitor_allocationsize_construct(memorymonitor_allocationsize_obj_t* self); -extern void common_hal_memorymonitor_allocationsize_pause(memorymonitor_allocationsize_obj_t* self); -extern void common_hal_memorymonitor_allocationsize_resume(memorymonitor_allocationsize_obj_t* self); -extern void common_hal_memorymonitor_allocationsize_clear(memorymonitor_allocationsize_obj_t* self); -extern size_t common_hal_memorymonitor_allocationsize_get_bytes_per_block(memorymonitor_allocationsize_obj_t* self); -extern uint16_t common_hal_memorymonitor_allocationsize_get_len(memorymonitor_allocationsize_obj_t* self); -extern uint16_t common_hal_memorymonitor_allocationsize_get_item(memorymonitor_allocationsize_obj_t* self, int16_t index); - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR_ALLOCATIONSIZE_H diff --git a/shared-bindings/memorymonitor/__init__ 2.c b/shared-bindings/memorymonitor/__init__ 2.c deleted file mode 100644 index c101ba5e0d..0000000000 --- a/shared-bindings/memorymonitor/__init__ 2.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Scott Shawcroft - * - * 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 "py/obj.h" -#include "py/runtime.h" - -#include "shared-bindings/memorymonitor/__init__.h" -#include "shared-bindings/memorymonitor/AllocationAlarm.h" -#include "shared-bindings/memorymonitor/AllocationSize.h" - -//| """Memory monitoring helpers""" -//| - -//| class AllocationError(Exception): -//| """Catchall exception for allocation related errors.""" -//| ... -MP_DEFINE_MEMORYMONITOR_EXCEPTION(AllocationError, Exception) - -NORETURN void mp_raise_memorymonitor_AllocationError(const compressed_string_t* fmt, ...) { - va_list argptr; - va_start(argptr,fmt); - mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_memorymonitor_AllocationError, fmt, argptr); - va_end(argptr); - nlr_raise(exception); -} - -STATIC const mp_rom_map_elem_t memorymonitor_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_memorymonitor) }, - { MP_ROM_QSTR(MP_QSTR_AllocationAlarm), MP_ROM_PTR(&memorymonitor_allocationalarm_type) }, - { MP_ROM_QSTR(MP_QSTR_AllocationSize), MP_ROM_PTR(&memorymonitor_allocationsize_type) }, - - // Errors - { MP_ROM_QSTR(MP_QSTR_AllocationError), MP_ROM_PTR(&mp_type_memorymonitor_AllocationError) }, -}; - -STATIC MP_DEFINE_CONST_DICT(memorymonitor_module_globals, memorymonitor_module_globals_table); - -void memorymonitor_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) { - mp_print_kind_t k = kind & ~PRINT_EXC_SUBCLASS; - bool is_subclass = kind & PRINT_EXC_SUBCLASS; - if (!is_subclass && (k == PRINT_EXC)) { - mp_print_str(print, qstr_str(MP_OBJ_QSTR_VALUE(memorymonitor_module_globals_table[0].value))); - mp_print_str(print, "."); - } - mp_obj_exception_print(print, o_in, kind); -} - -const mp_obj_module_t memorymonitor_module = { - .base = { &mp_type_module }, - .globals = (mp_obj_dict_t*)&memorymonitor_module_globals, -}; diff --git a/shared-bindings/memorymonitor/__init__ 2.h b/shared-bindings/memorymonitor/__init__ 2.h deleted file mode 100644 index 60fcdc3f62..0000000000 --- a/shared-bindings/memorymonitor/__init__ 2.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Scott Shawcroft - * - * 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_MEMORYMONITOR___INIT___H -#define MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR___INIT___H - -#include "py/obj.h" - - -void memorymonitor_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind); - -#define MP_DEFINE_MEMORYMONITOR_EXCEPTION(exc_name, base_name) \ -const mp_obj_type_t mp_type_memorymonitor_ ## exc_name = { \ - { &mp_type_type }, \ - .name = MP_QSTR_ ## exc_name, \ - .print = memorymonitor_exception_print, \ - .make_new = mp_obj_exception_make_new, \ - .attr = mp_obj_exception_attr, \ - .parent = &mp_type_ ## base_name, \ -}; - -extern const mp_obj_type_t mp_type_memorymonitor_AllocationError; - -NORETURN void mp_raise_memorymonitor_AllocationError(const compressed_string_t* msg, ...); - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_MEMORYMONITOR___INIT___H diff --git a/shared-bindings/sdcardio/SDCard 2.c b/shared-bindings/sdcardio/SDCard 2.c deleted file mode 100644 index 975f8b0953..0000000000 --- a/shared-bindings/sdcardio/SDCard 2.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 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/obj.h" -#include "py/objproperty.h" -#include "py/runtime.h" -#include "py/objarray.h" - -#include "shared-bindings/sdcardio/SDCard.h" -#include "shared-module/sdcardio/SDCard.h" -#include "common-hal/busio/SPI.h" -#include "shared-bindings/busio/SPI.h" -#include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/flash.h" - -//| class SDCard: -//| """SD Card Block Interface -//| -//| Controls an SD card over SPI. This built-in module has higher read -//| performance than the library adafruit_sdcard, but it is only compatible with -//| `busio.SPI`, not `bitbangio.SPI`. Usually an SDCard object is used -//| with ``storage.VfsFat`` to allow file I/O to an SD card.""" -//| -//| def __init__(self, bus: busio.SPI, cs: microcontroller.Pin, baudrate: int = 8000000) -> None: -//| """Construct an SPI SD Card object with the given properties -//| -//| :param busio.SPI spi: The SPI bus -//| :param microcontroller.Pin cs: The chip select connected to the card -//| :param int baudrate: The SPI data rate to use after card setup -//| -//| Note that during detection and configuration, a hard-coded low baudrate is used. -//| Data transfers use the specified baurate (rounded down to one that is supported by -//| the microcontroller) -//| -//| Example usage: -//| -//| .. code-block:: python -//| -//| import os -//| -//| import board -//| import sdcardio -//| import storage -//| -//| sd = sdcardio.SDCard(board.SPI(), board.SD_CS) -//| vfs = storage.VfsFat(sd) -//| storage.mount(vfs, '/sd') -//| os.listdir('/sd')""" - -STATIC mp_obj_t sdcardio_sdcard_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_spi, ARG_cs, ARG_baudrate, ARG_sdio, NUM_ARGS }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_spi, MP_ARG_OBJ, {.u_obj = mp_const_none } }, - { MP_QSTR_cs, MP_ARG_OBJ, {.u_obj = mp_const_none } }, - { MP_QSTR_baudrate, MP_ARG_INT, {.u_int = 8000000} }, - { MP_QSTR_sdio, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_int = 8000000} }, - }; - MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - - busio_spi_obj_t *spi = validate_obj_is_spi_bus(args[ARG_spi].u_obj); - mcu_pin_obj_t *cs = validate_obj_is_free_pin(args[ARG_cs].u_obj); - - sdcardio_sdcard_obj_t *self = m_new_obj(sdcardio_sdcard_obj_t); - self->base.type = &sdcardio_SDCard_type; - - common_hal_sdcardio_sdcard_construct(self, spi, cs, args[ARG_baudrate].u_int); - - return self; -} - - -//| def count(self) -> int: -//| """Returns the total number of sectors -//| -//| Due to technical limitations, this is a function and not a property. -//| -//| :return: The number of 512-byte blocks, as a number""" -//| -mp_obj_t sdcardio_sdcard_count(mp_obj_t self_in) { - sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t*)self_in; - return mp_obj_new_int_from_ull(common_hal_sdcardio_sdcard_get_blockcount(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_count_obj, sdcardio_sdcard_count); - -//| def deinit(self) -> None: -//| """Disable permanently. -//| -//| :return: None""" -//| -mp_obj_t sdcardio_sdcard_deinit(mp_obj_t self_in) { - sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t*)self_in; - common_hal_sdcardio_sdcard_deinit(self); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_deinit_obj, sdcardio_sdcard_deinit); - - -//| def readblocks(self, start_block: int, buf: WriteableBuffer) -> None: -//| -//| """Read one or more blocks from the card -//| -//| :param int start_block: The block to start reading from -//| :param ~_typing.WriteableBuffer buf: The buffer to write into. Length must be multiple of 512. -//| -//| :return: None""" -//| - -mp_obj_t sdcardio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { - uint32_t start_block = mp_obj_get_int(start_block_in); - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE); - sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t*)self_in; - int result = common_hal_sdcardio_sdcard_readblocks(self, start_block, &bufinfo); - if (result < 0) { - mp_raise_OSError(-result); - } - return mp_const_none; -} - -MP_DEFINE_CONST_FUN_OBJ_3(sdcardio_sdcard_readblocks_obj, sdcardio_sdcard_readblocks); - -//| def writeblocks(self, start_block: int, buf: ReadableBuffer) -> None: -//| -//| """Write one or more blocks to the card -//| -//| :param int start_block: The block to start writing from -//| :param ~_typing.ReadableBuffer buf: The buffer to read from. Length must be multiple of 512. -//| -//| :return: None""" -//| - -mp_obj_t sdcardio_sdcard_writeblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { - uint32_t start_block = mp_obj_get_int(start_block_in); - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); - sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t*)self_in; - int result = common_hal_sdcardio_sdcard_writeblocks(self, start_block, &bufinfo); - if (result < 0) { - mp_raise_OSError(-result); - } - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_3(sdcardio_sdcard_writeblocks_obj, sdcardio_sdcard_writeblocks); - -STATIC const mp_rom_map_elem_t sdcardio_sdcard_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_count), MP_ROM_PTR(&sdcardio_sdcard_count_obj) }, - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&sdcardio_sdcard_deinit_obj) }, - { MP_ROM_QSTR(MP_QSTR_readblocks), MP_ROM_PTR(&sdcardio_sdcard_readblocks_obj) }, - { MP_ROM_QSTR(MP_QSTR_writeblocks), MP_ROM_PTR(&sdcardio_sdcard_writeblocks_obj) }, -}; -STATIC MP_DEFINE_CONST_DICT(sdcardio_sdcard_locals_dict, sdcardio_sdcard_locals_dict_table); - -const mp_obj_type_t sdcardio_SDCard_type = { - { &mp_type_type }, - .name = MP_QSTR_SDCard, - .make_new = sdcardio_sdcard_make_new, - .locals_dict = (mp_obj_dict_t*)&sdcardio_sdcard_locals_dict, -}; diff --git a/shared-bindings/sdcardio/SDCard 2.h b/shared-bindings/sdcardio/SDCard 2.h deleted file mode 100644 index 5986d5b814..0000000000 --- a/shared-bindings/sdcardio/SDCard 2.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017, 2018 Scott Shawcroft for Adafruit Industries - * Copyright (c) 2020 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 - -extern const mp_obj_type_t sdcardio_SDCard_type; diff --git a/shared-bindings/sdcardio/__init__ 2.c b/shared-bindings/sdcardio/__init__ 2.c deleted file mode 100644 index 746aa5588e..0000000000 --- a/shared-bindings/sdcardio/__init__ 2.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 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 "py/obj.h" -#include "py/runtime.h" - -#include "shared-bindings/sdcardio/SDCard.h" - -//| """Interface to an SD card via the SPI bus""" - -STATIC const mp_rom_map_elem_t sdcardio_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_sdcardio) }, - { MP_ROM_QSTR(MP_QSTR_SDCard), MP_ROM_PTR(&sdcardio_SDCard_type) }, -}; - -STATIC MP_DEFINE_CONST_DICT(sdcardio_module_globals, sdcardio_module_globals_table); - -const mp_obj_module_t sdcardio_module = { - .base = { &mp_type_module }, - .globals = (mp_obj_dict_t*)&sdcardio_module_globals, -}; diff --git a/shared-bindings/sdcardio/__init__ 2.h b/shared-bindings/sdcardio/__init__ 2.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/shared-module/sdcardio/SDCard 2.c b/shared-module/sdcardio/SDCard 2.c deleted file mode 100644 index 9e861279d3..0000000000 --- a/shared-module/sdcardio/SDCard 2.c +++ /dev/null @@ -1,466 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 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. - */ - -// This implementation largely follows the structure of adafruit_sdcard.py - -#include "shared-bindings/busio/SPI.h" -#include "shared-bindings/digitalio/DigitalInOut.h" -#include "shared-bindings/time/__init__.h" -#include "shared-bindings/util.h" -#include "shared-module/sdcardio/SDCard.h" - -#include "py/mperrno.h" - -#if 0 -#define DEBUG_PRINT(...) ((void)mp_printf(&mp_plat_print, ## __VA_ARGS__)) -#else -#define DEBUG_PRINT(...) ((void)0) -#endif - -#define CMD_TIMEOUT (200) - -#define R1_IDLE_STATE (1<<0) -#define R1_ILLEGAL_COMMAND (1<<2) - -#define TOKEN_CMD25 (0xFC) -#define TOKEN_STOP_TRAN (0xFD) -#define TOKEN_DATA (0xFE) - -STATIC bool lock_and_configure_bus(sdcardio_sdcard_obj_t *self) { - if (!common_hal_busio_spi_try_lock(self->bus)) { - return false; - } - common_hal_busio_spi_configure(self->bus, self->baudrate, 0, 0, 8); - common_hal_digitalio_digitalinout_set_value(&self->cs, false); - return true; -} - -STATIC void lock_bus_or_throw(sdcardio_sdcard_obj_t *self) { - if (!lock_and_configure_bus(self)) { - mp_raise_OSError(EAGAIN); - } -} - -STATIC void clock_card(sdcardio_sdcard_obj_t *self, int bytes) { - uint8_t buf[] = {0xff}; - common_hal_digitalio_digitalinout_set_value(&self->cs, true); - for (int i=0; ibus, buf, 1); - } -} - -STATIC void extraclock_and_unlock_bus(sdcardio_sdcard_obj_t *self) { - clock_card(self, 1); - common_hal_busio_spi_unlock(self->bus); -} - -static uint8_t CRC7(const uint8_t* data, uint8_t n) { - uint8_t crc = 0; - for (uint8_t i = 0; i < n; i++) { - uint8_t d = data[i]; - for (uint8_t j = 0; j < 8; j++) { - crc <<= 1; - if ((d & 0x80) ^ (crc & 0x80)) { - crc ^= 0x09; - } - d <<= 1; - } - } - return (crc << 1) | 1; -} - -#define READY_TIMEOUT_NS (300 * 1000 * 1000) // 300ms -STATIC void wait_for_ready(sdcardio_sdcard_obj_t *self) { - uint64_t deadline = common_hal_time_monotonic_ns() + READY_TIMEOUT_NS; - while (common_hal_time_monotonic_ns() < deadline) { - uint8_t b; - common_hal_busio_spi_read(self->bus, &b, 1, 0xff); - if (b == 0xff) { - break; - } - } -} - -// In Python API, defaults are response=None, data_block=True, wait=True -STATIC int cmd(sdcardio_sdcard_obj_t *self, int cmd, int arg, void *response_buf, size_t response_len, bool data_block, bool wait) { - DEBUG_PRINT("cmd % 3d [%02x] arg=% 11d [%08x] len=%d%s%s\n", cmd, cmd, arg, arg, response_len, data_block ? " data" : "", wait ? " wait" : ""); - uint8_t cmdbuf[6]; - cmdbuf[0] = cmd | 0x40; - cmdbuf[1] = (arg >> 24) & 0xff; - cmdbuf[2] = (arg >> 16) & 0xff; - cmdbuf[3] = (arg >> 8) & 0xff; - cmdbuf[4] = arg & 0xff; - cmdbuf[5] = CRC7(cmdbuf, 5); - - if (wait) { - wait_for_ready(self); - } - - common_hal_busio_spi_write(self->bus, cmdbuf, sizeof(cmdbuf)); - - // Wait for the response (response[7] == 0) - bool response_received = false; - for (int i=0; ibus, cmdbuf, 1, 0xff); - if ((cmdbuf[0] & 0x80) == 0) { - response_received = true; - break; - } - } - - if (!response_received) { - return -EIO; - } - - if (response_buf) { - - if (data_block) { - cmdbuf[1] = 0xff; - do { - // Wait for the start block byte - common_hal_busio_spi_read(self->bus, cmdbuf+1, 1, 0xff); - } while (cmdbuf[1] != 0xfe); - } - - common_hal_busio_spi_read(self->bus, response_buf, response_len, 0xff); - - if (data_block) { - // Read and discard the CRC-CCITT checksum - common_hal_busio_spi_read(self->bus, cmdbuf+1, 2, 0xff); - } - - } - - return cmdbuf[0]; -} - -STATIC int block_cmd(sdcardio_sdcard_obj_t *self, int cmd_, int block, void *response_buf, size_t response_len, bool data_block, bool wait) { - return cmd(self, cmd_, block * self->cdv, response_buf, response_len, true, true); -} - -STATIC bool cmd_nodata(sdcardio_sdcard_obj_t* self, int cmd, int response) { - uint8_t cmdbuf[2] = {cmd, 0xff}; - - common_hal_busio_spi_write(self->bus, cmdbuf, sizeof(cmdbuf)); - - // Wait for the response (response[7] == response) - for (int i=0; ibus, cmdbuf, 1, 0xff); - if (cmdbuf[0] == response) { - return 0; - } - } - return -EIO; -} - -STATIC const compressed_string_t *init_card_v1(sdcardio_sdcard_obj_t *self) { - for (int i=0; icdv = 1; - } - return NULL; - } - } - return translate("timeout waiting for v2 card"); -} - -STATIC const compressed_string_t *init_card(sdcardio_sdcard_obj_t *self) { - clock_card(self, 10); - - common_hal_digitalio_digitalinout_set_value(&self->cs, false); - - // CMD0: init card: should return _R1_IDLE_STATE (allow 5 attempts) - { - bool reached_idle_state = false; - for (int i=0; i<5; i++) { - if (cmd(self, 0, 0, NULL, 0, true, true) == R1_IDLE_STATE) { - reached_idle_state = true; - break; - } - } - if (!reached_idle_state) { - return translate("no SD card"); - } - } - - // CMD8: determine card version - { - uint8_t rb7[4]; - int response = cmd(self, 8, 0x1AA, rb7, sizeof(rb7), false, true); - if (response == R1_IDLE_STATE) { - const compressed_string_t *result =init_card_v2(self); - if (result != NULL) { - return result; - } - } else if (response == (R1_IDLE_STATE | R1_ILLEGAL_COMMAND)) { - const compressed_string_t *result =init_card_v1(self); - if (result != NULL) { - return result; - } - } else { - return translate("couldn't determine SD card version"); - } - } - - // CMD9: get number of sectors - { - uint8_t csd[16]; - int response = cmd(self, 9, 0, csd, sizeof(csd), true, true); - if (response != 0) { - return translate("no response from SD card"); - } - int csd_version = (csd[0] & 0xC0) >> 6; - if (csd_version >= 2) { - return translate("SD card CSD format not supported"); - } - - if (csd_version == 1) { - self->sectors = ((csd[8] << 8 | csd[9]) + 1) * 1024; - } else { - uint32_t block_length = 1 << (csd[5] & 0xF); - uint32_t c_size = ((csd[6] & 0x3) << 10) | (csd[7] << 2) | ((csd[8] & 0xC) >> 6); - uint32_t mult = 1 << (((csd[9] & 0x3) << 1 | (csd[10] & 0x80) >> 7) + 2); - self->sectors = block_length / 512 * mult * (c_size + 1); - } - } - - // CMD16: set block length to 512 bytes - { - int response = cmd(self, 16, 512, NULL, 0, true, true); - if (response != 0) { - return translate("can't set 512 block size"); - } - } - - return NULL; -} - -void common_hal_sdcardio_sdcard_construct(sdcardio_sdcard_obj_t *self, busio_spi_obj_t *bus, mcu_pin_obj_t *cs, int baudrate) { - self->bus = bus; - common_hal_digitalio_digitalinout_construct(&self->cs, cs); - common_hal_digitalio_digitalinout_switch_to_output(&self->cs, true, DRIVE_MODE_PUSH_PULL); - - self->cdv = 512; - self->sectors = 0; - self->baudrate = 250000; - - lock_bus_or_throw(self); - const compressed_string_t *result = init_card(self); - extraclock_and_unlock_bus(self); - - if (result != NULL) { - common_hal_digitalio_digitalinout_deinit(&self->cs); - mp_raise_OSError_msg(result); - } - - self->baudrate = baudrate; -} - -void common_hal_sdcardio_sdcard_deinit(sdcardio_sdcard_obj_t *self) { - if (!self->bus) { - return; - } - self->bus = 0; - common_hal_digitalio_digitalinout_deinit(&self->cs); -} - -void common_hal_sdcardio_check_for_deinit(sdcardio_sdcard_obj_t *self) { - if (!self->bus) { - raise_deinited_error(); - } -} - -int common_hal_sdcardio_sdcard_get_blockcount(sdcardio_sdcard_obj_t *self) { - common_hal_sdcardio_check_for_deinit(self); - return self->sectors; -} - -int readinto(sdcardio_sdcard_obj_t *self, void *buf, size_t size) { - uint8_t aux[2] = {0, 0}; - while (aux[0] != 0xfe) { - common_hal_busio_spi_read(self->bus, aux, 1, 0xff); - } - - common_hal_busio_spi_read(self->bus, buf, size, 0xff); - - // Read checksum and throw it away - common_hal_busio_spi_read(self->bus, aux, sizeof(aux), 0xff); - return 0; -} - -int readblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf) { - uint32_t nblocks = buf->len / 512; - if (nblocks == 1) { - // Use CMD17 to read a single block - return block_cmd(self, 17, start_block, buf->buf, buf->len, true, true); - } else { - // Use CMD18 to read multiple blocks - int r = block_cmd(self, 18, start_block, NULL, 0, true, true); - if (r < 0) { - return r; - } - - uint8_t *ptr = buf->buf; - while (nblocks--) { - r = readinto(self, ptr, 512); - if (r < 0) { - return r; - } - ptr += 512; - } - - // End the multi-block read - r = cmd(self, 12, 0, NULL, 0, true, false); - - // Return first status 0 or last before card ready (0xff) - while (r != 0) { - uint8_t single_byte; - common_hal_busio_spi_read(self->bus, &single_byte, 1, 0xff); - if (single_byte & 0x80) { - return r; - } - r = single_byte; - } - } - return 0; -} - -int common_hal_sdcardio_sdcard_readblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf) { - common_hal_sdcardio_check_for_deinit(self); - if (buf->len % 512 != 0) { - mp_raise_ValueError(translate("Buffer length must be a multiple of 512")); - } - - lock_and_configure_bus(self); - int r = readblocks(self, start_block, buf); - extraclock_and_unlock_bus(self); - return r; -} - -int _write(sdcardio_sdcard_obj_t *self, uint8_t token, void *buf, size_t size) { - wait_for_ready(self); - - uint8_t cmd[2]; - cmd[0] = token; - - common_hal_busio_spi_write(self->bus, cmd, 1); - common_hal_busio_spi_write(self->bus, buf, size); - - cmd[0] = cmd[1] = 0xff; - common_hal_busio_spi_write(self->bus, cmd, 2); - - // Check the response - // This differs from the traditional adafruit_sdcard handling, - // but adafruit_sdcard also ignored the return value of SDCard._write(!) - // so nobody noticed - // - // - // Response is as follows: - // x x x 0 STAT 1 - // 7 6 5 4 3..1 0 - // with STATUS 010 indicating "data accepted", and other status bit - // combinations indicating failure. - // In practice, I was seeing cmd[0] as 0xe5, indicating success - for (int i=0; ibus, cmd, 1, 0xff); - DEBUG_PRINT("i=%02d cmd[0] = 0x%02x\n", i, cmd[0]); - if ((cmd[0] & 0b00010001) == 0b00000001) { - if ((cmd[0] & 0x1f) != 0x5) { - return -EIO; - } else { - break; - } - } - } - - // Wait for the write to finish - do { - common_hal_busio_spi_read(self->bus, cmd, 1, 0xff); - } while (cmd[0] == 0); - - // Success - return 0; -} - -int writeblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf) { - common_hal_sdcardio_check_for_deinit(self); - uint32_t nblocks = buf->len / 512; - if (nblocks == 1) { - // Use CMD24 to write a single block - int r = block_cmd(self, 24, start_block, NULL, 0, true, true); - if (r < 0) { - return r; - } - r = _write(self, TOKEN_DATA, buf->buf, buf->len); - if (r < 0) { - return r; - } - } else { - // Use CMD25 to write multiple block - int r = block_cmd(self, 25, start_block, NULL, 0, true, true); - if (r < 0) { - return r; - } - - uint8_t *ptr = buf->buf; - while (nblocks--) { - r = _write(self, TOKEN_CMD25, ptr, 512); - if (r < 0) { - return r; - } - ptr += 512; - } - - cmd_nodata(self, TOKEN_STOP_TRAN, 0); - } - return 0; -} - -int common_hal_sdcardio_sdcard_writeblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf) { - common_hal_sdcardio_check_for_deinit(self); - if (buf->len % 512 != 0) { - mp_raise_ValueError(translate("Buffer length must be a multiple of 512")); - } - lock_and_configure_bus(self); - int r = writeblocks(self, start_block, buf); - extraclock_and_unlock_bus(self); - return r; -} diff --git a/shared-module/sdcardio/SDCard 2.h b/shared-module/sdcardio/SDCard 2.h deleted file mode 100644 index 76c906029f..0000000000 --- a/shared-module/sdcardio/SDCard 2.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 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" -#include "py/objproperty.h" -#include "py/runtime.h" -#include "py/objarray.h" - -#include "common-hal/busio/SPI.h" -#include "common-hal/digitalio/DigitalInOut.h" - -typedef struct { - mp_obj_base_t base; - busio_spi_obj_t *bus; - digitalio_digitalinout_obj_t cs; - int cdv; - int baudrate; - uint32_t sectors; -} sdcardio_sdcard_obj_t; - -void common_hal_sdcardio_sdcard_construct(sdcardio_sdcard_obj_t *self, busio_spi_obj_t *spi, mcu_pin_obj_t *cs, int baudrate); -void common_hal_sdcardio_sdcard_deinit(sdcardio_sdcard_obj_t *self); -void common_hal_sdcardio_sdcard_check_for_deinit(sdcardio_sdcard_obj_t *self); -int common_hal_sdcardio_sdcard_get_blockcount(sdcardio_sdcard_obj_t *self); -int common_hal_sdcardio_sdcard_readblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf); -int common_hal_sdcardio_sdcard_writeblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf); diff --git a/shared-module/sdcardio/__init__ 2.c b/shared-module/sdcardio/__init__ 2.c deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/shared-module/sdcardio/__init__ 2.h b/shared-module/sdcardio/__init__ 2.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/supervisor/background_callback 2.h b/supervisor/background_callback 2.h deleted file mode 100644 index 535dd656be..0000000000 --- a/supervisor/background_callback 2.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 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 CIRCUITPY_INCLUDED_SUPERVISOR_BACKGROUND_CALLBACK_H -#define CIRCUITPY_INCLUDED_SUPERVISOR_BACKGROUND_CALLBACK_H - -/** Background callbacks are a linked list of tasks to call in the background. - * - * Include a member of type `background_callback_t` inside an object - * which needs to queue up background work, and zero-initialize it. - * - * To schedule the work, use background_callback_add, with fun as the - * function to call and data pointing to the object itself. - * - * Next time run_background_tasks_if_tick is called, the callback will - * be run and removed from the linked list. - * - * Queueing a task that is already queued does nothing. Unconditionally - * re-queueing it from its own background task will cause it to run during the - * very next background-tasks invocation, leading to a CircuitPython freeze, so - * don't do that. - * - * background_callback_add can be called from interrupt context. - */ -typedef void (*background_callback_fun)(void *data); -typedef struct background_callback { - background_callback_fun fun; - void *data; - struct background_callback *next; - struct background_callback *prev; -} background_callback_t; - -/* Add a background callback for which 'fun' and 'data' were previously set */ -void background_callback_add_core(background_callback_t *cb); - -/* Add a background callback to the given function with the given data. When - * the callback involves an object on the GC heap, the 'data' must be a pointer - * to that object itself, not an internal pointer. Otherwise, it can be the - * case that no other references to the object itself survive, and the object - * becomes garbage collected while an outstanding background callback still - * exists. - */ -void background_callback_add(background_callback_t *cb, background_callback_fun fun, void *data); - -/* Run all background callbacks. Normally, this is done by the supervisor - * whenever the list is non-empty */ -void background_callback_run_all(void); - -/* During soft reset, remove all pending callbacks and clear the critical section flag */ -void background_callback_reset(void); - -/* Sometimes background callbacks must be blocked. Use these functions to - * bracket the section of code where this is the case. These calls nest, and - * begins must be balanced with ends. - */ -void background_callback_begin_critical_section(void); -void background_callback_end_critical_section(void); - -/* - * Background callbacks may stop objects from being collected - */ -void background_callback_gc_collect(void); - -#endif diff --git a/supervisor/shared/background_callback 2.c b/supervisor/shared/background_callback 2.c deleted file mode 100644 index 8e12dd3625..0000000000 --- a/supervisor/shared/background_callback 2.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 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 "py/gc.h" -#include "py/mpconfig.h" -#include "supervisor/background_callback.h" -#include "supervisor/shared/tick.h" -#include "shared-bindings/microcontroller/__init__.h" - -STATIC volatile background_callback_t *callback_head, *callback_tail; - -#define CALLBACK_CRITICAL_BEGIN (common_hal_mcu_disable_interrupts()) -#define CALLBACK_CRITICAL_END (common_hal_mcu_enable_interrupts()) - -void background_callback_add_core(background_callback_t *cb) { - CALLBACK_CRITICAL_BEGIN; - if (cb->prev || callback_head == cb) { - CALLBACK_CRITICAL_END; - return; - } - cb->next = 0; - cb->prev = (background_callback_t*)callback_tail; - if (callback_tail) { - callback_tail->next = cb; - cb->prev = (background_callback_t*)callback_tail; - } - if (!callback_head) { - callback_head = cb; - } - callback_tail = cb; - CALLBACK_CRITICAL_END; -} - -void background_callback_add(background_callback_t *cb, background_callback_fun fun, void *data) { - cb->fun = fun; - cb->data = data; - background_callback_add_core(cb); -} - -static bool in_background_callback; -void background_callback_run_all() { - if (!callback_head) { - return; - } - CALLBACK_CRITICAL_BEGIN; - if (in_background_callback) { - CALLBACK_CRITICAL_END; - return; - } - in_background_callback = true; - background_callback_t *cb = (background_callback_t*)callback_head; - callback_head = NULL; - callback_tail = NULL; - while (cb) { - background_callback_t *next = cb->next; - cb->next = cb->prev = NULL; - background_callback_fun fun = cb->fun; - void *data = cb->data; - CALLBACK_CRITICAL_END; - // Leave the critical section in order to run the callback function - if (fun) { - fun(data); - } - CALLBACK_CRITICAL_BEGIN; - cb = next; - } - in_background_callback = false; - CALLBACK_CRITICAL_END; -} - -void background_callback_begin_critical_section() { - CALLBACK_CRITICAL_BEGIN; -} - -void background_callback_end_critical_section() { - CALLBACK_CRITICAL_END; -} - -void background_callback_reset() { - CALLBACK_CRITICAL_BEGIN; - background_callback_t *cb = (background_callback_t*)callback_head; - while(cb) { - background_callback_t *next = cb->next; - memset(cb, 0, sizeof(*cb)); - cb = next; - } - callback_head = NULL; - callback_tail = NULL; - in_background_callback = false; - CALLBACK_CRITICAL_END; -} - -void background_callback_gc_collect(void) { - // We don't enter the callback critical section here. We rely on - // gc_collect_ptr _NOT_ entering background callbacks, so it is not - // possible for the list to be cleared. - // - // However, it is possible for the list to be extended. We make the - // minor assumption that no newly added callback is for a - // collectable object. That is, we only plug the hole where an - // object becomes collectable AFTER it is added but before the - // callback is run, not the hole where an object was ALREADY - // collectable but adds a background task for itself. - // - // It's necessary to traverse the whole list here, as the callbacks - // themselves can be in non-gc memory, and some of the cb->data - // objects themselves might be in non-gc memory. - background_callback_t *cb = (background_callback_t*)callback_head; - while(cb) { - gc_collect_ptr(cb->data); - cb = cb->next; - } -} From 983e1af33d0440329aa4f34109994f8597f0737a Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Fri, 21 Aug 2020 19:10:13 -0500 Subject: [PATCH 0691/1293] remove other extraneous files --- shared-bindings/sdioio/SDCard 2.c | 296 ------------------ shared-bindings/sdioio/SDCard 2.h | 66 ---- shared-bindings/sdioio/__init__ 2.c | 47 --- shared-bindings/sdioio/__init__ 2.h | 0 .../memorymonitor/AllocationAlarm 2.c | 94 ------ .../memorymonitor/AllocationAlarm 2.h | 51 --- .../memorymonitor/AllocationSize 2.c | 91 ------ .../memorymonitor/AllocationSize 2.h | 51 --- shared-module/memorymonitor/__init__ 2.c | 39 --- shared-module/memorymonitor/__init__ 2.h | 35 --- 10 files changed, 770 deletions(-) delete mode 100644 shared-bindings/sdioio/SDCard 2.c delete mode 100644 shared-bindings/sdioio/SDCard 2.h delete mode 100644 shared-bindings/sdioio/__init__ 2.c delete mode 100644 shared-bindings/sdioio/__init__ 2.h delete mode 100644 shared-module/memorymonitor/AllocationAlarm 2.c delete mode 100644 shared-module/memorymonitor/AllocationAlarm 2.h delete mode 100644 shared-module/memorymonitor/AllocationSize 2.c delete mode 100644 shared-module/memorymonitor/AllocationSize 2.h delete mode 100644 shared-module/memorymonitor/__init__ 2.c delete mode 100644 shared-module/memorymonitor/__init__ 2.h diff --git a/shared-bindings/sdioio/SDCard 2.c b/shared-bindings/sdioio/SDCard 2.c deleted file mode 100644 index aba414cd63..0000000000 --- a/shared-bindings/sdioio/SDCard 2.c +++ /dev/null @@ -1,296 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Scott Shawcroft - * - * 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. - */ - -// This file contains all of the Python API definitions for the -// sdioio.SDCard class. - -#include - -#include "shared-bindings/microcontroller/Pin.h" -#include "shared-bindings/sdioio/SDCard.h" -#include "shared-bindings/util.h" - -#include "lib/utils/buffer_helper.h" -#include "lib/utils/context_manager_helpers.h" -#include "py/mperrno.h" -#include "py/objproperty.h" -#include "py/runtime.h" -#include "supervisor/shared/translate.h" - -//| class SDCard: -//| """SD Card Block Interface with SDIO -//| -//| Controls an SD card over SDIO. SDIO is a parallel protocol designed -//| for SD cards. It uses a clock pin, a command pin, and 1 or 4 -//| data pins. It can be operated at a high frequency such as -//| 25MHz. Usually an SDCard object is used with ``storage.VfsFat`` -//| to allow file I/O to an SD card.""" -//| -//| def __init__(self, clock: microcontroller.Pin, command: microcontroller.Pin, data: Sequence[microcontroller.Pin], frequency: int) -> None: -//| """Construct an SDIO SD Card object with the given properties -//| -//| :param ~microcontroller.Pin clock: the pin to use for the clock. -//| :param ~microcontroller.Pin command: the pin to use for the command. -//| :param data: A sequence of pins to use for data. -//| :param frequency: The frequency of the bus in Hz -//| -//| Example usage: -//| -//| .. code-block:: python -//| -//| import os -//| -//| import board -//| import sdioio -//| import storage -//| -//| sd = sdioio.SDCard( -//| clock=board.SDIO_CLOCK, -//| command=board.SDIO_COMMAND, -//| data=board.SDIO_DATA, -//| frequency=25000000) -//| vfs = storage.VfsFat(sd) -//| storage.mount(vfs, '/sd') -//| os.listdir('/sd')""" -//| ... -//| - -STATIC mp_obj_t sdioio_sdcard_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - sdioio_sdcard_obj_t *self = m_new_obj(sdioio_sdcard_obj_t); - self->base.type = &sdioio_SDCard_type; - enum { ARG_clock, ARG_command, ARG_data, ARG_frequency, NUM_ARGS }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_clock, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ }, - { MP_QSTR_command, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ }, - { MP_QSTR_data, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ }, - { MP_QSTR_frequency, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_INT }, - }; - MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - - const mcu_pin_obj_t* clock = validate_obj_is_free_pin(args[ARG_clock].u_obj); - const mcu_pin_obj_t* command = validate_obj_is_free_pin(args[ARG_command].u_obj); - mcu_pin_obj_t *data_pins[4]; - uint8_t num_data; - validate_list_is_free_pins(MP_QSTR_data, data_pins, MP_ARRAY_SIZE(data_pins), args[ARG_data].u_obj, &num_data); - - common_hal_sdioio_sdcard_construct(self, clock, command, num_data, data_pins, args[ARG_frequency].u_int); - return MP_OBJ_FROM_PTR(self); -} - -STATIC void check_for_deinit(sdioio_sdcard_obj_t *self) { - if (common_hal_sdioio_sdcard_deinited(self)) { - raise_deinited_error(); - } -} - -//| def configure(self, frequency: int = 0, width: int = 0) -> None: -//| """Configures the SDIO bus. -//| -//| :param int frequency: the desired clock rate in Hertz. The actual clock rate may be higher or lower due to the granularity of available clock settings. Check the `frequency` attribute for the actual clock rate. -//| :param int width: the number of data lines to use. Must be 1 or 4 and must also not exceed the number of data lines at construction -//| -//| .. note:: Leaving a value unspecified or 0 means the current setting is kept""" -//| -STATIC mp_obj_t sdioio_sdcard_configure(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_frequency, ARG_width, NUM_ARGS }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_frequency, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, - { MP_QSTR_width, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, - }; - sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); - check_for_deinit(self); - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); - mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - - mp_int_t frequency = args[ARG_frequency].u_int; - if (frequency < 0) { - mp_raise_ValueError_varg(translate("Invalid %q"), MP_QSTR_baudrate); - } - - uint8_t width = args[ARG_width].u_int; - if (width != 0 && width != 1 && width != 4) { - mp_raise_ValueError_varg(translate("Invalid %q"), MP_QSTR_width); - } - - if (!common_hal_sdioio_sdcard_configure(self, frequency, width)) { - mp_raise_OSError(MP_EIO); - } - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_KW(sdioio_sdcard_configure_obj, 1, sdioio_sdcard_configure); - -//| def count(self) -> int: -//| """Returns the total number of sectors -//| -//| Due to technical limitations, this is a function and not a property. -//| -//| :return: The number of 512-byte blocks, as a number""" -//| -STATIC mp_obj_t sdioio_sdcard_count(mp_obj_t self_in) { - sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - return MP_OBJ_NEW_SMALL_INT(common_hal_sdioio_sdcard_get_count(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_count_obj, sdioio_sdcard_count); - -//| def readblocks(self, start_block: int, buf: WriteableBuffer) -> None: -//| -//| """Read one or more blocks from the card -//| -//| :param int start_block: The block to start reading from -//| :param ~_typing.WriteableBuffer buf: The buffer to write into. Length must be multiple of 512. -//| -//| :return: None""" -mp_obj_t sdioio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { - uint32_t start_block = mp_obj_get_int(start_block_in); - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE); - sdioio_sdcard_obj_t *self = (sdioio_sdcard_obj_t*)self_in; - int result = common_hal_sdioio_sdcard_readblocks(self, start_block, &bufinfo); - if (result < 0) { - mp_raise_OSError(-result); - } - return mp_const_none; -} - -MP_DEFINE_CONST_FUN_OBJ_3(sdioio_sdcard_readblocks_obj, sdioio_sdcard_readblocks); - -//| def writeblocks(self, start_block: int, buf: ReadableBuffer) -> None: -//| -//| """Write one or more blocks to the card -//| -//| :param int start_block: The block to start writing from -//| :param ~_typing.ReadableBuffer buf: The buffer to read from. Length must be multiple of 512. -//| -//| :return: None""" -//| -mp_obj_t sdioio_sdcard_writeblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { - uint32_t start_block = mp_obj_get_int(start_block_in); - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); - sdioio_sdcard_obj_t *self = (sdioio_sdcard_obj_t*)self_in; - int result = common_hal_sdioio_sdcard_writeblocks(self, start_block, &bufinfo); - if (result < 0) { - mp_raise_OSError(-result); - } - return mp_const_none; -} - -MP_DEFINE_CONST_FUN_OBJ_3(sdioio_sdcard_writeblocks_obj, sdioio_sdcard_writeblocks); - -//| @property -//| def frequency(self) -> int: -//| """The actual SDIO bus frequency. This may not match the frequency -//| requested due to internal limitations.""" -//| ... -//| -STATIC mp_obj_t sdioio_sdcard_obj_get_frequency(mp_obj_t self_in) { - sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - return MP_OBJ_NEW_SMALL_INT(common_hal_sdioio_sdcard_get_frequency(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_get_frequency_obj, sdioio_sdcard_obj_get_frequency); - -const mp_obj_property_t sdioio_sdcard_frequency_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&sdioio_sdcard_get_frequency_obj, - (mp_obj_t)&mp_const_none_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - -//| @property -//| def width(self) -> int: -//| """The actual SDIO bus width, in bits""" -//| ... -//| -STATIC mp_obj_t sdioio_sdcard_obj_get_width(mp_obj_t self_in) { - sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - return MP_OBJ_NEW_SMALL_INT(common_hal_sdioio_sdcard_get_width(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_get_width_obj, sdioio_sdcard_obj_get_width); - -const mp_obj_property_t sdioio_sdcard_width_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&sdioio_sdcard_get_width_obj, - (mp_obj_t)&mp_const_none_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - -//| def deinit(self) -> None: -//| """Disable permanently. -//| -//| :return: None""" -STATIC mp_obj_t sdioio_sdcard_obj_deinit(mp_obj_t self_in) { - sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_sdioio_sdcard_deinit(self); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_deinit_obj, sdioio_sdcard_obj_deinit); - -//| def __enter__(self) -> SDCard: -//| """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 sdioio_sdcard_obj___exit__(size_t n_args, const mp_obj_t *args) { - (void)n_args; - common_hal_sdioio_sdcard_deinit(args[0]); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(sdioio_sdcard_obj___exit___obj, 4, 4, sdioio_sdcard_obj___exit__); - -STATIC const mp_rom_map_elem_t sdioio_sdcard_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&sdioio_sdcard_deinit_obj) }, - { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&sdioio_sdcard_obj___exit___obj) }, - - { MP_ROM_QSTR(MP_QSTR_configure), MP_ROM_PTR(&sdioio_sdcard_configure_obj) }, - { MP_ROM_QSTR(MP_QSTR_frequency), MP_ROM_PTR(&sdioio_sdcard_frequency_obj) }, - { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&sdioio_sdcard_width_obj) }, - - { MP_ROM_QSTR(MP_QSTR_count), MP_ROM_PTR(&sdioio_sdcard_count_obj) }, - { MP_ROM_QSTR(MP_QSTR_readblocks), MP_ROM_PTR(&sdioio_sdcard_readblocks_obj) }, - { MP_ROM_QSTR(MP_QSTR_writeblocks), MP_ROM_PTR(&sdioio_sdcard_writeblocks_obj) }, -}; -STATIC MP_DEFINE_CONST_DICT(sdioio_sdcard_locals_dict, sdioio_sdcard_locals_dict_table); - -const mp_obj_type_t sdioio_SDCard_type = { - { &mp_type_type }, - .name = MP_QSTR_SDCard, - .make_new = sdioio_sdcard_make_new, - .locals_dict = (mp_obj_dict_t*)&sdioio_sdcard_locals_dict, -}; diff --git a/shared-bindings/sdioio/SDCard 2.h b/shared-bindings/sdioio/SDCard 2.h deleted file mode 100644 index 7f62ee7a65..0000000000 --- a/shared-bindings/sdioio/SDCard 2.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Scott Shawcroft - * - * 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_BUSIO_SDIO_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_SDIO_H - -#include "py/obj.h" - -#include "common-hal/microcontroller/Pin.h" -#include "common-hal/sdioio/SDCard.h" - -// Type object used in Python. Should be shared between ports. -extern const mp_obj_type_t sdioio_SDCard_type; - -// Construct an underlying SDIO object. -extern void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, - const mcu_pin_obj_t * clock, const mcu_pin_obj_t * command, - uint8_t num_data, mcu_pin_obj_t ** data, uint32_t frequency); - -extern void common_hal_sdioio_sdcard_deinit(sdioio_sdcard_obj_t *self); -extern bool common_hal_sdioio_sdcard_deinited(sdioio_sdcard_obj_t *self); - -extern bool common_hal_sdioio_sdcard_configure(sdioio_sdcard_obj_t *self, uint32_t baudrate, uint8_t width); - -extern void common_hal_sdioio_sdcard_unlock(sdioio_sdcard_obj_t *self); - -// Return actual SDIO bus frequency. -uint32_t common_hal_sdioio_sdcard_get_frequency(sdioio_sdcard_obj_t* self); - -// Return SDIO bus width. -uint8_t common_hal_sdioio_sdcard_get_width(sdioio_sdcard_obj_t* self); - -// Return number of device blocks -uint32_t common_hal_sdioio_sdcard_get_count(sdioio_sdcard_obj_t* self); - -// Read or write blocks -int common_hal_sdioio_sdcard_readblocks(sdioio_sdcard_obj_t* self, uint32_t start_block, mp_buffer_info_t *bufinfo); -int common_hal_sdioio_sdcard_writeblocks(sdioio_sdcard_obj_t* self, uint32_t start_block, mp_buffer_info_t *bufinfo); - -// This is used by the supervisor to claim SDIO devices indefinitely. -extern void common_hal_sdioio_sdcard_never_reset(sdioio_sdcard_obj_t *self); - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_SDIO_H diff --git a/shared-bindings/sdioio/__init__ 2.c b/shared-bindings/sdioio/__init__ 2.c deleted file mode 100644 index b88e5c3a96..0000000000 --- a/shared-bindings/sdioio/__init__ 2.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 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 "py/obj.h" -#include "py/runtime.h" - -#include "shared-bindings/sdioio/SDCard.h" - -//| """Interface to an SD card via the SDIO bus""" - -STATIC const mp_rom_map_elem_t sdioio_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_sdio) }, - { MP_ROM_QSTR(MP_QSTR_SDCard), MP_ROM_PTR(&sdioio_SDCard_type) }, -}; - -STATIC MP_DEFINE_CONST_DICT(sdioio_module_globals, sdioio_module_globals_table); - -const mp_obj_module_t sdioio_module = { - .base = { &mp_type_module }, - .globals = (mp_obj_dict_t*)&sdioio_module_globals, -}; diff --git a/shared-bindings/sdioio/__init__ 2.h b/shared-bindings/sdioio/__init__ 2.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/shared-module/memorymonitor/AllocationAlarm 2.c b/shared-module/memorymonitor/AllocationAlarm 2.c deleted file mode 100644 index 35f4e4c636..0000000000 --- a/shared-module/memorymonitor/AllocationAlarm 2.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This file is part of the Micro Python 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 "shared-bindings/memorymonitor/__init__.h" -#include "shared-bindings/memorymonitor/AllocationAlarm.h" - -#include "py/gc.h" -#include "py/mpstate.h" -#include "py/runtime.h" - -void common_hal_memorymonitor_allocationalarm_construct(memorymonitor_allocationalarm_obj_t* self, size_t minimum_block_count) { - self->minimum_block_count = minimum_block_count; - self->next = NULL; - self->previous = NULL; -} - -void common_hal_memorymonitor_allocationalarm_set_ignore(memorymonitor_allocationalarm_obj_t* self, mp_int_t count) { - self->count = count; -} - -void common_hal_memorymonitor_allocationalarm_pause(memorymonitor_allocationalarm_obj_t* self) { - // Check to make sure we aren't already paused. We can be if we're exiting from an exception we - // caused. - if (self->previous == NULL) { - return; - } - *self->previous = self->next; - self->next = NULL; - self->previous = NULL; -} - -void common_hal_memorymonitor_allocationalarm_resume(memorymonitor_allocationalarm_obj_t* self) { - if (self->previous != NULL) { - mp_raise_RuntimeError(translate("Already running")); - } - self->next = MP_STATE_VM(active_allocationalarms); - self->previous = (memorymonitor_allocationalarm_obj_t**) &MP_STATE_VM(active_allocationalarms); - if (self->next != NULL) { - self->next->previous = &self->next; - } - MP_STATE_VM(active_allocationalarms) = self; -} - -void memorymonitor_allocationalarms_allocation(size_t block_count) { - memorymonitor_allocationalarm_obj_t* alarm = MP_OBJ_TO_PTR(MP_STATE_VM(active_allocationalarms)); - size_t alert_count = 0; - while (alarm != NULL) { - // Hold onto next in case we remove the alarm from the list. - memorymonitor_allocationalarm_obj_t* next = alarm->next; - if (block_count >= alarm->minimum_block_count) { - if (alarm->count > 0) { - alarm->count--; - } else { - // Uncomment the breakpoint below if you want to use a C debugger to figure out the C - // call stack for an allocation. - // asm("bkpt"); - // Pause now because we may alert when throwing the exception too. - common_hal_memorymonitor_allocationalarm_pause(alarm); - alert_count++; - } - } - alarm = next; - } - if (alert_count > 0) { - mp_raise_memorymonitor_AllocationError(translate("Attempt to allocate %d blocks"), block_count); - } -} - -void memorymonitor_allocationalarms_reset(void) { - MP_STATE_VM(active_allocationalarms) = NULL; -} diff --git a/shared-module/memorymonitor/AllocationAlarm 2.h b/shared-module/memorymonitor/AllocationAlarm 2.h deleted file mode 100644 index 172c24f6c8..0000000000 --- a/shared-module/memorymonitor/AllocationAlarm 2.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of the Micro Python 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. - */ - -#ifndef MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONALARM_H -#define MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONALARM_H - -#include -#include - -#include "py/obj.h" - -typedef struct _memorymonitor_allocationalarm_obj_t memorymonitor_allocationalarm_obj_t; - -#define ALLOCATION_SIZE_BUCKETS 16 - -typedef struct _memorymonitor_allocationalarm_obj_t { - mp_obj_base_t base; - size_t minimum_block_count; - mp_int_t count; - // Store the location that points to us so we can remove ourselves. - memorymonitor_allocationalarm_obj_t** previous; - memorymonitor_allocationalarm_obj_t* next; -} memorymonitor_allocationalarm_obj_t; - -void memorymonitor_allocationalarms_allocation(size_t block_count); -void memorymonitor_allocationalarms_reset(void); - -#endif // MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONALARM_H diff --git a/shared-module/memorymonitor/AllocationSize 2.c b/shared-module/memorymonitor/AllocationSize 2.c deleted file mode 100644 index c28e65592c..0000000000 --- a/shared-module/memorymonitor/AllocationSize 2.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * This file is part of the Micro Python 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 "shared-bindings/memorymonitor/AllocationSize.h" - -#include "py/gc.h" -#include "py/mpstate.h" -#include "py/runtime.h" - -void common_hal_memorymonitor_allocationsize_construct(memorymonitor_allocationsize_obj_t* self) { - common_hal_memorymonitor_allocationsize_clear(self); - self->next = NULL; - self->previous = NULL; -} - -void common_hal_memorymonitor_allocationsize_pause(memorymonitor_allocationsize_obj_t* self) { - *self->previous = self->next; - self->next = NULL; - self->previous = NULL; -} - -void common_hal_memorymonitor_allocationsize_resume(memorymonitor_allocationsize_obj_t* self) { - if (self->previous != NULL) { - mp_raise_RuntimeError(translate("Already running")); - } - self->next = MP_STATE_VM(active_allocationsizes); - self->previous = (memorymonitor_allocationsize_obj_t**) &MP_STATE_VM(active_allocationsizes); - if (self->next != NULL) { - self->next->previous = &self->next; - } - MP_STATE_VM(active_allocationsizes) = self; -} - -void common_hal_memorymonitor_allocationsize_clear(memorymonitor_allocationsize_obj_t* self) { - for (size_t i = 0; i < ALLOCATION_SIZE_BUCKETS; i++) { - self->buckets[i] = 0; - } -} - -uint16_t common_hal_memorymonitor_allocationsize_get_len(memorymonitor_allocationsize_obj_t* self) { - return ALLOCATION_SIZE_BUCKETS; -} - -size_t common_hal_memorymonitor_allocationsize_get_bytes_per_block(memorymonitor_allocationsize_obj_t* self) { - return BYTES_PER_BLOCK; -} - -uint16_t common_hal_memorymonitor_allocationsize_get_item(memorymonitor_allocationsize_obj_t* self, int16_t index) { - return self->buckets[index]; -} - -void memorymonitor_allocationsizes_track_allocation(size_t block_count) { - memorymonitor_allocationsize_obj_t* as = MP_OBJ_TO_PTR(MP_STATE_VM(active_allocationsizes)); - size_t power_of_two = 0; - block_count >>= 1; - while (block_count != 0) { - power_of_two++; - block_count >>= 1; - } - while (as != NULL) { - as->buckets[power_of_two]++; - as = as->next; - } -} - -void memorymonitor_allocationsizes_reset(void) { - MP_STATE_VM(active_allocationsizes) = NULL; -} diff --git a/shared-module/memorymonitor/AllocationSize 2.h b/shared-module/memorymonitor/AllocationSize 2.h deleted file mode 100644 index 3baab2213e..0000000000 --- a/shared-module/memorymonitor/AllocationSize 2.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of the Micro Python 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. - */ - -#ifndef MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONSIZE_H -#define MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONSIZE_H - -#include -#include - -#include "py/obj.h" - -typedef struct _memorymonitor_allocationsize_obj_t memorymonitor_allocationsize_obj_t; - -#define ALLOCATION_SIZE_BUCKETS 16 - -typedef struct _memorymonitor_allocationsize_obj_t { - mp_obj_base_t base; - uint16_t buckets[ALLOCATION_SIZE_BUCKETS]; - // Store the location that points to us so we can remove ourselves. - memorymonitor_allocationsize_obj_t** previous; - memorymonitor_allocationsize_obj_t* next; - bool paused; -} memorymonitor_allocationsize_obj_t; - -void memorymonitor_allocationsizes_track_allocation(size_t block_count); -void memorymonitor_allocationsizes_reset(void); - -#endif // MICROPY_INCLUDED_SHARED_MODULE_MEMORYMONITOR_ALLOCATIONSIZE_H diff --git a/shared-module/memorymonitor/__init__ 2.c b/shared-module/memorymonitor/__init__ 2.c deleted file mode 100644 index 6cb424153d..0000000000 --- a/shared-module/memorymonitor/__init__ 2.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Scott Shawcroft - * - * 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-module/memorymonitor/__init__.h" -#include "shared-module/memorymonitor/AllocationAlarm.h" -#include "shared-module/memorymonitor/AllocationSize.h" - -void memorymonitor_track_allocation(size_t block_count) { - memorymonitor_allocationalarms_allocation(block_count); - memorymonitor_allocationsizes_track_allocation(block_count); -} - -void memorymonitor_reset(void) { - memorymonitor_allocationalarms_reset(); - memorymonitor_allocationsizes_reset(); -} diff --git a/shared-module/memorymonitor/__init__ 2.h b/shared-module/memorymonitor/__init__ 2.h deleted file mode 100644 index f47f6434bf..0000000000 --- a/shared-module/memorymonitor/__init__ 2.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 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 MICROPY_INCLUDED_MEMORYMONITOR___INIT___H -#define MICROPY_INCLUDED_MEMORYMONITOR___INIT___H - -#include - -void memorymonitor_track_allocation(size_t block_count); -void memorymonitor_reset(void); - -#endif // MICROPY_INCLUDED_MEMORYMONITOR___INIT___H From fe0f79adce95dbe88c4826b26f163c573aa8f9c2 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 21 Aug 2020 20:38:19 -0500 Subject: [PATCH 0692/1293] Making requested modifications --- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 4 ++-- ports/atmel-samd/common-hal/pulseio/PulseIn.h | 1 - supervisor/shared/background_callback.c | 4 ---- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index 772948828a..27bf842d56 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -112,7 +112,7 @@ void pulsein_interrupt_handler(uint8_t channel) { } uint16_t i = (self->start + self->len) % self->maxlen; - if (self->len <= self->maxlen) { + if (self->len < self->maxlen) { self->len++; } else { self->errored_too_fast = true; @@ -278,6 +278,7 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t* self, self->first_edge = true; self->last_overflow = 0; self->last_count = 0; + self->errored_too_fast = false; gpio_set_pin_function(self->pin, GPIO_PIN_FUNCTION_A); uint32_t mask = 1 << self->channel; // Clear previous interrupt state and re-enable it. @@ -299,7 +300,6 @@ uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { mp_raise_IndexError(translate("pop from an empty PulseIn")); } if (self->errored_too_fast) { - self->errored_too_fast = false; mp_raise_RuntimeError(translate("Input taking too long")); } common_hal_mcu_disable_interrupts(); diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.h b/ports/atmel-samd/common-hal/pulseio/PulseIn.h index a0f838b373..99358178f2 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.h +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.h @@ -50,7 +50,6 @@ void pulsein_reset(void); void pulsein_interrupt_handler(uint8_t channel); void pulsein_timer_interrupt_handler(uint8_t index); -void update_background_ticks(void); #ifdef SAMD21 void rtc_set_continuous(void); void rtc_start_pulsein(void); diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c index fb46343ab1..154618297e 100644 --- a/supervisor/shared/background_callback.c +++ b/supervisor/shared/background_callback.c @@ -43,10 +43,6 @@ uint64_t get_background_ticks(void) { return last_background_tick; } -void update_background_ticks(void) { - last_background_tick = port_get_raw_ticks(NULL); -} - void background_callback_add_core(background_callback_t *cb) { last_background_tick = port_get_raw_ticks(NULL); CALLBACK_CRITICAL_BEGIN; From 7f629624dbd1d67576af495026305b75200f8872 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Fri, 21 Aug 2020 20:50:15 -0500 Subject: [PATCH 0693/1293] Added hanging indents to docs per @sommersoft's suggestion --- shared-bindings/displayio/Bitmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index c13ed0407e..b1d73115de 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -174,19 +174,19 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val //| def blit(self, x: int, y: int, source_bitmap: bitmap, *, x1: int, y1: int, x2: int, y2: int, skip_index: int) -> None: //| """Inserts the source_bitmap region defined by rectangular boundaries -//| (x1,y1) and (x2,y2) into the bitmap at the specified (x,y) location. +//| (x1,y1) and (x2,y2) into the bitmap at the specified (x,y) location. //| //| :param int x: Horizontal pixel location in bitmap where source_bitmap upper-left -//| corner will be placed +//| corner will be placed //| :param int y: Vertical pixel location in bitmap where source_bitmap upper-left -//| corner will be placed +//| corner will be placed //| :param bitmap source_bitmap: Source bitmap that contains the graphical region to be copied //| :param int x1: Minimum x-value for rectangular bounding box to be copied from the source bitmap //| :param int y1: Minimum y-value for rectangular bounding box to be copied from the source bitmap //| :param int x2: Maximum x-value (exclusive) for rectangular bounding box to be copied from the source bitmap //| :param int y2: Maximum y-value (exclusive) for rectangular bounding box to be copied from the source bitmap //| :param int skip_index: bitmap palette index in the source that will not be copied, -//| set to None to copy all pixels""" +//| set to None to copy all pixels""" //| ... //| STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args){ From f55f2bfee1bcce39a617628a5b1aa7728a24295b Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Fri, 21 Aug 2020 21:40:46 -0500 Subject: [PATCH 0694/1293] shorten error strings --- locale/circuitpython.pot | 60 ++++++++++++------------------ shared-bindings/displayio/Bitmap.c | 12 +++--- 2 files changed, 30 insertions(+), 42 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index c8a24ef674..fe726acf27 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-21 14:36-0500\n" +"POT-Creation-Date: 2020-08-21 21:39-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -82,7 +82,6 @@ msgstr "" msgid "%q list must be a list" msgstr "" -#: shared-bindings/memorymonitor/AllocationAlarm 2.c #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" msgstr "" @@ -90,7 +89,6 @@ msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm 2.c #: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" @@ -254,14 +252,6 @@ msgstr "" msgid "'yield' outside function" msgstr "" -#: shared-bindings/displayio/Bitmap.c -msgid "(x,y): out of range of target bitmap" -msgstr "" - -#: shared-bindings/displayio/Bitmap.c -msgid "(x1,y1) or (x2,y2): out of range of source bitmap" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "" @@ -332,9 +322,7 @@ msgstr "" msgid "Already advertising." msgstr "" -#: shared-module/memorymonitor/AllocationAlarm 2.c #: shared-module/memorymonitor/AllocationAlarm.c -#: shared-module/memorymonitor/AllocationSize 2.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" msgstr "" @@ -374,7 +362,6 @@ msgstr "" msgid "At most %d %q may be specified (not %d)" msgstr "" -#: shared-module/memorymonitor/AllocationAlarm 2.c #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" @@ -456,8 +443,7 @@ msgid "Buffer length %d too big. It must be less than %d" msgstr "" #: ports/atmel-samd/common-hal/sdioio/SDCard.c -#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard 2.c -#: shared-module/sdcardio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" msgstr "" @@ -505,11 +491,6 @@ msgid "Can't set CCCD on local Characteristic" msgstr "" #: shared-bindings/displayio/Bitmap.c -msgid "Cannot blit: source palette too large." -msgstr "" - -#: shared-bindings/displayio/Bitmap.c -#: shared-bindings/memorymonitor/AllocationSize 2.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" @@ -931,7 +912,7 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard 2.c shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c msgid "Invalid %q" msgstr "" @@ -1398,7 +1379,6 @@ msgstr "" msgid "Random number generation error" msgstr "" -#: shared-bindings/memorymonitor/AllocationSize 2.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" @@ -1432,7 +1412,7 @@ msgstr "" msgid "Running in safe mode! " msgstr "" -#: shared-module/sdcardio/SDCard 2.c shared-module/sdcardio/SDCard.c +#: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" msgstr "" @@ -1491,7 +1471,6 @@ msgstr "" #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/TileGrid.c -#: shared-bindings/memorymonitor/AllocationSize 2.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" @@ -1517,7 +1496,7 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" -#: shared-bindings/gnss/GNSS 2.c shared-bindings/gnss/GNSS.c +#: shared-bindings/gnss/GNSS.c msgid "System entry must be gnss.SatelliteSystem" msgstr "" @@ -1821,12 +1800,10 @@ msgstr "" msgid "address %08x is not aligned to %d bytes" msgstr "" -#: shared-bindings/i2cperipheral/I2CPeripheral 2.c #: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cperipheral/I2CPeripheral 2.c #: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1989,8 +1966,7 @@ msgstr "" msgid "can't assign to expression" msgstr "" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral 2.c -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c #: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -2051,7 +2027,7 @@ msgstr "" msgid "can't send non-None value to a just-started generator" msgstr "" -#: shared-module/sdcardio/SDCard 2.c shared-module/sdcardio/SDCard.c +#: shared-module/sdcardio/SDCard.c msgid "can't set 512 block size" msgstr "" @@ -2181,7 +2157,7 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" -#: shared-module/sdcardio/SDCard 2.c shared-module/sdcardio/SDCard.c +#: shared-module/sdcardio/SDCard.c msgid "couldn't determine SD card version" msgstr "" @@ -2739,7 +2715,7 @@ msgstr "" msgid "negative shift count" msgstr "" -#: shared-module/sdcardio/SDCard 2.c shared-module/sdcardio/SDCard.c +#: shared-module/sdcardio/SDCard.c msgid "no SD card" msgstr "" @@ -2764,7 +2740,7 @@ msgstr "" msgid "no reset pin available" msgstr "" -#: shared-module/sdcardio/SDCard 2.c shared-module/sdcardio/SDCard.c +#: shared-module/sdcardio/SDCard.c msgid "no response from SD card" msgstr "" @@ -2899,6 +2875,14 @@ msgstr "" msgid "ord() expected a character, but string of length %d found" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "" @@ -3076,6 +3060,10 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3152,11 +3140,11 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "" -#: shared-module/sdcardio/SDCard 2.c shared-module/sdcardio/SDCard.c +#: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "" -#: shared-module/sdcardio/SDCard 2.c shared-module/sdcardio/SDCard.c +#: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v2 card" msgstr "" diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index b1d73115de..5a2fc785f8 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -177,16 +177,16 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val //| (x1,y1) and (x2,y2) into the bitmap at the specified (x,y) location. //| //| :param int x: Horizontal pixel location in bitmap where source_bitmap upper-left -//| corner will be placed +//| corner will be placed //| :param int y: Vertical pixel location in bitmap where source_bitmap upper-left -//| corner will be placed +//| corner will be placed //| :param bitmap source_bitmap: Source bitmap that contains the graphical region to be copied //| :param int x1: Minimum x-value for rectangular bounding box to be copied from the source bitmap //| :param int y1: Minimum y-value for rectangular bounding box to be copied from the source bitmap //| :param int x2: Maximum x-value (exclusive) for rectangular bounding box to be copied from the source bitmap //| :param int y2: Maximum y-value (exclusive) for rectangular bounding box to be copied from the source bitmap //| :param int skip_index: bitmap palette index in the source that will not be copied, -//| set to None to copy all pixels""" +//| set to None to copy all pixels""" //| ... //| STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args){ @@ -213,7 +213,7 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg // ensure that the target bitmap (self) has at least as many `bits_per_value` as the source if (self->bits_per_value < source->bits_per_value) { - mp_raise_ValueError(translate("Cannot blit: source palette too large.")); + mp_raise_ValueError(translate("source palette too large")); } int16_t x1 = args[ARG_x1].u_int; @@ -234,14 +234,14 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg // Check x,y are within self (target) bitmap boundary if ( (x < 0) || (y < 0) || (x > self->width) || (y > self->height) ) { - mp_raise_ValueError(translate("(x,y): out of range of target bitmap")); + mp_raise_ValueError(translate("out of range of target")); } // Check x1,y1,x2,y2 are within source bitmap boundary if ( (x1 < 0) || (x1 > source->width) || (y1 < 0) || (y1 > source->height) || (x2 < 0) || (x2 > source->width) || (y2 < 0) || (y2 > source->height) ) { - mp_raise_ValueError(translate("(x1,y1) or (x2,y2): out of range of source bitmap")); + mp_raise_ValueError(translate("out of range of source")); } // Ensure x1 < x2 and y1 < y2 From f8a9e11ff4f42620bbe6e678f009bdadcb4ac542 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 23 Aug 2020 08:46:42 -0500 Subject: [PATCH 0695/1293] WIP supervisor: check for interrupt during rx_chr --- supervisor/shared/micropython.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/supervisor/shared/micropython.c b/supervisor/shared/micropython.c index 245db11d42..cd9485f8c0 100644 --- a/supervisor/shared/micropython.c +++ b/supervisor/shared/micropython.c @@ -29,14 +29,32 @@ #include "supervisor/serial.h" #include "lib/oofatfs/ff.h" #include "py/mpconfig.h" +#include "py/mpstate.h" #include "supervisor/shared/status_leds.h" +#if CIRCUITPY_WATCHDOG +#include "shared-bindings/watchdog/__init__.h" +#define WATCHDOG_EXCEPTION_CHECK() (MP_STATE_VM(mp_pending_exception) == &mp_watchdog_timeout_exception) +#else +#define WATCHDOG_EXCEPTION_CHECK() 0 +#endif + int mp_hal_stdin_rx_chr(void) { for (;;) { #ifdef MICROPY_VM_HOOK_LOOP MICROPY_VM_HOOK_LOOP #endif + // Check to see if we've been CTRL-Ced by autoreload or the user. + if (MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) { + // clear exception and generate stacktrace + MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; + nlr_raise(&MP_STATE_VM(mp_kbd_exception)); + } + if (MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || WATCHDOG_EXCEPTION_CHECK()) { + // stop reading immediately + return EOF; + } if (serial_bytes_available()) { toggle_rx_led(); return serial_read(); From 1033e89561d6535f32aa4cfd3541ffd9683a1123 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 23 Aug 2020 09:03:34 -0500 Subject: [PATCH 0696/1293] supervisor: use mp_handle_pending to check for exceptions --- supervisor/shared/micropython.c | 12 ++---------- supervisor/shared/tick.c | 13 ++----------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/supervisor/shared/micropython.c b/supervisor/shared/micropython.c index cd9485f8c0..bbc4807f97 100644 --- a/supervisor/shared/micropython.c +++ b/supervisor/shared/micropython.c @@ -30,6 +30,7 @@ #include "lib/oofatfs/ff.h" #include "py/mpconfig.h" #include "py/mpstate.h" +#include "py/runtime.h" #include "supervisor/shared/status_leds.h" @@ -45,16 +46,7 @@ int mp_hal_stdin_rx_chr(void) { #ifdef MICROPY_VM_HOOK_LOOP MICROPY_VM_HOOK_LOOP #endif - // Check to see if we've been CTRL-Ced by autoreload or the user. - if (MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) { - // clear exception and generate stacktrace - MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; - nlr_raise(&MP_STATE_VM(mp_kbd_exception)); - } - if (MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || WATCHDOG_EXCEPTION_CHECK()) { - // stop reading immediately - return EOF; - } + mp_handle_pending(); if (serial_bytes_available()) { toggle_rx_led(); return serial_read(); diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 4af59f78e3..f26e1e79d1 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -27,6 +27,7 @@ #include "supervisor/shared/tick.h" #include "py/mpstate.h" +#include "py/runtime.h" #include "supervisor/linker.h" #include "supervisor/filesystem.h" #include "supervisor/background_callback.h" @@ -149,17 +150,7 @@ void mp_hal_delay_ms(mp_uint_t delay) { while (remaining > 0) { RUN_BACKGROUND_TASKS; // Check to see if we've been CTRL-Ced by autoreload or the user. - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) - { - // clear exception and generate stacktrace - MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; - nlr_raise(&MP_STATE_VM(mp_kbd_exception)); - } - if( MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || - WATCHDOG_EXCEPTION_CHECK()) { - // stop sleeping immediately - break; - } + mp_handle_pending(); remaining = end_tick - port_get_raw_ticks(NULL); // We break a bit early so we don't risk setting the alarm before the time when we call // sleep. From c79389c4d4af881a1df3e366855c731f09a1e128 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Mon, 24 Aug 2020 11:10:34 +0530 Subject: [PATCH 0697/1293] Added microS2 board to build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ceb691a15b..28bc7664c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -410,6 +410,7 @@ jobs: board: - "espressif_saola_1_wroom" - "espressif_saola_1_wrover" + - "micro_s2" - "unexpectedmaker_feathers2" steps: From 3eea3b5311c9e096a790b37f339ae02e2b206934 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Mon, 24 Aug 2020 11:12:35 +0530 Subject: [PATCH 0698/1293] Added microS2 specific config files --- ports/esp32s2/boards/micro_s2/board.c | 56 +++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 ports/esp32s2/boards/micro_s2/board.c diff --git a/ports/esp32s2/boards/micro_s2/board.c b/ports/esp32s2/boards/micro_s2/board.c new file mode 100644 index 0000000000..1dc30b5af8 --- /dev/null +++ b/ports/esp32s2/boards/micro_s2/board.c @@ -0,0 +1,56 @@ +/* + * 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 "boards/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + + // SPI Flash and RAM + common_hal_never_reset_pin(&pin_GPIO26); + common_hal_never_reset_pin(&pin_GPIO27); + common_hal_never_reset_pin(&pin_GPIO28); + common_hal_never_reset_pin(&pin_GPIO29); + common_hal_never_reset_pin(&pin_GPIO30); + common_hal_never_reset_pin(&pin_GPIO31); + common_hal_never_reset_pin(&pin_GPIO32); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} From c137a1612133e06d2b7bec06b325695c9a60c4b9 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 24 Aug 2020 14:49:06 -0400 Subject: [PATCH 0699/1293] Remove Meowbit LSE flag, harsher failure for LSE issues --- ports/stm/boards/meowbit_v121/mpconfigboard.h | 3 +-- ports/stm/peripherals/stm32f4/clocks.c | 17 +++-------------- ports/stm/peripherals/stm32f7/clocks.c | 17 +++-------------- ports/stm/peripherals/stm32h7/clocks.c | 17 +++-------------- 4 files changed, 10 insertions(+), 44 deletions(-) diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.h b/ports/stm/boards/meowbit_v121/mpconfigboard.h index 106f25b15c..be9f2a75fb 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.h +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.h @@ -36,8 +36,7 @@ #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) #define HSE_VALUE ((uint32_t)12000000U) -#define LSE_VALUE ((uint32_t)32000U) -#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) #define BOARD_NO_VBUS_SENSE (1) #define BOARD_VTOR_DEFER (1) //Leave VTOR relocation to bootloader diff --git a/ports/stm/peripherals/stm32f4/clocks.c b/ports/stm/peripherals/stm32f4/clocks.c index 7a16812b36..c2d0a452a0 100644 --- a/ports/stm/peripherals/stm32f4/clocks.c +++ b/ports/stm/peripherals/stm32f4/clocks.c @@ -49,7 +49,6 @@ void stm32_peripherals_clocks_init(void) { RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_OscInitTypeDef RCC_OscInitStruct; RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; - bool lse_failure = false; // Set voltage scaling in accordance with system clock speed __HAL_RCC_PWR_CLK_ENABLE(); @@ -76,15 +75,9 @@ void stm32_peripherals_clocks_init(void) { #endif if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { - // Failure likely means a LSE issue - attempt to swap to LSI, and set to crash - RCC_OscInitStruct.LSEState = RCC_LSE_OFF; - RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSI; - RCC_OscInitStruct.LSIState = RCC_LSI_ON; - if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { - // No HSE means no USB, so just fail forever - while(1); - } - lse_failure = true; + // Clock issues are too problematic to even attempt recovery. + // If you end up here, check whether your LSE settings match your board. + while(1); } // Configure bus clock sources and divisors @@ -113,8 +106,4 @@ void stm32_peripherals_clocks_init(void) { #endif HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); - - if (lse_failure) { - reset_into_safe_mode(HARD_CRASH); //TODO: make safe mode category CLOCK_FAULT? - } } diff --git a/ports/stm/peripherals/stm32f7/clocks.c b/ports/stm/peripherals/stm32f7/clocks.c index 93016f6828..f130887822 100644 --- a/ports/stm/peripherals/stm32f7/clocks.c +++ b/ports/stm/peripherals/stm32f7/clocks.c @@ -40,7 +40,6 @@ void stm32_peripherals_clocks_init(void) { RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_OscInitTypeDef RCC_OscInitStruct; RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; - bool lse_failure = false; // Configure LSE Drive HAL_PWR_EnableBkUpAccess(); @@ -68,15 +67,9 @@ void stm32_peripherals_clocks_init(void) { RCC_OscInitStruct.PLL.PLLQ = CPY_CLK_PLLQ; if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { - // Failure likely means a LSE issue - attempt to swap to LSI, and set to crash - RCC_OscInitStruct.LSEState = RCC_LSE_OFF; - RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSI; - RCC_OscInitStruct.LSIState = RCC_LSI_ON; - if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { - // No HSE means no USB, so just fail forever - while(1); - } - lse_failure = true; + // Clock issues are too problematic to even attempt recovery. + // If you end up here, check whether your LSE settings match your board. + while(1); } /* Activate the OverDrive to reach the 216 MHz Frequency */ @@ -111,8 +104,4 @@ void stm32_peripherals_clocks_init(void) { #endif HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); - - if (lse_failure) { - reset_into_safe_mode(HARD_CRASH); //TODO: make safe mode category CLOCK_FAULT? - } } diff --git a/ports/stm/peripherals/stm32h7/clocks.c b/ports/stm/peripherals/stm32h7/clocks.c index 0e4e79f9f7..a088f78bf2 100644 --- a/ports/stm/peripherals/stm32h7/clocks.c +++ b/ports/stm/peripherals/stm32h7/clocks.c @@ -37,7 +37,6 @@ void stm32_peripherals_clocks_init(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; - bool lse_failure = false; // Set voltage scaling in accordance with system clock speed HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY); @@ -73,15 +72,9 @@ void stm32_peripherals_clocks_init(void) { RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE; RCC_OscInitStruct.PLL.PLLFRACN = 0; if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { - // Failure likely means a LSE issue - attempt to swap to LSI, and set to crash - RCC_OscInitStruct.LSEState = RCC_LSE_OFF; - RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSI; - RCC_OscInitStruct.LSIState = RCC_LSI_ON; - if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { - // No HSE means no USB, so just fail forever - while(1); - } - lse_failure = true; + // Clock issues are too problematic to even attempt recovery. + // If you end up here, check whether your LSE settings match your board. + while(1); } // Configure bus clock sources and divisors @@ -116,8 +109,4 @@ void stm32_peripherals_clocks_init(void) { // Enable USB Voltage detector HAL_PWREx_EnableUSBVoltageDetector(); - - if (lse_failure) { - reset_into_safe_mode(HARD_CRASH); //TODO: make safe mode category CLOCK_FAULT? - } } From 0cc438e6b99f29a097bc256f2320be7060ebfa17 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 24 Aug 2020 18:29:34 -0700 Subject: [PATCH 0700/1293] Fix pycubed pwm use --- ports/atmel-samd/boards/pycubed/board.c | 8 ++++---- ports/atmel-samd/boards/pycubed_mram/board.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ports/atmel-samd/boards/pycubed/board.c b/ports/atmel-samd/boards/pycubed/board.c index 9d29d2a66a..0bf586ad8e 100644 --- a/ports/atmel-samd/boards/pycubed/board.c +++ b/ports/atmel-samd/boards/pycubed/board.c @@ -32,7 +32,7 @@ #include "shared-bindings/nvm/ByteArray.h" #include "common-hal/microcontroller/Pin.h" #include "hal/include/hal_gpio.h" -#include "shared-bindings/pulseio/PWMOut.h" +#include "shared-bindings/pwmio/PWMOut.h" nvm_bytearray_obj_t bootcnt = { .base = { @@ -44,9 +44,9 @@ nvm_bytearray_obj_t bootcnt = { void board_init(void) { - pulseio_pwmout_obj_t pwm; - common_hal_pulseio_pwmout_construct(&pwm, &pin_PA23, 4096, 2, false); - common_hal_pulseio_pwmout_never_reset(&pwm); + pwmio_pwmout_obj_t pwm; + common_hal_pwmio_pwmout_construct(&pwm, &pin_PA23, 4096, 2, false); + common_hal_pwmio_pwmout_never_reset(&pwm); } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/pycubed_mram/board.c b/ports/atmel-samd/boards/pycubed_mram/board.c index 9d29d2a66a..0bf586ad8e 100644 --- a/ports/atmel-samd/boards/pycubed_mram/board.c +++ b/ports/atmel-samd/boards/pycubed_mram/board.c @@ -32,7 +32,7 @@ #include "shared-bindings/nvm/ByteArray.h" #include "common-hal/microcontroller/Pin.h" #include "hal/include/hal_gpio.h" -#include "shared-bindings/pulseio/PWMOut.h" +#include "shared-bindings/pwmio/PWMOut.h" nvm_bytearray_obj_t bootcnt = { .base = { @@ -44,9 +44,9 @@ nvm_bytearray_obj_t bootcnt = { void board_init(void) { - pulseio_pwmout_obj_t pwm; - common_hal_pulseio_pwmout_construct(&pwm, &pin_PA23, 4096, 2, false); - common_hal_pulseio_pwmout_never_reset(&pwm); + pwmio_pwmout_obj_t pwm; + common_hal_pwmio_pwmout_construct(&pwm, &pin_PA23, 4096, 2, false); + common_hal_pwmio_pwmout_never_reset(&pwm); } bool board_requests_safe_mode(void) { From 2b470b148620031adbd0afe6732a5b1965cbb19f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 24 Aug 2020 18:29:50 -0700 Subject: [PATCH 0701/1293] Fix RGB LED use --- supervisor/shared/rgb_led_status.c | 44 +++++++++++++++--------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/supervisor/shared/rgb_led_status.c b/supervisor/shared/rgb_led_status.c index 2f23e31258..283b9da123 100644 --- a/supervisor/shared/rgb_led_status.c +++ b/supervisor/shared/rgb_led_status.c @@ -66,22 +66,22 @@ busio_spi_obj_t status_apa102 = { #if defined(CP_RGB_STATUS_R) || defined(CP_RGB_STATUS_G) || defined(CP_RGB_STATUS_B) #define CP_RGB_STATUS_LED -#include "shared-bindings/pulseio/PWMOut.h" +#include "shared-bindings/pwmio/PWMOut.h" #include "shared-bindings/microcontroller/Pin.h" -pulseio_pwmout_obj_t rgb_status_r = { +pwmio_pwmout_obj_t rgb_status_r = { .base = { - .type = &pulseio_pwmout_type, + .type = &pwmio_pwmout_type, }, }; -pulseio_pwmout_obj_t rgb_status_g = { +pwmio_pwmout_obj_t rgb_status_g = { .base = { - .type = &pulseio_pwmout_type, + .type = &pwmio_pwmout_type, }, }; -pulseio_pwmout_obj_t rgb_status_b = { +pwmio_pwmout_obj_t rgb_status_b = { .base = { - .type = &pulseio_pwmout_type, + .type = &pwmio_pwmout_type, }, }; @@ -147,26 +147,26 @@ void rgb_led_status_init() { #if defined(CP_RGB_STATUS_LED) if (common_hal_mcu_pin_is_free(CP_RGB_STATUS_R)) { - pwmout_result_t red_result = common_hal_pulseio_pwmout_construct(&rgb_status_r, CP_RGB_STATUS_R, 0, 50000, false); + pwmout_result_t red_result = common_hal_pwmio_pwmout_construct(&rgb_status_r, CP_RGB_STATUS_R, 0, 50000, false); if (PWMOUT_OK == red_result) { - common_hal_pulseio_pwmout_never_reset(&rgb_status_r); + common_hal_pwmio_pwmout_never_reset(&rgb_status_r); } } if (common_hal_mcu_pin_is_free(CP_RGB_STATUS_G)) { - pwmout_result_t green_result = common_hal_pulseio_pwmout_construct(&rgb_status_g, CP_RGB_STATUS_G, 0, 50000, false); + pwmout_result_t green_result = common_hal_pwmio_pwmout_construct(&rgb_status_g, CP_RGB_STATUS_G, 0, 50000, false); if (PWMOUT_OK == green_result) { - common_hal_pulseio_pwmout_never_reset(&rgb_status_g); + common_hal_pwmio_pwmout_never_reset(&rgb_status_g); } } if (common_hal_mcu_pin_is_free(CP_RGB_STATUS_B)) { - pwmout_result_t blue_result = common_hal_pulseio_pwmout_construct(&rgb_status_b, CP_RGB_STATUS_B, 0, 50000, false); + pwmout_result_t blue_result = common_hal_pwmio_pwmout_construct(&rgb_status_b, CP_RGB_STATUS_B, 0, 50000, false); if (PWMOUT_OK == blue_result) { - common_hal_pulseio_pwmout_never_reset(&rgb_status_b); + common_hal_pwmio_pwmout_never_reset(&rgb_status_b); } } #endif @@ -242,9 +242,9 @@ void new_status_color(uint32_t rgb) { status_rgb_color[2] = (uint16_t) (blue_u8 << 8) + blue_u8; #endif - common_hal_pulseio_pwmout_set_duty_cycle(&rgb_status_r, status_rgb_color[0]); - common_hal_pulseio_pwmout_set_duty_cycle(&rgb_status_g, status_rgb_color[1]); - common_hal_pulseio_pwmout_set_duty_cycle(&rgb_status_b, status_rgb_color[2]); + common_hal_pwmio_pwmout_set_duty_cycle(&rgb_status_r, status_rgb_color[0]); + common_hal_pwmio_pwmout_set_duty_cycle(&rgb_status_g, status_rgb_color[1]); + common_hal_pwmio_pwmout_set_duty_cycle(&rgb_status_b, status_rgb_color[2]); #endif } @@ -288,9 +288,9 @@ void temp_status_color(uint32_t rgb) { temp_status_color_rgb[2] = (uint16_t) (blue_u8 << 8) + blue_u8; #endif - common_hal_pulseio_pwmout_set_duty_cycle(&rgb_status_r, temp_status_color_rgb[0]); - common_hal_pulseio_pwmout_set_duty_cycle(&rgb_status_g, temp_status_color_rgb[1]); - common_hal_pulseio_pwmout_set_duty_cycle(&rgb_status_b, temp_status_color_rgb[2]); + common_hal_pwmio_pwmout_set_duty_cycle(&rgb_status_r, temp_status_color_rgb[0]); + common_hal_pwmio_pwmout_set_duty_cycle(&rgb_status_g, temp_status_color_rgb[1]); + common_hal_pwmio_pwmout_set_duty_cycle(&rgb_status_b, temp_status_color_rgb[2]); #endif } @@ -327,9 +327,9 @@ void clear_temp_status() { blue = status_rgb_color[2]; #endif - common_hal_pulseio_pwmout_set_duty_cycle(&rgb_status_r, red); - common_hal_pulseio_pwmout_set_duty_cycle(&rgb_status_g, green); - common_hal_pulseio_pwmout_set_duty_cycle(&rgb_status_b, blue); + common_hal_pwmio_pwmout_set_duty_cycle(&rgb_status_r, red); + common_hal_pwmio_pwmout_set_duty_cycle(&rgb_status_g, green); + common_hal_pwmio_pwmout_set_duty_cycle(&rgb_status_b, blue); #endif } From de9fd4a0fb26c1a62b97d6175c75568b68e50abd Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 24 Aug 2020 17:59:13 -0400 Subject: [PATCH 0702/1293] Fix null dereference, invert auto_brightness to reenable screen --- ports/stm/boards/meowbit_v121/board.c | 2 +- ports/stm/boards/meowbit_v121/mpconfigboard.mk | 4 +++- ports/stm/common-hal/pulseio/PWMOut.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ports/stm/boards/meowbit_v121/board.c b/ports/stm/boards/meowbit_v121/board.c index 812a8c208c..b74f135165 100644 --- a/ports/stm/boards/meowbit_v121/board.c +++ b/ports/stm/boards/meowbit_v121/board.c @@ -106,7 +106,7 @@ void board_init(void) { &pin_PB03, NO_BRIGHTNESS_COMMAND, 1.0f, // brightness (ignored) - true, // auto_brightness + false, // auto_brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk index 852836ef8f..9eaa1bd8fb 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -18,4 +18,6 @@ OPTIMIZATION_FLAGS = -Os LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F401xe_boot.ld -# LD_FILE = boards/STM32F401xe_fs.ld # use for internal flash + +# For debugging - also comment BOOTLOADER_OFFSET and BOARD_VTOR_DEFER +# LD_FILE = boards/STM32F401xe_fs.ld diff --git a/ports/stm/common-hal/pulseio/PWMOut.c b/ports/stm/common-hal/pulseio/PWMOut.c index ddbadaf4ce..4bcb072122 100644 --- a/ports/stm/common-hal/pulseio/PWMOut.c +++ b/ports/stm/common-hal/pulseio/PWMOut.c @@ -239,13 +239,14 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { HAL_TIM_PWM_Stop(&self->handle, self->channel); } reset_pin_number(self->tim->pin->port,self->tim->pin->number); - self->tim = NULL; //if reserved timer has no active channels, we can disable it if (!reserved_tim[self->tim->tim_index - 1]) { tim_frequencies[self->tim->tim_index - 1] = 0x00; stm_peripherals_timer_free(self->handle.Instance); } + + self->tim = NULL; } void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty) { From 645adaadb0ec97b7e0250b8987ff5be9cd59c4c5 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Tue, 25 Aug 2020 20:32:44 +0530 Subject: [PATCH 0703/1293] Added microS2 specific config files --- ports/esp32s2/boards/micro_s2/mpconfigboard.h | 35 +++++++++++++ .../esp32s2/boards/micro_s2/mpconfigboard.mk | 15 ++++++ ports/esp32s2/boards/micro_s2/pins.c | 49 +++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 ports/esp32s2/boards/micro_s2/mpconfigboard.h create mode 100644 ports/esp32s2/boards/micro_s2/mpconfigboard.mk create mode 100644 ports/esp32s2/boards/micro_s2/pins.c diff --git a/ports/esp32s2/boards/micro_s2/mpconfigboard.h b/ports/esp32s2/boards/micro_s2/mpconfigboard.h new file mode 100644 index 0000000000..05d860394b --- /dev/null +++ b/ports/esp32s2/boards/micro_s2/mpconfigboard.h @@ -0,0 +1,35 @@ +/* + * 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 "microS2" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_LED (&pin_GPIO21) +#define MICROPY_HW_NEOPIXEL (&pin_GPIO33) + +#define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/micro_s2/mpconfigboard.mk b/ports/esp32s2/boards/micro_s2/mpconfigboard.mk new file mode 100644 index 0000000000..783e7ad4c7 --- /dev/null +++ b/ports/esp32s2/boards/micro_s2/mpconfigboard.mk @@ -0,0 +1,15 @@ +USB_VID = 0x239A +USB_PID = 0x80C6 +USB_PRODUCT = "microS2" +USB_MANUFACTURER = "microDev" + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=qio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=16MB diff --git a/ports/esp32s2/boards/micro_s2/pins.c b/ports/esp32s2/boards/micro_s2/pins.c new file mode 100644 index 0000000000..570b6a4ccb --- /dev/null +++ b/ports/esp32s2/boards/micro_s2/pins.c @@ -0,0 +1,49 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { 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_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_IO17), MP_ROM_PTR(&pin_GPIO17) }, + { 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_IO20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_IO26), MP_ROM_PTR(&pin_GPIO26) }, + { 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_IO37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO33) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); \ No newline at end of file From 89c6a44e4e1340d87931f20b58503d09a0f2aa74 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Tue, 25 Aug 2020 20:35:08 +0530 Subject: [PATCH 0704/1293] Added microS2 specific config files --- ports/esp32s2/boards/micro_s2/sdkconfig | 1 + 1 file changed, 1 insertion(+) create mode 100644 ports/esp32s2/boards/micro_s2/sdkconfig diff --git a/ports/esp32s2/boards/micro_s2/sdkconfig b/ports/esp32s2/boards/micro_s2/sdkconfig new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/ports/esp32s2/boards/micro_s2/sdkconfig @@ -0,0 +1 @@ + From e9bc8e892b5ccc88782d8aaf08868b0094eae414 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 25 Aug 2020 11:45:00 -0500 Subject: [PATCH 0705/1293] pyexec: Handle a ctrl-c that comes in "very late" In relatively unusual circumstances, such as entering `l = 17 ** 17777` at the REPL, you could hit ctrl-c, but not get KeyboardInterrupt. This can lead to a condition where the display would stop updating (#2689). --- lib/utils/pyexec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/utils/pyexec.c b/lib/utils/pyexec.c index 8e99bc2099..378fb6267d 100755 --- a/lib/utils/pyexec.c +++ b/lib/utils/pyexec.c @@ -113,6 +113,8 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input start = mp_hal_ticks_ms(); mp_call_function_0(module_fun); mp_hal_set_interrupt_char(-1); // disable interrupt + // Handle any ctrl-c interrupt that arrived just in time + mp_handle_pending(); nlr_pop(); ret = 0; if (exec_flags & EXEC_FLAG_PRINT_EOF) { From c0753c1afb09dab873da02e6f98a492cb913f0e9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 25 Aug 2020 11:46:49 -0500 Subject: [PATCH 0706/1293] mp_obj_print_helper: Handle a ctrl-c that comes in during printing In #2689, hitting ctrl-c during the printing of an object with a lot of sub-objects could cause the screen to stop updating (without showing a KeyboardInterrupt). This makes the printing of such objects acutally interruptable, and also correctly handles the KeyboardInterrupt: ``` >>> l = ["a" * 100] * 200 >>> l ['aaaaaaaaaaaaaaaaaaaaaa...aaaaaaaaaaa', Traceback (most recent call last): File "", line 1, in KeyboardInterrupt: >>> ``` --- py/obj.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py/obj.c b/py/obj.c index 0cff2f1a4b..9dc0cf4749 100644 --- a/py/obj.c +++ b/py/obj.c @@ -67,6 +67,8 @@ void mp_obj_print_helper(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t #ifdef RUN_BACKGROUND_TASKS RUN_BACKGROUND_TASKS; #endif + mp_handle_pending(); + #ifndef NDEBUG if (o_in == MP_OBJ_NULL) { mp_print_str(print, "(nil)"); From 05bde255f7a00dd9b41d2e4200eda652aeec28f2 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 25 Aug 2020 14:00:29 -0400 Subject: [PATCH 0707/1293] Add random to ESP32-S2, fix it on STM32 --- ports/esp32s2/common-hal/os/__init__.c | 14 +++++++++++++- ports/esp32s2/mpconfigport.mk | 1 - ports/stm/common-hal/os/__init__.c | 3 +-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ports/esp32s2/common-hal/os/__init__.c b/ports/esp32s2/common-hal/os/__init__.c index 17bda75ad3..4d6a6a2bfc 100644 --- a/ports/esp32s2/common-hal/os/__init__.c +++ b/ports/esp32s2/common-hal/os/__init__.c @@ -30,6 +30,8 @@ #include "py/objtuple.h" #include "py/qstr.h" +#include "esp_system.h" + STATIC const qstr os_uname_info_fields[] = { MP_QSTR_sysname, MP_QSTR_nodename, MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine @@ -57,5 +59,15 @@ mp_obj_t common_hal_os_uname(void) { } bool common_hal_os_urandom(uint8_t* buffer, uint32_t length) { - return false; + uint32_t i = 0; + while (i < length) { + uint32_t new_random = esp_random(); + for (int j = 0; j < 4 && i < length; j++) { + buffer[i] = new_random & 0xff; + i++; + new_random >>= 8; + } + } + + return true; } diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index a7873aa468..13c0d66fb1 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -25,7 +25,6 @@ CIRCUITPY_COUNTIO = 0 # These modules are implemented in shared-module/ - they can be included in # any port once their prerequisites in common-hal are complete. -CIRCUITPY_RANDOM = 0 # Requires OS CIRCUITPY_USB_MIDI = 0 # Requires USB CIRCUITPY_ULAB = 0 # No requirements, but takes extra flash diff --git a/ports/stm/common-hal/os/__init__.c b/ports/stm/common-hal/os/__init__.c index 84deb81759..13871a46ea 100644 --- a/ports/stm/common-hal/os/__init__.c +++ b/ports/stm/common-hal/os/__init__.c @@ -77,11 +77,10 @@ bool common_hal_os_urandom(uint8_t *buffer, uint32_t length) { uint32_t start = HAL_GetTick(); //the HAL function has a timeout, but it isn't long enough, and isn't adjustable while(!(__HAL_RNG_GET_FLAG(&handle,RNG_FLAG_DRDY)) && ((HAL_GetTick() - start) < RNG_TIMEOUT)); - // if (HAL_RNG_GenerateRandomNumber(&handle, &temp) != HAL_OK) { mp_raise_ValueError(translate("Random number generation error")); } - *buffer = (uint8_t)temp; + buffer[i] = (uint8_t)temp; } //shut down the peripheral From f71f6631ccae6b595c419d9e161b1d566f3cc6ed Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 25 Aug 2020 14:24:35 -0400 Subject: [PATCH 0708/1293] Enable ulab --- ports/esp32s2/mpconfigport.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index a7873aa468..152e5c8030 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -27,6 +27,6 @@ CIRCUITPY_COUNTIO = 0 # any port once their prerequisites in common-hal are complete. CIRCUITPY_RANDOM = 0 # Requires OS CIRCUITPY_USB_MIDI = 0 # Requires USB -CIRCUITPY_ULAB = 0 # No requirements, but takes extra flash +CIRCUITPY_ULAB = 1 # No requirements, but takes extra flash CIRCUITPY_MODULE ?= none From 69fc872944e55ac36f3ede0d643087b21d6f7047 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 25 Aug 2020 16:14:31 -0700 Subject: [PATCH 0709/1293] Fix espidf.MemoryError print --- ports/esp32s2/bindings/espidf/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/bindings/espidf/__init__.c b/ports/esp32s2/bindings/espidf/__init__.c index 7c3a8c713d..3b910cfe6f 100644 --- a/ports/esp32s2/bindings/espidf/__init__.c +++ b/ports/esp32s2/bindings/espidf/__init__.c @@ -77,7 +77,7 @@ void espidf_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kin mp_print_kind_t k = kind & ~PRINT_EXC_SUBCLASS; bool is_subclass = kind & PRINT_EXC_SUBCLASS; if (!is_subclass && (k == PRINT_EXC)) { - mp_print_str(print, qstr_str(MP_OBJ_QSTR_VALUE(MP_QSTR_espidf))); + mp_print_str(print, qstr_str(MP_OBJ_QSTR_VALUE(MP_ROM_QSTR(MP_QSTR_espidf)))); mp_print_str(print, "."); } mp_obj_exception_print(print, o_in, kind); From f3bc712539ec13e73fe2b809ee274df57dca5f46 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 25 Aug 2020 16:15:00 -0700 Subject: [PATCH 0710/1293] Fix SocketPool radio check --- shared-bindings/socketpool/SocketPool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index 579a4824c8..5624a6632d 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -53,7 +53,7 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t socketpool_socketpool_obj_t *s = m_new_obj_with_finaliser(socketpool_socketpool_obj_t); s->base.type = &socketpool_socketpool_type; - mp_obj_t radio = args[1]; + mp_obj_t radio = args[0]; common_hal_socketpool_socketpool_construct(s, radio); From 380cbfba55e45f9f0d8ccae6c28c23b1ea93147f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 25 Aug 2020 16:15:45 -0700 Subject: [PATCH 0711/1293] Add hash to Socket so it can be used in dicts --- ports/esp32s2/common-hal/socketpool/Socket.c | 21 ++++++++----------- .../common-hal/socketpool/SocketPool.c | 1 - ports/esp32s2/common-hal/wifi/Radio.c | 5 ----- shared-bindings/socketpool/Socket.c | 18 ++++++++++++++-- shared-bindings/socketpool/Socket.h | 1 + 5 files changed, 26 insertions(+), 20 deletions(-) diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/esp32s2/common-hal/socketpool/Socket.c index 003ba24434..654ea42d55 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.c +++ b/ports/esp32s2/common-hal/socketpool/Socket.c @@ -32,9 +32,6 @@ #include "py/runtime.h" #include "supervisor/shared/tick.h" -#include "esp_log.h" -static const char* TAG = "socket"; - void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t* self, mp_uint_t timeout_ms) { self->timeout_ms = timeout_ms; } @@ -49,7 +46,6 @@ bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self, const c tls_config = &self->ssl_context->ssl_config; } int result = esp_tls_conn_new_sync(host, hostlen, port, tls_config, self->tcp); - ESP_EARLY_LOGW(TAG, "connect result %d", result); self->connected = result >= 0; if (result < 0) { int esp_tls_code; @@ -58,8 +54,11 @@ bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self, const c if (err == ESP_ERR_MBEDTLS_SSL_SETUP_FAILED) { mp_raise_espidf_MemoryError(); + } else if (ESP_ERR_MBEDTLS_SSL_HANDSHAKE_FAILED) { + // What should this error be? + mp_raise_OSError_msg_varg(translate("Failed SSL handshake")); } else { - mp_raise_OSError_msg_varg(translate("Unhandled ESP TLS error %d %d %x"), esp_tls_code, flags, err); + mp_raise_OSError_msg_varg(translate("Unhandled ESP TLS error %d %d %x %d"), esp_tls_code, flags, err, result); } } @@ -99,37 +98,31 @@ mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, // and between encrypted TLS blocks. int status = lwip_ioctl(sockfd, FIONREAD, &available); if (status < 0) { - // ESP_EARLY_LOGW(TAG, "ioctl fail. socket %d status %d errno %d available %d", sockfd, status, errno, available); last_read = status; break; } } - // ESP_EARLY_LOGW(TAG, "available %d", available); size_t remaining = len - received; if (available > remaining) { available = remaining; } if (available > 0) { last_read = esp_tls_conn_read(self->tcp, (void*) buf + received, available); - // ESP_EARLY_LOGW(TAG, "read %d out of %d", last_read, available); received += last_read; } } if (last_read == 0) { // socket closed - ESP_EARLY_LOGW(TAG, "receive close %d %d", received, len); common_hal_socketpool_socket_close(self); } if (last_read < 0) { - // ESP_EARLY_LOGI(TAG, "received %d", received); mp_raise_BrokenPipeError(); } return received; } void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self) { - // ESP_EARLY_LOGW(TAG, "close"); if (self->connected) { self->connected = false; } @@ -144,6 +137,10 @@ void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self) { } bool common_hal_socketpool_socket_get_closed(socketpool_socket_obj_t* self) { - // ESP_EARLY_LOGW(TAG, "tcp %p", self->tcp); return self->tcp == NULL; } + + +mp_uint_t common_hal_socketpool_socket_get_hash(socketpool_socket_obj_t* self) { + return self->num; +} diff --git a/ports/esp32s2/common-hal/socketpool/SocketPool.c b/ports/esp32s2/common-hal/socketpool/SocketPool.c index 2af5bf7221..dbc9c91924 100644 --- a/ports/esp32s2/common-hal/socketpool/SocketPool.c +++ b/ports/esp32s2/common-hal/socketpool/SocketPool.c @@ -33,7 +33,6 @@ #include "bindings/espidf/__init__.h" - void common_hal_socketpool_socketpool_construct(socketpool_socketpool_obj_t* self, mp_obj_t radio) { if (radio != MP_OBJ_FROM_PTR(&common_hal_wifi_radio_obj)) { mp_raise_ValueError(translate("SocketPool can only be used with wifi.radio.")); diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index 038ce9e754..ae3fa2f175 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -38,9 +38,6 @@ #include "esp-idf/components/esp_wifi/include/esp_wifi.h" #include "esp-idf/components/lwip/include/apps/ping/ping_sock.h" -#include "esp_log.h" -static const char* TAG = "radio"; - static void start_station(wifi_radio_obj_t *self) { if (self->sta_mode) { return; @@ -170,8 +167,6 @@ mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address, uint32_t elapsed_time = 0xffffffff; if (received > 0) { esp_ping_get_profile(ping, ESP_PING_PROF_TIMEGAP, &elapsed_time, sizeof(elapsed_time)); - } else { - ESP_EARLY_LOGW(TAG, "received none - time %d timeout %d", total_time_ms, timeout_ms); } esp_ping_delete_session(ping); diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index 932e8e856c..250e9c874e 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -267,8 +267,7 @@ STATIC mp_obj_t socketpool_socket_recv_into(size_t n_args, const mp_obj_t *args) } if (len == 0) { - ESP_EARLY_LOGW(TAG, "len 0"); - mp_raise_OSError(0); + return MP_OBJ_NEW_SMALL_INT(0); } mp_int_t ret = common_hal_socketpool_socket_recv_into(self, (byte*)bufinfo.buf, len); @@ -426,6 +425,20 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_settimeout_obj, socketpool_so // } // STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_setblocking_obj, socketpool_socket_setblocking); +//| def __hash__(self) -> int: +//| """Returns a hash for the Socket.""" +//| ... +//| +STATIC mp_obj_t socketpool_socket_unary_op(mp_unary_op_t op, mp_obj_t self_in) { + switch (op) { + case MP_UNARY_OP_HASH: { + return MP_OBJ_NEW_SMALL_INT(common_hal_socketpool_socket_get_hash(MP_OBJ_TO_PTR(self_in))); + } + default: + return MP_OBJ_NULL; // op not supported + } +} + STATIC const mp_rom_map_elem_t socketpool_socket_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&socketpool_socket___exit___obj) }, @@ -451,4 +464,5 @@ const mp_obj_type_t socketpool_socket_type = { { &mp_type_type }, .name = MP_QSTR_Socket, .locals_dict = (mp_obj_dict_t*)&socketpool_socket_locals_dict, + .unary_op = socketpool_socket_unary_op, }; diff --git a/shared-bindings/socketpool/Socket.h b/shared-bindings/socketpool/Socket.h index 4597aed38d..f0be95c925 100644 --- a/shared-bindings/socketpool/Socket.h +++ b/shared-bindings/socketpool/Socket.h @@ -38,5 +38,6 @@ mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self); bool common_hal_socketpool_socket_get_closed(socketpool_socket_obj_t* self); bool common_hal_socketpool_socket_get_connected(socketpool_socket_obj_t* self); +mp_uint_t common_hal_socketpool_socket_get_hash(socketpool_socket_obj_t* self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKET_H From 6fbeb28bd6804fe884ee4cfcaf56199a0859d439 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 25 Aug 2020 16:40:45 -0700 Subject: [PATCH 0712/1293] Update translations --- locale/circuitpython.pot | 74 +++++++++++++++++++++++++++------------- 1 file changed, 51 insertions(+), 23 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index fe726acf27..b7b442414b 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-21 21:39-0500\n" +"POT-Creation-Date: 2020-08-25 16:39-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -273,7 +273,7 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" -#: shared-bindings/_bleio/Address.c +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" msgstr "" @@ -302,7 +302,7 @@ msgstr "" msgid "All sync event channels in use" msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" msgstr "" @@ -314,7 +314,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" msgstr "" @@ -371,6 +371,10 @@ msgstr "" msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + #: main.c msgid "Auto-reload is off.\n" msgstr "" @@ -552,7 +556,7 @@ msgstr "" msgid "Cannot unambiguously get sizeof scalar" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" @@ -621,23 +625,23 @@ msgstr "" msgid "Could not initialize UART" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" msgstr "" @@ -645,7 +649,7 @@ msgstr "" msgid "Could not set address" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" msgstr "" @@ -836,7 +840,7 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -938,9 +942,9 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PWMOut.c -#: ports/cxd56/common-hal/pulseio/PWMOut.c -#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "Invalid PWM frequency" msgstr "" @@ -980,7 +984,7 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "" @@ -998,8 +1002,8 @@ msgid "Invalid phase" msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "" @@ -1023,7 +1027,7 @@ msgstr "" msgid "Invalid pins" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" msgstr "" @@ -1205,10 +1209,14 @@ msgstr "" msgid "No long integer support" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1229,6 +1237,10 @@ msgstr "" msgid "Nordic Soft Device failure assertion." msgstr "" +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1269,16 +1281,20 @@ msgid "" "%d bpp given" msgstr "" +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip." +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" @@ -1465,6 +1481,10 @@ msgstr "" msgid "Serializer in use" msgstr "" +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname." +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" @@ -1560,7 +1580,7 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" @@ -1660,6 +1680,10 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Unknown failure" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" @@ -1763,6 +1787,10 @@ msgid "" "To list built-in modules please do `help(\"modules\")`.\n" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters." +msgstr "" + #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" msgstr "" From 964a39164e9630144944c59c5be1f1fb47c760a0 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 26 Aug 2020 08:23:54 +0530 Subject: [PATCH 0713/1293] Changed microS2 board name --- .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 28bc7664c7..4782012102 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -410,7 +410,7 @@ jobs: board: - "espressif_saola_1_wroom" - "espressif_saola_1_wrover" - - "micro_s2" + - "microdev_micro_s2" - "unexpectedmaker_feathers2" steps: From bf2b594066191f7dee335550c0f14e70cfef639b Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 26 Aug 2020 08:33:21 +0530 Subject: [PATCH 0714/1293] Change microS2 board name --- ports/esp32s2/boards/{micro_s2 => microdev_micro_s2}/board.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ports/esp32s2/boards/{micro_s2 => microdev_micro_s2}/board.c (100%) diff --git a/ports/esp32s2/boards/micro_s2/board.c b/ports/esp32s2/boards/microdev_micro_s2/board.c similarity index 100% rename from ports/esp32s2/boards/micro_s2/board.c rename to ports/esp32s2/boards/microdev_micro_s2/board.c From 1dce6bd7ca24b4135980953ede3a653ebcdeaeb5 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 26 Aug 2020 08:35:09 +0530 Subject: [PATCH 0715/1293] Change microS2 board name --- .../boards/{micro_s2 => microdev_micro_s2}/mpconfigboard.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ports/esp32s2/boards/{micro_s2 => microdev_micro_s2}/mpconfigboard.h (100%) diff --git a/ports/esp32s2/boards/micro_s2/mpconfigboard.h b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/micro_s2/mpconfigboard.h rename to ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h From 3f699024d943982acd55073c5db19ee9733843e2 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 26 Aug 2020 08:36:38 +0530 Subject: [PATCH 0716/1293] Change microS2 board name --- ports/esp32s2/boards/{micro_s2 => microdev_micro_s2}/sdkconfig | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ports/esp32s2/boards/{micro_s2 => microdev_micro_s2}/sdkconfig (100%) diff --git a/ports/esp32s2/boards/micro_s2/sdkconfig b/ports/esp32s2/boards/microdev_micro_s2/sdkconfig similarity index 100% rename from ports/esp32s2/boards/micro_s2/sdkconfig rename to ports/esp32s2/boards/microdev_micro_s2/sdkconfig From f1f316c50236f11c91b64ec06d361380a8a485f5 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 26 Aug 2020 08:37:36 +0530 Subject: [PATCH 0717/1293] Change microS2 board name --- ports/esp32s2/boards/{micro_s2 => microdev_micro_s2}/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename ports/esp32s2/boards/{micro_s2 => microdev_micro_s2}/pins.c (99%) diff --git a/ports/esp32s2/boards/micro_s2/pins.c b/ports/esp32s2/boards/microdev_micro_s2/pins.c similarity index 99% rename from ports/esp32s2/boards/micro_s2/pins.c rename to ports/esp32s2/boards/microdev_micro_s2/pins.c index 570b6a4ccb..c5d14fd9e3 100644 --- a/ports/esp32s2/boards/micro_s2/pins.c +++ b/ports/esp32s2/boards/microdev_micro_s2/pins.c @@ -46,4 +46,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO33) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From b019ef2e4330dcf1e341a912be3fe5bcbbeeecb8 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 26 Aug 2020 08:38:42 +0530 Subject: [PATCH 0718/1293] Change microS2 board name --- .../boards/{micro_s2 => microdev_micro_s2}/mpconfigboard.mk | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ports/esp32s2/boards/{micro_s2 => microdev_micro_s2}/mpconfigboard.mk (100%) diff --git a/ports/esp32s2/boards/micro_s2/mpconfigboard.mk b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/micro_s2/mpconfigboard.mk rename to ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.mk From 0425305a737b2f79f2f1d383a1b91cf8426980a3 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 26 Aug 2020 08:40:46 +0530 Subject: [PATCH 0719/1293] Change microS2 board name --- ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h index 05d860394b..bb28fe16ad 100644 --- a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +++ b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h @@ -26,7 +26,7 @@ //Micropython setup -#define MICROPY_HW_BOARD_NAME "microS2" +#define MICROPY_HW_BOARD_NAME "microDev microS2" #define MICROPY_HW_MCU_NAME "ESP32S2" #define MICROPY_HW_LED (&pin_GPIO21) From 0c9513a2e73870670e79a8fbcc58fdbd7a74a892 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 26 Aug 2020 09:00:16 -0400 Subject: [PATCH 0720/1293] Remove trailing whitespace --- .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 4782012102..e54bbb84b1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -410,7 +410,7 @@ jobs: board: - "espressif_saola_1_wroom" - "espressif_saola_1_wrover" - - "microdev_micro_s2" + - "microdev_micro_s2" - "unexpectedmaker_feathers2" steps: From f7d224705f55e32a59a23cee7dc9cb6ad5fcd403 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 26 Aug 2020 09:01:27 -0400 Subject: [PATCH 0721/1293] Trim trailing whitespace in pins.c --- ports/esp32s2/boards/microdev_micro_s2/pins.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/boards/microdev_micro_s2/pins.c b/ports/esp32s2/boards/microdev_micro_s2/pins.c index c5d14fd9e3..25300b5c3c 100644 --- a/ports/esp32s2/boards/microdev_micro_s2/pins.c +++ b/ports/esp32s2/boards/microdev_micro_s2/pins.c @@ -33,8 +33,8 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) }, { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) }, { MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) }, - { MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) }, - { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) }, From 01ddb177fc7f5d7bd5008e3a657ae398af404bf4 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 26 Aug 2020 09:07:54 -0400 Subject: [PATCH 0724/1293] Remove whitespace in sdkconfig --- ports/esp32s2/boards/microdev_micro_s2/sdkconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/esp32s2/boards/microdev_micro_s2/sdkconfig b/ports/esp32s2/boards/microdev_micro_s2/sdkconfig index 8b13789179..e69de29bb2 100644 --- a/ports/esp32s2/boards/microdev_micro_s2/sdkconfig +++ b/ports/esp32s2/boards/microdev_micro_s2/sdkconfig @@ -1 +0,0 @@ - From f26d15c5c9988f95317211d66e583f6982f8228a Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 26 Aug 2020 18:39:30 +0530 Subject: [PATCH 0725/1293] Added PSRAM support --- .../boards/microdev_micro_s2/sdkconfig | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/ports/esp32s2/boards/microdev_micro_s2/sdkconfig b/ports/esp32s2/boards/microdev_micro_s2/sdkconfig index e69de29bb2..8ee2c08fd1 100644 --- a/ports/esp32s2/boards/microdev_micro_s2/sdkconfig +++ b/ports/esp32s2/boards/microdev_micro_s2/sdkconfig @@ -0,0 +1,35 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM64=y +CONFIG_SPIRAM_SIZE=8388608 + +# +# PSRAM clock and cs IO for ESP32S2 +# +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM clock and cs IO for ESP32S2 + +CONFIG_SPIRAM_SPIWP_SD3_PIN=28 +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_USE_AHB_DBUS3 is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config From 44342732a4e774a63d03c9902d1dfd6a07f77ed2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 26 Aug 2020 10:56:00 -0500 Subject: [PATCH 0726/1293] Fix DOS line endings, they give my git fits --- .../boards/microdev_micro_s2/sdkconfig | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/ports/esp32s2/boards/microdev_micro_s2/sdkconfig b/ports/esp32s2/boards/microdev_micro_s2/sdkconfig index 8ee2c08fd1..b73c4a8c20 100644 --- a/ports/esp32s2/boards/microdev_micro_s2/sdkconfig +++ b/ports/esp32s2/boards/microdev_micro_s2/sdkconfig @@ -1,35 +1,35 @@ -CONFIG_ESP32S2_SPIRAM_SUPPORT=y - -# -# SPI RAM config -# -# CONFIG_SPIRAM_TYPE_AUTO is not set -# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set -# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set -CONFIG_SPIRAM_TYPE_ESPPSRAM64=y -CONFIG_SPIRAM_SIZE=8388608 - -# -# PSRAM clock and cs IO for ESP32S2 -# -CONFIG_DEFAULT_PSRAM_CLK_IO=30 -CONFIG_DEFAULT_PSRAM_CS_IO=26 -# end of PSRAM clock and cs IO for ESP32S2 - -CONFIG_SPIRAM_SPIWP_SD3_PIN=28 -# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set -# CONFIG_SPIRAM_RODATA is not set -# CONFIG_SPIRAM_USE_AHB_DBUS3 is not set -# CONFIG_SPIRAM_SPEED_80M is not set -CONFIG_SPIRAM_SPEED_40M=y -# CONFIG_SPIRAM_SPEED_26M is not set -# CONFIG_SPIRAM_SPEED_20M is not set -CONFIG_SPIRAM=y -CONFIG_SPIRAM_BOOT_INIT=y -# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set -CONFIG_SPIRAM_USE_MEMMAP=y -# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set -# CONFIG_SPIRAM_USE_MALLOC is not set -CONFIG_SPIRAM_MEMTEST=y -# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set -# end of SPI RAM config +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM64=y +CONFIG_SPIRAM_SIZE=8388608 + +# +# PSRAM clock and cs IO for ESP32S2 +# +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM clock and cs IO for ESP32S2 + +CONFIG_SPIRAM_SPIWP_SD3_PIN=28 +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_USE_AHB_DBUS3 is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config From 5422dd682ca107ae27c57c7d3fa240baa354bc87 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 26 Aug 2020 11:13:18 -0500 Subject: [PATCH 0727/1293] shared_bindings_matrix: Run in parallel .. this makes it take a fraction of the time, at least on systems with a lot of CPU threads. Even on my old laptop with a 2-core CPU it reduces the time from 55s to 27s. --- docs/shared_bindings_matrix.py | 51 +++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index 7b96c14f29..3523b8ec60 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -28,6 +28,7 @@ import re import subprocess import sys +from concurrent.futures import ThreadPoolExecutor SUPPORTED_PORTS = ['atmel-samd', 'esp32s2', 'litex', 'mimxrt10xx', 'nrf', 'stm'] @@ -131,38 +132,44 @@ def lookup_setting(settings, key, default=''): key = value[2:-1] return value +def all_ports_all_boards(ports=SUPPORTED_PORTS): + for port in ports: + + port_dir = get_circuitpython_root_dir() / "ports" / port + for entry in (port_dir / "boards").iterdir(): + if not entry.is_dir(): + continue + yield (port, entry) + def support_matrix_by_board(use_branded_name=True): """ Compiles a list of the available core modules available for each board. """ base = build_module_map() - boards = dict() - for port in SUPPORTED_PORTS: - + def support_matrix(arg): + port, entry = arg port_dir = get_circuitpython_root_dir() / "ports" / port - for entry in (port_dir / "boards").iterdir(): - if not entry.is_dir(): - continue - board_modules = [] - board_name = entry.name + settings = get_settings_from_makefile(str(port_dir), entry.name) - settings = get_settings_from_makefile(str(port_dir), entry.name) + if use_branded_name: + with open(entry / "mpconfigboard.h") as get_name: + board_contents = get_name.read() + board_name_re = re.search(r"(?<=MICROPY_HW_BOARD_NAME)\s+(.+)", + board_contents) + if board_name_re: + board_name = board_name_re.group(1).strip('"') - if use_branded_name: - with open(entry / "mpconfigboard.h") as get_name: - board_contents = get_name.read() - board_name_re = re.search(r"(?<=MICROPY_HW_BOARD_NAME)\s+(.+)", - board_contents) - if board_name_re: - board_name = board_name_re.group(1).strip('"') + board_modules = [] + for module in base: + key = f'CIRCUITPY_{module.upper()}' + if int(lookup_setting(settings, key, '0')): + board_modules.append(base[module]['name']) - board_modules = [] - for module in base: - key = f'CIRCUITPY_{module.upper()}' - if int(lookup_setting(settings, key, '0')): - board_modules.append(base[module]['name']) - boards[board_name] = sorted(board_modules) + return (board_name, sorted(board_modules)) + + executor = ThreadPoolExecutor(max_workers=os.cpu_count()) + boards = dict(sorted(executor.map(support_matrix, all_ports_all_boards()))) #print(json.dumps(boards, indent=2)) return boards From e121e267adacf69809b78fdafc0209ad9a824266 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 26 Aug 2020 11:28:39 -0500 Subject: [PATCH 0728/1293] shared_bindings_matrix: Use stubs, not shared-bindings This fixes a problem where things that were in extmod/ could not be listed. --- docs/shared_bindings_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index 3523b8ec60..e81ae188c2 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -43,7 +43,7 @@ def get_circuitpython_root_dir(): def get_shared_bindings(): """ Get a list of modules in shared-bindings based on folder names """ - shared_bindings_dir = get_circuitpython_root_dir() / "shared-bindings" + shared_bindings_dir = get_circuitpython_root_dir() / "circuitpython-stubs" return [item.name for item in shared_bindings_dir.iterdir()] From c77523503bfebbcb3ea74465928145b7ccf5b625 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 26 Aug 2020 14:48:46 -0400 Subject: [PATCH 0729/1293] Fix trailing whitespace errors across ports and docs --- docs/porting.rst | 43 +++++++++++++------ ports/esp32s2/mpconfigport.mk | 7 +-- .../stm/boards/espruino_pico/mpconfigboard.mk | 3 +- .../mpconfigboard.mk | 3 +- .../stm/boards/meowbit_v121/mpconfigboard.mk | 3 +- 5 files changed, 40 insertions(+), 19 deletions(-) diff --git a/docs/porting.rst b/docs/porting.rst index db4ae76262..6cd59fefb1 100644 --- a/docs/porting.rst +++ b/docs/porting.rst @@ -51,10 +51,15 @@ as a natural "TODO" list. An example minimal build list is shown below: .. code-block:: makefile # These modules are implemented in ports//common-hal: - CIRCUITPY_MICROCONTROLLER = 0 # Typically the first module to create - CIRCUITPY_DIGITALIO = 0 # Typically the second module to create + + # Typically the first module to create + CIRCUITPY_MICROCONTROLLER = 0 + # Typically the second module to create + CIRCUITPY_DIGITALIO = 0 + # Other modules: CIRCUITPY_ANALOGIO = 0 CIRCUITPY_BUSIO = 0 + CIRCUITPY_COUNTIO = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_PULSEIO = 0 CIRCUITPY_OS = 0 @@ -63,22 +68,34 @@ as a natural "TODO" list. An example minimal build list is shown below: CIRCUITPY_AUDIOIO = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 + CIRCUITPY_SDCARDIO = 0 + CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 - CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO (stub ok) + # Requires SPI, PulseIO (stub ok): + CIRCUITPY_DISPLAYIO = 0 # These modules are implemented in shared-module/ - they can be included in # any port once their prerequisites in common-hal are complete. - CIRCUITPY_BITBANGIO = 0 # Requires DigitalIO - CIRCUITPY_GAMEPAD = 0 # Requires DigitalIO - CIRCUITPY_PIXELBUF = 0 # Requires neopixel_write or SPI (dotstar) - CIRCUITPY_RANDOM = 0 # Requires OS - CIRCUITPY_STORAGE = 0 # Requires OS, filesystem - CIRCUITPY_TOUCHIO = 0 # Requires Microcontroller - CIRCUITPY_USB_HID = 0 # Requires USB - CIRCUITPY_USB_MIDI = 0 # Requires USB - CIRCUITPY_REQUIRE_I2C_PULLUPS = 0 # Does nothing without I2C - CIRCUITPY_ULAB = 0 # No requirements, but takes extra flash + # Requires DigitalIO: + CIRCUITPY_BITBANGIO = 0 + # Requires DigitalIO + CIRCUITPY_GAMEPAD = 0 + # Requires neopixel_write or SPI (dotstar) + CIRCUITPY_PIXELBUF = 0 + # Requires OS + CIRCUITPY_RANDOM = 0 + # Requires OS, filesystem + CIRCUITPY_STORAGE = 0 + # Requires Microcontroller + CIRCUITPY_TOUCHIO = 0 + # 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 = 0 Step 2: Init -------------- diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 152e5c8030..3ddcf5d613 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -25,8 +25,9 @@ CIRCUITPY_COUNTIO = 0 # These modules are implemented in shared-module/ - they can be included in # any port once their prerequisites in common-hal are complete. -CIRCUITPY_RANDOM = 0 # Requires OS -CIRCUITPY_USB_MIDI = 0 # Requires USB -CIRCUITPY_ULAB = 1 # No requirements, but takes extra flash +# Requires OS +CIRCUITPY_RANDOM = 0 +# Requires USB +CIRCUITPY_USB_MIDI = 0 CIRCUITPY_MODULE ?= none diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.mk b/ports/stm/boards/espruino_pico/mpconfigboard.mk index 201237c9d6..b1b023dd58 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.mk +++ b/ports/stm/boards/espruino_pico/mpconfigboard.mk @@ -10,7 +10,8 @@ MCU_VARIANT = STM32F401xE MCU_PACKAGE = UFQFPN48 LD_COMMON = boards/common_default.ld -LD_FILE = boards/STM32F401xd_fs.ld # use for internal flash +# use for internal flash +LD_FILE = boards/STM32F401xd_fs.ld # Disable ulab as we're nearly out of space on this board due to # INTERNAL_FLASH_FILESYSTEM. It can probably be reenabled if we enable diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk index 2b2c0d6db5..4d0bd4598d 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk @@ -13,5 +13,6 @@ MCU_PACKAGE = LQFP64 LD_COMMON = boards/common_default.ld LD_DEFAULT = boards/STM32F405_default.ld -LD_BOOT = boards/STM32F405_boot.ld # UF2 boot option +# UF2 boot option +LD_BOOT = boards/STM32F405_boot.ld UF2_OFFSET = 0x8010000 diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk index 852836ef8f..a638183019 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -18,4 +18,5 @@ OPTIMIZATION_FLAGS = -Os LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F401xe_boot.ld -# LD_FILE = boards/STM32F401xe_fs.ld # use for internal flash +# use for internal flash +# LD_FILE = boards/STM32F401xe_fs.ld From ad733e6c4a33b830fe430599c372d1fa51ed1b2e Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 26 Aug 2020 17:37:05 -0400 Subject: [PATCH 0730/1293] rename reader tool --- tools/mpconfig_category_reader.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tools/mpconfig_category_reader.py diff --git a/tools/mpconfig_category_reader.py b/tools/mpconfig_category_reader.py new file mode 100644 index 0000000000..2f813931e8 --- /dev/null +++ b/tools/mpconfig_category_reader.py @@ -0,0 +1,31 @@ +filepath = '../py/circuitpy_mpconfig.mk' +with open(filepath) as fp: + line = fp.readline() + cnt = 1 + fullbuild = [] + defon = [] + defoff = [] + while line: + wordlist = line.split() + if wordlist: + if wordlist[-1] == "$(CIRCUITPY_FULL_BUILD)": + fullbuild.append(wordlist[0]) + elif wordlist[-1] == "0": + defoff.append(wordlist[0]) + elif wordlist[-1] == "1": + defon.append(wordlist[0]) + line = fp.readline() + cnt += 1 + + print(str(cnt) + " Lines Read\n") + print("\nFULL BUILDS ------------------------") + for string in fullbuild: + print(string) + + print("\nON BUILDS ------------------------") + for string in defon: + print(string) + + print("\nOFF BUILDS ------------------------") + for string in defoff: + print(string) From 553ac576ebd59941965ef7615fdb15bd2bdc347e Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 26 Aug 2020 17:48:29 -0400 Subject: [PATCH 0731/1293] Disable ulab --- ports/esp32s2/mpconfigport.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 3ddcf5d613..b7cd635044 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -29,5 +29,7 @@ CIRCUITPY_COUNTIO = 0 CIRCUITPY_RANDOM = 0 # Requires USB CIRCUITPY_USB_MIDI = 0 +# Too large for the partition table! +CIRCUITPY_ULAB = 0 CIRCUITPY_MODULE ?= none From c22934574146c4468374a10916d2746f0400a8a8 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 26 Aug 2020 18:47:19 -0400 Subject: [PATCH 0732/1293] improve efficiency of stm32 random gen --- ports/stm/common-hal/os/__init__.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ports/stm/common-hal/os/__init__.c b/ports/stm/common-hal/os/__init__.c index 13871a46ea..8da7243a30 100644 --- a/ports/stm/common-hal/os/__init__.c +++ b/ports/stm/common-hal/os/__init__.c @@ -72,15 +72,20 @@ bool common_hal_os_urandom(uint8_t *buffer, uint32_t length) { if (HAL_RNG_Init(&handle) != HAL_OK) mp_raise_ValueError(translate("RNG Init Error")); //Assign bytes - for (uint i = 0; i < length; i++) { - uint32_t temp; + uint32_t i = 0; + while (i < length) { + uint32_t new_random; uint32_t start = HAL_GetTick(); //the HAL function has a timeout, but it isn't long enough, and isn't adjustable while(!(__HAL_RNG_GET_FLAG(&handle,RNG_FLAG_DRDY)) && ((HAL_GetTick() - start) < RNG_TIMEOUT)); - if (HAL_RNG_GenerateRandomNumber(&handle, &temp) != HAL_OK) { + if (HAL_RNG_GenerateRandomNumber(&handle, &new_random) != HAL_OK) { mp_raise_ValueError(translate("Random number generation error")); } - buffer[i] = (uint8_t)temp; + for (int j = 0; j < 4 && i < length; j++) { + buffer[i] = new_random & 0xff; + i++; + new_random >>= 8; + } } //shut down the peripheral From 46dc133d04bb6c38faea820576978827edd4337d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 26 Aug 2020 17:18:16 -0700 Subject: [PATCH 0733/1293] Fix stub and doc builds --- conf.py | 1 + shared-bindings/ipaddress/IPv4Address.c | 2 +- shared-bindings/wifi/ScannedNetworks.c | 2 +- shared-bindings/wifi/__init__.c | 9 ++++----- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/conf.py b/conf.py index 4a8b72584e..bd9e31d7f9 100644 --- a/conf.py +++ b/conf.py @@ -144,6 +144,7 @@ version = release = final_version # directories to ignore when looking for source files. exclude_patterns = ["**/build*", ".git", + ".env", ".venv", ".direnv", "docs/autoapi", diff --git a/shared-bindings/ipaddress/IPv4Address.c b/shared-bindings/ipaddress/IPv4Address.c index 29536dfa43..03d1874cfc 100644 --- a/shared-bindings/ipaddress/IPv4Address.c +++ b/shared-bindings/ipaddress/IPv4Address.c @@ -42,7 +42,7 @@ //| def __init__(self, address: Union[str, bytes]) -> None: //| """Create a new IPv4Address object encapsulating the address value. //| -//| The value itself can either be bytes or a string formatted address."" +//| The value itself can either be bytes or a string formatted address.""" //| ... //| STATIC mp_obj_t ipaddress_ipv4address_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { diff --git a/shared-bindings/wifi/ScannedNetworks.c b/shared-bindings/wifi/ScannedNetworks.c index c6b77d70b7..c927d7282f 100644 --- a/shared-bindings/wifi/ScannedNetworks.c +++ b/shared-bindings/wifi/ScannedNetworks.c @@ -36,7 +36,7 @@ static const char *TAG = "cp iternext"; //| class ScannedNetworks: -//| """Iterates over wifi `Network`s found while scanning. This object is always created +//| """Iterates over all `wifi.Network` objects found while scanning. This object is always created //| by a `wifi.Radio`: it has no user-visible constructor.""" //| STATIC mp_obj_t scannednetworks_iternext(mp_obj_t self_in) { diff --git a/shared-bindings/wifi/__init__.c b/shared-bindings/wifi/__init__.c index a12881094c..352ceb3318 100644 --- a/shared-bindings/wifi/__init__.c +++ b/shared-bindings/wifi/__init__.c @@ -32,12 +32,11 @@ //| """ //| The `wifi` module provides necessary low-level functionality for managing wifi -//| wifi connections. Use `socketpool` for communicating over the network. +//| wifi connections. Use `socketpool` for communicating over the network.""" //| -//| .. attribute:: radio -//| -//| Wifi radio used to manage both station and AP modes. -//| This object is the sole instance of `wifi.Radio`.""" +//| radio: Radio +//| """Wifi radio used to manage both station and AP modes. +//| This object is the sole instance of `wifi.Radio`.""" //| From 200a296b5cf6851b72460d49fdb3be43980f2d9b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 26 Aug 2020 20:41:25 -0500 Subject: [PATCH 0734/1293] conf.py (docs): Reorder the steps of the doc build Since e121e267adacf6, the shared bindings matrix uses the stubs. Therefore, we must build them! This should fix the failure to build the docs on readthedocs.org. Neither @sommersoft nor I saw this locally since we had previously built the stubs. github CI didn't see it, because it manually builds the stubs in an earlier step of the build process, and does not clean the tree in between. --- conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 4a8b72584e..256ca922c7 100644 --- a/conf.py +++ b/conf.py @@ -42,6 +42,9 @@ master_doc = 'docs/index' # Grab the JSON values to use while building the module support matrix # in 'shared-bindings/index.rst' +# The stubs must be built before we calculate the shared bindings matrix +subprocess.check_output(["make", "stubs"]) + #modules_support_matrix = shared_bindings_matrix.support_matrix_excluded_boards() modules_support_matrix = shared_bindings_matrix.support_matrix_by_board() @@ -77,7 +80,6 @@ source_suffix = { '.md': 'markdown', } -subprocess.check_output(["make", "stubs"]) extensions.append('autoapi.extension') autoapi_type = 'python' From 8021da08d3fb0a3a55ffc00f00ce9c2959ce80c8 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 27 Aug 2020 11:07:47 -0400 Subject: [PATCH 0735/1293] Fix problematic whitespace on pulseout parameter errors --- ports/atmel-samd/common-hal/pulseio/PulseOut.c | 3 +-- ports/cxd56/common-hal/pulseio/PulseOut.c | 3 +-- ports/esp32s2/common-hal/pulseio/PulseOut.c | 3 +-- ports/nrf/common-hal/pulseio/PulseOut.c | 3 +-- ports/stm/common-hal/pulseio/PulseOut.c | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/ports/atmel-samd/common-hal/pulseio/PulseOut.c b/ports/atmel-samd/common-hal/pulseio/PulseOut.c index 3463bb5e20..086052a973 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseOut.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseOut.c @@ -101,8 +101,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, uint32_t frequency, uint16_t duty_cycle) { if (!carrier || pin || frequency) { - mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. \ - Construct and pass a PWMOut Carrier instead")); + mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. Construct and pass a PWMOut Carrier instead")); } if (refcount == 0) { diff --git a/ports/cxd56/common-hal/pulseio/PulseOut.c b/ports/cxd56/common-hal/pulseio/PulseOut.c index 764a5860a9..f08e7cd7a0 100644 --- a/ports/cxd56/common-hal/pulseio/PulseOut.c +++ b/ports/cxd56/common-hal/pulseio/PulseOut.c @@ -64,8 +64,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, uint32_t frequency, uint16_t duty_cycle) { if (!carrier || pin || frequency) { - mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. \ - Construct and pass a PWMOut Carrier instead")); + mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. Construct and pass a PWMOut Carrier instead")); } if (pulse_fd < 0) { diff --git a/ports/esp32s2/common-hal/pulseio/PulseOut.c b/ports/esp32s2/common-hal/pulseio/PulseOut.c index cfe750732b..e45492a893 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseOut.c +++ b/ports/esp32s2/common-hal/pulseio/PulseOut.c @@ -37,8 +37,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, uint32_t frequency, uint16_t duty_cycle) { if (carrier || !pin || !frequency) { - mp_raise_NotImplementedError(translate("Port does not accept PWM carrier. \ - Pass a pin, frequency and duty cycle instead")); + mp_raise_NotImplementedError(translate("Port does not accept PWM carrier. Pass a pin, frequency and duty cycle instead")); } rmt_channel_t channel = esp32s2_peripherals_find_and_reserve_rmt(); diff --git a/ports/nrf/common-hal/pulseio/PulseOut.c b/ports/nrf/common-hal/pulseio/PulseOut.c index 9f301a7306..f40dbea5c8 100644 --- a/ports/nrf/common-hal/pulseio/PulseOut.c +++ b/ports/nrf/common-hal/pulseio/PulseOut.c @@ -105,8 +105,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, uint32_t frequency, uint16_t duty_cycle) { if (!carrier || pin || frequency) { - mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. \ - Construct and pass a PWMOut Carrier instead")); + mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. Construct and pass a PWMOut Carrier instead")); } if (refcount == 0) { diff --git a/ports/stm/common-hal/pulseio/PulseOut.c b/ports/stm/common-hal/pulseio/PulseOut.c index 3bf23ad14b..963aee721a 100644 --- a/ports/stm/common-hal/pulseio/PulseOut.c +++ b/ports/stm/common-hal/pulseio/PulseOut.c @@ -118,8 +118,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, uint32_t frequency, uint16_t duty_cycle) { if (!carrier || pin || frequency) { - mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. \ - Construct and pass a PWMOut Carrier instead")); + mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. Construct and pass a PWMOut Carrier instead")); } // Add to active PulseOuts From e2559efb9374af54ac10d30c2178a10d99352c16 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 27 Aug 2020 11:21:39 -0400 Subject: [PATCH 0736/1293] translations --- locale/circuitpython.pot | 52 +++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index fe726acf27..108bcb381c 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-21 21:39-0500\n" +"POT-Creation-Date: 2020-08-27 11:21-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -302,7 +302,7 @@ msgstr "" msgid "All sync event channels in use" msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" msgstr "" @@ -314,7 +314,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" msgstr "" @@ -552,7 +552,7 @@ msgstr "" msgid "Cannot unambiguously get sizeof scalar" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" @@ -621,23 +621,23 @@ msgstr "" msgid "Could not initialize UART" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" msgstr "" @@ -645,7 +645,7 @@ msgstr "" msgid "Could not set address" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" msgstr "" @@ -836,7 +836,7 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -938,9 +938,9 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PWMOut.c -#: ports/cxd56/common-hal/pulseio/PWMOut.c -#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "Invalid PWM frequency" msgstr "" @@ -980,7 +980,7 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "" @@ -998,8 +998,8 @@ msgid "Invalid phase" msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "" @@ -1023,7 +1023,7 @@ msgstr "" msgid "Invalid pins" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" msgstr "" @@ -1205,7 +1205,7 @@ msgstr "" msgid "No long integer support" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1273,12 +1273,12 @@ msgstr "" msgid "Oversample must be multiple of 8." msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" @@ -1333,8 +1333,8 @@ msgstr "" #: ports/nrf/common-hal/pulseio/PulseOut.c #: ports/stm/common-hal/pulseio/PulseOut.c msgid "" -"Port does not accept pins or frequency. " -"Construct and pass a PWMOut Carrier instead" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" msgstr "" #: shared-bindings/_bleio/Adapter.c @@ -1349,6 +1349,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -1560,7 +1564,7 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" From fd6e63d806e1b3611df20ed4d3a85bcadb63947f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 27 Aug 2020 11:43:06 -0700 Subject: [PATCH 0737/1293] Hopefully final partition scheme. --- ports/esp32s2/partitions.csv | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ports/esp32s2/partitions.csv b/ports/esp32s2/partitions.csv index 6317ff52ad..7c9a1cac90 100644 --- a/ports/esp32s2/partitions.csv +++ b/ports/esp32s2/partitions.csv @@ -1,9 +1,10 @@ # ESP-IDF Partition Table # Name, Type, SubType, Offset, Size, Flags -# bootloader.bin 0x1000 -# partition table 0x8000, 0xC00 -otadata, data, ota, 0xd000, 0x2000, -ota_0, 0, ota_0, 0x10000, 0x120000, -ota_1, 0, ota_1, 0x130000, 0x120000, -phy_init, data, phy, 0x250000, 0x1000, -user_fs, data, fat, 0x251000, 0x1af000, +# bootloader.bin 0x1000 +# partition table 0x8000, 0xC00 +otadata, data, ota, 0xd000, 0x2000, +phy_init, data, phy, 0xf000, 0x1000, +ota_0, 0, ota_0, 0x10000, 0x160000, +ota_1, 0, ota_1, 0x170000, 0x160000, +uf2, app, factory,0x2d0000, 256K, +user_fs, data, fat, 0x310000, 960K, From 2b71635c4978a337542292cfc78460440d59338d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 27 Aug 2020 11:45:51 -0700 Subject: [PATCH 0738/1293] Fix esp-idf requirements --- ports/esp32s2/esp-idf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index 83595f7659..de733cdab5 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit 83595f76591aebf0cca9a578258276e67f628b06 +Subproject commit de733cdab556c5713c94ba95078f4024dd56fd87 From a03b6a99e60c8c428d95bc78b1ee6948607f69c6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 27 Aug 2020 15:10:52 -0500 Subject: [PATCH 0739/1293] gen_usb_descriptor: Fix off-by-1 error in endpoint counting --- tools/gen_usb_descriptor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index baee8cad7b..adf0d8270d 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -382,8 +382,9 @@ if args.max_ep != 0: for interface in interfaces: for subdescriptor in interface.subdescriptors: endpoint_address = getattr(subdescriptor, 'bEndpointAddress', 0) & 0x7f - if endpoint_address > args.max_ep: - raise ValueError("Endpoint address %d of %s may not exceed %d" % (endpoint_address & 0x7f, interface.description, args.max_ep)) + print("Endpoint %d - vs max_ep %d" % (endpoint_address, args.max_ep)) + if endpoint_address >= args.max_ep: + raise ValueError("Endpoint address %d of %s must be less than %d" % (endpoint_address & 0x7f, interface.description, args.max_ep)) else: print("Unable to check whether maximum number of endpoints is respected", file=sys.stderr) From 563e038c0d210dd0d17f6dc65f2c9eb5bbff1892 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 27 Aug 2020 15:11:17 -0500 Subject: [PATCH 0740/1293] stm: Specify max endpoints for stm32f405xx .. which is why we can't have HID or MIDI on the stm32f405 feather --- ports/stm/mpconfigport.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 19f9ffa44c..b827aa48b9 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -7,6 +7,7 @@ ifeq ($(MCU_VARIANT),STM32F405xx) CIRCUITPY_FRAMEBUFFERIO ?= 1 CIRCUITPY_RGBMATRIX ?= 1 CIRCUITPY_SDIOIO ?= 1 + USB_NUM_EP = 4 endif ifeq ($(MCU_SERIES),F4) From 5d8ac0428b239be2b0487a2da2d2192aa7ed8725 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 27 Aug 2020 13:34:37 -0700 Subject: [PATCH 0741/1293] -Os espruino_pico to save space --- ports/stm/boards/espruino_pico/mpconfigboard.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.mk b/ports/stm/boards/espruino_pico/mpconfigboard.mk index b1b023dd58..556ff35c45 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.mk +++ b/ports/stm/boards/espruino_pico/mpconfigboard.mk @@ -9,6 +9,8 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F401xE MCU_PACKAGE = UFQFPN48 +OPTIMIZATION_FLAGS = -Os + LD_COMMON = boards/common_default.ld # use for internal flash LD_FILE = boards/STM32F401xd_fs.ld From a09243472cf4e57d9c157ecd4c55416a42fb7081 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 28 Aug 2020 16:08:24 -0700 Subject: [PATCH 0742/1293] Add Kaluga board definition --- .github/workflows/build.yml | 1 + .../esp32s2/boards/espressif_kaluga_1/board.c | 47 +++++++++++++ .../boards/espressif_kaluga_1/mpconfigboard.h | 34 ++++++++++ .../espressif_kaluga_1/mpconfigboard.mk | 17 +++++ .../esp32s2/boards/espressif_kaluga_1/pins.c | 66 +++++++++++++++++++ .../boards/espressif_kaluga_1/sdkconfig | 33 ++++++++++ 6 files changed, 198 insertions(+) create mode 100644 ports/esp32s2/boards/espressif_kaluga_1/board.c create mode 100644 ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h create mode 100644 ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk create mode 100644 ports/esp32s2/boards/espressif_kaluga_1/pins.c create mode 100644 ports/esp32s2/boards/espressif_kaluga_1/sdkconfig diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8528168ac..e780f652ab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -409,6 +409,7 @@ jobs: matrix: board: - "electroniccats_bastwifi" + - "espressif_kaluga_1" - "espressif_saola_1_wroom" - "espressif_saola_1_wrover" - "microdev_micro_s2" diff --git a/ports/esp32s2/boards/espressif_kaluga_1/board.c b/ports/esp32s2/boards/espressif_kaluga_1/board.c new file mode 100644 index 0000000000..9f708874bf --- /dev/null +++ b/ports/esp32s2/boards/espressif_kaluga_1/board.c @@ -0,0 +1,47 @@ +/* + * 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 "boards/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h b/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h new file mode 100644 index 0000000000..84d15ffc2b --- /dev/null +++ b/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h @@ -0,0 +1,34 @@ +/* + * 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 "Kaluga 1" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO45) + +#define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk b/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk new file mode 100644 index 0000000000..43b1a9a688 --- /dev/null +++ b/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x239A +USB_PID = 0x80A6 +USB_PRODUCT = "Kaluga 1" +USB_MANUFACTURER = "Espressif" + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=4MB + +CIRCUITPY_MODULE=wrover diff --git a/ports/esp32s2/boards/espressif_kaluga_1/pins.c b/ports/esp32s2/boards/espressif_kaluga_1/pins.c new file mode 100644 index 0000000000..b0e9957a1d --- /dev/null +++ b/ports/esp32s2/boards/espressif_kaluga_1/pins.c @@ -0,0 +1,66 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { 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_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_IO17), MP_ROM_PTR(&pin_GPIO17) }, + + + { 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_IO20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_IO26), MP_ROM_PTR(&pin_GPIO26) }, + { 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_IO37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) }, + + + { MP_ROM_QSTR(MP_QSTR_CAMERA_XCLK), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_PCLK), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_HREF), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_VSYNC), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_SIOD), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_SIOC), MP_ROM_PTR(&pin_GPIO7) }, + + + { MP_ROM_QSTR(MP_QSTR_CAMERA_D2), MP_ROM_PTR(&pin_GPIO46) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_D3), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_D4), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_D5), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_D6), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_D7), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_D8), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_D9), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO45) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/esp32s2/boards/espressif_kaluga_1/sdkconfig b/ports/esp32s2/boards/espressif_kaluga_1/sdkconfig new file mode 100644 index 0000000000..9d8bbde967 --- /dev/null +++ b/ports/esp32s2/boards/espressif_kaluga_1/sdkconfig @@ -0,0 +1,33 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 + +# +# PSRAM clock and cs IO for ESP32S2 +# +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM clock and cs IO for ESP32S2 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config From 81870413af5efc35beb31449a099fb69ba05e15c Mon Sep 17 00:00:00 2001 From: lady ada Date: Fri, 28 Aug 2020 19:08:36 -0400 Subject: [PATCH 0743/1293] add default I2C --- ports/atmel-samd/boards/blm_badge/pins.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/atmel-samd/boards/blm_badge/pins.c b/ports/atmel-samd/boards/blm_badge/pins.c index af1b693584..6e7d8da754 100644 --- a/ports/atmel-samd/boards/blm_badge/pins.c +++ b/ports/atmel-samd/boards/blm_badge/pins.c @@ -39,5 +39,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_PA03) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA03) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 0bb5c6c07fdb0ce4100cd4b8a9465ad9f4d090ff Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 28 Aug 2020 16:37:25 -0700 Subject: [PATCH 0744/1293] Add unique USB PID --- ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk b/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk index 43b1a9a688..ba85e46efc 100644 --- a/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x80A6 +USB_PID = 0x80C8 USB_PRODUCT = "Kaluga 1" USB_MANUFACTURER = "Espressif" From 7b59ede25e4bba09e2b104c2404399bbf0af7fb6 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 28 Aug 2020 18:22:22 -0700 Subject: [PATCH 0745/1293] Add remaining pins --- .../esp32s2/boards/espressif_kaluga_1/pins.c | 61 ++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/ports/esp32s2/boards/espressif_kaluga_1/pins.c b/ports/esp32s2/boards/espressif_kaluga_1/pins.c index b0e9957a1d..c1657d6c0e 100644 --- a/ports/esp32s2/boards/espressif_kaluga_1/pins.c +++ b/ports/esp32s2/boards/espressif_kaluga_1/pins.c @@ -44,6 +44,8 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_XCLK), MP_ROM_PTR(&pin_GPIO1) }, { MP_ROM_QSTR(MP_QSTR_CAMERA_PCLK), MP_ROM_PTR(&pin_GPIO33) }, { MP_ROM_QSTR(MP_QSTR_CAMERA_HREF), MP_ROM_PTR(&pin_GPIO3) }, @@ -61,6 +63,63 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_CAMERA_D8), MP_ROM_PTR(&pin_GPIO21) }, { MP_ROM_QSTR(MP_QSTR_CAMERA_D9), MP_ROM_PTR(&pin_GPIO38) }, - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO45) }, + + { MP_ROM_QSTR(MP_QSTR_TOUCH1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH14), MP_ROM_PTR(&pin_GPIO14) }, + + // LED FPC + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_BT_ARRAY_ADC), MP_ROM_PTR(&pin_GPIO6) }, + + // 3.2 inch LCD FPC + { MP_ROM_QSTR(MP_QSTR_LCD_TP_MISO), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_LCD_TP_MOSI), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_LCD_TP_SCK), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_LCD_TP_CS), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_LCD_TP_IRQ), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_LCD_TP_BUSY), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_LCD_BL_CTR), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_LCD_MISO), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_LCD_MOSI), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_LCD_CS), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_LCD_D_C), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_LCD_CLK), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_LCD_RST), MP_ROM_PTR(&pin_GPIO16) }, + + // Audio + { MP_ROM_QSTR(MP_QSTR_AUDIO_SPI_MISO), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_SPI_MOSI), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_SPI_SCK), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_SPI_CS), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_BT_ADC), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_SCL), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_SDA), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S0_MCLK), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S0_BCLK), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S0_LRCK), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S0_SDI), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S0_SDO), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_RST), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_WAKE_INT), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S1_MCLK), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_PA_CTRL), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S1_SDI), MP_ROM_PTR(&pin_GPIO46) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S1_SDO), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S1_LRCK_DAC1), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S1_BCLK_DAC2), MP_ROM_PTR(&pin_GPIO18) }, + }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 28f0139e6e0f927c480925f1699bb8b150b055a7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 29 Aug 2020 07:37:00 -0500 Subject: [PATCH 0746/1293] shared_bindings_matrix revert to using shared-bindings .. hard-coding ulab for now. It also fixes a problem where board_name was unassigned when use_branded_name was False, which only happened at release-building time. Trying to change this caused multiple problems in the release process. --- docs/shared_bindings_matrix.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index e81ae188c2..f38c0b64a0 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -43,8 +43,8 @@ def get_circuitpython_root_dir(): def get_shared_bindings(): """ Get a list of modules in shared-bindings based on folder names """ - shared_bindings_dir = get_circuitpython_root_dir() / "circuitpython-stubs" - return [item.name for item in shared_bindings_dir.iterdir()] + shared_bindings_dir = get_circuitpython_root_dir() / "shared-bindings" + return [item.name for item in shared_bindings_dir.iterdir()] + ["ulab"] def read_mpconfig(): @@ -159,6 +159,8 @@ def support_matrix_by_board(use_branded_name=True): board_contents) if board_name_re: board_name = board_name_re.group(1).strip('"') + else: + board_name = entry.name board_modules = [] for module in base: From 455226ffded69538f5f453b566b499361b201ffb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 30 Aug 2020 11:09:49 -0500 Subject: [PATCH 0747/1293] builtinimport: Fix a crash with 'import ulab.linalg' on unix port only A crash like the following occurs in the unix port: ``` Program received signal SIGSEGV, Segmentation fault. 0x00005555555a2d7a in mp_obj_module_set_globals (self_in=0x55555562c860 , globals=0x55555562c840 ) at ../../py/objmodule.c:145 145 self->globals = globals; (gdb) up #1 0x00005555555b2781 in mp_builtin___import__ (n_args=5, args=0x7fffffffdbb0) at ../../py/builtinimport.c:496 496 mp_obj_module_set_globals(outer_module_obj, (gdb) #2 0x00005555555940c9 in mp_import_name (name=824, fromlist=0x555555621f10 , level=0x1) at ../../py/runtime.c:1392 1392 return mp_builtin___import__(5, args); ``` I don't understand how it doesn't happen on the embedded ports, because the module object should reside in ROM and the assignment of self->globals should trigger a Hard Fault. By checking VERIFY_PTR, we know that the pointed-to data is on the heap so we can do things like mutate it. --- py/builtinimport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/builtinimport.c b/py/builtinimport.c index 597819f55c..47ffab5196 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -488,7 +488,7 @@ mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args) { // afterwards. gc_collect(); } - if (outer_module_obj != MP_OBJ_NULL) { + if (outer_module_obj != MP_OBJ_NULL && VERIFY_PTR(outer_module_obj) ) { qstr s = qstr_from_strn(mod_str + last, i - last); mp_store_attr(outer_module_obj, s, module_obj); // The above store can cause a dictionary rehash and new allocation. So, From b27d51125134b4317b429eb7b015c9f94f22adb0 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 30 Aug 2020 14:06:48 -0400 Subject: [PATCH 0748/1293] address review; use constructor for HCI Adapter --- devices/ble_hci/common-hal/_bleio/Adapter.c | 3 +- devices/ble_hci/common-hal/_bleio/Adapter.h | 1 + devices/ble_hci/common-hal/_bleio/__init__.c | 10 +++ .../common-hal/_bleio/hci_include/NOTE.txt | 4 +- py/obj.h | 25 ++++++- shared-bindings/_bleio/Adapter.c | 43 +++++------ shared-bindings/_bleio/Adapter.h | 2 +- shared-bindings/_bleio/__init__.c | 72 ++++++++++++++++++- shared-bindings/_bleio/__init__.h | 3 + shared-bindings/usb_midi/__init__.c | 12 +--- 10 files changed, 133 insertions(+), 42 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index 27a2512815..559b586de3 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -341,7 +341,8 @@ STATIC void bleio_adapter_hci_init(bleio_adapter_obj_t *self) { } } -void common_hal_bleio_adapter_hci_uart_init(bleio_adapter_obj_t *self, busio_uart_obj_t *uart, digitalio_digitalinout_obj_t *rts, digitalio_digitalinout_obj_t *cts) { +void common_hal_bleio_adapter_construct_hci_uart(bleio_adapter_obj_t *self, busio_uart_obj_t *uart, digitalio_digitalinout_obj_t *rts, digitalio_digitalinout_obj_t *cts) { + self->allocated = true; self->hci_uart = uart; self->rts_digitalinout = rts; self->cts_digitalinout = cts; diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.h b/devices/ble_hci/common-hal/_bleio/Adapter.h index dbccfbfb1a..bec1329f28 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.h +++ b/devices/ble_hci/common-hal/_bleio/Adapter.h @@ -52,6 +52,7 @@ typedef struct _bleio_adapter_obj_t { busio_uart_obj_t* hci_uart; digitalio_digitalinout_obj_t *rts_digitalinout; digitalio_digitalinout_obj_t *cts_digitalinout; + bool allocated; // True when in use. bool now_advertising; bool extended_advertising; bool circuitpython_advertising; diff --git a/devices/ble_hci/common-hal/_bleio/__init__.c b/devices/ble_hci/common-hal/_bleio/__init__.c index 25aca39b51..9fc4b480d9 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.c +++ b/devices/ble_hci/common-hal/_bleio/__init__.c @@ -74,6 +74,9 @@ void bleio_reset() { return; } common_hal_bleio_adapter_set_enabled(&common_hal_bleio_adapter_obj, false); + common_hal_bleio_adapter_obj.allocated = false; + + bleio_set_adapter(mp_const_none); //FIX bonding_reset(); supervisor_start_bluetooth(); @@ -86,6 +89,13 @@ bleio_adapter_obj_t common_hal_bleio_adapter_obj = { }, }; +bleio_adapter_obj_t *common_hal_bleio_allocate_adapter_or_raise(void) { + if (common_hal_bleio_adapter_obj.allocated) { + mp_raise_RuntimeError(translate("Too many Adapters")); + } + return &common_hal_bleio_adapter_obj; +} + void common_hal_bleio_check_connected(uint16_t conn_handle) { if (conn_handle == BLE_CONN_HANDLE_INVALID) { mp_raise_bleio_ConnectionError(translate("Not connected")); diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/NOTE.txt b/devices/ble_hci/common-hal/_bleio/hci_include/NOTE.txt index 4d2968c39c..ac34c815ce 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_include/NOTE.txt +++ b/devices/ble_hci/common-hal/_bleio/hci_include/NOTE.txt @@ -1,2 +1,2 @@ -The HCI-related include files here are copied from the Zephyr project: -https://github.com/zephyrproject-rtos/zephyr/tree/master/include/bluetooth +The HCI-related include files here were copied from the Zephyr project, from this commit: +https://github.com/zephyrproject-rtos/zephyr/tree/0a87f9359edf1ec1c169626df3e19c2b4a4e9646/include/bluetooth diff --git a/py/obj.h b/py/obj.h index e9d867f77b..943e1a389b 100644 --- a/py/obj.h +++ b/py/obj.h @@ -303,7 +303,7 @@ typedef struct _mp_rom_obj_t { mp_const_obj_t o; } mp_rom_obj_t; (mp_obj_t)&mp_const_none_obj, \ (mp_obj_t)&mp_const_none_obj}, } -// These macros are used to define constant map/dict objects +// These macros are used to define constant or mutable map/dict objects // You can put "static" in front of the definition to make it local #define MP_DEFINE_CONST_MAP(map_name, table_name) \ @@ -329,6 +329,29 @@ typedef struct _mp_rom_obj_t { mp_const_obj_t o; } mp_rom_obj_t; }, \ } +#define MP_DEFINE_MUTABLE_MAP(map_name, table_name) \ + mp_map_t map_name = { \ + .all_keys_are_qstrs = 1, \ + .is_fixed = 1, \ + .is_ordered = 1, \ + .used = MP_ARRAY_SIZE(table_name), \ + .alloc = MP_ARRAY_SIZE(table_name), \ + .table = table_name, \ + } + +#define MP_DEFINE_MUTABLE_DICT(dict_name, table_name) \ + mp_obj_dict_t dict_name = { \ + .base = {&mp_type_dict}, \ + .map = { \ + .all_keys_are_qstrs = 1, \ + .is_fixed = 1, \ + .is_ordered = 1, \ + .used = MP_ARRAY_SIZE(table_name), \ + .alloc = MP_ARRAY_SIZE(table_name), \ + .table = table_name, \ + }, \ + } + // These macros are used to declare and define constant staticmethond and classmethod objects // You can put "static" in front of the definitions to make them local diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 5b67a9ae95..b70fd17f8f 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -48,46 +48,42 @@ #define WINDOW_DEFAULT (0.1f) //| class Adapter: -//| """BLE adapter -//| -//| The Adapter manages the discovery and connection to other nearby Bluetooth Low Energy devices. +//| """ +//| The BLE Adapter object manages the discovery and connection to other nearby Bluetooth Low Energy devices. //| This part of the Bluetooth Low Energy Specification is known as Generic Access Profile (GAP). //| //| Discovery of other devices happens during a scanning process that listens for small packets of //| information, known as advertisements, that are broadcast unencrypted. The advertising packets //| have two different uses. The first is to broadcast a small piece of data to anyone who cares and -//| and nothing more. These are known as Beacons. The second class of advertisement is to promote +//| and nothing more. These are known as beacons. The second class of advertisement is to promote //| additional functionality available after the devices establish a connection. For example, a -//| BLE keyboard may advertise that it can provide key information, but not what the key info is. +//| BLE heart rate monitor would advertise that it provides the standard BLE Heart Rate Service. //| -//| The built-in BLE adapter can do both parts of this process: it can scan for other device +//| The Adapter can do both parts of this process: it can scan for other device //| advertisements and it can advertise its own data. Furthermore, Adapters can accept incoming //| connections and also initiate connections.""" //| -//| def __init__(self) -> None: -//| """You cannot create an instance of `_bleio.Adapter`. -//| Use `_bleio.adapter` to access the sole instance available.""" -//| ... -//| - -//| def hci_uart_init(self, *, uart: busio.UART, rts: digitalio.DigitalInOut, cts: digitalio.DigitalInOut, baudrate: int = 115200, buffer_size: int = 256) -> None: -//| """On boards that do not have native BLE, you can an use HCI co-processor. +//| def __init__(self, *, uart: busio.UART, rts: digitalio.DigitalInOut, cts: digitalio.DigitalInOut) -> None: +//| """On boards that do not have native BLE, you can use an HCI co-processor. //| Pass the uart and pins used to communicate with the co-processor, such as an Adafruit AirLift. //| The co-processor must have been reset and put into BLE mode beforehand //| by the appropriate pin manipulation. //| The ``uart``, ``rts``, and ``cts`` objects are used to //| communicate with the HCI co-processor in HCI mode. +//| The `Adapter` object is enabled during this call. //| -//| The `_bleio.adapter` object is enabled during this call. +//| After instantiating the Adapter, assign it to _bleio.adapter //| -//| Raises `RuntimeError` on boards with native BLE. +//| On boards with native BLE, you cannot create an instance of `_bleio.Adapter`; +//| this constructor will raise `NotImplementedError`. +//| Use `_bleio.adapter` to access the sole instance already available.""" //| """ //| ... //| -STATIC mp_obj_t bleio_adapter_hci_uart_init(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { +STATIC mp_obj_t bleio_adapter_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { #if CIRCUITPY_BLEIO_HCI - bleio_adapter_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + bleio_adapter_obj_t *self = common_hal_bleio_allocate_adapter_or_raise(); enum { ARG_uart, ARG_rts, ARG_cts }; static const mp_arg_t allowed_args[] = { @@ -97,7 +93,7 @@ STATIC mp_obj_t bleio_adapter_hci_uart_init(mp_uint_t n_args, const mp_obj_t *po }; 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); + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); busio_uart_obj_t *uart = args[ARG_uart].u_obj; if (!MP_OBJ_IS_TYPE(uart, &busio_uart_type)) { @@ -112,15 +108,14 @@ STATIC mp_obj_t bleio_adapter_hci_uart_init(mp_uint_t n_args, const mp_obj_t *po } // Will enable the adapter. - common_hal_bleio_adapter_hci_uart_init(self, uart, rts, cts); + common_hal_bleio_adapter_construct_hci_uart(self, uart, rts, cts); - return mp_const_none; + return MP_OBJ_FROM_PTR(self); #else - mp_raise_RuntimeError(translate("hci_uart_init not available")); + mp_raise_NotImplementedError(translate("Cannot create a new Adapter; use _bleio.adapter;")); return mp_const_none; #endif // CIRCUITPY_BLEIO_HCI } -STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_hci_uart_init_obj, 1, bleio_adapter_hci_uart_init); //| //| enabled: bool @@ -454,7 +449,6 @@ STATIC mp_obj_t bleio_adapter_erase_bonding(mp_obj_t self_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_erase_bonding_obj, bleio_adapter_erase_bonding); STATIC const mp_rom_map_elem_t bleio_adapter_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_hci_uart_init), MP_ROM_PTR(&bleio_adapter_hci_uart_init_obj) }, { MP_ROM_QSTR(MP_QSTR_enabled), MP_ROM_PTR(&bleio_adapter_enabled_obj) }, { MP_ROM_QSTR(MP_QSTR_address), MP_ROM_PTR(&bleio_adapter_address_obj) }, { MP_ROM_QSTR(MP_QSTR_name), MP_ROM_PTR(&bleio_adapter_name_obj) }, @@ -479,5 +473,6 @@ STATIC MP_DEFINE_CONST_DICT(bleio_adapter_locals_dict, bleio_adapter_locals_dict const mp_obj_type_t bleio_adapter_type = { .base = { &mp_type_type }, .name = MP_QSTR_Adapter, + .make_new = bleio_adapter_make_new, .locals_dict = (mp_obj_t)&bleio_adapter_locals_dict, }; diff --git a/shared-bindings/_bleio/Adapter.h b/shared-bindings/_bleio/Adapter.h index 62a1d1c767..36e9db7610 100644 --- a/shared-bindings/_bleio/Adapter.h +++ b/shared-bindings/_bleio/Adapter.h @@ -38,7 +38,7 @@ const mp_obj_type_t bleio_adapter_type; #if CIRCUITPY_BLEIO_HCI -void common_hal_bleio_adapter_hci_uart_init(bleio_adapter_obj_t *self, busio_uart_obj_t *uart, digitalio_digitalinout_obj_t *rts, digitalio_digitalinout_obj_t *cts); +void common_hal_bleio_adapter_construct_hci_uart(bleio_adapter_obj_t *self, busio_uart_obj_t *uart, digitalio_digitalinout_obj_t *rts, digitalio_digitalinout_obj_t *cts); #endif // CIRCUITPY_BLEIO_HCI extern bool common_hal_bleio_adapter_get_advertising(bleio_adapter_obj_t *self); diff --git a/shared-bindings/_bleio/__init__.c b/shared-bindings/_bleio/__init__.c index f3fdc517e4..dece5820fb 100644 --- a/shared-bindings/_bleio/__init__.c +++ b/shared-bindings/_bleio/__init__.c @@ -108,8 +108,8 @@ NORETURN void mp_raise_bleio_SecurityError(const compressed_string_t* fmt, ...) // Called when _bleio is imported. STATIC mp_obj_t bleio___init__(void) { +// HCI cannot be enabled on import, because we need to setup the HCI adapter first. #if !CIRCUITPY_BLEIO_HCI - // HCI cannot be enabled on import, because we need to setup the HCI adapter first. common_hal_bleio_adapter_set_enabled(&common_hal_bleio_adapter_obj, true); #endif return mp_const_none; @@ -117,6 +117,74 @@ STATIC mp_obj_t bleio___init__(void) { STATIC MP_DEFINE_CONST_FUN_OBJ_0(bleio___init___obj, bleio___init__); +// Need a forward reference due to mutual references. +#if CIRCUITPY_BLEIO_HCI +STATIC mp_obj_dict_t bleio_module_globals; +#endif + +//| def set_adapter(adapter: Optional[_bleio.Adapter]) -> None: +//| """Set the adapter to use for BLE. Not settable when the adapter is a singleton.""" +//| ... +//| +mp_obj_t bleio_set_adapter(mp_obj_t adapter_obj) { +#if CIRCUITPY_BLEIO_HCI + if (adapter_obj != mp_const_none && !MP_OBJ_IS_TYPE(adapter_obj, &bleio_adapter_type)) { + mp_raise_TypeError_varg(translate("Expected a %q"), bleio_adapter_type.name); + } + + // Equivalent of: + // bleio.adapter = adapter_obj + mp_map_elem_t *elem = mp_map_lookup(&bleio_module_globals.map, MP_ROM_QSTR(MP_QSTR_adapter), MP_MAP_LOOKUP); + if (elem) { + elem->value = adapter_obj; + } +#else + mp_raise_NotImplementedError(translate("Not settable")); +#endif + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(bleio_set_adapter_obj, bleio_set_adapter); + +#if CIRCUITPY_BLEIO_HCI +// Make the module dictionary be in RAM, so that _bleio.adapter can be set. + +STATIC mp_map_elem_t bleio_module_globals_table[] = { + // Name must be the first entry so that the exception printing below is correct. + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__bleio) }, + { MP_ROM_QSTR(MP_QSTR_Adapter), MP_OBJ_FROM_PTR(&bleio_adapter_type) }, + { MP_ROM_QSTR(MP_QSTR_Address), MP_OBJ_FROM_PTR(&bleio_address_type) }, + { MP_ROM_QSTR(MP_QSTR_Attribute), MP_OBJ_FROM_PTR(&bleio_attribute_type) }, + { MP_ROM_QSTR(MP_QSTR_Connection), MP_OBJ_FROM_PTR(&bleio_connection_type) }, + { MP_ROM_QSTR(MP_QSTR_Characteristic), MP_OBJ_FROM_PTR(&bleio_characteristic_type) }, + { MP_ROM_QSTR(MP_QSTR_CharacteristicBuffer), MP_OBJ_FROM_PTR(&bleio_characteristic_buffer_type) }, + { MP_ROM_QSTR(MP_QSTR_Descriptor), MP_OBJ_FROM_PTR(&bleio_descriptor_type) }, + { MP_ROM_QSTR(MP_QSTR_PacketBuffer), MP_OBJ_FROM_PTR(&bleio_packet_buffer_type) }, + { MP_ROM_QSTR(MP_QSTR_ScanEntry), MP_OBJ_FROM_PTR(&bleio_scanentry_type) }, + { MP_ROM_QSTR(MP_QSTR_ScanResults), MP_OBJ_FROM_PTR(&bleio_scanresults_type) }, + { MP_ROM_QSTR(MP_QSTR_Service), MP_OBJ_FROM_PTR(&bleio_service_type) }, + { MP_ROM_QSTR(MP_QSTR_UUID), MP_OBJ_FROM_PTR(&bleio_uuid_type) }, + + // Attributes + { MP_ROM_QSTR(MP_QSTR_adapter), mp_const_none }, + + // Functions + { MP_ROM_QSTR(MP_QSTR_set_adapter), (mp_obj_t) &bleio_set_adapter_obj }, + + // Errors + { MP_ROM_QSTR(MP_QSTR_BluetoothError), MP_OBJ_FROM_PTR(&mp_type_bleio_BluetoothError) }, + { MP_ROM_QSTR(MP_QSTR_ConnectionError), MP_OBJ_FROM_PTR(&mp_type_bleio_ConnectionError) }, + { MP_ROM_QSTR(MP_QSTR_RoleError), MP_OBJ_FROM_PTR(&mp_type_bleio_RoleError) }, + { MP_ROM_QSTR(MP_QSTR_SecurityError), MP_OBJ_FROM_PTR(&mp_type_bleio_SecurityError) }, + + // Initialization + { MP_ROM_QSTR(MP_QSTR___init__), MP_OBJ_FROM_PTR(&bleio___init___obj) }, +}; + +STATIC MP_DEFINE_MUTABLE_DICT(bleio_module_globals, bleio_module_globals_table); + +#else +// When _bleio.adapter is a singleton, and can't be set. + STATIC const mp_rom_map_elem_t bleio_module_globals_table[] = { // Name must be the first entry so that the exception printing below is correct. { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__bleio) }, @@ -144,10 +212,10 @@ STATIC const mp_rom_map_elem_t bleio_module_globals_table[] = { // Initialization { MP_ROM_QSTR(MP_QSTR___init__), MP_ROM_PTR(&bleio___init___obj) }, - }; STATIC MP_DEFINE_CONST_DICT(bleio_module_globals, bleio_module_globals_table); +#endif void bleio_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) { mp_print_kind_t k = kind & ~PRINT_EXC_SUBCLASS; diff --git a/shared-bindings/_bleio/__init__.h b/shared-bindings/_bleio/__init__.h index 969d2efb1c..588b1f1973 100644 --- a/shared-bindings/_bleio/__init__.h +++ b/shared-bindings/_bleio/__init__.h @@ -55,11 +55,14 @@ extern const mp_obj_type_t mp_type_bleio_ConnectionError; extern const mp_obj_type_t mp_type_bleio_RoleError; extern const mp_obj_type_t mp_type_bleio_SecurityError; +extern mp_obj_t bleio_set_adapter(mp_obj_t adapter_obj); + NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* msg, ...); NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* msg, ...); NORETURN void mp_raise_bleio_RoleError(const compressed_string_t* msg); NORETURN void mp_raise_bleio_SecurityError(const compressed_string_t* msg, ...); +bleio_adapter_obj_t *common_hal_bleio_allocate_adapter_or_raise(void); void common_hal_bleio_check_connected(uint16_t conn_handle); uint16_t common_hal_bleio_device_get_conn_handle(mp_obj_t device); diff --git a/shared-bindings/usb_midi/__init__.c b/shared-bindings/usb_midi/__init__.c index e61086f84f..d88a0db48d 100644 --- a/shared-bindings/usb_midi/__init__.c +++ b/shared-bindings/usb_midi/__init__.c @@ -51,17 +51,7 @@ mp_map_elem_t usb_midi_module_globals_table[] = { }; // This isn't const so we can set ports dynamically. -mp_obj_dict_t usb_midi_module_globals = { - .base = {&mp_type_dict}, - .map = { - .all_keys_are_qstrs = 1, - .is_fixed = 1, - .is_ordered = 1, - .used = MP_ARRAY_SIZE(usb_midi_module_globals_table), - .alloc = MP_ARRAY_SIZE(usb_midi_module_globals_table), - .table = usb_midi_module_globals_table, - }, -}; +MP_DEFINE_MUTABLE_DICT(usb_midi_module_globals, usb_midi_module_globals_table); const mp_obj_module_t usb_midi_module = { .base = { &mp_type_module }, From aeeec581780bf1d7486b51b3b6f2de396941f73f Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Wed, 26 Aug 2020 23:31:33 +0000 Subject: [PATCH 0749/1293] Translated using Weblate (Swedish) Currently translated at 99.8% (776 of 777 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 70 ++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index df205b1095..a72f8b4fbc 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: 2020-08-18 11:19-0400\n" -"PO-Revision-Date: 2020-07-25 20:58+0000\n" +"PO-Revision-Date: 2020-08-30 18:28+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.2-dev\n" +"X-Generator: Weblate 4.2.1-dev\n" #: main.c msgid "" @@ -82,7 +82,7 @@ msgstr "Index %q ligger utanför intervallet" #: py/obj.c msgid "%q indices must be integers, not %q" -msgstr "" +msgstr "%q index måste vara heltal, inte %q" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -122,39 +122,39 @@ msgstr "'%q' argument krävs" #: py/runtime.c msgid "'%q' object cannot assign attribute '%q'" -msgstr "" +msgstr "Objektet '%q' kan inte tilldela attributet '%q'" #: py/proto.c msgid "'%q' object does not support '%q'" -msgstr "" +msgstr "Objektet '%q' stöder inte '%q'" #: py/obj.c msgid "'%q' object does not support item assignment" -msgstr "" +msgstr "Objektet '%q' stöder inte tilldelning" #: py/obj.c msgid "'%q' object does not support item deletion" -msgstr "" +msgstr "Objektet '%q' stöder inte borttagning av objekt" #: py/runtime.c msgid "'%q' object has no attribute '%q'" -msgstr "" +msgstr "Objektet '%q' har inget attribut '%q'" #: py/runtime.c msgid "'%q' object is not an iterator" -msgstr "" +msgstr "Objektet '%q' är inte en iterator" #: py/objtype.c py/runtime.c msgid "'%q' object is not callable" -msgstr "" +msgstr "Objektet '%q' kan inte anropas" #: py/runtime.c msgid "'%q' object is not iterable" -msgstr "" +msgstr "Objektet '%q' är inte itererbart" #: py/obj.c msgid "'%q' object is not subscriptable" -msgstr "" +msgstr "Objektet '%q' är inte indexbar" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -224,7 +224,7 @@ msgstr "'await' utanför funktion" #: py/compile.c msgid "'await', 'async for' or 'async with' outside async function" -msgstr "" +msgstr "'await', 'async for' eller 'async with' utanför asynk-funktion" #: py/compile.c msgid "'break' outside loop" @@ -457,7 +457,7 @@ msgstr "Buffertlängd måste vara en multipel av 512" #: ports/stm/common-hal/sdioio/SDCard.c msgid "Buffer must be a multiple of 512 bytes" -msgstr "" +msgstr "Bufferten måste vara en multipel av 512 byte" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -657,7 +657,7 @@ msgstr "Det gick inte att starta om PWM" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" -msgstr "" +msgstr "Kan inte ange adress" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" @@ -844,7 +844,7 @@ msgstr "Filen finns redan" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" -msgstr "" +msgstr "Framebuffer kräver %d byte" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." @@ -888,7 +888,7 @@ msgstr "I2C init-fel" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" -msgstr "" +msgstr "I2SOut är inte tillgängligt" #: shared-bindings/aesio/aes.c #, c-format @@ -940,7 +940,7 @@ msgstr "Ogiltig %q-pinne" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c #: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" -msgstr "" +msgstr "Ogiltigt val av % q pinne" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" @@ -1258,7 +1258,7 @@ msgstr "Ingen uppspelning" #: main.c msgid "Not running saved code.\n" -msgstr "" +msgstr "Kör inte sparad kod.\n" #: shared-bindings/util.c msgid "" @@ -1442,7 +1442,7 @@ msgstr "Radvärdet måste vara digitalio.DigitalInOut" #: main.c msgid "Running in safe mode! " -msgstr "" +msgstr "Kör i säkert läge! " #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1456,12 +1456,12 @@ msgstr "SDA eller SCL behöver en pullup" #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" -msgstr "" +msgstr "SDIO GetCardInfo-fel %d" #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO Init Error %d" -msgstr "" +msgstr "SDIO Init-fel %d" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" @@ -1831,7 +1831,7 @@ msgstr "__init __ () ska returnera None" #: py/objtype.c msgid "__init__() should return None, not '%q'" -msgstr "" +msgstr "__init__() ska returnera None, inte '%q'" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -1876,7 +1876,7 @@ msgstr "argumentet har fel typ" #: extmod/ulab/code/linalg/linalg.c msgid "argument must be ndarray" -msgstr "" +msgstr "argument måste vara ndarray" #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c @@ -2019,7 +2019,7 @@ msgstr "kan inte tilldela uttryck" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c #: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" -msgstr "" +msgstr "kan inte konvertera %q till %q" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" @@ -2027,7 +2027,7 @@ msgstr "kan inte konvertera '%q' objekt implicit till %q" #: py/obj.c msgid "can't convert to %q" -msgstr "" +msgstr "kan inte konvertera till %q" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2848,7 +2848,7 @@ msgstr "antal punkter måste vara minst 2" #: py/obj.c msgid "object '%q' is not a tuple or list" -msgstr "" +msgstr "objektet '%q' är inte en tuple eller list" #: py/obj.c msgid "object does not support item assignment" @@ -2884,7 +2884,7 @@ msgstr "objektet är inte iterable" #: py/obj.c msgid "object of type '%q' has no len()" -msgstr "" +msgstr "objekt av typen '%q' har inte len()" #: py/obj.c msgid "object with buffer protocol required" @@ -2980,7 +2980,7 @@ msgstr "polygon kan endast registreras i en förälder" #: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c #: shared-bindings/ps2io/Ps2.c msgid "pop from empty %q" -msgstr "" +msgstr "pop från tom %q" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3139,7 +3139,7 @@ msgstr "stream-åtgärd stöds inte" #: py/objstrunicode.c msgid "string indices must be integers, not %q" -msgstr "" +msgstr "strängindex måste vara heltal, inte %q" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3216,7 +3216,7 @@ msgstr "för många värden att packa upp (förväntat %d)" #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" -msgstr "" +msgstr "trapz är definierad för 1D-matriser med samma längd" #: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" @@ -3282,7 +3282,7 @@ msgstr "okänd konverteringsspecificerare %c" #: py/objstr.c msgid "unknown format code '%c' for object of type '%q'" -msgstr "" +msgstr "okänd formatkod '%c' för objekt av typ '%q'" #: py/compile.c msgid "unknown type" @@ -3322,7 +3322,7 @@ msgstr "Formattecknet '%c' (0x%x) stöds inte vid index %d" #: py/runtime.c msgid "unsupported type for %q: '%q'" -msgstr "" +msgstr "typen %q stöder inte '%q'" #: py/runtime.c msgid "unsupported type for operator" @@ -3330,7 +3330,7 @@ msgstr "typ stöds inte för operatören" #: py/runtime.c msgid "unsupported types for %q: '%q', '%q'" -msgstr "" +msgstr "typen %q stöder inte '%q', '%q'" #: py/objint.c #, c-format @@ -3343,7 +3343,7 @@ msgstr "value_count måste vara > 0" #: extmod/ulab/code/linalg/linalg.c msgid "vectors must have same lengths" -msgstr "" +msgstr "vektorer måste ha samma längd" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" From 6b506ab0adefb0a71b0a343df2cbf309c53ecb31 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Sun, 30 Aug 2020 20:28:56 +0200 Subject: [PATCH 0750/1293] 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 | 60 +++++++++++++++++++-------------- locale/cs.po | 60 +++++++++++++++++++-------------- locale/de_DE.po | 60 +++++++++++++++++++-------------- locale/es.po | 60 +++++++++++++++++++-------------- locale/fil.po | 60 +++++++++++++++++++-------------- locale/fr.po | 60 +++++++++++++++++++-------------- locale/hi.po | 60 +++++++++++++++++++-------------- locale/it_IT.po | 60 +++++++++++++++++++-------------- locale/ja.po | 60 +++++++++++++++++++-------------- locale/ko.po | 60 +++++++++++++++++++-------------- locale/nl.po | 60 +++++++++++++++++++-------------- locale/pl.po | 60 +++++++++++++++++++-------------- locale/pt_BR.po | 71 +++++++++++++++++++++++++--------------- locale/sv.po | 60 +++++++++++++++++++-------------- locale/zh_Latn_pinyin.po | 60 +++++++++++++++++++-------------- 15 files changed, 549 insertions(+), 362 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index ec5b6f6e86..6b2ef5f266 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-18 11:19-0400\n" +"POT-Creation-Date: 2020-08-27 11:21-0400\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -308,7 +308,7 @@ msgstr "Semua channel event sedang digunakan" msgid "All sync event channels in use" msgstr "Semua channel event yang disinkronisasi sedang digunakan" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" msgstr "Semua timer untuk pin ini sedang digunakan" @@ -320,7 +320,7 @@ msgstr "Semua timer untuk pin ini sedang digunakan" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" msgstr "Semua timer sedang digunakan" @@ -566,7 +566,7 @@ msgstr "Tidak dapat transfer tanpa pin MOSI dan MISO." msgid "Cannot unambiguously get sizeof scalar" msgstr "tidak dapat mendapatkan ukuran scalar secara tidak ambigu" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" "Tidak dapat membuat variasi frekuensi pada penghitung waktu yang sudah " @@ -640,23 +640,23 @@ msgstr "" msgid "Could not initialize UART" msgstr "Tidak dapat menginisialisasi UART" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "Tidak dapat menginisialisasi kanal" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "Tidak dapat menginisialisasi timer" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" msgstr "Tidak dapat menginisialisasi ulang kanal" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" msgstr "Tidak dapat menginisialisasi ulang timer" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" msgstr "Tidak dapat memulai ulang PWM" @@ -664,7 +664,7 @@ msgstr "Tidak dapat memulai ulang PWM" msgid "Could not set address" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" msgstr "Tidak dapat memulai PWM" @@ -857,7 +857,7 @@ msgid "Frequency captured is above capability. Capture Paused." msgstr "" "Frekuensi yang ditangkap berada di atas kemampuan. Penangkapan Ditunda." -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "Frekuensi harus cocok dengan PWMOut yang ada menggunakan timer ini" @@ -961,9 +961,9 @@ msgstr "File BMP tidak valid" msgid "Invalid DAC pin supplied" msgstr "Pin DAC yang diberikan tidak valid" -#: ports/atmel-samd/common-hal/pulseio/PWMOut.c -#: ports/cxd56/common-hal/pulseio/PWMOut.c -#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Frekuensi PWM tidak valid" @@ -1003,7 +1003,7 @@ msgstr "File tidak valid" msgid "Invalid format chunk size" msgstr "Ukuran potongan format tidak valid" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "Frekuensi yang diberikan tidak valid" @@ -1021,8 +1021,8 @@ msgid "Invalid phase" msgstr "Fase tidak valid" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Pin tidak valid" @@ -1046,7 +1046,7 @@ msgstr "Pin untuk channel kanan tidak valid" msgid "Invalid pins" msgstr "Pin-pin tidak valid" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" msgstr "Pin untuk PWMOut tidak valid" @@ -1228,7 +1228,7 @@ msgstr "" msgid "No long integer support" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1297,12 +1297,12 @@ msgstr "" msgid "Oversample must be multiple of 8." msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" @@ -1357,8 +1357,8 @@ msgstr "" #: ports/nrf/common-hal/pulseio/PulseOut.c #: ports/stm/common-hal/pulseio/PulseOut.c msgid "" -"Port does not accept pins or frequency. " -"Construct and pass a PWMOut Carrier instead" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" msgstr "" #: shared-bindings/_bleio/Adapter.c @@ -1591,7 +1591,7 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" @@ -2915,6 +2915,14 @@ msgstr "" msgid "ord() expected a character, but string of length %d found" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "" @@ -3092,6 +3100,10 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index b353f46306..4d13478eb1 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-18 11:19-0400\n" +"POT-Creation-Date: 2020-08-27 11:21-0400\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -308,7 +308,7 @@ msgstr "" msgid "All sync event channels in use" msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" msgstr "" @@ -320,7 +320,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" msgstr "" @@ -558,7 +558,7 @@ msgstr "" msgid "Cannot unambiguously get sizeof scalar" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" @@ -627,23 +627,23 @@ msgstr "" msgid "Could not initialize UART" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" msgstr "" @@ -651,7 +651,7 @@ msgstr "" msgid "Could not set address" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" msgstr "" @@ -842,7 +842,7 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -944,9 +944,9 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PWMOut.c -#: ports/cxd56/common-hal/pulseio/PWMOut.c -#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "Invalid PWM frequency" msgstr "" @@ -986,7 +986,7 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "" @@ -1004,8 +1004,8 @@ msgid "Invalid phase" msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "" @@ -1029,7 +1029,7 @@ msgstr "" msgid "Invalid pins" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" msgstr "" @@ -1211,7 +1211,7 @@ msgstr "" msgid "No long integer support" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1279,12 +1279,12 @@ msgstr "" msgid "Oversample must be multiple of 8." msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" @@ -1339,8 +1339,8 @@ msgstr "" #: ports/nrf/common-hal/pulseio/PulseOut.c #: ports/stm/common-hal/pulseio/PulseOut.c msgid "" -"Port does not accept pins or frequency. " -"Construct and pass a PWMOut Carrier instead" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" msgstr "" #: shared-bindings/_bleio/Adapter.c @@ -1570,7 +1570,7 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" @@ -2885,6 +2885,14 @@ msgstr "" msgid "ord() expected a character, but string of length %d found" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "" @@ -3062,6 +3070,10 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 87cca4a77f..6be135ebdf 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-18 11:19-0400\n" +"POT-Creation-Date: 2020-08-27 11:21-0400\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -307,7 +307,7 @@ msgstr "Alle event Kanäle werden benutzt" msgid "All sync event channels in use" msgstr "Alle sync event Kanäle werden benutzt" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" msgstr "Alle timer für diesen Pin werden bereits benutzt" @@ -319,7 +319,7 @@ msgstr "Alle timer für diesen Pin werden bereits benutzt" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" msgstr "Alle timer werden benutzt" @@ -562,7 +562,7 @@ msgstr "Übertragung ohne MOSI- und MISO-Pins nicht möglich." msgid "Cannot unambiguously get sizeof scalar" msgstr "sizeof scalar kann nicht eindeutig bestimmt werden" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" "Die Frequenz eines bereits verwendeten Timers kann nicht variiert werden" @@ -637,23 +637,23 @@ msgstr "" msgid "Could not initialize UART" msgstr "Konnte UART nicht initialisieren" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "Kanal konnte nicht initialisiert werden" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "Timer konnte nicht initialisiert werden" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" msgstr "Kanal konnte nicht neu initiiert werden" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" msgstr "Timer konnte nicht neu gestartet werden" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" msgstr "PWM konnte nicht neu gestartet werden" @@ -661,7 +661,7 @@ msgstr "PWM konnte nicht neu gestartet werden" msgid "Could not set address" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" msgstr "PWM konnte nicht gestartet werden" @@ -855,7 +855,7 @@ msgstr "" "Die aufgezeichnete Frequenz liegt über der Leistungsgrenze. Aufnahme " "angehalten." -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" "Die Frequenz muss mit dem vorhandenen PWMOut unter Verwendung dieses Timers " @@ -961,9 +961,9 @@ msgstr "Ungültige BMP-Datei" msgid "Invalid DAC pin supplied" msgstr "Ungültiger DAC-Pin angegeben" -#: ports/atmel-samd/common-hal/pulseio/PWMOut.c -#: ports/cxd56/common-hal/pulseio/PWMOut.c -#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Ungültige PWM Frequenz" @@ -1003,7 +1003,7 @@ msgstr "Ungültige Datei" msgid "Invalid format chunk size" msgstr "Ungültige format chunk size" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "Ungültige Frequenz geliefert" @@ -1021,8 +1021,8 @@ msgid "Invalid phase" msgstr "Ungültige Phase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Ungültiger Pin" @@ -1046,7 +1046,7 @@ msgstr "Ungültiger Pin für rechten Kanal" msgid "Invalid pins" msgstr "Ungültige Pins" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" msgstr "Ungültige Pins für PWMOut" @@ -1230,7 +1230,7 @@ msgstr "Es wurde kein Schlüssel angegeben" msgid "No long integer support" msgstr "Keine langen Integer (long) unterstützt" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "An diesem Pin sind keine Timer mehr verfügbar." @@ -1304,12 +1304,12 @@ msgstr "" msgid "Oversample must be multiple of 8." msgstr "Oversample muss ein Vielfaches von 8 sein." -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "PWM duty_cycle muss zwischen 0 und 65535 (16 Bit Auflösung) liegen" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "Die PWM-Frequenz ist nicht schreibbar wenn variable_Frequenz = False." @@ -1367,8 +1367,8 @@ msgstr "Polygone brauchen mindestens 3 Punkte" #: ports/nrf/common-hal/pulseio/PulseOut.c #: ports/stm/common-hal/pulseio/PulseOut.c msgid "" -"Port does not accept pins or frequency. " -"Construct and pass a PWMOut Carrier instead" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" msgstr "" #: shared-bindings/_bleio/Adapter.c @@ -1612,7 +1612,7 @@ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" "Zeitbeschränkung ist zu groß: Maximale Zeitbeschränkung ist %d Sekunden" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" @@ -2966,6 +2966,14 @@ msgstr "" "ord() erwartet einen Buchstaben(char) aber es wurde ein String mit Länge %d " "gefunden" +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "Überlauf beim konvertieren von long int zu machine word" @@ -3145,6 +3153,10 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start/end Indizes" diff --git a/locale/es.po b/locale/es.po index 882904f640..2820d01a82 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-18 11:19-0400\n" +"POT-Creation-Date: 2020-08-27 11:21-0400\n" "PO-Revision-Date: 2020-08-17 21:11+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -313,7 +313,7 @@ msgstr "" "Todos los canales de eventos de sincronización (sync event channels) están " "siendo utilizados" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" msgstr "Todos los timers para este pin están siendo utilizados" @@ -325,7 +325,7 @@ msgstr "Todos los timers para este pin están siendo utilizados" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" msgstr "Todos los timers en uso" @@ -569,7 +569,7 @@ msgstr "No se puede transmitir sin pines MOSI y MISO." msgid "Cannot unambiguously get sizeof scalar" msgstr "No se puede obtener inequívocamente sizeof escalar" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "No puede variar la frecuencia en un temporizador que ya está en uso" @@ -642,23 +642,23 @@ msgstr "No se pudo inicializar SDCard" msgid "Could not initialize UART" msgstr "No se puede inicializar la UART" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "No se pudo inicializar el canal" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "No se pudo inicializar el temporizador" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" msgstr "No se pudo reiniciar el canal" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" msgstr "No se pudo reiniciar el temporizador" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" msgstr "No se pudo reiniciar el PWM" @@ -666,7 +666,7 @@ msgstr "No se pudo reiniciar el PWM" msgid "Could not set address" msgstr "No se puede definir la dirección" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" msgstr "No se pudo iniciar el PWM" @@ -857,7 +857,7 @@ msgstr "Framebuffer requiere %d bytes" msgid "Frequency captured is above capability. Capture Paused." msgstr "Frecuencia capturada por encima de la capacidad. Captura en pausa." -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" "La frecuencia debe coincidir con PWMOut existente usando este temporizador" @@ -962,9 +962,9 @@ msgstr "Archivo BMP inválido" msgid "Invalid DAC pin supplied" msgstr "Pin suministrado inválido para DAC" -#: ports/atmel-samd/common-hal/pulseio/PWMOut.c -#: ports/cxd56/common-hal/pulseio/PWMOut.c -#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Frecuencia PWM inválida" @@ -1004,7 +1004,7 @@ msgstr "Archivo inválido" msgid "Invalid format chunk size" msgstr "Formato de fragmento de formato no válido" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "Frecuencia suministrada no válida" @@ -1022,8 +1022,8 @@ msgid "Invalid phase" msgstr "Fase inválida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Pin inválido" @@ -1047,7 +1047,7 @@ msgstr "Pin inválido para canal derecho" msgid "Invalid pins" msgstr "pines inválidos" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" msgstr "Pines inválidos para PWMOut" @@ -1229,7 +1229,7 @@ msgstr "No se especificó ninguna llave" msgid "No long integer support" msgstr "No hay soporte de entero largo" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "No hay más temporizadores disponibles en este pin." @@ -1303,12 +1303,12 @@ msgstr "" msgid "Oversample must be multiple of 8." msgstr "El sobremuestreo debe ser un múltiplo de 8." -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "PWM duty_cycle debe ser entre 0 y 65535 inclusivo (16 bit resolution)" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" @@ -1367,8 +1367,8 @@ msgstr "El polígono necesita al menos 3 puntos" #: ports/nrf/common-hal/pulseio/PulseOut.c #: ports/stm/common-hal/pulseio/PulseOut.c msgid "" -"Port does not accept pins or frequency. " -"Construct and pass a PWMOut Carrier instead" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" msgstr "" #: shared-bindings/_bleio/Adapter.c @@ -1610,7 +1610,7 @@ msgstr "" "Tiempo de espera demasiado largo: El tiempo máximo de espera es de %d " "segundos" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" @@ -2952,6 +2952,14 @@ msgstr "ord espera un carácter" msgid "ord() expected a character, but string of length %d found" msgstr "ord() espera un carácter, pero encontró un string de longitud %d" +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "desbordamiento convirtiendo long int a palabra de máquina" @@ -3131,6 +3139,10 @@ msgstr "sos[:, 3] deberían ser todos unos" msgid "sosfilt requires iterable arguments" msgstr "sosfilt requiere argumentos iterables" +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "índices inicio/final" diff --git a/locale/fil.po b/locale/fil.po index ec4f9f6856..60be99da76 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-18 11:19-0400\n" +"POT-Creation-Date: 2020-08-27 11:21-0400\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -304,7 +304,7 @@ msgstr "Lahat ng event channels ginagamit" msgid "All sync event channels in use" msgstr "Lahat ng sync event channels ay ginagamit" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" msgstr "Lahat ng timers para sa pin na ito ay ginagamit" @@ -316,7 +316,7 @@ msgstr "Lahat ng timers para sa pin na ito ay ginagamit" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" msgstr "Lahat ng timer ginagamit" @@ -558,7 +558,7 @@ msgstr "Hindi maaaring ilipat kapag walang MOSI at MISO pin." msgid "Cannot unambiguously get sizeof scalar" msgstr "Hindi puedeng hindi sigurado ang get sizeof scalar" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" @@ -628,23 +628,23 @@ msgstr "" msgid "Could not initialize UART" msgstr "Hindi ma-initialize ang UART" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" msgstr "" @@ -652,7 +652,7 @@ msgstr "" msgid "Could not set address" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" msgstr "" @@ -848,7 +848,7 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -952,9 +952,9 @@ msgstr "Mali ang BMP file" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PWMOut.c -#: ports/cxd56/common-hal/pulseio/PWMOut.c -#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Mali ang PWM frequency" @@ -994,7 +994,7 @@ msgstr "Mali ang file" msgid "Invalid format chunk size" msgstr "Mali ang format ng chunk size" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "" @@ -1012,8 +1012,8 @@ msgid "Invalid phase" msgstr "Mali ang phase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Mali ang pin" @@ -1037,7 +1037,7 @@ msgstr "Mali ang pin para sa kanang channel" msgid "Invalid pins" msgstr "Mali ang pins" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" msgstr "" @@ -1219,7 +1219,7 @@ msgstr "" msgid "No long integer support" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1290,12 +1290,12 @@ msgstr "" msgid "Oversample must be multiple of 8." msgstr "Oversample ay dapat multiple ng 8." -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "PWM duty_cycle ay dapat sa loob ng 0 at 65535 (16 bit resolution)" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" @@ -1351,8 +1351,8 @@ msgstr "" #: ports/nrf/common-hal/pulseio/PulseOut.c #: ports/stm/common-hal/pulseio/PulseOut.c msgid "" -"Port does not accept pins or frequency. " -"Construct and pass a PWMOut Carrier instead" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" msgstr "" #: shared-bindings/_bleio/Adapter.c @@ -1585,7 +1585,7 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" @@ -2928,6 +2928,14 @@ msgstr "ord umaasa ng character" msgid "ord() expected a character, but string of length %d found" msgstr "ord() umaasa ng character pero string ng %d haba ang nakita" +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "overflow nagcoconvert ng long int sa machine word" @@ -3108,6 +3116,10 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start/end indeks" diff --git a/locale/fr.po b/locale/fr.po index 0562053f15..043fe6cf23 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-18 11:19-0400\n" +"POT-Creation-Date: 2020-08-27 11:21-0400\n" "PO-Revision-Date: 2020-07-27 21:27+0000\n" "Last-Translator: Nathan \n" "Language: fr\n" @@ -312,7 +312,7 @@ msgstr "Tous les canaux d'événements sont utilisés" msgid "All sync event channels in use" msgstr "Tous les canaux d'événements de synchro sont utilisés" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" msgstr "Tous les timers pour cette broche sont utilisés" @@ -324,7 +324,7 @@ msgstr "Tous les timers pour cette broche sont utilisés" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" msgstr "Tous les timers sont utilisés" @@ -570,7 +570,7 @@ msgstr "Pas de transfert sans broches MOSI et MISO." msgid "Cannot unambiguously get sizeof scalar" msgstr "Impossible d'obtenir la taille du scalaire sans ambigüité" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" "Impossible de faire varier la fréquence sur une minuterie déjà utilisée" @@ -645,23 +645,23 @@ msgstr "Impossible d'initialiser la carte SD" msgid "Could not initialize UART" msgstr "L'UART n'a pu être initialisé" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "Impossible d'initialiser la chaîne" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "Impossible d'initialiser la minuterie" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" msgstr "Impossible de réinitialiser la chaîne" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" msgstr "Impossible de réinitialiser le minuteur" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" msgstr "Impossible de redémarrer PWM" @@ -669,7 +669,7 @@ msgstr "Impossible de redémarrer PWM" msgid "Could not set address" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" msgstr "Impossible de démarrer PWM" @@ -861,7 +861,7 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "La fréquence capturée est au delà des capacités. Capture en pause." -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" "La fréquence doit correspondre à PWMOut existant à l'aide de cette minuterie" @@ -966,9 +966,9 @@ msgstr "Fichier BMP invalide" msgid "Invalid DAC pin supplied" msgstr "Broche DAC non valide fournie" -#: ports/atmel-samd/common-hal/pulseio/PWMOut.c -#: ports/cxd56/common-hal/pulseio/PWMOut.c -#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Fréquence de PWM invalide" @@ -1008,7 +1008,7 @@ msgstr "Fichier invalide" msgid "Invalid format chunk size" msgstr "Taille de bloc de formatage invalide" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "Fréquence invalide fournie" @@ -1026,8 +1026,8 @@ msgid "Invalid phase" msgstr "Phase invalide" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Broche invalide" @@ -1051,7 +1051,7 @@ msgstr "Broche invalide pour le canal droit" msgid "Invalid pins" msgstr "Broches invalides" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" msgstr "Broches non valides pour PWMOut" @@ -1233,7 +1233,7 @@ msgstr "Aucune clé n'a été spécifiée" msgid "No long integer support" msgstr "Pas de support entier long" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "Plus de minuteurs disponibles sur cette broche." @@ -1307,14 +1307,14 @@ msgstr "" msgid "Oversample must be multiple of 8." msgstr "Le sur-échantillonage doit être un multiple de 8." -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "" "La valeur de cycle PWM doit être entre 0 et 65535 inclus (résolution de 16 " "bits)" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" @@ -1374,8 +1374,8 @@ msgstr "Polygone a besoin d’au moins 3 points" #: ports/nrf/common-hal/pulseio/PulseOut.c #: ports/stm/common-hal/pulseio/PulseOut.c msgid "" -"Port does not accept pins or frequency. " -"Construct and pass a PWMOut Carrier instead" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" msgstr "" #: shared-bindings/_bleio/Adapter.c @@ -1614,7 +1614,7 @@ msgstr "La largeur de la tuile doit diviser exactement la largeur de l'image" 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" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" @@ -2972,6 +2972,14 @@ msgstr "" "ord() attend un caractère mais une chaîne de caractère de longueur %d a été " "trouvée" +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "dépassement de capacité en convertissant un entier long en mot machine" @@ -3152,6 +3160,10 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "indices de début/fin" diff --git a/locale/hi.po b/locale/hi.po index 50a1887f67..717d21a275 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-18 11:19-0400\n" +"POT-Creation-Date: 2020-08-27 11:21-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -301,7 +301,7 @@ msgstr "" msgid "All sync event channels in use" msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" msgstr "" @@ -313,7 +313,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" msgstr "" @@ -551,7 +551,7 @@ msgstr "" msgid "Cannot unambiguously get sizeof scalar" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" @@ -620,23 +620,23 @@ msgstr "" msgid "Could not initialize UART" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" msgstr "" @@ -644,7 +644,7 @@ msgstr "" msgid "Could not set address" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" msgstr "" @@ -835,7 +835,7 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -937,9 +937,9 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PWMOut.c -#: ports/cxd56/common-hal/pulseio/PWMOut.c -#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "Invalid PWM frequency" msgstr "" @@ -979,7 +979,7 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "" @@ -997,8 +997,8 @@ msgid "Invalid phase" msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "" @@ -1022,7 +1022,7 @@ msgstr "" msgid "Invalid pins" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" msgstr "" @@ -1204,7 +1204,7 @@ msgstr "" msgid "No long integer support" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1272,12 +1272,12 @@ msgstr "" msgid "Oversample must be multiple of 8." msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" @@ -1332,8 +1332,8 @@ msgstr "" #: ports/nrf/common-hal/pulseio/PulseOut.c #: ports/stm/common-hal/pulseio/PulseOut.c msgid "" -"Port does not accept pins or frequency. " -"Construct and pass a PWMOut Carrier instead" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" msgstr "" #: shared-bindings/_bleio/Adapter.c @@ -1563,7 +1563,7 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" @@ -2878,6 +2878,14 @@ msgstr "" msgid "ord() expected a character, but string of length %d found" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "" @@ -3055,6 +3063,10 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 9635220af3..c4214a1500 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-18 11:19-0400\n" +"POT-Creation-Date: 2020-08-27 11:21-0400\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -303,7 +303,7 @@ msgstr "Tutti i canali eventi utilizati" msgid "All sync event channels in use" msgstr "Tutti i canali di eventi sincronizzati in uso" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" msgstr "Tutti i timer per questo pin sono in uso" @@ -315,7 +315,7 @@ msgstr "Tutti i timer per questo pin sono in uso" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" msgstr "Tutti i timer utilizzati" @@ -559,7 +559,7 @@ msgstr "Impossibile trasferire senza i pin MOSI e MISO." msgid "Cannot unambiguously get sizeof scalar" msgstr "Impossibile ricavare la grandezza scalare di sizeof inequivocabilmente" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" @@ -629,23 +629,23 @@ msgstr "" msgid "Could not initialize UART" msgstr "Impossibile inizializzare l'UART" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" msgstr "" @@ -653,7 +653,7 @@ msgstr "" msgid "Could not set address" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" msgstr "" @@ -848,7 +848,7 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -952,9 +952,9 @@ msgstr "File BMP non valido" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PWMOut.c -#: ports/cxd56/common-hal/pulseio/PWMOut.c -#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Frequenza PWM non valida" @@ -996,7 +996,7 @@ msgstr "File non valido" msgid "Invalid format chunk size" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "" @@ -1014,8 +1014,8 @@ msgid "Invalid phase" msgstr "Fase non valida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Pin non valido" @@ -1039,7 +1039,7 @@ msgstr "Pin non valido per il canale destro" msgid "Invalid pins" msgstr "Pin non validi" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" msgstr "" @@ -1223,7 +1223,7 @@ msgstr "" msgid "No long integer support" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1295,14 +1295,14 @@ msgstr "" msgid "Oversample must be multiple of 8." msgstr "L'oversampling deve essere multiplo di 8." -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "" "duty_cycle del PWM deve essere compresa tra 0 e 65535 inclusiva (risoluzione " "a 16 bit)" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c #, fuzzy msgid "" "PWM frequency not writable when variable_frequency is False on construction." @@ -1361,8 +1361,8 @@ msgstr "" #: ports/nrf/common-hal/pulseio/PulseOut.c #: ports/stm/common-hal/pulseio/PulseOut.c msgid "" -"Port does not accept pins or frequency. " -"Construct and pass a PWMOut Carrier instead" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" msgstr "" #: shared-bindings/_bleio/Adapter.c @@ -1596,7 +1596,7 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" @@ -2934,6 +2934,14 @@ msgid "ord() expected a character, but string of length %d found" msgstr "" "ord() aspettava un carattere, ma ha ricevuto una stringa di lunghezza %d" +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "overflow convertendo long int in parola" @@ -3115,6 +3123,10 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 7c3b42580a..10e1d09a06 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-18 11:19-0400\n" +"POT-Creation-Date: 2020-08-27 11:21-0400\n" "PO-Revision-Date: 2020-08-16 13:25+0000\n" "Last-Translator: Taku Fukada \n" "Language-Team: none\n" @@ -311,7 +311,7 @@ msgstr "全てのイベントチャネルが使用中" msgid "All sync event channels in use" msgstr "全ての同期イベントチャネルが使用中" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" msgstr "このピン用の全てのタイマが使用中" @@ -323,7 +323,7 @@ msgstr "このピン用の全てのタイマが使用中" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" msgstr "全てのタイマーが使用中" @@ -565,7 +565,7 @@ msgstr "MOSIピンとMISOピンなしに転送できません" msgid "Cannot unambiguously get sizeof scalar" msgstr "スカラのサイズを曖昧さなしに取得できません" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "使用中のタイマー上で周波数を変えられません" @@ -636,23 +636,23 @@ msgstr "SDカードを初期化できません" msgid "Could not initialize UART" msgstr "UARTを初期化できません" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "チャネルを初期化できません" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "タイマーを初期化できません" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" msgstr "チャネルを再初期化できません" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" msgstr "タイマーを再初期化できません" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" msgstr "PWMを再スタートできません" @@ -660,7 +660,7 @@ msgstr "PWMを再スタートできません" msgid "Could not set address" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" msgstr "PWMをスタートできません" @@ -851,7 +851,7 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "このタイマーを使う既存のPWMOutと周波数を一致させてください" @@ -955,9 +955,9 @@ msgstr "不正なBMPファイル" msgid "Invalid DAC pin supplied" msgstr "無効なDACピンが与えられました" -#: ports/atmel-samd/common-hal/pulseio/PWMOut.c -#: ports/cxd56/common-hal/pulseio/PWMOut.c -#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "Invalid PWM frequency" msgstr "無効なPWM周波数" @@ -997,7 +997,7 @@ msgstr "不正なファイル" msgid "Invalid format chunk size" msgstr "フォーマットチャンクのサイズが不正" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "不正な周波数が与えられました" @@ -1015,8 +1015,8 @@ msgid "Invalid phase" msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "不正なピン" @@ -1040,7 +1040,7 @@ msgstr "右チャネルのピンが不正" msgid "Invalid pins" msgstr "ピンが不正" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" msgstr "PWMOutのピンが不正" @@ -1222,7 +1222,7 @@ msgstr "キーが指定されていません" msgid "No long integer support" msgstr "long integerサポートがありません" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "このピンに利用可能なタイマーがもうありません" @@ -1292,13 +1292,13 @@ msgstr "" msgid "Oversample must be multiple of 8." msgstr "オーバーサンプルは8の倍数でなければなりません" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "" "PWMの duty_cycle 値は 0 から 65535 の間でなければなりません(16ビット解像度)" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "PWM周波数は、生成時のvariable_frequencyがFalseのとき書き換え不可" @@ -1353,8 +1353,8 @@ msgstr "ポリゴンには少なくとも3つの点が必要" #: ports/nrf/common-hal/pulseio/PulseOut.c #: ports/stm/common-hal/pulseio/PulseOut.c msgid "" -"Port does not accept pins or frequency. " -"Construct and pass a PWMOut Carrier instead" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" msgstr "" #: shared-bindings/_bleio/Adapter.c @@ -1593,7 +1593,7 @@ msgstr "タイルの幅はビットマップの幅を割り切れる値でなけ msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "タイムアウトが長すぎ。最大のタイムアウト長は%d秒" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" @@ -2912,6 +2912,14 @@ msgstr "ord()は1文字を受け取ります" msgid "ord() expected a character, but string of length %d found" msgstr "ord()は1文字を要求しますが、長さ %d の文字列が与えられました" +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "long int をマシンの word に変換する際にオーバーフローしました" @@ -3091,6 +3099,10 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index ecf539946f..2404c561d0 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-18 11:19-0400\n" +"POT-Creation-Date: 2020-08-27 11:21-0400\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -302,7 +302,7 @@ msgstr "" msgid "All sync event channels in use" msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" msgstr "핀의 모든 타이머가 사용 중입니다" @@ -314,7 +314,7 @@ msgstr "핀의 모든 타이머가 사용 중입니다" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" msgstr "모든 타이머가 사용 중입니다" @@ -554,7 +554,7 @@ msgstr "" msgid "Cannot unambiguously get sizeof scalar" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" @@ -623,23 +623,23 @@ msgstr "" msgid "Could not initialize UART" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" msgstr "" @@ -647,7 +647,7 @@ msgstr "" msgid "Could not set address" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" msgstr "" @@ -838,7 +838,7 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -940,9 +940,9 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PWMOut.c -#: ports/cxd56/common-hal/pulseio/PWMOut.c -#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "Invalid PWM frequency" msgstr "" @@ -982,7 +982,7 @@ msgstr "파일이 유효하지 않습니다" msgid "Invalid format chunk size" msgstr "형식 청크 크기가 잘못되었습니다" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "" @@ -1000,8 +1000,8 @@ msgid "Invalid phase" msgstr "단계가 잘못되었습니다" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "핀이 잘못되었습니다" @@ -1025,7 +1025,7 @@ msgstr "오른쪽 채널 핀이 잘못되었습니다" msgid "Invalid pins" msgstr "핀이 유효하지 않습니다" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" msgstr "" @@ -1207,7 +1207,7 @@ msgstr "" msgid "No long integer support" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1275,12 +1275,12 @@ msgstr "" msgid "Oversample must be multiple of 8." msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" @@ -1335,8 +1335,8 @@ msgstr "" #: ports/nrf/common-hal/pulseio/PulseOut.c #: ports/stm/common-hal/pulseio/PulseOut.c msgid "" -"Port does not accept pins or frequency. " -"Construct and pass a PWMOut Carrier instead" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" msgstr "" #: shared-bindings/_bleio/Adapter.c @@ -1566,7 +1566,7 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" @@ -2882,6 +2882,14 @@ msgstr "" msgid "ord() expected a character, but string of length %d found" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "" @@ -3059,6 +3067,10 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 3133596686..87133a4606 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-18 11:19-0400\n" +"POT-Creation-Date: 2020-08-27 11:21-0400\n" "PO-Revision-Date: 2020-08-10 19:59+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -308,7 +308,7 @@ msgstr "Alle event kanalen zijn in gebruik" msgid "All sync event channels in use" msgstr "Alle sync event kanalen zijn in gebruik" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" msgstr "Alle timers voor deze pin zijn in gebruik" @@ -320,7 +320,7 @@ msgstr "Alle timers voor deze pin zijn in gebruik" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" msgstr "Alle timers zijn in gebruik" @@ -564,7 +564,7 @@ msgstr "Kan niet overdragen zonder MOSI en MISO pinnen." msgid "Cannot unambiguously get sizeof scalar" msgstr "Kan niet ondubbelzinning sizeof scalar verkrijgen" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "Kan de frequentie van een timer die al in gebruik is niet variëren" @@ -637,23 +637,23 @@ msgstr "Kan SDCard niet initialiseren" msgid "Could not initialize UART" msgstr "Kan UART niet initialiseren" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "Kan kanaal niet initialiseren" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "Kan timer niet initialiseren" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" msgstr "Kan kanaal niet her-initialiseren" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" msgstr "Kan timer niet her-initialiseren" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" msgstr "Kan PWM niet herstarten" @@ -663,7 +663,7 @@ msgstr "Kan PWM niet herstarten" msgid "Could not set address" msgstr "Kan PWM niet starten" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" msgstr "Kan PWM niet starten" @@ -855,7 +855,7 @@ msgid "Frequency captured is above capability. Capture Paused." msgstr "" "De vastgelegde frequentie is boven de capaciteit. Vastleggen gepauzeerd." -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" "Frequentie moet overeenkomen met bestaande PWMOut bij gebruik van deze timer" @@ -962,9 +962,9 @@ msgstr "Ongeldig BMP bestand" msgid "Invalid DAC pin supplied" msgstr "Ongeldige DAC pin opgegeven" -#: ports/atmel-samd/common-hal/pulseio/PWMOut.c -#: ports/cxd56/common-hal/pulseio/PWMOut.c -#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Ongeldige PWM frequentie" @@ -1004,7 +1004,7 @@ msgstr "Ongeldig bestand" msgid "Invalid format chunk size" msgstr "Ongeldig formaat stuk grootte" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "Ongeldige frequentie opgegeven" @@ -1022,8 +1022,8 @@ msgid "Invalid phase" msgstr "Ongeldige fase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Ongeldige pin" @@ -1047,7 +1047,7 @@ msgstr "Ongeldige pin voor rechter kanaal" msgid "Invalid pins" msgstr "Ongeldige pinnen" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" msgstr "Ongeldige pinnen voor PWMOut" @@ -1229,7 +1229,7 @@ msgstr "Een sleutel was niet gespecificeerd" msgid "No long integer support" msgstr "Geen lange integer ondersteuning" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "Geen timers meer beschikbaar op deze pin." @@ -1303,13 +1303,13 @@ msgstr "" msgid "Oversample must be multiple of 8." msgstr "Oversample moet een meervoud van 8 zijn." -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "" "PWM duty_cycle moet tussen 0 en 65535 inclusief zijn (16 bit resolutie)" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" @@ -1369,8 +1369,8 @@ msgstr "Polygon heeft op zijn minst 3 punten nodig" #: ports/nrf/common-hal/pulseio/PulseOut.c #: ports/stm/common-hal/pulseio/PulseOut.c msgid "" -"Port does not accept pins or frequency. " -"Construct and pass a PWMOut Carrier instead" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" msgstr "" #: shared-bindings/_bleio/Adapter.c @@ -1611,7 +1611,7 @@ msgstr "Tile breedte moet exact de bitmap breedte verdelen" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "Time-out is te lang. Maximale time-out lengte is %d seconden" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" @@ -2947,6 +2947,14 @@ msgstr "ord verwacht een teken (char)" msgid "ord() expected a character, but string of length %d found" msgstr "ord() verwacht een teken (char) maar vond een string van lengte %d" +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "overloop bij converteren van long int naar machine word" @@ -3127,6 +3135,10 @@ msgstr "sos[:, 3] moeten allemaal 1 zijn" msgid "sosfilt requires iterable arguments" msgstr "sosfilt vereist itereerbare argumenten" +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start/stop indices" diff --git a/locale/pl.po b/locale/pl.po index 6c52062d9a..610da7bfc0 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-18 11:19-0400\n" +"POT-Creation-Date: 2020-08-27 11:21-0400\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -302,7 +302,7 @@ msgstr "Wszystkie kanały zdarzeń w użyciu" msgid "All sync event channels in use" msgstr "Wszystkie kanały zdarzeń synchronizacji w użyciu" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" msgstr "Wszystkie timery tej nóżki w użyciu" @@ -314,7 +314,7 @@ msgstr "Wszystkie timery tej nóżki w użyciu" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" msgstr "Wszystkie timery w użyciu" @@ -554,7 +554,7 @@ msgstr "Nie można przesyłać bez nóżek MOSI i MISO." msgid "Cannot unambiguously get sizeof scalar" msgstr "Wielkość skalara jest niejednoznaczna" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" @@ -623,23 +623,23 @@ msgstr "" msgid "Could not initialize UART" msgstr "Ustawienie UART nie powiodło się" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" msgstr "" @@ -647,7 +647,7 @@ msgstr "" msgid "Could not set address" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" msgstr "" @@ -838,7 +838,7 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "Uzyskana częstotliwość jest niemożliwa. Spauzowano." -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -942,9 +942,9 @@ msgstr "Zły BMP" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PWMOut.c -#: ports/cxd56/common-hal/pulseio/PWMOut.c -#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Zła częstotliwość PWM" @@ -984,7 +984,7 @@ msgstr "Zły plik" msgid "Invalid format chunk size" msgstr "Zła wielkość fragmentu formatu" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "" @@ -1002,8 +1002,8 @@ msgid "Invalid phase" msgstr "Zła faza" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Zła nóżka" @@ -1027,7 +1027,7 @@ msgstr "Zła nóżka dla prawego kanału" msgid "Invalid pins" msgstr "Złe nóżki" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" msgstr "" @@ -1209,7 +1209,7 @@ msgstr "" msgid "No long integer support" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1277,12 +1277,12 @@ msgstr "" msgid "Oversample must be multiple of 8." msgstr "Nadpróbkowanie musi być wielokrotnością 8." -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "duty_cycle musi być pomiędzy 0 a 65535 włącznie (rozdzielczość 16 bit)" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "Nie można zmienić częstotliwości PWM gdy variable_frequency=False." @@ -1337,8 +1337,8 @@ msgstr "" #: ports/nrf/common-hal/pulseio/PulseOut.c #: ports/stm/common-hal/pulseio/PulseOut.c msgid "" -"Port does not accept pins or frequency. " -"Construct and pass a PWMOut Carrier instead" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" msgstr "" #: shared-bindings/_bleio/Adapter.c @@ -1568,7 +1568,7 @@ msgstr "Szerokość bitmapy musi być wielokrotnością szerokości kafelka" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" @@ -2887,6 +2887,14 @@ msgstr "ord oczekuje znaku" msgid "ord() expected a character, but string of length %d found" msgstr "ord() oczekuje znaku, a jest łańcuch od długości %d" +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "przepełnienie przy konwersji long in to słowa maszynowego" @@ -3066,6 +3074,10 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "początkowe/końcowe indeksy" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 9fb4142c47..65fe17cde8 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-18 11:19-0400\n" +"POT-Creation-Date: 2020-08-27 11:21-0400\n" "PO-Revision-Date: 2020-08-21 18:19+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -312,7 +312,7 @@ msgstr "Todos os canais de eventos em uso" msgid "All sync event channels in use" msgstr "Todos os canais dos eventos de sincronização em uso" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" msgstr "Todos os temporizadores para este pino estão em uso" @@ -324,7 +324,7 @@ msgstr "Todos os temporizadores para este pino estão em uso" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" msgstr "Todos os temporizadores em uso" @@ -571,7 +571,7 @@ msgstr "Não é possível transferir sem os pinos MOSI e MISO." msgid "Cannot unambiguously get sizeof scalar" msgstr "Não é possível obter inequivocamente o tamanho do escalar" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "Não é possível variar a frequência em um timer que já esteja em uso" @@ -644,23 +644,23 @@ msgstr "Não foi possível inicializar o SDCard" msgid "Could not initialize UART" msgstr "Não foi possível inicializar o UART" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "Não foi possível inicializar o canal" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "Não foi possível inicializar o temporizador" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" msgstr "Não foi possível reiniciar o canal" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" msgstr "Não foi possível reiniciar o temporizador" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" msgstr "Não foi possível reiniciar o PWM" @@ -668,7 +668,7 @@ msgstr "Não foi possível reiniciar o PWM" msgid "Could not set address" msgstr "Não foi possível definir o endereço" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" msgstr "Não foi possível iniciar o PWM" @@ -860,7 +860,7 @@ msgid "Frequency captured is above capability. Capture Paused." msgstr "" "A frequência capturada está acima da capacidade. A captura está em pausa." -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" "A frequência deve coincidir com o PWMOut existente usando este temporizador" @@ -965,9 +965,9 @@ msgstr "Arquivo BMP inválido" msgid "Invalid DAC pin supplied" msgstr "O pino DAC informado é inválido" -#: ports/atmel-samd/common-hal/pulseio/PWMOut.c -#: ports/cxd56/common-hal/pulseio/PWMOut.c -#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Frequência PWM inválida" @@ -1007,7 +1007,7 @@ msgstr "Arquivo inválido" msgid "Invalid format chunk size" msgstr "Tamanho do pedaço de formato inválido" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "A frequência informada é inválida" @@ -1025,8 +1025,8 @@ msgid "Invalid phase" msgstr "Fase Inválida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Pino inválido" @@ -1050,7 +1050,7 @@ msgstr "Pino inválido para canal direito" msgid "Invalid pins" msgstr "Pinos inválidos" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" msgstr "Os pinos para o PWMOut são inválidos" @@ -1232,7 +1232,7 @@ msgstr "Nenhuma chave foi definida" msgid "No long integer support" msgstr "Não há compatibilidade com inteiro longo" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "Não há mais temporizadores disponíveis neste pino." @@ -1305,14 +1305,14 @@ msgstr "" msgid "Oversample must be multiple of 8." msgstr "A superamostragem deve ser um múltiplo de 8." -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "" "O duty_cycle do PWM deve estar entre 0 e inclusive 65535 (com resolução de " "16 bits)" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" @@ -1372,11 +1372,9 @@ msgstr "O Polígono precisa de pelo menos 3 pontos" #: ports/nrf/common-hal/pulseio/PulseOut.c #: ports/stm/common-hal/pulseio/PulseOut.c msgid "" -"Port does not accept pins or frequency. " -"Construct and pass a PWMOut Carrier instead" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" msgstr "" -"A porta não aceita pinos ou frequência. " -"Em vez disso, Construa e encaminhe um PWMOut Carrier" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" @@ -1619,7 +1617,7 @@ msgstr "" "O tempo limite é long demais: O comprimento máximo do tempo limite é de %d " "segundos" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" @@ -2967,6 +2965,14 @@ msgstr "" "o ord() esperava um caractere, porém a sequência do comprimento %d foi " "encontrada" +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "" @@ -3148,6 +3154,10 @@ msgstr "sos[:, 3] deve ser um em todos" msgid "sosfilt requires iterable arguments" msgstr "o sosfilt requer que os argumentos sejam iteráveis" +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "os índices de início/fim" @@ -3444,6 +3454,15 @@ 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 "" +#~ "Port does not accept pins or " +#~ "frequency. Construct and pass a " +#~ "PWMOut Carrier instead" +#~ msgstr "" +#~ "A porta não aceita pinos ou " +#~ "frequência. Em vez disso, Construa e " +#~ "encaminhe um PWMOut Carrier" + #~ msgid "tuple/list required on RHS" #~ msgstr "a tupla/lista necessária no RHS" diff --git a/locale/sv.po b/locale/sv.po index a72f8b4fbc..3f8be415f8 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-18 11:19-0400\n" +"POT-Creation-Date: 2020-08-27 11:21-0400\n" "PO-Revision-Date: 2020-08-30 18:28+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -308,7 +308,7 @@ msgstr "Alla händelsekanaler används" msgid "All sync event channels in use" msgstr "Alla händelsekanaler används" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" msgstr "Alla timers för denna pinne är i bruk" @@ -320,7 +320,7 @@ msgstr "Alla timers för denna pinne är i bruk" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" msgstr "Alla timers används" @@ -562,7 +562,7 @@ msgstr "Kan inte överföra utan MOSI- och MISO-pinnar." msgid "Cannot unambiguously get sizeof scalar" msgstr "Kan inte entydigt få sizeof scalar" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "Det går inte att ändra frekvensen på en timer som redan används" @@ -635,23 +635,23 @@ msgstr "Kan inte initiera SD-kort" msgid "Could not initialize UART" msgstr "Det gick inte att initiera UART" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "Det gick inte att initiera kanalen" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "Det gick inte att initialisera timern" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" msgstr "Det gick inte att återinitiera kanalen" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" msgstr "Det gick inte att återinitiera timern" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" msgstr "Det gick inte att starta om PWM" @@ -659,7 +659,7 @@ msgstr "Det gick inte att starta om PWM" msgid "Could not set address" msgstr "Kan inte ange adress" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" msgstr "Det gick inte att starta PWM" @@ -850,7 +850,7 @@ msgstr "Framebuffer kräver %d byte" msgid "Frequency captured is above capability. Capture Paused." msgstr "Infångningsfrekvens är för hög. Infångning pausad." -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "Frekvensen måste matcha befintlig PWMOut med denna timer" @@ -954,9 +954,9 @@ msgstr "Ogiltig BMP-fil" msgid "Invalid DAC pin supplied" msgstr "Ogiltig DAC-pinne angiven" -#: ports/atmel-samd/common-hal/pulseio/PWMOut.c -#: ports/cxd56/common-hal/pulseio/PWMOut.c -#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Ogiltig PWM-frekvens" @@ -996,7 +996,7 @@ msgstr "Felaktig fil" msgid "Invalid format chunk size" msgstr "Ogiltig formatsegmentstorlek" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "Ogiltig frekvens angiven" @@ -1014,8 +1014,8 @@ msgid "Invalid phase" msgstr "Ogiltig fas" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Ogiltig pinne" @@ -1039,7 +1039,7 @@ msgstr "Ogiltig pinne för höger kanal" msgid "Invalid pins" msgstr "Ogiltiga pinnar" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" msgstr "Ogiltiga pinnar för PWMOut" @@ -1222,7 +1222,7 @@ msgstr "Ingen nyckel angavs" msgid "No long integer support" msgstr "Inget stöd för långt heltal" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "Inga fler timers tillgängliga på denna pinne." @@ -1295,12 +1295,12 @@ msgstr "" msgid "Oversample must be multiple of 8." msgstr "Översampling måste vara multipel av 8." -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "PWM duty_cykel måste vara mellan 0 och 65535 (16 bitars upplösning)" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" @@ -1360,8 +1360,8 @@ msgstr "Polygonen behöver minst 3 punkter" #: ports/nrf/common-hal/pulseio/PulseOut.c #: ports/stm/common-hal/pulseio/PulseOut.c msgid "" -"Port does not accept pins or frequency. " -"Construct and pass a PWMOut Carrier instead" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" msgstr "" #: shared-bindings/_bleio/Adapter.c @@ -1600,7 +1600,7 @@ msgstr "Tile-bredd måste vara jämnt delbar med bredd på bitmap" 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" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" @@ -2933,6 +2933,14 @@ msgstr "ord förväntar sig ett tecken" msgid "ord() expected a character, but string of length %d found" msgstr "ord() förväntade sig ett tecken, men en sträng med längden %d hittades" +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "Konvertering av long int till machine word överskred maxvärde" @@ -3113,6 +3121,10 @@ msgstr "sos[:, 3] måste vara ettor" msgid "sosfilt requires iterable arguments" msgstr "sosfilt kräver iterable argument" +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start-/slutindex" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 725491f5b2..290d4749ef 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-18 11:19-0400\n" +"POT-Creation-Date: 2020-08-27 11:21-0400\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -309,7 +309,7 @@ msgstr "Suǒyǒu shǐyòng de shìjiàn píndào" msgid "All sync event channels in use" msgstr "Suǒyǒu tóngbù shìjiàn píndào shǐyòng" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" msgstr "Cǐ yǐn jiǎo de suǒyǒu jìshí qì zhèngzài shǐyòng" @@ -321,7 +321,7 @@ msgstr "Cǐ yǐn jiǎo de suǒyǒu jìshí qì zhèngzài shǐyòng" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" msgstr "Suǒyǒu jìshí qì shǐyòng" @@ -561,7 +561,7 @@ msgstr "Méiyǒu MOSI/MISO jiù wúfǎ zhuǎnyí." msgid "Cannot unambiguously get sizeof scalar" msgstr "Wúfǎ míngquè de huòdé biāoliàng de dàxiǎo" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/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ǜ" @@ -632,23 +632,23 @@ msgstr "wú fǎ chū shǐ huà SDCard" msgid "Could not initialize UART" msgstr "Wúfǎ chūshǐhuà UART" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "Wúfǎ chūshǐhuà píndào" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "Wúfǎ chūshǐhuà jìshí qì" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" msgstr "Wúfǎ chóngxīn chūshǐhuà píndào" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" msgstr "Wúfǎ chóngxīn qǐdòng jìshí qì" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" msgstr "Wúfǎ chóngqǐ PWM" @@ -656,7 +656,7 @@ msgstr "Wúfǎ chóngqǐ PWM" msgid "Could not set address" msgstr "wú fǎ shè zhì dì zhǐ" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" msgstr "Wúfǎ qǐdòng PWM" @@ -847,7 +847,7 @@ msgstr "zhēn huǎn chōng qū xū yào %d zì jié" msgid "Frequency captured is above capability. Capture Paused." msgstr "Pínlǜ bǔhuò gāo yú nénglì. Bǔhuò zàntíng." -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "Pínlǜ bìxū yǔ shǐyòng cǐ jìshí qì de xiàn yǒu PWMOut xiāng pǐpèi" @@ -951,9 +951,9 @@ msgstr "Wúxiào de BMP wénjiàn" msgid "Invalid DAC pin supplied" msgstr "Tí gōng liǎo wúxiào de DAC yǐn jiǎo" -#: ports/atmel-samd/common-hal/pulseio/PWMOut.c -#: ports/cxd56/common-hal/pulseio/PWMOut.c -#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "Invalid PWM frequency" msgstr "Wúxiào de PWM pínlǜ" @@ -993,7 +993,7 @@ msgstr "Wúxiào de wénjiàn" msgid "Invalid format chunk size" msgstr "Géshì kuài dàxiǎo wúxiào" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "Tígōng de pínlǜ wúxiào" @@ -1011,8 +1011,8 @@ msgid "Invalid phase" msgstr "Jiēduàn wúxiào" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Wúxiào de yǐn jiǎo" @@ -1036,7 +1036,7 @@ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào" msgid "Invalid pins" msgstr "Wúxiào de yǐn jiǎo" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" msgstr "PWMOut de yǐn jiǎo wú xiào" @@ -1218,7 +1218,7 @@ msgstr "Wèi zhǐdìng mì yào" msgid "No long integer support" msgstr "Méiyǒu zhǎng zhěngshù zhīchí" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "Gāi yǐn jiǎo shàng méiyǒu kěyòng de dìngshí qì." @@ -1291,13 +1291,13 @@ msgstr "" msgid "Oversample must be multiple of 8." msgstr "Guò cǎiyàng bìxū shì 8 de bèishù." -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "" "PWM yìwù zhōuqí bìxū jiè yú 0 zhì 65535 de bāoróng xìng (16 wèi fēnbiàn lǜ)" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "Dāng biànliàng_pínlǜ shì False zài jiànzhú shí PWM pínlǜ bùkě xiě." @@ -1355,8 +1355,8 @@ msgstr "Duōbiānxíng zhìshǎo xūyào 3 diǎn" #: ports/nrf/common-hal/pulseio/PulseOut.c #: ports/stm/common-hal/pulseio/PulseOut.c msgid "" -"Port does not accept pins or frequency. " -"Construct and pass a PWMOut Carrier instead" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" msgstr "" #: shared-bindings/_bleio/Adapter.c @@ -1593,7 +1593,7 @@ msgstr "Píng pū kuāndù bìxū huàfēn wèi tú kuāndù" 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" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" @@ -2924,6 +2924,14 @@ msgstr "ord yùqí zìfú" msgid "ord() expected a character, but string of length %d found" msgstr "ord() yùqí zìfú, dàn chángdù zìfú chuàn %d" +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "chāo gāo zhuǎnhuàn zhǎng zhěng shùzì shí" @@ -3103,6 +3111,10 @@ msgstr "sos [:, 3] yīnggāi quán shì" msgid "sosfilt requires iterable arguments" msgstr "sosfilt xūyào diédài cānshù" +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "kāishǐ/jiéshù zhǐshù" From 767f3d0feb1e145efc2def5048e91d910bbe2f9a Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 30 Aug 2020 14:35:02 -0400 Subject: [PATCH 0751/1293] make translate --- locale/circuitpython.pot | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index f53c9c51f8..92e9b6d241 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-21 11:37-0400\n" +"POT-Creation-Date: 2020-08-30 14:34-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -490,6 +490,10 @@ msgstr "" msgid "Can't set CCCD on local Characteristic" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c @@ -742,8 +746,8 @@ msgstr "" msgid "Error in regex" msgstr "" -#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -1251,6 +1255,10 @@ msgstr "" msgid "Not running saved code.\n" msgstr "" +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -2413,10 +2421,6 @@ msgstr "" msgid "graphic must be 2048 bytes long" msgstr "" -#: shared-bindings/_bleio/Adapter.c -msgid "hci_uart_init not available" -msgstr "" - #: extmod/moduheapq.c msgid "heap must be a list" msgstr "" From f5a5fc4c8494cd80f0e113c7cd4de975925b9bac Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 30 Aug 2020 14:59:03 -0400 Subject: [PATCH 0752/1293] Fix stub; mismatched triple quotes --- shared-bindings/_bleio/Adapter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index b70fd17f8f..4facd818a3 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -77,7 +77,7 @@ //| //| On boards with native BLE, you cannot create an instance of `_bleio.Adapter`; //| this constructor will raise `NotImplementedError`. -//| Use `_bleio.adapter` to access the sole instance already available.""" +//| Use `_bleio.adapter` to access the sole instance already available. //| """ //| ... //| From aba27c12e506fe44674e11fd1db5a25abc004f6b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 30 Aug 2020 20:02:24 +0000 Subject: [PATCH 0753/1293] Translated using Weblate (Swedish) Currently translated at 99.4% (776 of 780 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 3f8be415f8..9946917445 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,8 +6,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-08-27 11:21-0400\n" -"PO-Revision-Date: 2020-08-30 18:28+0000\n" -"Last-Translator: Jonny Bergdahl \n" +"PO-Revision-Date: 2020-08-30 20:02+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: LANGUAGE \n" "Language: sv\n" "MIME-Version: 1.0\n" @@ -940,7 +940,7 @@ msgstr "Ogiltig %q-pinne" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c #: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" -msgstr "Ogiltigt val av % q pinne" +msgstr "Ogiltigt val av %q pinne" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" From ef8cde94a47a140c21175cbe7fc877535b9ed0ea Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 30 Aug 2020 20:51:04 -0500 Subject: [PATCH 0754/1293] actions: Clone the esp-idf submodules ourselves Builds of the esp32s2 targets frequently fail: ``` -- Found Git: /usr/bin/git (found version "2.28.0") -- Initialising new submodule components/asio/asio... warning: could not look up configuration 'remote.origin.url'. Assuming this repository is its own authoritative upstream. Submodule 'components/asio/asio' (/home/runner/work/circuitpython/circuitpython/ports/espressif/asio.git) registered for path 'components/asio/asio' fatal: repository '/home/runner/work/circuitpython/circuitpython/ports/espressif/asio.git' does not exist fatal: clone of '/home/runner/work/circuitpython/circuitpython/ports/espressif/asio.git' into submodule path '/home/runner/work/circuitpython/circuitpython/ports/esp32s2/esp-idf/components/asio/asio' failed Failed to clone 'components/asio/asio'. Retry scheduled fatal: repository '/home/runner/work/circuitpython/circuitpython/ports/espressif/asio.git' does not exist fatal: clone of '/home/runner/work/circuitpython/circuitpython/ports/espressif/asio.git' into submodule path '/home/runner/work/circuitpython/circuitpython/ports/esp32s2/esp-idf/components/asio/asio' failed Failed to clone 'components/asio/asio' a second time, aborting CMake Error at esp-idf/tools/cmake/git_submodules.cmake:48 (message): Git submodule init failed for components/asio/asio Call Stack (most recent call first): esp-idf/tools/cmake/build.cmake:78 (git_submodule_check) esp-idf/tools/cmake/build.cmake:160 (__build_get_idf_git_revision) esp-idf/tools/cmake/idf.cmake:49 (__build_init) esp-idf/tools/cmake/project.cmake:7 (include) CMakeLists.txt:8 (include) ``` It's not clear how/why this happens--is it something to do with our multithreaded build?. Attempt to clear it up by manually checking out these submodules ourselves. --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e780f652ab..3c7cc781bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -433,6 +433,11 @@ jobs: with: path: ${{ github.workspace }}/.idf_tools key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20200801 + - name: Clone IDF submodules + run: | + (cd $IDF_PATH && git submodule update --init) + env: + IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf - name: Install IDF tools run: | $IDF_PATH/tools/idf_tools.py --non-interactive install required From 07e2fc721a9903a2f5340fe9763c8b2f17310521 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 30 Aug 2020 23:14:50 -0400 Subject: [PATCH 0755/1293] Remove debugging print-out for endpoint checking. --- tools/gen_usb_descriptor.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index adf0d8270d..15bf2daa00 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -382,7 +382,6 @@ if args.max_ep != 0: for interface in interfaces: for subdescriptor in interface.subdescriptors: endpoint_address = getattr(subdescriptor, 'bEndpointAddress', 0) & 0x7f - print("Endpoint %d - vs max_ep %d" % (endpoint_address, args.max_ep)) if endpoint_address >= args.max_ep: raise ValueError("Endpoint address %d of %s must be less than %d" % (endpoint_address & 0x7f, interface.description, args.max_ep)) else: From 4ac7650f22c049d9059e6173e55cf44c43b1b5ac Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 31 Aug 2020 23:56:38 -0400 Subject: [PATCH 0756/1293] matrix portal board --- .github/workflows/build.yml | 1 + .../atmel-samd/boards/matrixportal_m4/board.c | 39 ++++++++++++ .../boards/matrixportal_m4/mpconfigboard.h | 30 +++++++++ .../boards/matrixportal_m4/mpconfigboard.mk | 12 ++++ .../atmel-samd/boards/matrixportal_m4/pins.c | 61 +++++++++++++++++++ 5 files changed, 143 insertions(+) create mode 100644 ports/atmel-samd/boards/matrixportal_m4/board.c create mode 100644 ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/matrixportal_m4/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e780f652ab..ec57f889f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -234,6 +234,7 @@ jobs: - "makerdiary_nrf52840_m2_devkit" - "makerdiary_nrf52840_mdk" - "makerdiary_nrf52840_mdk_usb_dongle" + - "matrixportal_m4" - "meowbit_v121" - "meowmeow" - "metro_m0_express" diff --git a/ports/atmel-samd/boards/matrixportal_m4/board.c b/ports/atmel-samd/boards/matrixportal_m4/board.c new file mode 100644 index 0000000000..2d4f302391 --- /dev/null +++ b/ports/atmel-samd/boards/matrixportal_m4/board.c @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "boards/board.h" +#include "mpconfigboard.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h new file mode 100644 index 0000000000..0368d577bf --- /dev/null +++ b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h @@ -0,0 +1,30 @@ +#define MICROPY_HW_BOARD_NAME "Adafruit Matrix Portal M4" +#define MICROPY_HW_MCU_NAME "samd51j19" + +#define CIRCUITPY_MCU_FAMILY samd51 + +#define MICROPY_HW_LED_STATUS (&pin_PA14) + +#define MICROPY_HW_NEOPIXEL (&pin_PA23) + +// These are pins not to reset. +// QSPI Data pins, PA23 is NeoPixel +#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11 | PA23) +// QSPI CS, QSPI SCK +#define MICROPY_PORT_B (PORT_PB10 | PORT_PB11) +#define MICROPY_PORT_C (0) +#define MICROPY_PORT_D (0) + +#define DEFAULT_I2C_BUS_SCL (&pin_PB03) +#define DEFAULT_I2C_BUS_SDA (&pin_PB02) + +#define DEFAULT_SPI_BUS_SCK (&pin_PA16) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA19) +#define DEFAULT_SPI_BUS_MISO (&pin_PA17) + +#define DEFAULT_UART_BUS_RX (&pin_PA01) +#define DEFAULT_UART_BUS_TX (&pin_PA00) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk new file mode 100644 index 0000000000..44b28acbcb --- /dev/null +++ b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk @@ -0,0 +1,12 @@ +USB_VID = 0x239A +USB_PID = 0x80CA +USB_PRODUCT = "Matrix Portal M4" +USB_MANUFACTURER = "Adafruit Industries LLC" + +CHIP_VARIANT = SAMD51J19A +CHIP_FAMILY = samd51 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 3 +EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C" +LONGINT_IMPL = MPZ diff --git a/ports/atmel-samd/boards/matrixportal_m4/pins.c b/ports/atmel-samd/boards/matrixportal_m4/pins.c new file mode 100644 index 0000000000..34865597b6 --- /dev/null +++ b/ports/atmel-samd/boards/matrixportal_m4/pins.c @@ -0,0 +1,61 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA07) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_TX),MP_ROM_PTR(&pin_PA00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RX),MP_ROM_PTR(&pin_PA01) }, + + // ESP control + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_CS), MP_ROM_PTR(&pin_PB17) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_GPIO0), MP_ROM_PTR(&pin_PA20) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_BUSY), MP_ROM_PTR(&pin_PA22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RESET), MP_ROM_PTR(&pin_PA21) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RTS), MP_ROM_PTR(&pin_PA18) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PA12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PA13) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL),MP_ROM_PTR(&pin_PB30) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_PB31) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL),MP_ROM_PTR(&pin_PA23) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SCK),MP_ROM_PTR(&pin_PA16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI),MP_ROM_PTR(&pin_PA19) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MISO),MP_ROM_PTR(&pin_PA17) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_R1),MP_ROM_PTR(&pin_PB00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_G1),MP_ROM_PTR(&pin_PB01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_B1),MP_ROM_PTR(&pin_PB02) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_R2),MP_ROM_PTR(&pin_PB03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_G2),MP_ROM_PTR(&pin_PB04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_B2),MP_ROM_PTR(&pin_PB05) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRA),MP_ROM_PTR(&pin_PB07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRB),MP_ROM_PTR(&pin_PB08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRC),MP_ROM_PTR(&pin_PB09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRD),MP_ROM_PTR(&pin_PB15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRE),MP_ROM_PTR(&pin_PB13) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_CLK),MP_ROM_PTR(&pin_PB06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_LAT),MP_ROM_PTR(&pin_PB14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_OE),MP_ROM_PTR(&pin_PB12) }, + + { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_INTERRUPT), MP_ROM_PTR(&pin_PA27) }, + + // Grounded when closed. + { MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_UP),MP_ROM_PTR(&pin_PB22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_DOWN),MP_ROM_PTR(&pin_PB23) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_L),MP_ROM_PTR(&pin_PA14) }, + + { 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_global_dict_table); From fc513956be8cb0389d450308f6363c6b742af072 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Tue, 1 Sep 2020 09:36:29 -0500 Subject: [PATCH 0757/1293] Update refresh to force immediate redraw with display.refresh() or display.refresh(target_frames_per_second=None), even with auto_refresh=False --- shared-bindings/displayio/Display.c | 19 +++++++++++++++++-- shared-module/displayio/Display.c | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index c4fbdab2e4..ff003ab4bf 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -227,6 +227,9 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show //| When auto refresh is on, updates the display immediately. (The display will also update //| without calls to this.) //| +//| When auto refresh is off, refresh() or refresh(target_frames_per_second=None) will update +//| the display immediately. +//| //| :param int target_frames_per_second: How many times a second `refresh` should be called and the screen updated. //| :param int minimum_frames_per_second: The minimum number of times the screen should be updated per second.""" //| ... @@ -234,9 +237,11 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show STATIC mp_obj_t displayio_display_obj_refresh(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_target_frames_per_second, ARG_minimum_frames_per_second }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_target_frames_per_second, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 60} }, + //{ MP_QSTR_target_frames_per_second, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 60} }, + { MP_QSTR_target_frames_per_second, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NEW_SMALL_INT(60)} }, { MP_QSTR_minimum_frames_per_second, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} }, }; + 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); @@ -246,8 +251,18 @@ STATIC mp_obj_t displayio_display_obj_refresh(size_t n_args, const mp_obj_t *pos if (minimum_frames_per_second > 0) { maximum_ms_per_real_frame = 1000 / minimum_frames_per_second; } - return mp_obj_new_bool(common_hal_displayio_display_refresh(self, 1000 / args[ARG_target_frames_per_second].u_int, maximum_ms_per_real_frame)); + + uint32_t target_ms_per_frame; + if ( (args[ARG_target_frames_per_second].u_obj == mp_const_none) || (n_args == 1) ) { // if None or no arguments + target_ms_per_frame = 0xffffffff; + } + else { + target_ms_per_frame = 1000 / mp_obj_get_int(args[ARG_target_frames_per_second].u_obj); + } + + return mp_obj_new_bool(common_hal_displayio_display_refresh(self, target_ms_per_frame, maximum_ms_per_real_frame)); } + MP_DEFINE_CONST_FUN_OBJ_KW(displayio_display_refresh_obj, 1, displayio_display_obj_refresh); //| auto_refresh: bool diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 4f92f249fd..021159c0d9 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -352,7 +352,7 @@ uint16_t common_hal_displayio_display_get_rotation(displayio_display_obj_t* self bool common_hal_displayio_display_refresh(displayio_display_obj_t* self, uint32_t target_ms_per_frame, uint32_t maximum_ms_per_real_frame) { - if (!self->auto_refresh && !self->first_manual_refresh) { + if (!self->auto_refresh && !self->first_manual_refresh && (target_ms_per_frame != 0xffffffff) ) { uint64_t current_time = supervisor_ticks_ms64(); uint32_t current_ms_since_real_refresh = current_time - self->core.last_refresh; // Test to see if the real frame time is below our minimum. From c4b1db006f3f091f67076226e26c3f53c9e76f8b Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Tue, 1 Sep 2020 09:38:57 -0500 Subject: [PATCH 0758/1293] delete unnecessary comment --- shared-bindings/displayio/Display.c | 1 - 1 file changed, 1 deletion(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index ff003ab4bf..cf1b840dc9 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -237,7 +237,6 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show STATIC mp_obj_t displayio_display_obj_refresh(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_target_frames_per_second, ARG_minimum_frames_per_second }; static const mp_arg_t allowed_args[] = { - //{ MP_QSTR_target_frames_per_second, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 60} }, { MP_QSTR_target_frames_per_second, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NEW_SMALL_INT(60)} }, { MP_QSTR_minimum_frames_per_second, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} }, }; From 8be862e644dad22641f5a4f9c1520f91df08d7a5 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Tue, 1 Sep 2020 10:26:48 -0500 Subject: [PATCH 0759/1293] Remove trailing whitespace --- shared-bindings/displayio/Display.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index cf1b840dc9..9f3148dc76 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -227,7 +227,7 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show //| When auto refresh is on, updates the display immediately. (The display will also update //| without calls to this.) //| -//| When auto refresh is off, refresh() or refresh(target_frames_per_second=None) will update +//| When auto refresh is off, refresh() or refresh(target_frames_per_second=None) will update //| the display immediately. //| //| :param int target_frames_per_second: How many times a second `refresh` should be called and the screen updated. @@ -252,8 +252,9 @@ STATIC mp_obj_t displayio_display_obj_refresh(size_t n_args, const mp_obj_t *pos } uint32_t target_ms_per_frame; - if ( (args[ARG_target_frames_per_second].u_obj == mp_const_none) || (n_args == 1) ) { // if None or no arguments - target_ms_per_frame = 0xffffffff; + if ( (args[ARG_target_frames_per_second].u_obj == mp_const_none) || (n_args == 1) ) { + // if None or no arguments + target_ms_per_frame = 0xffffffff; } else { target_ms_per_frame = 1000 / mp_obj_get_int(args[ARG_target_frames_per_second].u_obj); From ad4bf75367b1b1992d653428593c0f66f5b5e7ff Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 1 Sep 2020 10:05:13 -0500 Subject: [PATCH 0760/1293] samd: only set NDEBUG for non-debug builds --- ports/atmel-samd/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 30487ae3ef..25dc0cf15e 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -107,7 +107,7 @@ CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAME5X -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_ endif # option to override default optimization level, set in boards/$(BOARD)/mpconfigboard.mk -CFLAGS += $(OPTIMIZATION_FLAGS) -DNDEBUG +CFLAGS += $(OPTIMIZATION_FLAGS) $(echo PERIPHERALS_CHIP_FAMILY=$(PERIPHERALS_CHIP_FAMILY)) #Debugging/Optimization @@ -121,6 +121,7 @@ ifeq ($(DEBUG), 1) CFLAGS += -DENABLE_MICRO_TRACE_BUFFER endif else + CFLAGS += -DNDEBUG # -finline-limit can shrink the image size. # -finline-limit=80 or so is similar to not having it on. # There is no simple default value, though. From 952d9bbb4a99cc598b56e170cdc05d94087d0d6d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 28 Aug 2020 11:24:36 -0500 Subject: [PATCH 0761/1293] samd: Ignore a maybe-uninitialized diagnostic in asf4 I encountered this when changing optimization flags for debugging purposes. The diagnostic appears spurious and unrelated to what I'm debugging. --- ports/atmel-samd/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 25dc0cf15e..3b7ab75bb0 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -258,6 +258,8 @@ SRC_ASF += \ $(BUILD)/asf4/$(CHIP_FAMILY)/hpl/sdhc/hpl_sdhc.o: CFLAGS += -Wno-cast-align endif +$(BUILD)/asf4/$(CHIP_FAMILY)/hpl/sercom/hpl_sercom.o: CFLAGS += -Wno-maybe-uninitialized + SRC_ASF := $(addprefix asf4/$(CHIP_FAMILY)/, $(SRC_ASF)) SRC_C = \ From 9bd2a61d8b2ba56cef241f3b93aed50e718998b5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 1 Sep 2020 10:29:10 -0500 Subject: [PATCH 0762/1293] supervisor: Always allocate at least a 1x1 terminal Otherwise, out of range writes would occur in tilegrid_set_tile, causing a safe mode reset. ``` Hardware watchpoint 6: -location *stack_alloc->ptr Old value = 24652061 New value = 24641565 0x000444f2 in common_hal_displayio_tilegrid_set_tile (self=0x200002c8 , x=1, y=1, tile_index=0 '\000') at ../../shared-module/displayio/TileGrid.c:236 236 if (!self->partial_change) { (gdb) ``` --- supervisor/shared/display.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index 634720d0ab..afb3f3a9a6 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -65,10 +65,14 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { if (width_in_tiles < 80) { scale = 1; } + width_in_tiles = (width_px - blinka_bitmap.width * scale) / (grid->tile_width * scale); + if (width_in_tiles < 1) { + width_in_tiles = 1; + } uint16_t height_in_tiles = height_px / (grid->tile_height * scale); uint16_t remaining_pixels = height_px % (grid->tile_height * scale); - if (remaining_pixels > 0) { + if (height_in_tiles < 1 || remaining_pixels > 0) { height_in_tiles += 1; } @@ -94,6 +98,8 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { } grid->width_in_tiles = width_in_tiles; grid->height_in_tiles = height_in_tiles; + assert(width_in_tiles > 0); + assert(height_in_tiles > 0); grid->pixel_width = width_in_tiles * grid->tile_width; grid->pixel_height = height_in_tiles * grid->tile_height; grid->tiles = tiles; From 2f120c70eee692b8e036f8f0778af2b723e1f0e7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 28 Aug 2020 11:17:07 -0500 Subject: [PATCH 0763/1293] rgbmatrix: recover gracefully from allocation errors e.g., allocating a 192x32x6bpp matrix would be enough to trigger this reliably on a Metro M4 Express using the "memory hogging" layout. Allocating 64x32x6bpp could trigger it, but somewhat unreliably. There are several things going on here: * we make the failing call with interrupts off * we were throwing an exception with interrupts off * protomatter failed badly in _PM_free when it was partially-initialized Incorporate the fix from protomatter, switch to a non-throwing malloc variant, and ensure that interrupts get turned back on. This decreases the quality of the MemoryError (it cannot report the size of the failed allocation) but allows CircuitPython to survive, rather than faulting. --- lib/protomatter | 2 +- shared-module/rgbmatrix/RGBMatrix.c | 17 +++++++++++------ shared-module/rgbmatrix/allocator.h | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/protomatter b/lib/protomatter index 761d6437e8..2a1ba8fa47 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit 761d6437e8cd6a131d51de96974337121a9c7164 +Subproject commit 2a1ba8fa4753b2bcb158c9b17351cf18eade0d2b diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c index 6dad91679f..a020ef0896 100644 --- a/shared-module/rgbmatrix/RGBMatrix.c +++ b/shared-module/rgbmatrix/RGBMatrix.c @@ -89,6 +89,7 @@ void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t* self, self->bufinfo.typecode = 'H' | MP_OBJ_ARRAY_TYPECODE_FLAG_RW; } + memset(&self->core, 0, sizeof(self->core)); ProtomatterStatus stat = _PM_init(&self->core, self->width, self->bit_depth, self->rgb_count/6, self->rgb_pins, @@ -101,14 +102,17 @@ void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t* self, common_hal_mcu_disable_interrupts(); common_hal_rgbmatrix_timer_enable(self->timer); stat = _PM_begin(&self->core); - _PM_convert_565(&self->core, self->bufinfo.buf, self->width); + + if (stat == PROTOMATTER_OK) { + _PM_convert_565(&self->core, self->bufinfo.buf, self->width); + } common_hal_mcu_enable_interrupts(); - _PM_swapbuffer_maybe(&self->core); + if (stat == PROTOMATTER_OK) { + _PM_swapbuffer_maybe(&self->core); + } } if (stat != PROTOMATTER_OK) { - // XXX this deinit() actually makes crashy-crashy - // can trigger it by sending inappropriate pins common_hal_rgbmatrix_rgbmatrix_deinit(self); switch (stat) { case PROTOMATTER_ERR_PINS: @@ -117,7 +121,9 @@ void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t* self, case PROTOMATTER_ERR_ARG: mp_raise_ValueError(translate("Invalid argument")); break; - case PROTOMATTER_ERR_MALLOC: /// should have already been signaled as NLR + case PROTOMATTER_ERR_MALLOC: + mp_raise_msg(&mp_type_MemoryError, NULL); + break; default: mp_raise_msg_varg(&mp_type_RuntimeError, translate("Internal error #%d"), (int)stat); @@ -126,7 +132,6 @@ void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t* self, } self->paused = 0; - } STATIC void free_pin(uint8_t *pin) { diff --git a/shared-module/rgbmatrix/allocator.h b/shared-module/rgbmatrix/allocator.h index 5e6f0b41d2..172d82684b 100644 --- a/shared-module/rgbmatrix/allocator.h +++ b/shared-module/rgbmatrix/allocator.h @@ -11,7 +11,7 @@ static inline void *_PM_allocator_impl(size_t sz) { if (gc_alloc_possible()) { - return m_malloc(sz + sizeof(void*), true); + return m_malloc_maybe(sz + sizeof(void*), true); } else { supervisor_allocation *allocation = allocate_memory(align32_size(sz), false); return allocation ? allocation->ptr : NULL; From e01ade3848cf828620ea25ada2b2b829dbe180f3 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 28 Aug 2020 11:24:59 -0500 Subject: [PATCH 0764/1293] rgbmatrix: Don't inline the allocator functions --- shared-module/rgbmatrix/RGBMatrix.c | 19 ++++++++++++++++++- shared-module/rgbmatrix/allocator.h | 28 +++++----------------------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c index a020ef0896..6fb36f6e3a 100644 --- a/shared-module/rgbmatrix/RGBMatrix.c +++ b/shared-module/rgbmatrix/RGBMatrix.c @@ -84,7 +84,7 @@ void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t* self, _PM_FREE(self->core.screenData); self->framebuffer = NULL; - self->bufinfo.buf = _PM_allocator_impl(self->bufsize); + self->bufinfo.buf = common_hal_rgbmatrix_allocator_impl(self->bufsize); self->bufinfo.len = self->bufsize; self->bufinfo.typecode = 'H' | MP_OBJ_ARRAY_TYPECODE_FLAG_RW; } @@ -211,3 +211,20 @@ int common_hal_rgbmatrix_rgbmatrix_get_height(rgbmatrix_rgbmatrix_obj_t* self) { int computed_height = (self->rgb_count / 3) << (self->addr_count); return computed_height; } + +void *common_hal_rgbmatrix_allocator_impl(size_t sz) { + if (gc_alloc_possible()) { + return m_malloc_maybe(sz + sizeof(void*), true); + } else { + supervisor_allocation *allocation = allocate_memory(align32_size(sz), false); + return allocation ? allocation->ptr : NULL; + } +} + +void common_hal_rgbmatrix_free_impl(void *ptr_in) { + supervisor_allocation *allocation = allocation_from_ptr(ptr_in); + + if (allocation) { + free_memory(allocation); + } +} diff --git a/shared-module/rgbmatrix/allocator.h b/shared-module/rgbmatrix/allocator.h index 172d82684b..3191565a36 100644 --- a/shared-module/rgbmatrix/allocator.h +++ b/shared-module/rgbmatrix/allocator.h @@ -1,29 +1,11 @@ -#ifndef MICROPY_INCLUDED_SHARED_MODULE_RGBMATRIX_ALLOCATOR_H -#define MICROPY_INCLUDED_SHARED_MODULE_RGBMATRIX_ALLOCATOR_H +#pragma once #include #include "py/gc.h" #include "py/misc.h" #include "supervisor/memory.h" -#define _PM_ALLOCATOR _PM_allocator_impl -#define _PM_FREE(x) (_PM_free_impl((x)), (x)=NULL, (void)0) - -static inline void *_PM_allocator_impl(size_t sz) { - if (gc_alloc_possible()) { - return m_malloc_maybe(sz + sizeof(void*), true); - } else { - supervisor_allocation *allocation = allocate_memory(align32_size(sz), false); - return allocation ? allocation->ptr : NULL; - } -} - -static inline void _PM_free_impl(void *ptr_in) { - supervisor_allocation *allocation = allocation_from_ptr(ptr_in); - - if (allocation) { - free_memory(allocation); - } -} - -#endif +#define _PM_ALLOCATOR common_hal_rgbmatrix_allocator_impl +#define _PM_FREE(x) (common_hal_rgbmatrix_free_impl((x)), (x)=NULL, (void)0) +extern void *common_hal_rgbmatrix_allocator_impl(size_t sz); +extern void common_hal_rgbmatrix_free_impl(void *); From dfa90cc11ddf7cd719c448ae9c516bf2b117aa3a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 1 Sep 2020 11:00:19 -0500 Subject: [PATCH 0765/1293] allocator.h: add a missing license notice --- shared-module/rgbmatrix/allocator.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/shared-module/rgbmatrix/allocator.h b/shared-module/rgbmatrix/allocator.h index 3191565a36..323fa5ec06 100644 --- a/shared-module/rgbmatrix/allocator.h +++ b/shared-module/rgbmatrix/allocator.h @@ -1,3 +1,29 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 From ce603dfebfa9a6ef057110c14c5d5b819eb93069 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 31 Aug 2020 16:00:41 -0500 Subject: [PATCH 0766/1293] rgbmatrix: Disable timer while reconstructing the display --- shared-module/rgbmatrix/RGBMatrix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c index 6fb36f6e3a..edeef7c1fc 100644 --- a/shared-module/rgbmatrix/RGBMatrix.c +++ b/shared-module/rgbmatrix/RGBMatrix.c @@ -66,6 +66,7 @@ void common_hal_rgbmatrix_rgbmatrix_construct(rgbmatrix_rgbmatrix_obj_t *self, i } void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t* self, mp_obj_t framebuffer) { + common_hal_rgbmatrix_timer_disable(self->timer); if (framebuffer) { self->framebuffer = framebuffer; framebuffer = mp_obj_new_bytearray_of_zeros(self->bufsize); From 71c63c2812ce63ceabdc74aac1b2dda5eb1ca338 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 1 Sep 2020 10:30:14 -0500 Subject: [PATCH 0767/1293] FramebufferDisplay: Don't set rotation via core_construct The expectations of displayio.Display and frambufferio.FramebufferDisplay are different when it comes to rotation. In displayio.Display, if you call core_construct with a WxH = 64x32 and rotation=90, you get something that is 32 pixels wide and 64 pixels tall in the LCD's coordinate system. This is fine, as the existing definitions were written to work like this. With framebuffer displays, however, the underlying framebuffer (such as RGBMatrix) says "I am WxH pixels wide in my coordinate system" and the constructor is given a rotation; when the rotation indicates a transpose that means "exchange rows and columns, so that to the Groups displayed on it, there is an effectively HxW pixel region for use". Happily, we already have a set_rotation method. Thus (modulo the time spent debugging things anyway:) the fix is simple: Always request no rotation from core_construct, then immediately fix up the rotation to match what was requested. Testing performed: 32x16 RGBMatrix on Metro M4 Express (but using the Airlift firmware, as this is the configuration the error was reported on): * initially construct display at 0, 90, 180, 270 degrees * later change angle to 0, 90, 180, 270 degrees * no garbled display * no safe mode crashes --- shared-module/framebufferio/FramebufferDisplay.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 6b5346877c..5163c3a7bc 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -66,7 +66,7 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu ram_height, 0, 0, - rotation, + 0, // rotation depth, fb_getter_default(get_grayscale, (depth < 8)), fb_getter_default(get_pixels_in_byte_share_row, false), @@ -92,6 +92,10 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu self->native_frames_per_second = fb_getter_default(get_native_frames_per_second, 60); self->native_ms_per_frame = 1000 / self->native_frames_per_second; + if (rotation != 0) { + common_hal_framebufferio_framebufferdisplay_set_rotation(self, rotation); + } + supervisor_start_terminal(self->core.width, self->core.height); // Set the group after initialization otherwise we may send pixels while we delay in From 3c083330f8a201d74b120c1f9f83baef8124fae5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 1 Sep 2020 10:58:54 -0500 Subject: [PATCH 0768/1293] RGBMatrix: Remove unused, dead allocation @tannewt noticed this in a pull request review. The allocated memory was never used, but the GC would have collected it eventually. --- shared-module/rgbmatrix/RGBMatrix.c | 1 - 1 file changed, 1 deletion(-) diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c index edeef7c1fc..c39ec99a27 100644 --- a/shared-module/rgbmatrix/RGBMatrix.c +++ b/shared-module/rgbmatrix/RGBMatrix.c @@ -69,7 +69,6 @@ void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t* self, common_hal_rgbmatrix_timer_disable(self->timer); if (framebuffer) { self->framebuffer = framebuffer; - framebuffer = mp_obj_new_bytearray_of_zeros(self->bufsize); mp_get_buffer_raise(self->framebuffer, &self->bufinfo, MP_BUFFER_READ); if (mp_get_buffer(self->framebuffer, &self->bufinfo, MP_BUFFER_RW)) { self->bufinfo.typecode = 'H' | MP_OBJ_ARRAY_TYPECODE_FLAG_RW; From 4e3cb55ce705878a811cad2c68317391c7b5497d Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 1 Sep 2020 12:41:58 -0400 Subject: [PATCH 0769/1293] share more of _bleio dict; fix one doc error --- shared-bindings/_bleio/Adapter.c | 2 +- shared-bindings/_bleio/__init__.c | 91 ++++++++++++------------------- 2 files changed, 37 insertions(+), 56 deletions(-) diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 4facd818a3..682177093d 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -73,7 +73,7 @@ //| communicate with the HCI co-processor in HCI mode. //| The `Adapter` object is enabled during this call. //| -//| After instantiating the Adapter, assign it to _bleio.adapter +//| After instantiating an Adapter, call `_bleio.set_adapter()` to set `_bleio.adapter` //| //| On boards with native BLE, you cannot create an instance of `_bleio.Adapter`; //| this constructor will raise `NotImplementedError`. diff --git a/shared-bindings/_bleio/__init__.c b/shared-bindings/_bleio/__init__.c index dece5820fb..3d9084dd53 100644 --- a/shared-bindings/_bleio/__init__.c +++ b/shared-bindings/_bleio/__init__.c @@ -123,7 +123,8 @@ STATIC mp_obj_dict_t bleio_module_globals; #endif //| def set_adapter(adapter: Optional[_bleio.Adapter]) -> None: -//| """Set the adapter to use for BLE. Not settable when the adapter is a singleton.""" +//| """Set the adapter to use for BLE, such as when using an HCI adapter. +//| Raises `NotImplementedError` when the adapter is a singleton and cannot be set.""" //| ... //| mp_obj_t bleio_set_adapter(mp_obj_t adapter_obj) { @@ -147,73 +148,53 @@ MP_DEFINE_CONST_FUN_OBJ_1(bleio_set_adapter_obj, bleio_set_adapter); #if CIRCUITPY_BLEIO_HCI // Make the module dictionary be in RAM, so that _bleio.adapter can be set. - +// Use a local macro to define how table entries should be converted. +#define OBJ_FROM_PTR MP_OBJ_FROM_PTR STATIC mp_map_elem_t bleio_module_globals_table[] = { - // Name must be the first entry so that the exception printing below is correct. - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__bleio) }, - { MP_ROM_QSTR(MP_QSTR_Adapter), MP_OBJ_FROM_PTR(&bleio_adapter_type) }, - { MP_ROM_QSTR(MP_QSTR_Address), MP_OBJ_FROM_PTR(&bleio_address_type) }, - { MP_ROM_QSTR(MP_QSTR_Attribute), MP_OBJ_FROM_PTR(&bleio_attribute_type) }, - { MP_ROM_QSTR(MP_QSTR_Connection), MP_OBJ_FROM_PTR(&bleio_connection_type) }, - { MP_ROM_QSTR(MP_QSTR_Characteristic), MP_OBJ_FROM_PTR(&bleio_characteristic_type) }, - { MP_ROM_QSTR(MP_QSTR_CharacteristicBuffer), MP_OBJ_FROM_PTR(&bleio_characteristic_buffer_type) }, - { MP_ROM_QSTR(MP_QSTR_Descriptor), MP_OBJ_FROM_PTR(&bleio_descriptor_type) }, - { MP_ROM_QSTR(MP_QSTR_PacketBuffer), MP_OBJ_FROM_PTR(&bleio_packet_buffer_type) }, - { MP_ROM_QSTR(MP_QSTR_ScanEntry), MP_OBJ_FROM_PTR(&bleio_scanentry_type) }, - { MP_ROM_QSTR(MP_QSTR_ScanResults), MP_OBJ_FROM_PTR(&bleio_scanresults_type) }, - { MP_ROM_QSTR(MP_QSTR_Service), MP_OBJ_FROM_PTR(&bleio_service_type) }, - { MP_ROM_QSTR(MP_QSTR_UUID), MP_OBJ_FROM_PTR(&bleio_uuid_type) }, - - // Attributes - { MP_ROM_QSTR(MP_QSTR_adapter), mp_const_none }, - - // Functions - { MP_ROM_QSTR(MP_QSTR_set_adapter), (mp_obj_t) &bleio_set_adapter_obj }, - - // Errors - { MP_ROM_QSTR(MP_QSTR_BluetoothError), MP_OBJ_FROM_PTR(&mp_type_bleio_BluetoothError) }, - { MP_ROM_QSTR(MP_QSTR_ConnectionError), MP_OBJ_FROM_PTR(&mp_type_bleio_ConnectionError) }, - { MP_ROM_QSTR(MP_QSTR_RoleError), MP_OBJ_FROM_PTR(&mp_type_bleio_RoleError) }, - { MP_ROM_QSTR(MP_QSTR_SecurityError), MP_OBJ_FROM_PTR(&mp_type_bleio_SecurityError) }, - - // Initialization - { MP_ROM_QSTR(MP_QSTR___init__), MP_OBJ_FROM_PTR(&bleio___init___obj) }, -}; - -STATIC MP_DEFINE_MUTABLE_DICT(bleio_module_globals, bleio_module_globals_table); - #else -// When _bleio.adapter is a singleton, and can't be set. - +#define OBJ_FROM_PTR MP_ROM_PTR STATIC const mp_rom_map_elem_t bleio_module_globals_table[] = { +#endif // Name must be the first entry so that the exception printing below is correct. { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__bleio) }, - { MP_ROM_QSTR(MP_QSTR_Adapter), MP_ROM_PTR(&bleio_adapter_type) }, - { MP_ROM_QSTR(MP_QSTR_Address), MP_ROM_PTR(&bleio_address_type) }, - { MP_ROM_QSTR(MP_QSTR_Attribute), MP_ROM_PTR(&bleio_attribute_type) }, - { MP_ROM_QSTR(MP_QSTR_Connection), MP_ROM_PTR(&bleio_connection_type) }, - { MP_ROM_QSTR(MP_QSTR_Characteristic), MP_ROM_PTR(&bleio_characteristic_type) }, - { MP_ROM_QSTR(MP_QSTR_CharacteristicBuffer), MP_ROM_PTR(&bleio_characteristic_buffer_type) }, - { MP_ROM_QSTR(MP_QSTR_Descriptor), MP_ROM_PTR(&bleio_descriptor_type) }, - { MP_ROM_QSTR(MP_QSTR_PacketBuffer), MP_ROM_PTR(&bleio_packet_buffer_type) }, - { MP_ROM_QSTR(MP_QSTR_ScanEntry), MP_ROM_PTR(&bleio_scanentry_type) }, - { MP_ROM_QSTR(MP_QSTR_ScanResults), MP_ROM_PTR(&bleio_scanresults_type) }, - { MP_ROM_QSTR(MP_QSTR_Service), MP_ROM_PTR(&bleio_service_type) }, - { MP_ROM_QSTR(MP_QSTR_UUID), MP_ROM_PTR(&bleio_uuid_type) }, + { MP_ROM_QSTR(MP_QSTR_Adapter), OBJ_FROM_PTR(&bleio_adapter_type) }, + { MP_ROM_QSTR(MP_QSTR_Address), OBJ_FROM_PTR(&bleio_address_type) }, + { MP_ROM_QSTR(MP_QSTR_Attribute), OBJ_FROM_PTR(&bleio_attribute_type) }, + { MP_ROM_QSTR(MP_QSTR_Connection), OBJ_FROM_PTR(&bleio_connection_type) }, + { MP_ROM_QSTR(MP_QSTR_Characteristic), OBJ_FROM_PTR(&bleio_characteristic_type) }, + { MP_ROM_QSTR(MP_QSTR_CharacteristicBuffer), OBJ_FROM_PTR(&bleio_characteristic_buffer_type) }, + { MP_ROM_QSTR(MP_QSTR_Descriptor), OBJ_FROM_PTR(&bleio_descriptor_type) }, + { MP_ROM_QSTR(MP_QSTR_PacketBuffer), OBJ_FROM_PTR(&bleio_packet_buffer_type) }, + { MP_ROM_QSTR(MP_QSTR_ScanEntry), OBJ_FROM_PTR(&bleio_scanentry_type) }, + { MP_ROM_QSTR(MP_QSTR_ScanResults), OBJ_FROM_PTR(&bleio_scanresults_type) }, + { MP_ROM_QSTR(MP_QSTR_Service), OBJ_FROM_PTR(&bleio_service_type) }, + { MP_ROM_QSTR(MP_QSTR_UUID), OBJ_FROM_PTR(&bleio_uuid_type) }, - // Properties +#if CIRCUITPY_BLEIO_HCI + // For HCI, _bleio.adapter is settable, and starts as None. + { MP_ROM_QSTR(MP_QSTR_adapter), mp_const_none }, + { MP_ROM_QSTR(MP_QSTR_set_adapter), (mp_obj_t) &bleio_set_adapter_obj }, +#else + // For non-HCI _bleio.adapter is a fixed singleton, and is not settable. + // _bleio.set_adapter will raise NotImplementedError. { MP_ROM_QSTR(MP_QSTR_adapter), MP_ROM_PTR(&common_hal_bleio_adapter_obj) }, + { MP_ROM_QSTR(MP_QSTR_set_adapter), MP_ROM_PTR(&bleio_set_adapter_obj) }, +#endif // Errors - { MP_ROM_QSTR(MP_QSTR_BluetoothError), MP_ROM_PTR(&mp_type_bleio_BluetoothError) }, - { MP_ROM_QSTR(MP_QSTR_ConnectionError), MP_ROM_PTR(&mp_type_bleio_ConnectionError) }, - { MP_ROM_QSTR(MP_QSTR_RoleError), MP_ROM_PTR(&mp_type_bleio_RoleError) }, - { MP_ROM_QSTR(MP_QSTR_SecurityError), MP_ROM_PTR(&mp_type_bleio_SecurityError) }, + { MP_ROM_QSTR(MP_QSTR_BluetoothError), OBJ_FROM_PTR(&mp_type_bleio_BluetoothError) }, + { MP_ROM_QSTR(MP_QSTR_ConnectionError), OBJ_FROM_PTR(&mp_type_bleio_ConnectionError) }, + { MP_ROM_QSTR(MP_QSTR_RoleError), OBJ_FROM_PTR(&mp_type_bleio_RoleError) }, + { MP_ROM_QSTR(MP_QSTR_SecurityError), OBJ_FROM_PTR(&mp_type_bleio_SecurityError) }, // Initialization - { MP_ROM_QSTR(MP_QSTR___init__), MP_ROM_PTR(&bleio___init___obj) }, + { MP_ROM_QSTR(MP_QSTR___init__), OBJ_FROM_PTR(&bleio___init___obj) }, }; +#if CIRCUITPY_BLEIO_HCI +// Module dict is mutable to allow setting _bleio.adapter. +STATIC MP_DEFINE_MUTABLE_DICT(bleio_module_globals, bleio_module_globals_table); +#else STATIC MP_DEFINE_CONST_DICT(bleio_module_globals, bleio_module_globals_table); #endif From 51acfbbb01978e0b4a31013d9b25d28f2d7265f3 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Sun, 30 Aug 2020 22:05:24 +0000 Subject: [PATCH 0770/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (780 of 780 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 65fe17cde8..b0233b5dbc 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: 2020-08-27 11:21-0400\n" -"PO-Revision-Date: 2020-08-21 18:19+0000\n" +"PO-Revision-Date: 2020-08-31 00:37+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -1375,6 +1375,8 @@ msgid "" "Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " "instead" msgstr "" +"A porta não aceita pinos ou frequência. Em vez disso, construa e passe um " +"PWMOut Carrier" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" @@ -2967,11 +2969,11 @@ msgstr "" #: shared-bindings/displayio/Bitmap.c msgid "out of range of source" -msgstr "" +msgstr "fora do alcance da fonte" #: shared-bindings/displayio/Bitmap.c msgid "out of range of target" -msgstr "" +msgstr "fora do alcance do alvo" #: py/objint_mpz.c msgid "overflow converting long int to machine word" @@ -3156,7 +3158,7 @@ msgstr "o sosfilt requer que os argumentos sejam iteráveis" #: shared-bindings/displayio/Bitmap.c msgid "source palette too large" -msgstr "" +msgstr "a paleta de origem é muito grande" #: py/objstr.c msgid "start/end indices" From 23fc7a573ee0a53a49004690d39efcf71698b977 Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Tue, 1 Sep 2020 05:56:43 +0000 Subject: [PATCH 0771/1293] Translated using Weblate (Japanese) Currently translated at 68.7% (536 of 780 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ja/ --- locale/ja.po | 345 +++++++++++++++++++++++++-------------------------- 1 file changed, 170 insertions(+), 175 deletions(-) diff --git a/locale/ja.po b/locale/ja.po index 10e1d09a06..789930cd00 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-08-27 11:21-0400\n" -"PO-Revision-Date: 2020-08-16 13:25+0000\n" +"PO-Revision-Date: 2020-09-01 12:07+0000\n" "Last-Translator: Taku Fukada \n" "Language-Team: none\n" "Language: ja\n" @@ -16,7 +16,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.2-dev\n" +"X-Generator: Weblate 4.2.1-dev\n" #: main.c msgid "" @@ -42,7 +42,7 @@ msgid "" "To exit, please reset the board without " msgstr "" "\n" -"終了するには、次の操作なしにリセットしてください: " +"終了するには、次の操作をせずにリセットしてください: " #: py/obj.c msgid " File \"%q\"" @@ -84,7 +84,7 @@ msgstr "%q インデックスは範囲外" #: py/obj.c msgid "%q indices must be integers, not %q" -msgstr "%qインデクスは、%qでなく整数が必要です" +msgstr "%qインデクスは、%qでなく整数が必要" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -121,7 +121,7 @@ msgstr "%q()は%d個の位置引数を受け取りますが、%d個しか与え #: py/argcheck.c msgid "'%q' argument required" -msgstr "引数'%q'が必要" +msgstr "引数 '%q' が必要" #: py/runtime.c msgid "'%q' object cannot assign attribute '%q'" @@ -177,7 +177,7 @@ msgstr "" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects an FPU register" -msgstr "" +msgstr "'%s'にはFPUレジスタが必要" #: py/emitinlinethumb.c #, c-format @@ -227,15 +227,15 @@ msgstr "関数外でのawait" #: py/compile.c msgid "'await', 'async for' or 'async with' outside async function" -msgstr "async関数外でのawait, async for, async with" +msgstr "async関数外での await, async for, async with" #: py/compile.c msgid "'break' outside loop" -msgstr "ループ外での 'break'" +msgstr "ループ外でのbreak" #: py/compile.c msgid "'continue' outside loop" -msgstr "ループ外での 'continue'" +msgstr "ループ外でのcontinue" #: py/objgenerator.c msgid "'coroutine' object is not an iterator" @@ -243,11 +243,11 @@ msgstr "'coroutine' オブジェクトはイテレータではありません" #: py/compile.c msgid "'data' requires at least 2 arguments" -msgstr "" +msgstr "'data'には少なくとも2つの引数が必要" #: py/compile.c msgid "'data' requires integer arguments" -msgstr "" +msgstr "'data'には整数の引数が必要" #: py/compile.c msgid "'label' requires 1 argument" @@ -255,11 +255,11 @@ msgstr "" #: py/compile.c msgid "'return' outside function" -msgstr "関数外での 'return'" +msgstr "関数外でのreturn" #: py/compile.c msgid "'yield' outside function" -msgstr "関数外での 'yield'" +msgstr "関数外でのyield" #: py/compile.c msgid "*x must be assignment target" @@ -285,7 +285,7 @@ msgstr "ハードウェア割り込みチャネルは使用中" #: shared-bindings/_bleio/Address.c #, c-format msgid "Address must be %d bytes long" -msgstr "アドレスの長さは %d バイトでなければなりません" +msgstr "アドレスは、%dバイト長でなければなりません" #: shared-bindings/_bleio/Address.c msgid "Address type out of range" @@ -369,16 +369,16 @@ msgstr "Arrayの各値は1バイトでなければなりません" #: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" -msgstr "最大で %d 個の %q が指定できます(%d個でなく)" +msgstr "最大で %d個の %q が指定できます(%d個でなく)" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" -msgstr "%d 個のブロックの確保を試みました" +msgstr "%d個のブロックの確保を試みました" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." -msgstr "MicroPython VMの非実行時にヒープの確保を試みました" +msgstr "MicroPython VM 非実行時にヒープの確保を試みました" #: main.c msgid "Auto-reload is off.\n" @@ -407,7 +407,7 @@ msgstr "ビット深度は8の倍数でなければなりません" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "フロー制御のためにRXとTXの両方が必要" +msgstr "フロー制御のためRXとTXの両方が必要" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -417,7 +417,7 @@ msgstr "両方のピンにハードウェア割り込み対応が必要" #: shared-bindings/framebufferio/FramebufferDisplay.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "Brightnessは0から1.0まででなければなりません" +msgstr "brightnessは0から1.0まででなければなりません" #: shared-bindings/supervisor/__init__.c msgid "Brightness must be between 0 and 255" @@ -529,7 +529,7 @@ msgstr "同じピン上の両チャネルに出力できません" #: shared-module/bitbangio/SPI.c msgid "Cannot read without MISO pin." -msgstr "MISOピンなしで読み込みはできません" +msgstr "MISOピンなしで読み込めません" #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" @@ -537,13 +537,13 @@ msgstr "ファイルへ記録できません" #: shared-module/storage/__init__.c msgid "Cannot remount '/' when USB is active." -msgstr "USBがアクティブな時に '/' を再マウントできません" +msgstr "USBがアクティブの時に'/'を再マウントできません" #: 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 "ブートローダが存在しないため、ブートローダへとリセットできません" #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." @@ -567,11 +567,11 @@ msgstr "スカラのサイズを曖昧さなしに取得できません" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" -msgstr "使用中のタイマー上で周波数を変えられません" +msgstr "使用中のタイマー上では周波数を変えられません" #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." -msgstr "MOSIピンなしに書き込みできません" +msgstr "MOSIピンなしで書き込みできません" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -622,7 +622,7 @@ msgstr "破損した .mpy ファイル" #: py/emitglue.c msgid "Corrupt raw code" -msgstr "破損した raw code" +msgstr "破損したraw code" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" @@ -658,7 +658,7 @@ msgstr "PWMを再スタートできません" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" -msgstr "" +msgstr "アドレスをセットできません" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" @@ -762,7 +762,7 @@ msgstr "正規表現にエラーがあります" #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" -msgstr "" +msgstr "%qが必要" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c @@ -776,7 +776,7 @@ msgstr "" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" -msgstr "" +msgstr "UUIDが必要" #: shared-bindings/_bleio/Adapter.c msgid "Expected an Address" @@ -793,7 +793,7 @@ msgstr "" #: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" -msgstr "FFTは ndarray に対してのみ定義されています" +msgstr "FFTはndarrayでのみ使えます" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." @@ -815,7 +815,7 @@ msgstr "RXバッファの確保に失敗" #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" -msgstr "%d バイトのRXバッファの確保に失敗" +msgstr "%dバイトのRXバッファの確保に失敗" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" @@ -849,11 +849,11 @@ msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." -msgstr "" +msgstr "キャプチャした周波数は能力を超えています。キャプチャ停止" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" -msgstr "このタイマーを使う既存のPWMOutと周波数を一致させてください" +msgstr "このタイマーを使う既存のPWMOutと周波数を一致させる必要があります" #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c @@ -877,11 +877,11 @@ msgstr "ハードウェアビジー。代替のピンを試してください" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" -msgstr "ハードウェア使用中。代替のピンを試してください" +msgstr "ハードウェア使用中。代わりのピンを試してください" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" -msgstr "閉じられたファイルに対するI/O操作" +msgstr "閉じられたファイルへのI/O操作" #: ports/stm/common-hal/busio/I2C.c msgid "I2C Init Error" @@ -894,15 +894,13 @@ msgstr "I2SOutが利用できません" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "IV の長さは %d バイトでなければなりません" +msgstr "IVは%dバイト長でなければなりません" #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." -msgstr "" -"非互換の.mpyファイルです。全ての.mpyファイルをアップデートしてください。詳細" -"は http://adafru.it/mpy-update を参照" +msgstr "非互換の.mpyファイルです。全ての.mpyファイルを更新してください。詳細は http://adafru.it/mpy-update を参照" #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" @@ -941,7 +939,7 @@ msgstr "不正な%qピン" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c #: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" -msgstr "" +msgstr "不正な%qピン選択" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" @@ -953,7 +951,7 @@ msgstr "不正なBMPファイル" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" -msgstr "無効なDACピンが与えられました" +msgstr "不正なDACピンが与えられました" #: ports/atmel-samd/common-hal/pwmio/PWMOut.c #: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c @@ -967,7 +965,7 @@ msgstr "不正な引数" #: shared-module/displayio/Bitmap.c msgid "Invalid bits per value" -msgstr "値ごとのビット数が不正" +msgstr "不正なbits per value" #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" @@ -979,7 +977,7 @@ msgstr "不正なバイトオーダー文字列" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "不正なキャプチャ周期。有効な周期は1 - 500" +msgstr "不正なキャプチャ周期。有効な周期は1-500" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid channel count" @@ -987,7 +985,7 @@ msgstr "不正なチャンネル数" #: shared-bindings/digitalio/DigitalInOut.c msgid "Invalid direction." -msgstr "不正な方向" +msgstr "不正な入出力方向" #: shared-module/audiocore/WaveFile.c msgid "Invalid file" @@ -1012,7 +1010,7 @@ msgstr "不正なビット数" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c msgid "Invalid phase" -msgstr "" +msgstr "不正なphase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c @@ -1055,11 +1053,11 @@ msgstr "不正なプロパティ" #: shared-bindings/microcontroller/__init__.c msgid "Invalid run mode." -msgstr "不正な Run Mode" +msgstr "不正なRun Mode" #: shared-module/_bleio/Attribute.c msgid "Invalid security_mode" -msgstr "不正な security_mode" +msgstr "不正なsecurity_mode" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice" @@ -1071,7 +1069,7 @@ msgstr "不正なボイス数" #: shared-module/audiocore/WaveFile.c msgid "Invalid wave file" -msgstr "不正なWaveファイル" +msgstr "不正なwaveファイル" #: ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" @@ -1167,7 +1165,7 @@ msgstr "DMAチャネルが見つかりません" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" -msgstr "MISOピンがありません" +msgstr "MISOピンなし" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" @@ -1203,7 +1201,7 @@ msgstr "使われていないGCLKがありません" #: shared-bindings/os/__init__.c msgid "No hardware random available" -msgstr "ハードウェア乱数が利用できません" +msgstr "利用可能なハードウェア乱数なし" #: ports/atmel-samd/common-hal/ps2io/Ps2.c msgid "No hardware support on clk pin" @@ -1254,7 +1252,7 @@ msgstr "接続されていません" #: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c #: shared-bindings/audiopwmio/PWMAudioOut.c msgid "Not playing" -msgstr "再生中していません" +msgstr "再生していません" #: main.c msgid "Not running saved code.\n" @@ -1290,13 +1288,12 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." -msgstr "オーバーサンプルは8の倍数でなければなりません" +msgstr "オーバーサンプルは8の倍数が必要" #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "" -"PWMの duty_cycle 値は 0 から 65535 の間でなければなりません(16ビット解像度)" +msgstr "PWMのduty_cycle値は0から65535の間でなければなりません(16ビット解像度)" #: shared-bindings/pwmio/PWMOut.c msgid "" @@ -1364,7 +1361,7 @@ msgstr "Prefixバッファはヒープ上になければなりません" #: main.c #, fuzzy msgid "Press any key to enter the REPL. Use CTRL-D to reload." -msgstr "何らかのキーを押すとREPLに入ります。CTRL-Dでリロードします" +msgstr "いずれかのキーを押すとREPLに入ります。リロードはCTRL-D" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." @@ -1372,11 +1369,11 @@ msgstr "方向がoutputのときpullは使われません" #: ports/stm/ref/pulseout-pre-timeralloc.c msgid "PulseOut not supported on this chip" -msgstr "" +msgstr "PulseOutはこのチップでサポートされていません" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" -msgstr "乱数生成器の解体エラー" +msgstr "RNG解体エラー" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" @@ -1427,7 +1424,7 @@ msgstr "要求のAESモードは非サポート" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" -msgstr "右チャネルは非サポート" +msgstr "右チャネルはサポートされていません" #: shared-bindings/_pew/PewPew.c msgid "Row entry must be digitalio.DigitalInOut" @@ -1454,7 +1451,7 @@ msgstr "" #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO Init Error %d" -msgstr "" +msgstr "SDIO初期化エラー %d" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" @@ -1466,7 +1463,7 @@ msgstr "SPI再初期化エラー" #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" -msgstr "サンプルレートは正数でなければなりません" +msgstr "サンプルレートには正の数が必要" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #, c-format @@ -1479,7 +1476,7 @@ msgstr "スキャンはすでに進行中。stop_scanで停止してください #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" -msgstr "選択されたCTSピンが不正です" +msgstr "選択されたCTSピンが不正" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected RTS pin not valid" @@ -1515,7 +1512,7 @@ msgstr "スタックサイズは少なくとも256以上が必要" #: shared-bindings/multiterminal/__init__.c msgid "Stream missing readinto() or write() method." -msgstr "" +msgstr "streamにreadinto()またはwrite()メソッドがありません" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" @@ -1534,8 +1531,8 @@ msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Please increase the stack size if you know how, or if not:" msgstr "" -"スタックが小さすぎたことによりCircuitPythonのヒープが破損しました。\n" -"スタックサイズを上げるか、その方法が分からなければ:" +"スタックが小さすぎたためCircuitPythonのヒープが壊れました。\n" +"スタックサイズを上げるか、その方法が分からなければ:" #: supervisor/shared/safe_mode.c msgid "" @@ -1566,11 +1563,11 @@ msgstr "" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's sample rate does not match the mixer's" -msgstr "" +msgstr "サンプルレートがサンプルとミキサーで一致しません" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's signedness does not match the mixer's" -msgstr "サンプルの符号有無がミキサーと一致しません" +msgstr "符号の有無がサンプルとミキサーで一致しません" #: shared-bindings/displayio/TileGrid.c msgid "Tile height must exactly divide bitmap height" @@ -1582,7 +1579,7 @@ msgstr "タイルのインデクスが範囲外" #: shared-bindings/displayio/TileGrid.c msgid "Tile value out of bounds" -msgstr "タイルの値が範囲外" +msgstr "タイル値が範囲外" #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" @@ -1591,7 +1588,7 @@ msgstr "タイルの幅はビットマップの幅を割り切れる値でなけ #: ports/nrf/common-hal/_bleio/Adapter.c #, c-format msgid "Timeout is too long: Maximum timeout length is %d seconds" -msgstr "タイムアウトが長すぎ。最大のタイムアウト長は%d秒" +msgstr "タイムアウトが長すぎです。最大のタイムアウト長は%d秒" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "" @@ -1616,7 +1613,7 @@ msgstr "" #: py/obj.c msgid "Traceback (most recent call last):\n" -msgstr "" +msgstr "トレースバック(最新の呼び出しが末尾):\n" #: shared-bindings/time/__init__.c msgid "Tuple or struct_time argument required" @@ -1672,7 +1669,7 @@ msgstr "" #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" -msgstr "" +msgstr "I2Cディスプレイを %x に見つけられません" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1685,7 +1682,7 @@ msgstr "パーザを初期化できません" #: shared-module/displayio/OnDiskBitmap.c msgid "Unable to read color palette data" -msgstr "カラーパレットのデータを読み込めません" +msgstr "カラーパレットデータを読み込めません" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." @@ -1728,7 +1725,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" -msgstr "" +msgstr "非サポートのbaudrate" #: shared-module/displayio/display_core.c msgid "Unsupported display bus type" @@ -1736,11 +1733,11 @@ msgstr "" #: shared-module/audiocore/WaveFile.c msgid "Unsupported format" -msgstr "" +msgstr "サポートされていないフォーマット" #: py/moduerrno.c msgid "Unsupported operation" -msgstr "" +msgstr "サポートされていない操作" #: shared-bindings/digitalio/DigitalInOut.c msgid "Unsupported pull value." @@ -1762,7 +1759,7 @@ msgstr "" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Voltage read timed out" -msgstr "" +msgstr "電圧読み取りがタイムアウト" #: main.c msgid "WARNING: Your code filename has two extensions\n" @@ -1824,11 +1821,11 @@ msgstr "" #: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" -msgstr "" +msgstr "bytes-likeオブジェクトが必要" #: lib/embed/abort_.c msgid "abort() called" -msgstr "" +msgstr "abort()が呼ばれました" #: extmod/machine_mem.c #, c-format @@ -1837,7 +1834,7 @@ msgstr "" #: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" -msgstr "" +msgstr "アドレスが範囲外" #: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" @@ -1870,7 +1867,7 @@ msgstr "" #: py/runtime.c msgid "argument should be a '%q' not a '%q'" -msgstr "" +msgstr "引数には '%q' が必要('%q' ではなく)" #: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" @@ -1878,7 +1875,7 @@ msgstr "" #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" -msgstr "" +msgstr "右辺にはarray/bytesが必要" #: extmod/ulab/code/numerical/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" @@ -1886,7 +1883,7 @@ msgstr "" #: py/objstr.c msgid "attributes not supported yet" -msgstr "" +msgstr "属性はまだサポートされていません" #: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" @@ -1898,7 +1895,7 @@ msgstr "axisは -1, 0, 1 のいずれかでなければなりません" #: extmod/ulab/code/numerical/numerical.c msgid "axis must be None, 0, or 1" -msgstr "axisは None, 0, 1 のいずれかが必要です" +msgstr "axisは None, 0, 1 のいずれか" #: py/builtinevex.c msgid "bad compile mode" @@ -1910,11 +1907,11 @@ msgstr "" #: py/objstr.c msgid "bad format string" -msgstr "" +msgstr "不正な書式化文字列" #: py/binary.c msgid "bad typecode" -msgstr "typecodeが不正" +msgstr "不正なtypecode" #: py/emitnative.c msgid "binary op %q not implemented" @@ -1922,7 +1919,7 @@ msgstr "" #: shared-bindings/busio/UART.c msgid "bits must be 7, 8 or 9" -msgstr "" +msgstr "bitsは7, 8, 9のいずれかが必要" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" @@ -1959,7 +1956,7 @@ msgstr "" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "byteorder is not a string" -msgstr "" +msgstr "byteorderが文字列ではありません" #: ports/atmel-samd/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" @@ -1967,15 +1964,15 @@ msgstr "" #: py/objstr.c msgid "bytes value out of range" -msgstr "" +msgstr "範囲外のバイト値" #: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration is out of range" -msgstr "" +msgstr "キャリブレーションが範囲外" #: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is read only" -msgstr "" +msgstr "calibrationは読み込み専用" #: ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration value out of range +/-127" @@ -1995,24 +1992,24 @@ msgstr "" #: py/objtype.c msgid "can't add special method to already-subclassed class" -msgstr "" +msgstr "サブクラス化済みのクラスに特殊メソッドを追加できません" #: py/compile.c msgid "can't assign to expression" -msgstr "" +msgstr "式には代入できません" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c #: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" -msgstr "" +msgstr "%qを%qに変換できません" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" -msgstr "" +msgstr "オブジェクト '%q' を %q に暗黙に変換できません" #: py/obj.c msgid "can't convert to %q" -msgstr "" +msgstr "%q に変換できません" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2020,7 +2017,7 @@ msgstr "" #: py/compile.c msgid "can't declare nonlocal in outer code" -msgstr "" +msgstr "外側のコードでnonlocalは使えません" #: py/compile.c msgid "can't delete expression" @@ -2032,15 +2029,15 @@ msgstr "" #: py/objcomplex.c msgid "can't do truncated division of a complex number" -msgstr "" +msgstr "複素数の切り捨て除算はできません" #: py/compile.c msgid "can't have multiple **x" -msgstr "" +msgstr "複数の **x は持てません" #: py/compile.c msgid "can't have multiple *x" -msgstr "" +msgstr "複数の *x は持てません" #: py/emitnative.c msgid "can't implicitly convert '%q' to 'bool'" @@ -2090,7 +2087,7 @@ msgstr "" #: py/objstr.c msgid "" "can't switch from manual field specification to automatic field numbering" -msgstr "" +msgstr "手動と自動のフィールド指定は混在できません" #: py/objtype.c msgid "cannot create '%q' instances" @@ -2106,11 +2103,11 @@ msgstr "" #: py/builtinimport.c msgid "cannot perform relative import" -msgstr "" +msgstr "相対インポートはできません" #: extmod/ulab/code/ndarray.c msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" +msgstr "入力/出力シェイプが互換でなくreshapeできません" #: py/emitnative.c msgid "casting" @@ -2138,7 +2135,7 @@ msgstr "" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a buffer, tuple, list, or int" -msgstr "" +msgstr "カラーバッファはbuffer, tuple, list, int のいずれかです" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a bytearray or array of type 'b' or 'B'" @@ -2146,7 +2143,7 @@ msgstr "" #: shared-bindings/displayio/Palette.c msgid "color must be between 0x000000 and 0xffffff" -msgstr "" +msgstr "色は0x000000から0xffffffでなければなりません" #: shared-bindings/displayio/ColorConverter.c msgid "color should be an int" @@ -2154,7 +2151,7 @@ msgstr "" #: py/objcomplex.c msgid "complex division by zero" -msgstr "" +msgstr "複素数ゼロ除算" #: py/objfloat.c py/parsenum.c msgid "complex values not supported" @@ -2162,7 +2159,7 @@ msgstr "" #: extmod/moduzlib.c msgid "compression header" -msgstr "" +msgstr "圧縮ヘッダー" #: py/parse.c msgid "constant must be an integer" @@ -2174,11 +2171,11 @@ msgstr "" #: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be linear arrays" -msgstr "" +msgstr "convolve引数には1次元arrayが必要" #: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" -msgstr "" +msgstr "convolve引数にはndarrayが必要" #: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" @@ -2190,7 +2187,7 @@ msgstr "" #: extmod/ulab/code/poly/poly.c msgid "could not invert Vandermonde matrix" -msgstr "" +msgstr "ヴァンデルモンド行列の逆行列を求められません" #: shared-module/sdcardio/SDCard.c msgid "couldn't determine SD card version" @@ -2214,7 +2211,7 @@ msgstr "" #: py/compile.c msgid "default 'except' must be last" -msgstr "" +msgstr "デフォルトのexceptは最後に置く必要があります" #: shared-bindings/audiobusio/PDMIn.c msgid "" @@ -2223,11 +2220,11 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" -msgstr "" +msgstr "bit_depath = 16 用のバッファにはタイプ'H'のarrayが必要" #: shared-bindings/audiobusio/PDMIn.c msgid "destination_length must be an int >= 0" -msgstr "" +msgstr "desitination_lengthには正の整数が必要" #: py/objdict.c msgid "dict update sequence has wrong length" @@ -2235,7 +2232,7 @@ msgstr "" #: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" -msgstr "" +msgstr "引数にはndarrayが必要" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c @@ -2325,7 +2322,7 @@ msgstr "f-string: '}'が必要" #: py/parse.c msgid "f-string: single '}' is not allowed" -msgstr "f-string: 1つだけの '}' は許されません" +msgstr "f-string: 1つだけの'}'は許されません" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c @@ -2334,7 +2331,7 @@ msgstr "fileにはバイトモードで開かれたファイルが必要" #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" -msgstr "" +msgstr "filesystemにはmountメソッドが必要" #: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" @@ -2374,7 +2371,7 @@ msgstr "" #: py/objstr.c msgid "format requires a dict" -msgstr "" +msgstr "formatにはdictが必要" #: py/objdeque.c msgid "full" @@ -2399,7 +2396,7 @@ msgstr "" #: extmod/ulab/code/compare/compare.c msgid "function is implemented for scalars and ndarrays only" -msgstr "" +msgstr "スカラ値およびndarrayのみを受け取ります" #: py/argcheck.c #, c-format @@ -2427,7 +2424,7 @@ msgstr "" #: shared-bindings/time/__init__.c msgid "function takes exactly 9 arguments" -msgstr "この関数はちょうど9個の引数をとります" +msgstr "関数はちょうど9個の引数をとります" #: py/objgenerator.c msgid "generator already executing" @@ -2443,7 +2440,7 @@ msgstr "" #: extmod/moduheapq.c msgid "heap must be a list" -msgstr "" +msgstr "heapにはリストが必要" #: py/compile.c msgid "identifier redefined as global" @@ -2488,7 +2485,7 @@ msgstr "" #: py/compile.c msgid "inline assembler must be a function" -msgstr "" +msgstr "インラインアセンブラは関数でなければなりません" #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer or a 2-tuple" @@ -2496,7 +2493,7 @@ msgstr "" #: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" -msgstr "入力 array の長さは2の累乗でなければなりません" +msgstr "入力array長は2の累乗でなければなりません" #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" @@ -2508,7 +2505,7 @@ msgstr "入力行列が非対称" #: extmod/ulab/code/linalg/linalg.c msgid "input matrix is singular" -msgstr "" +msgstr "入力が非正則行列" #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" @@ -2516,7 +2513,7 @@ msgstr "" #: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" -msgstr "" +msgstr "入力はtuple, list, range, ndarrayでなければなりません" #: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" @@ -2524,7 +2521,7 @@ msgstr "" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "int() の2番目の引数は 2 以上 36 以下でなければなりません" +msgstr "int()の第2引数は2以上36以下でなければなりません" #: py/objstr.c msgid "integer required" @@ -2537,7 +2534,7 @@ msgstr "" #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" -msgstr "" +msgstr "intervalは%s-%sの範囲でなければなりません" #: lib/netutils/netutils.c msgid "invalid arguments" @@ -2565,7 +2562,7 @@ msgstr "不正な鍵" #: py/compile.c msgid "invalid micropython decorator" -msgstr "" +msgstr "不正なmicropythonデコレータ" #: shared-bindings/random/__init__.c msgid "invalid step" @@ -2590,7 +2587,7 @@ msgstr "数字として不正な構文" #: py/objtype.c msgid "issubclass() arg 1 must be a class" -msgstr "issubclass()の1つ目の引数はクラスです" +msgstr "issubclass()の第1引数はクラスが必要" #: py/objtype.c msgid "issubclass() arg 2 must be a class or a tuple of classes" @@ -2598,19 +2595,19 @@ msgstr "" #: extmod/ulab/code/ndarray.c msgid "iterables are not of the same length" -msgstr "イテレート可能なオブジェクトが同じ長さではありません" +msgstr "iterableが同じ長さではありません" #: extmod/ulab/code/linalg/linalg.c msgid "iterations did not converge" -msgstr "" +msgstr "収束しません" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" -msgstr "" +msgstr "joinには、str/bytes(のうち自身と一致した型の)リストが必要" #: py/argcheck.c msgid "keyword argument(s) not yet implemented - use normal args instead" -msgstr "" +msgstr "キーワード引数はまだ実装されていません。通常の引数を使ってください。" #: py/bc.c msgid "keywords must be strings" @@ -2618,7 +2615,7 @@ msgstr "キーワードは文字列でなければなりません" #: py/emitinlinethumb.c py/emitinlinextensa.c msgid "label '%q' not defined" -msgstr "" +msgstr "ラベル'%q'は定義されていません" #: py/compile.c msgid "label redefined" @@ -2721,11 +2718,11 @@ msgstr "" #: extmod/ulab/code/numerical/numerical.c msgid "n must be between 0, and 9" -msgstr "nは0から9までです" +msgstr "nは0から9まで" #: py/runtime.c msgid "name '%q' is not defined" -msgstr "名前'%q'は定義されていません" +msgstr "名前 '%q' は定義されていません" #: py/runtime.c msgid "name not defined" @@ -2733,7 +2730,7 @@ msgstr "名前が定義されていません" #: py/compile.c msgid "name reused for argument" -msgstr "名前が引数で再利用されています" +msgstr "引数で名前が再利用されています" #: py/emitnative.c msgid "native yield" @@ -2742,7 +2739,7 @@ msgstr "" #: py/runtime.c #, c-format msgid "need more than %d values to unpack" -msgstr "" +msgstr "アンパックする値は%d個では足りません" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" @@ -2766,7 +2763,7 @@ msgstr "利用可能なNICがありません" #: py/compile.c msgid "no binding for nonlocal found" -msgstr "" +msgstr "nonlocalの対象が見つかりません" #: py/builtinimport.c msgid "no module named '%q'" @@ -2783,7 +2780,7 @@ msgstr "SDカードからの応答がありません" #: py/runtime.c msgid "no such attribute" -msgstr "そのような属性はありません" +msgstr "指定の属性はありません" #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -2791,7 +2788,7 @@ msgstr "" #: py/compile.c msgid "non-default argument follows default argument" -msgstr "" +msgstr "デフォルト引数の後に通常の引数は置けません" #: extmod/modubinascii.c msgid "non-hex digit found" @@ -2815,11 +2812,11 @@ msgstr "" #: py/objstr.c msgid "not enough arguments for format string" -msgstr "" +msgstr "書式化文字列への引数が足りません" #: extmod/ulab/code/poly/poly.c msgid "number of arguments must be 2, or 3" -msgstr "引数の数は2個または3個でなければなりません" +msgstr "引数は2個または3個でなければなりません" #: extmod/ulab/code/ulab_create.c msgid "number of points must be at least 2" @@ -2847,7 +2844,7 @@ msgstr "オブジェクトは要素の取得をサポートしていません" #: py/runtime.c msgid "object not an iterator" -msgstr "オブジェクトはイテレータではありません" +msgstr "オブジェクトがイテレータではありません" #: py/objtype.c py/runtime.c msgid "object not callable" @@ -2863,7 +2860,7 @@ msgstr "オブジェクトはイテレートできません" #: py/obj.c msgid "object of type '%q' has no len()" -msgstr "" +msgstr "オブジェクト(型 '%q')はlen()を持ちません" #: py/obj.c msgid "object with buffer protocol required" @@ -2879,7 +2876,7 @@ msgstr "" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" -msgstr "" +msgstr "bit_depth=16のみサポートしています" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" @@ -2914,7 +2911,7 @@ msgstr "ord()は1文字を要求しますが、長さ %d の文字列が与え #: shared-bindings/displayio/Bitmap.c msgid "out of range of source" -msgstr "" +msgstr "ソースが範囲外" #: shared-bindings/displayio/Bitmap.c msgid "out of range of target" @@ -2922,7 +2919,7 @@ msgstr "" #: py/objint_mpz.c msgid "overflow converting long int to machine word" -msgstr "long int をマシンの word に変換する際にオーバーフローしました" +msgstr "long intをマシンのwordに変換する際にオーバーフローしました" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" @@ -2930,7 +2927,7 @@ msgstr "パレットの長さは32バイトでなければなりません" #: shared-bindings/displayio/Palette.c msgid "palette_index should be an int" -msgstr "palette_indexは整数です" +msgstr "palette_indexには整数が必要" #: py/compile.c msgid "parameter annotation must be an identifier" @@ -2974,7 +2971,7 @@ msgstr "pow()の3つ目の引数は0にできません" #: py/objint_mpz.c msgid "pow() with 3 arguments requires integers" -msgstr "pow()の3番目の引数には整数が必要" +msgstr "pow()の第3引数には整数が必要" #: extmod/modutimeq.c msgid "queue overflow" @@ -2982,7 +2979,7 @@ msgstr "キューがオーバーフローしました" #: py/parse.c msgid "raw f-strings are not implemented" -msgstr "" +msgstr "raw f-文字列は実装されていません" #: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" @@ -2995,7 +2992,7 @@ msgstr "相対インポート" #: py/obj.c #, c-format msgid "requested length %d but object has length %d" -msgstr "長さ%dが必要。オブジェクトの長さは%d" +msgstr "必要な長さは%dですがオブジェクトの長さは%d" #: py/compile.c msgid "return annotation must be an identifier" @@ -3027,9 +3024,7 @@ msgstr "rsplit(None,n)" msgid "" "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " "'B'" -msgstr "" -"sample_source バッファは、bytearray または 'h', 'H', 'b', 'B'型のarrayでなけ" -"ればなりません" +msgstr "sample_source バッファには bytearray または 'h','H','b','B'型のarrayが必要" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -3045,7 +3040,7 @@ msgstr "スクリプトのコンパイルは非サポート" #: extmod/ulab/code/ndarray.c msgid "shape must be a 2-tuple" -msgstr "shapeは 2値のタプルでなければなりません" +msgstr "shapeは2値のタプルでなければなりません" #: py/objstr.c msgid "sign not allowed in string format specifier" @@ -3113,11 +3108,11 @@ msgstr "" #: shared-bindings/random/__init__.c msgid "step must be non-zero" -msgstr "" +msgstr "stepは非ゼロ値が必要" #: shared-bindings/busio/UART.c msgid "stop must be 1 or 2" -msgstr "stopは1または2でなければなりません" +msgstr "stopは1または2のいずれか" #: shared-bindings/random/__init__.c msgid "stop not reachable from start" @@ -3129,11 +3124,11 @@ msgstr "ストリーム操作はサポートされていません" #: py/objstrunicode.c msgid "string indices must be integers, not %q" -msgstr "" +msgstr "文字列のインデクスには整数が必要(%qでなく)" #: py/stream.c msgid "string not supported; use bytes or bytearray" -msgstr "" +msgstr "文字列ではなくbytesまたはbytesarrayが必要" #: extmod/moductypes.c msgid "struct: cannot index" @@ -3149,7 +3144,7 @@ msgstr "部分文字列が見つかりません" #: py/compile.c msgid "super() can't find self" -msgstr "" +msgstr "super()がselfを見つけられません" #: extmod/modujson.c msgid "syntax error in JSON" @@ -3161,7 +3156,7 @@ msgstr "uctypedディスクリプタの構文エラー" #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" -msgstr "threshouldは0から65536までです" +msgstr "threshouldは0から65536まで" #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" @@ -3169,7 +3164,7 @@ msgstr "time.struct_time()は9要素のシーケンスを受け取ります" #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" -msgstr "" +msgstr "タイムアウト長がサポートされる最大値を超えています" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" @@ -3189,11 +3184,11 @@ msgstr "v2カードの待機がタイムアウトしました" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" -msgstr "" +msgstr "timestampがプラットフォームのtime_tの範囲外" #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" -msgstr "" +msgstr "指定された書式に対して引数が多すぎます" #: extmod/ulab/code/ndarray.c msgid "too many indices" @@ -3202,11 +3197,11 @@ msgstr "インデクスが多すぎます" #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" -msgstr "" +msgstr "アンパックする値が多すぎます (%d個を期待)" #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" -msgstr "" +msgstr "trapzは同じ長さの1次元arrayに対して定義されています" #: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" @@ -3219,7 +3214,7 @@ msgstr "タプル/リストの長さが正しくありません" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" -msgstr "txとrxの両方をNoneにすることはできません" +msgstr "txとrxを両方ともNoneにできません" #: py/objtype.c msgid "type '%q' is not an acceptable base type" @@ -3235,7 +3230,7 @@ msgstr "" #: py/objtype.c msgid "type takes 1 or 3 arguments" -msgstr "typeは1つまたは3つの引数をとります" +msgstr "typeは1つか3つの引数をとります" #: py/objint_longlong.c msgid "ulonglong too large" @@ -3272,7 +3267,7 @@ msgstr "" #: py/objstr.c msgid "unknown format code '%c' for object of type '%q'" -msgstr "" +msgstr "型'%q'のオブジェクトに対する不明な書式コード'%c'" #: py/compile.c msgid "unknown type" @@ -3320,12 +3315,12 @@ msgstr "演算子がサポートしていない型" #: py/runtime.c msgid "unsupported types for %q: '%q', '%q'" -msgstr "" +msgstr "%qでサポートされない型: '%q', '%q'" #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" -msgstr "値は %d バイトに収まらなければなりません" +msgstr "値は%dバイトに収まらなければなりません" #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" @@ -3345,11 +3340,11 @@ msgstr "" #: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" -msgstr "引数の型が正しくありません" +msgstr "引数の型が不正" #: extmod/ulab/code/ndarray.c msgid "wrong index type" -msgstr "インデクスの型が不正です" +msgstr "インデクスの型が不正" #: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" @@ -3361,7 +3356,7 @@ msgstr "" #: py/runtime.c msgid "wrong number of values to unpack" -msgstr "" +msgstr "アンパックする値の個数が不正です" #: extmod/ulab/code/ndarray.c msgid "wrong operand type" @@ -3377,15 +3372,15 @@ msgstr "" #: shared-bindings/displayio/Shape.c msgid "y should be an int" -msgstr "yは整数でなければなりません" +msgstr "yは整数が必要" #: shared-module/displayio/Shape.c msgid "y value out of bounds" -msgstr "" +msgstr "yが範囲外" #: py/objrange.c msgid "zero step" -msgstr "" +msgstr "ステップが0" #: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" @@ -3393,7 +3388,7 @@ msgstr "ziはndarrayでなければなりません" #: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" -msgstr "ziはfloat値が必要です" +msgstr "ziはfloat値が必要" #: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" From 00eb0b5a1a98517bb4cd602c745815e67ac782d7 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 1 Sep 2020 20:28:15 +0200 Subject: [PATCH 0772/1293] 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 | 34 +++++++++++++++++++++++++++------- locale/cs.po | 34 +++++++++++++++++++++++++++------- locale/de_DE.po | 37 ++++++++++++++++++++++++++++++------- locale/es.po | 37 ++++++++++++++++++++++++++++++------- locale/fil.po | 34 +++++++++++++++++++++++++++------- locale/fr.po | 37 ++++++++++++++++++++++++++++++------- locale/hi.po | 34 +++++++++++++++++++++++++++------- locale/it_IT.po | 34 +++++++++++++++++++++++++++------- locale/ko.po | 34 +++++++++++++++++++++++++++------- locale/nl.po | 37 ++++++++++++++++++++++++++++++------- locale/pl.po | 34 +++++++++++++++++++++++++++------- locale/pt_BR.po | 37 ++++++++++++++++++++++++++++++------- locale/sv.po | 37 ++++++++++++++++++++++++++++++------- locale/zh_Latn_pinyin.po | 34 +++++++++++++++++++++++++++------- 14 files changed, 396 insertions(+), 98 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 6b2ef5f266..dd41b740f1 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-27 11:21-0400\n" +"POT-Creation-Date: 2020-08-30 14:38-0400\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -498,6 +498,10 @@ msgstr "Panggil super().__init__() sebelum mengakses objek asli." msgid "Can't set CCCD on local Characteristic" msgstr "Tidak dapat mengatur CCCD pada Karakteristik lokal" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c @@ -762,8 +766,8 @@ msgstr "Channel EXTINT sedang digunakan" msgid "Error in regex" msgstr "Error pada regex" -#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -774,10 +778,18 @@ msgstr "Diharapkan %q" msgid "Expected a Characteristic" msgstr "Diharapkan sebuah Karakteristik" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" msgstr "Diharapkan sebuah Layanan" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" @@ -1267,6 +1279,10 @@ msgstr "" msgid "Not running saved code.\n" msgstr "" +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1375,10 +1391,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -2488,6 +2500,10 @@ msgstr "" msgid "initial values must be iterable" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler harus sebuah fungsi" @@ -2680,6 +2696,10 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be > 0" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 4d13478eb1..cd81c258fe 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-27 11:21-0400\n" +"POT-Creation-Date: 2020-08-30 14:38-0400\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -496,6 +496,10 @@ msgstr "" msgid "Can't set CCCD on local Characteristic" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c @@ -748,8 +752,8 @@ msgstr "" msgid "Error in regex" msgstr "" -#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -760,10 +764,18 @@ msgstr "" msgid "Expected a Characteristic" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" @@ -1249,6 +1261,10 @@ msgstr "" msgid "Not running saved code.\n" msgstr "" +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1355,10 +1371,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -2459,6 +2471,10 @@ msgstr "" msgid "initial values must be iterable" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" @@ -2651,6 +2667,10 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be > 0" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 6be135ebdf..3debbcb621 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-27 11:21-0400\n" +"POT-Creation-Date: 2020-08-30 14:38-0400\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -499,6 +499,10 @@ msgstr "Rufe super().__init__() vor dem Zugriff auf ein natives Objekt auf." msgid "Can't set CCCD on local Characteristic" msgstr "CCCD kann nicht auf lokales Merkmal eingestellt werden" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c @@ -758,8 +762,8 @@ msgstr "EXTINT Kanal ist schon in Benutzung" msgid "Error in regex" msgstr "Fehler in regex" -#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -770,10 +774,18 @@ msgstr "Erwartet ein(e) %q" msgid "Expected a Characteristic" msgstr "Characteristic wird erwartet" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" msgstr "Ein Service wird erwartet" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" @@ -1268,6 +1280,10 @@ msgstr "Spielt nicht ab" msgid "Not running saved code.\n" msgstr "" +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1385,10 +1401,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "PulseOut wird auf diesem Chip nicht unterstützt" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG DeInit-Fehler" @@ -2530,6 +2542,10 @@ msgstr "Indizes müssen Integer, Slices oder Boolesche Listen sein" msgid "initial values must be iterable" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler muss eine function sein" @@ -2728,6 +2744,10 @@ msgstr "Matrix ist nicht positiv definitiv" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "max_length muss 0-%d sein, wenn fixed_length %s ist" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be > 0" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "maximale Rekursionstiefe überschritten" @@ -3458,6 +3478,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "PulseOut not supported on this chip" +#~ msgstr "PulseOut wird auf diesem Chip nicht unterstützt" + #~ msgid "tuple/list required on RHS" #~ msgstr "Tupel / Liste auf RHS erforderlich" diff --git a/locale/es.po b/locale/es.po index 2820d01a82..15b4fe7806 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-27 11:21-0400\n" +"POT-Creation-Date: 2020-08-30 14:38-0400\n" "PO-Revision-Date: 2020-08-17 21:11+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -505,6 +505,10 @@ msgstr "Llame a super().__ init __() antes de acceder al objeto nativo." msgid "Can't set CCCD on local Characteristic" msgstr "No se puede configurar CCCD en la característica local" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c @@ -763,8 +767,8 @@ msgstr "El canal EXTINT ya está siendo utilizado" msgid "Error in regex" msgstr "Error en regex" -#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -775,10 +779,18 @@ msgstr "Se espera un %q" msgid "Expected a Characteristic" msgstr "Se esperaba una Característica" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" msgstr "Se esperaba un servicio" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" @@ -1267,6 +1279,10 @@ msgstr "No reproduciendo" msgid "Not running saved code.\n" msgstr "No ejecutando el código almacenado.\n" +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1384,10 +1400,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull no se usa cuando la dirección es output." -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "PulseOut no es compatible con este chip" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "Error de desinicializado del RNG" @@ -2520,6 +2532,10 @@ msgstr "los índices deben ser enteros, particiones o listas de booleanos" msgid "initial values must be iterable" msgstr "los valores iniciales deben permitir iteración" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "ensamblador en línea debe ser una función" @@ -2715,6 +2731,10 @@ msgstr "matrix no es definida positiva" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "max_length debe ser 0-%d cuando fixed_length es %s" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be > 0" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "profundidad máxima de recursión excedida" @@ -3440,6 +3460,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 "PulseOut not supported on this chip" +#~ msgstr "PulseOut no es compatible con este chip" + #~ msgid "tuple/list required on RHS" #~ msgstr "tuple/lista se require en RHS" diff --git a/locale/fil.po b/locale/fil.po index 60be99da76..5bb696c83b 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-27 11:21-0400\n" +"POT-Creation-Date: 2020-08-30 14:38-0400\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -495,6 +495,10 @@ msgstr "" msgid "Can't set CCCD on local Characteristic" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c @@ -752,8 +756,8 @@ msgstr "Ginagamit na ang EXTINT channel" msgid "Error in regex" msgstr "May pagkakamali sa REGEX" -#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -765,10 +769,18 @@ msgstr "Umasa ng %q" msgid "Expected a Characteristic" msgstr "Hindi mabasa and Characteristic." +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c #, fuzzy @@ -1258,6 +1270,10 @@ msgstr "Hindi playing" msgid "Not running saved code.\n" msgstr "" +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1369,10 +1385,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull hindi ginagamit kapag ang direksyon ay output." -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -2497,6 +2509,10 @@ msgstr "" msgid "initial values must be iterable" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler ay dapat na function" @@ -2693,6 +2709,10 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be > 0" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "lumagpas ang maximum recursion depth" diff --git a/locale/fr.po b/locale/fr.po index 043fe6cf23..3ab4858020 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-27 11:21-0400\n" +"POT-Creation-Date: 2020-08-30 14:38-0400\n" "PO-Revision-Date: 2020-07-27 21:27+0000\n" "Last-Translator: Nathan \n" "Language: fr\n" @@ -505,6 +505,10 @@ msgstr "Appelez super () .__ init __ () avant d'accéder à l'objet natif." msgid "Can't set CCCD on local Characteristic" msgstr "Impossible de définir CCCD sur une caractéristique locale" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c @@ -766,8 +770,8 @@ msgstr "Canal EXTINT déjà utilisé" msgid "Error in regex" msgstr "Erreur dans l'expression régulière" -#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -778,10 +782,18 @@ msgstr "Attendu un %q" msgid "Expected a Characteristic" msgstr "Une 'Characteristic' est attendue" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" msgstr "Attendu un service" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" @@ -1271,6 +1283,10 @@ msgstr "Ne joue pas" msgid "Not running saved code.\n" msgstr "" +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1390,10 +1406,6 @@ msgstr "Appuyez sur une touche pour entrer sur REPL ou CTRL-D pour recharger." msgid "Pull not used when direction is output." msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'." -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "PulseOut non pris en charge sur cette puce" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "Erreur RNG DeInit" @@ -2538,6 +2550,10 @@ msgstr "" msgid "initial values must be iterable" msgstr "les valeurs initiales doivent être itérables" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "l'assembleur doit être une fonction" @@ -2734,6 +2750,10 @@ msgstr "la matrice n'est pas définie positive" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "max_length doit être 0-%d lorsque fixed_length est %s" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be > 0" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "profondeur maximale de récursivité dépassée" @@ -3461,6 +3481,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "PulseOut not supported on this chip" +#~ msgstr "PulseOut non pris en charge sur cette puce" + #~ msgid "tuple/list required on RHS" #~ msgstr "tuple ou liste requis en partie droite" diff --git a/locale/hi.po b/locale/hi.po index 717d21a275..3803348aa4 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-27 11:21-0400\n" +"POT-Creation-Date: 2020-08-30 14:38-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -489,6 +489,10 @@ msgstr "" msgid "Can't set CCCD on local Characteristic" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c @@ -741,8 +745,8 @@ msgstr "" msgid "Error in regex" msgstr "" -#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -753,10 +757,18 @@ msgstr "" msgid "Expected a Characteristic" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" @@ -1242,6 +1254,10 @@ msgstr "" msgid "Not running saved code.\n" msgstr "" +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1348,10 +1364,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -2452,6 +2464,10 @@ msgstr "" msgid "initial values must be iterable" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" @@ -2644,6 +2660,10 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be > 0" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index c4214a1500..e9dfc0474d 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-27 11:21-0400\n" +"POT-Creation-Date: 2020-08-30 14:38-0400\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -495,6 +495,10 @@ msgstr "" msgid "Can't set CCCD on local Characteristic" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c @@ -752,8 +756,8 @@ msgstr "Canale EXTINT già in uso" msgid "Error in regex" msgstr "Errore nella regex" -#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -765,10 +769,18 @@ msgstr "Atteso un %q" msgid "Expected a Characteristic" msgstr "Non è possibile aggiungere Characteristic." +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c #, fuzzy @@ -1262,6 +1274,10 @@ msgstr "In pausa" msgid "Not running saved code.\n" msgstr "" +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1378,10 +1394,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -2498,6 +2510,10 @@ msgstr "" msgid "initial values must be iterable" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler deve essere una funzione" @@ -2695,6 +2711,10 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be > 0" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "profondità massima di ricorsione superata" diff --git a/locale/ko.po b/locale/ko.po index 2404c561d0..a4e088bc40 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-27 11:21-0400\n" +"POT-Creation-Date: 2020-08-30 14:38-0400\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -492,6 +492,10 @@ msgstr "" msgid "Can't set CCCD on local Characteristic" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c @@ -744,8 +748,8 @@ msgstr "" msgid "Error in regex" msgstr "Regex에 오류가 있습니다." -#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -756,10 +760,18 @@ msgstr "%q 이 예상되었습니다." msgid "Expected a Characteristic" msgstr "특성(Characteristic)이 예상되었습니다." +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" @@ -1245,6 +1257,10 @@ msgstr "" msgid "Not running saved code.\n" msgstr "" +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1351,10 +1367,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -2456,6 +2468,10 @@ msgstr "" msgid "initial values must be iterable" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" @@ -2648,6 +2664,10 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be > 0" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 87133a4606..9cce2523ed 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-27 11:21-0400\n" +"POT-Creation-Date: 2020-08-30 14:38-0400\n" "PO-Revision-Date: 2020-08-10 19:59+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -500,6 +500,10 @@ msgstr "Roep super().__init__() aan voor toegang native object." msgid "Can't set CCCD on local Characteristic" msgstr "Kan CCCD niet toewijzen aan lokaal Characteristic" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c @@ -760,8 +764,8 @@ msgstr "EXTINT kanaal al in gebruik" msgid "Error in regex" msgstr "Fout in regex" -#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -772,10 +776,18 @@ msgstr "Verwacht een %q" msgid "Expected a Characteristic" msgstr "Verwachtte een Characteristic" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" msgstr "Verwachtte een Service" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" @@ -1267,6 +1279,10 @@ msgstr "Wordt niet afgespeeld" msgid "Not running saved code.\n" msgstr "Opgeslagen code wordt niet uitgevoerd.\n" +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1387,10 +1403,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull niet gebruikt wanneer de richting output is." -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "PulseOut niet ondersteund door deze chip" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG DeInit Fout" @@ -2518,6 +2530,10 @@ msgstr "indices moeten integers, segmenten (slices) of Boolean lijsten zijn" msgid "initial values must be iterable" msgstr "oorspronkelijke waarden moeten itereerbaar zijn" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler moet een functie zijn" @@ -2713,6 +2729,10 @@ msgstr "matrix is niet positief-definiet" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "max_length moet 0-%d zijn als fixed_length %s is" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be > 0" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "maximale recursiediepte overschreden" @@ -3435,6 +3455,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 "PulseOut not supported on this chip" +#~ msgstr "PulseOut niet ondersteund door deze chip" + #~ msgid "tuple/list required on RHS" #~ msgstr "tuple of lijst vereist op RHS" diff --git a/locale/pl.po b/locale/pl.po index 610da7bfc0..b072629cd1 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-27 11:21-0400\n" +"POT-Creation-Date: 2020-08-30 14:38-0400\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -492,6 +492,10 @@ msgstr "" msgid "Can't set CCCD on local Characteristic" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c @@ -744,8 +748,8 @@ msgstr "Kanał EXTINT w użyciu" msgid "Error in regex" msgstr "Błąd w regex" -#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -756,10 +760,18 @@ msgstr "Oczekiwano %q" msgid "Expected a Characteristic" msgstr "Oczekiwano charakterystyki" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" @@ -1247,6 +1259,10 @@ msgstr "Nic nie jest odtwarzane" msgid "Not running saved code.\n" msgstr "" +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1353,10 +1369,6 @@ msgstr "Dowolny klawisz aby uruchomić konsolę. CTRL-D aby przeładować." msgid "Pull not used when direction is output." msgstr "Podciągnięcie nieużywane w trybie wyjścia." -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -2461,6 +2473,10 @@ msgstr "" msgid "initial values must be iterable" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "wtrącony asembler musi być funkcją" @@ -2653,6 +2669,10 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be > 0" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "przekroczono dozwoloną głębokość rekurencji" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index b0233b5dbc..e407756d07 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-27 11:21-0400\n" +"POT-Creation-Date: 2020-08-30 14:38-0400\n" "PO-Revision-Date: 2020-08-31 00:37+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -506,6 +506,10 @@ msgstr "Chame super().__init__() antes de acessar o objeto nativo." msgid "Can't set CCCD on local Characteristic" msgstr "Não é possível definir o CCCD com a característica local" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c @@ -765,8 +769,8 @@ msgstr "Canal EXTINT em uso" msgid "Error in regex" msgstr "Erro no regex" -#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -777,10 +781,18 @@ msgstr "Esperado um" msgid "Expected a Characteristic" msgstr "Uma característica é necessária" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" msgstr "Esperava um Serviço" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" @@ -1270,6 +1282,10 @@ msgstr "Não está jogando" msgid "Not running saved code.\n" msgstr "O código salvo não está em execução.\n" +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1393,10 +1409,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "O Pull não foi usado quando a direção for gerada." -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "O PulseOut não é compatível neste CI" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "Erro DeInit RNG" @@ -2533,6 +2545,10 @@ msgstr "os índices devem ser números inteiros, fatias ou listas booleanas" msgid "initial values must be iterable" msgstr "os valores iniciais devem ser iteráveis" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "o assembler em linha deve ser uma função" @@ -2728,6 +2744,10 @@ msgstr "a matriz não é definitiva positiva" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "o max_length deve ser 0-%d quando Fixed_length for %s" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be > 0" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "a recursão máxima da profundidade foi excedida" @@ -3456,6 +3476,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 "PulseOut not supported on this chip" +#~ msgstr "O PulseOut não é compatível neste CI" + #~ msgid "" #~ "Port does not accept pins or " #~ "frequency. Construct and pass a " diff --git a/locale/sv.po b/locale/sv.po index 9946917445..9b9a52dacf 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-27 11:21-0400\n" +"POT-Creation-Date: 2020-08-30 14:38-0400\n" "PO-Revision-Date: 2020-08-30 20:02+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: LANGUAGE \n" @@ -498,6 +498,10 @@ msgstr "Anropa super().__init__() innan du använder det ursprungliga objektet." msgid "Can't set CCCD on local Characteristic" msgstr "Kan inte ställa in CCCD på lokal karaktäristik" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c @@ -756,8 +760,8 @@ msgstr "EXTINT-kanalen används redan" msgid "Error in regex" msgstr "Fel i regex" -#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -768,10 +772,18 @@ msgstr "Förväntade %q" msgid "Expected a Characteristic" msgstr "Förväntade en karaktäristik" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" msgstr "Förväntade en tjänst" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" @@ -1260,6 +1272,10 @@ msgstr "Ingen uppspelning" msgid "Not running saved code.\n" msgstr "Kör inte sparad kod.\n" +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1377,10 +1393,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull används inte när riktningen är output." -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "PulseIn stöds inte av detta chip" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG DeInit-fel" @@ -2504,6 +2516,10 @@ msgstr "index måste vara heltal, slices, eller Boolean-listor" msgid "initial values must be iterable" msgstr "initialvärden måste vara iterable" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler måste vara en funktion" @@ -2699,6 +2715,10 @@ msgstr "matrisen är inte positiv bestämd" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "max_length måste vara 0-%d när fixed_length är %s" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be > 0" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "maximal rekursionsdjup överskriden" @@ -3421,6 +3441,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 "PulseOut not supported on this chip" +#~ msgstr "PulseIn stöds inte av detta chip" + #~ msgid "tuple/list required on RHS" #~ msgstr "tupel/lista krävs för RHS" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 290d4749ef..56f9bae8c1 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-27 11:21-0400\n" +"POT-Creation-Date: 2020-08-30 14:38-0400\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -499,6 +499,10 @@ msgstr "Zài fǎngwèn běn jī wùjiàn zhīqián diàoyòng super().__init__() msgid "Can't set CCCD on local Characteristic" msgstr "Wúfǎ jiāng CCCD shèzhì wéi běndì tèzhēng" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c @@ -753,8 +757,8 @@ msgstr "EXTINT píndào yǐjīng shǐyòng" msgid "Error in regex" msgstr "Zhèngzé biǎodá shì cuòwù" -#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -765,10 +769,18 @@ msgstr "Yùqí %q" msgid "Expected a Characteristic" msgstr "Yùqí de tèdiǎn" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" msgstr "Yùqí fúwù" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" @@ -1256,6 +1268,10 @@ msgstr "Wèi bòfàng" msgid "Not running saved code.\n" msgstr "Méiyǒu yùnxíng yǐ bǎocún de dàimǎ.\n" +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1371,10 +1387,6 @@ msgstr "Àn xià rènhé jiàn jìnrù REPL. Shǐyòng CTRL-D chóngxīn jiāzà msgid "Pull not used when direction is output." msgstr "Fāngxiàng shūchū shí Pull méiyǒu shǐyòng." -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG qǔxiāo chūshǐhuà cuòwù" @@ -2496,6 +2508,10 @@ msgstr "suǒyǐn bìxū shì zhěngshù, qiēpiàn huò bù'ěr zhí lièbiǎo" msgid "initial values must be iterable" msgstr "chūshǐ zhí bìxū shì kě diédài de" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "nèi lián jíhé bìxū shì yīgè hánshù" @@ -2689,6 +2705,10 @@ msgstr "jǔzhèn bùshì zhèngdìng de" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "Dāng gùdìng chángdù wèi %s shí, zuìdà chángdù bìxū wèi 0-%d" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be > 0" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "chāochū zuìdà dìguī shēndù" From bb17882065034053444ff9cebe637c12285e5b95 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 1 Sep 2020 18:43:45 +0000 Subject: [PATCH 0773/1293] Translated using Weblate (Japanese) Currently translated at 68.7% (536 of 780 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ja/ --- locale/ja.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/ja.po b/locale/ja.po index 789930cd00..b9fb7ce7a5 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-08-27 11:21-0400\n" -"PO-Revision-Date: 2020-09-01 12:07+0000\n" -"Last-Translator: Taku Fukada \n" +"PO-Revision-Date: 2020-09-01 18:44+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: none\n" "Language: ja\n" "MIME-Version: 1.0\n" @@ -2143,7 +2143,7 @@ msgstr "" #: shared-bindings/displayio/Palette.c msgid "color must be between 0x000000 and 0xffffff" -msgstr "色は0x000000から0xffffffでなければなりません" +msgstr "色は0x000000から0xffffffでなければなりません" #: shared-bindings/displayio/ColorConverter.c msgid "color should be an int" @@ -2739,7 +2739,7 @@ msgstr "" #: py/runtime.c #, c-format msgid "need more than %d values to unpack" -msgstr "アンパックする値は%d個では足りません" +msgstr "アンパックする値は%d個では足りません" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" From e14de385283ad01b17e5abf51c5830db59a1a0f2 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Tue, 1 Sep 2020 13:57:19 -0500 Subject: [PATCH 0774/1293] Revise .refresh input default value for target_frames_per_second to None --- shared-bindings/displayio/Display.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 9f3148dc76..b9e8d02b4b 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -215,7 +215,7 @@ STATIC mp_obj_t displayio_display_obj_show(mp_obj_t self_in, mp_obj_t group_in) } MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show); -//| def refresh(self, *, target_frames_per_second: int = 60, minimum_frames_per_second: int = 1) -> bool: +//| def refresh(self, *, target_frames_per_second: int = None, minimum_frames_per_second: int = 1) -> bool: //| """When auto refresh is off, waits for the target frame rate and then refreshes the display, //| returning True. If the call has taken too long since the last refresh call for the given //| target frame rate, then the refresh returns False immediately without updating the screen to @@ -231,13 +231,14 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show //| the display immediately. //| //| :param int target_frames_per_second: How many times a second `refresh` should be called and the screen updated. +//| Set to None for immediate refresh. //| :param int minimum_frames_per_second: The minimum number of times the screen should be updated per second.""" //| ... //| STATIC mp_obj_t displayio_display_obj_refresh(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_target_frames_per_second, ARG_minimum_frames_per_second }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_target_frames_per_second, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NEW_SMALL_INT(60)} }, + { MP_QSTR_target_frames_per_second, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} }, { MP_QSTR_minimum_frames_per_second, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} }, }; @@ -252,8 +253,7 @@ STATIC mp_obj_t displayio_display_obj_refresh(size_t n_args, const mp_obj_t *pos } uint32_t target_ms_per_frame; - if ( (args[ARG_target_frames_per_second].u_obj == mp_const_none) || (n_args == 1) ) { - // if None or no arguments + if (args[ARG_target_frames_per_second].u_obj == mp_const_none) { target_ms_per_frame = 0xffffffff; } else { From f5015e4485e8885d1af2507f61229a09faa332f3 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Tue, 1 Sep 2020 14:36:43 -0500 Subject: [PATCH 0775/1293] Add hanging tab to doc --- shared-bindings/displayio/Display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index b9e8d02b4b..a11a17c558 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -231,7 +231,7 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show //| the display immediately. //| //| :param int target_frames_per_second: How many times a second `refresh` should be called and the screen updated. -//| Set to None for immediate refresh. +//| Set to None for immediate refresh. //| :param int minimum_frames_per_second: The minimum number of times the screen should be updated per second.""" //| ... //| From c6529daac576aa3492abef2073b7e597c3ffee5d Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Tue, 1 Sep 2020 14:44:32 -0500 Subject: [PATCH 0776/1293] Added some backticks to clarify the docs --- shared-bindings/displayio/Display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index a11a17c558..3df36d1bd3 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -227,11 +227,11 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show //| When auto refresh is on, updates the display immediately. (The display will also update //| without calls to this.) //| -//| When auto refresh is off, refresh() or refresh(target_frames_per_second=None) will update +//| When auto refresh is off, `refresh()` or `refresh(target_frames_per_second=None)` will update //| the display immediately. //| //| :param int target_frames_per_second: How many times a second `refresh` should be called and the screen updated. -//| Set to None for immediate refresh. +//| Set to `None` for immediate refresh. //| :param int minimum_frames_per_second: The minimum number of times the screen should be updated per second.""" //| ... //| From 649a955a74ec8206dfb53511e7a2e6a679968648 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Tue, 1 Sep 2020 15:02:37 -0500 Subject: [PATCH 0777/1293] Modified docs to try to pass sphinx build --- shared-bindings/displayio/Display.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 3df36d1bd3..9b63e4fec7 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -230,8 +230,7 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show //| When auto refresh is off, `refresh()` or `refresh(target_frames_per_second=None)` will update //| the display immediately. //| -//| :param int target_frames_per_second: How many times a second `refresh` should be called and the screen updated. -//| Set to `None` for immediate refresh. +//| :param int target_frames_per_second: How many times a second `refresh` should be called and the screen updated. Set to `None` for immediate refresh. //| :param int minimum_frames_per_second: The minimum number of times the screen should be updated per second.""" //| ... //| From 7b6d805580a3da679bd14807c7646c5a8c830ef6 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Tue, 1 Sep 2020 15:40:55 -0500 Subject: [PATCH 0778/1293] Add Optional[int] to docs string --- shared-bindings/displayio/Display.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 9b63e4fec7..4d94fa1e0d 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -215,7 +215,7 @@ STATIC mp_obj_t displayio_display_obj_show(mp_obj_t self_in, mp_obj_t group_in) } MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show); -//| def refresh(self, *, target_frames_per_second: int = None, minimum_frames_per_second: int = 1) -> bool: +//| def refresh(self, *, target_frames_per_second: Optional[int] = None, minimum_frames_per_second: int = 1) -> bool: //| """When auto refresh is off, waits for the target frame rate and then refreshes the display, //| returning True. If the call has taken too long since the last refresh call for the given //| target frame rate, then the refresh returns False immediately without updating the screen to @@ -230,7 +230,8 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show //| When auto refresh is off, `refresh()` or `refresh(target_frames_per_second=None)` will update //| the display immediately. //| -//| :param int target_frames_per_second: How many times a second `refresh` should be called and the screen updated. Set to `None` for immediate refresh. +//| :param int target_frames_per_second: How many times a second `refresh` should be called +//| and the screen updated. Set to `None` for immediate refresh. //| :param int minimum_frames_per_second: The minimum number of times the screen should be updated per second.""" //| ... //| From 554cc356dbdce74101e86090d71ea2955908f78a Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Tue, 1 Sep 2020 15:43:18 -0500 Subject: [PATCH 0779/1293] Delete trailing whitespace --- shared-bindings/displayio/Display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 4d94fa1e0d..5d9569f4c1 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -230,7 +230,7 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show //| When auto refresh is off, `refresh()` or `refresh(target_frames_per_second=None)` will update //| the display immediately. //| -//| :param int target_frames_per_second: How many times a second `refresh` should be called +//| :param int target_frames_per_second: How many times a second `refresh` should be called //| and the screen updated. Set to `None` for immediate refresh. //| :param int minimum_frames_per_second: The minimum number of times the screen should be updated per second.""" //| ... From 07740d19f3fd647979b223b8ffffcb6776c613e3 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 1 Sep 2020 17:12:22 -0500 Subject: [PATCH 0780/1293] add bigram compression to makeqstrdata Compress common unicode bigrams by making code points in the range 0x80 - 0xbf (inclusive) represent them. Then, they can be greedily encoded and the substituted code points handled by the existing Huffman compression. Normally code points in the range 0x80-0xbf are not used in Unicode, so we stake our own claim. Using the more arguably correct "Private Use Area" (PUA) would mean that for scripts that only use code points under 256 we would use more memory for the "values" table. bigram means "two letters", and is also sometimes called a "digram". It's nothing to do with "big RAM". For our purposes, a bigram represents two successive unicode code points, so for instance in our build on trinket m0 for english the most frequent are: ['t ', 'e ', 'in', 'd ', ...]. The bigrams are selected based on frequency in the corpus, but the selection is not necessarily optimal, for these reasons I can think of: * Suppose the corpus was just "tea" repeated 100 times. The top bigrams would be "te", and "ea". However, overlap, "te" could never be used. Thus, some bigrams might actually waste space * I _assume_ this has to be why e.g., bigram 0x86 "s " is more frequent than bigram 0x85 " a" in English for Trinket M0, because sequences like "can't add" would get the "t " digram and then be unable to use the " a" digram. * And generally, if a bigram is frequent then so are its constituents. Say that "i" and "n" both encode to just 5 or 6 bits, then the huffman code for "in" had better compress to 10 or fewer bits or it's a net loss! * I checked though! "i" is 5 bits, "n" is 6 bits (lucky guess) but the bigram 0x83 also just 6 bits, so this one is a win of 5 bits for every "it" minus overhead. Yay, this round goes to team compression. * On the other hand, the least frequent bigram 0x9d " n" is 10 bits long and its constituent code points are 4+6 bits so there's no savings, but there is the cost of the table entry. * and somehow 0x9f 'an' is never used at all! With or without accounting for overlaps, there is some optimum number of bigrams. Adding one more bigram uses at least 2 bytes (for the entry in the bigram table; 4 bytes if code points >255 are in the source text) and also needs a slot in the Huffman dictionary, so adding bigrams beyond the optimim number makes compression worse again. If it's an improvement, the fact that it's not guaranteed optimal doesn't seem to matter too much. It just leaves a little more fruit for the next sweep to pick up. Perhaps try adding the most frequent bigram not yet present, until it doesn't improve compression overall. Right now, de_DE is again the "fullest" build on trinket_m0. (It's reclaimed that spot from the ja translation somehow) This change saves 104 bytes there, increasing free space about 6.8%. In the larger (but not critically full) pyportal build it saves 324 bytes. The specific number of bigrams used (32) was chosen as it is the max number that fit within the 0x80..0xbf range. Larger tables would require the use of 16 bit code points in the de_DE build, losing savings overall. (Side note: The most frequent letters in English have been said to be: ETA OIN SHRDLU; but we have UAC EIL MOPRST in our corpus) --- py/makeqstrdata.py | 33 +++++++++++++++++++++++++++++---- supervisor/shared/translate.c | 9 +++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 04c8938766..28aed3df97 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -100,9 +100,30 @@ def translate(translation_file, i18ns): translations.append((original, translation)) return translations +def frequent_ngrams(corpus, sz, n): + return collections.Counter(corpus[i:i+sz] for i in range(len(corpus)-sz)).most_common(n) + +def ngrams_to_pua(translation, ngrams): + if len(ngrams) > 32: + start = 0xe000 + else: + start = 0x80 + for i, g in enumerate(ngrams): + translation = translation.replace(g, chr(start + i)) + return translation + +def pua_to_ngrams(compressed, ngrams): + if len(ngrams) > 32: + start, end = 0xe000, 0xf8ff + else: + start, end = 0x80, 0xbf + return "".join(ngrams[ord(c) - start] if (start <= ord(c) <= end) else c for c in compressed) + def compute_huffman_coding(translations, qstrs, compression_filename): all_strings = [x[1] for x in translations] all_strings_concat = "".join(all_strings) + ngrams = [i[0] for i in frequent_ngrams(all_strings_concat, 2, 32)] + all_strings_concat = ngrams_to_pua(all_strings_concat, ngrams) counts = collections.Counter(all_strings_concat) cb = huffman.codebook(counts.items()) values = [] @@ -128,7 +149,8 @@ def compute_huffman_coding(translations, qstrs, compression_filename): for i in range(1, max(length_count) + 2): lengths.append(length_count.get(i, 0)) print("// values", values, "lengths", len(lengths), lengths) - print("// estimated total memory size", len(lengths) + 2*len(values) + sum(len(cb[u]) for u in all_strings_concat)) + ngramdata = [ord(ni) for i in ngrams for ni in i] + print("// estimated total memory size", len(lengths) + 2*len(values) + 2 * len(ngramdata) + sum((len(cb[u]) + 7)//8 for u in all_strings_concat)) print("//", values, lengths) values_type = "uint16_t" if max(ord(u) for u in values) > 255 else "uint8_t" max_translation_encoded_length = max(len(translation.encode("utf-8")) for original,translation in translations) @@ -136,10 +158,11 @@ def compute_huffman_coding(translations, qstrs, compression_filename): f.write("const uint8_t lengths[] = {{ {} }};\n".format(", ".join(map(str, lengths)))) f.write("const {} values[] = {{ {} }};\n".format(values_type, ", ".join(str(ord(u)) for u in values))) f.write("#define compress_max_length_bits ({})\n".format(max_translation_encoded_length.bit_length())) - return values, lengths + f.write("const {} ngrams[] = {{ {} }};\n".format(values_type, ", ".join(str(u) for u in ngramdata))) + return values, lengths, ngrams def decompress(encoding_table, encoded, encoded_length_bits): - values, lengths = encoding_table + values, lengths, ngrams = encoding_table dec = [] this_byte = 0 this_bit = 7 @@ -187,6 +210,7 @@ def decompress(encoding_table, encoded, encoded_length_bits): searched_length += lengths[bit_length] v = values[searched_length + bits - max_code] + v = pua_to_ngrams(v, ngrams) i += len(v.encode('utf-8')) dec.append(v) return ''.join(dec) @@ -194,7 +218,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() - values, lengths = encoding_table + values, lengths, ngrams = encoding_table + decompressed = ngrams_to_pua(decompressed, ngrams) enc = bytearray(len(decompressed) * 3) #print(decompressed) #print(lengths) diff --git a/supervisor/shared/translate.c b/supervisor/shared/translate.c index 606f8fa91a..49ee8f143f 100644 --- a/supervisor/shared/translate.c +++ b/supervisor/shared/translate.c @@ -34,6 +34,7 @@ #include "genhdr/compression.generated.h" #endif +#include "py/misc.h" #include "supervisor/serial.h" void serial_write_compressed(const compressed_string_t* compressed) { @@ -46,10 +47,18 @@ STATIC int put_utf8(char *buf, int u) { if(u <= 0x7f) { *buf = u; return 1; + } else if(MP_ARRAY_SIZE(ngrams) <= 64 && u <= 0xbf) { + int n = (u - 0x80) * 2; + int ret = put_utf8(buf, ngrams[n]); + return ret + put_utf8(buf + ret, ngrams[n+1]); } else if(u <= 0x07ff) { *buf++ = 0b11000000 | (u >> 6); *buf = 0b10000000 | (u & 0b00111111); return 2; + } else if(MP_ARRAY_SIZE(ngrams) > 64 && u >= 0xe000 && u <= 0xf8ff) { + int n = (u - 0xe000) * 2; + int ret = put_utf8(buf, ngrams[n]); + return ret + put_utf8(buf + ret, ngrams[n+1]); } else { // u <= 0xffff) *buf++ = 0b11000000 | (u >> 12); *buf = 0b10000000 | ((u >> 6) & 0b00111111); From 4b9306aa7cc87a5c0eed52db36cbccd5d00152b6 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Tue, 1 Sep 2020 18:10:40 -0500 Subject: [PATCH 0781/1293] Cleanup for sphinx --- shared-bindings/displayio/Display.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 5d9569f4c1..72b0eef279 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -227,11 +227,11 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show //| When auto refresh is on, updates the display immediately. (The display will also update //| without calls to this.) //| -//| When auto refresh is off, `refresh()` or `refresh(target_frames_per_second=None)` will update +//| When auto refresh is off, refresh() or refresh(target_frames_per_second=None) will update //| the display immediately. //| -//| :param int target_frames_per_second: How many times a second `refresh` should be called -//| and the screen updated. Set to `None` for immediate refresh. +//| :param int target_frames_per_second: How many times a second `refresh` should be called and the screen updated. +//| Set to None for immediate refresh. //| :param int minimum_frames_per_second: The minimum number of times the screen should be updated per second.""" //| ... //| From 4733a672265f97a83353d005160f8e24ed8755b8 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 2 Sep 2020 11:27:42 -0400 Subject: [PATCH 0782/1293] Add GDB debugging capability --- ports/esp32s2/Makefile | 2 +- ports/esp32s2/boards/esp32s2-saola-1.cfg | 41 ++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 ports/esp32s2/boards/esp32s2-saola-1.cfg diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 19b89a13a1..db05349b6c 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -116,7 +116,7 @@ CFLAGS += $(OPTIMIZATION_FLAGS) CFLAGS += $(INC) -Werror -Wall -mlongcalls -std=gnu11 -Wl,--gc-sections $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) -LDFLAGS = $(CFLAGS) -Wl,-nostdlib -Wl,-Map=$@.map -Wl,-cref +LDFLAGS = $(CFLAGS) -Wl,-nostdlib -Wl,-Map=$@.map -Wl,-cref -Wl,--undefined=uxTopUsedPriority LDFLAGS += -L$(BUILD)/esp-idf/esp-idf/esp32s2 \ -Tesp32s2_out.ld \ -L$(BUILD)/esp-idf/esp-idf/esp32s2/ld \ diff --git a/ports/esp32s2/boards/esp32s2-saola-1.cfg b/ports/esp32s2/boards/esp32s2-saola-1.cfg new file mode 100644 index 0000000000..6772907570 --- /dev/null +++ b/ports/esp32s2/boards/esp32s2-saola-1.cfg @@ -0,0 +1,41 @@ +# The ESP32-S2 only supports JTAG. +transport select jtag +adapter_khz 1000 + +# Source the ESP common configuration file +source [find target/esp_common.cfg] + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME esp32s2 +} + +if { [info exists CPUTAPID] } { + set _CPUTAPID $CPUTAPID +} else { + set _CPUTAPID 0x120034e5 +} + +set _TARGETNAME $_CHIPNAME +set _CPUNAME cpu +set _TAPNAME $_CHIPNAME.$_CPUNAME + +jtag newtap $_CHIPNAME $_CPUNAME -irlen 5 -expected-id $_CPUTAPID + +if { $_RTOS == "none" } { + target create $_TARGETNAME esp32s2 -endian little -chain-position $_TAPNAME +} else { + target create $_TARGETNAME esp32s2 -endian little -chain-position $_TAPNAME -rtos $_RTOS +} + +configure_esp_workarea $_TARGETNAME 0x40030000 0x3400 0x3FFE0000 0x6000 +configure_esp_flash_bank $_TARGETNAME $_TARGETNAME $_FLASH_SIZE + +xtensa maskisr on +if { $_SEMIHOST_BASEDIR != "" } { + esp semihost_basedir $_SEMIHOST_BASEDIR +} +if { $_FLASH_SIZE == 0 } { + gdb_breakpoint_override hard +} From 8256bf7ea68d714f16503c97329632b7c0ca477d Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Wed, 2 Sep 2020 11:20:30 -0500 Subject: [PATCH 0783/1293] Add backticks to function references in docs --- shared-bindings/displayio/Display.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 72b0eef279..fa180fe38e 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -222,16 +222,16 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show //| hopefully help getting caught up. //| //| If the time since the last successful refresh is below the minimum frame rate, then an -//| exception will be raised. Set minimum_frames_per_second to 0 to disable. +//| exception will be raised. Set ``minimum_frames_per_second`` to 0 to disable. +//| +//| When auto refresh is off, ``display.refresh()`` or ``display.refresh(target_frames_per_second=None)`` +//| will update the display immediately. //| //| When auto refresh is on, updates the display immediately. (The display will also update //| without calls to this.) //| -//| When auto refresh is off, refresh() or refresh(target_frames_per_second=None) will update -//| the display immediately. -//| //| :param int target_frames_per_second: How many times a second `refresh` should be called and the screen updated. -//| Set to None for immediate refresh. +//| Set to `None` for immediate refresh. //| :param int minimum_frames_per_second: The minimum number of times the screen should be updated per second.""" //| ... //| From d224183a7e10ed2b10c92f9cc2f8a14412b1ed0a Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Wed, 2 Sep 2020 11:26:37 -0500 Subject: [PATCH 0784/1293] Delete trailing whitespace --- shared-bindings/displayio/Display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index fa180fe38e..f36aeed18c 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -224,7 +224,7 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show //| If the time since the last successful refresh is below the minimum frame rate, then an //| exception will be raised. Set ``minimum_frames_per_second`` to 0 to disable. //| -//| When auto refresh is off, ``display.refresh()`` or ``display.refresh(target_frames_per_second=None)`` +//| When auto refresh is off, ``display.refresh()`` or ``display.refresh(target_frames_per_second=None)`` //| will update the display immediately. //| //| When auto refresh is on, updates the display immediately. (The display will also update From 17a5a85528525352ec1821127fafec2acb239196 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 2 Sep 2020 13:34:16 -0500 Subject: [PATCH 0785/1293] rgbmatrix: Move struct definition to shared-module, rename 'core' member --- shared-bindings/rgbmatrix/RGBMatrix.c | 2 +- shared-bindings/rgbmatrix/RGBMatrix.h | 21 +----------- shared-module/rgbmatrix/RGBMatrix.c | 40 +++++++++++------------ shared-module/rgbmatrix/RGBMatrix.h | 47 +++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 41 deletions(-) diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index 9cfc0d4095..e4683af920 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -252,7 +252,7 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_deinit(mp_obj_t self_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(rgbmatrix_rgbmatrix_deinit_obj, rgbmatrix_rgbmatrix_deinit); static void check_for_deinit(rgbmatrix_rgbmatrix_obj_t *self) { - if (!self->core.rgbPins) { + if (!self->protomatter.rgbPins) { raise_deinited_error(); } } diff --git a/shared-bindings/rgbmatrix/RGBMatrix.h b/shared-bindings/rgbmatrix/RGBMatrix.h index 027f817bb6..1dc5a406ca 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.h +++ b/shared-bindings/rgbmatrix/RGBMatrix.h @@ -24,29 +24,12 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_RGBMATRIX_RGBMATRIX_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_RGBMATRIX_RGBMATRIX_H +#pragma once #include "shared-module/rgbmatrix/RGBMatrix.h" #include "lib/protomatter/core.h" extern const mp_obj_type_t rgbmatrix_RGBMatrix_type; -typedef struct { - mp_obj_base_t base; - mp_obj_t framebuffer; - mp_buffer_info_t bufinfo; - Protomatter_core core; - void *timer; - uint16_t bufsize, width; - uint8_t rgb_pins[30]; - uint8_t addr_pins[10]; - uint8_t clock_pin, latch_pin, oe_pin; - uint8_t rgb_count, addr_count; - uint8_t bit_depth; - bool core_is_initialized; - bool paused; - bool doublebuffer; -} rgbmatrix_rgbmatrix_obj_t; void common_hal_rgbmatrix_rgbmatrix_construct(rgbmatrix_rgbmatrix_obj_t* self, int width, int bit_depth, uint8_t rgb_count, uint8_t* rgb_pins, uint8_t addr_count, uint8_t* addr_pins, uint8_t clock_pin, uint8_t latch_pin, uint8_t oe_pin, bool doublebuffer, mp_obj_t framebuffer, void* timer); void common_hal_rgbmatrix_rgbmatrix_deinit(rgbmatrix_rgbmatrix_obj_t*); @@ -57,5 +40,3 @@ bool common_hal_rgbmatrix_rgbmatrix_get_paused(rgbmatrix_rgbmatrix_obj_t* self); void common_hal_rgbmatrix_rgbmatrix_refresh(rgbmatrix_rgbmatrix_obj_t* self); int common_hal_rgbmatrix_rgbmatrix_get_width(rgbmatrix_rgbmatrix_obj_t* self); int common_hal_rgbmatrix_rgbmatrix_get_height(rgbmatrix_rgbmatrix_obj_t* self); - -#endif diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c index c39ec99a27..3007ca4db5 100644 --- a/shared-module/rgbmatrix/RGBMatrix.c +++ b/shared-module/rgbmatrix/RGBMatrix.c @@ -79,9 +79,9 @@ void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t* self, mp_get_index(mp_obj_get_type(self->framebuffer), self->bufinfo.len, MP_OBJ_NEW_SMALL_INT(self->bufsize-1), false); } else { _PM_FREE(self->bufinfo.buf); - _PM_FREE(self->core.rgbPins); - _PM_FREE(self->core.addr); - _PM_FREE(self->core.screenData); + _PM_FREE(self->protomatter.rgbPins); + _PM_FREE(self->protomatter.addr); + _PM_FREE(self->protomatter.screenData); self->framebuffer = NULL; self->bufinfo.buf = common_hal_rgbmatrix_allocator_impl(self->bufsize); @@ -89,8 +89,8 @@ void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t* self, self->bufinfo.typecode = 'H' | MP_OBJ_ARRAY_TYPECODE_FLAG_RW; } - memset(&self->core, 0, sizeof(self->core)); - ProtomatterStatus stat = _PM_init(&self->core, + memset(&self->protomatter, 0, sizeof(self->protomatter)); + ProtomatterStatus stat = _PM_init(&self->protomatter, self->width, self->bit_depth, self->rgb_count/6, self->rgb_pins, self->addr_count, self->addr_pins, @@ -98,17 +98,17 @@ void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t* self, self->doublebuffer, self->timer); if (stat == PROTOMATTER_OK) { - _PM_protoPtr = &self->core; + _PM_protoPtr = &self->protomatter; common_hal_mcu_disable_interrupts(); common_hal_rgbmatrix_timer_enable(self->timer); - stat = _PM_begin(&self->core); + stat = _PM_begin(&self->protomatter); if (stat == PROTOMATTER_OK) { - _PM_convert_565(&self->core, self->bufinfo.buf, self->width); + _PM_convert_565(&self->protomatter, self->bufinfo.buf, self->width); } common_hal_mcu_enable_interrupts(); if (stat == PROTOMATTER_OK) { - _PM_swapbuffer_maybe(&self->core); + _PM_swapbuffer_maybe(&self->protomatter); } } @@ -153,7 +153,7 @@ void common_hal_rgbmatrix_rgbmatrix_deinit(rgbmatrix_rgbmatrix_obj_t* self) { self->timer = 0; } - if (_PM_protoPtr == &self->core) { + if (_PM_protoPtr == &self->protomatter) { _PM_protoPtr = NULL; } @@ -163,10 +163,10 @@ void common_hal_rgbmatrix_rgbmatrix_deinit(rgbmatrix_rgbmatrix_obj_t* self) { free_pin(&self->latch_pin); free_pin(&self->oe_pin); - if (self->core.rgbPins) { - _PM_free(&self->core); + if (self->protomatter.rgbPins) { + _PM_free(&self->protomatter); } - memset(&self->core, 0, sizeof(self->core)); + memset(&self->protomatter, 0, sizeof(self->protomatter)); // If it was supervisor-allocated, it is supervisor-freed and the pointer // is zeroed, otherwise the pointer is just zeroed @@ -180,16 +180,16 @@ void common_hal_rgbmatrix_rgbmatrix_deinit(rgbmatrix_rgbmatrix_obj_t* self) { void rgbmatrix_rgbmatrix_collect_ptrs(rgbmatrix_rgbmatrix_obj_t* self) { gc_collect_ptr(self->framebuffer); - gc_collect_ptr(self->core.rgbPins); - gc_collect_ptr(self->core.addr); - gc_collect_ptr(self->core.screenData); + gc_collect_ptr(self->protomatter.rgbPins); + gc_collect_ptr(self->protomatter.addr); + gc_collect_ptr(self->protomatter.screenData); } void common_hal_rgbmatrix_rgbmatrix_set_paused(rgbmatrix_rgbmatrix_obj_t* self, bool paused) { if (paused && !self->paused) { - _PM_stop(&self->core); + _PM_stop(&self->protomatter); } else if (!paused && self->paused) { - _PM_resume(&self->core); + _PM_resume(&self->protomatter); } self->paused = paused; } @@ -199,8 +199,8 @@ bool common_hal_rgbmatrix_rgbmatrix_get_paused(rgbmatrix_rgbmatrix_obj_t* self) } void common_hal_rgbmatrix_rgbmatrix_refresh(rgbmatrix_rgbmatrix_obj_t* self) { - _PM_convert_565(&self->core, self->bufinfo.buf, self->width); - _PM_swapbuffer_maybe(&self->core); + _PM_convert_565(&self->protomatter, self->bufinfo.buf, self->width); + _PM_swapbuffer_maybe(&self->protomatter); } int common_hal_rgbmatrix_rgbmatrix_get_width(rgbmatrix_rgbmatrix_obj_t* self) { diff --git a/shared-module/rgbmatrix/RGBMatrix.h b/shared-module/rgbmatrix/RGBMatrix.h index e69de29bb2..19d7d5f2e7 100644 --- a/shared-module/rgbmatrix/RGBMatrix.h +++ b/shared-module/rgbmatrix/RGBMatrix.h @@ -0,0 +1,47 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "lib/protomatter/core.h" + +extern const mp_obj_type_t rgbmatrix_RGBMatrix_type; +typedef struct { + mp_obj_base_t base; + mp_obj_t framebuffer; + mp_buffer_info_t bufinfo; + Protomatter_core protomatter; + void *timer; + uint16_t bufsize, width; + uint8_t rgb_pins[30]; + uint8_t addr_pins[10]; + uint8_t clock_pin, latch_pin, oe_pin; + uint8_t rgb_count, addr_count; + uint8_t bit_depth; + bool core_is_initialized; + bool paused; + bool doublebuffer; +} rgbmatrix_rgbmatrix_obj_t; From f1c7389b2951edc3e24091565b1465252ac40a1e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 2 Sep 2020 15:50:51 -0500 Subject: [PATCH 0786/1293] locales: Replace NBSP characters with true spaces These characters, at code point 0xa0, are unintended. --- locale/cs.po | 6 +++--- locale/pl.po | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/locale/cs.po b/locale/cs.po index cd81c258fe..3e22ac2514 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -44,15 +44,15 @@ msgstr "" #: py/obj.c msgid " File \"%q\"" -msgstr "  Soubor \"%q\"" +msgstr " Soubor \"%q\"" #: py/obj.c msgid " File \"%q\", line %d" -msgstr "  Soubor \"%q\", řádek %d" +msgstr " Soubor \"%q\", řádek %d" #: main.c msgid " output:\n" -msgstr " výstup:\n" +msgstr " výstup:\n" #: py/objstr.c #, c-format diff --git a/locale/pl.po b/locale/pl.po index b072629cd1..cd4b905e73 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -1971,7 +1971,7 @@ msgstr "wartość kalibracji poza zakresem +/-127" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" -msgstr "asembler Thumb może przyjąć do 4 parameterów" +msgstr "asembler Thumb może przyjąć do 4 parameterów" #: py/emitinlinextensa.c msgid "can only have up to 4 parameters to Xtensa assembly" @@ -3562,7 +3562,7 @@ msgstr "" #~ msgstr "Nie udało się odkryć serwisów" #~ msgid "Failed to get local address" -#~ msgstr "Nie udało się uzyskać lokalnego adresu" +#~ msgstr "Nie udało się uzyskać lokalnego adresu" #~ msgid "Failed to get softdevice state" #~ msgstr "Nie udało się odczytać stanu softdevice" @@ -3610,7 +3610,7 @@ msgstr "" #~ msgstr "Nie udało się zapisać gatts, błąd 0x%04x" #~ msgid "Flash erase failed" -#~ msgstr "Nie udało się skasować flash" +#~ msgstr "Nie udało się skasować flash" #~ msgid "Flash erase failed to start, err 0x%04x" #~ msgstr "Nie udało się rozpocząć kasowania flash, błąd 0x%04x" From c34cb82ecb26ac2d5d85394ec535928194cd9e5e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 2 Sep 2020 15:52:02 -0500 Subject: [PATCH 0787/1293] makeqstrdata: correct range of low code points to 0x80..0x9f inclusive The previous range was unintentionally big and overlaps some characters we'd like to use (and also 0xa0, which we don't intentionally use) --- py/makeqstrdata.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 28aed3df97..350f11c4cb 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -116,7 +116,7 @@ def pua_to_ngrams(compressed, ngrams): if len(ngrams) > 32: start, end = 0xe000, 0xf8ff else: - start, end = 0x80, 0xbf + start, end = 0x80, 0x9f return "".join(ngrams[ord(c) - start] if (start <= ord(c) <= end) else c for c in compressed) def compute_huffman_coding(translations, qstrs, compression_filename): @@ -146,6 +146,7 @@ def compute_huffman_coding(translations, qstrs, compression_filename): last_l = l lengths = bytearray() print("// length count", length_count) + print("// bigrams", ngrams) for i in range(1, max(length_count) + 2): lengths.append(length_count.get(i, 0)) print("// values", values, "lengths", len(lengths), lengths) From cbfd38d1ce8839e11e828b0e8742d5d983446313 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 2 Sep 2020 19:09:23 -0500 Subject: [PATCH 0788/1293] Rename functions to encode_ngrams / decode_ngrams --- py/makeqstrdata.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 350f11c4cb..40c50b7b43 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -103,7 +103,7 @@ def translate(translation_file, i18ns): def frequent_ngrams(corpus, sz, n): return collections.Counter(corpus[i:i+sz] for i in range(len(corpus)-sz)).most_common(n) -def ngrams_to_pua(translation, ngrams): +def encode_ngrams(translation, ngrams): if len(ngrams) > 32: start = 0xe000 else: @@ -112,7 +112,7 @@ def ngrams_to_pua(translation, ngrams): translation = translation.replace(g, chr(start + i)) return translation -def pua_to_ngrams(compressed, ngrams): +def decode_ngrams(compressed, ngrams): if len(ngrams) > 32: start, end = 0xe000, 0xf8ff else: @@ -123,7 +123,7 @@ def compute_huffman_coding(translations, qstrs, compression_filename): all_strings = [x[1] for x in translations] all_strings_concat = "".join(all_strings) ngrams = [i[0] for i in frequent_ngrams(all_strings_concat, 2, 32)] - all_strings_concat = ngrams_to_pua(all_strings_concat, ngrams) + all_strings_concat = encode_ngrams(all_strings_concat, ngrams) counts = collections.Counter(all_strings_concat) cb = huffman.codebook(counts.items()) values = [] @@ -211,7 +211,7 @@ def decompress(encoding_table, encoded, encoded_length_bits): searched_length += lengths[bit_length] v = values[searched_length + bits - max_code] - v = pua_to_ngrams(v, ngrams) + v = decode_ngrams(v, ngrams) i += len(v.encode('utf-8')) dec.append(v) return ''.join(dec) @@ -220,7 +220,7 @@ def compress(encoding_table, decompressed, encoded_length_bits, len_translation_ if not isinstance(decompressed, str): raise TypeError() values, lengths, ngrams = encoding_table - decompressed = ngrams_to_pua(decompressed, ngrams) + decompressed = encode_ngrams(decompressed, ngrams) enc = bytearray(len(decompressed) * 3) #print(decompressed) #print(lengths) From 960888a3bd78ba4f456bc1e26347b9a9f4d615d9 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 3 Sep 2020 14:22:18 -0400 Subject: [PATCH 0789/1293] fix pins for trellis_m4 board.I2C() --- ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.h index 96b38810c3..331ee894b1 100644 --- a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.h @@ -16,8 +16,8 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define DEFAULT_I2C_BUS_SCL (&pin_PB08) -#define DEFAULT_I2C_BUS_SDA (&pin_PB09) +#define DEFAULT_I2C_BUS_SCL (&pin_PB09) +#define DEFAULT_I2C_BUS_SDA (&pin_PB08) // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 From 0b94638aeb667f2a417d859487083241a5749128 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 3 Sep 2020 16:32:12 -0700 Subject: [PATCH 0790/1293] Changes based on Dan's feedback --- locale/circuitpython.pot | 14 +-- ports/esp32s2/common-hal/socketpool/Socket.c | 11 +-- .../common-hal/socketpool/SocketPool.c | 4 +- .../esp32s2/common-hal/socketpool/__init__.c | 6 -- ports/esp32s2/common-hal/wifi/Radio.c | 14 +-- .../esp32s2/common-hal/wifi/ScannedNetworks.c | 1 + ports/esp32s2/common-hal/wifi/__init__.c | 91 +++++++++---------- ports/esp32s2/mpconfigport.mk | 3 +- ports/esp32s2/partitions.csv | 12 +-- py/circuitpy_mpconfig.mk | 2 +- shared-bindings/ipaddress/IPv4Address.c | 4 +- shared-bindings/ipaddress/__init__.c | 4 +- shared-bindings/socketpool/SocketPool.c | 2 +- shared-bindings/ssl/SSLContext.c | 2 +- shared-bindings/wifi/Radio.c | 11 +-- shared-module/ipaddress/__init__.c | 2 +- 16 files changed, 78 insertions(+), 105 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 2ba112d00e..5122e7ba8f 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-27 11:21-0400\n" +"POT-Creation-Date: 2020-09-03 15:16-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1238,7 +1238,7 @@ msgid "Nordic Soft Device failure assertion." msgstr "" #: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c -msgid "Not a valid IP string." +msgid "Not a valid IP string" msgstr "" #: ports/nrf/common-hal/_bleio/__init__.c @@ -1282,7 +1282,7 @@ msgid "" msgstr "" #: shared-bindings/ipaddress/__init__.c -msgid "Only raw int supported for ip." +msgid "Only raw int supported for ip" msgstr "" #: shared-bindings/audiobusio/PDMIn.c @@ -1365,10 +1365,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -1486,7 +1482,7 @@ msgid "Serializer in use" msgstr "" #: shared-bindings/ssl/SSLContext.c -msgid "Server side context cannot have hostname." +msgid "Server side context cannot have hostname" msgstr "" #: shared-bindings/nvm/ByteArray.c @@ -1792,7 +1788,7 @@ msgid "" msgstr "" #: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters." +msgid "WiFi password must be between 8 and 63 characters" msgstr "" #: ports/nrf/common-hal/_bleio/PacketBuffer.c diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/esp32s2/common-hal/socketpool/Socket.c index 654ea42d55..0a994c604e 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.c +++ b/ports/esp32s2/common-hal/socketpool/Socket.c @@ -55,7 +55,6 @@ bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self, const c if (err == ESP_ERR_MBEDTLS_SSL_SETUP_FAILED) { mp_raise_espidf_MemoryError(); } else if (ESP_ERR_MBEDTLS_SSL_HANDSHAKE_FAILED) { - // What should this error be? mp_raise_OSError_msg_varg(translate("Failed SSL handshake")); } else { mp_raise_OSError_msg_varg(translate("Unhandled ESP TLS error %d %d %x %d"), esp_tls_code, flags, err, result); @@ -123,15 +122,9 @@ mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, } void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self) { - if (self->connected) { - self->connected = false; - } + self->connected = false; if (self->tcp != NULL) { - int status = esp_tls_conn_destroy(self->tcp); - - if (status < 0) { - // raise an error - } + esp_tls_conn_destroy(self->tcp); self->tcp = NULL; } } diff --git a/ports/esp32s2/common-hal/socketpool/SocketPool.c b/ports/esp32s2/common-hal/socketpool/SocketPool.c index dbc9c91924..4a07f21c48 100644 --- a/ports/esp32s2/common-hal/socketpool/SocketPool.c +++ b/ports/esp32s2/common-hal/socketpool/SocketPool.c @@ -35,7 +35,7 @@ void common_hal_socketpool_socketpool_construct(socketpool_socketpool_obj_t* self, mp_obj_t radio) { if (radio != MP_OBJ_FROM_PTR(&common_hal_wifi_radio_obj)) { - mp_raise_ValueError(translate("SocketPool can only be used with wifi.radio.")); + mp_raise_ValueError(translate("SocketPool can only be used with wifi.radio")); } } @@ -63,7 +63,7 @@ socketpool_socket_obj_t* common_hal_socketpool_socket(socketpool_socketpool_obj_ if (socket_type == SOCK_DGRAM || socket_type == SOCK_RAW || addr_family == AF_INET6 || ipproto == IPPROTO_IPV6) { - mp_raise_NotImplementedError(translate("Only IPv4 SOCK_STREAM sockets supported.")); + mp_raise_NotImplementedError(translate("Only IPv4 SOCK_STREAM sockets supported")); } int socknum = -1; diff --git a/ports/esp32s2/common-hal/socketpool/__init__.c b/ports/esp32s2/common-hal/socketpool/__init__.c index 8f9565b46e..fa0e7d5f3f 100644 --- a/ports/esp32s2/common-hal/socketpool/__init__.c +++ b/ports/esp32s2/common-hal/socketpool/__init__.c @@ -23,9 +23,3 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H - - -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SOCKETPOOL___INIT___H diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index ae3fa2f175..3c6ab57570 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -73,10 +73,12 @@ void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled) { } } +#define MAC_ADDRESS_LENGTH 6 + mp_obj_t common_hal_wifi_radio_get_mac_address(wifi_radio_obj_t *self) { - uint8_t mac[6]; + uint8_t mac[MAC_ADDRESS_LENGTH]; esp_wifi_get_mac(ESP_IF_WIFI_STA, mac); - return mp_const_none; + return mp_obj_new_bytes(mac, MAC_ADDRESS_LENGTH); } mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self) { @@ -87,8 +89,8 @@ mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self) { start_station(self); wifi_scannednetworks_obj_t *scan = m_new_obj(wifi_scannednetworks_obj_t); - self->current_scan = scan; scan->base.type = &wifi_scannednetworks_type; + self->current_scan = scan; scan->start_channel = 1; scan->end_channel = 11; scan->radio_event_group = self->event_group_handle; @@ -107,9 +109,7 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t wifi_config_t* config = &self->sta_config; memcpy(&config->sta.ssid, ssid, ssid_len); config->sta.ssid[ssid_len] = 0; - if (password_len > 0) { - memcpy(&config->sta.password, password, password_len); - } + memcpy(&config->sta.password, password, password_len); config->sta.password[password_len] = 0; config->sta.channel = channel; esp_wifi_set_config(ESP_IF_WIFI_STA, config); @@ -159,7 +159,7 @@ mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address, uint32_t received = 0; uint32_t total_time_ms = 0; - while (received == 0 && total_time_ms < timeout_ms) { + while (received == 0 && total_time_ms < timeout_ms && !mp_hal_is_interrupted()) { RUN_BACKGROUND_TASKS; esp_ping_get_profile(ping, ESP_PING_PROF_DURATION, &total_time_ms, sizeof(total_time_ms)); esp_ping_get_profile(ping, ESP_PING_PROF_REPLY, &received, sizeof(received)); diff --git a/ports/esp32s2/common-hal/wifi/ScannedNetworks.c b/ports/esp32s2/common-hal/wifi/ScannedNetworks.c index c13fef0718..507c6d1861 100644 --- a/ports/esp32s2/common-hal/wifi/ScannedNetworks.c +++ b/ports/esp32s2/common-hal/wifi/ScannedNetworks.c @@ -162,6 +162,7 @@ void wifi_scannednetworks_deinit(wifi_scannednetworks_obj_t* self) { if (self->scanning) { esp_wifi_scan_stop(); if (wifi_scannednetworks_wait_for_scan(self)) { + // Ignore the number of records since we're throwing them away. uint16_t number = 0; esp_wifi_scan_get_ap_records(&number, NULL); self->scanning = false; diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index d455679467..b9ea9da06f 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -44,51 +44,42 @@ static void event_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data) { wifi_radio_obj_t* radio = arg; if (event_base == WIFI_EVENT) { - if (event_id == WIFI_EVENT_SCAN_DONE) { - xEventGroupSetBits(radio->event_group_handle, WIFI_SCAN_DONE_BIT); - } else if (event_id == WIFI_EVENT_STA_START) { - } else if (event_id == WIFI_EVENT_STA_STOP) { - } else if (event_id == WIFI_EVENT_STA_CONNECTED) { - ESP_EARLY_LOGW(TAG, "connected"); - } else if (event_id == WIFI_EVENT_STA_DISCONNECTED) { - ESP_EARLY_LOGW(TAG, "disconnected"); - wifi_event_sta_disconnected_t* d = (wifi_event_sta_disconnected_t*) event_data; - uint8_t reason = d->reason; - ESP_EARLY_LOGW(TAG, "reason %d 0x%02x", reason, reason); - if (radio->retries_left > 0 && - (reason == WIFI_REASON_AUTH_EXPIRE || - reason == WIFI_REASON_ASSOC_EXPIRE || - reason == WIFI_REASON_CONNECTION_FAIL || - reason == WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT)) { - radio->retries_left--; - ESP_EARLY_LOGI(TAG, "Retrying connect. %d retries remaining", radio->retries_left); - esp_wifi_connect(); - return; + switch (event_id) { + case WIFI_EVENT_SCAN_DONE: + xEventGroupSetBits(radio->event_group_handle, WIFI_SCAN_DONE_BIT); + break; + case WIFI_EVENT_STA_CONNECTED: + ESP_EARLY_LOGW(TAG, "connected"); + break; + case WIFI_EVENT_STA_DISCONNECTED: { + ESP_EARLY_LOGW(TAG, "disconnected"); + wifi_event_sta_disconnected_t* d = (wifi_event_sta_disconnected_t*) event_data; + uint8_t reason = d->reason; + ESP_EARLY_LOGW(TAG, "reason %d 0x%02x", reason, reason); + if (radio->retries_left > 0 && + (reason == WIFI_REASON_AUTH_EXPIRE || + reason == WIFI_REASON_ASSOC_EXPIRE || + reason == WIFI_REASON_CONNECTION_FAIL || + reason == WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT)) { + radio->retries_left--; + ESP_EARLY_LOGI(TAG, "Retrying connect. %d retries remaining", radio->retries_left); + esp_wifi_connect(); + return; + } + + radio->last_disconnect_reason = reason; + xEventGroupSetBits(radio->event_group_handle, WIFI_DISCONNECTED_BIT); } - radio->last_disconnect_reason = reason; - xEventGroupSetBits(radio->event_group_handle, WIFI_DISCONNECTED_BIT); - - // if (reason != WIFI_REASON_ASSOC_LEAVE) { - // // reconnect - // } - } else if (event_id == WIFI_EVENT_STA_AUTHMODE_CHANGE) { + // Cases to handle later. + // case WIFI_EVENT_STA_START: + // case WIFI_EVENT_STA_STOP: + // case WIFI_EVENT_STA_AUTHMODE_CHANGE: + default: + break; } } - // esp_wifi_connect(); - // if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) { - // esp_wifi_connect(); - // } else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) { - // if (s_retry_num < EXAMPLE_ESP_MAXIMUM_RETRY) { - // esp_wifi_connect(); - // s_retry_num++; - // ESP_LOGI(TAG, "retry to connect to the AP"); - // } else { - // xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT); - // } - // ESP_LOGI(TAG,"connect to the AP fail"); - // } else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) { ESP_EARLY_LOGW(TAG, "got ip"); radio->retries_left = radio->starting_retries; @@ -100,7 +91,7 @@ static bool wifi_inited; void common_hal_wifi_init(void) { wifi_inited = true; - common_hal_wifi_radio_obj.base.type = &wifi_radio_type; + common_hal_wifi_radio_obj.base.type = &wifi_radio_type; ESP_ERROR_CHECK(esp_netif_init()); ESP_ERROR_CHECK(esp_event_loop_create_default()); @@ -120,13 +111,13 @@ void common_hal_wifi_init(void) { self, &self->handler_instance_got_ip)); - wifi_init_config_t config = WIFI_INIT_CONFIG_DEFAULT(); - esp_err_t result = esp_wifi_init(&config); - if (result == ESP_ERR_NO_MEM) { - mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate Wifi memory")); - } else if (result != ESP_OK) { - // handle this - } + wifi_init_config_t config = WIFI_INIT_CONFIG_DEFAULT(); + esp_err_t result = esp_wifi_init(&config); + if (result == ESP_ERR_NO_MEM) { + mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate Wifi memory")); + } else if (result != ESP_OK) { + mp_raise_RuntimeError(translate("Failed to init wifi")); + } common_hal_wifi_radio_set_enabled(self, true); } @@ -135,14 +126,14 @@ void wifi_reset(void) { return; } wifi_radio_obj_t* radio = &common_hal_wifi_radio_obj; - common_hal_wifi_radio_set_enabled(radio, false); + common_hal_wifi_radio_set_enabled(radio, false); ESP_ERROR_CHECK(esp_event_handler_instance_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, radio->handler_instance_all_wifi)); ESP_ERROR_CHECK(esp_event_handler_instance_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, radio->handler_instance_got_ip)); - ESP_ERROR_CHECK(esp_wifi_deinit()); + ESP_ERROR_CHECK(esp_wifi_deinit()); esp_netif_destroy(radio->netif); radio->netif = NULL; ESP_ERROR_CHECK(esp_netif_deinit()); diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 5252714388..ee98ce1f42 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -23,7 +23,8 @@ CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_NVM = 0 -CIRCUITPY_USB_MIDI = 0 # We don't have enough endpoints to include MIDI. +# We don't have enough endpoints to include MIDI. +CIRCUITPY_USB_MIDI = 0 CIRCUITPY_WIFI = 1 CIRCUITPY_ESPIDF = 1 diff --git a/ports/esp32s2/partitions.csv b/ports/esp32s2/partitions.csv index 7c9a1cac90..cf9b3cca84 100644 --- a/ports/esp32s2/partitions.csv +++ b/ports/esp32s2/partitions.csv @@ -1,10 +1,10 @@ # ESP-IDF Partition Table # Name, Type, SubType, Offset, Size, Flags -# bootloader.bin 0x1000 -# partition table 0x8000, 0xC00 -otadata, data, ota, 0xd000, 0x2000, -phy_init, data, phy, 0xf000, 0x1000, -ota_0, 0, ota_0, 0x10000, 0x160000, -ota_1, 0, ota_1, 0x170000, 0x160000, +# bootloader.bin,, 0x1000, 32K +# partition table,, 0x8000, 4K +nvs, data, nvs, 0x9000, 20K, +otadata, data, ota, 0xe000, 8K, +ota_0, 0, ota_0, 0x10000, 1408K, +ota_1, 0, ota_1, 0x170000, 1408K, uf2, app, factory,0x2d0000, 256K, user_fs, data, fat, 0x310000, 960K, diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 2629883f80..ca2f60508e 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -95,7 +95,7 @@ CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO) CIRCUITPY_DISPLAYIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_DISPLAYIO=$(CIRCUITPY_DISPLAYIO) -# CIRCUITPY_ESPIDF is handled in the atmel-samd tree. +# CIRCUITPY_ESPIDF is handled in the esp32s2 tree. # Only for ESP32S chips. # Assume not a ESP build. CIRCUITPY_ESPIDF ?= 0 diff --git a/shared-bindings/ipaddress/IPv4Address.c b/shared-bindings/ipaddress/IPv4Address.c index 03d1874cfc..b2a10158ae 100644 --- a/shared-bindings/ipaddress/IPv4Address.c +++ b/shared-bindings/ipaddress/IPv4Address.c @@ -39,7 +39,7 @@ //| """Encapsulates an IPv4 address.""" //| -//| def __init__(self, address: Union[str, bytes]) -> None: +//| def __init__(self, address: Union[int, str, bytes]) -> None: //| """Create a new IPv4Address object encapsulating the address value. //| //| The value itself can either be bytes or a string formatted address.""" @@ -64,7 +64,7 @@ STATIC mp_obj_t ipaddress_ipv4address_make_new(const mp_obj_type_t *type, size_t } else if (MP_OBJ_IS_STR(address)) { GET_STR_DATA_LEN(address, str_data, str_len); if (!ipaddress_parse_ipv4address((const char*) str_data, str_len, &value)) { - mp_raise_ValueError(translate("Not a valid IP string.")); + mp_raise_ValueError(translate("Not a valid IP string")); } } else { mp_buffer_info_t buf_info; diff --git a/shared-bindings/ipaddress/__init__.c b/shared-bindings/ipaddress/__init__.c index 76b63202cc..7ec2984ef7 100644 --- a/shared-bindings/ipaddress/__init__.c +++ b/shared-bindings/ipaddress/__init__.c @@ -88,10 +88,10 @@ STATIC mp_obj_t ipaddress_ip_address(mp_obj_t ip_in) { } else if (MP_OBJ_IS_STR(ip_in)) { GET_STR_DATA_LEN(ip_in, str_data, str_len); if (!ipaddress_parse_ipv4address((const char*) str_data, str_len, &value)) { - mp_raise_ValueError(translate("Not a valid IP string.")); + mp_raise_ValueError(translate("Not a valid IP string")); } } else { - mp_raise_ValueError(translate("Only raw int supported for ip.")); + mp_raise_ValueError(translate("Only raw int supported for ip")); } return common_hal_ipaddress_new_ipv4address(value); diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index 5624a6632d..0eeebd6911 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -61,7 +61,7 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t } -//| def socket(self, family: int, type: int, proto: int) -> None: +//| def socket(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> None: //| """Create a new socket //| //| :param ~int family: AF_INET or AF_INET6 diff --git a/shared-bindings/ssl/SSLContext.c b/shared-bindings/ssl/SSLContext.c index 5d44dc0f54..d2c236d3bf 100644 --- a/shared-bindings/ssl/SSLContext.c +++ b/shared-bindings/ssl/SSLContext.c @@ -72,7 +72,7 @@ STATIC mp_obj_t ssl_sslcontext_wrap_socket(size_t n_args, const mp_obj_t *pos_ar const char *server_hostname = mp_obj_str_get_str(args[ARG_server_hostname].u_obj); bool server_side = args[ARG_server_side].u_bool; if (server_side && server_hostname != NULL) { - mp_raise_ValueError(translate("Server side context cannot have hostname.")); + mp_raise_ValueError(translate("Server side context cannot have hostname")); } socketpool_socket_obj_t* sock = args[ARG_sock].u_obj; diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 2d356e5d96..329dcb1b5f 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -61,7 +61,7 @@ const mp_obj_property_t wifi_radio_enabled_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| mac_address: Address +//| mac_address: bytes //| """MAC address of the wifi radio. (read-only)""" //| STATIC mp_obj_t wifi_radio_get_mac_address(mp_obj_t self) { @@ -110,7 +110,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_stop_scanning_networks_obj, wifi_rad 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_timeout }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_ssid, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_ssid, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_password, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, { MP_QSTR_channel, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, @@ -127,17 +127,14 @@ STATIC mp_obj_t wifi_radio_connect(size_t n_args, const mp_obj_t *pos_args, mp_m mp_buffer_info_t ssid; - ssid.len = 0; - if (args[ARG_ssid].u_obj != MP_OBJ_NULL) { - mp_get_buffer_raise(args[ARG_ssid].u_obj, &ssid, MP_BUFFER_READ); - } + mp_get_buffer_raise(args[ARG_ssid].u_obj, &ssid, MP_BUFFER_READ); mp_buffer_info_t password; password.len = 0; if (args[ARG_password].u_obj != MP_OBJ_NULL) { mp_get_buffer_raise(args[ARG_password].u_obj, &password, MP_BUFFER_READ); if (password.len > 0 && (password.len < 8 || password.len > 63)) { - mp_raise_ValueError(translate("WiFi password must be between 8 and 63 characters.")); + mp_raise_ValueError(translate("WiFi password must be between 8 and 63 characters")); } } diff --git a/shared-module/ipaddress/__init__.c b/shared-module/ipaddress/__init__.c index 2fce9d8f51..a8f8e1caf8 100644 --- a/shared-module/ipaddress/__init__.c +++ b/shared-module/ipaddress/__init__.c @@ -31,5 +31,5 @@ mp_obj_t common_hal_ipaddress_new_ipv4address(uint32_t value) { ipaddress_ipv4address_obj_t* self = m_new_obj(ipaddress_ipv4address_obj_t); self->base.type = &ipaddress_ipv4address_type; common_hal_ipaddress_ipv4address_construct(self, (uint8_t*) &value, 4); - return self; + return MP_OBJ_FROM_PTR(self); } From e13698f8f7ad2062a909053d71765b9d819c86dd Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Wed, 2 Sep 2020 04:05:35 +0000 Subject: [PATCH 0791/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (785 of 785 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e407756d07..b40d33f80b 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: 2020-08-30 14:38-0400\n" -"PO-Revision-Date: 2020-08-31 00:37+0000\n" +"PO-Revision-Date: 2020-09-02 22:32+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.2.1-dev\n" +"X-Generator: Weblate 4.3-dev\n" #: main.c msgid "" @@ -508,7 +508,7 @@ msgstr "Não é possível definir o CCCD com a característica local" #: shared-bindings/_bleio/Adapter.c msgid "Cannot create a new Adapter; use _bleio.adapter;" -msgstr "" +msgstr "Não é possível criar um novo Adaptador; utilize _bleio.adapter;" #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c @@ -783,7 +783,7 @@ msgstr "Uma característica é necessária" #: shared-bindings/_bleio/Adapter.c msgid "Expected a DigitalInOut" -msgstr "" +msgstr "Espera-se um DigitalInOut" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" @@ -791,7 +791,7 @@ msgstr "Esperava um Serviço" #: shared-bindings/_bleio/Adapter.c msgid "Expected a UART" -msgstr "" +msgstr "Espera-se uma UART" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c @@ -1284,7 +1284,7 @@ msgstr "O código salvo não está em execução.\n" #: shared-bindings/_bleio/__init__.c msgid "Not settable" -msgstr "" +msgstr "Não configurável" #: shared-bindings/util.c msgid "" @@ -2547,7 +2547,7 @@ msgstr "os valores iniciais devem ser iteráveis" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "initial_value length is wrong" -msgstr "" +msgstr "O comprimento do initial_value está errado" #: py/compile.c msgid "inline assembler must be a function" @@ -2746,7 +2746,7 @@ msgstr "o max_length deve ser 0-%d quando Fixed_length for %s" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "max_length must be > 0" -msgstr "" +msgstr "max_length deve ser > 0" #: py/runtime.c msgid "maximum recursion depth exceeded" From f7714649eeb1b8be97099e848a800a4dea941867 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Fri, 4 Sep 2020 14:15:15 -0500 Subject: [PATCH 0792/1293] Add dirty rectangle tracking to Shape display element --- shared-module/displayio/Shape.c | 74 ++++++++++++++++++++++++++++++ shared-module/displayio/Shape.h | 5 ++ shared-module/displayio/TileGrid.c | 8 +++- 3 files changed, 86 insertions(+), 1 deletion(-) diff --git a/shared-module/displayio/Shape.c b/shared-module/displayio/Shape.c index ab9ca735bc..b8412ed9a3 100644 --- a/shared-module/displayio/Shape.c +++ b/shared-module/displayio/Shape.c @@ -49,10 +49,16 @@ void common_hal_displayio_shape_construct(displayio_shape_t *self, uint32_t widt self->half_height = height; self->data = m_malloc(height * sizeof(uint32_t), false); + //for (uint16_t i = 0; i < height; i++) { for (uint16_t i = 0; i <= height; i++) { self->data[2 * i] = 0; self->data[2 * i + 1] = width; } + + self->dirty_area.x1=0; + self->dirty_area.x2=width; + self->dirty_area.y1=0; + self->dirty_area.y2=height; } void common_hal_displayio_shape_set_boundary(displayio_shape_t *self, uint16_t y, uint16_t start_x, uint16_t end_x) { @@ -66,8 +72,58 @@ void common_hal_displayio_shape_set_boundary(displayio_shape_t *self, uint16_t y if (self->mirror_x && (start_x > half_width || end_x > half_width)) { mp_raise_ValueError_varg(translate("Maximum x value when mirrored is %d"), half_width); } + + uint16_t lower_x, upper_x; + + // find x-boundaries for updating based on current data and start_x, end_x + if (start_x < self->data[2 * y]) { + lower_x = start_x; + } else { + lower_x = self->data[2 * y]; + } + + if (self->mirror_x) { + upper_x = self->width-lower_x; + } else { + if (end_x > self->data[2 * y + 1]) { + upper_x = end_x + 1; + } else { + upper_x = self->data[2 * y + 1] + 1; + } + } + self->data[2 * y] = start_x; self->data[2 * y + 1] = end_x; + + if (self->dirty_area.x1 == self->dirty_area.x2) { // Dirty region is empty + self->dirty_area.x1=lower_x; + self->dirty_area.x2=upper_x; + self->dirty_area.y1 = y; + if (self->mirror_y) { + self->dirty_area.y2 = self->height-y; + } else { + self->dirty_area.y2 = y+1; + } + } else { // Dirty region is not empty + if (lower_x < self->dirty_area.x1) { + self->dirty_area.x1 = lower_x; + } + if (upper_x > self->dirty_area.x2) { + self->dirty_area.x2 = upper_x; + } + if (y < self->dirty_area.y1) { + self->dirty_area.y1=y; + if (self->mirror_y) { // if y is mirrored and the lower y was updated, the upper y must be updated too + self->dirty_area.y2=self->height-y; + } + } + else { + if ( !self->mirror_y && (y >= self->dirty_area.y2) ) { // y is not mirrored + self->dirty_area.y2=y+1; + } + } + } + } uint32_t common_hal_displayio_shape_get_pixel(void *obj, int16_t x, int16_t y) { @@ -88,3 +144,21 @@ uint32_t common_hal_displayio_shape_get_pixel(void *obj, int16_t x, int16_t y) { } return 1; } + +displayio_area_t* displayio_shape_get_refresh_areas(displayio_shape_t *self, displayio_area_t* tail) { + if (self->dirty_area.x1 == self->dirty_area.x2) { + return tail; + } + self->dirty_area.next = tail; + return &self->dirty_area; +} + +void displayio_shape_finish_refresh(displayio_shape_t *self) { + self->dirty_area.x1 = 0; + self->dirty_area.x2 = 0; +} + + + + + diff --git a/shared-module/displayio/Shape.h b/shared-module/displayio/Shape.h index ca054fe008..e59ad586e7 100644 --- a/shared-module/displayio/Shape.h +++ b/shared-module/displayio/Shape.h @@ -31,6 +31,7 @@ #include #include "py/obj.h" +#include "shared-module/displayio/area.h" typedef struct { mp_obj_base_t base; @@ -41,6 +42,10 @@ typedef struct { uint16_t* data; bool mirror_x; bool mirror_y; + displayio_area_t dirty_area; } displayio_shape_t; +void displayio_shape_finish_refresh(displayio_shape_t *self); +displayio_area_t* displayio_shape_get_refresh_areas(displayio_shape_t *self, displayio_area_t* tail); + #endif // MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_SHAPE_H diff --git a/shared-module/displayio/TileGrid.c b/shared-module/displayio/TileGrid.c index 2766cbecdc..e3642107f8 100644 --- a/shared-module/displayio/TileGrid.c +++ b/shared-module/displayio/TileGrid.c @@ -499,7 +499,7 @@ void displayio_tilegrid_finish_refresh(displayio_tilegrid_t *self) { if (MP_OBJ_IS_TYPE(self->bitmap, &displayio_bitmap_type)) { displayio_bitmap_finish_refresh(self->bitmap); } else if (MP_OBJ_IS_TYPE(self->bitmap, &displayio_shape_type)) { - // TODO: Support shape changes. + displayio_shape_finish_refresh(self->bitmap); } else if (MP_OBJ_IS_TYPE(self->bitmap, &displayio_ondiskbitmap_type)) { // OnDiskBitmap changes will trigger a complete reload so no need to // track changes. @@ -543,6 +543,12 @@ displayio_area_t* displayio_tilegrid_get_refresh_areas(displayio_tilegrid_t *sel self->full_change = true; } } + } else if (MP_OBJ_IS_TYPE(self->bitmap, &displayio_shape_type)) { + displayio_area_t* refresh_area = displayio_shape_get_refresh_areas(self->bitmap, tail); + if (refresh_area != tail) { + displayio_area_copy(refresh_area, &self->dirty_area); + self->partial_change = true; + } } self->full_change = self->full_change || From 9edad9ea851528b1be4ee924c49fa3ecc67f9fe1 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Fri, 4 Sep 2020 14:21:49 -0500 Subject: [PATCH 0793/1293] Delete trailing blank lines from Shape.c --- shared-module/displayio/Shape.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/shared-module/displayio/Shape.c b/shared-module/displayio/Shape.c index b8412ed9a3..a0cce60b2d 100644 --- a/shared-module/displayio/Shape.c +++ b/shared-module/displayio/Shape.c @@ -156,9 +156,4 @@ displayio_area_t* displayio_shape_get_refresh_areas(displayio_shape_t *self, dis void displayio_shape_finish_refresh(displayio_shape_t *self) { self->dirty_area.x1 = 0; self->dirty_area.x2 = 0; -} - - - - - +} \ No newline at end of file From 95db456a7ea3db6b4f8047e2fe8b0351354ac7d7 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Fri, 4 Sep 2020 14:23:53 -0500 Subject: [PATCH 0794/1293] Add final newline --- shared-module/displayio/Shape.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/displayio/Shape.c b/shared-module/displayio/Shape.c index a0cce60b2d..ac2abd150f 100644 --- a/shared-module/displayio/Shape.c +++ b/shared-module/displayio/Shape.c @@ -156,4 +156,4 @@ displayio_area_t* displayio_shape_get_refresh_areas(displayio_shape_t *self, dis void displayio_shape_finish_refresh(displayio_shape_t *self) { self->dirty_area.x1 = 0; self->dirty_area.x2 = 0; -} \ No newline at end of file +} From ed6cc64c4988387e79ac6889e0fd7f4984a5dfc0 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 4 Sep 2020 16:59:41 -0500 Subject: [PATCH 0795/1293] Corrected issue with BLE not working on nrf52840 --- ports/nrf/common-hal/busio/SPI.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ports/nrf/common-hal/busio/SPI.c b/ports/nrf/common-hal/busio/SPI.c index 380ec27de4..d7d0e0fe81 100644 --- a/ports/nrf/common-hal/busio/SPI.c +++ b/ports/nrf/common-hal/busio/SPI.c @@ -104,8 +104,12 @@ void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { never_reset[i] = true; never_reset_pin_number(self->clock_pin_number); - never_reset_pin_number(self->MOSI_pin_number); - never_reset_pin_number(self->MISO_pin_number); + if ( self->MOSI_pin_number != NO_PIN) { + never_reset_pin_number(self->MOSI_pin_number); + } + if ( self->MISO_pin_number != NO_PIN) { + never_reset_pin_number(self->MISO_pin_number); + } break; } } @@ -180,7 +184,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t * if (miso != NULL) { config.miso_pin = miso->number; - self->MISO_pin_number = mosi->number; + self->MISO_pin_number = miso->number; claim_pin(miso); } else { self->MISO_pin_number = NO_PIN; @@ -204,8 +208,12 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { nrfx_spim_uninit(&self->spim_peripheral->spim); reset_pin_number(self->clock_pin_number); - reset_pin_number(self->MOSI_pin_number); - reset_pin_number(self->MISO_pin_number); + if ( self->MOSI_pin_number != NO_PIN) { + reset_pin_number(self->MOSI_pin_number); + } + if ( self->MISO_pin_number != NO_PIN) { + reset_pin_number(self->MISO_pin_number); + } } bool common_hal_busio_spi_configure(busio_spi_obj_t *self, uint32_t baudrate, uint8_t polarity, uint8_t phase, uint8_t bits) { From 297b7195b089f08cd40f97f8a244484a82d2094e Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Fri, 4 Sep 2020 22:03:57 -0500 Subject: [PATCH 0796/1293] Delete unnecessary comment --- shared-module/displayio/Shape.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/displayio/Shape.c b/shared-module/displayio/Shape.c index ac2abd150f..a09191cce1 100644 --- a/shared-module/displayio/Shape.c +++ b/shared-module/displayio/Shape.c @@ -49,7 +49,7 @@ void common_hal_displayio_shape_construct(displayio_shape_t *self, uint32_t widt self->half_height = height; self->data = m_malloc(height * sizeof(uint32_t), false); - //for (uint16_t i = 0; i < height; i++) { + for (uint16_t i = 0; i <= height; i++) { self->data[2 * i] = 0; self->data[2 * i + 1] = width; From 2690faec4313bf36d83374ccbfab02f6abbef6dc Mon Sep 17 00:00:00 2001 From: root Date: Sat, 5 Sep 2020 11:42:06 -0500 Subject: [PATCH 0797/1293] Moved checks for invalid pin to common-hal/microcontroller/Pin.c --- .../atmel-samd/common-hal/microcontroller/Pin.c | 4 ++++ ports/esp32s2/common-hal/microcontroller/Pin.c | 6 ++++++ ports/nrf/common-hal/busio/SPI.c | 16 ++++------------ ports/nrf/common-hal/microcontroller/Pin.c | 3 +++ ports/stm/common-hal/microcontroller/Pin.c | 7 +++++++ 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/ports/atmel-samd/common-hal/microcontroller/Pin.c b/ports/atmel-samd/common-hal/microcontroller/Pin.c index 5ce077eb86..ef1d8fffaa 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Pin.c +++ b/ports/atmel-samd/common-hal/microcontroller/Pin.c @@ -106,6 +106,10 @@ void reset_all_pins(void) { } void never_reset_pin_number(uint8_t pin_number) { + if (pin_number >= PORT_BITS) { + return; + } + never_reset_pins[GPIO_PORT(pin_number)] |= 1 << GPIO_PIN(pin_number); } diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index 03a83cfe67..546dca848c 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -45,6 +45,9 @@ bool apa102_mosi_in_use; bool apa102_sck_in_use; void never_reset_pin_number(gpio_num_t pin_number) { + if (pin_number == -1 ) { + return; + } never_reset_pins[pin_number / 32] |= 1 << pin_number % 32; } @@ -54,6 +57,9 @@ void common_hal_never_reset_pin(const mcu_pin_obj_t* pin) { // Mark pin as free and return it to a quiescent state. void reset_pin_number(gpio_num_t pin_number) { + if (pin_number == -1 ) { + return; + } never_reset_pins[pin_number / 32] &= ~(1 << pin_number % 32); in_use[pin_number / 32] &= ~(1 << pin_number % 32); diff --git a/ports/nrf/common-hal/busio/SPI.c b/ports/nrf/common-hal/busio/SPI.c index d7d0e0fe81..1cf074955f 100644 --- a/ports/nrf/common-hal/busio/SPI.c +++ b/ports/nrf/common-hal/busio/SPI.c @@ -104,12 +104,8 @@ void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { never_reset[i] = true; never_reset_pin_number(self->clock_pin_number); - if ( self->MOSI_pin_number != NO_PIN) { - never_reset_pin_number(self->MOSI_pin_number); - } - if ( self->MISO_pin_number != NO_PIN) { - never_reset_pin_number(self->MISO_pin_number); - } + never_reset_pin_number(self->MOSI_pin_number); + never_reset_pin_number(self->MISO_pin_number); break; } } @@ -208,12 +204,8 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { nrfx_spim_uninit(&self->spim_peripheral->spim); reset_pin_number(self->clock_pin_number); - if ( self->MOSI_pin_number != NO_PIN) { - reset_pin_number(self->MOSI_pin_number); - } - if ( self->MISO_pin_number != NO_PIN) { - reset_pin_number(self->MISO_pin_number); - } + reset_pin_number(self->MOSI_pin_number); + reset_pin_number(self->MISO_pin_number); } bool common_hal_busio_spi_configure(busio_spi_obj_t *self, uint32_t baudrate, uint8_t polarity, uint8_t phase, uint8_t bits) { diff --git a/ports/nrf/common-hal/microcontroller/Pin.c b/ports/nrf/common-hal/microcontroller/Pin.c index d294c1dd5d..bc7ff831a5 100644 --- a/ports/nrf/common-hal/microcontroller/Pin.c +++ b/ports/nrf/common-hal/microcontroller/Pin.c @@ -123,6 +123,9 @@ void reset_pin_number(uint8_t pin_number) { void never_reset_pin_number(uint8_t pin_number) { + if (pin_number == NO_PIN) { + return; + } never_reset_pins[nrf_pin_port(pin_number)] |= 1 << nrf_relative_pin_number(pin_number); } diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index 9fbdedeade..9965132703 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -70,6 +70,10 @@ void reset_all_pins(void) { // Mark pin as free and return it to a quiescent state. void reset_pin_number(uint8_t pin_port, uint8_t pin_number) { + if ( pin_number == NO_PIN ) { + return; + } + if (pin_port == 0x0F) { return; } @@ -88,6 +92,9 @@ void reset_pin_number(uint8_t pin_port, uint8_t pin_number) { } void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number) { + if ( pin_number == NO_PIN ) { + return; + } never_reset_pins[pin_port] |= 1< Date: Tue, 28 Apr 2020 09:13:49 -0500 Subject: [PATCH 0798/1293] core: add int.bit_length() when MICROPY_CYPTHON_COMPAT is enabled This method of integer objects is needed for a port of python3's decimal.py module. MICROPY_CPYTHON_COMPAT is enabled by CIRCUITPY_FULL_BUILD. --- py/mpz.h | 3 +++ py/objint.c | 25 +++++++++++++++++++++++++ py/objint.h | 1 + py/objint_longlong.c | 11 +++++++++++ py/objint_mpz.c | 6 ++++++ tests/basics/bit_length.py | 4 ++++ tests/basics/builtin_help.py.exp | 4 ++-- 7 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 tests/basics/bit_length.py diff --git a/py/mpz.h b/py/mpz.h index e412f5cce1..ade04a4f7c 100644 --- a/py/mpz.h +++ b/py/mpz.h @@ -135,6 +135,9 @@ void mpz_xor_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs); void mpz_divmod_inpl(mpz_t *dest_quo, mpz_t *dest_rem, const mpz_t *lhs, const mpz_t *rhs); static inline size_t mpz_max_num_bits(const mpz_t *z) { return z->len * MPZ_DIG_SIZE; } +static inline size_t mpz_num_bits(const mpz_t *z) { + size_t last_bits = (8 * (sizeof(long) - sizeof(mpz_dig_t))) - __builtin_clzl(z->dig[z->len-1]); + return z->len * MPZ_DIG_SIZE + last_bits; } mp_int_t mpz_hash(const mpz_t *z); bool mpz_as_int_checked(const mpz_t *z, mp_int_t *value); bool mpz_as_uint_checked(const mpz_t *z, mp_uint_t *value); diff --git a/py/objint.c b/py/objint.c index b12bb39952..5a33ccbc04 100644 --- a/py/objint.c +++ b/py/objint.c @@ -457,6 +457,28 @@ mp_obj_t mp_obj_int_binary_op_extra_cases(mp_binary_op_t op, mp_obj_t lhs_in, mp return MP_OBJ_NULL; // op not supported } +#if MICROPY_CPYTHON_COMPAT +STATIC mp_obj_t int_bit_length(mp_obj_t self_in) { + #if MICROPY_LONGINT_IMPL != MICROPY_LONGINT_IMPL_NONE + if (!MP_OBJ_IS_SMALL_INT(self_in)) { + return mp_obj_int_bit_length_impl(self_in); + } + else + #endif + { + mp_int_t int_val = MP_OBJ_SMALL_INT_VALUE(self_in); + mp_uint_t value = + (int_val == 0) ? 0 : + (int_val == MP_SMALL_INT_MIN) ? 8 * sizeof(mp_int_t) : + (int_val < 0) ? 8 * sizeof(long) - __builtin_clzl(-int_val) : + 8 * sizeof(long) - __builtin_clzl(int_val); + return mp_obj_new_int_from_uint(value); + } + +} +MP_DEFINE_CONST_FUN_OBJ_1(int_bit_length_obj, int_bit_length); +#endif + // this is a classmethod STATIC mp_obj_t int_from_bytes(size_t n_args, const mp_obj_t *args) { // TODO: Support signed param (assumes signed=False at the moment) @@ -537,6 +559,9 @@ STATIC mp_obj_t int_to_bytes(size_t n_args, const mp_obj_t *pos_args, mp_map_t * STATIC MP_DEFINE_CONST_FUN_OBJ_KW(int_to_bytes_obj, 3, int_to_bytes); STATIC const mp_rom_map_elem_t int_locals_dict_table[] = { +#if MICROPY_CPYTHON_COMPAT + { MP_ROM_QSTR(MP_QSTR_bit_length), MP_ROM_PTR(&int_bit_length_obj) }, +#endif { MP_ROM_QSTR(MP_QSTR_from_bytes), MP_ROM_PTR(&int_from_bytes_obj) }, { MP_ROM_QSTR(MP_QSTR_to_bytes), MP_ROM_PTR(&int_to_bytes_obj) }, }; diff --git a/py/objint.h b/py/objint.h index bba9ff50a5..68997ced27 100644 --- a/py/objint.h +++ b/py/objint.h @@ -60,6 +60,7 @@ void mp_obj_int_buffer_overflow_check(mp_obj_t self_in, size_t nbytes, bool is_s void mp_small_int_buffer_overflow_check(mp_int_t val, size_t nbytes, bool is_signed); mp_int_t mp_obj_int_hash(mp_obj_t self_in); +mp_obj_t mp_obj_int_bit_length_impl(mp_obj_t self_in); mp_obj_t mp_obj_int_from_bytes_impl(bool big_endian, size_t len, const byte *buf); void mp_obj_int_to_bytes_impl(mp_obj_t self_in, bool big_endian, size_t len, byte *buf); int mp_obj_int_sign(mp_obj_t self_in); diff --git a/py/objint_longlong.c b/py/objint_longlong.c index 1890496305..0a65098c78 100644 --- a/py/objint_longlong.c +++ b/py/objint_longlong.c @@ -45,6 +45,17 @@ const mp_obj_int_t mp_maxsize_obj = {{&mp_type_int}, MP_SSIZE_MAX}; #endif +mp_obj_t mp_obj_int_bit_length_impl(mp_obj_t self_in) { + assert(MP_OBJ_IS_TYPE(self_in, &mp_type_int)); + mp_obj_int_t *self = self_in; + long long val = self->val; + return MP_OBJ_NEW_SMALL_INT( + (val == 0) ? 0 : + (val == MP_SMALL_INT_MIN) ? 8 * sizeof(long long) : + (val < 0) ? 8 * sizeof(long long) - __builtin_clzll(-val) : + 8 * sizeof(long long) - __builtin_clzll(val)); +} + mp_obj_t mp_obj_int_from_bytes_impl(bool big_endian, size_t len, const byte *buf) { int delta = 1; if (!big_endian) { diff --git a/py/objint_mpz.c b/py/objint_mpz.c index 90060114ed..d32fdfbe8d 100644 --- a/py/objint_mpz.c +++ b/py/objint_mpz.c @@ -107,6 +107,12 @@ char *mp_obj_int_formatted_impl(char **buf, size_t *buf_size, size_t *fmt_size, return str; } +mp_obj_t mp_obj_int_bit_length_impl(mp_obj_t self_in) { + assert(MP_OBJ_IS_TYPE(self_in, &mp_type_int)); + mp_obj_int_t *self = MP_OBJ_TO_PTR(self_in); + return MP_OBJ_NEW_SMALL_INT(mpz_num_bits(&self->mpz)); +} + mp_obj_t mp_obj_int_from_bytes_impl(bool big_endian, size_t len, const byte *buf) { mp_obj_int_t *o = mp_obj_int_new_mpz(); mpz_set_from_bytes(&o->mpz, big_endian, len, buf); diff --git a/tests/basics/bit_length.py b/tests/basics/bit_length.py new file mode 100644 index 0000000000..5eb33f604e --- /dev/null +++ b/tests/basics/bit_length.py @@ -0,0 +1,4 @@ +for i in range(129): + j = (1 << i) + print(i, (j-1).bit_length(), (j).bit_length(), (j+1).bit_length()) + print(i, (-j-1).bit_length(), (-j).bit_length(), (-j+1).bit_length()) diff --git a/tests/basics/builtin_help.py.exp b/tests/basics/builtin_help.py.exp index ed8a7d74b8..89350a6c79 100644 --- a/tests/basics/builtin_help.py.exp +++ b/tests/basics/builtin_help.py.exp @@ -1,14 +1,14 @@ ######## object is of type function object is of type type + bit_length -- from_bytes -- to_bytes -- object 1 is of type int + bit_length -- from_bytes -- to_bytes -- object is of type module __name__ -- micropython - const -- - opt_level -- ######## done From 73858ea682da98d1b4e153c2f0254a9956e975aa Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 6 Sep 2020 10:07:57 -0500 Subject: [PATCH 0799/1293] circuitpy_mpconfig: enable 3-arg pow() with CIRCUITPY_FULL_BUILD This is needed for a port of python3's decimal.py module. --- py/circuitpy_mpconfig.h | 1 + 1 file changed, 1 insertion(+) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 76b91defae..d144f0ba84 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -185,6 +185,7 @@ typedef long mp_off_t; // Turning off FULL_BUILD removes some functionality to reduce flash size on tiny SAMD21s #define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (CIRCUITPY_FULL_BUILD) #define MICROPY_CPYTHON_COMPAT (CIRCUITPY_FULL_BUILD) +#define MICROPY_PY_BUILTINS_POW3 (CIRCUITPY_FULL_BUILD) #define MICROPY_COMP_FSTRING_LITERAL (MICROPY_CPYTHON_COMPAT) #define MICROPY_MODULE_WEAK_LINKS (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_ALL_SPECIAL_METHODS (CIRCUITPY_FULL_BUILD) From 8d27533cd45f0dc759f84e68408839f118c0c9d2 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 6 Sep 2020 18:03:25 -0500 Subject: [PATCH 0800/1293] Make sure SPI lock is free initially --- shared-module/board/__init__.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index 265c6517fa..903b8fa716 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -89,6 +89,8 @@ mp_obj_t common_hal_board_create_spi(void) { const mcu_pin_obj_t* mosi = MP_OBJ_TO_PTR(DEFAULT_SPI_BUS_MOSI); const mcu_pin_obj_t* miso = MP_OBJ_TO_PTR(DEFAULT_SPI_BUS_MISO); common_hal_busio_spi_construct(self, clock, mosi, miso); + // make sure lock is not held initially + common_hal_busio_spi_unlock(self); spi_singleton = (mp_obj_t)self; return spi_singleton; } From 7d58cdb12c001f5a4a0fdf2fc0d1e8c1d4029045 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 7 Sep 2020 07:11:23 -0500 Subject: [PATCH 0801/1293] update expected result with new method --- tests/cmdline/repl_autocomplete.py.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cmdline/repl_autocomplete.py.exp b/tests/cmdline/repl_autocomplete.py.exp index 7d160e7bf9..0dabc90144 100644 --- a/tests/cmdline/repl_autocomplete.py.exp +++ b/tests/cmdline/repl_autocomplete.py.exp @@ -12,7 +12,7 @@ Use \.\+ 'abc' >>> x = 5 >>> x. -from_bytes to_bytes +bit_length from_bytes to_bytes >>> x. >>> x.__class__ From 19594f4adf40a20f5424ddacd3d3e83483a38df6 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Sun, 6 Sep 2020 19:23:50 +0000 Subject: [PATCH 0802/1293] Translated using Weblate (Swedish) Currently translated at 100.0% (785 of 785 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 9b9a52dacf..eb131ef543 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,15 +6,15 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-08-30 14:38-0400\n" -"PO-Revision-Date: 2020-08-30 20:02+0000\n" -"Last-Translator: Jeff Epler \n" +"PO-Revision-Date: 2020-09-07 19:36+0000\n" +"Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\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.2.1-dev\n" +"X-Generator: Weblate 4.3-dev\n" #: main.c msgid "" @@ -500,7 +500,7 @@ msgstr "Kan inte ställa in CCCD på lokal karaktäristik" #: shared-bindings/_bleio/Adapter.c msgid "Cannot create a new Adapter; use _bleio.adapter;" -msgstr "" +msgstr "Det går inte att skapa en ny Adapter; använd _bleio.adapter;" #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c @@ -774,7 +774,7 @@ msgstr "Förväntade en karaktäristik" #: shared-bindings/_bleio/Adapter.c msgid "Expected a DigitalInOut" -msgstr "" +msgstr "Förväntar en DigitalInOut" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" @@ -782,7 +782,7 @@ msgstr "Förväntade en tjänst" #: shared-bindings/_bleio/Adapter.c msgid "Expected a UART" -msgstr "" +msgstr "Förväntar en UART" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c @@ -1274,7 +1274,7 @@ msgstr "Kör inte sparad kod.\n" #: shared-bindings/_bleio/__init__.c msgid "Not settable" -msgstr "" +msgstr "Går inte sätta" #: shared-bindings/util.c msgid "" @@ -1379,6 +1379,8 @@ msgid "" "Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " "instead" msgstr "" +"Porten accepterar inte pinne eller frekvens. Skapa och skicka en PWMOut " +"Carrier istället" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" @@ -2518,7 +2520,7 @@ msgstr "initialvärden måste vara iterable" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "initial_value length is wrong" -msgstr "" +msgstr "initial_value-längd är fel" #: py/compile.c msgid "inline assembler must be a function" @@ -2717,7 +2719,7 @@ msgstr "max_length måste vara 0-%d när fixed_length är %s" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "max_length must be > 0" -msgstr "" +msgstr "max_length måste vara > 0" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -2955,11 +2957,11 @@ msgstr "ord() förväntade sig ett tecken, men en sträng med längden %d hittad #: shared-bindings/displayio/Bitmap.c msgid "out of range of source" -msgstr "" +msgstr "utanför räckvidd för source" #: shared-bindings/displayio/Bitmap.c msgid "out of range of target" -msgstr "" +msgstr "utanför räckvidd för target" #: py/objint_mpz.c msgid "overflow converting long int to machine word" @@ -3143,7 +3145,7 @@ msgstr "sosfilt kräver iterable argument" #: shared-bindings/displayio/Bitmap.c msgid "source palette too large" -msgstr "" +msgstr "källpalett för stor" #: py/objstr.c msgid "start/end indices" From c68723db3c299f9f77af79b4eda7ee1083004392 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Tue, 8 Sep 2020 15:13:48 +0530 Subject: [PATCH 0803/1293] Update Processor.c --- ports/esp32s2/common-hal/microcontroller/Processor.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ports/esp32s2/common-hal/microcontroller/Processor.c b/ports/esp32s2/common-hal/microcontroller/Processor.c index 39b85a18b8..0df3e9e92c 100644 --- a/ports/esp32s2/common-hal/microcontroller/Processor.c +++ b/ports/esp32s2/common-hal/microcontroller/Processor.c @@ -34,8 +34,15 @@ #include "soc/efuse_reg.h" +#include "esp-idf/components/driver/esp32s2/include/driver/temp_sensor.h" + float common_hal_mcu_processor_get_temperature(void) { - return NAN; + float tsens_out; + temp_sensor_config_t temp_sensor = TSENS_CONFIG_DEFAULT(); // DEFAULT: range:-10℃ ~ 80℃, error < 1℃. + temp_sensor_set_config(temp_sensor); + temp_sensor_start(); + temp_sensor_read_celsius(&tsens_out); + return tsens_out; } float common_hal_mcu_processor_get_voltage(void) { From 14af8e4b42df4c0ea84d1fe6f4998342aa5f3c71 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Tue, 8 Sep 2020 21:07:00 +0530 Subject: [PATCH 0804/1293] Added temp_sensor_stop Co-authored-by: hierophect --- ports/esp32s2/common-hal/microcontroller/Processor.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/esp32s2/common-hal/microcontroller/Processor.c b/ports/esp32s2/common-hal/microcontroller/Processor.c index 0df3e9e92c..c64fa010e6 100644 --- a/ports/esp32s2/common-hal/microcontroller/Processor.c +++ b/ports/esp32s2/common-hal/microcontroller/Processor.c @@ -42,6 +42,7 @@ float common_hal_mcu_processor_get_temperature(void) { temp_sensor_set_config(temp_sensor); temp_sensor_start(); temp_sensor_read_celsius(&tsens_out); + temp_sensor_stop(); return tsens_out; } From e066448e369d33f655b4454562a9711e1cbdb2ff Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Sep 2020 10:43:24 -0500 Subject: [PATCH 0805/1293] atmel-samd: add same51, feather_m4_can This is compile-tested, and requires updates in the related submodules: https://github.com/adafruit/samd-peripherals/pull/35 https://github.com/adafruit/asf4/pull/37 This should not be merged until those can also be merged. --- ports/atmel-samd/Makefile | 30 +- ports/atmel-samd/asf4 | 2 +- .../asf4_conf/same51/hpl_adc_config.h | 303 + .../asf4_conf/same51/hpl_dac_config.h | 169 + .../asf4_conf/same51/hpl_dmac_config.h | 7277 +++++++++++++++++ .../asf4_conf/same51/hpl_gclk_config.h | 924 +++ .../asf4_conf/same51/hpl_mclk_config.h | 104 + .../asf4_conf/same51/hpl_nvmctrl_config.h | 36 + .../asf4_conf/same51/hpl_osc32kctrl_config.h | 163 + .../asf4_conf/same51/hpl_oscctrl_config.h | 634 ++ .../asf4_conf/same51/hpl_rtc_config.h | 145 + .../asf4_conf/same51/hpl_sdhc_config.h | 24 + .../asf4_conf/same51/hpl_sercom_config.h | 751 ++ .../asf4_conf/same51/hpl_systick_config.h | 18 + .../asf4_conf/same51/hpl_tc_config.h | 209 + .../asf4_conf/same51/hpl_trng_config.h | 27 + .../asf4_conf/same51/hpl_usb_config.h | 413 + .../asf4_conf/same51/peripheral_clk_config.h | 1170 +++ .../atmel-samd/asf4_conf/same51/usbd_config.h | 850 ++ .../atmel-samd/boards/feather_m4_can/board.c | 38 + .../boards/feather_m4_can/mpconfigboard.h | 35 + .../boards/feather_m4_can/mpconfigboard.mk | 14 + ports/atmel-samd/boards/feather_m4_can/pins.c | 61 + .../common-hal/neopixel_write/__init__.c | 3 + ports/atmel-samd/peripherals | 2 +- ports/atmel-samd/supervisor/internal_flash.c | 3 + ports/atmel-samd/supervisor/port.c | 3 + ports/atmel-samd/supervisor/same51_cpu.s | 27 + 28 files changed, 13432 insertions(+), 3 deletions(-) create mode 100644 ports/atmel-samd/asf4_conf/same51/hpl_adc_config.h create mode 100644 ports/atmel-samd/asf4_conf/same51/hpl_dac_config.h create mode 100644 ports/atmel-samd/asf4_conf/same51/hpl_dmac_config.h create mode 100644 ports/atmel-samd/asf4_conf/same51/hpl_gclk_config.h create mode 100644 ports/atmel-samd/asf4_conf/same51/hpl_mclk_config.h create mode 100644 ports/atmel-samd/asf4_conf/same51/hpl_nvmctrl_config.h create mode 100644 ports/atmel-samd/asf4_conf/same51/hpl_osc32kctrl_config.h create mode 100644 ports/atmel-samd/asf4_conf/same51/hpl_oscctrl_config.h create mode 100644 ports/atmel-samd/asf4_conf/same51/hpl_rtc_config.h create mode 100644 ports/atmel-samd/asf4_conf/same51/hpl_sdhc_config.h create mode 100644 ports/atmel-samd/asf4_conf/same51/hpl_sercom_config.h create mode 100644 ports/atmel-samd/asf4_conf/same51/hpl_systick_config.h create mode 100644 ports/atmel-samd/asf4_conf/same51/hpl_tc_config.h create mode 100644 ports/atmel-samd/asf4_conf/same51/hpl_trng_config.h create mode 100644 ports/atmel-samd/asf4_conf/same51/hpl_usb_config.h create mode 100644 ports/atmel-samd/asf4_conf/same51/peripheral_clk_config.h create mode 100644 ports/atmel-samd/asf4_conf/same51/usbd_config.h create mode 100644 ports/atmel-samd/boards/feather_m4_can/board.c create mode 100644 ports/atmel-samd/boards/feather_m4_can/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/feather_m4_can/pins.c create mode 100755 ports/atmel-samd/supervisor/same51_cpu.s diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 489f3a7afb..79573b62ef 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -99,6 +99,13 @@ OPTIMIZATION_FLAGS ?= -O2 CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD51 -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 +ifeq ($(CHIP_FAMILY), same51) +PERIPHERALS_CHIP_FAMILY=sam_d5x_e5x +OPTIMIZATION_FLAGS ?= -O2 +# 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 + ifeq ($(CHIP_FAMILY), same54) PERIPHERALS_CHIP_FAMILY=sam_d5x_e5x OPTIMIZATION_FLAGS ?= -O2 @@ -177,6 +184,15 @@ CFLAGS += \ -mfpu=fpv4-sp-d16 \ -DSAM_D5X_E5X -DSAME54 endif +ifeq ($(CHIP_FAMILY), same51) +CFLAGS += \ + -mthumb \ + -mabi=aapcs-linux \ + -mcpu=cortex-m4 \ + -mfloat-abi=hard \ + -mfpu=fpv4-sp-d16 \ + -DSAM_D5X_E5X -DSAME51 +endif @@ -197,6 +213,9 @@ BOOTLOADER_SIZE := 0x4000 else ifeq ($(CHIP_FAMILY), same54) LDFLAGS += -mthumb -mcpu=cortex-m4 BOOTLOADER_SIZE := 0x4000 +else ifeq ($(CHIP_FAMILY), same51) +LDFLAGS += -mthumb -mcpu=cortex-m4 +BOOTLOADER_SIZE := 0x4000 endif SRC_ASF := \ @@ -241,7 +260,16 @@ SRC_ASF += \ else ifeq ($(CHIP_FAMILY), same54) SRC_ASF += \ - hal/src/hal_rand_sync.c \ + hal/src/hal_rand_sync.c \ + hpl/core/hpl_core_m4.c \ + hpl/mclk/hpl_mclk.c \ + hpl/osc32kctrl/hpl_osc32kctrl.c \ + hpl/oscctrl/hpl_oscctrl.c \ + hpl/trng/hpl_trng.c \ + +else ifeq ($(CHIP_FAMILY), same51) +SRC_ASF += \ + hal/src/hal_rand_sync.c \ hpl/core/hpl_core_m4.c \ hpl/mclk/hpl_mclk.c \ hpl/osc32kctrl/hpl_osc32kctrl.c \ diff --git a/ports/atmel-samd/asf4 b/ports/atmel-samd/asf4 index 35a1525796..f99e36fb00 160000 --- a/ports/atmel-samd/asf4 +++ b/ports/atmel-samd/asf4 @@ -1 +1 @@ -Subproject commit 35a1525796c7ef8a3893d90befdad2f267fca20e +Subproject commit f99e36fb008588bd9ff005099b3b89b7952fcfba diff --git a/ports/atmel-samd/asf4_conf/same51/hpl_adc_config.h b/ports/atmel-samd/asf4_conf/same51/hpl_adc_config.h new file mode 100644 index 0000000000..13d8151028 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same51/hpl_adc_config.h @@ -0,0 +1,303 @@ +/* Auto-generated config file hpl_adc_config.h */ +#ifndef HPL_ADC_CONFIG_H +#define HPL_ADC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +#ifndef CONF_ADC_0_ENABLE +#define CONF_ADC_0_ENABLE 1 +#endif + +// Basic Configuration + +// Conversion Result Resolution +// <0x0=>12-bit +// <0x1=>16-bit (averaging must be enabled) +// <0x2=>10-bit +// <0x3=>8-bit +// Defines the bit resolution for the ADC sample values (RESSEL) +// adc_resolution +#ifndef CONF_ADC_0_RESSEL +#define CONF_ADC_0_RESSEL 0x0 +#endif + +// Reference Selection +// <0x0=>Internal bandgap reference +// <0x2=>1/2 VDDANA (only for VDDANA > 2.0V) +// <0x3=>VDDANA +// <0x4=>External reference A +// <0x5=>External reference B +// <0x6=>External reference C +// Select the reference for the ADC (REFSEL) +// adc_reference +#ifndef CONF_ADC_0_REFSEL +#define CONF_ADC_0_REFSEL 0x0 +#endif + +// Prescaler configuration +// <0x0=>Peripheral clock divided by 2 +// <0x1=>Peripheral clock divided by 4 +// <0x2=>Peripheral clock divided by 8 +// <0x3=>Peripheral clock divided by 16 +// <0x4=>Peripheral clock divided by 32 +// <0x5=>Peripheral clock divided by 64 +// <0x6=>Peripheral clock divided by 128 +// <0x7=>Peripheral clock divided by 256 +// These bits define the ADC clock relative to the peripheral clock (PRESCALER) +// adc_prescaler +#ifndef CONF_ADC_0_PRESCALER +#define CONF_ADC_0_PRESCALER 0x3 +#endif + +// Free Running Mode +// When enabled, the ADC is in free running mode and a new conversion will be initiated when a previous conversion completes. (FREERUN) +// adc_freerunning_mode +#ifndef CONF_ADC_0_FREERUN +#define CONF_ADC_0_FREERUN 0 +#endif + +// Differential Mode +// In differential mode, the voltage difference between the MUXPOS and MUXNEG inputs will be converted by the ADC. (DIFFMODE) +// adc_differential_mode +#ifndef CONF_ADC_0_DIFFMODE +#define CONF_ADC_0_DIFFMODE 0 +#endif + +// Positive Mux Input Selection +// <0x00=>ADC AIN0 pin +// <0x01=>ADC AIN1 pin +// <0x02=>ADC AIN2 pin +// <0x03=>ADC AIN3 pin +// <0x04=>ADC AIN4 pin +// <0x05=>ADC AIN5 pin +// <0x06=>ADC AIN6 pin +// <0x07=>ADC AIN7 pin +// <0x08=>ADC AIN8 pin +// <0x09=>ADC AIN9 pin +// <0x0A=>ADC AIN10 pin +// <0x0B=>ADC AIN11 pin +// <0x0C=>ADC AIN12 pin +// <0x0D=>ADC AIN13 pin +// <0x0E=>ADC AIN14 pin +// <0x0F=>ADC AIN15 pin +// <0x18=>1/4 scaled core supply +// <0x19=>1/4 Scaled VBAT Supply +// <0x1A=>1/4 scaled I/O supply +// <0x1B=>Bandgap voltage +// <0x1C=>Temperature reference (PTAT) +// <0x1D=>Temperature reference (CTAT) +// <0x1E=>DAC Output +// These bits define the Mux selection for the positive ADC input. (MUXPOS) +// adc_pinmux_positive +#ifndef CONF_ADC_0_MUXPOS +#define CONF_ADC_0_MUXPOS 0x0 +#endif + +// Negative Mux Input Selection +// <0x00=>ADC AIN0 pin +// <0x01=>ADC AIN1 pin +// <0x02=>ADC AIN2 pin +// <0x03=>ADC AIN3 pin +// <0x04=>ADC AIN4 pin +// <0x05=>ADC AIN5 pin +// <0x06=>ADC AIN6 pin +// <0x07=>ADC AIN7 pin +// <0x18=>Internal ground +// <0x19=>I/O ground +// These bits define the Mux selection for the negative ADC input. (MUXNEG) +// adc_pinmux_negative +#ifndef CONF_ADC_0_MUXNEG +#define CONF_ADC_0_MUXNEG 0x0 +#endif + +// + +// Advanced Configuration +// adc_advanced_settings +#ifndef CONF_ADC_0_ADVANCED +#define CONF_ADC_0_ADVANCED 0 +#endif + +// Run in standby +// Indicates whether the ADC will continue running in standby sleep mode or not (RUNSTDBY) +// adc_arch_runstdby +#ifndef CONF_ADC_0_RUNSTDBY +#define CONF_ADC_0_RUNSTDBY 0 +#endif + +// Debug Run +// If enabled, the ADC is running if the CPU is halted by an external debugger. (DBGRUN) +// adc_arch_dbgrun +#ifndef CONF_ADC_0_DBGRUN +#define CONF_ADC_0_DBGRUN 0 +#endif + +// On Demand Control +// Will keep the ADC peripheral running if requested by other peripherals (ONDEMAND) +// adc_arch_ondemand +#ifndef CONF_ADC_0_ONDEMAND +#define CONF_ADC_0_ONDEMAND 0 +#endif + +// Left-Adjusted Result +// When enabled, the ADC conversion result is left-adjusted in the RESULT register. The high byte of the 12-bit result will be present in the upper part of the result register. (LEFTADJ) +// adc_arch_leftadj +#ifndef CONF_ADC_0_LEFTADJ +#define CONF_ADC_0_LEFTADJ 0 +#endif + +// Reference Buffer Offset Compensation Enable +// The accuracy of the gain stage can be increased by enabling the reference buffer offset compensation. This will decrease the input impedance and thus increase the start-up time of the reference. (REFCOMP) +// adc_arch_refcomp +#ifndef CONF_ADC_0_REFCOMP +#define CONF_ADC_0_REFCOMP 0 +#endif + +// Comparator Offset Compensation Enable +// This bit indicates whether the Comparator Offset Compensation is enabled or not (OFFCOMP) +// adc_arch_offcomp +#ifndef CONF_ADC_0_OFFCOMP +#define CONF_ADC_0_OFFCOMP 0 +#endif + +// Digital Correction Logic Enabled +// When enabled, the ADC conversion result in the RESULT register is then corrected for gain and offset based on the values in the GAINCAL and OFFSETCAL registers. (CORREN) +// adc_arch_corren +#ifndef CONF_ADC_0_CORREN +#define CONF_ADC_0_CORREN 0 +#endif + +// Offset Correction Value <0-4095> +// If the digital correction logic is enabled (CTRLB.CORREN = 1), these bits define how the ADC conversion result is compensated for offset error before being written to the Result register. (OFFSETCORR) +// adc_arch_offsetcorr +#ifndef CONF_ADC_0_OFFSETCORR +#define CONF_ADC_0_OFFSETCORR 0 +#endif + +// Gain Correction Value <0-4095> +// If the digital correction logic is enabled (CTRLB.CORREN = 1), these bits define how the ADC conversion result is compensated for gain error before being written to the result register. (GAINCORR) +// adc_arch_gaincorr +#ifndef CONF_ADC_0_GAINCORR +#define CONF_ADC_0_GAINCORR 0 +#endif + +// Adjusting Result / Division Coefficient <0-7> +// These bits define the division coefficient in 2n steps. (ADJRES) +// adc_arch_adjres +#ifndef CONF_ADC_0_ADJRES +#define CONF_ADC_0_ADJRES 0x0 +#endif + +// Number of Samples to be Collected +// <0x0=>1 sample +// <0x1=>2 samples +// <0x2=>4 samples +// <0x3=>8 samples +// <0x4=>16 samples +// <0x5=>32 samples +// <0x6=>64 samples +// <0x7=>128 samples +// <0x8=>256 samples +// <0x9=>512 samples +// <0xA=>1024 samples +// Define how many samples should be added together.The result will be available in the Result register (SAMPLENUM) +// adc_arch_samplenum +#ifndef CONF_ADC_0_SAMPLENUM +#define CONF_ADC_0_SAMPLENUM 0x0 +#endif + +// Sampling Time Length <0-63> +// These bits control the ADC sampling time in number of half CLK_ADC cycles, depending of the prescaler value, thus controlling the ADC input impedance. (SAMPLEN) +// adc_arch_samplen +#ifndef CONF_ADC_0_SAMPLEN +#define CONF_ADC_0_SAMPLEN 0 +#endif + +// Window Monitor Mode +// <0x0=>No window mode +// <0x1=>Mode 1: RESULT above lower threshold +// <0x2=>Mode 2: RESULT beneath upper threshold +// <0x3=>Mode 3: RESULT inside lower and upper threshold +// <0x4=>Mode 4: RESULT outside lower and upper threshold +// These bits enable and define the window monitor mode. (WINMODE) +// adc_arch_winmode +#ifndef CONF_ADC_0_WINMODE +#define CONF_ADC_0_WINMODE 0x0 +#endif + +// Window Monitor Lower Threshold <0-65535> +// If the window monitor is enabled, these bits define the lower threshold value. (WINLT) +// adc_arch_winlt +#ifndef CONF_ADC_0_WINLT +#define CONF_ADC_0_WINLT 0 +#endif + +// Window Monitor Upper Threshold <0-65535> +// If the window monitor is enabled, these bits define the lower threshold value. (WINUT) +// adc_arch_winut +#ifndef CONF_ADC_0_WINUT +#define CONF_ADC_0_WINUT 0 +#endif + +// Bitmask for positive input sequence <0-4294967295> +// Use this parameter to input the bitmask for positive input sequence control (refer to datasheet for the device). +// adc_arch_seqen +#ifndef CONF_ADC_0_SEQEN +#define CONF_ADC_0_SEQEN 0x0 +#endif + +// + +// Event Control +// adc_arch_event_settings +#ifndef CONF_ADC_0_EVENT_CONTROL +#define CONF_ADC_0_EVENT_CONTROL 0 +#endif + +// Window Monitor Event Out +// Enables event output on window event (WINMONEO) +// adc_arch_winmoneo +#ifndef CONF_ADC_0_WINMONEO +#define CONF_ADC_0_WINMONEO 0 +#endif + +// Result Ready Event Out +// Enables event output on result ready event (RESRDEO) +// adc_arch_resrdyeo +#ifndef CONF_ADC_0_RESRDYEO +#define CONF_ADC_0_RESRDYEO 0 +#endif + +// Invert flush Event Signal +// Invert the flush event input signal (FLUSHINV) +// adc_arch_flushinv +#ifndef CONF_ADC_0_FLUSHINV +#define CONF_ADC_0_FLUSHINV 0 +#endif + +// Trigger Flush On Event +// Trigger an ADC pipeline flush on event (FLUSHEI) +// adc_arch_flushei +#ifndef CONF_ADC_0_FLUSHEI +#define CONF_ADC_0_FLUSHEI 0 +#endif + +// Invert Start Conversion Event Signal +// Invert the start conversion event input signal (STARTINV) +// adc_arch_startinv +#ifndef CONF_ADC_0_STARTINV +#define CONF_ADC_0_STARTINV 0 +#endif + +// Trigger Conversion On Event +// Trigger a conversion on event. (STARTEI) +// adc_arch_startei +#ifndef CONF_ADC_0_STARTEI +#define CONF_ADC_0_STARTEI 0 +#endif + +// + +// <<< end of configuration section >>> + +#endif // HPL_ADC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same51/hpl_dac_config.h b/ports/atmel-samd/asf4_conf/same51/hpl_dac_config.h new file mode 100644 index 0000000000..c46f99b7db --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same51/hpl_dac_config.h @@ -0,0 +1,169 @@ +/* Auto-generated config file hpl_dac_config.h */ +#ifndef HPL_DAC_CONFIG_H +#define HPL_DAC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Basic configuration +// Reference Selection +// <0x00=> Unbuffered external voltage reference +// <0x01=> Voltage supply +// <0x02=> Buffered external voltage reference +// <0x03=> Internal bandgap reference +// dac_arch_refsel +#ifndef CONF_DAC_REFSEL +#define CONF_DAC_REFSEL 0 +#endif + +// Differential mode +// Indicates whether the differential mode is enabled or not +// dac_arch_diff +#ifndef CONF_DAC_DIFF +#define CONF_DAC_DIFF 0 +#endif +// + +// Advanced Configuration +// dac_advanced_settings +#ifndef CONF_DAC_ADVANCED_CONFIG +#define CONF_DAC_ADVANCED_CONFIG 0 +#endif + +// Debug Run +// Indicate whether running when CPU is halted +// adc_arch_dbgrun +#ifndef CONF_DAC_DBGRUN +#define CONF_DAC_DBGRUN 1 +#endif + +// Channel 0 configuration +// Left Adjusted Data +// Indicate how the data is adjusted in the Data and Data Buffer register +// dac0_arch_leftadj +#ifndef CONF_DAC0_LEFTADJ +#define CONF_DAC0_LEFTADJ 1 +#endif + +// Current control +// <0=> GCLK_DAC <= 1.2MHz (100kSPS) +// <1=> 1.2MHz < GCLK_DAC <= 6MHz (500kSPS) +// <2=> 6MHz < GCLK_DAC <= 12MHz (1MSPS) +// This defines the current in output buffer according to conversion rate +// dac0_arch_cctrl +#ifndef CONF_DAC0_CCTRL +#define CONF_DAC0_CCTRL 0 +#endif + +// Run in standby +// Indicates whether the DAC channel will continue running in standby sleep mode or not +// dac0_arch_runstdby +#ifndef CONF_DAC0_RUNSTDBY +#define CONF_DAC0_RUNSTDBY 0 +#endif + +// Dithering Mode +// Indicate whether dithering mode is enabled +// dac0_arch_ditrher +#ifndef CONF_DAC0_DITHER +#define CONF_DAC0_DITHER 0 +#endif + +// Refresh period <0x00-0xFF> +// This defines the refresh period. If it is 0, the refresh mode is disabled, else the refresh period is: value * 500us +// dac0_arch_refresh +#ifndef CONF_DAC0_REFRESH +#define CONF_DAC0_REFRESH 2 +#endif +// +// Channel 1 configuration +// Left Adjusted Data +// Indicate how the data is adjusted in the Data and Data Buffer register +// dac1_arch_leftadj +#ifndef CONF_DAC1_LEFTADJ +#define CONF_DAC1_LEFTADJ 1 +#endif + +// Current control +// <0=> GCLK_DAC <= 1.2MHz (100kSPS) +// <1=> 1.2MHz < GCLK_DAC <= 6MHz (500kSPS) +// <2=> 6MHz < GCLK_DAC <= 12MHz (1MSPS) +// This defines the current in output buffer according to conversion rate +// dac1_arch_cctrl +#ifndef CONF_DAC1_CCTRL +#define CONF_DAC1_CCTRL 0 +#endif + +// Run in standby +// Indicates whether the DAC channel will continue running in standby sleep mode or not +// dac1_arch_runstdby +#ifndef CONF_DAC1_RUNSTDBY +#define CONF_DAC1_RUNSTDBY 0 +#endif + +// Dithering Mode +// Indicate whether dithering mode is enabled +// dac1_arch_ditrher +#ifndef CONF_DAC1_DITHER +#define CONF_DAC1_DITHER 0 +#endif + +// Refresh period <0x00-0xFF> +// This defines the refresh period. If it is 0, the refresh mode is disabled, else the refresh period is: value * 500us +// dac1_arch_refresh +#ifndef CONF_DAC1_REFRESH +#define CONF_DAC1_REFRESH 2 +#endif +// + +// Event configuration +// Inversion of DAC 0 event +// <0=> Detection on rising edge pf the input event +// <1=> Detection on falling edge pf the input event +// This defines the edge detection of the input event +// dac_arch_invei0 +#ifndef CONF_DAC_INVEI0 +#define CONF_DAC_INVEI0 0 +#endif + +// Data Buffer of DAC 0 Empty Event Output +// Indicate whether Data Buffer Empty Event is enabled and generated when the Data Buffer register is empty or not +// dac_arch_emptyeo_0 +#ifndef CONF_DAC_EMPTYEO0 +#define CONF_DAC_EMPTYEO0 0 +#endif + +// Start Conversion Event Input DAC 0 +// Indicate whether Start input event is enabled +// dac_arch_startei_0 +#ifndef CONF_DAC_STARTEI0 +#define CONF_DAC_STARTEI0 0 +#endif +// Inversion of DAC 1 event +// <0=> Detection on rising edge pf the input event +// <1=> Detection on falling edge pf the input event +// This defines the edge detection of the input event +// dac_arch_invei1 +#ifndef CONF_DAC_INVEI1 +#define CONF_DAC_INVEI1 0 +#endif + +// Data Buffer of DAC 1 Empty Event Output +// Indicate whether Data Buffer Empty Event is enabled and generated when the Data Buffer register is empty or not +// dac_arch_emptyeo_1 +#ifndef CONF_DAC_EMPTYEO1 +#define CONF_DAC_EMPTYEO1 0 +#endif + +// Start Conversion Event Input DAC 1 +// Indicate whether Start input event is enabled +// dac_arch_startei_1 +#ifndef CONF_DAC_STARTEI1 +#define CONF_DAC_STARTEI1 0 +#endif + +// +// + +// <<< end of configuration section >>> + +#endif // HPL_DAC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same51/hpl_dmac_config.h b/ports/atmel-samd/asf4_conf/same51/hpl_dmac_config.h new file mode 100644 index 0000000000..90499fc27f --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same51/hpl_dmac_config.h @@ -0,0 +1,7277 @@ +/* Auto-generated config file hpl_dmac_config.h */ +#ifndef HPL_DMAC_CONFIG_H +#define HPL_DMAC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// DMAC enable +// Indicates whether dmac is enabled or not +// dmac_enable +#ifndef CONF_DMAC_ENABLE +#define CONF_DMAC_ENABLE 0 +#endif + +// Priority Level 0 +// Indicates whether Priority Level 0 is enabled or not +// dmac_lvlen0 +#ifndef CONF_DMAC_LVLEN0 +#define CONF_DMAC_LVLEN0 1 +#endif + +// Level 0 Round-Robin Arbitration +// <0=> Static arbitration scheme for channel with priority 0 +// <1=> Round-robin arbitration scheme for channel with priority 0 +// Defines Level 0 Arbitration for DMA channels +// dmac_rrlvlen0 +#ifndef CONF_DMAC_RRLVLEN0 +#define CONF_DMAC_RRLVLEN0 0 +#endif + +// Level 0 Channel Priority Number <0x00-0xFF> +// dmac_lvlpri0 +#ifndef CONF_DMAC_LVLPRI0 +#define CONF_DMAC_LVLPRI0 0 +#endif +// Priority Level 1 +// Indicates whether Priority Level 1 is enabled or not +// dmac_lvlen1 +#ifndef CONF_DMAC_LVLEN1 +#define CONF_DMAC_LVLEN1 1 +#endif + +// Level 1 Round-Robin Arbitration +// <0=> Static arbitration scheme for channel with priority 1 +// <1=> Round-robin arbitration scheme for channel with priority 1 +// Defines Level 1 Arbitration for DMA channels +// dmac_rrlvlen1 +#ifndef CONF_DMAC_RRLVLEN1 +#define CONF_DMAC_RRLVLEN1 0 +#endif + +// Level 1 Channel Priority Number <0x00-0xFF> +// dmac_lvlpri1 +#ifndef CONF_DMAC_LVLPRI1 +#define CONF_DMAC_LVLPRI1 0 +#endif +// Priority Level 2 +// Indicates whether Priority Level 2 is enabled or not +// dmac_lvlen2 +#ifndef CONF_DMAC_LVLEN2 +#define CONF_DMAC_LVLEN2 1 +#endif + +// Level 2 Round-Robin Arbitration +// <0=> Static arbitration scheme for channel with priority 2 +// <1=> Round-robin arbitration scheme for channel with priority 2 +// Defines Level 2 Arbitration for DMA channels +// dmac_rrlvlen2 +#ifndef CONF_DMAC_RRLVLEN2 +#define CONF_DMAC_RRLVLEN2 0 +#endif + +// Level 2 Channel Priority Number <0x00-0xFF> +// dmac_lvlpri2 +#ifndef CONF_DMAC_LVLPRI2 +#define CONF_DMAC_LVLPRI2 0 +#endif +// Priority Level 3 +// Indicates whether Priority Level 3 is enabled or not +// dmac_lvlen3 +#ifndef CONF_DMAC_LVLEN3 +#define CONF_DMAC_LVLEN3 1 +#endif + +// Level 3 Round-Robin Arbitration +// <0=> Static arbitration scheme for channel with priority 3 +// <1=> Round-robin arbitration scheme for channel with priority 3 +// Defines Level 3 Arbitration for DMA channels +// dmac_rrlvlen3 +#ifndef CONF_DMAC_RRLVLEN3 +#define CONF_DMAC_RRLVLEN3 0 +#endif + +// Level 3 Channel Priority Number <0x00-0xFF> +// dmac_lvlpri3 +#ifndef CONF_DMAC_LVLPRI3 +#define CONF_DMAC_LVLPRI3 0 +#endif +// Debug Run +// Indicates whether Debug Run is enabled or not +// dmac_dbgrun +#ifndef CONF_DMAC_DBGRUN +#define CONF_DMAC_DBGRUN 0 +#endif + +// Channel 0 settings +// dmac_channel_0_settings +#ifndef CONF_DMAC_CHANNEL_0_SETTINGS +#define CONF_DMAC_CHANNEL_0_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 0 is running in standby mode or not +// dmac_runstdby_0 +#ifndef CONF_DMAC_RUNSTDBY_0 +#define CONF_DMAC_RUNSTDBY_0 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_0 +#ifndef CONF_DMAC_TRIGACT_0 +#define CONF_DMAC_TRIGACT_0 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_0 +#ifndef CONF_DMAC_TRIGSRC_0 +#define CONF_DMAC_TRIGSRC_0 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_0 +#ifndef CONF_DMAC_LVL_0 +#define CONF_DMAC_LVL_0 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_0 +#ifndef CONF_DMAC_EVOE_0 +#define CONF_DMAC_EVOE_0 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_0 +#ifndef CONF_DMAC_EVIE_0 +#define CONF_DMAC_EVIE_0 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_0 +#ifndef CONF_DMAC_EVACT_0 +#define CONF_DMAC_EVACT_0 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_0 +#ifndef CONF_DMAC_STEPSIZE_0 +#define CONF_DMAC_STEPSIZE_0 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_0 +#ifndef CONF_DMAC_STEPSEL_0 +#define CONF_DMAC_STEPSEL_0 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_0 +#ifndef CONF_DMAC_SRCINC_0 +#define CONF_DMAC_SRCINC_0 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_0 +#ifndef CONF_DMAC_DSTINC_0 +#define CONF_DMAC_DSTINC_0 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_0 +#ifndef CONF_DMAC_BEATSIZE_0 +#define CONF_DMAC_BEATSIZE_0 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_0 +#ifndef CONF_DMAC_BLOCKACT_0 +#define CONF_DMAC_BLOCKACT_0 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_0 +#ifndef CONF_DMAC_EVOSEL_0 +#define CONF_DMAC_EVOSEL_0 0 +#endif +// + +// Channel 1 settings +// dmac_channel_1_settings +#ifndef CONF_DMAC_CHANNEL_1_SETTINGS +#define CONF_DMAC_CHANNEL_1_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 1 is running in standby mode or not +// dmac_runstdby_1 +#ifndef CONF_DMAC_RUNSTDBY_1 +#define CONF_DMAC_RUNSTDBY_1 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_1 +#ifndef CONF_DMAC_TRIGACT_1 +#define CONF_DMAC_TRIGACT_1 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_1 +#ifndef CONF_DMAC_TRIGSRC_1 +#define CONF_DMAC_TRIGSRC_1 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_1 +#ifndef CONF_DMAC_LVL_1 +#define CONF_DMAC_LVL_1 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_1 +#ifndef CONF_DMAC_EVOE_1 +#define CONF_DMAC_EVOE_1 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_1 +#ifndef CONF_DMAC_EVIE_1 +#define CONF_DMAC_EVIE_1 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_1 +#ifndef CONF_DMAC_EVACT_1 +#define CONF_DMAC_EVACT_1 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_1 +#ifndef CONF_DMAC_STEPSIZE_1 +#define CONF_DMAC_STEPSIZE_1 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_1 +#ifndef CONF_DMAC_STEPSEL_1 +#define CONF_DMAC_STEPSEL_1 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_1 +#ifndef CONF_DMAC_SRCINC_1 +#define CONF_DMAC_SRCINC_1 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_1 +#ifndef CONF_DMAC_DSTINC_1 +#define CONF_DMAC_DSTINC_1 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_1 +#ifndef CONF_DMAC_BEATSIZE_1 +#define CONF_DMAC_BEATSIZE_1 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_1 +#ifndef CONF_DMAC_BLOCKACT_1 +#define CONF_DMAC_BLOCKACT_1 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_1 +#ifndef CONF_DMAC_EVOSEL_1 +#define CONF_DMAC_EVOSEL_1 0 +#endif +// + +// Channel 2 settings +// dmac_channel_2_settings +#ifndef CONF_DMAC_CHANNEL_2_SETTINGS +#define CONF_DMAC_CHANNEL_2_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 2 is running in standby mode or not +// dmac_runstdby_2 +#ifndef CONF_DMAC_RUNSTDBY_2 +#define CONF_DMAC_RUNSTDBY_2 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_2 +#ifndef CONF_DMAC_TRIGACT_2 +#define CONF_DMAC_TRIGACT_2 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_2 +#ifndef CONF_DMAC_TRIGSRC_2 +#define CONF_DMAC_TRIGSRC_2 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_2 +#ifndef CONF_DMAC_LVL_2 +#define CONF_DMAC_LVL_2 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_2 +#ifndef CONF_DMAC_EVOE_2 +#define CONF_DMAC_EVOE_2 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_2 +#ifndef CONF_DMAC_EVIE_2 +#define CONF_DMAC_EVIE_2 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_2 +#ifndef CONF_DMAC_EVACT_2 +#define CONF_DMAC_EVACT_2 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_2 +#ifndef CONF_DMAC_STEPSIZE_2 +#define CONF_DMAC_STEPSIZE_2 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_2 +#ifndef CONF_DMAC_STEPSEL_2 +#define CONF_DMAC_STEPSEL_2 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_2 +#ifndef CONF_DMAC_SRCINC_2 +#define CONF_DMAC_SRCINC_2 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_2 +#ifndef CONF_DMAC_DSTINC_2 +#define CONF_DMAC_DSTINC_2 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_2 +#ifndef CONF_DMAC_BEATSIZE_2 +#define CONF_DMAC_BEATSIZE_2 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_2 +#ifndef CONF_DMAC_BLOCKACT_2 +#define CONF_DMAC_BLOCKACT_2 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_2 +#ifndef CONF_DMAC_EVOSEL_2 +#define CONF_DMAC_EVOSEL_2 0 +#endif +// + +// Channel 3 settings +// dmac_channel_3_settings +#ifndef CONF_DMAC_CHANNEL_3_SETTINGS +#define CONF_DMAC_CHANNEL_3_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 3 is running in standby mode or not +// dmac_runstdby_3 +#ifndef CONF_DMAC_RUNSTDBY_3 +#define CONF_DMAC_RUNSTDBY_3 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_3 +#ifndef CONF_DMAC_TRIGACT_3 +#define CONF_DMAC_TRIGACT_3 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_3 +#ifndef CONF_DMAC_TRIGSRC_3 +#define CONF_DMAC_TRIGSRC_3 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_3 +#ifndef CONF_DMAC_LVL_3 +#define CONF_DMAC_LVL_3 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_3 +#ifndef CONF_DMAC_EVOE_3 +#define CONF_DMAC_EVOE_3 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_3 +#ifndef CONF_DMAC_EVIE_3 +#define CONF_DMAC_EVIE_3 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_3 +#ifndef CONF_DMAC_EVACT_3 +#define CONF_DMAC_EVACT_3 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_3 +#ifndef CONF_DMAC_STEPSIZE_3 +#define CONF_DMAC_STEPSIZE_3 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_3 +#ifndef CONF_DMAC_STEPSEL_3 +#define CONF_DMAC_STEPSEL_3 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_3 +#ifndef CONF_DMAC_SRCINC_3 +#define CONF_DMAC_SRCINC_3 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_3 +#ifndef CONF_DMAC_DSTINC_3 +#define CONF_DMAC_DSTINC_3 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_3 +#ifndef CONF_DMAC_BEATSIZE_3 +#define CONF_DMAC_BEATSIZE_3 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_3 +#ifndef CONF_DMAC_BLOCKACT_3 +#define CONF_DMAC_BLOCKACT_3 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_3 +#ifndef CONF_DMAC_EVOSEL_3 +#define CONF_DMAC_EVOSEL_3 0 +#endif +// + +// Channel 4 settings +// dmac_channel_4_settings +#ifndef CONF_DMAC_CHANNEL_4_SETTINGS +#define CONF_DMAC_CHANNEL_4_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 4 is running in standby mode or not +// dmac_runstdby_4 +#ifndef CONF_DMAC_RUNSTDBY_4 +#define CONF_DMAC_RUNSTDBY_4 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_4 +#ifndef CONF_DMAC_TRIGACT_4 +#define CONF_DMAC_TRIGACT_4 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_4 +#ifndef CONF_DMAC_TRIGSRC_4 +#define CONF_DMAC_TRIGSRC_4 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_4 +#ifndef CONF_DMAC_LVL_4 +#define CONF_DMAC_LVL_4 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_4 +#ifndef CONF_DMAC_EVOE_4 +#define CONF_DMAC_EVOE_4 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_4 +#ifndef CONF_DMAC_EVIE_4 +#define CONF_DMAC_EVIE_4 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_4 +#ifndef CONF_DMAC_EVACT_4 +#define CONF_DMAC_EVACT_4 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_4 +#ifndef CONF_DMAC_STEPSIZE_4 +#define CONF_DMAC_STEPSIZE_4 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_4 +#ifndef CONF_DMAC_STEPSEL_4 +#define CONF_DMAC_STEPSEL_4 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_4 +#ifndef CONF_DMAC_SRCINC_4 +#define CONF_DMAC_SRCINC_4 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_4 +#ifndef CONF_DMAC_DSTINC_4 +#define CONF_DMAC_DSTINC_4 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_4 +#ifndef CONF_DMAC_BEATSIZE_4 +#define CONF_DMAC_BEATSIZE_4 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_4 +#ifndef CONF_DMAC_BLOCKACT_4 +#define CONF_DMAC_BLOCKACT_4 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_4 +#ifndef CONF_DMAC_EVOSEL_4 +#define CONF_DMAC_EVOSEL_4 0 +#endif +// + +// Channel 5 settings +// dmac_channel_5_settings +#ifndef CONF_DMAC_CHANNEL_5_SETTINGS +#define CONF_DMAC_CHANNEL_5_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 5 is running in standby mode or not +// dmac_runstdby_5 +#ifndef CONF_DMAC_RUNSTDBY_5 +#define CONF_DMAC_RUNSTDBY_5 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_5 +#ifndef CONF_DMAC_TRIGACT_5 +#define CONF_DMAC_TRIGACT_5 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_5 +#ifndef CONF_DMAC_TRIGSRC_5 +#define CONF_DMAC_TRIGSRC_5 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_5 +#ifndef CONF_DMAC_LVL_5 +#define CONF_DMAC_LVL_5 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_5 +#ifndef CONF_DMAC_EVOE_5 +#define CONF_DMAC_EVOE_5 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_5 +#ifndef CONF_DMAC_EVIE_5 +#define CONF_DMAC_EVIE_5 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_5 +#ifndef CONF_DMAC_EVACT_5 +#define CONF_DMAC_EVACT_5 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_5 +#ifndef CONF_DMAC_STEPSIZE_5 +#define CONF_DMAC_STEPSIZE_5 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_5 +#ifndef CONF_DMAC_STEPSEL_5 +#define CONF_DMAC_STEPSEL_5 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_5 +#ifndef CONF_DMAC_SRCINC_5 +#define CONF_DMAC_SRCINC_5 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_5 +#ifndef CONF_DMAC_DSTINC_5 +#define CONF_DMAC_DSTINC_5 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_5 +#ifndef CONF_DMAC_BEATSIZE_5 +#define CONF_DMAC_BEATSIZE_5 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_5 +#ifndef CONF_DMAC_BLOCKACT_5 +#define CONF_DMAC_BLOCKACT_5 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_5 +#ifndef CONF_DMAC_EVOSEL_5 +#define CONF_DMAC_EVOSEL_5 0 +#endif +// + +// Channel 6 settings +// dmac_channel_6_settings +#ifndef CONF_DMAC_CHANNEL_6_SETTINGS +#define CONF_DMAC_CHANNEL_6_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 6 is running in standby mode or not +// dmac_runstdby_6 +#ifndef CONF_DMAC_RUNSTDBY_6 +#define CONF_DMAC_RUNSTDBY_6 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_6 +#ifndef CONF_DMAC_TRIGACT_6 +#define CONF_DMAC_TRIGACT_6 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_6 +#ifndef CONF_DMAC_TRIGSRC_6 +#define CONF_DMAC_TRIGSRC_6 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_6 +#ifndef CONF_DMAC_LVL_6 +#define CONF_DMAC_LVL_6 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_6 +#ifndef CONF_DMAC_EVOE_6 +#define CONF_DMAC_EVOE_6 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_6 +#ifndef CONF_DMAC_EVIE_6 +#define CONF_DMAC_EVIE_6 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_6 +#ifndef CONF_DMAC_EVACT_6 +#define CONF_DMAC_EVACT_6 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_6 +#ifndef CONF_DMAC_STEPSIZE_6 +#define CONF_DMAC_STEPSIZE_6 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_6 +#ifndef CONF_DMAC_STEPSEL_6 +#define CONF_DMAC_STEPSEL_6 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_6 +#ifndef CONF_DMAC_SRCINC_6 +#define CONF_DMAC_SRCINC_6 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_6 +#ifndef CONF_DMAC_DSTINC_6 +#define CONF_DMAC_DSTINC_6 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_6 +#ifndef CONF_DMAC_BEATSIZE_6 +#define CONF_DMAC_BEATSIZE_6 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_6 +#ifndef CONF_DMAC_BLOCKACT_6 +#define CONF_DMAC_BLOCKACT_6 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_6 +#ifndef CONF_DMAC_EVOSEL_6 +#define CONF_DMAC_EVOSEL_6 0 +#endif +// + +// Channel 7 settings +// dmac_channel_7_settings +#ifndef CONF_DMAC_CHANNEL_7_SETTINGS +#define CONF_DMAC_CHANNEL_7_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 7 is running in standby mode or not +// dmac_runstdby_7 +#ifndef CONF_DMAC_RUNSTDBY_7 +#define CONF_DMAC_RUNSTDBY_7 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_7 +#ifndef CONF_DMAC_TRIGACT_7 +#define CONF_DMAC_TRIGACT_7 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_7 +#ifndef CONF_DMAC_TRIGSRC_7 +#define CONF_DMAC_TRIGSRC_7 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_7 +#ifndef CONF_DMAC_LVL_7 +#define CONF_DMAC_LVL_7 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_7 +#ifndef CONF_DMAC_EVOE_7 +#define CONF_DMAC_EVOE_7 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_7 +#ifndef CONF_DMAC_EVIE_7 +#define CONF_DMAC_EVIE_7 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_7 +#ifndef CONF_DMAC_EVACT_7 +#define CONF_DMAC_EVACT_7 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_7 +#ifndef CONF_DMAC_STEPSIZE_7 +#define CONF_DMAC_STEPSIZE_7 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_7 +#ifndef CONF_DMAC_STEPSEL_7 +#define CONF_DMAC_STEPSEL_7 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_7 +#ifndef CONF_DMAC_SRCINC_7 +#define CONF_DMAC_SRCINC_7 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_7 +#ifndef CONF_DMAC_DSTINC_7 +#define CONF_DMAC_DSTINC_7 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_7 +#ifndef CONF_DMAC_BEATSIZE_7 +#define CONF_DMAC_BEATSIZE_7 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_7 +#ifndef CONF_DMAC_BLOCKACT_7 +#define CONF_DMAC_BLOCKACT_7 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_7 +#ifndef CONF_DMAC_EVOSEL_7 +#define CONF_DMAC_EVOSEL_7 0 +#endif +// + +// Channel 8 settings +// dmac_channel_8_settings +#ifndef CONF_DMAC_CHANNEL_8_SETTINGS +#define CONF_DMAC_CHANNEL_8_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 8 is running in standby mode or not +// dmac_runstdby_8 +#ifndef CONF_DMAC_RUNSTDBY_8 +#define CONF_DMAC_RUNSTDBY_8 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_8 +#ifndef CONF_DMAC_TRIGACT_8 +#define CONF_DMAC_TRIGACT_8 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_8 +#ifndef CONF_DMAC_TRIGSRC_8 +#define CONF_DMAC_TRIGSRC_8 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_8 +#ifndef CONF_DMAC_LVL_8 +#define CONF_DMAC_LVL_8 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_8 +#ifndef CONF_DMAC_EVOE_8 +#define CONF_DMAC_EVOE_8 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_8 +#ifndef CONF_DMAC_EVIE_8 +#define CONF_DMAC_EVIE_8 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_8 +#ifndef CONF_DMAC_EVACT_8 +#define CONF_DMAC_EVACT_8 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_8 +#ifndef CONF_DMAC_STEPSIZE_8 +#define CONF_DMAC_STEPSIZE_8 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_8 +#ifndef CONF_DMAC_STEPSEL_8 +#define CONF_DMAC_STEPSEL_8 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_8 +#ifndef CONF_DMAC_SRCINC_8 +#define CONF_DMAC_SRCINC_8 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_8 +#ifndef CONF_DMAC_DSTINC_8 +#define CONF_DMAC_DSTINC_8 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_8 +#ifndef CONF_DMAC_BEATSIZE_8 +#define CONF_DMAC_BEATSIZE_8 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_8 +#ifndef CONF_DMAC_BLOCKACT_8 +#define CONF_DMAC_BLOCKACT_8 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_8 +#ifndef CONF_DMAC_EVOSEL_8 +#define CONF_DMAC_EVOSEL_8 0 +#endif +// + +// Channel 9 settings +// dmac_channel_9_settings +#ifndef CONF_DMAC_CHANNEL_9_SETTINGS +#define CONF_DMAC_CHANNEL_9_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 9 is running in standby mode or not +// dmac_runstdby_9 +#ifndef CONF_DMAC_RUNSTDBY_9 +#define CONF_DMAC_RUNSTDBY_9 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_9 +#ifndef CONF_DMAC_TRIGACT_9 +#define CONF_DMAC_TRIGACT_9 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_9 +#ifndef CONF_DMAC_TRIGSRC_9 +#define CONF_DMAC_TRIGSRC_9 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_9 +#ifndef CONF_DMAC_LVL_9 +#define CONF_DMAC_LVL_9 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_9 +#ifndef CONF_DMAC_EVOE_9 +#define CONF_DMAC_EVOE_9 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_9 +#ifndef CONF_DMAC_EVIE_9 +#define CONF_DMAC_EVIE_9 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_9 +#ifndef CONF_DMAC_EVACT_9 +#define CONF_DMAC_EVACT_9 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_9 +#ifndef CONF_DMAC_STEPSIZE_9 +#define CONF_DMAC_STEPSIZE_9 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_9 +#ifndef CONF_DMAC_STEPSEL_9 +#define CONF_DMAC_STEPSEL_9 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_9 +#ifndef CONF_DMAC_SRCINC_9 +#define CONF_DMAC_SRCINC_9 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_9 +#ifndef CONF_DMAC_DSTINC_9 +#define CONF_DMAC_DSTINC_9 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_9 +#ifndef CONF_DMAC_BEATSIZE_9 +#define CONF_DMAC_BEATSIZE_9 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_9 +#ifndef CONF_DMAC_BLOCKACT_9 +#define CONF_DMAC_BLOCKACT_9 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_9 +#ifndef CONF_DMAC_EVOSEL_9 +#define CONF_DMAC_EVOSEL_9 0 +#endif +// + +// Channel 10 settings +// dmac_channel_10_settings +#ifndef CONF_DMAC_CHANNEL_10_SETTINGS +#define CONF_DMAC_CHANNEL_10_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 10 is running in standby mode or not +// dmac_runstdby_10 +#ifndef CONF_DMAC_RUNSTDBY_10 +#define CONF_DMAC_RUNSTDBY_10 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_10 +#ifndef CONF_DMAC_TRIGACT_10 +#define CONF_DMAC_TRIGACT_10 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_10 +#ifndef CONF_DMAC_TRIGSRC_10 +#define CONF_DMAC_TRIGSRC_10 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_10 +#ifndef CONF_DMAC_LVL_10 +#define CONF_DMAC_LVL_10 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_10 +#ifndef CONF_DMAC_EVOE_10 +#define CONF_DMAC_EVOE_10 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_10 +#ifndef CONF_DMAC_EVIE_10 +#define CONF_DMAC_EVIE_10 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_10 +#ifndef CONF_DMAC_EVACT_10 +#define CONF_DMAC_EVACT_10 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_10 +#ifndef CONF_DMAC_STEPSIZE_10 +#define CONF_DMAC_STEPSIZE_10 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_10 +#ifndef CONF_DMAC_STEPSEL_10 +#define CONF_DMAC_STEPSEL_10 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_10 +#ifndef CONF_DMAC_SRCINC_10 +#define CONF_DMAC_SRCINC_10 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_10 +#ifndef CONF_DMAC_DSTINC_10 +#define CONF_DMAC_DSTINC_10 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_10 +#ifndef CONF_DMAC_BEATSIZE_10 +#define CONF_DMAC_BEATSIZE_10 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_10 +#ifndef CONF_DMAC_BLOCKACT_10 +#define CONF_DMAC_BLOCKACT_10 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_10 +#ifndef CONF_DMAC_EVOSEL_10 +#define CONF_DMAC_EVOSEL_10 0 +#endif +// + +// Channel 11 settings +// dmac_channel_11_settings +#ifndef CONF_DMAC_CHANNEL_11_SETTINGS +#define CONF_DMAC_CHANNEL_11_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 11 is running in standby mode or not +// dmac_runstdby_11 +#ifndef CONF_DMAC_RUNSTDBY_11 +#define CONF_DMAC_RUNSTDBY_11 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_11 +#ifndef CONF_DMAC_TRIGACT_11 +#define CONF_DMAC_TRIGACT_11 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_11 +#ifndef CONF_DMAC_TRIGSRC_11 +#define CONF_DMAC_TRIGSRC_11 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_11 +#ifndef CONF_DMAC_LVL_11 +#define CONF_DMAC_LVL_11 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_11 +#ifndef CONF_DMAC_EVOE_11 +#define CONF_DMAC_EVOE_11 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_11 +#ifndef CONF_DMAC_EVIE_11 +#define CONF_DMAC_EVIE_11 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_11 +#ifndef CONF_DMAC_EVACT_11 +#define CONF_DMAC_EVACT_11 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_11 +#ifndef CONF_DMAC_STEPSIZE_11 +#define CONF_DMAC_STEPSIZE_11 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_11 +#ifndef CONF_DMAC_STEPSEL_11 +#define CONF_DMAC_STEPSEL_11 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_11 +#ifndef CONF_DMAC_SRCINC_11 +#define CONF_DMAC_SRCINC_11 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_11 +#ifndef CONF_DMAC_DSTINC_11 +#define CONF_DMAC_DSTINC_11 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_11 +#ifndef CONF_DMAC_BEATSIZE_11 +#define CONF_DMAC_BEATSIZE_11 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_11 +#ifndef CONF_DMAC_BLOCKACT_11 +#define CONF_DMAC_BLOCKACT_11 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_11 +#ifndef CONF_DMAC_EVOSEL_11 +#define CONF_DMAC_EVOSEL_11 0 +#endif +// + +// Channel 12 settings +// dmac_channel_12_settings +#ifndef CONF_DMAC_CHANNEL_12_SETTINGS +#define CONF_DMAC_CHANNEL_12_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 12 is running in standby mode or not +// dmac_runstdby_12 +#ifndef CONF_DMAC_RUNSTDBY_12 +#define CONF_DMAC_RUNSTDBY_12 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_12 +#ifndef CONF_DMAC_TRIGACT_12 +#define CONF_DMAC_TRIGACT_12 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_12 +#ifndef CONF_DMAC_TRIGSRC_12 +#define CONF_DMAC_TRIGSRC_12 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_12 +#ifndef CONF_DMAC_LVL_12 +#define CONF_DMAC_LVL_12 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_12 +#ifndef CONF_DMAC_EVOE_12 +#define CONF_DMAC_EVOE_12 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_12 +#ifndef CONF_DMAC_EVIE_12 +#define CONF_DMAC_EVIE_12 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_12 +#ifndef CONF_DMAC_EVACT_12 +#define CONF_DMAC_EVACT_12 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_12 +#ifndef CONF_DMAC_STEPSIZE_12 +#define CONF_DMAC_STEPSIZE_12 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_12 +#ifndef CONF_DMAC_STEPSEL_12 +#define CONF_DMAC_STEPSEL_12 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_12 +#ifndef CONF_DMAC_SRCINC_12 +#define CONF_DMAC_SRCINC_12 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_12 +#ifndef CONF_DMAC_DSTINC_12 +#define CONF_DMAC_DSTINC_12 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_12 +#ifndef CONF_DMAC_BEATSIZE_12 +#define CONF_DMAC_BEATSIZE_12 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_12 +#ifndef CONF_DMAC_BLOCKACT_12 +#define CONF_DMAC_BLOCKACT_12 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_12 +#ifndef CONF_DMAC_EVOSEL_12 +#define CONF_DMAC_EVOSEL_12 0 +#endif +// + +// Channel 13 settings +// dmac_channel_13_settings +#ifndef CONF_DMAC_CHANNEL_13_SETTINGS +#define CONF_DMAC_CHANNEL_13_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 13 is running in standby mode or not +// dmac_runstdby_13 +#ifndef CONF_DMAC_RUNSTDBY_13 +#define CONF_DMAC_RUNSTDBY_13 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_13 +#ifndef CONF_DMAC_TRIGACT_13 +#define CONF_DMAC_TRIGACT_13 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_13 +#ifndef CONF_DMAC_TRIGSRC_13 +#define CONF_DMAC_TRIGSRC_13 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_13 +#ifndef CONF_DMAC_LVL_13 +#define CONF_DMAC_LVL_13 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_13 +#ifndef CONF_DMAC_EVOE_13 +#define CONF_DMAC_EVOE_13 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_13 +#ifndef CONF_DMAC_EVIE_13 +#define CONF_DMAC_EVIE_13 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_13 +#ifndef CONF_DMAC_EVACT_13 +#define CONF_DMAC_EVACT_13 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_13 +#ifndef CONF_DMAC_STEPSIZE_13 +#define CONF_DMAC_STEPSIZE_13 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_13 +#ifndef CONF_DMAC_STEPSEL_13 +#define CONF_DMAC_STEPSEL_13 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_13 +#ifndef CONF_DMAC_SRCINC_13 +#define CONF_DMAC_SRCINC_13 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_13 +#ifndef CONF_DMAC_DSTINC_13 +#define CONF_DMAC_DSTINC_13 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_13 +#ifndef CONF_DMAC_BEATSIZE_13 +#define CONF_DMAC_BEATSIZE_13 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_13 +#ifndef CONF_DMAC_BLOCKACT_13 +#define CONF_DMAC_BLOCKACT_13 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_13 +#ifndef CONF_DMAC_EVOSEL_13 +#define CONF_DMAC_EVOSEL_13 0 +#endif +// + +// Channel 14 settings +// dmac_channel_14_settings +#ifndef CONF_DMAC_CHANNEL_14_SETTINGS +#define CONF_DMAC_CHANNEL_14_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 14 is running in standby mode or not +// dmac_runstdby_14 +#ifndef CONF_DMAC_RUNSTDBY_14 +#define CONF_DMAC_RUNSTDBY_14 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_14 +#ifndef CONF_DMAC_TRIGACT_14 +#define CONF_DMAC_TRIGACT_14 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_14 +#ifndef CONF_DMAC_TRIGSRC_14 +#define CONF_DMAC_TRIGSRC_14 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_14 +#ifndef CONF_DMAC_LVL_14 +#define CONF_DMAC_LVL_14 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_14 +#ifndef CONF_DMAC_EVOE_14 +#define CONF_DMAC_EVOE_14 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_14 +#ifndef CONF_DMAC_EVIE_14 +#define CONF_DMAC_EVIE_14 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_14 +#ifndef CONF_DMAC_EVACT_14 +#define CONF_DMAC_EVACT_14 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_14 +#ifndef CONF_DMAC_STEPSIZE_14 +#define CONF_DMAC_STEPSIZE_14 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_14 +#ifndef CONF_DMAC_STEPSEL_14 +#define CONF_DMAC_STEPSEL_14 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_14 +#ifndef CONF_DMAC_SRCINC_14 +#define CONF_DMAC_SRCINC_14 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_14 +#ifndef CONF_DMAC_DSTINC_14 +#define CONF_DMAC_DSTINC_14 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_14 +#ifndef CONF_DMAC_BEATSIZE_14 +#define CONF_DMAC_BEATSIZE_14 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_14 +#ifndef CONF_DMAC_BLOCKACT_14 +#define CONF_DMAC_BLOCKACT_14 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_14 +#ifndef CONF_DMAC_EVOSEL_14 +#define CONF_DMAC_EVOSEL_14 0 +#endif +// + +// Channel 15 settings +// dmac_channel_15_settings +#ifndef CONF_DMAC_CHANNEL_15_SETTINGS +#define CONF_DMAC_CHANNEL_15_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 15 is running in standby mode or not +// dmac_runstdby_15 +#ifndef CONF_DMAC_RUNSTDBY_15 +#define CONF_DMAC_RUNSTDBY_15 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_15 +#ifndef CONF_DMAC_TRIGACT_15 +#define CONF_DMAC_TRIGACT_15 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_15 +#ifndef CONF_DMAC_TRIGSRC_15 +#define CONF_DMAC_TRIGSRC_15 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_15 +#ifndef CONF_DMAC_LVL_15 +#define CONF_DMAC_LVL_15 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_15 +#ifndef CONF_DMAC_EVOE_15 +#define CONF_DMAC_EVOE_15 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_15 +#ifndef CONF_DMAC_EVIE_15 +#define CONF_DMAC_EVIE_15 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_15 +#ifndef CONF_DMAC_EVACT_15 +#define CONF_DMAC_EVACT_15 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_15 +#ifndef CONF_DMAC_STEPSIZE_15 +#define CONF_DMAC_STEPSIZE_15 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_15 +#ifndef CONF_DMAC_STEPSEL_15 +#define CONF_DMAC_STEPSEL_15 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_15 +#ifndef CONF_DMAC_SRCINC_15 +#define CONF_DMAC_SRCINC_15 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_15 +#ifndef CONF_DMAC_DSTINC_15 +#define CONF_DMAC_DSTINC_15 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_15 +#ifndef CONF_DMAC_BEATSIZE_15 +#define CONF_DMAC_BEATSIZE_15 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_15 +#ifndef CONF_DMAC_BLOCKACT_15 +#define CONF_DMAC_BLOCKACT_15 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_15 +#ifndef CONF_DMAC_EVOSEL_15 +#define CONF_DMAC_EVOSEL_15 0 +#endif +// + +// Channel 16 settings +// dmac_channel_16_settings +#ifndef CONF_DMAC_CHANNEL_16_SETTINGS +#define CONF_DMAC_CHANNEL_16_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 16 is running in standby mode or not +// dmac_runstdby_16 +#ifndef CONF_DMAC_RUNSTDBY_16 +#define CONF_DMAC_RUNSTDBY_16 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_16 +#ifndef CONF_DMAC_TRIGACT_16 +#define CONF_DMAC_TRIGACT_16 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_16 +#ifndef CONF_DMAC_TRIGSRC_16 +#define CONF_DMAC_TRIGSRC_16 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_16 +#ifndef CONF_DMAC_LVL_16 +#define CONF_DMAC_LVL_16 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_16 +#ifndef CONF_DMAC_EVOE_16 +#define CONF_DMAC_EVOE_16 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_16 +#ifndef CONF_DMAC_EVIE_16 +#define CONF_DMAC_EVIE_16 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_16 +#ifndef CONF_DMAC_EVACT_16 +#define CONF_DMAC_EVACT_16 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_16 +#ifndef CONF_DMAC_STEPSIZE_16 +#define CONF_DMAC_STEPSIZE_16 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_16 +#ifndef CONF_DMAC_STEPSEL_16 +#define CONF_DMAC_STEPSEL_16 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_16 +#ifndef CONF_DMAC_SRCINC_16 +#define CONF_DMAC_SRCINC_16 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_16 +#ifndef CONF_DMAC_DSTINC_16 +#define CONF_DMAC_DSTINC_16 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_16 +#ifndef CONF_DMAC_BEATSIZE_16 +#define CONF_DMAC_BEATSIZE_16 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_16 +#ifndef CONF_DMAC_BLOCKACT_16 +#define CONF_DMAC_BLOCKACT_16 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_16 +#ifndef CONF_DMAC_EVOSEL_16 +#define CONF_DMAC_EVOSEL_16 0 +#endif +// + +// Channel 17 settings +// dmac_channel_17_settings +#ifndef CONF_DMAC_CHANNEL_17_SETTINGS +#define CONF_DMAC_CHANNEL_17_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 17 is running in standby mode or not +// dmac_runstdby_17 +#ifndef CONF_DMAC_RUNSTDBY_17 +#define CONF_DMAC_RUNSTDBY_17 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_17 +#ifndef CONF_DMAC_TRIGACT_17 +#define CONF_DMAC_TRIGACT_17 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_17 +#ifndef CONF_DMAC_TRIGSRC_17 +#define CONF_DMAC_TRIGSRC_17 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_17 +#ifndef CONF_DMAC_LVL_17 +#define CONF_DMAC_LVL_17 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_17 +#ifndef CONF_DMAC_EVOE_17 +#define CONF_DMAC_EVOE_17 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_17 +#ifndef CONF_DMAC_EVIE_17 +#define CONF_DMAC_EVIE_17 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_17 +#ifndef CONF_DMAC_EVACT_17 +#define CONF_DMAC_EVACT_17 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_17 +#ifndef CONF_DMAC_STEPSIZE_17 +#define CONF_DMAC_STEPSIZE_17 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_17 +#ifndef CONF_DMAC_STEPSEL_17 +#define CONF_DMAC_STEPSEL_17 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_17 +#ifndef CONF_DMAC_SRCINC_17 +#define CONF_DMAC_SRCINC_17 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_17 +#ifndef CONF_DMAC_DSTINC_17 +#define CONF_DMAC_DSTINC_17 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_17 +#ifndef CONF_DMAC_BEATSIZE_17 +#define CONF_DMAC_BEATSIZE_17 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_17 +#ifndef CONF_DMAC_BLOCKACT_17 +#define CONF_DMAC_BLOCKACT_17 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_17 +#ifndef CONF_DMAC_EVOSEL_17 +#define CONF_DMAC_EVOSEL_17 0 +#endif +// + +// Channel 18 settings +// dmac_channel_18_settings +#ifndef CONF_DMAC_CHANNEL_18_SETTINGS +#define CONF_DMAC_CHANNEL_18_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 18 is running in standby mode or not +// dmac_runstdby_18 +#ifndef CONF_DMAC_RUNSTDBY_18 +#define CONF_DMAC_RUNSTDBY_18 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_18 +#ifndef CONF_DMAC_TRIGACT_18 +#define CONF_DMAC_TRIGACT_18 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_18 +#ifndef CONF_DMAC_TRIGSRC_18 +#define CONF_DMAC_TRIGSRC_18 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_18 +#ifndef CONF_DMAC_LVL_18 +#define CONF_DMAC_LVL_18 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_18 +#ifndef CONF_DMAC_EVOE_18 +#define CONF_DMAC_EVOE_18 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_18 +#ifndef CONF_DMAC_EVIE_18 +#define CONF_DMAC_EVIE_18 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_18 +#ifndef CONF_DMAC_EVACT_18 +#define CONF_DMAC_EVACT_18 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_18 +#ifndef CONF_DMAC_STEPSIZE_18 +#define CONF_DMAC_STEPSIZE_18 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_18 +#ifndef CONF_DMAC_STEPSEL_18 +#define CONF_DMAC_STEPSEL_18 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_18 +#ifndef CONF_DMAC_SRCINC_18 +#define CONF_DMAC_SRCINC_18 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_18 +#ifndef CONF_DMAC_DSTINC_18 +#define CONF_DMAC_DSTINC_18 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_18 +#ifndef CONF_DMAC_BEATSIZE_18 +#define CONF_DMAC_BEATSIZE_18 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_18 +#ifndef CONF_DMAC_BLOCKACT_18 +#define CONF_DMAC_BLOCKACT_18 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_18 +#ifndef CONF_DMAC_EVOSEL_18 +#define CONF_DMAC_EVOSEL_18 0 +#endif +// + +// Channel 19 settings +// dmac_channel_19_settings +#ifndef CONF_DMAC_CHANNEL_19_SETTINGS +#define CONF_DMAC_CHANNEL_19_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 19 is running in standby mode or not +// dmac_runstdby_19 +#ifndef CONF_DMAC_RUNSTDBY_19 +#define CONF_DMAC_RUNSTDBY_19 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_19 +#ifndef CONF_DMAC_TRIGACT_19 +#define CONF_DMAC_TRIGACT_19 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_19 +#ifndef CONF_DMAC_TRIGSRC_19 +#define CONF_DMAC_TRIGSRC_19 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_19 +#ifndef CONF_DMAC_LVL_19 +#define CONF_DMAC_LVL_19 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_19 +#ifndef CONF_DMAC_EVOE_19 +#define CONF_DMAC_EVOE_19 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_19 +#ifndef CONF_DMAC_EVIE_19 +#define CONF_DMAC_EVIE_19 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_19 +#ifndef CONF_DMAC_EVACT_19 +#define CONF_DMAC_EVACT_19 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_19 +#ifndef CONF_DMAC_STEPSIZE_19 +#define CONF_DMAC_STEPSIZE_19 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_19 +#ifndef CONF_DMAC_STEPSEL_19 +#define CONF_DMAC_STEPSEL_19 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_19 +#ifndef CONF_DMAC_SRCINC_19 +#define CONF_DMAC_SRCINC_19 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_19 +#ifndef CONF_DMAC_DSTINC_19 +#define CONF_DMAC_DSTINC_19 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_19 +#ifndef CONF_DMAC_BEATSIZE_19 +#define CONF_DMAC_BEATSIZE_19 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_19 +#ifndef CONF_DMAC_BLOCKACT_19 +#define CONF_DMAC_BLOCKACT_19 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_19 +#ifndef CONF_DMAC_EVOSEL_19 +#define CONF_DMAC_EVOSEL_19 0 +#endif +// + +// Channel 20 settings +// dmac_channel_20_settings +#ifndef CONF_DMAC_CHANNEL_20_SETTINGS +#define CONF_DMAC_CHANNEL_20_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 20 is running in standby mode or not +// dmac_runstdby_20 +#ifndef CONF_DMAC_RUNSTDBY_20 +#define CONF_DMAC_RUNSTDBY_20 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_20 +#ifndef CONF_DMAC_TRIGACT_20 +#define CONF_DMAC_TRIGACT_20 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_20 +#ifndef CONF_DMAC_TRIGSRC_20 +#define CONF_DMAC_TRIGSRC_20 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_20 +#ifndef CONF_DMAC_LVL_20 +#define CONF_DMAC_LVL_20 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_20 +#ifndef CONF_DMAC_EVOE_20 +#define CONF_DMAC_EVOE_20 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_20 +#ifndef CONF_DMAC_EVIE_20 +#define CONF_DMAC_EVIE_20 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_20 +#ifndef CONF_DMAC_EVACT_20 +#define CONF_DMAC_EVACT_20 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_20 +#ifndef CONF_DMAC_STEPSIZE_20 +#define CONF_DMAC_STEPSIZE_20 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_20 +#ifndef CONF_DMAC_STEPSEL_20 +#define CONF_DMAC_STEPSEL_20 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_20 +#ifndef CONF_DMAC_SRCINC_20 +#define CONF_DMAC_SRCINC_20 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_20 +#ifndef CONF_DMAC_DSTINC_20 +#define CONF_DMAC_DSTINC_20 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_20 +#ifndef CONF_DMAC_BEATSIZE_20 +#define CONF_DMAC_BEATSIZE_20 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_20 +#ifndef CONF_DMAC_BLOCKACT_20 +#define CONF_DMAC_BLOCKACT_20 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_20 +#ifndef CONF_DMAC_EVOSEL_20 +#define CONF_DMAC_EVOSEL_20 0 +#endif +// + +// Channel 21 settings +// dmac_channel_21_settings +#ifndef CONF_DMAC_CHANNEL_21_SETTINGS +#define CONF_DMAC_CHANNEL_21_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 21 is running in standby mode or not +// dmac_runstdby_21 +#ifndef CONF_DMAC_RUNSTDBY_21 +#define CONF_DMAC_RUNSTDBY_21 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_21 +#ifndef CONF_DMAC_TRIGACT_21 +#define CONF_DMAC_TRIGACT_21 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_21 +#ifndef CONF_DMAC_TRIGSRC_21 +#define CONF_DMAC_TRIGSRC_21 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_21 +#ifndef CONF_DMAC_LVL_21 +#define CONF_DMAC_LVL_21 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_21 +#ifndef CONF_DMAC_EVOE_21 +#define CONF_DMAC_EVOE_21 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_21 +#ifndef CONF_DMAC_EVIE_21 +#define CONF_DMAC_EVIE_21 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_21 +#ifndef CONF_DMAC_EVACT_21 +#define CONF_DMAC_EVACT_21 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_21 +#ifndef CONF_DMAC_STEPSIZE_21 +#define CONF_DMAC_STEPSIZE_21 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_21 +#ifndef CONF_DMAC_STEPSEL_21 +#define CONF_DMAC_STEPSEL_21 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_21 +#ifndef CONF_DMAC_SRCINC_21 +#define CONF_DMAC_SRCINC_21 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_21 +#ifndef CONF_DMAC_DSTINC_21 +#define CONF_DMAC_DSTINC_21 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_21 +#ifndef CONF_DMAC_BEATSIZE_21 +#define CONF_DMAC_BEATSIZE_21 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_21 +#ifndef CONF_DMAC_BLOCKACT_21 +#define CONF_DMAC_BLOCKACT_21 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_21 +#ifndef CONF_DMAC_EVOSEL_21 +#define CONF_DMAC_EVOSEL_21 0 +#endif +// + +// Channel 22 settings +// dmac_channel_22_settings +#ifndef CONF_DMAC_CHANNEL_22_SETTINGS +#define CONF_DMAC_CHANNEL_22_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 22 is running in standby mode or not +// dmac_runstdby_22 +#ifndef CONF_DMAC_RUNSTDBY_22 +#define CONF_DMAC_RUNSTDBY_22 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_22 +#ifndef CONF_DMAC_TRIGACT_22 +#define CONF_DMAC_TRIGACT_22 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_22 +#ifndef CONF_DMAC_TRIGSRC_22 +#define CONF_DMAC_TRIGSRC_22 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_22 +#ifndef CONF_DMAC_LVL_22 +#define CONF_DMAC_LVL_22 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_22 +#ifndef CONF_DMAC_EVOE_22 +#define CONF_DMAC_EVOE_22 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_22 +#ifndef CONF_DMAC_EVIE_22 +#define CONF_DMAC_EVIE_22 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_22 +#ifndef CONF_DMAC_EVACT_22 +#define CONF_DMAC_EVACT_22 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_22 +#ifndef CONF_DMAC_STEPSIZE_22 +#define CONF_DMAC_STEPSIZE_22 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_22 +#ifndef CONF_DMAC_STEPSEL_22 +#define CONF_DMAC_STEPSEL_22 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_22 +#ifndef CONF_DMAC_SRCINC_22 +#define CONF_DMAC_SRCINC_22 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_22 +#ifndef CONF_DMAC_DSTINC_22 +#define CONF_DMAC_DSTINC_22 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_22 +#ifndef CONF_DMAC_BEATSIZE_22 +#define CONF_DMAC_BEATSIZE_22 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_22 +#ifndef CONF_DMAC_BLOCKACT_22 +#define CONF_DMAC_BLOCKACT_22 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_22 +#ifndef CONF_DMAC_EVOSEL_22 +#define CONF_DMAC_EVOSEL_22 0 +#endif +// + +// Channel 23 settings +// dmac_channel_23_settings +#ifndef CONF_DMAC_CHANNEL_23_SETTINGS +#define CONF_DMAC_CHANNEL_23_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 23 is running in standby mode or not +// dmac_runstdby_23 +#ifndef CONF_DMAC_RUNSTDBY_23 +#define CONF_DMAC_RUNSTDBY_23 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_23 +#ifndef CONF_DMAC_TRIGACT_23 +#define CONF_DMAC_TRIGACT_23 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_23 +#ifndef CONF_DMAC_TRIGSRC_23 +#define CONF_DMAC_TRIGSRC_23 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_23 +#ifndef CONF_DMAC_LVL_23 +#define CONF_DMAC_LVL_23 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_23 +#ifndef CONF_DMAC_EVOE_23 +#define CONF_DMAC_EVOE_23 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_23 +#ifndef CONF_DMAC_EVIE_23 +#define CONF_DMAC_EVIE_23 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_23 +#ifndef CONF_DMAC_EVACT_23 +#define CONF_DMAC_EVACT_23 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_23 +#ifndef CONF_DMAC_STEPSIZE_23 +#define CONF_DMAC_STEPSIZE_23 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_23 +#ifndef CONF_DMAC_STEPSEL_23 +#define CONF_DMAC_STEPSEL_23 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_23 +#ifndef CONF_DMAC_SRCINC_23 +#define CONF_DMAC_SRCINC_23 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_23 +#ifndef CONF_DMAC_DSTINC_23 +#define CONF_DMAC_DSTINC_23 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_23 +#ifndef CONF_DMAC_BEATSIZE_23 +#define CONF_DMAC_BEATSIZE_23 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_23 +#ifndef CONF_DMAC_BLOCKACT_23 +#define CONF_DMAC_BLOCKACT_23 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_23 +#ifndef CONF_DMAC_EVOSEL_23 +#define CONF_DMAC_EVOSEL_23 0 +#endif +// + +// Channel 24 settings +// dmac_channel_24_settings +#ifndef CONF_DMAC_CHANNEL_24_SETTINGS +#define CONF_DMAC_CHANNEL_24_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 24 is running in standby mode or not +// dmac_runstdby_24 +#ifndef CONF_DMAC_RUNSTDBY_24 +#define CONF_DMAC_RUNSTDBY_24 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_24 +#ifndef CONF_DMAC_TRIGACT_24 +#define CONF_DMAC_TRIGACT_24 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_24 +#ifndef CONF_DMAC_TRIGSRC_24 +#define CONF_DMAC_TRIGSRC_24 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_24 +#ifndef CONF_DMAC_LVL_24 +#define CONF_DMAC_LVL_24 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_24 +#ifndef CONF_DMAC_EVOE_24 +#define CONF_DMAC_EVOE_24 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_24 +#ifndef CONF_DMAC_EVIE_24 +#define CONF_DMAC_EVIE_24 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_24 +#ifndef CONF_DMAC_EVACT_24 +#define CONF_DMAC_EVACT_24 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_24 +#ifndef CONF_DMAC_STEPSIZE_24 +#define CONF_DMAC_STEPSIZE_24 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_24 +#ifndef CONF_DMAC_STEPSEL_24 +#define CONF_DMAC_STEPSEL_24 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_24 +#ifndef CONF_DMAC_SRCINC_24 +#define CONF_DMAC_SRCINC_24 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_24 +#ifndef CONF_DMAC_DSTINC_24 +#define CONF_DMAC_DSTINC_24 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_24 +#ifndef CONF_DMAC_BEATSIZE_24 +#define CONF_DMAC_BEATSIZE_24 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_24 +#ifndef CONF_DMAC_BLOCKACT_24 +#define CONF_DMAC_BLOCKACT_24 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_24 +#ifndef CONF_DMAC_EVOSEL_24 +#define CONF_DMAC_EVOSEL_24 0 +#endif +// + +// Channel 25 settings +// dmac_channel_25_settings +#ifndef CONF_DMAC_CHANNEL_25_SETTINGS +#define CONF_DMAC_CHANNEL_25_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 25 is running in standby mode or not +// dmac_runstdby_25 +#ifndef CONF_DMAC_RUNSTDBY_25 +#define CONF_DMAC_RUNSTDBY_25 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_25 +#ifndef CONF_DMAC_TRIGACT_25 +#define CONF_DMAC_TRIGACT_25 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_25 +#ifndef CONF_DMAC_TRIGSRC_25 +#define CONF_DMAC_TRIGSRC_25 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_25 +#ifndef CONF_DMAC_LVL_25 +#define CONF_DMAC_LVL_25 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_25 +#ifndef CONF_DMAC_EVOE_25 +#define CONF_DMAC_EVOE_25 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_25 +#ifndef CONF_DMAC_EVIE_25 +#define CONF_DMAC_EVIE_25 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_25 +#ifndef CONF_DMAC_EVACT_25 +#define CONF_DMAC_EVACT_25 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_25 +#ifndef CONF_DMAC_STEPSIZE_25 +#define CONF_DMAC_STEPSIZE_25 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_25 +#ifndef CONF_DMAC_STEPSEL_25 +#define CONF_DMAC_STEPSEL_25 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_25 +#ifndef CONF_DMAC_SRCINC_25 +#define CONF_DMAC_SRCINC_25 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_25 +#ifndef CONF_DMAC_DSTINC_25 +#define CONF_DMAC_DSTINC_25 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_25 +#ifndef CONF_DMAC_BEATSIZE_25 +#define CONF_DMAC_BEATSIZE_25 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_25 +#ifndef CONF_DMAC_BLOCKACT_25 +#define CONF_DMAC_BLOCKACT_25 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_25 +#ifndef CONF_DMAC_EVOSEL_25 +#define CONF_DMAC_EVOSEL_25 0 +#endif +// + +// Channel 26 settings +// dmac_channel_26_settings +#ifndef CONF_DMAC_CHANNEL_26_SETTINGS +#define CONF_DMAC_CHANNEL_26_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 26 is running in standby mode or not +// dmac_runstdby_26 +#ifndef CONF_DMAC_RUNSTDBY_26 +#define CONF_DMAC_RUNSTDBY_26 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_26 +#ifndef CONF_DMAC_TRIGACT_26 +#define CONF_DMAC_TRIGACT_26 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_26 +#ifndef CONF_DMAC_TRIGSRC_26 +#define CONF_DMAC_TRIGSRC_26 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_26 +#ifndef CONF_DMAC_LVL_26 +#define CONF_DMAC_LVL_26 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_26 +#ifndef CONF_DMAC_EVOE_26 +#define CONF_DMAC_EVOE_26 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_26 +#ifndef CONF_DMAC_EVIE_26 +#define CONF_DMAC_EVIE_26 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_26 +#ifndef CONF_DMAC_EVACT_26 +#define CONF_DMAC_EVACT_26 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_26 +#ifndef CONF_DMAC_STEPSIZE_26 +#define CONF_DMAC_STEPSIZE_26 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_26 +#ifndef CONF_DMAC_STEPSEL_26 +#define CONF_DMAC_STEPSEL_26 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_26 +#ifndef CONF_DMAC_SRCINC_26 +#define CONF_DMAC_SRCINC_26 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_26 +#ifndef CONF_DMAC_DSTINC_26 +#define CONF_DMAC_DSTINC_26 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_26 +#ifndef CONF_DMAC_BEATSIZE_26 +#define CONF_DMAC_BEATSIZE_26 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_26 +#ifndef CONF_DMAC_BLOCKACT_26 +#define CONF_DMAC_BLOCKACT_26 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_26 +#ifndef CONF_DMAC_EVOSEL_26 +#define CONF_DMAC_EVOSEL_26 0 +#endif +// + +// Channel 27 settings +// dmac_channel_27_settings +#ifndef CONF_DMAC_CHANNEL_27_SETTINGS +#define CONF_DMAC_CHANNEL_27_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 27 is running in standby mode or not +// dmac_runstdby_27 +#ifndef CONF_DMAC_RUNSTDBY_27 +#define CONF_DMAC_RUNSTDBY_27 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_27 +#ifndef CONF_DMAC_TRIGACT_27 +#define CONF_DMAC_TRIGACT_27 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_27 +#ifndef CONF_DMAC_TRIGSRC_27 +#define CONF_DMAC_TRIGSRC_27 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_27 +#ifndef CONF_DMAC_LVL_27 +#define CONF_DMAC_LVL_27 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_27 +#ifndef CONF_DMAC_EVOE_27 +#define CONF_DMAC_EVOE_27 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_27 +#ifndef CONF_DMAC_EVIE_27 +#define CONF_DMAC_EVIE_27 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_27 +#ifndef CONF_DMAC_EVACT_27 +#define CONF_DMAC_EVACT_27 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_27 +#ifndef CONF_DMAC_STEPSIZE_27 +#define CONF_DMAC_STEPSIZE_27 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_27 +#ifndef CONF_DMAC_STEPSEL_27 +#define CONF_DMAC_STEPSEL_27 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_27 +#ifndef CONF_DMAC_SRCINC_27 +#define CONF_DMAC_SRCINC_27 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_27 +#ifndef CONF_DMAC_DSTINC_27 +#define CONF_DMAC_DSTINC_27 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_27 +#ifndef CONF_DMAC_BEATSIZE_27 +#define CONF_DMAC_BEATSIZE_27 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_27 +#ifndef CONF_DMAC_BLOCKACT_27 +#define CONF_DMAC_BLOCKACT_27 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_27 +#ifndef CONF_DMAC_EVOSEL_27 +#define CONF_DMAC_EVOSEL_27 0 +#endif +// + +// Channel 28 settings +// dmac_channel_28_settings +#ifndef CONF_DMAC_CHANNEL_28_SETTINGS +#define CONF_DMAC_CHANNEL_28_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 28 is running in standby mode or not +// dmac_runstdby_28 +#ifndef CONF_DMAC_RUNSTDBY_28 +#define CONF_DMAC_RUNSTDBY_28 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_28 +#ifndef CONF_DMAC_TRIGACT_28 +#define CONF_DMAC_TRIGACT_28 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_28 +#ifndef CONF_DMAC_TRIGSRC_28 +#define CONF_DMAC_TRIGSRC_28 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_28 +#ifndef CONF_DMAC_LVL_28 +#define CONF_DMAC_LVL_28 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_28 +#ifndef CONF_DMAC_EVOE_28 +#define CONF_DMAC_EVOE_28 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_28 +#ifndef CONF_DMAC_EVIE_28 +#define CONF_DMAC_EVIE_28 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_28 +#ifndef CONF_DMAC_EVACT_28 +#define CONF_DMAC_EVACT_28 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_28 +#ifndef CONF_DMAC_STEPSIZE_28 +#define CONF_DMAC_STEPSIZE_28 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_28 +#ifndef CONF_DMAC_STEPSEL_28 +#define CONF_DMAC_STEPSEL_28 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_28 +#ifndef CONF_DMAC_SRCINC_28 +#define CONF_DMAC_SRCINC_28 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_28 +#ifndef CONF_DMAC_DSTINC_28 +#define CONF_DMAC_DSTINC_28 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_28 +#ifndef CONF_DMAC_BEATSIZE_28 +#define CONF_DMAC_BEATSIZE_28 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_28 +#ifndef CONF_DMAC_BLOCKACT_28 +#define CONF_DMAC_BLOCKACT_28 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_28 +#ifndef CONF_DMAC_EVOSEL_28 +#define CONF_DMAC_EVOSEL_28 0 +#endif +// + +// Channel 29 settings +// dmac_channel_29_settings +#ifndef CONF_DMAC_CHANNEL_29_SETTINGS +#define CONF_DMAC_CHANNEL_29_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 29 is running in standby mode or not +// dmac_runstdby_29 +#ifndef CONF_DMAC_RUNSTDBY_29 +#define CONF_DMAC_RUNSTDBY_29 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_29 +#ifndef CONF_DMAC_TRIGACT_29 +#define CONF_DMAC_TRIGACT_29 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_29 +#ifndef CONF_DMAC_TRIGSRC_29 +#define CONF_DMAC_TRIGSRC_29 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_29 +#ifndef CONF_DMAC_LVL_29 +#define CONF_DMAC_LVL_29 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_29 +#ifndef CONF_DMAC_EVOE_29 +#define CONF_DMAC_EVOE_29 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_29 +#ifndef CONF_DMAC_EVIE_29 +#define CONF_DMAC_EVIE_29 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_29 +#ifndef CONF_DMAC_EVACT_29 +#define CONF_DMAC_EVACT_29 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_29 +#ifndef CONF_DMAC_STEPSIZE_29 +#define CONF_DMAC_STEPSIZE_29 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_29 +#ifndef CONF_DMAC_STEPSEL_29 +#define CONF_DMAC_STEPSEL_29 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_29 +#ifndef CONF_DMAC_SRCINC_29 +#define CONF_DMAC_SRCINC_29 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_29 +#ifndef CONF_DMAC_DSTINC_29 +#define CONF_DMAC_DSTINC_29 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_29 +#ifndef CONF_DMAC_BEATSIZE_29 +#define CONF_DMAC_BEATSIZE_29 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_29 +#ifndef CONF_DMAC_BLOCKACT_29 +#define CONF_DMAC_BLOCKACT_29 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_29 +#ifndef CONF_DMAC_EVOSEL_29 +#define CONF_DMAC_EVOSEL_29 0 +#endif +// + +// Channel 30 settings +// dmac_channel_30_settings +#ifndef CONF_DMAC_CHANNEL_30_SETTINGS +#define CONF_DMAC_CHANNEL_30_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 30 is running in standby mode or not +// dmac_runstdby_30 +#ifndef CONF_DMAC_RUNSTDBY_30 +#define CONF_DMAC_RUNSTDBY_30 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_30 +#ifndef CONF_DMAC_TRIGACT_30 +#define CONF_DMAC_TRIGACT_30 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_30 +#ifndef CONF_DMAC_TRIGSRC_30 +#define CONF_DMAC_TRIGSRC_30 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_30 +#ifndef CONF_DMAC_LVL_30 +#define CONF_DMAC_LVL_30 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_30 +#ifndef CONF_DMAC_EVOE_30 +#define CONF_DMAC_EVOE_30 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_30 +#ifndef CONF_DMAC_EVIE_30 +#define CONF_DMAC_EVIE_30 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_30 +#ifndef CONF_DMAC_EVACT_30 +#define CONF_DMAC_EVACT_30 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_30 +#ifndef CONF_DMAC_STEPSIZE_30 +#define CONF_DMAC_STEPSIZE_30 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_30 +#ifndef CONF_DMAC_STEPSEL_30 +#define CONF_DMAC_STEPSEL_30 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_30 +#ifndef CONF_DMAC_SRCINC_30 +#define CONF_DMAC_SRCINC_30 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_30 +#ifndef CONF_DMAC_DSTINC_30 +#define CONF_DMAC_DSTINC_30 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_30 +#ifndef CONF_DMAC_BEATSIZE_30 +#define CONF_DMAC_BEATSIZE_30 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_30 +#ifndef CONF_DMAC_BLOCKACT_30 +#define CONF_DMAC_BLOCKACT_30 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_30 +#ifndef CONF_DMAC_EVOSEL_30 +#define CONF_DMAC_EVOSEL_30 0 +#endif +// + +// Channel 31 settings +// dmac_channel_31_settings +#ifndef CONF_DMAC_CHANNEL_31_SETTINGS +#define CONF_DMAC_CHANNEL_31_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 31 is running in standby mode or not +// dmac_runstdby_31 +#ifndef CONF_DMAC_RUNSTDBY_31 +#define CONF_DMAC_RUNSTDBY_31 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_31 +#ifndef CONF_DMAC_TRIGACT_31 +#define CONF_DMAC_TRIGACT_31 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_31 +#ifndef CONF_DMAC_TRIGSRC_31 +#define CONF_DMAC_TRIGSRC_31 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_31 +#ifndef CONF_DMAC_LVL_31 +#define CONF_DMAC_LVL_31 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_31 +#ifndef CONF_DMAC_EVOE_31 +#define CONF_DMAC_EVOE_31 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_31 +#ifndef CONF_DMAC_EVIE_31 +#define CONF_DMAC_EVIE_31 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_31 +#ifndef CONF_DMAC_EVACT_31 +#define CONF_DMAC_EVACT_31 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_31 +#ifndef CONF_DMAC_STEPSIZE_31 +#define CONF_DMAC_STEPSIZE_31 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_31 +#ifndef CONF_DMAC_STEPSEL_31 +#define CONF_DMAC_STEPSEL_31 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_31 +#ifndef CONF_DMAC_SRCINC_31 +#define CONF_DMAC_SRCINC_31 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_31 +#ifndef CONF_DMAC_DSTINC_31 +#define CONF_DMAC_DSTINC_31 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_31 +#ifndef CONF_DMAC_BEATSIZE_31 +#define CONF_DMAC_BEATSIZE_31 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_31 +#ifndef CONF_DMAC_BLOCKACT_31 +#define CONF_DMAC_BLOCKACT_31 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_31 +#ifndef CONF_DMAC_EVOSEL_31 +#define CONF_DMAC_EVOSEL_31 0 +#endif +// + +// + +// <<< end of configuration section >>> + +#endif // HPL_DMAC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same51/hpl_gclk_config.h b/ports/atmel-samd/asf4_conf/same51/hpl_gclk_config.h new file mode 100644 index 0000000000..6f4f01a7e6 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same51/hpl_gclk_config.h @@ -0,0 +1,924 @@ +// Circuit Python SAMD51 clock tree: +// DFLL48M (with USBCRM on to sync with external USB ref) -> GCLK1, GCLK5, GCLK6 +// GCLK1 (48MHz) -> 48 MHz peripherals +// GCLK5 (48 MHz divided down to 2 MHz) -> DPLL0 +// DPLL0 (multiplied up to 120 MHz) -> GCLK0, GCLK4 (output for monitoring) +// GCLK6 (48 MHz divided down to 12 MHz) -> DAC + +// We'd like to use XOSC32K as a ref for DFLL48M on boards with a 32kHz crystal, +// but haven't figured that out yet. + +// Used in hpl/core/hpl_init.c to define which clocks should be initialized first. +// Not clear why all these need to be specified, but it doesn't work properly otherwise. + +//#define CIRCUITPY_GCLK_INIT_1ST (1 << 0 | 1 << 1 | 1 << 3 | 1 <<5) +#define CIRCUITPY_GCLK_INIT_1ST 0xffff + +/* Auto-generated config file hpl_gclk_config.h */ +#ifndef HPL_GCLK_CONFIG_H +#define HPL_GCLK_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Generic clock generator 0 configuration +// Indicates whether generic clock 0 configuration is enabled or not +// enable_gclk_gen_0 +#ifndef CONF_GCLK_GENERATOR_0_CONFIG +#define CONF_GCLK_GENERATOR_0_CONFIG 1 +#endif + +// Generic Clock Generator Control +// Generic clock generator 0 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 0 +// gclk_gen_0_oscillator +#ifndef CONF_GCLK_GEN_0_SOURCE +#define CONF_GCLK_GEN_0_SOURCE GCLK_GENCTRL_SRC_DPLL0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_0_runstdby +#ifndef CONF_GCLK_GEN_0_RUNSTDBY +#define CONF_GCLK_GEN_0_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_0_div_sel +#ifndef CONF_GCLK_GEN_0_DIVSEL +#define CONF_GCLK_GEN_0_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_0_oe +#ifndef CONF_GCLK_GEN_0_OE +#define CONF_GCLK_GEN_0_OE 1 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_0_oov +#ifndef CONF_GCLK_GEN_0_OOV +#define CONF_GCLK_GEN_0_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_0_idc +#ifndef CONF_GCLK_GEN_0_IDC +#define CONF_GCLK_GEN_0_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_0_enable +#ifndef CONF_GCLK_GEN_0_GENEN +#define CONF_GCLK_GEN_0_GENEN 1 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 0 division <0x0000-0xFFFF> +// gclk_gen_0_div +#ifndef CONF_GCLK_GEN_0_DIV +#define CONF_GCLK_GEN_0_DIV 1 +#endif +// +// + +// Generic clock generator 1 configuration +// Indicates whether generic clock 1 configuration is enabled or not +// enable_gclk_gen_1 +#ifndef CONF_GCLK_GENERATOR_1_CONFIG +#define CONF_GCLK_GENERATOR_1_CONFIG 1 +#endif + +// Generic Clock Generator Control +// Generic clock generator 1 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 1 +// gclk_gen_1_oscillator +#ifndef CONF_GCLK_GEN_1_SOURCE +#define CONF_GCLK_GEN_1_SOURCE GCLK_GENCTRL_SRC_DFLL +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_1_runstdby +#ifndef CONF_GCLK_GEN_1_RUNSTDBY +#define CONF_GCLK_GEN_1_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_1_div_sel +#ifndef CONF_GCLK_GEN_1_DIVSEL +#define CONF_GCLK_GEN_1_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_1_oe +#ifndef CONF_GCLK_GEN_1_OE +#define CONF_GCLK_GEN_1_OE 1 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_1_oov +#ifndef CONF_GCLK_GEN_1_OOV +#define CONF_GCLK_GEN_1_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_1_idc +#ifndef CONF_GCLK_GEN_1_IDC +#define CONF_GCLK_GEN_1_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_1_enable +#ifndef CONF_GCLK_GEN_1_GENEN +#define CONF_GCLK_GEN_1_GENEN 1 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 1 division <0x0000-0xFFFF> +// gclk_gen_1_div +#ifndef CONF_GCLK_GEN_1_DIV +#define CONF_GCLK_GEN_1_DIV 1 +#endif +// +// + +// Generic clock generator 2 configuration +// Indicates whether generic clock 2 configuration is enabled or not +// enable_gclk_gen_2 +#ifndef CONF_GCLK_GENERATOR_2_CONFIG +#define CONF_GCLK_GENERATOR_2_CONFIG 1 +#endif + +// Generic Clock Generator Control +// Generic clock generator 2 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 2 +// gclk_gen_2_oscillator +#ifndef CONF_GCLK_GEN_2_SOURCE +#define CONF_GCLK_GEN_2_SOURCE GCLK_GENCTRL_SRC_OSCULP32K +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_2_runstdby +#ifndef CONF_GCLK_GEN_2_RUNSTDBY +#define CONF_GCLK_GEN_2_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_2_div_sel +#ifndef CONF_GCLK_GEN_2_DIVSEL +#define CONF_GCLK_GEN_2_DIVSEL 1 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_2_oe +#ifndef CONF_GCLK_GEN_2_OE +#define CONF_GCLK_GEN_2_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_2_oov +#ifndef CONF_GCLK_GEN_2_OOV +#define CONF_GCLK_GEN_2_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_2_idc +#ifndef CONF_GCLK_GEN_2_IDC +#define CONF_GCLK_GEN_2_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_2_enable +#ifndef CONF_GCLK_GEN_2_GENEN +#define CONF_GCLK_GEN_2_GENEN 1 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 2 division <0x0000-0xFFFF> +// gclk_gen_2_div +#ifndef CONF_GCLK_GEN_2_DIV +#define CONF_GCLK_GEN_2_DIV 4 +#endif +// +// + +// Generic clock generator 3 configuration +// Indicates whether generic clock 3 configuration is enabled or not +// enable_gclk_gen_3 +#ifndef CONF_GCLK_GENERATOR_3_CONFIG +#define CONF_GCLK_GENERATOR_3_CONFIG 0 +#endif + +// Generic Clock Generator Control +// Generic clock generator 3 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 3 +// gclk_gen_3_oscillator +#ifndef CONF_GCLK_GEN_3_SOURCE +#define CONF_GCLK_GEN_3_SOURCE GCLK_GENCTRL_SRC_XOSC32K +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_3_runstdby +#ifndef CONF_GCLK_GEN_3_RUNSTDBY +#define CONF_GCLK_GEN_3_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_3_div_sel +#ifndef CONF_GCLK_GEN_3_DIVSEL +#define CONF_GCLK_GEN_3_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_3_oe +#ifndef CONF_GCLK_GEN_3_OE +#define CONF_GCLK_GEN_3_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_3_oov +#ifndef CONF_GCLK_GEN_3_OOV +#define CONF_GCLK_GEN_3_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_3_idc +#ifndef CONF_GCLK_GEN_3_IDC +#define CONF_GCLK_GEN_3_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_3_enable +#ifndef CONF_GCLK_GEN_3_GENEN +#define CONF_GCLK_GEN_3_GENEN 0 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 3 division <0x0000-0xFFFF> +// gclk_gen_3_div +#ifndef CONF_GCLK_GEN_3_DIV +#define CONF_GCLK_GEN_3_DIV 1 +#endif +// +// + +// Generic clock generator 4 configuration +// Indicates whether generic clock 4 configuration is enabled or not +// enable_gclk_gen_4 +#ifndef CONF_GCLK_GENERATOR_4_CONFIG +#define CONF_GCLK_GENERATOR_4_CONFIG 1 +#endif + +// Generic Clock Generator Control +// Generic clock generator 4 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 4 +// gclk_gen_4_oscillator +#ifndef CONF_GCLK_GEN_4_SOURCE +#define CONF_GCLK_GEN_4_SOURCE GCLK_GENCTRL_SRC_DPLL0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_4_runstdby +#ifndef CONF_GCLK_GEN_4_RUNSTDBY +#define CONF_GCLK_GEN_4_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_4_div_sel +#ifndef CONF_GCLK_GEN_4_DIVSEL +#define CONF_GCLK_GEN_4_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_4_oe +#ifndef CONF_GCLK_GEN_4_OE +#define CONF_GCLK_GEN_4_OE 1 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_4_oov +#ifndef CONF_GCLK_GEN_4_OOV +#define CONF_GCLK_GEN_4_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_4_idc +#ifndef CONF_GCLK_GEN_4_IDC +#define CONF_GCLK_GEN_4_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_4_enable +#ifndef CONF_GCLK_GEN_4_GENEN +#define CONF_GCLK_GEN_4_GENEN 1 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 4 division <0x0000-0xFFFF> +// gclk_gen_4_div +#ifndef CONF_GCLK_GEN_4_DIV +#define CONF_GCLK_GEN_4_DIV 1 +#endif +// +// + +// Generic clock generator 5 configuration +// Indicates whether generic clock 5 configuration is enabled or not +// enable_gclk_gen_5 +#ifndef CONF_GCLK_GENERATOR_5_CONFIG +#define CONF_GCLK_GENERATOR_5_CONFIG 1 +#endif + +// Generic Clock Generator Control +// Generic clock generator 5 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 5 +// gclk_gen_5_oscillator +#ifndef CONF_GCLK_GEN_5_SOURCE +#define CONF_GCLK_GEN_5_SOURCE GCLK_GENCTRL_SRC_DFLL +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_5_runstdby +#ifndef CONF_GCLK_GEN_5_RUNSTDBY +#define CONF_GCLK_GEN_5_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_5_div_sel +#ifndef CONF_GCLK_GEN_5_DIVSEL +#define CONF_GCLK_GEN_5_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_5_oe +#ifndef CONF_GCLK_GEN_5_OE +#define CONF_GCLK_GEN_5_OE 1 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_5_oov +#ifndef CONF_GCLK_GEN_5_OOV +#define CONF_GCLK_GEN_5_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_5_idc +#ifndef CONF_GCLK_GEN_5_IDC +#define CONF_GCLK_GEN_5_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_5_enable +#ifndef CONF_GCLK_GEN_5_GENEN +#define CONF_GCLK_GEN_5_GENEN 1 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 5 division <0x0000-0xFFFF> +// gclk_gen_5_div +#ifndef CONF_GCLK_GEN_5_DIV +#define CONF_GCLK_GEN_5_DIV 24 +#endif +// +// + +// Generic clock generator 6 configuration +// Indicates whether generic clock 6 configuration is enabled or not +// enable_gclk_gen_6 +#ifndef CONF_GCLK_GENERATOR_6_CONFIG +#define CONF_GCLK_GENERATOR_6_CONFIG 1 +#endif + +// Generic Clock Generator Control +// Generic clock generator 6 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 6 +// gclk_gen_6_oscillator +#ifndef CONF_GCLK_GEN_6_SOURCE +#define CONF_GCLK_GEN_6_SOURCE GCLK_GENCTRL_SRC_DFLL +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_6_runstdby +#ifndef CONF_GCLK_GEN_6_RUNSTDBY +#define CONF_GCLK_GEN_6_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_6_div_sel +#ifndef CONF_GCLK_GEN_6_DIVSEL +#define CONF_GCLK_GEN_6_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_6_oe +#ifndef CONF_GCLK_GEN_6_OE +#define CONF_GCLK_GEN_6_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_6_oov +#ifndef CONF_GCLK_GEN_6_OOV +#define CONF_GCLK_GEN_6_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_6_idc +#ifndef CONF_GCLK_GEN_6_IDC +#define CONF_GCLK_GEN_6_IDC 1 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_6_enable +#ifndef CONF_GCLK_GEN_6_GENEN +#define CONF_GCLK_GEN_6_GENEN 1 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 6 division <0x0000-0xFFFF> +// gclk_gen_6_div +#ifndef CONF_GCLK_GEN_6_DIV +#define CONF_GCLK_GEN_6_DIV 4 +#endif +// +// + +// Generic clock generator 7 configuration +// Indicates whether generic clock 7 configuration is enabled or not +// enable_gclk_gen_7 +#ifndef CONF_GCLK_GENERATOR_7_CONFIG +#define CONF_GCLK_GENERATOR_7_CONFIG 0 +#endif + +// Generic Clock Generator Control +// Generic clock generator 7 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 7 +// gclk_gen_7_oscillator +#ifndef CONF_GCLK_GEN_7_SOURCE +#define CONF_GCLK_GEN_7_SOURCE GCLK_GENCTRL_SRC_XOSC1 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_7_runstdby +#ifndef CONF_GCLK_GEN_7_RUNSTDBY +#define CONF_GCLK_GEN_7_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_7_div_sel +#ifndef CONF_GCLK_GEN_7_DIVSEL +#define CONF_GCLK_GEN_7_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_7_oe +#ifndef CONF_GCLK_GEN_7_OE +#define CONF_GCLK_GEN_7_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_7_oov +#ifndef CONF_GCLK_GEN_7_OOV +#define CONF_GCLK_GEN_7_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_7_idc +#ifndef CONF_GCLK_GEN_7_IDC +#define CONF_GCLK_GEN_7_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_7_enable +#ifndef CONF_GCLK_GEN_7_GENEN +#define CONF_GCLK_GEN_7_GENEN 0 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 7 division <0x0000-0xFFFF> +// gclk_gen_7_div +#ifndef CONF_GCLK_GEN_7_DIV +#define CONF_GCLK_GEN_7_DIV 1 +#endif +// +// + +// Generic clock generator 8 configuration +// Indicates whether generic clock 8 configuration is enabled or not +// enable_gclk_gen_8 +#ifndef CONF_GCLK_GENERATOR_8_CONFIG +#define CONF_GCLK_GENERATOR_8_CONFIG 0 +#endif + +// Generic Clock Generator Control +// Generic clock generator 8 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 8 +// gclk_gen_8_oscillator +#ifndef CONF_GCLK_GEN_8_SOURCE +#define CONF_GCLK_GEN_8_SOURCE GCLK_GENCTRL_SRC_XOSC1 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_8_runstdby +#ifndef CONF_GCLK_GEN_8_RUNSTDBY +#define CONF_GCLK_GEN_8_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_8_div_sel +#ifndef CONF_GCLK_GEN_8_DIVSEL +#define CONF_GCLK_GEN_8_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_8_oe +#ifndef CONF_GCLK_GEN_8_OE +#define CONF_GCLK_GEN_8_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_8_oov +#ifndef CONF_GCLK_GEN_8_OOV +#define CONF_GCLK_GEN_8_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_8_idc +#ifndef CONF_GCLK_GEN_8_IDC +#define CONF_GCLK_GEN_8_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_8_enable +#ifndef CONF_GCLK_GEN_8_GENEN +#define CONF_GCLK_GEN_8_GENEN 0 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 8 division <0x0000-0xFFFF> +// gclk_gen_8_div +#ifndef CONF_GCLK_GEN_8_DIV +#define CONF_GCLK_GEN_8_DIV 1 +#endif +// +// + +// Generic clock generator 9 configuration +// Indicates whether generic clock 9 configuration is enabled or not +// enable_gclk_gen_9 +#ifndef CONF_GCLK_GENERATOR_9_CONFIG +#define CONF_GCLK_GENERATOR_9_CONFIG 0 +#endif + +// Generic Clock Generator Control +// Generic clock generator 9 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 9 +// gclk_gen_9_oscillator +#ifndef CONF_GCLK_GEN_9_SOURCE +#define CONF_GCLK_GEN_9_SOURCE GCLK_GENCTRL_SRC_XOSC1 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_9_runstdby +#ifndef CONF_GCLK_GEN_9_RUNSTDBY +#define CONF_GCLK_GEN_9_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_9_div_sel +#ifndef CONF_GCLK_GEN_9_DIVSEL +#define CONF_GCLK_GEN_9_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_9_oe +#ifndef CONF_GCLK_GEN_9_OE +#define CONF_GCLK_GEN_9_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_9_oov +#ifndef CONF_GCLK_GEN_9_OOV +#define CONF_GCLK_GEN_9_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_9_idc +#ifndef CONF_GCLK_GEN_9_IDC +#define CONF_GCLK_GEN_9_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_9_enable +#ifndef CONF_GCLK_GEN_9_GENEN +#define CONF_GCLK_GEN_9_GENEN 0 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 9 division <0x0000-0xFFFF> +// gclk_gen_9_div +#ifndef CONF_GCLK_GEN_9_DIV +#define CONF_GCLK_GEN_9_DIV 1 +#endif +// +// + +// Generic clock generator 10 configuration +// Indicates whether generic clock 10 configuration is enabled or not +// enable_gclk_gen_10 +#ifndef CONF_GCLK_GENERATOR_10_CONFIG +#define CONF_GCLK_GENERATOR_10_CONFIG 0 +#endif + +// Generic Clock Generator Control +// Generic clock generator 10 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 10 +// gclk_gen_10_oscillator +#ifndef CONF_GCLK_GEN_10_SOURCE +#define CONF_GCLK_GEN_10_SOURCE GCLK_GENCTRL_SRC_XOSC1 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_10_runstdby +#ifndef CONF_GCLK_GEN_10_RUNSTDBY +#define CONF_GCLK_GEN_10_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_10_div_sel +#ifndef CONF_GCLK_GEN_10_DIVSEL +#define CONF_GCLK_GEN_10_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_10_oe +#ifndef CONF_GCLK_GEN_10_OE +#define CONF_GCLK_GEN_10_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_10_oov +#ifndef CONF_GCLK_GEN_10_OOV +#define CONF_GCLK_GEN_10_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_10_idc +#ifndef CONF_GCLK_GEN_10_IDC +#define CONF_GCLK_GEN_10_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_10_enable +#ifndef CONF_GCLK_GEN_10_GENEN +#define CONF_GCLK_GEN_10_GENEN 0 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 10 division <0x0000-0xFFFF> +// gclk_gen_10_div +#ifndef CONF_GCLK_GEN_10_DIV +#define CONF_GCLK_GEN_10_DIV 1 +#endif +// +// + +// Generic clock generator 11 configuration +// Indicates whether generic clock 11 configuration is enabled or not +// enable_gclk_gen_11 +#ifndef CONF_GCLK_GENERATOR_11_CONFIG +#define CONF_GCLK_GENERATOR_11_CONFIG 0 +#endif + +// Generic Clock Generator Control +// Generic clock generator 11 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 11 +// gclk_gen_11_oscillator +#ifndef CONF_GCLK_GEN_11_SOURCE +#define CONF_GCLK_GEN_11_SOURCE GCLK_GENCTRL_SRC_XOSC1 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_11_runstdby +#ifndef CONF_GCLK_GEN_11_RUNSTDBY +#define CONF_GCLK_GEN_11_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_11_div_sel +#ifndef CONF_GCLK_GEN_11_DIVSEL +#define CONF_GCLK_GEN_11_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_11_oe +#ifndef CONF_GCLK_GEN_11_OE +#define CONF_GCLK_GEN_11_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_11_oov +#ifndef CONF_GCLK_GEN_11_OOV +#define CONF_GCLK_GEN_11_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_11_idc +#ifndef CONF_GCLK_GEN_11_IDC +#define CONF_GCLK_GEN_11_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_11_enable +#ifndef CONF_GCLK_GEN_11_GENEN +#define CONF_GCLK_GEN_11_GENEN 0 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 11 division <0x0000-0xFFFF> +// gclk_gen_11_div +#ifndef CONF_GCLK_GEN_11_DIV +#define CONF_GCLK_GEN_11_DIV 1 +#endif +// +// + +// <<< end of configuration section >>> + +#endif // HPL_GCLK_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same51/hpl_mclk_config.h b/ports/atmel-samd/asf4_conf/same51/hpl_mclk_config.h new file mode 100644 index 0000000000..a5a7de53c2 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same51/hpl_mclk_config.h @@ -0,0 +1,104 @@ +/* Auto-generated config file hpl_mclk_config.h */ +#ifndef HPL_MCLK_CONFIG_H +#define HPL_MCLK_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +#include + +// System Configuration +// Indicates whether configuration for system is enabled or not +// enable_cpu_clock +#ifndef CONF_SYSTEM_CONFIG +#define CONF_SYSTEM_CONFIG 1 +#endif + +// Basic settings +// CPU Clock source +// Generic clock generator 0 +// This defines the clock source for the CPU +// cpu_clock_source +#ifndef CONF_CPU_SRC +#define CONF_CPU_SRC GCLK_PCHCTRL_GEN_GCLK0_Val +#endif + +// CPU Clock Division Factor +// 1 +// 2 +// 4 +// 8 +// 16 +// 32 +// 64 +// 128 +// Prescalar for CPU clock +// cpu_div +#ifndef CONF_MCLK_CPUDIV +#define CONF_MCLK_CPUDIV MCLK_CPUDIV_DIV_DIV1_Val +#endif +// Low Power Clock Division +// Divide by 1 +// Divide by 2 +// Divide by 4 +// Divide by 8 +// Divide by 16 +// Divide by 32 +// Divide by 64 +// Divide by 128 +// mclk_arch_lpdiv +#ifndef CONF_MCLK_LPDIV +#define CONF_MCLK_LPDIV MCLK_LPDIV_LPDIV_DIV4_Val +#endif + +// Backup Clock Division +// Divide by 1 +// Divide by 2 +// Divide by 4 +// Divide by 8 +// Divide by 16 +// Divide by 32 +// Divide by 64 +// Divide by 128 +// mclk_arch_bupdiv +#ifndef CONF_MCLK_BUPDIV +#define CONF_MCLK_BUPDIV MCLK_BUPDIV_BUPDIV_DIV8_Val +#endif +// High-Speed Clock Division +// Divide by 1 +// mclk_arch_hsdiv +#ifndef CONF_MCLK_HSDIV +#define CONF_MCLK_HSDIV MCLK_HSDIV_DIV_DIV1_Val +#endif +// + +// NVM Settings +// NVM Wait States +// These bits select the number of wait states for a read operation. +// <0=> 0 +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 +// <8=> 8 +// <9=> 9 +// <10=> 10 +// <11=> 11 +// <12=> 12 +// <13=> 13 +// <14=> 14 +// <15=> 15 +// nvm_wait_states +#ifndef CONF_NVM_WAIT_STATE +#define CONF_NVM_WAIT_STATE 0 +#endif + +// + +// + +// <<< end of configuration section >>> + +#endif // HPL_MCLK_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same51/hpl_nvmctrl_config.h b/ports/atmel-samd/asf4_conf/same51/hpl_nvmctrl_config.h new file mode 100644 index 0000000000..53fcb593ab --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same51/hpl_nvmctrl_config.h @@ -0,0 +1,36 @@ +/* Auto-generated config file hpl_nvmctrl_config.h */ +#ifndef HPL_NVMCTRL_CONFIG_H +#define HPL_NVMCTRL_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Basic Settings + +// Power Reduction Mode During Sleep +// <0x00=> Wake On Access +// <0x01=> Wake Up Instant +// <0x03=> Disabled +// nvm_arch_sleepprm +#ifndef CONF_NVM_SLEEPPRM +#define CONF_NVM_SLEEPPRM 0 +#endif + +// AHB0 Cache Disable +// Indicate whether AHB0 cache is disable or not +// nvm_arch_cache0 +#ifndef CONF_NVM_CACHE0 +#define CONF_NVM_CACHE0 1 +#endif + +// AHB1 Cache Disable +// Indicate whether AHB1 cache is disable or not +// nvm_arch_cache1 +#ifndef CONF_NVM_CACHE1 +#define CONF_NVM_CACHE1 1 +#endif + +// + +// <<< end of configuration section >>> + +#endif // HPL_NVMCTRL_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same51/hpl_osc32kctrl_config.h b/ports/atmel-samd/asf4_conf/same51/hpl_osc32kctrl_config.h new file mode 100644 index 0000000000..d93cbf922e --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same51/hpl_osc32kctrl_config.h @@ -0,0 +1,163 @@ +/* Auto-generated config file hpl_osc32kctrl_config.h */ +#ifndef HPL_OSC32KCTRL_CONFIG_H +#define HPL_OSC32KCTRL_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// RTC Source configuration +// enable_rtc_source +#ifndef CONF_RTCCTRL_CONFIG +#define CONF_RTCCTRL_CONFIG 0 +#endif + +// RTC source control +// RTC Clock Source Selection +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// This defines the clock source for RTC +// rtc_source_oscillator +#ifndef CONF_RTCCTRL_SRC +#define CONF_RTCCTRL_SRC GCLK_GENCTRL_SRC_OSCULP32K +#endif + +// Use 1 kHz output +// rtc_1khz_selection +#ifndef CONF_RTCCTRL_1KHZ +#define CONF_RTCCTRL_1KHZ 1 +#endif + +#if CONF_RTCCTRL_SRC == GCLK_GENCTRL_SRC_OSCULP32K +#define CONF_RTCCTRL (CONF_RTCCTRL_1KHZ ? OSC32KCTRL_RTCCTRL_RTCSEL_ULP1K_Val : OSC32KCTRL_RTCCTRL_RTCSEL_ULP32K_Val) +#elif CONF_RTCCTRL_SRC == GCLK_GENCTRL_SRC_XOSC32K +#define CONF_RTCCTRL (CONF_RTCCTRL_1KHZ ? OSC32KCTRL_RTCCTRL_RTCSEL_XOSC1K_Val : OSC32KCTRL_RTCCTRL_RTCSEL_XOSC32K_Val) +#else +#error unexpected CONF_RTCCTRL_SRC +#endif + +// +// + +// 32kHz External Crystal Oscillator Configuration +// Indicates whether configuration for External 32K Osc is enabled or not +// enable_xosc32k +#ifndef CONF_XOSC32K_CONFIG +#define CONF_XOSC32K_CONFIG 1 +#endif + +// 32kHz External Crystal Oscillator Control +// Oscillator enable +// Indicates whether 32kHz External Crystal Oscillator is enabled or not +// xosc32k_arch_enable +#ifndef CONF_XOSC32K_ENABLE +#define CONF_XOSC32K_ENABLE 1 +#endif + +// Start-Up Time +// <0x0=>62592us +// <0x1=>125092us +// <0x2=>500092us +// <0x3=>1000092us +// <0x4=>2000092us +// <0x5=>4000092us +// <0x6=>8000092us +// xosc32k_arch_startup +#ifndef CONF_XOSC32K_STARTUP +#define CONF_XOSC32K_STARTUP 0x0 +#endif + +// On Demand Control +// Indicates whether On Demand Control is enabled or not +// xosc32k_arch_ondemand +#ifndef CONF_XOSC32K_ONDEMAND +#define CONF_XOSC32K_ONDEMAND 1 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// xosc32k_arch_runstdby +#ifndef CONF_XOSC32K_RUNSTDBY +#define CONF_XOSC32K_RUNSTDBY 0 +#endif + +// 1kHz Output Enable +// Indicates whether 1kHz Output is enabled or not +// xosc32k_arch_en1k +#ifndef CONF_XOSC32K_EN1K +#define CONF_XOSC32K_EN1K 0 +#endif + +// 32kHz Output Enable +// Indicates whether 32kHz Output is enabled or not +// xosc32k_arch_en32k +#ifndef CONF_XOSC32K_EN32K +#define CONF_XOSC32K_EN32K 0 +#endif + +// Clock Switch Back +// Indicates whether Clock Switch Back is enabled or not +// xosc32k_arch_swben +#ifndef CONF_XOSC32K_SWBEN +#define CONF_XOSC32K_SWBEN 0 +#endif + +// Clock Failure Detector +// Indicates whether Clock Failure Detector is enabled or not +// xosc32k_arch_cfden +#ifndef CONF_XOSC32K_CFDEN +#define CONF_XOSC32K_CFDEN 0 +#endif + +// Clock Failure Detector Event Out +// Indicates whether Clock Failure Detector Event Out is enabled or not +// xosc32k_arch_cfdeo +#ifndef CONF_XOSC32K_CFDEO +#define CONF_XOSC32K_CFDEO 0 +#endif + +// Crystal connected to XIN32/XOUT32 Enable +// Indicates whether the connections between the I/O pads and the external clock or crystal oscillator is enabled or not +// xosc32k_arch_xtalen +#ifndef CONF_XOSC32K_XTALEN +#define CONF_XOSC32K_XTALEN 0 +#endif + +// Control Gain Mode +// <0x0=>Low Power mode +// <0x1=>Standard mode +// <0x2=>High Speed mode +// xosc32k_arch_cgm +#ifndef CONF_XOSC32K_CGM +#define CONF_XOSC32K_CGM 0x1 +#endif + +// +// + +// 32kHz Ultra Low Power Internal Oscillator Configuration +// Indicates whether configuration for OSCULP32K is enabled or not +// enable_osculp32k +#ifndef CONF_OSCULP32K_CONFIG +#define CONF_OSCULP32K_CONFIG 1 +#endif + +// 32kHz Ultra Low Power Internal Oscillator Control + +// Oscillator Calibration Control +// Indicates whether Oscillator Calibration is enabled or not +// osculp32k_calib_enable +#ifndef CONF_OSCULP32K_CALIB_ENABLE +#define CONF_OSCULP32K_CALIB_ENABLE 0 +#endif + +// Oscillator Calibration <0x0-0x3F> +// osculp32k_calib +#ifndef CONF_OSCULP32K_CALIB +#define CONF_OSCULP32K_CALIB 0x0 +#endif + +// +// + +// <<< end of configuration section >>> + +#endif // HPL_OSC32KCTRL_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same51/hpl_oscctrl_config.h b/ports/atmel-samd/asf4_conf/same51/hpl_oscctrl_config.h new file mode 100644 index 0000000000..cd11866059 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same51/hpl_oscctrl_config.h @@ -0,0 +1,634 @@ +/* Auto-generated config file hpl_oscctrl_config.h */ +#ifndef HPL_OSCCTRL_CONFIG_H +#define HPL_OSCCTRL_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// External Multipurpose Crystal Oscillator Configuration +// Indicates whether configuration for XOSC0 is enabled or not +// enable_xosc0 +#ifndef CONF_XOSC0_CONFIG +#define CONF_XOSC0_CONFIG 0 +#endif + +// Frequency <8000000-48000000> +// Oscillation frequency of the resonator connected to the External Multipurpose Crystal Oscillator. +// xosc0_frequency +#ifndef CONF_XOSC_FREQUENCY +#define CONF_XOSC0_FREQUENCY 12000000 +#endif + +// External Multipurpose Crystal Oscillator Control +// Oscillator enable +// Indicates whether External Multipurpose Crystal Oscillator is enabled or not +// xosc0_arch_enable +#ifndef CONF_XOSC0_ENABLE +#define CONF_XOSC0_ENABLE 0 +#endif + +// Start-Up Time +// <0x0=>31us +// <0x1=>61us +// <0x2=>122us +// <0x3=>244us +// <0x4=>488us +// <0x5=>977us +// <0x6=>1953us +// <0x7=>3906us +// <0x8=>7813us +// <0x9=>15625us +// <0xA=>31250us +// <0xB=>62500us +// <0xC=>125000us +// <0xD=>250000us +// <0xE=>500000us +// <0xF=>1000000us +// xosc0_arch_startup +#ifndef CONF_XOSC0_STARTUP +#define CONF_XOSC0_STARTUP 0 +#endif + +// Clock Switch Back +// Indicates whether Clock Switch Back is enabled or not +// xosc0_arch_swben +#ifndef CONF_XOSC0_SWBEN +#define CONF_XOSC0_SWBEN 0 +#endif + +// Clock Failure Detector +// Indicates whether Clock Failure Detector is enabled or not +// xosc0_arch_cfden +#ifndef CONF_XOSC0_CFDEN +#define CONF_XOSC0_CFDEN 0 +#endif + +// Automatic Loop Control Enable +// Indicates whether Automatic Loop Control is enabled or not +// xosc0_arch_enalc +#ifndef CONF_XOSC0_ENALC +#define CONF_XOSC0_ENALC 0 +#endif + +// Low Buffer Gain Enable +// Indicates whether Low Buffer Gain is enabled or not +// xosc0_arch_lowbufgain +#ifndef CONF_XOSC0_LOWBUFGAIN +#define CONF_XOSC0_LOWBUFGAIN 0 +#endif + +// On Demand Control +// Indicates whether On Demand Control is enabled or not +// xosc0_arch_ondemand +#ifndef CONF_XOSC0_ONDEMAND +#define CONF_XOSC0_ONDEMAND 0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// xosc0_arch_runstdby +#ifndef CONF_XOSC0_RUNSTDBY +#define CONF_XOSC0_RUNSTDBY 0 +#endif + +// Crystal connected to XIN/XOUT Enable +// Indicates whether the connections between the I/O pads and the external clock or crystal oscillator is enabled or not +// xosc0_arch_xtalen +#ifndef CONF_XOSC0_XTALEN +#define CONF_XOSC0_XTALEN 0 +#endif +// +// + +#if CONF_XOSC0_FREQUENCY >= 32000000 +#define CONF_XOSC0_CFDPRESC 0x0 +#define CONF_XOSC0_IMULT 0x7 +#define CONF_XOSC0_IPTAT 0x3 +#elif CONF_XOSC0_FREQUENCY >= 24000000 +#define CONF_XOSC0_CFDPRESC 0x1 +#define CONF_XOSC0_IMULT 0x6 +#define CONF_XOSC0_IPTAT 0x3 +#elif CONF_XOSC0_FREQUENCY >= 16000000 +#define CONF_XOSC0_CFDPRESC 0x2 +#define CONF_XOSC0_IMULT 0x5 +#define CONF_XOSC0_IPTAT 0x3 +#elif CONF_XOSC0_FREQUENCY >= 8000000 +#define CONF_XOSC0_CFDPRESC 0x3 +#define CONF_XOSC0_IMULT 0x4 +#define CONF_XOSC0_IPTAT 0x3 +#endif + +// External Multipurpose Crystal Oscillator Configuration +// Indicates whether configuration for XOSC1 is enabled or not +// enable_xosc1 +#ifndef CONF_XOSC1_CONFIG +#define CONF_XOSC1_CONFIG 0 +#endif + +// Frequency <8000000-48000000> +// Oscillation frequency of the resonator connected to the External Multipurpose Crystal Oscillator. +// xosc1_frequency +#ifndef CONF_XOSC_FREQUENCY +#define CONF_XOSC1_FREQUENCY 12000000 +#endif + +// External Multipurpose Crystal Oscillator Control +// Oscillator enable +// Indicates whether External Multipurpose Crystal Oscillator is enabled or not +// xosc1_arch_enable +#ifndef CONF_XOSC1_ENABLE +#define CONF_XOSC1_ENABLE 0 +#endif + +// Start-Up Time +// <0x0=>31us +// <0x1=>61us +// <0x2=>122us +// <0x3=>244us +// <0x4=>488us +// <0x5=>977us +// <0x6=>1953us +// <0x7=>3906us +// <0x8=>7813us +// <0x9=>15625us +// <0xA=>31250us +// <0xB=>62500us +// <0xC=>125000us +// <0xD=>250000us +// <0xE=>500000us +// <0xF=>1000000us +// xosc1_arch_startup +#ifndef CONF_XOSC1_STARTUP +#define CONF_XOSC1_STARTUP 0 +#endif + +// Clock Switch Back +// Indicates whether Clock Switch Back is enabled or not +// xosc1_arch_swben +#ifndef CONF_XOSC1_SWBEN +#define CONF_XOSC1_SWBEN 0 +#endif + +// Clock Failure Detector +// Indicates whether Clock Failure Detector is enabled or not +// xosc1_arch_cfden +#ifndef CONF_XOSC1_CFDEN +#define CONF_XOSC1_CFDEN 0 +#endif + +// Automatic Loop Control Enable +// Indicates whether Automatic Loop Control is enabled or not +// xosc1_arch_enalc +#ifndef CONF_XOSC1_ENALC +#define CONF_XOSC1_ENALC 0 +#endif + +// Low Buffer Gain Enable +// Indicates whether Low Buffer Gain is enabled or not +// xosc1_arch_lowbufgain +#ifndef CONF_XOSC1_LOWBUFGAIN +#define CONF_XOSC1_LOWBUFGAIN 0 +#endif + +// On Demand Control +// Indicates whether On Demand Control is enabled or not +// xosc1_arch_ondemand +#ifndef CONF_XOSC1_ONDEMAND +#define CONF_XOSC1_ONDEMAND 0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// xosc1_arch_runstdby +#ifndef CONF_XOSC1_RUNSTDBY +#define CONF_XOSC1_RUNSTDBY 0 +#endif + +// Crystal connected to XIN/XOUT Enable +// Indicates whether the connections between the I/O pads and the external clock or crystal oscillator is enabled or not +// xosc1_arch_xtalen +#ifndef CONF_XOSC1_XTALEN +#define CONF_XOSC1_XTALEN 0 +#endif +// +// + +#if CONF_XOSC1_FREQUENCY >= 32000000 +#define CONF_XOSC1_CFDPRESC 0x0 +#define CONF_XOSC1_IMULT 0x7 +#define CONF_XOSC1_IPTAT 0x3 +#elif CONF_XOSC1_FREQUENCY >= 24000000 +#define CONF_XOSC1_CFDPRESC 0x1 +#define CONF_XOSC1_IMULT 0x6 +#define CONF_XOSC1_IPTAT 0x3 +#elif CONF_XOSC1_FREQUENCY >= 16000000 +#define CONF_XOSC1_CFDPRESC 0x2 +#define CONF_XOSC1_IMULT 0x5 +#define CONF_XOSC1_IPTAT 0x3 +#elif CONF_XOSC1_FREQUENCY >= 8000000 +#define CONF_XOSC1_CFDPRESC 0x3 +#define CONF_XOSC1_IMULT 0x4 +#define CONF_XOSC1_IPTAT 0x3 +#endif + +// DFLL Configuration +// Indicates whether configuration for DFLL is enabled or not +// enable_dfll +#ifndef CONF_DFLL_CONFIG +#define CONF_DFLL_CONFIG 0 +#endif + +// Reference Clock Source +// Generic clock generator 0 +// Generic clock generator 1 +// Generic clock generator 2 +// Generic clock generator 3 +// Generic clock generator 4 +// Generic clock generator 5 +// Generic clock generator 6 +// Generic clock generator 7 +// Generic clock generator 8 +// Generic clock generator 9 +// Generic clock generator 10 +// Generic clock generator 11 +// Select the clock source +// dfll_ref_clock +#ifndef CONF_DFLL_GCLK +#define CONF_DFLL_GCLK GCLK_PCHCTRL_GEN_GCLK3_Val +#endif + +// Digital Frequency Locked Loop Control +// DFLL Enable +// Indicates whether DFLL is enabled or not +// dfll_arch_enable +#ifndef CONF_DFLL_ENABLE +#define CONF_DFLL_ENABLE 1 +#endif + +// On Demand Control +// Indicates whether On Demand Control is enabled or not +// dfll_arch_ondemand +#ifndef CONF_DFLL_ONDEMAND +#define CONF_DFLL_ONDEMAND 0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// dfll_arch_runstdby +#ifndef CONF_DFLL_RUNSTDBY +#define CONF_DFLL_RUNSTDBY 0 +#endif + +// USB Clock Recovery Mode +// Indicates whether USB Clock Recovery Mode is enabled or not +// dfll_arch_usbcrm +#ifndef CONF_DFLL_USBCRM +#define CONF_DFLL_USBCRM 1 +#endif + +// Wait Lock +// Indicates whether Wait Lock is enabled or not +// dfll_arch_waitlock +#ifndef CONF_DFLL_WAITLOCK +#define CONF_DFLL_WAITLOCK 1 +#endif + +// Bypass Coarse Lock +// Indicates whether Bypass Coarse Lock is enabled or not +// dfll_arch_bplckc +#ifndef CONF_DFLL_BPLCKC +#define CONF_DFLL_BPLCKC 0 +#endif + +// Quick Lock Disable +// Indicates whether Quick Lock Disable is enabled or not +// dfll_arch_qldis +#ifndef CONF_DFLL_QLDIS +#define CONF_DFLL_QLDIS 0 +#endif + +// Chill Cycle Disable +// Indicates whether Chill Cycle Disable is enabled or not +// dfll_arch_ccdis +#ifndef CONF_DFLL_CCDIS +#define CONF_DFLL_CCDIS 1 +#endif + +// Lose Lock After Wake +// Indicates whether Lose Lock After Wake is enabled or not +// dfll_arch_llaw +#ifndef CONF_DFLL_LLAW +#define CONF_DFLL_LLAW 0 +#endif + +// Stable DFLL Frequency +// Indicates whether Stable DFLL Frequency is enabled or not +// dfll_arch_stable +#ifndef CONF_DFLL_STABLE +#define CONF_DFLL_STABLE 0 +#endif + +// Operating Mode Selection +// <0=>Open Loop Mode +// <1=>Closed Loop Mode +// dfll_mode +#ifndef CONF_DFLL_MODE +#define CONF_DFLL_MODE 0x0 +#endif + +// Coarse Maximum Step <0x0-0x1F> +// dfll_arch_cstep +#ifndef CONF_DFLL_CSTEP +#define CONF_DFLL_CSTEP 0x1 +#endif + +// Fine Maximum Step <0x0-0xFF> +// dfll_arch_fstep +#ifndef CONF_DFLL_FSTEP +#define CONF_DFLL_FSTEP 0x1 +#endif + +// DFLL Multiply Factor <0x0-0xFFFF> +// dfll_mul +#ifndef CONF_DFLL_MUL +#define CONF_DFLL_MUL 0x0 +#endif + +// DFLL Calibration Overwrite +// Indicates whether Overwrite Calibration value of DFLL +// dfll_arch_calibration +#ifndef CONF_DFLL_OVERWRITE_CALIBRATION +#define CONF_DFLL_OVERWRITE_CALIBRATION 0 +#endif + +// Coarse Value <0x0-0x3F> +// dfll_arch_coarse +#ifndef CONF_DFLL_COARSE +#define CONF_DFLL_COARSE (0x1f / 4) +#endif + +// Fine Value <0x0-0xFF> +// dfll_arch_fine +#ifndef CONF_DFLL_FINE +#define CONF_DFLL_FINE (0x80) +#endif + +// + +// + +// + +// FDPLL0 Configuration +// Indicates whether configuration for FDPLL0 is enabled or not +// enable_fdpll0 +#ifndef CONF_FDPLL0_CONFIG +#define CONF_FDPLL0_CONFIG 1 +#endif + +// Reference Clock Source +// 32kHz External Crystal Oscillator (XOSC32K) +// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator 0 +// Generic clock generator 1 +// Generic clock generator 2 +// Generic clock generator 3 +// Generic clock generator 4 +// Generic clock generator 5 +// Generic clock generator 6 +// Generic clock generator 7 +// Generic clock generator 8 +// Generic clock generator 9 +// Generic clock generator 10 +// Generic clock generator 11 +// Select the clock source. +// fdpll0_ref_clock +#ifndef CONF_FDPLL0_GCLK +#define CONF_FDPLL0_GCLK GCLK_PCHCTRL_GEN_GCLK5_Val +#endif + +// Digital Phase Locked Loop Control +// Enable +// Indicates whether Digital Phase Locked Loop is enabled or not +// fdpll0_arch_enable +#ifndef CONF_FDPLL0_ENABLE +#define CONF_FDPLL0_ENABLE 1 +#endif + +// On Demand Control +// Indicates whether On Demand Control is enabled or not +// fdpll0_arch_ondemand +#ifndef CONF_FDPLL0_ONDEMAND +#define CONF_FDPLL0_ONDEMAND 0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// fdpll0_arch_runstdby +#ifndef CONF_FDPLL0_RUNSTDBY +#define CONF_FDPLL0_RUNSTDBY 0 +#endif + +// Loop Divider Ratio Fractional Part <0x0-0x1F> +// fdpll0_ldrfrac +#ifndef CONF_FDPLL0_LDRFRAC +#define CONF_FDPLL0_LDRFRAC 0x0 +#endif + +// Loop Divider Ratio Integer Part <0x0-0x1FFF> +// fdpll0_ldr +#ifndef CONF_FDPLL0_LDR +#define CONF_FDPLL0_LDR 59 +#endif + +// Clock Divider <0x0-0x7FF> +// fdpll0_clock_div +#ifndef CONF_FDPLL0_DIV +#define CONF_FDPLL0_DIV 0x0 +#endif + +// DCO Filter Enable +// Indicates whether DCO Filter Enable is enabled or not +// fdpll0_arch_dcoen +#ifndef CONF_FDPLL0_DCOEN +#define CONF_FDPLL0_DCOEN 0 +#endif + +// Sigma-Delta DCO Filter Selection <0x0-0x7> +// fdpll0_clock_dcofilter +#ifndef CONF_FDPLL0_DCOFILTER +#define CONF_FDPLL0_DCOFILTER 0x0 +#endif + +// Lock Bypass +// Indicates whether Lock Bypass is enabled or not +// fdpll0_arch_lbypass +#ifndef CONF_FDPLL0_LBYPASS +#define CONF_FDPLL0_LBYPASS 0 +#endif + +// Lock Time +// <0x0=>No time-out, automatic lock +// <0x4=>The Time-out if no lock within 800 us +// <0x5=>The Time-out if no lock within 900 us +// <0x6=>The Time-out if no lock within 1 ms +// <0x7=>The Time-out if no lock within 11 ms +// fdpll0_arch_ltime +#ifndef CONF_FDPLL0_LTIME +#define CONF_FDPLL0_LTIME 0x0 +#endif + +// Reference Clock Selection +// <0x0=>GCLK clock reference +// <0x1=>XOSC32K clock reference +// <0x2=>XOSC0 clock reference +// <0x3=>XOSC1 clock reference +// fdpll0_arch_refclk +#ifndef CONF_FDPLL0_REFCLK +#define CONF_FDPLL0_REFCLK 0x0 +#endif + +// Wake Up Fast +// Indicates whether Wake Up Fast is enabled or not +// fdpll0_arch_wuf +#ifndef CONF_FDPLL0_WUF +#define CONF_FDPLL0_WUF 0 +#endif + +// Proportional Integral Filter Selection <0x0-0xF> +// fdpll0_arch_filter +#ifndef CONF_FDPLL0_FILTER +#define CONF_FDPLL0_FILTER 0x0 +#endif + +// +// +// FDPLL1 Configuration +// Indicates whether configuration for FDPLL1 is enabled or not +// enable_fdpll1 +#ifndef CONF_FDPLL1_CONFIG +#define CONF_FDPLL1_CONFIG 0 +#endif + +// Reference Clock Source +// 32kHz External Crystal Oscillator (XOSC32K) +// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator 0 +// Generic clock generator 1 +// Generic clock generator 2 +// Generic clock generator 3 +// Generic clock generator 4 +// Generic clock generator 5 +// Generic clock generator 6 +// Generic clock generator 7 +// Generic clock generator 8 +// Generic clock generator 9 +// Generic clock generator 10 +// Generic clock generator 11 +// Select the clock source. +// fdpll1_ref_clock +#ifndef CONF_FDPLL1_GCLK +#define CONF_FDPLL1_GCLK GCLK_GENCTRL_SRC_XOSC32K +#endif + +// Digital Phase Locked Loop Control +// Enable +// Indicates whether Digital Phase Locked Loop is enabled or not +// fdpll1_arch_enable +#ifndef CONF_FDPLL1_ENABLE +#define CONF_FDPLL1_ENABLE 0 +#endif + +// On Demand Control +// Indicates whether On Demand Control is enabled or not +// fdpll1_arch_ondemand +#ifndef CONF_FDPLL1_ONDEMAND +#define CONF_FDPLL1_ONDEMAND 0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// fdpll1_arch_runstdby +#ifndef CONF_FDPLL1_RUNSTDBY +#define CONF_FDPLL1_RUNSTDBY 0 +#endif + +// Loop Divider Ratio Fractional Part <0x0-0x1F> +// fdpll1_ldrfrac +#ifndef CONF_FDPLL1_LDRFRAC +#define CONF_FDPLL1_LDRFRAC 0xd +#endif + +// Loop Divider Ratio Integer Part <0x0-0x1FFF> +// fdpll1_ldr +#ifndef CONF_FDPLL1_LDR +#define CONF_FDPLL1_LDR 0x5b7 +#endif + +// Clock Divider <0x0-0x7FF> +// fdpll1_clock_div +#ifndef CONF_FDPLL1_DIV +#define CONF_FDPLL1_DIV 0x0 +#endif + +// DCO Filter Enable +// Indicates whether DCO Filter Enable is enabled or not +// fdpll1_arch_dcoen +#ifndef CONF_FDPLL1_DCOEN +#define CONF_FDPLL1_DCOEN 0 +#endif + +// Sigma-Delta DCO Filter Selection <0x0-0x7> +// fdpll1_clock_dcofilter +#ifndef CONF_FDPLL1_DCOFILTER +#define CONF_FDPLL1_DCOFILTER 0x0 +#endif + +// Lock Bypass +// Indicates whether Lock Bypass is enabled or not +// fdpll1_arch_lbypass +#ifndef CONF_FDPLL1_LBYPASS +#define CONF_FDPLL1_LBYPASS 0 +#endif + +// Lock Time +// <0x0=>No time-out, automatic lock +// <0x4=>The Time-out if no lock within 800 us +// <0x5=>The Time-out if no lock within 900 us +// <0x6=>The Time-out if no lock within 1 ms +// <0x7=>The Time-out if no lock within 11 ms +// fdpll1_arch_ltime +#ifndef CONF_FDPLL1_LTIME +#define CONF_FDPLL1_LTIME 0x0 +#endif + +// Reference Clock Selection +// <0x0=>GCLK clock reference +// <0x1=>XOSC32K clock reference +// <0x2=>XOSC0 clock reference +// <0x3=>XOSC1 clock reference +// fdpll1_arch_refclk +#ifndef CONF_FDPLL1_REFCLK +#define CONF_FDPLL1_REFCLK 0x1 +#endif + +// Wake Up Fast +// Indicates whether Wake Up Fast is enabled or not +// fdpll1_arch_wuf +#ifndef CONF_FDPLL1_WUF +#define CONF_FDPLL1_WUF 0 +#endif + +// Proportional Integral Filter Selection <0x0-0xF> +// fdpll1_arch_filter +#ifndef CONF_FDPLL1_FILTER +#define CONF_FDPLL1_FILTER 0x0 +#endif + +// +// + +// <<< end of configuration section >>> + +#endif // HPL_OSCCTRL_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same51/hpl_rtc_config.h b/ports/atmel-samd/asf4_conf/same51/hpl_rtc_config.h new file mode 100644 index 0000000000..2b0b6712e6 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same51/hpl_rtc_config.h @@ -0,0 +1,145 @@ +/* Auto-generated config file hpl_rtc_config.h */ +#ifndef HPL_RTC_CONFIG_H +#define HPL_RTC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Basic settings + +#ifndef CONF_RTC_ENABLE +#define CONF_RTC_ENABLE 1 +#endif + +// Force reset RTC on initialization +// Force RTC to reset on initialization. +// Note that the previous power down data in RTC is lost if it's enabled. +// rtc_arch_init_reset +#ifndef CONF_RTC_INIT_RESET +#define CONF_RTC_INIT_RESET 0 +#endif + +// Prescaler configuration +// <0x0=>OFF(Peripheral clock divided by 1) +// <0x1=>Peripheral clock divided by 1 +// <0x2=>Peripheral clock divided by 2 +// <0x3=>Peripheral clock divided by 4 +// <0x4=>Peripheral clock divided by 8 +// <0x5=>Peripheral clock divided by 16 +// <0x6=>Peripheral clock divided by 32 +// <0x7=>Peripheral clock divided by 64 +// <0x8=>Peripheral clock divided by 128 +// <0x9=>Peripheral clock divided by 256 +// <0xA=>Peripheral clock divided by 512 +// <0xB=>Peripheral clock divided by 1024 +// These bits define the RTC clock relative to the peripheral clock +// rtc_arch_prescaler +#ifndef CONF_RTC_PRESCALER +#define CONF_RTC_PRESCALER 0xb + +#endif + +// Compare Value <1-4294967295> +// These bits define the RTC Compare value, the ticks period is equal to reciprocal of (rtc clock/prescaler/compare value), +// by default 1K clock input, 1 prescaler, 1 compare value, the ticks period equals to 1ms. +// rtc_arch_comp_val + +#ifndef CONF_RTC_COMP_VAL +#define CONF_RTC_COMP_VAL 1 + +#endif + +// Event control +// rtc_event_control +#ifndef CONF_RTC_EVENT_CONTROL_ENABLE +#define CONF_RTC_EVENT_CONTROL_ENABLE 0 +#endif + +// Periodic Interval 0 Event Output +// This bit indicates whether Periodic interval 0 event is enabled and will be generated +// rtc_pereo0 +#ifndef CONF_RTC_PEREO0 +#define CONF_RTC_PEREO0 0 +#endif +// Periodic Interval 1 Event Output +// This bit indicates whether Periodic interval 1 event is enabled and will be generated +// rtc_pereo1 +#ifndef CONF_RTC_PEREO1 +#define CONF_RTC_PEREO1 0 +#endif +// Periodic Interval 2 Event Output +// This bit indicates whether Periodic interval 2 event is enabled and will be generated +// rtc_pereo2 +#ifndef CONF_RTC_PEREO2 +#define CONF_RTC_PEREO2 0 +#endif +// Periodic Interval 3 Event Output +// This bit indicates whether Periodic interval 3 event is enabled and will be generated +// rtc_pereo3 +#ifndef CONF_RTC_PEREO3 +#define CONF_RTC_PEREO3 0 +#endif +// Periodic Interval 4 Event Output +// This bit indicates whether Periodic interval 4 event is enabled and will be generated +// rtc_pereo4 +#ifndef CONF_RTC_PEREO4 +#define CONF_RTC_PEREO4 0 +#endif +// Periodic Interval 5 Event Output +// This bit indicates whether Periodic interval 5 event is enabled and will be generated +// rtc_pereo5 +#ifndef CONF_RTC_PEREO5 +#define CONF_RTC_PEREO5 0 +#endif +// Periodic Interval 6 Event Output +// This bit indicates whether Periodic interval 6 event is enabled and will be generated +// rtc_pereo6 +#ifndef CONF_RTC_PEREO6 +#define CONF_RTC_PEREO6 0 +#endif +// Periodic Interval 7 Event Output +// This bit indicates whether Periodic interval 7 event is enabled and will be generated +// rtc_pereo7 +#ifndef CONF_RTC_PEREO7 +#define CONF_RTC_PEREO7 0 +#endif + +// Compare 0 Event Output +// This bit indicates whether Compare O event is enabled and will be generated +// rtc_cmpeo0 +#ifndef CONF_RTC_COMPE0 +#define CONF_RTC_COMPE0 0 +#endif + +// Compare 1 Event Output +// This bit indicates whether Compare 1 event is enabled and will be generated +// rtc_cmpeo1 +#ifndef CONF_RTC_COMPE1 +#define CONF_RTC_COMPE1 0 +#endif +// Overflow Event Output +// This bit indicates whether Overflow event is enabled and will be generated +// rtc_ovfeo +#ifndef CONF_RTC_OVFEO +#define CONF_RTC_OVFEO 0 +#endif + +// Tamper Event Output +// This bit indicates whether Tamper event output is enabled and will be generated +// rtc_tampereo +#ifndef CONF_RTC_TAMPEREO +#define CONF_RTC_TAMPEREO 0 +#endif + +// Tamper Event Input +// This bit indicates whether Tamper event input is enabled and will be generated +// rtc_tampevei +#ifndef CONF_RTC_TAMPEVEI +#define CONF_RTC_TAMPEVEI 0 +#endif +// + +// + +// <<< end of configuration section >>> + +#endif // HPL_RTC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same51/hpl_sdhc_config.h b/ports/atmel-samd/asf4_conf/same51/hpl_sdhc_config.h new file mode 100644 index 0000000000..daa6620517 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same51/hpl_sdhc_config.h @@ -0,0 +1,24 @@ +/* Auto-generated config file hpl_sdhc_config.h */ +#ifndef HPL_SDHC_CONFIG_H +#define HPL_SDHC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +#include "peripheral_clk_config.h" + +#ifndef CONF_BASE_FREQUENCY +#define CONF_BASE_FREQUENCY CONF_SDHC0_FREQUENCY +#endif + +// Clock Generator Select +// <0=> Divided Clock mode +// <1=> Programmable Clock mode +// This defines the clock generator mode in the SDCLK Frequency Select field +// sdhc_clk_gsel +#ifndef CONF_SDHC0_CLK_GEN_SEL +#define CONF_SDHC0_CLK_GEN_SEL 0 +#endif + +// <<< end of configuration section >>> + +#endif // HPL_SDHC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same51/hpl_sercom_config.h b/ports/atmel-samd/asf4_conf/same51/hpl_sercom_config.h new file mode 100644 index 0000000000..cd411154c7 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same51/hpl_sercom_config.h @@ -0,0 +1,751 @@ +// For CircuitPython, use SERCOM settings as prototypes to set +// the default settings. This file defines these SERCOMs +// +// SERCOM0: SPI with hal_spi_m_sync.c driver: spi master synchronous +// SERCOM1: I2C with hal_i2c_m_sync.c driver: i2c master synchronous +// SERCOM2: USART with hal_usart_async.c driver: usart asynchronous +// SERCOM3: SPI with hal_spi_m_dma.c: spi master DMA + +#define PROTOTYPE_SERCOM_SPI_M_SYNC SERCOM0 +#define PROTOTYPE_SERCOM_SPI_M_SYNC_CLOCK_FREQUENCY CONF_GCLK_SERCOM0_CORE_FREQUENCY + +#define PROTOTYPE_SERCOM_I2CM_SYNC SERCOM1 + +#define PROTOTYPE_SERCOM_USART_ASYNC SERCOM2 +#define PROTOTYPE_SERCOM_USART_ASYNC_CLOCK_FREQUENCY CONF_GCLK_SERCOM2_CORE_FREQUENCY + +/* Auto-generated config file hpl_sercom_config.h */ +#ifndef HPL_SERCOM_CONFIG_H +#define HPL_SERCOM_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +#include + +// Enable configuration of module +#ifndef CONF_SERCOM_0_SPI_ENABLE +#define CONF_SERCOM_0_SPI_ENABLE 1 +#endif + +// Set module in SPI Master mode +#ifndef CONF_SERCOM_0_SPI_MODE +#define CONF_SERCOM_0_SPI_MODE 0x03 +#endif + +// Basic Configuration + +// Receive buffer enable +// Enable receive buffer to receive data from slave (RXEN) +// spi_master_rx_enable +#ifndef CONF_SERCOM_0_SPI_RXEN +#define CONF_SERCOM_0_SPI_RXEN 0x1 +#endif + +// Character Size +// Bit size for all characters sent over the SPI bus (CHSIZE) +// <0x0=>8 bits +// <0x1=>9 bits +// spi_master_character_size +#ifndef CONF_SERCOM_0_SPI_CHSIZE +#define CONF_SERCOM_0_SPI_CHSIZE 0x0 +#endif + +// Baud rate <1-12000000> +// The SPI data transfer rate +// spi_master_baud_rate +#ifndef CONF_SERCOM_0_SPI_BAUD +#define CONF_SERCOM_0_SPI_BAUD 50000 +#endif + +// + +// Advanced Configuration +// spi_master_advanced +#ifndef CONF_SERCOM_0_SPI_ADVANCED +#define CONF_SERCOM_0_SPI_ADVANCED 1 +#endif + +// Dummy byte <0x00-0x1ff> +// spi_master_dummybyte +// Dummy byte used when reading data from the slave without sending any data +#ifndef CONF_SERCOM_0_SPI_DUMMYBYTE +#define CONF_SERCOM_0_SPI_DUMMYBYTE 0x1ff +#endif + +// Data Order +// <0=>MSB first +// <1=>LSB first +// I least significant or most significant bit is shifted out first (DORD) +// spi_master_arch_dord +#ifndef CONF_SERCOM_0_SPI_DORD +#define CONF_SERCOM_0_SPI_DORD 0x0 +#endif + +// Clock Polarity +// <0=>SCK is low when idle +// <1=>SCK is high when idle +// Determines if the leading edge is rising or falling with a corresponding opposite edge at the trailing edge. (CPOL) +// spi_master_arch_cpol +#ifndef CONF_SERCOM_0_SPI_CPOL +#define CONF_SERCOM_0_SPI_CPOL 0x0 +#endif + +// Clock Phase +// <0x0=>Sample input on leading edge +// <0x1=>Sample input on trailing edge +// Determines if input data is sampled on leading or trailing SCK edge. (CPHA) +// spi_master_arch_cpha +#ifndef CONF_SERCOM_0_SPI_CPHA +#define CONF_SERCOM_0_SPI_CPHA 0x0 +#endif + +// Immediate Buffer Overflow Notification +// Controls when OVF is asserted (IBON) +// <0x0=>In data stream +// <0x1=>On buffer overflow +// spi_master_arch_ibon +#ifndef CONF_SERCOM_0_SPI_IBON +#define CONF_SERCOM_0_SPI_IBON 0x0 +#endif + +// Run in stand-by +// Module stays active in stand-by sleep mode. (RUNSTDBY) +// spi_master_arch_runstdby +#ifndef CONF_SERCOM_0_SPI_RUNSTDBY +#define CONF_SERCOM_0_SPI_RUNSTDBY 0x0 +#endif + +// Debug Stop Mode +// Behavior of the baud-rate generator when CPU is halted by external debugger. (DBGSTOP) +// <0=>Keep running +// <1=>Halt +// spi_master_arch_dbgstop +#ifndef CONF_SERCOM_0_SPI_DBGSTOP +#define CONF_SERCOM_0_SPI_DBGSTOP 0 +#endif + +// + +// Address mode disabled in master mode +#ifndef CONF_SERCOM_0_SPI_AMODE_EN +#define CONF_SERCOM_0_SPI_AMODE_EN 0 +#endif + +#ifndef CONF_SERCOM_0_SPI_AMODE +#define CONF_SERCOM_0_SPI_AMODE 0 +#endif + +#ifndef CONF_SERCOM_0_SPI_ADDR +#define CONF_SERCOM_0_SPI_ADDR 0 +#endif + +#ifndef CONF_SERCOM_0_SPI_ADDRMASK +#define CONF_SERCOM_0_SPI_ADDRMASK 0 +#endif + +#ifndef CONF_SERCOM_0_SPI_SSDE +#define CONF_SERCOM_0_SPI_SSDE 0 +#endif + +#ifndef CONF_SERCOM_0_SPI_MSSEN +#define CONF_SERCOM_0_SPI_MSSEN 0x0 +#endif + +#ifndef CONF_SERCOM_0_SPI_PLOADEN +#define CONF_SERCOM_0_SPI_PLOADEN 0 +#endif + +// Receive Data Pinout +// <0x0=>PAD[0] +// <0x1=>PAD[1] +// <0x2=>PAD[2] +// <0x3=>PAD[3] +// spi_master_rxpo +#ifndef CONF_SERCOM_0_SPI_RXPO +#define CONF_SERCOM_0_SPI_RXPO 2 +#endif + +// Transmit Data Pinout +// <0x0=>PAD[0,1]_DO_SCK +// <0x1=>PAD[2,3]_DO_SCK +// <0x2=>PAD[3,1]_DO_SCK +// <0x3=>PAD[0,3]_DO_SCK +// spi_master_txpo +#ifndef CONF_SERCOM_0_SPI_TXPO +#define CONF_SERCOM_0_SPI_TXPO 0 +#endif + +// Calculate baud register value from requested baudrate value +#ifndef CONF_SERCOM_0_SPI_BAUD_RATE +#define CONF_SERCOM_0_SPI_BAUD_RATE ((float)CONF_GCLK_SERCOM0_CORE_FREQUENCY / (float)(2 * CONF_SERCOM_0_SPI_BAUD)) - 1 +#endif + +#include + +#ifndef SERCOM_I2CM_CTRLA_MODE_I2C_MASTER +#define SERCOM_I2CM_CTRLA_MODE_I2C_MASTER (5 << 2) +#endif + +#ifndef CONF_SERCOM_1_I2CM_ENABLE +#define CONF_SERCOM_1_I2CM_ENABLE 1 +#endif + +// Basic + +// I2C Bus clock speed (Hz) <1-400000> +// I2C Bus clock (SCL) speed measured in Hz +// i2c_master_baud_rate +#ifndef CONF_SERCOM_1_I2CM_BAUD +#define CONF_SERCOM_1_I2CM_BAUD 100000 +#endif + +// + +// Advanced +// i2c_master_advanced +#ifndef CONF_SERCOM_1_I2CM_ADVANCED_CONFIG +#define CONF_SERCOM_1_I2CM_ADVANCED_CONFIG 1 +#endif + +// TRise (ns) <0-300> +// Determined by the bus impedance, check electric characteristics in the datasheet +// Standard Fast Mode: typical 215ns, max 300ns +// Fast Mode +: typical 60ns, max 100ns +// High Speed Mode: typical 20ns, max 40ns +// i2c_master_arch_trise + +#ifndef CONF_SERCOM_1_I2CM_TRISE +#define CONF_SERCOM_1_I2CM_TRISE 215 +#endif + +// Master SCL Low Extended Time-Out (MEXTTOEN) +// This enables the master SCL low extend time-out +// i2c_master_arch_mexttoen +#ifndef CONF_SERCOM_1_I2CM_MEXTTOEN +#define CONF_SERCOM_1_I2CM_MEXTTOEN 0 +#endif + +// Slave SCL Low Extend Time-Out (SEXTTOEN) +// Enables the slave SCL low extend time-out. If SCL is cumulatively held low for greater than 25ms from the initial START to a STOP, the slave will release its clock hold if enabled and reset the internal state machine +// i2c_master_arch_sexttoen +#ifndef CONF_SERCOM_1_I2CM_SEXTTOEN +#define CONF_SERCOM_1_I2CM_SEXTTOEN 0 +#endif + +// SCL Low Time-Out (LOWTOUT) +// Enables SCL low time-out. If SCL is held low for 25ms-35ms, the master will release it's clock hold +// i2c_master_arch_lowtout +#ifndef CONF_SERCOM_1_I2CM_LOWTOUT +#define CONF_SERCOM_1_I2CM_LOWTOUT 0 +#endif + +// Inactive Time-Out (INACTOUT) +// <0x0=>Disabled +// <0x1=>5-6 SCL cycle time-out(50-60us) +// <0x2=>10-11 SCL cycle time-out(100-110us) +// <0x3=>20-21 SCL cycle time-out(200-210us) +// Defines if inactivity time-out should be enabled, and how long the time-out should be +// i2c_master_arch_inactout +#ifndef CONF_SERCOM_1_I2CM_INACTOUT +#define CONF_SERCOM_1_I2CM_INACTOUT 0x0 +#endif + +// SDA Hold Time (SDAHOLD) +// <0=>Disabled +// <1=>50-100ns hold time +// <2=>300-600ns hold time +// <3=>400-800ns hold time +// Defines the SDA hold time with respect to the negative edge of SCL +// i2c_master_arch_sdahold +#ifndef CONF_SERCOM_1_I2CM_SDAHOLD +#define CONF_SERCOM_1_I2CM_SDAHOLD 0x2 +#endif + +// Run in stand-by +// Determine if the module shall run in standby sleep mode +// i2c_master_arch_runstdby +#ifndef CONF_SERCOM_1_I2CM_RUNSTDBY +#define CONF_SERCOM_1_I2CM_RUNSTDBY 0 +#endif + +// Debug Stop Mode +// Behavior of the baud-rate generator when CPU is halted by external debugger. +// <0=>Keep running +// <1=>Halt +// i2c_master_arch_dbgstop +#ifndef CONF_SERCOM_1_I2CM_DEBUG_STOP_MODE +#define CONF_SERCOM_1_I2CM_DEBUG_STOP_MODE 0 +#endif + +// + +#ifndef CONF_SERCOM_1_I2CM_SPEED +#define CONF_SERCOM_1_I2CM_SPEED 0x00 // Speed: Standard/Fast mode +#endif +#if CONF_SERCOM_1_I2CM_TRISE < 215 || CONF_SERCOM_1_I2CM_TRISE > 300 +#warning Bad I2C Rise time for Standard/Fast mode, reset to 215ns +#undef CONF_SERCOM_1_I2CM_TRISE +#define CONF_SERCOM_1_I2CM_TRISE 215 +#endif + +// gclk_freq - (i2c_scl_freq * 10) - (gclk_freq * i2c_scl_freq * Trise) +// BAUD + BAUDLOW = -------------------------------------------------------------------- +// i2c_scl_freq +// BAUD: register value low [7:0] +// BAUDLOW: register value high [15:8], only used for odd BAUD + BAUDLOW +#define CONF_SERCOM_1_I2CM_BAUD_BAUDLOW \ + (((CONF_GCLK_SERCOM1_CORE_FREQUENCY - (CONF_SERCOM_1_I2CM_BAUD * 10) \ + - (CONF_SERCOM_1_I2CM_TRISE * (CONF_SERCOM_1_I2CM_BAUD / 100) * (CONF_GCLK_SERCOM1_CORE_FREQUENCY / 10000) \ + / 1000)) \ + * 10 \ + + 5) \ + / (CONF_SERCOM_1_I2CM_BAUD * 10)) +#ifndef CONF_SERCOM_1_I2CM_BAUD_RATE +#if CONF_SERCOM_1_I2CM_BAUD_BAUDLOW > (0xFF * 2) +#warning Requested I2C baudrate too low, please check +#define CONF_SERCOM_1_I2CM_BAUD_RATE 0xFF +#elif CONF_SERCOM_1_I2CM_BAUD_BAUDLOW <= 1 +#warning Requested I2C baudrate too high, please check +#define CONF_SERCOM_1_I2CM_BAUD_RATE 1 +#else +#define CONF_SERCOM_1_I2CM_BAUD_RATE \ + ((CONF_SERCOM_1_I2CM_BAUD_BAUDLOW & 0x1) \ + ? (CONF_SERCOM_1_I2CM_BAUD_BAUDLOW / 2) + ((CONF_SERCOM_1_I2CM_BAUD_BAUDLOW / 2 + 1) << 8) \ + : (CONF_SERCOM_1_I2CM_BAUD_BAUDLOW / 2)) +#endif +#endif + +#include + +#ifndef CONF_SERCOM_2_USART_ENABLE +#define CONF_SERCOM_2_USART_ENABLE 1 +#endif + +// Basic Configuration + +// Receive buffer enable +// Enable input buffer in SERCOM module +// usart_rx_enable +#ifndef CONF_SERCOM_2_USART_RXEN +#define CONF_SERCOM_2_USART_RXEN 1 +#endif + +// Transmitt buffer enable +// Enable output buffer in SERCOM module +// usart_tx_enable +#ifndef CONF_SERCOM_2_USART_TXEN +#define CONF_SERCOM_2_USART_TXEN 1 +#endif + +// Frame parity +// <0x0=>No parity +// <0x1=>Even parity +// <0x2=>Odd parity +// Parity bit mode for USART frame +// usart_parity +#ifndef CONF_SERCOM_2_USART_PARITY +#define CONF_SERCOM_2_USART_PARITY 0x0 +#endif + +// Character Size +// <0x0=>8 bits +// <0x1=>9 bits +// <0x5=>5 bits +// <0x6=>6 bits +// <0x7=>7 bits +// Data character size in USART frame +// usart_character_size +#ifndef CONF_SERCOM_2_USART_CHSIZE +#define CONF_SERCOM_2_USART_CHSIZE 0x0 +#endif + +// Stop Bit +// <0=>One stop bit +// <1=>Two stop bits +// Number of stop bits in USART frame +// usart_stop_bit +#ifndef CONF_SERCOM_2_USART_SBMODE +#define CONF_SERCOM_2_USART_SBMODE 0 +#endif + +// Baud rate <1-3000000> +// USART baud rate setting +// usart_baud_rate +#ifndef CONF_SERCOM_2_USART_BAUD +#define CONF_SERCOM_2_USART_BAUD 9600 +#endif + +// + +// Advanced configuration +// usart_advanced +#ifndef CONF_SERCOM_2_USART_ADVANCED_CONFIG +#define CONF_SERCOM_2_USART_ADVANCED_CONFIG 1 +#endif + +// Run in stand-by +// Keep the module running in standby sleep mode +// usart_arch_runstdby +#ifndef CONF_SERCOM_2_USART_RUNSTDBY +#define CONF_SERCOM_2_USART_RUNSTDBY 0 +#endif + +// Immediate Buffer Overflow Notification +// Controls when the BUFOVF status bit is asserted +// usart_arch_ibon +#ifndef CONF_SERCOM_2_USART_IBON +#define CONF_SERCOM_2_USART_IBON 0 +#endif + +// Start of Frame Detection Enable +// Will wake the device from any sleep mode if usart_init and usart_enable was run priort to going to sleep. (receive buffer must be enabled) +// usart_arch_sfde +#ifndef CONF_SERCOM_2_USART_SFDE +#define CONF_SERCOM_2_USART_SFDE 0 +#endif + +// Collision Detection Enable +// Collision detection enable +// usart_arch_cloden +#ifndef CONF_SERCOM_2_USART_CLODEN +#define CONF_SERCOM_2_USART_CLODEN 0 +#endif + +// Operating Mode +// <0x0=>USART with external clock +// <0x1=>USART with internal clock +// Drive the shift register by an internal clock generated by the baud rate generator or an external clock supplied on the XCK pin. +// usart_arch_clock_mode +#ifndef CONF_SERCOM_2_USART_MODE +#define CONF_SERCOM_2_USART_MODE 0x1 +#endif + +// Sample Rate +// <0x0=>16x arithmetic +// <0x1=>16x fractional +// <0x2=>8x arithmetic +// <0x3=>8x fractional +// <0x3=>3x +// How many over-sampling bits used when samling data state +// usart_arch_sampr +#ifndef CONF_SERCOM_2_USART_SAMPR +#define CONF_SERCOM_2_USART_SAMPR 0x0 +#endif + +// Sample Adjustment +// <0x0=>7-8-9 (3-4-5 8-bit over-sampling) +// <0x1=>9-10-11 (4-5-6 8-bit over-sampling) +// <0x2=>11-12-13 (5-6-7 8-bit over-sampling) +// <0x3=>13-14-15 (6-7-8 8-bit over-sampling) +// Adjust which samples to use for data sampling in asynchronous mode +// usart_arch_sampa +#ifndef CONF_SERCOM_2_USART_SAMPA +#define CONF_SERCOM_2_USART_SAMPA 0x0 +#endif + +// Fractional Part <0-7> +// Fractional part of the baud rate if baud rate generator is in fractional mode +// usart_arch_fractional +#ifndef CONF_SERCOM_2_USART_FRACTIONAL +#define CONF_SERCOM_2_USART_FRACTIONAL 0x0 +#endif + +// Data Order +// <0=>MSB is transmitted first +// <1=>LSB is transmitted first +// Data order of the data bits in the frame +// usart_arch_dord +#ifndef CONF_SERCOM_2_USART_DORD +#define CONF_SERCOM_2_USART_DORD 1 +#endif + +// Does not do anything in UART mode +#define CONF_SERCOM_2_USART_CPOL 0 + +// Encoding Format +// <0=>No encoding +// <1=>IrDA encoded +// usart_arch_enc +#ifndef CONF_SERCOM_2_USART_ENC +#define CONF_SERCOM_2_USART_ENC 0 +#endif + +// Debug Stop Mode +// Behavior of the baud-rate generator when CPU is halted by external debugger. +// <0=>Keep running +// <1=>Halt +// usart_arch_dbgstop +#ifndef CONF_SERCOM_2_USART_DEBUG_STOP_MODE +#define CONF_SERCOM_2_USART_DEBUG_STOP_MODE 0 +#endif + +// + +#ifndef CONF_SERCOM_2_USART_INACK +#define CONF_SERCOM_2_USART_INACK 0x0 +#endif + +#ifndef CONF_SERCOM_2_USART_DSNACK +#define CONF_SERCOM_2_USART_DSNACK 0x0 +#endif + +#ifndef CONF_SERCOM_2_USART_MAXITER +#define CONF_SERCOM_2_USART_MAXITER 0x7 +#endif + +#ifndef CONF_SERCOM_2_USART_GTIME +#define CONF_SERCOM_2_USART_GTIME 0x2 +#endif + +#define CONF_SERCOM_2_USART_RXINV 0x0 +#define CONF_SERCOM_2_USART_TXINV 0x0 + +#ifndef CONF_SERCOM_2_USART_CMODE +#define CONF_SERCOM_2_USART_CMODE 0 +#endif + +#ifndef CONF_SERCOM_2_USART_RXPO +#define CONF_SERCOM_2_USART_RXPO 1 /* RX is on PIN_PA08 */ +#endif + +#ifndef CONF_SERCOM_2_USART_TXPO +#define CONF_SERCOM_2_USART_TXPO 0 /* TX is on PIN_PA09 */ +#endif + +/* Set correct parity settings in register interface based on PARITY setting */ +#if CONF_SERCOM_2_USART_PARITY == 0 +#define CONF_SERCOM_2_USART_PMODE 0 +#define CONF_SERCOM_2_USART_FORM 0 +#else +#define CONF_SERCOM_2_USART_PMODE CONF_SERCOM_2_USART_PARITY - 1 +#define CONF_SERCOM_2_USART_FORM 1 +#endif + +// Calculate BAUD register value in UART mode +#if CONF_SERCOM_2_USART_SAMPR == 0 +#ifndef CONF_SERCOM_2_USART_BAUD_RATE +#define CONF_SERCOM_2_USART_BAUD_RATE \ + 65536 - ((65536 * 16.0f * CONF_SERCOM_2_USART_BAUD) / CONF_GCLK_SERCOM2_CORE_FREQUENCY) +#endif +#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH +#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0 +#endif +#elif CONF_SERCOM_2_USART_SAMPR == 1 +#ifndef CONF_SERCOM_2_USART_BAUD_RATE +#define CONF_SERCOM_2_USART_BAUD_RATE \ + ((CONF_GCLK_SERCOM2_CORE_FREQUENCY) / (CONF_SERCOM_2_USART_BAUD * 16)) - (CONF_SERCOM_2_USART_FRACTIONAL / 8) +#endif +#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH +#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0 +#endif +#elif CONF_SERCOM_2_USART_SAMPR == 2 +#ifndef CONF_SERCOM_2_USART_BAUD_RATE +#define CONF_SERCOM_2_USART_BAUD_RATE \ + 65536 - ((65536 * 8.0f * CONF_SERCOM_2_USART_BAUD) / CONF_GCLK_SERCOM2_CORE_FREQUENCY) +#endif +#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH +#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0 +#endif +#elif CONF_SERCOM_2_USART_SAMPR == 3 +#ifndef CONF_SERCOM_2_USART_BAUD_RATE +#define CONF_SERCOM_2_USART_BAUD_RATE \ + ((CONF_GCLK_SERCOM2_CORE_FREQUENCY) / (CONF_SERCOM_2_USART_BAUD * 8)) - (CONF_SERCOM_2_USART_FRACTIONAL / 8) +#endif +#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH +#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0 +#endif +#elif CONF_SERCOM_2_USART_SAMPR == 4 +#ifndef CONF_SERCOM_2_USART_BAUD_RATE +#define CONF_SERCOM_2_USART_BAUD_RATE \ + 65536 - ((65536 * 3.0f * CONF_SERCOM_2_USART_BAUD) / CONF_GCLK_SERCOM2_CORE_FREQUENCY) +#endif +#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH +#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0 +#endif +#endif + +#include + +// Enable configuration of module +#ifndef CONF_SERCOM_3_SPI_ENABLE +#define CONF_SERCOM_3_SPI_ENABLE 1 +#endif + +// SPI DMA TX Channel <0-32> +// This defines DMA channel to be used +// spi_master_dma_tx_channel +#ifndef CONF_SERCOM_3_SPI_M_DMA_TX_CHANNEL +#define CONF_SERCOM_3_SPI_M_DMA_TX_CHANNEL 0 +#endif + +// SPI RX Channel Enable +// spi_master_rx_channel +#ifndef CONF_SERCOM_3_SPI_RX_CHANNEL +#define CONF_SERCOM_3_SPI_RX_CHANNEL 1 +#endif + +// DMA Channel <0-32> +// This defines DMA channel to be used +// spi_master_dma_rx_channel +#ifndef CONF_SERCOM_3_SPI_M_DMA_RX_CHANNEL +#define CONF_SERCOM_3_SPI_M_DMA_RX_CHANNEL 1 +#endif + +// + +// Set module in SPI Master mode +#ifndef CONF_SERCOM_3_SPI_MODE +#define CONF_SERCOM_3_SPI_MODE 0x03 +#endif + +// Basic Configuration + +// Receive buffer enable +// Enable receive buffer to receive data from slave (RXEN) +// spi_master_rx_enable +#ifndef CONF_SERCOM_3_SPI_RXEN +#define CONF_SERCOM_3_SPI_RXEN 0x1 +#endif + +// Character Size +// Bit size for all characters sent over the SPI bus (CHSIZE) +// <0x0=>8 bits +// <0x1=>9 bits +// spi_master_character_size +#ifndef CONF_SERCOM_3_SPI_CHSIZE +#define CONF_SERCOM_3_SPI_CHSIZE 0x0 +#endif + +// Baud rate <1-12000000> +// The SPI data transfer rate +// spi_master_baud_rate +#ifndef CONF_SERCOM_3_SPI_BAUD +#define CONF_SERCOM_3_SPI_BAUD 50000 +#endif + +// + +// Advanced Configuration +// spi_master_advanced +#ifndef CONF_SERCOM_3_SPI_ADVANCED +#define CONF_SERCOM_3_SPI_ADVANCED 0 +#endif + +// Dummy byte <0x00-0x1ff> +// spi_master_dummybyte +// Dummy byte used when reading data from the slave without sending any data +#ifndef CONF_SERCOM_3_SPI_DUMMYBYTE +#define CONF_SERCOM_3_SPI_DUMMYBYTE 0x1ff +#endif + +// Data Order +// <0=>MSB first +// <1=>LSB first +// I least significant or most significant bit is shifted out first (DORD) +// spi_master_arch_dord +#ifndef CONF_SERCOM_3_SPI_DORD +#define CONF_SERCOM_3_SPI_DORD 0x0 +#endif + +// Clock Polarity +// <0=>SCK is low when idle +// <1=>SCK is high when idle +// Determines if the leading edge is rising or falling with a corresponding opposite edge at the trailing edge. (CPOL) +// spi_master_arch_cpol +#ifndef CONF_SERCOM_3_SPI_CPOL +#define CONF_SERCOM_3_SPI_CPOL 0x0 +#endif + +// Clock Phase +// <0x0=>Sample input on leading edge +// <0x1=>Sample input on trailing edge +// Determines if input data is sampled on leading or trailing SCK edge. (CPHA) +// spi_master_arch_cpha +#ifndef CONF_SERCOM_3_SPI_CPHA +#define CONF_SERCOM_3_SPI_CPHA 0x0 +#endif + +// Immediate Buffer Overflow Notification +// Controls when OVF is asserted (IBON) +// <0x0=>In data stream +// <0x1=>On buffer overflow +// spi_master_arch_ibon +#ifndef CONF_SERCOM_3_SPI_IBON +#define CONF_SERCOM_3_SPI_IBON 0x0 +#endif + +// Run in stand-by +// Module stays active in stand-by sleep mode. (RUNSTDBY) +// spi_master_arch_runstdby +#ifndef CONF_SERCOM_3_SPI_RUNSTDBY +#define CONF_SERCOM_3_SPI_RUNSTDBY 0x0 +#endif + +// Debug Stop Mode +// Behavior of the baud-rate generator when CPU is halted by external debugger. (DBGSTOP) +// <0=>Keep running +// <1=>Halt +// spi_master_arch_dbgstop +#ifndef CONF_SERCOM_3_SPI_DBGSTOP +#define CONF_SERCOM_3_SPI_DBGSTOP 0 +#endif + +// + +// Address mode disabled in master mode +#ifndef CONF_SERCOM_3_SPI_AMODE_EN +#define CONF_SERCOM_3_SPI_AMODE_EN 0 +#endif + +#ifndef CONF_SERCOM_3_SPI_AMODE +#define CONF_SERCOM_3_SPI_AMODE 0 +#endif + +#ifndef CONF_SERCOM_3_SPI_ADDR +#define CONF_SERCOM_3_SPI_ADDR 0 +#endif + +#ifndef CONF_SERCOM_3_SPI_ADDRMASK +#define CONF_SERCOM_3_SPI_ADDRMASK 0 +#endif + +#ifndef CONF_SERCOM_3_SPI_SSDE +#define CONF_SERCOM_3_SPI_SSDE 0 +#endif + +#ifndef CONF_SERCOM_3_SPI_MSSEN +#define CONF_SERCOM_3_SPI_MSSEN 0x0 +#endif + +#ifndef CONF_SERCOM_3_SPI_PLOADEN +#define CONF_SERCOM_3_SPI_PLOADEN 0 +#endif + +// Receive Data Pinout +// <0x0=>PAD[0] +// <0x1=>PAD[1] +// <0x2=>PAD[2] +// <0x3=>PAD[3] +// spi_master_rxpo +#ifndef CONF_SERCOM_3_SPI_RXPO +#define CONF_SERCOM_3_SPI_RXPO 2 +#endif + +// Transmit Data Pinout +// <0x0=>PAD[0,1]_DO_SCK +// <0x1=>PAD[2,3]_DO_SCK +// <0x2=>PAD[3,1]_DO_SCK +// <0x3=>PAD[0,3]_DO_SCK +// spi_master_txpo +#ifndef CONF_SERCOM_3_SPI_TXPO +#define CONF_SERCOM_3_SPI_TXPO 0 +#endif + +// Calculate baud register value from requested baudrate value +#ifndef CONF_SERCOM_3_SPI_BAUD_RATE +#define CONF_SERCOM_3_SPI_BAUD_RATE ((float)CONF_GCLK_SERCOM3_CORE_FREQUENCY / (float)(2 * CONF_SERCOM_3_SPI_BAUD)) - 1 +#endif + +// <<< end of configuration section >>> + +#endif // HPL_SERCOM_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same51/hpl_systick_config.h b/ports/atmel-samd/asf4_conf/same51/hpl_systick_config.h new file mode 100644 index 0000000000..a7f2f36208 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same51/hpl_systick_config.h @@ -0,0 +1,18 @@ +/* Auto-generated config file hpl_systick_config.h */ +#ifndef HPL_SYSTICK_CONFIG_H +#define HPL_SYSTICK_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Advanced settings +// SysTick exception request +// Indicates whether the generation of SysTick exception is enabled or not +// systick_arch_tickint +#ifndef CONF_SYSTICK_TICKINT +#define CONF_SYSTICK_TICKINT 0 +#endif +// + +// <<< end of configuration section >>> + +#endif // HPL_SYSTICK_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same51/hpl_tc_config.h b/ports/atmel-samd/asf4_conf/same51/hpl_tc_config.h new file mode 100644 index 0000000000..38d48e9b67 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same51/hpl_tc_config.h @@ -0,0 +1,209 @@ +/* Auto-generated config file hpl_tc_config.h */ +#ifndef HPL_TC_CONFIG_H +#define HPL_TC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +#include + +#ifndef CONF_TC0_ENABLE +#define CONF_TC0_ENABLE 1 +#endif + +// Basic settings +// Prescaler +// <0=> No division +// <1=> Divide by 2 +// <2=> Divide by 4 +// <3=> Divide by 8 +// <4=> Divide by 16 +// <5=> Divide by 64 +// <6=> Divide by 256 +// <7=> Divide by 1024 +// This defines the prescaler value +// tc_prescaler +#ifndef CONF_TC0_PRESCALER +#define CONF_TC0_PRESCALER 0 +#endif +// + +// PWM Waveform Output settings +// Waveform Period Value (uS) <0x00-0xFFFFFFFF> +// The unit of this value is us. +// tc_arch_wave_per_val +#ifndef CONF_TC0_WAVE_PER_VAL +#define CONF_TC0_WAVE_PER_VAL 0x3e8 +#endif + +// Waveform Duty Value (0.1%) <0x00-0x03E8> +// The unit of this value is 1/1000. +// tc_arch_wave_duty_val +#ifndef CONF_TC0_WAVE_DUTY_VAL +#define CONF_TC0_WAVE_DUTY_VAL 0x1f4 +#endif + +/* Caculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ +#if CONF_TC0_PRESCALER < TC_CTRLA_PRESCALER_DIV64_Val +#define CONF_TC0_CC0 \ + ((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 1000000 / (1 << CONF_TC0_PRESCALER) - 1)) +#define CONF_TC0_CC1 ((CONF_TC0_CC0 * CONF_TC0_WAVE_DUTY_VAL) / 1000) + +#elif CONF_TC0_PRESCALER == TC_CTRLA_PRESCALER_DIV64_Val +#define CONF_TC0_CC0 ((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 64000000 - 1)) +#define CONF_TC0_CC1 ((CONF_TC0_CC0 * CONF_TC0_WAVE_DUTY_VAL) / 1000) + +#elif CONF_TC0_PRESCALER == TC_CTRLA_PRESCALER_DIV256_Val +#define CONF_TC0_CC0 ((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 256000000 - 1)) +#define CONF_TC0_CC1 ((CONF_TC0_CC0 * CONF_TC0_WAVE_DUTY_VAL) / 1000) + +#elif CONF_TC0_PRESCALER == TC_CTRLA_PRESCALER_DIV1024_Val +#define CONF_TC0_CC0 ((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 1024000000 - 1)) +#define CONF_TC0_CC1 ((CONF_TC0_CC0 * CONF_TC0_WAVE_DUTY_VAL) / 1000) +#endif + +// + +// Advanced settings +// Mode +// Counter in 16-bit mode +// Counter in 32-bit mode +// These bits mode +// tc_mode +#ifndef CONF_TC0_MODE +#define CONF_TC0_MODE TC_CTRLA_MODE_COUNT16_Val +#endif + +// Period Value <0x00000000-0xFFFFFFFF> +// tc_per +#ifndef CONF_TC0_PER +#define CONF_TC0_PER 0x32 +#endif +// + +// Advanced settings +// Prescaler and Counter Synchronization Selection +// Reload or reset counter on next GCLK +// Reload or reset counter on next prescaler clock +// Reload or reset counter on next GCLK and reset prescaler counter +// These bits select if on retrigger event, the Counter should be cleared or reloaded on the next GCLK_TCx clock or on the next prescaled GCLK_TCx clock. +// tc_arch_presync +#ifndef CONF_TC0_PRESCSYNC +#define CONF_TC0_PRESCSYNC TC_CTRLA_PRESCSYNC_GCLK_Val +#endif + +// Run in standby +// Indicates whether the will continue running in standby sleep mode or not +// tc_arch_runstdby +#ifndef CONF_TC0_RUNSTDBY +#define CONF_TC0_RUNSTDBY 0 +#endif + +// On-Demand +// Indicates whether the TC0's on-demand mode is on or not +// tc_arch_ondemand +#ifndef CONF_TC0_ONDEMAND +#define CONF_TC0_ONDEMAND 0 +#endif + +// Auto Lock +// <0x0=>The Lock Update bit is not affected on overflow/underflow and re-trigger event +// <0x1=>The Lock Update bit is set on each overflow/underflow or re-trigger event +// tc_arch_alock +#ifndef CONF_TC0_ALOCK +#define CONF_TC0_ALOCK 0 +#endif + +/* Commented intentionally. Timer uses fixed value. May be used by other abstractions based on TC. */ +//#define CONF_TC0_CAPTEN0 0 +//#define CONF_TC0_CAPTEN1 0 +//#define CONF_TC0_COPEN0 0 +//#define CONF_TC0_COPEN1 0 + +/* Commented intentionally. Timer uses fixed value. May be used by other abstractions based on TC. */ +//#define CONF_TC0_DIR 0 +//#define CONF_TC0_ONESHOT 0 +//#define CONF_TC0_LUPD 0 + +// Debug Running Mode +// Indicates whether the Debug Running Mode is enabled or not +// tc_arch_dbgrun +#ifndef CONF_TC0_DBGRUN +#define CONF_TC0_DBGRUN 0 +#endif + +// Event control +// timer_event_control +#ifndef CONF_TC0_EVENT_CONTROL_ENABLE +#define CONF_TC0_EVENT_CONTROL_ENABLE 0 +#endif + +// Output Event On Match or Capture on Channel 0 +// Enable output of event on timer tick +// tc_arch_mceo0 +#ifndef CONF_TC0_MCEO0 +#define CONF_TC0_MCEO0 0 +#endif + +// Output Event On Match or Capture on Channel 1 +// Enable output of event on timer tick +// tc_arch_mceo1 +#ifndef CONF_TC0_MCEO1 +#define CONF_TC0_MCEO1 0 +#endif + +// Output Event On Timer Tick +// Enable output of event on timer tick +// tc_arch_ovfeo +#ifndef CONF_TC0_OVFEO +#define CONF_TC0_OVFEO 0 +#endif + +// Event Input +// Enable asynchronous input events +// tc_arch_tcei +#ifndef CONF_TC0_TCEI +#define CONF_TC0_TCEI 0 +#endif + +// Inverted Event Input +// Invert the asynchronous input events +// tc_arch_tcinv +#ifndef CONF_TC0_TCINV +#define CONF_TC0_TCINV 0 +#endif + +// Event action +// <0=> Event action disabled +// <1=> Start, restart or re-trigger TC on event +// <2=> Count on event +// <3=> Start on event +// <4=> Time stamp capture +// <5=> Period captured in CC0, pulse width in CC1 +// <6=> Period captured in CC1, pulse width in CC0 +// <7=> Pulse width capture +// Event which will be performed on an event +// tc_arch_evact +#ifndef CONF_TC0_EVACT +#define CONF_TC0_EVACT 0 +#endif +// + +/* Commented intentionally. Timer uses fixed value. May be used by other abstractions based on TC. */ +//#define CONF_TC0_WAVEGEN TC_CTRLA_WAVEGEN_MFRQ_Val + +/* Commented intentionally. Timer uses fixed value. May be used by other abstractions based on TC. */ +//#define CONF_TC0_INVEN0 0 +//#define CONF_TC0_INVEN1 0 + +/* Commented intentionally. Timer uses fixed value. May be used by other abstractions based on TC. */ +//#define CONF_TC0_PERBUF 0 + +/* Commented intentionally. Timer uses fixed value. May be used by other abstractions based on TC. */ +//#define CONF_TC0_CCBUF0 0 +//#define CONF_TC0_CCBUF1 0 + +// + +// <<< end of configuration section >>> + +#endif // HPL_TC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same51/hpl_trng_config.h b/ports/atmel-samd/asf4_conf/same51/hpl_trng_config.h new file mode 100644 index 0000000000..ba9014989a --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same51/hpl_trng_config.h @@ -0,0 +1,27 @@ +/* Auto-generated config file hpl_trng_config.h */ +#ifndef HPL_TRNG_CONFIG_H +#define HPL_TRNG_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Advanced configurations + +// Run In Standby +// Indicates whether the TRNG works in standby mode +// trng_runstdby +#ifndef CONF_TRNG_RUNSTDBY +#define CONF_TRNG_RUNSTDBY 0 +#endif + +// Data Ready Event Output Enable +// Indicates whether the TRNG generates event on Data Ready +// trng_datardyeo +#ifndef CONF_TRNG_DATARDYEO +#define CONF_TRNG_DATARDYEO 0 +#endif + +// + +// <<< end of configuration section >>> + +#endif // HPL_TRNG_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same51/hpl_usb_config.h b/ports/atmel-samd/asf4_conf/same51/hpl_usb_config.h new file mode 100644 index 0000000000..d1bb42fe45 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same51/hpl_usb_config.h @@ -0,0 +1,413 @@ +/* Auto-generated config file hpl_usb_config.h */ +#ifndef HPL_USB_CONFIG_H +#define HPL_USB_CONFIG_H + +// CIRCUITPY: + +// Use 64-byte USB buffers for endpoint directions that are in use. They're set to 0 below otherwise. + +#include "genhdr/autogen_usb_descriptor.h" + +#if defined(USB_ENDPOINT_1_OUT_USED) && USB_ENDPOINT_1_OUT_USED +#define CONF_USB_EP1_CACHE 64 +#endif +#if defined(USB_ENDPOINT_1_IN_USED) && USB_ENDPOINT_1_IN_USED +#define CONF_USB_EP1_I_CACHE 64 +#endif + +#if defined(USB_ENDPOINT_2_OUT_USED) && USB_ENDPOINT_2_OUT_USED +#define CONF_USB_EP2_CACHE 64 +#endif +#if defined(USB_ENDPOINT_2_IN_USED) && USB_ENDPOINT_2_IN_USED +#define CONF_USB_EP2_I_CACHE 64 +#endif + +#if defined(USB_ENDPOINT_3_OUT_USED) && USB_ENDPOINT_3_OUT_USED +#define CONF_USB_EP3_CACHE 64 +#endif +#if defined(USB_ENDPOINT_3_IN_USED) && USB_ENDPOINT_3_IN_USED +#define CONF_USB_EP3_I_CACHE 64 +#endif + +#if defined(USB_ENDPOINT_4_OUT_USED) && USB_ENDPOINT_4_OUT_USED +#define CONF_USB_EP4_CACHE 64 +#endif +#if defined(USB_ENDPOINT_4_IN_USED) && USB_ENDPOINT_4_IN_USED +#define CONF_USB_EP4_I_CACHE 64 +#endif + +#if defined(USB_ENDPOINT_5_OUT_USED) && USB_ENDPOINT_5_OUT_USED +#define CONF_USB_EP5_CACHE 64 +#endif +#if defined(USB_ENDPOINT_5_IN_USED) && USB_ENDPOINT_5_IN_USED +#define CONF_USB_EP5_I_CACHE 64 +#endif + +#if defined(USB_ENDPOINT_6_OUT_USED) && USB_ENDPOINT_6_OUT_USED +#define CONF_USB_EP6_CACHE 64 +#endif +#if defined(USB_ENDPOINT_6_IN_USED) && USB_ENDPOINT_6_IN_USED +#define CONF_USB_EP6_I_CACHE 64 +#endif + +#if defined(USB_ENDPOINT_7_OUT_USED) && USB_ENDPOINT_7_OUT_USED +#define CONF_USB_EP7_CACHE 64 +#endif +#if defined(USB_ENDPOINT_7_IN_USED) && USB_ENDPOINT_7_IN_USED +#define CONF_USB_EP7_I_CACHE 64 +#endif + + +// <<< Use Configuration Wizard in Context Menu >>> + +#define CONF_USB_N_0 0 +#define CONF_USB_N_1 1 +#define CONF_USB_N_2 2 +#define CONF_USB_N_3 3 +#define CONF_USB_N_4 4 +#define CONF_USB_N_5 5 +#define CONF_USB_N_6 6 +#define CONF_USB_N_7 7 +#define CONF_USB_N_8 8 +#define CONF_USB_N_9 9 +#define CONF_USB_N_10 10 +#define CONF_USB_N_11 11 +#define CONF_USB_N_12 12 +#define CONF_USB_N_13 13 +#define CONF_USB_N_14 14 +#define CONF_USB_N_15 15 + +#define CONF_USB_D_EP_N_MAX (USB_EPT_NUM - 1) +#define CONF_USB_D_N_EP_MAX (CONF_USB_D_EP_N_MAX * 2 - 1) + +// USB Device HAL Configuration + +// Max number of endpoints supported +// Limits the number of endpoints (described by EP address) can be used in app. +// NOTE(tannewt): This not only limits the number of endpoints but also the +// addresses. In other words, even if you use endpoint 6 you need to set this to 11. +// 1 (EP0 only) +// 2 (EP0 + 1 endpoint) +// 3 (EP0 + 2 endpoints) +// 4 (EP0 + 3 endpoints) +// 5 (EP0 + 4 endpoints) +// 6 (EP0 + 5 endpoints) +// 7 (EP0 + 6 endpoints) +// 8 (EP0 + 7 endpoints) +// Max possible (by "Max Endpoint Number" config) +// usbd_num_ep_sp +#ifndef CONF_USB_D_NUM_EP_SP +#define CONF_USB_D_NUM_EP_SP CONF_USB_D_N_EP_MAX +#endif + +// + +// Max Endpoint Number supported +// Limits the max endpoint number. +// USB endpoint address is constructed by direction and endpoint number. Bit 8 of address set indicates the direction is IN. E.g., EP0x81 and EP0x01 have the same endpoint number, 1. +// Reduce the value according to specific device design, to cut-off memory usage. +// 0 (only EP0) +// 1 (EP 0x81 or 0x01) +// 2 (EP 0x82 or 0x02) +// 3 (EP 0x83 or 0x03) +// 4 (EP 0x84 or 0x04) +// 5 (EP 0x85 or 0x05) +// 6 (EP 0x86 or 0x06) +// 7 (EP 0x87 or 0x07) +// Max possible (by HW) +// The number of physical endpoints - 1 +// usbd_arch_max_ep_n +#ifndef CONF_USB_D_MAX_EP_N +#define CONF_USB_D_MAX_EP_N CONF_USB_D_EP_N_MAX +#endif + +// USB Speed Limit +// Limits the working speed of the device. +// Full speed +// Low Speed +// usbd_arch_speed +#ifndef CONF_USB_D_SPEED +#define CONF_USB_D_SPEED USB_SPEED_FS +#endif + +// Cache buffer size for EP0 +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// EP0 is default control endpoint, so cache must be used to be able to receive SETUP packet at any time. +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// usb_arch_ep0_cache +#ifndef CONF_USB_EP0_CACHE +#define CONF_USB_EP0_CACHE 64 +#endif + +// Cache configuration EP1 +// Cache buffer size for EP1 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep1_cache +#ifndef CONF_USB_EP1_CACHE +#define CONF_USB_EP1_CACHE 0 +#endif + +// Cache buffer size for EP1 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep1_I_CACHE +#ifndef CONF_USB_EP1_I_CACHE +#define CONF_USB_EP1_I_CACHE 0 +#endif +// + +// Cache configuration EP2 +// Cache buffer size for EP2 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep2_cache +#ifndef CONF_USB_EP2_CACHE +#define CONF_USB_EP2_CACHE 0 +#endif + +// Cache buffer size for EP2 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep2_I_CACHE +#ifndef CONF_USB_EP2_I_CACHE +#define CONF_USB_EP2_I_CACHE 0 +#endif +// + +// Cache configuration EP3 +// Cache buffer size for EP3 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep3_cache +#ifndef CONF_USB_EP3_CACHE +#define CONF_USB_EP3_CACHE 0 +#endif + +// Cache buffer size for EP3 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep3_I_CACHE +#ifndef CONF_USB_EP3_I_CACHE +#define CONF_USB_EP3_I_CACHE 0 +#endif +// + +// Cache configuration EP4 +// Cache buffer size for EP4 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep4_cache +#ifndef CONF_USB_EP4_CACHE +#define CONF_USB_EP4_CACHE 0 +#endif + +// Cache buffer size for EP4 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep4_I_CACHE +#ifndef CONF_USB_EP4_I_CACHE +#define CONF_USB_EP4_I_CACHE 0 +#endif +// + +// Cache configuration EP5 +// Cache buffer size for EP5 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep5_cache +#ifndef CONF_USB_EP5_CACHE +#define CONF_USB_EP5_CACHE 0 +#endif + +// Cache buffer size for EP5 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep5_I_CACHE +#ifndef CONF_USB_EP5_I_CACHE +#define CONF_USB_EP5_I_CACHE 0 +#endif +// + +// Cache configuration EP6 +// Cache buffer size for EP6 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep6_cache +#ifndef CONF_USB_EP6_CACHE +#define CONF_USB_EP6_CACHE 0 +#endif + +// Cache buffer size for EP6 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep6_I_CACHE +#ifndef CONF_USB_EP6_I_CACHE +#define CONF_USB_EP6_I_CACHE 0 +#endif +// + +// Cache configuration EP7 +// Cache buffer size for EP7 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep7_cache +#ifndef CONF_USB_EP7_CACHE +#define CONF_USB_EP7_CACHE 0 +#endif + +// Cache buffer size for EP7 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep7_I_CACHE +#ifndef CONF_USB_EP7_I_CACHE +#define CONF_USB_EP7_I_CACHE 0 +#endif +// + +// <<< end of configuration section >>> + +#endif // HPL_USB_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same51/peripheral_clk_config.h b/ports/atmel-samd/asf4_conf/same51/peripheral_clk_config.h new file mode 100644 index 0000000000..59fe8730e6 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same51/peripheral_clk_config.h @@ -0,0 +1,1170 @@ +/* Auto-generated config file peripheral_clk_config.h */ +#ifndef PERIPHERAL_CLK_CONFIG_H +#define PERIPHERAL_CLK_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// ADC Clock Source +// adc_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for ADC. +#ifndef CONF_GCLK_ADC0_SRC +#define CONF_GCLK_ADC0_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_ADC0_FREQUENCY + * \brief ADC0's Clock frequency + */ +#ifndef CONF_GCLK_ADC0_FREQUENCY +#define CONF_GCLK_ADC0_FREQUENCY 48000000 +#endif + +// DAC Clock Source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// dac_gclk_selection +// Select the clock source for DAC. +#ifndef CONF_GCLK_DAC_SRC +#define CONF_GCLK_DAC_SRC GCLK_PCHCTRL_GEN_GCLK6_Val +#endif + +/** + * \def CONF_GCLK_DAC_FREQUENCY + * \brief DAC's Clock frequency + */ +#ifndef CONF_GCLK_DAC_FREQUENCY +#define CONF_GCLK_DAC_FREQUENCY 2000000 +#endif + +// EVSYS Channel 0 Clock Source +// evsys_clk_selection_0 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 0. +#ifndef CONF_GCLK_EVSYS_CHANNEL_0_SRC +#define CONF_GCLK_EVSYS_CHANNEL_0_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_0_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_0_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_0_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 1 Clock Source +// evsys_clk_selection_1 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 1. +#ifndef CONF_GCLK_EVSYS_CHANNEL_1_SRC +#define CONF_GCLK_EVSYS_CHANNEL_1_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_1_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_1_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_1_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 2 Clock Source +// evsys_clk_selection_2 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 2. +#ifndef CONF_GCLK_EVSYS_CHANNEL_2_SRC +#define CONF_GCLK_EVSYS_CHANNEL_2_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_2_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_2_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_2_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 3 Clock Source +// evsys_clk_selection_3 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 3. +#ifndef CONF_GCLK_EVSYS_CHANNEL_3_SRC +#define CONF_GCLK_EVSYS_CHANNEL_3_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_3_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_3_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_3_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 4 Clock Source +// evsys_clk_selection_4 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 4. +#ifndef CONF_GCLK_EVSYS_CHANNEL_4_SRC +#define CONF_GCLK_EVSYS_CHANNEL_4_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_4_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_4_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_4_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 5 Clock Source +// evsys_clk_selection_5 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 5. +#ifndef CONF_GCLK_EVSYS_CHANNEL_5_SRC +#define CONF_GCLK_EVSYS_CHANNEL_5_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_5_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_5_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_5_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 6 Clock Source +// evsys_clk_selection_6 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 6. +#ifndef CONF_GCLK_EVSYS_CHANNEL_6_SRC +#define CONF_GCLK_EVSYS_CHANNEL_6_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_6_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_6_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_6_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 7 Clock Source +// evsys_clk_selection_7 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 7. +#ifndef CONF_GCLK_EVSYS_CHANNEL_7_SRC +#define CONF_GCLK_EVSYS_CHANNEL_7_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_7_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_7_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_7_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 8 Clock Source +// evsys_clk_selection_8 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 8. +#ifndef CONF_GCLK_EVSYS_CHANNEL_8_SRC +#define CONF_GCLK_EVSYS_CHANNEL_8_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_8_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_8_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_8_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 9 Clock Source +// evsys_clk_selection_9 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 9. +#ifndef CONF_GCLK_EVSYS_CHANNEL_9_SRC +#define CONF_GCLK_EVSYS_CHANNEL_9_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_9_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_9_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_9_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 10 Clock Source +// evsys_clk_selection_10 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 10. +#ifndef CONF_GCLK_EVSYS_CHANNEL_10_SRC +#define CONF_GCLK_EVSYS_CHANNEL_10_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_10_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_10_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_10_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 11 Clock Source +// evsys_clk_selection_11 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 11. +#ifndef CONF_GCLK_EVSYS_CHANNEL_11_SRC +#define CONF_GCLK_EVSYS_CHANNEL_11_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_11_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_11_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_11_FREQUENCY 48000000.0 +#endif + +/** + * \def CONF_CPU_FREQUENCY + * \brief CPU's Clock frequency + */ +#ifndef CONF_CPU_FREQUENCY +#define CONF_CPU_FREQUENCY 120000000 +#endif + +// RTC Clock Source +// rtc_clk_selection +// RTC source +// Select the clock source for RTC. +#ifndef CONF_GCLK_RTC_SRC +#define CONF_GCLK_RTC_SRC RTC_CLOCK_SOURCE +#endif + +/** + * \def CONF_GCLK_RTC_FREQUENCY + * \brief RTC's Clock frequency + */ +#ifndef CONF_GCLK_RTC_FREQUENCY +#define CONF_GCLK_RTC_FREQUENCY 1024 +#endif + +// Core Clock Source +// core_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for CORE. +#ifndef CONF_GCLK_SERCOM0_CORE_SRC +#define CONF_GCLK_SERCOM0_CORE_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +// Slow Clock Source +// slow_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the slow clock source. +#ifndef CONF_GCLK_SERCOM0_SLOW_SRC +#define CONF_GCLK_SERCOM0_SLOW_SRC GCLK_PCHCTRL_GEN_GCLK3_Val +#endif + +/** + * \def CONF_GCLK_SERCOM0_CORE_FREQUENCY + * \brief SERCOM0's Core Clock frequency + */ +#ifndef CONF_GCLK_SERCOM0_CORE_FREQUENCY +#define CONF_GCLK_SERCOM0_CORE_FREQUENCY 48000000 +#endif + +/** + * \def CONF_GCLK_SERCOM0_SLOW_FREQUENCY + * \brief SERCOM0's Slow Clock frequency + */ +#ifndef CONF_GCLK_SERCOM0_SLOW_FREQUENCY +#define CONF_GCLK_SERCOM0_SLOW_FREQUENCY 32768 +#endif + +// Core Clock Source +// core_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for CORE. +#ifndef CONF_GCLK_SERCOM1_CORE_SRC +#define CONF_GCLK_SERCOM1_CORE_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +// Slow Clock Source +// slow_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the slow clock source. +#ifndef CONF_GCLK_SERCOM1_SLOW_SRC +#define CONF_GCLK_SERCOM1_SLOW_SRC GCLK_PCHCTRL_GEN_GCLK3_Val +#endif + +/** + * \def CONF_GCLK_SERCOM1_CORE_FREQUENCY + * \brief SERCOM1's Core Clock frequency + */ +#ifndef CONF_GCLK_SERCOM1_CORE_FREQUENCY +#define CONF_GCLK_SERCOM1_CORE_FREQUENCY 48000000 +#endif + +/** + * \def CONF_GCLK_SERCOM1_SLOW_FREQUENCY + * \brief SERCOM1's Slow Clock frequency + */ +#ifndef CONF_GCLK_SERCOM1_SLOW_FREQUENCY +#define CONF_GCLK_SERCOM1_SLOW_FREQUENCY 32768 +#endif + +// Core Clock Source +// core_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for CORE. +#ifndef CONF_GCLK_SERCOM2_CORE_SRC +#define CONF_GCLK_SERCOM2_CORE_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +// Slow Clock Source +// slow_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the slow clock source. +#ifndef CONF_GCLK_SERCOM2_SLOW_SRC +#define CONF_GCLK_SERCOM2_SLOW_SRC GCLK_PCHCTRL_GEN_GCLK3_Val +#endif + +/** + * \def CONF_GCLK_SERCOM2_CORE_FREQUENCY + * \brief SERCOM2's Core Clock frequency + */ +#ifndef CONF_GCLK_SERCOM2_CORE_FREQUENCY +#define CONF_GCLK_SERCOM2_CORE_FREQUENCY 48000000 +#endif + +/** + * \def CONF_GCLK_SERCOM2_SLOW_FREQUENCY + * \brief SERCOM2's Slow Clock frequency + */ +#ifndef CONF_GCLK_SERCOM2_SLOW_FREQUENCY +#define CONF_GCLK_SERCOM2_SLOW_FREQUENCY 32768 +#endif + +// Core Clock Source +// core_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for CORE. +#ifndef CONF_GCLK_SERCOM3_CORE_SRC +#define CONF_GCLK_SERCOM3_CORE_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +// Slow Clock Source +// slow_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the slow clock source. +#ifndef CONF_GCLK_SERCOM3_SLOW_SRC +#define CONF_GCLK_SERCOM3_SLOW_SRC GCLK_PCHCTRL_GEN_GCLK3_Val +#endif + +/** + * \def CONF_GCLK_SERCOM3_CORE_FREQUENCY + * \brief SERCOM3's Core Clock frequency + */ +#ifndef CONF_GCLK_SERCOM3_CORE_FREQUENCY +#define CONF_GCLK_SERCOM3_CORE_FREQUENCY 48000000 +#endif + +/** + * \def CONF_GCLK_SERCOM3_SLOW_FREQUENCY + * \brief SERCOM3's Slow Clock frequency + */ +#ifndef CONF_GCLK_SERCOM3_SLOW_FREQUENCY +#define CONF_GCLK_SERCOM3_SLOW_FREQUENCY 32768 +#endif + +// TC Clock Source +// tc_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for TC. +#ifndef CONF_GCLK_TC0_SRC +#define CONF_GCLK_TC0_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_TC0_FREQUENCY + * \brief TC0's Clock frequency + */ +#ifndef CONF_GCLK_TC0_FREQUENCY +#define CONF_GCLK_TC0_FREQUENCY 48000000 +#endif + +// USB Clock Source +// usb_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for USB. +#ifndef CONF_GCLK_USB_SRC +#define CONF_GCLK_USB_SRC GCLK_PCHCTRL_GEN_GCLK1_Val + +#endif + +/** + * \def CONF_GCLK_USB_FREQUENCY + * \brief USB's Clock frequency + */ +#ifndef CONF_GCLK_USB_FREQUENCY +#define CONF_GCLK_USB_FREQUENCY 48000000 +#endif + +// SDHC Clock Settings +// SDHC Clock source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_gclk_selection +#ifndef CONF_GCLK_SDHC0_SRC +#define CONF_GCLK_SDHC0_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif + +// SDHC clock slow source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_slow_gclk_selection +#ifndef CONF_GCLK_SDHC0_SLOW_SRC +#define CONF_GCLK_SDHC0_SLOW_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif +// + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock frequency + */ +#ifndef CONF_SDHC0_FREQUENCY +#define CONF_SDHC0_FREQUENCY 12000000 +#endif + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock slow frequency + */ +#ifndef CONF_SDHC0_SLOW_FREQUENCY +#define CONF_SDHC0_SLOW_FREQUENCY 12000000 +#endif + +// SDHC Clock Settings +// SDHC Clock source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_gclk_selection +#ifndef CONF_GCLK_SDHC1_SRC +#define CONF_GCLK_SDHC1_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif + +// SDHC clock slow source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_slow_gclk_selection +#ifndef CONF_GCLK_SDHC1_SLOW_SRC +#define CONF_GCLK_SDHC1_SLOW_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif +// + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock frequency + */ +#ifndef CONF_SDHC1_FREQUENCY +#define CONF_SDHC1_FREQUENCY 12000000 +#endif + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock slow frequency + */ +#ifndef CONF_SDHC1_SLOW_FREQUENCY +#define CONF_SDHC1_SLOW_FREQUENCY 12000000 +#endif + +// <<< end of configuration section >>> + +#endif // PERIPHERAL_CLK_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same51/usbd_config.h b/ports/atmel-samd/asf4_conf/same51/usbd_config.h new file mode 100644 index 0000000000..be1fa3c9e0 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same51/usbd_config.h @@ -0,0 +1,850 @@ +/* Auto-generated config file usbd_config.h */ +#ifndef USBD_CONFIG_H +#define USBD_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// ---- USB Device Stack Core Options ---- + +// High Speed Support +// Enable high speed specific descriptors support, e.g., DeviceQualifierDescriptor and OtherSpeedConfiguration Descriptor. +// High speed support require descriptors description array on start, for LS/FS and HS support in first and second place. +// usbd_hs_sp +#ifndef CONF_USBD_HS_SP +#define CONF_USBD_HS_SP 0 +#endif + +// ---- USB Device Stack Composite Options ---- + +// Enable String Descriptors +// usb_composite_str_en +#ifndef CONF_USB_COMPOSITE_STR_EN +#define CONF_USB_COMPOSITE_STR_EN 0 +#endif +// Language IDs +// Language IDs in c format, split by comma (E.g., 0x0409 ...) +// usb_composite_langid +#ifndef CONF_USB_COMPOSITE_LANGID +#define CONF_USB_COMPOSITE_LANGID "0x0409" +#endif + +#ifndef CONF_USB_COMPOSITE_LANGID_DESC +#define CONF_USB_COMPOSITE_LANGID_DESC +#endif +// + +// Composite Device Descriptor + +// bcdUSB +// <0x0200=> USB 2.0 version +// <0x0210=> USB 2.1 version +// usb_composite_bcdusb +#ifndef CONF_USB_COMPOSITE_BCDUSB +#define CONF_USB_COMPOSITE_BCDUSB 0x200 +#endif + +// bMaxPackeSize0 +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes +// usb_composite_bmaxpksz0 +#ifndef CONF_USB_COMPOSITE_BMAXPKSZ0 +#define CONF_USB_COMPOSITE_BMAXPKSZ0 0x40 +#endif + +// idVender <0x0000-0xFFFF> +// usb_composite_idvender +#ifndef CONF_USB_COMPOSITE_IDVENDER +#define CONF_USB_COMPOSITE_IDVENDER 0x3eb +#endif + +// idProduct <0x0000-0xFFFF> +// usb_composite_idproduct +#ifndef CONF_USB_COMPOSITE_IDPRODUCT +#define CONF_USB_COMPOSITE_IDPRODUCT 0x2421 +#endif + +// bcdDevice <0x0000-0xFFFF> +// usb_composite_bcddevice +#ifndef CONF_USB_COMPOSITE_BCDDEVICE +#define CONF_USB_COMPOSITE_BCDDEVICE 0x100 +#endif + +// Enable string descriptor of iManufact +// usb_composite_imanufact_en +#ifndef CONF_USB_COMPOSITE_IMANUFACT_EN +#define CONF_USB_COMPOSITE_IMANUFACT_EN 0 +#endif + +#ifndef CONF_USB_COMPOSITE_IMANUFACT +#define CONF_USB_COMPOSITE_IMANUFACT (CONF_USB_COMPOSITE_IMANUFACT_EN * (CONF_USB_COMPOSITE_IMANUFACT_EN)) +#endif + +// Unicode string of iManufact +// usb_composite_imanufact_str +#ifndef CONF_USB_COMPOSITE_IMANUFACT_STR +#define CONF_USB_COMPOSITE_IMANUFACT_STR "Atmel" +#endif + +#ifndef CONF_USB_COMPOSITE_IMANUFACT_STR_DESC +#define CONF_USB_COMPOSITE_IMANUFACT_STR_DESC +#endif + +// + +// Enable string descriptor of iProduct +// usb_composite_iproduct_en +#ifndef CONF_USB_COMPOSITE_IPRODUCT_EN +#define CONF_USB_COMPOSITE_IPRODUCT_EN 0 +#endif + +#ifndef CONF_USB_COMPOSITE_IPRODUCT +#define CONF_USB_COMPOSITE_IPRODUCT \ + (CONF_USB_COMPOSITE_IPRODUCT_EN * (CONF_USB_COMPOSITE_IMANUFACT_EN + CONF_USB_COMPOSITE_IPRODUCT_EN)) +#endif + +// Unicode string of iProduct +// usb_composite_iproduct_str +#ifndef CONF_USB_COMPOSITE_IPRODUCT_STR +#define CONF_USB_COMPOSITE_IPRODUCT_STR "Composite Demo" +#endif + +#ifndef CONF_USB_COMPOSITE_IPRODUCT_STR_DESC +#define CONF_USB_COMPOSITE_IPRODUCT_STR_DESC +#endif + +// + +// Enable string descriptor of iSerialNum +// usb_composite_iserialnum_en +#ifndef CONF_USB_COMPOSITE_ISERIALNUM_EN +#define CONF_USB_COMPOSITE_ISERIALNUM_EN 0 +#endif + +#ifndef CONF_USB_COMPOSITE_ISERIALNUM +#define CONF_USB_COMPOSITE_ISERIALNUM \ + (CONF_USB_COMPOSITE_ISERIALNUM_EN \ + * (CONF_USB_COMPOSITE_IMANUFACT_EN + CONF_USB_COMPOSITE_IPRODUCT_EN + CONF_USB_COMPOSITE_ISERIALNUM_EN)) +#endif + +// Unicode string of iSerialNum +// usb_composite_iserialnum_str +#ifndef CONF_USB_COMPOSITE_ISERIALNUM_STR +#define CONF_USB_COMPOSITE_ISERIALNUM_STR "123456789ABCDEF" +#endif + +#ifndef CONF_USB_COMPOSITE_ISERIALNUM_STR_DESC +#define CONF_USB_COMPOSITE_ISERIALNUM_STR_DESC +#endif + +// + +// bNumConfigurations <0x01-0xFF> +// usb_composite_bnumconfig +#ifndef CONF_USB_COMPOSITE_BNUMCONFIG +#define CONF_USB_COMPOSITE_BNUMCONFIG 0x1 +#endif + +// + +// Composite Configuration Descriptor +// bConfigurationValue <0x01-0xFF> +// usb_composite_bconfigval +#ifndef CONF_USB_COMPOSITE_BCONFIGVAL +#define CONF_USB_COMPOSITE_BCONFIGVAL 0x1 +#endif +// Enable string descriptor of iConfig +// usb_composite_iconfig_en +#ifndef CONF_USB_COMPOSITE_ICONFIG_EN +#define CONF_USB_COMPOSITE_ICONFIG_EN 0 +#endif + +#ifndef CONF_USB_COMPOSITE_ICONFIG +#define CONF_USB_COMPOSITE_ICONFIG \ + (CONF_USB_COMPOSITE_ICONFIG_EN \ + * (CONF_USB_COMPOSITE_IMANUFACT_EN + CONF_USB_COMPOSITE_IPRODUCT_EN + CONF_USB_COMPOSITE_ISERIALNUM_EN \ + + CONF_USB_COMPOSITE_ICONFIG_EN)) +#endif + +// Unicode string of iConfig +// usb_composite_iconfig_str +#ifndef CONF_USB_COMPOSITE_ICONFIG_STR +#define CONF_USB_COMPOSITE_ICONFIG_STR "" +#endif + +#ifndef CONF_USB_COMPOSITE_ICONFIG_STR_DESC +#define CONF_USB_COMPOSITE_ICONFIG_STR_DESC +#endif + +// + +// bmAttributes +// <0x80=> Bus power supply, not support for remote wakeup +// <0xA0=> Bus power supply, support for remote wakeup +// <0xC0=> Self powered, not support for remote wakeup +// <0xE0=> Self powered, support for remote wakeup +// usb_composite_bmattri +#ifndef CONF_USB_COMPOSITE_BMATTRI +#define CONF_USB_COMPOSITE_BMATTRI 0x80 +#endif + +// bMaxPower <0x00-0xFF> +// usb_composite_bmaxpower +#ifndef CONF_USB_COMPOSITE_BMAXPOWER +#define CONF_USB_COMPOSITE_BMAXPOWER 0x32 +#endif +// + +// CDC ACM Support +// usb_composite_cdc_acm_support +#ifndef CONF_USB_COMPOSITE_CDC_ACM_EN +#define CONF_USB_COMPOSITE_CDC_ACM_EN 0 +#endif + +// CDC ACM Comm Interrupt IN Endpoint Address +// <0x81=> EndpointAddress = 0x81 +// <0x82=> EndpointAddress = 0x82 +// <0x83=> EndpointAddress = 0x83 +// <0x84=> EndpointAddress = 0x84 +// <0x85=> EndpointAddress = 0x85 +// <0x86=> EndpointAddress = 0x86 +// <0x87=> EndpointAddress = 0x87 +// <0x88=> EndpointAddress = 0x88 +// <0x89=> EndpointAddress = 0x89 + +// usb_composite_cdc_acm_epaddr +#ifndef CONF_USB_COMPOSITE_CDC_ACM_COMM_INT_EPADDR +#define CONF_USB_COMPOSITE_CDC_ACM_COMM_INT_EPADDR 0x82 +#endif + +// CDC ACM Comm Interrupt IN Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_cdc_acm_comm_int_maxpksz +#ifndef CONF_USB_COMPOSITE_CDC_ACM_COMM_INT_MAXPKSZ +#define CONF_USB_COMPOSITE_CDC_ACM_COMM_INT_MAXPKSZ 0x40 +#endif + +// CDC ACM Data BULK IN Endpoint Address +// <0x81=> EndpointAddress = 0x81 +// <0x82=> EndpointAddress = 0x82 +// <0x83=> EndpointAddress = 0x83 +// <0x84=> EndpointAddress = 0x84 +// <0x85=> EndpointAddress = 0x85 +// <0x86=> EndpointAddress = 0x86 +// <0x87=> EndpointAddress = 0x87 +// <0x88=> EndpointAddress = 0x88 +// <0x89=> EndpointAddress = 0x89 + +// usb_composite_cdc_acm_data_bulkin_epaddr +#ifndef CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKIN_EPADDR +#define CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKIN_EPADDR 0x81 +#endif + +// CDC ACM Data BULK IN Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_cdc_acm_data_builin_maxpksz +#ifndef CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKIN_MAXPKSZ +#define CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKIN_MAXPKSZ 0x40 +#endif + +// CDC ACM Data BULK IN Endpoint wMaxPacketSize for High Speed +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes +// <0x0080=> 128 bytes +// <0x0100=> 256 bytes +// <0x0200=> 512 bytes + +// usb_composite_cdc_acm_data_builin_maxpksz_hs +#ifndef CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKIN_MAXPKSZ_HS +#define CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKIN_MAXPKSZ_HS 0x200 +#endif + +// CDC ACM Data BULK OUT Endpoint Address +// <0x01=> EndpointAddress = 0x01 +// <0x02=> EndpointAddress = 0x02 +// <0x03=> EndpointAddress = 0x03 +// <0x04=> EndpointAddress = 0x04 +// <0x05=> EndpointAddress = 0x05 +// <0x06=> EndpointAddress = 0x06 +// <0x07=> EndpointAddress = 0x07 +// <0x08=> EndpointAddress = 0x08 +// <0x09=> EndpointAddress = 0x09 + +// usb_composite_cdc_acm_data_bulkout_epaddr +#ifndef CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKOUT_EPADDR +#define CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKOUT_EPADDR 0x1 +#endif + +// CDC ACM Data BULK OUT Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_cdc_acm_data_buckout_maxpksz +#ifndef CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKOUT_MAXPKSZ +#define CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKOUT_MAXPKSZ 0x40 +#endif + +// CDC ACM Data BULK OUT Endpoint wMaxPacketSize for High Speed +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes +// <0x0080=> 128 bytes +// <0x0100=> 256 bytes +// <0x0200=> 512 bytes + +// usb_composite_cdc_acm_data_buckout_maxpksz_hs +#ifndef CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKOUT_MAXPKSZ_HS +#define CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKOUT_MAXPKSZ_HS 0x200 +#endif + +// CDC ACM Echo Demo generation +// conf_usb_composite_cdc_echo_demo +// Invoke cdcdf_acm_demo_init(buf[wMaxPacketSize]) to enable the echo demo. +// Buf is packet buffer for data receive and echo back. +// The buffer is 4 byte aligned to support DMA. +#ifndef CONF_USB_COMPOSITE_CDC_ECHO_DEMO +#define CONF_USB_COMPOSITE_CDC_ECHO_DEMO 0 +#endif + +// + +// HID Mouse Support +// usb_composite_hid_mouse_support +#ifndef CONF_USB_COMPOSITE_HID_MOUSE_EN +#define CONF_USB_COMPOSITE_HID_MOUSE_EN 0 +#endif + +// HID Mouse INTERRUPT IN Endpoint Address +// <0x81=> EndpointAddress = 0x81 +// <0x82=> EndpointAddress = 0x82 +// <0x83=> EndpointAddress = 0x83 +// <0x84=> EndpointAddress = 0x84 +// <0x85=> EndpointAddress = 0x85 +// <0x86=> EndpointAddress = 0x86 +// <0x87=> EndpointAddress = 0x87 +// <0x88=> EndpointAddress = 0x88 +// <0x89=> EndpointAddress = 0x89 + +// usb_composite_hid_mouse_intin_epaddr +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_MOUSE_INTIN_EPADDR +#define CONF_USB_COMPOSITE_HID_MOUSE_INTIN_EPADDR 0x83 +#endif + +// HID Mouse INTERRUPT IN Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_hid_mouse_intin_maxpksz +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_MOUSE_INTIN_MAXPKSZ +#define CONF_USB_COMPOSITE_HID_MOUSE_INTIN_MAXPKSZ 0x8 +#endif + +// HID Mouse Move Demo generation +// conf_usb_composite_hid_mouse_demo +// Invoke hiddf_demo_init(button1, button2, button3) to enabled the move demo. +// Button1 and button3 are the pins used for mouse moving left and right. +#ifndef CONF_USB_COMPOSITE_HID_MOUSE_DEMO +#define CONF_USB_COMPOSITE_HID_MOUSE_DEMO 0 +#endif + +// + +// HID Keyboard Support +// usb_composite_hid_keyboard_support +#ifndef CONF_USB_COMPOSITE_HID_KEYBOARD_EN +#define CONF_USB_COMPOSITE_HID_KEYBOARD_EN 0 +#endif + +// HID Keyboard INTERRUPT IN Endpoint Address +// <0x81=> EndpointAddress = 0x81 +// <0x82=> EndpointAddress = 0x82 +// <0x83=> EndpointAddress = 0x83 +// <0x84=> EndpointAddress = 0x84 +// <0x85=> EndpointAddress = 0x85 +// <0x86=> EndpointAddress = 0x86 +// <0x87=> EndpointAddress = 0x87 +// <0x88=> EndpointAddress = 0x88 +// <0x89=> EndpointAddress = 0x89 + +// usb_composite_hid_keyboard_intin_epaddr +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_KEYBOARD_INTIN_EPADDR +#define CONF_USB_COMPOSITE_HID_KEYBOARD_INTIN_EPADDR 0x84 +#endif + +// HID Keyboard INTERRUPT IN Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_hid_keyboard_intin_maxpksz +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_KEYBOARD_INTIN_MAXPKSZ +#define CONF_USB_COMPOSITE_HID_KEYBOARD_INTIN_MAXPKSZ 0x8 +#endif + +// HID Keyboard INTERRUPT OUT Endpoint Address +// <0x01=> EndpointAddress = 0x01 +// <0x02=> EndpointAddress = 0x02 +// <0x03=> EndpointAddress = 0x03 +// <0x04=> EndpointAddress = 0x04 +// <0x05=> EndpointAddress = 0x05 +// <0x06=> EndpointAddress = 0x06 +// <0x07=> EndpointAddress = 0x07 +// <0x08=> EndpointAddress = 0x08 +// <0x09=> EndpointAddress = 0x09 + +// usb_composite_hid_keyboard_intout_epaddr +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_KEYBOARD_INTOUT_EPADDR +#define CONF_USB_COMPOSITE_HID_KEYBOARD_INTOUT_EPADDR 0x2 +#endif + +// HID Keyboard INTERRUPT OUT Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_hid_keyboard_intout_maxpksz +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_KEYBOARD_INTOUT_MAXPKSZ +#define CONF_USB_COMPOSITE_HID_KEYBOARD_INTOUT_MAXPKSZ 0x8 +#endif + +// HID Keyboard Caps Lock Demo generation +// conf_usb_composite_hid_keyboard_demo +// Invoke hiddf_demo_init(button1, button2, button3) to enabled the move demo. +// Buffon2 is the pin used for keyboard CAPS LOCK simulation. +#ifndef CONF_USB_COMPOSITE_HID_KEYBOARD_DEMO +#define CONF_USB_COMPOSITE_HID_KEYBOARD_DEMO 0 +#endif + +// + +// HID Generic Support +// usb_composite_hid_generic_support +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_EN +#define CONF_USB_COMPOSITE_HID_GENERIC_EN 0 +#endif + +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_REPORT_LEN +#define CONF_USB_COMPOSITE_HID_GENERIC_REPORT_LEN 53 +#endif + +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_REPORT +#define CONF_USB_COMPOSITE_HID_GENERIC_REPORT \ + 0x06, 0xFF, 0xFF, 0x09, 0x01, 0xA1, 0x01, 0x09, 0x02, 0x09, 0x03, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08, 0x95, \ + 0x40, 0x81, 0x02, 0x09, 0x04, 0x09, 0x05, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08, 0x95, 0x40, 0x91, 0x02, \ + 0x09, 0x06, 0x09, 0x07, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08, 0x95, 0x04, 0xB1, 0x02, 0xC0 +#endif + +// HID Generic INTERRUPT IN Endpoint Address +// <0x81=> EndpointAddress = 0x81 +// <0x82=> EndpointAddress = 0x82 +// <0x83=> EndpointAddress = 0x83 +// <0x84=> EndpointAddress = 0x84 +// <0x85=> EndpointAddress = 0x85 +// <0x86=> EndpointAddress = 0x86 +// <0x87=> EndpointAddress = 0x87 +// <0x88=> EndpointAddress = 0x88 +// <0x89=> EndpointAddress = 0x89 + +// usb_composite_hid_generic_intin_epaddr +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_INTIN_EPADDR +#define CONF_USB_COMPOSITE_HID_GENERIC_INTIN_EPADDR 0x85 +#endif + +// HID Generic INTERRUPT IN Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_hid_generic_intin_maxpksz +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_INTIN_MAXPKSZ +#define CONF_USB_COMPOSITE_HID_GENERIC_INTIN_MAXPKSZ 0x40 +#endif + +// HID Generic INTERRUPT OUT Endpoint Address +// <0x01=> EndpointAddress = 0x01 +// <0x02=> EndpointAddress = 0x02 +// <0x03=> EndpointAddress = 0x03 +// <0x04=> EndpointAddress = 0x04 +// <0x05=> EndpointAddress = 0x05 +// <0x06=> EndpointAddress = 0x06 +// <0x07=> EndpointAddress = 0x07 +// <0x08=> EndpointAddress = 0x08 +// <0x09=> EndpointAddress = 0x09 + +// usb_composite_hid_generic_intout_epaddr +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_INTOUT_EPADDR +#define CONF_USB_COMPOSITE_HID_GENERIC_INTOUT_EPADDR 0x3 +#endif + +// HID Generic INTERRUPT OUT Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes +// usb_composite_hid_generic_intout_maxpksz +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_INTOUT_MAXPKSZ +#define CONF_USB_COMPOSITE_HID_GENERIC_INTOUT_MAXPKSZ 0x40 +#endif + +// + +// MSC Support +// usb_composite_msc_support +#ifndef CONF_USB_COMPOSITE_MSC_EN +#define CONF_USB_COMPOSITE_MSC_EN 0 +#endif + +// MSC BULK Endpoints wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_msc_bulk_maxpksz +#ifndef CONF_USB_COMPOSITE_MSC_BULK_MAXPKSZ +#define CONF_USB_COMPOSITE_MSC_BULK_MAXPKSZ 0x40 +#endif + +// MSC BULK Endpoints wMaxPacketSize for High Speed +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes +// <0x0080=> 128 bytes +// <0x0100=> 256 bytes +// <0x0200=> 512 bytes + +// usb_composite_msc_bulk_maxpksz_hs +#ifndef CONF_USB_COMPOSITE_MSC_BULK_MAXPKSZ_HS +#define CONF_USB_COMPOSITE_MSC_BULK_MAXPKSZ_HS 0x200 +#endif + +// MSC BULK IN Endpoint Address +// <0x81=> EndpointAddress = 0x81 +// <0x82=> EndpointAddress = 0x82 +// <0x83=> EndpointAddress = 0x83 +// <0x84=> EndpointAddress = 0x84 +// <0x85=> EndpointAddress = 0x85 +// <0x86=> EndpointAddress = 0x86 +// <0x87=> EndpointAddress = 0x87 +// <0x88=> EndpointAddress = 0x88 +// <0x89=> EndpointAddress = 0x89 + +// usb_composite_msc_bulkin_epaddr +#ifndef CONF_USB_COMPOSITE_MSC_BULKIN_EPADDR +#define CONF_USB_COMPOSITE_MSC_BULKIN_EPADDR 0x86 +#endif + +// MSC BULK OUT Endpoint Address +// <0x01=> EndpointAddress = 0x01 +// <0x02=> EndpointAddress = 0x02 +// <0x03=> EndpointAddress = 0x03 +// <0x04=> EndpointAddress = 0x04 +// <0x05=> EndpointAddress = 0x05 +// <0x06=> EndpointAddress = 0x06 +// <0x07=> EndpointAddress = 0x07 +// <0x08=> EndpointAddress = 0x08 +// <0x09=> EndpointAddress = 0x09 + +// usb_composite_msc_bulkout_epaddr +#ifndef CONF_USB_COMPOSITE_MSC_BULKOUT_EPADDR +#define CONF_USB_COMPOSITE_MSC_BULKOUT_EPADDR 0x4 +#endif + +// Enable Demo code for Disk LUN handling +// usb_composite_msc_demo_en +#ifndef CONF_USB_COMPOSITE_MSC_LUN_DEMO +#define CONF_USB_COMPOSITE_MSC_LUN_DEMO 1 +#endif + +// Disk access cache/buffer of sectors if non-RAM disk (e.g., SD/MMC) enabled <1-64> +// conf_usb_msc_lun_buf_sectors +#ifndef CONF_USB_MSC_LUN_BUF_SECTORS +#define CONF_USB_MSC_LUN_BUF_SECTORS 4 +#endif + +// Enable Demo for RAM Disk +// conf_usb_msc_lun0_enable +#ifndef CONF_USB_MSC_LUN0_ENABLE +#define CONF_USB_MSC_LUN0_ENABLE 1 +#endif + +#ifndef CONF_USB_MSC_LUN0_TYPE +#define CONF_USB_MSC_LUN0_TYPE 0x00 +#endif + +// The disk is removable +// conf_usb_msc_lun0_rmb +#ifndef CONF_USB_MSC_LUN0_RMB +#define CONF_USB_MSC_LUN0_RMB 0x1 +#endif + +#ifndef CONF_USB_MSC_LUN0_ISO +#define CONF_USB_MSC_LUN0_ISO 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN0_ECMA +#define CONF_USB_MSC_LUN0_ECMA 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN0_ANSI +#define CONF_USB_MSC_LUN0_ANSI 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN0_REPO +#define CONF_USB_MSC_LUN0_REPO 0x01 +#endif + +#ifndef CONF_USB_MSC_LUN0_FACTORY +#define CONF_USB_MSC_LUN0_FACTORY 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN0_PRODUCT +#define CONF_USB_MSC_LUN0_PRODUCT 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN0_PRODUCT_VERSION +#define CONF_USB_MSC_LUN0_PRODUCT_VERSION 0x00, 0x00, 0x00, 0x00 +#endif + +// Disk Size (in KB) <0x1-0xFFFFFFFF> +// Windows will not show disk less than 20K, so 22K is used to reserve more RAM for APP +// conf_usb_msc_lun0_capacity + +#ifndef CONF_USB_MSC_LUN0_CAPACITY +#define CONF_USB_MSC_LUN0_CAPACITY 22 +#endif + +#ifndef CONF_USB_MSC_LUN0_BLOCK_SIZE +#define CONF_USB_MSC_LUN0_BLOCK_SIZE 512 +#endif + +#ifndef CONF_USB_MSC_LUN0_LAST_BLOCK_ADDR +#define CONF_USB_MSC_LUN0_LAST_BLOCK_ADDR \ + ((uint32_t)CONF_USB_MSC_LUN0_CAPACITY * 1024 / CONF_USB_MSC_LUN0_BLOCK_SIZE - 1) +#endif + +// + +// Enable Demo for SD/MMC Disk +// SD/MMC stack must be added before enable SD/MMC demo +// SD/MMC insert/eject not supported by this simple demo +// conf_usb_msc_lun1_enable +#ifndef CONF_USB_MSC_LUN1_ENABLE +#define CONF_USB_MSC_LUN1_ENABLE 0 +#endif + +#ifndef CONF_USB_MSC_LUN1_TYPE +#define CONF_USB_MSC_LUN1_TYPE 0x00 +#endif + +// The disk is removable +// SD/MMC stack must be added before enable SD/MMC demo +// SD/MMC insert/eject not supported by this simple demo +// conf_usb_msc_lun1_rmb +#ifndef CONF_USB_MSC_LUN1_RMB +#define CONF_USB_MSC_LUN1_RMB 0x1 +#endif + +#ifndef CONF_USB_MSC_LUN1_ISO +#define CONF_USB_MSC_LUN1_ISO 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN1_ECMA +#define CONF_USB_MSC_LUN1_ECMA 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN1_ANSI +#define CONF_USB_MSC_LUN1_ANSI 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN1_REPO +#define CONF_USB_MSC_LUN1_REPO 0x01 +#endif + +#ifndef CONF_USB_MSC_LUN1_FACTORY +#define CONF_USB_MSC_LUN1_FACTORY 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN1_PRODUCT +#define CONF_USB_MSC_LUN1_PRODUCT 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN1_PRODUCT_VERSION +#define CONF_USB_MSC_LUN1_PRODUCT_VERSION 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN1_CAPACITY +#define CONF_USB_MSC_LUN1_CAPACITY 22 +#endif + +#ifndef CONF_USB_MSC_LUN1_BLOCK_SIZE +#define CONF_USB_MSC_LUN1_BLOCK_SIZE 512 +#endif + +#ifndef CONF_USB_MSC_LUN1_LAST_BLOCK_ADDR +#define CONF_USB_MSC_LUN1_LAST_BLOCK_ADDR \ + ((uint32_t)CONF_USB_MSC_LUN1_CAPACITY * 1024 / CONF_USB_MSC_LUN1_BLOCK_SIZE - 1) +#endif + +// + +// Enable Demo for LUN 2 +// conf_usb_msc_lun2_enable +#ifndef CONF_USB_MSC_LUN2_ENABLE +#define CONF_USB_MSC_LUN2_ENABLE 0 +#endif + +#ifndef CONF_USB_MSC_LUN2_TYPE +#define CONF_USB_MSC_LUN2_TYPE 0x00 +#endif + +// The disk is removable +// conf_usb_msc_lun2_rmb +#ifndef CONF_USB_MSC_LUN2_RMB +#define CONF_USB_MSC_LUN2_RMB 0x1 +#endif + +#ifndef CONF_USB_MSC_LUN2_ISO +#define CONF_USB_MSC_LUN2_ISO 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN2_ECMA +#define CONF_USB_MSC_LUN2_ECMA 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN2_ANSI +#define CONF_USB_MSC_LUN2_ANSI 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN2_REPO +#define CONF_USB_MSC_LUN2_REPO 0x01 +#endif + +#ifndef CONF_USB_MSC_LUN2_FACTORY +#define CONF_USB_MSC_LUN2_FACTORY 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN2_PRODUCT +#define CONF_USB_MSC_LUN2_PRODUCT 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN2_PRODUCT_VERSION +#define CONF_USB_MSC_LUN2_PRODUCT_VERSION 0x00, 0x00, 0x00, 0x00 +#endif + +// Disk Size (in KB) <0x1-0xFFFFFFFF> +// conf_usb_msc_lun2_capacity + +#ifndef CONF_USB_MSC_LUN2_CAPACITY +#define CONF_USB_MSC_LUN2_CAPACITY 22 +#endif + +#ifndef CONF_USB_MSC_LUN2_BLOCK_SIZE +#define CONF_USB_MSC_LUN2_BLOCK_SIZE 512 +#endif + +#ifndef CONF_USB_MSC_LUN2_LAST_BLOCK_ADDR +#define CONF_USB_MSC_LUN2_LAST_BLOCK_ADDR \ + ((uint32_t)CONF_USB_MSC_LUN2_CAPACITY * 1024 / CONF_USB_MSC_LUN2_BLOCK_SIZE - 1) +#endif + +// + +// Enable Demo for LUN 3 +// conf_usb_msc_lun3_enable +#ifndef CONF_USB_MSC_LUN3_ENABLE +#define CONF_USB_MSC_LUN3_ENABLE 0 +#endif + +#ifndef CONF_USB_MSC_LUN3_TYPE +#define CONF_USB_MSC_LUN3_TYPE 0x00 +#endif + +// The disk is removable +// conf_usb_msc_lun3_rmb +#ifndef CONF_USB_MSC_LUN3_RMB +#define CONF_USB_MSC_LUN3_RMB 0x1 +#endif + +#ifndef CONF_USB_MSC_LUN3_ISO +#define CONF_USB_MSC_LUN3_ISO 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN3_ECMA +#define CONF_USB_MSC_LUN3_ECMA 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN3_ANSI +#define CONF_USB_MSC_LUN3_ANSI 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN3_REPO +#define CONF_USB_MSC_LUN3_REPO 0x01 +#endif + +#ifndef CONF_USB_MSC_LUN3_FACTORY +#define CONF_USB_MSC_LUN3_FACTORY 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN3_PRODUCT +#define CONF_USB_MSC_LUN3_PRODUCT 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN3_PRODUCT_VERSION +#define CONF_USB_MSC_LUN3_PRODUCT_VERSION 0x00, 0x00, 0x00, 0x00 +#endif + +// Disk Size (in KB) <0x1-0xFFFFFFFF> +// conf_usb_msc_lun3_capacity + +#ifndef CONF_USB_MSC_LUN3_CAPACITY +#define CONF_USB_MSC_LUN3_CAPACITY 22 +#endif + +#ifndef CONF_USB_MSC_LUN3_BLOCK_SIZE +#define CONF_USB_MSC_LUN3_BLOCK_SIZE 512 +#endif + +#ifndef CONF_USB_MSC_LUN3_LAST_BLOCK_ADDR +#define CONF_USB_MSC_LUN3_LAST_BLOCK_ADDR \ + ((uint32_t)CONF_USB_MSC_LUN3_CAPACITY * 1024 / CONF_USB_MSC_LUN3_BLOCK_SIZE - 1) +#endif + +// + +// +// + +// <<< end of configuration section >>> + +#endif // USBD_CONFIG_H diff --git a/ports/atmel-samd/boards/feather_m4_can/board.c b/ports/atmel-samd/boards/feather_m4_can/board.c new file mode 100644 index 0000000000..8096b9b8ea --- /dev/null +++ b/ports/atmel-samd/boards/feather_m4_can/board.c @@ -0,0 +1,38 @@ +/* + * 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 "boards/board.h" +#include "mpconfigboard.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.h b/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.h new file mode 100644 index 0000000000..20c4670e25 --- /dev/null +++ b/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.h @@ -0,0 +1,35 @@ +#define MICROPY_HW_BOARD_NAME "Adafruit Feather M4 CAN" +#define MICROPY_HW_MCU_NAME "same51j19a" + +#define CIRCUITPY_MCU_FAMILY samd51 + +// Rev E + +#define MICROPY_HW_LED_STATUS (&pin_PA23) +#define MICROPY_HW_NEOPIXEL (&pin_PB03) + +// These are pins not to reset. +// QSPI Data pins +#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11) +// QSPI CS, QSPI SCK and NeoPixel pin +#define MICROPY_PORT_B (PORT_PB03 | PORT_PB10 | PORT_PB11) +#define MICROPY_PORT_C (0) +#define MICROPY_PORT_D (0) + +#define EXTERNAL_FLASH_QSPI_DUAL + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA13) +#define DEFAULT_I2C_BUS_SDA (&pin_PA12) + +#define DEFAULT_SPI_BUS_SCK (&pin_PA17) +#define DEFAULT_SPI_BUS_MOSI (&pin_PB23) +#define DEFAULT_SPI_BUS_MISO (&pin_PB22) + +#define DEFAULT_UART_BUS_RX (&pin_PB17) +#define DEFAULT_UART_BUS_TX (&pin_PB16) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk new file mode 100644 index 0000000000..306e7fe42b --- /dev/null +++ b/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk @@ -0,0 +1,14 @@ +USB_VID = 0x239A +USB_PID = 0x80CE +USB_PRODUCT = "Feather M4 CAN" +USB_MANUFACTURER = "Adafruit Industries LLC" + +CHIP_VARIANT = SAME51J19A +CHIP_FAMILY = same51 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = GD25Q16C +LONGINT_IMPL = MPZ + +CIRCUITPY_VECTORIO = 1 diff --git a/ports/atmel-samd/boards/feather_m4_can/pins.c b/ports/atmel-samd/boards/feather_m4_can/pins.c new file mode 100644 index 0000000000..2b67709f87 --- /dev/null +++ b/ports/atmel-samd/boards/feather_m4_can/pins.c @@ -0,0 +1,61 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA02) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PA05) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PB08) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PB09) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PA04) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_PA06) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_PA17) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB23) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_PB23) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB22) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_PB22) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PB17) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB17) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PB16) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB16) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA20) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA21) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA23) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PB03) }, + + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PB01) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR(&pin_PB15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR(&pin_PB14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_STANDBY), MP_ROM_PTR(&pin_PB13) }, + + { 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_global_dict_table); diff --git a/ports/atmel-samd/common-hal/neopixel_write/__init__.c b/ports/atmel-samd/common-hal/neopixel_write/__init__.c index 43c8575cb3..6f2090b983 100644 --- a/ports/atmel-samd/common-hal/neopixel_write/__init__.c +++ b/ports/atmel-samd/common-hal/neopixel_write/__init__.c @@ -34,6 +34,9 @@ #if defined(SAME54) #include "hri/hri_cmcc_e54.h" #include "hri/hri_nvmctrl_e54.h" +#elif defined(SAME51) +#include "hri/hri_cmcc_e51.h" +#include "hri/hri_nvmctrl_e51.h" #elif defined(SAMD51) #include "hri/hri_cmcc_d51.h" #include "hri/hri_nvmctrl_d51.h" diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 0f5f1522d0..15fd96f4d8 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 0f5f1522d09c8fa7d858edec484a994c21c59668 +Subproject commit 15fd96f4d8c38d5490767ea09469b82a231a768d diff --git a/ports/atmel-samd/supervisor/internal_flash.c b/ports/atmel-samd/supervisor/internal_flash.c index ecb59f836e..4c7ca0dc76 100644 --- a/ports/atmel-samd/supervisor/internal_flash.c +++ b/ports/atmel-samd/supervisor/internal_flash.c @@ -39,6 +39,9 @@ #ifdef SAMD21 #include "hpl/pm/hpl_pm_base.h" #endif +#ifdef SAME51 +#include "hri/hri_mclk_e51.h" +#endif #ifdef SAME54 #include "hri/hri_mclk_e54.h" #endif diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 6352afb1d4..8d52c30c53 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -44,6 +44,9 @@ #include "hri/hri_pm_d21.h" #elif defined(SAME54) #include "hri/hri_rstc_e54.h" +#elif defined(SAME51) +#include "sam.h" +#include "hri/hri_rstc_e51.h" #elif defined(SAMD51) #include "hri/hri_rstc_d51.h" #else diff --git a/ports/atmel-samd/supervisor/same51_cpu.s b/ports/atmel-samd/supervisor/same51_cpu.s new file mode 100755 index 0000000000..9e6807a5e2 --- /dev/null +++ b/ports/atmel-samd/supervisor/same51_cpu.s @@ -0,0 +1,27 @@ +.syntax unified +.cpu cortex-m4 +.thumb +.text +.align 2 + +@ uint cpu_get_regs_and_sp(r0=uint regs[10]) +.global cpu_get_regs_and_sp +.thumb +.thumb_func +.type cpu_get_regs_and_sp, %function +cpu_get_regs_and_sp: +@ store registers into given array +str r4, [r0], #4 +str r5, [r0], #4 +str r6, [r0], #4 +str r7, [r0], #4 +str r8, [r0], #4 +str r9, [r0], #4 +str r10, [r0], #4 +str r11, [r0], #4 +str r12, [r0], #4 +str r13, [r0], #4 + +@ return the sp +mov r0, sp +bx lr From baa2d7fd56c65f0003f4a5b17849c6bc2f3d37a7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Sep 2020 14:08:52 -0500 Subject: [PATCH 0806/1293] add new board to CI --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6bb9612f81..fef3da615c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -208,6 +208,7 @@ jobs: - "feather_m0_rfm69" - "feather_m0_rfm9x" - "feather_m0_supersized" + - "feather_m4_can" - "feather_m4_express" - "feather_m7_1011" - "feather_mimxrt1011" From b49099c8f3dd957a3e7aa34a62cf68bcf4bd024b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Sep 2020 15:31:13 -0500 Subject: [PATCH 0807/1293] additional asf4 updates --- ports/atmel-samd/asf4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/asf4 b/ports/atmel-samd/asf4 index f99e36fb00..1b87f18f80 160000 --- a/ports/atmel-samd/asf4 +++ b/ports/atmel-samd/asf4 @@ -1 +1 @@ -Subproject commit f99e36fb008588bd9ff005099b3b89b7952fcfba +Subproject commit 1b87f18f8091f258e63f85cef54bcc7bafd44598 From 99f5011d74e3d059a59f7c382974d57f03a0b6e9 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 8 Sep 2020 17:06:09 -0700 Subject: [PATCH 0808/1293] Fix heap without PSRAM. Never set heap_size. --- ports/esp32s2/supervisor/port.c | 15 +++++---------- supervisor/shared/safe_mode.c | 4 ++++ supervisor/shared/safe_mode.h | 1 + 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 89ab166d51..e52b7f3762 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -59,8 +59,6 @@ void tick_timer_cb(void* arg) { supervisor_tick(); } -uint32_t* heap; - safe_mode_t port_init(void) { esp_timer_create_args_t args; args.callback = &tick_timer_cb; @@ -69,7 +67,7 @@ safe_mode_t port_init(void) { args.name = "CircuitPython Tick"; esp_timer_create(&args, &_tick_timer); - heap = malloc(HEAP_SIZE); + heap = NULL; never_reset_module_internal_pins(); #ifdef CONFIG_SPIRAM @@ -81,6 +79,10 @@ safe_mode_t port_init(void) { heap = malloc(HEAP_SIZE); heap_size = HEAP_SIZE / sizeof(uint32_t); } + if (heap == NULL) { + return NO_HEAP; + } + return NO_SAFE_MODE; } @@ -142,13 +144,6 @@ supervisor_allocation* port_fixed_stack(void) { return &_fixed_stack; } -supervisor_allocation _fixed_heap; -supervisor_allocation* port_fixed_heap(void) { - _fixed_heap.ptr = port_heap_get_bottom(); - _fixed_heap.length = (port_heap_get_top() - port_heap_get_bottom()) * sizeof(uint32_t); - return &_fixed_heap; -} - // Place the word to save just after our BSS section that gets blanked. void port_set_saved_word(uint32_t value) { } diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index 3275cc66f3..29a0a6a4ff 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -133,6 +133,10 @@ void print_safe_mode_message(safe_mode_t reason) { serial_write_compressed(translate("The CircuitPython heap was corrupted because the stack was too small.\nPlease increase the stack size if you know how, or if not:")); serial_write_compressed(FILE_AN_ISSUE); return; + case NO_HEAP: + serial_write_compressed(translate("CircuitPython was unable to allocate the heap.\n")); + serial_write_compressed(FILE_AN_ISSUE); + return; default: break; } diff --git a/supervisor/shared/safe_mode.h b/supervisor/shared/safe_mode.h index c160739aec..7d3cd63b58 100644 --- a/supervisor/shared/safe_mode.h +++ b/supervisor/shared/safe_mode.h @@ -42,6 +42,7 @@ typedef enum { FLASH_WRITE_FAIL, MEM_MANAGE, WATCHDOG_RESET, + NO_HEAP, } safe_mode_t; safe_mode_t wait_for_safe_mode_reset(void); From bdb07adfccaf25576a8f1e074db7f8b7e48890b2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Sep 2020 19:07:53 -0500 Subject: [PATCH 0809/1293] translations: Make decompression clearer Now this gets filled in with values e.g., 128 (0x80) and 159 (0x9f). --- py/makeqstrdata.py | 9 ++++++++- supervisor/shared/translate.c | 15 +++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 40c50b7b43..721fa83206 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -159,7 +159,14 @@ def compute_huffman_coding(translations, qstrs, compression_filename): f.write("const uint8_t lengths[] = {{ {} }};\n".format(", ".join(map(str, lengths)))) f.write("const {} values[] = {{ {} }};\n".format(values_type, ", ".join(str(ord(u)) for u in values))) f.write("#define compress_max_length_bits ({})\n".format(max_translation_encoded_length.bit_length())) - f.write("const {} ngrams[] = {{ {} }};\n".format(values_type, ", ".join(str(u) for u in ngramdata))) + f.write("const {} bigrams[] = {{ {} }};\n".format(values_type, ", ".join(str(u) for u in ngramdata))) + if len(ngrams) > 32: + bigram_start = 0xe000 + else: + bigram_start = 0x80 + bigram_end = bigram_start + len(ngrams) - 1 # End is inclusive + f.write("#define bigram_start {}\n".format(bigram_start)) + f.write("#define bigram_end {}\n".format(bigram_end)) return values, lengths, ngrams def decompress(encoding_table, encoded, encoded_length_bits): diff --git a/supervisor/shared/translate.c b/supervisor/shared/translate.c index 49ee8f143f..0235293bee 100644 --- a/supervisor/shared/translate.c +++ b/supervisor/shared/translate.c @@ -47,19 +47,18 @@ STATIC int put_utf8(char *buf, int u) { if(u <= 0x7f) { *buf = u; return 1; - } else if(MP_ARRAY_SIZE(ngrams) <= 64 && u <= 0xbf) { + } else if(bigram_start <= u && u <= bigram_end) { int n = (u - 0x80) * 2; - int ret = put_utf8(buf, ngrams[n]); - return ret + put_utf8(buf + ret, ngrams[n+1]); + // (note that at present, entries in the bigrams table are + // guaranteed not to represent bigrams themselves, so this adds + // at most 1 level of recursive call + int ret = put_utf8(buf, bigrams[n]); + return ret + put_utf8(buf + ret, bigrams[n+1]); } else if(u <= 0x07ff) { *buf++ = 0b11000000 | (u >> 6); *buf = 0b10000000 | (u & 0b00111111); return 2; - } else if(MP_ARRAY_SIZE(ngrams) > 64 && u >= 0xe000 && u <= 0xf8ff) { - int n = (u - 0xe000) * 2; - int ret = put_utf8(buf, ngrams[n]); - return ret + put_utf8(buf + ret, ngrams[n+1]); - } else { // u <= 0xffff) + } else { // u <= 0xffff *buf++ = 0b11000000 | (u >> 12); *buf = 0b10000000 | ((u >> 6) & 0b00111111); *buf = 0b10000000 | (u & 0b00111111); From d600759bc808c5e78d429b6da8c824f5574cee82 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Tue, 8 Sep 2020 20:02:34 -0500 Subject: [PATCH 0810/1293] Utilize MIN and MAX functions from py/misc.h --- shared-module/displayio/Shape.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/shared-module/displayio/Shape.c b/shared-module/displayio/Shape.c index a09191cce1..4f481f2244 100644 --- a/shared-module/displayio/Shape.c +++ b/shared-module/displayio/Shape.c @@ -29,6 +29,7 @@ #include #include "py/runtime.h" +#include "py/misc.h" void common_hal_displayio_shape_construct(displayio_shape_t *self, uint32_t width, uint32_t height, bool mirror_x, bool mirror_y) { @@ -76,20 +77,12 @@ void common_hal_displayio_shape_set_boundary(displayio_shape_t *self, uint16_t y uint16_t lower_x, upper_x; // find x-boundaries for updating based on current data and start_x, end_x - if (start_x < self->data[2 * y]) { - lower_x = start_x; - } else { - lower_x = self->data[2 * y]; - } + lower_x = MIN(start_x, self->data[2 * y]); if (self->mirror_x) { upper_x = self->width-lower_x; } else { - if (end_x > self->data[2 * y + 1]) { - upper_x = end_x + 1; - } else { - upper_x = self->data[2 * y + 1] + 1; - } + upper_x = 1 + MAX(end_x, self->data[2 * y + 1]); } self->data[2 * y] = start_x; @@ -105,12 +98,10 @@ void common_hal_displayio_shape_set_boundary(displayio_shape_t *self, uint16_t y self->dirty_area.y2 = y+1; } } else { // Dirty region is not empty - if (lower_x < self->dirty_area.x1) { - self->dirty_area.x1 = lower_x; - } - if (upper_x > self->dirty_area.x2) { - self->dirty_area.x2 = upper_x; - } + + self->dirty_area.x1 = MIN(lower_x, self->dirty_area.x1); + self->dirty_area.x2 = MAX(upper_x, self->dirty_area.x2); + if (y < self->dirty_area.y1) { self->dirty_area.y1=y; if (self->mirror_y) { // if y is mirrored and the lower y was updated, the upper y must be updated too From 0eee93729a3074461c4907f03deb803c2f35a6fe Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Sep 2020 20:54:47 -0500 Subject: [PATCH 0811/1293] Fix decompression of unicode values above 2047 Two problems: The lead byte for 3-byte sequences was wrong, and one mid-byte was not even filled in due to a missing "++"! Apparently this was broken ever since the first "Compress as unicode, not bytes" commit, but I believed I'd "tested" it by running on the Pinyin translation. This rendered at least the Korean and Japanese translations completely illegible, affecting 5.0 and all later releases. --- supervisor/shared/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervisor/shared/translate.c b/supervisor/shared/translate.c index 0235293bee..5cd7b8dd88 100644 --- a/supervisor/shared/translate.c +++ b/supervisor/shared/translate.c @@ -59,8 +59,8 @@ STATIC int put_utf8(char *buf, int u) { *buf = 0b10000000 | (u & 0b00111111); return 2; } else { // u <= 0xffff - *buf++ = 0b11000000 | (u >> 12); - *buf = 0b10000000 | ((u >> 6) & 0b00111111); + *buf++ = 0b11100000 | (u >> 12); + *buf++ = 0b10000000 | ((u >> 6) & 0b00111111); *buf = 0b10000000 | (u & 0b00111111); return 3; } From 24a18c63f9d3990661cc58888896faba9c8fad50 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 9 Sep 2020 09:32:25 -0500 Subject: [PATCH 0812/1293] Moved SPI unlock to reset_board_busses() --- shared-module/board/__init__.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index 903b8fa716..153aa086cc 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -89,8 +89,6 @@ mp_obj_t common_hal_board_create_spi(void) { const mcu_pin_obj_t* mosi = MP_OBJ_TO_PTR(DEFAULT_SPI_BUS_MOSI); const mcu_pin_obj_t* miso = MP_OBJ_TO_PTR(DEFAULT_SPI_BUS_MISO); common_hal_busio_spi_construct(self, clock, mosi, miso); - // make sure lock is not held initially - common_hal_busio_spi_unlock(self); spi_singleton = (mp_obj_t)self; return spi_singleton; } @@ -153,6 +151,7 @@ void reset_board_busses(void) { #endif #if BOARD_SPI bool display_using_spi = false; + busio_spi_obj_t *self = &spi_obj; #if CIRCUITPY_DISPLAYIO for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { mp_const_obj_t bus_type = displays[i].bus_base.type; @@ -169,6 +168,8 @@ void reset_board_busses(void) { } #endif if (!display_using_spi) { + // make sure lock is not held over a soft reset + common_hal_busio_spi_unlock(self); spi_singleton = NULL; } #endif From 59165cabbe1c27260678c4e252465b11e1cf8c0e Mon Sep 17 00:00:00 2001 From: root Date: Wed, 9 Sep 2020 10:36:55 -0500 Subject: [PATCH 0813/1293] Removed unneeded pointer --- shared-module/board/__init__.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index 153aa086cc..ae06597910 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -151,7 +151,6 @@ void reset_board_busses(void) { #endif #if BOARD_SPI bool display_using_spi = false; - busio_spi_obj_t *self = &spi_obj; #if CIRCUITPY_DISPLAYIO for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { mp_const_obj_t bus_type = displays[i].bus_base.type; @@ -169,7 +168,7 @@ void reset_board_busses(void) { #endif if (!display_using_spi) { // make sure lock is not held over a soft reset - common_hal_busio_spi_unlock(self); + common_hal_busio_spi_unlock(&spi_obj); spi_singleton = NULL; } #endif From 5322aa5fcd5c79b84781cfd62d17ad5fbeab37eb Mon Sep 17 00:00:00 2001 From: Jelle Jager Date: Tue, 8 Sep 2020 23:49:21 +0000 Subject: [PATCH 0814/1293] Translated using Weblate (Dutch) Currently translated at 99.2% (779 of 785 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/nl/ --- locale/nl.po | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index 9cce2523ed..ead58bb78b 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -6,15 +6,15 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-08-30 14:38-0400\n" -"PO-Revision-Date: 2020-08-10 19:59+0000\n" -"Last-Translator: _fonzlate \n" +"PO-Revision-Date: 2020-09-09 16:05+0000\n" +"Last-Translator: Jelle Jager \n" "Language-Team: none\n" "Language: nl\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.2-dev\n" +"X-Generator: Weblate 4.3-dev\n" #: main.c msgid "" @@ -456,10 +456,8 @@ msgid "Buffer length must be a multiple of 512" msgstr "Buffer lengte moet een veelvoud van 512 zijn" #: ports/stm/common-hal/sdioio/SDCard.c -#, fuzzy -#| msgid "Buffer length must be a multiple of 512" msgid "Buffer must be a multiple of 512 bytes" -msgstr "Buffer lengte moet een veelvoud van 512 zijn" +msgstr "Buffer moet een veelvoud van 512 zijn" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -502,7 +500,7 @@ msgstr "Kan CCCD niet toewijzen aan lokaal Characteristic" #: shared-bindings/_bleio/Adapter.c msgid "Cannot create a new Adapter; use _bleio.adapter;" -msgstr "" +msgstr "Kan geen nieuwe Adapter creëren; gebruik _bleio.adapter;" #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c @@ -662,10 +660,8 @@ msgid "Could not restart PWM" msgstr "Kan PWM niet herstarten" #: shared-bindings/_bleio/Adapter.c -#, fuzzy -#| msgid "Could not start PWM" msgid "Could not set address" -msgstr "Kan PWM niet starten" +msgstr "Kan adres niet zetten" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" @@ -778,7 +774,7 @@ msgstr "Verwachtte een Characteristic" #: shared-bindings/_bleio/Adapter.c msgid "Expected a DigitalInOut" -msgstr "" +msgstr "Verwachtte een DigitalInOut" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" @@ -786,7 +782,7 @@ msgstr "Verwachtte een Service" #: shared-bindings/_bleio/Adapter.c msgid "Expected a UART" -msgstr "" +msgstr "Verwachtte een UART" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c @@ -860,7 +856,7 @@ msgstr "Bestand bestaat" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" -msgstr "" +msgstr "Framebuffer benodigd %d bytes" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." @@ -957,10 +953,8 @@ msgstr "Ongeldige %q pin" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c #: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c -#, fuzzy -#| msgid "Invalid I2C pin selection" msgid "Invalid %q pin selection" -msgstr "Ongeldige I2C pin selectie" +msgstr "Ongeldige %q pin selectie" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" @@ -1478,13 +1472,12 @@ msgstr "SDA of SCL hebben een pullup nodig" #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" -msgstr "" +msgstr "SDIO GetCardInfo Fout %d" #: ports/stm/common-hal/sdioio/SDCard.c -#, fuzzy, c-format -#| msgid "SPI Init Error" +#, c-format msgid "SDIO Init Error %d" -msgstr "SPI Init Fout" +msgstr "SDIO Init Fout %d" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" @@ -2731,7 +2724,7 @@ msgstr "max_length moet 0-%d zijn als fixed_length %s is" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "max_length must be > 0" -msgstr "" +msgstr "max_length moet >0 zijn" #: py/runtime.c msgid "maximum recursion depth exceeded" From 2529ee2359a6402505172a0046e491d7deb32362 Mon Sep 17 00:00:00 2001 From: Jerry Needell Date: Wed, 9 Sep 2020 14:54:20 -0400 Subject: [PATCH 0815/1293] freeze rfm69 and bus_device libraries int feather_m0_rfm69 --- .gitmodules | 3 +++ frozen/Adafruit_CircuitPython_RFM69 | 1 + .../boards/feather_m0_rfm69/mpconfigboard.mk | 17 +++++++++++++++++ 3 files changed, 21 insertions(+) create mode 160000 frozen/Adafruit_CircuitPython_RFM69 diff --git a/.gitmodules b/.gitmodules index f922aae1db..3603cea696 100644 --- a/.gitmodules +++ b/.gitmodules @@ -150,3 +150,6 @@ [submodule "frozen/Adafruit_CircuitPython_RFM9x"] path = frozen/Adafruit_CircuitPython_RFM9x url = https://github.com/adafruit/Adafruit_CircuitPython_RFM9x.git +[submodule "frozen/Adafruit_CircuitPython_RFM69"] + path = frozen/Adafruit_CircuitPython_RFM69 + url = https://github.com/adafruit/Adafruit_CircuitPython_RFM69.git diff --git a/frozen/Adafruit_CircuitPython_RFM69 b/frozen/Adafruit_CircuitPython_RFM69 new file mode 160000 index 0000000000..c0b9bdf229 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_RFM69 @@ -0,0 +1 @@ +Subproject commit c0b9bdf22997552396abb514a6304d33460c2912 diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk index 7556b9517f..b589ae7665 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk @@ -10,4 +10,21 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 +# A number of modules are removed for RFM69 to make room for frozen libraries. +# Many I/O functions are not available. +CIRCUITPY_ANALOGIO = 0 +CIRCUITPY_PULSEIO = 0 +CIRCUITPY_NEOPIXEL_WRITE = 1 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_RTC = 0 +CIRCUITPY_SAMD = 0 +CIRCUITPY_USB_MIDI = 0 +CIRCUITPY_USB_HID = 0 +CIRCUITPY_TOUCHIO = 0 +CFLAGS_INLINE_LIMIT = 35 +# Make more room. SUPEROPT_GC = 0 + +# Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_RFM69 From f3fc7c1c72b4119112c198cfc22fb1799d9f566c Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 9 Sep 2020 14:34:57 -0700 Subject: [PATCH 0816/1293] Add safe mode translation --- locale/circuitpython.pot | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index d0a314d0c3..af9491c042 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-03 16:33-0700\n" +"POT-Creation-Date: 2020-09-09 14:33-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -582,6 +582,10 @@ msgid "" "boot. Press again to exit safe mode.\n" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "" From 40f3cd3615ca7be009ba2deb37209fa4d3993bf9 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 10 Sep 2020 13:26:51 -0400 Subject: [PATCH 0817/1293] Change `.report` to `.last_received_report` --- shared-bindings/usb_hid/Device.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/shared-bindings/usb_hid/Device.c b/shared-bindings/usb_hid/Device.c index a6c268c74d..8f28bc422d 100644 --- a/shared-bindings/usb_hid/Device.c +++ b/shared-bindings/usb_hid/Device.c @@ -58,21 +58,21 @@ STATIC mp_obj_t usb_hid_device_send_report(mp_obj_t self_in, mp_obj_t buffer) { } MP_DEFINE_CONST_FUN_OBJ_2(usb_hid_device_send_report_obj, usb_hid_device_send_report); -//| report: bytes -//| """The HID OUT report as a `bytes`. (read-only)""" +//| last_received_report: bytes +//| """The HID OUT report as a `bytes`. (read-only). `None` if nothing received.""" //| -STATIC mp_obj_t usb_hid_device_obj_get_report(mp_obj_t self_in) { +STATIC mp_obj_t usb_hid_device_obj_get_last_received_report(mp_obj_t self_in) { usb_hid_device_obj_t *self = MP_OBJ_TO_PTR(self_in); if (self->out_report_buffer == 0) { return mp_const_none; } return mp_obj_new_bytes(self->out_report_buffer, self->out_report_length); } -MP_DEFINE_CONST_FUN_OBJ_1(usb_hid_device_get_report_obj, usb_hid_device_obj_get_report); +MP_DEFINE_CONST_FUN_OBJ_1(usb_hid_device_get_last_received_report_obj, usb_hid_device_obj_get_last_received_report); -const mp_obj_property_t usb_hid_device_report_obj = { +const mp_obj_property_t usb_hid_device_last_received_report_obj = { .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&usb_hid_device_get_report_obj, + .proxy = {(mp_obj_t)&usb_hid_device_get_last_received_report_obj, (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj}, }; @@ -114,10 +114,10 @@ const mp_obj_property_t usb_hid_device_usage_obj = { }; STATIC const mp_rom_map_elem_t usb_hid_device_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_send_report), MP_ROM_PTR(&usb_hid_device_send_report_obj) }, - { MP_ROM_QSTR(MP_QSTR_report), MP_ROM_PTR(&usb_hid_device_report_obj) }, - { MP_ROM_QSTR(MP_QSTR_usage_page), MP_ROM_PTR(&usb_hid_device_usage_page_obj)}, - { MP_ROM_QSTR(MP_QSTR_usage), MP_ROM_PTR(&usb_hid_device_usage_obj)}, + { MP_ROM_QSTR(MP_QSTR_send_report), MP_ROM_PTR(&usb_hid_device_send_report_obj) }, + { MP_ROM_QSTR(MP_QSTR_last_received_report), MP_ROM_PTR(&usb_hid_device_report_obj) }, + { MP_ROM_QSTR(MP_QSTR_usage_page), MP_ROM_PTR(&usb_hid_device_usage_page_obj)}, + { MP_ROM_QSTR(MP_QSTR_usage), MP_ROM_PTR(&usb_hid_device_usage_obj)}, }; STATIC MP_DEFINE_CONST_DICT(usb_hid_device_locals_dict, usb_hid_device_locals_dict_table); From f0bb9635bf311013e7b1ff69d1a0542575cf9d0a Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 10 Sep 2020 14:21:36 -0400 Subject: [PATCH 0818/1293] MIssed one change for .last_received_report --- 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 8f28bc422d..c7c05a9749 100644 --- a/shared-bindings/usb_hid/Device.c +++ b/shared-bindings/usb_hid/Device.c @@ -115,7 +115,7 @@ const mp_obj_property_t usb_hid_device_usage_obj = { STATIC const mp_rom_map_elem_t usb_hid_device_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_send_report), MP_ROM_PTR(&usb_hid_device_send_report_obj) }, - { MP_ROM_QSTR(MP_QSTR_last_received_report), MP_ROM_PTR(&usb_hid_device_report_obj) }, + { MP_ROM_QSTR(MP_QSTR_last_received_report), MP_ROM_PTR(&usb_hid_device_last_received_report_obj) }, { MP_ROM_QSTR(MP_QSTR_usage_page), MP_ROM_PTR(&usb_hid_device_usage_page_obj)}, { MP_ROM_QSTR(MP_QSTR_usage), MP_ROM_PTR(&usb_hid_device_usage_obj)}, }; From f95ad7b27c040e54daeb4c71d6bb6c35844be66e Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 10 Sep 2020 15:37:43 -0400 Subject: [PATCH 0819/1293] Fix reset pin null reference, construct error null reference --- shared-module/displayio/FourWire.c | 4 +++- shared-module/displayio/I2CDisplay.c | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/shared-module/displayio/FourWire.c b/shared-module/displayio/FourWire.c index 17e8cfa1d7..7261162089 100644 --- a/shared-module/displayio/FourWire.c +++ b/shared-module/displayio/FourWire.c @@ -76,7 +76,9 @@ void common_hal_displayio_fourwire_deinit(displayio_fourwire_obj_t* self) { common_hal_reset_pin(self->command.pin); common_hal_reset_pin(self->chip_select.pin); - common_hal_reset_pin(self->reset.pin); + if (self->reset.pin) { + common_hal_reset_pin(self->reset.pin); + } } bool common_hal_displayio_fourwire_reset(mp_obj_t obj) { diff --git a/shared-module/displayio/I2CDisplay.c b/shared-module/displayio/I2CDisplay.c index 0c8f2e69a9..9e9e178812 100644 --- a/shared-module/displayio/I2CDisplay.c +++ b/shared-module/displayio/I2CDisplay.c @@ -53,6 +53,7 @@ void common_hal_displayio_i2cdisplay_construct(displayio_i2cdisplay_obj_t* self, // Probe the bus to see if a device acknowledges the given address. if (!common_hal_busio_i2c_probe(i2c, device_address)) { + self->base.type = &mp_type_NoneType; mp_raise_ValueError_varg(translate("Unable to find I2C Display at %x"), device_address); } @@ -71,7 +72,9 @@ void common_hal_displayio_i2cdisplay_deinit(displayio_i2cdisplay_obj_t* self) { common_hal_busio_i2c_deinit(self->bus); } - common_hal_reset_pin(self->reset.pin); + if (self->reset.pin) { + common_hal_reset_pin(self->reset.pin); + } } bool common_hal_displayio_i2cdisplay_reset(mp_obj_t obj) { From c7c90f47b0986e0f8c4bcba574bccc2352bf700f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 10 Sep 2020 17:32:20 -0700 Subject: [PATCH 0820/1293] Add non-DMA SPI support. This fixes SPI with PSRAM allocated buffers. DMA with SPI2 was attempted but produced junk output. This manual copy is less than 2x slower than DMA when not interrupted. Fixes #3339 --- ports/esp32s2/common-hal/busio/SPI.c | 41 ++++++++++++++++++++-------- ports/esp32s2/common-hal/busio/SPI.h | 4 --- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index a22075cd59..350580ea84 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -183,9 +183,6 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, // spi_hal_init clears the given hal context so set everything after. spi_hal_init(hal, host_id); - hal->dmadesc_tx = &self->tx_dma; - hal->dmadesc_rx = &self->rx_dma; - hal->dmadesc_n = 1; // We don't use native CS. // hal->cs_setup = 0; @@ -196,7 +193,6 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, hal->half_duplex = 0; // hal->tx_lsbfirst = 0; // hal->rx_lsbfirst = 0; - hal->dma_enabled = 1; hal->no_compensate = 1; // Ignore CS bits @@ -315,16 +311,34 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_ou hal->rcv_buffer = NULL; // Reset timing_conf in case we've moved since the last time we used it. hal->timing_conf = &self->timing_conf; + lldesc_t tx_dma __attribute__((aligned(16))); + lldesc_t rx_dma __attribute__((aligned(16))); + hal->dmadesc_tx = &tx_dma; + hal->dmadesc_rx = &rx_dma; + hal->dmadesc_n = 1; + + size_t burst_length; + // If both of the incoming pointers are DMA capable then use DMA. Otherwise, do + // bursts the size of the SPI data buffer without DMA. + if ((data_out == NULL || esp_ptr_dma_capable(data_out)) && + (data_in == NULL || esp_ptr_dma_capable(data_out))) { + hal->dma_enabled = 1; + burst_length = LLDESC_MAX_NUM_PER_DESC; + } else { + hal->dma_enabled = 0; + burst_length = sizeof(hal->hw->data_buf); + } + // This rounds up. - size_t dma_count = (len + LLDESC_MAX_NUM_PER_DESC - 1) / LLDESC_MAX_NUM_PER_DESC; - for (size_t i = 0; i < dma_count; i++) { - size_t offset = LLDESC_MAX_NUM_PER_DESC * i; - size_t dma_len = len - offset; - if (dma_len > LLDESC_MAX_NUM_PER_DESC) { - dma_len = LLDESC_MAX_NUM_PER_DESC; + size_t burst_count = (len + burst_length - 1) / burst_length; + for (size_t i = 0; i < burst_count; i++) { + size_t offset = burst_length * i; + size_t this_length = len - offset; + if (this_length > burst_length) { + this_length = burst_length; } - hal->tx_bitlen = dma_len * self->bits; - hal->rx_bitlen = dma_len * self->bits; + hal->tx_bitlen = this_length * self->bits; + hal->rx_bitlen = this_length * self->bits; if (data_out != NULL) { hal->send_buffer = (uint8_t*) data_out + offset; } @@ -341,6 +355,9 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_ou } spi_hal_fetch_result(hal); } + hal->dmadesc_tx = NULL; + hal->dmadesc_rx = NULL; + hal->dmadesc_n = 0; return true; } diff --git a/ports/esp32s2/common-hal/busio/SPI.h b/ports/esp32s2/common-hal/busio/SPI.h index 6d82038317..38fbe42ffc 100644 --- a/ports/esp32s2/common-hal/busio/SPI.h +++ b/ports/esp32s2/common-hal/busio/SPI.h @@ -44,10 +44,6 @@ typedef struct { spi_hal_context_t hal_context; spi_hal_timing_conf_t timing_conf; intr_handle_t interrupt; - // IDF allocates these in DMA accessible memory so they may need to move when - // we use external RAM for CircuitPython. - lldesc_t tx_dma; - lldesc_t rx_dma; uint32_t target_frequency; int32_t real_frequency; uint8_t polarity; From cacb0124acc13025c8658d9e1fe57b58780105b5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 10 Sep 2020 20:17:27 -0500 Subject: [PATCH 0821/1293] feather_m4_express: Use quad data mode on flash Limor confirmed that the all shipping revisions starting with Rev D had QSPI flash chips installed. Note that when neither EXTERNAL_FLASH_QSPI_SINGLE nor EXTERNAL_FLASH_QSPI_DUAL is specified quad mode is assumed, so this is addressed by removing the setting altogether. --- ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h index ba16d17ee4..a57b18e24a 100644 --- a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h @@ -16,8 +16,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define EXTERNAL_FLASH_QSPI_DUAL - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA13) From 37e85aebd25502e7c1213797cde8b0c02359d029 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Thu, 10 Sep 2020 21:34:03 -0500 Subject: [PATCH 0822/1293] Fix off-by-one error, simplify the logic, add comments --- shared-module/displayio/Shape.c | 68 +++++++++++++++------------------ 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/shared-module/displayio/Shape.c b/shared-module/displayio/Shape.c index 4f481f2244..b94a392bc6 100644 --- a/shared-module/displayio/Shape.c +++ b/shared-module/displayio/Shape.c @@ -38,20 +38,20 @@ void common_hal_displayio_shape_construct(displayio_shape_t *self, uint32_t widt self->width = width; if (self->mirror_x) { width /= 2; - width += self->width % 2 - 1; + width += self->width % 2; } self->half_width = width; self->height = height; if (self->mirror_y) { height /= 2; - height += self->height % 2 - 1; + height += self->height % 2; } self->half_height = height; self->data = m_malloc(height * sizeof(uint32_t), false); - for (uint16_t i = 0; i <= height; i++) { + for (uint16_t i = 0; i < height; i++) { self->data[2 * i] = 0; self->data[2 * i + 1] = width; } @@ -63,58 +63,52 @@ void common_hal_displayio_shape_construct(displayio_shape_t *self, uint32_t widt } void common_hal_displayio_shape_set_boundary(displayio_shape_t *self, uint16_t y, uint16_t start_x, uint16_t end_x) { - if (y < 0 || y >= self->height || (self->mirror_y && y > self->half_height)) { + if (y < 0 || y >= self->height || (self->mirror_y && y >= self->half_height)) { mp_raise_ValueError(translate("y value out of bounds")); } - if (start_x < 0 || start_x > self->width || end_x < 0 || end_x > self->width) { + if (start_x < 0 || start_x >= self->width || end_x < 0 || end_x >= self->width) { mp_raise_ValueError(translate("x value out of bounds")); } - uint16_t half_width = self->width / 2 - 1 + self->width % 2; - if (self->mirror_x && (start_x > half_width || end_x > half_width)) { - mp_raise_ValueError_varg(translate("Maximum x value when mirrored is %d"), half_width); + if (self->mirror_x && (start_x >= self->half_width || end_x >= self->half_width)) { + mp_raise_ValueError_varg(translate("Maximum x value when mirrored is %d"), self->half_width); } - uint16_t lower_x, upper_x; + uint16_t lower_x, upper_x, lower_y, upper_y; - // find x-boundaries for updating based on current data and start_x, end_x + // find x-boundaries for updating based on current data and start_x, end_x, and mirror_x lower_x = MIN(start_x, self->data[2 * y]); if (self->mirror_x) { - upper_x = self->width-lower_x; + upper_x = self->width - lower_x + 1; // dirty rectangles are treated with max value exclusive } else { - upper_x = 1 + MAX(end_x, self->data[2 * y + 1]); + upper_x = MAX(end_x, self->data[2 * y + 1]) + 1; // dirty rectangles are treated with max value exclusive } - self->data[2 * y] = start_x; + // find y-boundaries based on y and mirror_y + lower_y = y; + + if (self->mirror_y) { + upper_y = self->height - lower_y + 1; // dirty rectangles are treated with max value exclusive + } else { + upper_y = y + 1; // dirty rectangles are treated with max value exclusive + } + + self->data[2 * y] = start_x; // update the data array with the new boundaries self->data[2 * y + 1] = end_x; if (self->dirty_area.x1 == self->dirty_area.x2) { // Dirty region is empty - self->dirty_area.x1=lower_x; - self->dirty_area.x2=upper_x; - self->dirty_area.y1 = y; - if (self->mirror_y) { - self->dirty_area.y2 = self->height-y; - } else { - self->dirty_area.y2 = y+1; - } - } else { // Dirty region is not empty + self->dirty_area.x1 = lower_x; + self->dirty_area.x2 = upper_x; + self->dirty_area.y1 = lower_y; + self->dirty_area.y2 = upper_y; + } else { // Dirty region is not empty self->dirty_area.x1 = MIN(lower_x, self->dirty_area.x1); self->dirty_area.x2 = MAX(upper_x, self->dirty_area.x2); - if (y < self->dirty_area.y1) { - self->dirty_area.y1=y; - if (self->mirror_y) { // if y is mirrored and the lower y was updated, the upper y must be updated too - self->dirty_area.y2=self->height-y; - } - } - else { - if ( !self->mirror_y && (y >= self->dirty_area.y2) ) { // y is not mirrored - self->dirty_area.y2=y+1; - } - } + self->dirty_area.y1 = MIN(lower_y, self->dirty_area.y1); + self->dirty_area.y2 = MAX(upper_y, self->dirty_area.y2); } - } uint32_t common_hal_displayio_shape_get_pixel(void *obj, int16_t x, int16_t y) { @@ -122,10 +116,10 @@ uint32_t common_hal_displayio_shape_get_pixel(void *obj, int16_t x, int16_t y) { if (x >= self->width || x < 0 || y >= self->height || y < 0) { return 0; } - if (self->mirror_x && x > self->half_width) { - x = self->width - 1 - x; + if (self->mirror_x && x >= self->half_width) { + x = self->width - x - 1; } - if (self->mirror_y && y > self->half_height) { + if (self->mirror_y && y >= self->half_height) { y = self->height - y - 1; } uint16_t start_x = self->data[2 * y]; From 305bed6d9e9581ed19d2043622bc77106a0c3b5b Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Fri, 11 Sep 2020 21:06:54 +0530 Subject: [PATCH 0823/1293] Added esp32s2 safe_mode & fixed user_safe_mode --- .../espressif_saola_1_wroom/mpconfigboard.h | 4 + .../espressif_saola_1_wrover/mpconfigboard.h | 4 + .../boards/microdev_micro_s2/mpconfigboard.h | 4 + supervisor/shared/safe_mode.c | 155 ++++++++++-------- 4 files changed, 96 insertions(+), 71 deletions(-) diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h index a94f10ea49..6d603ba57b 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -31,4 +31,8 @@ #define MICROPY_HW_NEOPIXEL (&pin_GPIO18) +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up." + #define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h index 338186dc52..f5b6c7948e 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h @@ -31,4 +31,8 @@ #define MICROPY_HW_NEOPIXEL (&pin_GPIO18) +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up." + #define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h index bb28fe16ad..d844f37d09 100644 --- a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +++ b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h @@ -32,4 +32,8 @@ #define MICROPY_HW_LED (&pin_GPIO21) #define MICROPY_HW_NEOPIXEL (&pin_GPIO33) +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up." + #define AUTORESET_DELAY_MS 500 diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index 29a0a6a4ff..cbbdfe4276 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -60,6 +60,11 @@ safe_mode_t wait_for_safe_mode_reset(void) { common_hal_digitalio_digitalinout_construct(&status_led, MICROPY_HW_LED_STATUS); common_hal_digitalio_digitalinout_switch_to_output(&status_led, true, DRIVE_MODE_PUSH_PULL); #endif + #ifdef CIRCUITPY_BOOT_BUTTON + digitalio_digitalinout_obj_t boot_button; + common_hal_digitalio_digitalinout_construct(&boot_button, CIRCUITPY_BOOT_BUTTON); + common_hal_digitalio_digitalinout_switch_to_input(&boot_button, PULL_UP); + #endif uint64_t start_ticks = supervisor_ticks_ms64(); uint64_t diff = 0; while (diff < 700) { @@ -67,6 +72,11 @@ safe_mode_t wait_for_safe_mode_reset(void) { // Blink on for 100, off for 100, on for 100, off for 100 and on for 200 common_hal_digitalio_digitalinout_set_value(&status_led, diff > 100 && diff / 100 != 2 && diff / 100 != 4); #endif + #ifdef CIRCUITPY_BOOT_BUTTON + if (!common_hal_digitalio_digitalinout_get_value(&boot_button)) { + return USER_SAFE_MODE; + } + #endif diff = supervisor_ticks_ms64() - start_ticks; } #ifdef MICROPY_HW_LED_STATUS @@ -103,77 +113,80 @@ void print_safe_mode_message(safe_mode_t reason) { return; } serial_write("\n"); - // Output a user safe mode string if it's set. - #ifdef BOARD_USER_SAFE_MODE - if (reason == USER_SAFE_MODE) { - serial_write_compressed(translate("You requested starting safe mode by ")); - serial_write(BOARD_USER_SAFE_MODE_ACTION); - serial_write_compressed(translate("\nTo exit, please reset the board without ")); - serial_write(BOARD_USER_SAFE_MODE_ACTION); - serial_write("\n"); - } else - #endif - switch (reason) { - case MANUAL_SAFE_MODE: - serial_write_compressed(translate("CircuitPython is in safe mode because you pressed the reset button during boot. Press again to exit safe mode.\n")); - return; - case PROGRAMMATIC_SAFE_MODE: - serial_write_compressed(translate("The `microcontroller` module was used to boot into safe mode. Press reset to exit safe mode.\n")); - return; - default: - break; - } - serial_write_compressed(translate("You are in safe mode: something unanticipated happened.\n")); - switch (reason) { - case BROWNOUT: - serial_write_compressed(translate("The microcontroller's power dipped. Make sure your power supply provides\nenough power for the whole circuit and press reset (after ejecting CIRCUITPY).\n")); - return; - case HEAP_OVERWRITTEN: - serial_write_compressed(translate("The CircuitPython heap was corrupted because the stack was too small.\nPlease increase the stack size if you know how, or if not:")); - serial_write_compressed(FILE_AN_ISSUE); - return; - case NO_HEAP: - serial_write_compressed(translate("CircuitPython was unable to allocate the heap.\n")); - serial_write_compressed(FILE_AN_ISSUE); - return; - default: - break; - } + switch (reason) { + case USER_SAFE_MODE: + #ifdef BOARD_USER_SAFE_MODE_ACTION + // Output a user safe mode string if it's set. + serial_write_compressed(translate("You requested starting safe mode by ")); + serial_write_compressed(translate(BOARD_USER_SAFE_MODE_ACTION)); + serial_write_compressed(translate("\nTo exit, please reset the board without ")); + serial_write_compressed(translate(BOARD_USER_SAFE_MODE_ACTION)); + serial_write("\n"); + #else + // fallthrough + #endif + return; + case MANUAL_SAFE_MODE: + serial_write_compressed(translate("CircuitPython is in safe mode because you pressed the reset button during boot. Press again to exit safe mode.\n")); + return; + case PROGRAMMATIC_SAFE_MODE: + serial_write_compressed(translate("The `microcontroller` module was used to boot into safe mode. Press reset to exit safe mode.\n")); + return; + default: + break; + } - serial_write_compressed(translate("CircuitPython core code crashed hard. Whoops!\n")); - switch (reason) { - case HARD_CRASH: - serial_write_compressed(translate("Crash into the HardFault_Handler.")); - return; - case MICROPY_NLR_JUMP_FAIL: - serial_write_compressed(translate("MicroPython NLR jump failed. Likely memory corruption.")); - return; - case MICROPY_FATAL_ERROR: - serial_write_compressed(translate("MicroPython fatal error.")); - break; - case GC_ALLOC_OUTSIDE_VM: - serial_write_compressed(translate("Attempted heap allocation when MicroPython VM not running.")); - break; -#ifdef SOFTDEVICE_PRESENT - // defined in ports/nrf/bluetooth/bluetooth_common.mk - // will print "Unknown reason" if somehow encountered on other ports - case NORDIC_SOFT_DEVICE_ASSERT: - serial_write_compressed(translate("Nordic Soft Device failure assertion.")); - break; -#endif - case FLASH_WRITE_FAIL: - serial_write_compressed(translate("Failed to write internal flash.")); - break; - case MEM_MANAGE: - serial_write_compressed(translate("Invalid memory access.")); - break; - case WATCHDOG_RESET: - serial_write_compressed(translate("Watchdog timer expired.")); - break; - default: - serial_write_compressed(translate("Unknown reason.")); - break; - } - serial_write_compressed(FILE_AN_ISSUE); + serial_write_compressed(translate("You are in safe mode: something unanticipated happened.\n")); + switch (reason) { + case BROWNOUT: + serial_write_compressed(translate("The microcontroller's power dipped. Make sure your power supply provides\nenough power for the whole circuit and press reset (after ejecting CIRCUITPY).\n")); + return; + case HEAP_OVERWRITTEN: + serial_write_compressed(translate("The CircuitPython heap was corrupted because the stack was too small.\nPlease increase the stack size if you know how, or if not:")); + serial_write_compressed(FILE_AN_ISSUE); + return; + case NO_HEAP: + serial_write_compressed(translate("CircuitPython was unable to allocate the heap.\n")); + serial_write_compressed(FILE_AN_ISSUE); + return; + default: + break; + } + + serial_write_compressed(translate("CircuitPython core code crashed hard. Whoops!\n")); + switch (reason) { + case HARD_CRASH: + serial_write_compressed(translate("Crash into the HardFault_Handler.")); + return; + case MICROPY_NLR_JUMP_FAIL: + serial_write_compressed(translate("MicroPython NLR jump failed. Likely memory corruption.")); + return; + case MICROPY_FATAL_ERROR: + serial_write_compressed(translate("MicroPython fatal error.")); + break; + case GC_ALLOC_OUTSIDE_VM: + serial_write_compressed(translate("Attempted heap allocation when MicroPython VM not running.")); + break; + #ifdef SOFTDEVICE_PRESENT + // defined in ports/nrf/bluetooth/bluetooth_common.mk + // will print "Unknown reason" if somehow encountered on other ports + case NORDIC_SOFT_DEVICE_ASSERT: + serial_write_compressed(translate("Nordic Soft Device failure assertion.")); + break; + #endif + case FLASH_WRITE_FAIL: + serial_write_compressed(translate("Failed to write internal flash.")); + break; + case MEM_MANAGE: + serial_write_compressed(translate("Invalid memory access.")); + break; + case WATCHDOG_RESET: + serial_write_compressed(translate("Watchdog timer expired.")); + break; + default: + serial_write_compressed(translate("Unknown reason.")); + break; + } + serial_write_compressed(FILE_AN_ISSUE); } From 870326b2218e24a20f40c8ee72f3ec27d0f3813b Mon Sep 17 00:00:00 2001 From: root Date: Fri, 11 Sep 2020 10:54:46 -0500 Subject: [PATCH 0824/1293] Moved SPI unlock code --- shared-module/board/__init__.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index ae06597910..7d99f2d4e3 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -166,9 +166,9 @@ void reset_board_busses(void) { #endif } #endif + // make sure SPI lock is not held over a soft reset + common_hal_busio_spi_unlock(&spi_obj); if (!display_using_spi) { - // make sure lock is not held over a soft reset - common_hal_busio_spi_unlock(&spi_obj); spi_singleton = NULL; } #endif From 5197085d790e6d0f072fe18d0f5b742847a6d8bd Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 10 Sep 2020 20:20:55 +0200 Subject: [PATCH 0825/1293] 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 | 36 +++++++++++++++++- locale/cs.po | 36 +++++++++++++++++- locale/de_DE.po | 36 +++++++++++++++++- locale/es.po | 36 +++++++++++++++++- locale/fil.po | 36 +++++++++++++++++- locale/fr.po | 36 +++++++++++++++++- locale/hi.po | 36 +++++++++++++++++- locale/it_IT.po | 36 +++++++++++++++++- locale/ja.po | 81 ++++++++++++++++++++++++++++++++++------ locale/ko.po | 36 +++++++++++++++++- locale/nl.po | 36 +++++++++++++++++- locale/pl.po | 36 +++++++++++++++++- locale/pt_BR.po | 36 +++++++++++++++++- locale/sv.po | 36 +++++++++++++++++- locale/zh_Latn_pinyin.po | 36 +++++++++++++++++- 15 files changed, 546 insertions(+), 39 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index dd41b740f1..6312e0e242 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-30 14:38-0400\n" +"POT-Creation-Date: 2020-09-09 14:33-0700\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -279,7 +279,7 @@ msgstr "pow() 3-arg tidak didukung" msgid "A hardware interrupt channel is already in use" msgstr "Sebuah channel hardware interrupt sedang digunakan" -#: shared-bindings/_bleio/Address.c +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" msgstr "Alamat harus sepanjang %d byte" @@ -377,6 +377,10 @@ msgstr "" msgid "Attempted heap allocation when MicroPython VM not running." msgstr "Mencoba alokasi heap ketika MicroPython VM tidak berjalan." +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + #: main.c msgid "Auto-reload is off.\n" msgstr "Auto-reload tidak aktif.\n" @@ -596,6 +600,10 @@ msgstr "" "CircuitPython dalam mode aman karena Anda menekan tombol reset saat boot. " "Tekan lagi untuk keluar dari mode aman.\n" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Init pin clock gagal." @@ -1244,6 +1252,10 @@ msgstr "" msgid "No more timers available on this pin." msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1264,6 +1276,10 @@ msgstr "" msgid "Nordic Soft Device failure assertion." msgstr "" +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c #, fuzzy @@ -1309,6 +1325,10 @@ msgid "" "%d bpp given" msgstr "" +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1508,6 +1528,10 @@ msgstr "" msgid "Serializer in use" msgstr "Serializer sedang digunakan" +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" @@ -1703,6 +1727,10 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Unknown failure" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" @@ -1813,6 +1841,10 @@ msgstr "" "\n" "Untuk menampilkan modul built-in silahkan ketik `help(\"modules\")`.\n" +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters" +msgstr "" + #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 3e22ac2514..db04b0fff5 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-30 14:38-0400\n" +"POT-Creation-Date: 2020-09-09 14:33-0700\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -279,7 +279,7 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" -#: shared-bindings/_bleio/Address.c +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" msgstr "" @@ -377,6 +377,10 @@ msgstr "" msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + #: main.c msgid "Auto-reload is off.\n" msgstr "" @@ -584,6 +588,10 @@ msgid "" "boot. Press again to exit safe mode.\n" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "" @@ -1227,6 +1235,10 @@ msgstr "" msgid "No more timers available on this pin." msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1247,6 +1259,10 @@ msgstr "" msgid "Nordic Soft Device failure assertion." msgstr "" +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1291,6 +1307,10 @@ msgid "" "%d bpp given" msgstr "" +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1487,6 +1507,10 @@ msgstr "" msgid "Serializer in use" msgstr "" +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" @@ -1682,6 +1706,10 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Unknown failure" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" @@ -1785,6 +1813,10 @@ msgid "" "To list built-in modules please do `help(\"modules\")`.\n" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters" +msgstr "" + #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 3debbcb621..388f0932b6 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-30 14:38-0400\n" +"POT-Creation-Date: 2020-09-09 14:33-0700\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -278,7 +278,7 @@ msgstr "3-arg pow() wird nicht unterstützt" msgid "A hardware interrupt channel is already in use" msgstr "Ein Hardware Interrupt Kanal wird schon benutzt" -#: shared-bindings/_bleio/Address.c +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" msgstr "Die Adresse muss %d Bytes lang sein" @@ -378,6 +378,10 @@ msgstr "" "Versuch einer Heap Reservierung, wenn die MicroPython-VM nicht ausgeführt " "wird." +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + #: main.c msgid "Auto-reload is off.\n" msgstr "Automatisches Neuladen ist deaktiviert.\n" @@ -592,6 +596,10 @@ msgstr "" "Reset-Taste gedrückt haben. Drücken Sie erneut, um den abgesicherten Modus " "zu verlassen.\n" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Clock pin init fehlgeschlagen." @@ -1246,6 +1254,10 @@ msgstr "Keine langen Integer (long) unterstützt" msgid "No more timers available on this pin." msgstr "An diesem Pin sind keine Timer mehr verfügbar." +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "Kein Pulldown Widerstand am Pin; 1Mohm wird vorgeschlagen" @@ -1266,6 +1278,10 @@ msgstr "Kein Timer verfügbar" msgid "Nordic Soft Device failure assertion." msgstr "Fehlerbehauptung für Nordic Soft Device." +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1316,6 +1332,10 @@ msgstr "" "Nur monochrome, indizierte 4bpp oder 8bpp, und 16bpp oder größere BMPs " "unterstützt: %d bpp wurden gegeben" +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Oversample muss ein Vielfaches von 8 sein." @@ -1517,6 +1537,10 @@ msgstr "Ausgewählter RTS-Pin ungültig" msgid "Serializer in use" msgstr "Serializer wird benutzt" +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Slice und Wert (value) haben unterschiedliche Längen." @@ -1726,6 +1750,10 @@ msgstr "Schreiben in nvm nicht möglich." msgid "Unexpected nrfx uuid type" msgstr "Unerwarteter nrfx uuid-Typ" +#: shared-bindings/wifi/Radio.c +msgid "Unknown failure" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" @@ -1840,6 +1868,10 @@ msgstr "" "Um die integrierten Module aufzulisten, führe bitte `help(\"modules\")` " "aus.\n" +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters" +msgstr "" + #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" msgstr "Schreiben nicht unterstüzt für die Characteristic" diff --git a/locale/es.po b/locale/es.po index 15b4fe7806..0f37aa1eb0 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-30 14:38-0400\n" +"POT-Creation-Date: 2020-09-09 14:33-0700\n" "PO-Revision-Date: 2020-08-17 21:11+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -282,7 +282,7 @@ msgstr "pow() con 3 argumentos no soportado" msgid "A hardware interrupt channel is already in use" msgstr "El canal EXTINT ya está siendo utilizado" -#: shared-bindings/_bleio/Address.c +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" msgstr "La dirección debe ser %d bytes de largo" @@ -384,6 +384,10 @@ msgstr "" "Se intentó asignación del montículo, sin que la VM de MicroPython esté " "ejecutando." +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + #: main.c msgid "Auto-reload is off.\n" msgstr "Auto-recarga deshabilitada.\n" @@ -597,6 +601,10 @@ msgstr "" "CircuitPython está en modo seguro porque presionó el botón de reinicio " "durante el arranque. Presione nuevamente para salir del modo seguro.\n" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Iniciado de pin de reloj fallido." @@ -1245,6 +1253,10 @@ msgstr "No hay soporte de entero largo" msgid "No more timers available on this pin." msgstr "No hay más temporizadores disponibles en este pin." +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "No hay pulldown en el pin; 1Mohm recomendado" @@ -1265,6 +1277,10 @@ msgstr "No hay temporizador disponible" msgid "Nordic Soft Device failure assertion." msgstr "fallo de aserción de dispositivo Nordic Soft." +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1315,6 +1331,10 @@ msgstr "" "Solo se admiten BMP monocromáticos, indexados de 4 bpp u 8 bpp y 16 bpp o " "más: %d bpp proporcionados" +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "El sobremuestreo debe ser un múltiplo de 8." @@ -1516,6 +1536,10 @@ msgstr "Pin RTS seleccionado no válido" msgid "Serializer in use" msgstr "Serializer está siendo utilizado" +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Slice y value tienen tamaños diferentes." @@ -1725,6 +1749,10 @@ msgstr "Imposible escribir en nvm." msgid "Unexpected nrfx uuid type" msgstr "Tipo de uuid nrfx inesperado" +#: shared-bindings/wifi/Radio.c +msgid "Unknown failure" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" @@ -1839,6 +1867,10 @@ msgstr "" "\n" "Para listar los módulos incorporados por favor haga `help(\"modules\")`.\n" +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters" +msgstr "" + #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" msgstr "Escrituras no admitidas en la característica" diff --git a/locale/fil.po b/locale/fil.po index 5bb696c83b..2283dff2bb 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-30 14:38-0400\n" +"POT-Creation-Date: 2020-09-09 14:33-0700\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -274,7 +274,7 @@ msgstr "3-arg pow() hindi suportado" msgid "A hardware interrupt channel is already in use" msgstr "Isang channel ng hardware interrupt ay ginagamit na" -#: shared-bindings/_bleio/Address.c +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, fuzzy, c-format msgid "Address must be %d bytes long" msgstr "ang palette ay dapat 32 bytes ang haba" @@ -373,6 +373,10 @@ msgstr "" msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + #: main.c msgid "Auto-reload is off.\n" msgstr "Awtomatikong pag re-reload ay OFF.\n" @@ -584,6 +588,10 @@ msgid "" "boot. Press again to exit safe mode.\n" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Nabigo sa pag init ng Clock pin." @@ -1235,6 +1243,10 @@ msgstr "" msgid "No more timers available on this pin." msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1255,6 +1267,10 @@ msgstr "" msgid "Nordic Soft Device failure assertion." msgstr "" +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c #, fuzzy @@ -1302,6 +1318,10 @@ msgid "" "%d bpp given" msgstr "" +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Oversample ay dapat multiple ng 8." @@ -1502,6 +1522,10 @@ msgstr "" msgid "Serializer in use" msgstr "Serializer ginagamit" +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Slice at value iba't ibang haba." @@ -1698,6 +1722,10 @@ msgstr "Hindi ma i-sulat sa NVM." msgid "Unexpected nrfx uuid type" msgstr "hindi inaasahang indent" +#: shared-bindings/wifi/Radio.c +msgid "Unknown failure" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" @@ -1810,6 +1838,10 @@ msgstr "" "\n" "Para makita ang listahan ng modules, `help(“modules”)`.\n" +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters" +msgstr "" + #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 3ab4858020..49da4ac4e3 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-30 14:38-0400\n" +"POT-Creation-Date: 2020-09-09 14:33-0700\n" "PO-Revision-Date: 2020-07-27 21:27+0000\n" "Last-Translator: Nathan \n" "Language: fr\n" @@ -283,7 +283,7 @@ msgstr "pow() non supporté avec 3 arguments" msgid "A hardware interrupt channel is already in use" msgstr "Un canal d'interruptions matérielles est déjà utilisé" -#: shared-bindings/_bleio/Address.c +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" msgstr "L'adresse doit être longue de %d octets" @@ -384,6 +384,10 @@ msgstr "" "Tentative d'allocation de segments lorsque la machine virtuelle MicroPython " "n'est pas en cours d'exécution." +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + #: main.c msgid "Auto-reload is off.\n" msgstr "L'auto-chargement est désactivé.\n" @@ -600,6 +604,10 @@ msgstr "" "réinitialisation pendant le démarrage. Appuyez à nouveau pour quitter le " "mode sans échec.\n" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Echec de l'init. de la broche d'horloge." @@ -1249,6 +1257,10 @@ msgstr "Pas de support entier long" msgid "No more timers available on this pin." msgstr "Plus de minuteurs disponibles sur cette broche." +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "Pas de pulldown sur la broche ; 1Mohm recommandé" @@ -1269,6 +1281,10 @@ msgstr "Pas de minuterie disponible" msgid "Nordic Soft Device failure assertion." msgstr "Affirmation de défaillance du Nordic Soft Device." +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1319,6 +1335,10 @@ msgstr "" "Prise en charge uniquement des monochromes, 4 bpp ou 8 bpp indexés et 16 bpp " "ou plus : %d bpp fournis" +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Le sur-échantillonage doit être un multiple de 8." @@ -1522,6 +1542,10 @@ msgstr "Broche RTS sélectionnée non valide" msgid "Serializer in use" msgstr "Sérialiseur en cours d'utilisation" +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Tranche et valeur de tailles différentes." @@ -1730,6 +1754,10 @@ msgstr "Impossible d'écrire sur la mémoire non-volatile." msgid "Unexpected nrfx uuid type" msgstr "Type inattendu pour l'uuid nrfx" +#: shared-bindings/wifi/Radio.c +msgid "Unknown failure" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" @@ -1846,6 +1874,10 @@ msgstr "" "\n" "Pour lister les modules inclus, tapez `help(\"modules\")`.\n" +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters" +msgstr "" + #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" msgstr "Écritures non prises en charge sur la caractéristique" diff --git a/locale/hi.po b/locale/hi.po index 3803348aa4..bf85b19d70 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-30 14:38-0400\n" +"POT-Creation-Date: 2020-09-09 14:33-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -272,7 +272,7 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" -#: shared-bindings/_bleio/Address.c +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" msgstr "" @@ -370,6 +370,10 @@ msgstr "" msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + #: main.c msgid "Auto-reload is off.\n" msgstr "" @@ -577,6 +581,10 @@ msgid "" "boot. Press again to exit safe mode.\n" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "" @@ -1220,6 +1228,10 @@ msgstr "" msgid "No more timers available on this pin." msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1240,6 +1252,10 @@ msgstr "" msgid "Nordic Soft Device failure assertion." msgstr "" +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1284,6 +1300,10 @@ msgid "" "%d bpp given" msgstr "" +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1480,6 +1500,10 @@ msgstr "" msgid "Serializer in use" msgstr "" +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" @@ -1675,6 +1699,10 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Unknown failure" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" @@ -1778,6 +1806,10 @@ msgid "" "To list built-in modules please do `help(\"modules\")`.\n" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters" +msgstr "" + #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index e9dfc0474d..cfc6b76a56 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-30 14:38-0400\n" +"POT-Creation-Date: 2020-09-09 14:33-0700\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -273,7 +273,7 @@ msgstr "pow() con tre argmomenti non supportata" msgid "A hardware interrupt channel is already in use" msgstr "Un canale di interrupt hardware è già in uso" -#: shared-bindings/_bleio/Address.c +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, fuzzy, c-format msgid "Address must be %d bytes long" msgstr "la palette deve essere lunga 32 byte" @@ -372,6 +372,10 @@ msgstr "" msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + #: main.c msgid "Auto-reload is off.\n" msgstr "Auto-reload disattivato.\n" @@ -585,6 +589,10 @@ msgid "" "boot. Press again to exit safe mode.\n" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Inizializzazione del pin di clock fallita." @@ -1239,6 +1247,10 @@ msgstr "" msgid "No more timers available on this pin." msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1259,6 +1271,10 @@ msgstr "" msgid "Nordic Soft Device failure assertion." msgstr "" +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c #, fuzzy @@ -1307,6 +1323,10 @@ msgid "" "%d bpp given" msgstr "" +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "L'oversampling deve essere multiplo di 8." @@ -1513,6 +1533,10 @@ msgstr "" msgid "Serializer in use" msgstr "Serializer in uso" +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" @@ -1709,6 +1733,10 @@ msgstr "Imposibile scrivere su nvm." msgid "Unexpected nrfx uuid type" msgstr "indentazione inaspettata" +#: shared-bindings/wifi/Radio.c +msgid "Unknown failure" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" @@ -1813,6 +1841,10 @@ msgid "" "To list built-in modules please do `help(\"modules\")`.\n" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters" +msgstr "" + #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index b9fb7ce7a5..b66e9a06d9 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-27 11:21-0400\n" +"POT-Creation-Date: 2020-09-09 14:33-0700\n" "PO-Revision-Date: 2020-09-01 18:44+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: none\n" @@ -282,7 +282,7 @@ msgstr "引数3つのpow()はサポートされていません" msgid "A hardware interrupt channel is already in use" msgstr "ハードウェア割り込みチャネルは使用中" -#: shared-bindings/_bleio/Address.c +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" msgstr "アドレスは、%dバイト長でなければなりません" @@ -380,6 +380,10 @@ msgstr "%d個のブロックの確保を試みました" msgid "Attempted heap allocation when MicroPython VM not running." msgstr "MicroPython VM 非実行時にヒープの確保を試みました" +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + #: main.c msgid "Auto-reload is off.\n" msgstr "オートリロードはオフです。\n" @@ -503,6 +507,10 @@ msgstr "" msgid "Can't set CCCD on local Characteristic" msgstr "ローカルのCharacteristicにはCCCDを設定できません" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c @@ -589,6 +597,10 @@ msgstr "" "起動中にリセットボタンを押したためCircuitPythonはセーフモードにいます。もう一" "度押すとセーフモードを終了します。\n" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "クロックピンの初期化に失敗" @@ -757,8 +769,8 @@ msgstr "EXTINTチャネルはすでに使用されています" msgid "Error in regex" msgstr "正規表現にエラーがあります" -#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -769,10 +781,18 @@ msgstr "%qが必要" msgid "Expected a Characteristic" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" @@ -900,7 +920,9 @@ msgstr "IVは%dバイト長でなければなりません" msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." -msgstr "非互換の.mpyファイルです。全ての.mpyファイルを更新してください。詳細は http://adafru.it/mpy-update を参照" +msgstr "" +"非互換の.mpyファイルです。全ての.mpyファイルを更新してください。詳細は " +"http://adafru.it/mpy-update を参照" #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" @@ -1224,6 +1246,10 @@ msgstr "long integerサポートがありません" msgid "No more timers available on this pin." msgstr "このピンに利用可能なタイマーがもうありません" +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "ピンにプルダウンがありません。1Mオーム推奨" @@ -1244,6 +1270,10 @@ msgstr "利用できるタイマーなし" msgid "Nordic Soft Device failure assertion." msgstr "" +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1258,6 +1288,10 @@ msgstr "再生していません" msgid "Not running saved code.\n" msgstr "保存されたコードは実行していません。\n" +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1286,6 +1320,10 @@ msgid "" "%d bpp given" msgstr "" +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "オーバーサンプルは8の倍数が必要" @@ -1293,7 +1331,8 @@ msgstr "オーバーサンプルは8の倍数が必要" #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "PWMのduty_cycle値は0から65535の間でなければなりません(16ビット解像度)" +msgstr "" +"PWMのduty_cycle値は0から65535の間でなければなりません(16ビット解像度)" #: shared-bindings/pwmio/PWMOut.c msgid "" @@ -1367,10 +1406,6 @@ msgstr "いずれかのキーを押すとREPLに入ります。リロードはCT msgid "Pull not used when direction is output." msgstr "方向がoutputのときpullは使われません" -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "PulseOutはこのチップでサポートされていません" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG解体エラー" @@ -1487,6 +1522,10 @@ msgstr "選択されたRTSピンが正しくありません" msgid "Serializer in use" msgstr "シリアライザは使用中" +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "スライスと値の長さが一致しません" @@ -1692,6 +1731,10 @@ msgstr "nvm に書き込みできません" msgid "Unexpected nrfx uuid type" msgstr "想定されていないnrfx UUID型" +#: shared-bindings/wifi/Radio.c +msgid "Unknown failure" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" @@ -1795,6 +1838,10 @@ msgid "" "To list built-in modules please do `help(\"modules\")`.\n" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters" +msgstr "" + #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" msgstr "" @@ -2483,6 +2530,10 @@ msgstr "" msgid "initial values must be iterable" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "インラインアセンブラは関数でなければなりません" @@ -2675,6 +2726,10 @@ msgstr "正定値行列ではありません" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be > 0" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "最大の再帰深度を超えました" @@ -3024,7 +3079,8 @@ msgstr "rsplit(None,n)" msgid "" "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " "'B'" -msgstr "sample_source バッファには bytearray または 'h','H','b','B'型のarrayが必要" +msgstr "" +"sample_source バッファには bytearray または 'h','H','b','B'型のarrayが必要" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -3394,6 +3450,9 @@ msgstr "ziはfloat値が必要" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "PulseOut not supported on this chip" +#~ msgstr "PulseOutはこのチップでサポートされていません" + #~ msgid "Invalid I2C pin selection" #~ msgstr "I2Cピンの選択が不正です" diff --git a/locale/ko.po b/locale/ko.po index a4e088bc40..858d117f26 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-30 14:38-0400\n" +"POT-Creation-Date: 2020-09-09 14:33-0700\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -273,7 +273,7 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" -#: shared-bindings/_bleio/Address.c +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" msgstr "" @@ -371,6 +371,10 @@ msgstr "" msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + #: main.c msgid "Auto-reload is off.\n" msgstr "자동 재 장전이 꺼져 있습니다\n" @@ -580,6 +584,10 @@ msgid "" "boot. Press again to exit safe mode.\n" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "" @@ -1223,6 +1231,10 @@ msgstr "" msgid "No more timers available on this pin." msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1243,6 +1255,10 @@ msgstr "" msgid "Nordic Soft Device failure assertion." msgstr "" +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1287,6 +1303,10 @@ msgid "" "%d bpp given" msgstr "" +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1483,6 +1503,10 @@ msgstr "" msgid "Serializer in use" msgstr "" +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" @@ -1679,6 +1703,10 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Unknown failure" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" @@ -1782,6 +1810,10 @@ msgid "" "To list built-in modules please do `help(\"modules\")`.\n" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters" +msgstr "" + #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index ead58bb78b..470e9db9c5 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-30 14:38-0400\n" +"POT-Creation-Date: 2020-09-09 14:33-0700\n" "PO-Revision-Date: 2020-09-09 16:05+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -279,7 +279,7 @@ msgstr "3-arg pow() niet ondersteund" msgid "A hardware interrupt channel is already in use" msgstr "Een hardware interrupt kanaal is al in gebruik" -#: shared-bindings/_bleio/Address.c +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" msgstr "Adres moet %d bytes lang zijn" @@ -377,6 +377,10 @@ msgstr "Poging om %d blokken toe te wijzen" msgid "Attempted heap allocation when MicroPython VM not running." msgstr "heap allocatie geprobeerd terwijl MicroPython VM niet draait." +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + #: main.c msgid "Auto-reload is off.\n" msgstr "Auto-herlaad staat uit.\n" @@ -590,6 +594,10 @@ msgstr "" "CircuitPython is in veilige modus omdat de rest knop werd ingedrukt tijdens " "het opstarten. Druk nogmaals om veilige modus te verlaten\n" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Clock pin init mislukt." @@ -1239,6 +1247,10 @@ msgstr "Geen lange integer ondersteuning" msgid "No more timers available on this pin." msgstr "Geen timers meer beschikbaar op deze pin." +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "Geen pulldown op pin; 1MOhm aangeraden" @@ -1259,6 +1271,10 @@ msgstr "Geen timer beschikbaar" msgid "Nordic Soft Device failure assertion." msgstr "Nordic Soft Device assertion mislukt." +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1309,6 +1325,10 @@ msgstr "" "Alleen monochrome en 4bpp of 8bpp, en 16bpp of grotere geïndiceerde BMP's " "zijn ondersteund: %d bpp is gegeven" +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Oversample moet een meervoud van 8 zijn." @@ -1513,6 +1533,10 @@ msgstr "Geselecteerde RTS pin niet geldig" msgid "Serializer in use" msgstr "Serializer in gebruik" +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Slice en waarde hebben verschillende lengtes." @@ -1718,6 +1742,10 @@ msgstr "Niet in staat om naar nvm te schrijven." msgid "Unexpected nrfx uuid type" msgstr "Onverwacht mrfx uuid type" +#: shared-bindings/wifi/Radio.c +msgid "Unknown failure" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" @@ -1832,6 +1860,10 @@ msgstr "" "\n" "Voor een lijst van ingebouwde modules, gebruik `help(\"modules\")`.\n" +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters" +msgstr "" + #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" msgstr "Schrijven niet ondersteund op Characteristic" diff --git a/locale/pl.po b/locale/pl.po index cd4b905e73..03915175a3 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-30 14:38-0400\n" +"POT-Creation-Date: 2020-09-09 14:33-0700\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -273,7 +273,7 @@ msgstr "3-argumentowy pow() jest niewspierany" msgid "A hardware interrupt channel is already in use" msgstr "Kanał przerwań sprzętowych w użyciu" -#: shared-bindings/_bleio/Address.c +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" msgstr "Adres musi mieć %d bajtów" @@ -371,6 +371,10 @@ msgstr "" msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + #: main.c msgid "Auto-reload is off.\n" msgstr "Samo-przeładowywanie wyłączone.\n" @@ -580,6 +584,10 @@ msgid "" "boot. Press again to exit safe mode.\n" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Nie powiodło się ustawienie nóżki zegara" @@ -1225,6 +1233,10 @@ msgstr "" msgid "No more timers available on this pin." msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1245,6 +1257,10 @@ msgstr "" msgid "Nordic Soft Device failure assertion." msgstr "" +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1289,6 +1305,10 @@ msgid "" "%d bpp given" msgstr "" +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Nadpróbkowanie musi być wielokrotnością 8." @@ -1485,6 +1505,10 @@ msgstr "" msgid "Serializer in use" msgstr "Serializator w użyciu" +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Fragment i wartość są różnych długości." @@ -1680,6 +1704,10 @@ msgstr "Błąd zapisu do NVM." msgid "Unexpected nrfx uuid type" msgstr "Nieoczekiwany typ nrfx uuid." +#: shared-bindings/wifi/Radio.c +msgid "Unknown failure" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" @@ -1786,6 +1814,10 @@ msgstr "" "Podręczniki dostępne na learn.adafruit.com/category/circuitpyhon.\n" "Aby zobaczyć wbudowane moduły, wpisz `help(\"modules\")`.\n" +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters" +msgstr "" + #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index b40d33f80b..408287d600 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-30 14:38-0400\n" +"POT-Creation-Date: 2020-09-09 14:33-0700\n" "PO-Revision-Date: 2020-09-02 22:32+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -283,7 +283,7 @@ msgstr "3-arg pow() não compatível" msgid "A hardware interrupt channel is already in use" msgstr "Um canal de interrupção de hardware já está em uso" -#: shared-bindings/_bleio/Address.c +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" msgstr "O endereço deve ter %d bytes de comprimento" @@ -383,6 +383,10 @@ msgstr "" "A tentativa da área de alocação dinâmica de variáveis (heap) quando o " "MicroPython VM não está em execução." +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + #: main.c msgid "Auto-reload is off.\n" msgstr "A atualização automática está desligada.\n" @@ -600,6 +604,10 @@ msgstr "" "redefinição durante a inicialização. Pressione novamente para sair do modo " "de segurança.\n" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Inicialização do pino de Clock falhou." @@ -1248,6 +1256,10 @@ msgstr "Não há compatibilidade com inteiro longo" msgid "No more timers available on this pin." msgstr "Não há mais temporizadores disponíveis neste pino." +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "Não há pulldown no pino; É recomendável utilizar um resistor de 1M ohm" @@ -1268,6 +1280,10 @@ msgstr "Não há um temporizador disponível" msgid "Nordic Soft Device failure assertion." msgstr "Declaração de falha do dispositivo Nordic Soft." +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1317,6 +1333,10 @@ msgstr "" "São compatíveis apenas os BMPs monocromáticos, indexados em 4bpp ou 8bpp e " "16bpp ou superior: determinado %d bpp" +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "A superamostragem deve ser um múltiplo de 8." @@ -1525,6 +1545,10 @@ msgstr "O pino RTS selecionado é inválido" msgid "Serializer in use" msgstr "Serializer em uso" +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Fatie e avalie os diferentes comprimentos." @@ -1734,6 +1758,10 @@ msgstr "Não é possível gravar no nvm." msgid "Unexpected nrfx uuid type" msgstr "Tipo uuid nrfx inesperado" +#: shared-bindings/wifi/Radio.c +msgid "Unknown failure" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" @@ -1849,6 +1877,10 @@ msgstr "" "\n" "Para listar os módulos internos, faça `help(\"modules\")`.\n" +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters" +msgstr "" + #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" msgstr "A escrita não é compatível na Característica" diff --git a/locale/sv.po b/locale/sv.po index eb131ef543..8911d0334d 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-30 14:38-0400\n" +"POT-Creation-Date: 2020-09-09 14:33-0700\n" "PO-Revision-Date: 2020-09-07 19:36+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -279,7 +279,7 @@ msgstr "3-arguments pow() stöds inte" msgid "A hardware interrupt channel is already in use" msgstr "En kanal för hårdvaruavbrott används redan" -#: shared-bindings/_bleio/Address.c +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" msgstr "Adressen måste vara %d byte lång" @@ -377,6 +377,10 @@ msgstr "Försök att tilldela %d block" msgid "Attempted heap allocation when MicroPython VM not running." msgstr "Försökte tilldela heap när MicroPython VM inte körs." +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + #: main.c msgid "Auto-reload is off.\n" msgstr "Autoladdning är avstängd.\n" @@ -590,6 +594,10 @@ msgstr "" "CircuitPython är i säkert läge eftersom du tryckte på återställningsknappen " "under start. Tryck igen för att lämna säkert läge.\n" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Initiering av klockpinne misslyckades." @@ -1238,6 +1246,10 @@ msgstr "Inget stöd för långt heltal" msgid "No more timers available on this pin." msgstr "Inga fler timers tillgängliga på denna pinne." +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "Ingen pulldown på pinnen; 1Mohm rekommenderas" @@ -1258,6 +1270,10 @@ msgstr "Ingen timer tillgänglig" msgid "Nordic Soft Device failure assertion." msgstr "Påståendet om Nordic Soft Device-fel." +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1307,6 +1323,10 @@ msgstr "" "Endast monokrom, indexerad 4 bpp eller 8 bpp och 16 bpp eller högre BMP: er " "stöds: %d bpp angiven" +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Översampling måste vara multipel av 8." @@ -1511,6 +1531,10 @@ msgstr "Vald CTS-pinne är inte giltig" msgid "Serializer in use" msgstr "Serializern används redan" +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Slice och värde har olika längd." @@ -1716,6 +1740,10 @@ msgstr "Det gick inte att skriva till nvm." msgid "Unexpected nrfx uuid type" msgstr "Oväntad nrfx uuid-typ" +#: shared-bindings/wifi/Radio.c +msgid "Unknown failure" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" @@ -1827,6 +1855,10 @@ msgstr "" "\n" "För att lista inbyggda moduler, ange `help(\"modules\")`.\n" +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters" +msgstr "" + #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" msgstr "Skrivning stöds inte på karaktäristik" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 56f9bae8c1..046bb9b754 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-30 14:38-0400\n" +"POT-Creation-Date: 2020-09-09 14:33-0700\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -280,7 +280,7 @@ msgstr "bù zhīchí 3-arg pow ()" msgid "A hardware interrupt channel is already in use" msgstr "Yìngjiàn zhōngduàn tōngdào yǐ zài shǐyòng zhōng" -#: shared-bindings/_bleio/Address.c +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" msgstr "Dìzhǐ bìxū shì %d zì jié zhǎng" @@ -378,6 +378,10 @@ msgstr "cháng shì fēn pèi %d kuài" msgid "Attempted heap allocation when MicroPython VM not running." msgstr "MicroPython VM zài wèi yùnxíng shí chángshì fēnpèi duī." +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + #: main.c msgid "Auto-reload is off.\n" msgstr "Zìdòng chóngxīn jiāzài yǐ guānbì.\n" @@ -589,6 +593,10 @@ msgstr "" "CircuitPython chǔyú ānquán móshì, yīnwèi zài yǐndǎo guòchéng zhōng àn xiàle " "chóng zhì ànniǔ. Zài àn yīcì tuìchū ānquán móshì.\n" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Shízhōng de yǐn jiǎo chūshǐhuà shībài." @@ -1234,6 +1242,10 @@ msgstr "Méiyǒu zhǎng zhěngshù zhīchí" msgid "No more timers available on this pin." msgstr "Gāi yǐn jiǎo shàng méiyǒu kěyòng de dìngshí qì." +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "Yǐn jiǎo shàng méiyǒu xiàlā; 1Mohm tuījiàn" @@ -1254,6 +1266,10 @@ msgstr "Méiyǒu jìshí qì" msgid "Nordic Soft Device failure assertion." msgstr "Nordic ruǎn shèbèi gùzhàng shēngmíng." +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1303,6 +1319,10 @@ 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" +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Guò cǎiyàng bìxū shì 8 de bèishù." @@ -1503,6 +1523,10 @@ msgstr "Suǒ xuǎn de RTS yǐn jiǎo wúxiào" msgid "Serializer in use" msgstr "Xùliè huà yǐjīng shǐyòngguò" +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Qiēpiàn hé zhí bùtóng chángdù." @@ -1707,6 +1731,10 @@ msgstr "Wúfǎ xiě rù nvm." msgid "Unexpected nrfx uuid type" msgstr "Yìwài de nrfx uuid lèixíng" +#: shared-bindings/wifi/Radio.c +msgid "Unknown failure" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" @@ -1818,6 +1846,10 @@ msgstr "" "\n" "Ruò yào liè chū nèizài de mókuài, qǐng qǐng zuò yǐxià `help(\"modules\")`.\n" +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters" +msgstr "" + #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" msgstr "Tèzhēng bù zhīchí xiě rù" From 8f58669ddddd83fc2820ea8a6689b8d175265783 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 11 Sep 2020 16:17:20 -0700 Subject: [PATCH 0826/1293] Fix bug with socket.recv_into size == 0. It returned 0 when it should have filled the buffer. Python reference: https://docs.python.org/3/library/socket.html#socket.socket.recv_into --- shared-bindings/socketpool/Socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index 250e9c874e..e1b1e69672 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -261,7 +261,7 @@ STATIC mp_obj_t socketpool_socket_recv_into(size_t n_args, const mp_obj_t *args) mp_int_t len = bufinfo.len; if (n_args == 3) { mp_int_t given_len = mp_obj_get_int(args[2]); - if (given_len < len) { + if (given_len > 0 && given_len < len) { len = given_len; } } From e114b5ab54e3c7f4a36a03dae2913cb76804efa3 Mon Sep 17 00:00:00 2001 From: FoamyGuy Date: Fri, 11 Sep 2020 21:37:00 -0500 Subject: [PATCH 0827/1293] fixes showing OnDiskBitmap with adafruit_sdcard --- shared-module/displayio/Display.c | 5 ++--- shared-module/displayio/display_core.c | 12 +++++++++++- shared-module/displayio/display_core.h | 3 ++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 021159c0d9..70ed8f2c2f 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -317,11 +317,10 @@ STATIC bool _refresh_area(displayio_display_obj_t* self, const displayio_area_t* } STATIC void _refresh_display(displayio_display_obj_t* self) { - if (!displayio_display_core_bus_free(&self->core)) { - // Can't acquire display bus; skip updating this display. Try next display. + if (!displayio_display_core_start_refresh(&self->core)) { + // A refresh on this bus is already in progress. Try next display. return; } - displayio_display_core_start_refresh(&self->core); const displayio_area_t* current_area = _get_refresh_areas(self); while (current_area != NULL) { _refresh_area(self, current_area); diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index 43f2d19375..68572c44f3 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -295,8 +295,17 @@ void displayio_display_core_set_region_to_update(displayio_display_core_t* self, } } -void displayio_display_core_start_refresh(displayio_display_core_t* self) { +bool displayio_display_core_start_refresh(displayio_display_core_t* self) { + if (!displayio_display_core_bus_free(self)) { + // Can't acquire display bus; skip updating this display. Try next display. + return false; + } + if (self->refresh_in_progress) { + return false; + } + self->refresh_in_progress = true; self->last_refresh = supervisor_ticks_ms64(); + return true; } void displayio_display_core_finish_refresh(displayio_display_core_t* self) { @@ -305,6 +314,7 @@ void displayio_display_core_finish_refresh(displayio_display_core_t* self) { displayio_group_finish_refresh(self->current_group); } self->full_refresh = false; + self->refresh_in_progress = false; self->last_refresh = supervisor_ticks_ms64(); } diff --git a/shared-module/displayio/display_core.h b/shared-module/displayio/display_core.h index e4fd62d4a5..c72111f7df 100644 --- a/shared-module/displayio/display_core.h +++ b/shared-module/displayio/display_core.h @@ -54,6 +54,7 @@ typedef struct { int16_t colstart; int16_t rowstart; bool full_refresh; // New group means we need to refresh the whole display. + bool refresh_in_progress; } displayio_display_core_t; void displayio_display_core_construct(displayio_display_core_t* self, @@ -78,7 +79,7 @@ void displayio_display_core_set_region_to_update(displayio_display_core_t* self, void release_display_core(displayio_display_core_t* self); -void displayio_display_core_start_refresh(displayio_display_core_t* self); +bool displayio_display_core_start_refresh(displayio_display_core_t* self); void displayio_display_core_finish_refresh(displayio_display_core_t* self); void displayio_display_core_collect_ptrs(displayio_display_core_t* self); From 4da478382d8e428d3e702dcd8c35f67cf80cc319 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sat, 12 Sep 2020 17:46:52 +0530 Subject: [PATCH 0828/1293] Fix serial console output & add more boards --- .../esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h | 4 ++++ ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h | 4 ++++ .../esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h | 2 +- .../esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h | 2 +- ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h | 2 +- .../boards/unexpectedmaker_feathers2/mpconfigboard.h | 4 ++++ supervisor/shared/safe_mode.c | 6 +++--- 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h b/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h index ed3f23a3c4..2af3515f4c 100644 --- a/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +++ b/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h @@ -29,4 +29,8 @@ #define MICROPY_HW_BOARD_NAME "BastWiFi" #define MICROPY_HW_MCU_NAME "ESP32S2" +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n" + #define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h b/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h index 84d15ffc2b..a4c8e65762 100644 --- a/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +++ b/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h @@ -31,4 +31,8 @@ #define MICROPY_HW_NEOPIXEL (&pin_GPIO45) +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n" + #define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h index 6d603ba57b..335aaeb5e1 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -33,6 +33,6 @@ #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) -#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up." +#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n" #define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h index f5b6c7948e..d3ef8bb260 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h @@ -33,6 +33,6 @@ #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) -#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up." +#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n" #define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h index d844f37d09..1a1ef7a6c7 100644 --- a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +++ b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h @@ -34,6 +34,6 @@ #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) -#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up." +#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n" #define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h index 93fb0c573d..a65d00206d 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h @@ -29,6 +29,10 @@ #define MICROPY_HW_BOARD_NAME "FeatherS2" #define MICROPY_HW_MCU_NAME "ESP32S2" +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n" + #define AUTORESET_DELAY_MS 500 // Doesn't work with this on. diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index cbbdfe4276..f4f23378a4 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -72,7 +72,7 @@ safe_mode_t wait_for_safe_mode_reset(void) { // Blink on for 100, off for 100, on for 100, off for 100 and on for 200 common_hal_digitalio_digitalinout_set_value(&status_led, diff > 100 && diff / 100 != 2 && diff / 100 != 4); #endif - #ifdef CIRCUITPY_BOOT_BUTTON + #ifdef CIRCUITPY_BOOT_BUTTON if (!common_hal_digitalio_digitalinout_get_value(&boot_button)) { return USER_SAFE_MODE; } @@ -120,11 +120,11 @@ void print_safe_mode_message(safe_mode_t reason) { // Output a user safe mode string if it's set. serial_write_compressed(translate("You requested starting safe mode by ")); serial_write_compressed(translate(BOARD_USER_SAFE_MODE_ACTION)); - serial_write_compressed(translate("\nTo exit, please reset the board without ")); + serial_write_compressed(translate("To exit, please reset the board without ")); serial_write_compressed(translate(BOARD_USER_SAFE_MODE_ACTION)); - serial_write("\n"); #else // fallthrough + serial_write_compressed(translate("CircuitPython is in safe mode with status being USER_SAFE_MODE but no specific reason was provided.\n")); #endif return; case MANUAL_SAFE_MODE: From e9f411bebc691182cfb8780d1929fa8c02e4fd09 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sat, 12 Sep 2020 18:10:04 +0530 Subject: [PATCH 0829/1293] Add translation for safe mode --- locale/circuitpython.pot | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index af9491c042..0c6c4ac484 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-09 14:33-0700\n" +"POT-Creation-Date: 2020-09-12 18:06+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -30,12 +30,6 @@ msgid "" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"To exit, please reset the board without " -msgstr "" - #: py/obj.c msgid " File \"%q\"" msgstr "" @@ -582,6 +576,12 @@ msgid "" "boot. Press again to exit safe mode.\n" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode with status being USER_SAFE_MODE but no " +"specific reason was provided.\n" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "CircuitPython was unable to allocate the heap.\n" msgstr "" @@ -1605,6 +1605,10 @@ msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" From 40ab5c6b21ff93ad11ca51dc66d3613dcd77e5ef Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 12 Sep 2020 10:10:18 -0500 Subject: [PATCH 0830/1293] compression: Implement ciscorn's dictionary approach MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Massive savings. Thanks so much @ciscorn for providing the initial code for choosing the dictionary. This adds a bit of time to the build, both to find the dictionary but also because (for reasons I don't fully understand), the binary search in the compress() function no longer worked and had to be replaced with a linear search. I think this is because the intended invariant is that for codebook entries that encode to the same number of bits, the entries are ordered in ascending value. However, I mis-placed the transition from "words" to "byte/char values" so the codebook entries for words are in word-order rather than their code order. Because this price is only paid at build time, I didn't care to determine exactly where the correct fix was. I also commented out a line to produce the "estimated total memory size" -- at least on the unix build with TRANSLATION=ja, this led to a build time KeyError trying to compute the codebook size for all the strings. I think this occurs because some single unicode code point ('ァ') is no longer present as itself in the compressed strings, due to always being replaced by a word. As promised, this seems to save hundreds of bytes in the German translation on the trinket m0. Testing performed: - built trinket_m0 in several languages - built and ran unix port in several languages (en, de_DE, ja) and ran simple error-producing codes like ./micropython -c '1/0' --- py/makeqstrdata.py | 197 +++++++++++++++++++++++----------- supervisor/shared/translate.c | 21 ++-- 2 files changed, 152 insertions(+), 66 deletions(-) diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 721fa83206..57635807dc 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -100,77 +100,153 @@ def translate(translation_file, i18ns): translations.append((original, translation)) return translations -def frequent_ngrams(corpus, sz, n): - return collections.Counter(corpus[i:i+sz] for i in range(len(corpus)-sz)).most_common(n) +class TextSplitter: + def __init__(self, words): + words.sort(key=lambda x: len(x), reverse=True) + self.words = set(words) + self.pat = re.compile("|".join(re.escape(w) for w in words) + "|.", flags=re.DOTALL) -def encode_ngrams(translation, ngrams): - if len(ngrams) > 32: - start = 0xe000 - else: - start = 0x80 - for i, g in enumerate(ngrams): - translation = translation.replace(g, chr(start + i)) - return translation + def iter_words(self, text): + s = [] + for m in self.pat.finditer(text): + t = m.group(0) + if t in self.words: + if s: + yield (False, "".join(s)) + s = [] + yield (True, t) + else: + s.append(t) + if s: + yield (False, "".join(s)) -def decode_ngrams(compressed, ngrams): - if len(ngrams) > 32: - start, end = 0xe000, 0xf8ff - else: - start, end = 0x80, 0x9f - return "".join(ngrams[ord(c) - start] if (start <= ord(c) <= end) else c for c in compressed) + def iter(self, text): + s = [] + for m in self.pat.finditer(text): + yield m.group(0) + +def iter_substrings(s, minlen, maxlen): + maxlen = min(len(s), maxlen) + for n in range(minlen, maxlen + 1): + for begin in range(0, len(s) - n + 1): + yield s[begin : begin + n] + +def compute_huffman_coding(translations, compression_filename): + texts = [t[1] for t in translations] + all_strings_concat = "".join(texts) + words = [] + max_ord = 0 + begin_unused = 128 + end_unused = 256 + for text in texts: + for c in text: + ord_c = ord(c) + max_ord = max(max_ord, ord_c) + if 128 <= ord_c < 256: + end_unused = min(ord_c, end_unused) + max_words = end_unused - begin_unused + char_size = 1 if max_ord < 256 else 2 + + sum_word_len = 0 + while True: + extractor = TextSplitter(words) + counter = collections.Counter() + for t in texts: + for (found, word) in extractor.iter_words(t): + if not found: + for substr in iter_substrings(word, minlen=2, maxlen=9): + counter[substr] += 1 + + scores = sorted( + ( + # I don't know why this works good. This could be better. + (s, (len(s) - 1) ** ((max(occ - 2, 1) + 0.5) ** 0.8), occ) + for (s, occ) in counter.items() + ), + key=lambda x: x[1], + reverse=True, + ) + + w = None + for (s, score, occ) in scores: + if score < 0: + break + if len(s) > 1: + w = s + break + + if not w: + break + if len(w) + sum_word_len > 256: + break + if len(words) == max_words: + break + words.append(w) + sum_word_len += len(w) + + extractor = TextSplitter(words) + counter = collections.Counter() + for t in texts: + for atom in extractor.iter(t): + counter[atom] += 1 + cb = huffman.codebook(counter.items()) + + word_start = begin_unused + word_end = word_start + len(words) - 1 + print("// # words", len(words)) + print("// words", words) -def compute_huffman_coding(translations, qstrs, compression_filename): - all_strings = [x[1] for x in translations] - all_strings_concat = "".join(all_strings) - ngrams = [i[0] for i in frequent_ngrams(all_strings_concat, 2, 32)] - all_strings_concat = encode_ngrams(all_strings_concat, ngrams) - counts = collections.Counter(all_strings_concat) - cb = huffman.codebook(counts.items()) values = [] length_count = {} renumbered = 0 last_l = None canonical = {} - for ch, code in sorted(cb.items(), key=lambda x: (len(x[1]), x[0])): - values.append(ch) + for atom, code in sorted(cb.items(), key=lambda x: (len(x[1]), x[0])): + values.append(atom) l = len(code) if l not in length_count: length_count[l] = 0 length_count[l] += 1 if last_l: renumbered <<= (l - last_l) - canonical[ch] = '{0:0{width}b}'.format(renumbered, width=l) - s = C_ESCAPES.get(ch, ch) - print("//", ord(ch), s, counts[ch], canonical[ch], renumbered) + canonical[atom] = '{0:0{width}b}'.format(renumbered, width=l) + #print(f"atom={repr(atom)} code={code}", file=sys.stderr) + if len(atom) > 1: + o = words.index(atom) + 0x80 + s = "".join(C_ESCAPES.get(ch1, ch1) for ch1 in atom) + else: + s = C_ESCAPES.get(atom, atom) + o = ord(atom) + print("//", o, s, counter[atom], canonical[atom], renumbered) renumbered += 1 last_l = l lengths = bytearray() print("// length count", length_count) - print("// bigrams", ngrams) + for i in range(1, max(length_count) + 2): lengths.append(length_count.get(i, 0)) print("// values", values, "lengths", len(lengths), lengths) - ngramdata = [ord(ni) for i in ngrams for ni in i] - print("// estimated total memory size", len(lengths) + 2*len(values) + 2 * len(ngramdata) + sum((len(cb[u]) + 7)//8 for u in all_strings_concat)) + maxord = max(ord(u) for u in values if len(u) == 1) + values_type = "uint16_t" if maxord > 255 else "uint8_t" + ch_size = 1 if maxord > 255 else 2 + print("//", values, lengths) + values = [(atom if len(atom) == 1 else chr(0x80 + words.index(atom))) for atom in values] print("//", values, lengths) - values_type = "uint16_t" if max(ord(u) for u in values) > 255 else "uint8_t" max_translation_encoded_length = max(len(translation.encode("utf-8")) for original,translation in translations) with open(compression_filename, "w") as f: f.write("const uint8_t lengths[] = {{ {} }};\n".format(", ".join(map(str, lengths)))) f.write("const {} values[] = {{ {} }};\n".format(values_type, ", ".join(str(ord(u)) for u in values))) f.write("#define compress_max_length_bits ({})\n".format(max_translation_encoded_length.bit_length())) - f.write("const {} bigrams[] = {{ {} }};\n".format(values_type, ", ".join(str(u) for u in ngramdata))) - if len(ngrams) > 32: - bigram_start = 0xe000 - else: - bigram_start = 0x80 - bigram_end = bigram_start + len(ngrams) - 1 # End is inclusive - f.write("#define bigram_start {}\n".format(bigram_start)) - f.write("#define bigram_end {}\n".format(bigram_end)) - return values, lengths, ngrams + f.write("const {} words[] = {{ {} }};\n".format(values_type, ", ".join(str(ord(c)) for w in words for c in w))) + f.write("const uint8_t wlen[] = {{ {} }};\n".format(", ".join(str(len(w)) for w in words))) + f.write("#define word_start {}\n".format(word_start)) + f.write("#define word_end {}\n".format(word_end)) + + extractor = TextSplitter(words) + return values, lengths, words, extractor def decompress(encoding_table, encoded, encoded_length_bits): - values, lengths, ngrams = encoding_table + values, lengths, words, extractor = encoding_table dec = [] this_byte = 0 this_bit = 7 @@ -218,7 +294,8 @@ def decompress(encoding_table, encoded, encoded_length_bits): searched_length += lengths[bit_length] v = values[searched_length + bits - max_code] - v = decode_ngrams(v, ngrams) + if v >= chr(0x80) and v < chr(0x80 + len(words)): + v = words[ord(v) - 0x80] i += len(v.encode('utf-8')) dec.append(v) return ''.join(dec) @@ -226,8 +303,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() - values, lengths, ngrams = encoding_table - decompressed = encode_ngrams(decompressed, ngrams) + values, lengths, words, extractor = encoding_table + enc = bytearray(len(decompressed) * 3) #print(decompressed) #print(lengths) @@ -246,9 +323,15 @@ def compress(encoding_table, decompressed, encoded_length_bits, len_translation_ else: current_bit -= 1 - for c in decompressed: - #print() - #print("char", c, values.index(c)) + #print("values = ", values, file=sys.stderr) + for atom in extractor.iter(decompressed): + #print("", file=sys.stderr) + if len(atom) > 1: + c = chr(0x80 + words.index(atom)) + else: + c = atom + assert c in values + start = 0 end = lengths[0] bits = 1 @@ -258,18 +341,12 @@ def compress(encoding_table, decompressed, encoded_length_bits, len_translation_ s = start e = end #print("{0:0{width}b}".format(code, width=bits)) - # Binary search! - while e > s: - midpoint = (s + e) // 2 - #print(s, e, midpoint) - if values[midpoint] == c: - compressed = code + (midpoint - start) - #print("found {0:0{width}b}".format(compressed, width=bits)) + # Linear search! + for i in range(s, e): + if values[i] == c: + compressed = code + (i - start) + #print("found {0:0{width}b}".format(compressed, width=bits), file=sys.stderr) break - elif c < values[midpoint]: - e = midpoint - else: - s = midpoint + 1 code += end - start code <<= 1 start = end @@ -452,7 +529,7 @@ if __name__ == "__main__": if args.translation: i18ns = sorted(i18ns) translations = translate(args.translation, i18ns) - encoding_table = compute_huffman_coding(translations, qstrs, args.compression_filename) + encoding_table = compute_huffman_coding(translations, args.compression_filename) print_qstr_data(encoding_table, qcfgs, qstrs, translations) else: print_qstr_enums(qstrs) diff --git a/supervisor/shared/translate.c b/supervisor/shared/translate.c index 5cd7b8dd88..cc0de7f619 100644 --- a/supervisor/shared/translate.c +++ b/supervisor/shared/translate.c @@ -47,13 +47,22 @@ STATIC int put_utf8(char *buf, int u) { if(u <= 0x7f) { *buf = u; return 1; - } else if(bigram_start <= u && u <= bigram_end) { - int n = (u - 0x80) * 2; - // (note that at present, entries in the bigrams table are - // guaranteed not to represent bigrams themselves, so this adds + } else if(word_start <= u && u <= word_end) { + int n = (u - 0x80); + size_t off = 0; + for(int i=0; i> 6); *buf = 0b10000000 | (u & 0b00111111); From 7cb60d3b69e897e5eb127e462d66894a10f2f8d5 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Sat, 12 Sep 2020 05:50:33 +0000 Subject: [PATCH 0831/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (793 of 793 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 408287d600..d1d3b72092 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: 2020-09-09 14:33-0700\n" -"PO-Revision-Date: 2020-09-02 22:32+0000\n" +"PO-Revision-Date: 2020-09-12 17:32+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -385,7 +385,7 @@ msgstr "" #: shared-bindings/wifi/Radio.c msgid "Authentication failure" -msgstr "" +msgstr "Houve um falha na autenticação" #: main.c msgid "Auto-reload is off.\n" @@ -606,7 +606,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "CircuitPython was unable to allocate the heap.\n" -msgstr "" +msgstr "O CircuitPython não conseguiu alocar o heap.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." @@ -1258,7 +1258,7 @@ msgstr "Não há mais temporizadores disponíveis neste pino." #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" -msgstr "" +msgstr "Não há rede com este ssid" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" @@ -1282,7 +1282,7 @@ msgstr "Declaração de falha do dispositivo Nordic Soft." #: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c msgid "Not a valid IP string" -msgstr "" +msgstr "Não é uma sequência válida de IP" #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -1335,7 +1335,7 @@ msgstr "" #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" -msgstr "" +msgstr "Apenas o int bruto é compatível para o ip" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." @@ -1547,7 +1547,7 @@ msgstr "Serializer em uso" #: shared-bindings/ssl/SSLContext.c msgid "Server side context cannot have hostname" -msgstr "" +msgstr "O contexto do lado do servidor não pode ter nome de host" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." @@ -1760,7 +1760,7 @@ msgstr "Tipo uuid nrfx inesperado" #: shared-bindings/wifi/Radio.c msgid "Unknown failure" -msgstr "" +msgstr "Falha desconhecida" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format @@ -1879,7 +1879,7 @@ msgstr "" #: shared-bindings/wifi/Radio.c msgid "WiFi password must be between 8 and 63 characters" -msgstr "" +msgstr "A senha do Wi-Fi deve ter entre 8 e 63 caracteres" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" From 54d97251fe2dd4939652a186bf703885e654b4d1 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 12 Sep 2020 13:57:31 -0500 Subject: [PATCH 0832/1293] modstruct: Improve compliance with python3 While checking whether we can enable -Wimplicit-fallthrough, I encountered a diagnostic in mp_binary_set_val_array_from_int which led to discovering the following bug: ``` >>> struct.pack("xb", 3) b'\x03\x03' ``` That is, the next value (3) was used as the value of a padding byte, while standard Python always fills "x" bytes with zeros. I initially thought this had to do with the unintentional fallthrough, but it doesn't. Instead, this code would relate to an array.array with a typecode of padding ('x'), which is ALSO not desktop Python compliant: ``` >>> array.array('x', (1, 2, 3)) array('x', [1, 0, 0]) ``` Possibly this is dead code that used to be shared between struct-setting and array-setting, but it no longer is. I also discovered that the argument list length for struct.pack and struct.pack_into were not checked, and that the length of binary data passed to array.array was not checked to be a multiple of the element size. I have corrected all of these to conform more closely to standard Python and revised some tests where necessary. Some tests for micropython-specific behavior that does not conform to standard Python and is not present in CircuitPython was deleted outright. --- py/binary.c | 9 +++--- py/modstruct.c | 17 ++++++----- py/objarray.c | 7 ++++- tests/basics/struct1.py | 25 ++++++++++++++++ tests/basics/struct_micropython.py | 41 -------------------------- tests/basics/struct_micropython.py.exp | 2 -- tests/misc/non_compliant.py | 6 ---- tests/misc/non_compliant.py.exp | 2 -- 8 files changed, 46 insertions(+), 63 deletions(-) delete mode 100644 tests/basics/struct_micropython.py delete mode 100644 tests/basics/struct_micropython.py.exp diff --git a/py/binary.c b/py/binary.c index cd0f1aa4df..b85edba625 100644 --- a/py/binary.c +++ b/py/binary.c @@ -126,7 +126,6 @@ mp_obj_t mp_binary_get_val_array(char typecode, void *p, mp_uint_t index) { break; case BYTEARRAY_TYPECODE: case 'B': - case 'x': // value will be discarded val = ((unsigned char*)p)[index]; break; case 'h': @@ -330,7 +329,11 @@ void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte ** } } - mp_binary_set_int(MIN((size_t)size, sizeof(val)), struct_type == '>', p, val); + if (val_type == 'x') { + memset(p, 0, 1); + } else { + mp_binary_set_int(MIN((size_t)size, sizeof(val)), struct_type == '>', p, val); + } } void mp_binary_set_val_array(char typecode, void *p, mp_uint_t index, mp_obj_t val_in) { @@ -379,8 +382,6 @@ void mp_binary_set_val_array_from_int(char typecode, void *p, mp_uint_t index, m case 'B': ((unsigned char*)p)[index] = val; break; - case 'x': - ((unsigned char*)p)[index] = 0; case 'h': ((short*)p)[index] = val; break; diff --git a/py/modstruct.c b/py/modstruct.c index fe766a4deb..7675de275d 100644 --- a/py/modstruct.c +++ b/py/modstruct.c @@ -183,16 +183,21 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(struct_unpack_from_obj, 2, 3, struct_unpack_ // This function assumes there is enough room in p to store all the values STATIC void struct_pack_into_internal(mp_obj_t fmt_in, byte *p, size_t n_args, const mp_obj_t *args) { + size_t size; + size_t count = calc_size_items(mp_obj_str_get_str(fmt_in), &size); + if (count != n_args) { +#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE + mp_raise_ValueError(NULL); +#else + mp_raise_ValueError_varg(translate("pack expected %d items for packing (got %d)"), count, n_args); +#endif + } const char *fmt = mp_obj_str_get_str(fmt_in); char fmt_type = get_fmt_type(&fmt); size_t i; for (i = 0; i < n_args;) { mp_uint_t cnt = 1; - if (*fmt == '\0') { - // more arguments given than used by format string; CPython raises struct.error here - break; - } if (unichar_isdigit(*fmt)) { cnt = get_fmt_num(&fmt); } @@ -208,8 +213,7 @@ STATIC void struct_pack_into_internal(mp_obj_t fmt_in, byte *p, size_t n_args, c memset(p + to_copy, 0, cnt - to_copy); p += cnt; } else { - // If we run out of args then we just finish; CPython would raise struct.error - while (cnt-- && i < n_args) { + while (cnt--) { mp_binary_set_val(fmt_type, *fmt, args[i], &p); // Pad bytes don't have a corresponding argument. if (*fmt != 'x') { @@ -222,7 +226,6 @@ STATIC void struct_pack_into_internal(mp_obj_t fmt_in, byte *p, size_t n_args, c } STATIC mp_obj_t struct_pack(size_t n_args, const mp_obj_t *args) { - // TODO: "The arguments must match the values required by the format exactly." mp_int_t size = MP_OBJ_SMALL_INT_VALUE(struct_calcsize(args[0])); vstr_t vstr; vstr_init_len(&vstr, size); diff --git a/py/objarray.c b/py/objarray.c index 5d83f06977..e0b4cbd55f 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -97,6 +97,9 @@ STATIC void array_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t #if MICROPY_PY_BUILTINS_BYTEARRAY || MICROPY_PY_ARRAY STATIC mp_obj_array_t *array_new(char typecode, size_t n) { + if (typecode == 'x') { + mp_raise_ValueError(translate("bad typecode")); + } int typecode_size = mp_binary_get_size('@', typecode, NULL); mp_obj_array_t *o = m_new_obj(mp_obj_array_t); #if MICROPY_PY_BUILTINS_BYTEARRAY && MICROPY_PY_ARRAY @@ -126,8 +129,10 @@ STATIC mp_obj_t array_construct(char typecode, mp_obj_t initializer) { || (MICROPY_PY_BUILTINS_BYTEARRAY && MP_OBJ_IS_TYPE(initializer, &mp_type_bytearray))))) && mp_get_buffer(initializer, &bufinfo, MP_BUFFER_READ)) { // construct array from raw bytes - // we round-down the len to make it a multiple of sz (CPython raises error) size_t sz = mp_binary_get_size('@', typecode, NULL); + if (bufinfo.len % sz) { + mp_raise_ValueError(translate("bytes length not a multiple of item size")); + } size_t len = bufinfo.len / sz; mp_obj_array_t *o = array_new(typecode, len); memcpy(o->items, bufinfo.buf, len * sz); diff --git a/tests/basics/struct1.py b/tests/basics/struct1.py index db34342a17..107006cc3f 100644 --- a/tests/basics/struct1.py +++ b/tests/basics/struct1.py @@ -39,6 +39,28 @@ print(v == (10, 100, 200, 300)) # network byte order print(struct.pack('!i', 123)) +# too short / too long arguments +buf = bytearray(b'>>>123<<<') +try: + struct.pack_into('bb', buf, 0, 3) +except: + print('struct.error') + +try: + struct.pack_into('bb', buf, 0, 3, 1, 4) +except: + print('struct.error') + +try: + struct.pack('bb', 3) +except: + print('struct.error') + +try: + struct.pack('bb', 3, 1, 4) +except: + print('struct.error') + # check that we get an error if the buffer is too small try: struct.unpack('I', b'\x00\x00\x00') @@ -96,3 +118,6 @@ try: print(struct.unpack_from(' Date: Sat, 12 Sep 2020 15:11:02 -0500 Subject: [PATCH 0833/1293] make translate --- locale/circuitpython.pot | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index af9491c042..78d1223a63 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-09 14:33-0700\n" +"POT-Creation-Date: 2020-09-12 15:10-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1925,7 +1925,7 @@ msgstr "" msgid "bad format string" msgstr "" -#: py/binary.c +#: py/binary.c py/objarray.c msgid "bad typecode" msgstr "" @@ -1978,6 +1978,10 @@ msgstr "" msgid "bytes > 8 bits not supported" msgstr "" +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + #: py/objstr.c msgid "bytes value out of range" msgstr "" @@ -2943,6 +2947,11 @@ msgstr "" msgid "overflow converting long int to machine word" msgstr "" +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" msgstr "" From 12d826d941f705fbfa0ced667d1c7efb264d95b1 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 12 Sep 2020 14:14:30 -0500 Subject: [PATCH 0834/1293] Add FALLTHROUGH comments as needed I investigated these cases and confirmed that the fallthrough behavior was intentional. --- extmod/re1.5/recursiveloop.c | 1 + py/objset.c | 1 + 2 files changed, 2 insertions(+) diff --git a/extmod/re1.5/recursiveloop.c b/extmod/re1.5/recursiveloop.c index bb337decfb..5c1f37a5a1 100644 --- a/extmod/re1.5/recursiveloop.c +++ b/extmod/re1.5/recursiveloop.c @@ -22,6 +22,7 @@ recursiveloop(char *pc, const char *sp, Subject *input, const char **subp, int n case Char: if(*sp != *pc++) return 0; + /* FALLTHROUGH */ case Any: sp++; continue; diff --git a/py/objset.c b/py/objset.c index b8f0f07ede..45b5c12606 100644 --- a/py/objset.c +++ b/py/objset.c @@ -450,6 +450,7 @@ STATIC mp_obj_t set_unary_op(mp_unary_op_t op, mp_obj_t self_in) { return MP_OBJ_NEW_SMALL_INT(hash); } #endif + /* FALLTHROUGH */ default: return MP_OBJ_NULL; // op not supported } } From 5729097bc415a935b0e18b034a6313cf0b74daab Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 12 Sep 2020 14:15:32 -0500 Subject: [PATCH 0835/1293] atmel-samd: enable build error for implicit fallthrough If any diagnostics occur, we will want to either add `/* FALLTHROUGH */` or `break;` as appropriate. I only tested a few builds (trinket m0 and metro m4 express) --- 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 489f3a7afb..f00366c272 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -148,7 +148,7 @@ else endif endif -CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) +CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) -Wimplicit-fallthrough=2 ifeq ($(CHIP_FAMILY), samd21) CFLAGS += \ From 2f058029e9c62761cdac3e54f326dd4d1f53cc94 Mon Sep 17 00:00:00 2001 From: Carl Karsten Date: Sat, 12 Sep 2020 15:25:04 -0500 Subject: [PATCH 0836/1293] doc fix: remove the text about the non-existing clock specification --- shared-bindings/time/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 0a78b377c5..44f82c62e7 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -215,7 +215,7 @@ STATIC mp_obj_t time_time(void) { MP_DEFINE_CONST_FUN_OBJ_0(time_time_obj, time_time); //| def monotonic_ns() -> int: -//| """Return the time of the specified clock clk_id in nanoseconds. +//| """Return the time of the monotonic clock, cannot go backward, in nanoseconds. //| //| :return: the current time //| :rtype: int""" From 7151ee85ce55683b95bdd19d87e08ed23c857bc6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 12 Sep 2020 16:30:12 -0500 Subject: [PATCH 0837/1293] _bleio: add missing break statement --- devices/ble_hci/common-hal/_bleio/att.c | 1 + 1 file changed, 1 insertion(+) diff --git a/devices/ble_hci/common-hal/_bleio/att.c b/devices/ble_hci/common-hal/_bleio/att.c index 591e508a65..6528361cb1 100644 --- a/devices/ble_hci/common-hal/_bleio/att.c +++ b/devices/ble_hci/common-hal/_bleio/att.c @@ -1748,6 +1748,7 @@ void check_att_err(uint8_t err) { break; case BT_ATT_ERR_ENCRYPTION_KEY_SIZE: msg = translate("Encryption key size"); + break; case BT_ATT_ERR_INVALID_ATTRIBUTE_LEN: msg = translate("Invalid attribute length"); break; From 01fdd9598a83fee98b2447c50ea911d7bfe205cb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 12 Sep 2020 17:48:42 -0500 Subject: [PATCH 0838/1293] disable iimplicit-fallthrough warning inside asf4 .. there is an instance of it that looks like a "true positive", but it only affects sdhc transfers that are not a multiple of 4 bytes, which I don't think happens. (sd card blocks are always 512 bytes) I can fix this in our asf4 repo but that would mean this should be deferred until after #3384 is merged, since that also touches asf4 very invasively by adding a whole new chip family. --- 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 f00366c272..20c79de8f1 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -255,7 +255,7 @@ SRC_ASF += \ hal/src/hal_mci_sync.c \ hpl/sdhc/hpl_sdhc.c \ -$(BUILD)/asf4/$(CHIP_FAMILY)/hpl/sdhc/hpl_sdhc.o: CFLAGS += -Wno-cast-align +$(BUILD)/asf4/$(CHIP_FAMILY)/hpl/sdhc/hpl_sdhc.o: CFLAGS += -Wno-cast-align -Wno-implicit-fallthrough endif $(BUILD)/asf4/$(CHIP_FAMILY)/hpl/sercom/hpl_sercom.o: CFLAGS += -Wno-maybe-uninitialized From 6fff4ec00d7b822852bdf553075a68820482fc22 Mon Sep 17 00:00:00 2001 From: lady ada Date: Sat, 12 Sep 2020 19:00:26 -0400 Subject: [PATCH 0839/1293] cutie variant --- ports/atmel-samd/boards/qtpy_m0/board.c | 40 ++++++++++++++ .../atmel-samd/boards/qtpy_m0/mpconfigboard.h | 55 +++++++++++++++++++ .../boards/qtpy_m0/mpconfigboard.mk | 24 ++++++++ ports/atmel-samd/boards/qtpy_m0/pins.c | 49 +++++++++++++++++ 4 files changed, 168 insertions(+) create mode 100644 ports/atmel-samd/boards/qtpy_m0/board.c create mode 100644 ports/atmel-samd/boards/qtpy_m0/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/qtpy_m0/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/qtpy_m0/pins.c diff --git a/ports/atmel-samd/boards/qtpy_m0/board.c b/ports/atmel-samd/boards/qtpy_m0/board.c new file mode 100644 index 0000000000..5f7b4dda80 --- /dev/null +++ b/ports/atmel-samd/boards/qtpy_m0/board.c @@ -0,0 +1,40 @@ +/* + * 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 "boards/board.h" + +void board_init(void) { + gpio_set_pin_function(PIN_PA18, GPIO_PIN_FUNCTION_OFF); + gpio_set_pin_direction(PIN_PA18, GPIO_DIRECTION_OUT); + gpio_set_pin_level(PIN_PA18, true); // Turn on neopixel by default +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/qtpy_m0/mpconfigboard.h b/ports/atmel-samd/boards/qtpy_m0/mpconfigboard.h new file mode 100644 index 0000000000..a88c1992de --- /dev/null +++ b/ports/atmel-samd/boards/qtpy_m0/mpconfigboard.h @@ -0,0 +1,55 @@ +#define MICROPY_HW_BOARD_NAME "Adafruit QT Py M0" +#define MICROPY_HW_MCU_NAME "samd21e18" + +#define MICROPY_HW_NEOPIXEL (&pin_PA19) + +#define MICROPY_PORT_A (0) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define IGNORE_PIN_PA00 1 +#define IGNORE_PIN_PA01 1 +#define IGNORE_PIN_PA09 1 +#define IGNORE_PIN_PA12 1 +#define IGNORE_PIN_PA13 1 +#define IGNORE_PIN_PA20 1 +#define IGNORE_PIN_PA21 1 +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 +#define IGNORE_PIN_PA27 1 +#define IGNORE_PIN_PA28 1 +#define IGNORE_PIN_PA30 1 +#define IGNORE_PIN_PA31 1 +#define IGNORE_PIN_PB01 1 +#define IGNORE_PIN_PB02 1 +#define IGNORE_PIN_PB03 1 +#define IGNORE_PIN_PB04 1 +#define IGNORE_PIN_PB05 1 +#define IGNORE_PIN_PB06 1 +#define IGNORE_PIN_PB07 1 +#define IGNORE_PIN_PB08 1 +#define IGNORE_PIN_PB09 1 +#define IGNORE_PIN_PB10 1 +#define IGNORE_PIN_PB11 1 +#define IGNORE_PIN_PB12 1 +#define IGNORE_PIN_PB13 1 +#define IGNORE_PIN_PB14 1 +#define IGNORE_PIN_PB15 1 +#define IGNORE_PIN_PB16 1 +#define IGNORE_PIN_PB17 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PB30 1 +#define IGNORE_PIN_PB31 1 +#define IGNORE_PIN_PB00 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA17) +#define DEFAULT_I2C_BUS_SDA (&pin_PA16) + +#define DEFAULT_SPI_BUS_SCK (&pin_PA11) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA08) +#define DEFAULT_SPI_BUS_MISO (&pin_PA10) + +#define DEFAULT_UART_BUS_RX (&pin_PA07) +#define DEFAULT_UART_BUS_TX (&pin_PA06) diff --git a/ports/atmel-samd/boards/qtpy_m0/mpconfigboard.mk b/ports/atmel-samd/boards/qtpy_m0/mpconfigboard.mk new file mode 100644 index 0000000000..964cbe643a --- /dev/null +++ b/ports/atmel-samd/boards/qtpy_m0/mpconfigboard.mk @@ -0,0 +1,24 @@ +USB_VID = 0x239A +USB_PID = 0x80CC +USB_PRODUCT = "QT Py M0" +USB_MANUFACTURER = "Adafruit Industries LLC" + +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE +CIRCUITPY_FULL_BUILD = 0 + +SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif diff --git a/ports/atmel-samd/boards/qtpy_m0/pins.c b/ports/atmel-samd/boards/qtpy_m0/pins.c new file mode 100644 index 0000000000..5732e9f5b3 --- /dev/null +++ b/ports/atmel-samd/boards/qtpy_m0/pins.c @@ -0,0 +1,49 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA03) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA05) }, + + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA16) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA17) }, + + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA06) }, + + { MP_ROM_QSTR(MP_QSTR_D7, MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA07) }, + + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA11) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA10) }, + + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA08) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_PA18) }, + + { 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_global_dict_table); From 2fac4851a5e6cf08688c64ce12b5918b52c610ab Mon Sep 17 00:00:00 2001 From: lady ada Date: Sat, 12 Sep 2020 19:56:13 -0400 Subject: [PATCH 0840/1293] fix typo, tested hardware, neopixel doesnt work tho --- ports/atmel-samd/boards/qtpy_m0/board.c | 3 +++ ports/atmel-samd/boards/qtpy_m0/pins.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/qtpy_m0/board.c b/ports/atmel-samd/boards/qtpy_m0/board.c index 5f7b4dda80..2add1867c0 100644 --- a/ports/atmel-samd/boards/qtpy_m0/board.c +++ b/ports/atmel-samd/boards/qtpy_m0/board.c @@ -25,6 +25,9 @@ */ #include "boards/board.h" +#include "common-hal/microcontroller/Pin.h" +#include "supervisor/shared/board.h" +#include "hal/include/hal_gpio.h" void board_init(void) { gpio_set_pin_function(PIN_PA18, GPIO_PIN_FUNCTION_OFF); diff --git a/ports/atmel-samd/boards/qtpy_m0/pins.c b/ports/atmel-samd/boards/qtpy_m0/pins.c index 5732e9f5b3..4ac10a7a66 100644 --- a/ports/atmel-samd/boards/qtpy_m0/pins.c +++ b/ports/atmel-samd/boards/qtpy_m0/pins.c @@ -23,7 +23,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_D7, MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA07) }, From cc57ef8368578fb5018249cbd3c9e6b688909c90 Mon Sep 17 00:00:00 2001 From: lady ada Date: Sat, 12 Sep 2020 19:58:27 -0400 Subject: [PATCH 0841/1293] add to buildyml! --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6bb9612f81..360c299927 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -275,6 +275,7 @@ jobs: - "pyportal" - "pyportal_titano" - "pyruler" + - "qtpy_m0" - "raytac_mdbt50q-db-40" - "robohatmm1_m4" - "sam32" From 15964a4750d9eb1a34317c166d9bde5f40c9878d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 12 Sep 2020 19:39:35 -0500 Subject: [PATCH 0842/1293] makeqstrdata: Avoid encoding problems Most users and the CI system are running in configurations where Python configures stdout and stderr in UTF-8 mode. However, Windows is different, setting values like CP1252. This led to a build failure on Windows, because makeqstrdata printed Unicode strings to its stdout, expecting them to be encoded as UTF-8. This script is writing (stdout) to a compiler input file and potentially printing messages (stderr) to a log or console. Explicitly configure stdout to use utf-8 to get consistent behavior on all platforms, and configure stderr so that if any log/diagnostic messages are printed that cannot be displayed correctly, they are still displayed instead of creating an error while trying to print the diagnostic information. I considered setting the encodings both to ascii, but this would just be occasionally inconvenient to developers like me who want to show diagnostic info on stderr and in comments while working with the compression code. Closes: #3408 --- py/makeqstrdata.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 57635807dc..e30f120e61 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -16,6 +16,9 @@ import collections import gettext import os.path +sys.stdout.reconfigure(encoding='utf-8') +sys.stderr.reconfigure(errors='backslashreplace') + py = os.path.dirname(sys.argv[0]) top = os.path.dirname(py) From 5deac8d2491ded0ace0ea02dc2ae5ee9becfdb14 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sun, 13 Sep 2020 18:22:40 +0530 Subject: [PATCH 0843/1293] Update board specific safe mode message --- .../atmel-samd/boards/circuitplayground_express/mpconfigboard.h | 2 +- .../boards/circuitplayground_express_crickit/mpconfigboard.h | 2 +- .../boards/circuitplayground_express_displayio/mpconfigboard.h | 2 +- ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h | 2 +- ports/atmel-samd/boards/meowmeow/mpconfigboard.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h index 12c48b1e39..4a6cbad862 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h @@ -25,7 +25,7 @@ #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up" +#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons 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 95b4ec110e..5a3871b5c6 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h @@ -27,7 +27,7 @@ #define USER_NEOPIXELS_PIN (&pin_PB23) // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up" +#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons 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 d478ea38b4..da1abfd9dc 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h @@ -25,7 +25,7 @@ #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up" +#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons 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/escornabot_makech/mpconfigboard.h b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h index 3a984188fa..892d6af370 100644 --- a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h +++ b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h @@ -11,7 +11,7 @@ #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up" +#define BOARD_USER_SAFE_MODE_ACTION "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/atmel-samd/boards/meowmeow/mpconfigboard.h b/ports/atmel-samd/boards/meowmeow/mpconfigboard.h index 80d3678630..224a8d7ce4 100644 --- a/ports/atmel-samd/boards/meowmeow/mpconfigboard.h +++ b/ports/atmel-samd/boards/meowmeow/mpconfigboard.h @@ -11,7 +11,7 @@ #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up" +#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up\n" #define DEFAULT_I2C_BUS_SCL (&pin_PA01) #define DEFAULT_I2C_BUS_SDA (&pin_PA00) From d18d79ac4709364c2371e2eaefd8f96bb20802e7 Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Mon, 14 Sep 2020 01:25:13 +0900 Subject: [PATCH 0844/1293] Small improvements to the dictionary compression --- py/makeqstrdata.py | 137 ++++++++++++++-------------------- supervisor/shared/translate.c | 12 +-- 2 files changed, 61 insertions(+), 88 deletions(-) diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index e30f120e61..0060217917 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -12,6 +12,7 @@ from __future__ import print_function import re import sys +from math import log import collections import gettext import os.path @@ -111,9 +112,10 @@ class TextSplitter: def iter_words(self, text): s = [] + words = self.words for m in self.pat.finditer(text): t = m.group(0) - if t in self.words: + if t in words: if s: yield (False, "".join(s)) s = [] @@ -124,33 +126,35 @@ class TextSplitter: yield (False, "".join(s)) def iter(self, text): - s = [] for m in self.pat.finditer(text): yield m.group(0) def iter_substrings(s, minlen, maxlen): - maxlen = min(len(s), maxlen) + len_s = len(s) + maxlen = min(len_s, maxlen) for n in range(minlen, maxlen + 1): - for begin in range(0, len(s) - n + 1): + for begin in range(0, len_s - n + 1): yield s[begin : begin + n] def compute_huffman_coding(translations, compression_filename): texts = [t[1] for t in translations] - all_strings_concat = "".join(texts) words = [] + + start_unused = 0x80 + end_unused = 0xff max_ord = 0 - begin_unused = 128 - end_unused = 256 for text in texts: for c in text: ord_c = ord(c) - max_ord = max(max_ord, ord_c) - if 128 <= ord_c < 256: + max_ord = max(ord_c, max_ord) + if 0x80 <= ord_c < 0xff: end_unused = min(ord_c, end_unused) - max_words = end_unused - begin_unused - char_size = 1 if max_ord < 256 else 2 + max_words = end_unused - 0x80 - sum_word_len = 0 + values_type = "uint16_t" if max_ord > 255 else "uint8_t" + max_words_len = 160 if max_ord > 255 else 255 + + sum_len = 0 while True: extractor = TextSplitter(words) counter = collections.Counter() @@ -162,30 +166,30 @@ def compute_huffman_coding(translations, compression_filename): scores = sorted( ( - # I don't know why this works good. This could be better. - (s, (len(s) - 1) ** ((max(occ - 2, 1) + 0.5) ** 0.8), occ) + (s, (len(s) - 1) ** log(max(occ - 2, 1)), occ) for (s, occ) in counter.items() ), key=lambda x: x[1], reverse=True, ) - w = None + word = None for (s, score, occ) in scores: - if score < 0: + if occ < 5: + continue + if score < 5: break - if len(s) > 1: - w = s - break - - if not w: + word = s break - if len(w) + sum_word_len > 256: + + if not word: + break + if sum_len + len(word) - 2 > max_words_len: break if len(words) == max_words: break - words.append(w) - sum_word_len += len(w) + words.append(word) + sum_len += len(word) - 2 extractor = TextSplitter(words) counter = collections.Counter() @@ -194,7 +198,7 @@ def compute_huffman_coding(translations, compression_filename): counter[atom] += 1 cb = huffman.codebook(counter.items()) - word_start = begin_unused + word_start = start_unused word_end = word_start + len(words) - 1 print("// # words", len(words)) print("// words", words) @@ -202,18 +206,18 @@ def compute_huffman_coding(translations, compression_filename): values = [] length_count = {} renumbered = 0 - last_l = None + last_length = None canonical = {} for atom, code in sorted(cb.items(), key=lambda x: (len(x[1]), x[0])): values.append(atom) - l = len(code) - if l not in length_count: - length_count[l] = 0 - length_count[l] += 1 - if last_l: - renumbered <<= (l - last_l) - canonical[atom] = '{0:0{width}b}'.format(renumbered, width=l) - #print(f"atom={repr(atom)} code={code}", file=sys.stderr) + length = len(code) + if length not in length_count: + length_count[length] = 0 + 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) if len(atom) > 1: o = words.index(atom) + 0x80 s = "".join(C_ESCAPES.get(ch1, ch1) for ch1 in atom) @@ -222,34 +226,37 @@ def compute_huffman_coding(translations, compression_filename): o = ord(atom) print("//", o, s, counter[atom], canonical[atom], renumbered) renumbered += 1 - last_l = l + last_length = length lengths = bytearray() print("// length count", length_count) for i in range(1, max(length_count) + 2): lengths.append(length_count.get(i, 0)) print("// values", values, "lengths", len(lengths), lengths) - maxord = max(ord(u) for u in values if len(u) == 1) - values_type = "uint16_t" if maxord > 255 else "uint8_t" - ch_size = 1 if maxord > 255 else 2 + print("//", values, lengths) values = [(atom if len(atom) == 1 else chr(0x80 + words.index(atom))) for atom in values] print("//", values, lengths) - max_translation_encoded_length = max(len(translation.encode("utf-8")) for original,translation in translations) + max_translation_encoded_length = max( + len(translation.encode("utf-8")) for (original, translation) in translations) + + wends = list(len(w) - 2 for w in words) + for i in range(1, len(wends)): + wends[i] += wends[i - 1] + with open(compression_filename, "w") as f: f.write("const uint8_t lengths[] = {{ {} }};\n".format(", ".join(map(str, lengths)))) f.write("const {} values[] = {{ {} }};\n".format(values_type, ", ".join(str(ord(u)) for u in values))) f.write("#define compress_max_length_bits ({})\n".format(max_translation_encoded_length.bit_length())) f.write("const {} words[] = {{ {} }};\n".format(values_type, ", ".join(str(ord(c)) for w in words for c in w))) - f.write("const uint8_t wlen[] = {{ {} }};\n".format(", ".join(str(len(w)) for w in words))) + f.write("const uint8_t wends[] = {{ {} }};\n".format(", ".join(str(p) for p in wends))) f.write("#define word_start {}\n".format(word_start)) f.write("#define word_end {}\n".format(word_end)) - extractor = TextSplitter(words) - return values, lengths, words, extractor + return (values, lengths, words, canonical, extractor) def decompress(encoding_table, encoded, encoded_length_bits): - values, lengths, words, extractor = encoding_table + (values, lengths, words, _, _) = encoding_table dec = [] this_byte = 0 this_bit = 7 @@ -306,66 +313,32 @@ 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() - values, lengths, words, extractor = encoding_table + (_, _, _, canonical, extractor) = encoding_table enc = bytearray(len(decompressed) * 3) - #print(decompressed) - #print(lengths) current_bit = 7 current_byte = 0 - code = len_translation_encoded - bits = encoded_length_bits+1 + bits = encoded_length_bits + 1 for i in range(bits - 1, 0, -1): if len_translation_encoded & (1 << (i - 1)): enc[current_byte] |= 1 << current_bit if current_bit == 0: current_bit = 7 - #print("packed {0:0{width}b}".format(enc[current_byte], width=8)) current_byte += 1 else: current_bit -= 1 - #print("values = ", values, file=sys.stderr) for atom in extractor.iter(decompressed): - #print("", file=sys.stderr) - if len(atom) > 1: - c = chr(0x80 + words.index(atom)) - else: - c = atom - assert c in values - - start = 0 - end = lengths[0] - bits = 1 - compressed = None - code = 0 - while compressed is None: - s = start - e = end - #print("{0:0{width}b}".format(code, width=bits)) - # Linear search! - for i in range(s, e): - if values[i] == c: - compressed = code + (i - start) - #print("found {0:0{width}b}".format(compressed, width=bits), file=sys.stderr) - break - code += end - start - code <<= 1 - start = end - end += lengths[bits] - bits += 1 - #print("next bit", bits) - - for i in range(bits - 1, 0, -1): - if compressed & (1 << (i - 1)): + for b in canonical[atom]: + if b == "1": enc[current_byte] |= 1 << current_bit if current_bit == 0: current_bit = 7 - #print("packed {0:0{width}b}".format(enc[current_byte], width=8)) current_byte += 1 else: current_bit -= 1 + if current_bit != 7: current_byte += 1 return enc[:current_byte] diff --git a/supervisor/shared/translate.c b/supervisor/shared/translate.c index cc0de7f619..44544c98dd 100644 --- a/supervisor/shared/translate.c +++ b/supervisor/shared/translate.c @@ -48,17 +48,17 @@ STATIC int put_utf8(char *buf, int u) { *buf = u; return 1; } else if(word_start <= u && u <= word_end) { - int n = (u - 0x80); - size_t off = 0; - for(int i=0; i 0) { + pos = wends[n - 1] + (n * 2); } int ret = 0; // note that at present, entries in the words table are // guaranteed not to represent words themselves, so this adds // at most 1 level of recursive call - for(int i=0; i Date: Sun, 13 Sep 2020 11:56:11 -0500 Subject: [PATCH 0845/1293] _bleio: fix markup typo --- shared-bindings/_bleio/Address.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c index 1f168d31af..04c667db44 100644 --- a/shared-bindings/_bleio/Address.c +++ b/shared-bindings/_bleio/Address.c @@ -86,7 +86,7 @@ STATIC mp_obj_t bleio_address_make_new(const mp_obj_type_t *type, size_t n_args, //| or use `str()` on the :py:class:`~_bleio.Attribute` object itself, the address will be printed //| in the expected order. For example: //| -//| .. code-block:: pycon +//| .. code-block:: python //| //| >>> import _bleio //| >>> _bleio.adapter.address From 36da92075b6b83a6b1a998b377f340524d143f35 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sun, 13 Sep 2020 22:57:24 +0530 Subject: [PATCH 0846/1293] Update safe mode reason --- locale/circuitpython.pot | 8 +------- .../boards/circuitplayground_express/mpconfigboard.h | 2 +- .../circuitplayground_express_crickit/mpconfigboard.h | 2 +- .../circuitplayground_express_displayio/mpconfigboard.h | 2 +- ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h | 2 +- ports/atmel-samd/boards/meowmeow/mpconfigboard.h | 2 +- supervisor/shared/safe_mode.c | 5 ++--- 7 files changed, 8 insertions(+), 15 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 0c6c4ac484..5814421729 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-12 18:06+0530\n" +"POT-Creation-Date: 2020-09-13 22:53+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -576,12 +576,6 @@ msgid "" "boot. Press again to exit safe mode.\n" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"CircuitPython is in safe mode with status being USER_SAFE_MODE but no " -"specific reason was provided.\n" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "CircuitPython was unable to allocate the heap.\n" msgstr "" diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h index 4a6cbad862..54789f04f9 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h @@ -25,7 +25,7 @@ #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up\n" +#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons 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 5a3871b5c6..e377275b7a 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h @@ -27,7 +27,7 @@ #define USER_NEOPIXELS_PIN (&pin_PB23) // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up\n" +#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons 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 da1abfd9dc..cacbed0de7 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h @@ -25,7 +25,7 @@ #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up\n" +#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons 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/escornabot_makech/mpconfigboard.h b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h index 892d6af370..ac1add545a 100644 --- a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h +++ b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h @@ -11,7 +11,7 @@ #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up\n" +#define BOARD_USER_SAFE_MODE_ACTION "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/atmel-samd/boards/meowmeow/mpconfigboard.h b/ports/atmel-samd/boards/meowmeow/mpconfigboard.h index 224a8d7ce4..79d477cac8 100644 --- a/ports/atmel-samd/boards/meowmeow/mpconfigboard.h +++ b/ports/atmel-samd/boards/meowmeow/mpconfigboard.h @@ -11,7 +11,7 @@ #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up\n" +#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up.\n" #define DEFAULT_I2C_BUS_SCL (&pin_PA01) #define DEFAULT_I2C_BUS_SDA (&pin_PA00) diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index f4f23378a4..0c7933a213 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -123,8 +123,7 @@ void print_safe_mode_message(safe_mode_t reason) { serial_write_compressed(translate("To exit, please reset the board without ")); serial_write_compressed(translate(BOARD_USER_SAFE_MODE_ACTION)); #else - // fallthrough - serial_write_compressed(translate("CircuitPython is in safe mode with status being USER_SAFE_MODE but no specific reason was provided.\n")); + break; #endif return; case MANUAL_SAFE_MODE: @@ -189,4 +188,4 @@ void print_safe_mode_message(safe_mode_t reason) { break; } serial_write_compressed(FILE_AN_ISSUE); -} +} \ No newline at end of file From 506bb097f7af5118a4e52a9471fe4599e681ba39 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sun, 13 Sep 2020 23:17:14 +0530 Subject: [PATCH 0847/1293] Update safe_mode.c --- supervisor/shared/safe_mode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index 0c7933a213..1cf36e4b71 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -72,7 +72,7 @@ safe_mode_t wait_for_safe_mode_reset(void) { // Blink on for 100, off for 100, on for 100, off for 100 and on for 200 common_hal_digitalio_digitalinout_set_value(&status_led, diff > 100 && diff / 100 != 2 && diff / 100 != 4); #endif - #ifdef CIRCUITPY_BOOT_BUTTON + #ifdef CIRCUITPY_BOOT_BUTTON if (!common_hal_digitalio_digitalinout_get_value(&boot_button)) { return USER_SAFE_MODE; } @@ -188,4 +188,4 @@ void print_safe_mode_message(safe_mode_t reason) { break; } serial_write_compressed(FILE_AN_ISSUE); -} \ No newline at end of file +} From 90f7340bfc35d19fcf5e11c078c7f45399ed07e7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 13 Sep 2020 13:12:35 -0500 Subject: [PATCH 0848/1293] move implicit-fallthrough warning enable to defns.mk --- ports/atmel-samd/Makefile | 2 +- py/circuitpy_defns.mk | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 20c79de8f1..72c7d96882 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -148,7 +148,7 @@ else endif endif -CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) -Wimplicit-fallthrough=2 +CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) ifeq ($(CHIP_FAMILY), samd21) CFLAGS += \ diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 04e38d81ea..0e87287c13 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -31,6 +31,7 @@ BASE_CFLAGS = \ -fsingle-precision-constant \ -fno-strict-aliasing \ -Wdouble-promotion \ + -Wimplicit-fallthrough=2 \ -Wno-endif-labels \ -Wstrict-prototypes \ -Werror-implicit-function-declaration \ From bbf2e9882738b6d599311d19ae52f32680774752 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Sun, 13 Sep 2020 21:19:10 +0200 Subject: [PATCH 0849/1293] 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 | 24 ++++++++++++------------ locale/cs.po | 21 ++++++++++++--------- locale/de_DE.po | 24 ++++++++++++------------ locale/es.po | 24 ++++++++++++------------ locale/fil.po | 15 +++++---------- locale/fr.po | 24 ++++++++++++------------ locale/hi.po | 12 +++++------- locale/it_IT.po | 15 +++++---------- locale/ja.po | 21 ++++++++++++--------- locale/ko.po | 12 +++++------- locale/nl.po | 21 ++++++++++++--------- locale/pl.po | 15 +++++---------- locale/pt_BR.po | 24 ++++++++++++------------ locale/sv.po | 21 ++++++++++++--------- locale/zh_Latn_pinyin.po | 24 ++++++++++++------------ 15 files changed, 145 insertions(+), 152 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 6312e0e242..d27b6c2207 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-09 14:33-0700\n" +"POT-Creation-Date: 2020-09-13 22:53+0530\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -34,14 +34,6 @@ msgstr "" "Harap ajukan masalah dengan konten drive CIRCUITPY Anda di\n" "https://github.com/adafruit/circuitpython/issues\n" -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"To exit, please reset the board without " -msgstr "" -"\n" -"Untuk keluar, harap setel ulang papan tanpa" - #: py/obj.c msgid " File \"%q\"" msgstr " File \"%q\"" @@ -1632,6 +1624,10 @@ msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "Untuk keluar, silahkan reset board tanpa " + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Terlalu banyak channel dalam sampel" @@ -3453,6 +3449,13 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "" +#~ "\n" +#~ "To exit, please reset the board without " +#~ msgstr "" +#~ "\n" +#~ "Untuk keluar, harap setel ulang papan tanpa" + #~ msgid "%q indices must be integers, not %s" #~ msgstr "indeks %q harus bilangan bulat, bukan %s" @@ -3712,9 +3715,6 @@ msgstr "" #~ "Tegangan dari mikrokontroler turun atau mati. Pastikan sumber tegangan " #~ "memberikan daya\n" -#~ msgid "To exit, please reset the board without " -#~ msgstr "Untuk keluar, silahkan reset board tanpa " - #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) tidak ada" diff --git a/locale/cs.po b/locale/cs.po index db04b0fff5..c1d46f1f9c 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-09 14:33-0700\n" +"POT-Creation-Date: 2020-09-13 22:53+0530\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -34,14 +34,6 @@ msgstr "" "Založte prosím problém s obsahem vaší jednotky CIRCUITPY na adrese\n" "https://github.com/adafruit/circuitpython/issues\n" -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"To exit, please reset the board without " -msgstr "" -"\n" -"Pro ukončení, prosím resetujte desku bez " - #: py/obj.c msgid " File \"%q\"" msgstr " Soubor \"%q\"" @@ -1611,6 +1603,10 @@ msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -3422,5 +3418,12 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "" +#~ "\n" +#~ "To exit, please reset the board without " +#~ msgstr "" +#~ "\n" +#~ "Pro ukončení, prosím resetujte desku bez " + #~ 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 388f0932b6..2dfc715e75 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-09 14:33-0700\n" +"POT-Creation-Date: 2020-09-13 22:53+0530\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -33,14 +33,6 @@ msgstr "" "Bitte melden Sie ein Problem mit dem Inhalt Ihres CIRCUITPY-Laufwerks unter\n" "https://github.com/adafruit/circuitpython/issues\n" -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"To exit, please reset the board without " -msgstr "" -"\n" -"Zum Beenden, resete bitte das Board ohne " - #: py/obj.c msgid " File \"%q\"" msgstr " Datei \"%q\"" @@ -1653,6 +1645,10 @@ msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "Zum beenden, resette bitte das board ohne " + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Zu viele Kanäle im sample." @@ -3510,6 +3506,13 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "" +#~ "\n" +#~ "To exit, please reset the board without " +#~ msgstr "" +#~ "\n" +#~ "Zum Beenden, resete bitte das Board ohne " + #~ msgid "PulseOut not supported on this chip" #~ msgstr "PulseOut wird auf diesem Chip nicht unterstützt" @@ -3932,9 +3935,6 @@ msgstr "" #~ "Die Reset-Taste wurde beim Booten von CircuitPython gedrückt. Drücke sie " #~ "erneut um den abgesicherten Modus zu verlassen. \n" -#~ msgid "To exit, please reset the board without " -#~ msgstr "Zum beenden, resette bitte das board ohne " - #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) existiert nicht" diff --git a/locale/es.po b/locale/es.po index 0f37aa1eb0..f72825d894 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-09 14:33-0700\n" +"POT-Creation-Date: 2020-09-13 22:53+0530\n" "PO-Revision-Date: 2020-08-17 21:11+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -36,14 +36,6 @@ msgstr "" "Reporte un problema con el contenido de su unidad CIRCUITPY en\n" "https://github.com/adafruit/circuitpython/issues\n" -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"To exit, please reset the board without " -msgstr "" -"\n" -"Para salir, favor reinicie la tarjeta sin " - #: py/obj.c msgid " File \"%q\"" msgstr " Archivo \"%q\"" @@ -1653,6 +1645,10 @@ msgstr "" "El temporizador es utilizado para uso interno - declare los pines para PWM " "más temprano en el programa" +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "Para salir, por favor reinicia la tarjeta sin " + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Demasiados canales en sample." @@ -3492,6 +3488,13 @@ 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 "" +#~ "\n" +#~ "To exit, please reset the board without " +#~ msgstr "" +#~ "\n" +#~ "Para salir, favor reinicie la tarjeta sin " + #~ msgid "PulseOut not supported on this chip" #~ msgstr "PulseOut no es compatible con este chip" @@ -3941,9 +3944,6 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Los índices de Tile deben ser 0 - 255" -#~ msgid "To exit, please reset the board without " -#~ msgstr "Para salir, por favor reinicia la tarjeta sin " - #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) no existe" diff --git a/locale/fil.po b/locale/fil.po index 2283dff2bb..c23d994dfa 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-09 14:33-0700\n" +"POT-Creation-Date: 2020-09-13 22:53+0530\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -28,12 +28,6 @@ msgid "" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"To exit, please reset the board without " -msgstr "" - #: py/obj.c msgid " File \"%q\"" msgstr " File \"%q\"" @@ -1626,6 +1620,10 @@ msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "Para lumabas, paki-reset ang board na wala ang " + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Sobra ang channels sa sample." @@ -3842,9 +3840,6 @@ msgstr "" #~ "Ang reset button ay pinindot habang nag boot ang CircuitPython. Pindutin " #~ "ulit para lumabas sa safe mode.\n" -#~ msgid "To exit, please reset the board without " -#~ msgstr "Para lumabas, paki-reset ang board na wala ang " - #~ msgid "UART(%d) does not exist" #~ msgstr "Walang UART(%d)" diff --git a/locale/fr.po b/locale/fr.po index 49da4ac4e3..a891a2a981 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-09 14:33-0700\n" +"POT-Creation-Date: 2020-09-13 22:53+0530\n" "PO-Revision-Date: 2020-07-27 21:27+0000\n" "Last-Translator: Nathan \n" "Language: fr\n" @@ -36,14 +36,6 @@ msgstr "" "l'adresse\n" "https://github.com/adafruit/circuitpython/issues\n" -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"To exit, please reset the board without " -msgstr "" -"\n" -"Pour quitter, veuillez réinitialiser la carte sans " - #: py/obj.c msgid " File \"%q\"" msgstr " Fichier \"%q\"" @@ -1655,6 +1647,10 @@ msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "Pour quitter, redémarrez la carte SVP sans " + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Trop de canaux dans l'échantillon." @@ -3513,6 +3509,13 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "" +#~ "\n" +#~ "To exit, please reset the board without " +#~ msgstr "" +#~ "\n" +#~ "Pour quitter, veuillez réinitialiser la carte sans " + #~ msgid "PulseOut not supported on this chip" #~ msgstr "PulseOut non pris en charge sur cette puce" @@ -3970,9 +3973,6 @@ msgstr "" #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Les indices des tuiles doivent être compris entre 0 et 255 " -#~ msgid "To exit, please reset the board without " -#~ msgstr "Pour quitter, redémarrez la carte SVP sans " - #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) n'existe pas" diff --git a/locale/hi.po b/locale/hi.po index bf85b19d70..1c904242e5 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-09 14:33-0700\n" +"POT-Creation-Date: 2020-09-13 22:53+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -29,12 +29,6 @@ msgid "" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"To exit, please reset the board without " -msgstr "" - #: py/obj.c msgid " File \"%q\"" msgstr "" @@ -1604,6 +1598,10 @@ msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index cfc6b76a56..24f16499cd 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-09 14:33-0700\n" +"POT-Creation-Date: 2020-09-13 22:53+0530\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -28,12 +28,6 @@ msgid "" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"To exit, please reset the board without " -msgstr "" - #: py/obj.c msgid " File \"%q\"" msgstr " File \"%q\"" @@ -1637,6 +1631,10 @@ msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "Per uscire resettare la scheda senza " + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -3833,9 +3831,6 @@ msgstr "" #~ "La potenza del microcontrollore è calata. Assicurati che l'alimentazione " #~ "sia attaccata correttamente\n" -#~ msgid "To exit, please reset the board without " -#~ msgstr "Per uscire resettare la scheda senza " - #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) non esistente" diff --git a/locale/ja.po b/locale/ja.po index b66e9a06d9..0e3ce60597 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-09 14:33-0700\n" +"POT-Creation-Date: 2020-09-13 22:53+0530\n" "PO-Revision-Date: 2020-09-01 18:44+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: none\n" @@ -36,14 +36,6 @@ msgstr "" "CIRCUITPYドライブの内容を添えて問題を以下で報告してください:\n" "https://github.com/adafruit/circuitpython/issues\n" -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"To exit, please reset the board without " -msgstr "" -"\n" -"終了するには、次の操作をせずにリセットしてください: " - #: py/obj.c msgid " File \"%q\"" msgstr " ファイル \"%q\"" @@ -1634,6 +1626,10 @@ msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "サンプルのチャンネル数が多すぎます" @@ -3450,6 +3446,13 @@ msgstr "ziはfloat値が必要" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "" +#~ "\n" +#~ "To exit, please reset the board without " +#~ msgstr "" +#~ "\n" +#~ "終了するには、次の操作をせずにリセットしてください: " + #~ msgid "PulseOut not supported on this chip" #~ msgstr "PulseOutはこのチップでサポートされていません" diff --git a/locale/ko.po b/locale/ko.po index 858d117f26..cebf6ec2bf 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-09 14:33-0700\n" +"POT-Creation-Date: 2020-09-13 22:53+0530\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -30,12 +30,6 @@ msgid "" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"To exit, please reset the board without " -msgstr "" - #: py/obj.c msgid " File \"%q\"" msgstr " 파일 \"%q\"" @@ -1607,6 +1601,10 @@ msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 470e9db9c5..61571d6bc5 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-09 14:33-0700\n" +"POT-Creation-Date: 2020-09-13 22:53+0530\n" "PO-Revision-Date: 2020-09-09 16:05+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -34,14 +34,6 @@ msgstr "" "Meld een probleem met de inhoud van de CIRCUITPY drive op:\n" "https://github.com/adafruit/circuitpython/issues\n" -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"To exit, please reset the board without " -msgstr "" -"\n" -"Om te verlaten, herstart de module zonder " - #: py/obj.c msgid " File \"%q\"" msgstr " Bestand" @@ -1647,6 +1639,10 @@ msgstr "" "Timer is gereserveerd voor intern gebruik - wijs PWM pins eerder in het " "programma toe" +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Teveel kanalen in sample." @@ -3480,6 +3476,13 @@ 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 "" +#~ "\n" +#~ "To exit, please reset the board without " +#~ msgstr "" +#~ "\n" +#~ "Om te verlaten, herstart de module zonder " + #~ msgid "PulseOut not supported on this chip" #~ msgstr "PulseOut niet ondersteund door deze chip" diff --git a/locale/pl.po b/locale/pl.po index 03915175a3..2b7339786d 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-09 14:33-0700\n" +"POT-Creation-Date: 2020-09-13 22:53+0530\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -30,12 +30,6 @@ msgid "" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"To exit, please reset the board without " -msgstr "" - #: py/obj.c msgid " File \"%q\"" msgstr " Plik \"%q\"" @@ -1609,6 +1603,10 @@ msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "By wyjść, proszę zresetować płytkę bez " + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Zbyt wiele kanałów." @@ -3735,9 +3733,6 @@ msgstr "" #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Indeks kafelka musi być pomiędzy 0 a 255 włącznie" -#~ msgid "To exit, please reset the board without " -#~ msgstr "By wyjść, proszę zresetować płytkę bez " - #~ msgid "UUID integer value not in range 0 to 0xffff" #~ msgstr "Wartość UUID poza zakresem 0 do 0xffff" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index d1d3b72092..33ca38a58f 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-09 14:33-0700\n" +"POT-Creation-Date: 2020-09-13 22:53+0530\n" "PO-Revision-Date: 2020-09-12 17:32+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -34,14 +34,6 @@ msgstr "" "Registre um problema com o conteúdo do seu controlador no CIRCUITPY\n" "https://github.com/adafruit/circuitpython/issues\n" -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"To exit, please reset the board without " -msgstr "" -"\n" -"Para encerrar, redefina a placa sem " - #: py/obj.c msgid " File \"%q\"" msgstr " Arquivo \"%q\"" @@ -1662,6 +1654,10 @@ msgstr "" "O temporizador foi reservado para uso interno - declare os pinos PWM no " "início do programa" +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "Para sair, por favor, reinicie a placa sem " + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Muitos canais na amostra." @@ -3508,6 +3504,13 @@ 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 "" +#~ "\n" +#~ "To exit, please reset the board without " +#~ msgstr "" +#~ "\n" +#~ "Para encerrar, redefina a placa sem " + #~ msgid "PulseOut not supported on this chip" #~ msgstr "O PulseOut não é compatível neste CI" @@ -3831,9 +3834,6 @@ msgstr "zi deve estar na forma (n_section, 2)" #~ msgid "STA required" #~ msgstr "STA requerido" -#~ msgid "To exit, please reset the board without " -#~ msgstr "Para sair, por favor, reinicie a placa sem " - #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) não existe" diff --git a/locale/sv.po b/locale/sv.po index 8911d0334d..c73b24c458 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-09 14:33-0700\n" +"POT-Creation-Date: 2020-09-13 22:53+0530\n" "PO-Revision-Date: 2020-09-07 19:36+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -34,14 +34,6 @@ msgstr "" "Vänligen skapa ett ärende med innehållet i din CIRCUITPY-enhet på\n" "https://github.com/adafruit/circuitpython/issues\n" -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"To exit, please reset the board without " -msgstr "" -"\n" -"För att avsluta, gör reset på kortet utan " - #: py/obj.c msgid " File \"%q\"" msgstr " Filen \"%q\"" @@ -1645,6 +1637,10 @@ msgstr "" "Timern är reserverad för internt bruk - deklarera PWM-pinne tidigare i " "programmet" +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "För många kanaler i sampling." @@ -3475,6 +3471,13 @@ 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 "" +#~ "\n" +#~ "To exit, please reset the board without " +#~ msgstr "" +#~ "\n" +#~ "För att avsluta, gör reset på kortet utan " + #~ msgid "PulseOut not supported on this chip" #~ msgstr "PulseIn stöds inte av detta chip" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 046bb9b754..41d928ff6c 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-09 14:33-0700\n" +"POT-Creation-Date: 2020-09-13 22:53+0530\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -34,14 +34,6 @@ msgstr "" "Qǐng tōngguò https://github.com/adafruit/circuitpython/issues\n" "tíjiāo yǒuguān nín de CIRCUITPY qūdòngqì nèiróng de wèntí \n" -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"To exit, please reset the board without " -msgstr "" -"\n" -"Qǐng zài méiyǒu _ de qíngkuàng xià chóng zhì bǎn zǐ yǐ tuìchū " - #: py/obj.c msgid " File \"%q\"" msgstr " Wénjiàn \"%q\"" @@ -1636,6 +1628,10 @@ msgstr "" "Dìngshí qì bǎoliú gōng nèibù shǐyòng-zài chéngxù de qiánmiàn shēngmíng PWM " "yǐn jiǎ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 " + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Chōuyàng zhōng de píndào tài duō." @@ -3463,6 +3459,13 @@ 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 "" +#~ "\n" +#~ "To exit, please reset the board without " +#~ msgstr "" +#~ "\n" +#~ "Qǐng zài méiyǒu _ de qíngkuàng xià chóng zhì bǎn zǐ yǐ tuìchū " + #~ msgid "tuple/list required on RHS" #~ msgstr "RHS yāoqiú de yuán zǔ/lièbiǎo" @@ -3838,9 +3841,6 @@ msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Píng pū zhǐshù bìxū wèi 0 - 255" -#~ 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 "UUID integer value not in range 0 to 0xffff" #~ msgstr "UUID zhěngshù zhí bùzài fànwéi 0 zhì 0xffff" From b3bdd4686bd5f4a7c91972b9b0f65e624a7eab95 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 13 Sep 2020 15:10:04 -0500 Subject: [PATCH 0850/1293] PacketBuffer: add missing 'break's, remove unneeded {} --- ports/nrf/common-hal/_bleio/PacketBuffer.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ports/nrf/common-hal/_bleio/PacketBuffer.c b/ports/nrf/common-hal/_bleio/PacketBuffer.c index a8773f961f..6d587984ca 100644 --- a/ports/nrf/common-hal/_bleio/PacketBuffer.c +++ b/ports/nrf/common-hal/_bleio/PacketBuffer.c @@ -129,14 +129,12 @@ STATIC bool packet_buffer_on_ble_client_evt(ble_evt_t *ble_evt, void *param) { } break; } - case BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE: { + case BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE: queue_next_write(self); break; - } - case BLE_GATTC_EVT_WRITE_RSP: { + case BLE_GATTC_EVT_WRITE_RSP: queue_next_write(self); break; - } default: return false; break; @@ -171,14 +169,14 @@ STATIC bool packet_buffer_on_ble_server_evt(ble_evt_t *ble_evt, void *param) { } break; } - case BLE_GAP_EVT_DISCONNECTED: { + case BLE_GAP_EVT_DISCONNECTED: if (self->conn_handle == ble_evt->evt.gap_evt.conn_handle) { self->conn_handle = BLE_CONN_HANDLE_INVALID; } - } - case BLE_GATTS_EVT_HVN_TX_COMPLETE: { + break; + case BLE_GATTS_EVT_HVN_TX_COMPLETE: queue_next_write(self); - } + break; default: return false; break; From 90b21ce548abb79e9ec28852f3517b373faa23b6 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Mon, 14 Sep 2020 04:29:00 +0200 Subject: [PATCH 0851/1293] 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/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/sv.po | 13 +++++++++++-- locale/zh_Latn_pinyin.po | 13 +++++++++++-- 15 files changed, 165 insertions(+), 30 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index d27b6c2207..5fd0647a14 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 22:53+0530\n" +"POT-Creation-Date: 2020-09-13 14:21-0500\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -1955,7 +1955,7 @@ msgstr "" msgid "bad format string" msgstr "" -#: py/binary.c +#: py/binary.c py/objarray.c msgid "bad typecode" msgstr "typecode buruk" @@ -2009,6 +2009,10 @@ msgstr "" msgid "bytes > 8 bits not supported" msgstr "byte > 8 bit tidak didukung" +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + #: py/objstr.c msgid "bytes value out of range" msgstr "" @@ -2975,6 +2979,11 @@ msgstr "" msgid "overflow converting long int to machine word" msgstr "" +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index c1d46f1f9c..8dcf08cf2a 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 22:53+0530\n" +"POT-Creation-Date: 2020-09-13 14:21-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -1927,7 +1927,7 @@ msgstr "" msgid "bad format string" msgstr "" -#: py/binary.c +#: py/binary.c py/objarray.c msgid "bad typecode" msgstr "" @@ -1980,6 +1980,10 @@ msgstr "" msgid "bytes > 8 bits not supported" msgstr "" +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + #: py/objstr.c msgid "bytes value out of range" msgstr "" @@ -2945,6 +2949,11 @@ msgstr "" msgid "overflow converting long int to machine word" msgstr "" +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 2dfc715e75..d9f80769ea 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 22:53+0530\n" +"POT-Creation-Date: 2020-09-13 14:21-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -1984,7 +1984,7 @@ msgstr "schlechter Konvertierungsspezifizierer" msgid "bad format string" msgstr "Falscher Formatstring" -#: py/binary.c +#: py/binary.c py/objarray.c msgid "bad typecode" msgstr "Falscher Typcode" @@ -2037,6 +2037,10 @@ msgstr "Byteorder ist kein String" msgid "bytes > 8 bits not supported" msgstr "bytes mit mehr als 8 bits werden nicht unterstützt" +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + #: py/objstr.c msgid "bytes value out of range" msgstr "Byte-Wert außerhalb des Bereichs" @@ -3026,6 +3030,11 @@ msgstr "" msgid "overflow converting long int to machine word" msgstr "Überlauf beim konvertieren von long int zu machine word" +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" msgstr "Die Palette muss 32 Byte lang sein" diff --git a/locale/es.po b/locale/es.po index f72825d894..85b4e758df 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 22:53+0530\n" +"POT-Creation-Date: 2020-09-13 14:21-0500\n" "PO-Revision-Date: 2020-08-17 21:11+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -1981,7 +1981,7 @@ msgstr "especificador de conversion erroneo" msgid "bad format string" msgstr "formato de string erroneo" -#: py/binary.c +#: py/binary.c py/objarray.c msgid "bad typecode" msgstr "typecode erroneo" @@ -2034,6 +2034,10 @@ msgstr "byteorder no es una cadena" msgid "bytes > 8 bits not supported" msgstr "bytes > 8 bits no soportados" +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + #: py/objstr.c msgid "bytes value out of range" msgstr "valor de bytes fuera de rango" @@ -3012,6 +3016,11 @@ msgstr "" msgid "overflow converting long int to machine word" msgstr "desbordamiento convirtiendo long int a palabra de máquina" +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" msgstr "palette debe ser 32 bytes de largo" diff --git a/locale/fil.po b/locale/fil.po index c23d994dfa..e630fddee3 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 22:53+0530\n" +"POT-Creation-Date: 2020-09-13 14:21-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -1954,7 +1954,7 @@ msgstr "masamang pag convert na specifier" msgid "bad format string" msgstr "maling format ang string" -#: py/binary.c +#: py/binary.c py/objarray.c msgid "bad typecode" msgstr "masamang typecode" @@ -2008,6 +2008,10 @@ msgstr "" msgid "bytes > 8 bits not supported" msgstr "hindi sinusuportahan ang bytes > 8 bits" +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + #: py/objstr.c msgid "bytes value out of range" msgstr "bytes value wala sa sakop" @@ -2990,6 +2994,11 @@ msgstr "" msgid "overflow converting long int to machine word" msgstr "overflow nagcoconvert ng long int sa machine word" +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" msgstr "ang palette ay dapat 32 bytes ang haba" diff --git a/locale/fr.po b/locale/fr.po index a891a2a981..1180648961 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 22:53+0530\n" +"POT-Creation-Date: 2020-09-13 14:21-0500\n" "PO-Revision-Date: 2020-07-27 21:27+0000\n" "Last-Translator: Nathan \n" "Language: fr\n" @@ -1988,7 +1988,7 @@ msgstr "mauvaise spécification de conversion" msgid "bad format string" msgstr "chaîne mal-formée" -#: py/binary.c +#: py/binary.c py/objarray.c msgid "bad typecode" msgstr "mauvais code type" @@ -2041,6 +2041,10 @@ msgstr "byteorder n'est pas une chaîne" msgid "bytes > 8 bits not supported" msgstr "octets > 8 bits non supporté" +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + #: py/objstr.c msgid "bytes value out of range" msgstr "valeur des octets hors bornes" @@ -3032,6 +3036,11 @@ msgstr "" msgid "overflow converting long int to machine word" msgstr "dépassement de capacité en convertissant un entier long en mot machine" +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" msgstr "la palette doit être longue de 32 octets" diff --git a/locale/hi.po b/locale/hi.po index 1c904242e5..c06eff81d9 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 22:53+0530\n" +"POT-Creation-Date: 2020-09-13 14:21-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -1922,7 +1922,7 @@ msgstr "" msgid "bad format string" msgstr "" -#: py/binary.c +#: py/binary.c py/objarray.c msgid "bad typecode" msgstr "" @@ -1975,6 +1975,10 @@ msgstr "" msgid "bytes > 8 bits not supported" msgstr "" +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + #: py/objstr.c msgid "bytes value out of range" msgstr "" @@ -2940,6 +2944,11 @@ msgstr "" msgid "overflow converting long int to machine word" msgstr "" +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 24f16499cd..5ff22f8a63 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 22:53+0530\n" +"POT-Creation-Date: 2020-09-13 14:21-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -1957,7 +1957,7 @@ msgstr "specificatore di conversione scorretto" msgid "bad format string" msgstr "stringa di formattazione scorretta" -#: py/binary.c +#: py/binary.c py/objarray.c msgid "bad typecode" msgstr "" @@ -2013,6 +2013,10 @@ msgstr "" msgid "bytes > 8 bits not supported" msgstr "byte > 8 bit non supportati" +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + #: py/objstr.c msgid "bytes value out of range" msgstr "valore byte fuori intervallo" @@ -2996,6 +3000,11 @@ msgstr "" msgid "overflow converting long int to machine word" msgstr "overflow convertendo long int in parola" +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" msgstr "la palette deve essere lunga 32 byte" diff --git a/locale/ja.po b/locale/ja.po index 0e3ce60597..db3839b402 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 22:53+0530\n" +"POT-Creation-Date: 2020-09-13 14:21-0500\n" "PO-Revision-Date: 2020-09-01 18:44+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: none\n" @@ -1952,7 +1952,7 @@ msgstr "" msgid "bad format string" msgstr "不正な書式化文字列" -#: py/binary.c +#: py/binary.c py/objarray.c msgid "bad typecode" msgstr "不正なtypecode" @@ -2005,6 +2005,10 @@ msgstr "byteorderが文字列ではありません" msgid "bytes > 8 bits not supported" msgstr "" +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + #: py/objstr.c msgid "bytes value out of range" msgstr "範囲外のバイト値" @@ -2972,6 +2976,11 @@ msgstr "" msgid "overflow converting long int to machine word" msgstr "long intをマシンのwordに変換する際にオーバーフローしました" +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" msgstr "パレットの長さは32バイトでなければなりません" diff --git a/locale/ko.po b/locale/ko.po index cebf6ec2bf..70b7985867 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 22:53+0530\n" +"POT-Creation-Date: 2020-09-13 14:21-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -1926,7 +1926,7 @@ msgstr "" msgid "bad format string" msgstr "" -#: py/binary.c +#: py/binary.c py/objarray.c msgid "bad typecode" msgstr "" @@ -1979,6 +1979,10 @@ msgstr "" msgid "bytes > 8 bits not supported" msgstr "" +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + #: py/objstr.c msgid "bytes value out of range" msgstr "" @@ -2944,6 +2948,11 @@ msgstr "" msgid "overflow converting long int to machine word" msgstr "" +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 61571d6bc5..04d0ede837 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 22:53+0530\n" +"POT-Creation-Date: 2020-09-13 14:21-0500\n" "PO-Revision-Date: 2020-09-09 16:05+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -1974,7 +1974,7 @@ msgstr "slechte conversie specificatie" msgid "bad format string" msgstr "string met verkeerde indeling" -#: py/binary.c +#: py/binary.c py/objarray.c msgid "bad typecode" msgstr "verkeerde typecode" @@ -2027,6 +2027,10 @@ msgstr "byteorder is geen string" msgid "bytes > 8 bits not supported" msgstr "butes > 8 niet ondersteund" +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + #: py/objstr.c msgid "bytes value out of range" msgstr "bytes waarde buiten bereik" @@ -3000,6 +3004,11 @@ msgstr "" msgid "overflow converting long int to machine word" msgstr "overloop bij converteren van long int naar machine word" +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" msgstr "palette moet 32 bytes lang zijn" diff --git a/locale/pl.po b/locale/pl.po index 2b7339786d..8b4fceee4a 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 22:53+0530\n" +"POT-Creation-Date: 2020-09-13 14:21-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -1930,7 +1930,7 @@ msgstr "zły specyfikator konwersji" msgid "bad format string" msgstr "zła specyfikacja formatu" -#: py/binary.c +#: py/binary.c py/objarray.c msgid "bad typecode" msgstr "zły typecode" @@ -1983,6 +1983,10 @@ msgstr "" msgid "bytes > 8 bits not supported" msgstr "bajty większe od 8 bitów są niewspierane" +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + #: py/objstr.c msgid "bytes value out of range" msgstr "wartość bytes poza zakresem" @@ -2949,6 +2953,11 @@ msgstr "" msgid "overflow converting long int to machine word" msgstr "przepełnienie przy konwersji long in to słowa maszynowego" +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" msgstr "paleta musi mieć 32 bajty długości" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 33ca38a58f..92e41e1fc1 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 22:53+0530\n" +"POT-Creation-Date: 2020-09-13 14:21-0500\n" "PO-Revision-Date: 2020-09-12 17:32+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -1991,7 +1991,7 @@ msgstr "especificador de conversão incorreto" msgid "bad format string" msgstr "formato da string incorreta" -#: py/binary.c +#: py/binary.c py/objarray.c msgid "bad typecode" msgstr "typecode incorreto" @@ -2044,6 +2044,10 @@ msgstr "a ordem dos bytes não é uma cadeia de caracteres" msgid "bytes > 8 bits not supported" msgstr "bytes > 8 bits não suportado" +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + #: py/objstr.c msgid "bytes value out of range" msgstr "o valor dos bytes estão fora do alcance" @@ -3029,6 +3033,11 @@ msgstr "" "houve um transbordamento durante a conversão int longo para a palavra de " "máquina" +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" msgstr "a paleta deve ter 32 bytes de comprimento" diff --git a/locale/sv.po b/locale/sv.po index c73b24c458..cc3cd4593e 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 22:53+0530\n" +"POT-Creation-Date: 2020-09-13 14:21-0500\n" "PO-Revision-Date: 2020-09-07 19:36+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -1969,7 +1969,7 @@ msgstr "Ogiltig konverteringsspecifikation" msgid "bad format string" msgstr "Ogiltig formatsträng" -#: py/binary.c +#: py/binary.c py/objarray.c msgid "bad typecode" msgstr "Ogiltig typkod" @@ -2022,6 +2022,10 @@ msgstr "byteorder är inte en sträng" msgid "bytes > 8 bits not supported" msgstr "bytes> 8 bitar stöds inte" +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + #: py/objstr.c msgid "bytes value out of range" msgstr "bytevärde utanför intervallet" @@ -2995,6 +2999,11 @@ msgstr "utanför räckvidd för target" msgid "overflow converting long int to machine word" msgstr "Konvertering av long int till machine word överskred maxvärde" +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" msgstr "palette måste vara 32 bytes lång" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 41d928ff6c..9b9c1414ac 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 22:53+0530\n" +"POT-Creation-Date: 2020-09-13 14:21-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -1960,7 +1960,7 @@ msgstr "cuòwù zhuǎnhuàn biāozhù" msgid "bad format string" msgstr "géshì cuòwù zìfú chuàn" -#: py/binary.c +#: py/binary.c py/objarray.c msgid "bad typecode" msgstr "cuòwù de dàimǎ lèixíng" @@ -2013,6 +2013,10 @@ msgstr "byteorder bùshì zìfú chuàn" msgid "bytes > 8 bits not supported" msgstr "zì jié > 8 wèi" +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + #: py/objstr.c msgid "bytes value out of range" msgstr "zì jié zhí chāochū fànwéi" @@ -2984,6 +2988,11 @@ msgstr "" msgid "overflow converting long int to machine word" msgstr "chāo gāo zhuǎnhuàn zhǎng zhěng shùzì shí" +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" msgstr "yánsè bìxū shì 32 gè zì jié" From 064c597b60d7394216d9c36080b7ee8ff089cb53 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Wed, 2 Sep 2020 15:42:57 +0200 Subject: [PATCH 0852/1293] camera: Implement new library for camera --- py/circuitpy_defns.mk | 6 + py/circuitpy_mpconfig.h | 8 ++ py/circuitpy_mpconfig.mk | 3 + shared-bindings/camera/Camera.c | 178 +++++++++++++++++++++++++++++ shared-bindings/camera/Camera.h | 45 ++++++++ shared-bindings/camera/ImageSize.c | 163 ++++++++++++++++++++++++++ shared-bindings/camera/ImageSize.h | 59 ++++++++++ shared-bindings/camera/__init__.c | 50 ++++++++ 8 files changed, 512 insertions(+) create mode 100644 shared-bindings/camera/Camera.c create mode 100644 shared-bindings/camera/Camera.h create mode 100644 shared-bindings/camera/ImageSize.c create mode 100644 shared-bindings/camera/ImageSize.h create mode 100644 shared-bindings/camera/__init__.c diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 0e87287c13..f72c821e53 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -139,6 +139,9 @@ endif ifeq ($(CIRCUITPY_BUSIO),1) SRC_PATTERNS += busio/% bitbangio/OneWire.% endif +ifeq ($(CIRCUITPY_CAMERA),1) +SRC_PATTERNS += camera/% +endif ifeq ($(CIRCUITPY_COUNTIO),1) SRC_PATTERNS += countio/% endif @@ -310,6 +313,9 @@ SRC_COMMON_HAL_ALL = \ busio/SPI.c \ busio/UART.c \ busio/__init__.c \ + camera/__init__.c \ + camera/Camera.c \ + camera/ImageSize.c \ countio/Counter.c \ countio/__init__.c \ digitalio/DigitalInOut.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 0fafbe876d..4272de2ec7 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -329,6 +329,13 @@ extern const struct _mp_obj_module_t busio_module; #define BUSIO_MODULE #endif +#if CIRCUITPY_CAMERA +extern const struct _mp_obj_module_t camera_module; +#define CAMERA_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_camera), (mp_obj_t)&camera_module }, +#else +#define CAMERA_MODULE +#endif + #if CIRCUITPY_COUNTIO extern const struct _mp_obj_module_t countio_module; #define COUNTIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_countio), (mp_obj_t)&countio_module }, @@ -758,6 +765,7 @@ extern const struct _mp_obj_module_t wifi_module; BLEIO_MODULE \ BOARD_MODULE \ BUSIO_MODULE \ + CAMERA_MODULE \ COUNTIO_MODULE \ DIGITALIO_MODULE \ DISPLAYIO_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index a2da9c42f5..54bdefc6dd 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -90,6 +90,9 @@ CFLAGS += -DCIRCUITPY_BOARD=$(CIRCUITPY_BOARD) CIRCUITPY_BUSIO ?= 1 CFLAGS += -DCIRCUITPY_BUSIO=$(CIRCUITPY_BUSIO) +CIRCUITPY_CAMERA ?= 0 +CFLAGS += -DCIRCUITPY_CAMERA=$(CIRCUITPY_CAMERA) + CIRCUITPY_DIGITALIO ?= 1 CFLAGS += -DCIRCUITPY_DIGITALIO=$(CIRCUITPY_DIGITALIO) diff --git a/shared-bindings/camera/Camera.c b/shared-bindings/camera/Camera.c new file mode 100644 index 0000000000..3855fed3c7 --- /dev/null +++ b/shared-bindings/camera/Camera.c @@ -0,0 +1,178 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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/objproperty.h" +#include "py/runtime.h" + +#include "shared-bindings/camera/Camera.h" +#include "shared-bindings/util.h" + +//| class Camera: +//| """The class to control camera. +//| +//| Usage:: +//| +//| import board +//| import sdioio +//| import storage +//| import camera +//| +//| sd = sdioio.SDCard( +//| clock=board.SDIO_CLOCK, +//| command=board.SDIO_COMMAND, +//| data=board.SDIO_DATA, +//| frequency=25000000) +//| vfs = storage.VfsFat(sd) +//| storage.mount(vfs, '/sd') +//| +//| cam = camera.Camera(camera.ImageSize.IMAGE_SIZE_1920x1080) +//| +//| file = open("/sd/image.jpg","wb") +//| cam.take_picture() +//| file.write(cam.picture) +//| file.close()""" +//| + +//| def __init__(self, ): +//| """Initialize camera. +//| +//| :param camera.ImageSize size: image size""" +//| ... +//| +STATIC mp_obj_t camera_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + camera_obj_t *self = m_new_obj(camera_obj_t); + self->base.type = &camera_type; + enum { ARG_size }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_size, MP_ARG_REQUIRED | MP_ARG_OBJ }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + camera_imagesize_t size = camera_imagesize_obj_to_type(args[ARG_size].u_obj); + + common_hal_camera_construct(self, size); + return MP_OBJ_FROM_PTR(self); +} + +//| def deinit(self, ) -> Any: +//| """De-initialize camera.""" +//| ... +//| +STATIC mp_obj_t camera_obj_deinit(mp_obj_t self_in) { + camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_camera_deinit(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(camera_deinit_obj, camera_obj_deinit); + +STATIC void check_for_deinit(camera_obj_t *self) { + if (common_hal_camera_deinited(self)) { + raise_deinited_error(); + } +} + +//| def take_picture(self, ) -> Any: +//| """Take picture.""" +//| ... +//| +STATIC mp_obj_t camera_obj_take_picture(mp_obj_t self_in) { + camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + common_hal_camera_take_picture(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(camera_take_picture_obj, camera_obj_take_picture); + +//| picture: Any = ... +//| """Image buffer.""" +//| +STATIC mp_obj_t camera_obj_get_picture(mp_obj_t self_in) { + camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + uint8_t *buffer = common_hal_camera_get_picture_buffer(self); + size_t size = common_hal_camera_get_picture_size(self); + + return mp_obj_new_bytearray_by_ref(size, buffer); +} +MP_DEFINE_CONST_FUN_OBJ_1(camera_get_picture_obj, camera_obj_get_picture); + +const mp_obj_property_t camera_picture_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&camera_get_picture_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| size: Any = ... +//| """Image size.""" +//| +STATIC mp_obj_t camera_obj_get_size(mp_obj_t self_in) { + camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return camera_imagesize_type_to_obj(common_hal_camera_get_size(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(camera_get_size_obj, camera_obj_get_size); + +STATIC mp_obj_t camera_obj_set_size(mp_obj_t self_in, mp_obj_t value) { + camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + camera_imagesize_t size = camera_imagesize_obj_to_type(value); + if (size == IMAGESIZE_NONE) { + mp_raise_ValueError(translate("Invalid image size.")); + } + + common_hal_camera_set_size(self, size); + + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(camera_set_size_obj, camera_obj_set_size); + +const mp_obj_property_t camera_size_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&camera_get_size_obj, + (mp_obj_t)&camera_set_size_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +STATIC const mp_rom_map_elem_t camera_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&camera_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_take_picture), MP_ROM_PTR(&camera_take_picture_obj) }, + + { MP_ROM_QSTR(MP_QSTR_picture), MP_ROM_PTR(&camera_picture_obj) }, + { MP_ROM_QSTR(MP_QSTR_size), MP_ROM_PTR(&camera_size_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(camera_locals_dict, camera_locals_dict_table); + +const mp_obj_type_t camera_type = { + { &mp_type_type }, + .name = MP_QSTR_GNSS, + .make_new = camera_make_new, + .locals_dict = (mp_obj_dict_t*)&camera_locals_dict, +}; diff --git a/shared-bindings/camera/Camera.h b/shared-bindings/camera/Camera.h new file mode 100644 index 0000000000..e70d2493ec --- /dev/null +++ b/shared-bindings/camera/Camera.h @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_CAMERA_CAMERA_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_CAMERA_CAMERA_H + +#include "common-hal/camera/Camera.h" +#include "shared-bindings/camera/ImageSize.h" + +extern const mp_obj_type_t camera_type; + +void common_hal_camera_construct(camera_obj_t *self, camera_imagesize_t size); +void common_hal_camera_deinit(camera_obj_t *self); +bool common_hal_camera_deinited(camera_obj_t *self); +void common_hal_camera_take_picture(camera_obj_t *self); + +uint8_t* common_hal_camera_get_picture_buffer(camera_obj_t *self); +size_t common_hal_camera_get_picture_size(camera_obj_t *self); +camera_imagesize_t common_hal_camera_get_size(camera_obj_t *self); +void common_hal_camera_set_size(camera_obj_t *self, camera_imagesize_t size); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_CAMERA_CAMERA_H diff --git a/shared-bindings/camera/ImageSize.c b/shared-bindings/camera/ImageSize.c new file mode 100644 index 0000000000..bfa01814d9 --- /dev/null +++ b/shared-bindings/camera/ImageSize.c @@ -0,0 +1,163 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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 "shared-bindings/camera/ImageSize.h" + +//| class ImageSize: +//| """Image size""" +//| +//| def __init__(self) -> None: +//| """Enum-like class to define the image size.""" +//| +//| IMAGE_SIZE_320x240: ImageSize +//| """Image size 320x240.""" +//| +//| IMAGE_SIZE_640x480: ImageSize +//| """Image size 640x480.""" +//| +//| IMAGE_SIZE_1280x720: ImageSize +//| """Image size 1280x720.""" +//| +//| IMAGE_SIZE_1280x960: ImageSize +//| """Image size 1280x960.""" +//| +//| IMAGE_SIZE_1920x1080: ImageSize +//| """Image size 1920x1080.""" +//| +//| IMAGE_SIZE_2048x1536: ImageSize +//| """Image size 2048x1536.""" +//| +//| IMAGE_SIZE_2560x1920: ImageSize +//| """Image size 2560x1920.""" +//| +const mp_obj_type_t camera_imagesize_type; + +const camera_imagesize_obj_t camera_imagesize_320x240_obj = { + { &camera_imagesize_type }, +}; + +const camera_imagesize_obj_t camera_imagesize_640x320_obj = { + { &camera_imagesize_type }, +}; + +const camera_imagesize_obj_t camera_imagesize_1280x720_obj = { + { &camera_imagesize_type }, +}; + +const camera_imagesize_obj_t camera_imagesize_1280x960_obj = { + { &camera_imagesize_type }, +}; + +const camera_imagesize_obj_t camera_imagesize_1920x1080_obj = { + { &camera_imagesize_type }, +}; + +const camera_imagesize_obj_t camera_imagesize_2048x1536_obj = { + { &camera_imagesize_type }, +}; + +const camera_imagesize_obj_t camera_imagesize_2560x1920_obj = { + { &camera_imagesize_type }, +}; + +camera_imagesize_t camera_imagesize_obj_to_type(mp_obj_t obj) { + if (obj == MP_ROM_PTR(&camera_imagesize_320x240_obj)) { + return IMAGESIZE_320x240; + } else if (obj == MP_ROM_PTR(&camera_imagesize_640x320_obj)) { + return IMAGESIZE_640x320; + } else if (obj == MP_ROM_PTR(&camera_imagesize_1280x720_obj)) { + return IMAGESIZE_1280x720; + } else if (obj == MP_ROM_PTR(&camera_imagesize_1280x960_obj)) { + return IMAGESIZE_1280x960; + } else if (obj == MP_ROM_PTR(&camera_imagesize_1920x1080_obj)) { + return IMAGESIZE_1920x1080; + } else if (obj == MP_ROM_PTR(&camera_imagesize_2048x1536_obj)) { + return IMAGESIZE_2048x1536; + } else if (obj == MP_ROM_PTR(&camera_imagesize_2560x1920_obj)) { + return IMAGESIZE_2560x1920; + } + return IMAGESIZE_NONE; +} + +mp_obj_t camera_imagesize_type_to_obj(camera_imagesize_t size) { + switch (size) { + case IMAGESIZE_320x240: + return (mp_obj_t)MP_ROM_PTR(&camera_imagesize_320x240_obj); + case IMAGESIZE_640x320: + return (mp_obj_t)MP_ROM_PTR(&camera_imagesize_640x320_obj); + case IMAGESIZE_1280x720: + return (mp_obj_t)MP_ROM_PTR(&camera_imagesize_1280x720_obj); + case IMAGESIZE_1280x960: + return (mp_obj_t)MP_ROM_PTR(&camera_imagesize_1280x960_obj); + case IMAGESIZE_1920x1080: + return (mp_obj_t)MP_ROM_PTR(&camera_imagesize_1920x1080_obj); + case IMAGESIZE_2048x1536: + return (mp_obj_t)MP_ROM_PTR(&camera_imagesize_2048x1536_obj); + case IMAGESIZE_2560x1920: + return (mp_obj_t)MP_ROM_PTR(&camera_imagesize_2560x1920_obj); + case IMAGESIZE_NONE: + default: + return (mp_obj_t)MP_ROM_PTR(&mp_const_none_obj); + } +} + +STATIC const mp_rom_map_elem_t camera_imagesize_locals_dict_table[] = { + {MP_ROM_QSTR(MP_QSTR_IMAGE_SIZE_320x240), MP_ROM_PTR(&camera_imagesize_320x240_obj)}, + {MP_ROM_QSTR(MP_QSTR_IMAGE_SIZE_640x320), MP_ROM_PTR(&camera_imagesize_640x320_obj)}, + {MP_ROM_QSTR(MP_QSTR_IMAGE_SIZE_1280x720), MP_ROM_PTR(&camera_imagesize_1280x720_obj)}, + {MP_ROM_QSTR(MP_QSTR_IMAGE_SIZE_1280x960), MP_ROM_PTR(&camera_imagesize_1280x960_obj)}, + {MP_ROM_QSTR(MP_QSTR_IMAGE_SIZE_1920x1080), MP_ROM_PTR(&camera_imagesize_1920x1080_obj)}, + {MP_ROM_QSTR(MP_QSTR_IMAGE_SIZE_2048x1536), MP_ROM_PTR(&camera_imagesize_2048x1536_obj)}, + {MP_ROM_QSTR(MP_QSTR_IMAGE_SIZE_2560x1920), MP_ROM_PTR(&camera_imagesize_2560x1920_obj)}, +}; +STATIC MP_DEFINE_CONST_DICT(camera_imagesize_locals_dict, camera_imagesize_locals_dict_table); + +STATIC void camera_imagesize_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { + qstr size = MP_QSTR_None; + if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&camera_imagesize_320x240_obj)) { + size = MP_QSTR_IMAGE_SIZE_320x240; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&camera_imagesize_640x320_obj)) { + size = MP_QSTR_IMAGE_SIZE_640x320; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&camera_imagesize_1280x720_obj)) { + size = MP_QSTR_IMAGE_SIZE_1280x720; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&camera_imagesize_1280x960_obj)) { + size = MP_QSTR_IMAGE_SIZE_1280x960; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&camera_imagesize_1920x1080_obj)) { + size = MP_QSTR_IMAGE_SIZE_1920x1080; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&camera_imagesize_2048x1536_obj)) { + size = MP_QSTR_IMAGE_SIZE_2048x1536; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&camera_imagesize_2560x1920_obj)) { + size = MP_QSTR_IMAGE_SIZE_2560x1920; + } + mp_printf(print, "%q.%q.%q", MP_QSTR_camera, MP_QSTR_ImageSize, size); +} + +const mp_obj_type_t camera_imagesize_type = { + { &mp_type_type }, + .name = MP_QSTR_ImageSize, + .print = camera_imagesize_print, + .locals_dict = (mp_obj_t)&camera_imagesize_locals_dict, +}; diff --git a/shared-bindings/camera/ImageSize.h b/shared-bindings/camera/ImageSize.h new file mode 100644 index 0000000000..3fe624e066 --- /dev/null +++ b/shared-bindings/camera/ImageSize.h @@ -0,0 +1,59 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_CAMERA_IMAGESIZE_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_CAMERA_IMAGESIZE_H + +#include "py/obj.h" + +typedef enum { + IMAGESIZE_NONE, + IMAGESIZE_320x240, + IMAGESIZE_640x320, + IMAGESIZE_1280x720, + IMAGESIZE_1280x960, + IMAGESIZE_1920x1080, + IMAGESIZE_2048x1536, + IMAGESIZE_2560x1920, +} camera_imagesize_t; + +const mp_obj_type_t camera_imagesize_type; + +camera_imagesize_t camera_imagesize_obj_to_type(mp_obj_t obj); +mp_obj_t camera_imagesize_type_to_obj(camera_imagesize_t mode); + +typedef struct { + mp_obj_base_t base; +} camera_imagesize_obj_t; +extern const camera_imagesize_obj_t camera_imagesize_320x240_obj; +extern const camera_imagesize_obj_t camera_imagesize_640x320_obj; +extern const camera_imagesize_obj_t camera_imagesize_1280x720_obj; +extern const camera_imagesize_obj_t camera_imagesize_1280x960_obj; +extern const camera_imagesize_obj_t camera_imagesize_1920x1080_obj; +extern const camera_imagesize_obj_t camera_imagesize_2048x1536_obj; +extern const camera_imagesize_obj_t camera_imagesize_2560x1920_obj; + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_CAMERA_IMAGESIZE_H diff --git a/shared-bindings/camera/__init__.c b/shared-bindings/camera/__init__.c new file mode 100644 index 0000000000..3398d1ade6 --- /dev/null +++ b/shared-bindings/camera/__init__.c @@ -0,0 +1,50 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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/obj.h" +#include "py/runtime.h" +#include "py/mphal.h" +#include "shared-bindings/camera/Camera.h" +#include "shared-bindings/util.h" + +//| """Support for camera input +//| +//| The `camera` module contains classes to control the camera and take pictures.""" +//| +STATIC const mp_rom_map_elem_t camera_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_camera) }, + { MP_ROM_QSTR(MP_QSTR_Camera), MP_ROM_PTR(&camera_type) }, + + // Enum-like Classes. + { MP_ROM_QSTR(MP_QSTR_ImageSize), MP_ROM_PTR(&camera_imagesize_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(camera_module_globals, camera_module_globals_table); + +const mp_obj_module_t camera_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&camera_module_globals, +}; From 1fde8ef9bce14ceea241574f074ac446dca93055 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Wed, 2 Sep 2020 15:43:37 +0200 Subject: [PATCH 0853/1293] spresense: Add support for camera --- ports/cxd56/Makefile | 2 +- ports/cxd56/common-hal/camera/Camera.c | 224 ++++++++++++++++++++++ ports/cxd56/common-hal/camera/Camera.h | 43 +++++ ports/cxd56/common-hal/camera/ImageSize.c | 0 ports/cxd56/common-hal/camera/__init__.c | 1 + ports/cxd56/mpconfigport.mk | 1 + 6 files changed, 270 insertions(+), 1 deletion(-) create mode 100644 ports/cxd56/common-hal/camera/Camera.c create mode 100644 ports/cxd56/common-hal/camera/Camera.h create mode 100644 ports/cxd56/common-hal/camera/ImageSize.c create mode 100644 ports/cxd56/common-hal/camera/__init__.c diff --git a/ports/cxd56/Makefile b/ports/cxd56/Makefile index bb3958af4f..7e145f5e2d 100644 --- a/ports/cxd56/Makefile +++ b/ports/cxd56/Makefile @@ -201,7 +201,7 @@ all: $(BUILD)/firmware.spk $(FIRMWARE): $(ECHO) "" $(ECHO) "Download the spresense binaries zip archive from:" - $(ECHO) "https://developer.sony.com/file/download/download-spresense-firmware-v1-4-000" + $(ECHO) "https://developer.sony.com/file/download/download-spresense-firmware-v2-0-000" $(ECHO) "Extract spresense binaries to $(FIRMWARE)" $(ECHO) "" $(ECHO) "run make flash-bootloader again to flash bootloader." diff --git a/ports/cxd56/common-hal/camera/Camera.c b/ports/cxd56/common-hal/camera/Camera.c new file mode 100644 index 0000000000..0c22525302 --- /dev/null +++ b/ports/cxd56/common-hal/camera/Camera.c @@ -0,0 +1,224 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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 +#include + +#include +#include +#include + +#include "py/runtime.h" + +#include "shared-bindings/camera/Camera.h" + +#define JPG_COMPRESS_RATIO (9) +#define SPRESENSE_CAMIMAGE_MEM_ALIGN (32) + +typedef struct { + const char* devpath; + int fd; +} camera_dev_t; + +STATIC camera_dev_t camera_dev = {"/dev/video", -1}; + +static void camera_size_to_width_and_height(camera_imagesize_t size, uint16_t *width, uint16_t *height) { + switch (size) { + case IMAGESIZE_320x240: + *height = VIDEO_VSIZE_QVGA; + *width = VIDEO_HSIZE_QVGA; + break; + case IMAGESIZE_640x320: + *height = VIDEO_VSIZE_VGA; + *width = VIDEO_HSIZE_VGA; + break; + case IMAGESIZE_1280x720: + *height = VIDEO_VSIZE_HD; + *width = VIDEO_HSIZE_HD; + break; + case IMAGESIZE_1280x960: + *height = VIDEO_VSIZE_QUADVGA; + *width = VIDEO_HSIZE_QUADVGA; + break; + case IMAGESIZE_1920x1080: + *height = VIDEO_VSIZE_FULLHD; + *width = VIDEO_HSIZE_FULLHD; + break; + case IMAGESIZE_2048x1536: + *height = VIDEO_VSIZE_3M; + *width = VIDEO_HSIZE_3M; + break; + case IMAGESIZE_2560x1920: + *height = VIDEO_VSIZE_5M; + *width = VIDEO_HSIZE_5M; + break; + default: + mp_raise_ValueError(translate("Size not supported")); + break; + } +} + +static void camera_set_format(enum v4l2_buf_type type, uint32_t pixformat, uint16_t width, uint16_t height) { + v4l2_requestbuffers_t req = {0}; + + // Set Buffer Mode. + req.type = type; + req.memory = V4L2_MEMORY_USERPTR; + req.count = 1; + req.mode = V4L2_BUF_MODE_RING; + ioctl(camera_dev.fd, VIDIOC_REQBUFS, (unsigned long)&req); + v4l2_format_t fmt = {0}; + + // Set Format. + fmt.type = type; + fmt.fmt.pix.width = width; + fmt.fmt.pix.height = height; + fmt.fmt.pix.field = V4L2_FIELD_ANY; + fmt.fmt.pix.pixelformat = pixformat; + ioctl(camera_dev.fd, VIDIOC_S_FMT, (unsigned long)&fmt); +} + +static void camera_start_streaming(enum v4l2_buf_type type) { + ioctl(camera_dev.fd, VIDIOC_STREAMON, (unsigned long)&type); +} + +static void camera_start_preview() { + camera_set_format(V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_PIX_FMT_UYVY, VIDEO_HSIZE_QVGA, VIDEO_VSIZE_QVGA); + + v4l2_buffer_t buf; + + memset(&buf, 0, sizeof(v4l2_buffer_t)); + buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + buf.memory = V4L2_MEMORY_USERPTR; + ioctl(camera_dev.fd, VIDIOC_QBUF, (unsigned long)&buf); + + camera_start_streaming(V4L2_BUF_TYPE_VIDEO_CAPTURE); +} + +void common_hal_camera_construct(camera_obj_t *self, camera_imagesize_t size) { + if (camera_dev.fd < 0) { + if (video_initialize(camera_dev.devpath) < 0) { + mp_raise_ValueError(translate("Could not initialize Camera")); + } + camera_dev.fd = open(camera_dev.devpath, 0); + if (camera_dev.fd < 0) { + mp_raise_ValueError(translate("Could not initialize Camera")); + } + } + + uint16_t width, height; + + camera_size_to_width_and_height(size, &width, &height); + + self->size = size; + + // In SPRESENSE SDK, JPEG compression quality=80 by default. + // In such setting, the maximum actual measured size of JPEG image + // is about width * height * 2 / 9. + self->buffer_size = (size_t)(width * height * 2 / JPG_COMPRESS_RATIO);; + self->buffer = m_malloc(self->buffer_size, true); + if (self->buffer == NULL) { + mp_raise_msg(&mp_type_MemoryError, translate("Couldn't allocate picture buffer")); + } + self->picture_buffer = self->buffer; + while ((uint32_t)self->picture_buffer % SPRESENSE_CAMIMAGE_MEM_ALIGN != 0) { + self->picture_buffer++; + } + + camera_start_preview(); + + camera_set_format(V4L2_BUF_TYPE_STILL_CAPTURE, V4L2_PIX_FMT_JPEG, width, height); + + camera_start_streaming(V4L2_BUF_TYPE_STILL_CAPTURE); + + sleep(1); +} + +void common_hal_camera_deinit(camera_obj_t *self) { + if (common_hal_camera_deinited(self)) { + return; + } + + video_uninitialize(); + + m_free(self->buffer); + + close(camera_dev.fd); + camera_dev.fd = -1; +} + +bool common_hal_camera_deinited(camera_obj_t *self) { + return camera_dev.fd < 0; +} + +void common_hal_camera_take_picture(camera_obj_t *self) { + v4l2_buffer_t buf; + + memset(&buf, 0, sizeof(v4l2_buffer_t)); + buf.type = V4L2_BUF_TYPE_STILL_CAPTURE; + buf.memory = V4L2_MEMORY_USERPTR; + buf.m.userptr = (unsigned long)self->picture_buffer; + buf.length = self->buffer_size - SPRESENSE_CAMIMAGE_MEM_ALIGN; + ioctl(camera_dev.fd, VIDIOC_QBUF, (unsigned long)&buf); + + ioctl(camera_dev.fd, VIDIOC_TAKEPICT_START, 0); + + ioctl(camera_dev.fd, VIDIOC_DQBUF, (unsigned long)&buf); + + ioctl(camera_dev.fd, VIDIOC_TAKEPICT_STOP, false); + + self->picture_size = (size_t)buf.bytesused; +} + +uint8_t *common_hal_camera_get_picture_buffer(camera_obj_t *self) { + return self->picture_buffer; +} + +size_t common_hal_camera_get_picture_size(camera_obj_t *self) { + return self->picture_size; +} + +camera_imagesize_t common_hal_camera_get_size(camera_obj_t *self) { + return self->size; +} + +void common_hal_camera_set_size(camera_obj_t *self, camera_imagesize_t size) { + uint16_t width, height; + + camera_size_to_width_and_height(size, &width, &height); + + self->buffer_size = (size_t)(width * height * 2 / JPG_COMPRESS_RATIO);; + self->buffer = m_realloc(self->buffer, self->buffer_size); + if (self->buffer == NULL) { + mp_raise_msg(&mp_type_MemoryError, translate("Couldn't allocate picture buffer")); + } + self->picture_buffer = self->buffer; + while ((uint32_t)self->picture_buffer % SPRESENSE_CAMIMAGE_MEM_ALIGN != 0) { + self->picture_buffer++; + } + + camera_set_format(V4L2_BUF_TYPE_STILL_CAPTURE, V4L2_PIX_FMT_JPEG, width, height); +} diff --git a/ports/cxd56/common-hal/camera/Camera.h b/ports/cxd56/common-hal/camera/Camera.h new file mode 100644 index 0000000000..1eb63ace11 --- /dev/null +++ b/ports/cxd56/common-hal/camera/Camera.h @@ -0,0 +1,43 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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. + */ + +#ifndef MICROPY_INCLUDED_CXD56_COMMON_HAL_CAMERA_CAMERA_H +#define MICROPY_INCLUDED_CXD56_COMMON_HAL_CAMERA_CAMERA_H + +#include "py/obj.h" + +#include "shared-bindings/camera/ImageSize.h" + +typedef struct { + mp_obj_base_t base; + uint8_t *buffer; + size_t buffer_size; + uint8_t *picture_buffer; + size_t picture_size; + camera_imagesize_t size; +} camera_obj_t; + +#endif // MICROPY_INCLUDED_CXD56_COMMON_HAL_CAMERA_CAMERA_H diff --git a/ports/cxd56/common-hal/camera/ImageSize.c b/ports/cxd56/common-hal/camera/ImageSize.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/cxd56/common-hal/camera/__init__.c b/ports/cxd56/common-hal/camera/__init__.c new file mode 100644 index 0000000000..bf38b5f2bd --- /dev/null +++ b/ports/cxd56/common-hal/camera/__init__.c @@ -0,0 +1 @@ +// No camera module functions. diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 914e0b37d5..e1ffc79d08 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -11,6 +11,7 @@ MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 +CIRCUITPY_CAMERA = 1 CIRCUITPY_COUNTIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 From fbf4431aa0f40859d0686308bda226a4880449e8 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Wed, 2 Sep 2020 15:44:51 +0200 Subject: [PATCH 0854/1293] locale: make translate --- locale/circuitpython.pot | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 038cdacfc6..7bf2f851da 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -615,6 +615,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Could not initialize Camera" +msgstr "" + #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" msgstr "" @@ -672,6 +676,10 @@ msgstr "" msgid "Couldn't allocate input buffer" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Couldn't allocate picture buffer" +msgstr "" + #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate second buffer" @@ -998,6 +1006,10 @@ msgstr "" msgid "Invalid frequency supplied" msgstr "" +#: shared-bindings/camera/Camera.c +msgid "Invalid image size." +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -1499,6 +1511,10 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Size not supported" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" From 143a1ff94a5052465e3e65057b0ec4660120b2ed Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Fri, 11 Sep 2020 13:24:55 +0200 Subject: [PATCH 0855/1293] spresense: change the GC to do 32-byte blocks --- ports/cxd56/configs/circuitpython/defconfig | 1 - ports/cxd56/mpconfigport.h | 6 ++++-- ports/cxd56/spresense-exported-sdk | 2 +- ports/cxd56/supervisor/port.c | 12 ++++++++++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ports/cxd56/configs/circuitpython/defconfig b/ports/cxd56/configs/circuitpython/defconfig index 268f7a68e9..a97f821dfa 100644 --- a/ports/cxd56/configs/circuitpython/defconfig +++ b/ports/cxd56/configs/circuitpython/defconfig @@ -165,7 +165,6 @@ CONFIG_USBDEV=y CONFIG_USBDEV_DMA=y CONFIG_USBDEV_DUALSPEED=y CONFIG_USEC_PER_TICK=1000 -CONFIG_USERMAIN_STACKSIZE=1064960 CONFIG_USER_ENTRYPOINT="spresense_main" CONFIG_VIDEO_ISX012=y CONFIG_VIDEO_STREAM=y diff --git a/ports/cxd56/mpconfigport.h b/ports/cxd56/mpconfigport.h index df87946b95..27c82337bc 100644 --- a/ports/cxd56/mpconfigport.h +++ b/ports/cxd56/mpconfigport.h @@ -27,13 +27,15 @@ #ifndef __INCLUDED_MPCONFIGPORT_H #define __INCLUDED_MPCONFIGPORT_H -#define MICROPY_PY_SYS_PLATFORM "CXD56" +#define MICROPY_PY_SYS_PLATFORM "CXD56" // 64kiB stack -#define CIRCUITPY_DEFAULT_STACK_SIZE 0x10000 +#define CIRCUITPY_DEFAULT_STACK_SIZE (0x10000) #include "py/circuitpy_mpconfig.h" +#define MICROPY_BYTES_PER_GC_BLOCK (32) + #define MICROPY_PORT_ROOT_POINTERS \ CIRCUITPY_COMMON_ROOT_POINTERS \ diff --git a/ports/cxd56/spresense-exported-sdk b/ports/cxd56/spresense-exported-sdk index c991d439fa..752c4cd56d 160000 --- a/ports/cxd56/spresense-exported-sdk +++ b/ports/cxd56/spresense-exported-sdk @@ -1 +1 @@ -Subproject commit c991d439fac9c23cfcac0da16fe8055f818d40a4 +Subproject commit 752c4cd56dd0a270a559c28272ceb61ddcb7806c diff --git a/ports/cxd56/supervisor/port.c b/ports/cxd56/supervisor/port.c index 7038ca4782..6a32dc0f9e 100644 --- a/ports/cxd56/supervisor/port.c +++ b/ports/cxd56/supervisor/port.c @@ -46,12 +46,20 @@ #include "common-hal/pwmio/PWMOut.h" #include "common-hal/busio/UART.h" +#define HEAP_SIZE (1000 * 1024) + +uint32_t* heap; +uint32_t heap_size; + safe_mode_t port_init(void) { boardctl(BOARDIOC_INIT, 0); // Wait until RTC is available while (g_rtc_enabled == false); + heap = memalign(32, HEAP_SIZE); + heap_size = HEAP_SIZE / sizeof(uint32_t); + if (board_requests_safe_mode()) { return USER_SAFE_MODE; } @@ -100,11 +108,11 @@ uint32_t *port_stack_get_top(void) { } uint32_t *port_heap_get_bottom(void) { - return port_stack_get_limit(); + return heap; } uint32_t *port_heap_get_top(void) { - return port_stack_get_top(); + return heap + heap_size; } extern uint32_t _ebss; From c2fc592c2ca7ec42374a50f9e33ac551bf846596 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Fri, 11 Sep 2020 13:27:11 +0200 Subject: [PATCH 0856/1293] camera: Change API --- ports/cxd56/common-hal/camera/Camera.c | 144 +++++++--------- ports/cxd56/common-hal/camera/Camera.h | 9 +- ports/cxd56/common-hal/camera/ImageSize.c | 0 py/circuitpy_defns.mk | 2 +- shared-bindings/camera/Camera.c | 120 +++++++------ shared-bindings/camera/Camera.h | 14 +- shared-bindings/camera/ImageFormat.c | 93 ++++++++++ .../camera/{ImageSize.h => ImageFormat.h} | 36 ++-- shared-bindings/camera/ImageSize.c | 163 ------------------ shared-bindings/camera/__init__.c | 2 +- 10 files changed, 247 insertions(+), 336 deletions(-) delete mode 100644 ports/cxd56/common-hal/camera/ImageSize.c create mode 100644 shared-bindings/camera/ImageFormat.c rename shared-bindings/camera/{ImageSize.h => ImageFormat.h} (55%) delete mode 100644 shared-bindings/camera/ImageSize.c diff --git a/ports/cxd56/common-hal/camera/Camera.c b/ports/cxd56/common-hal/camera/Camera.c index 0c22525302..9376822c8a 100644 --- a/ports/cxd56/common-hal/camera/Camera.c +++ b/ports/cxd56/common-hal/camera/Camera.c @@ -35,9 +35,6 @@ #include "shared-bindings/camera/Camera.h" -#define JPG_COMPRESS_RATIO (9) -#define SPRESENSE_CAMIMAGE_MEM_ALIGN (32) - typedef struct { const char* devpath; int fd; @@ -45,39 +42,36 @@ typedef struct { STATIC camera_dev_t camera_dev = {"/dev/video", -1}; -static void camera_size_to_width_and_height(camera_imagesize_t size, uint16_t *width, uint16_t *height) { - switch (size) { - case IMAGESIZE_320x240: - *height = VIDEO_VSIZE_QVGA; - *width = VIDEO_HSIZE_QVGA; - break; - case IMAGESIZE_640x320: - *height = VIDEO_VSIZE_VGA; - *width = VIDEO_HSIZE_VGA; - break; - case IMAGESIZE_1280x720: - *height = VIDEO_VSIZE_HD; - *width = VIDEO_HSIZE_HD; - break; - case IMAGESIZE_1280x960: - *height = VIDEO_VSIZE_QUADVGA; - *width = VIDEO_HSIZE_QUADVGA; - break; - case IMAGESIZE_1920x1080: - *height = VIDEO_VSIZE_FULLHD; - *width = VIDEO_HSIZE_FULLHD; - break; - case IMAGESIZE_2048x1536: - *height = VIDEO_VSIZE_3M; - *width = VIDEO_HSIZE_3M; - break; - case IMAGESIZE_2560x1920: - *height = VIDEO_VSIZE_5M; - *width = VIDEO_HSIZE_5M; - break; - default: - mp_raise_ValueError(translate("Size not supported")); - break; +static bool camera_check_width_and_height(uint16_t width, uint16_t height) { + if ((width == VIDEO_HSIZE_QVGA && height == VIDEO_VSIZE_QVGA) || + (width == VIDEO_HSIZE_VGA && height == VIDEO_VSIZE_VGA) || + (width == VIDEO_HSIZE_HD && height == VIDEO_VSIZE_HD) || + (width == VIDEO_HSIZE_QUADVGA && height == VIDEO_VSIZE_QUADVGA) || + (width == VIDEO_HSIZE_FULLHD && height == VIDEO_VSIZE_FULLHD) || + (width == VIDEO_HSIZE_3M && height == VIDEO_VSIZE_3M) || + (width == VIDEO_HSIZE_5M && height == VIDEO_VSIZE_5M)) { + return true; + } else { + return false; + } +} + +static bool camera_check_buffer_length(uint16_t width, uint16_t height, camera_imageformat_t format, size_t length) { + if (format == IMAGEFORMAT_JPG) { + // In SPRESENSE SDK, JPEG compression quality=80 by default. + // In such setting, the maximum actual measured size of JPEG image + // is about width * height * 2 / 9. + return length >= (size_t)(width * height * 2 / 9) ? true : false; + } else { + return false; + } +} + +static bool camera_check_format(camera_imageformat_t format) { + if (format == IMAGEFORMAT_JPG) { + return true; + } else { + return false; } } @@ -118,7 +112,9 @@ static void camera_start_preview() { camera_start_streaming(V4L2_BUF_TYPE_VIDEO_CAPTURE); } -void common_hal_camera_construct(camera_obj_t *self, camera_imagesize_t size) { +extern uint32_t _ebss; +extern uint32_t _stext; +void common_hal_camera_construct(camera_obj_t *self, uint16_t width, uint16_t height) { if (camera_dev.fd < 0) { if (video_initialize(camera_dev.devpath) < 0) { mp_raise_ValueError(translate("Could not initialize Camera")); @@ -129,25 +125,13 @@ void common_hal_camera_construct(camera_obj_t *self, camera_imagesize_t size) { } } - uint16_t width, height; - - camera_size_to_width_and_height(size, &width, &height); - - self->size = size; - - // In SPRESENSE SDK, JPEG compression quality=80 by default. - // In such setting, the maximum actual measured size of JPEG image - // is about width * height * 2 / 9. - self->buffer_size = (size_t)(width * height * 2 / JPG_COMPRESS_RATIO);; - self->buffer = m_malloc(self->buffer_size, true); - if (self->buffer == NULL) { - mp_raise_msg(&mp_type_MemoryError, translate("Couldn't allocate picture buffer")); - } - self->picture_buffer = self->buffer; - while ((uint32_t)self->picture_buffer % SPRESENSE_CAMIMAGE_MEM_ALIGN != 0) { - self->picture_buffer++; + if (!camera_check_width_and_height(width, height)) { + mp_raise_ValueError(translate("Size not supported")); } + self->width = width; + self->height = height; + camera_start_preview(); camera_set_format(V4L2_BUF_TYPE_STILL_CAPTURE, V4L2_PIX_FMT_JPEG, width, height); @@ -164,8 +148,6 @@ void common_hal_camera_deinit(camera_obj_t *self) { video_uninitialize(); - m_free(self->buffer); - close(camera_dev.fd); camera_dev.fd = -1; } @@ -174,14 +156,26 @@ bool common_hal_camera_deinited(camera_obj_t *self) { return camera_dev.fd < 0; } -void common_hal_camera_take_picture(camera_obj_t *self) { +size_t common_hal_camera_take_picture(camera_obj_t *self, uint8_t *buffer, size_t len, camera_imageformat_t format) { + if (!camera_check_width_and_height(self->width, self->height)) { + mp_raise_ValueError(translate("Size not supported")); + } + if (!camera_check_buffer_length(self->width, self->height, format, len)) { + mp_raise_ValueError(translate("Buffer is too small")); + } + if (!camera_check_format(format)) { + mp_raise_ValueError(translate("Format not supported")); + } + + camera_set_format(V4L2_BUF_TYPE_STILL_CAPTURE, V4L2_PIX_FMT_JPEG, self->width, self->height); + v4l2_buffer_t buf; memset(&buf, 0, sizeof(v4l2_buffer_t)); buf.type = V4L2_BUF_TYPE_STILL_CAPTURE; buf.memory = V4L2_MEMORY_USERPTR; - buf.m.userptr = (unsigned long)self->picture_buffer; - buf.length = self->buffer_size - SPRESENSE_CAMIMAGE_MEM_ALIGN; + buf.m.userptr = (unsigned long)buffer; + buf.length = len; ioctl(camera_dev.fd, VIDIOC_QBUF, (unsigned long)&buf); ioctl(camera_dev.fd, VIDIOC_TAKEPICT_START, 0); @@ -190,35 +184,21 @@ void common_hal_camera_take_picture(camera_obj_t *self) { ioctl(camera_dev.fd, VIDIOC_TAKEPICT_STOP, false); - self->picture_size = (size_t)buf.bytesused; + return (size_t)buf.bytesused; } -uint8_t *common_hal_camera_get_picture_buffer(camera_obj_t *self) { - return self->picture_buffer; +uint16_t common_hal_camera_get_width(camera_obj_t *self) { + return self->width; } -size_t common_hal_camera_get_picture_size(camera_obj_t *self) { - return self->picture_size; +void common_hal_camera_set_width(camera_obj_t *self, uint16_t width) { + self->width = width; } -camera_imagesize_t common_hal_camera_get_size(camera_obj_t *self) { - return self->size; +uint16_t common_hal_camera_get_height(camera_obj_t *self) { + return self->height; } -void common_hal_camera_set_size(camera_obj_t *self, camera_imagesize_t size) { - uint16_t width, height; - - camera_size_to_width_and_height(size, &width, &height); - - self->buffer_size = (size_t)(width * height * 2 / JPG_COMPRESS_RATIO);; - self->buffer = m_realloc(self->buffer, self->buffer_size); - if (self->buffer == NULL) { - mp_raise_msg(&mp_type_MemoryError, translate("Couldn't allocate picture buffer")); - } - self->picture_buffer = self->buffer; - while ((uint32_t)self->picture_buffer % SPRESENSE_CAMIMAGE_MEM_ALIGN != 0) { - self->picture_buffer++; - } - - camera_set_format(V4L2_BUF_TYPE_STILL_CAPTURE, V4L2_PIX_FMT_JPEG, width, height); +void common_hal_camera_set_height(camera_obj_t *self, uint16_t height) { + self->height = height; } diff --git a/ports/cxd56/common-hal/camera/Camera.h b/ports/cxd56/common-hal/camera/Camera.h index 1eb63ace11..11fc102085 100644 --- a/ports/cxd56/common-hal/camera/Camera.h +++ b/ports/cxd56/common-hal/camera/Camera.h @@ -29,15 +29,10 @@ #include "py/obj.h" -#include "shared-bindings/camera/ImageSize.h" - typedef struct { mp_obj_base_t base; - uint8_t *buffer; - size_t buffer_size; - uint8_t *picture_buffer; - size_t picture_size; - camera_imagesize_t size; + uint16_t width; + uint16_t height; } camera_obj_t; #endif // MICROPY_INCLUDED_CXD56_COMMON_HAL_CAMERA_CAMERA_H diff --git a/ports/cxd56/common-hal/camera/ImageSize.c b/ports/cxd56/common-hal/camera/ImageSize.c deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index f72c821e53..6e98af8686 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -315,7 +315,6 @@ SRC_COMMON_HAL_ALL = \ busio/__init__.c \ camera/__init__.c \ camera/Camera.c \ - camera/ImageSize.c \ countio/Counter.c \ countio/__init__.c \ digitalio/DigitalInOut.c \ @@ -386,6 +385,7 @@ $(filter $(SRC_PATTERNS), \ _bleio/Attribute.c \ _bleio/ScanEntry.c \ _eve/__init__.c \ + camera/ImageFormat.c \ digitalio/Direction.c \ digitalio/DriveMode.c \ digitalio/Pull.c \ diff --git a/shared-bindings/camera/Camera.c b/shared-bindings/camera/Camera.c index 3855fed3c7..3b839d802f 100644 --- a/shared-bindings/camera/Camera.c +++ b/shared-bindings/camera/Camera.c @@ -48,37 +48,38 @@ //| vfs = storage.VfsFat(sd) //| storage.mount(vfs, '/sd') //| -//| cam = camera.Camera(camera.ImageSize.IMAGE_SIZE_1920x1080) +//| cam = camera.Camera(1920, 1080) //| +//| buffer = bytearray(512 * 1024) //| file = open("/sd/image.jpg","wb") -//| cam.take_picture() -//| file.write(cam.picture) +//| size = cam.take_picture() +//| file.write(buffer, size) //| file.close()""" //| -//| def __init__(self, ): +//| def __init__(self, width: int, height: int) -> None: //| """Initialize camera. //| -//| :param camera.ImageSize size: image size""" +//| :param int width: Width in pixels +//| :param int height: Height in pixels""" //| ... //| STATIC mp_obj_t camera_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { camera_obj_t *self = m_new_obj(camera_obj_t); self->base.type = &camera_type; - enum { ARG_size }; + enum { ARG_width, ARG_height }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_size, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_width, MP_ARG_REQUIRED | MP_ARG_INT }, + { MP_QSTR_height, MP_ARG_REQUIRED | MP_ARG_INT }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - camera_imagesize_t size = camera_imagesize_obj_to_type(args[ARG_size].u_obj); - - common_hal_camera_construct(self, size); + common_hal_camera_construct(self, args[ARG_width].u_int, args[ARG_height].u_int); return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self) -> None: //| """De-initialize camera.""" //| ... //| @@ -95,69 +96,84 @@ STATIC void check_for_deinit(camera_obj_t *self) { } } -//| def take_picture(self, ) -> Any: -//| """Take picture.""" +//| def take_picture(self, buf: WriteableBuffer, format: ImageFormat) -> int: +//| """Take picture and save to ``buf`` in the given ``format`` +//| +//| :return: the size of the picture taken +//| :rtype: int""" //| ... //| -STATIC mp_obj_t camera_obj_take_picture(mp_obj_t self_in) { +STATIC mp_obj_t camera_obj_take_picture(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_buffer, ARG_format }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_buffer, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_format, MP_ARG_REQUIRED | MP_ARG_OBJ }, + }; + camera_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + check_for_deinit(self); + 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); + + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(args[ARG_buffer].u_obj, &bufinfo, MP_BUFFER_WRITE); + + camera_imageformat_t format = camera_imageformat_obj_to_type(args[ARG_format].u_obj); + + return MP_OBJ_NEW_SMALL_INT(common_hal_camera_take_picture(self, (uint8_t *)bufinfo.buf, bufinfo.len, format)); +} +MP_DEFINE_CONST_FUN_OBJ_KW(camera_take_picture_obj, 3, camera_obj_take_picture); + +//| width: int +//| """Image width in pixels.""" +//| +STATIC mp_obj_t camera_obj_get_width(mp_obj_t self_in) { + camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_camera_get_width(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(camera_get_width_obj, camera_obj_get_width); + +STATIC mp_obj_t camera_obj_set_width(mp_obj_t self_in, mp_obj_t value) { camera_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); - common_hal_camera_take_picture(self); + common_hal_camera_set_width(self, mp_obj_get_int(value)); + return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_1(camera_take_picture_obj, camera_obj_take_picture); +MP_DEFINE_CONST_FUN_OBJ_2(camera_set_width_obj, camera_obj_set_width); -//| picture: Any = ... -//| """Image buffer.""" -//| -STATIC mp_obj_t camera_obj_get_picture(mp_obj_t self_in) { - camera_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - uint8_t *buffer = common_hal_camera_get_picture_buffer(self); - size_t size = common_hal_camera_get_picture_size(self); - - return mp_obj_new_bytearray_by_ref(size, buffer); -} -MP_DEFINE_CONST_FUN_OBJ_1(camera_get_picture_obj, camera_obj_get_picture); - -const mp_obj_property_t camera_picture_obj = { +const mp_obj_property_t camera_width_obj = { .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&camera_get_picture_obj, - (mp_obj_t)&mp_const_none_obj, + .proxy = {(mp_obj_t)&camera_get_width_obj, + (mp_obj_t)&camera_set_width_obj, (mp_obj_t)&mp_const_none_obj}, }; -//| size: Any = ... -//| """Image size.""" +//| height: int +//| """Image height in pixels.""" //| -STATIC mp_obj_t camera_obj_get_size(mp_obj_t self_in) { +STATIC mp_obj_t camera_obj_get_height(mp_obj_t self_in) { camera_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); - return camera_imagesize_type_to_obj(common_hal_camera_get_size(self)); + return MP_OBJ_NEW_SMALL_INT(common_hal_camera_get_height(self)); } -MP_DEFINE_CONST_FUN_OBJ_1(camera_get_size_obj, camera_obj_get_size); +MP_DEFINE_CONST_FUN_OBJ_1(camera_get_height_obj, camera_obj_get_height); -STATIC mp_obj_t camera_obj_set_size(mp_obj_t self_in, mp_obj_t value) { +STATIC mp_obj_t camera_obj_set_height(mp_obj_t self_in, mp_obj_t value) { camera_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); - camera_imagesize_t size = camera_imagesize_obj_to_type(value); - if (size == IMAGESIZE_NONE) { - mp_raise_ValueError(translate("Invalid image size.")); - } - - common_hal_camera_set_size(self, size); + common_hal_camera_set_height(self, mp_obj_get_int(value)); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_2(camera_set_size_obj, camera_obj_set_size); +MP_DEFINE_CONST_FUN_OBJ_2(camera_set_height_obj, camera_obj_set_height); -const mp_obj_property_t camera_size_obj = { +const mp_obj_property_t camera_height_obj = { .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&camera_get_size_obj, - (mp_obj_t)&camera_set_size_obj, + .proxy = {(mp_obj_t)&camera_get_height_obj, + (mp_obj_t)&camera_set_height_obj, (mp_obj_t)&mp_const_none_obj}, }; @@ -165,14 +181,14 @@ STATIC const mp_rom_map_elem_t camera_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&camera_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR_take_picture), MP_ROM_PTR(&camera_take_picture_obj) }, - { MP_ROM_QSTR(MP_QSTR_picture), MP_ROM_PTR(&camera_picture_obj) }, - { MP_ROM_QSTR(MP_QSTR_size), MP_ROM_PTR(&camera_size_obj) }, + { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&camera_width_obj) }, + { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&camera_height_obj) }, }; STATIC MP_DEFINE_CONST_DICT(camera_locals_dict, camera_locals_dict_table); const mp_obj_type_t camera_type = { { &mp_type_type }, - .name = MP_QSTR_GNSS, + .name = MP_QSTR_Camera, .make_new = camera_make_new, .locals_dict = (mp_obj_dict_t*)&camera_locals_dict, }; diff --git a/shared-bindings/camera/Camera.h b/shared-bindings/camera/Camera.h index e70d2493ec..7ef13cd07e 100644 --- a/shared-bindings/camera/Camera.h +++ b/shared-bindings/camera/Camera.h @@ -28,18 +28,18 @@ #define MICROPY_INCLUDED_SHARED_BINDINGS_CAMERA_CAMERA_H #include "common-hal/camera/Camera.h" -#include "shared-bindings/camera/ImageSize.h" +#include "shared-bindings/camera/ImageFormat.h" extern const mp_obj_type_t camera_type; -void common_hal_camera_construct(camera_obj_t *self, camera_imagesize_t size); +void common_hal_camera_construct(camera_obj_t *self, uint16_t width, uint16_t height); void common_hal_camera_deinit(camera_obj_t *self); bool common_hal_camera_deinited(camera_obj_t *self); -void common_hal_camera_take_picture(camera_obj_t *self); +size_t common_hal_camera_take_picture(camera_obj_t *self, uint8_t *buffer, size_t len, camera_imageformat_t format); -uint8_t* common_hal_camera_get_picture_buffer(camera_obj_t *self); -size_t common_hal_camera_get_picture_size(camera_obj_t *self); -camera_imagesize_t common_hal_camera_get_size(camera_obj_t *self); -void common_hal_camera_set_size(camera_obj_t *self, camera_imagesize_t size); +uint16_t common_hal_camera_get_width(camera_obj_t *self); +void common_hal_camera_set_width(camera_obj_t *self, uint16_t width); +uint16_t common_hal_camera_get_height(camera_obj_t *self); +void common_hal_camera_set_height(camera_obj_t *self, uint16_t height); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_CAMERA_CAMERA_H diff --git a/shared-bindings/camera/ImageFormat.c b/shared-bindings/camera/ImageFormat.c new file mode 100644 index 0000000000..d4bdddc562 --- /dev/null +++ b/shared-bindings/camera/ImageFormat.c @@ -0,0 +1,93 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 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 "shared-bindings/camera/ImageFormat.h" + +//| class ImageFormat: +//| """Image format""" +//| +//| def __init__(self) -> None: +//| """Enum-like class to define the image format.""" +//| +//| JPG: ImageFormat +//| """JPG format.""" +//| +//| RGB565: ImageFormat +//| """RGB565 format.""" +//| +const mp_obj_type_t camera_imageformat_type; + +const camera_imageformat_obj_t camera_imageformat_jpg_obj = { + { &camera_imageformat_type }, +}; + +const camera_imageformat_obj_t camera_imageformat_rgb565_obj = { + { &camera_imageformat_type }, +}; + +camera_imageformat_t camera_imageformat_obj_to_type(mp_obj_t obj) { + if (obj == MP_ROM_PTR(&camera_imageformat_jpg_obj)) { + return IMAGEFORMAT_JPG; + } else if (obj == MP_ROM_PTR(&camera_imageformat_rgb565_obj)) { + return IMAGEFORMAT_RGB565; + } + return IMAGEFORMAT_NONE; +} + +mp_obj_t camera_imageformat_type_to_obj(camera_imageformat_t format) { + switch (format) { + case IMAGEFORMAT_JPG: + return (mp_obj_t)MP_ROM_PTR(&camera_imageformat_jpg_obj); + case IMAGEFORMAT_RGB565: + return (mp_obj_t)MP_ROM_PTR(&camera_imageformat_rgb565_obj); + case IMAGEFORMAT_NONE: + default: + return (mp_obj_t)MP_ROM_PTR(&mp_const_none_obj); + } +} + +STATIC const mp_rom_map_elem_t camera_imageformat_locals_dict_table[] = { + {MP_ROM_QSTR(MP_QSTR_JPG), MP_ROM_PTR(&camera_imageformat_jpg_obj)}, + {MP_ROM_QSTR(MP_QSTR_RGB565), MP_ROM_PTR(&camera_imageformat_rgb565_obj)}, +}; +STATIC MP_DEFINE_CONST_DICT(camera_imageformat_locals_dict, camera_imageformat_locals_dict_table); + +STATIC void camera_imageformat_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { + qstr format = MP_QSTR_None; + if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&camera_imageformat_jpg_obj)) { + format = MP_QSTR_JPG; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&camera_imageformat_rgb565_obj)) { + format = MP_QSTR_RGB565; + } + mp_printf(print, "%q.%q.%q", MP_QSTR_camera, MP_QSTR_ImageSize, format); +} + +const mp_obj_type_t camera_imageformat_type = { + { &mp_type_type }, + .name = MP_QSTR_ImageFormat, + .print = camera_imageformat_print, + .locals_dict = (mp_obj_t)&camera_imageformat_locals_dict, +}; diff --git a/shared-bindings/camera/ImageSize.h b/shared-bindings/camera/ImageFormat.h similarity index 55% rename from shared-bindings/camera/ImageSize.h rename to shared-bindings/camera/ImageFormat.h index 3fe624e066..8abc88438d 100644 --- a/shared-bindings/camera/ImageSize.h +++ b/shared-bindings/camera/ImageFormat.h @@ -24,36 +24,26 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_CAMERA_IMAGESIZE_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_CAMERA_IMAGESIZE_H +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_CAMERA_IMAGEFORMAT_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_CAMERA_IMAGEFORMAT_H #include "py/obj.h" typedef enum { - IMAGESIZE_NONE, - IMAGESIZE_320x240, - IMAGESIZE_640x320, - IMAGESIZE_1280x720, - IMAGESIZE_1280x960, - IMAGESIZE_1920x1080, - IMAGESIZE_2048x1536, - IMAGESIZE_2560x1920, -} camera_imagesize_t; + IMAGEFORMAT_NONE, + IMAGEFORMAT_JPG, + IMAGEFORMAT_RGB565, +} camera_imageformat_t; -const mp_obj_type_t camera_imagesize_type; +const mp_obj_type_t camera_imageformat_type; -camera_imagesize_t camera_imagesize_obj_to_type(mp_obj_t obj); -mp_obj_t camera_imagesize_type_to_obj(camera_imagesize_t mode); +camera_imageformat_t camera_imageformat_obj_to_type(mp_obj_t obj); +mp_obj_t camera_imageformat_type_to_obj(camera_imageformat_t mode); typedef struct { mp_obj_base_t base; -} camera_imagesize_obj_t; -extern const camera_imagesize_obj_t camera_imagesize_320x240_obj; -extern const camera_imagesize_obj_t camera_imagesize_640x320_obj; -extern const camera_imagesize_obj_t camera_imagesize_1280x720_obj; -extern const camera_imagesize_obj_t camera_imagesize_1280x960_obj; -extern const camera_imagesize_obj_t camera_imagesize_1920x1080_obj; -extern const camera_imagesize_obj_t camera_imagesize_2048x1536_obj; -extern const camera_imagesize_obj_t camera_imagesize_2560x1920_obj; +} camera_imageformat_obj_t; +extern const camera_imageformat_obj_t camera_imageformat_jpg_obj; +extern const camera_imageformat_obj_t camera_imageformat_rgb565_obj; -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_CAMERA_IMAGESIZE_H +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_CAMERA_IMAGEFORMAT_H diff --git a/shared-bindings/camera/ImageSize.c b/shared-bindings/camera/ImageSize.c deleted file mode 100644 index bfa01814d9..0000000000 --- a/shared-bindings/camera/ImageSize.c +++ /dev/null @@ -1,163 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright 2020 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 "shared-bindings/camera/ImageSize.h" - -//| class ImageSize: -//| """Image size""" -//| -//| def __init__(self) -> None: -//| """Enum-like class to define the image size.""" -//| -//| IMAGE_SIZE_320x240: ImageSize -//| """Image size 320x240.""" -//| -//| IMAGE_SIZE_640x480: ImageSize -//| """Image size 640x480.""" -//| -//| IMAGE_SIZE_1280x720: ImageSize -//| """Image size 1280x720.""" -//| -//| IMAGE_SIZE_1280x960: ImageSize -//| """Image size 1280x960.""" -//| -//| IMAGE_SIZE_1920x1080: ImageSize -//| """Image size 1920x1080.""" -//| -//| IMAGE_SIZE_2048x1536: ImageSize -//| """Image size 2048x1536.""" -//| -//| IMAGE_SIZE_2560x1920: ImageSize -//| """Image size 2560x1920.""" -//| -const mp_obj_type_t camera_imagesize_type; - -const camera_imagesize_obj_t camera_imagesize_320x240_obj = { - { &camera_imagesize_type }, -}; - -const camera_imagesize_obj_t camera_imagesize_640x320_obj = { - { &camera_imagesize_type }, -}; - -const camera_imagesize_obj_t camera_imagesize_1280x720_obj = { - { &camera_imagesize_type }, -}; - -const camera_imagesize_obj_t camera_imagesize_1280x960_obj = { - { &camera_imagesize_type }, -}; - -const camera_imagesize_obj_t camera_imagesize_1920x1080_obj = { - { &camera_imagesize_type }, -}; - -const camera_imagesize_obj_t camera_imagesize_2048x1536_obj = { - { &camera_imagesize_type }, -}; - -const camera_imagesize_obj_t camera_imagesize_2560x1920_obj = { - { &camera_imagesize_type }, -}; - -camera_imagesize_t camera_imagesize_obj_to_type(mp_obj_t obj) { - if (obj == MP_ROM_PTR(&camera_imagesize_320x240_obj)) { - return IMAGESIZE_320x240; - } else if (obj == MP_ROM_PTR(&camera_imagesize_640x320_obj)) { - return IMAGESIZE_640x320; - } else if (obj == MP_ROM_PTR(&camera_imagesize_1280x720_obj)) { - return IMAGESIZE_1280x720; - } else if (obj == MP_ROM_PTR(&camera_imagesize_1280x960_obj)) { - return IMAGESIZE_1280x960; - } else if (obj == MP_ROM_PTR(&camera_imagesize_1920x1080_obj)) { - return IMAGESIZE_1920x1080; - } else if (obj == MP_ROM_PTR(&camera_imagesize_2048x1536_obj)) { - return IMAGESIZE_2048x1536; - } else if (obj == MP_ROM_PTR(&camera_imagesize_2560x1920_obj)) { - return IMAGESIZE_2560x1920; - } - return IMAGESIZE_NONE; -} - -mp_obj_t camera_imagesize_type_to_obj(camera_imagesize_t size) { - switch (size) { - case IMAGESIZE_320x240: - return (mp_obj_t)MP_ROM_PTR(&camera_imagesize_320x240_obj); - case IMAGESIZE_640x320: - return (mp_obj_t)MP_ROM_PTR(&camera_imagesize_640x320_obj); - case IMAGESIZE_1280x720: - return (mp_obj_t)MP_ROM_PTR(&camera_imagesize_1280x720_obj); - case IMAGESIZE_1280x960: - return (mp_obj_t)MP_ROM_PTR(&camera_imagesize_1280x960_obj); - case IMAGESIZE_1920x1080: - return (mp_obj_t)MP_ROM_PTR(&camera_imagesize_1920x1080_obj); - case IMAGESIZE_2048x1536: - return (mp_obj_t)MP_ROM_PTR(&camera_imagesize_2048x1536_obj); - case IMAGESIZE_2560x1920: - return (mp_obj_t)MP_ROM_PTR(&camera_imagesize_2560x1920_obj); - case IMAGESIZE_NONE: - default: - return (mp_obj_t)MP_ROM_PTR(&mp_const_none_obj); - } -} - -STATIC const mp_rom_map_elem_t camera_imagesize_locals_dict_table[] = { - {MP_ROM_QSTR(MP_QSTR_IMAGE_SIZE_320x240), MP_ROM_PTR(&camera_imagesize_320x240_obj)}, - {MP_ROM_QSTR(MP_QSTR_IMAGE_SIZE_640x320), MP_ROM_PTR(&camera_imagesize_640x320_obj)}, - {MP_ROM_QSTR(MP_QSTR_IMAGE_SIZE_1280x720), MP_ROM_PTR(&camera_imagesize_1280x720_obj)}, - {MP_ROM_QSTR(MP_QSTR_IMAGE_SIZE_1280x960), MP_ROM_PTR(&camera_imagesize_1280x960_obj)}, - {MP_ROM_QSTR(MP_QSTR_IMAGE_SIZE_1920x1080), MP_ROM_PTR(&camera_imagesize_1920x1080_obj)}, - {MP_ROM_QSTR(MP_QSTR_IMAGE_SIZE_2048x1536), MP_ROM_PTR(&camera_imagesize_2048x1536_obj)}, - {MP_ROM_QSTR(MP_QSTR_IMAGE_SIZE_2560x1920), MP_ROM_PTR(&camera_imagesize_2560x1920_obj)}, -}; -STATIC MP_DEFINE_CONST_DICT(camera_imagesize_locals_dict, camera_imagesize_locals_dict_table); - -STATIC void camera_imagesize_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { - qstr size = MP_QSTR_None; - if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&camera_imagesize_320x240_obj)) { - size = MP_QSTR_IMAGE_SIZE_320x240; - } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&camera_imagesize_640x320_obj)) { - size = MP_QSTR_IMAGE_SIZE_640x320; - } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&camera_imagesize_1280x720_obj)) { - size = MP_QSTR_IMAGE_SIZE_1280x720; - } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&camera_imagesize_1280x960_obj)) { - size = MP_QSTR_IMAGE_SIZE_1280x960; - } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&camera_imagesize_1920x1080_obj)) { - size = MP_QSTR_IMAGE_SIZE_1920x1080; - } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&camera_imagesize_2048x1536_obj)) { - size = MP_QSTR_IMAGE_SIZE_2048x1536; - } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&camera_imagesize_2560x1920_obj)) { - size = MP_QSTR_IMAGE_SIZE_2560x1920; - } - mp_printf(print, "%q.%q.%q", MP_QSTR_camera, MP_QSTR_ImageSize, size); -} - -const mp_obj_type_t camera_imagesize_type = { - { &mp_type_type }, - .name = MP_QSTR_ImageSize, - .print = camera_imagesize_print, - .locals_dict = (mp_obj_t)&camera_imagesize_locals_dict, -}; diff --git a/shared-bindings/camera/__init__.c b/shared-bindings/camera/__init__.c index 3398d1ade6..28cf7df575 100644 --- a/shared-bindings/camera/__init__.c +++ b/shared-bindings/camera/__init__.c @@ -39,7 +39,7 @@ STATIC const mp_rom_map_elem_t camera_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_Camera), MP_ROM_PTR(&camera_type) }, // Enum-like Classes. - { MP_ROM_QSTR(MP_QSTR_ImageSize), MP_ROM_PTR(&camera_imagesize_type) }, + { MP_ROM_QSTR(MP_QSTR_ImageSize), MP_ROM_PTR(&camera_imageformat_type) }, }; STATIC MP_DEFINE_CONST_DICT(camera_module_globals, camera_module_globals_table); From a25e3c2858e565e465849669c96da560b4af228f Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Fri, 11 Sep 2020 13:31:34 +0200 Subject: [PATCH 0857/1293] locale: make translate --- locale/circuitpython.pot | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 7bf2f851da..20cf75264a 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"POT-Creation-Date: 2020-09-11 13:30+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -430,7 +430,7 @@ msgstr "" msgid "Buffer is not a bytearray." msgstr "" -#: shared-bindings/displayio/Display.c +#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "" @@ -676,10 +676,6 @@ msgstr "" msgid "Couldn't allocate input buffer" msgstr "" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Couldn't allocate picture buffer" -msgstr "" - #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate second buffer" @@ -849,6 +845,10 @@ msgstr "" msgid "File exists" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Format not supported" +msgstr "" + #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" @@ -1006,10 +1006,6 @@ msgstr "" msgid "Invalid frequency supplied" msgstr "" -#: shared-bindings/camera/Camera.c -msgid "Invalid image size." -msgstr "" - #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" From ce7ee58e92eca840f75c2fcf885fe862f1ebec13 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Mon, 14 Sep 2020 12:55:53 +0200 Subject: [PATCH 0858/1293] camera: Update camera module --- ports/cxd56/common-hal/camera/Camera.c | 38 +++++++++++++++----------- ports/cxd56/supervisor/port.c | 8 ++++-- shared-bindings/camera/Camera.c | 4 +-- shared-bindings/camera/__init__.c | 2 +- 4 files changed, 30 insertions(+), 22 deletions(-) diff --git a/ports/cxd56/common-hal/camera/Camera.c b/ports/cxd56/common-hal/camera/Camera.c index 9376822c8a..a4e197bf33 100644 --- a/ports/cxd56/common-hal/camera/Camera.c +++ b/ports/cxd56/common-hal/camera/Camera.c @@ -42,18 +42,28 @@ typedef struct { STATIC camera_dev_t camera_dev = {"/dev/video", -1}; +typedef struct { + uint16_t width; + uint16_t height; +} image_size_t; + +STATIC const image_size_t image_size_table[] = { + { VIDEO_HSIZE_QVGA, VIDEO_VSIZE_QVGA }, + { VIDEO_HSIZE_VGA, VIDEO_VSIZE_VGA }, + { VIDEO_HSIZE_HD, VIDEO_VSIZE_HD }, + { VIDEO_HSIZE_QUADVGA, VIDEO_VSIZE_QUADVGA }, + { VIDEO_HSIZE_FULLHD, VIDEO_VSIZE_FULLHD }, + { VIDEO_HSIZE_3M, VIDEO_VSIZE_3M }, + { VIDEO_HSIZE_5M, VIDEO_VSIZE_5M }, +}; + static bool camera_check_width_and_height(uint16_t width, uint16_t height) { - if ((width == VIDEO_HSIZE_QVGA && height == VIDEO_VSIZE_QVGA) || - (width == VIDEO_HSIZE_VGA && height == VIDEO_VSIZE_VGA) || - (width == VIDEO_HSIZE_HD && height == VIDEO_VSIZE_HD) || - (width == VIDEO_HSIZE_QUADVGA && height == VIDEO_VSIZE_QUADVGA) || - (width == VIDEO_HSIZE_FULLHD && height == VIDEO_VSIZE_FULLHD) || - (width == VIDEO_HSIZE_3M && height == VIDEO_VSIZE_3M) || - (width == VIDEO_HSIZE_5M && height == VIDEO_VSIZE_5M)) { - return true; - } else { - return false; + for (int i = 0; i < MP_ARRAY_SIZE(image_size_table); i++) { + if (image_size_table[i].width == width && image_size_table[i].height == height) { + return true; + } } + return false; } static bool camera_check_buffer_length(uint16_t width, uint16_t height, camera_imageformat_t format, size_t length) { @@ -61,18 +71,14 @@ static bool camera_check_buffer_length(uint16_t width, uint16_t height, camera_i // In SPRESENSE SDK, JPEG compression quality=80 by default. // In such setting, the maximum actual measured size of JPEG image // is about width * height * 2 / 9. - return length >= (size_t)(width * height * 2 / 9) ? true : false; + return length >= (size_t)(width * height * 2 / 9); } else { return false; } } static bool camera_check_format(camera_imageformat_t format) { - if (format == IMAGEFORMAT_JPG) { - return true; - } else { - return false; - } + return format == IMAGEFORMAT_JPG; } static void camera_set_format(enum v4l2_buf_type type, uint32_t pixformat, uint16_t width, uint16_t height) { diff --git a/ports/cxd56/supervisor/port.c b/ports/cxd56/supervisor/port.c index 6a32dc0f9e..6164f74113 100644 --- a/ports/cxd56/supervisor/port.c +++ b/ports/cxd56/supervisor/port.c @@ -46,7 +46,7 @@ #include "common-hal/pwmio/PWMOut.h" #include "common-hal/busio/UART.h" -#define HEAP_SIZE (1000 * 1024) +#define SPRESENSE_MEM_ALIGN (32) uint32_t* heap; uint32_t heap_size; @@ -57,8 +57,10 @@ safe_mode_t port_init(void) { // Wait until RTC is available while (g_rtc_enabled == false); - heap = memalign(32, HEAP_SIZE); - heap_size = HEAP_SIZE / sizeof(uint32_t); + heap = memalign(SPRESENSE_MEM_ALIGN, 128 * 1024); + uint32_t size = CONFIG_RAM_START + CONFIG_RAM_SIZE - (uint32_t)heap - 2 * SPRESENSE_MEM_ALIGN; + heap = realloc(heap, size); + heap_size = size / sizeof(uint32_t); if (board_requests_safe_mode()) { return USER_SAFE_MODE; diff --git a/shared-bindings/camera/Camera.c b/shared-bindings/camera/Camera.c index 3b839d802f..5fe54e429d 100644 --- a/shared-bindings/camera/Camera.c +++ b/shared-bindings/camera/Camera.c @@ -52,7 +52,7 @@ //| //| buffer = bytearray(512 * 1024) //| file = open("/sd/image.jpg","wb") -//| size = cam.take_picture() +//| size = cam.take_picture(buffer, camera.ImageFormat.JPG) //| file.write(buffer, size) //| file.close()""" //| @@ -99,7 +99,7 @@ STATIC void check_for_deinit(camera_obj_t *self) { //| def take_picture(self, buf: WriteableBuffer, format: ImageFormat) -> int: //| """Take picture and save to ``buf`` in the given ``format`` //| -//| :return: the size of the picture taken +//| :return: the number of bytes written into buf //| :rtype: int""" //| ... //| diff --git a/shared-bindings/camera/__init__.c b/shared-bindings/camera/__init__.c index 28cf7df575..080516d51c 100644 --- a/shared-bindings/camera/__init__.c +++ b/shared-bindings/camera/__init__.c @@ -39,7 +39,7 @@ STATIC const mp_rom_map_elem_t camera_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_Camera), MP_ROM_PTR(&camera_type) }, // Enum-like Classes. - { MP_ROM_QSTR(MP_QSTR_ImageSize), MP_ROM_PTR(&camera_imageformat_type) }, + { MP_ROM_QSTR(MP_QSTR_ImageFormat), MP_ROM_PTR(&camera_imageformat_type) }, }; STATIC MP_DEFINE_CONST_DICT(camera_module_globals, camera_module_globals_table); From 6bf699502206794176e19edfa85641cff92cc718 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Mon, 14 Sep 2020 04:49:18 +0000 Subject: [PATCH 0859/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (795 of 795 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 92e41e1fc1..70cecc395c 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: 2020-09-13 14:21-0500\n" -"PO-Revision-Date: 2020-09-12 17:32+0000\n" +"PO-Revision-Date: 2020-09-14 13:47+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -2046,7 +2046,7 @@ msgstr "bytes > 8 bits não suportado" #: py/objarray.c msgid "bytes length not a multiple of item size" -msgstr "" +msgstr "o comprimento dos bytes não é um múltiplo do tamanho do item" #: py/objstr.c msgid "bytes value out of range" @@ -3036,7 +3036,7 @@ msgstr "" #: py/modstruct.c #, c-format msgid "pack expected %d items for packing (got %d)" -msgstr "" +msgstr "o pacote previa %d itens para a empacotamento (obteve %d)" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" From c68098777daab6454be82b9f9bd875473c31b566 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 14 Sep 2020 10:50:57 -0500 Subject: [PATCH 0860/1293] Fixing up locale/circuitpython.pot date --- locale/circuitpython.pot | 147 +++++++++++++++++++++++++++++---------- 1 file changed, 109 insertions(+), 38 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 0bf0cff1cf..351d30e651 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-18 11:19-0400\n" +"POT-Creation-Date: 2020-09-13 14:21-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -30,12 +30,6 @@ msgid "" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"To exit, please reset the board without " -msgstr "" - #: py/obj.c msgid " File \"%q\"" msgstr "" @@ -273,7 +267,7 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" -#: shared-bindings/_bleio/Address.c +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" msgstr "" @@ -302,7 +296,7 @@ msgstr "" msgid "All sync event channels in use" msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" msgstr "" @@ -314,7 +308,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" msgstr "" @@ -371,6 +365,10 @@ msgstr "" msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + #: main.c msgid "Auto-reload is off.\n" msgstr "" @@ -490,6 +488,10 @@ msgstr "" msgid "Can't set CCCD on local Characteristic" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c @@ -552,7 +554,7 @@ msgstr "" msgid "Cannot unambiguously get sizeof scalar" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" @@ -574,6 +576,10 @@ msgid "" "boot. Press again to exit safe mode.\n" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "" @@ -621,23 +627,23 @@ msgstr "" msgid "Could not initialize UART" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" msgstr "" @@ -645,7 +651,7 @@ msgstr "" msgid "Could not set address" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" msgstr "" @@ -742,8 +748,8 @@ msgstr "" msgid "Error in regex" msgstr "" -#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -754,10 +760,18 @@ msgstr "" msgid "Expected a Characteristic" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" @@ -836,7 +850,7 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" @@ -942,9 +956,9 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PWMOut.c -#: ports/cxd56/common-hal/pulseio/PWMOut.c -#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "Invalid PWM frequency" msgstr "" @@ -984,7 +998,7 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "" @@ -1002,8 +1016,8 @@ msgid "Invalid phase" msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "" @@ -1027,7 +1041,7 @@ msgstr "" msgid "Invalid pins" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" msgstr "" @@ -1209,10 +1223,14 @@ msgstr "" msgid "No long integer support" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1233,6 +1251,10 @@ msgstr "" msgid "Nordic Soft Device failure assertion." msgstr "" +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1247,6 +1269,10 @@ msgstr "" msgid "Not running saved code.\n" msgstr "" +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." @@ -1273,16 +1299,20 @@ msgid "" "%d bpp given" msgstr "" +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "" -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" @@ -1337,8 +1367,8 @@ msgstr "" #: ports/nrf/common-hal/pulseio/PulseOut.c #: ports/stm/common-hal/pulseio/PulseOut.c msgid "" -"Port does not accept pins or frequency. " -"Construct and pass a PWMOut Carrier instead" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" msgstr "" #: shared-bindings/_bleio/Adapter.c @@ -1353,10 +1383,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -1473,6 +1499,10 @@ msgstr "" msgid "Serializer in use" msgstr "" +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" @@ -1568,11 +1598,15 @@ msgstr "" msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" -#: ports/stm/common-hal/pulseio/PWMOut.c +#: ports/stm/common-hal/pwmio/PWMOut.c msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -1668,6 +1702,10 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Unknown failure" +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" @@ -1771,6 +1809,10 @@ msgid "" "To list built-in modules please do `help(\"modules\")`.\n" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters" +msgstr "" + #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" msgstr "" @@ -1885,7 +1927,7 @@ msgstr "" msgid "bad format string" msgstr "" -#: py/binary.c +#: py/binary.c py/objarray.c msgid "bad typecode" msgstr "" @@ -1938,6 +1980,10 @@ msgstr "" msgid "bytes > 8 bits not supported" msgstr "" +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + #: py/objstr.c msgid "bytes value out of range" msgstr "" @@ -2457,6 +2503,10 @@ msgstr "" msgid "initial values must be iterable" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" @@ -2649,6 +2699,10 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be > 0" +msgstr "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "" @@ -2883,10 +2937,23 @@ msgstr "" msgid "ord() expected a character, but string of length %d found" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "" +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" msgstr "" @@ -3060,6 +3127,10 @@ msgstr "" msgid "sosfilt requires iterable arguments" msgstr "" +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" From 127346f7aeaddd724449c1c5beb71d5ad0c169a5 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 14 Sep 2020 10:52:46 -0500 Subject: [PATCH 0861/1293] Removing some prior changes --- supervisor/background_callback.h | 4 ---- supervisor/port.h | 5 ++--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/supervisor/background_callback.h b/supervisor/background_callback.h index e943830fd0..535dd656be 100644 --- a/supervisor/background_callback.h +++ b/supervisor/background_callback.h @@ -27,8 +27,6 @@ #ifndef CIRCUITPY_INCLUDED_SUPERVISOR_BACKGROUND_CALLBACK_H #define CIRCUITPY_INCLUDED_SUPERVISOR_BACKGROUND_CALLBACK_H -#include "supervisor/port.h" - /** Background callbacks are a linked list of tasks to call in the background. * * Include a member of type `background_callback_t` inside an object @@ -86,6 +84,4 @@ void background_callback_end_critical_section(void); */ void background_callback_gc_collect(void); -uint64_t background_get_ticks(void); - #endif diff --git a/supervisor/port.h b/supervisor/port.h index c95e43fd2e..ddb96bd524 100644 --- a/supervisor/port.h +++ b/supervisor/port.h @@ -69,13 +69,12 @@ uint32_t *port_heap_get_bottom(void); // Get heap top address uint32_t *port_heap_get_top(void); +supervisor_allocation* port_fixed_heap(void); + // Save and retrieve a word from memory that is preserved over reset. Used for safe mode. void port_set_saved_word(uint32_t); uint32_t port_get_saved_word(void); -// Used to keep track of last time background was run -uint64_t get_background_ticks(void); - // Get the raw tick count since start up. A tick is 1/1024 of a second, a common low frequency // clock rate. If subticks is not NULL then the port will fill in the number of subticks where each // tick is 32 subticks (for a resolution of 1/32768 or 30.5ish microseconds.) From 6b93f97de1e535b9b921b68c85360bfee5cc38c1 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 14 Sep 2020 10:53:30 -0500 Subject: [PATCH 0862/1293] Removing some prior changes --- supervisor/shared/background_callback.c | 7 ------- supervisor/shared/tick.c | 21 +++++++-------------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c index 154618297e..8e12dd3625 100644 --- a/supervisor/shared/background_callback.c +++ b/supervisor/shared/background_callback.c @@ -37,14 +37,7 @@ STATIC volatile background_callback_t *callback_head, *callback_tail; #define CALLBACK_CRITICAL_BEGIN (common_hal_mcu_disable_interrupts()) #define CALLBACK_CRITICAL_END (common_hal_mcu_enable_interrupts()) -uint64_t last_background_tick = 0; - -uint64_t get_background_ticks(void) { - return last_background_tick; -} - void background_callback_add_core(background_callback_t *cb) { - last_background_tick = port_get_raw_ticks(NULL); CALLBACK_CRITICAL_BEGIN; if (cb->prev || callback_head == cb) { CALLBACK_CRITICAL_END; diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index eac5104a5c..012f2c80e8 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -27,6 +27,7 @@ #include "supervisor/shared/tick.h" #include "py/mpstate.h" +#include "py/runtime.h" #include "supervisor/linker.h" #include "supervisor/filesystem.h" #include "supervisor/background_callback.h" @@ -36,7 +37,7 @@ #if CIRCUITPY_BLEIO #include "supervisor/shared/bluetooth.h" -#include "common-hal/_bleio/bonding.h" +#include "common-hal/_bleio/__init__.h" #endif #if CIRCUITPY_DISPLAYIO @@ -68,6 +69,8 @@ static volatile uint64_t PLACE_IN_DTCM_BSS(background_ticks); static background_callback_t tick_callback; +volatile uint64_t last_finished_tick = 0; + void supervisor_background_tasks(void *unused) { port_start_background_task(); @@ -84,7 +87,7 @@ void supervisor_background_tasks(void *unused) { #if CIRCUITPY_BLEIO supervisor_bluetooth_background(); - bonding_background(); + bleio_background(); #endif port_background_task(); @@ -95,7 +98,7 @@ void supervisor_background_tasks(void *unused) { } bool supervisor_background_tasks_ok(void) { - return port_get_raw_ticks(NULL) - get_background_ticks() < 1024; + return port_get_raw_ticks(NULL) - last_finished_tick < 1024; } void supervisor_tick(void) { @@ -145,17 +148,7 @@ void mp_hal_delay_ms(mp_uint_t delay) { while (remaining > 0) { RUN_BACKGROUND_TASKS; // Check to see if we've been CTRL-Ced by autoreload or the user. - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) - { - // clear exception and generate stacktrace - MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; - nlr_raise(&MP_STATE_VM(mp_kbd_exception)); - } - if( MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || - WATCHDOG_EXCEPTION_CHECK()) { - // stop sleeping immediately - break; - } + mp_handle_pending(); remaining = end_tick - port_get_raw_ticks(NULL); // We break a bit early so we don't risk setting the alarm before the time when we call // sleep. From c014ac308903f6f0224c667624609f02a624bac0 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 14 Sep 2020 10:54:57 -0500 Subject: [PATCH 0863/1293] Reworked check for input taking too long --- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index 27bf842d56..9a9bf57a0d 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -51,6 +51,7 @@ static uint8_t refcount = 0; static uint8_t pulsein_tc_index = 0xff; volatile static uint32_t overflow_count = 0; +volatile static uint32_t start_overflow = 0; void pulsein_timer_interrupt_handler(uint8_t index) { if (index != pulsein_tc_index) return; @@ -91,6 +92,9 @@ void pulsein_interrupt_handler(uint8_t channel) { uint32_t current_count = tc->COUNT16.COUNT.reg; pulseio_pulsein_obj_t* self = get_eic_channel_data(channel); + if (self->len == 0 ) { + start_overflow = overflow_count; + } if (self->first_edge) { self->first_edge = false; pulsein_set_config(self, false); @@ -110,16 +114,21 @@ void pulsein_interrupt_handler(uint8_t channel) { if (total_diff < duration) { duration = total_diff; } + //check if the input is taking too long, 15 timer overflows is approx 1 second + if (current_overflow - start_overflow > 15) { + self->errored_too_fast = true; + common_hal_pulseio_pulsein_pause(self); + common_hal_mcu_enable_interrupts(); + return; + } uint16_t i = (self->start + self->len) % self->maxlen; + self->buffer[i] = duration; if (self->len < self->maxlen) { self->len++; } else { - self->errored_too_fast = true; - common_hal_mcu_enable_interrupts(); - return; + self->start++; } - self->buffer[i] = duration; } self->last_overflow = current_overflow; self->last_count = current_count; @@ -300,6 +309,7 @@ uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { mp_raise_IndexError(translate("pop from an empty PulseIn")); } if (self->errored_too_fast) { + self->errored_too_fast = 0; mp_raise_RuntimeError(translate("Input taking too long")); } common_hal_mcu_disable_interrupts(); From e504438fd223c9bb0b9d6950a699f1283ece137c Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 14 Sep 2020 11:58:13 -0400 Subject: [PATCH 0864/1293] Remove unlicensed file, fix reset pin type check --- ports/esp32s2/boards/esp32s2-saola-1.cfg | 41 ------------------------ shared-module/displayio/I2CDisplay.c | 4 +-- 2 files changed, 2 insertions(+), 43 deletions(-) delete mode 100644 ports/esp32s2/boards/esp32s2-saola-1.cfg diff --git a/ports/esp32s2/boards/esp32s2-saola-1.cfg b/ports/esp32s2/boards/esp32s2-saola-1.cfg deleted file mode 100644 index 6772907570..0000000000 --- a/ports/esp32s2/boards/esp32s2-saola-1.cfg +++ /dev/null @@ -1,41 +0,0 @@ -# The ESP32-S2 only supports JTAG. -transport select jtag -adapter_khz 1000 - -# Source the ESP common configuration file -source [find target/esp_common.cfg] - -if { [info exists CHIPNAME] } { - set _CHIPNAME $CHIPNAME -} else { - set _CHIPNAME esp32s2 -} - -if { [info exists CPUTAPID] } { - set _CPUTAPID $CPUTAPID -} else { - set _CPUTAPID 0x120034e5 -} - -set _TARGETNAME $_CHIPNAME -set _CPUNAME cpu -set _TAPNAME $_CHIPNAME.$_CPUNAME - -jtag newtap $_CHIPNAME $_CPUNAME -irlen 5 -expected-id $_CPUTAPID - -if { $_RTOS == "none" } { - target create $_TARGETNAME esp32s2 -endian little -chain-position $_TAPNAME -} else { - target create $_TARGETNAME esp32s2 -endian little -chain-position $_TAPNAME -rtos $_RTOS -} - -configure_esp_workarea $_TARGETNAME 0x40030000 0x3400 0x3FFE0000 0x6000 -configure_esp_flash_bank $_TARGETNAME $_TARGETNAME $_FLASH_SIZE - -xtensa maskisr on -if { $_SEMIHOST_BASEDIR != "" } { - esp semihost_basedir $_SEMIHOST_BASEDIR -} -if { $_FLASH_SIZE == 0 } { - gdb_breakpoint_override hard -} diff --git a/shared-module/displayio/I2CDisplay.c b/shared-module/displayio/I2CDisplay.c index 9e9e178812..5bd03dcd65 100644 --- a/shared-module/displayio/I2CDisplay.c +++ b/shared-module/displayio/I2CDisplay.c @@ -72,8 +72,8 @@ void common_hal_displayio_i2cdisplay_deinit(displayio_i2cdisplay_obj_t* self) { common_hal_busio_i2c_deinit(self->bus); } - if (self->reset.pin) { - common_hal_reset_pin(self->reset.pin); + if (self->reset.base.type == &digitalio_digitalinout_type) { + common_hal_digitalio_digitalinout_deinit(&self->reset); } } From 2eca4ee90244bc3c09999eb9efa5cd9ef611c3e3 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 14 Sep 2020 11:04:45 -0500 Subject: [PATCH 0865/1293] Update PulseIn.c --- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index 9a9bf57a0d..9930fe9c9f 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -115,11 +115,11 @@ void pulsein_interrupt_handler(uint8_t channel) { duration = total_diff; } //check if the input is taking too long, 15 timer overflows is approx 1 second - if (current_overflow - start_overflow > 15) { - self->errored_too_fast = true; - common_hal_pulseio_pulsein_pause(self); + if (current_overflow - start_overflow > 15) { + self->errored_too_fast = true; + common_hal_pulseio_pulsein_pause(self); common_hal_mcu_enable_interrupts(); - return; + return; } uint16_t i = (self->start + self->len) % self->maxlen; From da0a0f88f9d6bbaf0debfe93f01ed162cf38eae2 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 14 Sep 2020 11:27:08 -0500 Subject: [PATCH 0867/1293] Reverting some prior changes --- supervisor/shared/tick.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 012f2c80e8..91ffa307d7 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -94,6 +94,8 @@ void supervisor_background_tasks(void *unused) { assert_heap_ok(); + last_finished_tick = port_get_raw_ticks(NULL); + port_finish_background_task(); } From 6ecfdda580a7d27b1aaeb7d37f63fdb7f10b3779 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 14 Sep 2020 13:18:51 -0400 Subject: [PATCH 0869/1293] Add Readme --- ports/esp32s2/README.md | 88 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 ports/esp32s2/README.md diff --git a/ports/esp32s2/README.md b/ports/esp32s2/README.md new file mode 100644 index 0000000000..86aa99a13a --- /dev/null +++ b/ports/esp32s2/README.md @@ -0,0 +1,88 @@ +# Circuitpython on ESP32-S2 # + +This port adds the ESP32-S2 line of modules from Espressif to Circuitpython. ESP32-S2 modules are low power, single-core Wi-Fi microcontroller SoCs designed for IoT applications. + +## How this port is organized: ## + +- **bindings/** contains some required bindings to the ESP-IDF for exceptions and memory. +- **boards/** contains the configuration files for each development board and breakout available on the port. +- **common-hal/** contains the port-specific module implementations, used by shared-module and shared-bindings. +- **esp-idf/** contains the Espressif IoT development framework installation, includign all the drivers for the port. +- **modules/** contains information specific to certain ESP32-S2 hardware modules, such as the pins used for flash and RAM on the WROVER and WROOM. +- **peripherals/** contains peripheral setup files and peripheral mapping information, sorted by family and sub-variant. Most files in this directory can be generated with the python scripts in **tools/**. +- **supervisor/** contains port-specific implementations of internal flash, serial and USB, as well as the **port.c** file, which initializes the port at startup. +- **tools/** includes useful python scripts for debugging and other purposes. + +At the root level, refer to **mpconfigboard.h** and **mpconfigport.mk** for port specific settings and a list of enabled circuitpython modules. + +## Connecting to the ESP32-S2 ## + +The USB port built into ESP32-S2 boards such as the Saola is not the native USB of the board, but a debugging and programming interface. The actual ESP32-S2 native USB which exposes the Circuitpython drive and CDC connection is located on IO pins 19 and 20: + +| GPIO | USB | +| ---- | ----------- | +| 20 | D+ (green) | +| 19 | D- (white) | +| GND | GND (black) | +| 5V | +5V (red) | + +Connect these pins using a [USB adapter](https://www.adafruit.com/product/4090) or [breakout cable](https://www.adafruit.com/product/4448) to access the Circuitpython drive. + +## Building and flashing ## + +Before building or flashing the ESP32-S2, you must [install the esp-idf](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html). This must be re-done ever time the esp-idf is updated, but not every time you build. From the port root, run: + +``` +./esp-idf/install.sh +``` + +Additionally, any time you open a new bash environment for building or flashing, you must add the esp-idf tools to your path: + +``` +. esp-idf/export.sh +``` + +To build for a board such as the Saola 1 Wrover and flash it over the UART interface, run the following: + +``` +make BOARD=espressif_saola_1_wrover flash +``` + +On MacOS, you may need to directly specify the port. You can determine the correct port on your machine by running `ls /dev/tty.usb*` and selecting the one that appears only when your development board is plugged in. Example: + +``` +make BOARD=espressif_saola_1_wrover flash PORT=/dev/tty.usbserial-1421120 +``` + +## Debugging ## + +The ESP32-S2 supports JTAG debugging over OpenOCD using a JLink or other probe hardware. The official tutorials can be found on the Espressif website [here](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-guides/jtag-debugging/index.html), but they are mostly for the ESP32-S2 Kaluga, which has built-in debugging. + +OpenOCD is automatically installed and added to your bash environment during the esp-idf installation and setup process. You can double check that it is installed by using `openocd --version`, as per the tutorial. Attach the JTAG probe pins according to the [instructions](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-guides/jtag-debugging/configure-other-jtag.html) for JTAG debugging on boards that do not contain an integrated debugger. + +Once the debugger is connected physically, you must run OpenOCD with attached configuration files specifying the **interface** (your debugger probe) and either a **target** or a **board** (targets are for SoCs only, and can be used when a full board configuration file doesn't exist). You can find the path location of these files by checking the `OPENOCD_SCRIPTS` environmental variable by running `echo $OPENOCD_SCRIPTS` in bash. Interfaces will be in the `interface/` directory, and targets and boards in the `target/` and `board/` directories, respectively. + +**Note:** Unfortunately, there are no board files for the esp32-s2 other than the Kaluga, and the included `target/esp32s2.cfg` target file will not work by default on the Jlink for boards like the Saola 1, as the default speed is incorrect. In addition, these files are covered under the GPL and cannot be included in Circuitpython. Thus, you must make a copy of the esp32s2.cfg file yourself and add the following line manually, under `transport select jtag` at the start of the file: + +``` +adapter_khz 1000 +``` + +Once this is complete, your final OpenOCD command may look something like this: + +`openocd -f interface/jlink.cfg -f SOMEPATH/copied-esp32s2-saola-1.cfg` + +Where `SOMEPATH` is the location of your copied configuration file (this can be placed in the port/boards director with a prefix to ignore it with `.gitignore`, for instance). Interface, target and board config files sourced from espressif only need their paths from the $OPENOCD_SCRIPTS location, you don't need to include their full path. Once OpenOCD is running, connect to GDB with: + +`xtensa-esp32s2-elf-gdb build-espressif_saola_1_wrover/firmware.elf` + +And follow the Espressif GDB tutorial [instructions](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-guides/jtag-debugging/using-debugger.html) for connecting, or add them to your `gdbinit`: + +``` +target remote :3333 +set remote hardware-watchpoint-limit 2 +mon reset halt +flushregs +thb app_main +c +``` From 30cfac08e297d834b1fcee43255104812676f82f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 14 Sep 2020 21:09:11 +0200 Subject: [PATCH 0870/1293] Added translation using Weblate (Greek) --- locale/el.po | 3423 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 3423 insertions(+) create mode 100644 locale/el.po diff --git a/locale/el.po b/locale/el.po new file mode 100644 index 0000000000..6f5ae88e04 --- /dev/null +++ b/locale/el.po @@ -0,0 +1,3423 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: el\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: main.c +msgid "" +"\n" +"Code done running. Waiting for reload.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: py/obj.c +msgid " File \"%q\"" +msgstr "" + +#: py/obj.c +msgid " File \"%q\", line %d" +msgstr "" + +#: main.c +msgid " output:\n" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "%%c requires int or char" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q in use" +msgstr "" + +#: extmod/moductypes.c ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c +#: py/objstrunicode.c +msgid "%q index out of range" +msgstr "" + +#: py/obj.c +msgid "%q indices must be integers, not %q" +msgstr "" + +#: shared-bindings/vectorio/Polygon.c +msgid "%q list must be a list" +msgstr "" + +#: shared-bindings/memorymonitor/AllocationAlarm.c +msgid "%q must be >= 0" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c +#: shared-bindings/displayio/Shape.c +#: shared-bindings/memorymonitor/AllocationAlarm.c +#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c +msgid "%q must be >= 1" +msgstr "" + +#: shared-module/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + +#: shared-bindings/fontio/BuiltinFont.c +msgid "%q should be an int" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "%q() takes %d positional arguments but %d were given" +msgstr "" + +#: py/argcheck.c +msgid "'%q' argument required" +msgstr "" + +#: py/runtime.c +msgid "'%q' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%q' object does not support '%q'" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "'%q' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%q' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "'%q' object is not callable" +msgstr "" + +#: py/runtime.c +msgid "'%q' object is not iterable" +msgstr "" + +#: py/obj.c +msgid "'%q' object is not subscriptable" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects a label" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects a register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects a special register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects an FPU register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects an address of the form [a, b]" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects an integer" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects at most r%d" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects {r0, r1, ...}" +msgstr "" + +#: py/emitinlinextensa.c +#, c-format +msgid "'%s' integer %d is not within range %d..%d" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' integer 0x%x does not fit in mask 0x%x" +msgstr "" + +#: py/objstr.c +msgid "'=' alignment not allowed in string format specifier" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "'S' and 'O' are not supported format types" +msgstr "" + +#: py/compile.c +msgid "'align' requires 1 argument" +msgstr "" + +#: py/compile.c +msgid "'await' outside function" +msgstr "" + +#: py/compile.c +msgid "'await', 'async for' or 'async with' outside async function" +msgstr "" + +#: py/compile.c +msgid "'break' outside loop" +msgstr "" + +#: py/compile.c +msgid "'continue' outside loop" +msgstr "" + +#: py/objgenerator.c +msgid "'coroutine' object is not an iterator" +msgstr "" + +#: py/compile.c +msgid "'data' requires at least 2 arguments" +msgstr "" + +#: py/compile.c +msgid "'data' requires integer arguments" +msgstr "" + +#: py/compile.c +msgid "'label' requires 1 argument" +msgstr "" + +#: py/compile.c +msgid "'return' outside function" +msgstr "" + +#: py/compile.c +msgid "'yield' outside function" +msgstr "" + +#: py/compile.c +msgid "*x must be assignment target" +msgstr "" + +#: py/obj.c +msgid ", in %q\n" +msgstr "" + +#: py/objcomplex.c +msgid "0.0 to a complex power" +msgstr "" + +#: py/modbuiltins.c +msgid "3-arg pow() not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/countio/Counter.c +#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +msgid "A hardware interrupt channel is already in use" +msgstr "" + +#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c +#, c-format +msgid "Address must be %d bytes long" +msgstr "" + +#: shared-bindings/_bleio/Address.c +msgid "Address type out of range" +msgstr "" + +#: ports/nrf/common-hal/busio/I2C.c +msgid "All I2C peripherals are in use" +msgstr "" + +#: ports/nrf/common-hal/busio/SPI.c +msgid "All SPI peripherals are in use" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +msgid "All UART peripherals are in use" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "All event channels in use" +msgstr "" + +#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "All sync event channels in use" +msgstr "" + +#: shared-bindings/pwmio/PWMOut.c +msgid "All timers for this pin are in use" +msgstr "" + +#: ports/atmel-samd/common-hal/_pew/PewPew.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c +msgid "All timers in use" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Already advertising." +msgstr "" + +#: shared-module/memorymonitor/AllocationAlarm.c +#: shared-module/memorymonitor/AllocationSize.c +msgid "Already running" +msgstr "" + +#: ports/cxd56/common-hal/analogio/AnalogIn.c +msgid "AnalogIn not supported on given pin" +msgstr "" + +#: ports/cxd56/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/nrf/common-hal/analogio/AnalogOut.c +msgid "AnalogOut functionality not supported" +msgstr "" + +#: shared-bindings/analogio/AnalogOut.c +msgid "AnalogOut is only 16 bits. Value must be less than 65536." +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogOut.c +msgid "AnalogOut not supported on given pin" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +msgid "Another send is already active" +msgstr "" + +#: shared-bindings/pulseio/PulseOut.c +msgid "Array must contain halfwords (type 'H')" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +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" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Attempted heap allocation when MicroPython VM not running." +msgstr "" + +#: shared-bindings/wifi/Radio.c +msgid "Authentication failure" +msgstr "" + +#: main.c +msgid "Auto-reload is off.\n" +msgstr "" + +#: main.c +msgid "" +"Auto-reload is on. Simply save files over USB to run them or enter REPL to " +"disable.\n" +msgstr "" + +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c +msgid "Below minimum frame rate" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must share a clock unit" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Bit depth must be multiple of 8." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + +#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +msgid "Both pins must support hardware interrupts" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "Brightness must be 0-1.0" +msgstr "" + +#: shared-bindings/supervisor/__init__.c +msgid "Brightness must be between 0 and 255" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Brightness not adjustable" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +#, c-format +msgid "Buffer + offset too small %d %d %d" +msgstr "" + +#: shared-module/usb_hid/Device.c +#, c-format +msgid "Buffer incorrect size. Should be %d bytes." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Buffer is not a bytearray." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Buffer is too small" +msgstr "" + +#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#, c-format +msgid "Buffer length %d too big. It must be less than %d" +msgstr "" + +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +msgid "Buffer must be a multiple of 512 bytes" +msgstr "" + +#: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c +msgid "Buffer must be at least length 1" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Buffer too large and unable to allocate" +msgstr "" + +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + +#: ports/atmel-samd/common-hal/displayio/ParallelBus.c +#: ports/nrf/common-hal/displayio/ParallelBus.c +#, c-format +msgid "Bus pin %d is already in use" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "Byte buffer must be 16 bytes." +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Bytes must be between 0 and 255." +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + +#: py/objtype.c +msgid "Call super().__init__() before accessing native object." +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +msgid "Can't set CCCD on local Characteristic" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot create a new Adapter; use _bleio.adapter;" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c +msgid "Cannot delete values" +msgstr "" + +#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c +#: ports/nrf/common-hal/digitalio/DigitalInOut.c +msgid "Cannot get pull while in output mode" +msgstr "" + +#: ports/nrf/common-hal/microcontroller/Processor.c +msgid "Cannot get temperature" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Cannot output both channels on the same pin" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot read without MISO pin." +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Cannot record to a file" +msgstr "" + +#: shared-module/storage/__init__.c +msgid "Cannot remount '/' when USB is active." +msgstr "" + +#: 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 "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Cannot set value when direction is input." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Cannot specify RTS or CTS in RS485 mode" +msgstr "" + +#: py/objslice.c +msgid "Cannot subclass slice" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot transfer without MOSI and MISO pins." +msgstr "" + +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot write without MOSI pin." +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "CharacteristicBuffer writing not provided" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "CircuitPython was unable to allocate the heap.\n" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Clock pin init failed." +msgstr "" + +#: shared-module/bitbangio/I2C.c +msgid "Clock stretch too long" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Clock unit in use" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Column entry must be digitalio.DigitalInOut" +msgstr "" + +#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c +#: shared-bindings/displayio/ParallelBus.c +msgid "Command must be an int between 0 and 255" +msgstr "" + +#: shared-bindings/_bleio/Connection.c +msgid "" +"Connection has been disconnected and can no longer be used. Create a new " +"connection." +msgstr "" + +#: py/persistentcode.c +msgid "Corrupt .mpy file" +msgstr "" + +#: py/emitglue.c +msgid "Corrupt raw code" +msgstr "" + +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +msgid "Could not initialize UART" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Could not set address" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate decoder" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate first buffer" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate input buffer" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate second buffer" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Crash into the HardFault_Handler." +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "DAC already in use" +msgstr "" + +#: ports/atmel-samd/common-hal/displayio/ParallelBus.c +#: ports/nrf/common-hal/displayio/ParallelBus.c +msgid "Data 0 pin must be byte aligned" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Data chunk must follow fmt chunk" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Data too large for advertisement packet" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Destination capacity is smaller than destination_length." +msgstr "" + +#: ports/nrf/common-hal/audiobusio/I2SOut.c +msgid "Device in use" +msgstr "" + +#: ports/cxd56/common-hal/digitalio/DigitalInOut.c +msgid "DigitalInOut not supported on given pin" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Display must have a 16 bit colorspace." +msgstr "" + +#: 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 "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Drive mode not used when direction is input." +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +msgid "EXTINT channel already in use" +msgstr "" + +#: extmod/modure.c +msgid "Error in regex" +msgstr "" + +#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/neopixel_write/__init__.c +#: shared-bindings/terminalio/Terminal.c +msgid "Expected a %q" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c +msgid "Expected a Characteristic" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a DigitalInOut" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c +msgid "Expected a Service" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Expected a UART" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +#: shared-bindings/_bleio/Service.c +msgid "Expected a UUID" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Expected an Address" +msgstr "" + +#: shared-module/_pixelbuf/PixelBuf.c +#, c-format +msgid "Expected tuple of length %d, got %d" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Extended advertisements with scan response not supported." +msgstr "" + +#: extmod/ulab/code/fft/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + +#: ports/nrf/sd_mutex.c +#, c-format +msgid "Failed to acquire mutex, err 0x%04x" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +msgid "Failed to allocate RX buffer" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c +#, c-format +msgid "Failed to allocate RX buffer of %d bytes" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to connect: internal error" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to connect: timeout" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Failed to parse MP3 file" +msgstr "" + +#: ports/nrf/sd_mutex.c +#, c-format +msgid "Failed to release mutex, err 0x%04x" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + +#: py/moduerrno.c +msgid "File exists" +msgstr "" + +#: shared-module/framebufferio/FramebufferDisplay.c +#, c-format +msgid "Framebuffer requires %d bytes" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "Frequency captured is above capability. Capture Paused." +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + +#: 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 "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Group already used" +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Group full" +msgstr "" + +#: 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/sdioio/SDCard.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + +#: extmod/vfs_posix_file.c py/objstringio.c +msgid "I/O operation on closed file" +msgstr "" + +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + +#: shared-bindings/audiobusio/I2SOut.c +msgid "I2SOut not available" +msgstr "" + +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + +#: py/persistentcode.c +msgid "" +"Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" +"mpy-update for more info." +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Incorrect buffer size" +msgstr "" + +#: py/moduerrno.c +msgid "Input/output error" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Invalid %q pin" +msgstr "" + +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +msgid "Invalid %q pin selection" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +msgid "Invalid BMP file" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/atmel-samd/common-hal/pwmio/PWMOut.c +#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c +#: shared-bindings/pwmio/PWMOut.c +msgid "Invalid PWM frequency" +msgstr "" + +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c +msgid "Invalid argument" +msgstr "" + +#: shared-module/displayio/Bitmap.c +msgid "Invalid bits per value" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Invalid buffer size" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Invalid byteorder string" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "Invalid capture period. Valid range: 1 - 500" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid channel count" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Invalid direction." +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid file" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid format chunk size" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Invalid memory access." +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +msgid "Invalid number of bits" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c +msgid "Invalid phase" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Invalid pin" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Invalid pin for left channel" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Invalid pin for right channel" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/SPI.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +msgid "Invalid pins" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c +msgid "Invalid polarity" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c +msgid "Invalid properties" +msgstr "" + +#: shared-bindings/microcontroller/__init__.c +msgid "Invalid run mode." +msgstr "" + +#: shared-module/_bleio/Attribute.c +msgid "Invalid security_mode" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid voice" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid voice count" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid wave file" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + +#: py/compile.c +msgid "LHS of keyword arg must be an id" +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Layer already in a group." +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Layer must be a Group or TileGrid subclass." +msgstr "" + +#: py/objslice.c +msgid "Length must be an int" +msgstr "" + +#: py/objslice.c +msgid "Length must be non-negative" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "MISO pin init failed." +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "MOSI pin init failed." +msgstr "" + +#: shared-module/displayio/Shape.c +#, c-format +msgid "Maximum x value when mirrored is %d" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "MicroPython NLR jump failed. Likely memory corruption." +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "MicroPython fatal error." +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Microphone startup delay must be in range 0.0 to 1.0" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + +#: shared-bindings/displayio/Group.c +msgid "Must be a %q subclass." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide SCK pin" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + +#: py/parse.c +msgid "Name too long" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +msgid "No CCCD for this Characteristic" +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "No DAC on chip" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "No DMA channel found" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c +msgid "No RX pin" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c +msgid "No TX pin" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "No available clocks" +msgstr "" + +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + +#: shared-bindings/board/__init__.c +msgid "No default %q bus" +msgstr "" + +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +msgid "No free GCLKs" +msgstr "" + +#: shared-bindings/os/__init__.c +msgid "No hardware random available" +msgstr "" + +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "No hardware support on pin" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "No long integer support" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + +#: shared-bindings/wifi/Radio.c +msgid "No network with that ssid" +msgstr "" + +#: shared-module/touchio/TouchIn.c +msgid "No pulldown on pin; 1Mohm recommended" +msgstr "" + +#: py/moduerrno.c +msgid "No space left on device" +msgstr "" + +#: py/moduerrno.c +msgid "No such file/directory" +msgstr "" + +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "No timer available" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + +#: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c +msgid "Not a valid IP string" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "Not connected" +msgstr "" + +#: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c +#: shared-bindings/audiopwmio/PWMAudioOut.c +msgid "Not playing" +msgstr "" + +#: main.c +msgid "Not running saved code.\n" +msgstr "" + +#: shared-bindings/_bleio/__init__.c +msgid "Not settable" +msgstr "" + +#: shared-bindings/util.c +msgid "" +"Object has been deinitialized and can no longer be used. Create a new object." +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +msgid "Odd parity is not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Only 8 or 16 bit mono with " +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +#, c-format +msgid "" +"Only Windows format, uncompressed BMP supported: given header size is %d" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +#, c-format +msgid "" +"Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " +"%d bpp given" +msgstr "" + +#: shared-bindings/ipaddress/__init__.c +msgid "Only raw int supported for ip" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Oversample must be multiple of 8." +msgstr "" + +#: shared-bindings/pwmio/PWMOut.c +msgid "" +"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +msgstr "" + +#: shared-bindings/pwmio/PWMOut.c +msgid "" +"PWM frequency not writable when variable_frequency is False on construction." +msgstr "" + +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c +msgid "ParallelBus not yet supported" +msgstr "" + +#: py/moduerrno.c +msgid "Permission denied" +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogIn.c +#: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c +#: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Pin does not have ADC capabilities" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + +#: py/builtinhelp.c +msgid "Plus any modules on the filesystem\n" +msgstr "" + +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " +"instead" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Prefix buffer must be on the heap" +msgstr "" + +#: main.c +msgid "Press any key to enter the REPL. Use CTRL-D to reload." +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pull not used when direction is output." +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "RS485 inversion specified when not in RS485 mode" +msgstr "" + +#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/rtc/RTC.c +msgid "RTC calibration is not supported on this board" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "RTC is not supported on this board" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "RTS/CTS/RS485 Not yet supported on this device" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c +msgid "Read-only" +msgstr "" + +#: extmod/vfs_fat.c py/moduerrno.c +msgid "Read-only filesystem" +msgstr "" + +#: shared-module/displayio/Bitmap.c +msgid "Read-only object" +msgstr "" + +#: shared-bindings/displayio/EPaperDisplay.c +msgid "Refresh too soon" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Right channel unsupported" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Row entry must be digitalio.DigitalInOut" +msgstr "" + +#: main.c +msgid "Running in safe mode! " +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +msgid "SDA or SCL needs a pull up" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO GetCardInfo Error %d" +msgstr "" + +#: ports/stm/common-hal/sdioio/SDCard.c +#, c-format +msgid "SDIO Init Error %d" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Sample rate must be positive" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#, c-format +msgid "Sample rate too high. It must be less than %d" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Scan already in progess. Stop with stop_scan." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Selected CTS pin not valid" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Selected RTS pin not valid" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Serializer in use" +msgstr "" + +#: shared-bindings/ssl/SSLContext.c +msgid "Server side context cannot have hostname" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Slice and value different lengths." +msgstr "" + +#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c +#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/memorymonitor/AllocationSize.c +#: shared-bindings/pulseio/PulseIn.c +msgid "Slices not supported" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "" + +#: shared-bindings/supervisor/__init__.c +msgid "Stack size must be at least 256" +msgstr "" + +#: shared-bindings/multiterminal/__init__.c +msgid "Stream missing readinto() or write() method." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The CircuitPython heap was corrupted because the stack was too small.\n" +"Please increase the stack size if you know how, or if not:" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The `microcontroller` module was used to boot into safe mode. Press reset to " +"exit safe mode.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The microcontroller's power dipped. Make sure your power supply provides\n" +"enough power for the whole circuit and press reset (after ejecting " +"CIRCUITPY).\n" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's bits_per_sample does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's channel count does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's sample rate does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's signedness does not match the mixer's" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile height must exactly divide bitmap height" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c +msgid "Tile index out of bounds" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile value out of bounds" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile width must exactly divide bitmap width" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +#, c-format +msgid "Timeout is too long: Maximum timeout length is %d seconds" +msgstr "" + +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "" +"Timer was reserved for internal use - declare PWM pins earlier in the program" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample." +msgstr "" + +#: shared-module/displayio/__init__.c +msgid "Too many display busses" +msgstr "" + +#: shared-module/displayio/__init__.c +msgid "Too many displays" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + +#: py/obj.c +msgid "Traceback (most recent call last):\n" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "Tuple or struct_time argument required" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + +#: shared-module/usb_hid/Device.c +msgid "USB Busy" +msgstr "" + +#: shared-module/usb_hid/Device.c +msgid "USB Error" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID integer value must be 0-0xffff" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID value is not str, int or byte buffer" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Unable to allocate buffers for signed conversion" +msgstr "" + +#: shared-module/displayio/I2CDisplay.c +#, c-format +msgid "Unable to find I2C Display at %x" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Unable to find free GCLK" +msgstr "" + +#: py/parse.c +msgid "Unable to init parser" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +msgid "Unable to read color palette data" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Unable to write to nvm." +msgstr "" + +#: ports/nrf/common-hal/_bleio/UUID.c +msgid "Unexpected nrfx uuid type" +msgstr "" + +#: shared-bindings/wifi/Radio.c +msgid "Unknown failure" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown security error: 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown soft device error: %04x" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +#, c-format +msgid "Unmatched number of items on RHS (expected %d, got %d)." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "" +"Unspecified issue. Can be that the pairing prompt on the other device was " +"declined or ignored." +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c +msgid "Unsupported baudrate" +msgstr "" + +#: shared-module/displayio/display_core.c +msgid "Unsupported display bus type" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Unsupported format" +msgstr "" + +#: py/moduerrno.c +msgid "Unsupported operation" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Unsupported pull value." +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +msgid "Value length != required fixed length" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +msgid "Value length > max_length" +msgstr "" + +#: py/emitnative.c +msgid "Viper functions don't currently support more than 4 arguments" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + +#: main.c +msgid "WARNING: Your code filename has two extensions\n" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +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 "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + +#: py/builtinhelp.c +#, c-format +msgid "" +"Welcome to Adafruit CircuitPython %s!\n" +"\n" +"Please visit learn.adafruit.com/category/circuitpython for project guides.\n" +"\n" +"To list built-in modules please do `help(\"modules\")`.\n" +msgstr "" + +#: shared-bindings/wifi/Radio.c +msgid "WiFi password must be between 8 and 63 characters" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Writes not supported on Characteristic" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "You are in safe mode: something unanticipated happened.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "You requested starting safe mode by " +msgstr "" + +#: py/objtype.c +msgid "__init__() should return None" +msgstr "" + +#: py/objtype.c +msgid "__init__() should return None, not '%q'" +msgstr "" + +#: py/objobject.c +msgid "__new__ arg must be a user-type" +msgstr "" + +#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c +msgid "a bytes-like object is required" +msgstr "" + +#: lib/embed/abort_.c +msgid "abort() called" +msgstr "" + +#: extmod/machine_mem.c +#, c-format +msgid "address %08x is not aligned to %d bytes" +msgstr "" + +#: shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "address out of bounds" +msgstr "" + +#: shared-bindings/i2cperipheral/I2CPeripheral.c +msgid "addresses is empty" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + +#: py/modbuiltins.c +msgid "arg is an empty sequence" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + +#: py/runtime.c +msgid "argument has wrong type" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "argument must be ndarray" +msgstr "" + +#: py/argcheck.c shared-bindings/_stage/__init__.c +#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +msgid "argument num/types mismatch" +msgstr "" + +#: py/runtime.c +msgid "argument should be a '%q' not a '%q'" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + +#: py/objarray.c shared-bindings/nvm/ByteArray.c +msgid "array/bytes required on right side" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + +#: py/objstr.c +msgid "attributes not supported yet" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + +#: py/builtinevex.c +msgid "bad compile mode" +msgstr "" + +#: py/objstr.c +msgid "bad conversion specifier" +msgstr "" + +#: py/objstr.c +msgid "bad format string" +msgstr "" + +#: py/binary.c py/objarray.c +msgid "bad typecode" +msgstr "" + +#: py/emitnative.c +msgid "binary op %q not implemented" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "bits must be 7, 8 or 9" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "bits_per_sample must be 8 or 16" +msgstr "" + +#: py/emitinlinethumb.c +msgid "branch not in range" +msgstr "" + +#: shared-bindings/audiocore/RawSample.c +msgid "buffer must be a bytes-like object" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "buffer size must match format" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +msgid "buffer slices must be of equal length" +msgstr "" + +#: py/modstruct.c shared-bindings/struct/__init__.c +#: shared-module/struct/__init__.c +msgid "buffer too small" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "buttons must be digitalio.DigitalInOut" +msgstr "" + +#: py/vm.c +msgid "byte code not implemented" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "byteorder is not a string" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +msgid "bytes > 8 bits not supported" +msgstr "" + +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + +#: py/objstr.c +msgid "bytes value out of range" +msgstr "" + +#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +msgid "calibration is out of range" +msgstr "" + +#: ports/atmel-samd/bindings/samd/Clock.c +msgid "calibration is read only" +msgstr "" + +#: ports/atmel-samd/common-hal/rtc/RTC.c +msgid "calibration value out of range +/-127" +msgstr "" + +#: py/emitinlinethumb.c +msgid "can only have up to 4 parameters to Thumb assembly" +msgstr "" + +#: py/emitinlinextensa.c +msgid "can only have up to 4 parameters to Xtensa assembly" +msgstr "" + +#: py/persistentcode.c +msgid "can only save bytecode" +msgstr "" + +#: py/objtype.c +msgid "can't add special method to already-subclassed class" +msgstr "" + +#: py/compile.c +msgid "can't assign to expression" +msgstr "" + +#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-module/_pixelbuf/PixelBuf.c +msgid "can't convert %q to %q" +msgstr "" + +#: py/objstr.c +msgid "can't convert '%q' object to %q implicitly" +msgstr "" + +#: py/obj.c +msgid "can't convert to %q" +msgstr "" + +#: py/objstr.c +msgid "can't convert to str implicitly" +msgstr "" + +#: py/compile.c +msgid "can't declare nonlocal in outer code" +msgstr "" + +#: py/compile.c +msgid "can't delete expression" +msgstr "" + +#: py/emitnative.c +msgid "can't do binary op between '%q' and '%q'" +msgstr "" + +#: py/objcomplex.c +msgid "can't do truncated division of a complex number" +msgstr "" + +#: py/compile.c +msgid "can't have multiple **x" +msgstr "" + +#: py/compile.c +msgid "can't have multiple *x" +msgstr "" + +#: py/emitnative.c +msgid "can't implicitly convert '%q' to 'bool'" +msgstr "" + +#: py/emitnative.c +msgid "can't load from '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't load with '%q' index" +msgstr "" + +#: py/objgenerator.c +msgid "can't pend throw to just-started generator" +msgstr "" + +#: py/objgenerator.c +msgid "can't send non-None value to a just-started generator" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + +#: py/objnamedtuple.c +msgid "can't set attribute" +msgstr "" + +#: py/emitnative.c +msgid "can't store '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't store to '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't store with '%q' index" +msgstr "" + +#: py/objstr.c +msgid "" +"can't switch from automatic field numbering to manual field specification" +msgstr "" + +#: py/objstr.c +msgid "" +"can't switch from manual field specification to automatic field numbering" +msgstr "" + +#: py/objtype.c +msgid "cannot create '%q' instances" +msgstr "" + +#: py/objtype.c +msgid "cannot create instance" +msgstr "" + +#: py/runtime.c +msgid "cannot import name %q" +msgstr "" + +#: py/builtinimport.c +msgid "cannot perform relative import" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + +#: py/emitnative.c +msgid "casting" +msgstr "" + +#: shared-bindings/_stage/Text.c +msgid "chars buffer too small" +msgstr "" + +#: py/modbuiltins.c +msgid "chr() arg not in range(0x110000)" +msgstr "" + +#: py/modbuiltins.c +msgid "chr() arg not in range(256)" +msgstr "" + +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be a buffer, tuple, list, or int" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be a bytearray or array of type 'b' or 'B'" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color must be between 0x000000 and 0xffffff" +msgstr "" + +#: shared-bindings/displayio/ColorConverter.c +msgid "color should be an int" +msgstr "" + +#: py/objcomplex.c +msgid "complex division by zero" +msgstr "" + +#: py/objfloat.c py/parsenum.c +msgid "complex values not supported" +msgstr "" + +#: extmod/moduzlib.c +msgid "compression header" +msgstr "" + +#: py/parse.c +msgid "constant must be an integer" +msgstr "" + +#: py/emitnative.c +msgid "conversion to object" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "data must be of equal length" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + +#: py/parsenum.c +msgid "decimal numbers not supported" +msgstr "" + +#: py/compile.c +msgid "default 'except' must be last" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "" +"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "destination buffer must be an array of type 'H' for bit_depth = 16" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "destination_length must be an int >= 0" +msgstr "" + +#: py/objdict.c +msgid "dict update sequence has wrong length" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + +#: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c +#: shared-bindings/math/__init__.c +msgid "division by zero" +msgstr "" + +#: py/objdeque.c +msgid "empty" +msgstr "" + +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "" + +#: py/objstr.c +msgid "empty separator" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "empty sequence" +msgstr "" + +#: py/objstr.c +msgid "end of format while looking for conversion specifier" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "end_x should be an int" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +#, c-format +msgid "error = 0x%08lX" +msgstr "" + +#: py/runtime.c +msgid "exceptions must derive from BaseException" +msgstr "" + +#: py/objstr.c +msgid "expected ':' after format specifier" +msgstr "" + +#: py/obj.c +msgid "expected tuple/list" +msgstr "" + +#: py/modthread.c +msgid "expecting a dict for keyword args" +msgstr "" + +#: py/compile.c +msgid "expecting an assembler instruction" +msgstr "" + +#: py/compile.c +msgid "expecting just a value for set" +msgstr "" + +#: py/compile.c +msgid "expecting key:value for dict" +msgstr "" + +#: py/argcheck.c +msgid "extra keyword arguments given" +msgstr "" + +#: py/argcheck.c +msgid "extra positional arguments given" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c +#: shared-bindings/displayio/OnDiskBitmap.c +msgid "file must be a file opened in byte mode" +msgstr "" + +#: shared-bindings/storage/__init__.c +msgid "filesystem must provide mount method" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "first argument must be a function" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + +#: py/objtype.c +msgid "first argument to super() must be type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + +#: py/objint.c +msgid "float too big" +msgstr "" + +#: shared-bindings/_stage/Text.c +msgid "font must be 2048 bytes long" +msgstr "" + +#: py/objstr.c +msgid "format requires a dict" +msgstr "" + +#: py/objdeque.c +msgid "full" +msgstr "" + +#: py/argcheck.c +msgid "function does not take keyword arguments" +msgstr "" + +#: py/argcheck.c +#, c-format +msgid "function expected at most %d arguments, got %d" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "function got multiple values for argument '%q'" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + +#: extmod/ulab/code/compare/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + +#: py/argcheck.c +#, c-format +msgid "function missing %d required positional arguments" +msgstr "" + +#: py/bc.c +msgid "function missing keyword-only argument" +msgstr "" + +#: py/bc.c +msgid "function missing required keyword argument '%q'" +msgstr "" + +#: py/bc.c +#, c-format +msgid "function missing required positional argument #%d" +msgstr "" + +#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c +#, c-format +msgid "function takes %d positional arguments but %d were given" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "function takes exactly 9 arguments" +msgstr "" + +#: py/objgenerator.c +msgid "generator already executing" +msgstr "" + +#: py/objgenerator.c +msgid "generator ignored GeneratorExit" +msgstr "" + +#: shared-bindings/_stage/Layer.c +msgid "graphic must be 2048 bytes long" +msgstr "" + +#: extmod/moduheapq.c +msgid "heap must be a list" +msgstr "" + +#: py/compile.c +msgid "identifier redefined as global" +msgstr "" + +#: py/compile.c +msgid "identifier redefined as nonlocal" +msgstr "" + +#: py/objstr.c +msgid "incomplete format" +msgstr "" + +#: py/objstr.c +msgid "incomplete format key" +msgstr "" + +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + +#: py/obj.c +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 "" + +#: extmod/ulab/code/approx/approx.c +msgid "initial values must be iterable" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "initial_value length is wrong" +msgstr "" + +#: py/compile.c +msgid "inline assembler must be a function" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "input vectors must be of equal length" +msgstr "" + +#: py/parsenum.c +msgid "int() arg 2 must be >= 2 and <= 36" +msgstr "" + +#: py/objstr.c +msgid "integer required" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +#, c-format +msgid "interval must be in range %s-%s" +msgstr "" + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "" + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "" + +#: py/objstr.c +msgid "invalid format specifier" +msgstr "" + +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "" + +#: py/compile.c +msgid "invalid micropython decorator" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "invalid step" +msgstr "" + +#: py/compile.c py/parse.c +msgid "invalid syntax" +msgstr "" + +#: py/parsenum.c +msgid "invalid syntax for integer" +msgstr "" + +#: py/parsenum.c +#, c-format +msgid "invalid syntax for integer with base %d" +msgstr "" + +#: py/parsenum.c +msgid "invalid syntax for number" +msgstr "" + +#: py/objtype.c +msgid "issubclass() arg 1 must be a class" +msgstr "" + +#: py/objtype.c +msgid "issubclass() arg 2 must be a class or a tuple of classes" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "iterations did not converge" +msgstr "" + +#: py/objstr.c +msgid "join expects a list of str/bytes objects consistent with self object" +msgstr "" + +#: py/argcheck.c +msgid "keyword argument(s) not yet implemented - use normal args instead" +msgstr "" + +#: py/bc.c +msgid "keywords must be strings" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +msgid "label '%q' not defined" +msgstr "" + +#: py/compile.c +msgid "label redefined" +msgstr "" + +#: py/stream.c +msgid "length argument not allowed for this type" +msgstr "" + +#: shared-bindings/audiomixer/MixerVoice.c +msgid "level must be between 0 and 1" +msgstr "" + +#: py/objarray.c +msgid "lhs and rhs should be compatible" +msgstr "" + +#: py/emitnative.c +msgid "local '%q' has type '%q' but source is '%q'" +msgstr "" + +#: py/emitnative.c +msgid "local '%q' used before type known" +msgstr "" + +#: py/vm.c +msgid "local variable referenced before assignment" +msgstr "" + +#: py/objint.c +msgid "long int not supported in this build" +msgstr "" + +#: py/parse.c +msgid "malformed f-string" +msgstr "" + +#: shared-bindings/_stage/Layer.c +msgid "map buffer too small" +msgstr "" + +#: py/modmath.c shared-bindings/math/__init__.c +msgid "math domain error" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "matrix is not positive definite" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +#, c-format +msgid "max_length must be 0-%d when fixed_length is %s" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +msgid "max_length must be > 0" +msgstr "" + +#: py/runtime.c +msgid "maximum recursion depth exceeded" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "memory allocation failed, allocating %u bytes" +msgstr "" + +#: py/runtime.c +msgid "memory allocation failed, heap is locked" +msgstr "" + +#: py/builtinimport.c +msgid "module not found" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + +#: py/compile.c +msgid "multiple *x in assignment" +msgstr "" + +#: py/objtype.c +msgid "multiple bases have instance lay-out conflict" +msgstr "" + +#: py/objtype.c +msgid "multiple inheritance not supported" +msgstr "" + +#: py/emitnative.c +msgid "must raise an object" +msgstr "" + +#: py/modbuiltins.c +msgid "must use keyword argument for key function" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + +#: py/runtime.c +msgid "name '%q' is not defined" +msgstr "" + +#: py/runtime.c +msgid "name not defined" +msgstr "" + +#: py/compile.c +msgid "name reused for argument" +msgstr "" + +#: py/emitnative.c +msgid "native yield" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "need more than %d values to unpack" +msgstr "" + +#: py/objint_longlong.c py/objint_mpz.c py/runtime.c +msgid "negative power with no float support" +msgstr "" + +#: py/objint_mpz.c py/runtime.c +msgid "negative shift count" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + +#: py/vm.c +msgid "no active exception to reraise" +msgstr "" + +#: shared-bindings/socket/__init__.c shared-module/network/__init__.c +msgid "no available NIC" +msgstr "" + +#: py/compile.c +msgid "no binding for nonlocal found" +msgstr "" + +#: py/builtinimport.c +msgid "no module named '%q'" +msgstr "" + +#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c +#: shared-bindings/displayio/ParallelBus.c +msgid "no reset pin available" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + +#: py/runtime.c +msgid "no such attribute" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Connection.c +msgid "non-UUID found in service_uuids_whitelist" +msgstr "" + +#: py/compile.c +msgid "non-default argument follows default argument" +msgstr "" + +#: extmod/modubinascii.c +msgid "non-hex digit found" +msgstr "" + +#: py/compile.c +msgid "non-keyword arg after */**" +msgstr "" + +#: py/compile.c +msgid "non-keyword arg after keyword arg" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "not a 128-bit UUID" +msgstr "" + +#: py/objstr.c +msgid "not all arguments converted during string formatting" +msgstr "" + +#: py/objstr.c +msgid "not enough arguments for format string" +msgstr "" + +#: extmod/ulab/code/poly/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/ulab_create.c +msgid "number of points must be at least 2" +msgstr "" + +#: py/obj.c +msgid "object '%q' is not a tuple or list" +msgstr "" + +#: py/obj.c +msgid "object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "object does not support item deletion" +msgstr "" + +#: py/obj.c +msgid "object has no len" +msgstr "" + +#: py/obj.c +msgid "object is not subscriptable" +msgstr "" + +#: py/runtime.c +msgid "object not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "object not callable" +msgstr "" + +#: py/sequence.c shared-bindings/displayio/Group.c +msgid "object not in sequence" +msgstr "" + +#: py/runtime.c +msgid "object not iterable" +msgstr "" + +#: py/obj.c +msgid "object of type '%q' has no len()" +msgstr "" + +#: py/obj.c +msgid "object with buffer protocol required" +msgstr "" + +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "" + +#: py/objstr.c py/objstrunicode.c +msgid "offset out of bounds" +msgstr "" + +#: ports/nrf/common-hal/audiobusio/PDMIn.c +msgid "only bit_depth=16 is supported" +msgstr "" + +#: ports/nrf/common-hal/audiobusio/PDMIn.c +msgid "only sample_rate=16000 is supported" +msgstr "" + +#: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c +#: shared-bindings/nvm/ByteArray.c +msgid "only slices with step=1 (aka None) are supported" +msgstr "" + +#: extmod/ulab/code/compare/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vector/vectorise.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + +#: py/modbuiltins.c +msgid "ord expects a character" +msgstr "" + +#: py/modbuiltins.c +#, c-format +msgid "ord() expected a character, but string of length %d found" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of source" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "out of range of target" +msgstr "" + +#: py/objint_mpz.c +msgid "overflow converting long int to machine word" +msgstr "" + +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + +#: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c +msgid "palette must be 32 bytes long" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "palette_index should be an int" +msgstr "" + +#: py/compile.c +msgid "parameter annotation must be an identifier" +msgstr "" + +#: py/emitinlinextensa.c +msgid "parameters must be registers in sequence a2 to a5" +msgstr "" + +#: py/emitinlinethumb.c +msgid "parameters must be registers in sequence r0 to r3" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "pixel coordinates out of bounds" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "pixel value requires too many bits" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" +msgstr "" + +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c +#: shared-bindings/ps2io/Ps2.c +msgid "pop from empty %q" +msgstr "" + +#: py/objint_mpz.c +msgid "pow() 3rd argument cannot be 0" +msgstr "" + +#: py/objint_mpz.c +msgid "pow() with 3 arguments requires integers" +msgstr "" + +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "" + +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + +#: extmod/ulab/code/fft/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + +#: py/builtinimport.c +msgid "relative import" +msgstr "" + +#: py/obj.c +#, c-format +msgid "requested length %d but object has length %d" +msgstr "" + +#: py/compile.c +msgid "return annotation must be an identifier" +msgstr "" + +#: py/emitnative.c +msgid "return expected '%q' but got '%q'" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + +#: py/objstr.c +msgid "rsplit(None,n)" +msgstr "" + +#: shared-bindings/audiocore/RawSample.c +msgid "" +"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " +"'B'" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "sampling rate out of range" +msgstr "" + +#: py/modmicropython.c +msgid "schedule stack full" +msgstr "" + +#: lib/utils/pyexec.c py/builtinimport.c +msgid "script compilation not supported" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + +#: py/objstr.c +msgid "sign not allowed in string format specifier" +msgstr "" + +#: py/objstr.c +msgid "sign not allowed with integer format specifier 'c'" +msgstr "" + +#: py/objstr.c +msgid "single '}' encountered in format string" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "sleep length must be non-negative" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + +#: py/objslice.c py/sequence.c +msgid "slice step cannot be zero" +msgstr "" + +#: py/objint.c py/sequence.c +msgid "small int overflow" +msgstr "" + +#: main.c +msgid "soft reboot\n" +msgstr "" + +#: extmod/ulab/code/numerical/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "source palette too large" +msgstr "" + +#: py/objstr.c +msgid "start/end indices" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "start_x should be an int" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "step must be non-zero" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "stop must be 1 or 2" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "stop not reachable from start" +msgstr "" + +#: py/stream.c +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 "" + +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "" + +#: py/objarray.c py/objstr.c +msgid "substring not found" +msgstr "" + +#: py/compile.c +msgid "super() can't find self" +msgstr "" + +#: extmod/modujson.c +msgid "syntax error in JSON" +msgstr "" + +#: extmod/moductypes.c +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 "" + +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "timeout must be 0.0-100.0 seconds" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "timeout must be >= 0.0" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "timestamp out of range for platform time_t" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "too many arguments provided with the given format" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "too many values to unpack (expected %d)" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays of equal length" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "tuple index out of range" +msgstr "" + +#: py/obj.c +msgid "tuple/list has wrong length" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c +msgid "tx and rx cannot both be None" +msgstr "" + +#: py/objtype.c +msgid "type '%q' is not an acceptable base type" +msgstr "" + +#: py/objtype.c +msgid "type is not an acceptable base type" +msgstr "" + +#: py/runtime.c +msgid "type object '%q' has no attribute '%q'" +msgstr "" + +#: py/objtype.c +msgid "type takes 1 or 3 arguments" +msgstr "" + +#: py/objint_longlong.c +msgid "ulonglong too large" +msgstr "" + +#: py/emitnative.c +msgid "unary op %q not implemented" +msgstr "" + +#: py/parse.c +msgid "unexpected indent" +msgstr "" + +#: py/bc.c +msgid "unexpected keyword argument" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "unexpected keyword argument '%q'" +msgstr "" + +#: py/lexer.c +msgid "unicode name escapes" +msgstr "" + +#: py/parse.c +msgid "unindent does not match any outer indentation level" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unknown conversion specifier %c" +msgstr "" + +#: py/objstr.c +msgid "unknown format code '%c' for object of type '%q'" +msgstr "" + +#: py/compile.c +msgid "unknown type" +msgstr "" + +#: py/emitnative.c +msgid "unknown type '%q'" +msgstr "" + +#: py/objstr.c +msgid "unmatched '{' in format" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "unreadable attribute" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c +msgid "unsupported %q type" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "unsupported Thumb instruction '%s' with %d arguments" +msgstr "" + +#: py/emitinlinextensa.c +#, c-format +msgid "unsupported Xtensa instruction '%s' with %d arguments" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unsupported format character '%c' (0x%x) at index %d" +msgstr "" + +#: py/runtime.c +msgid "unsupported type for %q: '%q'" +msgstr "" + +#: py/runtime.c +msgid "unsupported type for operator" +msgstr "" + +#: py/runtime.c +msgid "unsupported types for %q: '%q', '%q'" +msgstr "" + +#: py/objint.c +#, c-format +msgid "value must fit in %d byte(s)" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "value_count must be > 0" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "vectors must have same lengths" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "window must be <= interval" +msgstr "" + +#: extmod/ulab/code/linalg/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "wrong input type" +msgstr "" + +#: extmod/ulab/code/ulab_create.c py/objstr.c +msgid "wrong number of arguments" +msgstr "" + +#: py/runtime.c +msgid "wrong number of values to unpack" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type" +msgstr "" + +#: extmod/ulab/code/vector/vectorise.c +msgid "wrong output type" +msgstr "" + +#: shared-module/displayio/Shape.c +msgid "x value out of bounds" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "y should be an int" +msgstr "" + +#: shared-module/displayio/Shape.c +msgid "y value out of bounds" +msgstr "" + +#: py/objrange.c +msgid "zero step" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" From f963d06643ac3ef1aeed21e6b873c8731d160ba3 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 14 Sep 2020 16:29:19 -0500 Subject: [PATCH 0871/1293] Update from adafruit/main --- locale/circuitpython.pot | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index af9491c042..038cdacfc6 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-09 14:33-0700\n" +"POT-Creation-Date: 2020-09-13 14:21-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -30,12 +30,6 @@ msgid "" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"\n" -"To exit, please reset the board without " -msgstr "" - #: py/obj.c msgid " File \"%q\"" msgstr "" @@ -1605,6 +1599,10 @@ msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -1925,7 +1923,7 @@ msgstr "" msgid "bad format string" msgstr "" -#: py/binary.c +#: py/binary.c py/objarray.c msgid "bad typecode" msgstr "" @@ -1978,6 +1976,10 @@ msgstr "" msgid "bytes > 8 bits not supported" msgstr "" +#: py/objarray.c +msgid "bytes length not a multiple of item size" +msgstr "" + #: py/objstr.c msgid "bytes value out of range" msgstr "" @@ -2943,6 +2945,11 @@ msgstr "" msgid "overflow converting long int to machine word" msgstr "" +#: py/modstruct.c +#, c-format +msgid "pack expected %d items for packing (got %d)" +msgstr "" + #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" msgstr "" From 3640ef2b7f5cfa2c7938b7d0d23132a033756ba5 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 14 Sep 2020 17:37:55 -0400 Subject: [PATCH 0875/1293] Fix toctree, incorrect flash port assumptions --- docs/supported_ports.rst | 1 + ports/esp32s2/README.md | 8 +------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/docs/supported_ports.rst b/docs/supported_ports.rst index 09571afb67..e74067e28f 100644 --- a/docs/supported_ports.rst +++ b/docs/supported_ports.rst @@ -17,3 +17,4 @@ is limited. ../ports/mimxrt10xx/README ../ports/nrf/README ../ports/stm/README + ../ports/esp32s2/README diff --git a/ports/esp32s2/README.md b/ports/esp32s2/README.md index 86aa99a13a..5b664df08c 100644 --- a/ports/esp32s2/README.md +++ b/ports/esp32s2/README.md @@ -42,13 +42,7 @@ Additionally, any time you open a new bash environment for building or flashing, . esp-idf/export.sh ``` -To build for a board such as the Saola 1 Wrover and flash it over the UART interface, run the following: - -``` -make BOARD=espressif_saola_1_wrover flash -``` - -On MacOS, you may need to directly specify the port. You can determine the correct port on your machine by running `ls /dev/tty.usb*` and selecting the one that appears only when your development board is plugged in. Example: +Building boards such as the Saola is typically done through `make flash`. The default port is `tty.SLAB_USBtoUART`, which will only work on certain Mac setups. On most machines, both Mac and Linux, you will need to set the port yourself by running `ls /dev/tty.usb*` and selecting the one that only appears when your development board is plugged in. An example make command with the port setting is as follows: ``` make BOARD=espressif_saola_1_wrover flash PORT=/dev/tty.usbserial-1421120 From 067a97587504521007a2031038b217cf151511f5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 14 Sep 2020 17:22:30 -0500 Subject: [PATCH 0876/1293] update submodules to merge commits --- ports/atmel-samd/asf4 | 2 +- ports/atmel-samd/peripherals | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/asf4 b/ports/atmel-samd/asf4 index 1b87f18f80..84f56af132 160000 --- a/ports/atmel-samd/asf4 +++ b/ports/atmel-samd/asf4 @@ -1 +1 @@ -Subproject commit 1b87f18f8091f258e63f85cef54bcc7bafd44598 +Subproject commit 84f56af13292d8f32c40acbd949bde698ddd4507 diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 15fd96f4d8..2ff4ab0510 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 15fd96f4d8c38d5490767ea09469b82a231a768d +Subproject commit 2ff4ab05101ce7d3e105009cc6612df6e992123f From 8fcdc7da16a978d7c65bd3c82c46b11c5178714c Mon Sep 17 00:00:00 2001 From: askpatricw <4002194+askpatrickw@users.noreply.github.com> Date: Mon, 14 Sep 2020 23:24:44 -0700 Subject: [PATCH 0877/1293] RTC enabled --- ports/esp32s2/common-hal/rtc/RTC.c | 52 +++++++++++++++++++++++++ ports/esp32s2/common-hal/rtc/RTC.h | 34 ++++++++++++++++ ports/esp32s2/common-hal/rtc/__init__.c | 0 ports/esp32s2/mpconfigport.mk | 2 +- 4 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 ports/esp32s2/common-hal/rtc/RTC.c create mode 100644 ports/esp32s2/common-hal/rtc/RTC.h create mode 100644 ports/esp32s2/common-hal/rtc/__init__.c diff --git a/ports/esp32s2/common-hal/rtc/RTC.c b/ports/esp32s2/common-hal/rtc/RTC.c new file mode 100644 index 0000000000..1218186a8c --- /dev/null +++ b/ports/esp32s2/common-hal/rtc/RTC.c @@ -0,0 +1,52 @@ +/* + * 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 + +#include "py/obj.h" +#include "py/runtime.h" +#include "soc/rtc_periph.h" +#include "shared-bindings/rtc/RTC.h" + +void common_hal_rtc_get_time(timeutils_struct_time_t *tm) { + struct timeval tv_now; + gettimeofday(&tv_now, NULL); + timeutils_seconds_since_2000_to_struct_time(tv_now.tv_sec, tm); +} + +void common_hal_rtc_set_time(timeutils_struct_time_t *tm) { + struct timeval tv_now = {0}; + tv_now.tv_sec = timeutils_seconds_since_2000(tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); + settimeofday(&tv_now, NULL); +} + +int common_hal_rtc_get_calibration(void) { + return 0; +} + +void common_hal_rtc_set_calibration(int calibration) { + mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board")); +} diff --git a/ports/esp32s2/common-hal/rtc/RTC.h b/ports/esp32s2/common-hal/rtc/RTC.h new file mode 100644 index 0000000000..e51f1f7848 --- /dev/null +++ b/ports/esp32s2/common-hal/rtc/RTC.h @@ -0,0 +1,34 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Noralf Trønnes + * + * 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_NRF_COMMON_HAL_RTC_RTC_H +#define MICROPY_INCLUDED_NRF_COMMON_HAL_RTC_RTC_H + +extern void rtc_init(void); +extern void rtc_reset(void); +extern void common_hal_rtc_init(void); + +#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_RTC_RTC_H diff --git a/ports/esp32s2/common-hal/rtc/__init__.c b/ports/esp32s2/common-hal/rtc/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index ee98ce1f42..8f057784ac 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -21,7 +21,7 @@ CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_ROTARYIO = 0 -CIRCUITPY_RTC = 0 +CIRCUITPY_RTC = 1 CIRCUITPY_NVM = 0 # We don't have enough endpoints to include MIDI. CIRCUITPY_USB_MIDI = 0 From d9e336d39f7a19c47cd98619049f5d8e29512947 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 15 Sep 2020 13:18:04 -0500 Subject: [PATCH 0878/1293] supervisor translate: explain the dictionary --- supervisor/shared/translate.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/supervisor/shared/translate.h b/supervisor/shared/translate.h index 731b26d123..16296a4161 100644 --- a/supervisor/shared/translate.h +++ b/supervisor/shared/translate.h @@ -43,6 +43,19 @@ // (building the huffman encoding on UTF-16 code points gave better // compression than building it on UTF-8 bytes) // +// - code points starting at 128 (word_start) and potentially extending +// to 255 (word_end) (but never interfering with the target +// language's used code points) stand for dictionary entries in a +// dictionary with size up to 256 code points. The dictionary entries +// are computed with a heuristic based on frequent substrings of 2 to +// 9 code points. These are called "words" but are not, grammatically +// speaking, words. They're just spans of code points that frequently +// occur together. +// +// - dictionary entries are non-overlapping, and the _ending_ index of each +// entry is stored in an array. Since the index given is the ending +// index, the array is called "wends". +// // The "data" / "tail" construct is so that the struct's last member is a // "flexible array". However, the _only_ member is not permitted to be // a flexible member, so we have to declare the first byte as a separte From f9f614b3a2878383cad845f72ffef034bd2be951 Mon Sep 17 00:00:00 2001 From: askpatricw <4002194+askpatrickw@users.noreply.github.com> Date: Tue, 15 Sep 2020 11:28:31 -0700 Subject: [PATCH 0879/1293] code review feedback --- ports/esp32s2/mpconfigport.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 8f057784ac..95a845736f 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -13,7 +13,7 @@ USB_SERIAL_NUMBER_LENGTH = 12 LONGINT_IMPL = MPZ # These modules are implemented in ports//common-hal: -CIRCUITPY_FULL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_ANALOGIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 From bd381e434f00360a5089261b7ab108d6c0fd0ad9 Mon Sep 17 00:00:00 2001 From: askpatricw <4002194+askpatrickw@users.noreply.github.com> Date: Tue, 15 Sep 2020 13:02:26 -0700 Subject: [PATCH 0880/1293] Revert "code review feedback" This reverts commit f9f614b3a2878383cad845f72ffef034bd2be951. --- ports/esp32s2/mpconfigport.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 95a845736f..8f057784ac 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -13,7 +13,7 @@ USB_SERIAL_NUMBER_LENGTH = 12 LONGINT_IMPL = MPZ # These modules are implemented in ports//common-hal: -CIRCUITPY_FULL_BUILD = 0 +CIRCUITPY_FULL_BUILD = 1 CIRCUITPY_ANALOGIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 From 95e27bb8bf3e0e3ab1f21e252dafe2c974f1ad30 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 15 Sep 2020 13:43:35 -0700 Subject: [PATCH 0881/1293] Add more PIDs for unique boards --- .../boards/feather_m0_adalogger/mpconfigboard.mk | 2 +- .../feather_m0_express_crickit/mpconfigboard.mk | 2 +- .../boards/feather_m0_rfm69/mpconfigboard.mk | 2 +- .../boards/feather_m0_rfm9x/mpconfigboard.mk | 2 +- .../feather_radiofruit_zigbee/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/pewpew10/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/ugame10/mpconfigboard.mk | 2 +- ports/nrf/boards/TG-Watch02A/mpconfigboard.mk | 2 +- .../boards/electronut_labs_blip/mpconfigboard.mk | 2 +- .../makerdiary_nrf52840_mdk/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- ports/nrf/boards/pca10056/mpconfigboard.mk | 2 +- ports/nrf/boards/pca10059/mpconfigboard.mk | 2 +- ports/nrf/boards/pca10100/mpconfigboard.mk | 2 +- ports/stm/boards/meowbit_v121/mpconfigboard.mk | 2 +- ports/stm/boards/thunderpack/mpconfigboard.mk | 2 +- tools/ci_check_duplicate_usb_vid_pid.py | 14 ++++++++++++-- 17 files changed, 28 insertions(+), 18 deletions(-) diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk index 54c5bff6a0..143910318d 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x8015 +USB_PID = 0x80D3 USB_PRODUCT = "Feather M0 Adalogger" USB_MANUFACTURER = "Adafruit Industries LLC" diff --git a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk index d5e03b49d4..345722575a 100644 --- a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x8023 +USB_PID = 0x80D1 USB_PRODUCT = "Feather M0 Express" USB_MANUFACTURER = "Adafruit Industries LLC" diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk index 7556b9517f..30701f7286 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x8015 +USB_PID = 0x80D2 USB_PRODUCT = "Feather M0 RFM69" USB_MANUFACTURER = "Adafruit Industries LLC" diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index de79638bd3..2d8010a360 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x8015 +USB_PID = 0x80D4 USB_PRODUCT = "Feather M0 RFM9x" USB_MANUFACTURER = "Adafruit Industries LLC" diff --git a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk index e9d94638af..ef571f9ab4 100755 --- a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x8023 +USB_PID = 0x80D0 USB_PRODUCT = "Feather RadioFruit Zigbee" USB_MANUFACTURER = "Adafruit Industries LLC" diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index 7305abf73a..1cc91a8df6 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x801D +USB_PID = 0x80D5 USB_PRODUCT = "PewPew 10.2" USB_MANUFACTURER = "Radomir Dopieralski" diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index 1c43369076..f34655a959 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x801F +USB_PID = 0x80AF USB_PRODUCT = "uGame10" USB_MANUFACTURER = "Radomir Dopieralski" diff --git a/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk b/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk index 08915a19b9..4f5899fa7d 100644 --- a/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk +++ b/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x802A +USB_PID = 0x80DB USB_PRODUCT = "TG-Watch02A" USB_MANUFACTURER = "TG-Tech" diff --git a/ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk b/ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk index f30b308ecf..30946057c9 100644 --- a/ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk +++ b/ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x803C +USB_PID = 0x80D7 USB_PRODUCT = "Blip" USB_MANUFACTURER = "Electronut Labs" diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk b/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk index 3395750496..d69bc82357 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x802A +USB_PID = 0x80DC USB_PRODUCT = "nRF52840-MDK" USB_MANUFACTURER = "makerdiary" diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk index 55ca410d9f..c4fa121744 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x802A +USB_PID = 0x80DD USB_PRODUCT = "nRF52840-MDK-Dongle" USB_MANUFACTURER = "makerdiary" diff --git a/ports/nrf/boards/pca10056/mpconfigboard.mk b/ports/nrf/boards/pca10056/mpconfigboard.mk index 8fd1ef08d0..f24e6f6670 100644 --- a/ports/nrf/boards/pca10056/mpconfigboard.mk +++ b/ports/nrf/boards/pca10056/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x802A +USB_PID = 0x80DA USB_PRODUCT = "PCA10056" USB_MANUFACTURER = "Nordic Semiconductor" diff --git a/ports/nrf/boards/pca10059/mpconfigboard.mk b/ports/nrf/boards/pca10059/mpconfigboard.mk index 3f97b08218..9dc3cc71ed 100644 --- a/ports/nrf/boards/pca10059/mpconfigboard.mk +++ b/ports/nrf/boards/pca10059/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x802A +USB_PID = 0x80D9 USB_PRODUCT = "PCA10059" USB_MANUFACTURER = "Nordic Semiconductor" diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 715b65e63e..fcac550996 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x802A +USB_PID = 0x80D8 USB_PRODUCT = "PCA10100" USB_MANUFACTURER = "Nordic Semiconductor" diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk index cf60c89c26..69a6c65c85 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x805A +USB_PID = 0x80CF USB_PRODUCT = "Meowbit" USB_MANUFACTURER = "Kittenbot" USB_DEVICES = "CDC,MSC" diff --git a/ports/stm/boards/thunderpack/mpconfigboard.mk b/ports/stm/boards/thunderpack/mpconfigboard.mk index 007b00cdd1..02f28775ae 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x806A +USB_PID = 0x8069 USB_PRODUCT = "Thunderpack STM32F411" USB_MANUFACTURER = "Jeremy Gillick" USB_DEVICES = "CDC,MSC" diff --git a/tools/ci_check_duplicate_usb_vid_pid.py b/tools/ci_check_duplicate_usb_vid_pid.py index b05d56012f..dd6bf56709 100644 --- a/tools/ci_check_duplicate_usb_vid_pid.py +++ b/tools/ci_check_duplicate_usb_vid_pid.py @@ -38,7 +38,13 @@ DEFAULT_IGNORELIST = [ "pygamer", "pygamer_advance", "trinket_m0", - "trinket_m0_haxpress" + "trinket_m0_haxpress", + "sparkfun_qwiic_micro_with_flash", + "sparkfun_qwiic_micro_no_flash", + "feather_m0_express", + "feather_m0_supersized", + "cp32-m4", + "metro_m4_express" ] cli_parser = argparse.ArgumentParser(description="USB VID/PID Duplicate Checker") @@ -118,9 +124,13 @@ def check_vid_pid(files, ignorelist): ) duplicate_message = ( - f"Duplicate VID/PID usage found!\n{duplicates}" + f"Duplicate VID/PID usage found!\n{duplicates}\n" + f"If you are open source maker, then you can request a PID from http://pid.codes\n" + f"Otherwise, companies should pay the USB-IF for a vendor ID: https://www.usb.org/getting-vendor-id" ) sys.exit(duplicate_message) + else: + print("No USB PID duplicates found.") if __name__ == "__main__": From 2bd169ec327abd5af0cb34ea51a766341cdaae4a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 15 Sep 2020 18:12:06 -0700 Subject: [PATCH 0882/1293] Add partition layouts for 8 and 16 MB as well. --- ports/esp32s2/Makefile | 2 +- ports/esp32s2/partitions-16MB.csv | 10 ++++++++++ ports/esp32s2/{partitions.csv => partitions-4MB.csv} | 0 ports/esp32s2/partitions-8MB.csv | 10 ++++++++++ ports/esp32s2/sdkconfig-16MB.defaults | 10 ++++++++++ ports/esp32s2/sdkconfig-4MB.defaults | 10 ++++++++++ ports/esp32s2/sdkconfig-8MB.defaults | 10 ++++++++++ ports/esp32s2/sdkconfig.defaults | 8 -------- 8 files changed, 51 insertions(+), 9 deletions(-) create mode 100644 ports/esp32s2/partitions-16MB.csv rename ports/esp32s2/{partitions.csv => partitions-4MB.csv} (100%) create mode 100644 ports/esp32s2/partitions-8MB.csv create mode 100644 ports/esp32s2/sdkconfig-16MB.defaults create mode 100644 ports/esp32s2/sdkconfig-4MB.defaults create mode 100644 ports/esp32s2/sdkconfig-8MB.defaults diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 64068b02d6..229a3bf3ab 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -230,7 +230,7 @@ $(BUILD)/esp-idf: # create the config headers $(BUILD)/esp-idf/config/sdkconfig.h: boards/$(BOARD)/sdkconfig | $(BUILD)/esp-idf - IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;boards/$(BOARD)/sdkconfig" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-esp32s2.cmake -DIDF_TARGET=esp32s2 -GNinja + IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig-$(CIRCUITPY_ESP_FLASH_SIZE).defaults;boards/$(BOARD)/sdkconfig" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-esp32s2.cmake -DIDF_TARGET=esp32s2 -GNinja # build a lib # Adding -d explain -j 1 -v to the ninja line will output debug info diff --git a/ports/esp32s2/partitions-16MB.csv b/ports/esp32s2/partitions-16MB.csv new file mode 100644 index 0000000000..13ea81bea5 --- /dev/null +++ b/ports/esp32s2/partitions-16MB.csv @@ -0,0 +1,10 @@ +# ESP-IDF Partition Table +# Name, Type, SubType, Offset, Size, Flags +# bootloader.bin,, 0x1000, 32K +# partition table,, 0x8000, 4K +nvs, data, nvs, 0x9000, 20K, +otadata, data, ota, 0xe000, 8K, +ota_0, 0, ota_0, 0x10000, 2048K, +ota_1, 0, ota_1, 0x210000, 2048K, +uf2, app, factory,0x410000, 256K, +user_fs, data, fat, 0x450000, 11968K, diff --git a/ports/esp32s2/partitions.csv b/ports/esp32s2/partitions-4MB.csv similarity index 100% rename from ports/esp32s2/partitions.csv rename to ports/esp32s2/partitions-4MB.csv diff --git a/ports/esp32s2/partitions-8MB.csv b/ports/esp32s2/partitions-8MB.csv new file mode 100644 index 0000000000..f4ba9b60a1 --- /dev/null +++ b/ports/esp32s2/partitions-8MB.csv @@ -0,0 +1,10 @@ +# ESP-IDF Partition Table +# Name, Type, SubType, Offset, Size, Flags +# bootloader.bin,, 0x1000, 32K +# partition table,, 0x8000, 4K +nvs, data, nvs, 0x9000, 20K, +otadata, data, ota, 0xe000, 8K, +ota_0, 0, ota_0, 0x10000, 2048K, +ota_1, 0, ota_1, 0x210000, 2048K, +uf2, app, factory,0x410000, 256K, +user_fs, data, fat, 0x450000, 3776K, diff --git a/ports/esp32s2/sdkconfig-16MB.defaults b/ports/esp32s2/sdkconfig-16MB.defaults new file mode 100644 index 0000000000..af477999bd --- /dev/null +++ b/ports/esp32s2/sdkconfig-16MB.defaults @@ -0,0 +1,10 @@ + +# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y +CONFIG_ESPTOOLPY_FLASHSIZE="16MB" + +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-16MB.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions-16MB.csv" diff --git a/ports/esp32s2/sdkconfig-4MB.defaults b/ports/esp32s2/sdkconfig-4MB.defaults new file mode 100644 index 0000000000..561f971c31 --- /dev/null +++ b/ports/esp32s2/sdkconfig-4MB.defaults @@ -0,0 +1,10 @@ + +# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" + +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-4MB.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions-4MB.csv" diff --git a/ports/esp32s2/sdkconfig-8MB.defaults b/ports/esp32s2/sdkconfig-8MB.defaults new file mode 100644 index 0000000000..fcff17f46f --- /dev/null +++ b/ports/esp32s2/sdkconfig-8MB.defaults @@ -0,0 +1,10 @@ + +# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE="8MB" + +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-8MB.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions-8MB.csv" diff --git a/ports/esp32s2/sdkconfig.defaults b/ports/esp32s2/sdkconfig.defaults index c0a56c1432..4094367e0c 100644 --- a/ports/esp32s2/sdkconfig.defaults +++ b/ports/esp32s2/sdkconfig.defaults @@ -88,12 +88,6 @@ CONFIG_ESPTOOLPY_FLASHFREQ_40M=y # CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set CONFIG_ESPTOOLPY_FLASHFREQ="40m" -# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y -# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE="4MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y CONFIG_ESPTOOLPY_BEFORE_RESET=y # CONFIG_ESPTOOLPY_BEFORE_NORESET is not set @@ -119,8 +113,6 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 # CONFIG_PARTITION_TABLE_SINGLE_APP is not set # CONFIG_PARTITION_TABLE_TWO_OTA is not set CONFIG_PARTITION_TABLE_CUSTOM=y -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" -CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_MD5=y # end of Partition Table From fead60d2d877073aad7d4303ff885781f3cff269 Mon Sep 17 00:00:00 2001 From: "Ryan T. Hamilton" Date: Tue, 15 Sep 2020 23:32:53 -0700 Subject: [PATCH 0883/1293] Add BSSID to Network --- ports/esp32s2/common-hal/wifi/Network.c | 6 ++++++ shared-bindings/wifi/Network.c | 18 ++++++++++++++++++ shared-bindings/wifi/Network.h | 1 + 3 files changed, 25 insertions(+) diff --git a/ports/esp32s2/common-hal/wifi/Network.c b/ports/esp32s2/common-hal/wifi/Network.c index 0320e8f92f..e90b3d552c 100644 --- a/ports/esp32s2/common-hal/wifi/Network.c +++ b/ports/esp32s2/common-hal/wifi/Network.c @@ -35,6 +35,12 @@ mp_obj_t common_hal_wifi_network_get_ssid(wifi_network_obj_t *self) { return mp_obj_new_str(cstr, strlen(cstr)); } +#define MAC_ADDRESS_LENGTH 6 + +mp_obj_t common_hal_wifi_network_get_bssid(wifi_network_obj_t *self) { + return mp_obj_new_bytes(self->record.bssid, MAC_ADDRESS_LENGTH); +} + mp_obj_t common_hal_wifi_network_get_rssi(wifi_network_obj_t *self) { return mp_obj_new_int(self->record.rssi); } diff --git a/shared-bindings/wifi/Network.c b/shared-bindings/wifi/Network.c index b6d5e0901e..bf970a9c0f 100644 --- a/shared-bindings/wifi/Network.c +++ b/shared-bindings/wifi/Network.c @@ -58,6 +58,23 @@ const mp_obj_property_t wifi_network_ssid_obj = { }; +//| bssid: bytes +//| """BSSID of the network (usually the AP's MAC address)""" +//| +STATIC mp_obj_t wifi_network_get_bssid(mp_obj_t self) { + return common_hal_wifi_network_get_bssid(self); + +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_network_get_bssid_obj, wifi_network_get_bssid); + +const mp_obj_property_t wifi_network_bssid_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&wifi_network_get_bssid_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + + //| rssi: int //| """Signal strength of the network""" //| @@ -94,6 +111,7 @@ const mp_obj_property_t wifi_network_channel_obj = { STATIC const mp_rom_map_elem_t wifi_network_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_ssid), MP_ROM_PTR(&wifi_network_ssid_obj) }, + { MP_ROM_QSTR(MP_QSTR_bssid), MP_ROM_PTR(&wifi_network_bssid_obj) }, { MP_ROM_QSTR(MP_QSTR_rssi), MP_ROM_PTR(&wifi_network_rssi_obj) }, { MP_ROM_QSTR(MP_QSTR_channel), MP_ROM_PTR(&wifi_network_channel_obj) }, }; diff --git a/shared-bindings/wifi/Network.h b/shared-bindings/wifi/Network.h index 6a7f7be4a0..c9bbc685e6 100644 --- a/shared-bindings/wifi/Network.h +++ b/shared-bindings/wifi/Network.h @@ -36,6 +36,7 @@ const mp_obj_type_t wifi_network_type; extern mp_obj_t common_hal_wifi_network_get_ssid(wifi_network_obj_t *self); +extern mp_obj_t common_hal_wifi_network_get_bssid(wifi_network_obj_t *self); extern mp_obj_t common_hal_wifi_network_get_rssi(wifi_network_obj_t *self); extern mp_obj_t common_hal_wifi_network_get_channel(wifi_network_obj_t *self); From c06aeda399142b50d7fc049effc22db4e2da6830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Sarrailh?= Date: Wed, 16 Sep 2020 13:10:01 +0200 Subject: [PATCH 0884/1293] Add Muselab nanoesp32 s2 definition --- .github/workflows/build.yml | 1 + .../boards/muselab_nanoesp32_s2/board.c | 47 ++++++++++++++++++ .../muselab_nanoesp32_s2/mpconfigboard.h | 34 +++++++++++++ .../muselab_nanoesp32_s2/mpconfigboard.mk | 17 +++++++ .../boards/muselab_nanoesp32_s2/pins.c | 48 +++++++++++++++++++ .../boards/muselab_nanoesp32_s2/sdkconfig | 0 6 files changed, 147 insertions(+) create mode 100644 ports/esp32s2/boards/muselab_nanoesp32_s2/board.c create mode 100644 ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h create mode 100644 ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.mk create mode 100644 ports/esp32s2/boards/muselab_nanoesp32_s2/pins.c create mode 100644 ports/esp32s2/boards/muselab_nanoesp32_s2/sdkconfig diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 513ef29304..49e52dbb2e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -244,6 +244,7 @@ jobs: - "metro_nrf52840_express" - "mini_sam_m4" - "monster_m4sk" + - "muselabnanoesp32_s2" - "ndgarage_ndbit6" - "ndgarage_ndbit6_v2" - "nfc_copy_cat" diff --git a/ports/esp32s2/boards/muselab_nanoesp32_s2/board.c b/ports/esp32s2/boards/muselab_nanoesp32_s2/board.c new file mode 100644 index 0000000000..9f708874bf --- /dev/null +++ b/ports/esp32s2/boards/muselab_nanoesp32_s2/board.c @@ -0,0 +1,47 @@ +/* + * 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 "boards/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h b/ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h new file mode 100644 index 0000000000..5a165deccd --- /dev/null +++ b/ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h @@ -0,0 +1,34 @@ +/* + * 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 "nanoESP32-S2" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) + +#define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.mk b/ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.mk new file mode 100644 index 0000000000..449676d380 --- /dev/null +++ b/ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x239A +USB_PID = 0x80DE +USB_PRODUCT = "nanoESP32-S2" +USB_MANUFACTURER = "Muselab" + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=4MB + +CIRCUITPY_MODULE=wroom diff --git a/ports/esp32s2/boards/muselab_nanoesp32_s2/pins.c b/ports/esp32s2/boards/muselab_nanoesp32_s2/pins.c new file mode 100644 index 0000000000..0562d9331f --- /dev/null +++ b/ports/esp32s2/boards/muselab_nanoesp32_s2/pins.c @@ -0,0 +1,48 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { 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_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_IO17), MP_ROM_PTR(&pin_GPIO17) }, + + + { 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_IO20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_IO26), MP_ROM_PTR(&pin_GPIO26) }, + { 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_IO37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/esp32s2/boards/muselab_nanoesp32_s2/sdkconfig b/ports/esp32s2/boards/muselab_nanoesp32_s2/sdkconfig new file mode 100644 index 0000000000..e69de29bb2 From 8be5d616e48828fa0220004aa3c0c1cf9dbc4761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Sarrailh?= Date: Wed, 16 Sep 2020 13:44:09 +0200 Subject: [PATCH 0885/1293] Fix invalid indentation on build.yml --- .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 49e52dbb2e..ef8c3c8a0e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -244,7 +244,7 @@ jobs: - "metro_nrf52840_express" - "mini_sam_m4" - "monster_m4sk" - - "muselabnanoesp32_s2" + - "muselabnanoesp32_s2" - "ndgarage_ndbit6" - "ndgarage_ndbit6_v2" - "nfc_copy_cat" From 61687c81d82572ee5c014a9f167b2d73db73e2f4 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Wed, 16 Sep 2020 13:55:57 +0200 Subject: [PATCH 0886/1293] camera: Pass width and height to take_picture() --- ports/cxd56/common-hal/camera/Camera.c | 37 ++--------- ports/cxd56/common-hal/camera/Camera.h | 2 - shared-bindings/camera/Camera.c | 92 +++++--------------------- shared-bindings/camera/Camera.h | 9 +-- 4 files changed, 22 insertions(+), 118 deletions(-) diff --git a/ports/cxd56/common-hal/camera/Camera.c b/ports/cxd56/common-hal/camera/Camera.c index a4e197bf33..35e2ab8822 100644 --- a/ports/cxd56/common-hal/camera/Camera.c +++ b/ports/cxd56/common-hal/camera/Camera.c @@ -118,9 +118,7 @@ static void camera_start_preview() { camera_start_streaming(V4L2_BUF_TYPE_VIDEO_CAPTURE); } -extern uint32_t _ebss; -extern uint32_t _stext; -void common_hal_camera_construct(camera_obj_t *self, uint16_t width, uint16_t height) { +void common_hal_camera_construct(camera_obj_t *self) { if (camera_dev.fd < 0) { if (video_initialize(camera_dev.devpath) < 0) { mp_raise_ValueError(translate("Could not initialize Camera")); @@ -131,17 +129,8 @@ void common_hal_camera_construct(camera_obj_t *self, uint16_t width, uint16_t he } } - if (!camera_check_width_and_height(width, height)) { - mp_raise_ValueError(translate("Size not supported")); - } - - self->width = width; - self->height = height; - camera_start_preview(); - camera_set_format(V4L2_BUF_TYPE_STILL_CAPTURE, V4L2_PIX_FMT_JPEG, width, height); - camera_start_streaming(V4L2_BUF_TYPE_STILL_CAPTURE); sleep(1); @@ -162,18 +151,18 @@ bool common_hal_camera_deinited(camera_obj_t *self) { return camera_dev.fd < 0; } -size_t common_hal_camera_take_picture(camera_obj_t *self, uint8_t *buffer, size_t len, camera_imageformat_t format) { - if (!camera_check_width_and_height(self->width, self->height)) { +size_t common_hal_camera_take_picture(camera_obj_t *self, uint8_t *buffer, size_t len, uint16_t width, uint16_t height, camera_imageformat_t format) { + if (!camera_check_width_and_height(width, height)) { mp_raise_ValueError(translate("Size not supported")); } - if (!camera_check_buffer_length(self->width, self->height, format, len)) { + if (!camera_check_buffer_length(width, height, format, len)) { mp_raise_ValueError(translate("Buffer is too small")); } if (!camera_check_format(format)) { mp_raise_ValueError(translate("Format not supported")); } - camera_set_format(V4L2_BUF_TYPE_STILL_CAPTURE, V4L2_PIX_FMT_JPEG, self->width, self->height); + camera_set_format(V4L2_BUF_TYPE_STILL_CAPTURE, V4L2_PIX_FMT_JPEG, width, height); v4l2_buffer_t buf; @@ -192,19 +181,3 @@ size_t common_hal_camera_take_picture(camera_obj_t *self, uint8_t *buffer, size_ return (size_t)buf.bytesused; } - -uint16_t common_hal_camera_get_width(camera_obj_t *self) { - return self->width; -} - -void common_hal_camera_set_width(camera_obj_t *self, uint16_t width) { - self->width = width; -} - -uint16_t common_hal_camera_get_height(camera_obj_t *self) { - return self->height; -} - -void common_hal_camera_set_height(camera_obj_t *self, uint16_t height) { - self->height = height; -} diff --git a/ports/cxd56/common-hal/camera/Camera.h b/ports/cxd56/common-hal/camera/Camera.h index 11fc102085..7056237d16 100644 --- a/ports/cxd56/common-hal/camera/Camera.h +++ b/ports/cxd56/common-hal/camera/Camera.h @@ -31,8 +31,6 @@ typedef struct { mp_obj_base_t base; - uint16_t width; - uint16_t height; } camera_obj_t; #endif // MICROPY_INCLUDED_CXD56_COMMON_HAL_CAMERA_CAMERA_H diff --git a/shared-bindings/camera/Camera.c b/shared-bindings/camera/Camera.c index 5fe54e429d..fd88ccab00 100644 --- a/shared-bindings/camera/Camera.c +++ b/shared-bindings/camera/Camera.c @@ -48,34 +48,26 @@ //| vfs = storage.VfsFat(sd) //| storage.mount(vfs, '/sd') //| -//| cam = camera.Camera(1920, 1080) +//| cam = camera.Camera() //| //| buffer = bytearray(512 * 1024) //| file = open("/sd/image.jpg","wb") -//| size = cam.take_picture(buffer, camera.ImageFormat.JPG) +//| size = cam.take_picture(buffer, width=1920, height=1080, format=camera.ImageFormat.JPG) //| file.write(buffer, size) //| file.close()""" //| -//| def __init__(self, width: int, height: int) -> None: -//| """Initialize camera. -//| -//| :param int width: Width in pixels -//| :param int height: Height in pixels""" +//| def __init__(self) -> None: +//| """Initialize camera.""" //| ... //| STATIC mp_obj_t camera_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { camera_obj_t *self = m_new_obj(camera_obj_t); self->base.type = &camera_type; - enum { ARG_width, ARG_height }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_width, MP_ARG_REQUIRED | MP_ARG_INT }, - { MP_QSTR_height, MP_ARG_REQUIRED | MP_ARG_INT }, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + // No arguments + mp_arg_check_num(n_args, kw_args, 0, 0, false); - common_hal_camera_construct(self, args[ARG_width].u_int, args[ARG_height].u_int); + common_hal_camera_construct(self); return MP_OBJ_FROM_PTR(self); } @@ -97,17 +89,20 @@ STATIC void check_for_deinit(camera_obj_t *self) { } //| def take_picture(self, buf: WriteableBuffer, format: ImageFormat) -> int: -//| """Take picture and save to ``buf`` in the given ``format`` +//| """Take picture and save to ``buf`` in the given ``format``. The size of the picture +//| taken is ``width`` by ``height`` in pixels. //| //| :return: the number of bytes written into buf //| :rtype: int""" //| ... //| STATIC mp_obj_t camera_obj_take_picture(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_buffer, ARG_format }; + enum { ARG_buffer, ARG_width, ARG_height, ARG_format }; static const mp_arg_t allowed_args[] = { { MP_QSTR_buffer, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_format, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_width, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_INT }, + { MP_QSTR_height, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_INT }, + { MP_QSTR_format, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, }; camera_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); check_for_deinit(self); @@ -119,70 +114,13 @@ STATIC mp_obj_t camera_obj_take_picture(size_t n_args, const mp_obj_t *pos_args, camera_imageformat_t format = camera_imageformat_obj_to_type(args[ARG_format].u_obj); - return MP_OBJ_NEW_SMALL_INT(common_hal_camera_take_picture(self, (uint8_t *)bufinfo.buf, bufinfo.len, format)); + return MP_OBJ_NEW_SMALL_INT(common_hal_camera_take_picture(self, (uint8_t *)bufinfo.buf, bufinfo.len, args[ARG_width].u_int, args[ARG_height].u_int, format)); } -MP_DEFINE_CONST_FUN_OBJ_KW(camera_take_picture_obj, 3, camera_obj_take_picture); - -//| width: int -//| """Image width in pixels.""" -//| -STATIC mp_obj_t camera_obj_get_width(mp_obj_t self_in) { - camera_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - return MP_OBJ_NEW_SMALL_INT(common_hal_camera_get_width(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(camera_get_width_obj, camera_obj_get_width); - -STATIC mp_obj_t camera_obj_set_width(mp_obj_t self_in, mp_obj_t value) { - camera_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - common_hal_camera_set_width(self, mp_obj_get_int(value)); - - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_2(camera_set_width_obj, camera_obj_set_width); - -const mp_obj_property_t camera_width_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&camera_get_width_obj, - (mp_obj_t)&camera_set_width_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - -//| height: int -//| """Image height in pixels.""" -//| -STATIC mp_obj_t camera_obj_get_height(mp_obj_t self_in) { - camera_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - return MP_OBJ_NEW_SMALL_INT(common_hal_camera_get_height(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(camera_get_height_obj, camera_obj_get_height); - -STATIC mp_obj_t camera_obj_set_height(mp_obj_t self_in, mp_obj_t value) { - camera_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - common_hal_camera_set_height(self, mp_obj_get_int(value)); - - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_2(camera_set_height_obj, camera_obj_set_height); - -const mp_obj_property_t camera_height_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&camera_get_height_obj, - (mp_obj_t)&camera_set_height_obj, - (mp_obj_t)&mp_const_none_obj}, -}; +MP_DEFINE_CONST_FUN_OBJ_KW(camera_take_picture_obj, 2, camera_obj_take_picture); STATIC const mp_rom_map_elem_t camera_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&camera_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR_take_picture), MP_ROM_PTR(&camera_take_picture_obj) }, - - { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&camera_width_obj) }, - { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&camera_height_obj) }, }; STATIC MP_DEFINE_CONST_DICT(camera_locals_dict, camera_locals_dict_table); diff --git a/shared-bindings/camera/Camera.h b/shared-bindings/camera/Camera.h index 7ef13cd07e..8102672e49 100644 --- a/shared-bindings/camera/Camera.h +++ b/shared-bindings/camera/Camera.h @@ -32,14 +32,9 @@ extern const mp_obj_type_t camera_type; -void common_hal_camera_construct(camera_obj_t *self, uint16_t width, uint16_t height); +void common_hal_camera_construct(camera_obj_t *self); void common_hal_camera_deinit(camera_obj_t *self); bool common_hal_camera_deinited(camera_obj_t *self); -size_t common_hal_camera_take_picture(camera_obj_t *self, uint8_t *buffer, size_t len, camera_imageformat_t format); - -uint16_t common_hal_camera_get_width(camera_obj_t *self); -void common_hal_camera_set_width(camera_obj_t *self, uint16_t width); -uint16_t common_hal_camera_get_height(camera_obj_t *self); -void common_hal_camera_set_height(camera_obj_t *self, uint16_t height); +size_t common_hal_camera_take_picture(camera_obj_t *self, uint8_t *buffer, size_t len, uint16_t width, uint16_t height, camera_imageformat_t format); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_CAMERA_CAMERA_H From d538918cfd0d24afffc800db4d07e7e269a13f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Sarrailh?= Date: Wed, 16 Sep 2020 13:59:59 +0200 Subject: [PATCH 0887/1293] Fix name in build.yml --- .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 ef8c3c8a0e..6d8dc5ba19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -244,7 +244,7 @@ jobs: - "metro_nrf52840_express" - "mini_sam_m4" - "monster_m4sk" - - "muselabnanoesp32_s2" + - "muselab_nanoesp32_s2" - "ndgarage_ndbit6" - "ndgarage_ndbit6_v2" - "nfc_copy_cat" From 4225f8348ffc8cfd0bd0cd881d5896b12a16b324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Sarrailh?= Date: Wed, 16 Sep 2020 14:59:35 +0200 Subject: [PATCH 0888/1293] Change build-arm to build-xtensa in build.yml --- .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 6d8dc5ba19..8e7648e3e6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -244,7 +244,6 @@ jobs: - "metro_nrf52840_express" - "mini_sam_m4" - "monster_m4sk" - - "muselab_nanoesp32_s2" - "ndgarage_ndbit6" - "ndgarage_ndbit6_v2" - "nfc_copy_cat" @@ -417,6 +416,7 @@ jobs: - "espressif_saola_1_wroom" - "espressif_saola_1_wrover" - "microdev_micro_s2" + - "muselab_nanoesp32_s2" - "unexpectedmaker_feathers2" steps: From a8e98cda83119b8716533ce24af6e3d691f7d2ca Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 16 Sep 2020 07:58:55 -0500 Subject: [PATCH 0889/1293] makeqstrdata: comment my understanding of @ciscorn's code --- py/makeqstrdata.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 0060217917..39d4a6840f 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -156,6 +156,14 @@ def compute_huffman_coding(translations, compression_filename): sum_len = 0 while True: + # Until the dictionary is filled to capacity, use a heuristic to find + # the best "word" (2- to 9-gram) to add to it. + # + # The TextSplitter allows us to avoid considering parts of the text + # that are already covered by a previously chosen word, for example + # if "the" is in words then not only will "the" not be considered + # again, neither will "there" or "wither", since they have "the" + # as substrings. extractor = TextSplitter(words) counter = collections.Counter() for t in texts: @@ -164,6 +172,8 @@ def compute_huffman_coding(translations, compression_filename): for substr in iter_substrings(word, minlen=2, maxlen=9): counter[substr] += 1 + # Score the candidates we found. This is an empirical formula only, + # chosen for its effectiveness. scores = sorted( ( (s, (len(s) - 1) ** log(max(occ - 2, 1)), occ) @@ -173,6 +183,8 @@ def compute_huffman_coding(translations, compression_filename): reverse=True, ) + # Do we have a "word" that occurred 5 times and got a score of at least + # 5? Horray. Pick the one with the highest score. word = None for (s, score, occ) in scores: if occ < 5: @@ -182,6 +194,8 @@ def compute_huffman_coding(translations, compression_filename): word = s break + # If we can successfully add it to the dictionary, do so. Otherwise, + # we've filled the dictionary to capacity and are done. if not word: break if sum_len + len(word) - 2 > max_words_len: From 478a4b6405df620f3c8933faae9b81a76dd5a87b Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 16 Sep 2020 10:51:08 -0400 Subject: [PATCH 0890/1293] Clarify location of port root --- ports/esp32s2/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/README.md b/ports/esp32s2/README.md index 5b664df08c..8a6dfbd2d8 100644 --- a/ports/esp32s2/README.md +++ b/ports/esp32s2/README.md @@ -30,7 +30,7 @@ Connect these pins using a [USB adapter](https://www.adafruit.com/product/4090) ## Building and flashing ## -Before building or flashing the ESP32-S2, you must [install the esp-idf](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html). This must be re-done ever time the esp-idf is updated, but not every time you build. From the port root, run: +Before building or flashing the ESP32-S2, you must [install the esp-idf](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html). This must be re-done ever time the esp-idf is updated, but not every time you build. Run `cd ports/esp32s2` from `circuitpython/` to move to the esp32s2 port root, and run: ``` ./esp-idf/install.sh From 18285f96e8a2600afcfcc1a63fa5df6388a8da19 Mon Sep 17 00:00:00 2001 From: askpatricw <4002194+askpatrickw@users.noreply.github.com> Date: Wed, 16 Sep 2020 10:13:07 -0700 Subject: [PATCH 0891/1293] RTC is pickd up automatically --- ports/esp32s2/mpconfigport.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 8f057784ac..bbaabb1c3d 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -21,7 +21,6 @@ CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_ROTARYIO = 0 -CIRCUITPY_RTC = 1 CIRCUITPY_NVM = 0 # We don't have enough endpoints to include MIDI. CIRCUITPY_USB_MIDI = 0 From 00ee94d24b407768612a5f2a40c4099a7899aa0b Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 16 Sep 2020 14:05:15 -0400 Subject: [PATCH 0892/1293] Add SPI memset, optional flags --- ports/stm/Makefile | 3 ++- ports/stm/common-hal/busio/SPI.c | 13 ++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ports/stm/Makefile b/ports/stm/Makefile index dccc749ed8..9e1d10b998 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -102,7 +102,8 @@ CFLAGS += $(INC) -Werror -Wall -std=gnu11 -fshort-enums $(BASE_CFLAGS) $(C_DEFS) # Undo some warnings. # STM32 HAL uses undefined preprocessor variables, shadowed variables, casts that change alignment reqs -CFLAGS += -Wno-undef -Wno-shadow -Wno-cast-align +# You can add your own temporary suppression by setting ADD_CFLAGS in the make command +CFLAGS += -Wno-undef -Wno-shadow -Wno-cast-align $(ADD_CFLAGS) CFLAGS += -mthumb -mabi=aapcs-linux diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index 0354d64ad3..913385e962 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -25,6 +25,7 @@ * THE SOFTWARE. */ #include +#include #include "shared-bindings/busio/SPI.h" #include "py/mperrno.h" @@ -340,7 +341,7 @@ bool common_hal_busio_spi_write(busio_spi_obj_t *self, if (self->mosi == NULL) { mp_raise_ValueError(translate("No MOSI Pin")); } - HAL_StatusTypeDef result = HAL_SPI_Transmit (&self->handle, (uint8_t *)data, (uint16_t)len, HAL_MAX_DELAY); + HAL_StatusTypeDef result = HAL_SPI_Transmit(&self->handle, (uint8_t *)data, (uint16_t)len, HAL_MAX_DELAY); return result == HAL_OK; } @@ -349,7 +350,13 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, if (self->miso == NULL) { mp_raise_ValueError(translate("No MISO Pin")); } - HAL_StatusTypeDef result = HAL_SPI_Receive (&self->handle, data, (uint16_t)len, HAL_MAX_DELAY); + HAL_StatusTypeDef result = HAL_OK; + if (self->mosi == NULL) { + result = HAL_SPI_Receive(&self->handle, data, (uint16_t)len, HAL_MAX_DELAY); + } else { + memset(data, write_value, len); + result = HAL_SPI_TransmitReceive(&self->handle, data, data, (uint16_t)len, HAL_MAX_DELAY); + } return result == HAL_OK; } @@ -358,7 +365,7 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, if (self->miso == NULL || self->mosi == NULL) { mp_raise_ValueError(translate("Missing MISO or MOSI Pin")); } - HAL_StatusTypeDef result = HAL_SPI_TransmitReceive (&self->handle, + HAL_StatusTypeDef result = HAL_SPI_TransmitReceive(&self->handle, (uint8_t *) data_out, data_in, (uint16_t)len,HAL_MAX_DELAY); return result == HAL_OK; } From 847d609ddcab77ac0bba7f2bf50f847ec70ab1ed Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Wed, 16 Sep 2020 16:27:24 -0400 Subject: [PATCH 0893/1293] rename board bdmicro_vina_m0 to bdmicro_vina_d21 and update boardfiles appropriately --- .github/workflows/build.yml | 2 +- .../board.c | 0 .../mpconfigboard.h | 37 +++++++++---------- .../mpconfigboard.mk | 13 ++++--- .../pins.c | 24 ++++++------ 5 files changed, 38 insertions(+), 38 deletions(-) rename ports/atmel-samd/boards/{bdmicro_vina_m0 => bdmicro_vina_d21}/board.c (100%) rename ports/atmel-samd/boards/{bdmicro_vina_m0 => bdmicro_vina_d21}/mpconfigboard.h (85%) rename ports/atmel-samd/boards/{bdmicro_vina_m0 => bdmicro_vina_d21}/mpconfigboard.mk (51%) rename ports/atmel-samd/boards/{bdmicro_vina_m0 => bdmicro_vina_d21}/pins.c (88%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e7648e3e6..04b09f778e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -177,7 +177,7 @@ jobs: - "arduino_nano_33_iot" - "arduino_zero" - "bast_pro_mini_m0" - - "bdmicro_vina_m0" + - "bdmicro_vina_d21" - "bless_dev_board_multi_sensor" - "blm_badge" - "capablerobot_usbhub" diff --git a/ports/atmel-samd/boards/bdmicro_vina_m0/board.c b/ports/atmel-samd/boards/bdmicro_vina_d21/board.c similarity index 100% rename from ports/atmel-samd/boards/bdmicro_vina_m0/board.c rename to ports/atmel-samd/boards/bdmicro_vina_d21/board.c diff --git a/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.h b/ports/atmel-samd/boards/bdmicro_vina_d21/mpconfigboard.h similarity index 85% rename from ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.h rename to ports/atmel-samd/boards/bdmicro_vina_d21/mpconfigboard.h index 458b1e12a6..f2332bbe54 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/bdmicro_vina_d21/mpconfigboard.h @@ -1,34 +1,31 @@ -#define MICROPY_HW_BOARD_NAME "BDMICRO Vina M0" +#define MICROPY_HW_BOARD_NAME "BDMICRO VINA-D21" #define MICROPY_HW_MCU_NAME "samd21g18" -#define MICROPY_HW_LED_STATUS (&pin_PA28) -#define MICROPY_HW_LED_TX &pin_PA27 -#define MICROPY_HW_LED_RX &pin_PA31 - -// Clock rates are off: Salae reads 12MHz which is the limit even though we set it to the safer 8MHz. -#define SPI_FLASH_BAUDRATE (8000000) - -#define SPI_FLASH_MOSI_PIN &pin_PB22 -#define SPI_FLASH_MISO_PIN &pin_PB03 -#define SPI_FLASH_SCK_PIN &pin_PB23 -#define SPI_FLASH_CS_PIN &pin_PA13 - // These are pins not to reset. #define MICROPY_PORT_A (0) #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define BOARD_HAS_CRYSTAL 0 +#define SPI_FLASH_CS_PIN &pin_PA13 +#define SPI_FLASH_MISO_PIN &pin_PB03 +#define SPI_FLASH_MOSI_PIN &pin_PB22 +#define SPI_FLASH_SCK_PIN &pin_PB23 -#define DEFAULT_I2C_BUS_SCL (&pin_PA23) -#define DEFAULT_I2C_BUS_SDA (&pin_PA22) +// Clock rates are off: Salae reads 12MHz which is the limit even though we set it to the safer 8MHz. +#define SPI_FLASH_BAUDRATE (8000000) -#define DEFAULT_SPI_BUS_SCK (&pin_PB11) -#define DEFAULT_SPI_BUS_MOSI (&pin_PB10) -#define DEFAULT_SPI_BUS_MISO (&pin_PA12) +#define BOARD_HAS_CRYSTAL 1 -#define DEFAULT_UART_BUS_RX (&pin_PA11) #define DEFAULT_UART_BUS_TX (&pin_PA10) +#define DEFAULT_UART_BUS_RX (&pin_PA11) +#define DEFAULT_SPI_BUS_MISO (&pin_PA12) +#define DEFAULT_I2C_BUS_SDA (&pin_PA22) +#define DEFAULT_I2C_BUS_SCL (&pin_PA23) +#define MICROPY_HW_LED_TX (&pin_PA27) +#define MICROPY_HW_LED_STATUS (&pin_PA28) +#define MICROPY_HW_LED_RX (&pin_PA31) +#define DEFAULT_SPI_BUS_MOSI (&pin_PB10) +#define DEFAULT_SPI_BUS_SCK (&pin_PB11) // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 diff --git a/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk b/ports/atmel-samd/boards/bdmicro_vina_d21/mpconfigboard.mk similarity index 51% rename from ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk rename to ports/atmel-samd/boards/bdmicro_vina_d21/mpconfigboard.mk index b7ad47ff2c..a9885d064b 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bdmicro_vina_d21/mpconfigboard.mk @@ -1,19 +1,22 @@ USB_VID = 0x31e2 -USB_PID = 0x2002 -USB_PRODUCT = "Vina M0" +USB_PID = 0x2001 +USB_PRODUCT = "VINA-D21" USB_MANUFACTURER = "BDMICRO LLC" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 SPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICE_COUNT = 1 -EXTERNAL_FLASH_DEVICES = "MX25L51245G" +EXTERNAL_FLASH_DEVICE_COUNT = 2 +EXTERNAL_FLASH_DEVICES = "MX25L51245G","GD25S512MD" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_COUNTIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 -CFLAGS_INLINE_LIMIT = 50 +CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 diff --git a/ports/atmel-samd/boards/bdmicro_vina_m0/pins.c b/ports/atmel-samd/boards/bdmicro_vina_d21/pins.c similarity index 88% rename from ports/atmel-samd/boards/bdmicro_vina_m0/pins.c rename to ports/atmel-samd/boards/bdmicro_vina_d21/pins.c index 0ebceb28dd..2e2f9ff4f1 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_m0/pins.c +++ b/ports/atmel-samd/boards/bdmicro_vina_d21/pins.c @@ -1,8 +1,6 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_RTC_INT), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_RTC_CLK), MP_ROM_PTR(&pin_PA01) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB08) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB09) }, @@ -13,8 +11,11 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) }, { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_RTC_TS), MP_ROM_PTR(&pin_PA14) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA09) }, { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, @@ -22,18 +23,17 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) }, { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, - { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, - { MP_ROM_QSTR(MP_QSTR_PGM_LED), MP_ROM_PTR(&pin_PA28) }, - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_LED_STATUS), MP_ROM_PTR(&pin_PA28) }, + { MP_ROM_QSTR(MP_QSTR_LED_TX), MP_ROM_PTR(&pin_PA27) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_LED_RX), MP_ROM_PTR(&pin_PA31) }, { 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_global_dict_table); + From 81ee8745319a4e2802db55eb2dae5adc8fe47b35 Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Wed, 16 Sep 2020 16:40:04 -0400 Subject: [PATCH 0894/1293] pins.c: fix trailing whitespace --- ports/atmel-samd/boards/bdmicro_vina_d21/pins.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/atmel-samd/boards/bdmicro_vina_d21/pins.c b/ports/atmel-samd/boards/bdmicro_vina_d21/pins.c index 2e2f9ff4f1..323f71dec2 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_d21/pins.c +++ b/ports/atmel-samd/boards/bdmicro_vina_d21/pins.c @@ -36,4 +36,3 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); - From daa1dd278d3ee389be63723f4eabee1ab82c9a92 Mon Sep 17 00:00:00 2001 From: "Ryan T. Hamilton" Date: Wed, 16 Sep 2020 16:25:17 -0700 Subject: [PATCH 0895/1293] connect now accepts bssid --- ports/esp32s2/common-hal/wifi/Radio.c | 10 +++++++++- shared-bindings/wifi/Radio.c | 18 +++++++++++++++--- shared-bindings/wifi/Radio.h | 2 +- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index 3c6ab57570..9ba384ca18 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -104,7 +104,7 @@ void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) { self->current_scan = NULL; } -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) { +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) { // check enabled wifi_config_t* config = &self->sta_config; memcpy(&config->sta.ssid, ssid, ssid_len); @@ -112,6 +112,14 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t memcpy(&config->sta.password, password, password_len); config->sta.password[password_len] = 0; config->sta.channel = channel; + // From esp_wifi_types.h: + // Generally, station_config.bssid_set needs to be 0; and it needs + // to be 1 only when users need to check the MAC address of the AP + if (bssid_len > 0){ + memcpy(&config->sta.bssid, bssid, bssid_len); + config->sta.bssid[bssid_len] = 0; + config->sta.bssid_set = 1; + } esp_wifi_set_config(ESP_IF_WIFI_STA, config); self->starting_retries = 5; self->retries_left = 5; diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 329dcb1b5f..928f21da90 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -108,11 +108,12 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_stop_scanning_networks_obj, wifi_rad //| ... //| 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_timeout }; + 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_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_timeout, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, }; @@ -125,7 +126,6 @@ STATIC mp_obj_t wifi_radio_connect(size_t n_args, const mp_obj_t *pos_args, mp_m timeout = mp_obj_get_float(args[ARG_timeout].u_obj); } - mp_buffer_info_t ssid; mp_get_buffer_raise(args[ARG_ssid].u_obj, &ssid, MP_BUFFER_READ); @@ -138,7 +138,19 @@ STATIC mp_obj_t wifi_radio_connect(size_t n_args, const mp_obj_t *pos_args, mp_m } } - wifi_radio_error_t error = common_hal_wifi_radio_connect(self, ssid.buf, ssid.len, password.buf, password.len, args[ARG_channel].u_int, timeout); + #define MAC_ADDRESS_LENGTH 6 + + 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) { + 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")); + } + } + + wifi_radio_error_t error = common_hal_wifi_radio_connect(self, ssid.buf, ssid.len, password.buf, password.len, args[ARG_channel].u_int, timeout, bssid.buf, bssid.len); if (error == WIFI_RADIO_ERROR_AUTH) { mp_raise_ConnectionError(translate("Authentication failure")); } else if (error == WIFI_RADIO_ERROR_NO_AP_FOUND) { diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index 812814f9ea..b5341d51c9 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -51,7 +51,7 @@ extern mp_obj_t common_hal_wifi_radio_get_mac_address(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self); extern void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self); -extern 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); +extern 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); extern mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self); From 6a323a583f48b85e2762db8fc0468afa90501cb3 Mon Sep 17 00:00:00 2001 From: "Ryan T. Hamilton" Date: Wed, 16 Sep 2020 17:08:11 -0700 Subject: [PATCH 0896/1293] Add new error msg to translation --- locale/circuitpython.pot | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 038cdacfc6..078df08b23 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"POT-Creation-Date: 2020-09-16 17:07-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -948,6 +948,10 @@ msgstr "" msgid "Invalid BMP file" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Invalid BSSID" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" From 1805e92038a16d5bada953bdf52b7ae99524f2fa Mon Sep 17 00:00:00 2001 From: "Ryan T. Hamilton" Date: Thu, 17 Sep 2020 15:04:27 -0700 Subject: [PATCH 0897/1293] Add else case for non-bssid usage --- ports/esp32s2/common-hal/wifi/Radio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index 9ba384ca18..a0b8b6adc5 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -119,6 +119,8 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t memcpy(&config->sta.bssid, bssid, bssid_len); config->sta.bssid[bssid_len] = 0; config->sta.bssid_set = 1; + } else { + config->sta.bssid_set = 0; } esp_wifi_set_config(ESP_IF_WIFI_STA, config); self->starting_retries = 5; From 17bdc969dbd060eec60de067f21f8d4143e80bd8 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 17 Sep 2020 16:01:23 -0700 Subject: [PATCH 0898/1293] Reorganize sdkconfigs and release UF2s --- .pre-commit-config.yaml | 2 +- ports/esp32s2/Makefile | 18 +++++++++++++----- .../esp32s2/boards/microdev_micro_s2/sdkconfig | 3 +-- .../boards/unexpectedmaker_feathers2/sdkconfig | 3 +-- .../{ => esp-idf-config}/partitions-16MB.csv | 0 .../{ => esp-idf-config}/partitions-4MB.csv | 0 .../{ => esp-idf-config}/partitions-8MB.csv | 0 .../sdkconfig-16MB.defaults | 7 +++---- .../sdkconfig-4MB.defaults | 7 +++---- .../sdkconfig-8MB.defaults | 7 +++---- .../esp-idf-config/sdkconfig-debug.defaults | 13 +++++++++++++ .../esp-idf-config/sdkconfig-opt.defaults | 12 ++++++++++++ .../{ => esp-idf-config}/sdkconfig.defaults | 0 tools/build_board_info.py | 2 +- 14 files changed, 51 insertions(+), 23 deletions(-) rename ports/esp32s2/{ => esp-idf-config}/partitions-16MB.csv (100%) rename ports/esp32s2/{ => esp-idf-config}/partitions-4MB.csv (100%) rename ports/esp32s2/{ => esp-idf-config}/partitions-8MB.csv (100%) rename ports/esp32s2/{ => esp-idf-config}/sdkconfig-16MB.defaults (52%) rename ports/esp32s2/{ => esp-idf-config}/sdkconfig-4MB.defaults (53%) rename ports/esp32s2/{ => esp-idf-config}/sdkconfig-8MB.defaults (53%) create mode 100644 ports/esp32s2/esp-idf-config/sdkconfig-debug.defaults create mode 100644 ports/esp32s2/esp-idf-config/sdkconfig-opt.defaults rename ports/esp32s2/{ => esp-idf-config}/sdkconfig.defaults (100%) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7c41ca3ce8..322f37da46 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,6 +8,6 @@ repos: hooks: - id: check-yaml - id: end-of-file-fixer - exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*)' + exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/esp32s2/esp-idf-config/.*|ports/esp32s2/boards/.*/sdkconfig)' - id: trailing-whitespace exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*)' diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 229a3bf3ab..662be481e6 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -228,9 +228,17 @@ IDF_PATH = $(realpath ./esp-idf) $(BUILD)/esp-idf: $(Q)$(MKDIR) -p $@ +FLASH_SDKCONFIG = esp-idf-config/sdkconfig-$(CIRCUITPY_ESP_FLASH_SIZE).defaults +ifeq ($(DEBUG), 1) + DEBUG_SDKCONFIG = esp-idf-config/sdkconfig-debug.defaults +else + DEBUG_SDKCONFIG = esp-idf-config/sdkconfig-opt.defaults +endif +SDKCONFIGS = esp-idf-config/sdkconfig.defaults;$(DEBUG_SDKCONFIG);$(FLASH_SDKCONFIG);boards/$(BOARD)/sdkconfig + # create the config headers $(BUILD)/esp-idf/config/sdkconfig.h: boards/$(BOARD)/sdkconfig | $(BUILD)/esp-idf - IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig-$(CIRCUITPY_ESP_FLASH_SIZE).defaults;boards/$(BOARD)/sdkconfig" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-esp32s2.cmake -DIDF_TARGET=esp32s2 -GNinja + IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="$(SDKCONFIGS)" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-esp32s2.cmake -DIDF_TARGET=esp32s2 -GNinja # build a lib # Adding -d explain -j 1 -v to the ninja line will output debug info @@ -247,10 +255,12 @@ $(BUILD)/esp-idf/esp-idf/esp32s2/ld/esp32s2.project.ld: $(BUILD)/esp-idf/config/ $(BUILD)/esp-idf/partition_table/partition-table.bin: $(BUILD)/esp-idf/config/sdkconfig.h IDF_PATH=$(IDF_PATH) ninja -C $(BUILD)/esp-idf partition_table/partition-table.bin -# run menuconfig +# run menuconfig and then remove standard settings menuconfig: $(BUILD)/esp-idf/config $(Q)ninja -C $(BUILD)/esp-idf menuconfig - $(Q)diff --old-line-format= --unchanged-line-format= sdkconfig.defaults $(BUILD)/esp-idf/sdkconfig > boards/$(BOARD)/sdkconfig || true + $(Q)diff --old-line-format= --unchanged-line-format= esp-idf-config/sdkconfig.defaults $(BUILD)/esp-idf/sdkconfig > $(BUILD)/sdkconfig.diff || true + $(Q)grep -Fvxf $(FLASH_SDKCONFIG) $(BUILD)/sdkconfig.diff > $(BUILD)/sdkconfig.stripped1 + $(Q)grep -Fvxf $(DEBUG_SDKCONFIG) $(BUILD)/sdkconfig.stripped1 > boards/$(BOARD)/sdkconfig # qstr builds include headers so we need to make sure they are up to date $(HEADER_BUILD)/qstr.i.last: | $(BUILD)/esp-idf/config/sdkconfig.h @@ -307,8 +317,6 @@ $(BUILD)/firmware.elf: $(OBJ) | esp-idf-stamp $(BUILD)/circuitpython-firmware.bin: $(BUILD)/firmware.elf $(STEPECHO) "Create $@" $(Q)esptool.py --chip esp32s2 elf2image $(FLASH_FLAGS) --elf-sha256-offset 0xb0 -o $@ $^ -# $(Q)$(OBJCOPY) -O binary $^ $@ -# $(Q)$(OBJCOPY) -O binary -j .vectors -j .text -j .data $^ $@ $(BUILD)/firmware.bin: $(BUILD)/circuitpython-firmware.bin | esp-idf-stamp $(Q)$(PYTHON) ../../tools/join_bins.py $@ 0x1000 $(BUILD)/esp-idf/bootloader/bootloader.bin 0x8000 $(BUILD)/esp-idf/partition_table/partition-table.bin 0x10000 $(BUILD)/circuitpython-firmware.bin diff --git a/ports/esp32s2/boards/microdev_micro_s2/sdkconfig b/ports/esp32s2/boards/microdev_micro_s2/sdkconfig index b73c4a8c20..67ac6d2f37 100644 --- a/ports/esp32s2/boards/microdev_micro_s2/sdkconfig +++ b/ports/esp32s2/boards/microdev_micro_s2/sdkconfig @@ -16,10 +16,8 @@ CONFIG_DEFAULT_PSRAM_CLK_IO=30 CONFIG_DEFAULT_PSRAM_CS_IO=26 # end of PSRAM clock and cs IO for ESP32S2 -CONFIG_SPIRAM_SPIWP_SD3_PIN=28 # CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set # CONFIG_SPIRAM_RODATA is not set -# CONFIG_SPIRAM_USE_AHB_DBUS3 is not set # CONFIG_SPIRAM_SPEED_80M is not set CONFIG_SPIRAM_SPEED_40M=y # CONFIG_SPIRAM_SPEED_26M is not set @@ -33,3 +31,4 @@ CONFIG_SPIRAM_USE_MEMMAP=y CONFIG_SPIRAM_MEMTEST=y # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set # end of SPI RAM config + diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig b/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig index b73c4a8c20..67ac6d2f37 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig @@ -16,10 +16,8 @@ CONFIG_DEFAULT_PSRAM_CLK_IO=30 CONFIG_DEFAULT_PSRAM_CS_IO=26 # end of PSRAM clock and cs IO for ESP32S2 -CONFIG_SPIRAM_SPIWP_SD3_PIN=28 # CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set # CONFIG_SPIRAM_RODATA is not set -# CONFIG_SPIRAM_USE_AHB_DBUS3 is not set # CONFIG_SPIRAM_SPEED_80M is not set CONFIG_SPIRAM_SPEED_40M=y # CONFIG_SPIRAM_SPEED_26M is not set @@ -33,3 +31,4 @@ CONFIG_SPIRAM_USE_MEMMAP=y CONFIG_SPIRAM_MEMTEST=y # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set # end of SPI RAM config + diff --git a/ports/esp32s2/partitions-16MB.csv b/ports/esp32s2/esp-idf-config/partitions-16MB.csv similarity index 100% rename from ports/esp32s2/partitions-16MB.csv rename to ports/esp32s2/esp-idf-config/partitions-16MB.csv diff --git a/ports/esp32s2/partitions-4MB.csv b/ports/esp32s2/esp-idf-config/partitions-4MB.csv similarity index 100% rename from ports/esp32s2/partitions-4MB.csv rename to ports/esp32s2/esp-idf-config/partitions-4MB.csv diff --git a/ports/esp32s2/partitions-8MB.csv b/ports/esp32s2/esp-idf-config/partitions-8MB.csv similarity index 100% rename from ports/esp32s2/partitions-8MB.csv rename to ports/esp32s2/esp-idf-config/partitions-8MB.csv diff --git a/ports/esp32s2/sdkconfig-16MB.defaults b/ports/esp32s2/esp-idf-config/sdkconfig-16MB.defaults similarity index 52% rename from ports/esp32s2/sdkconfig-16MB.defaults rename to ports/esp32s2/esp-idf-config/sdkconfig-16MB.defaults index af477999bd..2299feccd8 100644 --- a/ports/esp32s2/sdkconfig-16MB.defaults +++ b/ports/esp32s2/esp-idf-config/sdkconfig-16MB.defaults @@ -1,10 +1,9 @@ - +# No newlines in this file so they are preserved in the board sdkconfig. # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y CONFIG_ESPTOOLPY_FLASHSIZE="16MB" - -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-16MB.csv" -CONFIG_PARTITION_TABLE_FILENAME="partitions-16MB.csv" +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-16MB.csv" +CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-16MB.csv" \ No newline at end of file diff --git a/ports/esp32s2/sdkconfig-4MB.defaults b/ports/esp32s2/esp-idf-config/sdkconfig-4MB.defaults similarity index 53% rename from ports/esp32s2/sdkconfig-4MB.defaults rename to ports/esp32s2/esp-idf-config/sdkconfig-4MB.defaults index 561f971c31..4da90d1bcd 100644 --- a/ports/esp32s2/sdkconfig-4MB.defaults +++ b/ports/esp32s2/esp-idf-config/sdkconfig-4MB.defaults @@ -1,10 +1,9 @@ - +# No newlines in this file so they are preserved in the board sdkconfig. # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y # CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set CONFIG_ESPTOOLPY_FLASHSIZE="4MB" - -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-4MB.csv" -CONFIG_PARTITION_TABLE_FILENAME="partitions-4MB.csv" +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-4MB.csv" +CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-4MB.csv" \ No newline at end of file diff --git a/ports/esp32s2/sdkconfig-8MB.defaults b/ports/esp32s2/esp-idf-config/sdkconfig-8MB.defaults similarity index 53% rename from ports/esp32s2/sdkconfig-8MB.defaults rename to ports/esp32s2/esp-idf-config/sdkconfig-8MB.defaults index fcff17f46f..af681c5ea8 100644 --- a/ports/esp32s2/sdkconfig-8MB.defaults +++ b/ports/esp32s2/esp-idf-config/sdkconfig-8MB.defaults @@ -1,10 +1,9 @@ - +# No newlines in this file so they are preserved in the board sdkconfig. # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set CONFIG_ESPTOOLPY_FLASHSIZE="8MB" - -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-8MB.csv" -CONFIG_PARTITION_TABLE_FILENAME="partitions-8MB.csv" +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-8MB.csv" +CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB.csv" \ No newline at end of file diff --git a/ports/esp32s2/esp-idf-config/sdkconfig-debug.defaults b/ports/esp32s2/esp-idf-config/sdkconfig-debug.defaults new file mode 100644 index 0000000000..f45f6ae9f1 --- /dev/null +++ b/ports/esp32s2/esp-idf-config/sdkconfig-debug.defaults @@ -0,0 +1,13 @@ +# No newlines in this file so they are preserved in the board sdkconfig. +CONFIG_ESP_ERR_TO_NAME_LOOKUP=y +CONFIG_ESP_CONSOLE_UART_DEFAULT=y +# CONFIG_ESP_CONSOLE_USB_CDC is not set +# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set +# CONFIG_ESP_CONSOLE_NONE is not set +CONFIG_ESP_CONSOLE_UART=y +CONFIG_ESP_CONSOLE_UART_NUM=0 +CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +# CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT is not set +# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set \ No newline at end of file diff --git a/ports/esp32s2/esp-idf-config/sdkconfig-opt.defaults b/ports/esp32s2/esp-idf-config/sdkconfig-opt.defaults new file mode 100644 index 0000000000..af0746bc0e --- /dev/null +++ b/ports/esp32s2/esp-idf-config/sdkconfig-opt.defaults @@ -0,0 +1,12 @@ +# No newlines in this file so they are preserved in the board sdkconfig. +# CONFIG_ESP_ERR_TO_NAME_LOOKUP is not set +# CONFIG_ESP_CONSOLE_UART_DEFAULT is not set +# CONFIG_CONSOLE_UART_DEFAULT is not set +CONFIG_ESP_CONSOLE_UART_NONE=y +CONFIG_ESP_CONSOLE_NONE=y +CONFIG_ESP_CONSOLE_UART_NUM=-1 +CONFIG_CONSOLE_UART_NUM=-1 +# CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set +CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT=y +# CONFIG_ESP32S2_PANIC_PRINT_HALT is not set +CONFIG_ESP32S2_PANIC_SILENT_REBOOT=y \ No newline at end of file diff --git a/ports/esp32s2/sdkconfig.defaults b/ports/esp32s2/esp-idf-config/sdkconfig.defaults similarity index 100% rename from ports/esp32s2/sdkconfig.defaults rename to ports/esp32s2/esp-idf-config/sdkconfig.defaults diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 6ed8b8c167..f83282ea9d 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -42,7 +42,7 @@ extension_by_port = { "cxd56": SPK, "mimxrt10xx": HEX_UF2, "litex": DFU, - "esp32s2": BIN + "esp32s2": BIN_UF2 } # Per board overrides From 1b29ceaf1a7b9fd2e8e0ce832b24528a6591bef8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Sep 2020 09:10:31 -0500 Subject: [PATCH 0899/1293] sam e54: disable microcontroller.cpu.voltage This hangs, and the usual workarounds didn't work. --- ports/atmel-samd/common-hal/microcontroller/Processor.c | 6 ++++++ ports/atmel-samd/mpconfigport.h | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/ports/atmel-samd/common-hal/microcontroller/Processor.c b/ports/atmel-samd/common-hal/microcontroller/Processor.c index 199f19354b..ba8daf3fb0 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Processor.c +++ b/ports/atmel-samd/common-hal/microcontroller/Processor.c @@ -61,6 +61,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include + #include "py/mphal.h" #include "common-hal/microcontroller/Processor.h" @@ -276,6 +278,9 @@ float common_hal_mcu_processor_get_temperature(void) { } float common_hal_mcu_processor_get_voltage(void) { +#if MICROCONTROLLER_VOLTAGE_DISABLE + return NAN; +#else struct adc_sync_descriptor adc; static Adc* adc_insts[] = ADC_INSTS; @@ -320,6 +325,7 @@ float common_hal_mcu_processor_get_voltage(void) { adc_sync_deinit(&adc); // Multiply by 4 to compensate for SCALEDIOVCC division by 4. return (reading / 4095.0f) * 4.0f; +#endif } uint32_t common_hal_mcu_processor_get_frequency(void) { diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 2a2428d679..f185142e47 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -75,6 +75,9 @@ #define MICROPY_PY_SYS_PLATFORM "MicroChip SAMD51" #elif defined(SAME54) #define MICROPY_PY_SYS_PLATFORM "MicroChip SAME54" +#ifndef MICROCONTROLLER_VOLTAGE_DISABLE +#define MICROCONTROLLER_VOLTAGE_DISABLE (1) +#endif #endif #define SPI_FLASH_MAX_BAUDRATE 24000000 #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1) @@ -246,4 +249,8 @@ CIRCUITPY_COMMON_ROOT_POINTERS \ mp_obj_t playing_audio[AUDIO_DMA_CHANNEL_COUNT]; +#ifndef MICROCONTROLLER_VOLTAGE_DISABLE +#define MICROCONTROLLER_VOLTAGE_DISABLE (0) +#endif + #endif // __INCLUDED_MPCONFIGPORT_H From c73182803d9ff5a0d270fa20a7649f61198ba5a0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 25 Aug 2020 13:14:08 -0500 Subject: [PATCH 0900/1293] sdioio: fix code for the case where there is no SDHC1 .. it doesn't really make a difference (the old code created an empty else{} statement) but this is more correct. --- ports/atmel-samd/common-hal/sdioio/SDCard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/common-hal/sdioio/SDCard.c b/ports/atmel-samd/common-hal/sdioio/SDCard.c index 8cd077ecd7..1f555b6476 100644 --- a/ports/atmel-samd/common-hal/sdioio/SDCard.c +++ b/ports/atmel-samd/common-hal/sdioio/SDCard.c @@ -144,8 +144,8 @@ CLK PA21 PCC_D? (D32) BROWN hri_mclk_set_AHBMASK_SDHC0_bit(MCLK); hri_gclk_write_PCHCTRL_reg(GCLK, SDHC0_GCLK_ID, CONF_GCLK_SDHC0_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); hri_gclk_write_PCHCTRL_reg(GCLK, SDHC0_GCLK_ID_SLOW, CONF_GCLK_SDHC0_SLOW_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); - } else { #ifdef SDHC1_GCLK_ID + } else { hri_mclk_set_AHBMASK_SDHC1_bit(MCLK); hri_gclk_write_PCHCTRL_reg(GCLK, SDHC1_GCLK_ID, CONF_GCLK_SDHC1_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); hri_gclk_write_PCHCTRL_reg(GCLK, SDHC1_GCLK_ID_SLOW, CONF_GCLK_SDHC1_SLOW_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); From 45eec5b5a566f049edaff11e8457bc0befe79c60 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 3 Sep 2020 10:00:26 -0500 Subject: [PATCH 0901/1293] samd: SPI: improve conditional code I recently misdiagnosed a "maybe-uninitialized" diagnostic as a bug in asf4. However, the problem was in our SPI code. A special case for samr21 MCUs was being applied to same54p20a and possibly other D5x/E5x MCUs, since the check was simply for pin PC19 existing at all. Change the check to use the macro PIN_PC19F_SERCOM4_PAD0 which is only defined if special function F of pin PC19 is SERCOM4 PAD0. Reorganize the code a little bit so that brace-matching in editors is not confused by the conditionalized code, including an unrelated change for APA102_SCK's condition. Revert the change to the Makefile that incorrectly attempted to silence the diagnostic. --- ports/atmel-samd/Makefile | 2 - ports/atmel-samd/common-hal/busio/SPI.c | 106 ++++++++++++------------ 2 files changed, 53 insertions(+), 55 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index f115f9f666..aba630dbb3 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -286,8 +286,6 @@ SRC_ASF += \ $(BUILD)/asf4/$(CHIP_FAMILY)/hpl/sdhc/hpl_sdhc.o: CFLAGS += -Wno-cast-align -Wno-implicit-fallthrough endif -$(BUILD)/asf4/$(CHIP_FAMILY)/hpl/sercom/hpl_sercom.o: CFLAGS += -Wno-maybe-uninitialized - SRC_ASF := $(addprefix asf4/$(CHIP_FAMILY)/, $(SRC_ASF)) SRC_C += \ diff --git a/ports/atmel-samd/common-hal/busio/SPI.c b/ports/atmel-samd/common-hal/busio/SPI.c index 921713d690..189fd93b54 100644 --- a/ports/atmel-samd/common-hal/busio/SPI.c +++ b/ports/atmel-samd/common-hal/busio/SPI.c @@ -98,8 +98,8 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, uint8_t miso_pad = 0; uint8_t dopo = 255; - // Special case for SAMR boards. - #ifdef PIN_PC19 + // Special case for SAMR21 boards. (feather_radiofruit_zigbee) + #if defined(PIN_PC19F_SERCOM4_PAD0) if (miso == &pin_PC19) { if (mosi == &pin_PB30 && clock == &pin_PC18) { sercom = SERCOM4; @@ -113,67 +113,67 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, dopo = samd_peripherals_get_spi_dopo(clock_pad, mosi_pad); } // Error, leave SERCOM unset to throw an exception later. - } else { + } else #endif - for (int i = 0; i < NUM_SERCOMS_PER_PIN; i++) { - sercom_index = clock->sercom[i].index; // 2 for SERCOM2, etc. - if (sercom_index >= SERCOM_INST_NUM) { - continue; - } - Sercom* potential_sercom = sercom_insts[sercom_index]; - if ( - #if defined(MICROPY_HW_APA102_SCK) && defined(MICROPY_HW_APA102_MOSI) && !CIRCUITPY_BITBANG_APA102 - (potential_sercom->SPI.CTRLA.bit.ENABLE != 0 && - potential_sercom != status_apa102.spi_desc.dev.prvt && - !apa102_sck_in_use)) { - #else - potential_sercom->SPI.CTRLA.bit.ENABLE != 0) { - #endif - continue; - } - clock_pinmux = PINMUX(clock->number, (i == 0) ? MUX_C : MUX_D); - clock_pad = clock->sercom[i].pad; - if (!samd_peripherals_valid_spi_clock_pad(clock_pad)) { - continue; - } - for (int j = 0; j < NUM_SERCOMS_PER_PIN; j++) { - if (!mosi_none) { - if (sercom_index == mosi->sercom[j].index) { - mosi_pinmux = PINMUX(mosi->number, (j == 0) ? MUX_C : MUX_D); - mosi_pad = mosi->sercom[j].pad; - dopo = samd_peripherals_get_spi_dopo(clock_pad, mosi_pad); - if (dopo > 0x3) { - continue; // pad combination not possible - } - if (miso_none) { - sercom = potential_sercom; - break; - } - } else { - continue; - } + { + for (int i = 0; i < NUM_SERCOMS_PER_PIN; i++) { + sercom_index = clock->sercom[i].index; // 2 for SERCOM2, etc. + if (sercom_index >= SERCOM_INST_NUM) { + continue; } - if (!miso_none) { - for (int k = 0; k < NUM_SERCOMS_PER_PIN; k++) { - if (sercom_index == miso->sercom[k].index) { - miso_pinmux = PINMUX(miso->number, (k == 0) ? MUX_C : MUX_D); - miso_pad = miso->sercom[k].pad; - sercom = potential_sercom; - break; + Sercom* potential_sercom = sercom_insts[sercom_index]; + if ( + #if defined(MICROPY_HW_APA102_SCK) && defined(MICROPY_HW_APA102_MOSI) && !CIRCUITPY_BITBANG_APA102 + (potential_sercom->SPI.CTRLA.bit.ENABLE != 0 && + potential_sercom != status_apa102.spi_desc.dev.prvt && + !apa102_sck_in_use) + #else + potential_sercom->SPI.CTRLA.bit.ENABLE != 0 + #endif + ) { + continue; + } + clock_pinmux = PINMUX(clock->number, (i == 0) ? MUX_C : MUX_D); + clock_pad = clock->sercom[i].pad; + if (!samd_peripherals_valid_spi_clock_pad(clock_pad)) { + continue; + } + for (int j = 0; j < NUM_SERCOMS_PER_PIN; j++) { + if (!mosi_none) { + if (sercom_index == mosi->sercom[j].index) { + mosi_pinmux = PINMUX(mosi->number, (j == 0) ? MUX_C : MUX_D); + mosi_pad = mosi->sercom[j].pad; + dopo = samd_peripherals_get_spi_dopo(clock_pad, mosi_pad); + if (dopo > 0x3) { + continue; // pad combination not possible + } + if (miso_none) { + sercom = potential_sercom; + break; + } + } else { + continue; } } + if (!miso_none) { + for (int k = 0; k < NUM_SERCOMS_PER_PIN; k++) { + if (sercom_index == miso->sercom[k].index) { + miso_pinmux = PINMUX(miso->number, (k == 0) ? MUX_C : MUX_D); + miso_pad = miso->sercom[k].pad; + sercom = potential_sercom; + break; + } + } + } + if (sercom != NULL) { + break; + } } if (sercom != NULL) { break; } - } - if (sercom != NULL) { - break; - } } - #ifdef PIN_PC19 } - #endif if (sercom == NULL) { mp_raise_ValueError(translate("Invalid pins")); } From 28043c94b5ea5f3cce11fa57afa9f3f0141b8dce Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 3 Sep 2020 13:36:15 -0500 Subject: [PATCH 0902/1293] supervisor: Improve serial connection detection These changes remove the caveat from supervisor.runtime.serial_connected. It appears that _tud_cdc_connected() only tracks explicit changes to the "DTR" bit, which leads to disconnects not being registered. Instead: * when line state is changed explicitly, track the dtr value in _serial_connected * when the USB bus is suspended, set _serial_connected to False Testing performed (using sam e54 xplained): Run a program to show the state of `serial_connected` on the LED: ``` import digitalio import supervisor import board led = digitalio.DigitalInOut(board.LED) while True: led.switch_to_output(not supervisor.runtime.serial_connected) ``` Try all the following: * open, close serial terminal program - LED status tracks whether terminal is open * turn on/off data lines using the switchable charge-only cable - LED turns off when switch is in "charger" position - LED turns back on when switch is in Data position and terminal is opened (but doesn't turn back on just because switch position is changed) --- shared-bindings/supervisor/Runtime.c | 8 +------- supervisor/serial.h | 1 + supervisor/shared/serial.c | 4 +++- supervisor/shared/usb/usb.c | 4 ++++ 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/shared-bindings/supervisor/Runtime.c b/shared-bindings/supervisor/Runtime.c index 84d8370dd5..bfca6e7b1d 100755 --- a/shared-bindings/supervisor/Runtime.c +++ b/shared-bindings/supervisor/Runtime.c @@ -46,13 +46,7 @@ //| //| serial_connected: bool -//| """Returns the USB serial communication status (read-only). -//| -//| .. note:: -//| -//| SAMD: Will return ``True`` if the USB serial connection -//| has been established at any point. Will not reset if -//| USB is disconnected but power remains (e.g. battery connected)""" +//| """Returns the USB serial communication status (read-only).""" //| STATIC mp_obj_t supervisor_get_serial_connected(mp_obj_t self){ diff --git a/supervisor/serial.h b/supervisor/serial.h index 066886303e..9c2d44737a 100644 --- a/supervisor/serial.h +++ b/supervisor/serial.h @@ -47,4 +47,5 @@ char serial_read(void); bool serial_bytes_available(void); bool serial_connected(void); +extern volatile bool _serial_connected; #endif // MICROPY_INCLUDED_SUPERVISOR_SERIAL_H diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c index 303f89e752..91e90671d2 100644 --- a/supervisor/shared/serial.c +++ b/supervisor/shared/serial.c @@ -47,6 +47,8 @@ busio_uart_obj_t debug_uart; byte buf_array[64]; #endif +volatile bool _serial_connected; + void serial_early_init(void) { #if defined(DEBUG_UART_TX) && defined(DEBUG_UART_RX) debug_uart.base.type = &busio_uart_type; @@ -69,7 +71,7 @@ bool serial_connected(void) { #if defined(DEBUG_UART_TX) && defined(DEBUG_UART_RX) return true; #else - return tud_cdc_connected(); + return _serial_connected; #endif } diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index e8541669ad..89fbf56f37 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -29,6 +29,7 @@ #include "shared-module/usb_midi/__init__.h" #include "supervisor/background_callback.h" #include "supervisor/port.h" +#include "supervisor/serial.h" #include "supervisor/usb.h" #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" @@ -115,6 +116,7 @@ void tud_umount_cb(void) { // remote_wakeup_en : if host allows us to perform remote wakeup // USB Specs: Within 7ms, device must draw an average current less than 2.5 mA from bus void tud_suspend_cb(bool remote_wakeup_en) { + _serial_connected = false; } // Invoked when usb bus is resumed @@ -126,6 +128,8 @@ void tud_resume_cb(void) { void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts) { (void) itf; // interface ID, not used + _serial_connected = dtr; + // DTR = false is counted as disconnected if ( !dtr ) { From be3e478fceed9da87e569a0fa40c5797139d99bc Mon Sep 17 00:00:00 2001 From: Chris Dailey Date: Thu, 17 Sep 2020 20:46:59 -0400 Subject: [PATCH 0903/1293] Add SDA & SDL, RX & TX to pins.c Despite the [silk on the dock board](https://wiki.makerdiary.com/nrf52840-m2-devkit/resources/nrf52840_m2_devkit_hw_diagram_v1_0.pdf), the SDA/SCL pins weren't defined. Though, they were already defined in `mpconfigboard.h`. Same for RX/TX. It looks like it declared `TXD` and `RXD`, so I didn't want to remove those, but I think it makes sense to have the "standard" pin names, but I moved ithem to illustrate they were all referencing the same pins. I mimicked the whitespace I saw in the metro_nrf52840_express port. --- .../boards/makerdiary_nrf52840_m2_devkit/pins.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c index cb3bda35ab..d56fd35594 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c +++ b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c @@ -59,7 +59,13 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P1_9), MP_ROM_PTR(&pin_P1_09) }, { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_RXD), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_P0_16) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_16) }, + { MP_ROM_QSTR(MP_QSTR_TXD), MP_ROM_PTR(&pin_P0_16) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P0_19) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P0_20) }, { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P0_21) }, @@ -72,8 +78,12 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_P1_03) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P1_04) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P1_07) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_P1_05) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P1_05) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_P1_06) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P1_06) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_02) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_03) }, @@ -81,6 +91,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_P0_27) }, { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_26) }, { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_11) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_12) }, @@ -91,9 +102,6 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_LCD_BL), MP_ROM_PTR(&pin_P0_20) }, { MP_ROM_QSTR(MP_QSTR_LCD_RST), MP_ROM_PTR(&pin_P1_09) }, - { MP_ROM_QSTR(MP_QSTR_TXD), MP_ROM_PTR(&pin_P0_16) }, - { MP_ROM_QSTR(MP_QSTR_RXD), MP_ROM_PTR(&pin_P0_15) }, - { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_P0_30) }, { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_P0_29) }, { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_P0_31) }, From db078922e4a0e77515fd2bddfb9ba0a4cfbde552 Mon Sep 17 00:00:00 2001 From: nitz Date: Thu, 17 Sep 2020 21:32:19 -0400 Subject: [PATCH 0904/1293] Removed TXD/RXD, fixed whitespace. --- ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c index d56fd35594..027cd9d8d7 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c +++ b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c @@ -60,12 +60,10 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_P0_15) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_15) }, - { MP_ROM_QSTR(MP_QSTR_RXD), MP_ROM_PTR(&pin_P0_15) }, - + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_P0_16) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_16) }, - { MP_ROM_QSTR(MP_QSTR_TXD), MP_ROM_PTR(&pin_P0_16) }, - + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P0_19) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P0_20) }, { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P0_21) }, @@ -78,10 +76,10 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_P1_03) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P1_04) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P1_07) }, - + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_P1_05) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P1_05) }, - + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_P1_06) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P1_06) }, @@ -91,7 +89,6 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_P0_27) }, { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_26) }, { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_04) }, - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_11) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_12) }, From c58bd4c04782efad04ffc08f77fda3efce83badb Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 18 Sep 2020 12:38:15 -0400 Subject: [PATCH 0905/1293] Add never_reset reservation to RGBMatrix init --- ports/stm/common-hal/rgbmatrix/RGBMatrix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/stm/common-hal/rgbmatrix/RGBMatrix.c b/ports/stm/common-hal/rgbmatrix/RGBMatrix.c index 3b42631adc..2826cf53e9 100644 --- a/ports/stm/common-hal/rgbmatrix/RGBMatrix.c +++ b/ports/stm/common-hal/rgbmatrix/RGBMatrix.c @@ -36,6 +36,7 @@ extern void _PM_IRQ_HANDLER(void); void *common_hal_rgbmatrix_timer_allocate() { TIM_TypeDef * timer = stm_peripherals_find_timer(); stm_peripherals_timer_reserve(timer); + stm_peripherals_timer_never_reset(timer); return timer; } From 3a59d30e1ae1a4d5159dadb5f34534b186cdf9fd Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 18 Sep 2020 12:48:15 -0400 Subject: [PATCH 0906/1293] Remove timer debug messages --- ports/stm/peripherals/timers.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ports/stm/peripherals/timers.c b/ports/stm/peripherals/timers.c index baa81d2b5f..7bc5ea495a 100644 --- a/ports/stm/peripherals/timers.c +++ b/ports/stm/peripherals/timers.c @@ -195,9 +195,7 @@ TIM_TypeDef * stm_peripherals_find_timer(void) { // If no results are found, no unclaimed pins with this timer are in this package, // and it is safe to pick if (timer_in_package == false && mcu_tim_banks[i] != NULL) { - // DEBUG: print the timer return mcu_tim_banks[i]; - mp_printf(&mp_plat_print, "Timer: %d\n",i); } } //TODO: secondary search for timers outside the pins in the board profile @@ -205,8 +203,6 @@ TIM_TypeDef * stm_peripherals_find_timer(void) { // Work backwards - higher index timers have fewer pin allocations for (size_t i = (MP_ARRAY_SIZE(mcu_tim_banks) - 1); i >= 0; i--) { if ((!stm_timer_reserved[i]) && (mcu_tim_banks[i] != NULL)) { - // DEBUG: print the timer - mp_printf(&mp_plat_print, "Timer: %d\n",i); return mcu_tim_banks[i]; } } From 5249a228a011c737401a32ff76316bef161cc086 Mon Sep 17 00:00:00 2001 From: nitz Date: Fri, 18 Sep 2020 14:27:00 -0400 Subject: [PATCH 0907/1293] More pin names cleanup. --- ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c | 3 ++- ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/pins.c | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c index 027cd9d8d7..2340885b50 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c +++ b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c @@ -103,7 +103,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_P0_29) }, { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_P0_31) }, - { MP_ROM_QSTR(MP_QSTR_USR_BTN), MP_ROM_PTR(&pin_P0_19) }, + { MP_ROM_QSTR(MP_QSTR_USR), MP_ROM_PTR(&pin_P0_19) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_P0_19) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/pins.c b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/pins.c index 006b247688..d46f369422 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/pins.c +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/pins.c @@ -9,9 +9,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_AREF), MP_ROM_PTR(&pin_P0_04) }, // User must connect manually. { MP_ROM_QSTR(MP_QSTR_VDIV), MP_ROM_PTR(&pin_P0_05) }, // User must connect manually. -// Not defining the NFC names until CircuitPython supports NFC. -// { 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_NFC1), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) }, { MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_P0_02) }, { MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_P0_03) }, From 8d6a28a9ffcc3b8993b0ac261c81b8a619094cb2 Mon Sep 17 00:00:00 2001 From: nitz Date: Fri, 18 Sep 2020 17:01:44 -0400 Subject: [PATCH 0908/1293] Update user button names. --- ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c | 3 +-- ports/nrf/boards/makerdiary_nrf52840_mdk/pins.c | 2 +- ports/nrf/boards/pitaya_go/pins.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c index 2340885b50..7dc6db18fa 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c +++ b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c @@ -103,8 +103,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_P0_29) }, { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_P0_31) }, - { MP_ROM_QSTR(MP_QSTR_USR), MP_ROM_PTR(&pin_P0_19) }, - { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_P0_19) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_USR), MP_ROM_PTR(&pin_P0_19) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk/pins.c b/ports/nrf/boards/makerdiary_nrf52840_mdk/pins.c index 5284c24842..34f487b1de 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk/pins.c +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk/pins.c @@ -55,7 +55,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_P0_22) }, { MP_ROM_QSTR(MP_QSTR_LED_BLUE), MP_ROM_PTR(&pin_P0_24) }, - { MP_ROM_QSTR(MP_QSTR_USR_BTN), MP_ROM_PTR(&pin_P1_00) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_USR), MP_ROM_PTR(&pin_P1_00) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/nrf/boards/pitaya_go/pins.c b/ports/nrf/boards/pitaya_go/pins.c index 92411581bc..ba333fc2be 100644 --- a/ports/nrf/boards/pitaya_go/pins.c +++ b/ports/nrf/boards/pitaya_go/pins.c @@ -58,7 +58,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_P0_11) }, { MP_ROM_QSTR(MP_QSTR_LED_BLUE), MP_ROM_PTR(&pin_P0_12) }, - { MP_ROM_QSTR(MP_QSTR_USR_BTN), MP_ROM_PTR(&pin_P1_00) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_USER), MP_ROM_PTR(&pin_P1_00) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From bfbbbd6c5ce58ba1bcb57323566209902e1000b0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 19 Sep 2020 10:16:13 -0500 Subject: [PATCH 0909/1293] makeqstrdata: Work with older Python This construct (which I added without sufficient testing, apparently) is only supported in Python 3.7 and newer. Make it optional so that this script works on other Python versions. This means that if you have a system with non-UTF-8 encoding you will need to use Python 3.7. In particular, this affects a problem building circuitpython in github's ubuntu-18.04 virtual environment when Python 3.7 is not explicitly installed. cookie-cuttered libraries call for Python 3.6: ``` - name: Set up Python 3.6 uses: actions/setup-python@v1 with: python-version: 3.6 ``` Since CircuitPython's own build calls for 3.8, this problem was not detected. This problem was also encountered by discord user mdroberts1243. The failure I encountered was here: https://github.com/jepler/Jepler_CircuitPython_udecimal/runs/1138045020?check_suite_focus=true .. while my step of "clone and build circuitpython unix port" is unusual, I think the same problem would have affected "build assets" if that step had been reached. --- py/makeqstrdata.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 39d4a6840f..96e3956b42 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -17,8 +17,9 @@ import collections import gettext import os.path -sys.stdout.reconfigure(encoding='utf-8') -sys.stderr.reconfigure(errors='backslashreplace') +if hasattr(sys.stdout, 'reconfigure'): + sys.stdout.reconfigure(encoding='utf-8') + sys.stderr.reconfigure(errors='backslashreplace') py = os.path.dirname(sys.argv[0]) top = os.path.dirname(py) From 852bdd2137b98d77634eaa09773821a24684a780 Mon Sep 17 00:00:00 2001 From: Hugo Dahl Date: Wed, 16 Sep 2020 02:20:39 +0000 Subject: [PATCH 0910/1293] Translated using Weblate (French) Currently translated at 94.7% (753 of 795 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 1180648961..8f1965a6b8 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: 2020-09-13 14:21-0500\n" -"PO-Revision-Date: 2020-07-27 21:27+0000\n" -"Last-Translator: Nathan \n" +"PO-Revision-Date: 2020-09-16 13:47+0000\n" +"Last-Translator: Hugo Dahl \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.2-dev\n" +"X-Generator: Weblate 4.3-dev\n" #: main.c msgid "" @@ -78,7 +78,7 @@ msgstr "index %q hors gamme" #: py/obj.c msgid "%q indices must be integers, not %q" -msgstr "" +msgstr "indices %q doivent être des chiffres entier, et non %q" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -118,39 +118,39 @@ msgstr "'%q' argument requis" #: py/runtime.c msgid "'%q' object cannot assign attribute '%q'" -msgstr "" +msgstr "object '%q' ne peut assigner l'attribut '%q'" #: py/proto.c msgid "'%q' object does not support '%q'" -msgstr "" +msgstr "object '%q' ne supporte pas '%q'" #: py/obj.c msgid "'%q' object does not support item assignment" -msgstr "" +msgstr "objet '%q' ne supporte pas l'assignement d'objets" #: py/obj.c msgid "'%q' object does not support item deletion" -msgstr "" +msgstr "object '%q' ne supported pas la suppression d'objet" #: py/runtime.c msgid "'%q' object has no attribute '%q'" -msgstr "" +msgstr "object '%q' n'as pas d'attribut '%q'" #: py/runtime.c msgid "'%q' object is not an iterator" -msgstr "" +msgstr "object '%q' n'est pas un itérateur" #: py/objtype.c py/runtime.c msgid "'%q' object is not callable" -msgstr "" +msgstr "object '%q' ne peut pas être appelé" #: py/runtime.c msgid "'%q' object is not iterable" -msgstr "" +msgstr "objet '%q' n'est pas iterable" #: py/obj.c msgid "'%q' object is not subscriptable" -msgstr "" +msgstr "objet '%q' n'est pas souscriptable" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -220,7 +220,7 @@ msgstr "'await' en dehors d'une fonction" #: py/compile.c msgid "'await', 'async for' or 'async with' outside async function" -msgstr "" +msgstr "'await', 'async for' ou 'async with' au dehors d'une fonction async" #: py/compile.c msgid "'break' outside loop" @@ -378,7 +378,7 @@ msgstr "" #: shared-bindings/wifi/Radio.c msgid "Authentication failure" -msgstr "" +msgstr "Échec d'authentification" #: main.c msgid "Auto-reload is off.\n" @@ -460,7 +460,7 @@ msgstr "La longueur de la mémoire tampon doit être un multiple de 512" #: ports/stm/common-hal/sdioio/SDCard.c msgid "Buffer must be a multiple of 512 bytes" -msgstr "" +msgstr "La mémoire tampon doit être un multiple de 512" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -504,6 +504,7 @@ msgstr "Impossible de définir CCCD sur une caractéristique locale" #: shared-bindings/_bleio/Adapter.c msgid "Cannot create a new Adapter; use _bleio.adapter;" msgstr "" +"Un nouveau Adapter ne peut être créé ; Adapter; utilisez _bleio.adapter;" #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c @@ -598,7 +599,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "CircuitPython was unable to allocate the heap.\n" -msgstr "" +msgstr "CircuitPython n'as pu faire l'allocation de la pile\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." @@ -784,7 +785,7 @@ msgstr "Une 'Characteristic' est attendue" #: shared-bindings/_bleio/Adapter.c msgid "Expected a DigitalInOut" -msgstr "" +msgstr "Un 'DigitalInOut' est attendu" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" @@ -792,7 +793,7 @@ msgstr "Attendu un service" #: shared-bindings/_bleio/Adapter.c msgid "Expected a UART" -msgstr "" +msgstr "Un 'UART' est attendu" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c @@ -3391,7 +3392,7 @@ msgstr "spécification %c de conversion inconnue" #: py/objstr.c msgid "unknown format code '%c' for object of type '%q'" -msgstr "" +msgstr "code de formatage inconnu '%c' pour objet de type '%q'" #: py/compile.c msgid "unknown type" @@ -3431,7 +3432,7 @@ msgstr "caractère de format '%c' (0x%x) non supporté à l'index %d" #: py/runtime.c msgid "unsupported type for %q: '%q'" -msgstr "" +msgstr "type non supporté pour %q: '%q'" #: py/runtime.c msgid "unsupported type for operator" @@ -3439,7 +3440,7 @@ msgstr "type non supporté pour l'opérateur" #: py/runtime.c msgid "unsupported types for %q: '%q', '%q'" -msgstr "" +msgstr "types non supportés pour %q: '%q', '%q'" #: py/objint.c #, c-format @@ -3452,7 +3453,7 @@ msgstr "'value_count' doit être > 0" #: extmod/ulab/code/linalg/linalg.c msgid "vectors must have same lengths" -msgstr "" +msgstr "les vecteurs doivent avoir la même longueur" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" From aeec662fef2ec47384be9f3f87ed0cd8a3a56e87 Mon Sep 17 00:00:00 2001 From: Maciej Stankiewicz Date: Wed, 16 Sep 2020 10:41:07 +0000 Subject: [PATCH 0911/1293] Translated using Weblate (Polish) Currently translated at 71.3% (567 of 795 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pl/ --- locale/pl.po | 199 +++++++++++++++++++++++++++------------------------ 1 file changed, 105 insertions(+), 94 deletions(-) diff --git a/locale/pl.po b/locale/pl.po index 8b4fceee4a..d616378fbf 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,13 +7,16 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-13 14:21-0500\n" -"PO-Revision-Date: 2019-03-19 18:37-0700\n" -"Last-Translator: Radomir Dopieralski \n" +"PO-Revision-Date: 2020-09-16 13:47+0000\n" +"Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" "Language: pl\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==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " +"|| n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 4.3-dev\n" #: main.c msgid "" @@ -78,7 +81,7 @@ msgstr "" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" -msgstr "" +msgstr "%q musi być >= 0" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -90,7 +93,7 @@ msgstr "%q musi być >= 1" #: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "" +msgstr "%q musi być krotką o długości 2" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q pin invalid" @@ -114,7 +117,7 @@ msgstr "" #: py/proto.c msgid "'%q' object does not support '%q'" -msgstr "" +msgstr "Obiekt '%q' nie wspiera '%q'" #: py/obj.c msgid "'%q' object does not support item assignment" @@ -126,19 +129,19 @@ msgstr "" #: py/runtime.c msgid "'%q' object has no attribute '%q'" -msgstr "" +msgstr "Obiekt '%q' nie ma atrybutu '%q'" #: py/runtime.c msgid "'%q' object is not an iterator" -msgstr "" +msgstr "Obiekt '%q' nie jest iteratorem" #: py/objtype.c py/runtime.c msgid "'%q' object is not callable" -msgstr "" +msgstr "Obiekt '%q' nie jest wywoływalny" #: py/runtime.c msgid "'%q' object is not iterable" -msgstr "" +msgstr "Obiekt '%q' nie jest iterowalny" #: py/obj.c msgid "'%q' object is not subscriptable" @@ -212,7 +215,7 @@ msgstr "'await' poza funkcją" #: py/compile.c msgid "'await', 'async for' or 'async with' outside async function" -msgstr "" +msgstr "'await', 'async for' lub 'async with' poza funkcją asynchroniczną" #: py/compile.c msgid "'break' outside loop" @@ -359,7 +362,7 @@ msgstr "" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" -msgstr "" +msgstr "Próba przydzielenia %d bloków" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." @@ -367,7 +370,7 @@ msgstr "" #: shared-bindings/wifi/Radio.c msgid "Authentication failure" -msgstr "" +msgstr "Błąd autoryzacji" #: main.c msgid "Auto-reload is off.\n" @@ -396,7 +399,7 @@ msgstr "Głębia musi być wielokrotnością 8." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "" +msgstr "Do kontroli przepływu wymagane są zarówno RX, jak i TX" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -406,7 +409,7 @@ msgstr "Obie nóżki muszą wspierać przerwania sprzętowe" #: shared-bindings/framebufferio/FramebufferDisplay.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "" +msgstr "Jasność musi wynosić 0-1,0" #: shared-bindings/supervisor/__init__.c msgid "Brightness must be between 0 and 255" @@ -435,21 +438,21 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" -msgstr "" +msgstr "Bufor jest za mały" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "" +msgstr "Długość %d bufora jest za duża. Musi być ona mniejsza niż %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" -msgstr "" +msgstr "Długość bufora musi być wielokrotnością 512" #: ports/stm/common-hal/sdioio/SDCard.c msgid "Buffer must be a multiple of 512 bytes" -msgstr "" +msgstr "Bufor musi być wielokrotnością 512 bajtów" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -457,12 +460,12 @@ msgstr "Bufor musi mieć długość 1 lub więcej" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Buffer too large and unable to allocate" -msgstr "" +msgstr "Bufor jest zbyt duży i nie można go przydzielić" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "" +msgstr "Bufor za krótki o %d bajtów" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -480,7 +483,7 @@ msgstr "Bytes musi być między 0 a 255." #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "Bloki CBC muszą być wielokrotnościami 16 bajtów" #: py/objtype.c msgid "Call super().__init__() before accessing native object." @@ -520,7 +523,7 @@ msgstr "Nie można mieć obu kanałów na tej samej nóżce" #: shared-module/bitbangio/SPI.c msgid "Cannot read without MISO pin." -msgstr "Nie można czytać bez nóżki MISO" +msgstr "Nie można czytać bez nóżki MISO." #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" @@ -538,11 +541,11 @@ msgstr "Nie można zrestartować -- nie ma bootloadera." #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." -msgstr "Nie można ustawić wartości w trybie wejścia" +msgstr "Nie można ustawić wartości w trybie wejścia." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "" +msgstr "Nie można określić RTS ani CTS w trybie RS485" #: py/objslice.c msgid "Cannot subclass slice" @@ -558,7 +561,7 @@ msgstr "Wielkość skalara jest niejednoznaczna" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" +msgstr "Nie można zmieniać częstotliwości timera, który jest już używany" #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." @@ -577,14 +580,16 @@ msgid "" "CircuitPython is in safe mode because you pressed the reset button during " "boot. Press again to exit safe mode.\n" msgstr "" +"CircuitPython jest w trybie awaryjnym, ponieważ podczas rozruchu naciśnięto " +"przycisk resetowania. Naciśnij ponownie, aby wyjść z trybu awaryjnego.\n" #: supervisor/shared/safe_mode.c msgid "CircuitPython was unable to allocate the heap.\n" -msgstr "" +msgstr "CircuitPython nie mógł przydzielić sterty.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." -msgstr "Nie powiodło się ustawienie nóżki zegara" +msgstr "Inicjalizacja nóżki zegara nie powiodła się." #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" @@ -608,10 +613,12 @@ msgid "" "Connection has been disconnected and can no longer be used. Create a new " "connection." msgstr "" +"Połączenie zostało rozłączone i nie można go już używać. Utwórz nowe " +"połączenie." #: py/persistentcode.c msgid "Corrupt .mpy file" -msgstr "" +msgstr "Uszkodzony plik .mpy" #: py/emitglue.c msgid "Corrupt raw code" @@ -619,11 +626,11 @@ msgstr "" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" -msgstr "" +msgstr "Nie można zainicjować GNSS" #: ports/cxd56/common-hal/sdioio/SDCard.c msgid "Could not initialize SDCard" -msgstr "" +msgstr "Nie można zainicjować SDCard" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" @@ -647,15 +654,15 @@ msgstr "" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" -msgstr "" +msgstr "Nie można zrestartować PWM" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" -msgstr "" +msgstr "Nie można ustawić adresu" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" -msgstr "" +msgstr "Nie można wystartować PWM" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" @@ -714,7 +721,7 @@ msgstr "Pojemność celu mniejsza od destination_length." #: ports/nrf/common-hal/audiobusio/I2SOut.c msgid "Device in use" -msgstr "" +msgstr "Urządzenie w użyciu" #: ports/cxd56/common-hal/digitalio/DigitalInOut.c msgid "DigitalInOut not supported on given pin" @@ -798,12 +805,12 @@ msgstr "" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." -msgstr "" +msgstr "Nie udało się wysłać polecenia." #: ports/nrf/sd_mutex.c -#, fuzzy, c-format +#, c-format msgid "Failed to acquire mutex, err 0x%04x" -msgstr "Nie udało się uzyskać blokady, błąd 0x$04x" +msgstr "Nie udało się uzyskać blokady, błąd 0x%04x" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" @@ -820,11 +827,11 @@ msgstr "Nie udała się alokacja %d bajtów na bufor RX" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" -msgstr "" +msgstr "Nie udało się połączyć: błąd wewnętrzny" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: timeout" -msgstr "" +msgstr "Nie udało się połączyć: upłynął limit czasu" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" @@ -837,7 +844,7 @@ msgstr "Nie udało się zwolnić blokady, błąd 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "" +msgstr "Nie udało się zapisać wewnętrznej pamięci flash." #: py/moduerrno.c msgid "File exists" @@ -846,7 +853,7 @@ msgstr "Plik istnieje" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" -msgstr "" +msgstr "Bufor ramki wymaga %d bajtów" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." @@ -865,7 +872,7 @@ msgstr "Funkcja wymaga blokady" #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" -msgstr "" +msgstr "Grupa już używana" #: shared-module/displayio/Group.c msgid "Group full" @@ -886,7 +893,7 @@ msgstr "Operacja I/O na zamkniętym pliku" #: ports/stm/common-hal/busio/I2C.c msgid "I2C Init Error" -msgstr "" +msgstr "Błąd inicjalizacji I2C" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" @@ -915,11 +922,11 @@ msgstr "Błąd I/O" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" -msgstr "" +msgstr "Niewystarczające uwierzytelnienie" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" -msgstr "" +msgstr "Niewystarczające szyfrowanie" #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" @@ -928,7 +935,7 @@ msgstr "" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format msgid "Internal error #%d" -msgstr "" +msgstr "Błąd wewnętrzny #%d" #: shared-bindings/sdioio/SDCard.c msgid "Invalid %q" @@ -988,7 +995,7 @@ msgstr "Zła liczba kanałów" #: shared-bindings/digitalio/DigitalInOut.c msgid "Invalid direction." -msgstr "Zły tryb" +msgstr "Nieprawidłowy kierunek." #: shared-module/audiocore/WaveFile.c msgid "Invalid file" @@ -1000,11 +1007,11 @@ msgstr "Zła wielkość fragmentu formatu" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" -msgstr "" +msgstr "Podano nieprawidłową częstotliwość" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "" +msgstr "Nieprawidłowy dostęp do pamięci." #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid number of bits" @@ -1043,7 +1050,7 @@ msgstr "Złe nóżki" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" -msgstr "" +msgstr "Nieprawidłowe piny dla PWMOut" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c @@ -1052,11 +1059,11 @@ msgstr "Zła polaryzacja" #: shared-bindings/_bleio/Characteristic.c msgid "Invalid properties" -msgstr "" +msgstr "Nieprawidłowe właściwości" #: shared-bindings/microcontroller/__init__.c msgid "Invalid run mode." -msgstr "Zły tryb uruchomienia" +msgstr "Zły tryb uruchomienia." #: shared-module/_bleio/Attribute.c msgid "Invalid security_mode" @@ -1076,11 +1083,11 @@ msgstr "Zły plik wave" #: ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" -msgstr "" +msgstr "Niepoprawna długość słowa/bitu" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" -msgstr "" +msgstr "Klucz musi mieć długość 16, 24 lub 32 bajtów" #: py/compile.c msgid "LHS of keyword arg must be an id" @@ -1108,7 +1115,7 @@ msgstr "Nie powiodło się ustawienie nóżki MISO." #: shared-module/bitbangio/SPI.c msgid "MOSI pin init failed." -msgstr "Nie powiodło się ustawienie nóżki MOSI" +msgstr "Nie powiodło się ustawienie nóżki MOSI." #: shared-module/displayio/Shape.c #, c-format @@ -1118,10 +1125,11 @@ msgstr "Największa wartość x przy odwróceniu to %d" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" +"Skok MicroRython NLR nie powiódł się. Prawdopodobne uszkodzenie pamięci." #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error." -msgstr "" +msgstr "Błąd krytyczny MicroPython." #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -1137,11 +1145,11 @@ msgstr "" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" -msgstr "" +msgstr "Należy podać pin MISO lub MOSI" #: ports/stm/common-hal/busio/SPI.c msgid "Must provide SCK pin" -msgstr "" +msgstr "Należy podać pin SCK" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1150,7 +1158,7 @@ msgstr "" #: py/parse.c msgid "Name too long" -msgstr "" +msgstr "Za długa nazwa" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" @@ -1192,7 +1200,7 @@ msgstr "Brak wolnych zegarów" #: shared-bindings/_bleio/PacketBuffer.c msgid "No connection: length cannot be determined" -msgstr "" +msgstr "Brak połączenia: nie można ustalić długości" #: shared-bindings/board/__init__.c msgid "No default %q bus" @@ -1217,7 +1225,7 @@ msgstr "Brak sprzętowej obsługi na nóżce" #: shared-bindings/aesio/aes.c msgid "No key was specified" -msgstr "" +msgstr "Nie określono klucza" #: shared-bindings/time/__init__.c msgid "No long integer support" @@ -1320,7 +1328,7 @@ msgstr "Nie można zmienić częstotliwości PWM gdy variable_frequency=False." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" -msgstr "" +msgstr "ParallelBus nie jest jeszcze obsługiwany" #: py/moduerrno.c msgid "Permission denied" @@ -1340,7 +1348,7 @@ msgstr "" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" -msgstr "" +msgstr "Pin musi obsługiwać przerwania sprzętowe" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" @@ -1428,11 +1436,11 @@ msgstr "Obiekt tylko do odczytu" #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" -msgstr "" +msgstr "Zbyt wczesne odświeżenie" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" -msgstr "" +msgstr "Żądany tryb AES nie jest obsługiwany" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" @@ -1467,11 +1475,11 @@ msgstr "" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" -msgstr "" +msgstr "Błąd inicjowania SPI" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Re-initialization error" -msgstr "" +msgstr "Błąd ponownej inicjalizacji SPI" #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" @@ -1484,7 +1492,7 @@ msgstr "Zbyt wysoka częstotliwość próbkowania. Musi być mniejsza niż %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." -msgstr "" +msgstr "Skanuj już w toku. Zatrzymaj za pomocą stop_scan." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" @@ -1516,7 +1524,7 @@ msgstr "Fragmenty nieobsługiwane" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "" +msgstr "Bufory źródłowy i docelowy muszą mieć taką samą długość" #: extmod/modure.c msgid "Splitting with sub-captures" @@ -1567,7 +1575,7 @@ msgstr "Wartość bits_per_sample nie pasuje do miksera" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's channel count does not match the mixer's" -msgstr "Liczba kanałów nie pasuje do miksera " +msgstr "Liczba kanałów nie pasuje do miksera" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's sample rate does not match the mixer's" @@ -1633,7 +1641,7 @@ msgstr "Wymagana krotka lub struct_time" #: ports/stm/common-hal/busio/UART.c msgid "UART Buffer allocation error" -msgstr "" +msgstr "Błąd alokacji bufora UART" #: ports/stm/common-hal/busio/UART.c msgid "UART De-init error" @@ -1700,7 +1708,7 @@ msgstr "Błąd zapisu do NVM." #: ports/nrf/common-hal/_bleio/UUID.c msgid "Unexpected nrfx uuid type" -msgstr "Nieoczekiwany typ nrfx uuid." +msgstr "Nieoczekiwany typ nrfx uuid" #: shared-bindings/wifi/Radio.c msgid "Unknown failure" @@ -1793,7 +1801,7 @@ msgstr "" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" +msgstr "WatchDogTimer.timeout musi być większe od 0" #: supervisor/shared/safe_mode.c msgid "Watchdog timer expired." @@ -1808,9 +1816,12 @@ msgid "" "\n" "To list built-in modules please do `help(\"modules\")`.\n" msgstr "" -"Witamy w CircuitPythonie Adafruita %s!\n" -"Podręczniki dostępne na learn.adafruit.com/category/circuitpyhon.\n" -"Aby zobaczyć wbudowane moduły, wpisz `help(\"modules\")`.\n" +"Witamy w Adafruit CircuitPython %s!\n" +"\n" +"Aby zapoznać się z przewodnikami do projektu, odwiedź stronę learn.adafruit." +"com/category/circuitpython.\n" +"\n" +"Aby wyświetlić listę wbudowanych modułów, wpisz `help(\"modules\")`.\n" #: shared-bindings/wifi/Radio.c msgid "WiFi password must be between 8 and 63 characters" @@ -2026,7 +2037,7 @@ msgstr "przypisanie do wyrażenia" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c #: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" -msgstr "" +msgstr "nie można dokonać konwersji %q na %q" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" @@ -2216,7 +2227,7 @@ msgstr "" #: shared-module/sdcardio/SDCard.c msgid "couldn't determine SD card version" -msgstr "" +msgstr "nie można określić wersji karty SD" #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" @@ -2365,11 +2376,11 @@ msgstr "" #: extmod/ulab/code/approx/approx.c msgid "first argument must be a function" -msgstr "" +msgstr "pierwszy argument musi być funkcją" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" -msgstr "" +msgstr "pierwszy argument musi być iterowalny" #: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" @@ -2489,7 +2500,7 @@ msgstr "złe wypełnienie" #: extmod/ulab/code/ndarray.c msgid "index is out of bounds" -msgstr "" +msgstr "indeks jest poza zakresem" #: py/obj.c msgid "index out of range" @@ -2505,11 +2516,11 @@ msgstr "" #: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" -msgstr "" +msgstr "wartości początkowe muszą być iterowalne" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "initial_value length is wrong" -msgstr "" +msgstr "długość initial_value jest nieprawidłowa" #: py/compile.c msgid "inline assembler must be a function" @@ -2521,7 +2532,7 @@ msgstr "" #: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" -msgstr "" +msgstr "długość tablicy wejściowej musi być potęgą 2" #: extmod/ulab/code/poly/poly.c msgid "input data must be an iterable" @@ -2537,7 +2548,7 @@ msgstr "" #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" -msgstr "" +msgstr "wejście musi być macierzą kwadratową" #: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" @@ -2545,7 +2556,7 @@ msgstr "" #: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" -msgstr "" +msgstr "wektory wejściowe muszą być równej długości" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" @@ -2562,7 +2573,7 @@ msgstr "" #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" -msgstr "" +msgstr "interwał musi mieścić się w zakresie %s-%s" #: lib/netutils/netutils.c msgid "invalid arguments" @@ -2705,7 +2716,7 @@ msgstr "" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "max_length must be > 0" -msgstr "" +msgstr "max_length musi być > 0" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -2930,7 +2941,7 @@ msgstr "" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" -msgstr "" +msgstr "operacja nie jest obsługiwana dla danego typu" #: py/modbuiltins.c msgid "ord expects a character" @@ -3021,7 +3032,7 @@ msgstr "" #: extmod/ulab/code/fft/fft.c msgid "real and imaginary parts must be of equal length" -msgstr "" +msgstr "rzeczywiste i urojone części muszą mieć jednakową długość" #: py/builtinimport.c msgid "relative import" @@ -3231,7 +3242,7 @@ msgstr "zbyt wiele argumentów podanych dla tego formatu" #: extmod/ulab/code/ndarray.c msgid "too many indices" -msgstr "" +msgstr "zbyt wiele indeksów" #: py/runtime.c #, c-format @@ -3367,7 +3378,7 @@ msgstr "value_count musi być > 0" #: extmod/ulab/code/linalg/linalg.c msgid "vectors must have same lengths" -msgstr "" +msgstr "wektory muszą mieć identyczną długość" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" @@ -3379,11 +3390,11 @@ msgstr "" #: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" -msgstr "" +msgstr "zły typ argumentu" #: extmod/ulab/code/ndarray.c msgid "wrong index type" -msgstr "" +msgstr "zły typ indeksu" #: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" From e1071bb14ab269e2dfea95f3419e77ed53bb3c05 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 16 Sep 2020 15:47:44 +0200 Subject: [PATCH 0912/1293] 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/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/sv.po | 4 ++++ locale/zh_Latn_pinyin.po | 4 ++++ 16 files changed, 64 insertions(+) diff --git a/locale/ID.po b/locale/ID.po index 5fd0647a14..5b9354b5a9 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -926,6 +926,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "Ukuran penyangga salah" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "Input taking too long" +msgstr "" + #: py/moduerrno.c msgid "Input/output error" msgstr "Kesalahan input/output" diff --git a/locale/cs.po b/locale/cs.po index 8dcf08cf2a..33fa668c50 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -909,6 +909,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "Input taking too long" +msgstr "" + #: py/moduerrno.c msgid "Input/output error" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index d9f80769ea..83cb537fa0 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -926,6 +926,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "Inkorrekte Puffergröße" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "Input taking too long" +msgstr "" + #: py/moduerrno.c msgid "Input/output error" msgstr "Eingabe-/Ausgabefehler" diff --git a/locale/el.po b/locale/el.po index 6f5ae88e04..4aee93220d 100644 --- a/locale/el.po +++ b/locale/el.po @@ -904,6 +904,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "Input taking too long" +msgstr "" + #: py/moduerrno.c msgid "Input/output error" msgstr "" diff --git a/locale/es.po b/locale/es.po index 85b4e758df..e6d321c31e 100644 --- a/locale/es.po +++ b/locale/es.po @@ -927,6 +927,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "Tamaño incorrecto del buffer" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "Input taking too long" +msgstr "" + #: py/moduerrno.c msgid "Input/output error" msgstr "error Input/output" diff --git a/locale/fil.po b/locale/fil.po index e630fddee3..7e8ee19907 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -919,6 +919,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "Input taking too long" +msgstr "" + #: py/moduerrno.c msgid "Input/output error" msgstr "May mali sa Input/Output" diff --git a/locale/fr.po b/locale/fr.po index 8f1965a6b8..d59eec51d4 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -932,6 +932,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "Taille de tampon incorrecte" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "Input taking too long" +msgstr "" + #: py/moduerrno.c msgid "Input/output error" msgstr "Erreur d'entrée/sortie" diff --git a/locale/hi.po b/locale/hi.po index c06eff81d9..34014d120b 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -904,6 +904,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "Input taking too long" +msgstr "" + #: py/moduerrno.c msgid "Input/output error" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 5ff22f8a63..128958c22b 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -919,6 +919,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "Input taking too long" +msgstr "" + #: py/moduerrno.c msgid "Input/output error" msgstr "Errore input/output" diff --git a/locale/ja.po b/locale/ja.po index db3839b402..91e4d46368 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -920,6 +920,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "バッファサイズが正しくありません" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "Input taking too long" +msgstr "" + #: py/moduerrno.c msgid "Input/output error" msgstr "入力/出力エラー" diff --git a/locale/ko.po b/locale/ko.po index 70b7985867..d371c9bbdc 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -907,6 +907,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "Input taking too long" +msgstr "" + #: py/moduerrno.c msgid "Input/output error" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 04d0ede837..f5fe492b67 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -921,6 +921,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "Incorrecte buffer grootte" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "Input taking too long" +msgstr "" + #: py/moduerrno.c msgid "Input/output error" msgstr "Input/Output fout" diff --git a/locale/pl.po b/locale/pl.po index d616378fbf..ff9f6e4b3d 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -916,6 +916,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "Niewłaściwa wielkość bufora" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "Input taking too long" +msgstr "" + #: py/moduerrno.c msgid "Input/output error" msgstr "Błąd I/O" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 70cecc395c..26392c8043 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -930,6 +930,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "O tamanho do buffer está incorreto" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "Input taking too long" +msgstr "" + #: py/moduerrno.c msgid "Input/output error" msgstr "Erro de entrada/saída" diff --git a/locale/sv.po b/locale/sv.po index cc3cd4593e..94e4d4f330 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -919,6 +919,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "Fel buffertstorlek" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "Input taking too long" +msgstr "" + #: py/moduerrno.c msgid "Input/output error" msgstr "Indata-/utdatafel" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 9b9c1414ac..c3f0a7e0d8 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -916,6 +916,10 @@ msgstr "" msgid "Incorrect buffer size" msgstr "Huǎnchōng qū dàxiǎo bù zhèngquè" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "Input taking too long" +msgstr "" + #: py/moduerrno.c msgid "Input/output error" msgstr "Shūrù/shūchū cuòwù" From 07f944bf6732646a2020f4ccdb803a428539bf39 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Wed, 16 Sep 2020 15:54:08 +0000 Subject: [PATCH 0913/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (796 of 796 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 26392c8043..0cef2c6360 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: 2020-09-13 14:21-0500\n" -"PO-Revision-Date: 2020-09-14 13:47+0000\n" +"PO-Revision-Date: 2020-09-16 16:30+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -932,7 +932,7 @@ msgstr "O tamanho do buffer está incorreto" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" -msgstr "" +msgstr "A entrada está demorando demais" #: py/moduerrno.c msgid "Input/output error" From 22becafde9c012a374c29c11bcb8cd0fc2d7b5c4 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 16 Sep 2020 18:30:09 +0200 Subject: [PATCH 0914/1293] 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/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/sv.po | 16 ++++++++++++++-- locale/zh_Latn_pinyin.po | 16 ++++++++++++++-- 16 files changed, 224 insertions(+), 32 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 5b9354b5a9..cbf59dc8c6 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"POT-Creation-Date: 2020-09-11 13:30+0200\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -436,7 +436,7 @@ msgstr "Ukuran buffer salah. Seharusnya %d byte." msgid "Buffer is not a bytearray." msgstr "Buffer bukan bytearray." -#: shared-bindings/displayio/Display.c +#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "Buffer terlalu kecil" @@ -632,6 +632,10 @@ msgstr "File .mpy rusak" msgid "Corrupt raw code" msgstr "Kode raw rusak" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Could not initialize Camera" +msgstr "" + #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" msgstr "" @@ -859,6 +863,10 @@ msgstr "Gagal menulis flash internal." msgid "File exists" msgstr "File sudah ada" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Format not supported" +msgstr "" + #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" @@ -1528,6 +1536,10 @@ msgstr "Serializer sedang digunakan" msgid "Server side context cannot have hostname" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Size not supported" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 33fa668c50..5f6a46a3bb 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"POT-Creation-Date: 2020-09-11 13:30+0200\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -434,7 +434,7 @@ msgstr "" msgid "Buffer is not a bytearray." msgstr "" -#: shared-bindings/displayio/Display.c +#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "" @@ -619,6 +619,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Could not initialize Camera" +msgstr "" + #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" msgstr "" @@ -845,6 +849,10 @@ msgstr "" msgid "File exists" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Format not supported" +msgstr "" + #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" @@ -1507,6 +1515,10 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Size not supported" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 83cb537fa0..0e9511f125 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"POT-Creation-Date: 2020-09-11 13:30+0200\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -437,7 +437,7 @@ msgstr "Der Puffergröße ist inkorrekt. Sie sollte %d bytes haben." msgid "Buffer is not a bytearray." msgstr "Der Buffer ist kein Byte-Array." -#: shared-bindings/displayio/Display.c +#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "Der Puffer ist zu klein" @@ -629,6 +629,10 @@ msgstr "Beschädigte .mpy Datei" msgid "Corrupt raw code" msgstr "Beschädigter raw code" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Could not initialize Camera" +msgstr "" + #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" msgstr "" @@ -856,6 +860,10 @@ msgstr "Interner Flash konnte nicht geschrieben werden." msgid "File exists" msgstr "Datei existiert" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Format not supported" +msgstr "" + #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" @@ -1537,6 +1545,10 @@ msgstr "Serializer wird benutzt" msgid "Server side context cannot have hostname" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Size not supported" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Slice und Wert (value) haben unterschiedliche Längen." diff --git a/locale/el.po b/locale/el.po index 4aee93220d..10efe96a7c 100644 --- a/locale/el.po +++ b/locale/el.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"POT-Creation-Date: 2020-09-11 13:30+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -429,7 +429,7 @@ msgstr "" msgid "Buffer is not a bytearray." msgstr "" -#: shared-bindings/displayio/Display.c +#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "" @@ -614,6 +614,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Could not initialize Camera" +msgstr "" + #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" msgstr "" @@ -840,6 +844,10 @@ msgstr "" msgid "File exists" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Format not supported" +msgstr "" + #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" @@ -1502,6 +1510,10 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Size not supported" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" diff --git a/locale/es.po b/locale/es.po index e6d321c31e..1e312d7c8e 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"POT-Creation-Date: 2020-09-11 13:30+0200\n" "PO-Revision-Date: 2020-08-17 21:11+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -443,7 +443,7 @@ msgstr "Tamaño de buffer incorrecto. Debe ser de %d bytes." msgid "Buffer is not a bytearray." msgstr "Buffer no es un bytearray." -#: shared-bindings/displayio/Display.c +#: 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" @@ -634,6 +634,10 @@ msgstr "Archivo .mpy corrupto" msgid "Corrupt raw code" msgstr "Código crudo corrupto" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Could not initialize Camera" +msgstr "" + #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" msgstr "No se pudo inicializar el GNSS" @@ -860,6 +864,10 @@ msgstr "Error al escribir al flash interno." msgid "File exists" msgstr "El archivo ya existe" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Format not supported" +msgstr "" + #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" @@ -1536,6 +1544,10 @@ msgstr "Serializer está siendo utilizado" msgid "Server side context cannot have hostname" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Size not supported" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Slice y value tienen tamaños diferentes." diff --git a/locale/fil.po b/locale/fil.po index 7e8ee19907..09efc42440 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"POT-Creation-Date: 2020-09-11 13:30+0200\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -434,7 +434,7 @@ msgstr "Mali ang size ng buffer. Dapat %d bytes." msgid "Buffer is not a bytearray." msgstr "" -#: shared-bindings/displayio/Display.c +#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "" @@ -622,6 +622,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Could not initialize Camera" +msgstr "" + #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" msgstr "" @@ -853,6 +857,10 @@ msgstr "" msgid "File exists" msgstr "Mayroong file" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Format not supported" +msgstr "" + #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" @@ -1524,6 +1532,10 @@ msgstr "Serializer ginagamit" msgid "Server side context cannot have hostname" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Size not supported" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Slice at value iba't ibang haba." diff --git a/locale/fr.po b/locale/fr.po index d59eec51d4..e602facaf2 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"POT-Creation-Date: 2020-09-11 13:30+0200\n" "PO-Revision-Date: 2020-09-16 13:47+0000\n" "Last-Translator: Hugo Dahl \n" "Language: fr\n" @@ -443,7 +443,7 @@ msgstr "Tampon de taille incorrect. Devrait être de %d octets." msgid "Buffer is not a bytearray." msgstr "Le tampon n'est pas un 'bytearray'." -#: shared-bindings/displayio/Display.c +#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "Le tampon est trop petit" @@ -638,6 +638,10 @@ msgstr "Fichier .mpy corrompu" msgid "Corrupt raw code" msgstr "Code brut corrompu" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Could not initialize Camera" +msgstr "" + #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" msgstr "Impossible d'initialiser GNSS" @@ -865,6 +869,10 @@ msgstr "Échec de l'écriture du flash interne." msgid "File exists" msgstr "Le fichier existe" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Format not supported" +msgstr "" + #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" @@ -1543,6 +1551,10 @@ msgstr "Sérialiseur en cours d'utilisation" msgid "Server side context cannot have hostname" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Size not supported" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Tranche et valeur de tailles différentes." diff --git a/locale/hi.po b/locale/hi.po index 34014d120b..17048b1a6d 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"POT-Creation-Date: 2020-09-11 13:30+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -429,7 +429,7 @@ msgstr "" msgid "Buffer is not a bytearray." msgstr "" -#: shared-bindings/displayio/Display.c +#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "" @@ -614,6 +614,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Could not initialize Camera" +msgstr "" + #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" msgstr "" @@ -840,6 +844,10 @@ msgstr "" msgid "File exists" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Format not supported" +msgstr "" + #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" @@ -1502,6 +1510,10 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Size not supported" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 128958c22b..b190f976b6 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"POT-Creation-Date: 2020-09-11 13:30+0200\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -434,7 +434,7 @@ msgstr "Buffer di lunghezza non valida. Dovrebbe essere di %d bytes." msgid "Buffer is not a bytearray." msgstr "" -#: shared-bindings/displayio/Display.c +#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "" @@ -623,6 +623,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Could not initialize Camera" +msgstr "" + #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" msgstr "" @@ -853,6 +857,10 @@ msgstr "" msgid "File exists" msgstr "File esistente" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Format not supported" +msgstr "" + #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" @@ -1535,6 +1543,10 @@ msgstr "Serializer in uso" msgid "Server side context cannot have hostname" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Size not supported" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 91e4d46368..0f9bd3be60 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"POT-Creation-Date: 2020-09-11 13:30+0200\n" "PO-Revision-Date: 2020-09-01 18:44+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: none\n" @@ -439,7 +439,7 @@ msgstr "バッファサイズが正しくありません。%dバイトでなけ msgid "Buffer is not a bytearray." msgstr "バッファが bytearray ではありません" -#: shared-bindings/displayio/Display.c +#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "バッファが小さすぎます" @@ -628,6 +628,10 @@ msgstr "破損した .mpy ファイル" msgid "Corrupt raw code" msgstr "破損したraw code" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Could not initialize Camera" +msgstr "" + #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" msgstr "GNSSを初期化できません" @@ -854,6 +858,10 @@ msgstr "内部フラッシュの書き込みに失敗" msgid "File exists" msgstr "ファイルが存在します" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Format not supported" +msgstr "" + #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" @@ -1522,6 +1530,10 @@ msgstr "シリアライザは使用中" msgid "Server side context cannot have hostname" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Size not supported" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "スライスと値の長さが一致しません" diff --git a/locale/ko.po b/locale/ko.po index d371c9bbdc..0bdf7c742d 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"POT-Creation-Date: 2020-09-11 13:30+0200\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -432,7 +432,7 @@ msgstr "잘못된 크기의 버퍼. %d 바이트 여야합니다." msgid "Buffer is not a bytearray." msgstr "" -#: shared-bindings/displayio/Display.c +#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "" @@ -617,6 +617,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Could not initialize Camera" +msgstr "" + #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" msgstr "" @@ -843,6 +847,10 @@ msgstr "" msgid "File exists" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Format not supported" +msgstr "" + #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" @@ -1505,6 +1513,10 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Size not supported" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "" diff --git a/locale/nl.po b/locale/nl.po index f5fe492b67..e0b4d8793a 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"POT-Creation-Date: 2020-09-11 13:30+0200\n" "PO-Revision-Date: 2020-09-09 16:05+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -436,7 +436,7 @@ msgstr "Buffer heeft incorrect grootte. Moet %d bytes zijn." msgid "Buffer is not a bytearray." msgstr "Buffer is geen bytearray." -#: shared-bindings/displayio/Display.c +#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "Buffer is te klein" @@ -627,6 +627,10 @@ msgstr "Corrupt .mpy bestand" msgid "Corrupt raw code" msgstr "Corrupt raw code" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Could not initialize Camera" +msgstr "" + #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" msgstr "Kan GNSS niet initialiseren" @@ -853,6 +857,10 @@ msgstr "Schrijven naar interne flash mislukt." msgid "File exists" msgstr "Bestand bestaat" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Format not supported" +msgstr "" + #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" @@ -1533,6 +1541,10 @@ msgstr "Serializer in gebruik" msgid "Server side context cannot have hostname" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Size not supported" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Slice en waarde hebben verschillende lengtes." diff --git a/locale/pl.po b/locale/pl.po index ff9f6e4b3d..afecdaf4fb 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"POT-Creation-Date: 2020-09-11 13:30+0200\n" "PO-Revision-Date: 2020-09-16 13:47+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -435,7 +435,7 @@ msgstr "Zła wielkość bufora. Powinno być %d bajtów." msgid "Buffer is not a bytearray." msgstr "" -#: shared-bindings/displayio/Display.c +#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "Bufor jest za mały" @@ -624,6 +624,10 @@ msgstr "Uszkodzony plik .mpy" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Could not initialize Camera" +msgstr "" + #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" msgstr "Nie można zainicjować GNSS" @@ -850,6 +854,10 @@ msgstr "Nie udało się zapisać wewnętrznej pamięci flash." msgid "File exists" msgstr "Plik istnieje" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Format not supported" +msgstr "" + #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" @@ -1515,6 +1523,10 @@ msgstr "Serializator w użyciu" msgid "Server side context cannot have hostname" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Size not supported" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Fragment i wartość są różnych długości." diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 0cef2c6360..89fd302163 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"POT-Creation-Date: 2020-09-11 13:30+0200\n" "PO-Revision-Date: 2020-09-16 16:30+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -444,7 +444,7 @@ msgstr "Buffer de tamanho incorreto. Deve ser %d bytes." msgid "Buffer is not a bytearray." msgstr "O buffer não é um bytearray." -#: shared-bindings/displayio/Display.c +#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "O buffer é muito pequeno" @@ -636,6 +636,10 @@ msgstr "Arquivo .mpy corrompido" msgid "Corrupt raw code" msgstr "Código bruto corrompido" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Could not initialize Camera" +msgstr "" + #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" msgstr "Não foi possível inicializar o GNSS" @@ -862,6 +866,10 @@ msgstr "Falha ao gravar o flash interno." msgid "File exists" msgstr "Arquivo já existe" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Format not supported" +msgstr "" + #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" @@ -1545,6 +1553,10 @@ msgstr "Serializer em uso" msgid "Server side context cannot have hostname" msgstr "O contexto do lado do servidor não pode ter nome de host" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Size not supported" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Fatie e avalie os diferentes comprimentos." diff --git a/locale/sv.po b/locale/sv.po index 94e4d4f330..8774e0734c 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"POT-Creation-Date: 2020-09-11 13:30+0200\n" "PO-Revision-Date: 2020-09-07 19:36+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -436,7 +436,7 @@ msgstr "Buffert har felaktig storlek. Ska vara %d byte." msgid "Buffer is not a bytearray." msgstr "Buffert är inte en bytearray." -#: shared-bindings/displayio/Display.c +#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "Bufferten är för liten" @@ -627,6 +627,10 @@ msgstr "Skadad .mpy-fil" msgid "Corrupt raw code" msgstr "Korrupt rå kod" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Could not initialize Camera" +msgstr "" + #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" msgstr "Kan inte initiera GNSS" @@ -853,6 +857,10 @@ msgstr "Det gick inte att skriva till intern flash." msgid "File exists" msgstr "Filen finns redan" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Format not supported" +msgstr "" + #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" @@ -1531,6 +1539,10 @@ msgstr "Serializern används redan" msgid "Server side context cannot have hostname" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Size not supported" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Slice och värde har olika längd." diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index c3f0a7e0d8..fe49abaf25 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-13 14:21-0500\n" +"POT-Creation-Date: 2020-09-11 13:30+0200\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -437,7 +437,7 @@ msgstr "Huǎnchōng qū dàxiǎo bù zhèngquè. Yīnggāi shì %d zì jié." msgid "Buffer is not a bytearray." msgstr "Huǎnchōng qū bùshì bytearray" -#: shared-bindings/displayio/Display.c +#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "Huǎnchōng qū tài xiǎo" @@ -624,6 +624,10 @@ msgstr "Fǔbài de .mpy wénjiàn" msgid "Corrupt raw code" msgstr "Sǔnhuài de yuánshǐ dàimǎ" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Could not initialize Camera" +msgstr "" + #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" msgstr "wú fǎ chū shǐ huà GNSS" @@ -850,6 +854,10 @@ msgstr "Wúfǎ xiě rù nèibù shǎncún." msgid "File exists" msgstr "Wénjiàn cúnzài" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Format not supported" +msgstr "" + #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" @@ -1523,6 +1531,10 @@ msgstr "Xùliè huà yǐjīng shǐyòngguò" msgid "Server side context cannot have hostname" msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Size not supported" +msgstr "" + #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." msgstr "Qiēpiàn hé zhí bùtóng chángdù." From 63ac3a5a435c011faa31055e0eb40fe5cf71cab4 Mon Sep 17 00:00:00 2001 From: Maciej Stankiewicz Date: Thu, 17 Sep 2020 07:54:17 +0000 Subject: [PATCH 0915/1293] Translated using Weblate (Polish) Currently translated at 73.2% (585 of 799 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pl/ --- locale/pl.po | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/locale/pl.po b/locale/pl.po index afecdaf4fb..1dc55ad825 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-11 13:30+0200\n" -"PO-Revision-Date: 2020-09-16 13:47+0000\n" +"PO-Revision-Date: 2020-09-17 17:58+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" "Language: pl\n" @@ -326,7 +326,7 @@ msgstr "" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" -msgstr "" +msgstr "AnalogIn nie jest obsługiwany na danym pinie" #: ports/cxd56/common-hal/analogio/AnalogOut.c #: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c @@ -443,7 +443,7 @@ msgstr "Bufor jest za mały" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "Długość %d bufora jest za duża. Musi być ona mniejsza niż %d" +msgstr "Długość %d bufora jest za duża. Musi być mniejsza niż %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c @@ -465,7 +465,7 @@ msgstr "Bufor jest zbyt duży i nie można go przydzielić" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "Bufor za krótki o %d bajtów" +msgstr "Bufor za krótki o% d bajtów" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -642,23 +642,23 @@ msgstr "Ustawienie UART nie powiodło się" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" -msgstr "" +msgstr "Nie można zainicjować kanału" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" -msgstr "" +msgstr "Nie można zainicjować timera" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" -msgstr "" +msgstr "Nie można ponownie zainicjować kanału" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" -msgstr "" +msgstr "Nie można ponownie zainicjować timera" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not restart PWM" -msgstr "Nie można zrestartować PWM" +msgstr "Nie można ponownie uruchomić PWM" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" @@ -666,11 +666,11 @@ msgstr "Nie można ustawić adresu" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" -msgstr "Nie można wystartować PWM" +msgstr "Nie można uruchomić PWM" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" -msgstr "" +msgstr "Nie można rozpocząć przerwania, RX jest zajęty" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" @@ -683,7 +683,7 @@ msgstr "Nie udała się alokacja pierwszego bufora" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate input buffer" -msgstr "" +msgstr "Nie można przydzielić bufora wejściowego" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -696,11 +696,11 @@ msgstr "" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" -msgstr "" +msgstr "Błąd inicjalizacji kanału DAC" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" -msgstr "" +msgstr "Błąd inicjowania urządzenia DAC" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -729,12 +729,12 @@ msgstr "Urządzenie w użyciu" #: ports/cxd56/common-hal/digitalio/DigitalInOut.c msgid "DigitalInOut not supported on given pin" -msgstr "" +msgstr "DigitalInOut nie jest obsługiwany na podanym pinie" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." -msgstr "" +msgstr "Wyświetlacz musi mieć 16-bitową przestrzeń kolorów." #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c @@ -748,7 +748,7 @@ msgstr "Tryb sterowania nieużywany w trybie wejścia." #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" -msgstr "" +msgstr "ECB działa tylko na 16 bajtach naraz" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -792,7 +792,7 @@ msgstr "Oczekiwano UUID" #: shared-bindings/_bleio/Adapter.c msgid "Expected an Address" -msgstr "" +msgstr "Oczekiwano adresu" #: shared-module/_pixelbuf/PixelBuf.c #, c-format @@ -839,7 +839,7 @@ msgstr "Nie udało się połączyć: upłynął limit czasu" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" -msgstr "" +msgstr "Nie można przeanalizować pliku MP3" #: ports/nrf/sd_mutex.c #, c-format @@ -889,11 +889,11 @@ msgstr "Grupa pełna" #: 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/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" -msgstr "" +msgstr "Sprzęt zajęty, wypróbuj alternatywne piny" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" -msgstr "" +msgstr "Sprzęt w użyciu, wypróbuj alternatywne piny" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -910,7 +910,7 @@ msgstr "" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "" +msgstr "IV musi mieć długość %d bajtów" #: py/persistentcode.c msgid "" @@ -1123,11 +1123,11 @@ msgstr "Długość musi być nieujemna" #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." -msgstr "Nie powiodło się ustawienie nóżki MISO." +msgstr "Nie powiodło się ustawienie pinu MISO." #: shared-module/bitbangio/SPI.c msgid "MOSI pin init failed." -msgstr "Nie powiodło się ustawienie nóżki MOSI." +msgstr "Nie powiodło się ustawienie pinu MOSI." #: shared-module/displayio/Shape.c #, c-format @@ -1188,7 +1188,7 @@ msgstr "Nie znaleziono kanału DMA" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" -msgstr "" +msgstr "Brak pinu MISO" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" From dd0f5f1b21f2a7919a1ec90c83214c1a39317706 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Wed, 16 Sep 2020 19:26:42 +0000 Subject: [PATCH 0916/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (799 of 799 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 89fd302163..e3f8fee72b 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: 2020-09-11 13:30+0200\n" -"PO-Revision-Date: 2020-09-16 16:30+0000\n" +"PO-Revision-Date: 2020-09-17 17:58+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -638,7 +638,7 @@ msgstr "Código bruto corrompido" #: ports/cxd56/common-hal/camera/Camera.c msgid "Could not initialize Camera" -msgstr "" +msgstr "Não foi possível inicializar a Câmera" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" @@ -868,7 +868,7 @@ msgstr "Arquivo já existe" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" -msgstr "" +msgstr "O formato não é suportado" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format @@ -1555,7 +1555,7 @@ msgstr "O contexto do lado do servidor não pode ter nome de host" #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" -msgstr "" +msgstr "O tamanho não é suportado" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." From fb123cebf2d4e60166516d72010db29e45d2e072 Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Fri, 18 Sep 2020 21:41:03 +0000 Subject: [PATCH 0917/1293] Translated using Weblate (Spanish) Currently translated at 100.0% (799 of 799 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 52 +++++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/locale/es.po b/locale/es.po index 1e312d7c8e..354311e8d2 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-11 13:30+0200\n" -"PO-Revision-Date: 2020-08-17 21:11+0000\n" +"PO-Revision-Date: 2020-09-18 23:14+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" @@ -16,7 +16,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.2-dev\n" +"X-Generator: Weblate 4.3-dev\n" #: main.c msgid "" @@ -378,7 +378,7 @@ msgstr "" #: shared-bindings/wifi/Radio.c msgid "Authentication failure" -msgstr "" +msgstr "Fallo de autenticación" #: main.c msgid "Auto-reload is off.\n" @@ -503,7 +503,7 @@ msgstr "No se puede configurar CCCD en la característica local" #: shared-bindings/_bleio/Adapter.c msgid "Cannot create a new Adapter; use _bleio.adapter;" -msgstr "" +msgstr "No se puede crear nuevo Adapter; use _bleio.adapter;" #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c @@ -595,7 +595,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "CircuitPython was unable to allocate the heap.\n" -msgstr "" +msgstr "CircuitPython no puedo encontrar el montículo.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." @@ -636,7 +636,7 @@ msgstr "Código crudo corrupto" #: ports/cxd56/common-hal/camera/Camera.c msgid "Could not initialize Camera" -msgstr "" +msgstr "No se puede inicializar Camera" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" @@ -785,7 +785,7 @@ msgstr "Se esperaba una Característica" #: shared-bindings/_bleio/Adapter.c msgid "Expected a DigitalInOut" -msgstr "" +msgstr "Se espera un DigitalInOut" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" @@ -793,7 +793,7 @@ msgstr "Se esperaba un servicio" #: shared-bindings/_bleio/Adapter.c msgid "Expected a UART" -msgstr "" +msgstr "Se espera un UART" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c @@ -866,7 +866,7 @@ msgstr "El archivo ya existe" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" -msgstr "" +msgstr "Sin capacidades para el formato" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format @@ -937,7 +937,7 @@ msgstr "Tamaño incorrecto del buffer" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" -msgstr "" +msgstr "La entrada está durando mucho tiempo" #: py/moduerrno.c msgid "Input/output error" @@ -1259,7 +1259,7 @@ msgstr "No hay más temporizadores disponibles en este pin." #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" -msgstr "" +msgstr "No hay una red con ese ssid" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" @@ -1283,7 +1283,7 @@ msgstr "fallo de aserción de dispositivo Nordic Soft." #: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c msgid "Not a valid IP string" -msgstr "" +msgstr "No es una cadena de IP válida" #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -1301,7 +1301,7 @@ msgstr "No ejecutando el código almacenado.\n" #: shared-bindings/_bleio/__init__.c msgid "Not settable" -msgstr "" +msgstr "No configurable" #: shared-bindings/util.c msgid "" @@ -1337,7 +1337,7 @@ msgstr "" #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" -msgstr "" +msgstr "Solo se aceptan enteros crudos para ip" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." @@ -1410,6 +1410,8 @@ msgid "" "Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " "instead" msgstr "" +"Port no acepta los pines o la frecuencia. Construya y pase en su lugar un " +"Carrier de PWMOut" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" @@ -1542,11 +1544,11 @@ msgstr "Serializer está siendo utilizado" #: shared-bindings/ssl/SSLContext.c msgid "Server side context cannot have hostname" -msgstr "" +msgstr "El contexto del lado del servidor no puede tener un hostname" #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" -msgstr "" +msgstr "Sin capacidades para el tamaño" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." @@ -1763,7 +1765,7 @@ msgstr "Tipo de uuid nrfx inesperado" #: shared-bindings/wifi/Radio.c msgid "Unknown failure" -msgstr "" +msgstr "Fallo desconocido" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format @@ -1881,7 +1883,7 @@ msgstr "" #: shared-bindings/wifi/Radio.c msgid "WiFi password must be between 8 and 63 characters" -msgstr "" +msgstr "La clave de WiFi debe ser entre 8 y 63 caracteres" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" @@ -2052,7 +2054,7 @@ msgstr "bytes > 8 bits no soportados" #: py/objarray.c msgid "bytes length not a multiple of item size" -msgstr "" +msgstr "el tamaño en bytes no es un múltiplo del tamaño del item" #: py/objstr.c msgid "bytes value out of range" @@ -2582,7 +2584,7 @@ msgstr "los valores iniciales deben permitir iteración" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "initial_value length is wrong" -msgstr "" +msgstr "el tamaño de initial_value es incorrecto" #: py/compile.c msgid "inline assembler must be a function" @@ -2781,7 +2783,7 @@ msgstr "max_length debe ser 0-%d cuando fixed_length es %s" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "max_length must be > 0" -msgstr "" +msgstr "max_lenght debe ser > 0" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3022,11 +3024,11 @@ msgstr "ord() espera un carácter, pero encontró un string de longitud %d" #: shared-bindings/displayio/Bitmap.c msgid "out of range of source" -msgstr "" +msgstr "fuera de rango de fuente" #: shared-bindings/displayio/Bitmap.c msgid "out of range of target" -msgstr "" +msgstr "fuera de rango del objetivo" #: py/objint_mpz.c msgid "overflow converting long int to machine word" @@ -3035,7 +3037,7 @@ msgstr "desbordamiento convirtiendo long int a palabra de máquina" #: py/modstruct.c #, c-format msgid "pack expected %d items for packing (got %d)" -msgstr "" +msgstr "pack espera %d items para empaquetado (se recibió %d)" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" @@ -3214,7 +3216,7 @@ msgstr "sosfilt requiere argumentos iterables" #: shared-bindings/displayio/Bitmap.c msgid "source palette too large" -msgstr "" +msgstr "paleta fuente muy larga" #: py/objstr.c msgid "start/end indices" From ed9173498f3d2e091aa576ff88a43a28f21fc29b Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Sat, 19 Sep 2020 03:31:34 +0200 Subject: [PATCH 0918/1293] 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 | 6 +++++- locale/cs.po | 6 +++++- locale/de_DE.po | 6 +++++- locale/el.po | 6 +++++- locale/es.po | 6 +++++- locale/fil.po | 6 +++++- locale/fr.po | 6 +++++- locale/hi.po | 6 +++++- locale/it_IT.po | 6 +++++- locale/ja.po | 6 +++++- locale/ko.po | 6 +++++- locale/nl.po | 6 +++++- locale/pl.po | 6 +++++- locale/pt_BR.po | 6 +++++- locale/sv.po | 6 +++++- locale/zh_Latn_pinyin.po | 6 +++++- 16 files changed, 80 insertions(+), 16 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index cbf59dc8c6..a13d97f9ec 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-11 13:30+0200\n" +"POT-Creation-Date: 2020-09-16 17:07-0700\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -981,6 +981,10 @@ msgstr "Nilai Unit ADC tidak valid" msgid "Invalid BMP file" msgstr "File BMP tidak valid" +#: shared-bindings/wifi/Radio.c +msgid "Invalid BSSID" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "Pin DAC yang diberikan tidak valid" diff --git a/locale/cs.po b/locale/cs.po index 5f6a46a3bb..8d0827b9a1 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-11 13:30+0200\n" +"POT-Creation-Date: 2020-09-16 17:07-0700\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -964,6 +964,10 @@ msgstr "" msgid "Invalid BMP file" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Invalid BSSID" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 0e9511f125..b1eefc98e8 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-11 13:30+0200\n" +"POT-Creation-Date: 2020-09-16 17:07-0700\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -981,6 +981,10 @@ msgstr "Ungültiger ADC-Einheitenwert" msgid "Invalid BMP file" msgstr "Ungültige BMP-Datei" +#: shared-bindings/wifi/Radio.c +msgid "Invalid BSSID" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "Ungültiger DAC-Pin angegeben" diff --git a/locale/el.po b/locale/el.po index 10efe96a7c..acdb64d5a5 100644 --- a/locale/el.po +++ b/locale/el.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-11 13:30+0200\n" +"POT-Creation-Date: 2020-09-16 17:07-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -959,6 +959,10 @@ msgstr "" msgid "Invalid BMP file" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Invalid BSSID" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" diff --git a/locale/es.po b/locale/es.po index 354311e8d2..990908b7c3 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-11 13:30+0200\n" +"POT-Creation-Date: 2020-09-16 17:07-0700\n" "PO-Revision-Date: 2020-09-18 23:14+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -982,6 +982,10 @@ msgstr "Valor de unidad de ADC no válido" msgid "Invalid BMP file" msgstr "Archivo BMP inválido" +#: shared-bindings/wifi/Radio.c +msgid "Invalid BSSID" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "Pin suministrado inválido para DAC" diff --git a/locale/fil.po b/locale/fil.po index 09efc42440..6ef8829981 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-11 13:30+0200\n" +"POT-Creation-Date: 2020-09-16 17:07-0700\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -974,6 +974,10 @@ msgstr "" msgid "Invalid BMP file" msgstr "Mali ang BMP file" +#: shared-bindings/wifi/Radio.c +msgid "Invalid BSSID" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index e602facaf2..d4a68c3f48 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-11 13:30+0200\n" +"POT-Creation-Date: 2020-09-16 17:07-0700\n" "PO-Revision-Date: 2020-09-16 13:47+0000\n" "Last-Translator: Hugo Dahl \n" "Language: fr\n" @@ -987,6 +987,10 @@ msgstr "Valeur d'unité ADC non valide" msgid "Invalid BMP file" msgstr "Fichier BMP invalide" +#: shared-bindings/wifi/Radio.c +msgid "Invalid BSSID" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "Broche DAC non valide fournie" diff --git a/locale/hi.po b/locale/hi.po index 17048b1a6d..b2a4bccafe 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-11 13:30+0200\n" +"POT-Creation-Date: 2020-09-16 17:07-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -959,6 +959,10 @@ msgstr "" msgid "Invalid BMP file" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Invalid BSSID" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index b190f976b6..146e4ced14 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-11 13:30+0200\n" +"POT-Creation-Date: 2020-09-16 17:07-0700\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -974,6 +974,10 @@ msgstr "" msgid "Invalid BMP file" msgstr "File BMP non valido" +#: shared-bindings/wifi/Radio.c +msgid "Invalid BSSID" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 0f9bd3be60..cd0ae7b50f 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-11 13:30+0200\n" +"POT-Creation-Date: 2020-09-16 17:07-0700\n" "PO-Revision-Date: 2020-09-01 18:44+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: none\n" @@ -975,6 +975,10 @@ msgstr "不正なADCユニット値" msgid "Invalid BMP file" msgstr "不正なBMPファイル" +#: shared-bindings/wifi/Radio.c +msgid "Invalid BSSID" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "不正なDACピンが与えられました" diff --git a/locale/ko.po b/locale/ko.po index 0bdf7c742d..4072553a60 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-11 13:30+0200\n" +"POT-Creation-Date: 2020-09-16 17:07-0700\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -962,6 +962,10 @@ msgstr "" msgid "Invalid BMP file" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Invalid BSSID" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index e0b4d8793a..d74a2e07d0 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-11 13:30+0200\n" +"POT-Creation-Date: 2020-09-16 17:07-0700\n" "PO-Revision-Date: 2020-09-09 16:05+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -976,6 +976,10 @@ msgstr "Ongeldige ADC Unit waarde" msgid "Invalid BMP file" msgstr "Ongeldig BMP bestand" +#: shared-bindings/wifi/Radio.c +msgid "Invalid BSSID" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "Ongeldige DAC pin opgegeven" diff --git a/locale/pl.po b/locale/pl.po index 1dc55ad825..2528b25e6f 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-11 13:30+0200\n" +"POT-Creation-Date: 2020-09-16 17:07-0700\n" "PO-Revision-Date: 2020-09-17 17:58+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -971,6 +971,10 @@ msgstr "" msgid "Invalid BMP file" msgstr "Zły BMP" +#: shared-bindings/wifi/Radio.c +msgid "Invalid BSSID" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e3f8fee72b..bff8ff948f 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-11 13:30+0200\n" +"POT-Creation-Date: 2020-09-16 17:07-0700\n" "PO-Revision-Date: 2020-09-17 17:58+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -985,6 +985,10 @@ msgstr "Valor inválido da unidade ADC" msgid "Invalid BMP file" msgstr "Arquivo BMP inválido" +#: shared-bindings/wifi/Radio.c +msgid "Invalid BSSID" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "O pino DAC informado é inválido" diff --git a/locale/sv.po b/locale/sv.po index 8774e0734c..a88c91b532 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-11 13:30+0200\n" +"POT-Creation-Date: 2020-09-16 17:07-0700\n" "PO-Revision-Date: 2020-09-07 19:36+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -974,6 +974,10 @@ msgstr "Ogiltigt ADC-enhetsvärde" msgid "Invalid BMP file" msgstr "Ogiltig BMP-fil" +#: shared-bindings/wifi/Radio.c +msgid "Invalid BSSID" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "Ogiltig DAC-pinne angiven" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index fe49abaf25..de19d2b602 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-11 13:30+0200\n" +"POT-Creation-Date: 2020-09-16 17:07-0700\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -971,6 +971,10 @@ msgstr "Wúxiào de ADC dānwèi zhí" msgid "Invalid BMP file" msgstr "Wúxiào de BMP wénjiàn" +#: shared-bindings/wifi/Radio.c +msgid "Invalid BSSID" +msgstr "" + #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "Tí gōng liǎo wúxiào de DAC yǐn jiǎo" From 54001079f7872047f06e1363b8b82436c172eb8a Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Sat, 19 Sep 2020 05:02:16 +0000 Subject: [PATCH 0919/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (800 of 800 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 bff8ff948f..2574786db8 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: 2020-09-16 17:07-0700\n" -"PO-Revision-Date: 2020-09-17 17:58+0000\n" +"PO-Revision-Date: 2020-09-19 17:41+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -987,7 +987,7 @@ msgstr "Arquivo BMP inválido" #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" -msgstr "" +msgstr "BSSID Inválido" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" From 04ffd0dca0db404028da8ef2eb43f82b6e1b24ab Mon Sep 17 00:00:00 2001 From: "Ryan T. Hamilton" Date: Sat, 19 Sep 2020 13:38:04 -0700 Subject: [PATCH 0920/1293] Add gateway, subnet, and rssi info for current connected AP ap_rssi is a bound method, which I'm not keen on, but it works --- ports/esp32s2/common-hal/wifi/Radio.c | 38 +++++++++++++++++++++++ shared-bindings/wifi/Radio.c | 44 +++++++++++++++++++++++++++ shared-bindings/wifi/Radio.h | 3 ++ 3 files changed, 85 insertions(+) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index a0b8b6adc5..4b2e7b64ee 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -147,6 +147,44 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t return WIFI_RADIO_ERROR_NONE; } +mp_obj_t common_hal_wifi_radio_get_ap_rssi(wifi_radio_obj_t *self) { + if (!esp_netif_is_netif_up(self->netif)) { + return mp_const_none; + } + // Make sure the interface is in STA mode + wifi_mode_t if_mode; + esp_wifi_get_mode(&if_mode); + if (if_mode != WIFI_MODE_STA){ + return mp_const_none; + } + + wifi_ap_record_t ap_info; + esp_wifi_sta_get_ap_info(&ap_info); + + mp_obj_t rssi; + rssi = MP_OBJ_NEW_SMALL_INT(ap_info.rssi); + + return rssi; +} + +mp_obj_t common_hal_wifi_radio_get_ipv4_gateway(wifi_radio_obj_t *self) { + if (!esp_netif_is_netif_up(self->netif)) { + return mp_const_none; + } + esp_netif_ip_info_t ip_info; + esp_netif_get_ip_info(self->netif, &ip_info); + return common_hal_ipaddress_new_ipv4address(ip_info.gw.addr); +} + +mp_obj_t common_hal_wifi_radio_get_ipv4_subnet(wifi_radio_obj_t *self) { + if (!esp_netif_is_netif_up(self->netif)) { + return mp_const_none; + } + esp_netif_ip_info_t ip_info; + esp_netif_get_ip_info(self->netif, &ip_info); + return common_hal_ipaddress_new_ipv4address(ip_info.netmask.addr); +} + mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self) { if (!esp_netif_is_netif_up(self->netif)) { return mp_const_none; diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 928f21da90..6f1935191d 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -163,6 +163,47 @@ STATIC mp_obj_t wifi_radio_connect(size_t n_args, const mp_obj_t *pos_args, mp_m } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wifi_radio_connect_obj, 1, wifi_radio_connect); +//| ap_rssi: int +//| """RSSI of the currently connected AP. Returns none if not connected""" +//| +STATIC mp_obj_t wifi_radio_get_ap_rssi(mp_obj_t self) { + return common_hal_wifi_radio_get_ap_rssi(self); + +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ap_rssi_obj, wifi_radio_get_ap_rssi); + +//| ipv4_gateway: Optional[ipaddress.IPv4Address] +//| """IP v4 Address of the gateway when connected to an access point. None otherwise.""" +//| +STATIC mp_obj_t wifi_radio_get_ipv4_gateway(mp_obj_t self) { + return common_hal_wifi_radio_get_ipv4_gateway(self); + +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_gateway_obj, wifi_radio_get_ipv4_gateway); + +const mp_obj_property_t wifi_radio_ipv4_gateway_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&wifi_radio_get_ipv4_gateway_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + +//| ipv4_subnet: Optional[ipaddress.IPv4Address] +//| """IP v4 Address of the subnet when connected to an access point. None otherwise.""" +//| +STATIC mp_obj_t wifi_radio_get_ipv4_subnet(mp_obj_t self) { + return common_hal_wifi_radio_get_ipv4_subnet(self); + +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_subnet_obj, wifi_radio_get_ipv4_subnet); + +const mp_obj_property_t wifi_radio_ipv4_subnet_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&wifi_radio_get_ipv4_subnet_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + //| ipv4_address: Optional[ipaddress.IPv4Address] //| """IP v4 Address of the radio when connected to an access point. None otherwise.""" //| @@ -219,6 +260,9 @@ STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&wifi_radio_connect_obj) }, // { MP_ROM_QSTR(MP_QSTR_connect_to_enterprise), MP_ROM_PTR(&wifi_radio_connect_to_enterprise_obj) }, + { MP_ROM_QSTR(MP_QSTR_ap_rssi), MP_ROM_PTR(&wifi_radio_get_ap_rssi_obj) }, + { MP_ROM_QSTR(MP_QSTR_ipv4_gateway), MP_ROM_PTR(&wifi_radio_ipv4_gateway_obj) }, + { MP_ROM_QSTR(MP_QSTR_ipv4_subnet), MP_ROM_PTR(&wifi_radio_ipv4_subnet_obj) }, { MP_ROM_QSTR(MP_QSTR_ipv4_address), MP_ROM_PTR(&wifi_radio_ipv4_address_obj) }, // { MP_ROM_QSTR(MP_QSTR_access_point_active), MP_ROM_PTR(&wifi_radio_access_point_active_obj) }, diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index b5341d51c9..3c8ecbebd1 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -53,6 +53,9 @@ extern void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) extern 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); +extern mp_obj_t common_hal_wifi_radio_get_ap_rssi(wifi_radio_obj_t *self); +extern mp_obj_t common_hal_wifi_radio_get_ipv4_gateway(wifi_radio_obj_t *self); +extern mp_obj_t common_hal_wifi_radio_get_ipv4_subnet(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self); extern mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address, mp_float_t timeout); From bc8863a3c788c7a44c164e35c71a7ec83cf29823 Mon Sep 17 00:00:00 2001 From: "Ryan T. Hamilton" Date: Sat, 19 Sep 2020 21:04:07 -0700 Subject: [PATCH 0921/1293] Simplify now that I have it working still need to figure out the bound method business --- ports/esp32s2/common-hal/wifi/Radio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index 4b2e7b64ee..5bc69eab40 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -151,6 +151,7 @@ mp_obj_t common_hal_wifi_radio_get_ap_rssi(wifi_radio_obj_t *self) { if (!esp_netif_is_netif_up(self->netif)) { return mp_const_none; } + // Make sure the interface is in STA mode wifi_mode_t if_mode; esp_wifi_get_mode(&if_mode); @@ -161,10 +162,7 @@ mp_obj_t common_hal_wifi_radio_get_ap_rssi(wifi_radio_obj_t *self) { wifi_ap_record_t ap_info; esp_wifi_sta_get_ap_info(&ap_info); - mp_obj_t rssi; - rssi = MP_OBJ_NEW_SMALL_INT(ap_info.rssi); - - return rssi; + return MP_OBJ_NEW_SMALL_INT(ap_info.rssi); } mp_obj_t common_hal_wifi_radio_get_ipv4_gateway(wifi_radio_obj_t *self) { From 40ec7a66e424c37da7556bdea303a4e5da30985c Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Mon, 21 Sep 2020 14:39:31 +0530 Subject: [PATCH 0922/1293] Update microS2 config files --- .../boards/microdev_micro_s2/mpconfigboard.h | 3 ++- .../boards/microdev_micro_s2/mpconfigboard.mk | 1 + ports/esp32s2/boards/microdev_micro_s2/pins.c | 21 ++++++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h index 1a1ef7a6c7..c138c8ed15 100644 --- a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +++ b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h @@ -26,10 +26,11 @@ //Micropython setup -#define MICROPY_HW_BOARD_NAME "microDev microS2" +#define MICROPY_HW_BOARD_NAME "microS2" #define MICROPY_HW_MCU_NAME "ESP32S2" #define MICROPY_HW_LED (&pin_GPIO21) +#define MICROPY_HW_BUTTON (&pin_GPIO0) #define MICROPY_HW_NEOPIXEL (&pin_GPIO33) #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) diff --git a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.mk b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.mk index 783e7ad4c7..5156170957 100644 --- a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.mk +++ b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.mk @@ -2,6 +2,7 @@ USB_VID = 0x239A USB_PID = 0x80C6 USB_PRODUCT = "microS2" USB_MANUFACTURER = "microDev" +USB_DEVICES = "CDC,MSC,HID" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/esp32s2/boards/microdev_micro_s2/pins.c b/ports/esp32s2/boards/microdev_micro_s2/pins.c index 25300b5c3c..bd230ed38f 100644 --- a/ports/esp32s2/boards/microdev_micro_s2/pins.c +++ b/ports/esp32s2/boards/microdev_micro_s2/pins.c @@ -42,8 +42,27 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_MTCK), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_MTDO), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_MTDI), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_MTMS), MP_ROM_PTR(&pin_GPIO42) }, + + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO33) }, + + { 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_global_dict_table); From 0318eb359fbeb91c6b37ed2050e57711ec2740bc Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 21 Sep 2020 10:02:27 -0500 Subject: [PATCH 0923/1293] makeqstrdata: Work around python3.6 compatibility problem Discord user Folknology encountered a problem building with Python 3.6.9, `TypeError: ord() expected a character, but string of length 0 found`. I was able to reproduce the problem using Python3.5*, and discovered that the meaning of the regular expression `"|."` had changed in 3.7. Before, ``` >>> [m.group(0) for m in re.finditer("|.", "hello")] ['', '', '', '', '', ''] ``` After: ``` >>> [m.group(0) for m in re.finditer("|.", "hello")] ['', 'h', '', 'e', '', 'l', '', 'l', '', 'o', ''] ``` Check if `words` is empty and if so use `"."` as the regular expression instead. This gives the same result on both versions: ``` ['h', 'e', 'l', 'l', 'o'] ``` and fixes the generation of the huffman dictionary. Folknology verified that this fix worked for them. * I could easily install 3.5 but not 3.6. 3.5 reproduced the same problem --- py/makeqstrdata.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 96e3956b42..b4f4f1b035 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -109,7 +109,11 @@ class TextSplitter: def __init__(self, words): words.sort(key=lambda x: len(x), reverse=True) self.words = set(words) - self.pat = re.compile("|".join(re.escape(w) for w in words) + "|.", flags=re.DOTALL) + if words: + pat = "|".join(re.escape(w) for w in words) + "|." + else: + pat = "." + self.pat = re.compile(pat, flags=re.DOTALL) def iter_words(self, text): s = [] From 22d9a94f2b880c57b7939e3e08a6fecd1ef59720 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 21 Sep 2020 13:47:14 -0400 Subject: [PATCH 0924/1293] Use write_value, add missing pin exceptions --- ports/esp32s2/common-hal/busio/SPI.c | 49 +++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index 350580ea84..6e4e344740 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -115,6 +115,16 @@ static void spi_bus_intr_disable(void *self) void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t * clock, const mcu_pin_obj_t * mosi, const mcu_pin_obj_t * miso) { + + //SCK is not optional. MOSI and MISO are + if (!clock) { + mp_raise_ValueError(translate("Must provide SCK pin")); + } + + if (!miso && !mosi) { + mp_raise_ValueError(translate("Must provide MISO or MOSI pin")); + } + spi_bus_config_t bus_config; bus_config.mosi_io_num = mosi != NULL ? mosi->number : -1; bus_config.miso_io_num = miso != NULL ? miso->number : -1; @@ -212,8 +222,12 @@ void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { spi_never_reset[self->host_id] = true; common_hal_never_reset_pin(self->clock_pin); - common_hal_never_reset_pin(self->MOSI_pin); - common_hal_never_reset_pin(self->MISO_pin); + if (self->MOSI_pin != NULL) { + common_hal_never_reset_pin(self->MOSI_pin); + } + if (self->MISO_pin != NULL) { + common_hal_never_reset_pin(self->MISO_pin); + } } bool common_hal_busio_spi_deinited(busio_spi_obj_t *self) { @@ -236,9 +250,15 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { spi_bus_free(self->host_id); common_hal_reset_pin(self->clock_pin); - common_hal_reset_pin(self->MOSI_pin); - common_hal_reset_pin(self->MISO_pin); + if (self->MOSI_pin != NULL) { + common_hal_reset_pin(self->MOSI_pin); + } + if (self->MISO_pin != NULL) { + common_hal_reset_pin(self->MISO_pin); + } self->clock_pin = NULL; + self->MISO_pin = NULL; + self->MOSI_pin = NULL; } bool common_hal_busio_spi_configure(busio_spi_obj_t *self, @@ -293,18 +313,37 @@ void common_hal_busio_spi_unlock(busio_spi_obj_t *self) { bool common_hal_busio_spi_write(busio_spi_obj_t *self, const uint8_t *data, size_t len) { + if (self->MOSI_pin == NULL) { + mp_raise_ValueError(translate("No MOSI Pin")); + } return common_hal_busio_spi_transfer(self, data, NULL, len); } bool common_hal_busio_spi_read(busio_spi_obj_t *self, uint8_t *data, size_t len, uint8_t write_value) { - return common_hal_busio_spi_transfer(self, NULL, data, len); + + if (self->MISO_pin == NULL) { + mp_raise_ValueError(translate("No MISO Pin")); + } + if (self->MOSI_pin == NULL) { + return common_hal_busio_spi_transfer(self, NULL, data, len); + } else { + memset(data, write_value, len); + return common_hal_busio_spi_transfer(self, data, data, len); + } } bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_out, uint8_t *data_in, size_t len) { if (len == 0) { return true; } + // Other than the read special case, stop transfers that don't have a pin/array match + if (!self->MOSI_pin && (data_out != data_in)) { + mp_raise_ValueError(translate("No MOSI Pin")); + } + if (!self->MISO_pin && data_in) { + mp_raise_ValueError(translate("No MISO Pin")); + } spi_hal_context_t* hal = &self->hal_context; hal->send_buffer = NULL; From 183649aad888f39f84cb9f81d589f9786c28c73c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 24 Aug 2020 09:00:08 -0500 Subject: [PATCH 0925/1293] samd: move mcu_find_pin_function to header .. it'll be used in can as well as sdio --- .../common-hal/microcontroller/Pin.c | 18 ++++++++++ .../common-hal/microcontroller/Pin.h | 9 +++++ ports/atmel-samd/common-hal/sdioio/SDCard.c | 34 +++++-------------- ports/atmel-samd/tools/mksdiodata.py | 9 ++--- 4 files changed, 37 insertions(+), 33 deletions(-) diff --git a/ports/atmel-samd/common-hal/microcontroller/Pin.c b/ports/atmel-samd/common-hal/microcontroller/Pin.c index ef1d8fffaa..bec9dc1e26 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Pin.c +++ b/ports/atmel-samd/common-hal/microcontroller/Pin.c @@ -24,6 +24,8 @@ * THE SOFTWARE. */ +#include "py/runtime.h" + #include "shared-bindings/microcontroller/Pin.h" #include "atmel_start_pins.h" @@ -256,3 +258,19 @@ void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) { void common_hal_mcu_pin_reset_number(uint8_t pin_no) { reset_pin_number(pin_no); } + +mcu_pin_function_t *mcu_find_pin_function(mcu_pin_function_t *table, const mcu_pin_obj_t *pin, int instance, uint16_t name) { + if (!pin) { + return NULL; + } + + for(; table->obj; table++) { + if (instance != -1 && instance != table->instance) { + continue; + } + if (pin == table->obj) { + return table; + } + } + mp_raise_ValueError_varg(translate("%q pin invalid"), name); +} diff --git a/ports/atmel-samd/common-hal/microcontroller/Pin.h b/ports/atmel-samd/common-hal/microcontroller/Pin.h index 14887207aa..59302713af 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Pin.h +++ b/ports/atmel-samd/common-hal/microcontroller/Pin.h @@ -47,4 +47,13 @@ void never_reset_pin_number(uint8_t pin_number); void claim_pin(const mcu_pin_obj_t* pin); bool pin_number_is_free(uint8_t pin_number); +typedef struct { + const mcu_pin_obj_t *obj; + uint8_t instance; + uint8_t pin; + uint16_t function; +} mcu_pin_function_t; + +mcu_pin_function_t *mcu_find_pin_function(mcu_pin_function_t *table, const mcu_pin_obj_t *pin, int instance, uint16_t name); + #endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_MICROCONTROLLER_PIN_H diff --git a/ports/atmel-samd/common-hal/sdioio/SDCard.c b/ports/atmel-samd/common-hal/sdioio/SDCard.c index 1f555b6476..4d2539aa5a 100644 --- a/ports/atmel-samd/common-hal/sdioio/SDCard.c +++ b/ports/atmel-samd/common-hal/sdioio/SDCard.c @@ -58,24 +58,6 @@ static Sdhc *sdhc_insts[] = SDHC_INSTS; -STATIC pin_function_t *find_pin_function(pin_function_t *table, const mcu_pin_obj_t *pin, int instance, uint16_t name) { - DEBUG_PRINT("\n\n[inst=% 2d] %q: ", instance, name); - DEBUG_PRINT_OBJ_NL(pin); - - for(; table->obj; table++) { - DEBUG_PRINT("[inst=% 2d] considering table @%p: "); - DEBUG_PRINT_OBJ(table->obj); - DEBUG_PRINT(" %d %d\n", table->instance, table->pin); - if (instance != -1 && instance != table->instance) { - continue; - } - if (pin == table->obj) { - return table; - } - } - mp_raise_ValueError_varg(translate("%q pin invalid"), name); -} - void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, const mcu_pin_obj_t * clock, const mcu_pin_obj_t * command, uint8_t num_data, mcu_pin_obj_t ** data, uint32_t frequency) { @@ -98,15 +80,15 @@ CLK PA21 PCC_D? (D32) BROWN */ - pin_function_t *functions[6] = {}; - functions[0] = find_pin_function(sdio_cmd, command, -1, MP_QSTR_command); + mcu_pin_function_t *functions[6] = {}; + functions[0] = mcu_find_pin_function(sdio_cmd, command, -1, MP_QSTR_command); int instance = functions[0]->instance; - functions[1] = find_pin_function(sdio_ck, clock, instance, MP_QSTR_clock); - functions[2] = find_pin_function(sdio_dat0, data[0], instance, MP_QSTR_data0); + functions[1] = mcu_find_pin_function(sdio_ck, clock, instance, MP_QSTR_clock); + functions[2] = mcu_find_pin_function(sdio_dat0, data[0], instance, MP_QSTR_data0); if(num_data == 4) { - functions[3] = find_pin_function(sdio_dat1, data[1], instance, MP_QSTR_data1); - functions[4] = find_pin_function(sdio_dat2, data[2], instance, MP_QSTR_data2); - functions[5] = find_pin_function(sdio_dat3, data[3], instance, MP_QSTR_data3); + functions[3] = mcu_find_pin_function(sdio_dat1, data[1], instance, MP_QSTR_data1); + functions[4] = mcu_find_pin_function(sdio_dat2, data[2], instance, MP_QSTR_data2); + functions[5] = mcu_find_pin_function(sdio_dat3, data[3], instance, MP_QSTR_data3); } // We've verified all pins, now set their special functions @@ -114,7 +96,7 @@ CLK PA21 PCC_D? (D32) BROWN self->clock_pin = common_hal_mcu_pin_number(functions[1]->obj); for(int i=0; idata_pins[i] = common_hal_mcu_pin_number(function->obj); } else { diff --git a/ports/atmel-samd/tools/mksdiodata.py b/ports/atmel-samd/tools/mksdiodata.py index 0cce3819f3..48c4a085f5 100755 --- a/ports/atmel-samd/tools/mksdiodata.py +++ b/ports/atmel-samd/tools/mksdiodata.py @@ -1,7 +1,7 @@ #!/usr/bin/python3 def defines(name, function): - print(f'pin_function_t {name} [] = {{') + print(f'mcu_pin_function_t {name} [] = {{') for instance in (0, 1): for port in 'ABCD': for idx in range(32): @@ -23,13 +23,8 @@ print('''\ #include "mpconfigport.h" #include "atmel_start_pins.h" #include "hal/include/hal_gpio.h" +#include "common-hal/microcontroller/Pin.h" -typedef struct { - const mcu_pin_obj_t *obj; - uint8_t instance; - uint8_t pin; - uint16_t function; -} pin_function_t; ''') defines('sdio_ck', 'SDCK') From e7a213a11420ed362dfb672cd0fa6e77c032fa07 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 16 Sep 2020 11:57:09 -0500 Subject: [PATCH 0926/1293] py: Add enum helper code This makes it much easier to implement enums, and the printing code is shared. We might want to convert other enums to this in the future. --- py/enum.c | 52 ++++++++++++++++++++++++++++++++++++++++++++ py/enum.h | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ py/py.mk | 1 + 3 files changed, 118 insertions(+) create mode 100644 py/enum.c create mode 100644 py/enum.h diff --git a/py/enum.c b/py/enum.c new file mode 100644 index 0000000000..02a85a168c --- /dev/null +++ b/py/enum.c @@ -0,0 +1,52 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2020 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/enum.h" +#include "py/runtime.h" + +mp_obj_t cp_enum_find(const mp_obj_type_t *type, int value) { + const mp_obj_dict_t *dict = type->locals_dict; + for (size_t i=0; imap.used; i++) { + const cp_enum_obj_t *v = dict->map.table[i].value; + if (v->value == value) { + return (mp_obj_t)v; + } + } + return mp_const_none; +} + +int cp_enum_value(const mp_obj_type_t *type, mp_obj_t *obj) { + if (!MP_OBJ_IS_TYPE(obj, type)) { + mp_raise_TypeError_varg(translate("Expected a %q"), type->name); + } + return ((cp_enum_obj_t*)MP_OBJ_TO_PTR(obj))->value; +} + +void cp_enum_obj_print_helper(uint16_t module, const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { + (void) kind; + cp_enum_obj_t *self = self_in; + mp_printf(print, "%q.%q.%q", module, self->base.type->name, self->name); +} diff --git a/py/enum.h b/py/enum.h new file mode 100644 index 0000000000..1c38ae5ae6 --- /dev/null +++ b/py/enum.h @@ -0,0 +1,65 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2020 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" + +typedef struct { + mp_obj_base_t base; + int16_t value; + int16_t name; +} cp_enum_obj_t; + +#define MAKE_ENUM_VALUE(type, prefix, name, value) \ + STATIC const cp_enum_obj_t prefix ## _ ## name ## _obj = { \ + { &type }, value, MP_QSTR_ ## name, \ + } + +#define MAKE_ENUM_MAP(name) \ + STATIC const mp_rom_map_elem_t name ## _locals_table[] = + +#define MAKE_ENUM_MAP_ENTRY(prefix, name) \ + { MP_ROM_QSTR(MP_QSTR_ ## name), MP_ROM_PTR(&prefix ## _ ## name ## _obj) } + +#define MAKE_PRINTER(module, typename) \ + STATIC void typename ## _ ## print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { \ + cp_enum_obj_print_helper(MP_QSTR_ ## module, print, self_in, kind); \ + } + +#define MAKE_ENUM_TYPE(module, type, typename) \ + const mp_obj_type_t typename ## _type = { \ + { &mp_type_type }, \ + .name = MP_QSTR_ ## type, \ + .print = typename ## _print, \ + .locals_dict = (mp_obj_t)&typename ## _locals_dict, \ + } + + + +mp_obj_t cp_enum_find(const mp_obj_type_t *type, int value); +int cp_enum_value(const mp_obj_type_t *type, mp_obj_t *obj); +void cp_enum_obj_print_helper(uint16_t module, const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind); diff --git a/py/py.mk b/py/py.mk index 49fb0acaf9..acf5d127bc 100644 --- a/py/py.mk +++ b/py/py.mk @@ -181,6 +181,7 @@ PY_CORE_O_BASENAME = $(addprefix py/,\ argcheck.o \ warning.o \ map.o \ + enum.o \ obj.o \ objarray.o \ objattrtuple.o \ From a2e1867f69ec2d703a9651e5c36a02b0e14dfd9c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 20 Aug 2020 11:08:00 -0500 Subject: [PATCH 0927/1293] _canio: Minimal implementation for SAM E5x MCUs Tested & working: * Send standard packets * Receive standard packets (1 FIFO, no filter) Interoperation between SAM E54 Xplained running this tree and MicroPython running on STM32F405 Feather with an external transceiver was also tested. Many other aspects of a full implementation are not yet present, such as error detection and recovery. --- main.c | 8 + ports/atmel-samd/Makefile | 4 + .../asf4_conf/same54/peripheral_clk_config.h | 82 ++++ ports/atmel-samd/boards/common.template.ld | 7 +- .../boards/same54_xplained/mpconfigboard.mk | 1 + .../atmel-samd/boards/same54_xplained/pins.c | 5 +- ports/atmel-samd/common-hal/_canio/CAN.c | 384 ++++++++++++++++++ ports/atmel-samd/common-hal/_canio/CAN.h | 62 +++ ports/atmel-samd/common-hal/_canio/Listener.c | 117 ++++++ ports/atmel-samd/common-hal/_canio/Listener.h | 53 +++ ports/atmel-samd/common-hal/_canio/__init__.c | 25 ++ ports/atmel-samd/common-hal/_canio/__init__.h | 62 +++ ports/atmel-samd/tools/mkcandata.py | 31 ++ py/circuitpy_defns.mk | 9 + py/circuitpy_mpconfig.h | 8 + py/circuitpy_mpconfig.mk | 3 + shared-bindings/_canio/CAN.c | 338 +++++++++++++++ shared-bindings/_canio/CAN.h | 31 ++ shared-bindings/_canio/Listener.c | 197 +++++++++ shared-bindings/_canio/Listener.h | 31 ++ shared-bindings/_canio/Match.c | 140 +++++++ shared-bindings/_canio/Match.h | 33 ++ shared-bindings/_canio/Message.c | 213 ++++++++++ shared-bindings/_canio/Message.h | 31 ++ shared-bindings/_canio/__init__.c | 73 ++++ shared-bindings/_canio/__init__.h | 29 ++ shared-module/_canio/Match.c | 43 ++ shared-module/_canio/Match.h | 41 ++ shared-module/_canio/Message.c | 85 ++++ shared-module/_canio/Message.h | 47 +++ 30 files changed, 2190 insertions(+), 3 deletions(-) create mode 100644 ports/atmel-samd/common-hal/_canio/CAN.c create mode 100644 ports/atmel-samd/common-hal/_canio/CAN.h create mode 100644 ports/atmel-samd/common-hal/_canio/Listener.c create mode 100644 ports/atmel-samd/common-hal/_canio/Listener.h create mode 100644 ports/atmel-samd/common-hal/_canio/__init__.c create mode 100644 ports/atmel-samd/common-hal/_canio/__init__.h create mode 100755 ports/atmel-samd/tools/mkcandata.py create mode 100644 shared-bindings/_canio/CAN.c create mode 100644 shared-bindings/_canio/CAN.h create mode 100644 shared-bindings/_canio/Listener.c create mode 100644 shared-bindings/_canio/Listener.h create mode 100644 shared-bindings/_canio/Match.c create mode 100644 shared-bindings/_canio/Match.h create mode 100644 shared-bindings/_canio/Message.c create mode 100644 shared-bindings/_canio/Message.h create mode 100644 shared-bindings/_canio/__init__.c create mode 100644 shared-bindings/_canio/__init__.h create mode 100644 shared-module/_canio/Match.c create mode 100644 shared-module/_canio/Match.h create mode 100644 shared-module/_canio/Message.c create mode 100644 shared-module/_canio/Message.h diff --git a/main.c b/main.c index 5b719dc4b6..f259fea3f9 100755 --- a/main.c +++ b/main.c @@ -81,6 +81,10 @@ #include "supervisor/shared/bluetooth.h" #endif +#if CIRCUITPY_CANIO +#include "common-hal/_canio/CAN.h" +#endif + void do_str(const char *src, mp_parse_input_kind_t input_kind) { mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR__lt_stdin_gt_, src, strlen(src), 0); if (lex == NULL) { @@ -226,6 +230,10 @@ void cleanup_after_vm(supervisor_allocation* heap) { free_memory(heap); supervisor_move_memory(); + #ifdef CIRCUITPY_CANIO + common_hal_canio_reset(); + #endif + reset_port(); #if CIRCUITPY_BOARD reset_board_busses(); diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index aba630dbb3..1ee21679d8 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -393,6 +393,10 @@ SRC_QSTR += $(HEADER_BUILD)/sdiodata.h $(HEADER_BUILD)/sdiodata.h: tools/mksdiodata.py | $(HEADER_BUILD) $(Q)$(PYTHON3) $< > $@ +SRC_QSTR += $(HEADER_BUILD)/candata.h +$(HEADER_BUILD)/candata.h: tools/mkcandata.py | $(HEADER_BUILD) + $(Q)$(PYTHON3) $< > $@ + SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) # Sources that only hold QSTRs after pre-processing. SRC_QSTR_PREPROCESSOR += peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/clocks.c diff --git a/ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h b/ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h index 59fe8730e6..51173f6d32 100644 --- a/ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h +++ b/ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h @@ -1165,6 +1165,88 @@ #define CONF_SDHC1_SLOW_FREQUENCY 12000000 #endif +// CAN Clock Settings +// CAN Clock source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for CAN. +// sdhc_gclk_selection +#ifndef CONF_GCLK_CAN0_SRC +#define CONF_GCLK_CAN0_SRC GCLK_PCHCTRL_GEN_GCLK0_Val +#endif + +/** + * \def CAN FREQUENCY + * \brief CAN's Clock frequency + */ +#ifndef CONF_CAN0_FREQUENCY +#define CONF_CAN0_FREQUENCY 120000000 +#endif + +// CAN Clock Settings +// CAN Clock source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for CAN. +// sdhc_gclk_selection +#ifndef CONF_GCLK_CAN1_SRC +#define CONF_GCLK_CAN1_SRC GCLK_PCHCTRL_GEN_GCLK0_Val +#endif + +/** + * \def CAN FREQUENCY + * \brief CAN's Clock frequency + */ +#ifndef CONF_CAN1_FREQUENCY +#define CONF_CAN1_FREQUENCY 120000000 +#endif + // <<< end of configuration section >>> #endif // PERIPHERAL_CLK_CONFIG_H diff --git a/ports/atmel-samd/boards/common.template.ld b/ports/atmel-samd/boards/common.template.ld index 1054605c8c..19e4753f8b 100644 --- a/ports/atmel-samd/boards/common.template.ld +++ b/ports/atmel-samd/boards/common.template.ld @@ -51,6 +51,7 @@ SECTIONS { . = ALIGN(4); _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialize the .data section in RAM */ + . = ALIGN(4); *(.ramfunc) *(.ramfunc*) *(.data) /* .data sections */ @@ -61,11 +62,15 @@ SECTIONS } >RAM /* Uninitialized data section */ - .bss : + .bss (NOLOAD) : { . = ALIGN(4); _sbss = .; _szero = .; /* define a global symbol at bss start; used by startup code */ + /* Data accessed by the CAN peripheral must be in the first 64kB RAM */ + _scanram = .; + *(.canram) + _ecanram = .; *(.bss) *(.bss*) *(COMMON) diff --git a/ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk b/ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk index 7ac1265149..e4472e05d6 100644 --- a/ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk +++ b/ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk @@ -12,3 +12,4 @@ EXTERNAL_FLASH_DEVICES = "N25Q256A" LONGINT_IMPL = MPZ CIRCUITPY_SDIOIO = 1 +CIRCUITPY_CANIO = 1 diff --git a/ports/atmel-samd/boards/same54_xplained/pins.c b/ports/atmel-samd/boards/same54_xplained/pins.c index 8a864ab97d..1ed431fbad 100644 --- a/ports/atmel-samd/boards/same54_xplained/pins.c +++ b/ports/atmel-samd/boards/same54_xplained/pins.c @@ -48,8 +48,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_QT), MP_ROM_PTR(&pin_PA16) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_CANRX), MP_ROM_PTR(&pin_PB12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_CANTX), MP_ROM_PTR(&pin_PB13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR(&pin_PB13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR(&pin_PB12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_STANDBY), MP_ROM_PTR(&pin_PC13) }, // EXT1 header { MP_OBJ_NEW_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, diff --git a/ports/atmel-samd/common-hal/_canio/CAN.c b/ports/atmel-samd/common-hal/_canio/CAN.c new file mode 100644 index 0000000000..dcd269495e --- /dev/null +++ b/ports/atmel-samd/common-hal/_canio/CAN.c @@ -0,0 +1,384 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "py/runtime.h" +#include "py/mperrno.h" + +#include "peripheral_clk_config.h" + +#include "common-hal/_canio/CAN.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/util.h" +#include "supervisor/port.h" + +#include "component/can.h" + +#include "genhdr/candata.h" + +STATIC Can * const can_insts[] = CAN_INSTS; + +STATIC canio_can_obj_t *can_objs[MP_ARRAY_SIZE(can_insts)]; + +// This must be placed in the first 64kB of RAM +STATIC COMPILER_SECTION(".canram") canio_can_state_t can_state[MP_ARRAY_SIZE(can_insts)]; + +__attribute__((optimize("O0"), noinline)) +void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *rx, mcu_pin_obj_t *tx, int baudrate, bool loopback, bool silent) +{ + mcu_pin_function_t *tx_function = mcu_find_pin_function(can_tx, tx, -1, MP_QSTR_tx); + int instance = tx_function->instance; + + mcu_pin_function_t *rx_function = mcu_find_pin_function(can_rx, rx, instance, MP_QSTR_rx); + + const uint32_t can_frequency = CONF_CAN0_FREQUENCY; + +#define DIV_ROUND(a, b) (((a) + (b)/2) / (b)) +#define DIV_ROUND_UP(a, b) (((a) + (b) - 1) / (b)) + + uint32_t clocks_per_bit = DIV_ROUND(can_frequency, baudrate); + uint32_t clocks_to_sample = DIV_ROUND(clocks_per_bit * 7, 8); + uint32_t clocks_after_sample = clocks_per_bit - clocks_to_sample; + uint32_t divisor = MAX(DIV_ROUND_UP(clocks_to_sample, 256), DIV_ROUND_UP(clocks_after_sample, 128)); + if (divisor > 32) { + mp_raise_OSError(MP_EINVAL); // baudrate cannot be attained (16kHz or something is lower bound, should never happen) + } + + gpio_set_pin_direction(tx_function->pin, GPIO_DIRECTION_OUT); + gpio_set_pin_function(tx_function->pin, tx_function->function); + common_hal_never_reset_pin(tx_function->obj); + + if (rx_function) { + gpio_set_pin_direction(rx_function->pin, GPIO_DIRECTION_IN); + gpio_set_pin_function(rx_function->pin, rx_function->function); + common_hal_never_reset_pin(rx_function->obj); + } + + self->tx_pin_number = common_hal_mcu_pin_number(tx); + self->rx_pin_number = rx ? common_hal_mcu_pin_number(rx) : COMMON_HAL_MCU_NO_PIN; + self->hw = can_insts[instance]; + self->state = &can_state[instance]; + + self->loopback = loopback; + + // Allow configuration change + hri_can_set_CCCR_INIT_bit(self->hw); + while (hri_can_get_CCCR_INIT_bit(self->hw) == 0) { + } + hri_can_set_CCCR_CCE_bit(self->hw); + + if(instance == 0) { + hri_mclk_set_AHBMASK_CAN0_bit(MCLK); + hri_gclk_write_PCHCTRL_reg(GCLK, CAN0_GCLK_ID, CONF_GCLK_CAN0_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); + + NVIC_DisableIRQ(CAN0_IRQn); + NVIC_ClearPendingIRQ(CAN0_IRQn); + NVIC_EnableIRQ(CAN0_IRQn); + hri_can_write_ILE_reg(self->hw, CAN_ILE_EINT0); +#ifdef CAN1_GCLK_ID + } else if(instance == 1) { + hri_mclk_set_AHBMASK_CAN1_bit(MCLK); + hri_gclk_write_PCHCTRL_reg(GCLK, CAN1_GCLK_ID, CONF_GCLK_CAN1_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); + + NVIC_DisableIRQ(CAN1_IRQn); + NVIC_ClearPendingIRQ(CAN1_IRQn); + NVIC_EnableIRQ(CAN1_IRQn); + hri_can_write_ILE_reg(self->hw, CAN_ILE_EINT0); +#endif + } + + self->hw->CCCR.bit.FDOE = 0; // neither FD nor Bit Rate Switch enabled + self->hw->CCCR.bit.BRSE = 0; + + hri_can_write_MRCFG_reg(self->hw, CAN_MRCFG_QOS(CAN_MRCFG_QOS_DISABLE_Val)); // QoS disabled (no sensitive operation) + + // A "nominal bit" is a header bit. With dual rate CAN FD, this is a slower rate + { + CAN_NBTP_Type btp = { + // 0 means "1 tq", but 2 is subtracted from NTSEG1 for the + // fixed 1 "SYNC" tq + .bit.NTSEG1 = DIV_ROUND(clocks_to_sample, divisor) - 2, + .bit.NTSEG2 = DIV_ROUND(clocks_after_sample, divisor) - 1, + .bit.NBRP = divisor - 1, + .bit.NSJW = DIV_ROUND(clocks_after_sample, divisor * 4), + }; + hri_can_write_NBTP_reg(self->hw, btp.reg); + } + + // we don't do the high bit rate yet, so do we need to set this register? + // hri_can_write_DBTP_reg(self->hw, ???); + // A "data bit" is a data bit :) with dul rate CAN FD, this is a higher + // rate. However, CAN FD is not implemented in CircuitPython, and this is the same rate as + // the "nominal rate". + { + CAN_DBTP_Type btp = { + .bit.DTSEG1 = DIV_ROUND(clocks_to_sample, divisor) - 1, + .bit.DTSEG2 = DIV_ROUND(clocks_after_sample, divisor) - 1, + .bit.DBRP = divisor - 1, + .bit.DSJW = DIV_ROUND(clocks_after_sample, divisor * 4), + }; + hri_can_write_DBTP_reg(self->hw, btp.reg); + } + + { + CAN_RXF0C_Type rxf = { + .bit.F0SA = (uint32_t)self->state->rx0_fifo, + .bit.F0S = COMMON_HAL_CANIO_RX_FIFO_SIZE, + }; + hri_can_write_RXF0C_reg(self->hw, rxf.reg); + } + + { + CAN_RXF1C_Type rxf = { + .bit.F1SA = (uint32_t)self->state->rx1_fifo, + .bit.F1S = COMMON_HAL_CANIO_RX_FIFO_SIZE, + }; + hri_can_write_RXF1C_reg(self->hw, rxf.reg); + } + + // All RX data has an 8 byte payload (max) + { + CAN_RXESC_Type esc = { + .bit.F0DS = CAN_RXESC_F0DS_DATA8_Val, + .bit.F1DS = CAN_RXESC_F1DS_DATA8_Val, + .bit.RBDS = CAN_RXESC_RBDS_DATA8_Val, + }; + hri_can_write_RXESC_reg(self->hw, esc.reg); + } + + // All TX data has an 8 byte payload (max) + { + CAN_TXESC_Type esc = { + .bit.TBDS = CAN_TXESC_TBDS_DATA8_Val, + }; + hri_can_write_TXESC_reg(self->hw, esc.reg); + } + + { + CAN_TXBC_Type bc = { + .bit.TBSA = (uint32_t)self->state->tx_fifo, + .bit.NDTB = COMMON_HAL_CANIO_TX_FIFO_SIZE, + .bit.TFQM = 0, // Messages are transmitted in the order submitted + }; + hri_can_write_TXBC_reg(self->hw, bc.reg); + } + + { + CAN_TXEFC_Type efc = { + .bit.EFS = 0, + }; + hri_can_write_TXEFC_reg(self->hw, efc.reg); + } + + { + CAN_GFC_Type gfc = { + .bit.RRFE = 1, + .bit.ANFS = CAN_GFC_ANFS_RXF0_Val, + .bit.ANFE = CAN_GFC_ANFE_REJECT_Val, + }; + hri_can_write_GFC_reg(self->hw, gfc.reg); + } + + { + CAN_SIDFC_Type dfc = { + .bit.LSS = COMMON_HAL_CANIO_RX_FILTER_SIZE, + .bit.FLSSA = (uint32_t)self->state->rx_filter + }; + hri_can_write_SIDFC_reg(self->hw, dfc.reg); + } + + { + CAN_XIDFC_Type dfc = { + .bit.LSE = 0, + }; + hri_can_write_XIDFC_reg(self->hw, dfc.reg); + } + + hri_can_write_XIDAM_reg(self->hw, CAN_XIDAM_RESETVALUE); + +// silent: The CAN is set in Bus Monitoring Mode by programming CCCR.MON to '1'. (tx pin unused) +// external loopback: The CAN can be set in External Loop Back Mode by programming TEST.LBCK and CCCR.MON to '1'. (rx pin unused) +// internal loopback (silent loopback): Internal Loop Back Mode is entered by programming bits TEST.LBCK and CCCR.MON to '1'. (tx, rx unused) + self->hw->CCCR.bit.MON = silent; + self->hw->CCCR.bit.TEST = loopback; + self->hw->TEST.bit.LBCK = loopback; + + if(instance == 0) { + NVIC_DisableIRQ(CAN0_IRQn); + NVIC_ClearPendingIRQ(CAN0_IRQn); + NVIC_EnableIRQ(CAN0_IRQn); +#ifdef CAN1_GCLK_ID + } else if(instance == 1) { + NVIC_DisableIRQ(CAN1_IRQn); + NVIC_ClearPendingIRQ(CAN1_IRQn); + NVIC_EnableIRQ(CAN1_IRQn); +#endif + } + + hri_can_write_ILE_reg(self->hw, CAN_ILE_EINT0); + // Prevent configuration change + hri_can_clear_CCCR_CCE_bit(self->hw); + hri_can_clear_CCCR_INIT_bit(self->hw); + while (hri_can_get_CCCR_INIT_bit(self->hw)) { + } + + can_objs[instance] = self; +} + +int common_hal_canio_can_loopback_get(canio_can_obj_t *self) +{ + return self->loopback; +} + +int common_hal_canio_can_baudrate_get(canio_can_obj_t *self) +{ + return self->baudrate; +} + +int common_hal_canio_can_transmit_error_count_get(canio_can_obj_t *self) +{ + return -1; +} + +int common_hal_canio_can_receive_error_count_get(canio_can_obj_t *self) +{ + return -1; +} + +int common_hal_canio_can_error_warning_state_count_get(canio_can_obj_t *self) +{ + return -1; +} + +int common_hal_canio_can_error_passive_state_count_get(canio_can_obj_t *self) +{ + return -1; +} + +int common_hal_canio_can_bus_off_state_count_get(canio_can_obj_t *self) +{ + return -1; +} + +int common_hal_canio_can_state_get(canio_can_obj_t *self) { + return -1; +} + +void common_hal_canio_can_send(canio_can_obj_t *self, canio_message_obj_t *message) +{ + // We have just one dedicated TX buffer, use it! + canio_can_fifo_t *ent = &self->state->tx_fifo[0]; + ent->txb0.bit.ESI = false; + ent->txb0.bit.XTD = false; + ent->txb0.bit.RTR = message->rtr; + ent->txb0.bit.ID = message->id << 18; // short addresses are left-justified + + ent->txb1.bit.MM = 0; // "message marker" + ent->txb1.bit.EFC = 0; // don't store fifo events to event queue + ent->txb1.bit.FDF = 0; // Classic CAN format + ent->txb1.bit.BRS = 0; // No bit rate switching + ent->txb1.bit.DLC = message->size; + + if (!message->rtr) { + memcpy(ent->data, message->data, message->size); + } + + // TX buffer add request + self->hw->TXBAR.reg = 1; + + // wait 8ms (hard coded for now) for TX to occur + uint64_t deadline = port_get_raw_ticks(NULL) + 8; + while (port_get_raw_ticks(NULL) < deadline && !(self->hw->TXBTO.reg & 1)) { + RUN_BACKGROUND_TASKS; + } +} + +bool common_hal_canio_can_deinited(canio_can_obj_t *self) { + return !self->hw; +} + +void common_hal_canio_can_check_for_deinit(canio_can_obj_t *self) { + if(common_hal_canio_can_deinited(self)) { + raise_deinited_error(); + } +} + +void common_hal_canio_can_deinit(canio_can_obj_t *self) +{ + if (self->hw) { + hri_can_set_CCCR_INIT_bit(self->hw); + self->hw = 0; + } + if (self->rx_pin_number != COMMON_HAL_MCU_NO_PIN) { + reset_pin_number(self->rx_pin_number); + self->rx_pin_number = COMMON_HAL_MCU_NO_PIN; + } + if (self->tx_pin_number != COMMON_HAL_MCU_NO_PIN) { + reset_pin_number(self->tx_pin_number); + self->tx_pin_number = COMMON_HAL_MCU_NO_PIN; + } +} + +void common_hal_canio_reset(void) { + memset(can_state, 0, sizeof(can_state)); + + for (size_t i=0; i +#include + +#include "py/obj.h" +#include "py/runtime.h" + +#include "common-hal/_canio/__init__.h" +#include "common-hal/_canio/Listener.h" +#include "shared-bindings/util.h" +#include "supervisor/shared/tick.h" + +void common_hal_canio_listener_construct(canio_listener_obj_t *self, canio_can_obj_t *can, size_t nmatch, canio_match_obj_t **matches, float timeout) { + if (nmatch) { + mp_raise_NotImplementedError(NULL); + } + + if (!can->fifo0_in_use) { + self->fifo_idx = 0; + self->fifo = can->state->rx0_fifo; + self->hw = (canio_rxfifo_reg_t*)&can->hw->RXF0C; + can->hw->IR.reg = CAN_IR_RF0N | CAN_IR_RF0W | CAN_IR_RF0F | CAN_IR_RF0L; + can->fifo0_in_use = true; + } else if (!can->fifo1_in_use) { + self->fifo_idx = 1; + self->fifo = can->state->rx1_fifo; + self->hw = (canio_rxfifo_reg_t*)&can->hw->RXF1C; + can->fifo1_in_use = true; + can->hw->IR.reg = CAN_IR_RF1N | CAN_IR_RF1W | CAN_IR_RF1F | CAN_IR_RF1L; + } else { + mp_raise_ValueError(translate("All RX FIFOs in use")); + } + + self->can = can; + common_hal_canio_listener_set_timeout(self, timeout); +} + +void common_hal_canio_listener_set_timeout(canio_listener_obj_t *self, float timeout) { + self->timeout_ms = (int)MICROPY_FLOAT_C_FUN(ceil)(timeout * 1000); +} + +float common_hal_canio_listener_get_timeout(canio_listener_obj_t *self) { + return self->timeout_ms / 1000.0f; +} + +void common_hal_canio_listener_check_for_deinit(canio_listener_obj_t *self) { + if(!self->can) { + raise_deinited_error(); + } + common_hal_canio_can_check_for_deinit(self->can); +} + +int common_hal_canio_listener_in_waiting(canio_listener_obj_t *self) { + return self->hw->RXFS.bit.F0FL; +} + +bool common_hal_canio_listener_readinto(canio_listener_obj_t *self, canio_message_obj_t *message) { + if (!common_hal_canio_listener_in_waiting(self)) { + uint64_t deadline = supervisor_ticks_ms64() + self->timeout_ms; + do { + if(supervisor_ticks_ms64() > deadline) { + return false; + } + } while (!common_hal_canio_listener_in_waiting(self)); + } + int index = self->hw->RXFS.bit.F0GI; + canio_can_fifo_t *hw_message = &self->fifo[index]; + message->id = hw_message->rxb0.bit.ID >> 18; // short addresses are left-justified + message->rtr = hw_message->rxb0.bit.RTR; + message->size = hw_message->rxb1.bit.DLC; + if(!message->rtr) { + memcpy(message->data, hw_message->data, message->size); + } + self->hw->RXFA.bit.F0AI = index; + return true; +} + +void common_hal_canio_listener_deinit(canio_listener_obj_t *self) { + // free our FIFO, clear our matches, SOMETHING + if(self->can) { + if(self->fifo_idx == 0) { + self->can->fifo0_in_use = false; + } + if(self->fifo_idx == 1) { + self->can->fifo1_in_use = false; + } + } + self->fifo_idx = -1; + self->fifo = NULL; + self->can = NULL; + self->hw = NULL; +} diff --git a/ports/atmel-samd/common-hal/_canio/Listener.h b/ports/atmel-samd/common-hal/_canio/Listener.h new file mode 100644 index 0000000000..cc6770e6e5 --- /dev/null +++ b/ports/atmel-samd/common-hal/_canio/Listener.h @@ -0,0 +1,53 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "common-hal/_canio/CAN.h" +#include "shared-module/_canio/Match.h" + +typedef struct { + __IO CAN_RXF0C_Type RXFC; /**< \brief (R/W 32) Rx FIFO n Configuration */ + __I CAN_RXF0S_Type RXFS; /**< \brief (R/ 32) Rx FIFO n Status */ + __IO CAN_RXF0A_Type RXFA; /**< \brief (R/W 32) Rx FIFO n Acknowledge */ +} canio_rxfifo_reg_t; + +typedef struct { + mp_obj_base_t base; + canio_can_obj_t *can; + canio_can_fifo_t *fifo; + canio_rxfifo_reg_t *hw; + uint32_t timeout_ms; + uint8_t fifo_idx; +} canio_listener_obj_t; + +void common_hal_canio_listener_construct(canio_listener_obj_t *self, canio_can_obj_t *can, size_t nmatch, canio_match_obj_t **matches, float timeout); +void common_hal_canio_listener_check_for_deinit(canio_listener_obj_t *self); +void common_hal_canio_listener_deinit(canio_listener_obj_t *self); +bool common_hal_canio_listener_readinto(canio_listener_obj_t *self, canio_message_obj_t *message); +int common_hal_canio_listener_in_waiting(canio_listener_obj_t *self); +float common_hal_canio_listener_get_timeout(canio_listener_obj_t *self); +void common_hal_canio_listener_set_timeout(canio_listener_obj_t *self, float timeout); diff --git a/ports/atmel-samd/common-hal/_canio/__init__.c b/ports/atmel-samd/common-hal/_canio/__init__.c new file mode 100644 index 0000000000..7932bfc2da --- /dev/null +++ b/ports/atmel-samd/common-hal/_canio/__init__.c @@ -0,0 +1,25 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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. + */ diff --git a/ports/atmel-samd/common-hal/_canio/__init__.h b/ports/atmel-samd/common-hal/_canio/__init__.h new file mode 100644 index 0000000000..429369e188 --- /dev/null +++ b/ports/atmel-samd/common-hal/_canio/__init__.h @@ -0,0 +1,62 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "hal/utils/include/utils.h" +#include "component/can.h" + +#define COMMON_HAL_CANIO_MAX_MESSAGE_LENGTH (8) +#define COMMON_HAL_CANIO_RX_FIFO_SIZE (3) +#define COMMON_HAL_CANIO_RX_FILTER_SIZE (4) +#define COMMON_HAL_CANIO_TX_FIFO_SIZE (1) + +typedef struct canio_listener canio_listener_t; +typedef struct canio_can canio_can_t; + +typedef struct { + union { + CAN_RXBE_0_Type rxb0; + CAN_TXBE_0_Type txb0; + CAN_RXF0E_0_Type rxf0; + }; + union { + CAN_RXBE_1_Type rxb1; + CAN_TXBE_1_Type txb1; + CAN_RXF0E_1_Type rxf1; + }; + COMPILER_ALIGNED(4) + uint8_t data[COMMON_HAL_CANIO_MAX_MESSAGE_LENGTH]; +} canio_can_fifo_t; + +typedef uint32_t canio_can_filter_t; + +typedef struct { + canio_can_fifo_t tx_fifo[COMMON_HAL_CANIO_TX_FIFO_SIZE]; + canio_can_fifo_t rx0_fifo[COMMON_HAL_CANIO_RX_FIFO_SIZE]; + canio_can_fifo_t rx1_fifo[COMMON_HAL_CANIO_RX_FIFO_SIZE]; + canio_can_filter_t rx_filter[COMMON_HAL_CANIO_RX_FILTER_SIZE]; +} canio_can_state_t; diff --git a/ports/atmel-samd/tools/mkcandata.py b/ports/atmel-samd/tools/mkcandata.py new file mode 100755 index 0000000000..9668d2208a --- /dev/null +++ b/ports/atmel-samd/tools/mkcandata.py @@ -0,0 +1,31 @@ +#!/usr/bin/python3 + +def defines(name, suffix): + print(f'mcu_pin_function_t {name} [] = {{') + for instance in (0, 1): + for function in 'HI': + for port in 'ABCD': + for idx in range(32): + pin = f'P{port}{idx:02d}' + pinmux = f'PINMUX_{pin}{function}_CAN{instance}_{suffix}' + print(f'''\ +#if defined({pinmux}) && ! defined(IGNORE_PIN_{pin}) + {{&pin_{pin}, {instance}, PIN_{pin}, {pinmux} & 0xffff}}, +#endif''') + print(f'{{NULL, 0, 0}}') + print(f'}};') + print() + +print('''\ +#include +#include "py/obj.h" +#include "sam.h" +#include "samd/pins.h" +#include "mpconfigport.h" +#include "atmel_start_pins.h" +#include "hal/include/hal_gpio.h" +#include "common-hal/microcontroller/Pin.h" +''') + +defines('can_rx', 'RX') +defines('can_tx', 'TX') diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 6e98af8686..2614dc011f 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -142,6 +142,9 @@ endif ifeq ($(CIRCUITPY_CAMERA),1) SRC_PATTERNS += camera/% endif +ifeq ($(CIRCUITPY_CANIO),1) +SRC_PATTERNS += _canio/% +endif ifeq ($(CIRCUITPY_COUNTIO),1) SRC_PATTERNS += countio/% endif @@ -315,6 +318,9 @@ SRC_COMMON_HAL_ALL = \ busio/__init__.c \ camera/__init__.c \ camera/Camera.c \ + _canio/CAN.c \ + _canio/Listener.c \ + _canio/__init__.c \ countio/Counter.c \ countio/__init__.c \ digitalio/DigitalInOut.c \ @@ -384,6 +390,7 @@ $(filter $(SRC_PATTERNS), \ _bleio/Address.c \ _bleio/Attribute.c \ _bleio/ScanEntry.c \ + _canio/Match.c \ _eve/__init__.c \ camera/ImageFormat.c \ digitalio/Direction.c \ @@ -402,6 +409,8 @@ SRC_SHARED_MODULE_ALL = \ _bleio/Attribute.c \ _bleio/ScanEntry.c \ _bleio/ScanResults.c \ + _canio/Match.c \ + _canio/Message.c \ _eve/__init__.c \ _pixelbuf/PixelBuf.c \ _pixelbuf/__init__.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 4272de2ec7..d1b12f3544 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -336,6 +336,13 @@ extern const struct _mp_obj_module_t camera_module; #define CAMERA_MODULE #endif +#if CIRCUITPY_CANIO +extern const struct _mp_obj_module_t canio_module; +#define CANIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__canio), (mp_obj_t)&canio_module }, +#else +#define CANIO_MODULE +#endif + #if CIRCUITPY_COUNTIO extern const struct _mp_obj_module_t countio_module; #define COUNTIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_countio), (mp_obj_t)&countio_module }, @@ -766,6 +773,7 @@ extern const struct _mp_obj_module_t wifi_module; BOARD_MODULE \ BUSIO_MODULE \ CAMERA_MODULE \ + CANIO_MODULE \ COUNTIO_MODULE \ DIGITALIO_MODULE \ DISPLAYIO_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 54bdefc6dd..9b9bd83b4d 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -93,6 +93,9 @@ CFLAGS += -DCIRCUITPY_BUSIO=$(CIRCUITPY_BUSIO) CIRCUITPY_CAMERA ?= 0 CFLAGS += -DCIRCUITPY_CAMERA=$(CIRCUITPY_CAMERA) +CIRCUITPY_CANIO ?= 0 +CFLAGS += -DCIRCUITPY_CANIO=$(CIRCUITPY_CANIO) + CIRCUITPY_DIGITALIO ?= 1 CFLAGS += -DCIRCUITPY_DIGITALIO=$(CIRCUITPY_DIGITALIO) diff --git a/shared-bindings/_canio/CAN.c b/shared-bindings/_canio/CAN.c new file mode 100644 index 0000000000..4c7ae3650a --- /dev/null +++ b/shared-bindings/_canio/CAN.c @@ -0,0 +1,338 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "common-hal/_canio/CAN.h" +#include "common-hal/_canio/Listener.h" +#include "shared-bindings/_canio/CAN.h" +#include "shared-bindings/_canio/Listener.h" +#include "shared-bindings/_canio/Match.h" +#include "shared-bindings/_canio/Message.h" +#include "shared-bindings/microcontroller/Pin.h" + +#include "py/objproperty.h" +#include "py/runtime.h" + +//| +//| class CAN: +//| """CAN bus protocol""" +//| +//| def __init__(self, +//| rx: microcontroller.Pin, +//| tx: Optional[microcontroller.Pin]=None, +//| *, +//| baudrate: int = 250000, +//| loopback: bool = False, +//| ): +//| """A common shared-bus protocol. The rx and tx pins are generally +//| connected to a transceiver which controls the H and L pins on a shared +//| bus. +//| +//| :param ~microcontrller.Pin rx: the pin to receive with. +//| :param ~microcontrller.Pin tx: the pin to transmit with, or None if the peripheral should operate in "silent" mode. +//| :param int baudrate: The bit rate of the bus in Hz. All devices on the bus must agree on this value. +//| :param bool loopback: True if the peripheral will be operated in loopback mode. +//| """ +//| ... +//| +//## auto_restart: bool = False, # Whether to restart communications after entering bus-off state +//## sample_point: float = .875, # When to sample within bit time (0.0-1.0) +STATIC mp_obj_t canio_can_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_rx, ARG_tx, ARG_baudrate, ARG_loopback, ARG_silent, NUM_ARGS }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_rx, MP_ARG_OBJ | MP_ARG_REQUIRED, {.u_obj = 0} }, + { MP_QSTR_tx, MP_ARG_OBJ, {.u_obj = 0} }, + { MP_QSTR_baudrate, MP_ARG_INT, {.u_int = 250000} }, + { MP_QSTR_loopback, MP_ARG_BOOL, {.u_bool = false} }, + { MP_QSTR_silent, MP_ARG_BOOL, {.u_bool = false} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); + + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + +mp_printf(&mp_plat_print, "ARG_rx=%d args[ARG_rx].u_obj=%p\n", ARG_rx, args[ARG_rx].u_obj); +mp_printf(&mp_plat_print, "ARG_tx=%d args[ARG_tx].u_obj=%p\n", ARG_tx, args[ARG_tx].u_obj); + + mcu_pin_obj_t *rx_pin = validate_obj_is_free_pin(args[ARG_rx].u_obj); +mp_printf(&mp_plat_print, "rx_pin=%p\n", rx_pin); + mcu_pin_obj_t *tx_pin = validate_obj_is_free_pin_or_none(args[ARG_tx].u_obj); +mp_printf(&mp_plat_print, "tx_pin=%p\n", tx_pin); + + canio_can_obj_t *self = m_new_obj(canio_can_obj_t); + self->base.type = &canio_can_type; + common_hal_canio_can_construct(self, rx_pin, tx_pin, args[ARG_baudrate].u_int, args[ARG_loopback].u_bool, args[ARG_silent].u_bool); + + return MP_OBJ_FROM_PTR(self); +} + + +//| baudrate: int +//| """The baud rate(read-only)""" +//| +STATIC mp_obj_t canio_can_baudrate_get(mp_obj_t self_in) { + canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_can_check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_can_baudrate_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_can_baudrate_get_obj, canio_can_baudrate_get); + +STATIC const mp_obj_property_t canio_can_baudrate_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_can_baudrate_get_obj, + (mp_obj_t)mp_const_none, + (mp_obj_t)mp_const_none}, +}; + +//| state: State +//| """The status of the hardware (read-only)""" +//| +STATIC mp_obj_t canio_can_state_get(mp_obj_t self_in) { + canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_can_check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_can_state_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_can_state_get_obj, canio_can_state_get); + +STATIC const mp_obj_property_t canio_can_state_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_can_state_get_obj, + (mp_obj_t)mp_const_none, + (mp_obj_t)mp_const_none}, +}; + +//| transmit_error_count: int +//| """The number of transmit errors (read-only). Increased for a detected transmission error, decreased for successful transmission. Limited to the range from 0 to 255 inclusive. Also called TEC.""" +//| +STATIC mp_obj_t canio_can_transmit_error_count_get(mp_obj_t self_in) { + canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_can_check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_can_transmit_error_count_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_can_transmit_error_count_get_obj, canio_can_transmit_error_count_get); + +STATIC const mp_obj_property_t canio_can_transmit_error_count_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_can_transmit_error_count_get_obj, + (mp_obj_t)mp_const_none, + (mp_obj_t)mp_const_none}, +}; + +//| receive_error_count: int +//| """The number of receive errors (read-only). Increased for a detected reception error, decreased for successful reception. Limited to the range from 0 to 255 inclusive. Also called REC.""" +//| +STATIC mp_obj_t canio_can_receive_error_count_get(mp_obj_t self_in) { + canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_can_check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_can_receive_error_count_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_can_receive_error_count_get_obj, canio_can_receive_error_count_get); + +STATIC const mp_obj_property_t canio_can_receive_error_count_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_can_receive_error_count_get_obj, + (mp_obj_t)mp_const_none, + (mp_obj_t)mp_const_none}, +}; + +//| error_warning_state_count: int +//| """The number of times the controller enterted the Error Warning state (read-only). This number wraps around to 0 after an implementation-defined number of errors.""" +//| +STATIC mp_obj_t canio_can_error_warning_state_count_get(mp_obj_t self_in) { + canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_can_check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_can_error_warning_state_count_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_can_error_warning_state_count_get_obj, canio_can_error_warning_state_count_get); + +STATIC const mp_obj_property_t canio_can_error_warning_state_count_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_can_error_warning_state_count_get_obj, + (mp_obj_t)mp_const_none, + (mp_obj_t)mp_const_none}, +}; + +//| error_passive_state_count: int +//| """The number of times the controller enterted the Error Passive state (read-only). This number wraps around to 0 after an implementation-defined number of errors.""" +//| +STATIC mp_obj_t canio_can_error_passive_state_count_get(mp_obj_t self_in) { + canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_can_check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_can_error_passive_state_count_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_can_error_passive_state_count_get_obj, canio_can_error_passive_state_count_get); + +STATIC const mp_obj_property_t canio_can_error_passive_state_count_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_can_error_passive_state_count_get_obj, + (mp_obj_t)mp_const_none, + (mp_obj_t)mp_const_none}, +}; + +//| bus_off_state_count: int +//| """The number of times the controller enterted the Bus Off state (read-only). This number wraps around to 0 after an implementation-defined number of errors.""" +//| +STATIC mp_obj_t canio_can_bus_off_state_count_get(mp_obj_t self_in) { + canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_can_check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_can_bus_off_state_count_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_can_bus_off_state_count_get_obj, canio_can_bus_off_state_count_get); + +STATIC const mp_obj_property_t canio_can_bus_off_state_count_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_can_bus_off_state_count_get_obj, + (mp_obj_t)mp_const_none, + (mp_obj_t)mp_const_none}, +}; + +#if 0 +//| # pending_tx_count: int +//| # """The number of messages waiting to be transmitted. (read-only)""" +#endif + +//| def listen(filters: Optional[Sequence[Filter]]=None, *, timeout: float=10) -> Listener: +//| """Start receiving messages that match any one of the filters. +//| Creating a listener is an expensive operation and can interfere with reception of messages by other listeners. +//| There is an implementation-defined maximum number of listeners and limit to the complexity of the filters. +//| If the hardware cannot support all the requested filters, a ValueError is raised. Note that generally there are some number of hardware filters shared among all fifos. +//| A message can be received by at most one Listener. +//| An empty filter list causes all messages to be accepted. +//| Timeout dictates how long readinto, read and next() will block. +//| Readinto will return false(), read will return None, and next() will raise StopIteration.""" +//| ... +//| +STATIC mp_obj_t canio_can_listen(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + canio_can_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + common_hal_canio_can_check_for_deinit(self); + + enum { ARG_match, ARG_timeout, NUM_ARGS }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_match, MP_ARG_OBJ, {.u_obj = 0} }, + { MP_QSTR_timeout, MP_ARG_OBJ, {.u_obj = 0} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); + + mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + size_t nmatch = 0; + mp_obj_t *match_objects = NULL; + + if (args[ARG_match].u_obj) { + mp_obj_get_array(args[ARG_match].u_obj, &nmatch, &match_objects); + } + + canio_match_obj_t *matches[nmatch]; + for (size_t i=0; iname); + } + matches[i] = MP_OBJ_TO_PTR(match_objects[i]); + } + + float timeout = args[ARG_timeout].u_obj ? mp_obj_get_float(args[ARG_timeout].u_obj) : 10.0f; + canio_listener_obj_t *listener = m_new_obj(canio_listener_obj_t); + listener->base.type = &canio_listener_type; + common_hal_canio_listener_construct(listener, self, nmatch, matches, timeout); + return listener; +} +MP_DEFINE_CONST_FUN_OBJ_KW(canio_can_listen_obj, 1, canio_can_listen); + +//| def send(message: Message) -> None: +//| """Send a message on the bus with the given data and id. +//| If the message could not be sent due to a full fifo or a bus error condition, RuntimeError is raised. +//| """ +//| ... +//| +STATIC mp_obj_t canio_can_send(mp_obj_t self_in, mp_obj_t message_in) { + canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_can_check_for_deinit(self); + mp_obj_type_t *message_type = mp_obj_get_type(message_in); + if (message_type != &canio_message_type) { + mp_raise_TypeError_varg(translate("expected '%q' but got '%q'"), MP_QSTR_Message, message_type->name); + } + + canio_message_obj_t *message = message_in; + common_hal_canio_can_send(self, message); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(canio_can_send_obj, canio_can_send); + +//| def deinit(self) -> None: +//| """Deinitialize this object, freeing its hardware resources""" +//| ... +//| +STATIC mp_obj_t canio_can_deinit(mp_obj_t self_in) { + canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_can_deinit(self); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_can_deinit_obj, canio_can_deinit); + +//| def __enter__(self) -> CAN: +//| """Returns self, to allow the object to be used in a `with` statement for resource control""" +//| ... +//| +STATIC mp_obj_t canio_can_enter(mp_obj_t self_in) { + canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_can_check_for_deinit(self); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_can_enter_obj, canio_can_enter); + +//| def __exit__(self, unused1, unused2, unused3) -> None: +//| """Calls deinit()""" +//| ... +STATIC mp_obj_t canio_can_exit(size_t num_args, const mp_obj_t args[]) { + canio_can_obj_t *self = MP_OBJ_TO_PTR(args[0]); + common_hal_canio_can_deinit(self); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(canio_can_exit_obj, 4, 4, canio_can_exit); + +STATIC const mp_rom_map_elem_t canio_can_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&canio_can_enter_obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&canio_can_exit_obj) }, + { MP_ROM_QSTR(MP_QSTR_bus_off_state_count), MP_ROM_PTR(&canio_can_bus_off_state_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&canio_can_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_error_passive_state_count), MP_ROM_PTR(&canio_can_error_passive_state_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_error_warning_state_count), MP_ROM_PTR(&canio_can_error_warning_state_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_listen), MP_ROM_PTR(&canio_can_listen_obj) }, + { MP_ROM_QSTR(MP_QSTR_receive_error_count), MP_ROM_PTR(&canio_can_receive_error_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_send), MP_ROM_PTR(&canio_can_send_obj) }, + { MP_ROM_QSTR(MP_QSTR_state), MP_ROM_PTR(&canio_can_state_obj) }, + { MP_ROM_QSTR(MP_QSTR_baudrate), MP_ROM_PTR(&canio_can_baudrate_obj) }, + { MP_ROM_QSTR(MP_QSTR_transmit_error_count), MP_ROM_PTR(&canio_can_transmit_error_count_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(canio_can_locals_dict, canio_can_locals_dict_table); + +const mp_obj_type_t canio_can_type = { + { &mp_type_type }, + .name = MP_QSTR_CAN, + .make_new = canio_can_make_new, + .locals_dict = (mp_obj_t)&canio_can_locals_dict, +}; diff --git a/shared-bindings/_canio/CAN.h b/shared-bindings/_canio/CAN.h new file mode 100644 index 0000000000..81040cf237 --- /dev/null +++ b/shared-bindings/_canio/CAN.h @@ -0,0 +1,31 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 canio_can_type; diff --git a/shared-bindings/_canio/Listener.c b/shared-bindings/_canio/Listener.c new file mode 100644 index 0000000000..7f83c735f0 --- /dev/null +++ b/shared-bindings/_canio/Listener.c @@ -0,0 +1,197 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "shared-bindings/_canio/Listener.h" +#include "shared-bindings/_canio/Message.h" +#include "common-hal/_canio/Listener.h" + +#include "py/runtime.h" +#include "py/objproperty.h" + +//| class Listener: +//| """Listens for CAN message +//| +//| _canio.Listener is not constructed directly, but instead by calling the +//| Listen method of a _canio.CAN object.""" +//| + +//| def read(self) -> Optional[Message]: +//| """Returns a message, after waiting up to self.timeout seconds +//| +//| If no message is received in time, None is returned. Otherwise, +//| a Message is returned.""" +//| ... +//| +STATIC mp_obj_t canio_listener_read(mp_obj_t self_in) { + canio_listener_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_listener_check_for_deinit(self); + + canio_message_obj_t *message = m_new_obj(canio_message_obj_t); + self->base.type = &canio_message_type; + + if (common_hal_canio_listener_readinto(self, message)) { + return message; + } else { + m_free(message); // message did not escape into vm + } + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_read_obj, canio_listener_read); + +//| def readinto(self, message: Message) -> bool: +//| """Returns a message, after waiting up to self.timeout seconds +//| +//| Returns True (and modifies message) if a message was received, +//| False otherwise.""" +//| ... +//| +STATIC mp_obj_t canio_listener_readinto(mp_obj_t self_in, mp_obj_t message) { + canio_listener_obj_t *self = MP_OBJ_TO_PTR(self_in); + mp_obj_type_t *type = mp_obj_get_type(message); + if (type != &canio_message_type) { + mp_raise_TypeError_varg(translate("expected '%q' but got '%q'"), MP_QSTR_Message, type->name); + } + common_hal_canio_listener_check_for_deinit(self); + return mp_obj_new_bool(common_hal_canio_listener_readinto(self, message)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(canio_listener_readinto_obj, canio_listener_readinto); + +//| def in_waiting(self) -> int: +//| """Returns the number of messages waiting""" +//| ... +//| +STATIC mp_obj_t canio_listener_in_waiting(mp_obj_t self_in) { + canio_listener_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_listener_check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_listener_in_waiting(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_in_waiting_obj, canio_listener_in_waiting); + +//| def __iter__(self): +//| """Returns self, unless the object is deinitialized""" +//| ... +//| +STATIC mp_obj_t canio_listener_iter(mp_obj_t self_in) { + canio_listener_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_listener_check_for_deinit(self); + return self; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_iter_obj, canio_listener_iter); + +//| def __next__(self): +//| """Returns the next waiting message, if one is available +//| +//| If the object is deinitialized, raises ValueError. +//| +//| If no message is waiting raises StopIteration""" +//| ... +//| +STATIC mp_obj_t canio_listener_next(mp_obj_t self_in) { + canio_listener_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_listener_check_for_deinit(self); + if(common_hal_canio_listener_in_waiting(self)) { + return canio_listener_read(self_in); + } + return self; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_next_obj, canio_listener_next); + +//| def deinit(self) -> None: +//| """Deinitialize this object, freeing its hardware resources""" +//| ... +//| +STATIC mp_obj_t canio_listener_deinit(mp_obj_t self_in) { + canio_listener_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_listener_deinit(self); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_deinit_obj, canio_listener_deinit); + +//| def __enter__(self) -> CAN: +//| """Returns self, to allow the object to be used in a `with` statement for resource control""" +//| ... +//| +STATIC mp_obj_t canio_listener_enter(mp_obj_t self_in) { + canio_listener_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_listener_check_for_deinit(self); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_enter_obj, canio_listener_enter); + +//| def __exit__(self, unused1, unused2, unused3) -> None: +//| """Calls deinit()""" +//| ... +STATIC mp_obj_t canio_listener_exit(size_t num_args, const mp_obj_t args[]) { + canio_listener_obj_t *self = MP_OBJ_TO_PTR(args[0]); + common_hal_canio_listener_deinit(self); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(canio_listener_exit_obj, 4, 4, canio_listener_exit); + + +//| timeout : float +STATIC mp_obj_t canio_listener_timeout_get(mp_obj_t self_in) { + canio_listener_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_listener_check_for_deinit(self); + return mp_obj_new_float(common_hal_canio_listener_get_timeout(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_timeout_get_obj, canio_listener_timeout_get); + +STATIC mp_obj_t canio_listener_timeout_set(mp_obj_t self_in, mp_obj_t timeout_in) { + canio_listener_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_listener_check_for_deinit(self); + common_hal_canio_listener_set_timeout(self, mp_obj_get_float(timeout_in)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(canio_listener_timeout_set_obj, canio_listener_timeout_set); + +STATIC const mp_obj_property_t canio_listener_timeout_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_listener_timeout_get_obj, + (mp_obj_t)&canio_listener_timeout_set_obj, + (mp_obj_t)mp_const_none}, +}; + + + +STATIC const mp_rom_map_elem_t canio_listener_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&canio_listener_enter_obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&canio_listener_exit_obj) }, + { MP_ROM_QSTR(MP_QSTR___iter__), MP_ROM_PTR(&canio_listener_iter_obj) }, + { MP_ROM_QSTR(MP_QSTR___next__), MP_ROM_PTR(&canio_listener_next_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&canio_listener_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_in_waiting), MP_ROM_PTR(&canio_listener_in_waiting_obj) }, + { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&canio_listener_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&canio_listener_readinto_obj) }, + { MP_ROM_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&canio_listener_timeout_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(canio_listener_locals_dict, canio_listener_locals_dict_table); + +const mp_obj_type_t canio_listener_type = { + { &mp_type_type }, + .name = MP_QSTR_Listener, + .locals_dict = (mp_obj_dict_t*)&canio_listener_locals_dict, +}; diff --git a/shared-bindings/_canio/Listener.h b/shared-bindings/_canio/Listener.h new file mode 100644 index 0000000000..eaa3490dff --- /dev/null +++ b/shared-bindings/_canio/Listener.h @@ -0,0 +1,31 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 canio_listener_type; diff --git a/shared-bindings/_canio/Match.c b/shared-bindings/_canio/Match.c new file mode 100644 index 0000000000..6c32aa5390 --- /dev/null +++ b/shared-bindings/_canio/Match.c @@ -0,0 +1,140 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "shared-bindings/_canio/Match.h" +#include "shared-module/_canio/Match.h" + +#include "py/objproperty.h" +#include "py/runtime.h" + +//| class Match: +//| """Describe CAN bus messages to match""" +//| +//| +//| def __init__(self, address: int, *, mask: int = 0, extended: bool = False): +//| """Construct a Match with the given properties. +//| +//| If mask is nonzero, then the filter is for any sender which matches all +//| the nonzero bits in mask. Otherwise, it matches exactly the given address. +//| If extended is true then only extended addresses are matched, otherwise +//| only standard addresses are matched.""" +//| + +STATIC mp_obj_t canio_match_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_address, ARG_mask, ARG_extended, NUM_ARGS }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_address, MP_ARG_INT | MP_ARG_REQUIRED, {.u_int = 0} }, + { MP_QSTR_mask, MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_extended, MP_ARG_BOOL, {.u_bool = false} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); + + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + int address_bits = args[ARG_extended].u_bool ? 0x1fffffff : 0x7ff; + int address = args[ARG_address].u_int; + int mask = args[ARG_mask].u_int; + + if(address & ~address_bits) { + mp_raise_ValueError_varg(translate("%q out of range"), MP_QSTR_address); + } + + if(mask & ~address_bits) { + mp_raise_ValueError_varg(translate("%q out of range"), MP_QSTR_mask); + } + + canio_match_obj_t *self = m_new_obj(canio_match_obj_t); + self->base.type = &canio_match_type; + common_hal_canio_match_construct(self, args[ARG_address].u_int, args[ARG_mask].u_int, args[ARG_extended].u_bool); + return self; +} + +//| address: int +//| """The address to match""" +//| + +STATIC mp_obj_t canio_match_address_get(mp_obj_t self_in) { + canio_match_obj_t *self = self_in; + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_match_address_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_match_address_get_obj, canio_match_address_get); + +const mp_obj_property_t canio_match_address_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_match_address_get_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| +//| mask: int +//| """The optional mask of addresses to match""" +//| + +STATIC mp_obj_t canio_match_mask_get(mp_obj_t self_in) { + canio_match_obj_t *self = self_in; + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_match_mask_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_match_mask_get_obj, canio_match_mask_get); + +const mp_obj_property_t canio_match_mask_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_match_mask_get_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| extended: bool +//| """True to match extended addresses, False to match standard addresses""" +//| + +STATIC mp_obj_t canio_match_extended_get(mp_obj_t self_in) { + canio_match_obj_t *self = self_in; + return mp_obj_new_bool(common_hal_canio_match_extended_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_match_extended_get_obj, canio_match_extended_get); + +const mp_obj_property_t canio_match_extended_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_match_extended_get_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +STATIC const mp_rom_map_elem_t canio_match_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_address), MP_ROM_PTR(&canio_match_address_obj) }, + { MP_ROM_QSTR(MP_QSTR_mask), MP_ROM_PTR(&canio_match_mask_obj) }, + { MP_ROM_QSTR(MP_QSTR_extended), MP_ROM_PTR(&canio_match_extended_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(canio_match_locals_dict, canio_match_locals_dict_table); + +const mp_obj_type_t canio_match_type = { + { &mp_type_type }, + .name = MP_QSTR_Match, + .make_new = canio_match_make_new, + .locals_dict = (mp_obj_dict_t*)&canio_match_locals_dict, +}; diff --git a/shared-bindings/_canio/Match.h b/shared-bindings/_canio/Match.h new file mode 100644 index 0000000000..adf98eb865 --- /dev/null +++ b/shared-bindings/_canio/Match.h @@ -0,0 +1,33 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 canio_match_type; + +// Nothing now. diff --git a/shared-bindings/_canio/Message.c b/shared-bindings/_canio/Message.c new file mode 100644 index 0000000000..a8e5883541 --- /dev/null +++ b/shared-bindings/_canio/Message.c @@ -0,0 +1,213 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "shared-bindings/_canio/Message.h" +#include "shared-module/_canio/Message.h" + +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/runtime.h" + +//| class Message: +//| def __init__(self, id: int=0, data: Optional[bytes] = None, *, size: Optional[int] = None, rtr: bool = False): +//| """Construct a Message to send on a CAN bus +//| +//| :param int id: The numeric ID of the message +//| :param bytes data: The content of the message +//| :param int size: The amount of data requested, for an rtr +//| :param bool rtr: True if the message represents an rtr (Remote Transmission Request) +//| +//| In CAN, messages can have a size from 0 to 8 bytes. +//| +//| For a non-rtr message, specify `data`. For an rtr-message, specify either `data` (a dummy buffer of the requested size) or `size`. +//| """ +//| ... +//| +STATIC mp_obj_t canio_message_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_id, ARG_data, ARG_size, ARG_rtr, NUM_ARGS }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_id, MP_ARG_INT, {.u_obj = 0} }, + { MP_QSTR_data, MP_ARG_OBJ, {.u_obj = 0} }, + { MP_QSTR_size, MP_ARG_INT, {.u_int = -1} }, + { MP_QSTR_rtr, MP_ARG_BOOL, {.u_bool = false} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); + + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + bool rtr = args[ARG_rtr].u_bool; + size_t size = (size_t)args[ARG_size].u_int; + bool specified_size = (size != (size_t)-1); + bool specified_data = (args[ARG_data].u_obj != NULL); + + if(specified_size && specified_data) { + mp_raise_TypeError(translate("specify size or data, but not both")); + } + + mp_buffer_info_t data; + if (specified_data) { + mp_get_buffer_raise(args[ARG_data].u_obj, &data, MP_BUFFER_READ); + } else if (specified_size) { + data.buf = 0; + data.len = size; + } else { + data.buf = 0; + data.len = 0; + } + + if(data.len > 8) { + mp_raise_ValueError(translate("Messages limited to 8 bytes")); + } + + canio_message_obj_t *self = m_new_obj(canio_message_obj_t); + self->base.type = &canio_message_type; + common_hal_canio_message_construct(self, args[ARG_id].u_int, data.buf, data.len, rtr); + return self; +} + +//| id: int +//| """The numeric ID of the message""" +//| +STATIC mp_obj_t canio_message_id_get(const mp_obj_t self_in) { + canio_message_obj_t *self = self_in; + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_message_id_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_message_id_get_obj, canio_message_id_get); + +STATIC mp_obj_t canio_message_id_set(const mp_obj_t self_in, const mp_obj_t id) { + canio_message_obj_t *self = self_in; + common_hal_canio_message_id_set(self, mp_obj_get_int(id)); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(canio_message_id_set_obj, canio_message_id_set); + +STATIC const mp_obj_property_t canio_message_id_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_message_id_get_obj, + (mp_obj_t)&canio_message_id_set_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| data: bytes +//| """The content of the message, or dummy content in the case of an rtr. +//| +//| Assigning to data sets the bytes to zero""" +//| +STATIC mp_obj_t canio_message_data_get(const mp_obj_t self_in) { + canio_message_obj_t *self = self_in; + return mp_obj_new_bytes((const byte*)common_hal_canio_message_data_get(self), common_hal_canio_message_size_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_message_data_get_obj, canio_message_data_get); + +STATIC mp_obj_t canio_message_data_set(const mp_obj_t self_in, const mp_obj_t data_in) { + canio_message_obj_t *self = self_in; + mp_buffer_info_t data; + mp_get_buffer_raise(data_in, &data, MP_BUFFER_READ); + if(data.len > 8) { + mp_raise_ValueError(translate("Messages limited to 8 bytes")); + } + common_hal_canio_message_data_set(self, data.buf, data.len); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(canio_message_data_set_obj, canio_message_data_set); + + +STATIC const mp_obj_property_t canio_message_data_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_message_data_get_obj, + (mp_obj_t)&canio_message_data_set_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + + +//| size: int +//| """The length of the message, or the length of the requested data in the case of an rtr""" +//| +STATIC mp_obj_t canio_message_size_get(const mp_obj_t self_in) { + canio_message_obj_t *self = self_in; + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_message_size_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_message_size_get_obj, canio_message_size_get); + +STATIC mp_obj_t canio_message_size_set(const mp_obj_t self_in, const mp_obj_t size_in) { + canio_message_obj_t *self = self_in; + int size = mp_obj_get_int(size_in); + if(size > 8) { + mp_raise_ValueError(translate("Messages limited to 8 bytes")); + } + common_hal_canio_message_size_set(self, size); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(canio_message_size_set_obj, canio_message_size_set); + + +STATIC const mp_obj_property_t canio_message_size_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_message_size_get_obj, + (mp_obj_t)&canio_message_size_set_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| rtr: bool +//| """True if the message represents a remote transmission request (RTR)""" +//| +STATIC mp_obj_t canio_message_rtr_get(const mp_obj_t self_in) { + canio_message_obj_t *self = self_in; + return mp_obj_new_bool(common_hal_canio_message_rtr_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_message_rtr_get_obj, canio_message_rtr_get); + +STATIC mp_obj_t canio_message_rtr_set(const mp_obj_t self_in, const mp_obj_t rtr) { + canio_message_obj_t *self = self_in; + common_hal_canio_message_size_set(self, mp_obj_is_true(rtr)); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(canio_message_rtr_set_obj, canio_message_rtr_set); + + +STATIC const mp_obj_property_t canio_message_rtr_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_message_rtr_get_obj, + (mp_obj_t)&canio_message_rtr_set_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + + +STATIC const mp_rom_map_elem_t canio_message_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_id), MP_ROM_PTR(&canio_message_id_obj) }, + { MP_ROM_QSTR(MP_QSTR_data), MP_ROM_PTR(&canio_message_data_obj) }, + { MP_ROM_QSTR(MP_QSTR_size), MP_ROM_PTR(&canio_message_size_obj) }, + { MP_ROM_QSTR(MP_QSTR_rtr), MP_ROM_PTR(&canio_message_rtr_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(canio_message_locals_dict, canio_message_locals_dict_table); + +const mp_obj_type_t canio_message_type = { + { &mp_type_type }, + .name = MP_QSTR_Message, + .make_new = canio_message_make_new, + .locals_dict = (mp_obj_t)&canio_message_locals_dict, +}; diff --git a/shared-bindings/_canio/Message.h b/shared-bindings/_canio/Message.h new file mode 100644 index 0000000000..32d6801bc3 --- /dev/null +++ b/shared-bindings/_canio/Message.h @@ -0,0 +1,31 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 canio_message_type; diff --git a/shared-bindings/_canio/__init__.c b/shared-bindings/_canio/__init__.c new file mode 100644 index 0000000000..4da008ff21 --- /dev/null +++ b/shared-bindings/_canio/__init__.c @@ -0,0 +1,73 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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. + */ + +//| """CAN bus access +//| +//| The `_canio` module contains low level classes to support the CAN bus +//| protocol. +//| +//| All classes change hardware state and should be deinitialized when they +//| are no longer needed if the program continues after use. To do so, either +//| call :py:meth:`!deinit` or use a context manager. See +//| :ref:`lifetime-and-contextmanagers` for more info. +//| +//| For example:: +//| +//| import _canio +//| from board import * +//| +//| can = _canio.BUS(board.CANRX, board.CANTX) +//| can.write(408, b"adafruit") +//| can.deinit() +//| +//| This example will write the data 'adafruit' onto the CAN bus to any +//| device listening for message id 408.""" +//| + +#include "py/obj.h" + +#include "shared-bindings/_canio/__init__.h" +#include "shared-bindings/_canio/CAN.h" +#include "shared-bindings/_canio/Match.h" +#include "shared-bindings/_canio/Message.h" + +STATIC const mp_rom_map_elem_t canio_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__canio) }, + { MP_ROM_QSTR(MP_QSTR_CAN), MP_ROM_PTR(&canio_can_type) }, + { MP_ROM_QSTR(MP_QSTR_Match), MP_ROM_PTR(&canio_match_type) }, + { MP_ROM_QSTR(MP_QSTR_Message), MP_ROM_PTR(&canio_message_type) }, +#if 0 + { MP_ROM_QSTR(MP_QSTR_Listener), MP_ROM_PTR(&canio_listener_type) }, +#endif +}; + + +STATIC MP_DEFINE_CONST_DICT(canio_module_globals, canio_module_globals_table); + +const mp_obj_module_t canio_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&canio_module_globals, +}; diff --git a/shared-bindings/_canio/__init__.h b/shared-bindings/_canio/__init__.h new file mode 100644 index 0000000000..45e76369c7 --- /dev/null +++ b/shared-bindings/_canio/__init__.h @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 + +// Nothing now. diff --git a/shared-module/_canio/Match.c b/shared-module/_canio/Match.c new file mode 100644 index 0000000000..2b696addb0 --- /dev/null +++ b/shared-module/_canio/Match.c @@ -0,0 +1,43 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "shared-module/_canio/Match.h" + +void common_hal_canio_match_construct(canio_match_obj_t *self, int address, int mask, bool extended) { + self->address = address; + self->mask = mask; + self->extended = extended; +} + +int common_hal_canio_match_address_get(const canio_match_obj_t *self) { + return self->address; +} +int common_hal_canio_match_mask_get(const canio_match_obj_t *self) { + return self->mask; +} +bool common_hal_canio_match_extended_get(const canio_match_obj_t *self) { + return self->extended; +} diff --git a/shared-module/_canio/Match.h b/shared-module/_canio/Match.h new file mode 100644 index 0000000000..099df976df --- /dev/null +++ b/shared-module/_canio/Match.h @@ -0,0 +1,41 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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" + +typedef struct { + mp_obj_base_t base; + int address; + int mask; + bool extended; +} canio_match_obj_t; + +void common_hal_canio_match_construct(canio_match_obj_t *self, int address, int mask, bool extended); +int common_hal_canio_match_address_get(const canio_match_obj_t *self); +int common_hal_canio_match_mask_get(const canio_match_obj_t *self); +bool common_hal_canio_match_extended_get(const canio_match_obj_t *self); diff --git a/shared-module/_canio/Message.c b/shared-module/_canio/Message.c new file mode 100644 index 0000000000..df6a40a0af --- /dev/null +++ b/shared-module/_canio/Message.c @@ -0,0 +1,85 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "shared-module/_canio/Message.h" + +#include + +void common_hal_canio_message_construct(canio_message_obj_t *self, int id, void *data, size_t size, bool rtr) +{ + self->id = id; + self->size = size; + self->rtr = rtr; + if (data) { + memcpy(self->data, data, size); + } else { + memset(self->data, 0, size); + } +} + +int common_hal_canio_message_id_get(const canio_message_obj_t *self) +{ + return self->id; +} + +void common_hal_canio_message_id_set(canio_message_obj_t *self, int id) +{ + self->id = id; +} + + +const void *common_hal_canio_message_data_get(const canio_message_obj_t *self) +{ + return self->data; +} + +const void common_hal_canio_message_data_set(canio_message_obj_t *self, const void *data, size_t size) +{ + memcpy(self->data, data, size); +} + + +size_t common_hal_canio_message_size_get(const canio_message_obj_t *self) +{ + return self->size; +} + +void common_hal_canio_message_size_set(canio_message_obj_t *self, size_t size) +{ + memset(self->data, 0, size); + self->size = size; +} + + +bool common_hal_canio_message_rtr_get(const canio_message_obj_t *self) +{ + return self->rtr; +} + +void common_hal_canio_message_rtr_set(canio_message_obj_t *self, bool rtr) +{ + self->rtr = rtr; +} diff --git a/shared-module/_canio/Message.h b/shared-module/_canio/Message.h new file mode 100644 index 0000000000..e846f1095f --- /dev/null +++ b/shared-module/_canio/Message.h @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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" + +typedef struct { + mp_obj_base_t base; + int id; + size_t size; + uint8_t data[8]; + bool rtr; +} canio_message_obj_t; + +void common_hal_canio_message_construct(canio_message_obj_t *self, int id, void *data, size_t size, bool rtr); +bool common_hal_canio_message_rtr_get(const canio_message_obj_t *self); +int common_hal_canio_message_id_get(const canio_message_obj_t *self); +const void *common_hal_canio_message_data_get(const canio_message_obj_t *self); +size_t common_hal_canio_message_size_get(const canio_message_obj_t *self); +void common_hal_canio_message_rtr_set(canio_message_obj_t *self, bool rtr); +void common_hal_canio_message_id_set(canio_message_obj_t *self, int id); +void common_hal_canio_message_data_set(canio_message_obj_t *self, const void *data, size_t size); +void common_hal_canio_message_size_set(canio_message_obj_t *self, size_t size); From 65ca1c7bbc84cd88d3aae69d89d2ff2c287ef884 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 16 Sep 2020 11:57:24 -0500 Subject: [PATCH 0928/1293] _canio: Message: Setting data should set the size to match --- shared-module/_canio/Message.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shared-module/_canio/Message.c b/shared-module/_canio/Message.c index df6a40a0af..1ac5b81789 100644 --- a/shared-module/_canio/Message.c +++ b/shared-module/_canio/Message.c @@ -58,6 +58,7 @@ const void *common_hal_canio_message_data_get(const canio_message_obj_t *self) const void common_hal_canio_message_data_set(canio_message_obj_t *self, const void *data, size_t size) { + self->size = size; memcpy(self->data, data, size); } From 37af9dde90a65626c60debfe7ede034534a6a823 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 16 Sep 2020 11:57:57 -0500 Subject: [PATCH 0929/1293] Listener: fix doc markup, include in globals of its module --- shared-bindings/_canio/Listener.c | 6 +++--- shared-bindings/_canio/__init__.c | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/shared-bindings/_canio/Listener.c b/shared-bindings/_canio/Listener.c index 7f83c735f0..d68138d997 100644 --- a/shared-bindings/_canio/Listener.c +++ b/shared-bindings/_canio/Listener.c @@ -32,10 +32,10 @@ #include "py/objproperty.h" //| class Listener: -//| """Listens for CAN message +//| """Listens for CAN message //| -//| _canio.Listener is not constructed directly, but instead by calling the -//| Listen method of a _canio.CAN object.""" +//| _canio.Listener is not constructed directly, but instead by calling the +//| Listen method of a _canio.CAN object.""" //| //| def read(self) -> Optional[Message]: diff --git a/shared-bindings/_canio/__init__.c b/shared-bindings/_canio/__init__.c index 4da008ff21..8b8aba8c49 100644 --- a/shared-bindings/_canio/__init__.c +++ b/shared-bindings/_canio/__init__.c @@ -57,11 +57,9 @@ STATIC const mp_rom_map_elem_t canio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__canio) }, { MP_ROM_QSTR(MP_QSTR_CAN), MP_ROM_PTR(&canio_can_type) }, + { MP_ROM_QSTR(MP_QSTR_Listener), MP_ROM_PTR(&canio_listener_type) }, { MP_ROM_QSTR(MP_QSTR_Match), MP_ROM_PTR(&canio_match_type) }, { MP_ROM_QSTR(MP_QSTR_Message), MP_ROM_PTR(&canio_message_type) }, -#if 0 - { MP_ROM_QSTR(MP_QSTR_Listener), MP_ROM_PTR(&canio_listener_type) }, -#endif }; From f8dcf2118e453b3adbf8ddbee9705749389b8799 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 16 Sep 2020 11:58:19 -0500 Subject: [PATCH 0930/1293] _canio: Add _canio.State enum-like class --- shared-bindings/_canio/__init__.c | 38 +++++++++++++++++++++++++++++-- shared-bindings/_canio/__init__.h | 6 ++++- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/shared-bindings/_canio/__init__.c b/shared-bindings/_canio/__init__.c index 8b8aba8c49..577466ed61 100644 --- a/shared-bindings/_canio/__init__.c +++ b/shared-bindings/_canio/__init__.c @@ -48,21 +48,55 @@ //| #include "py/obj.h" +#include "py/enum.h" #include "shared-bindings/_canio/__init__.h" #include "shared-bindings/_canio/CAN.h" #include "shared-bindings/_canio/Match.h" #include "shared-bindings/_canio/Message.h" +#include "shared-bindings/_canio/Listener.h" + +MAKE_ENUM_VALUE(canio_bus_state_type, bus_state, ERROR_ACTIVE, BUS_STATE_ERROR_ACTIVE); +MAKE_ENUM_VALUE(canio_bus_state_type, bus_state, ERROR_PASSIVE, BUS_STATE_ERROR_PASSIVE); +MAKE_ENUM_VALUE(canio_bus_state_type, bus_state, ERROR_WARNING, BUS_STATE_ERROR_WARNING); +MAKE_ENUM_VALUE(canio_bus_state_type, bus_state, BUS_OFF, BUS_STATE_OFF); + +//| class BusState: +//| """The state of the CAN bus""" +//| +//| ERROR_ACTIVE: object +//| """The bus is in the normal (active) state""" +//| +//| ERROR_WARNING: object +//| """The bus is in the normal (active) state, but a moderate number of errors have occurred recently""" +//| +//| ERROR_PASSIVE: object +//| """The bus is in the passive state due to the number of errors that have occurred recently""" +//| +//| BUS_OFF: object +//| """The bus has turned off due to the number of errors that have occurred recently. It must be restarted before it will send or receive packets""" +//| +MAKE_ENUM_MAP(canio_bus_state) { + MAKE_ENUM_MAP_ENTRY(bus_state, ERROR_ACTIVE), + MAKE_ENUM_MAP_ENTRY(bus_state, ERROR_PASSIVE), + MAKE_ENUM_MAP_ENTRY(bus_state, ERROR_WARNING), + MAKE_ENUM_MAP_ENTRY(bus_state, BUS_OFF), +}; +STATIC MP_DEFINE_CONST_DICT(canio_bus_state_locals_dict, canio_bus_state_locals_table); + +MAKE_PRINTER(_canio, canio_bus_state); + +MAKE_ENUM_TYPE(_canio, BusState, canio_bus_state); STATIC const mp_rom_map_elem_t canio_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__canio) }, + { MP_ROM_QSTR(MP_QSTR_BusState), MP_ROM_PTR(&canio_bus_state_type) }, { MP_ROM_QSTR(MP_QSTR_CAN), MP_ROM_PTR(&canio_can_type) }, { MP_ROM_QSTR(MP_QSTR_Listener), MP_ROM_PTR(&canio_listener_type) }, { MP_ROM_QSTR(MP_QSTR_Match), MP_ROM_PTR(&canio_match_type) }, { MP_ROM_QSTR(MP_QSTR_Message), MP_ROM_PTR(&canio_message_type) }, + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__canio) }, }; - STATIC MP_DEFINE_CONST_DICT(canio_module_globals, canio_module_globals_table); const mp_obj_module_t canio_module = { diff --git a/shared-bindings/_canio/__init__.h b/shared-bindings/_canio/__init__.h index 45e76369c7..e24eba92c1 100644 --- a/shared-bindings/_canio/__init__.h +++ b/shared-bindings/_canio/__init__.h @@ -26,4 +26,8 @@ #pragma once -// Nothing now. +typedef enum { + BUS_STATE_ERROR_ACTIVE, BUS_STATE_ERROR_PASSIVE, BUS_STATE_ERROR_WARNING, BUS_STATE_OFF +} canio_bus_state_t; + +extern const mp_obj_type_t canio_bus_state_type; From 635fcadb59fdba47d1628c3abff1b9bfc890a5d5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 16 Sep 2020 11:59:01 -0500 Subject: [PATCH 0931/1293] _canio.CAN: add error handling & bus state --- ports/atmel-samd/common-hal/_canio/CAN.c | 71 ++++++++++++++++-- ports/atmel-samd/common-hal/_canio/CAN.h | 37 ++++++---- shared-bindings/_canio/CAN.c | 93 ++++++++++++++++++------ 3 files changed, 156 insertions(+), 45 deletions(-) diff --git a/ports/atmel-samd/common-hal/_canio/CAN.c b/ports/atmel-samd/common-hal/_canio/CAN.c index dcd269495e..d2e7d8d9db 100644 --- a/ports/atmel-samd/common-hal/_canio/CAN.c +++ b/ports/atmel-samd/common-hal/_canio/CAN.c @@ -218,6 +218,15 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *rx, mc hri_can_write_XIDFC_reg(self->hw, dfc.reg); } + { + CAN_IE_Type ie = { + .bit.EWE = 1, + .bit.EPE = 1, + .bit.BOE = 1, + }; + hri_can_write_IE_reg(self->hw, ie.reg); + } + hri_can_write_XIDAM_reg(self->hw, CAN_XIDAM_RESETVALUE); // silent: The CAN is set in Bus Monitoring Mode by programming CCCR.MON to '1'. (tx pin unused) @@ -261,35 +270,71 @@ int common_hal_canio_can_baudrate_get(canio_can_obj_t *self) int common_hal_canio_can_transmit_error_count_get(canio_can_obj_t *self) { - return -1; + return self->hw->ECR.bit.TEC; } int common_hal_canio_can_receive_error_count_get(canio_can_obj_t *self) { - return -1; + return self->hw->ECR.bit.REC; } int common_hal_canio_can_error_warning_state_count_get(canio_can_obj_t *self) { - return -1; + return self->error_warning_state_count; } int common_hal_canio_can_error_passive_state_count_get(canio_can_obj_t *self) { - return -1; + return self->error_passive_state_count; } int common_hal_canio_can_bus_off_state_count_get(canio_can_obj_t *self) { - return -1; + return self->bus_off_state_count; } -int common_hal_canio_can_state_get(canio_can_obj_t *self) { - return -1; +canio_bus_state_t common_hal_canio_can_state_get(canio_can_obj_t *self) { + CAN_PSR_Type psr = self->hw->PSR; + if(psr.bit.BO) { + return BUS_STATE_OFF; + } + if(psr.bit.EP) { + return BUS_STATE_ERROR_PASSIVE; + } + if(psr.bit.EW) { + return BUS_STATE_ERROR_WARNING; + } + return BUS_STATE_ERROR_ACTIVE; +} + +void common_hal_canio_can_restart(canio_can_obj_t *self) { + if (!self->hw->PSR.bit.BO) { + return; + } + + hri_can_clear_CCCR_INIT_bit(self->hw); + while (hri_can_get_CCCR_INIT_bit(self->hw)) { + } +} + +bool common_hal_canio_can_auto_restart_get(canio_can_obj_t *self) { + return self->auto_restart; +} + +void common_hal_canio_can_auto_restart_set(canio_can_obj_t *self, bool value) { + self->auto_restart = value; +} + +static void maybe_auto_restart(canio_can_obj_t *self) { + if(self->auto_restart) { + common_hal_canio_can_restart(self); + } } void common_hal_canio_can_send(canio_can_obj_t *self, canio_message_obj_t *message) { + maybe_auto_restart(self); + // We have just one dedicated TX buffer, use it! canio_can_fifo_t *ent = &self->state->tx_fifo[0]; ent->txb0.bit.ESI = false; @@ -365,7 +410,17 @@ STATIC void can_handler(int i) { Can *hw = can_insts[i]; uint32_t ir = hri_can_read_IR_reg(hw); - /* Handle various interrupts */ + + /* Count up errors*/ + if (ir & CAN_IE_EWE) { + self->error_warning_state_count += 1; + } + if (ir & CAN_IE_EPE) { + self->error_passive_state_count += 1; + } + if (ir & CAN_IE_BOE) { + self->bus_off_state_count += 1; + } /* Acknowledge interrupt */ hri_can_write_IR_reg(hw, ir); diff --git a/ports/atmel-samd/common-hal/_canio/CAN.h b/ports/atmel-samd/common-hal/_canio/CAN.h index 0e637fc408..02bc2e41b5 100644 --- a/ports/atmel-samd/common-hal/_canio/CAN.h +++ b/ports/atmel-samd/common-hal/_canio/CAN.h @@ -27,6 +27,7 @@ #pragma once #include "py/obj.h" +#include "shared-bindings/_canio/__init__.h" #include "component/can.h" #include "common-hal/microcontroller/Pin.h" #include "common-hal/_canio/__init__.h" @@ -38,25 +39,33 @@ typedef struct { mp_obj_base_t base; Can *hw; - int baudrate; - uint8_t rx_pin_number, tx_pin_number; - bool loopback; - bool silent; canio_can_state_t *state; + volatile uint32_t error_warning_state_count; + volatile uint32_t error_passive_state_count; + volatile uint32_t bus_off_state_count; + int baudrate; + uint8_t rx_pin_number:8; + uint8_t tx_pin_number:8; + bool loopback:1; + bool silent:1; + bool auto_restart:1; bool fifo0_in_use:1; bool fifo1_in_use:1; } canio_can_obj_t; void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *rx, mcu_pin_obj_t *tx, int baudrate, bool loopback, bool silent); -int common_hal_canio_can_state_get(canio_can_obj_t *self); -int common_hal_canio_can_baudrate_get(canio_can_obj_t *self); -int common_hal_canio_can_transmit_error_count_get(canio_can_obj_t *self); -int common_hal_canio_can_receive_error_count_get(canio_can_obj_t *self); -int common_hal_canio_can_error_warning_state_count_get(canio_can_obj_t *self); -int common_hal_canio_can_error_passive_state_count_get(canio_can_obj_t *self); -int common_hal_canio_can_bus_off_state_count_get(canio_can_obj_t *self); -void common_hal_canio_can_send(canio_can_obj_t *self, canio_message_obj_t *message); -void common_hal_canio_can_deinit(canio_can_obj_t *self); -void common_hal_canio_can_check_for_deinit(canio_can_obj_t *self); +bool common_hal_canio_can_auto_restart_get(canio_can_obj_t *self); bool common_hal_canio_can_deinited(canio_can_obj_t *self); +int common_hal_canio_can_baudrate_get(canio_can_obj_t *self); +int common_hal_canio_can_bus_off_state_count_get(canio_can_obj_t *self); +int common_hal_canio_can_error_passive_state_count_get(canio_can_obj_t *self); +int common_hal_canio_can_error_warning_state_count_get(canio_can_obj_t *self); +int common_hal_canio_can_receive_error_count_get(canio_can_obj_t *self); +canio_bus_state_t common_hal_canio_can_state_get(canio_can_obj_t *self); +int common_hal_canio_can_transmit_error_count_get(canio_can_obj_t *self); +void common_hal_canio_can_auto_restart_set(canio_can_obj_t *self, bool auto_restart); +void common_hal_canio_can_check_for_deinit(canio_can_obj_t *self); +void common_hal_canio_can_deinit(canio_can_obj_t *self); +void common_hal_canio_can_restart(canio_can_obj_t *self); +void common_hal_canio_can_send(canio_can_obj_t *self, canio_message_obj_t *message); void common_hal_canio_reset(void); diff --git a/shared-bindings/_canio/CAN.c b/shared-bindings/_canio/CAN.c index 4c7ae3650a..45640d41e4 100644 --- a/shared-bindings/_canio/CAN.c +++ b/shared-bindings/_canio/CAN.c @@ -24,8 +24,10 @@ * THE SOFTWARE. */ +#include "py/enum.h" #include "common-hal/_canio/CAN.h" #include "common-hal/_canio/Listener.h" +#include "shared-bindings/_canio/__init__.h" #include "shared-bindings/_canio/CAN.h" #include "shared-bindings/_canio/Listener.h" #include "shared-bindings/_canio/Match.h" @@ -45,6 +47,7 @@ //| *, //| baudrate: int = 250000, //| loopback: bool = False, +//| auto_restart: bool = False, //| ): //| """A common shared-bus protocol. The rx and tx pins are generally //| connected to a transceiver which controls the H and L pins on a shared @@ -54,19 +57,19 @@ //| :param ~microcontrller.Pin tx: the pin to transmit with, or None if the peripheral should operate in "silent" mode. //| :param int baudrate: The bit rate of the bus in Hz. All devices on the bus must agree on this value. //| :param bool loopback: True if the peripheral will be operated in loopback mode. +//| :param bool auto_restart: If True, will restart communications after entering bus-off state //| """ //| ... //| -//## auto_restart: bool = False, # Whether to restart communications after entering bus-off state -//## sample_point: float = .875, # When to sample within bit time (0.0-1.0) STATIC mp_obj_t canio_can_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_rx, ARG_tx, ARG_baudrate, ARG_loopback, ARG_silent, NUM_ARGS }; + enum { ARG_rx, ARG_tx, ARG_baudrate, ARG_loopback, ARG_silent, ARG_auto_restart, NUM_ARGS }; static const mp_arg_t allowed_args[] = { { MP_QSTR_rx, MP_ARG_OBJ | MP_ARG_REQUIRED, {.u_obj = 0} }, { MP_QSTR_tx, MP_ARG_OBJ, {.u_obj = 0} }, { MP_QSTR_baudrate, MP_ARG_INT, {.u_int = 250000} }, { MP_QSTR_loopback, MP_ARG_BOOL, {.u_bool = false} }, { MP_QSTR_silent, MP_ARG_BOOL, {.u_bool = false} }, + { MP_QSTR_auto_restart, MP_ARG_BOOL, {.u_bool = false} }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); @@ -85,12 +88,40 @@ mp_printf(&mp_plat_print, "tx_pin=%p\n", tx_pin); self->base.type = &canio_can_type; common_hal_canio_can_construct(self, rx_pin, tx_pin, args[ARG_baudrate].u_int, args[ARG_loopback].u_bool, args[ARG_silent].u_bool); + common_hal_canio_can_auto_restart_set(self, args[ARG_auto_restart].u_bool); + return MP_OBJ_FROM_PTR(self); } +//| auto_restart: int +//| """If True, will restart communications after entering bus-off state""" +//| +STATIC mp_obj_t canio_can_auto_restart_get(mp_obj_t self_in) { + canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_can_check_for_deinit(self); + return mp_obj_new_bool(common_hal_canio_can_auto_restart_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_can_auto_restart_get_obj, canio_can_auto_restart_get); + +STATIC mp_obj_t canio_can_auto_restart_set(mp_obj_t self_in, mp_obj_t flag_in) { + canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_can_check_for_deinit(self); + common_hal_canio_can_auto_restart_set(self, mp_obj_is_true(flag_in)); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(canio_can_auto_restart_set_obj, canio_can_auto_restart_set); + +STATIC const mp_obj_property_t canio_can_auto_restart_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_can_auto_restart_get_obj, + (mp_obj_t)&canio_can_auto_restart_set_obj, + (mp_obj_t)mp_const_none}, +}; + + //| baudrate: int -//| """The baud rate(read-only)""" +//| """The baud rate (read-only)""" //| STATIC mp_obj_t canio_can_baudrate_get(mp_obj_t self_in) { canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -106,23 +137,6 @@ STATIC const mp_obj_property_t canio_can_baudrate_obj = { (mp_obj_t)mp_const_none}, }; -//| state: State -//| """The status of the hardware (read-only)""" -//| -STATIC mp_obj_t canio_can_state_get(mp_obj_t self_in) { - canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_canio_can_check_for_deinit(self); - return MP_OBJ_NEW_SMALL_INT(common_hal_canio_can_state_get(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(canio_can_state_get_obj, canio_can_state_get); - -STATIC const mp_obj_property_t canio_can_state_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_can_state_get_obj, - (mp_obj_t)mp_const_none, - (mp_obj_t)mp_const_none}, -}; - //| transmit_error_count: int //| """The number of transmit errors (read-only). Increased for a detected transmission error, decreased for successful transmission. Limited to the range from 0 to 255 inclusive. Also called TEC.""" //| @@ -208,12 +222,43 @@ STATIC const mp_obj_property_t canio_can_bus_off_state_count_obj = { (mp_obj_t)mp_const_none}, }; +//| state: State +//| """The current state of the bus.""" +STATIC mp_obj_t canio_can_state_get(mp_obj_t self_in) { + canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_can_check_for_deinit(self); + return cp_enum_find(&canio_bus_state_type, common_hal_canio_can_state_get(self)); +} + +MP_DEFINE_CONST_FUN_OBJ_1(canio_can_state_get_obj, canio_can_state_get); + +STATIC const mp_obj_property_t canio_can_state_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_can_state_get_obj, + (mp_obj_t)mp_const_none, + (mp_obj_t)mp_const_none}, +}; + + #if 0 //| # pending_tx_count: int //| # """The number of messages waiting to be transmitted. (read-only)""" +//| #endif -//| def listen(filters: Optional[Sequence[Filter]]=None, *, timeout: float=10) -> Listener: +//| def restart(self) -> None: +//| """If the device is in the bus off state, restart it.""" +//| ... +//| +STATIC mp_obj_t canio_can_restart(mp_obj_t self_in) { + canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_can_check_for_deinit(self); + common_hal_canio_can_restart(self); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_can_restart_obj, canio_can_restart); + +//| def listen(self, filters: Optional[Sequence[Filter]]=None, *, timeout: float=10) -> Listener: //| """Start receiving messages that match any one of the filters. //| Creating a listener is an expensive operation and can interfere with reception of messages by other listeners. //| There is an implementation-defined maximum number of listeners and limit to the complexity of the filters. @@ -317,15 +362,17 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(canio_can_exit_obj, 4, 4, canio_can_e STATIC const mp_rom_map_elem_t canio_can_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&canio_can_enter_obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&canio_can_exit_obj) }, + { MP_ROM_QSTR(MP_QSTR_auto_restart), MP_ROM_PTR(&canio_can_auto_restart_obj) }, + { MP_ROM_QSTR(MP_QSTR_baudrate), MP_ROM_PTR(&canio_can_baudrate_obj) }, { MP_ROM_QSTR(MP_QSTR_bus_off_state_count), MP_ROM_PTR(&canio_can_bus_off_state_count_obj) }, { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&canio_can_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR_error_passive_state_count), MP_ROM_PTR(&canio_can_error_passive_state_count_obj) }, { MP_ROM_QSTR(MP_QSTR_error_warning_state_count), MP_ROM_PTR(&canio_can_error_warning_state_count_obj) }, { MP_ROM_QSTR(MP_QSTR_listen), MP_ROM_PTR(&canio_can_listen_obj) }, { MP_ROM_QSTR(MP_QSTR_receive_error_count), MP_ROM_PTR(&canio_can_receive_error_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_restart), MP_ROM_PTR(&canio_can_restart_obj) }, { MP_ROM_QSTR(MP_QSTR_send), MP_ROM_PTR(&canio_can_send_obj) }, { MP_ROM_QSTR(MP_QSTR_state), MP_ROM_PTR(&canio_can_state_obj) }, - { MP_ROM_QSTR(MP_QSTR_baudrate), MP_ROM_PTR(&canio_can_baudrate_obj) }, { MP_ROM_QSTR(MP_QSTR_transmit_error_count), MP_ROM_PTR(&canio_can_transmit_error_count_obj) }, }; STATIC MP_DEFINE_CONST_DICT(canio_can_locals_dict, canio_can_locals_dict_table); From 1eb0587917f54aec07104b00f7dd6f3f0b9cf201 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 16 Sep 2020 12:07:15 -0500 Subject: [PATCH 0932/1293] correct docstring --- shared-bindings/_canio/Message.c | 6 ++++-- shared-bindings/_canio/__init__.c | 9 +++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/shared-bindings/_canio/Message.c b/shared-bindings/_canio/Message.c index a8e5883541..f1cd11d8ec 100644 --- a/shared-bindings/_canio/Message.c +++ b/shared-bindings/_canio/Message.c @@ -115,7 +115,7 @@ STATIC const mp_obj_property_t canio_message_id_obj = { //| data: bytes //| """The content of the message, or dummy content in the case of an rtr. //| -//| Assigning to data sets the bytes to zero""" +//| Assigning to data also sets the length.""" //| STATIC mp_obj_t canio_message_data_get(const mp_obj_t self_in) { canio_message_obj_t *self = self_in; @@ -145,7 +145,9 @@ STATIC const mp_obj_property_t canio_message_data_obj = { //| size: int -//| """The length of the message, or the length of the requested data in the case of an rtr""" +//| """The length of the message, or the length of the requested data in the case of an rtr +//| +//| Assigning to the length sets all the data bytes to zero""" //| STATIC mp_obj_t canio_message_size_get(const mp_obj_t self_in) { canio_message_obj_t *self = self_in; diff --git a/shared-bindings/_canio/__init__.c b/shared-bindings/_canio/__init__.c index 577466ed61..cff675f069 100644 --- a/shared-bindings/_canio/__init__.c +++ b/shared-bindings/_canio/__init__.c @@ -29,7 +29,7 @@ //| The `_canio` module contains low level classes to support the CAN bus //| protocol. //| -//| All classes change hardware state and should be deinitialized when they +//| CAN and Listener classes change hardware state and should be deinitialized when they //| are no longer needed if the program continues after use. To do so, either //| call :py:meth:`!deinit` or use a context manager. See //| :ref:`lifetime-and-contextmanagers` for more info. @@ -39,12 +39,13 @@ //| import _canio //| from board import * //| -//| can = _canio.BUS(board.CANRX, board.CANTX) -//| can.write(408, b"adafruit") +//| can = _canio.CAN(board.CAN_RX, board.CAN_TX, baudrate=1000000) +//| message = _canio.Message(id=0x0408, data="adafruit" +//| can.write(message)) //| can.deinit() //| //| This example will write the data 'adafruit' onto the CAN bus to any -//| device listening for message id 408.""" +//| device listening for message id 0x0408.""" //| #include "py/obj.h" From 40d4a69133e09e66575dee13b7881aead43f66d4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 16 Sep 2020 12:16:30 -0500 Subject: [PATCH 0933/1293] more doc improvements --- shared-bindings/_canio/__init__.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/shared-bindings/_canio/__init__.c b/shared-bindings/_canio/__init__.c index cff675f069..29e43c5c46 100644 --- a/shared-bindings/_canio/__init__.c +++ b/shared-bindings/_canio/__init__.c @@ -45,7 +45,16 @@ //| can.deinit() //| //| This example will write the data 'adafruit' onto the CAN bus to any -//| device listening for message id 0x0408.""" +//| device listening for message id 0x0408. +//| +//| A CAN bus involves a transceiver, which is often a separate chip with a "standby" pin. +//| If your board has a CAN_STANDBY pin, ensure to set it to an output with the value False +//| to enable the transceiver. +//| +//| Other implementations of the CAN device may exist (for instance, attached +//| via an SPI bus). If so their constructor arguments may differ, but +//| otherwise we encourage implementors to follow the API that the core uses. +//| """ //| #include "py/obj.h" @@ -69,13 +78,22 @@ MAKE_ENUM_VALUE(canio_bus_state_type, bus_state, BUS_OFF, BUS_STATE_OFF); //| """The bus is in the normal (active) state""" //| //| ERROR_WARNING: object -//| """The bus is in the normal (active) state, but a moderate number of errors have occurred recently""" +//| """The bus is in the normal (active) state, but a moderate number of errors have occurred recently. +//| +//| NOTE: Not all implementations may use ERROR_WARNING. Do not rely on seeing ERROR_WARNING before ERROR_PASSIVE.""" //| //| ERROR_PASSIVE: object -//| """The bus is in the passive state due to the number of errors that have occurred recently""" +//| """The bus is in the passive state due to the number of errors that have occurred recently. +//| +//| This device will acknowledge packets it receives, but cannot transmit messages. +//| If additional errors occur, this device may progress to BUS_OFF. +//| If it successfully acknowledges other packets on the bus, it can return to ERROR_WARNING or ERROR_ACTIVE and transmit packets. +//| """ //| //| BUS_OFF: object -//| """The bus has turned off due to the number of errors that have occurred recently. It must be restarted before it will send or receive packets""" +//| """The bus has turned off due to the number of errors that have +//| occurred recently. It must be restarted before it will send or receive +//| packets. This device will neither send or acknowledge packets on the bus.""" //| MAKE_ENUM_MAP(canio_bus_state) { MAKE_ENUM_MAP_ENTRY(bus_state, ERROR_ACTIVE), From ca32a81bf11301b2aea4fb2a91991dcfecd14902 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 16 Sep 2020 12:18:55 -0500 Subject: [PATCH 0934/1293] main.c: Correct CANIO if-guard --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index f259fea3f9..4d34e451dd 100755 --- a/main.c +++ b/main.c @@ -230,7 +230,7 @@ void cleanup_after_vm(supervisor_allocation* heap) { free_memory(heap); supervisor_move_memory(); - #ifdef CIRCUITPY_CANIO + #if CIRCUITPY_CANIO common_hal_canio_reset(); #endif From 2cb4707f92ffc65b2f160a7d1ea7d6b28892b548 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 17 Sep 2020 10:57:16 -0500 Subject: [PATCH 0935/1293] Message: add extended address flag --- shared-bindings/_canio/Message.c | 35 +++++++++++++++++++++++++++++--- shared-module/_canio/Message.c | 13 +++++++++++- shared-module/_canio/Message.h | 9 +++++--- 3 files changed, 50 insertions(+), 7 deletions(-) diff --git a/shared-bindings/_canio/Message.c b/shared-bindings/_canio/Message.c index f1cd11d8ec..3fa018a834 100644 --- a/shared-bindings/_canio/Message.c +++ b/shared-bindings/_canio/Message.c @@ -32,13 +32,14 @@ #include "py/runtime.h" //| class Message: -//| def __init__(self, id: int=0, data: Optional[bytes] = None, *, size: Optional[int] = None, rtr: bool = False): +//| def __init__(self, id: int=0, data: Optional[bytes] = None, *, size: Optional[int] = None, rtr: bool = False, extended: bool = False): //| """Construct a Message to send on a CAN bus //| //| :param int id: The numeric ID of the message //| :param bytes data: The content of the message //| :param int size: The amount of data requested, for an rtr //| :param bool rtr: True if the message represents an rtr (Remote Transmission Request) +//| :param bool extended: True if the message has an extended identifier, False if it has a standard identifier //| //| In CAN, messages can have a size from 0 to 8 bytes. //| @@ -47,12 +48,13 @@ //| ... //| STATIC mp_obj_t canio_message_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_id, ARG_data, ARG_size, ARG_rtr, NUM_ARGS }; + enum { ARG_id, ARG_data, ARG_size, ARG_rtr, ARG_extended, NUM_ARGS }; static const mp_arg_t allowed_args[] = { { MP_QSTR_id, MP_ARG_INT, {.u_obj = 0} }, { MP_QSTR_data, MP_ARG_OBJ, {.u_obj = 0} }, { MP_QSTR_size, MP_ARG_INT, {.u_int = -1} }, { MP_QSTR_rtr, MP_ARG_BOOL, {.u_bool = false} }, + { MP_QSTR_extended, MP_ARG_BOOL, {.u_bool = false} }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); @@ -60,6 +62,7 @@ STATIC mp_obj_t canio_message_make_new(const mp_obj_type_t *type, size_t n_args, mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); bool rtr = args[ARG_rtr].u_bool; + bool extended = args[ARG_extended].u_bool; size_t size = (size_t)args[ARG_size].u_int; bool specified_size = (size != (size_t)-1); bool specified_data = (args[ARG_data].u_obj != NULL); @@ -85,7 +88,7 @@ STATIC mp_obj_t canio_message_make_new(const mp_obj_type_t *type, size_t n_args, canio_message_obj_t *self = m_new_obj(canio_message_obj_t); self->base.type = &canio_message_type; - common_hal_canio_message_construct(self, args[ARG_id].u_int, data.buf, data.len, rtr); + common_hal_canio_message_construct(self, args[ARG_id].u_int, data.buf, data.len, rtr, extended); return self; } @@ -174,6 +177,31 @@ STATIC const mp_obj_property_t canio_message_size_obj = { (mp_obj_t)&mp_const_none_obj}, }; +//| extended: bool +//| """True if the message represents a remote transmission request (RTR)""" +//| +STATIC mp_obj_t canio_message_extended_get(const mp_obj_t self_in) { + canio_message_obj_t *self = self_in; + return mp_obj_new_bool(common_hal_canio_message_extended_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_message_extended_get_obj, canio_message_extended_get); + +STATIC mp_obj_t canio_message_extended_set(const mp_obj_t self_in, const mp_obj_t extended) { + canio_message_obj_t *self = self_in; + common_hal_canio_message_size_set(self, mp_obj_is_true(extended)); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(canio_message_extended_set_obj, canio_message_extended_set); + + +STATIC const mp_obj_property_t canio_message_extended_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_message_extended_get_obj, + (mp_obj_t)&canio_message_extended_set_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + + //| rtr: bool //| """True if the message represents a remote transmission request (RTR)""" //| @@ -204,6 +232,7 @@ STATIC const mp_rom_map_elem_t canio_message_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_data), MP_ROM_PTR(&canio_message_data_obj) }, { MP_ROM_QSTR(MP_QSTR_size), MP_ROM_PTR(&canio_message_size_obj) }, { MP_ROM_QSTR(MP_QSTR_rtr), MP_ROM_PTR(&canio_message_rtr_obj) }, + { MP_ROM_QSTR(MP_QSTR_extended), MP_ROM_PTR(&canio_message_extended_obj) }, }; STATIC MP_DEFINE_CONST_DICT(canio_message_locals_dict, canio_message_locals_dict_table); diff --git a/shared-module/_canio/Message.c b/shared-module/_canio/Message.c index 1ac5b81789..c0403b5196 100644 --- a/shared-module/_canio/Message.c +++ b/shared-module/_canio/Message.c @@ -28,11 +28,12 @@ #include -void common_hal_canio_message_construct(canio_message_obj_t *self, int id, void *data, size_t size, bool rtr) +void common_hal_canio_message_construct(canio_message_obj_t *self, int id, void *data, size_t size, bool rtr, bool extended) { self->id = id; self->size = size; self->rtr = rtr; + self->extended = extended; if (data) { memcpy(self->data, data, size); } else { @@ -84,3 +85,13 @@ void common_hal_canio_message_rtr_set(canio_message_obj_t *self, bool rtr) { self->rtr = rtr; } + +bool common_hal_canio_message_extended_get(const canio_message_obj_t *self) +{ + return self->extended; +} + +void common_hal_canio_message_extended_set(canio_message_obj_t *self, bool extended) +{ + self->extended = extended; +} diff --git a/shared-module/_canio/Message.h b/shared-module/_canio/Message.h index e846f1095f..b9fd8eaf2d 100644 --- a/shared-module/_canio/Message.h +++ b/shared-module/_canio/Message.h @@ -31,17 +31,20 @@ typedef struct { mp_obj_base_t base; int id; - size_t size; uint8_t data[8]; - bool rtr; + size_t size:4; + bool rtr:1; + bool extended:1; } canio_message_obj_t; -void common_hal_canio_message_construct(canio_message_obj_t *self, int id, void *data, size_t size, bool rtr); +void common_hal_canio_message_construct(canio_message_obj_t *self, int id, void *data, size_t size, bool rtr, bool extended); bool common_hal_canio_message_rtr_get(const canio_message_obj_t *self); +bool common_hal_canio_message_extended_get(const canio_message_obj_t *self); int common_hal_canio_message_id_get(const canio_message_obj_t *self); const void *common_hal_canio_message_data_get(const canio_message_obj_t *self); size_t common_hal_canio_message_size_get(const canio_message_obj_t *self); void common_hal_canio_message_rtr_set(canio_message_obj_t *self, bool rtr); +void common_hal_canio_message_extended_set(canio_message_obj_t *self, bool extended); void common_hal_canio_message_id_set(canio_message_obj_t *self, int id); void common_hal_canio_message_data_set(canio_message_obj_t *self, const void *data, size_t size); void common_hal_canio_message_size_set(canio_message_obj_t *self, size_t size); From 27cbb690e5b634b2791100a258618252476f609d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 17 Sep 2020 10:57:56 -0500 Subject: [PATCH 0936/1293] _canio: Add listener matching Lightly tested: * no matches (catch-all) * standard address single address matches (even and odd positions) * standard address mask matches * only tested that extended doesn't match non-extended --- ports/atmel-samd/common-hal/_canio/CAN.c | 34 +- ports/atmel-samd/common-hal/_canio/Listener.c | 295 +++++++++++++++++- ports/atmel-samd/common-hal/_canio/__init__.h | 7 +- shared-bindings/_canio/CAN.c | 15 +- 4 files changed, 321 insertions(+), 30 deletions(-) diff --git a/ports/atmel-samd/common-hal/_canio/CAN.c b/ports/atmel-samd/common-hal/_canio/CAN.c index d2e7d8d9db..4c957c8f86 100644 --- a/ports/atmel-samd/common-hal/_canio/CAN.c +++ b/ports/atmel-samd/common-hal/_canio/CAN.c @@ -91,7 +91,7 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *rx, mc } hri_can_set_CCCR_CCE_bit(self->hw); - if(instance == 0) { + if (instance == 0) { hri_mclk_set_AHBMASK_CAN0_bit(MCLK); hri_gclk_write_PCHCTRL_reg(GCLK, CAN0_GCLK_ID, CONF_GCLK_CAN0_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); @@ -100,7 +100,7 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *rx, mc NVIC_EnableIRQ(CAN0_IRQn); hri_can_write_ILE_reg(self->hw, CAN_ILE_EINT0); #ifdef CAN1_GCLK_ID - } else if(instance == 1) { + } else if (instance == 1) { hri_mclk_set_AHBMASK_CAN1_bit(MCLK); hri_gclk_write_PCHCTRL_reg(GCLK, CAN1_GCLK_ID, CONF_GCLK_CAN1_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); @@ -197,7 +197,7 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *rx, mc { CAN_GFC_Type gfc = { .bit.RRFE = 1, - .bit.ANFS = CAN_GFC_ANFS_RXF0_Val, + .bit.ANFS = CAN_GFC_ANFS_REJECT_Val, .bit.ANFE = CAN_GFC_ANFE_REJECT_Val, }; hri_can_write_GFC_reg(self->hw, gfc.reg); @@ -206,14 +206,15 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *rx, mc { CAN_SIDFC_Type dfc = { .bit.LSS = COMMON_HAL_CANIO_RX_FILTER_SIZE, - .bit.FLSSA = (uint32_t)self->state->rx_filter + .bit.FLSSA = (uint32_t)self->state->standard_rx_filter }; hri_can_write_SIDFC_reg(self->hw, dfc.reg); } { CAN_XIDFC_Type dfc = { - .bit.LSE = 0, + .bit.LSE = COMMON_HAL_CANIO_RX_FILTER_SIZE, + .bit.FLESA = (uint32_t)self->state->extended_rx_filter }; hri_can_write_XIDFC_reg(self->hw, dfc.reg); } @@ -236,12 +237,12 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *rx, mc self->hw->CCCR.bit.TEST = loopback; self->hw->TEST.bit.LBCK = loopback; - if(instance == 0) { + if (instance == 0) { NVIC_DisableIRQ(CAN0_IRQn); NVIC_ClearPendingIRQ(CAN0_IRQn); NVIC_EnableIRQ(CAN0_IRQn); #ifdef CAN1_GCLK_ID - } else if(instance == 1) { + } else if (instance == 1) { NVIC_DisableIRQ(CAN1_IRQn); NVIC_ClearPendingIRQ(CAN1_IRQn); NVIC_EnableIRQ(CAN1_IRQn); @@ -295,13 +296,13 @@ int common_hal_canio_can_bus_off_state_count_get(canio_can_obj_t *self) canio_bus_state_t common_hal_canio_can_state_get(canio_can_obj_t *self) { CAN_PSR_Type psr = self->hw->PSR; - if(psr.bit.BO) { + if (psr.bit.BO) { return BUS_STATE_OFF; } - if(psr.bit.EP) { + if (psr.bit.EP) { return BUS_STATE_ERROR_PASSIVE; } - if(psr.bit.EW) { + if (psr.bit.EW) { return BUS_STATE_ERROR_WARNING; } return BUS_STATE_ERROR_ACTIVE; @@ -326,7 +327,7 @@ void common_hal_canio_can_auto_restart_set(canio_can_obj_t *self, bool value) { } static void maybe_auto_restart(canio_can_obj_t *self) { - if(self->auto_restart) { + if (self->auto_restart) { common_hal_canio_can_restart(self); } } @@ -337,10 +338,15 @@ void common_hal_canio_can_send(canio_can_obj_t *self, canio_message_obj_t *messa // We have just one dedicated TX buffer, use it! canio_can_fifo_t *ent = &self->state->tx_fifo[0]; + ent->txb0.bit.ESI = false; - ent->txb0.bit.XTD = false; + ent->txb0.bit.XTD = message->extended; ent->txb0.bit.RTR = message->rtr; - ent->txb0.bit.ID = message->id << 18; // short addresses are left-justified + if (message->extended) { + ent->txb0.bit.ID = message->id << 18; + } else { + ent->txb0.bit.ID = message->id << 18; // short addresses are left-justified + } ent->txb1.bit.MM = 0; // "message marker" ent->txb1.bit.EFC = 0; // don't store fifo events to event queue @@ -367,7 +373,7 @@ bool common_hal_canio_can_deinited(canio_can_obj_t *self) { } void common_hal_canio_can_check_for_deinit(canio_can_obj_t *self) { - if(common_hal_canio_can_deinited(self)) { + if (common_hal_canio_can_deinited(self)) { raise_deinited_error(); } } diff --git a/ports/atmel-samd/common-hal/_canio/Listener.c b/ports/atmel-samd/common-hal/_canio/Listener.c index ddae61de95..4d54e9f734 100644 --- a/ports/atmel-samd/common-hal/_canio/Listener.c +++ b/ports/atmel-samd/common-hal/_canio/Listener.c @@ -34,12 +34,262 @@ #include "common-hal/_canio/Listener.h" #include "shared-bindings/util.h" #include "supervisor/shared/tick.h" +#include "component/can.h" -void common_hal_canio_listener_construct(canio_listener_obj_t *self, canio_can_obj_t *can, size_t nmatch, canio_match_obj_t **matches, float timeout) { - if (nmatch) { - mp_raise_NotImplementedError(NULL); +STATIC void allow_config_change(canio_can_obj_t *can) { + can->hw->CCCR.bit.INIT = 1; + while (!can->hw->CCCR.bit.INIT) { + } + can->hw->CCCR.bit.CCE = 1; +} + +STATIC void prevent_config_change(canio_can_obj_t *can) { + can->hw->CCCR.bit.CCE = 0; + can->hw->CCCR.bit.INIT = 0; + while (can->hw->CCCR.bit.INIT) { + } +} + +__attribute__((unused)) +STATIC void static_assertions(void) { + MP_STATIC_ASSERT(CAN_GFC_ANFE_RXF0_Val + 1 == CAN_GFC_ANFE_RXF1_Val); + MP_STATIC_ASSERT(CAN_GFC_ANFS_RXF0_Val + 1 == CAN_GFC_ANFS_RXF1_Val); + MP_STATIC_ASSERT(CAN_SIDFE_0_SFEC_STF0M_Val + 1 == CAN_SIDFE_0_SFEC_STF1M_Val); + MP_STATIC_ASSERT(CAN_XIDFE_0_EFEC_STF0M_Val + 1 == CAN_XIDFE_0_EFEC_STF1M_Val); +} + +STATIC bool single_address_filter(canio_match_obj_t *match) { + return match->mask == 0 || match->mask == match->address; +} + +STATIC bool standard_filter_in_use(CanMramSidfe *filter) { + return filter->SIDFE_0.bit.SFEC != CAN_SIDFE_0_SFEC_DISABLE_Val; +} + +STATIC bool extended_filter_in_use(CanMramXidfe *filter) { + return filter->XIDFE_0.bit.EFEC != CAN_XIDFE_0_EFEC_DISABLE_Val; +} + +STATIC size_t num_filters_needed(size_t nmatch, canio_match_obj_t **matches, bool extended) { + size_t num_half_filters_needed = 1; + for(size_t i=0; iextended) { + continue; + } + if (single_address_filter(matches[i])) { + num_half_filters_needed += 1; + } else { + num_half_filters_needed += 2; + } + } + return num_half_filters_needed / 2; +} + +STATIC size_t num_filters_available(canio_can_obj_t *can, bool extended) { + size_t available = 0; + if (extended) { + for(size_t i = 0; i < MP_ARRAY_SIZE(can->state->extended_rx_filter); i++) { + if (!extended_filter_in_use(&can->state->extended_rx_filter[i])) { + available++; + } + } + } else { + for(size_t i = 0; i < MP_ARRAY_SIZE(can->state->standard_rx_filter); i++) { + if (!standard_filter_in_use(&can->state->standard_rx_filter[i])) { + available++; + } + } + } + return available; +} + +STATIC void clear_filters(canio_listener_obj_t *self) { + canio_can_obj_t *can = self->can; + int fifo = self->fifo_idx; + + // If it was a global accept, clear it + allow_config_change(can); + if (can->hw->GFC.bit.ANFS == CAN_GFC_ANFS_RXF0 + fifo) { + can->hw->GFC.bit.ANFS = CAN_GFC_ANFS_REJECT_Val; + } + if (can->hw->GFC.bit.ANFE == CAN_GFC_ANFE_RXF0 + fifo) { + can->hw->GFC.bit.ANFE = CAN_GFC_ANFE_REJECT_Val; + } + prevent_config_change(can); + + // For each filter entry, if it pointed at this FIFO set it to DISABLE + for(size_t i = 0; i < MP_ARRAY_SIZE(can->state->extended_rx_filter); i++) { + int val = CAN_XIDFE_0_EFEC_STF0M_Val + fifo; + if (can->state->extended_rx_filter[i].XIDFE_0.bit.EFEC == val) { + can->state->extended_rx_filter[i].XIDFE_0.bit.EFEC = CAN_XIDFE_0_EFEC_DISABLE_Val; + } + } + for(size_t i = 0; i < MP_ARRAY_SIZE(can->state->standard_rx_filter); i++) { + int val = CAN_SIDFE_0_SFEC_STF1M_Val + fifo; + if (can->state->standard_rx_filter[i].SIDFE_0.bit.SFEC == val) { + can->state->standard_rx_filter[i].SIDFE_0.bit.SFEC = CAN_SIDFE_0_SFEC_DISABLE_Val; + } + } +} + +STATIC CanMramXidfe *next_extended_filter(canio_listener_obj_t *self, CanMramXidfe *start) { + CanMramXidfe *end = &self->can->state->extended_rx_filter[MP_ARRAY_SIZE(self->can->state->extended_rx_filter)]; + if (start == NULL) { + start = self->can->state->extended_rx_filter; + } else { + start = start + 1; + } + while (extended_filter_in_use(start)) { + if (start == end) { + return NULL; + } + start = start + 1; + } + return start; +} + +STATIC CanMramSidfe *next_standard_filter(canio_listener_obj_t *self, CanMramSidfe *start) { + CanMramSidfe *end = &self->can->state->standard_rx_filter[MP_ARRAY_SIZE(self->can->state->standard_rx_filter)]; + if (start == NULL) { + start = self->can->state->standard_rx_filter; + } else { + start = start + 1; + } + while (standard_filter_in_use(start)) { + if (start == end) { + return NULL; + } + start = start + 1; + } + return start; +} + +STATIC void install_standard_filter(CanMramSidfe *standard, int id1, int id2, int sfec, int sft) { + assert(standard); + CAN_SIDFE_0_Type val = { + .bit.SFID1 = id1, + .bit.SFID2 = id2, + .bit.SFEC = sfec, + .bit.SFT = sft, + }; + standard->SIDFE_0 = val; +} + +STATIC void install_extended_filter(CanMramXidfe *extended, int id1, int id2, int efec, int eft) { + assert(extended); + CAN_XIDFE_0_Type val0 = { + .bit.EFID1 = id1, + .bit.EFEC = efec, + }; + CAN_XIDFE_1_Type val1 = { + .bit.EFID2 = id2, + .bit.EFT = eft, + }; + // Set entry 0 second, because it has the enable bits (XIDFE_0_EFEC) + extended->XIDFE_1 = val1; + extended->XIDFE_0 = val0; +} + + +#define NO_ADDRESS (-1) +void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t **matches) { + int fifo = self->fifo_idx; + + if (!nmatch) { + allow_config_change(self->can); + self->can->hw->GFC.bit.ANFS = CAN_GFC_ANFS_RXF0_Val + fifo; + self->can->hw->GFC.bit.ANFE = CAN_GFC_ANFE_RXF0_Val + fifo; + self->can->hw->CCCR.bit.CCE = 0; + prevent_config_change(self->can); + return; } + CanMramSidfe *standard = next_standard_filter(self, NULL); + CanMramXidfe *extended = next_extended_filter(self, NULL); + + int first_address = NO_ADDRESS; + + // step 1: single address standard matches + // we have to gather up pairs and stuff them in a single filter entry + for(size_t i = 0; iextended) { + continue; + } + if (!single_address_filter(match)) { + continue; + } + if (first_address != NO_ADDRESS) { + install_standard_filter(standard, first_address, match->address, CAN_SIDFE_0_SFEC_STF0M_Val + fifo, CAN_SIDFE_0_SFT_DUAL_Val); + first_address = NO_ADDRESS; + standard = next_standard_filter(self, standard); + } else { + first_address = match->address; + } + } + // step 1.5. odd single address standard match + if (first_address != NO_ADDRESS) { + install_standard_filter(standard, first_address, first_address, CAN_SIDFE_0_SFEC_STF0M_Val + fifo, CAN_SIDFE_0_SFT_DUAL_Val); + standard = next_standard_filter(self, standard); + first_address = NO_ADDRESS; + } + + // step 2: standard mask filter + for(size_t i = 0; iextended) { + continue; + } + if (single_address_filter(match)) { + continue; + } + install_standard_filter(standard, match->address, match->mask, CAN_SIDFE_0_SFEC_STF0M_Val + fifo, CAN_SIDFE_0_SFT_CLASSIC_Val); + standard = next_standard_filter(self, standard); + } + + // step 3: single address extended matches + // we have to gather up pairs and stuff them in a single filter entry + for(size_t i = 0; iextended) { + continue; + } + if (!single_address_filter(match)) { + continue; + } + if (first_address != NO_ADDRESS) { + install_extended_filter(extended, first_address, match->address, CAN_XIDFE_0_EFEC_STF0M_Val + fifo, CAN_XIDFE_1_EFT_DUAL_Val); + first_address = NO_ADDRESS; + extended = next_extended_filter(self, extended); + } else { + first_address = match->address; + } + } + // step 3.5. odd single address standard match + if (first_address != NO_ADDRESS) { + install_extended_filter(extended, first_address, first_address, CAN_XIDFE_0_EFEC_STF0M_Val + fifo, CAN_XIDFE_1_EFT_DUAL_Val); + extended = next_extended_filter(self, extended); + first_address = NO_ADDRESS; + } + + // step 4: extended mask filters + for(size_t i = 0; iextended) { + continue; + } + if (single_address_filter(match)) { + continue; + } + install_extended_filter(extended, match->address, match->mask, CAN_XIDFE_0_EFEC_STF0M_Val + fifo, CAN_XIDFE_1_EFT_CLASSIC_Val); + extended = next_extended_filter(self, extended); + } + + // phew, easy(!) +} + + +void common_hal_canio_listener_construct(canio_listener_obj_t *self, canio_can_obj_t *can, size_t nmatch, canio_match_obj_t **matches, float timeout) { if (!can->fifo0_in_use) { self->fifo_idx = 0; self->fifo = can->state->rx0_fifo; @@ -56,7 +306,26 @@ void common_hal_canio_listener_construct(canio_listener_obj_t *self, canio_can_o mp_raise_ValueError(translate("All RX FIFOs in use")); } + if (!nmatch) { + if (can->hw->GFC.bit.ANFS == CAN_GFC_ANFS_RXF1_Val - self->fifo_idx) { + mp_raise_ValueError(translate("Already have all-matches listener")); + } + if (can->hw->GFC.bit.ANFE == CAN_GFC_ANFE_RXF1_Val - self->fifo_idx) { + mp_raise_ValueError(translate("Already have all-matches listener")); + } + } + + if (num_filters_needed(nmatch, matches, false) > num_filters_available(can, false)) { + mp_raise_ValueError(translate("Filters too complex")); + } + + if (num_filters_needed(nmatch, matches, true) > num_filters_available(can, true)) { + mp_raise_ValueError(translate("Filters too complex")); + } + + // Nothing can fail now so it's safe to assign self->can self->can = can; + set_filters(self, nmatch, matches); common_hal_canio_listener_set_timeout(self, timeout); } @@ -69,7 +338,7 @@ float common_hal_canio_listener_get_timeout(canio_listener_obj_t *self) { } void common_hal_canio_listener_check_for_deinit(canio_listener_obj_t *self) { - if(!self->can) { + if (!self->can) { raise_deinited_error(); } common_hal_canio_can_check_for_deinit(self->can); @@ -83,17 +352,22 @@ bool common_hal_canio_listener_readinto(canio_listener_obj_t *self, canio_messag if (!common_hal_canio_listener_in_waiting(self)) { uint64_t deadline = supervisor_ticks_ms64() + self->timeout_ms; do { - if(supervisor_ticks_ms64() > deadline) { + if (supervisor_ticks_ms64() > deadline) { return false; } } while (!common_hal_canio_listener_in_waiting(self)); } int index = self->hw->RXFS.bit.F0GI; canio_can_fifo_t *hw_message = &self->fifo[index]; - message->id = hw_message->rxb0.bit.ID >> 18; // short addresses are left-justified + message->extended = hw_message->rxb0.bit.XTD; + if (message->extended) { + message->id = hw_message->rxb0.bit.ID; + } else { + message->id = hw_message->rxb0.bit.ID >> 18; // short addresses are left-justified + } message->rtr = hw_message->rxb0.bit.RTR; message->size = hw_message->rxb1.bit.DLC; - if(!message->rtr) { + if (!message->rtr) { memcpy(message->data, hw_message->data, message->size); } self->hw->RXFA.bit.F0AI = index; @@ -102,11 +376,12 @@ bool common_hal_canio_listener_readinto(canio_listener_obj_t *self, canio_messag void common_hal_canio_listener_deinit(canio_listener_obj_t *self) { // free our FIFO, clear our matches, SOMETHING - if(self->can) { - if(self->fifo_idx == 0) { + if (self->can) { + clear_filters(self); + if (self->fifo_idx == 0) { self->can->fifo0_in_use = false; } - if(self->fifo_idx == 1) { + if (self->fifo_idx == 1) { self->can->fifo1_in_use = false; } } diff --git a/ports/atmel-samd/common-hal/_canio/__init__.h b/ports/atmel-samd/common-hal/_canio/__init__.h index 429369e188..cb491ab9e6 100644 --- a/ports/atmel-samd/common-hal/_canio/__init__.h +++ b/ports/atmel-samd/common-hal/_canio/__init__.h @@ -34,6 +34,10 @@ #define COMMON_HAL_CANIO_RX_FILTER_SIZE (4) #define COMMON_HAL_CANIO_TX_FIFO_SIZE (1) +// This appears to be a typo (transposition error) in the ASF4 headers +// It's called the "Extended ID Filter Entry" +typedef CanMramXifde CanMramXidfe; + typedef struct canio_listener canio_listener_t; typedef struct canio_can canio_can_t; @@ -58,5 +62,6 @@ typedef struct { canio_can_fifo_t tx_fifo[COMMON_HAL_CANIO_TX_FIFO_SIZE]; canio_can_fifo_t rx0_fifo[COMMON_HAL_CANIO_RX_FIFO_SIZE]; canio_can_fifo_t rx1_fifo[COMMON_HAL_CANIO_RX_FIFO_SIZE]; - canio_can_filter_t rx_filter[COMMON_HAL_CANIO_RX_FILTER_SIZE]; + CanMramSidfe standard_rx_filter[COMMON_HAL_CANIO_RX_FILTER_SIZE]; + CanMramXifde extended_rx_filter[COMMON_HAL_CANIO_RX_FILTER_SIZE]; } canio_can_state_t; diff --git a/shared-bindings/_canio/CAN.c b/shared-bindings/_canio/CAN.c index 45640d41e4..8f3e45420d 100644 --- a/shared-bindings/_canio/CAN.c +++ b/shared-bindings/_canio/CAN.c @@ -258,15 +258,20 @@ STATIC mp_obj_t canio_can_restart(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_can_restart_obj, canio_can_restart); -//| def listen(self, filters: Optional[Sequence[Filter]]=None, *, timeout: float=10) -> Listener: +//| def listen(self, match: Optional[Sequence[Match]]=None, *, timeout: float=10) -> Listener: //| """Start receiving messages that match any one of the filters. +//| //| Creating a listener is an expensive operation and can interfere with reception of messages by other listeners. +//| //| There is an implementation-defined maximum number of listeners and limit to the complexity of the filters. -//| If the hardware cannot support all the requested filters, a ValueError is raised. Note that generally there are some number of hardware filters shared among all fifos. -//| A message can be received by at most one Listener. +//| +//| If the hardware cannot support all the requested matches, a ValueError is raised. Note that generally there are some number of hardware filters shared among all fifos. +//| +//| A message can be received by at most one Listener. If more than one listener matches a message, it is undefined which one actually receives it. +//| //| An empty filter list causes all messages to be accepted. -//| Timeout dictates how long readinto, read and next() will block. -//| Readinto will return false(), read will return None, and next() will raise StopIteration.""" +//| +//| Timeout dictates how long readinto, read and next() will block.""" //| ... //| STATIC mp_obj_t canio_can_listen(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { From 58b920ed97ac5acdcf3ccb405524c89e32c17b50 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 17 Sep 2020 11:35:34 -0500 Subject: [PATCH 0937/1293] fix whitespace --- ports/atmel-samd/common-hal/_canio/CAN.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/common-hal/_canio/CAN.c b/ports/atmel-samd/common-hal/_canio/CAN.c index 4c957c8f86..266a1aa1f7 100644 --- a/ports/atmel-samd/common-hal/_canio/CAN.c +++ b/ports/atmel-samd/common-hal/_canio/CAN.c @@ -338,7 +338,7 @@ void common_hal_canio_can_send(canio_can_obj_t *self, canio_message_obj_t *messa // We have just one dedicated TX buffer, use it! canio_can_fifo_t *ent = &self->state->tx_fifo[0]; - + ent->txb0.bit.ESI = false; ent->txb0.bit.XTD = message->extended; ent->txb0.bit.RTR = message->rtr; From a69b298aed6c2b711ab5a9e32102fa4df986406d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 17 Sep 2020 11:42:33 -0500 Subject: [PATCH 0938/1293] Whitespace --- shared-bindings/_canio/CAN.c | 2 +- shared-bindings/_canio/Listener.c | 2 +- shared-bindings/_canio/Match.c | 4 ++-- shared-bindings/_canio/Message.c | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/shared-bindings/_canio/CAN.c b/shared-bindings/_canio/CAN.c index 8f3e45420d..53045c35ad 100644 --- a/shared-bindings/_canio/CAN.c +++ b/shared-bindings/_canio/CAN.c @@ -298,7 +298,7 @@ STATIC mp_obj_t canio_can_listen(size_t n_args, const mp_obj_t *pos_args, mp_map canio_match_obj_t *matches[nmatch]; for (size_t i=0; iname); } matches[i] = MP_OBJ_TO_PTR(match_objects[i]); diff --git a/shared-bindings/_canio/Listener.c b/shared-bindings/_canio/Listener.c index d68138d997..a3890f8dd3 100644 --- a/shared-bindings/_canio/Listener.c +++ b/shared-bindings/_canio/Listener.c @@ -112,7 +112,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_iter_obj, canio_listener_iter); STATIC mp_obj_t canio_listener_next(mp_obj_t self_in) { canio_listener_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_canio_listener_check_for_deinit(self); - if(common_hal_canio_listener_in_waiting(self)) { + if (common_hal_canio_listener_in_waiting(self)) { return canio_listener_read(self_in); } return self; diff --git a/shared-bindings/_canio/Match.c b/shared-bindings/_canio/Match.c index 6c32aa5390..b71529b736 100644 --- a/shared-bindings/_canio/Match.c +++ b/shared-bindings/_canio/Match.c @@ -59,11 +59,11 @@ STATIC mp_obj_t canio_match_make_new(const mp_obj_type_t *type, size_t n_args, c int address = args[ARG_address].u_int; int mask = args[ARG_mask].u_int; - if(address & ~address_bits) { + if (address & ~address_bits) { mp_raise_ValueError_varg(translate("%q out of range"), MP_QSTR_address); } - if(mask & ~address_bits) { + if (mask & ~address_bits) { mp_raise_ValueError_varg(translate("%q out of range"), MP_QSTR_mask); } diff --git a/shared-bindings/_canio/Message.c b/shared-bindings/_canio/Message.c index 3fa018a834..bfaaf52b2f 100644 --- a/shared-bindings/_canio/Message.c +++ b/shared-bindings/_canio/Message.c @@ -67,7 +67,7 @@ STATIC mp_obj_t canio_message_make_new(const mp_obj_type_t *type, size_t n_args, bool specified_size = (size != (size_t)-1); bool specified_data = (args[ARG_data].u_obj != NULL); - if(specified_size && specified_data) { + if (specified_size && specified_data) { mp_raise_TypeError(translate("specify size or data, but not both")); } @@ -82,7 +82,7 @@ STATIC mp_obj_t canio_message_make_new(const mp_obj_type_t *type, size_t n_args, data.len = 0; } - if(data.len > 8) { + if (data.len > 8) { mp_raise_ValueError(translate("Messages limited to 8 bytes")); } @@ -130,7 +130,7 @@ STATIC mp_obj_t canio_message_data_set(const mp_obj_t self_in, const mp_obj_t da canio_message_obj_t *self = self_in; mp_buffer_info_t data; mp_get_buffer_raise(data_in, &data, MP_BUFFER_READ); - if(data.len > 8) { + if (data.len > 8) { mp_raise_ValueError(translate("Messages limited to 8 bytes")); } common_hal_canio_message_data_set(self, data.buf, data.len); @@ -161,7 +161,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(canio_message_size_get_obj, canio_message_size_get); STATIC mp_obj_t canio_message_size_set(const mp_obj_t self_in, const mp_obj_t size_in) { canio_message_obj_t *self = self_in; int size = mp_obj_get_int(size_in); - if(size > 8) { + if (size > 8) { mp_raise_ValueError(translate("Messages limited to 8 bytes")); } common_hal_canio_message_size_set(self, size); From 44c5b2bbb1a00cf07e1725c76d1920e8c73977ed Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 17 Sep 2020 12:44:40 -0500 Subject: [PATCH 0939/1293] Respond to review comments Thanks @tannewt! --- ports/atmel-samd/common-hal/_canio/Listener.c | 1 - shared-bindings/_canio/CAN.c | 17 +++----------- shared-bindings/_canio/Listener.c | 10 ++++---- shared-bindings/_canio/Match.c | 9 ++++---- shared-bindings/_canio/Match.h | 6 ++++- shared-bindings/_canio/Message.c | 23 +++++++++---------- shared-bindings/_canio/Message.h | 13 +++++++++++ shared-module/_canio/Match.c | 6 ++--- shared-module/_canio/Match.h | 5 ---- shared-module/_canio/Message.c | 20 ++++++++-------- shared-module/_canio/Message.h | 12 ---------- 11 files changed, 53 insertions(+), 69 deletions(-) diff --git a/ports/atmel-samd/common-hal/_canio/Listener.c b/ports/atmel-samd/common-hal/_canio/Listener.c index 4d54e9f734..0a5f629f88 100644 --- a/ports/atmel-samd/common-hal/_canio/Listener.c +++ b/ports/atmel-samd/common-hal/_canio/Listener.c @@ -375,7 +375,6 @@ bool common_hal_canio_listener_readinto(canio_listener_obj_t *self, canio_messag } void common_hal_canio_listener_deinit(canio_listener_obj_t *self) { - // free our FIFO, clear our matches, SOMETHING if (self->can) { clear_filters(self); if (self->fifo_idx == 0) { diff --git a/shared-bindings/_canio/CAN.c b/shared-bindings/_canio/CAN.c index 53045c35ad..537aa55804 100644 --- a/shared-bindings/_canio/CAN.c +++ b/shared-bindings/_canio/CAN.c @@ -53,8 +53,8 @@ //| connected to a transceiver which controls the H and L pins on a shared //| bus. //| -//| :param ~microcontrller.Pin rx: the pin to receive with. -//| :param ~microcontrller.Pin tx: the pin to transmit with, or None if the peripheral should operate in "silent" mode. +//| :param ~microcontroller.Pin rx: the pin to receive with. +//| :param ~microcontroller.Pin tx: the pin to transmit with, or None if the peripheral should operate in "silent" mode. //| :param int baudrate: The bit rate of the bus in Hz. All devices on the bus must agree on this value. //| :param bool loopback: True if the peripheral will be operated in loopback mode. //| :param bool auto_restart: If True, will restart communications after entering bus-off state @@ -76,13 +76,8 @@ STATIC mp_obj_t canio_can_make_new(const mp_obj_type_t *type, size_t n_args, con mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); -mp_printf(&mp_plat_print, "ARG_rx=%d args[ARG_rx].u_obj=%p\n", ARG_rx, args[ARG_rx].u_obj); -mp_printf(&mp_plat_print, "ARG_tx=%d args[ARG_tx].u_obj=%p\n", ARG_tx, args[ARG_tx].u_obj); - mcu_pin_obj_t *rx_pin = validate_obj_is_free_pin(args[ARG_rx].u_obj); -mp_printf(&mp_plat_print, "rx_pin=%p\n", rx_pin); mcu_pin_obj_t *tx_pin = validate_obj_is_free_pin_or_none(args[ARG_tx].u_obj); -mp_printf(&mp_plat_print, "tx_pin=%p\n", tx_pin); canio_can_obj_t *self = m_new_obj(canio_can_obj_t); self->base.type = &canio_can_type; @@ -94,7 +89,7 @@ mp_printf(&mp_plat_print, "tx_pin=%p\n", tx_pin); } -//| auto_restart: int +//| auto_restart: bool //| """If True, will restart communications after entering bus-off state""" //| STATIC mp_obj_t canio_can_auto_restart_get(mp_obj_t self_in) { @@ -240,12 +235,6 @@ STATIC const mp_obj_property_t canio_can_state_obj = { }; -#if 0 -//| # pending_tx_count: int -//| # """The number of messages waiting to be transmitted. (read-only)""" -//| -#endif - //| def restart(self) -> None: //| """If the device is in the bus off state, restart it.""" //| ... diff --git a/shared-bindings/_canio/Listener.c b/shared-bindings/_canio/Listener.c index a3890f8dd3..84b2aacb97 100644 --- a/shared-bindings/_canio/Listener.c +++ b/shared-bindings/_canio/Listener.c @@ -39,7 +39,7 @@ //| //| def read(self) -> Optional[Message]: -//| """Returns a message, after waiting up to self.timeout seconds +//| """Reads a message, after waiting up to self.timeout seconds //| //| If no message is received in time, None is returned. Otherwise, //| a Message is returned.""" @@ -62,10 +62,8 @@ STATIC mp_obj_t canio_listener_read(mp_obj_t self_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_read_obj, canio_listener_read); //| def readinto(self, message: Message) -> bool: -//| """Returns a message, after waiting up to self.timeout seconds -//| -//| Returns True (and modifies message) if a message was received, -//| False otherwise.""" +//| """Returns True (and modifies message) if a message was received +//| before ``timeout`` seconds elapsed, False otherwise.""" //| ... //| STATIC mp_obj_t canio_listener_readinto(mp_obj_t self_in, mp_obj_t message) { @@ -115,7 +113,7 @@ STATIC mp_obj_t canio_listener_next(mp_obj_t self_in) { if (common_hal_canio_listener_in_waiting(self)) { return canio_listener_read(self_in); } - return self; + return MP_OBJ_STOP_ITERATION; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_next_obj, canio_listener_next); diff --git a/shared-bindings/_canio/Match.c b/shared-bindings/_canio/Match.c index b71529b736..4ff35906b7 100644 --- a/shared-bindings/_canio/Match.c +++ b/shared-bindings/_canio/Match.c @@ -25,7 +25,6 @@ */ #include "shared-bindings/_canio/Match.h" -#include "shared-module/_canio/Match.h" #include "py/objproperty.h" #include "py/runtime.h" @@ -46,7 +45,7 @@ STATIC mp_obj_t canio_match_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_address, ARG_mask, ARG_extended, NUM_ARGS }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_address, MP_ARG_INT | MP_ARG_REQUIRED, {.u_int = 0} }, + { MP_QSTR_address, MP_ARG_INT | MP_ARG_REQUIRED }, { MP_QSTR_mask, MP_ARG_INT, {.u_int = 0} }, { MP_QSTR_extended, MP_ARG_BOOL, {.u_bool = false} }, }; @@ -79,7 +78,7 @@ STATIC mp_obj_t canio_match_make_new(const mp_obj_type_t *type, size_t n_args, c STATIC mp_obj_t canio_match_address_get(mp_obj_t self_in) { canio_match_obj_t *self = self_in; - return MP_OBJ_NEW_SMALL_INT(common_hal_canio_match_address_get(self)); + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_match_get_address(self)); } MP_DEFINE_CONST_FUN_OBJ_1(canio_match_address_get_obj, canio_match_address_get); @@ -97,7 +96,7 @@ const mp_obj_property_t canio_match_address_obj = { STATIC mp_obj_t canio_match_mask_get(mp_obj_t self_in) { canio_match_obj_t *self = self_in; - return MP_OBJ_NEW_SMALL_INT(common_hal_canio_match_mask_get(self)); + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_match_get_mask(self)); } MP_DEFINE_CONST_FUN_OBJ_1(canio_match_mask_get_obj, canio_match_mask_get); @@ -114,7 +113,7 @@ const mp_obj_property_t canio_match_mask_obj = { STATIC mp_obj_t canio_match_extended_get(mp_obj_t self_in) { canio_match_obj_t *self = self_in; - return mp_obj_new_bool(common_hal_canio_match_extended_get(self)); + return mp_obj_new_bool(common_hal_canio_match_get_extended(self)); } MP_DEFINE_CONST_FUN_OBJ_1(canio_match_extended_get_obj, canio_match_extended_get); diff --git a/shared-bindings/_canio/Match.h b/shared-bindings/_canio/Match.h index adf98eb865..5522c26367 100644 --- a/shared-bindings/_canio/Match.h +++ b/shared-bindings/_canio/Match.h @@ -27,7 +27,11 @@ #pragma once #include "py/obj.h" +#include "shared-module/_canio/Match.h" extern const mp_obj_type_t canio_match_type; -// Nothing now. +void common_hal_canio_match_construct(canio_match_obj_t *self, int address, int mask, bool extended); +int common_hal_canio_match_get_address(const canio_match_obj_t *self); +int common_hal_canio_match_get_mask(const canio_match_obj_t *self); +bool common_hal_canio_match_get_extended(const canio_match_obj_t *self); diff --git a/shared-bindings/_canio/Message.c b/shared-bindings/_canio/Message.c index bfaaf52b2f..85657e05ef 100644 --- a/shared-bindings/_canio/Message.c +++ b/shared-bindings/_canio/Message.c @@ -25,7 +25,6 @@ */ #include "shared-bindings/_canio/Message.h" -#include "shared-module/_canio/Message.h" #include "py/obj.h" #include "py/objproperty.h" @@ -33,7 +32,7 @@ //| class Message: //| def __init__(self, id: int=0, data: Optional[bytes] = None, *, size: Optional[int] = None, rtr: bool = False, extended: bool = False): -//| """Construct a Message to send on a CAN bus +//| """Construct a Message to use with a CAN bus. Provide arguments to create a message to send. Otherwise, use Listener.readinto() to read a message. //| //| :param int id: The numeric ID of the message //| :param bytes data: The content of the message @@ -97,13 +96,13 @@ STATIC mp_obj_t canio_message_make_new(const mp_obj_type_t *type, size_t n_args, //| STATIC mp_obj_t canio_message_id_get(const mp_obj_t self_in) { canio_message_obj_t *self = self_in; - return MP_OBJ_NEW_SMALL_INT(common_hal_canio_message_id_get(self)); + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_message_get_id(self)); } MP_DEFINE_CONST_FUN_OBJ_1(canio_message_id_get_obj, canio_message_id_get); STATIC mp_obj_t canio_message_id_set(const mp_obj_t self_in, const mp_obj_t id) { canio_message_obj_t *self = self_in; - common_hal_canio_message_id_set(self, mp_obj_get_int(id)); + common_hal_canio_message_set_id(self, mp_obj_get_int(id)); return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_2(canio_message_id_set_obj, canio_message_id_set); @@ -122,7 +121,7 @@ STATIC const mp_obj_property_t canio_message_id_obj = { //| STATIC mp_obj_t canio_message_data_get(const mp_obj_t self_in) { canio_message_obj_t *self = self_in; - return mp_obj_new_bytes((const byte*)common_hal_canio_message_data_get(self), common_hal_canio_message_size_get(self)); + return mp_obj_new_bytes((const byte*)common_hal_canio_message_get_data(self), common_hal_canio_message_get_size(self)); } MP_DEFINE_CONST_FUN_OBJ_1(canio_message_data_get_obj, canio_message_data_get); @@ -133,7 +132,7 @@ STATIC mp_obj_t canio_message_data_set(const mp_obj_t self_in, const mp_obj_t da if (data.len > 8) { mp_raise_ValueError(translate("Messages limited to 8 bytes")); } - common_hal_canio_message_data_set(self, data.buf, data.len); + common_hal_canio_message_set_data(self, data.buf, data.len); return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_2(canio_message_data_set_obj, canio_message_data_set); @@ -154,7 +153,7 @@ STATIC const mp_obj_property_t canio_message_data_obj = { //| STATIC mp_obj_t canio_message_size_get(const mp_obj_t self_in) { canio_message_obj_t *self = self_in; - return MP_OBJ_NEW_SMALL_INT(common_hal_canio_message_size_get(self)); + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_message_get_size(self)); } MP_DEFINE_CONST_FUN_OBJ_1(canio_message_size_get_obj, canio_message_size_get); @@ -164,7 +163,7 @@ STATIC mp_obj_t canio_message_size_set(const mp_obj_t self_in, const mp_obj_t si if (size > 8) { mp_raise_ValueError(translate("Messages limited to 8 bytes")); } - common_hal_canio_message_size_set(self, size); + common_hal_canio_message_set_size(self, size); return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_2(canio_message_size_set_obj, canio_message_size_set); @@ -182,13 +181,13 @@ STATIC const mp_obj_property_t canio_message_size_obj = { //| STATIC mp_obj_t canio_message_extended_get(const mp_obj_t self_in) { canio_message_obj_t *self = self_in; - return mp_obj_new_bool(common_hal_canio_message_extended_get(self)); + return mp_obj_new_bool(common_hal_canio_message_get_extended(self)); } MP_DEFINE_CONST_FUN_OBJ_1(canio_message_extended_get_obj, canio_message_extended_get); STATIC mp_obj_t canio_message_extended_set(const mp_obj_t self_in, const mp_obj_t extended) { canio_message_obj_t *self = self_in; - common_hal_canio_message_size_set(self, mp_obj_is_true(extended)); + common_hal_canio_message_set_extended(self, mp_obj_is_true(extended)); return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_2(canio_message_extended_set_obj, canio_message_extended_set); @@ -207,13 +206,13 @@ STATIC const mp_obj_property_t canio_message_extended_obj = { //| STATIC mp_obj_t canio_message_rtr_get(const mp_obj_t self_in) { canio_message_obj_t *self = self_in; - return mp_obj_new_bool(common_hal_canio_message_rtr_get(self)); + return mp_obj_new_bool(common_hal_canio_message_get_rtr(self)); } MP_DEFINE_CONST_FUN_OBJ_1(canio_message_rtr_get_obj, canio_message_rtr_get); STATIC mp_obj_t canio_message_rtr_set(const mp_obj_t self_in, const mp_obj_t rtr) { canio_message_obj_t *self = self_in; - common_hal_canio_message_size_set(self, mp_obj_is_true(rtr)); + common_hal_canio_message_set_rtr(self, mp_obj_is_true(rtr)); return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_2(canio_message_rtr_set_obj, canio_message_rtr_set); diff --git a/shared-bindings/_canio/Message.h b/shared-bindings/_canio/Message.h index 32d6801bc3..ed739af0d4 100644 --- a/shared-bindings/_canio/Message.h +++ b/shared-bindings/_canio/Message.h @@ -27,5 +27,18 @@ #pragma once #include "py/obj.h" +#include "shared-module/_canio/Message.h" extern const mp_obj_type_t canio_message_type; + +void common_hal_canio_message_construct(canio_message_obj_t *self, int id, void *data, size_t size, bool rtr, bool extended); +const void *common_hal_canio_message_get_data(const canio_message_obj_t *self); +void common_hal_canio_message_set_data(canio_message_obj_t *self, const void *data, size_t size); +bool common_hal_canio_message_get_extended(const canio_message_obj_t *self); +void common_hal_canio_message_set_extended(canio_message_obj_t *self, bool extended); +int common_hal_canio_message_get_id(const canio_message_obj_t *self); +void common_hal_canio_message_set_id(canio_message_obj_t *self, int id); +bool common_hal_canio_message_get_rtr(const canio_message_obj_t *self); +void common_hal_canio_message_set_rtr(canio_message_obj_t *self, bool rtr); +size_t common_hal_canio_message_get_size(const canio_message_obj_t *self); +void common_hal_canio_message_set_size(canio_message_obj_t *self, size_t size); diff --git a/shared-module/_canio/Match.c b/shared-module/_canio/Match.c index 2b696addb0..3dcde18a78 100644 --- a/shared-module/_canio/Match.c +++ b/shared-module/_canio/Match.c @@ -32,12 +32,12 @@ void common_hal_canio_match_construct(canio_match_obj_t *self, int address, int self->extended = extended; } -int common_hal_canio_match_address_get(const canio_match_obj_t *self) { +int common_hal_canio_match_get_address(const canio_match_obj_t *self) { return self->address; } -int common_hal_canio_match_mask_get(const canio_match_obj_t *self) { +int common_hal_canio_match_get_mask(const canio_match_obj_t *self) { return self->mask; } -bool common_hal_canio_match_extended_get(const canio_match_obj_t *self) { +bool common_hal_canio_match_get_extended(const canio_match_obj_t *self) { return self->extended; } diff --git a/shared-module/_canio/Match.h b/shared-module/_canio/Match.h index 099df976df..25f047f37e 100644 --- a/shared-module/_canio/Match.h +++ b/shared-module/_canio/Match.h @@ -34,8 +34,3 @@ typedef struct { int mask; bool extended; } canio_match_obj_t; - -void common_hal_canio_match_construct(canio_match_obj_t *self, int address, int mask, bool extended); -int common_hal_canio_match_address_get(const canio_match_obj_t *self); -int common_hal_canio_match_mask_get(const canio_match_obj_t *self); -bool common_hal_canio_match_extended_get(const canio_match_obj_t *self); diff --git a/shared-module/_canio/Message.c b/shared-module/_canio/Message.c index c0403b5196..0caca58f02 100644 --- a/shared-module/_canio/Message.c +++ b/shared-module/_canio/Message.c @@ -41,57 +41,57 @@ void common_hal_canio_message_construct(canio_message_obj_t *self, int id, void } } -int common_hal_canio_message_id_get(const canio_message_obj_t *self) +int common_hal_canio_message_get_id(const canio_message_obj_t *self) { return self->id; } -void common_hal_canio_message_id_set(canio_message_obj_t *self, int id) +void common_hal_canio_message_set_id(canio_message_obj_t *self, int id) { self->id = id; } -const void *common_hal_canio_message_data_get(const canio_message_obj_t *self) +const void *common_hal_canio_message_get_data(const canio_message_obj_t *self) { return self->data; } -const void common_hal_canio_message_data_set(canio_message_obj_t *self, const void *data, size_t size) +const void common_hal_canio_message_set_data(canio_message_obj_t *self, const void *data, size_t size) { self->size = size; memcpy(self->data, data, size); } -size_t common_hal_canio_message_size_get(const canio_message_obj_t *self) +size_t common_hal_canio_message_get_size(const canio_message_obj_t *self) { return self->size; } -void common_hal_canio_message_size_set(canio_message_obj_t *self, size_t size) +void common_hal_canio_message_set_size(canio_message_obj_t *self, size_t size) { memset(self->data, 0, size); self->size = size; } -bool common_hal_canio_message_rtr_get(const canio_message_obj_t *self) +bool common_hal_canio_message_get_rtr(const canio_message_obj_t *self) { return self->rtr; } -void common_hal_canio_message_rtr_set(canio_message_obj_t *self, bool rtr) +void common_hal_canio_message_set_rtr(canio_message_obj_t *self, bool rtr) { self->rtr = rtr; } -bool common_hal_canio_message_extended_get(const canio_message_obj_t *self) +bool common_hal_canio_message_get_extended(const canio_message_obj_t *self) { return self->extended; } -void common_hal_canio_message_extended_set(canio_message_obj_t *self, bool extended) +void common_hal_canio_message_set_extended(canio_message_obj_t *self, bool extended) { self->extended = extended; } diff --git a/shared-module/_canio/Message.h b/shared-module/_canio/Message.h index b9fd8eaf2d..b99c5c48e3 100644 --- a/shared-module/_canio/Message.h +++ b/shared-module/_canio/Message.h @@ -36,15 +36,3 @@ typedef struct { bool rtr:1; bool extended:1; } canio_message_obj_t; - -void common_hal_canio_message_construct(canio_message_obj_t *self, int id, void *data, size_t size, bool rtr, bool extended); -bool common_hal_canio_message_rtr_get(const canio_message_obj_t *self); -bool common_hal_canio_message_extended_get(const canio_message_obj_t *self); -int common_hal_canio_message_id_get(const canio_message_obj_t *self); -const void *common_hal_canio_message_data_get(const canio_message_obj_t *self); -size_t common_hal_canio_message_size_get(const canio_message_obj_t *self); -void common_hal_canio_message_rtr_set(canio_message_obj_t *self, bool rtr); -void common_hal_canio_message_extended_set(canio_message_obj_t *self, bool extended); -void common_hal_canio_message_id_set(canio_message_obj_t *self, int id); -void common_hal_canio_message_data_set(canio_message_obj_t *self, const void *data, size_t size); -void common_hal_canio_message_size_set(canio_message_obj_t *self, size_t size); From 67d8f108bb94bd734e218f13201fb31d64a66dd4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 18 Sep 2020 10:56:52 -0500 Subject: [PATCH 0940/1293] Add CAN to SAM E51 clock config --- .../asf4_conf/same51/peripheral_clk_config.h | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/ports/atmel-samd/asf4_conf/same51/peripheral_clk_config.h b/ports/atmel-samd/asf4_conf/same51/peripheral_clk_config.h index 59fe8730e6..51173f6d32 100644 --- a/ports/atmel-samd/asf4_conf/same51/peripheral_clk_config.h +++ b/ports/atmel-samd/asf4_conf/same51/peripheral_clk_config.h @@ -1165,6 +1165,88 @@ #define CONF_SDHC1_SLOW_FREQUENCY 12000000 #endif +// CAN Clock Settings +// CAN Clock source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for CAN. +// sdhc_gclk_selection +#ifndef CONF_GCLK_CAN0_SRC +#define CONF_GCLK_CAN0_SRC GCLK_PCHCTRL_GEN_GCLK0_Val +#endif + +/** + * \def CAN FREQUENCY + * \brief CAN's Clock frequency + */ +#ifndef CONF_CAN0_FREQUENCY +#define CONF_CAN0_FREQUENCY 120000000 +#endif + +// CAN Clock Settings +// CAN Clock source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for CAN. +// sdhc_gclk_selection +#ifndef CONF_GCLK_CAN1_SRC +#define CONF_GCLK_CAN1_SRC GCLK_PCHCTRL_GEN_GCLK0_Val +#endif + +/** + * \def CAN FREQUENCY + * \brief CAN's Clock frequency + */ +#ifndef CONF_CAN1_FREQUENCY +#define CONF_CAN1_FREQUENCY 120000000 +#endif + // <<< end of configuration section >>> #endif // PERIPHERAL_CLK_CONFIG_H From a76119afcba6d7ceb4eb1e4baa79745528feeb92 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 18 Sep 2020 10:57:15 -0500 Subject: [PATCH 0941/1293] add _canio to Feather M4 CAN --- ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk index 306e7fe42b..345ac33c5d 100644 --- a/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk @@ -12,3 +12,4 @@ EXTERNAL_FLASH_DEVICES = GD25Q16C LONGINT_IMPL = MPZ CIRCUITPY_VECTORIO = 1 +CIRCUITPY_CANIO = 1 From c39ec1581e3fbc59de7f882adf2e6fbb574fb42e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 18 Sep 2020 11:14:59 -0500 Subject: [PATCH 0942/1293] _canio: Message: setting data clears rtr, and vice versa --- shared-bindings/_canio/Message.c | 4 ++-- shared-module/_canio/Message.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/shared-bindings/_canio/Message.c b/shared-bindings/_canio/Message.c index 85657e05ef..c7ef5d4582 100644 --- a/shared-bindings/_canio/Message.c +++ b/shared-bindings/_canio/Message.c @@ -117,7 +117,7 @@ STATIC const mp_obj_property_t canio_message_id_obj = { //| data: bytes //| """The content of the message, or dummy content in the case of an rtr. //| -//| Assigning to data also sets the length.""" +//| Assigning to data also sets the length and clears the rtr flag.""" //| STATIC mp_obj_t canio_message_data_get(const mp_obj_t self_in) { canio_message_obj_t *self = self_in; @@ -202,7 +202,7 @@ STATIC const mp_obj_property_t canio_message_extended_obj = { //| rtr: bool -//| """True if the message represents a remote transmission request (RTR)""" +//| """True if the message represents a remote transmission request (RTR). Setting rtr to true zeros out data""" //| STATIC mp_obj_t canio_message_rtr_get(const mp_obj_t self_in) { canio_message_obj_t *self = self_in; diff --git a/shared-module/_canio/Message.c b/shared-module/_canio/Message.c index 0caca58f02..a02bd01276 100644 --- a/shared-module/_canio/Message.c +++ b/shared-module/_canio/Message.c @@ -59,6 +59,7 @@ const void *common_hal_canio_message_get_data(const canio_message_obj_t *self) const void common_hal_canio_message_set_data(canio_message_obj_t *self, const void *data, size_t size) { + self->rtr = false; self->size = size; memcpy(self->data, data, size); } @@ -84,6 +85,9 @@ bool common_hal_canio_message_get_rtr(const canio_message_obj_t *self) void common_hal_canio_message_set_rtr(canio_message_obj_t *self, bool rtr) { self->rtr = rtr; + if (rtr) { + memset(self->data, 0, self->size); + } } bool common_hal_canio_message_get_extended(const canio_message_obj_t *self) From 09f8a83a756c784e846d2acd9a929e4a45ea34b4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 18 Sep 2020 13:54:03 -0500 Subject: [PATCH 0943/1293] samd: template.ld: put canram in its own output section --- ports/atmel-samd/boards/common.template.ld | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ports/atmel-samd/boards/common.template.ld b/ports/atmel-samd/boards/common.template.ld index 19e4753f8b..b30a7a1d9f 100644 --- a/ports/atmel-samd/boards/common.template.ld +++ b/ports/atmel-samd/boards/common.template.ld @@ -43,6 +43,17 @@ SECTIONS _sidata = .; /* start of .data section */ } >FLASH_FIRMWARE + /* Data accessed by the CAN peripheral must be in the first 64kB RAM */ + /* place it at the very start of RAM, before the .data section */ + /* it is zeroed by reset_port */ + .canram (NOLOAD) : + { + . = ALIGN(4); + _scanram = .; + *(.canram) + _ecanram = .; + } > RAM + /* This is the initialized data section The program executes knowing that the data is in the RAM but the loader puts the initial values in the FLASH_FIRMWARE (inidata). @@ -67,10 +78,6 @@ SECTIONS . = ALIGN(4); _sbss = .; _szero = .; /* define a global symbol at bss start; used by startup code */ - /* Data accessed by the CAN peripheral must be in the first 64kB RAM */ - _scanram = .; - *(.canram) - _ecanram = .; *(.bss) *(.bss*) *(COMMON) From 7fd6cab2ac411b808858c0fac9049a856a592cb1 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 18 Sep 2020 14:19:05 -0500 Subject: [PATCH 0944/1293] canio: Make both tx and rx (but not both) optional .. loopback and silent come from the (optional) constructor parameters not guessing based on the pin specification .. docstring & comment improvements --- ports/atmel-samd/common-hal/_canio/CAN.c | 28 +++++++---- ports/atmel-samd/common-hal/_canio/CAN.h | 2 + shared-bindings/_canio/CAN.c | 64 ++++++++++++++++++++---- 3 files changed, 74 insertions(+), 20 deletions(-) diff --git a/ports/atmel-samd/common-hal/_canio/CAN.c b/ports/atmel-samd/common-hal/_canio/CAN.c index 266a1aa1f7..2d8f1d0312 100644 --- a/ports/atmel-samd/common-hal/_canio/CAN.c +++ b/ports/atmel-samd/common-hal/_canio/CAN.c @@ -51,9 +51,10 @@ __attribute__((optimize("O0"), noinline)) void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *rx, mcu_pin_obj_t *tx, int baudrate, bool loopback, bool silent) { mcu_pin_function_t *tx_function = mcu_find_pin_function(can_tx, tx, -1, MP_QSTR_tx); - int instance = tx_function->instance; + int instance = tx_function ? tx_function->instance : -1; mcu_pin_function_t *rx_function = mcu_find_pin_function(can_rx, rx, instance, MP_QSTR_rx); + instance = rx_function->instance; const uint32_t can_frequency = CONF_CAN0_FREQUENCY; @@ -68,9 +69,11 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *rx, mc mp_raise_OSError(MP_EINVAL); // baudrate cannot be attained (16kHz or something is lower bound, should never happen) } - gpio_set_pin_direction(tx_function->pin, GPIO_DIRECTION_OUT); - gpio_set_pin_function(tx_function->pin, tx_function->function); - common_hal_never_reset_pin(tx_function->obj); + if (tx_function) { + gpio_set_pin_direction(tx_function->pin, GPIO_DIRECTION_OUT); + gpio_set_pin_function(tx_function->pin, tx_function->function); + common_hal_never_reset_pin(tx_function->obj); + } if (rx_function) { gpio_set_pin_direction(rx_function->pin, GPIO_DIRECTION_IN); @@ -78,12 +81,13 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *rx, mc common_hal_never_reset_pin(rx_function->obj); } - self->tx_pin_number = common_hal_mcu_pin_number(tx); + self->tx_pin_number = tx ? common_hal_mcu_pin_number(tx) : COMMON_HAL_MCU_NO_PIN; self->rx_pin_number = rx ? common_hal_mcu_pin_number(rx) : COMMON_HAL_MCU_NO_PIN; self->hw = can_insts[instance]; self->state = &can_state[instance]; self->loopback = loopback; + self->silent = silent; // Allow configuration change hri_can_set_CCCR_INIT_bit(self->hw); @@ -129,11 +133,9 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *rx, mc hri_can_write_NBTP_reg(self->hw, btp.reg); } - // we don't do the high bit rate yet, so do we need to set this register? - // hri_can_write_DBTP_reg(self->hw, ???); - // A "data bit" is a data bit :) with dul rate CAN FD, this is a higher - // rate. However, CAN FD is not implemented in CircuitPython, and this is the same rate as - // the "nominal rate". + // A "data bit" is a data bit :) with dula rate CAN FD, this is a higher + // rate. However, CAN FD is not implemented in CircuitPython, and this is + // the same rate as the "nominal rate". { CAN_DBTP_Type btp = { .bit.DTSEG1 = DIV_ROUND(clocks_to_sample, divisor) - 1, @@ -259,7 +261,7 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *rx, mc can_objs[instance] = self; } -int common_hal_canio_can_loopback_get(canio_can_obj_t *self) +bool common_hal_canio_can_loopback_get(canio_can_obj_t *self) { return self->loopback; } @@ -368,6 +370,10 @@ void common_hal_canio_can_send(canio_can_obj_t *self, canio_message_obj_t *messa } } +bool common_hal_canio_can_silent_get(canio_can_obj_t *self) { + return self->silent; +} + bool common_hal_canio_can_deinited(canio_can_obj_t *self) { return !self->hw; } diff --git a/ports/atmel-samd/common-hal/_canio/CAN.h b/ports/atmel-samd/common-hal/_canio/CAN.h index 02bc2e41b5..893b71550d 100644 --- a/ports/atmel-samd/common-hal/_canio/CAN.h +++ b/ports/atmel-samd/common-hal/_canio/CAN.h @@ -60,8 +60,10 @@ int common_hal_canio_can_baudrate_get(canio_can_obj_t *self); int common_hal_canio_can_bus_off_state_count_get(canio_can_obj_t *self); int common_hal_canio_can_error_passive_state_count_get(canio_can_obj_t *self); int common_hal_canio_can_error_warning_state_count_get(canio_can_obj_t *self); +bool common_hal_canio_can_loopback_get(canio_can_obj_t *self); int common_hal_canio_can_receive_error_count_get(canio_can_obj_t *self); canio_bus_state_t common_hal_canio_can_state_get(canio_can_obj_t *self); +bool common_hal_canio_can_silent_get(canio_can_obj_t *self); int common_hal_canio_can_transmit_error_count_get(canio_can_obj_t *self); void common_hal_canio_can_auto_restart_set(canio_can_obj_t *self, bool auto_restart); void common_hal_canio_can_check_for_deinit(canio_can_obj_t *self); diff --git a/shared-bindings/_canio/CAN.c b/shared-bindings/_canio/CAN.c index 537aa55804..3c80b342f7 100644 --- a/shared-bindings/_canio/CAN.c +++ b/shared-bindings/_canio/CAN.c @@ -42,7 +42,7 @@ //| """CAN bus protocol""" //| //| def __init__(self, -//| rx: microcontroller.Pin, +//| rx: Optional[microcontroller.Pin]=None, //| tx: Optional[microcontroller.Pin]=None, //| *, //| baudrate: int = 250000, @@ -50,13 +50,18 @@ //| auto_restart: bool = False, //| ): //| """A common shared-bus protocol. The rx and tx pins are generally -//| connected to a transceiver which controls the H and L pins on a shared -//| bus. +//| connected to a transceiver which controls the H and L pins on a +//| shared bus. //| -//| :param ~microcontroller.Pin rx: the pin to receive with. -//| :param ~microcontroller.Pin tx: the pin to transmit with, or None if the peripheral should operate in "silent" mode. +//| Normally, both ``tx`` and ``rx`` pins will be specified. However, +//| in silent and loopback modes, the other pin may not be required and +//| can be used for other purposes. +//| +//| :param ~microcontroller.Pin rx: the pin to receive with, or None. +//| :param ~microcontroller.Pin tx: the pin to transmit with, or None. //| :param int baudrate: The bit rate of the bus in Hz. All devices on the bus must agree on this value. -//| :param bool loopback: True if the peripheral will be operated in loopback mode. +//| :param bool loopback: True if the peripheral will be operated in loopback mode. In loopback mode, the ``rx`` pin's value is ignored, and the device receives the packets it sends. +//| :param bool silent: True if the peripheral will be operated in silent mode. In silent mode, the ``tx`` pin is always driven to the high logic level. This mode can be used to "sniff" a CAN bus without interfering. //| :param bool auto_restart: If True, will restart communications after entering bus-off state //| """ //| ... @@ -64,8 +69,8 @@ STATIC mp_obj_t canio_can_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_rx, ARG_tx, ARG_baudrate, ARG_loopback, ARG_silent, ARG_auto_restart, NUM_ARGS }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_rx, MP_ARG_OBJ | MP_ARG_REQUIRED, {.u_obj = 0} }, - { MP_QSTR_tx, MP_ARG_OBJ, {.u_obj = 0} }, + { MP_QSTR_rx, MP_ARG_OBJ, {.u_obj = mp_const_none} }, + { MP_QSTR_tx, MP_ARG_OBJ, {.u_obj = mp_const_none} }, { MP_QSTR_baudrate, MP_ARG_INT, {.u_int = 250000} }, { MP_QSTR_loopback, MP_ARG_BOOL, {.u_bool = false} }, { MP_QSTR_silent, MP_ARG_BOOL, {.u_bool = false} }, @@ -76,8 +81,11 @@ STATIC mp_obj_t canio_can_make_new(const mp_obj_type_t *type, size_t n_args, con mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mcu_pin_obj_t *rx_pin = validate_obj_is_free_pin(args[ARG_rx].u_obj); + mcu_pin_obj_t *rx_pin = validate_obj_is_free_pin_or_none(args[ARG_rx].u_obj); mcu_pin_obj_t *tx_pin = validate_obj_is_free_pin_or_none(args[ARG_tx].u_obj); + if (!rx_pin && !tx_pin) { + mp_raise_ValueError(translate("tx and rx cannot both be None")); + } canio_can_obj_t *self = m_new_obj(canio_can_obj_t); self->base.type = &canio_can_type; @@ -301,6 +309,24 @@ STATIC mp_obj_t canio_can_listen(size_t n_args, const mp_obj_t *pos_args, mp_map } MP_DEFINE_CONST_FUN_OBJ_KW(canio_can_listen_obj, 1, canio_can_listen); +//| loopback: bool +//| """True if the device was created in loopback mode, False otherwise""" +//| +STATIC mp_obj_t canio_can_loopback_get(mp_obj_t self_in) { + canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_can_check_for_deinit(self); + return mp_obj_new_bool(common_hal_canio_can_loopback_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_can_loopback_get_obj, canio_can_loopback_get); + +STATIC const mp_obj_property_t canio_can_loopback_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_can_loopback_get_obj, + (mp_obj_t)mp_const_none, + (mp_obj_t)mp_const_none}, +}; + + //| def send(message: Message) -> None: //| """Send a message on the bus with the given data and id. //| If the message could not be sent due to a full fifo or a bus error condition, RuntimeError is raised. @@ -321,6 +347,24 @@ STATIC mp_obj_t canio_can_send(mp_obj_t self_in, mp_obj_t message_in) { } MP_DEFINE_CONST_FUN_OBJ_2(canio_can_send_obj, canio_can_send); +//| silent: bool +//| """True if the device was created in silent mode, False otherwise""" +//| +STATIC mp_obj_t canio_can_silent_get(mp_obj_t self_in) { + canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_canio_can_check_for_deinit(self); + return mp_obj_new_bool(common_hal_canio_can_silent_get(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_can_silent_get_obj, canio_can_silent_get); + +STATIC const mp_obj_property_t canio_can_silent_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_can_silent_get_obj, + (mp_obj_t)mp_const_none, + (mp_obj_t)mp_const_none}, +}; + + //| def deinit(self) -> None: //| """Deinitialize this object, freeing its hardware resources""" //| ... @@ -363,9 +407,11 @@ STATIC const mp_rom_map_elem_t canio_can_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_error_passive_state_count), MP_ROM_PTR(&canio_can_error_passive_state_count_obj) }, { MP_ROM_QSTR(MP_QSTR_error_warning_state_count), MP_ROM_PTR(&canio_can_error_warning_state_count_obj) }, { MP_ROM_QSTR(MP_QSTR_listen), MP_ROM_PTR(&canio_can_listen_obj) }, + { MP_ROM_QSTR(MP_QSTR_loopback), MP_ROM_PTR(&canio_can_loopback_obj) }, { MP_ROM_QSTR(MP_QSTR_receive_error_count), MP_ROM_PTR(&canio_can_receive_error_count_obj) }, { MP_ROM_QSTR(MP_QSTR_restart), MP_ROM_PTR(&canio_can_restart_obj) }, { MP_ROM_QSTR(MP_QSTR_send), MP_ROM_PTR(&canio_can_send_obj) }, + { MP_ROM_QSTR(MP_QSTR_silent), MP_ROM_PTR(&canio_can_silent_obj) }, { MP_ROM_QSTR(MP_QSTR_state), MP_ROM_PTR(&canio_can_state_obj) }, { MP_ROM_QSTR(MP_QSTR_transmit_error_count), MP_ROM_PTR(&canio_can_transmit_error_count_obj) }, }; From df379b84cb00a3ad694fb89877529c6862a455cb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 21 Sep 2020 15:07:40 -0500 Subject: [PATCH 0945/1293] remove unneeded symbols --- ports/atmel-samd/boards/common.template.ld | 2 -- 1 file changed, 2 deletions(-) diff --git a/ports/atmel-samd/boards/common.template.ld b/ports/atmel-samd/boards/common.template.ld index b30a7a1d9f..8942450d2d 100644 --- a/ports/atmel-samd/boards/common.template.ld +++ b/ports/atmel-samd/boards/common.template.ld @@ -49,9 +49,7 @@ SECTIONS .canram (NOLOAD) : { . = ALIGN(4); - _scanram = .; *(.canram) - _ecanram = .; } > RAM /* This is the initialized data section From fd9df164c0c3f3f5c6da3f2f2e17780c7caa6653 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 21 Sep 2020 15:33:42 -0500 Subject: [PATCH 0946/1293] canio: Message: remove size property This is just duplicating what len(message.data) gives you. --- shared-bindings/_canio/Message.c | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/shared-bindings/_canio/Message.c b/shared-bindings/_canio/Message.c index c7ef5d4582..487ac9bfd1 100644 --- a/shared-bindings/_canio/Message.c +++ b/shared-bindings/_canio/Message.c @@ -146,36 +146,6 @@ STATIC const mp_obj_property_t canio_message_data_obj = { }; -//| size: int -//| """The length of the message, or the length of the requested data in the case of an rtr -//| -//| Assigning to the length sets all the data bytes to zero""" -//| -STATIC mp_obj_t canio_message_size_get(const mp_obj_t self_in) { - canio_message_obj_t *self = self_in; - return MP_OBJ_NEW_SMALL_INT(common_hal_canio_message_get_size(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(canio_message_size_get_obj, canio_message_size_get); - -STATIC mp_obj_t canio_message_size_set(const mp_obj_t self_in, const mp_obj_t size_in) { - canio_message_obj_t *self = self_in; - int size = mp_obj_get_int(size_in); - if (size > 8) { - mp_raise_ValueError(translate("Messages limited to 8 bytes")); - } - common_hal_canio_message_set_size(self, size); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_2(canio_message_size_set_obj, canio_message_size_set); - - -STATIC const mp_obj_property_t canio_message_size_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_message_size_get_obj, - (mp_obj_t)&canio_message_size_set_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - //| extended: bool //| """True if the message represents a remote transmission request (RTR)""" //| @@ -229,7 +199,6 @@ STATIC const mp_obj_property_t canio_message_rtr_obj = { STATIC const mp_rom_map_elem_t canio_message_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_id), MP_ROM_PTR(&canio_message_id_obj) }, { MP_ROM_QSTR(MP_QSTR_data), MP_ROM_PTR(&canio_message_data_obj) }, - { MP_ROM_QSTR(MP_QSTR_size), MP_ROM_PTR(&canio_message_size_obj) }, { MP_ROM_QSTR(MP_QSTR_rtr), MP_ROM_PTR(&canio_message_rtr_obj) }, { MP_ROM_QSTR(MP_QSTR_extended), MP_ROM_PTR(&canio_message_extended_obj) }, }; From 4e4853dcb26aa46db3269db45a8cbbbad61c44d8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 21 Sep 2020 15:49:51 -0500 Subject: [PATCH 0947/1293] common.template.ld: remove unneeded line --- ports/atmel-samd/boards/common.template.ld | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/atmel-samd/boards/common.template.ld b/ports/atmel-samd/boards/common.template.ld index 8942450d2d..53c4cf5eec 100644 --- a/ports/atmel-samd/boards/common.template.ld +++ b/ports/atmel-samd/boards/common.template.ld @@ -60,7 +60,6 @@ SECTIONS { . = ALIGN(4); _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialize the .data section in RAM */ - . = ALIGN(4); *(.ramfunc) *(.ramfunc*) *(.data) /* .data sections */ From 9e8f1820c8b9be728ae0f9e7c197565ac17cc6a8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 21 Sep 2020 15:51:55 -0500 Subject: [PATCH 0948/1293] canio.CAN: switch rx/tx, make both mandatory, move declarations around --- ports/atmel-samd/common-hal/_canio/CAN.c | 22 ++++++++-------------- ports/atmel-samd/common-hal/_canio/CAN.h | 22 ++-------------------- shared-bindings/_canio/CAN.c | 23 ++++++++++------------- shared-bindings/_canio/CAN.h | 23 +++++++++++++++++++++++ 4 files changed, 43 insertions(+), 47 deletions(-) diff --git a/ports/atmel-samd/common-hal/_canio/CAN.c b/ports/atmel-samd/common-hal/_canio/CAN.c index 2d8f1d0312..0d967d7cae 100644 --- a/ports/atmel-samd/common-hal/_canio/CAN.c +++ b/ports/atmel-samd/common-hal/_canio/CAN.c @@ -47,14 +47,12 @@ STATIC canio_can_obj_t *can_objs[MP_ARRAY_SIZE(can_insts)]; // This must be placed in the first 64kB of RAM STATIC COMPILER_SECTION(".canram") canio_can_state_t can_state[MP_ARRAY_SIZE(can_insts)]; -__attribute__((optimize("O0"), noinline)) -void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *rx, mcu_pin_obj_t *tx, int baudrate, bool loopback, bool silent) +void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *tx, mcu_pin_obj_t *rx, int baudrate, bool loopback, bool silent) { mcu_pin_function_t *tx_function = mcu_find_pin_function(can_tx, tx, -1, MP_QSTR_tx); - int instance = tx_function ? tx_function->instance : -1; + int instance = tx_function->instance; mcu_pin_function_t *rx_function = mcu_find_pin_function(can_rx, rx, instance, MP_QSTR_rx); - instance = rx_function->instance; const uint32_t can_frequency = CONF_CAN0_FREQUENCY; @@ -69,17 +67,13 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *rx, mc mp_raise_OSError(MP_EINVAL); // baudrate cannot be attained (16kHz or something is lower bound, should never happen) } - if (tx_function) { - gpio_set_pin_direction(tx_function->pin, GPIO_DIRECTION_OUT); - gpio_set_pin_function(tx_function->pin, tx_function->function); - common_hal_never_reset_pin(tx_function->obj); - } + gpio_set_pin_direction(tx_function->pin, GPIO_DIRECTION_OUT); + gpio_set_pin_function(tx_function->pin, tx_function->function); + common_hal_never_reset_pin(tx_function->obj); - if (rx_function) { - gpio_set_pin_direction(rx_function->pin, GPIO_DIRECTION_IN); - gpio_set_pin_function(rx_function->pin, rx_function->function); - common_hal_never_reset_pin(rx_function->obj); - } + gpio_set_pin_direction(rx_function->pin, GPIO_DIRECTION_IN); + gpio_set_pin_function(rx_function->pin, rx_function->function); + common_hal_never_reset_pin(rx_function->obj); self->tx_pin_number = tx ? common_hal_mcu_pin_number(tx) : COMMON_HAL_MCU_NO_PIN; self->rx_pin_number = rx ? common_hal_mcu_pin_number(rx) : COMMON_HAL_MCU_NO_PIN; diff --git a/ports/atmel-samd/common-hal/_canio/CAN.h b/ports/atmel-samd/common-hal/_canio/CAN.h index 893b71550d..1cc34e3ac0 100644 --- a/ports/atmel-samd/common-hal/_canio/CAN.h +++ b/ports/atmel-samd/common-hal/_canio/CAN.h @@ -28,6 +28,7 @@ #include "py/obj.h" #include "shared-bindings/_canio/__init__.h" +#include "shared-bindings/_canio/CAN.h" #include "component/can.h" #include "common-hal/microcontroller/Pin.h" #include "common-hal/_canio/__init__.h" @@ -36,7 +37,7 @@ #define COMMON_HAL_CAN_RX_FIFO_LEN (2) #define COMMON_HAL_CAN_TX_FIFO_LEN (2) -typedef struct { +typedef struct canio_can_obj { mp_obj_base_t base; Can *hw; canio_can_state_t *state; @@ -52,22 +53,3 @@ typedef struct { bool fifo0_in_use:1; bool fifo1_in_use:1; } canio_can_obj_t; - -void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *rx, mcu_pin_obj_t *tx, int baudrate, bool loopback, bool silent); -bool common_hal_canio_can_auto_restart_get(canio_can_obj_t *self); -bool common_hal_canio_can_deinited(canio_can_obj_t *self); -int common_hal_canio_can_baudrate_get(canio_can_obj_t *self); -int common_hal_canio_can_bus_off_state_count_get(canio_can_obj_t *self); -int common_hal_canio_can_error_passive_state_count_get(canio_can_obj_t *self); -int common_hal_canio_can_error_warning_state_count_get(canio_can_obj_t *self); -bool common_hal_canio_can_loopback_get(canio_can_obj_t *self); -int common_hal_canio_can_receive_error_count_get(canio_can_obj_t *self); -canio_bus_state_t common_hal_canio_can_state_get(canio_can_obj_t *self); -bool common_hal_canio_can_silent_get(canio_can_obj_t *self); -int common_hal_canio_can_transmit_error_count_get(canio_can_obj_t *self); -void common_hal_canio_can_auto_restart_set(canio_can_obj_t *self, bool auto_restart); -void common_hal_canio_can_check_for_deinit(canio_can_obj_t *self); -void common_hal_canio_can_deinit(canio_can_obj_t *self); -void common_hal_canio_can_restart(canio_can_obj_t *self); -void common_hal_canio_can_send(canio_can_obj_t *self, canio_message_obj_t *message); -void common_hal_canio_reset(void); diff --git a/shared-bindings/_canio/CAN.c b/shared-bindings/_canio/CAN.c index 3c80b342f7..38aed85d33 100644 --- a/shared-bindings/_canio/CAN.c +++ b/shared-bindings/_canio/CAN.c @@ -42,26 +42,23 @@ //| """CAN bus protocol""" //| //| def __init__(self, -//| rx: Optional[microcontroller.Pin]=None, -//| tx: Optional[microcontroller.Pin]=None, +//| tx: microcontroller.Pin, +//| rx: microcontroller.Pin, //| *, //| baudrate: int = 250000, //| loopback: bool = False, +//| silent: bool = False, //| auto_restart: bool = False, //| ): //| """A common shared-bus protocol. The rx and tx pins are generally //| connected to a transceiver which controls the H and L pins on a //| shared bus. //| -//| Normally, both ``tx`` and ``rx`` pins will be specified. However, -//| in silent and loopback modes, the other pin may not be required and -//| can be used for other purposes. -//| -//| :param ~microcontroller.Pin rx: the pin to receive with, or None. -//| :param ~microcontroller.Pin tx: the pin to transmit with, or None. +//| :param ~microcontroller.Pin rx: the pin to receive with +//| :param ~microcontroller.Pin tx: the pin to transmit with //| :param int baudrate: The bit rate of the bus in Hz. All devices on the bus must agree on this value. -//| :param bool loopback: True if the peripheral will be operated in loopback mode. In loopback mode, the ``rx`` pin's value is ignored, and the device receives the packets it sends. -//| :param bool silent: True if the peripheral will be operated in silent mode. In silent mode, the ``tx`` pin is always driven to the high logic level. This mode can be used to "sniff" a CAN bus without interfering. +//| :param bool loopback: When True the ``rx`` pin's value is ignored, and the device receives the packets it sends. +//| :param bool silent: When True the ``tx`` pin is always driven to the high logic level. This mode can be used to "sniff" a CAN bus without interfering. //| :param bool auto_restart: If True, will restart communications after entering bus-off state //| """ //| ... @@ -69,8 +66,8 @@ STATIC mp_obj_t canio_can_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_rx, ARG_tx, ARG_baudrate, ARG_loopback, ARG_silent, ARG_auto_restart, NUM_ARGS }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_rx, MP_ARG_OBJ, {.u_obj = mp_const_none} }, - { MP_QSTR_tx, MP_ARG_OBJ, {.u_obj = mp_const_none} }, + { MP_QSTR_tx, MP_ARG_OBJ | MP_ARG_REQUIRED }, + { MP_QSTR_rx, MP_ARG_OBJ | MP_ARG_REQUIRED }, { MP_QSTR_baudrate, MP_ARG_INT, {.u_int = 250000} }, { MP_QSTR_loopback, MP_ARG_BOOL, {.u_bool = false} }, { MP_QSTR_silent, MP_ARG_BOOL, {.u_bool = false} }, @@ -89,7 +86,7 @@ STATIC mp_obj_t canio_can_make_new(const mp_obj_type_t *type, size_t n_args, con canio_can_obj_t *self = m_new_obj(canio_can_obj_t); self->base.type = &canio_can_type; - common_hal_canio_can_construct(self, rx_pin, tx_pin, args[ARG_baudrate].u_int, args[ARG_loopback].u_bool, args[ARG_silent].u_bool); + common_hal_canio_can_construct(self, tx_pin, rx_pin, args[ARG_baudrate].u_int, args[ARG_loopback].u_bool, args[ARG_silent].u_bool); common_hal_canio_can_auto_restart_set(self, args[ARG_auto_restart].u_bool); diff --git a/shared-bindings/_canio/CAN.h b/shared-bindings/_canio/CAN.h index 81040cf237..c591c8e6ba 100644 --- a/shared-bindings/_canio/CAN.h +++ b/shared-bindings/_canio/CAN.h @@ -27,5 +27,28 @@ #pragma once #include "py/obj.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/_canio/Message.h" extern const mp_obj_type_t canio_can_type; + +typedef struct canio_can_obj canio_can_obj_t; + +void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *tx, mcu_pin_obj_t *rx, int baudrate, bool loopback, bool silent); +bool common_hal_canio_can_auto_restart_get(canio_can_obj_t *self); +bool common_hal_canio_can_deinited(canio_can_obj_t *self); +int common_hal_canio_can_baudrate_get(canio_can_obj_t *self); +int common_hal_canio_can_bus_off_state_count_get(canio_can_obj_t *self); +int common_hal_canio_can_error_passive_state_count_get(canio_can_obj_t *self); +int common_hal_canio_can_error_warning_state_count_get(canio_can_obj_t *self); +bool common_hal_canio_can_loopback_get(canio_can_obj_t *self); +int common_hal_canio_can_receive_error_count_get(canio_can_obj_t *self); +canio_bus_state_t common_hal_canio_can_state_get(canio_can_obj_t *self); +bool common_hal_canio_can_silent_get(canio_can_obj_t *self); +int common_hal_canio_can_transmit_error_count_get(canio_can_obj_t *self); +void common_hal_canio_can_auto_restart_set(canio_can_obj_t *self, bool auto_restart); +void common_hal_canio_can_check_for_deinit(canio_can_obj_t *self); +void common_hal_canio_can_deinit(canio_can_obj_t *self); +void common_hal_canio_can_restart(canio_can_obj_t *self); +void common_hal_canio_can_send(canio_can_obj_t *self, canio_message_obj_t *message); +void common_hal_canio_reset(void); From 493679da3b5b80b446e805966103a4d6703ec90c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 21 Sep 2020 16:06:17 -0500 Subject: [PATCH 0949/1293] CAN.listen: block until a message comes in or timeout is reached --- shared-bindings/_canio/Listener.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/shared-bindings/_canio/Listener.c b/shared-bindings/_canio/Listener.c index 84b2aacb97..6186f3bbdb 100644 --- a/shared-bindings/_canio/Listener.c +++ b/shared-bindings/_canio/Listener.c @@ -100,20 +100,18 @@ STATIC mp_obj_t canio_listener_iter(mp_obj_t self_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_iter_obj, canio_listener_iter); //| def __next__(self): -//| """Returns the next waiting message, if one is available +//| """Reads a message, after waiting up to self.timeout seconds //| -//| If the object is deinitialized, raises ValueError. -//| -//| If no message is waiting raises StopIteration""" +//| If no message is received in time, raises StopIteration. Otherwise, +//| a Message is returned.""" //| ... //| STATIC mp_obj_t canio_listener_next(mp_obj_t self_in) { - canio_listener_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_canio_listener_check_for_deinit(self); - if (common_hal_canio_listener_in_waiting(self)) { - return canio_listener_read(self_in); + mp_obj_t result = canio_listener_read(self_in); + if (result == mp_const_none) { + return MP_OBJ_STOP_ITERATION; } - return MP_OBJ_STOP_ITERATION; + return result; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_next_obj, canio_listener_next); From 4869dbdc670bfa8a5f2e0a639495d03984ea0a6a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 21 Sep 2020 16:42:12 -0500 Subject: [PATCH 0950/1293] canio: rename from _canio This reflects our belief that the API is stable enough to avoid incompatible changes during 6.x. --- main.c | 2 +- .../atmel-samd/common-hal/{_canio => canio}/CAN.c | 2 +- .../atmel-samd/common-hal/{_canio => canio}/CAN.h | 8 ++++---- .../common-hal/{_canio => canio}/Listener.c | 4 ++-- .../common-hal/{_canio => canio}/Listener.h | 4 ++-- .../common-hal/{_canio => canio}/__init__.c | 0 .../common-hal/{_canio => canio}/__init__.h | 0 py/circuitpy_defns.mk | 14 +++++++------- py/circuitpy_mpconfig.h | 2 +- shared-bindings/{_canio => canio}/CAN.c | 14 +++++++------- shared-bindings/{_canio => canio}/CAN.h | 2 +- shared-bindings/{_canio => canio}/Listener.c | 6 +++--- shared-bindings/{_canio => canio}/Listener.h | 0 shared-bindings/{_canio => canio}/Match.c | 2 +- shared-bindings/{_canio => canio}/Match.h | 2 +- shared-bindings/{_canio => canio}/Message.c | 2 +- shared-bindings/{_canio => canio}/Message.h | 2 +- shared-bindings/{_canio => canio}/__init__.c | 10 +++++----- shared-bindings/{_canio => canio}/__init__.h | 0 shared-module/{_canio => canio}/Match.c | 2 +- shared-module/{_canio => canio}/Match.h | 0 shared-module/{_canio => canio}/Message.c | 2 +- shared-module/{_canio => canio}/Message.h | 0 23 files changed, 40 insertions(+), 40 deletions(-) rename ports/atmel-samd/common-hal/{_canio => canio}/CAN.c (99%) rename ports/atmel-samd/common-hal/{_canio => canio}/CAN.h (91%) rename ports/atmel-samd/common-hal/{_canio => canio}/Listener.c (99%) rename ports/atmel-samd/common-hal/{_canio => canio}/Listener.h (96%) rename ports/atmel-samd/common-hal/{_canio => canio}/__init__.c (100%) rename ports/atmel-samd/common-hal/{_canio => canio}/__init__.h (100%) rename shared-bindings/{_canio => canio}/CAN.c (98%) rename shared-bindings/{_canio => canio}/CAN.h (98%) rename shared-bindings/{_canio => canio}/Listener.c (98%) rename shared-bindings/{_canio => canio}/Listener.h (100%) rename shared-bindings/{_canio => canio}/Match.c (99%) rename shared-bindings/{_canio => canio}/Match.h (97%) rename shared-bindings/{_canio => canio}/Message.c (99%) rename shared-bindings/{_canio => canio}/Message.h (98%) rename shared-bindings/{_canio => canio}/__init__.c (95%) rename shared-bindings/{_canio => canio}/__init__.h (100%) rename shared-module/{_canio => canio}/Match.c (97%) rename shared-module/{_canio => canio}/Match.h (100%) rename shared-module/{_canio => canio}/Message.c (98%) rename shared-module/{_canio => canio}/Message.h (100%) diff --git a/main.c b/main.c index 4d34e451dd..dbd367a596 100755 --- a/main.c +++ b/main.c @@ -82,7 +82,7 @@ #endif #if CIRCUITPY_CANIO -#include "common-hal/_canio/CAN.h" +#include "common-hal/canio/CAN.h" #endif void do_str(const char *src, mp_parse_input_kind_t input_kind) { diff --git a/ports/atmel-samd/common-hal/_canio/CAN.c b/ports/atmel-samd/common-hal/canio/CAN.c similarity index 99% rename from ports/atmel-samd/common-hal/_canio/CAN.c rename to ports/atmel-samd/common-hal/canio/CAN.c index 0d967d7cae..01cc03dea5 100644 --- a/ports/atmel-samd/common-hal/_canio/CAN.c +++ b/ports/atmel-samd/common-hal/canio/CAN.c @@ -31,7 +31,7 @@ #include "peripheral_clk_config.h" -#include "common-hal/_canio/CAN.h" +#include "common-hal/canio/CAN.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/util.h" #include "supervisor/port.h" diff --git a/ports/atmel-samd/common-hal/_canio/CAN.h b/ports/atmel-samd/common-hal/canio/CAN.h similarity index 91% rename from ports/atmel-samd/common-hal/_canio/CAN.h rename to ports/atmel-samd/common-hal/canio/CAN.h index 1cc34e3ac0..cdea60e7d0 100644 --- a/ports/atmel-samd/common-hal/_canio/CAN.h +++ b/ports/atmel-samd/common-hal/canio/CAN.h @@ -27,12 +27,12 @@ #pragma once #include "py/obj.h" -#include "shared-bindings/_canio/__init__.h" -#include "shared-bindings/_canio/CAN.h" +#include "shared-bindings/canio/__init__.h" +#include "shared-bindings/canio/CAN.h" #include "component/can.h" #include "common-hal/microcontroller/Pin.h" -#include "common-hal/_canio/__init__.h" -#include "shared-module/_canio/Message.h" +#include "common-hal/canio/__init__.h" +#include "shared-module/canio/Message.h" #define COMMON_HAL_CAN_RX_FIFO_LEN (2) #define COMMON_HAL_CAN_TX_FIFO_LEN (2) diff --git a/ports/atmel-samd/common-hal/_canio/Listener.c b/ports/atmel-samd/common-hal/canio/Listener.c similarity index 99% rename from ports/atmel-samd/common-hal/_canio/Listener.c rename to ports/atmel-samd/common-hal/canio/Listener.c index 0a5f629f88..bf8b3288dc 100644 --- a/ports/atmel-samd/common-hal/_canio/Listener.c +++ b/ports/atmel-samd/common-hal/canio/Listener.c @@ -30,8 +30,8 @@ #include "py/obj.h" #include "py/runtime.h" -#include "common-hal/_canio/__init__.h" -#include "common-hal/_canio/Listener.h" +#include "common-hal/canio/__init__.h" +#include "common-hal/canio/Listener.h" #include "shared-bindings/util.h" #include "supervisor/shared/tick.h" #include "component/can.h" diff --git a/ports/atmel-samd/common-hal/_canio/Listener.h b/ports/atmel-samd/common-hal/canio/Listener.h similarity index 96% rename from ports/atmel-samd/common-hal/_canio/Listener.h rename to ports/atmel-samd/common-hal/canio/Listener.h index cc6770e6e5..a51a9fc379 100644 --- a/ports/atmel-samd/common-hal/_canio/Listener.h +++ b/ports/atmel-samd/common-hal/canio/Listener.h @@ -26,8 +26,8 @@ #pragma once -#include "common-hal/_canio/CAN.h" -#include "shared-module/_canio/Match.h" +#include "common-hal/canio/CAN.h" +#include "shared-module/canio/Match.h" typedef struct { __IO CAN_RXF0C_Type RXFC; /**< \brief (R/W 32) Rx FIFO n Configuration */ diff --git a/ports/atmel-samd/common-hal/_canio/__init__.c b/ports/atmel-samd/common-hal/canio/__init__.c similarity index 100% rename from ports/atmel-samd/common-hal/_canio/__init__.c rename to ports/atmel-samd/common-hal/canio/__init__.c diff --git a/ports/atmel-samd/common-hal/_canio/__init__.h b/ports/atmel-samd/common-hal/canio/__init__.h similarity index 100% rename from ports/atmel-samd/common-hal/_canio/__init__.h rename to ports/atmel-samd/common-hal/canio/__init__.h diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 2614dc011f..98fa7a5f2c 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -143,7 +143,7 @@ ifeq ($(CIRCUITPY_CAMERA),1) SRC_PATTERNS += camera/% endif ifeq ($(CIRCUITPY_CANIO),1) -SRC_PATTERNS += _canio/% +SRC_PATTERNS += canio/% endif ifeq ($(CIRCUITPY_COUNTIO),1) SRC_PATTERNS += countio/% @@ -318,9 +318,9 @@ SRC_COMMON_HAL_ALL = \ busio/__init__.c \ camera/__init__.c \ camera/Camera.c \ - _canio/CAN.c \ - _canio/Listener.c \ - _canio/__init__.c \ + canio/CAN.c \ + canio/Listener.c \ + canio/__init__.c \ countio/Counter.c \ countio/__init__.c \ digitalio/DigitalInOut.c \ @@ -390,7 +390,7 @@ $(filter $(SRC_PATTERNS), \ _bleio/Address.c \ _bleio/Attribute.c \ _bleio/ScanEntry.c \ - _canio/Match.c \ + canio/Match.c \ _eve/__init__.c \ camera/ImageFormat.c \ digitalio/Direction.c \ @@ -409,8 +409,8 @@ SRC_SHARED_MODULE_ALL = \ _bleio/Attribute.c \ _bleio/ScanEntry.c \ _bleio/ScanResults.c \ - _canio/Match.c \ - _canio/Message.c \ + canio/Match.c \ + canio/Message.c \ _eve/__init__.c \ _pixelbuf/PixelBuf.c \ _pixelbuf/__init__.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index d1b12f3544..0583ae1c97 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -338,7 +338,7 @@ extern const struct _mp_obj_module_t camera_module; #if CIRCUITPY_CANIO extern const struct _mp_obj_module_t canio_module; -#define CANIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__canio), (mp_obj_t)&canio_module }, +#define CANIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_canio), (mp_obj_t)&canio_module }, #else #define CANIO_MODULE #endif diff --git a/shared-bindings/_canio/CAN.c b/shared-bindings/canio/CAN.c similarity index 98% rename from shared-bindings/_canio/CAN.c rename to shared-bindings/canio/CAN.c index 38aed85d33..482d11546d 100644 --- a/shared-bindings/_canio/CAN.c +++ b/shared-bindings/canio/CAN.c @@ -25,13 +25,13 @@ */ #include "py/enum.h" -#include "common-hal/_canio/CAN.h" -#include "common-hal/_canio/Listener.h" -#include "shared-bindings/_canio/__init__.h" -#include "shared-bindings/_canio/CAN.h" -#include "shared-bindings/_canio/Listener.h" -#include "shared-bindings/_canio/Match.h" -#include "shared-bindings/_canio/Message.h" +#include "common-hal/canio/CAN.h" +#include "common-hal/canio/Listener.h" +#include "shared-bindings/canio/__init__.h" +#include "shared-bindings/canio/CAN.h" +#include "shared-bindings/canio/Listener.h" +#include "shared-bindings/canio/Match.h" +#include "shared-bindings/canio/Message.h" #include "shared-bindings/microcontroller/Pin.h" #include "py/objproperty.h" diff --git a/shared-bindings/_canio/CAN.h b/shared-bindings/canio/CAN.h similarity index 98% rename from shared-bindings/_canio/CAN.h rename to shared-bindings/canio/CAN.h index c591c8e6ba..66c972c285 100644 --- a/shared-bindings/_canio/CAN.h +++ b/shared-bindings/canio/CAN.h @@ -28,7 +28,7 @@ #include "py/obj.h" #include "shared-bindings/microcontroller/Pin.h" -#include "shared-bindings/_canio/Message.h" +#include "shared-bindings/canio/Message.h" extern const mp_obj_type_t canio_can_type; diff --git a/shared-bindings/_canio/Listener.c b/shared-bindings/canio/Listener.c similarity index 98% rename from shared-bindings/_canio/Listener.c rename to shared-bindings/canio/Listener.c index 6186f3bbdb..0b50e58358 100644 --- a/shared-bindings/_canio/Listener.c +++ b/shared-bindings/canio/Listener.c @@ -24,9 +24,9 @@ * THE SOFTWARE. */ -#include "shared-bindings/_canio/Listener.h" -#include "shared-bindings/_canio/Message.h" -#include "common-hal/_canio/Listener.h" +#include "shared-bindings/canio/Listener.h" +#include "shared-bindings/canio/Message.h" +#include "common-hal/canio/Listener.h" #include "py/runtime.h" #include "py/objproperty.h" diff --git a/shared-bindings/_canio/Listener.h b/shared-bindings/canio/Listener.h similarity index 100% rename from shared-bindings/_canio/Listener.h rename to shared-bindings/canio/Listener.h diff --git a/shared-bindings/_canio/Match.c b/shared-bindings/canio/Match.c similarity index 99% rename from shared-bindings/_canio/Match.c rename to shared-bindings/canio/Match.c index 4ff35906b7..ff5d028fad 100644 --- a/shared-bindings/_canio/Match.c +++ b/shared-bindings/canio/Match.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "shared-bindings/_canio/Match.h" +#include "shared-bindings/canio/Match.h" #include "py/objproperty.h" #include "py/runtime.h" diff --git a/shared-bindings/_canio/Match.h b/shared-bindings/canio/Match.h similarity index 97% rename from shared-bindings/_canio/Match.h rename to shared-bindings/canio/Match.h index 5522c26367..88996d730f 100644 --- a/shared-bindings/_canio/Match.h +++ b/shared-bindings/canio/Match.h @@ -27,7 +27,7 @@ #pragma once #include "py/obj.h" -#include "shared-module/_canio/Match.h" +#include "shared-module/canio/Match.h" extern const mp_obj_type_t canio_match_type; diff --git a/shared-bindings/_canio/Message.c b/shared-bindings/canio/Message.c similarity index 99% rename from shared-bindings/_canio/Message.c rename to shared-bindings/canio/Message.c index 487ac9bfd1..11de6ded92 100644 --- a/shared-bindings/_canio/Message.c +++ b/shared-bindings/canio/Message.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "shared-bindings/_canio/Message.h" +#include "shared-bindings/canio/Message.h" #include "py/obj.h" #include "py/objproperty.h" diff --git a/shared-bindings/_canio/Message.h b/shared-bindings/canio/Message.h similarity index 98% rename from shared-bindings/_canio/Message.h rename to shared-bindings/canio/Message.h index ed739af0d4..34b632e847 100644 --- a/shared-bindings/_canio/Message.h +++ b/shared-bindings/canio/Message.h @@ -27,7 +27,7 @@ #pragma once #include "py/obj.h" -#include "shared-module/_canio/Message.h" +#include "shared-module/canio/Message.h" extern const mp_obj_type_t canio_message_type; diff --git a/shared-bindings/_canio/__init__.c b/shared-bindings/canio/__init__.c similarity index 95% rename from shared-bindings/_canio/__init__.c rename to shared-bindings/canio/__init__.c index 29e43c5c46..bc191913d7 100644 --- a/shared-bindings/_canio/__init__.c +++ b/shared-bindings/canio/__init__.c @@ -60,11 +60,11 @@ #include "py/obj.h" #include "py/enum.h" -#include "shared-bindings/_canio/__init__.h" -#include "shared-bindings/_canio/CAN.h" -#include "shared-bindings/_canio/Match.h" -#include "shared-bindings/_canio/Message.h" -#include "shared-bindings/_canio/Listener.h" +#include "shared-bindings/canio/__init__.h" +#include "shared-bindings/canio/CAN.h" +#include "shared-bindings/canio/Match.h" +#include "shared-bindings/canio/Message.h" +#include "shared-bindings/canio/Listener.h" MAKE_ENUM_VALUE(canio_bus_state_type, bus_state, ERROR_ACTIVE, BUS_STATE_ERROR_ACTIVE); MAKE_ENUM_VALUE(canio_bus_state_type, bus_state, ERROR_PASSIVE, BUS_STATE_ERROR_PASSIVE); diff --git a/shared-bindings/_canio/__init__.h b/shared-bindings/canio/__init__.h similarity index 100% rename from shared-bindings/_canio/__init__.h rename to shared-bindings/canio/__init__.h diff --git a/shared-module/_canio/Match.c b/shared-module/canio/Match.c similarity index 97% rename from shared-module/_canio/Match.c rename to shared-module/canio/Match.c index 3dcde18a78..9e33b956f6 100644 --- a/shared-module/_canio/Match.c +++ b/shared-module/canio/Match.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "shared-module/_canio/Match.h" +#include "shared-module/canio/Match.h" void common_hal_canio_match_construct(canio_match_obj_t *self, int address, int mask, bool extended) { self->address = address; diff --git a/shared-module/_canio/Match.h b/shared-module/canio/Match.h similarity index 100% rename from shared-module/_canio/Match.h rename to shared-module/canio/Match.h diff --git a/shared-module/_canio/Message.c b/shared-module/canio/Message.c similarity index 98% rename from shared-module/_canio/Message.c rename to shared-module/canio/Message.c index a02bd01276..b8ebb78596 100644 --- a/shared-module/_canio/Message.c +++ b/shared-module/canio/Message.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "shared-module/_canio/Message.h" +#include "shared-module/canio/Message.h" #include diff --git a/shared-module/_canio/Message.h b/shared-module/canio/Message.h similarity index 100% rename from shared-module/_canio/Message.h rename to shared-module/canio/Message.h From 85756fa0cdef144a45fe7a297c0b86e182837895 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 21 Sep 2020 16:45:51 -0500 Subject: [PATCH 0951/1293] make translate --- locale/circuitpython.pot | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 37212e2416..c9114dd5c5 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-16 17:07-0700\n" +"POT-Creation-Date: 2020-09-21 16:45-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -92,7 +92,11 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: shared-bindings/canio/Match.c +msgid "%q out of range" +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" msgstr "" @@ -280,6 +284,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "All RX FIFOs in use" +msgstr "" + #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "" @@ -316,6 +324,10 @@ msgstr "" msgid "Already advertising." msgstr "" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Already have all-matches listener" +msgstr "" + #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -752,7 +764,7 @@ msgstr "" msgid "Error in regex" msgstr "" -#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c #: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c @@ -845,6 +857,10 @@ msgstr "" msgid "File exists" msgstr "" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Filters too complex" +msgstr "" + #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" msgstr "" @@ -1127,6 +1143,10 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" +#: shared-bindings/canio/Message.c +msgid "Messages limited to 8 bytes" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" @@ -2310,6 +2330,10 @@ msgstr "" msgid "exceptions must derive from BaseException" msgstr "" +#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +msgid "expected '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "" @@ -3147,6 +3171,10 @@ msgstr "" msgid "source palette too large" msgstr "" +#: shared-bindings/canio/Message.c +msgid "specify size or data, but not both" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3261,7 +3289,7 @@ msgid "tuple/list has wrong length" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: shared-bindings/busio/UART.c +#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "" From a8147c125c6775ce844f912901ad750de39d11e7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 21 Sep 2020 16:47:28 -0500 Subject: [PATCH 0952/1293] Fix unintentional cross references --- shared-bindings/canio/Message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/canio/Message.c b/shared-bindings/canio/Message.c index 11de6ded92..23645d2e5f 100644 --- a/shared-bindings/canio/Message.c +++ b/shared-bindings/canio/Message.c @@ -42,7 +42,7 @@ //| //| In CAN, messages can have a size from 0 to 8 bytes. //| -//| For a non-rtr message, specify `data`. For an rtr-message, specify either `data` (a dummy buffer of the requested size) or `size`. +//| For a non-rtr message, specify ``data``. For an rtr-message, specify either ``data`` (a dummy buffer of the requested size) or ``size``. //| """ //| ... //| From 10245c0ff8d5847dac5885a7e40838ccc0fe8154 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 21 Sep 2020 17:04:30 -0500 Subject: [PATCH 0953/1293] canio: a few more stray _canios --- shared-bindings/canio/Listener.c | 4 ++-- shared-bindings/canio/__init__.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/shared-bindings/canio/Listener.c b/shared-bindings/canio/Listener.c index 0b50e58358..137c9e590a 100644 --- a/shared-bindings/canio/Listener.c +++ b/shared-bindings/canio/Listener.c @@ -34,8 +34,8 @@ //| class Listener: //| """Listens for CAN message //| -//| _canio.Listener is not constructed directly, but instead by calling the -//| Listen method of a _canio.CAN object.""" +//| canio.Listener is not constructed directly, but instead by calling the +//| Listen method of a canio.CAN object.""" //| //| def read(self) -> Optional[Message]: diff --git a/shared-bindings/canio/__init__.c b/shared-bindings/canio/__init__.c index bc191913d7..b0b982c950 100644 --- a/shared-bindings/canio/__init__.c +++ b/shared-bindings/canio/__init__.c @@ -26,7 +26,7 @@ //| """CAN bus access //| -//| The `_canio` module contains low level classes to support the CAN bus +//| The `canio` module contains low level classes to support the CAN bus //| protocol. //| //| CAN and Listener classes change hardware state and should be deinitialized when they @@ -36,11 +36,11 @@ //| //| For example:: //| -//| import _canio +//| import canio //| from board import * //| -//| can = _canio.CAN(board.CAN_RX, board.CAN_TX, baudrate=1000000) -//| message = _canio.Message(id=0x0408, data="adafruit" +//| can = canio.CAN(board.CAN_RX, board.CAN_TX, baudrate=1000000) +//| message = canio.Message(id=0x0408, data="adafruit" //| can.write(message)) //| can.deinit() //| @@ -103,9 +103,9 @@ MAKE_ENUM_MAP(canio_bus_state) { }; STATIC MP_DEFINE_CONST_DICT(canio_bus_state_locals_dict, canio_bus_state_locals_table); -MAKE_PRINTER(_canio, canio_bus_state); +MAKE_PRINTER(canio, canio_bus_state); -MAKE_ENUM_TYPE(_canio, BusState, canio_bus_state); +MAKE_ENUM_TYPE(canio, BusState, canio_bus_state); STATIC const mp_rom_map_elem_t canio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_BusState), MP_ROM_PTR(&canio_bus_state_type) }, From f21dc253e094854670b829f6258aac3722eefc26 Mon Sep 17 00:00:00 2001 From: Mark Roberts Date: Mon, 21 Sep 2020 18:42:16 -0400 Subject: [PATCH 0954/1293] Initial commit bool column_and_page_addressing --- shared-bindings/displayio/Display.c | 5 ++++- shared-bindings/displayio/Display.h | 3 ++- shared-module/displayio/Display.c | 4 +++- shared-module/displayio/Display.h | 2 ++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index f36aeed18c..634156f561 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -105,6 +105,7 @@ //| :param bool auto_brightness: If True, brightness is controlled via an ambient light sensor or other mechanism. //| :param bool single_byte_bounds: Display column and row commands use single bytes //| :param bool data_as_commands: Treat all init and boundary data as SPI commands. Certain displays require this. +//| :param bool column_and_page_addressing: Special quirk for SH1107, use upper/lower column set and page set //| :param bool auto_refresh: Automatically refresh the screen //| :param int native_frames_per_second: Number of display refreshes per second that occur with the given init_sequence. //| :param bool backlight_on_high: If True, pulling the backlight pin high turns the backlight on.""" @@ -139,6 +140,7 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a { MP_QSTR_auto_refresh, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, { MP_QSTR_native_frames_per_second, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 60} }, { MP_QSTR_backlight_on_high, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, + { MP_QSTR_column_and_page_addressing, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); @@ -180,7 +182,8 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a args[ARG_data_as_commands].u_bool, args[ARG_auto_refresh].u_bool, args[ARG_native_frames_per_second].u_int, - args[ARG_backlight_on_high].u_bool + args[ARG_backlight_on_high].u_bool, + args[ARG_column_and_page_addressing].u_bool ); return self; diff --git a/shared-bindings/displayio/Display.h b/shared-bindings/displayio/Display.h index e69c5b6b52..d6274a2b24 100644 --- a/shared-bindings/displayio/Display.h +++ b/shared-bindings/displayio/Display.h @@ -45,7 +45,8 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, uint8_t set_column_command, uint8_t set_row_command, uint8_t write_ram_command, uint8_t set_vertical_scroll, uint8_t* init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t* backlight_pin, uint16_t brightness_command, mp_float_t brightness, bool auto_brightness, - bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, bool backlight_on_high); + bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, + bool backlight_on_high, bool column_and_page_addressing); bool common_hal_displayio_display_show(displayio_display_obj_t* self, displayio_group_t* root_group); diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 021159c0d9..d3e7ee175c 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -48,7 +48,8 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, uint8_t set_row_command, uint8_t write_ram_command, uint8_t set_vertical_scroll, uint8_t* init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t* backlight_pin, uint16_t brightness_command, mp_float_t brightness, bool auto_brightness, - bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, bool backlight_on_high) { + bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, + bool backlight_on_high), bool column_and_page_addressing { // Turn off auto-refresh as we init. self->auto_refresh = false; uint16_t ram_width = 0x100; @@ -68,6 +69,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, self->first_manual_refresh = !auto_refresh; self->data_as_commands = data_as_commands; self->backlight_on_high = backlight_on_high; + self->column_and_page_addressing = column_and_page_addressing; self->native_frames_per_second = native_frames_per_second; self->native_ms_per_frame = 1000 / native_frames_per_second; diff --git a/shared-module/displayio/Display.h b/shared-module/displayio/Display.h index bdb861aa09..86c2a93604 100644 --- a/shared-module/displayio/Display.h +++ b/shared-module/displayio/Display.h @@ -60,6 +60,8 @@ typedef struct { bool auto_brightness; bool updating_backlight; bool backlight_on_high; + // new quirk for sh1107 + bool column_and_page_addressing; } displayio_display_obj_t; void displayio_display_background(displayio_display_obj_t* self); From 08189edf247244c616b0bd4c58fdb678b6c53d0e Mon Sep 17 00:00:00 2001 From: Mark Roberts Date: Mon, 21 Sep 2020 21:07:42 -0400 Subject: [PATCH 0955/1293] Quirk coded up for ...set_region_to_update --- shared-module/displayio/Display.c | 2 +- shared-module/displayio/display_core.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index d3e7ee175c..b0806af291 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -49,7 +49,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, uint8_t* init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t* backlight_pin, uint16_t brightness_command, mp_float_t brightness, bool auto_brightness, bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, - bool backlight_on_high), bool column_and_page_addressing { + bool backlight_on_high, bool column_and_page_addressing) { // Turn off auto-refresh as we init. self->auto_refresh = false; uint16_t ram_width = 0x100; diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index 43f2d19375..f046ab9e48 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -253,8 +253,16 @@ void displayio_display_core_set_region_to_update(displayio_display_core_t* self, data[data_length++] = x2 >> 8; data[data_length++] = x2 & 0xff; } + // Quirk for SH1107 "column_and_page_addressing" + // Column lower command = 0x00, Column upper command = 0x10 + if (column_and_page_addressing) { + data[0] = 0x00 | (x1 & 0x0F); + data[1] = 0x10 | (x1 >> 4); + data_length = 2; + } self->send(self->bus, data_type, chip_select, data, data_length); displayio_display_core_end_transaction(self); + if (set_current_column_command != NO_COMMAND) { uint8_t command = set_current_column_command; displayio_display_core_begin_transaction(self); @@ -283,6 +291,14 @@ void displayio_display_core_set_region_to_update(displayio_display_core_t* self, data[data_length++] = y2 >> 8; data[data_length++] = y2 & 0xff; } + // Quirk for SH1107 "column_and_page_addressing" + // Page address command = 0xB0 + if (column_and_page_addressing) { + data[0] = 0xB0 | (y1 & 0x07); + data_length = 1; + } + self->send(self->bus, data_type, chip_select, data, data_length); + self->send(self->bus, data_type, chip_select, data, data_length); displayio_display_core_end_transaction(self); From 5536e574dba604b86ef5f6e8c4d86bc408ef8ac5 Mon Sep 17 00:00:00 2001 From: Mark Roberts Date: Mon, 21 Sep 2020 22:08:16 -0400 Subject: [PATCH 0956/1293] Changes to compile cleanly --- .gitignore | 1 + shared-bindings/displayio/Display.c | 2 +- shared-module/displayio/Display.c | 4 +++- shared-module/displayio/EPaperDisplay.c | 4 +++- shared-module/displayio/display_core.c | 5 ++++- shared-module/displayio/display_core.h | 5 ++++- 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 03cd38f35d..a8814be45e 100644 --- a/.gitignore +++ b/.gitignore @@ -80,6 +80,7 @@ TAGS *.mo .vscode +.idea # Python Virtual Environments #################### diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 634156f561..2ae2373505 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -112,7 +112,7 @@ //| ... //| STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_display_bus, ARG_init_sequence, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_reverse_bytes_in_word, ARG_set_column_command, ARG_set_row_command, ARG_write_ram_command, ARG_set_vertical_scroll, ARG_backlight_pin, ARG_brightness_command, ARG_brightness, ARG_auto_brightness, ARG_single_byte_bounds, ARG_data_as_commands, ARG_auto_refresh, ARG_native_frames_per_second, ARG_backlight_on_high }; + enum { ARG_display_bus, ARG_init_sequence, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_reverse_bytes_in_word, ARG_set_column_command, ARG_set_row_command, ARG_write_ram_command, ARG_set_vertical_scroll, ARG_backlight_pin, ARG_brightness_command, ARG_brightness, ARG_auto_brightness, ARG_single_byte_bounds, ARG_data_as_commands, ARG_auto_refresh, ARG_native_frames_per_second, ARG_backlight_on_high, ARG_column_and_page_addressing }; static const mp_arg_t allowed_args[] = { { MP_QSTR_display_bus, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_init_sequence, MP_ARG_REQUIRED | MP_ARG_OBJ }, diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index b0806af291..b6979c0b2d 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -288,7 +288,9 @@ STATIC bool _refresh_area(displayio_display_obj_t* self, const displayio_area_t* } remaining_rows -= rows_per_buffer; - displayio_display_core_set_region_to_update(&self->core, self->set_column_command, self->set_row_command, NO_COMMAND, NO_COMMAND, self->data_as_commands, false, &subrectangle); + displayio_display_core_set_region_to_update(&self->core, self->set_column_command, + self->set_row_command, NO_COMMAND, NO_COMMAND, self->data_as_commands, false, + &subrectangle, self->column_and_page_addressing); uint16_t subrectangle_size_bytes; if (self->core.colorspace.depth >= 8) { diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 6d9e915b44..397ceb4fdc 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -239,7 +239,9 @@ bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, c uint16_t remaining_rows = displayio_area_height(&clipped); if (self->set_row_window_command != NO_COMMAND) { - displayio_display_core_set_region_to_update(&self->core, self->set_column_window_command, self->set_row_window_command, self->set_current_column_command, self->set_current_row_command, false, self->chip_select, &clipped); + displayio_display_core_set_region_to_update(&self->core, self->set_column_window_command, + self->set_row_window_command, self->set_current_column_command, self->set_current_row_command, + false, self->chip_select, &clipped, false); } uint8_t write_command = self->write_black_ram_command; diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index f046ab9e48..f01fda092b 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -208,7 +208,10 @@ void displayio_display_core_end_transaction(displayio_display_core_t* self) { self->end_transaction(self->bus); } -void displayio_display_core_set_region_to_update(displayio_display_core_t* self, uint8_t column_command, uint8_t row_command, uint16_t set_current_column_command, uint16_t set_current_row_command, bool data_as_commands, bool always_toggle_chip_select, displayio_area_t* area) { +void displayio_display_core_set_region_to_update(displayio_display_core_t* self, uint8_t column_command, + uint8_t row_command, uint16_t set_current_column_command, uint16_t set_current_row_command, + bool data_as_commands, bool always_toggle_chip_select, + displayio_area_t* area, bool column_and_page_addressing) { uint16_t x1 = area->x1; uint16_t x2 = area->x2; uint16_t y1 = area->y1; diff --git a/shared-module/displayio/display_core.h b/shared-module/displayio/display_core.h index e4fd62d4a5..1c880be443 100644 --- a/shared-module/displayio/display_core.h +++ b/shared-module/displayio/display_core.h @@ -74,7 +74,10 @@ bool displayio_display_core_bus_free(displayio_display_core_t *self); bool displayio_display_core_begin_transaction(displayio_display_core_t* self); void displayio_display_core_end_transaction(displayio_display_core_t* self); -void displayio_display_core_set_region_to_update(displayio_display_core_t* self, uint8_t column_command, uint8_t row_command, uint16_t set_current_column_command, uint16_t set_current_row_command, bool data_as_commands, bool always_toggle_chip_select, displayio_area_t* area); +void displayio_display_core_set_region_to_update(displayio_display_core_t* self, uint8_t column_command, + uint8_t row_command, uint16_t set_current_column_command, uint16_t set_current_row_command, + bool data_as_commands, bool always_toggle_chip_select, + displayio_area_t* area, bool column_and_page_addressing); void release_display_core(displayio_display_core_t* self); From 2fa269ccbc981c00eaf4f0bf6d7f5eaa52db4d08 Mon Sep 17 00:00:00 2001 From: "Ryan T. Hamilton" Date: Mon, 21 Sep 2020 20:56:03 -0700 Subject: [PATCH 0957/1293] Additional error handling --- ports/esp32s2/common-hal/wifi/Radio.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index 5bc69eab40..44f0fe2cf1 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -160,9 +160,15 @@ mp_obj_t common_hal_wifi_radio_get_ap_rssi(wifi_radio_obj_t *self) { } wifi_ap_record_t ap_info; - esp_wifi_sta_get_ap_info(&ap_info); - - return MP_OBJ_NEW_SMALL_INT(ap_info.rssi); + // From esp_wifi.h, the possible return values (typos theirs): + // ESP_OK: succeed + // ESP_ERR_WIFI_CONN: The station interface don't initialized + // ESP_ERR_WIFI_NOT_CONNECT: The station is in disconnect status + if (esp_wifi_sta_get_ap_info(&ap_info) != ESP_OK){ + return mp_const_none; + } else { + return mp_obj_new_int(ap_info.rssi); + } } mp_obj_t common_hal_wifi_radio_get_ipv4_gateway(wifi_radio_obj_t *self) { From a77966a73640a8699d116e0f484199338c4477e9 Mon Sep 17 00:00:00 2001 From: "Ryan T. Hamilton" Date: Mon, 21 Sep 2020 21:36:46 -0700 Subject: [PATCH 0958/1293] Try to reuse/share existing objects --- ports/esp32s2/common-hal/wifi/Radio.c | 24 +++++++++--------------- ports/esp32s2/common-hal/wifi/Radio.h | 2 ++ 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index 44f0fe2cf1..ab61778595 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -153,21 +153,18 @@ mp_obj_t common_hal_wifi_radio_get_ap_rssi(wifi_radio_obj_t *self) { } // Make sure the interface is in STA mode - wifi_mode_t if_mode; - esp_wifi_get_mode(&if_mode); - if (if_mode != WIFI_MODE_STA){ + if (self->sta_mode){ return mp_const_none; } - wifi_ap_record_t ap_info; // From esp_wifi.h, the possible return values (typos theirs): // ESP_OK: succeed // ESP_ERR_WIFI_CONN: The station interface don't initialized // ESP_ERR_WIFI_NOT_CONNECT: The station is in disconnect status - if (esp_wifi_sta_get_ap_info(&ap_info) != ESP_OK){ + if (esp_wifi_sta_get_ap_info(&self->ap_info) != ESP_OK){ return mp_const_none; } else { - return mp_obj_new_int(ap_info.rssi); + return mp_obj_new_int(self->ap_info.rssi); } } @@ -175,27 +172,24 @@ mp_obj_t common_hal_wifi_radio_get_ipv4_gateway(wifi_radio_obj_t *self) { if (!esp_netif_is_netif_up(self->netif)) { return mp_const_none; } - esp_netif_ip_info_t ip_info; - esp_netif_get_ip_info(self->netif, &ip_info); - return common_hal_ipaddress_new_ipv4address(ip_info.gw.addr); + esp_netif_get_ip_info(self->netif, &self->ip_info); + return common_hal_ipaddress_new_ipv4address(self->ip_info.gw.addr); } mp_obj_t common_hal_wifi_radio_get_ipv4_subnet(wifi_radio_obj_t *self) { if (!esp_netif_is_netif_up(self->netif)) { return mp_const_none; } - esp_netif_ip_info_t ip_info; - esp_netif_get_ip_info(self->netif, &ip_info); - return common_hal_ipaddress_new_ipv4address(ip_info.netmask.addr); + esp_netif_get_ip_info(self->netif, &self->ip_info); + return common_hal_ipaddress_new_ipv4address(self->ip_info.netmask.addr); } mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self) { if (!esp_netif_is_netif_up(self->netif)) { return mp_const_none; } - esp_netif_ip_info_t ip_info; - esp_netif_get_ip_info(self->netif, &ip_info); - return common_hal_ipaddress_new_ipv4address(ip_info.ip.addr); + esp_netif_get_ip_info(self->netif, &self->ip_info); + return common_hal_ipaddress_new_ipv4address(self->ip_info.ip.addr); } mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address, mp_float_t timeout) { diff --git a/ports/esp32s2/common-hal/wifi/Radio.h b/ports/esp32s2/common-hal/wifi/Radio.h index 205aef1761..ddcd9dc0d0 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.h +++ b/ports/esp32s2/common-hal/wifi/Radio.h @@ -46,6 +46,8 @@ typedef struct { StaticEventGroup_t event_group; EventGroupHandle_t event_group_handle; wifi_config_t sta_config; + wifi_ap_record_t ap_info; + esp_netif_ip_info_t ip_info; esp_netif_t *netif; bool started; bool ap_mode; From add230b4da7c32c1b6fee3a328ccb8eebede42c5 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Tue, 22 Sep 2020 11:37:12 +0530 Subject: [PATCH 0959/1293] Update port.c --- ports/esp32s2/supervisor/port.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index e52b7f3762..3de63278dc 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -43,6 +43,7 @@ #include "common-hal/wifi/__init__.h" #include "supervisor/memory.h" #include "supervisor/shared/tick.h" +#include "shared-bindings/rtc/__init__.h" #include "peripherals/rmt.h" #include "esp-idf/components/heap/include/esp_heap_caps.h" @@ -106,6 +107,11 @@ void reset_port(void) { spi_reset(); uart_reset(); #endif + +#if CIRCUITPY_RTC + rtc_reset(); +#endif + #if CIRCUITPY_WIFI wifi_reset(); #endif From 59580d0f2d744ac5f04600e371964aea9f79e833 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 22 Sep 2020 09:36:29 -0500 Subject: [PATCH 0960/1293] canio: Fix implementation bugs in atmel-sam --- ports/atmel-samd/common-hal/canio/CAN.c | 8 +++--- ports/atmel-samd/common-hal/canio/Listener.c | 12 ++++----- ports/atmel-samd/common-hal/canio/Listener.h | 2 +- ports/atmel-samd/common-hal/canio/__init__.h | 27 ++++++++++---------- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/ports/atmel-samd/common-hal/canio/CAN.c b/ports/atmel-samd/common-hal/canio/CAN.c index 01cc03dea5..4f28698fba 100644 --- a/ports/atmel-samd/common-hal/canio/CAN.c +++ b/ports/atmel-samd/common-hal/canio/CAN.c @@ -176,7 +176,7 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *tx, mc { CAN_TXBC_Type bc = { - .bit.TBSA = (uint32_t)self->state->tx_fifo, + .bit.TBSA = (uint32_t)self->state->tx_buffer, .bit.NDTB = COMMON_HAL_CANIO_TX_FIFO_SIZE, .bit.TFQM = 0, // Messages are transmitted in the order submitted }; @@ -192,7 +192,7 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *tx, mc { CAN_GFC_Type gfc = { - .bit.RRFE = 1, + .bit.RRFE = 0, .bit.ANFS = CAN_GFC_ANFS_REJECT_Val, .bit.ANFE = CAN_GFC_ANFE_REJECT_Val, }; @@ -333,13 +333,13 @@ void common_hal_canio_can_send(canio_can_obj_t *self, canio_message_obj_t *messa maybe_auto_restart(self); // We have just one dedicated TX buffer, use it! - canio_can_fifo_t *ent = &self->state->tx_fifo[0]; + canio_can_tx_buffer_t *ent = &self->state->tx_buffer[0]; ent->txb0.bit.ESI = false; ent->txb0.bit.XTD = message->extended; ent->txb0.bit.RTR = message->rtr; if (message->extended) { - ent->txb0.bit.ID = message->id << 18; + ent->txb0.bit.ID = message->id; } else { ent->txb0.bit.ID = message->id << 18; // short addresses are left-justified } diff --git a/ports/atmel-samd/common-hal/canio/Listener.c b/ports/atmel-samd/common-hal/canio/Listener.c index bf8b3288dc..02cfde9cc8 100644 --- a/ports/atmel-samd/common-hal/canio/Listener.c +++ b/ports/atmel-samd/common-hal/canio/Listener.c @@ -358,15 +358,15 @@ bool common_hal_canio_listener_readinto(canio_listener_obj_t *self, canio_messag } while (!common_hal_canio_listener_in_waiting(self)); } int index = self->hw->RXFS.bit.F0GI; - canio_can_fifo_t *hw_message = &self->fifo[index]; - message->extended = hw_message->rxb0.bit.XTD; + canio_can_rx_fifo_t *hw_message = &self->fifo[index]; + message->extended = hw_message->rxf0.bit.XTD; if (message->extended) { - message->id = hw_message->rxb0.bit.ID; + message->id = hw_message->rxf0.bit.ID; } else { - message->id = hw_message->rxb0.bit.ID >> 18; // short addresses are left-justified + message->id = hw_message->rxf0.bit.ID >> 18; // short addresses are left-justified } - message->rtr = hw_message->rxb0.bit.RTR; - message->size = hw_message->rxb1.bit.DLC; + message->rtr = hw_message->rxf0.bit.RTR; + message->size = hw_message->rxf1.bit.DLC; if (!message->rtr) { memcpy(message->data, hw_message->data, message->size); } diff --git a/ports/atmel-samd/common-hal/canio/Listener.h b/ports/atmel-samd/common-hal/canio/Listener.h index a51a9fc379..1b81d82aa6 100644 --- a/ports/atmel-samd/common-hal/canio/Listener.h +++ b/ports/atmel-samd/common-hal/canio/Listener.h @@ -38,7 +38,7 @@ typedef struct { typedef struct { mp_obj_base_t base; canio_can_obj_t *can; - canio_can_fifo_t *fifo; + canio_can_rx_fifo_t *fifo; canio_rxfifo_reg_t *hw; uint32_t timeout_ms; uint8_t fifo_idx; diff --git a/ports/atmel-samd/common-hal/canio/__init__.h b/ports/atmel-samd/common-hal/canio/__init__.h index cb491ab9e6..32adc5bf96 100644 --- a/ports/atmel-samd/common-hal/canio/__init__.h +++ b/ports/atmel-samd/common-hal/canio/__init__.h @@ -42,26 +42,25 @@ typedef struct canio_listener canio_listener_t; typedef struct canio_can canio_can_t; typedef struct { - union { - CAN_RXBE_0_Type rxb0; - CAN_TXBE_0_Type txb0; - CAN_RXF0E_0_Type rxf0; - }; - union { - CAN_RXBE_1_Type rxb1; - CAN_TXBE_1_Type txb1; - CAN_RXF0E_1_Type rxf1; - }; + CAN_TXBE_0_Type txb0; + CAN_TXBE_1_Type txb1; COMPILER_ALIGNED(4) uint8_t data[COMMON_HAL_CANIO_MAX_MESSAGE_LENGTH]; -} canio_can_fifo_t; +} canio_can_tx_buffer_t; + +typedef struct { + CAN_RXF0E_0_Type rxf0; + CAN_RXF0E_1_Type rxf1; + COMPILER_ALIGNED(4) + uint8_t data[COMMON_HAL_CANIO_MAX_MESSAGE_LENGTH]; +} canio_can_rx_fifo_t; typedef uint32_t canio_can_filter_t; typedef struct { - canio_can_fifo_t tx_fifo[COMMON_HAL_CANIO_TX_FIFO_SIZE]; - canio_can_fifo_t rx0_fifo[COMMON_HAL_CANIO_RX_FIFO_SIZE]; - canio_can_fifo_t rx1_fifo[COMMON_HAL_CANIO_RX_FIFO_SIZE]; + canio_can_tx_buffer_t tx_buffer[COMMON_HAL_CANIO_TX_FIFO_SIZE]; + canio_can_rx_fifo_t rx0_fifo[COMMON_HAL_CANIO_RX_FIFO_SIZE]; + canio_can_rx_fifo_t rx1_fifo[COMMON_HAL_CANIO_RX_FIFO_SIZE]; CanMramSidfe standard_rx_filter[COMMON_HAL_CANIO_RX_FILTER_SIZE]; CanMramXifde extended_rx_filter[COMMON_HAL_CANIO_RX_FILTER_SIZE]; } canio_can_state_t; From 9fd9cf1138817184399f381aacfc4aa1c4b16b76 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 22 Sep 2020 09:36:47 -0500 Subject: [PATCH 0961/1293] canio: fix bugs in shared-bindings --- shared-bindings/canio/CAN.c | 4 ++-- shared-bindings/canio/Listener.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/canio/CAN.c b/shared-bindings/canio/CAN.c index 482d11546d..ff27bb2048 100644 --- a/shared-bindings/canio/CAN.c +++ b/shared-bindings/canio/CAN.c @@ -64,7 +64,7 @@ //| ... //| STATIC mp_obj_t canio_can_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_rx, ARG_tx, ARG_baudrate, ARG_loopback, ARG_silent, ARG_auto_restart, NUM_ARGS }; + enum { ARG_tx, ARG_rx, ARG_baudrate, ARG_loopback, ARG_silent, ARG_auto_restart, NUM_ARGS }; static const mp_arg_t allowed_args[] = { { MP_QSTR_tx, MP_ARG_OBJ | MP_ARG_REQUIRED }, { MP_QSTR_rx, MP_ARG_OBJ | MP_ARG_REQUIRED }, @@ -380,7 +380,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_can_deinit_obj, canio_can_deinit); STATIC mp_obj_t canio_can_enter(mp_obj_t self_in) { canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_canio_can_check_for_deinit(self); - return mp_const_none; + return self_in; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_can_enter_obj, canio_can_enter); diff --git a/shared-bindings/canio/Listener.c b/shared-bindings/canio/Listener.c index 137c9e590a..bca880880d 100644 --- a/shared-bindings/canio/Listener.c +++ b/shared-bindings/canio/Listener.c @@ -133,7 +133,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_deinit_obj, canio_listener_deini STATIC mp_obj_t canio_listener_enter(mp_obj_t self_in) { canio_listener_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_canio_listener_check_for_deinit(self); - return mp_const_none; + return self_in; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_enter_obj, canio_listener_enter); From dbf8a9ad69fa93b7ad9b85df22208e08790e5795 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 22 Sep 2020 10:25:31 -0500 Subject: [PATCH 0962/1293] Changed delay calls to avoid conflicts with qspi_disable --- shared-module/displayio/FourWire.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-module/displayio/FourWire.c b/shared-module/displayio/FourWire.c index 7261162089..8c56d7ab60 100644 --- a/shared-module/displayio/FourWire.c +++ b/shared-module/displayio/FourWire.c @@ -87,9 +87,9 @@ bool common_hal_displayio_fourwire_reset(mp_obj_t obj) { return false; } common_hal_digitalio_digitalinout_set_value(&self->reset, false); - common_hal_time_delay_ms(1); + common_hal_mcu_delay_us(1000); common_hal_digitalio_digitalinout_set_value(&self->reset, true); - common_hal_time_delay_ms(1); + common_hal_mcu_delay_us(1000); return true; } From 82f37c92520248cef5086ac62a8483ae087e4531 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 22 Sep 2020 10:28:25 -0500 Subject: [PATCH 0963/1293] canio: fix read(), iterable bindings --- shared-bindings/canio/Listener.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/shared-bindings/canio/Listener.c b/shared-bindings/canio/Listener.c index bca880880d..1f4176f0c0 100644 --- a/shared-bindings/canio/Listener.c +++ b/shared-bindings/canio/Listener.c @@ -50,7 +50,7 @@ STATIC mp_obj_t canio_listener_read(mp_obj_t self_in) { common_hal_canio_listener_check_for_deinit(self); canio_message_obj_t *message = m_new_obj(canio_message_obj_t); - self->base.type = &canio_message_type; + message->base.type = &canio_message_type; if (common_hal_canio_listener_readinto(self, message)) { return message; @@ -92,13 +92,6 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_in_waiting_obj, canio_listener_i //| """Returns self, unless the object is deinitialized""" //| ... //| -STATIC mp_obj_t canio_listener_iter(mp_obj_t self_in) { - canio_listener_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_canio_listener_check_for_deinit(self); - return self; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_iter_obj, canio_listener_iter); - //| def __next__(self): //| """Reads a message, after waiting up to self.timeout seconds //| @@ -106,14 +99,13 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_iter_obj, canio_listener_iter); //| a Message is returned.""" //| ... //| -STATIC mp_obj_t canio_listener_next(mp_obj_t self_in) { +STATIC mp_obj_t canio_iternext(mp_obj_t self_in) { mp_obj_t result = canio_listener_read(self_in); if (result == mp_const_none) { return MP_OBJ_STOP_ITERATION; } return result; } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_next_obj, canio_listener_next); //| def deinit(self) -> None: //| """Deinitialize this object, freeing its hardware resources""" @@ -176,8 +168,6 @@ STATIC const mp_obj_property_t canio_listener_timeout_obj = { STATIC const mp_rom_map_elem_t canio_listener_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&canio_listener_enter_obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&canio_listener_exit_obj) }, - { MP_ROM_QSTR(MP_QSTR___iter__), MP_ROM_PTR(&canio_listener_iter_obj) }, - { MP_ROM_QSTR(MP_QSTR___next__), MP_ROM_PTR(&canio_listener_next_obj) }, { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&canio_listener_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR_in_waiting), MP_ROM_PTR(&canio_listener_in_waiting_obj) }, { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&canio_listener_read_obj) }, @@ -189,5 +179,7 @@ STATIC MP_DEFINE_CONST_DICT(canio_listener_locals_dict, canio_listener_locals_di const mp_obj_type_t canio_listener_type = { { &mp_type_type }, .name = MP_QSTR_Listener, + .getiter = mp_identity_getiter, + .iternext = canio_iternext, .locals_dict = (mp_obj_dict_t*)&canio_listener_locals_dict, }; From 5a176c2c67cff17415d1a713ed2ee3cbf94dd020 Mon Sep 17 00:00:00 2001 From: Mark Roberts Date: Tue, 22 Sep 2020 13:41:25 -0400 Subject: [PATCH 0964/1293] Removed redundant send of page setting --- shared-module/displayio/display_core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index f01fda092b..19e45e6b6f 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -302,7 +302,6 @@ void displayio_display_core_set_region_to_update(displayio_display_core_t* self, } self->send(self->bus, data_type, chip_select, data, data_length); - self->send(self->bus, data_type, chip_select, data, data_length); displayio_display_core_end_transaction(self); if (set_current_row_command != NO_COMMAND) { From c2d6405feabcae0de6fe3f0838d885ab9ca68a7e Mon Sep 17 00:00:00 2001 From: Szymon Jakubiak Date: Tue, 22 Sep 2020 07:40:34 +0000 Subject: [PATCH 0965/1293] Translated using Weblate (Polish) Currently translated at 73.3% (587 of 800 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pl/ --- locale/pl.po | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/locale/pl.po b/locale/pl.po index 2528b25e6f..857d09b9c2 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-16 17:07-0700\n" -"PO-Revision-Date: 2020-09-17 17:58+0000\n" -"Last-Translator: Maciej Stankiewicz \n" +"PO-Revision-Date: 2020-09-22 13:32+0000\n" +"Last-Translator: Szymon Jakubiak \n" "Language-Team: pl\n" "Language: pl\n" "MIME-Version: 1.0\n" @@ -32,6 +32,9 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"Zgłoś problem z zawartością dysku CIRCUITPY pod adresem\n" +"https://github.com/adafruit/circuitpython/issues\n" #: py/obj.c msgid " File \"%q\"" @@ -57,7 +60,7 @@ msgstr "" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" -msgstr "" +msgstr "%q niepowodzenie: %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" From cabd7539d3c7abab7f1ebc34c82771e92592e5e7 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 22 Sep 2020 21:40:01 +0200 Subject: [PATCH 0966/1293] 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 | 36 ++++++++++++++++++++++++++++++++---- locale/cs.po | 36 ++++++++++++++++++++++++++++++++---- locale/de_DE.po | 36 ++++++++++++++++++++++++++++++++---- locale/el.po | 36 ++++++++++++++++++++++++++++++++---- locale/es.po | 36 ++++++++++++++++++++++++++++++++---- locale/fil.po | 36 ++++++++++++++++++++++++++++++++---- locale/fr.po | 36 ++++++++++++++++++++++++++++++++---- locale/hi.po | 36 ++++++++++++++++++++++++++++++++---- locale/it_IT.po | 36 ++++++++++++++++++++++++++++++++---- locale/ja.po | 36 ++++++++++++++++++++++++++++++++---- locale/ko.po | 36 ++++++++++++++++++++++++++++++++---- locale/nl.po | 36 ++++++++++++++++++++++++++++++++---- locale/pl.po | 36 ++++++++++++++++++++++++++++++++---- locale/pt_BR.po | 36 ++++++++++++++++++++++++++++++++---- locale/sv.po | 36 ++++++++++++++++++++++++++++++++---- locale/zh_Latn_pinyin.po | 36 ++++++++++++++++++++++++++++++++---- 16 files changed, 512 insertions(+), 64 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index a13d97f9ec..bce444da2e 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-16 17:07-0700\n" +"POT-Creation-Date: 2020-09-21 16:45-0500\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -96,7 +96,11 @@ msgstr "%q harus >= 1" msgid "%q must be a tuple of length 2" msgstr "%q harus berupa tuple dengan panjang 2" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: shared-bindings/canio/Match.c +msgid "%q out of range" +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" msgstr "pin %q tidak valid" @@ -284,6 +288,10 @@ msgstr "Jenis alamat di luar batas" msgid "All I2C peripherals are in use" msgstr "Semua perangkat I2C sedang digunakan" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "All RX FIFOs in use" +msgstr "" + #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Semua perangkat SPI sedang digunakan" @@ -320,6 +328,10 @@ msgstr "Semua timer sedang digunakan" msgid "Already advertising." msgstr "Sudah disebarkan." +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Already have all-matches listener" +msgstr "" + #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -770,7 +782,7 @@ msgstr "Channel EXTINT sedang digunakan" msgid "Error in regex" msgstr "Error pada regex" -#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c #: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c @@ -863,6 +875,10 @@ msgstr "Gagal menulis flash internal." msgid "File exists" msgstr "File sudah ada" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Filters too complex" +msgstr "" + #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" msgstr "" @@ -1148,6 +1164,10 @@ msgstr "Pin MOSI gagal inisialisasi." msgid "Maximum x value when mirrored is %d" msgstr "Nilai x maksimum ketika dicerminkan adalah %d" +#: shared-bindings/canio/Message.c +msgid "Messages limited to 8 bytes" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "Lompatan NLR MicroPython gagal. Kemungkinan kerusakan memori." @@ -2343,6 +2363,10 @@ msgstr "error = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "" +#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +msgid "expected '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "" @@ -3181,6 +3205,10 @@ msgstr "" msgid "source palette too large" msgstr "" +#: shared-bindings/canio/Message.c +msgid "specify size or data, but not both" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3296,7 +3324,7 @@ msgid "tuple/list has wrong length" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: shared-bindings/busio/UART.c +#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx dan rx keduanya tidak boleh kosong" diff --git a/locale/cs.po b/locale/cs.po index 8d0827b9a1..f96a054118 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-16 17:07-0700\n" +"POT-Creation-Date: 2020-09-21 16:45-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -96,7 +96,11 @@ msgstr " %q musí být > = 1" msgid "%q must be a tuple of length 2" msgstr " %q musí být n-tice délky 2" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: shared-bindings/canio/Match.c +msgid "%q out of range" +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" msgstr "" @@ -284,6 +288,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "All RX FIFOs in use" +msgstr "" + #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "" @@ -320,6 +328,10 @@ msgstr "" msgid "Already advertising." msgstr "" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Already have all-matches listener" +msgstr "" + #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -756,7 +768,7 @@ msgstr "" msgid "Error in regex" msgstr "" -#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c #: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c @@ -849,6 +861,10 @@ msgstr "" msgid "File exists" msgstr "" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Filters too complex" +msgstr "" + #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" msgstr "" @@ -1131,6 +1147,10 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" +#: shared-bindings/canio/Message.c +msgid "Messages limited to 8 bytes" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" @@ -2314,6 +2334,10 @@ msgstr "" msgid "exceptions must derive from BaseException" msgstr "" +#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +msgid "expected '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "" @@ -3151,6 +3175,10 @@ msgstr "" msgid "source palette too large" msgstr "" +#: shared-bindings/canio/Message.c +msgid "specify size or data, but not both" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3265,7 +3293,7 @@ msgid "tuple/list has wrong length" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: shared-bindings/busio/UART.c +#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index b1eefc98e8..81d24c818c 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-16 17:07-0700\n" +"POT-Creation-Date: 2020-09-21 16:45-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -95,7 +95,11 @@ msgstr "%q muss >= 1 sein" msgid "%q must be a tuple of length 2" msgstr "%q muss ein Tupel der Länge 2 sein" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: shared-bindings/canio/Match.c +msgid "%q out of range" +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" msgstr "" @@ -283,6 +287,10 @@ msgstr "Adresstyp außerhalb des zulässigen Bereichs" msgid "All I2C peripherals are in use" msgstr "Alle I2C-Peripheriegeräte sind in Benutzung" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "All RX FIFOs in use" +msgstr "" + #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Alle SPI-Peripheriegeräte sind in Benutzung" @@ -319,6 +327,10 @@ msgstr "Alle timer werden benutzt" msgid "Already advertising." msgstr "Bereits am anbieten (advertising)." +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Already have all-matches listener" +msgstr "" + #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -766,7 +778,7 @@ msgstr "EXTINT Kanal ist schon in Benutzung" msgid "Error in regex" msgstr "Fehler in regex" -#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c #: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c @@ -860,6 +872,10 @@ msgstr "Interner Flash konnte nicht geschrieben werden." msgid "File exists" msgstr "Datei existiert" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Filters too complex" +msgstr "" + #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" msgstr "" @@ -1148,6 +1164,10 @@ msgstr "MOSI pin Initialisierung fehlgeschlagen." msgid "Maximum x value when mirrored is %d" msgstr "Maximaler x-Wert beim Spiegeln ist %d" +#: shared-bindings/canio/Message.c +msgid "Messages limited to 8 bytes" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" @@ -2384,6 +2404,10 @@ msgstr "Fehler = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "Exceptions müssen von BaseException abgeleitet sein" +#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +msgid "expected '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "erwarte ':' nach format specifier" @@ -3234,6 +3258,10 @@ msgstr "" msgid "source palette too large" msgstr "" +#: shared-bindings/canio/Message.c +msgid "specify size or data, but not both" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start/end Indizes" @@ -3349,7 +3377,7 @@ msgid "tuple/list has wrong length" msgstr "tupel/list hat falsche Länge" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: shared-bindings/busio/UART.c +#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx und rx können nicht beide None sein" diff --git a/locale/el.po b/locale/el.po index acdb64d5a5..1f830deb42 100644 --- a/locale/el.po +++ b/locale/el.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-16 17:07-0700\n" +"POT-Creation-Date: 2020-09-21 16:45-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -91,7 +91,11 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: shared-bindings/canio/Match.c +msgid "%q out of range" +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" msgstr "" @@ -279,6 +283,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "All RX FIFOs in use" +msgstr "" + #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "" @@ -315,6 +323,10 @@ msgstr "" msgid "Already advertising." msgstr "" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Already have all-matches listener" +msgstr "" + #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -751,7 +763,7 @@ msgstr "" msgid "Error in regex" msgstr "" -#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c #: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c @@ -844,6 +856,10 @@ msgstr "" msgid "File exists" msgstr "" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Filters too complex" +msgstr "" + #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" msgstr "" @@ -1126,6 +1142,10 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" +#: shared-bindings/canio/Message.c +msgid "Messages limited to 8 bytes" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" @@ -2309,6 +2329,10 @@ msgstr "" msgid "exceptions must derive from BaseException" msgstr "" +#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +msgid "expected '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "" @@ -3146,6 +3170,10 @@ msgstr "" msgid "source palette too large" msgstr "" +#: shared-bindings/canio/Message.c +msgid "specify size or data, but not both" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3260,7 +3288,7 @@ msgid "tuple/list has wrong length" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: shared-bindings/busio/UART.c +#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/es.po b/locale/es.po index 990908b7c3..a1be03bfc1 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-16 17:07-0700\n" +"POT-Creation-Date: 2020-09-21 16:45-0500\n" "PO-Revision-Date: 2020-09-18 23:14+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -99,7 +99,11 @@ msgstr "%q debe ser >= 1" msgid "%q must be a tuple of length 2" msgstr "%q debe ser una tupla de longitud 2" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: shared-bindings/canio/Match.c +msgid "%q out of range" +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" msgstr "pin inválido %q" @@ -287,6 +291,10 @@ msgstr "Tipo de dirección fuera de rango" msgid "All I2C peripherals are in use" msgstr "Todos los periféricos I2C están siendo usados" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "All RX FIFOs in use" +msgstr "" + #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Todos los periféricos SPI están siendo usados" @@ -325,6 +333,10 @@ msgstr "Todos los timers en uso" msgid "Already advertising." msgstr "Ya se encuentra publicando." +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Already have all-matches listener" +msgstr "" + #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -771,7 +783,7 @@ msgstr "El canal EXTINT ya está siendo utilizado" msgid "Error in regex" msgstr "Error en regex" -#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c #: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c @@ -864,6 +876,10 @@ msgstr "Error al escribir al flash interno." msgid "File exists" msgstr "El archivo ya existe" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Filters too complex" +msgstr "" + #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" msgstr "Sin capacidades para el formato" @@ -1149,6 +1165,10 @@ msgstr "MOSI pin init fallido." msgid "Maximum x value when mirrored is %d" msgstr "Valor máximo de x cuando se refleja es %d" +#: shared-bindings/canio/Message.c +msgid "Messages limited to 8 bytes" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "MicroPython NLR jump falló. Probable corrupción de la memoria." @@ -2377,6 +2397,10 @@ msgstr "error = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "las excepciones deben derivar de BaseException" +#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +msgid "expected '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "se esperaba ':' después de un especificador de tipo format" @@ -3222,6 +3246,10 @@ msgstr "sosfilt requiere argumentos iterables" msgid "source palette too large" msgstr "paleta fuente muy larga" +#: shared-bindings/canio/Message.c +msgid "specify size or data, but not both" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "índices inicio/final" @@ -3337,7 +3365,7 @@ msgid "tuple/list has wrong length" msgstr "tupla/lista tiene una longitud incorrecta" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: shared-bindings/busio/UART.c +#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "Ambos tx y rx no pueden ser None" diff --git a/locale/fil.po b/locale/fil.po index 6ef8829981..a53dd4c6a0 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-16 17:07-0700\n" +"POT-Creation-Date: 2020-09-21 16:45-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -91,7 +91,11 @@ msgstr "aarehas na haba dapat ang buffer slices" msgid "%q must be a tuple of length 2" msgstr "" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: shared-bindings/canio/Match.c +msgid "%q out of range" +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" msgstr "" @@ -281,6 +285,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Lahat ng I2C peripherals ginagamit" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "All RX FIFOs in use" +msgstr "" + #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Lahat ng SPI peripherals ay ginagamit" @@ -318,6 +326,10 @@ msgstr "Lahat ng timer ginagamit" msgid "Already advertising." msgstr "" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Already have all-matches listener" +msgstr "" + #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -762,7 +774,7 @@ msgstr "Ginagamit na ang EXTINT channel" msgid "Error in regex" msgstr "May pagkakamali sa REGEX" -#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c #: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c @@ -857,6 +869,10 @@ msgstr "" msgid "File exists" msgstr "Mayroong file" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Filters too complex" +msgstr "" + #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" msgstr "" @@ -1141,6 +1157,10 @@ msgstr "Hindi ma-initialize ang MOSI pin." msgid "Maximum x value when mirrored is %d" msgstr "" +#: shared-bindings/canio/Message.c +msgid "Messages limited to 8 bytes" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" @@ -2353,6 +2373,10 @@ msgstr "" msgid "exceptions must derive from BaseException" msgstr "ang mga exceptions ay dapat makuha mula sa BaseException" +#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +msgid "expected '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "umaasa ng ':' pagkatapos ng format specifier" @@ -3199,6 +3223,10 @@ msgstr "" msgid "source palette too large" msgstr "" +#: shared-bindings/canio/Message.c +msgid "specify size or data, but not both" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start/end indeks" @@ -3315,7 +3343,7 @@ msgid "tuple/list has wrong length" msgstr "mali ang haba ng tuple/list" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: shared-bindings/busio/UART.c +#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx at rx hindi pwedeng parehas na None" diff --git a/locale/fr.po b/locale/fr.po index d4a68c3f48..31881c873b 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-16 17:07-0700\n" +"POT-Creation-Date: 2020-09-21 16:45-0500\n" "PO-Revision-Date: 2020-09-16 13:47+0000\n" "Last-Translator: Hugo Dahl \n" "Language: fr\n" @@ -100,7 +100,11 @@ msgstr "%q doit être >=1" msgid "%q must be a tuple of length 2" msgstr "%q doit être un tuple de longueur 2" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: shared-bindings/canio/Match.c +msgid "%q out of range" +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" msgstr "PIN %q invalide" @@ -288,6 +292,10 @@ msgstr "Type d'adresse hors plage" msgid "All I2C peripherals are in use" msgstr "Tous les périphériques I2C sont utilisés" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "All RX FIFOs in use" +msgstr "" + #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Tous les périphériques SPI sont utilisés" @@ -324,6 +332,10 @@ msgstr "Tous les timers sont utilisés" msgid "Already advertising." msgstr "S'annonce déjà." +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Already have all-matches listener" +msgstr "" + #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -775,7 +787,7 @@ msgstr "Canal EXTINT déjà utilisé" msgid "Error in regex" msgstr "Erreur dans l'expression régulière" -#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c #: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c @@ -869,6 +881,10 @@ msgstr "Échec de l'écriture du flash interne." msgid "File exists" msgstr "Le fichier existe" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Filters too complex" +msgstr "" + #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" msgstr "" @@ -1154,6 +1170,10 @@ msgstr "Echec de l'init. de la broche MOSI." msgid "Maximum x value when mirrored is %d" msgstr "La valeur max. de x est %d lors d'une opération miroir" +#: shared-bindings/canio/Message.c +msgid "Messages limited to 8 bytes" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "Le saut MicroPython NLR a échoué. Altération probable de la mémoire." @@ -2390,6 +2410,10 @@ msgstr "erreur = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "les exceptions doivent dériver de 'BaseException'" +#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +msgid "expected '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "':' attendu après la spécification de format" @@ -3242,6 +3266,10 @@ msgstr "" msgid "source palette too large" msgstr "" +#: shared-bindings/canio/Message.c +msgid "specify size or data, but not both" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "indices de début/fin" @@ -3357,7 +3385,7 @@ msgid "tuple/list has wrong length" msgstr "tuple/liste a une mauvaise longueur" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: shared-bindings/busio/UART.c +#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx et rx ne peuvent être 'None' tous les deux" diff --git a/locale/hi.po b/locale/hi.po index b2a4bccafe..c6fbe49fd5 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-16 17:07-0700\n" +"POT-Creation-Date: 2020-09-21 16:45-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -91,7 +91,11 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: shared-bindings/canio/Match.c +msgid "%q out of range" +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" msgstr "" @@ -279,6 +283,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "All RX FIFOs in use" +msgstr "" + #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "" @@ -315,6 +323,10 @@ msgstr "" msgid "Already advertising." msgstr "" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Already have all-matches listener" +msgstr "" + #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -751,7 +763,7 @@ msgstr "" msgid "Error in regex" msgstr "" -#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c #: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c @@ -844,6 +856,10 @@ msgstr "" msgid "File exists" msgstr "" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Filters too complex" +msgstr "" + #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" msgstr "" @@ -1126,6 +1142,10 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" +#: shared-bindings/canio/Message.c +msgid "Messages limited to 8 bytes" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" @@ -2309,6 +2329,10 @@ msgstr "" msgid "exceptions must derive from BaseException" msgstr "" +#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +msgid "expected '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "" @@ -3146,6 +3170,10 @@ msgstr "" msgid "source palette too large" msgstr "" +#: shared-bindings/canio/Message.c +msgid "specify size or data, but not both" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3260,7 +3288,7 @@ msgid "tuple/list has wrong length" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: shared-bindings/busio/UART.c +#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 146e4ced14..94c7f1f847 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-16 17:07-0700\n" +"POT-Creation-Date: 2020-09-21 16:45-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -91,7 +91,11 @@ msgstr "slice del buffer devono essere della stessa lunghezza" msgid "%q must be a tuple of length 2" msgstr "" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: shared-bindings/canio/Match.c +msgid "%q out of range" +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" msgstr "" @@ -280,6 +284,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Tutte le periferiche I2C sono in uso" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "All RX FIFOs in use" +msgstr "" + #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Tutte le periferiche SPI sono in uso" @@ -317,6 +325,10 @@ msgstr "Tutti i timer utilizzati" msgid "Already advertising." msgstr "" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Already have all-matches listener" +msgstr "" + #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -762,7 +774,7 @@ msgstr "Canale EXTINT già in uso" msgid "Error in regex" msgstr "Errore nella regex" -#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c #: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c @@ -857,6 +869,10 @@ msgstr "" msgid "File exists" msgstr "File esistente" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Filters too complex" +msgstr "" + #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" msgstr "" @@ -1144,6 +1160,10 @@ msgstr "inizializzazione del pin MOSI fallita." msgid "Maximum x value when mirrored is %d" msgstr "Valore massimo di x quando rispachiato è %d" +#: shared-bindings/canio/Message.c +msgid "Messages limited to 8 bytes" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" @@ -2354,6 +2374,10 @@ msgstr "errore = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "le eccezioni devono derivare da BaseException" +#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +msgid "expected '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "':' atteso dopo lo specificatore di formato" @@ -3206,6 +3230,10 @@ msgstr "" msgid "source palette too large" msgstr "" +#: shared-bindings/canio/Message.c +msgid "specify size or data, but not both" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3322,7 +3350,7 @@ msgid "tuple/list has wrong length" msgstr "tupla/lista ha la lunghezza sbagliata" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: shared-bindings/busio/UART.c +#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx e rx non possono essere entrambi None" diff --git a/locale/ja.po b/locale/ja.po index cd0ae7b50f..6bc29b069f 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-16 17:07-0700\n" +"POT-Creation-Date: 2020-09-21 16:45-0500\n" "PO-Revision-Date: 2020-09-01 18:44+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: none\n" @@ -98,7 +98,11 @@ msgstr "%qは1以上でなければなりません" msgid "%q must be a tuple of length 2" msgstr "%qは長さ2のタプルでなければなりません" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: shared-bindings/canio/Match.c +msgid "%q out of range" +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" msgstr "%q ピンは無効" @@ -287,6 +291,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "全てのI2C周辺機器が使用中" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "All RX FIFOs in use" +msgstr "" + #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "全てのSPI周辺機器が使用中" @@ -323,6 +331,10 @@ msgstr "全てのタイマーが使用中" msgid "Already advertising." msgstr "すでにアドバータイズ中" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Already have all-matches listener" +msgstr "" + #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -765,7 +777,7 @@ msgstr "EXTINTチャネルはすでに使用されています" msgid "Error in regex" msgstr "正規表現にエラーがあります" -#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c #: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c @@ -858,6 +870,10 @@ msgstr "内部フラッシュの書き込みに失敗" msgid "File exists" msgstr "ファイルが存在します" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Filters too complex" +msgstr "" + #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" msgstr "" @@ -1142,6 +1158,10 @@ msgstr "MOSIピンの初期化に失敗" msgid "Maximum x value when mirrored is %d" msgstr "" +#: shared-bindings/canio/Message.c +msgid "Messages limited to 8 bytes" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "MicroPythonのNLRジャンプに失敗。メモリ破壊の可能性あり" @@ -2339,6 +2359,10 @@ msgstr "error = 0x1%08lX" msgid "exceptions must derive from BaseException" msgstr "例外はBaseExceptionから派生していなければなりません" +#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +msgid "expected '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "書式化指定子の後に':'が必要" @@ -3179,6 +3203,10 @@ msgstr "" msgid "source palette too large" msgstr "" +#: shared-bindings/canio/Message.c +msgid "specify size or data, but not both" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3293,7 +3321,7 @@ msgid "tuple/list has wrong length" msgstr "タプル/リストの長さが正しくありません" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: shared-bindings/busio/UART.c +#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "txとrxを両方ともNoneにできません" diff --git a/locale/ko.po b/locale/ko.po index 4072553a60..e2214b2bf5 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-16 17:07-0700\n" +"POT-Creation-Date: 2020-09-21 16:45-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -92,7 +92,11 @@ msgstr "%q 는 >=1이어야합니다" msgid "%q must be a tuple of length 2" msgstr "" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: shared-bindings/canio/Match.c +msgid "%q out of range" +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" msgstr "" @@ -280,6 +284,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "사용중인 모든 I2C주변 기기" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "All RX FIFOs in use" +msgstr "" + #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "사용중인 모든 SPI주변 기기" @@ -316,6 +324,10 @@ msgstr "모든 타이머가 사용 중입니다" msgid "Already advertising." msgstr "" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Already have all-matches listener" +msgstr "" + #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -754,7 +766,7 @@ msgstr "" msgid "Error in regex" msgstr "Regex에 오류가 있습니다." -#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c #: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c @@ -847,6 +859,10 @@ msgstr "" msgid "File exists" msgstr "" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Filters too complex" +msgstr "" + #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" msgstr "" @@ -1129,6 +1145,10 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" +#: shared-bindings/canio/Message.c +msgid "Messages limited to 8 bytes" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" @@ -2313,6 +2333,10 @@ msgstr "" msgid "exceptions must derive from BaseException" msgstr "" +#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +msgid "expected '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "':'이 예상되었습니다" @@ -3150,6 +3174,10 @@ msgstr "" msgid "source palette too large" msgstr "" +#: shared-bindings/canio/Message.c +msgid "specify size or data, but not both" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3264,7 +3292,7 @@ msgid "tuple/list has wrong length" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: shared-bindings/busio/UART.c +#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index d74a2e07d0..567734f19f 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-16 17:07-0700\n" +"POT-Creation-Date: 2020-09-21 16:45-0500\n" "PO-Revision-Date: 2020-09-09 16:05+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -96,7 +96,11 @@ msgstr "%q moet >= 1 zijn" msgid "%q must be a tuple of length 2" msgstr "%q moet een tuple van lengte 2 zijn" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: shared-bindings/canio/Match.c +msgid "%q out of range" +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" msgstr "%q pin onjuist" @@ -284,6 +288,10 @@ msgstr "Adres type buiten bereik" msgid "All I2C peripherals are in use" msgstr "Alle I2C peripherals zijn in gebruik" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "All RX FIFOs in use" +msgstr "" + #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Alle SPI peripherals zijn in gebruik" @@ -320,6 +328,10 @@ msgstr "Alle timers zijn in gebruik" msgid "Already advertising." msgstr "Advertising is al bezig." +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Already have all-matches listener" +msgstr "" + #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -764,7 +776,7 @@ msgstr "EXTINT kanaal al in gebruik" msgid "Error in regex" msgstr "Fout in regex" -#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c #: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c @@ -857,6 +869,10 @@ msgstr "Schrijven naar interne flash mislukt." msgid "File exists" msgstr "Bestand bestaat" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Filters too complex" +msgstr "" + #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" msgstr "" @@ -1143,6 +1159,10 @@ msgstr "MOSI pin init mislukt." msgid "Maximum x value when mirrored is %d" msgstr "Maximale x waarde indien gespiegeld is %d" +#: shared-bindings/canio/Message.c +msgid "Messages limited to 8 bytes" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "MicroPython NLR sprong mislukt. Waarschijnlijk geheugen corruptie." @@ -2365,6 +2385,10 @@ msgstr "fout = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "uitzonderingen moeten afleiden van BaseException" +#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +msgid "expected '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "verwachtte ':' na format specifier" @@ -3209,6 +3233,10 @@ msgstr "sosfilt vereist itereerbare argumenten" msgid "source palette too large" msgstr "" +#: shared-bindings/canio/Message.c +msgid "specify size or data, but not both" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start/stop indices" @@ -3323,7 +3351,7 @@ msgid "tuple/list has wrong length" msgstr "tuple of lijst heeft onjuiste lengte" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: shared-bindings/busio/UART.c +#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx en rx kunnen niet beiden None zijn" diff --git a/locale/pl.po b/locale/pl.po index 857d09b9c2..0538f61784 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-16 17:07-0700\n" +"POT-Creation-Date: 2020-09-21 16:45-0500\n" "PO-Revision-Date: 2020-09-22 13:32+0000\n" "Last-Translator: Szymon Jakubiak \n" "Language-Team: pl\n" @@ -98,7 +98,11 @@ msgstr "%q musi być >= 1" msgid "%q must be a tuple of length 2" msgstr "%q musi być krotką o długości 2" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: shared-bindings/canio/Match.c +msgid "%q out of range" +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" msgstr "" @@ -286,6 +290,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Wszystkie peryferia I2C w użyciu" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "All RX FIFOs in use" +msgstr "" + #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Wszystkie peryferia SPI w użyciu" @@ -322,6 +330,10 @@ msgstr "Wszystkie timery w użyciu" msgid "Already advertising." msgstr "" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Already have all-matches listener" +msgstr "" + #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -764,7 +776,7 @@ msgstr "Kanał EXTINT w użyciu" msgid "Error in regex" msgstr "Błąd w regex" -#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c #: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c @@ -857,6 +869,10 @@ msgstr "Nie udało się zapisać wewnętrznej pamięci flash." msgid "File exists" msgstr "Plik istnieje" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Filters too complex" +msgstr "" + #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" msgstr "" @@ -1141,6 +1157,10 @@ msgstr "Nie powiodło się ustawienie pinu MOSI." msgid "Maximum x value when mirrored is %d" msgstr "Największa wartość x przy odwróceniu to %d" +#: shared-bindings/canio/Message.c +msgid "Messages limited to 8 bytes" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" @@ -2332,6 +2352,10 @@ msgstr "błąd = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "wyjątki muszą dziedziczyć po BaseException" +#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +msgid "expected '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "oczekiwano ':' po specyfikacji formatu" @@ -3171,6 +3195,10 @@ msgstr "" msgid "source palette too large" msgstr "" +#: shared-bindings/canio/Message.c +msgid "specify size or data, but not both" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "początkowe/końcowe indeksy" @@ -3285,7 +3313,7 @@ msgid "tuple/list has wrong length" msgstr "krotka/lista ma złą długość" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: shared-bindings/busio/UART.c +#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx i rx nie mogą być oba None" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 2574786db8..e4d5a5afe9 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-16 17:07-0700\n" +"POT-Creation-Date: 2020-09-21 16:45-0500\n" "PO-Revision-Date: 2020-09-19 17:41+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -96,7 +96,11 @@ msgstr "%q deve ser >= 1" msgid "%q must be a tuple of length 2" msgstr "%q deve ser uma tupla de comprimento 2" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: shared-bindings/canio/Match.c +msgid "%q out of range" +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" msgstr "%q pino inválido" @@ -288,6 +292,10 @@ msgstr "O tipo do endereço está fora do alcance" msgid "All I2C peripherals are in use" msgstr "Todos os periféricos I2C estão em uso" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "All RX FIFOs in use" +msgstr "" + #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Todos os periféricos SPI estão em uso" @@ -324,6 +332,10 @@ msgstr "Todos os temporizadores em uso" msgid "Already advertising." msgstr "Já está anunciando." +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Already have all-matches listener" +msgstr "" + #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -773,7 +785,7 @@ msgstr "Canal EXTINT em uso" msgid "Error in regex" msgstr "Erro no regex" -#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c #: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c @@ -866,6 +878,10 @@ msgstr "Falha ao gravar o flash interno." msgid "File exists" msgstr "Arquivo já existe" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Filters too complex" +msgstr "" + #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" msgstr "O formato não é suportado" @@ -1152,6 +1168,10 @@ msgstr "Inicialização do pino MOSI falhou." msgid "Maximum x value when mirrored is %d" msgstr "O valor máximo de x quando espelhado é %d" +#: shared-bindings/canio/Message.c +msgid "Messages limited to 8 bytes" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "O salto do MicroPython NLR falhou. Possível corrupção de memória." @@ -2388,6 +2408,10 @@ msgstr "erro = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "as exceções devem derivar a partir do BaseException" +#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +msgid "expected '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "é esperado ':' após o especificador do formato" @@ -3237,6 +3261,10 @@ msgstr "o sosfilt requer que os argumentos sejam iteráveis" msgid "source palette too large" msgstr "a paleta de origem é muito grande" +#: shared-bindings/canio/Message.c +msgid "specify size or data, but not both" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "os índices de início/fim" @@ -3351,7 +3379,7 @@ msgid "tuple/list has wrong length" msgstr "a tupla/lista está com tamanho incorreto" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: shared-bindings/busio/UART.c +#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "TX e RX não podem ser ambos" diff --git a/locale/sv.po b/locale/sv.po index a88c91b532..f2b7cae3e2 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-16 17:07-0700\n" +"POT-Creation-Date: 2020-09-21 16:45-0500\n" "PO-Revision-Date: 2020-09-07 19:36+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -96,7 +96,11 @@ msgstr "%q måste vara >= 1" msgid "%q must be a tuple of length 2" msgstr "%q måste vara en tuple av längd 2" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: shared-bindings/canio/Match.c +msgid "%q out of range" +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" msgstr "Pinne %q ogiltig" @@ -284,6 +288,10 @@ msgstr "Adresstyp utanför intervallet" msgid "All I2C peripherals are in use" msgstr "All I2C-kringutrustning används" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "All RX FIFOs in use" +msgstr "" + #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "All SPI-kringutrustning används" @@ -320,6 +328,10 @@ msgstr "Alla timers används" msgid "Already advertising." msgstr "Annonserar redan." +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Already have all-matches listener" +msgstr "" + #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -764,7 +776,7 @@ msgstr "EXTINT-kanalen används redan" msgid "Error in regex" msgstr "Fel i regex" -#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c #: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c @@ -857,6 +869,10 @@ msgstr "Det gick inte att skriva till intern flash." msgid "File exists" msgstr "Filen finns redan" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Filters too complex" +msgstr "" + #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" msgstr "" @@ -1141,6 +1157,10 @@ msgstr "init för MOSI-pinne misslyckades." msgid "Maximum x value when mirrored is %d" msgstr "Maximum x-värde vid spegling är %d" +#: shared-bindings/canio/Message.c +msgid "Messages limited to 8 bytes" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "MicroPython NLR jump misslyckades. Troligen korrupt minne." @@ -2361,6 +2381,10 @@ msgstr "fel = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "exceptions måste ärvas från BaseException" +#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +msgid "expected '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "förväntade ':' efter formatspecifikation" @@ -3204,6 +3228,10 @@ msgstr "sosfilt kräver iterable argument" msgid "source palette too large" msgstr "källpalett för stor" +#: shared-bindings/canio/Message.c +msgid "specify size or data, but not both" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start-/slutindex" @@ -3318,7 +3346,7 @@ msgid "tuple/list has wrong length" msgstr "tupel/lista har fel längd" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: shared-bindings/busio/UART.c +#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx och rx kan inte båda vara None" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index de19d2b602..780f5be222 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-16 17:07-0700\n" +"POT-Creation-Date: 2020-09-21 16:45-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -97,7 +97,11 @@ msgstr "%q bìxū dàyú huò děngyú 1" msgid "%q must be a tuple of length 2" msgstr "%q bìxū shì chángdù wèi 2 de yuán zǔ" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: shared-bindings/canio/Match.c +msgid "%q out of range" +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" msgstr "%q yǐn jiǎo wúxiào" @@ -285,6 +289,10 @@ msgstr "Dìzhǐ lèixíng chāochū fànwéi" msgid "All I2C peripherals are in use" msgstr "Suǒyǒu I2C wàiwéi qì zhèngzài shǐyòng" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "All RX FIFOs in use" +msgstr "" + #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Suǒyǒu SPI wàiwéi qì zhèngzài shǐyòng" @@ -321,6 +329,10 @@ msgstr "Suǒyǒu jìshí qì shǐyòng" msgid "Already advertising." msgstr "Mùqián zhèngzài guǎngbò" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Already have all-matches listener" +msgstr "" + #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" @@ -761,7 +773,7 @@ msgstr "EXTINT píndào yǐjīng shǐyòng" msgid "Error in regex" msgstr "Zhèngzé biǎodá shì cuòwù" -#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c +#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c #: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c #: shared-bindings/terminalio/Terminal.c @@ -854,6 +866,10 @@ msgstr "Wúfǎ xiě rù nèibù shǎncún." msgid "File exists" msgstr "Wénjiàn cúnzài" +#: ports/atmel-samd/common-hal/canio/Listener.c +msgid "Filters too complex" +msgstr "" + #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" msgstr "" @@ -1138,6 +1154,10 @@ msgstr "MOSI yǐn jiǎo shūrù shībài." msgid "Maximum x value when mirrored is %d" msgstr "Jìngxiàng shí de zuìdà X zhí wèi%d" +#: shared-bindings/canio/Message.c +msgid "Messages limited to 8 bytes" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "MicroPython NLR tiào zhuǎn shībài. Kěnéng shì nèicún sǔnhuài." @@ -2351,6 +2371,10 @@ msgstr "cuòwù = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "lìwài bìxū láizì BaseException" +#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +msgid "expected '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "zài géshì shuōmíng fú zhīhòu yùqí ':'" @@ -3192,6 +3216,10 @@ msgstr "sosfilt xūyào diédài cānshù" msgid "source palette too large" msgstr "" +#: shared-bindings/canio/Message.c +msgid "specify size or data, but not both" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "kāishǐ/jiéshù zhǐshù" @@ -3306,7 +3334,7 @@ msgid "tuple/list has wrong length" msgstr "yuán zǔ/lièbiǎo chángdù cuòwù" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: shared-bindings/busio/UART.c +#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx hé rx bùnéng dōu shì wú" From 28e80e47d708fe346be0ae8d430f1a86d5d3049b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 22 Sep 2020 17:38:58 -0500 Subject: [PATCH 0967/1293] makeqstrdefs: don't make _and_, _or_ poisoned substrings for QSTRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New contributor @mdroberts1243 encountered an interesting problem in which the argument they had named "column_underscore_and_page_addressing" simply couldn't be used; I discovered that internally this had been transformed into "column_underscore∧page_addressing", because QSTR makes _ENTITY_ stand for the same thing as &ENTITY; does in HTML. This might be nice for some things, but we don't want it here! I was unable to find a sensible way to "escape" and prevent this entity coding, so instead I ripped out support for the _and_ and _or_ escapes. --- py/makeqstrdefs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/py/makeqstrdefs.py b/py/makeqstrdefs.py index cb27ced356..d3e90ba486 100644 --- a/py/makeqstrdefs.py +++ b/py/makeqstrdefs.py @@ -57,6 +57,10 @@ name2codepoint['caret'] = ord('^') name2codepoint['pipe'] = ord('|') name2codepoint['tilde'] = ord('~') +# These are just vexing! +del name2codepoint['and'] +del name2codepoint['or'] + def write_out(fname, output): if output: for m, r in [("/", "__"), ("\\", "__"), (":", "@"), ("..", "@@")]: From 5384479a619b0bfbf6d3a184d43108936558869e Mon Sep 17 00:00:00 2001 From: lady ada Date: Tue, 22 Sep 2020 23:28:23 -0400 Subject: [PATCH 0968/1293] fix pins for rev C --- ports/atmel-samd/boards/qtpy_m0/board.c | 6 +++--- ports/atmel-samd/boards/qtpy_m0/mpconfigboard.h | 8 ++++---- ports/atmel-samd/boards/qtpy_m0/pins.c | 16 ++++++++-------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ports/atmel-samd/boards/qtpy_m0/board.c b/ports/atmel-samd/boards/qtpy_m0/board.c index 2add1867c0..499be113f1 100644 --- a/ports/atmel-samd/boards/qtpy_m0/board.c +++ b/ports/atmel-samd/boards/qtpy_m0/board.c @@ -30,9 +30,9 @@ #include "hal/include/hal_gpio.h" void board_init(void) { - gpio_set_pin_function(PIN_PA18, GPIO_PIN_FUNCTION_OFF); - gpio_set_pin_direction(PIN_PA18, GPIO_DIRECTION_OUT); - gpio_set_pin_level(PIN_PA18, true); // Turn on neopixel by default + gpio_set_pin_function(PIN_PA15, GPIO_PIN_FUNCTION_OFF); + gpio_set_pin_direction(PIN_PA15, GPIO_DIRECTION_OUT); + gpio_set_pin_level(PIN_PA15, true); // Turn on neopixel by default } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/qtpy_m0/mpconfigboard.h b/ports/atmel-samd/boards/qtpy_m0/mpconfigboard.h index a88c1992de..713d2c03eb 100644 --- a/ports/atmel-samd/boards/qtpy_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/qtpy_m0/mpconfigboard.h @@ -1,7 +1,7 @@ #define MICROPY_HW_BOARD_NAME "Adafruit QT Py M0" #define MICROPY_HW_MCU_NAME "samd21e18" -#define MICROPY_HW_NEOPIXEL (&pin_PA19) +#define MICROPY_HW_NEOPIXEL (&pin_PA18) #define MICROPY_PORT_A (0) #define MICROPY_PORT_B (0) @@ -9,9 +9,9 @@ #define IGNORE_PIN_PA00 1 #define IGNORE_PIN_PA01 1 -#define IGNORE_PIN_PA09 1 #define IGNORE_PIN_PA12 1 #define IGNORE_PIN_PA13 1 +#define IGNORE_PIN_PA14 1 #define IGNORE_PIN_PA20 1 #define IGNORE_PIN_PA21 1 // USB is always used internally so skip the pin objects for it. @@ -48,8 +48,8 @@ #define DEFAULT_I2C_BUS_SDA (&pin_PA16) #define DEFAULT_SPI_BUS_SCK (&pin_PA11) -#define DEFAULT_SPI_BUS_MOSI (&pin_PA08) -#define DEFAULT_SPI_BUS_MISO (&pin_PA10) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA10) +#define DEFAULT_SPI_BUS_MISO (&pin_PA09) #define DEFAULT_UART_BUS_RX (&pin_PA07) #define DEFAULT_UART_BUS_TX (&pin_PA06) diff --git a/ports/atmel-samd/boards/qtpy_m0/pins.c b/ports/atmel-samd/boards/qtpy_m0/pins.c index 4ac10a7a66..636c48bffc 100644 --- a/ports/atmel-samd/boards/qtpy_m0/pins.c +++ b/ports/atmel-samd/boards/qtpy_m0/pins.c @@ -31,16 +31,16 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA11) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA11) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA19) }, - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, From 9db7625717ffee90eac0a88b8c1b0a4e68256ec1 Mon Sep 17 00:00:00 2001 From: lady ada Date: Wed, 23 Sep 2020 11:19:01 -0400 Subject: [PATCH 0969/1293] neopix is default on! --- ports/atmel-samd/boards/qtpy_m0/board.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/qtpy_m0/board.c b/ports/atmel-samd/boards/qtpy_m0/board.c index 499be113f1..1a65a561f7 100644 --- a/ports/atmel-samd/boards/qtpy_m0/board.c +++ b/ports/atmel-samd/boards/qtpy_m0/board.c @@ -33,6 +33,7 @@ void board_init(void) { gpio_set_pin_function(PIN_PA15, GPIO_PIN_FUNCTION_OFF); gpio_set_pin_direction(PIN_PA15, GPIO_DIRECTION_OUT); gpio_set_pin_level(PIN_PA15, true); // Turn on neopixel by default + never_reset_pin_number(PIN_PA15); } bool board_requests_safe_mode(void) { From 00517b26009d6b721145995e40725625b5152afd Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 23 Sep 2020 11:39:39 -0400 Subject: [PATCH 0970/1293] Move missing pin warning to shared-bindings --- ports/esp32s2/common-hal/busio/SPI.c | 9 --------- ports/stm/common-hal/busio/SPI.c | 9 --------- shared-bindings/busio/SPI.c | 4 ++++ 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index 6e4e344740..eaafa87b74 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -116,15 +116,6 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t * clock, const mcu_pin_obj_t * mosi, const mcu_pin_obj_t * miso) { - //SCK is not optional. MOSI and MISO are - if (!clock) { - mp_raise_ValueError(translate("Must provide SCK pin")); - } - - if (!miso && !mosi) { - mp_raise_ValueError(translate("Must provide MISO or MOSI pin")); - } - spi_bus_config_t bus_config; bus_config.mosi_io_num = mosi != NULL ? mosi->number : -1; bus_config.miso_io_num = miso != NULL ? miso->number : -1; diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index 913385e962..29fbdee569 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -127,15 +127,6 @@ STATIC int check_pins(busio_spi_obj_t *self, uint8_t mosi_len = MP_ARRAY_SIZE(mcu_spi_mosi_list); uint8_t miso_len = MP_ARRAY_SIZE(mcu_spi_miso_list); - //SCK is not optional. MOSI and MISO are - if (!sck) { - mp_raise_ValueError(translate("Must provide SCK pin")); - } - - if (!miso && !mosi) { - mp_raise_ValueError(translate("Must provide MISO or MOSI pin")); - } - // Loop over each possibility for SCK. Check whether MISO and/or MOSI can be used on the same peripheral for (uint i = 0; i < sck_len; i++) { const mcu_periph_obj_t *mcu_spi_sck = &mcu_spi_sck_list[i]; diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index aefe4f5a77..e47564c8c2 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -96,6 +96,10 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, con const mcu_pin_obj_t* mosi = validate_obj_is_free_pin_or_none(args[ARG_MOSI].u_obj); const mcu_pin_obj_t* miso = validate_obj_is_free_pin_or_none(args[ARG_MISO].u_obj); + if (!miso && !mosi) { + mp_raise_ValueError(translate("Must provide MISO or MOSI pin")); + } + common_hal_busio_spi_construct(self, clock, mosi, miso); return MP_OBJ_FROM_PTR(self); } From c1830d62122604840a05007b823b021280c9aee1 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 22 Sep 2020 20:25:34 +0000 Subject: [PATCH 0971/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (807 of 807 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e4d5a5afe9..0f5885ccf5 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: 2020-09-21 16:45-0500\n" -"PO-Revision-Date: 2020-09-19 17:41+0000\n" +"PO-Revision-Date: 2020-09-22 21:30+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -98,7 +98,7 @@ msgstr "%q deve ser uma tupla de comprimento 2" #: shared-bindings/canio/Match.c msgid "%q out of range" -msgstr "" +msgstr "%q fora do alcance" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" @@ -294,7 +294,7 @@ msgstr "Todos os periféricos I2C estão em uso" #: ports/atmel-samd/common-hal/canio/Listener.c msgid "All RX FIFOs in use" -msgstr "" +msgstr "Todos os FIFOs RX estão em uso" #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" @@ -334,7 +334,7 @@ msgstr "Já está anunciando." #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Already have all-matches listener" -msgstr "" +msgstr "Já há um ouvinte com todas as correspondências" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c @@ -880,7 +880,7 @@ msgstr "Arquivo já existe" #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Filters too complex" -msgstr "" +msgstr "Os filtros são muito complexos" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" @@ -1170,7 +1170,7 @@ msgstr "O valor máximo de x quando espelhado é %d" #: shared-bindings/canio/Message.c msgid "Messages limited to 8 bytes" -msgstr "" +msgstr "As mensagens estão limitadas a 8 bytes" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." @@ -2410,7 +2410,7 @@ msgstr "as exceções devem derivar a partir do BaseException" #: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c msgid "expected '%q' but got '%q'" -msgstr "" +msgstr "o retorno esperado era '%q', porém obteve '% q'" #: py/objstr.c msgid "expected ':' after format specifier" @@ -3263,7 +3263,7 @@ msgstr "a paleta de origem é muito grande" #: shared-bindings/canio/Message.c msgid "specify size or data, but not both" -msgstr "" +msgstr "defina o tamanho ou os dados, porém não ambos" #: py/objstr.c msgid "start/end indices" From 3a6f7986df617e4330fdb267542ccf2cd619dc38 Mon Sep 17 00:00:00 2001 From: Maciej Stankiewicz Date: Tue, 22 Sep 2020 23:50:11 +0000 Subject: [PATCH 0972/1293] Translated using Weblate (Polish) Currently translated at 73.7% (595 of 807 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pl/ --- locale/pl.po | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/locale/pl.po b/locale/pl.po index 0538f61784..5428885c1d 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-21 16:45-0500\n" -"PO-Revision-Date: 2020-09-22 13:32+0000\n" -"Last-Translator: Szymon Jakubiak \n" +"PO-Revision-Date: 2020-09-23 18:31+0000\n" +"Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" "Language: pl\n" "MIME-Version: 1.0\n" @@ -100,7 +100,7 @@ msgstr "%q musi być krotką o długości 2" #: shared-bindings/canio/Match.c msgid "%q out of range" -msgstr "" +msgstr "%q poza zakresem" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" @@ -438,7 +438,7 @@ msgstr "Jasność nie jest regulowana" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "" +msgstr "Bufor + przesunięcie za małe %d %d %d" #: shared-module/usb_hid/Device.c #, c-format @@ -480,7 +480,7 @@ msgstr "Bufor jest zbyt duży i nie można go przydzielić" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "Bufor za krótki o% d bajtów" +msgstr "Bufor za krótki o %d bajtów" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -790,7 +790,7 @@ msgstr "Oczekiwano charakterystyki" #: shared-bindings/_bleio/Adapter.c msgid "Expected a DigitalInOut" -msgstr "" +msgstr "Oczekiwano DigitalInOut" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" @@ -875,7 +875,7 @@ msgstr "" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" -msgstr "" +msgstr "Nie wspierany format" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format @@ -924,7 +924,7 @@ msgstr "Błąd inicjalizacji I2C" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" -msgstr "" +msgstr "I2SOut niedostępne" #: shared-bindings/aesio/aes.c #, c-format @@ -1159,7 +1159,7 @@ msgstr "Największa wartość x przy odwróceniu to %d" #: shared-bindings/canio/Message.c msgid "Messages limited to 8 bytes" -msgstr "" +msgstr "Wiadomości ograniczone do 8 bajtów" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." @@ -1176,7 +1176,7 @@ msgstr "Opóźnienie włączenia mikrofonu musi być w zakresie od 0.0 do 1.0" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" -msgstr "" +msgstr "Brak pinu MISO lub MOSI" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." @@ -1219,7 +1219,7 @@ msgstr "Brak pinu MISO" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" -msgstr "" +msgstr "Brak pinu MOSI" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c From 832869b257b50b12f9388c83021c53ece8761160 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 24 Sep 2020 16:56:07 -0500 Subject: [PATCH 0973/1293] make translate --- locale/circuitpython.pot | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index c9114dd5c5..2b395356ca 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-24 16:55-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1167,14 +1167,10 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" From 6bcbe51f7fcfaca6ee3ee40b4ce64fd791725e8f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 24 Sep 2020 16:57:10 -0500 Subject: [PATCH 0974/1293] supervisor: stub: make unimplemented safe_mode loop forever --- supervisor/stub/safe_mode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/supervisor/stub/safe_mode.c b/supervisor/stub/safe_mode.c index 1a792becd9..8072be2c65 100644 --- a/supervisor/stub/safe_mode.c +++ b/supervisor/stub/safe_mode.c @@ -32,6 +32,8 @@ safe_mode_t wait_for_safe_mode_reset(void) { void reset_into_safe_mode(safe_mode_t reason) { (void) reason; + for (;;) { + } } void print_safe_mode_message(safe_mode_t reason) { From eadb4de144005503dd648d16926527e5c40823f6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 24 Sep 2020 16:58:24 -0500 Subject: [PATCH 0975/1293] qtpy_m0_haxpress: add --- .../boards/qtpy_m0_haxpress/board.c | 44 ++++++++++++++ .../boards/qtpy_m0_haxpress/mpconfigboard.h | 60 +++++++++++++++++++ .../boards/qtpy_m0_haxpress/mpconfigboard.mk | 33 ++++++++++ .../atmel-samd/boards/qtpy_m0_haxpress/pins.c | 49 +++++++++++++++ 4 files changed, 186 insertions(+) create mode 100644 ports/atmel-samd/boards/qtpy_m0_haxpress/board.c create mode 100644 ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/qtpy_m0_haxpress/pins.c diff --git a/ports/atmel-samd/boards/qtpy_m0_haxpress/board.c b/ports/atmel-samd/boards/qtpy_m0_haxpress/board.c new file mode 100644 index 0000000000..1a65a561f7 --- /dev/null +++ b/ports/atmel-samd/boards/qtpy_m0_haxpress/board.c @@ -0,0 +1,44 @@ +/* + * 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 "boards/board.h" +#include "common-hal/microcontroller/Pin.h" +#include "supervisor/shared/board.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) { + gpio_set_pin_function(PIN_PA15, GPIO_PIN_FUNCTION_OFF); + gpio_set_pin_direction(PIN_PA15, GPIO_DIRECTION_OUT); + gpio_set_pin_level(PIN_PA15, true); // Turn on neopixel by default + never_reset_pin_number(PIN_PA15); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.h b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.h new file mode 100644 index 0000000000..4e557751fc --- /dev/null +++ b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.h @@ -0,0 +1,60 @@ +#define MICROPY_HW_BOARD_NAME "Adafruit QT Py M0 Haxpress" +#define MICROPY_HW_MCU_NAME "samd21e18" + +#define MICROPY_HW_NEOPIXEL (&pin_PA18) + +#define MICROPY_PORT_A (0) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define SPI_FLASH_MOSI_PIN &pin_PA22 +#define SPI_FLASH_MISO_PIN &pin_PA19 +#define SPI_FLASH_SCK_PIN &pin_PA23 +#define SPI_FLASH_CS_PIN &pin_PA08 + +#define IGNORE_PIN_PA00 1 +#define IGNORE_PIN_PA01 1 +#define IGNORE_PIN_PA12 1 +#define IGNORE_PIN_PA13 1 +#define IGNORE_PIN_PA14 1 +#define IGNORE_PIN_PA20 1 +#define IGNORE_PIN_PA21 1 +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 +#define IGNORE_PIN_PA27 1 +#define IGNORE_PIN_PA28 1 +#define IGNORE_PIN_PA30 1 +#define IGNORE_PIN_PA31 1 +#define IGNORE_PIN_PB01 1 +#define IGNORE_PIN_PB02 1 +#define IGNORE_PIN_PB03 1 +#define IGNORE_PIN_PB04 1 +#define IGNORE_PIN_PB05 1 +#define IGNORE_PIN_PB06 1 +#define IGNORE_PIN_PB07 1 +#define IGNORE_PIN_PB08 1 +#define IGNORE_PIN_PB09 1 +#define IGNORE_PIN_PB10 1 +#define IGNORE_PIN_PB11 1 +#define IGNORE_PIN_PB12 1 +#define IGNORE_PIN_PB13 1 +#define IGNORE_PIN_PB14 1 +#define IGNORE_PIN_PB15 1 +#define IGNORE_PIN_PB16 1 +#define IGNORE_PIN_PB17 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PB30 1 +#define IGNORE_PIN_PB31 1 +#define IGNORE_PIN_PB00 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA17) +#define DEFAULT_I2C_BUS_SDA (&pin_PA16) + +#define DEFAULT_SPI_BUS_SCK (&pin_PA11) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA10) +#define DEFAULT_SPI_BUS_MISO (&pin_PA09) + +#define DEFAULT_UART_BUS_RX (&pin_PA07) +#define DEFAULT_UART_BUS_TX (&pin_PA06) diff --git a/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk new file mode 100644 index 0000000000..6c7bb3fca2 --- /dev/null +++ b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk @@ -0,0 +1,33 @@ +USB_VID = 0x239A +USB_PID = 0x80CC +USB_PRODUCT = "QT Py M0 Haxpress" +USB_MANUFACTURER = "Adafruit Industries LLC" + +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 0 +LONGINT_IMPL = MPZ +SPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = GD25Q16C + +CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_COUNTIO = 0 +CIRCUITPY_RTC = 0 +CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_I2CPERIPHERAL = 0 + +SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), zh_Latn_pinyin) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +endif +ifeq ($(TRANSLATION), de_DE) +RELEASE_NEEDS_CLEAN_BUILD = 1 +CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 +endif diff --git a/ports/atmel-samd/boards/qtpy_m0_haxpress/pins.c b/ports/atmel-samd/boards/qtpy_m0_haxpress/pins.c new file mode 100644 index 0000000000..636c48bffc --- /dev/null +++ b/ports/atmel-samd/boards/qtpy_m0_haxpress/pins.c @@ -0,0 +1,49 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA03) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA05) }, + + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA16) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA17) }, + + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA06) }, + + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA07) }, + + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA11) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA09) }, + + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA10) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_PA15) }, + + { 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_global_dict_table); From 06a3d152664a97cc0a2f2faee86d2f5ea4e063e2 Mon Sep 17 00:00:00 2001 From: Mark Roberts Date: Thu, 24 Sep 2020 22:07:33 -0400 Subject: [PATCH 0976/1293] Mostly-working-version with comments --- shared-bindings/displayio/Display.c | 18 +++++++++---- shared-bindings/displayio/Display.h | 2 +- shared-module/displayio/Display.c | 36 ++++++++++++++++++++----- shared-module/displayio/Display.h | 2 +- shared-module/displayio/EPaperDisplay.c | 1 + shared-module/displayio/display_core.c | 33 ++++++++++++----------- shared-module/displayio/display_core.h | 2 +- 7 files changed, 64 insertions(+), 30 deletions(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 2ae2373505..a81736e469 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -105,14 +105,22 @@ //| :param bool auto_brightness: If True, brightness is controlled via an ambient light sensor or other mechanism. //| :param bool single_byte_bounds: Display column and row commands use single bytes //| :param bool data_as_commands: Treat all init and boundary data as SPI commands. Certain displays require this. -//| :param bool column_and_page_addressing: Special quirk for SH1107, use upper/lower column set and page set +//| :param bool SH1107_addressing: Special quirk for SH1107, use upper/lower column set and page set //| :param bool auto_refresh: Automatically refresh the screen //| :param int native_frames_per_second: Number of display refreshes per second that occur with the given init_sequence. //| :param bool backlight_on_high: If True, pulling the backlight pin high turns the backlight on.""" //| ... //| -STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_display_bus, ARG_init_sequence, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_reverse_bytes_in_word, ARG_set_column_command, ARG_set_row_command, ARG_write_ram_command, ARG_set_vertical_scroll, ARG_backlight_pin, ARG_brightness_command, ARG_brightness, ARG_auto_brightness, ARG_single_byte_bounds, ARG_data_as_commands, ARG_auto_refresh, ARG_native_frames_per_second, ARG_backlight_on_high, ARG_column_and_page_addressing }; +STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_args, + const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_display_bus, ARG_init_sequence, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, + ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, + ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_reverse_bytes_in_word, + ARG_set_column_command, ARG_set_row_command, ARG_write_ram_command, + ARG_set_vertical_scroll, ARG_backlight_pin, ARG_brightness_command, + ARG_brightness, ARG_auto_brightness, ARG_single_byte_bounds, ARG_data_as_commands, + ARG_auto_refresh, ARG_native_frames_per_second, ARG_backlight_on_high, + ARG_SH1107_addressing }; static const mp_arg_t allowed_args[] = { { MP_QSTR_display_bus, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_init_sequence, MP_ARG_REQUIRED | MP_ARG_OBJ }, @@ -140,7 +148,7 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a { MP_QSTR_auto_refresh, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, { MP_QSTR_native_frames_per_second, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 60} }, { MP_QSTR_backlight_on_high, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, - { MP_QSTR_column_and_page_addressing, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, + { MP_QSTR_SH1107_addressing, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} } }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); @@ -183,7 +191,7 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a args[ARG_auto_refresh].u_bool, args[ARG_native_frames_per_second].u_int, args[ARG_backlight_on_high].u_bool, - args[ARG_column_and_page_addressing].u_bool + args[ARG_SH1107_addressing].u_bool ); return self; diff --git a/shared-bindings/displayio/Display.h b/shared-bindings/displayio/Display.h index d6274a2b24..c1704eaada 100644 --- a/shared-bindings/displayio/Display.h +++ b/shared-bindings/displayio/Display.h @@ -46,7 +46,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, uint8_t* init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t* backlight_pin, uint16_t brightness_command, mp_float_t brightness, bool auto_brightness, bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, - bool backlight_on_high, bool column_and_page_addressing); + bool backlight_on_high, bool SH1107_addressing); bool common_hal_displayio_display_show(displayio_display_obj_t* self, displayio_group_t* root_group); diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index b6979c0b2d..afc4b7564c 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -49,7 +49,8 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, uint8_t* init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t* backlight_pin, uint16_t brightness_command, mp_float_t brightness, bool auto_brightness, bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, - bool backlight_on_high, bool column_and_page_addressing) { + bool backlight_on_high, bool SH1107_addressing) { + // Turn off auto-refresh as we init. self->auto_refresh = false; uint16_t ram_width = 0x100; @@ -69,7 +70,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, self->first_manual_refresh = !auto_refresh; self->data_as_commands = data_as_commands; self->backlight_on_high = backlight_on_high; - self->column_and_page_addressing = column_and_page_addressing; + self->SH1107_addressing = SH1107_addressing; self->native_frames_per_second = native_frames_per_second; self->native_ms_per_frame = 1000 / native_frames_per_second; @@ -242,11 +243,23 @@ STATIC bool _refresh_area(displayio_display_obj_t* self, const displayio_area_t* if (!displayio_display_core_clip_area(&self->core, area, &clipped)) { return true; } - uint16_t subrectangles = 1; uint16_t rows_per_buffer = displayio_area_height(&clipped); uint8_t pixels_per_word = (sizeof(uint32_t) * 8) / self->core.colorspace.depth; uint16_t pixels_per_buffer = displayio_area_size(&clipped); - if (displayio_area_size(&clipped) > buffer_size * pixels_per_word) { + + uint16_t subrectangles = 1; + // for SH1107 and other boundary constrained controllers + // write one single row at a time + if (self->SH1107_addressing) { + subrectangles = rows_per_buffer; // vertical (column mode) write each separately (height times) + } + + // Skip this recalculation of subrectangles if SH1107 (each subrectangle is a single row) + // [mdroberts1243] I am worried/confused about the pixels_in_byte_share_row calculation though + // since it makes sense to be on a byte boundary (actually a page boundary too) + // seems to work as is though. + if ((displayio_area_size(&clipped) > buffer_size * pixels_per_word) + && (!self->SH1107_addressing)) { rows_per_buffer = buffer_size * pixels_per_word / displayio_area_width(&clipped); if (rows_per_buffer == 0) { rows_per_buffer = 1; @@ -283,14 +296,23 @@ STATIC bool _refresh_area(displayio_display_obj_t* self, const displayio_area_t* .x2 = clipped.x2, .y2 = clipped.y1 + rows_per_buffer * (j + 1) }; - if (remaining_rows < rows_per_buffer) { + if (self->SH1107_addressing) { + // one row only for SH1107 in vertical (column) mode + subrectangle.y1 = clipped.y1 + j; + subrectangle.y2 = clipped.y1 + (j + 1); + }; + if ((remaining_rows < rows_per_buffer) && (!self->SH1107_addressing)) { subrectangle.y2 = subrectangle.y1 + remaining_rows; } - remaining_rows -= rows_per_buffer; + if (self->SH1107_addressing) { + remaining_rows -= 1; + } else { + remaining_rows -= rows_per_buffer; + } displayio_display_core_set_region_to_update(&self->core, self->set_column_command, self->set_row_command, NO_COMMAND, NO_COMMAND, self->data_as_commands, false, - &subrectangle, self->column_and_page_addressing); + &subrectangle, self->SH1107_addressing); uint16_t subrectangle_size_bytes; if (self->core.colorspace.depth >= 8) { diff --git a/shared-module/displayio/Display.h b/shared-module/displayio/Display.h index 86c2a93604..cc9cd54c40 100644 --- a/shared-module/displayio/Display.h +++ b/shared-module/displayio/Display.h @@ -61,7 +61,7 @@ typedef struct { bool updating_backlight; bool backlight_on_high; // new quirk for sh1107 - bool column_and_page_addressing; + bool SH1107_addressing; } displayio_display_obj_t; void displayio_display_background(displayio_display_obj_t* self); diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 397ceb4fdc..3391a56b4d 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -238,6 +238,7 @@ bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, c for (uint8_t pass = 0; pass < passes; pass++) { uint16_t remaining_rows = displayio_area_height(&clipped); + // added false parameter at end for SH1107_addressing quirk if (self->set_row_window_command != NO_COMMAND) { displayio_display_core_set_region_to_update(&self->core, self->set_column_window_command, self->set_row_window_command, self->set_current_column_command, self->set_current_row_command, diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index 19e45e6b6f..4e36e4dd1f 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -41,7 +41,7 @@ #include #define DISPLAYIO_CORE_DEBUG(...) (void)0 -// #define DISPLAYIO_CORE_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) +//#define DISPLAYIO_CORE_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) 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, @@ -57,7 +57,7 @@ void displayio_display_core_construct(displayio_display_core_t* self, self->colstart = colstart; self->rowstart = rowstart; self->last_refresh = 0; - + // (framebufferdisplay already validated its 'bus' is a buffer-protocol object) if (bus) { if (MP_OBJ_IS_TYPE(bus, &displayio_parallelbus_type)) { @@ -211,7 +211,7 @@ void displayio_display_core_end_transaction(displayio_display_core_t* self) { void displayio_display_core_set_region_to_update(displayio_display_core_t* self, uint8_t column_command, uint8_t row_command, uint16_t set_current_column_command, uint16_t set_current_row_command, bool data_as_commands, bool always_toggle_chip_select, - displayio_area_t* area, bool column_and_page_addressing) { + displayio_area_t* area, bool SH1107_addressing) { uint16_t x1 = area->x1; uint16_t x2 = area->x2; uint16_t y1 = area->y1; @@ -256,12 +256,13 @@ void displayio_display_core_set_region_to_update(displayio_display_core_t* self, data[data_length++] = x2 >> 8; data[data_length++] = x2 & 0xff; } - // Quirk for SH1107 "column_and_page_addressing" - // Column lower command = 0x00, Column upper command = 0x10 - if (column_and_page_addressing) { - data[0] = 0x00 | (x1 & 0x0F); - data[1] = 0x10 | (x1 >> 4); - data_length = 2; + // Quirk for SH1107 "SH1107_addressing" + // Note... column is y! page is x! + // Page address command = 0xB0 + if (SH1107_addressing) { + // set the page to our x value + data[0] = 0xB0 | (x1 & 0x07); + data_length = 1; } self->send(self->bus, data_type, chip_select, data, data_length); displayio_display_core_end_transaction(self); @@ -294,11 +295,13 @@ void displayio_display_core_set_region_to_update(displayio_display_core_t* self, data[data_length++] = y2 >> 8; data[data_length++] = y2 & 0xff; } - // Quirk for SH1107 "column_and_page_addressing" - // Page address command = 0xB0 - if (column_and_page_addressing) { - data[0] = 0xB0 | (y1 & 0x07); - data_length = 1; + // Quirk for SH1107 "SH1107_addressing" + // Note... column is y! page is x! + // Column lower command = 0x00, Column upper command = 0x10 + if (SH1107_addressing) { + data[0] = y1 & 0x0F; // 0x00 to 0x0F + data[1] = (y1 >> 4 & 0x0F) | 0x10; // 0x10 to 0x17 + data_length = 2; } self->send(self->bus, data_type, chip_select, data, data_length); @@ -319,7 +322,7 @@ void displayio_display_core_start_refresh(displayio_display_core_t* self) { void displayio_display_core_finish_refresh(displayio_display_core_t* self) { if (self->current_group != NULL) { - DISPLAYIO_CORE_DEBUG("displayiocore group_finish_refresh\n"); +// DISPLAYIO_CORE_DEBUG("displayiocore group_finish_refresh\n"); displayio_group_finish_refresh(self->current_group); } self->full_refresh = false; diff --git a/shared-module/displayio/display_core.h b/shared-module/displayio/display_core.h index 1c880be443..ad9998a2f8 100644 --- a/shared-module/displayio/display_core.h +++ b/shared-module/displayio/display_core.h @@ -77,7 +77,7 @@ void displayio_display_core_end_transaction(displayio_display_core_t* self); void displayio_display_core_set_region_to_update(displayio_display_core_t* self, uint8_t column_command, uint8_t row_command, uint16_t set_current_column_command, uint16_t set_current_row_command, bool data_as_commands, bool always_toggle_chip_select, - displayio_area_t* area, bool column_and_page_addressing); + displayio_area_t* area, bool SH1107_addressing); void release_display_core(displayio_display_core_t* self); From 19dbff67f2a4921ccbe06fdf29e229225e8aed2d Mon Sep 17 00:00:00 2001 From: Mark Roberts Date: Fri, 25 Sep 2020 00:26:39 -0400 Subject: [PATCH 0977/1293] Fixed page set mask to be four bits! --- 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 4e36e4dd1f..6e05b47571 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -261,7 +261,7 @@ void displayio_display_core_set_region_to_update(displayio_display_core_t* self, // Page address command = 0xB0 if (SH1107_addressing) { // set the page to our x value - data[0] = 0xB0 | (x1 & 0x07); + data[0] = 0xB0 | (x1 & 0x0F); data_length = 1; } self->send(self->bus, data_type, chip_select, data, data_length); From 33952023e89b96530bc2acaaf6a5f03da01d9a3c Mon Sep 17 00:00:00 2001 From: askpatricw <4002194+askpatrickw@users.noreply.github.com> Date: Fri, 25 Sep 2020 10:08:26 -0700 Subject: [PATCH 0978/1293] Print package if it exists for pin or module only if it does not --- shared-bindings/microcontroller/Pin.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index 1294b78f00..6ba02a0e7d 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -71,7 +71,11 @@ STATIC void mcu_pin_print(const mp_print_t *print, mp_obj_t self_in, mp_print_ki qstr name; get_pin_name(self, &package, &module, &name); - mp_printf(print, "%q.%q.%q", MP_QSTR_microcontroller, MP_QSTR_pin, name); + if (package){ + mp_printf(print, "%q.%q.%q", package, module, name); + } else { + mp_printf(print, "%q.%q", module , name); + } } const mp_obj_type_t mcu_pin_type = { From b9d68bc5a6b7b63f52da6c7034d379d6de51be7e Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 25 Sep 2020 11:07:22 -0700 Subject: [PATCH 0979/1293] Change I2C default to 100khz Greater that 100khz is technically out of the original spec. Background here: https://github.com/adafruit/Adafruit_CircuitPython_CLUE/issues/36 --- shared-bindings/busio/I2C.c | 4 ++-- shared-module/board/__init__.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 157e779fdc..8b456dbd35 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -39,7 +39,7 @@ //| class I2C: //| """Two wire serial protocol""" //| -//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int = 255) -> None: +//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 100000, timeout: int = 255) -> None: //| //| """I2C is a two-wire protocol for communicating between devices. At the //| physical level it consists of 2 wires: SCL and SDA, the clock and data @@ -70,7 +70,7 @@ STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, con static const mp_arg_t allowed_args[] = { { MP_QSTR_scl, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_sda, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_frequency, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 400000} }, + { MP_QSTR_frequency, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 100000} }, { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 255} }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index 7d99f2d4e3..fb4f731b88 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -61,7 +61,7 @@ mp_obj_t common_hal_board_create_i2c(void) { busio_i2c_obj_t *self = &i2c_obj; self->base.type = &busio_i2c_type; - common_hal_busio_i2c_construct(self, DEFAULT_I2C_BUS_SCL, DEFAULT_I2C_BUS_SDA, 400000, 0); + common_hal_busio_i2c_construct(self, DEFAULT_I2C_BUS_SCL, DEFAULT_I2C_BUS_SDA, 100000, 0); i2c_singleton = (mp_obj_t)self; return i2c_singleton; } From 73d08df9adc603dd678b0d62e38b553eab18ff71 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 25 Sep 2020 12:23:31 -0700 Subject: [PATCH 0980/1293] Update TinyUSB to get MIDI SysEx fix Fixes #3465 --- lib/tinyusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index e90cf7a676..8b2c822557 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit e90cf7a676eddcbd9c35d2d99a0a9cd14686e2ce +Subproject commit 8b2c82255750488232eae72f3d5dcbacfd6227f3 From b92154357145f4e7d976306490ef33b5d5fe9c92 Mon Sep 17 00:00:00 2001 From: Mark Roberts Date: Fri, 25 Sep 2020 21:27:29 -0400 Subject: [PATCH 0981/1293] Requested changes take 1 --- .../boards/hallowing_m0_express/board.c | 3 ++- .../boards/hallowing_m4_express/board.c | 3 ++- ports/atmel-samd/boards/monster_m4sk/board.c | 3 ++- ports/atmel-samd/boards/pewpew_m4/board.c | 3 ++- ports/atmel-samd/boards/pybadge/board.c | 3 ++- .../atmel-samd/boards/pybadge_airlift/board.c | 3 ++- ports/atmel-samd/boards/pygamer/board.c | 3 ++- .../atmel-samd/boards/pygamer_advance/board.c | 3 ++- ports/atmel-samd/boards/pyportal/board.c | 3 ++- .../atmel-samd/boards/pyportal_titano/board.c | 3 ++- .../boards/seeeduino_wio_terminal/board.c | 3 ++- .../nrf/boards/clue_nrf52840_express/board.c | 3 ++- ports/nrf/boards/hiibot_bluefi/board.c | 3 ++- .../makerdiary_nrf52840_m2_devkit/board.c | 3 ++- ports/nrf/boards/ohs2020_badge/board.c | 3 ++- ports/stm/boards/meowbit_v121/board.c | 3 ++- shared-module/displayio/Display.c | 25 ++++++------------- shared-module/displayio/display_core.c | 4 +-- 18 files changed, 41 insertions(+), 36 deletions(-) diff --git a/ports/atmel-samd/boards/hallowing_m0_express/board.c b/ports/atmel-samd/boards/hallowing_m0_express/board.c index 4717e6ceb9..14a2bdb816 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m0_express/board.c @@ -110,7 +110,8 @@ void board_init(void) { false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second - true); // backlight_on_high + true, // backlight_on_high + false); // not SH1107 } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/hallowing_m4_express/board.c b/ports/atmel-samd/boards/hallowing_m4_express/board.c index 7da1d8128c..61e797d652 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m4_express/board.c @@ -91,7 +91,8 @@ void board_init(void) { false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second - true); // backlight_on_high + true, // backlight_on_high + false); // not SH1107 } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/monster_m4sk/board.c b/ports/atmel-samd/boards/monster_m4sk/board.c index 4dd65f8c90..45fea9d529 100644 --- a/ports/atmel-samd/boards/monster_m4sk/board.c +++ b/ports/atmel-samd/boards/monster_m4sk/board.c @@ -92,7 +92,8 @@ void board_init(void) { false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second - true); // backlight_on_high + true, // backlight_on_high + false); // SH1107_addressing } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/pewpew_m4/board.c b/ports/atmel-samd/boards/pewpew_m4/board.c index 52a52b4b7d..d02e0dc01d 100644 --- a/ports/atmel-samd/boards/pewpew_m4/board.c +++ b/ports/atmel-samd/boards/pewpew_m4/board.c @@ -143,7 +143,8 @@ void board_init(void) { false, // data_as_commands false, // auto_refresh 20, // native_frames_per_second - true); // backlight_on_high + true, // backlight_on_high + false); // SH1107_addressing } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/pybadge/board.c b/ports/atmel-samd/boards/pybadge/board.c index 45298acc27..35f228c75a 100644 --- a/ports/atmel-samd/boards/pybadge/board.c +++ b/ports/atmel-samd/boards/pybadge/board.c @@ -114,7 +114,8 @@ void board_init(void) { false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second - true); // backlight_on_high + true, // backlight_on_high + false); // SH1107_addressing } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/pybadge_airlift/board.c b/ports/atmel-samd/boards/pybadge_airlift/board.c index 7495c7d48f..fe3e4a0171 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/board.c +++ b/ports/atmel-samd/boards/pybadge_airlift/board.c @@ -92,7 +92,8 @@ void board_init(void) { false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second - true); // backlight_on_high + true, // backlight_on_high + false); // SH1107_addressing } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/pygamer/board.c b/ports/atmel-samd/boards/pygamer/board.c index 2e83440ea6..b478b5947c 100644 --- a/ports/atmel-samd/boards/pygamer/board.c +++ b/ports/atmel-samd/boards/pygamer/board.c @@ -114,7 +114,8 @@ void board_init(void) { false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second - true); // backlight_on_high + true, // backlight_on_high + false); // SH1107_addressing } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/pygamer_advance/board.c b/ports/atmel-samd/boards/pygamer_advance/board.c index 330446b6ff..7dfe07c00d 100644 --- a/ports/atmel-samd/boards/pygamer_advance/board.c +++ b/ports/atmel-samd/boards/pygamer_advance/board.c @@ -92,7 +92,8 @@ void board_init(void) { false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second - true); // backlight_on_high + true, // backlight_on_high + false); // SH1107_addressing } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/pyportal/board.c b/ports/atmel-samd/boards/pyportal/board.c index d14b6b6a58..cd94f68875 100644 --- a/ports/atmel-samd/boards/pyportal/board.c +++ b/ports/atmel-samd/boards/pyportal/board.c @@ -100,7 +100,8 @@ void board_init(void) { false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second - true); // backlight_on_high + true, // backlight_on_high + false); // SH1107_addressing } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/pyportal_titano/board.c b/ports/atmel-samd/boards/pyportal_titano/board.c index 0ee2e68aa2..dc417f5d14 100644 --- a/ports/atmel-samd/boards/pyportal_titano/board.c +++ b/ports/atmel-samd/boards/pyportal_titano/board.c @@ -117,7 +117,8 @@ void board_init(void) { false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second - true); // backlight_on_high + true, // backlight_on_high + false); // SH1107_addressing } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c index b7fc736eb0..58d0beca85 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c @@ -105,7 +105,8 @@ void board_init(void) { false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second - true); // backlight_on_high + true, // backlight_on_high + false); // SH1107_addressing } bool board_requests_safe_mode(void) { diff --git a/ports/nrf/boards/clue_nrf52840_express/board.c b/ports/nrf/boards/clue_nrf52840_express/board.c index 45452a35ea..523bd7677b 100644 --- a/ports/nrf/boards/clue_nrf52840_express/board.c +++ b/ports/nrf/boards/clue_nrf52840_express/board.c @@ -91,7 +91,8 @@ void board_init(void) { false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second - true); // backlight_on_high + true, // backlight_on_high + false); // not SH1107 } bool board_requests_safe_mode(void) { diff --git a/ports/nrf/boards/hiibot_bluefi/board.c b/ports/nrf/boards/hiibot_bluefi/board.c index 6b53cab139..93e31aef0c 100644 --- a/ports/nrf/boards/hiibot_bluefi/board.c +++ b/ports/nrf/boards/hiibot_bluefi/board.c @@ -92,7 +92,8 @@ void board_init(void) { false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second - true); // backlight_on_high + true, // backlight_on_high + false); // SH1107_addressing } bool board_requests_safe_mode(void) { diff --git a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c index e7f946f4d0..e08d00daca 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c +++ b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c @@ -92,7 +92,8 @@ void board_init(void) { false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second - true); // backlight_on_high + true, // backlight_on_high + false); // SH1107_addressing } bool board_requests_safe_mode(void) { diff --git a/ports/nrf/boards/ohs2020_badge/board.c b/ports/nrf/boards/ohs2020_badge/board.c index 9fcf9d2bff..ec52690ced 100644 --- a/ports/nrf/boards/ohs2020_badge/board.c +++ b/ports/nrf/boards/ohs2020_badge/board.c @@ -91,7 +91,8 @@ void board_init(void) { false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second - false); // backlight_on_high + false, // backlight_on_high + false); // SH1107_addressing } bool board_requests_safe_mode(void) { diff --git a/ports/stm/boards/meowbit_v121/board.c b/ports/stm/boards/meowbit_v121/board.c index b74f135165..f67b4a49db 100644 --- a/ports/stm/boards/meowbit_v121/board.c +++ b/ports/stm/boards/meowbit_v121/board.c @@ -111,7 +111,8 @@ void board_init(void) { false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second - true); // backlight_on_high + true, // backlight_on_high + false); // SH1107_addressing } bool board_requests_safe_mode(void) { diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index afc4b7564c..9864e9f9d4 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -252,14 +252,8 @@ STATIC bool _refresh_area(displayio_display_obj_t* self, const displayio_area_t* // write one single row at a time if (self->SH1107_addressing) { subrectangles = rows_per_buffer; // vertical (column mode) write each separately (height times) - } - - // Skip this recalculation of subrectangles if SH1107 (each subrectangle is a single row) - // [mdroberts1243] I am worried/confused about the pixels_in_byte_share_row calculation though - // since it makes sense to be on a byte boundary (actually a page boundary too) - // seems to work as is though. - if ((displayio_area_size(&clipped) > buffer_size * pixels_per_word) - && (!self->SH1107_addressing)) { + rows_per_buffer = 1; + } else if (displayio_area_size(&clipped) > buffer_size * pixels_per_word) { rows_per_buffer = buffer_size * pixels_per_word / displayio_area_width(&clipped); if (rows_per_buffer == 0) { rows_per_buffer = 1; @@ -297,18 +291,13 @@ STATIC bool _refresh_area(displayio_display_obj_t* self, const displayio_area_t* .y2 = clipped.y1 + rows_per_buffer * (j + 1) }; if (self->SH1107_addressing) { - // one row only for SH1107 in vertical (column) mode - subrectangle.y1 = clipped.y1 + j; - subrectangle.y2 = clipped.y1 + (j + 1); - }; - if ((remaining_rows < rows_per_buffer) && (!self->SH1107_addressing)) { + // one row only for SH1107 in vertical (column) mode + subrectangle.y1 = clipped.y1 + j; + subrectangle.y2 = clipped.y1 + (j + 1); + } else if (remaining_rows < rows_per_buffer) { subrectangle.y2 = subrectangle.y1 + remaining_rows; } - if (self->SH1107_addressing) { - remaining_rows -= 1; - } else { - remaining_rows -= rows_per_buffer; - } + remaining_rows -= rows_per_buffer; displayio_display_core_set_region_to_update(&self->core, self->set_column_command, self->set_row_command, NO_COMMAND, NO_COMMAND, self->data_as_commands, false, diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index 6e05b47571..eb8c8f3b4a 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -41,7 +41,7 @@ #include #define DISPLAYIO_CORE_DEBUG(...) (void)0 -//#define DISPLAYIO_CORE_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) +// #define DISPLAYIO_CORE_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) 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, @@ -322,7 +322,7 @@ void displayio_display_core_start_refresh(displayio_display_core_t* self) { void displayio_display_core_finish_refresh(displayio_display_core_t* self) { if (self->current_group != NULL) { -// DISPLAYIO_CORE_DEBUG("displayiocore group_finish_refresh\n"); + DISPLAYIO_CORE_DEBUG("displayiocore group_finish_refresh\n"); displayio_group_finish_refresh(self->current_group); } self->full_refresh = false; From 22a7696faca36bb1abdc938e06bcd5e25fb89f33 Mon Sep 17 00:00:00 2001 From: Mark Roberts Date: Fri, 25 Sep 2020 22:17:59 -0400 Subject: [PATCH 0982/1293] Changes take 2: missed ugame10 board --- ports/atmel-samd/boards/ugame10/board.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/ugame10/board.c b/ports/atmel-samd/boards/ugame10/board.c index 3bb9eab7de..9f2b8d039d 100644 --- a/ports/atmel-samd/boards/ugame10/board.c +++ b/ports/atmel-samd/boards/ugame10/board.c @@ -111,7 +111,8 @@ void board_init(void) { false, // data as commands true, // auto_refresh 60, // native_frames_per_second - true); // backlight_on_high + true, // backlight_on_high + false); // SH1107_addressing } bool board_requests_safe_mode(void) { From 9944935fdeb0783a8b1d1ce3fd98f9c7ea0924e3 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 26 Sep 2020 11:31:54 -0500 Subject: [PATCH 0983/1293] qtpy haxpress: enable RTC --- ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk index 6c7bb3fca2..df452688e6 100644 --- a/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk @@ -15,7 +15,6 @@ EXTERNAL_FLASH_DEVICES = GD25Q16C CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_COUNTIO = 0 -CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 From 8b27febf324d754ccc9bb07080453e33098a4e31 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 26 Sep 2020 11:43:46 -0500 Subject: [PATCH 0984/1293] add new board to actions build --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8edec5616..1c68a3e5c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -279,6 +279,7 @@ jobs: - "pyportal_titano" - "pyruler" - "qtpy_m0" + - "qtpy_m0_haxpress" - "raytac_mdbt50q-db-40" - "robohatmm1_m4" - "sam32" From 791d20f16ccfc0328ef0fab0159a2b4985480928 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 26 Sep 2020 11:43:55 -0500 Subject: [PATCH 0985/1293] give qtpy haxpress its own USB PID --- ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk index df452688e6..a63f142742 100644 --- a/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x80CC +USB_PID = 0x00CC USB_PRODUCT = "QT Py M0 Haxpress" USB_MANUFACTURER = "Adafruit Industries LLC" From deefeecb454931a1476be0f852b78dfea0975d92 Mon Sep 17 00:00:00 2001 From: "Ryan T. Hamilton" Date: Sat, 26 Sep 2020 14:27:42 -0700 Subject: [PATCH 0986/1293] Fix ap_rssi bound_method Forgot to make it a property! --- shared-bindings/wifi/Radio.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 6f1935191d..6c4e6a4f65 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -172,6 +172,13 @@ STATIC mp_obj_t wifi_radio_get_ap_rssi(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ap_rssi_obj, wifi_radio_get_ap_rssi); +const mp_obj_property_t wifi_radio_ap_rssi_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&wifi_radio_get_ap_rssi_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + //| ipv4_gateway: Optional[ipaddress.IPv4Address] //| """IP v4 Address of the gateway when connected to an access point. None otherwise.""" //| @@ -260,7 +267,7 @@ STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&wifi_radio_connect_obj) }, // { MP_ROM_QSTR(MP_QSTR_connect_to_enterprise), MP_ROM_PTR(&wifi_radio_connect_to_enterprise_obj) }, - { MP_ROM_QSTR(MP_QSTR_ap_rssi), MP_ROM_PTR(&wifi_radio_get_ap_rssi_obj) }, + { MP_ROM_QSTR(MP_QSTR_ap_rssi), MP_ROM_PTR(&wifi_radio_ap_rssi_obj) }, { MP_ROM_QSTR(MP_QSTR_ipv4_gateway), MP_ROM_PTR(&wifi_radio_ipv4_gateway_obj) }, { MP_ROM_QSTR(MP_QSTR_ipv4_subnet), MP_ROM_PTR(&wifi_radio_ipv4_subnet_obj) }, { MP_ROM_QSTR(MP_QSTR_ipv4_address), MP_ROM_PTR(&wifi_radio_ipv4_address_obj) }, From 96323ac3ac2e93b87834b368726f49b8b2796049 Mon Sep 17 00:00:00 2001 From: Anson He Date: Sun, 27 Sep 2020 10:21:25 +0800 Subject: [PATCH 0987/1293] Default power on Wio Terminal's 40 Pin --- .../boards/seeeduino_wio_terminal/board.c | 23 +++++++++++++++++++ .../seeeduino_wio_terminal/mpconfigboard.h | 4 ++++ 2 files changed, 27 insertions(+) diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c index b7fc736eb0..f6b1e0dd15 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c @@ -31,8 +31,12 @@ #include "shared-bindings/displayio/FourWire.h" #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" +#include "shared-bindings/digitalio/DigitalInOut.h" displayio_fourwire_obj_t board_display_obj; +digitalio_digitalinout_obj_t CTR_5V; +digitalio_digitalinout_obj_t CTR_3V3; +digitalio_digitalinout_obj_t USB_HOST_ENABLE; uint8_t display_init_sequence[] = { 0x01, 0x80, 0x80, // Software reset then delay 0x80 (128ms) @@ -106,6 +110,25 @@ void board_init(void) { true, // auto_refresh 60, // native_frames_per_second true); // backlight_on_high + + // Enabling the Power of the 40-pin at the back + CTR_5V.base.type = &digitalio_digitalinout_type; + CTR_3V3.base.type = &digitalio_digitalinout_type; + USB_HOST_ENABLE.base.type = &digitalio_digitalinout_type; + + common_hal_digitalio_digitalinout_construct(&CTR_5V, PIN_CTR_5V); + common_hal_digitalio_digitalinout_construct(&CTR_3V3, PIN_CTR_3V3); + common_hal_digitalio_digitalinout_construct(&USB_HOST_ENABLE, PIN_USB_HOST_ENABLE); + + common_hal_digitalio_digitalinout_set_value(&CTR_5V, true); + common_hal_digitalio_digitalinout_set_value(&CTR_3V3, false); + common_hal_digitalio_digitalinout_set_value(&USB_HOST_ENABLE, false); + + // Never reset + common_hal_digitalio_digitalinout_never_reset(&CTR_5V); + common_hal_digitalio_digitalinout_never_reset(&CTR_3V3); + common_hal_digitalio_digitalinout_never_reset(&USB_HOST_ENABLE); + } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h index f7d0448df9..c87ca46d81 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h @@ -27,6 +27,10 @@ #define DEFAULT_UART_BUS_RX (&pin_PB27) #define DEFAULT_UART_BUS_TX (&pin_PB26) +#define PIN_CTR_5V (&pin_PC14) +#define PIN_CTR_3V3 (&pin_PC15) +#define PIN_USB_HOST_ENABLE (&pin_PA27) + // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 From 128b4a013b83b02953b1cfd7f246bdd30dab5f9a Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 28 Sep 2020 12:11:08 -0400 Subject: [PATCH 0988/1293] Add non-calibrated ADC --- locale/circuitpython.pot | 12 +- ports/esp32s2/Makefile | 51 ++++----- ports/esp32s2/common-hal/analogio/AnalogIn.c | 103 ++++++++++++++++++ ports/esp32s2/common-hal/analogio/AnalogIn.h | 50 +++++++++ ports/esp32s2/common-hal/analogio/AnalogOut.c | 60 ++++++++++ ports/esp32s2/common-hal/analogio/AnalogOut.h | 44 ++++++++ ports/esp32s2/common-hal/analogio/__init__.c | 1 + ports/esp32s2/mpconfigport.mk | 2 +- ports/esp32s2/peripherals/pins.c | 94 ++++++++-------- ports/esp32s2/peripherals/pins.h | 3 + 10 files changed, 342 insertions(+), 78 deletions(-) create mode 100644 ports/esp32s2/common-hal/analogio/AnalogIn.c create mode 100644 ports/esp32s2/common-hal/analogio/AnalogIn.h create mode 100644 ports/esp32s2/common-hal/analogio/AnalogOut.c create mode 100644 ports/esp32s2/common-hal/analogio/AnalogOut.h create mode 100644 ports/esp32s2/common-hal/analogio/__init__.c diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index c9114dd5c5..2d994b01db 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-25 18:14-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1167,14 +1167,10 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" @@ -1415,6 +1411,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/ref/pulseout-pre-timeralloc.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 229a3bf3ab..013da7d899 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -73,30 +73,31 @@ INC += -I./peripherals INC += -I../../lib/mp-readline INC += -I../../lib/tinyusb/src INC += -I../../supervisor/shared/usb -INC += -Iesp-idf/components/freertos/include/freertos -INC += -Iesp-idf/components/freertos/xtensa/include -INC += -Iesp-idf/components/esp32s2/include -INC += -Iesp-idf/components/xtensa/esp32s2/include -INC += -Iesp-idf/components/esp_common/include -INC += -Iesp-idf/components/esp_event/include -INC += -Iesp-idf/components/esp_netif/include -INC += -Iesp-idf/components/esp_ringbuf/include -INC += -Iesp-idf/components/esp_rom/include -INC += -Iesp-idf/components/esp_wifi/include -INC += -Iesp-idf/components/xtensa/include -INC += -Iesp-idf/components/esp_timer/include -INC += -Iesp-idf/components/mbedtls/mbedtls/include -INC += -Iesp-idf/components/mbedtls/port/include/ -INC += -Iesp-idf/components/newlib/platform_include -INC += -Iesp-idf/components/lwip/lwip/src/include -INC += -Iesp-idf/components/lwip/port/esp32/include -INC += -Iesp-idf/components/lwip/include/apps/sntp -INC += -Iesp-idf/components/soc/include -INC += -Iesp-idf/components/soc/src/esp32s2/include -INC += -Iesp-idf/components/soc/soc/include -INC += -Iesp-idf/components/soc/soc/esp32s2/include -INC += -Iesp-idf/components/heap/include -INC += -Iesp-idf/components/esp_system/include +INC += -isystem esp-idf/components/freertos/include/freertos +INC += -isystem esp-idf/components/freertos/xtensa/include +INC += -isystem esp-idf/components/esp32s2/include +INC += -isystem esp-idf/components/driver/esp32s2/include +INC += -isystem esp-idf/components/xtensa/esp32s2/include +INC += -isystem esp-idf/components/esp_common/include +INC += -isystem esp-idf/components/esp_event/include +INC += -isystem esp-idf/components/esp_netif/include +INC += -isystem esp-idf/components/esp_ringbuf/include +INC += -isystem esp-idf/components/esp_rom/include +INC += -isystem esp-idf/components/esp_wifi/include +INC += -isystem esp-idf/components/xtensa/include +INC += -isystem esp-idf/components/esp_timer/include +INC += -isystem esp-idf/components/mbedtls/mbedtls/include +INC += -isystem esp-idf/components/mbedtls/port/include/ +INC += -isystem esp-idf/components/newlib/platform_include +INC += -isystem esp-idf/components/lwip/lwip/src/include +INC += -isystem esp-idf/components/lwip/port/esp32/include +INC += -isystem esp-idf/components/lwip/include/apps/sntp +INC += -isystem esp-idf/components/soc/include +INC += -isystem esp-idf/components/soc/src/esp32s2/include +INC += -isystem esp-idf/components/soc/soc/include +INC += -isystem esp-idf/components/soc/soc/esp32s2/include +INC += -isystem esp-idf/components/heap/include +INC += -isystem esp-idf/components/esp_system/include INC += -I$(BUILD)/esp-idf/config CFLAGS += -DHAVE_CONFIG_H \ @@ -260,7 +261,7 @@ ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pth ESP_IDF_COMPONENTS_INCLUDE = driver freertos log soc -INC += $(foreach component, $(ESP_IDF_COMPONENTS_INCLUDE), -Iesp-idf/components/$(component)/include) +INC += $(foreach component, $(ESP_IDF_COMPONENTS_INCLUDE), -isystem esp-idf/components/$(component)/include) ESP_IDF_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_COMPONENTS_LINK), $(BUILD)/esp-idf/esp-idf/$(component)/lib$(component).a) ESP_IDF_WIFI_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_WIFI_COMPONENTS_LINK), $(BUILD)/esp-idf/esp-idf/$(component)/lib$(component).a) diff --git a/ports/esp32s2/common-hal/analogio/AnalogIn.c b/ports/esp32s2/common-hal/analogio/AnalogIn.c new file mode 100644 index 0000000000..1a15fc77cd --- /dev/null +++ b/ports/esp32s2/common-hal/analogio/AnalogIn.c @@ -0,0 +1,103 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland 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 "common-hal/analogio/AnalogIn.h" +#include "py/mperrno.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +#include "driver/adc.h" +// TODO: Add when ESP-IDF is updated latest version +// #include "esp-idf/components/esp_adc_cal/include/esp_adc_cal.h" + +#include "shared-bindings/microcontroller/Pin.h" + +#define DEFAULT_VREF 1100 +#define NO_OF_SAMPLES 64 +#define ATTENUATION ADC_ATTEN_DB_11 +#define DATA_WIDTH ADC_WIDTH_BIT_13 + +void common_hal_analogio_analogin_construct(analogio_analogin_obj_t* self, + const mcu_pin_obj_t *pin) { + if (pin->adc_index == 0 || pin->adc_channel == ADC_CHANNEL_MAX) { + mp_raise_ValueError(translate("Pin does not have ADC capabilities")); + } + common_hal_mcu_pin_claim(pin); + self->pin = pin; +} + +bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) { + return self->pin == NULL; +} + +void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { + if (common_hal_analogio_analogin_deinited(self)) { + return; + } + reset_pin_number(self->pin->number); + self->pin = NULL; +} + +uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { + if (self->pin->adc_index == ADC_UNIT_1) { + adc1_config_width(DATA_WIDTH); + adc1_config_channel_atten((adc1_channel_t)self->pin->adc_channel, ATTENUATION); + } else if (self->pin->adc_index == ADC_UNIT_2) { + adc2_config_channel_atten((adc2_channel_t)self->pin->adc_channel, ATTENUATION); + } + + // TODO: esp_adc_cal is only available in the latest version of the esp-idf. Enable when we update. + // Automatically select calibration process depending on status of efuse + // esp_adc_cal_characteristics_t *adc_chars = calloc(1, sizeof(esp_adc_cal_characteristics_t)); + // esp_adc_cal_characterize(self->pin->adc_index, ATTENUATION, DATA_WIDTH, DEFAULT_VREF, adc_chars); + + uint32_t adc_reading = 0; + //Multisampling + for (int i = 0; i < NO_OF_SAMPLES; i++) { + if (self->pin->adc_index == ADC_UNIT_1) { + adc_reading += adc1_get_raw((adc1_channel_t)self->pin->adc_channel); + } else { + int raw; + esp_err_t r = adc2_get_raw((adc2_channel_t)self->pin->adc_channel, DATA_WIDTH, &raw); + if ( r != ESP_OK ) { + mp_raise_ValueError(translate("ADC2 is being used by WiFi")); + } + adc_reading += raw; + } + } + adc_reading /= NO_OF_SAMPLES; + + // This corrects non-linear regions of the ADC range with a LUT, so it's a better reading than raw + // Enable when ESP-IDF is updated + //uint32_t voltage = esp_adc_cal_raw_to_voltage(adc_reading, adc_chars); + //return voltage * ((1 << 16) - 1)/3300; + + return adc_reading; +} + +float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) { + return 3.3f; +} diff --git a/ports/esp32s2/common-hal/analogio/AnalogIn.h b/ports/esp32s2/common-hal/analogio/AnalogIn.h new file mode 100644 index 0000000000..5ea4a913de --- /dev/null +++ b/ports/esp32s2/common-hal/analogio/AnalogIn.h @@ -0,0 +1,50 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland 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_ESP32S2_COMMON_HAL_ANALOGIO_ANALOGIN_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ANALOGIO_ANALOGIN_H + +#include "common-hal/microcontroller/Pin.h" + +#include "esp-idf/components/soc/include/hal/adc_types.h" +#include "FreeRTOS.h" +#include "freertos/semphr.h" +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t * pin; +} analogio_analogin_obj_t; + +static inline uint8_t stm32_adc_units(uint8_t adc_packed) { + return adc_packed >> 5; +} + +static inline uint8_t stm32_adc_channel(uint8_t adc_packed) { + return adc_packed & 0x1f; +} + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ANALOGIO_ANALOGIN_H diff --git a/ports/esp32s2/common-hal/analogio/AnalogOut.c b/ports/esp32s2/common-hal/analogio/AnalogOut.c new file mode 100644 index 0000000000..d67dc6083f --- /dev/null +++ b/ports/esp32s2/common-hal/analogio/AnalogOut.c @@ -0,0 +1,60 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2013, 2014 Damien P. George + * Copyright (c) 2019, Lucian Copeland 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 "py/mperrno.h" +#include "py/runtime.h" + +#include "shared-bindings/analogio/AnalogOut.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/shared/translate.h" + +#include "common-hal/microcontroller/Pin.h" + +void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, + const mcu_pin_obj_t *pin) { + //mp_raise_ValueError(translate("No DAC on chip")); +} + +bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { + return true; +} + +void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { + +} + +void common_hal_analogio_analogout_set_value(analogio_analogout_obj_t *self, + uint16_t value) { + +} + +void analogout_reset(void) { + +} diff --git a/ports/esp32s2/common-hal/analogio/AnalogOut.h b/ports/esp32s2/common-hal/analogio/AnalogOut.h new file mode 100644 index 0000000000..d5f29ffd74 --- /dev/null +++ b/ports/esp32s2/common-hal/analogio/AnalogOut.h @@ -0,0 +1,44 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * Copyright (c) 2019 Lucian Copeland 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_STM32F4_COMMON_HAL_ANALOGIO_ANALOGOUT_H +#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGOUT_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t * pin; + uint8_t channel; + uint8_t dac_index:1; +} analogio_analogout_obj_t; + +void analogout_reset(void); + +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGOUT_H diff --git a/ports/esp32s2/common-hal/analogio/__init__.c b/ports/esp32s2/common-hal/analogio/__init__.c new file mode 100644 index 0000000000..eea58c77d6 --- /dev/null +++ b/ports/esp32s2/common-hal/analogio/__init__.c @@ -0,0 +1 @@ +// No analogio module functions. diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index bbaabb1c3d..d68fe469dc 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -13,8 +13,8 @@ USB_SERIAL_NUMBER_LENGTH = 12 LONGINT_IMPL = MPZ # These modules are implemented in ports//common-hal: +# CIRCUITPY_ANALOGIO = 0 CIRCUITPY_FULL_BUILD = 1 -CIRCUITPY_ANALOGIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_COUNTIO = 0 diff --git a/ports/esp32s2/peripherals/pins.c b/ports/esp32s2/peripherals/pins.c index 34fd6483eb..2c8b61c627 100755 --- a/ports/esp32s2/peripherals/pins.c +++ b/ports/esp32s2/peripherals/pins.c @@ -26,56 +26,58 @@ #include "peripherals/pins.h" -#define NO_ADC 0xff +#define NO_ADC 0 +#define NO_ADC_CHANNEL ADC_CHANNEL_MAX // This macro is used to simplify pin definition in boards//pins.c -#define PIN(p_name, p_number) \ +#define PIN(p_name, p_number, p_adc_index, p_adc_channel) \ const mcu_pin_obj_t pin_## p_name = { \ PIN_PREFIX_VALUES \ .number = p_number, \ + .adc_index = p_adc_index, \ + .adc_channel = p_adc_channel, \ } -PIN(GPIO0, 0); -PIN(GPIO1, 1); -PIN(GPIO2, 2); -PIN(GPIO3, 3); -PIN(GPIO4, 4); -PIN(GPIO5, 5); -PIN(GPIO6, 6); -PIN(GPIO7, 7); -PIN(GPIO8, 8); -PIN(GPIO9, 9); -PIN(GPIO10, 10); -PIN(GPIO11, 11); -PIN(GPIO12, 12); -PIN(GPIO13, 13); -PIN(GPIO14, 14); -PIN(GPIO15, 15); -PIN(GPIO16, 16); -PIN(GPIO17, 17); -PIN(GPIO18, 18); - -PIN(GPIO19, 19); -PIN(GPIO20, 20); -PIN(GPIO21, 21); -PIN(GPIO26, 26); -PIN(GPIO27, 27); -PIN(GPIO28, 28); -PIN(GPIO29, 29); -PIN(GPIO30, 30); -PIN(GPIO31, 31); -PIN(GPIO32, 32); -PIN(GPIO33, 33); -PIN(GPIO34, 34); -PIN(GPIO35, 35); -PIN(GPIO36, 36); -PIN(GPIO37, 37); -PIN(GPIO38, 38); -PIN(GPIO39, 39); -PIN(GPIO40, 40); -PIN(GPIO41, 41); -PIN(GPIO42, 42); -PIN(GPIO43, 43); -PIN(GPIO44, 44); -PIN(GPIO45, 45); -PIN(GPIO46, 46); +PIN(GPIO0, 0, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO1, 1, ADC_UNIT_1, ADC_CHANNEL_0); +PIN(GPIO2, 2, ADC_UNIT_1, ADC_CHANNEL_1); +PIN(GPIO3, 3, ADC_UNIT_1, ADC_CHANNEL_2); +PIN(GPIO4, 4, ADC_UNIT_1, ADC_CHANNEL_3); +PIN(GPIO5, 5, ADC_UNIT_1, ADC_CHANNEL_4); +PIN(GPIO6, 6, ADC_UNIT_1, ADC_CHANNEL_5); +PIN(GPIO7, 7, ADC_UNIT_1, ADC_CHANNEL_6); +PIN(GPIO8, 8, ADC_UNIT_1, ADC_CHANNEL_7); +PIN(GPIO9, 9, ADC_UNIT_1, ADC_CHANNEL_8); +PIN(GPIO10, 10, ADC_UNIT_1, ADC_CHANNEL_9); +PIN(GPIO11, 11, ADC_UNIT_2, ADC_CHANNEL_0); +PIN(GPIO12, 12, ADC_UNIT_2, ADC_CHANNEL_1); +PIN(GPIO13, 13, ADC_UNIT_2, ADC_CHANNEL_2); +PIN(GPIO14, 14, ADC_UNIT_2, ADC_CHANNEL_3); +PIN(GPIO15, 15, ADC_UNIT_2, ADC_CHANNEL_4); +PIN(GPIO16, 16, ADC_UNIT_2, ADC_CHANNEL_5); +PIN(GPIO17, 17, ADC_UNIT_2, ADC_CHANNEL_6); +PIN(GPIO18, 18, ADC_UNIT_2, ADC_CHANNEL_7); +PIN(GPIO19, 19, ADC_UNIT_2, ADC_CHANNEL_8); +PIN(GPIO20, 20, ADC_UNIT_2, ADC_CHANNEL_9); +PIN(GPIO21, 21, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO26, 26, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO27, 27, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO28, 28, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO29, 29, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO30, 30, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO31, 31, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO32, 32, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO33, 33, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO34, 34, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO35, 35, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO36, 36, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO37, 37, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO38, 38, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO39, 39, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO40, 40, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO41, 41, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO42, 42, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO43, 43, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO44, 44, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO45, 45, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO46, 46, NO_ADC, NO_ADC_CHANNEL); diff --git a/ports/esp32s2/peripherals/pins.h b/ports/esp32s2/peripherals/pins.h index 07d0b908ee..3f41cf35b2 100644 --- a/ports/esp32s2/peripherals/pins.h +++ b/ports/esp32s2/peripherals/pins.h @@ -35,10 +35,13 @@ #include "esp32s2_peripherals_config.h" #include "esp-idf/config/sdkconfig.h" #include "esp-idf/components/soc/include/hal/gpio_types.h" +#include "esp-idf/components/soc/include/hal/adc_types.h" typedef struct { PIN_PREFIX_FIELDS gpio_num_t number; + uint8_t adc_index:2; + uint8_t adc_channel:6; } mcu_pin_obj_t; extern const mcu_pin_obj_t pin_GPIO0; From 8e4f08a109980e76df43cd95f8bca96422ae89ce Mon Sep 17 00:00:00 2001 From: caternuson Date: Mon, 28 Sep 2020 13:15:43 -0700 Subject: [PATCH 0989/1293] add MP const info to Design Guide --- docs/design_guide.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/design_guide.rst b/docs/design_guide.rst index 6f87ecf798..9ce8dc9636 100644 --- a/docs/design_guide.rst +++ b/docs/design_guide.rst @@ -448,6 +448,19 @@ struct.pack Use `struct.pack_into` instead of `struct.pack`. +Use of MicroPython `const()` +-------------------------------------------------------------------------------- +The MicroPython `const()` feature, as discussed in `this forum post +`_, and in `this issue thread +`_, provides some +optimizations that can be useful on smaller, memory constrained devices. However, +when using `const()`, keep in mind these general guide lines: + +- Always use via an import, ex: `from micropython import const` +- Limit use to global (module level) variables only. +- If user will not need access to variable, prefix name with a leading + underscore, ex: `_SOME_CONST`. + Sensor properties and units -------------------------------------------------------------------------------- From 4d4dbbcafe4330d9dcd16535605d8990960972b1 Mon Sep 17 00:00:00 2001 From: caternuson Date: Mon, 28 Sep 2020 13:28:38 -0700 Subject: [PATCH 0990/1293] RST tweak --- docs/design_guide.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/design_guide.rst b/docs/design_guide.rst index 9ce8dc9636..a00caf1d69 100644 --- a/docs/design_guide.rst +++ b/docs/design_guide.rst @@ -448,18 +448,18 @@ struct.pack Use `struct.pack_into` instead of `struct.pack`. -Use of MicroPython `const()` +Use of MicroPython ``const()`` -------------------------------------------------------------------------------- -The MicroPython `const()` feature, as discussed in `this forum post +The MicroPython ``const()`` feature, as discussed in `this forum post `_, and in `this issue thread `_, provides some optimizations that can be useful on smaller, memory constrained devices. However, -when using `const()`, keep in mind these general guide lines: +when using ``const()``, keep in mind these general guide lines: -- Always use via an import, ex: `from micropython import const` +- Always use via an import, ex: ``from micropython import const`` - Limit use to global (module level) variables only. - If user will not need access to variable, prefix name with a leading - underscore, ex: `_SOME_CONST`. + underscore, ex: ``_SOME_CONST``. Sensor properties and units -------------------------------------------------------------------------------- From abdbbf9e242e7ae8234d338f0b1d7a0c26fa6ad1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 28 Sep 2020 15:10:12 -0700 Subject: [PATCH 0991/1293] One grep --- ports/esp32s2/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 662be481e6..a32c83013b 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -259,8 +259,7 @@ $(BUILD)/esp-idf/partition_table/partition-table.bin: $(BUILD)/esp-idf/config/sd menuconfig: $(BUILD)/esp-idf/config $(Q)ninja -C $(BUILD)/esp-idf menuconfig $(Q)diff --old-line-format= --unchanged-line-format= esp-idf-config/sdkconfig.defaults $(BUILD)/esp-idf/sdkconfig > $(BUILD)/sdkconfig.diff || true - $(Q)grep -Fvxf $(FLASH_SDKCONFIG) $(BUILD)/sdkconfig.diff > $(BUILD)/sdkconfig.stripped1 - $(Q)grep -Fvxf $(DEBUG_SDKCONFIG) $(BUILD)/sdkconfig.stripped1 > boards/$(BOARD)/sdkconfig + $(Q)grep -Fvxf $(DEBUG_SDKCONFIG) -f $(FLASH_SDKCONFIG) $(BUILD)/sdkconfig.diff > boards/$(BOARD)/sdkconfig # qstr builds include headers so we need to make sure they are up to date $(HEADER_BUILD)/qstr.i.last: | $(BUILD)/esp-idf/config/sdkconfig.h From 8b82c239b825b058efcbe4e3749a6e7d023bdd17 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 24 Sep 2020 11:20:02 -0500 Subject: [PATCH 0992/1293] canio: doc improvements --- shared-bindings/canio/Message.c | 2 +- shared-bindings/canio/__init__.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/canio/Message.c b/shared-bindings/canio/Message.c index 23645d2e5f..8d1828fba0 100644 --- a/shared-bindings/canio/Message.c +++ b/shared-bindings/canio/Message.c @@ -117,7 +117,7 @@ STATIC const mp_obj_property_t canio_message_id_obj = { //| data: bytes //| """The content of the message, or dummy content in the case of an rtr. //| -//| Assigning to data also sets the length and clears the rtr flag.""" +//| Assigning to data also clears the rtr flag, if it was set.""" //| STATIC mp_obj_t canio_message_data_get(const mp_obj_t self_in) { canio_message_obj_t *self = self_in; diff --git a/shared-bindings/canio/__init__.c b/shared-bindings/canio/__init__.c index b0b982c950..409cc20cfe 100644 --- a/shared-bindings/canio/__init__.c +++ b/shared-bindings/canio/__init__.c @@ -40,8 +40,8 @@ //| from board import * //| //| can = canio.CAN(board.CAN_RX, board.CAN_TX, baudrate=1000000) -//| message = canio.Message(id=0x0408, data="adafruit" -//| can.write(message)) +//| message = canio.Message(id=0x0408, data=b"adafruit") +//| can.send(message) //| can.deinit() //| //| This example will write the data 'adafruit' onto the CAN bus to any From 79ca430ddf25a71c73d6219fb68160fb405c3777 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 24 Sep 2020 13:58:45 -0500 Subject: [PATCH 0993/1293] Match: address -> id --- ports/atmel-samd/common-hal/canio/Listener.c | 60 ++++++++++---------- shared-bindings/canio/Match.c | 46 +++++++-------- shared-bindings/canio/Match.h | 4 +- shared-module/canio/Match.c | 8 +-- shared-module/canio/Match.h | 2 +- 5 files changed, 60 insertions(+), 60 deletions(-) diff --git a/ports/atmel-samd/common-hal/canio/Listener.c b/ports/atmel-samd/common-hal/canio/Listener.c index 02cfde9cc8..d21ebbb313 100644 --- a/ports/atmel-samd/common-hal/canio/Listener.c +++ b/ports/atmel-samd/common-hal/canio/Listener.c @@ -58,8 +58,8 @@ STATIC void static_assertions(void) { MP_STATIC_ASSERT(CAN_XIDFE_0_EFEC_STF0M_Val + 1 == CAN_XIDFE_0_EFEC_STF1M_Val); } -STATIC bool single_address_filter(canio_match_obj_t *match) { - return match->mask == 0 || match->mask == match->address; +STATIC bool single_id_filter(canio_match_obj_t *match) { + return match->mask == 0 || match->mask == match->id; } STATIC bool standard_filter_in_use(CanMramSidfe *filter) { @@ -76,7 +76,7 @@ STATIC size_t num_filters_needed(size_t nmatch, canio_match_obj_t **matches, boo if (extended != matches[i]->extended) { continue; } - if (single_address_filter(matches[i])) { + if (single_id_filter(matches[i])) { num_half_filters_needed += 1; } else { num_half_filters_needed += 2; @@ -191,7 +191,7 @@ STATIC void install_extended_filter(CanMramXidfe *extended, int id1, int id2, in } -#define NO_ADDRESS (-1) +#define NO_ID (-1) void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t **matches) { int fifo = self->fifo_idx; @@ -207,31 +207,31 @@ void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t ** CanMramSidfe *standard = next_standard_filter(self, NULL); CanMramXidfe *extended = next_extended_filter(self, NULL); - int first_address = NO_ADDRESS; + int first_id = NO_ID; - // step 1: single address standard matches + // step 1: single id standard matches // we have to gather up pairs and stuff them in a single filter entry for(size_t i = 0; iextended) { continue; } - if (!single_address_filter(match)) { + if (!single_id_filter(match)) { continue; } - if (first_address != NO_ADDRESS) { - install_standard_filter(standard, first_address, match->address, CAN_SIDFE_0_SFEC_STF0M_Val + fifo, CAN_SIDFE_0_SFT_DUAL_Val); - first_address = NO_ADDRESS; + if (first_id != NO_ID) { + install_standard_filter(standard, first_id, match->id, CAN_SIDFE_0_SFEC_STF0M_Val + fifo, CAN_SIDFE_0_SFT_DUAL_Val); + first_id = NO_ID; standard = next_standard_filter(self, standard); } else { - first_address = match->address; + first_id = match->id; } } - // step 1.5. odd single address standard match - if (first_address != NO_ADDRESS) { - install_standard_filter(standard, first_address, first_address, CAN_SIDFE_0_SFEC_STF0M_Val + fifo, CAN_SIDFE_0_SFT_DUAL_Val); + // step 1.5. odd single id standard match + if (first_id != NO_ID) { + install_standard_filter(standard, first_id, first_id, CAN_SIDFE_0_SFEC_STF0M_Val + fifo, CAN_SIDFE_0_SFT_DUAL_Val); standard = next_standard_filter(self, standard); - first_address = NO_ADDRESS; + first_id = NO_ID; } // step 2: standard mask filter @@ -240,36 +240,36 @@ void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t ** if (match->extended) { continue; } - if (single_address_filter(match)) { + if (single_id_filter(match)) { continue; } - install_standard_filter(standard, match->address, match->mask, CAN_SIDFE_0_SFEC_STF0M_Val + fifo, CAN_SIDFE_0_SFT_CLASSIC_Val); + install_standard_filter(standard, match->id, match->mask, CAN_SIDFE_0_SFEC_STF0M_Val + fifo, CAN_SIDFE_0_SFT_CLASSIC_Val); standard = next_standard_filter(self, standard); } - // step 3: single address extended matches + // step 3: single id extended matches // we have to gather up pairs and stuff them in a single filter entry for(size_t i = 0; iextended) { continue; } - if (!single_address_filter(match)) { + if (!single_id_filter(match)) { continue; } - if (first_address != NO_ADDRESS) { - install_extended_filter(extended, first_address, match->address, CAN_XIDFE_0_EFEC_STF0M_Val + fifo, CAN_XIDFE_1_EFT_DUAL_Val); - first_address = NO_ADDRESS; + if (first_id != NO_ID) { + install_extended_filter(extended, first_id, match->id, CAN_XIDFE_0_EFEC_STF0M_Val + fifo, CAN_XIDFE_1_EFT_DUAL_Val); + first_id = NO_ID; extended = next_extended_filter(self, extended); } else { - first_address = match->address; + first_id = match->id; } } - // step 3.5. odd single address standard match - if (first_address != NO_ADDRESS) { - install_extended_filter(extended, first_address, first_address, CAN_XIDFE_0_EFEC_STF0M_Val + fifo, CAN_XIDFE_1_EFT_DUAL_Val); + // step 3.5. odd single id standard match + if (first_id != NO_ID) { + install_extended_filter(extended, first_id, first_id, CAN_XIDFE_0_EFEC_STF0M_Val + fifo, CAN_XIDFE_1_EFT_DUAL_Val); extended = next_extended_filter(self, extended); - first_address = NO_ADDRESS; + first_id = NO_ID; } // step 4: extended mask filters @@ -278,10 +278,10 @@ void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t ** if (!match->extended) { continue; } - if (single_address_filter(match)) { + if (single_id_filter(match)) { continue; } - install_extended_filter(extended, match->address, match->mask, CAN_XIDFE_0_EFEC_STF0M_Val + fifo, CAN_XIDFE_1_EFT_CLASSIC_Val); + install_extended_filter(extended, match->id, match->mask, CAN_XIDFE_0_EFEC_STF0M_Val + fifo, CAN_XIDFE_1_EFT_CLASSIC_Val); extended = next_extended_filter(self, extended); } @@ -363,7 +363,7 @@ bool common_hal_canio_listener_readinto(canio_listener_obj_t *self, canio_messag if (message->extended) { message->id = hw_message->rxf0.bit.ID; } else { - message->id = hw_message->rxf0.bit.ID >> 18; // short addresses are left-justified + message->id = hw_message->rxf0.bit.ID >> 18; // short ids are left-justified } message->rtr = hw_message->rxf0.bit.RTR; message->size = hw_message->rxf1.bit.DLC; diff --git a/shared-bindings/canio/Match.c b/shared-bindings/canio/Match.c index ff5d028fad..91a9dd02a3 100644 --- a/shared-bindings/canio/Match.c +++ b/shared-bindings/canio/Match.c @@ -33,19 +33,19 @@ //| """Describe CAN bus messages to match""" //| //| -//| def __init__(self, address: int, *, mask: int = 0, extended: bool = False): +//| def __init__(self, id: int, *, mask: int = 0, extended: bool = False): //| """Construct a Match with the given properties. //| -//| If mask is nonzero, then the filter is for any sender which matches all -//| the nonzero bits in mask. Otherwise, it matches exactly the given address. -//| If extended is true then only extended addresses are matched, otherwise -//| only standard addresses are matched.""" +//| If mask is nonzero, then the filter is for any id which matches all +//| the nonzero bits in mask. Otherwise, it matches exactly the given id. +//| If extended is true then only extended ids are matched, otherwise +//| only standard ids are matched.""" //| STATIC mp_obj_t canio_match_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_address, ARG_mask, ARG_extended, NUM_ARGS }; + enum { ARG_id, ARG_mask, ARG_extended, NUM_ARGS }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_address, MP_ARG_INT | MP_ARG_REQUIRED }, + { MP_QSTR_id, MP_ARG_INT | MP_ARG_REQUIRED }, { MP_QSTR_mask, MP_ARG_INT, {.u_int = 0} }, { MP_QSTR_extended, MP_ARG_BOOL, {.u_bool = false} }, }; @@ -54,44 +54,44 @@ STATIC mp_obj_t canio_match_make_new(const mp_obj_type_t *type, size_t n_args, c mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - int address_bits = args[ARG_extended].u_bool ? 0x1fffffff : 0x7ff; - int address = args[ARG_address].u_int; + int id_bits = args[ARG_extended].u_bool ? 0x1fffffff : 0x7ff; + int id = args[ARG_id].u_int; int mask = args[ARG_mask].u_int; - if (address & ~address_bits) { - mp_raise_ValueError_varg(translate("%q out of range"), MP_QSTR_address); + if (id & ~id_bits) { + mp_raise_ValueError_varg(translate("%q out of range"), MP_QSTR_id); } - if (mask & ~address_bits) { + if (mask & ~id_bits) { mp_raise_ValueError_varg(translate("%q out of range"), MP_QSTR_mask); } canio_match_obj_t *self = m_new_obj(canio_match_obj_t); self->base.type = &canio_match_type; - common_hal_canio_match_construct(self, args[ARG_address].u_int, args[ARG_mask].u_int, args[ARG_extended].u_bool); + common_hal_canio_match_construct(self, args[ARG_id].u_int, args[ARG_mask].u_int, args[ARG_extended].u_bool); return self; } -//| address: int -//| """The address to match""" +//| id: int +//| """The id to match""" //| -STATIC mp_obj_t canio_match_address_get(mp_obj_t self_in) { +STATIC mp_obj_t canio_match_id_get(mp_obj_t self_in) { canio_match_obj_t *self = self_in; - return MP_OBJ_NEW_SMALL_INT(common_hal_canio_match_get_address(self)); + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_match_get_id(self)); } -MP_DEFINE_CONST_FUN_OBJ_1(canio_match_address_get_obj, canio_match_address_get); +MP_DEFINE_CONST_FUN_OBJ_1(canio_match_id_get_obj, canio_match_id_get); -const mp_obj_property_t canio_match_address_obj = { +const mp_obj_property_t canio_match_id_obj = { .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_match_address_get_obj, + .proxy = {(mp_obj_t)&canio_match_id_get_obj, (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj}, }; //| //| mask: int -//| """The optional mask of addresses to match""" +//| """The optional mask of ids to match""" //| STATIC mp_obj_t canio_match_mask_get(mp_obj_t self_in) { @@ -108,7 +108,7 @@ const mp_obj_property_t canio_match_mask_obj = { }; //| extended: bool -//| """True to match extended addresses, False to match standard addresses""" +//| """True to match extended ids, False to match standard ides""" //| STATIC mp_obj_t canio_match_extended_get(mp_obj_t self_in) { @@ -125,7 +125,7 @@ const mp_obj_property_t canio_match_extended_obj = { }; STATIC const mp_rom_map_elem_t canio_match_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_address), MP_ROM_PTR(&canio_match_address_obj) }, + { MP_ROM_QSTR(MP_QSTR_id), MP_ROM_PTR(&canio_match_id_obj) }, { MP_ROM_QSTR(MP_QSTR_mask), MP_ROM_PTR(&canio_match_mask_obj) }, { MP_ROM_QSTR(MP_QSTR_extended), MP_ROM_PTR(&canio_match_extended_obj) }, }; diff --git a/shared-bindings/canio/Match.h b/shared-bindings/canio/Match.h index 88996d730f..01a75fd1c6 100644 --- a/shared-bindings/canio/Match.h +++ b/shared-bindings/canio/Match.h @@ -31,7 +31,7 @@ extern const mp_obj_type_t canio_match_type; -void common_hal_canio_match_construct(canio_match_obj_t *self, int address, int mask, bool extended); -int common_hal_canio_match_get_address(const canio_match_obj_t *self); +void common_hal_canio_match_construct(canio_match_obj_t *self, int id, int mask, bool extended); +int common_hal_canio_match_get_id(const canio_match_obj_t *self); int common_hal_canio_match_get_mask(const canio_match_obj_t *self); bool common_hal_canio_match_get_extended(const canio_match_obj_t *self); diff --git a/shared-module/canio/Match.c b/shared-module/canio/Match.c index 9e33b956f6..b4e8616e9b 100644 --- a/shared-module/canio/Match.c +++ b/shared-module/canio/Match.c @@ -26,14 +26,14 @@ #include "shared-module/canio/Match.h" -void common_hal_canio_match_construct(canio_match_obj_t *self, int address, int mask, bool extended) { - self->address = address; +void common_hal_canio_match_construct(canio_match_obj_t *self, int id, int mask, bool extended) { + self->id = id; self->mask = mask; self->extended = extended; } -int common_hal_canio_match_get_address(const canio_match_obj_t *self) { - return self->address; +int common_hal_canio_match_get_id(const canio_match_obj_t *self) { + return self->id; } int common_hal_canio_match_get_mask(const canio_match_obj_t *self) { return self->mask; diff --git a/shared-module/canio/Match.h b/shared-module/canio/Match.h index 25f047f37e..b52191d7c4 100644 --- a/shared-module/canio/Match.h +++ b/shared-module/canio/Match.h @@ -30,7 +30,7 @@ typedef struct { mp_obj_base_t base; - int address; + int id; int mask; bool extended; } canio_match_obj_t; From 48bda589b81acad03bfe088c4c754040e9eb0783 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 24 Sep 2020 14:05:16 -0500 Subject: [PATCH 0994/1293] Listerner: read -> receive, drop readinto This prepares for creating a separate RemoteTransmissionRequest class --- ports/atmel-samd/common-hal/canio/Listener.c | 2 +- ports/atmel-samd/common-hal/canio/Listener.h | 4 +-- shared-bindings/canio/CAN.h | 1 + shared-bindings/canio/Listener.c | 29 ++++---------------- shared-bindings/canio/Listener.h | 12 ++++++++ 5 files changed, 22 insertions(+), 26 deletions(-) diff --git a/ports/atmel-samd/common-hal/canio/Listener.c b/ports/atmel-samd/common-hal/canio/Listener.c index d21ebbb313..7137f806bf 100644 --- a/ports/atmel-samd/common-hal/canio/Listener.c +++ b/ports/atmel-samd/common-hal/canio/Listener.c @@ -348,7 +348,7 @@ int common_hal_canio_listener_in_waiting(canio_listener_obj_t *self) { return self->hw->RXFS.bit.F0FL; } -bool common_hal_canio_listener_readinto(canio_listener_obj_t *self, canio_message_obj_t *message) { +bool common_hal_canio_listener_receiveinto(canio_listener_obj_t *self, canio_message_obj_t *message) { if (!common_hal_canio_listener_in_waiting(self)) { uint64_t deadline = supervisor_ticks_ms64() + self->timeout_ms; do { diff --git a/ports/atmel-samd/common-hal/canio/Listener.h b/ports/atmel-samd/common-hal/canio/Listener.h index 1b81d82aa6..10e1a5f8ad 100644 --- a/ports/atmel-samd/common-hal/canio/Listener.h +++ b/ports/atmel-samd/common-hal/canio/Listener.h @@ -35,7 +35,7 @@ typedef struct { __IO CAN_RXF0A_Type RXFA; /**< \brief (R/W 32) Rx FIFO n Acknowledge */ } canio_rxfifo_reg_t; -typedef struct { +typedef struct canio_listener_obj { mp_obj_base_t base; canio_can_obj_t *can; canio_can_rx_fifo_t *fifo; @@ -47,7 +47,7 @@ typedef struct { void common_hal_canio_listener_construct(canio_listener_obj_t *self, canio_can_obj_t *can, size_t nmatch, canio_match_obj_t **matches, float timeout); void common_hal_canio_listener_check_for_deinit(canio_listener_obj_t *self); void common_hal_canio_listener_deinit(canio_listener_obj_t *self); -bool common_hal_canio_listener_readinto(canio_listener_obj_t *self, canio_message_obj_t *message); +bool common_hal_canio_listener_receiveinto(canio_listener_obj_t *self, canio_message_obj_t *message); int common_hal_canio_listener_in_waiting(canio_listener_obj_t *self); float common_hal_canio_listener_get_timeout(canio_listener_obj_t *self); void common_hal_canio_listener_set_timeout(canio_listener_obj_t *self, float timeout); diff --git a/shared-bindings/canio/CAN.h b/shared-bindings/canio/CAN.h index 66c972c285..08166dfd42 100644 --- a/shared-bindings/canio/CAN.h +++ b/shared-bindings/canio/CAN.h @@ -28,6 +28,7 @@ #include "py/obj.h" #include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/canio/__init__.h" #include "shared-bindings/canio/Message.h" extern const mp_obj_type_t canio_can_type; diff --git a/shared-bindings/canio/Listener.c b/shared-bindings/canio/Listener.c index 1f4176f0c0..5159c8481f 100644 --- a/shared-bindings/canio/Listener.c +++ b/shared-bindings/canio/Listener.c @@ -38,44 +38,28 @@ //| Listen method of a canio.CAN object.""" //| -//| def read(self) -> Optional[Message]: +//| def receive(self) -> Optional[Message]: //| """Reads a message, after waiting up to self.timeout seconds //| //| If no message is received in time, None is returned. Otherwise, //| a Message is returned.""" //| ... //| -STATIC mp_obj_t canio_listener_read(mp_obj_t self_in) { +STATIC mp_obj_t canio_listener_receive(mp_obj_t self_in) { canio_listener_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_canio_listener_check_for_deinit(self); canio_message_obj_t *message = m_new_obj(canio_message_obj_t); message->base.type = &canio_message_type; - if (common_hal_canio_listener_readinto(self, message)) { + if (common_hal_canio_listener_receiveinto(self, message)) { return message; } else { m_free(message); // message did not escape into vm } return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_read_obj, canio_listener_read); - -//| def readinto(self, message: Message) -> bool: -//| """Returns True (and modifies message) if a message was received -//| before ``timeout`` seconds elapsed, False otherwise.""" -//| ... -//| -STATIC mp_obj_t canio_listener_readinto(mp_obj_t self_in, mp_obj_t message) { - canio_listener_obj_t *self = MP_OBJ_TO_PTR(self_in); - mp_obj_type_t *type = mp_obj_get_type(message); - if (type != &canio_message_type) { - mp_raise_TypeError_varg(translate("expected '%q' but got '%q'"), MP_QSTR_Message, type->name); - } - common_hal_canio_listener_check_for_deinit(self); - return mp_obj_new_bool(common_hal_canio_listener_readinto(self, message)); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(canio_listener_readinto_obj, canio_listener_readinto); +STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_receive_obj, canio_listener_receive); //| def in_waiting(self) -> int: //| """Returns the number of messages waiting""" @@ -100,7 +84,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_in_waiting_obj, canio_listener_i //| ... //| STATIC mp_obj_t canio_iternext(mp_obj_t self_in) { - mp_obj_t result = canio_listener_read(self_in); + mp_obj_t result = canio_listener_receive(self_in); if (result == mp_const_none) { return MP_OBJ_STOP_ITERATION; } @@ -170,8 +154,7 @@ STATIC const mp_rom_map_elem_t canio_listener_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&canio_listener_exit_obj) }, { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&canio_listener_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR_in_waiting), MP_ROM_PTR(&canio_listener_in_waiting_obj) }, - { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&canio_listener_read_obj) }, - { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&canio_listener_readinto_obj) }, + { MP_ROM_QSTR(MP_QSTR_receive), MP_ROM_PTR(&canio_listener_receive_obj) }, { MP_ROM_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&canio_listener_timeout_obj) }, }; STATIC MP_DEFINE_CONST_DICT(canio_listener_locals_dict, canio_listener_locals_dict_table); diff --git a/shared-bindings/canio/Listener.h b/shared-bindings/canio/Listener.h index eaa3490dff..d925fa2652 100644 --- a/shared-bindings/canio/Listener.h +++ b/shared-bindings/canio/Listener.h @@ -27,5 +27,17 @@ #pragma once #include "py/obj.h" +#include "shared-bindings/canio/CAN.h" +#include "shared-bindings/canio/Match.h" extern const mp_obj_type_t canio_listener_type; + +typedef struct canio_listener_obj canio_listener_obj_t; + +void common_hal_canio_listener_construct(canio_listener_obj_t *self, canio_can_obj_t *can, size_t nmatch, canio_match_obj_t **matches, float timeout); +void common_hal_canio_listener_check_for_deinit(canio_listener_obj_t *self); +void common_hal_canio_listener_deinit(canio_listener_obj_t *self); +bool common_hal_canio_listener_receiveinto(canio_listener_obj_t *self, canio_message_obj_t *message); +int common_hal_canio_listener_in_waiting(canio_listener_obj_t *self); +float common_hal_canio_listener_get_timeout(canio_listener_obj_t *self); +void common_hal_canio_listener_set_timeout(canio_listener_obj_t *self, float timeout); From 8d45be1cd99c6fbfcb69877ab335e010810c54fd Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 24 Sep 2020 15:25:06 -0500 Subject: [PATCH 0995/1293] canio: Split RemoteTransmissionRequest to its own class It reuses most of canio.Message's implementation, and structure --- shared-bindings/canio/CAN.c | 6 +- shared-bindings/canio/Listener.c | 6 +- shared-bindings/canio/Message.c | 138 +++++++++++++++++++------------ shared-bindings/canio/Message.h | 7 +- shared-bindings/canio/__init__.c | 1 + shared-module/canio/Message.c | 10 +-- 6 files changed, 102 insertions(+), 66 deletions(-) diff --git a/shared-bindings/canio/CAN.c b/shared-bindings/canio/CAN.c index ff27bb2048..6b7a3878eb 100644 --- a/shared-bindings/canio/CAN.c +++ b/shared-bindings/canio/CAN.c @@ -265,7 +265,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_can_restart_obj, canio_can_restart); //| //| An empty filter list causes all messages to be accepted. //| -//| Timeout dictates how long readinto, read and next() will block.""" +//| Timeout dictates how long receive() and next() will block.""" //| ... //| STATIC mp_obj_t canio_can_listen(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -334,8 +334,8 @@ STATIC mp_obj_t canio_can_send(mp_obj_t self_in, mp_obj_t message_in) { canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_canio_can_check_for_deinit(self); mp_obj_type_t *message_type = mp_obj_get_type(message_in); - if (message_type != &canio_message_type) { - mp_raise_TypeError_varg(translate("expected '%q' but got '%q'"), MP_QSTR_Message, message_type->name); + if (message_type != &canio_message_type && message_type != &canio_remote_transmission_request_type) { + mp_raise_TypeError_varg(translate("expected '%q' or '%q' but got '%q'"), MP_QSTR_Message, MP_QSTR_RemoteTransmissionRequest, message_type->name); } canio_message_obj_t *message = message_in; diff --git a/shared-bindings/canio/Listener.c b/shared-bindings/canio/Listener.c index 5159c8481f..9f3fe05c5d 100644 --- a/shared-bindings/canio/Listener.c +++ b/shared-bindings/canio/Listener.c @@ -50,9 +50,13 @@ STATIC mp_obj_t canio_listener_receive(mp_obj_t self_in) { common_hal_canio_listener_check_for_deinit(self); canio_message_obj_t *message = m_new_obj(canio_message_obj_t); - message->base.type = &canio_message_type; if (common_hal_canio_listener_receiveinto(self, message)) { + if (message->rtr) { + message->base.type = &canio_remote_transmission_request_type; + } else { + message->base.type = &canio_message_type; + } return message; } else { m_free(message); // message did not escape into vm diff --git a/shared-bindings/canio/Message.c b/shared-bindings/canio/Message.c index 8d1828fba0..ae03c25e76 100644 --- a/shared-bindings/canio/Message.c +++ b/shared-bindings/canio/Message.c @@ -31,28 +31,22 @@ #include "py/runtime.h" //| class Message: -//| def __init__(self, id: int=0, data: Optional[bytes] = None, *, size: Optional[int] = None, rtr: bool = False, extended: bool = False): -//| """Construct a Message to use with a CAN bus. Provide arguments to create a message to send. Otherwise, use Listener.readinto() to read a message. +//| def __init__(self, id: int, data: bytes, *, extended: bool = False): +//| """Construct a Message to send on a CAN bus. //| //| :param int id: The numeric ID of the message //| :param bytes data: The content of the message -//| :param int size: The amount of data requested, for an rtr -//| :param bool rtr: True if the message represents an rtr (Remote Transmission Request) //| :param bool extended: True if the message has an extended identifier, False if it has a standard identifier //| -//| In CAN, messages can have a size from 0 to 8 bytes. -//| -//| For a non-rtr message, specify ``data``. For an rtr-message, specify either ``data`` (a dummy buffer of the requested size) or ``size``. +//| In CAN, messages can have a length from 0 to 8 bytes. //| """ //| ... //| STATIC mp_obj_t canio_message_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_id, ARG_data, ARG_size, ARG_rtr, ARG_extended, NUM_ARGS }; + enum { ARG_id, ARG_data, ARG_extended, NUM_ARGS }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_id, MP_ARG_INT, {.u_obj = 0} }, - { MP_QSTR_data, MP_ARG_OBJ, {.u_obj = 0} }, - { MP_QSTR_size, MP_ARG_INT, {.u_int = -1} }, - { MP_QSTR_rtr, MP_ARG_BOOL, {.u_bool = false} }, + { MP_QSTR_id, MP_ARG_INT | MP_ARG_REQUIRED }, + { MP_QSTR_data, MP_ARG_OBJ | MP_ARG_REQUIRED }, { MP_QSTR_extended, MP_ARG_BOOL, {.u_bool = false} }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; @@ -60,26 +54,8 @@ STATIC mp_obj_t canio_message_make_new(const mp_obj_type_t *type, size_t n_args, mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - bool rtr = args[ARG_rtr].u_bool; - bool extended = args[ARG_extended].u_bool; - size_t size = (size_t)args[ARG_size].u_int; - bool specified_size = (size != (size_t)-1); - bool specified_data = (args[ARG_data].u_obj != NULL); - - if (specified_size && specified_data) { - mp_raise_TypeError(translate("specify size or data, but not both")); - } - mp_buffer_info_t data; - if (specified_data) { - mp_get_buffer_raise(args[ARG_data].u_obj, &data, MP_BUFFER_READ); - } else if (specified_size) { - data.buf = 0; - data.len = size; - } else { - data.buf = 0; - data.len = 0; - } + mp_get_buffer_raise(args[ARG_data].u_obj, &data, MP_BUFFER_READ); if (data.len > 8) { mp_raise_ValueError(translate("Messages limited to 8 bytes")); @@ -87,7 +63,7 @@ STATIC mp_obj_t canio_message_make_new(const mp_obj_type_t *type, size_t n_args, canio_message_obj_t *self = m_new_obj(canio_message_obj_t); self->base.type = &canio_message_type; - common_hal_canio_message_construct(self, args[ARG_id].u_int, data.buf, data.len, rtr, extended); + common_hal_canio_message_construct(self, args[ARG_id].u_int, data.buf, data.len, args[ARG_extended].u_bool); return self; } @@ -115,13 +91,11 @@ STATIC const mp_obj_property_t canio_message_id_obj = { }; //| data: bytes -//| """The content of the message, or dummy content in the case of an rtr. -//| -//| Assigning to data also clears the rtr flag, if it was set.""" +//| """The content of the message""" //| STATIC mp_obj_t canio_message_data_get(const mp_obj_t self_in) { canio_message_obj_t *self = self_in; - return mp_obj_new_bytes((const byte*)common_hal_canio_message_get_data(self), common_hal_canio_message_get_size(self)); + return mp_obj_new_bytes((const byte*)common_hal_canio_message_get_data(self), common_hal_canio_message_get_length(self)); } MP_DEFINE_CONST_FUN_OBJ_1(canio_message_data_get_obj, canio_message_data_get); @@ -147,7 +121,7 @@ STATIC const mp_obj_property_t canio_message_data_obj = { //| extended: bool -//| """True if the message represents a remote transmission request (RTR)""" +//| """True if the message's id is an extended id""" //| STATIC mp_obj_t canio_message_extended_get(const mp_obj_t self_in) { canio_message_obj_t *self = self_in; @@ -170,36 +144,80 @@ STATIC const mp_obj_property_t canio_message_extended_obj = { (mp_obj_t)&mp_const_none_obj}, }; - -//| rtr: bool -//| """True if the message represents a remote transmission request (RTR). Setting rtr to true zeros out data""" +//| class RemoteTransmissionRequest: +//| def __init__(self, id: int, length: int, *, extended: bool = False): +//| """Construct a Message to send on a CAN bus. //| -STATIC mp_obj_t canio_message_rtr_get(const mp_obj_t self_in) { - canio_message_obj_t *self = self_in; - return mp_obj_new_bool(common_hal_canio_message_get_rtr(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(canio_message_rtr_get_obj, canio_message_rtr_get); +//| :param int id: The numeric ID of the requested message +//| :param int length: The length of the requested message +//| :param bool extended: True if the message has an extended identifier, False if it has a standard identifier +//| +//| In CAN, messages can have a length from 0 to 8 bytes. +//| """ +//| ... +//| +STATIC mp_obj_t canio_remote_transmission_request_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_id, ARG_length, ARG_extended, NUM_ARGS }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_id, MP_ARG_INT | MP_ARG_REQUIRED }, + { MP_QSTR_length, MP_ARG_INT | MP_ARG_REQUIRED }, + { MP_QSTR_extended, MP_ARG_BOOL, {.u_bool = false} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); -STATIC mp_obj_t canio_message_rtr_set(const mp_obj_t self_in, const mp_obj_t rtr) { + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + int length = args[ARG_length].u_int; + if (length < 0 || length > 8) { + mp_raise_ValueError(translate("Messages limited to 8 bytes")); + } + + canio_message_obj_t *self = m_new_obj(canio_message_obj_t); + self->base.type = &canio_remote_transmission_request_type; + common_hal_canio_message_construct(self, args[ARG_id].u_int, NULL, length, args[ARG_extended].u_bool); + return self; +} + +//| extended: bool +//| """True if the message's id is an extended id""" +//| + +//| id: int +//| """The numeric ID of the message""" +//| + +//| length: int +//| """The length of the requested message.""" +//| +STATIC mp_obj_t canio_remote_transmission_request_length_get(const mp_obj_t self_in) { canio_message_obj_t *self = self_in; - common_hal_canio_message_set_rtr(self, mp_obj_is_true(rtr)); + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_message_get_length(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_remote_transmission_request_length_get_obj, canio_remote_transmission_request_length_get); + +STATIC mp_obj_t canio_remote_transmission_request_length_set(const mp_obj_t self_in, const mp_obj_t length_in) { + canio_message_obj_t *self = self_in; + int length = mp_obj_get_int(length_in); + if (length < 0 || length > 8) { + mp_raise_ValueError(translate("Messages limited to 8 bytes")); + } + common_hal_canio_remote_transmission_request_set_length(self, length); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_2(canio_message_rtr_set_obj, canio_message_rtr_set); +MP_DEFINE_CONST_FUN_OBJ_2(canio_remote_transmission_request_length_set_obj, canio_remote_transmission_request_length_set); -STATIC const mp_obj_property_t canio_message_rtr_obj = { +STATIC const mp_obj_property_t canio_remote_transmission_request_length_obj = { .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_message_rtr_get_obj, - (mp_obj_t)&canio_message_rtr_set_obj, + .proxy = {(mp_obj_t)&canio_remote_transmission_request_length_get_obj, + (mp_obj_t)&canio_remote_transmission_request_length_set_obj, (mp_obj_t)&mp_const_none_obj}, }; - STATIC const mp_rom_map_elem_t canio_message_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_id), MP_ROM_PTR(&canio_message_id_obj) }, { MP_ROM_QSTR(MP_QSTR_data), MP_ROM_PTR(&canio_message_data_obj) }, - { MP_ROM_QSTR(MP_QSTR_rtr), MP_ROM_PTR(&canio_message_rtr_obj) }, { MP_ROM_QSTR(MP_QSTR_extended), MP_ROM_PTR(&canio_message_extended_obj) }, }; STATIC MP_DEFINE_CONST_DICT(canio_message_locals_dict, canio_message_locals_dict_table); @@ -210,3 +228,17 @@ const mp_obj_type_t canio_message_type = { .make_new = canio_message_make_new, .locals_dict = (mp_obj_t)&canio_message_locals_dict, }; + +STATIC const mp_rom_map_elem_t canio_remote_transmission_request_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_id), MP_ROM_PTR(&canio_message_id_obj) }, + { MP_ROM_QSTR(MP_QSTR_length), MP_ROM_PTR(&canio_remote_transmission_request_length_obj) }, + { MP_ROM_QSTR(MP_QSTR_extended), MP_ROM_PTR(&canio_message_extended_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(canio_remote_transmission_request_locals_dict, canio_remote_transmission_request_locals_dict_table); + +const mp_obj_type_t canio_remote_transmission_request_type = { + { &mp_type_type }, + .name = MP_QSTR_RemoteTransmissionRequest, + .make_new = canio_remote_transmission_request_make_new, + .locals_dict = (mp_obj_t)&canio_remote_transmission_request_locals_dict, +}; diff --git a/shared-bindings/canio/Message.h b/shared-bindings/canio/Message.h index 34b632e847..96716864cf 100644 --- a/shared-bindings/canio/Message.h +++ b/shared-bindings/canio/Message.h @@ -30,8 +30,9 @@ #include "shared-module/canio/Message.h" extern const mp_obj_type_t canio_message_type; +extern const mp_obj_type_t canio_remote_transmission_request_type; -void common_hal_canio_message_construct(canio_message_obj_t *self, int id, void *data, size_t size, bool rtr, bool extended); +void common_hal_canio_message_construct(canio_message_obj_t *self, int id, void *data, size_t size, bool extended); const void *common_hal_canio_message_get_data(const canio_message_obj_t *self); void common_hal_canio_message_set_data(canio_message_obj_t *self, const void *data, size_t size); bool common_hal_canio_message_get_extended(const canio_message_obj_t *self); @@ -40,5 +41,5 @@ int common_hal_canio_message_get_id(const canio_message_obj_t *self); void common_hal_canio_message_set_id(canio_message_obj_t *self, int id); bool common_hal_canio_message_get_rtr(const canio_message_obj_t *self); void common_hal_canio_message_set_rtr(canio_message_obj_t *self, bool rtr); -size_t common_hal_canio_message_get_size(const canio_message_obj_t *self); -void common_hal_canio_message_set_size(canio_message_obj_t *self, size_t size); +size_t common_hal_canio_message_get_length(const canio_message_obj_t *self); +void common_hal_canio_remote_transmission_request_set_length(canio_message_obj_t *self, size_t length); diff --git a/shared-bindings/canio/__init__.c b/shared-bindings/canio/__init__.c index 409cc20cfe..f29d3ab8ac 100644 --- a/shared-bindings/canio/__init__.c +++ b/shared-bindings/canio/__init__.c @@ -113,6 +113,7 @@ STATIC const mp_rom_map_elem_t canio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_Listener), MP_ROM_PTR(&canio_listener_type) }, { MP_ROM_QSTR(MP_QSTR_Match), MP_ROM_PTR(&canio_match_type) }, { MP_ROM_QSTR(MP_QSTR_Message), MP_ROM_PTR(&canio_message_type) }, + { MP_ROM_QSTR(MP_QSTR_RemoteTransmissionRequest), MP_ROM_PTR(&canio_remote_transmission_request_type) }, { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__canio) }, }; diff --git a/shared-module/canio/Message.c b/shared-module/canio/Message.c index b8ebb78596..86a3b71069 100644 --- a/shared-module/canio/Message.c +++ b/shared-module/canio/Message.c @@ -28,16 +28,14 @@ #include -void common_hal_canio_message_construct(canio_message_obj_t *self, int id, void *data, size_t size, bool rtr, bool extended) +void common_hal_canio_message_construct(canio_message_obj_t *self, int id, void *data, size_t size, bool extended) { self->id = id; self->size = size; - self->rtr = rtr; + self->rtr = !data; self->extended = extended; if (data) { memcpy(self->data, data, size); - } else { - memset(self->data, 0, size); } } @@ -65,12 +63,12 @@ const void common_hal_canio_message_set_data(canio_message_obj_t *self, const vo } -size_t common_hal_canio_message_get_size(const canio_message_obj_t *self) +size_t common_hal_canio_message_get_length(const canio_message_obj_t *self) { return self->size; } -void common_hal_canio_message_set_size(canio_message_obj_t *self, size_t size) +void common_hal_canio_remote_transmission_request_set_length(canio_message_obj_t *self, size_t size) { memset(self->data, 0, size); self->size = size; From f4fd5bbfc48c162647705aa68d2dded71a38c959 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 26 Sep 2020 09:46:26 -0500 Subject: [PATCH 0996/1293] canio: docs: fix how we refer to 'the listen method' --- shared-bindings/canio/Listener.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/canio/Listener.c b/shared-bindings/canio/Listener.c index 9f3fe05c5d..1aaa092178 100644 --- a/shared-bindings/canio/Listener.c +++ b/shared-bindings/canio/Listener.c @@ -34,8 +34,8 @@ //| class Listener: //| """Listens for CAN message //| -//| canio.Listener is not constructed directly, but instead by calling the -//| Listen method of a canio.CAN object.""" +//| canio.Listener is not constructed directly, but instead by calling +//| `~canio.CAN.listen`.""" //| //| def receive(self) -> Optional[Message]: From ea2f5b63963f7bf281fad6f2d29b2b673826610e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 26 Sep 2020 10:04:30 -0500 Subject: [PATCH 0997/1293] canio: Correct type annotations of CAN.send, Listener.receive --- shared-bindings/canio/CAN.c | 2 +- shared-bindings/canio/Listener.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/canio/CAN.c b/shared-bindings/canio/CAN.c index 6b7a3878eb..b1fe7d28ba 100644 --- a/shared-bindings/canio/CAN.c +++ b/shared-bindings/canio/CAN.c @@ -324,7 +324,7 @@ STATIC const mp_obj_property_t canio_can_loopback_obj = { }; -//| def send(message: Message) -> None: +//| def send(message: Union[RemoteTransmissionRequest, Message]) -> None: //| """Send a message on the bus with the given data and id. //| If the message could not be sent due to a full fifo or a bus error condition, RuntimeError is raised. //| """ diff --git a/shared-bindings/canio/Listener.c b/shared-bindings/canio/Listener.c index 1aaa092178..7b0e59063c 100644 --- a/shared-bindings/canio/Listener.c +++ b/shared-bindings/canio/Listener.c @@ -38,7 +38,7 @@ //| `~canio.CAN.listen`.""" //| -//| def receive(self) -> Optional[Message]: +//| def receive(self) -> Optional[Union[RemoteTransmissionRequest,Message]]: //| """Reads a message, after waiting up to self.timeout seconds //| //| If no message is received in time, None is returned. Otherwise, From 3e97e9c4be9798c5cd6d4a8a633bdadd3246577c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 26 Sep 2020 09:35:48 -0500 Subject: [PATCH 0998/1293] canio: Listener: shuffle function declarations around --- ports/atmel-samd/common-hal/canio/Listener.c | 1 + ports/atmel-samd/common-hal/canio/Listener.h | 8 -------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/ports/atmel-samd/common-hal/canio/Listener.c b/ports/atmel-samd/common-hal/canio/Listener.c index 7137f806bf..483802fa4a 100644 --- a/ports/atmel-samd/common-hal/canio/Listener.c +++ b/ports/atmel-samd/common-hal/canio/Listener.c @@ -32,6 +32,7 @@ #include "common-hal/canio/__init__.h" #include "common-hal/canio/Listener.h" +#include "shared-bindings/canio/Listener.h" #include "shared-bindings/util.h" #include "supervisor/shared/tick.h" #include "component/can.h" diff --git a/ports/atmel-samd/common-hal/canio/Listener.h b/ports/atmel-samd/common-hal/canio/Listener.h index 10e1a5f8ad..237dca870d 100644 --- a/ports/atmel-samd/common-hal/canio/Listener.h +++ b/ports/atmel-samd/common-hal/canio/Listener.h @@ -43,11 +43,3 @@ typedef struct canio_listener_obj { uint32_t timeout_ms; uint8_t fifo_idx; } canio_listener_obj_t; - -void common_hal_canio_listener_construct(canio_listener_obj_t *self, canio_can_obj_t *can, size_t nmatch, canio_match_obj_t **matches, float timeout); -void common_hal_canio_listener_check_for_deinit(canio_listener_obj_t *self); -void common_hal_canio_listener_deinit(canio_listener_obj_t *self); -bool common_hal_canio_listener_receiveinto(canio_listener_obj_t *self, canio_message_obj_t *message); -int common_hal_canio_listener_in_waiting(canio_listener_obj_t *self); -float common_hal_canio_listener_get_timeout(canio_listener_obj_t *self); -void common_hal_canio_listener_set_timeout(canio_listener_obj_t *self, float timeout); From a4cc3ad6cb75845e0dc75ede97b8287bb1af0317 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 26 Sep 2020 09:44:11 -0500 Subject: [PATCH 0999/1293] canio: RemoteTransmissionRequest: Split implementation, keep one structure This already begins obscuring things, because now there are two sets of shared-module functions for manipulating the same structure, e.g., common_hal_canio_remote_transmission_request_get_id and common_hal_canio_message_get_id --- py/circuitpy_defns.mk | 1 + shared-bindings/canio/Message.c | 85 --------- shared-bindings/canio/Message.h | 2 - .../canio/RemoteTransmissionRequest.c | 164 ++++++++++++++++++ .../canio/RemoteTransmissionRequest.h | 42 +++++ shared-module/canio/Message.c | 20 --- .../canio/RemoteTransmissionRequest.c | 68 ++++++++ .../canio/RemoteTransmissionRequest.h | 33 ++++ 8 files changed, 308 insertions(+), 107 deletions(-) create mode 100644 shared-bindings/canio/RemoteTransmissionRequest.c create mode 100644 shared-bindings/canio/RemoteTransmissionRequest.h create mode 100644 shared-module/canio/RemoteTransmissionRequest.c create mode 100644 shared-module/canio/RemoteTransmissionRequest.h diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 98fa7a5f2c..76c0a4db67 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -411,6 +411,7 @@ SRC_SHARED_MODULE_ALL = \ _bleio/ScanResults.c \ canio/Match.c \ canio/Message.c \ + canio/RemoteTransmissionRequest.c \ _eve/__init__.c \ _pixelbuf/PixelBuf.c \ _pixelbuf/__init__.c \ diff --git a/shared-bindings/canio/Message.c b/shared-bindings/canio/Message.c index ae03c25e76..e47e997c70 100644 --- a/shared-bindings/canio/Message.c +++ b/shared-bindings/canio/Message.c @@ -144,77 +144,6 @@ STATIC const mp_obj_property_t canio_message_extended_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| class RemoteTransmissionRequest: -//| def __init__(self, id: int, length: int, *, extended: bool = False): -//| """Construct a Message to send on a CAN bus. -//| -//| :param int id: The numeric ID of the requested message -//| :param int length: The length of the requested message -//| :param bool extended: True if the message has an extended identifier, False if it has a standard identifier -//| -//| In CAN, messages can have a length from 0 to 8 bytes. -//| """ -//| ... -//| -STATIC mp_obj_t canio_remote_transmission_request_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_id, ARG_length, ARG_extended, NUM_ARGS }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_id, MP_ARG_INT | MP_ARG_REQUIRED }, - { MP_QSTR_length, MP_ARG_INT | MP_ARG_REQUIRED }, - { MP_QSTR_extended, MP_ARG_BOOL, {.u_bool = false} }, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); - - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - - int length = args[ARG_length].u_int; - if (length < 0 || length > 8) { - mp_raise_ValueError(translate("Messages limited to 8 bytes")); - } - - canio_message_obj_t *self = m_new_obj(canio_message_obj_t); - self->base.type = &canio_remote_transmission_request_type; - common_hal_canio_message_construct(self, args[ARG_id].u_int, NULL, length, args[ARG_extended].u_bool); - return self; -} - -//| extended: bool -//| """True if the message's id is an extended id""" -//| - -//| id: int -//| """The numeric ID of the message""" -//| - -//| length: int -//| """The length of the requested message.""" -//| -STATIC mp_obj_t canio_remote_transmission_request_length_get(const mp_obj_t self_in) { - canio_message_obj_t *self = self_in; - return MP_OBJ_NEW_SMALL_INT(common_hal_canio_message_get_length(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(canio_remote_transmission_request_length_get_obj, canio_remote_transmission_request_length_get); - -STATIC mp_obj_t canio_remote_transmission_request_length_set(const mp_obj_t self_in, const mp_obj_t length_in) { - canio_message_obj_t *self = self_in; - int length = mp_obj_get_int(length_in); - if (length < 0 || length > 8) { - mp_raise_ValueError(translate("Messages limited to 8 bytes")); - } - common_hal_canio_remote_transmission_request_set_length(self, length); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_2(canio_remote_transmission_request_length_set_obj, canio_remote_transmission_request_length_set); - - -STATIC const mp_obj_property_t canio_remote_transmission_request_length_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_remote_transmission_request_length_get_obj, - (mp_obj_t)&canio_remote_transmission_request_length_set_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - STATIC const mp_rom_map_elem_t canio_message_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_id), MP_ROM_PTR(&canio_message_id_obj) }, { MP_ROM_QSTR(MP_QSTR_data), MP_ROM_PTR(&canio_message_data_obj) }, @@ -228,17 +157,3 @@ const mp_obj_type_t canio_message_type = { .make_new = canio_message_make_new, .locals_dict = (mp_obj_t)&canio_message_locals_dict, }; - -STATIC const mp_rom_map_elem_t canio_remote_transmission_request_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_id), MP_ROM_PTR(&canio_message_id_obj) }, - { MP_ROM_QSTR(MP_QSTR_length), MP_ROM_PTR(&canio_remote_transmission_request_length_obj) }, - { MP_ROM_QSTR(MP_QSTR_extended), MP_ROM_PTR(&canio_message_extended_obj) }, -}; -STATIC MP_DEFINE_CONST_DICT(canio_remote_transmission_request_locals_dict, canio_remote_transmission_request_locals_dict_table); - -const mp_obj_type_t canio_remote_transmission_request_type = { - { &mp_type_type }, - .name = MP_QSTR_RemoteTransmissionRequest, - .make_new = canio_remote_transmission_request_make_new, - .locals_dict = (mp_obj_t)&canio_remote_transmission_request_locals_dict, -}; diff --git a/shared-bindings/canio/Message.h b/shared-bindings/canio/Message.h index 96716864cf..adcdb095ce 100644 --- a/shared-bindings/canio/Message.h +++ b/shared-bindings/canio/Message.h @@ -39,7 +39,5 @@ bool common_hal_canio_message_get_extended(const canio_message_obj_t *self); void common_hal_canio_message_set_extended(canio_message_obj_t *self, bool extended); int common_hal_canio_message_get_id(const canio_message_obj_t *self); void common_hal_canio_message_set_id(canio_message_obj_t *self, int id); -bool common_hal_canio_message_get_rtr(const canio_message_obj_t *self); -void common_hal_canio_message_set_rtr(canio_message_obj_t *self, bool rtr); size_t common_hal_canio_message_get_length(const canio_message_obj_t *self); void common_hal_canio_remote_transmission_request_set_length(canio_message_obj_t *self, size_t length); diff --git a/shared-bindings/canio/RemoteTransmissionRequest.c b/shared-bindings/canio/RemoteTransmissionRequest.c new file mode 100644 index 0000000000..4e3f674174 --- /dev/null +++ b/shared-bindings/canio/RemoteTransmissionRequest.c @@ -0,0 +1,164 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "shared-bindings/canio/RemoteTransmissionRequest.h" + +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/runtime.h" + +//| class RemoteTransmissionRequest: +//| def __init__(self, id: int, length: int, *, extended: bool = False): +//| """Construct a RemoteTransmissionRequest to send on a CAN bus. +//| +//| :param int id: The numeric ID of the requested message +//| :param int length: The length of the requested message +//| :param bool extended: True if the message has an extended identifier, False if it has a standard identifier +//| +//| In CAN, messages can have a length from 0 to 8 bytes. +//| """ +//| ... +//| +STATIC mp_obj_t canio_remote_transmission_request_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_id, ARG_length, ARG_extended, NUM_ARGS }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_id, MP_ARG_INT | MP_ARG_REQUIRED }, + { MP_QSTR_length, MP_ARG_INT | MP_ARG_REQUIRED }, + { MP_QSTR_extended, MP_ARG_BOOL, {.u_bool = false} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); + + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + int length = args[ARG_length].u_int; + if (length < 0 || length > 8) { + mp_raise_ValueError(translate("RemoteTransmissionRequests limited to 8 bytes")); + } + + canio_remote_transmission_request_obj_t *self = m_new_obj(canio_remote_transmission_request_obj_t); + self->base.type = &canio_remote_transmission_request_type; + common_hal_canio_remote_transmission_request_construct(self, args[ARG_id].u_int, length, args[ARG_extended].u_bool); + return self; +} + + +//| id: int +//| """The numeric ID of the message""" +//| +STATIC mp_obj_t canio_remote_transmission_request_id_get(const mp_obj_t self_in) { + canio_remote_transmission_request_obj_t *self = self_in; + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_remote_transmission_request_get_id(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_remote_transmission_request_id_get_obj, canio_remote_transmission_request_id_get); + +STATIC mp_obj_t canio_remote_transmission_request_id_set(const mp_obj_t self_in, const mp_obj_t id) { + canio_remote_transmission_request_obj_t *self = self_in; + common_hal_canio_remote_transmission_request_set_id(self, mp_obj_get_int(id)); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(canio_remote_transmission_request_id_set_obj, canio_remote_transmission_request_id_set); + +STATIC const mp_obj_property_t canio_remote_transmission_request_id_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_remote_transmission_request_id_get_obj, + (mp_obj_t)&canio_remote_transmission_request_id_set_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| extended: bool +//| """True if the message's id is an extended id""" +//| +STATIC mp_obj_t canio_remote_transmission_request_extended_get(const mp_obj_t self_in) { + canio_remote_transmission_request_obj_t *self = self_in; + return mp_obj_new_bool(common_hal_canio_remote_transmission_request_get_extended(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_remote_transmission_request_extended_get_obj, canio_remote_transmission_request_extended_get); + +STATIC mp_obj_t canio_remote_transmission_request_extended_set(const mp_obj_t self_in, const mp_obj_t extended) { + canio_remote_transmission_request_obj_t *self = self_in; + common_hal_canio_remote_transmission_request_set_extended(self, mp_obj_is_true(extended)); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(canio_remote_transmission_request_extended_set_obj, canio_remote_transmission_request_extended_set); + + +STATIC const mp_obj_property_t canio_remote_transmission_request_extended_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_remote_transmission_request_extended_get_obj, + (mp_obj_t)&canio_remote_transmission_request_extended_set_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| extended: bool +//| """True if the message's id is an extended id""" +//| + +//| id: int +//| """The numeric ID of the message""" +//| + +//| length: int +//| """The length of the requested message.""" +//| +STATIC mp_obj_t canio_remote_transmission_request_length_get(const mp_obj_t self_in) { + canio_remote_transmission_request_obj_t *self = self_in; + return MP_OBJ_NEW_SMALL_INT(common_hal_canio_remote_transmission_request_get_length(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(canio_remote_transmission_request_length_get_obj, canio_remote_transmission_request_length_get); + +STATIC mp_obj_t canio_remote_transmission_request_length_set(const mp_obj_t self_in, const mp_obj_t length_in) { + canio_remote_transmission_request_obj_t *self = self_in; + int length = mp_obj_get_int(length_in); + if (length < 0 || length > 8) { + mp_raise_ValueError(translate("RemoteTransmissionRequests limited to 8 bytes")); + } + common_hal_canio_remote_transmission_request_set_length(self, length); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(canio_remote_transmission_request_length_set_obj, canio_remote_transmission_request_length_set); + + +STATIC const mp_obj_property_t canio_remote_transmission_request_length_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&canio_remote_transmission_request_length_get_obj, + (mp_obj_t)&canio_remote_transmission_request_length_set_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +STATIC const mp_rom_map_elem_t canio_remote_transmission_request_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_id), MP_ROM_PTR(&canio_remote_transmission_request_id_obj) }, + { MP_ROM_QSTR(MP_QSTR_length), MP_ROM_PTR(&canio_remote_transmission_request_length_obj) }, + { MP_ROM_QSTR(MP_QSTR_extended), MP_ROM_PTR(&canio_remote_transmission_request_extended_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(canio_remote_transmission_request_locals_dict, canio_remote_transmission_request_locals_dict_table); + +const mp_obj_type_t canio_remote_transmission_request_type = { + { &mp_type_type }, + .name = MP_QSTR_RemoteTransmissionRequest, + .make_new = canio_remote_transmission_request_make_new, + .locals_dict = (mp_obj_t)&canio_remote_transmission_request_locals_dict, +}; diff --git a/shared-bindings/canio/RemoteTransmissionRequest.h b/shared-bindings/canio/RemoteTransmissionRequest.h new file mode 100644 index 0000000000..8956587b3a --- /dev/null +++ b/shared-bindings/canio/RemoteTransmissionRequest.h @@ -0,0 +1,42 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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" +#include "shared-module/canio/RemoteTransmissionRequest.h" + +extern const mp_obj_type_t canio_remote_transmission_request_type; + +void common_hal_canio_remote_transmission_request_construct(canio_remote_transmission_request_obj_t *self, int id, size_t size, bool extended); +const void *common_hal_canio_remote_transmission_request_get_data(const canio_remote_transmission_request_obj_t *self); +void common_hal_canio_remote_transmission_request_set_data(canio_remote_transmission_request_obj_t *self, const void *data, size_t size); +bool common_hal_canio_remote_transmission_request_get_extended(const canio_remote_transmission_request_obj_t *self); +void common_hal_canio_remote_transmission_request_set_extended(canio_remote_transmission_request_obj_t *self, bool extended); +int common_hal_canio_remote_transmission_request_get_id(const canio_remote_transmission_request_obj_t *self); +void common_hal_canio_remote_transmission_request_set_id(canio_remote_transmission_request_obj_t *self, int id); +size_t common_hal_canio_remote_transmission_request_get_length(const canio_remote_transmission_request_obj_t *self); +void common_hal_canio_remote_transmission_request_set_length(canio_remote_transmission_request_obj_t *self, size_t length); diff --git a/shared-module/canio/Message.c b/shared-module/canio/Message.c index 86a3b71069..34c2e61f76 100644 --- a/shared-module/canio/Message.c +++ b/shared-module/canio/Message.c @@ -68,26 +68,6 @@ size_t common_hal_canio_message_get_length(const canio_message_obj_t *self) return self->size; } -void common_hal_canio_remote_transmission_request_set_length(canio_message_obj_t *self, size_t size) -{ - memset(self->data, 0, size); - self->size = size; -} - - -bool common_hal_canio_message_get_rtr(const canio_message_obj_t *self) -{ - return self->rtr; -} - -void common_hal_canio_message_set_rtr(canio_message_obj_t *self, bool rtr) -{ - self->rtr = rtr; - if (rtr) { - memset(self->data, 0, self->size); - } -} - bool common_hal_canio_message_get_extended(const canio_message_obj_t *self) { return self->extended; diff --git a/shared-module/canio/RemoteTransmissionRequest.c b/shared-module/canio/RemoteTransmissionRequest.c new file mode 100644 index 0000000000..00c9334b0a --- /dev/null +++ b/shared-module/canio/RemoteTransmissionRequest.c @@ -0,0 +1,68 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "shared-module/canio/RemoteTransmissionRequest.h" +#include "shared-bindings/canio/RemoteTransmissionRequest.h" + +#include + +void common_hal_canio_remote_transmission_request_construct(canio_remote_transmission_request_obj_t *self, int id, size_t size, bool extended) +{ + self->id = id; + self->size = size; + self->rtr = true; + self->extended = extended; +} + +int common_hal_canio_remote_transmission_request_get_id(const canio_remote_transmission_request_obj_t *self) +{ + return self->id; +} + +void common_hal_canio_remote_transmission_request_set_id(canio_remote_transmission_request_obj_t *self, int id) +{ + self->id = id; +} + +size_t common_hal_canio_remote_transmission_request_get_length(const canio_remote_transmission_request_obj_t *self) +{ + return self->size; +} + +void common_hal_canio_remote_transmission_request_set_length(canio_remote_transmission_request_obj_t *self, size_t size) +{ + self->size = size; +} + +bool common_hal_canio_remote_transmission_request_get_extended(const canio_remote_transmission_request_obj_t *self) +{ + return self->extended; +} + +void common_hal_canio_remote_transmission_request_set_extended(canio_remote_transmission_request_obj_t *self, bool extended) +{ + self->extended = extended; +} diff --git a/shared-module/canio/RemoteTransmissionRequest.h b/shared-module/canio/RemoteTransmissionRequest.h new file mode 100644 index 0000000000..2f09b19c6f --- /dev/null +++ b/shared-module/canio/RemoteTransmissionRequest.h @@ -0,0 +1,33 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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" + +#include "shared-bindings/canio/Message.h" + +typedef canio_message_obj_t canio_remote_transmission_request_obj_t; From 4f7f1e810681f2956598acced5c09c05695967f9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 28 Sep 2020 15:51:46 -0500 Subject: [PATCH 1000/1293] canio: CAN.listen: rename argument to 'matches', reflecting that it is a sequence --- shared-bindings/canio/CAN.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/shared-bindings/canio/CAN.c b/shared-bindings/canio/CAN.c index b1fe7d28ba..925b248fa6 100644 --- a/shared-bindings/canio/CAN.c +++ b/shared-bindings/canio/CAN.c @@ -252,7 +252,7 @@ STATIC mp_obj_t canio_can_restart(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_can_restart_obj, canio_can_restart); -//| def listen(self, match: Optional[Sequence[Match]]=None, *, timeout: float=10) -> Listener: +//| def listen(self, matches: Optional[Sequence[Match]]=None, *, timeout: float=10) -> Listener: //| """Start receiving messages that match any one of the filters. //| //| Creating a listener is an expensive operation and can interfere with reception of messages by other listeners. @@ -272,9 +272,9 @@ STATIC mp_obj_t canio_can_listen(size_t n_args, const mp_obj_t *pos_args, mp_map canio_can_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); common_hal_canio_can_check_for_deinit(self); - enum { ARG_match, ARG_timeout, NUM_ARGS }; + enum { ARG_matches, ARG_timeout, NUM_ARGS }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_match, MP_ARG_OBJ, {.u_obj = 0} }, + { MP_QSTR_matches, MP_ARG_OBJ, {.u_obj = 0} }, { MP_QSTR_timeout, MP_ARG_OBJ, {.u_obj = 0} }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; @@ -285,8 +285,8 @@ STATIC mp_obj_t canio_can_listen(size_t n_args, const mp_obj_t *pos_args, mp_map size_t nmatch = 0; mp_obj_t *match_objects = NULL; - if (args[ARG_match].u_obj) { - mp_obj_get_array(args[ARG_match].u_obj, &nmatch, &match_objects); + if (args[ARG_matches].u_obj) { + mp_obj_get_array(args[ARG_matches].u_obj, &nmatch, &match_objects); } canio_match_obj_t *matches[nmatch]; From 13493730a15d5c75b50f2568387f2ddc88c412c7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 28 Sep 2020 16:06:54 -0500 Subject: [PATCH 1001/1293] canio: CAN.Match: improve how an unspecified `mask` is implemented 0 should actually indicate a "match everything" filter which you otherwise couldn't indicate with any single Match object, and an all-address-bits-set number should indicate a "match single address" filter. Use an optional/default None argument to do the job. --- shared-bindings/canio/Match.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/shared-bindings/canio/Match.c b/shared-bindings/canio/Match.c index 91a9dd02a3..3fbc1773e8 100644 --- a/shared-bindings/canio/Match.c +++ b/shared-bindings/canio/Match.c @@ -33,10 +33,10 @@ //| """Describe CAN bus messages to match""" //| //| -//| def __init__(self, id: int, *, mask: int = 0, extended: bool = False): +//| def __init__(self, id: int, *, mask: Optional[int] = None, extended: bool = False): //| """Construct a Match with the given properties. //| -//| If mask is nonzero, then the filter is for any id which matches all +//| If mask is not None, then the filter is for any id which matches all //| the nonzero bits in mask. Otherwise, it matches exactly the given id. //| If extended is true then only extended ids are matched, otherwise //| only standard ids are matched.""" @@ -46,7 +46,7 @@ STATIC mp_obj_t canio_match_make_new(const mp_obj_type_t *type, size_t n_args, c enum { ARG_id, ARG_mask, ARG_extended, NUM_ARGS }; static const mp_arg_t allowed_args[] = { { MP_QSTR_id, MP_ARG_INT | MP_ARG_REQUIRED }, - { MP_QSTR_mask, MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_mask, MP_ARG_OBJ, {.u_obj = mp_const_none } }, { MP_QSTR_extended, MP_ARG_BOOL, {.u_bool = false} }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; @@ -56,7 +56,7 @@ STATIC mp_obj_t canio_match_make_new(const mp_obj_type_t *type, size_t n_args, c int id_bits = args[ARG_extended].u_bool ? 0x1fffffff : 0x7ff; int id = args[ARG_id].u_int; - int mask = args[ARG_mask].u_int; + int mask = args[ARG_mask].u_obj == mp_const_none ? id_bits : mp_obj_get_int(args[ARG_mask].u_obj); if (id & ~id_bits) { mp_raise_ValueError_varg(translate("%q out of range"), MP_QSTR_id); @@ -68,7 +68,7 @@ STATIC mp_obj_t canio_match_make_new(const mp_obj_type_t *type, size_t n_args, c canio_match_obj_t *self = m_new_obj(canio_match_obj_t); self->base.type = &canio_match_type; - common_hal_canio_match_construct(self, args[ARG_id].u_int, args[ARG_mask].u_int, args[ARG_extended].u_bool); + common_hal_canio_match_construct(self, id, mask, args[ARG_extended].u_bool); return self; } From f4e36fc7f6719cb938b6e11b3e5242b149600d7d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 28 Sep 2020 17:14:39 -0500 Subject: [PATCH 1002/1293] CAN: Use mp_obj_t insteaed of canio_message_obj_t, get rid of rtr field --- ports/atmel-samd/common-hal/canio/CAN.c | 8 +++++--- ports/atmel-samd/common-hal/canio/Listener.c | 12 +++++++----- shared-bindings/canio/CAN.h | 2 +- shared-bindings/canio/Listener.c | 12 +++--------- shared-bindings/canio/Listener.h | 2 +- shared-module/canio/Message.c | 2 -- shared-module/canio/Message.h | 1 - shared-module/canio/RemoteTransmissionRequest.c | 1 - 8 files changed, 17 insertions(+), 23 deletions(-) diff --git a/ports/atmel-samd/common-hal/canio/CAN.c b/ports/atmel-samd/common-hal/canio/CAN.c index 4f28698fba..ec6b759510 100644 --- a/ports/atmel-samd/common-hal/canio/CAN.c +++ b/ports/atmel-samd/common-hal/canio/CAN.c @@ -328,16 +328,18 @@ static void maybe_auto_restart(canio_can_obj_t *self) { } } -void common_hal_canio_can_send(canio_can_obj_t *self, canio_message_obj_t *message) +void common_hal_canio_can_send(canio_can_obj_t *self, mp_obj_t message_in) { maybe_auto_restart(self); + canio_message_obj_t *message = message_in;; // We have just one dedicated TX buffer, use it! canio_can_tx_buffer_t *ent = &self->state->tx_buffer[0]; + bool rtr = message->base.type == &canio_remote_transmission_request_type; ent->txb0.bit.ESI = false; ent->txb0.bit.XTD = message->extended; - ent->txb0.bit.RTR = message->rtr; + ent->txb0.bit.RTR = rtr; if (message->extended) { ent->txb0.bit.ID = message->id; } else { @@ -350,7 +352,7 @@ void common_hal_canio_can_send(canio_can_obj_t *self, canio_message_obj_t *messa ent->txb1.bit.BRS = 0; // No bit rate switching ent->txb1.bit.DLC = message->size; - if (!message->rtr) { + if (!rtr) { memcpy(ent->data, message->data, message->size); } diff --git a/ports/atmel-samd/common-hal/canio/Listener.c b/ports/atmel-samd/common-hal/canio/Listener.c index 483802fa4a..b27c8cd1b8 100644 --- a/ports/atmel-samd/common-hal/canio/Listener.c +++ b/ports/atmel-samd/common-hal/canio/Listener.c @@ -349,30 +349,32 @@ int common_hal_canio_listener_in_waiting(canio_listener_obj_t *self) { return self->hw->RXFS.bit.F0FL; } -bool common_hal_canio_listener_receiveinto(canio_listener_obj_t *self, canio_message_obj_t *message) { +mp_obj_t common_hal_canio_listener_receive(canio_listener_obj_t *self) { if (!common_hal_canio_listener_in_waiting(self)) { uint64_t deadline = supervisor_ticks_ms64() + self->timeout_ms; do { if (supervisor_ticks_ms64() > deadline) { - return false; + return NULL; } } while (!common_hal_canio_listener_in_waiting(self)); } int index = self->hw->RXFS.bit.F0GI; canio_can_rx_fifo_t *hw_message = &self->fifo[index]; + bool rtr = hw_message->rxf0.bit.RTR; + canio_message_obj_t *message = m_new_obj(canio_message_obj_t); + message->base.type = rtr ? &canio_remote_transmission_request_type : &canio_message_type; message->extended = hw_message->rxf0.bit.XTD; if (message->extended) { message->id = hw_message->rxf0.bit.ID; } else { message->id = hw_message->rxf0.bit.ID >> 18; // short ids are left-justified } - message->rtr = hw_message->rxf0.bit.RTR; message->size = hw_message->rxf1.bit.DLC; - if (!message->rtr) { + if (!rtr) { memcpy(message->data, hw_message->data, message->size); } self->hw->RXFA.bit.F0AI = index; - return true; + return message; } void common_hal_canio_listener_deinit(canio_listener_obj_t *self) { diff --git a/shared-bindings/canio/CAN.h b/shared-bindings/canio/CAN.h index 08166dfd42..8d61bc8ed5 100644 --- a/shared-bindings/canio/CAN.h +++ b/shared-bindings/canio/CAN.h @@ -51,5 +51,5 @@ void common_hal_canio_can_auto_restart_set(canio_can_obj_t *self, bool auto_rest void common_hal_canio_can_check_for_deinit(canio_can_obj_t *self); void common_hal_canio_can_deinit(canio_can_obj_t *self); void common_hal_canio_can_restart(canio_can_obj_t *self); -void common_hal_canio_can_send(canio_can_obj_t *self, canio_message_obj_t *message); +void common_hal_canio_can_send(canio_can_obj_t *self, mp_obj_t message); void common_hal_canio_reset(void); diff --git a/shared-bindings/canio/Listener.c b/shared-bindings/canio/Listener.c index 7b0e59063c..e5a9a2f83f 100644 --- a/shared-bindings/canio/Listener.c +++ b/shared-bindings/canio/Listener.c @@ -49,17 +49,11 @@ STATIC mp_obj_t canio_listener_receive(mp_obj_t self_in) { canio_listener_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_canio_listener_check_for_deinit(self); - canio_message_obj_t *message = m_new_obj(canio_message_obj_t); + mp_obj_t message = common_hal_canio_listener_receive(self); + // note: receive fills out the type field of the message - if (common_hal_canio_listener_receiveinto(self, message)) { - if (message->rtr) { - message->base.type = &canio_remote_transmission_request_type; - } else { - message->base.type = &canio_message_type; - } + if (message) { return message; - } else { - m_free(message); // message did not escape into vm } return mp_const_none; } diff --git a/shared-bindings/canio/Listener.h b/shared-bindings/canio/Listener.h index d925fa2652..527ffe4cbb 100644 --- a/shared-bindings/canio/Listener.h +++ b/shared-bindings/canio/Listener.h @@ -37,7 +37,7 @@ typedef struct canio_listener_obj canio_listener_obj_t; void common_hal_canio_listener_construct(canio_listener_obj_t *self, canio_can_obj_t *can, size_t nmatch, canio_match_obj_t **matches, float timeout); void common_hal_canio_listener_check_for_deinit(canio_listener_obj_t *self); void common_hal_canio_listener_deinit(canio_listener_obj_t *self); -bool common_hal_canio_listener_receiveinto(canio_listener_obj_t *self, canio_message_obj_t *message); +mp_obj_t common_hal_canio_listener_receive(canio_listener_obj_t *self); int common_hal_canio_listener_in_waiting(canio_listener_obj_t *self); float common_hal_canio_listener_get_timeout(canio_listener_obj_t *self); void common_hal_canio_listener_set_timeout(canio_listener_obj_t *self, float timeout); diff --git a/shared-module/canio/Message.c b/shared-module/canio/Message.c index 34c2e61f76..a1df4f693d 100644 --- a/shared-module/canio/Message.c +++ b/shared-module/canio/Message.c @@ -32,7 +32,6 @@ void common_hal_canio_message_construct(canio_message_obj_t *self, int id, void { self->id = id; self->size = size; - self->rtr = !data; self->extended = extended; if (data) { memcpy(self->data, data, size); @@ -57,7 +56,6 @@ const void *common_hal_canio_message_get_data(const canio_message_obj_t *self) const void common_hal_canio_message_set_data(canio_message_obj_t *self, const void *data, size_t size) { - self->rtr = false; self->size = size; memcpy(self->data, data, size); } diff --git a/shared-module/canio/Message.h b/shared-module/canio/Message.h index b99c5c48e3..1ca0d42e2c 100644 --- a/shared-module/canio/Message.h +++ b/shared-module/canio/Message.h @@ -33,6 +33,5 @@ typedef struct { int id; uint8_t data[8]; size_t size:4; - bool rtr:1; bool extended:1; } canio_message_obj_t; diff --git a/shared-module/canio/RemoteTransmissionRequest.c b/shared-module/canio/RemoteTransmissionRequest.c index 00c9334b0a..9b4d5632f8 100644 --- a/shared-module/canio/RemoteTransmissionRequest.c +++ b/shared-module/canio/RemoteTransmissionRequest.c @@ -33,7 +33,6 @@ void common_hal_canio_remote_transmission_request_construct(canio_remote_transmi { self->id = id; self->size = size; - self->rtr = true; self->extended = extended; } From 04e434a7ce89eb756b5e2db8a2ef2f49ef3748ee Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 28 Sep 2020 17:19:28 -0500 Subject: [PATCH 1003/1293] canio: remove stray remote_transmission_request method declaration --- shared-bindings/canio/Message.h | 1 - 1 file changed, 1 deletion(-) diff --git a/shared-bindings/canio/Message.h b/shared-bindings/canio/Message.h index adcdb095ce..b76535939b 100644 --- a/shared-bindings/canio/Message.h +++ b/shared-bindings/canio/Message.h @@ -40,4 +40,3 @@ void common_hal_canio_message_set_extended(canio_message_obj_t *self, bool exten int common_hal_canio_message_get_id(const canio_message_obj_t *self); void common_hal_canio_message_set_id(canio_message_obj_t *self, int id); size_t common_hal_canio_message_get_length(const canio_message_obj_t *self); -void common_hal_canio_remote_transmission_request_set_length(canio_message_obj_t *self, size_t length); From 809225fd1e4bb4370d035e20c65405c02324fea8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 28 Sep 2020 17:22:15 -0500 Subject: [PATCH 1004/1293] make translate --- locale/circuitpython.pot | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 2b395356ca..17a3243272 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-24 16:55-0500\n" +"POT-Creation-Date: 2020-09-28 17:22-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1458,6 +1458,10 @@ msgstr "" msgid "Refresh too soon" msgstr "" +#: shared-bindings/canio/RemoteTransmissionRequest.c +msgid "RemoteTransmissionRequests limited to 8 bytes" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" msgstr "" @@ -2326,10 +2330,14 @@ msgstr "" msgid "exceptions must derive from BaseException" msgstr "" -#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +#: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" msgstr "" +#: shared-bindings/canio/CAN.c +msgid "expected '%q' or '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "" @@ -3167,10 +3175,6 @@ msgstr "" msgid "source palette too large" msgstr "" -#: shared-bindings/canio/Message.c -msgid "specify size or data, but not both" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "" From db74f97e60e58c22e6ce73bd068d9279e3daee57 Mon Sep 17 00:00:00 2001 From: Mark Roberts Date: Mon, 28 Sep 2020 19:10:47 -0400 Subject: [PATCH 1005/1293] modified _stage/__init__.c call to set region to update --- shared-module/_stage/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/_stage/__init__.c b/shared-module/_stage/__init__.c index 0323c32cb9..6dfc188801 100644 --- a/shared-module/_stage/__init__.c +++ b/shared-module/_stage/__init__.c @@ -45,7 +45,7 @@ void render_stage(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, area.y2 = y1; displayio_display_core_set_region_to_update( &display->core, display->set_column_command, display->set_row_command, - NO_COMMAND, NO_COMMAND, display->data_as_commands, false, &area); + NO_COMMAND, NO_COMMAND, display->data_as_commands, false, &area, display->SH1107_addressing); while (!displayio_display_core_begin_transaction(&display->core)) { RUN_BACKGROUND_TASKS; From 66d55738c1315b223d3e5ed6bc710f8b1e443836 Mon Sep 17 00:00:00 2001 From: "Ryan T. Hamilton" Date: Mon, 28 Sep 2020 16:49:20 -0700 Subject: [PATCH 1006/1293] Enable DNS info --- ports/esp32s2/common-hal/wifi/Radio.c | 14 ++++++++++++++ ports/esp32s2/common-hal/wifi/Radio.h | 1 + shared-bindings/wifi/Radio.c | 17 +++++++++++++++++ shared-bindings/wifi/Radio.h | 1 + 4 files changed, 33 insertions(+) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index ab61778595..0184793a1a 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -192,6 +192,20 @@ mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self) { return common_hal_ipaddress_new_ipv4address(self->ip_info.ip.addr); } +mp_obj_t common_hal_wifi_radio_get_ipv4_dns(wifi_radio_obj_t *self) { + if (!esp_netif_is_netif_up(self->netif)) { + return mp_const_none; + } + + esp_netif_get_dns_info(self->netif, ESP_NETIF_DNS_MAIN, &self->dns_info); + + // dns_info is of type esp_netif_dns_info_t, which is just ever so slightly + // different than esp_netif_ip_info_t used for + // common_hal_wifi_radio_get_ipv4_address (includes both ipv4 and 6), + // so some extra jumping is required to get to the actual address + return common_hal_ipaddress_new_ipv4address(self->dns_info.ip.u_addr.ip4.addr); +} + mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address, mp_float_t timeout) { esp_ping_config_t ping_config = ESP_PING_DEFAULT_CONFIG(); ipaddress_ipaddress_to_esp_idf(ip_address, &ping_config.target_addr); diff --git a/ports/esp32s2/common-hal/wifi/Radio.h b/ports/esp32s2/common-hal/wifi/Radio.h index ddcd9dc0d0..7c0cb996d7 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.h +++ b/ports/esp32s2/common-hal/wifi/Radio.h @@ -48,6 +48,7 @@ typedef struct { wifi_config_t sta_config; wifi_ap_record_t ap_info; esp_netif_ip_info_t ip_info; + esp_netif_dns_info_t dns_info; esp_netif_t *netif; bool started; bool ap_mode; diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 6c4e6a4f65..8c556aafe6 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -227,6 +227,22 @@ const mp_obj_property_t wifi_radio_ipv4_address_obj = { (mp_obj_t)&mp_const_none_obj }, }; +//| ipv4_dns: Optional[ipaddress.IPv4Address] +//| """IP v4 Address of the DNS server in use when connected to an access point. None otherwise.""" +//| +STATIC mp_obj_t wifi_radio_get_ipv4_dns(mp_obj_t self) { + return common_hal_wifi_radio_get_ipv4_dns(self); + +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_dns_obj, wifi_radio_get_ipv4_dns); + +const mp_obj_property_t wifi_radio_ipv4_dns_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&wifi_radio_get_ipv4_dns_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + //| def ping(self, ip, *, timeout: float = 0.5) -> float: //| """Ping an IP to test connectivity. Returns echo time in seconds. //| Returns None when it times out.""" @@ -268,6 +284,7 @@ STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = { // { MP_ROM_QSTR(MP_QSTR_connect_to_enterprise), MP_ROM_PTR(&wifi_radio_connect_to_enterprise_obj) }, { MP_ROM_QSTR(MP_QSTR_ap_rssi), MP_ROM_PTR(&wifi_radio_ap_rssi_obj) }, + { MP_ROM_QSTR(MP_QSTR_ipv4_dns), MP_ROM_PTR(&wifi_radio_ipv4_dns_obj) }, { MP_ROM_QSTR(MP_QSTR_ipv4_gateway), MP_ROM_PTR(&wifi_radio_ipv4_gateway_obj) }, { MP_ROM_QSTR(MP_QSTR_ipv4_subnet), MP_ROM_PTR(&wifi_radio_ipv4_subnet_obj) }, { MP_ROM_QSTR(MP_QSTR_ipv4_address), MP_ROM_PTR(&wifi_radio_ipv4_address_obj) }, diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index 3c8ecbebd1..fd0807a86e 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -54,6 +54,7 @@ extern void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) extern 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); extern mp_obj_t common_hal_wifi_radio_get_ap_rssi(wifi_radio_obj_t *self); +extern mp_obj_t common_hal_wifi_radio_get_ipv4_dns(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_gateway(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_subnet(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self); From 726dcdb60aa84b5070e5484a19e896abdaffeb93 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 24 Sep 2020 11:20:32 -0500 Subject: [PATCH 1007/1293] Add some NORETURN attributes I have a function where it should be impossible to reach the end, so I put in a safe-mode reset at the bottom: ``` int find_unused_slot(void) { // precondition: you already verified that a slot was available for (int i=0; i #include +#include "py/mpconfig.h" + // Copied from inc/uf2.h in https://github.com/Microsoft/uf2-samd21 #define DBL_TAP_MAGIC 0xf01669ef // Randomly selected, adjusted to have first and last bit set #define DBL_TAP_MAGIC_QUICK_BOOT 0xf02669ef extern uint32_t _bootloader_dbl_tap; -void reset_to_bootloader(void); -void reset(void); +void reset_to_bootloader(void) NORETURN; +void reset(void) NORETURN; bool bootloader_available(void); #endif // MICROPY_INCLUDED_ATMEL_SAMD_RESET_H diff --git a/ports/cxd56/supervisor/port.c b/ports/cxd56/supervisor/port.c index 6164f74113..92d335cd59 100644 --- a/ports/cxd56/supervisor/port.c +++ b/ports/cxd56/supervisor/port.c @@ -71,6 +71,8 @@ safe_mode_t port_init(void) { void reset_cpu(void) { boardctl(BOARDIOC_RESET, 0); + for (;;) { + } } void reset_port(void) { @@ -91,6 +93,9 @@ void reset_port(void) { } void reset_to_bootloader(void) { + boardctl(BOARDIOC_RESET, 0); + for (;;) { + } } supervisor_allocation* port_fixed_stack(void) { diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 3de63278dc..60331d08e8 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -121,6 +121,7 @@ void reset_to_bootloader(void) { } void reset_cpu(void) { + esp_restart(); } uint32_t *port_heap_get_bottom(void) { diff --git a/ports/litex/supervisor/port.c b/ports/litex/supervisor/port.c index 3125072e60..e55eb49f00 100644 --- a/ports/litex/supervisor/port.c +++ b/ports/litex/supervisor/port.c @@ -85,9 +85,17 @@ void reset_port(void) { void reset_to_bootloader(void) { reboot_ctrl_write(0xac); + for(;;) {} } void reset_cpu(void) { + // "You can reset Fomu by writing a special value to the CSR_REBOOT_CTRL + // register at 0xe0006000L. All writes to this register must start with + // 0xac, to ensure random values aren’t written. We can reboot Fomu by + // simply writing this value" -- + // https://workshop.fomu.im/en/latest/riscv.html + reboot_ctrl_write(0xac); + for(;;) {} } supervisor_allocation* port_fixed_stack(void) { diff --git a/ports/mimxrt10xx/reset.h b/ports/mimxrt10xx/reset.h index dc3106cf07..c7569202c7 100644 --- a/ports/mimxrt10xx/reset.h +++ b/ports/mimxrt10xx/reset.h @@ -34,8 +34,8 @@ #define DBL_TAP_MAGIC 0xf01669ef // Randomly selected, adjusted to have first and last bit set #define DBL_TAP_MAGIC_QUICK_BOOT 0xf02669ef -void reset_to_bootloader(void); -void reset(void); +void reset_to_bootloader(void) NORETURN; +void reset(void) NORETURN; bool bootloader_available(void); #endif // MICROPY_INCLUDED_MIMXRT10XX_RESET_H diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 2945f244db..bc8b47be77 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -234,6 +234,8 @@ void reset_cpu(void) { uint32_t ticks = nrfx_rtc_counter_get(&rtc_instance); overflow_tracker.overflowed_ticks += ticks / 32; NVIC_SystemReset(); + for (;;) { + } } // The uninitialized data section is placed directly after BSS, under the theory diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index e21105001c..bb304a3173 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -56,6 +56,8 @@ #include STM32_HAL_H +void NVIC_SystemReset(void) NORETURN; + #if (CPY_STM32H7) || (CPY_STM32F7) // Device memories must be accessed in order. @@ -247,7 +249,7 @@ void reset_port(void) { } void reset_to_bootloader(void) { - + NVIC_SystemReset(); } void reset_cpu(void) { diff --git a/supervisor/port.h b/supervisor/port.h index ddb96bd524..f5b3c15d14 100644 --- a/supervisor/port.h +++ b/supervisor/port.h @@ -44,7 +44,7 @@ extern uint32_t _ebss; safe_mode_t port_init(void); // Reset the microcontroller completely. -void reset_cpu(void); +void reset_cpu(void) NORETURN; // Reset the microcontroller state. void reset_port(void); @@ -53,7 +53,7 @@ void reset_port(void); void reset_board(void); // Reset to the bootloader -void reset_to_bootloader(void); +void reset_to_bootloader(void) NORETURN; // Get stack limit address uint32_t *port_stack_get_limit(void); diff --git a/supervisor/shared/safe_mode.h b/supervisor/shared/safe_mode.h index 7d3cd63b58..34fc3c8ae1 100644 --- a/supervisor/shared/safe_mode.h +++ b/supervisor/shared/safe_mode.h @@ -27,6 +27,8 @@ #ifndef MICROPY_INCLUDED_SUPERVISOR_SAFE_MODE_H #define MICROPY_INCLUDED_SUPERVISOR_SAFE_MODE_H +#include "py/mpconfig.h" + typedef enum { NO_SAFE_MODE = 0, BROWNOUT, @@ -48,7 +50,7 @@ typedef enum { safe_mode_t wait_for_safe_mode_reset(void); void safe_mode_on_next_reset(safe_mode_t reason); -void reset_into_safe_mode(safe_mode_t reason); +void reset_into_safe_mode(safe_mode_t reason) NORETURN; void print_safe_mode_message(safe_mode_t reason); diff --git a/supervisor/stub/safe_mode.c b/supervisor/stub/safe_mode.c index 8072be2c65..a70ac6b6d0 100644 --- a/supervisor/stub/safe_mode.c +++ b/supervisor/stub/safe_mode.c @@ -26,14 +26,15 @@ #include "supervisor/shared/safe_mode.h" +#include + safe_mode_t wait_for_safe_mode_reset(void) { return NO_SAFE_MODE; } void reset_into_safe_mode(safe_mode_t reason) { (void) reason; - for (;;) { - } + abort(); } void print_safe_mode_message(safe_mode_t reason) { From 1dbb59271c6086fa26088c9672be19bb1f66cdfd Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 25 Sep 2020 13:28:04 -0500 Subject: [PATCH 1008/1293] esp32: Use esp_restart from reset_to_bootloader; redeclare it NORETURN --- ports/esp32s2/supervisor/port.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 60331d08e8..8b41076e1a 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -56,6 +56,8 @@ uint32_t heap_size; STATIC esp_timer_handle_t _tick_timer; +extern void esp_restart(void) NORETURN; + void tick_timer_cb(void* arg) { supervisor_tick(); } @@ -118,6 +120,7 @@ void reset_port(void) { } void reset_to_bootloader(void) { + esp_restart(); } void reset_cpu(void) { From dd6e7f5a8afa9d089e1be7f5a5a8110e0044dbd7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 25 Sep 2020 13:29:58 -0500 Subject: [PATCH 1009/1293] mimxrt10xx: Add required header for NORETURN definition --- ports/mimxrt10xx/reset.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/mimxrt10xx/reset.h b/ports/mimxrt10xx/reset.h index c7569202c7..ea56df02a1 100644 --- a/ports/mimxrt10xx/reset.h +++ b/ports/mimxrt10xx/reset.h @@ -30,6 +30,8 @@ #include #include +#include "py/mpconfig.h" + // Copied from inc/uf2.h in https://github.com/Microsoft/uf2-samd21 #define DBL_TAP_MAGIC 0xf01669ef // Randomly selected, adjusted to have first and last bit set #define DBL_TAP_MAGIC_QUICK_BOOT 0xf02669ef From 2a4a244245e3e03bfb89dcc49e56e83b71291bb2 Mon Sep 17 00:00:00 2001 From: "Ryan T. Hamilton" Date: Mon, 28 Sep 2020 17:25:09 -0700 Subject: [PATCH 1010/1293] Add ap_ssid and ap_bssid --- ports/esp32s2/common-hal/wifi/Radio.c | 39 +++++++++++++++++++++++++-- shared-bindings/wifi/Radio.c | 34 +++++++++++++++++++++++ shared-bindings/wifi/Radio.h | 2 ++ 3 files changed, 73 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index 0184793a1a..019e8316c1 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -38,6 +38,8 @@ #include "esp-idf/components/esp_wifi/include/esp_wifi.h" #include "esp-idf/components/lwip/include/apps/ping/ping_sock.h" +#define MAC_ADDRESS_LENGTH 6 + static void start_station(wifi_radio_obj_t *self) { if (self->sta_mode) { return; @@ -73,8 +75,6 @@ void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled) { } } -#define MAC_ADDRESS_LENGTH 6 - mp_obj_t common_hal_wifi_radio_get_mac_address(wifi_radio_obj_t *self) { uint8_t mac[MAC_ADDRESS_LENGTH]; esp_wifi_get_mac(ESP_IF_WIFI_STA, mac); @@ -168,6 +168,41 @@ mp_obj_t common_hal_wifi_radio_get_ap_rssi(wifi_radio_obj_t *self) { } } +mp_obj_t common_hal_wifi_radio_get_ap_ssid(wifi_radio_obj_t *self) { + if (!esp_netif_is_netif_up(self->netif)) { + return mp_const_none; + } + + // Make sure the interface is in STA mode + if (self->sta_mode){ + return mp_const_none; + } + + if (esp_wifi_sta_get_ap_info(&self->ap_info) != ESP_OK){ + return mp_const_none; + } else { + const char* cstr = (const char*) self->ap_info.ssid; + return mp_obj_new_str(cstr, strlen(cstr)); + } +} + +mp_obj_t common_hal_wifi_radio_get_ap_bssid(wifi_radio_obj_t *self) { + if (!esp_netif_is_netif_up(self->netif)) { + return mp_const_none; + } + + // Make sure the interface is in STA mode + if (self->sta_mode){ + return mp_const_none; + } + + if (esp_wifi_sta_get_ap_info(&self->ap_info) != ESP_OK){ + return mp_const_none; + } else { + return mp_obj_new_bytes(self->ap_info.bssid, MAC_ADDRESS_LENGTH); + } +} + mp_obj_t common_hal_wifi_radio_get_ipv4_gateway(wifi_radio_obj_t *self) { if (!esp_netif_is_netif_up(self->netif)) { return mp_const_none; diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 8c556aafe6..96abadf6ff 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -179,6 +179,38 @@ const mp_obj_property_t wifi_radio_ap_rssi_obj = { (mp_obj_t)&mp_const_none_obj }, }; +//| ap_ssid: int +//| """SSID of the currently connected AP. Returns none if not connected""" +//| +STATIC mp_obj_t wifi_radio_get_ap_ssid(mp_obj_t self) { + return common_hal_wifi_radio_get_ap_ssid(self); + +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ap_ssid_obj, wifi_radio_get_ap_ssid); + +const mp_obj_property_t wifi_radio_ap_ssid_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&wifi_radio_get_ap_ssid_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + +//| ap_bssid: int +//| """BSSID (usually MAC) of the currently connected AP. Returns none if not connected""" +//| +STATIC mp_obj_t wifi_radio_get_ap_bssid(mp_obj_t self) { + return common_hal_wifi_radio_get_ap_bssid(self); + +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ap_bssid_obj, wifi_radio_get_ap_bssid); + +const mp_obj_property_t wifi_radio_ap_bssid_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&wifi_radio_get_ap_bssid_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + //| ipv4_gateway: Optional[ipaddress.IPv4Address] //| """IP v4 Address of the gateway when connected to an access point. None otherwise.""" //| @@ -284,6 +316,8 @@ STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = { // { MP_ROM_QSTR(MP_QSTR_connect_to_enterprise), MP_ROM_PTR(&wifi_radio_connect_to_enterprise_obj) }, { MP_ROM_QSTR(MP_QSTR_ap_rssi), MP_ROM_PTR(&wifi_radio_ap_rssi_obj) }, + { MP_ROM_QSTR(MP_QSTR_ap_ssid), MP_ROM_PTR(&wifi_radio_ap_ssid_obj) }, + { MP_ROM_QSTR(MP_QSTR_ap_bssid), MP_ROM_PTR(&wifi_radio_ap_bssid_obj) }, { MP_ROM_QSTR(MP_QSTR_ipv4_dns), MP_ROM_PTR(&wifi_radio_ipv4_dns_obj) }, { MP_ROM_QSTR(MP_QSTR_ipv4_gateway), MP_ROM_PTR(&wifi_radio_ipv4_gateway_obj) }, { MP_ROM_QSTR(MP_QSTR_ipv4_subnet), MP_ROM_PTR(&wifi_radio_ipv4_subnet_obj) }, diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index fd0807a86e..bf30ac3405 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -54,6 +54,8 @@ extern void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) extern 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); extern mp_obj_t common_hal_wifi_radio_get_ap_rssi(wifi_radio_obj_t *self); +extern mp_obj_t common_hal_wifi_radio_get_ap_ssid(wifi_radio_obj_t *self); +extern mp_obj_t common_hal_wifi_radio_get_ap_bssid(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_dns(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_gateway(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_subnet(wifi_radio_obj_t *self); From 979ec3a458a463d45dfd062e86073ffc2198f82e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 28 Sep 2020 19:47:06 -0500 Subject: [PATCH 1011/1293] can: RemoteTransmissionRequest: remove duplicate docstrings --- shared-bindings/canio/RemoteTransmissionRequest.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/shared-bindings/canio/RemoteTransmissionRequest.c b/shared-bindings/canio/RemoteTransmissionRequest.c index 4e3f674174..d762787b18 100644 --- a/shared-bindings/canio/RemoteTransmissionRequest.c +++ b/shared-bindings/canio/RemoteTransmissionRequest.c @@ -113,14 +113,6 @@ STATIC const mp_obj_property_t canio_remote_transmission_request_extended_obj = (mp_obj_t)&mp_const_none_obj}, }; -//| extended: bool -//| """True if the message's id is an extended id""" -//| - -//| id: int -//| """The numeric ID of the message""" -//| - //| length: int //| """The length of the requested message.""" //| From 03bd968450fe167db7b7bfcffc98461be850dd5e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 28 Sep 2020 19:56:19 -0500 Subject: [PATCH 1012/1293] more doc improvements --- shared-bindings/canio/Listener.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/shared-bindings/canio/Listener.c b/shared-bindings/canio/Listener.c index e5a9a2f83f..5a4df3c46b 100644 --- a/shared-bindings/canio/Listener.c +++ b/shared-bindings/canio/Listener.c @@ -34,15 +34,20 @@ //| class Listener: //| """Listens for CAN message //| -//| canio.Listener is not constructed directly, but instead by calling -//| `~canio.CAN.listen`.""" +//| `canio.Listener` is not constructed directly, but instead by calling +//| `canio.CAN.listen`. +//| +//| In addition to using the `receive` method to retrieve a message or +//| the `in_waiting` method to check for an available message, a +//| listener can be used as an iterable, yielding messages until no +//| message arrives within ``self.timeout`` seconds.""" //| //| def receive(self) -> Optional[Union[RemoteTransmissionRequest,Message]]: -//| """Reads a message, after waiting up to self.timeout seconds +//| """Reads a message, after waiting up to ``self.timeout`` seconds //| -//| If no message is received in time, None is returned. Otherwise, -//| a Message is returned.""" +//| If no message is received in time, `None` is returned. Otherwise, +//| a `Message` or `RemoteTransmissionRequest` is returned.""" //| ... //| STATIC mp_obj_t canio_listener_receive(mp_obj_t self_in) { @@ -60,7 +65,8 @@ STATIC mp_obj_t canio_listener_receive(mp_obj_t self_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_receive_obj, canio_listener_receive); //| def in_waiting(self) -> int: -//| """Returns the number of messages waiting""" +//| """Returns the number of messages (including remote +//| transmission requests) waiting""" //| ... //| STATIC mp_obj_t canio_listener_in_waiting(mp_obj_t self_in) { @@ -70,15 +76,21 @@ STATIC mp_obj_t canio_listener_in_waiting(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_in_waiting_obj, canio_listener_in_waiting); -//| def __iter__(self): -//| """Returns self, unless the object is deinitialized""" +//| def __iter__(self) -> Listener: +//| """Returns self, unless the object is deinitialized. +//| +//| This method exists so that `Listener` can be used as an +//| iterable""" //| ... //| -//| def __next__(self): +//| def __next__(self) -> Union[RemoteTransmissionRequest,Message]: //| """Reads a message, after waiting up to self.timeout seconds //| //| If no message is received in time, raises StopIteration. Otherwise, -//| a Message is returned.""" +//| a Message or is returned. +//| +//| This method enables the `Listener` to be used as an +//| iterable, for instance in a for-loop.""" //| ... //| STATIC mp_obj_t canio_iternext(mp_obj_t self_in) { From 4c7d9e3aafbde08399d9839d6cde968f4d1ae005 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Tue, 29 Sep 2020 11:14:30 +0530 Subject: [PATCH 1013/1293] Update make translate script --- Makefile | 7 +- locale/circuitpython.pot | 139 ++++++++++++++++-- .../circuitplayground_express/mpconfigboard.h | 2 +- .../mpconfigboard.h | 2 +- .../mpconfigboard.h | 2 +- .../boards/escornabot_makech/mpconfigboard.h | 2 +- .../boards/meowmeow/mpconfigboard.h | 2 +- .../electroniccats_bastwifi/mpconfigboard.h | 2 +- .../boards/espressif_kaluga_1/mpconfigboard.h | 2 +- .../espressif_saola_1_wroom/mpconfigboard.h | 2 +- .../espressif_saola_1_wrover/mpconfigboard.h | 2 +- .../boards/microdev_micro_s2/mpconfigboard.h | 2 +- .../muselab_nanoesp32_s2/mpconfigboard.h | 4 + .../unexpectedmaker_feathers2/mpconfigboard.h | 2 +- supervisor/shared/safe_mode.c | 4 +- 15 files changed, 145 insertions(+), 31 deletions(-) diff --git a/Makefile b/Makefile index d016b770fc..e7b2bb0444 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,8 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(BASEOPTS) # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(BASEOPTS) -TRANSLATE_SOURCES = extmod lib main.c ports/atmel-samd ports/cxd56 ports/mimxrt10xx ports/nrf ports/stm py shared-bindings shared-module supervisor +TRANSLATE_SOURCES = extmod lib main.c ports/atmel-samd ports/cxd56 ports/esp32s2 ports/mimxrt10xx ports/nrf ports/stm py shared-bindings shared-module supervisor +TRANSLATE_SOURCES_EXC = -path ports/*/build-* -o -path ports/esp32s2/esp-idf .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext stubs @@ -210,7 +211,7 @@ pseudoxml: all-source: locale/circuitpython.pot: all-source - find $(TRANSLATE_SOURCES) -iname "*.c" -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o circuitpython.pot -p locale + find $(TRANSLATE_SOURCES) -type d \( $(TRANSLATE_SOURCES_EXC) \) -prune -o -type f \( -iname "*.c" -o -iname "*.h" \) -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o circuitpython.pot -p locale # Historically, `make translate` updated the .pot file and ran msgmerge. # However, this was a frequent source of merge conflicts. Weblate can perform @@ -235,7 +236,7 @@ merge-translate: .PHONY: check-translate check-translate: - find $(TRANSLATE_SOURCES) -iname "*.c" -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o circuitpython.pot.tmp -p locale + find $(TRANSLATE_SOURCES) -type d \( $(TRANSLATE_SOURCES_EXC) \) -prune -o -type f \( -iname "*.c" -o -iname "*.h" \) -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o circuitpython.pot.tmp -p locale $(PYTHON) tools/check_translations.py locale/circuitpython.pot.tmp locale/circuitpython.pot; status=$$?; rm -f locale/circuitpython.pot.tmp; exit $$status stubs: diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 2b395356ca..b6de5667e2 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-24 16:55-0500\n" +"POT-Creation-Date: 2020-09-29 11:11+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -280,7 +280,7 @@ msgstr "" msgid "Address type out of range" msgstr "" -#: ports/nrf/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" @@ -288,11 +288,11 @@ msgstr "" msgid "All RX FIFOs in use" msgstr "" -#: ports/nrf/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "" @@ -314,6 +314,9 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c @@ -333,6 +336,10 @@ msgstr "" msgid "Already running" msgstr "" +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "Already scanning for wifi networks" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "" @@ -550,6 +557,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "" @@ -640,14 +648,15 @@ msgid "Could not initialize SDCard" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "" @@ -663,6 +672,10 @@ msgstr "" msgid "Could not restart PWM" msgstr "" +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +msgid "Could not retrieve clock" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" msgstr "" @@ -753,6 +766,10 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" +#: ports/esp32s2/common-hal/busio/SPI.c +msgid "ESP-IDF memory allocation failed" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -810,6 +827,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "" +#: ports/esp32s2/common-hal/socketpool/Socket.c +msgid "Failed SSL handshake" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -826,12 +847,21 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to allocate Wifi memory" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +msgid "Failed to allocate wifi scan memory" +msgstr "" + #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -840,6 +870,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to init wifi" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "" @@ -933,7 +967,7 @@ msgstr "" msgid "Input taking too long" msgstr "" -#: py/moduerrno.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "" @@ -1026,6 +1060,10 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "" @@ -1063,6 +1101,8 @@ msgstr "" #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -1194,21 +1234,25 @@ msgstr "" msgid "No DMA channel found" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" @@ -1251,6 +1295,14 @@ msgstr "" msgid "No long integer support" msgstr "" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more channels available" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more timers available" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1314,6 +1366,14 @@ msgstr "" msgid "Only 8 or 16 bit mono with " msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 SOCK_STREAM sockets supported" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Only IPv4 addresses supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -1331,6 +1391,10 @@ msgstr "" msgid "Only raw int supported for ip" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Out of sockets" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1345,6 +1409,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" @@ -1390,6 +1455,12 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +"instead" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/pulseio/PulseOut.c @@ -1419,12 +1490,13 @@ msgstr "" msgid "RNG Init Error" msgstr "" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c -#: ports/nrf/common-hal/rtc/RTC.c +#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" msgstr "" @@ -1478,7 +1550,7 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "" @@ -1546,6 +1618,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "SocketPool can only be used with wifi.radio" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" msgstr "" @@ -1708,6 +1784,10 @@ msgstr "" msgid "Unable to allocate buffers for signed conversion" msgstr "" +#: ports/esp32s2/common-hal/busio/I2C.c +msgid "Unable to create lock" +msgstr "" + #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" @@ -1734,6 +1814,11 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" +#: ports/esp32s2/common-hal/socketpool/Socket.c +#, c-format +msgid "Unhandled ESP TLS error %d %d %x %d" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "Unknown failure" msgstr "" @@ -1769,7 +1854,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" @@ -2009,6 +2094,7 @@ msgid "byteorder is not a string" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "" @@ -2523,7 +2609,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: py/obj.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -3026,6 +3112,10 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3042,6 +3132,24 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +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 "" + #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -3284,7 +3392,8 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h index 54789f04f9..4321335e59 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h @@ -25,7 +25,7 @@ #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up.\n" +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing both buttons 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 e377275b7a..5673be2909 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h @@ -27,7 +27,7 @@ #define USER_NEOPIXELS_PIN (&pin_PB23) // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up.\n" +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing both buttons 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 cacbed0de7..fab235149d 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h @@ -25,7 +25,7 @@ #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up.\n" +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing both buttons 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/escornabot_makech/mpconfigboard.h b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h index ac1add545a..c4c8c4f3ca 100644 --- a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h +++ b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h @@ -11,7 +11,7 @@ #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up.\n" +#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/atmel-samd/boards/meowmeow/mpconfigboard.h b/ports/atmel-samd/boards/meowmeow/mpconfigboard.h index 79d477cac8..7bbbf33223 100644 --- a/ports/atmel-samd/boards/meowmeow/mpconfigboard.h +++ b/ports/atmel-samd/boards/meowmeow/mpconfigboard.h @@ -11,7 +11,7 @@ #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. -#define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up.\n" +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing both buttons at start up.\n") #define DEFAULT_I2C_BUS_SCL (&pin_PA01) #define DEFAULT_I2C_BUS_SDA (&pin_PA00) diff --git a/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h b/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h index 2af3515f4c..1ec61e9461 100644 --- a/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +++ b/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h @@ -31,6 +31,6 @@ #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) -#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n" +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") #define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h b/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h index a4c8e65762..2c0f175abf 100644 --- a/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +++ b/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h @@ -33,6 +33,6 @@ #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) -#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n" +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") #define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h index 335aaeb5e1..3f628c0f1e 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -33,6 +33,6 @@ #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) -#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n" +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") #define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h index d3ef8bb260..9615228910 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h @@ -33,6 +33,6 @@ #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) -#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n" +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") #define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h index c138c8ed15..b87b5dfa08 100644 --- a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +++ b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h @@ -35,6 +35,6 @@ #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) -#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n" +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") #define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h b/ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h index 5a165deccd..6b05ac06f4 100644 --- a/ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +++ b/ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h @@ -31,4 +31,8 @@ #define MICROPY_HW_NEOPIXEL (&pin_GPIO18) +#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 diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h index a65d00206d..e5fed4e324 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h @@ -31,7 +31,7 @@ #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) -#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n" +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") #define AUTORESET_DELAY_MS 500 diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index 1cf36e4b71..d59e754ed4 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -119,9 +119,9 @@ void print_safe_mode_message(safe_mode_t reason) { #ifdef BOARD_USER_SAFE_MODE_ACTION // Output a user safe mode string if it's set. serial_write_compressed(translate("You requested starting safe mode by ")); - serial_write_compressed(translate(BOARD_USER_SAFE_MODE_ACTION)); + serial_write_compressed(BOARD_USER_SAFE_MODE_ACTION); serial_write_compressed(translate("To exit, please reset the board without ")); - serial_write_compressed(translate(BOARD_USER_SAFE_MODE_ACTION)); + serial_write_compressed(BOARD_USER_SAFE_MODE_ACTION); #else break; #endif From 1bea099eb201526a777f3d30b8a9e017724aaa9d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 29 Sep 2020 14:05:50 -0500 Subject: [PATCH 1014/1293] Allow the _state_count properties to be unimplemented This is the case on the SPI implementations MCP2515 and MCP2518. --- shared-bindings/canio/CAN.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/shared-bindings/canio/CAN.c b/shared-bindings/canio/CAN.c index 925b248fa6..15ce3dc08c 100644 --- a/shared-bindings/canio/CAN.c +++ b/shared-bindings/canio/CAN.c @@ -172,7 +172,12 @@ STATIC const mp_obj_property_t canio_can_receive_error_count_obj = { }; //| error_warning_state_count: int -//| """The number of times the controller enterted the Error Warning state (read-only). This number wraps around to 0 after an implementation-defined number of errors.""" +//| """The number of times the controller enterted the Error Warning +//| state (read-only). This number wraps around to 0 after an +//| implementation-defined number of errors. +//| +//| Not all implementations support this property. If the property +//| is unsupported, AttributeError will be raised.""" //| STATIC mp_obj_t canio_can_error_warning_state_count_get(mp_obj_t self_in) { canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -189,7 +194,12 @@ STATIC const mp_obj_property_t canio_can_error_warning_state_count_obj = { }; //| error_passive_state_count: int -//| """The number of times the controller enterted the Error Passive state (read-only). This number wraps around to 0 after an implementation-defined number of errors.""" +//| """The number of times the controller enterted the Error Passive +//| state (read-only). This number wraps around to 0 after an +//| implementation-defined number of errors. +//| +//| Not all implementations support this property. If the property +//| is unsupported, AttributeError will be raised.""" //| STATIC mp_obj_t canio_can_error_passive_state_count_get(mp_obj_t self_in) { canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -206,7 +216,12 @@ STATIC const mp_obj_property_t canio_can_error_passive_state_count_obj = { }; //| bus_off_state_count: int -//| """The number of times the controller enterted the Bus Off state (read-only). This number wraps around to 0 after an implementation-defined number of errors.""" +//| """The number of times the controller enterted the Bus Off state +//| (read-only). This number wraps around to 0 after an +//| implementation-defined number of errors. +//| +//| Not all implementations support this property. If the property +//| is unsupported, AttributeError will be raised.""" //| STATIC mp_obj_t canio_can_bus_off_state_count_get(mp_obj_t self_in) { canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); From 611f81ac1afce82b74acbe8b282fef5300dac4d9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 29 Sep 2020 14:25:53 -0500 Subject: [PATCH 1015/1293] canio: actually drop the _error_count properties thanks @tannewt --- ports/atmel-samd/common-hal/canio/CAN.c | 26 ---------- shared-bindings/canio/CAN.c | 69 ------------------------- shared-bindings/canio/CAN.h | 3 -- 3 files changed, 98 deletions(-) diff --git a/ports/atmel-samd/common-hal/canio/CAN.c b/ports/atmel-samd/common-hal/canio/CAN.c index ec6b759510..76599a9a7b 100644 --- a/ports/atmel-samd/common-hal/canio/CAN.c +++ b/ports/atmel-samd/common-hal/canio/CAN.c @@ -275,21 +275,6 @@ int common_hal_canio_can_receive_error_count_get(canio_can_obj_t *self) return self->hw->ECR.bit.REC; } -int common_hal_canio_can_error_warning_state_count_get(canio_can_obj_t *self) -{ - return self->error_warning_state_count; -} - -int common_hal_canio_can_error_passive_state_count_get(canio_can_obj_t *self) -{ - return self->error_passive_state_count; -} - -int common_hal_canio_can_bus_off_state_count_get(canio_can_obj_t *self) -{ - return self->bus_off_state_count; -} - canio_bus_state_t common_hal_canio_can_state_get(canio_can_obj_t *self) { CAN_PSR_Type psr = self->hw->PSR; if (psr.bit.BO) { @@ -419,17 +404,6 @@ STATIC void can_handler(int i) { Can *hw = can_insts[i]; uint32_t ir = hri_can_read_IR_reg(hw); - /* Count up errors*/ - if (ir & CAN_IE_EWE) { - self->error_warning_state_count += 1; - } - if (ir & CAN_IE_EPE) { - self->error_passive_state_count += 1; - } - if (ir & CAN_IE_BOE) { - self->bus_off_state_count += 1; - } - /* Acknowledge interrupt */ hri_can_write_IR_reg(hw, ir); } diff --git a/shared-bindings/canio/CAN.c b/shared-bindings/canio/CAN.c index 15ce3dc08c..e8ab15a3c9 100644 --- a/shared-bindings/canio/CAN.c +++ b/shared-bindings/canio/CAN.c @@ -171,72 +171,6 @@ STATIC const mp_obj_property_t canio_can_receive_error_count_obj = { (mp_obj_t)mp_const_none}, }; -//| error_warning_state_count: int -//| """The number of times the controller enterted the Error Warning -//| state (read-only). This number wraps around to 0 after an -//| implementation-defined number of errors. -//| -//| Not all implementations support this property. If the property -//| is unsupported, AttributeError will be raised.""" -//| -STATIC mp_obj_t canio_can_error_warning_state_count_get(mp_obj_t self_in) { - canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_canio_can_check_for_deinit(self); - return MP_OBJ_NEW_SMALL_INT(common_hal_canio_can_error_warning_state_count_get(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(canio_can_error_warning_state_count_get_obj, canio_can_error_warning_state_count_get); - -STATIC const mp_obj_property_t canio_can_error_warning_state_count_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_can_error_warning_state_count_get_obj, - (mp_obj_t)mp_const_none, - (mp_obj_t)mp_const_none}, -}; - -//| error_passive_state_count: int -//| """The number of times the controller enterted the Error Passive -//| state (read-only). This number wraps around to 0 after an -//| implementation-defined number of errors. -//| -//| Not all implementations support this property. If the property -//| is unsupported, AttributeError will be raised.""" -//| -STATIC mp_obj_t canio_can_error_passive_state_count_get(mp_obj_t self_in) { - canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_canio_can_check_for_deinit(self); - return MP_OBJ_NEW_SMALL_INT(common_hal_canio_can_error_passive_state_count_get(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(canio_can_error_passive_state_count_get_obj, canio_can_error_passive_state_count_get); - -STATIC const mp_obj_property_t canio_can_error_passive_state_count_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_can_error_passive_state_count_get_obj, - (mp_obj_t)mp_const_none, - (mp_obj_t)mp_const_none}, -}; - -//| bus_off_state_count: int -//| """The number of times the controller enterted the Bus Off state -//| (read-only). This number wraps around to 0 after an -//| implementation-defined number of errors. -//| -//| Not all implementations support this property. If the property -//| is unsupported, AttributeError will be raised.""" -//| -STATIC mp_obj_t canio_can_bus_off_state_count_get(mp_obj_t self_in) { - canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_canio_can_check_for_deinit(self); - return MP_OBJ_NEW_SMALL_INT(common_hal_canio_can_bus_off_state_count_get(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(canio_can_bus_off_state_count_get_obj, canio_can_bus_off_state_count_get); - -STATIC const mp_obj_property_t canio_can_bus_off_state_count_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_can_bus_off_state_count_get_obj, - (mp_obj_t)mp_const_none, - (mp_obj_t)mp_const_none}, -}; - //| state: State //| """The current state of the bus.""" STATIC mp_obj_t canio_can_state_get(mp_obj_t self_in) { @@ -414,10 +348,7 @@ STATIC const mp_rom_map_elem_t canio_can_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&canio_can_exit_obj) }, { MP_ROM_QSTR(MP_QSTR_auto_restart), MP_ROM_PTR(&canio_can_auto_restart_obj) }, { MP_ROM_QSTR(MP_QSTR_baudrate), MP_ROM_PTR(&canio_can_baudrate_obj) }, - { MP_ROM_QSTR(MP_QSTR_bus_off_state_count), MP_ROM_PTR(&canio_can_bus_off_state_count_obj) }, { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&canio_can_deinit_obj) }, - { MP_ROM_QSTR(MP_QSTR_error_passive_state_count), MP_ROM_PTR(&canio_can_error_passive_state_count_obj) }, - { MP_ROM_QSTR(MP_QSTR_error_warning_state_count), MP_ROM_PTR(&canio_can_error_warning_state_count_obj) }, { MP_ROM_QSTR(MP_QSTR_listen), MP_ROM_PTR(&canio_can_listen_obj) }, { MP_ROM_QSTR(MP_QSTR_loopback), MP_ROM_PTR(&canio_can_loopback_obj) }, { MP_ROM_QSTR(MP_QSTR_receive_error_count), MP_ROM_PTR(&canio_can_receive_error_count_obj) }, diff --git a/shared-bindings/canio/CAN.h b/shared-bindings/canio/CAN.h index 8d61bc8ed5..968b71f14c 100644 --- a/shared-bindings/canio/CAN.h +++ b/shared-bindings/canio/CAN.h @@ -39,9 +39,6 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *tx, mc bool common_hal_canio_can_auto_restart_get(canio_can_obj_t *self); bool common_hal_canio_can_deinited(canio_can_obj_t *self); int common_hal_canio_can_baudrate_get(canio_can_obj_t *self); -int common_hal_canio_can_bus_off_state_count_get(canio_can_obj_t *self); -int common_hal_canio_can_error_passive_state_count_get(canio_can_obj_t *self); -int common_hal_canio_can_error_warning_state_count_get(canio_can_obj_t *self); bool common_hal_canio_can_loopback_get(canio_can_obj_t *self); int common_hal_canio_can_receive_error_count_get(canio_can_obj_t *self); canio_bus_state_t common_hal_canio_can_state_get(canio_can_obj_t *self); From d79f4e26621681d80e72a614ca8f2210ac4ca02f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 29 Sep 2020 14:32:27 -0500 Subject: [PATCH 1016/1293] canio: doc improvement -- don't needlessly call out deinit behavior --- shared-bindings/canio/Listener.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/canio/Listener.c b/shared-bindings/canio/Listener.c index 5a4df3c46b..93552af814 100644 --- a/shared-bindings/canio/Listener.c +++ b/shared-bindings/canio/Listener.c @@ -77,7 +77,7 @@ STATIC mp_obj_t canio_listener_in_waiting(mp_obj_t self_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_in_waiting_obj, canio_listener_in_waiting); //| def __iter__(self) -> Listener: -//| """Returns self, unless the object is deinitialized. +//| """Returns self //| //| This method exists so that `Listener` can be used as an //| iterable""" From c1ac0eed2f7ed70b37ae337e2fe7658c93e0a0d3 Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Fri, 25 Sep 2020 00:46:21 +0000 Subject: [PATCH 1017/1293] Translated using Weblate (Spanish) Currently translated at 100.0% (807 of 807 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/locale/es.po b/locale/es.po index a1be03bfc1..74002ed4ab 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-21 16:45-0500\n" -"PO-Revision-Date: 2020-09-18 23:14+0000\n" +"PO-Revision-Date: 2020-09-25 18:20+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" @@ -101,7 +101,7 @@ msgstr "%q debe ser una tupla de longitud 2" #: shared-bindings/canio/Match.c msgid "%q out of range" -msgstr "" +msgstr "%q fuera de rango" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" @@ -293,7 +293,7 @@ msgstr "Todos los periféricos I2C están siendo usados" #: ports/atmel-samd/common-hal/canio/Listener.c msgid "All RX FIFOs in use" -msgstr "" +msgstr "Todos los FIFOs de RX en uso" #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" @@ -335,7 +335,7 @@ msgstr "Ya se encuentra publicando." #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Already have all-matches listener" -msgstr "" +msgstr "Ya se tiene un escucha todas-las-coincidencias" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c @@ -878,7 +878,7 @@ msgstr "El archivo ya existe" #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Filters too complex" -msgstr "" +msgstr "Filtros muy complejos" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" @@ -1000,7 +1000,7 @@ msgstr "Archivo BMP inválido" #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" -msgstr "" +msgstr "BSSID inválido" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" @@ -1167,7 +1167,7 @@ msgstr "Valor máximo de x cuando se refleja es %d" #: shared-bindings/canio/Message.c msgid "Messages limited to 8 bytes" -msgstr "" +msgstr "Mensajes limitados a 8 bytes" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." @@ -2399,7 +2399,7 @@ msgstr "las excepciones deben derivar de BaseException" #: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c msgid "expected '%q' but got '%q'" -msgstr "" +msgstr "se espera '%q' pero se recibe '%q'" #: py/objstr.c msgid "expected ':' after format specifier" @@ -3248,7 +3248,7 @@ msgstr "paleta fuente muy larga" #: shared-bindings/canio/Message.c msgid "specify size or data, but not both" -msgstr "" +msgstr "especifique o tamaño o datos, pero no ambos" #: py/objstr.c msgid "start/end indices" From 88749fce64ae1d52cdc982eb6a308914df5e1c84 Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Thu, 24 Sep 2020 13:55:22 +0000 Subject: [PATCH 1018/1293] Translated using Weblate (Japanese) Currently translated at 73.2% (591 of 807 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ja/ --- locale/ja.po | 310 +++++++++++++++++++++++++-------------------------- 1 file changed, 150 insertions(+), 160 deletions(-) diff --git a/locale/ja.po b/locale/ja.po index 6bc29b069f..5931e978bf 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -8,15 +8,15 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-21 16:45-0500\n" -"PO-Revision-Date: 2020-09-01 18:44+0000\n" -"Last-Translator: Jeff Epler \n" +"PO-Revision-Date: 2020-09-25 18:20+0000\n" +"Last-Translator: Taku Fukada \n" "Language-Team: none\n" "Language: ja\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.2.1-dev\n" +"X-Generator: Weblate 4.3-dev\n" #: main.c msgid "" @@ -60,7 +60,7 @@ msgstr "" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" -msgstr "" +msgstr "%q 失敗: %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -76,11 +76,11 @@ msgstr "%q インデックスは範囲外" #: py/obj.c msgid "%q indices must be integers, not %q" -msgstr "%qインデクスは、%qでなく整数が必要" +msgstr "%q インデクスは %q でなく整数でなければなりません" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "%q のリストはリスト型でなければなりません" +msgstr "%q リストはリストでなければなりません" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" @@ -100,7 +100,7 @@ msgstr "%qは長さ2のタプルでなければなりません" #: shared-bindings/canio/Match.c msgid "%q out of range" -msgstr "" +msgstr "%q が範囲外" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" @@ -108,16 +108,15 @@ msgstr "%q ピンは無効" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" -msgstr "%qはint型が必要" +msgstr "%qはint型でなければなりません" #: py/bc.c py/objnamedtuple.c -#, fuzzy msgid "%q() takes %d positional arguments but %d were given" -msgstr "%q()は%d個の位置引数を受け取りますが、%d個しか与えられていません" +msgstr "%q() は %d 個の位置引数を取りますが、%d 個与えられました" #: py/argcheck.c msgid "'%q' argument required" -msgstr "引数 '%q' が必要" +msgstr "'%q' 引数が必要" #: py/runtime.c msgid "'%q' object cannot assign attribute '%q'" @@ -125,15 +124,15 @@ msgstr "オブジェクト'%q'に属性'%q'を割り当てられません" #: py/proto.c msgid "'%q' object does not support '%q'" -msgstr "オブジェクト'%q'は'%q'をサポートしていません" +msgstr "'%q' オブジェクトは '%q' に対応していません" #: py/obj.c msgid "'%q' object does not support item assignment" -msgstr "オブジェクト'%q'は要素の代入をサポートしていません" +msgstr "'%q' オブジェクトは要素の代入に対応していません" #: py/obj.c msgid "'%q' object does not support item deletion" -msgstr "オブジェクト'%q'は要素の削除をサポートしていません" +msgstr "'%q' オブジェクトは要素の削除に対応していません" #: py/runtime.c msgid "'%q' object has no attribute '%q'" @@ -158,7 +157,7 @@ msgstr "オブジェクト'%q'は要素の取得ができません" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" -msgstr "" +msgstr "'%s' にはラベルが必要" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -259,7 +258,7 @@ msgstr "関数外でのyield" #: py/compile.c msgid "*x must be assignment target" -msgstr "" +msgstr "*xは代入先でなければなりません" #: py/obj.c msgid ", in %q\n" @@ -267,11 +266,11 @@ msgstr "" #: py/objcomplex.c msgid "0.0 to a complex power" -msgstr "" +msgstr "0.0を複素数でべき乗" #: py/modbuiltins.c msgid "3-arg pow() not supported" -msgstr "引数3つのpow()はサポートされていません" +msgstr "引数3つのpow()は非対応" #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -285,7 +284,7 @@ msgstr "アドレスは、%dバイト長でなければなりません" #: shared-bindings/_bleio/Address.c msgid "Address type out of range" -msgstr "" +msgstr "address_typeが範囲外" #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" @@ -293,7 +292,7 @@ msgstr "全てのI2C周辺機器が使用中" #: ports/atmel-samd/common-hal/canio/Listener.c msgid "All RX FIFOs in use" -msgstr "" +msgstr "全てのRX FIFOが使用中" #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" @@ -348,15 +347,15 @@ msgstr "指定のピンはAnalogInに対応していません" #: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c #: ports/nrf/common-hal/analogio/AnalogOut.c msgid "AnalogOut functionality not supported" -msgstr "AnalogOut機能はサポートされていません" +msgstr "AnalogOut機能に対応していません" #: shared-bindings/analogio/AnalogOut.c msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOutは16ビットです。値は65536以下にしてください" +msgstr "AnalogOutは16ビットです。値は65536以下でなければなりません" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c msgid "AnalogOut not supported on given pin" -msgstr "指定のピンはAnalogOutをサポートしていません" +msgstr "指定のピンはAnalogOutに対応していません" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c @@ -382,11 +381,11 @@ msgstr "%d個のブロックの確保を試みました" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." -msgstr "MicroPython VM 非実行時にヒープの確保を試みました" +msgstr "MicroPython VMの非実行時にヒープ確保を試みました" #: shared-bindings/wifi/Radio.c msgid "Authentication failure" -msgstr "" +msgstr "認証失敗" #: main.c msgid "Auto-reload is off.\n" @@ -407,7 +406,7 @@ msgstr "最低のフレームレート未満" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" -msgstr "" +msgstr "bit clockとword selectはクロックユニットを共有しなければなりません" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." @@ -439,17 +438,17 @@ msgstr "Brightnessは調整可能ではありません" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "" +msgstr "buffer + offsetが小さすぎます %d %d %d" #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." -msgstr "バッファサイズが正しくありません。%dバイトでなければなりません" +msgstr "バッファサイズが不正です。%dバイトでなければなりません" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "バッファが bytearray ではありません" +msgstr "バッファがbytearrayではありません" #: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c @@ -468,7 +467,7 @@ msgstr "バッファ長は512の倍数でなければなりません" #: ports/stm/common-hal/sdioio/SDCard.c msgid "Buffer must be a multiple of 512 bytes" -msgstr "" +msgstr "バッファは512の倍数でなければなりません" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -481,7 +480,7 @@ msgstr "バッファが大きすぎて確保できません" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "" +msgstr "バッファが %d バイト足りません" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -491,7 +490,7 @@ msgstr "Busピン%dはすでに使用中" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." -msgstr "バッファは16バイトにしてください" +msgstr "バッファは16バイトでなければなりません" #: shared-bindings/nvm/ByteArray.c msgid "Bytes must be between 0 and 255." @@ -513,7 +512,7 @@ msgstr "ローカルのCharacteristicにはCCCDを設定できません" #: shared-bindings/_bleio/Adapter.c msgid "Cannot create a new Adapter; use _bleio.adapter;" -msgstr "" +msgstr "Adapterは作成できません。_bleio.adapterを使用してください。" #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c @@ -555,11 +554,11 @@ msgstr "USBがアクティブの時に'/'を再マウントできません" #: 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 "ブートローダが存在しないためブートローダへとリセットできません" #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." -msgstr "方向がINPUTのときは値を設定できません" +msgstr "方向がinputのときは値を設定できません" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" @@ -603,15 +602,15 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "CircuitPython was unable to allocate the heap.\n" -msgstr "" +msgstr "CircuitPythonはヒープを確保できませんでした\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." -msgstr "クロックピンの初期化に失敗" +msgstr "クロックピン初期化に失敗" #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" -msgstr "" +msgstr "クロックのストレッチが長すぎ" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Clock unit in use" @@ -630,7 +629,7 @@ msgstr "commandは0から255の間の整数でなければなりません" msgid "" "Connection has been disconnected and can no longer be used. Create a new " "connection." -msgstr "接続は切断済みのためもう使えません。新たな接続を作成してください" +msgstr "接続は切断済みでもう使えません。新しい接続を作成してください" #: py/persistentcode.c msgid "Corrupt .mpy file" @@ -642,7 +641,7 @@ msgstr "破損したraw code" #: ports/cxd56/common-hal/camera/Camera.c msgid "Could not initialize Camera" -msgstr "" +msgstr "カメラを初期化できません" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" @@ -737,7 +736,7 @@ msgstr "データが、アドバタイズメントパケットには大きすぎ #: shared-bindings/audiobusio/PDMIn.c msgid "Destination capacity is smaller than destination_length." -msgstr "" +msgstr "宛先バッファがdestination_lengthより小さい" #: ports/nrf/common-hal/audiobusio/I2SOut.c msgid "Device in use" @@ -745,12 +744,12 @@ msgstr "デバイス使用中" #: ports/cxd56/common-hal/digitalio/DigitalInOut.c msgid "DigitalInOut not supported on given pin" -msgstr "指定されたピンはDigitalInOutをサポートしていません" +msgstr "指定されたピンはDigitalInOutに対応していません" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." -msgstr "ディスプレイには16ビット色空間が必要" +msgstr "ディスプレイは16ビット色空間を持たなければなりません" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c @@ -760,7 +759,7 @@ msgstr "ディスプレイの回転は90度の倍数でなければなりませ #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." -msgstr "方向がINPUTのときドライブモードは使われません" +msgstr "方向がinputのときドライブモードは使われません" #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" @@ -825,7 +824,7 @@ msgstr "FFTはndarrayでのみ使えます" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." -msgstr "コマンドの送信に失敗" +msgstr "コマンド送信に失敗" #: ports/nrf/sd_mutex.c #, c-format @@ -864,7 +863,7 @@ msgstr "ミューテックスの開放に失敗。エラー 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "内部フラッシュの書き込みに失敗" +msgstr "内部フラッシュ書き込みに失敗" #: py/moduerrno.c msgid "File exists" @@ -876,7 +875,7 @@ msgstr "" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" -msgstr "" +msgstr "非対応の形式" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format @@ -936,9 +935,7 @@ msgstr "IVは%dバイト長でなければなりません" msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." -msgstr "" -"非互換の.mpyファイルです。全ての.mpyファイルを更新してください。詳細は " -"http://adafru.it/mpy-update を参照" +msgstr "非互換の.mpyファイル。全.mpyファイルを更新してください。詳細は http://adafru.it/mpy-update を参照" #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" @@ -1031,7 +1028,7 @@ msgstr "不正なチャンネル数" #: shared-bindings/digitalio/DigitalInOut.c msgid "Invalid direction." -msgstr "不正な入出力方向" +msgstr "不正な方向" #: shared-module/audiocore/WaveFile.c msgid "Invalid file" @@ -1099,7 +1096,7 @@ msgstr "不正なプロパティ" #: shared-bindings/microcontroller/__init__.c msgid "Invalid run mode." -msgstr "不正なRun Mode" +msgstr "不正なrun mode" #: shared-module/_bleio/Attribute.c msgid "Invalid security_mode" @@ -1131,11 +1128,11 @@ msgstr "キーワード引数の左辺には識別子が必要" #: shared-module/displayio/Group.c msgid "Layer already in a group." -msgstr "レイヤーはすでにグループに含まれています" +msgstr "レイヤはすでにグループに含まれています" #: shared-module/displayio/Group.c msgid "Layer must be a Group or TileGrid subclass." -msgstr "レイヤーはGroupかTileGridのサブクラスでなければなりません" +msgstr "レイヤはGroupかTileGridのサブクラスでなければなりません" #: py/objslice.c msgid "Length must be an int" @@ -1147,11 +1144,11 @@ msgstr "Lengthは非負数でなければなりません" #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." -msgstr "MISOピンの初期化に失敗" +msgstr "MISOピン初期化に失敗" #: shared-module/bitbangio/SPI.c msgid "MOSI pin init failed." -msgstr "MOSIピンの初期化に失敗" +msgstr "MOSIピン初期化に失敗" #: shared-module/displayio/Shape.c #, c-format @@ -1164,11 +1161,11 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." -msgstr "MicroPythonのNLRジャンプに失敗。メモリ破壊の可能性あり" +msgstr "MicroPython NLRジャンプ失敗。メモリ破壊の可能性あり" #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error." -msgstr "MicroPythonの致命的エラー" +msgstr "MicroPython致命的エラー" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -1255,12 +1252,12 @@ msgstr "利用可能なハードウェア乱数なし" #: ports/atmel-samd/common-hal/ps2io/Ps2.c msgid "No hardware support on clk pin" -msgstr "clkピン上にハードウェアサポートがありません" +msgstr "clkピンにハードウェア対応がありません" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "No hardware support on pin" -msgstr "ピン上のハードウェアサポートがありません" +msgstr "ピンにハードウェア対応がありません" #: shared-bindings/aesio/aes.c msgid "No key was specified" @@ -1268,11 +1265,11 @@ msgstr "キーが指定されていません" #: shared-bindings/time/__init__.c msgid "No long integer support" -msgstr "long integerサポートがありません" +msgstr "long integerに対応していません" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." -msgstr "このピンに利用可能なタイマーがもうありません" +msgstr "このピンには使えるタイマーがもうありません" #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" @@ -1300,7 +1297,7 @@ msgstr "" #: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c msgid "Not a valid IP string" -msgstr "" +msgstr "不正なIP文字列です" #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -1323,17 +1320,15 @@ msgstr "" #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." -msgstr "" -"オブジェクトは解体済みでもう使われていません。新たなオブジェクトを作成してく" -"ださい" +msgstr "オブジェクトは解放済みでもう使われていません。新しいオブジェクトを作成してください" #: ports/nrf/common-hal/busio/UART.c msgid "Odd parity is not supported" -msgstr "奇数パリティはサポートされていません" +msgstr "奇数パリティには対応していません" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " -msgstr "8または16ビットの" +msgstr "8または16ビットの " #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1354,7 +1349,7 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." -msgstr "オーバーサンプルは8の倍数が必要" +msgstr "オーバーサンプルは8の倍数でなければなりません" #: shared-bindings/pwmio/PWMOut.c msgid "" @@ -1365,12 +1360,12 @@ msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." -msgstr "PWM周波数は、生成時のvariable_frequencyがFalseのとき書き換え不可" +msgstr "PWM周波数は生成時のvariable_frequencyがFalseのとき書き換え不可" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" -msgstr "ParallelBusはまだサポートされていません" +msgstr "ParallelBusにはまだ対応していません" #: py/moduerrno.c msgid "Permission denied" @@ -1390,7 +1385,7 @@ msgstr "ピンは入力専用" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" -msgstr "ピンはハードウェア割り込みをサポートしていなければなりません" +msgstr "ピンはハードウェア割り込みに対応していなければなりません" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" @@ -1426,9 +1421,8 @@ msgid "Prefix buffer must be on the heap" msgstr "Prefixバッファはヒープ上になければなりません" #: main.c -#, fuzzy msgid "Press any key to enter the REPL. Use CTRL-D to reload." -msgstr "いずれかのキーを押すとREPLに入ります。リロードはCTRL-D" +msgstr "何らかのキーを押すとREPLに入ります。CTRL-Dでリロード。" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." @@ -1453,12 +1447,12 @@ msgstr "このボードはRTCのキャリブレーションに非対応" #: shared-bindings/time/__init__.c msgid "RTC is not supported on this board" -msgstr "このボードではRTCがサポートされていません" +msgstr "このボードはRTCに対応していません" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "RTS/CTS/RS485はこのデバイスでは未サポート" +msgstr "RTS/CTS/RS485はこのデバイスでは未対応" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" @@ -1483,11 +1477,11 @@ msgstr "リフレッシュが早すぎます" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" -msgstr "要求のAESモードは非サポート" +msgstr "要求のAESモードは非対応" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" -msgstr "右チャネルはサポートされていません" +msgstr "右チャネルは非対応" #: shared-bindings/_pew/PewPew.c msgid "Row entry must be digitalio.DigitalInOut" @@ -1499,7 +1493,7 @@ msgstr "セーフモードで実行中! " #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" -msgstr "SDカードのCSDフォーマットは非サポート" +msgstr "SDカードのCSDフォーマットは非対応" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c @@ -1526,7 +1520,7 @@ msgstr "SPI再初期化エラー" #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" -msgstr "サンプルレートには正の数が必要" +msgstr "サンプルレートは正数でなければなりません" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #, c-format @@ -1535,7 +1529,7 @@ msgstr "サンプルレートは%d以下でなければなりません" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." -msgstr "スキャンはすでに進行中。stop_scanで停止してください" +msgstr "既にスキャン進行中。stop_scanで停止してください" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" @@ -1567,11 +1561,11 @@ msgstr "スライスと値の長さが一致しません" #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" -msgstr "スライスはサポートされていません" +msgstr "スライスは対応していません" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "" +msgstr "バッファ (元/先) は同じ長さでなければなりません" #: extmod/modure.c msgid "Splitting with sub-captures" @@ -1579,11 +1573,11 @@ msgstr "" #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" -msgstr "スタックサイズは少なくとも256以上が必要" +msgstr "スタックサイズは少なくとも256以上でなければなりません" #: shared-bindings/multiterminal/__init__.c msgid "Stream missing readinto() or write() method." -msgstr "streamにreadinto()またはwrite()メソッドがありません" +msgstr "ストリームにreadinto()またはwrite()メソッドがありません" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" @@ -1591,7 +1585,7 @@ msgstr "少なくとも1つのUARTピンが必要" #: shared-bindings/gnss/GNSS.c msgid "System entry must be gnss.SatelliteSystem" -msgstr "" +msgstr "system引数はgnss.SatelliteSystemでなければなりません" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" @@ -1614,15 +1608,13 @@ msgstr "" "ドを抜けるにはリセットを押します。\n" #: supervisor/shared/safe_mode.c -#, fuzzy msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" -"マイクロコントローラの電力が降下しました。電源が回路全体が求める十分な電力を" -"供給できることを確認してリセットを押してください(CIRCUITPYを取り出した" -"後)。\n" +"マイコンの電力が降下しました。使っている電源が十分な電力を回路に供給することを確認し (CIRCUITPYを取り出してから) リセットを押してください。" +"\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1699,9 +1691,8 @@ msgid "UART Buffer allocation error" msgstr "UARTバッファの確保エラー" #: ports/stm/common-hal/busio/UART.c -#, fuzzy msgid "UART De-init error" -msgstr "UARTの解体エラー" +msgstr "UART解放エラー" #: ports/stm/common-hal/busio/UART.c msgid "UART Init Error" @@ -1761,7 +1752,7 @@ msgstr "カラーパレットデータを読み込めません" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." -msgstr "nvm に書き込みできません" +msgstr "nvmに書き込みできません" #: ports/nrf/common-hal/_bleio/UUID.c msgid "Unexpected nrfx uuid type" @@ -1804,7 +1795,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" -msgstr "非サポートのbaudrate" +msgstr "非対応のbaudrate" #: shared-module/displayio/display_core.c msgid "Unsupported display bus type" @@ -1812,15 +1803,15 @@ msgstr "" #: shared-module/audiocore/WaveFile.c msgid "Unsupported format" -msgstr "サポートされていないフォーマット" +msgstr "非対応の形式" #: py/moduerrno.c msgid "Unsupported operation" -msgstr "サポートされていない操作" +msgstr "非対応の操作" #: shared-bindings/digitalio/DigitalInOut.c msgid "Unsupported pull value." -msgstr "サポートされていないpull値" +msgstr "非対応のpull値" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -1858,7 +1849,7 @@ msgstr "WatchDogTimer.modeはいったんWatchDogMode.RESETに設定すると変 #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" +msgstr "WatchDogTimer.timeoutは0以上でなければなりません" #: supervisor/shared/safe_mode.c msgid "Watchdog timer expired." @@ -1876,7 +1867,7 @@ msgstr "" #: shared-bindings/wifi/Radio.c msgid "WiFi password must be between 8 and 63 characters" -msgstr "" +msgstr "WiFiパスワードは8〜63文字でなければなりません" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" @@ -1900,7 +1891,7 @@ msgstr "" #: py/objobject.c msgid "__new__ arg must be a user-type" -msgstr "" +msgstr "__new__の引数はユーザ型でなければなりません" #: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c msgid "a bytes-like object is required" @@ -1933,7 +1924,7 @@ msgstr "" #: extmod/ulab/code/numerical/numerical.c msgid "argsort argument must be an ndarray" -msgstr "" +msgstr "argsortの引数はndarrayでなければなりません" #: py/runtime.c msgid "argument has wrong type" @@ -1941,7 +1932,7 @@ msgstr "" #: extmod/ulab/code/linalg/linalg.c msgid "argument must be ndarray" -msgstr "" +msgstr "引数はndarrayでなければなりません" #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c @@ -1954,7 +1945,7 @@ msgstr "引数には '%q' が必要('%q' ではなく)" #: extmod/ulab/code/linalg/linalg.c msgid "arguments must be ndarrays" -msgstr "" +msgstr "引数はndarrayでなければなりません" #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -1966,7 +1957,7 @@ msgstr "" #: py/objstr.c msgid "attributes not supported yet" -msgstr "属性はまだサポートされていません" +msgstr "属性は未対応です" #: extmod/ulab/code/numerical/numerical.c msgid "axis must be -1, 0, None, or 1" @@ -2002,11 +1993,11 @@ msgstr "" #: shared-bindings/busio/UART.c msgid "bits must be 7, 8 or 9" -msgstr "bitsは7, 8, 9のいずれかが必要" +msgstr "bitsは7, 8, 9のいずれかでなければなりません" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" -msgstr "" +msgstr "bits_per_sampleは8または16でなければなりません" #: py/emitinlinethumb.c msgid "branch not in range" @@ -2014,7 +2005,7 @@ msgstr "" #: shared-bindings/audiocore/RawSample.c msgid "buffer must be a bytes-like object" -msgstr "" +msgstr "バッファはbytes-likeオブジェクトでなければなりません" #: shared-module/struct/__init__.c msgid "buffer size must match format" @@ -2022,7 +2013,7 @@ msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "buffer slices must be of equal length" -msgstr "" +msgstr "バッファのスライスは同じ長さでなければなりません" #: py/modstruct.c shared-bindings/struct/__init__.c #: shared-module/struct/__init__.c @@ -2031,7 +2022,7 @@ msgstr "" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" -msgstr "" +msgstr "buttonsはdigitalio.DigitalInOutでなければなりません" #: py/vm.c msgid "byte code not implemented" @@ -2218,7 +2209,7 @@ msgstr "" #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" -msgstr "" +msgstr "色バッファは3バイト (RGB) か4バイト (RGB + pad byte) でなければなりません" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a buffer, tuple, list, or int" @@ -2226,7 +2217,7 @@ msgstr "カラーバッファはbuffer, tuple, list, int のいずれかです" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a bytearray or array of type 'b' or 'B'" -msgstr "" +msgstr "色バッファは、bytearrayまたはタイプが 'b' か 'B' のarrayでなければなりません" #: shared-bindings/displayio/Palette.c msgid "color must be between 0x000000 and 0xffffff" @@ -2250,7 +2241,7 @@ msgstr "圧縮ヘッダー" #: py/parse.c msgid "constant must be an integer" -msgstr "" +msgstr "定数は整数でなければなりません" #: py/emitnative.c msgid "conversion to object" @@ -2262,7 +2253,7 @@ msgstr "convolve引数には1次元arrayが必要" #: extmod/ulab/code/filter/filter.c msgid "convolve arguments must be ndarrays" -msgstr "convolve引数にはndarrayが必要" +msgstr "convolve引数はndarrayでなければなりません" #: extmod/ulab/code/filter/filter.c msgid "convolve arguments must not be empty" @@ -2282,11 +2273,11 @@ msgstr "" #: extmod/ulab/code/approx/approx.c msgid "data must be iterable" -msgstr "" +msgstr "dataはイテレート可能でなければなりません" #: extmod/ulab/code/approx/approx.c msgid "data must be of equal length" -msgstr "" +msgstr "dataは同じ長さでなければなりません" #: extmod/ulab/code/numerical/numerical.c msgid "ddof must be smaller than length of data set" @@ -2303,15 +2294,15 @@ msgstr "デフォルトのexceptは最後に置く必要があります" #: shared-bindings/audiobusio/PDMIn.c msgid "" "destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" -msgstr "" +msgstr "bit_depth = 8のとき、宛先バッファはbytearrayまたはタイプ'B'のarrayでなければなりません" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" -msgstr "bit_depath = 16 用のバッファにはタイプ'H'のarrayが必要" +msgstr "bit_depath = 16用のバッファはタイプ'H'のarrayでなければなりません" #: shared-bindings/audiobusio/PDMIn.c msgid "destination_length must be an int >= 0" -msgstr "desitination_lengthには正の整数が必要" +msgstr "desitination_lengthは正の整数でなければなりません" #: py/objdict.c msgid "dict update sequence has wrong length" @@ -2319,7 +2310,7 @@ msgstr "" #: extmod/ulab/code/numerical/numerical.c msgid "diff argument must be an ndarray" -msgstr "引数にはndarrayが必要" +msgstr "引数はndarrayでなければなりません" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c @@ -2397,15 +2388,15 @@ msgstr "余分な位置引数が与えられました" #: py/parse.c msgid "f-string expression part cannot include a '#'" -msgstr "" +msgstr "f-文字列の表現部は '#' を持てません" #: py/parse.c msgid "f-string expression part cannot include a backslash" -msgstr "" +msgstr "f-文字列の表現部はバックスラッシュを持てません" #: py/parse.c msgid "f-string: empty expression not allowed" -msgstr "" +msgstr "f-文字列: 空の表現は許されません" #: py/parse.c msgid "f-string: expecting '}'" @@ -2418,11 +2409,11 @@ msgstr "f-string: 1つだけの'}'は許されません" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" -msgstr "fileにはバイトモードで開かれたファイルが必要" +msgstr "fileはバイトモードで開かれたファイルでなければなりません" #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" -msgstr "filesystemにはmountメソッドが必要" +msgstr "filesystemはmountメソッドを提供しなければなりません" #: extmod/ulab/code/vector/vectorise.c msgid "first argument must be a callable" @@ -2438,11 +2429,11 @@ msgstr "1つ目の引数はイテレート可能でなければなりません" #: extmod/ulab/code/vector/vectorise.c msgid "first argument must be an ndarray" -msgstr "1つ目の引数にはndarrayが必要" +msgstr "1つ目の引数はndarrayでなければなりません" #: py/objtype.c msgid "first argument to super() must be type" -msgstr "" +msgstr "superの第1引数は型でなければなりません" #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" @@ -2458,7 +2449,7 @@ msgstr "floatの値が大きすぎます" #: shared-bindings/_stage/Text.c msgid "font must be 2048 bytes long" -msgstr "" +msgstr "fontは2048バイト長でなければなりません" #: py/objstr.c msgid "format requires a dict" @@ -2495,7 +2486,6 @@ msgid "function missing %d required positional arguments" msgstr "" #: py/bc.c -#, fuzzy msgid "function missing keyword-only argument" msgstr "キーワード専用引数が足りません" @@ -2527,7 +2517,7 @@ msgstr "" #: shared-bindings/_stage/Layer.c msgid "graphic must be 2048 bytes long" -msgstr "" +msgstr "graphicは2048バイトでなければなりません" #: extmod/moduheapq.c msgid "heap must be a list" @@ -2604,7 +2594,7 @@ msgstr "入力が非正則行列" #: extmod/ulab/code/linalg/linalg.c msgid "input must be square matrix" -msgstr "" +msgstr "入力は正方行列でなければなりません" #: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" @@ -2682,11 +2672,11 @@ msgstr "数字として不正な構文" #: py/objtype.c msgid "issubclass() arg 1 must be a class" -msgstr "issubclass()の第1引数はクラスが必要" +msgstr "issubclass()の第1引数はクラスでなければなりません" #: py/objtype.c msgid "issubclass() arg 2 must be a class or a tuple of classes" -msgstr "" +msgstr "issubclass()の第2引数はクラスかクラスのタプルでなければなりません" #: extmod/ulab/code/ndarray.c msgid "iterables are not of the same length" @@ -2698,11 +2688,11 @@ msgstr "収束しません" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" -msgstr "joinには、str/bytes(のうち自身と一致した型の)リストが必要" +msgstr "joinには str/bytes (のうち自身と一致した型の) リストが必要" #: py/argcheck.c msgid "keyword argument(s) not yet implemented - use normal args instead" -msgstr "キーワード引数はまだ実装されていません。通常の引数を使ってください。" +msgstr "キーワード引数は未実装。通常の引数を使ってください" #: py/bc.c msgid "keywords must be strings" @@ -2742,7 +2732,7 @@ msgstr "" #: py/objint.c msgid "long int not supported in this build" -msgstr "このビルドはlong intをサポートしていません" +msgstr "このビルドはlong intに非対応" #: py/parse.c msgid "malformed f-string" @@ -2772,7 +2762,7 @@ msgstr "" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "max_length must be > 0" -msgstr "" +msgstr "max_lengthは0より大きくなければなりません" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -2805,7 +2795,7 @@ msgstr "" #: py/objtype.c msgid "multiple inheritance not supported" -msgstr "複数継承は非サポート" +msgstr "複数継承には対応していません" #: py/emitnative.c msgid "must raise an object" @@ -2907,7 +2897,7 @@ msgstr "128ビットのUUIDではありません" #: py/objstr.c msgid "not all arguments converted during string formatting" -msgstr "" +msgstr "文字列書式化で全ての引数が使われていません" #: py/objstr.c msgid "not enough arguments for format string" @@ -2927,11 +2917,11 @@ msgstr "オブジェクト'%q'がタプルやリストでありません" #: py/obj.c msgid "object does not support item assignment" -msgstr "オブジェクトは要素の代入をサポートしていません" +msgstr "オブジェクトは要素の代入に対応していません" #: py/obj.c msgid "object does not support item deletion" -msgstr "オブジェクトは要素の削除をサポートしていません" +msgstr "オブジェクトは要素の削除に対応していません" #: py/obj.c msgid "object has no len" @@ -2939,7 +2929,7 @@ msgstr "オブジェクトがlenを持っていません" #: py/obj.c msgid "object is not subscriptable" -msgstr "オブジェクトは要素の取得をサポートしていません" +msgstr "オブジェクトは要素の取得に対応していません" #: py/runtime.c msgid "object not an iterator" @@ -2975,7 +2965,7 @@ msgstr "" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" -msgstr "bit_depth=16のみサポートしています" +msgstr "bit_depth=16のみ対応しています" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" @@ -2997,7 +2987,7 @@ msgstr "この演算はndarray上で実装されていません" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" -msgstr "この演算は与えられた型をサポートしていません" +msgstr "演算は与えられた型に対応していません" #: py/modbuiltins.c msgid "ord expects a character" @@ -3055,7 +3045,7 @@ msgstr "" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" -msgstr "" +msgstr "pixel_shaderはdisplayio.Paletteかdisplayio.ColorConverterのどちらかでなければなりません" #: shared-module/vectorio/Polygon.c msgid "polygon can only be registered in one parent" @@ -3141,7 +3131,7 @@ msgstr "スケジュールスタックが一杯" #: lib/utils/pyexec.c py/builtinimport.c msgid "script compilation not supported" -msgstr "スクリプトのコンパイルは非サポート" +msgstr "スクリプトのコンパイルは非対応" #: extmod/ulab/code/ndarray.c msgid "shape must be a 2-tuple" @@ -3217,7 +3207,7 @@ msgstr "" #: shared-bindings/random/__init__.c msgid "step must be non-zero" -msgstr "stepは非ゼロ値が必要" +msgstr "stepは非ゼロ値でなければなりません" #: shared-bindings/busio/UART.c msgid "stop must be 1 or 2" @@ -3229,11 +3219,11 @@ msgstr "" #: py/stream.c msgid "stream operation not supported" -msgstr "ストリーム操作はサポートされていません" +msgstr "ストリーム操作は非対応" #: py/objstrunicode.c msgid "string indices must be integers, not %q" -msgstr "文字列のインデクスには整数が必要(%qでなく)" +msgstr "文字列のインデクスは整数でなければなりません (%qでなく)" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3273,15 +3263,15 @@ msgstr "time.struct_time()は9要素のシーケンスを受け取ります" #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" -msgstr "タイムアウト長がサポートされる最大値を超えています" +msgstr "タイムアウト長は対応する最大値を超えています" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" -msgstr "" +msgstr "timeoutは0.0〜100.0秒でなければなりません" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" -msgstr "timeoutは0.0以上が必要" +msgstr "timeoutは0.0以上でなければなりません" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" @@ -3397,7 +3387,7 @@ msgstr "読み込み不可能な属性" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c #: shared-module/vectorio/Polygon.c msgid "unsupported %q type" -msgstr "サポートされない型 %q" +msgstr "非対応の型 %q" #: py/emitinlinethumb.c #, c-format @@ -3416,15 +3406,15 @@ msgstr "" #: py/runtime.c msgid "unsupported type for %q: '%q'" -msgstr "%qがサポートしていない型: '%q'" +msgstr "%q が対応していない型: '%q'" #: py/runtime.c msgid "unsupported type for operator" -msgstr "演算子がサポートしていない型" +msgstr "演算子が対応していない型" #: py/runtime.c msgid "unsupported types for %q: '%q', '%q'" -msgstr "%qでサポートされない型: '%q', '%q'" +msgstr "%q が対応していない型: '%q', '%q'" #: py/objint.c #, c-format @@ -3433,7 +3423,7 @@ msgstr "値は%dバイトに収まらなければなりません" #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" -msgstr "" +msgstr "value_countは0より大きくなければなりません" #: extmod/ulab/code/linalg/linalg.c msgid "vectors must have same lengths" @@ -3441,11 +3431,11 @@ msgstr "" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" -msgstr "" +msgstr "watchdogのtimeoutは0以上でなければなりません" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" -msgstr "" +msgstr "windowはinterval以下でなければなりません" #: extmod/ulab/code/linalg/linalg.c msgid "wrong argument type" @@ -3481,7 +3471,7 @@ msgstr "" #: shared-bindings/displayio/Shape.c msgid "y should be an int" -msgstr "yは整数が必要" +msgstr "yは整数でなければなりません" #: shared-module/displayio/Shape.c msgid "y value out of bounds" @@ -3497,7 +3487,7 @@ msgstr "ziはndarrayでなければなりません" #: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" -msgstr "ziはfloat値が必要" +msgstr "ziはfloat値でなければなりません" #: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" From 38f12185aa0b6963b2364bf675e6309c7cad1d19 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Sat, 26 Sep 2020 19:37:55 +0200 Subject: [PATCH 1019/1293] 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 | 8 ++------ locale/cs.po | 8 ++------ locale/de_DE.po | 8 ++------ locale/el.po | 8 ++------ locale/es.po | 11 +++++------ locale/fil.po | 8 ++------ locale/fr.po | 11 +++++------ locale/hi.po | 8 ++------ locale/it_IT.po | 8 ++------ locale/ja.po | 37 +++++++++++++++++++++++-------------- locale/ko.po | 8 ++------ locale/nl.po | 11 +++++------ locale/pl.po | 11 +++++------ locale/pt_BR.po | 11 +++++------ locale/sv.po | 11 +++++------ locale/zh_Latn_pinyin.po | 11 +++++------ 16 files changed, 74 insertions(+), 104 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index bce444da2e..42247dae47 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-24 16:55-0500\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -1188,14 +1188,10 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/cs.po b/locale/cs.po index f96a054118..88186b8231 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-24 16:55-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -1171,14 +1171,10 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/de_DE.po b/locale/de_DE.po index 81d24c818c..1fd1861095 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-24 16:55-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -1190,14 +1190,10 @@ msgstr "Fehlender MISO- oder MOSI-Pin" msgid "Must be a %q subclass." msgstr "Muss eine %q Unterklasse sein." -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "Muss MISO- oder MOSI-Pin bereitstellen" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/el.po b/locale/el.po index 1f830deb42..6732ddfdc5 100644 --- a/locale/el.po +++ b/locale/el.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-24 16:55-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -1166,14 +1166,10 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/es.po b/locale/es.po index 74002ed4ab..69a5f05946 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-24 16:55-0500\n" "PO-Revision-Date: 2020-09-25 18:20+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -1189,14 +1189,10 @@ msgstr "Falta el pin MISO o MOSI" msgid "Must be a %q subclass." msgstr "Debe de ser una subclase de %q." -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "Debe proporcionar un pin MISO o MOSI" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "Debes proveer un pin para SCK" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" @@ -3547,6 +3543,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 "Must provide SCK pin" +#~ msgstr "Debes proveer un pin para SCK" + #~ msgid "" #~ "\n" #~ "To exit, please reset the board without " diff --git a/locale/fil.po b/locale/fil.po index a53dd4c6a0..0b8ead16d1 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-24 16:55-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -1181,14 +1181,10 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/fr.po b/locale/fr.po index 31881c873b..bea085d1e3 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-24 16:55-0500\n" "PO-Revision-Date: 2020-09-16 13:47+0000\n" "Last-Translator: Hugo Dahl \n" "Language: fr\n" @@ -1194,14 +1194,10 @@ msgstr "Broche MISO ou MOSI manquante" msgid "Must be a %q subclass." msgstr "Doit être une sous-classe de %q." -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "Doit fournir une broche MISO ou MOSI" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "Vous devez fournir un code PIN SCK" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" @@ -3567,6 +3563,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "Must provide SCK pin" +#~ msgstr "Vous devez fournir un code PIN SCK" + #~ msgid "" #~ "\n" #~ "To exit, please reset the board without " diff --git a/locale/hi.po b/locale/hi.po index c6fbe49fd5..137e44eed3 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-24 16:55-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -1166,14 +1166,10 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/it_IT.po b/locale/it_IT.po index 94c7f1f847..537c6effd9 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-24 16:55-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -1185,14 +1185,10 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/ja.po b/locale/ja.po index 5931e978bf..bf53151ad5 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-24 16:55-0500\n" "PO-Revision-Date: 2020-09-25 18:20+0000\n" "Last-Translator: Taku Fukada \n" "Language-Team: none\n" @@ -935,7 +935,9 @@ msgstr "IVは%dバイト長でなければなりません" msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." -msgstr "非互換の.mpyファイル。全.mpyファイルを更新してください。詳細は http://adafru.it/mpy-update を参照" +msgstr "" +"非互換の.mpyファイル。全.mpyファイルを更新してください。詳細は http://adafru." +"it/mpy-update を参照" #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" @@ -1179,14 +1181,10 @@ msgstr "MISOまたはMOSIピンがありません" msgid "Must be a %q subclass." msgstr "%q のサブクラスでなければなりません" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "MISOピンまたはMOSIピンが必要" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "SCKピンが必要" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" @@ -1320,7 +1318,9 @@ msgstr "" #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." -msgstr "オブジェクトは解放済みでもう使われていません。新しいオブジェクトを作成してください" +msgstr "" +"オブジェクトは解放済みでもう使われていません。新しいオブジェクトを作成してく" +"ださい" #: ports/nrf/common-hal/busio/UART.c msgid "Odd parity is not supported" @@ -1613,8 +1613,8 @@ msgid "" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" -"マイコンの電力が降下しました。使っている電源が十分な電力を回路に供給することを確認し (CIRCUITPYを取り出してから) リセットを押してください。" -"\n" +"マイコンの電力が降下しました。使っている電源が十分な電力を回路に供給すること" +"を確認し (CIRCUITPYを取り出してから) リセットを押してください。\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -2209,7 +2209,8 @@ msgstr "" #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" -msgstr "色バッファは3バイト (RGB) か4バイト (RGB + pad byte) でなければなりません" +msgstr "" +"色バッファは3バイト (RGB) か4バイト (RGB + pad byte) でなければなりません" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a buffer, tuple, list, or int" @@ -2217,7 +2218,8 @@ msgstr "カラーバッファはbuffer, tuple, list, int のいずれかです" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a bytearray or array of type 'b' or 'B'" -msgstr "色バッファは、bytearrayまたはタイプが 'b' か 'B' のarrayでなければなりません" +msgstr "" +"色バッファは、bytearrayまたはタイプが 'b' か 'B' のarrayでなければなりません" #: shared-bindings/displayio/Palette.c msgid "color must be between 0x000000 and 0xffffff" @@ -2294,7 +2296,9 @@ msgstr "デフォルトのexceptは最後に置く必要があります" #: shared-bindings/audiobusio/PDMIn.c msgid "" "destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" -msgstr "bit_depth = 8のとき、宛先バッファはbytearrayまたはタイプ'B'のarrayでなければなりません" +msgstr "" +"bit_depth = 8のとき、宛先バッファはbytearrayまたはタイプ'B'のarrayでなければ" +"なりません" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" @@ -3045,7 +3049,9 @@ msgstr "" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" -msgstr "pixel_shaderはdisplayio.Paletteかdisplayio.ColorConverterのどちらかでなければなりません" +msgstr "" +"pixel_shaderはdisplayio.Paletteかdisplayio.ColorConverterのどちらかでなければ" +"なりません" #: shared-module/vectorio/Polygon.c msgid "polygon can only be registered in one parent" @@ -3493,6 +3499,9 @@ msgstr "ziはfloat値でなければなりません" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "Must provide SCK pin" +#~ msgstr "SCKピンが必要" + #~ msgid "" #~ "\n" #~ "To exit, please reset the board without " diff --git a/locale/ko.po b/locale/ko.po index e2214b2bf5..f5ac77e906 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-24 16:55-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -1169,14 +1169,10 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" diff --git a/locale/nl.po b/locale/nl.po index 567734f19f..d9468c7b9e 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-24 16:55-0500\n" "PO-Revision-Date: 2020-09-09 16:05+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -1183,14 +1183,10 @@ msgstr "Ontbrekende MISO of MOSI Pin" msgid "Must be a %q subclass." msgstr "%q moet een subklasse zijn." -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "MISO of MOSI moeten worden gegeven" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "SCK pin moet opgegeven worden" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" @@ -3533,6 +3529,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 "Must provide SCK pin" +#~ msgstr "SCK pin moet opgegeven worden" + #~ msgid "" #~ "\n" #~ "To exit, please reset the board without " diff --git a/locale/pl.po b/locale/pl.po index 5428885c1d..e3ba4bfb44 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-24 16:55-0500\n" "PO-Revision-Date: 2020-09-23 18:31+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -1182,14 +1182,10 @@ msgstr "Brak pinu MISO lub MOSI" msgid "Must be a %q subclass." msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "Należy podać pin MISO lub MOSI" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "Należy podać pin SCK" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" @@ -3495,6 +3491,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "Must provide SCK pin" +#~ msgstr "Należy podać pin SCK" + #~ msgid "tuple/list required on RHS" #~ msgstr "wymagana krotka/lista po prawej stronie" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 0f5885ccf5..6a32208780 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-24 16:55-0500\n" "PO-Revision-Date: 2020-09-22 21:30+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -1192,14 +1192,10 @@ msgstr "O pino MISO ou MOSI está ausente" msgid "Must be a %q subclass." msgstr "Deve ser uma subclasse %q." -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "Deve informar os pinos MISO ou MOSI" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "É obrigatório informar o pino SCK" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" @@ -3561,6 +3557,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 "Must provide SCK pin" +#~ msgstr "É obrigatório informar o pino SCK" + #~ msgid "" #~ "\n" #~ "To exit, please reset the board without " diff --git a/locale/sv.po b/locale/sv.po index f2b7cae3e2..c181e975c8 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-24 16:55-0500\n" "PO-Revision-Date: 2020-09-07 19:36+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -1182,14 +1182,10 @@ msgstr "MISO- eller MOSI-pinne saknas" msgid "Must be a %q subclass." msgstr "Måste vara en %q-subklass." -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "Måste ange MISO- eller MOSI-pinne" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "Måste ange SCK-pinne" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" @@ -3528,6 +3524,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 "Must provide SCK pin" +#~ msgstr "Måste ange SCK-pinne" + #~ msgid "" #~ "\n" #~ "To exit, please reset the board without " diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 780f5be222..2b146478c1 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-21 16:45-0500\n" +"POT-Creation-Date: 2020-09-24 16:55-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -1178,14 +1178,10 @@ msgstr "Quēshǎo MISO huò MOSI yǐn jiǎo" msgid "Must be a %q subclass." msgstr "Bìxū shì %q zi lèi." -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "Bìxū tígōng MISO huò MOSI yǐn jiǎo" -#: ports/stm/common-hal/busio/SPI.c -msgid "Must provide SCK pin" -msgstr "bì xū tí gòng SCK yǐn jiǎo" - #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" @@ -3516,6 +3512,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 "Must provide SCK pin" +#~ msgstr "bì xū tí gòng SCK yǐn jiǎo" + #~ msgid "" #~ "\n" #~ "To exit, please reset the board without " From 9b3e955bd4b541cf804814e06b42a86c5b938e56 Mon Sep 17 00:00:00 2001 From: Maciej Stankiewicz Date: Mon, 28 Sep 2020 22:31:29 +0000 Subject: [PATCH 1020/1293] Translated using Weblate (Polish) Currently translated at 73.8% (595 of 806 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pl/ --- locale/pl.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/pl.po b/locale/pl.po index e3ba4bfb44..df56f7fbd1 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-24 16:55-0500\n" -"PO-Revision-Date: 2020-09-23 18:31+0000\n" +"PO-Revision-Date: 2020-09-29 01:39+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" "Language: pl\n" @@ -3417,7 +3417,7 @@ msgstr "" #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" -msgstr "" +msgstr "wartość musi mieścić się w %d bajtach" #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" From 28353973b21a053558f0c97ca7f7756f82afa5cb Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 29 Sep 2020 21:32:56 +0200 Subject: [PATCH 1021/1293] 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 | 142 ++++++++++++++++++++++++++++++++++----- locale/cs.po | 139 +++++++++++++++++++++++++++++++++----- locale/de_DE.po | 142 ++++++++++++++++++++++++++++++++++----- locale/el.po | 139 +++++++++++++++++++++++++++++++++----- locale/es.po | 142 ++++++++++++++++++++++++++++++++++----- locale/fil.po | 142 ++++++++++++++++++++++++++++++++++----- locale/fr.po | 142 ++++++++++++++++++++++++++++++++++----- locale/hi.po | 139 +++++++++++++++++++++++++++++++++----- locale/it_IT.po | 142 ++++++++++++++++++++++++++++++++++----- locale/ja.po | 139 +++++++++++++++++++++++++++++++++----- locale/ko.po | 139 +++++++++++++++++++++++++++++++++----- locale/nl.po | 142 ++++++++++++++++++++++++++++++++++----- locale/pl.po | 142 ++++++++++++++++++++++++++++++++++----- locale/pt_BR.po | 142 ++++++++++++++++++++++++++++++++++----- locale/sv.po | 142 ++++++++++++++++++++++++++++++++++----- locale/zh_Latn_pinyin.po | 142 ++++++++++++++++++++++++++++++++++----- 16 files changed, 1984 insertions(+), 273 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 42247dae47..be3fea6022 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-24 16:55-0500\n" +"POT-Creation-Date: 2020-09-29 11:11+0530\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -284,7 +284,7 @@ msgstr "Alamat harus sepanjang %d byte" msgid "Address type out of range" msgstr "Jenis alamat di luar batas" -#: ports/nrf/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Semua perangkat I2C sedang digunakan" @@ -292,11 +292,11 @@ msgstr "Semua perangkat I2C sedang digunakan" msgid "All RX FIFOs in use" msgstr "" -#: ports/nrf/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Semua perangkat SPI sedang digunakan" -#: ports/nrf/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "Semua perangkat UART sedang digunakan" @@ -318,6 +318,9 @@ msgstr "Semua timer untuk pin ini sedang digunakan" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c @@ -337,6 +340,10 @@ msgstr "" msgid "Already running" msgstr "" +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "Already scanning for wifi networks" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "AnalogIn tidak didukung pada pin yang diberikan" @@ -562,6 +569,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "Tidak dapat menetapkan nilai saat arah input." +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "Tidak dapat menentukan RTS atau CTS dalam mode RS485" @@ -657,14 +665,15 @@ msgid "Could not initialize SDCard" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Tidak dapat menginisialisasi UART" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "Tidak dapat menginisialisasi kanal" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "Tidak dapat menginisialisasi timer" @@ -680,6 +689,10 @@ msgstr "Tidak dapat menginisialisasi ulang timer" msgid "Could not restart PWM" msgstr "Tidak dapat memulai ulang PWM" +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +msgid "Could not retrieve clock" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" msgstr "" @@ -771,6 +784,10 @@ msgstr "Mode kendara tidak digunakan saat arah input." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB hanya beroperasi pada 16 byte di satu waktu" +#: ports/esp32s2/common-hal/busio/SPI.c +msgid "ESP-IDF memory allocation failed" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -828,6 +845,10 @@ msgstr "Penyebaran yang diperluas dengan respon pindai tidak didukung." msgid "FFT is defined for ndarrays only" msgstr "FFT didefinisikan hanya untuk ndarrays" +#: ports/esp32s2/common-hal/socketpool/Socket.c +msgid "Failed SSL handshake" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Gagal mengirim perintah." @@ -844,12 +865,21 @@ msgstr "Gagal untuk mengalokasikan buffer RX" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Gagal untuk megalokasikan buffer RX dari %d byte" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to allocate Wifi memory" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +msgid "Failed to allocate wifi scan memory" +msgstr "" + #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "Gagal terhubung: kesalahan internal" @@ -858,6 +888,10 @@ msgstr "Gagal terhubung: kesalahan internal" msgid "Failed to connect: timeout" msgstr "Gagal terhubung: habis waktu" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to init wifi" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Gagal mengurai file MP3" @@ -954,7 +988,7 @@ msgstr "Ukuran penyangga salah" msgid "Input taking too long" msgstr "" -#: py/moduerrno.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "Kesalahan input/output" @@ -1047,6 +1081,10 @@ msgstr "File tidak valid" msgid "Invalid format chunk size" msgstr "Ukuran potongan format tidak valid" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "Frekuensi yang diberikan tidak valid" @@ -1084,6 +1122,8 @@ msgstr "Pin untuk channel kanan tidak valid" #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -1215,21 +1255,25 @@ msgstr "Tidak ada DAC (Digital Analog Converter) di dalam chip" msgid "No DMA channel found" msgstr "tidak ada channel DMA ditemukan" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Tidak pin RX" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" @@ -1272,6 +1316,14 @@ msgstr "" msgid "No long integer support" msgstr "" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more channels available" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more timers available" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1336,6 +1388,14 @@ msgstr "Parity ganjil tidak didukung" msgid "Only 8 or 16 bit mono with " msgstr "Hanya 8 atau 16 bit mono dengan " +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 SOCK_STREAM sockets supported" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Only IPv4 addresses supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -1353,6 +1413,10 @@ msgstr "" msgid "Only raw int supported for ip" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Out of sockets" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1367,6 +1431,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" @@ -1412,6 +1477,12 @@ msgstr "Tambahkan module apapun pada filesystem\n" msgid "Polygon needs at least 3 points" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +"instead" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/pulseio/PulseOut.c @@ -1443,12 +1514,13 @@ msgstr "" msgid "RNG Init Error" msgstr "" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c -#: ports/nrf/common-hal/rtc/RTC.c +#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" msgstr "" @@ -1503,7 +1575,7 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA atau SCL membutuhkan pull up" @@ -1571,6 +1643,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "SocketPool can only be used with wifi.radio" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" msgstr "" @@ -1733,6 +1809,10 @@ msgstr "" msgid "Unable to allocate buffers for signed conversion" msgstr "Tidak dapat mengalokasikan buffer untuk signed conversion" +#: ports/esp32s2/common-hal/busio/I2C.c +msgid "Unable to create lock" +msgstr "" + #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" @@ -1759,6 +1839,11 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" +#: ports/esp32s2/common-hal/socketpool/Socket.c +#, c-format +msgid "Unhandled ESP TLS error %d %d %x %d" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "Unknown failure" msgstr "" @@ -1794,7 +1879,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Baudrate tidak didukung" @@ -2042,6 +2127,7 @@ msgid "byteorder is not a string" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "byte > 8 bit tidak didukung" @@ -2556,7 +2642,7 @@ msgstr "lapisan (padding) tidak benar" msgid "index is out of bounds" msgstr "" -#: py/obj.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index keluar dari jangkauan" @@ -3060,6 +3146,10 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "Muncul dari PulseIn yang kosong" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3076,6 +3166,24 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +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 "" + #: extmod/modutimeq.c msgid "queue overflow" msgstr "antrian meluap (overflow)" @@ -3319,7 +3427,8 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx dan rx keduanya tidak boleh kosong" @@ -3555,9 +3664,6 @@ msgstr "" #~ msgstr "" #~ "Berjalan di mode aman(safe mode)! tidak menjalankan kode yang tersimpan.\n" -#~ msgid "pop from an empty PulseIn" -#~ msgstr "Muncul dari PulseIn yang kosong" - #~ msgid "struct: index out of range" #~ msgstr "struct: index keluar dari jangkauan" diff --git a/locale/cs.po b/locale/cs.po index 88186b8231..229abad995 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-24 16:55-0500\n" +"POT-Creation-Date: 2020-09-29 11:11+0530\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -284,7 +284,7 @@ msgstr "" msgid "Address type out of range" msgstr "" -#: ports/nrf/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" @@ -292,11 +292,11 @@ msgstr "" msgid "All RX FIFOs in use" msgstr "" -#: ports/nrf/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "" @@ -318,6 +318,9 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c @@ -337,6 +340,10 @@ msgstr "" msgid "Already running" msgstr "" +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "Already scanning for wifi networks" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "" @@ -554,6 +561,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "" @@ -644,14 +652,15 @@ msgid "Could not initialize SDCard" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "" @@ -667,6 +676,10 @@ msgstr "" msgid "Could not restart PWM" msgstr "" +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +msgid "Could not retrieve clock" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" msgstr "" @@ -757,6 +770,10 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" +#: ports/esp32s2/common-hal/busio/SPI.c +msgid "ESP-IDF memory allocation failed" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -814,6 +831,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "" +#: ports/esp32s2/common-hal/socketpool/Socket.c +msgid "Failed SSL handshake" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -830,12 +851,21 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to allocate Wifi memory" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +msgid "Failed to allocate wifi scan memory" +msgstr "" + #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -844,6 +874,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to init wifi" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "" @@ -937,7 +971,7 @@ msgstr "" msgid "Input taking too long" msgstr "" -#: py/moduerrno.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "" @@ -1030,6 +1064,10 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "" @@ -1067,6 +1105,8 @@ msgstr "" #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -1198,21 +1238,25 @@ msgstr "" msgid "No DMA channel found" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" @@ -1255,6 +1299,14 @@ msgstr "" msgid "No long integer support" msgstr "" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more channels available" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more timers available" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1318,6 +1370,14 @@ msgstr "" msgid "Only 8 or 16 bit mono with " msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 SOCK_STREAM sockets supported" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Only IPv4 addresses supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -1335,6 +1395,10 @@ msgstr "" msgid "Only raw int supported for ip" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Out of sockets" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1349,6 +1413,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" @@ -1394,6 +1459,12 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +"instead" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/pulseio/PulseOut.c @@ -1423,12 +1494,13 @@ msgstr "" msgid "RNG Init Error" msgstr "" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c -#: ports/nrf/common-hal/rtc/RTC.c +#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" msgstr "" @@ -1482,7 +1554,7 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "" @@ -1550,6 +1622,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "SocketPool can only be used with wifi.radio" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" msgstr "" @@ -1712,6 +1788,10 @@ msgstr "" msgid "Unable to allocate buffers for signed conversion" msgstr "" +#: ports/esp32s2/common-hal/busio/I2C.c +msgid "Unable to create lock" +msgstr "" + #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" @@ -1738,6 +1818,11 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" +#: ports/esp32s2/common-hal/socketpool/Socket.c +#, c-format +msgid "Unhandled ESP TLS error %d %d %x %d" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "Unknown failure" msgstr "" @@ -1773,7 +1858,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" @@ -2013,6 +2098,7 @@ msgid "byteorder is not a string" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "" @@ -2527,7 +2613,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: py/obj.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -3030,6 +3116,10 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3046,6 +3136,24 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +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 "" + #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -3288,7 +3396,8 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 1fd1861095..f7d8377e9d 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-24 16:55-0500\n" +"POT-Creation-Date: 2020-09-29 11:11+0530\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -283,7 +283,7 @@ msgstr "Die Adresse muss %d Bytes lang sein" msgid "Address type out of range" msgstr "Adresstyp außerhalb des zulässigen Bereichs" -#: ports/nrf/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Alle I2C-Peripheriegeräte sind in Benutzung" @@ -291,11 +291,11 @@ msgstr "Alle I2C-Peripheriegeräte sind in Benutzung" msgid "All RX FIFOs in use" msgstr "" -#: ports/nrf/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Alle SPI-Peripheriegeräte sind in Benutzung" -#: ports/nrf/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "Alle UART-Peripheriegeräte sind in Benutzung" @@ -317,6 +317,9 @@ msgstr "Alle timer für diesen Pin werden bereits benutzt" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c @@ -336,6 +339,10 @@ msgstr "" msgid "Already running" msgstr "" +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "Already scanning for wifi networks" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "AnalogIn ist an diesem Pin nicht unterstützt" @@ -558,6 +565,7 @@ msgstr "Reset zum bootloader nicht möglich da bootloader nicht vorhanden." msgid "Cannot set value when direction is input." msgstr "Der Wert kann nicht gesetzt werden, wenn die Richtung input ist." +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "RTS oder CTS können im RS485-Modus nicht angegeben werden" @@ -654,14 +662,15 @@ msgid "Could not initialize SDCard" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Konnte UART nicht initialisieren" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "Kanal konnte nicht initialisiert werden" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "Timer konnte nicht initialisiert werden" @@ -677,6 +686,10 @@ msgstr "Timer konnte nicht neu gestartet werden" msgid "Could not restart PWM" msgstr "PWM konnte nicht neu gestartet werden" +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +msgid "Could not retrieve clock" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" msgstr "" @@ -767,6 +780,10 @@ msgstr "Drive mode wird nicht verwendet, wenn die Richtung input ist." msgid "ECB only operates on 16 bytes at a time" msgstr "Die EZB arbeitet jeweils nur mit 16 Bytes" +#: ports/esp32s2/common-hal/busio/SPI.c +msgid "ESP-IDF memory allocation failed" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -825,6 +842,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "FFT ist nur für ndarrays definiert" +#: ports/esp32s2/common-hal/socketpool/Socket.c +msgid "Failed SSL handshake" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Kommando nicht gesendet." @@ -841,12 +862,21 @@ msgstr "Konnte keinen RX Buffer allozieren" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Konnte keine RX Buffer mit %d allozieren" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to allocate Wifi memory" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +msgid "Failed to allocate wifi scan memory" +msgstr "" + #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "Verbindung fehlgeschlagen: interner Fehler" @@ -855,6 +885,10 @@ msgstr "Verbindung fehlgeschlagen: interner Fehler" msgid "Failed to connect: timeout" msgstr "Verbindung nicht erfolgreich: timeout" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to init wifi" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Parsen der MP3 Datei fehlgeschlagen" @@ -954,7 +988,7 @@ msgstr "Inkorrekte Puffergröße" msgid "Input taking too long" msgstr "" -#: py/moduerrno.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "Eingabe-/Ausgabefehler" @@ -1047,6 +1081,10 @@ msgstr "Ungültige Datei" msgid "Invalid format chunk size" msgstr "Ungültige format chunk size" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "Ungültige Frequenz geliefert" @@ -1084,6 +1122,8 @@ msgstr "Ungültiger Pin für rechten Kanal" #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -1217,21 +1257,25 @@ msgstr "Kein DAC im Chip vorhanden" msgid "No DMA channel found" msgstr "Kein DMA Kanal gefunden" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Kein MISO Pin" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Kein MOSI Pin" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Kein RX Pin" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" @@ -1274,6 +1318,14 @@ msgstr "Es wurde kein Schlüssel angegeben" msgid "No long integer support" msgstr "Keine langen Integer (long) unterstützt" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more channels available" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more timers available" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "An diesem Pin sind keine Timer mehr verfügbar." @@ -1339,6 +1391,14 @@ msgstr "Eine ungerade Parität wird nicht unterstützt" msgid "Only 8 or 16 bit mono with " msgstr "Nur 8 oder 16 bit mono mit " +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 SOCK_STREAM sockets supported" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Only IPv4 addresses supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -1360,6 +1420,10 @@ msgstr "" msgid "Only raw int supported for ip" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Out of sockets" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Oversample muss ein Vielfaches von 8 sein." @@ -1374,6 +1438,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "Die PWM-Frequenz ist nicht schreibbar wenn variable_Frequenz = False." +#: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" @@ -1422,6 +1487,12 @@ msgstr "und alle Module im Dateisystem \n" msgid "Polygon needs at least 3 points" msgstr "Polygone brauchen mindestens 3 Punkte" +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +"instead" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/pulseio/PulseOut.c @@ -1453,12 +1524,13 @@ msgstr "RNG DeInit-Fehler" msgid "RNG Init Error" msgstr "RNG Init Fehler" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "RS485-Inversion angegeben, wenn nicht im RS485-Modus" -#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c -#: ports/nrf/common-hal/rtc/RTC.c +#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" msgstr "Die RTC-Kalibrierung wird auf diesem Board nicht unterstützt" @@ -1512,7 +1584,7 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA oder SCL brauchen pull up" @@ -1580,6 +1652,10 @@ msgstr "Slice und Wert (value) haben unterschiedliche Längen." msgid "Slices not supported" msgstr "Slices werden nicht unterstützt" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "SocketPool can only be used with wifi.radio" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" msgstr "Quell- und Zielbuffer müssen gleich lang sein" @@ -1756,6 +1832,10 @@ msgstr "Der UUID-Wert ist kein str-, int- oder Byte-Puffer" msgid "Unable to allocate buffers for signed conversion" msgstr "Konnte keine Buffer für Vorzeichenumwandlung allozieren" +#: ports/esp32s2/common-hal/busio/I2C.c +msgid "Unable to create lock" +msgstr "" + #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" @@ -1782,6 +1862,11 @@ msgstr "Schreiben in nvm nicht möglich." msgid "Unexpected nrfx uuid type" msgstr "Unerwarteter nrfx uuid-Typ" +#: ports/esp32s2/common-hal/socketpool/Socket.c +#, c-format +msgid "Unhandled ESP TLS error %d %d %x %d" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "Unknown failure" msgstr "" @@ -1821,7 +1906,7 @@ msgstr "" "Eingabeaufforderung auf dem anderen Gerät abgelehnt oder ignoriert." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Baudrate wird nicht unterstützt" @@ -2070,6 +2155,7 @@ msgid "byteorder is not a string" msgstr "Byteorder ist kein String" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "bytes mit mehr als 8 bits werden nicht unterstützt" @@ -2598,7 +2684,7 @@ msgstr "padding ist inkorrekt" msgid "index is out of bounds" msgstr "Index ist außerhalb der Grenzen" -#: py/obj.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index außerhalb der Reichweite" @@ -3111,6 +3197,10 @@ msgstr "pixel_shader muss displayio.Palette oder displayio.ColorConverter sein" msgid "polygon can only be registered in one parent" msgstr "Polygon kann nur in einem übergeordneten Element registriert werden" +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "pop von einem leeren PulseIn" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3127,6 +3217,24 @@ msgstr "pow() drittes Argument darf nicht 0 sein" msgid "pow() with 3 arguments requires integers" msgstr "pow () mit 3 Argumenten erfordert Integer" +#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +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 "" + #: extmod/modutimeq.c msgid "queue overflow" msgstr "Warteschlangenüberlauf" @@ -3372,7 +3480,8 @@ msgstr "Tupelindex außerhalb des Bereichs" msgid "tuple/list has wrong length" msgstr "tupel/list hat falsche Länge" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx und rx können nicht beide None sein" @@ -3656,9 +3765,6 @@ msgstr "" #~ msgid "object of type '%s' has no len()" #~ msgstr "Objekt vom Typ '%s' hat keine len()" -#~ msgid "pop from an empty PulseIn" -#~ msgstr "pop von einem leeren PulseIn" - #~ msgid "pop from an empty set" #~ msgstr "pop von einer leeren Menge (set)" diff --git a/locale/el.po b/locale/el.po index 6732ddfdc5..78487c521f 100644 --- a/locale/el.po +++ b/locale/el.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-24 16:55-0500\n" +"POT-Creation-Date: 2020-09-29 11:11+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -279,7 +279,7 @@ msgstr "" msgid "Address type out of range" msgstr "" -#: ports/nrf/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" @@ -287,11 +287,11 @@ msgstr "" msgid "All RX FIFOs in use" msgstr "" -#: ports/nrf/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "" @@ -313,6 +313,9 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c @@ -332,6 +335,10 @@ msgstr "" msgid "Already running" msgstr "" +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "Already scanning for wifi networks" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "" @@ -549,6 +556,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "" @@ -639,14 +647,15 @@ msgid "Could not initialize SDCard" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "" @@ -662,6 +671,10 @@ msgstr "" msgid "Could not restart PWM" msgstr "" +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +msgid "Could not retrieve clock" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" msgstr "" @@ -752,6 +765,10 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" +#: ports/esp32s2/common-hal/busio/SPI.c +msgid "ESP-IDF memory allocation failed" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -809,6 +826,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "" +#: ports/esp32s2/common-hal/socketpool/Socket.c +msgid "Failed SSL handshake" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -825,12 +846,21 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to allocate Wifi memory" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +msgid "Failed to allocate wifi scan memory" +msgstr "" + #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -839,6 +869,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to init wifi" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "" @@ -932,7 +966,7 @@ msgstr "" msgid "Input taking too long" msgstr "" -#: py/moduerrno.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "" @@ -1025,6 +1059,10 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "" @@ -1062,6 +1100,8 @@ msgstr "" #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -1193,21 +1233,25 @@ msgstr "" msgid "No DMA channel found" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" @@ -1250,6 +1294,14 @@ msgstr "" msgid "No long integer support" msgstr "" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more channels available" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more timers available" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1313,6 +1365,14 @@ msgstr "" msgid "Only 8 or 16 bit mono with " msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 SOCK_STREAM sockets supported" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Only IPv4 addresses supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -1330,6 +1390,10 @@ msgstr "" msgid "Only raw int supported for ip" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Out of sockets" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1344,6 +1408,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" @@ -1389,6 +1454,12 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +"instead" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/pulseio/PulseOut.c @@ -1418,12 +1489,13 @@ msgstr "" msgid "RNG Init Error" msgstr "" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c -#: ports/nrf/common-hal/rtc/RTC.c +#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" msgstr "" @@ -1477,7 +1549,7 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "" @@ -1545,6 +1617,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "SocketPool can only be used with wifi.radio" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" msgstr "" @@ -1707,6 +1783,10 @@ msgstr "" msgid "Unable to allocate buffers for signed conversion" msgstr "" +#: ports/esp32s2/common-hal/busio/I2C.c +msgid "Unable to create lock" +msgstr "" + #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" @@ -1733,6 +1813,11 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" +#: ports/esp32s2/common-hal/socketpool/Socket.c +#, c-format +msgid "Unhandled ESP TLS error %d %d %x %d" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "Unknown failure" msgstr "" @@ -1768,7 +1853,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" @@ -2008,6 +2093,7 @@ msgid "byteorder is not a string" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "" @@ -2522,7 +2608,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: py/obj.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -3025,6 +3111,10 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3041,6 +3131,24 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +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 "" + #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -3283,7 +3391,8 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/es.po b/locale/es.po index 69a5f05946..bb0aaa0025 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-24 16:55-0500\n" +"POT-Creation-Date: 2020-09-29 11:11+0530\n" "PO-Revision-Date: 2020-09-25 18:20+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -287,7 +287,7 @@ msgstr "La dirección debe ser %d bytes de largo" msgid "Address type out of range" msgstr "Tipo de dirección fuera de rango" -#: ports/nrf/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Todos los periféricos I2C están siendo usados" @@ -295,11 +295,11 @@ msgstr "Todos los periféricos I2C están siendo usados" msgid "All RX FIFOs in use" msgstr "Todos los FIFOs de RX en uso" -#: ports/nrf/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Todos los periféricos SPI están siendo usados" -#: ports/nrf/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "Todos los periféricos UART están siendo usados" @@ -323,6 +323,9 @@ msgstr "Todos los timers para este pin están siendo utilizados" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c @@ -342,6 +345,10 @@ msgstr "Ya se tiene un escucha todas-las-coincidencias" msgid "Already running" msgstr "Ya está en ejecución" +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "Already scanning for wifi networks" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "El pin proporcionado no soporta AnalogIn" @@ -565,6 +572,7 @@ msgstr "No se puede reiniciar a bootloader porque no hay bootloader presente." msgid "Cannot set value when direction is input." msgstr "No se puede asignar un valor cuando la dirección es input." +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "No se puede especificar RTS o CTS en modo RS485" @@ -659,14 +667,15 @@ msgid "Could not initialize SDCard" msgstr "No se pudo inicializar SDCard" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "No se puede inicializar la UART" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "No se pudo inicializar el canal" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "No se pudo inicializar el temporizador" @@ -682,6 +691,10 @@ msgstr "No se pudo reiniciar el temporizador" msgid "Could not restart PWM" msgstr "No se pudo reiniciar el PWM" +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +msgid "Could not retrieve clock" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" msgstr "No se puede definir la dirección" @@ -772,6 +785,10 @@ msgstr "Modo Drive no se usa cuando la dirección es input." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB solo opera sobre 16 bytes a la vez" +#: ports/esp32s2/common-hal/busio/SPI.c +msgid "ESP-IDF memory allocation failed" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -829,6 +846,10 @@ msgstr "No se admiten anuncios extendidos con respuesta de escaneo." msgid "FFT is defined for ndarrays only" msgstr "FFT se define solo para ndarrays" +#: ports/esp32s2/common-hal/socketpool/Socket.c +msgid "Failed SSL handshake" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Fallo enviando comando." @@ -845,12 +866,21 @@ msgstr "Ha fallado la asignación del buffer RX" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Falló la asignación del buffer RX de %d bytes" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to allocate Wifi memory" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +msgid "Failed to allocate wifi scan memory" +msgstr "" + #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "Error al conectar: error interno" @@ -859,6 +889,10 @@ msgstr "Error al conectar: error interno" msgid "Failed to connect: timeout" msgstr "Error al conectar: tiempo de espera agotado" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to init wifi" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Error al analizar el archivo MP3" @@ -955,7 +989,7 @@ msgstr "Tamaño incorrecto del buffer" msgid "Input taking too long" msgstr "La entrada está durando mucho tiempo" -#: py/moduerrno.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "error Input/output" @@ -1048,6 +1082,10 @@ msgstr "Archivo inválido" msgid "Invalid format chunk size" msgstr "Formato de fragmento de formato no válido" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "Frecuencia suministrada no válida" @@ -1085,6 +1123,8 @@ msgstr "Pin inválido para canal derecho" #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -1216,21 +1256,25 @@ msgstr "El chip no tiene DAC" msgid "No DMA channel found" msgstr "No se encontró el canal DMA" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Sin pin MISO" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Sin pin MOSI" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Sin pin RX" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" @@ -1273,6 +1317,14 @@ msgstr "No se especificó ninguna llave" msgid "No long integer support" msgstr "No hay soporte de entero largo" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more channels available" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more timers available" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "No hay más temporizadores disponibles en este pin." @@ -1338,6 +1390,14 @@ msgstr "Paridad impar no soportada" msgid "Only 8 or 16 bit mono with " msgstr "Solo mono de 8 ó 16 bit con " +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 SOCK_STREAM sockets supported" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Only IPv4 addresses supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -1359,6 +1419,10 @@ msgstr "" msgid "Only raw int supported for ip" msgstr "Solo se aceptan enteros crudos para ip" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Out of sockets" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "El sobremuestreo debe ser un múltiplo de 8." @@ -1375,6 +1439,7 @@ msgstr "" "La frecuencia de PWM no se puede escribir variable_frequency es False en la " "construcción." +#: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" @@ -1422,6 +1487,12 @@ msgstr "Además de cualquier módulo en el sistema de archivos\n" msgid "Polygon needs at least 3 points" msgstr "El polígono necesita al menos 3 puntos" +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +"instead" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/pulseio/PulseOut.c @@ -1454,12 +1525,13 @@ msgstr "Error de desinicializado del RNG" msgid "RNG Init Error" msgstr "Error de inicialización de RNG" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "Se especifica inversión de RS485 sin estar en modo RS485" -#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c -#: ports/nrf/common-hal/rtc/RTC.c +#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" msgstr "Calibración de RTC no es soportada en esta placa" @@ -1513,7 +1585,7 @@ msgstr "¡Corriendo en modo seguro! " msgid "SD card CSD format not supported" msgstr "Sin capacidad para formato CSD para tarjeta SD" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA o SCL necesitan una pull up" @@ -1581,6 +1653,10 @@ msgstr "Slice y value tienen tamaños diferentes." msgid "Slices not supported" msgstr "Rebanadas no soportadas" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "SocketPool can only be used with wifi.radio" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" msgstr "Los búferes de fuente y destino deben ser del mismo tamaño" @@ -1757,6 +1833,10 @@ msgstr "UUID valor no es un str, int o byte buffer" msgid "Unable to allocate buffers for signed conversion" msgstr "No se pudieron asignar buffers para la conversión con signo" +#: ports/esp32s2/common-hal/busio/I2C.c +msgid "Unable to create lock" +msgstr "" + #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" @@ -1783,6 +1863,11 @@ msgstr "Imposible escribir en nvm." msgid "Unexpected nrfx uuid type" msgstr "Tipo de uuid nrfx inesperado" +#: ports/esp32s2/common-hal/socketpool/Socket.c +#, c-format +msgid "Unhandled ESP TLS error %d %d %x %d" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "Unknown failure" msgstr "Fallo desconocido" @@ -1820,7 +1905,7 @@ msgstr "" "dispositivo fue declinada o ignorada." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Baudrate no soportado" @@ -2069,6 +2154,7 @@ msgid "byteorder is not a string" msgstr "byteorder no es una cadena" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "bytes > 8 bits no soportados" @@ -2590,7 +2676,7 @@ msgstr "relleno (padding) incorrecto" msgid "index is out of bounds" msgstr "el índice está fuera de límites" -#: py/obj.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index fuera de rango" @@ -3099,6 +3185,10 @@ msgstr "pixel_shader debe ser displayio.Palette o displayio.ColorConverter" msgid "polygon can only be registered in one parent" msgstr "el polígono solo se puede registrar en uno de los padres" +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "pop de un PulseIn vacío" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3115,6 +3205,24 @@ 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/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +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 "" + #: extmod/modutimeq.c msgid "queue overflow" msgstr "desbordamiento de cola(queue)" @@ -3360,7 +3468,8 @@ msgstr "tuple index fuera de rango" msgid "tuple/list has wrong length" msgstr "tupla/lista tiene una longitud incorrecta" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "Ambos tx y rx no pueden ser None" @@ -3644,9 +3753,6 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgid "object of type '%s' has no len()" #~ msgstr "el objeto de tipo '%s' no tiene len()" -#~ msgid "pop from an empty PulseIn" -#~ msgstr "pop de un PulseIn vacío" - #~ msgid "pop from an empty set" #~ msgstr "pop desde un set vacío" diff --git a/locale/fil.po b/locale/fil.po index 0b8ead16d1..48d17e0701 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-24 16:55-0500\n" +"POT-Creation-Date: 2020-09-29 11:11+0530\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -281,7 +281,7 @@ msgstr "ang palette ay dapat 32 bytes ang haba" msgid "Address type out of range" msgstr "" -#: ports/nrf/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Lahat ng I2C peripherals ginagamit" @@ -289,11 +289,11 @@ msgstr "Lahat ng I2C peripherals ginagamit" msgid "All RX FIFOs in use" msgstr "" -#: ports/nrf/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Lahat ng SPI peripherals ay ginagamit" -#: ports/nrf/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #, fuzzy msgid "All UART peripherals are in use" msgstr "Lahat ng I2C peripherals ginagamit" @@ -316,6 +316,9 @@ msgstr "Lahat ng timers para sa pin na ito ay ginagamit" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c @@ -335,6 +338,10 @@ msgstr "" msgid "Already running" msgstr "" +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "Already scanning for wifi networks" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "" @@ -556,6 +563,7 @@ msgstr "Hindi ma-reset sa bootloader dahil walang bootloader." msgid "Cannot set value when direction is input." msgstr "Hindi ma i-set ang value kapag ang direksyon ay input." +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "" @@ -647,14 +655,15 @@ msgid "Could not initialize SDCard" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Hindi ma-initialize ang UART" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "" @@ -670,6 +679,10 @@ msgstr "" msgid "Could not restart PWM" msgstr "" +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +msgid "Could not retrieve clock" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" msgstr "" @@ -763,6 +776,10 @@ msgstr "Drive mode ay hindi ginagamit kapag ang direksyon ay input." msgid "ECB only operates on 16 bytes at a time" msgstr "" +#: ports/esp32s2/common-hal/busio/SPI.c +msgid "ESP-IDF memory allocation failed" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -822,6 +839,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "" +#: ports/esp32s2/common-hal/socketpool/Socket.c +msgid "Failed SSL handshake" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -838,12 +859,21 @@ msgstr "Nabigong ilaan ang RX buffer" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Nabigong ilaan ang RX buffer ng %d bytes" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to allocate Wifi memory" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +msgid "Failed to allocate wifi scan memory" +msgstr "" + #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -852,6 +882,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to init wifi" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "" @@ -947,7 +981,7 @@ msgstr "" msgid "Input taking too long" msgstr "" -#: py/moduerrno.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "May mali sa Input/Output" @@ -1040,6 +1074,10 @@ msgstr "Mali ang file" msgid "Invalid format chunk size" msgstr "Mali ang format ng chunk size" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "" @@ -1077,6 +1115,8 @@ msgstr "Mali ang pin para sa kanang channel" #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -1208,21 +1248,25 @@ msgstr "Walang DAC sa chip" msgid "No DMA channel found" msgstr "Walang DMA channel na mahanap" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Walang RX pin" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" @@ -1265,6 +1309,14 @@ msgstr "" msgid "No long integer support" msgstr "" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more channels available" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more timers available" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1331,6 +1383,14 @@ msgstr "Odd na parity ay hindi supportado" msgid "Only 8 or 16 bit mono with " msgstr "Tanging 8 o 16 na bit mono na may " +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 SOCK_STREAM sockets supported" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Only IPv4 addresses supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -1348,6 +1408,10 @@ msgstr "" msgid "Only raw int supported for ip" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Out of sockets" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Oversample ay dapat multiple ng 8." @@ -1363,6 +1427,7 @@ msgid "" msgstr "" "PWM frequency hindi writable kapag variable_frequency ay False sa pag buo." +#: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" @@ -1408,6 +1473,12 @@ msgstr "Kasama ang kung ano pang modules na sa filesystem\n" msgid "Polygon needs at least 3 points" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +"instead" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/pulseio/PulseOut.c @@ -1439,12 +1510,13 @@ msgstr "" msgid "RNG Init Error" msgstr "" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c -#: ports/nrf/common-hal/rtc/RTC.c +#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" msgstr "RTC calibration ay hindi supportado ng board na ito" @@ -1499,7 +1571,7 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "Kailangan ng pull up resistors ang SDA o SCL" @@ -1567,6 +1639,10 @@ msgstr "Slice at value iba't ibang haba." msgid "Slices not supported" msgstr "Hindi suportado ang Slices" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "SocketPool can only be used with wifi.radio" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" msgstr "" @@ -1729,6 +1805,10 @@ msgstr "" msgid "Unable to allocate buffers for signed conversion" msgstr "Hindi ma-allocate ang buffers para sa naka-sign na conversion" +#: ports/esp32s2/common-hal/busio/I2C.c +msgid "Unable to create lock" +msgstr "" + #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" @@ -1756,6 +1836,11 @@ msgstr "Hindi ma i-sulat sa NVM." msgid "Unexpected nrfx uuid type" msgstr "hindi inaasahang indent" +#: ports/esp32s2/common-hal/socketpool/Socket.c +#, c-format +msgid "Unhandled ESP TLS error %d %d %x %d" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "Unknown failure" msgstr "" @@ -1791,7 +1876,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Hindi supportadong baudrate" @@ -2041,6 +2126,7 @@ msgid "byteorder is not a string" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "hindi sinusuportahan ang bytes > 8 bits" @@ -2567,7 +2653,7 @@ msgstr "mali ang padding" msgid "index is out of bounds" msgstr "" -#: py/obj.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index wala sa sakop" @@ -3076,6 +3162,10 @@ msgstr "pixel_shader ay dapat displayio.Palette o displayio.ColorConverter" msgid "polygon can only be registered in one parent" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "pop mula sa walang laman na PulseIn" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3092,6 +3182,24 @@ 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/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +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 "" + #: extmod/modutimeq.c msgid "queue overflow" msgstr "puno na ang pila (overflow)" @@ -3338,7 +3446,8 @@ msgstr "indeks ng tuple wala sa sakop" msgid "tuple/list has wrong length" msgstr "mali ang haba ng tuple/list" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx at rx hindi pwedeng parehas na None" @@ -3589,9 +3698,6 @@ msgstr "" #~ msgid "object of type '%s' has no len()" #~ msgstr "object na type '%s' walang len()" -#~ msgid "pop from an empty PulseIn" -#~ msgstr "pop mula sa walang laman na PulseIn" - #~ msgid "pop from an empty set" #~ msgstr "pop sa walang laman na set" diff --git a/locale/fr.po b/locale/fr.po index bea085d1e3..6824816b48 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-24 16:55-0500\n" +"POT-Creation-Date: 2020-09-29 11:11+0530\n" "PO-Revision-Date: 2020-09-16 13:47+0000\n" "Last-Translator: Hugo Dahl \n" "Language: fr\n" @@ -288,7 +288,7 @@ msgstr "L'adresse doit être longue de %d octets" msgid "Address type out of range" msgstr "Type d'adresse hors plage" -#: ports/nrf/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Tous les périphériques I2C sont utilisés" @@ -296,11 +296,11 @@ msgstr "Tous les périphériques I2C sont utilisés" msgid "All RX FIFOs in use" msgstr "" -#: ports/nrf/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Tous les périphériques SPI sont utilisés" -#: ports/nrf/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "Tous les périphériques UART sont utilisés" @@ -322,6 +322,9 @@ msgstr "Tous les timers pour cette broche sont utilisés" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c @@ -341,6 +344,10 @@ msgstr "" msgid "Already running" msgstr "Déjà en cours d'exécution" +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "Already scanning for wifi networks" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "'AnalogOut' n'est pas supporté sur la broche indiquée" @@ -567,6 +574,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "Impossible d'affecter une valeur quand la direction est 'input'." +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "Impossible de spécifier RTS ou CTS en mode RS485" @@ -663,14 +671,15 @@ msgid "Could not initialize SDCard" msgstr "Impossible d'initialiser la carte SD" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "L'UART n'a pu être initialisé" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "Impossible d'initialiser la chaîne" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "Impossible d'initialiser la minuterie" @@ -686,6 +695,10 @@ msgstr "Impossible de réinitialiser le minuteur" msgid "Could not restart PWM" msgstr "Impossible de redémarrer PWM" +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +msgid "Could not retrieve clock" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" msgstr "" @@ -776,6 +789,10 @@ msgstr "Le mode Drive n'est pas utilisé quand la direction est 'input'." msgid "ECB only operates on 16 bytes at a time" msgstr "La BCE ne fonctionne que sur 16 octets à la fois" +#: ports/esp32s2/common-hal/busio/SPI.c +msgid "ESP-IDF memory allocation failed" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -834,6 +851,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "La FFT est définie pour les ndarrays uniquement" +#: ports/esp32s2/common-hal/socketpool/Socket.c +msgid "Failed SSL handshake" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Échec de l'envoi de la commande." @@ -850,12 +871,21 @@ msgstr "Echec de l'allocation du tampon RX" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Echec de l'allocation de %d octets du tampon RX" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to allocate Wifi memory" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +msgid "Failed to allocate wifi scan memory" +msgstr "" + #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "Impossible de se connecter : erreur interne" @@ -864,6 +894,10 @@ msgstr "Impossible de se connecter : erreur interne" msgid "Failed to connect: timeout" msgstr "Impossible de se connecter : délai d'expiration" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to init wifi" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Impossible d'analyser le fichier MP3" @@ -960,7 +994,7 @@ msgstr "Taille de tampon incorrecte" msgid "Input taking too long" msgstr "" -#: py/moduerrno.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "Erreur d'entrée/sortie" @@ -1053,6 +1087,10 @@ msgstr "Fichier invalide" msgid "Invalid format chunk size" msgstr "Taille de bloc de formatage invalide" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "Fréquence invalide fournie" @@ -1090,6 +1128,8 @@ msgstr "Broche invalide pour le canal droit" #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -1221,21 +1261,25 @@ msgstr "Pas de DAC sur la puce" msgid "No DMA channel found" msgstr "Aucun canal DMA trouvé" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Pas de broche MISO" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Pas de broche MOSI" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Pas de broche RX" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" @@ -1278,6 +1322,14 @@ msgstr "Aucune clé n'a été spécifiée" msgid "No long integer support" msgstr "Pas de support entier long" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more channels available" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more timers available" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "Plus de minuteurs disponibles sur cette broche." @@ -1343,6 +1395,14 @@ msgstr "Parité impaire non supportée" msgid "Only 8 or 16 bit mono with " msgstr "Uniquement 8 ou 16 bit mono avec " +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 SOCK_STREAM sockets supported" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Only IPv4 addresses supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -1364,6 +1424,10 @@ msgstr "" msgid "Only raw int supported for ip" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Out of sockets" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Le sur-échantillonage doit être un multiple de 8." @@ -1382,6 +1446,7 @@ msgstr "" "La fréquence de PWM n'est pas modifiable quand variable_frequency est False " "à la construction." +#: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" @@ -1430,6 +1495,12 @@ msgstr "Ainsi que tout autre module présent sur le système de fichiers\n" msgid "Polygon needs at least 3 points" msgstr "Polygone a besoin d’au moins 3 points" +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +"instead" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/pulseio/PulseOut.c @@ -1459,12 +1530,13 @@ msgstr "Erreur RNG DeInit" msgid "RNG Init Error" msgstr "Erreur d'initialisation RNG" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "Inversion RS485 spécifiée lorsqu'elle n'est pas en mode RS485" -#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c -#: ports/nrf/common-hal/rtc/RTC.c +#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" msgstr "étalonnage de la RTC non supportée sur cette carte" @@ -1518,7 +1590,7 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "Le format de carte SD CSD n'est pas pris en charge" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA ou SCL a besoin d'une résistance de tirage ('pull up')" @@ -1586,6 +1658,10 @@ msgstr "Tranche et valeur de tailles différentes." msgid "Slices not supported" msgstr "Tranches non supportées" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "SocketPool can only be used with wifi.radio" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" msgstr "Les tampons source et de destination doivent être de la même longueur" @@ -1761,6 +1837,10 @@ msgstr "" msgid "Unable to allocate buffers for signed conversion" msgstr "Impossible d'allouer des tampons pour une conversion signée" +#: ports/esp32s2/common-hal/busio/I2C.c +msgid "Unable to create lock" +msgstr "" + #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" @@ -1787,6 +1867,11 @@ msgstr "Impossible d'écrire sur la mémoire non-volatile." msgid "Unexpected nrfx uuid type" msgstr "Type inattendu pour l'uuid nrfx" +#: ports/esp32s2/common-hal/socketpool/Socket.c +#, c-format +msgid "Unhandled ESP TLS error %d %d %x %d" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "Unknown failure" msgstr "" @@ -1825,7 +1910,7 @@ msgstr "" "appareil ait été refusée ou ignorée." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Débit non supporté" @@ -2075,6 +2160,7 @@ msgid "byteorder is not a string" msgstr "byteorder n'est pas une chaîne" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "octets > 8 bits non supporté" @@ -2606,7 +2692,7 @@ msgstr "espacement incorrect" msgid "index is out of bounds" msgstr "l'index est hors limites" -#: py/obj.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index hors gamme" @@ -3119,6 +3205,10 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "le polygone ne peut être enregistré que dans un parent" +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "'pop' d'une entrée PulseIn vide" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3135,6 +3225,24 @@ 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/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +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 "" + #: extmod/modutimeq.c msgid "queue overflow" msgstr "dépassement de file" @@ -3380,7 +3488,8 @@ msgstr "index du tuple hors gamme" msgid "tuple/list has wrong length" msgstr "tuple/liste a une mauvaise longueur" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx et rx ne peuvent être 'None' tous les deux" @@ -3663,9 +3772,6 @@ msgstr "" #~ msgid "object of type '%s' has no len()" #~ msgstr "l'objet de type '%s' n'a pas de len()" -#~ msgid "pop from an empty PulseIn" -#~ msgstr "'pop' d'une entrée PulseIn vide" - #~ msgid "pop from an empty set" #~ msgstr "'pop' d'un ensemble set vide" diff --git a/locale/hi.po b/locale/hi.po index 137e44eed3..66f8e4865e 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-24 16:55-0500\n" +"POT-Creation-Date: 2020-09-29 11:11+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -279,7 +279,7 @@ msgstr "" msgid "Address type out of range" msgstr "" -#: ports/nrf/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" @@ -287,11 +287,11 @@ msgstr "" msgid "All RX FIFOs in use" msgstr "" -#: ports/nrf/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "" @@ -313,6 +313,9 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c @@ -332,6 +335,10 @@ msgstr "" msgid "Already running" msgstr "" +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "Already scanning for wifi networks" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "" @@ -549,6 +556,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "" @@ -639,14 +647,15 @@ msgid "Could not initialize SDCard" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "" @@ -662,6 +671,10 @@ msgstr "" msgid "Could not restart PWM" msgstr "" +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +msgid "Could not retrieve clock" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" msgstr "" @@ -752,6 +765,10 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" +#: ports/esp32s2/common-hal/busio/SPI.c +msgid "ESP-IDF memory allocation failed" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -809,6 +826,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "" +#: ports/esp32s2/common-hal/socketpool/Socket.c +msgid "Failed SSL handshake" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -825,12 +846,21 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to allocate Wifi memory" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +msgid "Failed to allocate wifi scan memory" +msgstr "" + #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -839,6 +869,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to init wifi" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "" @@ -932,7 +966,7 @@ msgstr "" msgid "Input taking too long" msgstr "" -#: py/moduerrno.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "" @@ -1025,6 +1059,10 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "" @@ -1062,6 +1100,8 @@ msgstr "" #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -1193,21 +1233,25 @@ msgstr "" msgid "No DMA channel found" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" @@ -1250,6 +1294,14 @@ msgstr "" msgid "No long integer support" msgstr "" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more channels available" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more timers available" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1313,6 +1365,14 @@ msgstr "" msgid "Only 8 or 16 bit mono with " msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 SOCK_STREAM sockets supported" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Only IPv4 addresses supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -1330,6 +1390,10 @@ msgstr "" msgid "Only raw int supported for ip" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Out of sockets" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1344,6 +1408,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" @@ -1389,6 +1454,12 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +"instead" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/pulseio/PulseOut.c @@ -1418,12 +1489,13 @@ msgstr "" msgid "RNG Init Error" msgstr "" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c -#: ports/nrf/common-hal/rtc/RTC.c +#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" msgstr "" @@ -1477,7 +1549,7 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "" @@ -1545,6 +1617,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "SocketPool can only be used with wifi.radio" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" msgstr "" @@ -1707,6 +1783,10 @@ msgstr "" msgid "Unable to allocate buffers for signed conversion" msgstr "" +#: ports/esp32s2/common-hal/busio/I2C.c +msgid "Unable to create lock" +msgstr "" + #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" @@ -1733,6 +1813,11 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" +#: ports/esp32s2/common-hal/socketpool/Socket.c +#, c-format +msgid "Unhandled ESP TLS error %d %d %x %d" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "Unknown failure" msgstr "" @@ -1768,7 +1853,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" @@ -2008,6 +2093,7 @@ msgid "byteorder is not a string" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "" @@ -2522,7 +2608,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: py/obj.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -3025,6 +3111,10 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3041,6 +3131,24 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +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 "" + #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -3283,7 +3391,8 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 537c6effd9..2377c1a2f1 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-24 16:55-0500\n" +"POT-Creation-Date: 2020-09-29 11:11+0530\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -280,7 +280,7 @@ msgstr "la palette deve essere lunga 32 byte" msgid "Address type out of range" msgstr "" -#: ports/nrf/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Tutte le periferiche I2C sono in uso" @@ -288,11 +288,11 @@ msgstr "Tutte le periferiche I2C sono in uso" msgid "All RX FIFOs in use" msgstr "" -#: ports/nrf/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Tutte le periferiche SPI sono in uso" -#: ports/nrf/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #, fuzzy msgid "All UART peripherals are in use" msgstr "Tutte le periferiche I2C sono in uso" @@ -315,6 +315,9 @@ msgstr "Tutti i timer per questo pin sono in uso" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c @@ -334,6 +337,10 @@ msgstr "" msgid "Already running" msgstr "" +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "Already scanning for wifi networks" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "" @@ -557,6 +564,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "non si può impostare un valore quando direzione è input" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "" @@ -648,14 +656,15 @@ msgid "Could not initialize SDCard" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Impossibile inizializzare l'UART" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "" @@ -671,6 +680,10 @@ msgstr "" msgid "Could not restart PWM" msgstr "" +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +msgid "Could not retrieve clock" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" msgstr "" @@ -763,6 +776,10 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" +#: ports/esp32s2/common-hal/busio/SPI.c +msgid "ESP-IDF memory allocation failed" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -822,6 +839,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "" +#: ports/esp32s2/common-hal/socketpool/Socket.c +msgid "Failed SSL handshake" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -838,12 +859,21 @@ msgstr "Impossibile allocare buffer RX" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Fallita allocazione del buffer RX di %d byte" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to allocate Wifi memory" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +msgid "Failed to allocate wifi scan memory" +msgstr "" + #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -852,6 +882,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to init wifi" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "" @@ -947,7 +981,7 @@ msgstr "" msgid "Input taking too long" msgstr "" -#: py/moduerrno.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "Errore input/output" @@ -1042,6 +1076,10 @@ msgstr "File non valido" msgid "Invalid format chunk size" msgstr "" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "" @@ -1079,6 +1117,8 @@ msgstr "Pin non valido per il canale destro" #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -1212,21 +1252,25 @@ msgstr "Nessun DAC sul chip" msgid "No DMA channel found" msgstr "Nessun canale DMA trovato" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Nessun pin RX" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" @@ -1269,6 +1313,14 @@ msgstr "" msgid "No long integer support" msgstr "" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more channels available" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more timers available" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1336,6 +1388,14 @@ msgstr "operazione I2C non supportata" msgid "Only 8 or 16 bit mono with " msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 SOCK_STREAM sockets supported" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Only IPv4 addresses supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -1353,6 +1413,10 @@ msgstr "" msgid "Only raw int supported for ip" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Out of sockets" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "L'oversampling deve essere multiplo di 8." @@ -1372,6 +1436,7 @@ msgstr "" "frequenza PWM frequency non è scrivibile quando variable_frequency è " "impostato nel costruttore a False." +#: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" @@ -1418,6 +1483,12 @@ msgstr "Imposssibile rimontare il filesystem" msgid "Polygon needs at least 3 points" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +"instead" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/pulseio/PulseOut.c @@ -1448,12 +1519,13 @@ msgstr "" msgid "RNG Init Error" msgstr "" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c -#: ports/nrf/common-hal/rtc/RTC.c +#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" msgstr "calibrazione RTC non supportata su questa scheda" @@ -1508,7 +1580,7 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA o SCL necessitano un pull-up" @@ -1578,6 +1650,10 @@ msgstr "" msgid "Slices not supported" msgstr "Slice non supportate" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "SocketPool can only be used with wifi.radio" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" msgstr "" @@ -1740,6 +1816,10 @@ msgstr "" msgid "Unable to allocate buffers for signed conversion" msgstr "Ipossibilitato ad allocare buffer per la conversione con segno" +#: ports/esp32s2/common-hal/busio/I2C.c +msgid "Unable to create lock" +msgstr "" + #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" @@ -1767,6 +1847,11 @@ msgstr "Imposibile scrivere su nvm." msgid "Unexpected nrfx uuid type" msgstr "indentazione inaspettata" +#: ports/esp32s2/common-hal/socketpool/Socket.c +#, c-format +msgid "Unhandled ESP TLS error %d %d %x %d" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "Unknown failure" msgstr "" @@ -1802,7 +1887,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "baudrate non supportato" @@ -2046,6 +2131,7 @@ msgid "byteorder is not a string" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "byte > 8 bit non supportati" @@ -2568,7 +2654,7 @@ msgstr "padding incorretto" msgid "index is out of bounds" msgstr "" -#: py/obj.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "indice fuori intervallo" @@ -3083,6 +3169,10 @@ msgstr "pixel_shader deve essere displayio.Palette o displayio.ColorConverter" msgid "polygon can only be registered in one parent" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "pop sun un PulseIn vuoto" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3099,6 +3189,24 @@ 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/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +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 "" + #: extmod/modutimeq.c msgid "queue overflow" msgstr "overflow della coda" @@ -3345,7 +3453,8 @@ msgstr "indice della tupla fuori intervallo" msgid "tuple/list has wrong length" msgstr "tupla/lista ha la lunghezza sbagliata" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx e rx non possono essere entrambi None" @@ -3597,9 +3706,6 @@ msgstr "" #~ msgid "object of type '%s' has no len()" #~ msgstr "l'oggetto di tipo '%s' non implementa len()" -#~ msgid "pop from an empty PulseIn" -#~ msgstr "pop sun un PulseIn vuoto" - #~ msgid "pop from an empty set" #~ msgstr "pop da un set vuoto" diff --git a/locale/ja.po b/locale/ja.po index bf53151ad5..d5e2015f4b 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-24 16:55-0500\n" +"POT-Creation-Date: 2020-09-29 11:11+0530\n" "PO-Revision-Date: 2020-09-25 18:20+0000\n" "Last-Translator: Taku Fukada \n" "Language-Team: none\n" @@ -286,7 +286,7 @@ msgstr "アドレスは、%dバイト長でなければなりません" msgid "Address type out of range" msgstr "address_typeが範囲外" -#: ports/nrf/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "全てのI2C周辺機器が使用中" @@ -294,11 +294,11 @@ msgstr "全てのI2C周辺機器が使用中" msgid "All RX FIFOs in use" msgstr "全てのRX FIFOが使用中" -#: ports/nrf/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "全てのSPI周辺機器が使用中" -#: ports/nrf/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "全てのUART周辺機器が使用中" @@ -320,6 +320,9 @@ msgstr "このピン用の全てのタイマが使用中" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c @@ -339,6 +342,10 @@ msgstr "" msgid "Already running" msgstr "すでに実行中" +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "Already scanning for wifi networks" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "指定のピンはAnalogInに対応していません" @@ -560,6 +567,7 @@ msgstr "ブートローダが存在しないためブートローダへとリセ msgid "Cannot set value when direction is input." msgstr "方向がinputのときは値を設定できません" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "RS485モードにRTSまたはCTSを指定できません" @@ -652,14 +660,15 @@ msgid "Could not initialize SDCard" msgstr "SDカードを初期化できません" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "UARTを初期化できません" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "チャネルを初期化できません" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "タイマーを初期化できません" @@ -675,6 +684,10 @@ msgstr "タイマーを再初期化できません" msgid "Could not restart PWM" msgstr "PWMを再スタートできません" +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +msgid "Could not retrieve clock" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" msgstr "アドレスをセットできません" @@ -765,6 +778,10 @@ msgstr "方向がinputのときドライブモードは使われません" msgid "ECB only operates on 16 bytes at a time" msgstr "ECBは一度に16バイトの演算のみを行います" +#: ports/esp32s2/common-hal/busio/SPI.c +msgid "ESP-IDF memory allocation failed" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -822,6 +839,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "FFTはndarrayでのみ使えます" +#: ports/esp32s2/common-hal/socketpool/Socket.c +msgid "Failed SSL handshake" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "コマンド送信に失敗" @@ -838,12 +859,21 @@ msgstr "RXバッファの確保に失敗" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "%dバイトのRXバッファの確保に失敗" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to allocate Wifi memory" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +msgid "Failed to allocate wifi scan memory" +msgstr "" + #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "接続失敗: 内部エラー" @@ -852,6 +882,10 @@ msgstr "接続失敗: 内部エラー" msgid "Failed to connect: timeout" msgstr "接続失敗: タイムアウト" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to init wifi" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "MP3ファイルのパーズに失敗" @@ -947,7 +981,7 @@ msgstr "バッファサイズが正しくありません" msgid "Input taking too long" msgstr "" -#: py/moduerrno.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "入力/出力エラー" @@ -1040,6 +1074,10 @@ msgstr "不正なファイル" msgid "Invalid format chunk size" msgstr "フォーマットチャンクのサイズが不正" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "不正な周波数が与えられました" @@ -1077,6 +1115,8 @@ msgstr "右チャネルのピンが不正" #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -1208,21 +1248,25 @@ msgstr "チップにDACがありません" msgid "No DMA channel found" msgstr "DMAチャネルが見つかりません" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "MISOピンなし" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "MOSIピンがありません" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "RXピンがありません" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" @@ -1265,6 +1309,14 @@ msgstr "キーが指定されていません" msgid "No long integer support" msgstr "long integerに対応していません" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more channels available" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more timers available" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "このピンには使えるタイマーがもうありません" @@ -1330,6 +1382,14 @@ msgstr "奇数パリティには対応していません" msgid "Only 8 or 16 bit mono with " msgstr "8または16ビットの " +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 SOCK_STREAM sockets supported" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Only IPv4 addresses supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -1347,6 +1407,10 @@ msgstr "" msgid "Only raw int supported for ip" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Out of sockets" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "オーバーサンプルは8の倍数でなければなりません" @@ -1362,6 +1426,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "PWM周波数は生成時のvariable_frequencyがFalseのとき書き換え不可" +#: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" @@ -1407,6 +1472,12 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "ポリゴンには少なくとも3つの点が必要" +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +"instead" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/pulseio/PulseOut.c @@ -1436,12 +1507,13 @@ msgstr "RNG解体エラー" msgid "RNG Init Error" msgstr "乱数生成器の初期化エラー" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c -#: ports/nrf/common-hal/rtc/RTC.c +#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" msgstr "このボードはRTCのキャリブレーションに非対応" @@ -1495,7 +1567,7 @@ msgstr "セーフモードで実行中! " msgid "SD card CSD format not supported" msgstr "SDカードのCSDフォーマットは非対応" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDAとSCLにプルアップが必要" @@ -1563,6 +1635,10 @@ msgstr "スライスと値の長さが一致しません" msgid "Slices not supported" msgstr "スライスは対応していません" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "SocketPool can only be used with wifi.radio" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" msgstr "バッファ (元/先) は同じ長さでなければなりません" @@ -1732,6 +1808,10 @@ msgstr "UUIDの値がstr, int, bufferのいずれでもありません" msgid "Unable to allocate buffers for signed conversion" msgstr "" +#: ports/esp32s2/common-hal/busio/I2C.c +msgid "Unable to create lock" +msgstr "" + #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" @@ -1758,6 +1838,11 @@ msgstr "nvmに書き込みできません" msgid "Unexpected nrfx uuid type" msgstr "想定されていないnrfx UUID型" +#: ports/esp32s2/common-hal/socketpool/Socket.c +#, c-format +msgid "Unhandled ESP TLS error %d %d %x %d" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "Unknown failure" msgstr "" @@ -1793,7 +1878,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "非対応のbaudrate" @@ -2033,6 +2118,7 @@ msgid "byteorder is not a string" msgstr "byteorderが文字列ではありません" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "" @@ -2551,7 +2637,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: py/obj.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "インデクスが範囲外" @@ -3057,6 +3143,10 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3073,6 +3163,24 @@ msgstr "pow()の3つ目の引数は0にできません" msgid "pow() with 3 arguments requires integers" msgstr "pow()の第3引数には整数が必要" +#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +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 "" + #: extmod/modutimeq.c msgid "queue overflow" msgstr "キューがオーバーフローしました" @@ -3316,7 +3424,8 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "タプル/リストの長さが正しくありません" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "txとrxを両方ともNoneにできません" diff --git a/locale/ko.po b/locale/ko.po index f5ac77e906..23396a96e9 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-24 16:55-0500\n" +"POT-Creation-Date: 2020-09-29 11:11+0530\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -280,7 +280,7 @@ msgstr "" msgid "Address type out of range" msgstr "" -#: ports/nrf/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "사용중인 모든 I2C주변 기기" @@ -288,11 +288,11 @@ msgstr "사용중인 모든 I2C주변 기기" msgid "All RX FIFOs in use" msgstr "" -#: ports/nrf/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "사용중인 모든 SPI주변 기기" -#: ports/nrf/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "사용중인 모든 UART주변 기기" @@ -314,6 +314,9 @@ msgstr "핀의 모든 타이머가 사용 중입니다" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c @@ -333,6 +336,10 @@ msgstr "" msgid "Already running" msgstr "" +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "Already scanning for wifi networks" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "" @@ -552,6 +559,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "" @@ -642,14 +650,15 @@ msgid "Could not initialize SDCard" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "" @@ -665,6 +674,10 @@ msgstr "" msgid "Could not restart PWM" msgstr "" +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +msgid "Could not retrieve clock" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" msgstr "" @@ -755,6 +768,10 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" +#: ports/esp32s2/common-hal/busio/SPI.c +msgid "ESP-IDF memory allocation failed" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -812,6 +829,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "" +#: ports/esp32s2/common-hal/socketpool/Socket.c +msgid "Failed SSL handshake" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -828,12 +849,21 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to allocate Wifi memory" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +msgid "Failed to allocate wifi scan memory" +msgstr "" + #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -842,6 +872,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to init wifi" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "" @@ -935,7 +969,7 @@ msgstr "" msgid "Input taking too long" msgstr "" -#: py/moduerrno.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "" @@ -1028,6 +1062,10 @@ msgstr "파일이 유효하지 않습니다" msgid "Invalid format chunk size" msgstr "형식 청크 크기가 잘못되었습니다" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "" @@ -1065,6 +1103,8 @@ msgstr "오른쪽 채널 핀이 잘못되었습니다" #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -1196,21 +1236,25 @@ msgstr "" msgid "No DMA channel found" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" @@ -1253,6 +1297,14 @@ msgstr "" msgid "No long integer support" msgstr "" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more channels available" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more timers available" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1316,6 +1368,14 @@ msgstr "" msgid "Only 8 or 16 bit mono with " msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 SOCK_STREAM sockets supported" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Only IPv4 addresses supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -1333,6 +1393,10 @@ msgstr "" msgid "Only raw int supported for ip" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Out of sockets" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1347,6 +1411,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" @@ -1392,6 +1457,12 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +"instead" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/pulseio/PulseOut.c @@ -1421,12 +1492,13 @@ msgstr "" msgid "RNG Init Error" msgstr "" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c -#: ports/nrf/common-hal/rtc/RTC.c +#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" msgstr "" @@ -1480,7 +1552,7 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "" @@ -1548,6 +1620,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "SocketPool can only be used with wifi.radio" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" msgstr "" @@ -1711,6 +1787,10 @@ msgstr "" msgid "Unable to allocate buffers for signed conversion" msgstr "" +#: ports/esp32s2/common-hal/busio/I2C.c +msgid "Unable to create lock" +msgstr "" + #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" @@ -1737,6 +1817,11 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" +#: ports/esp32s2/common-hal/socketpool/Socket.c +#, c-format +msgid "Unhandled ESP TLS error %d %d %x %d" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "Unknown failure" msgstr "" @@ -1772,7 +1857,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" @@ -2012,6 +2097,7 @@ msgid "byteorder is not a string" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "" @@ -2526,7 +2612,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: py/obj.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -3029,6 +3115,10 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3045,6 +3135,24 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +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 "" + #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -3287,7 +3395,8 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index d9468c7b9e..cffbee62e6 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-24 16:55-0500\n" +"POT-Creation-Date: 2020-09-29 11:11+0530\n" "PO-Revision-Date: 2020-09-09 16:05+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -284,7 +284,7 @@ msgstr "Adres moet %d bytes lang zijn" msgid "Address type out of range" msgstr "Adres type buiten bereik" -#: ports/nrf/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Alle I2C peripherals zijn in gebruik" @@ -292,11 +292,11 @@ msgstr "Alle I2C peripherals zijn in gebruik" msgid "All RX FIFOs in use" msgstr "" -#: ports/nrf/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Alle SPI peripherals zijn in gebruik" -#: ports/nrf/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "Alle UART peripherals zijn in gebruik" @@ -318,6 +318,9 @@ msgstr "Alle timers voor deze pin zijn in gebruik" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c @@ -337,6 +340,10 @@ msgstr "" msgid "Already running" msgstr "Wordt al uitgevoerd" +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "Already scanning for wifi networks" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "AnalogIn niet ondersteund door gegeven pin" @@ -558,6 +565,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "Kan de waarde niet toewijzen als de richting input is." +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "Kan RTS of CTS niet specificeren in RS485 modus" @@ -652,14 +660,15 @@ msgid "Could not initialize SDCard" msgstr "Kan SDCard niet initialiseren" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Kan UART niet initialiseren" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "Kan kanaal niet initialiseren" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "Kan timer niet initialiseren" @@ -675,6 +684,10 @@ msgstr "Kan timer niet her-initialiseren" msgid "Could not restart PWM" msgstr "Kan PWM niet herstarten" +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +msgid "Could not retrieve clock" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" msgstr "Kan adres niet zetten" @@ -765,6 +778,10 @@ msgstr "Drive modus niet gebruikt als de richting input is." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB werkt alleen met 16 bytes tegelijkertijd" +#: ports/esp32s2/common-hal/busio/SPI.c +msgid "ESP-IDF memory allocation failed" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -822,6 +839,10 @@ msgstr "Extended advertisements met scan antwoord niet ondersteund." msgid "FFT is defined for ndarrays only" msgstr "FFT alleen voor ndarrays gedefineerd" +#: ports/esp32s2/common-hal/socketpool/Socket.c +msgid "Failed SSL handshake" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Commando verzenden mislukt." @@ -838,12 +859,21 @@ msgstr "RX buffer alloceren mislukt" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Mislukt een RX buffer van %d bytes te alloceren" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to allocate Wifi memory" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +msgid "Failed to allocate wifi scan memory" +msgstr "" + #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "Verbinding mislukt: interne fout" @@ -852,6 +882,10 @@ msgstr "Verbinding mislukt: interne fout" msgid "Failed to connect: timeout" msgstr "Verbinding mislukt: timeout" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to init wifi" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Mislukt om MP3 bestand te ontleden" @@ -949,7 +983,7 @@ msgstr "Incorrecte buffer grootte" msgid "Input taking too long" msgstr "" -#: py/moduerrno.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "Input/Output fout" @@ -1042,6 +1076,10 @@ msgstr "Ongeldig bestand" msgid "Invalid format chunk size" msgstr "Ongeldig formaat stuk grootte" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "Ongeldige frequentie opgegeven" @@ -1079,6 +1117,8 @@ msgstr "Ongeldige pin voor rechter kanaal" #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -1210,21 +1250,25 @@ msgstr "Geen DAC op de chip" msgid "No DMA channel found" msgstr "Geen DMA kanaal gevonden" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Geen MISO pin" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Geen MOSI pin" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Geen RX pin" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" @@ -1267,6 +1311,14 @@ msgstr "Een sleutel was niet gespecificeerd" msgid "No long integer support" msgstr "Geen lange integer ondersteuning" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more channels available" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more timers available" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "Geen timers meer beschikbaar op deze pin." @@ -1332,6 +1384,14 @@ msgstr "Oneven pariteit is niet ondersteund" msgid "Only 8 or 16 bit mono with " msgstr "Alleen 8 of 16 bit mono met " +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 SOCK_STREAM sockets supported" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Only IPv4 addresses supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -1353,6 +1413,10 @@ msgstr "" msgid "Only raw int supported for ip" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Out of sockets" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Oversample moet een meervoud van 8 zijn." @@ -1370,6 +1434,7 @@ msgstr "" "PWM frequentie is niet schrijfbaar wanneer de variable_frequency False is " "tijdens constructie." +#: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" @@ -1418,6 +1483,12 @@ msgstr "En iedere module in het bestandssysteem\n" msgid "Polygon needs at least 3 points" msgstr "Polygon heeft op zijn minst 3 punten nodig" +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +"instead" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/pulseio/PulseOut.c @@ -1449,12 +1520,13 @@ msgstr "RNG DeInit Fout" msgid "RNG Init Error" msgstr "RNG Init Fout" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "RS485 inversie gespecificeerd terwijl niet in RS485 modus" -#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c -#: ports/nrf/common-hal/rtc/RTC.c +#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" msgstr "RTC calibratie niet ondersteund door dit board" @@ -1508,7 +1580,7 @@ msgstr "Veilige modus wordt uitgevoerd! " msgid "SD card CSD format not supported" msgstr "SD kaart CSD formaat niet ondersteund" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA of SCL hebben een pullup nodig" @@ -1576,6 +1648,10 @@ msgstr "Slice en waarde hebben verschillende lengtes." msgid "Slices not supported" msgstr "Slices niet ondersteund" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "SocketPool can only be used with wifi.radio" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" msgstr "Bron en bestemming buffers moeten dezelfde lengte hebben" @@ -1748,6 +1824,10 @@ msgstr "UUID waarde is geen str, int, of byte buffer" msgid "Unable to allocate buffers for signed conversion" msgstr "Niet in staat buffers voor gesigneerde conversie te alloceren" +#: ports/esp32s2/common-hal/busio/I2C.c +msgid "Unable to create lock" +msgstr "" + #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" @@ -1774,6 +1854,11 @@ msgstr "Niet in staat om naar nvm te schrijven." msgid "Unexpected nrfx uuid type" msgstr "Onverwacht mrfx uuid type" +#: ports/esp32s2/common-hal/socketpool/Socket.c +#, c-format +msgid "Unhandled ESP TLS error %d %d %x %d" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "Unknown failure" msgstr "" @@ -1811,7 +1896,7 @@ msgstr "" "apparaat geweigerd of genegeerd werd." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Niet-ondersteunde baudsnelheid" @@ -2060,6 +2145,7 @@ msgid "byteorder is not a string" msgstr "byteorder is geen string" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "butes > 8 niet ondersteund" @@ -2579,7 +2665,7 @@ msgstr "vulling (padding) is onjuist" msgid "index is out of bounds" msgstr "index is buiten bereik" -#: py/obj.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index is buiten bereik" @@ -3086,6 +3172,10 @@ msgid "polygon can only be registered in one parent" msgstr "" "polygoon kan slechts bij één object van een hoger niveau worden geregistreerd" +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "pop van een lege PulseIn" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3102,6 +3192,24 @@ msgstr "derde argument van pow() mag geen 0 zijn" msgid "pow() with 3 arguments requires integers" msgstr "pow() met 3 argumenten vereist integers" +#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +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 "" + #: extmod/modutimeq.c msgid "queue overflow" msgstr "wachtrij overloop" @@ -3346,7 +3454,8 @@ msgstr "tuple index buiten bereik" msgid "tuple/list has wrong length" msgstr "tuple of lijst heeft onjuiste lengte" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx en rx kunnen niet beiden None zijn" @@ -3627,9 +3736,6 @@ msgstr "zi moet vorm (n_section, 2) hebben" #~ msgid "object of type '%s' has no len()" #~ msgstr "object van type '%s' heeft geen len()" -#~ msgid "pop from an empty PulseIn" -#~ msgstr "pop van een lege PulseIn" - #~ msgid "pop from an empty set" #~ msgstr "pop van een lege set" diff --git a/locale/pl.po b/locale/pl.po index df56f7fbd1..ea0c2a4017 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-24 16:55-0500\n" +"POT-Creation-Date: 2020-09-29 11:11+0530\n" "PO-Revision-Date: 2020-09-29 01:39+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -286,7 +286,7 @@ msgstr "Adres musi mieć %d bajtów" msgid "Address type out of range" msgstr "" -#: ports/nrf/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Wszystkie peryferia I2C w użyciu" @@ -294,11 +294,11 @@ msgstr "Wszystkie peryferia I2C w użyciu" msgid "All RX FIFOs in use" msgstr "" -#: ports/nrf/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Wszystkie peryferia SPI w użyciu" -#: ports/nrf/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "Wszystkie peryferia UART w użyciu" @@ -320,6 +320,9 @@ msgstr "Wszystkie timery tej nóżki w użyciu" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c @@ -339,6 +342,10 @@ msgstr "" msgid "Already running" msgstr "" +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "Already scanning for wifi networks" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "AnalogIn nie jest obsługiwany na danym pinie" @@ -558,6 +565,7 @@ msgstr "Nie można zrestartować -- nie ma bootloadera." msgid "Cannot set value when direction is input." msgstr "Nie można ustawić wartości w trybie wejścia." +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "Nie można określić RTS ani CTS w trybie RS485" @@ -652,14 +660,15 @@ msgid "Could not initialize SDCard" msgstr "Nie można zainicjować SDCard" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Ustawienie UART nie powiodło się" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "Nie można zainicjować kanału" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "Nie można zainicjować timera" @@ -675,6 +684,10 @@ msgstr "Nie można ponownie zainicjować timera" msgid "Could not restart PWM" msgstr "Nie można ponownie uruchomić PWM" +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +msgid "Could not retrieve clock" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" msgstr "Nie można ustawić adresu" @@ -765,6 +778,10 @@ msgstr "Tryb sterowania nieużywany w trybie wejścia." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB działa tylko na 16 bajtach naraz" +#: ports/esp32s2/common-hal/busio/SPI.c +msgid "ESP-IDF memory allocation failed" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -822,6 +839,10 @@ msgstr "" msgid "FFT is defined for ndarrays only" msgstr "" +#: ports/esp32s2/common-hal/socketpool/Socket.c +msgid "Failed SSL handshake" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Nie udało się wysłać polecenia." @@ -838,12 +859,21 @@ msgstr "Nie udała się alokacja bufora RX" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Nie udała się alokacja %d bajtów na bufor RX" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to allocate Wifi memory" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +msgid "Failed to allocate wifi scan memory" +msgstr "" + #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "Nie udało się połączyć: błąd wewnętrzny" @@ -852,6 +882,10 @@ msgstr "Nie udało się połączyć: błąd wewnętrzny" msgid "Failed to connect: timeout" msgstr "Nie udało się połączyć: upłynął limit czasu" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to init wifi" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Nie można przeanalizować pliku MP3" @@ -947,7 +981,7 @@ msgstr "Niewłaściwa wielkość bufora" msgid "Input taking too long" msgstr "" -#: py/moduerrno.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "Błąd I/O" @@ -1040,6 +1074,10 @@ msgstr "Zły plik" msgid "Invalid format chunk size" msgstr "Zła wielkość fragmentu formatu" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "Podano nieprawidłową częstotliwość" @@ -1077,6 +1115,8 @@ msgstr "Zła nóżka dla prawego kanału" #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -1209,21 +1249,25 @@ msgstr "Brak DAC" msgid "No DMA channel found" msgstr "Nie znaleziono kanału DMA" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Brak pinu MISO" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Brak pinu MOSI" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Brak nóżki RX" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" @@ -1266,6 +1310,14 @@ msgstr "Nie określono klucza" msgid "No long integer support" msgstr "" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more channels available" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more timers available" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1329,6 +1381,14 @@ msgstr "Nieparzysta parzystość nie jest wspierana" msgid "Only 8 or 16 bit mono with " msgstr "Tylko 8 lub 16 bitów mono z " +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 SOCK_STREAM sockets supported" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Only IPv4 addresses supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -1346,6 +1406,10 @@ msgstr "" msgid "Only raw int supported for ip" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Out of sockets" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Nadpróbkowanie musi być wielokrotnością 8." @@ -1360,6 +1424,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "Nie można zmienić częstotliwości PWM gdy variable_frequency=False." +#: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" @@ -1405,6 +1470,12 @@ msgstr "Oraz moduły w systemie plików\n" msgid "Polygon needs at least 3 points" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +"instead" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/pulseio/PulseOut.c @@ -1434,12 +1505,13 @@ msgstr "" msgid "RNG Init Error" msgstr "" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c -#: ports/nrf/common-hal/rtc/RTC.c +#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" msgstr "Brak obsługi kalibracji RTC" @@ -1493,7 +1565,7 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA lub SCL wymagają podciągnięcia" @@ -1561,6 +1633,10 @@ msgstr "Fragment i wartość są różnych długości." msgid "Slices not supported" msgstr "Fragmenty nieobsługiwane" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "SocketPool can only be used with wifi.radio" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" msgstr "Bufory źródłowy i docelowy muszą mieć taką samą długość" @@ -1723,6 +1799,10 @@ msgstr "UUID nie jest typu str, int lub bytes" msgid "Unable to allocate buffers for signed conversion" msgstr "Nie udała się alokacja buforów do konwersji ze znakiem" +#: ports/esp32s2/common-hal/busio/I2C.c +msgid "Unable to create lock" +msgstr "" + #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" @@ -1749,6 +1829,11 @@ msgstr "Błąd zapisu do NVM." msgid "Unexpected nrfx uuid type" msgstr "Nieoczekiwany typ nrfx uuid" +#: ports/esp32s2/common-hal/socketpool/Socket.c +#, c-format +msgid "Unhandled ESP TLS error %d %d %x %d" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "Unknown failure" msgstr "" @@ -1784,7 +1869,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Zła szybkość transmisji" @@ -2030,6 +2115,7 @@ msgid "byteorder is not a string" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "bajty większe od 8 bitów są niewspierane" @@ -2545,7 +2631,7 @@ msgstr "złe wypełnienie" msgid "index is out of bounds" msgstr "indeks jest poza zakresem" -#: py/obj.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "indeks poza zakresem" @@ -3049,6 +3135,10 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "" +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "pop z pustego PulseIn" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3065,6 +3155,24 @@ msgstr "trzeci argument pow() nie może być 0" msgid "pow() with 3 arguments requires integers" msgstr "trzyargumentowe pow() wymaga liczb całkowitych" +#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +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 "" + #: extmod/modutimeq.c msgid "queue overflow" msgstr "przepełnienie kolejki" @@ -3308,7 +3416,8 @@ msgstr "indeks krotki poza zakresem" msgid "tuple/list has wrong length" msgstr "krotka/lista ma złą długość" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx i rx nie mogą być oba None" @@ -3564,9 +3673,6 @@ msgstr "" #~ msgid "object of type '%s' has no len()" #~ msgstr "obiekt typu '%s' nie ma len()" -#~ msgid "pop from an empty PulseIn" -#~ msgstr "pop z pustego PulseIn" - #~ msgid "pop from an empty set" #~ msgstr "pop z pustego zbioru" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 6a32208780..a565db0985 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-24 16:55-0500\n" +"POT-Creation-Date: 2020-09-29 11:11+0530\n" "PO-Revision-Date: 2020-09-22 21:30+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -288,7 +288,7 @@ msgstr "O endereço deve ter %d bytes de comprimento" msgid "Address type out of range" msgstr "O tipo do endereço está fora do alcance" -#: ports/nrf/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Todos os periféricos I2C estão em uso" @@ -296,11 +296,11 @@ msgstr "Todos os periféricos I2C estão em uso" msgid "All RX FIFOs in use" msgstr "Todos os FIFOs RX estão em uso" -#: ports/nrf/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Todos os periféricos SPI estão em uso" -#: ports/nrf/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "Todos os periféricos UART estão em uso" @@ -322,6 +322,9 @@ msgstr "Todos os temporizadores para este pino estão em uso" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c @@ -341,6 +344,10 @@ msgstr "Já há um ouvinte com todas as correspondências" msgid "Already running" msgstr "Já está em execução" +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "Already scanning for wifi networks" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "O AnalogIn não é compatível no pino informado" @@ -567,6 +574,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "Não é possível definir o valor quando a direção é inserida." +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "Não é possível definir o RTS ou CTS no modo RS485" @@ -661,14 +669,15 @@ msgid "Could not initialize SDCard" msgstr "Não foi possível inicializar o SDCard" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Não foi possível inicializar o UART" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "Não foi possível inicializar o canal" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "Não foi possível inicializar o temporizador" @@ -684,6 +693,10 @@ msgstr "Não foi possível reiniciar o temporizador" msgid "Could not restart PWM" msgstr "Não foi possível reiniciar o PWM" +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +msgid "Could not retrieve clock" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" msgstr "Não foi possível definir o endereço" @@ -774,6 +787,10 @@ msgstr "O modo do controlador não é usado quando a direção for inserida." msgid "ECB only operates on 16 bytes at a time" msgstr "O BCE opera apenas com 16 bytes por vez" +#: ports/esp32s2/common-hal/busio/SPI.c +msgid "ESP-IDF memory allocation failed" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -831,6 +848,10 @@ msgstr "Anúncios estendidos não compatíveis com a resposta da varredura." msgid "FFT is defined for ndarrays only" msgstr "O FFT é definido apenas para ndarrays" +#: ports/esp32s2/common-hal/socketpool/Socket.c +msgid "Failed SSL handshake" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Falha ao enviar comando." @@ -847,12 +868,21 @@ msgstr "Falha ao alocar buffer RX" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Falha ao alocar buffer RX de %d bytes" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to allocate Wifi memory" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +msgid "Failed to allocate wifi scan memory" +msgstr "" + #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "Falha ao conectar: erro interno" @@ -861,6 +891,10 @@ msgstr "Falha ao conectar: erro interno" msgid "Failed to connect: timeout" msgstr "Falha ao conectar: tempo limite" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to init wifi" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Falha ao analisar o arquivo MP3" @@ -958,7 +992,7 @@ msgstr "O tamanho do buffer está incorreto" msgid "Input taking too long" msgstr "A entrada está demorando demais" -#: py/moduerrno.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "Erro de entrada/saída" @@ -1051,6 +1085,10 @@ msgstr "Arquivo inválido" msgid "Invalid format chunk size" msgstr "Tamanho do pedaço de formato inválido" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "A frequência informada é inválida" @@ -1088,6 +1126,8 @@ msgstr "Pino inválido para canal direito" #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -1219,21 +1259,25 @@ msgstr "Nenhum DAC no chip" msgid "No DMA channel found" msgstr "Nenhum canal DMA encontrado" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Nenhum pino MISO" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Nenhum pino MOSI" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Nenhum pino RX" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" @@ -1276,6 +1320,14 @@ msgstr "Nenhuma chave foi definida" msgid "No long integer support" msgstr "Não há compatibilidade com inteiro longo" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more channels available" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more timers available" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "Não há mais temporizadores disponíveis neste pino." @@ -1340,6 +1392,14 @@ msgstr "A paridade ímpar não é compatível" msgid "Only 8 or 16 bit mono with " msgstr "Apenas mono com 8 ou 16 bits com " +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 SOCK_STREAM sockets supported" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Only IPv4 addresses supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -1361,6 +1421,10 @@ msgstr "" msgid "Only raw int supported for ip" msgstr "Apenas o int bruto é compatível para o ip" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Out of sockets" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "A superamostragem deve ser um múltiplo de 8." @@ -1379,6 +1443,7 @@ msgstr "" "A frequência do PWM não pode ser gravada quando variable_frequency for False " "na construção." +#: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" @@ -1427,6 +1492,12 @@ msgstr "Além de quaisquer módulos no sistema de arquivos\n" msgid "Polygon needs at least 3 points" msgstr "O Polígono precisa de pelo menos 3 pontos" +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +"instead" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/pulseio/PulseOut.c @@ -1461,12 +1532,13 @@ msgstr "Erro DeInit RNG" msgid "RNG Init Error" msgstr "Houve um erro na inicialização do RNG" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "A definição da inversão do RS485 quando não está no modo RS485" -#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c -#: ports/nrf/common-hal/rtc/RTC.c +#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" msgstr "A calibração RTC não é suportada nesta placa" @@ -1520,7 +1592,7 @@ msgstr "Executando no modo de segurança! " msgid "SD card CSD format not supported" msgstr "O formato CSD do Cartão SD não é compatível" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA ou SCL precisa de um pull up" @@ -1588,6 +1660,10 @@ msgstr "Fatie e avalie os diferentes comprimentos." msgid "Slices not supported" msgstr "Fatiamento não compatível" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "SocketPool can only be used with wifi.radio" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" msgstr "Os buffers da origem e do destino devem ter o mesmo comprimento" @@ -1764,6 +1840,10 @@ msgstr "O valor UUID não é um buffer str, int ou byte" msgid "Unable to allocate buffers for signed conversion" msgstr "Não é possível alocar buffers para conversão assinada" +#: ports/esp32s2/common-hal/busio/I2C.c +msgid "Unable to create lock" +msgstr "" + #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" @@ -1790,6 +1870,11 @@ msgstr "Não é possível gravar no nvm." msgid "Unexpected nrfx uuid type" msgstr "Tipo uuid nrfx inesperado" +#: ports/esp32s2/common-hal/socketpool/Socket.c +#, c-format +msgid "Unhandled ESP TLS error %d %d %x %d" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "Unknown failure" msgstr "Falha desconhecida" @@ -1827,7 +1912,7 @@ msgstr "" "dispositivo tenha sido recusado ou ignorado." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Taxa de transmissão não suportada" @@ -2077,6 +2162,7 @@ msgid "byteorder is not a string" msgstr "a ordem dos bytes não é uma cadeia de caracteres" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "bytes > 8 bits não suportado" @@ -2601,7 +2687,7 @@ msgstr "preenchimento incorreto" msgid "index is out of bounds" msgstr "o índice está fora dos limites" -#: py/obj.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "Índice fora do intervalo" @@ -3114,6 +3200,10 @@ msgstr "o pixel_shader deve ser displayio.Palette ou displayio.ColorConverter" msgid "polygon can only be registered in one parent" msgstr "o polígono só pode ser registrado em um pai" +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "pop a partir de um PulseIn vazio" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3130,6 +3220,24 @@ 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/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +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 "" + #: extmod/modutimeq.c msgid "queue overflow" msgstr "estouro de fila" @@ -3374,7 +3482,8 @@ msgstr "o índice da tupla está fora do intervalo" msgid "tuple/list has wrong length" msgstr "a tupla/lista está com tamanho incorreto" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "TX e RX não podem ser ambos" @@ -3666,9 +3775,6 @@ msgstr "zi deve estar na forma (n_section, 2)" #~ msgid "object of type '%s' has no len()" #~ msgstr "O objeto do tipo '%s' não possui len()" -#~ msgid "pop from an empty PulseIn" -#~ msgstr "pop a partir de um PulseIn vazio" - #~ msgid "pop from an empty set" #~ msgstr "pop a partir de um conjunto vazio" diff --git a/locale/sv.po b/locale/sv.po index c181e975c8..cb69ecef1d 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-24 16:55-0500\n" +"POT-Creation-Date: 2020-09-29 11:11+0530\n" "PO-Revision-Date: 2020-09-07 19:36+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -284,7 +284,7 @@ msgstr "Adressen måste vara %d byte lång" msgid "Address type out of range" msgstr "Adresstyp utanför intervallet" -#: ports/nrf/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "All I2C-kringutrustning används" @@ -292,11 +292,11 @@ msgstr "All I2C-kringutrustning används" msgid "All RX FIFOs in use" msgstr "" -#: ports/nrf/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "All SPI-kringutrustning används" -#: ports/nrf/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "Alla UART-kringutrustning används" @@ -318,6 +318,9 @@ msgstr "Alla timers för denna pinne är i bruk" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c @@ -337,6 +340,10 @@ msgstr "" msgid "Already running" msgstr "Kör redan" +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "Already scanning for wifi networks" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "AnalogIn stöds inte på angiven pinne" @@ -558,6 +565,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "Kan inte sätta värde när riktning är input." +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "Det går inte att specificera RTS eller CTS i RS485-läget" @@ -652,14 +660,15 @@ msgid "Could not initialize SDCard" msgstr "Kan inte initiera SD-kort" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Det gick inte att initiera UART" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "Det gick inte att initiera kanalen" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "Det gick inte att initialisera timern" @@ -675,6 +684,10 @@ msgstr "Det gick inte att återinitiera timern" msgid "Could not restart PWM" msgstr "Det gick inte att starta om PWM" +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +msgid "Could not retrieve clock" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" msgstr "Kan inte ange adress" @@ -765,6 +778,10 @@ msgstr "Drivläge används inte när riktning är input." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB arbetar endast på 16 byte åt gången" +#: ports/esp32s2/common-hal/busio/SPI.c +msgid "ESP-IDF memory allocation failed" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -822,6 +839,10 @@ msgstr "Utökad annonsering i kombination med skanningssvar stöds inte." msgid "FFT is defined for ndarrays only" msgstr "FFT är enbart definierade för ndarrays" +#: ports/esp32s2/common-hal/socketpool/Socket.c +msgid "Failed SSL handshake" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Det gick inte att skicka kommandot." @@ -838,12 +859,21 @@ msgstr "Det gick inte att tilldela RX-buffert" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Det gick inte att allokera RX-bufferten på %d byte" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to allocate Wifi memory" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +msgid "Failed to allocate wifi scan memory" +msgstr "" + #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "Det gick inte att ansluta: internt fel" @@ -852,6 +882,10 @@ msgstr "Det gick inte att ansluta: internt fel" msgid "Failed to connect: timeout" msgstr "Det gick inte att ansluta: timeout" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to init wifi" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Det gick inte att tolka MP3-filen" @@ -947,7 +981,7 @@ msgstr "Fel buffertstorlek" msgid "Input taking too long" msgstr "" -#: py/moduerrno.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "Indata-/utdatafel" @@ -1040,6 +1074,10 @@ msgstr "Felaktig fil" msgid "Invalid format chunk size" msgstr "Ogiltig formatsegmentstorlek" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "Ogiltig frekvens angiven" @@ -1077,6 +1115,8 @@ msgstr "Ogiltig pinne för höger kanal" #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -1209,21 +1249,25 @@ msgstr "Ingen DAC på chipet" msgid "No DMA channel found" msgstr "Ingen DMA-kanal hittades" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Ingen MISO-pinne" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Ingen MOSI-pinne" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Ingen RX-pinne" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" @@ -1266,6 +1310,14 @@ msgstr "Ingen nyckel angavs" msgid "No long integer support" msgstr "Inget stöd för långt heltal" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more channels available" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more timers available" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "Inga fler timers tillgängliga på denna pinne." @@ -1331,6 +1383,14 @@ msgstr "Udda paritet stöds inte" msgid "Only 8 or 16 bit mono with " msgstr "Endast 8 eller 16 bitars mono med " +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 SOCK_STREAM sockets supported" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Only IPv4 addresses supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -1351,6 +1411,10 @@ msgstr "" msgid "Only raw int supported for ip" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Out of sockets" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Översampling måste vara multipel av 8." @@ -1367,6 +1431,7 @@ msgstr "" "PWM-frekvensen är inte skrivbar när variable_frequency är falsk vid " "skapandet." +#: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" @@ -1415,6 +1480,12 @@ msgstr "Plus eventuella moduler i filsystemet\n" msgid "Polygon needs at least 3 points" msgstr "Polygonen behöver minst 3 punkter" +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +"instead" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/pulseio/PulseOut.c @@ -1447,12 +1518,13 @@ msgstr "RNG DeInit-fel" msgid "RNG Init Error" msgstr "RNG Init-fel" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "RS485-inversion specificerad när den inte är i RS485-läge" -#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c -#: ports/nrf/common-hal/rtc/RTC.c +#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" msgstr "RTC-kalibrering stöds inte av detta kort" @@ -1506,7 +1578,7 @@ msgstr "Kör i säkert läge! " msgid "SD card CSD format not supported" msgstr "SD-kort CSD-format stöds inte" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA eller SCL behöver en pullup" @@ -1574,6 +1646,10 @@ msgstr "Slice och värde har olika längd." msgid "Slices not supported" msgstr "Slice stöds inte" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "SocketPool can only be used with wifi.radio" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" msgstr "Käll- och målbuffertar måste ha samma längd" @@ -1746,6 +1822,10 @@ msgstr "UUID-värdet är inte str, int eller byte-buffert" msgid "Unable to allocate buffers for signed conversion" msgstr "Det går inte att allokera buffert för signerad konvertering" +#: ports/esp32s2/common-hal/busio/I2C.c +msgid "Unable to create lock" +msgstr "" + #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" @@ -1772,6 +1852,11 @@ msgstr "Det gick inte att skriva till nvm." msgid "Unexpected nrfx uuid type" msgstr "Oväntad nrfx uuid-typ" +#: ports/esp32s2/common-hal/socketpool/Socket.c +#, c-format +msgid "Unhandled ESP TLS error %d %d %x %d" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "Unknown failure" msgstr "" @@ -1809,7 +1894,7 @@ msgstr "" "eller ignorerades." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Baudrate stöd inte" @@ -2055,6 +2140,7 @@ msgid "byteorder is not a string" msgstr "byteorder är inte en sträng" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "bytes> 8 bitar stöds inte" @@ -2574,7 +2660,7 @@ msgstr "felaktig utfyllnad" msgid "index is out of bounds" msgstr "index är utanför gränserna" -#: py/obj.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index utanför intervallet" @@ -3081,6 +3167,10 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "polygon kan endast registreras i en förälder" +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "pop från en tom PulseIn" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3097,6 +3187,24 @@ 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/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +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 "" + #: extmod/modutimeq.c msgid "queue overflow" msgstr "köstorlek överskreds" @@ -3341,7 +3449,8 @@ msgstr "tupelindex utanför intervallet" msgid "tuple/list has wrong length" msgstr "tupel/lista har fel längd" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx och rx kan inte båda vara None" @@ -3624,9 +3733,6 @@ msgstr "zi måste vara i formen (n_section, 2)" #~ msgid "object of type '%s' has no len()" #~ msgstr "objekt av typen '%s' har ingen len()" -#~ msgid "pop from an empty PulseIn" -#~ msgstr "pop från en tom PulseIn" - #~ msgid "pop from an empty set" #~ msgstr "pop från en tom uppsättning" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 2b146478c1..a9c8c422ea 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-24 16:55-0500\n" +"POT-Creation-Date: 2020-09-29 11:11+0530\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -285,7 +285,7 @@ msgstr "Dìzhǐ bìxū shì %d zì jié zhǎng" msgid "Address type out of range" msgstr "Dìzhǐ lèixíng chāochū fànwéi" -#: ports/nrf/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Suǒyǒu I2C wàiwéi qì zhèngzài shǐyòng" @@ -293,11 +293,11 @@ msgstr "Suǒyǒu I2C wàiwéi qì zhèngzài shǐyòng" msgid "All RX FIFOs in use" msgstr "" -#: ports/nrf/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Suǒyǒu SPI wàiwéi qì zhèngzài shǐyòng" -#: ports/nrf/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" msgstr "Suǒyǒu UART wàiwéi zhèngzài shǐyòng" @@ -319,6 +319,9 @@ msgstr "Cǐ yǐn jiǎo de suǒyǒu jìshí qì zhèngzài shǐyòng" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c @@ -338,6 +341,10 @@ msgstr "" msgid "Already running" msgstr "yǐ zài yùn xíng" +#: ports/esp32s2/common-hal/wifi/Radio.c +msgid "Already scanning for wifi networks" +msgstr "" + #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" msgstr "Gěi dìng de yǐn jiǎo bù zhīchí AnalogIn" @@ -557,6 +564,7 @@ msgstr "Wúfǎ chóng zhì wèi bootloader, yīnwèi méiyǒu bootloader cúnzà msgid "Cannot set value when direction is input." msgstr "Dāng fāngxiàng xiàng nèi shí, bùnéng shèzhì gāi zhí." +#: ports/esp32s2/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" @@ -649,14 +657,15 @@ msgid "Could not initialize SDCard" msgstr "wú fǎ chū shǐ huà SDCard" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Wúfǎ chūshǐhuà UART" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" msgstr "Wúfǎ chūshǐhuà píndào" -#: ports/stm/common-hal/pwmio/PWMOut.c +#: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" msgstr "Wúfǎ chūshǐhuà jìshí qì" @@ -672,6 +681,10 @@ msgstr "Wúfǎ chóngxīn qǐdòng jìshí qì" msgid "Could not restart PWM" msgstr "Wúfǎ chóngqǐ PWM" +#: ports/esp32s2/common-hal/neopixel_write/__init__.c +msgid "Could not retrieve clock" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" msgstr "wú fǎ shè zhì dì zhǐ" @@ -762,6 +775,10 @@ msgstr "Fāngxiàng shūrù shí qūdòng móshì méiyǒu shǐyòng." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB yí cì zhǐ shǐ yòng 16 gè zì jié" +#: ports/esp32s2/common-hal/busio/SPI.c +msgid "ESP-IDF memory allocation failed" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -819,6 +836,10 @@ msgstr "Bù zhīchí dài yǒu sǎomiáo xiǎngyìng de kuòzhǎn guǎngbò." msgid "FFT is defined for ndarrays only" msgstr "FFT jǐn wéi ndarrays dìng yì" +#: ports/esp32s2/common-hal/socketpool/Socket.c +msgid "Failed SSL handshake" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Fāsòng mìnglìng shībài." @@ -835,12 +856,21 @@ msgstr "Fēnpèi RX huǎnchōng shībài" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Fēnpèi RX huǎnchōng qū%d zì jié shībài" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to allocate Wifi memory" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +msgid "Failed to allocate wifi scan memory" +msgstr "" + #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "Liánjiē shībài: Nèibù cuòwù" @@ -849,6 +879,10 @@ msgstr "Liánjiē shībài: Nèibù cuòwù" msgid "Failed to connect: timeout" msgstr "Liánjiē shībài: Chāoshí" +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Failed to init wifi" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Wúfǎ jiěxī MP3 wénjiàn" @@ -944,7 +978,7 @@ msgstr "Huǎnchōng qū dàxiǎo bù zhèngquè" msgid "Input taking too long" msgstr "" -#: py/moduerrno.c +#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "Shūrù/shūchū cuòwù" @@ -1037,6 +1071,10 @@ msgstr "Wúxiào de wénjiàn" msgid "Invalid format chunk size" msgstr "Géshì kuài dàxiǎo wúxiào" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "Invalid frequency" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" msgstr "Tígōng de pínlǜ wúxiào" @@ -1074,6 +1112,8 @@ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào" #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -1205,21 +1245,25 @@ msgstr "Méiyǒu DAC zài xīnpiàn shàng de" msgid "No DMA channel found" msgstr "Wèi zhǎodào DMA píndào" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Méiyǒu MISO yǐn jiǎo" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Méiyǒu MOSI yǐn jiǎo" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Wèi zhǎodào RX yǐn jiǎo" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" @@ -1262,6 +1306,14 @@ msgstr "Wèi zhǐdìng mì yào" msgid "No long integer support" msgstr "Méiyǒu zhǎng zhěngshù zhīchí" +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more channels available" +msgstr "" + +#: ports/esp32s2/common-hal/pwmio/PWMOut.c +msgid "No more timers available" +msgstr "" + #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." msgstr "Gāi yǐn jiǎo shàng méiyǒu kěyòng de dìngshí qì." @@ -1326,6 +1378,14 @@ msgstr "Bù zhīchí jīshù" msgid "Only 8 or 16 bit mono with " msgstr "Zhǐyǒu 8 huò 16 wèi dānwèi " +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Only IPv4 SOCK_STREAM sockets supported" +msgstr "" + +#: ports/esp32s2/common-hal/wifi/__init__.c +msgid "Only IPv4 addresses supported" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" @@ -1347,6 +1407,10 @@ msgstr "" msgid "Only raw int supported for ip" msgstr "" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "Out of sockets" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Guò cǎiyàng bìxū shì 8 de bèishù." @@ -1362,6 +1426,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "Dāng biànliàng_pínlǜ shì False zài jiànzhú shí PWM pínlǜ bùkě xiě." +#: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" @@ -1410,6 +1475,12 @@ msgstr "Zài wénjiàn xìtǒng shàng tiānjiā rènhé mókuài\n" msgid "Polygon needs at least 3 points" msgstr "Duōbiānxíng zhìshǎo xūyào 3 diǎn" +#: ports/esp32s2/common-hal/pulseio/PulseOut.c +msgid "" +"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +"instead" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/pulseio/PulseOut.c @@ -1439,12 +1510,13 @@ msgstr "RNG qǔxiāo chūshǐhuà cuòwù" msgid "RNG Init Error" msgstr "RNG chūshǐhuà cuòwù" +#: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "Wèi chǔyú RS485 móshì shí zhǐdìngle RS485 fǎn zhuǎn" -#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c -#: ports/nrf/common-hal/rtc/RTC.c +#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" msgstr "Cǐ bǎn bù zhīchí RTC jiàozhǔn" @@ -1498,7 +1570,7 @@ msgstr "Zài ānquán móshì xià yùnxíng!" msgid "SD card CSD format not supported" msgstr "Bù zhīchí SD kǎ CSD géshì" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA huò SCL xūyào lādòng" @@ -1566,6 +1638,10 @@ msgstr "Qiēpiàn hé zhí bùtóng chángdù." msgid "Slices not supported" msgstr "Qiēpiàn bù shòu zhīchí" +#: ports/esp32s2/common-hal/socketpool/SocketPool.c +msgid "SocketPool can only be used with wifi.radio" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" msgstr "Yuán huǎnchōng qū hé mùbiāo huǎnchōng qū de chángdù bìxū xiāngtóng" @@ -1737,6 +1813,10 @@ msgstr "UUID zhí bùshì str,int huò zì jié huǎnchōng qū" msgid "Unable to allocate buffers for signed conversion" msgstr "Wúfǎ fēnpèi huǎnchōng qū yòng yú qiānmíng zhuǎnhuàn" +#: ports/esp32s2/common-hal/busio/I2C.c +msgid "Unable to create lock" +msgstr "" + #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" @@ -1763,6 +1843,11 @@ msgstr "Wúfǎ xiě rù nvm." msgid "Unexpected nrfx uuid type" msgstr "Yìwài de nrfx uuid lèixíng" +#: ports/esp32s2/common-hal/socketpool/Socket.c +#, c-format +msgid "Unhandled ESP TLS error %d %d %x %d" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "Unknown failure" msgstr "" @@ -1800,7 +1885,7 @@ msgstr "" "huò hūlüè." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/stm/common-hal/busio/I2C.c +#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Bù zhīchí de baudrate" @@ -2046,6 +2131,7 @@ msgid "byteorder is not a string" msgstr "byteorder bùshì zìfú chuàn" #: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "zì jié > 8 wèi" @@ -2564,7 +2650,7 @@ msgstr "bù zhèngquè de tiánchōng" msgid "index is out of bounds" msgstr "suǒyǐn chāochū fànwéi" -#: py/obj.c +#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "suǒyǐn chāochū fànwéi" @@ -3069,6 +3155,10 @@ msgstr "pixel_shader bìxū shì displayio.Palette huò displayio.ColorConverter msgid "polygon can only be registered in one parent" msgstr "duōbiānxíng zhī néng zài yīgè fù jí zhōng zhùcè" +#: ports/esp32s2/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "cóng kōng de PulseIn dànchū dànchū" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3085,6 +3175,24 @@ 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/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h +#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h +#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +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 "" + #: extmod/modutimeq.c msgid "queue overflow" msgstr "duìliè yìchū" @@ -3329,7 +3437,8 @@ msgstr "yuán zǔ suǒyǐn chāochū fànwéi" msgid "tuple/list has wrong length" msgstr "yuán zǔ/lièbiǎo chángdù cuòwù" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx hé rx bùnéng dōu shì wú" @@ -3606,9 +3715,6 @@ msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" #~ msgid "object of type '%s' has no len()" #~ msgstr "lèixíng '%s' de duìxiàng méiyǒu chángdù" -#~ msgid "pop from an empty PulseIn" -#~ msgstr "cóng kōng de PulseIn dànchū dànchū" - #~ msgid "pop from an empty set" #~ msgstr "cóng kōng jí dànchū" From 2f6d7c90028304d2f38dc17b88ec0514ffe1f256 Mon Sep 17 00:00:00 2001 From: "Ryan T. Hamilton" Date: Tue, 29 Sep 2020 13:41:56 -0700 Subject: [PATCH 1022/1293] Make sure you're a STA before connecting --- ports/esp32s2/common-hal/wifi/Radio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index a0b8b6adc5..277a837fdc 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -106,6 +106,8 @@ void common_hal_wifi_radio_stop_scanning_networks(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) { // check enabled + start_station(self); + wifi_config_t* config = &self->sta_config; memcpy(&config->sta.ssid, ssid, ssid_len); config->sta.ssid[ssid_len] = 0; From a2a0aa058f3330478343faed0345b6a02b0a3b3d Mon Sep 17 00:00:00 2001 From: Seon Rozenblum Date: Wed, 23 Sep 2020 05:20:10 +1000 Subject: [PATCH 1023/1293] Updated UM boards --- .../adafruit_dotstar.py | 198 ++++++++++ .../adafruit_pypixelbuf.py | 374 ++++++++++++++++++ .../adafruit_requests.py | 311 +++++++++++++++ .../unexpectedmaker_feathers2/feathers2.py | 47 +++ .../unexpectedmaker_feathers2/mpconfigboard.h | 5 +- .../mpconfigboard.mk | 4 + .../boards/unexpectedmaker_feathers2/pins.c | 72 +++- .../adafruit_dotstar.py | 198 ++++++++++ .../adafruit_pypixelbuf.py | 374 ++++++++++++++++++ .../board.c | 56 +++ .../feathers2.py | 47 +++ .../mpconfigboard.h | 40 ++ .../mpconfigboard.mk | 21 + .../pins.c | 56 +++ .../sdkconfig | 35 ++ .../unexpectedmaker_pros2/adafruit_dotstar.py | 198 ++++++++++ .../adafruit_pypixelbuf.py | 374 ++++++++++++++++++ .../boards/unexpectedmaker_pros2/board.c | 56 +++ .../unexpectedmaker_pros2/mpconfigboard.h | 35 ++ .../unexpectedmaker_pros2/mpconfigboard.mk | 21 + .../boards/unexpectedmaker_pros2/pins.c | 58 +++ .../boards/unexpectedmaker_pros2/pros2.py | 63 +++ .../boards/unexpectedmaker_pros2/sdkconfig | 35 ++ 23 files changed, 2663 insertions(+), 15 deletions(-) create mode 100755 ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_dotstar.py create mode 100755 ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_pypixelbuf.py create mode 100755 ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_requests.py create mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2/feathers2.py create mode 100755 ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/adafruit_dotstar.py create mode 100755 ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/adafruit_pypixelbuf.py create mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/board.c create mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/feathers2.py create mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h create mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk create mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c create mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/sdkconfig create mode 100755 ports/esp32s2/boards/unexpectedmaker_pros2/adafruit_dotstar.py create mode 100755 ports/esp32s2/boards/unexpectedmaker_pros2/adafruit_pypixelbuf.py create mode 100644 ports/esp32s2/boards/unexpectedmaker_pros2/board.c create mode 100644 ports/esp32s2/boards/unexpectedmaker_pros2/mpconfigboard.h create mode 100644 ports/esp32s2/boards/unexpectedmaker_pros2/mpconfigboard.mk create mode 100644 ports/esp32s2/boards/unexpectedmaker_pros2/pins.c create mode 100644 ports/esp32s2/boards/unexpectedmaker_pros2/pros2.py create mode 100644 ports/esp32s2/boards/unexpectedmaker_pros2/sdkconfig diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_dotstar.py b/ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_dotstar.py new file mode 100755 index 0000000000..65fbbe8683 --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_dotstar.py @@ -0,0 +1,198 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Damien P. George (original Neopixel object) +# Copyright (c) 2017 Ladyada +# Copyright (c) 2017 Scott Shawcroft for Adafruit Industries +# Copyright (c) 2019 Roy 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. + +""" +`adafruit_dotstar` - DotStar strip driver (for CircuitPython 5.0+ with _pixelbuf) +================================================================================= + +* Author(s): Damien P. George, Limor Fried, Scott Shawcroft & Roy Hooper +""" + +# pylint: disable=ungrouped-imports +import sys +import busio +import digitalio + +if sys.implementation.version[0] < 5: + import adafruit_pypixelbuf as _pixelbuf +else: + try: + import _pixelbuf + except ImportError: + import adafruit_pypixelbuf as _pixelbuf + +__version__ = "0.0.0-auto.0" +__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DotStar.git" + +START_HEADER_SIZE = 4 + +# Pixel color order constants +RBG = "PRBG" +"""Red Blue Green""" +RGB = "PRGB" +"""Red Green Blue""" +GRB = "PGRB" +"""Green Red Blue""" +GBR = "PGBR" +"""Green Blue Red""" +BRG = "PBRG" +"""Blue Red Green""" +BGR = "PBGR" +"""Blue Green Red""" + + +class DotStar(_pixelbuf.PixelBuf): + """ + A sequence of dotstars. + + :param ~microcontroller.Pin clock: The pin to output dotstar clock on. + :param ~microcontroller.Pin data: The pin to output dotstar data on. + :param int n: The number of dotstars in the chain + :param float brightness: Brightness of the pixels between 0.0 and 1.0 + :param bool auto_write: True if the dotstars should immediately change when + set. If False, `show` must be called explicitly. + :param str pixel_order: Set the pixel order on the strip - different + strips implement this differently. If you send red, and it looks blue + or green on the strip, modify this! It should be one of the values above. + :param int baudrate: Desired clock rate if using hardware SPI (ignored if + using 'soft' SPI). This is only a recommendation; the actual clock + rate may be slightly different depending on what the system hardware + can provide. + + Example for Gemma M0: + + .. code-block:: python + + import adafruit_dotstar + import time + from board import * + + RED = 0x100000 + + with adafruit_dotstar.DotStar(APA102_SCK, APA102_MOSI, 1) as pixels: + pixels[0] = RED + time.sleep(2) + + .. py:method:: DotStar.show() + + Shows the new colors on the dotstars themselves if they haven't already + been autowritten. + + The colors may or may not be showing after this function returns because + it may be done asynchronously. + + .. py:method:: DotStar.fill(color) + + Colors all dotstars the given ***color***. + + .. py:attribute:: brightness + + Overall brightness of all dotstars (0 to 1.0) + """ + + def __init__( + self, + clock, + data, + n, + *, + brightness=1.0, + auto_write=True, + pixel_order=BGR, + baudrate=4000000 + ): + self._spi = None + try: + self._spi = busio.SPI(clock, MOSI=data) + while not self._spi.try_lock(): + pass + self._spi.configure(baudrate=baudrate) + + except (NotImplementedError, ValueError): + self.dpin = digitalio.DigitalInOut(data) + self.cpin = digitalio.DigitalInOut(clock) + self.dpin.direction = digitalio.Direction.OUTPUT + self.cpin.direction = digitalio.Direction.OUTPUT + self.cpin.value = False + + # Supply one extra clock cycle for each two pixels in the strip. + trailer_size = n // 16 + if n % 16 != 0: + trailer_size += 1 + + # Four empty bytes for the header. + header = bytearray(START_HEADER_SIZE) + # 0xff bytes for the trailer. + trailer = bytearray(b"\xff") * trailer_size + + super().__init__( + n, + byteorder=pixel_order, + brightness=brightness, + auto_write=auto_write, + header=header, + trailer=trailer, + ) + + def deinit(self): + """Blank out the DotStars and release the resources.""" + self.fill(0) + self.show() + if self._spi: + self._spi.deinit() + else: + self.dpin.deinit() + self.cpin.deinit() + + def __enter__(self): + return self + + def __exit__(self, exception_type, exception_value, traceback): + self.deinit() + + def __repr__(self): + return "[" + ", ".join([str(x) for x in self]) + "]" + + @property + def n(self): + """ + The number of dotstars in the chain (read-only) + """ + return len(self) + + def _transmit(self, buffer): + if self._spi: + self._spi.write(buffer) + else: + self._ds_writebytes(buffer) + + def _ds_writebytes(self, buffer): + for b in buffer: + for _ in range(8): + self.dpin.value = b & 0x80 + self.cpin.value = True + self.cpin.value = False + b = b << 1 + self.cpin.value = False diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_pypixelbuf.py b/ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_pypixelbuf.py new file mode 100755 index 0000000000..3cb83e970c --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_pypixelbuf.py @@ -0,0 +1,374 @@ +# The MIT License (MIT) +# +# Based on the Adafruit NeoPixel and Adafruit Dotstar CircuitPython drivers. +# Copyright (c) 2019-2020 Roy 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. + +""" +`adafruit_pypixelbuf` - A pure python implementation of _pixelbuf +================================================================= +This class is used when _pixelbuf is not available in CircuitPython. It is based on the work +in neopixel.py and adafruit_dotstar.py. + +* Author(s): Damien P. George & Limor Fried & Scott Shawcroft & Roy Hooper +""" + +DOTSTAR_LED_START_FULL_BRIGHT = 0xFF +DOTSTAR_LED_START = 0b11100000 # Three "1" bits, followed by 5 brightness bits +DOTSTAR_LED_BRIGHTNESS = 0b00011111 + + +class PixelBuf: # pylint: disable=too-many-instance-attributes + """ + A sequence of RGB/RGBW pixels. + + This is the pure python implementation of CircuitPython's _pixelbuf. + + :param ~int n: Number of pixels + :param ~str byteorder: Byte order string constant (also sets bpp) + :param ~float brightness: Brightness (0 to 1.0, default 1.0) + :param ~bool auto_write: Whether to automatically write pixels (Default False) + :param bytes header: Sequence of bytes to always send before pixel values. + :param bytes trailer: Sequence of bytes to always send after pixel values. + """ + + def __init__( # pylint: disable=too-many-locals,too-many-arguments + self, + n, + byteorder="BGR", + brightness=1.0, + auto_write=False, + header=None, + trailer=None, + ): + + bpp, byteorder_tuple, has_white, dotstar_mode = self.parse_byteorder(byteorder) + + self.auto_write = False + + effective_bpp = 4 if dotstar_mode else bpp + _bytes = effective_bpp * n + buf = bytearray(_bytes) + offset = 0 + + if header is not None: + if not isinstance(header, bytearray): + raise TypeError("header must be a bytearray") + buf = header + buf + offset = len(header) + + if trailer is not None: + if not isinstance(trailer, bytearray): + raise TypeError("trailer must be a bytearray") + buf += trailer + + self._pixels = n + self._bytes = _bytes + self._byteorder = byteorder_tuple + self._byteorder_string = byteorder + self._has_white = has_white + self._bpp = bpp + self._pre_brightness_buffer = None + self._post_brightness_buffer = buf + self._offset = offset + self._dotstar_mode = dotstar_mode + self._pixel_step = effective_bpp + + if dotstar_mode: + self._byteorder_tuple = ( + byteorder_tuple[0] + 1, + byteorder_tuple[1] + 1, + byteorder_tuple[2] + 1, + 0, + ) + # Initialize the buffer with the dotstar start bytes. + for i in range(self._offset, self._bytes + self._offset, 4): + self._post_brightness_buffer[i] = DOTSTAR_LED_START_FULL_BRIGHT + + self._brightness = 1.0 + self.brightness = brightness + + self.auto_write = auto_write + + @staticmethod + def parse_byteorder(byteorder): + """ + Parse a Byteorder string for validity and determine bpp, byte order, and + dostar brightness bits. + + Byteorder strings may contain the following characters: + R - Red + G - Green + B - Blue + W - White + P - PWM (PWM Duty cycle for pixel - dotstars 0 - 1.0) + + :param: ~str bpp: bpp string. + :return: ~tuple: bpp, byteorder, has_white, dotstar_mode + """ + bpp = len(byteorder) + dotstar_mode = False + has_white = False + + if byteorder.strip("RGBWP") != "": + raise ValueError("Invalid Byteorder string") + + try: + r = byteorder.index("R") + g = byteorder.index("G") + b = byteorder.index("B") + except ValueError: + raise ValueError("Invalid Byteorder string") + if "W" in byteorder: + w = byteorder.index("W") + byteorder = (r, g, b, w) + has_white = True + elif "P" in byteorder: + lum = byteorder.index("P") + byteorder = (r, g, b, lum) + dotstar_mode = True + else: + byteorder = (r, g, b) + + return bpp, byteorder, has_white, dotstar_mode + + @property + def bpp(self): + """ + The number of bytes per pixel in the buffer (read-only). + """ + return self._bpp + + @property + def brightness(self): + """ + Float value between 0 and 1. Output brightness. + + When brightness is less than 1.0, a second buffer will be used to store the color values + before they are adjusted for brightness. + """ + return self._brightness + + @brightness.setter + def brightness(self, value): + value = min(max(value, 0.0), 1.0) + change = value - self._brightness + if -0.001 < change < 0.001: + return + + self._brightness = value + + if self._pre_brightness_buffer is None: + self._pre_brightness_buffer = bytearray(self._post_brightness_buffer) + + # Adjust brightness of existing pixels + offset_check = self._offset % self._pixel_step + for i in range(self._offset, self._bytes + self._offset): + # Don't adjust per-pixel luminance bytes in dotstar mode + if self._dotstar_mode and (i % 4 != offset_check): + continue + self._post_brightness_buffer[i] = int( + self._pre_brightness_buffer[i] * self._brightness + ) + + if self.auto_write: + self.show() + + @property + def byteorder(self): + """ + ByteOrder string for the buffer (read-only) + """ + return self._byteorder_string + + def __len__(self): + """ + Number of pixels. + """ + return self._pixels + + def show(self): + """ + Call the associated write function to display the pixels + """ + return self._transmit(self._post_brightness_buffer) + + def fill(self, color): + """ + Fills the given pixelbuf with the given color. + :param pixelbuf: A pixel object. + :param color: Color to set. + """ + r, g, b, w = self._parse_color(color) + for i in range(self._pixels): + self._set_item(i, r, g, b, w) + if self.auto_write: + self.show() + + def _parse_color(self, value): + r = 0 + g = 0 + b = 0 + w = 0 + if isinstance(value, int): + r = value >> 16 + g = (value >> 8) & 0xFF + b = value & 0xFF + w = 0 + + if self._dotstar_mode: + w = 1.0 + else: + if len(value) < 3 or len(value) > 4: + raise ValueError( + "Expected tuple of length {}, got {}".format(self._bpp, len(value)) + ) + if len(value) == self._bpp: + if self._bpp == 3: + r, g, b = value + else: + r, g, b, w = value + elif len(value) == 3: + r, g, b = value + if self._dotstar_mode: + w = 1.0 + + if self._bpp == 4: + if self._dotstar_mode: + # LED startframe is three "1" bits, followed by 5 brightness bits + # then 8 bits for each of R, G, and B. The order of those 3 are configurable and + # vary based on hardware + w = (int(w * 31) & 0b00011111) | DOTSTAR_LED_START + elif ( + self._has_white + and (isinstance(value, int) or len(value) == 3) + and r == g + and g == b + ): + # If all components are the same and we have a white pixel then use it + # instead of the individual components when all 4 values aren't explicitly given. + w = r + r = 0 + g = 0 + b = 0 + + return (r, g, b, w) + + def _set_item( + self, index, r, g, b, w + ): # pylint: disable=too-many-locals,too-many-branches,too-many-arguments + if index < 0: + index += len(self) + if index >= self._pixels or index < 0: + raise IndexError + offset = self._offset + (index * self._bpp) + + if self._pre_brightness_buffer is not None: + if self._bpp == 4: + self._pre_brightness_buffer[offset + self._byteorder[3]] = w + self._pre_brightness_buffer[offset + self._byteorder[0]] = r + self._pre_brightness_buffer[offset + self._byteorder[1]] = g + self._pre_brightness_buffer[offset + self._byteorder[2]] = b + + if self._bpp == 4: + # Only apply brightness if w is actually white (aka not DotStar.) + if not self._dotstar_mode: + w = int(w * self._brightness) + self._post_brightness_buffer[offset + self._byteorder[3]] = w + + self._post_brightness_buffer[offset + self._byteorder[0]] = int( + r * self._brightness + ) + self._post_brightness_buffer[offset + self._byteorder[1]] = int( + g * self._brightness + ) + self._post_brightness_buffer[offset + self._byteorder[2]] = int( + b * self._brightness + ) + + def __setitem__(self, index, val): + if isinstance(index, slice): + start, stop, step = index.indices(self._pixels) + for val_i, in_i in enumerate(range(start, stop, step)): + r, g, b, w = self._parse_color(val[val_i]) + self._set_item(in_i, r, g, b, w) + else: + r, g, b, w = self._parse_color(val) + self._set_item(index, r, g, b, w) + + if self.auto_write: + self.show() + + def _getitem(self, index): + start = self._offset + (index * self._bpp) + buffer = ( + self._pre_brightness_buffer + if self._pre_brightness_buffer is not None + else self._post_brightness_buffer + ) + value = [ + buffer[start + self._byteorder[0]], + buffer[start + self._byteorder[1]], + buffer[start + self._byteorder[2]], + ] + if self._has_white: + value.append(buffer[start + self._byteorder[3]]) + elif self._dotstar_mode: + value.append( + (buffer[start + self._byteorder[3]] & DOTSTAR_LED_BRIGHTNESS) / 31.0 + ) + return value + + def __getitem__(self, index): + if isinstance(index, slice): + out = [] + for in_i in range( + *index.indices(len(self._post_brightness_buffer) // self._bpp) + ): + out.append(self._getitem(in_i)) + return out + if index < 0: + index += len(self) + if index >= self._pixels or index < 0: + raise IndexError + return self._getitem(index) + + def _transmit(self, buffer): + raise NotImplementedError("Must be subclassed") + + +def wheel(pos): + """ + Helper to create a colorwheel. + + :param pos: int 0-255 of color value to return + :return: tuple of RGB values + """ + # Input a value 0 to 255 to get a color value. + # The colours are a transition r - g - b - back to r. + if pos < 0 or pos > 255: + return 0, 0, 0 + if pos < 85: + return 255 - pos * 3, pos * 3, 0 + if pos < 170: + pos -= 85 + return 0, 255 - pos * 3, pos * 3 + pos -= 170 + return pos * 3, 0, 255 - pos * 3 diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_requests.py b/ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_requests.py new file mode 100755 index 0000000000..0888937bf8 --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_requests.py @@ -0,0 +1,311 @@ +# The MIT License (MIT) +# +# Copyright (c) 2019 ladyada 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. +""" +`adafruit_requests` +================================================================================ + +A requests-like library for web interfacing + + +* Author(s): ladyada, Paul Sokolovsky + +Implementation Notes +-------------------- + +Adapted from https://github.com/micropython/micropython-lib/tree/master/urequests + +micropython-lib consists of multiple modules from different sources and +authors. Each module comes under its own licensing terms. Short name of +a license can be found in a file within a module directory (usually +metadata.txt or setup.py). Complete text of each license used is provided +at https://github.com/micropython/micropython-lib/blob/master/LICENSE + +author='Paul Sokolovsky' +license='MIT' + +**Software and Dependencies:** + +* Adafruit CircuitPython firmware for the supported boards: + https://github.com/adafruit/circuitpython/releases + +""" + +import gc + +__version__ = "0.0.0-auto.0" +__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Requests.git" + +_the_interface = None # pylint: disable=invalid-name +_the_sock = None # pylint: disable=invalid-name + + +def set_socket(sock, iface=None): + """Helper to set the global socket and optionally set the global network interface. + :param sock: socket object. + :param iface: internet interface object + + """ + global _the_sock # pylint: disable=invalid-name, global-statement + _the_sock = sock + if iface: + global _the_interface # pylint: disable=invalid-name, global-statement + _the_interface = iface + _the_sock.set_interface(iface) + + +class Response: + """The response from a request, contains all the headers/content""" + + encoding = None + + def __init__(self, sock): + self.socket = sock + self.encoding = "utf-8" + self._cached = None + self.status_code = None + self.reason = None + self._read_so_far = 0 + self.headers = {} + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): + """Close, delete and collect the response data""" + if self.socket: + self.socket.close() + del self.socket + del self._cached + gc.collect() + + @property + def content(self): + """The HTTP content direct from the socket, as bytes""" + # print(self.headers) + try: + content_length = int(self.headers["content-length"]) + except KeyError: + content_length = 0 + # print("Content length:", content_length) + if self._cached is None: + try: + self._cached = self.socket.recv(content_length) + finally: + self.socket.close() + self.socket = None + # print("Buffer length:", len(self._cached)) + return self._cached + + @property + def text(self): + """The HTTP content, encoded into a string according to the HTTP + header encoding""" + return str(self.content, self.encoding) + + def json(self): + """The HTTP content, parsed into a json dictionary""" + # pylint: disable=import-outside-toplevel + try: + import json as json_module + except ImportError: + import ujson as json_module + return json_module.loads(self.content) + + def iter_content(self, chunk_size=1, decode_unicode=False): + """An iterator that will stream data by only reading 'chunk_size' + bytes and yielding them, when we can't buffer the whole datastream""" + if decode_unicode: + raise NotImplementedError("Unicode not supported") + + while True: + chunk = self.socket.recv(chunk_size) + if chunk: + yield chunk + else: + return + + +# pylint: disable=too-many-branches, too-many-statements, unused-argument, too-many-arguments, too-many-locals +def request(method, url, data=None, json=None, headers=None, stream=False, timeout=1): + """Perform an HTTP request to the given url which we will parse to determine + whether to use SSL ('https://') or not. We can also send some provided 'data' + or a json dictionary which we will stringify. 'headers' is optional HTTP headers + sent along. 'stream' will determine if we buffer everything, or whether to only + read only when requested + """ + global _the_interface # pylint: disable=global-statement, invalid-name + global _the_sock # pylint: disable=global-statement, invalid-name + + if not headers: + headers = {} + + try: + proto, dummy, host, path = url.split("/", 3) + # replace spaces in path + path = path.replace(" ", "%20") + except ValueError: + proto, dummy, host = url.split("/", 2) + path = "" + if proto == "http:": + port = 80 + elif proto == "https:": + port = 443 + else: + raise ValueError("Unsupported protocol: " + proto) + + if ":" in host: + host, port = host.split(":", 1) + port = int(port) + + addr_info = _the_sock.getaddrinfo(host, port, 0, _the_sock.SOCK_STREAM)[0] + sock = _the_sock.socket(addr_info[0], addr_info[1], addr_info[2]) + resp = Response(sock) # our response + + sock.settimeout(timeout) # socket read timeout + + try: + if proto == "https:": + conntype = _the_interface.TLS_MODE + sock.connect( + (host, port), conntype + ) # for SSL we need to know the host name + else: + conntype = _the_interface.TCP_MODE + sock.connect(addr_info[-1], conntype) + sock.send( + b"%s /%s HTTP/1.0\r\n" % (bytes(method, "utf-8"), bytes(path, "utf-8")) + ) + if "Host" not in headers: + sock.send(b"Host: %s\r\n" % bytes(host, "utf-8")) + if "User-Agent" not in headers: + sock.send(b"User-Agent: Adafruit CircuitPython\r\n") + # Iterate over keys to avoid tuple alloc + for k in headers: + sock.send(k.encode()) + sock.send(b": ") + sock.send(headers[k].encode()) + sock.send(b"\r\n") + if json is not None: + assert data is None + # pylint: disable=import-outside-toplevel + try: + import json as json_module + except ImportError: + import ujson as json_module + # pylint: enable=import-outside-toplevel + data = json_module.dumps(json) + sock.send(b"Content-Type: application/json\r\n") + if data: + if isinstance(data, dict): + sock.send(b"Content-Type: application/x-www-form-urlencoded\r\n") + _post_data = "" + for k in data: + _post_data = "{}&{}={}".format(_post_data, k, data[k]) + data = _post_data[1:] + sock.send(b"Content-Length: %d\r\n" % len(data)) + sock.send(b"\r\n") + if data: + if isinstance(data, bytearray): + sock.send(bytes(data)) + else: + sock.send(bytes(data, "utf-8")) + + line = sock.readline() + # print(line) + line = line.split(None, 2) + status = int(line[1]) + reason = "" + if len(line) > 2: + reason = line[2].rstrip() + resp.headers = parse_headers(sock) + if resp.headers.get("transfer-encoding"): + if "chunked" in resp.headers.get("transfer-encoding"): + raise ValueError("Unsupported " + resp.headers.get("transfer-encoding")) + elif resp.headers.get("location") and not 200 <= status <= 299: + raise NotImplementedError("Redirects not yet supported") + + except: + sock.close() + raise + + resp.status_code = status + resp.reason = reason + return resp + + +def parse_headers(sock): + """ + Parses the header portion of an HTTP request/response from the socket. + Expects first line of HTTP request/response to have been read already + return: header dictionary + rtype: Dict + """ + headers = {} + while True: + line = sock.readline() + if not line or line == b"\r\n": + break + + # print("**line: ", line) + splits = line.split(b": ", 1) + title = splits[0] + content = "" + if len(splits) > 1: + content = splits[1] + if title and content: + title = str(title.lower(), "utf-8") + content = str(content, "utf-8") + headers[title] = content + return headers + + +def head(url, **kw): + """Send HTTP HEAD request""" + return request("HEAD", url, **kw) + + +def get(url, **kw): + """Send HTTP GET request""" + return request("GET", url, **kw) + + +def post(url, **kw): + """Send HTTP POST request""" + return request("POST", url, **kw) + + +def put(url, **kw): + """Send HTTP PUT request""" + return request("PUT", url, **kw) + + +def patch(url, **kw): + """Send HTTP PATCH request""" + return request("PATCH", url, **kw) + + +def delete(url, **kw): + """Send HTTP DELETE request""" + return request("DELETE", url, **kw) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/feathers2.py b/ports/esp32s2/boards/unexpectedmaker_feathers2/feathers2.py new file mode 100644 index 0000000000..0631cad7f0 --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/feathers2.py @@ -0,0 +1,47 @@ +# FeatherS2 Helper Library +# 2020 Seon Rozenblum, Unexpected Maker +# +# Project home: +# https://feathers2.io +# + +# Import required libraries +import time +import board +from digitalio import DigitalInOut, Direction, Pull + + +# Helper functions + +def enable_LDO2(state): + """Set the power for the second on-board LDO to allow no current draw when not needed.""" + + # Grab a reference to the LDO2 IO (21 in this case) + ldo2 = DigitalInOut(board.LDO2) + ldo2.direction = Direction.OUTPUT + + # Set the LDO2 power pin on / off + ldo2.value = state + + # A small delay to let the IO change state + time.sleep(0.035) + + +# Dotstar rainbow colour wheel +def dotstar_color_wheel(wheel_pos): + """Color wheel to allow for cycling through the rainbow of RGB colors.""" + wheel_pos = wheel_pos % 255 + + if wheel_pos < 85: + return 255 - wheel_pos * 3, 0, wheel_pos * 3 + elif wheel_pos < 170: + wheel_pos -= 85 + return 0, wheel_pos * 3, 255 - wheel_pos * 3 + else: + wheel_pos -= 170 + return wheel_pos * 3, 255 - wheel_pos * 3, 0 + + + +# Disable LDO2 by default +enable_LDO2(False) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h index e5fed4e324..a77de15116 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h @@ -35,6 +35,5 @@ #define AUTORESET_DELAY_MS 500 -// Doesn't work with this on. -// #define MICROPY_HW_APA102_MOSI (&pin_GPIO44) -// #define MICROPY_HW_APA102_SCK (&pin_GPIO45) +#define MICROPY_HW_APA102_MOSI (&pin_GPIO40) +#define MICROPY_HW_APA102_SCK (&pin_GPIO45) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk index 294736d17c..91c321af92 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk @@ -16,3 +16,7 @@ CIRCUITPY_ESP_FLASH_FREQ=40m CIRCUITPY_ESP_FLASH_SIZE=16MB CIRCUITPY_BITBANG_APA102 = 1 + +# Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar + diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c b/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c index e8dd2edf6a..5a29e029c2 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c @@ -1,55 +1,103 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO18) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO14) }, - { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO44) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, - // Moving to 9 and 8 - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO38) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO33) }, - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO1) }, - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO3) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO8) }, - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO9) }, - { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO10) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO11) }, - { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_GPIO44) }, // MTDO + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO11) }, + + // { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) }, // MTDO + { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_GPIO40) }, // MTDO + + // { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_GPIO45) }, + + { MP_ROM_QSTR(MP_QSTR_LDO2), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_AMB), MP_ROM_PTR(&pin_GPIO4) }, + { 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) }, diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/adafruit_dotstar.py b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/adafruit_dotstar.py new file mode 100755 index 0000000000..65fbbe8683 --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/adafruit_dotstar.py @@ -0,0 +1,198 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Damien P. George (original Neopixel object) +# Copyright (c) 2017 Ladyada +# Copyright (c) 2017 Scott Shawcroft for Adafruit Industries +# Copyright (c) 2019 Roy 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. + +""" +`adafruit_dotstar` - DotStar strip driver (for CircuitPython 5.0+ with _pixelbuf) +================================================================================= + +* Author(s): Damien P. George, Limor Fried, Scott Shawcroft & Roy Hooper +""" + +# pylint: disable=ungrouped-imports +import sys +import busio +import digitalio + +if sys.implementation.version[0] < 5: + import adafruit_pypixelbuf as _pixelbuf +else: + try: + import _pixelbuf + except ImportError: + import adafruit_pypixelbuf as _pixelbuf + +__version__ = "0.0.0-auto.0" +__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DotStar.git" + +START_HEADER_SIZE = 4 + +# Pixel color order constants +RBG = "PRBG" +"""Red Blue Green""" +RGB = "PRGB" +"""Red Green Blue""" +GRB = "PGRB" +"""Green Red Blue""" +GBR = "PGBR" +"""Green Blue Red""" +BRG = "PBRG" +"""Blue Red Green""" +BGR = "PBGR" +"""Blue Green Red""" + + +class DotStar(_pixelbuf.PixelBuf): + """ + A sequence of dotstars. + + :param ~microcontroller.Pin clock: The pin to output dotstar clock on. + :param ~microcontroller.Pin data: The pin to output dotstar data on. + :param int n: The number of dotstars in the chain + :param float brightness: Brightness of the pixels between 0.0 and 1.0 + :param bool auto_write: True if the dotstars should immediately change when + set. If False, `show` must be called explicitly. + :param str pixel_order: Set the pixel order on the strip - different + strips implement this differently. If you send red, and it looks blue + or green on the strip, modify this! It should be one of the values above. + :param int baudrate: Desired clock rate if using hardware SPI (ignored if + using 'soft' SPI). This is only a recommendation; the actual clock + rate may be slightly different depending on what the system hardware + can provide. + + Example for Gemma M0: + + .. code-block:: python + + import adafruit_dotstar + import time + from board import * + + RED = 0x100000 + + with adafruit_dotstar.DotStar(APA102_SCK, APA102_MOSI, 1) as pixels: + pixels[0] = RED + time.sleep(2) + + .. py:method:: DotStar.show() + + Shows the new colors on the dotstars themselves if they haven't already + been autowritten. + + The colors may or may not be showing after this function returns because + it may be done asynchronously. + + .. py:method:: DotStar.fill(color) + + Colors all dotstars the given ***color***. + + .. py:attribute:: brightness + + Overall brightness of all dotstars (0 to 1.0) + """ + + def __init__( + self, + clock, + data, + n, + *, + brightness=1.0, + auto_write=True, + pixel_order=BGR, + baudrate=4000000 + ): + self._spi = None + try: + self._spi = busio.SPI(clock, MOSI=data) + while not self._spi.try_lock(): + pass + self._spi.configure(baudrate=baudrate) + + except (NotImplementedError, ValueError): + self.dpin = digitalio.DigitalInOut(data) + self.cpin = digitalio.DigitalInOut(clock) + self.dpin.direction = digitalio.Direction.OUTPUT + self.cpin.direction = digitalio.Direction.OUTPUT + self.cpin.value = False + + # Supply one extra clock cycle for each two pixels in the strip. + trailer_size = n // 16 + if n % 16 != 0: + trailer_size += 1 + + # Four empty bytes for the header. + header = bytearray(START_HEADER_SIZE) + # 0xff bytes for the trailer. + trailer = bytearray(b"\xff") * trailer_size + + super().__init__( + n, + byteorder=pixel_order, + brightness=brightness, + auto_write=auto_write, + header=header, + trailer=trailer, + ) + + def deinit(self): + """Blank out the DotStars and release the resources.""" + self.fill(0) + self.show() + if self._spi: + self._spi.deinit() + else: + self.dpin.deinit() + self.cpin.deinit() + + def __enter__(self): + return self + + def __exit__(self, exception_type, exception_value, traceback): + self.deinit() + + def __repr__(self): + return "[" + ", ".join([str(x) for x in self]) + "]" + + @property + def n(self): + """ + The number of dotstars in the chain (read-only) + """ + return len(self) + + def _transmit(self, buffer): + if self._spi: + self._spi.write(buffer) + else: + self._ds_writebytes(buffer) + + def _ds_writebytes(self, buffer): + for b in buffer: + for _ in range(8): + self.dpin.value = b & 0x80 + self.cpin.value = True + self.cpin.value = False + b = b << 1 + self.cpin.value = False diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/adafruit_pypixelbuf.py b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/adafruit_pypixelbuf.py new file mode 100755 index 0000000000..3cb83e970c --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/adafruit_pypixelbuf.py @@ -0,0 +1,374 @@ +# The MIT License (MIT) +# +# Based on the Adafruit NeoPixel and Adafruit Dotstar CircuitPython drivers. +# Copyright (c) 2019-2020 Roy 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. + +""" +`adafruit_pypixelbuf` - A pure python implementation of _pixelbuf +================================================================= +This class is used when _pixelbuf is not available in CircuitPython. It is based on the work +in neopixel.py and adafruit_dotstar.py. + +* Author(s): Damien P. George & Limor Fried & Scott Shawcroft & Roy Hooper +""" + +DOTSTAR_LED_START_FULL_BRIGHT = 0xFF +DOTSTAR_LED_START = 0b11100000 # Three "1" bits, followed by 5 brightness bits +DOTSTAR_LED_BRIGHTNESS = 0b00011111 + + +class PixelBuf: # pylint: disable=too-many-instance-attributes + """ + A sequence of RGB/RGBW pixels. + + This is the pure python implementation of CircuitPython's _pixelbuf. + + :param ~int n: Number of pixels + :param ~str byteorder: Byte order string constant (also sets bpp) + :param ~float brightness: Brightness (0 to 1.0, default 1.0) + :param ~bool auto_write: Whether to automatically write pixels (Default False) + :param bytes header: Sequence of bytes to always send before pixel values. + :param bytes trailer: Sequence of bytes to always send after pixel values. + """ + + def __init__( # pylint: disable=too-many-locals,too-many-arguments + self, + n, + byteorder="BGR", + brightness=1.0, + auto_write=False, + header=None, + trailer=None, + ): + + bpp, byteorder_tuple, has_white, dotstar_mode = self.parse_byteorder(byteorder) + + self.auto_write = False + + effective_bpp = 4 if dotstar_mode else bpp + _bytes = effective_bpp * n + buf = bytearray(_bytes) + offset = 0 + + if header is not None: + if not isinstance(header, bytearray): + raise TypeError("header must be a bytearray") + buf = header + buf + offset = len(header) + + if trailer is not None: + if not isinstance(trailer, bytearray): + raise TypeError("trailer must be a bytearray") + buf += trailer + + self._pixels = n + self._bytes = _bytes + self._byteorder = byteorder_tuple + self._byteorder_string = byteorder + self._has_white = has_white + self._bpp = bpp + self._pre_brightness_buffer = None + self._post_brightness_buffer = buf + self._offset = offset + self._dotstar_mode = dotstar_mode + self._pixel_step = effective_bpp + + if dotstar_mode: + self._byteorder_tuple = ( + byteorder_tuple[0] + 1, + byteorder_tuple[1] + 1, + byteorder_tuple[2] + 1, + 0, + ) + # Initialize the buffer with the dotstar start bytes. + for i in range(self._offset, self._bytes + self._offset, 4): + self._post_brightness_buffer[i] = DOTSTAR_LED_START_FULL_BRIGHT + + self._brightness = 1.0 + self.brightness = brightness + + self.auto_write = auto_write + + @staticmethod + def parse_byteorder(byteorder): + """ + Parse a Byteorder string for validity and determine bpp, byte order, and + dostar brightness bits. + + Byteorder strings may contain the following characters: + R - Red + G - Green + B - Blue + W - White + P - PWM (PWM Duty cycle for pixel - dotstars 0 - 1.0) + + :param: ~str bpp: bpp string. + :return: ~tuple: bpp, byteorder, has_white, dotstar_mode + """ + bpp = len(byteorder) + dotstar_mode = False + has_white = False + + if byteorder.strip("RGBWP") != "": + raise ValueError("Invalid Byteorder string") + + try: + r = byteorder.index("R") + g = byteorder.index("G") + b = byteorder.index("B") + except ValueError: + raise ValueError("Invalid Byteorder string") + if "W" in byteorder: + w = byteorder.index("W") + byteorder = (r, g, b, w) + has_white = True + elif "P" in byteorder: + lum = byteorder.index("P") + byteorder = (r, g, b, lum) + dotstar_mode = True + else: + byteorder = (r, g, b) + + return bpp, byteorder, has_white, dotstar_mode + + @property + def bpp(self): + """ + The number of bytes per pixel in the buffer (read-only). + """ + return self._bpp + + @property + def brightness(self): + """ + Float value between 0 and 1. Output brightness. + + When brightness is less than 1.0, a second buffer will be used to store the color values + before they are adjusted for brightness. + """ + return self._brightness + + @brightness.setter + def brightness(self, value): + value = min(max(value, 0.0), 1.0) + change = value - self._brightness + if -0.001 < change < 0.001: + return + + self._brightness = value + + if self._pre_brightness_buffer is None: + self._pre_brightness_buffer = bytearray(self._post_brightness_buffer) + + # Adjust brightness of existing pixels + offset_check = self._offset % self._pixel_step + for i in range(self._offset, self._bytes + self._offset): + # Don't adjust per-pixel luminance bytes in dotstar mode + if self._dotstar_mode and (i % 4 != offset_check): + continue + self._post_brightness_buffer[i] = int( + self._pre_brightness_buffer[i] * self._brightness + ) + + if self.auto_write: + self.show() + + @property + def byteorder(self): + """ + ByteOrder string for the buffer (read-only) + """ + return self._byteorder_string + + def __len__(self): + """ + Number of pixels. + """ + return self._pixels + + def show(self): + """ + Call the associated write function to display the pixels + """ + return self._transmit(self._post_brightness_buffer) + + def fill(self, color): + """ + Fills the given pixelbuf with the given color. + :param pixelbuf: A pixel object. + :param color: Color to set. + """ + r, g, b, w = self._parse_color(color) + for i in range(self._pixels): + self._set_item(i, r, g, b, w) + if self.auto_write: + self.show() + + def _parse_color(self, value): + r = 0 + g = 0 + b = 0 + w = 0 + if isinstance(value, int): + r = value >> 16 + g = (value >> 8) & 0xFF + b = value & 0xFF + w = 0 + + if self._dotstar_mode: + w = 1.0 + else: + if len(value) < 3 or len(value) > 4: + raise ValueError( + "Expected tuple of length {}, got {}".format(self._bpp, len(value)) + ) + if len(value) == self._bpp: + if self._bpp == 3: + r, g, b = value + else: + r, g, b, w = value + elif len(value) == 3: + r, g, b = value + if self._dotstar_mode: + w = 1.0 + + if self._bpp == 4: + if self._dotstar_mode: + # LED startframe is three "1" bits, followed by 5 brightness bits + # then 8 bits for each of R, G, and B. The order of those 3 are configurable and + # vary based on hardware + w = (int(w * 31) & 0b00011111) | DOTSTAR_LED_START + elif ( + self._has_white + and (isinstance(value, int) or len(value) == 3) + and r == g + and g == b + ): + # If all components are the same and we have a white pixel then use it + # instead of the individual components when all 4 values aren't explicitly given. + w = r + r = 0 + g = 0 + b = 0 + + return (r, g, b, w) + + def _set_item( + self, index, r, g, b, w + ): # pylint: disable=too-many-locals,too-many-branches,too-many-arguments + if index < 0: + index += len(self) + if index >= self._pixels or index < 0: + raise IndexError + offset = self._offset + (index * self._bpp) + + if self._pre_brightness_buffer is not None: + if self._bpp == 4: + self._pre_brightness_buffer[offset + self._byteorder[3]] = w + self._pre_brightness_buffer[offset + self._byteorder[0]] = r + self._pre_brightness_buffer[offset + self._byteorder[1]] = g + self._pre_brightness_buffer[offset + self._byteorder[2]] = b + + if self._bpp == 4: + # Only apply brightness if w is actually white (aka not DotStar.) + if not self._dotstar_mode: + w = int(w * self._brightness) + self._post_brightness_buffer[offset + self._byteorder[3]] = w + + self._post_brightness_buffer[offset + self._byteorder[0]] = int( + r * self._brightness + ) + self._post_brightness_buffer[offset + self._byteorder[1]] = int( + g * self._brightness + ) + self._post_brightness_buffer[offset + self._byteorder[2]] = int( + b * self._brightness + ) + + def __setitem__(self, index, val): + if isinstance(index, slice): + start, stop, step = index.indices(self._pixels) + for val_i, in_i in enumerate(range(start, stop, step)): + r, g, b, w = self._parse_color(val[val_i]) + self._set_item(in_i, r, g, b, w) + else: + r, g, b, w = self._parse_color(val) + self._set_item(index, r, g, b, w) + + if self.auto_write: + self.show() + + def _getitem(self, index): + start = self._offset + (index * self._bpp) + buffer = ( + self._pre_brightness_buffer + if self._pre_brightness_buffer is not None + else self._post_brightness_buffer + ) + value = [ + buffer[start + self._byteorder[0]], + buffer[start + self._byteorder[1]], + buffer[start + self._byteorder[2]], + ] + if self._has_white: + value.append(buffer[start + self._byteorder[3]]) + elif self._dotstar_mode: + value.append( + (buffer[start + self._byteorder[3]] & DOTSTAR_LED_BRIGHTNESS) / 31.0 + ) + return value + + def __getitem__(self, index): + if isinstance(index, slice): + out = [] + for in_i in range( + *index.indices(len(self._post_brightness_buffer) // self._bpp) + ): + out.append(self._getitem(in_i)) + return out + if index < 0: + index += len(self) + if index >= self._pixels or index < 0: + raise IndexError + return self._getitem(index) + + def _transmit(self, buffer): + raise NotImplementedError("Must be subclassed") + + +def wheel(pos): + """ + Helper to create a colorwheel. + + :param pos: int 0-255 of color value to return + :return: tuple of RGB values + """ + # Input a value 0 to 255 to get a color value. + # The colours are a transition r - g - b - back to r. + if pos < 0 or pos > 255: + return 0, 0, 0 + if pos < 85: + return 255 - pos * 3, pos * 3, 0 + if pos < 170: + pos -= 85 + return 0, 255 - pos * 3, pos * 3 + pos -= 170 + return pos * 3, 0, 255 - pos * 3 diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/board.c b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/board.c new file mode 100644 index 0000000000..1dc30b5af8 --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/board.c @@ -0,0 +1,56 @@ +/* + * 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 "boards/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + + // SPI Flash and RAM + common_hal_never_reset_pin(&pin_GPIO26); + common_hal_never_reset_pin(&pin_GPIO27); + common_hal_never_reset_pin(&pin_GPIO28); + common_hal_never_reset_pin(&pin_GPIO29); + common_hal_never_reset_pin(&pin_GPIO30); + common_hal_never_reset_pin(&pin_GPIO31); + common_hal_never_reset_pin(&pin_GPIO32); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/feathers2.py b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/feathers2.py new file mode 100644 index 0000000000..0631cad7f0 --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/feathers2.py @@ -0,0 +1,47 @@ +# FeatherS2 Helper Library +# 2020 Seon Rozenblum, Unexpected Maker +# +# Project home: +# https://feathers2.io +# + +# Import required libraries +import time +import board +from digitalio import DigitalInOut, Direction, Pull + + +# Helper functions + +def enable_LDO2(state): + """Set the power for the second on-board LDO to allow no current draw when not needed.""" + + # Grab a reference to the LDO2 IO (21 in this case) + ldo2 = DigitalInOut(board.LDO2) + ldo2.direction = Direction.OUTPUT + + # Set the LDO2 power pin on / off + ldo2.value = state + + # A small delay to let the IO change state + time.sleep(0.035) + + +# Dotstar rainbow colour wheel +def dotstar_color_wheel(wheel_pos): + """Color wheel to allow for cycling through the rainbow of RGB colors.""" + wheel_pos = wheel_pos % 255 + + if wheel_pos < 85: + return 255 - wheel_pos * 3, 0, wheel_pos * 3 + elif wheel_pos < 170: + wheel_pos -= 85 + return 0, wheel_pos * 3, 255 - wheel_pos * 3 + else: + wheel_pos -= 170 + return wheel_pos * 3, 255 - wheel_pos * 3, 0 + + + +# Disable LDO2 by default +enable_LDO2(False) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h new file mode 100644 index 0000000000..a65d00206d --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h @@ -0,0 +1,40 @@ +/* + * 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 "FeatherS2" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n" + +#define AUTORESET_DELAY_MS 500 + +// Doesn't work with this on. +// #define MICROPY_HW_APA102_MOSI (&pin_GPIO44) +// #define MICROPY_HW_APA102_SCK (&pin_GPIO45) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk new file mode 100644 index 0000000000..4c809471bd --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk @@ -0,0 +1,21 @@ +USB_VID = 0x239A +USB_PID = 0x80AC +USB_PRODUCT = "FeatherS2" +USB_MANUFACTURER = "UnexpectedMaker" +USB_DEVICES = "CDC,MSC,HID" + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=qio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=16MB + +CIRCUITPY_BITBANG_APA102 = 1 + +# Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar \ No newline at end of file diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c new file mode 100644 index 0000000000..9476cafdf2 --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c @@ -0,0 +1,56 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + + // Moving to 9 and 8 + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_GPIO40) }, // MTDO + { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_LDO2), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_AMB), MP_ROM_PTR(&pin_GPIO4) }, + + { 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_global_dict_table); diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/sdkconfig b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/sdkconfig new file mode 100644 index 0000000000..b73c4a8c20 --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/sdkconfig @@ -0,0 +1,35 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM64=y +CONFIG_SPIRAM_SIZE=8388608 + +# +# PSRAM clock and cs IO for ESP32S2 +# +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM clock and cs IO for ESP32S2 + +CONFIG_SPIRAM_SPIWP_SD3_PIN=28 +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_USE_AHB_DBUS3 is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config diff --git a/ports/esp32s2/boards/unexpectedmaker_pros2/adafruit_dotstar.py b/ports/esp32s2/boards/unexpectedmaker_pros2/adafruit_dotstar.py new file mode 100755 index 0000000000..65fbbe8683 --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_pros2/adafruit_dotstar.py @@ -0,0 +1,198 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Damien P. George (original Neopixel object) +# Copyright (c) 2017 Ladyada +# Copyright (c) 2017 Scott Shawcroft for Adafruit Industries +# Copyright (c) 2019 Roy 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. + +""" +`adafruit_dotstar` - DotStar strip driver (for CircuitPython 5.0+ with _pixelbuf) +================================================================================= + +* Author(s): Damien P. George, Limor Fried, Scott Shawcroft & Roy Hooper +""" + +# pylint: disable=ungrouped-imports +import sys +import busio +import digitalio + +if sys.implementation.version[0] < 5: + import adafruit_pypixelbuf as _pixelbuf +else: + try: + import _pixelbuf + except ImportError: + import adafruit_pypixelbuf as _pixelbuf + +__version__ = "0.0.0-auto.0" +__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DotStar.git" + +START_HEADER_SIZE = 4 + +# Pixel color order constants +RBG = "PRBG" +"""Red Blue Green""" +RGB = "PRGB" +"""Red Green Blue""" +GRB = "PGRB" +"""Green Red Blue""" +GBR = "PGBR" +"""Green Blue Red""" +BRG = "PBRG" +"""Blue Red Green""" +BGR = "PBGR" +"""Blue Green Red""" + + +class DotStar(_pixelbuf.PixelBuf): + """ + A sequence of dotstars. + + :param ~microcontroller.Pin clock: The pin to output dotstar clock on. + :param ~microcontroller.Pin data: The pin to output dotstar data on. + :param int n: The number of dotstars in the chain + :param float brightness: Brightness of the pixels between 0.0 and 1.0 + :param bool auto_write: True if the dotstars should immediately change when + set. If False, `show` must be called explicitly. + :param str pixel_order: Set the pixel order on the strip - different + strips implement this differently. If you send red, and it looks blue + or green on the strip, modify this! It should be one of the values above. + :param int baudrate: Desired clock rate if using hardware SPI (ignored if + using 'soft' SPI). This is only a recommendation; the actual clock + rate may be slightly different depending on what the system hardware + can provide. + + Example for Gemma M0: + + .. code-block:: python + + import adafruit_dotstar + import time + from board import * + + RED = 0x100000 + + with adafruit_dotstar.DotStar(APA102_SCK, APA102_MOSI, 1) as pixels: + pixels[0] = RED + time.sleep(2) + + .. py:method:: DotStar.show() + + Shows the new colors on the dotstars themselves if they haven't already + been autowritten. + + The colors may or may not be showing after this function returns because + it may be done asynchronously. + + .. py:method:: DotStar.fill(color) + + Colors all dotstars the given ***color***. + + .. py:attribute:: brightness + + Overall brightness of all dotstars (0 to 1.0) + """ + + def __init__( + self, + clock, + data, + n, + *, + brightness=1.0, + auto_write=True, + pixel_order=BGR, + baudrate=4000000 + ): + self._spi = None + try: + self._spi = busio.SPI(clock, MOSI=data) + while not self._spi.try_lock(): + pass + self._spi.configure(baudrate=baudrate) + + except (NotImplementedError, ValueError): + self.dpin = digitalio.DigitalInOut(data) + self.cpin = digitalio.DigitalInOut(clock) + self.dpin.direction = digitalio.Direction.OUTPUT + self.cpin.direction = digitalio.Direction.OUTPUT + self.cpin.value = False + + # Supply one extra clock cycle for each two pixels in the strip. + trailer_size = n // 16 + if n % 16 != 0: + trailer_size += 1 + + # Four empty bytes for the header. + header = bytearray(START_HEADER_SIZE) + # 0xff bytes for the trailer. + trailer = bytearray(b"\xff") * trailer_size + + super().__init__( + n, + byteorder=pixel_order, + brightness=brightness, + auto_write=auto_write, + header=header, + trailer=trailer, + ) + + def deinit(self): + """Blank out the DotStars and release the resources.""" + self.fill(0) + self.show() + if self._spi: + self._spi.deinit() + else: + self.dpin.deinit() + self.cpin.deinit() + + def __enter__(self): + return self + + def __exit__(self, exception_type, exception_value, traceback): + self.deinit() + + def __repr__(self): + return "[" + ", ".join([str(x) for x in self]) + "]" + + @property + def n(self): + """ + The number of dotstars in the chain (read-only) + """ + return len(self) + + def _transmit(self, buffer): + if self._spi: + self._spi.write(buffer) + else: + self._ds_writebytes(buffer) + + def _ds_writebytes(self, buffer): + for b in buffer: + for _ in range(8): + self.dpin.value = b & 0x80 + self.cpin.value = True + self.cpin.value = False + b = b << 1 + self.cpin.value = False diff --git a/ports/esp32s2/boards/unexpectedmaker_pros2/adafruit_pypixelbuf.py b/ports/esp32s2/boards/unexpectedmaker_pros2/adafruit_pypixelbuf.py new file mode 100755 index 0000000000..3cb83e970c --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_pros2/adafruit_pypixelbuf.py @@ -0,0 +1,374 @@ +# The MIT License (MIT) +# +# Based on the Adafruit NeoPixel and Adafruit Dotstar CircuitPython drivers. +# Copyright (c) 2019-2020 Roy 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. + +""" +`adafruit_pypixelbuf` - A pure python implementation of _pixelbuf +================================================================= +This class is used when _pixelbuf is not available in CircuitPython. It is based on the work +in neopixel.py and adafruit_dotstar.py. + +* Author(s): Damien P. George & Limor Fried & Scott Shawcroft & Roy Hooper +""" + +DOTSTAR_LED_START_FULL_BRIGHT = 0xFF +DOTSTAR_LED_START = 0b11100000 # Three "1" bits, followed by 5 brightness bits +DOTSTAR_LED_BRIGHTNESS = 0b00011111 + + +class PixelBuf: # pylint: disable=too-many-instance-attributes + """ + A sequence of RGB/RGBW pixels. + + This is the pure python implementation of CircuitPython's _pixelbuf. + + :param ~int n: Number of pixels + :param ~str byteorder: Byte order string constant (also sets bpp) + :param ~float brightness: Brightness (0 to 1.0, default 1.0) + :param ~bool auto_write: Whether to automatically write pixels (Default False) + :param bytes header: Sequence of bytes to always send before pixel values. + :param bytes trailer: Sequence of bytes to always send after pixel values. + """ + + def __init__( # pylint: disable=too-many-locals,too-many-arguments + self, + n, + byteorder="BGR", + brightness=1.0, + auto_write=False, + header=None, + trailer=None, + ): + + bpp, byteorder_tuple, has_white, dotstar_mode = self.parse_byteorder(byteorder) + + self.auto_write = False + + effective_bpp = 4 if dotstar_mode else bpp + _bytes = effective_bpp * n + buf = bytearray(_bytes) + offset = 0 + + if header is not None: + if not isinstance(header, bytearray): + raise TypeError("header must be a bytearray") + buf = header + buf + offset = len(header) + + if trailer is not None: + if not isinstance(trailer, bytearray): + raise TypeError("trailer must be a bytearray") + buf += trailer + + self._pixels = n + self._bytes = _bytes + self._byteorder = byteorder_tuple + self._byteorder_string = byteorder + self._has_white = has_white + self._bpp = bpp + self._pre_brightness_buffer = None + self._post_brightness_buffer = buf + self._offset = offset + self._dotstar_mode = dotstar_mode + self._pixel_step = effective_bpp + + if dotstar_mode: + self._byteorder_tuple = ( + byteorder_tuple[0] + 1, + byteorder_tuple[1] + 1, + byteorder_tuple[2] + 1, + 0, + ) + # Initialize the buffer with the dotstar start bytes. + for i in range(self._offset, self._bytes + self._offset, 4): + self._post_brightness_buffer[i] = DOTSTAR_LED_START_FULL_BRIGHT + + self._brightness = 1.0 + self.brightness = brightness + + self.auto_write = auto_write + + @staticmethod + def parse_byteorder(byteorder): + """ + Parse a Byteorder string for validity and determine bpp, byte order, and + dostar brightness bits. + + Byteorder strings may contain the following characters: + R - Red + G - Green + B - Blue + W - White + P - PWM (PWM Duty cycle for pixel - dotstars 0 - 1.0) + + :param: ~str bpp: bpp string. + :return: ~tuple: bpp, byteorder, has_white, dotstar_mode + """ + bpp = len(byteorder) + dotstar_mode = False + has_white = False + + if byteorder.strip("RGBWP") != "": + raise ValueError("Invalid Byteorder string") + + try: + r = byteorder.index("R") + g = byteorder.index("G") + b = byteorder.index("B") + except ValueError: + raise ValueError("Invalid Byteorder string") + if "W" in byteorder: + w = byteorder.index("W") + byteorder = (r, g, b, w) + has_white = True + elif "P" in byteorder: + lum = byteorder.index("P") + byteorder = (r, g, b, lum) + dotstar_mode = True + else: + byteorder = (r, g, b) + + return bpp, byteorder, has_white, dotstar_mode + + @property + def bpp(self): + """ + The number of bytes per pixel in the buffer (read-only). + """ + return self._bpp + + @property + def brightness(self): + """ + Float value between 0 and 1. Output brightness. + + When brightness is less than 1.0, a second buffer will be used to store the color values + before they are adjusted for brightness. + """ + return self._brightness + + @brightness.setter + def brightness(self, value): + value = min(max(value, 0.0), 1.0) + change = value - self._brightness + if -0.001 < change < 0.001: + return + + self._brightness = value + + if self._pre_brightness_buffer is None: + self._pre_brightness_buffer = bytearray(self._post_brightness_buffer) + + # Adjust brightness of existing pixels + offset_check = self._offset % self._pixel_step + for i in range(self._offset, self._bytes + self._offset): + # Don't adjust per-pixel luminance bytes in dotstar mode + if self._dotstar_mode and (i % 4 != offset_check): + continue + self._post_brightness_buffer[i] = int( + self._pre_brightness_buffer[i] * self._brightness + ) + + if self.auto_write: + self.show() + + @property + def byteorder(self): + """ + ByteOrder string for the buffer (read-only) + """ + return self._byteorder_string + + def __len__(self): + """ + Number of pixels. + """ + return self._pixels + + def show(self): + """ + Call the associated write function to display the pixels + """ + return self._transmit(self._post_brightness_buffer) + + def fill(self, color): + """ + Fills the given pixelbuf with the given color. + :param pixelbuf: A pixel object. + :param color: Color to set. + """ + r, g, b, w = self._parse_color(color) + for i in range(self._pixels): + self._set_item(i, r, g, b, w) + if self.auto_write: + self.show() + + def _parse_color(self, value): + r = 0 + g = 0 + b = 0 + w = 0 + if isinstance(value, int): + r = value >> 16 + g = (value >> 8) & 0xFF + b = value & 0xFF + w = 0 + + if self._dotstar_mode: + w = 1.0 + else: + if len(value) < 3 or len(value) > 4: + raise ValueError( + "Expected tuple of length {}, got {}".format(self._bpp, len(value)) + ) + if len(value) == self._bpp: + if self._bpp == 3: + r, g, b = value + else: + r, g, b, w = value + elif len(value) == 3: + r, g, b = value + if self._dotstar_mode: + w = 1.0 + + if self._bpp == 4: + if self._dotstar_mode: + # LED startframe is three "1" bits, followed by 5 brightness bits + # then 8 bits for each of R, G, and B. The order of those 3 are configurable and + # vary based on hardware + w = (int(w * 31) & 0b00011111) | DOTSTAR_LED_START + elif ( + self._has_white + and (isinstance(value, int) or len(value) == 3) + and r == g + and g == b + ): + # If all components are the same and we have a white pixel then use it + # instead of the individual components when all 4 values aren't explicitly given. + w = r + r = 0 + g = 0 + b = 0 + + return (r, g, b, w) + + def _set_item( + self, index, r, g, b, w + ): # pylint: disable=too-many-locals,too-many-branches,too-many-arguments + if index < 0: + index += len(self) + if index >= self._pixels or index < 0: + raise IndexError + offset = self._offset + (index * self._bpp) + + if self._pre_brightness_buffer is not None: + if self._bpp == 4: + self._pre_brightness_buffer[offset + self._byteorder[3]] = w + self._pre_brightness_buffer[offset + self._byteorder[0]] = r + self._pre_brightness_buffer[offset + self._byteorder[1]] = g + self._pre_brightness_buffer[offset + self._byteorder[2]] = b + + if self._bpp == 4: + # Only apply brightness if w is actually white (aka not DotStar.) + if not self._dotstar_mode: + w = int(w * self._brightness) + self._post_brightness_buffer[offset + self._byteorder[3]] = w + + self._post_brightness_buffer[offset + self._byteorder[0]] = int( + r * self._brightness + ) + self._post_brightness_buffer[offset + self._byteorder[1]] = int( + g * self._brightness + ) + self._post_brightness_buffer[offset + self._byteorder[2]] = int( + b * self._brightness + ) + + def __setitem__(self, index, val): + if isinstance(index, slice): + start, stop, step = index.indices(self._pixels) + for val_i, in_i in enumerate(range(start, stop, step)): + r, g, b, w = self._parse_color(val[val_i]) + self._set_item(in_i, r, g, b, w) + else: + r, g, b, w = self._parse_color(val) + self._set_item(index, r, g, b, w) + + if self.auto_write: + self.show() + + def _getitem(self, index): + start = self._offset + (index * self._bpp) + buffer = ( + self._pre_brightness_buffer + if self._pre_brightness_buffer is not None + else self._post_brightness_buffer + ) + value = [ + buffer[start + self._byteorder[0]], + buffer[start + self._byteorder[1]], + buffer[start + self._byteorder[2]], + ] + if self._has_white: + value.append(buffer[start + self._byteorder[3]]) + elif self._dotstar_mode: + value.append( + (buffer[start + self._byteorder[3]] & DOTSTAR_LED_BRIGHTNESS) / 31.0 + ) + return value + + def __getitem__(self, index): + if isinstance(index, slice): + out = [] + for in_i in range( + *index.indices(len(self._post_brightness_buffer) // self._bpp) + ): + out.append(self._getitem(in_i)) + return out + if index < 0: + index += len(self) + if index >= self._pixels or index < 0: + raise IndexError + return self._getitem(index) + + def _transmit(self, buffer): + raise NotImplementedError("Must be subclassed") + + +def wheel(pos): + """ + Helper to create a colorwheel. + + :param pos: int 0-255 of color value to return + :return: tuple of RGB values + """ + # Input a value 0 to 255 to get a color value. + # The colours are a transition r - g - b - back to r. + if pos < 0 or pos > 255: + return 0, 0, 0 + if pos < 85: + return 255 - pos * 3, pos * 3, 0 + if pos < 170: + pos -= 85 + return 0, 255 - pos * 3, pos * 3 + pos -= 170 + return pos * 3, 0, 255 - pos * 3 diff --git a/ports/esp32s2/boards/unexpectedmaker_pros2/board.c b/ports/esp32s2/boards/unexpectedmaker_pros2/board.c new file mode 100644 index 0000000000..1dc30b5af8 --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_pros2/board.c @@ -0,0 +1,56 @@ +/* + * 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 "boards/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + + // SPI Flash and RAM + common_hal_never_reset_pin(&pin_GPIO26); + common_hal_never_reset_pin(&pin_GPIO27); + common_hal_never_reset_pin(&pin_GPIO28); + common_hal_never_reset_pin(&pin_GPIO29); + common_hal_never_reset_pin(&pin_GPIO30); + common_hal_never_reset_pin(&pin_GPIO31); + common_hal_never_reset_pin(&pin_GPIO32); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/esp32s2/boards/unexpectedmaker_pros2/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_pros2/mpconfigboard.h new file mode 100644 index 0000000000..2cfb7b6a0f --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_pros2/mpconfigboard.h @@ -0,0 +1,35 @@ +/* + * 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 "ProS2" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define AUTORESET_DELAY_MS 500 + +#define MICROPY_HW_APA102_MOSI (&pin_GPIO40) +#define MICROPY_HW_APA102_SCK (&pin_GPIO45) diff --git a/ports/esp32s2/boards/unexpectedmaker_pros2/mpconfigboard.mk b/ports/esp32s2/boards/unexpectedmaker_pros2/mpconfigboard.mk new file mode 100644 index 0000000000..cb6823ba67 --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_pros2/mpconfigboard.mk @@ -0,0 +1,21 @@ +USB_VID = 0x239A +USB_PID = 0x80AA +USB_PRODUCT = "ProS2" +USB_MANUFACTURER = "UnexpectedMaker" +USB_DEVICES = "CDC,MSC,HID" + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=qio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=16MB + +CIRCUITPY_BITBANG_APA102 = 1 + +# Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar diff --git a/ports/esp32s2/boards/unexpectedmaker_pros2/pins.c b/ports/esp32s2/boards/unexpectedmaker_pros2/pins.c new file mode 100644 index 0000000000..349ad1bd5d --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_pros2/pins.c @@ -0,0 +1,58 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_GPIO40) }, // MTDO + { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_GPIO45) }, + + { MP_ROM_QSTR(MP_QSTR_LDO2), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_VBAT_SENSE), MP_ROM_PTR(&pin_GPIO14) }, + + { 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_global_dict_table); diff --git a/ports/esp32s2/boards/unexpectedmaker_pros2/pros2.py b/ports/esp32s2/boards/unexpectedmaker_pros2/pros2.py new file mode 100644 index 0000000000..3d2397d5d4 --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_pros2/pros2.py @@ -0,0 +1,63 @@ +# Pros2 Helper Library +# 2020 Seon Rozenblum, Unexpected Maker +# +# Project home: +# https://pros2.io +# + +# Import required libraries +import time +import board +from digitalio import DigitalInOut, Direction, Pull +from analogio import AnalogIn + + +# Helper functions + +def enable_LDO2(state): + """Set the power for the second on-board LDO to allow no current draw when not needed.""" + + # Grab a reference to the LDO2 IO (21 in this case) + ldo2 = DigitalInOut(board.LDO2) + ldo2.direction = Direction.OUTPUT + + # Set the LDO2 power pin on / off + ldo2.value = state + + # A small delay to let the IO change state + time.sleep(0.035) + + +# Dotstar rainbow colour wheel +def dotstar_color_wheel(wheel_pos): + """Color wheel to allow for cycling through the rainbow of RGB colors.""" + wheel_pos = wheel_pos % 255 + + if wheel_pos < 85: + return 255 - wheel_pos * 3, 0, wheel_pos * 3 + elif wheel_pos < 170: + wheel_pos -= 85 + return 0, wheel_pos * 3, 255 - wheel_pos * 3 + else: + wheel_pos -= 170 + return wheel_pos * 3, 255 - wheel_pos * 3, 0 + + +# Get a *rough* estimate of the current battery voltage +# If the battery is not present, the charge IC will still report it's trying to charge at X voltage +# so it will still show a voltage. +def get_battery_voltage(): + """ + Returns the current battery voltage. If no battery is connected, returns 3.7V + This is an approximation only, but useful to detect of the charge state of the battery is getting low. + """ + adc = AnalogIn(board.VBAT_SENSE) + + measured_vbat = adc.value # Read the value + measured_vbat /= 4095 # divide by 4095 as we are using the default ADC voltage range of 0-1V + measured_vbat *= 3.7 # Multiply by 3.7V, our reference voltage + return measured_vbat + + +# Disable LDO2 by default +enable_LDO2(False) diff --git a/ports/esp32s2/boards/unexpectedmaker_pros2/sdkconfig b/ports/esp32s2/boards/unexpectedmaker_pros2/sdkconfig new file mode 100644 index 0000000000..b73c4a8c20 --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_pros2/sdkconfig @@ -0,0 +1,35 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM64=y +CONFIG_SPIRAM_SIZE=8388608 + +# +# PSRAM clock and cs IO for ESP32S2 +# +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM clock and cs IO for ESP32S2 + +CONFIG_SPIRAM_SPIWP_SD3_PIN=28 +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_USE_AHB_DBUS3 is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config From 4b1a7d812e93223ba4247eb3a96c4c94bdc96bb9 Mon Sep 17 00:00:00 2001 From: Seon Rozenblum Date: Wed, 23 Sep 2020 05:20:10 +1000 Subject: [PATCH 1024/1293] Updated UM boards --- .github/workflows/build.yml | 1 + .../mpconfigboard.mk | 3 +- .../mpconfigboard.mk | 2 +- .../pins.c | 50 ++++++++++++++++++- 4 files changed, 51 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c68a3e5c6..40bf65209c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -421,6 +421,7 @@ jobs: - "microdev_micro_s2" - "muselab_nanoesp32_s2" - "unexpectedmaker_feathers2" + - "unexpectedmaker_feathers2_prerelease" steps: - name: Set up Python 3.8 diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk index 91c321af92..9857c07617 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk @@ -18,5 +18,4 @@ CIRCUITPY_ESP_FLASH_SIZE=16MB CIRCUITPY_BITBANG_APA102 = 1 # Include these Python libraries in firmware. -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar - +# FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk index 4c809471bd..9857c07617 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk @@ -18,4 +18,4 @@ CIRCUITPY_ESP_FLASH_SIZE=16MB CIRCUITPY_BITBANG_APA102 = 1 # Include these Python libraries in firmware. -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar \ No newline at end of file +# FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c index 9476cafdf2..967f5e8d97 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c @@ -1,52 +1,98 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO44) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, - // Moving to 9 and 8 { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_GPIO40) }, // MTDO { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_GPIO45) }, - { MP_ROM_QSTR(MP_QSTR_LDO2), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_LDO2), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_AMB), MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, From 819b5faa71ab8aa13a82308cc6fc820df46ec83b Mon Sep 17 00:00:00 2001 From: Seon Rozenblum Date: Wed, 30 Sep 2020 10:02:50 +1000 Subject: [PATCH 1025/1293] Removed ProS2 board files for now --- .../adafruit_dotstar.py | 198 ---------- .../adafruit_pypixelbuf.py | 374 ------------------ .../adafruit_requests.py | 311 --------------- .../unexpectedmaker_feathers2/feathers2.py | 47 --- .../boards/unexpectedmaker_feathers2/pins.c | 7 +- .../adafruit_dotstar.py | 198 ---------- .../adafruit_pypixelbuf.py | 374 ------------------ .../feathers2.py | 47 --- .../mpconfigboard.h | 8 +- .../unexpectedmaker_pros2/adafruit_dotstar.py | 198 ---------- .../adafruit_pypixelbuf.py | 374 ------------------ .../boards/unexpectedmaker_pros2/board.c | 56 --- .../unexpectedmaker_pros2/mpconfigboard.h | 35 -- .../unexpectedmaker_pros2/mpconfigboard.mk | 21 - .../boards/unexpectedmaker_pros2/pins.c | 58 --- .../boards/unexpectedmaker_pros2/pros2.py | 63 --- .../boards/unexpectedmaker_pros2/sdkconfig | 35 -- 17 files changed, 5 insertions(+), 2399 deletions(-) delete mode 100755 ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_dotstar.py delete mode 100755 ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_pypixelbuf.py delete mode 100755 ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_requests.py delete mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2/feathers2.py delete mode 100755 ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/adafruit_dotstar.py delete mode 100755 ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/adafruit_pypixelbuf.py delete mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/feathers2.py delete mode 100755 ports/esp32s2/boards/unexpectedmaker_pros2/adafruit_dotstar.py delete mode 100755 ports/esp32s2/boards/unexpectedmaker_pros2/adafruit_pypixelbuf.py delete mode 100644 ports/esp32s2/boards/unexpectedmaker_pros2/board.c delete mode 100644 ports/esp32s2/boards/unexpectedmaker_pros2/mpconfigboard.h delete mode 100644 ports/esp32s2/boards/unexpectedmaker_pros2/mpconfigboard.mk delete mode 100644 ports/esp32s2/boards/unexpectedmaker_pros2/pins.c delete mode 100644 ports/esp32s2/boards/unexpectedmaker_pros2/pros2.py delete mode 100644 ports/esp32s2/boards/unexpectedmaker_pros2/sdkconfig diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_dotstar.py b/ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_dotstar.py deleted file mode 100755 index 65fbbe8683..0000000000 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_dotstar.py +++ /dev/null @@ -1,198 +0,0 @@ -# The MIT License (MIT) -# -# Copyright (c) 2016 Damien P. George (original Neopixel object) -# Copyright (c) 2017 Ladyada -# Copyright (c) 2017 Scott Shawcroft for Adafruit Industries -# Copyright (c) 2019 Roy 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. - -""" -`adafruit_dotstar` - DotStar strip driver (for CircuitPython 5.0+ with _pixelbuf) -================================================================================= - -* Author(s): Damien P. George, Limor Fried, Scott Shawcroft & Roy Hooper -""" - -# pylint: disable=ungrouped-imports -import sys -import busio -import digitalio - -if sys.implementation.version[0] < 5: - import adafruit_pypixelbuf as _pixelbuf -else: - try: - import _pixelbuf - except ImportError: - import adafruit_pypixelbuf as _pixelbuf - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DotStar.git" - -START_HEADER_SIZE = 4 - -# Pixel color order constants -RBG = "PRBG" -"""Red Blue Green""" -RGB = "PRGB" -"""Red Green Blue""" -GRB = "PGRB" -"""Green Red Blue""" -GBR = "PGBR" -"""Green Blue Red""" -BRG = "PBRG" -"""Blue Red Green""" -BGR = "PBGR" -"""Blue Green Red""" - - -class DotStar(_pixelbuf.PixelBuf): - """ - A sequence of dotstars. - - :param ~microcontroller.Pin clock: The pin to output dotstar clock on. - :param ~microcontroller.Pin data: The pin to output dotstar data on. - :param int n: The number of dotstars in the chain - :param float brightness: Brightness of the pixels between 0.0 and 1.0 - :param bool auto_write: True if the dotstars should immediately change when - set. If False, `show` must be called explicitly. - :param str pixel_order: Set the pixel order on the strip - different - strips implement this differently. If you send red, and it looks blue - or green on the strip, modify this! It should be one of the values above. - :param int baudrate: Desired clock rate if using hardware SPI (ignored if - using 'soft' SPI). This is only a recommendation; the actual clock - rate may be slightly different depending on what the system hardware - can provide. - - Example for Gemma M0: - - .. code-block:: python - - import adafruit_dotstar - import time - from board import * - - RED = 0x100000 - - with adafruit_dotstar.DotStar(APA102_SCK, APA102_MOSI, 1) as pixels: - pixels[0] = RED - time.sleep(2) - - .. py:method:: DotStar.show() - - Shows the new colors on the dotstars themselves if they haven't already - been autowritten. - - The colors may or may not be showing after this function returns because - it may be done asynchronously. - - .. py:method:: DotStar.fill(color) - - Colors all dotstars the given ***color***. - - .. py:attribute:: brightness - - Overall brightness of all dotstars (0 to 1.0) - """ - - def __init__( - self, - clock, - data, - n, - *, - brightness=1.0, - auto_write=True, - pixel_order=BGR, - baudrate=4000000 - ): - self._spi = None - try: - self._spi = busio.SPI(clock, MOSI=data) - while not self._spi.try_lock(): - pass - self._spi.configure(baudrate=baudrate) - - except (NotImplementedError, ValueError): - self.dpin = digitalio.DigitalInOut(data) - self.cpin = digitalio.DigitalInOut(clock) - self.dpin.direction = digitalio.Direction.OUTPUT - self.cpin.direction = digitalio.Direction.OUTPUT - self.cpin.value = False - - # Supply one extra clock cycle for each two pixels in the strip. - trailer_size = n // 16 - if n % 16 != 0: - trailer_size += 1 - - # Four empty bytes for the header. - header = bytearray(START_HEADER_SIZE) - # 0xff bytes for the trailer. - trailer = bytearray(b"\xff") * trailer_size - - super().__init__( - n, - byteorder=pixel_order, - brightness=brightness, - auto_write=auto_write, - header=header, - trailer=trailer, - ) - - def deinit(self): - """Blank out the DotStars and release the resources.""" - self.fill(0) - self.show() - if self._spi: - self._spi.deinit() - else: - self.dpin.deinit() - self.cpin.deinit() - - def __enter__(self): - return self - - def __exit__(self, exception_type, exception_value, traceback): - self.deinit() - - def __repr__(self): - return "[" + ", ".join([str(x) for x in self]) + "]" - - @property - def n(self): - """ - The number of dotstars in the chain (read-only) - """ - return len(self) - - def _transmit(self, buffer): - if self._spi: - self._spi.write(buffer) - else: - self._ds_writebytes(buffer) - - def _ds_writebytes(self, buffer): - for b in buffer: - for _ in range(8): - self.dpin.value = b & 0x80 - self.cpin.value = True - self.cpin.value = False - b = b << 1 - self.cpin.value = False diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_pypixelbuf.py b/ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_pypixelbuf.py deleted file mode 100755 index 3cb83e970c..0000000000 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_pypixelbuf.py +++ /dev/null @@ -1,374 +0,0 @@ -# The MIT License (MIT) -# -# Based on the Adafruit NeoPixel and Adafruit Dotstar CircuitPython drivers. -# Copyright (c) 2019-2020 Roy 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. - -""" -`adafruit_pypixelbuf` - A pure python implementation of _pixelbuf -================================================================= -This class is used when _pixelbuf is not available in CircuitPython. It is based on the work -in neopixel.py and adafruit_dotstar.py. - -* Author(s): Damien P. George & Limor Fried & Scott Shawcroft & Roy Hooper -""" - -DOTSTAR_LED_START_FULL_BRIGHT = 0xFF -DOTSTAR_LED_START = 0b11100000 # Three "1" bits, followed by 5 brightness bits -DOTSTAR_LED_BRIGHTNESS = 0b00011111 - - -class PixelBuf: # pylint: disable=too-many-instance-attributes - """ - A sequence of RGB/RGBW pixels. - - This is the pure python implementation of CircuitPython's _pixelbuf. - - :param ~int n: Number of pixels - :param ~str byteorder: Byte order string constant (also sets bpp) - :param ~float brightness: Brightness (0 to 1.0, default 1.0) - :param ~bool auto_write: Whether to automatically write pixels (Default False) - :param bytes header: Sequence of bytes to always send before pixel values. - :param bytes trailer: Sequence of bytes to always send after pixel values. - """ - - def __init__( # pylint: disable=too-many-locals,too-many-arguments - self, - n, - byteorder="BGR", - brightness=1.0, - auto_write=False, - header=None, - trailer=None, - ): - - bpp, byteorder_tuple, has_white, dotstar_mode = self.parse_byteorder(byteorder) - - self.auto_write = False - - effective_bpp = 4 if dotstar_mode else bpp - _bytes = effective_bpp * n - buf = bytearray(_bytes) - offset = 0 - - if header is not None: - if not isinstance(header, bytearray): - raise TypeError("header must be a bytearray") - buf = header + buf - offset = len(header) - - if trailer is not None: - if not isinstance(trailer, bytearray): - raise TypeError("trailer must be a bytearray") - buf += trailer - - self._pixels = n - self._bytes = _bytes - self._byteorder = byteorder_tuple - self._byteorder_string = byteorder - self._has_white = has_white - self._bpp = bpp - self._pre_brightness_buffer = None - self._post_brightness_buffer = buf - self._offset = offset - self._dotstar_mode = dotstar_mode - self._pixel_step = effective_bpp - - if dotstar_mode: - self._byteorder_tuple = ( - byteorder_tuple[0] + 1, - byteorder_tuple[1] + 1, - byteorder_tuple[2] + 1, - 0, - ) - # Initialize the buffer with the dotstar start bytes. - for i in range(self._offset, self._bytes + self._offset, 4): - self._post_brightness_buffer[i] = DOTSTAR_LED_START_FULL_BRIGHT - - self._brightness = 1.0 - self.brightness = brightness - - self.auto_write = auto_write - - @staticmethod - def parse_byteorder(byteorder): - """ - Parse a Byteorder string for validity and determine bpp, byte order, and - dostar brightness bits. - - Byteorder strings may contain the following characters: - R - Red - G - Green - B - Blue - W - White - P - PWM (PWM Duty cycle for pixel - dotstars 0 - 1.0) - - :param: ~str bpp: bpp string. - :return: ~tuple: bpp, byteorder, has_white, dotstar_mode - """ - bpp = len(byteorder) - dotstar_mode = False - has_white = False - - if byteorder.strip("RGBWP") != "": - raise ValueError("Invalid Byteorder string") - - try: - r = byteorder.index("R") - g = byteorder.index("G") - b = byteorder.index("B") - except ValueError: - raise ValueError("Invalid Byteorder string") - if "W" in byteorder: - w = byteorder.index("W") - byteorder = (r, g, b, w) - has_white = True - elif "P" in byteorder: - lum = byteorder.index("P") - byteorder = (r, g, b, lum) - dotstar_mode = True - else: - byteorder = (r, g, b) - - return bpp, byteorder, has_white, dotstar_mode - - @property - def bpp(self): - """ - The number of bytes per pixel in the buffer (read-only). - """ - return self._bpp - - @property - def brightness(self): - """ - Float value between 0 and 1. Output brightness. - - When brightness is less than 1.0, a second buffer will be used to store the color values - before they are adjusted for brightness. - """ - return self._brightness - - @brightness.setter - def brightness(self, value): - value = min(max(value, 0.0), 1.0) - change = value - self._brightness - if -0.001 < change < 0.001: - return - - self._brightness = value - - if self._pre_brightness_buffer is None: - self._pre_brightness_buffer = bytearray(self._post_brightness_buffer) - - # Adjust brightness of existing pixels - offset_check = self._offset % self._pixel_step - for i in range(self._offset, self._bytes + self._offset): - # Don't adjust per-pixel luminance bytes in dotstar mode - if self._dotstar_mode and (i % 4 != offset_check): - continue - self._post_brightness_buffer[i] = int( - self._pre_brightness_buffer[i] * self._brightness - ) - - if self.auto_write: - self.show() - - @property - def byteorder(self): - """ - ByteOrder string for the buffer (read-only) - """ - return self._byteorder_string - - def __len__(self): - """ - Number of pixels. - """ - return self._pixels - - def show(self): - """ - Call the associated write function to display the pixels - """ - return self._transmit(self._post_brightness_buffer) - - def fill(self, color): - """ - Fills the given pixelbuf with the given color. - :param pixelbuf: A pixel object. - :param color: Color to set. - """ - r, g, b, w = self._parse_color(color) - for i in range(self._pixels): - self._set_item(i, r, g, b, w) - if self.auto_write: - self.show() - - def _parse_color(self, value): - r = 0 - g = 0 - b = 0 - w = 0 - if isinstance(value, int): - r = value >> 16 - g = (value >> 8) & 0xFF - b = value & 0xFF - w = 0 - - if self._dotstar_mode: - w = 1.0 - else: - if len(value) < 3 or len(value) > 4: - raise ValueError( - "Expected tuple of length {}, got {}".format(self._bpp, len(value)) - ) - if len(value) == self._bpp: - if self._bpp == 3: - r, g, b = value - else: - r, g, b, w = value - elif len(value) == 3: - r, g, b = value - if self._dotstar_mode: - w = 1.0 - - if self._bpp == 4: - if self._dotstar_mode: - # LED startframe is three "1" bits, followed by 5 brightness bits - # then 8 bits for each of R, G, and B. The order of those 3 are configurable and - # vary based on hardware - w = (int(w * 31) & 0b00011111) | DOTSTAR_LED_START - elif ( - self._has_white - and (isinstance(value, int) or len(value) == 3) - and r == g - and g == b - ): - # If all components are the same and we have a white pixel then use it - # instead of the individual components when all 4 values aren't explicitly given. - w = r - r = 0 - g = 0 - b = 0 - - return (r, g, b, w) - - def _set_item( - self, index, r, g, b, w - ): # pylint: disable=too-many-locals,too-many-branches,too-many-arguments - if index < 0: - index += len(self) - if index >= self._pixels or index < 0: - raise IndexError - offset = self._offset + (index * self._bpp) - - if self._pre_brightness_buffer is not None: - if self._bpp == 4: - self._pre_brightness_buffer[offset + self._byteorder[3]] = w - self._pre_brightness_buffer[offset + self._byteorder[0]] = r - self._pre_brightness_buffer[offset + self._byteorder[1]] = g - self._pre_brightness_buffer[offset + self._byteorder[2]] = b - - if self._bpp == 4: - # Only apply brightness if w is actually white (aka not DotStar.) - if not self._dotstar_mode: - w = int(w * self._brightness) - self._post_brightness_buffer[offset + self._byteorder[3]] = w - - self._post_brightness_buffer[offset + self._byteorder[0]] = int( - r * self._brightness - ) - self._post_brightness_buffer[offset + self._byteorder[1]] = int( - g * self._brightness - ) - self._post_brightness_buffer[offset + self._byteorder[2]] = int( - b * self._brightness - ) - - def __setitem__(self, index, val): - if isinstance(index, slice): - start, stop, step = index.indices(self._pixels) - for val_i, in_i in enumerate(range(start, stop, step)): - r, g, b, w = self._parse_color(val[val_i]) - self._set_item(in_i, r, g, b, w) - else: - r, g, b, w = self._parse_color(val) - self._set_item(index, r, g, b, w) - - if self.auto_write: - self.show() - - def _getitem(self, index): - start = self._offset + (index * self._bpp) - buffer = ( - self._pre_brightness_buffer - if self._pre_brightness_buffer is not None - else self._post_brightness_buffer - ) - value = [ - buffer[start + self._byteorder[0]], - buffer[start + self._byteorder[1]], - buffer[start + self._byteorder[2]], - ] - if self._has_white: - value.append(buffer[start + self._byteorder[3]]) - elif self._dotstar_mode: - value.append( - (buffer[start + self._byteorder[3]] & DOTSTAR_LED_BRIGHTNESS) / 31.0 - ) - return value - - def __getitem__(self, index): - if isinstance(index, slice): - out = [] - for in_i in range( - *index.indices(len(self._post_brightness_buffer) // self._bpp) - ): - out.append(self._getitem(in_i)) - return out - if index < 0: - index += len(self) - if index >= self._pixels or index < 0: - raise IndexError - return self._getitem(index) - - def _transmit(self, buffer): - raise NotImplementedError("Must be subclassed") - - -def wheel(pos): - """ - Helper to create a colorwheel. - - :param pos: int 0-255 of color value to return - :return: tuple of RGB values - """ - # Input a value 0 to 255 to get a color value. - # The colours are a transition r - g - b - back to r. - if pos < 0 or pos > 255: - return 0, 0, 0 - if pos < 85: - return 255 - pos * 3, pos * 3, 0 - if pos < 170: - pos -= 85 - return 0, 255 - pos * 3, pos * 3 - pos -= 170 - return pos * 3, 0, 255 - pos * 3 diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_requests.py b/ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_requests.py deleted file mode 100755 index 0888937bf8..0000000000 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/adafruit_requests.py +++ /dev/null @@ -1,311 +0,0 @@ -# The MIT License (MIT) -# -# Copyright (c) 2019 ladyada 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. -""" -`adafruit_requests` -================================================================================ - -A requests-like library for web interfacing - - -* Author(s): ladyada, Paul Sokolovsky - -Implementation Notes --------------------- - -Adapted from https://github.com/micropython/micropython-lib/tree/master/urequests - -micropython-lib consists of multiple modules from different sources and -authors. Each module comes under its own licensing terms. Short name of -a license can be found in a file within a module directory (usually -metadata.txt or setup.py). Complete text of each license used is provided -at https://github.com/micropython/micropython-lib/blob/master/LICENSE - -author='Paul Sokolovsky' -license='MIT' - -**Software and Dependencies:** - -* Adafruit CircuitPython firmware for the supported boards: - https://github.com/adafruit/circuitpython/releases - -""" - -import gc - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Requests.git" - -_the_interface = None # pylint: disable=invalid-name -_the_sock = None # pylint: disable=invalid-name - - -def set_socket(sock, iface=None): - """Helper to set the global socket and optionally set the global network interface. - :param sock: socket object. - :param iface: internet interface object - - """ - global _the_sock # pylint: disable=invalid-name, global-statement - _the_sock = sock - if iface: - global _the_interface # pylint: disable=invalid-name, global-statement - _the_interface = iface - _the_sock.set_interface(iface) - - -class Response: - """The response from a request, contains all the headers/content""" - - encoding = None - - def __init__(self, sock): - self.socket = sock - self.encoding = "utf-8" - self._cached = None - self.status_code = None - self.reason = None - self._read_so_far = 0 - self.headers = {} - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - """Close, delete and collect the response data""" - if self.socket: - self.socket.close() - del self.socket - del self._cached - gc.collect() - - @property - def content(self): - """The HTTP content direct from the socket, as bytes""" - # print(self.headers) - try: - content_length = int(self.headers["content-length"]) - except KeyError: - content_length = 0 - # print("Content length:", content_length) - if self._cached is None: - try: - self._cached = self.socket.recv(content_length) - finally: - self.socket.close() - self.socket = None - # print("Buffer length:", len(self._cached)) - return self._cached - - @property - def text(self): - """The HTTP content, encoded into a string according to the HTTP - header encoding""" - return str(self.content, self.encoding) - - def json(self): - """The HTTP content, parsed into a json dictionary""" - # pylint: disable=import-outside-toplevel - try: - import json as json_module - except ImportError: - import ujson as json_module - return json_module.loads(self.content) - - def iter_content(self, chunk_size=1, decode_unicode=False): - """An iterator that will stream data by only reading 'chunk_size' - bytes and yielding them, when we can't buffer the whole datastream""" - if decode_unicode: - raise NotImplementedError("Unicode not supported") - - while True: - chunk = self.socket.recv(chunk_size) - if chunk: - yield chunk - else: - return - - -# pylint: disable=too-many-branches, too-many-statements, unused-argument, too-many-arguments, too-many-locals -def request(method, url, data=None, json=None, headers=None, stream=False, timeout=1): - """Perform an HTTP request to the given url which we will parse to determine - whether to use SSL ('https://') or not. We can also send some provided 'data' - or a json dictionary which we will stringify. 'headers' is optional HTTP headers - sent along. 'stream' will determine if we buffer everything, or whether to only - read only when requested - """ - global _the_interface # pylint: disable=global-statement, invalid-name - global _the_sock # pylint: disable=global-statement, invalid-name - - if not headers: - headers = {} - - try: - proto, dummy, host, path = url.split("/", 3) - # replace spaces in path - path = path.replace(" ", "%20") - except ValueError: - proto, dummy, host = url.split("/", 2) - path = "" - if proto == "http:": - port = 80 - elif proto == "https:": - port = 443 - else: - raise ValueError("Unsupported protocol: " + proto) - - if ":" in host: - host, port = host.split(":", 1) - port = int(port) - - addr_info = _the_sock.getaddrinfo(host, port, 0, _the_sock.SOCK_STREAM)[0] - sock = _the_sock.socket(addr_info[0], addr_info[1], addr_info[2]) - resp = Response(sock) # our response - - sock.settimeout(timeout) # socket read timeout - - try: - if proto == "https:": - conntype = _the_interface.TLS_MODE - sock.connect( - (host, port), conntype - ) # for SSL we need to know the host name - else: - conntype = _the_interface.TCP_MODE - sock.connect(addr_info[-1], conntype) - sock.send( - b"%s /%s HTTP/1.0\r\n" % (bytes(method, "utf-8"), bytes(path, "utf-8")) - ) - if "Host" not in headers: - sock.send(b"Host: %s\r\n" % bytes(host, "utf-8")) - if "User-Agent" not in headers: - sock.send(b"User-Agent: Adafruit CircuitPython\r\n") - # Iterate over keys to avoid tuple alloc - for k in headers: - sock.send(k.encode()) - sock.send(b": ") - sock.send(headers[k].encode()) - sock.send(b"\r\n") - if json is not None: - assert data is None - # pylint: disable=import-outside-toplevel - try: - import json as json_module - except ImportError: - import ujson as json_module - # pylint: enable=import-outside-toplevel - data = json_module.dumps(json) - sock.send(b"Content-Type: application/json\r\n") - if data: - if isinstance(data, dict): - sock.send(b"Content-Type: application/x-www-form-urlencoded\r\n") - _post_data = "" - for k in data: - _post_data = "{}&{}={}".format(_post_data, k, data[k]) - data = _post_data[1:] - sock.send(b"Content-Length: %d\r\n" % len(data)) - sock.send(b"\r\n") - if data: - if isinstance(data, bytearray): - sock.send(bytes(data)) - else: - sock.send(bytes(data, "utf-8")) - - line = sock.readline() - # print(line) - line = line.split(None, 2) - status = int(line[1]) - reason = "" - if len(line) > 2: - reason = line[2].rstrip() - resp.headers = parse_headers(sock) - if resp.headers.get("transfer-encoding"): - if "chunked" in resp.headers.get("transfer-encoding"): - raise ValueError("Unsupported " + resp.headers.get("transfer-encoding")) - elif resp.headers.get("location") and not 200 <= status <= 299: - raise NotImplementedError("Redirects not yet supported") - - except: - sock.close() - raise - - resp.status_code = status - resp.reason = reason - return resp - - -def parse_headers(sock): - """ - Parses the header portion of an HTTP request/response from the socket. - Expects first line of HTTP request/response to have been read already - return: header dictionary - rtype: Dict - """ - headers = {} - while True: - line = sock.readline() - if not line or line == b"\r\n": - break - - # print("**line: ", line) - splits = line.split(b": ", 1) - title = splits[0] - content = "" - if len(splits) > 1: - content = splits[1] - if title and content: - title = str(title.lower(), "utf-8") - content = str(content, "utf-8") - headers[title] = content - return headers - - -def head(url, **kw): - """Send HTTP HEAD request""" - return request("HEAD", url, **kw) - - -def get(url, **kw): - """Send HTTP GET request""" - return request("GET", url, **kw) - - -def post(url, **kw): - """Send HTTP POST request""" - return request("POST", url, **kw) - - -def put(url, **kw): - """Send HTTP PUT request""" - return request("PUT", url, **kw) - - -def patch(url, **kw): - """Send HTTP PATCH request""" - return request("PATCH", url, **kw) - - -def delete(url, **kw): - """Send HTTP DELETE request""" - return request("DELETE", url, **kw) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/feathers2.py b/ports/esp32s2/boards/unexpectedmaker_feathers2/feathers2.py deleted file mode 100644 index 0631cad7f0..0000000000 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/feathers2.py +++ /dev/null @@ -1,47 +0,0 @@ -# FeatherS2 Helper Library -# 2020 Seon Rozenblum, Unexpected Maker -# -# Project home: -# https://feathers2.io -# - -# Import required libraries -import time -import board -from digitalio import DigitalInOut, Direction, Pull - - -# Helper functions - -def enable_LDO2(state): - """Set the power for the second on-board LDO to allow no current draw when not needed.""" - - # Grab a reference to the LDO2 IO (21 in this case) - ldo2 = DigitalInOut(board.LDO2) - ldo2.direction = Direction.OUTPUT - - # Set the LDO2 power pin on / off - ldo2.value = state - - # A small delay to let the IO change state - time.sleep(0.035) - - -# Dotstar rainbow colour wheel -def dotstar_color_wheel(wheel_pos): - """Color wheel to allow for cycling through the rainbow of RGB colors.""" - wheel_pos = wheel_pos % 255 - - if wheel_pos < 85: - return 255 - wheel_pos * 3, 0, wheel_pos * 3 - elif wheel_pos < 170: - wheel_pos -= 85 - return 0, wheel_pos * 3, 255 - wheel_pos * 3 - else: - wheel_pos -= 170 - return wheel_pos * 3, 255 - wheel_pos * 3, 0 - - - -# Disable LDO2 by default -enable_LDO2(False) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c b/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c index 5a29e029c2..c294fb9d3c 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c @@ -45,12 +45,12 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, - { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO8) }, - { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, @@ -82,10 +82,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO11) }, - // { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) }, // MTDO { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_GPIO40) }, // MTDO - - // { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_GPIO45) }, diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/adafruit_dotstar.py b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/adafruit_dotstar.py deleted file mode 100755 index 65fbbe8683..0000000000 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/adafruit_dotstar.py +++ /dev/null @@ -1,198 +0,0 @@ -# The MIT License (MIT) -# -# Copyright (c) 2016 Damien P. George (original Neopixel object) -# Copyright (c) 2017 Ladyada -# Copyright (c) 2017 Scott Shawcroft for Adafruit Industries -# Copyright (c) 2019 Roy 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. - -""" -`adafruit_dotstar` - DotStar strip driver (for CircuitPython 5.0+ with _pixelbuf) -================================================================================= - -* Author(s): Damien P. George, Limor Fried, Scott Shawcroft & Roy Hooper -""" - -# pylint: disable=ungrouped-imports -import sys -import busio -import digitalio - -if sys.implementation.version[0] < 5: - import adafruit_pypixelbuf as _pixelbuf -else: - try: - import _pixelbuf - except ImportError: - import adafruit_pypixelbuf as _pixelbuf - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DotStar.git" - -START_HEADER_SIZE = 4 - -# Pixel color order constants -RBG = "PRBG" -"""Red Blue Green""" -RGB = "PRGB" -"""Red Green Blue""" -GRB = "PGRB" -"""Green Red Blue""" -GBR = "PGBR" -"""Green Blue Red""" -BRG = "PBRG" -"""Blue Red Green""" -BGR = "PBGR" -"""Blue Green Red""" - - -class DotStar(_pixelbuf.PixelBuf): - """ - A sequence of dotstars. - - :param ~microcontroller.Pin clock: The pin to output dotstar clock on. - :param ~microcontroller.Pin data: The pin to output dotstar data on. - :param int n: The number of dotstars in the chain - :param float brightness: Brightness of the pixels between 0.0 and 1.0 - :param bool auto_write: True if the dotstars should immediately change when - set. If False, `show` must be called explicitly. - :param str pixel_order: Set the pixel order on the strip - different - strips implement this differently. If you send red, and it looks blue - or green on the strip, modify this! It should be one of the values above. - :param int baudrate: Desired clock rate if using hardware SPI (ignored if - using 'soft' SPI). This is only a recommendation; the actual clock - rate may be slightly different depending on what the system hardware - can provide. - - Example for Gemma M0: - - .. code-block:: python - - import adafruit_dotstar - import time - from board import * - - RED = 0x100000 - - with adafruit_dotstar.DotStar(APA102_SCK, APA102_MOSI, 1) as pixels: - pixels[0] = RED - time.sleep(2) - - .. py:method:: DotStar.show() - - Shows the new colors on the dotstars themselves if they haven't already - been autowritten. - - The colors may or may not be showing after this function returns because - it may be done asynchronously. - - .. py:method:: DotStar.fill(color) - - Colors all dotstars the given ***color***. - - .. py:attribute:: brightness - - Overall brightness of all dotstars (0 to 1.0) - """ - - def __init__( - self, - clock, - data, - n, - *, - brightness=1.0, - auto_write=True, - pixel_order=BGR, - baudrate=4000000 - ): - self._spi = None - try: - self._spi = busio.SPI(clock, MOSI=data) - while not self._spi.try_lock(): - pass - self._spi.configure(baudrate=baudrate) - - except (NotImplementedError, ValueError): - self.dpin = digitalio.DigitalInOut(data) - self.cpin = digitalio.DigitalInOut(clock) - self.dpin.direction = digitalio.Direction.OUTPUT - self.cpin.direction = digitalio.Direction.OUTPUT - self.cpin.value = False - - # Supply one extra clock cycle for each two pixels in the strip. - trailer_size = n // 16 - if n % 16 != 0: - trailer_size += 1 - - # Four empty bytes for the header. - header = bytearray(START_HEADER_SIZE) - # 0xff bytes for the trailer. - trailer = bytearray(b"\xff") * trailer_size - - super().__init__( - n, - byteorder=pixel_order, - brightness=brightness, - auto_write=auto_write, - header=header, - trailer=trailer, - ) - - def deinit(self): - """Blank out the DotStars and release the resources.""" - self.fill(0) - self.show() - if self._spi: - self._spi.deinit() - else: - self.dpin.deinit() - self.cpin.deinit() - - def __enter__(self): - return self - - def __exit__(self, exception_type, exception_value, traceback): - self.deinit() - - def __repr__(self): - return "[" + ", ".join([str(x) for x in self]) + "]" - - @property - def n(self): - """ - The number of dotstars in the chain (read-only) - """ - return len(self) - - def _transmit(self, buffer): - if self._spi: - self._spi.write(buffer) - else: - self._ds_writebytes(buffer) - - def _ds_writebytes(self, buffer): - for b in buffer: - for _ in range(8): - self.dpin.value = b & 0x80 - self.cpin.value = True - self.cpin.value = False - b = b << 1 - self.cpin.value = False diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/adafruit_pypixelbuf.py b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/adafruit_pypixelbuf.py deleted file mode 100755 index 3cb83e970c..0000000000 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/adafruit_pypixelbuf.py +++ /dev/null @@ -1,374 +0,0 @@ -# The MIT License (MIT) -# -# Based on the Adafruit NeoPixel and Adafruit Dotstar CircuitPython drivers. -# Copyright (c) 2019-2020 Roy 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. - -""" -`adafruit_pypixelbuf` - A pure python implementation of _pixelbuf -================================================================= -This class is used when _pixelbuf is not available in CircuitPython. It is based on the work -in neopixel.py and adafruit_dotstar.py. - -* Author(s): Damien P. George & Limor Fried & Scott Shawcroft & Roy Hooper -""" - -DOTSTAR_LED_START_FULL_BRIGHT = 0xFF -DOTSTAR_LED_START = 0b11100000 # Three "1" bits, followed by 5 brightness bits -DOTSTAR_LED_BRIGHTNESS = 0b00011111 - - -class PixelBuf: # pylint: disable=too-many-instance-attributes - """ - A sequence of RGB/RGBW pixels. - - This is the pure python implementation of CircuitPython's _pixelbuf. - - :param ~int n: Number of pixels - :param ~str byteorder: Byte order string constant (also sets bpp) - :param ~float brightness: Brightness (0 to 1.0, default 1.0) - :param ~bool auto_write: Whether to automatically write pixels (Default False) - :param bytes header: Sequence of bytes to always send before pixel values. - :param bytes trailer: Sequence of bytes to always send after pixel values. - """ - - def __init__( # pylint: disable=too-many-locals,too-many-arguments - self, - n, - byteorder="BGR", - brightness=1.0, - auto_write=False, - header=None, - trailer=None, - ): - - bpp, byteorder_tuple, has_white, dotstar_mode = self.parse_byteorder(byteorder) - - self.auto_write = False - - effective_bpp = 4 if dotstar_mode else bpp - _bytes = effective_bpp * n - buf = bytearray(_bytes) - offset = 0 - - if header is not None: - if not isinstance(header, bytearray): - raise TypeError("header must be a bytearray") - buf = header + buf - offset = len(header) - - if trailer is not None: - if not isinstance(trailer, bytearray): - raise TypeError("trailer must be a bytearray") - buf += trailer - - self._pixels = n - self._bytes = _bytes - self._byteorder = byteorder_tuple - self._byteorder_string = byteorder - self._has_white = has_white - self._bpp = bpp - self._pre_brightness_buffer = None - self._post_brightness_buffer = buf - self._offset = offset - self._dotstar_mode = dotstar_mode - self._pixel_step = effective_bpp - - if dotstar_mode: - self._byteorder_tuple = ( - byteorder_tuple[0] + 1, - byteorder_tuple[1] + 1, - byteorder_tuple[2] + 1, - 0, - ) - # Initialize the buffer with the dotstar start bytes. - for i in range(self._offset, self._bytes + self._offset, 4): - self._post_brightness_buffer[i] = DOTSTAR_LED_START_FULL_BRIGHT - - self._brightness = 1.0 - self.brightness = brightness - - self.auto_write = auto_write - - @staticmethod - def parse_byteorder(byteorder): - """ - Parse a Byteorder string for validity and determine bpp, byte order, and - dostar brightness bits. - - Byteorder strings may contain the following characters: - R - Red - G - Green - B - Blue - W - White - P - PWM (PWM Duty cycle for pixel - dotstars 0 - 1.0) - - :param: ~str bpp: bpp string. - :return: ~tuple: bpp, byteorder, has_white, dotstar_mode - """ - bpp = len(byteorder) - dotstar_mode = False - has_white = False - - if byteorder.strip("RGBWP") != "": - raise ValueError("Invalid Byteorder string") - - try: - r = byteorder.index("R") - g = byteorder.index("G") - b = byteorder.index("B") - except ValueError: - raise ValueError("Invalid Byteorder string") - if "W" in byteorder: - w = byteorder.index("W") - byteorder = (r, g, b, w) - has_white = True - elif "P" in byteorder: - lum = byteorder.index("P") - byteorder = (r, g, b, lum) - dotstar_mode = True - else: - byteorder = (r, g, b) - - return bpp, byteorder, has_white, dotstar_mode - - @property - def bpp(self): - """ - The number of bytes per pixel in the buffer (read-only). - """ - return self._bpp - - @property - def brightness(self): - """ - Float value between 0 and 1. Output brightness. - - When brightness is less than 1.0, a second buffer will be used to store the color values - before they are adjusted for brightness. - """ - return self._brightness - - @brightness.setter - def brightness(self, value): - value = min(max(value, 0.0), 1.0) - change = value - self._brightness - if -0.001 < change < 0.001: - return - - self._brightness = value - - if self._pre_brightness_buffer is None: - self._pre_brightness_buffer = bytearray(self._post_brightness_buffer) - - # Adjust brightness of existing pixels - offset_check = self._offset % self._pixel_step - for i in range(self._offset, self._bytes + self._offset): - # Don't adjust per-pixel luminance bytes in dotstar mode - if self._dotstar_mode and (i % 4 != offset_check): - continue - self._post_brightness_buffer[i] = int( - self._pre_brightness_buffer[i] * self._brightness - ) - - if self.auto_write: - self.show() - - @property - def byteorder(self): - """ - ByteOrder string for the buffer (read-only) - """ - return self._byteorder_string - - def __len__(self): - """ - Number of pixels. - """ - return self._pixels - - def show(self): - """ - Call the associated write function to display the pixels - """ - return self._transmit(self._post_brightness_buffer) - - def fill(self, color): - """ - Fills the given pixelbuf with the given color. - :param pixelbuf: A pixel object. - :param color: Color to set. - """ - r, g, b, w = self._parse_color(color) - for i in range(self._pixels): - self._set_item(i, r, g, b, w) - if self.auto_write: - self.show() - - def _parse_color(self, value): - r = 0 - g = 0 - b = 0 - w = 0 - if isinstance(value, int): - r = value >> 16 - g = (value >> 8) & 0xFF - b = value & 0xFF - w = 0 - - if self._dotstar_mode: - w = 1.0 - else: - if len(value) < 3 or len(value) > 4: - raise ValueError( - "Expected tuple of length {}, got {}".format(self._bpp, len(value)) - ) - if len(value) == self._bpp: - if self._bpp == 3: - r, g, b = value - else: - r, g, b, w = value - elif len(value) == 3: - r, g, b = value - if self._dotstar_mode: - w = 1.0 - - if self._bpp == 4: - if self._dotstar_mode: - # LED startframe is three "1" bits, followed by 5 brightness bits - # then 8 bits for each of R, G, and B. The order of those 3 are configurable and - # vary based on hardware - w = (int(w * 31) & 0b00011111) | DOTSTAR_LED_START - elif ( - self._has_white - and (isinstance(value, int) or len(value) == 3) - and r == g - and g == b - ): - # If all components are the same and we have a white pixel then use it - # instead of the individual components when all 4 values aren't explicitly given. - w = r - r = 0 - g = 0 - b = 0 - - return (r, g, b, w) - - def _set_item( - self, index, r, g, b, w - ): # pylint: disable=too-many-locals,too-many-branches,too-many-arguments - if index < 0: - index += len(self) - if index >= self._pixels or index < 0: - raise IndexError - offset = self._offset + (index * self._bpp) - - if self._pre_brightness_buffer is not None: - if self._bpp == 4: - self._pre_brightness_buffer[offset + self._byteorder[3]] = w - self._pre_brightness_buffer[offset + self._byteorder[0]] = r - self._pre_brightness_buffer[offset + self._byteorder[1]] = g - self._pre_brightness_buffer[offset + self._byteorder[2]] = b - - if self._bpp == 4: - # Only apply brightness if w is actually white (aka not DotStar.) - if not self._dotstar_mode: - w = int(w * self._brightness) - self._post_brightness_buffer[offset + self._byteorder[3]] = w - - self._post_brightness_buffer[offset + self._byteorder[0]] = int( - r * self._brightness - ) - self._post_brightness_buffer[offset + self._byteorder[1]] = int( - g * self._brightness - ) - self._post_brightness_buffer[offset + self._byteorder[2]] = int( - b * self._brightness - ) - - def __setitem__(self, index, val): - if isinstance(index, slice): - start, stop, step = index.indices(self._pixels) - for val_i, in_i in enumerate(range(start, stop, step)): - r, g, b, w = self._parse_color(val[val_i]) - self._set_item(in_i, r, g, b, w) - else: - r, g, b, w = self._parse_color(val) - self._set_item(index, r, g, b, w) - - if self.auto_write: - self.show() - - def _getitem(self, index): - start = self._offset + (index * self._bpp) - buffer = ( - self._pre_brightness_buffer - if self._pre_brightness_buffer is not None - else self._post_brightness_buffer - ) - value = [ - buffer[start + self._byteorder[0]], - buffer[start + self._byteorder[1]], - buffer[start + self._byteorder[2]], - ] - if self._has_white: - value.append(buffer[start + self._byteorder[3]]) - elif self._dotstar_mode: - value.append( - (buffer[start + self._byteorder[3]] & DOTSTAR_LED_BRIGHTNESS) / 31.0 - ) - return value - - def __getitem__(self, index): - if isinstance(index, slice): - out = [] - for in_i in range( - *index.indices(len(self._post_brightness_buffer) // self._bpp) - ): - out.append(self._getitem(in_i)) - return out - if index < 0: - index += len(self) - if index >= self._pixels or index < 0: - raise IndexError - return self._getitem(index) - - def _transmit(self, buffer): - raise NotImplementedError("Must be subclassed") - - -def wheel(pos): - """ - Helper to create a colorwheel. - - :param pos: int 0-255 of color value to return - :return: tuple of RGB values - """ - # Input a value 0 to 255 to get a color value. - # The colours are a transition r - g - b - back to r. - if pos < 0 or pos > 255: - return 0, 0, 0 - if pos < 85: - return 255 - pos * 3, pos * 3, 0 - if pos < 170: - pos -= 85 - return 0, 255 - pos * 3, pos * 3 - pos -= 170 - return pos * 3, 0, 255 - pos * 3 diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/feathers2.py b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/feathers2.py deleted file mode 100644 index 0631cad7f0..0000000000 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/feathers2.py +++ /dev/null @@ -1,47 +0,0 @@ -# FeatherS2 Helper Library -# 2020 Seon Rozenblum, Unexpected Maker -# -# Project home: -# https://feathers2.io -# - -# Import required libraries -import time -import board -from digitalio import DigitalInOut, Direction, Pull - - -# Helper functions - -def enable_LDO2(state): - """Set the power for the second on-board LDO to allow no current draw when not needed.""" - - # Grab a reference to the LDO2 IO (21 in this case) - ldo2 = DigitalInOut(board.LDO2) - ldo2.direction = Direction.OUTPUT - - # Set the LDO2 power pin on / off - ldo2.value = state - - # A small delay to let the IO change state - time.sleep(0.035) - - -# Dotstar rainbow colour wheel -def dotstar_color_wheel(wheel_pos): - """Color wheel to allow for cycling through the rainbow of RGB colors.""" - wheel_pos = wheel_pos % 255 - - if wheel_pos < 85: - return 255 - wheel_pos * 3, 0, wheel_pos * 3 - elif wheel_pos < 170: - wheel_pos -= 85 - return 0, wheel_pos * 3, 255 - wheel_pos * 3 - else: - wheel_pos -= 170 - return wheel_pos * 3, 255 - wheel_pos * 3, 0 - - - -# Disable LDO2 by default -enable_LDO2(False) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h index a65d00206d..726c46e401 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h @@ -30,11 +30,9 @@ #define MICROPY_HW_MCU_NAME "ESP32S2" #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) - -#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n" +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") #define AUTORESET_DELAY_MS 500 -// Doesn't work with this on. -// #define MICROPY_HW_APA102_MOSI (&pin_GPIO44) -// #define MICROPY_HW_APA102_SCK (&pin_GPIO45) +#define MICROPY_HW_APA102_MOSI (&pin_GPIO40) +#define MICROPY_HW_APA102_SCK (&pin_GPIO45) \ No newline at end of file diff --git a/ports/esp32s2/boards/unexpectedmaker_pros2/adafruit_dotstar.py b/ports/esp32s2/boards/unexpectedmaker_pros2/adafruit_dotstar.py deleted file mode 100755 index 65fbbe8683..0000000000 --- a/ports/esp32s2/boards/unexpectedmaker_pros2/adafruit_dotstar.py +++ /dev/null @@ -1,198 +0,0 @@ -# The MIT License (MIT) -# -# Copyright (c) 2016 Damien P. George (original Neopixel object) -# Copyright (c) 2017 Ladyada -# Copyright (c) 2017 Scott Shawcroft for Adafruit Industries -# Copyright (c) 2019 Roy 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. - -""" -`adafruit_dotstar` - DotStar strip driver (for CircuitPython 5.0+ with _pixelbuf) -================================================================================= - -* Author(s): Damien P. George, Limor Fried, Scott Shawcroft & Roy Hooper -""" - -# pylint: disable=ungrouped-imports -import sys -import busio -import digitalio - -if sys.implementation.version[0] < 5: - import adafruit_pypixelbuf as _pixelbuf -else: - try: - import _pixelbuf - except ImportError: - import adafruit_pypixelbuf as _pixelbuf - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DotStar.git" - -START_HEADER_SIZE = 4 - -# Pixel color order constants -RBG = "PRBG" -"""Red Blue Green""" -RGB = "PRGB" -"""Red Green Blue""" -GRB = "PGRB" -"""Green Red Blue""" -GBR = "PGBR" -"""Green Blue Red""" -BRG = "PBRG" -"""Blue Red Green""" -BGR = "PBGR" -"""Blue Green Red""" - - -class DotStar(_pixelbuf.PixelBuf): - """ - A sequence of dotstars. - - :param ~microcontroller.Pin clock: The pin to output dotstar clock on. - :param ~microcontroller.Pin data: The pin to output dotstar data on. - :param int n: The number of dotstars in the chain - :param float brightness: Brightness of the pixels between 0.0 and 1.0 - :param bool auto_write: True if the dotstars should immediately change when - set. If False, `show` must be called explicitly. - :param str pixel_order: Set the pixel order on the strip - different - strips implement this differently. If you send red, and it looks blue - or green on the strip, modify this! It should be one of the values above. - :param int baudrate: Desired clock rate if using hardware SPI (ignored if - using 'soft' SPI). This is only a recommendation; the actual clock - rate may be slightly different depending on what the system hardware - can provide. - - Example for Gemma M0: - - .. code-block:: python - - import adafruit_dotstar - import time - from board import * - - RED = 0x100000 - - with adafruit_dotstar.DotStar(APA102_SCK, APA102_MOSI, 1) as pixels: - pixels[0] = RED - time.sleep(2) - - .. py:method:: DotStar.show() - - Shows the new colors on the dotstars themselves if they haven't already - been autowritten. - - The colors may or may not be showing after this function returns because - it may be done asynchronously. - - .. py:method:: DotStar.fill(color) - - Colors all dotstars the given ***color***. - - .. py:attribute:: brightness - - Overall brightness of all dotstars (0 to 1.0) - """ - - def __init__( - self, - clock, - data, - n, - *, - brightness=1.0, - auto_write=True, - pixel_order=BGR, - baudrate=4000000 - ): - self._spi = None - try: - self._spi = busio.SPI(clock, MOSI=data) - while not self._spi.try_lock(): - pass - self._spi.configure(baudrate=baudrate) - - except (NotImplementedError, ValueError): - self.dpin = digitalio.DigitalInOut(data) - self.cpin = digitalio.DigitalInOut(clock) - self.dpin.direction = digitalio.Direction.OUTPUT - self.cpin.direction = digitalio.Direction.OUTPUT - self.cpin.value = False - - # Supply one extra clock cycle for each two pixels in the strip. - trailer_size = n // 16 - if n % 16 != 0: - trailer_size += 1 - - # Four empty bytes for the header. - header = bytearray(START_HEADER_SIZE) - # 0xff bytes for the trailer. - trailer = bytearray(b"\xff") * trailer_size - - super().__init__( - n, - byteorder=pixel_order, - brightness=brightness, - auto_write=auto_write, - header=header, - trailer=trailer, - ) - - def deinit(self): - """Blank out the DotStars and release the resources.""" - self.fill(0) - self.show() - if self._spi: - self._spi.deinit() - else: - self.dpin.deinit() - self.cpin.deinit() - - def __enter__(self): - return self - - def __exit__(self, exception_type, exception_value, traceback): - self.deinit() - - def __repr__(self): - return "[" + ", ".join([str(x) for x in self]) + "]" - - @property - def n(self): - """ - The number of dotstars in the chain (read-only) - """ - return len(self) - - def _transmit(self, buffer): - if self._spi: - self._spi.write(buffer) - else: - self._ds_writebytes(buffer) - - def _ds_writebytes(self, buffer): - for b in buffer: - for _ in range(8): - self.dpin.value = b & 0x80 - self.cpin.value = True - self.cpin.value = False - b = b << 1 - self.cpin.value = False diff --git a/ports/esp32s2/boards/unexpectedmaker_pros2/adafruit_pypixelbuf.py b/ports/esp32s2/boards/unexpectedmaker_pros2/adafruit_pypixelbuf.py deleted file mode 100755 index 3cb83e970c..0000000000 --- a/ports/esp32s2/boards/unexpectedmaker_pros2/adafruit_pypixelbuf.py +++ /dev/null @@ -1,374 +0,0 @@ -# The MIT License (MIT) -# -# Based on the Adafruit NeoPixel and Adafruit Dotstar CircuitPython drivers. -# Copyright (c) 2019-2020 Roy 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. - -""" -`adafruit_pypixelbuf` - A pure python implementation of _pixelbuf -================================================================= -This class is used when _pixelbuf is not available in CircuitPython. It is based on the work -in neopixel.py and adafruit_dotstar.py. - -* Author(s): Damien P. George & Limor Fried & Scott Shawcroft & Roy Hooper -""" - -DOTSTAR_LED_START_FULL_BRIGHT = 0xFF -DOTSTAR_LED_START = 0b11100000 # Three "1" bits, followed by 5 brightness bits -DOTSTAR_LED_BRIGHTNESS = 0b00011111 - - -class PixelBuf: # pylint: disable=too-many-instance-attributes - """ - A sequence of RGB/RGBW pixels. - - This is the pure python implementation of CircuitPython's _pixelbuf. - - :param ~int n: Number of pixels - :param ~str byteorder: Byte order string constant (also sets bpp) - :param ~float brightness: Brightness (0 to 1.0, default 1.0) - :param ~bool auto_write: Whether to automatically write pixels (Default False) - :param bytes header: Sequence of bytes to always send before pixel values. - :param bytes trailer: Sequence of bytes to always send after pixel values. - """ - - def __init__( # pylint: disable=too-many-locals,too-many-arguments - self, - n, - byteorder="BGR", - brightness=1.0, - auto_write=False, - header=None, - trailer=None, - ): - - bpp, byteorder_tuple, has_white, dotstar_mode = self.parse_byteorder(byteorder) - - self.auto_write = False - - effective_bpp = 4 if dotstar_mode else bpp - _bytes = effective_bpp * n - buf = bytearray(_bytes) - offset = 0 - - if header is not None: - if not isinstance(header, bytearray): - raise TypeError("header must be a bytearray") - buf = header + buf - offset = len(header) - - if trailer is not None: - if not isinstance(trailer, bytearray): - raise TypeError("trailer must be a bytearray") - buf += trailer - - self._pixels = n - self._bytes = _bytes - self._byteorder = byteorder_tuple - self._byteorder_string = byteorder - self._has_white = has_white - self._bpp = bpp - self._pre_brightness_buffer = None - self._post_brightness_buffer = buf - self._offset = offset - self._dotstar_mode = dotstar_mode - self._pixel_step = effective_bpp - - if dotstar_mode: - self._byteorder_tuple = ( - byteorder_tuple[0] + 1, - byteorder_tuple[1] + 1, - byteorder_tuple[2] + 1, - 0, - ) - # Initialize the buffer with the dotstar start bytes. - for i in range(self._offset, self._bytes + self._offset, 4): - self._post_brightness_buffer[i] = DOTSTAR_LED_START_FULL_BRIGHT - - self._brightness = 1.0 - self.brightness = brightness - - self.auto_write = auto_write - - @staticmethod - def parse_byteorder(byteorder): - """ - Parse a Byteorder string for validity and determine bpp, byte order, and - dostar brightness bits. - - Byteorder strings may contain the following characters: - R - Red - G - Green - B - Blue - W - White - P - PWM (PWM Duty cycle for pixel - dotstars 0 - 1.0) - - :param: ~str bpp: bpp string. - :return: ~tuple: bpp, byteorder, has_white, dotstar_mode - """ - bpp = len(byteorder) - dotstar_mode = False - has_white = False - - if byteorder.strip("RGBWP") != "": - raise ValueError("Invalid Byteorder string") - - try: - r = byteorder.index("R") - g = byteorder.index("G") - b = byteorder.index("B") - except ValueError: - raise ValueError("Invalid Byteorder string") - if "W" in byteorder: - w = byteorder.index("W") - byteorder = (r, g, b, w) - has_white = True - elif "P" in byteorder: - lum = byteorder.index("P") - byteorder = (r, g, b, lum) - dotstar_mode = True - else: - byteorder = (r, g, b) - - return bpp, byteorder, has_white, dotstar_mode - - @property - def bpp(self): - """ - The number of bytes per pixel in the buffer (read-only). - """ - return self._bpp - - @property - def brightness(self): - """ - Float value between 0 and 1. Output brightness. - - When brightness is less than 1.0, a second buffer will be used to store the color values - before they are adjusted for brightness. - """ - return self._brightness - - @brightness.setter - def brightness(self, value): - value = min(max(value, 0.0), 1.0) - change = value - self._brightness - if -0.001 < change < 0.001: - return - - self._brightness = value - - if self._pre_brightness_buffer is None: - self._pre_brightness_buffer = bytearray(self._post_brightness_buffer) - - # Adjust brightness of existing pixels - offset_check = self._offset % self._pixel_step - for i in range(self._offset, self._bytes + self._offset): - # Don't adjust per-pixel luminance bytes in dotstar mode - if self._dotstar_mode and (i % 4 != offset_check): - continue - self._post_brightness_buffer[i] = int( - self._pre_brightness_buffer[i] * self._brightness - ) - - if self.auto_write: - self.show() - - @property - def byteorder(self): - """ - ByteOrder string for the buffer (read-only) - """ - return self._byteorder_string - - def __len__(self): - """ - Number of pixels. - """ - return self._pixels - - def show(self): - """ - Call the associated write function to display the pixels - """ - return self._transmit(self._post_brightness_buffer) - - def fill(self, color): - """ - Fills the given pixelbuf with the given color. - :param pixelbuf: A pixel object. - :param color: Color to set. - """ - r, g, b, w = self._parse_color(color) - for i in range(self._pixels): - self._set_item(i, r, g, b, w) - if self.auto_write: - self.show() - - def _parse_color(self, value): - r = 0 - g = 0 - b = 0 - w = 0 - if isinstance(value, int): - r = value >> 16 - g = (value >> 8) & 0xFF - b = value & 0xFF - w = 0 - - if self._dotstar_mode: - w = 1.0 - else: - if len(value) < 3 or len(value) > 4: - raise ValueError( - "Expected tuple of length {}, got {}".format(self._bpp, len(value)) - ) - if len(value) == self._bpp: - if self._bpp == 3: - r, g, b = value - else: - r, g, b, w = value - elif len(value) == 3: - r, g, b = value - if self._dotstar_mode: - w = 1.0 - - if self._bpp == 4: - if self._dotstar_mode: - # LED startframe is three "1" bits, followed by 5 brightness bits - # then 8 bits for each of R, G, and B. The order of those 3 are configurable and - # vary based on hardware - w = (int(w * 31) & 0b00011111) | DOTSTAR_LED_START - elif ( - self._has_white - and (isinstance(value, int) or len(value) == 3) - and r == g - and g == b - ): - # If all components are the same and we have a white pixel then use it - # instead of the individual components when all 4 values aren't explicitly given. - w = r - r = 0 - g = 0 - b = 0 - - return (r, g, b, w) - - def _set_item( - self, index, r, g, b, w - ): # pylint: disable=too-many-locals,too-many-branches,too-many-arguments - if index < 0: - index += len(self) - if index >= self._pixels or index < 0: - raise IndexError - offset = self._offset + (index * self._bpp) - - if self._pre_brightness_buffer is not None: - if self._bpp == 4: - self._pre_brightness_buffer[offset + self._byteorder[3]] = w - self._pre_brightness_buffer[offset + self._byteorder[0]] = r - self._pre_brightness_buffer[offset + self._byteorder[1]] = g - self._pre_brightness_buffer[offset + self._byteorder[2]] = b - - if self._bpp == 4: - # Only apply brightness if w is actually white (aka not DotStar.) - if not self._dotstar_mode: - w = int(w * self._brightness) - self._post_brightness_buffer[offset + self._byteorder[3]] = w - - self._post_brightness_buffer[offset + self._byteorder[0]] = int( - r * self._brightness - ) - self._post_brightness_buffer[offset + self._byteorder[1]] = int( - g * self._brightness - ) - self._post_brightness_buffer[offset + self._byteorder[2]] = int( - b * self._brightness - ) - - def __setitem__(self, index, val): - if isinstance(index, slice): - start, stop, step = index.indices(self._pixels) - for val_i, in_i in enumerate(range(start, stop, step)): - r, g, b, w = self._parse_color(val[val_i]) - self._set_item(in_i, r, g, b, w) - else: - r, g, b, w = self._parse_color(val) - self._set_item(index, r, g, b, w) - - if self.auto_write: - self.show() - - def _getitem(self, index): - start = self._offset + (index * self._bpp) - buffer = ( - self._pre_brightness_buffer - if self._pre_brightness_buffer is not None - else self._post_brightness_buffer - ) - value = [ - buffer[start + self._byteorder[0]], - buffer[start + self._byteorder[1]], - buffer[start + self._byteorder[2]], - ] - if self._has_white: - value.append(buffer[start + self._byteorder[3]]) - elif self._dotstar_mode: - value.append( - (buffer[start + self._byteorder[3]] & DOTSTAR_LED_BRIGHTNESS) / 31.0 - ) - return value - - def __getitem__(self, index): - if isinstance(index, slice): - out = [] - for in_i in range( - *index.indices(len(self._post_brightness_buffer) // self._bpp) - ): - out.append(self._getitem(in_i)) - return out - if index < 0: - index += len(self) - if index >= self._pixels or index < 0: - raise IndexError - return self._getitem(index) - - def _transmit(self, buffer): - raise NotImplementedError("Must be subclassed") - - -def wheel(pos): - """ - Helper to create a colorwheel. - - :param pos: int 0-255 of color value to return - :return: tuple of RGB values - """ - # Input a value 0 to 255 to get a color value. - # The colours are a transition r - g - b - back to r. - if pos < 0 or pos > 255: - return 0, 0, 0 - if pos < 85: - return 255 - pos * 3, pos * 3, 0 - if pos < 170: - pos -= 85 - return 0, 255 - pos * 3, pos * 3 - pos -= 170 - return pos * 3, 0, 255 - pos * 3 diff --git a/ports/esp32s2/boards/unexpectedmaker_pros2/board.c b/ports/esp32s2/boards/unexpectedmaker_pros2/board.c deleted file mode 100644 index 1dc30b5af8..0000000000 --- a/ports/esp32s2/boards/unexpectedmaker_pros2/board.c +++ /dev/null @@ -1,56 +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 "boards/board.h" -#include "mpconfigboard.h" -#include "shared-bindings/microcontroller/Pin.h" - -void board_init(void) { - // USB - common_hal_never_reset_pin(&pin_GPIO19); - common_hal_never_reset_pin(&pin_GPIO20); - - // Debug UART - common_hal_never_reset_pin(&pin_GPIO43); - common_hal_never_reset_pin(&pin_GPIO44); - - // SPI Flash and RAM - common_hal_never_reset_pin(&pin_GPIO26); - common_hal_never_reset_pin(&pin_GPIO27); - common_hal_never_reset_pin(&pin_GPIO28); - common_hal_never_reset_pin(&pin_GPIO29); - common_hal_never_reset_pin(&pin_GPIO30); - common_hal_never_reset_pin(&pin_GPIO31); - common_hal_never_reset_pin(&pin_GPIO32); -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} diff --git a/ports/esp32s2/boards/unexpectedmaker_pros2/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_pros2/mpconfigboard.h deleted file mode 100644 index 2cfb7b6a0f..0000000000 --- a/ports/esp32s2/boards/unexpectedmaker_pros2/mpconfigboard.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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 "ProS2" -#define MICROPY_HW_MCU_NAME "ESP32S2" - -#define AUTORESET_DELAY_MS 500 - -#define MICROPY_HW_APA102_MOSI (&pin_GPIO40) -#define MICROPY_HW_APA102_SCK (&pin_GPIO45) diff --git a/ports/esp32s2/boards/unexpectedmaker_pros2/mpconfigboard.mk b/ports/esp32s2/boards/unexpectedmaker_pros2/mpconfigboard.mk deleted file mode 100644 index cb6823ba67..0000000000 --- a/ports/esp32s2/boards/unexpectedmaker_pros2/mpconfigboard.mk +++ /dev/null @@ -1,21 +0,0 @@ -USB_VID = 0x239A -USB_PID = 0x80AA -USB_PRODUCT = "ProS2" -USB_MANUFACTURER = "UnexpectedMaker" -USB_DEVICES = "CDC,MSC,HID" - -INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = MPZ - -# The default queue depth of 16 overflows on release builds, -# so increase it to 32. -CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 - -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=16MB - -CIRCUITPY_BITBANG_APA102 = 1 - -# Include these Python libraries in firmware. -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar diff --git a/ports/esp32s2/boards/unexpectedmaker_pros2/pins.c b/ports/esp32s2/boards/unexpectedmaker_pros2/pins.c deleted file mode 100644 index 349ad1bd5d..0000000000 --- a/ports/esp32s2/boards/unexpectedmaker_pros2/pins.c +++ /dev/null @@ -1,58 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, - { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO17) }, - - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, - { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO18) }, - - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO4) }, - { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO4) }, - - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO12) }, - { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO12) }, - - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO6) }, - { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO6) }, - - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, - { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO5) }, - - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, - { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO36) }, - - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, - { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO35) }, - - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, - { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO37) }, - - { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO44) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, - - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, - - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO9) }, - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO1) }, - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO3) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO7) }, - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO8) }, - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO9) }, - { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO10) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO11) }, - - { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_GPIO40) }, // MTDO - { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_GPIO45) }, - - { MP_ROM_QSTR(MP_QSTR_LDO2), MP_ROM_PTR(&pin_GPIO21) }, - - { MP_ROM_QSTR(MP_QSTR_VBAT_SENSE), MP_ROM_PTR(&pin_GPIO14) }, - - { 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_global_dict_table); diff --git a/ports/esp32s2/boards/unexpectedmaker_pros2/pros2.py b/ports/esp32s2/boards/unexpectedmaker_pros2/pros2.py deleted file mode 100644 index 3d2397d5d4..0000000000 --- a/ports/esp32s2/boards/unexpectedmaker_pros2/pros2.py +++ /dev/null @@ -1,63 +0,0 @@ -# Pros2 Helper Library -# 2020 Seon Rozenblum, Unexpected Maker -# -# Project home: -# https://pros2.io -# - -# Import required libraries -import time -import board -from digitalio import DigitalInOut, Direction, Pull -from analogio import AnalogIn - - -# Helper functions - -def enable_LDO2(state): - """Set the power for the second on-board LDO to allow no current draw when not needed.""" - - # Grab a reference to the LDO2 IO (21 in this case) - ldo2 = DigitalInOut(board.LDO2) - ldo2.direction = Direction.OUTPUT - - # Set the LDO2 power pin on / off - ldo2.value = state - - # A small delay to let the IO change state - time.sleep(0.035) - - -# Dotstar rainbow colour wheel -def dotstar_color_wheel(wheel_pos): - """Color wheel to allow for cycling through the rainbow of RGB colors.""" - wheel_pos = wheel_pos % 255 - - if wheel_pos < 85: - return 255 - wheel_pos * 3, 0, wheel_pos * 3 - elif wheel_pos < 170: - wheel_pos -= 85 - return 0, wheel_pos * 3, 255 - wheel_pos * 3 - else: - wheel_pos -= 170 - return wheel_pos * 3, 255 - wheel_pos * 3, 0 - - -# Get a *rough* estimate of the current battery voltage -# If the battery is not present, the charge IC will still report it's trying to charge at X voltage -# so it will still show a voltage. -def get_battery_voltage(): - """ - Returns the current battery voltage. If no battery is connected, returns 3.7V - This is an approximation only, but useful to detect of the charge state of the battery is getting low. - """ - adc = AnalogIn(board.VBAT_SENSE) - - measured_vbat = adc.value # Read the value - measured_vbat /= 4095 # divide by 4095 as we are using the default ADC voltage range of 0-1V - measured_vbat *= 3.7 # Multiply by 3.7V, our reference voltage - return measured_vbat - - -# Disable LDO2 by default -enable_LDO2(False) diff --git a/ports/esp32s2/boards/unexpectedmaker_pros2/sdkconfig b/ports/esp32s2/boards/unexpectedmaker_pros2/sdkconfig deleted file mode 100644 index b73c4a8c20..0000000000 --- a/ports/esp32s2/boards/unexpectedmaker_pros2/sdkconfig +++ /dev/null @@ -1,35 +0,0 @@ -CONFIG_ESP32S2_SPIRAM_SUPPORT=y - -# -# SPI RAM config -# -# CONFIG_SPIRAM_TYPE_AUTO is not set -# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set -# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set -CONFIG_SPIRAM_TYPE_ESPPSRAM64=y -CONFIG_SPIRAM_SIZE=8388608 - -# -# PSRAM clock and cs IO for ESP32S2 -# -CONFIG_DEFAULT_PSRAM_CLK_IO=30 -CONFIG_DEFAULT_PSRAM_CS_IO=26 -# end of PSRAM clock and cs IO for ESP32S2 - -CONFIG_SPIRAM_SPIWP_SD3_PIN=28 -# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set -# CONFIG_SPIRAM_RODATA is not set -# CONFIG_SPIRAM_USE_AHB_DBUS3 is not set -# CONFIG_SPIRAM_SPEED_80M is not set -CONFIG_SPIRAM_SPEED_40M=y -# CONFIG_SPIRAM_SPEED_26M is not set -# CONFIG_SPIRAM_SPEED_20M is not set -CONFIG_SPIRAM=y -CONFIG_SPIRAM_BOOT_INIT=y -# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set -CONFIG_SPIRAM_USE_MEMMAP=y -# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set -# CONFIG_SPIRAM_USE_MALLOC is not set -CONFIG_SPIRAM_MEMTEST=y -# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set -# end of SPI RAM config From 176b3376113180ab38fe1c43e2947d358ff041fe Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 28 Sep 2020 18:59:57 -0500 Subject: [PATCH 1026/1293] rgbmatrix: validate width= constructor parameter In #3482, @cwalther noted that, hypothetically, a zero byte allocation could be made in the RGBMatrix constructor. Ensure that width is positive. Height was already checked against the number of RGB pins if it was specified, so zero is ruled out there as well. --- shared-bindings/rgbmatrix/RGBMatrix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index e4683af920..6a99e1f3dd 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -210,6 +210,10 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n } } + if (args[ARG_width] <= 0) { + mp_raise_ValueError(translate("width must be greater than zero")); + } + preflight_pins_or_throw(clock_pin, rgb_pins, rgb_count, true); mp_obj_t framebuffer = args[ARG_framebuffer].u_obj; From e4b9c168912799d126894dbdf44f6af5c5d4878d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 28 Sep 2020 19:03:04 -0500 Subject: [PATCH 1027/1293] rgbmatrix: Check that the number of rgb pins is supported. Having zero RGB pins may not have been caught, nor having a non-multiple-of-6 value. Generally, users will only have 6 RGB pins unless they are driving multiple matrices in parallel. No existing breakouts exist to do this, and there are probably not any efficient pinouts to be had anyway. --- locale/circuitpython.pot | 10 +++++++++- shared-bindings/rgbmatrix/RGBMatrix.c | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index b6de5667e2..ec27b2f6b6 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 11:11+0530\n" +"POT-Creation-Date: 2020-09-29 19:54-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1662,6 +1662,10 @@ msgid "" "exit safe mode.\n" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" @@ -3516,6 +3520,10 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "width must be greater than zero" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index 6a99e1f3dd..7ddbd36fb5 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -73,6 +73,10 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_ uint32_t port = clock_pin / 32; uint32_t bit_mask = 1 << (clock_pin % 32); + if (rgb_pin_count <= 0 || rgb_pin_count % 6 != 0 || rgb_pin_count > 30) { + mp_raise_ValueError_varg(translate("The length of rgb_pins must be 6, 12, 18, 24, or 30")); + } + for (uint8_t i = 0; i < rgb_pin_count; i++) { uint32_t pin_port = rgb_pins[i] / 32; From 8f8326fe57f386271c53fda029085e9d9722e8af Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 29 Sep 2020 19:57:26 -0500 Subject: [PATCH 1028/1293] Makefile: Correct and expand translation excluded directories As originally written, the TRANSLATE_SOURCES_EXC was incorrect. If more than one build directory existed, "make translate" (and make check-translate) would error. I corrected the problem, commented it, and added a number of additional exclude directives. I reviewed the PR and should have caught this, but did not. --- Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e7b2bb0444..c032b0f634 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,17 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(BASEOPTS) I18NSPHINXOPTS = $(BASEOPTS) TRANSLATE_SOURCES = extmod lib main.c ports/atmel-samd ports/cxd56 ports/esp32s2 ports/mimxrt10xx ports/nrf ports/stm py shared-bindings shared-module supervisor -TRANSLATE_SOURCES_EXC = -path ports/*/build-* -o -path ports/esp32s2/esp-idf +# Paths to exclude from TRANSLATE_SOURCES +# Each must be preceded by "-path"; if any wildcards, enclose in quotes. +# Separate by "-o" (Find's "or" operand) +TRANSLATE_SOURCES_EXC = -path "ports/*/build-*" \ + -o -path ports/esp32s2/esp-idf \ + -o -path ports/cxd56/spresense-exported-sdk \ + -o -path ports/stm/st_driver \ + -o -path ports/atmel-samd/asf4 \ + -o -path ports/mimxrt10xx/sdk \ + -o -path lib/tinyusb \ + -o -path lib/lwip \ .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext stubs From 88cbf772dfb5bcfd020c42c2470d0287c4b780a8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 29 Sep 2020 20:13:52 -0500 Subject: [PATCH 1029/1293] canio.CAN: clarify read-only status of several properties --- shared-bindings/canio/CAN.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/shared-bindings/canio/CAN.c b/shared-bindings/canio/CAN.c index e8ab15a3c9..6dae36943a 100644 --- a/shared-bindings/canio/CAN.c +++ b/shared-bindings/canio/CAN.c @@ -172,7 +172,7 @@ STATIC const mp_obj_property_t canio_can_receive_error_count_obj = { }; //| state: State -//| """The current state of the bus.""" +//| """The current state of the bus. (read-only)""" STATIC mp_obj_t canio_can_state_get(mp_obj_t self_in) { canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_canio_can_check_for_deinit(self); @@ -256,7 +256,8 @@ STATIC mp_obj_t canio_can_listen(size_t n_args, const mp_obj_t *pos_args, mp_map MP_DEFINE_CONST_FUN_OBJ_KW(canio_can_listen_obj, 1, canio_can_listen); //| loopback: bool -//| """True if the device was created in loopback mode, False otherwise""" +//| """True if the device was created in loopback mode, False +//| otherwise (read-only)""" //| STATIC mp_obj_t canio_can_loopback_get(mp_obj_t self_in) { canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -294,7 +295,8 @@ STATIC mp_obj_t canio_can_send(mp_obj_t self_in, mp_obj_t message_in) { MP_DEFINE_CONST_FUN_OBJ_2(canio_can_send_obj, canio_can_send); //| silent: bool -//| """True if the device was created in silent mode, False otherwise""" +//| """True if the device was created in silent mode, False +//| otherwise (read-only)""" //| STATIC mp_obj_t canio_can_silent_get(mp_obj_t self_in) { canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); From 66b8559fd4e4ea7d50adb12a87b7bac208b5fc16 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 28 Sep 2020 18:59:29 -0400 Subject: [PATCH 1030/1293] Change submodule, rework all includes --- .gitmodules | 6 +- ports/esp32s2/Makefile | 61 +++++++++++-------- ports/esp32s2/bindings/espidf/__init__.c | 2 +- ports/esp32s2/common-hal/busio/I2C.c | 2 +- ports/esp32s2/common-hal/busio/I2C.h | 2 +- ports/esp32s2/common-hal/busio/SPI.c | 2 +- ports/esp32s2/common-hal/busio/SPI.h | 6 +- ports/esp32s2/common-hal/busio/UART.c | 2 +- ports/esp32s2/common-hal/busio/UART.h | 2 +- .../common-hal/digitalio/DigitalInOut.c | 4 +- .../esp32s2/common-hal/microcontroller/Pin.c | 4 +- .../common-hal/microcontroller/Processor.c | 2 +- .../common-hal/neopixel_write/__init__.c | 4 +- ports/esp32s2/common-hal/pulseio/PulseIn.h | 4 +- ports/esp32s2/common-hal/pulseio/PulseOut.h | 4 +- ports/esp32s2/common-hal/pwmio/PWMOut.c | 2 +- ports/esp32s2/common-hal/pwmio/PWMOut.h | 2 +- ports/esp32s2/common-hal/rtc/RTC.c | 2 +- ports/esp32s2/common-hal/socketpool/Socket.h | 3 +- .../common-hal/socketpool/SocketPool.c | 2 +- ports/esp32s2/common-hal/ssl/SSLContext.h | 2 +- ports/esp32s2/common-hal/ssl/__init__.c | 2 +- ports/esp32s2/common-hal/wifi/Network.h | 2 +- ports/esp32s2/common-hal/wifi/Radio.c | 4 +- ports/esp32s2/common-hal/wifi/Radio.h | 2 +- .../esp32s2/common-hal/wifi/ScannedNetworks.c | 2 +- .../esp32s2/common-hal/wifi/ScannedNetworks.h | 3 +- ports/esp32s2/common-hal/wifi/__init__.c | 7 ++- ports/esp32s2/esp-idf | 2 +- ports/esp32s2/mphalport.c | 4 +- ports/esp32s2/peripherals/pins.h | 2 +- ports/esp32s2/peripherals/rmt.c | 2 +- ports/esp32s2/peripherals/rmt.h | 2 +- ports/esp32s2/supervisor/internal_flash.c | 2 +- ports/esp32s2/supervisor/port.c | 4 +- ports/esp32s2/supervisor/usb.c | 8 +-- shared-bindings/socketpool/Socket.c | 1 - shared-bindings/socketpool/SocketPool.c | 1 - shared-bindings/wifi/ScannedNetworks.c | 1 - 39 files changed, 89 insertions(+), 82 deletions(-) diff --git a/.gitmodules b/.gitmodules index 3603cea696..f66ce8aafa 100644 --- a/.gitmodules +++ b/.gitmodules @@ -144,12 +144,12 @@ [submodule "frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center"] path = frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center url = https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center -[submodule "ports/esp32s2/esp-idf"] - path = ports/esp32s2/esp-idf - url = https://github.com/tannewt/esp-idf.git [submodule "frozen/Adafruit_CircuitPython_RFM9x"] path = frozen/Adafruit_CircuitPython_RFM9x url = https://github.com/adafruit/Adafruit_CircuitPython_RFM9x.git [submodule "frozen/Adafruit_CircuitPython_RFM69"] path = frozen/Adafruit_CircuitPython_RFM69 url = https://github.com/adafruit/Adafruit_CircuitPython_RFM69.git +[submodule "ports/esp32s2/esp-idf"] + path = ports/esp32s2/esp-idf + url = https://github.com/espressif/esp-idf.git diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 229a3bf3ab..49b9c6d2bd 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -73,30 +73,37 @@ INC += -I./peripherals INC += -I../../lib/mp-readline INC += -I../../lib/tinyusb/src INC += -I../../supervisor/shared/usb -INC += -Iesp-idf/components/freertos/include/freertos -INC += -Iesp-idf/components/freertos/xtensa/include -INC += -Iesp-idf/components/esp32s2/include -INC += -Iesp-idf/components/xtensa/esp32s2/include -INC += -Iesp-idf/components/esp_common/include -INC += -Iesp-idf/components/esp_event/include -INC += -Iesp-idf/components/esp_netif/include -INC += -Iesp-idf/components/esp_ringbuf/include -INC += -Iesp-idf/components/esp_rom/include -INC += -Iesp-idf/components/esp_wifi/include -INC += -Iesp-idf/components/xtensa/include -INC += -Iesp-idf/components/esp_timer/include -INC += -Iesp-idf/components/mbedtls/mbedtls/include -INC += -Iesp-idf/components/mbedtls/port/include/ -INC += -Iesp-idf/components/newlib/platform_include -INC += -Iesp-idf/components/lwip/lwip/src/include -INC += -Iesp-idf/components/lwip/port/esp32/include -INC += -Iesp-idf/components/lwip/include/apps/sntp -INC += -Iesp-idf/components/soc/include -INC += -Iesp-idf/components/soc/src/esp32s2/include -INC += -Iesp-idf/components/soc/soc/include -INC += -Iesp-idf/components/soc/soc/esp32s2/include -INC += -Iesp-idf/components/heap/include -INC += -Iesp-idf/components/esp_system/include + +INC += -isystem esp-idf +INC += -isystem esp-idf/components/driver/include +INC += -isystem esp-idf/components/hal/esp32s2/include +INC += -isystem esp-idf/components/hal/include + +INC += -isystem esp-idf/components/freertos/include/freertos +INC += -isystem esp-idf/components/freertos/xtensa/include +INC += -isystem esp-idf/components/esp32s2/include +INC += -isystem esp-idf/components/xtensa/esp32s2/include +INC += -isystem esp-idf/components/esp_common/include +INC += -isystem esp-idf/components/esp_event/include +INC += -isystem esp-idf/components/esp_netif/include +INC += -isystem esp-idf/components/esp_ringbuf/include +INC += -isystem esp-idf/components/esp_rom/include +INC += -isystem esp-idf/components/esp_wifi/include +INC += -isystem esp-idf/components/xtensa/include +INC += -isystem esp-idf/components/esp_timer/include +INC += -isystem esp-idf/components/mbedtls/mbedtls/include +INC += -isystem esp-idf/components/mbedtls/port/include/ +INC += -isystem esp-idf/components/newlib/platform_include +INC += -isystem esp-idf/components/lwip/lwip/src/include +INC += -isystem esp-idf/components/lwip/port/esp32/include +INC += -isystem esp-idf/components/lwip/include/apps/sntp +INC += -isystem esp-idf/components/hal/include +INC += -isystem esp-idf/components/soc/include +INC += -isystem esp-idf/components/soc/src/esp32s2/include +INC += -isystem esp-idf/components/soc/soc/include +INC += -isystem esp-idf/components/soc/soc/esp32s2/include +INC += -isystem esp-idf/components/heap/include +INC += -isystem esp-idf/components/esp_system/include INC += -I$(BUILD)/esp-idf/config CFLAGS += -DHAVE_CONFIG_H \ @@ -256,7 +263,7 @@ menuconfig: $(BUILD)/esp-idf/config $(HEADER_BUILD)/qstr.i.last: | $(BUILD)/esp-idf/config/sdkconfig.h # Order here matters -ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip esp_rom esp-tls +ESP_IDF_COMPONENTS_LINK = freertos log hal esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip esp_rom esp-tls ESP_IDF_COMPONENTS_INCLUDE = driver freertos log soc @@ -268,11 +275,11 @@ ESP_IDF_WIFI_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_WIFI_COMPONENT MBEDTLS_COMPONENTS_LINK = crypto tls x509 MBEDTLS_COMPONENTS_LINK_EXPANDED = $(foreach component, $(MBEDTLS_COMPONENTS_LINK), $(BUILD)/esp-idf/esp-idf/mbedtls/mbedtls/library/libmbed$(component).a) -BINARY_BLOBS = esp-idf/components/xtensa/esp32s2/libhal.a +BINARY_BLOBS = esp-idf/components/xtensa/esp32s2/libxt_hal.a BINARY_WIFI_BLOBS = libcoexist.a libcore.a libespnow.a libmesh.a libnet80211.a libpp.a librtc.a libsmartconfig.a libphy.a BINARY_BLOBS += $(addprefix esp-idf/components/esp_wifi/lib/esp32s2/, $(BINARY_WIFI_BLOBS)) -ESP_IDF_COMPONENTS_EXPANDED += $(BUILD)/esp-idf/esp-idf/soc/soc/esp32s2/libsoc_esp32s2.a esp-idf/components/xtensa/esp32s2/libhal.a +ESP_IDF_COMPONENTS_EXPANDED += $(BUILD)/esp-idf/esp-idf/soc/soc/esp32s2/libsoc_esp32s2.a esp-idf/components/xtensa/esp32s2/libxt_hal.a ESP_AUTOGEN_LD = $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld $(BUILD)/esp-idf/esp-idf/esp32s2/ld/esp32s2.project.ld FLASH_FLAGS = --flash_mode $(CIRCUITPY_ESP_FLASH_MODE) --flash_freq $(CIRCUITPY_ESP_FLASH_FREQ) --flash_size $(CIRCUITPY_ESP_FLASH_SIZE) diff --git a/ports/esp32s2/bindings/espidf/__init__.c b/ports/esp32s2/bindings/espidf/__init__.c index 3b910cfe6f..554bfaa39e 100644 --- a/ports/esp32s2/bindings/espidf/__init__.c +++ b/ports/esp32s2/bindings/espidf/__init__.c @@ -29,7 +29,7 @@ #include "bindings/espidf/__init__.h" -#include "esp-idf/components/heap/include/esp_heap_caps.h" +#include "components/heap/include/esp_heap_caps.h" //| """Direct access to a few ESP-IDF details. This module *should not* include any functionality //| that could be implemented by other frameworks. It should only include ESP-IDF specific diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/esp32s2/common-hal/busio/I2C.c index 57270372f1..6f19531288 100644 --- a/ports/esp32s2/common-hal/busio/I2C.c +++ b/ports/esp32s2/common-hal/busio/I2C.c @@ -28,7 +28,7 @@ #include "py/mperrno.h" #include "py/runtime.h" -#include "driver/i2c.h" +#include "components/driver/include/driver/i2c.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" diff --git a/ports/esp32s2/common-hal/busio/I2C.h b/ports/esp32s2/common-hal/busio/I2C.h index 24a3fd4951..c39d6d7448 100644 --- a/ports/esp32s2/common-hal/busio/I2C.h +++ b/ports/esp32s2/common-hal/busio/I2C.h @@ -29,7 +29,7 @@ #include "common-hal/microcontroller/Pin.h" -#include "esp-idf/components/soc/include/hal/i2c_types.h" +#include "components/hal/include/hal/i2c_types.h" #include "FreeRTOS.h" #include "freertos/semphr.h" #include "py/obj.h" diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index eaafa87b74..1906ca6f00 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -266,7 +266,7 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, self->bits = bits; self->target_frequency = baudrate; self->hal_context.timing_conf = &self->timing_conf; - esp_err_t result = spi_hal_get_clock_conf(&self->hal_context, + esp_err_t result = spi_hal_cal_clock_conf(&self->hal_context, self->target_frequency, 128 /* duty_cycle */, self->connected_through_gpio, diff --git a/ports/esp32s2/common-hal/busio/SPI.h b/ports/esp32s2/common-hal/busio/SPI.h index 38fbe42ffc..f6c1c344a1 100644 --- a/ports/esp32s2/common-hal/busio/SPI.h +++ b/ports/esp32s2/common-hal/busio/SPI.h @@ -29,9 +29,9 @@ #include "common-hal/microcontroller/Pin.h" -#include "esp-idf/components/driver/include/driver/spi_common_internal.h" -#include "esp-idf/components/soc/include/hal/spi_hal.h" -#include "esp-idf/components/soc/include/hal/spi_types.h" +#include "components/driver/include/driver/spi_common_internal.h" +#include "components/hal/include/hal/spi_hal.h" +#include "components/hal/include/hal/spi_types.h" #include "py/obj.h" typedef struct { diff --git a/ports/esp32s2/common-hal/busio/UART.c b/ports/esp32s2/common-hal/busio/UART.c index b0162adba9..98cebba67f 100644 --- a/ports/esp32s2/common-hal/busio/UART.c +++ b/ports/esp32s2/common-hal/busio/UART.c @@ -27,7 +27,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/busio/UART.h" -#include "driver/uart.h" +#include "components/driver/include/driver/uart.h" #include "mpconfigport.h" #include "lib/utils/interrupt_char.h" diff --git a/ports/esp32s2/common-hal/busio/UART.h b/ports/esp32s2/common-hal/busio/UART.h index b3cc929665..1d7f135115 100644 --- a/ports/esp32s2/common-hal/busio/UART.h +++ b/ports/esp32s2/common-hal/busio/UART.h @@ -29,7 +29,7 @@ #include "common-hal/microcontroller/Pin.h" -#include "esp-idf/components/soc/include/hal/uart_types.h" +#include "components/hal/include/hal/uart_types.h" #include "py/obj.h" typedef struct { diff --git a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c index fb3ee10ad7..2c7902616f 100644 --- a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c +++ b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c @@ -28,9 +28,9 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -#include "driver/gpio.h" +#include "components/driver/include/driver/gpio.h" -#include "esp-idf/components/soc/include/hal/gpio_hal.h" +#include "components/hal/include/hal/gpio_hal.h" void common_hal_digitalio_digitalinout_never_reset( digitalio_digitalinout_obj_t *self) { diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index 546dca848c..3c2611efeb 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -31,8 +31,8 @@ #include "py/mphal.h" -#include "esp-idf/components/driver/include/driver/gpio.h" -#include "esp-idf/components/soc/include/hal/gpio_hal.h" +#include "components/driver/include/driver/gpio.h" +#include "components/hal/include/hal/gpio_hal.h" #ifdef MICROPY_HW_NEOPIXEL bool neopixel_in_use; diff --git a/ports/esp32s2/common-hal/microcontroller/Processor.c b/ports/esp32s2/common-hal/microcontroller/Processor.c index c64fa010e6..b815216012 100644 --- a/ports/esp32s2/common-hal/microcontroller/Processor.c +++ b/ports/esp32s2/common-hal/microcontroller/Processor.c @@ -34,7 +34,7 @@ #include "soc/efuse_reg.h" -#include "esp-idf/components/driver/esp32s2/include/driver/temp_sensor.h" +#include "components/driver/esp32s2/include/driver/temp_sensor.h" float common_hal_mcu_processor_get_temperature(void) { float tsens_out; diff --git a/ports/esp32s2/common-hal/neopixel_write/__init__.c b/ports/esp32s2/common-hal/neopixel_write/__init__.c index 193d754f43..553cb79f83 100644 --- a/ports/esp32s2/common-hal/neopixel_write/__init__.c +++ b/ports/esp32s2/common-hal/neopixel_write/__init__.c @@ -43,8 +43,8 @@ #include "py/mphal.h" #include "py/runtime.h" #include "shared-bindings/neopixel_write/__init__.h" -#include "driver/rmt.h" -#include "rmt.h" +#include "components/driver/include/driver/rmt.h" +#include "peripherals/rmt.h" #define WS2812_T0H_NS (350) #define WS2812_T0L_NS (1000) diff --git a/ports/esp32s2/common-hal/pulseio/PulseIn.h b/ports/esp32s2/common-hal/pulseio/PulseIn.h index 97d70d4b03..289605ed05 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseIn.h +++ b/ports/esp32s2/common-hal/pulseio/PulseIn.h @@ -30,8 +30,8 @@ #include "common-hal/microcontroller/Pin.h" #include "py/obj.h" -#include "driver/rmt.h" -#include "rmt.h" +#include "components/driver/include/driver/rmt.h" +#include "peripherals/rmt.h" typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/common-hal/pulseio/PulseOut.h b/ports/esp32s2/common-hal/pulseio/PulseOut.h index 629591af61..c3952452f6 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseOut.h +++ b/ports/esp32s2/common-hal/pulseio/PulseOut.h @@ -28,8 +28,8 @@ #define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEOUT_H #include "common-hal/microcontroller/Pin.h" -#include "driver/rmt.h" -#include "rmt.h" +#include "components/driver/include/driver/rmt.h" +#include "peripherals/rmt.h" #include "py/obj.h" diff --git a/ports/esp32s2/common-hal/pwmio/PWMOut.c b/ports/esp32s2/common-hal/pwmio/PWMOut.c index d745b7789e..e1fdd4760a 100644 --- a/ports/esp32s2/common-hal/pwmio/PWMOut.c +++ b/ports/esp32s2/common-hal/pwmio/PWMOut.c @@ -28,7 +28,7 @@ #include "common-hal/pwmio/PWMOut.h" #include "shared-bindings/pwmio/PWMOut.h" #include "py/runtime.h" -#include "driver/ledc.h" +#include "components/driver/include/driver/ledc.h" #define INDEX_EMPTY 0xFF diff --git a/ports/esp32s2/common-hal/pwmio/PWMOut.h b/ports/esp32s2/common-hal/pwmio/PWMOut.h index c489e5a278..9055dee8e3 100644 --- a/ports/esp32s2/common-hal/pwmio/PWMOut.h +++ b/ports/esp32s2/common-hal/pwmio/PWMOut.h @@ -28,7 +28,7 @@ #define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PWMIO_PWMOUT_H #include "common-hal/microcontroller/Pin.h" -#include "driver/ledc.h" +#include "components/driver/include/driver/ledc.h" typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/common-hal/rtc/RTC.c b/ports/esp32s2/common-hal/rtc/RTC.c index 1218186a8c..4d8713639f 100644 --- a/ports/esp32s2/common-hal/rtc/RTC.c +++ b/ports/esp32s2/common-hal/rtc/RTC.c @@ -28,7 +28,7 @@ #include "py/obj.h" #include "py/runtime.h" -#include "soc/rtc_periph.h" +#include "components/soc/soc/include/soc/rtc_periph.h" #include "shared-bindings/rtc/RTC.h" void common_hal_rtc_get_time(timeutils_struct_time_t *tm) { diff --git a/ports/esp32s2/common-hal/socketpool/Socket.h b/ports/esp32s2/common-hal/socketpool/Socket.h index c23dd171cf..de63c8ab2c 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.h +++ b/ports/esp32s2/common-hal/socketpool/Socket.h @@ -32,7 +32,8 @@ #include "common-hal/socketpool/SocketPool.h" #include "common-hal/ssl/SSLContext.h" -#include "esp-idf/components/esp-tls/esp_tls.h" +#include "components/esp-tls/esp_tls.h" +#include "components/log/include/esp_log.h" typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/common-hal/socketpool/SocketPool.c b/ports/esp32s2/common-hal/socketpool/SocketPool.c index 4a07f21c48..1d4d04b034 100644 --- a/ports/esp32s2/common-hal/socketpool/SocketPool.c +++ b/ports/esp32s2/common-hal/socketpool/SocketPool.c @@ -29,7 +29,7 @@ #include "py/runtime.h" #include "shared-bindings/wifi/__init__.h" -#include "esp-idf/components/lwip/lwip/src/include/lwip/netdb.h" +#include "components/lwip/lwip/src/include/lwip/netdb.h" #include "bindings/espidf/__init__.h" diff --git a/ports/esp32s2/common-hal/ssl/SSLContext.h b/ports/esp32s2/common-hal/ssl/SSLContext.h index 41d199f080..e359ac0de4 100644 --- a/ports/esp32s2/common-hal/ssl/SSLContext.h +++ b/ports/esp32s2/common-hal/ssl/SSLContext.h @@ -29,7 +29,7 @@ #include "py/obj.h" -#include "esp-idf/components/esp-tls/esp_tls.h" +#include "components/esp-tls/esp_tls.h" typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/common-hal/ssl/__init__.c b/ports/esp32s2/common-hal/ssl/__init__.c index a105e53624..8d386d0c3a 100644 --- a/ports/esp32s2/common-hal/ssl/__init__.c +++ b/ports/esp32s2/common-hal/ssl/__init__.c @@ -26,7 +26,7 @@ #include "shared-bindings/ssl/SSLContext.h" -#include "esp-idf/components/mbedtls/esp_crt_bundle/include/esp_crt_bundle.h" +#include "components/mbedtls/esp_crt_bundle/include/esp_crt_bundle.h" void common_hal_ssl_create_default_context(ssl_sslcontext_obj_t* self) { memset(&self->ssl_config, 0, sizeof(esp_tls_cfg_t)); diff --git a/ports/esp32s2/common-hal/wifi/Network.h b/ports/esp32s2/common-hal/wifi/Network.h index ab75fcafe5..9345bb4576 100644 --- a/ports/esp32s2/common-hal/wifi/Network.h +++ b/ports/esp32s2/common-hal/wifi/Network.h @@ -29,7 +29,7 @@ #include "py/obj.h" -#include "esp-idf/components/esp_wifi/include/esp_wifi_types.h" +#include "components/esp_wifi/include/esp_wifi_types.h" typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index a0b8b6adc5..ac3e2ee4c9 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -35,8 +35,8 @@ #include "shared-bindings/wifi/ScannedNetworks.h" #include "shared-module/ipaddress/__init__.h" -#include "esp-idf/components/esp_wifi/include/esp_wifi.h" -#include "esp-idf/components/lwip/include/apps/ping/ping_sock.h" +#include "components/esp_wifi/include/esp_wifi.h" +#include "components/lwip/include/apps/ping/ping_sock.h" static void start_station(wifi_radio_obj_t *self) { if (self->sta_mode) { diff --git a/ports/esp32s2/common-hal/wifi/Radio.h b/ports/esp32s2/common-hal/wifi/Radio.h index 205aef1761..8679cbef1e 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.h +++ b/ports/esp32s2/common-hal/wifi/Radio.h @@ -29,7 +29,7 @@ #include "py/obj.h" -#include "esp-idf/components/esp_event/include/esp_event.h" +#include "components/esp_event/include/esp_event.h" #include "shared-bindings/wifi/ScannedNetworks.h" diff --git a/ports/esp32s2/common-hal/wifi/ScannedNetworks.c b/ports/esp32s2/common-hal/wifi/ScannedNetworks.c index 507c6d1861..cc733308db 100644 --- a/ports/esp32s2/common-hal/wifi/ScannedNetworks.c +++ b/ports/esp32s2/common-hal/wifi/ScannedNetworks.c @@ -37,7 +37,7 @@ #include "shared-bindings/wifi/Radio.h" #include "shared-bindings/wifi/ScannedNetworks.h" -#include "esp-idf/components/esp_wifi/include/esp_wifi.h" +#include "components/esp_wifi/include/esp_wifi.h" static void wifi_scannednetworks_done(wifi_scannednetworks_obj_t *self) { self->done = true; diff --git a/ports/esp32s2/common-hal/wifi/ScannedNetworks.h b/ports/esp32s2/common-hal/wifi/ScannedNetworks.h index cd57e95f29..db0c2a1484 100644 --- a/ports/esp32s2/common-hal/wifi/ScannedNetworks.h +++ b/ports/esp32s2/common-hal/wifi/ScannedNetworks.h @@ -35,7 +35,8 @@ #include "FreeRTOS.h" #include "freertos/event_groups.h" -#include "esp-idf/components/esp_wifi/include/esp_wifi_types.h" +#include "components/esp_wifi/include/esp_wifi_types.h" +#include "components/log/include/esp_log.h" typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index b9ea9da06f..5c8d2e9526 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -31,13 +31,14 @@ #include "py/runtime.h" -#include "esp-idf/components/esp_wifi/include/esp_wifi.h" +#include "components/esp_wifi/include/esp_wifi.h" -#include "esp-idf/components/heap/include/esp_heap_caps.h" +#include "components/heap/include/esp_heap_caps.h" wifi_radio_obj_t common_hal_wifi_radio_obj; -#include "esp_log.h" +#include "components/log/include/esp_log.h" + static const char* TAG = "wifi"; static void event_handler(void* arg, esp_event_base_t event_base, diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index de733cdab5..8bc19ba893 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit de733cdab556c5713c94ba95078f4024dd56fd87 +Subproject commit 8bc19ba893e5544d571a753d82b44a84799b94b1 diff --git a/ports/esp32s2/mphalport.c b/ports/esp32s2/mphalport.c index e1662a6ce2..9b4c4bc5eb 100644 --- a/ports/esp32s2/mphalport.c +++ b/ports/esp32s2/mphalport.c @@ -31,8 +31,8 @@ #include "py/mpstate.h" #include "py/gc.h" -#include "esp-idf/components/xtensa/include/esp_debug_helpers.h" -#include "esp-idf/components/esp_rom/include/esp32s2/rom/ets_sys.h" +#include "components/xtensa/include/esp_debug_helpers.h" +#include "components/esp_rom/include/esp32s2/rom/ets_sys.h" void mp_hal_delay_us(mp_uint_t delay) { ets_delay_us(delay); diff --git a/ports/esp32s2/peripherals/pins.h b/ports/esp32s2/peripherals/pins.h index 07d0b908ee..9776fbb78f 100644 --- a/ports/esp32s2/peripherals/pins.h +++ b/ports/esp32s2/peripherals/pins.h @@ -34,7 +34,7 @@ #include "esp32s2_peripherals_config.h" #include "esp-idf/config/sdkconfig.h" -#include "esp-idf/components/soc/include/hal/gpio_types.h" +#include "components/hal/include/hal/gpio_types.h" typedef struct { PIN_PREFIX_FIELDS diff --git a/ports/esp32s2/peripherals/rmt.c b/ports/esp32s2/peripherals/rmt.c index b7629dbd5c..2be5f06d81 100644 --- a/ports/esp32s2/peripherals/rmt.c +++ b/ports/esp32s2/peripherals/rmt.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "rmt.h" +#include "peripherals/rmt.h" #include "py/runtime.h" bool rmt_reserved_channels[RMT_CHANNEL_MAX]; diff --git a/ports/esp32s2/peripherals/rmt.h b/ports/esp32s2/peripherals/rmt.h index 01ed09907a..020f8dc3ee 100644 --- a/ports/esp32s2/peripherals/rmt.h +++ b/ports/esp32s2/peripherals/rmt.h @@ -28,7 +28,7 @@ #define MICROPY_INCLUDED_ESP32S2_PERIPHERALS_RMT_H #include "py/mphal.h" -#include "driver/rmt.h" +#include "components/driver/include/driver/rmt.h" #include void esp32s2_peripherals_rmt_reset(void); diff --git a/ports/esp32s2/supervisor/internal_flash.c b/ports/esp32s2/supervisor/internal_flash.c index 4b216a095a..de69a49f94 100644 --- a/ports/esp32s2/supervisor/internal_flash.c +++ b/ports/esp32s2/supervisor/internal_flash.c @@ -37,7 +37,7 @@ #include "py/runtime.h" #include "lib/oofatfs/ff.h" -#include "esp-idf/components/spi_flash/include/esp_partition.h" +#include "components/spi_flash/include/esp_partition.h" #include "supervisor/usb.h" diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 3de63278dc..d2630617b9 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -46,8 +46,8 @@ #include "shared-bindings/rtc/__init__.h" #include "peripherals/rmt.h" -#include "esp-idf/components/heap/include/esp_heap_caps.h" -#include "esp-idf/components/soc/soc/esp32s2/include/soc/cache_memory.h" +#include "components/heap/include/esp_heap_caps.h" +#include "components/soc/soc/esp32s2/include/soc/cache_memory.h" #define HEAP_SIZE (48 * 1024) diff --git a/ports/esp32s2/supervisor/usb.c b/ports/esp32s2/supervisor/usb.c index 39eb8204ff..c91c2ec4b0 100644 --- a/ports/esp32s2/supervisor/usb.c +++ b/ports/esp32s2/supervisor/usb.c @@ -29,10 +29,10 @@ #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" -#include "esp-idf/components/soc/soc/esp32s2/include/soc/usb_periph.h" -#include "esp-idf/components/driver/include/driver/periph_ctrl.h" -#include "esp-idf/components/driver/include/driver/gpio.h" -#include "esp-idf/components/esp_rom/include/esp32s2/rom/gpio.h" +#include "components/soc/soc/esp32s2/include/soc/usb_periph.h" +#include "components/driver/include/driver/periph_ctrl.h" +#include "components/driver/include/driver/gpio.h" +#include "components/esp_rom/include/esp32s2/rom/gpio.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index e1b1e69672..de05b8eb4b 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -36,7 +36,6 @@ #include "py/runtime.h" #include "py/mperrno.h" -#include "esp_log.h" static const char* TAG = "socket binding"; //| class Socket: diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index 0eeebd6911..9f56e8c7e8 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -37,7 +37,6 @@ #include "shared-bindings/socketpool/Socket.h" #include "shared-bindings/socketpool/SocketPool.h" -#include "esp_log.h" static const char* TAG = "socketpool binding"; //| class SocketPool: diff --git a/shared-bindings/wifi/ScannedNetworks.c b/shared-bindings/wifi/ScannedNetworks.c index c927d7282f..d04f0f92a3 100644 --- a/shared-bindings/wifi/ScannedNetworks.c +++ b/shared-bindings/wifi/ScannedNetworks.c @@ -32,7 +32,6 @@ #include "py/runtime.h" #include "shared-bindings/wifi/ScannedNetworks.h" -#include "esp_log.h" static const char *TAG = "cp iternext"; //| class ScannedNetworks: From 9f19a8a7600ad59851953a7c0454d09245eadf4d Mon Sep 17 00:00:00 2001 From: Mark Roberts Date: Tue, 29 Sep 2020 15:37:06 -0400 Subject: [PATCH 1031/1293] Ran pre-commit locally --- shared-bindings/displayio/Display.c | 16 ++++++++-------- shared-bindings/displayio/Display.h | 2 +- shared-module/displayio/Display.c | 8 ++++---- shared-module/displayio/EPaperDisplay.c | 4 ++-- shared-module/displayio/display_core.c | 8 ++++---- shared-module/displayio/display_core.h | 6 +++--- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index a81736e469..e78a893b01 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -111,15 +111,15 @@ //| :param bool backlight_on_high: If True, pulling the backlight pin high turns the backlight on.""" //| ... //| -STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_args, +STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_display_bus, ARG_init_sequence, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, - ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, - ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_reverse_bytes_in_word, - ARG_set_column_command, ARG_set_row_command, ARG_write_ram_command, - ARG_set_vertical_scroll, ARG_backlight_pin, ARG_brightness_command, - ARG_brightness, ARG_auto_brightness, ARG_single_byte_bounds, ARG_data_as_commands, - ARG_auto_refresh, ARG_native_frames_per_second, ARG_backlight_on_high, + enum { ARG_display_bus, ARG_init_sequence, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, + ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, + ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_reverse_bytes_in_word, + ARG_set_column_command, ARG_set_row_command, ARG_write_ram_command, + ARG_set_vertical_scroll, ARG_backlight_pin, ARG_brightness_command, + ARG_brightness, ARG_auto_brightness, ARG_single_byte_bounds, ARG_data_as_commands, + ARG_auto_refresh, ARG_native_frames_per_second, ARG_backlight_on_high, ARG_SH1107_addressing }; static const mp_arg_t allowed_args[] = { { MP_QSTR_display_bus, MP_ARG_REQUIRED | MP_ARG_OBJ }, diff --git a/shared-bindings/displayio/Display.h b/shared-bindings/displayio/Display.h index c1704eaada..f9fbc157c0 100644 --- a/shared-bindings/displayio/Display.h +++ b/shared-bindings/displayio/Display.h @@ -45,7 +45,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, uint8_t set_column_command, uint8_t set_row_command, uint8_t write_ram_command, uint8_t set_vertical_scroll, uint8_t* init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t* backlight_pin, uint16_t brightness_command, mp_float_t brightness, bool auto_brightness, - bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, + bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, bool backlight_on_high, bool SH1107_addressing); bool common_hal_displayio_display_show(displayio_display_obj_t* self, diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 9864e9f9d4..f2b8e04474 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -48,7 +48,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, uint8_t set_row_command, uint8_t write_ram_command, uint8_t set_vertical_scroll, uint8_t* init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t* backlight_pin, uint16_t brightness_command, mp_float_t brightness, bool auto_brightness, - bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, + bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, bool backlight_on_high, bool SH1107_addressing) { // Turn off auto-refresh as we init. @@ -246,7 +246,7 @@ STATIC bool _refresh_area(displayio_display_obj_t* self, const displayio_area_t* uint16_t rows_per_buffer = displayio_area_height(&clipped); uint8_t pixels_per_word = (sizeof(uint32_t) * 8) / self->core.colorspace.depth; uint16_t pixels_per_buffer = displayio_area_size(&clipped); - + uint16_t subrectangles = 1; // for SH1107 and other boundary constrained controllers // write one single row at a time @@ -299,8 +299,8 @@ STATIC bool _refresh_area(displayio_display_obj_t* self, const displayio_area_t* } remaining_rows -= rows_per_buffer; - displayio_display_core_set_region_to_update(&self->core, self->set_column_command, - self->set_row_command, NO_COMMAND, NO_COMMAND, self->data_as_commands, false, + displayio_display_core_set_region_to_update(&self->core, self->set_column_command, + self->set_row_command, NO_COMMAND, NO_COMMAND, self->data_as_commands, false, &subrectangle, self->SH1107_addressing); uint16_t subrectangle_size_bytes; diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 3391a56b4d..5b055e62e4 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -240,8 +240,8 @@ bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, c // added false parameter at end for SH1107_addressing quirk if (self->set_row_window_command != NO_COMMAND) { - displayio_display_core_set_region_to_update(&self->core, self->set_column_window_command, - self->set_row_window_command, self->set_current_column_command, self->set_current_row_command, + displayio_display_core_set_region_to_update(&self->core, self->set_column_window_command, + self->set_row_window_command, self->set_current_column_command, self->set_current_row_command, false, self->chip_select, &clipped, false); } diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index eb8c8f3b4a..c592202fba 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -57,7 +57,7 @@ void displayio_display_core_construct(displayio_display_core_t* self, self->colstart = colstart; self->rowstart = rowstart; self->last_refresh = 0; - + // (framebufferdisplay already validated its 'bus' is a buffer-protocol object) if (bus) { if (MP_OBJ_IS_TYPE(bus, &displayio_parallelbus_type)) { @@ -208,9 +208,9 @@ void displayio_display_core_end_transaction(displayio_display_core_t* self) { self->end_transaction(self->bus); } -void displayio_display_core_set_region_to_update(displayio_display_core_t* self, uint8_t column_command, - uint8_t row_command, uint16_t set_current_column_command, uint16_t set_current_row_command, - bool data_as_commands, bool always_toggle_chip_select, +void displayio_display_core_set_region_to_update(displayio_display_core_t* self, uint8_t column_command, + uint8_t row_command, uint16_t set_current_column_command, uint16_t set_current_row_command, + bool data_as_commands, bool always_toggle_chip_select, displayio_area_t* area, bool SH1107_addressing) { uint16_t x1 = area->x1; uint16_t x2 = area->x2; diff --git a/shared-module/displayio/display_core.h b/shared-module/displayio/display_core.h index ad9998a2f8..3b45f79464 100644 --- a/shared-module/displayio/display_core.h +++ b/shared-module/displayio/display_core.h @@ -74,9 +74,9 @@ bool displayio_display_core_bus_free(displayio_display_core_t *self); bool displayio_display_core_begin_transaction(displayio_display_core_t* self); void displayio_display_core_end_transaction(displayio_display_core_t* self); -void displayio_display_core_set_region_to_update(displayio_display_core_t* self, uint8_t column_command, - uint8_t row_command, uint16_t set_current_column_command, uint16_t set_current_row_command, - bool data_as_commands, bool always_toggle_chip_select, +void displayio_display_core_set_region_to_update(displayio_display_core_t* self, uint8_t column_command, + uint8_t row_command, uint16_t set_current_column_command, uint16_t set_current_row_command, + bool data_as_commands, bool always_toggle_chip_select, displayio_area_t* area, bool SH1107_addressing); void release_display_core(displayio_display_core_t* self); From ef245ef54ebab7c483a935dbfb100e2ab100f0ea Mon Sep 17 00:00:00 2001 From: Mark Roberts Date: Tue, 29 Sep 2020 19:48:14 -0400 Subject: [PATCH 1032/1293] Removed redundant subrectangle sizing code --- shared-module/displayio/Display.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index f2b8e04474..37d72a82f2 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -290,11 +290,7 @@ STATIC bool _refresh_area(displayio_display_obj_t* self, const displayio_area_t* .x2 = clipped.x2, .y2 = clipped.y1 + rows_per_buffer * (j + 1) }; - if (self->SH1107_addressing) { - // one row only for SH1107 in vertical (column) mode - subrectangle.y1 = clipped.y1 + j; - subrectangle.y2 = clipped.y1 + (j + 1); - } else if (remaining_rows < rows_per_buffer) { + if (remaining_rows < rows_per_buffer) { subrectangle.y2 = subrectangle.y1 + remaining_rows; } remaining_rows -= rows_per_buffer; From 29af7068d4ef545d5e93ff55a085b084f622c860 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 30 Sep 2020 11:33:54 -0700 Subject: [PATCH 1033/1293] Ignore duplicate USB PID for prerelease version --- tools/ci_check_duplicate_usb_vid_pid.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/ci_check_duplicate_usb_vid_pid.py b/tools/ci_check_duplicate_usb_vid_pid.py index dd6bf56709..cb4efc5f11 100644 --- a/tools/ci_check_duplicate_usb_vid_pid.py +++ b/tools/ci_check_duplicate_usb_vid_pid.py @@ -44,7 +44,9 @@ DEFAULT_IGNORELIST = [ "feather_m0_express", "feather_m0_supersized", "cp32-m4", - "metro_m4_express" + "metro_m4_express", + "unexpectedmaker_feathers2", + "unexpectedmaker_feathers2_prerelease" ] cli_parser = argparse.ArgumentParser(description="USB VID/PID Duplicate Checker") From a09a158ddc89da5c870437a0706c862944e08321 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 30 Sep 2020 11:36:51 -0700 Subject: [PATCH 1034/1293] Fix trailing line --- .../boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h index 726c46e401..ee97d62c63 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h @@ -35,4 +35,4 @@ #define AUTORESET_DELAY_MS 500 #define MICROPY_HW_APA102_MOSI (&pin_GPIO40) -#define MICROPY_HW_APA102_SCK (&pin_GPIO45) \ No newline at end of file +#define MICROPY_HW_APA102_SCK (&pin_GPIO45) From d1bda47d94c2ab9e42a74de4a5209df73e46a4ea Mon Sep 17 00:00:00 2001 From: FoamyGuy Date: Wed, 30 Sep 2020 14:03:03 -0500 Subject: [PATCH 1035/1293] removing top level displayio background check --- shared-module/displayio/__init__.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index 101dac4b3e..5161923d60 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -40,8 +40,6 @@ STATIC bool any_display_uses_this_framebuffer(mp_obj_base_t *obj) { } #endif -// Check for recursive calls to displayio_background. -bool displayio_background_in_progress = false; void displayio_background(void) { if (mp_hal_is_interrupted()) { @@ -52,11 +50,6 @@ void displayio_background(void) { return; } - if (displayio_background_in_progress) { - // Don't allow recursive calls to this routine. - return; - } - displayio_background_in_progress = true; for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { @@ -75,8 +68,6 @@ void displayio_background(void) { } } - // All done. - displayio_background_in_progress = false; } void common_hal_displayio_release_displays(void) { From 9d0d3e3615d4c523536f599f214535aba02ffeda Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 29 Sep 2020 23:47:21 +0000 Subject: [PATCH 1036/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (826 of 826 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index a565db0985..5a89e3b183 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: 2020-09-29 11:11+0530\n" -"PO-Revision-Date: 2020-09-22 21:30+0000\n" +"PO-Revision-Date: 2020-09-30 18:43+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -346,7 +346,7 @@ msgstr "Já está em execução" #: ports/esp32s2/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" -msgstr "" +msgstr "Já está em busca das redes de wifi" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -695,7 +695,7 @@ msgstr "Não foi possível reiniciar o PWM" #: ports/esp32s2/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" -msgstr "" +msgstr "Não foi possível recuperar o clock" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" @@ -789,7 +789,7 @@ msgstr "O BCE opera apenas com 16 bytes por vez" #: ports/esp32s2/common-hal/busio/SPI.c msgid "ESP-IDF memory allocation failed" -msgstr "" +msgstr "Houve uma falha na alocação da memória ESP-IDF" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -850,7 +850,7 @@ msgstr "O FFT é definido apenas para ndarrays" #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" -msgstr "" +msgstr "Houve uma falha no handshake do SSL" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." @@ -877,11 +877,11 @@ msgstr "Falha ao alocar buffer RX de %d bytes" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" -msgstr "" +msgstr "Houve uma falha na alocação da memória do Wifi" #: ports/esp32s2/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" -msgstr "" +msgstr "Houve uma falha na alocação da memória para a varredura do Wifi" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" @@ -893,7 +893,7 @@ msgstr "Falha ao conectar: tempo limite" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to init wifi" -msgstr "" +msgstr "Houve uma falha ao iniciar o wifi" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" @@ -1087,7 +1087,7 @@ msgstr "Tamanho do pedaço de formato inválido" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "Invalid frequency" -msgstr "" +msgstr "Frequência inválida" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" @@ -1322,11 +1322,11 @@ msgstr "Não há compatibilidade com inteiro longo" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more channels available" -msgstr "" +msgstr "Não há mais canais disponíveis" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more timers available" -msgstr "" +msgstr "Não há mais temporizadores disponíveis" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." @@ -1394,11 +1394,11 @@ msgstr "Apenas mono com 8 ou 16 bits com " #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "" +msgstr "São suportados apenas soquetes IPv4 SOCK_STREAM" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" -msgstr "" +msgstr "Somente os endereços IPv4 são suportados" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1423,7 +1423,7 @@ msgstr "Apenas o int bruto é compatível para o ip" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Out of sockets" -msgstr "" +msgstr "Sem soquetes" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." @@ -1497,6 +1497,8 @@ msgid "" "Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " "instead" msgstr "" +"A porta não aceita portadora PWM. Em vez disso informe um pino, frequência e " +"o ciclo de trabalho" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c @@ -1662,7 +1664,7 @@ msgstr "Fatiamento não compatível" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" -msgstr "" +msgstr "O SocketPool só pode ser usado com rádio wifi.radio" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" @@ -1842,7 +1844,7 @@ msgstr "Não é possível alocar buffers para conversão assinada" #: ports/esp32s2/common-hal/busio/I2C.c msgid "Unable to create lock" -msgstr "" +msgstr "Não é possível criar um lock" #: shared-module/displayio/I2CDisplay.c #, c-format @@ -1873,7 +1875,7 @@ msgstr "Tipo uuid nrfx inesperado" #: ports/esp32s2/common-hal/socketpool/Socket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" -msgstr "" +msgstr "Erro não tratado do ESP TLS %d %d %x %d" #: shared-bindings/wifi/Radio.c msgid "Unknown failure" @@ -3228,7 +3230,7 @@ msgstr "o pow() com 3 argumentos requer números inteiros" #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h msgid "pressing boot button at start up.\n" -msgstr "" +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 @@ -3236,7 +3238,7 @@ msgstr "" #: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "pressing both buttons at start up.\n" -msgstr "" +msgstr "pressionando ambos os botões durante a inicialização.\n" #: extmod/modutimeq.c msgid "queue overflow" From cebaf99c64e499e580223444a8f3579fbe5596d3 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Wed, 30 Sep 2020 18:33:22 +0000 Subject: [PATCH 1037/1293] Translated using Weblate (Swedish) Currently translated at 100.0% (826 of 826 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 86 +++++++++++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index cb69ecef1d..534f7b62cd 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: 2020-09-29 11:11+0530\n" -"PO-Revision-Date: 2020-09-07 19:36+0000\n" +"PO-Revision-Date: 2020-09-30 18:43+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -98,7 +98,7 @@ msgstr "%q måste vara en tuple av längd 2" #: shared-bindings/canio/Match.c msgid "%q out of range" -msgstr "" +msgstr "%q utanför intervallet" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" @@ -290,7 +290,7 @@ msgstr "All I2C-kringutrustning används" #: ports/atmel-samd/common-hal/canio/Listener.c msgid "All RX FIFOs in use" -msgstr "" +msgstr "Alla RX FIFO i bruk" #: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" @@ -333,7 +333,7 @@ msgstr "Annonserar redan." #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Already have all-matches listener" -msgstr "" +msgstr "Har redan lyssnare för all-matchningar" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c @@ -342,7 +342,7 @@ msgstr "Kör redan" #: ports/esp32s2/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" -msgstr "" +msgstr "Skannar redan efter wifi-nätverk" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -390,7 +390,7 @@ msgstr "Försökte tilldela heap när MicroPython VM inte körs." #: shared-bindings/wifi/Radio.c msgid "Authentication failure" -msgstr "" +msgstr "Autentiseringsfel" #: main.c msgid "Auto-reload is off.\n" @@ -608,7 +608,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "CircuitPython was unable to allocate the heap.\n" -msgstr "" +msgstr "CircuitPython kunde inte allokera heap.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." @@ -649,7 +649,7 @@ msgstr "Korrupt rå kod" #: ports/cxd56/common-hal/camera/Camera.c msgid "Could not initialize Camera" -msgstr "" +msgstr "Kunde inte initiera Camera" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" @@ -686,7 +686,7 @@ msgstr "Det gick inte att starta om PWM" #: ports/esp32s2/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" -msgstr "" +msgstr "Kunde inte hämta klocka" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" @@ -780,7 +780,7 @@ msgstr "ECB arbetar endast på 16 byte åt gången" #: ports/esp32s2/common-hal/busio/SPI.c msgid "ESP-IDF memory allocation failed" -msgstr "" +msgstr "ESP-IDF-minnetilldelning misslyckades" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -841,7 +841,7 @@ msgstr "FFT är enbart definierade för ndarrays" #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" -msgstr "" +msgstr "Misslyckad SSL-handskakning" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." @@ -868,11 +868,11 @@ msgstr "Det gick inte att allokera RX-bufferten på %d byte" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" -msgstr "" +msgstr "Det gick inte att allokera WiFi-minne" #: ports/esp32s2/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" -msgstr "" +msgstr "Det gick inte att allokera minne för WiFi-scanning" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" @@ -884,7 +884,7 @@ msgstr "Det gick inte att ansluta: timeout" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to init wifi" -msgstr "" +msgstr "Kunde inte initiera WiFi" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" @@ -905,11 +905,11 @@ msgstr "Filen finns redan" #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Filters too complex" -msgstr "" +msgstr "Filter för komplexa" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" -msgstr "" +msgstr "Formatet stöds inte" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format @@ -979,7 +979,7 @@ msgstr "Fel buffertstorlek" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" -msgstr "" +msgstr "Indata tar för lång tid" #: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" @@ -1026,7 +1026,7 @@ msgstr "Ogiltig BMP-fil" #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" -msgstr "" +msgstr "Ogiltig BSSID" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" @@ -1076,7 +1076,7 @@ msgstr "Ogiltig formatsegmentstorlek" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "Invalid frequency" -msgstr "" +msgstr "Ogiltig frekvens" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" @@ -1199,7 +1199,7 @@ msgstr "Maximum x-värde vid spegling är %d" #: shared-bindings/canio/Message.c msgid "Messages limited to 8 bytes" -msgstr "" +msgstr "Meddelanden begränsad till 8 byte" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." @@ -1312,11 +1312,11 @@ msgstr "Inget stöd för långt heltal" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more channels available" -msgstr "" +msgstr "Inga fler kanaler tillgängliga" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more timers available" -msgstr "" +msgstr "Ingen timer tillgänglig" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." @@ -1324,7 +1324,7 @@ msgstr "Inga fler timers tillgängliga på denna pinne." #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" -msgstr "" +msgstr "Inget nätverk med sådant ssid" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" @@ -1348,7 +1348,7 @@ msgstr "Påståendet om Nordic Soft Device-fel." #: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c msgid "Not a valid IP string" -msgstr "" +msgstr "Inte en giltig IP-sträng" #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -1385,11 +1385,11 @@ msgstr "Endast 8 eller 16 bitars mono med " #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "" +msgstr "Endast IPv4 SOCK_STREAM sockets stöds" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" -msgstr "" +msgstr "Endast IPv4-adresser stöds" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1409,11 +1409,11 @@ msgstr "" #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" -msgstr "" +msgstr "Endast raw int stöds för ip" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Out of sockets" -msgstr "" +msgstr "Slut på sockets" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." @@ -1485,6 +1485,8 @@ msgid "" "Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " "instead" msgstr "" +"Port accepterar inte PWM carrier. Ange pinne frekvens och arbetscykel " +"istället" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c @@ -1629,11 +1631,11 @@ msgstr "Serializern används redan" #: shared-bindings/ssl/SSLContext.c msgid "Server side context cannot have hostname" -msgstr "" +msgstr "Serversidans kontext kan inte ha värdnamn" #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" -msgstr "" +msgstr "Storleken stöds inte" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." @@ -1648,7 +1650,7 @@ msgstr "Slice stöds inte" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" -msgstr "" +msgstr "SocketPool kan endast användas med wifi.radio" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" @@ -1751,7 +1753,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "To exit, please reset the board without " -msgstr "" +msgstr "För att avsluta, gör reset på kortet utan " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1824,7 +1826,7 @@ msgstr "Det går inte att allokera buffert för signerad konvertering" #: ports/esp32s2/common-hal/busio/I2C.c msgid "Unable to create lock" -msgstr "" +msgstr "Kan inte skapa lås" #: shared-module/displayio/I2CDisplay.c #, c-format @@ -1855,11 +1857,11 @@ msgstr "Oväntad nrfx uuid-typ" #: ports/esp32s2/common-hal/socketpool/Socket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" -msgstr "" +msgstr "Ej hanterat ESP TLS-fel %d-%d-%x-%d" #: shared-bindings/wifi/Radio.c msgid "Unknown failure" -msgstr "" +msgstr "Okänt fel" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format @@ -1974,7 +1976,7 @@ msgstr "" #: shared-bindings/wifi/Radio.c msgid "WiFi password must be between 8 and 63 characters" -msgstr "" +msgstr "WiFi-lösenord måste vara mellan 8 och 63 tecken" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" @@ -2146,7 +2148,7 @@ msgstr "bytes> 8 bitar stöds inte" #: py/objarray.c msgid "bytes length not a multiple of item size" -msgstr "" +msgstr "bytelängd inte en multipel av storlek" #: py/objstr.c msgid "bytes value out of range" @@ -2465,7 +2467,7 @@ msgstr "exceptions måste ärvas från BaseException" #: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c msgid "expected '%q' but got '%q'" -msgstr "" +msgstr "förväntade '%q' men fick '%q'" #: py/objstr.c msgid "expected ':' after format specifier" @@ -3128,7 +3130,7 @@ msgstr "Konvertering av long int till machine word överskred maxvärde" #: py/modstruct.c #, c-format msgid "pack expected %d items for packing (got %d)" -msgstr "" +msgstr "pack förväntade %d stycken för packning (fick %d)" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" @@ -3195,7 +3197,7 @@ msgstr "pow() med 3 argument kräver heltal" #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h msgid "pressing boot button at start up.\n" -msgstr "" +msgstr "trycka på startknappen vid start.\n" #: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h #: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h @@ -3203,7 +3205,7 @@ msgstr "" #: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "pressing both buttons at start up.\n" -msgstr "" +msgstr "trycka båda knapparna vid uppstart.\n" #: extmod/modutimeq.c msgid "queue overflow" @@ -3334,7 +3336,7 @@ msgstr "källpalett för stor" #: shared-bindings/canio/Message.c msgid "specify size or data, but not both" -msgstr "" +msgstr "ange storlek eller data, men inte båda" #: py/objstr.c msgid "start/end indices" From b26c34d9e2d12f26cbf67807daf5c2fa4a5c4c18 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 30 Sep 2020 20:43:16 +0200 Subject: [PATCH 1038/1293] 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/es.po | 19 +++++++++++++------ 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 | 19 +++++++++++++------ locale/sv.po | 19 +++++++++++++------ locale/zh_Latn_pinyin.po | 16 ++++++++++------ 16 files changed, 169 insertions(+), 96 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index be3fea6022..42f654975c 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 11:11+0530\n" +"POT-Creation-Date: 2020-09-29 20:14-0500\n" "PO-Revision-Date: 2020-07-06 18:10+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -1555,6 +1555,10 @@ msgstr "sistem file (filesystem) bersifat Read-only" msgid "Refresh too soon" msgstr "" +#: shared-bindings/canio/RemoteTransmissionRequest.c +msgid "RemoteTransmissionRequests limited to 8 bytes" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" msgstr "" @@ -2445,10 +2449,14 @@ msgstr "error = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "" -#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +#: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" msgstr "" +#: shared-bindings/canio/CAN.c +msgid "expected '%q' or '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "" @@ -3309,10 +3317,6 @@ msgstr "" msgid "source palette too large" msgstr "" -#: shared-bindings/canio/Message.c -msgid "specify size or data, but not both" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 229abad995..da2339a90c 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 11:11+0530\n" +"POT-Creation-Date: 2020-09-29 20:14-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -1534,6 +1534,10 @@ msgstr "" msgid "Refresh too soon" msgstr "" +#: shared-bindings/canio/RemoteTransmissionRequest.c +msgid "RemoteTransmissionRequests limited to 8 bytes" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" msgstr "" @@ -2416,10 +2420,14 @@ msgstr "" msgid "exceptions must derive from BaseException" msgstr "" -#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +#: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" msgstr "" +#: shared-bindings/canio/CAN.c +msgid "expected '%q' or '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "" @@ -3279,10 +3287,6 @@ msgstr "" msgid "source palette too large" msgstr "" -#: shared-bindings/canio/Message.c -msgid "specify size or data, but not both" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index f7d8377e9d..7fd7c6b0bd 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 11:11+0530\n" +"POT-Creation-Date: 2020-09-29 20:14-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -1564,6 +1564,10 @@ msgstr "Schreibgeschützte Objekt" msgid "Refresh too soon" msgstr "Zu früh neu geladen" +#: shared-bindings/canio/RemoteTransmissionRequest.c +msgid "RemoteTransmissionRequests limited to 8 bytes" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" msgstr "Der angeforderte AES-Modus wird nicht unterstützt" @@ -2486,10 +2490,14 @@ msgstr "Fehler = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "Exceptions müssen von BaseException abgeleitet sein" -#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +#: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" msgstr "" +#: shared-bindings/canio/CAN.c +msgid "expected '%q' or '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "erwarte ':' nach format specifier" @@ -3362,10 +3370,6 @@ msgstr "" msgid "source palette too large" msgstr "" -#: shared-bindings/canio/Message.c -msgid "specify size or data, but not both" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "start/end Indizes" diff --git a/locale/el.po b/locale/el.po index 78487c521f..bebcf8fe30 100644 --- a/locale/el.po +++ b/locale/el.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 11:11+0530\n" +"POT-Creation-Date: 2020-09-29 20:14-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -1529,6 +1529,10 @@ msgstr "" msgid "Refresh too soon" msgstr "" +#: shared-bindings/canio/RemoteTransmissionRequest.c +msgid "RemoteTransmissionRequests limited to 8 bytes" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" msgstr "" @@ -2411,10 +2415,14 @@ msgstr "" msgid "exceptions must derive from BaseException" msgstr "" -#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +#: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" msgstr "" +#: shared-bindings/canio/CAN.c +msgid "expected '%q' or '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "" @@ -3274,10 +3282,6 @@ msgstr "" msgid "source palette too large" msgstr "" -#: shared-bindings/canio/Message.c -msgid "specify size or data, but not both" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "" diff --git a/locale/es.po b/locale/es.po index bb0aaa0025..101f27b5c1 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 11:11+0530\n" +"POT-Creation-Date: 2020-09-29 20:14-0500\n" "PO-Revision-Date: 2020-09-25 18:20+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -1565,6 +1565,10 @@ msgstr "Objeto de solo-lectura" msgid "Refresh too soon" msgstr "Actualizando demasiado pronto" +#: shared-bindings/canio/RemoteTransmissionRequest.c +msgid "RemoteTransmissionRequests limited to 8 bytes" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" msgstr "El modo AES solicitado no es compatible" @@ -2479,10 +2483,14 @@ msgstr "error = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "las excepciones deben derivar de BaseException" -#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +#: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" msgstr "se espera '%q' pero se recibe '%q'" +#: shared-bindings/canio/CAN.c +msgid "expected '%q' or '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "se esperaba ':' después de un especificador de tipo format" @@ -3350,10 +3358,6 @@ msgstr "sosfilt requiere argumentos iterables" msgid "source palette too large" msgstr "paleta fuente muy larga" -#: shared-bindings/canio/Message.c -msgid "specify size or data, but not both" -msgstr "especifique o tamaño o datos, pero no ambos" - #: py/objstr.c msgid "start/end indices" msgstr "índices inicio/final" @@ -3652,6 +3656,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 "specify size or data, but not both" +#~ msgstr "especifique o tamaño o datos, pero no ambos" + #~ msgid "Must provide SCK pin" #~ msgstr "Debes proveer un pin para SCK" diff --git a/locale/fil.po b/locale/fil.po index 48d17e0701..1f6a03286d 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 11:11+0530\n" +"POT-Creation-Date: 2020-09-29 20:14-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -1551,6 +1551,10 @@ msgstr "Basahin-lamang" msgid "Refresh too soon" msgstr "" +#: shared-bindings/canio/RemoteTransmissionRequest.c +msgid "RemoteTransmissionRequests limited to 8 bytes" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" msgstr "" @@ -2455,10 +2459,14 @@ msgstr "" msgid "exceptions must derive from BaseException" msgstr "ang mga exceptions ay dapat makuha mula sa BaseException" -#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +#: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" msgstr "" +#: shared-bindings/canio/CAN.c +msgid "expected '%q' or '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "umaasa ng ':' pagkatapos ng format specifier" @@ -3327,10 +3335,6 @@ msgstr "" msgid "source palette too large" msgstr "" -#: shared-bindings/canio/Message.c -msgid "specify size or data, but not both" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "start/end indeks" diff --git a/locale/fr.po b/locale/fr.po index 6824816b48..179d845d39 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 11:11+0530\n" +"POT-Creation-Date: 2020-09-29 20:14-0500\n" "PO-Revision-Date: 2020-09-16 13:47+0000\n" "Last-Translator: Hugo Dahl \n" "Language: fr\n" @@ -1570,6 +1570,10 @@ msgstr "Objet en lecture seule" msgid "Refresh too soon" msgstr "Rafraîchissez trop tôt" +#: shared-bindings/canio/RemoteTransmissionRequest.c +msgid "RemoteTransmissionRequests limited to 8 bytes" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" msgstr "Le mode AES demandé n'est pas pris en charge" @@ -2492,10 +2496,14 @@ msgstr "erreur = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "les exceptions doivent dériver de 'BaseException'" -#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +#: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" msgstr "" +#: shared-bindings/canio/CAN.c +msgid "expected '%q' or '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "':' attendu après la spécification de format" @@ -3370,10 +3378,6 @@ msgstr "" msgid "source palette too large" msgstr "" -#: shared-bindings/canio/Message.c -msgid "specify size or data, but not both" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "indices de début/fin" diff --git a/locale/hi.po b/locale/hi.po index 66f8e4865e..b1f21dddc4 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 11:11+0530\n" +"POT-Creation-Date: 2020-09-29 20:14-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -1529,6 +1529,10 @@ msgstr "" msgid "Refresh too soon" msgstr "" +#: shared-bindings/canio/RemoteTransmissionRequest.c +msgid "RemoteTransmissionRequests limited to 8 bytes" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" msgstr "" @@ -2411,10 +2415,14 @@ msgstr "" msgid "exceptions must derive from BaseException" msgstr "" -#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +#: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" msgstr "" +#: shared-bindings/canio/CAN.c +msgid "expected '%q' or '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "" @@ -3274,10 +3282,6 @@ msgstr "" msgid "source palette too large" msgstr "" -#: shared-bindings/canio/Message.c -msgid "specify size or data, but not both" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 2377c1a2f1..d430f28d12 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 11:11+0530\n" +"POT-Creation-Date: 2020-09-29 20:14-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -1560,6 +1560,10 @@ msgstr "Sola lettura" msgid "Refresh too soon" msgstr "" +#: shared-bindings/canio/RemoteTransmissionRequest.c +msgid "RemoteTransmissionRequests limited to 8 bytes" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" msgstr "" @@ -2456,10 +2460,14 @@ msgstr "errore = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "le eccezioni devono derivare da BaseException" -#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +#: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" msgstr "" +#: shared-bindings/canio/CAN.c +msgid "expected '%q' or '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "':' atteso dopo lo specificatore di formato" @@ -3334,10 +3342,6 @@ msgstr "" msgid "source palette too large" msgstr "" -#: shared-bindings/canio/Message.c -msgid "specify size or data, but not both" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index d5e2015f4b..51cf1792a8 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 11:11+0530\n" +"POT-Creation-Date: 2020-09-29 20:14-0500\n" "PO-Revision-Date: 2020-09-25 18:20+0000\n" "Last-Translator: Taku Fukada \n" "Language-Team: none\n" @@ -1547,6 +1547,10 @@ msgstr "読み込み専用のオブジェクト" msgid "Refresh too soon" msgstr "リフレッシュが早すぎます" +#: shared-bindings/canio/RemoteTransmissionRequest.c +msgid "RemoteTransmissionRequests limited to 8 bytes" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" msgstr "要求のAESモードは非対応" @@ -2440,10 +2444,14 @@ msgstr "error = 0x1%08lX" msgid "exceptions must derive from BaseException" msgstr "例外はBaseExceptionから派生していなければなりません" -#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +#: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" msgstr "" +#: shared-bindings/canio/CAN.c +msgid "expected '%q' or '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "書式化指定子の後に':'が必要" @@ -3307,10 +3315,6 @@ msgstr "" msgid "source palette too large" msgstr "" -#: shared-bindings/canio/Message.c -msgid "specify size or data, but not both" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 23396a96e9..2bab3f4223 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 11:11+0530\n" +"POT-Creation-Date: 2020-09-29 20:14-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -1532,6 +1532,10 @@ msgstr "" msgid "Refresh too soon" msgstr "" +#: shared-bindings/canio/RemoteTransmissionRequest.c +msgid "RemoteTransmissionRequests limited to 8 bytes" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" msgstr "" @@ -2415,10 +2419,14 @@ msgstr "" msgid "exceptions must derive from BaseException" msgstr "" -#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +#: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" msgstr "" +#: shared-bindings/canio/CAN.c +msgid "expected '%q' or '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "':'이 예상되었습니다" @@ -3278,10 +3286,6 @@ msgstr "" msgid "source palette too large" msgstr "" -#: shared-bindings/canio/Message.c -msgid "specify size or data, but not both" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index cffbee62e6..11089452c7 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 11:11+0530\n" +"POT-Creation-Date: 2020-09-29 20:14-0500\n" "PO-Revision-Date: 2020-09-09 16:05+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -1560,6 +1560,10 @@ msgstr "Alleen-lezen object" msgid "Refresh too soon" msgstr "Verversing te snel" +#: shared-bindings/canio/RemoteTransmissionRequest.c +msgid "RemoteTransmissionRequests limited to 8 bytes" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" msgstr "Gevraagde AES modus is niet ondersteund" @@ -2467,10 +2471,14 @@ msgstr "fout = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "uitzonderingen moeten afleiden van BaseException" -#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +#: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" msgstr "" +#: shared-bindings/canio/CAN.c +msgid "expected '%q' or '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "verwachtte ':' na format specifier" @@ -3337,10 +3345,6 @@ msgstr "sosfilt vereist itereerbare argumenten" msgid "source palette too large" msgstr "" -#: shared-bindings/canio/Message.c -msgid "specify size or data, but not both" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "start/stop indices" diff --git a/locale/pl.po b/locale/pl.po index ea0c2a4017..8ee6a9698b 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 11:11+0530\n" +"POT-Creation-Date: 2020-09-29 20:14-0500\n" "PO-Revision-Date: 2020-09-29 01:39+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -1545,6 +1545,10 @@ msgstr "Obiekt tylko do odczytu" msgid "Refresh too soon" msgstr "Zbyt wczesne odświeżenie" +#: shared-bindings/canio/RemoteTransmissionRequest.c +msgid "RemoteTransmissionRequests limited to 8 bytes" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" msgstr "Żądany tryb AES nie jest obsługiwany" @@ -2434,10 +2438,14 @@ msgstr "błąd = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "wyjątki muszą dziedziczyć po BaseException" -#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +#: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" msgstr "" +#: shared-bindings/canio/CAN.c +msgid "expected '%q' or '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "oczekiwano ':' po specyfikacji formatu" @@ -3299,10 +3307,6 @@ msgstr "" msgid "source palette too large" msgstr "" -#: shared-bindings/canio/Message.c -msgid "specify size or data, but not both" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "początkowe/końcowe indeksy" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 5a89e3b183..1a8c8925ef 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 11:11+0530\n" +"POT-Creation-Date: 2020-09-29 20:14-0500\n" "PO-Revision-Date: 2020-09-30 18:43+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -1574,6 +1574,10 @@ msgstr "Objeto de leitura apenas" msgid "Refresh too soon" msgstr "A recarga foi cedo demais" +#: shared-bindings/canio/RemoteTransmissionRequest.c +msgid "RemoteTransmissionRequests limited to 8 bytes" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" msgstr "O modo AES solicitado não é compatível" @@ -2492,10 +2496,14 @@ msgstr "erro = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "as exceções devem derivar a partir do BaseException" -#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +#: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" msgstr "o retorno esperado era '%q', porém obteve '% q'" +#: shared-bindings/canio/CAN.c +msgid "expected '%q' or '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "é esperado ':' após o especificador do formato" @@ -3367,10 +3375,6 @@ msgstr "o sosfilt requer que os argumentos sejam iteráveis" msgid "source palette too large" msgstr "a paleta de origem é muito grande" -#: shared-bindings/canio/Message.c -msgid "specify size or data, but not both" -msgstr "defina o tamanho ou os dados, porém não ambos" - #: py/objstr.c msgid "start/end indices" msgstr "os índices de início/fim" @@ -3668,6 +3672,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 "specify size or data, but not both" +#~ msgstr "defina o tamanho ou os dados, porém não ambos" + #~ msgid "Must provide SCK pin" #~ msgstr "É obrigatório informar o pino SCK" diff --git a/locale/sv.po b/locale/sv.po index 534f7b62cd..a0f60a2197 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 11:11+0530\n" +"POT-Creation-Date: 2020-09-29 20:14-0500\n" "PO-Revision-Date: 2020-09-30 18:43+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -1560,6 +1560,10 @@ msgstr "Skrivskyddat objekt" msgid "Refresh too soon" msgstr "Uppdaterad för tidigt" +#: shared-bindings/canio/RemoteTransmissionRequest.c +msgid "RemoteTransmissionRequests limited to 8 bytes" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" msgstr "Det begärda AES-läget stöds inte" @@ -2465,10 +2469,14 @@ msgstr "fel = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "exceptions måste ärvas från BaseException" -#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +#: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" msgstr "förväntade '%q' men fick '%q'" +#: shared-bindings/canio/CAN.c +msgid "expected '%q' or '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "förväntade ':' efter formatspecifikation" @@ -3334,10 +3342,6 @@ msgstr "sosfilt kräver iterable argument" msgid "source palette too large" msgstr "källpalett för stor" -#: shared-bindings/canio/Message.c -msgid "specify size or data, but not both" -msgstr "ange storlek eller data, men inte båda" - #: py/objstr.c msgid "start/end indices" msgstr "start-/slutindex" @@ -3635,6 +3639,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 "specify size or data, but not both" +#~ msgstr "ange storlek eller data, men inte båda" + #~ msgid "Must provide SCK pin" #~ msgstr "Måste ange SCK-pinne" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index a9c8c422ea..0b0743b460 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 11:11+0530\n" +"POT-Creation-Date: 2020-09-29 20:14-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -1550,6 +1550,10 @@ msgstr "Zhǐ dú duìxiàng" msgid "Refresh too soon" msgstr "Shuāxīn tài kuàile" +#: shared-bindings/canio/RemoteTransmissionRequest.c +msgid "RemoteTransmissionRequests limited to 8 bytes" +msgstr "" + #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" msgstr "Qǐngqiú de AES móshì bù shòu zhīchí" @@ -2453,10 +2457,14 @@ msgstr "cuòwù = 0x%08lX" msgid "exceptions must derive from BaseException" msgstr "lìwài bìxū láizì BaseException" -#: shared-bindings/canio/CAN.c shared-bindings/canio/Listener.c +#: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" msgstr "" +#: shared-bindings/canio/CAN.c +msgid "expected '%q' or '%q' but got '%q'" +msgstr "" + #: py/objstr.c msgid "expected ':' after format specifier" msgstr "zài géshì shuōmíng fú zhīhòu yùqí ':'" @@ -3320,10 +3328,6 @@ msgstr "sosfilt xūyào diédài cānshù" msgid "source palette too large" msgstr "" -#: shared-bindings/canio/Message.c -msgid "specify size or data, but not both" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "kāishǐ/jiéshù zhǐshù" From a739d314f1a9f5fee6517eb425a2c691969fd7f7 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 29 Sep 2020 13:04:39 -0700 Subject: [PATCH 1039/1293] Add Metro ESP32S2 Also fix two bugs: * Crash when resetting board.SPI when it hasn't been inited. * Reading back the output value is always false. Fixes #3353 --- .../boards/adafruit_metro_esp32s2/board.c | 43 +++++++++++++++++ .../adafruit_metro_esp32s2/mpconfigboard.h | 48 +++++++++++++++++++ .../adafruit_metro_esp32s2/mpconfigboard.mk | 17 +++++++ .../boards/adafruit_metro_esp32s2/pins.c | 44 +++++++++++++++++ .../boards/adafruit_metro_esp32s2/sdkconfig | 33 +++++++++++++ .../common-hal/digitalio/DigitalInOut.c | 18 ++++++- .../common-hal/digitalio/DigitalInOut.h | 1 + shared-module/board/__init__.c | 4 +- 8 files changed, 205 insertions(+), 3 deletions(-) create mode 100644 ports/esp32s2/boards/adafruit_metro_esp32s2/board.c create mode 100644 ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h create mode 100644 ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.mk create mode 100644 ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c create mode 100644 ports/esp32s2/boards/adafruit_metro_esp32s2/sdkconfig diff --git a/ports/esp32s2/boards/adafruit_metro_esp32s2/board.c b/ports/esp32s2/boards/adafruit_metro_esp32s2/board.c new file mode 100644 index 0000000000..7380be6da6 --- /dev/null +++ b/ports/esp32s2/boards/adafruit_metro_esp32s2/board.c @@ -0,0 +1,43 @@ +/* + * 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 "boards/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h b/ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h new file mode 100644 index 0000000000..7280aab9c2 --- /dev/null +++ b/ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h @@ -0,0 +1,48 @@ +/* + * 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 "Metro ESP32S2" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO45) + +#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_GPIO34) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO33) + +#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_GPIO5) +#define DEFAULT_UART_BUS_TX (&pin_GPIO6) diff --git a/ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.mk b/ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.mk new file mode 100644 index 0000000000..e78098d644 --- /dev/null +++ b/ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x239A +USB_PID = 0x80E0 +USB_PRODUCT = "Metro ESP32S2" +USB_MANUFACTURER = "Adafruit" + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=4MB + +CIRCUITPY_MODULE=wrover diff --git a/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c b/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c new file mode 100644 index 0000000000..08d2b2a1a3 --- /dev/null +++ b/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c @@ -0,0 +1,44 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO1) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO2) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO3) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO5) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO5) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO6) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO6) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO7) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO8) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO9) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO21) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO42) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_GPIO33) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL),MP_ROM_PTR(&pin_GPIO34) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO45) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_DEBUG_RX), MP_ROM_PTR(&pin_GPIO38) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_DEBUG_TX), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI),MP_ROM_PTR(&pin_GPIO35) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MISO),MP_ROM_PTR(&pin_GPIO37) }, + + { 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_global_dict_table); diff --git a/ports/esp32s2/boards/adafruit_metro_esp32s2/sdkconfig b/ports/esp32s2/boards/adafruit_metro_esp32s2/sdkconfig new file mode 100644 index 0000000000..9d8bbde967 --- /dev/null +++ b/ports/esp32s2/boards/adafruit_metro_esp32s2/sdkconfig @@ -0,0 +1,33 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 + +# +# PSRAM clock and cs IO for ESP32S2 +# +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM clock and cs IO for ESP32S2 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config diff --git a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c index fb3ee10ad7..d27985181e 100644 --- a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c +++ b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c @@ -42,6 +42,16 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct( claim_pin(pin); self->pin = pin; + gpio_config_t config; + config.pin_bit_mask = 1ull << pin->number; + config.mode = GPIO_MODE_INPUT; + config.pull_up_en = GPIO_PULLUP_DISABLE; + config.pull_down_en = GPIO_PULLDOWN_DISABLE; + config.intr_type = GPIO_INTR_DISABLE; + if (gpio_config(&config) != ESP_OK) { + return DIGITALINOUT_PIN_BUSY; + } + return DIGITALINOUT_OK; } @@ -67,7 +77,7 @@ void common_hal_digitalio_digitalinout_switch_to_input( digitalinout_result_t common_hal_digitalio_digitalinout_switch_to_output( digitalio_digitalinout_obj_t *self, bool value, digitalio_drive_mode_t drive_mode) { - gpio_set_level(self->pin->number, value); + common_hal_digitalio_digitalinout_set_value(self, value); return common_hal_digitalio_digitalinout_set_drive_mode(self, drive_mode); } @@ -82,12 +92,16 @@ digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( void common_hal_digitalio_digitalinout_set_value( digitalio_digitalinout_obj_t *self, bool value) { + self->output_value = value; gpio_set_level(self->pin->number, value); } bool common_hal_digitalio_digitalinout_get_value( digitalio_digitalinout_obj_t *self) { - return gpio_get_level(self->pin->number) == 1; + if (common_hal_digitalio_digitalinout_get_direction(self) == DIRECTION_INPUT) { + return gpio_get_level(self->pin->number) == 1; + } + return self->output_value; } digitalinout_result_t common_hal_digitalio_digitalinout_set_drive_mode( diff --git a/ports/esp32s2/common-hal/digitalio/DigitalInOut.h b/ports/esp32s2/common-hal/digitalio/DigitalInOut.h index 6877f1741a..c09c5502df 100644 --- a/ports/esp32s2/common-hal/digitalio/DigitalInOut.h +++ b/ports/esp32s2/common-hal/digitalio/DigitalInOut.h @@ -33,6 +33,7 @@ typedef struct { mp_obj_base_t base; const mcu_pin_obj_t *pin; + bool output_value; } digitalio_digitalinout_obj_t; #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_DIGITALIO_DIGITALINOUT_H diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index fb4f731b88..39b68a0f11 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -167,7 +167,9 @@ void reset_board_busses(void) { } #endif // make sure SPI lock is not held over a soft reset - common_hal_busio_spi_unlock(&spi_obj); + if (spi_singleton != NULL) { + common_hal_busio_spi_unlock(spi_singleton); + } if (!display_using_spi) { spi_singleton = NULL; } From a6cfa507b6db0365c868acddd850d9f2d5c6d424 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 30 Sep 2020 12:59:56 -0700 Subject: [PATCH 1040/1293] Add to board list --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c68a3e5c6..012dbf6b87 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -414,6 +414,7 @@ jobs: fail-fast: false matrix: board: + - "adafruit_metro_esp32s2" - "electroniccats_bastwifi" - "espressif_kaluga_1" - "espressif_saola_1_wroom" From e01e8dd6b9c886c091bdbe735f4a3f63a4fb6859 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 30 Sep 2020 16:36:13 -0400 Subject: [PATCH 1041/1293] Revert HAL refactor changes to avoid USB breaking changes past esp-idf dde6222cd --- ports/esp32s2/Makefile | 6 +++--- ports/esp32s2/common-hal/busio/I2C.h | 2 +- ports/esp32s2/common-hal/busio/SPI.h | 4 ++-- ports/esp32s2/common-hal/busio/UART.h | 2 +- ports/esp32s2/common-hal/digitalio/DigitalInOut.c | 2 +- ports/esp32s2/common-hal/microcontroller/Pin.c | 2 +- ports/esp32s2/esp-idf | 2 +- ports/esp32s2/peripherals/pins.h | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 49b9c6d2bd..700af9b196 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -263,7 +263,7 @@ menuconfig: $(BUILD)/esp-idf/config $(HEADER_BUILD)/qstr.i.last: | $(BUILD)/esp-idf/config/sdkconfig.h # Order here matters -ESP_IDF_COMPONENTS_LINK = freertos log hal esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip esp_rom esp-tls +ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip esp_rom esp-tls ESP_IDF_COMPONENTS_INCLUDE = driver freertos log soc @@ -275,11 +275,11 @@ ESP_IDF_WIFI_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_WIFI_COMPONENT MBEDTLS_COMPONENTS_LINK = crypto tls x509 MBEDTLS_COMPONENTS_LINK_EXPANDED = $(foreach component, $(MBEDTLS_COMPONENTS_LINK), $(BUILD)/esp-idf/esp-idf/mbedtls/mbedtls/library/libmbed$(component).a) -BINARY_BLOBS = esp-idf/components/xtensa/esp32s2/libxt_hal.a +BINARY_BLOBS = esp-idf/components/xtensa/esp32s2/libhal.a BINARY_WIFI_BLOBS = libcoexist.a libcore.a libespnow.a libmesh.a libnet80211.a libpp.a librtc.a libsmartconfig.a libphy.a BINARY_BLOBS += $(addprefix esp-idf/components/esp_wifi/lib/esp32s2/, $(BINARY_WIFI_BLOBS)) -ESP_IDF_COMPONENTS_EXPANDED += $(BUILD)/esp-idf/esp-idf/soc/soc/esp32s2/libsoc_esp32s2.a esp-idf/components/xtensa/esp32s2/libxt_hal.a +ESP_IDF_COMPONENTS_EXPANDED += $(BUILD)/esp-idf/esp-idf/soc/soc/esp32s2/libsoc_esp32s2.a esp-idf/components/xtensa/esp32s2/libhal.a ESP_AUTOGEN_LD = $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld $(BUILD)/esp-idf/esp-idf/esp32s2/ld/esp32s2.project.ld FLASH_FLAGS = --flash_mode $(CIRCUITPY_ESP_FLASH_MODE) --flash_freq $(CIRCUITPY_ESP_FLASH_FREQ) --flash_size $(CIRCUITPY_ESP_FLASH_SIZE) diff --git a/ports/esp32s2/common-hal/busio/I2C.h b/ports/esp32s2/common-hal/busio/I2C.h index c39d6d7448..1a989e30a4 100644 --- a/ports/esp32s2/common-hal/busio/I2C.h +++ b/ports/esp32s2/common-hal/busio/I2C.h @@ -29,7 +29,7 @@ #include "common-hal/microcontroller/Pin.h" -#include "components/hal/include/hal/i2c_types.h" +#include "components/soc/include/hal/i2c_types.h" #include "FreeRTOS.h" #include "freertos/semphr.h" #include "py/obj.h" diff --git a/ports/esp32s2/common-hal/busio/SPI.h b/ports/esp32s2/common-hal/busio/SPI.h index f6c1c344a1..d6203feae6 100644 --- a/ports/esp32s2/common-hal/busio/SPI.h +++ b/ports/esp32s2/common-hal/busio/SPI.h @@ -30,8 +30,8 @@ #include "common-hal/microcontroller/Pin.h" #include "components/driver/include/driver/spi_common_internal.h" -#include "components/hal/include/hal/spi_hal.h" -#include "components/hal/include/hal/spi_types.h" +#include "components/soc/include/hal/spi_hal.h" +#include "components/soc/include/hal/spi_types.h" #include "py/obj.h" typedef struct { diff --git a/ports/esp32s2/common-hal/busio/UART.h b/ports/esp32s2/common-hal/busio/UART.h index 1d7f135115..751fb2e002 100644 --- a/ports/esp32s2/common-hal/busio/UART.h +++ b/ports/esp32s2/common-hal/busio/UART.h @@ -29,7 +29,7 @@ #include "common-hal/microcontroller/Pin.h" -#include "components/hal/include/hal/uart_types.h" +#include "components/soc/include/hal/uart_types.h" #include "py/obj.h" typedef struct { diff --git a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c index 2c7902616f..46c47a285f 100644 --- a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c +++ b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c @@ -30,7 +30,7 @@ #include "components/driver/include/driver/gpio.h" -#include "components/hal/include/hal/gpio_hal.h" +#include "components/soc/include/hal/gpio_hal.h" void common_hal_digitalio_digitalinout_never_reset( digitalio_digitalinout_obj_t *self) { diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index 3c2611efeb..0f4669fe0d 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -32,7 +32,7 @@ #include "py/mphal.h" #include "components/driver/include/driver/gpio.h" -#include "components/hal/include/hal/gpio_hal.h" +#include "components/soc/include/hal/gpio_hal.h" #ifdef MICROPY_HW_NEOPIXEL bool neopixel_in_use; diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index 8bc19ba893..dde6222cdc 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit 8bc19ba893e5544d571a753d82b44a84799b94b1 +Subproject commit dde6222cdceca978b2588fbf0eb25b8255741fba diff --git a/ports/esp32s2/peripherals/pins.h b/ports/esp32s2/peripherals/pins.h index 9776fbb78f..0cf63a029a 100644 --- a/ports/esp32s2/peripherals/pins.h +++ b/ports/esp32s2/peripherals/pins.h @@ -34,7 +34,7 @@ #include "esp32s2_peripherals_config.h" #include "esp-idf/config/sdkconfig.h" -#include "components/hal/include/hal/gpio_types.h" +#include "components/soc/include/hal/gpio_types.h" typedef struct { PIN_PREFIX_FIELDS From 422a7d4013ddaec7df5df9104e5d9ea533b31d1a Mon Sep 17 00:00:00 2001 From: FoamyGuy Date: Wed, 30 Sep 2020 17:25:58 -0500 Subject: [PATCH 1042/1293] remove remaining top level displayio background check --- shared-module/displayio/__init__.c | 1 - 1 file changed, 1 deletion(-) diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index 5161923d60..a9bb3b21b6 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -50,7 +50,6 @@ void displayio_background(void) { return; } - displayio_background_in_progress = true; for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { if (displays[i].display.base.type == NULL || displays[i].display.base.type == &mp_type_NoneType) { From 4799333ec287655c2c3cd11d22be604bf579701c Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Thu, 1 Oct 2020 04:14:29 +0000 Subject: [PATCH 1043/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (827 of 827 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 1a8c8925ef..9370e7bd71 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: 2020-09-29 20:14-0500\n" -"PO-Revision-Date: 2020-09-30 18:43+0000\n" +"PO-Revision-Date: 2020-10-01 14:20+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -1576,7 +1576,7 @@ msgstr "A recarga foi cedo demais" #: shared-bindings/canio/RemoteTransmissionRequest.c msgid "RemoteTransmissionRequests limited to 8 bytes" -msgstr "" +msgstr "As requisições de transmissões remotas é limitada a 8 bytes" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" @@ -2498,11 +2498,11 @@ msgstr "as exceções devem derivar a partir do BaseException" #: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" -msgstr "o retorno esperado era '%q', porém obteve '% q'" +msgstr "o retorno esperado era '%q', porém obteve '%q'" #: shared-bindings/canio/CAN.c msgid "expected '%q' or '%q' but got '%q'" -msgstr "" +msgstr "o retorno esperado era '%q' ou '%q', porém obteve '%q'" #: py/objstr.c msgid "expected ':' after format specifier" From d7c3f811afd924bae8e0b009a4cfadd6fab29584 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 1 Oct 2020 09:21:39 -0500 Subject: [PATCH 1044/1293] sharpdisplay: Fix memory corruption across soft-reset It was incorrect to NULL out the pointer to our heap allocated buffer in `reset`, because subsequent to framebuffer_reset, but while the heap was still active, we could call `get_bufinfo` again, leading to a fresh allocation on the heap that is about to be destroyed. Typical stack trace: ``` #1 0x0006c368 in sharpdisplay_framebuffer_get_bufinfo #2 0x0006ad6e in _refresh_display #3 0x0006b168 in framebufferio_framebufferdisplay_background #4 0x00069d22 in displayio_background #5 0x00045496 in supervisor_background_tasks #6 0x000446e8 in background_callback_run_all #7 0x00045546 in supervisor_run_background_tasks_if_tick #8 0x0005b042 in common_hal_neopixel_write #9 0x00044c4c in clear_temp_status #10 0x000497de in spi_flash_flush_keep_cache #11 0x00049a66 in supervisor_external_flash_flush #12 0x00044b22 in supervisor_flash_flush #13 0x0004490e in filesystem_flush #14 0x00043e18 in cleanup_after_vm #15 0x0004414c in run_repl #16 0x000441ce in main ``` When this happened -- which was inconsistent -- the display would keep some heap allocation across reset which is exactly what we need to avoid. NULLing the pointer in reconstruct follows what RGBMatrix does, and that code is a bit more battle-tested anyway. If I had a motivation for structuring the SharpMemory code differently, I can no longer recall it. Testing performed: Ran my complicated calculator program over multiple iterations without observing signs of heap corruption. Closes: #3473 --- shared-module/sharpdisplay/SharpMemoryFramebuffer.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/shared-module/sharpdisplay/SharpMemoryFramebuffer.c b/shared-module/sharpdisplay/SharpMemoryFramebuffer.c index 71e00d7f01..c234468283 100644 --- a/shared-module/sharpdisplay/SharpMemoryFramebuffer.c +++ b/shared-module/sharpdisplay/SharpMemoryFramebuffer.c @@ -90,10 +90,6 @@ bool common_hal_sharpdisplay_framebuffer_get_pixels_in_byte_share_row(sharpdispl } void common_hal_sharpdisplay_framebuffer_reset(sharpdisplay_framebuffer_obj_t *self) { - if (!allocation_from_ptr(self->bufinfo.buf)) { - self->bufinfo.buf = NULL; - } - if (self->bus != &self->inline_bus #if BOARD_SPI && self->bus != common_hal_board_get_spi() @@ -105,7 +101,9 @@ void common_hal_sharpdisplay_framebuffer_reset(sharpdisplay_framebuffer_obj_t *s } void common_hal_sharpdisplay_framebuffer_reconstruct(sharpdisplay_framebuffer_obj_t *self) { - + if (!allocation_from_ptr(self->bufinfo.buf)) { + self->bufinfo.buf = NULL; + } } void common_hal_sharpdisplay_framebuffer_get_bufinfo(sharpdisplay_framebuffer_obj_t *self, mp_buffer_info_t *bufinfo) { From e477d27be36cf78ac4a7166aa18604b2f0bc910a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 1 Oct 2020 10:59:02 -0500 Subject: [PATCH 1045/1293] Update shared-bindings/rgbmatrix/RGBMatrix.c Co-authored-by: Scott Shawcroft --- shared-bindings/rgbmatrix/RGBMatrix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index 7ddbd36fb5..753c1c9203 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -214,7 +214,7 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n } } - if (args[ARG_width] <= 0) { + if (args[ARG_width].u_int <= 0) { mp_raise_ValueError(translate("width must be greater than zero")); } From 618d22cd6970b5cd08c95925feb74ef839191230 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 1 Oct 2020 11:00:33 -0500 Subject: [PATCH 1046/1293] Makefile: translate: exclude e.g., ports/unix/build as well --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index c032b0f634..e553b85e8b 100644 --- a/Makefile +++ b/Makefile @@ -45,6 +45,7 @@ TRANSLATE_SOURCES = extmod lib main.c ports/atmel-samd ports/cxd56 ports/esp32s2 # Each must be preceded by "-path"; if any wildcards, enclose in quotes. # Separate by "-o" (Find's "or" operand) TRANSLATE_SOURCES_EXC = -path "ports/*/build-*" \ + -o -path "ports/*/build" \ -o -path ports/esp32s2/esp-idf \ -o -path ports/cxd56/spresense-exported-sdk \ -o -path ports/stm/st_driver \ From 0bbd067a17eaf89ec5fdc87d18555edb4608f784 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 1 Oct 2020 13:06:48 -0400 Subject: [PATCH 1047/1293] Revert ADC calibration removal, complete merge --- ports/esp32s2/Makefile | 5 +---- ports/esp32s2/common-hal/analogio/AnalogIn.c | 18 +++++++----------- ports/esp32s2/common-hal/analogio/AnalogIn.h | 2 +- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 1289835059..f19c960f43 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -77,6 +77,7 @@ INC += -I../../supervisor/shared/usb INC += -isystem esp-idf INC += -isystem esp-idf/components/driver/include INC += -isystem esp-idf/components/hal/esp32s2/include +INC += -isystem esp-idf/components/driver/esp32s2/include INC += -isystem esp-idf/components/hal/include INC += -isystem esp-idf/components/freertos/include/freertos @@ -97,10 +98,6 @@ INC += -isystem esp-idf/components/newlib/platform_include INC += -isystem esp-idf/components/lwip/lwip/src/include INC += -isystem esp-idf/components/lwip/port/esp32/include INC += -isystem esp-idf/components/lwip/include/apps/sntp -<<<<<<< HEAD -======= -INC += -isystem esp-idf/components/hal/include ->>>>>>> esp32-update-idf INC += -isystem esp-idf/components/soc/include INC += -isystem esp-idf/components/soc/src/esp32s2/include INC += -isystem esp-idf/components/soc/soc/include diff --git a/ports/esp32s2/common-hal/analogio/AnalogIn.c b/ports/esp32s2/common-hal/analogio/AnalogIn.c index 1a15fc77cd..d8acc5728c 100644 --- a/ports/esp32s2/common-hal/analogio/AnalogIn.c +++ b/ports/esp32s2/common-hal/analogio/AnalogIn.c @@ -29,9 +29,9 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -#include "driver/adc.h" -// TODO: Add when ESP-IDF is updated latest version -// #include "esp-idf/components/esp_adc_cal/include/esp_adc_cal.h" +#include "components/driver/include/driver/adc_common.h" + +#include "components/esp_adc_cal/include/esp_adc_cal.h" #include "shared-bindings/microcontroller/Pin.h" @@ -69,10 +69,9 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { adc2_config_channel_atten((adc2_channel_t)self->pin->adc_channel, ATTENUATION); } - // TODO: esp_adc_cal is only available in the latest version of the esp-idf. Enable when we update. // Automatically select calibration process depending on status of efuse - // esp_adc_cal_characteristics_t *adc_chars = calloc(1, sizeof(esp_adc_cal_characteristics_t)); - // esp_adc_cal_characterize(self->pin->adc_index, ATTENUATION, DATA_WIDTH, DEFAULT_VREF, adc_chars); + esp_adc_cal_characteristics_t *adc_chars = calloc(1, sizeof(esp_adc_cal_characteristics_t)); + esp_adc_cal_characterize(self->pin->adc_index, ATTENUATION, DATA_WIDTH, DEFAULT_VREF, adc_chars); uint32_t adc_reading = 0; //Multisampling @@ -91,11 +90,8 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { adc_reading /= NO_OF_SAMPLES; // This corrects non-linear regions of the ADC range with a LUT, so it's a better reading than raw - // Enable when ESP-IDF is updated - //uint32_t voltage = esp_adc_cal_raw_to_voltage(adc_reading, adc_chars); - //return voltage * ((1 << 16) - 1)/3300; - - return adc_reading; + uint32_t voltage = esp_adc_cal_raw_to_voltage(adc_reading, adc_chars); + return voltage * ((1 << 16) - 1)/3300; } float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) { diff --git a/ports/esp32s2/common-hal/analogio/AnalogIn.h b/ports/esp32s2/common-hal/analogio/AnalogIn.h index 5ea4a913de..548cbb5cc0 100644 --- a/ports/esp32s2/common-hal/analogio/AnalogIn.h +++ b/ports/esp32s2/common-hal/analogio/AnalogIn.h @@ -29,7 +29,7 @@ #include "common-hal/microcontroller/Pin.h" -#include "esp-idf/components/soc/include/hal/adc_types.h" +#include "components/soc/include/hal/adc_types.h" #include "FreeRTOS.h" #include "freertos/semphr.h" #include "py/obj.h" From 9a3bd82f40784c53f39d3fb806476c6fd2083da6 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 1 Oct 2020 13:19:54 -0400 Subject: [PATCH 1048/1293] Update TinyUSB include compatibility --- ports/esp32s2/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 700af9b196..04b3e43467 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -76,9 +76,6 @@ INC += -I../../supervisor/shared/usb INC += -isystem esp-idf INC += -isystem esp-idf/components/driver/include -INC += -isystem esp-idf/components/hal/esp32s2/include -INC += -isystem esp-idf/components/hal/include - INC += -isystem esp-idf/components/freertos/include/freertos INC += -isystem esp-idf/components/freertos/xtensa/include INC += -isystem esp-idf/components/esp32s2/include @@ -98,6 +95,8 @@ INC += -isystem esp-idf/components/lwip/lwip/src/include INC += -isystem esp-idf/components/lwip/port/esp32/include INC += -isystem esp-idf/components/lwip/include/apps/sntp INC += -isystem esp-idf/components/hal/include +INC += -isystem esp-idf/components/hal/esp32s2/include +INC += -isystem esp-idf/components/log/include/ INC += -isystem esp-idf/components/soc/include INC += -isystem esp-idf/components/soc/src/esp32s2/include INC += -isystem esp-idf/components/soc/soc/include From abe98f13df68db689efe63602e1bd16b1cbb91e2 Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Thu, 1 Oct 2020 15:24:13 +0000 Subject: [PATCH 1049/1293] Translated using Weblate (Spanish) Currently translated at 99.8% (826 of 827 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/locale/es.po b/locale/es.po index 101f27b5c1..ec91f34f4a 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-29 20:14-0500\n" -"PO-Revision-Date: 2020-09-25 18:20+0000\n" +"PO-Revision-Date: 2020-10-01 17:13+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" @@ -347,7 +347,7 @@ msgstr "Ya está en ejecución" #: ports/esp32s2/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" -msgstr "" +msgstr "Ya se están buscando redes wifi" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -693,7 +693,7 @@ msgstr "No se pudo reiniciar el PWM" #: ports/esp32s2/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" -msgstr "" +msgstr "No puedo traer el reloj" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" @@ -787,7 +787,7 @@ msgstr "ECB solo opera sobre 16 bytes a la vez" #: ports/esp32s2/common-hal/busio/SPI.c msgid "ESP-IDF memory allocation failed" -msgstr "" +msgstr "Fallo ESP-IDF al tomar la memoria" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -848,7 +848,7 @@ msgstr "FFT se define solo para ndarrays" #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" -msgstr "" +msgstr "Fallo en saludo SSL" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." @@ -875,11 +875,11 @@ msgstr "Falló la asignación del buffer RX de %d bytes" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" -msgstr "" +msgstr "Fallo al tomar memoria Wifi" #: ports/esp32s2/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" -msgstr "" +msgstr "Fallo al tomar memoria para búsqueda wifi" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" @@ -891,7 +891,7 @@ msgstr "Error al conectar: tiempo de espera agotado" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to init wifi" -msgstr "" +msgstr "Fallo al inicializar wifi" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" @@ -1084,7 +1084,7 @@ msgstr "Formato de fragmento de formato no válido" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "Invalid frequency" -msgstr "" +msgstr "Frecuencia inválida" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" @@ -1319,11 +1319,11 @@ msgstr "No hay soporte de entero largo" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more channels available" -msgstr "" +msgstr "No hay más canales disponibles" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more timers available" -msgstr "" +msgstr "No hay más temporizadores disponibles" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." @@ -1392,11 +1392,11 @@ msgstr "Solo mono de 8 ó 16 bit con " #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "" +msgstr "Solo hay capacidad para enchufes IPv4 SOCK_STREAM" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" -msgstr "" +msgstr "Solo hay capacidad para direcciones IPv4" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1421,7 +1421,7 @@ msgstr "Solo se aceptan enteros crudos para ip" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Out of sockets" -msgstr "" +msgstr "Se acabaron los enchufes" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." @@ -1567,7 +1567,7 @@ msgstr "Actualizando demasiado pronto" #: shared-bindings/canio/RemoteTransmissionRequest.c msgid "RemoteTransmissionRequests limited to 8 bytes" -msgstr "" +msgstr "RemoteTransmissionRequests limitado a 8 bytes" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" @@ -1659,7 +1659,7 @@ msgstr "Rebanadas no soportadas" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" -msgstr "" +msgstr "SocketPool solo se puede usar con wifi.radio" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" @@ -1839,7 +1839,7 @@ msgstr "No se pudieron asignar buffers para la conversión con signo" #: ports/esp32s2/common-hal/busio/I2C.c msgid "Unable to create lock" -msgstr "" +msgstr "No se puede crear bloqueo" #: shared-module/displayio/I2CDisplay.c #, c-format @@ -1870,7 +1870,7 @@ msgstr "Tipo de uuid nrfx inesperado" #: ports/esp32s2/common-hal/socketpool/Socket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" -msgstr "" +msgstr "Error no manejado de ESP TLS %d %d %x %d" #: shared-bindings/wifi/Radio.c msgid "Unknown failure" @@ -2489,7 +2489,7 @@ msgstr "se espera '%q' pero se recibe '%q'" #: shared-bindings/canio/CAN.c msgid "expected '%q' or '%q' but got '%q'" -msgstr "" +msgstr "se espera '%q' o '%q' pero se recibe '%q'" #: py/objstr.c msgid "expected ':' after format specifier" @@ -3221,7 +3221,7 @@ msgstr "pow() con 3 argumentos requiere enteros" #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h msgid "pressing boot button at start up.\n" -msgstr "" +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 @@ -3229,7 +3229,7 @@ msgstr "" #: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "pressing both buttons at start up.\n" -msgstr "" +msgstr "presionando ambos botones al inicio.\n" #: extmod/modutimeq.c msgid "queue overflow" From 7652b3046d9ecb081436f001909ce542070201f1 Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Thu, 1 Oct 2020 18:23:53 +0000 Subject: [PATCH 1050/1293] Translated using Weblate (Spanish) Currently translated at 100.0% (827 of 827 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/locale/es.po b/locale/es.po index ec91f34f4a..c389b10b85 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-29 20:14-0500\n" -"PO-Revision-Date: 2020-10-01 17:13+0000\n" +"PO-Revision-Date: 2020-10-01 21:24+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" @@ -1492,6 +1492,8 @@ msgid "" "Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " "instead" msgstr "" +"Port no acepta un carrier de PWM. Pase en cambio un pin, una frecuencia o un " +"ciclo de actividad" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c From b51a84d1f868825a67b4bf68a2d72379c3cb1db7 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Thu, 1 Oct 2020 18:24:29 +0000 Subject: [PATCH 1051/1293] Translated using Weblate (Swedish) Currently translated at 100.0% (827 of 827 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 a0f60a2197..66008a4c6d 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: 2020-09-29 20:14-0500\n" -"PO-Revision-Date: 2020-09-30 18:43+0000\n" +"PO-Revision-Date: 2020-10-01 21:24+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -1562,7 +1562,7 @@ msgstr "Uppdaterad för tidigt" #: shared-bindings/canio/RemoteTransmissionRequest.c msgid "RemoteTransmissionRequests limited to 8 bytes" -msgstr "" +msgstr "RemoteTransmissionRequests begränsad till 8 byte" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" @@ -2475,7 +2475,7 @@ msgstr "förväntade '%q' men fick '%q'" #: shared-bindings/canio/CAN.c msgid "expected '%q' or '%q' but got '%q'" -msgstr "" +msgstr "förväntade '%q' eller '%q' men fick '%q'" #: py/objstr.c msgid "expected ':' after format specifier" From d2d768a9366c0a3a040825a958d7ea59a4725977 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 1 Oct 2020 23:24:20 +0200 Subject: [PATCH 1052/1293] 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 | 8 ++++++++ locale/cs.po | 8 ++++++++ locale/de_DE.po | 8 ++++++++ locale/el.po | 8 ++++++++ locale/es.po | 8 ++++++++ locale/fil.po | 8 ++++++++ locale/fr.po | 8 ++++++++ locale/hi.po | 8 ++++++++ locale/it_IT.po | 8 ++++++++ locale/ja.po | 8 ++++++++ locale/ko.po | 8 ++++++++ locale/nl.po | 8 ++++++++ locale/pl.po | 8 ++++++++ locale/pt_BR.po | 8 ++++++++ locale/sv.po | 8 ++++++++ locale/zh_Latn_pinyin.po | 8 ++++++++ 16 files changed, 128 insertions(+) diff --git a/locale/ID.po b/locale/ID.po index 42f654975c..f6cd07a8cb 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -1691,6 +1691,10 @@ msgid "" "exit safe mode.\n" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" @@ -3555,6 +3559,10 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "width must be greater than zero" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index da2339a90c..c20674d782 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -1670,6 +1670,10 @@ msgid "" "exit safe mode.\n" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" @@ -3524,6 +3528,10 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "width must be greater than zero" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 7fd7c6b0bd..aefe48b856 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -1704,6 +1704,10 @@ msgstr "" "Das `Mikrocontroller` Modul wurde benutzt, um in den Sicherheitsmodus zu " "starten. Drücke Reset um den Sicherheitsmodus zu verlassen.\n" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" @@ -3612,6 +3616,10 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "width must be greater than zero" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "Fenster muss <= Intervall sein" diff --git a/locale/el.po b/locale/el.po index bebcf8fe30..c50c107d8c 100644 --- a/locale/el.po +++ b/locale/el.po @@ -1665,6 +1665,10 @@ msgid "" "exit safe mode.\n" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" @@ -3519,6 +3523,10 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "width must be greater than zero" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/es.po b/locale/es.po index c389b10b85..0d2b6743cb 100644 --- a/locale/es.po +++ b/locale/es.po @@ -1707,6 +1707,10 @@ msgstr "" "El módulo de `microcontroller` fue utilizado para bootear en modo seguro. " "Presione reset para salir del modo seguro.\n" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" @@ -3598,6 +3602,10 @@ msgstr "los vectores deben tener el mismo tamaño" msgid "watchdog timeout must be greater than 0" msgstr "el tiempo de espera del perro guardián debe ser mayor a 0" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "width must be greater than zero" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "la ventana debe ser <= intervalo" diff --git a/locale/fil.po b/locale/fil.po index 1f6a03286d..3ddec187c8 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -1687,6 +1687,10 @@ msgid "" "exit safe mode.\n" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" @@ -3574,6 +3578,10 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "width must be greater than zero" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 179d845d39..38364d2cf8 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -1710,6 +1710,10 @@ msgstr "" "Le module `microcontrôleur` a été utilisé pour démarrer en mode sans échec. " "Appuyez sur reset pour quitter le mode sans échec.\n" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" @@ -3616,6 +3620,10 @@ msgstr "les vecteurs doivent avoir la même longueur" msgid "watchdog timeout must be greater than 0" msgstr "watchdog timeout doit être supérieur à 0" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "width must be greater than zero" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "la fenêtre doit être <= intervalle" diff --git a/locale/hi.po b/locale/hi.po index b1f21dddc4..fdcb7dc3ee 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -1665,6 +1665,10 @@ msgid "" "exit safe mode.\n" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" @@ -3519,6 +3523,10 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "width must be greater than zero" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index d430f28d12..b94f73accb 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -1698,6 +1698,10 @@ msgid "" "exit safe mode.\n" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" @@ -3581,6 +3585,10 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "width must be greater than zero" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 51cf1792a8..e8ca0f808e 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -1687,6 +1687,10 @@ msgstr "" "`microcontroller` モジュールが使われてセーフモードで起動しました。セーフモー" "ドを抜けるにはリセットを押します。\n" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" @@ -3552,6 +3556,10 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "watchdogのtimeoutは0以上でなければなりません" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "width must be greater than zero" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "windowはinterval以下でなければなりません" diff --git a/locale/ko.po b/locale/ko.po index 2bab3f4223..0c87677e66 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -1668,6 +1668,10 @@ msgid "" "exit safe mode.\n" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" @@ -3523,6 +3527,10 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "width must be greater than zero" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 11089452c7..8bc7d8840c 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -1700,6 +1700,10 @@ msgstr "" "De `microcontroller` module is gebruikt om in veilige modus op te starten. " "Druk reset om de veilige modus te verlaten.\n" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" @@ -3582,6 +3586,10 @@ msgstr "vectoren moeten van gelijke lengte zijn" msgid "watchdog timeout must be greater than 0" msgstr "watchdog time-out moet groter zijn dan 0" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "width must be greater than zero" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "window moet <= interval zijn" diff --git a/locale/pl.po b/locale/pl.po index 8ee6a9698b..3cec5c4dfe 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -1681,6 +1681,10 @@ msgid "" "exit safe mode.\n" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" @@ -3544,6 +3548,10 @@ msgstr "wektory muszą mieć identyczną długość" msgid "watchdog timeout must be greater than 0" msgstr "" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "width must be greater than zero" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 9370e7bd71..68dd2df7e1 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -1715,6 +1715,10 @@ msgstr "" "O módulo `microcontrolador` foi utilizado para inicializar no modo de " "segurança. Pressione reset para encerrar do modo de segurança.\n" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" @@ -3612,6 +3616,10 @@ msgstr "os vetores devem ter os mesmos comprimentos" msgid "watchdog timeout must be greater than 0" msgstr "o tempo limite do watchdog deve ser maior que 0" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "width must be greater than zero" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "a janela deve ser <= intervalo" diff --git a/locale/sv.po b/locale/sv.po index 66008a4c6d..0b958e7a4e 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -1700,6 +1700,10 @@ msgstr "" "Modulen \"microkontroller\" användes för att starta i säkert läge. Tryck på " "reset för att lämna säkert läge.\n" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" @@ -3579,6 +3583,10 @@ msgstr "vektorer måste ha samma längd" msgid "watchdog timeout must be greater than 0" msgstr "watchdog timeout måste vara större än 0" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "width must be greater than zero" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "window måste vara <= interval" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 0b0743b460..6e65fa13a0 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -1690,6 +1690,10 @@ msgstr "" "“Wēi kòngzhì qì” mókuài yòng yú qǐdòng ānquán móshì. Àn chóng zhì kě tuìchū " "ānquán móshì.\n" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" @@ -3565,6 +3569,10 @@ msgstr "xiàngliàng bìxū jùyǒu xiāngtóng de chángdù" msgid "watchdog timeout must be greater than 0" msgstr "kān mén gǒu chāoshí bìxū dàyú 0" +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "width must be greater than zero" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "Chuāngkǒu bìxū shì <= jiàngé" From dd2b40fdf14ceee8400ada88f2cbfe87cbd19183 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Fri, 2 Oct 2020 12:17:49 +0200 Subject: [PATCH 1053/1293] Bump circuitpython-stage to 1.1.1 This adds handling of GameOver exception as SystemExit in anticipation of the new way of starting games from the menu. --- frozen/circuitpython-stage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frozen/circuitpython-stage b/frozen/circuitpython-stage index 9596a5904e..40d8a03b45 160000 --- a/frozen/circuitpython-stage +++ b/frozen/circuitpython-stage @@ -1 +1 @@ -Subproject commit 9596a5904ed757e6fbffcf03e7aa77ae9ecf5223 +Subproject commit 40d8a03b4569d566faa62fcb0f798178118f2954 From c4e337e234f8cc16a2efa309dfedade803d14524 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Fri, 2 Oct 2020 12:47:31 +0200 Subject: [PATCH 1054/1293] Bump pew-pewpew-standalone-10.x to 2.0.1 --- frozen/pew-pewpew-standalone-10.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frozen/pew-pewpew-standalone-10.x b/frozen/pew-pewpew-standalone-10.x index 87755e0881..a14da2e1ce 160000 --- a/frozen/pew-pewpew-standalone-10.x +++ b/frozen/pew-pewpew-standalone-10.x @@ -1 +1 @@ -Subproject commit 87755e088150cc9bce42f4104cbd74d91b923c6f +Subproject commit a14da2e1ced1010a0da65f758199ff08eedd0bd5 From b1592564b286ca7a5374e77eba2c2efc768ffae9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 2 Oct 2020 15:07:36 -0500 Subject: [PATCH 1055/1293] displayio: Fix matrixportal crash An RGBMatrix has no bus and no bus_free method. It is always possible to refresh the display. This was not a problem before, but the fix I suggested (#3449) added a call to core_bus_free when a FramebufferDisplay was being refreshed. This was not caught during testing. This is a band-aid fix and it brings to light a second problem in which a SharpDisplay + FrameBuffer will not have a 'bus' object, and yet does operate using a shared SPI bus. This kind of display will need a "bus-free" like function to be added, or it can have problems like #3309. --- 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 68572c44f3..35d0c74a41 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -197,7 +197,7 @@ bool displayio_display_core_get_dither(displayio_display_core_t* self){ } bool displayio_display_core_bus_free(displayio_display_core_t *self) { - return self->bus_free(self->bus); + return !self->bus || self->bus_free(self->bus); } bool displayio_display_core_begin_transaction(displayio_display_core_t* self) { From d6d02c67d2bcacaa02499930aabd76365797b108 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Mon, 28 Sep 2020 22:34:02 +0200 Subject: [PATCH 1056/1293] Fix inconsistent supervisor heap. When allocations were freed in a different order from the reverse of how they were allocated (leaving holes), the heap would get into an inconsistent state, eventually resulting in crashes. free_memory() relies on having allocations in order, but allocate_memory() did not guarantee that: It reused the first allocation with a NULL ptr without ensuring that it was between low_address and high_address. When it belongs to a hole in the allocated memory, such an allocation is not really free for reuse, because free_memory() still needs its length. Instead, explicitly mark allocations available for reuse with a special (invalid) value in the length field. Only allocations that lie between low_address and high_address are marked that way. --- supervisor/shared/memory.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c index 8ae8a16997..56c617b9cf 100755 --- a/supervisor/shared/memory.c +++ b/supervisor/shared/memory.c @@ -33,6 +33,10 @@ #define CIRCUITPY_SUPERVISOR_ALLOC_COUNT (12) +// Using a zero length to mark an unused allocation makes the code a bit shorter (but makes it +// impossible to support zero-length allocations). +#define FREE 0 + static supervisor_allocation allocations[CIRCUITPY_SUPERVISOR_ALLOC_COUNT]; // We use uint32_t* to ensure word (4 byte) alignment. uint32_t* low_address; @@ -61,19 +65,23 @@ void free_memory(supervisor_allocation* allocation) { } if (allocation->ptr == high_address) { high_address += allocation->length / 4; + allocation->length = FREE; for (index++; index < CIRCUITPY_SUPERVISOR_ALLOC_COUNT; index++) { if (allocations[index].ptr != NULL) { break; } high_address += allocations[index].length / 4; + allocations[index].length = FREE; } } else if (allocation->ptr + allocation->length / 4 == low_address) { low_address = allocation->ptr; + allocation->length = FREE; for (index--; index >= 0; index--) { if (allocations[index].ptr != NULL) { break; } low_address -= allocations[index].length / 4; + allocations[index].length = FREE; } } else { // Freed memory isn't in the middle so skip updating bounds. The memory will be added to the @@ -99,7 +107,7 @@ supervisor_allocation* allocate_remaining_memory(void) { } supervisor_allocation* allocate_memory(uint32_t length, bool high) { - if ((high_address - low_address) * 4 < (int32_t) length || length % 4 != 0) { + if (length == 0 || (high_address - low_address) * 4 < (int32_t) length || length % 4 != 0) { return NULL; } uint8_t index = 0; @@ -109,7 +117,7 @@ supervisor_allocation* allocate_memory(uint32_t length, bool high) { direction = -1; } for (; index < CIRCUITPY_SUPERVISOR_ALLOC_COUNT; index += direction) { - if (allocations[index].ptr == NULL) { + if (allocations[index].length == FREE) { break; } } From 5bdb8c45dd2700941ab75661b773680bdd46aaf1 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Tue, 29 Sep 2020 22:21:29 +0200 Subject: [PATCH 1057/1293] Allow allocate_memory() to reuse holes when matching exactly. This requires recovering the pointer of the allocation, which could be done by adding up neighbor lengths, but the simpler way is to stop NULLing it out in the first place and instead mark an allocation as freed by the client by setting the lowest bit of the length (which is always zero in a valid length). --- supervisor/shared/memory.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c index 56c617b9cf..fdb4e06fbb 100755 --- a/supervisor/shared/memory.c +++ b/supervisor/shared/memory.c @@ -37,6 +37,10 @@ // impossible to support zero-length allocations). #define FREE 0 +// The lowest two bits of a valid length are always zero, so we can use them to mark an allocation +// as freed by the client but not yet reclaimed into the FREE middle. +#define HOLE 1 + static supervisor_allocation allocations[CIRCUITPY_SUPERVISOR_ALLOC_COUNT]; // We use uint32_t* to ensure word (4 byte) alignment. uint32_t* low_address; @@ -67,9 +71,10 @@ void free_memory(supervisor_allocation* allocation) { high_address += allocation->length / 4; allocation->length = FREE; for (index++; index < CIRCUITPY_SUPERVISOR_ALLOC_COUNT; index++) { - if (allocations[index].ptr != NULL) { + if (!(allocations[index].length & HOLE)) { break; } + // Division automatically shifts out the HOLE bit. high_address += allocations[index].length / 4; allocations[index].length = FREE; } @@ -77,7 +82,7 @@ void free_memory(supervisor_allocation* allocation) { low_address = allocation->ptr; allocation->length = FREE; for (index--; index >= 0; index--) { - if (allocations[index].ptr != NULL) { + if (!(allocations[index].length & HOLE)) { break; } low_address -= allocations[index].length / 4; @@ -85,9 +90,10 @@ void free_memory(supervisor_allocation* allocation) { } } else { // Freed memory isn't in the middle so skip updating bounds. The memory will be added to the - // middle when the memory to the inside is freed. + // middle when the memory to the inside is freed. We still need its length, but setting + // only the lowest bit is nondestructive. + allocation->length |= HOLE; } - allocation->ptr = NULL; } supervisor_allocation* allocation_from_ptr(void *ptr) { @@ -107,7 +113,7 @@ supervisor_allocation* allocate_remaining_memory(void) { } supervisor_allocation* allocate_memory(uint32_t length, bool high) { - if (length == 0 || (high_address - low_address) * 4 < (int32_t) length || length % 4 != 0) { + if (length == 0 || length % 4 != 0) { return NULL; } uint8_t index = 0; @@ -116,15 +122,21 @@ supervisor_allocation* allocate_memory(uint32_t length, bool high) { index = CIRCUITPY_SUPERVISOR_ALLOC_COUNT - 1; direction = -1; } + supervisor_allocation* alloc; for (; index < CIRCUITPY_SUPERVISOR_ALLOC_COUNT; index += direction) { - if (allocations[index].length == FREE) { + alloc = &allocations[index]; + if (alloc->length == FREE) { break; } + // If a hole matches in length exactly, we can reuse it. + if (alloc->length == (length | HOLE)) { + alloc->length = length; + return alloc; + } } - if (index >= CIRCUITPY_SUPERVISOR_ALLOC_COUNT) { + if (index >= CIRCUITPY_SUPERVISOR_ALLOC_COUNT || (high_address - low_address) * 4 < (int32_t) length) { return NULL; } - supervisor_allocation* alloc = &allocations[index]; if (high) { high_address -= length / 4; alloc->ptr = high_address; From be8092f4d32d06488df88294a9dc4bb809411c5e Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Fri, 2 Oct 2020 23:07:07 +0200 Subject: [PATCH 1058/1293] When there is not enough free space, but a matching hole on the other side, use it. --- supervisor/shared/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c index fdb4e06fbb..0f96ae2734 100755 --- a/supervisor/shared/memory.c +++ b/supervisor/shared/memory.c @@ -125,7 +125,7 @@ supervisor_allocation* allocate_memory(uint32_t length, bool high) { supervisor_allocation* alloc; for (; index < CIRCUITPY_SUPERVISOR_ALLOC_COUNT; index += direction) { alloc = &allocations[index]; - if (alloc->length == FREE) { + if (alloc->length == FREE && (high_address - low_address) * 4 >= (int32_t) length) { break; } // If a hole matches in length exactly, we can reuse it. @@ -134,7 +134,7 @@ supervisor_allocation* allocate_memory(uint32_t length, bool high) { return alloc; } } - if (index >= CIRCUITPY_SUPERVISOR_ALLOC_COUNT || (high_address - low_address) * 4 < (int32_t) length) { + if (index >= CIRCUITPY_SUPERVISOR_ALLOC_COUNT) { return NULL; } if (high) { From 23cd9fcdadcdd950efad7d99a977a42808199f81 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Thu, 1 Oct 2020 23:18:24 +0000 Subject: [PATCH 1059/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (829 of 829 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 68dd2df7e1..e2ca8e9ab0 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: 2020-09-29 20:14-0500\n" -"PO-Revision-Date: 2020-10-01 14:20+0000\n" +"PO-Revision-Date: 2020-10-02 22:53+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -1717,7 +1717,7 @@ msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" -msgstr "" +msgstr "O comprimento dos rgb_pins devem ser 6, 12, 18, 24, ou 30" #: supervisor/shared/safe_mode.c msgid "" @@ -3618,7 +3618,7 @@ msgstr "o tempo limite do watchdog deve ser maior que 0" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" -msgstr "" +msgstr "a largura deve ser maior que zero" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" From cdf18885eecb8d75f71f39959b496ae8b2b021ca Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Fri, 2 Oct 2020 11:32:23 +0000 Subject: [PATCH 1060/1293] Translated using Weblate (Swedish) Currently translated at 100.0% (829 of 829 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 0b958e7a4e..de4c592958 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: 2020-09-29 20:14-0500\n" -"PO-Revision-Date: 2020-10-01 21:24+0000\n" +"PO-Revision-Date: 2020-10-02 22:53+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -1702,7 +1702,7 @@ msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" -msgstr "" +msgstr "Längden på rgb_pins vara 6, 12, 18, 24 eller 30" #: supervisor/shared/safe_mode.c msgid "" @@ -3585,7 +3585,7 @@ msgstr "watchdog timeout måste vara större än 0" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" -msgstr "" +msgstr "width måste vara större än noll" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" From 1cdc91dce69d1ec15d2e6b7a1a397d5a5cb41fa9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 3 Oct 2020 13:21:58 -0500 Subject: [PATCH 1061/1293] Update protomatter This brings in the following, and updates us to the 1.0.4 release tag: Submodule lib/protomatter 2a1ba8fa4..5f07ec618: > Bumping version for release > Merge pull request #21 from makermelissa/master > Merge pull request #20 from makermelissa/master > Merge pull request #18 from jepler/fix-cpy-3184 > Merge pull request #14 from hierophect/cpy-timer-allocator We previously had the _changes_ of jepler/fix-cpy-3184 and hierophect/cpy-timer-allocator but not their merge commits. The only other changes in protomatter were one formatting change in the core, plus several Arduino sketches. So this should make no practical difference for CPy. --- lib/protomatter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protomatter b/lib/protomatter index 2a1ba8fa47..5f07ec6188 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit 2a1ba8fa4753b2bcb158c9b17351cf18eade0d2b +Subproject commit 5f07ec6188852794a94138763e612844842f13e4 From 8e3ec3d5201d67a6fd06cf92fef380bf4a155186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Sun, 4 Oct 2020 11:25:48 +0000 Subject: [PATCH 1062/1293] Translated using Weblate (Korean) Currently translated at 9.4% (78 of 829 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ko/ --- locale/ko.po | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/locale/ko.po b/locale/ko.po index 0c87677e66..e2bf7a372d 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -7,13 +7,15 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-29 20:14-0500\n" -"PO-Revision-Date: 2019-05-06 14:22-0700\n" -"Last-Translator: \n" +"PO-Revision-Date: 2020-10-05 12:12+0000\n" +"Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" "Language: ko\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.3-dev\n" #: main.c msgid "" @@ -156,7 +158,7 @@ msgstr "'%s' 에는 라벨이 필요합니다" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a register" -msgstr "'%s%' 에는 레지스터가 필요합니다" +msgstr "'%s' 에는 레지스터가 필요합니다" #: py/emitinlinethumb.c #, c-format From 0467a828808f15cc5f0e502667f61e4a448450df Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 5 Oct 2020 12:58:42 -0400 Subject: [PATCH 1063/1293] Fix/remove various style issues --- locale/circuitpython.pot | 2 +- ports/esp32s2/common-hal/analogio/AnalogIn.h | 8 -------- ports/esp32s2/common-hal/analogio/AnalogOut.c | 3 +-- ports/esp32s2/common-hal/analogio/AnalogOut.h | 4 ++-- ports/esp32s2/mpconfigport.mk | 1 - 5 files changed, 4 insertions(+), 14 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index d0bbe6707f..1960a36946 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-01 17:17-0400\n" +"POT-Creation-Date: 2020-10-05 12:59-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/ports/esp32s2/common-hal/analogio/AnalogIn.h b/ports/esp32s2/common-hal/analogio/AnalogIn.h index 548cbb5cc0..b9c4866f29 100644 --- a/ports/esp32s2/common-hal/analogio/AnalogIn.h +++ b/ports/esp32s2/common-hal/analogio/AnalogIn.h @@ -39,12 +39,4 @@ typedef struct { const mcu_pin_obj_t * pin; } analogio_analogin_obj_t; -static inline uint8_t stm32_adc_units(uint8_t adc_packed) { - return adc_packed >> 5; -} - -static inline uint8_t stm32_adc_channel(uint8_t adc_packed) { - return adc_packed & 0x1f; -} - #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ANALOGIO_ANALOGIN_H diff --git a/ports/esp32s2/common-hal/analogio/AnalogOut.c b/ports/esp32s2/common-hal/analogio/AnalogOut.c index d67dc6083f..b23c405142 100644 --- a/ports/esp32s2/common-hal/analogio/AnalogOut.c +++ b/ports/esp32s2/common-hal/analogio/AnalogOut.c @@ -39,7 +39,7 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, const mcu_pin_obj_t *pin) { - //mp_raise_ValueError(translate("No DAC on chip")); + mp_raise_NotImplementedError(translate("No DAC on chip")); } bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { @@ -52,7 +52,6 @@ void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { void common_hal_analogio_analogout_set_value(analogio_analogout_obj_t *self, uint16_t value) { - } void analogout_reset(void) { diff --git a/ports/esp32s2/common-hal/analogio/AnalogOut.h b/ports/esp32s2/common-hal/analogio/AnalogOut.h index d5f29ffd74..a8cbc39d5f 100644 --- a/ports/esp32s2/common-hal/analogio/AnalogOut.h +++ b/ports/esp32s2/common-hal/analogio/AnalogOut.h @@ -25,8 +25,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGOUT_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGOUT_H +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ANALOGIO_ANALOGOUT_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ANALOGIO_ANALOGOUT_H #include "common-hal/microcontroller/Pin.h" diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index d68fe469dc..4e8a7bdef2 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -13,7 +13,6 @@ USB_SERIAL_NUMBER_LENGTH = 12 LONGINT_IMPL = MPZ # These modules are implemented in ports//common-hal: -# CIRCUITPY_ANALOGIO = 0 CIRCUITPY_FULL_BUILD = 1 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 From 5c00ba8592fd0b9eba9e5c795630638a79fc4044 Mon Sep 17 00:00:00 2001 From: Seon Rozenblum Date: Fri, 2 Oct 2020 19:25:04 +1000 Subject: [PATCH 1064/1293] Removed hardware APA settings from mpconfigboard.h because they make the APA flicker on boot. I need to look into why, but I don't think they are being used for anything right now anyway. --- .../esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h | 4 ++-- .../unexpectedmaker_feathers2_prerelease/mpconfigboard.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h index a77de15116..5a885f29ce 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h @@ -35,5 +35,5 @@ #define AUTORESET_DELAY_MS 500 -#define MICROPY_HW_APA102_MOSI (&pin_GPIO40) -#define MICROPY_HW_APA102_SCK (&pin_GPIO45) +// #define MICROPY_HW_APA102_MOSI (&pin_GPIO40) +// #define MICROPY_HW_APA102_SCK (&pin_GPIO45) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h index ee97d62c63..90a368006a 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h @@ -34,5 +34,5 @@ #define AUTORESET_DELAY_MS 500 -#define MICROPY_HW_APA102_MOSI (&pin_GPIO40) -#define MICROPY_HW_APA102_SCK (&pin_GPIO45) +// #define MICROPY_HW_APA102_MOSI (&pin_GPIO40) +// #define MICROPY_HW_APA102_SCK (&pin_GPIO45) From 0d7552b67eac91500db5e5ba25607df8bd3e16e5 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 6 Oct 2020 12:48:28 -0400 Subject: [PATCH 1065/1293] Update ESP-IDF to newer fixed fork --- .gitmodules | 2 +- ports/esp32s2/esp-idf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index f66ce8aafa..b1ae2276ca 100644 --- a/.gitmodules +++ b/.gitmodules @@ -152,4 +152,4 @@ url = https://github.com/adafruit/Adafruit_CircuitPython_RFM69.git [submodule "ports/esp32s2/esp-idf"] path = ports/esp32s2/esp-idf - url = https://github.com/espressif/esp-idf.git + url = https://github.com/hierophect/esp-idf.git diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index dde6222cdc..a7f7779881 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit dde6222cdceca978b2588fbf0eb25b8255741fba +Subproject commit a7f77798816661f7c4ae198f3878bc92a9274f82 From 68cb384f8faed451c3e31a83ae087646b0c0a9f6 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 6 Oct 2020 13:29:12 -0400 Subject: [PATCH 1066/1293] Remove logging from shared-bindings, fix translations, revert config target macro --- locale/circuitpython.pot | 14 +++++++++----- ports/esp32s2/common-hal/socketpool/Socket.h | 1 - ports/esp32s2/common-hal/wifi/ScannedNetworks.h | 1 - ports/esp32s2/mpconfigport.h | 3 --- shared-bindings/socketpool/Socket.c | 3 --- shared-bindings/socketpool/SocketPool.c | 3 --- shared-bindings/wifi/ScannedNetworks.c | 3 --- 7 files changed, 9 insertions(+), 19 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 62e1fbb102..199f39c589 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-05 12:59-0400\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -271,6 +271,10 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1225,6 +1229,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -1421,6 +1426,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -1482,10 +1488,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm/ref/pulseout-pre-timeralloc.c -msgid "PulseOut not supported on this chip" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" @@ -3148,6 +3150,7 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3155,6 +3158,7 @@ msgstr "" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" diff --git a/ports/esp32s2/common-hal/socketpool/Socket.h b/ports/esp32s2/common-hal/socketpool/Socket.h index de63c8ab2c..62b5ded58e 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.h +++ b/ports/esp32s2/common-hal/socketpool/Socket.h @@ -33,7 +33,6 @@ #include "common-hal/ssl/SSLContext.h" #include "components/esp-tls/esp_tls.h" -#include "components/log/include/esp_log.h" typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/common-hal/wifi/ScannedNetworks.h b/ports/esp32s2/common-hal/wifi/ScannedNetworks.h index db0c2a1484..36da387f21 100644 --- a/ports/esp32s2/common-hal/wifi/ScannedNetworks.h +++ b/ports/esp32s2/common-hal/wifi/ScannedNetworks.h @@ -36,7 +36,6 @@ #include "freertos/event_groups.h" #include "components/esp_wifi/include/esp_wifi_types.h" -#include "components/log/include/esp_log.h" typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/mpconfigport.h b/ports/esp32s2/mpconfigport.h index 066d0fd2cf..cec8dd35df 100644 --- a/ports/esp32s2/mpconfigport.h +++ b/ports/esp32s2/mpconfigport.h @@ -36,9 +36,6 @@ #include "py/circuitpy_mpconfig.h" -// ESP-IDF leaves this undefined but uses it everywhere. -// Defining it will reduce chance of undef errors. -#define CONFIG_IDF_TARGET_ESP32 (0) #define MICROPY_PORT_ROOT_POINTERS \ CIRCUITPY_COMMON_ROOT_POINTERS diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index de05b8eb4b..b0af57a5d3 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -36,8 +36,6 @@ #include "py/runtime.h" #include "py/mperrno.h" -static const char* TAG = "socket binding"; - //| class Socket: //| """TCP, UDP and RAW socket. Cannot be created directly. Instead, call //| `SocketPool.socket()`. @@ -182,7 +180,6 @@ STATIC mp_obj_t socketpool_socket_connect(mp_obj_t self_in, mp_obj_t addr_in) { bool ok = common_hal_socketpool_socket_connect(self, host, hostlen, port); if (!ok) { - ESP_EARLY_LOGW(TAG, "socket connect failed"); mp_raise_OSError(0); } diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index 9f56e8c7e8..527cf7e984 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -37,8 +37,6 @@ #include "shared-bindings/socketpool/Socket.h" #include "shared-bindings/socketpool/SocketPool.h" -static const char* TAG = "socketpool binding"; - //| class SocketPool: //| """A pool of socket resources available for the given radio. Only one //| SocketPool can be created for each radio. @@ -121,7 +119,6 @@ STATIC mp_obj_t socketpool_socketpool_getaddrinfo(size_t n_args, const mp_obj_t } if (ip_str == mp_const_none) { - ESP_EARLY_LOGW(TAG, "no ip str"); mp_raise_OSError(0); } diff --git a/shared-bindings/wifi/ScannedNetworks.c b/shared-bindings/wifi/ScannedNetworks.c index d04f0f92a3..9316faa45b 100644 --- a/shared-bindings/wifi/ScannedNetworks.c +++ b/shared-bindings/wifi/ScannedNetworks.c @@ -32,8 +32,6 @@ #include "py/runtime.h" #include "shared-bindings/wifi/ScannedNetworks.h" -static const char *TAG = "cp iternext"; - //| class ScannedNetworks: //| """Iterates over all `wifi.Network` objects found while scanning. This object is always created //| by a `wifi.Radio`: it has no user-visible constructor.""" @@ -46,7 +44,6 @@ STATIC mp_obj_t scannednetworks_iternext(mp_obj_t self_in) { return network; } - ESP_EARLY_LOGI(TAG, "stop iteration"); return MP_OBJ_STOP_ITERATION; } From d5c8e557691f307871aabdf7d10f49768c43b4f9 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 6 Oct 2020 15:00:26 -0400 Subject: [PATCH 1067/1293] Add AnalogIO --- ports/esp32s2/common-hal/analogio/AnalogOut.c | 22 +++++++++++++++---- ports/esp32s2/common-hal/analogio/AnalogOut.h | 1 - ports/esp32s2/supervisor/port.c | 5 +++++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ports/esp32s2/common-hal/analogio/AnalogOut.c b/ports/esp32s2/common-hal/analogio/AnalogOut.c index b23c405142..a85a171837 100644 --- a/ports/esp32s2/common-hal/analogio/AnalogOut.c +++ b/ports/esp32s2/common-hal/analogio/AnalogOut.c @@ -35,25 +35,39 @@ #include "shared-bindings/microcontroller/Pin.h" #include "supervisor/shared/translate.h" +#include "components/driver/include/driver/dac.h" + #include "common-hal/microcontroller/Pin.h" void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, const mcu_pin_obj_t *pin) { - mp_raise_NotImplementedError(translate("No DAC on chip")); + if (pin == &pin_GPIO17) { + self->channel = DAC_CHANNEL_1; + } else if (pin == &pin_GPIO18) { + self->channel = DAC_CHANNEL_2; + } else { + mp_raise_ValueError(translate("Invalid DAC pin supplied")); + } + dac_output_enable(self->channel); } bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { - return true; + return (self->channel == DAC_CHANNEL_MAX); } void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { - + dac_output_disable(self->channel); + self->channel = DAC_CHANNEL_MAX; } void common_hal_analogio_analogout_set_value(analogio_analogout_obj_t *self, uint16_t value) { + uint8_t dac_value = (value * 255) / 65535; + dac_output_enable(self->channel); + dac_output_voltage(self->channel, dac_value); } void analogout_reset(void) { - + dac_output_disable(DAC_CHANNEL_1); + dac_output_disable(DAC_CHANNEL_2); } diff --git a/ports/esp32s2/common-hal/analogio/AnalogOut.h b/ports/esp32s2/common-hal/analogio/AnalogOut.h index a8cbc39d5f..6285151ba0 100644 --- a/ports/esp32s2/common-hal/analogio/AnalogOut.h +++ b/ports/esp32s2/common-hal/analogio/AnalogOut.h @@ -36,7 +36,6 @@ typedef struct { mp_obj_base_t base; const mcu_pin_obj_t * pin; uint8_t channel; - uint8_t dac_index:1; } analogio_analogout_obj_t; void analogout_reset(void); diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 4290b9bb4a..0b9c03f747 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -35,6 +35,7 @@ #include "freertos/task.h" #include "common-hal/microcontroller/Pin.h" +#include "common-hal/analogio/AnalogOut.h" #include "common-hal/busio/I2C.h" #include "common-hal/busio/SPI.h" #include "common-hal/busio/UART.h" @@ -95,6 +96,10 @@ void reset_port(void) { // A larger delay so the idle task can run and do any IDF cleanup needed. vTaskDelay(4); +#if CIRCUITPY_ANALOGIO + analogout_reset(); +#endif + #if CIRCUITPY_PULSEIO esp32s2_peripherals_rmt_reset(); pulsein_reset(); From 01e9e355cefe53edcbd6662e98d926c248fc5b95 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 24 Sep 2020 11:19:46 -0500 Subject: [PATCH 1068/1293] canio: implement for stm32f405 The has successfully run my loopback self-test program for CAN, which tests transmission, reception, and filtering. The 1M baud rate setting was also verified on saleae to be accurate. --- ports/stm/Makefile | 4 + .../mpconfigboard.mk | 2 + .../boards/feather_stm32f405_express/pins.c | 3 + ports/stm/common-hal/canio/CAN.c | 279 ++++++++++++++++ ports/stm/common-hal/canio/CAN.h | 60 ++++ ports/stm/common-hal/canio/Listener.c | 314 ++++++++++++++++++ ports/stm/common-hal/canio/Listener.h | 47 +++ ports/stm/common-hal/canio/__init__.c | 25 ++ ports/stm/common-hal/canio/__init__.h | 27 ++ ports/stm/hal_conf/stm32_hal_conf.h | 2 +- .../peripherals/stm32f4/stm32f405xx/periph.c | 23 ++ .../peripherals/stm32f4/stm32f405xx/periph.h | 6 + 12 files changed, 791 insertions(+), 1 deletion(-) create mode 100644 ports/stm/common-hal/canio/CAN.c create mode 100644 ports/stm/common-hal/canio/CAN.h create mode 100644 ports/stm/common-hal/canio/Listener.c create mode 100644 ports/stm/common-hal/canio/Listener.h create mode 100644 ports/stm/common-hal/canio/__init__.c create mode 100644 ports/stm/common-hal/canio/__init__.h diff --git a/ports/stm/Makefile b/ports/stm/Makefile index 9e1d10b998..b9426e07ec 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -198,6 +198,10 @@ SRC_STM32 = $(addprefix $(HAL_DIR)/Src/stm32$(MCU_SERIES_LOWER)xx_,\ ll_utils.c \ ) +ifeq ($(CIRCUITPY_CANIO),1) +SRC_STM32 += $(HAL_DIR)/Src/stm32$(MCU_SERIES_LOWER)xx_hal_can.c +endif + # Need this to avoid UART linker problems. TODO: rewrite to use registered callbacks. # Does not exist for F4 and lower ifeq ($(MCU_VARIANT),$(filter $(MCU_VARIANT),STM32F765xx STM32F767xx STM32F769xx STM32H743xx)) diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk index 4d0bd4598d..0866223841 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk @@ -16,3 +16,5 @@ LD_DEFAULT = boards/STM32F405_default.ld # UF2 boot option LD_BOOT = boards/STM32F405_boot.ld UF2_OFFSET = 0x8010000 + +CIRCUITPY_CANIO = 1 diff --git a/ports/stm/boards/feather_stm32f405_express/pins.c b/ports/stm/boards/feather_stm32f405_express/pins.c index 571076c339..e20ad50281 100644 --- a/ports/stm/boards/feather_stm32f405_express/pins.c +++ b/ports/stm/boards/feather_stm32f405_express/pins.c @@ -47,5 +47,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SDIO_CLOCK), MP_ROM_PTR(&pin_PC12) }, { MP_ROM_QSTR(MP_QSTR_SDIO_COMMAND), MP_ROM_PTR(&pin_PD02) }, { MP_ROM_QSTR(MP_QSTR_SDIO_DATA), MP_ROM_PTR(&sdio_data_tuple) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR(&pin_PB09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR(&pin_PB08) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/common-hal/canio/CAN.c b/ports/stm/common-hal/canio/CAN.c new file mode 100644 index 0000000000..0edf1217e3 --- /dev/null +++ b/ports/stm/common-hal/canio/CAN.c @@ -0,0 +1,279 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "py/runtime.h" +#include "py/mperrno.h" + +#include "common-hal/canio/CAN.h" +#include "peripherals/periph.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/util.h" +#include "supervisor/port.h" + +STATIC bool reserved_can[MP_ARRAY_SIZE(mcu_can_banks)]; + +STATIC const mcu_periph_obj_t *find_pin_function(const mcu_periph_obj_t *table, size_t sz, const mcu_pin_obj_t *pin, int periph_index) { + for(size_t i = 0; iperiph_index) { + continue; + } + if (pin == table->pin) { + return table; + } + } + return NULL; +} + + +__attribute__((optimize("O0"))) +void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *tx, mcu_pin_obj_t *rx, int baudrate, bool loopback, bool silent) +{ +#define DIV_ROUND(a, b) (((a) + (b)/2) / (b)) +#define DIV_ROUND_UP(a, b) (((a) + (b) - 1) / (b)) + + const uint8_t can_tx_len = MP_ARRAY_SIZE(mcu_can_tx_list); + const uint8_t can_rx_len = MP_ARRAY_SIZE(mcu_can_rx_list); + + const mcu_periph_obj_t *mcu_tx = find_pin_function(mcu_can_tx_list, can_tx_len, tx, -1); + if (!mcu_tx) { + mp_raise_ValueError_varg(translate("Invalid %q pin selection"), MP_QSTR_tx); + } + int periph_index = mcu_tx->periph_index; + + const mcu_periph_obj_t *mcu_rx = find_pin_function(mcu_can_rx_list, can_rx_len, rx, periph_index); + if (!mcu_rx) { + mp_raise_ValueError_varg(translate("Invalid %q pin selection"), MP_QSTR_rx); + } + + if (reserved_can[periph_index]) { + mp_raise_ValueError(translate("Hardware busy, try alternative pins")); + } + + const uint32_t can_frequency = 42000000; + uint32_t clocks_per_bit = DIV_ROUND(can_frequency, baudrate); + uint32_t clocks_to_sample = DIV_ROUND(clocks_per_bit * 7, 8); + uint32_t clocks_after_sample = clocks_per_bit - clocks_to_sample; + uint32_t divisor = MAX(DIV_ROUND_UP(clocks_to_sample, 16), DIV_ROUND_UP(clocks_after_sample, 8)); + const uint32_t sjw = 3; + + uint32_t tq_per_bit = DIV_ROUND(clocks_per_bit, divisor); + uint32_t tq_to_sample = DIV_ROUND(clocks_to_sample, divisor); + uint32_t tq_after_sample = tq_per_bit - tq_to_sample; + + if (divisor > 1023) { + mp_raise_OSError(MP_EINVAL); // baudrate cannot be attained (16kHz or something is lower bound, should never happen) + } + + { + GPIO_InitTypeDef GPIO_InitStruct = { + .Pin = pin_mask(tx->number), + .Speed = GPIO_SPEED_FREQ_VERY_HIGH, + .Mode = GPIO_MODE_AF_PP, + .Pull = GPIO_PULLUP, + .Alternate = mcu_tx->altfn_index, + }; + HAL_GPIO_Init(pin_port(tx->port), &GPIO_InitStruct); + + GPIO_InitStruct.Pin = pin_mask(rx->number); + GPIO_InitStruct.Alternate = mcu_rx->altfn_index; + HAL_GPIO_Init(pin_port(rx->port), &GPIO_InitStruct); + } + + CAN_TypeDef *hw = mcu_can_banks[periph_index - 1]; + + // CAN2 shares resources with CAN1. So we always enable CAN1, then split + // the filter banks equally between them. + + __HAL_RCC_CAN1_CLK_ENABLE(); + + if(hw == CAN2) { + __HAL_RCC_CAN2_CLK_ENABLE(); + self->start_filter_bank = 14; + self->end_filter_bank = 28; + self->filter_hw = CAN1; + } else { + self->start_filter_bank = 0; + self->end_filter_bank = 14; + self->filter_hw = hw; + } + + CAN_InitTypeDef init = { + .AutoRetransmission = ENABLE, + .AutoBusOff = ENABLE, + .Prescaler = divisor, + .Mode = (loopback ? CAN_MODE_LOOPBACK : 0) | (silent ? CAN_MODE_SILENT_LOOPBACK : 0), + .SyncJumpWidth = (sjw-1) << CAN_BTR_SJW_Pos, + .TimeSeg1 = (tq_to_sample-2) << CAN_BTR_TS1_Pos, + .TimeSeg2 = (tq_after_sample-1) << CAN_BTR_TS2_Pos, + }; + + self->periph_index = periph_index; + self->silent = silent; + self->loopback = loopback; + self->baudrate = baudrate; + + self->handle.Instance = hw; + self->handle.Init = init; + self->handle.State = HAL_CAN_STATE_RESET; + + HAL_CAN_Init(&self->handle); + + // Set the filter split as 14:14 + // COULDDO(@jepler): Dynamically allocate filter banks between CAN1/2 + self->filter_hw->FMR |= CAN_FMR_FINIT; + self->filter_hw->FMR = CAN_FMR_FINIT | (14 << CAN_FMR_CAN2SB_Pos); + + // Clear every filter enable bit for this can HW + uint32_t fa1r = self->filter_hw->FA1R; + for (int i = self->start_filter_bank; iend_filter_bank; i++) { + fa1r &= ~(1 << i); + } + self->filter_hw->FA1R = fa1r; + CLEAR_BIT(self->filter_hw->FMR, CAN_FMR_FINIT); + + HAL_CAN_Start(&self->handle); + + reserved_can[periph_index] = true; +} + +bool common_hal_canio_can_loopback_get(canio_can_obj_t *self) +{ + return self->loopback; +} + +int common_hal_canio_can_baudrate_get(canio_can_obj_t *self) +{ + return self->baudrate; +} + +int common_hal_canio_can_transmit_error_count_get(canio_can_obj_t *self) +{ + return (self->handle.Instance->ESR & CAN_ESR_TEC) >> CAN_ESR_TEC_Pos; +} + +int common_hal_canio_can_receive_error_count_get(canio_can_obj_t *self) +{ + return (self->handle.Instance->ESR & CAN_ESR_REC) >> CAN_ESR_REC_Pos; +} + +int common_hal_canio_can_error_warning_state_count_get(canio_can_obj_t *self) +{ + return self->error_warning_state_count; +} + +int common_hal_canio_can_error_passive_state_count_get(canio_can_obj_t *self) +{ + return self->error_passive_state_count; +} + +int common_hal_canio_can_bus_off_state_count_get(canio_can_obj_t *self) +{ + return self->bus_off_state_count; +} + +canio_bus_state_t common_hal_canio_can_state_get(canio_can_obj_t *self) { + uint32_t esr = self->handle.Instance->ESR; + if (READ_BIT(esr, CAN_ESR_BOFF)) { + return BUS_STATE_OFF; + } + if (READ_BIT(esr, CAN_ESR_EPVF)) { + return BUS_STATE_ERROR_PASSIVE; + } + if (READ_BIT(esr, CAN_ESR_EWGF)) { + return BUS_STATE_ERROR_WARNING; + } + return BUS_STATE_ERROR_ACTIVE; +} + +void common_hal_canio_can_restart(canio_can_obj_t *self) { + if (!common_hal_canio_can_auto_restart_get(self)) { + HAL_CAN_Start(&self->handle); + } +} + +bool common_hal_canio_can_auto_restart_get(canio_can_obj_t *self) { + return READ_BIT(self->handle.Instance->MCR, CAN_MCR_ABOM); +} + +void common_hal_canio_can_auto_restart_set(canio_can_obj_t *self, bool value) { + if(value) { + SET_BIT(self->handle.Instance->MCR, CAN_MCR_ABOM); + } else { + CLEAR_BIT(self->handle.Instance->MCR, CAN_MCR_ABOM); + } +} + +void common_hal_canio_can_send(canio_can_obj_t *self, mp_obj_t message_in) +{ + canio_message_obj_t *message = message_in; + uint32_t mailbox; + bool rtr = message->base.type == &canio_remote_transmission_request_type; + CAN_TxHeaderTypeDef header = { + .StdId = message->id, + .ExtId = message->id, + .IDE = message->extended ? CAN_ID_EXT : CAN_ID_STD, + .RTR = rtr ? CAN_RTR_REMOTE : CAN_RTR_DATA, + .DLC = message->size, + }; + HAL_StatusTypeDef status = HAL_CAN_AddTxMessage(&self->handle, &header, message->data, &mailbox); + if (status != HAL_OK) { + mp_raise_OSError(MP_ENOMEM); + } +} + +bool common_hal_canio_can_silent_get(canio_can_obj_t *self) { + return self->silent; +} + +bool common_hal_canio_can_deinited(canio_can_obj_t *self) { + return !self->handle.Instance; +} + +void common_hal_canio_can_check_for_deinit(canio_can_obj_t *self) { + if (common_hal_canio_can_deinited(self)) { + raise_deinited_error(); + } +} + +void common_hal_canio_can_deinit(canio_can_obj_t *self) +{ + if (self->handle.Instance) { + SET_BIT(self->handle.Instance->MCR, CAN_MCR_RESET); + while (READ_BIT(self->handle.Instance->MCR, CAN_MCR_RESET)) { + } + reserved_can[self->periph_index] = 0; + } + self->handle.Instance = NULL; +} + +void common_hal_canio_reset(void) { + for (size_t i=0; iMCR, CAN_MCR_RESET); + reserved_can[i] = 0; + } +} diff --git a/ports/stm/common-hal/canio/CAN.h b/ports/stm/common-hal/canio/CAN.h new file mode 100644 index 0000000000..bffc0f65f0 --- /dev/null +++ b/ports/stm/common-hal/canio/CAN.h @@ -0,0 +1,60 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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" +#include "shared-bindings/canio/__init__.h" +#include "shared-bindings/canio/CAN.h" +#include "common-hal/microcontroller/Pin.h" +#include "common-hal/canio/__init__.h" +#include "shared-module/canio/Message.h" + +#include "stm32f4xx_hal.h" +#include "stm32f4xx_hal_can.h" + +#define FILTER_BANK_COUNT (28) + +typedef struct canio_can_obj { + mp_obj_base_t base; + CAN_HandleTypeDef handle; + CAN_TypeDef *filter_hw; + volatile uint32_t error_warning_state_count; + volatile uint32_t error_passive_state_count; + volatile uint32_t bus_off_state_count; + int baudrate; + const mcu_pin_obj_t *rx_pin; + const mcu_pin_obj_t *tx_pin; + bool loopback:1; + bool silent:1; + bool auto_restart:1; + bool fifo0_in_use:1; + bool fifo1_in_use:1; + uint8_t periph_index:2; + uint8_t start_filter_bank; + uint8_t end_filter_bank; + long filter_in_use; // bitmask for the 28 filter banks +} canio_can_obj_t; diff --git a/ports/stm/common-hal/canio/Listener.c b/ports/stm/common-hal/canio/Listener.c new file mode 100644 index 0000000000..dd968979d2 --- /dev/null +++ b/ports/stm/common-hal/canio/Listener.c @@ -0,0 +1,314 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 + +#include "py/obj.h" +#include "py/runtime.h" + +#include "common-hal/canio/__init__.h" +#include "common-hal/canio/Listener.h" +#include "shared-bindings/util.h" +#include "supervisor/shared/tick.h" +#include "supervisor/shared/safe_mode.h" + +STATIC void allow_filter_change(canio_can_obj_t *can) { + can->filter_hw->FMR |= CAN_FMR_FINIT; +} + +STATIC void prevent_filter_change(canio_can_obj_t *can) { + can->filter_hw->FMR &= ~CAN_FMR_FINIT; +} + +STATIC bool filter_in_use(canio_can_obj_t *can, int idx) { + return can->filter_hw->FA1R & (1<extended) { + num_extended_mask += 1; + } else { + num_standard_mask += 1; + } + } + return num_extended_mask + num_standard_mask/2; +} + +STATIC size_t num_filters_available(canio_can_obj_t *can) { + size_t available = 0; + for(size_t i = can->start_filter_bank; i < can->end_filter_bank; i++) { + if (!filter_in_use(can, i)) { + available++; + } + } + return available; +} + +STATIC void clear_filters(canio_listener_obj_t *self) { + canio_can_obj_t *can = self->can; + + allow_filter_change(can); + uint32_t fa1r = can->filter_hw->FA1R; + for(size_t i = can->start_filter_bank; i < can->end_filter_bank; i++) { + if (((can->filter_hw->FFA1R >> i) & 1) == self->fifo_idx) { + fa1r &= ~(1<filter_hw->FA1R = fa1r; + prevent_filter_change(can); +} + +STATIC int next_filter(canio_can_obj_t *can) { + uint32_t fa1r = can->filter_hw->FA1R; + for(size_t i = can->start_filter_bank; i < can->end_filter_bank; i++) { + if (!(fa1r & (1<can); + + // filter is already deactivated, so we skip deactivating it here + // CLEAR_BIT(self->can->filter_hw->FA1R, bank); + + self->can->filter_hw->sFilterRegister[bank].FR1 = + (((match1->id & 0x7ff) << 5)) | + (((match1->mask & 0x7ff) << 5 | FILTER16_IDE)) << 16; + self->can->filter_hw->sFilterRegister[bank].FR2 = + (((match2->id & 0x7ff) << 5)) | + (((match2->mask & 0x7ff) << 5 | FILTER16_IDE)) << 16; + + // filter mode: 0 = mask + // (this bit should be clear already, we never set it; but just in case) + CLEAR_BIT(self->can->filter_hw->FM1R, 1 << bank); + // filter scale: 0 = 16 bits + CLEAR_BIT(self->can->filter_hw->FS1R, 1 << bank); + // fifo assignment: 1 = FIFO 1 + if (self->fifo_idx) { + SET_BIT(self->can->filter_hw->FFA1R, 1 << bank); + } else { + CLEAR_BIT(self->can->filter_hw->FFA1R, 1 << bank); + } + + // filter activation: 1 = enabled + SET_BIT(self->can->filter_hw->FA1R, 1 << bank); +} + +STATIC void install_extended_filter(canio_listener_obj_t *self, canio_match_obj_t *match) { + int bank = next_filter(self->can); + + // filter is already deactivated, so we skip deactivating it here + // CLEAR_BIT(self->can->filter_hw->FA1R, bank); + + self->can->filter_hw->sFilterRegister[bank].FR1 = + ((match->id << 3) | FILTER32_IDE); + self->can->filter_hw->sFilterRegister[bank].FR2 = + ((match->mask << 3) | FILTER32_IDE); + + // filter mode: 0 = mask + // (this bit should be clear already, we never set it; but just in case) + CLEAR_BIT(self->can->filter_hw->FM1R, 1 << bank); + // filter scale: 1 = 32 bits + SET_BIT(self->can->filter_hw->FS1R, 1 << bank); + // fifo assignment: 1 = FIFO 1 + if (self->fifo_idx) { + SET_BIT(self->can->filter_hw->FFA1R, 1 << bank); + } else { + CLEAR_BIT(self->can->filter_hw->FFA1R, 1 << bank); + } + + // filter activation: 1 = enabled + SET_BIT(self->can->filter_hw->FA1R, 1 << bank); +} + +STATIC void install_all_match_filter(canio_listener_obj_t *self) { + int bank = next_filter(self->can); + + // filter is already deactivated, so we skip deactivating it here + // CLEAR_BIT(self->can->filter_hw->FA1R, bank); + + self->can->filter_hw->sFilterRegister[bank].FR1 = 0; + self->can->filter_hw->sFilterRegister[bank].FR2 = 0; + + // filter mode: 0 = mask + // (this bit should be clear already, we never set it; but just in case) + CLEAR_BIT(self->can->filter_hw->FM1R, bank); + // filter scale: 1 = 32 bits + SET_BIT(self->can->filter_hw->FS1R, bank); + // fifo assignment: 1 = FIFO 1 + if (self->fifo_idx) { + SET_BIT(self->can->filter_hw->FFA1R, bank); + } else { + CLEAR_BIT(self->can->filter_hw->FFA1R, bank); + } + + // filter activation: 1 = enabled + SET_BIT(self->can->filter_hw->FA1R, (1 << bank)); +} + + +#define NO_ADDRESS (-1) +void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t **matches) { + allow_filter_change(self->can); + if (!nmatch) { + install_all_match_filter(self); + } else { + canio_match_obj_t *first_match = NULL; + for(size_t i = 0; iextended) { + install_extended_filter(self, matches[i]); + } else { + if (first_match) { + install_standard_filter(self, first_match, matches[i]); + first_match = NULL; + } else { + first_match = matches[i]; + } + } + } + if (first_match) { + install_standard_filter(self, first_match, first_match); + } + } + prevent_filter_change(self->can); +} + + +void common_hal_canio_listener_construct(canio_listener_obj_t *self, canio_can_obj_t *can, size_t nmatch, canio_match_obj_t **matches, float timeout) { + if (!can->fifo0_in_use) { + self->fifo_idx = 0; + self->rfr = &can->handle.Instance->RF0R; + can->fifo0_in_use = true; + } else if (!can->fifo1_in_use) { + self->fifo_idx = 1; + self->rfr = &can->handle.Instance->RF1R; + can->fifo1_in_use = true; + } else { + mp_raise_ValueError(translate("All RX FIFOs in use")); + } + + if (num_filters_needed(nmatch, matches) > num_filters_available(can)) { + mp_raise_ValueError(translate("Filters too complex")); + } + + // Nothing can fail now so it's safe to assign self->can + self->can = can; + + self->mailbox = &can->handle.Instance->sFIFOMailBox[self->fifo_idx]; + set_filters(self, nmatch, matches); + common_hal_canio_listener_set_timeout(self, timeout); +} + +void common_hal_canio_listener_set_timeout(canio_listener_obj_t *self, float timeout) { + self->timeout_ms = (int)MICROPY_FLOAT_C_FUN(ceil)(timeout * 1000); +} + +float common_hal_canio_listener_get_timeout(canio_listener_obj_t *self) { + return self->timeout_ms / 1000.0f; +} + +void common_hal_canio_listener_check_for_deinit(canio_listener_obj_t *self) { + if (!self->can) { + raise_deinited_error(); + } + common_hal_canio_can_check_for_deinit(self->can); +} + +int common_hal_canio_listener_in_waiting(canio_listener_obj_t *self) { + return *(self->rfr) & CAN_RF0R_FMP0; +} + +mp_obj_t common_hal_canio_listener_receive(canio_listener_obj_t *self) { + if (!common_hal_canio_listener_in_waiting(self)) { + uint64_t deadline = supervisor_ticks_ms64() + self->timeout_ms; + do { + if (supervisor_ticks_ms64() > deadline) { + return NULL; + } + } while (!common_hal_canio_listener_in_waiting(self)); + } + + uint32_t rir = self->mailbox->RIR; + uint32_t rdtr = self->mailbox->RDTR; + + bool rtr = rir & CAN_RI0R_RTR; + canio_message_obj_t *message = m_new_obj(canio_message_obj_t); + message->base.type = rtr ? &canio_remote_transmission_request_type : &canio_message_type; + message->extended = rir & CAN_RI0R_IDE; + if (message->extended) { + message->id = rir >> 3; + } else { + message->id = rir >> 21; + } + message->size = rdtr & CAN_RDT0R_DLC; + if (!rtr) { + uint32_t payload[] = { self->mailbox->RDLR, self->mailbox->RDHR }; + MP_STATIC_ASSERT(sizeof(payload) == sizeof(message->data)); + memcpy(message->data, payload, sizeof(payload)); + } + // Release the mailbox + SET_BIT(*self->rfr, CAN_RF0R_RFOM0); + return message; +} + +void common_hal_canio_listener_deinit(canio_listener_obj_t *self) { + if (self->can) { + clear_filters(self); + if (self->fifo_idx == 0) { + self->can->fifo0_in_use = false; + } + if (self->fifo_idx == 1) { + self->can->fifo1_in_use = false; + } + } + self->fifo_idx = -1; + self->can = NULL; + self->mailbox = NULL; + self->rfr = NULL; +} diff --git a/ports/stm/common-hal/canio/Listener.h b/ports/stm/common-hal/canio/Listener.h new file mode 100644 index 0000000000..2e17788888 --- /dev/null +++ b/ports/stm/common-hal/canio/Listener.h @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "common-hal/canio/CAN.h" +#include "shared-module/canio/Match.h" + +typedef struct canio_listener_obj { + mp_obj_base_t base; + canio_can_obj_t *can; + CAN_FIFOMailBox_TypeDef *mailbox; + __IO uint32_t *rfr; + uint32_t timeout_ms; + uint8_t fifo_idx; +} canio_listener_obj_t; + +void common_hal_canio_listener_construct(canio_listener_obj_t *self, canio_can_obj_t *can, size_t nmatch, canio_match_obj_t **matches, float timeout); +void common_hal_canio_listener_check_for_deinit(canio_listener_obj_t *self); +void common_hal_canio_listener_deinit(canio_listener_obj_t *self); +bool common_hal_canio_listener_receiveinto(canio_listener_obj_t *self, canio_message_obj_t *message); +int common_hal_canio_listener_in_waiting(canio_listener_obj_t *self); +float common_hal_canio_listener_get_timeout(canio_listener_obj_t *self); +void common_hal_canio_listener_set_timeout(canio_listener_obj_t *self, float timeout); diff --git a/ports/stm/common-hal/canio/__init__.c b/ports/stm/common-hal/canio/__init__.c new file mode 100644 index 0000000000..7932bfc2da --- /dev/null +++ b/ports/stm/common-hal/canio/__init__.c @@ -0,0 +1,25 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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. + */ diff --git a/ports/stm/common-hal/canio/__init__.h b/ports/stm/common-hal/canio/__init__.h new file mode 100644 index 0000000000..20b6638cd8 --- /dev/null +++ b/ports/stm/common-hal/canio/__init__.h @@ -0,0 +1,27 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 diff --git a/ports/stm/hal_conf/stm32_hal_conf.h b/ports/stm/hal_conf/stm32_hal_conf.h index c91be86fdf..8000e7e83d 100644 --- a/ports/stm/hal_conf/stm32_hal_conf.h +++ b/ports/stm/hal_conf/stm32_hal_conf.h @@ -11,7 +11,7 @@ */ #define HAL_MODULE_ENABLED #define HAL_ADC_MODULE_ENABLED -// #define HAL_CAN_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED // #define HAL_CEC_MODULE_ENABLED // #define HAL_COMP_MODULE_ENABLED #define HAL_CORTEX_MODULE_ENABLED diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c index c58234671c..2f9accbf11 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c @@ -216,3 +216,26 @@ const mcu_periph_obj_t mcu_sdio_data2_list[1] = { const mcu_periph_obj_t mcu_sdio_data3_list[1] = { PERIPH(1, 12, &pin_PC11), }; + +//CAN +CAN_TypeDef * mcu_can_banks[2] = {CAN1, CAN2}; + +const mcu_periph_obj_t mcu_can_tx_list[6] = { + PERIPH(1, 9, &pin_PA11), + PERIPH(1, 9, &pin_PB08), + PERIPH(1, 9, &pin_PD00), + PERIPH(1, 9, &pin_PI09), + + PERIPH(2, 9, &pin_PB12), + PERIPH(2, 9, &pin_PB05), +}; + +const mcu_periph_obj_t mcu_can_rx_list[6] = { + PERIPH(1, 9, &pin_PA12), + PERIPH(1, 9, &pin_PB09), + PERIPH(1, 9, &pin_PD01), + PERIPH(1, 9, &pin_PH13), + + PERIPH(2, 9, &pin_PB13), + PERIPH(2, 9, &pin_PB06), +}; diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h index 5b64fe10c4..03198af55e 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h @@ -71,5 +71,11 @@ extern const mcu_periph_obj_t mcu_sdio_data1_list[1]; extern const mcu_periph_obj_t mcu_sdio_data2_list[1]; extern const mcu_periph_obj_t mcu_sdio_data3_list[1]; +// CAN +extern CAN_TypeDef * mcu_can_banks[2]; + +extern const mcu_periph_obj_t mcu_can_tx_list[6]; +extern const mcu_periph_obj_t mcu_can_rx_list[6]; + #endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PERIPH_H From 7df01d3fbd321855cc65dc185d17933e4c5b388f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 5 Oct 2020 12:41:22 -0500 Subject: [PATCH 1069/1293] stm32: canio: enable on all stm32f405 boards --- ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk | 2 -- ports/stm/mpconfigport.mk | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk index 0866223841..4d0bd4598d 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk @@ -16,5 +16,3 @@ LD_DEFAULT = boards/STM32F405_default.ld # UF2 boot option LD_BOOT = boards/STM32F405_boot.ld UF2_OFFSET = 0x8010000 - -CIRCUITPY_CANIO = 1 diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index b827aa48b9..bcecaa5170 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -4,6 +4,7 @@ INTERNAL_LIBM ?= 1 USB_SERIAL_NUMBER_LENGTH ?= 24 ifeq ($(MCU_VARIANT),STM32F405xx) + CIRCUITPY_CANIO = 1 CIRCUITPY_FRAMEBUFFERIO ?= 1 CIRCUITPY_RGBMATRIX ?= 1 CIRCUITPY_SDIOIO ?= 1 From 23bd2496de3eb07385f74801df9971f9b63236bb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 5 Oct 2020 12:41:31 -0500 Subject: [PATCH 1070/1293] stm32: canio: remove some unneeded declarations --- ports/stm/common-hal/canio/Listener.c | 1 + ports/stm/common-hal/canio/Listener.h | 8 -------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/ports/stm/common-hal/canio/Listener.c b/ports/stm/common-hal/canio/Listener.c index dd968979d2..09456d39dd 100644 --- a/ports/stm/common-hal/canio/Listener.c +++ b/ports/stm/common-hal/canio/Listener.c @@ -32,6 +32,7 @@ #include "common-hal/canio/__init__.h" #include "common-hal/canio/Listener.h" +#include "shared-bindings/canio/Listener.h" #include "shared-bindings/util.h" #include "supervisor/shared/tick.h" #include "supervisor/shared/safe_mode.h" diff --git a/ports/stm/common-hal/canio/Listener.h b/ports/stm/common-hal/canio/Listener.h index 2e17788888..2d0e302e9f 100644 --- a/ports/stm/common-hal/canio/Listener.h +++ b/ports/stm/common-hal/canio/Listener.h @@ -37,11 +37,3 @@ typedef struct canio_listener_obj { uint32_t timeout_ms; uint8_t fifo_idx; } canio_listener_obj_t; - -void common_hal_canio_listener_construct(canio_listener_obj_t *self, canio_can_obj_t *can, size_t nmatch, canio_match_obj_t **matches, float timeout); -void common_hal_canio_listener_check_for_deinit(canio_listener_obj_t *self); -void common_hal_canio_listener_deinit(canio_listener_obj_t *self); -bool common_hal_canio_listener_receiveinto(canio_listener_obj_t *self, canio_message_obj_t *message); -int common_hal_canio_listener_in_waiting(canio_listener_obj_t *self); -float common_hal_canio_listener_get_timeout(canio_listener_obj_t *self); -void common_hal_canio_listener_set_timeout(canio_listener_obj_t *self, float timeout); From a7dccb39a487cdd2e65d9b9b588829818de1d16f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 5 Oct 2020 12:41:50 -0500 Subject: [PATCH 1071/1293] stm32: canio: remove unused functions --- ports/stm/common-hal/canio/CAN.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/ports/stm/common-hal/canio/CAN.c b/ports/stm/common-hal/canio/CAN.c index 0edf1217e3..244cc037ce 100644 --- a/ports/stm/common-hal/canio/CAN.c +++ b/ports/stm/common-hal/canio/CAN.c @@ -181,21 +181,6 @@ int common_hal_canio_can_receive_error_count_get(canio_can_obj_t *self) return (self->handle.Instance->ESR & CAN_ESR_REC) >> CAN_ESR_REC_Pos; } -int common_hal_canio_can_error_warning_state_count_get(canio_can_obj_t *self) -{ - return self->error_warning_state_count; -} - -int common_hal_canio_can_error_passive_state_count_get(canio_can_obj_t *self) -{ - return self->error_passive_state_count; -} - -int common_hal_canio_can_bus_off_state_count_get(canio_can_obj_t *self) -{ - return self->bus_off_state_count; -} - canio_bus_state_t common_hal_canio_can_state_get(canio_can_obj_t *self) { uint32_t esr = self->handle.Instance->ESR; if (READ_BIT(esr, CAN_ESR_BOFF)) { From e5a0af9216a6d868fad9105a4eb44e0889f54e29 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 6 Oct 2020 09:18:53 -0500 Subject: [PATCH 1072/1293] stm32: canio: When Tx mailboxes are full, cancel an old message .. also add the 8ms wait for transmission that the atmel sam port has --- ports/stm/common-hal/canio/CAN.c | 18 ++++++++++++++++++ ports/stm/common-hal/canio/CAN.h | 1 + 2 files changed, 19 insertions(+) diff --git a/ports/stm/common-hal/canio/CAN.c b/ports/stm/common-hal/canio/CAN.c index 244cc037ce..8ff91aaca4 100644 --- a/ports/stm/common-hal/canio/CAN.c +++ b/ports/stm/common-hal/canio/CAN.c @@ -225,10 +225,28 @@ void common_hal_canio_can_send(canio_can_obj_t *self, mp_obj_t message_in) .RTR = rtr ? CAN_RTR_REMOTE : CAN_RTR_DATA, .DLC = message->size, }; + uint32_t free_level = HAL_CAN_GetTxMailboxesFreeLevel(&self->handle); + if (free_level == 0) { + // There's no free Tx mailbox. We need to cancel some message without + // transmitting it, because once the bus returns to active state it's + // preferable to transmit the newest messages instead of older messages. + // + // We don't strictly guarantee that we abort the oldest Tx request, + // rather we just abort a different index each time. This permits us + // to avoid tracking this information altogether. + HAL_CAN_AbortTxRequest(&self->handle, 1 << (self->cancel_mailbox)); + self->cancel_mailbox = (self->cancel_mailbox + 1) % 3; + } HAL_StatusTypeDef status = HAL_CAN_AddTxMessage(&self->handle, &header, message->data, &mailbox); if (status != HAL_OK) { mp_raise_OSError(MP_ENOMEM); } + + // wait 8ms (hard coded for now) for TX to occur + uint64_t deadline = port_get_raw_ticks(NULL) + 8; + while (port_get_raw_ticks(NULL) < deadline && HAL_CAN_IsTxMessagePending(&self->handle, 1 << mailbox)) { + RUN_BACKGROUND_TASKS; + } } bool common_hal_canio_can_silent_get(canio_can_obj_t *self) { diff --git a/ports/stm/common-hal/canio/CAN.h b/ports/stm/common-hal/canio/CAN.h index bffc0f65f0..94d7e99a8a 100644 --- a/ports/stm/common-hal/canio/CAN.h +++ b/ports/stm/common-hal/canio/CAN.h @@ -54,6 +54,7 @@ typedef struct canio_can_obj { bool fifo0_in_use:1; bool fifo1_in_use:1; uint8_t periph_index:2; + uint8_t cancel_mailbox; uint8_t start_filter_bank; uint8_t end_filter_bank; long filter_in_use; // bitmask for the 28 filter banks From abe0405d6e643614557edd65995b61c04c656c44 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 6 Oct 2020 10:31:01 -0500 Subject: [PATCH 1073/1293] stm32: canio: Fix canio.CAN.restart() --- ports/stm/common-hal/canio/CAN.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ports/stm/common-hal/canio/CAN.c b/ports/stm/common-hal/canio/CAN.c index 8ff91aaca4..62c4e9935f 100644 --- a/ports/stm/common-hal/canio/CAN.c +++ b/ports/stm/common-hal/canio/CAN.c @@ -197,7 +197,15 @@ canio_bus_state_t common_hal_canio_can_state_get(canio_can_obj_t *self) { void common_hal_canio_can_restart(canio_can_obj_t *self) { if (!common_hal_canio_can_auto_restart_get(self)) { - HAL_CAN_Start(&self->handle); + // "If ABOM is cleared, the software must initiate the recovering + // sequence by requesting bxCAN to enter and to leave initialization + // mode." + self->handle.Instance->MCR |= CAN_MCR_INRQ; + while ((self->handle.Instance->MSR & CAN_MSR_INAK) == 0) { + } + self->handle.Instance->MCR &= ~CAN_MCR_INRQ; + while ((self->handle.Instance->MSR & CAN_MSR_INAK)) { + } } } From eed3387f4e625335a5d2f6582946ec75d1c1ed10 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 6 Oct 2020 10:31:38 -0500 Subject: [PATCH 1074/1293] stm32: canio: Fix message cancellation .. it's necessary to wait for a cancellation request to actually free the respective Tx mailbox --- ports/stm/common-hal/canio/CAN.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ports/stm/common-hal/canio/CAN.c b/ports/stm/common-hal/canio/CAN.c index 62c4e9935f..fe1c3f2b14 100644 --- a/ports/stm/common-hal/canio/CAN.c +++ b/ports/stm/common-hal/canio/CAN.c @@ -241,13 +241,21 @@ void common_hal_canio_can_send(canio_can_obj_t *self, mp_obj_t message_in) // // We don't strictly guarantee that we abort the oldest Tx request, // rather we just abort a different index each time. This permits us - // to avoid tracking this information altogether. + // to just track a single cancel index HAL_CAN_AbortTxRequest(&self->handle, 1 << (self->cancel_mailbox)); self->cancel_mailbox = (self->cancel_mailbox + 1) % 3; + // The abort request may not have completed immediately, so wait for + // the Tx mailbox to become free + do { + free_level = HAL_CAN_GetTxMailboxesFreeLevel(&self->handle); + } while (!free_level); } HAL_StatusTypeDef status = HAL_CAN_AddTxMessage(&self->handle, &header, message->data, &mailbox); if (status != HAL_OK) { - mp_raise_OSError(MP_ENOMEM); + // this is a "shouldn't happen" condition. we don't throw because the + // contract of send() is that it queues the packet to be sent if + // possible and does not signal success or failure to actually send. + return; } // wait 8ms (hard coded for now) for TX to occur From 81d7ef0256d5450e56809c5fe198693cc6cb9925 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 6 Oct 2020 20:13:23 -0500 Subject: [PATCH 1075/1293] stm: canio: remove stray optimization flag for debugging --- ports/stm/common-hal/canio/CAN.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/stm/common-hal/canio/CAN.c b/ports/stm/common-hal/canio/CAN.c index fe1c3f2b14..52d5cad1fe 100644 --- a/ports/stm/common-hal/canio/CAN.c +++ b/ports/stm/common-hal/canio/CAN.c @@ -50,7 +50,6 @@ STATIC const mcu_periph_obj_t *find_pin_function(const mcu_periph_obj_t *table, } -__attribute__((optimize("O0"))) void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *tx, mcu_pin_obj_t *rx, int baudrate, bool loopback, bool silent) { #define DIV_ROUND(a, b) (((a) + (b)/2) / (b)) From 16ed875f4e88fbf0ecd9f5fa71b1c28d7a5e444b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 6 Oct 2020 20:14:50 -0500 Subject: [PATCH 1076/1293] canio: remove unused fields these relate to properties that were removed as well --- ports/atmel-samd/common-hal/canio/CAN.h | 3 --- ports/stm/common-hal/canio/CAN.h | 3 --- 2 files changed, 6 deletions(-) diff --git a/ports/atmel-samd/common-hal/canio/CAN.h b/ports/atmel-samd/common-hal/canio/CAN.h index cdea60e7d0..15ac0f4b7f 100644 --- a/ports/atmel-samd/common-hal/canio/CAN.h +++ b/ports/atmel-samd/common-hal/canio/CAN.h @@ -41,9 +41,6 @@ typedef struct canio_can_obj { mp_obj_base_t base; Can *hw; canio_can_state_t *state; - volatile uint32_t error_warning_state_count; - volatile uint32_t error_passive_state_count; - volatile uint32_t bus_off_state_count; int baudrate; uint8_t rx_pin_number:8; uint8_t tx_pin_number:8; diff --git a/ports/stm/common-hal/canio/CAN.h b/ports/stm/common-hal/canio/CAN.h index 94d7e99a8a..3157d0a036 100644 --- a/ports/stm/common-hal/canio/CAN.h +++ b/ports/stm/common-hal/canio/CAN.h @@ -42,9 +42,6 @@ typedef struct canio_can_obj { mp_obj_base_t base; CAN_HandleTypeDef handle; CAN_TypeDef *filter_hw; - volatile uint32_t error_warning_state_count; - volatile uint32_t error_passive_state_count; - volatile uint32_t bus_off_state_count; int baudrate; const mcu_pin_obj_t *rx_pin; const mcu_pin_obj_t *tx_pin; From d01b9ce933048c69c7611cd4f512baa040f2f101 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 7 Oct 2020 22:15:05 +0530 Subject: [PATCH 1077/1293] Disable auto-reload in safe mode --- main.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/main.c b/main.c index dbd367a596..1f7352b0e9 100755 --- a/main.c +++ b/main.c @@ -249,10 +249,7 @@ bool run_code_py(safe_mode_t safe_mode) { serial_write("\n"); if (autoreload_is_enabled()) { serial_write_compressed(translate("Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.\n")); - } else if (safe_mode != NO_SAFE_MODE) { - serial_write_compressed(translate("Running in safe mode! ")); - serial_write_compressed(translate("Auto-reload is off.\n")); - } else if (!autoreload_is_enabled()) { + } else { serial_write_compressed(translate("Auto-reload is off.\n")); } } @@ -322,16 +319,16 @@ bool run_code_py(safe_mode_t safe_mode) { } if (!serial_connected_before_animation && serial_connected()) { - if (serial_connected_at_start) { - serial_write("\n\n"); - } - if (!serial_connected_at_start) { if (autoreload_is_enabled()) { serial_write_compressed(translate("Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.\n")); } else { serial_write_compressed(translate("Auto-reload is off.\n")); } + if (safe_mode != NO_SAFE_MODE) { + serial_write_compressed(translate("Running in safe mode! ")); + serial_write_compressed(translate("Not running saved code.\n")); + } } print_safe_mode_message(safe_mode); serial_write("\n"); @@ -486,8 +483,10 @@ int __attribute__((used)) main(void) { reset_devices(); reset_board(); - // Turn on autoreload by default but before boot.py in case it wants to change it. - autoreload_enable(); + // If not in safe mode turn on autoreload by default but before boot.py in case it wants to change it. + if (safe_mode == NO_SAFE_MODE) { + autoreload_enable(); + } // By default our internal flash is readonly to local python code and // writable over USB. Set it here so that boot.py can change it. From b7ed18d622fb6ca5b02034cbd2ac8d256374d77d Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 8 Oct 2020 00:52:00 +0700 Subject: [PATCH 1078/1293] change idf to espressif fix hal includes --- .gitmodules | 2 +- ports/esp32s2/common-hal/busio/I2C.h | 2 +- ports/esp32s2/common-hal/busio/SPI.h | 4 ++-- ports/esp32s2/common-hal/busio/UART.h | 2 +- ports/esp32s2/common-hal/digitalio/DigitalInOut.c | 2 +- ports/esp32s2/common-hal/microcontroller/Pin.c | 2 +- ports/esp32s2/esp-idf | 2 +- ports/esp32s2/peripherals/pins.h | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitmodules b/.gitmodules index b1ae2276ca..f66ce8aafa 100644 --- a/.gitmodules +++ b/.gitmodules @@ -152,4 +152,4 @@ url = https://github.com/adafruit/Adafruit_CircuitPython_RFM69.git [submodule "ports/esp32s2/esp-idf"] path = ports/esp32s2/esp-idf - url = https://github.com/hierophect/esp-idf.git + url = https://github.com/espressif/esp-idf.git diff --git a/ports/esp32s2/common-hal/busio/I2C.h b/ports/esp32s2/common-hal/busio/I2C.h index 1a989e30a4..c39d6d7448 100644 --- a/ports/esp32s2/common-hal/busio/I2C.h +++ b/ports/esp32s2/common-hal/busio/I2C.h @@ -29,7 +29,7 @@ #include "common-hal/microcontroller/Pin.h" -#include "components/soc/include/hal/i2c_types.h" +#include "components/hal/include/hal/i2c_types.h" #include "FreeRTOS.h" #include "freertos/semphr.h" #include "py/obj.h" diff --git a/ports/esp32s2/common-hal/busio/SPI.h b/ports/esp32s2/common-hal/busio/SPI.h index d6203feae6..f6c1c344a1 100644 --- a/ports/esp32s2/common-hal/busio/SPI.h +++ b/ports/esp32s2/common-hal/busio/SPI.h @@ -30,8 +30,8 @@ #include "common-hal/microcontroller/Pin.h" #include "components/driver/include/driver/spi_common_internal.h" -#include "components/soc/include/hal/spi_hal.h" -#include "components/soc/include/hal/spi_types.h" +#include "components/hal/include/hal/spi_hal.h" +#include "components/hal/include/hal/spi_types.h" #include "py/obj.h" typedef struct { diff --git a/ports/esp32s2/common-hal/busio/UART.h b/ports/esp32s2/common-hal/busio/UART.h index 751fb2e002..1d7f135115 100644 --- a/ports/esp32s2/common-hal/busio/UART.h +++ b/ports/esp32s2/common-hal/busio/UART.h @@ -29,7 +29,7 @@ #include "common-hal/microcontroller/Pin.h" -#include "components/soc/include/hal/uart_types.h" +#include "components/hal/include/hal/uart_types.h" #include "py/obj.h" typedef struct { diff --git a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c index a2a0209f93..152db1e71d 100644 --- a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c +++ b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c @@ -30,7 +30,7 @@ #include "components/driver/include/driver/gpio.h" -#include "components/soc/include/hal/gpio_hal.h" +#include "components/hal/include/hal/gpio_hal.h" void common_hal_digitalio_digitalinout_never_reset( digitalio_digitalinout_obj_t *self) { diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index 0f4669fe0d..3c2611efeb 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -32,7 +32,7 @@ #include "py/mphal.h" #include "components/driver/include/driver/gpio.h" -#include "components/soc/include/hal/gpio_hal.h" +#include "components/hal/include/hal/gpio_hal.h" #ifdef MICROPY_HW_NEOPIXEL bool neopixel_in_use; diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index a7f7779881..8bc19ba893 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit a7f77798816661f7c4ae198f3878bc92a9274f82 +Subproject commit 8bc19ba893e5544d571a753d82b44a84799b94b1 diff --git a/ports/esp32s2/peripherals/pins.h b/ports/esp32s2/peripherals/pins.h index 0cf63a029a..9776fbb78f 100644 --- a/ports/esp32s2/peripherals/pins.h +++ b/ports/esp32s2/peripherals/pins.h @@ -34,7 +34,7 @@ #include "esp32s2_peripherals_config.h" #include "esp-idf/config/sdkconfig.h" -#include "components/soc/include/hal/gpio_types.h" +#include "components/hal/include/hal/gpio_types.h" typedef struct { PIN_PREFIX_FIELDS From 8487a51995d708b6ade7f714600b37ee6e7d4a5a Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 7 Oct 2020 23:53:08 +0530 Subject: [PATCH 1079/1293] Factor out code.py status messages --- main.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/main.c b/main.c index 1f7352b0e9..b43b3b8c80 100755 --- a/main.c +++ b/main.c @@ -242,16 +242,24 @@ void cleanup_after_vm(supervisor_allocation* heap) { reset_status_led(); } +void print_code_py_status_message(safe_mode_t safe_mode) { + if (autoreload_is_enabled()) { + serial_write_compressed(translate("Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.\n")); + } else { + serial_write_compressed(translate("Auto-reload is off.\n")); + } + if (safe_mode != NO_SAFE_MODE) { + serial_write_compressed(translate("Running in safe mode! ")); + serial_write_compressed(translate("Not running saved code.\n")); + } +} + bool run_code_py(safe_mode_t safe_mode) { bool serial_connected_at_start = serial_connected(); #if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 if (serial_connected_at_start) { serial_write("\n"); - if (autoreload_is_enabled()) { - serial_write_compressed(translate("Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.\n")); - } else { - serial_write_compressed(translate("Auto-reload is off.\n")); - } + print_code_py_status_message(safe_mode); } #endif @@ -263,10 +271,7 @@ bool run_code_py(safe_mode_t safe_mode) { bool found_main = false; - if (safe_mode != NO_SAFE_MODE) { - serial_write_compressed(translate("Running in safe mode! ")); - serial_write_compressed(translate("Not running saved code.\n")); - } else { + if (safe_mode == NO_SAFE_MODE) { new_status_color(MAIN_RUNNING); static const char * const supported_filenames[] = STRING_LIST("code.txt", "code.py", "main.py", "main.txt"); @@ -320,15 +325,7 @@ bool run_code_py(safe_mode_t safe_mode) { if (!serial_connected_before_animation && serial_connected()) { if (!serial_connected_at_start) { - if (autoreload_is_enabled()) { - serial_write_compressed(translate("Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.\n")); - } else { - serial_write_compressed(translate("Auto-reload is off.\n")); - } - if (safe_mode != NO_SAFE_MODE) { - serial_write_compressed(translate("Running in safe mode! ")); - serial_write_compressed(translate("Not running saved code.\n")); - } + print_code_py_status_message(safe_mode); } print_safe_mode_message(safe_mode); serial_write("\n"); From 085d2a22746f4e16915d64a81ac6b62123d650ee Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Wed, 7 Oct 2020 14:09:26 -0500 Subject: [PATCH 1080/1293] Update submodule to merge commit --- ports/atmel-samd/peripherals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 2ff4ab0510..a7e39c4d01 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 2ff4ab05101ce7d3e105009cc6612df6e992123f +Subproject commit a7e39c4d01aa5916015beecb021777617e77b0ad From 09bc4157516dd59754a3eb1a5dbbb72a758ebe93 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 28 Sep 2020 19:21:17 -0700 Subject: [PATCH 1081/1293] Unify iMX flash config and add Metro M7 1011 This unifies the flash config to the settings used by the Boot ROM. This makes the config unique per board which allows for changing quad enable and status bit differences per flash device. It also allows for timing differences due to the board layout. This change also tweaks linker layout to leave more ram space for the CircuitPython heap. --- .github/workflows/build.yml | 1 + extmod/vfs_fat_diskio.c | 37 ++- ports/mimxrt10xx/Makefile | 2 +- ports/mimxrt10xx/boards/board.h | 8 + .../boards/feather_m7_1011/flash_config.c | 203 ++++++++++------ .../boards/feather_mimxrt1011/flash_config.c | 203 ++++++++++------ .../boards/feather_mimxrt1062/flash_config.c | 203 ++++++++++------ .../boards/imxrt1010_evk/flash_config.c | 204 ++++++++++------ .../boards/imxrt1020_evk/flash_config.c | 207 +++++++++------- .../boards/imxrt1060_evk/flash_config.c | 205 ++++++++++------ ports/mimxrt10xx/boards/metro_m7_1011/board.c | 52 ++++ .../boards/metro_m7_1011/flash_config.c | 179 ++++++++++++++ .../boards/metro_m7_1011/mpconfigboard.h | 20 ++ .../boards/metro_m7_1011/mpconfigboard.mk | 12 + ports/mimxrt10xx/boards/metro_m7_1011/pins.c | 59 +++++ .../mimxrt10xx/boards/teensy40/flash_config.c | 217 ++++++++++------- .../mimxrt10xx/boards/teensy41/flash_config.c | 207 +++++++++------- ports/mimxrt10xx/linking/common.ld | 3 - .../supervisor/flexspi_nor_flash_ops.c | 228 ++---------------- ports/mimxrt10xx/supervisor/internal_flash.c | 121 +--------- ports/mimxrt10xx/supervisor/internal_flash.h | 17 +- ports/mimxrt10xx/supervisor/port.c | 22 +- ports/mimxrt10xx/supervisor/usb.c | 4 - supervisor/shared/background_callback.c | 3 +- supervisor/shared/filesystem.c | 17 +- supervisor/shared/flash.c | 49 +++- 26 files changed, 1458 insertions(+), 1025 deletions(-) create mode 100644 ports/mimxrt10xx/boards/metro_m7_1011/board.c create mode 100644 ports/mimxrt10xx/boards/metro_m7_1011/flash_config.c create mode 100644 ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.h create mode 100644 ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.mk create mode 100644 ports/mimxrt10xx/boards/metro_m7_1011/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dc3dc68352..cced2d702b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -243,6 +243,7 @@ jobs: - "metro_m0_express" - "metro_m4_airlift_lite" - "metro_m4_express" + - "metro_m7_1011" - "metro_nrf52840_express" - "mini_sam_m4" - "monster_m4sk" diff --git a/extmod/vfs_fat_diskio.c b/extmod/vfs_fat_diskio.c index ac8924394a..432c03b7c9 100644 --- a/extmod/vfs_fat_diskio.c +++ b/extmod/vfs_fat_diskio.c @@ -123,7 +123,7 @@ DRESULT disk_write ( DRESULT disk_ioctl ( bdev_t pdrv, /* Physical drive nmuber (0..) */ - BYTE cmd, /* Control code */ + BYTE cmd, /* Control code */ void *buff /* Buffer to send/receive control data */ ) { @@ -133,7 +133,7 @@ DRESULT disk_ioctl ( } // First part: call the relevant method of the underlying block device - mp_obj_t ret = mp_const_none; + mp_int_t out_value = 0; if (vfs->flags & FSUSER_HAVE_IOCTL) { // new protocol with ioctl static const uint8_t op_map[8] = { @@ -144,9 +144,19 @@ DRESULT disk_ioctl ( }; uint8_t bp_op = op_map[cmd & 7]; if (bp_op != 0) { - vfs->u.ioctl[2] = MP_OBJ_NEW_SMALL_INT(bp_op); - vfs->u.ioctl[3] = MP_OBJ_NEW_SMALL_INT(0); // unused - ret = mp_call_method_n_kw(2, 0, vfs->u.ioctl); + if (vfs->flags & FSUSER_NATIVE) { + bool (*f)(size_t, mp_int_t*) = (void*)(uintptr_t)vfs->u.ioctl[2]; + if (!f(bp_op, (mp_int_t*) &out_value)) { + return RES_ERROR; + } + } else { + vfs->u.ioctl[2] = MP_OBJ_NEW_SMALL_INT(bp_op); + vfs->u.ioctl[3] = MP_OBJ_NEW_SMALL_INT(0); // unused + mp_obj_t ret = mp_call_method_n_kw(2, 0, vfs->u.ioctl); + if (ret != mp_const_none) { + out_value = mp_obj_get_int(ret); + } + } } } else { // old protocol with sync and count @@ -157,10 +167,13 @@ DRESULT disk_ioctl ( } break; - case GET_SECTOR_COUNT: - ret = mp_call_method_n_kw(0, 0, vfs->u.old.count); + case GET_SECTOR_COUNT: { + mp_obj_t ret = mp_call_method_n_kw(0, 0, vfs->u.old.count); + if (ret != mp_const_none) { + out_value = mp_obj_get_int(ret); + } break; - + } case GET_SECTOR_SIZE: // old protocol has fixed sector size of 512 bytes break; @@ -177,16 +190,16 @@ DRESULT disk_ioctl ( return RES_OK; case GET_SECTOR_COUNT: { - *((DWORD*)buff) = mp_obj_get_int(ret); + *((DWORD*)buff) = out_value; return RES_OK; } case GET_SECTOR_SIZE: { - if (ret == mp_const_none) { + if (out_value == 0) { // Default sector size *((WORD*)buff) = 512; } else { - *((WORD*)buff) = mp_obj_get_int(ret); + *((WORD*)buff) = out_value; } #if _MAX_SS != _MIN_SS // need to store ssize because we use it in disk_read/disk_write @@ -202,7 +215,7 @@ DRESULT disk_ioctl ( case IOCTL_INIT: case IOCTL_STATUS: { DSTATUS stat; - if (ret != mp_const_none && MP_OBJ_SMALL_INT_VALUE(ret) != 0) { + if (out_value != 0) { // error initialising stat = STA_NOINIT; } else if (vfs->writeblocks[0] == MP_OBJ_NULL) { diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 248798f634..12c9bde4f5 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -75,7 +75,7 @@ INC += \ # NDEBUG disables assert() statements. This reduces code size pretty dramatically, per tannewt. -CFLAGS += -Os -DNDEBUG +CFLAGS += -Os -DNDEBUG -ffreestanding # TinyUSB defines CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_MIMXRT10XX -DCFG_TUD_MIDI_RX_BUFSIZE=512 -DCFG_TUD_CDC_RX_BUFSIZE=512 -DCFG_TUD_MIDI_TX_BUFSIZE=512 -DCFG_TUD_CDC_TX_BUFSIZE=512 -DCFG_TUD_MSC_BUFSIZE=1024 diff --git a/ports/mimxrt10xx/boards/board.h b/ports/mimxrt10xx/boards/board.h index 92d02d900e..678c223ae0 100644 --- a/ports/mimxrt10xx/boards/board.h +++ b/ports/mimxrt10xx/boards/board.h @@ -33,6 +33,7 @@ #include "py/mpconfig.h" #include "fsl_common.h" +#include "fsl_flexspi_nor_config.h" // Initializes board related state once on start up. void board_init(void); @@ -45,4 +46,11 @@ bool board_requests_safe_mode(void); // Reset the state of off MCU components such as neopixels. void reset_board(void); +#define SEQUENCE(first, second, third, fourth) first, second, third, fourth +#define TWO_EMPTY_STEPS 0x00000000 +#define EMPTY_SEQUENCE SEQUENCE(TWO_EMPTY_STEPS, TWO_EMPTY_STEPS, TWO_EMPTY_STEPS, TWO_EMPTY_STEPS) + +// FlexSPI configuration that stores command info. +extern const flexspi_nor_config_t qspiflash_config; + #endif // MICROPY_INCLUDED_MIMXRT10XX_BOARDS_BOARD_H diff --git a/ports/mimxrt10xx/boards/feather_m7_1011/flash_config.c b/ports/mimxrt10xx/boards/feather_m7_1011/flash_config.c index b74c0b1514..282464c75d 100644 --- a/ports/mimxrt10xx/boards/feather_m7_1011/flash_config.c +++ b/ports/mimxrt10xx/boards/feather_m7_1011/flash_config.c @@ -6,7 +6,7 @@ */ #include "fsl_flexspi_nor_boot.h" -#include "fsl_flexspi_nor_config.h" +#include "boards/board.h" __attribute__((section(".boot_hdr.ivt"))) @@ -35,88 +35,135 @@ const BOOT_DATA_T boot_data = { 0xFFFFFFFF /* empty - extra data word */ }; +// Config for W25Q32JV with QSPI routed. __attribute__((section(".boot_hdr.conf"))) -// Values copied from https://github.com/PaulStoffregen/cores/blob/ddb23fa5d97dac763bc06e11b9b41f026bd51f0a/teensy4/bootdata.c#L39 const flexspi_nor_config_t qspiflash_config = { - .memConfig = - { - .tag = FLEXSPI_CFG_BLK_TAG, - .version = FLEXSPI_CFG_BLK_VERSION, - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, - .csHoldTime = 1u, - .csSetupTime = 2u, - // Enable DDR mode, Wordaddressable, Safe configuration, Differential clock - .deviceType = kFlexSpiDeviceType_SerialNOR, - .sflashPadType = kSerialFlash_4Pads, - .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 - .sflashA1Size = FLASH_SIZE, - .lookupTable = - { - // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) - // (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | - // FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - // Read LUTs - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04), - 0, - 0, - - 0x24040405, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000406, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x08180420, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x081804D8, - 0, - 0, - 0, - - 0x08180402, - 0x00002004, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000460, - }, - }, .pageSize = 256u, .sectorSize = 4u * 1024u, .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, .blockSize = 0x00010000, .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x02, // Bit pattern for setting Quad Enable. + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_133MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x02), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + EMPTY_SEQUENCE, + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status -2 + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x31 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x01 /* number of bytes to write */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, }; diff --git a/ports/mimxrt10xx/boards/feather_mimxrt1011/flash_config.c b/ports/mimxrt10xx/boards/feather_mimxrt1011/flash_config.c index b74c0b1514..51cc0f164b 100644 --- a/ports/mimxrt10xx/boards/feather_mimxrt1011/flash_config.c +++ b/ports/mimxrt10xx/boards/feather_mimxrt1011/flash_config.c @@ -6,7 +6,7 @@ */ #include "fsl_flexspi_nor_boot.h" -#include "fsl_flexspi_nor_config.h" +#include "boards/board.h" __attribute__((section(".boot_hdr.ivt"))) @@ -35,88 +35,135 @@ const BOOT_DATA_T boot_data = { 0xFFFFFFFF /* empty - extra data word */ }; +// Config for W25Q64JV with QSPI routed. __attribute__((section(".boot_hdr.conf"))) -// Values copied from https://github.com/PaulStoffregen/cores/blob/ddb23fa5d97dac763bc06e11b9b41f026bd51f0a/teensy4/bootdata.c#L39 const flexspi_nor_config_t qspiflash_config = { - .memConfig = - { - .tag = FLEXSPI_CFG_BLK_TAG, - .version = FLEXSPI_CFG_BLK_VERSION, - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, - .csHoldTime = 1u, - .csSetupTime = 2u, - // Enable DDR mode, Wordaddressable, Safe configuration, Differential clock - .deviceType = kFlexSpiDeviceType_SerialNOR, - .sflashPadType = kSerialFlash_4Pads, - .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 - .sflashA1Size = FLASH_SIZE, - .lookupTable = - { - // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) - // (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | - // FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - // Read LUTs - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04), - 0, - 0, - - 0x24040405, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000406, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x08180420, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x081804D8, - 0, - 0, - 0, - - 0x08180402, - 0x00002004, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000460, - }, - }, .pageSize = 256u, .sectorSize = 4u * 1024u, .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, .blockSize = 0x00010000, .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x02, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_133MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + EMPTY_SEQUENCE, + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x31 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, }; diff --git a/ports/mimxrt10xx/boards/feather_mimxrt1062/flash_config.c b/ports/mimxrt10xx/boards/feather_mimxrt1062/flash_config.c index b74c0b1514..51cc0f164b 100644 --- a/ports/mimxrt10xx/boards/feather_mimxrt1062/flash_config.c +++ b/ports/mimxrt10xx/boards/feather_mimxrt1062/flash_config.c @@ -6,7 +6,7 @@ */ #include "fsl_flexspi_nor_boot.h" -#include "fsl_flexspi_nor_config.h" +#include "boards/board.h" __attribute__((section(".boot_hdr.ivt"))) @@ -35,88 +35,135 @@ const BOOT_DATA_T boot_data = { 0xFFFFFFFF /* empty - extra data word */ }; +// Config for W25Q64JV with QSPI routed. __attribute__((section(".boot_hdr.conf"))) -// Values copied from https://github.com/PaulStoffregen/cores/blob/ddb23fa5d97dac763bc06e11b9b41f026bd51f0a/teensy4/bootdata.c#L39 const flexspi_nor_config_t qspiflash_config = { - .memConfig = - { - .tag = FLEXSPI_CFG_BLK_TAG, - .version = FLEXSPI_CFG_BLK_VERSION, - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, - .csHoldTime = 1u, - .csSetupTime = 2u, - // Enable DDR mode, Wordaddressable, Safe configuration, Differential clock - .deviceType = kFlexSpiDeviceType_SerialNOR, - .sflashPadType = kSerialFlash_4Pads, - .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 - .sflashA1Size = FLASH_SIZE, - .lookupTable = - { - // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) - // (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | - // FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - // Read LUTs - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04), - 0, - 0, - - 0x24040405, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000406, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x08180420, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x081804D8, - 0, - 0, - 0, - - 0x08180402, - 0x00002004, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000460, - }, - }, .pageSize = 256u, .sectorSize = 4u * 1024u, .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, .blockSize = 0x00010000, .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x02, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_133MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + EMPTY_SEQUENCE, + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x31 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, }; diff --git a/ports/mimxrt10xx/boards/imxrt1010_evk/flash_config.c b/ports/mimxrt10xx/boards/imxrt1010_evk/flash_config.c index 7e8fb75b24..19573bd993 100644 --- a/ports/mimxrt10xx/boards/imxrt1010_evk/flash_config.c +++ b/ports/mimxrt10xx/boards/imxrt1010_evk/flash_config.c @@ -6,7 +6,8 @@ */ #include "fsl_flexspi_nor_boot.h" -#include "fsl_flexspi_nor_config.h" +#include "boards/board.h" + __attribute__((section(".boot_hdr.ivt"))) /************************************* @@ -34,88 +35,135 @@ const BOOT_DATA_T boot_data = { 0xFFFFFFFF /* empty - extra data word */ }; +// Config for AT25SF128A with QSPI routed. __attribute__((section(".boot_hdr.conf"))) -// Values copied from https://github.com/PaulStoffregen/cores/blob/ddb23fa5d97dac763bc06e11b9b41f026bd51f0a/teensy4/bootdata.c#L39 const flexspi_nor_config_t qspiflash_config = { - .memConfig = - { - .tag = FLEXSPI_CFG_BLK_TAG, - .version = FLEXSPI_CFG_BLK_VERSION, - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, - .csHoldTime = 1u, - .csSetupTime = 2u, - // Enable DDR mode, Wordaddressable, Safe configuration, Differential clock - .deviceType = kFlexSpiDeviceType_SerialNOR, - .sflashPadType = kSerialFlash_4Pads, - .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 - .sflashA1Size = FLASH_SIZE, - .lookupTable = - { - // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) - // (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | - // FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - // Read LUTs - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04), - 0, - 0, - - 0x24040405, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000406, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x08180420, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x081804D8, - 0, - 0, - 0, - - 0x08180402, - 0x00002004, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000460, - }, - }, .pageSize = 256u, .sectorSize = 4u * 1024u, .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, .blockSize = 0x00010000, .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x02, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_60MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x02), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + EMPTY_SEQUENCE, + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x31 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, }; diff --git a/ports/mimxrt10xx/boards/imxrt1020_evk/flash_config.c b/ports/mimxrt10xx/boards/imxrt1020_evk/flash_config.c index 43ffe0dd13..40b566618e 100644 --- a/ports/mimxrt10xx/boards/imxrt1020_evk/flash_config.c +++ b/ports/mimxrt10xx/boards/imxrt1020_evk/flash_config.c @@ -6,7 +6,7 @@ */ #include "fsl_flexspi_nor_boot.h" -#include "fsl_flexspi_nor_config.h" +#include "boards/board.h" __attribute__((section(".boot_hdr.ivt"))) @@ -35,92 +35,135 @@ const BOOT_DATA_T boot_data = { 0xFFFFFFFF /* empty - extra data word */ }; +// Config for IS25LP064A with QSPI routed. __attribute__((section(".boot_hdr.conf"))) -// Values copied from https://github.com/PaulStoffregen/cores/blob/ddb23fa5d97dac763bc06e11b9b41f026bd51f0a/teensy4/bootdata.c#L39 const flexspi_nor_config_t qspiflash_config = { - .memConfig = - { - .tag = FLEXSPI_CFG_BLK_TAG, - .version = FLEXSPI_CFG_BLK_VERSION, -#ifdef BOARD_USING_SECONDARY_QSPI_PINMUX - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromInternally, -#else - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, -#endif - .csHoldTime = 1u, - .csSetupTime = 2u, - // Enable DDR mode, Wordaddressable, Safe configuration, Differential clock - .deviceType = kFlexSpiDeviceType_SerialNOR, - .sflashPadType = kSerialFlash_4Pads, - .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 - .sflashA1Size = FLASH_SIZE, - .lookupTable = - { - // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) - // (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | - // FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - // Read LUTs - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04), - 0, - 0, - - 0x24040405, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000406, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x08180420, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x081804D8, - 0, - 0, - 0, - - 0x08180402, - 0x00002004, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000460, - }, - }, .pageSize = 256u, .sectorSize = 4u * 1024u, .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, .blockSize = 0x00010000, .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x40, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_30MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + // SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + // RADDR_SDR, FLEXSPI_4PAD, 24 bits to transmit ), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + // READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + EMPTY_SEQUENCE, + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x01 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, }; diff --git a/ports/mimxrt10xx/boards/imxrt1060_evk/flash_config.c b/ports/mimxrt10xx/boards/imxrt1060_evk/flash_config.c index 7e046d4940..d79a8d0f91 100644 --- a/ports/mimxrt10xx/boards/imxrt1060_evk/flash_config.c +++ b/ports/mimxrt10xx/boards/imxrt1060_evk/flash_config.c @@ -6,10 +6,10 @@ */ #include "fsl_flexspi_nor_boot.h" -#include "fsl_flexspi_nor_config.h" +#include "boards/board.h" + __attribute__((section(".boot_hdr.ivt"))) - /************************************* * IVT Data *************************************/ @@ -35,88 +35,135 @@ const BOOT_DATA_T boot_data = { 0xFFFFFFFF /* empty - extra data word */ }; +// Config for IS25WP064A with QSPI routed. __attribute__((section(".boot_hdr.conf"))) -// Values copied from https://github.com/PaulStoffregen/cores/blob/ddb23fa5d97dac763bc06e11b9b41f026bd51f0a/teensy4/bootdata.c#L39 const flexspi_nor_config_t qspiflash_config = { - .memConfig = - { - .tag = FLEXSPI_CFG_BLK_TAG, - .version = FLEXSPI_CFG_BLK_VERSION, - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, - .csHoldTime = 1u, - .csSetupTime = 2u, - // Enable DDR mode, Wordaddressable, Safe configuration, Differential clock - .deviceType = kFlexSpiDeviceType_SerialNOR, - .sflashPadType = kSerialFlash_4Pads, - .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 - .sflashA1Size = FLASH_SIZE, - .lookupTable = - { - // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) - // (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | - // FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - // Read LUTs - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04), - 0, - 0, - - 0x24040405, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000406, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x08180420, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x081804D8, - 0, - 0, - 0, - - 0x08180402, - 0x00002004, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000460, - }, - }, .pageSize = 256u, .sectorSize = 4u * 1024u, .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, .blockSize = 0x00010000, .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x40, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_60MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x02), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + EMPTY_SEQUENCE, + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x01 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, }; diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/board.c b/ports/mimxrt10xx/boards/metro_m7_1011/board.c new file mode 100644 index 0000000000..ed543e1b06 --- /dev/null +++ b/ports/mimxrt10xx/boards/metro_m7_1011/board.c @@ -0,0 +1,52 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Artur Pacholec + * + * 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 "boards/board.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 + + // 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); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/flash_config.c b/ports/mimxrt10xx/boards/metro_m7_1011/flash_config.c new file mode 100644 index 0000000000..30ce67523e --- /dev/null +++ b/ports/mimxrt10xx/boards/metro_m7_1011/flash_config.c @@ -0,0 +1,179 @@ +/* + * Copyright 2017 NXP + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "fsl_flexspi_nor_boot.h" +#include "boards/board.h" + + +__attribute__((section(".boot_hdr.ivt"))) +/************************************* + * IVT Data + *************************************/ +const ivt image_vector_table = { + IVT_HEADER, /* IVT Header */ + IMAGE_ENTRY_ADDRESS, /* Image Entry Function */ + IVT_RSVD, /* Reserved = 0 */ + (uint32_t)DCD_ADDRESS, /* Address where DCD information is stored */ + (uint32_t)BOOT_DATA_ADDRESS, /* Address where BOOT Data Structure is stored */ + (uint32_t)&image_vector_table, /* Pointer to IVT Self (absolute address */ + (uint32_t)CSF_ADDRESS, /* Address where CSF file is stored */ + IVT_RSVD /* Reserved = 0 */ +}; + +__attribute__((section(".boot_hdr.boot_data"))) +/************************************* + * Boot Data + *************************************/ +const BOOT_DATA_T boot_data = { + FLASH_BASE, /* boot start location */ + FLASH_SIZE, /* size */ + PLUGIN_FLAG, /* Plugin flag*/ + 0xFFFFFFFF /* empty - extra data word */ +}; + +// Config for W25Q16JV with QSPI routed. +__attribute__((section(".boot_hdr.conf"))) +const flexspi_nor_config_t qspiflash_config = { + .pageSize = 256u, + .sectorSize = 4u * 1024u, + .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, + .blockSize = 0x00010000, + .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x0200, + .configCmdEnable = 1u, + .configModeType[0] = kDeviceConfigCmdType_Generic, + .configCmdSeqs[0] = { + .seqId = 2u, + .seqNum = 1u, + }, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_60MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x02), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x35 /* the command to send */, + DUMMY_SDR, FLEXSPI_1PAD, 8), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x01 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x02), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, +}; diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.h b/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.h new file mode 100644 index 0000000000..b11edb18b4 --- /dev/null +++ b/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.h @@ -0,0 +1,20 @@ +#define MICROPY_HW_BOARD_NAME "Metro MIMXRT1011" +#define MICROPY_HW_MCU_NAME "IMXRT1011DAE5A" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO_00) + +// If you change this, then make sure to update the linker scripts as well to +// make sure you don't overwrite code +#define CIRCUITPY_INTERNAL_NVM_SIZE 0 + +#define BOARD_FLASH_SIZE (2 * 1024 * 1024) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO_02) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO_01) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO_AD_06) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO_AD_04) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO_AD_03) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO_09) +#define DEFAULT_UART_BUS_TX (&pin_GPIO_10) diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.mk b/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.mk new file mode 100644 index 0000000000..8cb150bb4b --- /dev/null +++ b/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.mk @@ -0,0 +1,12 @@ +USB_VID = 0x239A +USB_PID = 0x8092 +USB_PRODUCT = "Metro M7 1011" +USB_MANUFACTURER = "Adafruit" + +CHIP_VARIANT = MIMXRT1011DAE5A +CHIP_FAMILY = MIMXRT1011 +FLASH = W25Q16JV + +# Include these Python libraries in the firmware +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_ESP32SPI +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/pins.c b/ports/mimxrt10xx/boards/metro_m7_1011/pins.c new file mode 100644 index 0000000000..e884934134 --- /dev/null +++ b/ports/mimxrt10xx/boards/metro_m7_1011/pins.c @@ -0,0 +1,59 @@ +#include "shared-bindings/board/__init__.h" + +#include "boards/board.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + // Analog + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO_AD_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO_AD_05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_08) }, + + // Digital + { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_SD_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO_SD_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO_SD_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO_11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO_08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO_07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO_06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D13),MP_ROM_PTR(&pin_GPIO_03) }, + + // ESP control + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_CS), MP_ROM_PTR(&pin_GPIO_AD_14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_GPIO0), MP_ROM_PTR(&pin_GPIO_SD_05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_BUSY), MP_ROM_PTR(&pin_GPIO_AD_11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RESET), MP_ROM_PTR(&pin_GPIO_AD_07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_GPIO_09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_GPIO_10) }, + + // SPI + { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_AD_06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_AD_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_AD_04) }, + + // UART + { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_09) }, + + // I2C + { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_02) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO_00) }, + + { 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_global_dict_table); diff --git a/ports/mimxrt10xx/boards/teensy40/flash_config.c b/ports/mimxrt10xx/boards/teensy40/flash_config.c index 426deb884d..30ce67523e 100644 --- a/ports/mimxrt10xx/boards/teensy40/flash_config.c +++ b/ports/mimxrt10xx/boards/teensy40/flash_config.c @@ -6,12 +6,8 @@ */ #include "fsl_flexspi_nor_boot.h" -#include "fsl_flexspi_nor_config.h" +#include "boards/board.h" -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.xip_device" -#endif __attribute__((section(".boot_hdr.ivt"))) /************************************* @@ -39,88 +35,145 @@ const BOOT_DATA_T boot_data = { 0xFFFFFFFF /* empty - extra data word */ }; +// Config for W25Q16JV with QSPI routed. __attribute__((section(".boot_hdr.conf"))) -// Values copied from https://github.com/PaulStoffregen/cores/blob/ddb23fa5d97dac763bc06e11b9b41f026bd51f0a/teensy4/bootdata.c#L39 const flexspi_nor_config_t qspiflash_config = { - .memConfig = - { - .tag = FLEXSPI_CFG_BLK_TAG, - .version = FLEXSPI_CFG_BLK_VERSION, - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, - .csHoldTime = 1u, - .csSetupTime = 2u, - // Enable DDR mode, Wordaddressable, Safe configuration, Differential clock - .deviceType = kFlexSpiDeviceType_SerialNOR, - .sflashPadType = kSerialFlash_4Pads, - .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 - .sflashA1Size = FLASH_SIZE, - .lookupTable = - { - // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) - // (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | - // FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - // Read LUTs - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04), - 0, - 0, - - 0x24040405, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000406, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x08180420, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x081804D8, - 0, - 0, - 0, - - 0x08180402, - 0x00002004, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000460, - }, - }, .pageSize = 256u, .sectorSize = 4u * 1024u, .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, .blockSize = 0x00010000, .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x0200, + .configCmdEnable = 1u, + .configModeType[0] = kDeviceConfigCmdType_Generic, + .configCmdSeqs[0] = { + .seqId = 2u, + .seqNum = 1u, + }, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_60MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x02), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x35 /* the command to send */, + DUMMY_SDR, FLEXSPI_1PAD, 8), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x01 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x02), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, }; diff --git a/ports/mimxrt10xx/boards/teensy41/flash_config.c b/ports/mimxrt10xx/boards/teensy41/flash_config.c index 426deb884d..7b2bfb768d 100644 --- a/ports/mimxrt10xx/boards/teensy41/flash_config.c +++ b/ports/mimxrt10xx/boards/teensy41/flash_config.c @@ -6,12 +6,8 @@ */ #include "fsl_flexspi_nor_boot.h" -#include "fsl_flexspi_nor_config.h" +#include "boards/board.h" -/* Component ID definition, used by tools. */ -#ifndef FSL_COMPONENT_ID -#define FSL_COMPONENT_ID "platform.drivers.xip_device" -#endif __attribute__((section(".boot_hdr.ivt"))) /************************************* @@ -39,88 +35,135 @@ const BOOT_DATA_T boot_data = { 0xFFFFFFFF /* empty - extra data word */ }; +// Config for W25Q64JV with QSPI routed. __attribute__((section(".boot_hdr.conf"))) -// Values copied from https://github.com/PaulStoffregen/cores/blob/ddb23fa5d97dac763bc06e11b9b41f026bd51f0a/teensy4/bootdata.c#L39 const flexspi_nor_config_t qspiflash_config = { - .memConfig = - { - .tag = FLEXSPI_CFG_BLK_TAG, - .version = FLEXSPI_CFG_BLK_VERSION, - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, - .csHoldTime = 1u, - .csSetupTime = 2u, - // Enable DDR mode, Wordaddressable, Safe configuration, Differential clock - .deviceType = kFlexSpiDeviceType_SerialNOR, - .sflashPadType = kSerialFlash_4Pads, - .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 - .sflashA1Size = FLASH_SIZE, - .lookupTable = - { - // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) - // (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | - // FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - // Read LUTs - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04), - 0, - 0, - - 0x24040405, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000406, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x08180420, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x081804D8, - 0, - 0, - 0, - - 0x08180402, - 0x00002004, - 0, - 0, - - 0, - 0, - 0, - 0, - - 0x00000460, - }, - }, .pageSize = 256u, .sectorSize = 4u * 1024u, .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, .blockSize = 0x00010000, .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x02, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_60MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + EMPTY_SEQUENCE, + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x31 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, }; diff --git a/ports/mimxrt10xx/linking/common.ld b/ports/mimxrt10xx/linking/common.ld index 90fc780933..720361aa0a 100644 --- a/ports/mimxrt10xx/linking/common.ld +++ b/ports/mimxrt10xx/linking/common.ld @@ -62,7 +62,6 @@ SECTIONS KEEP(*(.isr_vector)) /* Startup code */ *(EXCLUDE_FILE( - *flexspi_nor_flash_ops.o *fsl_flexspi.o ) .text*) /* .text* sections (code) */ *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ @@ -84,7 +83,6 @@ SECTIONS { . = ALIGN(4); *(.data*) /* .data* sections */ - *flexspi_nor_flash_ops.o(.text*) *fsl_flexspi.o(.text*) . = ALIGN(4); } > OCRAM AT> FLASH_FIRMWARE @@ -110,7 +108,6 @@ SECTIONS .itcm : { . = ALIGN(4); - *(.itcm.*) . = ALIGN(4); diff --git a/ports/mimxrt10xx/supervisor/flexspi_nor_flash_ops.c b/ports/mimxrt10xx/supervisor/flexspi_nor_flash_ops.c index 28d5115ac7..353ba3176d 100644 --- a/ports/mimxrt10xx/supervisor/flexspi_nor_flash_ops.c +++ b/ports/mimxrt10xx/supervisor/flexspi_nor_flash_ops.c @@ -9,23 +9,10 @@ #include "fsl_flexspi.h" #include "internal_flash.h" +#include "boards/board.h" +#include "supervisor/linker.h" -#define FLASH_QUAD_ENABLE 0x02 -#define FLASH_BUSY_STATUS_POL 1 -#define FLASH_BUSY_STATUS_OFFSET 0 - -static inline void flexspi_clock_init(void) -{ - /* Switch to PLL2 for XIP to avoid hardfault during re-initialize clock. */ - CLOCK_InitSysPfd(kCLOCK_Pfd2, 24); /* Set PLL2 PFD2 clock 396MHZ. */ - CLOCK_SetMux(kCLOCK_FlexspiMux, 0x2); /* Choose PLL2 PFD2 clock as flexspi source clock. */ - CLOCK_SetDiv(kCLOCK_FlexspiDiv, 2); /* flexspi clock 133M. */ -} - -extern flexspi_device_config_t deviceconfig; -extern const uint32_t customLUT[CUSTOM_LUT_LENGTH]; - -status_t flexspi_nor_write_enable(FLEXSPI_Type *base, uint32_t baseAddr) +status_t PLACE_IN_ITCM(flexspi_nor_write_enable)(FLEXSPI_Type *base, uint32_t baseAddr) { flexspi_transfer_t flashXfer; status_t status; @@ -35,14 +22,14 @@ status_t flexspi_nor_write_enable(FLEXSPI_Type *base, uint32_t baseAddr) flashXfer.port = kFLEXSPI_PortA1; flashXfer.cmdType = kFLEXSPI_Command; flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_WRITEENABLE; + flashXfer.seqIndex = ROM_INDEX_WRITEENABLE; status = FLEXSPI_TransferBlocking(base, &flashXfer); return status; } -status_t flexspi_nor_wait_bus_busy(FLEXSPI_Type *base) +status_t PLACE_IN_ITCM(flexspi_nor_wait_bus_busy)(FLEXSPI_Type *base) { /* Wait status ready. */ bool isBusy; @@ -54,7 +41,7 @@ status_t flexspi_nor_wait_bus_busy(FLEXSPI_Type *base) flashXfer.port = kFLEXSPI_PortA1; flashXfer.cmdType = kFLEXSPI_Read; flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_READSTATUSREG; + flashXfer.seqIndex = ROM_INDEX_READSTATUSREG; flashXfer.data = &readValue; flashXfer.dataSize = 1; @@ -66,72 +53,15 @@ status_t flexspi_nor_wait_bus_busy(FLEXSPI_Type *base) { return status; } - if (FLASH_BUSY_STATUS_POL) - { - if (readValue & (1U << FLASH_BUSY_STATUS_OFFSET)) - { - isBusy = true; - } - else - { - isBusy = false; - } - } - else - { - if (readValue & (1U << FLASH_BUSY_STATUS_OFFSET)) - { - isBusy = false; - } - else - { - isBusy = true; - } - } - + size_t busyBit = readValue & (1U << qspiflash_config.memConfig.busyOffset); + isBusy = (qspiflash_config.memConfig.busyBitPolarity == 0 && busyBit != 0) || + (qspiflash_config.memConfig.busyBitPolarity == 1 && busyBit == 0); } while (isBusy); return status; } -status_t flexspi_nor_enable_quad_mode(FLEXSPI_Type *base) -{ - flexspi_transfer_t flashXfer; - status_t status; - uint32_t writeValue = FLASH_QUAD_ENABLE; - - /* Write enable */ - status = flexspi_nor_write_enable(base, 0); - - if (status != kStatus_Success) - { - return status; - } - - /* Enable quad mode. */ - flashXfer.deviceAddress = 0; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Write; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_WRITESTATUSREG; - flashXfer.data = &writeValue; - flashXfer.dataSize = 1; - - status = FLEXSPI_TransferBlocking(base, &flashXfer); - if (status != kStatus_Success) - { - return status; - } - - status = flexspi_nor_wait_bus_busy(base); - - /* Do software reset. */ - FLEXSPI_SoftwareReset(base); - - return status; -} - -status_t flexspi_nor_flash_erase_sector(FLEXSPI_Type *base, uint32_t address) +status_t PLACE_IN_ITCM(flexspi_nor_flash_erase_sector)(FLEXSPI_Type *base, uint32_t address) { status_t status; flexspi_transfer_t flashXfer; @@ -141,7 +71,7 @@ status_t flexspi_nor_flash_erase_sector(FLEXSPI_Type *base, uint32_t address) flashXfer.port = kFLEXSPI_PortA1; flashXfer.cmdType = kFLEXSPI_Command; flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_WRITEENABLE; + flashXfer.seqIndex = ROM_INDEX_WRITEENABLE; status = FLEXSPI_TransferBlocking(base, &flashXfer); @@ -154,7 +84,7 @@ status_t flexspi_nor_flash_erase_sector(FLEXSPI_Type *base, uint32_t address) flashXfer.port = kFLEXSPI_PortA1; flashXfer.cmdType = kFLEXSPI_Command; flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_ERASESECTOR; + flashXfer.seqIndex = ROM_INDEX_ERASESECTOR; status = FLEXSPI_TransferBlocking(base, &flashXfer); if (status != kStatus_Success) @@ -170,7 +100,7 @@ status_t flexspi_nor_flash_erase_sector(FLEXSPI_Type *base, uint32_t address) return status; } -status_t flexspi_nor_flash_program(FLEXSPI_Type *base, uint32_t dstAddr, const uint32_t *src, uint32_t length) +status_t PLACE_IN_ITCM(flexspi_nor_flash_page_program)(FLEXSPI_Type *base, uint32_t dstAddr, const uint32_t *src) { status_t status; flexspi_transfer_t flashXfer; @@ -188,48 +118,7 @@ status_t flexspi_nor_flash_program(FLEXSPI_Type *base, uint32_t dstAddr, const u flashXfer.port = kFLEXSPI_PortA1; flashXfer.cmdType = kFLEXSPI_Write; flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_QUAD; - flashXfer.data = (uint32_t *)src; - flashXfer.dataSize = length; - status = FLEXSPI_TransferBlocking(base, &flashXfer); - - if (status != kStatus_Success) - { - return status; - } - - status = flexspi_nor_wait_bus_busy(base); - - /* Do software reset. */ -#if defined(FSL_FEATURE_SOC_OTFAD_COUNT) - base->AHBCR |= FLEXSPI_AHBCR_CLRAHBRXBUF_MASK | FLEXSPI_AHBCR_CLRAHBTXBUF_MASK; - base->AHBCR &= ~(FLEXSPI_AHBCR_CLRAHBRXBUF_MASK | FLEXSPI_AHBCR_CLRAHBTXBUF_MASK); -#else - FLEXSPI_SoftwareReset(base); -#endif - - return status; -} - -status_t flexspi_nor_flash_page_program(FLEXSPI_Type *base, uint32_t dstAddr, const uint32_t *src) -{ - status_t status; - flexspi_transfer_t flashXfer; - - /* Write enable */ - status = flexspi_nor_write_enable(base, dstAddr); - - if (status != kStatus_Success) - { - return status; - } - - /* Prepare page program command */ - flashXfer.deviceAddress = dstAddr; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Write; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_QUAD; + flashXfer.seqIndex = ROM_INDEX_PAGEPROGRAM; flashXfer.data = (uint32_t *)src; flashXfer.dataSize = FLASH_PAGE_SIZE; status = FLEXSPI_TransferBlocking(base, &flashXfer); @@ -251,92 +140,3 @@ status_t flexspi_nor_flash_page_program(FLEXSPI_Type *base, uint32_t dstAddr, co return status; } - -status_t flexspi_nor_get_vendor_id(FLEXSPI_Type *base, uint8_t *vendorId) -{ - uint32_t temp; - flexspi_transfer_t flashXfer; - flashXfer.deviceAddress = 0; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Read; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_READID; - flashXfer.data = &temp; - flashXfer.dataSize = 1; - - status_t status = FLEXSPI_TransferBlocking(base, &flashXfer); - - *vendorId = temp; - - /* Do software reset. */ -#if defined(FSL_FEATURE_SOC_OTFAD_COUNT) - base->AHBCR |= FLEXSPI_AHBCR_CLRAHBRXBUF_MASK | FLEXSPI_AHBCR_CLRAHBTXBUF_MASK; - base->AHBCR &= ~(FLEXSPI_AHBCR_CLRAHBRXBUF_MASK | FLEXSPI_AHBCR_CLRAHBTXBUF_MASK); -#else - FLEXSPI_SoftwareReset(base); -#endif - - return status; -} - -status_t flexspi_nor_erase_chip(FLEXSPI_Type *base) -{ - status_t status; - flexspi_transfer_t flashXfer; - - /* Write enable */ - status = flexspi_nor_write_enable(base, 0); - - if (status != kStatus_Success) - { - return status; - } - - flashXfer.deviceAddress = 0; - flashXfer.port = kFLEXSPI_PortA1; - flashXfer.cmdType = kFLEXSPI_Command; - flashXfer.SeqNumber = 1; - flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_ERASECHIP; - - status = FLEXSPI_TransferBlocking(base, &flashXfer); - - if (status != kStatus_Success) - { - return status; - } - - status = flexspi_nor_wait_bus_busy(base); - - return status; -} - -void flexspi_nor_flash_init(FLEXSPI_Type *base) -{ - flexspi_config_t config; - - flexspi_clock_init(); - - /*Get FLEXSPI default settings and configure the flexspi. */ - FLEXSPI_GetDefaultConfig(&config); - - /*Set AHB buffer size for reading data through AHB bus. */ - config.ahbConfig.enableAHBPrefetch = true; - config.ahbConfig.enableAHBBufferable = true; - config.ahbConfig.enableReadAddressOpt = true; - config.ahbConfig.enableAHBCachable = true; -#ifdef BOARD_USING_SECONDARY_QSPI_PINMUX - config.rxSampleClock = kFLEXSPI_ReadSampleClkLoopbackInternally; -#else - config.rxSampleClock = kFLEXSPI_ReadSampleClkLoopbackFromDqsPad; -#endif - FLEXSPI_Init(base, &config); - - /* Configure flash settings according to serial flash feature. */ - FLEXSPI_SetFlashConfig(base, &deviceconfig, kFLEXSPI_PortA1); - - /* Update LUT table. */ - FLEXSPI_UpdateLUT(base, 0, customLUT, CUSTOM_LUT_LENGTH); - - /* Do software reset. */ - FLEXSPI_SoftwareReset(base); -} diff --git a/ports/mimxrt10xx/supervisor/internal_flash.c b/ports/mimxrt10xx/supervisor/internal_flash.c index 09f44ccedf..e194cbed96 100644 --- a/ports/mimxrt10xx/supervisor/internal_flash.c +++ b/ports/mimxrt10xx/supervisor/internal_flash.c @@ -30,6 +30,7 @@ #include #include +#include "boards/board.h" #include "extmod/vfs.h" #include "extmod/vfs_fat.h" #include "py/mphal.h" @@ -50,125 +51,14 @@ extern uint32_t __fatfs_flash_length[]; uint8_t _flash_cache[SECTOR_SIZE] __attribute__((aligned(4))); uint32_t _flash_page_addr = NO_CACHE; -static bool init_done = false; - -flexspi_device_config_t deviceconfig = { - .flexspiRootClk = 133000000, - .flashSize = (BOARD_FLASH_SIZE / 1024), - .CSIntervalUnit = kFLEXSPI_CsIntervalUnit1SckCycle, - .CSInterval = 2, - .CSHoldTime = 3, - .CSSetupTime = 3, - .dataValidTime = 0, - .columnspace = 0, - .enableWordAddress = 0, - .AWRSeqIndex = 0, - .AWRSeqNumber = 0, - .ARDSeqIndex = NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD, - .ARDSeqNumber = 1, - .AHBWriteWaitUnit = kFLEXSPI_AhbWriteWaitUnit2AhbCycle, - .AHBWriteWaitInterval = 0, -}; - -const uint32_t customLUT[CUSTOM_LUT_LENGTH] = { - /* Normal read mode -SDR */ - /* Normal read mode -SDR */ - [4 * NOR_CMD_LUT_SEQ_IDX_READ_NORMAL] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x03, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18), - [4 * NOR_CMD_LUT_SEQ_IDX_READ_NORMAL + 1] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x04, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0), - - /* Fast read mode - SDR */ - [4 * NOR_CMD_LUT_SEQ_IDX_READ_FAST] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x0B, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18), - [4 * NOR_CMD_LUT_SEQ_IDX_READ_FAST + 1] = FLEXSPI_LUT_SEQ( - kFLEXSPI_Command_DUMMY_SDR, kFLEXSPI_1PAD, 0x08, kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x04), - - /* Fast read quad mode - SDR */ - [4 * NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0xEB, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_4PAD, 0x18), - [4 * NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD + 1] = FLEXSPI_LUT_SEQ( - kFLEXSPI_Command_DUMMY_SDR, kFLEXSPI_4PAD, 0x06, kFLEXSPI_Command_READ_SDR, kFLEXSPI_4PAD, 0x04), - - /* Read extend parameters */ - [4 * NOR_CMD_LUT_SEQ_IDX_READSTATUS] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x81, kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x04), - - /* Write Enable */ - [4 * NOR_CMD_LUT_SEQ_IDX_WRITEENABLE] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x06, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0), - - /* Erase Sector */ - [4 * NOR_CMD_LUT_SEQ_IDX_ERASESECTOR] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x20, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18), - - /* Page Program - single mode */ - [4 * NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_SINGLE] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x02, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18), - [4 * NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_SINGLE + 1] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_WRITE_SDR, kFLEXSPI_1PAD, 0x04, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0), - - /* Page Program - quad mode */ - [4 * NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_QUAD] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x32, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18), - [4 * NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_QUAD + 1] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_WRITE_SDR, kFLEXSPI_4PAD, 0x04, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0), - - /* Read ID */ - [4 * NOR_CMD_LUT_SEQ_IDX_READID] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x9F, kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x04), - - /* Enable Quad mode */ - [4 * NOR_CMD_LUT_SEQ_IDX_WRITESTATUSREG] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x31, kFLEXSPI_Command_WRITE_SDR, kFLEXSPI_1PAD, 0x04), - - /* Read status register */ - [4 * NOR_CMD_LUT_SEQ_IDX_READSTATUSREG] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x05, kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x04), - - /* Erase whole chip */ - [4 * NOR_CMD_LUT_SEQ_IDX_ERASECHIP] = - FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0xC7, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0), -}; extern status_t flexspi_nor_flash_erase_sector(FLEXSPI_Type *base, uint32_t address); extern status_t flexspi_nor_flash_page_program(FLEXSPI_Type *base, uint32_t dstAddr, const uint32_t *src); -extern status_t flexspi_nor_get_vendor_id(FLEXSPI_Type *base, uint8_t *vendorId); extern status_t flexspi_nor_enable_quad_mode(FLEXSPI_Type *base); -extern status_t flexspi_nor_erase_chip(FLEXSPI_Type *base); -extern void flexspi_nor_flash_init(FLEXSPI_Type *base); -void supervisor_flash_init(void) { - if (init_done) - return; - - SCB_DisableDCache(); - - status_t status; - uint8_t vendorID = 0; - - flexspi_nor_flash_init(FLEXSPI); - - /* Get vendor ID. */ - status = flexspi_nor_get_vendor_id(FLEXSPI, &vendorID); - if (status != kStatus_Success) { - printf("flexspi_nor_get_vendor_id fail %ld\r\n", status); - return; - } - - /* Enter quad mode. */ - __disable_irq(); - status = flexspi_nor_enable_quad_mode(FLEXSPI); - if (status != kStatus_Success) - { - printf("flexspi_nor_enable_quad_mode fail %ld\r\n", status); - return; - } - __enable_irq(); - - SCB_EnableDCache(); - - init_done = true; +void PLACE_IN_ITCM(supervisor_flash_init)(void) { + // Update the LUT to make sure all entries are available. + FLEXSPI_UpdateLUT(FLEXSPI, 0, (const uint32_t*) &qspiflash_config.memConfig.lookupTable, 64); } static inline uint32_t lba2addr(uint32_t block) { @@ -183,7 +73,7 @@ uint32_t supervisor_flash_get_block_count(void) { return CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE; } -void port_internal_flash_flush(void) { +void PLACE_IN_ITCM(port_internal_flash_flush)(void) { if (_flash_page_addr == NO_CACHE) return; status_t status; @@ -211,6 +101,7 @@ void port_internal_flash_flush(void) { DCACHE_CleanInvalidateByRange(_flash_page_addr, SECTOR_SIZE); } + _flash_page_addr = NO_CACHE; } mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { diff --git a/ports/mimxrt10xx/supervisor/internal_flash.h b/ports/mimxrt10xx/supervisor/internal_flash.h index daee66620c..ae33fd134f 100644 --- a/ports/mimxrt10xx/supervisor/internal_flash.h +++ b/ports/mimxrt10xx/supervisor/internal_flash.h @@ -34,20 +34,11 @@ #define INTERNAL_FLASH_SYSTICK_MASK (0x1ff) // 512ms #define INTERNAL_FLASH_IDLE_TICK(tick) (((tick) & INTERNAL_FLASH_SYSTICK_MASK) == 2) -#define CUSTOM_LUT_LENGTH 60 #define FLASH_PAGE_SIZE 256 -#define NOR_CMD_LUT_SEQ_IDX_READ_NORMAL 7 -#define NOR_CMD_LUT_SEQ_IDX_READ_FAST 13 -#define NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD 0 -#define NOR_CMD_LUT_SEQ_IDX_READSTATUS 1 -#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE 2 -#define NOR_CMD_LUT_SEQ_IDX_ERASESECTOR 3 -#define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_SINGLE 6 -#define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_QUAD 4 -#define NOR_CMD_LUT_SEQ_IDX_READID 8 -#define NOR_CMD_LUT_SEQ_IDX_WRITESTATUSREG 9 -#define NOR_CMD_LUT_SEQ_IDX_READSTATUSREG 12 -#define NOR_CMD_LUT_SEQ_IDX_ERASECHIP 5 +#define ROM_INDEX_WRITEENABLE 3 +#define ROM_INDEX_ERASESECTOR 5 +#define ROM_INDEX_PAGEPROGRAM 9 +#define ROM_INDEX_READSTATUSREG 1 #endif // MICROPY_INCLUDED_MIMXRT10XX_INTERNAL_FLASH_H diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 38cf16a494..e3fef373f8 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -72,7 +72,8 @@ #define NO_EXECUTION 1 #define EXECUTION 0 -// Shareable if the memory system manages coherency. +// Shareable if the memory system manages coherency. This means shared between memory bus masters, +// not just CPUs. #define NOT_SHAREABLE 0 #define SHAREABLE 1 @@ -207,9 +208,11 @@ __attribute__((used, naked)) void Reset_Handler(void) { MPU->RBAR = ARM_MPU_RBAR(13, 0x20000000U); MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_32KB); - // This is OCRAM. + // This is OCRAM. We mark it as shareable so that it isn't cached. This makes USB work at the + // cost of 1/4 speed OCRAM accesses. It will leave more room for caching data from the flash + // too which might be a net win. MPU->RBAR = ARM_MPU_RBAR(14, 0x20200000U); - MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_512KB); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_512KB); // We steal 64k from FlexRAM for ITCM and DTCM so disable those memory regions here. MPU->RBAR = ARM_MPU_RBAR(15, 0x20280000U); @@ -322,19 +325,22 @@ void reset_cpu(void) { reset(); } -supervisor_allocation* port_fixed_stack(void) { - return NULL; -} - extern uint32_t _ld_heap_start, _ld_heap_end, _ld_stack_top, _ld_stack_bottom; uint32_t *port_stack_get_limit(void) { - return &_ld_heap_start; + return &_ld_stack_bottom; } uint32_t *port_stack_get_top(void) { return &_ld_stack_top; } +supervisor_allocation _fixed_stack; +supervisor_allocation* port_fixed_stack(void) { + _fixed_stack.ptr = port_stack_get_limit(); + _fixed_stack.length = (port_stack_get_top() - port_stack_get_limit()) * sizeof(uint32_t); + return &_fixed_stack; +} + uint32_t *port_heap_get_bottom(void) { return &_ld_heap_start; } diff --git a/ports/mimxrt10xx/supervisor/usb.c b/ports/mimxrt10xx/supervisor/usb.c index af259405a3..91135289c8 100644 --- a/ports/mimxrt10xx/supervisor/usb.c +++ b/ports/mimxrt10xx/supervisor/usb.c @@ -50,10 +50,6 @@ void init_usb_hardware(void) { phytx &= ~(USBPHY_TX_D_CAL_MASK | USBPHY_TX_TXCAL45DM_MASK | USBPHY_TX_TXCAL45DP_MASK); phytx |= USBPHY_TX_D_CAL(0x0C) | USBPHY_TX_TXCAL45DP(0x06) | USBPHY_TX_TXCAL45DM(0x06); usb_phy->TX = phytx; - - // Temporarily disable the data cache until we can sort out all of the spots in TinyUSB that - // need the cache invalidated or cleaned. - SCB_DisableDCache(); } void USB_OTG1_IRQHandler(void) { diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c index 8e12dd3625..ef686cbabe 100644 --- a/supervisor/shared/background_callback.c +++ b/supervisor/shared/background_callback.c @@ -29,6 +29,7 @@ #include "py/gc.h" #include "py/mpconfig.h" #include "supervisor/background_callback.h" +#include "supervisor/linker.h" #include "supervisor/shared/tick.h" #include "shared-bindings/microcontroller/__init__.h" @@ -63,7 +64,7 @@ void background_callback_add(background_callback_t *cb, background_callback_fun } static bool in_background_callback; -void background_callback_run_all() { +void PLACE_IN_ITCM(background_callback_run_all)() { if (!callback_head) { return; } diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c index f6b94e38b5..88603be0c0 100644 --- a/supervisor/shared/filesystem.c +++ b/supervisor/shared/filesystem.c @@ -105,13 +105,19 @@ void filesystem_init(bool create_allowed, bool force_create) { // set label #ifdef CIRCUITPY_DRIVE_LABEL - f_setlabel(&vfs_fat->fatfs, CIRCUITPY_DRIVE_LABEL); + res = f_setlabel(&vfs_fat->fatfs, CIRCUITPY_DRIVE_LABEL); #else - f_setlabel(&vfs_fat->fatfs, "CIRCUITPY"); + res = f_setlabel(&vfs_fat->fatfs, "CIRCUITPY"); #endif + if (res != FR_OK) { + return; + } // inhibit file indexing on MacOS - f_mkdir(&vfs_fat->fatfs, "/.fseventsd"); + res = f_mkdir(&vfs_fat->fatfs, "/.fseventsd"); + if (res != FR_OK) { + return; + } 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"); @@ -119,7 +125,10 @@ void filesystem_init(bool create_allowed, bool force_create) { make_sample_code_file(&vfs_fat->fatfs); // create empty lib directory - f_mkdir(&vfs_fat->fatfs, "/lib"); + res = f_mkdir(&vfs_fat->fatfs, "/lib"); + if (res != FR_OK) { + return; + } // and ensure everything is flushed supervisor_flash_flush(); diff --git a/supervisor/shared/flash.c b/supervisor/shared/flash.c index 9f52ddbc48..1e09fe14b3 100644 --- a/supervisor/shared/flash.c +++ b/supervisor/shared/flash.c @@ -88,9 +88,6 @@ static void build_partition(uint8_t *buf, int boot, int type, uint32_t start_blo mp_uint_t flash_read_blocks(uint8_t *dest, uint32_t block_num, uint32_t num_blocks) { if (block_num == 0) { - if (num_blocks > 1) { - return 1; // error - } // fake the MBR so we can decide on our own partition table for (int i = 0; i < 446; i++) { @@ -104,9 +101,13 @@ mp_uint_t flash_read_blocks(uint8_t *dest, uint32_t block_num, uint32_t num_bloc dest[510] = 0x55; dest[511] = 0xaa; - - return 0; // ok - + if (num_blocks > 1) { + dest += 512; + num_blocks -= 1; + // Fall through and do a read from flash. + } else { + return 0; // Done and ok. + } } return supervisor_flash_read_blocks(dest, block_num - PART1_START_BLOCK, num_blocks); } @@ -159,16 +160,37 @@ STATIC mp_obj_t supervisor_flash_obj_writeblocks(mp_obj_t self, mp_obj_t block_n } STATIC MP_DEFINE_CONST_FUN_OBJ_3(supervisor_flash_obj_writeblocks_obj, supervisor_flash_obj_writeblocks); +bool flash_ioctl(size_t cmd, mp_int_t* out_value) { + *out_value = 0; + switch (cmd) { + case BP_IOCTL_INIT: + supervisor_flash_init(); + break; + case BP_IOCTL_DEINIT: + supervisor_flash_flush(); + break; // TODO properly + case BP_IOCTL_SYNC: + supervisor_flash_flush(); + break; + case BP_IOCTL_SEC_COUNT: + *out_value = flash_get_block_count(); + break; + case BP_IOCTL_SEC_SIZE: + *out_value = supervisor_flash_get_block_size(); + break; + default: + return false; + } + return true; +} + STATIC mp_obj_t supervisor_flash_obj_ioctl(mp_obj_t self, mp_obj_t cmd_in, mp_obj_t arg_in) { mp_int_t cmd = mp_obj_get_int(cmd_in); - switch (cmd) { - case BP_IOCTL_INIT: supervisor_flash_init(); return MP_OBJ_NEW_SMALL_INT(0); - case BP_IOCTL_DEINIT: supervisor_flash_flush(); return MP_OBJ_NEW_SMALL_INT(0); // TODO properly - case BP_IOCTL_SYNC: supervisor_flash_flush(); return MP_OBJ_NEW_SMALL_INT(0); - case BP_IOCTL_SEC_COUNT: return MP_OBJ_NEW_SMALL_INT(flash_get_block_count()); - case BP_IOCTL_SEC_SIZE: return MP_OBJ_NEW_SMALL_INT(supervisor_flash_get_block_size()); - default: return mp_const_none; + mp_int_t out_value; + if (flash_ioctl(cmd, &out_value)) { + return MP_OBJ_NEW_SMALL_INT(out_value); } + return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_3(supervisor_flash_obj_ioctl_obj, supervisor_flash_obj_ioctl); @@ -200,4 +222,5 @@ void supervisor_flash_init_vfs(fs_user_mount_t *vfs) { vfs->writeblocks[2] = (mp_obj_t)flash_write_blocks; // native version vfs->u.ioctl[0] = (mp_obj_t)&supervisor_flash_obj_ioctl_obj; vfs->u.ioctl[1] = (mp_obj_t)&supervisor_flash_obj; + vfs->u.ioctl[2] = (mp_obj_t)flash_ioctl; // native version } From ef42d6bb6caaab8599fe0ac6211eca444ca109f1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 7 Oct 2020 16:12:07 -0700 Subject: [PATCH 1082/1293] Update USB PID --- ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.mk b/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.mk index 8cb150bb4b..1a3f7e766c 100644 --- a/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.mk +++ b/ports/mimxrt10xx/boards/metro_m7_1011/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x8092 +USB_PID = 0x80E2 USB_PRODUCT = "Metro M7 1011" USB_MANUFACTURER = "Adafruit" From 9fcf96cb645d726cd4c80b9cce438f1633dab95f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 7 Oct 2020 17:11:32 -0700 Subject: [PATCH 1083/1293] Replace _bleio.ConnectionError with the native version Replace uses of _bleio.ConnectionError with regular ConnectionError Fixes #3008 --- ports/nrf/common-hal/_bleio/__init__.c | 4 ++-- shared-bindings/_bleio/CharacteristicBuffer.c | 2 +- shared-bindings/_bleio/Connection.c | 2 +- shared-bindings/_bleio/PacketBuffer.c | 2 +- shared-bindings/_bleio/__init__.c | 15 +-------------- shared-bindings/_bleio/__init__.h | 2 -- 6 files changed, 6 insertions(+), 21 deletions(-) diff --git a/ports/nrf/common-hal/_bleio/__init__.c b/ports/nrf/common-hal/_bleio/__init__.c index 496c9429fe..5293f7ad14 100644 --- a/ports/nrf/common-hal/_bleio/__init__.c +++ b/ports/nrf/common-hal/_bleio/__init__.c @@ -50,7 +50,7 @@ void check_nrf_error(uint32_t err_code) { mp_raise_msg(&mp_type_TimeoutError, NULL); return; case BLE_ERROR_INVALID_CONN_HANDLE: - mp_raise_bleio_ConnectionError(translate("Not connected")); + mp_raise_ConnectionError(translate("Not connected")); return; default: mp_raise_bleio_BluetoothError(translate("Unknown soft device error: %04x"), err_code); @@ -115,7 +115,7 @@ bleio_adapter_obj_t common_hal_bleio_adapter_obj = { void common_hal_bleio_check_connected(uint16_t conn_handle) { if (conn_handle == BLE_CONN_HANDLE_INVALID) { - mp_raise_bleio_ConnectionError(translate("Not connected")); + mp_raise_ConnectionError(translate("Not connected")); } } diff --git a/shared-bindings/_bleio/CharacteristicBuffer.c b/shared-bindings/_bleio/CharacteristicBuffer.c index 7bcbc807e6..4d6c836c13 100644 --- a/shared-bindings/_bleio/CharacteristicBuffer.c +++ b/shared-bindings/_bleio/CharacteristicBuffer.c @@ -37,7 +37,7 @@ STATIC void raise_error_if_not_connected(bleio_characteristic_buffer_obj_t *self) { if (!common_hal_bleio_characteristic_buffer_connected(self)) { - mp_raise_bleio_ConnectionError(translate("Not connected")); + mp_raise_ConnectionError(translate("Not connected")); } } diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index b5eeaa9069..fe82af098f 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -63,7 +63,7 @@ void bleio_connection_ensure_connected(bleio_connection_obj_t *self) { if (!common_hal_bleio_connection_get_connected(self)) { - mp_raise_bleio_ConnectionError(translate("Connection has been disconnected and can no longer be used. Create a new connection.")); + mp_raise_ConnectionError(translate("Connection has been disconnected and can no longer be used. Create a new connection.")); } } diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index 8c8970939a..f2a3cbce07 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -161,7 +161,7 @@ STATIC mp_obj_t bleio_packet_buffer_write(mp_uint_t n_args, const mp_obj_t *pos_ // gatts write events, which may not have been sent yet. // // IDEAL: - // mp_raise_bleio_ConnectionError(translate("Not connected")); + // mp_raise_ConnectionError(translate("Not connected")); // TEMPORARY: num_bytes_written = 0; } diff --git a/shared-bindings/_bleio/__init__.c b/shared-bindings/_bleio/__init__.c index 3d9084dd53..2ef70a64f7 100644 --- a/shared-bindings/_bleio/__init__.c +++ b/shared-bindings/_bleio/__init__.c @@ -63,7 +63,6 @@ //| """Catchall exception for Bluetooth related errors.""" //| ... MP_DEFINE_BLEIO_EXCEPTION(BluetoothError, Exception) - NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* fmt, ...) { va_list argptr; va_start(argptr,fmt); @@ -71,18 +70,6 @@ NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* fmt, ...) va_end(argptr); nlr_raise(exception); } -//| class ConnectionError(BluetoothError): -//| """Raised when a connection is unavailable.""" -//| ... -//| -MP_DEFINE_BLEIO_EXCEPTION(ConnectionError, bleio_BluetoothError) -NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* fmt, ...) { - va_list argptr; - va_start(argptr,fmt); - mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_bleio_ConnectionError, fmt, argptr); - va_end(argptr); - nlr_raise(exception); -} //| class RoleError(BluetoothError): //| """Raised when a resource is used as the mismatched role. For example, if a local CCCD is @@ -93,6 +80,7 @@ MP_DEFINE_BLEIO_EXCEPTION(RoleError, bleio_BluetoothError) NORETURN void mp_raise_bleio_RoleError(const compressed_string_t* msg) { mp_raise_msg(&mp_type_bleio_RoleError, msg); } + //| class SecurityError(BluetoothError): //| """Raised when a security related error occurs.""" //| ... @@ -183,7 +171,6 @@ STATIC const mp_rom_map_elem_t bleio_module_globals_table[] = { // Errors { MP_ROM_QSTR(MP_QSTR_BluetoothError), OBJ_FROM_PTR(&mp_type_bleio_BluetoothError) }, - { MP_ROM_QSTR(MP_QSTR_ConnectionError), OBJ_FROM_PTR(&mp_type_bleio_ConnectionError) }, { MP_ROM_QSTR(MP_QSTR_RoleError), OBJ_FROM_PTR(&mp_type_bleio_RoleError) }, { MP_ROM_QSTR(MP_QSTR_SecurityError), OBJ_FROM_PTR(&mp_type_bleio_SecurityError) }, diff --git a/shared-bindings/_bleio/__init__.h b/shared-bindings/_bleio/__init__.h index 588b1f1973..65ba9b3a5d 100644 --- a/shared-bindings/_bleio/__init__.h +++ b/shared-bindings/_bleio/__init__.h @@ -51,14 +51,12 @@ const mp_obj_type_t mp_type_bleio_ ## exc_name = { \ }; extern const mp_obj_type_t mp_type_bleio_BluetoothError; -extern const mp_obj_type_t mp_type_bleio_ConnectionError; extern const mp_obj_type_t mp_type_bleio_RoleError; extern const mp_obj_type_t mp_type_bleio_SecurityError; extern mp_obj_t bleio_set_adapter(mp_obj_t adapter_obj); NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* msg, ...); -NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* msg, ...); NORETURN void mp_raise_bleio_RoleError(const compressed_string_t* msg); NORETURN void mp_raise_bleio_SecurityError(const compressed_string_t* msg, ...); From d93a1961c4dc3f0bc02b79b6ac116638a4f64794 Mon Sep 17 00:00:00 2001 From: Seon Rozenblum Date: Thu, 8 Oct 2020 14:03:16 +1100 Subject: [PATCH 1084/1293] Fixed the FeatherS2 prerelease hardware name --- .../boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h index 90a368006a..93d901becb 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h @@ -26,7 +26,7 @@ //Micropython setup -#define MICROPY_HW_BOARD_NAME "FeatherS2" +#define MICROPY_HW_BOARD_NAME "FeatherS2 PreRelease" #define MICROPY_HW_MCU_NAME "ESP32S2" #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) From e1fc85c56bb5e308d497c09eca8154243f85a83c Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 8 Oct 2020 13:30:32 +0700 Subject: [PATCH 1085/1293] fix usb issue with latest idf --- ports/esp32s2/Makefile | 6 +++--- ports/esp32s2/supervisor/usb.c | 34 ++++++++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index f8818eca01..935ced7cc0 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -271,7 +271,7 @@ menuconfig: $(BUILD)/esp-idf/config $(HEADER_BUILD)/qstr.i.last: | $(BUILD)/esp-idf/config/sdkconfig.h # Order here matters -ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip esp_rom esp-tls +ESP_IDF_COMPONENTS_LINK = freertos log hal esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip esp_rom esp-tls ESP_IDF_COMPONENTS_INCLUDE = driver freertos log soc @@ -283,11 +283,11 @@ ESP_IDF_WIFI_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_WIFI_COMPONENT MBEDTLS_COMPONENTS_LINK = crypto tls x509 MBEDTLS_COMPONENTS_LINK_EXPANDED = $(foreach component, $(MBEDTLS_COMPONENTS_LINK), $(BUILD)/esp-idf/esp-idf/mbedtls/mbedtls/library/libmbed$(component).a) -BINARY_BLOBS = esp-idf/components/xtensa/esp32s2/libhal.a +BINARY_BLOBS = esp-idf/components/xtensa/esp32s2/libxt_hal.a BINARY_WIFI_BLOBS = libcoexist.a libcore.a libespnow.a libmesh.a libnet80211.a libpp.a librtc.a libsmartconfig.a libphy.a BINARY_BLOBS += $(addprefix esp-idf/components/esp_wifi/lib/esp32s2/, $(BINARY_WIFI_BLOBS)) -ESP_IDF_COMPONENTS_EXPANDED += $(BUILD)/esp-idf/esp-idf/soc/soc/esp32s2/libsoc_esp32s2.a esp-idf/components/xtensa/esp32s2/libhal.a +ESP_IDF_COMPONENTS_EXPANDED += $(BUILD)/esp-idf/esp-idf/soc/soc/esp32s2/libsoc_esp32s2.a esp-idf/components/xtensa/esp32s2/libxt_hal.a ESP_AUTOGEN_LD = $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld $(BUILD)/esp-idf/esp-idf/esp32s2/ld/esp32s2.project.ld FLASH_FLAGS = --flash_mode $(CIRCUITPY_ESP_FLASH_MODE) --flash_freq $(CIRCUITPY_ESP_FLASH_FREQ) --flash_size $(CIRCUITPY_ESP_FLASH_SIZE) diff --git a/ports/esp32s2/supervisor/usb.c b/ports/esp32s2/supervisor/usb.c index c91c2ec4b0..1ad6af0470 100644 --- a/ports/esp32s2/supervisor/usb.c +++ b/ports/esp32s2/supervisor/usb.c @@ -33,6 +33,8 @@ #include "components/driver/include/driver/periph_ctrl.h" #include "components/driver/include/driver/gpio.h" #include "components/esp_rom/include/esp32s2/rom/gpio.h" +#include "components/esp_rom/include/esp_rom_gpio.h" +#include "components/hal/esp32s2/include/hal/gpio_ll.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" @@ -68,6 +70,33 @@ void usb_device_task(void* param) } } +static void configure_pins (usb_hal_context_t *usb) +{ + /* usb_periph_iopins currently configures USB_OTG as USB Device. + * Introduce additional parameters in usb_hal_context_t when adding support + * for USB Host. + */ + for ( const usb_iopin_dsc_t *iopin = usb_periph_iopins; iopin->pin != -1; ++iopin ) { + if ( (usb->use_external_phy) || (iopin->ext_phy_only == 0) ) { + esp_rom_gpio_pad_select_gpio(iopin->pin); + if ( iopin->is_output ) { + esp_rom_gpio_connect_out_signal(iopin->pin, iopin->func, false, false); + } + else { + esp_rom_gpio_connect_in_signal(iopin->pin, iopin->func, false); + if ( (iopin->pin != GPIO_FUNC_IN_LOW) && (iopin->pin != GPIO_FUNC_IN_HIGH) ) { + gpio_ll_input_enable(&GPIO, iopin->pin); + } + } + esp_rom_gpio_pad_unhold(iopin->pin); + } + } + if ( !usb->use_external_phy ) { + gpio_set_drive_capability(USBPHY_DM_NUM, GPIO_DRIVE_CAP_3); + gpio_set_drive_capability(USBPHY_DP_NUM, GPIO_DRIVE_CAP_3); + } +} + void init_usb_hardware(void) { periph_module_reset(PERIPH_USB_MODULE); periph_module_enable(PERIPH_USB_MODULE); @@ -75,10 +104,7 @@ void init_usb_hardware(void) { .use_external_phy = false // use built-in PHY }; usb_hal_init(&hal); - - // Initialize the pin drive strength. - gpio_set_drive_capability(USBPHY_DM_NUM, GPIO_DRIVE_CAP_3); - gpio_set_drive_capability(USBPHY_DP_NUM, GPIO_DRIVE_CAP_3); + configure_pins(&hal); (void) xTaskCreateStatic(usb_device_task, "usbd", From 10b5ab1058f30c7090dd7d892af08ea5e07cf92d Mon Sep 17 00:00:00 2001 From: oon arfiandwi Date: Wed, 7 Oct 2020 01:38:24 +0000 Subject: [PATCH 1086/1293] Translated using Weblate (Indonesian) Currently translated at 42.0% (349 of 829 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/id/ --- locale/ID.po | 65 +++++++++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index f6cd07a8cb..cff2a24656 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-29 20:14-0500\n" -"PO-Revision-Date: 2020-07-06 18:10+0000\n" +"PO-Revision-Date: 2020-10-07 17:22+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" "Language: ID\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.2-dev\n" +"X-Generator: Weblate 4.3-dev\n" #: main.c msgid "" @@ -1218,32 +1218,32 @@ msgstr "Kesalahan fatal MicroPython." #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" -msgstr "" +msgstr "Penundaan mulai mikrofon harus dalam kisaran 0,0 hingga 1,0" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" -msgstr "" +msgstr "Tidak menemukan Pin MISO atau MOSI" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." -msgstr "" +msgstr "Harus berupa subclass %q." #: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" -msgstr "" +msgstr "Harus menyediakan pin MISO atau MOSI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" -msgstr "" +msgstr "Harus menggunakan kelipatan 6 pin rgb, bukan %d" #: py/parse.c msgid "Name too long" -msgstr "" +msgstr "Nama terlalu panjang" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" -msgstr "" +msgstr "Tidak ada CCCD untuk Karakteristik ini" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c @@ -1258,12 +1258,12 @@ msgstr "tidak ada channel DMA ditemukan" #: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" -msgstr "" +msgstr "Tidak ada Pin MISO" #: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" -msgstr "" +msgstr "Tidak ada Pin MOSI" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c @@ -1281,11 +1281,11 @@ msgstr "Tidak ada pin TX" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "No available clocks" -msgstr "" +msgstr "Tidak ada clocks yang tersedia" #: shared-bindings/_bleio/PacketBuffer.c msgid "No connection: length cannot be determined" -msgstr "" +msgstr "Tidak ada koneksi: panjang tidak dapat ditentukan" #: shared-bindings/board/__init__.c msgid "No default %q bus" @@ -1297,11 +1297,11 @@ msgstr "Tidak ada GCLK yang kosong" #: shared-bindings/os/__init__.c msgid "No hardware random available" -msgstr "" +msgstr "Tidak ada perangkat keras acak yang tersedia" #: ports/atmel-samd/common-hal/ps2io/Ps2.c msgid "No hardware support on clk pin" -msgstr "" +msgstr "Tidak ada dukungan perangkat keras pada pin clk" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -1310,11 +1310,11 @@ msgstr "Tidak ada dukungan hardware untuk pin" #: shared-bindings/aesio/aes.c msgid "No key was specified" -msgstr "" +msgstr "Tidak ada kunci yang ditentukan" #: shared-bindings/time/__init__.c msgid "No long integer support" -msgstr "" +msgstr "Tidak ada dukungan bilangan bulat yang panjang" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more channels available" @@ -1326,7 +1326,7 @@ msgstr "" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." -msgstr "" +msgstr "Tidak ada lagi penghitung waktu yang tersedia pada pin ini." #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" @@ -1334,23 +1334,23 @@ msgstr "" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" -msgstr "" +msgstr "Tidak ada pull-down pada pin; 1Mohm direkomendasikan" #: py/moduerrno.c msgid "No space left on device" -msgstr "" +msgstr "Tidak ada ruang yang tersisa di perangkat" #: py/moduerrno.c msgid "No such file/directory" -msgstr "" +msgstr "Tidak ada file/direktori" #: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" -msgstr "" +msgstr "Penghitung waktu tidak tersedia" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." -msgstr "" +msgstr "Pernyataan kegagalan Perangkat Lunak Nordic." #: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c msgid "Not a valid IP string" @@ -1365,7 +1365,7 @@ msgstr "Tidak dapat menyambungkan ke AP" #: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c #: shared-bindings/audiopwmio/PWMAudioOut.c msgid "Not playing" -msgstr "" +msgstr "Tidak berfungsi" #: main.c msgid "Not running saved code.\n" @@ -1379,6 +1379,7 @@ msgstr "" msgid "" "Object has been deinitialized and can no longer be used. Create a new object." msgstr "" +"Objek telah dideinisialisasi dan tidak dapat lagi digunakan. Buat objek baru." #: ports/nrf/common-hal/busio/UART.c msgid "Odd parity is not supported" @@ -1401,6 +1402,8 @@ msgstr "" msgid "" "Only Windows format, uncompressed BMP supported: given header size is %d" msgstr "" +"Hanya format Windows, mendukung BMP tidak dikompresi: ukuran header yang " +"diberikan adalah %d" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1408,6 +1411,8 @@ msgid "" "Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " "%d bpp given" msgstr "" +"Hanya monokrom, 4bpp atau 8bpp yang diindeks, dan 16bpp atau lebih yang " +"didukung: %d bpp diberikan" #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" @@ -1419,27 +1424,29 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." -msgstr "" +msgstr "Sampel berlebihan harus kelipatan 8." #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "" +msgstr "PWM duty_cycle harus antara 0 dan 65535 inklusif (resolusi 16 bit)" #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +"Frekuensi PWM tidak dapat ditulis ketika variabel_frequency Salah pada " +"konstruksi." #: ports/esp32s2/common-hal/displayio/ParallelBus.c #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" -msgstr "" +msgstr "ParallelBus belum didukung" #: py/moduerrno.c msgid "Permission denied" -msgstr "" +msgstr "Izin ditolak" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c @@ -1455,7 +1462,7 @@ msgstr "" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" -msgstr "" +msgstr "Pin harus mendukung interupsi perangkat keras" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" From e0f6d883f57aeee1b8785c500096fe96113adbf9 Mon Sep 17 00:00:00 2001 From: oon arfiandwi Date: Thu, 8 Oct 2020 15:03:19 +0000 Subject: [PATCH 1087/1293] Translated using Weblate (Indonesian) Currently translated at 43.9% (364 of 829 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/id/ --- locale/ID.po | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index cff2a24656..2ad8acd9b0 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-29 20:14-0500\n" -"PO-Revision-Date: 2020-10-07 17:22+0000\n" +"PO-Revision-Date: 2020-10-08 16:22+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" "Language: ID\n" @@ -1466,7 +1466,7 @@ msgstr "Pin harus mendukung interupsi perangkat keras" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" -msgstr "" +msgstr "Nomor pin sudah dipesan oleh EXTI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1475,6 +1475,9 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" +"Pinout menggunakan %d byte per elemen, yang mengonsumsi lebih dari %d byte " +"ideal. Jika ini tidak dapat dihindari, berikan allow_inefficient=True ke " +"konstruktor" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" @@ -1501,7 +1504,7 @@ msgstr "" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" -msgstr "" +msgstr "Buffer awalan harus ada di heap" #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." @@ -1511,43 +1514,43 @@ msgstr "" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." -msgstr "" +msgstr "Pull tidak digunakan saat arah output." #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" -msgstr "" +msgstr "Kesalahan DeInit RNG" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" -msgstr "" +msgstr "Kesalahan Init RNG" #: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" -msgstr "" +msgstr "Pembalikan RS485 ditentukan saat tidak dalam mode RS485" #: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c #: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" -msgstr "" +msgstr "Kalibrasi RTC tidak didukung pada board ini" #: shared-bindings/time/__init__.c msgid "RTC is not supported on this board" -msgstr "" +msgstr "RTC tidak didukung di board ini" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" +msgstr "RTS/CTS/RS485 Belum didukung pada perangkat ini" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" -msgstr "" +msgstr "Kesalahan pembuatan nomor acak" #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" -msgstr "" +msgstr "Baca-saja" #: extmod/vfs_fat.c py/moduerrno.c msgid "Read-only filesystem" @@ -1560,7 +1563,7 @@ msgstr "sistem file (filesystem) bersifat Read-only" #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" -msgstr "" +msgstr "Segarkan terlalu cepat" #: shared-bindings/canio/RemoteTransmissionRequest.c msgid "RemoteTransmissionRequests limited to 8 bytes" @@ -1568,7 +1571,7 @@ msgstr "" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" -msgstr "" +msgstr "Mode AES yang diminta tidak didukung" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" @@ -1576,7 +1579,7 @@ msgstr "Channel Kanan tidak didukung" #: shared-bindings/_pew/PewPew.c msgid "Row entry must be digitalio.DigitalInOut" -msgstr "" +msgstr "Entri baris harus digitalio.DigitalInOut" #: main.c msgid "Running in safe mode! " From 860bba05550a08751870446d6c4dafe6af46a2a8 Mon Sep 17 00:00:00 2001 From: hexthat Date: Thu, 8 Oct 2020 02:26:21 +0000 Subject: [PATCH 1088/1293] Translated using Weblate (Chinese (Pinyin)) Currently translated at 99.8% (828 of 829 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/zh_Latn/ --- locale/zh_Latn_pinyin.po | 144 ++++++++++++++++++++------------------- 1 file changed, 73 insertions(+), 71 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 6e65fa13a0..32af6c2c6f 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,14 +7,15 @@ msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-29 20:14-0500\n" -"PO-Revision-Date: 2019-04-13 10:10-0700\n" -"Last-Translator: hexthat\n" +"PO-Revision-Date: 2020-10-08 16:22+0000\n" +"Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" -"Language: zh\n" +"Language: zh_Latn_pinyin\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.2.1\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 4.3-dev\n" #: main.c msgid "" @@ -99,7 +100,7 @@ msgstr "%q bìxū shì chángdù wèi 2 de yuán zǔ" #: shared-bindings/canio/Match.c msgid "%q out of range" -msgstr "" +msgstr "%q chāochū fànwéi" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" @@ -119,7 +120,7 @@ msgstr "xūyào '%q' cānshù" #: py/runtime.c msgid "'%q' object cannot assign attribute '%q'" -msgstr "'%q' duì xiàng wú fǎ fēn pèi shǔ xìng '%q'" +msgstr "'%q' duì xiàng wú fǎ fēn pèi shǔ xìng '%q'" #: py/proto.c msgid "'%q' object does not support '%q'" @@ -291,7 +292,7 @@ msgstr "Suǒyǒu I2C wàiwéi qì zhèngzài shǐyòng" #: ports/atmel-samd/common-hal/canio/Listener.c msgid "All RX FIFOs in use" -msgstr "" +msgstr "Suǒyǒu shǐyòng zhōng de RX FIFO" #: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" @@ -330,11 +331,11 @@ msgstr "Suǒyǒu jìshí qì shǐyòng" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." -msgstr "Mùqián zhèngzài guǎngbò" +msgstr "Mùqián zhèngzài guǎngbò." #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Already have all-matches listener" -msgstr "" +msgstr "yǐ jù yǒu quán pǐ pèi zhēn tīng qì" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c @@ -343,7 +344,7 @@ msgstr "yǐ zài yùn xíng" #: ports/esp32s2/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" -msgstr "" +msgstr "yǐ jīng sǎo miáo WIFI wǎng luò" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -391,7 +392,7 @@ msgstr "MicroPython VM zài wèi yùnxíng shí chángshì fēnpèi duī." #: shared-bindings/wifi/Radio.c msgid "Authentication failure" -msgstr "" +msgstr "shēn fèn yàn zhèng shī bài" #: main.c msgid "Auto-reload is off.\n" @@ -454,7 +455,7 @@ msgstr "Huǎnchōng qū dàxiǎo bù zhèngquè. Yīnggāi shì %d zì jié." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "Huǎnchōng qū bùshì bytearray" +msgstr "Huǎnchōng qū bùshì bytearray." #: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c @@ -508,7 +509,7 @@ msgstr "CBC kuài bì xū shì 16 zì jié de bèi shù" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "Zài fǎngwèn běn jī wùjiàn zhīqián diàoyòng super().__init__()" +msgstr "Zài fǎngwèn běn jī wùjiàn zhīqián diàoyòng super().__init__()." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" @@ -516,7 +517,7 @@ msgstr "Wúfǎ jiāng CCCD shèzhì wéi běndì tèzhēng" #: shared-bindings/_bleio/Adapter.c msgid "Cannot create a new Adapter; use _bleio.adapter;" -msgstr "" +msgstr "Wúfǎ chuàngjiàn xīn de shìpèiqì; shǐyòng_bleio.Adapter;" #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c @@ -607,7 +608,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "CircuitPython was unable to allocate the heap.\n" -msgstr "" +msgstr "CircuitPython wúfǎ fēnpèi duī.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." @@ -646,7 +647,7 @@ msgstr "Sǔnhuài de yuánshǐ dàimǎ" #: ports/cxd56/common-hal/camera/Camera.c msgid "Could not initialize Camera" -msgstr "" +msgstr "Wúfǎ chūshǐhuà xiàngjī" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" @@ -683,7 +684,7 @@ msgstr "Wúfǎ chóngqǐ PWM" #: ports/esp32s2/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" -msgstr "" +msgstr "Wúfǎ huòqǔ shízhōng" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" @@ -777,7 +778,7 @@ msgstr "ECB yí cì zhǐ shǐ yòng 16 gè zì jié" #: ports/esp32s2/common-hal/busio/SPI.c msgid "ESP-IDF memory allocation failed" -msgstr "" +msgstr "ESP-IDF nèicún fēnpèi shībài" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -804,7 +805,7 @@ msgstr "Yùqí de tèdiǎn" #: shared-bindings/_bleio/Adapter.c msgid "Expected a DigitalInOut" -msgstr "" +msgstr "yù qī shù zì huà" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" @@ -812,7 +813,7 @@ msgstr "Yùqí fúwù" #: shared-bindings/_bleio/Adapter.c msgid "Expected a UART" -msgstr "" +msgstr "qī dài UART" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c @@ -838,7 +839,7 @@ msgstr "FFT jǐn wéi ndarrays dìng yì" #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" -msgstr "" +msgstr "SSL wòshǒu shībài" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." @@ -865,11 +866,11 @@ msgstr "Fēnpèi RX huǎnchōng qū%d zì jié shībài" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" -msgstr "" +msgstr "Wúfǎ fēnpèi Wifi nèicún" #: ports/esp32s2/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" -msgstr "" +msgstr "Wúfǎ fēnpèi wifi sǎomiáo nèicún" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" @@ -881,7 +882,7 @@ msgstr "Liánjiē shībài: Chāoshí" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to init wifi" -msgstr "" +msgstr "Wúfǎ chūshǐhuà wifi" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" @@ -902,11 +903,11 @@ msgstr "Wénjiàn cúnzài" #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Filters too complex" -msgstr "" +msgstr "guò lǜ qì tài fù zá" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" -msgstr "" +msgstr "Bù zhīyuán géshì" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format @@ -976,7 +977,7 @@ msgstr "Huǎnchōng qū dàxiǎo bù zhèngquè" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" -msgstr "" +msgstr "Shūrù shíjiānguò zhǎng" #: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" @@ -1023,7 +1024,7 @@ msgstr "Wúxiào de BMP wénjiàn" #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" -msgstr "" +msgstr "Wúxiào de BSSID" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" @@ -1073,7 +1074,7 @@ msgstr "Géshì kuài dàxiǎo wúxiào" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "Invalid frequency" -msgstr "" +msgstr "Wúxiào de pínlǜ" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" @@ -1196,7 +1197,7 @@ msgstr "Jìngxiàng shí de zuìdà X zhí wèi%d" #: shared-bindings/canio/Message.c msgid "Messages limited to 8 bytes" -msgstr "" +msgstr "Yóujiàn xiànzhì wèi 8 gè zì jié" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." @@ -1308,11 +1309,11 @@ msgstr "Méiyǒu zhǎng zhěngshù zhīchí" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more channels available" -msgstr "" +msgstr "Méiyǒu gèng duō kěyòng píndào" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more timers available" -msgstr "" +msgstr "Méiyǒu gèng duō kěyòng de jìshí qì" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." @@ -1320,7 +1321,7 @@ msgstr "Gāi yǐn jiǎo shàng méiyǒu kěyòng de dìngshí qì." #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" -msgstr "" +msgstr "Méiyǒu wǎngluò yǔ gāi ssid" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" @@ -1344,7 +1345,7 @@ msgstr "Nordic ruǎn shèbèi gùzhàng shēngmíng." #: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c msgid "Not a valid IP string" -msgstr "" +msgstr "Wúxiào de IP zìfú chuàn" #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -1362,7 +1363,7 @@ msgstr "Méiyǒu yùnxíng yǐ bǎocún de dàimǎ.\n" #: shared-bindings/_bleio/__init__.c msgid "Not settable" -msgstr "" +msgstr "bù kě shè zhì" #: shared-bindings/util.c msgid "" @@ -1380,11 +1381,11 @@ msgstr "Zhǐyǒu 8 huò 16 wèi dānwèi " #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "" +msgstr "Jǐn zhīchí IPv4 SOCK_STREAM tào jiē zì" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" -msgstr "" +msgstr "Jǐn zhīchí IPv4 dìzhǐ" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1405,11 +1406,11 @@ msgstr "" #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" -msgstr "" +msgstr "Ip jǐn zhīchí raw int" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Out of sockets" -msgstr "" +msgstr "tào jiē zì wài" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." @@ -1479,7 +1480,7 @@ msgstr "Duōbiānxíng zhìshǎo xūyào 3 diǎn" msgid "" "Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " "instead" -msgstr "" +msgstr "Duānkǒu bù jiēshòu PWM zàibō. Tōngguò yǐn jiǎo, pínlǜ hé zhàn kōng bǐ" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c @@ -1488,7 +1489,7 @@ msgstr "" msgid "" "Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " "instead" -msgstr "" +msgstr "Duānkǒu bù jiēshòu yǐn jiǎo huò pínlǜ. Gòuzào bìng chuándì PWMOut zàibō" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" @@ -1552,7 +1553,7 @@ msgstr "Shuāxīn tài kuàile" #: shared-bindings/canio/RemoteTransmissionRequest.c msgid "RemoteTransmissionRequests limited to 8 bytes" -msgstr "" +msgstr "RemoteTransmissionRequests xiànzhì wèi 8 gè zì jié" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" @@ -1568,7 +1569,7 @@ msgstr "Xíng xiàng bìxū shì digitalio.DigitalInOut" #: main.c msgid "Running in safe mode! " -msgstr "Zài ānquán móshì xià yùnxíng!" +msgstr "Zài ānquán móshì xià yùnxíng! " #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1625,11 +1626,11 @@ msgstr "Xùliè huà yǐjīng shǐyòngguò" #: shared-bindings/ssl/SSLContext.c msgid "Server side context cannot have hostname" -msgstr "" +msgstr "Fúwùqì duān shàngxiàwén bùnéng jùyǒu zhǔjī míng" #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" -msgstr "" +msgstr "bù zhī chí dà xiǎo" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." @@ -1644,7 +1645,7 @@ msgstr "Qiēpiàn bù shòu zhīchí" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" -msgstr "" +msgstr "SocketPool zhǐ néng yǔ wifi.Radio yīqǐ shǐyòng" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" @@ -1692,7 +1693,7 @@ msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" -msgstr "" +msgstr "Rgb_pins de chángdù bìxū wèi 6,12,18,24 huò 30" #: supervisor/shared/safe_mode.c msgid "" @@ -1823,7 +1824,7 @@ msgstr "Wúfǎ fēnpèi huǎnchōng qū yòng yú qiānmíng zhuǎnhuàn" #: ports/esp32s2/common-hal/busio/I2C.c msgid "Unable to create lock" -msgstr "" +msgstr "Wúfǎ chuàngjiàn suǒ" #: shared-module/displayio/I2CDisplay.c #, c-format @@ -1854,11 +1855,11 @@ msgstr "Yìwài de nrfx uuid lèixíng" #: ports/esp32s2/common-hal/socketpool/Socket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" -msgstr "" +msgstr "Wèi chǔlǐ de ESP TLS cuòwù %d %d %x %d" #: shared-bindings/wifi/Radio.c msgid "Unknown failure" -msgstr "" +msgstr "Wèizhī gùzhàng" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format @@ -1946,7 +1947,7 @@ msgstr "WatchDogTimer dāngqián wèi yùnxíng" #: shared-bindings/watchdog/WatchDogTimer.c 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." +"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" @@ -1967,13 +1968,14 @@ msgid "" msgstr "" "Huānyíng lái dào Adafruit CircuitPython%s!\n" "\n" -"Qǐng fǎngwèn xuéxí. learn.Adafruit.com/category/circuitpython.\n" +"Qǐng fǎngwèn learn.Adafruit.Com/category/circuitpython yǐ huòqǔ xiàngmù " +"zhǐnán.\n" "\n" -"Ruò yào liè chū nèizài de mókuài, qǐng qǐng zuò yǐxià `help(\"modules\")`.\n" +"Yào liè chū nèizhì mókuài, qǐng zhíxíng `help(“modules”)`\n" #: shared-bindings/wifi/Radio.c msgid "WiFi password must be between 8 and 63 characters" -msgstr "" +msgstr "WiFi mìmǎ bìxū jiè yú 8 dào 63 gè zìfú zhī jiān" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" @@ -1989,7 +1991,7 @@ 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" +msgstr "__init__() fǎnhuí not" #: py/objtype.c msgid "__init__() should return None, not '%q'" @@ -2145,7 +2147,7 @@ msgstr "zì jié > 8 wèi" #: py/objarray.c msgid "bytes length not a multiple of item size" -msgstr "" +msgstr "zì jié chángdù, bùshì xiàngmù dàxiǎo de bèishù" #: py/objstr.c msgid "bytes value out of range" @@ -2405,7 +2407,8 @@ msgstr "mòrèn 'except' bìxū shì zuìhòu yīgè" msgid "" "destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" msgstr "" -"mùbiāo huǎnchōng qū bìxū shì zì yǎnlèi huò lèixíng 'B' wèi wèi shēndù = 8" +"Duìyú bit_depth = 8, mùbiāo huǎnchōng qū bìxū shì zì jié shùzǔ huò lèixíng " +"wèi 'B' de shùzǔ" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" @@ -2463,11 +2466,11 @@ msgstr "lìwài bìxū láizì BaseException" #: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" -msgstr "" +msgstr "yùqí wèi'%q'dàn dédàole'%q'" #: shared-bindings/canio/CAN.c msgid "expected '%q' or '%q' but got '%q'" -msgstr "" +msgstr "yùqí wèi'%q'huò'%q', dàn huòdéle'%q'" #: py/objstr.c msgid "expected ':' after format specifier" @@ -2680,7 +2683,7 @@ msgstr "chūshǐ zhí bìxū shì kě diédài de" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "initial_value length is wrong" -msgstr "" +msgstr "Initial_value chángdù cuòwù" #: py/compile.c msgid "inline assembler must be a function" @@ -2877,7 +2880,7 @@ msgstr "Dāng gùdìng chángdù wèi %s shí, zuìdà chángdù bìxū wèi 0-% #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "max_length must be > 0" -msgstr "" +msgstr "Max_length bìxū > 0" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -2937,9 +2940,8 @@ msgid "name reused for argument" msgstr "cān shǔ míngchēng bèi chóngxīn shǐyòng" #: py/emitnative.c -#, fuzzy msgid "native yield" -msgstr "yuánshēng chǎnliàng" +msgstr "yuán chǎn" #: py/runtime.c #, c-format @@ -3116,11 +3118,11 @@ msgstr "ord() yùqí zìfú, dàn chángdù zìfú chuàn %d" #: shared-bindings/displayio/Bitmap.c msgid "out of range of source" -msgstr "" +msgstr "yuán fàn wéi wài" #: shared-bindings/displayio/Bitmap.c msgid "out of range of target" -msgstr "" +msgstr "mù biāo fàn wéi wài" #: py/objint_mpz.c msgid "overflow converting long int to machine word" @@ -3129,7 +3131,7 @@ msgstr "chāo gāo zhuǎnhuàn zhǎng zhěng shùzì shí" #: py/modstruct.c #, c-format msgid "pack expected %d items for packing (got %d)" -msgstr "" +msgstr "bāo zhuāng yù qī de %d bāo zhuāng xiàng mù (dé dào %d)" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" @@ -3169,7 +3171,7 @@ msgstr "duōbiānxíng zhī néng zài yīgè fù jí zhōng zhùcè" #: ports/esp32s2/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" -msgstr "cóng kōng de PulseIn dànchū dànchū" +msgstr "cóng kōng mài chōng tán chū" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -3195,7 +3197,7 @@ msgstr "pow() yǒu 3 cānshù xūyào zhěngshù" #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h msgid "pressing boot button at start up.\n" -msgstr "" +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 @@ -3203,7 +3205,7 @@ msgstr "" #: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "pressing both buttons at start up.\n" -msgstr "" +msgstr "zài qǐdòng shí tóngshí àn xià liǎng gè ànniǔ.\n" #: extmod/modutimeq.c msgid "queue overflow" @@ -3330,7 +3332,7 @@ msgstr "sosfilt xūyào diédài cānshù" #: shared-bindings/displayio/Bitmap.c msgid "source palette too large" -msgstr "" +msgstr "yuán miànbǎn tài dà" #: py/objstr.c msgid "start/end indices" @@ -3571,7 +3573,7 @@ msgstr "kān mén gǒu chāoshí bìxū dàyú 0" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" -msgstr "" +msgstr "kuāndù bìxū dàyú líng" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" From 76f431df704174f99f269c29382e82a0e4e03c21 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 8 Oct 2020 11:02:14 -0700 Subject: [PATCH 1089/1293] Fix ble_hci --- devices/ble_hci/common-hal/_bleio/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices/ble_hci/common-hal/_bleio/__init__.c b/devices/ble_hci/common-hal/_bleio/__init__.c index 9fc4b480d9..8d6d764155 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.c +++ b/devices/ble_hci/common-hal/_bleio/__init__.c @@ -98,7 +98,7 @@ bleio_adapter_obj_t *common_hal_bleio_allocate_adapter_or_raise(void) { void common_hal_bleio_check_connected(uint16_t conn_handle) { if (conn_handle == BLE_CONN_HANDLE_INVALID) { - mp_raise_bleio_ConnectionError(translate("Not connected")); + mp_raise_ConnectionError(translate("Not connected")); } } From 5af1e054a74a9d088c3c2ca2bbac86ebd326d937 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 8 Oct 2020 14:57:41 -0400 Subject: [PATCH 1090/1293] Fix strange merge submodule edit --- ports/atmel-samd/peripherals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 2ff4ab0510..a7e39c4d01 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 2ff4ab05101ce7d3e105009cc6612df6e992123f +Subproject commit a7e39c4d01aa5916015beecb021777617e77b0ad From 3149f5bfd8baa59b52fbd8e98c036caa53cd2ce6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 8 Oct 2020 13:58:45 -0500 Subject: [PATCH 1091/1293] workflows: Replace deprecated ::set-env --- .github/workflows/build.yml | 6 +++--- .github/workflows/pre-commit.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dc3dc68352..dcd91b312e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: - name: CircuitPython version run: | git describe --dirty --tags - echo "::set-env name=CP_VERSION::$(git describe --dirty --tags)" + echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags) - name: Set up Python 3.8 uses: actions/setup-python@v1 with: @@ -132,7 +132,7 @@ jobs: - name: Install dependencies run: | brew install gettext awscli - echo "::set-env name=PATH::/usr/local/opt/gettext/bin:$PATH" + echo >>$GITHUB_PATH /usr/local/opt/gettext/bin - name: Versions run: | gcc --version @@ -146,7 +146,7 @@ jobs: - name: CircuitPython version run: | git describe --dirty --tags - echo "::set-env name=CP_VERSION::$(git describe --dirty --tags)" + echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags) - name: Build mpy-cross run: make -C mpy-cross -j2 - uses: actions/upload-artifact@v2 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 9663103046..eac9bfe096 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v1 - uses: actions/setup-python@v1 - name: set PY - run: echo "::set-env name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" + run: echo >>$GITHUB_ENV PY="$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" - uses: actions/cache@v1 with: path: ~/.cache/pre-commit From 2b2003f3e70a1e829bdd1ccffb1ed5bf933696dd Mon Sep 17 00:00:00 2001 From: askpatricw <4002194+askpatrickw@users.noreply.github.com> Date: Thu, 8 Oct 2020 22:46:10 -0700 Subject: [PATCH 1092/1293] Set default hostname --- ports/esp32s2/boards/adafruit_metro_esp32s2/sdkconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/esp32s2/boards/adafruit_metro_esp32s2/sdkconfig b/ports/esp32s2/boards/adafruit_metro_esp32s2/sdkconfig index 9d8bbde967..80b9a2cf8e 100644 --- a/ports/esp32s2/boards/adafruit_metro_esp32s2/sdkconfig +++ b/ports/esp32s2/boards/adafruit_metro_esp32s2/sdkconfig @@ -31,3 +31,9 @@ CONFIG_SPIRAM_USE_MEMMAP=y CONFIG_SPIRAM_MEMTEST=y # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set # end of SPI RAM config + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="Metro-ESP32S2" +# end of LWIP From ccbc15046a818094124565667d9687ff41e1b0a8 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 9 Oct 2020 13:29:35 -0400 Subject: [PATCH 1093/1293] Fix submodule issue --- ports/atmel-samd/peripherals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 2ff4ab0510..a7e39c4d01 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 2ff4ab05101ce7d3e105009cc6612df6e992123f +Subproject commit a7e39c4d01aa5916015beecb021777617e77b0ad From 3ccf644dd0afd85ad8d8c6c67494cebab172b5a8 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 9 Oct 2020 12:53:00 -0700 Subject: [PATCH 1094/1293] Fix autoreload on SAMD21 The issue was that a time.sleep() would set the RTC wake up further into the future even if we wanted to tick every ms. Ticking every ms is used to time the autoreload delay and without it, autoreload doesn't work. Fixes #3528 --- ports/atmel-samd/supervisor/port.c | 58 +++++++++++++++++------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 8d52c30c53..e69062296d 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -430,6 +430,33 @@ uint32_t port_get_saved_word(void) { static volatile uint64_t overflowed_ticks = 0; static volatile bool _ticks_enabled = false; +static uint32_t _get_count(void) { + #ifdef SAM_D5X_E5X + while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) {} + #endif + #ifdef SAMD21 + while (RTC->MODE0.STATUS.bit.SYNCBUSY != 0) {} + #endif + + return RTC->MODE0.COUNT.reg; +} + +static void _port_interrupt_after_ticks(uint32_t ticks) { + uint32_t current_ticks = _get_count(); + if (ticks > 1 << 28) { + // We'll interrupt sooner with an overflow. + return; + } +#ifdef SAMD21 + if (hold_interrupt) { + return; + } +#endif + RTC->MODE0.COMP[0].reg = current_ticks + (ticks << 4); + RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP0; + RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_CMP0; +} + void RTC_Handler(void) { uint32_t intflag = RTC->MODE0.INTFLAG.reg; if (intflag & RTC_MODE0_INTFLAG_OVF) { @@ -452,7 +479,7 @@ void RTC_Handler(void) { supervisor_tick(); // Check _ticks_enabled again because a tick handler may have turned it off. if (_ticks_enabled) { - port_interrupt_after_ticks(1); + _port_interrupt_after_ticks(1); } } #endif @@ -462,17 +489,6 @@ void RTC_Handler(void) { } } -static uint32_t _get_count(void) { - #ifdef SAM_D5X_E5X - while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) {} - #endif - #ifdef SAMD21 - while (RTC->MODE0.STATUS.bit.SYNCBUSY != 0) {} - #endif - - return RTC->MODE0.COUNT.reg; -} - uint64_t port_get_raw_ticks(uint8_t* subticks) { uint32_t current_ticks = _get_count(); if (subticks != NULL) { @@ -490,7 +506,7 @@ void port_enable_tick(void) { #endif #ifdef SAMD21 _ticks_enabled = true; - port_interrupt_after_ticks(1); + _port_interrupt_after_ticks(1); #endif } @@ -505,20 +521,14 @@ void port_disable_tick(void) { #endif } +// 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) { - uint32_t current_ticks = _get_count(); - if (ticks > 1 << 28) { - // We'll interrupt sooner with an overflow. + if (_ticks_enabled) { return; } -#ifdef SAMD21 - if (hold_interrupt) { - return; - } -#endif - RTC->MODE0.COMP[0].reg = current_ticks + (ticks << 4); - RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP0; - RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_CMP0; + _port_interrupt_after_ticks(ticks); } void port_sleep_until_interrupt(void) { From 70a94c8d2dec709e6692a89131f04e05b81bcae0 Mon Sep 17 00:00:00 2001 From: lady ada Date: Sat, 10 Oct 2020 12:27:35 -0400 Subject: [PATCH 1095/1293] fix for https://github.com/adafruit/circuitpython/issues/3534 --- ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h index 0368d577bf..cbca94e030 100644 --- a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h @@ -15,8 +15,8 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define DEFAULT_I2C_BUS_SCL (&pin_PB03) -#define DEFAULT_I2C_BUS_SDA (&pin_PB02) +#define DEFAULT_I2C_BUS_SCL (&pin_PB30) +#define DEFAULT_I2C_BUS_SDA (&pin_PB31) #define DEFAULT_SPI_BUS_SCK (&pin_PA16) #define DEFAULT_SPI_BUS_MOSI (&pin_PA19) From 5e38bb98cbcc2d1ab607b19d11e628def4f48f4c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 10 Oct 2020 14:30:37 -0500 Subject: [PATCH 1096/1293] rgbmatrix: update protomatter to 1.0.5 tag this is compile-tested on stm32f405 feather matrixportal nrf52840 feather but not actually tested-tested. --- lib/protomatter | 2 +- py/circuitpy_defns.mk | 4 ++-- shared-bindings/rgbmatrix/RGBMatrix.h | 2 +- shared-module/rgbmatrix/RGBMatrix.c | 12 ++++++------ shared-module/rgbmatrix/RGBMatrix.h | 2 +- shared-module/rgbmatrix/allocator.h | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/protomatter b/lib/protomatter index 5f07ec6188..de6b7704c5 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit 5f07ec6188852794a94138763e612844842f13e4 +Subproject commit de6b7704c530d886ad8dfa0fa1864764d86117ee diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 76c0a4db67..525e0b2bf2 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -528,10 +528,10 @@ SRC_MOD += $(addprefix lib/mp3/src/, \ $(BUILD)/lib/mp3/src/buffers.o: CFLAGS += -include "py/misc.h" -D'MPDEC_ALLOCATOR(x)=m_malloc(x,0)' -D'MPDEC_FREE(x)=m_free(x)' endif ifeq ($(CIRCUITPY_RGBMATRIX),1) -SRC_MOD += $(addprefix lib/protomatter/, \ +SRC_MOD += $(addprefix lib/protomatter/src/, \ core.c \ ) -$(BUILD)/lib/protomatter/core.o: CFLAGS += -include "shared-module/rgbmatrix/allocator.h" -DCIRCUITPY -Wno-missing-braces +$(BUILD)/lib/protomatter/src/core.o: CFLAGS += -include "shared-module/rgbmatrix/allocator.h" -DCIRCUITPY -Wno-missing-braces endif # All possible sources are listed here, and are filtered by SRC_PATTERNS. diff --git a/shared-bindings/rgbmatrix/RGBMatrix.h b/shared-bindings/rgbmatrix/RGBMatrix.h index 1dc5a406ca..bfe37c3404 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.h +++ b/shared-bindings/rgbmatrix/RGBMatrix.h @@ -27,7 +27,7 @@ #pragma once #include "shared-module/rgbmatrix/RGBMatrix.h" -#include "lib/protomatter/core.h" +#include "lib/protomatter/src/core.h" extern const mp_obj_type_t rgbmatrix_RGBMatrix_type; diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c index 3007ca4db5..a775181309 100644 --- a/shared-module/rgbmatrix/RGBMatrix.c +++ b/shared-module/rgbmatrix/RGBMatrix.c @@ -78,10 +78,10 @@ void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t* self, // verify that the matrix is big enough mp_get_index(mp_obj_get_type(self->framebuffer), self->bufinfo.len, MP_OBJ_NEW_SMALL_INT(self->bufsize-1), false); } else { - _PM_FREE(self->bufinfo.buf); - _PM_FREE(self->protomatter.rgbPins); - _PM_FREE(self->protomatter.addr); - _PM_FREE(self->protomatter.screenData); + _PM_free(self->bufinfo.buf); + _PM_free(self->protomatter.rgbPins); + _PM_free(self->protomatter.addr); + _PM_free(self->protomatter.screenData); self->framebuffer = NULL; self->bufinfo.buf = common_hal_rgbmatrix_allocator_impl(self->bufsize); @@ -164,13 +164,13 @@ void common_hal_rgbmatrix_rgbmatrix_deinit(rgbmatrix_rgbmatrix_obj_t* self) { free_pin(&self->oe_pin); if (self->protomatter.rgbPins) { - _PM_free(&self->protomatter); + _PM_deallocate(&self->protomatter); } memset(&self->protomatter, 0, sizeof(self->protomatter)); // If it was supervisor-allocated, it is supervisor-freed and the pointer // is zeroed, otherwise the pointer is just zeroed - _PM_FREE(self->bufinfo.buf); + _PM_free(self->bufinfo.buf); self->base.type = NULL; // If a framebuffer was passed in to the constructor, NULL the reference diff --git a/shared-module/rgbmatrix/RGBMatrix.h b/shared-module/rgbmatrix/RGBMatrix.h index 19d7d5f2e7..6dbc6fd41e 100644 --- a/shared-module/rgbmatrix/RGBMatrix.h +++ b/shared-module/rgbmatrix/RGBMatrix.h @@ -26,7 +26,7 @@ #pragma once -#include "lib/protomatter/core.h" +#include "lib/protomatter/src/core.h" extern const mp_obj_type_t rgbmatrix_RGBMatrix_type; typedef struct { diff --git a/shared-module/rgbmatrix/allocator.h b/shared-module/rgbmatrix/allocator.h index 323fa5ec06..3431046d5b 100644 --- a/shared-module/rgbmatrix/allocator.h +++ b/shared-module/rgbmatrix/allocator.h @@ -31,7 +31,7 @@ #include "py/misc.h" #include "supervisor/memory.h" -#define _PM_ALLOCATOR common_hal_rgbmatrix_allocator_impl -#define _PM_FREE(x) (common_hal_rgbmatrix_free_impl((x)), (x)=NULL, (void)0) +#define _PM_allocate common_hal_rgbmatrix_allocator_impl +#define _PM_free(x) (common_hal_rgbmatrix_free_impl((x)), (x)=NULL, (void)0) extern void *common_hal_rgbmatrix_allocator_impl(size_t sz); extern void common_hal_rgbmatrix_free_impl(void *); From b9e308c248ec953ebd2fc8c16c03b2cc06cfafc5 Mon Sep 17 00:00:00 2001 From: Targett363 Date: Sat, 10 Oct 2020 21:11:06 +0100 Subject: [PATCH 1097/1293] Adding Wroom and Wrover board files --- .../boards/targett_module_clip_wroom/board.c | 51 +++++++++++++++++++ .../targett_module_clip_wroom/mpconfigboard.h | 40 +++++++++++++++ .../mpconfigboard.mk | 17 +++++++ .../boards/targett_module_clip_wroom/pins.c | 48 +++++++++++++++++ .../targett_module_clip_wroom/sdkconfig | 0 .../boards/targett_module_clip_wrover/board.c | 47 +++++++++++++++++ .../mpconfigboard.h | 38 ++++++++++++++ .../mpconfigboard.mk | 17 +++++++ .../boards/targett_module_clip_wrover/pins.c | 48 +++++++++++++++++ .../targett_module_clip_wrover/sdkconfig | 33 ++++++++++++ 10 files changed, 339 insertions(+) create mode 100644 ports/esp32s2/boards/targett_module_clip_wroom/board.c create mode 100644 ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h create mode 100644 ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk create mode 100644 ports/esp32s2/boards/targett_module_clip_wroom/pins.c create mode 100644 ports/esp32s2/boards/targett_module_clip_wroom/sdkconfig create mode 100644 ports/esp32s2/boards/targett_module_clip_wrover/board.c create mode 100644 ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h create mode 100644 ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk create mode 100644 ports/esp32s2/boards/targett_module_clip_wrover/pins.c create mode 100644 ports/esp32s2/boards/targett_module_clip_wrover/sdkconfig diff --git a/ports/esp32s2/boards/targett_module_clip_wroom/board.c b/ports/esp32s2/boards/targett_module_clip_wroom/board.c new file mode 100644 index 0000000000..7f5de0e0dd --- /dev/null +++ b/ports/esp32s2/boards/targett_module_clip_wroom/board.c @@ -0,0 +1,51 @@ +/* + * 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 "boards/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + + // Crystal + common_hal_never_reset_pin(&pin_GPIO15); + common_hal_never_reset_pin(&pin_GPIO16); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h b/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h new file mode 100644 index 0000000000..6cf69138e7 --- /dev/null +++ b/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h @@ -0,0 +1,40 @@ +/* + * 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 + +//Essentially the same as the Saola board but without the neopixel + +#define MICROPY_HW_BOARD_NAME "Targett Module Clip w/Wroom" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +//#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) + +#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 diff --git a/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk b/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk new file mode 100644 index 0000000000..71793344e9 --- /dev/null +++ b/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x239A +USB_PID = 0x80A8 +USB_PRODUCT = "Targett Module Clip w/WROOM" +USB_MANUFACTURER = "Targett" + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=4MB + +CIRCUITPY_MODULE=wroom diff --git a/ports/esp32s2/boards/targett_module_clip_wroom/pins.c b/ports/esp32s2/boards/targett_module_clip_wroom/pins.c new file mode 100644 index 0000000000..99db096457 --- /dev/null +++ b/ports/esp32s2/boards/targett_module_clip_wroom/pins.c @@ -0,0 +1,48 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { 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_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_IO17), MP_ROM_PTR(&pin_GPIO17) }, + + + { 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_IO20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_IO26), MP_ROM_PTR(&pin_GPIO26) }, + { 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_IO37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) }, + + //{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/esp32s2/boards/targett_module_clip_wroom/sdkconfig b/ports/esp32s2/boards/targett_module_clip_wroom/sdkconfig new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/esp32s2/boards/targett_module_clip_wrover/board.c b/ports/esp32s2/boards/targett_module_clip_wrover/board.c new file mode 100644 index 0000000000..9f708874bf --- /dev/null +++ b/ports/esp32s2/boards/targett_module_clip_wrover/board.c @@ -0,0 +1,47 @@ +/* + * 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 "boards/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h b/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h new file mode 100644 index 0000000000..9615228910 --- /dev/null +++ b/ports/esp32s2/boards/targett_module_clip_wrover/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. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "Saola 1 w/Wrover" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) + +#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 diff --git a/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk b/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk new file mode 100644 index 0000000000..d5ff1c5ac8 --- /dev/null +++ b/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x239A +USB_PID = 0x80A6 +USB_PRODUCT = "Saola 1 w/WROVER" +USB_MANUFACTURER = "Espressif" + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=4MB + +CIRCUITPY_MODULE=wrover diff --git a/ports/esp32s2/boards/targett_module_clip_wrover/pins.c b/ports/esp32s2/boards/targett_module_clip_wrover/pins.c new file mode 100644 index 0000000000..0562d9331f --- /dev/null +++ b/ports/esp32s2/boards/targett_module_clip_wrover/pins.c @@ -0,0 +1,48 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { 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_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_IO17), MP_ROM_PTR(&pin_GPIO17) }, + + + { 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_IO20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_IO26), MP_ROM_PTR(&pin_GPIO26) }, + { 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_IO37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/esp32s2/boards/targett_module_clip_wrover/sdkconfig b/ports/esp32s2/boards/targett_module_clip_wrover/sdkconfig new file mode 100644 index 0000000000..9d8bbde967 --- /dev/null +++ b/ports/esp32s2/boards/targett_module_clip_wrover/sdkconfig @@ -0,0 +1,33 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 + +# +# PSRAM clock and cs IO for ESP32S2 +# +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM clock and cs IO for ESP32S2 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config From f38e868e90fb467cf0f910e4990ffacba07abefb Mon Sep 17 00:00:00 2001 From: Targett363 Date: Sat, 10 Oct 2020 21:28:26 +0100 Subject: [PATCH 1098/1293] Actually adding Wrover board files this time --- ports/esp32s2/boards/espressif_saola_1_wrover/board.c | 4 ++++ .../esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h | 6 ++++-- .../boards/espressif_saola_1_wrover/mpconfigboard.mk | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/board.c b/ports/esp32s2/boards/espressif_saola_1_wrover/board.c index 9f708874bf..83dcb920a8 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/board.c +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/board.c @@ -36,6 +36,10 @@ void board_init(void) { // Debug UART common_hal_never_reset_pin(&pin_GPIO43); common_hal_never_reset_pin(&pin_GPIO44); + + //Crystal + common_hal_never_reset_pin(&pin_GPIO15); + common_hal_never_reset_pin(&pin_GPIO16); } bool board_requests_safe_mode(void) { diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h index 9615228910..3c74d27fa4 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h @@ -26,10 +26,12 @@ //Micropython setup -#define MICROPY_HW_BOARD_NAME "Saola 1 w/Wrover" +//Same setup as the Saola board but with no Neopixel on board + +#define MICROPY_HW_BOARD_NAME "Targett Module Clip w/Wrover" #define MICROPY_HW_MCU_NAME "ESP32S2" -#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) +//#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk index d5ff1c5ac8..4b70f4a686 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk @@ -1,7 +1,7 @@ USB_VID = 0x239A USB_PID = 0x80A6 -USB_PRODUCT = "Saola 1 w/WROVER" -USB_MANUFACTURER = "Espressif" +USB_PRODUCT = "Targett Module Clip w/WROVER" +USB_MANUFACTURER = "Targett" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ From 74954286f09b2fc861db759232569520552f7cd8 Mon Sep 17 00:00:00 2001 From: Targett363 Date: Sat, 10 Oct 2020 21:44:14 +0100 Subject: [PATCH 1099/1293] Putting the Saola Wrover files back and adding my Wrover board files this time --- ports/esp32s2/boards/espressif_saola_1_wrover/board.c | 4 ---- .../esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h | 6 ++---- .../boards/espressif_saola_1_wrover/mpconfigboard.mk | 4 ++-- ports/esp32s2/boards/targett_module_clip_wrover/board.c | 4 ++++ .../boards/targett_module_clip_wrover/mpconfigboard.h | 6 ++++-- .../boards/targett_module_clip_wrover/mpconfigboard.mk | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/board.c b/ports/esp32s2/boards/espressif_saola_1_wrover/board.c index 83dcb920a8..9f708874bf 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/board.c +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/board.c @@ -36,10 +36,6 @@ void board_init(void) { // Debug UART common_hal_never_reset_pin(&pin_GPIO43); common_hal_never_reset_pin(&pin_GPIO44); - - //Crystal - common_hal_never_reset_pin(&pin_GPIO15); - common_hal_never_reset_pin(&pin_GPIO16); } bool board_requests_safe_mode(void) { diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h index 3c74d27fa4..9615228910 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h @@ -26,12 +26,10 @@ //Micropython setup -//Same setup as the Saola board but with no Neopixel on board - -#define MICROPY_HW_BOARD_NAME "Targett Module Clip w/Wrover" +#define MICROPY_HW_BOARD_NAME "Saola 1 w/Wrover" #define MICROPY_HW_MCU_NAME "ESP32S2" -//#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) +#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk index 4b70f4a686..d5ff1c5ac8 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk @@ -1,7 +1,7 @@ USB_VID = 0x239A USB_PID = 0x80A6 -USB_PRODUCT = "Targett Module Clip w/WROVER" -USB_MANUFACTURER = "Targett" +USB_PRODUCT = "Saola 1 w/WROVER" +USB_MANUFACTURER = "Espressif" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/esp32s2/boards/targett_module_clip_wrover/board.c b/ports/esp32s2/boards/targett_module_clip_wrover/board.c index 9f708874bf..83dcb920a8 100644 --- a/ports/esp32s2/boards/targett_module_clip_wrover/board.c +++ b/ports/esp32s2/boards/targett_module_clip_wrover/board.c @@ -36,6 +36,10 @@ void board_init(void) { // Debug UART common_hal_never_reset_pin(&pin_GPIO43); common_hal_never_reset_pin(&pin_GPIO44); + + //Crystal + common_hal_never_reset_pin(&pin_GPIO15); + common_hal_never_reset_pin(&pin_GPIO16); } bool board_requests_safe_mode(void) { diff --git a/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h b/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h index 9615228910..3c74d27fa4 100644 --- a/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h +++ b/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h @@ -26,10 +26,12 @@ //Micropython setup -#define MICROPY_HW_BOARD_NAME "Saola 1 w/Wrover" +//Same setup as the Saola board but with no Neopixel on board + +#define MICROPY_HW_BOARD_NAME "Targett Module Clip w/Wrover" #define MICROPY_HW_MCU_NAME "ESP32S2" -#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) +//#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) diff --git a/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk b/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk index d5ff1c5ac8..4b70f4a686 100644 --- a/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk +++ b/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk @@ -1,7 +1,7 @@ USB_VID = 0x239A USB_PID = 0x80A6 -USB_PRODUCT = "Saola 1 w/WROVER" -USB_MANUFACTURER = "Espressif" +USB_PRODUCT = "Targett Module Clip w/WROVER" +USB_MANUFACTURER = "Targett" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ From cd935346ec8afe93a89d3a858acad1da77245916 Mon Sep 17 00:00:00 2001 From: Targett363 Date: Sat, 10 Oct 2020 22:11:44 +0100 Subject: [PATCH 1100/1293] Updating the build.yml to include both Module Clip boards --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eaecd2fa4d..af006756e1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -422,6 +422,8 @@ jobs: - "espressif_saola_1_wrover" - "microdev_micro_s2" - "muselab_nanoesp32_s2" + - "targett_module_clip_wrooom" + - "targett_module_clip_wrover" - "unexpectedmaker_feathers2" - "unexpectedmaker_feathers2_prerelease" From ead0d51fd711d38bab8dc7cff8373b6fdd60a180 Mon Sep 17 00:00:00 2001 From: Targett363 Date: Sat, 10 Oct 2020 22:22:01 +0100 Subject: [PATCH 1101/1293] Commenting out Neopixel in pins.c --- ports/esp32s2/boards/targett_module_clip_wrover/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/boards/targett_module_clip_wrover/pins.c b/ports/esp32s2/boards/targett_module_clip_wrover/pins.c index 0562d9331f..99db096457 100644 --- a/ports/esp32s2/boards/targett_module_clip_wrover/pins.c +++ b/ports/esp32s2/boards/targett_module_clip_wrover/pins.c @@ -43,6 +43,6 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) }, - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, + //{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 2aee2b7dc7c11eaf44603e726683a66bf47f0ec5 Mon Sep 17 00:00:00 2001 From: Targett363 Date: Sat, 10 Oct 2020 22:33:52 +0100 Subject: [PATCH 1102/1293] Corecting spelling mistake in build.yml --- .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 af006756e1..4802335b55 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -422,7 +422,7 @@ jobs: - "espressif_saola_1_wrover" - "microdev_micro_s2" - "muselab_nanoesp32_s2" - - "targett_module_clip_wrooom" + - "targett_module_clip_wroom" - "targett_module_clip_wrover" - "unexpectedmaker_feathers2" - "unexpectedmaker_feathers2_prerelease" From 5721cf0710202294476c83500394a8dbd1c20d5b Mon Sep 17 00:00:00 2001 From: Targett363 Date: Sat, 10 Oct 2020 22:42:24 +0100 Subject: [PATCH 1103/1293] tidying up board names --- ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk | 2 +- .../esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk b/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk index 71793344e9..580caa71b6 100644 --- a/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk +++ b/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk @@ -1,6 +1,6 @@ USB_VID = 0x239A USB_PID = 0x80A8 -USB_PRODUCT = "Targett Module Clip w/WROOM" +USB_PRODUCT = "Targett Module Clip w/Wroom" USB_MANUFACTURER = "Targett" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk b/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk index 4b70f4a686..6832d21018 100644 --- a/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk +++ b/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk @@ -1,6 +1,6 @@ USB_VID = 0x239A USB_PID = 0x80A6 -USB_PRODUCT = "Targett Module Clip w/WROVER" +USB_PRODUCT = "Targett Module Clip w/Wrover" USB_MANUFACTURER = "Targett" INTERNAL_FLASH_FILESYSTEM = 1 From d94d2d297552decfc1f02b84c898127eb14e96bf Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Sun, 31 May 2020 13:09:45 -0700 Subject: [PATCH 1104/1293] Add async/await syntax to FULL_BUILD This adds the `async def` and `await` verbs to valid CircuitPython syntax using the Micropython implementation. Consider: ``` >>> class Awaitable: ... def __iter__(self): ... for i in range(3): ... print('awaiting', i) ... yield ... return 42 ... >>> async def wait_for_it(): ... a = Awaitable() ... result = await a ... return result ... >>> task = wait_for_it() >>> next(task) awaiting 0 >>> next(task) awaiting 1 >>> next(task) awaiting 2 >>> next(task) Traceback (most recent call last): File "", line 1, in StopIteration: 42 >>> ``` and more excitingly: ``` >>> async def it_awaits_a_subtask(): ... value = await wait_for_it() ... print('twice as good', value * 2) ... >>> task = it_awaits_a_subtask() >>> next(task) awaiting 0 >>> next(task) awaiting 1 >>> next(task) awaiting 2 >>> next(task) twice as good 84 Traceback (most recent call last): File "", line 1, in StopIteration: ``` Note that this is just syntax plumbing, not an all-encompassing implementation of an asynchronous task scheduler or asynchronous hardware apis. uasyncio might be a good module to bring in, or something else - but the standard Python syntax does not _strictly require_ deeper hardware support. Micropython implements the await verb via the __iter__ function rather than __await__. It's okay. The syntax being present will enable users to write clean and expressive multi-step state machines that are written serially and interleaved according to the rules provided by those users. Given that this does not include an all-encompassing C scheduler, this is expected to be an advanced functionality until the community settles on the future of deep hardware support for async/await in CircuitPython. Users will implement yield-based schedulers and tasks wrapping synchronous hardware APIs with polling to avoid blocking, while their application business logic gets simple `await` statements. --- py/circuitpy_mpconfig.h | 1 - py/circuitpy_mpconfig.mk | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 0583ae1c97..5ffdd4c8f3 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -79,7 +79,6 @@ #define MICROPY_PY_ARRAY (1) #define MICROPY_PY_ARRAY_SLICE_ASSIGN (1) -#define MICROPY_PY_ASYNC_AWAIT (0) #define MICROPY_PY_ATTRTUPLE (1) #define MICROPY_PY_BUILTINS_BYTEARRAY (1) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 9b9bd83b4d..cab6d339e5 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -290,3 +290,6 @@ CFLAGS += -DCIRCUITPY_WIFI=$(CIRCUITPY_WIFI) # Enabled micropython.native decorator (experimental) CIRCUITPY_ENABLE_MPY_NATIVE ?= 0 CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE) + +# async/await language keyword support +MICROPY_PY_ASYNC_AWAIT ?= $(CIRCUITPY_FULL_BUILD) From f5f1e29dc0503483ecdaef853b0b9361a5731b55 Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Sun, 31 May 2020 14:25:09 -0700 Subject: [PATCH 1105/1293] disable async/await on a several small ucontrollers --- ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk | 1 + ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk | 3 +++ .../atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/datum_distance/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/datum_imu/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/datum_light/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/datum_weather/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/pewpew10/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/shirtty/mpconfigboard.mk | 3 +++ .../boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk | 3 +++ ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/uchip/mpconfigboard.mk | 1 + ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk | 3 +++ ports/nrf/boards/pca10100/mpconfigboard.mk | 2 ++ ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk | 3 +++ 28 files changed, 75 insertions(+) diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk index d31d1f54a4..2c0056847c 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk @@ -10,3 +10,4 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 +MICROPY_PY_ASYNC_AWAIT = 0 diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk index 7eb83a1230..230bce4f21 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk index fd24edafa2..1d652737a7 100644 --- a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk index a5722c9ade..e4d0916fa1 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk index 055e6b19e2..47a5434504 100644 --- a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk @@ -9,3 +9,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk index 892a5371ef..201c9b1424 100644 --- a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk +++ b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_ROTARYIO = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk index 5656d4cb86..fa437bf364 100755 --- a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk @@ -16,6 +16,7 @@ CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 +MICROPY_PY_ASYNC_AWAIT = 0 SUPEROPT_GC = 0 @@ -33,3 +34,4 @@ RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 SUPEROPT_VM = 0 endif + diff --git a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk index ae05d32f2c..365b935ee8 100644 --- a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk index 6fd05f403b..f5900c8f78 100644 --- a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk index d42a7869de..3cefa856fa 100644 --- a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk index d92cbc71b3..1293a5aaa3 100644 --- a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk index 143910318d..0f784be8af 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk index 69ebdfc237..b535085704 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk index 1ad4292950..fe588b1635 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk @@ -21,10 +21,13 @@ CIRCUITPY_SAMD = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_TOUCHIO = 0 +MICROPY_PY_ASYNC_AWAIT = 0 CFLAGS_INLINE_LIMIT = 35 + # Make more room. SUPEROPT_GC = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_RFM69 + diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index 44606e340f..f2e27d1e23 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -22,6 +22,8 @@ CIRCUITPY_SAMD = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_TOUCHIO = 0 +MICROPY_PY_ASYNC_AWAIT = 0 + CFLAGS_INLINE_LIMIT = 35 # Make more room. SUPEROPT_GC = 0 @@ -29,3 +31,4 @@ SUPEROPT_GC = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_RFM9x + diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk index 0345417a98..10705f2802 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk @@ -9,6 +9,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 +MICROPY_PY_ASYNC_AWAIT = 0 SUPEROPT_GC = 0 @@ -21,3 +22,4 @@ ifeq ($(TRANSLATION), de_DE) RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 endif + diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index 1cc91a8df6..b5e1ce69ad 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -24,3 +24,6 @@ SUPEROPT_GC = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x CFLAGS_BOARD = --param max-inline-insns-auto=15 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk b/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk index bedec87f45..b89bee482b 100644 --- a/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk +++ b/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk index a04e097692..ed4960cd83 100644 --- a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk +++ b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk @@ -13,3 +13,6 @@ CIRCUITPY_I2CPERIPHERAL = 1 CIRCUITPY_TOUCHIO = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk index 22e2059a93..18b057a18a 100644 --- a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk index a2bd577cd3..c97207b215 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk index 9460d0009b..d9bde81833 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk @@ -11,3 +11,6 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index 735d422973..a65c570c7d 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -9,6 +9,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 +MICROPY_PY_ASYNC_AWAIT = 0 SUPEROPT_GC = 0 @@ -22,3 +23,4 @@ RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 SUPEROPT_VM = 0 endif + diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk index 402db7ebc0..82d2768d8f 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk @@ -17,6 +17,7 @@ CIRCUITPY_COUNTIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 +MICROPY_PY_ASYNC_AWAIT = 0 SUPEROPT_GC = 0 @@ -34,3 +35,4 @@ RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 SUPEROPT_VM = 0 endif + diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index d08690a15a..7270effde4 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -14,3 +14,4 @@ CIRCUITPY_FULL_BUILD = 0 CFLAGS_INLINE_LIMIT = 45 SUPEROPT_GC = 0 +MICROPY_PY_ASYNC_AWAIT = 0 diff --git a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk index 9309fdce0d..b08d36b59d 100644 --- a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk +++ b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk @@ -28,3 +28,6 @@ CIRCUITPY_COUNTIO=0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD + +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index f952983f55..6a6ca72ce1 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -29,3 +29,5 @@ SUPEROPT_GC = 0 # Override optimization to keep binary small OPTIMIZATION_FLAGS = -Os +MICROPY_PY_ASYNC_AWAIT = 0 + diff --git a/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk b/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk index f66b2eaf7a..7077766a37 100644 --- a/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk +++ b/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk @@ -6,3 +6,6 @@ USB_MANUFACTURER = "SparkFun Electronics" MCU_CHIP = nrf52840 INTERNAL_FLASH_FILESYSTEM = 1 + +MICROPY_PY_ASYNC_AWAIT = 0 + From 5cadf525bdf27ef4a3fab9b1c7242384f260003e Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Sun, 31 May 2020 15:16:44 -0700 Subject: [PATCH 1106/1293] fix missing cflag defeating the board gating --- py/circuitpy_mpconfig.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index cab6d339e5..ba75d29a5c 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -32,6 +32,8 @@ CIRCUITPY_FULL_BUILD ?= 1 CFLAGS += -DCIRCUITPY_FULL_BUILD=$(CIRCUITPY_FULL_BUILD) +MICROPY_PY_ASYNC_AWAIT ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DMICROPY_PY_ASYNC_AWAIT=$(MICROPY_PY_ASYNC_AWAIT) CIRCUITPY_AESIO ?= 0 CFLAGS += -DCIRCUITPY_AESIO=$(CIRCUITPY_AESIO) From bf849ff674a953ea36dbffc856a05158b2350077 Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Wed, 5 Aug 2020 19:55:40 -0700 Subject: [PATCH 1107/1293] async def syntax rigor and __await__ magic method Some examples of improved compliance with CPython that currently have divergent behavior in CircuitPython are listed below: * yield from is not allowed in async methods ``` >>> async def f(): ... yield from 'abc' ... Traceback (most recent call last): File "", line 2, in f SyntaxError: 'yield from' inside async function ``` * await only works on awaitable expressions ``` >>> async def f(): ... await 'not awaitable' ... >>> f().send(None) Traceback (most recent call last): File "", line 1, in File "", line 2, in f AttributeError: 'str' object has no attribute '__await__' ``` * only __await__()able expressions are awaitable Okay this one actually does not work in circuitpython at all today. This is how CPython works though and pretending __await__ does not exist will only bite users who write both. ``` >>> class c: ... pass ... >>> def f(self): ... yield ... yield ... return 'f to pay respects' ... >>> c.__await__ = f # could just as easily have put it on the class but this shows how it's wired >>> async def g(): ... awaitable_thing = c() ... partial = await awaitable_thing ... return 'press ' + partial ... >>> q = g() >>> q.send(None) >>> q.send(None) >>> q.send(None) Traceback (most recent call last): File "", line 1, in StopIteration: press f to pay respects ``` --- py/compile.c | 9 ++++++++- py/objgenerator.c | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/py/compile.c b/py/compile.c index 653aae0041..f194302982 100644 --- a/py/compile.c +++ b/py/compile.c @@ -2632,6 +2632,12 @@ STATIC void compile_yield_expr(compiler_t *comp, mp_parse_node_struct_t *pns) { EMIT_ARG(yield, MP_EMIT_YIELD_VALUE); } else if (MP_PARSE_NODE_IS_STRUCT_KIND(pns->nodes[0], PN_yield_arg_from)) { pns = (mp_parse_node_struct_t*)pns->nodes[0]; +#if MICROPY_PY_ASYNC_AWAIT + if(comp->scope_cur->scope_flags & MP_SCOPE_FLAG_ASYNC) { + compile_syntax_error(comp, (mp_parse_node_t)pns, translate("'yield from' inside async function")); + return; + } +#endif compile_node(comp, pns->nodes[0]); compile_yield_from(comp); } else { @@ -2648,7 +2654,8 @@ STATIC void compile_atom_expr_await(compiler_t *comp, mp_parse_node_struct_t *pn } compile_require_async_context(comp, pns); compile_atom_expr_normal(comp, pns); - compile_yield_from(comp); + + compile_await_object_method(comp, MP_QSTR___await__); } #endif diff --git a/py/objgenerator.c b/py/objgenerator.c index df421b60c8..baa6a9849c 100644 --- a/py/objgenerator.c +++ b/py/objgenerator.c @@ -225,6 +225,25 @@ STATIC mp_obj_t gen_instance_send(mp_obj_t self_in, mp_obj_t send_value) { STATIC MP_DEFINE_CONST_FUN_OBJ_2(gen_instance_send_obj, gen_instance_send); +#if MICROPY_PY_ASYNC_AWAIT +STATIC mp_obj_t gen_instance_await(mp_obj_t self_in) { + mp_obj_gen_instance_t *self = MP_OBJ_TO_PTR(self_in); + if ( !self->coroutine_generator ) { + // Pretend like a generator does not have this coroutine behavior. + // Pay no attention to the dir() behind the curtain + nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_AttributeError, + translate("type object 'generator' has no attribute '__await__'"))); + } + mp_obj_t ret = gen_resume_and_raise(self_in, mp_const_none, MP_OBJ_NULL); + if (ret == MP_OBJ_STOP_ITERATION) { + nlr_raise(mp_obj_new_exception(&mp_type_StopIteration)); + } else { + return ret; + } +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(gen_instance_await_obj, gen_instance_await); +#endif + STATIC mp_obj_t gen_instance_close(mp_obj_t self_in); STATIC mp_obj_t gen_instance_throw(size_t n_args, const mp_obj_t *args) { mp_obj_t exc = (n_args == 2) ? args[1] : args[2]; @@ -280,6 +299,9 @@ STATIC const mp_rom_map_elem_t gen_instance_locals_dict_table[] = { #if MICROPY_PY_GENERATOR_PEND_THROW { MP_ROM_QSTR(MP_QSTR_pend_throw), MP_ROM_PTR(&gen_instance_pend_throw_obj) }, #endif + #if MICROPY_PY_ASYNC_AWAIT + { MP_ROM_QSTR(MP_QSTR___await__), MP_ROM_PTR(&gen_instance_await_obj) }, + #endif }; STATIC MP_DEFINE_CONST_DICT(gen_instance_locals_dict, gen_instance_locals_dict_table); From 5d96afc5c2e4b4b6aa265a96a3921ac71f036980 Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Sat, 10 Oct 2020 15:30:37 -0700 Subject: [PATCH 1108/1293] i do not know if this is needed but this is not the vm i use anymore --- py/compile.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/py/compile.c b/py/compile.c index f194302982..da31846e23 100644 --- a/py/compile.c +++ b/py/compile.c @@ -2655,7 +2655,11 @@ STATIC void compile_atom_expr_await(compiler_t *comp, mp_parse_node_struct_t *pn compile_require_async_context(comp, pns); compile_atom_expr_normal(comp, pns); - compile_await_object_method(comp, MP_QSTR___await__); + + EMIT_ARG(load_method, MP_QSTR___await__, false); + EMIT_ARG(call_method, 0, 0, 0); + // EMIT_ARG(load_const_tok, MP_TOKEN_KW_NONE); // don't yield anything from an awaitable; only return the final result. + // EMIT_ARG(yield, MP_EMIT_YIELD_FROM); } #endif From 60deb321d1801ad86c9dfcfc09fd4c69eec1ef06 Mon Sep 17 00:00:00 2001 From: Targett363 Date: Sat, 10 Oct 2020 23:55:05 +0100 Subject: [PATCH 1109/1293] adding USB PID VID --- .../esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk | 4 ++-- .../boards/targett_module_clip_wrover/mpconfigboard.mk | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk b/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk index 580caa71b6..e307d7d623 100644 --- a/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk +++ b/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk @@ -1,5 +1,5 @@ -USB_VID = 0x239A -USB_PID = 0x80A8 +USB_VID = 0x1209 +USB_PID = 0x0011 USB_PRODUCT = "Targett Module Clip w/Wroom" USB_MANUFACTURER = "Targett" diff --git a/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk b/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk index 6832d21018..aff5ffd6cf 100644 --- a/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk +++ b/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk @@ -1,5 +1,5 @@ -USB_VID = 0x239A -USB_PID = 0x80A6 +USB_VID = 0x1209 +USB_PID = 0x0012 USB_PRODUCT = "Targett Module Clip w/Wrover" USB_MANUFACTURER = "Targett" From 92fcb92138bb8ef074dc1c5efc9c5e169989e36a Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 8 Oct 2020 20:14:25 +0000 Subject: [PATCH 1110/1293] Translated using Weblate (Spanish) Currently translated at 100.0% (829 of 829 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/es.po b/locale/es.po index 0d2b6743cb..75642b0098 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-09-29 20:14-0500\n" -"PO-Revision-Date: 2020-10-01 21:24+0000\n" -"Last-Translator: Alvaro Figueroa \n" +"PO-Revision-Date: 2020-10-09 17:19+0000\n" +"Last-Translator: dherrada \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" @@ -1709,7 +1709,7 @@ msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" -msgstr "" +msgstr "La longitud de rgb_pins debe ser 6, 12, 18, 24, o 30" #: supervisor/shared/safe_mode.c msgid "" @@ -3604,7 +3604,7 @@ msgstr "el tiempo de espera del perro guardián debe ser mayor a 0" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" -msgstr "" +msgstr "el ancho debe ser mayor que cero" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" From 940013a621c86ef93ecfec848b0f12ac8e9781a7 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Fri, 9 Oct 2020 23:10:33 +0200 Subject: [PATCH 1111/1293] 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 | 10 +++++++++- locale/el.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/sv.po | 10 +++++++++- locale/zh_Latn_pinyin.po | 13 +++++++++++-- 16 files changed, 146 insertions(+), 17 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 2ad8acd9b0..1d9f447b12 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-10-08 16:22+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -275,6 +275,10 @@ msgstr "pow() 3-arg tidak didukung" msgid "A hardware interrupt channel is already in use" msgstr "Sebuah channel hardware interrupt sedang digunakan" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1246,6 +1250,7 @@ msgid "No CCCD for this Characteristic" msgstr "Tidak ada CCCD untuk Karakteristik ini" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Tidak ada DAC (Digital Analog Converter) di dalam chip" @@ -1450,6 +1455,7 @@ msgstr "Izin ditolak" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3188,6 +3194,7 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3195,6 +3202,7 @@ msgstr "" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index c20674d782..a099e1c94a 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -275,6 +275,10 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1229,6 +1233,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -1425,6 +1430,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3148,6 +3154,7 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3155,6 +3162,7 @@ msgstr "" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index aefe48b856..5084ca505f 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -274,6 +274,10 @@ msgstr "3-arg pow() wird nicht unterstützt" msgid "A hardware interrupt channel is already in use" msgstr "Ein Hardware Interrupt Kanal wird schon benutzt" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1248,6 +1252,7 @@ msgid "No CCCD for this Characteristic" msgstr "Kein CCCD für diese Charakteristik" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Kein DAC im Chip vorhanden" @@ -1450,6 +1455,7 @@ msgstr "Zugang verweigert" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3229,6 +3235,7 @@ msgstr "pow() drittes Argument darf nicht 0 sein" msgid "pow() with 3 arguments requires integers" msgstr "pow () mit 3 Argumenten erfordert Integer" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3236,6 +3243,7 @@ msgstr "pow () mit 3 Argumenten erfordert Integer" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/el.po b/locale/el.po index c50c107d8c..32e08a5506 100644 --- a/locale/el.po +++ b/locale/el.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -270,6 +270,10 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1224,6 +1228,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -1420,6 +1425,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3143,6 +3149,7 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3150,6 +3157,7 @@ msgstr "" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/es.po b/locale/es.po index 75642b0098..3a7e1c6823 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-10-09 17:19+0000\n" "Last-Translator: dherrada \n" "Language-Team: \n" @@ -278,6 +278,10 @@ msgstr "pow() con 3 argumentos no soportado" msgid "A hardware interrupt channel is already in use" msgstr "El canal EXTINT ya está siendo utilizado" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1247,6 +1251,7 @@ msgid "No CCCD for this Characteristic" msgstr "No hay CCCD para esta característica" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "El chip no tiene DAC" @@ -1451,6 +1456,7 @@ msgstr "Permiso denegado" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3219,6 +3225,7 @@ 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/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3226,6 +3233,7 @@ msgstr "pow() con 3 argumentos requiere enteros" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "presionando botón de arranque al inicio.\n" diff --git a/locale/fil.po b/locale/fil.po index 3ddec187c8..4e7ce9ed8f 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -272,6 +272,10 @@ msgstr "3-arg pow() hindi suportado" msgid "A hardware interrupt channel is already in use" msgstr "Isang channel ng hardware interrupt ay ginagamit na" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, fuzzy, c-format msgid "Address must be %d bytes long" @@ -1239,6 +1243,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Walang DAC sa chip" @@ -1439,6 +1444,7 @@ msgstr "Walang pahintulot" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3194,6 +3200,7 @@ 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/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3201,6 +3208,7 @@ msgstr "pow() na may 3 argumento kailangan ng integers" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 38364d2cf8..45a4cc25d0 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-09-16 13:47+0000\n" "Last-Translator: Hugo Dahl \n" "Language: fr\n" @@ -279,6 +279,10 @@ msgstr "pow() non supporté avec 3 arguments" msgid "A hardware interrupt channel is already in use" msgstr "Un canal d'interruptions matérielles est déjà utilisé" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1252,6 +1256,7 @@ msgid "No CCCD for this Characteristic" msgstr "Pas de CCCD pour cette caractéristique" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Pas de DAC sur la puce" @@ -1458,6 +1463,7 @@ msgstr "Permission refusée" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3237,6 +3243,7 @@ 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/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3244,6 +3251,7 @@ msgstr "pow() avec 3 arguments nécessite des entiers" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/hi.po b/locale/hi.po index fdcb7dc3ee..90d7a1107a 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -270,6 +270,10 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1224,6 +1228,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -1420,6 +1425,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3143,6 +3149,7 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3150,6 +3157,7 @@ msgstr "" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index b94f73accb..7ae72a2e5e 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -271,6 +271,10 @@ msgstr "pow() con tre argmomenti non supportata" msgid "A hardware interrupt channel is already in use" msgstr "Un canale di interrupt hardware è già in uso" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, fuzzy, c-format msgid "Address must be %d bytes long" @@ -1243,6 +1247,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Nessun DAC sul chip" @@ -1448,6 +1453,7 @@ msgstr "Permesso negato" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3201,6 +3207,7 @@ 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/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3208,6 +3215,7 @@ msgstr "pow() con 3 argomenti richiede interi" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index e8ca0f808e..8443db3493 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-09-25 18:20+0000\n" "Last-Translator: Taku Fukada \n" "Language-Team: none\n" @@ -277,6 +277,10 @@ msgstr "引数3つのpow()は非対応" msgid "A hardware interrupt channel is already in use" msgstr "ハードウェア割り込みチャネルは使用中" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1239,6 +1243,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "チップにDACがありません" @@ -1438,6 +1443,7 @@ msgstr "パーミッション拒否" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3175,6 +3181,7 @@ msgstr "pow()の3つ目の引数は0にできません" msgid "pow() with 3 arguments requires integers" msgstr "pow()の第3引数には整数が必要" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3182,6 +3189,7 @@ msgstr "pow()の第3引数には整数が必要" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index e2bf7a372d..822c450a3f 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-10-05 12:12+0000\n" "Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" @@ -273,6 +273,10 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1229,6 +1233,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -1425,6 +1430,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3149,6 +3155,7 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3156,6 +3163,7 @@ msgstr "" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 8bc7d8840c..6ee0c68f40 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-09-09 16:05+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -275,6 +275,10 @@ msgstr "3-arg pow() niet ondersteund" msgid "A hardware interrupt channel is already in use" msgstr "Een hardware interrupt kanaal is al in gebruik" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1241,6 +1245,7 @@ msgid "No CCCD for this Characteristic" msgstr "Geen CCCD voor deze Characteristic" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Geen DAC op de chip" @@ -1446,6 +1451,7 @@ msgstr "Toegang geweigerd" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3204,6 +3210,7 @@ msgstr "derde argument van pow() mag geen 0 zijn" msgid "pow() with 3 arguments requires integers" msgstr "pow() met 3 argumenten vereist integers" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3211,6 +3218,7 @@ msgstr "pow() met 3 argumenten vereist integers" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 3cec5c4dfe..f2f2b2c14d 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-09-29 01:39+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -277,6 +277,10 @@ msgstr "3-argumentowy pow() jest niewspierany" msgid "A hardware interrupt channel is already in use" msgstr "Kanał przerwań sprzętowych w użyciu" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1240,6 +1244,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Brak DAC" @@ -1436,6 +1441,7 @@ msgstr "Odmowa dostępu" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3167,6 +3173,7 @@ msgstr "trzeci argument pow() nie może być 0" msgid "pow() with 3 arguments requires integers" msgstr "trzyargumentowe pow() wymaga liczb całkowitych" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3174,6 +3181,7 @@ msgstr "trzyargumentowe pow() wymaga liczb całkowitych" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e2ca8e9ab0..3a17d2325a 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-10-02 22:53+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -279,6 +279,10 @@ msgstr "3-arg pow() não compatível" msgid "A hardware interrupt channel is already in use" msgstr "Um canal de interrupção de hardware já está em uso" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1250,6 +1254,7 @@ msgid "No CCCD for this Characteristic" msgstr "Não há nenhum CCCD para esta característica" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Nenhum DAC no chip" @@ -1455,6 +1460,7 @@ msgstr "Permissão negada" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3234,6 +3240,7 @@ 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/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3241,6 +3248,7 @@ msgstr "o pow() com 3 argumentos requer números inteiros" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "pressionando o botão de boot na inicialização.\n" diff --git a/locale/sv.po b/locale/sv.po index de4c592958..a8d4d9ffc4 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-10-02 22:53+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -275,6 +275,10 @@ msgstr "3-arguments pow() stöds inte" msgid "A hardware interrupt channel is already in use" msgstr "En kanal för hårdvaruavbrott används redan" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1240,6 +1244,7 @@ msgid "No CCCD for this Characteristic" msgstr "Ingen CCCD för denna karaktäristik" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Ingen DAC på chipet" @@ -1443,6 +1448,7 @@ msgstr "Åtkomst nekad" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -3201,6 +3207,7 @@ 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/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3208,6 +3215,7 @@ msgstr "pow() med 3 argument kräver heltal" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "trycka på startknappen vid start.\n" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 32af6c2c6f..4910ea1306 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-06 13:26-0400\n" "PO-Revision-Date: 2020-10-08 16:22+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -277,6 +277,10 @@ msgstr "bù zhīchí 3-arg pow ()" msgid "A hardware interrupt channel is already in use" msgstr "Yìngjiàn zhōngduàn tōngdào yǐ zài shǐyòng zhōng" +#: ports/esp32s2/common-hal/analogio/AnalogIn.c +msgid "ADC2 is being used by WiFi" +msgstr "" + #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" @@ -1237,6 +1241,7 @@ msgid "No CCCD for this Characteristic" msgstr "Zhège tèzhēng méiyǒu CCCD" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Méiyǒu DAC zài xīnpiàn shàng de" @@ -1439,6 +1444,7 @@ msgstr "Quánxiàn bèi jùjué" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/esp32s2/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c @@ -1489,7 +1495,8 @@ msgstr "Duānkǒu bù jiēshòu PWM zàibō. Tōngguò yǐn jiǎo, pínlǜ hé z msgid "" "Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " "instead" -msgstr "Duānkǒu bù jiēshòu yǐn jiǎo huò pínlǜ. Gòuzào bìng chuándì PWMOut zàibō" +msgstr "" +"Duānkǒu bù jiēshòu yǐn jiǎo huò pínlǜ. Gòuzào bìng chuándì PWMOut zàibō" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" @@ -3189,6 +3196,7 @@ 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/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3196,6 +3204,7 @@ msgstr "pow() yǒu 3 cānshù xūyào zhěngshù" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "Zài qǐdòng shí àn qǐdòng ànniǔ.\n" From f987b363c89d43b34ff1eafd3cc5af8afd857bfe Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Fri, 9 Oct 2020 21:43:53 +0000 Subject: [PATCH 1112/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (830 of 830 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 3a17d2325a..92214322d7 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: 2020-10-06 13:26-0400\n" -"PO-Revision-Date: 2020-10-02 22:53+0000\n" +"PO-Revision-Date: 2020-10-09 22:07+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -281,7 +281,7 @@ msgstr "Um canal de interrupção de hardware já está em uso" #: ports/esp32s2/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" -msgstr "" +msgstr "O ADC2 está sendo usado pelo WiFi" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format From e3378b7ccbf9a48b0488ec92a085779d1abc6112 Mon Sep 17 00:00:00 2001 From: oon arfiandwi Date: Sat, 10 Oct 2020 01:12:52 +0000 Subject: [PATCH 1113/1293] Translated using Weblate (Indonesian) Currently translated at 45.6% (379 of 830 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/id/ --- locale/ID.po | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 1d9f447b12..76e83920cc 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-06 13:26-0400\n" -"PO-Revision-Date: 2020-10-08 16:22+0000\n" +"PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" "Language: ID\n" @@ -1612,15 +1612,15 @@ msgstr "" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" -msgstr "" +msgstr "Kesalahan Init SPI" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Re-initialization error" -msgstr "" +msgstr "Kesalahan Inisialisasi ulang SPI" #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" -msgstr "" +msgstr "Tingkat sampel harus positif" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #, c-format @@ -1629,15 +1629,15 @@ msgstr "Nilai sampel terlalu tinggi. Nilai harus kurang dari %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." -msgstr "" +msgstr "Pindai sudah dalam proses. Hentikan dengan stop_scan." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" -msgstr "" +msgstr "Pin CTS yang dipilih tidak valid" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected RTS pin not valid" -msgstr "" +msgstr "Pin RTS yang dipilih tidak valid" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1654,14 +1654,14 @@ msgstr "" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." -msgstr "" +msgstr "Potongan dan nilai panjangnya berbeda." #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/TileGrid.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" -msgstr "" +msgstr "Potongan tidak didukung" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" @@ -1669,7 +1669,7 @@ msgstr "" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "" +msgstr "Buffer sumber dan tujuan harus memiliki panjang yang sama" #: extmod/modure.c msgid "Splitting with sub-captures" @@ -1677,15 +1677,15 @@ msgstr "Memisahkan dengan menggunakan sub-captures" #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" -msgstr "" +msgstr "Ukuran stack minimal harus 256" #: shared-bindings/multiterminal/__init__.c msgid "Stream missing readinto() or write() method." -msgstr "" +msgstr "Aliran tidak menemukan metode readinto() atau write()." #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" -msgstr "" +msgstr "Berikan setidaknya satu pin UART" #: shared-bindings/gnss/GNSS.c msgid "System entry must be gnss.SatelliteSystem" @@ -1693,19 +1693,23 @@ msgstr "" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" -msgstr "" +msgstr "Waktu baca suhu habis" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Please increase the stack size if you know how, or if not:" msgstr "" +"heap dari CircuitPython rusak karena stack terlalu kecil.\n" +"Harap tambah ukuran stack jika Anda tahu caranya, atau jika tidak:" #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode.\n" msgstr "" +"Modul `microcontroller` digunakan untukboot ke mode aman. Tekan reset untuk " +"keluar dari mode aman.\n" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" From 6583e1087cb2d56d45f5daf678ff2ef8d3f115cb Mon Sep 17 00:00:00 2001 From: hexthat Date: Sat, 10 Oct 2020 11:23:02 +0000 Subject: [PATCH 1114/1293] Translated using Weblate (Chinese (Pinyin)) Currently translated at 100.0% (830 of 830 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/zh_Latn/ --- locale/zh_Latn_pinyin.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 4910ea1306..9e7baa9d02 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: 2020-10-06 13:26-0400\n" -"PO-Revision-Date: 2020-10-08 16:22+0000\n" +"PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" @@ -279,7 +279,7 @@ msgstr "Yìngjiàn zhōngduàn tōngdào yǐ zài shǐyòng zhōng" #: ports/esp32s2/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" -msgstr "" +msgstr "ADC2 zhèng yóu WiFi shǐ yòng" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format @@ -3261,7 +3261,7 @@ msgstr "yòubiān bìxū shì ndarray huò biāoliàng" #: py/objstr.c msgid "rsplit(None,n)" -msgstr "" +msgstr "Rchāifēn(wú ,N)" #: shared-bindings/audiocore/RawSample.c msgid "" From 98aa4b794346161e512d0fba913901021dd2cfbf Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Sat, 10 Oct 2020 23:39:32 -0700 Subject: [PATCH 1115/1293] update async tests with less upython workaround and more cpython compatibility --- py/compile.c | 12 ++++++++---- py/objgenerator.c | 8 ++------ tests/basics/async_await2.py | 28 ++++++++++++++-------------- tests/basics/async_for2.py | 28 ++++++++++++++-------------- tests/basics/async_with2.py | 32 ++++++++++++++++---------------- 5 files changed, 54 insertions(+), 54 deletions(-) diff --git a/py/compile.c b/py/compile.c index da31846e23..45a586594d 100644 --- a/py/compile.c +++ b/py/compile.c @@ -40,6 +40,8 @@ #if MICROPY_ENABLE_COMPILER +#define DEBUG_PRINT(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) + // TODO need to mangle __attr names #define INVALID_LABEL (0xffff) @@ -853,7 +855,7 @@ STATIC void compile_decorated(compiler_t *comp, mp_parse_node_struct_t *pns) { mp_parse_node_struct_t *pns0 = (mp_parse_node_struct_t*)pns_body->nodes[0]; body_name = compile_funcdef_helper(comp, pns0, emit_options); scope_t *fscope = (scope_t*)pns0->nodes[4]; - fscope->scope_flags |= MP_SCOPE_FLAG_GENERATOR; + fscope->scope_flags |= MP_SCOPE_FLAG_GENERATOR | MP_SCOPE_FLAG_ASYNC; #endif } else { assert(MP_PARSE_NODE_STRUCT_KIND(pns_body) == PN_classdef); // should be @@ -2655,11 +2657,13 @@ STATIC void compile_atom_expr_await(compiler_t *comp, mp_parse_node_struct_t *pn compile_require_async_context(comp, pns); compile_atom_expr_normal(comp, pns); - + // If it's an awaitable thing, need to reach for the __await__ method for the coroutine. + // async def functions' __await__ return themselves, which are able to receive a send(), + // while other types with custom __await__ implementations return async generators. EMIT_ARG(load_method, MP_QSTR___await__, false); EMIT_ARG(call_method, 0, 0, 0); - // EMIT_ARG(load_const_tok, MP_TOKEN_KW_NONE); // don't yield anything from an awaitable; only return the final result. - // EMIT_ARG(yield, MP_EMIT_YIELD_FROM); + EMIT_ARG(load_const_tok, MP_TOKEN_KW_NONE); + EMIT_ARG(yield, MP_EMIT_YIELD_FROM); } #endif diff --git a/py/objgenerator.c b/py/objgenerator.c index baa6a9849c..5e651ac269 100644 --- a/py/objgenerator.c +++ b/py/objgenerator.c @@ -234,12 +234,8 @@ STATIC mp_obj_t gen_instance_await(mp_obj_t self_in) { nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_AttributeError, translate("type object 'generator' has no attribute '__await__'"))); } - mp_obj_t ret = gen_resume_and_raise(self_in, mp_const_none, MP_OBJ_NULL); - if (ret == MP_OBJ_STOP_ITERATION) { - nlr_raise(mp_obj_new_exception(&mp_type_StopIteration)); - } else { - return ret; - } + // You can directly call send on a coroutine generator or you can __await__ then send on the return of that. + return self; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(gen_instance_await_obj, gen_instance_await); #endif diff --git a/tests/basics/async_await2.py b/tests/basics/async_await2.py index 7097ce85a6..2c5015fb4f 100644 --- a/tests/basics/async_await2.py +++ b/tests/basics/async_await2.py @@ -1,22 +1,22 @@ # test await expression -import sys -if sys.implementation.name in ('micropython', 'circuitpython'): - # uPy allows normal generators to be awaitables - coroutine = lambda f: f -else: - import types - coroutine = types.coroutine +# uPy allows normal generators to be awaitables. +# CircuitPython does not. +# In CircuitPython you need to have an __await__ method on an awaitable like in CPython; +# and like in CPython, generators do not have __await__. -@coroutine -def wait(value): - print('wait value:', value) - msg = yield 'message from wait(%u)' % value - print('wait got back:', msg) - return 10 +class Awaitable: + def __init__(self, value): + self.value = value + + def __await__(self): + print('wait value:', self.value) + msg = yield 'message from wait(%u)' % self.value + print('wait got back:', msg) + return 10 async def f(): - x = await wait(1)**2 + x = await Awaitable(1)**2 print('x =', x) coro = f() diff --git a/tests/basics/async_for2.py b/tests/basics/async_for2.py index add74dd388..d7b97cb386 100644 --- a/tests/basics/async_for2.py +++ b/tests/basics/async_for2.py @@ -1,19 +1,19 @@ # test waiting within "async for" __anext__ function -import sys -if sys.implementation.name in ('micropython', 'circuitpython'): - # uPy allows normal generators to be awaitables - coroutine = lambda f: f -else: - import types - coroutine = types.coroutine +# uPy allows normal generators to be awaitables. +# CircuitPython does not. +# In CircuitPython you need to have an __await__ method on an awaitable like in CPython; +# and like in CPython, generators do not have __await__. -@coroutine -def f(x): - print('f start:', x) - yield x + 1 - yield x + 2 - return x + 3 +class Awaitable: + def __init__(self, x): + self.x = x + + def __await__(self): + print('f start:', self.x) + yield self.x + 1 + yield self.x + 2 + return self.x + 3 class ARange: def __init__(self, high): @@ -27,7 +27,7 @@ class ARange: async def __anext__(self): print('anext') - print('f returned:', await f(20)) + print('f returned:', await Awaitable(20)) if self.cur < self.high: val = self.cur self.cur += 1 diff --git a/tests/basics/async_with2.py b/tests/basics/async_with2.py index 5fb06ba604..2e9e9e5a75 100644 --- a/tests/basics/async_with2.py +++ b/tests/basics/async_with2.py @@ -1,32 +1,32 @@ # test waiting within async with enter/exit functions -import sys -if sys.implementation.name in ('micropython', 'circuitpython'): - # uPy allows normal generators to be awaitables - coroutine = lambda f: f -else: - import types - coroutine = types.coroutine +# uPy allows normal generators to be awaitables. +# CircuitPython does not. +# In CircuitPython you need to have an __await__ method on an awaitable like in CPython; +# and like in CPython, generators do not have __await__. -@coroutine -def f(x): - print('f start:', x) - yield x + 1 - yield x + 2 - return x + 3 +class Awaitable: + def __init__(self, x): + self.x = x + + def __await__(self): + print('f start:', self.x) + yield self.x + 1 + yield self.x + 2 + return self.x + 3 class AContext: async def __aenter__(self): print('enter') - print('f returned:', await f(10)) + print('f returned:', await Awaitable(10)) async def __aexit__(self, exc_type, exc, tb): print('exit', exc_type, exc) - print('f returned:', await f(20)) + print('f returned:', await Awaitable(20)) async def coro(): async with AContext(): print('body start') - print('body f returned:', await f(30)) + print('body f returned:', await Awaitable(30)) print('body end') o = coro() From 88db16a2c6c166f5b407b507efa8f56026996f9b Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Sat, 10 Oct 2020 23:50:12 -0700 Subject: [PATCH 1116/1293] add translations --- locale/circuitpython.pot | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 199f39c589..fc564feeaf 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -246,6 +246,10 @@ msgstr "" msgid "'return' outside function" msgstr "" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "" @@ -289,6 +293,7 @@ msgid "All I2C peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -896,6 +901,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -932,7 +938,8 @@ msgid "Group full" msgstr "" #: 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/sdioio/SDCard.c +#: 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 "" @@ -1002,7 +1009,8 @@ msgid "Invalid %q pin" msgstr "" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3426,6 +3434,10 @@ msgstr "" msgid "type object '%q' has no attribute '%q'" msgstr "" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "" From 3c46e3a6aab8895f19302c4fe165d61d30f1a45e Mon Sep 17 00:00:00 2001 From: Kenny Date: Sun, 11 Oct 2020 08:16:36 -0700 Subject: [PATCH 1117/1293] Turn off async for circuitplayground express Firmware too large --- .../atmel-samd/boards/circuitplayground_express/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk index 81391b953e..13ec9e861c 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk @@ -15,6 +15,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 +MICROPY_PY_ASYNC_AWAIT = 0 SUPEROPT_GC = 0 CFLAGS_INLINE_LIMIT = 55 From c139eccc9271b8b81eb8ad3eb2dc09a68199a12c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 11 Oct 2020 16:23:02 -0500 Subject: [PATCH 1118/1293] remove warning that seems unneeded now --- py/circuitpy_defns.mk | 3 --- 1 file changed, 3 deletions(-) diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 76c0a4db67..e5debc8ea5 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -45,7 +45,6 @@ BASE_CFLAGS = \ -Wnested-externs \ -Wunreachable-code \ -Wcast-align \ - -Wno-error=lto-type-mismatch \ -D__$(CHIP_VARIANT)__ \ -ffunction-sections \ -fdata-sections \ @@ -66,7 +65,6 @@ ifneq ($(FROZEN_DIR),) # To use frozen source modules, put your .py files in a subdirectory (eg scripts/) # and then invoke make with FROZEN_DIR=scripts (be sure to build from scratch). CFLAGS += -DMICROPY_MODULE_FROZEN_STR -CFLAGS += -Wno-error=lto-type-mismatch endif # To use frozen bytecode, put your .py files in a subdirectory (eg frozen/) and @@ -76,7 +74,6 @@ endif ifneq ($(FROZEN_MPY_DIRS),) CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool CFLAGS += -DMICROPY_MODULE_FROZEN_MPY -CFLAGS += -Wno-error=lto-type-mismatch endif From 607e4a905ae8654bd8450ae137ffa24367039277 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 11 Oct 2020 15:19:55 -0500 Subject: [PATCH 1119/1293] build: parallelize the creation of qstr.i.last Rather than simply invoking gcc in preprocessor mode with a list of files, use a Python script with the (python3) ThreadPoolExecutor to invoke the preprocessor in parallel. The amount of concurrency is the number of system CPUs, not the makefile "-j" parallelism setting, because there is no simple and correct way for a Python program to correctly work together with make's idea of parallelism. This reduces the build time of stm32f405 feather (a non-LTO build) from 16s to 12s on my 16-thread Ryzen machine. --- py/genlast.py | 38 ++++++++++++++++++++++++++++++++++++++ py/mkrules.mk | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 py/genlast.py diff --git a/py/genlast.py b/py/genlast.py new file mode 100644 index 0000000000..e14e7ef1e0 --- /dev/null +++ b/py/genlast.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +import sys +from concurrent.futures import ThreadPoolExecutor +import multiprocessing +import threading +import subprocess + + +def checkoutput1(args): + info = subprocess.run(args, check=True, stdout=subprocess.PIPE, input='') + return info.stdout + +idx1 = sys.argv.index('--') +idx2 = sys.argv.index('--', idx1+1) +check = sys.argv[1:idx1] +always = sys.argv[idx1+1:idx2] +command = sys.argv[idx2+1:] + +output_lock = threading.Lock() +def preprocess(fn): + output = checkoutput1(command + [fn]) + # Ensure our output doesn't interleave with others + # a threading.Lock is not a context manager object :( + try: + output_lock.acquire() + sys.stdout.buffer.write(output) + finally: + output_lock.release() + +def maybe_preprocess(fn): + if subprocess.call(["grep", "-lqE", "(MP_QSTR|translate)", fn]) == 0: + preprocess(fn) + +executor = ThreadPoolExecutor(max_workers=multiprocessing.cpu_count() + 1) +executor.map(maybe_preprocess, check) +executor.map(preprocess, always) +executor.shutdown() diff --git a/py/mkrules.mk b/py/mkrules.mk index 0b3ecc0e17..84e16ec960 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -78,7 +78,7 @@ $(OBJ): | $(HEADER_BUILD)/qstrdefs.enum.h $(HEADER_BUILD)/mpversion.h # - else, process all source files ($^) [this covers "make -B" which can set $? to empty] $(HEADER_BUILD)/qstr.i.last: $(SRC_QSTR) $(SRC_QSTR_PREPROCESSOR) $(QSTR_GLOBAL_DEPENDENCIES) | $(HEADER_BUILD)/mpversion.h $(STEPECHO) "GEN $@" - $(Q)grep -lE "(MP_QSTR|translate)" $(if $(filter $?,$(QSTR_GLOBAL_DEPENDENCIES)),$^,$(if $?,$?,$^)) | xargs $(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) $(SRC_QSTR_PREPROCESSOR) >$(HEADER_BUILD)/qstr.i.last; + $(Q)$(PYTHON3) $(PY_SRC)/genlast.py $(if $(filter $?,$(QSTR_GLOBAL_DEPENDENCIES)),$^,$(if $?,$?,$^)) -- $(SRC_QSTR_PREPROCESSOR) -- $(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) >$(HEADER_BUILD)/qstr.i.last; $(HEADER_BUILD)/qstr.split: $(HEADER_BUILD)/qstr.i.last $(PY_SRC)/makeqstrdefs.py $(STEPECHO) "GEN $@" From 774f2e16ba166b5976a46519c38ea894f897dca4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 11 Oct 2020 21:09:08 -0500 Subject: [PATCH 1120/1293] displayio, framebufferio: Remove spurious call to supervisor_start_terminal A call to supervisor_start_terminal remained in common_hal_displayio_display_construct and was copied to other display _construct functions, even though it was also being done in displayio_display_core_construct when that was factored out. Originally, this was harmless, except it created an extra allocation. When investigating #3482, I found that this bug became harmful, especially for displays that were created in Python code, because it caused a supervisor allocation to leak. I believe that it is safe to merge #3482 after this PR is merged. --- shared-module/displayio/Display.c | 2 -- shared-module/displayio/EPaperDisplay.c | 2 -- shared-module/framebufferio/FramebufferDisplay.c | 2 -- 3 files changed, 6 deletions(-) diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index bb7e40f41d..499c00ffbb 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -107,8 +107,6 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, i += 2 + data_size; } - supervisor_start_terminal(width, height); - // Always set the backlight type in case we're reusing memory. self->backlight_inout.base.type = &mp_type_NoneType; if (backlight_pin != NULL && common_hal_mcu_pin_is_free(backlight_pin)) { diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 5b055e62e4..46c7ea82e1 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -90,8 +90,6 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t* // TODO: Clear } - supervisor_start_terminal(width, height); - // Set the group after initialization otherwise we may send pixels while we delay in // initialization. common_hal_displayio_epaperdisplay_show(self, &circuitpython_splash); diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 5163c3a7bc..6b506c7faf 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -96,8 +96,6 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu common_hal_framebufferio_framebufferdisplay_set_rotation(self, rotation); } - supervisor_start_terminal(self->core.width, self->core.height); - // Set the group after initialization otherwise we may send pixels while we delay in // initialization. common_hal_framebufferio_framebufferdisplay_show(self, &circuitpython_splash); From 479552ce564410f2d96855f5dbca223317c4cbe0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 11 Oct 2020 16:03:46 -0500 Subject: [PATCH 1121/1293] build: Make genlast write the "split" files This gets a further speedup of about 2s (12s -> 9.5s elapsed build time) for stm32f405_feather For what are probably historical reasons, the qstr process involves preprocessing a large number of source files into a single "qstr.i.last" file, then reading this and splitting it into one "qstr" file for each original source ("*.c") file. By eliminating the step of writing qstr.i.last as well as making the regular-expression-matching part be parallelized, build speed is further improved. Because the step to build QSTR_DEFS_COLLECTED does not access qstr.i.last, the path is replaced with "-" in the Makefile. --- py/genlast.py | 77 ++++++++++++++++++++++++++++++++++++--------------- py/mkrules.mk | 10 ++----- 2 files changed, 58 insertions(+), 29 deletions(-) diff --git a/py/genlast.py b/py/genlast.py index e14e7ef1e0..1df2a24825 100644 --- a/py/genlast.py +++ b/py/genlast.py @@ -1,38 +1,71 @@ #!/usr/bin/env python3 import sys -from concurrent.futures import ThreadPoolExecutor +import re +import os +import itertools +from concurrent.futures import ProcessPoolExecutor import multiprocessing import threading import subprocess +from makeqstrdefs import qstr_unescape, QSTRING_BLACK_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_translate = re.compile(r'translate\(\"((?:(?=(\\?))\2.)*?)\"\)', re.DOTALL) + +def write_out(fname, output_dir, output): + if output: + for m, r in [("/", "__"), ("\\", "__"), (":", "@"), ("..", "@@")]: + fname = fname.replace(m, r) + with open(output_dir + "/" + fname + ".qstr", "w") as f: + f.write("\n".join(output) + "\n") + +def process_file(fname, output_dir, content): + content = content.decode('utf-8', errors='ignore') + output = [] + for match in re_qstr.findall(content): + name = match.replace('MP_QSTR_', '') + if name not in QSTRING_BLACK_LIST: + output.append('Q(' + qstr_unescape(name) + ')') + for match in re_translate.findall(content): + output.append('TRANSLATE("' + match[0] + '")') + + write_out(fname, output_dir, output) + def checkoutput1(args): info = subprocess.run(args, check=True, stdout=subprocess.PIPE, input='') return info.stdout -idx1 = sys.argv.index('--') -idx2 = sys.argv.index('--', idx1+1) -check = sys.argv[1:idx1] -always = sys.argv[idx1+1:idx2] -command = sys.argv[idx2+1:] - -output_lock = threading.Lock() -def preprocess(fn): - output = checkoutput1(command + [fn]) - # Ensure our output doesn't interleave with others - # a threading.Lock is not a context manager object :( +def preprocess(command, output_dir, fn): try: - output_lock.acquire() - sys.stdout.buffer.write(output) - finally: - output_lock.release() + output = checkoutput1(command + [fn]) + process_file(fn, output_dir, output) + except Exception as e: + print(e, file=sys.stderr) -def maybe_preprocess(fn): +def maybe_preprocess(command, output_dir, fn): if subprocess.call(["grep", "-lqE", "(MP_QSTR|translate)", fn]) == 0: - preprocess(fn) + preprocess(command, output_dir, fn) -executor = ThreadPoolExecutor(max_workers=multiprocessing.cpu_count() + 1) -executor.map(maybe_preprocess, check) -executor.map(preprocess, always) -executor.shutdown() +if __name__ == '__main__': + + + idx1 = sys.argv.index('--') + idx2 = sys.argv.index('--', idx1+1) + output_dir = sys.argv[1] + check = sys.argv[2:idx1] + always = sys.argv[idx1+1:idx2] + command = sys.argv[idx2+1:] + + if not os.path.isdir(output_dir): + os.makedirs(output_dir) + + # Mac and Windows use 'spawn'. Uncomment this during testing to catch spawn-specific problems on Linux. + #multiprocessing.set_start_method("spawn") + executor = ProcessPoolExecutor(max_workers=multiprocessing.cpu_count() + 1) + executor.map(maybe_preprocess, itertools.repeat(command), itertools.repeat(output_dir), check) + executor.map(preprocess, itertools.repeat(command), itertools.repeat(output_dir), always) + executor.shutdown() diff --git a/py/mkrules.mk b/py/mkrules.mk index 84e16ec960..549b0e5e42 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -76,18 +76,14 @@ $(OBJ): | $(HEADER_BUILD)/qstrdefs.enum.h $(HEADER_BUILD)/mpversion.h # - if anything in QSTR_GLOBAL_DEPENDENCIES is newer, then process all source files ($^) # - else, if list of newer prerequisites ($?) is not empty, then process just these ($?) # - else, process all source files ($^) [this covers "make -B" which can set $? to empty] -$(HEADER_BUILD)/qstr.i.last: $(SRC_QSTR) $(SRC_QSTR_PREPROCESSOR) $(QSTR_GLOBAL_DEPENDENCIES) | $(HEADER_BUILD)/mpversion.h +$(HEADER_BUILD)/qstr.split: $(SRC_QSTR) $(SRC_QSTR_PREPROCESSOR) $(QSTR_GLOBAL_DEPENDENCIES) | $(HEADER_BUILD)/mpversion.h $(PY_SRC)/genlast.py $(STEPECHO) "GEN $@" - $(Q)$(PYTHON3) $(PY_SRC)/genlast.py $(if $(filter $?,$(QSTR_GLOBAL_DEPENDENCIES)),$^,$(if $?,$?,$^)) -- $(SRC_QSTR_PREPROCESSOR) -- $(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) >$(HEADER_BUILD)/qstr.i.last; - -$(HEADER_BUILD)/qstr.split: $(HEADER_BUILD)/qstr.i.last $(PY_SRC)/makeqstrdefs.py - $(STEPECHO) "GEN $@" - $(Q)$(PYTHON3) $(PY_SRC)/makeqstrdefs.py split $(HEADER_BUILD)/qstr.i.last $(HEADER_BUILD)/qstr $(QSTR_DEFS_COLLECTED) + $(Q)$(PYTHON3) $(PY_SRC)/genlast.py $(HEADER_BUILD)/qstr $(if $(filter $?,$(QSTR_GLOBAL_DEPENDENCIES)),$^,$(if $?,$?,$^)) -- $(SRC_QSTR_PREPROCESSOR) -- $(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) $(Q)touch $@ $(QSTR_DEFS_COLLECTED): $(HEADER_BUILD)/qstr.split $(PY_SRC)/makeqstrdefs.py $(STEPECHO) "GEN $@" - $(Q)$(PYTHON3) $(PY_SRC)/makeqstrdefs.py cat $(HEADER_BUILD)/qstr.i.last $(HEADER_BUILD)/qstr $(QSTR_DEFS_COLLECTED) + $(Q)$(PYTHON3) $(PY_SRC)/makeqstrdefs.py cat - $(HEADER_BUILD)/qstr $(QSTR_DEFS_COLLECTED) # $(sort $(var)) removes duplicates # From 94beeabc515986e366de569e85d395ab2678ee3d Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Sun, 11 Oct 2020 22:42:21 -0700 Subject: [PATCH 1122/1293] remove unnecessary board configuration and address feedback --- ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk | 1 - ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk | 3 --- .../atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk | 1 - ports/atmel-samd/boards/datum_distance/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/datum_imu/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/datum_light/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/datum_weather/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk | 1 - ports/atmel-samd/boards/pewpew10/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/shirtty/mpconfigboard.mk | 3 --- .../boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk | 1 - ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk | 1 - ports/atmel-samd/boards/uchip/mpconfigboard.mk | 1 - ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk | 3 --- ports/nrf/boards/pca10100/mpconfigboard.mk | 3 +-- ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk | 1 - py/circuitpy_mpconfig.mk | 4 +--- py/compile.c | 2 -- 30 files changed, 2 insertions(+), 72 deletions(-) diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk index 2c0056847c..d31d1f54a4 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk @@ -10,4 +10,3 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 -MICROPY_PY_ASYNC_AWAIT = 0 diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk index 230bce4f21..7eb83a1230 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk index 1d652737a7..fd24edafa2 100644 --- a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk index e4d0916fa1..a5722c9ade 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk index 47a5434504..055e6b19e2 100644 --- a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk @@ -9,6 +9,3 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk index 201c9b1424..892a5371ef 100644 --- a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk +++ b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_ROTARYIO = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk index fa437bf364..178258b6cd 100755 --- a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk @@ -34,4 +34,3 @@ RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 SUPEROPT_VM = 0 endif - diff --git a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk index 365b935ee8..ae05d32f2c 100644 --- a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk index f5900c8f78..6fd05f403b 100644 --- a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk index 3cefa856fa..d42a7869de 100644 --- a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk index 1293a5aaa3..d92cbc71b3 100644 --- a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk index 0f784be8af..143910318d 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk index b535085704..69ebdfc237 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk index fe588b1635..c33ab07400 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk @@ -21,7 +21,6 @@ CIRCUITPY_SAMD = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_TOUCHIO = 0 -MICROPY_PY_ASYNC_AWAIT = 0 CFLAGS_INLINE_LIMIT = 35 # Make more room. @@ -30,4 +29,3 @@ SUPEROPT_GC = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_RFM69 - diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index f2e27d1e23..49b0ef5e36 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -22,7 +22,6 @@ CIRCUITPY_SAMD = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_TOUCHIO = 0 -MICROPY_PY_ASYNC_AWAIT = 0 CFLAGS_INLINE_LIMIT = 35 # Make more room. @@ -31,4 +30,3 @@ SUPEROPT_GC = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_RFM9x - diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk index 10705f2802..e2604c89b5 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk @@ -9,7 +9,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 -MICROPY_PY_ASYNC_AWAIT = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index b5e1ce69ad..1cc91a8df6 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -24,6 +24,3 @@ SUPEROPT_GC = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x CFLAGS_BOARD = --param max-inline-insns-auto=15 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk b/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk index b89bee482b..bedec87f45 100644 --- a/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk +++ b/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk index ed4960cd83..a04e097692 100644 --- a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk +++ b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk @@ -13,6 +13,3 @@ CIRCUITPY_I2CPERIPHERAL = 1 CIRCUITPY_TOUCHIO = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk index 18b057a18a..22e2059a93 100644 --- a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk index c97207b215..a2bd577cd3 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk index d9bde81833..9460d0009b 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk @@ -11,6 +11,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index a65c570c7d..4cd50a030d 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -9,7 +9,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 -MICROPY_PY_ASYNC_AWAIT = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk index 82d2768d8f..7eda151f36 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk @@ -35,4 +35,3 @@ RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 SUPEROPT_VM = 0 endif - diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index 7270effde4..d08690a15a 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -14,4 +14,3 @@ CIRCUITPY_FULL_BUILD = 0 CFLAGS_INLINE_LIMIT = 45 SUPEROPT_GC = 0 -MICROPY_PY_ASYNC_AWAIT = 0 diff --git a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk index b08d36b59d..9309fdce0d 100644 --- a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk +++ b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk @@ -28,6 +28,3 @@ CIRCUITPY_COUNTIO=0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD - -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 6a6ca72ce1..86ba654548 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -24,10 +24,9 @@ CIRCUITPY_RTC = 1 CIRCUITPY_SDCARDIO = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_ULAB = 0 +MICROPY_PY_ASYNC_AWAIT = 0 SUPEROPT_GC = 0 # Override optimization to keep binary small OPTIMIZATION_FLAGS = -Os -MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk b/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk index 7077766a37..eb28ef5ea3 100644 --- a/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk +++ b/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk @@ -8,4 +8,3 @@ MCU_CHIP = nrf52840 INTERNAL_FLASH_FILESYSTEM = 1 MICROPY_PY_ASYNC_AWAIT = 0 - diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index ba75d29a5c..91850448db 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -32,6 +32,7 @@ CIRCUITPY_FULL_BUILD ?= 1 CFLAGS += -DCIRCUITPY_FULL_BUILD=$(CIRCUITPY_FULL_BUILD) +# async/await language keyword support MICROPY_PY_ASYNC_AWAIT ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DMICROPY_PY_ASYNC_AWAIT=$(MICROPY_PY_ASYNC_AWAIT) @@ -292,6 +293,3 @@ CFLAGS += -DCIRCUITPY_WIFI=$(CIRCUITPY_WIFI) # Enabled micropython.native decorator (experimental) CIRCUITPY_ENABLE_MPY_NATIVE ?= 0 CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE) - -# async/await language keyword support -MICROPY_PY_ASYNC_AWAIT ?= $(CIRCUITPY_FULL_BUILD) diff --git a/py/compile.c b/py/compile.c index 45a586594d..04bcf5bc14 100644 --- a/py/compile.c +++ b/py/compile.c @@ -40,8 +40,6 @@ #if MICROPY_ENABLE_COMPILER -#define DEBUG_PRINT(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) - // TODO need to mangle __attr names #define INVALID_LABEL (0xffff) From 10badd93c3ce4d2cdf074fe03bf23f9e481aa03e Mon Sep 17 00:00:00 2001 From: Kenny <3454741+WarriorOfWire@users.noreply.github.com> Date: Sun, 11 Oct 2020 22:52:27 -0700 Subject: [PATCH 1123/1293] leftover newlines --- ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk | 1 - ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk | 1 - 2 files changed, 2 deletions(-) diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk index e2604c89b5..0345417a98 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk @@ -21,4 +21,3 @@ ifeq ($(TRANSLATION), de_DE) RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 endif - diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index 4cd50a030d..735d422973 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -22,4 +22,3 @@ RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 SUPEROPT_VM = 0 endif - From 9696dbfd388aa4c21b686d4566832964c31f8035 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 12 Oct 2020 13:26:58 -0500 Subject: [PATCH 1124/1293] rgbmatrix: Don't crash when setting brightness=0 If the display is paused, `_PM_swapbuffer_maybe` will never return. So, when brightness is 0, refresh does nothing. This makes it necessary to update the display when unpausing. Closes: #3524 --- shared-module/rgbmatrix/RGBMatrix.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c index 3007ca4db5..abd6d500f6 100644 --- a/shared-module/rgbmatrix/RGBMatrix.c +++ b/shared-module/rgbmatrix/RGBMatrix.c @@ -190,6 +190,8 @@ void common_hal_rgbmatrix_rgbmatrix_set_paused(rgbmatrix_rgbmatrix_obj_t* self, _PM_stop(&self->protomatter); } else if (!paused && self->paused) { _PM_resume(&self->protomatter); + _PM_convert_565(&self->protomatter, self->bufinfo.buf, self->width); + _PM_swapbuffer_maybe(&self->protomatter); } self->paused = paused; } @@ -199,8 +201,10 @@ bool common_hal_rgbmatrix_rgbmatrix_get_paused(rgbmatrix_rgbmatrix_obj_t* self) } void common_hal_rgbmatrix_rgbmatrix_refresh(rgbmatrix_rgbmatrix_obj_t* self) { - _PM_convert_565(&self->protomatter, self->bufinfo.buf, self->width); - _PM_swapbuffer_maybe(&self->protomatter); + if (!self->paused) { + _PM_convert_565(&self->protomatter, self->bufinfo.buf, self->width); + _PM_swapbuffer_maybe(&self->protomatter); + } } int common_hal_rgbmatrix_rgbmatrix_get_width(rgbmatrix_rgbmatrix_obj_t* self) { From 8ddbebd2c1500ceba4b6628882f5a128743d323d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 12 Oct 2020 13:35:15 -0500 Subject: [PATCH 1125/1293] esp32s2: fix build after qstr rule changes --- ports/esp32s2/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index a97ab0b00f..8d891edd02 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -269,7 +269,7 @@ menuconfig: $(BUILD)/esp-idf/config $(Q)grep -Fvxf $(DEBUG_SDKCONFIG) -f $(FLASH_SDKCONFIG) $(BUILD)/sdkconfig.diff > boards/$(BOARD)/sdkconfig # qstr builds include headers so we need to make sure they are up to date -$(HEADER_BUILD)/qstr.i.last: | $(BUILD)/esp-idf/config/sdkconfig.h +$(HEADER_BUILD)/qstr.split: | $(BUILD)/esp-idf/config/sdkconfig.h ESP_IDF_COMPONENTS_LINK = freertos log hal esp_system esp_adc_cal esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip esp_rom esp-tls From a0e5e961c594e26713aa9e255bf6e43214bf42a4 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 12 Oct 2020 17:43:13 -0700 Subject: [PATCH 1126/1293] Fix STM RTC read so it's atomic. Fixes #3376 --- ports/stm/supervisor/port.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index bb304a3173..79e4584b0e 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -190,6 +190,7 @@ safe_mode_t port_init(void) { _hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; HAL_RTC_Init(&_hrtc); + HAL_RTCEx_EnableBypassShadow(&_hrtc); HAL_NVIC_EnableIRQ(RTC_Alarm_IRQn); // Turn off SysTick @@ -328,9 +329,23 @@ volatile uint32_t cached_date = 0; volatile uint32_t seconds_to_minute = 0; volatile uint32_t cached_hours_minutes = 0; uint64_t port_get_raw_ticks(uint8_t* subticks) { - uint32_t subseconds = rtc_clock_frequency - (uint32_t)(RTC->SSR); + // Disable IRQs to ensure we read all of the RTC registers as close in time as possible. Read + // SSR twice to make sure we didn't read across a tick. + __disable_irq(); + uint32_t first_ssr = (uint32_t)(RTC->SSR); uint32_t time = (uint32_t)(RTC->TR & RTC_TR_RESERVED_MASK); uint32_t date = (uint32_t)(RTC->DR & RTC_DR_RESERVED_MASK); + uint32_t ssr = (uint32_t)(RTC->SSR); + while (ssr != first_ssr) { + first_ssr = ssr; + time = (uint32_t)(RTC->TR & RTC_TR_RESERVED_MASK); + date = (uint32_t)(RTC->DR & RTC_DR_RESERVED_MASK); + ssr = (uint32_t)(RTC->SSR); + } + __enable_irq(); + + uint32_t subseconds = rtc_clock_frequency - 1 - ssr; + if (date != cached_date) { uint32_t year = (uint8_t)((date & (RTC_DR_YT | RTC_DR_YU)) >> 16U); uint8_t month = (uint8_t)((date & (RTC_DR_MT | RTC_DR_MU)) >> 8U); @@ -349,6 +364,7 @@ uint64_t port_get_raw_ticks(uint8_t* subticks) { hours = (uint8_t)RTC_Bcd2ToByte(hours); minutes = (uint8_t)RTC_Bcd2ToByte(minutes); seconds_to_minute = 60 * (60 * hours + minutes); + cached_hours_minutes = hours_minutes; } uint8_t seconds = (uint8_t)(time & (RTC_TR_ST | RTC_TR_SU)); seconds = (uint8_t)RTC_Bcd2ToByte(seconds); From 379e73af2e55b1f0c517883360e29d5dbc27a20b Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 12 Oct 2020 18:36:18 -0700 Subject: [PATCH 1127/1293] Finer grained, per port tick locking Fixes #3504 hopefully. --- ports/atmel-samd/common-hal/pulseio/PulseIn.h | 1 - ports/atmel-samd/supervisor/port.c | 37 +++++++++++++------ ports/litex/supervisor/port.c | 6 ++- ports/nrf/supervisor/port.c | 6 ++- supervisor/shared/tick.c | 2 - 5 files changed, 35 insertions(+), 17 deletions(-) diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.h b/ports/atmel-samd/common-hal/pulseio/PulseIn.h index 99358178f2..b91bbd703b 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.h +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.h @@ -51,7 +51,6 @@ void pulsein_reset(void); void pulsein_interrupt_handler(uint8_t channel); void pulsein_timer_interrupt_handler(uint8_t index); #ifdef SAMD21 -void rtc_set_continuous(void); void rtc_start_pulsein(void); void rtc_end_pulsein(void); #endif diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index e69062296d..6686d794c4 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -96,19 +96,21 @@ #endif volatile bool hold_interrupt = false; #ifdef SAMD21 +static void rtc_set_continuous(bool continuous) { + while (RTC->MODE0.STATUS.bit.SYNCBUSY); + // TODO: DaveP: Do we need the RREQ here? + RTC->MODE0.READREQ.reg = RTC_READREQ_RREQ | (continuous ? RTC_READREQ_RCONT : 0) | 0x0010; + while (RTC->MODE0.STATUS.bit.SYNCBUSY); +} + void rtc_start_pulsein(void) { - rtc_set_continuous(); + rtc_set_continuous(true); hold_interrupt = true; } void rtc_end_pulsein(void) { hold_interrupt = false; -} - -void rtc_set_continuous(void) { - while (RTC->MODE0.STATUS.bit.SYNCBUSY); - RTC->MODE0.READREQ.reg = RTC_READREQ_RREQ | RTC_READREQ_RCONT | 0x0010; - while (RTC->MODE0.STATUS.bit.SYNCBUSY); + rtc_set_continuous(false); } #endif @@ -430,19 +432,28 @@ uint32_t port_get_saved_word(void) { static volatile uint64_t overflowed_ticks = 0; static volatile bool _ticks_enabled = false; -static uint32_t _get_count(void) { +static uint32_t _get_count(uint32_t* overflow_count) { #ifdef SAM_D5X_E5X while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) {} #endif #ifdef SAMD21 + // Request a read so we don't stall the bus later. See section 14.3.1.5 Read Request + RTC->MODE0.READREQ.reg = RTC_READREQ_RREQ | 0x0010; while (RTC->MODE0.STATUS.bit.SYNCBUSY != 0) {} #endif + // Disable interrupts so we can grab the count and the overflow. + common_hal_mcu_disable_interrupts(); + uint32_t count = RTC->MODE0.COUNT.reg; + if (overflow_count != NULL) { + *overflow_count = overflowed_ticks; + } + common_hal_mcu_enable_interrupts(); - return RTC->MODE0.COUNT.reg; + return count; } static void _port_interrupt_after_ticks(uint32_t ticks) { - uint32_t current_ticks = _get_count(); + uint32_t current_ticks = _get_count(NULL); if (ticks > 1 << 28) { // We'll interrupt sooner with an overflow. return; @@ -490,12 +501,13 @@ void RTC_Handler(void) { } uint64_t port_get_raw_ticks(uint8_t* subticks) { - uint32_t current_ticks = _get_count(); + uint32_t overflow_count; + uint32_t current_ticks = _get_count(&overflow_count); if (subticks != NULL) { *subticks = (current_ticks % 16) * 2; } - return overflowed_ticks + current_ticks / 16; + return overflow_count + current_ticks / 16; } // Enable 1/1024 second tick. @@ -505,6 +517,7 @@ void port_enable_tick(void) { RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_PER2; #endif #ifdef SAMD21 + // TODO: Switch to using the PER *event* from the RTC to generate an interrupt via EVSYS. _ticks_enabled = true; _port_interrupt_after_ticks(1); #endif diff --git a/ports/litex/supervisor/port.c b/ports/litex/supervisor/port.c index e55eb49f00..02617b9af7 100644 --- a/ports/litex/supervisor/port.c +++ b/ports/litex/supervisor/port.c @@ -128,7 +128,11 @@ uint32_t port_get_saved_word(void) { } uint64_t port_get_raw_ticks(uint8_t* subticks) { - return raw_ticks; + // Reading 64 bits may take two loads, so turn of interrupts while we do it. + irq_setie(false); + uint64_t raw_tick_snapshot = raw_ticks; + irq_setie(true); + return raw_tick_snapshot; } // Enable 1/1024 second tick. diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index bc8b47be77..493de43e0f 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -274,11 +274,15 @@ uint32_t port_get_saved_word(void) { } uint64_t port_get_raw_ticks(uint8_t* subticks) { + common_hal_mcu_disable_interrupts(); uint32_t rtc = nrfx_rtc_counter_get(&rtc_instance); + uint32_t overflow_count = overflow_tracker.overflowed_ticks; + common_hal_mcu_enable_interrupts(); + if (subticks != NULL) { *subticks = (rtc % 32); } - return overflow_tracker.overflowed_ticks + rtc / 32; + return overflow_count + rtc / 32; } // Enable 1/1024 second tick. diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 91ffa307d7..a2855a5706 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -125,9 +125,7 @@ void supervisor_tick(void) { uint64_t supervisor_ticks_ms64() { uint64_t result; - common_hal_mcu_disable_interrupts(); result = port_get_raw_ticks(NULL); - common_hal_mcu_enable_interrupts(); result = result * 1000 / 1024; return result; } From 57b44928a38b5a2328e0fd4fe8f2baee11062229 Mon Sep 17 00:00:00 2001 From: Jensen Date: Thu, 8 Oct 2020 21:40:55 -0500 Subject: [PATCH 1128/1293] displayio: Pass transparent_color to ColorConverter Signed-off-by: Jensen --- shared-bindings/displayio/ColorConverter.c | 5 ++++- shared-bindings/displayio/ColorConverter.h | 2 +- shared-module/displayio/ColorConverter.c | 12 +++++++++++- shared-module/displayio/ColorConverter.h | 1 + 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index a2b6699efc..d2cbcfc732 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -43,6 +43,7 @@ //| """Create a ColorConverter object to convert color formats. Only supports RGB888 to RGB565 //| currently. //| :param bool dither: Adds random noise to dither the output image""" +//| :param bool transparent_color: Sets one color in the colorset to transparent""" //| ... //| @@ -50,9 +51,11 @@ //| STATIC mp_obj_t displayio_colorconverter_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_dither}; + enum { ARG_transparent_color }; static const mp_arg_t allowed_args[] = { { MP_QSTR_dither, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, + { MP_QSTR_transparent_color, MP_ARG_KW_ONLY | MP_ARG_INT, {.uint32_t = 0} }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); @@ -60,7 +63,7 @@ STATIC mp_obj_t displayio_colorconverter_make_new(const mp_obj_type_t *type, siz displayio_colorconverter_t *self = m_new_obj(displayio_colorconverter_t); self->base.type = &displayio_colorconverter_type; - common_hal_displayio_colorconverter_construct(self, args[ARG_dither].u_bool); + common_hal_displayio_colorconverter_construct(self, args[ARG_dither].u_bool, args[ARG_transparent_color].uint32_t); return MP_OBJ_FROM_PTR(self); } diff --git a/shared-bindings/displayio/ColorConverter.h b/shared-bindings/displayio/ColorConverter.h index d550d81be5..146ad80bdd 100644 --- a/shared-bindings/displayio/ColorConverter.h +++ b/shared-bindings/displayio/ColorConverter.h @@ -33,7 +33,7 @@ extern const mp_obj_type_t displayio_colorconverter_type; -void common_hal_displayio_colorconverter_construct(displayio_colorconverter_t* self, bool dither); +void common_hal_displayio_colorconverter_construct(displayio_colorconverter_t* self, bool dither, uint32_t transparent_color); void common_hal_displayio_colorconverter_convert(displayio_colorconverter_t *colorconverter, const _displayio_colorspace_t* colorspace, uint32_t input_color, uint32_t* output_color); void common_hal_displayio_colorconverter_set_dither(displayio_colorconverter_t* self, bool dither); diff --git a/shared-module/displayio/ColorConverter.c b/shared-module/displayio/ColorConverter.c index c2c3214aae..c23286d041 100644 --- a/shared-module/displayio/ColorConverter.c +++ b/shared-module/displayio/ColorConverter.c @@ -39,8 +39,9 @@ uint32_t displayio_colorconverter_dither_noise_2(uint32_t x, uint32_t y) { return displayio_colorconverter_dither_noise_1(x + y * 0xFFFF); } -void common_hal_displayio_colorconverter_construct(displayio_colorconverter_t* self, bool dither) { +void common_hal_displayio_colorconverter_construct(displayio_colorconverter_t* self, bool dither, uint32_t transparent_color) { self->dither = dither; + self->transparent_color = transparent_color; } uint16_t displayio_colorconverter_compute_rgb565(uint32_t color_rgb888) { @@ -161,6 +162,9 @@ void displayio_colorconverter_convert(displayio_colorconverter_t *self, const _d } output_color->pixel = packed; output_color->opaque = true; + if (self->transparent_color == pixel) { + output_color->opaque = false; + } return; } else if (colorspace->tricolor) { uint8_t luma = displayio_colorconverter_compute_luma(pixel); @@ -170,6 +174,9 @@ void displayio_colorconverter_convert(displayio_colorconverter_t *self, const _d output_color->pixel = 0; } output_color->opaque = true; + if (self->transparent_color == pixel) { + output_color->opaque = false; + } return; } uint8_t pixel_hue = displayio_colorconverter_compute_hue(pixel); @@ -179,6 +186,9 @@ void displayio_colorconverter_convert(displayio_colorconverter_t *self, const _d uint8_t luma = displayio_colorconverter_compute_luma(pixel); output_color->pixel = luma >> (8 - colorspace->depth); output_color->opaque = true; + if (self->transparent_color == pixel) { + output_color->opaque = false; + } return; } output_color->opaque = false; diff --git a/shared-module/displayio/ColorConverter.h b/shared-module/displayio/ColorConverter.h index 10b1604a49..b402625ef7 100644 --- a/shared-module/displayio/ColorConverter.h +++ b/shared-module/displayio/ColorConverter.h @@ -36,6 +36,7 @@ typedef struct { mp_obj_base_t base; bool dither; + uint32_t transparent_color; } displayio_colorconverter_t; bool displayio_colorconverter_needs_refresh(displayio_colorconverter_t *self); From b359e2945ac9914c31afc7e692a4f46a837a854d Mon Sep 17 00:00:00 2001 From: Jensen Date: Sun, 11 Oct 2020 13:18:09 -0500 Subject: [PATCH 1129/1293] displayio: Add make_transparent and make_opaque to ColorConvertor --- shared-bindings/displayio/ColorConverter.c | 7 ++---- shared-bindings/displayio/ColorConverter.h | 5 +++- shared-module/displayio/ColorConverter.c | 29 ++++++++++++++-------- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index d2cbcfc732..c02dfdb6d2 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -43,7 +43,6 @@ //| """Create a ColorConverter object to convert color formats. Only supports RGB888 to RGB565 //| currently. //| :param bool dither: Adds random noise to dither the output image""" -//| :param bool transparent_color: Sets one color in the colorset to transparent""" //| ... //| @@ -51,11 +50,9 @@ //| STATIC mp_obj_t displayio_colorconverter_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_dither}; - enum { ARG_transparent_color }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_dither, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, - { MP_QSTR_transparent_color, MP_ARG_KW_ONLY | MP_ARG_INT, {.uint32_t = 0} }, + { MP_QSTR_dither, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} } }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); @@ -63,7 +60,7 @@ STATIC mp_obj_t displayio_colorconverter_make_new(const mp_obj_type_t *type, siz displayio_colorconverter_t *self = m_new_obj(displayio_colorconverter_t); self->base.type = &displayio_colorconverter_type; - common_hal_displayio_colorconverter_construct(self, args[ARG_dither].u_bool, args[ARG_transparent_color].uint32_t); + common_hal_displayio_colorconverter_construct(self, args[ARG_dither].u_bool); return MP_OBJ_FROM_PTR(self); } diff --git a/shared-bindings/displayio/ColorConverter.h b/shared-bindings/displayio/ColorConverter.h index 146ad80bdd..441f7c7aee 100644 --- a/shared-bindings/displayio/ColorConverter.h +++ b/shared-bindings/displayio/ColorConverter.h @@ -33,10 +33,13 @@ extern const mp_obj_type_t displayio_colorconverter_type; -void common_hal_displayio_colorconverter_construct(displayio_colorconverter_t* self, bool dither, uint32_t transparent_color); +void common_hal_displayio_colorconverter_construct(displayio_colorconverter_t* self, bool dither); void common_hal_displayio_colorconverter_convert(displayio_colorconverter_t *colorconverter, const _displayio_colorspace_t* colorspace, uint32_t input_color, uint32_t* output_color); void common_hal_displayio_colorconverter_set_dither(displayio_colorconverter_t* self, bool dither); bool common_hal_displayio_colorconverter_get_dither(displayio_colorconverter_t* self); +void common_hal_displayio_colorconverter_make_transparent(displayio_colorconverter_t* self, uint32_t transparent_color); +void common_hal_displayio_colorconverter_make_opaque(displayio_colorconverter_t* self, uint32_t transparent_color); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_COLORCONVERTER_H diff --git a/shared-module/displayio/ColorConverter.c b/shared-module/displayio/ColorConverter.c index c23286d041..0a1a7dc06b 100644 --- a/shared-module/displayio/ColorConverter.c +++ b/shared-module/displayio/ColorConverter.c @@ -39,9 +39,8 @@ uint32_t displayio_colorconverter_dither_noise_2(uint32_t x, uint32_t y) { return displayio_colorconverter_dither_noise_1(x + y * 0xFFFF); } -void common_hal_displayio_colorconverter_construct(displayio_colorconverter_t* self, bool dither, uint32_t transparent_color) { +void common_hal_displayio_colorconverter_construct(displayio_colorconverter_t* self, bool dither) { self->dither = dither; - self->transparent_color = transparent_color; } uint16_t displayio_colorconverter_compute_rgb565(uint32_t color_rgb888) { @@ -129,9 +128,26 @@ bool common_hal_displayio_colorconverter_get_dither(displayio_colorconverter_t* return self->dither; } +void common_hal_displayio_colorconverter_make_transparent(displayio_colorconverter_t* self, uint32_t transparent_color) { + self->transparent_color = transparent_color; + // TODO: Does this require refreshing like the other modules? +} + +void common_hal_displayio_colorconverter_make_opaque(displayio_colorconverter_t* self, uint32_t transparent_color) { + if (self->transparent_color == transparent_color) { + m_del(uint8_t, self, transparent_color); + } + // TODO: Does this require refreshing like the other modules? +} + void displayio_colorconverter_convert(displayio_colorconverter_t *self, const _displayio_colorspace_t* colorspace, const displayio_input_pixel_t *input_pixel, displayio_output_pixel_t *output_color) { uint32_t pixel = input_pixel->pixel; + if (self->transparent_color == pixel) { + output_color->opaque = false; + return; + } + if (self->dither){ uint8_t randr = (displayio_colorconverter_dither_noise_2(input_pixel->tile_x,input_pixel->tile_y)); uint8_t randg = (displayio_colorconverter_dither_noise_2(input_pixel->tile_x+33,input_pixel->tile_y)); @@ -162,9 +178,6 @@ void displayio_colorconverter_convert(displayio_colorconverter_t *self, const _d } output_color->pixel = packed; output_color->opaque = true; - if (self->transparent_color == pixel) { - output_color->opaque = false; - } return; } else if (colorspace->tricolor) { uint8_t luma = displayio_colorconverter_compute_luma(pixel); @@ -174,9 +187,6 @@ void displayio_colorconverter_convert(displayio_colorconverter_t *self, const _d output_color->pixel = 0; } output_color->opaque = true; - if (self->transparent_color == pixel) { - output_color->opaque = false; - } return; } uint8_t pixel_hue = displayio_colorconverter_compute_hue(pixel); @@ -186,9 +196,6 @@ void displayio_colorconverter_convert(displayio_colorconverter_t *self, const _d uint8_t luma = displayio_colorconverter_compute_luma(pixel); output_color->pixel = luma >> (8 - colorspace->depth); output_color->opaque = true; - if (self->transparent_color == pixel) { - output_color->opaque = false; - } return; } output_color->opaque = false; From 337019626a8cd0632cd2a6f6bae4ae09ae26cf16 Mon Sep 17 00:00:00 2001 From: Jensen Date: Sun, 11 Oct 2020 17:29:16 -0500 Subject: [PATCH 1130/1293] displayio: Add make_transparent to ColorConverter --- locale/circuitpython.pot | 24 ++++++++++++++-- shared-bindings/displayio/ColorConverter.c | 32 ++++++++++++++++++++++ shared-module/displayio/ColorConverter.c | 12 +++++--- 3 files changed, 61 insertions(+), 7 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index c4951f78f9..081e2df9fa 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-12 20:47-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -285,6 +285,7 @@ msgid "All I2C peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -892,6 +893,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -928,7 +930,8 @@ msgid "Group full" msgstr "" #: 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/sdioio/SDCard.c +#: 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 "" @@ -998,7 +1001,8 @@ msgid "Invalid %q pin" msgstr "" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3144,6 +3148,7 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3151,6 +3156,7 @@ msgstr "" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -3388,6 +3394,18 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "" +#: shared-bindings/displayio/ColorConverter.c +msgid "transparent_color should be an int" +msgstr "" + +#: shared-module/displayio/ColorConverter.c +msgid "transparent_color value is already set" +msgstr "" + +#: shared-module/displayio/ColorConverter.c +msgid "transparent_color value is not transparent" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "" diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index c02dfdb6d2..a041bbe597 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -110,9 +110,41 @@ const mp_obj_property_t displayio_colorconverter_dither_obj = { (mp_obj_t)&mp_const_none_obj}, }; +//| def make_transparent(self, pixel: int) -> None: +//| """Sets a pixel to not opaque.""" +//| +STATIC mp_obj_t displayio_colorconverter_make_transparent(mp_obj_t self_in, mp_obj_t transparent_color_obj) { + displayio_colorconverter_t *self = MP_OBJ_TO_PTR(self_in); + + mp_int_t transparent_color; + if (!mp_obj_get_int_maybe(transparent_color_obj, &transparent_color)) { + mp_raise_ValueError(translate("transparent_color should be an int")); + } + common_hal_displayio_colorconverter_make_transparent(self, transparent_color); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(displayio_colorconverter_make_transparent_obj, displayio_colorconverter_make_transparent); + +//| def make_opaque(self, pixel: int) -> None: +//| """Sets a pixel to opaque.""" +//| +STATIC mp_obj_t displayio_colorconverter_make_opaque(mp_obj_t self_in, mp_obj_t transparent_color_obj) { + displayio_colorconverter_t *self = MP_OBJ_TO_PTR(self_in); + + mp_int_t transparent_color; + if (!mp_obj_get_int_maybe(transparent_color_obj, &transparent_color)) { + mp_raise_ValueError(translate("transparent_color should be an int")); + } + common_hal_displayio_colorconverter_make_opaque(self, transparent_color); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(displayio_colorconverter_make_opaque_obj, displayio_colorconverter_make_opaque); + STATIC const mp_rom_map_elem_t displayio_colorconverter_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_convert), MP_ROM_PTR(&displayio_colorconverter_convert_obj) }, { MP_ROM_QSTR(MP_QSTR_dither), MP_ROM_PTR(&displayio_colorconverter_dither_obj) }, + { MP_ROM_QSTR(MP_QSTR_make_transparent), MP_ROM_PTR(&displayio_colorconverter_make_transparent_obj) }, + { MP_ROM_QSTR(MP_QSTR_make_opaque), MP_ROM_PTR(&displayio_colorconverter_make_opaque_obj) }, }; STATIC MP_DEFINE_CONST_DICT(displayio_colorconverter_locals_dict, displayio_colorconverter_locals_dict_table); diff --git a/shared-module/displayio/ColorConverter.c b/shared-module/displayio/ColorConverter.c index 0a1a7dc06b..fef71cdf5e 100644 --- a/shared-module/displayio/ColorConverter.c +++ b/shared-module/displayio/ColorConverter.c @@ -27,6 +27,7 @@ #include "shared-bindings/displayio/ColorConverter.h" #include "py/misc.h" +#include "py/runtime.h" uint32_t displayio_colorconverter_dither_noise_1 (uint32_t n) { @@ -129,15 +130,18 @@ bool common_hal_displayio_colorconverter_get_dither(displayio_colorconverter_t* } void common_hal_displayio_colorconverter_make_transparent(displayio_colorconverter_t* self, uint32_t transparent_color) { + if (self->transparent_color) { + mp_raise_RuntimeError(translate("transparent_color value is already set")); + } self->transparent_color = transparent_color; - // TODO: Does this require refreshing like the other modules? } void common_hal_displayio_colorconverter_make_opaque(displayio_colorconverter_t* self, uint32_t transparent_color) { - if (self->transparent_color == transparent_color) { - m_del(uint8_t, self, transparent_color); + if (self->transparent_color != transparent_color) { + mp_raise_RuntimeError(translate("transparent_color value is not transparent")); } - // TODO: Does this require refreshing like the other modules? + // 0x1000000 will never equal a valid color + self->transparent_color = 0x1000000; } void displayio_colorconverter_convert(displayio_colorconverter_t *self, const _displayio_colorspace_t* colorspace, const displayio_input_pixel_t *input_pixel, displayio_output_pixel_t *output_color) { From ceb531086ed2e5d1e2ee1f1439820a5145fd981e Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Tue, 13 Oct 2020 14:22:02 +0530 Subject: [PATCH 1131/1293] Add method to set custom hostname --- locale/circuitpython.pot | 8 +++++-- .../boards/microdev_micro_s2/sdkconfig | 5 +++++ ports/esp32s2/common-hal/wifi/Radio.c | 4 ++++ shared-bindings/wifi/Radio.c | 22 +++++++++++++++++++ shared-bindings/wifi/Radio.h | 3 ++- 5 files changed, 39 insertions(+), 3 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index fc564feeaf..76681d2094 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-10 23:49-0700\n" +"POT-Creation-Date: 2020-10-12 14:16+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -947,6 +947,10 @@ msgstr "" msgid "Hardware in use, try alternative pins" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Hostname must be between 1 and 63 characters" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" @@ -1026,6 +1030,7 @@ msgstr "" msgid "Invalid BSSID" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" @@ -1237,7 +1242,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" diff --git a/ports/esp32s2/boards/microdev_micro_s2/sdkconfig b/ports/esp32s2/boards/microdev_micro_s2/sdkconfig index 67ac6d2f37..4b8cc5cc36 100644 --- a/ports/esp32s2/boards/microdev_micro_s2/sdkconfig +++ b/ports/esp32s2/boards/microdev_micro_s2/sdkconfig @@ -32,3 +32,8 @@ CONFIG_SPIRAM_MEMTEST=y # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set # end of SPI RAM config +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="microS2" +# end of LWIP diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index b62ad611b6..61d63e1f28 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -104,6 +104,10 @@ void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) { self->current_scan = NULL; } +void common_hal_wifi_radio_set_hostname(wifi_radio_obj_t *self, const char *hostname) { + esp_netif_set_hostname(self->netif, hostname); +} + 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) { // check enabled start_station(self); diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 928f21da90..9c774e1412 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -102,6 +102,26 @@ STATIC mp_obj_t wifi_radio_stop_scanning_networks(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_stop_scanning_networks_obj, wifi_radio_stop_scanning_networks); +//| def set_hostname(self, hostname: ReadableBuffer) -> None: +//| """Sets hostname for wifi interface. When the hostname is altered after interface started/connected +//| the changes would only be reflected once the interface restarts/reconnects.""" +//| ... +//| +STATIC mp_obj_t wifi_radio_set_hostname(mp_obj_t self_in, mp_obj_t hostname_in) { + mp_buffer_info_t hostname; + mp_get_buffer_raise(hostname_in, &hostname, MP_BUFFER_READ); + + if (hostname.len < 1 || hostname.len > 63) { + mp_raise_ValueError(translate("Hostname must be between 1 and 63 characters")); + } + + wifi_radio_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_wifi_radio_set_hostname(self, hostname.buf); + + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(wifi_radio_set_hostname_obj, wifi_radio_set_hostname); + //| def connect(self, ssid: ReadableBuffer, password: ReadableBuffer = b"", *, channel: Optional[int] = 0, timeout: Optional[float] = None) -> bool: //| """Connects to the given ssid and waits for an ip address. Reconnections are handled //| automatically once one connection succeeds.""" @@ -216,6 +236,8 @@ STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_start_scanning_networks), MP_ROM_PTR(&wifi_radio_start_scanning_networks_obj) }, { MP_ROM_QSTR(MP_QSTR_stop_scanning_networks), MP_ROM_PTR(&wifi_radio_stop_scanning_networks_obj) }, + { MP_ROM_QSTR(MP_QSTR_set_hostname), MP_ROM_PTR(&wifi_radio_set_hostname_obj) }, + { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&wifi_radio_connect_obj) }, // { MP_ROM_QSTR(MP_QSTR_connect_to_enterprise), MP_ROM_PTR(&wifi_radio_connect_to_enterprise_obj) }, diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index b5341d51c9..4226ae2a96 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -35,7 +35,6 @@ const mp_obj_type_t wifi_radio_type; - typedef enum { WIFI_RADIO_ERROR_NONE, WIFI_RADIO_ERROR_UNKNOWN, @@ -46,6 +45,8 @@ typedef enum { extern bool common_hal_wifi_radio_get_enabled(wifi_radio_obj_t *self); extern void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled); +extern void common_hal_wifi_radio_set_hostname(wifi_radio_obj_t *self, const char *hostname); + extern mp_obj_t common_hal_wifi_radio_get_mac_address(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self); From cfa3163a7ea76689c2c54556c990692b62c2577d Mon Sep 17 00:00:00 2001 From: Noel Gaetan Date: Mon, 12 Oct 2020 19:47:22 +0000 Subject: [PATCH 1132/1293] Translated using Weblate (French) Currently translated at 92.4% (767 of 830 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 45a4cc25d0..59f69508fe 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-06 13:26-0400\n" -"PO-Revision-Date: 2020-09-16 13:47+0000\n" -"Last-Translator: Hugo Dahl \n" +"PO-Revision-Date: 2020-10-12 21:00+0000\n" +"Last-Translator: Noel Gaetan \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" @@ -102,7 +102,7 @@ msgstr "%q doit être un tuple de longueur 2" #: shared-bindings/canio/Match.c msgid "%q out of range" -msgstr "" +msgstr "%q est hors de porté" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" @@ -281,7 +281,7 @@ msgstr "Un canal d'interruptions matérielles est déjà utilisé" #: ports/esp32s2/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" -msgstr "" +msgstr "ADC2 est utilisé pars le Wifi" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format @@ -298,7 +298,7 @@ msgstr "Tous les périphériques I2C sont utilisés" #: ports/atmel-samd/common-hal/canio/Listener.c msgid "All RX FIFOs in use" -msgstr "" +msgstr "Tout les RX FIFOs sont utilisé" #: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" @@ -664,7 +664,7 @@ msgstr "Code brut corrompu" #: ports/cxd56/common-hal/camera/Camera.c msgid "Could not initialize Camera" -msgstr "" +msgstr "Impossible d'initialisé la Camera" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" @@ -795,7 +795,7 @@ msgstr "La BCE ne fonctionne que sur 16 octets à la fois" #: ports/esp32s2/common-hal/busio/SPI.c msgid "ESP-IDF memory allocation failed" -msgstr "" +msgstr "ESP-IDF échec d'allocation de la mémoire" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -900,7 +900,7 @@ msgstr "Impossible de se connecter : délai d'expiration" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to init wifi" -msgstr "" +msgstr "Echec de l'initialisation du Wifi" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" @@ -975,7 +975,7 @@ msgstr "Erreur d'initialisation I2C" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" -msgstr "" +msgstr "I2SOut n'est pas disponible" #: shared-bindings/aesio/aes.c #, c-format @@ -1043,7 +1043,7 @@ msgstr "Fichier BMP invalide" #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" -msgstr "" +msgstr "BSSID Invalide" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" @@ -1093,7 +1093,7 @@ msgstr "Taille de bloc de formatage invalide" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "Invalid frequency" -msgstr "" +msgstr "fréquence non Valide" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" @@ -1216,7 +1216,7 @@ msgstr "La valeur max. de x est %d lors d'une opération miroir" #: shared-bindings/canio/Message.c msgid "Messages limited to 8 bytes" -msgstr "" +msgstr "Message limité a 8 bytes" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." @@ -1329,11 +1329,11 @@ msgstr "Pas de support entier long" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more channels available" -msgstr "" +msgstr "Pas de canal supplémentaire disponible" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more timers available" -msgstr "" +msgstr "Pas d'horloge supplémentaire disponible" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." @@ -1341,7 +1341,7 @@ msgstr "Plus de minuteurs disponibles sur cette broche." #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" -msgstr "" +msgstr "Aucun réseau avec ce ssid" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" @@ -1365,7 +1365,7 @@ msgstr "Affirmation de défaillance du Nordic Soft Device." #: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c msgid "Not a valid IP string" -msgstr "" +msgstr "Chaîne IP non valide" #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -3601,7 +3601,7 @@ msgstr "caractère de format '%c' (0x%x) non supporté à l'index %d" #: py/runtime.c msgid "unsupported type for %q: '%q'" -msgstr "type non supporté pour %q: '%q'" +msgstr "type non supporté pour %q : '%q'" #: py/runtime.c msgid "unsupported type for operator" From 1d4d269092c0e90baeb479e362424584b50194e2 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 13 Oct 2020 00:31:54 +0200 Subject: [PATCH 1133/1293] 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 | 18 +++++++++++++++--- locale/cs.po | 18 +++++++++++++++--- locale/de_DE.po | 18 +++++++++++++++--- locale/el.po | 18 +++++++++++++++--- locale/es.po | 18 +++++++++++++++--- locale/fil.po | 18 +++++++++++++++--- locale/fr.po | 18 +++++++++++++++--- locale/hi.po | 18 +++++++++++++++--- locale/it_IT.po | 18 +++++++++++++++--- locale/ja.po | 18 +++++++++++++++--- locale/ko.po | 18 +++++++++++++++--- locale/nl.po | 18 +++++++++++++++--- locale/pl.po | 18 +++++++++++++++--- locale/pt_BR.po | 18 +++++++++++++++--- locale/sv.po | 18 +++++++++++++++--- locale/zh_Latn_pinyin.po | 18 +++++++++++++++--- 16 files changed, 240 insertions(+), 48 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 76e83920cc..61af353825 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -250,6 +250,10 @@ msgstr "'label' membutuhkan 1 argumen" msgid "'return' outside function" msgstr "'return' diluar fungsi" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' diluar fungsi" @@ -293,6 +297,7 @@ msgid "All I2C peripherals are in use" msgstr "Semua perangkat I2C sedang digunakan" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -914,6 +919,7 @@ msgid "File exists" msgstr "File sudah ada" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -951,7 +957,8 @@ msgid "Group full" msgstr "Grup penuh" #: 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/sdioio/SDCard.c +#: 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 "Perangkat keras sibuk, coba pin alternatif" @@ -1023,7 +1030,8 @@ msgid "Invalid %q pin" msgstr "%q pada tidak valid" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3475,6 +3483,10 @@ msgstr "" msgid "type object '%q' has no attribute '%q'" msgstr "" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index a099e1c94a..6c5e871637 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -250,6 +250,10 @@ msgstr "" msgid "'return' outside function" msgstr "" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "" @@ -293,6 +297,7 @@ msgid "All I2C peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -900,6 +905,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -936,7 +942,8 @@ msgid "Group full" msgstr "" #: 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/sdioio/SDCard.c +#: 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 "" @@ -1006,7 +1013,8 @@ msgid "Invalid %q pin" msgstr "" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3430,6 +3438,10 @@ msgstr "" msgid "type object '%q' has no attribute '%q'" msgstr "" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 5084ca505f..5633ae9c08 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -249,6 +249,10 @@ msgstr "'label' erfordert genau ein Argument" msgid "'return' outside function" msgstr "'return' außerhalb einer Funktion" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' außerhalb einer Funktion" @@ -292,6 +296,7 @@ msgid "All I2C peripherals are in use" msgstr "Alle I2C-Peripheriegeräte sind in Benutzung" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -911,6 +916,7 @@ msgid "File exists" msgstr "Datei existiert" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -951,7 +957,8 @@ msgid "Group full" msgstr "Gruppe voll" #: 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/sdioio/SDCard.c +#: 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" @@ -1023,7 +1030,8 @@ msgid "Invalid %q pin" msgstr "Ungültiger %q pin" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3514,6 +3522,10 @@ msgstr "Typ ist kein akzeptierter Basis-Typ" msgid "type object '%q' has no attribute '%q'" msgstr "Typ vom Objekt '%q' hat kein Attribut '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "Typ akzeptiert 1 oder 3 Argumente" diff --git a/locale/el.po b/locale/el.po index 32e08a5506..4202f6ae06 100644 --- a/locale/el.po +++ b/locale/el.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -245,6 +245,10 @@ msgstr "" msgid "'return' outside function" msgstr "" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "" @@ -288,6 +292,7 @@ msgid "All I2C peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -895,6 +900,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -931,7 +937,8 @@ msgid "Group full" msgstr "" #: 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/sdioio/SDCard.c +#: 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 "" @@ -1001,7 +1008,8 @@ msgid "Invalid %q pin" msgstr "" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3425,6 +3433,10 @@ msgstr "" msgid "type object '%q' has no attribute '%q'" msgstr "" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "" diff --git a/locale/es.po b/locale/es.po index 3a7e1c6823..1b006e1d1e 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-10-09 17:19+0000\n" "Last-Translator: dherrada \n" "Language-Team: \n" @@ -253,6 +253,10 @@ msgstr "'label' requiere 1 argumento" msgid "'return' outside function" msgstr "'return' fuera de una función" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' fuera de una función" @@ -296,6 +300,7 @@ msgid "All I2C peripherals are in use" msgstr "Todos los periféricos I2C están siendo usados" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Todos los FIFOs de RX en uso" @@ -915,6 +920,7 @@ msgid "File exists" msgstr "El archivo ya existe" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filtros muy complejos" @@ -952,7 +958,8 @@ msgid "Group full" msgstr "Group lleno" #: 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/sdioio/SDCard.c +#: 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 ocupado, pruebe pines alternativos" @@ -1024,7 +1031,8 @@ msgid "Invalid %q pin" msgstr "Pin %q inválido" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "selección inválida de pin %q" @@ -3504,6 +3512,10 @@ msgstr "type no es un tipo de base aceptable" msgid "type object '%q' has no attribute '%q'" msgstr "objeto de tipo '%q' no tiene atributo '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "type acepta 1 ó 3 argumentos" diff --git a/locale/fil.po b/locale/fil.po index 4e7ce9ed8f..f71a0a757a 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -247,6 +247,10 @@ msgstr "'label' kailangan ng 1 argument" msgid "'return' outside function" msgstr "'return' sa labas ng function" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' sa labas ng function" @@ -290,6 +294,7 @@ msgid "All I2C peripherals are in use" msgstr "Lahat ng I2C peripherals ginagamit" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -908,6 +913,7 @@ msgid "File exists" msgstr "Mayroong file" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -944,7 +950,8 @@ msgid "Group full" msgstr "Puno ang group" #: 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/sdioio/SDCard.c +#: 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 "" @@ -1016,7 +1023,8 @@ msgid "Invalid %q pin" msgstr "Mali ang %q pin" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3480,6 +3488,10 @@ msgstr "hindi puede ang type para sa base type" msgid "type object '%q' has no attribute '%q'" msgstr "type object '%q' ay walang attribute '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "type kumuhuha ng 1 o 3 arguments" diff --git a/locale/fr.po b/locale/fr.po index 59f69508fe..500f0a091d 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-10-12 21:00+0000\n" "Last-Translator: Noel Gaetan \n" "Language: fr\n" @@ -254,6 +254,10 @@ msgstr "'label' nécessite 1 argument" msgid "'return' outside function" msgstr "'return' en dehors d'une fonction" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' en dehors d'une fonction" @@ -297,6 +301,7 @@ msgid "All I2C peripherals are in use" msgstr "Tous les périphériques I2C sont utilisés" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Tout les RX FIFOs sont utilisé" @@ -920,6 +925,7 @@ msgid "File exists" msgstr "Le fichier existe" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -957,7 +963,8 @@ msgid "Group full" msgstr "Groupe plein" #: 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/sdioio/SDCard.c +#: 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 "Matériel occupé, essayez d'autres broches" @@ -1029,7 +1036,8 @@ msgid "Invalid %q pin" msgstr "Broche invalide pour '%q'" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3522,6 +3530,10 @@ msgstr "le type n'est pas un type de base accepté" msgid "type object '%q' has no attribute '%q'" msgstr "l'objet de type '%q' n'a pas d'attribut '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "le type prend 1 ou 3 arguments" diff --git a/locale/hi.po b/locale/hi.po index 90d7a1107a..79b9e5105a 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -245,6 +245,10 @@ msgstr "" msgid "'return' outside function" msgstr "" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "" @@ -288,6 +292,7 @@ msgid "All I2C peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -895,6 +900,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -931,7 +937,8 @@ msgid "Group full" msgstr "" #: 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/sdioio/SDCard.c +#: 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 "" @@ -1001,7 +1008,8 @@ msgid "Invalid %q pin" msgstr "" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3425,6 +3433,10 @@ msgstr "" msgid "type object '%q' has no attribute '%q'" msgstr "" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 7ae72a2e5e..ef86aa78ac 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -246,6 +246,10 @@ msgstr "'label' richiede 1 argomento" msgid "'return' outside function" msgstr "'return' al di fuori della funzione" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' al di fuori della funzione" @@ -289,6 +293,7 @@ msgid "All I2C peripherals are in use" msgstr "Tutte le periferiche I2C sono in uso" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -908,6 +913,7 @@ msgid "File exists" msgstr "File esistente" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -944,7 +950,8 @@ msgid "Group full" msgstr "Gruppo pieno" #: 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/sdioio/SDCard.c +#: 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 "" @@ -1016,7 +1023,8 @@ msgid "Invalid %q pin" msgstr "Pin %q non valido" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3487,6 +3495,10 @@ msgstr "il tipo non è un tipo di base accettabile" msgid "type object '%q' has no attribute '%q'" msgstr "l'oggetto di tipo '%q' non ha l'attributo '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "tipo prende 1 o 3 argomenti" diff --git a/locale/ja.po b/locale/ja.po index 8443db3493..283149eee4 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-09-25 18:20+0000\n" "Last-Translator: Taku Fukada \n" "Language-Team: none\n" @@ -252,6 +252,10 @@ msgstr "" msgid "'return' outside function" msgstr "関数外でのreturn" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "関数外でのyield" @@ -295,6 +299,7 @@ msgid "All I2C peripherals are in use" msgstr "全てのI2C周辺機器が使用中" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "全てのRX FIFOが使用中" @@ -908,6 +913,7 @@ msgid "File exists" msgstr "ファイルが存在します" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -944,7 +950,8 @@ msgid "Group full" msgstr "グループが一杯" #: 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/sdioio/SDCard.c +#: 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 "ハードウェアビジー。代替のピンを試してください" @@ -1016,7 +1023,8 @@ msgid "Invalid %q pin" msgstr "不正な%qピン" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "不正な%qピン選択" @@ -3458,6 +3466,10 @@ msgstr "この型はベース型にできません" msgid "type object '%q' has no attribute '%q'" msgstr "" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "typeは1つか3つの引数をとります" diff --git a/locale/ko.po b/locale/ko.po index 822c450a3f..48ecb77372 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-10-05 12:12+0000\n" "Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" @@ -248,6 +248,10 @@ msgstr "'label' 에는 1 개의 독립변수가 필요합니다" msgid "'return' outside function" msgstr "'return' 는 함수 외부에 존재합니다" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' 는 함수 외부에 존재합니다" @@ -291,6 +295,7 @@ msgid "All I2C peripherals are in use" msgstr "사용중인 모든 I2C주변 기기" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -900,6 +905,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -936,7 +942,8 @@ msgid "Group full" msgstr "" #: 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/sdioio/SDCard.c +#: 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 "" @@ -1006,7 +1013,8 @@ msgid "Invalid %q pin" msgstr "" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3431,6 +3439,10 @@ msgstr "" msgid "type object '%q' has no attribute '%q'" msgstr "" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 6ee0c68f40..c979b5dce6 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-09-09 16:05+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -250,6 +250,10 @@ msgstr "'label' vereist 1 argument" msgid "'return' outside function" msgstr "'return' buiten de functie" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' buiten de functie" @@ -293,6 +297,7 @@ msgid "All I2C peripherals are in use" msgstr "Alle I2C peripherals zijn in gebruik" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -908,6 +913,7 @@ msgid "File exists" msgstr "Bestand bestaat" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -946,7 +952,8 @@ msgid "Group full" msgstr "Groep is vol" #: 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/sdioio/SDCard.c +#: 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 bezig, probeer alternatieve pinnen" @@ -1018,7 +1025,8 @@ msgid "Invalid %q pin" msgstr "Ongeldige %q pin" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "Ongeldige %q pin selectie" @@ -3488,6 +3496,10 @@ msgstr "type is geen aanvaardbaar basistype" msgid "type object '%q' has no attribute '%q'" msgstr "objecttype '%q' heeft geen attribuut '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "type accepteert 1 of 3 argumenten" diff --git a/locale/pl.po b/locale/pl.po index f2f2b2c14d..50d519f6aa 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-09-29 01:39+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -252,6 +252,10 @@ msgstr "'label' wymaga 1 argumentu" msgid "'return' outside function" msgstr "'return' poza funkcją" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' poza funkcją" @@ -295,6 +299,7 @@ msgid "All I2C peripherals are in use" msgstr "Wszystkie peryferia I2C w użyciu" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -908,6 +913,7 @@ msgid "File exists" msgstr "Plik istnieje" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -944,7 +950,8 @@ msgid "Group full" msgstr "Grupa pełna" #: 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/sdioio/SDCard.c +#: 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 "Sprzęt zajęty, wypróbuj alternatywne piny" @@ -1016,7 +1023,8 @@ msgid "Invalid %q pin" msgstr "Zła nóżka %q" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -3450,6 +3458,10 @@ msgstr "typ nie może być bazowy" msgid "type object '%q' has no attribute '%q'" msgstr "typ '%q' nie ma atrybutu '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "type wymaga 1 lub 3 argumentów" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 92214322d7..f7dd7db7fd 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-10-09 22:07+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -254,6 +254,10 @@ msgstr "'label' exige 1 argumento" msgid "'return' outside function" msgstr "função externa 'return'" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "função externa 'yield'" @@ -297,6 +301,7 @@ msgid "All I2C peripherals are in use" msgstr "Todos os periféricos I2C estão em uso" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Todos os FIFOs RX estão em uso" @@ -917,6 +922,7 @@ msgid "File exists" msgstr "Arquivo já existe" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Os filtros são muito complexos" @@ -955,7 +961,8 @@ msgid "Group full" msgstr "Grupo cheio" #: 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/sdioio/SDCard.c +#: 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 "O hardware está ocupado, tente os pinos alternativos" @@ -1027,7 +1034,8 @@ msgid "Invalid %q pin" msgstr "Pino do %q inválido" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "Seleção inválida dos pinos %q" @@ -3518,6 +3526,10 @@ msgstr "tipo não é um tipo base aceitável" msgid "type object '%q' has no attribute '%q'" msgstr "o objeto tipo '%q' não possuí atributo '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "o tipo usa 1 ou 3 argumentos" diff --git a/locale/sv.po b/locale/sv.po index a8d4d9ffc4..1d5739ed70 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-10-02 22:53+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -250,6 +250,10 @@ msgstr "'label' kräver 1 argument" msgid "'return' outside function" msgstr "'return' utanför funktion" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' utanför funktion" @@ -293,6 +297,7 @@ msgid "All I2C peripherals are in use" msgstr "All I2C-kringutrustning används" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Alla RX FIFO i bruk" @@ -908,6 +913,7 @@ msgid "File exists" msgstr "Filen finns redan" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filter för komplexa" @@ -944,7 +950,8 @@ msgid "Group full" msgstr "Gruppen är full" #: 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/sdioio/SDCard.c +#: 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 "Hårdvaran är upptagen, prova alternativa pinnar" @@ -1016,7 +1023,8 @@ msgid "Invalid %q pin" msgstr "Ogiltig %q-pinne" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "Ogiltigt val av %q pinne" @@ -3485,6 +3493,10 @@ msgstr "typ är inte en acceptabel bastyp" msgid "type object '%q' has no attribute '%q'" msgstr "typobjektet '%q' har inget attribut '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "typen tar 1 eller 3 argument" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 9e7baa9d02..0747b0e6f7 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-06 13:26-0400\n" +"POT-Creation-Date: 2020-10-10 23:49-0700\n" "PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -252,6 +252,10 @@ msgstr "'label' xūyào 1 cānshù" msgid "'return' outside function" msgstr "'return' wàibù gōngnéng" +#: py/compile.c +msgid "'yield from' inside async function" +msgstr "" + #: py/compile.c msgid "'yield' outside function" msgstr "'yield' wàibù gōngnéng" @@ -295,6 +299,7 @@ msgid "All I2C peripherals are in use" msgstr "Suǒyǒu I2C wàiwéi qì zhèngzài shǐyòng" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Suǒyǒu shǐyòng zhōng de RX FIFO" @@ -906,6 +911,7 @@ msgid "File exists" msgstr "Wénjiàn cúnzài" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "guò lǜ qì tài fù zá" @@ -942,7 +948,8 @@ msgid "Group full" msgstr "Fēnzǔ yǐ mǎn" #: 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/sdioio/SDCard.c +#: 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 "Yìngjiàn máng, qǐng chángshì qítā zhēnjiǎo" @@ -1014,7 +1021,8 @@ msgid "Invalid %q pin" msgstr "Wúxiào de %q yǐn jiǎo" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "wú xiào %q yǐn jiǎo xuǎn zé" @@ -3474,6 +3482,10 @@ msgstr "lèixíng bùshì kě jiēshòu de jīchǔ lèixíng" msgid "type object '%q' has no attribute '%q'" msgstr "lèixíng duìxiàng '%q' méiyǒu shǔxìng '%q'" +#: py/objgenerator.c +msgid "type object 'generator' has no attribute '__await__'" +msgstr "" + #: py/objtype.c msgid "type takes 1 or 3 arguments" msgstr "lèixíng wèi 1 huò 3 gè cānshù" From 6e38bf629b09c952694c2afa1e3db107f0b8e6c2 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 13 Oct 2020 04:18:19 +0000 Subject: [PATCH 1134/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (832 of 832 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 f7dd7db7fd..a8e1633898 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: 2020-10-10 23:49-0700\n" -"PO-Revision-Date: 2020-10-09 22:07+0000\n" +"PO-Revision-Date: 2020-10-13 17:11+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -256,7 +256,7 @@ msgstr "função externa 'return'" #: py/compile.c msgid "'yield from' inside async function" -msgstr "" +msgstr "'yield a partir' de dentro da função async" #: py/compile.c msgid "'yield' outside function" @@ -3528,7 +3528,7 @@ msgstr "o objeto tipo '%q' não possuí atributo '%q'" #: py/objgenerator.c msgid "type object 'generator' has no attribute '__await__'" -msgstr "" +msgstr "o tipo do objeto 'generator' não possui qualquer atributo '__await__'" #: py/objtype.c msgid "type takes 1 or 3 arguments" From b9c5fb57ff526d11218eef9e0537bd349ffff2fd Mon Sep 17 00:00:00 2001 From: hexthat Date: Mon, 12 Oct 2020 22:56:01 +0000 Subject: [PATCH 1135/1293] Translated using Weblate (Chinese (Pinyin)) Currently translated at 100.0% (832 of 832 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/zh_Latn/ --- locale/zh_Latn_pinyin.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 0747b0e6f7..b9adc10dfe 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: 2020-10-10 23:49-0700\n" -"PO-Revision-Date: 2020-10-10 23:51+0000\n" +"PO-Revision-Date: 2020-10-13 17:11+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" @@ -254,7 +254,7 @@ msgstr "'return' wàibù gōngnéng" #: py/compile.c msgid "'yield from' inside async function" -msgstr "" +msgstr "Yì bù hán shù zhōng de 'yield from'" #: py/compile.c msgid "'yield' outside function" @@ -3484,7 +3484,7 @@ msgstr "lèixíng duìxiàng '%q' méiyǒu shǔxìng '%q'" #: py/objgenerator.c msgid "type object 'generator' has no attribute '__await__'" -msgstr "" +msgstr "lèi xíng duì xiàng 'generator' méi yǒu shǔ xìng '__await__'" #: py/objtype.c msgid "type takes 1 or 3 arguments" From 2bc40bcadf36d27d2807ac155f185e6cc55e9ecb Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 13 Oct 2020 10:15:34 -0700 Subject: [PATCH 1136/1293] Remove readreq when changing continuous --- ports/atmel-samd/supervisor/port.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 6686d794c4..d65d098257 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -98,8 +98,7 @@ volatile bool hold_interrupt = false; #ifdef SAMD21 static void rtc_set_continuous(bool continuous) { while (RTC->MODE0.STATUS.bit.SYNCBUSY); - // TODO: DaveP: Do we need the RREQ here? - RTC->MODE0.READREQ.reg = RTC_READREQ_RREQ | (continuous ? RTC_READREQ_RCONT : 0) | 0x0010; + RTC->MODE0.READREQ.reg = (continuous ? RTC_READREQ_RCONT : 0) | 0x0010; while (RTC->MODE0.STATUS.bit.SYNCBUSY); } From 2b33968a1e4bf72017c983e1d92c80c73b071745 Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Tue, 13 Oct 2020 16:46:25 -0400 Subject: [PATCH 1137/1293] Add new board to atmel-samd port: bdmicro_vina_d51 --- .../boards/bdmicro_vina_d51/board.c | 48 +++++++++++ .../boards/bdmicro_vina_d51/mpconfigboard.h | 28 +++++++ .../boards/bdmicro_vina_d51/mpconfigboard.mk | 12 +++ .../atmel-samd/boards/bdmicro_vina_d51/pins.c | 82 +++++++++++++++++++ 4 files changed, 170 insertions(+) create mode 100644 ports/atmel-samd/boards/bdmicro_vina_d51/board.c create mode 100644 ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/bdmicro_vina_d51/pins.c diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51/board.c b/ports/atmel-samd/boards/bdmicro_vina_d51/board.c new file mode 100644 index 0000000000..bd63baa6fd --- /dev/null +++ b/ports/atmel-samd/boards/bdmicro_vina_d51/board.c @@ -0,0 +1,48 @@ +/* + * 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 "boards/board.h" +#include "mpconfigboard.h" + +void board_init(void) +{ + // struct port_config pin_conf; + // port_get_config_defaults(&pin_conf); + // + // pin_conf.direction = PORT_PIN_DIR_OUTPUT; + // port_pin_set_config(MICROPY_HW_LED_TX, &pin_conf); + // port_pin_set_output_level(MICROPY_HW_LED_TX, true); + // + // port_pin_set_config(MICROPY_HW_LED_RX, &pin_conf); + // port_pin_set_output_level(MICROPY_HW_LED_RX, true); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h b/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h new file mode 100644 index 0000000000..6bc9bb7063 --- /dev/null +++ b/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h @@ -0,0 +1,28 @@ +#define MICROPY_HW_BOARD_NAME "BDMICRO VINA-D51" +#define MICROPY_HW_MCU_NAME "samd51n20" + +#define CIRCUITPY_MCU_FAMILY samd51 + +// These are pins not to reset. +// Don't reset QSPI data pins +#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11) +#define MICROPY_PORT_B (PORT_PB10 | PORT_PB11) +#define MICROPY_PORT_C (0) +#define MICROPY_PORT_D (0) + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SDA (&pin_PB02) +#define DEFAULT_I2C_BUS_SCL (&pin_PB03) +#define DEFAULT_SPI_BUS_MISO (&pin_PB23) +#define DEFAULT_UART_BUS_TX (&pin_PB24) +#define DEFAULT_UART_BUS_RX (&pin_PB25) +#define DEFAULT_SPI_BUS_MOSI (&pin_PC27) +#define DEFAULT_SPI_BUS_SCK (&pin_PC28) +#define MICROPY_HW_LED_STATUS (&pin_PA15) +#define MICROPY_HW_LED_RX (&pin_PC05) +#define MICROPY_HW_LED_TX (&pin_PC06) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.mk b/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.mk new file mode 100644 index 0000000000..f1b2f4c1d9 --- /dev/null +++ b/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.mk @@ -0,0 +1,12 @@ +USB_VID = 0x31e2 +USB_PID = 0x2011 +USB_PRODUCT = "VINA-D51" +USB_MANUFACTURER = "BDMICRO LLC" + +CHIP_VARIANT = SAMD51N20A +CHIP_FAMILY = samd51 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 2 +EXTERNAL_FLASH_DEVICES = "MX25L51245G","GD25S512MD" +LONGINT_IMPL = MPZ diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c b/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c new file mode 100644 index 0000000000..d0006393ce --- /dev/null +++ b/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c @@ -0,0 +1,82 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PC10) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PC11) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PC20) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PC21) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PB31) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_ESP01_EN), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_ESP01_GPIO0), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_UART3_RTS), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_ESP01_GPIO2), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_UART3_CTS), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_ESP01_RESET), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_ESP01_RX), MP_ROM_PTR(&pin_PB21) }, + { MP_ROM_QSTR(MP_QSTR_UART3_RX), MP_ROM_PTR(&pin_PB21) }, + { MP_ROM_QSTR(MP_QSTR_ESP01_TX), MP_ROM_PTR(&pin_PB20) }, + { MP_ROM_QSTR(MP_QSTR_UART3_TX), MP_ROM_PTR(&pin_PB20) }, + { MP_ROM_QSTR(MP_QSTR_I2C_SCL), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_I2C_SDA), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_I2S_FS-0), MP_ROM_PTR(&pin_PA20) }, + { MP_ROM_QSTR(MP_QSTR_I2S_FS_1), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_I2S_MCK_0), MP_ROM_PTR(&pin_PB17) }, + { MP_ROM_QSTR(MP_QSTR_I2S_MCK_1), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_I2S_SCK_0), MP_ROM_PTR(&pin_PB16) }, + { MP_ROM_QSTR(MP_QSTR_I2S_SCK_1), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_I2S_SDI), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_I2S_SDO), MP_ROM_PTR(&pin_PA21) }, + { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_LED_STATUS), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_PB18) }, + { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_PB19) }, + { MP_ROM_QSTR(MP_QSTR_LED_RX), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_LED_TX), MP_ROM_PTR(&pin_PC06) }, + { MP_ROM_QSTR(MP_QSTR_RS485_RE), MP_ROM_PTR(&pin_PC15) }, + { MP_ROM_QSTR(MP_QSTR_RS485_RX), MP_ROM_PTR(&pin_PC13) }, + { MP_ROM_QSTR(MP_QSTR_RS485_TE), MP_ROM_PTR(&pin_PC14) }, + { MP_ROM_QSTR(MP_QSTR_RS485_TX), MP_ROM_PTR(&pin_PC12) }, + { MP_ROM_QSTR(MP_QSTR_SPI_MISO), MP_ROM_PTR(&pin_PB23) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB23) }, + { MP_ROM_QSTR(MP_QSTR_SPI_MOSI), MP_ROM_PTR(&pin_PC27) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PC27) }, + { MP_ROM_QSTR(MP_QSTR_SPI_SCK), MP_ROM_PTR(&pin_PC28) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PC28) }, + { MP_ROM_QSTR(MP_QSTR_SPI_SS), MP_ROM_PTR(&pin_PB22) }, + { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_PB22) }, + { MP_ROM_QSTR(MP_QSTR_UART1_CTS), MP_ROM_PTR(&pin_PC19) }, + { MP_ROM_QSTR(MP_QSTR_UART1_RTS), MP_ROM_PTR(&pin_PC18) }, + { MP_ROM_QSTR(MP_QSTR_UART1_RX), MP_ROM_PTR(&pin_PC17) }, + { MP_ROM_QSTR(MP_QSTR_UART1_TX), MP_ROM_PTR(&pin_PC16) }, + { MP_ROM_QSTR(MP_QSTR_UART2_RX), MP_ROM_PTR(&pin_PB25) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB25) }, + { MP_ROM_QSTR(MP_QSTR_UART2_TX), MP_ROM_PTR(&pin_PB24) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB24) }, + { 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_global_dict_table); From 56427d9abe7d905da7c11a3d935481bea23a78ff Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 13 Oct 2020 14:02:29 -0700 Subject: [PATCH 1138/1293] Fix stm sleep too long --- ports/stm/supervisor/port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 79e4584b0e..a8aab00ff2 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -423,7 +423,7 @@ void port_interrupt_after_ticks(uint32_t ticks) { alarm.AlarmMask = RTC_ALARMMASK_ALL; } - alarm.AlarmTime.SubSeconds = rtc_clock_frequency - + alarm.AlarmTime.SubSeconds = rtc_clock_frequency - 1 - ((raw_ticks % 1024) * 32); alarm.AlarmTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; alarm.AlarmTime.StoreOperation = RTC_STOREOPERATION_SET; From af2a23bd18adbee007aca1cb3c670341fe48b44d Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Tue, 13 Oct 2020 17:08:30 -0400 Subject: [PATCH 1139/1293] workflows/build.yml - Add forgotten vina_d51 board. --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eaecd2fa4d..0edc8c023d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -180,6 +180,7 @@ jobs: - "arduino_zero" - "bast_pro_mini_m0" - "bdmicro_vina_d21" + - "bdmicro_vina_d51" - "bless_dev_board_multi_sensor" - "blm_badge" - "capablerobot_usbhub" From 4270061db491bae1e7cca9ca2cbed5db70f9062e Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Tue, 13 Oct 2020 18:52:27 -0500 Subject: [PATCH 1140/1293] Moved ORDEREDDICT define to central location --- ports/atmel-samd/mpconfigport.h | 2 -- ports/litex/mpconfigport.h | 1 - ports/mimxrt10xx/mpconfigport.h | 1 - ports/nrf/mpconfigport.h | 1 - ports/stm/mpconfigport.h | 1 - ports/unix/mpconfigport.h | 1 - py/circuitpy_mpconfig.h | 1 + 7 files changed, 1 insertion(+), 7 deletions(-) diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index f185142e47..afe1cc4c65 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -43,7 +43,6 @@ #define MICROPY_PY_SYS_PLATFORM "Atmel SAMD21" #define SPI_FLASH_MAX_BAUDRATE 8000000 #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0) -#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0) #define MICROPY_PY_FUNCTION_ATTRS (0) // MICROPY_PY_UJSON depends on MICROPY_PY_IO #define MICROPY_PY_IO (0) @@ -81,7 +80,6 @@ #endif #define SPI_FLASH_MAX_BAUDRATE 24000000 #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1) -#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #define MICROPY_PY_FUNCTION_ATTRS (1) // MICROPY_PY_UJSON depends on MICROPY_PY_IO #define MICROPY_PY_IO (1) diff --git a/ports/litex/mpconfigport.h b/ports/litex/mpconfigport.h index fcf9d3b73b..a7caf8526c 100644 --- a/ports/litex/mpconfigport.h +++ b/ports/litex/mpconfigport.h @@ -30,7 +30,6 @@ #define CIRCUITPY_INTERNAL_NVM_SIZE (0) #define MICROPY_NLR_THUMB (0) -#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) #define MICROPY_PY_UBINASCII (1) #define MICROPY_PY_UJSON (1) diff --git a/ports/mimxrt10xx/mpconfigport.h b/ports/mimxrt10xx/mpconfigport.h index 7e7df01230..7496256d03 100644 --- a/ports/mimxrt10xx/mpconfigport.h +++ b/ports/mimxrt10xx/mpconfigport.h @@ -40,7 +40,6 @@ extern uint8_t _ld_default_stack_size; // 20kiB stack #define CIRCUITPY_DEFAULT_STACK_SIZE ((uint32_t) &_ld_default_stack_size) #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0) -#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0) #define MICROPY_PY_FUNCTION_ATTRS (0) #define MICROPY_PY_IO (1) #define MICROPY_PY_UJSON (1) diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 36a9819dc8..4ed42cd829 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -34,7 +34,6 @@ #include "nrf_sdm.h" // for SD_FLASH_SIZE #include "peripherals/nrf/nvm.h" // for FLASH_PAGE_SIZE -#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #define MICROPY_PY_FUNCTION_ATTRS (1) #define MICROPY_PY_IO (1) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) diff --git a/ports/stm/mpconfigport.h b/ports/stm/mpconfigport.h index e054ffbb58..9489b47657 100644 --- a/ports/stm/mpconfigport.h +++ b/ports/stm/mpconfigport.h @@ -30,7 +30,6 @@ #include -#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #define MICROPY_PY_FUNCTION_ATTRS (1) #define MICROPY_PY_IO (1) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) diff --git a/ports/unix/mpconfigport.h b/ports/unix/mpconfigport.h index 3ae4ff7866..d6bbad9ce1 100644 --- a/ports/unix/mpconfigport.h +++ b/ports/unix/mpconfigport.h @@ -99,7 +99,6 @@ #define MICROPY_PY_SYS_STDFILES (1) #define MICROPY_PY_SYS_EXC_INFO (1) #define MICROPY_PY_COLLECTIONS_DEQUE (1) -#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #ifndef MICROPY_PY_MATH_SPECIAL_FUNCTIONS #define MICROPY_PY_MATH_SPECIAL_FUNCTIONS (1) #endif diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 0583ae1c97..a3ffe52f66 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -195,6 +195,7 @@ typedef long mp_off_t; #define MICROPY_PY_BUILTINS_STR_PARTITION (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_BUILTINS_STR_SPLITLINES (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_UERRNO (CIRCUITPY_FULL_BUILD) +#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (CIRCUITPY_FULL_BUILD) // Opposite setting is deliberate. #define MICROPY_PY_UERRNO_ERRORCODE (!CIRCUITPY_FULL_BUILD) #ifndef MICROPY_PY_URE From 18fbff4f57e0c0b25ecaa3e1064c71b7a09f320b Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 14 Oct 2020 11:11:59 +0530 Subject: [PATCH 1141/1293] Update wifi hostname method --- ports/esp32s2/common-hal/wifi/Radio.c | 9 +++++++++ shared-bindings/wifi/Radio.c | 23 +++++++++++++++++------ shared-bindings/wifi/Radio.h | 1 + 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index 61d63e1f28..5e349c09d1 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -104,6 +104,15 @@ void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) { self->current_scan = NULL; } +mp_obj_t common_hal_wifi_radio_get_hostname(wifi_radio_obj_t *self) { + const char *hostname = NULL; + esp_netif_get_hostname(self->netif, &hostname); + if (hostname == NULL) { + return mp_const_none; + } + return mp_obj_new_str(hostname, strlen(hostname)); +} + void common_hal_wifi_radio_set_hostname(wifi_radio_obj_t *self, const char *hostname) { esp_netif_set_hostname(self->netif, hostname); } diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 9c774e1412..481294463a 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -50,7 +50,6 @@ //| STATIC mp_obj_t wifi_radio_get_enabled(mp_obj_t self) { return mp_obj_new_bool(common_hal_wifi_radio_get_enabled(self)); - } MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_enabled_obj, wifi_radio_get_enabled); @@ -102,11 +101,16 @@ STATIC mp_obj_t wifi_radio_stop_scanning_networks(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_stop_scanning_networks_obj, wifi_radio_stop_scanning_networks); -//| def set_hostname(self, hostname: ReadableBuffer) -> None: -//| """Sets hostname for wifi interface. When the hostname is altered after interface started/connected -//| the changes would only be reflected once the interface restarts/reconnects.""" -//| ... +//| hostname: ReadableBuffer +//| """Hostname for wifi interface. When the hostname is altered after interface started/connected +//| the changes would only be reflected once the interface restarts/reconnects.""" //| +STATIC mp_obj_t wifi_radio_get_hostname(mp_obj_t self_in) { + wifi_radio_obj_t *self = MP_OBJ_TO_PTR(self_in); + return common_hal_wifi_radio_get_hostname(self); +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_hostname_obj, wifi_radio_get_hostname); + STATIC mp_obj_t wifi_radio_set_hostname(mp_obj_t self_in, mp_obj_t hostname_in) { mp_buffer_info_t hostname; mp_get_buffer_raise(hostname_in, &hostname, MP_BUFFER_READ); @@ -122,6 +126,13 @@ STATIC mp_obj_t wifi_radio_set_hostname(mp_obj_t self_in, mp_obj_t hostname_in) } MP_DEFINE_CONST_FUN_OBJ_2(wifi_radio_set_hostname_obj, wifi_radio_set_hostname); +const mp_obj_property_t wifi_radio_hostname_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&wifi_radio_get_hostname_obj, + (mp_obj_t)&wifi_radio_set_hostname_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + //| def connect(self, ssid: ReadableBuffer, password: ReadableBuffer = b"", *, channel: Optional[int] = 0, timeout: Optional[float] = None) -> bool: //| """Connects to the given ssid and waits for an ip address. Reconnections are handled //| automatically once one connection succeeds.""" @@ -236,7 +247,7 @@ STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_start_scanning_networks), MP_ROM_PTR(&wifi_radio_start_scanning_networks_obj) }, { MP_ROM_QSTR(MP_QSTR_stop_scanning_networks), MP_ROM_PTR(&wifi_radio_stop_scanning_networks_obj) }, - { MP_ROM_QSTR(MP_QSTR_set_hostname), MP_ROM_PTR(&wifi_radio_set_hostname_obj) }, + { MP_ROM_QSTR(MP_QSTR_hostname), MP_ROM_PTR(&wifi_radio_hostname_obj) }, { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&wifi_radio_connect_obj) }, // { MP_ROM_QSTR(MP_QSTR_connect_to_enterprise), MP_ROM_PTR(&wifi_radio_connect_to_enterprise_obj) }, diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index 4226ae2a96..a6a6161542 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -45,6 +45,7 @@ typedef enum { extern bool common_hal_wifi_radio_get_enabled(wifi_radio_obj_t *self); extern void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled); +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 mp_obj_t common_hal_wifi_radio_get_mac_address(wifi_radio_obj_t *self); From 852a91e1b73f217926379c114cafa6089980976e Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Wed, 14 Oct 2020 08:29:28 -0400 Subject: [PATCH 1142/1293] boards/bdmicro_vina_d51/pins.c: Fix illegal QSTR name (hyphen). --- ports/atmel-samd/boards/bdmicro_vina_d51/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c b/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c index d0006393ce..931e0328fc 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c +++ b/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c @@ -41,7 +41,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB03) }, { MP_ROM_QSTR(MP_QSTR_I2C_SDA), MP_ROM_PTR(&pin_PB02) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB02) }, - { MP_ROM_QSTR(MP_QSTR_I2S_FS-0), MP_ROM_PTR(&pin_PA20) }, + { MP_ROM_QSTR(MP_QSTR_I2S_FS_0), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_I2S_FS_1), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_I2S_MCK_0), MP_ROM_PTR(&pin_PB17) }, { MP_ROM_QSTR(MP_QSTR_I2S_MCK_1), MP_ROM_PTR(&pin_PB13) }, From fead0433bd7deedc27208bfdc32a8ce88dda38e0 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Wed, 14 Oct 2020 17:13:01 +0000 Subject: [PATCH 1143/1293] Translated using Weblate (Swedish) Currently translated at 100.0% (832 of 832 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 1d5739ed70..11e15e79e6 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: 2020-10-10 23:49-0700\n" -"PO-Revision-Date: 2020-10-02 22:53+0000\n" +"PO-Revision-Date: 2020-10-14 18:12+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -252,7 +252,7 @@ msgstr "'return' utanför funktion" #: py/compile.c msgid "'yield from' inside async function" -msgstr "" +msgstr "'yield from' i async-funktion" #: py/compile.c msgid "'yield' outside function" @@ -281,7 +281,7 @@ msgstr "En kanal för hårdvaruavbrott används redan" #: ports/esp32s2/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" -msgstr "" +msgstr "ADC2 används av WiFi" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format @@ -3495,7 +3495,7 @@ msgstr "typobjektet '%q' har inget attribut '%q'" #: py/objgenerator.c msgid "type object 'generator' has no attribute '__await__'" -msgstr "" +msgstr "typobjekt 'generator' har inget attribut '__await__'" #: py/objtype.c msgid "type takes 1 or 3 arguments" From e6d0b207ec0abaf69171578d0beb668b17aec4b8 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Wed, 14 Oct 2020 14:06:34 -0500 Subject: [PATCH 1144/1293] Removed MICROPY_PY_COLLECTIONS_NAMEDTUPLE__ASDICT from unix coverage --- ports/unix/mpconfigport_coverage.h | 1 - py/objnamedtuple.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/unix/mpconfigport_coverage.h b/ports/unix/mpconfigport_coverage.h index 51015a5872..468d69a733 100644 --- a/ports/unix/mpconfigport_coverage.h +++ b/ports/unix/mpconfigport_coverage.h @@ -49,7 +49,6 @@ #define MICROPY_VFS_FAT (1) #define MICROPY_FATFS_USE_LABEL (1) #define MICROPY_PY_FRAMEBUF (1) -#define MICROPY_PY_COLLECTIONS_NAMEDTUPLE__ASDICT (1) // TODO these should be generic, not bound to fatfs #define mp_type_fileio mp_type_vfs_posix_fileio diff --git a/py/objnamedtuple.c b/py/objnamedtuple.c index 6c36909e75..ab2f2f3c00 100644 --- a/py/objnamedtuple.c +++ b/py/objnamedtuple.c @@ -46,7 +46,7 @@ size_t mp_obj_namedtuple_find_field(const mp_obj_namedtuple_type_t *type, qstr n return (size_t)-1; } -#if MICROPY_PY_COLLECTIONS_NAMEDTUPLE__ASDICT +#if MICROPY_PY_COLLECTIONS_ORDEREDDICT STATIC mp_obj_t namedtuple_asdict(mp_obj_t self_in) { mp_obj_namedtuple_t *self = MP_OBJ_TO_PTR(self_in); const qstr *fields = ((mp_obj_namedtuple_type_t*)self->tuple.base.type)->fields; From 0a9bcc538bf7540dbcb374fd447b11fe9e881494 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Wed, 14 Oct 2020 20:14:55 -0500 Subject: [PATCH 1145/1293] Removed ordered dict for all SAMD21 --- ports/atmel-samd/mpconfigport.h | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index afe1cc4c65..f7ccff4da2 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -48,6 +48,7 @@ #define MICROPY_PY_IO (0) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (0) #define MICROPY_PY_UJSON (0) +#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0) #define MICROPY_PY_UERRNO_LIST \ X(EPERM) \ X(ENOENT) \ From f6f89565d83c0ac942496f29394ff59976aaa5b9 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Wed, 14 Oct 2020 20:18:49 -0500 Subject: [PATCH 1146/1293] Remove ordered dict from SAMD21 --- py/circuitpy_mpconfig.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index a3ffe52f66..a0eb4fc070 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -195,7 +195,9 @@ typedef long mp_off_t; #define MICROPY_PY_BUILTINS_STR_PARTITION (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_BUILTINS_STR_SPLITLINES (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_UERRNO (CIRCUITPY_FULL_BUILD) +#ifndef MICROPY_PY_COLLECTIONS_ORDEREDDICT #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (CIRCUITPY_FULL_BUILD) +#endif // Opposite setting is deliberate. #define MICROPY_PY_UERRNO_ERRORCODE (!CIRCUITPY_FULL_BUILD) #ifndef MICROPY_PY_URE From 2517e4b486563724771074da88bc7fd6eda02532 Mon Sep 17 00:00:00 2001 From: Jensen Date: Wed, 14 Oct 2020 21:51:22 -0500 Subject: [PATCH 1147/1293] displayio: ColorConverter handle if opaque color is black --- shared-bindings/displayio/ColorConverter.c | 15 +++++---------- shared-bindings/displayio/ColorConverter.h | 2 +- shared-module/displayio/ColorConverter.c | 9 +++------ 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index a041bbe597..40550af82f 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -117,7 +117,7 @@ STATIC mp_obj_t displayio_colorconverter_make_transparent(mp_obj_t self_in, mp_o displayio_colorconverter_t *self = MP_OBJ_TO_PTR(self_in); mp_int_t transparent_color; - if (!mp_obj_get_int_maybe(transparent_color_obj, &transparent_color)) { + if (!mp_obj_get_int(&transparent_color)) { mp_raise_ValueError(translate("transparent_color should be an int")); } common_hal_displayio_colorconverter_make_transparent(self, transparent_color); @@ -125,20 +125,15 @@ STATIC mp_obj_t displayio_colorconverter_make_transparent(mp_obj_t self_in, mp_o } MP_DEFINE_CONST_FUN_OBJ_2(displayio_colorconverter_make_transparent_obj, displayio_colorconverter_make_transparent); -//| def make_opaque(self, pixel: int) -> None: +//| def make_opaque(self) -> None: //| """Sets a pixel to opaque.""" //| -STATIC mp_obj_t displayio_colorconverter_make_opaque(mp_obj_t self_in, mp_obj_t transparent_color_obj) { +STATIC mp_obj_t displayio_colorconverter_make_opaque(mp_obj_t self_in) { displayio_colorconverter_t *self = MP_OBJ_TO_PTR(self_in); - - mp_int_t transparent_color; - if (!mp_obj_get_int_maybe(transparent_color_obj, &transparent_color)) { - mp_raise_ValueError(translate("transparent_color should be an int")); - } - common_hal_displayio_colorconverter_make_opaque(self, transparent_color); + common_hal_displayio_colorconverter_make_opaque(self); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_2(displayio_colorconverter_make_opaque_obj, displayio_colorconverter_make_opaque); +MP_DEFINE_CONST_FUN_OBJ_1(displayio_colorconverter_make_opaque_obj, displayio_colorconverter_make_opaque); STATIC const mp_rom_map_elem_t displayio_colorconverter_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_convert), MP_ROM_PTR(&displayio_colorconverter_convert_obj) }, diff --git a/shared-bindings/displayio/ColorConverter.h b/shared-bindings/displayio/ColorConverter.h index 441f7c7aee..e4ddd1972d 100644 --- a/shared-bindings/displayio/ColorConverter.h +++ b/shared-bindings/displayio/ColorConverter.h @@ -40,6 +40,6 @@ void common_hal_displayio_colorconverter_set_dither(displayio_colorconverter_t* bool common_hal_displayio_colorconverter_get_dither(displayio_colorconverter_t* self); void common_hal_displayio_colorconverter_make_transparent(displayio_colorconverter_t* self, uint32_t transparent_color); -void common_hal_displayio_colorconverter_make_opaque(displayio_colorconverter_t* self, uint32_t transparent_color); +void common_hal_displayio_colorconverter_make_opaque(displayio_colorconverter_t* self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_COLORCONVERTER_H diff --git a/shared-module/displayio/ColorConverter.c b/shared-module/displayio/ColorConverter.c index fef71cdf5e..4089b2265e 100644 --- a/shared-module/displayio/ColorConverter.c +++ b/shared-module/displayio/ColorConverter.c @@ -130,16 +130,13 @@ bool common_hal_displayio_colorconverter_get_dither(displayio_colorconverter_t* } void common_hal_displayio_colorconverter_make_transparent(displayio_colorconverter_t* self, uint32_t transparent_color) { - if (self->transparent_color) { - mp_raise_RuntimeError(translate("transparent_color value is already set")); + if (self->transparent_color >= 0x1000000) { + mp_raise_RuntimeError(translate("Only one color can be transparent at a time")); } self->transparent_color = transparent_color; } -void common_hal_displayio_colorconverter_make_opaque(displayio_colorconverter_t* self, uint32_t transparent_color) { - if (self->transparent_color != transparent_color) { - mp_raise_RuntimeError(translate("transparent_color value is not transparent")); - } +void common_hal_displayio_colorconverter_make_opaque(displayio_colorconverter_t* self) { // 0x1000000 will never equal a valid color self->transparent_color = 0x1000000; } From cb0a4abc9592378eb185bd04facf8db0b416a2fe Mon Sep 17 00:00:00 2001 From: Jensen Date: Wed, 14 Oct 2020 22:22:48 -0500 Subject: [PATCH 1148/1293] displayio: new translation strings --- locale/circuitpython.pot | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index ea29676b79..c4b40d3617 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-12 20:47-0500\n" +"POT-Creation-Date: 2020-10-14 22:22-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1026,6 +1026,7 @@ msgstr "" msgid "Invalid BSSID" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" @@ -1237,7 +1238,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -1400,6 +1400,10 @@ msgid "" "%d bpp given" msgstr "" +#: shared-module/displayio/ColorConverter.c +msgid "Only one color can be transparent at a time" +msgstr "" + #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" msgstr "" @@ -3408,14 +3412,6 @@ msgstr "" msgid "transparent_color should be an int" msgstr "" -#: shared-module/displayio/ColorConverter.c -msgid "transparent_color value is already set" -msgstr "" - -#: shared-module/displayio/ColorConverter.c -msgid "transparent_color value is not transparent" -msgstr "" - #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "" From b02a5bcbd5eb96111ba30c49780677573fe1a66d Mon Sep 17 00:00:00 2001 From: Jensen Date: Wed, 14 Oct 2020 23:05:19 -0500 Subject: [PATCH 1149/1293] displayio: Remove verbose error --- shared-bindings/displayio/ColorConverter.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index 40550af82f..4e41ceff15 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -116,10 +116,7 @@ const mp_obj_property_t displayio_colorconverter_dither_obj = { STATIC mp_obj_t displayio_colorconverter_make_transparent(mp_obj_t self_in, mp_obj_t transparent_color_obj) { displayio_colorconverter_t *self = MP_OBJ_TO_PTR(self_in); - mp_int_t transparent_color; - if (!mp_obj_get_int(&transparent_color)) { - mp_raise_ValueError(translate("transparent_color should be an int")); - } + mp_int_t transparent_color = mp_obj_get_int(&transparent_color); common_hal_displayio_colorconverter_make_transparent(self, transparent_color); return mp_const_none; } From 26fd2c62238bb2fad5c0b727e279157f3f6c02cb Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Thu, 15 Oct 2020 16:08:01 +0530 Subject: [PATCH 1150/1293] Add hostname validation --- locale/circuitpython.pot | 8 ++++++-- shared-bindings/wifi/Radio.c | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 76681d2094..cf92b0584a 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-12 14:16+0530\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -948,7 +948,7 @@ msgid "Hardware in use, try alternative pins" msgstr "" #: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 63 characters" +msgid "Hostname must be between 1 and 253 characters" msgstr "" #: extmod/vfs_posix_file.c py/objstringio.c @@ -2732,6 +2732,10 @@ msgstr "" msgid "invalid format specifier" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "invalid hostname" +msgstr "" + #: extmod/modussl_axtls.c msgid "invalid key" msgstr "" diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 481294463a..b548d66f6a 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -24,11 +24,13 @@ * THE SOFTWARE. */ +#include "shared-bindings/wifi/__init__.h" + +#include #include -#include "py/objproperty.h" #include "py/runtime.h" -#include "shared-bindings/wifi/__init__.h" +#include "py/objproperty.h" //| class Radio: //| """Native wifi radio. @@ -115,10 +117,17 @@ STATIC mp_obj_t wifi_radio_set_hostname(mp_obj_t self_in, mp_obj_t hostname_in) mp_buffer_info_t hostname; mp_get_buffer_raise(hostname_in, &hostname, MP_BUFFER_READ); - if (hostname.len < 1 || hostname.len > 63) { - mp_raise_ValueError(translate("Hostname must be between 1 and 63 characters")); + if (hostname.len < 1 || hostname.len > 253) { + mp_raise_ValueError(translate("Hostname must be between 1 and 253 characters")); } + regex_t regex; //validate hostname according to RFC 1123 + regcomp(®ex,"^(([a-z0-9]|[a-z0-9][a-z0-9\\-]{0,61}[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]{0,61}[a-z0-9])$", REG_EXTENDED | REG_ICASE | REG_NOSUB); + if (regexec(®ex, hostname.buf, 0, NULL, 0)) { + mp_raise_ValueError(translate("invalid hostname")); + } + regfree(®ex); + wifi_radio_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_wifi_radio_set_hostname(self, hostname.buf); From 97fae546595753b4d7c19344f5ed4d4a233a127c Mon Sep 17 00:00:00 2001 From: Enrique Casado Date: Thu, 15 Oct 2020 12:39:14 +0200 Subject: [PATCH 1151/1293] Add DynOSSAT-EDU boards --- .github/workflows/build.yml | 2 + .../boards/dynossat_edu_eps/board.c | 38 ++++++++++++++++ .../boards/dynossat_edu_eps/mpconfigboard.h | 40 +++++++++++++++++ .../boards/dynossat_edu_eps/mpconfigboard.mk | 23 ++++++++++ .../atmel-samd/boards/dynossat_edu_eps/pins.c | 32 ++++++++++++++ .../boards/dynossat_edu_obc/board.c | 38 ++++++++++++++++ .../boards/dynossat_edu_obc/mpconfigboard.h | 44 +++++++++++++++++++ .../boards/dynossat_edu_obc/mpconfigboard.mk | 15 +++++++ .../atmel-samd/boards/dynossat_edu_obc/pins.c | 40 +++++++++++++++++ 9 files changed, 272 insertions(+) create mode 100644 ports/atmel-samd/boards/dynossat_edu_eps/board.c create mode 100644 ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/dynossat_edu_eps/pins.c create mode 100644 ports/atmel-samd/boards/dynossat_edu_obc/board.c create mode 100644 ports/atmel-samd/boards/dynossat_edu_obc/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/dynossat_edu_obc/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/dynossat_edu_obc/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0edc8c023d..b3455cb537 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -198,6 +198,8 @@ jobs: - "datum_imu" - "datum_light" - "datum_weather" + - "dynossat_edu_eps" + - "dynossat_edu_obc" - "electronut_labs_blip" - "electronut_labs_papyr" - "escornabot_makech" diff --git a/ports/atmel-samd/boards/dynossat_edu_eps/board.c b/ports/atmel-samd/boards/dynossat_edu_eps/board.c new file mode 100644 index 0000000000..c8e20206a1 --- /dev/null +++ b/ports/atmel-samd/boards/dynossat_edu_eps/board.c @@ -0,0 +1,38 @@ +/* + * 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 "boards/board.h" + +void board_init(void) +{ +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.h b/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.h new file mode 100644 index 0000000000..ef4fa8f997 --- /dev/null +++ b/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.h @@ -0,0 +1,40 @@ +#define MICROPY_HW_BOARD_NAME "DynOSSAT-EDU-EPS" +#define MICROPY_HW_MCU_NAME "samd21g18" + +#define MICROPY_HW_NEOPIXEL (&pin_PA06) + +#define SPI_FLASH_MOSI_PIN &pin_PA22 +#define SPI_FLASH_MISO_PIN &pin_PA21 +#define SPI_FLASH_SCK_PIN &pin_PA23 +#define SPI_FLASH_CS_PIN &pin_PA20 + +// These are pins not to reset. +#define MICROPY_PORT_A ( 0 ) +#define MICROPY_PORT_B ( 0 ) +#define MICROPY_PORT_C ( 0 ) + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA09) +#define DEFAULT_I2C_BUS_SDA (&pin_PA08) + +#define DEFAULT_SPI_BUS_SCK (&pin_PB11) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA12) +#define DEFAULT_SPI_BUS_MISO (&pin_PB10) + +#define DEFAULT_UART_BUS_RX (&pin_PA17) +#define DEFAULT_UART_BUS_TX (&pin_PA16) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 +#define IGNORE_PIN_PA03 1 +#define IGNORE_PIN_PA13 1 +#define IGNORE_PIN_PA14 1 +#define IGNORE_PIN_PA15 1 +#define IGNORE_PIN_PA18 1 +#define IGNORE_PIN_PA27 1 +#define IGNORE_PIN_PA28 1 +#define IGNORE_PIN_PB08 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 diff --git a/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk b/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk new file mode 100644 index 0000000000..a1005e09da --- /dev/null +++ b/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk @@ -0,0 +1,23 @@ +USB_VID = 0 +USB_PID = 0 + +USB_PRODUCT = "DynOSSAT-EDU EPS v1.0" +USB_MANUFACTURER = "Blackhand Dynamics SL" + +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + +SPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = "GD25Q32C" +LONGINT_IMPL = MPZ + +CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_COUNTIO = 0 +CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_VECTORIO = 0 + +CFLAGS_INLINE_LIMIT = 60 + +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/dynossat_edu_eps/pins.c b/ports/atmel-samd/boards/dynossat_edu_eps/pins.c new file mode 100644 index 0000000000..a910311d4a --- /dev/null +++ b/ports/atmel-samd/boards/dynossat_edu_eps/pins.c @@ -0,0 +1,32 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_PA30) }, + { MP_ROM_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_PA31) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_OVTEMP), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_SAT_RESET), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_SAT_PWR_ENABLE), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_INT_IMU_OBC), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_PWRMON_SDA), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_PWRMON_SCL), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_PWRMON_ALERT), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_I2C_MONITOR), 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_global_dict_table); diff --git a/ports/atmel-samd/boards/dynossat_edu_obc/board.c b/ports/atmel-samd/boards/dynossat_edu_obc/board.c new file mode 100644 index 0000000000..c8e20206a1 --- /dev/null +++ b/ports/atmel-samd/boards/dynossat_edu_obc/board.c @@ -0,0 +1,38 @@ +/* + * 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 "boards/board.h" + +void board_init(void) +{ +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/dynossat_edu_obc/mpconfigboard.h b/ports/atmel-samd/boards/dynossat_edu_obc/mpconfigboard.h new file mode 100644 index 0000000000..d7df8db74d --- /dev/null +++ b/ports/atmel-samd/boards/dynossat_edu_obc/mpconfigboard.h @@ -0,0 +1,44 @@ +#define MICROPY_HW_BOARD_NAME "DynOSSAT-EDU-OBC" +#define MICROPY_HW_MCU_NAME "samd51j20" + +#define MICROPY_HW_NEOPIXEL (&pin_PA08) + +#define SPI_FLASH_MOSI_PIN &pin_PA16 +#define SPI_FLASH_MISO_PIN &pin_PA18 +#define SPI_FLASH_SCK_PIN &pin_PA17 +#define SPI_FLASH_CS_PIN &pin_PA19 + +// These are pins not to reset. +#define MICROPY_PORT_A ( PORT_PA16 | PORT_PA17 | PORT_PA18 | PORT_PA19 ) +#define MICROPY_PORT_B ( 0 ) +#define MICROPY_PORT_C ( 0 ) +#define MICROPY_PORT_D ( 0 ) + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PB13) +#define DEFAULT_I2C_BUS_SDA (&pin_PB12) + +#define DEFAULT_SPI_BUS_SCK (&pin_PB03) +#define DEFAULT_SPI_BUS_MOSI (&pin_PB02) +#define DEFAULT_SPI_BUS_MISO (&pin_PB01) + +#define DEFAULT_UART_BUS_RX (&pin_PA23) +#define DEFAULT_UART_BUS_TX (&pin_PA22) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 +#define IGNORE_PIN_PA02 1 +#define IGNORE_PIN_PA13 1 +#define IGNORE_PIN_PA14 1 +#define IGNORE_PIN_PA20 1 +#define IGNORE_PIN_PA21 1 +#define IGNORE_PIN_PA27 1 +#define IGNORE_PIN_PB00 1 +#define IGNORE_PIN_PB04 1 +#define IGNORE_PIN_PB05 1 +#define IGNORE_PIN_PB16 1 +#define IGNORE_PIN_PB17 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PB31 1 diff --git a/ports/atmel-samd/boards/dynossat_edu_obc/mpconfigboard.mk b/ports/atmel-samd/boards/dynossat_edu_obc/mpconfigboard.mk new file mode 100644 index 0000000000..d5c626d130 --- /dev/null +++ b/ports/atmel-samd/boards/dynossat_edu_obc/mpconfigboard.mk @@ -0,0 +1,15 @@ +USB_VID = 0 +USB_PID = 0 +USB_PRODUCT = "DynOSSAT-EDU OBC v1.0" +USB_MANUFACTURER = "Blackhand Dynamics SL" + +CHIP_VARIANT = SAMD51J20A +CHIP_FAMILY = samd51 + +SPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = GD25Q32C +LONGINT_IMPL = MPZ + +CFLAGS_INLINE_LIMIT = 60 +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/dynossat_edu_obc/pins.c b/ports/atmel-samd/boards/dynossat_edu_obc/pins.c new file mode 100644 index 0000000000..a560360f7d --- /dev/null +++ b/ports/atmel-samd/boards/dynossat_edu_obc/pins.c @@ -0,0 +1,40 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PB30) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_PA30) }, + { MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_PA31) }, + { MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PB22) }, + { MP_ROM_QSTR(MP_QSTR_INT_IMU), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_SAT_POWER), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA08) }, + { 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_global_dict_table); From 82b49afe43494bb1d05bd7786a4f75a0288bf695 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 15 Oct 2020 11:15:48 -0400 Subject: [PATCH 1152/1293] enable CIRCUITPY_BLEIO_HCI on non-nRF boards where it will fit --- .../boards/metro_m4_airlift_lite/mpconfigboard.mk | 4 ---- ports/atmel-samd/mpconfigport.mk | 3 +++ ports/nrf/mpconfigport.mk | 3 +++ py/circuitpy_mpconfig.mk | 10 +++++----- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk index e999629c32..4895cda77b 100644 --- a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk @@ -6,10 +6,6 @@ USB_MANUFACTURER = "Adafruit Industries LLC" CHIP_VARIANT = SAMD51J19A CHIP_FAMILY = samd51 -# Support _bleio via the on-board ESP32 module. -CIRCUITPY_BLEIO = 1 -CIRCUITPY_BLEIO_HCI = 1 - QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 3 EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C" diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index a16daf4b00..1929e146d3 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -37,6 +37,9 @@ ifndef CIRCUITPY_TOUCHIO_USE_NATIVE CIRCUITPY_TOUCHIO_USE_NATIVE = 1 endif +# No room for HCI _bleio on SAMD21. +CIRCUITPY_BLEIO_HCI = 0 + CIRCUITPY_SDCARDIO ?= 0 # Not enough RAM for framebuffers diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index ed689545d0..9560064fbc 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -23,6 +23,9 @@ CIRCUITPY_AUDIOCORE ?= 1 CIRCUITPY_AUDIOMIXER ?= 1 CIRCUITPY_AUDIOPWMIO ?= 1 +# Native BLEIO is not compatible with HCI _bleio. +CIRCUITPY_BLEIO_HCI = 0 + CIRCUITPY_BLEIO ?= 1 # No I2CPeripheral implementation diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 91850448db..a6aabec33d 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -79,14 +79,14 @@ CFLAGS += -DCIRCUITPY_AUDIOMP3=$(CIRCUITPY_AUDIOMP3) CIRCUITPY_BITBANGIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_BITBANGIO=$(CIRCUITPY_BITBANGIO) -# Explicitly enabled for boards that support _bleio. -CIRCUITPY_BLEIO ?= 0 -CFLAGS += -DCIRCUITPY_BLEIO=$(CIRCUITPY_BLEIO) - # _bleio can be supported on most any board via HCI -CIRCUITPY_BLEIO_HCI ?= 0 +CIRCUITPY_BLEIO_HCI ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_BLEIO_HCI=$(CIRCUITPY_BLEIO_HCI) +# Explicitly enabled for boards that support _bleio. +CIRCUITPY_BLEIO ?= $(CIRCUITPY_BLEIO_HCI) +CFLAGS += -DCIRCUITPY_BLEIO=$(CIRCUITPY_BLEIO) + CIRCUITPY_BOARD ?= 1 CFLAGS += -DCIRCUITPY_BOARD=$(CIRCUITPY_BOARD) From f36336e17114d91bb85bf67665bd3adde409e14d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 15 Oct 2020 18:06:57 +0000 Subject: [PATCH 1153/1293] Translated using Weblate (French) Currently translated at 92.1% (767 of 832 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 500f0a091d..15f4c32f23 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-10 23:49-0700\n" -"PO-Revision-Date: 2020-10-12 21:00+0000\n" -"Last-Translator: Noel Gaetan \n" +"PO-Revision-Date: 2020-10-15 18:07+0000\n" +"Last-Translator: Jeff Epler \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" @@ -46,7 +46,7 @@ msgstr " Fichier \"%q\", ligne %d" #: main.c msgid " output:\n" -msgstr " sortie :\n" +msgstr " sortie :\n" #: py/objstr.c #, c-format From 9a2ab36fa53c622b249b872a6ee47943385c9f36 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 15 Oct 2020 18:13:02 +0000 Subject: [PATCH 1154/1293] Translated using Weblate (French) Currently translated at 92.1% (767 of 832 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 15f4c32f23..0e7cd1df33 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-10 23:49-0700\n" -"PO-Revision-Date: 2020-10-15 18:07+0000\n" +"PO-Revision-Date: 2020-10-15 18:17+0000\n" "Last-Translator: Jeff Epler \n" "Language: fr\n" "MIME-Version: 1.0\n" @@ -532,7 +532,7 @@ msgstr "Impossible de définir CCCD sur une caractéristique locale" #: shared-bindings/_bleio/Adapter.c msgid "Cannot create a new Adapter; use _bleio.adapter;" msgstr "" -"Un nouveau Adapter ne peut être créé ; Adapter; utilisez _bleio.adapter;" +"Un nouveau Adapter ne peut être créé ; Adapter; utilisez _bleio.adapter;" #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c @@ -3613,7 +3613,7 @@ msgstr "caractère de format '%c' (0x%x) non supporté à l'index %d" #: py/runtime.c msgid "unsupported type for %q: '%q'" -msgstr "type non supporté pour %q : '%q'" +msgstr "type non supporté pour %q : '%q'" #: py/runtime.c msgid "unsupported type for operator" From 6bfb6afacab099f0892735dce2bdcccffcfa6782 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 15 Oct 2020 20:17:16 +0200 Subject: [PATCH 1155/1293] 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 | 12 ++++++++++-- locale/cs.po | 12 ++++++++++-- locale/de_DE.po | 12 ++++++++++-- locale/el.po | 12 ++++++++++-- locale/es.po | 12 ++++++++++-- locale/fil.po | 12 ++++++++++-- locale/fr.po | 12 ++++++++++-- locale/hi.po | 12 ++++++++++-- locale/it_IT.po | 12 ++++++++++-- locale/ja.po | 12 ++++++++++-- locale/ko.po | 12 ++++++++++-- locale/nl.po | 12 ++++++++++-- locale/pl.po | 12 ++++++++++-- locale/pt_BR.po | 12 ++++++++++-- locale/sv.po | 12 ++++++++++-- locale/zh_Latn_pinyin.po | 12 ++++++++++-- 16 files changed, 160 insertions(+), 32 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 61af353825..f35afea66d 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-10 23:49-0700\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -966,6 +966,10 @@ msgstr "Perangkat keras sibuk, coba pin alternatif" msgid "Hardware in use, try alternative pins" msgstr "Perangkat keras sedang digunakan, coba pin alternatif" +#: shared-bindings/wifi/Radio.c +msgid "Hostname must be between 1 and 253 characters" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "operasi I/O pada file tertutup" @@ -1047,6 +1051,7 @@ msgstr "File BMP tidak valid" msgid "Invalid BSSID" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "Pin DAC yang diberikan tidak valid" @@ -1258,7 +1263,6 @@ msgid "No CCCD for this Characteristic" msgstr "Tidak ada CCCD untuk Karakteristik ini" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Tidak ada DAC (Digital Analog Converter) di dalam chip" @@ -2775,6 +2779,10 @@ msgstr "format tidak valid" msgid "invalid format specifier" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "invalid hostname" +msgstr "" + #: extmod/modussl_axtls.c msgid "invalid key" msgstr "key tidak valid" diff --git a/locale/cs.po b/locale/cs.po index 6c5e871637..d7caa43ea1 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-10 23:49-0700\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -951,6 +951,10 @@ msgstr "" msgid "Hardware in use, try alternative pins" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Hostname must be between 1 and 253 characters" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" @@ -1030,6 +1034,7 @@ msgstr "" msgid "Invalid BSSID" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" @@ -1241,7 +1246,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -2732,6 +2736,10 @@ msgstr "" msgid "invalid format specifier" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "invalid hostname" +msgstr "" + #: extmod/modussl_axtls.c msgid "invalid key" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 5633ae9c08..89969e8748 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-10 23:49-0700\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -966,6 +966,10 @@ msgstr "Hardware beschäftigt, versuchen Sie alternative Pins" msgid "Hardware in use, try alternative pins" msgstr "Hardware in benutzung, probiere alternative Pins" +#: shared-bindings/wifi/Radio.c +msgid "Hostname must be between 1 and 253 characters" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Lese/Schreibe-operation an geschlossener Datei" @@ -1047,6 +1051,7 @@ msgstr "Ungültige BMP-Datei" msgid "Invalid BSSID" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "Ungültiger DAC-Pin angegeben" @@ -1260,7 +1265,6 @@ msgid "No CCCD for this Characteristic" msgstr "Kein CCCD für diese Charakteristik" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Kein DAC im Chip vorhanden" @@ -2803,6 +2807,10 @@ msgstr "ungültiges Format" msgid "invalid format specifier" msgstr "ungültiger Formatbezeichner" +#: shared-bindings/wifi/Radio.c +msgid "invalid hostname" +msgstr "" + #: extmod/modussl_axtls.c msgid "invalid key" msgstr "ungültiger Schlüssel" diff --git a/locale/el.po b/locale/el.po index 4202f6ae06..42b083e3c9 100644 --- a/locale/el.po +++ b/locale/el.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-10 23:49-0700\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -946,6 +946,10 @@ msgstr "" msgid "Hardware in use, try alternative pins" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Hostname must be between 1 and 253 characters" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" @@ -1025,6 +1029,7 @@ msgstr "" msgid "Invalid BSSID" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" @@ -1236,7 +1241,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -2727,6 +2731,10 @@ msgstr "" msgid "invalid format specifier" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "invalid hostname" +msgstr "" + #: extmod/modussl_axtls.c msgid "invalid key" msgstr "" diff --git a/locale/es.po b/locale/es.po index 1b006e1d1e..16254aa5e7 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-10 23:49-0700\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: 2020-10-09 17:19+0000\n" "Last-Translator: dherrada \n" "Language-Team: \n" @@ -967,6 +967,10 @@ msgstr "Hardware ocupado, pruebe pines alternativos" msgid "Hardware in use, try alternative pins" msgstr "Hardware en uso, pruebe pines alternativos" +#: shared-bindings/wifi/Radio.c +msgid "Hostname must be between 1 and 253 characters" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Operación I/O en archivo cerrado" @@ -1048,6 +1052,7 @@ msgstr "Archivo BMP inválido" msgid "Invalid BSSID" msgstr "BSSID inválido" +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "Pin suministrado inválido para DAC" @@ -1259,7 +1264,6 @@ msgid "No CCCD for this Characteristic" msgstr "No hay CCCD para esta característica" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "El chip no tiene DAC" @@ -2797,6 +2801,10 @@ msgstr "formato inválido" msgid "invalid format specifier" msgstr "especificador de formato inválido" +#: shared-bindings/wifi/Radio.c +msgid "invalid hostname" +msgstr "" + #: extmod/modussl_axtls.c msgid "invalid key" msgstr "llave inválida" diff --git a/locale/fil.po b/locale/fil.po index f71a0a757a..ecda65cb21 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-10 23:49-0700\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -959,6 +959,10 @@ msgstr "" msgid "Hardware in use, try alternative pins" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Hostname must be between 1 and 253 characters" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "I/O operasyon sa saradong file" @@ -1040,6 +1044,7 @@ msgstr "Mali ang BMP file" msgid "Invalid BSSID" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" @@ -1251,7 +1256,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Walang DAC sa chip" @@ -2772,6 +2776,10 @@ msgstr "hindi wastong pag-format" msgid "invalid format specifier" msgstr "mali ang format specifier" +#: shared-bindings/wifi/Radio.c +msgid "invalid hostname" +msgstr "" + #: extmod/modussl_axtls.c msgid "invalid key" msgstr "mali ang key" diff --git a/locale/fr.po b/locale/fr.po index 0e7cd1df33..482fd28097 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-10 23:49-0700\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: 2020-10-15 18:17+0000\n" "Last-Translator: Jeff Epler \n" "Language: fr\n" @@ -972,6 +972,10 @@ msgstr "Matériel occupé, essayez d'autres broches" msgid "Hardware in use, try alternative pins" msgstr "Matériel utilisé, essayez d'autres broches" +#: shared-bindings/wifi/Radio.c +msgid "Hostname must be between 1 and 253 characters" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "opération d'E/S sur un fichier fermé" @@ -1053,6 +1057,7 @@ msgstr "Fichier BMP invalide" msgid "Invalid BSSID" msgstr "BSSID Invalide" +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "Broche DAC non valide fournie" @@ -1264,7 +1269,6 @@ msgid "No CCCD for this Characteristic" msgstr "Pas de CCCD pour cette caractéristique" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Pas de DAC sur la puce" @@ -2812,6 +2816,10 @@ msgstr "format invalide" msgid "invalid format specifier" msgstr "spécification de format invalide" +#: shared-bindings/wifi/Radio.c +msgid "invalid hostname" +msgstr "" + #: extmod/modussl_axtls.c msgid "invalid key" msgstr "clé invalide" diff --git a/locale/hi.po b/locale/hi.po index 79b9e5105a..88c795a7ce 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-10 23:49-0700\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -946,6 +946,10 @@ msgstr "" msgid "Hardware in use, try alternative pins" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Hostname must be between 1 and 253 characters" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" @@ -1025,6 +1029,7 @@ msgstr "" msgid "Invalid BSSID" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" @@ -1236,7 +1241,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -2727,6 +2731,10 @@ msgstr "" msgid "invalid format specifier" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "invalid hostname" +msgstr "" + #: extmod/modussl_axtls.c msgid "invalid key" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index ef86aa78ac..1650a5bdbd 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-10 23:49-0700\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -959,6 +959,10 @@ msgstr "" msgid "Hardware in use, try alternative pins" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Hostname must be between 1 and 253 characters" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "operazione I/O su file chiuso" @@ -1040,6 +1044,7 @@ msgstr "File BMP non valido" msgid "Invalid BSSID" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" @@ -1255,7 +1260,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Nessun DAC sul chip" @@ -2773,6 +2777,10 @@ msgstr "formato non valido" msgid "invalid format specifier" msgstr "specificatore di formato non valido" +#: shared-bindings/wifi/Radio.c +msgid "invalid hostname" +msgstr "" + #: extmod/modussl_axtls.c msgid "invalid key" msgstr "chiave non valida" diff --git a/locale/ja.po b/locale/ja.po index 283149eee4..01900d9a8f 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-10 23:49-0700\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: 2020-09-25 18:20+0000\n" "Last-Translator: Taku Fukada \n" "Language-Team: none\n" @@ -959,6 +959,10 @@ msgstr "ハードウェアビジー。代替のピンを試してください" msgid "Hardware in use, try alternative pins" msgstr "ハードウェア使用中。代わりのピンを試してください" +#: shared-bindings/wifi/Radio.c +msgid "Hostname must be between 1 and 253 characters" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "閉じられたファイルへのI/O操作" @@ -1040,6 +1044,7 @@ msgstr "不正なBMPファイル" msgid "Invalid BSSID" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "不正なDACピンが与えられました" @@ -1251,7 +1256,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "チップにDACがありません" @@ -2757,6 +2761,10 @@ msgstr "" msgid "invalid format specifier" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "invalid hostname" +msgstr "" + #: extmod/modussl_axtls.c msgid "invalid key" msgstr "不正な鍵" diff --git a/locale/ko.po b/locale/ko.po index 48ecb77372..a9bc60f781 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-10 23:49-0700\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: 2020-10-05 12:12+0000\n" "Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" @@ -951,6 +951,10 @@ msgstr "" msgid "Hardware in use, try alternative pins" msgstr "" +#: shared-bindings/wifi/Radio.c +msgid "Hostname must be between 1 and 253 characters" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" @@ -1030,6 +1034,7 @@ msgstr "" msgid "Invalid BSSID" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" @@ -1241,7 +1246,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -2733,6 +2737,10 @@ msgstr "형식가 유효하지 않습니다" msgid "invalid format specifier" msgstr "형식 지정자(format specifier)가 유효하지 않습니다" +#: shared-bindings/wifi/Radio.c +msgid "invalid hostname" +msgstr "" + #: extmod/modussl_axtls.c msgid "invalid key" msgstr "키가 유효하지 않습니다" diff --git a/locale/nl.po b/locale/nl.po index c979b5dce6..edcaefb832 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-10 23:49-0700\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: 2020-09-09 16:05+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -961,6 +961,10 @@ msgstr "Hardware bezig, probeer alternatieve pinnen" msgid "Hardware in use, try alternative pins" msgstr "Hardware in gebruik, probeer alternatieve pinnen" +#: shared-bindings/wifi/Radio.c +msgid "Hostname must be between 1 and 253 characters" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "I/O actie op gesloten bestand" @@ -1042,6 +1046,7 @@ msgstr "Ongeldig BMP bestand" msgid "Invalid BSSID" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "Ongeldige DAC pin opgegeven" @@ -1253,7 +1258,6 @@ msgid "No CCCD for this Characteristic" msgstr "Geen CCCD voor deze Characteristic" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Geen DAC op de chip" @@ -2784,6 +2788,10 @@ msgstr "ongeldig formaat" msgid "invalid format specifier" msgstr "ongeldige formaatspecificatie" +#: shared-bindings/wifi/Radio.c +msgid "invalid hostname" +msgstr "" + #: extmod/modussl_axtls.c msgid "invalid key" msgstr "ongeldige sleutel" diff --git a/locale/pl.po b/locale/pl.po index 50d519f6aa..b79fcc606b 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-10 23:49-0700\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: 2020-09-29 01:39+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -959,6 +959,10 @@ msgstr "Sprzęt zajęty, wypróbuj alternatywne piny" msgid "Hardware in use, try alternative pins" msgstr "Sprzęt w użyciu, wypróbuj alternatywne piny" +#: shared-bindings/wifi/Radio.c +msgid "Hostname must be between 1 and 253 characters" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Operacja I/O na zamkniętym pliku" @@ -1040,6 +1044,7 @@ msgstr "Zły BMP" msgid "Invalid BSSID" msgstr "" +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" @@ -1252,7 +1257,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Brak DAC" @@ -2750,6 +2754,10 @@ msgstr "zły format" msgid "invalid format specifier" msgstr "zła specyfikacja formatu" +#: shared-bindings/wifi/Radio.c +msgid "invalid hostname" +msgstr "" + #: extmod/modussl_axtls.c msgid "invalid key" msgstr "zły klucz" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index a8e1633898..a402cb07aa 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-10 23:49-0700\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: 2020-10-13 17:11+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -970,6 +970,10 @@ msgstr "O hardware está ocupado, tente os pinos alternativos" msgid "Hardware in use, try alternative pins" msgstr "O hardware está em uso, tente os pinos alternativos" +#: shared-bindings/wifi/Radio.c +msgid "Hostname must be between 1 and 253 characters" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Operação I/O no arquivo fechado" @@ -1051,6 +1055,7 @@ msgstr "Arquivo BMP inválido" msgid "Invalid BSSID" msgstr "BSSID Inválido" +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "O pino DAC informado é inválido" @@ -1262,7 +1267,6 @@ msgid "No CCCD for this Characteristic" msgstr "Não há nenhum CCCD para esta característica" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Nenhum DAC no chip" @@ -2808,6 +2812,10 @@ msgstr "formato inválido" msgid "invalid format specifier" msgstr "o especificador do formato é inválido" +#: shared-bindings/wifi/Radio.c +msgid "invalid hostname" +msgstr "" + #: extmod/modussl_axtls.c msgid "invalid key" msgstr "chave inválida" diff --git a/locale/sv.po b/locale/sv.po index 11e15e79e6..f3bf71558a 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-10 23:49-0700\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: 2020-10-14 18:12+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -959,6 +959,10 @@ msgstr "Hårdvaran är upptagen, prova alternativa pinnar" msgid "Hardware in use, try alternative pins" msgstr "Hårdvaran används redan, prova alternativa pinnar" +#: shared-bindings/wifi/Radio.c +msgid "Hostname must be between 1 and 253 characters" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "I/O-operation på stängd fil" @@ -1040,6 +1044,7 @@ msgstr "Ogiltig BMP-fil" msgid "Invalid BSSID" msgstr "Ogiltig BSSID" +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "Ogiltig DAC-pinne angiven" @@ -1252,7 +1257,6 @@ msgid "No CCCD for this Characteristic" msgstr "Ingen CCCD för denna karaktäristik" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Ingen DAC på chipet" @@ -2781,6 +2785,10 @@ msgstr "ogiltigt format" msgid "invalid format specifier" msgstr "ogiltig formatspecificerare" +#: shared-bindings/wifi/Radio.c +msgid "invalid hostname" +msgstr "" + #: extmod/modussl_axtls.c msgid "invalid key" msgstr "ogiltig nyckel" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index b9adc10dfe..bf7b3c636a 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-10 23:49-0700\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: 2020-10-13 17:11+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -957,6 +957,10 @@ msgstr "Yìngjiàn máng, qǐng chángshì qítā zhēnjiǎo" msgid "Hardware in use, try alternative pins" msgstr "Shǐyòng de yìngjiàn, qǐng chángshì qítā yǐn jiǎo" +#: shared-bindings/wifi/Radio.c +msgid "Hostname must be between 1 and 253 characters" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Wénjiàn shàng de I/ O cāozuò" @@ -1038,6 +1042,7 @@ msgstr "Wúxiào de BMP wénjiàn" msgid "Invalid BSSID" msgstr "Wúxiào de BSSID" +#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "Tí gōng liǎo wúxiào de DAC yǐn jiǎo" @@ -1249,7 +1254,6 @@ msgid "No CCCD for this Characteristic" msgstr "Zhège tèzhēng méiyǒu CCCD" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Méiyǒu DAC zài xīnpiàn shàng de" @@ -2773,6 +2777,10 @@ msgstr "wúxiào géshì" msgid "invalid format specifier" msgstr "wúxiào de géshì biāozhù" +#: shared-bindings/wifi/Radio.c +msgid "invalid hostname" +msgstr "" + #: extmod/modussl_axtls.c msgid "invalid key" msgstr "wúxiào de mì yào" From f51e75c1d216de5ce0c4cdb985756d9cf2b73f4c Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 15 Oct 2020 15:24:24 -0400 Subject: [PATCH 1156/1293] cxd56 needed more precise include for __packed; needed SRC_C += on some ports --- devices/ble_hci/common-hal/_bleio/Adapter.c | 1 - .../common-hal/_bleio/hci_include/att_internal.h | 2 +- devices/ble_hci/common-hal/_bleio/hci_include/hci.h | 4 +++- mpy-cross/mpy-cross.mk | 2 +- .../atmel-samd/boards/kicksat-sprite/mpconfigboard.mk | 10 +++++----- ports/cxd56/Makefile | 2 +- ports/mimxrt10xx/Makefile | 2 +- ports/unix/Makefile | 2 +- 8 files changed, 13 insertions(+), 12 deletions(-) diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index 559b586de3..753a886486 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -45,7 +45,6 @@ #include "shared-bindings/_bleio/Address.h" #include "shared-bindings/_bleio/Characteristic.h" #include "shared-bindings/_bleio/Service.h" -#include "shared-bindings/nvm/ByteArray.h" #include "shared-bindings/_bleio/Connection.h" #include "shared-bindings/_bleio/ScanEntry.h" #include "shared-bindings/time/__init__.h" diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/att_internal.h b/devices/ble_hci/common-hal/_bleio/hci_include/att_internal.h index 1c75275daa..d6a4cb79c7 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_include/att_internal.h +++ b/devices/ble_hci/common-hal/_bleio/hci_include/att_internal.h @@ -11,7 +11,7 @@ #include // for __packed -#include +#include #define BT_EATT_PSM 0x27 #define BT_ATT_DEFAULT_LE_MTU 23 diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/hci.h b/devices/ble_hci/common-hal/_bleio/hci_include/hci.h index 6c3a2b5bd0..b6c5ee34bb 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_include/hci.h +++ b/devices/ble_hci/common-hal/_bleio/hci_include/hci.h @@ -12,7 +12,9 @@ #define ZEPHYR_INCLUDE_BLUETOOTH_HCI_H_ #include -#include +// for __packed +#include + #include "addr.h" #define BIT(n) (1UL << (n)) diff --git a/mpy-cross/mpy-cross.mk b/mpy-cross/mpy-cross.mk index b4c8e34a2e..629054af9e 100644 --- a/mpy-cross/mpy-cross.mk +++ b/mpy-cross/mpy-cross.mk @@ -66,7 +66,7 @@ LDFLAGS += -static -static-libgcc -static-libstdc++ endif # source files -SRC_C = \ +SRC_C += \ main.c \ gccollect.c \ supervisor/stub/safe_mode.c \ diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index 18cef738e8..2492651516 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -11,12 +11,12 @@ LONGINT_IMPL = MPZ # Not needed. CIRCUITPY_AUDIOBUSIO = 0 -CIRCUITPY_FRAMEBUFFERIO = 0 -CIRCUITPY_DISPLAYIO = 0 -CIRCUITPY_RGBMATRIX = 0 -CIRCUITPY_PS2IO = 0 CIRCUITPY_AUDIOMP3 = 0 - +CIRCUITPY_BLEIO_HCI = 0 +CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_FRAMEBUFFERIO = 0 +CIRCUITPY_PS2IO = 0 +CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_ULAB = 0 # Override optimization to keep binary small diff --git a/ports/cxd56/Makefile b/ports/cxd56/Makefile index 7e145f5e2d..5201f0db56 100644 --- a/ports/cxd56/Makefile +++ b/ports/cxd56/Makefile @@ -162,7 +162,7 @@ SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) SRC_S = supervisor/cpu.s -SRC_C = \ +SRC_C += \ background.c \ fatfs_port.c \ mphalport.c \ diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 12c9bde4f5..a17e5f7030 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -147,7 +147,7 @@ SRC_SDK := \ SRC_SDK := $(addprefix sdk/devices/$(CHIP_FAMILY)/, $(SRC_SDK)) -SRC_C = \ +SRC_C += \ background.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/flash_config.c \ diff --git a/ports/unix/Makefile b/ports/unix/Makefile index 5d4b168fe9..4bfb13c6a2 100644 --- a/ports/unix/Makefile +++ b/ports/unix/Makefile @@ -134,7 +134,7 @@ SRC_MOD += modjni.c endif # source files -SRC_C = \ +SRC_C += \ main.c \ gccollect.c \ unix_mphal.c \ From 45a3bd1c042dd27eacf78cdcf116f97a7839eee0 Mon Sep 17 00:00:00 2001 From: Seon Rozenblum Date: Wed, 14 Oct 2020 19:18:38 +1100 Subject: [PATCH 1157/1293] Added default LWIP hostnames to FeatherS2 boards --- ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig | 5 +++++ .../boards/unexpectedmaker_feathers2_prerelease/sdkconfig | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig b/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig index 67ac6d2f37..c9d44460c5 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig @@ -32,3 +32,8 @@ CONFIG_SPIRAM_MEMTEST=y # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set # end of SPI RAM config +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="UMFeatherS2" +# end of LWIP diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/sdkconfig b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/sdkconfig index b73c4a8c20..00e0bb2566 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/sdkconfig +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/sdkconfig @@ -33,3 +33,9 @@ CONFIG_SPIRAM_USE_MEMMAP=y CONFIG_SPIRAM_MEMTEST=y # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set # end of SPI RAM config + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="UMFeatherS2" +# end of LWIP From 88d07ef35b686ffd66487de81564396aac0818b8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 13 Oct 2020 16:57:09 -0500 Subject: [PATCH 1158/1293] displayio: further ensure just one start_terminal call @cwalther determined that for boards with 2 displays (monster m4sk), start_terminal would be called for each one, leaking supervisor heap entries. Determine, by comparing addresses, whether the display being acted on is the first display (number zero) and do (or do not) call start_terminal. stop_terminal can safely be called multiple times, so there's no need to guard against calling it more than once. Slight behavioral change: The terminal size would follow the displays[0] size, not the displays[1] size --- shared-module/displayio/Display.c | 6 ++++-- shared-module/displayio/display_core.c | 5 ++++- shared-module/framebufferio/FramebufferDisplay.c | 6 ++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 499c00ffbb..7c8c9280b5 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -347,8 +347,10 @@ void common_hal_displayio_display_set_rotation(displayio_display_obj_t* self, in self->core.height = tmp; } displayio_display_core_set_rotation(&self->core, rotation); - supervisor_stop_terminal(); - supervisor_start_terminal(self->core.width, self->core.height); + if (self == &displays[0].display) { + supervisor_stop_terminal(); + supervisor_start_terminal(self->core.width, self->core.height); + } if (self->core.current_group != NULL) { displayio_group_update_transform(self->core.current_group, &self->core.transform); } diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index 60a8ef2133..411f9f3736 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -85,7 +85,10 @@ void displayio_display_core_construct(displayio_display_core_t* self, self->bus = bus; - supervisor_start_terminal(width, height); + // (offsetof core is equal in all display types) + if (self == &displays[0].display.core) { + supervisor_start_terminal(width, height); + } self->width = width; self->height = height; diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 6b506c7faf..03e121c914 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -280,8 +280,10 @@ void common_hal_framebufferio_framebufferdisplay_set_rotation(framebufferio_fram self->core.height = tmp; } displayio_display_core_set_rotation(&self->core, rotation); - supervisor_stop_terminal(); - supervisor_start_terminal(self->core.width, self->core.height); + if (self == &displays[0].framebuffer_display) { + supervisor_stop_terminal(); + supervisor_start_terminal(self->core.width, self->core.height); + } if (self->core.current_group != NULL) { displayio_group_update_transform(self->core.current_group, &self->core.transform); } From 1d05ad6b22bedc52c5a1b9e44e806aa09fafd16c Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 15 Oct 2020 16:34:19 -0400 Subject: [PATCH 1159/1293] no _bleio for litex; ESP32S2 defines BIT() already --- devices/ble_hci/common-hal/_bleio/hci_include/hci.h | 3 +++ ports/litex/mpconfigport.mk | 1 + 2 files changed, 4 insertions(+) diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/hci.h b/devices/ble_hci/common-hal/_bleio/hci_include/hci.h index b6c5ee34bb..5213edbf0f 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_include/hci.h +++ b/devices/ble_hci/common-hal/_bleio/hci_include/hci.h @@ -17,7 +17,10 @@ #include "addr.h" +// ESP32S2 build environment defines this already. +#ifndef BIT #define BIT(n) (1UL << (n)) +#endif /* Special own address types for LL privacy (used in adv & scan parameters) */ #define BT_HCI_OWN_ADDR_RPA_OR_PUBLIC 0x02 diff --git a/ports/litex/mpconfigport.mk b/ports/litex/mpconfigport.mk index 427e9ea841..485a75fde0 100644 --- a/ports/litex/mpconfigport.mk +++ b/ports/litex/mpconfigport.mk @@ -16,6 +16,7 @@ CIRCUITPY_ANALOGIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_BOARD = 0 CIRCUITPY_BUSIO = 0 CIRCUITPY_COUNTIO = 0 From 12ed3fc72f6eb81fd193258e757efdcf633c4c1d Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 15 Oct 2020 18:48:28 -0400 Subject: [PATCH 1160/1293] disable on winterbloom_sol and thunderpack --- ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk | 2 +- ports/stm/boards/thunderpack/mpconfigboard.mk | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk index 9217cdf23d..fcefaee9b8 100644 --- a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk @@ -18,7 +18,7 @@ LONGINT_IMPL = MPZ # Disable modules that are unusable on this special-purpose board. CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 -CIRCUITPY_BLEIO = 0 +CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_GAMEPAD = 0 diff --git a/ports/stm/boards/thunderpack/mpconfigboard.mk b/ports/stm/boards/thunderpack/mpconfigboard.mk index bb50f87108..d303582e0e 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack/mpconfigboard.mk @@ -7,6 +7,7 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_NVM = 1 +CIRCUITPY_BLEIO_HCI = 0 MCU_SERIES = F4 MCU_VARIANT = STM32F411xE From fa75231ae321ea95007804ac01a39dcbd09ecd75 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Thu, 15 Oct 2020 18:46:42 -0500 Subject: [PATCH 1161/1293] Added max size check to recv_into --- shared-bindings/socketpool/Socket.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index de05b8eb4b..f4a1e636af 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -260,6 +260,9 @@ STATIC mp_obj_t socketpool_socket_recv_into(size_t n_args, const mp_obj_t *args) mp_int_t len = bufinfo.len; if (n_args == 3) { mp_int_t given_len = mp_obj_get_int(args[2]); + if (given_len > len) { + mp_raise_ValueError(translate("buffer too small for requested bytes")); + } if (given_len > 0 && given_len < len) { len = given_len; } From b336039aab03bd9f609bad0c211981961b6685d2 Mon Sep 17 00:00:00 2001 From: "Ryan T. Hamilton" Date: Thu, 15 Oct 2020 23:18:30 -0700 Subject: [PATCH 1162/1293] Disable the long way and return an ap_info object still needs work and cleanup --- ports/esp32s2/common-hal/wifi/Radio.c | 83 +++++++++++++++++---------- ports/esp32s2/common-hal/wifi/Radio.h | 2 + shared-bindings/wifi/Radio.c | 73 ++++++++++++++--------- shared-bindings/wifi/Radio.h | 5 +- 4 files changed, 104 insertions(+), 59 deletions(-) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index 13bcccc809..b1f9e67e05 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -25,6 +25,7 @@ */ #include "shared-bindings/wifi/Radio.h" +#include "shared-bindings/wifi/Network.h" #include @@ -149,6 +150,30 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t return WIFI_RADIO_ERROR_NONE; } +mp_obj_t common_hal_wifi_radio_get_ap_info(wifi_radio_obj_t *self) { + if (!esp_netif_is_netif_up(self->netif)) { + return mp_const_none; + } + + // Make sure the interface is in STA mode + if (self->sta_mode){ + return mp_const_none; + } + + wifi_network_obj_t *apnet = m_new_obj(wifi_network_obj_t); + apnet->base.type = &wifi_network_type; + // From esp_wifi.h, the possible return values (typos theirs): + // ESP_OK: succeed + // ESP_ERR_WIFI_CONN: The station interface don't initialized + // ESP_ERR_WIFI_NOT_CONNECT: The station is in disconnect status + if (esp_wifi_sta_get_ap_info(&self->apnet.record) != ESP_OK){ + return mp_const_none; + } else { + memcpy(&apnet->record, &self->apnet.record, sizeof(wifi_ap_record_t)); + return MP_OBJ_FROM_PTR(apnet); + } +} + mp_obj_t common_hal_wifi_radio_get_ap_rssi(wifi_radio_obj_t *self) { if (!esp_netif_is_netif_up(self->netif)) { return mp_const_none; @@ -170,40 +195,40 @@ mp_obj_t common_hal_wifi_radio_get_ap_rssi(wifi_radio_obj_t *self) { } } -mp_obj_t common_hal_wifi_radio_get_ap_ssid(wifi_radio_obj_t *self) { - if (!esp_netif_is_netif_up(self->netif)) { - return mp_const_none; - } +// mp_obj_t common_hal_wifi_radio_get_ap_ssid(wifi_radio_obj_t *self) { +// if (!esp_netif_is_netif_up(self->netif)) { +// return mp_const_none; +// } - // Make sure the interface is in STA mode - if (self->sta_mode){ - return mp_const_none; - } +// // Make sure the interface is in STA mode +// if (self->sta_mode){ +// return mp_const_none; +// } - if (esp_wifi_sta_get_ap_info(&self->ap_info) != ESP_OK){ - return mp_const_none; - } else { - const char* cstr = (const char*) self->ap_info.ssid; - return mp_obj_new_str(cstr, strlen(cstr)); - } -} +// if (esp_wifi_sta_get_ap_info(&self->ap_info) != ESP_OK){ +// return mp_const_none; +// } else { +// const char* cstr = (const char*) self->ap_info.ssid; +// return mp_obj_new_str(cstr, strlen(cstr)); +// } +// } -mp_obj_t common_hal_wifi_radio_get_ap_bssid(wifi_radio_obj_t *self) { - if (!esp_netif_is_netif_up(self->netif)) { - return mp_const_none; - } +// mp_obj_t common_hal_wifi_radio_get_ap_bssid(wifi_radio_obj_t *self) { +// if (!esp_netif_is_netif_up(self->netif)) { +// return mp_const_none; +// } - // Make sure the interface is in STA mode - if (self->sta_mode){ - return mp_const_none; - } +// // Make sure the interface is in STA mode +// if (self->sta_mode){ +// return mp_const_none; +// } - if (esp_wifi_sta_get_ap_info(&self->ap_info) != ESP_OK){ - return mp_const_none; - } else { - return mp_obj_new_bytes(self->ap_info.bssid, MAC_ADDRESS_LENGTH); - } -} +// if (esp_wifi_sta_get_ap_info(&self->ap_info) != ESP_OK){ +// return mp_const_none; +// } else { +// return mp_obj_new_bytes(self->ap_info.bssid, MAC_ADDRESS_LENGTH); +// } +// } mp_obj_t common_hal_wifi_radio_get_ipv4_gateway(wifi_radio_obj_t *self) { if (!esp_netif_is_netif_up(self->netif)) { diff --git a/ports/esp32s2/common-hal/wifi/Radio.h b/ports/esp32s2/common-hal/wifi/Radio.h index 272c3a62e9..f441096f7d 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.h +++ b/ports/esp32s2/common-hal/wifi/Radio.h @@ -32,6 +32,7 @@ #include "components/esp_event/include/esp_event.h" #include "shared-bindings/wifi/ScannedNetworks.h" +#include "shared-bindings/wifi/Network.h" // Event bits for the Radio event group. #define WIFI_SCAN_DONE_BIT BIT0 @@ -47,6 +48,7 @@ typedef struct { EventGroupHandle_t event_group_handle; wifi_config_t sta_config; wifi_ap_record_t ap_info; + wifi_network_obj_t apnet; esp_netif_ip_info_t ip_info; esp_netif_dns_info_t dns_info; esp_netif_t *netif; diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 96abadf6ff..d755327694 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -179,37 +179,37 @@ const mp_obj_property_t wifi_radio_ap_rssi_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| ap_ssid: int -//| """SSID of the currently connected AP. Returns none if not connected""" -//| -STATIC mp_obj_t wifi_radio_get_ap_ssid(mp_obj_t self) { - return common_hal_wifi_radio_get_ap_ssid(self); +// //| ap_ssid: int +// //| """SSID of the currently connected AP. Returns none if not connected""" +// //| +// STATIC mp_obj_t wifi_radio_get_ap_ssid(mp_obj_t self) { +// return common_hal_wifi_radio_get_ap_ssid(self); -} -MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ap_ssid_obj, wifi_radio_get_ap_ssid); +// } +// MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ap_ssid_obj, wifi_radio_get_ap_ssid); -const mp_obj_property_t wifi_radio_ap_ssid_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_radio_get_ap_ssid_obj, - (mp_obj_t)&mp_const_none_obj, - (mp_obj_t)&mp_const_none_obj }, -}; +// const mp_obj_property_t wifi_radio_ap_ssid_obj = { +// .base.type = &mp_type_property, +// .proxy = { (mp_obj_t)&wifi_radio_get_ap_ssid_obj, +// (mp_obj_t)&mp_const_none_obj, +// (mp_obj_t)&mp_const_none_obj }, +// }; -//| ap_bssid: int -//| """BSSID (usually MAC) of the currently connected AP. Returns none if not connected""" -//| -STATIC mp_obj_t wifi_radio_get_ap_bssid(mp_obj_t self) { - return common_hal_wifi_radio_get_ap_bssid(self); +// //| ap_bssid: int +// //| """BSSID (usually MAC) of the currently connected AP. Returns none if not connected""" +// //| +// STATIC mp_obj_t wifi_radio_get_ap_bssid(mp_obj_t self) { +// return common_hal_wifi_radio_get_ap_bssid(self); -} -MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ap_bssid_obj, wifi_radio_get_ap_bssid); +// } +// MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ap_bssid_obj, wifi_radio_get_ap_bssid); -const mp_obj_property_t wifi_radio_ap_bssid_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_radio_get_ap_bssid_obj, - (mp_obj_t)&mp_const_none_obj, - (mp_obj_t)&mp_const_none_obj }, -}; +// const mp_obj_property_t wifi_radio_ap_bssid_obj = { +// .base.type = &mp_type_property, +// .proxy = { (mp_obj_t)&wifi_radio_get_ap_bssid_obj, +// (mp_obj_t)&mp_const_none_obj, +// (mp_obj_t)&mp_const_none_obj }, +// }; //| ipv4_gateway: Optional[ipaddress.IPv4Address] //| """IP v4 Address of the gateway when connected to an access point. None otherwise.""" @@ -275,6 +275,22 @@ const mp_obj_property_t wifi_radio_ipv4_dns_obj = { (mp_obj_t)&mp_const_none_obj }, }; +//| ap_info: Optional[Network] +//| """None otherwise.""" +//| +STATIC mp_obj_t wifi_radio_get_ap_info(mp_obj_t self) { + return common_hal_wifi_radio_get_ap_info(self); + +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ap_info_obj, wifi_radio_get_ap_info); + +const mp_obj_property_t wifi_radio_ap_info_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&wifi_radio_get_ap_info_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + //| def ping(self, ip, *, timeout: float = 0.5) -> float: //| """Ping an IP to test connectivity. Returns echo time in seconds. //| Returns None when it times out.""" @@ -315,9 +331,10 @@ STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&wifi_radio_connect_obj) }, // { MP_ROM_QSTR(MP_QSTR_connect_to_enterprise), MP_ROM_PTR(&wifi_radio_connect_to_enterprise_obj) }, + { MP_ROM_QSTR(MP_QSTR_ap_info), MP_ROM_PTR(&wifi_radio_ap_info_obj) }, { MP_ROM_QSTR(MP_QSTR_ap_rssi), MP_ROM_PTR(&wifi_radio_ap_rssi_obj) }, - { MP_ROM_QSTR(MP_QSTR_ap_ssid), MP_ROM_PTR(&wifi_radio_ap_ssid_obj) }, - { MP_ROM_QSTR(MP_QSTR_ap_bssid), MP_ROM_PTR(&wifi_radio_ap_bssid_obj) }, + // { MP_ROM_QSTR(MP_QSTR_ap_ssid), MP_ROM_PTR(&wifi_radio_ap_ssid_obj) }, + // { MP_ROM_QSTR(MP_QSTR_ap_bssid), MP_ROM_PTR(&wifi_radio_ap_bssid_obj) }, { MP_ROM_QSTR(MP_QSTR_ipv4_dns), MP_ROM_PTR(&wifi_radio_ipv4_dns_obj) }, { MP_ROM_QSTR(MP_QSTR_ipv4_gateway), MP_ROM_PTR(&wifi_radio_ipv4_gateway_obj) }, { MP_ROM_QSTR(MP_QSTR_ipv4_subnet), MP_ROM_PTR(&wifi_radio_ipv4_subnet_obj) }, diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index bf30ac3405..6dca40c56b 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -53,9 +53,10 @@ extern void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) extern 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); +extern mp_obj_t common_hal_wifi_radio_get_ap_info(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ap_rssi(wifi_radio_obj_t *self); -extern mp_obj_t common_hal_wifi_radio_get_ap_ssid(wifi_radio_obj_t *self); -extern mp_obj_t common_hal_wifi_radio_get_ap_bssid(wifi_radio_obj_t *self); +// extern mp_obj_t common_hal_wifi_radio_get_ap_ssid(wifi_radio_obj_t *self); +// extern mp_obj_t common_hal_wifi_radio_get_ap_bssid(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_dns(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_gateway(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_subnet(wifi_radio_obj_t *self); From 9d840aab0b81db61e185eeac5d8359489ff36320 Mon Sep 17 00:00:00 2001 From: "Ryan T. Hamilton" Date: Thu, 15 Oct 2020 23:45:11 -0700 Subject: [PATCH 1163/1293] Cleaned up and now testing --- ports/esp32s2/common-hal/wifi/Radio.c | 66 ++------------------------- ports/esp32s2/common-hal/wifi/Radio.h | 3 +- shared-bindings/wifi/Radio.c | 53 +-------------------- shared-bindings/wifi/Radio.h | 3 -- 4 files changed, 7 insertions(+), 118 deletions(-) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index b1f9e67e05..6203a151bd 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -160,76 +160,20 @@ mp_obj_t common_hal_wifi_radio_get_ap_info(wifi_radio_obj_t *self) { return mp_const_none; } - wifi_network_obj_t *apnet = m_new_obj(wifi_network_obj_t); - apnet->base.type = &wifi_network_type; + wifi_network_obj_t *ap_info = m_new_obj(wifi_network_obj_t); + ap_info->base.type = &wifi_network_type; // From esp_wifi.h, the possible return values (typos theirs): // ESP_OK: succeed // ESP_ERR_WIFI_CONN: The station interface don't initialized // ESP_ERR_WIFI_NOT_CONNECT: The station is in disconnect status - if (esp_wifi_sta_get_ap_info(&self->apnet.record) != ESP_OK){ + if (esp_wifi_sta_get_ap_info(&self->ap_info.record) != ESP_OK){ return mp_const_none; } else { - memcpy(&apnet->record, &self->apnet.record, sizeof(wifi_ap_record_t)); - return MP_OBJ_FROM_PTR(apnet); + memcpy(&ap_info->record, &self->ap_info.record, sizeof(wifi_ap_record_t)); + return MP_OBJ_FROM_PTR(ap_info); } } -mp_obj_t common_hal_wifi_radio_get_ap_rssi(wifi_radio_obj_t *self) { - if (!esp_netif_is_netif_up(self->netif)) { - return mp_const_none; - } - - // Make sure the interface is in STA mode - if (self->sta_mode){ - return mp_const_none; - } - - // From esp_wifi.h, the possible return values (typos theirs): - // ESP_OK: succeed - // ESP_ERR_WIFI_CONN: The station interface don't initialized - // ESP_ERR_WIFI_NOT_CONNECT: The station is in disconnect status - if (esp_wifi_sta_get_ap_info(&self->ap_info) != ESP_OK){ - return mp_const_none; - } else { - return mp_obj_new_int(self->ap_info.rssi); - } -} - -// mp_obj_t common_hal_wifi_radio_get_ap_ssid(wifi_radio_obj_t *self) { -// if (!esp_netif_is_netif_up(self->netif)) { -// return mp_const_none; -// } - -// // Make sure the interface is in STA mode -// if (self->sta_mode){ -// return mp_const_none; -// } - -// if (esp_wifi_sta_get_ap_info(&self->ap_info) != ESP_OK){ -// return mp_const_none; -// } else { -// const char* cstr = (const char*) self->ap_info.ssid; -// return mp_obj_new_str(cstr, strlen(cstr)); -// } -// } - -// mp_obj_t common_hal_wifi_radio_get_ap_bssid(wifi_radio_obj_t *self) { -// if (!esp_netif_is_netif_up(self->netif)) { -// return mp_const_none; -// } - -// // Make sure the interface is in STA mode -// if (self->sta_mode){ -// return mp_const_none; -// } - -// if (esp_wifi_sta_get_ap_info(&self->ap_info) != ESP_OK){ -// return mp_const_none; -// } else { -// return mp_obj_new_bytes(self->ap_info.bssid, MAC_ADDRESS_LENGTH); -// } -// } - mp_obj_t common_hal_wifi_radio_get_ipv4_gateway(wifi_radio_obj_t *self) { if (!esp_netif_is_netif_up(self->netif)) { return mp_const_none; diff --git a/ports/esp32s2/common-hal/wifi/Radio.h b/ports/esp32s2/common-hal/wifi/Radio.h index f441096f7d..c7f484eafd 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.h +++ b/ports/esp32s2/common-hal/wifi/Radio.h @@ -47,8 +47,7 @@ typedef struct { StaticEventGroup_t event_group; EventGroupHandle_t event_group_handle; wifi_config_t sta_config; - wifi_ap_record_t ap_info; - wifi_network_obj_t apnet; + wifi_network_obj_t ap_info; esp_netif_ip_info_t ip_info; esp_netif_dns_info_t dns_info; esp_netif_t *netif; diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index d755327694..4503310095 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -163,54 +163,6 @@ STATIC mp_obj_t wifi_radio_connect(size_t n_args, const mp_obj_t *pos_args, mp_m } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wifi_radio_connect_obj, 1, wifi_radio_connect); -//| ap_rssi: int -//| """RSSI of the currently connected AP. Returns none if not connected""" -//| -STATIC mp_obj_t wifi_radio_get_ap_rssi(mp_obj_t self) { - return common_hal_wifi_radio_get_ap_rssi(self); - -} -MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ap_rssi_obj, wifi_radio_get_ap_rssi); - -const mp_obj_property_t wifi_radio_ap_rssi_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_radio_get_ap_rssi_obj, - (mp_obj_t)&mp_const_none_obj, - (mp_obj_t)&mp_const_none_obj }, -}; - -// //| ap_ssid: int -// //| """SSID of the currently connected AP. Returns none if not connected""" -// //| -// STATIC mp_obj_t wifi_radio_get_ap_ssid(mp_obj_t self) { -// return common_hal_wifi_radio_get_ap_ssid(self); - -// } -// MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ap_ssid_obj, wifi_radio_get_ap_ssid); - -// const mp_obj_property_t wifi_radio_ap_ssid_obj = { -// .base.type = &mp_type_property, -// .proxy = { (mp_obj_t)&wifi_radio_get_ap_ssid_obj, -// (mp_obj_t)&mp_const_none_obj, -// (mp_obj_t)&mp_const_none_obj }, -// }; - -// //| ap_bssid: int -// //| """BSSID (usually MAC) of the currently connected AP. Returns none if not connected""" -// //| -// STATIC mp_obj_t wifi_radio_get_ap_bssid(mp_obj_t self) { -// return common_hal_wifi_radio_get_ap_bssid(self); - -// } -// MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ap_bssid_obj, wifi_radio_get_ap_bssid); - -// const mp_obj_property_t wifi_radio_ap_bssid_obj = { -// .base.type = &mp_type_property, -// .proxy = { (mp_obj_t)&wifi_radio_get_ap_bssid_obj, -// (mp_obj_t)&mp_const_none_obj, -// (mp_obj_t)&mp_const_none_obj }, -// }; - //| ipv4_gateway: Optional[ipaddress.IPv4Address] //| """IP v4 Address of the gateway when connected to an access point. None otherwise.""" //| @@ -276,7 +228,7 @@ const mp_obj_property_t wifi_radio_ipv4_dns_obj = { }; //| ap_info: Optional[Network] -//| """None otherwise.""" +//| """Network object containing BSSID, SSID, channel, and RSSI when connected to an access point. None otherwise.""" //| STATIC mp_obj_t wifi_radio_get_ap_info(mp_obj_t self) { return common_hal_wifi_radio_get_ap_info(self); @@ -332,9 +284,6 @@ STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = { // { MP_ROM_QSTR(MP_QSTR_connect_to_enterprise), MP_ROM_PTR(&wifi_radio_connect_to_enterprise_obj) }, { MP_ROM_QSTR(MP_QSTR_ap_info), MP_ROM_PTR(&wifi_radio_ap_info_obj) }, - { MP_ROM_QSTR(MP_QSTR_ap_rssi), MP_ROM_PTR(&wifi_radio_ap_rssi_obj) }, - // { MP_ROM_QSTR(MP_QSTR_ap_ssid), MP_ROM_PTR(&wifi_radio_ap_ssid_obj) }, - // { MP_ROM_QSTR(MP_QSTR_ap_bssid), MP_ROM_PTR(&wifi_radio_ap_bssid_obj) }, { MP_ROM_QSTR(MP_QSTR_ipv4_dns), MP_ROM_PTR(&wifi_radio_ipv4_dns_obj) }, { MP_ROM_QSTR(MP_QSTR_ipv4_gateway), MP_ROM_PTR(&wifi_radio_ipv4_gateway_obj) }, { MP_ROM_QSTR(MP_QSTR_ipv4_subnet), MP_ROM_PTR(&wifi_radio_ipv4_subnet_obj) }, diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index 6dca40c56b..38cc933372 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -54,9 +54,6 @@ extern void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self) extern 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); extern mp_obj_t common_hal_wifi_radio_get_ap_info(wifi_radio_obj_t *self); -extern mp_obj_t common_hal_wifi_radio_get_ap_rssi(wifi_radio_obj_t *self); -// extern mp_obj_t common_hal_wifi_radio_get_ap_ssid(wifi_radio_obj_t *self); -// extern mp_obj_t common_hal_wifi_radio_get_ap_bssid(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_dns(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_gateway(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_subnet(wifi_radio_obj_t *self); From 6631c8d393df83db3b9348b18e04c3580811c1bc Mon Sep 17 00:00:00 2001 From: Enrique Casado Date: Fri, 16 Oct 2020 13:52:46 +0200 Subject: [PATCH 1164/1293] Add USB VID&PID --- .../boards/dynossat_edu_eps/mpconfigboard.mk | 8 ++++---- .../boards/dynossat_edu_obc/mpconfigboard.mk | 11 ++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk b/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk index a1005e09da..3c0cc07bea 100644 --- a/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk +++ b/ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk @@ -1,8 +1,8 @@ -USB_VID = 0 -USB_PID = 0 +USB_VID = 0x04D8 +USB_PID = 0xEAD1 -USB_PRODUCT = "DynOSSAT-EDU EPS v1.0" -USB_MANUFACTURER = "Blackhand Dynamics SL" +USB_PRODUCT = "DynOSSAT-EDU-EPS-v1.0" +USB_MANUFACTURER = "BH Dynamics" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 diff --git a/ports/atmel-samd/boards/dynossat_edu_obc/mpconfigboard.mk b/ports/atmel-samd/boards/dynossat_edu_obc/mpconfigboard.mk index d5c626d130..360940cf18 100644 --- a/ports/atmel-samd/boards/dynossat_edu_obc/mpconfigboard.mk +++ b/ports/atmel-samd/boards/dynossat_edu_obc/mpconfigboard.mk @@ -1,14 +1,15 @@ -USB_VID = 0 -USB_PID = 0 -USB_PRODUCT = "DynOSSAT-EDU OBC v1.0" -USB_MANUFACTURER = "Blackhand Dynamics SL" +USB_VID = 0x04D8 +USB_PID = 0xEAD2 + +USB_PRODUCT = "DynOSSAT-EDU-OBC-v1.0" +USB_MANUFACTURER = "BH Dynamics" CHIP_VARIANT = SAMD51J20A CHIP_FAMILY = samd51 SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 -EXTERNAL_FLASH_DEVICES = GD25Q32C +EXTERNAL_FLASH_DEVICES = "GD25Q32C" LONGINT_IMPL = MPZ CFLAGS_INLINE_LIMIT = 60 From fdb5ce477e4d68947ebb7661c9c6f551b5f100e5 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Fri, 16 Oct 2020 01:25:44 +0000 Subject: [PATCH 1165/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (834 of 834 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index a402cb07aa..240a56104e 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: 2020-10-15 16:06+0530\n" -"PO-Revision-Date: 2020-10-13 17:11+0000\n" +"PO-Revision-Date: 2020-10-16 17:01+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.3-dev\n" +"X-Generator: Weblate 4.3.1-dev\n" #: main.c msgid "" @@ -972,7 +972,7 @@ msgstr "O hardware está em uso, tente os pinos alternativos" #: shared-bindings/wifi/Radio.c msgid "Hostname must be between 1 and 253 characters" -msgstr "" +msgstr "O nome do host deve ter entre 1 e 253 caracteres" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -2814,7 +2814,7 @@ msgstr "o especificador do formato é inválido" #: shared-bindings/wifi/Radio.c msgid "invalid hostname" -msgstr "" +msgstr "o nome do host é inválido" #: extmod/modussl_axtls.c msgid "invalid key" From 645382d51d37a40312118eebc11da75639913fce Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Fri, 16 Oct 2020 14:21:00 -0500 Subject: [PATCH 1166/1293] Updated translation --- locale/circuitpython.pot | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index c4951f78f9..035eb105fb 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-09-29 20:14-0500\n" +"POT-Creation-Date: 2020-10-16 13:56-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -285,6 +285,7 @@ msgid "All I2C peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -892,6 +893,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -928,7 +930,8 @@ msgid "Group full" msgstr "" #: 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/sdioio/SDCard.c +#: 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 "" @@ -998,7 +1001,8 @@ msgid "Invalid %q pin" msgstr "" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c +#: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" msgstr "" @@ -2089,6 +2093,10 @@ msgstr "" msgid "buffer too small" msgstr "" +#: shared-bindings/socketpool/Socket.c +msgid "buffer too small for requested bytes" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -3144,6 +3152,7 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h #: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h #: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h #: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -3151,6 +3160,7 @@ msgstr "" #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" From de328c3be97891ecd7cb6a3daff9ce7d7faf7e76 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sat, 17 Oct 2020 02:22:15 +0530 Subject: [PATCH 1167/1293] Update port status in readme --- README.rst | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 347b8b8c6b..99a35d6da1 100644 --- a/README.rst +++ b/README.rst @@ -95,7 +95,7 @@ Differences from `MicroPython `__ CircuitPython: - Supports native USB on all boards, allowing file editing without special tools. -- Supports only SAMD21, SAMD51, nRF52840, CXD56, STM32F4 and i.MX RT ports. +- Support status for ports is different. - Floats (aka decimals) are enabled for all builds. - Error messages are translated into 10+ languages. - Does not support concurrency within Python (including interrupts and threading). Some concurrency @@ -137,8 +137,8 @@ Behavior API ~~~ -- Unified hardware APIs. Documented - `on ReadTheDocs `_. +- Unified hardware APIs. Documented on + `ReadTheDocs `_. - API docs are rST within the C files in ``shared-bindings``. - No ``machine`` API. @@ -201,14 +201,27 @@ Ports Ports include the code unique to a microcontroller line and also variations based on the board. -- ``atmel-samd`` Support for SAMD21 and SAMD51 based boards. -- ``nrf`` Support for the nRF52840 based boards. -- ``unix`` Support for UNIX. Only used for automated testing. +================ ============================================================ +Supported Support status +================ ============================================================ +atmel-samd ``SAMD21`` stable | ``SAMD51`` stable +cxd56 stable +esp32s2 beta +litex alpha +mimxrt10xx alpha +nrf stable +stm ``F4`` stable | ``others`` beta +unix alpha +================ ============================================================ + +- ``stable`` Highly unlikely to have bugs or missing functionality. +- ``beta`` Being actively improved but may be missing functionality and have bugs. +- ``alpha`` Will have bugs and missing functionality. The remaining port directories not listed above are in the repo to maintain compatibility with the `MicroPython `__ parent project. -`back to top <#circuitpython>`__ +`Back to Top <#circuitpython>`__ .. |Build Status| image:: https://github.com/adafruit/circuitpython/workflows/Build%20CI/badge.svg :target: https://github.com/adafruit/circuitpython/actions?query=branch%3Amain From 74c07a4bdcc942e57668f1a2181e00d1213864a7 Mon Sep 17 00:00:00 2001 From: Jensen Date: Fri, 16 Oct 2020 19:48:41 -0500 Subject: [PATCH 1168/1293] displayio: Add in opaque pixel option for future --- locale/circuitpython.pot | 6 +----- shared-bindings/displayio/ColorConverter.c | 8 +++++--- shared-bindings/displayio/ColorConverter.h | 2 +- shared-module/displayio/ColorConverter.c | 4 +++- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index c4b40d3617..35143e04e6 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-14 22:22-0500\n" +"POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3408,10 +3408,6 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "" -#: shared-bindings/displayio/ColorConverter.c -msgid "transparent_color should be an int" -msgstr "" - #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "" diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index 4e41ceff15..e47a961a50 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -125,12 +125,14 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_colorconverter_make_transparent_obj, display //| def make_opaque(self) -> None: //| """Sets a pixel to opaque.""" //| -STATIC mp_obj_t displayio_colorconverter_make_opaque(mp_obj_t self_in) { +STATIC mp_obj_t displayio_colorconverter_make_opaque(mp_obj_t self_in, mp_obj_t transparent_color_obj) { displayio_colorconverter_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_displayio_colorconverter_make_opaque(self); + + mp_int_t transparent_color = mp_obj_get_int(&transparent_color); + common_hal_displayio_colorconverter_make_opaque(self, transparent_color); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_1(displayio_colorconverter_make_opaque_obj, displayio_colorconverter_make_opaque); +MP_DEFINE_CONST_FUN_OBJ_2(displayio_colorconverter_make_opaque_obj, displayio_colorconverter_make_opaque); STATIC const mp_rom_map_elem_t displayio_colorconverter_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_convert), MP_ROM_PTR(&displayio_colorconverter_convert_obj) }, diff --git a/shared-bindings/displayio/ColorConverter.h b/shared-bindings/displayio/ColorConverter.h index e4ddd1972d..441f7c7aee 100644 --- a/shared-bindings/displayio/ColorConverter.h +++ b/shared-bindings/displayio/ColorConverter.h @@ -40,6 +40,6 @@ void common_hal_displayio_colorconverter_set_dither(displayio_colorconverter_t* bool common_hal_displayio_colorconverter_get_dither(displayio_colorconverter_t* self); void common_hal_displayio_colorconverter_make_transparent(displayio_colorconverter_t* self, uint32_t transparent_color); -void common_hal_displayio_colorconverter_make_opaque(displayio_colorconverter_t* self); +void common_hal_displayio_colorconverter_make_opaque(displayio_colorconverter_t* self, uint32_t transparent_color); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_COLORCONVERTER_H diff --git a/shared-module/displayio/ColorConverter.c b/shared-module/displayio/ColorConverter.c index 4089b2265e..d1a4f16a97 100644 --- a/shared-module/displayio/ColorConverter.c +++ b/shared-module/displayio/ColorConverter.c @@ -136,7 +136,9 @@ void common_hal_displayio_colorconverter_make_transparent(displayio_colorconvert self->transparent_color = transparent_color; } -void common_hal_displayio_colorconverter_make_opaque(displayio_colorconverter_t* self) { +void common_hal_displayio_colorconverter_make_opaque(displayio_colorconverter_t* self, uint32_t transparent_color) { + (void) transparent_color; + // 0x1000000 will never equal a valid color self->transparent_color = 0x1000000; } From fc3f2a3f7f670f28d1a57eb61dfbf065463c906a Mon Sep 17 00:00:00 2001 From: Jensen Date: Fri, 16 Oct 2020 20:05:39 -0500 Subject: [PATCH 1169/1293] displayio: Remove trailing whitespace --- shared-module/displayio/ColorConverter.c | 1 - 1 file changed, 1 deletion(-) diff --git a/shared-module/displayio/ColorConverter.c b/shared-module/displayio/ColorConverter.c index d1a4f16a97..dc64da03da 100644 --- a/shared-module/displayio/ColorConverter.c +++ b/shared-module/displayio/ColorConverter.c @@ -138,7 +138,6 @@ void common_hal_displayio_colorconverter_make_transparent(displayio_colorconvert void common_hal_displayio_colorconverter_make_opaque(displayio_colorconverter_t* self, uint32_t transparent_color) { (void) transparent_color; - // 0x1000000 will never equal a valid color self->transparent_color = 0x1000000; } From 1efcb975abe2ce8fc4e2f6e8875da54c86f238e5 Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Fri, 16 Oct 2020 21:08:52 +0000 Subject: [PATCH 1170/1293] Translated using Weblate (Spanish) Currently translated at 100.0% (834 of 834 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/locale/es.po b/locale/es.po index 16254aa5e7..db20dea120 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: 2020-10-15 16:06+0530\n" -"PO-Revision-Date: 2020-10-09 17:19+0000\n" -"Last-Translator: dherrada \n" +"PO-Revision-Date: 2020-10-17 02:31+0000\n" +"Last-Translator: Alvaro Figueroa \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.3-dev\n" +"X-Generator: Weblate 4.3.1-dev\n" #: main.c msgid "" @@ -255,7 +255,7 @@ msgstr "'return' fuera de una función" #: py/compile.c msgid "'yield from' inside async function" -msgstr "" +msgstr "'yield from' dentro función asincrónica" #: py/compile.c msgid "'yield' outside function" @@ -284,7 +284,7 @@ msgstr "El canal EXTINT ya está siendo utilizado" #: ports/esp32s2/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" -msgstr "" +msgstr "ADC2 está siendo usado por WiFi" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format @@ -969,7 +969,7 @@ msgstr "Hardware en uso, pruebe pines alternativos" #: shared-bindings/wifi/Radio.c msgid "Hostname must be between 1 and 253 characters" -msgstr "" +msgstr "Hostname debe ser entre 1 y 253 caracteres" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -2803,7 +2803,7 @@ msgstr "especificador de formato inválido" #: shared-bindings/wifi/Radio.c msgid "invalid hostname" -msgstr "" +msgstr "hostname inválido" #: extmod/modussl_axtls.c msgid "invalid key" @@ -3522,7 +3522,7 @@ msgstr "objeto de tipo '%q' no tiene atributo '%q'" #: py/objgenerator.c msgid "type object 'generator' has no attribute '__await__'" -msgstr "" +msgstr "objeto tipo 'generator' no tiene un atributo '__await__'" #: py/objtype.c msgid "type takes 1 or 3 arguments" From 1e7e5eb1ff43ee57fa2dd5f2def8fcdae7e60683 Mon Sep 17 00:00:00 2001 From: hexthat Date: Fri, 16 Oct 2020 19:10:09 +0000 Subject: [PATCH 1171/1293] Translated using Weblate (Chinese (Pinyin)) Currently translated at 100.0% (834 of 834 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/zh_Latn/ --- locale/zh_Latn_pinyin.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index bf7b3c636a..365b1e498f 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: 2020-10-15 16:06+0530\n" -"PO-Revision-Date: 2020-10-13 17:11+0000\n" +"PO-Revision-Date: 2020-10-17 02:31+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" @@ -15,7 +15,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.3-dev\n" +"X-Generator: Weblate 4.3.1-dev\n" #: main.c msgid "" @@ -959,7 +959,7 @@ msgstr "Shǐyòng de yìngjiàn, qǐng chángshì qítā yǐn jiǎo" #: shared-bindings/wifi/Radio.c msgid "Hostname must be between 1 and 253 characters" -msgstr "" +msgstr "zhǔ jī míng bì xū jiè yú 1 hé 253 gè zì fú zhī jiān" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -2779,7 +2779,7 @@ msgstr "wúxiào de géshì biāozhù" #: shared-bindings/wifi/Radio.c msgid "invalid hostname" -msgstr "" +msgstr "wú xiào zhǔ jī míng" #: extmod/modussl_axtls.c msgid "invalid key" From 76f1db7a8795f2594db6b6d0d6f38a48a2cfd8af Mon Sep 17 00:00:00 2001 From: "Ryan T. Hamilton" Date: Sat, 17 Oct 2020 00:23:31 -0700 Subject: [PATCH 1172/1293] Set sta_mode flag for actual use/checking --- ports/esp32s2/common-hal/wifi/Radio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index 6203a151bd..80afc5eaad 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -53,6 +53,8 @@ static void start_station(wifi_radio_obj_t *self) { } esp_wifi_set_mode(next_mode); + self->sta_mode = 1; + esp_wifi_set_config(WIFI_MODE_STA, &self->sta_config); } @@ -156,7 +158,7 @@ mp_obj_t common_hal_wifi_radio_get_ap_info(wifi_radio_obj_t *self) { } // Make sure the interface is in STA mode - if (self->sta_mode){ + if (!self->sta_mode){ return mp_const_none; } From dc10e968149f50fbc88158bcb3f78380667abb40 Mon Sep 17 00:00:00 2001 From: Noel Gaetan Date: Sat, 17 Oct 2020 16:54:13 +0200 Subject: [PATCH 1173/1293] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 29db397932..15b4cfc892 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ SPDX-License-Identifier: MIT # Contributing Please note that this project is released with a -[Contributor Code of Conduct](https://github.com/adafruit/circuitpython/blob/main/CODE_OF_CONDUCT.md). +[Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. Participation covers any forum used to converse about CircuitPython including unofficial and official spaces. Failure to do so will result in corrective actions such as time out or ban from the project. From 7cf776d39e9c9e4694b65b636f456630b462958c Mon Sep 17 00:00:00 2001 From: Noel Gaetan Date: Sat, 17 Oct 2020 17:11:17 +0200 Subject: [PATCH 1174/1293] Update CONTRIBUTING.md test fix url 404 --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 15b4cfc892..c94e8db8c6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,6 +4,8 @@ SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://g SPDX-License-Identifier: MIT --> + + # Contributing Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). From a71885c3915298922cbc8934620d14193dc5d4f4 Mon Sep 17 00:00:00 2001 From: Noel Gaetan Date: Sat, 17 Oct 2020 10:35:34 +0000 Subject: [PATCH 1175/1293] Translated using Weblate (French) Currently translated at 100.0% (834 of 834 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 482fd28097..e4af75891f 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: 2020-10-15 16:06+0530\n" -"PO-Revision-Date: 2020-10-15 18:17+0000\n" -"Last-Translator: Jeff Epler \n" +"PO-Revision-Date: 2020-10-17 15:35+0000\n" +"Last-Translator: Noel Gaetan \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.3-dev\n" +"X-Generator: Weblate 4.3.1-dev\n" #: main.c msgid "" @@ -23,7 +23,7 @@ msgid "" "Code done running. Waiting for reload.\n" msgstr "" "\n" -"Fin d'éxecution du code. En attente de recharge.\n" +"Fin d'exécution du code. En attente de rechargement.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -122,39 +122,39 @@ msgstr "'%q' argument requis" #: py/runtime.c msgid "'%q' object cannot assign attribute '%q'" -msgstr "object '%q' ne peut assigner l'attribut '%q'" +msgstr "l'objet '%q' ne peut avoir l'attribut '%q'" #: py/proto.c msgid "'%q' object does not support '%q'" -msgstr "object '%q' ne supporte pas '%q'" +msgstr "l'objet '%q' ne supporte pas '%q'" #: py/obj.c msgid "'%q' object does not support item assignment" -msgstr "objet '%q' ne supporte pas l'assignement d'objets" +msgstr "l'objet '%q' ne supporte pas l'assignement d'objets" #: py/obj.c msgid "'%q' object does not support item deletion" -msgstr "object '%q' ne supported pas la suppression d'objet" +msgstr "l'objet '%q' ne supporte pas la suppression d'objet" #: py/runtime.c msgid "'%q' object has no attribute '%q'" -msgstr "object '%q' n'as pas d'attribut '%q'" +msgstr "l'objet '%q' n'as pas d'attribut '%q'" #: py/runtime.c msgid "'%q' object is not an iterator" -msgstr "object '%q' n'est pas un itérateur" +msgstr "l'objet '%q' n'est pas un itérateur" #: py/objtype.c py/runtime.c msgid "'%q' object is not callable" -msgstr "object '%q' ne peut pas être appelé" +msgstr "l'objet '%q' ne peut pas être appelé" #: py/runtime.c msgid "'%q' object is not iterable" -msgstr "objet '%q' n'est pas iterable" +msgstr "l'objet '%q' n'est pas itérable" #: py/obj.c msgid "'%q' object is not subscriptable" -msgstr "objet '%q' n'est pas souscriptable" +msgstr "l'objet '%q' n'est pas souscriptable" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -169,7 +169,7 @@ msgstr "'%s' attend un registre" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects a special register" -msgstr "'%s' attend un registre special" +msgstr "'%s' attend un registre spécial" #: py/emitinlinethumb.c #, c-format From c85a845ff4d1edc8c001b0138fbddd6f1ff1d3a6 Mon Sep 17 00:00:00 2001 From: Antonin ENFRUN Date: Sat, 17 Oct 2020 09:33:07 +0000 Subject: [PATCH 1176/1293] Translated using Weblate (French) Currently translated at 100.0% (834 of 834 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 136 +++++++++++++++++++++++++++------------------------ 1 file changed, 71 insertions(+), 65 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index e4af75891f..a8a382c709 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,7 +9,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: 2020-10-17 15:35+0000\n" -"Last-Translator: Noel Gaetan \n" +"Last-Translator: Antonin ENFRUN \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" @@ -256,7 +256,7 @@ msgstr "'return' en dehors d'une fonction" #: py/compile.c msgid "'yield from' inside async function" -msgstr "" +msgstr "'yield from' dans une fonction async" #: py/compile.c msgid "'yield' outside function" @@ -346,7 +346,7 @@ msgstr "S'annonce déjà." #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Already have all-matches listener" -msgstr "" +msgstr "Il y a déjà un auditeur all-matches" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c @@ -355,7 +355,7 @@ msgstr "Déjà en cours d'exécution" #: ports/esp32s2/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" -msgstr "" +msgstr "Déjà à la recherche des réseaux wifi" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -706,11 +706,11 @@ msgstr "Impossible de redémarrer PWM" #: ports/esp32s2/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" -msgstr "" +msgstr "Impossible d’obtenir l’horloge" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" -msgstr "" +msgstr "Impossible de définir l’adresse" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" @@ -862,7 +862,7 @@ msgstr "La FFT est définie pour les ndarrays uniquement" #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" -msgstr "" +msgstr "Échec du handshake SSL" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." @@ -889,11 +889,11 @@ msgstr "Echec de l'allocation de %d octets du tampon RX" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" -msgstr "" +msgstr "Impossible d’allouer la mémoire pour Wifi" #: ports/esp32s2/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" -msgstr "" +msgstr "Impossible d'allouer la mémoire pour le scan wifi" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" @@ -927,16 +927,16 @@ msgstr "Le fichier existe" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" -msgstr "" +msgstr "Filtre trop complexe" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" -msgstr "" +msgstr "Format non supporté" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" -msgstr "" +msgstr "Le framebuffer nécessite %d octets" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." @@ -974,7 +974,7 @@ msgstr "Matériel utilisé, essayez d'autres broches" #: shared-bindings/wifi/Radio.c msgid "Hostname must be between 1 and 253 characters" -msgstr "" +msgstr "Hostname doit faire entre 1 et 253 caractères" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -1007,7 +1007,7 @@ msgstr "Taille de tampon incorrecte" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" -msgstr "" +msgstr "L'entrée prend trop de temps" #: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" @@ -1043,7 +1043,7 @@ msgstr "Broche invalide pour '%q'" #: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c #: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" -msgstr "" +msgstr "Sélection de pin %q invalide" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" @@ -1391,11 +1391,11 @@ msgstr "Ne joue pas" #: main.c msgid "Not running saved code.\n" -msgstr "" +msgstr "N'exécute pas le code sauvegardé.\n" #: shared-bindings/_bleio/__init__.c msgid "Not settable" -msgstr "" +msgstr "Non réglable" #: shared-bindings/util.c msgid "" @@ -1414,11 +1414,11 @@ msgstr "Uniquement 8 ou 16 bit mono avec " #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "" +msgstr "Seules les sockets IPv4 SOCK_STREAM sont prises en charge" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" -msgstr "" +msgstr "Seules les adresses IPv4 sont prises en charge" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1439,11 +1439,11 @@ msgstr "" #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" -msgstr "" +msgstr "IP n'accepte que les entiers bruts" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Out of sockets" -msgstr "" +msgstr "Plus de sockets" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." @@ -1518,6 +1518,8 @@ msgid "" "Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " "instead" msgstr "" +"Ce portage n'accepte pas de PWM carrier. Précisez plutôt pin, frequency et " +"duty cycle" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c @@ -1527,6 +1529,8 @@ msgid "" "Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " "instead" msgstr "" +"Ce portage n'accepte pas pins ou frequency. Construisez et passez un PWMOut " +"Carrier à la place" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" @@ -1590,7 +1594,7 @@ msgstr "Rafraîchissez trop tôt" #: shared-bindings/canio/RemoteTransmissionRequest.c msgid "RemoteTransmissionRequests limited to 8 bytes" -msgstr "" +msgstr "RemoteTransmissionRequests limité à 8 octets" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" @@ -1606,7 +1610,7 @@ msgstr "L'entrée de ligne 'Row' doit être un digitalio.DigitalInOut" #: main.c msgid "Running in safe mode! " -msgstr "" +msgstr "Tourne en mode sécurisé " #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -1620,12 +1624,12 @@ msgstr "SDA ou SCL a besoin d'une résistance de tirage ('pull up')" #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" -msgstr "" +msgstr "SDIO GetCardInfo erreur %d" #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO Init Error %d" -msgstr "" +msgstr "SDIO Init erreur %d" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" @@ -1663,11 +1667,11 @@ msgstr "Sérialiseur en cours d'utilisation" #: shared-bindings/ssl/SSLContext.c msgid "Server side context cannot have hostname" -msgstr "" +msgstr "Un contexte niveau serveur ne peut avoir de hostname" #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" -msgstr "" +msgstr "Taille non prise en charge" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." @@ -1682,7 +1686,7 @@ msgstr "Tranches non supportées" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" -msgstr "" +msgstr "SocketPool ne s'utilise qu'avec wifi.radio" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" @@ -1730,7 +1734,7 @@ msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" -msgstr "" +msgstr "La taille de rgb_pins doit être 6, 12, 18, 24 ou 30" #: supervisor/shared/safe_mode.c msgid "" @@ -1785,6 +1789,8 @@ msgstr "Le délai est trop long : le délai maximal est de %d secondes" msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" +"Timer est reservé pour un usage interne - déclarez la broche PWM plus tôt " +"dans le programme" #: supervisor/shared/safe_mode.c msgid "To exit, please reset the board without " @@ -1865,7 +1871,7 @@ msgstr "Impossible d'allouer des tampons pour une conversion signée" #: ports/esp32s2/common-hal/busio/I2C.c msgid "Unable to create lock" -msgstr "" +msgstr "Impossible de créer un verrou" #: shared-module/displayio/I2CDisplay.c #, c-format @@ -1896,11 +1902,11 @@ msgstr "Type inattendu pour l'uuid nrfx" #: ports/esp32s2/common-hal/socketpool/Socket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" -msgstr "" +msgstr "Erreur ESP TLS non gérée %d %d %x %d" #: shared-bindings/wifi/Radio.c msgid "Unknown failure" -msgstr "" +msgstr "Echec inconnu" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format @@ -2020,7 +2026,7 @@ msgstr "" #: shared-bindings/wifi/Radio.c msgid "WiFi password must be between 8 and 63 characters" -msgstr "" +msgstr "Le mot de passe WiFi doit faire entre 8 et 63 caractères" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" @@ -2040,7 +2046,7 @@ msgstr "__init__() doit retourner None" #: py/objtype.c msgid "__init__() should return None, not '%q'" -msgstr "" +msgstr "__init__() doit retourner None, pas '%q'" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -2085,7 +2091,7 @@ msgstr "l'argument est d'un mauvais type" #: extmod/ulab/code/linalg/linalg.c msgid "argument must be ndarray" -msgstr "" +msgstr "l'argument doit être un ndarray" #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c @@ -2192,7 +2198,7 @@ msgstr "octets > 8 bits non supporté" #: py/objarray.c msgid "bytes length not a multiple of item size" -msgstr "" +msgstr "bytes length n'est pas un multiple de la taille d'un élément" #: py/objstr.c msgid "bytes value out of range" @@ -2234,7 +2240,7 @@ msgstr "ne peut pas assigner à une expression" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c #: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" -msgstr "" +msgstr "impossible de convertir %q en %q" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" @@ -2242,7 +2248,7 @@ msgstr "impossible de convertir l'objet '%q' en '%q' implicitement" #: py/obj.c msgid "can't convert to %q" -msgstr "" +msgstr "impossible de convertir en %q" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2520,11 +2526,11 @@ msgstr "les exceptions doivent dériver de 'BaseException'" #: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" -msgstr "" +msgstr "'%q' était attendu, mais reçu '%q'" #: shared-bindings/canio/CAN.c msgid "expected '%q' or '%q' but got '%q'" -msgstr "" +msgstr "'%q' ou '%q' était attendu, mais reçu '%q'" #: py/objstr.c msgid "expected ':' after format specifier" @@ -2741,7 +2747,7 @@ msgstr "les valeurs initiales doivent être itérables" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "initial_value length is wrong" -msgstr "" +msgstr "la longueur de initial_value est incorrecte" #: py/compile.c msgid "inline assembler must be a function" @@ -2818,7 +2824,7 @@ msgstr "spécification de format invalide" #: shared-bindings/wifi/Radio.c msgid "invalid hostname" -msgstr "" +msgstr "hostname incorrect" #: extmod/modussl_axtls.c msgid "invalid key" @@ -2945,7 +2951,7 @@ msgstr "max_length doit être 0-%d lorsque fixed_length est %s" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "max_length must be > 0" -msgstr "" +msgstr "max_length doit être > 0" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3098,7 +3104,7 @@ msgstr "le nombre de points doit être d'au moins 2" #: py/obj.c msgid "object '%q' is not a tuple or list" -msgstr "" +msgstr "l'objet '%q' n'est pas un tuple ou une list" #: py/obj.c msgid "object does not support item assignment" @@ -3134,7 +3140,7 @@ msgstr "objet non itérable" #: py/obj.c msgid "object of type '%q' has no len()" -msgstr "" +msgstr "len() indéfinie pour un objet de type '%q'" #: py/obj.c msgid "object with buffer protocol required" @@ -3187,11 +3193,11 @@ msgstr "" #: shared-bindings/displayio/Bitmap.c msgid "out of range of source" -msgstr "" +msgstr "dépassement des bornes de source" #: shared-bindings/displayio/Bitmap.c msgid "out of range of target" -msgstr "" +msgstr "dépassement des bornes de target" #: py/objint_mpz.c msgid "overflow converting long int to machine word" @@ -3200,7 +3206,7 @@ msgstr "dépassement de capacité en convertissant un entier long en mot machine #: py/modstruct.c #, c-format msgid "pack expected %d items for packing (got %d)" -msgstr "" +msgstr "pack attend %d element(s) (%d reçu)" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" @@ -3249,7 +3255,7 @@ msgstr "'pop' d'une entrée PulseIn vide" #: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c #: shared-bindings/ps2io/Ps2.c msgid "pop from empty %q" -msgstr "" +msgstr "pop sur %q vide" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3269,7 +3275,7 @@ msgstr "pow() avec 3 arguments nécessite des entiers" #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" -msgstr "" +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 @@ -3277,7 +3283,7 @@ msgstr "" #: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "pressing both buttons at start up.\n" -msgstr "" +msgstr "les deux boutons appuyés lors du démarrage.\n" #: extmod/modutimeq.c msgid "queue overflow" @@ -3372,7 +3378,7 @@ msgstr "la longueur de sleep ne doit pas être négative" #: extmod/ulab/code/ndarray.c msgid "slice step can't be zero" -msgstr "" +msgstr "le pas 'step' de la tranche ne peut être zéro" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" @@ -3392,19 +3398,19 @@ msgstr "l'argument de «sort» doit être un ndarray" #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" -msgstr "" +msgstr "le tableau sos doit être de forme (n_section, 6)" #: extmod/ulab/code/filter/filter.c msgid "sos[:, 3] should be all ones" -msgstr "" +msgstr "sos[:, 3] doivent tous être à un" #: extmod/ulab/code/filter/filter.c msgid "sosfilt requires iterable arguments" -msgstr "" +msgstr "sosfilt nécessite des argument itératifs" #: shared-bindings/displayio/Bitmap.c msgid "source palette too large" -msgstr "" +msgstr "la palette source est trop grande" #: py/objstr.c msgid "start/end indices" @@ -3432,7 +3438,7 @@ msgstr "opération de flux non supportée" #: py/objstrunicode.c msgid "string indices must be integers, not %q" -msgstr "" +msgstr "les indices d'une chaîne doivent être des entiers, pas %q" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3485,11 +3491,11 @@ msgstr "'timeout' doit être >= 0.0" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" -msgstr "" +msgstr "Délai d’expiration dépassé en attendant une carte v1" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v2 card" -msgstr "" +msgstr "Délai d’expiration dépassé en attendant une carte v2" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" @@ -3510,7 +3516,7 @@ msgstr "trop de valeur à dégrouper (%d attendues)" #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" -msgstr "" +msgstr "trapz n'est défini que pour des tableaux 1D de longueur égale" #: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" @@ -3540,7 +3546,7 @@ msgstr "l'objet de type '%q' n'a pas d'attribut '%q'" #: py/objgenerator.c msgid "type object 'generator' has no attribute '__await__'" -msgstr "" +msgstr "le type 'generator' n'a pas d'attribut '__await__'" #: py/objtype.c msgid "type takes 1 or 3 arguments" @@ -3650,7 +3656,7 @@ msgstr "watchdog timeout doit être supérieur à 0" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" -msgstr "" +msgstr "width doit être plus grand que zero" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" @@ -3702,15 +3708,15 @@ msgstr "'step' nul" #: extmod/ulab/code/filter/filter.c msgid "zi must be an ndarray" -msgstr "" +msgstr "zi doit être ndarray" #: extmod/ulab/code/filter/filter.c msgid "zi must be of float type" -msgstr "" +msgstr "zi doit être de type float" #: extmod/ulab/code/filter/filter.c msgid "zi must be of shape (n_section, 2)" -msgstr "" +msgstr "zi doit être de forme (n_section, 2)" #~ msgid "Must provide SCK pin" #~ msgstr "Vous devez fournir un code PIN SCK" From 396979a67e538da087136ce01dbc4c7a670bf60e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 11 Oct 2020 21:01:12 -0500 Subject: [PATCH 1177/1293] atmel-samd: parallelize lto linking This decreases the link time, especially on desktop machines with many CPU cores. However, it does come at a slight cost in binary size, making the flash section about 200 bytes bigger for circuitplayground_express. Before, linking build-circuitplayground_express/firmware.elf takes 8.8s elapsed time, leaving 3128 bytes free in flash. After, linking build-circuitplayground_express/firmware.elf takes 2.8s elapsed time, leaving 2924 bytes free in flash. (-6 seconds, -204 bytes free) If necessary, we can make this per-board or even per-translation to squeeze full builds. --- ports/atmel-samd/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 1ee21679d8..2593377eb5 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -121,7 +121,7 @@ $(echo PERIPHERALS_CHIP_FAMILY=$(PERIPHERALS_CHIP_FAMILY)) ifeq ($(DEBUG), 1) CFLAGS += -ggdb3 -Og # You may want to disable -flto if it interferes with debugging. - CFLAGS += -flto -flto-partition=none + CFLAGS += -flto # You may want to enable these flags to make setting breakpoints easier. # CFLAGS += -fno-inline -fno-ipa-sra ifeq ($(CHIP_FAMILY), samd21) @@ -144,7 +144,7 @@ else CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT) endif - CFLAGS += -flto -flto-partition=none + CFLAGS += -flto ifeq ($(CIRCUITPY_FULL_BUILD),0) CFLAGS += --param inline-unit-growth=15 --param max-inline-insns-auto=20 @@ -197,6 +197,7 @@ endif LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs +LDFLAGS += -flto=$(shell nproc) LIBS := -lgcc -lc # Use toolchain libm if we're not using our own. From aa3c890ead4a006f273d6188a0a9fa2a19550458 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 12 Oct 2020 12:48:47 -0500 Subject: [PATCH 1178/1293] samd: pin: Fix 'undefined reference to pin_PA30' .. when PA30 is IGNOREd --- ports/atmel-samd/common-hal/microcontroller/Pin.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/atmel-samd/common-hal/microcontroller/Pin.c b/ports/atmel-samd/common-hal/microcontroller/Pin.c index bec9dc1e26..7dd87a3b2c 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Pin.c +++ b/ports/atmel-samd/common-hal/microcontroller/Pin.c @@ -223,9 +223,11 @@ bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t* pin) { #ifdef MICROPY_HW_NEOPIXEL if (pin == MICROPY_HW_NEOPIXEL) { // Special case for Metro M0 where the NeoPixel is also SWCLK +#ifndef IGNORE_PIN_PA30 if (MICROPY_HW_NEOPIXEL == &pin_PA30 && DSU->STATUSB.bit.DBGPRES == 1) { return false; } +#endif return !neopixel_in_use; } #endif From 4b9fc5de537a166963264cc23eb56f6aea22edde Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 12 Oct 2020 15:46:31 -0500 Subject: [PATCH 1179/1293] samd: update peripherals submodule this is possible now that the undefined reference to pin_PA30 has been resolved. --- ports/atmel-samd/peripherals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index a7e39c4d01..710954269a 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit a7e39c4d01aa5916015beecb021777617e77b0ad +Subproject commit 710954269a34d1b0c5534965f31689a09cf1d197 From eb0b023dee5e6688ead7d875084086a6eea3ce89 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 13 Oct 2020 14:42:30 -0500 Subject: [PATCH 1180/1293] samd: extend IGNORE_PIN_foo to all sam e5x/e5x pins --- .../common-hal/microcontroller/__init__.c | 77 +++++++++---------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/ports/atmel-samd/common-hal/microcontroller/__init__.c b/ports/atmel-samd/common-hal/microcontroller/__init__.c index 09212a0d12..50a1ec038e 100644 --- a/ports/atmel-samd/common-hal/microcontroller/__init__.c +++ b/ports/atmel-samd/common-hal/microcontroller/__init__.c @@ -275,120 +275,119 @@ STATIC const mp_rom_map_elem_t mcu_pin_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_PB31), MP_ROM_PTR(&pin_PB31) }, #endif -// These are SAMD51 specific so we assume we want them in RAM -#if defined(PIN_PC00) +#if defined(PIN_PC00) && !defined(IGNORE_PIN_PC00) { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, #endif -#if defined(PIN_PC01) +#if defined(PIN_PC01) && !defined(IGNORE_PIN_PC01) { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, #endif -#if defined(PIN_PC02) +#if defined(PIN_PC02) && !defined(IGNORE_PIN_PC02) { MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, #endif -#if defined(PIN_PC03) +#if defined(PIN_PC03) && !defined(IGNORE_PIN_PC03) { MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, #endif -#if defined(PIN_PC04) +#if defined(PIN_PC04) && !defined(IGNORE_PIN_PC04) { MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, #endif -#if defined(PIN_PC05) +#if defined(PIN_PC05) && !defined(IGNORE_PIN_PC05) { MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, #endif -#if defined(PIN_PC06) +#if defined(PIN_PC06) && !defined(IGNORE_PIN_PC06) { MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, #endif -#if defined(PIN_PC07) +#if defined(PIN_PC07) && !defined(IGNORE_PIN_PC07) { MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, #endif -#if defined(PIN_PC10) +#if defined(PIN_PC10) && !defined(IGNORE_PIN_PC10) { MP_ROM_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) }, #endif -#if defined(PIN_PC11) +#if defined(PIN_PC11) && !defined(IGNORE_PIN_PC11) { MP_ROM_QSTR(MP_QSTR_PC11), MP_ROM_PTR(&pin_PC11) }, #endif -#if defined(PIN_PC12) +#if defined(PIN_PC12) && !defined(IGNORE_PIN_PC12) { MP_ROM_QSTR(MP_QSTR_PC12), MP_ROM_PTR(&pin_PC12) }, #endif -#if defined(PIN_PC13) +#if defined(PIN_PC13) && !defined(IGNORE_PIN_PC13) { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, #endif -#if defined(PIN_PC14) +#if defined(PIN_PC14) && !defined(IGNORE_PIN_PC14) { MP_ROM_QSTR(MP_QSTR_PC14), MP_ROM_PTR(&pin_PC14) }, #endif -#if defined(PIN_PC15) +#if defined(PIN_PC15) && !defined(IGNORE_PIN_PC15) { MP_ROM_QSTR(MP_QSTR_PC15), MP_ROM_PTR(&pin_PC15) }, #endif -#if defined(PIN_PC16) +#if defined(PIN_PC16) && !defined(IGNORE_PIN_PC16) { MP_ROM_QSTR(MP_QSTR_PC16), MP_ROM_PTR(&pin_PC16) }, #endif -#if defined(PIN_PC17) +#if defined(PIN_PC17) && !defined(IGNORE_PIN_PC17) { MP_ROM_QSTR(MP_QSTR_PC17), MP_ROM_PTR(&pin_PC17) }, #endif -#if defined(PIN_PC18) +#if defined(PIN_PC18) && !defined(IGNORE_PIN_PC18) { MP_ROM_QSTR(MP_QSTR_PC18), MP_ROM_PTR(&pin_PC18) }, #endif -#if defined(PIN_PC19) +#if defined(PIN_PC19) && !defined(IGNORE_PIN_PC19) { MP_ROM_QSTR(MP_QSTR_PC19), MP_ROM_PTR(&pin_PC19) }, #endif -#if defined(PIN_PC20) +#if defined(PIN_PC20) && !defined(IGNORE_PIN_PC20) { MP_ROM_QSTR(MP_QSTR_PC20), MP_ROM_PTR(&pin_PC20) }, #endif -#if defined(PIN_PC21) +#if defined(PIN_PC21) && !defined(IGNORE_PIN_PC21) { MP_ROM_QSTR(MP_QSTR_PC21), MP_ROM_PTR(&pin_PC21) }, #endif -#if defined(PIN_PC22) +#if defined(PIN_PC22) && !defined(IGNORE_PIN_PC22) { MP_ROM_QSTR(MP_QSTR_PC22), MP_ROM_PTR(&pin_PC22) }, #endif -#if defined(PIN_PC23) +#if defined(PIN_PC23) && !defined(IGNORE_PIN_PC23) { MP_ROM_QSTR(MP_QSTR_PC23), MP_ROM_PTR(&pin_PC23) }, #endif -#if defined(PIN_PC24) +#if defined(PIN_PC24) && !defined(IGNORE_PIN_PC24) { MP_ROM_QSTR(MP_QSTR_PC24), MP_ROM_PTR(&pin_PC24) }, #endif -#if defined(PIN_PC25) +#if defined(PIN_PC25) && !defined(IGNORE_PIN_PC25) { MP_ROM_QSTR(MP_QSTR_PC25), MP_ROM_PTR(&pin_PC25) }, #endif -#if defined(PIN_PC26) +#if defined(PIN_PC26) && !defined(IGNORE_PIN_PC26) { MP_ROM_QSTR(MP_QSTR_PC26), MP_ROM_PTR(&pin_PC26) }, #endif -#if defined(PIN_PC27) +#if defined(PIN_PC27) && !defined(IGNORE_PIN_PC27) { MP_ROM_QSTR(MP_QSTR_PC27), MP_ROM_PTR(&pin_PC27) }, #endif -#if defined(PIN_PC28) +#if defined(PIN_PC28) && !defined(IGNORE_PIN_PC28) { MP_ROM_QSTR(MP_QSTR_PC28), MP_ROM_PTR(&pin_PC28) }, #endif -#if defined(PIN_PC30) +#if defined(PIN_PC30) && !defined(IGNORE_PIN_PC30) { MP_ROM_QSTR(MP_QSTR_PC30), MP_ROM_PTR(&pin_PC30) }, #endif -#if defined(PIN_PC31) +#if defined(PIN_PC31) && !defined(IGNORE_PIN_PC31) { MP_ROM_QSTR(MP_QSTR_PC31), MP_ROM_PTR(&pin_PC31) }, #endif -#if defined(PIN_PD00) +#if defined(PIN_PD00) && !defined(IGNORE_PIN_PD00) { MP_ROM_QSTR(MP_QSTR_PD00), MP_ROM_PTR(&pin_PD00) }, #endif -#if defined(PIN_PD01) +#if defined(PIN_PD01) && !defined(IGNORE_PIN_PD01) { MP_ROM_QSTR(MP_QSTR_PD01), MP_ROM_PTR(&pin_PD01) }, #endif -#if defined(PIN_PD08) +#if defined(PIN_PD08) && !defined(IGNORE_PIN_PD08) { MP_ROM_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) }, #endif -#if defined(PIN_PD09) +#if defined(PIN_PD09) && !defined(IGNORE_PIN_PD09) { MP_ROM_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) }, #endif -#if defined(PIN_PD10) +#if defined(PIN_PD10) && !defined(IGNORE_PIN_PD10) { MP_ROM_QSTR(MP_QSTR_PD10), MP_ROM_PTR(&pin_PD10) }, #endif -#if defined(PIN_PD11) +#if defined(PIN_PD11) && !defined(IGNORE_PIN_PD11) { MP_ROM_QSTR(MP_QSTR_PD11), MP_ROM_PTR(&pin_PD11) }, #endif -#if defined(PIN_PD12) +#if defined(PIN_PD12) && !defined(IGNORE_PIN_PD12) { MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) }, #endif -#if defined(PIN_PD20) +#if defined(PIN_PD20) && !defined(IGNORE_PIN_PD20) { MP_ROM_QSTR(MP_QSTR_PD20), MP_ROM_PTR(&pin_PD20) }, #endif -#if defined(PIN_PD21) +#if defined(PIN_PD21) && !defined(IGNORE_PIN_PD21) { MP_ROM_QSTR(MP_QSTR_PD21), MP_ROM_PTR(&pin_PD21) }, #endif }; From 194d99f58856c3c0a3d838f99e823a6d0181063c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 17 Oct 2020 19:07:15 -0500 Subject: [PATCH 1181/1293] sparkfun_lumidrive: Can't IGNORE pins that are default bus pins The SDA, SCL, and MISO pins were ignored. This error was not diagnosed before now. --- ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.h b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.h index d184945f35..80f37429fa 100755 --- a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.h +++ b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.h @@ -35,9 +35,6 @@ #define IGNORE_PIN_PA12 1 #define IGNORE_PIN_PA15 1 #define IGNORE_PIN_PA16 1 -#define IGNORE_PIN_PA21 1 -#define IGNORE_PIN_PA22 1 -#define IGNORE_PIN_PA23 1 #define IGNORE_PIN_PA27 1 #define IGNORE_PIN_PA28 1 From fb768dfc14ab3b98905927f984a080e551513ea8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 17 Oct 2020 19:08:32 -0500 Subject: [PATCH 1182/1293] samd: AnalogOut: Better handle boards which IGNOREd analog pins --- .../common-hal/analogio/AnalogOut.c | 45 ++++++++++++------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/ports/atmel-samd/common-hal/analogio/AnalogOut.c b/ports/atmel-samd/common-hal/analogio/AnalogOut.c index fac4c6bfcb..1565b0a8f4 100644 --- a/ports/atmel-samd/common-hal/analogio/AnalogOut.c +++ b/ports/atmel-samd/common-hal/analogio/AnalogOut.c @@ -44,26 +44,36 @@ #include "hpl/pm/hpl_pm_base.h" #endif +#define HAVE_ANALOGOUT ( \ + (defined(PIN_PA02) && !defined(IGNORE_PA02)) || \ + (defined(SAM_D5X_E5X) && defined(PIN_PA05) && !defined(IGNORE_PA05)) \ +) + void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, const mcu_pin_obj_t *pin) { - #if defined(SAMD21) && !defined(PIN_PA02) + #if !HAVE_ANALOGOUT mp_raise_NotImplementedError(translate("No DAC on chip")); #else - if (pin->number != PIN_PA02 - #ifdef SAM_D5X_E5X - && pin->number != PIN_PA05 + + int channel = -1; + + #if defined(PIN_PA02) && !defined(IGNORE_PIN_PA02) + if (pin->number != PIN_PA02) { + channel = 0; + } #endif - ) { + #if defined(PIN_PA05) && defined(PIN_PA05) && !defined(IGNORE_PIN_PA05) + if (pin->number != PIN_PA05) { + channel = 1; + } + #endif + + if(channel == -1) { mp_raise_ValueError(translate("AnalogOut not supported on given pin")); return; } - self->channel = 0; - #ifdef SAM_D5X_E5X - if (pin->number == PIN_PA05) { - self->channel = 1; - } - #endif + self->channel = channel; #ifdef SAM_D5X_E5X hri_mclk_set_APBDMASK_DAC_bit(MCLK); @@ -105,11 +115,15 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, } bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { + #if !HAVE_ANALOGOUT + return false; + #else return self->deinited; + #endif } void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { - #if (defined(SAMD21) && defined(PIN_PA02)) || defined(SAM_D5X_E5X) + #if HAVE_ANALOGOUT if (common_hal_analogio_analogout_deinited(self)) { return; } @@ -130,12 +144,11 @@ void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { void common_hal_analogio_analogout_set_value(analogio_analogout_obj_t *self, uint16_t value) { - #if defined(SAMD21) && !defined(PIN_PA02) - return; - #endif + #if HAVE_ANALOGOUT // Input is 16 bit so make sure and set LEFTADJ to 1 so it takes the top // bits. This is currently done in asf4_conf/*/hpl_dac_config.h. dac_sync_write(&self->descriptor, self->channel, &value, 1); + #endif } void analogout_reset(void) { @@ -143,7 +156,7 @@ void analogout_reset(void) { // if it was enabled, so do that instead if AudioOut is enabled. #if CIRCUITPY_AUDIOIO audioout_reset(); -#else +#elif HAVE_ANALOGOUT #ifdef SAMD21 while (DAC->STATUS.reg & DAC_STATUS_SYNCBUSY) {} #endif From cc411f47eb009dab7a20f3a220cc569b7e310116 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 17 Oct 2020 19:10:22 -0500 Subject: [PATCH 1183/1293] samd: Update peripherals submodule (https://github.com/adafruit/samd-peripherals/pull/37) --- ports/atmel-samd/peripherals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 710954269a..a7e39c4d01 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 710954269a34d1b0c5534965f31689a09cf1d197 +Subproject commit a7e39c4d01aa5916015beecb021777617e77b0ad From 852c57c6614011ec63b4bb99a12e53790a0b38cd Mon Sep 17 00:00:00 2001 From: Senuros Date: Sun, 18 Oct 2020 03:40:02 +0200 Subject: [PATCH 1184/1293] Adding some more german translations --- locale/de_DE.po | 52 +++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index 89969e8748..6529715660 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -149,7 +149,7 @@ msgstr "" #: py/obj.c msgid "'%q' object is not subscriptable" -msgstr "" +msgstr "'%q' Objekt hat keine '__getitem__'-Methode (not subscriptable)" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -1986,14 +1986,16 @@ msgstr "WatchDogTimer läuft aktuell nicht" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" 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 "" +msgstr "WatchDogTimer.timeout muss größer als 0 sein" #: supervisor/shared/safe_mode.c msgid "Watchdog timer expired." -msgstr "" +msgstr "Watchdog timer abgelaufen " #: py/builtinhelp.c #, c-format @@ -2013,11 +2015,11 @@ msgstr "" #: shared-bindings/wifi/Radio.c msgid "WiFi password must be between 8 and 63 characters" -msgstr "" +msgstr "WiFi Passwort muss zwischen 8 und 63 Zeichen lang sein" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" -msgstr "Schreiben nicht unterstüzt für die Characteristic" +msgstr "Schreiben nicht unterstüzt für diese Charakteristik" #: supervisor/shared/safe_mode.c msgid "You are in safe mode: something unanticipated happened.\n" @@ -2035,7 +2037,7 @@ msgstr "__init__() sollte None zurückgeben" #: py/objtype.c msgid "__init__() should return None, not '%q'" -msgstr "" +msgstr "__init__() sollte None zurückgeben, nicht '%q'" #: py/objobject.c msgid "__new__ arg must be a user-type" @@ -2080,12 +2082,12 @@ msgstr "Argument hat falschen Typ" #: extmod/ulab/code/linalg/linalg.c msgid "argument must be ndarray" -msgstr "" +msgstr "Argument muss ein ndarray sein" #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" -msgstr "Anzahl/Type der Argumente passen nicht" +msgstr "Anzahl/Typen der Argumente passen nicht" #: py/runtime.c msgid "argument should be a '%q' not a '%q'" @@ -2187,7 +2189,7 @@ msgstr "bytes mit mehr als 8 bits werden nicht unterstützt" #: py/objarray.c msgid "bytes length not a multiple of item size" -msgstr "" +msgstr "Byte-Länge ist kein vielfaches der Item-Größe" #: py/objstr.c msgid "bytes value out of range" @@ -2230,7 +2232,7 @@ msgstr "kann keinem Ausdruck zuweisen" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c #: shared-module/_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" -msgstr "" +msgstr "kann %q nicht zu %q konvertieren" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" @@ -2238,7 +2240,7 @@ msgstr "Kann '%q' Objekt nicht implizit nach %q konvertieren" #: py/obj.c msgid "can't convert to %q" -msgstr "" +msgstr "kann nicht zu %q konvertieren" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2292,7 +2294,7 @@ msgstr "" #: shared-module/sdcardio/SDCard.c msgid "can't set 512 block size" -msgstr "" +msgstr "Kann Blockgröße von 512 nicht setzen" #: py/objnamedtuple.c msgid "can't set attribute" @@ -2728,11 +2730,11 @@ msgstr "Indizes müssen Integer, Slices oder Boolesche Listen sein" #: extmod/ulab/code/approx/approx.c msgid "initial values must be iterable" -msgstr "" +msgstr "Ausgangswerte müssen iterierbar sein" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "initial_value length is wrong" -msgstr "" +msgstr "Länge von initial_value ist falsch" #: py/compile.c msgid "inline assembler must be a function" @@ -3126,7 +3128,7 @@ msgstr "Objekt nicht iterierbar" #: py/obj.c msgid "object of type '%q' has no len()" -msgstr "" +msgstr "Object vom Typ '%q' hat kein len()" #: py/obj.c msgid "object with buffer protocol required" @@ -3180,11 +3182,11 @@ msgstr "" #: shared-bindings/displayio/Bitmap.c msgid "out of range of source" -msgstr "" +msgstr "Außerhalb des Bereichs der Quelle" #: shared-bindings/displayio/Bitmap.c msgid "out of range of target" -msgstr "" +msgstr "Außerhalb des Bereichs des Ziels" #: py/objint_mpz.c msgid "overflow converting long int to machine word" @@ -3396,7 +3398,7 @@ msgstr "" #: shared-bindings/displayio/Bitmap.c msgid "source palette too large" -msgstr "" +msgstr "Quell-Palette zu groß" #: py/objstr.c msgid "start/end indices" @@ -3424,7 +3426,7 @@ msgstr "stream operation ist nicht unterstützt" #: py/objstrunicode.c msgid "string indices must be integers, not %q" -msgstr "" +msgstr "String Indizes müssen Integer sein, nicht %q" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3465,7 +3467,7 @@ msgstr "time.struct_time() nimmt eine 9-Sequenz an" #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" -msgstr "" +msgstr "Das Zeitlimit hat den maximal zulässigen Wert überschritten" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" @@ -3477,11 +3479,11 @@ msgstr "timeout muss >= 0.0 sein" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" -msgstr "" +msgstr "Zeitlimit beim warten auf v1 Karte" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v2 card" -msgstr "" +msgstr "Zeitlimit beim warten auf v2 Karte" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" @@ -3532,7 +3534,7 @@ msgstr "Typ vom Objekt '%q' hat kein Attribut '%q'" #: py/objgenerator.c msgid "type object 'generator' has no attribute '__await__'" -msgstr "" +msgstr "Das Typ-Objekt 'generator' hat kein Attribut '__await__'" #: py/objtype.c msgid "type takes 1 or 3 arguments" @@ -3577,7 +3579,7 @@ msgstr "unbekannter Konvertierungs specifier %c" #: py/objstr.c msgid "unknown format code '%c' for object of type '%q'" -msgstr "" +msgstr "Unbekannter Formatcode '%c' für Objekt vom Typ '%q'" #: py/compile.c msgid "unknown type" @@ -3638,7 +3640,7 @@ msgstr "value_count muss größer als 0 sein" #: extmod/ulab/code/linalg/linalg.c msgid "vectors must have same lengths" -msgstr "" +msgstr "Vektoren müssen die selbe Länge haben" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" From d6805c0dd40e142654fd45e4d6d43af08871a2c8 Mon Sep 17 00:00:00 2001 From: askpatricw <4002194+askpatrickw@users.noreply.github.com> Date: Sun, 18 Oct 2020 17:15:59 -0700 Subject: [PATCH 1185/1293] SDA and SCL were flipped --- .../boards/unexpectedmaker_feathers2_prerelease/pins.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c index 967f5e8d97..a1036f8506 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c @@ -46,11 +46,11 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO38) }, { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO38) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO33) }, { MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) }, { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO33) }, From d2dada869cc3ab85c7ed5b81d9928d6b8dd3282b Mon Sep 17 00:00:00 2001 From: Jensen Kuras Date: Mon, 19 Oct 2020 17:27:01 -0500 Subject: [PATCH 1186/1293] displayio: Update docs for ColorConverter's make_opaque Co-authored-by: Scott Shawcroft --- shared-bindings/displayio/ColorConverter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index e47a961a50..0e6e9bfd94 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -122,7 +122,7 @@ STATIC mp_obj_t displayio_colorconverter_make_transparent(mp_obj_t self_in, mp_o } MP_DEFINE_CONST_FUN_OBJ_2(displayio_colorconverter_make_transparent_obj, displayio_colorconverter_make_transparent); -//| def make_opaque(self) -> None: +//| def make_opaque(self, pixel: int) -> None: //| """Sets a pixel to opaque.""" //| STATIC mp_obj_t displayio_colorconverter_make_opaque(mp_obj_t self_in, mp_obj_t transparent_color_obj) { From eb139c9babeda44a7e613602f8aa86d6207cb994 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 19 Oct 2020 17:41:16 -0700 Subject: [PATCH 1187/1293] Correct pins to not reset. They must have the PORT_ prefix otherwise they mask the wrong pins. Fixes #3552 --- ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h index cbca94e030..475752afb3 100644 --- a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.h @@ -9,7 +9,7 @@ // These are pins not to reset. // QSPI Data pins, PA23 is NeoPixel -#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11 | PA23) +#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11 | PORT_PA23) // QSPI CS, QSPI SCK #define MICROPY_PORT_B (PORT_PB10 | PORT_PB11) #define MICROPY_PORT_C (0) From 13387121fe653c3380e4248abc2db69687cc27cf Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Tue, 20 Oct 2020 09:23:45 +0530 Subject: [PATCH 1188/1293] Update readme --- README.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/README.rst b/README.rst index 99a35d6da1..d21e8d8d3c 100644 --- a/README.rst +++ b/README.rst @@ -95,7 +95,6 @@ Differences from `MicroPython `__ CircuitPython: - Supports native USB on all boards, allowing file editing without special tools. -- Support status for ports is different. - Floats (aka decimals) are enabled for all builds. - Error messages are translated into 10+ languages. - Does not support concurrency within Python (including interrupts and threading). Some concurrency From a2fce305d6b9407ad6af4e6d4721c47fc9e264d4 Mon Sep 17 00:00:00 2001 From: Targett363 Date: Tue, 20 Oct 2020 10:42:14 +0100 Subject: [PATCH 1189/1293] Replacing placeholder PIDs with correct PIDs --- ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk | 2 +- .../esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk b/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk index e307d7d623..f88cb75d25 100644 --- a/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk +++ b/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x1209 -USB_PID = 0x0011 +USB_PID = 0x3252 USB_PRODUCT = "Targett Module Clip w/Wroom" USB_MANUFACTURER = "Targett" diff --git a/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk b/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk index aff5ffd6cf..e2dc155846 100644 --- a/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk +++ b/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x1209 -USB_PID = 0x0012 +USB_PID = 0x3253 USB_PRODUCT = "Targett Module Clip w/Wrover" USB_MANUFACTURER = "Targett" From 543073b1986cf34530fd07644fbbe392075bf7cf Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 20 Oct 2020 08:13:11 -0500 Subject: [PATCH 1190/1293] zh_Latn_pinyin: Use ASCII alternatives to fullwidth chars --- locale/zh_Latn_pinyin.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 365b1e498f..892b9ac58b 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -3277,7 +3277,7 @@ msgstr "yòubiān bìxū shì ndarray huò biāoliàng" #: py/objstr.c msgid "rsplit(None,n)" -msgstr "Rchāifēn(wú ,N)" +msgstr "Rchāifēn(wú,N)" #: shared-bindings/audiocore/RawSample.c msgid "" From 1eab0692b50f05f6b8194897386cda7720634fe6 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Tue, 20 Oct 2020 16:37:24 +0200 Subject: [PATCH 1191/1293] Fix missing `nproc` on macOS. 396979a breaks building on macOS: `nproc` is a Linux thing, use a cross-platform alternative. --- ports/atmel-samd/Makefile | 2 +- py/mkenv.mk | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 2593377eb5..111f12b4ec 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -197,7 +197,7 @@ endif LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs -LDFLAGS += -flto=$(shell nproc) +LDFLAGS += -flto=$(shell $(NPROC)) LIBS := -lgcc -lc # Use toolchain libm if we're not using our own. diff --git a/py/mkenv.mk b/py/mkenv.mk index b76dd60f85..cb678e8e78 100644 --- a/py/mkenv.mk +++ b/py/mkenv.mk @@ -55,6 +55,8 @@ PYTHON3 ?= python3 RM = rm RSYNC = rsync SED = sed +# Linux has 'nproc', macOS has 'sysctl -n hw.logicalcpu', this is cross-platform +NPROC = $(PYTHON) -c 'import multiprocessing as mp; print(mp.cpu_count())' AS = $(CROSS_COMPILE)as CC = $(CROSS_COMPILE)gcc From 8beb36c240d162bfb3f12dceb46d409eee26722d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 20 Oct 2020 09:24:03 -0700 Subject: [PATCH 1192/1293] Use one lto partition This leads to smaller code size at the expense of slower linking. We can turn partitioning back on with GCC10 because it produces smaller code. --- ports/atmel-samd/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 2593377eb5..817cc9e3b5 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -121,7 +121,7 @@ $(echo PERIPHERALS_CHIP_FAMILY=$(PERIPHERALS_CHIP_FAMILY)) ifeq ($(DEBUG), 1) CFLAGS += -ggdb3 -Og # You may want to disable -flto if it interferes with debugging. - CFLAGS += -flto + CFLAGS += -flto -flto-partition=none # You may want to enable these flags to make setting breakpoints easier. # CFLAGS += -fno-inline -fno-ipa-sra ifeq ($(CHIP_FAMILY), samd21) @@ -144,7 +144,7 @@ else CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT) endif - CFLAGS += -flto + CFLAGS += -flto -flto-partition=none ifeq ($(CIRCUITPY_FULL_BUILD),0) CFLAGS += --param inline-unit-growth=15 --param max-inline-insns-auto=20 From 599bacb0b4f4654ad0fbc9844d8cc9365d2ee26e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 20 Oct 2020 10:06:26 -0500 Subject: [PATCH 1193/1293] build.yml: Fix building mpy-cross-mac Recently, the macos-10.15 image was updated with a non-brew version of awscli. This made our CI script, which does a `brew install awscli` fail: ``` Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink bin/aws Target /usr/local/bin/aws already exists. You may want to remove it: rm '/usr/local/bin/aws' ``` --- .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 b3455cb537..447961f85f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -131,7 +131,7 @@ jobs: run: echo "$GITHUB_CONTEXT" - name: Install dependencies run: | - brew install gettext awscli + brew install gettext echo >>$GITHUB_PATH /usr/local/opt/gettext/bin - name: Versions run: | From c58b0adf64a99916a3b360d62dee3b2964f3876b Mon Sep 17 00:00:00 2001 From: "Ryan T. Hamilton" Date: Tue, 20 Oct 2020 14:49:57 -0700 Subject: [PATCH 1194/1293] Reset sta_mode and ap_mode flags --- ports/esp32s2/common-hal/wifi/__init__.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index 5c8d2e9526..65186e9b17 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -100,6 +100,13 @@ void common_hal_wifi_init(void) { wifi_radio_obj_t* self = &common_hal_wifi_radio_obj; self->netif = esp_netif_create_default_wifi_sta(); + // Even though we just called esp_netif_create_default_wifi_sta, + // station mode isn't actually set until esp_wifi_set_mode() + // is called and the configuration is loaded via esp_wifi_set_config(). + // Set both convienence flags to false so it's not forgotten. + self->sta_mode = 0; + self->ap_mode = 0; + self->event_group_handle = xEventGroupCreateStatic(&self->event_group); ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, ESP_EVENT_ANY_ID, From e202da4dadeadfe22d30251d99c5247f024bd746 Mon Sep 17 00:00:00 2001 From: "Ryan T. Hamilton" Date: Tue, 20 Oct 2020 15:14:35 -0700 Subject: [PATCH 1195/1293] Change comment wording --- ports/esp32s2/common-hal/wifi/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index 65186e9b17..833ef0623f 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -101,7 +101,7 @@ void common_hal_wifi_init(void) { self->netif = esp_netif_create_default_wifi_sta(); // Even though we just called esp_netif_create_default_wifi_sta, - // station mode isn't actually set until esp_wifi_set_mode() + // station mode isn't actually ready for use until esp_wifi_set_mode() // is called and the configuration is loaded via esp_wifi_set_config(). // Set both convienence flags to false so it's not forgotten. self->sta_mode = 0; From ea6ef8b1423c653a461371e1bc105b6ff75d88b5 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 20 Oct 2020 00:40:50 +0200 Subject: [PATCH 1196/1293] 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 | 6 +++++- locale/cs.po | 6 +++++- locale/de_DE.po | 10 +++++++--- locale/el.po | 6 +++++- locale/es.po | 6 +++++- locale/fil.po | 6 +++++- locale/fr.po | 6 +++++- locale/hi.po | 6 +++++- locale/it_IT.po | 6 +++++- locale/ja.po | 6 +++++- locale/ko.po | 6 +++++- locale/nl.po | 6 +++++- locale/pl.po | 6 +++++- locale/pt_BR.po | 6 +++++- locale/sv.po | 6 +++++- locale/zh_Latn_pinyin.po | 6 +++++- 16 files changed, 82 insertions(+), 18 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index f35afea66d..ef090afec7 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-16 13:56-0500\n" "PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -2154,6 +2154,10 @@ msgstr "" msgid "buffer too small" msgstr "" +#: shared-bindings/socketpool/Socket.c +msgid "buffer too small for requested bytes" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index d7caa43ea1..f86f0fcfdd 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-16 13:56-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -2111,6 +2111,10 @@ msgstr "" msgid "buffer too small" msgstr "" +#: shared-bindings/socketpool/Socket.c +msgid "buffer too small for requested bytes" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 6529715660..d400f0a761 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-16 13:56-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -1986,8 +1986,8 @@ msgstr "WatchDogTimer läuft aktuell nicht" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" -"WatchDogTimer.mode kann nicht geändert werden, nachdem " -"er auf WatchDogMode.RESET gesetzt wurde" +"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" @@ -2170,6 +2170,10 @@ msgstr "Puffersegmente müssen gleich lang sein" msgid "buffer too small" msgstr "Der Puffer ist zu klein" +#: shared-bindings/socketpool/Socket.c +msgid "buffer too small for requested bytes" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "Tasten müssen digitalio.DigitalInOut sein" diff --git a/locale/el.po b/locale/el.po index 42b083e3c9..676c54c7bc 100644 --- a/locale/el.po +++ b/locale/el.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-16 13:56-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -2106,6 +2106,10 @@ msgstr "" msgid "buffer too small" msgstr "" +#: shared-bindings/socketpool/Socket.c +msgid "buffer too small for requested bytes" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" diff --git a/locale/es.po b/locale/es.po index db20dea120..50c3620d69 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-16 13:56-0500\n" "PO-Revision-Date: 2020-10-17 02:31+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -2169,6 +2169,10 @@ msgstr "Las secciones del buffer necesitan tener longitud igual" msgid "buffer too small" msgstr "buffer demasiado pequeño" +#: shared-bindings/socketpool/Socket.c +msgid "buffer too small for requested bytes" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "los botones necesitan ser digitalio.DigitalInOut" diff --git a/locale/fil.po b/locale/fil.po index ecda65cb21..f90f5bbed7 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-16 13:56-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -2139,6 +2139,10 @@ msgstr "aarehas na haba dapat ang buffer slices" msgid "buffer too small" msgstr "masyadong maliit ang buffer" +#: shared-bindings/socketpool/Socket.c +msgid "buffer too small for requested bytes" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index a8a382c709..d1e8b268d6 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-16 13:56-0500\n" "PO-Revision-Date: 2020-10-17 15:35+0000\n" "Last-Translator: Antonin ENFRUN \n" "Language: fr\n" @@ -2179,6 +2179,10 @@ msgstr "les tranches de tampon doivent être de longueurs égales" msgid "buffer too small" msgstr "tampon trop petit" +#: shared-bindings/socketpool/Socket.c +msgid "buffer too small for requested bytes" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "les boutons doivent être des digitalio.DigitalInOut" diff --git a/locale/hi.po b/locale/hi.po index 88c795a7ce..485ce63988 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-16 13:56-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -2106,6 +2106,10 @@ msgstr "" msgid "buffer too small" msgstr "" +#: shared-bindings/socketpool/Socket.c +msgid "buffer too small for requested bytes" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 1650a5bdbd..9d299b49b9 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-16 13:56-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -2144,6 +2144,10 @@ msgstr "slice del buffer devono essere della stessa lunghezza" msgid "buffer too small" msgstr "buffer troppo piccolo" +#: shared-bindings/socketpool/Socket.c +msgid "buffer too small for requested bytes" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 01900d9a8f..ac883044cb 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-16 13:56-0500\n" "PO-Revision-Date: 2020-09-25 18:20+0000\n" "Last-Translator: Taku Fukada \n" "Language-Team: none\n" @@ -2131,6 +2131,10 @@ msgstr "バッファのスライスは同じ長さでなければなりません msgid "buffer too small" msgstr "" +#: shared-bindings/socketpool/Socket.c +msgid "buffer too small for requested bytes" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "buttonsはdigitalio.DigitalInOutでなければなりません" diff --git a/locale/ko.po b/locale/ko.po index a9bc60f781..dea656591c 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-16 13:56-0500\n" "PO-Revision-Date: 2020-10-05 12:12+0000\n" "Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" @@ -2112,6 +2112,10 @@ msgstr "" msgid "buffer too small" msgstr "" +#: shared-bindings/socketpool/Socket.c +msgid "buffer too small for requested bytes" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index edcaefb832..ed75cdd8c1 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-16 13:56-0500\n" "PO-Revision-Date: 2020-09-09 16:05+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -2158,6 +2158,10 @@ msgstr "buffer slices moeten van gelijke grootte zijn" msgid "buffer too small" msgstr "buffer te klein" +#: shared-bindings/socketpool/Socket.c +msgid "buffer too small for requested bytes" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "buttons moeten digitalio.DigitalInOut zijn" diff --git a/locale/pl.po b/locale/pl.po index b79fcc606b..ec5fe5a65c 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-16 13:56-0500\n" "PO-Revision-Date: 2020-09-29 01:39+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -2128,6 +2128,10 @@ msgstr "fragmenty bufora muszą mieć tę samą długość" msgid "buffer too small" msgstr "zbyt mały bufor" +#: shared-bindings/socketpool/Socket.c +msgid "buffer too small for requested bytes" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "buttons musi być digitalio.DigitalInOut" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 240a56104e..b21b728ead 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-16 13:56-0500\n" "PO-Revision-Date: 2020-10-16 17:01+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -2177,6 +2177,10 @@ msgstr "as fatias do buffer devem ter o mesmo comprimento" msgid "buffer too small" msgstr "o buffer é muito pequeno" +#: shared-bindings/socketpool/Socket.c +msgid "buffer too small for requested bytes" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "os botões devem ser digitalio.DigitalInOut" diff --git a/locale/sv.po b/locale/sv.po index f3bf71558a..42e8ce2c45 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-16 13:56-0500\n" "PO-Revision-Date: 2020-10-14 18:12+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -2155,6 +2155,10 @@ msgstr "buffertsegmenten måste vara lika långa" msgid "buffer too small" msgstr "buffert för liten" +#: shared-bindings/socketpool/Socket.c +msgid "buffer too small for requested bytes" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "buttons måste vara digitalio.DigitalInOut" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 892b9ac58b..42c6e39d58 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-16 13:56-0500\n" "PO-Revision-Date: 2020-10-17 02:31+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -2147,6 +2147,10 @@ msgstr "huǎnchōng qū qiēpiàn bìxū chángdù xiāngděng" msgid "buffer too small" msgstr "huǎnchōng qū tài xiǎo" +#: shared-bindings/socketpool/Socket.c +msgid "buffer too small for requested bytes" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "ànniǔ bìxū shì digitalio.DigitalInOut" From c65b0985b897b21129356cad95df75d9698478eb Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 20 Oct 2020 02:57:36 +0000 Subject: [PATCH 1197/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (835 of 835 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 b21b728ead..20e7d68962 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: 2020-10-16 13:56-0500\n" -"PO-Revision-Date: 2020-10-16 17:01+0000\n" +"PO-Revision-Date: 2020-10-20 17:13+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.3.1-dev\n" +"X-Generator: Weblate 4.3.1\n" #: main.c msgid "" @@ -2179,7 +2179,7 @@ msgstr "o buffer é muito pequeno" #: shared-bindings/socketpool/Socket.c msgid "buffer too small for requested bytes" -msgstr "" +msgstr "o buffer é pequeno demais para os bytes requisitados" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" From 41d02fd53d39b01deff2d8cc0da83f1407cdf888 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 20 Oct 2020 19:42:08 +0200 Subject: [PATCH 1198/1293] 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 | 6 +++++- locale/cs.po | 6 +++++- locale/de_DE.po | 6 +++++- locale/el.po | 6 +++++- locale/es.po | 6 +++++- locale/fil.po | 6 +++++- locale/fr.po | 6 +++++- locale/hi.po | 6 +++++- locale/it_IT.po | 6 +++++- locale/ja.po | 6 +++++- locale/ko.po | 6 +++++- locale/nl.po | 6 +++++- locale/pl.po | 6 +++++- locale/pt_BR.po | 6 +++++- locale/sv.po | 6 +++++- locale/zh_Latn_pinyin.po | 6 +++++- 16 files changed, 80 insertions(+), 16 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index ef090afec7..958ff1e6b2 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 13:56-0500\n" +"POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -1431,6 +1431,10 @@ msgstr "" "Hanya monokrom, 4bpp atau 8bpp yang diindeks, dan 16bpp atau lebih yang " "didukung: %d bpp diberikan" +#: shared-module/displayio/ColorConverter.c +msgid "Only one color can be transparent at a time" +msgstr "" + #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index f86f0fcfdd..6a3d00d993 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 13:56-0500\n" +"POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -1408,6 +1408,10 @@ msgid "" "%d bpp given" msgstr "" +#: shared-module/displayio/ColorConverter.c +msgid "Only one color can be transparent at a time" +msgstr "" + #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index d400f0a761..e54b670a90 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 13:56-0500\n" +"POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -1433,6 +1433,10 @@ msgstr "" "Nur monochrome, indizierte 4bpp oder 8bpp, und 16bpp oder größere BMPs " "unterstützt: %d bpp wurden gegeben" +#: shared-module/displayio/ColorConverter.c +msgid "Only one color can be transparent at a time" +msgstr "" + #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" msgstr "" diff --git a/locale/el.po b/locale/el.po index 676c54c7bc..5e55065b30 100644 --- a/locale/el.po +++ b/locale/el.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 13:56-0500\n" +"POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -1403,6 +1403,10 @@ msgid "" "%d bpp given" msgstr "" +#: shared-module/displayio/ColorConverter.c +msgid "Only one color can be transparent at a time" +msgstr "" + #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" msgstr "" diff --git a/locale/es.po b/locale/es.po index 50c3620d69..8cd5e6c22b 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 13:56-0500\n" +"POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: 2020-10-17 02:31+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -1432,6 +1432,10 @@ msgstr "" "Solo se admiten BMP monocromáticos, indexados de 4 bpp u 8 bpp y 16 bpp o " "más: %d bpp proporcionados" +#: shared-module/displayio/ColorConverter.c +msgid "Only one color can be transparent at a time" +msgstr "" + #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" msgstr "Solo se aceptan enteros crudos para ip" diff --git a/locale/fil.po b/locale/fil.po index f90f5bbed7..7a91f5c859 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 13:56-0500\n" +"POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -1421,6 +1421,10 @@ msgid "" "%d bpp given" msgstr "" +#: shared-module/displayio/ColorConverter.c +msgid "Only one color can be transparent at a time" +msgstr "" + #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index d1e8b268d6..9bfc14428a 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 13:56-0500\n" +"POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: 2020-10-17 15:35+0000\n" "Last-Translator: Antonin ENFRUN \n" "Language: fr\n" @@ -1437,6 +1437,10 @@ msgstr "" "Prise en charge uniquement des monochromes, 4 bpp ou 8 bpp indexés et 16 bpp " "ou plus : %d bpp fournis" +#: shared-module/displayio/ColorConverter.c +msgid "Only one color can be transparent at a time" +msgstr "" + #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" msgstr "IP n'accepte que les entiers bruts" diff --git a/locale/hi.po b/locale/hi.po index 485ce63988..bd6d5395bf 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 13:56-0500\n" +"POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -1403,6 +1403,10 @@ msgid "" "%d bpp given" msgstr "" +#: shared-module/displayio/ColorConverter.c +msgid "Only one color can be transparent at a time" +msgstr "" + #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 9d299b49b9..9ed3bb1e1c 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 13:56-0500\n" +"POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -1426,6 +1426,10 @@ msgid "" "%d bpp given" msgstr "" +#: shared-module/displayio/ColorConverter.c +msgid "Only one color can be transparent at a time" +msgstr "" + #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index ac883044cb..8c3751c8e8 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 13:56-0500\n" +"POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: 2020-09-25 18:20+0000\n" "Last-Translator: Taku Fukada \n" "Language-Team: none\n" @@ -1420,6 +1420,10 @@ msgid "" "%d bpp given" msgstr "" +#: shared-module/displayio/ColorConverter.c +msgid "Only one color can be transparent at a time" +msgstr "" + #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index dea656591c..9c5750b9f5 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 13:56-0500\n" +"POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: 2020-10-05 12:12+0000\n" "Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" @@ -1408,6 +1408,10 @@ msgid "" "%d bpp given" msgstr "" +#: shared-module/displayio/ColorConverter.c +msgid "Only one color can be transparent at a time" +msgstr "" + #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index ed75cdd8c1..ca7530c0fd 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 13:56-0500\n" +"POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: 2020-09-09 16:05+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -1426,6 +1426,10 @@ msgstr "" "Alleen monochrome en 4bpp of 8bpp, en 16bpp of grotere geïndiceerde BMP's " "zijn ondersteund: %d bpp is gegeven" +#: shared-module/displayio/ColorConverter.c +msgid "Only one color can be transparent at a time" +msgstr "" + #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index ec5fe5a65c..f6292a0a3b 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 13:56-0500\n" +"POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: 2020-09-29 01:39+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -1419,6 +1419,10 @@ msgid "" "%d bpp given" msgstr "" +#: shared-module/displayio/ColorConverter.c +msgid "Only one color can be transparent at a time" +msgstr "" + #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 20e7d68962..94ec881cb5 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 13:56-0500\n" +"POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: 2020-10-20 17:13+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -1434,6 +1434,10 @@ msgstr "" "São compatíveis apenas os BMPs monocromáticos, indexados em 4bpp ou 8bpp e " "16bpp ou superior: determinado %d bpp" +#: shared-module/displayio/ColorConverter.c +msgid "Only one color can be transparent at a time" +msgstr "" + #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" msgstr "Apenas o int bruto é compatível para o ip" diff --git a/locale/sv.po b/locale/sv.po index 42e8ce2c45..d4be9db170 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 13:56-0500\n" +"POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: 2020-10-14 18:12+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -1424,6 +1424,10 @@ msgstr "" "Endast monokrom, indexerad 4 bpp eller 8 bpp och 16 bpp eller högre BMP: er " "stöds: %d bpp angiven" +#: shared-module/displayio/ColorConverter.c +msgid "Only one color can be transparent at a time" +msgstr "" + #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" msgstr "Endast raw int stöds för ip" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 42c6e39d58..6ad1c722d5 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 13:56-0500\n" +"POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: 2020-10-17 02:31+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -1421,6 +1421,10 @@ 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" +#: shared-module/displayio/ColorConverter.c +msgid "Only one color can be transparent at a time" +msgstr "" + #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" msgstr "Ip jǐn zhīchí raw int" From 7d1c1c815df859eadbe180f4ca57df9a38bdec75 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Wed, 21 Oct 2020 04:15:35 +0000 Subject: [PATCH 1199/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (836 of 836 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 94ec881cb5..b80afeb1aa 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: 2020-10-16 19:50-0500\n" -"PO-Revision-Date: 2020-10-20 17:13+0000\n" +"PO-Revision-Date: 2020-10-21 19:58+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -1436,7 +1436,7 @@ msgstr "" #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" -msgstr "" +msgstr "Apenas uma cor pode ser transparente de cada vez" #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" From ff69ab603d0ccec3b44ce72e5f365a0c91d33b97 Mon Sep 17 00:00:00 2001 From: Jerry Needell Date: Wed, 21 Oct 2020 17:07:30 -0400 Subject: [PATCH 1200/1293] fix CPB SPI pin definitions --- ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h index 17b044b145..ef34465dcd 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h +++ b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h @@ -59,8 +59,8 @@ #define DEFAULT_I2C_BUS_SCL (&pin_P0_04) #define DEFAULT_I2C_BUS_SDA (&pin_P0_05) -#define DEFAULT_SPI_BUS_SCK (&pin_P0_05) -#define DEFAULT_SPI_BUS_MOSI (&pin_P1_03) +#define DEFAULT_SPI_BUS_SCK (&pin_P0_02) +#define DEFAULT_SPI_BUS_MOSI (&pin_P0_03) #define DEFAULT_SPI_BUS_MISO (&pin_P0_29) #define DEFAULT_UART_BUS_RX (&pin_P0_30) From 05e4172ea0999a03ec8d59b509de1ee0307515e4 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Wed, 21 Oct 2020 21:51:47 +0000 Subject: [PATCH 1201/1293] Translated using Weblate (Swedish) Currently translated at 100.0% (836 of 836 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index d4be9db170..22007e11f3 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: 2020-10-16 19:50-0500\n" -"PO-Revision-Date: 2020-10-14 18:12+0000\n" +"PO-Revision-Date: 2020-10-22 01:12+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.3-dev\n" +"X-Generator: Weblate 4.3.1\n" #: main.c msgid "" @@ -961,7 +961,7 @@ msgstr "Hårdvaran används redan, prova alternativa pinnar" #: shared-bindings/wifi/Radio.c msgid "Hostname must be between 1 and 253 characters" -msgstr "" +msgstr "Hostname måste vara mellan 1 och 253 tecken" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -1426,7 +1426,7 @@ msgstr "" #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" -msgstr "" +msgstr "Bara en färg kan vara genomskinlig i taget" #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" @@ -2161,7 +2161,7 @@ msgstr "buffert för liten" #: shared-bindings/socketpool/Socket.c msgid "buffer too small for requested bytes" -msgstr "" +msgstr "buffertför liten för begärd längd" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" @@ -2795,7 +2795,7 @@ msgstr "ogiltig formatspecificerare" #: shared-bindings/wifi/Radio.c msgid "invalid hostname" -msgstr "" +msgstr "Ogiltigt värdnamn" #: extmod/modussl_axtls.c msgid "invalid key" From f431f859e74a92099079bd8753c2319566dbf3c7 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Thu, 22 Oct 2020 21:32:44 +0530 Subject: [PATCH 1202/1293] Initial support for native touchio --- ports/esp32s2/common-hal/touchio/TouchIn.c | 109 ++++++++++++++++++++ ports/esp32s2/common-hal/touchio/TouchIn.h | 42 ++++++++ ports/esp32s2/common-hal/touchio/__init__.c | 1 + ports/esp32s2/mpconfigport.mk | 4 + ports/esp32s2/peripherals/pins.c | 95 +++++++++-------- ports/esp32s2/peripherals/pins.h | 1 + 6 files changed, 208 insertions(+), 44 deletions(-) create mode 100644 ports/esp32s2/common-hal/touchio/TouchIn.c create mode 100644 ports/esp32s2/common-hal/touchio/TouchIn.h create mode 100644 ports/esp32s2/common-hal/touchio/__init__.c diff --git a/ports/esp32s2/common-hal/touchio/TouchIn.c b/ports/esp32s2/common-hal/touchio/TouchIn.c new file mode 100644 index 0000000000..7d30d1a325 --- /dev/null +++ b/ports/esp32s2/common-hal/touchio/TouchIn.c @@ -0,0 +1,109 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 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/touchio/TouchIn.h" +#include "py/runtime.h" + +#include "driver/touch_pad.h" + +static const touch_pad_t touch_pad[] = { + TOUCH_PAD_NUM1, + TOUCH_PAD_NUM2, + TOUCH_PAD_NUM3, + TOUCH_PAD_NUM4, + TOUCH_PAD_NUM5, + TOUCH_PAD_NUM6, + TOUCH_PAD_NUM7, + TOUCH_PAD_NUM8, + TOUCH_PAD_NUM9, + TOUCH_PAD_NUM10, + TOUCH_PAD_NUM11, + TOUCH_PAD_NUM12, + TOUCH_PAD_NUM13, + TOUCH_PAD_NUM14 +}; + +static uint16_t get_raw_reading(touchio_touchin_obj_t *self) { + uint32_t touch_value; + touch_pad_read_raw_data(touch_pad[self->pin], &touch_value); + return touch_value; +} + +void common_hal_touchio_touchin_construct(touchio_touchin_obj_t* self, + const mcu_pin_obj_t *pin) { + if (!pin->has_touch) { + mp_raise_ValueError(translate("Invalid pin")); + } + claim_pin(pin); + + touch_pad_init(); + touch_pad_config(touch_pad[pin->number]); + + touch_pad_set_fsm_mode(TOUCH_FSM_MODE_TIMER); + touch_pad_fsm_start(); + + // Initial values for pins will vary, depending on what peripherals the pins + // share on-chip. + + // Set a "touched" threshold not too far above the initial value. + // For simple finger touch, the values may vary as much as a factor of two, + // but for touches using fruit or other objects, the difference is much less. + + self->pin = pin->number; + self->threshold = get_raw_reading(self) + 100; +} + +bool common_hal_touchio_touchin_deinited(touchio_touchin_obj_t* self) { + return self->pin == 0xff; +} + +void common_hal_touchio_touchin_deinit(touchio_touchin_obj_t* self) { + if (common_hal_touchio_touchin_deinited(self)) { + return; + } + + //touch_pad_deinit(); + + reset_pin_number(self->pin); + self->pin = 0xff; +} + +bool common_hal_touchio_touchin_get_value(touchio_touchin_obj_t *self) { + uint16_t reading = get_raw_reading(self); + return reading > self->threshold; +} + +uint16_t common_hal_touchio_touchin_get_raw_value(touchio_touchin_obj_t *self) { + return get_raw_reading(self); +} + +uint16_t common_hal_touchio_touchin_get_threshold(touchio_touchin_obj_t *self) { + return self->threshold; +} + +void common_hal_touchio_touchin_set_threshold(touchio_touchin_obj_t *self, uint16_t new_threshold) { + self->threshold = new_threshold; +} diff --git a/ports/esp32s2/common-hal/touchio/TouchIn.h b/ports/esp32s2/common-hal/touchio/TouchIn.h new file mode 100644 index 0000000000..81d80c9dd9 --- /dev/null +++ b/ports/esp32s2/common-hal/touchio/TouchIn.h @@ -0,0 +1,42 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * 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_ESP32S2_COMMON_HAL_TOUCHIO_TOUCHIN_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_TOUCHIO_TOUCHIN_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + uint8_t pin; + uint16_t threshold; +} touchio_touchin_obj_t; + +void touchin_reset(void); + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_TOUCHIO_TOUCHIN_H diff --git a/ports/esp32s2/common-hal/touchio/__init__.c b/ports/esp32s2/common-hal/touchio/__init__.c new file mode 100644 index 0000000000..d2290447c9 --- /dev/null +++ b/ports/esp32s2/common-hal/touchio/__init__.c @@ -0,0 +1 @@ +// No touchio module functions. diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 4e8a7bdef2..60a3a14ca9 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -26,4 +26,8 @@ CIRCUITPY_USB_MIDI = 0 CIRCUITPY_WIFI = 1 CIRCUITPY_ESPIDF = 1 +ifndef CIRCUITPY_TOUCHIO_USE_NATIVE +CIRCUITPY_TOUCHIO_USE_NATIVE = 1 +endif + CIRCUITPY_MODULE ?= none diff --git a/ports/esp32s2/peripherals/pins.c b/ports/esp32s2/peripherals/pins.c index 2c8b61c627..e372c84b1d 100755 --- a/ports/esp32s2/peripherals/pins.c +++ b/ports/esp32s2/peripherals/pins.c @@ -29,55 +29,62 @@ #define NO_ADC 0 #define NO_ADC_CHANNEL ADC_CHANNEL_MAX +#define TOUCH \ + .has_touch = true, + +#define NO_TOUCH \ + .has_touch = false, + // This macro is used to simplify pin definition in boards//pins.c -#define PIN(p_name, p_number, p_adc_index, p_adc_channel) \ +#define PIN(p_name, p_number, p_adc_index, p_adc_channel, p_touch_channel) \ const mcu_pin_obj_t pin_## p_name = { \ PIN_PREFIX_VALUES \ .number = p_number, \ .adc_index = p_adc_index, \ .adc_channel = p_adc_channel, \ + p_touch_channel \ } -PIN(GPIO0, 0, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO1, 1, ADC_UNIT_1, ADC_CHANNEL_0); -PIN(GPIO2, 2, ADC_UNIT_1, ADC_CHANNEL_1); -PIN(GPIO3, 3, ADC_UNIT_1, ADC_CHANNEL_2); -PIN(GPIO4, 4, ADC_UNIT_1, ADC_CHANNEL_3); -PIN(GPIO5, 5, ADC_UNIT_1, ADC_CHANNEL_4); -PIN(GPIO6, 6, ADC_UNIT_1, ADC_CHANNEL_5); -PIN(GPIO7, 7, ADC_UNIT_1, ADC_CHANNEL_6); -PIN(GPIO8, 8, ADC_UNIT_1, ADC_CHANNEL_7); -PIN(GPIO9, 9, ADC_UNIT_1, ADC_CHANNEL_8); -PIN(GPIO10, 10, ADC_UNIT_1, ADC_CHANNEL_9); -PIN(GPIO11, 11, ADC_UNIT_2, ADC_CHANNEL_0); -PIN(GPIO12, 12, ADC_UNIT_2, ADC_CHANNEL_1); -PIN(GPIO13, 13, ADC_UNIT_2, ADC_CHANNEL_2); -PIN(GPIO14, 14, ADC_UNIT_2, ADC_CHANNEL_3); -PIN(GPIO15, 15, ADC_UNIT_2, ADC_CHANNEL_4); -PIN(GPIO16, 16, ADC_UNIT_2, ADC_CHANNEL_5); -PIN(GPIO17, 17, ADC_UNIT_2, ADC_CHANNEL_6); -PIN(GPIO18, 18, ADC_UNIT_2, ADC_CHANNEL_7); -PIN(GPIO19, 19, ADC_UNIT_2, ADC_CHANNEL_8); -PIN(GPIO20, 20, ADC_UNIT_2, ADC_CHANNEL_9); -PIN(GPIO21, 21, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO26, 26, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO27, 27, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO28, 28, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO29, 29, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO30, 30, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO31, 31, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO32, 32, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO33, 33, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO34, 34, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO35, 35, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO36, 36, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO37, 37, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO38, 38, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO39, 39, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO40, 40, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO41, 41, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO42, 42, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO43, 43, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO44, 44, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO45, 45, NO_ADC, NO_ADC_CHANNEL); -PIN(GPIO46, 46, NO_ADC, NO_ADC_CHANNEL); +PIN(GPIO0, 0, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO1, 1, ADC_UNIT_1, ADC_CHANNEL_0, TOUCH); +PIN(GPIO2, 2, ADC_UNIT_1, ADC_CHANNEL_1, TOUCH); +PIN(GPIO3, 3, ADC_UNIT_1, ADC_CHANNEL_2, TOUCH); +PIN(GPIO4, 4, ADC_UNIT_1, ADC_CHANNEL_3, TOUCH); +PIN(GPIO5, 5, ADC_UNIT_1, ADC_CHANNEL_4, TOUCH); +PIN(GPIO6, 6, ADC_UNIT_1, ADC_CHANNEL_5, TOUCH); +PIN(GPIO7, 7, ADC_UNIT_1, ADC_CHANNEL_6, TOUCH); +PIN(GPIO8, 8, ADC_UNIT_1, ADC_CHANNEL_7, TOUCH); +PIN(GPIO9, 9, ADC_UNIT_1, ADC_CHANNEL_8, TOUCH); +PIN(GPIO10, 10, ADC_UNIT_1, ADC_CHANNEL_9, TOUCH); +PIN(GPIO11, 11, ADC_UNIT_2, ADC_CHANNEL_0, TOUCH); +PIN(GPIO12, 12, ADC_UNIT_2, ADC_CHANNEL_1, TOUCH); +PIN(GPIO13, 13, ADC_UNIT_2, ADC_CHANNEL_2, TOUCH); +PIN(GPIO14, 14, ADC_UNIT_2, ADC_CHANNEL_3, TOUCH); +PIN(GPIO15, 15, ADC_UNIT_2, ADC_CHANNEL_4, NO_TOUCH); +PIN(GPIO16, 16, ADC_UNIT_2, ADC_CHANNEL_5, NO_TOUCH); +PIN(GPIO17, 17, ADC_UNIT_2, ADC_CHANNEL_6, NO_TOUCH); +PIN(GPIO18, 18, ADC_UNIT_2, ADC_CHANNEL_7, NO_TOUCH); +PIN(GPIO19, 19, ADC_UNIT_2, ADC_CHANNEL_8, NO_TOUCH); +PIN(GPIO20, 20, ADC_UNIT_2, ADC_CHANNEL_9, NO_TOUCH); +PIN(GPIO21, 21, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO26, 26, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO27, 27, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO28, 28, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO29, 29, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO30, 30, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO31, 31, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO32, 32, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO33, 33, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO34, 34, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO35, 35, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO36, 36, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO37, 37, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO38, 38, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO39, 39, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO40, 40, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO41, 41, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO42, 42, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO43, 43, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO44, 44, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO45, 45, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO46, 46, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); diff --git a/ports/esp32s2/peripherals/pins.h b/ports/esp32s2/peripherals/pins.h index 84123a80e6..8be57f320f 100644 --- a/ports/esp32s2/peripherals/pins.h +++ b/ports/esp32s2/peripherals/pins.h @@ -41,6 +41,7 @@ typedef struct { PIN_PREFIX_FIELDS gpio_num_t number; + bool has_touch:1; uint8_t adc_index:2; uint8_t adc_channel:6; } mcu_pin_obj_t; From b520498c733356afdc418bd5a9841c7496a3926e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 1 Oct 2020 10:30:35 -0500 Subject: [PATCH 1203/1293] sharpdisplay: Re-use supervisor allocations if possible This is enabled by #3482 I was unable to determine why previously I had added sizeof(void*) to the GC heap allocation, so I removed that code as a mistake. --- .../sharpdisplay/SharpMemoryFramebuffer.c | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/shared-module/sharpdisplay/SharpMemoryFramebuffer.c b/shared-module/sharpdisplay/SharpMemoryFramebuffer.c index c234468283..b199e98d63 100644 --- a/shared-module/sharpdisplay/SharpMemoryFramebuffer.c +++ b/shared-module/sharpdisplay/SharpMemoryFramebuffer.c @@ -34,21 +34,22 @@ #include "shared-module/sharpdisplay/SharpMemoryFramebuffer.h" #include "supervisor/memory.h" +#include "supervisor/shared/safe_mode.h" #define SHARPMEM_BIT_WRITECMD_LSB (0x80) #define SHARPMEM_BIT_VCOM_LSB (0x40) -static inline void *hybrid_alloc(size_t sz) { - if (gc_alloc_possible()) { - return m_malloc(sz + sizeof(void*), true); - } else { - supervisor_allocation *allocation = allocate_memory(align32_size(sz), false); - if (!allocation) { - return NULL; - } +static void *hybrid_alloc(size_t sz) { + supervisor_allocation *allocation = allocate_memory(align32_size(sz), false); + if (allocation) { memset(allocation->ptr, 0, sz); return allocation->ptr; } + if (gc_alloc_possible()) { + return m_malloc(sz, true); + } + reset_into_safe_mode(MEM_MANAGE); + return NULL; // unreached } static inline void hybrid_free(void *ptr_in) { @@ -155,7 +156,8 @@ void common_hal_sharpdisplay_framebuffer_construct(sharpdisplay_framebuffer_obj_ int row_stride = common_hal_sharpdisplay_framebuffer_get_row_stride(self); self->bufinfo.len = row_stride * height + 2; - self->bufinfo.buf = gc_alloc(self->bufinfo.len, false, true); + // re-use a supervisor allocation if possible + self->bufinfo.buf = hybrid_alloc(self->bufinfo.len); uint8_t *data = self->bufinfo.buf; *data++ = SHARPMEM_BIT_WRITECMD_LSB; From 04cf88deae155f99995e510270fd133ed2039f45 Mon Sep 17 00:00:00 2001 From: Antonin ENFRUN Date: Thu, 22 Oct 2020 07:50:31 +0000 Subject: [PATCH 1204/1293] Translated using Weblate (French) Currently translated at 100.0% (836 of 836 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 9bfc14428a..cf0ea4fc31 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: 2020-10-16 19:50-0500\n" -"PO-Revision-Date: 2020-10-17 15:35+0000\n" +"PO-Revision-Date: 2020-10-22 20:48+0000\n" "Last-Translator: Antonin ENFRUN \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.3.1-dev\n" +"X-Generator: Weblate 4.3.1\n" #: main.c msgid "" @@ -1439,7 +1439,7 @@ msgstr "" #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" -msgstr "" +msgstr "Une seule couleur peut être transparente à la fois" #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" @@ -2185,7 +2185,7 @@ msgstr "tampon trop petit" #: shared-bindings/socketpool/Socket.c msgid "buffer too small for requested bytes" -msgstr "" +msgstr "tampon trop petit pour le nombre d'octets demandé" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" From f4f6b082b46ae91ea9647bca5166bb0e6851b452 Mon Sep 17 00:00:00 2001 From: hexthat Date: Thu, 22 Oct 2020 02:52:04 +0000 Subject: [PATCH 1205/1293] Translated using Weblate (Chinese (Pinyin)) Currently translated at 100.0% (836 of 836 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/zh_Latn/ --- locale/zh_Latn_pinyin.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 6ad1c722d5..13d0dfa796 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: 2020-10-16 19:50-0500\n" -"PO-Revision-Date: 2020-10-17 02:31+0000\n" +"PO-Revision-Date: 2020-10-22 20:48+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" @@ -15,7 +15,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.3.1-dev\n" +"X-Generator: Weblate 4.3.1\n" #: main.c msgid "" @@ -1423,7 +1423,7 @@ msgstr "" #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" -msgstr "" +msgstr "Yīcì zhǐ néng yǒuyī zhǒng yánsè shì tòumíng de" #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" @@ -2153,7 +2153,7 @@ msgstr "huǎnchōng qū tài xiǎo" #: shared-bindings/socketpool/Socket.c msgid "buffer too small for requested bytes" -msgstr "" +msgstr "huǎn chōng qū tài xiǎo, duì yú qǐng qiú de zì jié" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" From 73aae6bbcd10abac422199b2f484859f1a4c83fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tino=20Mart=C3=ADnez?= <43123591+tinomtzlpz@users.noreply.github.com> Date: Thu, 22 Oct 2020 16:09:17 -0500 Subject: [PATCH 1206/1293] Update es.po Fixed typos UARL -> UART --- locale/es.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/es.po b/locale/es.po index 8cd5e6c22b..7b6dac46ea 100644 --- a/locale/es.po +++ b/locale/es.po @@ -1826,15 +1826,15 @@ msgstr "No se pudo encontrar el búfer para UART" #: ports/stm/common-hal/busio/UART.c msgid "UART De-init error" -msgstr "Error de desinicialización de UARL" +msgstr "Error de desinicialización de UART" #: ports/stm/common-hal/busio/UART.c msgid "UART Init Error" -msgstr "Error de inicialización de UARL" +msgstr "Error de inicialización de UART" #: ports/stm/common-hal/busio/UART.c msgid "UART Re-init error" -msgstr "Error de reinicialización de UARL" +msgstr "Error de reinicialización de UART" #: ports/stm/common-hal/busio/UART.c msgid "UART write error" From efd8f1ab888d1b72c4b25972e2e2d54ded3af455 Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Thu, 22 Oct 2020 22:02:25 +0000 Subject: [PATCH 1207/1293] Translated using Weblate (Spanish) Currently translated at 100.0% (836 of 836 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/es.po b/locale/es.po index 8cd5e6c22b..b3a4333a80 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-16 19:50-0500\n" -"PO-Revision-Date: 2020-10-17 02:31+0000\n" +"PO-Revision-Date: 2020-10-22 22:15+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" @@ -16,7 +16,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.3.1-dev\n" +"X-Generator: Weblate 4.3.1\n" #: main.c msgid "" @@ -1434,7 +1434,7 @@ msgstr "" #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" -msgstr "" +msgstr "Solo un color puede ser transparente a la vez" #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" @@ -2175,7 +2175,7 @@ msgstr "buffer demasiado pequeño" #: shared-bindings/socketpool/Socket.c msgid "buffer too small for requested bytes" -msgstr "" +msgstr "búfer muy pequeño para los bytes solicitados" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" From ef97ed6ab6938bc9c12987d7584cbc715a0f85bf Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Fri, 23 Oct 2020 13:17:49 +0530 Subject: [PATCH 1208/1293] Update touchio implementation --- ports/esp32s2/common-hal/touchio/TouchIn.c | 41 ++++------ ports/esp32s2/common-hal/touchio/TouchIn.h | 2 +- ports/esp32s2/peripherals/pins.c | 94 +++++++++++----------- ports/esp32s2/peripherals/pins.h | 3 +- 4 files changed, 62 insertions(+), 78 deletions(-) diff --git a/ports/esp32s2/common-hal/touchio/TouchIn.c b/ports/esp32s2/common-hal/touchio/TouchIn.c index 7d30d1a325..3e3e4b5511 100644 --- a/ports/esp32s2/common-hal/touchio/TouchIn.c +++ b/ports/esp32s2/common-hal/touchio/TouchIn.c @@ -29,42 +29,31 @@ #include "driver/touch_pad.h" -static const touch_pad_t touch_pad[] = { - TOUCH_PAD_NUM1, - TOUCH_PAD_NUM2, - TOUCH_PAD_NUM3, - TOUCH_PAD_NUM4, - TOUCH_PAD_NUM5, - TOUCH_PAD_NUM6, - TOUCH_PAD_NUM7, - TOUCH_PAD_NUM8, - TOUCH_PAD_NUM9, - TOUCH_PAD_NUM10, - TOUCH_PAD_NUM11, - TOUCH_PAD_NUM12, - TOUCH_PAD_NUM13, - TOUCH_PAD_NUM14 -}; - static uint16_t get_raw_reading(touchio_touchin_obj_t *self) { uint32_t touch_value; - touch_pad_read_raw_data(touch_pad[self->pin], &touch_value); + touch_pad_read_raw_data((touch_pad_t)self->pin->touch_channel, &touch_value); + if (touch_value > UINT16_MAX) { + return UINT16_MAX; + } return touch_value; } void common_hal_touchio_touchin_construct(touchio_touchin_obj_t* self, const mcu_pin_obj_t *pin) { - if (!pin->has_touch) { + if (pin->touch_channel == TOUCH_PAD_MAX) { mp_raise_ValueError(translate("Invalid pin")); } claim_pin(pin); touch_pad_init(); - touch_pad_config(touch_pad[pin->number]); + touch_pad_config((touch_pad_t)pin->touch_channel); touch_pad_set_fsm_mode(TOUCH_FSM_MODE_TIMER); touch_pad_fsm_start(); + // wait for "raw data" to reset + mp_hal_delay_ms(10); + // Initial values for pins will vary, depending on what peripherals the pins // share on-chip. @@ -72,23 +61,21 @@ void common_hal_touchio_touchin_construct(touchio_touchin_obj_t* self, // For simple finger touch, the values may vary as much as a factor of two, // but for touches using fruit or other objects, the difference is much less. - self->pin = pin->number; + self->pin = pin; self->threshold = get_raw_reading(self) + 100; } bool common_hal_touchio_touchin_deinited(touchio_touchin_obj_t* self) { - return self->pin == 0xff; + return self->pin == NULL; } void common_hal_touchio_touchin_deinit(touchio_touchin_obj_t* self) { if (common_hal_touchio_touchin_deinited(self)) { return; } - - //touch_pad_deinit(); - - reset_pin_number(self->pin); - self->pin = 0xff; + touch_pad_deinit(); + reset_pin_number(self->pin->touch_channel); + self->pin = NULL; } bool common_hal_touchio_touchin_get_value(touchio_touchin_obj_t *self) { diff --git a/ports/esp32s2/common-hal/touchio/TouchIn.h b/ports/esp32s2/common-hal/touchio/TouchIn.h index 81d80c9dd9..585bb37bf1 100644 --- a/ports/esp32s2/common-hal/touchio/TouchIn.h +++ b/ports/esp32s2/common-hal/touchio/TouchIn.h @@ -33,7 +33,7 @@ typedef struct { mp_obj_base_t base; - uint8_t pin; + const mcu_pin_obj_t * pin; uint16_t threshold; } touchio_touchin_obj_t; diff --git a/ports/esp32s2/peripherals/pins.c b/ports/esp32s2/peripherals/pins.c index e372c84b1d..0d3d89ad50 100755 --- a/ports/esp32s2/peripherals/pins.c +++ b/ports/esp32s2/peripherals/pins.c @@ -29,11 +29,7 @@ #define NO_ADC 0 #define NO_ADC_CHANNEL ADC_CHANNEL_MAX -#define TOUCH \ - .has_touch = true, - -#define NO_TOUCH \ - .has_touch = false, +#define NO_TOUCH_CHANNEL TOUCH_PAD_MAX // This macro is used to simplify pin definition in boards//pins.c #define PIN(p_name, p_number, p_adc_index, p_adc_channel, p_touch_channel) \ @@ -42,49 +38,49 @@ const mcu_pin_obj_t pin_## p_name = { \ .number = p_number, \ .adc_index = p_adc_index, \ .adc_channel = p_adc_channel, \ - p_touch_channel \ + .touch_channel = p_touch_channel, \ } -PIN(GPIO0, 0, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO1, 1, ADC_UNIT_1, ADC_CHANNEL_0, TOUCH); -PIN(GPIO2, 2, ADC_UNIT_1, ADC_CHANNEL_1, TOUCH); -PIN(GPIO3, 3, ADC_UNIT_1, ADC_CHANNEL_2, TOUCH); -PIN(GPIO4, 4, ADC_UNIT_1, ADC_CHANNEL_3, TOUCH); -PIN(GPIO5, 5, ADC_UNIT_1, ADC_CHANNEL_4, TOUCH); -PIN(GPIO6, 6, ADC_UNIT_1, ADC_CHANNEL_5, TOUCH); -PIN(GPIO7, 7, ADC_UNIT_1, ADC_CHANNEL_6, TOUCH); -PIN(GPIO8, 8, ADC_UNIT_1, ADC_CHANNEL_7, TOUCH); -PIN(GPIO9, 9, ADC_UNIT_1, ADC_CHANNEL_8, TOUCH); -PIN(GPIO10, 10, ADC_UNIT_1, ADC_CHANNEL_9, TOUCH); -PIN(GPIO11, 11, ADC_UNIT_2, ADC_CHANNEL_0, TOUCH); -PIN(GPIO12, 12, ADC_UNIT_2, ADC_CHANNEL_1, TOUCH); -PIN(GPIO13, 13, ADC_UNIT_2, ADC_CHANNEL_2, TOUCH); -PIN(GPIO14, 14, ADC_UNIT_2, ADC_CHANNEL_3, TOUCH); -PIN(GPIO15, 15, ADC_UNIT_2, ADC_CHANNEL_4, NO_TOUCH); -PIN(GPIO16, 16, ADC_UNIT_2, ADC_CHANNEL_5, NO_TOUCH); -PIN(GPIO17, 17, ADC_UNIT_2, ADC_CHANNEL_6, NO_TOUCH); -PIN(GPIO18, 18, ADC_UNIT_2, ADC_CHANNEL_7, NO_TOUCH); -PIN(GPIO19, 19, ADC_UNIT_2, ADC_CHANNEL_8, NO_TOUCH); -PIN(GPIO20, 20, ADC_UNIT_2, ADC_CHANNEL_9, NO_TOUCH); -PIN(GPIO21, 21, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO26, 26, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO27, 27, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO28, 28, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO29, 29, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO30, 30, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO31, 31, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO32, 32, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO33, 33, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO34, 34, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO35, 35, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO36, 36, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO37, 37, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO38, 38, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO39, 39, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO40, 40, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO41, 41, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO42, 42, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO43, 43, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO44, 44, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO45, 45, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); -PIN(GPIO46, 46, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH); +PIN(GPIO0, 0, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO1, 1, ADC_UNIT_1, ADC_CHANNEL_0, TOUCH_PAD_NUM1); +PIN(GPIO2, 2, ADC_UNIT_1, ADC_CHANNEL_1, TOUCH_PAD_NUM2); +PIN(GPIO3, 3, ADC_UNIT_1, ADC_CHANNEL_2, TOUCH_PAD_NUM3); +PIN(GPIO4, 4, ADC_UNIT_1, ADC_CHANNEL_3, TOUCH_PAD_NUM4); +PIN(GPIO5, 5, ADC_UNIT_1, ADC_CHANNEL_4, TOUCH_PAD_NUM5); +PIN(GPIO6, 6, ADC_UNIT_1, ADC_CHANNEL_5, TOUCH_PAD_NUM6); +PIN(GPIO7, 7, ADC_UNIT_1, ADC_CHANNEL_6, TOUCH_PAD_NUM7); +PIN(GPIO8, 8, ADC_UNIT_1, ADC_CHANNEL_7, TOUCH_PAD_NUM8); +PIN(GPIO9, 9, ADC_UNIT_1, ADC_CHANNEL_8, TOUCH_PAD_NUM9); +PIN(GPIO10, 10, ADC_UNIT_1, ADC_CHANNEL_9, TOUCH_PAD_NUM10); +PIN(GPIO11, 11, ADC_UNIT_2, ADC_CHANNEL_0, TOUCH_PAD_NUM11); +PIN(GPIO12, 12, ADC_UNIT_2, ADC_CHANNEL_1, TOUCH_PAD_NUM12); +PIN(GPIO13, 13, ADC_UNIT_2, ADC_CHANNEL_2, TOUCH_PAD_NUM13); +PIN(GPIO14, 14, ADC_UNIT_2, ADC_CHANNEL_3, TOUCH_PAD_NUM14); +PIN(GPIO15, 15, ADC_UNIT_2, ADC_CHANNEL_4, NO_TOUCH_CHANNEL); +PIN(GPIO16, 16, ADC_UNIT_2, ADC_CHANNEL_5, NO_TOUCH_CHANNEL); +PIN(GPIO17, 17, ADC_UNIT_2, ADC_CHANNEL_6, NO_TOUCH_CHANNEL); +PIN(GPIO18, 18, ADC_UNIT_2, ADC_CHANNEL_7, NO_TOUCH_CHANNEL); +PIN(GPIO19, 19, ADC_UNIT_2, ADC_CHANNEL_8, NO_TOUCH_CHANNEL); +PIN(GPIO20, 20, ADC_UNIT_2, ADC_CHANNEL_9, NO_TOUCH_CHANNEL); +PIN(GPIO21, 21, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO26, 26, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO27, 27, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO28, 28, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO29, 29, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO30, 30, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO31, 31, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO32, 32, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO33, 33, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO34, 34, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO35, 35, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO36, 36, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO37, 37, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO38, 38, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO39, 39, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO40, 40, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO41, 41, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO42, 42, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO43, 43, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO44, 44, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO45, 45, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +PIN(GPIO46, 46, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); diff --git a/ports/esp32s2/peripherals/pins.h b/ports/esp32s2/peripherals/pins.h index 8be57f320f..c78eb83851 100644 --- a/ports/esp32s2/peripherals/pins.h +++ b/ports/esp32s2/peripherals/pins.h @@ -37,13 +37,14 @@ #include "components/hal/include/hal/gpio_types.h" #include "components/hal/include/hal/adc_types.h" +#include "components/hal/include/hal/touch_sensor_types.h" typedef struct { PIN_PREFIX_FIELDS gpio_num_t number; - bool has_touch:1; uint8_t adc_index:2; uint8_t adc_channel:6; + uint8_t touch_channel; } mcu_pin_obj_t; extern const mcu_pin_obj_t pin_GPIO0; From 2ebd06f8ee3d5818cd0c61468a7e12072b59c973 Mon Sep 17 00:00:00 2001 From: 0-Arngerdur-1 Date: Fri, 23 Oct 2020 15:14:45 -0500 Subject: [PATCH 1209/1293] Fix typos and fix translate --- locale/es.po | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/locale/es.po b/locale/es.po index b3a4333a80..e2ae41ee3d 100644 --- a/locale/es.po +++ b/locale/es.po @@ -168,7 +168,7 @@ msgstr "'%s' espera un registro" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects a special register" -msgstr "'%s' espera un carácter" +msgstr "'%s' espera un registro especial" #: py/emitinlinethumb.c #, c-format @@ -239,7 +239,7 @@ msgstr "el objeto 'coroutine' no es un iterador" #: py/compile.c msgid "'data' requires at least 2 arguments" -msgstr "'data' requiere como minomo 2 argumentos" +msgstr "'data' requiere como mínimo 2 argumentos" #: py/compile.c msgid "'data' requires integer arguments" @@ -255,7 +255,7 @@ msgstr "'return' fuera de una función" #: py/compile.c msgid "'yield from' inside async function" -msgstr "'yield from' dentro función asincrónica" +msgstr "'yield from' dentro de una función asincrónica" #: py/compile.c msgid "'yield' outside function" @@ -289,7 +289,7 @@ msgstr "ADC2 está siendo usado por WiFi" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" -msgstr "La dirección debe ser %d bytes de largo" +msgstr "La dirección debe tener %d bytes de largo" #: shared-bindings/_bleio/Address.c msgid "Address type out of range" @@ -318,9 +318,7 @@ msgstr "Todos los canales de eventos estan siendo usados" #: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "All sync event channels in use" -msgstr "" -"Todos los canales de eventos de sincronización (sync event channels) están " -"siendo utilizados" +msgstr "Todos los canales de eventos de sincronización (sync event channels) están siendo utilizados" #: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" @@ -347,7 +345,7 @@ msgstr "Ya se encuentra publicando." #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Already have all-matches listener" -msgstr "Ya se tiene un escucha todas-las-coincidencias" +msgstr "Ya se tiene un escucha de todas las coincidencias" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c @@ -370,7 +368,7 @@ msgstr "Funcionalidad AnalogOut no soportada" #: shared-bindings/analogio/AnalogOut.c msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut es solo de 16 bits. Value debe ser menos a 65536." +msgstr "AnalogOut es solo de 16 bits. El valor debe ser menor que 65536." #: ports/atmel-samd/common-hal/analogio/AnalogOut.c msgid "AnalogOut not supported on given pin" @@ -383,7 +381,7 @@ msgstr "Otro envío ya está activo" #: shared-bindings/pulseio/PulseOut.c msgid "Array must contain halfwords (type 'H')" -msgstr "Array debe contener media palabra (type 'H')" +msgstr "El array debe contener medias palabras (escriba 'H')" #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." @@ -4013,7 +4011,7 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgstr "Falló el iniciar borrado de flash, err 0x%04x" #~ msgid "Flash write failed" -#~ msgstr "Falló la escritura" +#~ msgstr "Falló la escritura flash" #~ msgid "Flash write failed to start, err 0x%04x" #~ msgstr "Falló el iniciar la escritura de flash, err 0x%04x" @@ -4070,7 +4068,7 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgstr "Sin soporte PulseIn para %q" #~ msgid "No hardware support for analog out." -#~ msgstr "Sin soporte de hardware para analog out" +#~ msgstr "Sin soporte de hardware para salida analógica" #~ msgid "Not connected." #~ msgstr "No conectado." @@ -4079,24 +4077,24 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgstr "Solo formato Windows, BMP sin comprimir soportado %d" #~ msgid "Only bit maps of 8 bit color or less are supported" -#~ msgstr "Solo se admiten bit maps de color de 8 bits o menos" +#~ msgstr "Solo se admiten mapas de bits de color de 8 bits o menos" #~ msgid "" #~ "Only monochrome, indexed 8bpp, and 16bpp or greater BMPs supported: %d " #~ "bpp given" #~ msgstr "" #~ "Solo se admiten BMP monocromos, indexados de 8bpp y 16bpp o superiores:%d " -#~ "bppdado" +#~ "bpp dado" #, fuzzy #~ msgid "Only slices with step=1 (aka None) are supported" -#~ msgstr "solo se admiten segmentos con step=1 (alias None)" +#~ msgstr "Solo se admiten segmentos con step=1 (alias None)" #~ msgid "Only true color (24 bpp or higher) BMP supported %x" #~ msgstr "Solo color verdadero (24 bpp o superior) BMP admitido %x" #~ msgid "Only tx supported on UART1 (GPIO2)." -#~ msgstr "Solo tx soportada en UART1 (GPIO2)" +#~ msgstr "Solo tx soportada en UART1 (GPIO2)." #~ msgid "PWM not supported on pin %d" #~ msgstr "El pin %d no soporta PWM" @@ -4111,11 +4109,11 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgstr "Pines no válidos para SPI" #~ msgid "Pixel beyond bounds of buffer" -#~ msgstr "Pixel beyond bounds of buffer" +#~ msgstr "Píxel fuera de los límites del búfer" #, fuzzy #~ msgid "Range out of bounds" -#~ msgstr "address fuera de límites" +#~ msgstr "Rango fuera de límites" #~ msgid "STA must be active" #~ msgstr "STA debe estar activo" @@ -4135,10 +4133,10 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgstr "" #~ "El heap de CircuitPython estaba corrupto porque el stack era demasiado " #~ "pequeño.\n" -#~ "Aumente los límites del tamaño del stacj y presione reset (después de " +#~ "Aumente los límites del tamaño del stack y presione reset (después de " #~ "expulsarCIRCUITPY).\n" #~ "Si no cambió el stack, entonces reporte un issue aquí con el contenido " -#~ "desu unidad CIRCUITPY:\n" +#~ "de su unidad CIRCUITPY:\n" #~ msgid "" #~ "The microcontroller's power dipped. Please make sure your power supply " @@ -4191,7 +4189,7 @@ msgstr "zi debe ser una forma (n_section,2)" #~ "malo ha sucedido.\n" #~ msgid "bad GATT role" -#~ msgstr "mal GATT role" +#~ msgstr "rol de GATT malo" #~ msgid "bits must be 8" #~ msgstr "bits debe ser 8" @@ -4224,7 +4222,7 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgstr "no se puede establecer STA config" #~ msgid "characteristics includes an object that is not a Characteristic" -#~ msgstr "characteristics incluye un objeto que no es una Characteristica" +#~ msgstr "characteristics incluye un objeto que no es una Characteristic" #~ msgid "color buffer must be a buffer or int" #~ msgstr "color buffer deber ser un buffer o un int" From b4eb27557d98084024e9392dcb64bf9724c04517 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 24 Oct 2020 07:26:01 -0500 Subject: [PATCH 1210/1293] workflows: Upload stubs to s3 --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa576bbf0a..0792d36a01 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -111,11 +111,13 @@ jobs: with: name: mpy-cross.static-x64-windows path: mpy-cross/mpy-cross.static.exe - - name: Upload mpy-cross builds to S3 + - name: Upload stubs and mpy-cross builds to S3 run: | [ -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 + zip -9 circuitpython-stubs.CP_VERSION }}.zip stubs + [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/mpy-cross/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From 4cad5478e6b6abe6c15546fee4d1a81e180f6d15 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 24 Oct 2020 13:15:50 -0500 Subject: [PATCH 1211/1293] ulab: Incorporate bugfixes (update to tag 0.54.5) In particular, this closes #3954. --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index 11a7ecff6d..7f2c1ae52b 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 11a7ecff6d76a02644ff23a734b792afaa615e44 +Subproject commit 7f2c1ae52bee57ce32ac0a74652610cc233d3442 From 543316a8fbaa78db485c1135b8f9ee5c2d1982e3 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 25 Oct 2020 13:26:55 -0500 Subject: [PATCH 1212/1293] ulab: Update again .. pull in various doc build fixes that prevented the previous commit from building. This is still "0.54.5", the tag was updated in micropython-ulab (since no functional difference was introduced, only doc and CI differences, I imagine) --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index 7f2c1ae52b..8242b84753 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 7f2c1ae52bee57ce32ac0a74652610cc233d3442 +Subproject commit 8242b84753355433b61230ab6631c06e5ac77f35 From 85aa851714f8bc24817b2d56b3286419b43b537a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 25 Oct 2020 15:21:13 -0500 Subject: [PATCH 1213/1293] make translate --- locale/circuitpython.pot | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index cf92b0584a..cc058e61a2 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-25 15:21-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2863,6 +2863,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3295,6 +3303,10 @@ msgstr "" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "sorted axis can't be longer than 65535" +msgstr "" + #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" From c43011f149b981b4f9919a221f4ad4e9861b43a1 Mon Sep 17 00:00:00 2001 From: Senuros Date: Sun, 25 Oct 2020 22:08:10 +0100 Subject: [PATCH 1214/1293] Improving German translation --- locale/de_DE.po | 62 ++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index e54b670a90..0e2e5a038e 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -73,7 +73,7 @@ msgstr "Der Index %q befindet sich außerhalb des Bereiches" #: py/obj.c msgid "%q indices must be integers, not %q" -msgstr "" +msgstr "%q Indizes müssen Integer sein, nicht %q" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -81,7 +81,7 @@ msgstr "%q Liste muss eine Liste sein" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" -msgstr "" +msgstr "%q muss >= 0 sein" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -97,11 +97,11 @@ msgstr "%q muss ein Tupel der Länge 2 sein" #: shared-bindings/canio/Match.c msgid "%q out of range" -msgstr "" +msgstr "%q außerhalb des Bereichs" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" -msgstr "" +msgstr "%q Pin ungültig" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" @@ -117,11 +117,11 @@ msgstr "'%q' Argument erforderlich" #: py/runtime.c msgid "'%q' object cannot assign attribute '%q'" -msgstr "" +msgstr "'%q' Objekt kann das Attribut '%q' nicht zuweisen" #: py/proto.c msgid "'%q' object does not support '%q'" -msgstr "" +msgstr "'%q' Objekt unterstützt '%q' nicht" #: py/obj.c msgid "'%q' object does not support item assignment" @@ -129,11 +129,11 @@ msgstr "" #: py/obj.c msgid "'%q' object does not support item deletion" -msgstr "" +msgstr "'%q' objekt unterstützt das " #: py/runtime.c msgid "'%q' object has no attribute '%q'" -msgstr "" +msgstr "'%q' Objekt hat kein Attribut '%q'" #: py/runtime.c msgid "'%q' object is not an iterator" @@ -141,7 +141,7 @@ msgstr "" #: py/objtype.c py/runtime.c msgid "'%q' object is not callable" -msgstr "" +msgstr "'%q' Objekt ist kein callable" #: py/runtime.c msgid "'%q' object is not iterable" @@ -280,7 +280,7 @@ msgstr "Ein Hardware Interrupt Kanal wird schon benutzt" #: ports/esp32s2/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" -msgstr "" +msgstr "ADC2 wird vom WiFi benutzt" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format @@ -346,11 +346,11 @@ msgstr "" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" -msgstr "" +msgstr "Läuft bereits" #: ports/esp32s2/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" -msgstr "" +msgstr "Sucht bereits nach wifi Netzwerken" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -390,7 +390,7 @@ msgstr "Es darf höchstens %d %q spezifiziert werden (nicht %d)" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" -msgstr "" +msgstr "Versuche %d Blöcke zu allokieren" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." @@ -400,7 +400,7 @@ msgstr "" #: shared-bindings/wifi/Radio.c msgid "Authentication failure" -msgstr "" +msgstr "Authentifizierungsfehler" #: main.c msgid "Auto-reload is off.\n" @@ -478,11 +478,11 @@ msgstr "Die Pufferlänge %d ist zu groß. Sie muss kleiner als %d sein" #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" -msgstr "" +msgstr "Die Pufferlänge muss ein vielfaches von 512 sein" #: ports/stm/common-hal/sdioio/SDCard.c msgid "Buffer must be a multiple of 512 bytes" -msgstr "" +msgstr "Der Puffer muss ein vielfaches von 512 bytes sein" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -660,7 +660,7 @@ msgstr "Beschädigter raw code" #: ports/cxd56/common-hal/camera/Camera.c msgid "Could not initialize Camera" -msgstr "" +msgstr "Konnte Kamera nicht initialisieren" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" @@ -668,7 +668,7 @@ msgstr "" #: ports/cxd56/common-hal/sdioio/SDCard.c msgid "Could not initialize SDCard" -msgstr "" +msgstr "Konnte SDKarte nicht initialisieren" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c @@ -701,7 +701,7 @@ msgstr "" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" -msgstr "" +msgstr "Konnte Adresse nicht setzen" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not start PWM" @@ -818,7 +818,7 @@ msgstr "Characteristic wird erwartet" #: shared-bindings/_bleio/Adapter.c msgid "Expected a DigitalInOut" -msgstr "" +msgstr "DigitanInOut wird erwartet" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" @@ -826,7 +826,7 @@ msgstr "Ein Service wird erwartet" #: shared-bindings/_bleio/Adapter.c msgid "Expected a UART" -msgstr "" +msgstr "UART wird erwartet" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c @@ -853,7 +853,7 @@ msgstr "FFT ist nur für ndarrays definiert" #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" -msgstr "" +msgstr "SSL Handshake fehlgeschlagen" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." @@ -918,16 +918,16 @@ msgstr "Datei existiert" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" -msgstr "" +msgstr "Filter zu komplex" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" -msgstr "" +msgstr "Format nicht unterstützt" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" -msgstr "" +msgstr "Framepuffer benötigt %d bytes" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." @@ -968,7 +968,7 @@ msgstr "Hardware in benutzung, probiere alternative Pins" #: shared-bindings/wifi/Radio.c msgid "Hostname must be between 1 and 253 characters" -msgstr "" +msgstr "Der Hostname muss zwischen 1 und 253 Zeichen haben" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -980,7 +980,7 @@ msgstr "I2C-Init-Fehler" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" -msgstr "" +msgstr "I2SOut nicht verfügbar" #: shared-bindings/aesio/aes.c #, c-format @@ -1026,12 +1026,12 @@ msgstr "Interner Fehler #%d" #: shared-bindings/sdioio/SDCard.c msgid "Invalid %q" -msgstr "" +msgstr "Ungültiger %q" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" -msgstr "Ungültiger %q pin" +msgstr "Ungültiger %q Pin" #: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c #: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c @@ -1049,7 +1049,7 @@ msgstr "Ungültige BMP-Datei" #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" -msgstr "" +msgstr "Ungültige BSSID" #: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c @@ -1100,7 +1100,7 @@ msgstr "Ungültige format chunk size" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "Invalid frequency" -msgstr "" +msgstr "Ungültige Frequenz" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" From 998661246cc84330a239e33a89e2ce6f8f3e9c38 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Sun, 25 Oct 2020 21:03:27 +0000 Subject: [PATCH 1215/1293] Translated using Weblate (Swedish) Currently translated at 100.0% (836 of 836 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 22007e11f3..989b8257e7 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: 2020-10-16 19:50-0500\n" -"PO-Revision-Date: 2020-10-22 01:12+0000\n" +"PO-Revision-Date: 2020-10-26 02:36+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.3.1\n" +"X-Generator: Weblate 4.3.2-dev\n" #: main.c msgid "" @@ -494,7 +494,7 @@ msgstr "Bufferten är för stor och kan inte allokeras" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "Buffert år %d bytes för kort" +msgstr "Buffert är %d bytes för kort" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -2161,7 +2161,7 @@ msgstr "buffert för liten" #: shared-bindings/socketpool/Socket.c msgid "buffer too small for requested bytes" -msgstr "buffertför liten för begärd längd" +msgstr "buffert för liten för begärd längd" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" From 396d92f867c66673c8dffc77f7c0cbcaa83a157f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 21 Oct 2020 10:38:01 -0500 Subject: [PATCH 1216/1293] esp32s2: Add canio This works in loopback mode, though the hardware filtering only permits a single address or mask filter. --- ports/esp32s2/Makefile | 4 +- .../espressif_kaluga_1/mpconfigboard.mk | 2 +- ports/esp32s2/common-hal/canio/CAN.c | 297 ++++++++++++++++++ ports/esp32s2/common-hal/canio/CAN.h | 52 +++ ports/esp32s2/common-hal/canio/Listener.c | 182 +++++++++++ ports/esp32s2/common-hal/canio/Listener.h | 40 +++ ports/esp32s2/common-hal/canio/__init__.c | 25 ++ ports/esp32s2/common-hal/canio/__init__.h | 27 ++ ports/esp32s2/mpconfigport.mk | 1 + 9 files changed, 627 insertions(+), 3 deletions(-) create mode 100644 ports/esp32s2/common-hal/canio/CAN.c create mode 100644 ports/esp32s2/common-hal/canio/CAN.h create mode 100644 ports/esp32s2/common-hal/canio/Listener.c create mode 100644 ports/esp32s2/common-hal/canio/Listener.h create mode 100644 ports/esp32s2/common-hal/canio/__init__.c create mode 100644 ports/esp32s2/common-hal/canio/__init__.h diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 8d891edd02..5d8ccad50d 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -331,10 +331,10 @@ $(BUILD)/firmware.uf2: $(BUILD)/circuitpython-firmware.bin $(Q)$(PYTHON3) $(TOP)/tools/uf2/utils/uf2conv.py -f 0xbfdd4eee -b 0x0000 -c -o $@ $^ flash: $(BUILD)/firmware.bin - esptool.py --chip esp32s2 -p $(PORT) --no-stub -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ + esptool.py --chip esp32s2 -p $(PORT) -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ flash-circuitpython-only: $(BUILD)/circuitpython-firmware.bin - esptool.py --chip esp32s2 -p $(PORT) --no-stub -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x10000 $^ + esptool.py --chip esp32s2 -p $(PORT) -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x10000 $^ include $(TOP)/py/mkrules.mk diff --git a/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk b/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk index ba85e46efc..2dce038819 100644 --- a/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk @@ -11,7 +11,7 @@ LONGINT_IMPL = MPZ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_FREQ=80m CIRCUITPY_ESP_FLASH_SIZE=4MB CIRCUITPY_MODULE=wrover diff --git a/ports/esp32s2/common-hal/canio/CAN.c b/ports/esp32s2/common-hal/canio/CAN.c new file mode 100644 index 0000000000..f1741969db --- /dev/null +++ b/ports/esp32s2/common-hal/canio/CAN.c @@ -0,0 +1,297 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "py/runtime.h" +#include "py/mperrno.h" + +#include "common-hal/canio/CAN.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/util.h" +#include "supervisor/port.h" +#include "hal/twai_ll.h" + +#include "hal/twai_types.h" + +STATIC bool reserved_can; + +twai_timing_config_t get_t_config(int baudrate) { + switch(baudrate) { + case 1000000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_1MBITS(); + return t_config; + } + case 800000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_800KBITS(); + return t_config; + } + case 500000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_500KBITS(); + return t_config; + } + case 250000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_250KBITS(); + return t_config; + } + case 125000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_125KBITS(); + return t_config; + } + case 100000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_100KBITS(); + return t_config; + } + case 50000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_50KBITS(); + return t_config; + } + case 25000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_25KBITS(); + return t_config; + } + case 20000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_20KBITS(); + return t_config; + } + case 16000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_16KBITS(); + return t_config; + } + case 12500: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_12_5KBITS(); + return t_config; + } + case 10000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_10KBITS(); + return t_config; + } + case 5000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_5KBITS(); + return t_config; + } + case 1000: + { + twai_timing_config_t t_config = TWAI_TIMING_CONFIG_1KBITS(); + return t_config; + } + default: + mp_raise_ValueError(translate("Baudrate not supported by peripheral")); + } +} + +__attribute__((optimize("O0"))) +void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *tx, mcu_pin_obj_t *rx, int baudrate, bool loopback, bool silent) +{ +#define DIV_ROUND(a, b) (((a) + (b)/2) / (b)) +#define DIV_ROUND_UP(a, b) (((a) + (b) - 1) / (b)) + if (reserved_can) { + mp_raise_ValueError(translate("All CAN peripherals are in use")); + } + + if (loopback && silent) { + mp_raise_ValueError(translate("loopback + silent mode not supported by peripheral")); + } + + self->t_config = get_t_config(baudrate);; + twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT(-1, -1, TWAI_MODE_NORMAL); + g_config.tx_io = tx->number; + g_config.rx_io = rx->number; + if (loopback) { + g_config.mode = TWAI_MODE_NO_ACK; + } + if (silent) { + g_config.mode = TWAI_MODE_LISTEN_ONLY; + } + self->g_config = g_config; + + { + twai_filter_config_t f_config = TWAI_FILTER_CONFIG_ACCEPT_ALL(); + self->f_config = f_config; + } + + esp_err_t result = twai_driver_install(&self->g_config, &self->t_config, &self->f_config); + if (result == ESP_ERR_NO_MEM) { + mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); + } else if (result == ESP_ERR_INVALID_ARG) { + mp_raise_ValueError(translate("Invalid pins")); + } else if (result != ESP_OK) { + mp_raise_OSError_msg_varg(translate("twai_driver_install returned esp-idf error #%d"), (int)result); + } + + result = twai_start(); + if (result != ESP_OK) { + mp_raise_OSError_msg_varg(translate("twai_start returned esp-idf error #%d"), (int)result); + } + + self->silent = silent; + self->loopback = loopback; + self->baudrate = baudrate; + self->tx_pin = tx; + self->rx_pin = rx; + + claim_pin(tx); + claim_pin(rx); + + reserved_can = true; +} + +bool common_hal_canio_can_loopback_get(canio_can_obj_t *self) +{ + return self->loopback; +} + +int common_hal_canio_can_baudrate_get(canio_can_obj_t *self) +{ + return self->baudrate; +} + +int common_hal_canio_can_transmit_error_count_get(canio_can_obj_t *self) +{ + twai_status_info_t info; + twai_get_status_info(&info); + return info.tx_error_counter; +} + +int common_hal_canio_can_receive_error_count_get(canio_can_obj_t *self) +{ + twai_status_info_t info; + twai_get_status_info(&info); + return info.rx_error_counter; +} + +canio_bus_state_t common_hal_canio_can_state_get(canio_can_obj_t *self) { + twai_status_info_t info; + twai_get_status_info(&info); + if (info.state == TWAI_STATE_BUS_OFF || info.state == TWAI_STATE_RECOVERING) { + return BUS_STATE_OFF; + } + if (info.tx_error_counter > 127 || info.rx_error_counter > 127) { + return BUS_STATE_ERROR_PASSIVE; + } + if (info.tx_error_counter > 96 || info.rx_error_counter > 96) { + return BUS_STATE_ERROR_WARNING; + } + return BUS_STATE_ERROR_ACTIVE; +} + +static void can_restart(void) { + twai_status_info_t info; + twai_get_status_info(&info); + if (info.state != TWAI_STATE_BUS_OFF) { + return; + } + twai_initiate_recovery(); + // wait 100ms (hard coded for now) for bus to recover + uint64_t deadline = port_get_raw_ticks(NULL) + 100; + do { + twai_get_status_info(&info); + } while (port_get_raw_ticks(NULL) < deadline && (info.state == TWAI_STATE_BUS_OFF || info.state == TWAI_STATE_RECOVERING)); +} + +void canio_maybe_auto_restart(canio_can_obj_t *self) { + if (self->auto_restart) can_restart(); +} + +void common_hal_canio_can_restart(canio_can_obj_t *self) { + if (!common_hal_canio_can_auto_restart_get(self)) { + can_restart(); + } +} + +bool common_hal_canio_can_auto_restart_get(canio_can_obj_t *self) { + return self->auto_restart; +} + +void common_hal_canio_can_auto_restart_set(canio_can_obj_t *self, bool value) { + self->auto_restart = value; + canio_maybe_auto_restart(self); +} + +void common_hal_canio_can_send(canio_can_obj_t *self, mp_obj_t message_in) +{ + canio_maybe_auto_restart(self); + canio_message_obj_t *message = message_in; + bool rtr = message->base.type == &canio_remote_transmission_request_type; + twai_message_t message_out = { + .extd = message->extended, + .rtr = rtr, + .self = self->loopback, + .identifier = message->id, + .data_length_code = message->size, + }; + if (!rtr) { + memcpy(message_out.data, message->data, message->size); + } + // Allow transmission to occur in background + twai_transmit(&message_out, 0); +} + +bool common_hal_canio_can_silent_get(canio_can_obj_t *self) { + return self->silent; +} + +bool common_hal_canio_can_deinited(canio_can_obj_t *self) { + return !self->tx_pin; +} + +void common_hal_canio_can_check_for_deinit(canio_can_obj_t *self) { + if (common_hal_canio_can_deinited(self)) { + raise_deinited_error(); + } +} + +void common_hal_canio_can_deinit(canio_can_obj_t *self) +{ + if (self->tx_pin) { + (void)twai_stop(); + (void)twai_driver_uninstall(); + reset_pin_number(self->tx_pin->number); + reset_pin_number(self->rx_pin->number); + reserved_can = false; + } + self->tx_pin = NULL; + self->rx_pin = NULL; +} + +void common_hal_canio_reset(void) { + (void)twai_stop(); + (void)twai_driver_uninstall(); + reserved_can = false; +} diff --git a/ports/esp32s2/common-hal/canio/CAN.h b/ports/esp32s2/common-hal/canio/CAN.h new file mode 100644 index 0000000000..e15d515908 --- /dev/null +++ b/ports/esp32s2/common-hal/canio/CAN.h @@ -0,0 +1,52 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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" +#include "shared-bindings/canio/__init__.h" +#include "shared-bindings/canio/CAN.h" +#include "common-hal/microcontroller/Pin.h" +#include "common-hal/canio/__init__.h" +#include "shared-module/canio/Message.h" + +#include "driver/twai.h" + +#define FILTER_BANK_COUNT (28) + +typedef struct canio_can_obj { + mp_obj_base_t base; + int baudrate; + const mcu_pin_obj_t *rx_pin; + const mcu_pin_obj_t *tx_pin; + bool loopback:1; + bool silent:1; + bool auto_restart:1; + bool fifo_in_use:1; + twai_filter_config_t f_config; + twai_general_config_t g_config; + twai_timing_config_t t_config; +} canio_can_obj_t; diff --git a/ports/esp32s2/common-hal/canio/Listener.c b/ports/esp32s2/common-hal/canio/Listener.c new file mode 100644 index 0000000000..fddbfeb583 --- /dev/null +++ b/ports/esp32s2/common-hal/canio/Listener.c @@ -0,0 +1,182 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 + +#include "py/obj.h" +#include "py/runtime.h" + +#include "common-hal/canio/__init__.h" +#include "common-hal/canio/Listener.h" +#include "shared-bindings/canio/Listener.h" +#include "shared-bindings/util.h" +#include "supervisor/shared/tick.h" +#include "supervisor/shared/safe_mode.h" + +#include "hal/twai_ll.h" + +// IDE = "extended ID" flag of packet header. We always add this bit to the +// mask because a match is always for just one kind of address length +#define FILTER16_IDE (1<<3) +#define FILTER32_IDE (1<<2) + +// Work around a problem reported at +// https://github.com/espressif/esp-idf/issues/6020 where +// twai_ll_set_acc_filter does not work under -Os optimization +__attribute__((optimize("O0"))) +__attribute__((noinline)) +static void canio_set_acc_filter(twai_dev_t* hw, uint32_t code, uint32_t mask, bool single_filter) +{ + uint32_t code_swapped = __builtin_bswap32(code); + uint32_t mask_swapped = __builtin_bswap32(mask); + for (int i = 0; i < 4; i++) { + hw->acceptance_filter.acr[i].val = ((code_swapped >> (i * 8)) & 0xFF); + hw->acceptance_filter.amr[i].val = ((mask_swapped >> (i * 8)) & 0xFF); + } + hw->mode_reg.afm = single_filter; +} + +STATIC void install_standard_filter(canio_listener_obj_t *self, canio_match_obj_t *match) { + canio_set_acc_filter(&TWAI, match->id << 21, ~(match->mask << 21), true); + self->extended = false; + self->standard = true; +} + +STATIC void install_extended_filter(canio_listener_obj_t *self, canio_match_obj_t *match) { + canio_set_acc_filter(&TWAI, match->id << 3, ~(match->mask << 3), true); + self->extended = true; + self->standard = false; +} + +STATIC void install_all_match_filter(canio_listener_obj_t *self) { + canio_set_acc_filter(&TWAI, 0u, ~0u, true); + self->extended = true; + self->standard = true; +} + +__attribute__((noinline,optimize("O0"))) +void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t **matches) { + twai_ll_enter_reset_mode(&TWAI); + + if (!nmatch) { + install_all_match_filter(self); + } else { + canio_match_obj_t *match = matches[0]; + if (match->extended) { + install_extended_filter(self, match); + } else { + install_standard_filter(self, match); + } + } + + twai_ll_exit_reset_mode(&TWAI); +} + + +void common_hal_canio_listener_construct(canio_listener_obj_t *self, canio_can_obj_t *can, size_t nmatch, canio_match_obj_t **matches, float timeout) { + if (can->fifo_in_use) { + mp_raise_ValueError(translate("All RX FIFOs in use")); + } + if (nmatch > 1) { + mp_raise_ValueError(translate("Filters too complex")); + } + + // Nothing can fail now so it's safe to assign self->can + can->fifo_in_use = 1; + self->can = can; + self->pending = false; + + set_filters(self, nmatch, matches); + self->extended = self->standard = true; + + common_hal_canio_listener_set_timeout(self, timeout); +} + +void common_hal_canio_listener_set_timeout(canio_listener_obj_t *self, float timeout) { + self->timeout_ms = (int)MICROPY_FLOAT_C_FUN(ceil)(timeout * 1000); +} + +float common_hal_canio_listener_get_timeout(canio_listener_obj_t *self) { + return self->timeout_ms / 1000.0f; +} + +void common_hal_canio_listener_check_for_deinit(canio_listener_obj_t *self) { + if (!self->can) { + raise_deinited_error(); + } + common_hal_canio_can_check_for_deinit(self->can); +} + +// The API has no peek method so we must receive a packet into a holding area +// and then we can say that we have 1 message pending +int common_hal_canio_listener_in_waiting(canio_listener_obj_t *self) { + while (!self->pending && twai_receive(&self->message_in, 0) == ESP_OK) { + if (self->message_in.extd && self->extended) { + self->pending = true; + } + if (!self->message_in.extd && self->standard) { + self->pending = true; + } + } + return self->pending; +} + +mp_obj_t common_hal_canio_listener_receive(canio_listener_obj_t *self) { + if (!common_hal_canio_listener_in_waiting(self)) { + uint64_t deadline = supervisor_ticks_ms64() + self->timeout_ms; + do { + if (supervisor_ticks_ms64() > deadline) { + return NULL; + } + } while (!common_hal_canio_listener_in_waiting(self)); + } + + bool rtr = self->message_in.rtr; + + int dlc = self->message_in.data_length_code; + canio_message_obj_t *message = m_new_obj(canio_message_obj_t); + message->base.type = rtr ? &canio_remote_transmission_request_type : &canio_message_type; + message->extended = self->message_in.extd; + message->id = self->message_in.identifier; + message->size = dlc; + + if (!rtr) { + MP_STATIC_ASSERT(sizeof(self->message_in.data) == sizeof(message->data)); + memcpy(message->data, self->message_in.data, sizeof(message->data)); + } + + self->pending = false; + + return message; +} + +void common_hal_canio_listener_deinit(canio_listener_obj_t *self) { + if (self->can) { + self->can->fifo_in_use = false; + } + self->can = NULL; +} diff --git a/ports/esp32s2/common-hal/canio/Listener.h b/ports/esp32s2/common-hal/canio/Listener.h new file mode 100644 index 0000000000..d24900e435 --- /dev/null +++ b/ports/esp32s2/common-hal/canio/Listener.h @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 "common-hal/canio/CAN.h" +#include "shared-module/canio/Match.h" + +typedef struct canio_listener_obj { + mp_obj_base_t base; + canio_can_obj_t *can; + bool extended:1; + bool standard:1; + bool pending:1; + twai_message_t message_in; + uint32_t timeout_ms; +} canio_listener_obj_t; diff --git a/ports/esp32s2/common-hal/canio/__init__.c b/ports/esp32s2/common-hal/canio/__init__.c new file mode 100644 index 0000000000..7932bfc2da --- /dev/null +++ b/ports/esp32s2/common-hal/canio/__init__.c @@ -0,0 +1,25 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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. + */ diff --git a/ports/esp32s2/common-hal/canio/__init__.h b/ports/esp32s2/common-hal/canio/__init__.h new file mode 100644 index 0000000000..20b6638cd8 --- /dev/null +++ b/ports/esp32s2/common-hal/canio/__init__.h @@ -0,0 +1,27 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 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 diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 4e8a7bdef2..c9863572a5 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -16,6 +16,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_FULL_BUILD = 1 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 +CIRCUITPY_CANIO = 1 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 From bdc13437910320c0784902661b16b6171720f1ab Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 21 Oct 2020 11:30:33 -0500 Subject: [PATCH 1217/1293] make translate --- locale/circuitpython.pot | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 7ed2d1ba1d..94a6a8514d 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -288,11 +288,16 @@ msgstr "" msgid "Address type out of range" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -407,6 +412,10 @@ msgid "" "disable.\n" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -775,7 +784,7 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -901,6 +910,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1119,7 +1129,7 @@ msgstr "" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2837,6 +2847,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "" @@ -3181,6 +3195,8 @@ msgstr "" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3432,6 +3448,16 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c From 32f2a8d54cf54bb3f9dcba33f4b617d4dcf8b596 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 26 Oct 2020 11:03:54 -0400 Subject: [PATCH 1218/1293] Fix readme link --- ports/esp32s2/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/README.md b/ports/esp32s2/README.md index 8a6dfbd2d8..f3e678de85 100644 --- a/ports/esp32s2/README.md +++ b/ports/esp32s2/README.md @@ -30,18 +30,20 @@ Connect these pins using a [USB adapter](https://www.adafruit.com/product/4090) ## Building and flashing ## -Before building or flashing the ESP32-S2, you must [install the esp-idf](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html). This must be re-done ever time the esp-idf is updated, but not every time you build. Run `cd ports/esp32s2` from `circuitpython/` to move to the esp32s2 port root, and run: +Before building or flashing the ESP32-S2, you must [install the esp-idf](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/get-started/index.html). This must be re-done ever time the esp-idf is updated, but not every time you build. Run `cd ports/esp32s2` from `circuitpython/` to move to the esp32s2 port root, and run: ``` ./esp-idf/install.sh ``` -Additionally, any time you open a new bash environment for building or flashing, you must add the esp-idf tools to your path: +After this initial installation, you must add the esp-idf tools to your path. You must also do this **any time you open a new bash environment for building or flashing**: ``` . esp-idf/export.sh ``` +When Circuitpython updates the ESP-IDF to a new release, you may need to run this installation process again. The exact commands used may also vary based on your bash environment. + Building boards such as the Saola is typically done through `make flash`. The default port is `tty.SLAB_USBtoUART`, which will only work on certain Mac setups. On most machines, both Mac and Linux, you will need to set the port yourself by running `ls /dev/tty.usb*` and selecting the one that only appears when your development board is plugged in. An example make command with the port setting is as follows: ``` From c9f7df3bab8c46cc51b12eefc95391a00ba8c7e1 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 26 Oct 2020 10:06:49 -0500 Subject: [PATCH 1219/1293] canio: Give implementation-specific limits for CAN.Listen --- shared-bindings/canio/CAN.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/shared-bindings/canio/CAN.c b/shared-bindings/canio/CAN.c index 6dae36943a..4982a97b9d 100644 --- a/shared-bindings/canio/CAN.c +++ b/shared-bindings/canio/CAN.c @@ -214,7 +214,24 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_can_restart_obj, canio_can_restart); //| //| An empty filter list causes all messages to be accepted. //| -//| Timeout dictates how long receive() and next() will block.""" +//| Timeout dictates how long receive() and next() will block. +//| +//| Platform specific notes: +//| +//| SAM E5x supports two Listeners. Filter blocks are shared between the two +//| listeners. There are 4 standard filter blocks and 4 extended filter blocks. +//| Each block can either match 2 single addresses or a mask of addresses. +//| The number of filter blocks can be increased, up to a hardware maximum, by +//| rebuilding CircuitPython, but this decreases the CircuitPython free +//| memory even if canio is not used. +//| +//| STM32F405 supports two Listeners. Filter blocks are shared between the two listeners. +//| There are 14 filter blocks. Each block can match 2 standard addresses with +//| mask or 1 extended address with mask. +//| +//| ESP32S2 supports one Listener. There is a single filter block, which can either match a +//| standard address with mask or an extended address with mask. +//| """ //| ... //| STATIC mp_obj_t canio_can_listen(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { From 81ab6a05d0652688d446fc75c838be95f13fb32b Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 26 Oct 2020 13:25:00 -0700 Subject: [PATCH 1220/1293] Use old translation date to avoid merge conflict --- locale/circuitpython.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index cc058e61a2..a5581e7fa7 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-25 15:21-0500\n" +"POT-Creation-Date: 2020-10-15 16:06+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" From 1117edae63df7b66f1575980bf54d6836f9a8aa8 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Sat, 24 Oct 2020 17:13:10 +0200 Subject: [PATCH 1221/1293] Fix erroneous claim of board.I2C() by deinited display. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At the end of a session that called displayio.release_displays() (and did not initialize a new display), a board.I2C() bus that was previously used by a display would wrongly be considered still in use. While I can’t think of any unrecoverable problem this would cause in the next session, it violates the assumption that a soft reboot resets everything not needed by displays, potentially leading to confusion. By itself, this change does not fix the problem yet - rather, it introduces the same issue as in #3581 for SPI. This needs to be solved in the same way for I2C and SPI. --- shared-module/board/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index 39b68a0f11..856103b7b6 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -139,7 +139,7 @@ void reset_board_busses(void) { bool display_using_i2c = false; #if CIRCUITPY_DISPLAYIO for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { - if (displays[i].i2cdisplay_bus.bus == i2c_singleton) { + if (displays[i].bus_base.type == &displayio_i2cdisplay_type && displays[i].i2cdisplay_bus.bus == i2c_singleton) { display_using_i2c = true; break; } From f4f80e07ca3dc2f5a93484e5342540837a94a505 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Sat, 24 Oct 2020 17:23:17 +0200 Subject: [PATCH 1222/1293] Fix lost board.SPI and board.I2C after being used by display. Fixes #3581. Pins were marked as never_reset by common_hal_displayio_fourwire_construct() and common_hal_sharpdisplay_framebuffer_construct(), but these marks were never removed, so at the end of a session after displayio.release_displays(), {spi|i2c}_singleton would be set to NULL but the pins would not be reset. In the next session, board.SPI() and board.I2C() were unable to reconstruct the object because the pins were still in use. For symmetry with creation of the singleton, add deinitialization before setting it to NULL in reset_board_busses(). This makes the pins resettable, so that reset_port(), moved behind it, then resets them. --- main.c | 4 +++- shared-module/board/__init__.c | 14 +++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index b43b3b8c80..80b163f607 100755 --- a/main.c +++ b/main.c @@ -234,10 +234,12 @@ void cleanup_after_vm(supervisor_allocation* heap) { common_hal_canio_reset(); #endif - reset_port(); + // reset_board_busses() first because it may release pins from the never_reset state, so that + // reset_port() can reset them. #if CIRCUITPY_BOARD reset_board_busses(); #endif + reset_port(); reset_board(); reset_status_led(); } diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index 856103b7b6..967b430d2b 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -145,8 +145,11 @@ void reset_board_busses(void) { } } #endif - if (!display_using_i2c) { - i2c_singleton = NULL; + if (i2c_singleton != NULL) { + if (!display_using_i2c) { + common_hal_busio_i2c_deinit(i2c_singleton); + i2c_singleton = NULL; + } } #endif #if BOARD_SPI @@ -169,9 +172,10 @@ void reset_board_busses(void) { // make sure SPI lock is not held over a soft reset if (spi_singleton != NULL) { common_hal_busio_spi_unlock(spi_singleton); - } - if (!display_using_spi) { - spi_singleton = NULL; + if (!display_using_spi) { + common_hal_busio_spi_deinit(spi_singleton); + spi_singleton = NULL; + } } #endif #if BOARD_UART From 99a3750a2cfd1da8cdd266ca9a0367f0c3a54092 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Sat, 24 Oct 2020 17:50:11 +0200 Subject: [PATCH 1223/1293] Fix lost board.SPI and board.I2C after explicitly deiniting them. After calling board.SPI().deinit(), calling board.SPI() again would return the unusable deinited object and there was no way of getting it back into an initialized state until the end of the session. --- shared-bindings/board/__init__.c | 10 ++++++++-- shared-module/board/__init__.c | 10 ++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index 6837fc41c2..717698408a 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -28,6 +28,12 @@ #include "py/runtime.h" #include "shared-bindings/board/__init__.h" +#if BOARD_I2C +#include "shared-bindings/busio/I2C.h" +#endif +#if BOARD_SPI +#include "shared-bindings/busio/SPI.h" +#endif //| """Board specific pin names //| @@ -45,7 +51,7 @@ #if BOARD_I2C mp_obj_t board_i2c(void) { mp_obj_t singleton = common_hal_board_get_i2c(); - if (singleton != NULL) { + if (singleton != NULL && !common_hal_busio_i2c_deinited(singleton)) { return singleton; } assert_pin_free(DEFAULT_I2C_BUS_SDA); @@ -69,7 +75,7 @@ MP_DEFINE_CONST_FUN_OBJ_0(board_i2c_obj, board_i2c); #if BOARD_SPI mp_obj_t board_spi(void) { mp_obj_t singleton = common_hal_board_get_spi(); - if (singleton != NULL) { + if (singleton != NULL && !common_hal_busio_spi_deinited(singleton)) { return singleton; } assert_pin_free(DEFAULT_SPI_BUS_SCK); diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index 967b430d2b..2f1c34e565 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -55,9 +55,8 @@ mp_obj_t common_hal_board_get_i2c(void) { } mp_obj_t common_hal_board_create_i2c(void) { - if (i2c_singleton != NULL) { - return i2c_singleton; - } + // All callers have either already verified this or come so early that it can't be otherwise. + assert(i2c_singleton == NULL || common_hal_busio_i2c_deinited(i2c_singleton)); busio_i2c_obj_t *self = &i2c_obj; self->base.type = &busio_i2c_type; @@ -79,9 +78,8 @@ mp_obj_t common_hal_board_get_spi(void) { } mp_obj_t common_hal_board_create_spi(void) { - if (spi_singleton != NULL) { - return spi_singleton; - } + // All callers have either already verified this or come so early that it can't be otherwise. + assert(spi_singleton == NULL || common_hal_busio_spi_deinited(spi_singleton)); busio_spi_obj_t *self = &spi_obj; self->base.type = &busio_spi_type; From 5deb045a8112100de3cb28fdb7b6c56444663503 Mon Sep 17 00:00:00 2001 From: Gaetan Date: Mon, 26 Oct 2020 23:32:57 +0100 Subject: [PATCH 1224/1293] Ready to PR * ../../.github/workflows/build.yml + boards/holyiot_nrf52840/board.c + boards/holyiot_nrf52840/mpconfigboard.h + boards/holyiot_nrf52840/mpconfigboard.mk + boards/holyiot_nrf52840/pins.c --- .github/workflows/build.yml | 1 + ports/nrf/boards/holyiot_nrf52840/board.c | 38 ++++++++++++ .../boards/holyiot_nrf52840/mpconfigboard.h | 33 +++++++++++ .../boards/holyiot_nrf52840/mpconfigboard.mk | 8 +++ ports/nrf/boards/holyiot_nrf52840/pins.c | 59 +++++++++++++++++++ 5 files changed, 139 insertions(+) create mode 100644 ports/nrf/boards/holyiot_nrf52840/board.c create mode 100644 ports/nrf/boards/holyiot_nrf52840/mpconfigboard.h create mode 100644 ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk create mode 100644 ports/nrf/boards/holyiot_nrf52840/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index feb6a7f633..cada55aaa4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -214,6 +214,7 @@ jobs: - "hallowing_m0_express" - "hallowing_m4_express" - "hiibot_bluefi" + - "holyiot_nrf52840" - "ikigaisense_vita" - "imxrt1010_evk" - "imxrt1020_evk" diff --git a/ports/nrf/boards/holyiot_nrf52840/board.c b/ports/nrf/boards/holyiot_nrf52840/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/nrf/boards/holyiot_nrf52840/board.c @@ -0,0 +1,38 @@ +/* + * 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 "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.h b/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.h new file mode 100644 index 0000000000..3b64d3a629 --- /dev/null +++ b/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.h @@ -0,0 +1,33 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Glenn Ruben Bakke + * + * + * 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 "Holyiot nRF52840" +#define MICROPY_HW_MCU_NAME "nRF52840" + +#define MICROPY_HW_LED_STATUS (&pin_P0_19) diff --git a/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk b/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk new file mode 100644 index 0000000000..d85de75071 --- /dev/null +++ b/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk @@ -0,0 +1,8 @@ +USB_VID = 0x239A +USB_PID = 0x80A0 +USB_PRODUCT = "HOLYIOTNRF52840" +USB_MANUFACTURER = "Holyiot" + +MCU_CHIP = nrf52840 + +INTERNAL_FLASH_FILESYSTEM = 1 \ No newline at end of file diff --git a/ports/nrf/boards/holyiot_nrf52840/pins.c b/ports/nrf/boards/holyiot_nrf52840/pins.c new file mode 100644 index 0000000000..4e2593e58f --- /dev/null +++ b/ports/nrf/boards/holyiot_nrf52840/pins.c @@ -0,0 +1,59 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + + { MP_ROM_QSTR(MP_QSTR_P1_10), MP_ROM_PTR(&pin_P0_02) }, + { 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_P0_03), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_P0_02), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_P0_28), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_P0_29), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_P0_30), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_P0_31), MP_ROM_PTR(&pin_P0_31) }, + { MP_ROM_QSTR(MP_QSTR_P0_04), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_P0_05), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_P1_14), MP_ROM_PTR(&pin_P1_14) }, + { MP_ROM_QSTR(MP_QSTR_P1_12), MP_ROM_PTR(&pin_P1_12) }, + { MP_ROM_QSTR(MP_QSTR_P0_25), MP_ROM_PTR(&pin_P0_25) }, + { MP_ROM_QSTR(MP_QSTR_P0_11), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_P1_08), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_P0_27), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_P0_08), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_P0_06), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_P0_26), MP_ROM_PTR(&pin_P0_26) }, + + { MP_ROM_QSTR(MP_QSTR_P0_10), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_P0_09), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_P1_06), MP_ROM_PTR(&pin_P1_06) }, + { MP_ROM_QSTR(MP_QSTR_P1_04), MP_ROM_PTR(&pin_P1_04) }, + { MP_ROM_QSTR(MP_QSTR_P1_02), MP_ROM_PTR(&pin_P1_02) }, + { MP_ROM_QSTR(MP_QSTR_P1_01), MP_ROM_PTR(&pin_P1_01) }, + { MP_ROM_QSTR(MP_QSTR_P1_03), MP_ROM_PTR(&pin_P1_03) }, + { MP_ROM_QSTR(MP_QSTR_P1_00), MP_ROM_PTR(&pin_P1_00) }, + { MP_ROM_QSTR(MP_QSTR_P0_22), MP_ROM_PTR(&pin_P0_22) }, + { MP_ROM_QSTR(MP_QSTR_P1_07), MP_ROM_PTR(&pin_P1_07) }, + { MP_ROM_QSTR(MP_QSTR_P1_05), MP_ROM_PTR(&pin_P1_05) }, + { MP_ROM_QSTR(MP_QSTR_P0_24), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_P0_20), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_P0_17), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_P0_15), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_P0_14), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_P0_13), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_P0_16), MP_ROM_PTR(&pin_P0_16) }, + + + { MP_ROM_QSTR(MP_QSTR_P0_07), MP_ROM_PTR(&pin_P0_07) }, + { MP_ROM_QSTR(MP_QSTR_P1_09), MP_ROM_PTR(&pin_P1_09) }, + { MP_ROM_QSTR(MP_QSTR_P0_12), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_P0_23), MP_ROM_PTR(&pin_P0_23) }, + { MP_ROM_QSTR(MP_QSTR_P0_21), MP_ROM_PTR(&pin_P0_21) }, + { MP_ROM_QSTR(MP_QSTR_P0_19), MP_ROM_PTR(&pin_P0_19) }, + + // RESET { MP_ROM_QSTR(MP_QSTR_P0_18), MP_ROM_PTR(&pin_P0_18) }, + +}; + + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); \ No newline at end of file From cfaa02ef19c2370cfa8dc5d7fc27664f34d9c90c Mon Sep 17 00:00:00 2001 From: Gaetan Date: Mon, 26 Oct 2020 23:36:54 +0100 Subject: [PATCH 1225/1293] Fix error --- CONTRIBUTING.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c94e8db8c6..15b4cfc892 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,8 +4,6 @@ SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://g SPDX-License-Identifier: MIT --> - - # Contributing Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). From fc591c8d847ad543ee2e8a368574783e2c230309 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 19 Oct 2020 18:30:26 -0700 Subject: [PATCH 1226/1293] Add EInk Portal --- .../adafruit_esp32s2_eink_portal/board.c | 47 +++++++++++++++++++ .../mpconfigboard.h | 45 ++++++++++++++++++ .../mpconfigboard.mk | 17 +++++++ .../adafruit_esp32s2_eink_portal/pins.c | 39 +++++++++++++++ .../adafruit_esp32s2_eink_portal/sdkconfig | 33 +++++++++++++ 5 files changed, 181 insertions(+) create mode 100644 ports/esp32s2/boards/adafruit_esp32s2_eink_portal/board.c create mode 100644 ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.h create mode 100644 ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.mk create mode 100644 ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c create mode 100644 ports/esp32s2/boards/adafruit_esp32s2_eink_portal/sdkconfig diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/board.c b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/board.c new file mode 100644 index 0000000000..9f708874bf --- /dev/null +++ b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/board.c @@ -0,0 +1,47 @@ +/* + * 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 "boards/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.h b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.h new file mode 100644 index 0000000000..5a17a0cad1 --- /dev/null +++ b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.h @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "EInk Portal" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO1) + +#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_GPIO34) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO33) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO36) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO37) diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.mk b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.mk new file mode 100644 index 0000000000..31aff57da4 --- /dev/null +++ b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x239A +USB_PID = 0x80E6 +USB_PRODUCT = "EInk Portal" +USB_MANUFACTURER = "Adafruit" + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=4MB + +CIRCUITPY_MODULE=wrover diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c new file mode 100644 index 0000000000..2cf3d24029 --- /dev/null +++ b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c @@ -0,0 +1,39 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_AD1), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_SPEAKER_ENABLE), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_EPD_BUSY), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_EPD_RESET), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_EPD_DC), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_EPD_CS), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON_A), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_B), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_C), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_D), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO1) }, + + { 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_global_dict_table); diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/sdkconfig b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/sdkconfig new file mode 100644 index 0000000000..9d8bbde967 --- /dev/null +++ b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/sdkconfig @@ -0,0 +1,33 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 + +# +# PSRAM clock and cs IO for ESP32S2 +# +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM clock and cs IO for ESP32S2 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config From 0d1649880f1c23ec6c9c0a4834f3712a8495f9d8 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 26 Oct 2020 16:58:00 -0700 Subject: [PATCH 1227/1293] Add grayscale EInk support --- shared-bindings/displayio/EPaperDisplay.c | 35 +++++++++++++++++++---- shared-bindings/displayio/EPaperDisplay.h | 2 +- shared-module/displayio/ColorConverter.c | 9 +++--- shared-module/displayio/EPaperDisplay.c | 15 ++++++---- shared-module/displayio/EPaperDisplay.h | 1 + shared-module/displayio/Palette.h | 1 + shared-module/displayio/display_core.c | 1 + 7 files changed, 48 insertions(+), 16 deletions(-) diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index 8be4ee4c4a..e0326d9c82 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -49,7 +49,19 @@ //| Most people should not use this class directly. Use a specific display driver instead that will //| contain the startup and shutdown sequences at minimum.""" //| -//| def __init__(self, display_bus: _DisplayBus, start_sequence: ReadableBuffer, stop_sequence: ReadableBuffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: Optional[int] = None, set_row_window_command: Optional[int] = None, single_byte_bounds: bool = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: Optional[int] = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: Optional[microcontroller.Pin] = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False) -> None: +//| def __init__(self, display_bus: _DisplayBus, +//| start_sequence: ReadableBuffer, stop_sequence: ReadableBuffer, *, +//| width: int, height: int, ram_width: int, ram_height: int, +//| colstart: int = 0, rowstart: int = 0, rotation: int = 0, +//| set_column_window_command: Optional[int] = None, +//| set_row_window_command: Optional[int] = None, single_byte_bounds: bool = False, +//| write_black_ram_command: int, black_bits_inverted: bool = False, +//| write_color_ram_command: Optional[int] = None, +//| color_bits_inverted: bool = False, highlight_color: int = 0x000000, +//| refresh_display_command: int, refresh_time: float = 40, +//| busy_pin: Optional[microcontroller.Pin] = None, busy_state: bool = True, +//| seconds_per_frame: float = 180, always_toggle_chip_select: bool = False, +//| grayscale: bool = False) -> None: //| """Create a EPaperDisplay object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). //| //| The ``start_sequence`` and ``stop_sequence`` are bitpacked to minimize the ram impact. Every @@ -84,11 +96,18 @@ //| :param microcontroller.Pin busy_pin: Pin used to signify the display is busy //| :param bool busy_state: State of the busy pin when the display is busy //| :param float seconds_per_frame: Minimum number of seconds between screen refreshes -//| :param bool always_toggle_chip_select: When True, chip select is toggled every byte""" +//| :param bool always_toggle_chip_select: When True, chip select is toggled every byte +//| :param bool grayscale: When true, the color ram is the low bit of 2-bit grayscale""" //| ... //| STATIC mp_obj_t displayio_epaperdisplay_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_display_bus, ARG_start_sequence, ARG_stop_sequence, ARG_width, ARG_height, ARG_ram_width, ARG_ram_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_set_column_window_command, ARG_set_row_window_command, ARG_set_current_column_command, ARG_set_current_row_command, ARG_write_black_ram_command, ARG_black_bits_inverted, ARG_write_color_ram_command, ARG_color_bits_inverted, ARG_highlight_color, ARG_refresh_display_command, ARG_refresh_time, ARG_busy_pin, ARG_busy_state, ARG_seconds_per_frame, ARG_always_toggle_chip_select }; + enum { ARG_display_bus, ARG_start_sequence, ARG_stop_sequence, ARG_width, ARG_height, + ARG_ram_width, ARG_ram_height, ARG_colstart, ARG_rowstart, ARG_rotation, + ARG_set_column_window_command, ARG_set_row_window_command, ARG_set_current_column_command, + ARG_set_current_row_command, ARG_write_black_ram_command, ARG_black_bits_inverted, + ARG_write_color_ram_command, ARG_color_bits_inverted, ARG_highlight_color, + ARG_refresh_display_command, ARG_refresh_time, ARG_busy_pin, ARG_busy_state, + ARG_seconds_per_frame, ARG_always_toggle_chip_select, ARG_grayscale }; static const mp_arg_t allowed_args[] = { { MP_QSTR_display_bus, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_start_sequence, MP_ARG_REQUIRED | MP_ARG_OBJ }, @@ -115,6 +134,7 @@ STATIC mp_obj_t displayio_epaperdisplay_make_new(const mp_obj_type_t *type, size { MP_QSTR_busy_state, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, { MP_QSTR_seconds_per_frame, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NEW_SMALL_INT(180)} }, { MP_QSTR_always_toggle_chip_select, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, + { MP_QSTR_grayscale, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); @@ -151,11 +171,14 @@ STATIC mp_obj_t displayio_epaperdisplay_make_new(const mp_obj_type_t *type, size self, display_bus, start_bufinfo.buf, start_bufinfo.len, stop_bufinfo.buf, stop_bufinfo.len, - args[ARG_width].u_int, args[ARG_height].u_int, args[ARG_ram_width].u_int, args[ARG_ram_height].u_int, args[ARG_colstart].u_int, args[ARG_rowstart].u_int, rotation, + args[ARG_width].u_int, args[ARG_height].u_int, args[ARG_ram_width].u_int, args[ARG_ram_height].u_int, + args[ARG_colstart].u_int, args[ARG_rowstart].u_int, rotation, args[ARG_set_column_window_command].u_int, args[ARG_set_row_window_command].u_int, args[ARG_set_current_column_command].u_int, args[ARG_set_current_row_command].u_int, - args[ARG_write_black_ram_command].u_int, args[ARG_black_bits_inverted].u_bool, write_color_ram_command, args[ARG_color_bits_inverted].u_bool, highlight_color, args[ARG_refresh_display_command].u_int, refresh_time, - busy_pin, args[ARG_busy_state].u_bool, seconds_per_frame, args[ARG_always_toggle_chip_select].u_bool + args[ARG_write_black_ram_command].u_int, args[ARG_black_bits_inverted].u_bool, write_color_ram_command, + args[ARG_color_bits_inverted].u_bool, highlight_color, args[ARG_refresh_display_command].u_int, refresh_time, + busy_pin, args[ARG_busy_state].u_bool, seconds_per_frame, + args[ARG_always_toggle_chip_select].u_bool, args[ARG_grayscale].u_bool ); return self; diff --git a/shared-bindings/displayio/EPaperDisplay.h b/shared-bindings/displayio/EPaperDisplay.h index e4b81c8838..352de899a9 100644 --- a/shared-bindings/displayio/EPaperDisplay.h +++ b/shared-bindings/displayio/EPaperDisplay.h @@ -44,7 +44,7 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t* uint16_t set_column_window_command, uint16_t set_row_window_command, uint16_t set_current_column_command, uint16_t set_current_row_command, uint16_t write_black_ram_command, bool black_bits_inverted, uint16_t write_color_ram_command, bool color_bits_inverted, uint32_t highlight_color, uint16_t refresh_display_command, mp_float_t refresh_time, - const mcu_pin_obj_t* busy_pin, bool busy_state, mp_float_t seconds_per_frame, bool always_toggle_chip_select); + const mcu_pin_obj_t* busy_pin, bool busy_state, mp_float_t seconds_per_frame, bool always_toggle_chip_select, bool grayscale); bool common_hal_displayio_epaperdisplay_refresh(displayio_epaperdisplay_obj_t* self); diff --git a/shared-module/displayio/ColorConverter.c b/shared-module/displayio/ColorConverter.c index dc64da03da..03ec99ceb1 100644 --- a/shared-module/displayio/ColorConverter.c +++ b/shared-module/displayio/ColorConverter.c @@ -165,9 +165,9 @@ void displayio_colorconverter_convert(displayio_colorconverter_t *self, const _d g8 = MIN(255,g8 + (randg&0x03)); } else { int bitmask = 0xFF >> colorspace->depth; - b8 = MIN(255,b8 + (randb&bitmask)); - r8 = MIN(255,r8 + (randr&bitmask)); - g8 = MIN(255,g8 + (randg&bitmask)); + b8 = MIN(255,b8 + (randb & bitmask)); + r8 = MIN(255,r8 + (randr & bitmask)); + g8 = MIN(255,g8 + (randg & bitmask)); } pixel = r8 << 16 | g8 << 8 | b8; } @@ -196,7 +196,8 @@ void displayio_colorconverter_convert(displayio_colorconverter_t *self, const _d return; } else if (colorspace->grayscale && colorspace->depth <= 8) { uint8_t luma = displayio_colorconverter_compute_luma(pixel); - output_color->pixel = luma >> (8 - colorspace->depth); + size_t bitmask = (1 << colorspace->depth) - 1; + output_color->pixel = (luma >> colorspace->grayscale_bit) & bitmask; output_color->opaque = true; return; } diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 46c7ea82e1..514b99a13b 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -49,7 +49,7 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t* uint16_t set_column_window_command, uint16_t set_row_window_command, uint16_t set_current_column_command, uint16_t set_current_row_command, uint16_t write_black_ram_command, bool black_bits_inverted, uint16_t write_color_ram_command, bool color_bits_inverted, uint32_t highlight_color, uint16_t refresh_display_command, mp_float_t refresh_time, - const mcu_pin_obj_t* busy_pin, bool busy_state, mp_float_t seconds_per_frame, bool chip_select) { + const mcu_pin_obj_t* busy_pin, bool busy_state, mp_float_t seconds_per_frame, bool chip_select, bool grayscale) { if (highlight_color != 0x000000) { self->core.colorspace.tricolor = true; self->core.colorspace.tricolor_hue = displayio_colorconverter_compute_hue(highlight_color); @@ -72,6 +72,7 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t* self->refreshing = false; self->milliseconds_per_frame = seconds_per_frame * 1000; self->chip_select = chip_select ? CHIP_SELECT_TOGGLE_EVERY_BYTE : CHIP_SELECT_UNTOUCHED; + self->grayscale = grayscale; self->start_sequence = start_sequence; self->start_sequence_len = start_sequence_len; @@ -230,17 +231,16 @@ bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, c uint32_t mask[mask_length]; uint8_t passes = 1; - if (self->core.colorspace.tricolor) { + if (self->core.colorspace.tricolor || self->grayscale) { passes = 2; } for (uint8_t pass = 0; pass < passes; pass++) { uint16_t remaining_rows = displayio_area_height(&clipped); - // added false parameter at end for SH1107_addressing quirk if (self->set_row_window_command != NO_COMMAND) { displayio_display_core_set_region_to_update(&self->core, self->set_column_window_command, self->set_row_window_command, self->set_current_column_command, self->set_current_row_command, - false, self->chip_select, &clipped, false); + false, self->chip_select, &clipped, false /* SH1107_addressing */); } uint8_t write_command = self->write_black_ram_command; @@ -270,8 +270,13 @@ bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, c memset(buffer, 0, buffer_size * sizeof(buffer[0])); self->core.colorspace.grayscale = true; + self->core.colorspace.grayscale_bit = 7; if (pass == 1) { - self->core.colorspace.grayscale = false; + if (self->grayscale) { // 4-color grayscale + self->core.colorspace.grayscale_bit = 6; + } else { // Tri-color + self->core.colorspace.grayscale = false; + } } displayio_display_core_fill_area(&self->core, &subrectangle, mask, buffer); diff --git a/shared-module/displayio/EPaperDisplay.h b/shared-module/displayio/EPaperDisplay.h index 3b9f6e3680..4103fe5fce 100644 --- a/shared-module/displayio/EPaperDisplay.h +++ b/shared-module/displayio/EPaperDisplay.h @@ -55,6 +55,7 @@ typedef struct { bool black_bits_inverted; bool color_bits_inverted; bool refreshing; + bool grayscale; display_chip_select_behavior_t chip_select; } displayio_epaperdisplay_obj_t; diff --git a/shared-module/displayio/Palette.h b/shared-module/displayio/Palette.h index da72f250f9..993912cc51 100644 --- a/shared-module/displayio/Palette.h +++ b/shared-module/displayio/Palette.h @@ -37,6 +37,7 @@ typedef struct { uint8_t bytes_per_cell; uint8_t tricolor_hue; uint8_t tricolor_luma; + uint8_t grayscale_bit; // The lowest grayscale bit. Normally 8 - depth. bool grayscale; bool tricolor; bool pixels_in_byte_share_row; diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index 411f9f3736..57d33b5651 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -48,6 +48,7 @@ void displayio_display_core_construct(displayio_display_core_t* self, 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) { self->colorspace.depth = color_depth; self->colorspace.grayscale = grayscale; + self->colorspace.grayscale_bit = 8 - color_depth; self->colorspace.pixels_in_byte_share_row = pixels_in_byte_share_row; self->colorspace.bytes_per_cell = bytes_per_cell; self->colorspace.reverse_pixels_in_byte = reverse_pixels_in_byte; From 95cb5961d26a4e1e048d48266d21547dc9229ba9 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 26 Oct 2020 16:58:56 -0700 Subject: [PATCH 1228/1293] Fix ESP32-S2 SPI when DMA is sometimes used --- ports/esp32s2/common-hal/busio/SPI.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index 1906ca6f00..490419f34a 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -357,6 +357,9 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_ou } else { hal->dma_enabled = 0; burst_length = sizeof(hal->hw->data_buf); + // When switching to non-DMA, we need to make sure DMA is off. Otherwise, + // the S2 will transmit zeroes instead of our data. + spi_ll_txdma_disable(hal->hw); } // This rounds up. From d86c6a74a48adc1e559845acd9821d4ad6f63590 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 26 Oct 2020 17:06:04 -0700 Subject: [PATCH 1229/1293] Add to CI build --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa576bbf0a..95bd2bfa47 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -418,6 +418,7 @@ jobs: fail-fast: false matrix: board: + - "adafruit_esp32s2_eink_portal" - "adafruit_metro_esp32s2" - "electroniccats_bastwifi" - "espressif_kaluga_1" From 2ba66599670c0d3d0f5ef5dc8780c34cf9d61231 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 26 Oct 2020 19:07:37 -0500 Subject: [PATCH 1230/1293] esp32s2: Makefile: restore --no-stub --- ports/esp32s2/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 5d8ccad50d..8d891edd02 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -331,10 +331,10 @@ $(BUILD)/firmware.uf2: $(BUILD)/circuitpython-firmware.bin $(Q)$(PYTHON3) $(TOP)/tools/uf2/utils/uf2conv.py -f 0xbfdd4eee -b 0x0000 -c -o $@ $^ flash: $(BUILD)/firmware.bin - esptool.py --chip esp32s2 -p $(PORT) -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ + esptool.py --chip esp32s2 -p $(PORT) --no-stub -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ flash-circuitpython-only: $(BUILD)/circuitpython-firmware.bin - esptool.py --chip esp32s2 -p $(PORT) -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x10000 $^ + esptool.py --chip esp32s2 -p $(PORT) --no-stub -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x10000 $^ include $(TOP)/py/mkrules.mk From 3a501a04951849ddd83455706fe87a6950d051fe Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 26 Oct 2020 19:18:37 -0500 Subject: [PATCH 1231/1293] esp32s2: canio: respond to review comments * explain the introduction of the temporary variable in get_t_config * get rid of unneeded __attribute__ * get rid of unneeded members of canio_can_obj_t * get rid of unneeded header inclusion --- ports/esp32s2/common-hal/canio/CAN.c | 14 ++++++-------- ports/esp32s2/common-hal/canio/CAN.h | 3 --- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/ports/esp32s2/common-hal/canio/CAN.c b/ports/esp32s2/common-hal/canio/CAN.c index f1741969db..768fde2431 100644 --- a/ports/esp32s2/common-hal/canio/CAN.c +++ b/ports/esp32s2/common-hal/canio/CAN.c @@ -33,7 +33,6 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/util.h" #include "supervisor/port.h" -#include "hal/twai_ll.h" #include "hal/twai_types.h" @@ -43,6 +42,10 @@ twai_timing_config_t get_t_config(int baudrate) { switch(baudrate) { case 1000000: { + // TWAI_TIMING_CONFIG_abc expands to a C designated initializer list + // { .brp = 4, ...}. This is only acceptable to the compiler as an + // initializer and 'return TWAI_TIMING_CONFIG_1MBITS()` is not valid. + // Instead, introduce a temporary, named variable and return it. twai_timing_config_t t_config = TWAI_TIMING_CONFIG_1MBITS(); return t_config; } @@ -116,7 +119,6 @@ twai_timing_config_t get_t_config(int baudrate) { } } -__attribute__((optimize("O0"))) void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *tx, mcu_pin_obj_t *rx, int baudrate, bool loopback, bool silent) { #define DIV_ROUND(a, b) (((a) + (b)/2) / (b)) @@ -129,7 +131,7 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *tx, mc mp_raise_ValueError(translate("loopback + silent mode not supported by peripheral")); } - self->t_config = get_t_config(baudrate);; + twai_timing_config_t t_config = get_t_config(baudrate); twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT(-1, -1, TWAI_MODE_NORMAL); g_config.tx_io = tx->number; g_config.rx_io = rx->number; @@ -139,14 +141,10 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, mcu_pin_obj_t *tx, mc if (silent) { g_config.mode = TWAI_MODE_LISTEN_ONLY; } - self->g_config = g_config; - { twai_filter_config_t f_config = TWAI_FILTER_CONFIG_ACCEPT_ALL(); - self->f_config = f_config; - } - esp_err_t result = twai_driver_install(&self->g_config, &self->t_config, &self->f_config); + esp_err_t result = twai_driver_install(&g_config, &t_config, &f_config); if (result == ESP_ERR_NO_MEM) { mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); } else if (result == ESP_ERR_INVALID_ARG) { diff --git a/ports/esp32s2/common-hal/canio/CAN.h b/ports/esp32s2/common-hal/canio/CAN.h index e15d515908..85fb6972be 100644 --- a/ports/esp32s2/common-hal/canio/CAN.h +++ b/ports/esp32s2/common-hal/canio/CAN.h @@ -46,7 +46,4 @@ typedef struct canio_can_obj { bool silent:1; bool auto_restart:1; bool fifo_in_use:1; - twai_filter_config_t f_config; - twai_general_config_t g_config; - twai_timing_config_t t_config; } canio_can_obj_t; From ba0a3769e343b465c82dde4aafe99bcf11c84dbe Mon Sep 17 00:00:00 2001 From: _fonzlate Date: Mon, 26 Oct 2020 17:08:51 +0000 Subject: [PATCH 1232/1293] Translated using Weblate (Dutch) Currently translated at 100.0% (836 of 836 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/nl/ --- locale/nl.po | 122 ++++++++++++++++++++++++++------------------------- 1 file changed, 63 insertions(+), 59 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index ca7530c0fd..59b1f2e73b 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -6,15 +6,15 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-16 19:50-0500\n" -"PO-Revision-Date: 2020-09-09 16:05+0000\n" -"Last-Translator: Jelle Jager \n" +"PO-Revision-Date: 2020-10-27 16:47+0000\n" +"Last-Translator: _fonzlate \n" "Language-Team: none\n" "Language: nl\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.3-dev\n" +"X-Generator: Weblate 4.3.2-dev\n" #: main.c msgid "" @@ -98,7 +98,7 @@ msgstr "%q moet een tuple van lengte 2 zijn" #: shared-bindings/canio/Match.c msgid "%q out of range" -msgstr "" +msgstr "%q buiten bereik" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" @@ -252,7 +252,7 @@ msgstr "'return' buiten de functie" #: py/compile.c msgid "'yield from' inside async function" -msgstr "" +msgstr "'yield from' binnen asynchrone functie" #: py/compile.c msgid "'yield' outside function" @@ -281,7 +281,7 @@ msgstr "Een hardware interrupt kanaal is al in gebruik" #: ports/esp32s2/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" -msgstr "" +msgstr "ADC2 wordt gebruikt door WiFi" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format @@ -299,7 +299,7 @@ msgstr "Alle I2C peripherals zijn in gebruik" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" -msgstr "" +msgstr "Alle RX FIFO's zijn in gebruik" #: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" @@ -342,7 +342,7 @@ msgstr "Advertising is al bezig." #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Already have all-matches listener" -msgstr "" +msgstr "Heeft al een luisteraar voor 'all-matches'" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c @@ -351,7 +351,7 @@ msgstr "Wordt al uitgevoerd" #: ports/esp32s2/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" -msgstr "" +msgstr "Zoekt al naar WiFi netwerken" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -399,7 +399,7 @@ msgstr "heap allocatie geprobeerd terwijl MicroPython VM niet draait." #: shared-bindings/wifi/Radio.c msgid "Authentication failure" -msgstr "" +msgstr "Authenticatiefout" #: main.c msgid "Auto-reload is off.\n" @@ -617,7 +617,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "CircuitPython was unable to allocate the heap.\n" -msgstr "" +msgstr "CircuitPython kon het heap geheugen niet toewijzen.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." @@ -658,7 +658,7 @@ msgstr "Corrupt raw code" #: ports/cxd56/common-hal/camera/Camera.c msgid "Could not initialize Camera" -msgstr "" +msgstr "Kon camera niet initialiseren" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" @@ -695,7 +695,7 @@ msgstr "Kan PWM niet herstarten" #: ports/esp32s2/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" -msgstr "" +msgstr "Kon klok niet ophalen" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" @@ -789,7 +789,7 @@ msgstr "ECB werkt alleen met 16 bytes tegelijkertijd" #: ports/esp32s2/common-hal/busio/SPI.c msgid "ESP-IDF memory allocation failed" -msgstr "" +msgstr "ESP-IDF geheugen toewijzing mislukt" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -850,7 +850,7 @@ msgstr "FFT alleen voor ndarrays gedefineerd" #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" -msgstr "" +msgstr "SSL handdruk mislukt" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." @@ -877,11 +877,11 @@ msgstr "Mislukt een RX buffer van %d bytes te alloceren" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" -msgstr "" +msgstr "Kon WiFi geheugen niet toewijzen" #: ports/esp32s2/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" -msgstr "" +msgstr "Kon WiFi scan geheugen niet toewijzen" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" @@ -893,7 +893,7 @@ msgstr "Verbinding mislukt: timeout" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to init wifi" -msgstr "" +msgstr "Kon WiFi niet initialiseren" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" @@ -915,11 +915,11 @@ msgstr "Bestand bestaat" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" -msgstr "" +msgstr "Filters zijn te complex" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" -msgstr "" +msgstr "Formaat wordt niet ondersteund" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format @@ -963,7 +963,7 @@ msgstr "Hardware in gebruik, probeer alternatieve pinnen" #: shared-bindings/wifi/Radio.c msgid "Hostname must be between 1 and 253 characters" -msgstr "" +msgstr "Hostnaam moet tussen 1 en 253 karakters zijn" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -996,7 +996,7 @@ msgstr "Incorrecte buffer grootte" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" -msgstr "" +msgstr "Invoer duurt te lang" #: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" @@ -1044,7 +1044,7 @@ msgstr "Ongeldig BMP bestand" #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" -msgstr "" +msgstr "Ongeldig BSSID" #: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c @@ -1095,7 +1095,7 @@ msgstr "Ongeldig formaat stuk grootte" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "Invalid frequency" -msgstr "" +msgstr "Onjuiste frequentie" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" @@ -1218,7 +1218,7 @@ msgstr "Maximale x waarde indien gespiegeld is %d" #: shared-bindings/canio/Message.c msgid "Messages limited to 8 bytes" -msgstr "" +msgstr "Berichten zijn beperkt tot 8 bytes" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." @@ -1330,11 +1330,11 @@ msgstr "Geen lange integer ondersteuning" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more channels available" -msgstr "" +msgstr "Geen kanalen meer beschikbaar" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more timers available" -msgstr "" +msgstr "Geen timers meer beschikbaar" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." @@ -1342,7 +1342,7 @@ msgstr "Geen timers meer beschikbaar op deze pin." #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" -msgstr "" +msgstr "Geen netwerk met dat SSID gevonden" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" @@ -1366,7 +1366,7 @@ msgstr "Nordic Soft Device assertion mislukt." #: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c msgid "Not a valid IP string" -msgstr "" +msgstr "Geen geldige IP string" #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -1384,7 +1384,7 @@ msgstr "Opgeslagen code wordt niet uitgevoerd.\n" #: shared-bindings/_bleio/__init__.c msgid "Not settable" -msgstr "" +msgstr "Niet instelbaar" #: shared-bindings/util.c msgid "" @@ -1403,11 +1403,11 @@ msgstr "Alleen 8 of 16 bit mono met " #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Only IPv4 SOCK_STREAM sockets supported" -msgstr "" +msgstr "Alleen IPv4 SOCK_STREAM sockets worden ondersteund" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" -msgstr "" +msgstr "Alleen IPv4 adressen worden ondersteund" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1428,15 +1428,15 @@ msgstr "" #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" -msgstr "" +msgstr "Er kan maar één kleur per keer transparant zijn" #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" -msgstr "" +msgstr "Alleen raw int ondersteund voor IP" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Out of sockets" -msgstr "" +msgstr "Geen sockets meer beschikbaar" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." @@ -1510,6 +1510,8 @@ msgid "" "Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " "instead" msgstr "" +"Poort ondersteund geen PWM drager. Geef een pin, frequentie en inschakeltijd " +"op" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c @@ -1519,6 +1521,8 @@ msgid "" "Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " "instead" msgstr "" +"Poort accepteert geen pin of frequentie. Stel een PWMOut Carrier samen en " +"geef die op" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" @@ -1584,7 +1588,7 @@ msgstr "Verversing te snel" #: shared-bindings/canio/RemoteTransmissionRequest.c msgid "RemoteTransmissionRequests limited to 8 bytes" -msgstr "" +msgstr "RemoteTransmissionRequests is beperkt tot 8 bytes" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" @@ -1657,11 +1661,11 @@ msgstr "Serializer in gebruik" #: shared-bindings/ssl/SSLContext.c msgid "Server side context cannot have hostname" -msgstr "" +msgstr "Context aan de serverkant kan geen hostnaam hebben" #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" -msgstr "" +msgstr "Afmeting niet ondersteund" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." @@ -1676,7 +1680,7 @@ msgstr "Slices niet ondersteund" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" -msgstr "" +msgstr "SocketPool kan alleen met wifi.radio gebruikt worden" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" @@ -1724,7 +1728,7 @@ msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" -msgstr "" +msgstr "De lengte van rgb_pins moet 6, 12, 18, 24 of 30 zijn" #: supervisor/shared/safe_mode.c msgid "" @@ -1783,7 +1787,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "To exit, please reset the board without " -msgstr "" +msgstr "Om te beëindigen, reset het bord zonder " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1856,7 +1860,7 @@ msgstr "Niet in staat buffers voor gesigneerde conversie te alloceren" #: ports/esp32s2/common-hal/busio/I2C.c msgid "Unable to create lock" -msgstr "" +msgstr "Kan vergrendeling niet maken" #: shared-module/displayio/I2CDisplay.c #, c-format @@ -1887,11 +1891,11 @@ msgstr "Onverwacht mrfx uuid type" #: ports/esp32s2/common-hal/socketpool/Socket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" -msgstr "" +msgstr "Niet behandelde ESP TLS fout %d %d %x %d" #: shared-bindings/wifi/Radio.c msgid "Unknown failure" -msgstr "" +msgstr "Onbekende fout" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format @@ -2009,7 +2013,7 @@ msgstr "" #: shared-bindings/wifi/Radio.c msgid "WiFi password must be between 8 and 63 characters" -msgstr "" +msgstr "WiFi wachtwoord moet tussen 8 en 63 karakters bevatten" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" @@ -2164,7 +2168,7 @@ msgstr "buffer te klein" #: shared-bindings/socketpool/Socket.c msgid "buffer too small for requested bytes" -msgstr "" +msgstr "buffer te klein voor gevraagde bytes" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" @@ -2185,7 +2189,7 @@ msgstr "butes > 8 niet ondersteund" #: py/objarray.c msgid "bytes length not a multiple of item size" -msgstr "" +msgstr "bytes lengte is geen veelvoud van itemgrootte" #: py/objstr.c msgid "bytes value out of range" @@ -2503,11 +2507,11 @@ msgstr "uitzonderingen moeten afleiden van BaseException" #: shared-bindings/canio/CAN.c msgid "expected '%q' but got '%q'" -msgstr "" +msgstr "verwachtte '%q' maar ontving '%q'" #: shared-bindings/canio/CAN.c msgid "expected '%q' or '%q' but got '%q'" -msgstr "" +msgstr "verwachtte '%q' of '%q' maar ontving '%q'" #: py/objstr.c msgid "expected ':' after format specifier" @@ -2721,7 +2725,7 @@ msgstr "oorspronkelijke waarden moeten itereerbaar zijn" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c msgid "initial_value length is wrong" -msgstr "" +msgstr "lengte van initial_value is onjuist" #: py/compile.c msgid "inline assembler must be a function" @@ -2798,7 +2802,7 @@ msgstr "ongeldige formaatspecificatie" #: shared-bindings/wifi/Radio.c msgid "invalid hostname" -msgstr "" +msgstr "onjuiste hostnaam" #: extmod/modussl_axtls.c msgid "invalid key" @@ -3162,11 +3166,11 @@ msgstr "ord() verwacht een teken (char) maar vond een string van lengte %d" #: shared-bindings/displayio/Bitmap.c msgid "out of range of source" -msgstr "" +msgstr "buiten bereik van bron" #: shared-bindings/displayio/Bitmap.c msgid "out of range of target" -msgstr "" +msgstr "buiten bereik van doel" #: py/objint_mpz.c msgid "overflow converting long int to machine word" @@ -3175,7 +3179,7 @@ msgstr "overloop bij converteren van long int naar machine word" #: py/modstruct.c #, c-format msgid "pack expected %d items for packing (got %d)" -msgstr "" +msgstr "pack verwachtte %d elementen (ontving %d)" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" @@ -3244,7 +3248,7 @@ msgstr "pow() met 3 argumenten vereist integers" #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" -msgstr "" +msgstr "druk bootknop in bij opstarten.\n" #: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h #: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h @@ -3252,7 +3256,7 @@ msgstr "" #: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "pressing both buttons at start up.\n" -msgstr "" +msgstr "druk beide knoppen in bij opstarten.\n" #: extmod/modutimeq.c msgid "queue overflow" @@ -3379,7 +3383,7 @@ msgstr "sosfilt vereist itereerbare argumenten" #: shared-bindings/displayio/Bitmap.c msgid "source palette too large" -msgstr "" +msgstr "bronpalet te groot" #: py/objstr.c msgid "start/end indices" @@ -3514,7 +3518,7 @@ msgstr "objecttype '%q' heeft geen attribuut '%q'" #: py/objgenerator.c msgid "type object 'generator' has no attribute '__await__'" -msgstr "" +msgstr "het type object 'generator' heeft geen attribuut '__await__'" #: py/objtype.c msgid "type takes 1 or 3 arguments" @@ -3624,7 +3628,7 @@ msgstr "watchdog time-out moet groter zijn dan 0" #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" -msgstr "" +msgstr "breedte moet groter dan nul zijn" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" From f2e79ce89da0ed926a5b10c22e0cd3fc81197e6c Mon Sep 17 00:00:00 2001 From: Jelle Jager Date: Mon, 26 Oct 2020 16:37:46 +0000 Subject: [PATCH 1233/1293] Translated using Weblate (Dutch) Currently translated at 100.0% (836 of 836 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/nl/ --- locale/nl.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index 59b1f2e73b..f6efee0195 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-16 19:50-0500\n" "PO-Revision-Date: 2020-10-27 16:47+0000\n" -"Last-Translator: _fonzlate \n" +"Last-Translator: Jelle Jager \n" "Language-Team: none\n" "Language: nl\n" "MIME-Version: 1.0\n" @@ -481,7 +481,7 @@ msgstr "Buffer lengte moet een veelvoud van 512 zijn" #: ports/stm/common-hal/sdioio/SDCard.c msgid "Buffer must be a multiple of 512 bytes" -msgstr "Buffer moet een veelvoud van 512 zijn" +msgstr "Buffer moet een veelvoud van 512 bytes zijn" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" From e00ae204db06f6505f9965fb5433d8e3cb4e220c Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 27 Oct 2020 17:48:01 +0100 Subject: [PATCH 1234/1293] 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 | 12 ++++++++++++ locale/cs.po | 12 ++++++++++++ locale/de_DE.po | 12 ++++++++++++ locale/el.po | 12 ++++++++++++ locale/es.po | 20 +++++++++++++++++--- locale/fil.po | 12 ++++++++++++ locale/fr.po | 12 ++++++++++++ locale/hi.po | 12 ++++++++++++ locale/it_IT.po | 12 ++++++++++++ locale/ja.po | 12 ++++++++++++ locale/ko.po | 12 ++++++++++++ locale/nl.po | 12 ++++++++++++ locale/pl.po | 12 ++++++++++++ locale/pt_BR.po | 12 ++++++++++++ locale/sv.po | 12 ++++++++++++ locale/zh_Latn_pinyin.po | 12 ++++++++++++ 16 files changed, 197 insertions(+), 3 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 958ff1e6b2..94a874826d 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -2918,6 +2918,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3351,6 +3359,10 @@ msgstr "memulai ulang software(soft reboot)\n" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "sorted axis can't be longer than 65535" +msgstr "" + #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 6a3d00d993..b8da707413 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -2875,6 +2875,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3307,6 +3315,10 @@ msgstr "" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "sorted axis can't be longer than 65535" +msgstr "" + #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 0e2e5a038e..4d43a26557 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -2954,6 +2954,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "maximale Rekursionstiefe überschritten" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3392,6 +3400,10 @@ msgstr "weicher reboot\n" msgid "sort argument must be an ndarray" msgstr "sortierungs Argument muss ein ndarray sein" +#: extmod/ulab/code/numerical/numerical.c +msgid "sorted axis can't be longer than 65535" +msgstr "" + #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" diff --git a/locale/el.po b/locale/el.po index 5e55065b30..80fdb7eca1 100644 --- a/locale/el.po +++ b/locale/el.po @@ -2870,6 +2870,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3302,6 +3310,10 @@ msgstr "" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "sorted axis can't be longer than 65535" +msgstr "" + #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" diff --git a/locale/es.po b/locale/es.po index 5cf9cf8654..38e0ff8d39 100644 --- a/locale/es.po +++ b/locale/es.po @@ -318,7 +318,9 @@ msgstr "Todos los canales de eventos estan siendo usados" #: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "All sync event channels in use" -msgstr "Todos los canales de eventos de sincronización (sync event channels) están siendo utilizados" +msgstr "" +"Todos los canales de eventos de sincronización (sync event channels) están " +"siendo utilizados" #: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" @@ -2941,6 +2943,14 @@ msgstr "max_lenght debe ser > 0" msgid "maximum recursion depth exceeded" msgstr "profundidad máxima de recursión excedida" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3378,6 +3388,10 @@ msgstr "reinicio suave\n" msgid "sort argument must be an ndarray" msgstr "argumento de ordenado debe ser un ndarray" +#: extmod/ulab/code/numerical/numerical.c +msgid "sorted axis can't be longer than 65535" +msgstr "" + #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "el arreglo sos debe de forma (n_section, 6)" @@ -4135,8 +4149,8 @@ msgstr "zi debe ser una forma (n_section,2)" #~ "pequeño.\n" #~ "Aumente los límites del tamaño del stack y presione reset (después de " #~ "expulsarCIRCUITPY).\n" -#~ "Si no cambió el stack, entonces reporte un issue aquí con el contenido " -#~ "de su unidad CIRCUITPY:\n" +#~ "Si no cambió el stack, entonces reporte un issue aquí con el contenido de " +#~ "su unidad CIRCUITPY:\n" #~ msgid "" #~ "The microcontroller's power dipped. Please make sure your power supply " diff --git a/locale/fil.po b/locale/fil.po index 7a91f5c859..838bca98ba 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -2919,6 +2919,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "lumagpas ang maximum recursion depth" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3355,6 +3363,10 @@ msgstr "malambot na reboot\n" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "sorted axis can't be longer than 65535" +msgstr "" + #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index cf0ea4fc31..b4a15ee1f9 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -2965,6 +2965,14 @@ msgstr "max_length doit être > 0" msgid "maximum recursion depth exceeded" msgstr "profondeur maximale de récursivité dépassée" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3404,6 +3412,10 @@ msgstr "redémarrage logiciel\n" msgid "sort argument must be an ndarray" msgstr "l'argument de «sort» doit être un ndarray" +#: extmod/ulab/code/numerical/numerical.c +msgid "sorted axis can't be longer than 65535" +msgstr "" + #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "le tableau sos doit être de forme (n_section, 6)" diff --git a/locale/hi.po b/locale/hi.po index bd6d5395bf..9174580a26 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -2870,6 +2870,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3302,6 +3310,10 @@ msgstr "" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "sorted axis can't be longer than 65535" +msgstr "" + #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 9ed3bb1e1c..6345c095c7 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -2921,6 +2921,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "profondità massima di ricorsione superata" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3362,6 +3370,10 @@ msgstr "soft reboot\n" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "sorted axis can't be longer than 65535" +msgstr "" + #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" diff --git a/locale/ja.po b/locale/ja.po index 8c3751c8e8..abd2e1803d 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -2900,6 +2900,14 @@ msgstr "max_lengthは0より大きくなければなりません" msgid "maximum recursion depth exceeded" msgstr "最大の再帰深度を超えました" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3335,6 +3343,10 @@ msgstr "ソフトリブート\n" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "sorted axis can't be longer than 65535" +msgstr "" + #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 9c5750b9f5..e5b728b846 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -2876,6 +2876,14 @@ msgstr "" msgid "maximum recursion depth exceeded" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3308,6 +3316,10 @@ msgstr "" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "sorted axis can't be longer than 65535" +msgstr "" + #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index f6efee0195..234bb930ae 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -2934,6 +2934,14 @@ msgstr "max_length moet >0 zijn" msgid "maximum recursion depth exceeded" msgstr "maximale recursiediepte overschreden" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3369,6 +3377,10 @@ msgstr "zachte herstart\n" msgid "sort argument must be an ndarray" msgstr "sorteerargument moet een ndarray zijn" +#: extmod/ulab/code/numerical/numerical.c +msgid "sorted axis can't be longer than 65535" +msgstr "" + #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "sos array moet vorm (n_section, 6) hebben" diff --git a/locale/pl.po b/locale/pl.po index f6292a0a3b..cadb2c43eb 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -2893,6 +2893,14 @@ msgstr "max_length musi być > 0" msgid "maximum recursion depth exceeded" msgstr "przekroczono dozwoloną głębokość rekurencji" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3327,6 +3335,10 @@ msgstr "programowy reset\n" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "sorted axis can't be longer than 65535" +msgstr "" + #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index b80afeb1aa..2c3d9b2074 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -2954,6 +2954,14 @@ msgstr "max_length deve ser > 0" msgid "maximum recursion depth exceeded" msgstr "a recursão máxima da profundidade foi excedida" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3395,6 +3403,10 @@ msgstr "reinicialização soft\n" msgid "sort argument must be an ndarray" msgstr "o argumento da classificação deve ser um ndarray" +#: extmod/ulab/code/numerical/numerical.c +msgid "sorted axis can't be longer than 65535" +msgstr "" + #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "o sos da matriz deve estar na forma (n_section, 6)" diff --git a/locale/sv.po b/locale/sv.po index 989b8257e7..f2fa50189b 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -2927,6 +2927,14 @@ msgstr "max_length måste vara > 0" msgid "maximum recursion depth exceeded" msgstr "maximal rekursionsdjup överskriden" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3362,6 +3370,10 @@ msgstr "mjuk omstart\n" msgid "sort argument must be an ndarray" msgstr "argumentet sort måste vara en ndarray" +#: extmod/ulab/code/numerical/numerical.c +msgid "sorted axis can't be longer than 65535" +msgstr "" + #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "sos array måste ha form (n_section, 6)" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 13d0dfa796..5ed34cc6c3 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -2917,6 +2917,14 @@ msgstr "Max_length bìxū > 0" msgid "maximum recursion depth exceeded" msgstr "chāochū zuìdà dìguī shēndù" +#: extmod/ulab/code/approx/approx.c +msgid "maxiter must be > 0" +msgstr "" + +#: extmod/ulab/code/approx/approx.c +msgid "maxiter should be > 0" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3351,6 +3359,10 @@ msgstr "ruǎn chóngqǐ\n" msgid "sort argument must be an ndarray" msgstr "páixù cānshù bìxū shì ndarray" +#: extmod/ulab/code/numerical/numerical.c +msgid "sorted axis can't be longer than 65535" +msgstr "" + #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" msgstr "sos shùzǔ de xíngzhuàng bìxū wèi (n_section, 6)" From 80029f6929ebbf6c0a02c5320e59220b0501bd55 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 28 Oct 2020 00:12:13 +0530 Subject: [PATCH 1235/1293] rotaryio implementation for esp32s2 --- .../common-hal/rotaryio/IncrementalEncoder.c | 115 ++++++++++++++++++ .../common-hal/rotaryio/IncrementalEncoder.h | 41 +++++++ ports/esp32s2/common-hal/rotaryio/__init__.c | 1 + ports/esp32s2/mpconfigport.mk | 2 +- 4 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c create mode 100644 ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.h create mode 100644 ports/esp32s2/common-hal/rotaryio/__init__.c diff --git a/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c b/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c new file mode 100644 index 0000000000..bbff363740 --- /dev/null +++ b/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c @@ -0,0 +1,115 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 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 "common-hal/rotaryio/IncrementalEncoder.h" + +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +#include "driver/pcnt.h" + +static void pcnt_reset(int unit) { + // Initialize PCNT's counter + pcnt_counter_pause(unit); + pcnt_counter_clear(unit); + + // Everything is set up, now go to counting + pcnt_counter_resume(unit); +} + +static void pcnt_init(int unit, rotaryio_incrementalencoder_obj_t* self) { + // Prepare configuration for the PCNT unit + pcnt_config_t pcnt_config = { + // Set PCNT input signal and control GPIOs + .pulse_gpio_num = self->pin_a->number, + .ctrl_gpio_num = self->pin_b->number, + .channel = PCNT_CHANNEL_0, + .unit = unit, + // What to do on the positive / negative edge of pulse input? + .pos_mode = PCNT_COUNT_DEC, // Count up on the positive edge + .neg_mode = PCNT_COUNT_INC, // Keep the counter value on the negative edge + // What to do when control input is low or high? + .lctrl_mode = PCNT_MODE_REVERSE, // Reverse counting direction if low + .hctrl_mode = PCNT_MODE_KEEP, // Keep the primary counter mode if high + }; + // Initialize PCNT unit + pcnt_unit_config(&pcnt_config); + + // Configure channel 1 + pcnt_config.pulse_gpio_num = self->pin_b->number; + pcnt_config.ctrl_gpio_num = self->pin_a->number; + pcnt_config.channel = PCNT_CHANNEL_1; + pcnt_config.pos_mode = PCNT_COUNT_INC; + pcnt_config.neg_mode = PCNT_COUNT_DEC; + pcnt_unit_config(&pcnt_config); + + // Configure and enable the input filter + pcnt_set_filter_value(unit, 100); + pcnt_filter_enable(unit); + + pcnt_reset(unit); +} + +void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencoder_obj_t* self, + const mcu_pin_obj_t* pin_a, const mcu_pin_obj_t* pin_b) { + claim_pin(pin_a); + claim_pin(pin_b); + + self->pin_a = pin_a; + self->pin_b = pin_b; + + self->position = 0; + + pcnt_init(PCNT_UNIT_0, self); +} + +bool common_hal_rotaryio_incrementalencoder_deinited(rotaryio_incrementalencoder_obj_t* self) { + return self->pin_a == NULL; +} + +void common_hal_rotaryio_incrementalencoder_deinit(rotaryio_incrementalencoder_obj_t* self) { + if (common_hal_rotaryio_incrementalencoder_deinited(self)) { + return; + } + + reset_pin_number(self->pin_a->number); + self->pin_a = NULL; + + reset_pin_number(self->pin_b->number); + self->pin_b = NULL; +} + +mp_int_t common_hal_rotaryio_incrementalencoder_get_position(rotaryio_incrementalencoder_obj_t* self) { + int16_t count = 0; + pcnt_get_counter_value(PCNT_UNIT_0, &count); + return self->position+count; +} + +void common_hal_rotaryio_incrementalencoder_set_position(rotaryio_incrementalencoder_obj_t* self, + mp_int_t new_position) { + self->position = new_position; + pcnt_reset(PCNT_UNIT_0); +} diff --git a/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.h b/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.h new file mode 100644 index 0000000000..0cc2830fb7 --- /dev/null +++ b/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.h @@ -0,0 +1,41 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 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 MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t * pin_a; + const mcu_pin_obj_t * pin_b; + mp_int_t position; +} rotaryio_incrementalencoder_obj_t; + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H diff --git a/ports/esp32s2/common-hal/rotaryio/__init__.c b/ports/esp32s2/common-hal/rotaryio/__init__.c new file mode 100644 index 0000000000..0aae79c26a --- /dev/null +++ b/ports/esp32s2/common-hal/rotaryio/__init__.c @@ -0,0 +1 @@ +// No rotaryio module functions. diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 4e8a7bdef2..dadab37515 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -19,7 +19,7 @@ CIRCUITPY_AUDIOIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 -CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_ROTARYIO = 1 CIRCUITPY_NVM = 0 # We don't have enough endpoints to include MIDI. CIRCUITPY_USB_MIDI = 0 From 54c0e98a37fc3c997d3a7a566a67e33d1636f46a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 27 Oct 2020 13:58:23 -0700 Subject: [PATCH 1236/1293] Fix openbook build --- ports/atmel-samd/boards/openbook_m4/board.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/openbook_m4/board.c b/ports/atmel-samd/boards/openbook_m4/board.c index f0010f6d78..07dd1741ac 100644 --- a/ports/atmel-samd/boards/openbook_m4/board.c +++ b/ports/atmel-samd/boards/openbook_m4/board.c @@ -97,7 +97,8 @@ void board_init(void) { &pin_PA01, // busy_pin false, // busy_state 5, // seconds_per_frame - false); // chip_select (don't always toggle chip select) + false, // chip_select (don't always toggle chip select) + false); // grayscale } bool board_requests_safe_mode(void) { From 91e85e8037c058f5029f9ba61d6da952eeac436e Mon Sep 17 00:00:00 2001 From: Adolfo Jayme Barrientos Date: Tue, 27 Oct 2020 17:19:22 +0000 Subject: [PATCH 1237/1293] Translated using Weblate (Spanish) Currently translated at 99.6% (836 of 839 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/es.po b/locale/es.po index 38e0ff8d39..6b8b96d2d7 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: 2020-10-16 19:50-0500\n" -"PO-Revision-Date: 2020-10-22 22:15+0000\n" -"Last-Translator: Alvaro Figueroa \n" +"PO-Revision-Date: 2020-10-27 21:01+0000\n" +"Last-Translator: Adolfo Jayme Barrientos \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.3.1\n" +"X-Generator: Weblate 4.3.2-dev\n" #: main.c msgid "" @@ -33,7 +33,7 @@ msgid "" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" "\n" -"Reporte un problema con el contenido de su unidad CIRCUITPY en\n" +"Presente un problema con el contenido de su unidad CIRCUITPY en\n" "https://github.com/adafruit/circuitpython/issues\n" #: py/obj.c From 54c26a772ba071d129c0e30e8fc6d44e1be74029 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 27 Oct 2020 16:59:40 +0000 Subject: [PATCH 1238/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (839 of 839 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 2c3d9b2074..16631c32a7 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: 2020-10-16 19:50-0500\n" -"PO-Revision-Date: 2020-10-21 19:58+0000\n" +"PO-Revision-Date: 2020-10-27 21:01+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.3.1\n" +"X-Generator: Weblate 4.3.2-dev\n" #: main.c msgid "" @@ -2956,11 +2956,11 @@ msgstr "a recursão máxima da profundidade foi excedida" #: extmod/ulab/code/approx/approx.c msgid "maxiter must be > 0" -msgstr "" +msgstr "maxiter deve ser > 0" #: extmod/ulab/code/approx/approx.c msgid "maxiter should be > 0" -msgstr "" +msgstr "maxiter pode ser > 0" #: py/runtime.c #, c-format @@ -3405,7 +3405,7 @@ msgstr "o argumento da classificação deve ser um ndarray" #: extmod/ulab/code/numerical/numerical.c msgid "sorted axis can't be longer than 65535" -msgstr "" +msgstr "o eixo ordenado não pode ser maior do que 65535" #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" From 32f6f64a288903395358b4be73a92fe03a71fc67 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 27 Oct 2020 22:01:17 +0100 Subject: [PATCH 1239/1293] 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 | 32 +++++++++++++++++++++++++++++--- locale/cs.po | 32 +++++++++++++++++++++++++++++--- locale/de_DE.po | 32 +++++++++++++++++++++++++++++--- locale/el.po | 32 +++++++++++++++++++++++++++++--- locale/es.po | 32 +++++++++++++++++++++++++++++--- locale/fil.po | 32 +++++++++++++++++++++++++++++--- locale/fr.po | 32 +++++++++++++++++++++++++++++--- locale/hi.po | 32 +++++++++++++++++++++++++++++--- locale/it_IT.po | 32 +++++++++++++++++++++++++++++--- locale/ja.po | 32 +++++++++++++++++++++++++++++--- locale/ko.po | 32 +++++++++++++++++++++++++++++--- locale/nl.po | 32 +++++++++++++++++++++++++++++--- locale/pl.po | 32 +++++++++++++++++++++++++++++--- locale/pt_BR.po | 32 +++++++++++++++++++++++++++++--- locale/sv.po | 32 +++++++++++++++++++++++++++++--- locale/zh_Latn_pinyin.po | 32 +++++++++++++++++++++++++++++--- 16 files changed, 464 insertions(+), 48 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 94a874826d..7debab27ac 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -292,11 +292,16 @@ msgstr "Alamat harus sepanjang %d byte" msgid "Address type out of range" msgstr "Jenis alamat di luar batas" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Semua perangkat I2C sedang digunakan" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -413,6 +418,10 @@ msgstr "" "Auto-reload aktif. Silahkan simpan data-data (files) melalui USB untuk " "menjalankannya atau masuk ke REPL untukmenonaktifkan.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -793,7 +802,7 @@ msgstr "Mode kendara tidak digunakan saat arah input." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB hanya beroperasi pada 16 byte di satu waktu" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -919,6 +928,7 @@ msgid "File exists" msgstr "File sudah ada" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1140,7 +1150,7 @@ msgstr "Pin untuk channel kanan tidak valid" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2884,6 +2894,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "" @@ -3237,6 +3251,8 @@ msgstr "" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3493,6 +3509,16 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/cs.po b/locale/cs.po index b8da707413..e4f677d8e2 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -292,11 +292,16 @@ msgstr "" msgid "Address type out of range" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -411,6 +416,10 @@ msgid "" "disable.\n" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -779,7 +788,7 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -905,6 +914,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1123,7 +1133,7 @@ msgstr "" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2841,6 +2851,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "" @@ -3193,6 +3207,8 @@ msgstr "" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3448,6 +3464,16 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/de_DE.po b/locale/de_DE.po index 4d43a26557..141a5e8c03 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -291,11 +291,16 @@ msgstr "Die Adresse muss %d Bytes lang sein" msgid "Address type out of range" msgstr "Adresstyp außerhalb des zulässigen Bereichs" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Alle I2C-Peripheriegeräte sind in Benutzung" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -414,6 +419,10 @@ msgstr "" "Automatisches Neuladen ist aktiv. Speichere Dateien über USB um sie " "auszuführen oder verbinde dich mit der REPL zum Deaktivieren.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -789,7 +798,7 @@ msgstr "Drive mode wird nicht verwendet, wenn die Richtung input ist." msgid "ECB only operates on 16 bytes at a time" msgstr "Die EZB arbeitet jeweils nur mit 16 Bytes" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -916,6 +925,7 @@ msgid "File exists" msgstr "Datei existiert" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filter zu komplex" @@ -1140,7 +1150,7 @@ msgstr "Ungültiger Pin für rechten Kanal" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2920,6 +2930,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "long int wird in diesem Build nicht unterstützt" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "fehlformatierter f-string" @@ -3276,6 +3290,8 @@ msgstr "pow () mit 3 Argumenten erfordert Integer" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3534,6 +3550,16 @@ msgstr "Tupelindex außerhalb des Bereichs" msgid "tuple/list has wrong length" msgstr "tupel/list hat falsche Länge" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/el.po b/locale/el.po index 80fdb7eca1..cc6da670cd 100644 --- a/locale/el.po +++ b/locale/el.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -287,11 +287,16 @@ msgstr "" msgid "Address type out of range" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -406,6 +411,10 @@ msgid "" "disable.\n" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -774,7 +783,7 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -900,6 +909,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1118,7 +1128,7 @@ msgstr "" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2836,6 +2846,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "" @@ -3188,6 +3202,8 @@ msgstr "" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3443,6 +3459,16 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/es.po b/locale/es.po index 6b8b96d2d7..348af34067 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-10-27 21:01+0000\n" "Last-Translator: Adolfo Jayme Barrientos \n" "Language-Team: \n" @@ -295,11 +295,16 @@ msgstr "La dirección debe tener %d bytes de largo" msgid "Address type out of range" msgstr "Tipo de dirección fuera de rango" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Todos los periféricos I2C están siendo usados" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Todos los FIFOs de RX en uso" @@ -420,6 +425,10 @@ msgstr "" "Auto-reload habilitado. Simplemente guarda los archivos via USB para " "ejecutarlos o entra al REPL para desabilitarlos.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -794,7 +803,7 @@ msgstr "Modo Drive no se usa cuando la dirección es input." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB solo opera sobre 16 bytes a la vez" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "Fallo ESP-IDF al tomar la memoria" @@ -920,6 +929,7 @@ msgid "File exists" msgstr "El archivo ya existe" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filtros muy complejos" @@ -1141,7 +1151,7 @@ msgstr "Pin inválido para canal derecho" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2909,6 +2919,10 @@ msgstr "variable local referenciada antes de la asignación" msgid "long int not supported in this build" msgstr "long int no soportado en esta compilación" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "cadena-f mal formada" @@ -3264,6 +3278,8 @@ msgstr "pow() con 3 argumentos requiere enteros" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3522,6 +3538,16 @@ msgstr "tuple index fuera de rango" msgid "tuple/list has wrong length" msgstr "tupla/lista tiene una longitud incorrecta" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/fil.po b/locale/fil.po index 838bca98ba..7bc33dba3e 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -289,11 +289,16 @@ msgstr "ang palette ay dapat 32 bytes ang haba" msgid "Address type out of range" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Lahat ng I2C peripherals ginagamit" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -411,6 +416,10 @@ msgstr "" "Ang awtomatikong pag re-reload ay ON. i-save lamang ang mga files sa USB " "para patakbuhin sila o pasukin ang REPL para i-disable ito.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -785,7 +794,7 @@ msgstr "Drive mode ay hindi ginagamit kapag ang direksyon ay input." msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -913,6 +922,7 @@ msgid "File exists" msgstr "Mayroong file" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1133,7 +1143,7 @@ msgstr "Mali ang pin para sa kanang channel" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2885,6 +2895,10 @@ msgstr "local variable na reference bago na i-assign" msgid "long int not supported in this build" msgstr "long int hindi sinusuportahan sa build na ito" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "" @@ -3239,6 +3253,8 @@ msgstr "pow() na may 3 argumento kailangan ng integers" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3498,6 +3514,16 @@ msgstr "indeks ng tuple wala sa sakop" msgid "tuple/list has wrong length" msgstr "mali ang haba ng tuple/list" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/fr.po b/locale/fr.po index b4a15ee1f9..920e22cb0c 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-10-22 20:48+0000\n" "Last-Translator: Antonin ENFRUN \n" "Language: fr\n" @@ -296,11 +296,16 @@ msgstr "L'adresse doit être longue de %d octets" msgid "Address type out of range" msgstr "Type d'adresse hors plage" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Tous les périphériques I2C sont utilisés" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Tout les RX FIFOs sont utilisé" @@ -420,6 +425,10 @@ msgstr "" "Auto-chargement activé. Copiez simplement les fichiers en USB pour les " "lancer ou entrez sur REPL pour le désactiver.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -798,7 +807,7 @@ msgstr "Le mode Drive n'est pas utilisé quand la direction est 'input'." msgid "ECB only operates on 16 bytes at a time" msgstr "La BCE ne fonctionne que sur 16 octets à la fois" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "ESP-IDF échec d'allocation de la mémoire" @@ -925,6 +934,7 @@ msgid "File exists" msgstr "Le fichier existe" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filtre trop complexe" @@ -1146,7 +1156,7 @@ msgstr "Broche invalide pour le canal droit" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2931,6 +2941,10 @@ msgstr "variable locale référencée avant d'être assignée" msgid "long int not supported in this build" msgstr "entiers longs non supportés dans cette build" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "f-string mal formé" @@ -3288,6 +3302,8 @@ msgstr "pow() avec 3 arguments nécessite des entiers" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3546,6 +3562,16 @@ msgstr "index du tuple hors gamme" msgid "tuple/list has wrong length" msgstr "tuple/liste a une mauvaise longueur" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/hi.po b/locale/hi.po index 9174580a26..4966ad8e80 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -287,11 +287,16 @@ msgstr "" msgid "Address type out of range" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -406,6 +411,10 @@ msgid "" "disable.\n" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -774,7 +783,7 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -900,6 +909,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1118,7 +1128,7 @@ msgstr "" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2836,6 +2846,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "" @@ -3188,6 +3202,8 @@ msgstr "" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3443,6 +3459,16 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/it_IT.po b/locale/it_IT.po index 6345c095c7..82840c8523 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -288,11 +288,16 @@ msgstr "la palette deve essere lunga 32 byte" msgid "Address type out of range" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Tutte le periferiche I2C sono in uso" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -410,6 +415,10 @@ msgstr "" "L'auto-reload è attivo. Salva i file su USB per eseguirli o entra nel REPL " "per disabilitarlo.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -785,7 +794,7 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -913,6 +922,7 @@ msgid "File exists" msgstr "File esistente" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1135,7 +1145,7 @@ msgstr "Pin non valido per il canale destro" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2887,6 +2897,10 @@ msgstr "variabile locale richiamata prima di un assegnamento" msgid "long int not supported in this build" msgstr "long int non supportata in questa build" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "" @@ -3246,6 +3260,8 @@ msgstr "pow() con 3 argomenti richiede interi" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3505,6 +3521,16 @@ msgstr "indice della tupla fuori intervallo" msgid "tuple/list has wrong length" msgstr "tupla/lista ha la lunghezza sbagliata" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/ja.po b/locale/ja.po index abd2e1803d..ae7e51ba6b 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-09-25 18:20+0000\n" "Last-Translator: Taku Fukada \n" "Language-Team: none\n" @@ -294,11 +294,16 @@ msgstr "アドレスは、%dバイト長でなければなりません" msgid "Address type out of range" msgstr "address_typeが範囲外" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "全てのI2C周辺機器が使用中" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "全てのRX FIFOが使用中" @@ -415,6 +420,10 @@ msgstr "" "オートリロードがオンです。ファイルをUSB経由で保存するだけで実行できます。REPL" "に入ると無効化します。\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -787,7 +796,7 @@ msgstr "方向がinputのときドライブモードは使われません" msgid "ECB only operates on 16 bytes at a time" msgstr "ECBは一度に16バイトの演算のみを行います" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -913,6 +922,7 @@ msgid "File exists" msgstr "ファイルが存在します" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1133,7 +1143,7 @@ msgstr "右チャネルのピンが不正" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2866,6 +2876,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "このビルドはlong intに非対応" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "不正な形式のf-string" @@ -3220,6 +3234,8 @@ msgstr "pow()の第3引数には整数が必要" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3476,6 +3492,16 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "タプル/リストの長さが正しくありません" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/ko.po b/locale/ko.po index e5b728b846..858a036c83 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-10-05 12:12+0000\n" "Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" @@ -290,11 +290,16 @@ msgstr "" msgid "Address type out of range" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "사용중인 모든 I2C주변 기기" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -411,6 +416,10 @@ msgstr "" "자동 새로 고침이 켜져 있습니다. USB를 통해 파일을 저장하여 실행하십시오. 비활" "성화하려면 REPL을 입력하십시오.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -779,7 +788,7 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -905,6 +914,7 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1123,7 +1133,7 @@ msgstr "오른쪽 채널 핀이 잘못되었습니다" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2842,6 +2852,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "" @@ -3194,6 +3208,8 @@ msgstr "" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3449,6 +3465,16 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/nl.po b/locale/nl.po index 234bb930ae..bf05abb721 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-10-27 16:47+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -292,11 +292,16 @@ msgstr "Adres moet %d bytes lang zijn" msgid "Address type out of range" msgstr "Adres type buiten bereik" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Alle I2C peripherals zijn in gebruik" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Alle RX FIFO's zijn in gebruik" @@ -413,6 +418,10 @@ msgstr "" "Auto-herlaad staat aan. Sla bestanden simpelweg op over USB om uit te voeren " "of start REPL om uit te schakelen.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -787,7 +796,7 @@ msgstr "Drive modus niet gebruikt als de richting input is." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB werkt alleen met 16 bytes tegelijkertijd" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "ESP-IDF geheugen toewijzing mislukt" @@ -913,6 +922,7 @@ msgid "File exists" msgstr "Bestand bestaat" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filters zijn te complex" @@ -1135,7 +1145,7 @@ msgstr "Ongeldige pin voor rechter kanaal" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2900,6 +2910,10 @@ msgstr "verwijzing naar een (nog) niet toegewezen lokale variabele" msgid "long int not supported in this build" msgstr "long int wordt niet ondersteund in deze build" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "onjuist gevormde f-string" @@ -3253,6 +3267,8 @@ msgstr "pow() met 3 argumenten vereist integers" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3510,6 +3526,16 @@ msgstr "tuple index buiten bereik" msgid "tuple/list has wrong length" msgstr "tuple of lijst heeft onjuiste lengte" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/pl.po b/locale/pl.po index cadb2c43eb..1dbb0ba12b 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-09-29 01:39+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -294,11 +294,16 @@ msgstr "Adres musi mieć %d bajtów" msgid "Address type out of range" msgstr "" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Wszystkie peryferia I2C w użyciu" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "" @@ -415,6 +420,10 @@ msgstr "" "Samo-przeładowywanie włączone. Po prostu zapisz pliki przez USB aby je " "uruchomić, albo wejdź w konsolę aby wyłączyć.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -787,7 +796,7 @@ msgstr "Tryb sterowania nieużywany w trybie wejścia." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB działa tylko na 16 bajtach naraz" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -913,6 +922,7 @@ msgid "File exists" msgstr "Plik istnieje" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" @@ -1133,7 +1143,7 @@ msgstr "Zła nóżka dla prawego kanału" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2859,6 +2869,10 @@ msgstr "zmienna lokalna użyta przed przypisaniem" msgid "long int not supported in this build" msgstr "long int jest nieobsługiwany" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "" @@ -3212,6 +3226,8 @@ msgstr "trzyargumentowe pow() wymaga liczb całkowitych" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3468,6 +3484,16 @@ msgstr "indeks krotki poza zakresem" msgid "tuple/list has wrong length" msgstr "krotka/lista ma złą długość" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 16631c32a7..8696d7509a 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-10-27 21:01+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -296,11 +296,16 @@ msgstr "O endereço deve ter %d bytes de comprimento" msgid "Address type out of range" msgstr "O tipo do endereço está fora do alcance" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Todos os periféricos I2C estão em uso" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Todos os FIFOs RX estão em uso" @@ -419,6 +424,10 @@ msgstr "" "O recarregamento automático está ativo. Simplesmente salve os arquivos via " "USB para executá-los ou digite REPL para desativar.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -796,7 +805,7 @@ msgstr "O modo do controlador não é usado quando a direção for inserida." msgid "ECB only operates on 16 bytes at a time" msgstr "O BCE opera apenas com 16 bytes por vez" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "Houve uma falha na alocação da memória ESP-IDF" @@ -922,6 +931,7 @@ msgid "File exists" msgstr "Arquivo já existe" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Os filtros são muito complexos" @@ -1144,7 +1154,7 @@ msgstr "Pino inválido para canal direito" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2920,6 +2930,10 @@ msgstr "a variável local referenciada antes da atribuição" msgid "long int not supported in this build" msgstr "o long int não é suportado nesta compilação" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "f-string malformado" @@ -3279,6 +3293,8 @@ msgstr "o pow() com 3 argumentos requer números inteiros" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3536,6 +3552,16 @@ msgstr "o índice da tupla está fora do intervalo" msgid "tuple/list has wrong length" msgstr "a tupla/lista está com tamanho incorreto" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/sv.po b/locale/sv.po index f2fa50189b..53ed60acae 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-10-26 02:36+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -292,11 +292,16 @@ msgstr "Adressen måste vara %d byte lång" msgid "Address type out of range" msgstr "Adresstyp utanför intervallet" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "All I2C-kringutrustning används" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Alla RX FIFO i bruk" @@ -413,6 +418,10 @@ msgstr "" "Autoladdning är på. Spara bara filer via USB för att köra dem eller ange " "REPL för att inaktivera.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -787,7 +796,7 @@ msgstr "Drivläge används inte när riktning är input." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB arbetar endast på 16 byte åt gången" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "ESP-IDF-minnetilldelning misslyckades" @@ -913,6 +922,7 @@ msgid "File exists" msgstr "Filen finns redan" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filter för komplexa" @@ -1133,7 +1143,7 @@ msgstr "Ogiltig pinne för höger kanal" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2893,6 +2903,10 @@ msgstr "lokal variabel refererad före tilldelning" msgid "long int not supported in this build" msgstr "long int stöds inte i denna build" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "f-sträng har felaktigt format" @@ -3246,6 +3260,8 @@ msgstr "pow() med 3 argument kräver heltal" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3503,6 +3519,16 @@ msgstr "tupelindex utanför intervallet" msgid "tuple/list has wrong length" msgstr "tupel/lista har fel längd" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 5ed34cc6c3..9b32993eb0 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 19:50-0500\n" +"POT-Creation-Date: 2020-10-21 20:13-0500\n" "PO-Revision-Date: 2020-10-22 20:48+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -294,11 +294,16 @@ msgstr "Dìzhǐ bìxū shì %d zì jié zhǎng" msgid "Address type out of range" msgstr "Dìzhǐ lèixíng chāochū fànwéi" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "All CAN peripherals are in use" +msgstr "" + #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Suǒyǒu I2C wàiwéi qì zhèngzài shǐyòng" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" msgstr "Suǒyǒu shǐyòng zhōng de RX FIFO" @@ -415,6 +420,10 @@ msgstr "" "Zìdòng chóngxīn jiāzài. Zhǐ xū tōngguò USB bǎocún wénjiàn lái yùnxíng tāmen " "huò shūrù REPL jìnyòng.\n" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "Baudrate not supported by peripheral" +msgstr "" + #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" @@ -785,7 +794,7 @@ msgstr "Fāngxiàng shūrù shí qūdòng móshì méiyǒu shǐyòng." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB yí cì zhǐ shǐ yòng 16 gè zì jié" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "ESP-IDF nèicún fēnpèi shībài" @@ -911,6 +920,7 @@ msgid "File exists" msgstr "Wénjiàn cúnzài" #: ports/atmel-samd/common-hal/canio/Listener.c +#: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "guò lǜ qì tài fù zá" @@ -1131,7 +1141,7 @@ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c #: ports/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.c #: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c @@ -2883,6 +2893,10 @@ msgstr "fùzhí qián yǐnyòng de júbù biànliàng" msgid "long int not supported in this build" msgstr "cǐ bǎnběn bù zhīchí zhǎng zhěngshù" +#: ports/esp32s2/common-hal/canio/CAN.c +msgid "loopback + silent mode not supported by peripheral" +msgstr "" + #: py/parse.c msgid "malformed f-string" msgstr "jīxíng de f-string" @@ -3235,6 +3249,8 @@ msgstr "pow() yǒu 3 cānshù xūyào zhěngshù" #: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h #: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h #: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h +#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h #: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h msgid "pressing boot button at start up.\n" @@ -3492,6 +3508,16 @@ msgstr "yuán zǔ suǒyǐn chāochū fànwéi" msgid "tuple/list has wrong length" msgstr "yuán zǔ/lièbiǎo chángdù cuòwù" +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_driver_install returned esp-idf error #%d" +msgstr "" + +#: ports/esp32s2/common-hal/canio/CAN.c +#, c-format +msgid "twai_start returned esp-idf error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c From d0426b3438a934257c5351f7eb2d9cdd79881c03 Mon Sep 17 00:00:00 2001 From: Noel Gaetan Date: Tue, 27 Oct 2020 23:54:46 +0100 Subject: [PATCH 1240/1293] Update pins.c fix mistake --- ports/nrf/boards/holyiot_nrf52840/pins.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/boards/holyiot_nrf52840/pins.c b/ports/nrf/boards/holyiot_nrf52840/pins.c index 4e2593e58f..cdec4dfa8e 100644 --- a/ports/nrf/boards/holyiot_nrf52840/pins.c +++ b/ports/nrf/boards/holyiot_nrf52840/pins.c @@ -51,9 +51,9 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P0_21), MP_ROM_PTR(&pin_P0_21) }, { MP_ROM_QSTR(MP_QSTR_P0_19), MP_ROM_PTR(&pin_P0_19) }, - // RESET { MP_ROM_QSTR(MP_QSTR_P0_18), MP_ROM_PTR(&pin_P0_18) }, + // RESET { MP_ROM_QSTR(MP_QSTR_P0_18), MP_ROM_PTR(&pin_P0_18) } }; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 27827a4fef74dc66996ecb670f01ad5d58500899 Mon Sep 17 00:00:00 2001 From: Gaetan Date: Wed, 28 Oct 2020 00:34:07 +0100 Subject: [PATCH 1241/1293] =?UTF-8?q?Fix=20EOF=20error=20modifi=C3=A9?= =?UTF-8?q?=C2=A0:=20=20=20=20=20=20=20=20=20mpconfigboard.mk=20modifi?= =?UTF-8?q?=C3=A9=C2=A0:=20=20=20=20=20=20=20=20=20pins.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk | 2 +- ports/nrf/boards/holyiot_nrf52840/pins.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk b/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk index d85de75071..ead2059531 100644 --- a/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk +++ b/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk @@ -5,4 +5,4 @@ USB_MANUFACTURER = "Holyiot" MCU_CHIP = nrf52840 -INTERNAL_FLASH_FILESYSTEM = 1 \ No newline at end of file +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/holyiot_nrf52840/pins.c b/ports/nrf/boards/holyiot_nrf52840/pins.c index 4e2593e58f..604744e0ea 100644 --- a/ports/nrf/boards/holyiot_nrf52840/pins.c +++ b/ports/nrf/boards/holyiot_nrf52840/pins.c @@ -43,7 +43,6 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P0_13), MP_ROM_PTR(&pin_P0_13) }, { MP_ROM_QSTR(MP_QSTR_P0_16), MP_ROM_PTR(&pin_P0_16) }, - { MP_ROM_QSTR(MP_QSTR_P0_07), MP_ROM_PTR(&pin_P0_07) }, { MP_ROM_QSTR(MP_QSTR_P1_09), MP_ROM_PTR(&pin_P1_09) }, { MP_ROM_QSTR(MP_QSTR_P0_12), MP_ROM_PTR(&pin_P0_12) }, @@ -55,5 +54,4 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { }; - -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 9b911b2211715e9da7ae55b691f54fe2f33a4486 Mon Sep 17 00:00:00 2001 From: Gaetan Date: Wed, 28 Oct 2020 00:38:07 +0100 Subject: [PATCH 1242/1293] =?UTF-8?q?modifi=C3=A9=C2=A0:=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20pins.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ports/nrf/boards/holyiot_nrf52840/pins.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ports/nrf/boards/holyiot_nrf52840/pins.c b/ports/nrf/boards/holyiot_nrf52840/pins.c index 604744e0ea..8e06675916 100644 --- a/ports/nrf/boards/holyiot_nrf52840/pins.c +++ b/ports/nrf/boards/holyiot_nrf52840/pins.c @@ -50,8 +50,12 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P0_21), MP_ROM_PTR(&pin_P0_21) }, { MP_ROM_QSTR(MP_QSTR_P0_19), MP_ROM_PTR(&pin_P0_19) }, - // RESET { MP_ROM_QSTR(MP_QSTR_P0_18), MP_ROM_PTR(&pin_P0_18) }, + // RESET { MP_ROM_QSTR(MP_QSTR_P0_18), MP_ROM_PTR(&pin_P0_18) } }; +<<<<<<< HEAD +======= + +>>>>>>> d0426b3438a934257c5351f7eb2d9cdd79881c03 MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From b44011d196a0a7294fca1e1825054761979ba075 Mon Sep 17 00:00:00 2001 From: Gaetan Date: Wed, 28 Oct 2020 01:43:42 +0100 Subject: [PATCH 1243/1293] fix railing Whitespace pin.c --- ports/nrf/boards/holyiot_nrf52840/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/boards/holyiot_nrf52840/pins.c b/ports/nrf/boards/holyiot_nrf52840/pins.c index c9e222b671..83be4f0ac7 100644 --- a/ports/nrf/boards/holyiot_nrf52840/pins.c +++ b/ports/nrf/boards/holyiot_nrf52840/pins.c @@ -49,7 +49,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P0_23), MP_ROM_PTR(&pin_P0_23) }, { MP_ROM_QSTR(MP_QSTR_P0_21), MP_ROM_PTR(&pin_P0_21) }, { MP_ROM_QSTR(MP_QSTR_P0_19), MP_ROM_PTR(&pin_P0_19) }, - + // RESET { MP_ROM_QSTR(MP_QSTR_P0_18), MP_ROM_PTR(&pin_P0_18) } }; From 5e3bfa1956ca4d327fcad23ce508ebbdaeac4d69 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 28 Oct 2020 20:08:25 +0530 Subject: [PATCH 1244/1293] countio implementation for esp32s2 --- ports/esp32s2/common-hal/countio/Counter.c | 69 +++++++++++++++++++++ ports/esp32s2/common-hal/countio/Counter.h | 15 +++++ ports/esp32s2/common-hal/countio/__init__.c | 1 + ports/esp32s2/mpconfigport.mk | 2 +- 4 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 ports/esp32s2/common-hal/countio/Counter.c create mode 100644 ports/esp32s2/common-hal/countio/Counter.h create mode 100644 ports/esp32s2/common-hal/countio/__init__.c diff --git a/ports/esp32s2/common-hal/countio/Counter.c b/ports/esp32s2/common-hal/countio/Counter.c new file mode 100644 index 0000000000..6a76a163d7 --- /dev/null +++ b/ports/esp32s2/common-hal/countio/Counter.c @@ -0,0 +1,69 @@ +#include "common-hal/countio/Counter.h" + +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +#include "driver/pcnt.h" + +static void pcnt_init(countio_counter_obj_t* self) { + int unit = PCNT_UNIT_0; + // Prepare configuration for the PCNT unit + pcnt_config_t pcnt_config = { + // Set PCNT input signal and control GPIOs + .pulse_gpio_num = self->pin->number, + .ctrl_gpio_num = PCNT_PIN_NOT_USED, + .channel = PCNT_CHANNEL_0, + .unit = unit, + // What to do on the positive / negative edge of pulse input? + .pos_mode = PCNT_COUNT_INC, // Count up on the positive edge + .neg_mode = PCNT_COUNT_DIS, // Keep the counter value on the negative edge + }; + // Initialize PCNT unit + pcnt_unit_config(&pcnt_config); + + // Configure and enable the input filter + pcnt_set_filter_value(unit, 100); + pcnt_filter_enable(unit); + + // Initialize PCNT's counter + pcnt_counter_pause(unit); + pcnt_counter_clear(unit); + + // Everything is set up, now go to counting + pcnt_counter_resume(unit); +} + +void common_hal_countio_counter_construct(countio_counter_obj_t* self, + const mcu_pin_obj_t* pin) { + claim_pin(pin); + self->pin = pin; + pcnt_init(self); +} + +bool common_hal_countio_counter_deinited(countio_counter_obj_t* self) { + return self->pin == NULL; +} + +void common_hal_countio_counter_deinit(countio_counter_obj_t* self) { + if (common_hal_countio_counter_deinited(self)) { + return; + } + reset_pin_number(self->pin->number); + self->pin = NULL; +} + +mp_int_t common_hal_countio_counter_get_count(countio_counter_obj_t* self) { + int16_t count; + pcnt_get_counter_value(PCNT_UNIT_0, &count); + return count+self->count; +} + +void common_hal_countio_counter_set_count(countio_counter_obj_t* self, + mp_int_t new_count) { + self->count = new_count; + pcnt_counter_clear(PCNT_UNIT_0); +} + +void common_hal_countio_counter_reset(countio_counter_obj_t* self) { + common_hal_countio_counter_set_count(self, 0); +} diff --git a/ports/esp32s2/common-hal/countio/Counter.h b/ports/esp32s2/common-hal/countio/Counter.h new file mode 100644 index 0000000000..3406f9daaf --- /dev/null +++ b/ports/esp32s2/common-hal/countio/Counter.h @@ -0,0 +1,15 @@ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_COUNTIO_COUNTER_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_COUNTIO_COUNTER_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t * pin; + mp_int_t count; +} countio_counter_obj_t; + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_COUNTIO_COUNT_H diff --git a/ports/esp32s2/common-hal/countio/__init__.c b/ports/esp32s2/common-hal/countio/__init__.c new file mode 100644 index 0000000000..b95b20d153 --- /dev/null +++ b/ports/esp32s2/common-hal/countio/__init__.c @@ -0,0 +1 @@ +//No countio module functions diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index c06c89c909..bdb25a87b8 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -17,7 +17,7 @@ CIRCUITPY_FULL_BUILD = 1 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_CANIO = 1 -CIRCUITPY_COUNTIO = 0 +CIRCUITPY_COUNTIO = 1 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_ROTARYIO = 0 From 5ab2f16f64f0935ac8ad6fa776c435d55a3cff1e Mon Sep 17 00:00:00 2001 From: Gaetan Date: Wed, 28 Oct 2020 22:08:10 +0100 Subject: [PATCH 1245/1293] =?UTF-8?q?Change=20Board=20Name=20to=20ADM=5FB?= =?UTF-8?q?=5FNRF52840=5F1=20edit=20=20=20:=20=20=20=20=20=20=20=20=20.git?= =?UTF-8?q?hub/workflows/build.yml=20rename=C2=A0:=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20ports/nrf/boards/holyiot=5Fnrf52840/board.c=20->=20ports/nrf?= =?UTF-8?q?/boards/ADM=5FB=5FNRF52840=5F1/board.c=20rename=C2=A0:=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20ports/nrf/boards/holyiot=5Fnrf52840/mpconfigb?= =?UTF-8?q?oard.h=20->=20ports/nrf/boards/ADM=5FB=5FNRF52840=5F1/mpconfigb?= =?UTF-8?q?oard.h=20rename=C2=A0:=20=20=20=20=20=20=20=20=20ports/nrf/boar?= =?UTF-8?q?ds/holyiot=5Fnrf52840/mpconfigboard.mk=20->=20ports/nrf/boards/?= =?UTF-8?q?ADM=5FB=5FNRF52840=5F1/mpconfigboard.mk=20rename=C2=A0:=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20ports/nrf/boards/holyiot=5Fnrf52840/pins.c?= =?UTF-8?q?=20->=20ports/nrf/boards/ADM=5FB=5FNRF52840=5F1/pins.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- .../nrf/boards/{holyiot_nrf52840 => ADM_B_NRF52840_1}/board.c | 0 .../{holyiot_nrf52840 => ADM_B_NRF52840_1}/mpconfigboard.h | 2 +- .../{holyiot_nrf52840 => ADM_B_NRF52840_1}/mpconfigboard.mk | 4 ++-- .../nrf/boards/{holyiot_nrf52840 => ADM_B_NRF52840_1}/pins.c | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename ports/nrf/boards/{holyiot_nrf52840 => ADM_B_NRF52840_1}/board.c (100%) rename ports/nrf/boards/{holyiot_nrf52840 => ADM_B_NRF52840_1}/mpconfigboard.h (95%) rename ports/nrf/boards/{holyiot_nrf52840 => ADM_B_NRF52840_1}/mpconfigboard.mk (55%) rename ports/nrf/boards/{holyiot_nrf52840 => ADM_B_NRF52840_1}/pins.c (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cada55aaa4..1a967046ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -162,6 +162,7 @@ jobs: board: - "8086_commander" - "TG-Watch02A" + - "ADM_B_NRF52840_1" - "aloriumtech_evo_m51" - "aramcon_badge_2019" - "arduino_mkr1300" @@ -214,7 +215,6 @@ jobs: - "hallowing_m0_express" - "hallowing_m4_express" - "hiibot_bluefi" - - "holyiot_nrf52840" - "ikigaisense_vita" - "imxrt1010_evk" - "imxrt1020_evk" diff --git a/ports/nrf/boards/holyiot_nrf52840/board.c b/ports/nrf/boards/ADM_B_NRF52840_1/board.c similarity index 100% rename from ports/nrf/boards/holyiot_nrf52840/board.c rename to ports/nrf/boards/ADM_B_NRF52840_1/board.c diff --git a/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.h b/ports/nrf/boards/ADM_B_NRF52840_1/mpconfigboard.h similarity index 95% rename from ports/nrf/boards/holyiot_nrf52840/mpconfigboard.h rename to ports/nrf/boards/ADM_B_NRF52840_1/mpconfigboard.h index 3b64d3a629..575d09feb5 100644 --- a/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.h +++ b/ports/nrf/boards/ADM_B_NRF52840_1/mpconfigboard.h @@ -27,7 +27,7 @@ #include "nrfx/hal/nrf_gpio.h" -#define MICROPY_HW_BOARD_NAME "Holyiot nRF52840" +#define MICROPY_HW_BOARD_NAME "AtelierDuMaker nRF52840 Breakout" #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_HW_LED_STATUS (&pin_P0_19) diff --git a/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk b/ports/nrf/boards/ADM_B_NRF52840_1/mpconfigboard.mk similarity index 55% rename from ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk rename to ports/nrf/boards/ADM_B_NRF52840_1/mpconfigboard.mk index ead2059531..f3a2e830dd 100644 --- a/ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk +++ b/ports/nrf/boards/ADM_B_NRF52840_1/mpconfigboard.mk @@ -1,7 +1,7 @@ USB_VID = 0x239A USB_PID = 0x80A0 -USB_PRODUCT = "HOLYIOTNRF52840" -USB_MANUFACTURER = "Holyiot" +USB_PRODUCT = "ADM_B_NRF52840_1" +USB_MANUFACTURER = "AtelierDuMaker" MCU_CHIP = nrf52840 diff --git a/ports/nrf/boards/holyiot_nrf52840/pins.c b/ports/nrf/boards/ADM_B_NRF52840_1/pins.c similarity index 100% rename from ports/nrf/boards/holyiot_nrf52840/pins.c rename to ports/nrf/boards/ADM_B_NRF52840_1/pins.c From 3dcee5be803a4d6bd9f05ecb13608467dc2e3a55 Mon Sep 17 00:00:00 2001 From: Gaetan Date: Wed, 28 Oct 2020 22:38:13 +0100 Subject: [PATCH 1246/1293] Fix: .github/workflows/build.yml --- .github/workflows/build.yml | 49 ++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a967046ca..2f61b60415 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: - name: CircuitPython version run: | git describe --dirty --tags - echo "::set-env name=CP_VERSION::$(git describe --dirty --tags)" + echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags) - name: Set up Python 3.8 uses: actions/setup-python@v1 with: @@ -36,7 +36,7 @@ jobs: - name: Install deps run: | sudo apt-get install -y eatmydata - sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 + sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 latexmk texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli - name: Versions run: | @@ -73,17 +73,26 @@ jobs: with: name: stubs path: circuitpython-stubs* - - name: Docs + - name: Test Documentation Build (HTML) run: sphinx-build -E -W -b html -D version=${{ env.CP_VERSION }} -D release=${{ env.CP_VERSION }} . _build/html - uses: actions/upload-artifact@v2 with: name: docs path: _build/html + - name: Test Documentation Build (LaTeX/PDF) + run: | + make latexpdf + - uses: actions/upload-artifact@v2 + with: + name: docs + path: _build/latex - name: Translations run: make check-translate - name: New boards check run: python3 -u ci_new_boards_check.py working-directory: tools + - name: Duplicate USB VID/PID Check + run: python3 -u -m tools.ci_check_duplicate_usb_vid_pid - name: Build mpy-cross.static-raspbian run: make -C mpy-cross -j2 -f Makefile.static-raspbian - uses: actions/upload-artifact@v2 @@ -122,8 +131,8 @@ jobs: run: echo "$GITHUB_CONTEXT" - name: Install dependencies run: | - brew install gettext awscli - echo "::set-env name=PATH::/usr/local/opt/gettext/bin:$PATH" + brew install gettext + echo >>$GITHUB_PATH /usr/local/opt/gettext/bin - name: Versions run: | gcc --version @@ -137,7 +146,7 @@ jobs: - name: CircuitPython version run: | git describe --dirty --tags - echo "::set-env name=CP_VERSION::$(git describe --dirty --tags)" + echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags) - name: Build mpy-cross run: make -C mpy-cross -j2 - uses: actions/upload-artifact@v2 @@ -161,8 +170,8 @@ jobs: matrix: board: - "8086_commander" - - "TG-Watch02A" - "ADM_B_NRF52840_1" + - "TG-Watch02A" - "aloriumtech_evo_m51" - "aramcon_badge_2019" - "arduino_mkr1300" @@ -171,7 +180,8 @@ jobs: - "arduino_nano_33_iot" - "arduino_zero" - "bast_pro_mini_m0" - - "bdmicro_vina_m0" + - "bdmicro_vina_d21" + - "bdmicro_vina_d51" - "bless_dev_board_multi_sensor" - "blm_badge" - "capablerobot_usbhub" @@ -189,6 +199,8 @@ jobs: - "datum_imu" - "datum_light" - "datum_weather" + - "dynossat_edu_eps" + - "dynossat_edu_obc" - "electronut_labs_blip" - "electronut_labs_papyr" - "escornabot_makech" @@ -202,6 +214,7 @@ jobs: - "feather_m0_rfm69" - "feather_m0_rfm9x" - "feather_m0_supersized" + - "feather_m4_can" - "feather_m4_express" - "feather_m7_1011" - "feather_mimxrt1011" @@ -228,11 +241,13 @@ jobs: - "makerdiary_nrf52840_m2_devkit" - "makerdiary_nrf52840_mdk" - "makerdiary_nrf52840_mdk_usb_dongle" + - "matrixportal_m4" - "meowbit_v121" - "meowmeow" - "metro_m0_express" - "metro_m4_airlift_lite" - "metro_m4_express" + - "metro_m7_1011" - "metro_nrf52840_express" - "mini_sam_m4" - "monster_m4sk" @@ -254,6 +269,7 @@ jobs: - "pca10100" - "pewpew10" - "pewpew_m4" + - "picoplanet" - "pirkey_m0" - "pitaya_go" - "pyb_nano_v2" @@ -267,6 +283,8 @@ jobs: - "pyportal" - "pyportal_titano" - "pyruler" + - "qtpy_m0" + - "qtpy_m0_haxpress" - "raytac_mdbt50q-db-40" - "robohatmm1_m4" - "sam32" @@ -401,9 +419,17 @@ jobs: fail-fast: false matrix: board: + - "adafruit_metro_esp32s2" + - "electroniccats_bastwifi" + - "espressif_kaluga_1" - "espressif_saola_1_wroom" - "espressif_saola_1_wrover" + - "microdev_micro_s2" + - "muselab_nanoesp32_s2" + - "targett_module_clip_wroom" + - "targett_module_clip_wrover" - "unexpectedmaker_feathers2" + - "unexpectedmaker_feathers2_prerelease" steps: - name: Set up Python 3.8 @@ -423,6 +449,11 @@ jobs: with: path: ${{ github.workspace }}/.idf_tools key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20200801 + - name: Clone IDF submodules + run: | + (cd $IDF_PATH && git submodule update --init) + env: + IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf - name: Install IDF tools run: | $IDF_PATH/tools/idf_tools.py --non-interactive install required @@ -473,4 +504,4 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) + if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) \ No newline at end of file From 34ce8d8642d43397627e6001b221039d7190db5b Mon Sep 17 00:00:00 2001 From: Noel Gaetan Date: Wed, 28 Oct 2020 22:43:54 +0100 Subject: [PATCH 1247/1293] Update build.yml --- .github/workflows/build.yml | 47 +++++++------------------------------ 1 file changed, 8 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f61b60415..6619cbdf23 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: - name: CircuitPython version run: | git describe --dirty --tags - echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags) + echo "::set-env name=CP_VERSION::$(git describe --dirty --tags)" - name: Set up Python 3.8 uses: actions/setup-python@v1 with: @@ -36,7 +36,7 @@ jobs: - name: Install deps run: | sudo apt-get install -y eatmydata - sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 latexmk texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra + sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli - name: Versions run: | @@ -73,26 +73,17 @@ jobs: with: name: stubs path: circuitpython-stubs* - - name: Test Documentation Build (HTML) + - name: Docs run: sphinx-build -E -W -b html -D version=${{ env.CP_VERSION }} -D release=${{ env.CP_VERSION }} . _build/html - uses: actions/upload-artifact@v2 with: name: docs path: _build/html - - name: Test Documentation Build (LaTeX/PDF) - run: | - make latexpdf - - uses: actions/upload-artifact@v2 - with: - name: docs - path: _build/latex - name: Translations run: make check-translate - name: New boards check run: python3 -u ci_new_boards_check.py working-directory: tools - - name: Duplicate USB VID/PID Check - run: python3 -u -m tools.ci_check_duplicate_usb_vid_pid - name: Build mpy-cross.static-raspbian run: make -C mpy-cross -j2 -f Makefile.static-raspbian - uses: actions/upload-artifact@v2 @@ -131,8 +122,8 @@ jobs: run: echo "$GITHUB_CONTEXT" - name: Install dependencies run: | - brew install gettext - echo >>$GITHUB_PATH /usr/local/opt/gettext/bin + brew install gettext awscli + echo "::set-env name=PATH::/usr/local/opt/gettext/bin:$PATH" - name: Versions run: | gcc --version @@ -146,7 +137,7 @@ jobs: - name: CircuitPython version run: | git describe --dirty --tags - echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags) + echo "::set-env name=CP_VERSION::$(git describe --dirty --tags)" - name: Build mpy-cross run: make -C mpy-cross -j2 - uses: actions/upload-artifact@v2 @@ -180,8 +171,7 @@ jobs: - "arduino_nano_33_iot" - "arduino_zero" - "bast_pro_mini_m0" - - "bdmicro_vina_d21" - - "bdmicro_vina_d51" + - "bdmicro_vina_m0" - "bless_dev_board_multi_sensor" - "blm_badge" - "capablerobot_usbhub" @@ -199,8 +189,6 @@ jobs: - "datum_imu" - "datum_light" - "datum_weather" - - "dynossat_edu_eps" - - "dynossat_edu_obc" - "electronut_labs_blip" - "electronut_labs_papyr" - "escornabot_makech" @@ -214,7 +202,6 @@ jobs: - "feather_m0_rfm69" - "feather_m0_rfm9x" - "feather_m0_supersized" - - "feather_m4_can" - "feather_m4_express" - "feather_m7_1011" - "feather_mimxrt1011" @@ -241,13 +228,11 @@ jobs: - "makerdiary_nrf52840_m2_devkit" - "makerdiary_nrf52840_mdk" - "makerdiary_nrf52840_mdk_usb_dongle" - - "matrixportal_m4" - "meowbit_v121" - "meowmeow" - "metro_m0_express" - "metro_m4_airlift_lite" - "metro_m4_express" - - "metro_m7_1011" - "metro_nrf52840_express" - "mini_sam_m4" - "monster_m4sk" @@ -269,7 +254,6 @@ jobs: - "pca10100" - "pewpew10" - "pewpew_m4" - - "picoplanet" - "pirkey_m0" - "pitaya_go" - "pyb_nano_v2" @@ -283,8 +267,6 @@ jobs: - "pyportal" - "pyportal_titano" - "pyruler" - - "qtpy_m0" - - "qtpy_m0_haxpress" - "raytac_mdbt50q-db-40" - "robohatmm1_m4" - "sam32" @@ -419,17 +401,9 @@ jobs: fail-fast: false matrix: board: - - "adafruit_metro_esp32s2" - - "electroniccats_bastwifi" - - "espressif_kaluga_1" - "espressif_saola_1_wroom" - "espressif_saola_1_wrover" - - "microdev_micro_s2" - - "muselab_nanoesp32_s2" - - "targett_module_clip_wroom" - - "targett_module_clip_wrover" - "unexpectedmaker_feathers2" - - "unexpectedmaker_feathers2_prerelease" steps: - name: Set up Python 3.8 @@ -449,11 +423,6 @@ jobs: with: path: ${{ github.workspace }}/.idf_tools key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20200801 - - name: Clone IDF submodules - run: | - (cd $IDF_PATH && git submodule update --init) - env: - IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf - name: Install IDF tools run: | $IDF_PATH/tools/idf_tools.py --non-interactive install required @@ -504,4 +473,4 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) \ No newline at end of file + if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) From cbad75a7d2c2b997a7663f7793fe36cac82a9deb Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Wed, 28 Oct 2020 15:40:36 +0000 Subject: [PATCH 1248/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (844 of 844 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 8696d7509a..7ad85e0b78 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: 2020-10-21 20:13-0500\n" -"PO-Revision-Date: 2020-10-27 21:01+0000\n" +"PO-Revision-Date: 2020-10-28 21:45+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -298,7 +298,7 @@ msgstr "O tipo do endereço está fora do alcance" #: ports/esp32s2/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" -msgstr "" +msgstr "Todos os periféricos CAN estão em uso" #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" @@ -426,7 +426,7 @@ msgstr "" #: ports/esp32s2/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" -msgstr "" +msgstr "O Baudrate não é suportado pelo periférico" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c @@ -2932,7 +2932,7 @@ msgstr "o long int não é suportado nesta compilação" #: ports/esp32s2/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" -msgstr "" +msgstr "o loopback + o modo silencioso não é suportado pelo periférico" #: py/parse.c msgid "malformed f-string" @@ -3555,12 +3555,12 @@ msgstr "a tupla/lista está com tamanho incorreto" #: ports/esp32s2/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" -msgstr "" +msgstr "o twai_driver_install retornou um erro esp-idf #%d" #: ports/esp32s2/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" -msgstr "" +msgstr "o twai_start retornou um erro esp-idf #%d" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c From a28755d53df963ad70cae62e526a3cb2f147851f Mon Sep 17 00:00:00 2001 From: hexthat Date: Wed, 28 Oct 2020 06:14:24 +0000 Subject: [PATCH 1249/1293] Translated using Weblate (Chinese (Pinyin)) Currently translated at 100.0% (844 of 844 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/zh_Latn/ --- locale/zh_Latn_pinyin.po | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 9b32993eb0..4cc86400d9 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: 2020-10-21 20:13-0500\n" -"PO-Revision-Date: 2020-10-22 20:48+0000\n" +"PO-Revision-Date: 2020-10-28 21:45+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" @@ -15,7 +15,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.3.1\n" +"X-Generator: Weblate 4.3.2-dev\n" #: main.c msgid "" @@ -296,7 +296,7 @@ msgstr "Dìzhǐ lèixíng chāochū fànwéi" #: ports/esp32s2/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" -msgstr "" +msgstr "suǒ yǒu CAN wài shè dōu zài shǐ yòng zhōng" #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" @@ -422,7 +422,7 @@ msgstr "" #: ports/esp32s2/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" -msgstr "" +msgstr "wài shè bù zhī chí de bō tè lā tè" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c @@ -2895,7 +2895,7 @@ msgstr "cǐ bǎnběn bù zhīchí zhǎng zhěngshù" #: ports/esp32s2/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" -msgstr "" +msgstr "Wài shè bù zhī chí huán huí + jìng yīn mó shì" #: py/parse.c msgid "malformed f-string" @@ -2933,11 +2933,11 @@ msgstr "chāochū zuìdà dìguī shēndù" #: extmod/ulab/code/approx/approx.c msgid "maxiter must be > 0" -msgstr "" +msgstr "maxiter bì xū > 0" #: extmod/ulab/code/approx/approx.c msgid "maxiter should be > 0" -msgstr "" +msgstr "maxiter yìng wéi > 0" #: py/runtime.c #, c-format @@ -3377,7 +3377,7 @@ msgstr "páixù cānshù bìxū shì ndarray" #: extmod/ulab/code/numerical/numerical.c msgid "sorted axis can't be longer than 65535" -msgstr "" +msgstr "pái xù zhóu bù néng chāo guò 65535" #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" @@ -3511,12 +3511,12 @@ msgstr "yuán zǔ/lièbiǎo chángdù cuòwù" #: ports/esp32s2/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" -msgstr "" +msgstr "twai_driver_install fǎn huí esp-idf cuò wù #%d" #: ports/esp32s2/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" -msgstr "" +msgstr "twai_start fǎn huí esp -idf cuò wù #%d" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c From e83be19d0f43d406c0968eb3903972cf127efb8d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 28 Oct 2020 17:48:12 -0500 Subject: [PATCH 1250/1293] actions: Fix location of stubs upload --- .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 0792d36a01..5092e48323 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -117,7 +117,7 @@ jobs: [ -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 zip -9 circuitpython-stubs.CP_VERSION }}.zip stubs - [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/mpy-cross/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1 + [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/stubs/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From 25bad660c6cfc0c697ad02da18d9b9e8c1d9053e Mon Sep 17 00:00:00 2001 From: lady ada Date: Wed, 28 Oct 2020 19:23:18 -0400 Subject: [PATCH 1251/1293] add light sensor, move batt monitor --- ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c index 2cf3d24029..65bc3fb53b 100644 --- a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c +++ b/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c @@ -18,8 +18,10 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_BUTTON_C), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_BUTTON_D), MP_ROM_PTR(&pin_GPIO11) }, - { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO2) }, - { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_LIGHT), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO33) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO34) }, From 59b9ca409cc6d1835567f866f9a96c04bc78d2c3 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 28 Oct 2020 20:33:10 -0400 Subject: [PATCH 1252/1293] matrixportal ESP TX and RX pins were swapped --- ports/atmel-samd/boards/matrixportal_m4/pins.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/matrixportal_m4/pins.c b/ports/atmel-samd/boards/matrixportal_m4/pins.c index 34865597b6..1f9956d9ec 100644 --- a/ports/atmel-samd/boards/matrixportal_m4/pins.c +++ b/ports/atmel-samd/boards/matrixportal_m4/pins.c @@ -16,8 +16,8 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_BUSY), MP_ROM_PTR(&pin_PA22) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RESET), MP_ROM_PTR(&pin_PA21) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RTS), MP_ROM_PTR(&pin_PA18) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PA12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PA13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PA13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PA12) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SCL),MP_ROM_PTR(&pin_PB30) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_PB31) }, From ad166ca479f405a9cb43fae9fe7b082d2e6ba19f Mon Sep 17 00:00:00 2001 From: sw23 Date: Thu, 29 Oct 2020 20:15:34 -0400 Subject: [PATCH 1253/1293] Fixing make stub warnings and mypy issuesmak --- shared-bindings/canio/CAN.c | 8 ++++---- shared-bindings/canio/Listener.c | 2 +- shared-bindings/canio/Match.c | 2 +- shared-bindings/canio/Message.c | 2 +- shared-bindings/canio/RemoteTransmissionRequest.c | 2 +- shared-bindings/displayio/Bitmap.c | 4 ++-- shared-bindings/displayio/Display.c | 2 +- shared-bindings/socketpool/Socket.c | 2 +- shared-bindings/socketpool/SocketPool.c | 2 +- shared-bindings/ssl/SSLContext.c | 2 +- shared-bindings/wifi/Radio.c | 4 ++-- tools/extract_pyi.py | 9 ++++++++- 12 files changed, 24 insertions(+), 17 deletions(-) diff --git a/shared-bindings/canio/CAN.c b/shared-bindings/canio/CAN.c index 4982a97b9d..13066764e3 100644 --- a/shared-bindings/canio/CAN.c +++ b/shared-bindings/canio/CAN.c @@ -49,7 +49,7 @@ //| loopback: bool = False, //| silent: bool = False, //| auto_restart: bool = False, -//| ): +//| ) -> None: //| """A common shared-bus protocol. The rx and tx pins are generally //| connected to a transceiver which controls the H and L pins on a //| shared bus. @@ -171,7 +171,7 @@ STATIC const mp_obj_property_t canio_can_receive_error_count_obj = { (mp_obj_t)mp_const_none}, }; -//| state: State +//| state: BusState //| """The current state of the bus. (read-only)""" STATIC mp_obj_t canio_can_state_get(mp_obj_t self_in) { canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -291,7 +291,7 @@ STATIC const mp_obj_property_t canio_can_loopback_obj = { }; -//| def send(message: Union[RemoteTransmissionRequest, Message]) -> None: +//| def send(self, message: Union[RemoteTransmissionRequest, Message]) -> None: //| """Send a message on the bus with the given data and id. //| If the message could not be sent due to a full fifo or a bus error condition, RuntimeError is raised. //| """ @@ -352,7 +352,7 @@ STATIC mp_obj_t canio_can_enter(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_can_enter_obj, canio_can_enter); -//| def __exit__(self, unused1, unused2, unused3) -> None: +//| def __exit__(self, unused1: Optional[Type[BaseException]], unused2: Optional[BaseException], unused3: Optional[TracebackType]) -> None: //| """Calls deinit()""" //| ... STATIC mp_obj_t canio_can_exit(size_t num_args, const mp_obj_t args[]) { diff --git a/shared-bindings/canio/Listener.c b/shared-bindings/canio/Listener.c index 93552af814..8a39f0f2ae 100644 --- a/shared-bindings/canio/Listener.c +++ b/shared-bindings/canio/Listener.c @@ -123,7 +123,7 @@ STATIC mp_obj_t canio_listener_enter(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_enter_obj, canio_listener_enter); -//| def __exit__(self, unused1, unused2, unused3) -> None: +//| def __exit__(self, unused1: Optional[Type[BaseException]], unused2: Optional[BaseException], unused3: Optional[TracebackType]) -> None: //| """Calls deinit()""" //| ... STATIC mp_obj_t canio_listener_exit(size_t num_args, const mp_obj_t args[]) { diff --git a/shared-bindings/canio/Match.c b/shared-bindings/canio/Match.c index 3fbc1773e8..6039631fad 100644 --- a/shared-bindings/canio/Match.c +++ b/shared-bindings/canio/Match.c @@ -33,7 +33,7 @@ //| """Describe CAN bus messages to match""" //| //| -//| def __init__(self, id: int, *, mask: Optional[int] = None, extended: bool = False): +//| def __init__(self, id: int, *, mask: Optional[int] = None, extended: bool = False) -> None: //| """Construct a Match with the given properties. //| //| If mask is not None, then the filter is for any id which matches all diff --git a/shared-bindings/canio/Message.c b/shared-bindings/canio/Message.c index e47e997c70..04fa8fc6c2 100644 --- a/shared-bindings/canio/Message.c +++ b/shared-bindings/canio/Message.c @@ -31,7 +31,7 @@ #include "py/runtime.h" //| class Message: -//| def __init__(self, id: int, data: bytes, *, extended: bool = False): +//| def __init__(self, id: int, data: bytes, *, extended: bool = False) -> None: //| """Construct a Message to send on a CAN bus. //| //| :param int id: The numeric ID of the message diff --git a/shared-bindings/canio/RemoteTransmissionRequest.c b/shared-bindings/canio/RemoteTransmissionRequest.c index d762787b18..fcd2590340 100644 --- a/shared-bindings/canio/RemoteTransmissionRequest.c +++ b/shared-bindings/canio/RemoteTransmissionRequest.c @@ -31,7 +31,7 @@ #include "py/runtime.h" //| class RemoteTransmissionRequest: -//| def __init__(self, id: int, length: int, *, extended: bool = False): +//| def __init__(self, id: int, length: int, *, extended: bool = False) -> None: //| """Construct a RemoteTransmissionRequest to send on a CAN bus. //| //| :param int id: The numeric ID of the requested message diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 5a2fc785f8..b9f06fe143 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -172,7 +172,7 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val return mp_const_none; } -//| def blit(self, x: int, y: int, source_bitmap: bitmap, *, x1: int, y1: int, x2: int, y2: int, skip_index: int) -> None: +//| def blit(self, x: int, y: int, source_bitmap: Bitmap, *, x1: int, y1: int, x2: int, y2: int, skip_index: int) -> None: //| """Inserts the source_bitmap region defined by rectangular boundaries //| (x1,y1) and (x2,y2) into the bitmap at the specified (x,y) location. //| @@ -274,7 +274,7 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg MP_DEFINE_CONST_FUN_OBJ_KW(displayio_bitmap_blit_obj, 4, displayio_bitmap_obj_blit); // `displayio_bitmap_obj_blit` requires at least 4 arguments -//| def fill(self, value: Any) -> None: +//| def fill(self, value: int) -> None: //| """Fills the bitmap with the supplied palette index value.""" //| ... //| diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index e78a893b01..1ed59f2331 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -39,7 +39,7 @@ #include "shared-module/displayio/__init__.h" #include "supervisor/shared/translate.h" -//| _DisplayBus = Union[FourWire, ParallelBus, I2CDisplay] +//| _DisplayBus = Union['FourWire', 'ParallelBus', 'I2CDisplay'] //| """:py:class:`FourWire`, :py:class:`ParallelBus` or :py:class:`I2CDisplay`""" //| diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index e7b31842d2..362e4d7e86 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -161,7 +161,7 @@ STATIC mp_obj_t socketpool_socket_close(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(socketpool_socket_close_obj, socketpool_socket_close); -//| def connect(self, address: tuple) -> None: +//| def connect(self, address: Tuple[str, int]) -> None: //| """Connect a socket to a remote address //| //| :param ~tuple address: tuple of (remote_address, remote_port)""" diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index 527cf7e984..b737b5fc2d 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -82,7 +82,7 @@ STATIC mp_obj_t socketpool_socketpool_socket(size_t n_args, const mp_obj_t *pos_ } MP_DEFINE_CONST_FUN_OBJ_KW(socketpool_socketpool_socket_obj, 1, socketpool_socketpool_socket); -//| def getaddrinfo(host: str, port: int, family: int = 0, type: int = 0, proto: int = 0, flags: int = 0) -> tuple: +//| def getaddrinfo(host: str, port: int, family: int = 0, type: int = 0, proto: int = 0, flags: int = 0) -> Tuple[int, int, int, str, Tuple[str, int]]: //| """Gets the address information for a hostname and port //| //| Returns the appropriate family, socket type, socket protocol and diff --git a/shared-bindings/ssl/SSLContext.c b/shared-bindings/ssl/SSLContext.c index d2c236d3bf..9d4df72619 100644 --- a/shared-bindings/ssl/SSLContext.c +++ b/shared-bindings/ssl/SSLContext.c @@ -51,7 +51,7 @@ STATIC mp_obj_t ssl_sslcontext_make_new(const mp_obj_type_t *type, size_t n_args return MP_OBJ_FROM_PTR(s); } -//| def wrap_socket(sock: socketpool.Socket, *, server_side: bool = False, server_hostname: str = None) -> socketpool.Socket: +//| def wrap_socket(sock: socketpool.Socket, *, server_side: bool = False, server_hostname: Optional[str] = None) -> socketpool.Socket: //| """Wraps the socket into a socket-compatible class that handles SSL negotiation. //| The socket must be of type SOCK_STREAM.""" //| ... diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index a274c437e0..a56ca5aaa6 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -79,7 +79,7 @@ const mp_obj_property_t wifi_radio_mac_address_obj = { }; -//| def start_scanning_networks(self, *, start_channel=1, stop_channel=11) -> Iterable[Network]: +//| def start_scanning_networks(self, *, start_channel: int = 1, stop_channel: int = 11) -> Iterable[Network]: //| """Scans for available wifi networks over the given channel range. Make sure the channels are allowed in your country.""" //| ... //| @@ -283,7 +283,7 @@ const mp_obj_property_t wifi_radio_ap_info_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| def ping(self, ip, *, timeout: float = 0.5) -> float: +//| def ping(self, ip: wifi.Radio, *, timeout: float = 0.5) -> float: //| """Ping an IP to test connectivity. Returns echo time in seconds. //| Returns None when it times out.""" //| ... diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index 651216e11a..b7ce584a1e 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -17,7 +17,8 @@ import black IMPORTS_IGNORE = frozenset({'int', 'float', 'bool', 'str', 'bytes', 'tuple', 'list', 'set', 'dict', 'bytearray', 'slice', 'file', 'buffer', 'range', 'array', 'struct_time'}) -IMPORTS_TYPING = frozenset({'Any', 'Optional', 'Union', 'Tuple', 'List', 'Sequence', 'NamedTuple', 'Iterable', 'Iterator', 'Callable', 'AnyStr', 'overload'}) +IMPORTS_TYPING = frozenset({'Any', 'Optional', 'Union', 'Tuple', 'List', 'Sequence', 'NamedTuple', 'Iterable', 'Iterator', 'Callable', 'AnyStr', 'overload', 'Type'}) +IMPORTS_TYPES = frozenset({'TracebackType'}) CPY_TYPING = frozenset({'ReadableBuffer', 'WriteableBuffer', 'AudioSample', 'FrameBuffer'}) @@ -63,6 +64,7 @@ def find_stub_issues(tree): def extract_imports(tree): modules = set() typing = set() + types = set() cpy_typing = set() def collect_annotations(anno_tree): @@ -74,6 +76,8 @@ def extract_imports(tree): continue elif node.id in IMPORTS_TYPING: typing.add(node.id) + elif node.id in IMPORTS_TYPES: + types.add(node.id) elif node.id in CPY_TYPING: cpy_typing.add(node.id) elif isinstance(node, ast.Attribute): @@ -94,6 +98,7 @@ def extract_imports(tree): return { "modules": sorted(modules), "typing": sorted(typing), + "types": sorted(types), "cpy_typing": sorted(cpy_typing), } @@ -181,6 +186,8 @@ def convert_folder(top_level, stub_directory): # Add import statements imports = extract_imports(tree) import_lines = ["from __future__ import annotations"] + if imports["types"]: + import_lines.append("from types import " + ", ".join(imports["types"])) if imports["typing"]: import_lines.append("from typing import " + ", ".join(imports["typing"])) if imports["cpy_typing"]: From 9f3a1fe27b9f29771b87a4d5eb1914075d2b1e3a Mon Sep 17 00:00:00 2001 From: sw23 Date: Fri, 30 Oct 2020 01:29:58 -0400 Subject: [PATCH 1254/1293] Fixing stub for wifi_radio_ping --- shared-bindings/wifi/Radio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index a56ca5aaa6..e81e8793c4 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -283,7 +283,7 @@ const mp_obj_property_t wifi_radio_ap_info_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| def ping(self, ip: wifi.Radio, *, timeout: float = 0.5) -> float: +//| def ping(self, ip: ipaddress.IPv4Address, *, timeout: Optional[float] = 0.5) -> float: //| """Ping an IP to test connectivity. Returns echo time in seconds. //| Returns None when it times out.""" //| ... From 6a63d20a5d2e7184bfc5747b465818fb7eee6b49 Mon Sep 17 00:00:00 2001 From: sw23 Date: Fri, 30 Oct 2020 18:56:40 -0400 Subject: [PATCH 1255/1293] Fixing remaining stub mypy issues + run check-stubs to CI --- .github/workflows/build.yml | 2 +- shared-bindings/ipaddress/IPv4Address.c | 2 +- shared-bindings/socketpool/SocketPool.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 64d43f4d98..8039883e34 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,7 +68,7 @@ jobs: run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --via-mpy -d basics float working-directory: tests - name: Stubs - run: make stubs -j2 + run: make check-stubs -j2 - uses: actions/upload-artifact@v2 with: name: stubs diff --git a/shared-bindings/ipaddress/IPv4Address.c b/shared-bindings/ipaddress/IPv4Address.c index b2a10158ae..e027f32d65 100644 --- a/shared-bindings/ipaddress/IPv4Address.c +++ b/shared-bindings/ipaddress/IPv4Address.c @@ -126,7 +126,7 @@ const mp_obj_property_t ipaddress_ipv4address_version_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def __eq__(self, other: IPv4Address) -> bool: +//| def __eq__(self, other: object) -> bool: //| """Two Address objects are equal if their addresses and address types are equal.""" //| ... //| diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index b737b5fc2d..0cead525f8 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -58,7 +58,7 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t } -//| def socket(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> None: +//| def socket(self, family: int, type: int, proto: int) -> socketpool.Socket: //| """Create a new socket //| //| :param ~int family: AF_INET or AF_INET6 From 8e72b68e3de90f87261ce289dd7d3a28815cfd0b Mon Sep 17 00:00:00 2001 From: sw23 Date: Fri, 30 Oct 2020 19:16:26 -0400 Subject: [PATCH 1256/1293] Adding mypy to dep list and clarifying Stubs stage name --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8039883e34..07db88963b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: run: | sudo apt-get install -y eatmydata sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 latexmk texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra - pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli + pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli mypy - name: Versions run: | gcc --version @@ -67,7 +67,7 @@ jobs: - name: mpy Tests run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --via-mpy -d basics float working-directory: tests - - name: Stubs + - name: Build and Validate Stubs run: make check-stubs -j2 - uses: actions/upload-artifact@v2 with: From 345d84ffde527b16f50c203f7b6a718886be34f6 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 30 Oct 2020 22:16:12 -0400 Subject: [PATCH 1257/1293] improve USB CDC disconnect/reconnect checking --- supervisor/serial.h | 1 - supervisor/shared/serial.c | 6 +++--- supervisor/shared/usb/usb.c | 3 --- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/supervisor/serial.h b/supervisor/serial.h index 9c2d44737a..066886303e 100644 --- a/supervisor/serial.h +++ b/supervisor/serial.h @@ -47,5 +47,4 @@ char serial_read(void); bool serial_bytes_available(void); bool serial_connected(void); -extern volatile bool _serial_connected; #endif // MICROPY_INCLUDED_SUPERVISOR_SERIAL_H diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c index 91e90671d2..7383cc2282 100644 --- a/supervisor/shared/serial.c +++ b/supervisor/shared/serial.c @@ -47,8 +47,6 @@ busio_uart_obj_t debug_uart; byte buf_array[64]; #endif -volatile bool _serial_connected; - void serial_early_init(void) { #if defined(DEBUG_UART_TX) && defined(DEBUG_UART_RX) debug_uart.base.type = &busio_uart_type; @@ -71,7 +69,9 @@ bool serial_connected(void) { #if defined(DEBUG_UART_TX) && defined(DEBUG_UART_RX) return true; #else - return _serial_connected; + // True if DTR is asserted, and the USB connection is up. + // tud_cdc_get_line_state(): bit 0 is DTR, bit 1 is RTS + return (tud_cdc_get_line_state() & 1) && tud_ready(); #endif } diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index 89fbf56f37..93d3436e9d 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -116,7 +116,6 @@ void tud_umount_cb(void) { // remote_wakeup_en : if host allows us to perform remote wakeup // USB Specs: Within 7ms, device must draw an average current less than 2.5 mA from bus void tud_suspend_cb(bool remote_wakeup_en) { - _serial_connected = false; } // Invoked when usb bus is resumed @@ -128,8 +127,6 @@ void tud_resume_cb(void) { void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts) { (void) itf; // interface ID, not used - _serial_connected = dtr; - // DTR = false is counted as disconnected if ( !dtr ) { From 1f179b331750fbe05ccb4caff44e985234c9ee71 Mon Sep 17 00:00:00 2001 From: sw23 Date: Fri, 30 Oct 2020 23:19:27 -0400 Subject: [PATCH 1258/1293] Adding socket and socketpool class attributes --- shared-bindings/socket/__init__.c | 15 ++++++++------- shared-bindings/socketpool/SocketPool.c | 11 +++++++++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c index 38840da5ea..2969b37149 100644 --- a/shared-bindings/socket/__init__.c +++ b/shared-bindings/socket/__init__.c @@ -49,7 +49,14 @@ STATIC const mp_obj_type_t socket_type; //| class socket: //| -//| def __init__(self, family: int, type: int, proto: int) -> None: +//| AF_INET = 2 +//| AF_INET6 = 10 +//| SOCK_STREAM = 1 +//| SOCK_DGRAM = 2 +//| SOCK_RAW = 3 +//| IPPROTO_TCP = 6 +//| +//| def __init__(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> None: //| """Create a new socket //| //| :param int family: AF_INET or AF_INET6 @@ -57,12 +64,6 @@ STATIC const mp_obj_type_t socket_type; //| :param int proto: IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW (ignored)""" //| ... //| -//| AF_INET: int -//| AF_INET6: int -//| SOCK_STREAM: int -//| SOCK_DGRAM: int -//| SOCK_RAW: int -//| STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 0, 4, false); diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index 0cead525f8..2234f359ef 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -57,8 +57,14 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(s); } - -//| def socket(self, family: int, type: int, proto: int) -> socketpool.Socket: +//| AF_INET = 0 +//| AF_INET6 = 1 +//| SOCK_STREAM = 0 +//| SOCK_DGRAM = 1 +//| SOCK_RAW = 2 +//| IPPROTO_TCP = 6 +//| +//| def socket(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> socketpool.Socket: //| """Create a new socket //| //| :param ~int family: AF_INET or AF_INET6 @@ -66,6 +72,7 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t //| :param ~int proto: IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW (ignored)""" //| ... //| + STATIC mp_obj_t socketpool_socketpool_socket(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 0, 5, false); From a7616808e951b52e2ced08a7a279a224490ae404 Mon Sep 17 00:00:00 2001 From: "ITACA Innovation S.R.L" <40298126+ITACAInnovation@users.noreply.github.com> Date: Sat, 31 Oct 2020 10:12:49 +0100 Subject: [PATCH 1259/1293] Updated pinout --- ports/atmel-samd/boards/uchip/pins.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/ports/atmel-samd/boards/uchip/pins.c b/ports/atmel-samd/boards/uchip/pins.c index 856a220742..cfb6432336 100644 --- a/ports/atmel-samd/boards/uchip/pins.c +++ b/ports/atmel-samd/boards/uchip/pins.c @@ -1,14 +1,15 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA11) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA10) }, @@ -19,8 +20,10 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA23) }, - { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA31) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA30) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PA03) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA09) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, From 9a8484b853116e6f95f50da6d3bc66323d55ca9f Mon Sep 17 00:00:00 2001 From: "ITACA Innovation S.R.L" <40298126+ITACAInnovation@users.noreply.github.com> Date: Sat, 31 Oct 2020 11:06:56 +0100 Subject: [PATCH 1260/1293] Update mpconfigboard.h Removed ignore PA30 PA31 in order to allow using them as pinout --- ports/atmel-samd/boards/uchip/mpconfigboard.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.h b/ports/atmel-samd/boards/uchip/mpconfigboard.h index 1877a41ef9..5d6af4b782 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.h +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.h @@ -16,8 +16,6 @@ #define IGNORE_PIN_PA27 1 #define IGNORE_PIN_PA28 1 -#define IGNORE_PIN_PA30 1 -#define IGNORE_PIN_PA31 1 #define IGNORE_PIN_PB01 1 #define IGNORE_PIN_PB02 1 From 80ad300cad64a7da77d9292dbe5d2b81e458d5dc Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 31 Oct 2020 11:58:28 -0500 Subject: [PATCH 1261/1293] workflows: Fix typo that broke builds while trying to upload stubs --- .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 64d43f4d98..00db4f8cde 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,7 +116,7 @@ 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 - zip -9 circuitpython-stubs.CP_VERSION }}.zip stubs + zip -9 circuitpython-stubs.${{ env.CP_VERSION }}.zip stubs [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/stubs/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} From 0c30a26c9bcdfe537262d4ad3ea62b7eaba0c7b8 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 31 Oct 2020 13:19:13 -0400 Subject: [PATCH 1262/1293] Update .github/workflows/build.yml --- .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 00db4f8cde..36bf136d4d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,7 +116,7 @@ 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 - zip -9 circuitpython-stubs.${{ env.CP_VERSION }}.zip stubs + zip -9 circuitpython-stubs.zip stubs [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/stubs/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} From 073dc8751c92d943897db9e68b617fe7ba358f00 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 31 Oct 2020 14:50:13 -0400 Subject: [PATCH 1263/1293] Use correct stubs directory name The stubs directory is called `circuitpython-stubs`, not `stubs`. --- .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 36bf136d4d..514fa82da2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,7 +116,7 @@ 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 - zip -9 circuitpython-stubs.zip stubs + zip -9 circuitpython-stubs.zip circuitpython-stubs [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/stubs/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} From 3845db4bb98dbfa0b35b11baaa5d62f9f4266dea Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 31 Oct 2020 20:13:51 -0500 Subject: [PATCH 1264/1293] Update build.yml Need to request zip to recurse, because it is not the default --- .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 514fa82da2..b6c80558eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,7 +116,7 @@ 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 - zip -9 circuitpython-stubs.zip circuitpython-stubs + zip -9r circuitpython-stubs.zip circuitpython-stubs [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/stubs/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} From 1762a36438f7b54536186ab4d3bb11ef77553168 Mon Sep 17 00:00:00 2001 From: Jerry Needell Date: Sun, 1 Nov 2020 05:46:13 -0500 Subject: [PATCH 1265/1293] restore analogio to feather_m0_rfm9x/rfm69 builds --- ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk index c33ab07400..d746cdf811 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk @@ -12,7 +12,7 @@ CIRCUITPY_FULL_BUILD = 0 # A number of modules are removed for RFM69 to make room for frozen libraries. # Many I/O functions are not available. -CIRCUITPY_ANALOGIO = 0 +CIRCUITPY_ANALOGIO = 1 CIRCUITPY_PULSEIO = 0 CIRCUITPY_NEOPIXEL_WRITE = 1 CIRCUITPY_ROTARYIO = 0 diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index 49b0ef5e36..d373346889 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -13,7 +13,7 @@ CIRCUITPY_FULL_BUILD = 0 # A number of modules are removed for RFM9x to make room for frozen libraries. # Many I/O functions are not available. -CIRCUITPY_ANALOGIO = 0 +CIRCUITPY_ANALOGIO = 1 CIRCUITPY_PULSEIO = 0 CIRCUITPY_NEOPIXEL_WRITE = 1 CIRCUITPY_ROTARYIO = 0 From 4438050f794edea5c6a3f919964908800dd6b522 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sun, 1 Nov 2020 18:00:07 +0530 Subject: [PATCH 1266/1293] Add pcnt handler --- locale/circuitpython.pot | 9 ++- ports/esp32s2/Makefile | 1 + ports/esp32s2/common-hal/countio/Counter.c | 70 ++++++++++++---------- ports/esp32s2/common-hal/countio/Counter.h | 31 +++++++++- ports/esp32s2/pcnt_handler.c | 67 +++++++++++++++++++++ ports/esp32s2/pcnt_handler.h | 35 +++++++++++ 6 files changed, 177 insertions(+), 36 deletions(-) create mode 100644 ports/esp32s2/pcnt_handler.c create mode 100644 ports/esp32s2/pcnt_handler.h diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 16c3dd973a..1336ab25cd 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-01 11:11+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1109,7 +1109,8 @@ msgid "Invalid phase" msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "" @@ -1271,6 +1272,10 @@ msgstr "" msgid "No MOSI Pin" msgstr "" +#: ports/esp32s2/pcnt_handler.c +msgid "No PCNT unit free" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 8d891edd02..6dbbf58d4d 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -173,6 +173,7 @@ SRC_C += \ background.c \ fatfs_port.c \ mphalport.c \ + pcnt_handler.c \ bindings/espidf/__init__.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ diff --git a/ports/esp32s2/common-hal/countio/Counter.c b/ports/esp32s2/common-hal/countio/Counter.c index 6a76a163d7..4357624733 100644 --- a/ports/esp32s2/common-hal/countio/Counter.c +++ b/ports/esp32s2/common-hal/countio/Counter.c @@ -1,67 +1,75 @@ +/* + * 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 "common-hal/countio/Counter.h" +#include "common-hal/microcontroller/Pin.h" -#include "py/runtime.h" -#include "supervisor/shared/translate.h" +void common_hal_countio_counter_construct(countio_counter_obj_t* self, + const mcu_pin_obj_t* pin) { + claim_pin(pin); -#include "driver/pcnt.h" - -static void pcnt_init(countio_counter_obj_t* self) { - int unit = PCNT_UNIT_0; // Prepare configuration for the PCNT unit pcnt_config_t pcnt_config = { // Set PCNT input signal and control GPIOs - .pulse_gpio_num = self->pin->number, + .pulse_gpio_num = pin->number, .ctrl_gpio_num = PCNT_PIN_NOT_USED, .channel = PCNT_CHANNEL_0, - .unit = unit, // What to do on the positive / negative edge of pulse input? .pos_mode = PCNT_COUNT_INC, // Count up on the positive edge .neg_mode = PCNT_COUNT_DIS, // Keep the counter value on the negative edge }; // Initialize PCNT unit - pcnt_unit_config(&pcnt_config); + pcnt_handler_init(&pcnt_config); - // Configure and enable the input filter - pcnt_set_filter_value(unit, 100); - pcnt_filter_enable(unit); - - // Initialize PCNT's counter - pcnt_counter_pause(unit); - pcnt_counter_clear(unit); - - // Everything is set up, now go to counting - pcnt_counter_resume(unit); -} - -void common_hal_countio_counter_construct(countio_counter_obj_t* self, - const mcu_pin_obj_t* pin) { - claim_pin(pin); - self->pin = pin; - pcnt_init(self); + self->pin = pin->number; + self->unit = pcnt_config.unit; } bool common_hal_countio_counter_deinited(countio_counter_obj_t* self) { - return self->pin == NULL; + return self->unit == PCNT_UNIT_MAX; } void common_hal_countio_counter_deinit(countio_counter_obj_t* self) { if (common_hal_countio_counter_deinited(self)) { return; } - reset_pin_number(self->pin->number); - self->pin = NULL; + reset_pin_number(self->pin); + pcnt_handler_deinit(&self->unit); } mp_int_t common_hal_countio_counter_get_count(countio_counter_obj_t* self) { int16_t count; - pcnt_get_counter_value(PCNT_UNIT_0, &count); + pcnt_get_counter_value(self->unit, &count); return count+self->count; } void common_hal_countio_counter_set_count(countio_counter_obj_t* self, mp_int_t new_count) { self->count = new_count; - pcnt_counter_clear(PCNT_UNIT_0); + pcnt_counter_clear(self->unit); } void common_hal_countio_counter_reset(countio_counter_obj_t* self) { diff --git a/ports/esp32s2/common-hal/countio/Counter.h b/ports/esp32s2/common-hal/countio/Counter.h index 3406f9daaf..63d1eb98b2 100644 --- a/ports/esp32s2/common-hal/countio/Counter.h +++ b/ports/esp32s2/common-hal/countio/Counter.h @@ -1,15 +1,40 @@ +/* + * 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_ESP32S2_COMMON_HAL_COUNTIO_COUNTER_H #define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_COUNTIO_COUNTER_H -#include "common-hal/microcontroller/Pin.h" - #include "py/obj.h" +#include "pcnt_handler.h" typedef struct { mp_obj_base_t base; - const mcu_pin_obj_t * pin; + uint8_t pin; mp_int_t count; + pcnt_unit_t unit; } countio_counter_obj_t; #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_COUNTIO_COUNT_H diff --git a/ports/esp32s2/pcnt_handler.c b/ports/esp32s2/pcnt_handler.c new file mode 100644 index 0000000000..56fb0f21c8 --- /dev/null +++ b/ports/esp32s2/pcnt_handler.c @@ -0,0 +1,67 @@ +/* + * 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 "pcnt_handler.h" + +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +#define PCNT_UNIT_ACTIVE 1 +#define PCNT_UNIT_INACTIVE 0 + +static uint8_t pcnt_state[4]; + +void pcnt_handler_init(pcnt_config_t* pcnt_config) { + // Look for available pcnt unit + for (uint8_t i = 0; i<=3; i++) { + if (pcnt_state[i] == PCNT_UNIT_INACTIVE) { + pcnt_config->unit = (pcnt_unit_t)i; + pcnt_state[i] = PCNT_UNIT_ACTIVE; + break; + } else if (i == 3) { + mp_raise_RuntimeError(translate("No PCNT unit free")); + } + } + + // Initialize PCNT unit + pcnt_unit_config(pcnt_config); + + // Configure and enable the input filter + pcnt_set_filter_value(pcnt_config->unit, 100); + pcnt_filter_enable(pcnt_config->unit); + + // Initialize PCNT's counter + pcnt_counter_pause(pcnt_config->unit); + pcnt_counter_clear(pcnt_config->unit); + + // Everything is set up, now go to counting + pcnt_counter_resume(pcnt_config->unit); +} + +void pcnt_handler_deinit(pcnt_unit_t* unit) { + pcnt_state[*unit] = PCNT_UNIT_INACTIVE; + *unit = PCNT_UNIT_MAX; +} diff --git a/ports/esp32s2/pcnt_handler.h b/ports/esp32s2/pcnt_handler.h new file mode 100644 index 0000000000..4bdaee1b87 --- /dev/null +++ b/ports/esp32s2/pcnt_handler.h @@ -0,0 +1,35 @@ +/* + * 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_ESP32S2_PCNT_HANDLER_H +#define MICROPY_INCLUDED_ESP32S2_PCNT_HANDLER_H + +#include "driver/pcnt.h" + +extern void pcnt_handler_init(pcnt_config_t* pcnt_config); +extern void pcnt_handler_deinit(pcnt_unit_t* unit); + +#endif // MICROPY_INCLUDED_ESP32S2_PCNT_HANDLER_H From 856a6d4558d594e690a9e39ba841ef086c37ed9f Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Sat, 31 Oct 2020 15:51:35 +0000 Subject: [PATCH 1267/1293] Translated using Weblate (Spanish) Currently translated at 99.2% (838 of 844 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/es.po b/locale/es.po index 348af34067..a750c80554 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-21 20:13-0500\n" -"PO-Revision-Date: 2020-10-27 21:01+0000\n" -"Last-Translator: Adolfo Jayme Barrientos \n" +"PO-Revision-Date: 2020-11-01 16:26+0000\n" +"Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" @@ -297,7 +297,7 @@ msgstr "Tipo de dirección fuera de rango" #: ports/esp32s2/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" -msgstr "" +msgstr "Todos los periféricos CAN están en uso" #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" @@ -427,7 +427,7 @@ msgstr "" #: ports/esp32s2/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" -msgstr "" +msgstr "El periférico no maneja el Baudrate" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c From 7a07e8fa32de376c2f523b6c7d13e1b473198423 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Fri, 30 Oct 2020 21:04:56 +0000 Subject: [PATCH 1268/1293] Translated using Weblate (Swedish) Currently translated at 100.0% (844 of 844 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 53ed60acae..65cd9f6f1f 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: 2020-10-21 20:13-0500\n" -"PO-Revision-Date: 2020-10-26 02:36+0000\n" +"PO-Revision-Date: 2020-11-01 16:26+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -294,7 +294,7 @@ msgstr "Adresstyp utanför intervallet" #: ports/esp32s2/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" -msgstr "" +msgstr "All I2C-kringutrustning används" #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" @@ -420,7 +420,7 @@ msgstr "" #: ports/esp32s2/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" -msgstr "" +msgstr "Baudrate stöds inte av kringutrustning" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c @@ -2905,7 +2905,7 @@ msgstr "long int stöds inte i denna build" #: ports/esp32s2/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" -msgstr "" +msgstr "loopback + tyst läge stöds inte av kringutrustning" #: py/parse.c msgid "malformed f-string" @@ -2943,11 +2943,11 @@ msgstr "maximal rekursionsdjup överskriden" #: extmod/ulab/code/approx/approx.c msgid "maxiter must be > 0" -msgstr "" +msgstr "maxiter måste vara > 0" #: extmod/ulab/code/approx/approx.c msgid "maxiter should be > 0" -msgstr "" +msgstr "maxiter bör vara > 0" #: py/runtime.c #, c-format @@ -3388,7 +3388,7 @@ msgstr "argumentet sort måste vara en ndarray" #: extmod/ulab/code/numerical/numerical.c msgid "sorted axis can't be longer than 65535" -msgstr "" +msgstr "sorterad axel kan inte vara längre än 65535" #: extmod/ulab/code/filter/filter.c msgid "sos array must be of shape (n_section, 6)" @@ -3522,12 +3522,12 @@ msgstr "tupel/lista har fel längd" #: ports/esp32s2/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" -msgstr "" +msgstr "twai_driver_install returnerade esp-idf-fel #%d" #: ports/esp32s2/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" -msgstr "" +msgstr "twai_start returnerade esp-idf-fel #%d" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c From 72b829dff02cb9b8ebe6e2b47354f06650dbe864 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 1 Nov 2020 14:52:03 -0500 Subject: [PATCH 1269/1293] add binascii to most builds --- ports/atmel-samd/mpconfigport.h | 1 + py/circuitpy_mpconfig.h | 10 ++++++++++ py/objmodule.c | 7 ++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index f7ccff4da2..ed10da9b9d 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -47,6 +47,7 @@ // MICROPY_PY_UJSON depends on MICROPY_PY_IO #define MICROPY_PY_IO (0) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (0) +#define MICROPY_PY_UBINASCII (0) #define MICROPY_PY_UJSON (0) #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0) #define MICROPY_PY_UERRNO_LIST \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 1e01bd9c5e..08efabddb5 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -197,6 +197,9 @@ typedef long mp_off_t; #ifndef MICROPY_PY_COLLECTIONS_ORDEREDDICT #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (CIRCUITPY_FULL_BUILD) #endif +#ifndef MICROPY_PY_UBINASCII +#define MICROPY_PY_UBINASCII (CIRCUITPY_FULL_BUILD) +#endif // Opposite setting is deliberate. #define MICROPY_PY_UERRNO_ERRORCODE (!CIRCUITPY_FULL_BUILD) #ifndef MICROPY_PY_URE @@ -699,6 +702,12 @@ extern const struct _mp_obj_module_t ustack_module; #endif // These modules are not yet in shared-bindings, but we prefer the non-uxxx names. +#if MICROPY_PY_UBINASCII +#define BINASCII_MODULE { MP_ROM_QSTR(MP_QSTR_binascii), MP_ROM_PTR(&mp_module_ubinascii) }, +#else +#define BINASCII_MODULE +#endif + #if MICROPY_PY_UERRNO #define ERRNO_MODULE { MP_ROM_QSTR(MP_QSTR_errno), MP_ROM_PTR(&mp_module_uerrno) }, #else @@ -770,6 +779,7 @@ extern const struct _mp_obj_module_t wifi_module; AUDIOMIXER_MODULE \ AUDIOMP3_MODULE \ AUDIOPWMIO_MODULE \ + BINASCII_MODULE \ BITBANGIO_MODULE \ BLEIO_MODULE \ BOARD_MODULE \ diff --git a/py/objmodule.c b/py/objmodule.c index 757aece046..90796c5357 100644 --- a/py/objmodule.c +++ b/py/objmodule.c @@ -239,7 +239,12 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = { { MP_ROM_QSTR(MP_QSTR_hashlib), MP_ROM_PTR(&mp_module_uhashlib) }, #endif #if MICROPY_PY_UBINASCII - { MP_ROM_QSTR(MP_QSTR_binascii), MP_ROM_PTR(&mp_module_ubinascii) }, +#if CIRCUITPY +// CircuitPython: Defined in MICROPY_PORT_BUILTIN_MODULES, so not defined here. +// TODO: move to shared-bindings/ +#else + { MP_ROM_QSTR(MP_QSTR_ubinascii), MP_ROM_PTR(&mp_module_ubinascii) }, +#endif #endif #if MICROPY_PY_URANDOM { MP_ROM_QSTR(MP_QSTR_urandom), MP_ROM_PTR(&mp_module_urandom) }, From 4e52757f2653b16b91856df7575ec503c02c5d22 Mon Sep 17 00:00:00 2001 From: "ITACA Innovation S.R.L" <40298126+ITACAInnovation@users.noreply.github.com> Date: Sun, 1 Nov 2020 22:22:55 +0100 Subject: [PATCH 1270/1293] Update pins.c Added LED, BOOST_EN and VEXT_SELECT pins. --- ports/atmel-samd/boards/uchip/pins.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/atmel-samd/boards/uchip/pins.c b/ports/atmel-samd/boards/uchip/pins.c index cfb6432336..2d7eeebe11 100644 --- a/ports/atmel-samd/boards/uchip/pins.c +++ b/ports/atmel-samd/boards/uchip/pins.c @@ -1,6 +1,9 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_LED_BUILTIN), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_BOOST_EN), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_VEXT_SELECT), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA08) }, From 041c2a9f6174996a7c841e4ff7a1e158958c9745 Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Mon, 2 Nov 2020 08:35:25 -0500 Subject: [PATCH 1271/1293] .../boards/bdmicro_vina_d51: PAD updates for better resource flexibility. --- .../boards/bdmicro_vina_d51/mpconfigboard.h | 10 +- .../atmel-samd/boards/bdmicro_vina_d51/pins.c | 118 ++++++++++-------- 2 files changed, 68 insertions(+), 60 deletions(-) diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h b/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h index 6bc9bb7063..8b015df05e 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h +++ b/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h @@ -12,14 +12,14 @@ #define BOARD_HAS_CRYSTAL 1 -#define DEFAULT_I2C_BUS_SDA (&pin_PB02) -#define DEFAULT_I2C_BUS_SCL (&pin_PB03) +#define DEFAULT_I2C_BUS_SCL (&pin_PA16) +#define DEFAULT_I2C_BUS_SDA (&pin_PA17) +#define DEFAULT_UART_BUS_RX (&pin_PB20) +#define DEFAULT_UART_BUS_TX (&pin_PB21) #define DEFAULT_SPI_BUS_MISO (&pin_PB23) -#define DEFAULT_UART_BUS_TX (&pin_PB24) -#define DEFAULT_UART_BUS_RX (&pin_PB25) #define DEFAULT_SPI_BUS_MOSI (&pin_PC27) #define DEFAULT_SPI_BUS_SCK (&pin_PC28) -#define MICROPY_HW_LED_STATUS (&pin_PA15) +#define MICROPY_HW_LED_STATUS (&pin_PA23) #define MICROPY_HW_LED_RX (&pin_PC05) #define MICROPY_HW_LED_TX (&pin_PC06) diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c b/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c index 931e0328fc..8eeab8a9a5 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c +++ b/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c @@ -1,64 +1,70 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PC00) }, - { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_PC01) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB00) }, - { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PB01) }, - { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PB05) }, - { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PC10) }, - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PC11) }, - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA13) }, - { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PB15) }, - { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PC20) }, - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PC21) }, - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA12) }, - { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PB31) }, - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA16) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PB31) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PC16) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PC13) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PC17) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PC18) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PC19) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PC20) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PC21) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PB18) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PB19) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PC12) }, { MP_ROM_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_ESP01_EN), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_ESP01_EN), MP_ROM_PTR(&pin_PC15) }, + { MP_ROM_QSTR(MP_QSTR_E5), MP_ROM_PTR(&pin_PC15) }, { MP_ROM_QSTR(MP_QSTR_ESP01_GPIO0), MP_ROM_PTR(&pin_PA18) }, - { MP_ROM_QSTR(MP_QSTR_UART3_RTS), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_E3), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_ESP01_GPIO2), MP_ROM_PTR(&pin_PA19) }, - { MP_ROM_QSTR(MP_QSTR_UART3_CTS), MP_ROM_PTR(&pin_PA19) }, - { MP_ROM_QSTR(MP_QSTR_ESP01_RESET), MP_ROM_PTR(&pin_PC02) }, - { MP_ROM_QSTR(MP_QSTR_ESP01_RX), MP_ROM_PTR(&pin_PB21) }, - { MP_ROM_QSTR(MP_QSTR_UART3_RX), MP_ROM_PTR(&pin_PB21) }, - { MP_ROM_QSTR(MP_QSTR_ESP01_TX), MP_ROM_PTR(&pin_PB20) }, - { MP_ROM_QSTR(MP_QSTR_UART3_TX), MP_ROM_PTR(&pin_PB20) }, - { MP_ROM_QSTR(MP_QSTR_I2C_SCL), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_I2C_SDA), MP_ROM_PTR(&pin_PB02) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_E4), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_ESP01_RESET), MP_ROM_PTR(&pin_PC14) }, + { MP_ROM_QSTR(MP_QSTR_E6), MP_ROM_PTR(&pin_PC14) }, + { MP_ROM_QSTR(MP_QSTR_ESP01_RX), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_UART3_RX), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_I2C3_SCL), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_E2), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_ESP01_TX), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_UART3_TX), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_I2C3_SDA), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_E1), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_I2C1_SCL), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_I2C1_SDA), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA17) }, { MP_ROM_QSTR(MP_QSTR_I2S_FS_0), MP_ROM_PTR(&pin_PA20) }, - { MP_ROM_QSTR(MP_QSTR_I2S_FS_1), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_I2S_MCK_0), MP_ROM_PTR(&pin_PB17) }, - { MP_ROM_QSTR(MP_QSTR_I2S_MCK_1), MP_ROM_PTR(&pin_PB13) }, { MP_ROM_QSTR(MP_QSTR_I2S_SCK_0), MP_ROM_PTR(&pin_PB16) }, - { MP_ROM_QSTR(MP_QSTR_I2S_SCK_1), MP_ROM_PTR(&pin_PB12) }, { MP_ROM_QSTR(MP_QSTR_I2S_SDI), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_I2S_SDO), MP_ROM_PTR(&pin_PA21) }, - { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_LED_STATUS), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_PB18) }, - { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_PB19) }, + { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_LED_STATUS), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_PB14) }, { MP_ROM_QSTR(MP_QSTR_LED_RX), MP_ROM_PTR(&pin_PC05) }, { MP_ROM_QSTR(MP_QSTR_LED_TX), MP_ROM_PTR(&pin_PC06) }, - { MP_ROM_QSTR(MP_QSTR_RS485_RE), MP_ROM_PTR(&pin_PC15) }, - { MP_ROM_QSTR(MP_QSTR_RS485_RX), MP_ROM_PTR(&pin_PC13) }, - { MP_ROM_QSTR(MP_QSTR_RS485_TE), MP_ROM_PTR(&pin_PC14) }, - { MP_ROM_QSTR(MP_QSTR_RS485_TX), MP_ROM_PTR(&pin_PC12) }, + { MP_ROM_QSTR(MP_QSTR_RS485_RE), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_RS485_RX), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_RS485_TE), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_RS485_TX), MP_ROM_PTR(&pin_PB02) }, { MP_ROM_QSTR(MP_QSTR_SPI_MISO), MP_ROM_PTR(&pin_PB23) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB23) }, { MP_ROM_QSTR(MP_QSTR_SPI_MOSI), MP_ROM_PTR(&pin_PC27) }, @@ -67,14 +73,16 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PC28) }, { MP_ROM_QSTR(MP_QSTR_SPI_SS), MP_ROM_PTR(&pin_PB22) }, { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_PB22) }, - { MP_ROM_QSTR(MP_QSTR_UART1_CTS), MP_ROM_PTR(&pin_PC19) }, - { MP_ROM_QSTR(MP_QSTR_UART1_RTS), MP_ROM_PTR(&pin_PC18) }, - { MP_ROM_QSTR(MP_QSTR_UART1_RX), MP_ROM_PTR(&pin_PC17) }, - { MP_ROM_QSTR(MP_QSTR_UART1_TX), MP_ROM_PTR(&pin_PC16) }, - { MP_ROM_QSTR(MP_QSTR_UART2_RX), MP_ROM_PTR(&pin_PB25) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB25) }, - { MP_ROM_QSTR(MP_QSTR_UART2_TX), MP_ROM_PTR(&pin_PB24) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB24) }, + { MP_ROM_QSTR(MP_QSTR_UART1_CTS), MP_ROM_PTR(&pin_PC25) }, + { MP_ROM_QSTR(MP_QSTR_UART1_RTS), MP_ROM_PTR(&pin_PC24) }, + { MP_ROM_QSTR(MP_QSTR_UART1_RX), MP_ROM_PTR(&pin_PB24) }, + { MP_ROM_QSTR(MP_QSTR_UART1_TX), MP_ROM_PTR(&pin_PB25) }, + { MP_ROM_QSTR(MP_QSTR_UART2_RX), MP_ROM_PTR(&pin_PB20) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB20) }, + { MP_ROM_QSTR(MP_QSTR_I2C2_SCL), MP_ROM_PTR(&pin_PB20) }, + { MP_ROM_QSTR(MP_QSTR_UART2_TX), MP_ROM_PTR(&pin_PB21) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB21) }, + { MP_ROM_QSTR(MP_QSTR_I2C2_SDA), MP_ROM_PTR(&pin_PB21) }, { 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 1f7a3f0dfab05ab9551f0e1ecff9f45805897837 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 2 Nov 2020 15:28:30 -0500 Subject: [PATCH 1272/1293] Rev C Feather M4 CAN pin changes --- ports/atmel-samd/boards/feather_m4_can/pins.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ports/atmel-samd/boards/feather_m4_can/pins.c b/ports/atmel-samd/boards/feather_m4_can/pins.c index 2b67709f87..0150473301 100644 --- a/ports/atmel-samd/boards/feather_m4_can/pins.c +++ b/ports/atmel-samd/boards/feather_m4_can/pins.c @@ -36,6 +36,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA12) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA14) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA18) }, @@ -45,14 +46,17 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA23) }, - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PB01) }, - { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PB00) }, + + { MP_ROM_QSTR(MP_QSTR_BOOST_ENABLE), MP_ROM_PTR(&pin_PB13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR(&pin_PB15) }, { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR(&pin_PB14) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_STANDBY), MP_ROM_PTR(&pin_PB13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_STANDBY), MP_ROM_PTR(&pin_PB12) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, From 23afe08b6f81b70e2f24c609e6c43b0682aaf30b Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 2 Nov 2020 17:15:19 -0500 Subject: [PATCH 1273/1293] Add GPIO reset to end of neopixel-write --- ports/esp32s2/common-hal/neopixel_write/__init__.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/esp32s2/common-hal/neopixel_write/__init__.c b/ports/esp32s2/common-hal/neopixel_write/__init__.c index 553cb79f83..63d50bf14a 100644 --- a/ports/esp32s2/common-hal/neopixel_write/__init__.c +++ b/ports/esp32s2/common-hal/neopixel_write/__init__.c @@ -125,4 +125,6 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout // Free channel again esp32s2_peripherals_free_rmt(config.channel); + // Swap pin back to GPIO mode + gpio_set_direction(digitalinout->pin->number, GPIO_MODE_OUTPUT); } From 6c61a53e0fc7a2b56156551a7da07e8734e00a33 Mon Sep 17 00:00:00 2001 From: lady ada Date: Mon, 2 Nov 2020 18:38:23 -0500 Subject: [PATCH 1274/1293] io naming for gpio (credit to @kattni) --- .../boards/adafruit_metro_esp32s2/pins.c | 70 ++++++++++++------- 1 file changed, 45 insertions(+), 25 deletions(-) diff --git a/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c b/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c index 08d2b2a1a3..a7fc8b2d7c 100644 --- a/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c +++ b/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c @@ -2,41 +2,61 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO1) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO2) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO3) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO4) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO5) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO5) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO6) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO6) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO7) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO8) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO9) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO10) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO11) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO13) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO14) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO15) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO16) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO21) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO42) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO1) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO2) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO3) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO4) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_GPIO33) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO33),MP_ROM_PTR(&pin_GPIO33) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL),MP_ROM_PTR(&pin_GPIO34) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO34),MP_ROM_PTR(&pin_GPIO34) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI),MP_ROM_PTR(&pin_GPIO35) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO35),MP_ROM_PTR(&pin_GPIO35) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_MISO),MP_ROM_PTR(&pin_GPIO37) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO37),MP_ROM_PTR(&pin_GPIO37) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO42) }, { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO45) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, { MP_OBJ_NEW_QSTR(MP_QSTR_DEBUG_RX), MP_ROM_PTR(&pin_GPIO38) }, { MP_OBJ_NEW_QSTR(MP_QSTR_DEBUG_TX), MP_ROM_PTR(&pin_GPIO37) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI),MP_ROM_PTR(&pin_GPIO35) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_MISO),MP_ROM_PTR(&pin_GPIO37) }, - { 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 18838e390a71366ccaa1aaeda8964e65d70fc43f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 29 Oct 2020 19:38:25 -0700 Subject: [PATCH 1275/1293] reduce connection footprint and fix recv --- ports/esp32s2/common-hal/socketpool/Socket.c | 22 ++++++------- .../esp32s2/esp-idf-config/sdkconfig.defaults | 33 ++++++++++++------- 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/esp32s2/common-hal/socketpool/Socket.c index 0a994c604e..750415dc7b 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.c +++ b/ports/esp32s2/common-hal/socketpool/Socket.c @@ -79,15 +79,15 @@ mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t* self, const mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len) { size_t received = 0; - ssize_t last_read = 1; + int status = 0; uint64_t start_ticks = supervisor_ticks_ms64(); int sockfd; esp_err_t err = esp_tls_get_conn_sockfd(self->tcp, &sockfd); if (err != ESP_OK) { mp_raise_OSError(MP_EBADF); } - while (received < len && - last_read > 0 && + while (received == 0 && + status >= 0 && (self->timeout_ms == 0 || supervisor_ticks_ms64() - start_ticks <= self->timeout_ms) && !mp_hal_is_interrupted()) { RUN_BACKGROUND_TASKS; @@ -95,27 +95,25 @@ mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, if (available == 0) { // This reads the raw socket buffer and is used for non-TLS connections // and between encrypted TLS blocks. - int status = lwip_ioctl(sockfd, FIONREAD, &available); - if (status < 0) { - last_read = status; - break; - } + status = lwip_ioctl(sockfd, FIONREAD, &available); } size_t remaining = len - received; if (available > remaining) { available = remaining; } if (available > 0) { - last_read = esp_tls_conn_read(self->tcp, (void*) buf + received, available); - received += last_read; + status = esp_tls_conn_read(self->tcp, (void*) buf + received, available); + if (status > 0) { + received += status; + } } } - if (last_read == 0) { + if (received == 0) { // socket closed common_hal_socketpool_socket_close(self); } - if (last_read < 0) { + if (status < 0) { mp_raise_BrokenPipeError(); } return received; diff --git a/ports/esp32s2/esp-idf-config/sdkconfig.defaults b/ports/esp32s2/esp-idf-config/sdkconfig.defaults index 4094367e0c..37b33fc69e 100644 --- a/ports/esp32s2/esp-idf-config/sdkconfig.defaults +++ b/ports/esp32s2/esp-idf-config/sdkconfig.defaults @@ -135,6 +135,7 @@ CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y # CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set # CONFIG_COMPILER_WARN_WRITE_STRINGS is not set # CONFIG_COMPILER_DISABLE_GCC8_WARNINGS is not set +# CONFIG_COMPILER_DUMP_RTL_FILES is not set # end of Compiler options # @@ -332,12 +333,13 @@ CONFIG_ESP_TIMER_IMPL_SYSTIMER=y # # Wi-Fi # -CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 -CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 # CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 -CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32 +CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM=16 +CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16 # CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_TX_BA_WIN=6 @@ -439,7 +441,7 @@ CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y # CONFIG_LWIP_L2_TO_L3_COPY is not set # CONFIG_LWIP_IRAM_OPTIMIZATION is not set CONFIG_LWIP_TIMERS_ONDEMAND=y -CONFIG_LWIP_MAX_SOCKETS=10 +CONFIG_LWIP_MAX_SOCKETS=4 # CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set # CONFIG_LWIP_SO_LINGER is not set CONFIG_LWIP_SO_REUSE=y @@ -459,6 +461,9 @@ CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y # CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set +# +# CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set + # # DHCP server # @@ -474,15 +479,15 @@ CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 # # TCP # -CONFIG_LWIP_MAX_ACTIVE_TCP=16 -CONFIG_LWIP_MAX_LISTENING_TCP=16 +CONFIG_LWIP_MAX_ACTIVE_TCP=4 +CONFIG_LWIP_MAX_LISTENING_TCP=4 CONFIG_LWIP_TCP_MAXRTX=12 CONFIG_LWIP_TCP_SYNMAXRTX=6 CONFIG_LWIP_TCP_MSS=1440 CONFIG_LWIP_TCP_TMR_INTERVAL=250 CONFIG_LWIP_TCP_MSL=60000 -CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 -CONFIG_LWIP_TCP_WND_DEFAULT=5744 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=2880 +CONFIG_LWIP_TCP_WND_DEFAULT=2880 CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 CONFIG_LWIP_TCP_QUEUE_OOSEQ=y # CONFIG_LWIP_TCP_SACK_OUT is not set @@ -505,6 +510,8 @@ CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y # CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF # CONFIG_LWIP_PPP_SUPPORT is not set +CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 +CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 # CONFIG_LWIP_SLIP_SUPPORT is not set # @@ -552,8 +559,10 @@ CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y # CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 -CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 -# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=2048 +CONFIG_MBEDTLS_DYNAMIC_BUFFER=y +CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y +CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y # CONFIG_MBEDTLS_DEBUG is not set # @@ -824,8 +833,8 @@ CONFIG_TCP_MAXRTX=12 CONFIG_TCP_SYNMAXRTX=6 CONFIG_TCP_MSS=1440 CONFIG_TCP_MSL=60000 -CONFIG_TCP_SND_BUF_DEFAULT=5744 -CONFIG_TCP_WND_DEFAULT=5744 +CONFIG_TCP_SND_BUF_DEFAULT=2880 +CONFIG_TCP_WND_DEFAULT=2880 CONFIG_TCP_RECVMBOX_SIZE=6 CONFIG_TCP_QUEUE_OOSEQ=y # CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set From 88fcf4ef7e001e547ed94747df5d22b6736c881c Mon Sep 17 00:00:00 2001 From: sw23 Date: Mon, 2 Nov 2020 19:59:07 -0500 Subject: [PATCH 1276/1293] Removing implementation-specific values for socket/socketpool class attributes --- shared-bindings/socket/__init__.c | 12 ++++++------ shared-bindings/socketpool/SocketPool.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c index 2969b37149..799bf28afa 100644 --- a/shared-bindings/socket/__init__.c +++ b/shared-bindings/socket/__init__.c @@ -49,12 +49,12 @@ STATIC const mp_obj_type_t socket_type; //| class socket: //| -//| AF_INET = 2 -//| AF_INET6 = 10 -//| SOCK_STREAM = 1 -//| SOCK_DGRAM = 2 -//| SOCK_RAW = 3 -//| IPPROTO_TCP = 6 +//| AF_INET: int +//| AF_INET6: int +//| SOCK_STREAM: int +//| SOCK_DGRAM: int +//| SOCK_RAW: int +//| IPPROTO_TCP: int //| //| def __init__(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> None: //| """Create a new socket diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index 2234f359ef..73eeed2652 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -57,12 +57,12 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(s); } -//| AF_INET = 0 -//| AF_INET6 = 1 -//| SOCK_STREAM = 0 -//| SOCK_DGRAM = 1 -//| SOCK_RAW = 2 -//| IPPROTO_TCP = 6 +//| AF_INET: int +//| AF_INET6: int +//| SOCK_STREAM: int +//| SOCK_DGRAM: int +//| SOCK_RAW: int +//| IPPROTO_TCP: int //| //| def socket(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> socketpool.Socket: //| """Create a new socket From 7441344c6f29d9dbf7f8cedef55f394c42916963 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 2 Nov 2020 17:22:24 -0800 Subject: [PATCH 1277/1293] Add new config options to default --- ports/esp32s2/esp-idf-config/sdkconfig.defaults | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ports/esp32s2/esp-idf-config/sdkconfig.defaults b/ports/esp32s2/esp-idf-config/sdkconfig.defaults index 37b33fc69e..025b05caa6 100644 --- a/ports/esp32s2/esp-idf-config/sdkconfig.defaults +++ b/ports/esp32s2/esp-idf-config/sdkconfig.defaults @@ -264,6 +264,11 @@ CONFIG_ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP=y # CONFIG_PM_ENABLE is not set # end of Power Management +# +# ADC-Calibration +# +# end of ADC-Calibration + # # Common ESP-related # @@ -403,6 +408,7 @@ CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 # CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y # CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set +# CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set CONFIG_FREERTOS_DEBUG_OCDAWARE=y # end of FreeRTOS @@ -715,6 +721,7 @@ CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20 CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1 CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192 +# CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set # # Auto-detect flash chips From c4521287e39abf92f1833a25f950aa5bd8e4857c Mon Sep 17 00:00:00 2001 From: lady ada Date: Mon, 2 Nov 2020 23:22:53 -0500 Subject: [PATCH 1278/1293] add rx/tx default uart names --- ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c b/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c index a7fc8b2d7c..dbd6cfef8d 100644 --- a/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c +++ b/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c @@ -19,8 +19,12 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO4) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO5) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO6) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, From 4055c5ac61f824f7f2cfd72e670037af2f601427 Mon Sep 17 00:00:00 2001 From: Ed Hagerty Date: Tue, 3 Nov 2020 17:14:58 +0000 Subject: [PATCH 1279/1293] Update README.md --- ports/esp32s2/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/README.md b/ports/esp32s2/README.md index f3e678de85..0738d520e7 100644 --- a/ports/esp32s2/README.md +++ b/ports/esp32s2/README.md @@ -30,7 +30,7 @@ Connect these pins using a [USB adapter](https://www.adafruit.com/product/4090) ## Building and flashing ## -Before building or flashing the ESP32-S2, you must [install the esp-idf](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/get-started/index.html). This must be re-done ever time the esp-idf is updated, but not every time you build. Run `cd ports/esp32s2` from `circuitpython/` to move to the esp32s2 port root, and run: +Before building or flashing the ESP32-S2, you must [install the esp-idf](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/get-started/index.html). This must be re-done every time the esp-idf is updated, but not every time you build. Run `cd ports/esp32s2` from `circuitpython/` to move to the esp32s2 port root, and run: ``` ./esp-idf/install.sh From ca935c0dafba767f8eae681664972d0f6a0c5507 Mon Sep 17 00:00:00 2001 From: "ITACA Innovation S.R.L" <40298126+ITACAInnovation@users.noreply.github.com> Date: Tue, 3 Nov 2020 21:22:19 +0100 Subject: [PATCH 1280/1293] Update pins.c Changed builtin to standard --- ports/atmel-samd/boards/uchip/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/uchip/pins.c b/ports/atmel-samd/boards/uchip/pins.c index 2d7eeebe11..de5508110d 100644 --- a/ports/atmel-samd/boards/uchip/pins.c +++ b/ports/atmel-samd/boards/uchip/pins.c @@ -1,7 +1,7 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_LED_BUILTIN), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_BOOST_EN), MP_ROM_PTR(&pin_PA14) }, { MP_ROM_QSTR(MP_QSTR_VEXT_SELECT), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA06) }, From fe6bfde590fc325c984c679825024241afd23a5f Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 4 Nov 2020 21:20:24 +0530 Subject: [PATCH 1281/1293] move pcnt handler --- locale/circuitpython.pot | 10 +++++----- ports/esp32s2/Makefile | 2 +- ports/esp32s2/{ => peripherals}/pcnt_handler.c | 2 +- ports/esp32s2/{ => peripherals}/pcnt_handler.h | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) rename ports/esp32s2/{ => peripherals}/pcnt_handler.c (96%) rename ports/esp32s2/{ => peripherals}/pcnt_handler.h (88%) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 1336ab25cd..b4445abfbf 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-01 11:11+0530\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -296,6 +296,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1272,10 +1276,6 @@ msgstr "" msgid "No MOSI Pin" msgstr "" -#: ports/esp32s2/pcnt_handler.c -msgid "No PCNT unit free" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 6dbbf58d4d..56f0d46a31 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -173,7 +173,6 @@ SRC_C += \ background.c \ fatfs_port.c \ mphalport.c \ - pcnt_handler.c \ bindings/espidf/__init__.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ @@ -189,6 +188,7 @@ SRC_C += \ lib/utils/pyexec.c \ lib/utils/stdout_helpers.c \ lib/utils/sys_stdio_mphal.c \ + peripherals/pcnt_handler.c \ peripherals/pins.c \ peripherals/rmt.c \ supervisor/shared/memory.c diff --git a/ports/esp32s2/pcnt_handler.c b/ports/esp32s2/peripherals/pcnt_handler.c similarity index 96% rename from ports/esp32s2/pcnt_handler.c rename to ports/esp32s2/peripherals/pcnt_handler.c index 56fb0f21c8..5a0cc9a7c2 100644 --- a/ports/esp32s2/pcnt_handler.c +++ b/ports/esp32s2/peripherals/pcnt_handler.c @@ -42,7 +42,7 @@ void pcnt_handler_init(pcnt_config_t* pcnt_config) { pcnt_state[i] = PCNT_UNIT_ACTIVE; break; } else if (i == 3) { - mp_raise_RuntimeError(translate("No PCNT unit free")); + mp_raise_RuntimeError(translate("All PCNT units in use")); } } diff --git a/ports/esp32s2/pcnt_handler.h b/ports/esp32s2/peripherals/pcnt_handler.h similarity index 88% rename from ports/esp32s2/pcnt_handler.h rename to ports/esp32s2/peripherals/pcnt_handler.h index 4bdaee1b87..f44ee1f830 100644 --- a/ports/esp32s2/pcnt_handler.h +++ b/ports/esp32s2/peripherals/pcnt_handler.h @@ -24,12 +24,12 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_PCNT_HANDLER_H -#define MICROPY_INCLUDED_ESP32S2_PCNT_HANDLER_H +#ifndef MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PCNT_HANDLER_H +#define MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PCNT_HANDLER_H #include "driver/pcnt.h" extern void pcnt_handler_init(pcnt_config_t* pcnt_config); extern void pcnt_handler_deinit(pcnt_unit_t* unit); -#endif // MICROPY_INCLUDED_ESP32S2_PCNT_HANDLER_H +#endif // MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PCNT_HANDLER_H From 92cd599ea31482b5462438334ef36ae3cfd9dba8 Mon Sep 17 00:00:00 2001 From: cyz Date: Thu, 5 Nov 2020 09:14:53 +0800 Subject: [PATCH 1282/1293] Modify the pins of the hiibot_bluefi. --- ports/nrf/boards/hiibot_bluefi/pins.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/nrf/boards/hiibot_bluefi/pins.c b/ports/nrf/boards/hiibot_bluefi/pins.c index 340ea948cf..bce4ee52dd 100644 --- a/ports/nrf/boards/hiibot_bluefi/pins.c +++ b/ports/nrf/boards/hiibot_bluefi/pins.c @@ -109,10 +109,10 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_P0_27) }, { MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_P0_27) }, - { MP_ROM_QSTR(MP_QSTR_P27), MP_ROM_PTR(&pin_P1_14) }, - { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_P1_14) }, - { MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_P1_14) }, - { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_P1_14) }, + { MP_ROM_QSTR(MP_QSTR_P27), MP_ROM_PTR(&pin_P1_13) }, + { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_P1_13) }, + //{ MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_P1_13) }, + { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_P1_13) }, // P28~P33/D28~D33 connecte into QSPI FlashROM (W25Q16JV_IQ) From d8ef9a127b4914f7d9b50131c15e653aef94cb8f Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Thu, 5 Nov 2020 10:10:39 +0530 Subject: [PATCH 1283/1293] rename pcnt_handler to pcnt --- ports/esp32s2/Makefile | 2 +- ports/esp32s2/common-hal/countio/Counter.c | 5 +++-- ports/esp32s2/common-hal/countio/Counter.h | 2 +- ports/esp32s2/peripherals/{pcnt_handler.c => pcnt.c} | 6 +++--- ports/esp32s2/peripherals/{pcnt_handler.h => pcnt.h} | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) rename ports/esp32s2/peripherals/{pcnt_handler.c => pcnt.c} (94%) rename ports/esp32s2/peripherals/{pcnt_handler.h => pcnt.h} (92%) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 56f0d46a31..55d6e91d44 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -188,7 +188,7 @@ SRC_C += \ lib/utils/pyexec.c \ lib/utils/stdout_helpers.c \ lib/utils/sys_stdio_mphal.c \ - peripherals/pcnt_handler.c \ + peripherals/pcnt.c \ peripherals/pins.c \ peripherals/rmt.c \ supervisor/shared/memory.c diff --git a/ports/esp32s2/common-hal/countio/Counter.c b/ports/esp32s2/common-hal/countio/Counter.c index 4357624733..81f9f7ad2a 100644 --- a/ports/esp32s2/common-hal/countio/Counter.c +++ b/ports/esp32s2/common-hal/countio/Counter.c @@ -42,7 +42,8 @@ void common_hal_countio_counter_construct(countio_counter_obj_t* self, .neg_mode = PCNT_COUNT_DIS, // Keep the counter value on the negative edge }; // Initialize PCNT unit - pcnt_handler_init(&pcnt_config); + // This also sets pcnt_config.unit + peripherals_pcnt_init(&pcnt_config); self->pin = pin->number; self->unit = pcnt_config.unit; @@ -57,7 +58,7 @@ void common_hal_countio_counter_deinit(countio_counter_obj_t* self) { return; } reset_pin_number(self->pin); - pcnt_handler_deinit(&self->unit); + peripherals_pcnt_deinit(&self->unit); } mp_int_t common_hal_countio_counter_get_count(countio_counter_obj_t* self) { diff --git a/ports/esp32s2/common-hal/countio/Counter.h b/ports/esp32s2/common-hal/countio/Counter.h index 63d1eb98b2..20fe5b83e6 100644 --- a/ports/esp32s2/common-hal/countio/Counter.h +++ b/ports/esp32s2/common-hal/countio/Counter.h @@ -28,7 +28,7 @@ #define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_COUNTIO_COUNTER_H #include "py/obj.h" -#include "pcnt_handler.h" +#include "peripherals/pcnt.h" typedef struct { mp_obj_base_t base; diff --git a/ports/esp32s2/peripherals/pcnt_handler.c b/ports/esp32s2/peripherals/pcnt.c similarity index 94% rename from ports/esp32s2/peripherals/pcnt_handler.c rename to ports/esp32s2/peripherals/pcnt.c index 5a0cc9a7c2..e7eb32c1d1 100644 --- a/ports/esp32s2/peripherals/pcnt_handler.c +++ b/ports/esp32s2/peripherals/pcnt.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "pcnt_handler.h" +#include "peripherals/pcnt.h" #include "py/runtime.h" #include "supervisor/shared/translate.h" @@ -34,7 +34,7 @@ static uint8_t pcnt_state[4]; -void pcnt_handler_init(pcnt_config_t* pcnt_config) { +void peripherals_pcnt_init(pcnt_config_t* pcnt_config) { // Look for available pcnt unit for (uint8_t i = 0; i<=3; i++) { if (pcnt_state[i] == PCNT_UNIT_INACTIVE) { @@ -61,7 +61,7 @@ void pcnt_handler_init(pcnt_config_t* pcnt_config) { pcnt_counter_resume(pcnt_config->unit); } -void pcnt_handler_deinit(pcnt_unit_t* unit) { +void peripherals_pcnt_deinit(pcnt_unit_t* unit) { pcnt_state[*unit] = PCNT_UNIT_INACTIVE; *unit = PCNT_UNIT_MAX; } diff --git a/ports/esp32s2/peripherals/pcnt_handler.h b/ports/esp32s2/peripherals/pcnt.h similarity index 92% rename from ports/esp32s2/peripherals/pcnt_handler.h rename to ports/esp32s2/peripherals/pcnt.h index f44ee1f830..64072501cb 100644 --- a/ports/esp32s2/peripherals/pcnt_handler.h +++ b/ports/esp32s2/peripherals/pcnt.h @@ -29,7 +29,7 @@ #include "driver/pcnt.h" -extern void pcnt_handler_init(pcnt_config_t* pcnt_config); -extern void pcnt_handler_deinit(pcnt_unit_t* unit); +extern void peripherals_pcnt_init(pcnt_config_t* pcnt_config); +extern void peripherals_pcnt_deinit(pcnt_unit_t* unit); #endif // MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PCNT_HANDLER_H From ac8a0faa0d64fd07af65a798c7e1fc5ce4e39df2 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Fri, 6 Nov 2020 01:42:20 +0530 Subject: [PATCH 1284/1293] update peripherals_pcnt_init() --- ports/esp32s2/common-hal/countio/Counter.c | 14 +++++++++---- ports/esp32s2/peripherals/pcnt.c | 23 +++++++++++----------- ports/esp32s2/peripherals/pcnt.h | 2 +- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/ports/esp32s2/common-hal/countio/Counter.c b/ports/esp32s2/common-hal/countio/Counter.c index 81f9f7ad2a..fe52d93add 100644 --- a/ports/esp32s2/common-hal/countio/Counter.c +++ b/ports/esp32s2/common-hal/countio/Counter.c @@ -27,12 +27,15 @@ #include "common-hal/countio/Counter.h" #include "common-hal/microcontroller/Pin.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + void common_hal_countio_counter_construct(countio_counter_obj_t* self, const mcu_pin_obj_t* pin) { claim_pin(pin); // Prepare configuration for the PCNT unit - pcnt_config_t pcnt_config = { + const pcnt_config_t pcnt_config = { // Set PCNT input signal and control GPIOs .pulse_gpio_num = pin->number, .ctrl_gpio_num = PCNT_PIN_NOT_USED, @@ -41,12 +44,15 @@ void common_hal_countio_counter_construct(countio_counter_obj_t* self, .pos_mode = PCNT_COUNT_INC, // Count up on the positive edge .neg_mode = PCNT_COUNT_DIS, // Keep the counter value on the negative edge }; + // Initialize PCNT unit - // This also sets pcnt_config.unit - peripherals_pcnt_init(&pcnt_config); + const int8_t unit = peripherals_pcnt_init(pcnt_config); + if (unit == -1) { + mp_raise_RuntimeError(translate("All PCNT units in use")); + } self->pin = pin->number; - self->unit = pcnt_config.unit; + self->unit = (pcnt_unit_t)unit; } bool common_hal_countio_counter_deinited(countio_counter_obj_t* self) { diff --git a/ports/esp32s2/peripherals/pcnt.c b/ports/esp32s2/peripherals/pcnt.c index e7eb32c1d1..555a0ec1d3 100644 --- a/ports/esp32s2/peripherals/pcnt.c +++ b/ports/esp32s2/peripherals/pcnt.c @@ -26,39 +26,38 @@ #include "peripherals/pcnt.h" -#include "py/runtime.h" -#include "supervisor/shared/translate.h" - #define PCNT_UNIT_ACTIVE 1 #define PCNT_UNIT_INACTIVE 0 static uint8_t pcnt_state[4]; -void peripherals_pcnt_init(pcnt_config_t* pcnt_config) { +int peripherals_pcnt_init(pcnt_config_t pcnt_config) { // Look for available pcnt unit for (uint8_t i = 0; i<=3; i++) { if (pcnt_state[i] == PCNT_UNIT_INACTIVE) { - pcnt_config->unit = (pcnt_unit_t)i; + pcnt_config.unit = (pcnt_unit_t)i; pcnt_state[i] = PCNT_UNIT_ACTIVE; break; } else if (i == 3) { - mp_raise_RuntimeError(translate("All PCNT units in use")); + return -1; } } // Initialize PCNT unit - pcnt_unit_config(pcnt_config); + pcnt_unit_config(&pcnt_config); // Configure and enable the input filter - pcnt_set_filter_value(pcnt_config->unit, 100); - pcnt_filter_enable(pcnt_config->unit); + pcnt_set_filter_value(pcnt_config.unit, 100); + pcnt_filter_enable(pcnt_config.unit); // Initialize PCNT's counter - pcnt_counter_pause(pcnt_config->unit); - pcnt_counter_clear(pcnt_config->unit); + pcnt_counter_pause(pcnt_config.unit); + pcnt_counter_clear(pcnt_config.unit); // Everything is set up, now go to counting - pcnt_counter_resume(pcnt_config->unit); + pcnt_counter_resume(pcnt_config.unit); + + return pcnt_config.unit; } void peripherals_pcnt_deinit(pcnt_unit_t* unit) { diff --git a/ports/esp32s2/peripherals/pcnt.h b/ports/esp32s2/peripherals/pcnt.h index 64072501cb..abed80fd0c 100644 --- a/ports/esp32s2/peripherals/pcnt.h +++ b/ports/esp32s2/peripherals/pcnt.h @@ -29,7 +29,7 @@ #include "driver/pcnt.h" -extern void peripherals_pcnt_init(pcnt_config_t* pcnt_config); +extern int peripherals_pcnt_init(pcnt_config_t pcnt_config); extern void peripherals_pcnt_deinit(pcnt_unit_t* unit); #endif // MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PCNT_HANDLER_H From 8ce852e6523a51b419a28642732d5ad3813bdb88 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Wed, 4 Nov 2020 20:02:37 +0000 Subject: [PATCH 1285/1293] Translated using Weblate (Swedish) Currently translated at 100.0% (844 of 844 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 65cd9f6f1f..9182a99430 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: 2020-10-21 20:13-0500\n" -"PO-Revision-Date: 2020-11-01 16:26+0000\n" +"PO-Revision-Date: 2020-11-05 20:26+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.3.2-dev\n" +"X-Generator: Weblate 4.3.2\n" #: main.c msgid "" @@ -415,8 +415,8 @@ msgid "" "Auto-reload is on. Simply save files over USB to run them or enter REPL to " "disable.\n" msgstr "" -"Autoladdning är på. Spara bara filer via USB för att köra dem eller ange " -"REPL för att inaktivera.\n" +"Autoladdning är på. Spara filer via USB för att köra dem eller ange REPL för " +"att inaktivera.\n" #: ports/esp32s2/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" @@ -2220,7 +2220,7 @@ msgstr "kan bara ha upp till 4 parametrar att Xtensa assembly" #: py/persistentcode.c msgid "can only save bytecode" -msgstr "kan bara spara bytekod" +msgstr "kan bara spara bytecode" #: py/objtype.c msgid "can't add special method to already-subclassed class" From 93193f2f0b843fc8c052edecd362a1cdd7b30d5d Mon Sep 17 00:00:00 2001 From: sporeball Date: Fri, 6 Nov 2020 19:49:49 +0000 Subject: [PATCH 1286/1293] Translated using Weblate (Japanese) Currently translated at 71.8% (606 of 844 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ja/ --- locale/ja.po | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/locale/ja.po b/locale/ja.po index ae7e51ba6b..c9a85c1a23 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -8,15 +8,15 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-21 20:13-0500\n" -"PO-Revision-Date: 2020-09-25 18:20+0000\n" -"Last-Translator: Taku Fukada \n" +"PO-Revision-Date: 2020-11-06 20:29+0000\n" +"Last-Translator: sporeball \n" "Language-Team: none\n" "Language: ja\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.3-dev\n" +"X-Generator: Weblate 4.3.2\n" #: main.c msgid "" @@ -162,12 +162,12 @@ msgstr "'%s' にはラベルが必要" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a register" -msgstr "" +msgstr "'%s'にはレジスタが必要" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects a special register" -msgstr "" +msgstr "'%s'には特別レジスタが必要" #: py/emitinlinethumb.c #, c-format @@ -192,7 +192,7 @@ msgstr "" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects {r0, r1, ...}" -msgstr "" +msgstr "'%s'には{r0, r1, ...}が必要" #: py/emitinlinextensa.c #, c-format @@ -246,7 +246,7 @@ msgstr "'data'には整数の引数が必要" #: py/compile.c msgid "'label' requires 1 argument" -msgstr "" +msgstr "'label'には1つの引数が必要" #: py/compile.c msgid "'return' outside function" @@ -296,7 +296,7 @@ msgstr "address_typeが範囲外" #: ports/esp32s2/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" -msgstr "" +msgstr "全てのCAN周辺機器が使用中" #: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" @@ -821,19 +821,19 @@ msgstr "%qが必要" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c msgid "Expected a Characteristic" -msgstr "" +msgstr "Characteristicが必要" #: shared-bindings/_bleio/Adapter.c msgid "Expected a DigitalInOut" -msgstr "" +msgstr "DigitalInOutが必要" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" -msgstr "" +msgstr "Serviceが必要" #: shared-bindings/_bleio/Adapter.c msgid "Expected a UART" -msgstr "" +msgstr "UARTが必要" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c @@ -842,7 +842,7 @@ msgstr "UUIDが必要" #: shared-bindings/_bleio/Adapter.c msgid "Expected an Address" -msgstr "" +msgstr "Addressが必要" #: shared-module/_pixelbuf/PixelBuf.c #, c-format @@ -886,7 +886,7 @@ msgstr "%dバイトのRXバッファの確保に失敗" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" -msgstr "" +msgstr "Wi-Fiのメモリの確保に失敗" #: ports/esp32s2/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" @@ -1052,7 +1052,7 @@ msgstr "不正なBMPファイル" #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" -msgstr "" +msgstr "不正なBSSID" #: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c @@ -1103,7 +1103,7 @@ msgstr "フォーマットチャンクのサイズが不正" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "Invalid frequency" -msgstr "" +msgstr "不正な周波数" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" @@ -1338,11 +1338,11 @@ msgstr "long integerに対応していません" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more channels available" -msgstr "" +msgstr "使えるチャネルがもうありません" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more timers available" -msgstr "" +msgstr "使えるタイマーがもうありません" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." @@ -1658,7 +1658,7 @@ msgstr "" #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" -msgstr "" +msgstr "サイズは対応していません" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." From cb159569c23f71704b1787f8d6cabacedccca958 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Fri, 6 Nov 2020 21:29:26 +0100 Subject: [PATCH 1287/1293] 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/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/sv.po | 9 +++++++-- locale/zh_Latn_pinyin.po | 9 +++++++-- 16 files changed, 112 insertions(+), 32 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 7debab27ac..3e47dc9a18 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-10-10 23:51+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -300,6 +300,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Semua perangkat I2C sedang digunakan" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1130,7 +1134,8 @@ msgid "Invalid phase" msgstr "Fase tidak valid" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Pin tidak valid" diff --git a/locale/cs.po b/locale/cs.po index e4f677d8e2..428d6d1fe6 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -300,6 +300,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1113,7 +1117,8 @@ msgid "Invalid phase" msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 141a5e8c03..059d726cab 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -299,6 +299,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Alle I2C-Peripheriegeräte sind in Benutzung" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1130,7 +1134,8 @@ msgid "Invalid phase" msgstr "Ungültige Phase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Ungültiger Pin" diff --git a/locale/el.po b/locale/el.po index cc6da670cd..327f4dbe0f 100644 --- a/locale/el.po +++ b/locale/el.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -295,6 +295,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1108,7 +1112,8 @@ msgid "Invalid phase" msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "" diff --git a/locale/es.po b/locale/es.po index a750c80554..95d6a92ff5 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-11-01 16:26+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -303,6 +303,10 @@ msgstr "Todos los periféricos CAN están en uso" msgid "All I2C peripherals are in use" msgstr "Todos los periféricos I2C están siendo usados" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1131,7 +1135,8 @@ msgid "Invalid phase" msgstr "Fase inválida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Pin inválido" diff --git a/locale/fil.po b/locale/fil.po index 7bc33dba3e..ce3b5616a3 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -297,6 +297,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Lahat ng I2C peripherals ginagamit" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1123,7 +1127,8 @@ msgid "Invalid phase" msgstr "Mali ang phase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Mali ang pin" diff --git a/locale/fr.po b/locale/fr.po index 920e22cb0c..94ca1f21cf 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-10-22 20:48+0000\n" "Last-Translator: Antonin ENFRUN \n" "Language: fr\n" @@ -304,6 +304,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Tous les périphériques I2C sont utilisés" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1136,7 +1140,8 @@ msgid "Invalid phase" msgstr "Phase invalide" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Broche invalide" diff --git a/locale/hi.po b/locale/hi.po index 4966ad8e80..d87a1eb9ce 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -295,6 +295,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1108,7 +1112,8 @@ msgid "Invalid phase" msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 82840c8523..657c581cef 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -296,6 +296,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Tutte le periferiche I2C sono in uso" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1125,7 +1129,8 @@ msgid "Invalid phase" msgstr "Fase non valida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Pin non valido" diff --git a/locale/ja.po b/locale/ja.po index c9a85c1a23..7004c49f30 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-11-06 20:29+0000\n" "Last-Translator: sporeball \n" "Language-Team: none\n" @@ -302,6 +302,10 @@ msgstr "全てのCAN周辺機器が使用中" msgid "All I2C peripherals are in use" msgstr "全てのI2C周辺機器が使用中" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1123,7 +1127,8 @@ msgid "Invalid phase" msgstr "不正なphase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "不正なピン" diff --git a/locale/ko.po b/locale/ko.po index 858a036c83..4b302f3b9f 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-10-05 12:12+0000\n" "Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" @@ -298,6 +298,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "사용중인 모든 I2C주변 기기" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1113,7 +1117,8 @@ msgid "Invalid phase" msgstr "단계가 잘못되었습니다" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "핀이 잘못되었습니다" diff --git a/locale/nl.po b/locale/nl.po index bf05abb721..6851e6ef32 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-10-27 16:47+0000\n" "Last-Translator: Jelle Jager \n" "Language-Team: none\n" @@ -300,6 +300,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Alle I2C peripherals zijn in gebruik" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1125,7 +1129,8 @@ msgid "Invalid phase" msgstr "Ongeldige fase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Ongeldige pin" diff --git a/locale/pl.po b/locale/pl.po index 1dbb0ba12b..54ef4d9185 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-09-29 01:39+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -302,6 +302,10 @@ msgstr "" msgid "All I2C peripherals are in use" msgstr "Wszystkie peryferia I2C w użyciu" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1123,7 +1127,8 @@ msgid "Invalid phase" msgstr "Zła faza" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Zła nóżka" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 7ad85e0b78..ac5c7a6678 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-10-28 21:45+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -304,6 +304,10 @@ msgstr "Todos os periféricos CAN estão em uso" msgid "All I2C peripherals are in use" msgstr "Todos os periféricos I2C estão em uso" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1134,7 +1138,8 @@ msgid "Invalid phase" msgstr "Fase Inválida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Pino inválido" diff --git a/locale/sv.po b/locale/sv.po index 9182a99430..d9639aff6e 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-11-05 20:26+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -300,6 +300,10 @@ msgstr "All I2C-kringutrustning används" msgid "All I2C peripherals are in use" msgstr "All I2C-kringutrustning används" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1123,7 +1127,8 @@ msgid "Invalid phase" msgstr "Ogiltig fas" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Ogiltig pinne" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 4cc86400d9..c1853a73a5 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-21 20:13-0500\n" +"POT-Creation-Date: 2020-11-04 21:18+0530\n" "PO-Revision-Date: 2020-10-28 21:45+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -302,6 +302,10 @@ msgstr "suǒ yǒu CAN wài shè dōu zài shǐ yòng zhōng" msgid "All I2C peripherals are in use" msgstr "Suǒyǒu I2C wàiwéi qì zhèngzài shǐyòng" +#: ports/esp32s2/peripherals/pcnt_handler.c +msgid "All PCNT units in use" +msgstr "" + #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c @@ -1121,7 +1125,8 @@ msgid "Invalid phase" msgstr "Jiēduàn wúxiào" #: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Wúxiào de yǐn jiǎo" From b2e83952c026485866a7b5a830d85850b09abb38 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 6 Nov 2020 15:27:16 -0800 Subject: [PATCH 1288/1293] Rebrand EInk Portal to MagTag --- .../{adafruit_esp32s2_eink_portal => adafruit_magtag}/board.c | 0 .../mpconfigboard.h | 2 +- .../mpconfigboard.mk | 2 +- .../{adafruit_esp32s2_eink_portal => adafruit_magtag}/pins.c | 0 .../{adafruit_esp32s2_eink_portal => adafruit_magtag}/sdkconfig | 0 5 files changed, 2 insertions(+), 2 deletions(-) rename ports/esp32s2/boards/{adafruit_esp32s2_eink_portal => adafruit_magtag}/board.c (100%) rename ports/esp32s2/boards/{adafruit_esp32s2_eink_portal => adafruit_magtag}/mpconfigboard.h (97%) rename ports/esp32s2/boards/{adafruit_esp32s2_eink_portal => adafruit_magtag}/mpconfigboard.mk (92%) rename ports/esp32s2/boards/{adafruit_esp32s2_eink_portal => adafruit_magtag}/pins.c (100%) rename ports/esp32s2/boards/{adafruit_esp32s2_eink_portal => adafruit_magtag}/sdkconfig (100%) diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/board.c b/ports/esp32s2/boards/adafruit_magtag/board.c similarity index 100% rename from ports/esp32s2/boards/adafruit_esp32s2_eink_portal/board.c rename to ports/esp32s2/boards/adafruit_magtag/board.c diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.h b/ports/esp32s2/boards/adafruit_magtag/mpconfigboard.h similarity index 97% rename from ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.h rename to ports/esp32s2/boards/adafruit_magtag/mpconfigboard.h index 5a17a0cad1..be376e5a94 100644 --- a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.h +++ b/ports/esp32s2/boards/adafruit_magtag/mpconfigboard.h @@ -26,7 +26,7 @@ //Micropython setup -#define MICROPY_HW_BOARD_NAME "EInk Portal" +#define MICROPY_HW_BOARD_NAME "MagTag" #define MICROPY_HW_MCU_NAME "ESP32S2" #define MICROPY_HW_NEOPIXEL (&pin_GPIO1) diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.mk b/ports/esp32s2/boards/adafruit_magtag/mpconfigboard.mk similarity index 92% rename from ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.mk rename to ports/esp32s2/boards/adafruit_magtag/mpconfigboard.mk index 31aff57da4..0a141cbe3e 100644 --- a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/mpconfigboard.mk +++ b/ports/esp32s2/boards/adafruit_magtag/mpconfigboard.mk @@ -1,6 +1,6 @@ USB_VID = 0x239A USB_PID = 0x80E6 -USB_PRODUCT = "EInk Portal" +USB_PRODUCT = "MagTag" USB_MANUFACTURER = "Adafruit" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c b/ports/esp32s2/boards/adafruit_magtag/pins.c similarity index 100% rename from ports/esp32s2/boards/adafruit_esp32s2_eink_portal/pins.c rename to ports/esp32s2/boards/adafruit_magtag/pins.c diff --git a/ports/esp32s2/boards/adafruit_esp32s2_eink_portal/sdkconfig b/ports/esp32s2/boards/adafruit_magtag/sdkconfig similarity index 100% rename from ports/esp32s2/boards/adafruit_esp32s2_eink_portal/sdkconfig rename to ports/esp32s2/boards/adafruit_magtag/sdkconfig From 9ef23e8659d4ee58e3158c63f690108b411015a1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 6 Nov 2020 15:29:58 -0800 Subject: [PATCH 1289/1293] Fix build board list --- .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 404d2ea2e5..a2e9e92aba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -421,7 +421,7 @@ jobs: fail-fast: false matrix: board: - - "adafruit_esp32s2_eink_portal" + - "adafruit_magtag" - "adafruit_metro_esp32s2" - "electroniccats_bastwifi" - "espressif_kaluga_1" From 55e0e2c4ba7dfa1d3e2ba84a4af3b4f132ae1a23 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sun, 8 Nov 2020 11:12:32 +0530 Subject: [PATCH 1290/1293] Update rotaryio implementation --- .../common-hal/rotaryio/IncrementalEncoder.c | 79 ++++++------------- .../common-hal/rotaryio/IncrementalEncoder.h | 9 +-- 2 files changed, 29 insertions(+), 59 deletions(-) diff --git a/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c b/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c index bbff363740..25529ac723 100644 --- a/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries + * 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 @@ -25,29 +25,22 @@ */ #include "common-hal/rotaryio/IncrementalEncoder.h" +#include "common-hal/microcontroller/Pin.h" #include "py/runtime.h" #include "supervisor/shared/translate.h" -#include "driver/pcnt.h" +void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencoder_obj_t* self, + const mcu_pin_obj_t* pin_a, const mcu_pin_obj_t* pin_b) { + claim_pin(pin_a); + claim_pin(pin_b); -static void pcnt_reset(int unit) { - // Initialize PCNT's counter - pcnt_counter_pause(unit); - pcnt_counter_clear(unit); - - // Everything is set up, now go to counting - pcnt_counter_resume(unit); -} - -static void pcnt_init(int unit, rotaryio_incrementalencoder_obj_t* self) { // Prepare configuration for the PCNT unit - pcnt_config_t pcnt_config = { + const pcnt_config_t pcnt_config = { // Set PCNT input signal and control GPIOs - .pulse_gpio_num = self->pin_a->number, - .ctrl_gpio_num = self->pin_b->number, + .pulse_gpio_num = pin_a->number, + .ctrl_gpio_num = pin_b->number, .channel = PCNT_CHANNEL_0, - .unit = unit, // What to do on the positive / negative edge of pulse input? .pos_mode = PCNT_COUNT_DEC, // Count up on the positive edge .neg_mode = PCNT_COUNT_INC, // Keep the counter value on the negative edge @@ -55,61 +48,39 @@ static void pcnt_init(int unit, rotaryio_incrementalencoder_obj_t* self) { .lctrl_mode = PCNT_MODE_REVERSE, // Reverse counting direction if low .hctrl_mode = PCNT_MODE_KEEP, // Keep the primary counter mode if high }; - // Initialize PCNT unit - pcnt_unit_config(&pcnt_config); - // Configure channel 1 - pcnt_config.pulse_gpio_num = self->pin_b->number; - pcnt_config.ctrl_gpio_num = self->pin_a->number; - pcnt_config.channel = PCNT_CHANNEL_1; - pcnt_config.pos_mode = PCNT_COUNT_INC; - pcnt_config.neg_mode = PCNT_COUNT_DEC; - pcnt_unit_config(&pcnt_config); + // Initialize PCNT unit + const int8_t unit = peripherals_pcnt_init(pcnt_config); + if (unit == -1) { + mp_raise_RuntimeError(translate("All PCNT units in use")); + } - // Configure and enable the input filter - pcnt_set_filter_value(unit, 100); - pcnt_filter_enable(unit); - - pcnt_reset(unit); -} - -void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencoder_obj_t* self, - const mcu_pin_obj_t* pin_a, const mcu_pin_obj_t* pin_b) { - claim_pin(pin_a); - claim_pin(pin_b); - - self->pin_a = pin_a; - self->pin_b = pin_b; - - self->position = 0; - - pcnt_init(PCNT_UNIT_0, self); + self->pin_a = pin_a->number; + self->pin_b = pin_b->number; + self->unit = (pcnt_unit_t)unit; } bool common_hal_rotaryio_incrementalencoder_deinited(rotaryio_incrementalencoder_obj_t* self) { - return self->pin_a == NULL; + return self->unit == PCNT_UNIT_MAX; } void common_hal_rotaryio_incrementalencoder_deinit(rotaryio_incrementalencoder_obj_t* self) { if (common_hal_rotaryio_incrementalencoder_deinited(self)) { return; } - - reset_pin_number(self->pin_a->number); - self->pin_a = NULL; - - reset_pin_number(self->pin_b->number); - self->pin_b = NULL; + reset_pin_number(self->pin_a); + reset_pin_number(self->pin_b); + peripherals_pcnt_deinit(&self->unit); } mp_int_t common_hal_rotaryio_incrementalencoder_get_position(rotaryio_incrementalencoder_obj_t* self) { - int16_t count = 0; - pcnt_get_counter_value(PCNT_UNIT_0, &count); - return self->position+count; + int16_t count; + pcnt_get_counter_value(self->unit, &count); + return (count/2)+self->position; } void common_hal_rotaryio_incrementalencoder_set_position(rotaryio_incrementalencoder_obj_t* self, mp_int_t new_position) { self->position = new_position; - pcnt_reset(PCNT_UNIT_0); + pcnt_counter_clear(self->unit); } diff --git a/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.h b/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.h index 0cc2830fb7..8a717b7b5d 100644 --- a/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.h +++ b/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries + * 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 @@ -27,15 +27,14 @@ #ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H #define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H -#include "common-hal/microcontroller/Pin.h" - #include "py/obj.h" +#include "peripherals/pcnt.h" typedef struct { mp_obj_base_t base; - const mcu_pin_obj_t * pin_a; - const mcu_pin_obj_t * pin_b; + uint8_t pin_a, pin_b; mp_int_t position; + pcnt_unit_t unit; } rotaryio_incrementalencoder_obj_t; #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H From 7ba2c5772ccbe48c5c52d62493f9c899a1d0963a Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Sun, 8 Nov 2020 11:18:05 +0530 Subject: [PATCH 1291/1293] Update license --- ports/esp32s2/common-hal/touchio/TouchIn.c | 2 +- ports/esp32s2/common-hal/touchio/TouchIn.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/common-hal/touchio/TouchIn.c b/ports/esp32s2/common-hal/touchio/TouchIn.c index 3e3e4b5511..b44234775e 100644 --- a/ports/esp32s2/common-hal/touchio/TouchIn.c +++ b/ports/esp32s2/common-hal/touchio/TouchIn.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * 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 diff --git a/ports/esp32s2/common-hal/touchio/TouchIn.h b/ports/esp32s2/common-hal/touchio/TouchIn.h index 585bb37bf1..91de209316 100644 --- a/ports/esp32s2/common-hal/touchio/TouchIn.h +++ b/ports/esp32s2/common-hal/touchio/TouchIn.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Scott Shawcroft + * 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 From 5505a3649fe56738321e2138aa918d05d63da6b4 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Sat, 7 Nov 2020 10:04:39 +0000 Subject: [PATCH 1292/1293] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (845 of 845 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 ac5c7a6678..99f090dbd2 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: 2020-11-04 21:18+0530\n" -"PO-Revision-Date: 2020-10-28 21:45+0000\n" +"PO-Revision-Date: 2020-11-08 10:26+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.3.2-dev\n" +"X-Generator: Weblate 4.3.2\n" #: main.c msgid "" @@ -306,7 +306,7 @@ msgstr "Todos os periféricos I2C estão em uso" #: ports/esp32s2/peripherals/pcnt_handler.c msgid "All PCNT units in use" -msgstr "" +msgstr "Todas as unidades PCNT estão em uso" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c From d1f15d314bd630b073c70c093053c16ac34131bb Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 9 Nov 2020 15:03:22 -0800 Subject: [PATCH 1293/1293] Rename to include display details --- .github/workflows/build.yml | 2 +- .../{adafruit_magtag => adafruit_magtag_2.9_grayscale}/board.c | 0 .../mpconfigboard.h | 0 .../mpconfigboard.mk | 0 .../{adafruit_magtag => adafruit_magtag_2.9_grayscale}/pins.c | 0 .../sdkconfig | 0 6 files changed, 1 insertion(+), 1 deletion(-) rename ports/esp32s2/boards/{adafruit_magtag => adafruit_magtag_2.9_grayscale}/board.c (100%) rename ports/esp32s2/boards/{adafruit_magtag => adafruit_magtag_2.9_grayscale}/mpconfigboard.h (100%) rename ports/esp32s2/boards/{adafruit_magtag => adafruit_magtag_2.9_grayscale}/mpconfigboard.mk (100%) rename ports/esp32s2/boards/{adafruit_magtag => adafruit_magtag_2.9_grayscale}/pins.c (100%) rename ports/esp32s2/boards/{adafruit_magtag => adafruit_magtag_2.9_grayscale}/sdkconfig (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a2e9e92aba..c83f37e6ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -421,7 +421,7 @@ jobs: fail-fast: false matrix: board: - - "adafruit_magtag" + - "adafruit_magtag_2.9_grayscale" - "adafruit_metro_esp32s2" - "electroniccats_bastwifi" - "espressif_kaluga_1" diff --git a/ports/esp32s2/boards/adafruit_magtag/board.c b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/board.c similarity index 100% rename from ports/esp32s2/boards/adafruit_magtag/board.c rename to ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/board.c diff --git a/ports/esp32s2/boards/adafruit_magtag/mpconfigboard.h b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/adafruit_magtag/mpconfigboard.h rename to ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h diff --git a/ports/esp32s2/boards/adafruit_magtag/mpconfigboard.mk b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/adafruit_magtag/mpconfigboard.mk rename to ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk diff --git a/ports/esp32s2/boards/adafruit_magtag/pins.c b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c similarity index 100% rename from ports/esp32s2/boards/adafruit_magtag/pins.c rename to ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c diff --git a/ports/esp32s2/boards/adafruit_magtag/sdkconfig b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/sdkconfig similarity index 100% rename from ports/esp32s2/boards/adafruit_magtag/sdkconfig rename to ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/sdkconfig